@midas-ds/components 15.5.2 → 16.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/accordion/Accordion.d.ts +0 -5
  3. package/accordion/index.js +1 -1
  4. package/assets/Spinner.css +1 -1
  5. package/assets/default.css +1 -1
  6. package/button/index.js +1 -1
  7. package/calendar/index.js +1 -1
  8. package/checkbox/index.js +1 -1
  9. package/chunks/{AccordionItem-BDkCTxFM.js → AccordionItem-O3_wicV2.js} +40 -44
  10. package/chunks/{Button-DbQwg49l.js → Button-wBgWrXj3.js} +1 -1
  11. package/chunks/{CheckboxGroup-6UA5fwt5.js → CheckboxGroup-dofHjXkU.js} +1 -1
  12. package/chunks/{ComboBox-7VcYris7.js → ComboBox-XQqP_jga.js} +1 -1
  13. package/chunks/{DateField--2cGkaU8.js → DateField-ltU-Jvra.js} +1 -1
  14. package/chunks/{DateRangePicker-CrWRvDJw.js → DateRangePicker-CdoVIV-F.js} +2 -2
  15. package/chunks/{Dialog-BndmKdiv.js → Dialog-x-HLOQFU.js} +1 -1
  16. package/chunks/{InfoBanner-tXWNVxpu.js → InfoBanner-DLiVpNON.js} +1 -1
  17. package/chunks/{Label-BE4Aa-pL.js → Label-DqmNWnmm.js} +1 -1
  18. package/chunks/{Layout-DPRkHK4y.js → Layout-DtwVUZus.js} +2 -2
  19. package/chunks/{ListBoxLoadMoreItem-BKptRAtt.js → ListBoxLoadMoreItem-D9X8YnwD.js} +1 -1
  20. package/chunks/{ProgressBar-CEImvHGt.js → ProgressBar-DXBCKRe_.js} +1 -1
  21. package/chunks/{Radio-BYvbz297.js → Radio-C1AFopLt.js} +1 -1
  22. package/chunks/{RangeCalendar-CuXHsT-k.js → RangeCalendar-CGk2btOp.js} +1 -1
  23. package/chunks/{SearchField-CLrAjcdA.js → SearchField-BfpeANM6.js} +1 -1
  24. package/chunks/{Select-C9YP6yTv.js → Select-Bcu1yvbR.js} +2 -2
  25. package/chunks/{Select-eJLNw9M8.js → Select-DAlreRs2.js} +2 -2
  26. package/chunks/Spinner-BORNnHph.js +43 -0
  27. package/chunks/{Tag-CEfQksg8.js → Tag-DxBoeE_n.js} +1 -1
  28. package/chunks/{TextArea-BtxTcpto.js → TextArea-CEiOylOx.js} +2 -2
  29. package/chunks/Toast-DgQ6BTmK.js +153 -0
  30. package/chunks/Tooltip-uNMG_UU-.js +44 -0
  31. package/combobox/index.js +1 -1
  32. package/date-field/index.js +1 -1
  33. package/date-picker/index.js +1 -1
  34. package/index.d.ts +0 -1
  35. package/index.js +113 -115
  36. package/info-banner/index.js +1 -1
  37. package/label/index.js +1 -1
  38. package/layout/index.js +1 -1
  39. package/legacy-select/index.js +1 -1
  40. package/list-box/ListBoxHeader.d.ts +1 -1
  41. package/list-box/index.js +1 -1
  42. package/modal/Dialog.d.ts +0 -11
  43. package/modal/index.d.ts +1 -1
  44. package/modal/index.js +1 -1
  45. package/package.json +3 -3
  46. package/progress-bar/index.js +1 -1
  47. package/radio/index.js +1 -1
  48. package/search-field/SearchField.d.ts +1 -1
  49. package/search-field/index.js +1 -1
  50. package/select/index.js +1 -1
  51. package/spinner/Spinner.d.ts +0 -6
  52. package/spinner/index.js +1 -1
  53. package/tag/index.js +1 -1
  54. package/text/Text.d.ts +2 -2
  55. package/textfield/index.js +1 -1
  56. package/toast/Toast.d.ts +2 -6
  57. package/toast/index.js +5 -4
  58. package/tooltip/Tooltip.d.ts +6 -5
  59. package/tooltip/index.js +1 -1
  60. package/assets/Dropdown.css +0 -1
  61. package/chunks/Dropdown-CWP2clB2.js +0 -79
  62. package/chunks/Spinner-CL9evrHm.js +0 -49
  63. package/chunks/Toast-CCA9sCnB.js +0 -162
  64. package/chunks/Tooltip-CtstfI8u.js +0 -46
  65. package/dropdown/Dropdown.d.ts +0 -31
  66. package/dropdown/index.d.ts +0 -1
  67. package/dropdown/index.js +0 -5
