@altinn/altinn-components 0.19.6 → 0.20.0
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/components/Dialog/DialogActions.js +19 -20
- package/dist/types/lib/components/Avatar/Avatar.d.ts +2 -1
- package/dist/types/lib/components/Avatar/Examples.stories.d.ts +1 -1
- package/dist/types/lib/components/Avatar/avatar.stories.d.ts +1 -1
- package/dist/types/lib/components/Icon/IconOrAvatar.d.ts +1 -1
- package/dist/types/lib/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/types/lib/hooks/useClickOutside.d.ts +1 -1
- package/package.json +6 -6
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useMemo as
|
|
2
|
+
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as g } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import { Button as h } from "../Button/Button.js";
|
|
6
6
|
import { ComboButton as y } from "../Button/ComboButton.js";
|
|
7
|
-
import { useRootContext as
|
|
8
|
-
import { DropdownBase as
|
|
9
|
-
import { Menu as
|
|
7
|
+
import { useRootContext as C } from "../RootProvider/RootProvider.js";
|
|
8
|
+
import { DropdownBase as v } from "../Dropdown/DropdownBase.js";
|
|
9
|
+
import { Menu as b } from "../Menu/Menu.js";
|
|
10
10
|
import "../Search/AutocompleteBase.js";
|
|
11
11
|
import "../Snackbar/useSnackbar.js";
|
|
12
|
-
import { S as
|
|
13
|
-
import { S as
|
|
14
|
-
import '../../assets/DialogActions.css';const x = "_action_m3crc_1",
|
|
12
|
+
import { S as B } from "../../ChevronUp-H8Nuww4h.js";
|
|
13
|
+
import { S as _ } from "../../ChevronDown-CRAwzuD3.js";
|
|
14
|
+
import '../../assets/DialogActions.css';const x = "_action_m3crc_1", k = "_comboButton_m3crc_7", m = {
|
|
15
15
|
action: x,
|
|
16
|
-
comboButton:
|
|
17
|
-
},
|
|
18
|
-
const { currentId: a, toggleId: u } =
|
|
19
|
-
u(l);
|
|
20
|
-
}, t = f(() => (c || []).sort((r, o) => {
|
|
16
|
+
comboButton: k
|
|
17
|
+
}, q = ({ items: c, maxItems: s = 2, id: l = "dialog-actions" }) => {
|
|
18
|
+
const { currentId: p, closeAll: a, toggleId: u } = C(), e = p === l, t = g(() => (c || []).sort((r, o) => {
|
|
21
19
|
const i = ["primary", "secondary", "tertiary"];
|
|
22
20
|
return i.indexOf(r == null ? void 0 : r.priority) - i.indexOf(o == null ? void 0 : o.priority);
|
|
23
21
|
}), [c]);
|
|
@@ -30,26 +28,27 @@ import '../../assets/DialogActions.css';const x = "_action_m3crc_1", I = "_combo
|
|
|
30
28
|
onClick: o.onClick,
|
|
31
29
|
group: o.priority
|
|
32
30
|
}));
|
|
33
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ f("section", { className: m.comboButton, children: [
|
|
34
32
|
/* @__PURE__ */ n(
|
|
35
33
|
y,
|
|
36
34
|
{
|
|
37
35
|
variant: "solid",
|
|
38
|
-
icon: e ?
|
|
36
|
+
icon: e ? B : _,
|
|
39
37
|
size: "lg",
|
|
40
|
-
onIconClick: () =>
|
|
38
|
+
onIconClick: () => u(l),
|
|
39
|
+
onLabelClick: t[0].onClick,
|
|
41
40
|
ariaLabel: e ? "chevron up icon" : "chevron down icon",
|
|
42
41
|
children: t[0].label
|
|
43
42
|
}
|
|
44
43
|
),
|
|
45
|
-
/* @__PURE__ */ n(
|
|
44
|
+
/* @__PURE__ */ n(v, { open: e, onClose: a, children: /* @__PURE__ */ n(b, { items: r }) })
|
|
46
45
|
] });
|
|
47
46
|
}
|
|
48
|
-
return /* @__PURE__ */ n("section", { className:
|
|
49
|
-
const { priority: i, id:
|
|
47
|
+
return /* @__PURE__ */ n("section", { className: m.action, children: t.map((r, o) => {
|
|
48
|
+
const { priority: i, id: I, ...d } = r;
|
|
50
49
|
return /* @__PURE__ */ n(h, { variant: i === "primary" ? "solid" : "outline", size: "lg", ...d, children: r.label }, "button-" + o);
|
|
51
50
|
}) });
|
|
52
51
|
};
|
|
53
52
|
export {
|
|
54
|
-
|
|
53
|
+
q as DialogActions
|
|
55
54
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
1
2
|
export type AvatarType = 'company' | 'person' | 'custom';
|
|
2
3
|
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
4
|
/**
|
|
@@ -24,4 +25,4 @@ export interface AvatarProps {
|
|
|
24
25
|
/**
|
|
25
26
|
* Avatar component to display user or company avatars with various customization options.
|
|
26
27
|
*/
|
|
27
|
-
export declare const Avatar: ({ type, size, name, outline, imageUrl, imageUrlAlt, customLabel, className, }: AvatarProps) =>
|
|
28
|
+
export declare const Avatar: ({ type, size, name, outline, imageUrl, imageUrlAlt, customLabel, className, }: AvatarProps) => ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const meta: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: ({ type, size, name, outline, imageUrl, imageUrlAlt, customLabel, className, }: import('./Avatar').AvatarProps) =>
|
|
3
|
+
component: ({ type, size, name, outline, imageUrl, imageUrlAlt, customLabel, className, }: import('./Avatar').AvatarProps) => import('react').ReactElement;
|
|
4
4
|
parameters: {};
|
|
5
5
|
args: {};
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ type, size, name, outline, imageUrl, imageUrlAlt, customLabel, className, }: import('./Avatar').AvatarProps) =>
|
|
4
|
+
component: ({ type, size, name, outline, imageUrl, imageUrlAlt, customLabel, className, }: import('./Avatar').AvatarProps) => import('react').ReactElement;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
@@ -9,4 +9,4 @@ export interface IconOrAvatarProps {
|
|
|
9
9
|
avatarGroup?: AvatarGroupProps;
|
|
10
10
|
badge?: BadgeProps | undefined;
|
|
11
11
|
}
|
|
12
|
-
export declare const IconOrAvatar: ({ size, icon, iconTheme, avatar, avatarGroup }: IconOrAvatarProps) => string | number | true | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
|
|
12
|
+
export declare const IconOrAvatar: ({ size, icon, iconTheme, avatar, avatarGroup }: IconOrAvatarProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
@@ -8,5 +8,5 @@ interface SkeletonProps {
|
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const Skeleton: ({ as, loading, size, variant, className, children, }: SkeletonProps) => string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
|
|
11
|
+
export declare const Skeleton: ({ as, loading, size, variant, className, children, }: SkeletonProps) => string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
12
12
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
export declare const useClickOutside: (ref: RefObject<HTMLDivElement>, callback?: () => void) => RefObject<HTMLDivElement>;
|
|
2
|
+
export declare const useClickOutside: (ref: RefObject<HTMLDivElement | null>, callback?: () => void) => RefObject<HTMLDivElement | null>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altinn/altinn-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@navikt/aksel-icons": "^7.9.2",
|
|
24
24
|
"classnames": "^2.5.1",
|
|
25
|
-
"react": "^
|
|
26
|
-
"react-dom": "^
|
|
25
|
+
"react": "^19.0.0",
|
|
26
|
+
"react-dom": "^19.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@biomejs/biome": "1.9.4",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@storybook/react-vite": "^8.6.4",
|
|
40
40
|
"@storybook/test": "^8.6.4",
|
|
41
41
|
"@storybook/test-runner": "^0.22.0",
|
|
42
|
-
"@types/react": "^
|
|
42
|
+
"@types/react": "^19.0.10",
|
|
43
43
|
"@types/react-dom": "^18.3.5",
|
|
44
44
|
"@vitejs/plugin-react-swc": "^3.7.2",
|
|
45
45
|
"axe-core": "^4.10.2",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"vite-plugin-static-copy": "^2.2.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"react": ">=18.3.1",
|
|
62
|
-
"react-dom": ">=18.3.1"
|
|
61
|
+
"react": ">=18.3.1 || ^19.0.0",
|
|
62
|
+
"react-dom": ">=18.3.1 || ^19.0.0"
|
|
63
63
|
},
|
|
64
64
|
"lint-staged": {
|
|
65
65
|
"**/*.*": "biome check --staged --no-errors-on-unmatched --write"
|