@altinn/altinn-components 0.47.2 → 0.47.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.
@@ -1,27 +1,28 @@
1
1
  "use client";
2
2
  import { jsx as l } from "react/jsx-runtime";
3
3
  import { c } from "../../index-L8X2o7IH.js";
4
- import { useMemo as f } from "react";
5
- import { Avatar as h } from "./Avatar.js";
6
- import '../../assets/AvatarGroup.css';const A = "_group_1ts6c_1", _ = "_item_1ts6c_10", t = {
7
- group: A,
8
- item: _
9
- }, L = (o) => typeof o == "object" && o !== null && "items" in o, N = ({
4
+ import { useMemo as h } from "react";
5
+ import { Avatar as A } from "./Avatar.js";
6
+ import '../../assets/AvatarGroup.css';const _ = "_group_1ts6c_1", y = "_item_1ts6c_10", t = {
7
+ group: _,
8
+ item: y
9
+ }, N = (o) => typeof o == "object" && o !== null && "items" in o, P = ({
10
10
  items: o = [],
11
11
  maxItemsCount: i = 4,
12
12
  defaultType: r,
13
13
  size: u,
14
14
  className: m,
15
- style: p
15
+ style: p,
16
+ maxItemsCountReachedLabel: g
16
17
  }) => {
17
- const s = f(() => o.slice(0, i).reverse(), [o, i]);
18
+ const s = h(() => o.slice(0, i).reverse(), [o, i]);
18
19
  return o.length === 0 ? /* @__PURE__ */ l("div", { className: t.avatarGroup }) : /* @__PURE__ */ l("ul", { className: c(t.group, m), "data-size": u, "data-count": s == null ? void 0 : s.length, style: p, children: s.map((e, n) => {
19
- const g = n === i - 1, d = e.customLabel || g ? o.length.toString() : void 0;
20
+ const d = n === i - 1, f = e.customLabel || d ? g || o.length.toString() : void 0;
20
21
  return /* @__PURE__ */ l("li", { className: c(t.item), children: /* @__PURE__ */ l(
21
- h,
22
+ A,
22
23
  {
23
24
  name: e.name,
24
- customLabel: d,
25
+ customLabel: f,
25
26
  imageUrl: e.imageUrl,
26
27
  imageUrlAlt: e.imageUrlAlt,
27
28
  type: (e == null ? void 0 : e.type) || r,
@@ -34,6 +35,6 @@ import '../../assets/AvatarGroup.css';const A = "_group_1ts6c_1", _ = "_item_1ts
34
35
  }) });
35
36
  };
36
37
  export {
37
- N as AvatarGroup,
38
- L as isAvatarGroupProps
38
+ P as AvatarGroup,
39
+ N as isAvatarGroupProps
39
40
  };
@@ -16,9 +16,11 @@ export interface AvatarGroupProps {
16
16
  className?: string;
17
17
  /** Custom styles. */
18
18
  style?: CSSProperties;
19
+ /** Custom Label for items counts reached **/
20
+ maxItemsCountReachedLabel?: string;
19
21
  }
20
22
  export declare const isAvatarGroupProps: (icon: unknown) => icon is AvatarGroupProps;
21
23
  /**
22
24
  * Avatar group component for displaying multiple avatars as a group.
23
25
  */
24
- export declare const AvatarGroup: ({ items, maxItemsCount, defaultType, size, className, style, }: AvatarGroupProps) => import("react/jsx-runtime").JSX.Element;
26
+ export declare const AvatarGroup: ({ items, maxItemsCount, defaultType, size, className, style, maxItemsCountReachedLabel, }: AvatarGroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
2
2
  import { AvatarGroupProps } from '..';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ items, maxItemsCount, defaultType, size, className, style, }: AvatarGroupProps) => import("react/jsx-runtime").JSX.Element;
5
+ component: ({ items, maxItemsCount, defaultType, size, className, style, maxItemsCountReachedLabel, }: AvatarGroupProps) => import("react/jsx-runtime").JSX.Element;
6
6
  tags: string[];
7
7
  parameters: {
8
8
  layout: string;
@@ -18,4 +18,5 @@ type Story = StoryObj<typeof meta>;
18
18
  export declare const People: Story;
19
19
  export declare const Companies: Story;
20
20
  export declare const CompanyAndPerson: Story;
21
+ export declare const CustomLabel: (args: AvatarGroupProps) => import("react/jsx-runtime").JSX.Element;
21
22
  export declare const MaxItemsCount: (args: AvatarGroupProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.47.2",
3
+ "version": "0.47.3",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",