allaw-ui 3.8.1 → 3.8.3

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.
@@ -14,6 +14,7 @@ export interface SelectProps<T extends string | string[]> {
14
14
  width?: number;
15
15
  maxItems?: number;
16
16
  requireAttention?: boolean;
17
+ disabledItems?: string[];
17
18
  onChange?: (selected: T) => void;
18
19
  onError?: (error: string) => void;
19
20
  }
@@ -14,21 +14,21 @@ import "../../../styles/global.css";
14
14
  import TinyInfo from "../typography/TinyInfo";
15
15
  function Select(_a, ref) {
16
16
  var _b;
17
- var items = _a.items, selectedItem = _a.selectedItem, _c = _a.placeholder, placeholder = _c === void 0 ? "Choisir..." : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, _f = _a.showError, showError = _f === void 0 ? false : _f, _g = _a.width, width = _g === void 0 ? 100 : _g, maxItems = _a.maxItems, _h = _a.requireAttention, requireAttention = _h === void 0 ? false : _h, onChange = _a.onChange, onError = _a.onError;
18
- var _j = useState(false), isOpen = _j[0], setIsOpen = _j[1];
19
- var _k = useState((multiple ? selectedItem || [] : selectedItem || "")), selected = _k[0], setSelected = _k[1];
20
- var _l = useState(""), error = _l[0], setError = _l[1];
17
+ var items = _a.items, selectedItem = _a.selectedItem, _c = _a.placeholder, placeholder = _c === void 0 ? "Choisir..." : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, _f = _a.showError, showError = _f === void 0 ? false : _f, _g = _a.width, width = _g === void 0 ? 100 : _g, maxItems = _a.maxItems, _h = _a.requireAttention, requireAttention = _h === void 0 ? false : _h, _j = _a.disabledItems, disabledItems = _j === void 0 ? [] : _j, onChange = _a.onChange, onError = _a.onError;
18
+ var _k = useState(false), isOpen = _k[0], setIsOpen = _k[1];
19
+ var _l = useState((multiple ? selectedItem || [] : selectedItem || "")), selected = _l[0], setSelected = _l[1];
20
+ var _m = useState(""), error = _m[0], setError = _m[1];
21
21
  var selectRef = useRef(null);
22
22
  var listRef = useRef(null);
23
23
  var tagContainerRef = useRef(null);
24
- var _m = useState([]), visibleTags = _m[0], setVisibleTags = _m[1];
25
- var _o = useState(0), hiddenCount = _o[0], setHiddenCount = _o[1];
26
- var _p = useState({
24
+ var _o = useState([]), visibleTags = _o[0], setVisibleTags = _o[1];
25
+ var _p = useState(0), hiddenCount = _p[0], setHiddenCount = _p[1];
26
+ var _q = useState({
27
27
  top: 0,
28
28
  left: 0,
29
29
  width: 0,
30
- }), listPosition = _p[0], setListPosition = _p[1];
31
- var _q = useState("bottom"), placement = _q[0], setPlacement = _q[1];
30
+ }), listPosition = _q[0], setListPosition = _q[1];
31
+ var _r = useState("bottom"), placement = _r[0], setPlacement = _r[1];
32
32
  useEffect(function () {
33
33
  setSelected((multiple ? selectedItem || [] : selectedItem || ""));
34
34
  }, [selectedItem, multiple]);
@@ -207,11 +207,16 @@ function Select(_a, ref) {
207
207
  left: "".concat(listPosition.left, "px"),
208
208
  width: "".concat(listPosition.width, "px"),
209
209
  margin: placement === "bottom" ? "4px 0 0 0" : "0 0 4px 0",
210
- } }, items.map(function (item) { return (React.createElement("div", { key: item.value, "data-value": item.value, className: "".concat(styles.selectItem, " ").concat(Array.isArray(selected) && selected.includes(item.value)
211
- ? styles.selected
212
- : "", " ").concat(!multiple && item.value === selectedItem ? styles.highlighted : "", " ").concat(!multiple ? styles.singleSelect : ""), onClick: function () { return handleSelect(item); } },
213
- multiple && React.createElement("span", { className: styles.selectItemIcon }),
214
- React.createElement("span", { className: styles.selectItemText }, item.label))); }))); };
210
+ } }, items.map(function (item) {
211
+ var isDisabled = disabledItems.includes(item.value);
212
+ var isSelected = Array.isArray(selected)
213
+ ? selected.includes(item.value)
214
+ : item.value === selectedItem;
215
+ var isHighlighted = !multiple && item.value === selectedItem;
216
+ return (React.createElement("div", { key: item.value, "data-value": item.value, className: "".concat(styles.selectItem, " ").concat(isSelected ? styles.selected : "", " ").concat(isHighlighted ? styles.highlighted : "", " ").concat(!multiple ? styles.singleSelect : "", " ").concat(isDisabled ? styles.disabledItem : ""), onClick: function () { return !isDisabled && handleSelect(item); }, "aria-disabled": isDisabled },
217
+ multiple && React.createElement("span", { className: styles.selectItemIcon }),
218
+ React.createElement("span", { className: styles.selectItemText }, item.label)));
219
+ }))); };
215
220
  var renderTags = function (selectedValues) {
216
221
  if (!selectedValues.length)
217
222
  return null;
@@ -144,6 +144,16 @@
144
144
  border-radius: 8px;
145
145
  }
