@altinn/altinn-components 0.36.6 → 0.36.7

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,47 +1,47 @@
1
- import { jsx as n } from "react/jsx-runtime";
1
+ import { 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 "../Snackbar/useSnackbar.js";
6
- import { ListItem as h } from "../List/ListItem.js";
7
- import '../../assets/AccessAreaListItem.css';const d = "_content_7hk0i_1", I = {
8
- content: d
9
- }, k = ({
6
+ import { ListItem as b } from "../List/ListItem.js";
7
+ import '../../assets/AccessAreaListItem.css';const I = "_content_7hk0i_1", d = {
8
+ content: I
9
+ }, j = ({
10
10
  name: t,
11
- icon: i,
12
- iconUrl: r,
13
- size: l = "md",
14
- children: m,
15
- expanded: o = !1,
16
- onClick: a,
17
- badgeText: e,
18
- colorTheme: s,
19
- loading: c,
20
- titleAs: p = "h3",
21
- ...b
22
- }) => /* @__PURE__ */ n(
23
- h,
11
+ icon: c,
12
+ iconUrl: n,
13
+ size: r = "md",
14
+ children: i,
15
+ expanded: e = !1,
16
+ onClick: m,
17
+ badge: l,
18
+ colorTheme: a,
19
+ loading: o,
20
+ titleAs: h = "h3",
21
+ ...p
22
+ }) => /* @__PURE__ */ s(
23
+ b,
24
24
  {
25
25
  as: "button",
26
26
  icon: {
27
- svgElement: i,
28
- iconUrl: r,
27
+ svgElement: c,
28
+ iconUrl: n,
29
29
  theme: "subtle",
30
- color: s,
30
+ color: a,
31
31
  altText: ""
32
32
  },
33
- title: { children: t, as: p },
33
+ title: { children: t, as: h },
34
34
  ariaLabel: t,
35
- size: l,
36
- collapsible: !c,
37
- expanded: o,
38
- onClick: a,
39
- badge: e ? { label: e, color: s } : void 0,
40
- loading: c,
41
- ...b,
42
- children: o && /* @__PURE__ */ n("div", { className: I.content, children: m })
35
+ size: r,
36
+ collapsible: !o,
37
+ expanded: e,
38
+ onClick: m,
39
+ badge: l,
40
+ loading: o,
41
+ ...p,
42
+ children: e && /* @__PURE__ */ s("div", { className: d.content, children: i })
43
43
  }
44
44
  );
45
45
  export {
46
- k as AccessAreaListItem
46
+ j as AccessAreaListItem
47
47
  };
@@ -1,7 +1,7 @@
1
1
  import { Color } from '../../types';
2
2
  import { SvgElement } from '../Icon';
3
3
  import { ListItemProps } from '../List';
4
- interface AccessAreaListItemDefaultProps extends Pick<ListItemProps, 'size' | 'onClick' | 'expanded' | 'loading' | 'shadow' | 'border'> {
4
+ interface AccessAreaListItemDefaultProps extends Pick<ListItemProps, 'size' | 'onClick' | 'expanded' | 'loading' | 'shadow' | 'border' | 'badge'> {
5
5
  /** Id of the item */
6
6
  id: string;
7
7
  /** Name of the Access Area */
@@ -10,8 +10,6 @@ interface AccessAreaListItemDefaultProps extends Pick<ListItemProps, 'size' | 'o
10
10
  titleAs?: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div' | 'span';
11
11
  /** Color theme of the Access Area */
12
12
  colorTheme?: Color;
13
- /** Optional Badge to display things like the number of packages a user has in the area */
14
- badgeText?: string;
15
13
  /** Children to render when the item is expanded */
16
14
  children?: React.ReactNode;
17
15
  }
@@ -22,5 +20,5 @@ export type AccessAreaListItemProps = (AccessAreaListItemDefaultProps & {
22
20
  iconUrl: string;
23
21
  icon?: never;
24
22
  });
25
- export declare const AccessAreaListItem: ({ name, icon, iconUrl, size, children, expanded, onClick, badgeText, colorTheme, loading, titleAs, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const AccessAreaListItem: ({ name, icon, iconUrl, size, children, expanded, onClick, badge, colorTheme, loading, titleAs, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
26
24
  export {};
@@ -1,8 +1,9 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
+ import { BadgeProps } from '../..';
2
3
  import { AccessAreaListItemProps } from './AccessAreaListItem';
3
4
  declare const meta: {
4
5
  title: string;
5
- component: ({ name, icon, iconUrl, size, children, expanded, onClick, badgeText, colorTheme, loading, titleAs, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
6
+ component: ({ name, icon, iconUrl, size, children, expanded, onClick, badge, colorTheme, loading, titleAs, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
6
7
  tags: string[];
7
8
  args: {
8
9
  id: string;
@@ -10,7 +11,7 @@ declare const meta: {
10
11
  name: string;
11
12
  titleAs: "h3";
12
13
  iconUrl: string;
13
- badgeText: string;
14
+ badge: BadgeProps;
14
15
  colorTheme: "company";
15
16
  loading: false;
16
17
  shadow: "sm";
@@ -58,4 +59,5 @@ export default meta;
58
59
  type Story = StoryObj<typeof meta>;
59
60
  export declare const AreaListItemStory: Story;
60
61
  export declare const AreaWithPackages: (args: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const AreaWithPermissions: (args: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
61
63
  export declare const AllAreas: (args: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { ListItemProps } from '../List';
2
- export interface AccessPackageListItemProps extends Pick<ListItemProps, 'color' | 'onClick' | 'as' | 'description' | 'size' | 'controls' | 'loading' | 'shadow' | 'border'> {
2
+ export interface AccessPackageListItemProps extends Pick<ListItemProps, 'color' | 'onClick' | 'as' | 'description' | 'size' | 'controls' | 'loading' | 'shadow' | 'border' | 'badge'> {
3
3
  id: string;
4
4
  name: string;
5
5
  titleAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span';
@@ -55,4 +55,5 @@ declare const meta: {
55
55
  };
56
56
  export default meta;
57
57
  export declare const AccessPackageListStory: (args: AccessPackageListItemProps) => import("react/jsx-runtime").JSX.Element;
58
+ export declare const AccessPackageWithBadge: (args: AccessPackageListItemProps) => import("react/jsx-runtime").JSX.Element;
58
59
  export declare const ListOfPackages: () => import("react/jsx-runtime").JSX.Element;
@@ -13,4 +13,5 @@ export default meta;
13
13
  type Story = StoryObj<typeof meta>;
14
14
  export declare const Default: Story;
15
15
  export declare const Transmissions: Story;
16
+ export declare const TransmissionsUnread: () => import("react/jsx-runtime").JSX.Element;
16
17
  export declare const MultipleActivities: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.36.6",
3
+ "version": "0.36.7",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",