@midas-ds/components 12.1.1 → 13.0.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/AccordionItem-Bq8nUKg4.cjs +1 -0
- package/{AccordionItem-Dd9VLdsb.js → AccordionItem-D2Y0gJZB.js} +108 -108
- package/CHANGELOG.md +42 -0
- package/InfoBanner-C82hcpzj.cjs +1 -0
- package/InfoBanner-Dz_0wVSa.js +83 -0
- package/{Layout-CcXu63hP.js → Layout-B-A-s7B0.js} +39 -39
- package/{Layout-Bxd0-ao3.cjs → Layout-DlE30BHE.cjs} +2 -2
- package/TabList-3fErCDyP.cjs +1 -0
- package/{TabList-C0mZgIzV.js → TabList-CXaxruLg.js} +36 -36
- package/{Table-DzbfeVO7.js → Table-BzJktg2G.js} +1 -1
- package/{Table-BHY1uCZ0.cjs → Table-Dyqa6_rE.cjs} +1 -1
- package/{TextArea-DJCtwrqV.cjs → TextArea-BTmzOUZd.cjs} +1 -1
- package/{TextArea-CDoLq124.js → TextArea-CSNrZCEO.js} +19 -20
- package/{Toast-DZnQTLDr.js → Toast-B74PMVL9.js} +36 -36
- package/{Toast-BN3vRCsH.cjs → Toast-Cs0CEbRr.cjs} +1 -1
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/assets/AccordionItem.css +1 -1
- package/assets/InfoBanner.css +1 -1
- package/assets/Table.css +1 -1
- package/assets/Toast.css +1 -1
- package/assets/default.css +1 -0
- package/index.cjs +1 -1
- package/index.js +143 -144
- package/info-banner/index.cjs +1 -1
- package/info-banner/index.js +1 -1
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/package.json +4 -14
- package/table/index.cjs +1 -1
- package/table/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/textfield/TextArea.d.ts +2 -7
- package/textfield/TextField.d.ts +2 -6
- package/textfield/index.cjs +1 -1
- package/textfield/index.js +1 -1
- package/toast/index.cjs +1 -1
- package/toast/index.js +1 -1
- package/variables-B3KEYyhW.cjs +1 -0
- package/variables-DzXcMW2k.js +5 -0
- package/AccordionItem-CV9Hrare.cjs +0 -1
- package/InfoBanner-CgmPdsH8.js +0 -83
- package/InfoBanner-Y-f3hKVR.cjs +0 -1
- package/TabList-BMyKYLlY.cjs +0 -1
- package/assets/global.css +0 -1
- package/assets/theme.css +0 -1
- package/assets/variables.css +0 -1
- package/theme/generated-object.d.ts +0 -381
- package/theme/generated-tokens.d.ts +0 -331
- package/theme/index.cjs +0 -1
- package/theme/index.d.ts +0 -267
- package/theme/index.js +0 -3991
- package/theme/tokens.d.ts +0 -290
- package/tokens-B3FfJ-rY.cjs +0 -1
- package/tokens-B9ooUP4g.js +0 -327
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('./assets/AccordionItem.css');const u=require("react/jsx-runtime"),m=require("./clsx-C11secjj.cjs"),A=require("./icon-map-9XcghDra.cjs"),d=require("react"),y=require("./Button-CMIbSc4-.cjs"),x=require("./utils-CMHKYKlz.cjs"),b=require("./mergeProps-JhcJ7uJL.cjs"),E=require("./filterDOMProps-RRlKPKX0.cjs"),j=require("./useControlledState-D0L6S_5r.cjs"),M=require("react-dom"),K=require("./useEvent-3ZO5TPSH.cjs"),B=require("./SSRProvider-Bc-sMhsT.cjs"),D=require("./useFocusRing-BcbYske2.cjs"),T=require("./Button-D_tRdPW9.cjs"),F=require("./Heading-D3FR_KXb.cjs"),k=require("./chevron-down-5hFlg_lR.cjs"),O="_root_17bdp_1",W="_contained_17bdp_5",h={root:O,contained:W};function V(o,e,n){let{isDisabled:t}=o,a=b.$bdb11010cef70236$export$f680877a34711e37(),s=b.$bdb11010cef70236$export$f680877a34711e37(),l=!B.$b5e257d569688ac6$export$535bd6ca7f90a273()&&"onbeforematch"in document.body,i=d.useRef(null),f=d.useCallback(()=>{i.current=requestAnimationFrame(()=>{n.current&&n.current.setAttribute("hidden","until-found")}),M.flushSync(()=>{e.toggle()})},[n,e]);return K.$e9faafb641e167db$export$90fc3a17d93f704c(n,"beforematch",l?f:null),b.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{i.current&&cancelAnimationFrame(i.current),l&&n.current&&!t&&(e.isExpanded?n.current.removeAttribute("hidden"):n.current.setAttribute("hidden","until-found"))},[t,n,e.isExpanded,l]),d.useEffect(()=>()=>{i.current&&cancelAnimationFrame(i.current)},[]),{buttonProps:{id:a,"aria-expanded":e.isExpanded,"aria-controls":s,onPress:$=>{!t&&$.pointerType!=="keyboard"&&e.toggle()},isDisabled:t,onPressStart($){$.pointerType==="keyboard"&&!t&&e.toggle()}},panelProps:{id:s,role:"group","aria-labelledby":a,"aria-hidden":!e.isExpanded,hidden:l?!0:!e.isExpanded}}}function z(o){let[e,n]=j.$458b0a5536c1a7cf$export$40bfa8c7b0832715(o.isExpanded,o.defaultExpanded||!1,o.onExpandedChange);const t=d.useCallback(()=>{n(!0)},[n]),a=d.useCallback(()=>{n(!1)},[n]),s=d.useCallback(()=>{n(!e)},[n,e]);return{isExpanded:e,setExpanded:n,expand:t,collapse:a,toggle:s}}function G(o){let{allowsMultipleExpanded:e=!1,isDisabled:n=!1}=o,[t,a]=j.$458b0a5536c1a7cf$export$40bfa8c7b0832715(d.useMemo(()=>o.expandedKeys?new Set(o.expandedKeys):void 0,[o.expandedKeys]),d.useMemo(()=>o.defaultExpandedKeys?new Set(o.defaultExpandedKeys):new Set,[o.defaultExpandedKeys]),o.onExpandedChange);return d.useEffect(()=>{if(!e&&t.size>1){let s=t.values().next().value;s!=null&&a(new Set([s]))}}),{allowsMultipleExpanded:e,isDisabled:n,expandedKeys:t,setExpandedKeys:a,toggleKey(s){let c;e?(c=new Set(t),c.has(s)?c.delete(s):c.add(s)):c=new Set(t.has(s)?[]:[s]),a(c)}}}const P=d.createContext(null),H=d.forwardRef(function(e,n){let t=G(e),a=x.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,defaultClassName:"react-aria-DisclosureGroup",values:{isDisabled:t.isDisabled,state:t}}),s=E.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return d.createElement("div",{...s,...a,ref:n,"data-disabled":e.isDisabled||void 0},d.createElement(P.Provider,{value:t},a.children))}),J=d.createContext(null),L=d.createContext(null),w=d.createContext(null),Q=d.forwardRef(function(e,n){[e,n]=x.$64fa3d84918910a7$export$29f1550f4b0d4415(e,n,J);let t=d.useContext(P),{id:a,...s}=e,c=b.$bdb11010cef70236$export$f680877a34711e37();a||(a=c);let l=t?t.expandedKeys.has(a):e.isExpanded,i=z({...e,isExpanded:l,onExpandedChange(N){var _;t&&t.toggleKey(a),(_=e.onExpandedChange)===null||_===void 0||_.call(e,N)}}),f=d.useRef(null),$=e.isDisabled||(t==null?void 0:t.isDisabled)||!1,{buttonProps:p,panelProps:g}=V({...e,isExpanded:l,isDisabled:$},i,f),{isFocusVisible:v,focusProps:S}=D.$f7dceffc5ad7768b$export$4e328f61c538687f({within:!0}),C=x.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,id:void 0,defaultClassName:"react-aria-Disclosure",values:{isExpanded:i.isExpanded,isDisabled:$,isFocusVisibleWithin:v,state:i}}),q=E.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(s,{global:!0});return d.createElement(x.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[y.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{slots:{[x.$64fa3d84918910a7$export$c62b8e45d58ddad9]:{},trigger:p}}],[w,{panelProps:g,panelRef:f}],[L,i]]},d.createElement("div",{...b.$3ef42575df84b30b$export$9d1611c77c2fe928(q,C,S),ref:n,"data-expanded":i.isExpanded||void 0,"data-disabled":$||void 0,"data-focus-visible-within":v||void 0},C.children))}),U=d.forwardRef(function(e,n){let{role:t="group"}=e,{panelProps:a,panelRef:s}=d.useContext(w),{isFocusVisible:c,focusProps:l}=D.$f7dceffc5ad7768b$export$4e328f61c538687f({within:!0}),i=x.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,defaultClassName:"react-aria-DisclosurePanel",values:{isFocusVisibleWithin:c}}),f=E.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return d.createElement("div",{...b.$3ef42575df84b30b$export$9d1611c77c2fe928(f,i,a,l),ref:x.$5dc95899b306f630$export$c9058316764c140e(n,s),role:t,"data-focus-visible-within":c||void 0},d.createElement(x.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[y.$d2b4bc8c273e7be6$export$24d547caef80ccd1,null]]},e.children))}),I=d.createContext(void 0),R="accordion",X=({variant:o,children:e,className:n,isContained:t,...a})=>{const s=t||o==="contained";return u.jsx(I.Provider,{value:{isContained:s},children:u.jsx(H,{"data-testid":R,className:m.clsx(h.root,s?h.contained:h.uncontained,n),...a,children:e})})},Y="_item_yl8dj_1",Z="_contained_yl8dj_18",ee="_success_yl8dj_29",te="_warning_yl8dj_35",ne="_info_yl8dj_41",de="_important_yl8dj_47",ae="_triggerButton_yl8dj_58",se="_triggerText_yl8dj_62",oe="_trigger_yl8dj_58",ie="_triggerMainContent_yl8dj_73",ce="_chevronIcon_yl8dj_90",re="_statusIcon_yl8dj_96",le="_panel_yl8dj_110",ue="_content_yl8dj_124",fe="_hasBackground_yl8dj_130",$e="_header_yl8dj_134",r={item:Y,contained:Z,success:ee,warning:te,info:ne,important:de,triggerButton:ae,triggerText:se,trigger:oe,triggerMainContent:ie,chevronIcon:ce,statusIcon:re,panel:le,content:ue,hasBackground:fe,header:$e},xe=({title:o,children:e,className:n,headingLevel:t="h2",type:a,hasBackground:s=!0,isContained:c,...l})=>{const i=d.useContext(I),f=c??(i==null?void 0:i.isContained)??!1,$=typeof o=="object";d.useEffect(()=>{a&&!f&&console.warn("AccordionItem: When 'type' is set, it is recommended to also set 'isContained' to true for visual consistency.")},[a,f]);const p=a?A.iconMap[a]:null,g=p?u.jsx(p,{size:20,className:r.statusIcon}):null;return u.jsxs(Q,{...l,className:m.clsx(r.item,a&&r[a],f&&r.contained,n),children:[u.jsx("div",{className:r.trigger,children:u.jsxs(T.Button,{className:r.triggerButton,slot:"trigger",variant:"icon",children:[u.jsx(k.ChevronDown,{size:20,className:r.chevronIcon}),u.jsx("div",{className:r.triggerMainContent,children:$?o:u.jsx(F.Heading,{level:3,elementType:t,className:r.triggerText,children:o})}),g]})}),u.jsx(U,{className:r.panel,children:u.jsx("div",{className:m.clsx(r.content,s&&r.hasBackground),children:e})})]})};exports.ACCORDION_TEST_ID=R;exports.Accordion=X;exports.AccordionItem=xe;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as u, jsxs as
|
|
1
|
+
import { jsx as u, jsxs as I } from "react/jsx-runtime";
|
|
2
2
|
import { c as h } from "./clsx-OuTLNxxd.js";
|
|
3
3
|
import { i as z } from "./icon-map-uS87FT_Q.js";
|
|
4
|
-
import
|
|
5
|
-
import { e as
|
|
6
|
-
import { $ as G, a as
|
|
7
|
-
import { c as E, $ as J, a as
|
|
8
|
-
import { $ as
|
|
9
|
-
import { $ as
|
|
4
|
+
import p, { useRef as O, useCallback as m, useEffect as v, useMemo as N, forwardRef as y, createContext as $, useContext as C } from "react";
|
|
5
|
+
import { e as S } from "./Button-DD5_S-tD.js";
|
|
6
|
+
import { $ as G, a as P, f as K, g as H, h as q } from "./utils-Cpcjg55U.js";
|
|
7
|
+
import { c as E, $ as J, a as A } from "./mergeProps-BSsN7Bgk.js";
|
|
8
|
+
import { $ as D } from "./filterDOMProps-wsa9OcNI.js";
|
|
9
|
+
import { $ as B } from "./useControlledState-u436Wbp1.js";
|
|
10
10
|
import { flushSync as L } from "react-dom";
|
|
11
11
|
import { $ as Q } from "./useEvent-DpBHTuHJ.js";
|
|
12
12
|
import { $ as U } from "./SSRProvider-40TXmsUG.js";
|
|
13
|
-
import { $ as
|
|
13
|
+
import { $ as M } from "./useFocusRing-DMo8ctYV.js";
|
|
14
14
|
import { B as X } from "./Button-CUMHt7MG.js";
|
|
15
15
|
import { H as Y } from "./Heading-BQlmb5Tm.js";
|
|
16
16
|
import { C as Z } from "./chevron-down-DmZMdOiC.js";
|
|
@@ -18,9 +18,9 @@ import './assets/AccordionItem.css';const ee = "_root_17bdp_1", te = "_contained
|
|
|
18
18
|
root: ee,
|
|
19
19
|
contained: te
|
|
20
20
|
};
|
|
21
|
-
function ne(
|
|
22
|
-
let { isDisabled: t } =
|
|
23
|
-
|
|
21
|
+
function ne(s, e, n) {
|
|
22
|
+
let { isDisabled: t } = s, a = E(), d = E(), l = !U() && "onbeforematch" in document.body, o = O(null), c = m(() => {
|
|
23
|
+
o.current = requestAnimationFrame(() => {
|
|
24
24
|
n.current && n.current.setAttribute("hidden", "until-found");
|
|
25
25
|
}), L(() => {
|
|
26
26
|
e.toggle();
|
|
@@ -30,19 +30,19 @@ function ne(d, e, n) {
|
|
|
30
30
|
e
|
|
31
31
|
]);
|
|
32
32
|
return Q(n, "beforematch", l ? c : null), J(() => {
|
|
33
|
-
|
|
33
|
+
o.current && cancelAnimationFrame(o.current), l && n.current && !t && (e.isExpanded ? n.current.removeAttribute("hidden") : n.current.setAttribute("hidden", "until-found"));
|
|
34
34
|
}, [
|
|
35
35
|
t,
|
|
36
36
|
n,
|
|
37
37
|
e.isExpanded,
|
|
38
38
|
l
|
|
39
39
|
]), v(() => () => {
|
|
40
|
-
|
|
40
|
+
o.current && cancelAnimationFrame(o.current);
|
|
41
41
|
}, []), {
|
|
42
42
|
buttonProps: {
|
|
43
43
|
id: a,
|
|
44
44
|
"aria-expanded": e.isExpanded,
|
|
45
|
-
"aria-controls":
|
|
45
|
+
"aria-controls": d,
|
|
46
46
|
onPress: (f) => {
|
|
47
47
|
!t && f.pointerType !== "keyboard" && e.toggle();
|
|
48
48
|
},
|
|
@@ -52,7 +52,7 @@ function ne(d, e, n) {
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
panelProps: {
|
|
55
|
-
id:
|
|
55
|
+
id: d,
|
|
56
56
|
// This can be overridden at the panel element level.
|
|
57
57
|
role: "group",
|
|
58
58
|
"aria-labelledby": a,
|
|
@@ -61,17 +61,17 @@ function ne(d, e, n) {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
function ae(
|
|
65
|
-
let [e, n] =
|
|
66
|
-
const t =
|
|
64
|
+
function ae(s) {
|
|
65
|
+
let [e, n] = B(s.isExpanded, s.defaultExpanded || !1, s.onExpandedChange);
|
|
66
|
+
const t = m(() => {
|
|
67
67
|
n(!0);
|
|
68
68
|
}, [
|
|
69
69
|
n
|
|
70
|
-
]), a =
|
|
70
|
+
]), a = m(() => {
|
|
71
71
|
n(!1);
|
|
72
72
|
}, [
|
|
73
73
|
n
|
|
74
|
-
]),
|
|
74
|
+
]), d = m(() => {
|
|
75
75
|
n(!e);
|
|
76
76
|
}, [
|
|
77
77
|
n,
|
|
@@ -82,20 +82,20 @@ function ae(d) {
|
|
|
82
82
|
setExpanded: n,
|
|
83
83
|
expand: t,
|
|
84
84
|
collapse: a,
|
|
85
|
-
toggle:
|
|
85
|
+
toggle: d
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
let { allowsMultipleExpanded: e = !1, isDisabled: n = !1 } =
|
|
90
|
-
|
|
91
|
-
]),
|
|
92
|
-
|
|
93
|
-
]),
|
|
88
|
+
function de(s) {
|
|
89
|
+
let { allowsMultipleExpanded: e = !1, isDisabled: n = !1 } = s, [t, a] = B(N(() => s.expandedKeys ? new Set(s.expandedKeys) : void 0, [
|
|
90
|
+
s.expandedKeys
|
|
91
|
+
]), N(() => s.defaultExpandedKeys ? new Set(s.defaultExpandedKeys) : /* @__PURE__ */ new Set(), [
|
|
92
|
+
s.defaultExpandedKeys
|
|
93
|
+
]), s.onExpandedChange);
|
|
94
94
|
return v(() => {
|
|
95
95
|
if (!e && t.size > 1) {
|
|
96
|
-
let
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
let d = t.values().next().value;
|
|
97
|
+
d != null && a(/* @__PURE__ */ new Set([
|
|
98
|
+
d
|
|
99
99
|
]));
|
|
100
100
|
}
|
|
101
101
|
}), {
|
|
@@ -103,180 +103,180 @@ function ie(d) {
|
|
|
103
103
|
isDisabled: n,
|
|
104
104
|
expandedKeys: t,
|
|
105
105
|
setExpandedKeys: a,
|
|
106
|
-
toggleKey(
|
|
107
|
-
let
|
|
108
|
-
e ? (
|
|
109
|
-
|
|
110
|
-
]), a(
|
|
106
|
+
toggleKey(d) {
|
|
107
|
+
let i;
|
|
108
|
+
e ? (i = new Set(t), i.has(d) ? i.delete(d) : i.add(d)) : i = new Set(t.has(d) ? [] : [
|
|
109
|
+
d
|
|
110
|
+
]), a(i);
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
const
|
|
115
|
-
let t =
|
|
114
|
+
const R = /* @__PURE__ */ $(null), se = /* @__PURE__ */ y(function(e, n) {
|
|
115
|
+
let t = de(e), a = P({
|
|
116
116
|
...e,
|
|
117
117
|
defaultClassName: "react-aria-DisclosureGroup",
|
|
118
118
|
values: {
|
|
119
119
|
isDisabled: t.isDisabled,
|
|
120
120
|
state: t
|
|
121
121
|
}
|
|
122
|
-
}),
|
|
122
|
+
}), d = D(e, {
|
|
123
123
|
global: !0
|
|
124
124
|
});
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
...
|
|
125
|
+
return /* @__PURE__ */ p.createElement("div", {
|
|
126
|
+
...d,
|
|
127
127
|
...a,
|
|
128
128
|
ref: n,
|
|
129
129
|
"data-disabled": e.isDisabled || void 0
|
|
130
|
-
}, /* @__PURE__ */
|
|
130
|
+
}, /* @__PURE__ */ p.createElement(R.Provider, {
|
|
131
131
|
value: t
|
|
132
132
|
}, a.children));
|
|
133
|
-
}),
|
|
134
|
-
[e, n] = G(e, n,
|
|
135
|
-
let t =
|
|
136
|
-
a || (a =
|
|
137
|
-
let l = t ? t.expandedKeys.has(a) : e.isExpanded,
|
|
133
|
+
}), oe = /* @__PURE__ */ $(null), ie = /* @__PURE__ */ $(null), F = /* @__PURE__ */ $(null), re = /* @__PURE__ */ y(function(e, n) {
|
|
134
|
+
[e, n] = G(e, n, oe);
|
|
135
|
+
let t = C(R), { id: a, ...d } = e, i = E();
|
|
136
|
+
a || (a = i);
|
|
137
|
+
let l = t ? t.expandedKeys.has(a) : e.isExpanded, o = ae({
|
|
138
138
|
...e,
|
|
139
139
|
isExpanded: l,
|
|
140
|
-
onExpandedChange(
|
|
141
|
-
var
|
|
142
|
-
t && t.toggleKey(a), (
|
|
140
|
+
onExpandedChange(k) {
|
|
141
|
+
var g;
|
|
142
|
+
t && t.toggleKey(a), (g = e.onExpandedChange) === null || g === void 0 || g.call(e, k);
|
|
143
143
|
}
|
|
144
|
-
}), c =
|
|
144
|
+
}), c = p.useRef(null), f = e.isDisabled || (t == null ? void 0 : t.isDisabled) || !1, { buttonProps: b, panelProps: x } = ne({
|
|
145
145
|
...e,
|
|
146
146
|
isExpanded: l,
|
|
147
147
|
isDisabled: f
|
|
148
|
-
},
|
|
148
|
+
}, o, c), { isFocusVisible: j, focusProps: W } = M({
|
|
149
149
|
within: !0
|
|
150
|
-
}),
|
|
150
|
+
}), w = P({
|
|
151
151
|
...e,
|
|
152
152
|
id: void 0,
|
|
153
153
|
defaultClassName: "react-aria-Disclosure",
|
|
154
154
|
values: {
|
|
155
|
-
isExpanded:
|
|
155
|
+
isExpanded: o.isExpanded,
|
|
156
156
|
isDisabled: f,
|
|
157
|
-
isFocusVisibleWithin:
|
|
158
|
-
state:
|
|
157
|
+
isFocusVisibleWithin: j,
|
|
158
|
+
state: o
|
|
159
159
|
}
|
|
160
|
-
}),
|
|
160
|
+
}), V = D(d, {
|
|
161
161
|
global: !0
|
|
162
162
|
});
|
|
163
|
-
return /* @__PURE__ */
|
|
163
|
+
return /* @__PURE__ */ p.createElement(K, {
|
|
164
164
|
values: [
|
|
165
165
|
[
|
|
166
|
-
|
|
166
|
+
S,
|
|
167
167
|
{
|
|
168
168
|
slots: {
|
|
169
169
|
[H]: {},
|
|
170
|
-
trigger:
|
|
170
|
+
trigger: b
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
],
|
|
174
174
|
[
|
|
175
|
-
|
|
175
|
+
F,
|
|
176
176
|
{
|
|
177
|
-
panelProps:
|
|
177
|
+
panelProps: x,
|
|
178
178
|
panelRef: c
|
|
179
179
|
}
|
|
180
180
|
],
|
|
181
181
|
[
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
ie,
|
|
183
|
+
o
|
|
184
184
|
]
|
|
185
185
|
]
|
|
186
|
-
}, /* @__PURE__ */
|
|
187
|
-
...
|
|
186
|
+
}, /* @__PURE__ */ p.createElement("div", {
|
|
187
|
+
...A(V, w, W),
|
|
188
188
|
ref: n,
|
|
189
|
-
"data-expanded":
|
|
189
|
+
"data-expanded": o.isExpanded || void 0,
|
|
190
190
|
"data-disabled": f || void 0,
|
|
191
|
-
"data-focus-visible-within":
|
|
192
|
-
},
|
|
193
|
-
}), le = /* @__PURE__ */
|
|
194
|
-
let { role: t = "group" } = e, { panelProps: a, panelRef:
|
|
191
|
+
"data-focus-visible-within": j || void 0
|
|
192
|
+
}, w.children));
|
|
193
|
+
}), le = /* @__PURE__ */ y(function(e, n) {
|
|
194
|
+
let { role: t = "group" } = e, { panelProps: a, panelRef: d } = C(F), { isFocusVisible: i, focusProps: l } = M({
|
|
195
195
|
within: !0
|
|
196
|
-
}),
|
|
196
|
+
}), o = P({
|
|
197
197
|
...e,
|
|
198
198
|
defaultClassName: "react-aria-DisclosurePanel",
|
|
199
199
|
values: {
|
|
200
|
-
isFocusVisibleWithin:
|
|
200
|
+
isFocusVisibleWithin: i
|
|
201
201
|
}
|
|
202
|
-
}), c =
|
|
202
|
+
}), c = D(e, {
|
|
203
203
|
global: !0
|
|
204
204
|
});
|
|
205
|
-
return /* @__PURE__ */
|
|
206
|
-
...
|
|
207
|
-
ref: q(n,
|
|
205
|
+
return /* @__PURE__ */ p.createElement("div", {
|
|
206
|
+
...A(c, o, a, l),
|
|
207
|
+
ref: q(n, d),
|
|
208
208
|
role: t,
|
|
209
|
-
"data-focus-visible-within":
|
|
210
|
-
}, /* @__PURE__ */
|
|
209
|
+
"data-focus-visible-within": i || void 0
|
|
210
|
+
}, /* @__PURE__ */ p.createElement(K, {
|
|
211
211
|
values: [
|
|
212
212
|
[
|
|
213
|
-
|
|
213
|
+
S,
|
|
214
214
|
null
|
|
215
215
|
]
|
|
216
216
|
]
|
|
217
217
|
}, e.children));
|
|
218
|
-
}),
|
|
219
|
-
variant:
|
|
218
|
+
}), T = $(void 0), ce = "accordion", Oe = ({
|
|
219
|
+
variant: s,
|
|
220
220
|
children: e,
|
|
221
221
|
className: n,
|
|
222
222
|
isContained: t,
|
|
223
223
|
...a
|
|
224
224
|
}) => {
|
|
225
|
-
const
|
|
226
|
-
return /* @__PURE__ */ u(
|
|
227
|
-
|
|
225
|
+
const d = t || s === "contained";
|
|
226
|
+
return /* @__PURE__ */ u(T.Provider, { value: { isContained: d }, children: /* @__PURE__ */ u(
|
|
227
|
+
se,
|
|
228
228
|
{
|
|
229
229
|
"data-testid": ce,
|
|
230
230
|
className: h(
|
|
231
231
|
_.root,
|
|
232
|
-
|
|
232
|
+
d ? _.contained : _.uncontained,
|
|
233
233
|
n
|
|
234
234
|
),
|
|
235
235
|
...a,
|
|
236
236
|
children: e
|
|
237
237
|
}
|
|
238
238
|
) });
|
|
239
|
-
}, fe = "
|
|
239
|
+
}, fe = "_item_yl8dj_1", ue = "_contained_yl8dj_18", pe = "_success_yl8dj_29", $e = "_warning_yl8dj_35", be = "_info_yl8dj_41", me = "_important_yl8dj_47", xe = "_triggerButton_yl8dj_58", ge = "_triggerText_yl8dj_62", _e = "_trigger_yl8dj_58", he = "_triggerMainContent_yl8dj_73", Ee = "_chevronIcon_yl8dj_90", ve = "_statusIcon_yl8dj_96", ye = "_panel_yl8dj_110", Ce = "_content_yl8dj_124", Pe = "_hasBackground_yl8dj_130", De = "_header_yl8dj_134", r = {
|
|
240
240
|
item: fe,
|
|
241
241
|
contained: ue,
|
|
242
|
-
success:
|
|
243
|
-
warning:
|
|
244
|
-
info:
|
|
245
|
-
important:
|
|
246
|
-
triggerButton:
|
|
247
|
-
triggerText:
|
|
242
|
+
success: pe,
|
|
243
|
+
warning: $e,
|
|
244
|
+
info: be,
|
|
245
|
+
important: me,
|
|
246
|
+
triggerButton: xe,
|
|
247
|
+
triggerText: ge,
|
|
248
248
|
trigger: _e,
|
|
249
249
|
triggerMainContent: he,
|
|
250
250
|
chevronIcon: Ee,
|
|
251
251
|
statusIcon: ve,
|
|
252
|
-
panel:
|
|
253
|
-
content:
|
|
254
|
-
hasBackground:
|
|
255
|
-
header:
|
|
252
|
+
panel: ye,
|
|
253
|
+
content: Ce,
|
|
254
|
+
hasBackground: Pe,
|
|
255
|
+
header: De
|
|
256
256
|
}, Ge = ({
|
|
257
|
-
title:
|
|
257
|
+
title: s,
|
|
258
258
|
children: e,
|
|
259
259
|
className: n,
|
|
260
260
|
headingLevel: t = "h2",
|
|
261
261
|
type: a,
|
|
262
|
-
hasBackground:
|
|
263
|
-
isContained:
|
|
262
|
+
hasBackground: d = !0,
|
|
263
|
+
isContained: i,
|
|
264
264
|
...l
|
|
265
265
|
}) => {
|
|
266
|
-
const
|
|
266
|
+
const o = C(T), c = i ?? (o == null ? void 0 : o.isContained) ?? !1, f = typeof s == "object";
|
|
267
267
|
v(() => {
|
|
268
268
|
a && !c && console.warn(
|
|
269
269
|
"AccordionItem: When 'type' is set, it is recommended to also set 'isContained' to true for visual consistency."
|
|
270
270
|
);
|
|
271
271
|
}, [a, c]);
|
|
272
|
-
const
|
|
273
|
-
|
|
272
|
+
const b = a ? z[a] : null, x = b ? /* @__PURE__ */ u(
|
|
273
|
+
b,
|
|
274
274
|
{
|
|
275
275
|
size: 20,
|
|
276
276
|
className: r.statusIcon
|
|
277
277
|
}
|
|
278
278
|
) : null;
|
|
279
|
-
return /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ I(
|
|
280
280
|
re,
|
|
281
281
|
{
|
|
282
282
|
...l,
|
|
@@ -287,7 +287,7 @@ const F = /* @__PURE__ */ p(null), de = /* @__PURE__ */ C(function(e, n) {
|
|
|
287
287
|
n
|
|
288
288
|
),
|
|
289
289
|
children: [
|
|
290
|
-
/* @__PURE__ */ u("div", { className: r.trigger, children: /* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ u("div", { className: r.trigger, children: /* @__PURE__ */ I(
|
|
291
291
|
X,
|
|
292
292
|
{
|
|
293
293
|
className: r.triggerButton,
|
|
@@ -301,16 +301,16 @@ const F = /* @__PURE__ */ p(null), de = /* @__PURE__ */ C(function(e, n) {
|
|
|
301
301
|
className: r.chevronIcon
|
|
302
302
|
}
|
|
303
303
|
),
|
|
304
|
-
/* @__PURE__ */ u("div", { className: r.triggerMainContent, children: f ?
|
|
304
|
+
/* @__PURE__ */ u("div", { className: r.triggerMainContent, children: f ? s : /* @__PURE__ */ u(
|
|
305
305
|
Y,
|
|
306
306
|
{
|
|
307
307
|
level: 3,
|
|
308
308
|
elementType: t,
|
|
309
309
|
className: r.triggerText,
|
|
310
|
-
children:
|
|
310
|
+
children: s
|
|
311
311
|
}
|
|
312
312
|
) }),
|
|
313
|
-
|
|
313
|
+
x
|
|
314
314
|
]
|
|
315
315
|
}
|
|
316
316
|
) }),
|
|
@@ -319,7 +319,7 @@ const F = /* @__PURE__ */ p(null), de = /* @__PURE__ */ C(function(e, n) {
|
|
|
319
319
|
{
|
|
320
320
|
className: h(
|
|
321
321
|
r.content,
|
|
322
|
-
|
|
322
|
+
d && r.hasBackground
|
|
323
323
|
),
|
|
324
324
|
children: e
|
|
325
325
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
+
# 13.0.0 (2025-09-23)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **components:** change feedback-status icon color to --midas-icon-primary ([a92b43b16b](https://github.com/migrationsverket/midas/commit/a92b43b16b))
|
|
6
|
+
- ⚠️ **components-theme:** add new default css export ([60df9c5b0c](https://github.com/migrationsverket/midas/commit/60df9c5b0c))
|
|
7
|
+
|
|
8
|
+
### 🩹 Fixes
|
|
9
|
+
|
|
10
|
+
- **textfield:** add native attributes to textfield and textarea ([b66f66e0c2](https://github.com/migrationsverket/midas/commit/b66f66e0c2))
|
|
11
|
+
- **table:** use correct background color for row ([11ba3df094](https://github.com/migrationsverket/midas/commit/11ba3df094))
|
|
12
|
+
- **layout:** remove hash from main role querySelector ([1de02a1daf](https://github.com/migrationsverket/midas/commit/1de02a1daf))
|
|
13
|
+
|
|
14
|
+
### 🏭 Refactoring
|
|
15
|
+
|
|
16
|
+
- remove theme from components project completely, rely on theme package ([5616f8ecc2](https://github.com/migrationsverket/midas/commit/5616f8ecc2))
|
|
17
|
+
|
|
18
|
+
### 📖 Documentation changes
|
|
19
|
+
|
|
20
|
+
- add an unreleased indicator in the header ([a531105b18](https://github.com/migrationsverket/midas/commit/a531105b18))
|
|
21
|
+
|
|
22
|
+
### 🔧 Maintenance
|
|
23
|
+
|
|
24
|
+
- split global.css into fonts.css and color-scheme.css ([4597020286](https://github.com/migrationsverket/midas/commit/4597020286))
|
|
25
|
+
- **components:** remove reference to missing plugin ([8afb0b77d7](https://github.com/migrationsverket/midas/commit/8afb0b77d7))
|
|
26
|
+
- **theme:** rename imported variables ([1f33edb0a8](https://github.com/migrationsverket/midas/commit/1f33edb0a8))
|
|
27
|
+
- **theme:** revert removal of css ([32fd9c10f6](https://github.com/migrationsverket/midas/commit/32fd9c10f6))
|
|
28
|
+
- fix jest module name mapper for theme project ([67ab292b9b](https://github.com/migrationsverket/midas/commit/67ab292b9b))
|
|
29
|
+
- temporary fix on named module imports in preview.tsx ([4ef7584195](https://github.com/migrationsverket/midas/commit/4ef7584195))
|
|
30
|
+
- fix component unused variables ([86456c1412](https://github.com/migrationsverket/midas/commit/86456c1412))
|
|
31
|
+
- fix stylelint references ([0772ed273e](https://github.com/migrationsverket/midas/commit/0772ed273e))
|
|
32
|
+
- **storybook:** refactor theme imports to point to theme package ([3410f92902](https://github.com/migrationsverket/midas/commit/3410f92902))
|
|
33
|
+
- buildable docs version ([b25c77fdf3](https://github.com/migrationsverket/midas/commit/b25c77fdf3))
|
|
34
|
+
|
|
35
|
+
### ⚠️ Breaking Changes
|
|
36
|
+
|
|
37
|
+
- **components-theme:** Default styles are now accessible from `import '@midas-ds/components/default.css'` or via the `@midas-ds/theme` package.
|
|
38
|
+
|
|
39
|
+
### 🧱 Updated Dependencies
|
|
40
|
+
|
|
41
|
+
- Updated theme to 3.0.0
|
|
42
|
+
|
|
1
43
|
## 12.1.1 (2025-09-12)
|
|
2
44
|
|
|
3
45
|
### 🩹 Fixes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('./assets/InfoBanner.css');const e=require("react/jsx-runtime"),q=require("./icon-map-9XcghDra.cjs"),v=require("react"),S=require("./clsx-C11secjj.cjs"),z=require("./Button-D_tRdPW9.cjs"),R=require("./x-rV-nu490.cjs"),w=require("./useLocalizedStringFormatter-BO2iZEL0.cjs");function y(s){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>s[t]})}}return r.default=s,Object.freeze(r)}const f=y(v),M="_infoBanner_1firo_1",P="_success_1firo_11",h="_info_1firo_1",p="_important_1firo_21",D="_warning_1firo_26",F="_content_1firo_35",I="_heading_1firo_41",L="_text_1firo_46",k="_icon_1firo_52",E="_dismissable_1firo_57",i={infoBanner:M,success:P,info:h,important:p,warning:D,content:F,heading:I,text:L,icon:k,dismissable:E},T={close:"Close"},X={close:"Stäng"},A={en:T,sv:X},G=({title:s,message:r,type:t,children:o,isDismissable:m=!1,defaultOpen:x=!0,isOpen:a,onOpenChange:n,...l})=>{const u=f.useRef(!0),c=typeof a<"u",[j,_]=f.useState(c?a:x),b=q.iconMap[t],g=w.useLocalizedStringFormatter(A),B=()=>{n==null||n(!1),c||_(!1)};return f.useEffect(()=>{if(u.current){u.current=!1;return}_(N=>{const d=c&&a||!c&&!N;return d&&(n==null||n(!0)),d})},[a,c,n]),j?e.jsxs("div",{...l,className:S.clsx(i.infoBanner,i[t],l.className),children:[e.jsx(b,{size:20,"aria-hidden":!0,className:i.icon}),e.jsxs("div",{className:i.content,children:[s&&e.jsx("strong",{className:i.heading,children:s}),e.jsxs("div",{className:i.text,children:[r,o]})]}),m&&e.jsx("div",{className:i.dismissable,children:e.jsx(z.Button,{variant:"icon","aria-label":g.format("close"),onPress:B,children:e.jsx(R.X,{size:20})})})]}):null};exports.InfoBanner=G;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { i as w } from "./icon-map-uS87FT_Q.js";
|
|
3
|
+
import * as c from "react";
|
|
4
|
+
import { c as z } from "./clsx-OuTLNxxd.js";
|
|
5
|
+
import { B as R } from "./Button-CUMHt7MG.js";
|
|
6
|
+
import { X as S } from "./x-C2xUHAEl.js";
|
|
7
|
+
import { u as h } from "./useLocalizedStringFormatter-N0AyjzbM.js";
|
|
8
|
+
import './assets/InfoBanner.css';const j = "_infoBanner_1firo_1", I = "_success_1firo_11", y = "_info_1firo_1", E = "_important_1firo_21", F = "_warning_1firo_26", L = "_content_1firo_35", M = "_heading_1firo_41", P = "_text_1firo_46", X = "_icon_1firo_52", k = "_dismissable_1firo_57", i = {
|
|
9
|
+
infoBanner: j,
|
|
10
|
+
success: I,
|
|
11
|
+
info: y,
|
|
12
|
+
important: E,
|
|
13
|
+
warning: F,
|
|
14
|
+
content: L,
|
|
15
|
+
heading: M,
|
|
16
|
+
text: P,
|
|
17
|
+
icon: X,
|
|
18
|
+
dismissable: k
|
|
19
|
+
}, q = { close: "Close" }, A = { close: "Stäng" }, D = {
|
|
20
|
+
en: q,
|
|
21
|
+
sv: A
|
|
22
|
+
}, U = ({
|
|
23
|
+
title: e,
|
|
24
|
+
message: d,
|
|
25
|
+
type: a,
|
|
26
|
+
children: u,
|
|
27
|
+
isDismissable: x = !1,
|
|
28
|
+
defaultOpen: B = !0,
|
|
29
|
+
isOpen: r,
|
|
30
|
+
onOpenChange: s,
|
|
31
|
+
...f
|
|
32
|
+
}) => {
|
|
33
|
+
const m = c.useRef(!0), t = typeof r < "u", [N, l] = c.useState(
|
|
34
|
+
t ? r : B
|
|
35
|
+
), v = w[a], b = h(D), g = () => {
|
|
36
|
+
s == null || s(!1), t || l(!1);
|
|
37
|
+
};
|
|
38
|
+
return c.useEffect(() => {
|
|
39
|
+
if (m.current) {
|
|
40
|
+
m.current = !1;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
l((p) => {
|
|
44
|
+
const _ = t && r || !t && !p;
|
|
45
|
+
return _ && (s == null || s(!0)), _;
|
|
46
|
+
});
|
|
47
|
+
}, [r, t, s]), N ? /* @__PURE__ */ n(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
...f,
|
|
51
|
+
className: z(i.infoBanner, i[a], f.className),
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ o(
|
|
54
|
+
v,
|
|
55
|
+
{
|
|
56
|
+
size: 20,
|
|
57
|
+
"aria-hidden": !0,
|
|
58
|
+
className: i.icon
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ n("div", { className: i.content, children: [
|
|
62
|
+
e && /* @__PURE__ */ o("strong", { className: i.heading, children: e }),
|
|
63
|
+
/* @__PURE__ */ n("div", { className: i.text, children: [
|
|
64
|
+
d,
|
|
65
|
+
u
|
|
66
|
+
] })
|
|
67
|
+
] }),
|
|
68
|
+
x && /* @__PURE__ */ o("div", { className: i.dismissable, children: /* @__PURE__ */ o(
|
|
69
|
+
R,
|
|
70
|
+
{
|
|
71
|
+
variant: "icon",
|
|
72
|
+
"aria-label": b.format("close"),
|
|
73
|
+
onPress: g,
|
|
74
|
+
children: /* @__PURE__ */ o(S, { size: 20 })
|
|
75
|
+
}
|
|
76
|
+
) })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
) : null;
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
U as I
|
|
83
|
+
};
|