@frontify/fondue-components 29.0.0 → 29.0.1
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/fondue-components111.js +15 -3
- package/dist/fondue-components111.js.map +1 -1
- package/dist/fondue-components112.js +127 -5
- package/dist/fondue-components112.js.map +1 -1
- package/dist/fondue-components113.js +11 -17
- package/dist/fondue-components113.js.map +1 -1
- package/dist/fondue-components114.js +36 -14
- package/dist/fondue-components114.js.map +1 -1
- package/dist/fondue-components115.js +14 -15
- package/dist/fondue-components115.js.map +1 -1
- package/dist/fondue-components116.js +15 -111
- package/dist/fondue-components116.js.map +1 -1
- package/dist/fondue-components117.js +110 -12
- package/dist/fondue-components117.js.map +1 -1
- package/dist/fondue-components118.js +13 -17
- package/dist/fondue-components118.js.map +1 -1
- package/dist/fondue-components119.js +17 -13
- package/dist/fondue-components119.js.map +1 -1
- package/dist/fondue-components120.js +12 -126
- package/dist/fondue-components120.js.map +1 -1
- package/dist/fondue-components121.js +217 -11
- package/dist/fondue-components121.js.map +1 -1
- package/dist/fondue-components122.js +17 -34
- package/dist/fondue-components122.js.map +1 -1
- package/dist/fondue-components123.js +14 -214
- package/dist/fondue-components123.js.map +1 -1
- package/dist/fondue-components124.js +149 -17
- package/dist/fondue-components124.js.map +1 -1
- package/dist/fondue-components125.js +44 -16
- package/dist/fondue-components125.js.map +1 -1
- package/dist/fondue-components126.js +4 -150
- package/dist/fondue-components126.js.map +1 -1
- package/dist/fondue-components127.js +4 -44
- package/dist/fondue-components127.js.map +1 -1
- package/dist/fondue-components128.js +28 -169
- package/dist/fondue-components128.js.map +1 -1
- package/dist/fondue-components130.js +41 -9
- package/dist/fondue-components130.js.map +1 -1
- package/dist/fondue-components131.js +6 -256
- package/dist/fondue-components131.js.map +1 -1
- package/dist/fondue-components132.js +11 -28
- package/dist/fondue-components132.js.map +1 -1
- package/dist/fondue-components133.js +74 -0
- package/dist/fondue-components133.js.map +1 -0
- package/dist/fondue-components134.js +14 -40
- package/dist/fondue-components134.js.map +1 -1
- package/dist/fondue-components135.js +7 -6
- package/dist/fondue-components135.js.map +1 -1
- package/dist/fondue-components136.js +88 -11
- package/dist/fondue-components136.js.map +1 -1
- package/dist/fondue-components137.js +79 -69
- package/dist/fondue-components137.js.map +1 -1
- package/dist/fondue-components138.js +30 -14
- package/dist/fondue-components138.js.map +1 -1
- package/dist/fondue-components139.js +170 -7
- package/dist/fondue-components139.js.map +1 -1
- package/dist/fondue-components140.js +57 -86
- package/dist/fondue-components140.js.map +1 -1
- package/dist/fondue-components141.js +9 -81
- package/dist/fondue-components141.js.map +1 -1
- package/dist/fondue-components142.js +254 -29
- package/dist/fondue-components142.js.map +1 -1
- package/dist/fondue-components145.js +2 -2
- package/dist/fondue-components147.js +2 -2
- package/dist/fondue-components148.js +1 -1
- package/dist/fondue-components43.js +2 -2
- package/dist/fondue-components50.js +1 -1
- package/dist/fondue-components60.js +2 -2
- package/dist/fondue-components61.js +3 -3
- package/dist/fondue-components62.js +2 -2
- package/dist/fondue-components74.js +2 -2
- package/dist/fondue-components77.js +1 -1
- package/dist/fondue-components78.js +1 -1
- package/dist/fondue-components79.js +1 -1
- package/dist/fondue-components82.js +1 -1
- package/dist/fondue-components84.js +2 -2
- package/dist/fondue-components90.js +2 -2
- package/dist/fondue-components91.js +2 -2
- package/dist/fondue-components92.js +2 -2
- package/dist/fondue-components93.js +2 -2
- package/dist/fondue-components94.js +1 -1
- package/dist/fondue-components95.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/fondue-components129.js +0 -63
- package/dist/fondue-components129.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components130.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components130.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,259 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
for (var t, i = !1; u !== void 0; ) {
|
|
7
|
-
var o = u;
|
|
8
|
-
for (u = void 0, c++; o !== void 0; ) {
|
|
9
|
-
var n = o.o;
|
|
10
|
-
if (o.o = void 0, o.f &= -3, !(8 & o.f) && w(o)) try {
|
|
11
|
-
o.c();
|
|
12
|
-
} catch (h) {
|
|
13
|
-
i || (t = h, i = !0);
|
|
14
|
-
}
|
|
15
|
-
o = n;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
if (c = 0, s--, i) throw t;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function E(t) {
|
|
22
|
-
if (s > 0) return t();
|
|
23
|
-
s++;
|
|
24
|
-
try {
|
|
25
|
-
return t();
|
|
26
|
-
} finally {
|
|
27
|
-
d();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
var r = void 0;
|
|
31
|
-
function p(t) {
|
|
32
|
-
var i = r;
|
|
33
|
-
r = void 0;
|
|
34
|
-
try {
|
|
35
|
-
return t();
|
|
36
|
-
} finally {
|
|
37
|
-
r = i;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
var u = void 0, s = 0, c = 0, a = 0;
|
|
41
|
-
function y(t) {
|
|
42
|
-
if (r !== void 0) {
|
|
43
|
-
var i = t.n;
|
|
44
|
-
if (i === void 0 || i.t !== r)
|
|
45
|
-
return i = { i: 0, S: t, p: r.s, n: void 0, t: r, e: void 0, x: void 0, r: i }, r.s !== void 0 && (r.s.n = i), r.s = i, t.n = i, 32 & r.f && t.S(i), i;
|
|
46
|
-
if (i.i === -1)
|
|
47
|
-
return i.i = 0, i.n !== void 0 && (i.n.p = i.p, i.p !== void 0 && (i.p.n = i.n), i.p = r.s, i.n = void 0, r.s.n = i, r.s = i), i;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function f(t, i) {
|
|
51
|
-
this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.W = i == null ? void 0 : i.watched, this.Z = i == null ? void 0 : i.unwatched, this.name = i == null ? void 0 : i.name;
|
|
52
|
-
}
|
|
53
|
-
f.prototype.brand = m;
|
|
54
|
-
f.prototype.h = function() {
|
|
55
|
-
return !0;
|
|
56
|
-
};
|
|
57
|
-
f.prototype.S = function(t) {
|
|
58
|
-
var i = this, o = this.t;
|
|
59
|
-
o !== t && t.e === void 0 && (t.x = o, this.t = t, o !== void 0 ? o.e = t : p(function() {
|
|
60
|
-
var n;
|
|
61
|
-
(n = i.W) == null || n.call(i);
|
|
62
|
-
}));
|
|
63
|
-
};
|
|
64
|
-
f.prototype.U = function(t) {
|
|
65
|
-
var i = this;
|
|
66
|
-
if (this.t !== void 0) {
|
|
67
|
-
var o = t.e, n = t.x;
|
|
68
|
-
o !== void 0 && (o.x = n, t.e = void 0), n !== void 0 && (n.e = o, t.x = void 0), t === this.t && (this.t = n, n === void 0 && p(function() {
|
|
69
|
-
var h;
|
|
70
|
-
(h = i.Z) == null || h.call(i);
|
|
71
|
-
}));
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
f.prototype.subscribe = function(t) {
|
|
75
|
-
var i = this;
|
|
76
|
-
return U(function() {
|
|
77
|
-
var o = i.value, n = r;
|
|
78
|
-
r = void 0;
|
|
79
|
-
try {
|
|
80
|
-
t(o);
|
|
81
|
-
} finally {
|
|
82
|
-
r = n;
|
|
83
|
-
}
|
|
84
|
-
}, { name: "sub" });
|
|
85
|
-
};
|
|
86
|
-
f.prototype.valueOf = function() {
|
|
87
|
-
return this.value;
|
|
88
|
-
};
|
|
89
|
-
f.prototype.toString = function() {
|
|
90
|
-
return this.value + "";
|
|
91
|
-
};
|
|
92
|
-
f.prototype.toJSON = function() {
|
|
93
|
-
return this.value;
|
|
94
|
-
};
|
|
95
|
-
f.prototype.peek = function() {
|
|
96
|
-
var t = r;
|
|
97
|
-
r = void 0;
|
|
98
|
-
try {
|
|
99
|
-
return this.value;
|
|
100
|
-
} finally {
|
|
101
|
-
r = t;
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
Object.defineProperty(f.prototype, "value", { get: function() {
|
|
105
|
-
var t = y(this);
|
|
106
|
-
return t !== void 0 && (t.i = this.i), this.v;
|
|
107
|
-
}, set: function(t) {
|
|
108
|
-
if (t !== this.v) {
|
|
109
|
-
if (c > 100) throw new Error("Cycle detected");
|
|
110
|
-
this.v = t, this.i++, a++, s++;
|
|
111
|
-
try {
|
|
112
|
-
for (var i = this.t; i !== void 0; i = i.x) i.t.N();
|
|
113
|
-
} finally {
|
|
114
|
-
d();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
} });
|
|
118
|
-
function N(t, i) {
|
|
119
|
-
return new f(t, i);
|
|
120
|
-
}
|
|
121
|
-
function w(t) {
|
|
122
|
-
for (var i = t.s; i !== void 0; i = i.n) if (i.S.i !== i.i || !i.S.h() || i.S.i !== i.i) return !0;
|
|
123
|
-
return !1;
|
|
124
|
-
}
|
|
125
|
-
function S(t) {
|
|
126
|
-
for (var i = t.s; i !== void 0; i = i.n) {
|
|
127
|
-
var o = i.S.n;
|
|
128
|
-
if (o !== void 0 && (i.r = o), i.S.n = i, i.i = -1, i.n === void 0) {
|
|
129
|
-
t.s = i;
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
function x(t) {
|
|
135
|
-
for (var i = t.s, o = void 0; i !== void 0; ) {
|
|
136
|
-
var n = i.p;
|
|
137
|
-
i.i === -1 ? (i.S.U(i), n !== void 0 && (n.n = i.n), i.n !== void 0 && (i.n.p = n)) : o = i, i.S.n = i.r, i.r !== void 0 && (i.r = void 0), i = n;
|
|
138
|
-
}
|
|
139
|
-
t.s = o;
|
|
140
|
-
}
|
|
141
|
-
function e(t, i) {
|
|
142
|
-
f.call(this, void 0), this.x = t, this.s = void 0, this.g = a - 1, this.f = 4, this.W = i == null ? void 0 : i.watched, this.Z = i == null ? void 0 : i.unwatched, this.name = i == null ? void 0 : i.name;
|
|
143
|
-
}
|
|
144
|
-
e.prototype = new f();
|
|
145
|
-
e.prototype.h = function() {
|
|
146
|
-
if (this.f &= -3, 1 & this.f) return !1;
|
|
147
|
-
if ((36 & this.f) == 32 || (this.f &= -5, this.g === a)) return !0;
|
|
148
|
-
if (this.g = a, this.f |= 1, this.i > 0 && !w(this))
|
|
149
|
-
return this.f &= -2, !0;
|
|
150
|
-
var t = r;
|
|
151
|
-
try {
|
|
152
|
-
S(this), r = this;
|
|
153
|
-
var i = this.x();
|
|
154
|
-
(16 & this.f || this.v !== i || this.i === 0) && (this.v = i, this.f &= -17, this.i++);
|
|
155
|
-
} catch (o) {
|
|
156
|
-
this.v = o, this.f |= 16, this.i++;
|
|
157
|
-
}
|
|
158
|
-
return r = t, x(this), this.f &= -2, !0;
|
|
159
|
-
};
|
|
160
|
-
e.prototype.S = function(t) {
|
|
161
|
-
if (this.t === void 0) {
|
|
162
|
-
this.f |= 36;
|
|
163
|
-
for (var i = this.s; i !== void 0; i = i.n) i.S.S(i);
|
|
164
|
-
}
|
|
165
|
-
f.prototype.S.call(this, t);
|
|
166
|
-
};
|
|
167
|
-
e.prototype.U = function(t) {
|
|
168
|
-
if (this.t !== void 0 && (f.prototype.U.call(this, t), this.t === void 0)) {
|
|
169
|
-
this.f &= -33;
|
|
170
|
-
for (var i = this.s; i !== void 0; i = i.n) i.S.U(i);
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
e.prototype.N = function() {
|
|
174
|
-
if (!(2 & this.f)) {
|
|
175
|
-
this.f |= 6;
|
|
176
|
-
for (var t = this.t; t !== void 0; t = t.x) t.t.N();
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
Object.defineProperty(e.prototype, "value", { get: function() {
|
|
180
|
-
if (1 & this.f) throw new Error("Cycle detected");
|
|
181
|
-
var t = y(this);
|
|
182
|
-
if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
|
|
183
|
-
return this.v;
|
|
184
|
-
} });
|
|
185
|
-
function O(t, i) {
|
|
186
|
-
return new e(t, i);
|
|
187
|
-
}
|
|
188
|
-
function b(t) {
|
|
189
|
-
var i = t.u;
|
|
190
|
-
if (t.u = void 0, typeof i == "function") {
|
|
191
|
-
s++;
|
|
192
|
-
var o = r;
|
|
193
|
-
r = void 0;
|
|
194
|
-
try {
|
|
195
|
-
i();
|
|
196
|
-
} catch (n) {
|
|
197
|
-
throw t.f &= -2, t.f |= 8, l(t), n;
|
|
198
|
-
} finally {
|
|
199
|
-
r = o, d();
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
function l(t) {
|
|
204
|
-
for (var i = t.s; i !== void 0; i = i.n) i.S.U(i);
|
|
205
|
-
t.x = void 0, t.s = void 0, b(t);
|
|
206
|
-
}
|
|
207
|
-
function g(t) {
|
|
208
|
-
if (r !== this) throw new Error("Out-of-order effect");
|
|
209
|
-
x(this), r = t, this.f &= -2, 8 & this.f && l(this), d();
|
|
210
|
-
}
|
|
211
|
-
function v(t, i) {
|
|
212
|
-
this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = i == null ? void 0 : i.name;
|
|
213
|
-
}
|
|
214
|
-
v.prototype.c = function() {
|
|
215
|
-
var t = this.S();
|
|
216
|
-
try {
|
|
217
|
-
if (8 & this.f || this.x === void 0) return;
|
|
218
|
-
var i = this.x();
|
|
219
|
-
typeof i == "function" && (this.u = i);
|
|
220
|
-
} finally {
|
|
221
|
-
t();
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
v.prototype.S = function() {
|
|
225
|
-
if (1 & this.f) throw new Error("Cycle detected");
|
|
226
|
-
this.f |= 1, this.f &= -9, b(this), S(this), s++;
|
|
227
|
-
var t = r;
|
|
228
|
-
return r = this, g.bind(this, t);
|
|
229
|
-
};
|
|
230
|
-
v.prototype.N = function() {
|
|
231
|
-
2 & this.f || (this.f |= 2, this.o = u, u = this);
|
|
232
|
-
};
|
|
233
|
-
v.prototype.d = function() {
|
|
234
|
-
this.f |= 8, 1 & this.f || l(this);
|
|
235
|
-
};
|
|
236
|
-
v.prototype.dispose = function() {
|
|
237
|
-
this.d();
|
|
238
|
-
};
|
|
239
|
-
function U(t, i) {
|
|
240
|
-
var o = new v(t, i);
|
|
241
|
-
try {
|
|
242
|
-
o.c();
|
|
243
|
-
} catch (h) {
|
|
244
|
-
throw o.d(), h;
|
|
245
|
-
}
|
|
246
|
-
var n = o.d.bind(o);
|
|
247
|
-
return n[Symbol.dispose] = n, n;
|
|
248
|
-
}
|
|
1
|
+
import { useMemo as t } from "react";
|
|
2
|
+
const m = (n, s) => t(() => n.map((r) => {
|
|
3
|
+
const o = s(r), p = (o == null ? void 0 : o.label) ?? r;
|
|
4
|
+
return { value: r, displayValue: p };
|
|
5
|
+
}), [n, s]);
|
|
249
6
|
export {
|
|
250
|
-
|
|
251
|
-
v as Effect,
|
|
252
|
-
f as Signal,
|
|
253
|
-
E as batch,
|
|
254
|
-
O as computed,
|
|
255
|
-
U as effect,
|
|
256
|
-
N as signal,
|
|
257
|
-
p as untracked
|
|
7
|
+
m as useBadgeItems
|
|
258
8
|
};
|
|
259
9
|
//# sourceMappingURL=fondue-components131.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components131.js","sources":["../../../node_modules/.pnpm/@preact+signals-core@1.13.0/node_modules/@preact/signals-core/dist/signals-core.module.js"],"sourcesContent":["var i=Symbol.for(\"preact-signals\");function t(){if(!(s>1)){var i,t=!1;while(void 0!==h){var n=h;h=void 0;v++;while(void 0!==n){var r=n.o;n.o=void 0;n.f&=-3;if(!(8&n.f)&&a(n))try{n.c()}catch(n){if(!t){i=n;t=!0}}n=r}}v=0;s--;if(t)throw i}else s--}function n(i){if(s>0)return i();s++;try{return i()}finally{t()}}var r=void 0;function o(i){var t=r;r=void 0;try{return i()}finally{r=t}}var f,h=void 0,s=0,v=0,u=0;function e(i){if(void 0!==r){var t=i.n;if(void 0===t||t.t!==r){t={i:0,S:i,p:r.s,n:void 0,t:r,e:void 0,x:void 0,r:t};if(void 0!==r.s)r.s.n=t;r.s=t;i.n=t;if(32&r.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=r.s;t.n=void 0;r.s.n=t;r.s=t}return t}}}function d(i,t){this.v=i;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}d.prototype.brand=i;d.prototype.h=function(){return!0};d.prototype.S=function(i){var t=this,n=this.t;if(n!==i&&void 0===i.e){i.x=n;this.t=i;if(void 0!==n)n.e=i;else o(function(){var i;null==(i=t.W)||i.call(t)})}};d.prototype.U=function(i){var t=this;if(void 0!==this.t){var n=i.e,r=i.x;if(void 0!==n){n.x=r;i.e=void 0}if(void 0!==r){r.e=n;i.x=void 0}if(i===this.t){this.t=r;if(void 0===r)o(function(){var i;null==(i=t.Z)||i.call(t)})}}};d.prototype.subscribe=function(i){var t=this;return m(function(){var n=t.value,o=r;r=void 0;try{i(n)}finally{r=o}},{name:\"sub\"})};d.prototype.valueOf=function(){return this.value};d.prototype.toString=function(){return this.value+\"\"};d.prototype.toJSON=function(){return this.value};d.prototype.peek=function(){var i=r;r=void 0;try{return this.value}finally{r=i}};Object.defineProperty(d.prototype,\"value\",{get:function(){var i=e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(v>100)throw new Error(\"Cycle detected\");this.v=i;this.i++;u++;s++;try{for(var n=this.t;void 0!==n;n=n.x)n.t.N()}finally{t()}}}});function c(i,t){return new d(i,t)}function a(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function l(i){for(var t=i.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n)t.r=n;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function y(i){var t=i.s,n=void 0;while(void 0!==t){var r=t.p;if(-1===t.i){t.S.U(t);if(void 0!==r)r.n=t.n;if(void 0!==t.n)t.n.p=r}else n=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=r}i.s=n}function w(i,t){d.call(this,void 0);this.x=i;this.s=void 0;this.g=u-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}w.prototype=new d;w.prototype.h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===u)return!0;this.g=u;this.f|=1;if(this.i>0&&!a(this)){this.f&=-2;return!0}var i=r;try{l(this);r=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}r=i;y(this);this.f&=-2;return!0};w.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}d.prototype.S.call(this,i)};w.prototype.U=function(i){if(void 0!==this.t){d.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};w.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(w.prototype,\"value\",{get:function(){if(1&this.f)throw new Error(\"Cycle detected\");var i=e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function b(i,t){return new w(i,t)}function _(i){var n=i.u;i.u=void 0;if(\"function\"==typeof n){s++;var o=r;r=void 0;try{n()}catch(t){i.f&=-2;i.f|=8;p(i);throw t}finally{r=o;t()}}}function p(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;_(i)}function g(i){if(r!==this)throw new Error(\"Out-of-order effect\");y(this);r=i;this.f&=-2;if(8&this.f)p(this);t()}function S(i,t){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;this.name=null==t?void 0:t.name;if(f)f.push(this)}S.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if(\"function\"==typeof t)this.u=t}finally{i()}};S.prototype.S=function(){if(1&this.f)throw new Error(\"Cycle detected\");this.f|=1;this.f&=-9;_(this);l(this);s++;var i=r;r=this;return g.bind(this,i)};S.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=h;h=this}};S.prototype.d=function(){this.f|=8;if(!(1&this.f))p(this)};S.prototype.dispose=function(){this.d()};function m(i,t){var n=new S(i,t);try{n.c()}catch(i){n.d();throw i}var r=n.d.bind(n);r[Symbol.dispose]=r;return r}function E(i){return function(){var t=arguments,r=this;return n(function(){return o(function(){return i.apply(r,[].slice.call(t))})})}}function x(){var i=f;f=[];return function(){var t=f;if(f&&i)i=i.concat(f);f=i;return t}}function C(i){return function(){var t,n,r=x();try{n=i.apply(void 0,[].slice.call(arguments))}catch(i){f=void 0;throw i}finally{t=r()}for(var o in n)if(\"function\"==typeof n[o])n[o]=E(n[o]);n[Symbol.dispose]=E(function(){if(t)for(var i=0;i<t.length;i++)t[i].dispose();t=void 0});return n}}export{w as Computed,S as Effect,d as Signal,E as action,n as batch,b as computed,C as createModel,m as effect,c as signal,o as untracked};//# sourceMappingURL=signals-core.module.js.map\n"],"names":["i","t","h","n","v","r","a","o","u","e","d","m","c","l","y","w","b","_","p","S"],"mappings":"AAAA,IAAIA,IAAE,OAAO,IAAI,gBAAgB;AAAE,SAASC,IAAG;AAAC,MAAK,IAAE;AAA0L;AAAA,OAAvL;AAAY,aAAPD,GAAEC,IAAE,IAAkBC,MAAT,UAAW;AAAC,UAAIC,IAAED;AAAe,WAAbA,IAAE,QAAOE,KAAmBD,MAAT,UAAW;AAAC,YAAIE,IAAEF,EAAE;AAAqB,YAAnBA,EAAE,IAAE,QAAOA,EAAE,KAAG,IAAM,EAAE,IAAEA,EAAE,MAAIG,EAAEH,CAAC,EAAE,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AAAO,QAAIC,IAAE,KAAK,EAAC;AAAG,IAAe,OAAOA,KAAnB,eAAqB,KAAK,IAAEA;AAAA,EAAC,UAAC;AAAQ,IAAAD,EAAC;AAAA,EAAE;AAAC;AAAEmB,EAAE,UAAU,IAAE,WAAU;AAAC,MAAG,IAAE,KAAK,EAAE,OAAM,IAAI,MAAM,gBAAgB;AAAE,OAAK,KAAG,GAAE,KAAK,KAAG,IAAGF,EAAE,IAAI,GAAEJ,EAAE,IAAI,GAAE;AAAI,MAAIb,IAAE;AAAE,aAAE,MAAY,EAAE,KAAK,MAAKA,CAAC;AAAC;AAAEmB,EAAE,UAAU,IAAE,WAAU;AAAC,EAAK,IAAE,KAAK,MAAI,KAAK,KAAG,GAAE,KAAK,IAAEjB,GAAEA,IAAE;AAAK;AAAEiB,EAAE,UAAU,IAAE,WAAU;AAAC,OAAK,KAAG,GAAO,IAAE,KAAK,KAAGD,EAAE,IAAI;AAAC;AAAEC,EAAE,UAAU,UAAQ,WAAU;AAAC,OAAK,EAAC;AAAE;AAAE,SAASR,EAAEX,GAAEC,GAAE;AAAC,MAAIE,IAAE,IAAIgB,EAAEnB,GAAEC,CAAC;AAAE,MAAG;AAAC,IAAAE,EAAE,EAAC;AAAA,EAAE,SAAOH,GAAE;AAAC,UAAAG,EAAE,EAAC,GAASH;AAAA,EAAC;AAAC,MAAIK,IAAEF,EAAE,EAAE,KAAKA,CAAC;AAAE,SAAAE,EAAE,OAAO,OAAO,IAAEA,GAASA;AAAC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"fondue-components131.js","sources":["../src/components/Select/hooks/useBadgeItems.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useMemo } from 'react';\n\ntype SelectItemLike = {\n value: string;\n label: string;\n};\n\ntype BadgeItem = {\n value: string;\n displayValue: string;\n};\n\nexport const useBadgeItems = (\n selectedItemValues: string[],\n getItemByValue: (value?: string) => SelectItemLike | undefined,\n): BadgeItem[] => {\n return useMemo(() => {\n return selectedItemValues.map((value) => {\n const item = getItemByValue(value);\n const displayValue = item?.label ?? value;\n return { value, displayValue };\n });\n }, [selectedItemValues, getItemByValue]);\n};\n"],"names":["useBadgeItems","selectedItemValues","getItemByValue","useMemo","value","item","displayValue"],"mappings":";AAcO,MAAMA,IAAgB,CACzBC,GACAC,MAEOC,EAAQ,MACJF,EAAmB,IAAI,CAACG,MAAU;AACrC,QAAMC,IAAOH,EAAeE,CAAK,GAC3BE,KAAeD,KAAA,gBAAAA,EAAM,UAASD;AACpC,SAAO,EAAE,OAAAA,GAAO,cAAAE,EAAA;AACpB,CAAC,GACF,CAACL,GAAoBC,CAAc,CAAC;"}
|
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
return new Date(Date.UTC(r.year, r.month - 1, r.day));
|
|
12
|
-
}, D = (r) => {
|
|
13
|
-
const o = n(r == null ? void 0 : r.from), t = n(r == null ? void 0 : r.to);
|
|
14
|
-
if (!(!o || !t))
|
|
15
|
-
return {
|
|
16
|
-
from: o,
|
|
17
|
-
to: t
|
|
18
|
-
};
|
|
19
|
-
}, m = (r) => {
|
|
20
|
-
if (r)
|
|
21
|
-
return {
|
|
22
|
-
from: f(r.from),
|
|
23
|
-
to: f(r.to)
|
|
24
|
-
};
|
|
1
|
+
import { useRef as u, useCallback as t } from "react";
|
|
2
|
+
const c = () => {
|
|
3
|
+
const s = u(!1), o = t((e) => {
|
|
4
|
+
s.current = !0, e.currentTarget.dataset.showFocusRing = "false";
|
|
5
|
+
}, []), r = t((e) => {
|
|
6
|
+
s.current || (e.target.dataset.showFocusRing = "true");
|
|
7
|
+
}, []), n = t((e) => {
|
|
8
|
+
e.target.dataset.showFocusRing = "false", s.current = !1;
|
|
9
|
+
}, []);
|
|
10
|
+
return { wasClickedRef: s, onMouseDown: o, onFocus: r, onBlur: n };
|
|
25
11
|
};
|
|
26
12
|
export {
|
|
27
|
-
|
|
28
|
-
m as transformDateRangeToPickerDateRange,
|
|
29
|
-
n as transformDateToDatePickerDate,
|
|
30
|
-
D as transformPickerDateRangeToDateRange
|
|
13
|
+
c as useFocusRing
|
|
31
14
|
};
|
|
32
15
|
//# sourceMappingURL=fondue-components132.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components132.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components132.js","sources":["../src/components/Select/hooks/useFocusRing.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useCallback, useRef, type FocusEvent, type MouseEvent, type MutableRefObject } from 'react';\n\ntype FocusRingHandlers = {\n /** Ref tracking whether the element was activated via mouse click. */\n wasClickedRef: MutableRefObject<boolean>;\n /** Handler for mousedown events — marks the interaction as click-based. */\n onMouseDown: (event: MouseEvent<HTMLElement>) => void;\n /** Handler for focus events — shows the focus ring only for keyboard navigation. */\n onFocus: (event: FocusEvent<HTMLElement>) => void;\n /** Handler for blur events — hides the focus ring and resets click tracking. */\n onBlur: (event: FocusEvent<HTMLElement>) => void;\n};\n\nexport const useFocusRing = (): FocusRingHandlers => {\n const wasClickedRef = useRef(false);\n\n const onMouseDown = useCallback((event: MouseEvent<HTMLElement>): void => {\n wasClickedRef.current = true;\n event.currentTarget.dataset.showFocusRing = 'false';\n }, []);\n\n const onFocus = useCallback((event: FocusEvent<HTMLElement>): void => {\n if (!wasClickedRef.current) {\n event.target.dataset.showFocusRing = 'true';\n }\n }, []);\n\n const onBlur = useCallback((event: FocusEvent<HTMLElement>): void => {\n event.target.dataset.showFocusRing = 'false';\n wasClickedRef.current = false;\n }, []);\n\n return { wasClickedRef, onMouseDown, onFocus, onBlur };\n};\n"],"names":["useFocusRing","wasClickedRef","useRef","onMouseDown","useCallback","event","onFocus","onBlur"],"mappings":";AAeO,MAAMA,IAAe,MAAyB;AACjD,QAAMC,IAAgBC,EAAO,EAAK,GAE5BC,IAAcC,EAAY,CAACC,MAAyC;AACtE,IAAAJ,EAAc,UAAU,IACxBI,EAAM,cAAc,QAAQ,gBAAgB;AAAA,EAChD,GAAG,CAAA,CAAE,GAECC,IAAUF,EAAY,CAACC,MAAyC;AAClE,IAAKJ,EAAc,YACfI,EAAM,OAAO,QAAQ,gBAAgB;AAAA,EAE7C,GAAG,CAAA,CAAE,GAECE,IAASH,EAAY,CAACC,MAAyC;AACjE,IAAAA,EAAM,OAAO,QAAQ,gBAAgB,SACrCJ,EAAc,UAAU;AAAA,EAC5B,GAAG,CAAA,CAAE;AAEL,SAAO,EAAE,eAAAA,GAAe,aAAAE,GAAa,SAAAG,GAAS,QAAAC,EAAA;AAClD;"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S, useMemo as b, Children as V, isValidElement as C, cloneElement as w, useCallback as B, useEffect as x } from "react";
|
|
3
|
+
import { SelectClear as F } from "./fondue-components148.js";
|
|
4
|
+
import { ForwardedRefSelectItem as L } from "./fondue-components94.js";
|
|
5
|
+
import { ForwardedRefSelectSlot as y } from "./fondue-components95.js";
|
|
6
|
+
import { getSelectOptionValue as I } from "./fondue-components149.js";
|
|
7
|
+
const d = (n, s) => {
|
|
8
|
+
const [e, r] = S(!1), [m, i] = S(null), [l, f] = S({
|
|
9
|
+
menuComponents: [],
|
|
10
|
+
items: []
|
|
11
|
+
});
|
|
12
|
+
return x(() => {
|
|
13
|
+
i(null), s || f({
|
|
14
|
+
menuComponents: [],
|
|
15
|
+
items: []
|
|
16
|
+
}), s && (r(!0), s(n).then((u) => {
|
|
17
|
+
f({
|
|
18
|
+
menuComponents: u.map((o) => /* @__PURE__ */ E(L, { label: o.label, value: o.value, children: o.content ? o.content : o.label }, o.value)),
|
|
19
|
+
items: u.map((o) => ({ value: o.value, label: o.label, children: o.content }))
|
|
20
|
+
}), r(!1);
|
|
21
|
+
}).catch((u) => {
|
|
22
|
+
i(u), r(!1);
|
|
23
|
+
}));
|
|
24
|
+
}, [n, s]), { isLoading: e, error: m, menuComponents: l.menuComponents, items: l.items };
|
|
25
|
+
}, g = (n) => {
|
|
26
|
+
const s = [];
|
|
27
|
+
return V.forEach(n, (e) => {
|
|
28
|
+
if (C(e) && e.type === L)
|
|
29
|
+
s.push(I(e.props));
|
|
30
|
+
else if (C(e) && e.props.children) {
|
|
31
|
+
const r = g(e.props.children);
|
|
32
|
+
for (const m of r)
|
|
33
|
+
s.push(m);
|
|
34
|
+
}
|
|
35
|
+
}), s;
|
|
36
|
+
}, q = (n, s) => {
|
|
37
|
+
const [e, r] = S(""), { inputSlots: m, menuSlots: i, itemValues: l, clearButton: f } = b(() => {
|
|
38
|
+
const a = [], p = [];
|
|
39
|
+
let v;
|
|
40
|
+
V.toArray(n).some(
|
|
41
|
+
(t) => C(t) && t.type === y
|
|
42
|
+
) ? V.forEach(n, (t) => {
|
|
43
|
+
C(t) && t.type === y && (t.props.name === "menu" ? p.push(t.props.children) : t.props.name === "left" || t.props.name === "right" ? a.push(t) : t.props.name === "clear" && (t.props.children ? v = t : v = w(t, { children: /* @__PURE__ */ E(F, {}) })));
|
|
44
|
+
}) : p.push(n);
|
|
45
|
+
const R = g(p);
|
|
46
|
+
return { inputSlots: a, menuSlots: p, itemValues: R, clearButton: v };
|
|
47
|
+
}, [n]), u = b(
|
|
48
|
+
() => l.filter(
|
|
49
|
+
(a) => e === "" || a.label.toLowerCase().includes(e.toLowerCase())
|
|
50
|
+
),
|
|
51
|
+
[l, e]
|
|
52
|
+
), o = B(
|
|
53
|
+
(a) => a !== void 0 ? l.find((p) => p.value === a) : void 0,
|
|
54
|
+
[l]
|
|
55
|
+
), c = d(e, s);
|
|
56
|
+
return {
|
|
57
|
+
items: [...u, ...c.items],
|
|
58
|
+
menuSlots: [...i, ...c.menuComponents],
|
|
59
|
+
filterText: e,
|
|
60
|
+
inputSlots: m,
|
|
61
|
+
clearButton: f,
|
|
62
|
+
setFilterText: r,
|
|
63
|
+
getItemByValue: o,
|
|
64
|
+
asyncItemStatus: {
|
|
65
|
+
isLoading: c.isLoading,
|
|
66
|
+
error: c.error
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
g as getRecursiveOptionValues,
|
|
72
|
+
q as useSelectData
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=fondue-components133.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fondue-components133.js","sources":["../src/components/Select/hooks/useSelectData.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useMemo,\n useState,\n type ReactNode,\n} from 'react';\n\nimport { SelectClear } from '../components/SelectClear';\nimport { ForwardedRefSelectItem, type SelectItemProps } from '../components/SelectItem';\nimport { ForwardedRefSelectSlot, type SelectSlotProps } from '../components/SelectSlot';\nimport { getSelectOptionValue } from '../utils';\n\nexport type SelectItemType = {\n value: string;\n label: string;\n};\n\nexport type AsyncItem = { label: string; value: string; content?: ReactNode };\n\nexport type AsyncItemsFetcher = (filterText: string) => Promise<AsyncItem[]>;\n\nconst useAsyncItems = (filterText: string, getAsyncItems?: AsyncItemsFetcher) => {\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [asyncResult, setAsyncResult] = useState<{\n menuComponents: ReactNode[];\n items: { value: string; label: string; children?: ReactNode }[];\n }>({\n menuComponents: [],\n items: [],\n });\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setError(null);\n if (!getAsyncItems) {\n setAsyncResult({\n menuComponents: [],\n items: [],\n });\n }\n\n if (getAsyncItems) {\n setIsLoading(true);\n getAsyncItems(filterText)\n .then((items) => {\n setAsyncResult({\n menuComponents: items.map((item) => (\n <ForwardedRefSelectItem key={item.value} label={item.label} value={item.value}>\n {item.content ? item.content : item.label}\n </ForwardedRefSelectItem>\n )),\n items: items.map((item) => ({ value: item.value, label: item.label, children: item.content })),\n });\n setIsLoading(false);\n })\n .catch((error: Error) => {\n setError(error);\n setIsLoading(false);\n });\n }\n }, [filterText, getAsyncItems]);\n\n return { isLoading, error, menuComponents: asyncResult.menuComponents, items: asyncResult.items };\n};\n\n/**\n * Recursively extracts option values from children.\n * This function traverses through the React component tree and collects all SelectItem values.\n *\n * @param {ReactNode} children - The React children to extract values from.\n * @returns {SelectItemType[]} An array of SelectItemType objects.\n *\n * @example\n * const options = (\n * <SelectItem value=\"1\">Option 1</SelectItem>\n * <SelectItem value=\"2\">Option 2</SelectItem>\n * );\n * const values = getRecursiveOptionValues(options);\n * // Returns: [{ value: '1', label: 'Option 1' }, { value: '2', label: 'Option 2' }]\n */\nexport const getRecursiveOptionValues = (\n children: ReactNode,\n): { value: string; label: string; children?: ReactNode }[] => {\n const values: { value: string; label: string }[] = [];\n Children.forEach(children, (child) => {\n if (isValidElement<SelectItemProps>(child) && child.type === ForwardedRefSelectItem) {\n values.push(getSelectOptionValue(child.props));\n } else if (isValidElement<{ children: ReactNode }>(child) && child.props.children) {\n const optionValues = getRecursiveOptionValues(child.props.children);\n for (const optionValue of optionValues) {\n values.push(optionValue);\n }\n }\n });\n return values;\n};\n\n/**\n * Custom hook for managing select data and filtering.\n *\n * @param {ReactNode} children - The React children to process, typically SelectItem components.\n * @param {AsyncItemsFetcher} [getAsyncItems] - Optional function to fetch items asynchronously based on filter text.\n * @returns {Object} An object containing the processed data.\n */\nexport const useSelectData = (children: ReactNode, getAsyncItems?: AsyncItemsFetcher) => {\n const [filterText, setFilterText] = useState('');\n // eslint-disable-next-line react-hooks/preserve-manual-memoization\n const { inputSlots, menuSlots, itemValues, clearButton } = useMemo(() => {\n const inputSlots: ReactNode[] = [];\n const menuSlots: ReactNode[] = [];\n let clearButton: ReactNode;\n\n const hasSlots = Children.toArray(children).some(\n (child) => isValidElement<SelectSlotProps>(child) && child.type === ForwardedRefSelectSlot,\n );\n\n if (hasSlots) {\n Children.forEach(children, (child) => {\n if (isValidElement<SelectSlotProps>(child) && child.type === ForwardedRefSelectSlot) {\n if (child.props.name === 'menu') {\n menuSlots.push(child.props.children);\n } else if (child.props.name === 'left' || child.props.name === 'right') {\n inputSlots.push(child);\n } else if (child.props.name === 'clear') {\n if (child.props.children) {\n clearButton = child;\n } else {\n clearButton = cloneElement(child, { children: <SelectClear /> });\n }\n }\n }\n });\n } else {\n menuSlots.push(children);\n }\n\n const itemValues = getRecursiveOptionValues(menuSlots);\n\n return { inputSlots, menuSlots, itemValues, clearButton };\n }, [children]);\n\n const items = useMemo(\n () =>\n itemValues.filter(\n (item) => filterText === '' || item.label.toLowerCase().includes(filterText.toLowerCase()),\n ),\n [itemValues, filterText],\n );\n\n const getItemByValue = useCallback(\n (value?: string | null) => (value !== undefined ? itemValues.find((item) => item.value === value) : undefined),\n [itemValues],\n );\n\n const asyncItems = useAsyncItems(filterText, getAsyncItems);\n\n return {\n items: [...items, ...asyncItems.items],\n menuSlots: [...menuSlots, ...asyncItems.menuComponents],\n filterText,\n inputSlots,\n clearButton,\n setFilterText,\n getItemByValue,\n asyncItemStatus: {\n isLoading: asyncItems.isLoading,\n error: asyncItems.error,\n },\n };\n};\n"],"names":["useAsyncItems","filterText","getAsyncItems","isLoading","setIsLoading","useState","error","setError","asyncResult","setAsyncResult","useEffect","items","item","jsx","ForwardedRefSelectItem","getRecursiveOptionValues","children","values","Children","child","isValidElement","getSelectOptionValue","optionValues","optionValue","useSelectData","setFilterText","inputSlots","menuSlots","itemValues","clearButton","useMemo","ForwardedRefSelectSlot","cloneElement","SelectClear","getItemByValue","useCallback","value","asyncItems"],"mappings":";;;;;;AA2BA,MAAMA,IAAgB,CAACC,GAAoBC,MAAsC;AAC7E,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAOC,CAAQ,IAAIF,EAAuB,I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AAK,UAAUwB,CAAK,IAAI;AAAA,IACpG,CAACR,CAAU;AAAA,EAAA,GAGTS,IAAarC,EAAcC,GAAYC,CAAa;AAE1D,SAAO;AAAA,IACH,OAAO,CAAC,GAAGS,GAAO,GAAG0B,EAAW,KAAK;AAAA,IACrC,WAAW,CAAC,GAAGV,GAAW,GAAGU,EAAW,cAAc;AAAA,IACtD,YAAApC;AAAA,IACA,YAAAyB;AAAA,IACA,aAAAG;AAAA,IACA,eAAAJ;AAAA,IACA,gBAAAS;AAAA,IACA,iBAAiB;AAAA,MACb,WAAWG,EAAW;AAAA,MACtB,OAAOA,EAAW;AAAA,IAAA;AAAA,EACtB;AAER;"}
|
|
@@ -1,44 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
selected: l,
|
|
15
|
-
selectedMiddle: p,
|
|
16
|
-
selectedStart: j,
|
|
17
|
-
selectedEnd: y,
|
|
18
|
-
hoverAfter: h,
|
|
19
|
-
hoverSelected: u,
|
|
20
|
-
hoverBefore: w
|
|
1
|
+
import { useId as u, useMemo as f } from "react";
|
|
2
|
+
import { useTranslation as D } from "./fondue-components42.js";
|
|
3
|
+
const g = (t, n, r) => {
|
|
4
|
+
const { t: i } = D(), s = u(), e = f(() => {
|
|
5
|
+
if (!t || n.length === 0)
|
|
6
|
+
return "";
|
|
7
|
+
const p = n.map((c) => {
|
|
8
|
+
const o = r(c);
|
|
9
|
+
return (o == null ? void 0 : o.label) ?? c;
|
|
10
|
+
}).join(", ");
|
|
11
|
+
return i("Select_selectedCount", { count: n.length.toString(), items: p });
|
|
12
|
+
}, [t, n, r, i]);
|
|
13
|
+
return { selectionDescriptionId: s, selectionDescription: e };
|
|
21
14
|
};
|
|
22
15
|
export {
|
|
23
|
-
|
|
24
|
-
v as dayButton,
|
|
25
|
-
r as dayContent,
|
|
26
|
-
B as default,
|
|
27
|
-
i as disabled,
|
|
28
|
-
h as hoverAfter,
|
|
29
|
-
w as hoverBefore,
|
|
30
|
-
u as hoverSelected,
|
|
31
|
-
n as nextMonthButtonContainer,
|
|
32
|
-
a as outside,
|
|
33
|
-
t as root,
|
|
34
|
-
l as selected,
|
|
35
|
-
y as selectedEnd,
|
|
36
|
-
p as selectedMiddle,
|
|
37
|
-
j as selectedStart,
|
|
38
|
-
o as toggleMonthButtonContainer,
|
|
39
|
-
s as week,
|
|
40
|
-
_ as weekday,
|
|
41
|
-
d as weekdays,
|
|
42
|
-
e as wrapper
|
|
16
|
+
g as useSelectionDescription
|
|
43
17
|
};
|
|
44
18
|
//# sourceMappingURL=fondue-components134.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components134.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components134.js","sources":["../src/components/Select/hooks/useSelectionDescription.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useId, useMemo } from 'react';\n\nimport { useTranslation } from '#/hooks/useTranslation';\n\ntype SelectItemLike = {\n value: string;\n label: string;\n};\n\ntype SelectionDescription = {\n /** The unique ID for the SR description element. */\n selectionDescriptionId: string;\n /** The description text for screen readers (empty string when not applicable). */\n selectionDescription: string;\n};\n\nexport const useSelectionDescription = (\n isMultiple: boolean,\n selectedItemValues: string[],\n getItemByValue: (value?: string) => SelectItemLike | undefined,\n): SelectionDescription => {\n const { t } = useTranslation();\n const selectionDescriptionId = useId();\n\n const selectionDescription = useMemo((): string => {\n if (!isMultiple || selectedItemValues.length === 0) {\n return '';\n }\n const labels = selectedItemValues\n .map((value) => {\n const item = getItemByValue(value);\n return item?.label ?? value;\n })\n .join(', ');\n return t('Select_selectedCount', { count: selectedItemValues.length.toString(), items: labels });\n }, [isMultiple, selectedItemValues, getItemByValue, t]);\n\n return { selectionDescriptionId, selectionDescription };\n};\n"],"names":["useSelectionDescription","isMultiple","selectedItemValues","getItemByValue","t","useTranslation","selectionDescriptionId","useId","selectionDescription","useMemo","labels","value","item"],"mappings":";;AAkBO,MAAMA,IAA0B,CACnCC,GACAC,GACAC,MACuB;AACvB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAyBC,EAAA,GAEzBC,IAAuBC,EAAQ,MAAc;AAC/C,QAAI,CAACR,KAAcC,EAAmB,WAAW;AAC7C,aAAO;AAEX,UAAMQ,IAASR,EACV,IAAI,CAACS,MAAU;AACZ,YAAMC,IAAOT,EAAeQ,CAAK;AACjC,cAAOC,KAAA,gBAAAA,EAAM,UAASD;AAAA,IAC1B,CAAC,EACA,KAAK,IAAI;AACd,WAAOP,EAAE,wBAAwB,EAAE,OAAOF,EAAmB,OAAO,SAAA,GAAY,OAAOQ,GAAQ;AAAA,EACnG,GAAG,CAACT,GAAYC,GAAoBC,GAAgBC,CAAC,CAAC;AAEtD,SAAO,EAAE,wBAAAE,GAAwB,sBAAAE,EAAA;AACrC;"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as e } from "@radix-ui/react-slot";
|
|
3
|
+
import a from "./fondue-components125.js";
|
|
4
|
+
const m = ({ children: o, onClear: t }) => /* @__PURE__ */ r(e, { onClick: (l) => {
|
|
5
|
+
l.stopPropagation(), t();
|
|
6
|
+
}, className: a.clear, role: "button", "aria-label": "Clear selection", children: o });
|
|
6
7
|
export {
|
|
7
|
-
m as
|
|
8
|
+
m as ClearButton
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=fondue-components135.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components135.js","sources":["../src/components/Select/
|
|
1
|
+
{"version":3,"file":"fondue-components135.js","sources":["../src/components/Select/components/ClearButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { type MouseEvent, type ReactNode } from 'react';\n\nimport styles from '../styles/select.module.scss';\n\ntype ClearButtonProps = {\n /** The clear button element to render inside the slot. */\n children: ReactNode;\n /** Callback fired when the clear button is clicked. */\n onClear: () => void;\n};\n\nexport const ClearButton = ({ children, onClear }: ClearButtonProps): ReactNode => {\n const handleClick = (event: MouseEvent): void => {\n event.stopPropagation();\n onClear();\n };\n\n return (\n <RadixSlot onClick={handleClick} className={styles.clear} role=\"button\" aria-label=\"Clear selection\">\n {children}\n </RadixSlot>\n );\n};\n"],"names":["ClearButton","children","onClear","jsx","RadixSlot","event","styles"],"mappings":";;;AAcO,MAAMA,IAAc,CAAC,EAAE,UAAAC,GAAU,SAAAC,QAOhC,gBAAAC,EAACC,GAAA,EAAU,SANK,CAACC,MAA4B;AAC7C,EAAAA,EAAM,gBAAA,GACNH,EAAA;AACJ,GAGqC,WAAWI,EAAO,OAAO,MAAK,UAAS,cAAW,mBAC9E,UAAAL,EAAA,CACL;"}
|