package/text/Text.d.ts CHANGED
@@ -2,7 +2,7 @@ import { TextProps as AriaTextProps } from 'react-aria-components';
2
2
  import * as React from 'react';
3
3
  export type TextSize = 'small';
4
4
  /**
5
- * @deprecated Use size prop instead. Only kept for backwards compatibility with body-01 and body-02.
5
+ * @deprecated since v15.0.0 Use size prop instead. Only kept for backwards compatibility with body-01 and body-02.
6
6
  */
7
7
  export type TextVariant = 'body-01' | 'body-02';
8
8
  export interface TextProps extends AriaTextProps {
@@ -12,7 +12,7 @@ export interface TextProps extends AriaTextProps {
12
12
  */
13
13
  size?: TextSize;
14
14
  /**
15
- * @deprecated Use size prop instead. Only body-01 and body-02 are supported for backwards compatibility.
15
+ * @deprecated since v15.0.0 Use size prop instead. Only body-01 and body-02 are supported for backwards compatibility.
16
16
  */
17
17
  variant?: TextVariant;
18
18
  /**
@@ -1,4 +1,4 @@
1
- import { I as s, b as t, a as x, T } from "../chunks/TextArea-BtxTcpto.js";
1
+ import { I as s, b as t, a as x, T } from "../chunks/TextArea-CEiOylOx.js";
2
2
  export {
3
3
  s as Input,
4
4
  t as TextArea,
package/toast/Toast.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AriaToastProps, AriaToastRegionProps } from 'react-aria';
2
- import { QueuedToast, ToastQueue, ToastState, ToastStateProps } from 'react-stately';
2
+ import { QueuedToast, ToastQueue, ToastState, useToastState } from 'react-stately';
3
3
  import { default as React } from 'react';
4
4
  import { FeedbackStatus } from '../common/types';
5
5
  export interface MidasToast {
@@ -21,11 +21,7 @@ export interface ToastProviderProps extends AriaToastRegionProps {
21
21
  children?: ((state: ToastState<MidasToast>) => React.ReactNode) | React.ReactNode;
22
22
  className?: string;
23
23
  }
24
- /**
25
- * Temporary implementation of https://github.com/adobe/react-spectrum/blob/main/packages/%40react-stately/toast/src/useToastState.ts#L59
26
- * TODO: Erase this as soon as react-stately is released
27
- */
28
- export declare function useToastState<T>(props?: ToastStateProps): ToastState<T>;
24
+ export { useToastState };
29
25
  export declare const toastQueue: ToastQueue<MidasToast>;
30
26
  export declare const GlobalToastRegion: (props: ToastProviderProps) => React.ReactPortal | null;
31
27
  export declare const ToastProvider: ({ children, ...props }: ToastProviderProps) => import("react/jsx-runtime").JSX.Element;
package/toast/index.js CHANGED
@@ -1,9 +1,10 @@
1
- import { G as o, b as t, T as e, a as T, t as r, u } from "../chunks/Toast-CCA9sCnB.js";
1
+ import { G as s, b as t, T as e, a as r, t as T } from "../chunks/Toast-DgQ6BTmK.js";
2
+ import { useToastState as u } from "react-stately";
2
3
  export {
3
- o as GlobalToastRegion,
4
+ s as GlobalToastRegion,
4
5
  t as Toast,
5
6
  e as ToastProvider,
6
- T as ToastRegion,
7
- r as toastQueue,
7
+ r as ToastRegion,
8
+ T as toastQueue,
8
9
  u as useToastState
9
10
  };
@@ -1,7 +1,8 @@
1
1
  import { TooltipProps, TooltipTriggerComponentProps } from 'react-aria-components';
2
- import * as React from 'react';
3
- export interface MidasTooltipProps extends Omit<TooltipProps, 'children'> {
4
- children: React.ReactNode;
5
- }
2
+ export type { TooltipProps };
3
+ /**
4
+ * @deprecated since v16.0.0 please use TooltipProps instead
5
+ */
6
+ export type MidasTooltipProps = TooltipProps;
6
7
  export declare function Tooltip({ children, className, ...props }: MidasTooltipProps): import("react/jsx-runtime").JSX.Element;
7
- export declare function TooltipTrigger({ children, delay, ...props }: TooltipTriggerComponentProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function TooltipTrigger({ delay, ...props }: TooltipTriggerComponentProps): import("react/jsx-runtime").JSX.Element;
package/tooltip/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { T, a } from "../chunks/Tooltip-CtstfI8u.js";
1
+ import { T, a } from "../chunks/Tooltip-uNMG_UU-.js";
2
2
  export {
3
3
  T as Tooltip,
4
4
  a as TooltipTrigger
@@ -1 +0,0 @@
1
- ._dropDownMenu_1493w_1{font-family:var(--midas-typography-font-family);box-shadow:2px 2px 4px #00000040;background-color:var(--midas-button-background-tertiary-hover)}._dropDownMenu_1493w_1[data-focus-visible]{outline:none;box-shadow:var(--midas-state-focus)}@media(forced-colors:active){._dropDownMenu_1493w_1[data-focus-visible]{outline:var(--midas-state-focus-contrast-mode-outline) solid highlight!important;outline-offset:calc(var(--midas-state-focus-contrast-mode-outline) * -1)}}._menuItem_1493w_17{width:100%}._menuItem_1493w_17[data-focus-visible]{outline:none;box-shadow:var(--midas-state-focus)}@media(forced-colors:active){._menuItem_1493w_17[data-focus-visible]{outline:var(--midas-state-focus-contrast-mode-outline) solid highlight!important;outline-offset:calc(var(--midas-state-focus-contrast-mode-outline) * -1)}}
@@ -1,79 +0,0 @@
1
- import { jsxs as t, jsx as n, Fragment as a } from "react/jsx-runtime";
2
- import { MenuTrigger as m, Popover as s, Menu as d, MenuItem as u } from "react-aria-components";
3
- import { B as h } from "./Button-DbQwg49l.js";
4
- import { c as x } from "./clsx-AexbMWKp.js";
5
- import { c as f } from "./createLucideIcon-D4r5Phnh.js";
6
- import '../assets/Dropdown.css';const w = [
7
- ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
8
- ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
9
- ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
10
- ], y = f("ellipsis-vertical", w), _ = "_dropDownMenu_1493w_1", v = "_menuItem_1493w_17", l = {
11
- dropDownMenu: _,
12
- menuItem: v
13
- };
14
- function k({
15
- label: e,
16
- title: r,
17
- children: c,
18
- icon: i = y,
19
- ...o
20
- }) {
21
- return /* @__PURE__ */ t(m, { ...o, children: [
22
- /* @__PURE__ */ t(
23
- h,
24
- {
25
- "aria-label": e || o["aria-label"],
26
- variant: "icon",
27
- children: [
28
- r,
29
- /* @__PURE__ */ n(
30
- i,
31
- {
32
- size: 20,
33
- "aria-hidden": !0
34
- }
35
- )
36
- ]
37
- }
38
- ),
39
- /* @__PURE__ */ n(s, { children: /* @__PURE__ */ n(
40
- d,
41
- {
42
- ...o,
43
- className: l.dropDownMenu,
44
- children: c
45
- }
46
- ) })
47
- ] });
48
- }
49
- function p(e) {
50
- const r = e.textValue || (typeof e.children == "string" ? e.children : void 0);
51
- return /* @__PURE__ */ n(
52
- u,
53
- {
54
- ...e,
55
- textValue: r,
56
- className: ({ isFocused: c, isOpen: i }) => x(
57
- l.menuItem,
58
- e.className,
59
- c && "focused",
60
- i && "open"
61
- ),
62
- children: ({ hasSubmenu: c }) => /* @__PURE__ */ t(a, { children: [
63
- e.children,
64
- c && /* @__PURE__ */ n(
65
- "svg",
66
- {
67
- className: "chevron",
68
- viewBox: "0 0 24 24",
69
- children: /* @__PURE__ */ n("path", { d: "m9 18 6-6-6-6" })
70
- }
71
- )
72
- ] })
73
- }
74
- );
75
- }
76
- export {
77
- k as D,
78
- p as a
79
- };
@@ -1,49 +0,0 @@
1
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
- import { c as n } from "./clsx-AexbMWKp.js";
3
- import { VisuallyHidden as d } from "react-aria";
4
- import { u as l } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
5
- import { c as _ } from "./createLucideIcon-D4r5Phnh.js";
6
- import '../assets/Spinner.css';const m = "_container_vf3ec_1", p = "_spinner_vf3ec_5", g = "_large_vf3ec_18", f = "_dark_vf3ec_23", e = {
7
- container: m,
8
- spinner: p,
9
- large: g,
10
- dark: f
11
- };
12
- const u = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], v = _("loader-circle", u), k = { loadingPleaseWait: "Loading, please wait..." }, h = { loadingPleaseWait: "Laddar, vänligen vänta..." }, L = {
13
- en: k,
14
- sv: h
15
- }, N = ({
16
- small: a,
17
- isOnColor: s = !1,
18
- color: t,
19
- className: o
20
- }) => {
21
- const i = l(L);
22
- return /* @__PURE__ */ c(
23
- "div",
24
- {
25
- className: n(e.container, o),
26
- role: "status",
27
- children: [
28
- /* @__PURE__ */ r(
29
- v,
30
- {
31
- className: n(
32
- e.spinner,
33
- !a && e.large,
34
- s && e.dark
35
- ),
36
- size: a ? 20 : 96,
37
- strokeWidth: a ? 2 : 8,
38
- absoluteStrokeWidth: !0,
39
- color: t
40
- }
41
- ),
42
- /* @__PURE__ */ r(d, { children: i.format("loadingPleaseWait") })
43
- ]
44
- }
45
- );
46
- };
47
- export {
48
- N as S
49
- };
@@ -1,162 +0,0 @@
1
- import { jsx as e, jsxs as c, Fragment as g } from "react/jsx-runtime";
2
- import { B as q } from "./Button-DbQwg49l.js";
3
- import { useToastRegion as z, useToast as h } from "react-aria";
4
- import { ToastQueue as m, useToastQueue as l } from "react-stately";
5
- import d, { useMemo as v } from "react";
6
- import { createPortal as w, flushSync as R } from "react-dom";
7
- import { c as u } from "./clsx-AexbMWKp.js";
8
- import { F as b } from "./FeedbackStatusIcon-COWuMusk.js";
9
- import { X as y } from "./x-BXShoIAM.js";
10
- import '../assets/Toast.css';const P = "_toastRegion_3qumz_49", I = "_toast_3qumz_49", N = "_success_3qumz_97", x = "_info_3qumz_105", E = "_important_3qumz_113", O = "_warning_3qumz_121", M = "_icon_3qumz_129", C = "_toastContent_3qumz_143", S = "_toastMessage_3qumz_150", V = "_slideInTop_3qumz_1", k = "_slideInEnd_3qumz_1", B = "_slideOutTop_3qumz_1", F = "_slideOutEnd_3qumz_1", a = {
11
- toastRegion: P,
12
- toast: I,
13
- success: N,
14
- info: x,
15
- important: E,
16
- warning: O,
17
- icon: M,
18
- toastContent: C,
19
- toastMessage: S,
20
- slideInTop: V,
21
- slideInEnd: k,
22
- slideOutTop: B,
23
- slideOutEnd: F
24
- }, _ = {
25
- wrapUpdate(t) {
26
- "startViewTransition" in document ? document.startViewTransition(() => {
27
- R(t);
28
- }) : t();
29
- },
30
- maxVisibleToasts: 5
31
- };
32
- function Q(t = {}) {
33
- const { maxVisibleToasts: o = 1, wrapUpdate: s } = t, n = v(
34
- () => new m({ maxVisibleToasts: o, wrapUpdate: s }),
35
- [o, s]
36
- );
37
- return l(n);
38
- }
39
- const j = new m(_), Y = (t) => {
40
- const o = l(j);
41
- return o.visibleToasts.length > 0 ? w(
42
- /* @__PURE__ */ e(
43
- p,
44
- {
45
- ...t,
46
- state: o
47
- }
48
- ),
49
- document.body
50
- ) : null;
51
- }, Z = ({ children: t, ...o }) => {
52
- const s = Q(_);
53
- return /* @__PURE__ */ c(g, { children: [
54
- typeof t == "function" ? t(s) : t,
55
- s.visibleToasts.length > 0 && /* @__PURE__ */ e(
56
- p,
57
- {
58
- ...o,
59
- state: s
60
- }
61
- )
62
- ] });
63
- };
64
- function p({
65
- state: t,
66
- className: o,
67
- ...s
68
- }) {
69
- const n = d.useRef(null), { regionProps: r } = z(s, t, n);
70
- return /* @__PURE__ */ e(
71
- "div",
72
- {
73
- ...r,
74
- ref: n,
75
- className: u(a.toastRegion, o),
76
- children: t.visibleToasts.map((i) => /* @__PURE__ */ e(
77
- G,
78
- {
79
- toast: i,
80
- state: t
81
- },
82
- i.key
83
- ))
84
- }
85
- );
86
- }
87
- function G({
88
- state: t,
89
- className: o,
90
- ...s
91
- }) {
92
- const n = d.useRef(null), { toastProps: r, contentProps: i, titleProps: T, closeButtonProps: f } = h(
93
- s,
94
- t,
95
- n
96
- );
97
- return /* @__PURE__ */ c(
98
- "div",
99
- {
100
- ...r,
101
- ref: n,
102
- className: u(
103
- a.toast,
104
- a[s.toast.content.type],
105
- o
106
- ),
107
- style: { viewTransitionName: s.toast.key },
108
- children: [
109
- /* @__PURE__ */ c(
110
- "div",
111
- {
112
- ...i,
113
- className: u(a.toastContent, i.className),
114
- children: [
115
- /* @__PURE__ */ e(
116
- b,
117
- {
118
- "aria-hidden": !0,
119
- className: a.icon,
120
- status: s.toast.content.type
121
- }
122
- ),
123
- /* @__PURE__ */ c("div", { children: [
124
- /* @__PURE__ */ e(
125
- "p",
126
- {
127
- className: a.toastMessage,
128
- ...T,
129
- children: s.toast.content.message
130
- }
131
- ),
132
- s.toast.content.children
133
- ] })
134
- ]
135
- }
136
- ),
137
- /* @__PURE__ */ e(
138
- q,
139
- {
140
- variant: "icon",
141
- ...f,
142
- children: /* @__PURE__ */ e(
143
- y,
144
- {
145
- size: 20,
146
- "aria-hidden": !0
147
- }
148
- )
149
- }
150
- )
151
- ]
152
- }
153
- );
154
- }
155
- export {
156
- Y as G,
157
- Z as T,
158
- p as a,
159
- G as b,
160
- j as t,
161
- Q as u
162
- };
@@ -1,46 +0,0 @@
1
- import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
- import { c as a } from "./clsx-AexbMWKp.js";
3
- import { Tooltip as e, OverlayArrow as p, TooltipTrigger as n } from "react-aria-components";
4
- import '../assets/Tooltip.css';const c = "_tooltip_1nthz_1", T = "_arrow_1nthz_18", s = {
5
- tooltip: c,
6
- arrow: T
7
- };
8
- function w({ children: r, className: t, ...i }) {
9
- return /* @__PURE__ */ l(
10
- e,
11
- {
12
- className: a(s.tooltip, t),
13
- ...i,
14
- children: [
15
- /* @__PURE__ */ o(p, { className: s.arrow, children: /* @__PURE__ */ o(
16
- "svg",
17
- {
18
- width: 8,
19
- height: 8,
20
- viewBox: "0 0 8 8",
21
- children: /* @__PURE__ */ o("path", { d: "M0 0 L4 4 L8 0" })
22
- }
23
- ) }),
24
- r
25
- ]
26
- }
27
- );
28
- }
29
- function _({
30
- children: r,
31
- delay: t = 0,
32
- ...i
33
- }) {
34
- return /* @__PURE__ */ o(
35
- n,
36
- {
37
- delay: t,
38
- ...i,
39
- children: r
40
- }
41
- );
42
- }
43
- export {
44
- w as T,
45
- _ as a
46
- };
@@ -1,31 +0,0 @@
1
- import { MenuItemProps, MenuProps, MenuTriggerProps } from 'react-aria-components';
2
- import { LucideIcon } from 'lucide-react';
3
- /**
4
- *
5
- * @deprecated since v12.1.0
6
- * Please use `MenuProps` instead
7
- * @see {@link https://designsystem.migrationsverket.se/components/menu/|Menu}
8
- */
9
- export interface MidasMenuButtonProps<T> extends MenuProps<T>, Omit<MenuTriggerProps, 'children'> {
10
- label?: string;
11
- title?: string;
12
- /**
13
- * The icon to use for the menu button
14
- * @default EllipsisVertical
15
- */
16
- icon?: LucideIcon;
17
- }
18
- /**
19
- *
20
- * @deprecated since v12.1.0
21
- * Please use `Menu` instead
22
- * @see {@link https://designsystem.migrationsverket.se/components/menu/|Menu}
23
- */
24
- export declare function Dropdown<T extends object>({ label, title, children, icon: Icon, ...props }: MidasMenuButtonProps<T>): import("react/jsx-runtime").JSX.Element;
25
- /**
26
- *
27
- * @deprecated since v12.1.0
28
- * Please use `Menu` and `MenuItem` instead
29
- * @see {@link https://designsystem.migrationsverket.se/components/menu/|Menu}
30
- */
31
- export declare function DropdownItem(props: MenuItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export { Dropdown, DropdownItem, type MidasMenuButtonProps } from './Dropdown';
package/dropdown/index.js DELETED
@@ -1,5 +0,0 @@
1
- import { D as a, a as p } from "../chunks/Dropdown-CWP2clB2.js";
2
- export {
3
- a as Dropdown,
4
- p as DropdownItem
5
- };