welcome-ui 10.0.0-alpha.5 → 10.0.0-alpha.7
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/Button.css +1 -1
- package/dist/Button.js +42 -42
- package/dist/CloseButton.js +1 -1
- package/dist/Drawer.js +132 -111
- package/dist/DropdownMenu.js +251 -238
- package/dist/FileDrop.css +1 -1
- package/dist/FileDrop.js +333 -312
- package/dist/Icon.js +16 -12
- package/dist/InputText.css +1 -1
- package/dist/InputText.js +48 -48
- package/dist/Link.css +1 -1
- package/dist/Link.js +48 -48
- package/dist/Search.css +1 -1
- package/dist/Search.js +137 -132
- package/dist/Select.css +1 -1
- package/dist/Select.js +177 -177
- package/dist/Textarea.css +1 -1
- package/dist/Textarea.js +24 -18
- package/dist/Toast.js +163 -126
- package/dist/types/components/FileDrop/types.d.ts +2 -0
- package/dist/types/components/Icon/icons.d.ts +4 -3
- package/dist/types/components/Textarea/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/Select.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Select.css';
|
|
3
3
|
import { jsx as v, jsxs as L } from "react/jsx-runtime";
|
|
4
|
-
import { D as
|
|
4
|
+
import { D as me } from "./downshift.esm-xtYanIDi.js";
|
|
5
5
|
import { g as Ke, c as ye } from "./index-PAaZGbyz.js";
|
|
6
6
|
import { forwardRef as Le, useMemo as Pe, useState as P, useEffect as he, useCallback as $e, Fragment as Ye } from "react";
|
|
7
7
|
import { CloseButton as Be } from "./CloseButton.js";
|
|
@@ -474,19 +474,19 @@ function Je() {
|
|
|
474
474
|
Й: "И",
|
|
475
475
|
ё: "е",
|
|
476
476
|
Ё: "Е"
|
|
477
|
-
},
|
|
477
|
+
}, t = Object.keys(e).join("|"), n = new RegExp(t, "g"), r = new RegExp(t, "");
|
|
478
478
|
function s(o) {
|
|
479
479
|
return e[o];
|
|
480
480
|
}
|
|
481
481
|
var c = function(o) {
|
|
482
|
-
return o.replace(
|
|
482
|
+
return o.replace(n, s);
|
|
483
483
|
}, i = function(o) {
|
|
484
484
|
return !!o.match(r);
|
|
485
485
|
};
|
|
486
486
|
return V.exports = c, V.exports.has = i, V.exports.remove = c, V.exports;
|
|
487
487
|
}
|
|
488
|
-
var
|
|
489
|
-
const
|
|
488
|
+
var et = Je();
|
|
489
|
+
const tt = /* @__PURE__ */ Ke(et);
|
|
490
490
|
/**
|
|
491
491
|
* @name match-sorter
|
|
492
492
|
* @license MIT license.
|
|
@@ -502,61 +502,61 @@ const g = {
|
|
|
502
502
|
ACRONYM: 2,
|
|
503
503
|
MATCHES: 1,
|
|
504
504
|
NO_MATCH: 0
|
|
505
|
-
},
|
|
506
|
-
function G(e,
|
|
507
|
-
|
|
505
|
+
}, nt = (e, t) => String(e.rankedValue).localeCompare(String(t.rankedValue));
|
|
506
|
+
function G(e, t, n) {
|
|
507
|
+
n === void 0 && (n = {});
|
|
508
508
|
const {
|
|
509
509
|
keys: r,
|
|
510
510
|
threshold: s = g.MATCHES,
|
|
511
|
-
baseSort: c =
|
|
512
|
-
sorter: i = (
|
|
513
|
-
} =
|
|
514
|
-
return i(o).map((
|
|
511
|
+
baseSort: c = nt,
|
|
512
|
+
sorter: i = (d) => d.sort((u, h) => ot(u, h, c))
|
|
513
|
+
} = n, o = e.reduce(l, []);
|
|
514
|
+
return i(o).map((d) => {
|
|
515
515
|
let {
|
|
516
516
|
item: u
|
|
517
|
-
} =
|
|
517
|
+
} = d;
|
|
518
518
|
return u;
|
|
519
519
|
});
|
|
520
|
-
function l(
|
|
521
|
-
const E =
|
|
520
|
+
function l(d, u, h) {
|
|
521
|
+
const E = rt(u, r, t, n), {
|
|
522
522
|
rank: p,
|
|
523
|
-
keyThreshold:
|
|
523
|
+
keyThreshold: m = s
|
|
524
524
|
} = E;
|
|
525
|
-
return p >=
|
|
525
|
+
return p >= m && d.push({
|
|
526
526
|
...E,
|
|
527
527
|
item: u,
|
|
528
528
|
index: h
|
|
529
|
-
}),
|
|
529
|
+
}), d;
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
G.rankings = g;
|
|
533
|
-
function
|
|
534
|
-
if (!
|
|
533
|
+
function rt(e, t, n, r) {
|
|
534
|
+
if (!t) {
|
|
535
535
|
const c = e;
|
|
536
536
|
return {
|
|
537
537
|
// ends up being duplicate of 'item' in matches but consistent
|
|
538
538
|
rankedValue: c,
|
|
539
|
-
rank: Ae(c,
|
|
539
|
+
rank: Ae(c, n, r),
|
|
540
540
|
keyIndex: -1,
|
|
541
541
|
keyThreshold: r.threshold
|
|
542
542
|
};
|
|
543
543
|
}
|
|
544
|
-
return
|
|
544
|
+
return it(e, t).reduce((c, i, o) => {
|
|
545
545
|
let {
|
|
546
546
|
rank: l,
|
|
547
|
-
rankedValue:
|
|
547
|
+
rankedValue: d,
|
|
548
548
|
keyIndex: u,
|
|
549
549
|
keyThreshold: h
|
|
550
550
|
} = c, {
|
|
551
551
|
itemValue: E,
|
|
552
552
|
attributes: p
|
|
553
|
-
} = i,
|
|
553
|
+
} = i, m = Ae(E, n, r), k = d;
|
|
554
554
|
const {
|
|
555
555
|
minRanking: T,
|
|
556
556
|
maxRanking: R,
|
|
557
557
|
threshold: S
|
|
558
558
|
} = p;
|
|
559
|
-
return
|
|
559
|
+
return m < T && m >= g.MATCHES ? m = T : m > R && (m = R), m > l && (l = m, u = o, h = S, k = E), {
|
|
560
560
|
rankedValue: k,
|
|
561
561
|
rank: l,
|
|
562
562
|
keyIndex: u,
|
|
@@ -569,80 +569,80 @@ function rn(e, n, t, r) {
|
|
|
569
569
|
keyThreshold: r.threshold
|
|
570
570
|
});
|
|
571
571
|
}
|
|
572
|
-
function Ae(e,
|
|
573
|
-
return e = ge(e,
|
|
572
|
+
function Ae(e, t, n) {
|
|
573
|
+
return e = ge(e, n), t = ge(t, n), t.length > e.length ? g.NO_MATCH : e === t ? g.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), t = t.toLowerCase(), e === t ? g.EQUAL : e.startsWith(t) ? g.STARTS_WITH : e.includes(` ${t}`) ? g.WORD_STARTS_WITH : e.includes(t) ? g.CONTAINS : t.length === 1 ? g.NO_MATCH : st(e).includes(t) ? g.ACRONYM : at(e, t));
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
let
|
|
575
|
+
function st(e) {
|
|
576
|
+
let t = "";
|
|
577
577
|
return e.split(" ").forEach((r) => {
|
|
578
578
|
r.split("-").forEach((c) => {
|
|
579
|
-
|
|
579
|
+
t += c.substr(0, 1);
|
|
580
580
|
});
|
|
581
|
-
}),
|
|
581
|
+
}), t;
|
|
582
582
|
}
|
|
583
|
-
function
|
|
584
|
-
let
|
|
585
|
-
function s(l,
|
|
586
|
-
for (let h = u, E =
|
|
587
|
-
if (
|
|
588
|
-
return
|
|
583
|
+
function at(e, t) {
|
|
584
|
+
let n = 0, r = 0;
|
|
585
|
+
function s(l, d, u) {
|
|
586
|
+
for (let h = u, E = d.length; h < E; h++)
|
|
587
|
+
if (d[h] === l)
|
|
588
|
+
return n += 1, h + 1;
|
|
589
589
|
return -1;
|
|
590
590
|
}
|
|
591
591
|
function c(l) {
|
|
592
|
-
const
|
|
593
|
-
return g.MATCHES + u *
|
|
592
|
+
const d = 1 / l, u = n / t.length;
|
|
593
|
+
return g.MATCHES + u * d;
|
|
594
594
|
}
|
|
595
|
-
const i = s(
|
|
595
|
+
const i = s(t[0], e, 0);
|
|
596
596
|
if (i < 0)
|
|
597
597
|
return g.NO_MATCH;
|
|
598
598
|
r = i;
|
|
599
|
-
for (let l = 1,
|
|
600
|
-
const u =
|
|
599
|
+
for (let l = 1, d = t.length; l < d; l++) {
|
|
600
|
+
const u = t[l];
|
|
601
601
|
if (r = s(u, e, r), !(r > -1))
|
|
602
602
|
return g.NO_MATCH;
|
|
603
603
|
}
|
|
604
604
|
const o = r - i;
|
|
605
605
|
return c(o);
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function ot(e, t, n) {
|
|
608
608
|
const {
|
|
609
609
|
rank: c,
|
|
610
610
|
keyIndex: i
|
|
611
611
|
} = e, {
|
|
612
612
|
rank: o,
|
|
613
613
|
keyIndex: l
|
|
614
|
-
} =
|
|
615
|
-
return c === o ? i === l ?
|
|
614
|
+
} = t;
|
|
615
|
+
return c === o ? i === l ? n(e, t) : i < l ? -1 : 1 : c > o ? -1 : 1;
|
|
616
616
|
}
|
|
617
|
-
function ge(e,
|
|
617
|
+
function ge(e, t) {
|
|
618
618
|
let {
|
|
619
|
-
keepDiacritics:
|
|
620
|
-
} =
|
|
621
|
-
return e = `${e}`,
|
|
619
|
+
keepDiacritics: n
|
|
620
|
+
} = t;
|
|
621
|
+
return e = `${e}`, n || (e = tt(e)), e;
|
|
622
622
|
}
|
|
623
|
-
function
|
|
624
|
-
typeof
|
|
625
|
-
let
|
|
626
|
-
if (typeof
|
|
627
|
-
|
|
623
|
+
function lt(e, t) {
|
|
624
|
+
typeof t == "object" && (t = t.key);
|
|
625
|
+
let n;
|
|
626
|
+
if (typeof t == "function")
|
|
627
|
+
n = t(e);
|
|
628
628
|
else if (e == null)
|
|
629
|
-
|
|
630
|
-
else if (Object.hasOwnProperty.call(e,
|
|
631
|
-
|
|
629
|
+
n = null;
|
|
630
|
+
else if (Object.hasOwnProperty.call(e, t))
|
|
631
|
+
n = e[t];
|
|
632
632
|
else {
|
|
633
|
-
if (
|
|
634
|
-
return
|
|
635
|
-
|
|
633
|
+
if (t.includes("."))
|
|
634
|
+
return ct(t, e);
|
|
635
|
+
n = null;
|
|
636
636
|
}
|
|
637
|
-
return
|
|
637
|
+
return n == null ? [] : Array.isArray(n) ? n : [String(n)];
|
|
638
638
|
}
|
|
639
|
-
function
|
|
640
|
-
const
|
|
641
|
-
let r = [
|
|
642
|
-
for (let s = 0, c =
|
|
643
|
-
const i =
|
|
639
|
+
function ct(e, t) {
|
|
640
|
+
const n = e.split(".");
|
|
641
|
+
let r = [t];
|
|
642
|
+
for (let s = 0, c = n.length; s < c; s++) {
|
|
643
|
+
const i = n[s];
|
|
644
644
|
let o = [];
|
|
645
|
-
for (let l = 0,
|
|
645
|
+
for (let l = 0, d = r.length; l < d; l++) {
|
|
646
646
|
const u = r[l];
|
|
647
647
|
if (u != null)
|
|
648
648
|
if (Object.hasOwnProperty.call(u, i)) {
|
|
@@ -654,120 +654,120 @@ function cn(e, n) {
|
|
|
654
654
|
}
|
|
655
655
|
return Array.isArray(r[0]) ? [].concat(...r) : r;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
const
|
|
659
|
-
for (let r = 0, s =
|
|
660
|
-
const c =
|
|
661
|
-
for (let l = 0,
|
|
662
|
-
|
|
657
|
+
function it(e, t) {
|
|
658
|
+
const n = [];
|
|
659
|
+
for (let r = 0, s = t.length; r < s; r++) {
|
|
660
|
+
const c = t[r], i = ut(c), o = lt(e, c);
|
|
661
|
+
for (let l = 0, d = o.length; l < d; l++)
|
|
662
|
+
n.push({
|
|
663
663
|
itemValue: o[l],
|
|
664
664
|
attributes: i
|
|
665
665
|
});
|
|
666
666
|
}
|
|
667
|
-
return
|
|
667
|
+
return n;
|
|
668
668
|
}
|
|
669
669
|
const Ie = {
|
|
670
670
|
maxRanking: 1 / 0,
|
|
671
671
|
minRanking: -1 / 0
|
|
672
672
|
};
|
|
673
|
-
function
|
|
673
|
+
function ut(e) {
|
|
674
674
|
return typeof e == "string" ? Ie : {
|
|
675
675
|
...Ie,
|
|
676
676
|
...e
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
|
-
const
|
|
680
|
-
indicators:
|
|
681
|
-
"size-xs": "_size-
|
|
682
|
-
"dropdown-indicator": "_dropdown-
|
|
683
|
-
"styled-icon": "_styled-
|
|
684
|
-
open:
|
|
685
|
-
disabled:
|
|
686
|
-
"input-wrapper": "_input-
|
|
687
|
-
"icon-placement-right": "_icon-placement-
|
|
688
|
-
root:
|
|
689
|
-
"icon-placement-left": "_icon-placement-
|
|
690
|
-
"icon-placement-both": "_icon-placement-
|
|
691
|
-
clearable:
|
|
692
|
-
transparent:
|
|
693
|
-
"variant-danger": "_variant-
|
|
694
|
-
"variant-success": "_variant-
|
|
695
|
-
"variant-warning": "_variant-
|
|
696
|
-
"size-lg": "_size-
|
|
697
|
-
"size-md": "_size-
|
|
698
|
-
"size-sm": "_size-
|
|
699
|
-
"icon-wrapper": "_icon-
|
|
700
|
-
wrapper:
|
|
701
|
-
menu:
|
|
702
|
-
item:
|
|
703
|
-
highlighted:
|
|
704
|
-
selected:
|
|
705
|
-
multiple:
|
|
706
|
-
allowUnselectFromList:
|
|
707
|
-
tags:
|
|
708
|
-
"styled-tag": "_styled-
|
|
679
|
+
const dt = "_indicators_1tqnt_2", ft = "_open_1tqnt_34", mt = "_disabled_1tqnt_40", ht = "_root_1tqnt_51", _t = "_clearable_1tqnt_86", pt = "_transparent_1tqnt_104", At = "_wrapper_1tqnt_204", gt = "_menu_1tqnt_211", It = "_item_1tqnt_239", vt = "_highlighted_1tqnt_253", Et = "_selected_1tqnt_256", Ot = "_multiple_1tqnt_256", yt = "_allowUnselectFromList_1tqnt_260", wt = "_tags_1tqnt_268", we = {
|
|
680
|
+
indicators: dt,
|
|
681
|
+
"size-xs": "_size-xs_1tqnt_11",
|
|
682
|
+
"dropdown-indicator": "_dropdown-indicator_1tqnt_14",
|
|
683
|
+
"styled-icon": "_styled-icon_1tqnt_28",
|
|
684
|
+
open: ft,
|
|
685
|
+
disabled: mt,
|
|
686
|
+
"input-wrapper": "_input-wrapper_1tqnt_44",
|
|
687
|
+
"icon-placement-right": "_icon-placement-right_1tqnt_47",
|
|
688
|
+
root: ht,
|
|
689
|
+
"icon-placement-left": "_icon-placement-left_1tqnt_83",
|
|
690
|
+
"icon-placement-both": "_icon-placement-both_1tqnt_83",
|
|
691
|
+
clearable: _t,
|
|
692
|
+
transparent: pt,
|
|
693
|
+
"variant-danger": "_variant-danger_1tqnt_140",
|
|
694
|
+
"variant-success": "_variant-success_1tqnt_143",
|
|
695
|
+
"variant-warning": "_variant-warning_1tqnt_146",
|
|
696
|
+
"size-lg": "_size-lg_1tqnt_149",
|
|
697
|
+
"size-md": "_size-md_1tqnt_157",
|
|
698
|
+
"size-sm": "_size-sm_1tqnt_165",
|
|
699
|
+
"icon-wrapper": "_icon-wrapper_1tqnt_173",
|
|
700
|
+
wrapper: At,
|
|
701
|
+
menu: gt,
|
|
702
|
+
item: It,
|
|
703
|
+
highlighted: vt,
|
|
704
|
+
selected: Et,
|
|
705
|
+
multiple: Ot,
|
|
706
|
+
allowUnselectFromList: yt,
|
|
707
|
+
tags: wt,
|
|
708
|
+
"styled-tag": "_styled-tag_1tqnt_271"
|
|
709
709
|
}, ve = ye(we);
|
|
710
|
-
function
|
|
711
|
-
return /* @__PURE__ */ v("div", { className: ve("tags"), role: "list", children: e.map((
|
|
710
|
+
function Ct(e, t) {
|
|
711
|
+
return /* @__PURE__ */ v("div", { className: ve("tags"), role: "list", children: e.map((n) => (
|
|
712
712
|
// TODO migrate after WUI-187/tag
|
|
713
713
|
/* @__PURE__ */ v(
|
|
714
714
|
Ge,
|
|
715
715
|
{
|
|
716
716
|
className: ve("styled-tag"),
|
|
717
|
-
onRemove: () => n
|
|
717
|
+
onRemove: () => t(n.value.toString()),
|
|
718
718
|
role: "listitem",
|
|
719
|
-
children:
|
|
719
|
+
children: n.label
|
|
720
720
|
},
|
|
721
|
-
|
|
721
|
+
n.value
|
|
722
722
|
)
|
|
723
723
|
)) });
|
|
724
724
|
}
|
|
725
|
-
const ee = "",
|
|
725
|
+
const ee = "", xt = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g, Ce = (e) => {
|
|
726
726
|
if (typeof e == "number")
|
|
727
727
|
return String(e);
|
|
728
728
|
if (typeof e == "string") {
|
|
729
|
-
const
|
|
730
|
-
return
|
|
729
|
+
const t = e.match(xt);
|
|
730
|
+
return t && t.map((n) => n.toLowerCase()).join("-");
|
|
731
731
|
}
|
|
732
|
-
}, Ee = (e) => e ? e.label : ee,
|
|
733
|
-
(
|
|
732
|
+
}, Ee = (e) => e ? e.label : ee, Nt = (e) => e.reduce(
|
|
733
|
+
(t, n) => n.label && t.length > n.label.length ? t : n.label,
|
|
734
734
|
ee
|
|
735
|
-
),
|
|
736
|
-
const r =
|
|
737
|
-
return r &&
|
|
738
|
-
}, Q = (e,
|
|
735
|
+
), bt = (e, t, n) => {
|
|
736
|
+
const r = t.find((s) => e.value === s.value);
|
|
737
|
+
return r && n ? t.filter((s) => e.value !== s.value) : r ? t : [...t, e];
|
|
738
|
+
}, Q = (e, t) => !!t.find((n) => n.value === e), J = (e, t = []) => t.find(
|
|
739
739
|
(r) => r.label === (e.label || e) || r.value === (e.value || e)
|
|
740
|
-
) || { label: e, value: Ce(e) },
|
|
741
|
-
const r =
|
|
740
|
+
) || { label: e, value: Ce(e) }, Rt = (e, t, n = !1) => {
|
|
741
|
+
const r = n ? t.flatMap((s) => s.options) : t;
|
|
742
742
|
return !e && e !== 0 ? [] : Array.isArray(e) ? e.map((s) => J(s, r)) : [J(e, r)];
|
|
743
|
-
},
|
|
744
|
-
(
|
|
745
|
-
) : [],
|
|
743
|
+
}, qt = (e, t) => !!t.find((n) => n.value === e.value), kt = (e, t) => qt(e, t) ? e.value : e.label, Oe = (e, t) => e ? e.map((n) => kt(n, t)) : [], St = (e, t) => e ? e.filter(
|
|
744
|
+
(n) => !t.find((r) => r.value === n.value)
|
|
745
|
+
) : [], Ut = ({
|
|
746
746
|
inputValue: e,
|
|
747
|
-
isMultiple:
|
|
748
|
-
isSearchable:
|
|
747
|
+
isMultiple: t,
|
|
748
|
+
isSearchable: n,
|
|
749
749
|
options: r,
|
|
750
750
|
renderItem: s
|
|
751
751
|
}) => {
|
|
752
752
|
const c = J(e, r);
|
|
753
|
-
return
|
|
754
|
-
}, w = ye(we),
|
|
753
|
+
return t ? e : c.label ? n ? c.label : s(c) : ee;
|
|
754
|
+
}, w = ye(we), Vt = me.default || me, Tt = Le(
|
|
755
755
|
({
|
|
756
756
|
allowUnselectFromList: e,
|
|
757
|
-
autoComplete:
|
|
758
|
-
autoFocus:
|
|
757
|
+
autoComplete: t = "off",
|
|
758
|
+
autoFocus: n,
|
|
759
759
|
className: r,
|
|
760
760
|
dataTestId: s,
|
|
761
761
|
disableCloseOnSelect: c,
|
|
762
762
|
disabled: i,
|
|
763
763
|
groupsEnabled: o,
|
|
764
764
|
icon: l,
|
|
765
|
-
iconPlacement:
|
|
765
|
+
iconPlacement: d = "left",
|
|
766
766
|
id: u,
|
|
767
767
|
isClearable: h,
|
|
768
768
|
isCreatable: E,
|
|
769
769
|
isMultiple: p,
|
|
770
|
-
isSearchable:
|
|
770
|
+
isSearchable: m,
|
|
771
771
|
name: k,
|
|
772
772
|
onBlur: T,
|
|
773
773
|
onChange: R,
|
|
@@ -775,11 +775,11 @@ const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
775
775
|
onCreate: $,
|
|
776
776
|
onFocus: xe,
|
|
777
777
|
options: I = [],
|
|
778
|
-
placeholder:
|
|
778
|
+
placeholder: te = "Choose from…",
|
|
779
779
|
renderCreateItem: Ne = (F) => `Create "${F}"`,
|
|
780
|
-
renderGroupHeader:
|
|
780
|
+
renderGroupHeader: ne,
|
|
781
781
|
renderItem: H = Ee,
|
|
782
|
-
renderMultiple: be =
|
|
782
|
+
renderMultiple: be = Ct,
|
|
783
783
|
size: z = "lg",
|
|
784
784
|
transparent: re,
|
|
785
785
|
value: se,
|
|
@@ -787,64 +787,64 @@ const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
787
787
|
...oe
|
|
788
788
|
}, Re) => {
|
|
789
789
|
const { getInputProps: F, variant: qe } = Xe(), le = qe || ae, D = Pe(
|
|
790
|
-
() =>
|
|
790
|
+
() => Rt(se, I, o),
|
|
791
791
|
[se, I, o]
|
|
792
792
|
), Y = !p && D[0] || null, B = Y ? Y.label : "", [x, X] = P(D), [C, U] = P(B), [M, j] = P(I), [N, q] = P(!1);
|
|
793
|
-
|
|
793
|
+
m = E || m;
|
|
794
794
|
const [Z, ke] = Qe(Re);
|
|
795
795
|
he(() => {
|
|
796
|
-
|
|
797
|
-
}, [
|
|
796
|
+
n && Z.current && (Z.current.focus(), m && q(!0));
|
|
797
|
+
}, [m, n, Z]), he(() => {
|
|
798
798
|
X(D), U(B), j(I);
|
|
799
799
|
}, [B, I, D]);
|
|
800
800
|
const Se = (a) => {
|
|
801
|
-
if (
|
|
802
|
-
let
|
|
803
|
-
o ?
|
|
801
|
+
if (m && a !== C) {
|
|
802
|
+
let f = [];
|
|
803
|
+
o ? f = G(I, a, {
|
|
804
804
|
// should match on group.label OR group.options.label
|
|
805
805
|
keys: [(A) => A.label, (A) => A.options.map((O) => O.label)]
|
|
806
|
-
}) :
|
|
806
|
+
}) : f = G(I, a, { keys: ["label"] }), U(a), j(f);
|
|
807
807
|
}
|
|
808
808
|
}, Ue = () => {
|
|
809
|
-
|
|
809
|
+
m && !N && q(!0);
|
|
810
810
|
}, ce = (a) => {
|
|
811
|
-
let
|
|
812
|
-
o ?
|
|
811
|
+
let f = [];
|
|
812
|
+
o ? f = Oe(
|
|
813
813
|
a,
|
|
814
814
|
I.flatMap((_) => _.options)
|
|
815
|
-
) :
|
|
816
|
-
const A = p ?
|
|
815
|
+
) : f = Oe(a, I);
|
|
816
|
+
const A = p ? f : f[0], O = Ze({ name: k, value: p ? a : a[0] });
|
|
817
817
|
if (R == null || R(A, O), E) {
|
|
818
|
-
const _ =
|
|
818
|
+
const _ = St(a, I);
|
|
819
819
|
_.length && ($ == null || $(_[0].label, O));
|
|
820
820
|
}
|
|
821
821
|
}, Ve = (a) => {
|
|
822
|
-
let
|
|
823
|
-
!a || a != null && a.disabled ? (
|
|
822
|
+
let f, A;
|
|
823
|
+
!a || a != null && a.disabled ? (f = p ? x : [], A = !0) : (f = p ? bt(a, x, e) : [a], A = p), A && U(""), j(I), X(f), ce(f), c || q(!1);
|
|
824
824
|
}, Te = (a) => {
|
|
825
|
-
const
|
|
826
|
-
X(
|
|
825
|
+
const f = x.filter((A) => A.value !== a);
|
|
826
|
+
X(f), ce(f);
|
|
827
827
|
}, He = (a) => {
|
|
828
828
|
S == null || S(a), q(!N);
|
|
829
829
|
}, ze = (a) => {
|
|
830
|
-
p && a.selectedItem ? U("") :
|
|
831
|
-
}, Fe =
|
|
830
|
+
p && a.selectedItem ? U("") : m && a.selectedItem && U(a.selectedItem.label), j(I), q(!1);
|
|
831
|
+
}, Fe = Nt(I), ie = Ut({
|
|
832
832
|
inputValue: C,
|
|
833
833
|
isMultiple: p,
|
|
834
|
-
isSearchable:
|
|
834
|
+
isSearchable: m,
|
|
835
835
|
options: I,
|
|
836
836
|
renderItem: H
|
|
837
837
|
}), De = $e(
|
|
838
838
|
({
|
|
839
839
|
getItemProps: a,
|
|
840
|
-
highlightedIndex:
|
|
840
|
+
highlightedIndex: f,
|
|
841
841
|
options: A
|
|
842
842
|
}) => A.reduce(
|
|
843
843
|
(O, _, W) => {
|
|
844
844
|
if (o && "options" in _)
|
|
845
845
|
O.itemsToRender.push(
|
|
846
846
|
/* @__PURE__ */ L(Ye, { children: [
|
|
847
|
-
|
|
847
|
+
ne(_),
|
|
848
848
|
_.options ? _.options.map((y) => {
|
|
849
849
|
const b = O.itemIndex++, K = Q(y.value, x);
|
|
850
850
|
return /* @__PURE__ */ v(
|
|
@@ -852,7 +852,7 @@ const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
852
852
|
{
|
|
853
853
|
className: w(
|
|
854
854
|
"item",
|
|
855
|
-
|
|
855
|
+
f === b && "highlighted",
|
|
856
856
|
p && "multiple",
|
|
857
857
|
e && "allowUnselectFromList",
|
|
858
858
|
y.disabled && "disabled",
|
|
@@ -870,7 +870,7 @@ const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
870
870
|
] }, _.label)
|
|
871
871
|
);
|
|
872
872
|
else if ("value" in _) {
|
|
873
|
-
const y = Q(_.value, x), b =
|
|
873
|
+
const y = Q(_.value, x), b = f === W;
|
|
874
874
|
O.itemsToRender.push(
|
|
875
875
|
/* @__PURE__ */ v(
|
|
876
876
|
"li",
|
|
@@ -897,22 +897,22 @@ const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
897
897
|
},
|
|
898
898
|
{ itemIndex: 0, itemsToRender: [] }
|
|
899
899
|
).itemsToRender,
|
|
900
|
-
[p, e, x, o,
|
|
900
|
+
[p, e, x, o, ne, H]
|
|
901
901
|
), ue = w(
|
|
902
902
|
"root",
|
|
903
903
|
`size-${z}`,
|
|
904
904
|
le && `variant-${le}`,
|
|
905
905
|
h && "clearable",
|
|
906
906
|
re && "transparent",
|
|
907
|
-
l && `icon-placement-${
|
|
907
|
+
l && `icon-placement-${d}`,
|
|
908
908
|
r,
|
|
909
909
|
i && "disabled"
|
|
910
910
|
);
|
|
911
911
|
return /* @__PURE__ */ v(
|
|
912
|
-
|
|
912
|
+
Vt,
|
|
913
913
|
{
|
|
914
914
|
id: u,
|
|
915
|
-
inputValue:
|
|
915
|
+
inputValue: m ? ie : "",
|
|
916
916
|
isOpen: N,
|
|
917
917
|
itemToString: Ee,
|
|
918
918
|
onInputValueChange: Se,
|
|
@@ -921,14 +921,14 @@ const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
921
921
|
selectedItem: Y,
|
|
922
922
|
children: ({
|
|
923
923
|
clearSelection: a,
|
|
924
|
-
getInputProps:
|
|
924
|
+
getInputProps: f,
|
|
925
925
|
getItemProps: A,
|
|
926
926
|
getMenuProps: O,
|
|
927
927
|
getRootProps: _,
|
|
928
928
|
getToggleButtonProps: W,
|
|
929
929
|
highlightedIndex: y
|
|
930
930
|
}) => {
|
|
931
|
-
const b = !!(E && C && !Q(C, x)), K = N && (M.length || b),
|
|
931
|
+
const b = !!(E && C && !Q(C, x)), K = N && (M.length || b), de = h && C, Me = /* @__PURE__ */ v("div", { className: w("dropdown-indicator", N && "open"), children: /* @__PURE__ */ v(
|
|
932
932
|
Be,
|
|
933
933
|
{
|
|
934
934
|
animatePresence: !0,
|
|
@@ -947,10 +947,10 @@ const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
947
947
|
}),
|
|
948
948
|
children: /* @__PURE__ */ v(_e, { className: w("styled-icon"), name: "angle-down", size: "lg" })
|
|
949
949
|
}
|
|
950
|
-
), We = _(oe, { suppressRefError: !0 }),
|
|
951
|
-
autoComplete:
|
|
952
|
-
autoFocus:
|
|
953
|
-
"data-spacer": Fe ||
|
|
950
|
+
), We = _(oe, { suppressRefError: !0 }), fe = f({
|
|
951
|
+
autoComplete: t,
|
|
952
|
+
autoFocus: n,
|
|
953
|
+
"data-spacer": Fe || te,
|
|
954
954
|
"data-testid": s,
|
|
955
955
|
disabled: i,
|
|
956
956
|
id: u,
|
|
@@ -959,7 +959,7 @@ const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
959
959
|
onClick: i ? void 0 : He,
|
|
960
960
|
onFocus: xe,
|
|
961
961
|
onKeyDown: Ue,
|
|
962
|
-
placeholder:
|
|
962
|
+
placeholder: te,
|
|
963
963
|
ref: ke,
|
|
964
964
|
size: z,
|
|
965
965
|
tabIndex: 0,
|
|
@@ -968,17 +968,17 @@ const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
968
968
|
...oe
|
|
969
969
|
});
|
|
970
970
|
return /* @__PURE__ */ L("div", { ...We, className: w("wrapper", i && "disabled"), children: [
|
|
971
|
-
|
|
971
|
+
m ? /* @__PURE__ */ v(
|
|
972
972
|
"input",
|
|
973
973
|
{
|
|
974
974
|
className: ue,
|
|
975
975
|
type: "text",
|
|
976
|
-
...F(
|
|
976
|
+
...F(fe)
|
|
977
977
|
}
|
|
978
|
-
) : /* @__PURE__ */ v("div", { className: ue, ...F(
|
|
978
|
+
) : /* @__PURE__ */ v("div", { className: ue, ...F(fe), children: ie }),
|
|
979
979
|
l ? /* @__PURE__ */ v("div", { className: w("icon-wrapper", "icon-placement-left", `size-${z}`), children: /* @__PURE__ */ v(_e, { ...l.props, size: "md" }) }) : null,
|
|
980
980
|
/* @__PURE__ */ L("div", { className: w("indicators", `size-${z}`), children: [
|
|
981
|
-
|
|
981
|
+
de ? Me : null,
|
|
982
982
|
je
|
|
983
983
|
] }),
|
|
984
984
|
K ? /* @__PURE__ */ L("ul", { className: w("menu"), ...O(), children: [
|
|
@@ -1006,7 +1006,7 @@ const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
1006
1006
|
);
|
|
1007
1007
|
}
|
|
1008
1008
|
);
|
|
1009
|
-
|
|
1009
|
+
Tt.displayName = "Select";
|
|
1010
1010
|
export {
|
|
1011
|
-
|
|
1011
|
+
Tt as Select
|
|
1012
1012
|
};
|
package/dist/Textarea.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.
|
|
1
|
+
@layer components{._root_161f5_2{border-radius:var(--components-dimensions-input-border-radius);border-style:solid;border-width:var(--components-dimensions-input-border-width-default);font-size:var(--font-size-sm);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-md);width:100%;transition:var(--duration-medium);padding:var(--spacing-md);outline:none;background-color:var(--textAreaBackgroundColor, var(--components-colors-input-color-background-default));color:var(--textAreaColor, var(--components-colors-input-color-text-default));border-color:var(--textAreaBorderColor, var(--components-colors-input-color-border-default));box-shadow:var(--textAreaBoxShadow, var(--inset-10)) inset;field-sizing:var(--textAreaFieldSizing, fixed);min-height:var(--textAreaMinHeight, 8.125rem)}._root_161f5_2:disabled,._root_161f5_2[aria-disabled]{--textAreaBackgroundColor: var(--components-colors-input-color-background-disabled);--textAreaColor: var(--components-colors-input-color-text-disabled);cursor:not-allowed}._root_161f5_2:hover{--textAreaBorderColor: var(--components-colors-input-color-border-hover);--textAreaBoxShadow: var(--inset-20)}._root_161f5_2:active,._root_161f5_2:focus{--textAreaBorderColor: var(--components-colors-input-color-border-active)}._root_161f5_2::placeholder{color:var(--components-colors-input-color-text-placeholder)}._variant-danger_161f5_36{--textAreaBorderColor: var(--components-colors-input-color-border-error)}._variant-warning_161f5_39{--textAreaBorderColor: var(--components-colors-input-color-border-warning)}._variant-success_161f5_42{--textAreaBorderColor: var(--components-colors-input-color-border-success)}._adaptative_161f5_45{--textAreaFieldSizing: content;--textAreaMinHeight: auto}}
|