@midas-ds/components 17.2.1 → 17.2.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 17.2.3 (2026-02-23)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated theme to 3.11.1
6
+
7
+ ## 17.2.2 (2026-02-19)
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - **components, textfield:** toggle input type for password ([#1064](https://github.com/migrationsverket/midas/pull/1064))
12
+
1
13
  ## 17.2.1 (2026-02-19)
2
14
 
3
15
  ### 🩹 Fixes
@@ -1 +1 @@
1
- ._textField_1jh92_1{display:grid;grid-auto-columns:1fr;grid-auto-rows:1fr 1fr;grid-template-columns:1fr auto;grid-template-rows:min-content min-content min-content min-content;grid-template-areas:"Label Count" "Desc Count" "Error Count" "Input Input" "BottomError BottomError";width:100%;align-content:flex-end}._textField_1jh92_1>[slot=description]{grid-area:Desc}._textField_1jh92_1>._bottomError_1jh92_20{grid-area:BottomError}._textField_1jh92_1[data-disabled]{color:var(--midas-text-disabled)}._textField_1jh92_1[data-readonly] ._textArea_1jh92_29,._textField_1jh92_1[data-readonly] ._input_1jh92_30{background-color:transparent;border-color:var(--midas-border-color-subtle)}._textArea_1jh92_29{all:unset;color:var(--midas-text-primary);font-family:var(--midas-typography-font-family);display:flex;grid-area:Input;border-bottom:1px solid var(--midas-border-color-primary);align-items:center;justify-content:center;font-size:1rem;padding:1rem 1rem 1.25rem;background-color:var(--midas-field-01-base);box-sizing:border-box;word-wrap:break-word;width:100%;resize:both;overflow:auto}@media(forced-colors:active){._textArea_1jh92_29{outline:3px solid;outline-offset:2px}}._textArea_1jh92_29[data-hovered]{background-color:var(--midas-field-01-hover)}._textArea_1jh92_29[data-focused],._textArea_1jh92_29[data-focus-visible]{box-shadow:var(--midas-state-focus)}@media(forced-colors:active){._textArea_1jh92_29[data-focused],._textArea_1jh92_29[data-focus-visible]{border:1px solid}}._textArea_1jh92_29[data-invalid]{border:none;box-shadow:var(--midas-state-invalid)}._textArea_1jh92_29[data-disabled]{cursor:not-allowed;background-color:var(--midas-field-disabled);border:none;border-bottom:1px solid var(--midas-border-color-disabled);color:var(--midas-text-disabled)}._wrap_1jh92_87{position:relative;grid-area:Input}._medium_1jh92_92 ._input_1jh92_30{min-height:var(--midas-size-130)}._input_1jh92_30{all:unset;color:var(--midas-text-primary);font-family:var(--midas-typography-font-family);grid-area:Input;border-bottom:1px solid var(--midas-border-color-primary);font-size:1rem;padding:0 1rem;line-height:1;background-color:var(--midas-field-01-base);border-radius:0;box-sizing:border-box;width:100%;min-height:var(--midas-size-150)}@media(forced-colors:active){._input_1jh92_30{border:1px solid}}._input_1jh92_30[data-hovered]{background-color:var(--midas-field-01-hover)}._input_1jh92_30[data-hovered]+._passwordText_1jh92_120{background-color:var(--midas-field-01-hover)}._input_1jh92_30[data-focused]{box-shadow:var(--midas-state-focus)}@media(forced-colors:active){._input_1jh92_30[data-focused]{outline:3px solid highlight;outline-offset:2px}}._input_1jh92_30[data-invalid]{border:none;box-shadow:var(--midas-state-invalid)}@media(forced-colors:active){._input_1jh92_30[data-invalid]{border:1px solid}}._input_1jh92_30[data-disabled]{cursor:not-allowed;background-color:var(--midas-field-disabled);border:none;border-bottom:1px solid var(--midas-border-color-disabled)}@media(forced-colors:active){._input_1jh92_30[data-disabled]{border:1px solid}}._input_1jh92_30::-ms-reveal{display:none}._passwordText_1jh92_120{background-color:var(--midas-field-01-base);position:absolute;display:flex;align-items:center;top:3px;z-index:var(--midas-z-index-base);left:1rem;height:calc(100% - 6px);width:calc(100% - 2rem)}._passwordButton_1jh92_171{position:absolute;right:0;z-index:calc(var(--midas-z-index-base) + var(--midas-z-index-above));border-bottom:none}
1
+ ._textField_38yax_1{display:grid;grid-auto-columns:1fr;grid-auto-rows:1fr 1fr;grid-template-columns:1fr auto;grid-template-rows:min-content min-content min-content min-content;grid-template-areas:"Label Count" "Desc Count" "Error Count" "Input Input" "BottomError BottomError";width:100%;align-content:flex-end}._textField_38yax_1>[slot=description]{grid-area:Desc}._textField_38yax_1>._bottomError_38yax_20{grid-area:BottomError}._textField_38yax_1[data-disabled]{color:var(--midas-text-disabled)}._textField_38yax_1[data-readonly] ._textArea_38yax_29,._textField_38yax_1[data-readonly] ._input_38yax_30{background-color:transparent;border-color:var(--midas-border-color-subtle)}._textArea_38yax_29{all:unset;color:var(--midas-text-primary);font-family:var(--midas-typography-font-family);display:flex;grid-area:Input;border-bottom:1px solid var(--midas-border-color-primary);align-items:center;justify-content:center;font-size:1rem;padding:1rem 1rem 1.25rem;background-color:var(--midas-field-01-base);box-sizing:border-box;word-wrap:break-word;width:100%;resize:both;overflow:auto}@media(forced-colors:active){._textArea_38yax_29{outline:3px solid;outline-offset:2px}}._textArea_38yax_29[data-hovered]{background-color:var(--midas-field-01-hover)}._textArea_38yax_29[data-focused],._textArea_38yax_29[data-focus-visible]{box-shadow:var(--midas-state-focus)}@media(forced-colors:active){._textArea_38yax_29[data-focused],._textArea_38yax_29[data-focus-visible]{border:1px solid}}._textArea_38yax_29[data-invalid]{border:none;box-shadow:var(--midas-state-invalid)}._textArea_38yax_29[data-disabled]{cursor:not-allowed;background-color:var(--midas-field-disabled);border:none;border-bottom:1px solid var(--midas-border-color-disabled);color:var(--midas-text-disabled)}._wrap_38yax_87{position:relative;grid-area:Input}._medium_38yax_92 ._input_38yax_30{min-height:var(--midas-size-130)}._input_38yax_30{all:unset;color:var(--midas-text-primary);font-family:var(--midas-typography-font-family);grid-area:Input;border-bottom:1px solid var(--midas-border-color-primary);font-size:1rem;padding:0 1rem;line-height:1;background-color:var(--midas-field-01-base);border-radius:0;box-sizing:border-box;width:100%;min-height:var(--midas-size-150)}@media(forced-colors:active){._input_38yax_30{border:1px solid}}._input_38yax_30[data-hovered]{background-color:var(--midas-field-01-hover)}._input_38yax_30[data-hovered]+._passwordText_38yax_120{background-color:var(--midas-field-01-hover)}._input_38yax_30[data-focused]{box-shadow:var(--midas-state-focus)}@media(forced-colors:active){._input_38yax_30[data-focused]{outline:3px solid highlight;outline-offset:2px}}._input_38yax_30[data-invalid]{border:none;box-shadow:var(--midas-state-invalid)}@media(forced-colors:active){._input_38yax_30[data-invalid]{border:1px solid}}._input_38yax_30[data-disabled]{cursor:not-allowed;background-color:var(--midas-field-disabled);border:none;border-bottom:1px solid var(--midas-border-color-disabled)}@media(forced-colors:active){._input_38yax_30[data-disabled]{border:1px solid}}._input_38yax_30::-ms-reveal{display:none}._passwordButton_38yax_159{position:absolute;right:0;z-index:calc(var(--midas-z-index-base) + var(--midas-z-index-above));border-bottom:none}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsxs as u, jsx as t } from "react/jsx-runtime";
3
- import { s as C } from "./TextField.module-BQbSZFKU.js";
3
+ import { s as C } from "./TextField.module-CJn-guZp.js";
4
4
  import { B as F } from "./Button-CaLOUTDO.js";
5
5
  import { C as N } from "./ClearButton-DPm_d7SL.js";
6
6
  import { c as l } from "./clsx-AexbMWKp.js";
@@ -0,0 +1,135 @@
1
+ 'use client';
2
+ import { jsxs as w, jsx as t } from "react/jsx-runtime";
3
+ import { forwardRef as c, useState as F } from "react";
4
+ import { useContextProps as u, TextFieldContext as y, TextField as g, InputContext as P, Input as b, TextArea as C } from "react-aria-components";
5
+ import { a as I, c as h } from "./clsx-AexbMWKp.js";
6
+ import { s as d } from "./TextField.module-CJn-guZp.js";
7
+ import { B as A } from "./Button-CaLOUTDO.js";
8
+ import { u as B } from "./useLocalizedStringFormatter-BHvsRxDk.js";
9
+ import { T as L } from "./Text-BuXvuoqM.js";
10
+ import { F as f } from "./FieldError-BMTrvSof.js";
11
+ import { C as S } from "./CharacterCounter-Dgnv-orm.js";
12
+ import { a as v, L as E } from "./Label-6GZmmff9.js";
13
+ const x = c(
14
+ (e, o) => {
15
+ [e] = u(e, o, y);
16
+ const {
17
+ label: s,
18
+ description: a,
19
+ errorMessage: i,
20
+ showCounter: n,
21
+ errorPosition: r = "top",
22
+ size: l = "large",
23
+ popover: m,
24
+ children: p
25
+ } = e;
26
+ return /* @__PURE__ */ w(
27
+ g,
28
+ {
29
+ ...e,
30
+ className: I(d.textField, {
31
+ [d.medium]: l === "medium"
32
+ }),
33
+ children: [
34
+ /* @__PURE__ */ t(v, { popover: m, children: s && /* @__PURE__ */ t(E, { children: s }) }),
35
+ a && /* @__PURE__ */ t(L, { slot: "description", children: a }),
36
+ n && /* @__PURE__ */ t(S, { isLonely: !a }),
37
+ r === "top" && /* @__PURE__ */ t(f, { "data-testid": "fieldError", children: i }),
38
+ p,
39
+ r === "bottom" && /* @__PURE__ */ t(
40
+ f,
41
+ {
42
+ "data-testid": "fieldError",
43
+ className: d.bottomError,
44
+ children: i
45
+ }
46
+ )
47
+ ]
48
+ }
49
+ );
50
+ }
51
+ );
52
+ x.displayName = "TextFieldBase";
53
+ const $ = { hide: "Hide", show: "Show", showPassword: "Show password" }, j = { hide: "Dölj", show: "Visa", showPassword: "Visa lösenord" }, z = {
54
+ en: $,
55
+ sv: j
56
+ }, V = ({
57
+ showPassword: e,
58
+ onToggle: o
59
+ }) => {
60
+ const s = B(z);
61
+ return /* @__PURE__ */ t(
62
+ A,
63
+ {
64
+ "aria-label": s.format("showPassword"),
65
+ "aria-pressed": e,
66
+ variant: "tertiary",
67
+ onPress: o,
68
+ className: d.passwordButton,
69
+ children: e ? s.format("hide") : s.format("show")
70
+ }
71
+ );
72
+ }, T = c(
73
+ ({ skipContext: e = !1, ...o }, s) => {
74
+ const [a, i] = u(
75
+ o,
76
+ s,
77
+ P
78
+ ), n = e ? s : i, r = e ? o : a, l = r.type === "password", [m, p] = F(!1);
79
+ return /* @__PURE__ */ w("div", { className: d.wrap, children: [
80
+ /* @__PURE__ */ t(
81
+ b,
82
+ {
83
+ ...r,
84
+ ref: n,
85
+ type: l && m ? "text" : r.type,
86
+ className: h(d.input, r.className)
87
+ }
88
+ ),
89
+ l && /* @__PURE__ */ t(
90
+ V,
91
+ {
92
+ showPassword: m,
93
+ onToggle: () => p((N) => !N)
94
+ }
95
+ )
96
+ ] });
97
+ }
98
+ );
99
+ T.displayName = "Input";
100
+ const D = c(
101
+ ({ className: e, list: o, type: s, min: a, max: i, form: n, ...r }, l) => /* @__PURE__ */ t(x, { ...r, children: /* @__PURE__ */ t(
102
+ T,
103
+ {
104
+ className: h(e),
105
+ form: n,
106
+ list: o,
107
+ min: a,
108
+ max: i,
109
+ ref: l,
110
+ type: s,
111
+ skipContext: !0
112
+ }
113
+ ) })
114
+ );
115
+ D.displayName = "TextField";
116
+ const H = c(
117
+ ({ className: e, cols: o, form: s, rows: a, wrap: i, ...n }, r) => /* @__PURE__ */ t(x, { ...n, children: /* @__PURE__ */ t(
118
+ C,
119
+ {
120
+ className: h(d.textArea, e),
121
+ cols: o,
122
+ form: s,
123
+ ref: r,
124
+ rows: a,
125
+ wrap: i
126
+ }
127
+ ) })
128
+ );
129
+ H.displayName = "TextArea";
130
+ export {
131
+ T as I,
132
+ H as T,
133
+ D as a,
134
+ x as b
135
+ };
@@ -0,0 +1,12 @@
1
+ import '../assets/TextField.css';const t = "_textField_38yax_1", o = "_bottomError_38yax_20", _ = "_textArea_38yax_29", r = "_input_38yax_30", s = "_wrap_38yax_87", a = "_medium_38yax_92", e = "_passwordButton_38yax_159", n = {
2
+ textField: t,
3
+ bottomError: o,
4
+ textArea: _,
5
+ input: r,
6
+ wrap: s,
7
+ medium: a,
8
+ passwordButton: e
9
+ };
10
+ export {
11
+ n as s
12
+ };
package/index.js CHANGED
@@ -29,7 +29,7 @@ import { M as So } from "./chunks/Dialog-BHxDzbf8.js";
29
29
  import { P as Io } from "./chunks/Popover-BcEtFiU1.js";
30
30
  import { P as Go } from "./chunks/ProgressBar-Dg0JMQ71.js";
31
31
  import { R as ko, a as vo } from "./chunks/Radio-CAIyBgBp.js";
32
- import { S as Mo } from "./chunks/SearchField-YVhf1_6R.js";
32
+ import { S as Mo } from "./chunks/SearchField-CZqmRPCT.js";
33
33
  import { S as ho } from "./chunks/Select-D7JfpIUT.js";
34
34
  import { S as yo } from "./chunks/Skeleton-DqIHQLQl.js";
35
35
  import { S as No } from "./chunks/Spinner-CfKMn18u.js";
@@ -37,7 +37,7 @@ import { C as zo, a as Oo, R as Qo, T as Vo, b as Zo, c as jo } from "./chunks/T
37
37
  import { T as Jo, a as Ko, b as Uo, c as Wo } from "./chunks/TabList-BaR443mu.js";
38
38
  import { T as Yo, a as _o, b as $o } from "./chunks/TagGroup-CWe0P76-.js";
39
39
  import { T as aa } from "./chunks/Text-BuXvuoqM.js";
40
- import { I as ea, T as ta, a as sa, b as pa } from "./chunks/TextArea-CNmgpBdA.js";
40
+ import { I as ea, T as ta, a as sa, b as pa } from "./chunks/TextArea-DtcdxpIM.js";
41
41
  import { G as ma, T as ia, a as fa, b as na, t as da } from "./chunks/Toast-UPM-1ipu.js";
42
42
  import { T as ca, a as la } from "./chunks/ToggleButtonGroup-CXKTrLbb.js";
43
43
  import { T as ga, a as Ba } from "./chunks/Tooltip-rDmOkGmX.js";
@@ -49,7 +49,7 @@ import { c as Na } from "./chunks/clsx-AexbMWKp.js";
49
49
  import { DialogTrigger as za, MenuTrigger as Oa, RouterProvider as Qa } from "react-aria-components";
50
50
  import { u as Za } from "./chunks/useLocalizedStringFormatter-BHvsRxDk.js";
51
51
  import { useToastState as qa } from "react-stately";
52
- const o = "17.2.1", a = {
52
+ const o = "17.2.3", a = {
53
53
  version: o
54
54
  }, r = a.version;
55
55
  export {
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "description": "Midas Components",
15
15
  "homepage": "https://designsystem.migrationsverket.se/",
16
16
  "license": "CC0-1.0",
17
- "version": "17.2.1",
17
+ "version": "17.2.3",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
@@ -41,7 +41,7 @@
41
41
  "./*": "./*/index.js"
42
42
  },
43
43
  "dependencies": {
44
- "@midas-ds/theme": "3.11.0",
44
+ "@midas-ds/theme": "3.11.1",
45
45
  "react-aria-components": "1.14.0"
46
46
  }
47
47
  }
@@ -1,4 +1,4 @@
1
- import { S as a } from "../chunks/SearchField-YVhf1_6R.js";
1
+ import { S as a } from "../chunks/SearchField-CZqmRPCT.js";
2
2
  export {
3
3
  a as SearchField
4
4
  };
@@ -0,0 +1,6 @@
1
+ interface PasswordToggleProps {
2
+ showPassword: boolean;
3
+ onToggle: () => void;
4
+ }
5
+ export declare const PasswordToggle: ({ showPassword, onToggle, }: PasswordToggleProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1,4 +1,4 @@
1
- import { I as s, T as t, a as x, b as T } from "../chunks/TextArea-CNmgpBdA.js";
1
+ import { I as s, T as t, a as x, b as T } from "../chunks/TextArea-DtcdxpIM.js";
2
2
  export {
3
3
  s as Input,
4
4
  t as TextArea,
@@ -1,11 +1,13 @@
1
1
  declare const _default: {
2
2
  "en": {
3
3
  "hide": "Hide",
4
- "show": "Show"
4
+ "show": "Show",
5
+ "showPassword": "Show password"
5
6
  },
6
7
  "sv": {
7
8
  "hide": "Dölj",
8
- "show": "Visa"
9
+ "show": "Visa",
10
+ "showPassword": "Visa lösenord"
9
11
  }
10
12
  }
11
13
  ;
@@ -1,138 +0,0 @@
1
- 'use client';
2
- import { jsxs as c, jsx as s, Fragment as P } from "react/jsx-runtime";
3
- import { forwardRef as l, useState as C } from "react";
4
- import { useContextProps as p, TextFieldContext as b, TextField as g, InputContext as f, Input as I, TextArea as v } from "react-aria-components";
5
- import { a as A, c as h } from "./clsx-AexbMWKp.js";
6
- import { s as d } from "./TextField.module-BQbSZFKU.js";
7
- import { T as w } from "./Text-BuXvuoqM.js";
8
- import { B } from "./Button-CaLOUTDO.js";
9
- import { u as L } from "./useLocalizedStringFormatter-BHvsRxDk.js";
10
- import { F as u } from "./FieldError-BMTrvSof.js";
11
- import { C as E } from "./CharacterCounter-Dgnv-orm.js";
12
- import { a as S, L as $ } from "./Label-6GZmmff9.js";
13
- const x = l(
14
- (e, a) => {
15
- [e] = p(e, a, b);
16
- const {
17
- label: r,
18
- description: o,
19
- errorMessage: i,
20
- showCounter: n,
21
- errorPosition: t = "top",
22
- size: m = "large",
23
- popover: N,
24
- children: y
25
- } = e;
26
- return /* @__PURE__ */ c(
27
- g,
28
- {
29
- ...e,
30
- className: A(d.textField, {
31
- [d.medium]: m === "medium"
32
- }),
33
- children: [
34
- /* @__PURE__ */ s(S, { popover: N, children: r && /* @__PURE__ */ s($, { children: r }) }),
35
- o && /* @__PURE__ */ s(w, { slot: "description", children: o }),
36
- n && /* @__PURE__ */ s(E, { isLonely: !o }),
37
- t === "top" && /* @__PURE__ */ s(u, { "data-testid": "fieldError", children: i }),
38
- y,
39
- t === "bottom" && /* @__PURE__ */ s(
40
- u,
41
- {
42
- "data-testid": "fieldError",
43
- className: d.bottomError,
44
- children: i
45
- }
46
- )
47
- ]
48
- }
49
- );
50
- }
51
- );
52
- x.displayName = "TextFieldBase";
53
- const j = { hide: "Hide", show: "Show" }, z = { hide: "Dölj", show: "Visa" }, D = {
54
- en: j,
55
- sv: z
56
- }, T = l(
57
- (e, a) => {
58
- [e, a] = p(e, a, f);
59
- const [r, o] = C(!1), i = () => o((t) => !t), n = L(D);
60
- return /* @__PURE__ */ c(P, { children: [
61
- r && /* @__PURE__ */ s(
62
- w,
63
- {
64
- slot: "description",
65
- className: d.passwordText,
66
- children: e.value
67
- }
68
- ),
69
- /* @__PURE__ */ s(
70
- B,
71
- {
72
- variant: "tertiary",
73
- onPress: i,
74
- className: d.passwordButton,
75
- children: r ? n.format("hide") : n.format("show")
76
- }
77
- )
78
- ] });
79
- }
80
- );
81
- T.displayName = "PasswordField";
82
- const F = l(
83
- ({ skipContext: e = !1, ...a }, r) => {
84
- const [o, i] = p(
85
- a,
86
- r,
87
- f
88
- ), n = e ? r : i, t = e ? a : o;
89
- return /* @__PURE__ */ c("div", { className: d.wrap, children: [
90
- /* @__PURE__ */ s(
91
- I,
92
- {
93
- ...t,
94
- ref: n,
95
- className: h(d.input, t.className)
96
- }
97
- ),
98
- t.type === "password" && /* @__PURE__ */ s(T, { ...t })
99
- ] });
100
- }
101
- );
102
- F.displayName = "Input";
103
- const H = l(
104
- ({ className: e, list: a, type: r, min: o, max: i, form: n, ...t }, m) => /* @__PURE__ */ s(x, { ...t, children: /* @__PURE__ */ s(
105
- F,
106
- {
107
- className: h(e),
108
- form: n,
109
- list: a,
110
- min: o,
111
- max: i,
112
- ref: m,
113
- type: r,
114
- skipContext: !0
115
- }
116
- ) })
117
- );
118
- H.displayName = "TextField";
119
- const M = l(
120
- ({ className: e, cols: a, form: r, rows: o, wrap: i, ...n }, t) => /* @__PURE__ */ s(x, { ...n, children: /* @__PURE__ */ s(
121
- v,
122
- {
123
- className: h(d.textArea, e),
124
- cols: a,
125
- form: r,
126
- ref: t,
127
- rows: o,
128
- wrap: i
129
- }
130
- ) })
131
- );
132
- M.displayName = "TextArea";
133
- export {
134
- F as I,
135
- M as T,
136
- H as a,
137
- x as b
138
- };
@@ -1,13 +0,0 @@
1
- import '../assets/TextField.css';const t = "_textField_1jh92_1", o = "_bottomError_1jh92_20", s = "_textArea_1jh92_29", _ = "_input_1jh92_30", r = "_wrap_1jh92_87", e = "_medium_1jh92_92", n = "_passwordText_1jh92_120", a = "_passwordButton_1jh92_171", p = {
2
- textField: t,
3
- bottomError: o,
4
- textArea: s,
5
- input: _,
6
- wrap: r,
7
- medium: e,
8
- passwordText: n,
9
- passwordButton: a
10
- };
11
- export {
12
- p as s
13
- };
@@ -1,2 +0,0 @@
1
- import { InputProps } from './Input';
2
- export declare const PasswordField: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;