@altinn/altinn-components 0.35.8 → 0.35.9

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.
@@ -1 +1 @@
1
- ._field_5zm0g_1{position:relative}._icon_5zm0g_5{position:absolute;top:1px;left:1px;font-size:1.25em;color:var(--ds-color-text-subtle);margin:.5em}._input_5zm0g_14{padding-left:2.25em;padding-right:2.25em}._input_5zm0g_14[type=search]::-webkit-search-decoration,._input_5zm0g_14[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}._clear_5zm0g_24{font-size:inherit;position:absolute;top:1px;right:1px;margin:.25em;border:0;border-radius:100%;width:2em;height:2em;display:flex;justify-content:center;align-items:center;background-color:var(--ds-color-background-tinted);color:var(--ds-color-base-default)}._clear_5zm0g_24:hover{background-color:var(--ds-color-surface-active);color:var(--ds-color-base-default);cursor:pointer}._clear_5zm0g_24 ._clearIcon_5zm0g_48{font-size:1.5em}
1
+ ._field_zk1f7_1{position:relative}._icon_zk1f7_5{position:absolute;top:1px;left:1px;font-size:1.25em;color:var(--ds-color-text-subtle);margin:.5em}._input_zk1f7_14{padding-left:2.25em;padding-right:2.25em}._input_zk1f7_14[type=search]::-webkit-search-decoration,._input_zk1f7_14[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}._clear_zk1f7_24{font-size:inherit;position:absolute;top:0;right:0;margin:.375em;border:0;border-radius:100%;font-size:.75em;background-color:var(--ds-color-surface-tinted);color:var(--ds-color-base-default)}._clear_zk1f7_24:focus-visible{outline-offset:0;outline-width:2px}
@@ -1 +1 @@
1
- ._field_73ung_1{position:relative;display:flex;align-items:center;font-size:1.125rem;background-color:transparent;color:currentColor}._field_73ung_1[data-expanded=true]{background-color:#fff}._icon_73ung_14{position:absolute;left:0;font-size:1.5rem;margin:0 1rem}._input_73ung_21{height:3.5rem;background-color:transparent;font-size:inherit;flex-grow:1;padding:1rem 1rem 1rem 3rem;border:2px solid;border-radius:.25rem;outline:none}._input_73ung_21[type=search]::-webkit-search-decoration,._input_73ung_21[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}._input_73ung_21:focus,._input_73ung_21:not(:placeholder-shown){background-color:var(--ds-color-background-default)}._dismiss_73ung_42{position:absolute;right:0;margin:.375rem}._clear_73ung_48{background-color:var(--ds-color-neutral-surface-active);border:var(--ds-color-neutral-surface-active);color:var(--ds-color-neutral-base-default);position:absolute;right:0;margin:1rem;border-radius:100%;width:1.5rem;height:1.5rem}
1
+ ._field_1f56c_1{position:relative;display:flex;align-items:center;font-size:1.125rem;background-color:transparent;color:currentColor}._icon_1f56c_10{position:absolute;left:0;font-size:1.5rem;margin:0 1rem}._input_1f56c_17{height:3.5rem;background-color:transparent;font-size:inherit;flex-grow:1;padding:1rem 1rem 1rem 3rem;border:2px solid;border-radius:.25rem;outline:none}._input_1f56c_17[type=search]::-webkit-search-decoration,._input_1f56c_17[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}._input_1f56c_17[data-expanded=true],._input_1f56c_17:focus,._input_1f56c_17:not(:placeholder-shown){background-color:var(--ds-color-background-default)}._clear_1f56c_39{background-color:var(--ds-color-surface-tinted);color:var(--ds-color-base-default);border:0;position:absolute;right:0;margin:.75rem;border-radius:100%;width:1.5rem;height:1.5rem}._clear_1f56c_39:focus-visible{outline-offset:0;outline-width:2px}._dismiss_1f56c_56{position:absolute;right:0;margin:.5rem}._dismiss_1f56c_56:focus-visible{outline-offset:0;outline-width:2px}
@@ -1,34 +1,44 @@
1
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as l } from "react/jsx-runtime";
2
2
  import { Icon as p } from "../Icon/Icon.js";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import "react";
5
+ import { IconButton as f } from "../Button/IconButton.js";
5
6
  import "../RootProvider/RootProvider.js";
6
7
  import "../Searchbar/AutocompleteBase.js";
7
8
  import "../Snackbar/useSnackbar.js";
8
9
  import { Input as _ } from "./Input.js";
