@altinn/altinn-components 0.18.0 → 0.18.2
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/MenuOption.css +1 -1
- package/dist/components/AccessAreaList/AccessAreaList.js +5 -5
- package/dist/components/AccessAreaList/AccessAreaListItem.js +25 -18
- package/dist/components/Dropdown/DrawerBase.js +7 -7
- package/dist/components/Dropdown/DropdownBase.js +5 -5
- package/dist/components/Icon/Icon.js +15 -6
- package/dist/components/Icon/IconOrAvatar.js +9 -9
- package/dist/components/Menu/MenuItemLabel.js +10 -9
- package/dist/components/Menu/MenuOption.js +26 -25
- package/dist/types/lib/components/AccessAreaList/AccessAreaListItem.d.ts +10 -4
- package/dist/types/lib/components/AccessAreaList/AccessAreaListItem.stories.d.ts +2 -8
- package/dist/types/lib/components/Icon/Icon.d.ts +3 -2
- package/dist/types/lib/components/List/ListBase.stories.d.ts +2 -2
- package/dist/types/lib/components/Menu/MenuItemLabel.d.ts +2 -1
- package/dist/types/lib/components/Toolbar/ToolbarFilter.stories.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._base_igy0i_1{padding-left:6px}._base_igy0i_1:hover [data-hover=true]{opacity:1}._label_igy0i_9{display:block;white-space:nowrap;text-overflow:ellipsis;width:max-content;overflow:hidden;max-width:240px}._input_igy0i_18{position:absolute;opacity:0}._icon_igy0i_23{flex-shrink:0;font-size:1rem;display:flex;align-items:center;justify-content:center}._icon_igy0i_23{color:var(--ds-color-base-default)}._icon_igy0i_23 [data-hover=true]{opacity:0}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createElement as e } from "react";
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
2
|
import "../../index-L8X2o7IH.js";
|
|
3
|
+
import "react";
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
5
5
|
import "../Search/AutocompleteBase.js";
|
|
6
6
|
import "../Snackbar/useSnackbar.js";
|
|
7
|
-
import { AccessAreaListItem as
|
|
7
|
+
import { AccessAreaListItem as m } from "./AccessAreaListItem.js";
|
|
8
8
|
import { ListBase as p } from "../List/ListBase.js";
|
|
9
|
-
const
|
|
9
|
+
const d = ({ items: i, color: o }) => /* @__PURE__ */ t(p, { color: o, spacing: 1, children: i.map((r) => /* @__PURE__ */ t(m, { ...r }, r.id)) });
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
d as AccessAreaList
|
|
12
12
|
};
|
|
@@ -4,36 +4,43 @@ import "react";
|
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
5
5
|
import "../Search/AutocompleteBase.js";
|
|
6
6
|
import "../Snackbar/useSnackbar.js";
|
|
7
|
-
import { ListItem as
|
|
8
|
-
import '../../assets/AccessAreaListItem.css';const
|
|
9
|
-
content:
|
|
10
|
-
},
|
|
7
|
+
import { ListItem as b } from "../List/ListItem.js";
|
|
8
|
+
import '../../assets/AccessAreaListItem.css';const d = "_content_7hk0i_1", f = {
|
|
9
|
+
content: d
|
|
10
|
+
}, k = ({
|
|
11
11
|
name: c,
|
|
12
12
|
icon: m,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
iconUrl: i,
|
|
14
|
+
size: r = "md",
|
|
15
|
+
children: l,
|
|
15
16
|
expanded: t = !1,
|
|
16
|
-
onClick:
|
|
17
|
-
badgeText:
|
|
18
|
-
colorTheme:
|
|
17
|
+
onClick: p,
|
|
18
|
+
badgeText: e,
|
|
19
|
+
colorTheme: o,
|
|
19
20
|
loading: n,
|
|
20
|
-
...
|
|
21
|
+
...a
|
|
21
22
|
}) => /* @__PURE__ */ s(
|
|
22
|
-
|
|
23
|
+
b,
|
|
23
24
|
{
|
|
24
25
|
as: "button",
|
|
25
|
-
icon: {
|
|
26
|
+
icon: {
|
|
27
|
+
svgElement: m,
|
|
28
|
+
iconUrl: i,
|
|
29
|
+
theme: "subtle",
|
|
30
|
+
color: o,
|
|
31
|
+
altText: ""
|
|
32
|
+
},
|
|
26
33
|
title: c,
|
|
27
|
-
size:
|
|
34
|
+
size: r,
|
|
28
35
|
collapsible: !n,
|
|
29
36
|
expanded: t,
|
|
30
|
-
onClick:
|
|
31
|
-
badge:
|
|
37
|
+
onClick: p,
|
|
38
|
+
badge: e ? { label: e, color: o } : void 0,
|
|
32
39
|
loading: n,
|
|
33
|
-
...
|
|
34
|
-
children: t && /* @__PURE__ */ s("div", { className:
|
|
40
|
+
...a,
|
|
41
|
+
children: t && /* @__PURE__ */ s("div", { className: f.content, children: l })
|
|
35
42
|
}
|
|
36
43
|
);
|
|
37
44
|
export {
|
|
38
|
-
|
|
45
|
+
k as AccessAreaListItem
|
|
39
46
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/DrawerBase.css';const
|
|
4
|
-
drawer:
|
|
5
|
-
},
|
|
2
|
+
import { c as o } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/DrawerBase.css';const s = "_drawer_vej3t_1", c = {
|
|
4
|
+
drawer: s
|
|
5
|
+
}, l = ({ placement: a = "inline", open: e = !1, className: r, children: t }) => /* @__PURE__ */ d(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
|
-
className:
|
|
8
|
+
className: o(c.drawer, r),
|
|
9
9
|
"data-placement": a,
|
|
10
10
|
"data-theme": "default",
|
|
11
|
-
"data-color": "
|
|
11
|
+
"data-color": "company",
|
|
12
12
|
"data-expanded": e,
|
|
13
13
|
children: t
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
l as DrawerBase
|
|
18
18
|
};
|
|
@@ -9,8 +9,8 @@ import '../../assets/DropdownBase.css';const l = "_dropdown_1hh2v_1", u = "_draw
|
|
|
9
9
|
}, x = ({
|
|
10
10
|
placement: t = "left",
|
|
11
11
|
padding: d = !0,
|
|
12
|
-
open:
|
|
13
|
-
className:
|
|
12
|
+
open: a = !1,
|
|
13
|
+
className: r,
|
|
14
14
|
children: e,
|
|
15
15
|
onClose: n
|
|
16
16
|
}) => {
|
|
@@ -19,14 +19,14 @@ import '../../assets/DropdownBase.css';const l = "_dropdown_1hh2v_1", u = "_draw
|
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
21
21
|
ref: o,
|
|
22
|
-
className: m(w.dropdown,
|
|
22
|
+
className: m(w.dropdown, r),
|
|
23
23
|
"data-theme": "default",
|
|
24
|
-
"data-color": "
|
|
24
|
+
"data-color": "company",
|
|
25
25
|
"data-shadow": "md",
|
|
26
26
|
"data-placement": t,
|
|
27
27
|
"data-padding": d,
|
|
28
28
|
role: "menu",
|
|
29
|
-
"data-expanded":
|
|
29
|
+
"data-expanded": a,
|
|
30
30
|
children: e
|
|
31
31
|
}
|
|
32
32
|
);
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as t } from "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
5
5
|
import { Skeleton as p } from "../Skeleton/Skeleton.js";
|
|
6
6
|
import "../Search/AutocompleteBase.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import '../../assets/Icon.css';const
|
|
9
|
-
icon:
|
|
10
|
-
},
|
|
8
|
+
import '../../assets/Icon.css';const d = "_icon_3p8he_1", a = {
|
|
9
|
+
icon: d
|
|
10
|
+
}, b = ({
|
|
11
|
+
loading: c,
|
|
12
|
+
altText: n,
|
|
13
|
+
svgElement: o,
|
|
14
|
+
size: e,
|
|
15
|
+
color: s,
|
|
16
|
+
theme: m,
|
|
17
|
+
iconUrl: l,
|
|
18
|
+
className: i
|
|
19
|
+
}) => o ? /* @__PURE__ */ r(p, { loading: c, variant: "circle", children: /* @__PURE__ */ r("span", { "data-size": e, "data-color": s, "data-theme": m, className: t([a.icon], i), children: /* @__PURE__ */ r(o, { "aria-hidden": "true", "alt-label": n }) }) }) : l ? /* @__PURE__ */ r(p, { loading: c, variant: "circle", children: /* @__PURE__ */ r("span", { "data-size": e, "data-color": s, "data-theme": m, className: t([a.icon], i), children: /* @__PURE__ */ r("img", { src: l, alt: n, className: a.icon }) }) }) : /* @__PURE__ */ r("span", { className: t([a.icon], i) });
|
|
11
20
|
export {
|
|
12
|
-
|
|
21
|
+
b as Icon
|
|
13
22
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { isValidElement as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as o } from "react";
|
|
3
3
|
import { Icon as i } from "./Icon.js";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import { Avatar as s } from "../Avatar/Avatar.js";
|
|
@@ -8,17 +8,17 @@ import "../RootProvider/RootProvider.js";
|
|
|
8
8
|
import "../Search/AutocompleteBase.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
10
|
function u(r) {
|
|
11
|
-
return typeof r == "string" || typeof r == "number" || typeof r == "boolean" || r === null ||
|
|
11
|
+
return typeof r == "string" || typeof r == "number" || typeof r == "boolean" || r === null || o(r);
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
13
|
+
const d = (r) => r.svgElement !== void 0 || r.iconUrl !== void 0, x = ({ size: r, icon: e, iconTheme: f, avatar: t, avatarGroup: m }) => {
|
|
14
|
+
if (!e && !t && !m)
|
|
15
15
|
return null;
|
|
16
|
-
if (t)
|
|
17
|
-
return l(t) ? /* @__PURE__ */ o(i, { theme: t.theme || f, size: t.size || r, ...t }) : u(t) ? t : /* @__PURE__ */ o(i, { svgElement: t, theme: f, size: r });
|
|
18
16
|
if (e)
|
|
19
|
-
return /* @__PURE__ */
|
|
17
|
+
return d(e) ? /* @__PURE__ */ n(i, { theme: e.theme || f, size: e.size || r, ...e }) : u(e) ? e : /* @__PURE__ */ n(i, { svgElement: e, theme: f, size: r });
|
|
18
|
+
if (t)
|
|
19
|
+
return /* @__PURE__ */ n(s, { ...t, size: t.size || r });
|
|
20
20
|
if (m)
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ n(p, { ...m, size: m.size || r });
|
|
22
22
|
};
|
|
23
23
|
export {
|
|
24
24
|
x as IconOrAvatar
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* @__PURE__ */ t("
|
|
1
|
+
import { jsx as t, jsxs as r, Fragment as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as p } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/MenuItemLabel.css';const d = "_label_1ejxp_1", m = "_title_1ejxp_7", _ = "_description_1ejxp_25", s = {
|
|
4
|
+
label: d,
|
|
5
|
+
title: m,
|
|
6
|
+
description: _
|
|
7
|
+
}, j = ({ className: l, size: e = "sm", label: i, title: n, description: c, children: a }) => /* @__PURE__ */ t("span", { className: p(s.label, l), "data-size": e, children: a || /* @__PURE__ */ r(o, { children: [
|
|
8
|
+
/* @__PURE__ */ t("strong", { className: s.title, "data-size": e, children: n || i }),
|
|
9
|
+
/* @__PURE__ */ t("span", { className: s.description, "data-size": e, children: c })
|
|
9
10
|
] }) });
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
j as MenuItemLabel
|
|
12
13
|
};
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
5
5
|
import { MenuItemBase as f } from "./MenuItemBase.js";
|
|
6
|
-
import { MenuItemLabel as
|
|
6
|
+
import { MenuItemLabel as x } from "./MenuItemLabel.js";
|
|
7
7
|
import "../Search/AutocompleteBase.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import { CheckboxIcon as
|
|
10
|
-
import { RadioIcon as
|
|
11
|
-
import '../../assets/MenuOption.css';const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import { CheckboxIcon as N } from "../Icon/CheckboxIcon.js";
|
|
10
|
+
import { RadioIcon as g } from "../Icon/RadioIcon.js";
|
|
11
|
+
import '../../assets/MenuOption.css';const I = "_base_igy0i_1", d = "_label_igy0i_9", h = "_input_igy0i_18", y = "_icon_igy0i_23", o = {
|
|
12
|
+
base: I,
|
|
13
|
+
label: d,
|
|
14
|
+
input: h,
|
|
15
|
+
icon: y
|
|
15
16
|
}, A = ({
|
|
16
|
-
size:
|
|
17
|
-
type:
|
|
18
|
-
name:
|
|
19
|
-
value:
|
|
20
|
-
label:
|
|
21
|
-
title:
|
|
22
|
-
description:
|
|
17
|
+
size: e = "md",
|
|
18
|
+
type: t,
|
|
19
|
+
name: a,
|
|
20
|
+
value: n,
|
|
21
|
+
label: r,
|
|
22
|
+
title: m,
|
|
23
|
+
description: l,
|
|
23
24
|
badge: c,
|
|
24
|
-
checked:
|
|
25
|
+
checked: i = !1,
|
|
25
26
|
disabled: p,
|
|
26
|
-
onChange:
|
|
27
|
+
onChange: b,
|
|
27
28
|
..._
|
|
28
|
-
}) => /* @__PURE__ */
|
|
29
|
+
}) => /* @__PURE__ */ u(
|
|
29
30
|
f,
|
|
30
31
|
{
|
|
31
|
-
className:
|
|
32
|
+
className: o.base,
|
|
32
33
|
disabled: p,
|
|
33
|
-
selected:
|
|
34
|
-
size:
|
|
34
|
+
selected: i,
|
|
35
|
+
size: e,
|
|
35
36
|
badge: c,
|
|
36
37
|
as: "label",
|
|
37
38
|
..._,
|
|
38
39
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ s("input", { className: o.input, name: a, value: n, type: t, checked: i, onChange: b }),
|
|
41
|
+
t === "checkbox" && /* @__PURE__ */ s(N, { checked: i, hover: !0, className: o.icon }),
|
|
42
|
+
t === "radio" && /* @__PURE__ */ s(g, { checked: i, hover: !0, className: o.icon }),
|
|
43
|
+
/* @__PURE__ */ s(x, { className: o.label, title: m, description: l, size: e, children: r })
|
|
43
44
|
]
|
|
44
45
|
}
|
|
45
46
|
);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Color } from '../../types';
|
|
2
2
|
import { SvgElement } from '../Icon';
|
|
3
3
|
import { ListItemProps } from '../List';
|
|
4
|
-
|
|
4
|
+
interface AccessAreaListItemDefaultProps extends Pick<ListItemProps, 'size' | 'onClick' | 'expanded' | 'loading'> {
|
|
5
5
|
/** Id of the item */
|
|
6
6
|
id: string;
|
|
7
7
|
/** Name of the Access Area */
|
|
8
8
|
name: string;
|
|
9
|
-
/** The icon associated with the Access Area */
|
|
10
|
-
icon: SvgElement;
|
|
11
9
|
/** Color theme of the Access Area */
|
|
12
10
|
colorTheme?: Color;
|
|
13
11
|
/** Optional Badge to display things like the number of packages a user has in the area */
|
|
@@ -15,4 +13,12 @@ export interface AccessAreaListItemProps extends Pick<ListItemProps, 'size' | 'o
|
|
|
15
13
|
/** Children to render when the item is expanded */
|
|
16
14
|
children?: React.ReactNode;
|
|
17
15
|
}
|
|
18
|
-
export
|
|
16
|
+
export type AccessAreaListItemProps = (AccessAreaListItemDefaultProps & {
|
|
17
|
+
icon: SvgElement;
|
|
18
|
+
iconUrl?: never;
|
|
19
|
+
}) | (AccessAreaListItemDefaultProps & {
|
|
20
|
+
iconUrl: string;
|
|
21
|
+
icon?: never;
|
|
22
|
+
});
|
|
23
|
+
export declare const AccessAreaListItem: ({ name, icon, iconUrl, size, children, expanded, onClick, badgeText, colorTheme, loading, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
2
|
import { AccessAreaListItemProps } from './AccessAreaListItem';
|
|
4
3
|
declare const meta: {
|
|
5
4
|
title: string;
|
|
6
|
-
component: ({ name, icon, size, children, expanded, onClick, badgeText, colorTheme, loading, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
component: ({ name, icon, iconUrl, size, children, expanded, onClick, badgeText, colorTheme, loading, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
tags: string[];
|
|
8
7
|
args: {
|
|
9
8
|
id: string;
|
|
10
9
|
size: "md";
|
|
11
10
|
name: string;
|
|
12
|
-
|
|
11
|
+
iconUrl: string;
|
|
13
12
|
badgeText: string;
|
|
14
13
|
colorTheme: "company";
|
|
15
14
|
loading: false;
|
|
@@ -26,11 +25,6 @@ declare const meta: {
|
|
|
26
25
|
type: "inline-radio";
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
|
-
icon: {
|
|
30
|
-
control: {
|
|
31
|
-
disable: true;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
28
|
colorTheme: {
|
|
35
29
|
options: string[];
|
|
36
30
|
control: {
|
|
@@ -4,7 +4,8 @@ export type IconSize = Size | undefined;
|
|
|
4
4
|
export type IconColor = Color;
|
|
5
5
|
export type IconTheme = Theme;
|
|
6
6
|
export interface IconProps {
|
|
7
|
-
svgElement
|
|
7
|
+
svgElement?: SvgElement | undefined | null | string;
|
|
8
|
+
iconUrl?: string;
|
|
8
9
|
altText?: string;
|
|
9
10
|
loading?: boolean;
|
|
10
11
|
size?: IconSize;
|
|
@@ -12,4 +13,4 @@ export interface IconProps {
|
|
|
12
13
|
theme?: IconTheme;
|
|
13
14
|
className?: string;
|
|
14
15
|
}
|
|
15
|
-
export declare const Icon: ({ loading, altText, svgElement: SvgElement, size, color, theme, className }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const Icon: ({ loading, altText, svgElement: SvgElement, size, color, theme, iconUrl, className, }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { MenuItemSize } from './MenuItemBase';
|
|
3
3
|
export interface MenuItemLabelProps {
|
|
4
|
+
className?: string;
|
|
4
5
|
size?: MenuItemSize;
|
|
5
6
|
label?: string;
|
|
6
7
|
title?: string;
|
|
7
8
|
description?: string;
|
|
8
9
|
children?: ReactNode;
|
|
9
10
|
}
|
|
10
|
-
export declare const MenuItemLabel: ({ size, label, title, description, children }: MenuItemLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const MenuItemLabel: ({ className, size, label, title, description, children }: MenuItemLabelProps) => import("react/jsx-runtime").JSX.Element;
|