146
146
 
147
+ .disabledItem {
148
+ color: var(--mid-grey) !important;
149
+ opacity: 0.5;
150
+ cursor: not-allowed;
151
+ }
152
+
153
+ .disabledItem:hover {
154
+ background: transparent !important;
155
+ }
156
+
147
157
  .tagContainer {
148
158
  display: flex;
149
159
  flex-wrap: nowrap;
@@ -54,20 +54,27 @@ declare namespace _default {
54
54
  }
55
55
  export { control_6 as control };
56
56
  }
57
+ namespace disabledItems {
58
+ export namespace control_7 {
59
+ let type_7: string;
60
+ export { type_7 as type };
61
+ }
62
+ export { control_7 as control };
63
+ }
57
64
  namespace onChange {
58
65
  namespace table {
59
66
  let disable: boolean;
60
67
  }
61
68
  }
62
69
  namespace width {
63
- export namespace control_7 {
64
- let type_7: string;
65
- export { type_7 as type };
70
+ export namespace control_8 {
71
+ let type_8: string;
72
+ export { type_8 as type };
66
73
  let min_1: number;
67
74
  export { min_1 as min };
68
75
  export let max: number;
69
76
  }
70
- export { control_7 as control };
77
+ export { control_8 as control };
71
78
  }
72
79
  }
73
80
  export namespace parameters {
@@ -100,4 +107,6 @@ export const Multiple: any;
100
107
  export const Required: any;
101
108
  export const CustomWidth: any;
102
109
  export const RequireAttention: any;
110
+ export const WithDisabledItems: any;
111
+ export const MultipleWithDisabledItems: any;
103
112
  import Select from "./Select";
@@ -56,6 +56,11 @@ export default {
56
56
  min: 1,
57
57
  },
58
58
  },
