@altinn/altinn-components 0.19.4 → 0.19.6
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 +25 -23
- package/dist/components/Page/BreadcrumbsLink.js +11 -9
- package/dist/types/lib/components/Dialog/DialogActions.d.ts +3 -1
- package/dist/types/lib/components/Dialog/DialogActions.stories.d.ts +1 -1
- package/dist/types/lib/components/Page/BreadcrumbsLink.d.ts +1 -1
- package/package.json +15 -15
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import {
|
|
2
|
+
import { jsxs as g, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as f } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
|
-
import { Button as
|
|
6
|
-
import { ComboButton as
|
|
7
|
-
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { DropdownBase as
|
|
9
|
-
import { Menu as
|
|
5
|
+
import { Button as h } from "../Button/Button.js";
|
|
6
|
+
import { ComboButton as y } from "../Button/ComboButton.js";
|
|
7
|
+
import { useRootContext as v } from "../RootProvider/RootProvider.js";
|
|
8
|
+
import { DropdownBase as C } 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
|
|
15
|
-
action:
|
|
16
|
-
comboButton:
|
|
17
|
-
},
|
|
18
|
-
const
|
|
12
|
+
import { S as _ } from "../../ChevronUp-H8Nuww4h.js";
|
|
13
|
+
import { S as b } from "../../ChevronDown-CRAwzuD3.js";
|
|
14
|
+
import '../../assets/DialogActions.css';const x = "_action_m3crc_1", I = "_comboButton_m3crc_7", p = {
|
|
15
|
+
action: x,
|
|
16
|
+
comboButton: I
|
|
17
|
+
}, U = ({ items: c, maxItems: s = 2, id: l = "dialog-actions" }) => {
|
|
18
|
+
const { currentId: a, toggleId: u } = v(), e = a === l, m = () => {
|
|
19
|
+
u(l);
|
|
20
|
+
}, t = f(() => (c || []).sort((r, o) => {
|
|
19
21
|
const i = ["primary", "secondary", "tertiary"];
|
|
20
22
|
return i.indexOf(r == null ? void 0 : r.priority) - i.indexOf(o == null ? void 0 : o.priority);
|
|
21
23
|
}), [c]);
|
|
@@ -28,26 +30,26 @@ import '../../assets/DialogActions.css';const _ = "_action_m3crc_1", b = "_combo
|
|
|
28
30
|
onClick: o.onClick,
|
|
29
31
|
group: o.priority
|
|
30
32
|
}));
|
|
31
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ g("section", { className: p.comboButton, children: [
|
|
32
34
|
/* @__PURE__ */ n(
|
|
33
|
-
|
|
35
|
+
y,
|
|
34
36
|
{
|
|
35
37
|
variant: "solid",
|
|
36
|
-
icon: e ?
|
|
38
|
+
icon: e ? _ : b,
|
|
37
39
|
size: "lg",
|
|
38
|
-
onIconClick: () => m(
|
|
40
|
+
onIconClick: () => m(),
|
|
39
41
|
ariaLabel: e ? "chevron up icon" : "chevron down icon",
|
|
40
42
|
children: t[0].label
|
|
41
43
|
}
|
|
42
44
|
),
|
|
43
|
-
/* @__PURE__ */ n(
|
|
45
|
+
/* @__PURE__ */ n(C, { open: e, onClose: m, children: /* @__PURE__ */ n(B, { items: r }) })
|
|
44
46
|
] });
|
|
45
47
|
}
|
|
46
|
-
return /* @__PURE__ */ n("section", { className:
|
|
47
|
-
const { priority: i, id:
|
|
48
|
-
return /* @__PURE__ */ n(
|
|
48
|
+
return /* @__PURE__ */ n("section", { className: p.action, children: t.map((r, o) => {
|
|
49
|
+
const { priority: i, id: S, ...d } = r;
|
|
50
|
+
return /* @__PURE__ */ n(h, { variant: i === "primary" ? "solid" : "outline", size: "lg", ...d, children: r.label }, "button-" + o);
|
|
49
51
|
}) });
|
|
50
52
|
};
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
U as DialogActions
|
|
53
55
|
};
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/BreadcrumbsLink.css';const
|
|
4
|
-
link:
|
|
5
|
-
},
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/BreadcrumbsLink.css';const m = "_link_afpoj_1", p = {
|
|
4
|
+
link: m
|
|
5
|
+
}, x = ({
|
|
6
6
|
as: o,
|
|
7
7
|
className: s,
|
|
8
8
|
disabled: n = !1,
|
|
9
9
|
selected: e,
|
|
10
10
|
tabIndex: r = 0,
|
|
11
11
|
label: t,
|
|
12
|
-
children: a
|
|
13
|
-
|
|
12
|
+
children: a,
|
|
13
|
+
...c
|
|
14
|
+
}) => /* @__PURE__ */ i(
|
|
14
15
|
o || "a",
|
|
15
16
|
{
|
|
16
17
|
tabIndex: r,
|
|
17
18
|
"aria-selected": e,
|
|
18
19
|
"aria-disabled": n,
|
|
19
20
|
disabled: n,
|
|
20
|
-
className:
|
|
21
|
+
className: l(p.link, s),
|
|
22
|
+
...c,
|
|
21
23
|
children: a || t
|
|
22
24
|
}
|
|
23
25
|
);
|
|
24
26
|
export {
|
|
25
|
-
|
|
27
|
+
x as BreadcrumbsLink
|
|
26
28
|
};
|
|
@@ -10,5 +10,7 @@ export interface DialogActionsProps {
|
|
|
10
10
|
items: DialogActionButtonProps[];
|
|
11
11
|
/** How many actions to display before turning into a ComboButton */
|
|
12
12
|
maxItems?: number;
|
|
13
|
+
/** Unique id for the dialog if multiple DialogAction are needed */
|
|
14
|
+
id?: string;
|
|
13
15
|
}
|
|
14
|
-
export declare const DialogActions: ({ items, maxItems }: DialogActionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export declare const DialogActions: ({ items, maxItems, id }: DialogActionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ items, maxItems }: import('./DialogActions').DialogActionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
component: ({ items, maxItems, id }: import('./DialogActions').DialogActionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
tags: string[];
|
|
6
6
|
args: {
|
|
7
7
|
items: ({
|
|
@@ -8,4 +8,4 @@ export interface BreadcrumbsLinkProps extends React.HTMLAttributes<HTMLButtonEle
|
|
|
8
8
|
className?: string;
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
}
|
|
11
|
-
export declare const BreadcrumbsLink: ({ as, className, disabled, selected, tabIndex, label, children, }: BreadcrumbsLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const BreadcrumbsLink: ({ as, className, disabled, selected, tabIndex, label, children, ...rest }: BreadcrumbsLinkProps) => 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.19.
|
|
3
|
+
"version": "0.19.6",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@biomejs/biome": "1.9.4",
|
|
30
|
-
"@chromatic-com/storybook": "^3.2.
|
|
31
|
-
"@storybook/addon-a11y": "^8.
|
|
32
|
-
"@storybook/addon-essentials": "^8.
|
|
33
|
-
"@storybook/addon-interactions": "^8.
|
|
34
|
-
"@storybook/addon-links": "^8.
|
|
35
|
-
"@storybook/addon-mdx-gfm": "^8.
|
|
36
|
-
"@storybook/addon-themes": "^8.
|
|
37
|
-
"@storybook/blocks": "^8.
|
|
38
|
-
"@storybook/react": "^8.
|
|
39
|
-
"@storybook/react-vite": "^8.
|
|
40
|
-
"@storybook/test": "^8.
|
|
41
|
-
"@storybook/test-runner": "^0.
|
|
30
|
+
"@chromatic-com/storybook": "^3.2.5",
|
|
31
|
+
"@storybook/addon-a11y": "^8.6.4",
|
|
32
|
+
"@storybook/addon-essentials": "^8.6.4",
|
|
33
|
+
"@storybook/addon-interactions": "^8.6.4",
|
|
34
|
+
"@storybook/addon-links": "^8.6.4",
|
|
35
|
+
"@storybook/addon-mdx-gfm": "^8.6.4",
|
|
36
|
+
"@storybook/addon-themes": "^8.6.4",
|
|
37
|
+
"@storybook/blocks": "^8.6.4",
|
|
38
|
+
"@storybook/react": "^8.6.4",
|
|
39
|
+
"@storybook/react-vite": "^8.6.4",
|
|
40
|
+
"@storybook/test": "^8.6.4",
|
|
41
|
+
"@storybook/test-runner": "^0.22.0",
|
|
42
42
|
"@types/react": "^18.3.18",
|
|
43
43
|
"@types/react-dom": "^18.3.5",
|
|
44
44
|
"@vitejs/plugin-react-swc": "^3.7.2",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"lint-staged": "^15.4.1",
|
|
49
49
|
"playwright": "^1.50.1",
|
|
50
50
|
"rollup-preserve-directives": "^1.1.3",
|
|
51
|
-
"storybook": "^8.
|
|
51
|
+
"storybook": "^8.6.4",
|
|
52
52
|
"storybook-addon-tag-badges": "^1.4.0",
|
|
53
|
-
"storybook-addon-theme-provider": "^0.2.
|
|
53
|
+
"storybook-addon-theme-provider": "^0.2.9",
|
|
54
54
|
"typescript": "^5.7.3",
|
|
55
55
|
"vite": "^5.4.14",
|
|
56
56
|
"vite-plugin-dts": "^4.5.0",
|