@midas-ds/components 1.0.3 → 1.1.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/{Button-B4vMZbC6.js → Button-DL6nqUco.js} +22 -22
- package/CHANGELOG.md +6 -1
- package/{Checkbox-DnKWanep.js → Checkbox-q0dugR2t.js} +8 -8
- package/{Collection-COLWgm24.js → Collection-KMFfVuzU.js} +2 -2
- package/{Dialog-Cb6toyXO.js → Dialog-D6Bqrpn-.js} +170 -169
- package/Disclosure-dAZYXyTH.js +225 -0
- package/Disclosure.css +1 -0
- package/{FocusScope-C8i7CH6y.js → FocusScope-B7CkxXNC.js} +1 -1
- package/{Form-BQQs3jUk.js → Form-BWBjJC6v.js} +42 -42
- package/{Group-CdwXhx8Q.js → Group-D7_8007y.js} +10 -10
- package/Heading-RCRHv6hd.js +15 -0
- package/{Hidden-DngIphiL.js → Hidden-CVlUgUJM.js} +1 -1
- package/{Link-iAZLB3RI.js → Link-BnQvB-hH.js} +8 -8
- package/{ListBox-BKWkIIm6.js → ListBox-DBBiqvcR.js} +72 -72
- package/{ListKeyboardDelegate-BH-K5hyq.js → ListKeyboardDelegate-gCXy-Xnn.js} +2 -2
- package/{PressResponder-Cz-TRBHO.js → PressResponder-B4g56kDz.js} +5 -5
- package/{RSPContexts-EOiWkKOf.js → RSPContexts-BW2SEIqe.js} +2 -2
- package/{SelectionManager-8o40f7mx.js → SelectionManager-BfXUE1qg.js} +113 -129
- package/{Separator-BlvmQjwz.js → Separator-BBX9m2O2.js} +2 -2
- package/{Tag--W5TgxmK.js → Tag-DWt0koFj.js} +74 -74
- package/Text-BCF0xvqL.js +15 -0
- package/{TextField-DeK_yiK-.js → TextField-CX4eOQf6.js} +33 -33
- package/{TextField.module-0-u4LVPp.js → TextField.module-DdICj682.js} +7 -7
- package/{VisuallyHidden-CFx06Bae.js → VisuallyHidden-Dhr5caPC.js} +1 -1
- package/accordion/Accordion.d.ts +8 -8
- package/accordion/AccordionItem.d.ts +11 -3
- package/accordion/index.d.ts +0 -3
- package/{context-Bnqknrce.js → context-BpJLnOuu.js} +11 -11
- package/global.css +1 -0
- package/index.d.ts +1 -0
- package/index.js +105 -110
- package/index10.js +1 -1
- package/index11.js +1 -1
- package/index12.js +1 -1
- package/index13.js +1 -1
- package/index14.js +1 -1
- package/index15.js +2 -2
- package/index16.js +2 -2
- package/index17.js +1 -1
- package/index18.js +1 -1
- package/index19.js +2 -2
- package/index2.js +1 -1
- package/index20.js +2 -2
- package/index21.js +1 -1
- package/index22.js +1 -1
- package/index23.js +1 -1
- package/index24.js +1 -1
- package/index25.js +2 -2
- package/index26.js +2 -2
- package/index27.js +2 -2
- package/index28.js +1 -1
- package/index29.js +2 -8
- package/index3.js +1 -1
- package/index30.js +17 -16
- package/index31.js +1 -1
- package/index32.js +1 -1
- package/index33.js +1 -1
- package/index34.js +2 -2
- package/index36.js +1 -1
- package/index37.js +1 -1
- package/index38.js +1 -1
- package/index39.js +1 -1
- package/index4.js +1 -1
- package/index40.js +19 -12
- package/index41.js +61 -14
- package/index42.js +44 -22
- package/index43.js +13 -11
- package/index44.js +25 -4
- package/index45.js +16 -51
- package/index46.js +19 -16
- package/index47.js +49 -27
- package/index48.js +5 -18
- package/index49.js +25 -21
- package/index5.js +1 -1
- package/index50.js +16 -47
- package/index51.js +7 -3
- package/index52.js +18 -18
- package/index53.js +16 -16
- package/index54.js +5 -3
- package/index55.js +7 -20
- package/index56.js +13 -16
- package/index57.js +6 -8
- package/index58.js +5 -8
- package/index59.js +17 -13
- package/index6.js +1 -1
- package/index60.js +20 -7
- package/index61.js +59 -7
- package/index62.js +13 -17
- package/index63.js +9 -20
- package/index64.js +38 -46
- package/index65.js +85 -15
- package/index66.js +74 -11
- package/index67.js +23 -62
- package/index68.js +64 -80
- package/index69.js +68 -62
- package/index7.js +1 -1
- package/index70.js +138 -22
- package/index71.js +66 -65
- package/index72.js +40 -78
- package/index73.js +75 -133
- package/index74.js +69 -68
- package/index75.js +96 -34
- package/index76.js +258 -65
- package/index77.js +715 -63
- package/index78.js +478 -93
- package/index79.js +303 -263
- package/index8.js +1 -1
- package/index80.js +343 -677
- package/index81.js +242 -479
- package/index82.js +1332 -282
- package/index83.js +966 -346
- package/index84.js +344 -210
- package/index85.js +2024 -1286
- package/index86.js +2314 -955
- package/index87.js +6785 -340
- package/index88.js +15 -2099
- package/index89.js +12 -2367
- package/index9.js +1 -1
- package/index90.js +4 -6834
- package/index91.js +7 -15
- package/package.json +1 -1
- package/useControlledState-Kv9K2AYu.js +30 -0
- package/{useDescription-BPs7eRff.js → useDescription-B7stiK3j.js} +1 -1
- package/useEvent-Xk5kn5Ns.js +21 -0
- package/{useField-Dz62UHCP.js → useField-DMzJIIN4.js} +5 -5
- package/{useFilter-ViwzkzZe.js → useFilter-Bt9dbV1U.js} +1 -1
- package/{useFocusRing-BKGhL91C.js → useFocusRing-9PXyKy2A.js} +26 -26
- package/{useFocusable-CRSmYEQc.js → useFocusable-CcEBZe40.js} +1 -1
- package/{useGridSelectionCheckbox-CVEvUCJL.js → useGridSelectionCheckbox-DYgEnElE.js} +3 -3
- package/{useHasTabbableChild-C8y4fwiY.js → useHasTabbableChild-D6DwR81L.js} +5 -5
- package/{useHighlightSelectionDescription-CD74uzLh.js → useHighlightSelectionDescription-WYAbP4No.js} +4 -4
- package/useLabels-9zaZ9oa0.js +17 -0
- package/{useListState-DKnP5TB5.js → useListState-BfTeKTk5.js} +1 -1
- package/{useLocalizedStringFormatter-DsZ-ZWSk.js → useLocalizedStringFormatter-BlCbn-hX.js} +1 -1
- package/{useSingleSelectListState-BHTLh8Ob.js → useSingleSelectListState-DPkaL0la.js} +2 -2
- package/Text-CQPW6xs7.js +0 -15
- package/accordion/AccordionContent.d.ts +0 -3
- package/accordion/AccordionTagContext.d.ts +0 -3
- package/accordion/AccordionTrigger.d.ts +0 -3
- package/index-DK9ZACEc.js +0 -642
- package/index.css +0 -1
- package/index92.js +0 -14
- package/index93.js +0 -6
- package/index94.js +0 -9
- package/useControlledState-DrAoodI6.js +0 -45
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as F, jsxs as qe } from "react/jsx-runtime";
|
|
2
|
-
import { a as
|
|
3
|
-
import { $ as
|
|
4
|
-
import {
|
|
5
|
-
import { b as lr, $ as sr } from "./useField-
|
|
6
|
-
import { $ as
|
|
7
|
-
import { $ as dr } from "./Text-
|
|
8
|
-
import g, { useRef as T, useState as cr, useEffect as ee, forwardRef as re, useContext as
|
|
9
|
-
import { $ as fr } from "./useListState-
|
|
10
|
-
import { b as h, a as br } from "./ListKeyboardDelegate-
|
|
11
|
-
import { a as pr, b as $r } from "./useHighlightSelectionDescription-
|
|
12
|
-
import { $ as mr } from "./useHasTabbableChild-
|
|
13
|
-
import { $ as vr } from "./Separator-
|
|
14
|
-
import { $ as oe } from "./context-
|
|
15
|
-
import { $ as gr } from "./useDescription-
|
|
16
|
-
import { h as xr, d as yr, i as E } from "./SelectionManager-
|
|
17
|
-
import { $ as U } from "./FocusScope-
|
|
18
|
-
import { $ as Dr } from "./useLocalizedStringFormatter-
|
|
19
|
-
import { Button as Br } from "./
|
|
2
|
+
import { a as Je } from "./Button-DL6nqUco.js";
|
|
3
|
+
import { $ as Qe, a as Xe, b as q, f as Ye, c as Ze, d as _e } from "./Collection-KMFfVuzU.js";
|
|
4
|
+
import { k as J, o as z, e as y, C as er, I as rr, Q, u as P, J as tr, f as or, P as ar, a as X, z as nr, B as Y, c as Z, d as _, i as ir, b as ur } from "./useFocusRing-9PXyKy2A.js";
|
|
5
|
+
import { b as lr, $ as sr } from "./useField-DMzJIIN4.js";
|
|
6
|
+
import { $ as N } from "./ListBox-DBBiqvcR.js";
|
|
7
|
+
import { $ as dr } from "./Text-BCF0xvqL.js";
|
|
8
|
+
import g, { useRef as T, useState as cr, useEffect as ee, forwardRef as re, useContext as S, createContext as te } from "react";
|
|
9
|
+
import { $ as fr } from "./useListState-BfTeKTk5.js";
|
|
10
|
+
import { b as h, a as br } from "./ListKeyboardDelegate-gCXy-Xnn.js";
|
|
11
|
+
import { a as pr, b as $r } from "./useHighlightSelectionDescription-WYAbP4No.js";
|
|
12
|
+
import { $ as mr } from "./useHasTabbableChild-D6DwR81L.js";
|
|
13
|
+
import { $ as vr } from "./Separator-BBX9m2O2.js";
|
|
14
|
+
import { $ as oe } from "./context-BpJLnOuu.js";
|
|
15
|
+
import { $ as gr } from "./useDescription-B7stiK3j.js";
|
|
16
|
+
import { h as xr, d as yr, i as E } from "./SelectionManager-BfXUE1qg.js";
|
|
17
|
+
import { $ as U } from "./FocusScope-B7CkxXNC.js";
|
|
18
|
+
import { $ as Dr } from "./useLocalizedStringFormatter-BlCbn-hX.js";
|
|
19
|
+
import { Button as Br } from "./index66.js";
|
|
20
20
|
import { c as kr } from "./clsx-OuTLNxxd.js";
|
|
21
21
|
import { X as Pr } from "./x-JK7i-TQC.js";
|
|
22
22
|
import './Tag.css';const V = /* @__PURE__ */ new WeakMap();
|
|
@@ -43,7 +43,7 @@ function Er(t, e, r) {
|
|
|
43
43
|
selectOnFocus: e.selectionManager.selectionBehavior === "replace",
|
|
44
44
|
shouldFocusWrap: t.shouldFocusWrap,
|
|
45
45
|
linkBehavior: d
|
|
46
|
-
}), u =
|
|
46
|
+
}), u = J(t.id);
|
|
47
47
|
V.set(e, {
|
|
48
48
|
id: u,
|
|
49
49
|
onAction: i,
|
|
@@ -55,7 +55,7 @@ function Er(t, e, r) {
|
|
|
55
55
|
hasItemActions: !!i
|
|
56
56
|
}), f = mr(r, {
|
|
57
57
|
isDisabled: e.collection.size !== 0
|
|
58
|
-
}), b =
|
|
58
|
+
}), b = z(t, {
|
|
59
59
|
labelable: !0
|
|
60
60
|
}), m = y(
|
|
61
61
|
b,
|
|
@@ -89,33 +89,33 @@ function Cr(t, e, r) {
|
|
|
89
89
|
let { node: o, isVirtualized: i, shouldSelectOnPressUp: d } = t, { direction: s } = oe(), { onAction: c, linkBehavior: u, keyboardNavigationBehavior: $ } = V.get(e), f = er(), b = T(null), m = () => {
|
|
90
90
|
var n;
|
|
91
91
|
r.current !== null && (b.current != null && o.key !== b.current || !(!((n = r.current) === null || n === void 0) && n.contains(document.activeElement))) && P(r.current);
|
|
92
|
-
},
|
|
92
|
+
}, K = {}, D, R = e.selectionManager.isLink(o.key);
|
|
93
93
|
if (o != null && "expandedKeys" in e) {
|
|
94
94
|
var C, w, L;
|
|
95
95
|
let n = (C = (w = e.collection).getChildren) === null || C === void 0 ? void 0 : C.call(w, o.key);
|
|
96
96
|
D = [
|
|
97
97
|
...n ?? []
|
|
98
|
-
].length > 1, c == null && !
|
|
98
|
+
].length > 1, c == null && !R && e.selectionManager.selectionMode === "none" && D && (c = () => e.toggleKey(o.key));
|
|
99
99
|
let v = D ? e.expandedKeys.has(o.key) : void 0, k = 1;
|
|
100
100
|
var A;
|
|
101
101
|
if (o.level > 0 && (o == null ? void 0 : o.parentKey) != null) {
|
|
102
102
|
let p = e.collection.getItem(o.parentKey);
|
|
103
103
|
if (p) {
|
|
104
|
-
var B,
|
|
105
|
-
let x = (B = (
|
|
104
|
+
var B, I;
|
|
105
|
+
let x = (B = (I = e.collection).getChildren) === null || B === void 0 ? void 0 : B.call(I, p.key);
|
|
106
106
|
k = xr(x).index + 1;
|
|
107
107
|
}
|
|
108
108
|
} else k = ((A = (L = [
|
|
109
109
|
...e.collection
|
|
110
110
|
].filter((p) => p.level === 0).at(-1)) === null || L === void 0 ? void 0 : L.index) !== null && A !== void 0 ? A : 0) + 1;
|
|
111
|
-
|
|
111
|
+
K = {
|
|
112
112
|
"aria-expanded": v,
|
|
113
113
|
"aria-level": o.level + 1,
|
|
114
114
|
"aria-posinset": (o == null ? void 0 : o.index) + 1,
|
|
115
115
|
"aria-setsize": k
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
let { itemProps:
|
|
118
|
+
let { itemProps: je, ...j } = yr({
|
|
119
119
|
selectionManager: e.selectionManager,
|
|
120
120
|
key: o.key,
|
|
121
121
|
ref: r,
|
|
@@ -197,7 +197,7 @@ function Cr(t, e, r) {
|
|
|
197
197
|
tr() || e.selectionManager.setFocusedKey(o.key);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
-
}, We =
|
|
200
|
+
}, We = Q(o.props), He = j.hasAction ? We : {}, O = y(je, He, {
|
|
201
201
|
role: "row",
|
|
202
202
|
onKeyDownCapture: Oe,
|
|
203
203
|
onFocus: Ue,
|
|
@@ -215,13 +215,13 @@ function Cr(t, e, r) {
|
|
|
215
215
|
};
|
|
216
216
|
return {
|
|
217
217
|
rowProps: {
|
|
218
|
-
...y(O,
|
|
218
|
+
...y(O, K)
|
|
219
219
|
},
|
|
220
220
|
gridCellProps: Ge,
|
|
221
221
|
descriptionProps: {
|
|
222
222
|
id: f
|
|
223
223
|
},
|
|
224
|
-
...
|
|
224
|
+
...j
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
function G(t) {
|
|
@@ -251,7 +251,7 @@ function wr(t, e, r) {
|
|
|
251
251
|
linkBehavior: "override"
|
|
252
252
|
}, e, r), [u, $] = cr(!1), { focusWithinProps: f } = or({
|
|
253
253
|
onFocusWithinChange: $
|
|
254
|
-
}), b =
|
|
254
|
+
}), b = z(t), m = T(e.collection.size);
|
|
255
255
|
return ee(() => {
|
|
256
256
|
r.current && m.current > 0 && e.collection.size === 0 && u && r.current.focus(), m.current = e.collection.size;
|
|
257
257
|
}, [
|
|
@@ -414,28 +414,28 @@ Fe = {
|
|
|
414
414
|
removeButtonLabel: "Odstrani",
|
|
415
415
|
removeDescription: "Pritisnite Delete, da odstranite oznako."
|
|
416
416
|
};
|
|
417
|
-
var
|
|
418
|
-
|
|
417
|
+
var ze = {};
|
|
418
|
+
ze = {
|
|
419
419
|
removeButtonLabel: "Ukloni",
|
|
420
420
|
removeDescription: "Pritisnite Obriši da biste uklonili oznaku."
|
|
421
421
|
};
|
|
422
|
-
var
|
|
423
|
-
|
|
422
|
+
var Ke = {};
|
|
423
|
+
Ke = {
|
|
424
424
|
removeButtonLabel: "Ta bort",
|
|
425
425
|
removeDescription: "Tryck på Radera för att ta bort taggen."
|
|
426
426
|
};
|
|
427
|
-
var
|
|
428
|
-
|
|
427
|
+
var Se = {};
|
|
428
|
+
Se = {
|
|
429
429
|
removeButtonLabel: "Kaldır",
|
|
430
430
|
removeDescription: "Etiketi kaldırmak için Sil tuşuna basın."
|
|
431
431
|
};
|
|
432
|
-
var
|
|
433
|
-
|
|
432
|
+
var Ne = {};
|
|
433
|
+
Ne = {
|
|
434
434
|
removeButtonLabel: "Вилучити",
|
|
435
435
|
removeDescription: "Натисніть Delete, щоб вилучити тег."
|
|
436
436
|
};
|
|
437
|
-
var
|
|
438
|
-
|
|
437
|
+
var Re = {};
|
|
438
|
+
Re = {
|
|
439
439
|
removeButtonLabel: "删除",
|
|
440
440
|
removeDescription: "按下“删除”以删除标记。"
|
|
441
441
|
};
|
|
@@ -474,18 +474,18 @@ Ve = {
|
|
|
474
474
|
"ru-RU": Ae,
|
|
475
475
|
"sk-SK": Me,
|
|
476
476
|
"sl-SI": Fe,
|
|
477
|
-
"sr-SP":
|
|
478
|
-
"sv-SE":
|
|
479
|
-
"tr-TR":
|
|
480
|
-
"uk-UA":
|
|
481
|
-
"zh-CN":
|
|
477
|
+
"sr-SP": ze,
|
|
478
|
+
"sv-SE": Ke,
|
|
479
|
+
"tr-TR": Se,
|
|
480
|
+
"uk-UA": Ne,
|
|
481
|
+
"zh-CN": Re,
|
|
482
482
|
"zh-TW": Te
|
|
483
483
|
};
|
|
484
484
|
function Lr(t) {
|
|
485
485
|
return t && t.__esModule ? t.default : t;
|
|
486
486
|
}
|
|
487
487
|
function Ar(t, e, r) {
|
|
488
|
-
let { item: a } = t, l = Dr(Lr(Ve), "@react-aria/tag"), o =
|
|
488
|
+
let { item: a } = t, l = Dr(Lr(Ve), "@react-aria/tag"), o = J(), { onRemove: i } = ae.get(e) || {}, { rowProps: d, gridCellProps: s, ...c } = Cr({
|
|
489
489
|
node: a
|
|
490
490
|
}, e, r);
|
|
491
491
|
delete d.onKeyDownCapture;
|
|
@@ -498,9 +498,9 @@ function Ar(t, e, r) {
|
|
|
498
498
|
}
|
|
499
499
|
}, m = ar();
|
|
500
500
|
m === "virtual" && typeof window < "u" && "ontouchstart" in window && (m = "pointer");
|
|
501
|
-
let
|
|
502
|
-
!f && (
|
|
503
|
-
let L =
|
|
501
|
+
let K = i && (m === "keyboard" || m === "virtual") ? l.format("removeDescription") : "", D = gr(K), R = a.key === e.selectionManager.focusedKey, C = e.selectionManager.focusedKey != null, w = -1;
|
|
502
|
+
!f && (R || !C) && (w = 0);
|
|
503
|
+
let L = z(a.props), A = Q(a.props);
|
|
504
504
|
return {
|
|
505
505
|
removeButtonProps: {
|
|
506
506
|
"aria-label": l.format("removeButtonLabel"),
|
|
@@ -525,21 +525,21 @@ function Ar(t, e, r) {
|
|
|
525
525
|
allowsRemoving: !!i
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
|
-
const Mr = /* @__PURE__ */ te(null),
|
|
529
|
-
return [e, r] =
|
|
528
|
+
const Mr = /* @__PURE__ */ te(null), Ie = /* @__PURE__ */ te(null), Fr = /* @__PURE__ */ re(function(e, r) {
|
|
529
|
+
return [e, r] = X(e, r, Mr), /* @__PURE__ */ g.createElement(Qe, {
|
|
530
530
|
content: e.children
|
|
531
|
-
}, (a) => /* @__PURE__ */ g.createElement(
|
|
531
|
+
}, (a) => /* @__PURE__ */ g.createElement(zr, {
|
|
532
532
|
props: e,
|
|
533
533
|
forwardedRef: r,
|
|
534
534
|
collection: a
|
|
535
535
|
}));
|
|
536
536
|
});
|
|
537
|
-
function
|
|
537
|
+
function zr({ props: t, forwardedRef: e, collection: r }) {
|
|
538
538
|
let a = T(null), [l, o] = nr(), i = fr({
|
|
539
539
|
...t,
|
|
540
540
|
children: void 0,
|
|
541
541
|
collection: r
|
|
542
|
-
}), d =
|
|
542
|
+
}), d = z(t), s = Object.fromEntries(Object.entries(d).map(([m]) => [
|
|
543
543
|
m,
|
|
544
544
|
void 0
|
|
545
545
|
])), { gridProps: c, labelProps: u, descriptionProps: $, errorMessageProps: f } = wr({
|
|
@@ -565,14 +565,14 @@ function Kr({ props: t, forwardedRef: e, collection: r }) {
|
|
|
565
565
|
}
|
|
566
566
|
],
|
|
567
567
|
[
|
|
568
|
-
|
|
568
|
+
Ie,
|
|
569
569
|
{
|
|
570
570
|
...c,
|
|
571
571
|
ref: a
|
|
572
572
|
}
|
|
573
573
|
],
|
|
574
574
|
[
|
|
575
|
-
|
|
575
|
+
N,
|
|
576
576
|
i
|
|
577
577
|
],
|
|
578
578
|
[
|
|
@@ -587,14 +587,14 @@ function Kr({ props: t, forwardedRef: e, collection: r }) {
|
|
|
587
587
|
]
|
|
588
588
|
}, t.children));
|
|
589
589
|
}
|
|
590
|
-
const
|
|
591
|
-
return N
|
|
590
|
+
const Kr = /* @__PURE__ */ re(function(e, r) {
|
|
591
|
+
return S(N) ? /* @__PURE__ */ g.createElement(Sr, {
|
|
592
592
|
props: e,
|
|
593
593
|
forwardedRef: r
|
|
594
|
-
}) : /* @__PURE__ */ g.createElement(
|
|
594
|
+
}) : /* @__PURE__ */ g.createElement(Xe, e);
|
|
595
595
|
});
|
|
596
|
-
function
|
|
597
|
-
let r = N
|
|
596
|
+
function Sr({ props: t, forwardedRef: e }) {
|
|
597
|
+
let r = S(N), { CollectionRoot: a } = S(q), [l, o] = X(t, e, Ie);
|
|
598
598
|
delete l.items, delete l.renderEmptyState;
|
|
599
599
|
let { focusProps: i, isFocused: d, isFocusVisible: s } = Z(), c = {
|
|
600
600
|
isEmpty: r.collection.size === 0,
|
|
@@ -619,8 +619,8 @@ function Nr({ props: t, forwardedRef: e }) {
|
|
|
619
619
|
persistedKeys: $
|
|
620
620
|
}));
|
|
621
621
|
}
|
|
622
|
-
const
|
|
623
|
-
let a = N
|
|
622
|
+
const Nr = /* @__PURE__ */ Ze("item", (t, e, r) => {
|
|
623
|
+
let a = S(N), l = ir(e), { focusProps: o, isFocusVisible: i } = Z({
|
|
624
624
|
within: !0
|
|
625
625
|
}), { rowProps: d, gridCellProps: s, removeButtonProps: c, ...u } = Ar({
|
|
626
626
|
item: r
|
|
@@ -649,7 +649,7 @@ const Rr = /* @__PURE__ */ Ze("item", (t, e, r) => {
|
|
|
649
649
|
]), /* @__PURE__ */ g.createElement("div", {
|
|
650
650
|
ref: l,
|
|
651
651
|
...b,
|
|
652
|
-
...y(
|
|
652
|
+
...y(z(t), d, o, $),
|
|
653
653
|
"data-selected": u.isSelected || void 0,
|
|
654
654
|
"data-disabled": u.isDisabled || void 0,
|
|
655
655
|
"data-hovered": f || void 0,
|
|
@@ -666,7 +666,7 @@ const Rr = /* @__PURE__ */ Ze("item", (t, e, r) => {
|
|
|
666
666
|
}, /* @__PURE__ */ g.createElement(Y, {
|
|
667
667
|
values: [
|
|
668
668
|
[
|
|
669
|
-
|
|
669
|
+
Je,
|
|
670
670
|
{
|
|
671
671
|
slots: {
|
|
672
672
|
remove: c
|
|
@@ -679,28 +679,28 @@ const Rr = /* @__PURE__ */ Ze("item", (t, e, r) => {
|
|
|
679
679
|
]
|
|
680
680
|
]
|
|
681
681
|
}, b.children)));
|
|
682
|
-
}),
|
|
683
|
-
tokens:
|
|
682
|
+
}), Rr = '"../theme/tokens.css"', Tr = '"Inter", sans-serif', Vr = "#000000", Ir = "#b31b1b", jr = "(max-width: 767px)", Or = "#bfbfbf", Ur = "#d9d9d9", Wr = "#e6e6e6", Hr = "#f2f2f2", Gr = "#f2f2f2", qr = "_button_m4kn4_4", Jr = "_tag_m4kn4_14", Qr = "_dismissable_m4kn4_34", Xr = "_tagText_m4kn4_42", Yr = "_tagList_m4kn4_47", M = {
|
|
683
|
+
tokens: Rr,
|
|
684
684
|
display: Tr,
|
|
685
685
|
black: Vr,
|
|
686
|
-
signalRed130:
|
|
687
|
-
smBreakpoint:
|
|
686
|
+
signalRed130: Ir,
|
|
687
|
+
smBreakpoint: jr,
|
|
688
688
|
gray50: Or,
|
|
689
689
|
gray30: Ur,
|
|
690
690
|
gray20: Wr,
|
|
691
691
|
gray10: Hr,
|
|
692
692
|
backgroundSecondary: Gr,
|
|
693
693
|
button: qr,
|
|
694
|
-
tag:
|
|
695
|
-
dismissable:
|
|
696
|
-
tagText:
|
|
694
|
+
tag: Jr,
|
|
695
|
+
dismissable: Qr,
|
|
696
|
+
tagText: Xr,
|
|
697
697
|
tagList: Yr
|
|
698
|
-
}, xt = ({ children: t, ...e }) => /* @__PURE__ */ F(Fr, { ...e, children: /* @__PURE__ */ F(
|
|
698
|
+
}, xt = ({ children: t, ...e }) => /* @__PURE__ */ F(Fr, { ...e, children: /* @__PURE__ */ F(Kr, { className: M.tagList, children: t }) }), yt = ({
|
|
699
699
|
children: t,
|
|
700
700
|
dismissable: e,
|
|
701
701
|
...r
|
|
702
702
|
}) => /* @__PURE__ */ qe(
|
|
703
|
-
|
|
703
|
+
Nr,
|
|
704
704
|
{
|
|
705
705
|
className: kr(M.tag, e && M.dismissable),
|
|
706
706
|
...r,
|
package/Text-BCF0xvqL.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a as c } from "./useFocusRing-9PXyKy2A.js";
|
|
2
|
+
import o, { forwardRef as $, createContext as f } from "react";
|
|
3
|
+
const n = /* @__PURE__ */ f({}), s = /* @__PURE__ */ $(function(e, t) {
|
|
4
|
+
[e, t] = c(e, t, n);
|
|
5
|
+
let { elementType: a = "span", ...r } = e;
|
|
6
|
+
return /* @__PURE__ */ o.createElement(a, {
|
|
7
|
+
className: "react-aria-Text",
|
|
8
|
+
...r,
|
|
9
|
+
ref: t
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
n as $,
|
|
14
|
+
s as a
|
|
15
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as r, jsxs as $, Fragment as k } from "react/jsx-runtime";
|
|
2
2
|
import b, { forwardRef as y, createContext as N, useRef as A, useState as O, useCallback as _ } from "react";
|
|
3
|
-
import { $ as q, a as j, b as C } from "./Form-
|
|
4
|
-
import { $ as w, a as W, T as
|
|
5
|
-
import { $ as L, a as G } from "./useField-
|
|
6
|
-
import { $ as J, a as H } from "./Text-
|
|
7
|
-
import { a as g, b as K, c as M, d as I, e as B,
|
|
8
|
-
import { Button as ee } from "./
|
|
3
|
+
import { $ as q, a as j, b as C } from "./Form-BWBjJC6v.js";
|
|
4
|
+
import { $ as w, a as W, T as n, b as z } from "./TextField.module-DdICj682.js";
|
|
5
|
+
import { $ as L, a as G } from "./useField-DMzJIIN4.js";
|
|
6
|
+
import { $ as J, a as H } from "./Text-BCF0xvqL.js";
|
|
7
|
+
import { a as g, b as K, c as M, d as I, e as B, y as Q, z as U, A as X, o as Y, B as Z } from "./useFocusRing-9PXyKy2A.js";
|
|
8
|
+
import { Button as ee } from "./index66.js";
|
|
9
9
|
import { c as te } from "./clsx-OuTLNxxd.js";
|
|
10
10
|
const S = /* @__PURE__ */ N({});
|
|
11
11
|
let ae = (s) => {
|
|
12
|
-
let { onHoverStart: e, onHoverChange: t, onHoverEnd:
|
|
12
|
+
let { onHoverStart: e, onHoverChange: t, onHoverEnd: d, ...i } = s;
|
|
13
13
|
return i;
|
|
14
14
|
};
|
|
15
15
|
const xe = /* @__PURE__ */ y(function(e, t) {
|
|
16
16
|
[e, t] = g(e, t, S);
|
|
17
|
-
let { hoverProps:
|
|
17
|
+
let { hoverProps: d, isHovered: i } = K(e), { isFocused: a, isFocusVisible: u, focusProps: f } = M({
|
|
18
18
|
isTextInput: !0,
|
|
19
19
|
autoFocus: e.autoFocus
|
|
20
20
|
}), l = !!e["aria-invalid"] && e["aria-invalid"] !== "false", c = I({
|
|
@@ -29,7 +29,7 @@ const xe = /* @__PURE__ */ y(function(e, t) {
|
|
|
29
29
|
defaultClassName: "react-aria-TextArea"
|
|
30
30
|
});
|
|
31
31
|
return /* @__PURE__ */ b.createElement("textarea", {
|
|
32
|
-
...B(ae(e), f,
|
|
32
|
+
...B(ae(e), f, d),
|
|
33
33
|
...c,
|
|
34
34
|
ref: t,
|
|
35
35
|
"data-focused": a || void 0,
|
|
@@ -38,11 +38,11 @@ const xe = /* @__PURE__ */ y(function(e, t) {
|
|
|
38
38
|
"data-focus-visible": u || void 0,
|
|
39
39
|
"data-invalid": l || void 0
|
|
40
40
|
});
|
|
41
|
-
}),
|
|
42
|
-
[e, t] = g(e, t,
|
|
43
|
-
let { validationBehavior:
|
|
41
|
+
}), de = /* @__PURE__ */ N(null), ne = /* @__PURE__ */ y(function(e, t) {
|
|
42
|
+
[e, t] = g(e, t, de);
|
|
43
|
+
let { validationBehavior: d } = Q(q) || {};
|
|
44
44
|
var i, a;
|
|
45
|
-
let u = (a = (i = e.validationBehavior) !== null && i !== void 0 ? i :
|
|
45
|
+
let u = (a = (i = e.validationBehavior) !== null && i !== void 0 ? i : d) !== null && a !== void 0 ? a : "native", f = A(null), [l, c] = g({}, f, w), [p, v] = U(), [x, o] = O("input"), { labelProps: m, inputProps: F, descriptionProps: D, errorMessageProps: V, ...h } = W({
|
|
46
46
|
...X(e),
|
|
47
47
|
inputElementType: x,
|
|
48
48
|
label: v,
|
|
@@ -112,7 +112,7 @@ const xe = /* @__PURE__ */ y(function(e, t) {
|
|
|
112
112
|
label: s,
|
|
113
113
|
description: e,
|
|
114
114
|
errorMessage: t,
|
|
115
|
-
validationType:
|
|
115
|
+
validationType: d,
|
|
116
116
|
validate: i,
|
|
117
117
|
maxCharacters: a,
|
|
118
118
|
showCounter: u,
|
|
@@ -121,12 +121,12 @@ const xe = /* @__PURE__ */ y(function(e, t) {
|
|
|
121
121
|
const [l, c] = b.useState(""), p = (o) => {
|
|
122
122
|
const m = o.target.value;
|
|
123
123
|
c(m);
|
|
124
|
-
}, v = (o) =>
|
|
124
|
+
}, v = (o) => d === "ssn" ? re.test(o) ? null : "Felaktigt personnummer" : d instanceof RegExp ? new RegExp(d).test(o) ? null : t == null ? void 0 : t.toString() : a ? a && o.length > a ? `Du har angett ${o.length - a} tecken för mycket. Fältet är begränsat till ${a} tecken.` : null : i ? i(o) : !0, x = () => a ? /* @__PURE__ */ $(
|
|
125
125
|
"span",
|
|
126
126
|
{
|
|
127
127
|
className: te(
|
|
128
|
-
|
|
129
|
-
l.length > a &&
|
|
128
|
+
n.count,
|
|
129
|
+
l.length > a && n.countExceeded
|
|
130
130
|
),
|
|
131
131
|
children: [
|
|
132
132
|
l.length,
|
|
@@ -134,11 +134,11 @@ const xe = /* @__PURE__ */ y(function(e, t) {
|
|
|
134
134
|
a
|
|
135
135
|
]
|
|
136
136
|
}
|
|
137
|
-
) : u ? /* @__PURE__ */ r("span", { className:
|
|
137
|
+
) : u ? /* @__PURE__ */ r("span", { className: n.count, children: l.length }) : null;
|
|
138
138
|
return /* @__PURE__ */ r(
|
|
139
|
-
|
|
139
|
+
ne,
|
|
140
140
|
{
|
|
141
|
-
className:
|
|
141
|
+
className: n.inputField,
|
|
142
142
|
validate: v,
|
|
143
143
|
...f,
|
|
144
144
|
children: /* @__PURE__ */ $(
|
|
@@ -149,12 +149,12 @@ const xe = /* @__PURE__ */ y(function(e, t) {
|
|
|
149
149
|
errorMessage: t,
|
|
150
150
|
children: [
|
|
151
151
|
/* @__PURE__ */ r(x, {}),
|
|
152
|
-
/* @__PURE__ */ $("div", { className:
|
|
152
|
+
/* @__PURE__ */ $("div", { className: n.wrap, children: [
|
|
153
153
|
/* @__PURE__ */ r(
|
|
154
154
|
z,
|
|
155
155
|
{
|
|
156
156
|
type: f.type,
|
|
157
|
-
className:
|
|
157
|
+
className: n.input,
|
|
158
158
|
onChange: p,
|
|
159
159
|
onBlur: p
|
|
160
160
|
}
|
|
@@ -176,13 +176,13 @@ const xe = /* @__PURE__ */ y(function(e, t) {
|
|
|
176
176
|
type: s,
|
|
177
177
|
input: e
|
|
178
178
|
}) => {
|
|
179
|
-
const [t,
|
|
179
|
+
const [t, d] = b.useState(!1);
|
|
180
180
|
return s === "password" ? /* @__PURE__ */ $(k, { children: [
|
|
181
181
|
t && /* @__PURE__ */ r(
|
|
182
182
|
H,
|
|
183
183
|
{
|
|
184
184
|
slot: "description",
|
|
185
|
-
className:
|
|
185
|
+
className: n.passwordText,
|
|
186
186
|
children: e
|
|
187
187
|
}
|
|
188
188
|
),
|
|
@@ -190,8 +190,8 @@ const xe = /* @__PURE__ */ y(function(e, t) {
|
|
|
190
190
|
ee,
|
|
191
191
|
{
|
|
192
192
|
variant: "tertiary",
|
|
193
|
-
onPress: () =>
|
|
194
|
-
className:
|
|
193
|
+
onPress: () => d(!t),
|
|
194
|
+
className: n.passwordButton,
|
|
195
195
|
children: t ? "Dölj" : "Visa"
|
|
196
196
|
}
|
|
197
197
|
)
|
|
@@ -200,24 +200,24 @@ const xe = /* @__PURE__ */ y(function(e, t) {
|
|
|
200
200
|
label: s,
|
|
201
201
|
description: e,
|
|
202
202
|
errorMessage: t,
|
|
203
|
-
children:
|
|
204
|
-
}) => /* @__PURE__ */ $("div", { className:
|
|
205
|
-
s && /* @__PURE__ */ r(G, { className:
|
|
203
|
+
children: d
|
|
204
|
+
}) => /* @__PURE__ */ $("div", { className: n.inputWrapper, children: [
|
|
205
|
+
s && /* @__PURE__ */ r(G, { className: n.label, children: s }),
|
|
206
206
|
e && /* @__PURE__ */ r(
|
|
207
207
|
H,
|
|
208
208
|
{
|
|
209
209
|
slot: "description",
|
|
210
|
-
className:
|
|
210
|
+
className: n.text,
|
|
211
211
|
children: e
|
|
212
212
|
}
|
|
213
213
|
),
|
|
214
|
-
/* @__PURE__ */ r(C, { className:
|
|
215
|
-
|
|
214
|
+
/* @__PURE__ */ r(C, { className: n.fieldError, children: t }),
|
|
215
|
+
d
|
|
216
216
|
] }), re = new RegExp(
|
|
217
217
|
"^(?:(?:19|20)?\\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])(?:[-+ ]?\\d{4})?|\\d{4}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])(?:[-+ ]?\\d{4}))$"
|
|
218
218
|
);
|
|
219
219
|
export {
|
|
220
|
-
|
|
220
|
+
ne as $,
|
|
221
221
|
se as I,
|
|
222
222
|
me as T,
|
|
223
223
|
xe as a,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import C, { useEffect as y, createContext as w } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { c as R, d as
|
|
4
|
-
import { $ as B } from "./useControlledState-
|
|
5
|
-
import { b as V } from "./useField-
|
|
6
|
-
import { $ as W } from "./useFocusable-
|
|
7
|
-
import { $ as D } from "./Hidden-
|
|
2
|
+
import { o as k, s as E, e as p, a as I, b as F, c as T, d as H } from "./useFocusRing-9PXyKy2A.js";
|
|
3
|
+
import { c as R, d as S, e as M } from "./Form-BWBjJC6v.js";
|
|
4
|
+
import { $ as B } from "./useControlledState-Kv9K2AYu.js";
|
|
5
|
+
import { b as V } from "./useField-DMzJIIN4.js";
|
|
6
|
+
import { $ as W } from "./useFocusable-CcEBZe40.js";
|
|
7
|
+
import { $ as D } from "./Hidden-CVlUgUJM.js";
|
|
8
8
|
import './TextField.css';function me(e, a) {
|
|
9
9
|
let { inputElementType: o = "input", isDisabled: i = !1, isRequired: t = !1, isReadOnly: d = !1, type: r = "text", validationBehavior: s = "aria" } = e, [n, l] = B(e.value, e.defaultValue || "", e.onChange), { focusableProps: $ } = W(e, a), f = R({
|
|
10
10
|
...e,
|
|
@@ -20,7 +20,7 @@ import './TextField.css';function me(e, a) {
|
|
|
20
20
|
type: r,
|
|
21
21
|
pattern: e.pattern
|
|
22
22
|
};
|
|
23
|
-
return
|
|
23
|
+
return S(a, n, l), M(e, f, a), y(() => {
|
|
24
24
|
if (a.current instanceof E(a.current).HTMLTextAreaElement) {
|
|
25
25
|
let c = a.current;
|
|
26
26
|
Object.defineProperty(c, "defaultValue", {
|
package/accordion/Accordion.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
|
|
1
|
+
import { DisclosureGroupProps } from 'react-aria-components';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface MidasAccordion extends DisclosureGroupProps {
|
|
4
|
+
/** Display either the larger contained variant or a smaller uncontained variant */
|
|
5
|
+
variant?: 'uncontained' | 'contained';
|
|
6
|
+
/** Weither to allow the user to have multiple accordions open at the same time */
|
|
7
|
+
type?: 'single' | 'multiple';
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Accordions are used primarily to reduce the direct amount of information on a page and to sort it clearly.
|
|
11
11
|
*/
|
|
12
|
-
export declare const Accordion: React.
|
|
12
|
+
export declare const Accordion: React.FC<MidasAccordion>;
|
|
13
13
|
export {};
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
|
|
1
|
+
import { DisclosureProps, HeadingProps } from 'react-aria-components';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface MidasAccordionItem extends Omit<DisclosureProps, 'children'> {
|
|
4
|
+
/** The text displayed in the collapsed state */
|
|
5
|
+
title?: string;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/** Adjust the titles heading level to your heading tag structure */
|
|
8
|
+
headingLevel?: HeadingProps['level'];
|
|
9
|
+
}
|
|
10
|
+
export declare const AccordionItem: React.FC<MidasAccordionItem>;
|
|
11
|
+
export {};
|
package/accordion/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import l, { useState as
|
|
2
|
-
import { g as u } from "./useFocusRing-
|
|
1
|
+
import l, { useState as d, useEffect as i, useContext as $ } from "react";
|
|
2
|
+
import { g as u } from "./useFocusRing-9PXyKy2A.js";
|
|
3
3
|
const s = /* @__PURE__ */ new Set([
|
|
4
4
|
"Arab",
|
|
5
5
|
"Syrc",
|
|
@@ -34,9 +34,9 @@ const s = /* @__PURE__ */ new Set([
|
|
|
34
34
|
]);
|
|
35
35
|
function g(e) {
|
|
36
36
|
if (Intl.Locale) {
|
|
37
|
-
let
|
|
38
|
-
if (
|
|
39
|
-
if (
|
|
37
|
+
let a = new Intl.Locale(e).maximize(), o = typeof a.getTextInfo == "function" ? a.getTextInfo() : a.textInfo;
|
|
38
|
+
if (o) return o.direction === "rtl";
|
|
39
|
+
if (a.script) return s.has(a.script);
|
|
40
40
|
}
|
|
41
41
|
let n = e.split("-")[0];
|
|
42
42
|
return b.has(n);
|
|
@@ -56,15 +56,15 @@ function c() {
|
|
|
56
56
|
direction: g(e) ? "rtl" : "ltr"
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
let
|
|
59
|
+
let r = c(), t = /* @__PURE__ */ new Set();
|
|
60
60
|
function f() {
|
|
61
|
-
|
|
62
|
-
for (let e of
|
|
61
|
+
r = c();
|
|
62
|
+
for (let e of t) e(r);
|
|
63
63
|
}
|
|
64
64
|
function x() {
|
|
65
|
-
let e = u(), [n,
|
|
66
|
-
return
|
|
67
|
-
|
|
65
|
+
let e = u(), [n, a] = d(r);
|
|
66
|
+
return i(() => (t.size === 0 && window.addEventListener("languagechange", f), t.add(a), () => {
|
|
67
|
+
t.delete(a), t.size === 0 && window.removeEventListener("languagechange", f);
|
|
68
68
|
}), []), e ? {
|
|
69
69
|
locale: "en-US",
|
|
70
70
|
direction: "ltr"
|
package/global.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/inter:vf@latest/latin-wght-normal.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}*{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
package/index.d.ts
CHANGED