datastake-daf 0.6.168 → 0.6.170
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/components/index.js +256 -130
- package/package.json +1 -1
- package/src/@daf/core/components/AvatarGroup/AvatarGroup.stories.jsx +1 -1
- package/src/@daf/core/components/Badge/Badge.stories.js +98 -94
- package/src/@daf/core/components/Dashboard/Widget/CarouselWidget/CarouselWidget.stories.js +42 -0
- package/src/@daf/core/components/Dashboard/Widget/CarouselWidget/index.jsx +72 -0
- package/src/@daf/core/components/Dashboard/Widget/ImageCarousel/ImageCarousel.stories.js +93 -0
- package/src/@daf/core/components/Dashboard/Widget/ImageCarousel/index.jsx +132 -0
- package/src/@daf/core/components/Dashboard/Widget/ProjectWidget/ProjectWidget.stories.jsx +0 -3
- package/src/@daf/core/components/Dashboard/Widget/ProjectWidget/components/SdgList.jsx +9 -77
- package/src/@daf/core/components/Dashboard/Widget/ProjectWidget/index.jsx +78 -80
- package/src/@daf/core/components/Dashboard/Widget/ProjectWidget/style.js +47 -74
- package/src/@daf/core/components/EditForm/_index.scss +3 -3
- package/src/@daf/core/components/Icon/CustomIcon.stories.js +177 -179
- package/src/@daf/core/components/ProgressBar/MultiBarProgress/MultibarProgress.stories.jsx +48 -41
- package/src/@daf/core/components/ProgressBar/Progress.stories.jsx +31 -31
- package/src/@daf/core/components/Segment/Segment.stories.js +70 -64
- package/src/@daf/core/components/UI/SDGIcon/SGDIcon.stories.jsx +55 -0
- package/src/@daf/core/components/UI/SDGIcon/index.jsx +100 -0
- package/src/@daf/core/components/UI/SDGIcon/styles.js +26 -0
- package/src/@daf/core/components/ViewForm/_index.scss +1 -1
- package/src/index.js +2 -0
- package/src/@daf/core/components/Icon/Icon.stories.js +0 -27
|
@@ -8,204 +8,202 @@ import { copyToClipboard } from "../../../../helpers/copyToClipboard";
|
|
|
8
8
|
const configKeys = Object.keys(config);
|
|
9
9
|
|
|
10
10
|
const groupIconsByTag = () => {
|
|
11
|
-
|
|
11
|
+
const groupedIcons = {};
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
configKeys.forEach((iconName) => {
|
|
14
|
+
const iconConfig = config[iconName];
|
|
15
|
+
const tags = iconConfig.tag || ["other"];
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
tags.forEach((tag) => {
|
|
18
|
+
if (!groupedIcons[tag]) {
|
|
19
|
+
groupedIcons[tag] = [];
|
|
20
|
+
}
|
|
21
|
+
groupedIcons[tag].push(iconName);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
return groupedIcons;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const groupedIcons = groupIconsByTag();
|
|
29
29
|
|
|
30
30
|
const groupOptions = Object.keys(groupedIcons).map((tag) => ({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
label:
|
|
32
|
+
tag === "other"
|
|
33
|
+
? "General Icons"
|
|
34
|
+
: `${tag.charAt(0).toUpperCase() + tag.slice(1)} Icons`,
|
|
35
|
+
value: tag,
|
|
34
36
|
}));
|
|
35
37
|
|
|
36
38
|
export default {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
title: "Components/Icon",
|
|
40
|
+
component: CustomIcon,
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
decorators: [
|
|
43
|
+
() => {
|
|
44
|
+
const [selectedGroups, setSelectedGroups] = useState([]);
|
|
45
|
+
const [copiedIcon, setCopiedIcon] = useState(null);
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
const handleGroupSelectionChange = (selectedValues) => {
|
|
48
|
+
setSelectedGroups(selectedValues);
|
|
49
|
+
};
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
const handleIconClick = (iconName) => {
|
|
52
|
+
const tempInput = document.createElement("input");
|
|
53
|
+
tempInput.value = iconName;
|
|
54
|
+
tempInput.id = "temp-copy-input";
|
|
55
|
+
tempInput.style.position = "absolute";
|
|
56
|
+
tempInput.style.left = "-9999px";
|
|
57
|
+
document.body.appendChild(tempInput);
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
const success = copyToClipboard("temp-copy-input");
|
|
60
|
+
document.body.removeChild(tempInput);
|
|
59
61
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
if (success) {
|
|
63
|
+
setCopiedIcon(iconName);
|
|
64
|
+
setTimeout(() => setCopiedIcon(null), 2000);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
const filteredGroupedIcons = {};
|
|
69
|
+
Object.entries(groupedIcons).forEach(([tag, icons]) => {
|
|
70
|
+
if (selectedGroups.length === 0 || selectedGroups.includes(tag)) {
|
|
71
|
+
filteredGroupedIcons[tag] = icons;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
</div>
|
|
198
|
-
);
|
|
199
|
-
},
|
|
200
|
-
],
|
|
75
|
+
return (
|
|
76
|
+
<div style={{ margin: "3em" }}>
|
|
77
|
+
<ThemeLayout>
|
|
78
|
+
<div style={{ marginBottom: 30 }}>
|
|
79
|
+
<h3
|
|
80
|
+
style={{
|
|
81
|
+
marginBottom: 15,
|
|
82
|
+
fontSize: "1.1rem",
|
|
83
|
+
fontWeight: "500",
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
Filter Icon Groups
|
|
87
|
+
</h3>
|
|
88
|
+
<Multiselect
|
|
89
|
+
options={groupOptions}
|
|
90
|
+
defaultSelected={selectedGroups}
|
|
91
|
+
onChange={handleGroupSelectionChange}
|
|
92
|
+
textWhenMultiple={`${selectedGroups.length} groups selected`}
|
|
93
|
+
withCount={true}
|
|
94
|
+
placeholder="Select icon groups to display (leave empty to show all)..."
|
|
95
|
+
style={{ width: "100%" }}
|
|
96
|
+
showSearch={true}
|
|
97
|
+
selectionType="checkbox"
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
<div style={{ display: "flex", flexDirection: "column", gap: 40 }}>
|
|
101
|
+
{Object.entries(filteredGroupedIcons).map(([tag, icons]) => (
|
|
102
|
+
<div key={tag}>
|
|
103
|
+
<h2
|
|
104
|
+
style={{
|
|
105
|
+
marginBottom: 20,
|
|
106
|
+
padding: "10px 0",
|
|
107
|
+
borderBottom: "2px solid #e0e0e0",
|
|
108
|
+
textTransform: "capitalize",
|
|
109
|
+
fontSize: "1.5rem",
|
|
110
|
+
fontWeight: "600",
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
{tag === "other" ? "General Icons" : `${tag} Icons`}
|
|
114
|
+
</h2>
|
|
115
|
+
<div
|
|
116
|
+
style={{
|
|
117
|
+
display: "grid",
|
|
118
|
+
gridTemplateColumns:
|
|
119
|
+
"repeat(auto-fill, minmax(120px, 1fr))",
|
|
120
|
+
gap: 20,
|
|
121
|
+
}}
|
|
122
|
+
>
|
|
123
|
+
{icons.map((iconName) => (
|
|
124
|
+
<div
|
|
125
|
+
key={iconName}
|
|
126
|
+
onClick={() => handleIconClick(iconName)}
|
|
127
|
+
style={{
|
|
128
|
+
display: "flex",
|
|
129
|
+
flexDirection: "column",
|
|
130
|
+
alignItems: "center",
|
|
131
|
+
padding: "15px",
|
|
132
|
+
border: "1px solid #f0f0f0",
|
|
133
|
+
borderRadius: "8px",
|
|
134
|
+
backgroundColor:
|
|
135
|
+
copiedIcon === iconName ? "#e8f5e8" : "#fafafa",
|
|
136
|
+
cursor: "pointer",
|
|
137
|
+
transition: "all 0.2s ease",
|
|
138
|
+
position: "relative",
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
<div
|
|
142
|
+
style={{
|
|
143
|
+
display: "flex",
|
|
144
|
+
justifyContent: "center",
|
|
145
|
+
alignItems: "center",
|
|
146
|
+
width: "45px",
|
|
147
|
+
height: "45px",
|
|
148
|
+
marginBottom: 8,
|
|
149
|
+
}}
|
|
150
|
+
>
|
|
151
|
+
<CustomIcon name={iconName} size={28} color="black" />
|
|
152
|
+
</div>
|
|
153
|
+
<p
|
|
154
|
+
style={{
|
|
155
|
+
textAlign: "center",
|
|
156
|
+
fontSize: "0.8rem",
|
|
157
|
+
margin: 0,
|
|
158
|
+
wordBreak: "break-word",
|
|
159
|
+
lineHeight: "1.2",
|
|
160
|
+
color:
|
|
161
|
+
copiedIcon === iconName ? "#4CAF50" : "inherit",
|
|
162
|
+
fontWeight:
|
|
163
|
+
copiedIcon === iconName ? "600" : "normal",
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
{iconName}
|
|
167
|
+
</p>
|
|
168
|
+
{copiedIcon === iconName && (
|
|
169
|
+
<div
|
|
170
|
+
style={{
|
|
171
|
+
position: "absolute",
|
|
172
|
+
top: "5px",
|
|
173
|
+
right: "5px",
|
|
174
|
+
backgroundColor: "#4CAF50",
|
|
175
|
+
color: "white",
|
|
176
|
+
borderRadius: "50%",
|
|
177
|
+
width: "20px",
|
|
178
|
+
height: "20px",
|
|
179
|
+
display: "flex",
|
|
180
|
+
alignItems: "center",
|
|
181
|
+
justifyContent: "center",
|
|
182
|
+
fontSize: "12px",
|
|
183
|
+
}}
|
|
184
|
+
>
|
|
185
|
+
✓
|
|
186
|
+
</div>
|
|
187
|
+
)}
|
|
188
|
+
</div>
|
|
189
|
+
))}
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
))}
|
|
193
|
+
</div>
|
|
194
|
+
</ThemeLayout>
|
|
195
|
+
</div>
|
|
196
|
+
);
|
|
197
|
+
},
|
|
198
|
+
],
|
|
201
199
|
};
|
|
202
200
|
|
|
203
201
|
export const Primary = {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
202
|
+
name: "Warning Icon",
|
|
203
|
+
args: {
|
|
204
|
+
name: "Warning",
|
|
205
|
+
fill: "white",
|
|
206
|
+
width: 20,
|
|
207
|
+
height: 20,
|
|
208
|
+
},
|
|
211
209
|
};
|
|
@@ -2,51 +2,58 @@ import ProgressBar from "./index";
|
|
|
2
2
|
import ThemeLayout from "../../ThemeLayout";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
title: "Components/Progress/MultiBar Progress",
|
|
6
|
+
component: ProgressBar,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
decorators: [
|
|
9
|
+
(Story) => (
|
|
10
|
+
<div style={{ margin: "3em" }}>
|
|
11
|
+
<ThemeLayout>
|
|
12
|
+
<Story />
|
|
13
|
+
</ThemeLayout>
|
|
14
|
+
</div>
|
|
15
|
+
),
|
|
16
|
+
],
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const Primary = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
name: "Default",
|
|
21
|
+
args: {
|
|
22
|
+
config: [
|
|
23
|
+
{ percentage: 30, color: "#FF99C3" },
|
|
24
|
+
{ percentage: 20, color: "#5AD8A6", placement: "bottom" },
|
|
25
|
+
{ percentage: 10, color: "#F6BD16" },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
render: (args) => (
|
|
29
|
+
<div>
|
|
30
|
+
<ProgressBar {...args} />
|
|
31
|
+
</div>
|
|
32
|
+
),
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
export const CustomTooltip = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
name: "Custom Tooltip",
|
|
37
|
+
args: {
|
|
38
|
+
config: [
|
|
39
|
+
{ percentage: 30, color: "#FF99C3", tooltipTitle: "Red LABEL" },
|
|
40
|
+
{
|
|
41
|
+
percentage: 20,
|
|
42
|
+
color: "#5AD8A6",
|
|
43
|
+
tooltipTitle: "Blue LABEL",
|
|
44
|
+
placement: "bottom",
|
|
45
|
+
},
|
|
46
|
+
{ percentage: 10, color: "#F6BD16", tooltipTitle: "Green LABEL" },
|
|
47
|
+
],
|
|
48
|
+
renderTooltip: (item) => (
|
|
49
|
+
<div
|
|
50
|
+
style={{ color: item.color }}
|
|
51
|
+
>{`${item.tooltipTitle} ${item.percentage}%`}</div>
|
|
52
|
+
),
|
|
53
|
+
},
|
|
54
|
+
render: (args) => (
|
|
55
|
+
<div>
|
|
56
|
+
<ProgressBar {...args} />
|
|
57
|
+
</div>
|
|
58
|
+
),
|
|
52
59
|
};
|
|
@@ -2,38 +2,38 @@ import ProgressBar from "./index";
|
|
|
2
2
|
import ThemeLayout from "../ThemeLayout";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
5
|
+
title: "Components/Progress/Single Progress Bar",
|
|
6
|
+
component: ProgressBar,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
args: {
|
|
9
|
+
percentage: 50,
|
|
10
|
+
isSubmitted: true,
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
percentage: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "range",
|
|
16
|
+
min: 0,
|
|
17
|
+
max: 100,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
decorators: [
|
|
22
|
+
(Story) => (
|
|
23
|
+
<div style={{ margin: "3em" }}>
|
|
24
|
+
<ThemeLayout>
|
|
25
|
+
<Story />
|
|
26
|
+
</ThemeLayout>
|
|
27
|
+
</div>
|
|
28
|
+
),
|
|
29
|
+
],
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export const Primary = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
name: "Default",
|
|
34
|
+
render: (args) => (
|
|
35
|
+
<div>
|
|
36
|
+
<ProgressBar {...args} />
|
|
37
|
+
</div>
|
|
38
|
+
),
|
|
39
39
|
};
|