@altinn/altinn-components 0.55.1 → 0.55.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/dist/assets/SearchField.css +1 -1
- package/dist/components/Account/AccountListItem.js +14 -12
- package/dist/components/Account/AccountListItemControls.js +20 -19
- package/dist/components/Forms/SearchField.js +28 -28
- package/dist/types/lib/components/Account/AccountListItem.d.ts +2 -1
- package/dist/types/lib/components/Account/AccountListItem.stories.d.ts +2 -1
- package/dist/types/lib/components/Account/AccountListItemControls.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_nkg1g_1{position:relative;display:inline-flex;width:100%}._icon_nkg1g_7{position:absolute;top:0;bottom:0;left:0;width:2.5em;height:100%;color:var(--ds-color-text-subtle);display:flex;justify-content:center;align-items:center;pointer-events:none}._icon_nkg1g_7>*{pointer-events:none}._icon_nkg1g_7>svg{font-size:1.25em;width:1.25em;height:1.25em}._input_nkg1g_31{padding-left:2.25em;padding-right:2.25em}._input_nkg1g_31[type=search]::-webkit-search-decoration,._input_nkg1g_31[type=search]::-webkit-search-cancel-button{appearance:none}@media(max-width:1023px){._field_nkg1g_43[data-size=xs] input[type=search]{font-size:1rem;padding-left:2em;padding-right:2em}}._clear_nkg1g_50{position:absolute;top:0;right:0;bottom:0;width:2.5em;height:100%;display:flex;justify-content:center;align-items:center}._clearButton_nkg1g_62[data-size=xs]{--dsc-button-size: 2.5em;--dsc-button-padding: 0;font-size:.75em;border:none}._clearButton_nkg1g_62:focus-visible{outline-offset:0;outline-width:2px}._input_nkg1g_31[data-collapsible=true]{transition:width .5s ease-in-out}._input_nkg1g_31[data-collapsible=true]:placeholder-shown{background-color:transparent;width:8rem}._input_nkg1g_31[data-collapsible=true]:focus,._input_nkg1g_31[data-collapsible=true]:not(:placeholder-shown){width:auto;background-color:var(--ds-color-background-default)}
|
|
@@ -3,10 +3,10 @@ import "../../index-p1eeF8LQ.js";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import "../Button/Button.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { ListItem as
|
|
6
|
+
import { ListItem as q } from "../List/ListItem.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { AccountListItemControls as
|
|
9
|
-
const
|
|
8
|
+
import { AccountListItemControls as w } from "./AccountListItemControls.js";
|
|
9
|
+
const H = ({
|
|
10
10
|
id: m,
|
|
11
11
|
type: c,
|
|
12
12
|
size: s,
|
|
@@ -22,15 +22,16 @@ const G = ({
|
|
|
22
22
|
favouriteLabel: v,
|
|
23
23
|
onToggleFavourite: A,
|
|
24
24
|
contextMenu: j,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
isPreselectedParty: k,
|
|
26
|
+
children: C,
|
|
27
|
+
interactive: M,
|
|
27
28
|
disabled: r,
|
|
28
29
|
loading: o,
|
|
29
|
-
...
|
|
30
|
+
...h
|
|
30
31
|
}) => /* @__PURE__ */ i(
|
|
31
|
-
|
|
32
|
+
q,
|
|
32
33
|
{
|
|
33
|
-
...
|
|
34
|
+
...h,
|
|
34
35
|
loading: o,
|
|
35
36
|
size: s,
|
|
36
37
|
icon: e,
|
|
@@ -40,13 +41,14 @@ const G = ({
|
|
|
40
41
|
selected: t,
|
|
41
42
|
disabled: r,
|
|
42
43
|
controls: !o && !r && /* @__PURE__ */ i(
|
|
43
|
-
|
|
44
|
+
w,
|
|
44
45
|
{
|
|
45
46
|
id: m,
|
|
46
47
|
type: c,
|
|
47
48
|
favourite: L,
|
|
48
49
|
favouriteLabel: v,
|
|
49
50
|
badge: l,
|
|
51
|
+
isPreselectedParty: k,
|
|
50
52
|
isCurrentEndUser: f,
|
|
51
53
|
isDeleted: I,
|
|
52
54
|
onToggleFavourite: A,
|
|
@@ -54,10 +56,10 @@ const G = ({
|
|
|
54
56
|
}
|
|
55
57
|
),
|
|
56
58
|
linkIcon: !o && !0,
|
|
57
|
-
interactive:
|
|
58
|
-
children:
|
|
59
|
+
interactive: M,
|
|
60
|
+
children: C
|
|
59
61
|
}
|
|
60
62
|
);
|
|
61
63
|
export {
|
|
62
|
-
|
|
64
|
+
H as AccountListItem
|
|
63
65
|
};
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { Badge as
|
|
2
|
+
import { Badge as u } from "../Badge/Badge.js";
|
|
3
3
|
import "../../index-p1eeF8LQ.js";
|
|
4
|
-
import { isValidElement as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { ContextMenu as
|
|
4
|
+
import { isValidElement as c } from "react";
|
|
5
|
+
import { Button as d } from "../Button/Button.js";
|
|
6
|
+
import { ContextMenu as v } from "../ContextMenu/ContextMenu.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { ListItemControls as
|
|
8
|
+
import { ListItemControls as x } from "../List/ListItemControls.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { S as
|
|
11
|
-
const
|
|
10
|
+
import { S as B, a as C } from "../../HeartFill-CYSrJ_xK.js";
|
|
11
|
+
const E = ({
|
|
12
12
|
id: e,
|
|
13
13
|
type: i,
|
|
14
14
|
badge: r,
|
|
15
15
|
isCurrentEndUser: m = !1,
|
|
16
16
|
favourite: n = !1,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
isPreselectedParty: l = !1,
|
|
18
|
+
favouriteLabel: s,
|
|
19
|
+
onToggleFavourite: f,
|
|
19
20
|
contextMenu: o,
|
|
20
|
-
loading:
|
|
21
|
-
}) => /* @__PURE__ */ p(
|
|
22
|
-
r && (r && !
|
|
23
|
-
!m && i !== "group" && /* @__PURE__ */ t(
|
|
24
|
-
|
|
21
|
+
loading: a
|
|
22
|
+
}) => /* @__PURE__ */ p(x, { children: [
|
|
23
|
+
r && (r && !a && typeof r == "object" && "label" in r ? /* @__PURE__ */ t(u, { ...r }) : c(r) ? r : null),
|
|
24
|
+
!m && !l && i !== "group" && /* @__PURE__ */ t(
|
|
25
|
+
d,
|
|
25
26
|
{
|
|
26
27
|
size: "xs",
|
|
27
28
|
variant: "ghost",
|
|
28
29
|
rounded: !0,
|
|
29
|
-
"aria-label":
|
|
30
|
-
onClick: () =>
|
|
31
|
-
children: n ? /* @__PURE__ */ t(
|
|
30
|
+
"aria-label": s || "Toggle favourite",
|
|
31
|
+
onClick: () => f?.(e),
|
|
32
|
+
children: n ? /* @__PURE__ */ t(B, {}) : /* @__PURE__ */ t(C, {})
|
|
32
33
|
}
|
|
33
34
|
),
|
|
34
|
-
o && /* @__PURE__ */ t(
|
|
35
|
+
o && /* @__PURE__ */ t(v, { ...o })
|
|
35
36
|
] });
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
E as AccountListItemControls
|
|
38
39
|
};
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { Icon as
|
|
1
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { c as _ } from "../../index-p1eeF8LQ.js";
|
|
3
|
+
import { Icon as f } from "../Icon/Icon.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { Button as
|
|
5
|
+
import { Button as g } from "../Button/Button.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import { Input as
|
|
8
|
-
import { FieldBase as
|
|
7
|
+
import { Input as u } from "./Input.js";
|
|
8
|
+
import { FieldBase as d } from "./FieldBase.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { S as
|
|
11
|
-
import { S as
|
|
12
|
-
import '../../assets/SearchField.css';const
|
|
13
|
-
container:
|
|
14
|
-
icon:
|
|
10
|
+
import { S as k } from "../../MagnifyingGlass-bwVhw07z.js";
|
|
11
|
+
import { S as h } from "../../XMark-tKk6aExO.js";
|
|
12
|
+
import '../../assets/SearchField.css';const B = "_container_nkg1g_1", N = "_icon_nkg1g_7", x = "_input_nkg1g_31", S = "_field_nkg1g_43", v = "_clear_nkg1g_50", y = "_clearButton_nkg1g_62", n = {
|
|
13
|
+
container: B,
|
|
14
|
+
icon: N,
|
|
15
15
|
input: x,
|
|
16
16
|
field: S,
|
|
17
|
-
clear:
|
|
18
|
-
clearButton:
|
|
17
|
+
clear: v,
|
|
18
|
+
clearButton: y
|
|
19
19
|
}, w = ({
|
|
20
|
-
className:
|
|
21
|
-
collapsible:
|
|
22
|
-
size:
|
|
20
|
+
className: r,
|
|
21
|
+
collapsible: a,
|
|
22
|
+
size: i,
|
|
23
23
|
color: c = "neutral",
|
|
24
24
|
label: s,
|
|
25
25
|
value: o,
|
|
26
|
-
onClear:
|
|
26
|
+
onClear: e,
|
|
27
27
|
clearButtonAltText: l = "Clear search",
|
|
28
28
|
...m
|
|
29
|
-
}) => /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
29
|
+
}) => /* @__PURE__ */ t(d, { size: i, color: c, label: s, className: _(n.field, r), children: /* @__PURE__ */ p("div", { className: n.container, children: [
|
|
30
|
+
/* @__PURE__ */ t(
|
|
31
|
+
u,
|
|
32
32
|
{
|
|
33
33
|
...m,
|
|
34
34
|
type: "search",
|
|
35
35
|
value: o,
|
|
36
|
-
className:
|
|
37
|
-
"data-collapsible":
|
|
36
|
+
className: n.input,
|
|
37
|
+
"data-collapsible": a,
|
|
38
38
|
autoCapitalize: "off",
|
|
39
39
|
autoComplete: "off"
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
/* @__PURE__ */ t(f, { svgElement: k, className: n.icon }),
|
|
43
|
+
e && !!o && /* @__PURE__ */ t("span", { className: n.clear, children: /* @__PURE__ */ t(
|
|
44
|
+
g,
|
|
45
45
|
{
|
|
46
46
|
size: "xs",
|
|
47
47
|
rounded: !0,
|
|
48
48
|
icon: !0,
|
|
49
49
|
variant: "tinted",
|
|
50
|
-
className:
|
|
51
|
-
onClick:
|
|
50
|
+
className: n.clearButton,
|
|
51
|
+
onClick: e,
|
|
52
52
|
"aria-label": l,
|
|
53
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ t(h, {})
|
|
54
54
|
}
|
|
55
55
|
) })
|
|
56
56
|
] }) });
|
|
@@ -14,7 +14,8 @@ export interface AccountListItemProps extends ListItemProps, AccountListItemCont
|
|
|
14
14
|
isCurrentEndUser?: boolean;
|
|
15
15
|
isDeleted?: boolean;
|
|
16
16
|
isParent?: boolean;
|
|
17
|
+
isPreselectedParty?: boolean;
|
|
17
18
|
contextMenu?: ContextMenuProps;
|
|
18
19
|
label?: string;
|
|
19
20
|
}
|
|
20
|
-
export declare const AccountListItem: ({ id, type, size, expanded, icon, name, title, description, isCurrentEndUser, isDeleted, badge, favourite, favouriteLabel, onToggleFavourite, contextMenu, children, interactive, disabled, loading, ...item }: AccountListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const AccountListItem: ({ id, type, size, expanded, icon, name, title, description, isCurrentEndUser, isDeleted, badge, favourite, favouriteLabel, onToggleFavourite, contextMenu, isPreselectedParty, children, interactive, disabled, loading, ...item }: AccountListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { AccountListItemProps } from '..';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ id, type, size, expanded, icon, name, title, description, isCurrentEndUser, isDeleted, badge, favourite, favouriteLabel, onToggleFavourite, contextMenu, children, interactive, disabled, loading, ...item }: AccountListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
component: ({ id, type, size, expanded, icon, name, title, description, isCurrentEndUser, isDeleted, badge, favourite, favouriteLabel, onToggleFavourite, contextMenu, isPreselectedParty, children, interactive, disabled, loading, ...item }: AccountListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
parameters: {};
|
|
8
8
|
args: {
|
|
@@ -26,6 +26,7 @@ declare const meta: {
|
|
|
26
26
|
isCurrentEndUser?: boolean | undefined;
|
|
27
27
|
isDeleted?: boolean | undefined;
|
|
28
28
|
isParent?: boolean | undefined;
|
|
29
|
+
isPreselectedParty?: boolean | undefined;
|
|
29
30
|
contextMenu?: import('..').ContextMenuProps | undefined;
|
|
30
31
|
label?: string | undefined;
|
|
31
32
|
variant?: import('..').ListItemVariant | undefined;
|
|
@@ -7,6 +7,7 @@ export interface AccountListItemControlsProps {
|
|
|
7
7
|
isCurrentEndUser?: boolean;
|
|
8
8
|
isDeleted?: boolean;
|
|
9
9
|
favourite?: boolean;
|
|
10
|
+
isPreselectedParty?: boolean;
|
|
10
11
|
favouriteLabel?: string;
|
|
11
12
|
onToggleFavourite?: (id: string) => void;
|
|
12
13
|
accountLabel?: string;
|
|
@@ -14,4 +15,4 @@ export interface AccountListItemControlsProps {
|
|
|
14
15
|
loading?: boolean;
|
|
15
16
|
badge?: BadgeProps | ReactNode;
|
|
16
17
|
}
|
|
17
|
-
export declare const AccountListItemControls: ({ id, type, badge, isCurrentEndUser, favourite, favouriteLabel, onToggleFavourite, contextMenu, loading, }: AccountListItemControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const AccountListItemControls: ({ id, type, badge, isCurrentEndUser, favourite, isPreselectedParty, favouriteLabel, onToggleFavourite, contextMenu, loading, }: AccountListItemControlsProps) => import("react/jsx-runtime").JSX.Element;
|