@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.
@@ -1,21 +1,23 @@
1
1
  "use client";
2
- import { jsxs as a, jsx as n } from "react/jsx-runtime";
3
- import { useState as d, useMemo as u } from "react";
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 f } from "../Button/Button.js";
6
- import { ComboButton as h } from "../Button/ComboButton.js";
7
- import "../RootProvider/RootProvider.js";
8
- import { DropdownBase as y } from "../Dropdown/DropdownBase.js";
9
- import { Menu as g } from "../Menu/Menu.js";
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 v } from "../../ChevronUp-H8Nuww4h.js";
13
- import { S as B } from "../../ChevronDown-CRAwzuD3.js";
14
- import '../../assets/DialogActions.css';const _ = "_action_m3crc_1", b = "_comboButton_m3crc_7", l = {
15
- action: _,
16
- comboButton: b
17
- }, E = ({ items: c, maxItems: s = 2 }) => {
18
- const [e, m] = d(!1), t = u(() => (c || []).sort((r, o) => {
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__ */ a("section", { className: l.comboButton, children: [
33
+ return /* @__PURE__ */ g("section", { className: p.comboButton, children: [
32
34
  /* @__PURE__ */ n(
33
- h,
35
+ y,
34
36
  {
35
37
  variant: "solid",
36
- icon: e ? v : B,
38
+ icon: e ? _ : b,
37
39
  size: "lg",
38
- onIconClick: () => m((o) => !o),
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(y, { open: e, children: /* @__PURE__ */ n(g, { items: r }) })
45
+ /* @__PURE__ */ n(C, { open: e, onClose: m, children: /* @__PURE__ */ n(B, { items: r }) })
44
46
  ] });
45
47
  }
46
- return /* @__PURE__ */ n("section", { className: l.action, children: t.map((r, o) => {
47
- const { priority: i, id: x, ...p } = r;
48
- return /* @__PURE__ */ n(f, { variant: i === "primary" ? "solid" : "outline", size: "lg", ...p, children: r.label }, "button-" + o);
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
- E as DialogActions
54
+ U as DialogActions
53
55
  };
@@ -1,26 +1,28 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { c as i } from "../../index-L8X2o7IH.js";
3
- import '../../assets/BreadcrumbsLink.css';const l = "_link_afpoj_1", m = {
4
- link: l
5
- }, d = ({
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
- }) => /* @__PURE__ */ c(
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: i(m.link, s),
21
+ className: l(p.link, s),
22
+ ...c,
21
23
  children: a || t
22
24
  }
23
25
  );
24
26
  export {
25
- d as BreadcrumbsLink
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.4",
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.4",
31
- "@storybook/addon-a11y": "^8.5.0",
32
- "@storybook/addon-essentials": "^8.5.0",
33
- "@storybook/addon-interactions": "^8.5.0",
34
- "@storybook/addon-links": "^8.5.0",
35
- "@storybook/addon-mdx-gfm": "^8.5.0",
36
- "@storybook/addon-themes": "^8.5.0",
37
- "@storybook/blocks": "^8.5.0",
38
- "@storybook/react": "^8.5.0",
39
- "@storybook/react-vite": "^8.5.0",
40
- "@storybook/test": "^8.5.0",
41
- "@storybook/test-runner": "^0.21.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.5.0",
51
+ "storybook": "^8.6.4",
52
52
  "storybook-addon-tag-badges": "^1.4.0",
53
- "storybook-addon-theme-provider": "^0.2.8",
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",