9
- import { FieldBase as f } from "./FieldBase.js";
10
- import { S as d } from "../../MagnifyingGlass-3Ln1MufI.js";
11
- import { S as g } from "../../XMark-DIqxCTTQ.js";
12
- import '../../assets/SearchField.css';const u = "_field_5zm0g_1", h = "_icon_5zm0g_5", I = "_input_5zm0g_14", z = "_clear_5zm0g_24", N = "_clearIcon_5zm0g_48", c = {
13
- field: u,
10
+ import { FieldBase as d } from "./FieldBase.js";
11
+ import { S as u } from "../../MagnifyingGlass-3Ln1MufI.js";
12
+ import { S as k } from "../../XMark-DIqxCTTQ.js";
13
+ import '../../assets/SearchField.css';const g = "_field_zk1f7_1", h = "_icon_zk1f7_5", z = "_input_zk1f7_14", S = "_clear_zk1f7_24", o = {
14
+ field: g,
14
15
  icon: h,
15
- input: I,
16
- clear: z,
17
- clearIcon: N
18
- }, E = ({
19
- className: t,
20
- size: i,
21
- color: n = "neutral",
22
- label: a,
23
- value: o,
24
- onClear: e,
25
- clearButtonAltText: s = "Clear search",
26
- ...l
27
- }) => /* @__PURE__ */ r(f, { size: i, color: n, label: a, className: t, children: /* @__PURE__ */ m("div", { className: c.field, children: [
28
- /* @__PURE__ */ r(_, { ...l, type: "search", value: o, className: c.input }),
29
- /* @__PURE__ */ r(p, { svgElement: d, className: c.icon }),
30
- e && !!o && /* @__PURE__ */ r("button", { type: "button", className: c.clear, onClick: e, "aria-label": s, children: /* @__PURE__ */ r(g, { className: c.clearIcon }) })
16
+ input: z,
17
+ clear: S
18
+ }, G = ({
19
+ className: s,
20
+ size: c,
21
+ color: e = "neutral",
22
+ label: n,
23
+ value: t,
24
+ onClear: r,
25
+ clearButtonAltText: m = "Clear search",
26
+ ...a
27
+ }) => /* @__PURE__ */ i(d, { size: c, color: e, label: n, className: s, children: /* @__PURE__ */ l("div", { className: o.field, children: [
28
+ /* @__PURE__ */ i(_, { ...a, type: "search", value: t, className: o.input }),
29
+ /* @__PURE__ */ i(p, { svgElement: u, className: o.icon }),
30
+ r && !!t && /* @__PURE__ */ i(
31
+ f,
32
+ {
33
+ icon: k,
34
+ variant: "solid",
35
+ size: "custom",
36
+ className: o.clear,
37
+ onClick: r,
38
+ iconAltText: m
39
+ }
40
+ )
31
41
  ] }) });
32
42
  export {
33
- E as SearchField
43
+ G as SearchField
34
44
  };
@@ -1,33 +1,33 @@
1
- import { jsxs as f, jsx as p } from "react/jsx-runtime";
1
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
4
  import "../RootProvider/RootProvider.js";
5
- import { SearchbarBase as A } from "./SearchbarBase.js";
5
+ import { SearchbarBase as n } from "./SearchbarBase.js";
6
6
  import { SearchbarField as T } from "./SearchbarField.js";
7
7
  import "./AutocompleteBase.js";
8
- import { Autocomplete as n } from "./Autocomplete.js";
8
+ import { Autocomplete as A } from "./Autocomplete.js";
9
9
  import "../Snackbar/useSnackbar.js";
10
10
  const k = ({
11
- className: l,
11
+ className: p,
12
12
  autocomplete: e,
13
13
  expanded: a = !1,
14
- onClose: t,
14
+ onClose: r,
15
15
  tabIndex: g,
16
16
  ...h
17
17
  }) => /* @__PURE__ */ f(
18
- A,
18
+ n,
19
19
  {
20
- className: l,
20
+ className: p,
21
21
  expanded: a,
22
22
  autocomplete: !!e,
23
- onBlurCapture: (r) => {
24
- var c, s, u, m, d, b, o;
25
- const i = (u = (s = (c = r.target) == null ? void 0 : c.attributes) == null ? void 0 : s.getNamedItem("data-testid")) == null ? void 0 : u.value;
26
- (i === "search-button-clear" || i === "search-button-close" || i === "searchbar-input" && ((m = r.relatedTarget) == null ? void 0 : m.getAttribute("data-testid")) !== "searchbar-input" && ((d = r.relatedTarget) == null ? void 0 : d.getAttribute("data-testid")) !== "search-button-clear" && ((b = r.relatedTarget) == null ? void 0 : b.getAttribute("data-testid")) !== "search-button-close" && ((o = r.relatedTarget) == null ? void 0 : o.getAttribute("data-testid")) !== "autocomplete-list") && (t == null || t());
23
+ onBlurCapture: (t) => {
24
+ var u, c, s, d, m, b, l;
25
+ const i = (s = (c = (u = t.target) == null ? void 0 : u.attributes) == null ? void 0 : c.getNamedItem("data-testid")) == null ? void 0 : s.value;
26
+ t.relatedTarget !== null && (i === "search-button-clear" || i === "search-button-close" || i === "searchbar-input" && ((d = t.relatedTarget) == null ? void 0 : d.getAttribute("data-testid")) !== "searchbar-input" && ((m = t.relatedTarget) == null ? void 0 : m.getAttribute("data-testid")) !== "search-button-clear" && ((b = t.relatedTarget) == null ? void 0 : b.getAttribute("data-testid")) !== "search-button-close" && ((l = t.relatedTarget) == null ? void 0 : l.getAttribute("data-testid")) !== "autocomplete-list") && (r == null || r());
27
27
  },
28
28
  children: [
29
- /* @__PURE__ */ p(T, { ...h, expanded: a, onClose: t, tabIndex: g }),
30
- e && /* @__PURE__ */ p(n, { ...e, expanded: a, onSelect: t })
29
+ /* @__PURE__ */ o(T, { ...h, expanded: a, onClose: r, tabIndex: g }),
30
+ e && /* @__PURE__ */ o(A, { ...e, expanded: a, onSelect: r })
31
31
  ]
32
32
  }
33
33
  );
@@ -9,42 +9,42 @@ import "./AutocompleteBase.js";
9
9
  import "../Snackbar/useSnackbar.js";
10
10
  import { S as T } from "../../MagnifyingGlass-3Ln1MufI.js";
11
11
  import { S as m } from "../../XMark-DIqxCTTQ.js";
12
- import '../../assets/SearchbarField.css';const j = "_field_73ung_1", A = "_icon_73ung_14", K = "_input_73ung_21", M = "_dismiss_73ung_42", U = "_clear_73ung_48", s = {
12
+ import '../../assets/SearchbarField.css';const j = "_field_1f56c_1", z = "_icon_1f56c_10", A = "_input_1f56c_17", K = "_clear_1f56c_39", M = "_dismiss_1f56c_56", s = {
13
13
  field: j,
14
- icon: A,
15
- input: K,
16
- dismiss: M,
17
- clear: U
14
+ icon: z,
15
+ input: A,
16
+ clear: K,
17
+ dismiss: M
18
18
  }, H = ({
19
19
  className: p,
20
20
  expanded: e,
21
- name: u = "q",
22
- value: c,
21
+ name: f = "q",
22
+ value: a,
23
23
  placeholder: d = "Search",
24
- closeButtonAltText: f = "Close search",
24
+ closeButtonAltText: u = "Close search",
25
25
  clearButtonAltText: _ = "Clear search",
26
26
  onFocus: h,
27
- onBlur: g,
28
- onChange: x,
29
- onClear: b,
30
- onClose: y,
27
+ onBlur: x,
28
+ onChange: b,
29
+ onClear: y,
30
+ onClose: S,
31
31
  onEnter: i,
32
- tabIndex: S
32
+ tabIndex: g
33
33
  }) => {
34
- const a = N(null), k = (o) => {
34
+ const c = N(null), k = (o) => {
35
35
  var r, n;
36
- o.key === "Escape" && ((r = a.current) == null || r.blur()), o.key === "Enter" && ((n = a.current) == null || n.blur(), i == null || i());
36
+ o.key === "Escape" && ((r = c.current) == null || r.blur()), o.key === "Enter" && ((n = c.current) == null || n.blur(), i == null || i());
37
37
  };
38
- return /* @__PURE__ */ C("div", { className: I(s.field, p), "data-expanded": e, children: [
38
+ return /* @__PURE__ */ C("div", { className: I(s.field, p), children: [
39
39
  /* @__PURE__ */ t(
40
40
  "input",
41
41
  {
42
- ref: a,
42
+ ref: c,
43
43
  onFocus: h,
44
- onBlur: g,
45
- name: u,
46
- value: c,
47
- onChange: x,
44
+ onBlur: x,
45
+ name: f,
46
+ value: a,
47
+ onChange: b,
48
48
  placeholder: d,
49
49
  className: s.input,
50
50
  onKeyUp: k,
@@ -52,19 +52,20 @@ import '../../assets/SearchbarField.css';const j = "_field_73ung_1", A = "_icon_
52
52
  "aria-haspopup": !0,
53
53
  autoComplete: "off",
54
54
  "aria-autocomplete": "list",
55
- tabIndex: S ?? 0,
55
+ tabIndex: g ?? 0,
56
+ "data-expanded": e,
56
57
  "data-testid": "searchbar-input"
57
58
  }
58
59
  ),
59
60
  /* @__PURE__ */ t(v, { svgElement: T, className: s.icon }),
60
- c && /* @__PURE__ */ t(
61
+ a && /* @__PURE__ */ t(
61
62
  l,
62
63
  {
63
64
  icon: m,
64
65
  variant: "solid",
65
66
  size: "custom",
66
67
  className: s.clear,
67
- onClick: b,
68
+ onClick: y,
68
69
  dataTestId: "search-button-clear",
69
70
  iconAltText: _
70
71
  }
@@ -72,11 +73,12 @@ import '../../assets/SearchbarField.css';const j = "_field_73ung_1", A = "_icon_
72
73
  l,
73
74
  {
74
75
  icon: m,
76
+ size: "sm",
75
77
  variant: "text",
76
78
  className: s.dismiss,
77
- onClick: y,
79
+ onClick: S,
78
80
  dataTestId: "search-button-close",
79
- iconAltText: f
81
+ iconAltText: u
80
82
  }
81
83
  )
82
84
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.35.8",
3
+ "version": "0.35.9",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",