59
+ disabledItems: {
60
+ control: {
61
+ type: "array",
62
+ },
63
+ },
59
64
  onChange: {
60
65
  table: {
61
66
  disable: true,
@@ -185,3 +190,40 @@ RequireAttention.args = {
185
190
  requireAttention: true,
186
191
  width: 100,
187
192
  };
193
+ export var WithDisabledItems = Template.bind({});
194
+ WithDisabledItems.args = {
195
+ items: [
196
+ { label: "Lundi 12 août", value: "lundi-12-aout" },
197
+ { label: "Mardi 13 août", value: "mardi-13-aout" },
198
+ { label: "Mercredi 14 août", value: "mercredi-14-aout" },
199
+ { label: "Jeudi 15 août", value: "jeudi-15-aout" },
200
+ { label: "Vendredi 16 août", value: "vendredi-16-aout" },
201
+ { label: "Samedi 17 août", value: "samedi-17-aout" },
202
+ ],
203
+ selectedItem: "",
204
+ placeholder: "Sélectionner une option...",
205
+ multiple: false,
206
+ isRequired: false,
207
+ requireAttention: false,
208
+ disabledItems: ["mardi-13-aout", "jeudi-15-aout"],
209
+ width: 100,
210
+ };
211
+ export var MultipleWithDisabledItems = Template.bind({});
212
+ MultipleWithDisabledItems.args = {
213
+ items: [
214
+ { label: "Lundi 12 août", value: "lundi-12-aout" },
215
+ { label: "Mardi 13 août", value: "mardi-13-aout" },
216
+ { label: "Mercredi 14 août", value: "mercredi-14-aout" },
217
+ { label: "Jeudi 15 août", value: "jeudi-15-aout" },
218
+ { label: "Vendredi 16 août", value: "vendredi-16-aout" },
219
+ { label: "Samedi 17 août", value: "samedi-17-aout" },
220
+ ],
221
+ selectedItem: [],
222
+ placeholder: "Sélectionner des options...",
223
+ multiple: true,
224
+ isRequired: false,
225
+ requireAttention: false,
226
+ disabledItems: ["mardi-13-aout", "vendredi-16-aout"],
227
+ maxItems: 4,
228
+ width: 100,
229
+ };
@@ -10,25 +10,40 @@
10
10
  justify-content: space-between;
11
11
  align-items: flex-start;
12
12
  flex-shrink: 0;
13
- border-radius: 8px;
14
- background: var(--Primary-Blanc, #fff);
15
- box-shadow: 0px 1px 9px 0px rgba(15, 133, 168, 0.08);
13
+ border-radius: 18px;
14
+ background: rgba(255, 255, 255, 0.18);
15
+ box-shadow: 0 2px 8px 0 rgba(37, 190, 235, 0.07), 0 1px 3px 0 rgba(114, 142, 167, 0.04);
16
16
  cursor: pointer;
17
- transition: all 0.15s ease;
17
+ transition: all 0.18s cubic-bezier(0.4, 0.2, 0.2, 1);
18
18
  width: 100%;
19
- border: 2px solid var(--grey-venom, #e6edf5);
20
- /* border: 1px solid var(-grey-venom, #e6edf5); */
19
+ border: 1px solid rgba(200, 220, 235, 0.25);
20
+ backdrop-filter: blur(6px) saturate(140%);
21
+ -webkit-backdrop-filter: blur(6px) saturate(140%);
22
+ position: relative;
23
+ overflow: hidden;
24
+ }
25
+
26
+ .case-card-wrapper::before {
27
+ content: "";
28
+ position: absolute;
29
+ inset: 0;
30
+ border-radius: 18px;
31
+ pointer-events: none;
32
+ border: 1px solid rgba(255,255,255,0.10);
33
+ z-index: 1;
21
34
  }
22
35
 
23
36
  .case-card-wrapper:hover {
24
- box-shadow: 0px 4px 12px rgba(15, 133, 168, 0.12);
25
- transform: scale(1.01);
26
- border: 2px solid var(--bleu-allaw, #25beeb);
37
+ box-shadow: 0 6px 18px 0 rgba(37, 190, 235, 0.13), 0 2px 8px 0 rgba(114, 142, 167, 0.08);
38
+ transform: scale(1.01) translateY(-2px);
39
+ border: 1.5px solid var(--bleu-allaw, #25beeb);
40
+ background: rgba(255,255,255,0.28);
27
41
  }
28
42
 
29
43
  .case-card-wrapper:active {
30
- transform: scale(1.015);
31
- background-color: var(--grey-light), #f6fcfe;
44
+ transform: scale(1.01);
45
+ background: rgba(246, 252, 254, 0.45);
46
+ border: 1.5px solid var(--bleu-allaw, #25beeb);
32
47
  }
33
48
 
34
49
  .case-card-wrapper.case-card-mobile,
@@ -44,6 +59,8 @@
44
59
  align-self: stretch;
45
60
  width: calc(100% - 100px);
46
61
  overflow: hidden;
62
+ position: relative;
63
+ z-index: 2;
47
64
  }
48
65
 
49
66
  .case-card-header {
@@ -56,12 +73,13 @@
56
73
  }
57
74
 
58
75
  .case-card-client-name {
59
- color: var(--Tags-Mid-grey, var(--light-grey, #728ea7));
76
+ color: var(--mid-grey, #728ea7);
60
77
  font-family: "Open Sans", sans-serif;
61
78
  font-size: 12px;
62
79
  font-weight: 400;
63
80
  line-height: 15px;
64
81
  letter-spacing: 0.3px;
82
+ text-shadow: 0 1px 2px rgba(255,255,255,0.5);
65
83
  }
66
84
 
67
85
  .case-card-title {
@@ -69,14 +87,15 @@
69
87
  overflow: hidden;
70
88
  text-overflow: ellipsis;
71
89
  white-space: nowrap;
72
- color: var(--dark-grey, #171e25);
90
+ color: var(--noir, #171e25);
73
91
  font-family: Inter, sans-serif;
74
- font-size: 17px;
75
- font-weight: 600;
92
+ font-size: 18px;
93
+ font-weight: 700;
76
94
  line-height: 1.2;
77
95
  letter-spacing: 0.1px;
78
96
  padding-top: 4px;
79
97
  margin: 0;
98
+ text-shadow: 0 1px 2px rgba(255,255,255,0.4);
80
99
  }
81
100
 
82
101
  .case-card-title.closed {
@@ -91,27 +110,28 @@
91
110
  height: 100%;
92
111
  min-width: 100px;
93
112
  flex-shrink: 0;
113
+ position: relative;
114
+ z-index: 2;
94
115
  }
95
116
 
96
117
  .case-card-next-appointment-label {
97
- color: var(--Primary-Mid-black, var(--primary-black, #171e25));
118
+ color: var(--dark-grey, #456073);
98
119
  font-family: "Open Sans", sans-serif;
99
120
  font-size: 12px;
100
121
  font-weight: 400;
101
122
  line-height: normal;
102
123
  letter-spacing: 0.12px;
124
+ text-shadow: 0 1px 2px rgba(255,255,255,0.5);
103
125
  }
104
126
 
105
127
  .case-card-categories {
106
128
  display: flex;
107
129
  gap: 8px;
108
- /* margin-top: 8px; */
109
130
  margin-top: 16px;
110
- /* background-color: red; */
111
131
  }
112
132
 
113
133
  .case-card-mobile .case-card-next-appointment-label {
114
- color: var(--Primary-Dark-grey, var(--dark-grey, #456073));
134
+ color: var(--dark-grey, #456073);
115
135
  }
116
136
 
117
137
  .case-card-archived .case-card-next-appointment {
@@ -119,7 +139,8 @@
119
139
  }
120
140
 
121
141
  .case-card-progress-bar {
122
- /* background-color: lightgray; */
123
142
  width: 100%;
124
143
  margin-left: -10px;
144
+ margin-bottom: 2px;
145
+ z-index: 2;
125
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "3.8.1",
3
+ "version": "3.8.3",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",