allaw-ui 3.7.8 → 3.8.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/dist/components/atoms/buttons/PrimaryButton.js +3 -2
- package/dist/components/atoms/buttons/PrimaryButton.stories.d.ts +1 -0
- package/dist/components/atoms/buttons/PrimaryButton.stories.js +2 -0
- package/dist/components/atoms/selects/Select.js +1 -1
- package/dist/components/atoms/selects/Select.module.css +36 -10
- package/package.json +1 -1
|
@@ -71,7 +71,8 @@ var PrimaryButton = forwardRef(function (_a, ref) {
|
|
|
71
71
|
// Determine where to place additional icons
|
|
72
72
|
var hasStartIcon = startIcon || (startIconName && startIconName.trim() !== "");
|
|
73
73
|
var hasEndIcon = endIcon || (endIconName && endIconName.trim() !== "");
|
|
74
|
-
|
|
74
|
+
// Place additional icons at start if there's a start icon, otherwise at start by default
|
|
75
|
+
var shouldPlaceAtStart = hasStartIcon || !hasEndIcon;
|
|
75
76
|
useEffect(function () {
|
|
76
77
|
var interval = null;
|
|
77
78
|
if (isButtonLoading) {
|
|
@@ -123,7 +124,7 @@ var PrimaryButton = forwardRef(function (_a, ref) {
|
|
|
123
124
|
startIcon && (React.createElement("span", { className: "primary-button-icon ".concat(startIconName) })),
|
|
124
125
|
React.createElement("span", { className: "primary-button-label" }, label),
|
|
125
126
|
isButtonLoading ? (React.createElement("span", { className: "primary-button-loading-dots" }, loadingDots)) : (endIcon && React.createElement("span", { className: "primary-button-icon ".concat(endIconName) })),
|
|
126
|
-
!shouldPlaceAtStart &&
|
|
127
|
+
!shouldPlaceAtStart && renderAdditionalIcons()));
|
|
127
128
|
});
|
|
128
129
|
PrimaryButton.displayName = "PrimaryButton";
|
|
129
130
|
export default PrimaryButton;
|
|
@@ -117,4 +117,5 @@ export const WithAdditionalIconsStart: any;
|
|
|
117
117
|
export const WithAdditionalIconsEnd: any;
|
|
118
118
|
export const WithAdditionalIconsBoth: any;
|
|
119
119
|
export const LargeWithAdditionalIcons: any;
|
|
120
|
+
export const OnlyAdditionalIcons: any;
|
|
120
121
|
import PrimaryButton from "./PrimaryButton";
|
|
@@ -183,3 +183,5 @@ export var WithAdditionalIconsBoth = Template.bind({});
|
|
|
183
183
|
WithAdditionalIconsBoth.args = __assign(__assign({}, Default.args), { label: "Icônes Début et Fin", startIcon: true, endIcon: true, additionalIcons: [csvIcon, xlsxIcon] });
|
|
184
184
|
export var LargeWithAdditionalIcons = Template.bind({});
|
|
185
185
|
LargeWithAdditionalIcons.args = __assign(__assign({}, Default.args), { label: "Grand Bouton avec Icônes", startIcon: true, size: "large", additionalIcons: [csvIcon, xlsxIcon] });
|
|
186
|
+
export var OnlyAdditionalIcons = Template.bind({});
|
|
187
|
+
OnlyAdditionalIcons.args = __assign(__assign({}, Default.args), { label: "Seulement Icônes Supplémentaires", startIcon: false, endIcon: false, additionalIcons: [csvIcon, xlsxIcon] });
|
|
@@ -232,7 +232,7 @@ function Select(_a, ref) {
|
|
|
232
232
|
: !Array.isArray(selected) && selected
|
|
233
233
|
? (_b = items.find(function (item) { return item.value === selected; })) === null || _b === void 0 ? void 0 : _b.label
|
|
234
234
|
: placeholder),
|
|
235
|
-
React.createElement("
|
|
235
|
+
React.createElement("i", { className: "".concat(styles.selectIcon, " allaw-icon-chevron-down ").concat(isOpen ? styles.chevronUp : styles.chevronDown) })),
|
|
236
236
|
isOpen && ReactDOM.createPortal(renderList(), document.body),
|
|
237
237
|
isRequired && showError && error && (React.createElement("div", { className: styles.errorMessage },
|
|
238
238
|
React.createElement(TinyInfo, { variant: "medium12", color: "actions-error", text: error })))));
|
|
@@ -6,19 +6,28 @@
|
|
|
6
6
|
.select {
|
|
7
7
|
display: flex;
|
|
8
8
|
justify-content: space-between;
|
|
9
|
-
align-items:
|
|
10
|
-
gap:
|
|
11
|
-
border-radius:
|
|
12
|
-
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 8px;
|
|
11
|
+
border-radius: 10px;
|
|
12
|
+
border: 2px solid var(--grey-venom, #e6edf5);
|
|
13
|
+
background: var(--Primary-Blanc, #fff);
|
|
13
14
|
cursor: pointer;
|
|
15
|
+
outline: none;
|
|
16
|
+
font-family: "Open Sans";
|
|
17
|
+
font-size: 16px;
|
|
18
|
+
font-style: normal;
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
line-height: normal;
|
|
21
|
+
color: var(--Primary-Mid-black, var(--primary-black, #171e25));
|
|
22
|
+
width: 100%;
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
.select:hover {
|
|
17
|
-
|
|
26
|
+
border-color: var(--venom-grey-dark, #d1dce8);
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
.select:focus {
|
|
21
|
-
|
|
30
|
+
border-color: var(--venom-grey-dark, #d1dce8);
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
.selectText {
|
|
@@ -45,6 +54,20 @@
|
|
|
45
54
|
align-items: center;
|
|
46
55
|
justify-content: center;
|
|
47
56
|
padding-top: 2px;
|
|
57
|
+
transition: transform 0.3s ease-in-out;
|
|
58
|
+
color: var(--venom-grey-dark, #d1dce8);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.selectIcon:hover {
|
|
62
|
+
color: var(--mid-grey, #728ea7);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.chevronDown {
|
|
66
|
+
transform: rotate(0deg);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.chevronUp {
|
|
70
|
+
transform: rotate(180deg);
|
|
48
71
|
}
|
|
49
72
|
|
|
50
73
|
.selectList {
|
|
@@ -55,8 +78,8 @@
|
|
|
55
78
|
display: flex;
|
|
56
79
|
flex-direction: column;
|
|
57
80
|
background: #fff;
|
|
58
|
-
border-radius:
|
|
59
|
-
padding:
|
|
81
|
+
border-radius: 12px;
|
|
82
|
+
padding: 3px 5px;
|
|
60
83
|
color: var(--Primary-Mid-black, var(--primary-black, #171e25));
|
|
61
84
|
font-family: "Open Sans";
|
|
62
85
|
font-size: 14px;
|
|
@@ -75,13 +98,15 @@
|
|
|
75
98
|
.selectItem {
|
|
76
99
|
display: flex;
|
|
77
100
|
align-items: center;
|
|
78
|
-
padding: 8px
|
|
101
|
+
padding: 8px 12px;
|
|
102
|
+
margin: 2px 0;
|
|
79
103
|
cursor: pointer;
|
|
80
104
|
width: 100%;
|
|
81
105
|
}
|
|
82
106
|
|
|
83
107
|
.selectItem:hover {
|
|
84
108
|
background: var(--grey-venom, #e6edf5);
|
|
109
|
+
border-radius: 8px;
|
|
85
110
|
}
|
|
86
111
|
|
|
87
112
|
.selectItem .selectItemIcon {
|
|
@@ -116,6 +141,7 @@
|
|
|
116
141
|
|
|
117
142
|
.selectItem.highlighted {
|
|
118
143
|
background-color: var(--venom-grey-dark, #d1dce8);
|
|
144
|
+
border-radius: 8px;
|
|
119
145
|
}
|
|
120
146
|
|
|
121
147
|
.tagContainer {
|
|
@@ -152,7 +178,7 @@
|
|
|
152
178
|
}
|
|
153
179
|
|
|
154
180
|
.selectMultiple {
|
|
155
|
-
padding:
|
|
181
|
+
padding: 8px 16px;
|
|
156
182
|
}
|
|
157
183
|
|
|
158
184
|
.selectSingle {
|