@altinn/altinn-components 0.56.16 → 0.56.18

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.
Files changed (27) hide show
  1. package/dist/assets/PageMenu.css +1 -1
  2. package/dist/components/Bookmarks/BookmarkModal.js +41 -0
  3. package/dist/components/Bookmarks/BookmarkSettingsItem.js +35 -0
  4. package/dist/components/{Settings/BookmarksSettingsItemLabel.js → Bookmarks/BookmarkSettingsItemLabel.js} +1 -1
  5. package/dist/components/Bookmarks/BookmarkSettingsList.js +18 -0
  6. package/dist/components/Bookmarks/index.js +8 -0
  7. package/dist/components/LayoutAction/LayoutAction.js +18 -18
  8. package/dist/components/Page/PageMenu.js +14 -9
  9. package/dist/components/Settings/index.js +8 -12
  10. package/dist/components/index.js +451 -449
  11. package/dist/index.js +463 -461
  12. package/dist/types/lib/components/Bookmarks/BookmarkModal.d.ts +18 -0
  13. package/dist/types/lib/components/Bookmarks/BookmarkModal.stories.d.ts +5 -0
  14. package/dist/types/lib/components/Bookmarks/BookmarkSettingsItem.d.ts +22 -0
  15. package/dist/types/lib/components/{Settings/BookmarksSettingsItemLabel.d.ts → Bookmarks/BookmarkSettingsItemLabel.d.ts} +2 -2
  16. package/dist/types/lib/components/Bookmarks/BookmarkSettingsList.d.ts +6 -0
  17. package/dist/types/lib/components/Bookmarks/BookmarkSettingsList.stories.d.ts +19 -0
  18. package/dist/types/lib/components/Bookmarks/index.d.ts +3 -0
  19. package/dist/types/lib/components/Page/PageMenu.d.ts +11 -7
  20. package/dist/types/lib/components/Page/PageMenu.stories.d.ts +0 -1
  21. package/dist/types/lib/components/Settings/index.d.ts +0 -2
  22. package/dist/types/lib/components/index.d.ts +1 -0
  23. package/package.json +1 -1
  24. package/dist/components/Settings/BookmarksSettingsItem.js +0 -90
  25. package/dist/components/Settings/BookmarksSettingsList.js +0 -46
  26. package/dist/types/lib/components/Settings/BookmarksSettingsItem.d.ts +0 -32
  27. package/dist/types/lib/components/Settings/BookmarksSettingsList.d.ts +0 -12
@@ -0,0 +1,18 @@
1
+ import { QueryItemProps, SettingsModalProps, TextFieldProps } from '..';
2
+ export interface BookmarkModalProps {
3
+ /** Icon */
4
+ icon?: SettingsModalProps['icon'];
5
+ /** Optional title */
6
+ title?: string;
7
+ /** Query params */
8
+ params?: QueryItemProps[];
9
+ /** Title field */
10
+ titleField?: TextFieldProps;
11
+ /** Buttons */
12
+ buttons?: SettingsModalProps['buttons'];
13
+ /** Buttons */
14
+ onClose: SettingsModalProps['onClose'];
15
+ /** Buttons */
16
+ open: SettingsModalProps['open'];
17
+ }
18
+ export declare const BookmarkModal: ({ icon, title, params, titleField, buttons, open, onClose, }: BookmarkModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Meta } from '@storybook/react-vite';
2
+ import { BookmarkModal, BookmarkModalProps } from '..';
3
+ declare const meta: Meta<typeof BookmarkModal>;
4
+ export default meta;
5
+ export declare const Default: (args: BookmarkModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { ContextMenuProps, QueryItemProps, SettingsItemProps } from '..';
2
+ export interface BookmarkSettingsItemProps {
3
+ /** Bookmark id */
4
+ id: string;
5
+ /** Icon */
6
+ icon?: SettingsItemProps['icon'];
7
+ /** Loading */
8
+ loading?: boolean;
9
+ /** Optional title */
10
+ title?: string;
11
+ /** Icon */
12
+ highlightWords?: SettingsItemProps['highlightWords'];
13
+ /** Optional title */
14
+ untitled?: string;
15
+ /** Query params */
16
+ params?: QueryItemProps[];
17
+ /** Context menu */
18
+ contextMenu?: ContextMenuProps;
19
+ /** Render as **/
20
+ as?: React.ElementType;
21
+ }
22
+ export declare const BookmarkSettingsItem: ({ id, icon, loading, title, highlightWords, params, contextMenu, ...rest }: BookmarkSettingsItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { QueryItemProps } from '..';
2
- export interface BookmarksSettingsItemLabelProps {
2
+ export interface BookmarkSettingsItemLabelProps {
3
3
  /** Optional title */
4
4
  title?: string;
5
5
  /** Query params */
@@ -9,4 +9,4 @@ export interface BookmarksSettingsItemLabelProps {
9
9
  /** Highlight words */
10
10
  highlightWords?: string[];
11
11
  }
12
- export declare const BookmarksSettingsItemLabel: ({ loading, title, params, highlightWords, }: BookmarksSettingsItemLabelProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const BookmarkSettingsItemLabel: ({ loading, title, params, highlightWords, }: BookmarkSettingsItemLabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { BookmarkSettingsItemProps } from '..';
2
+ export interface BookmarkSettingsListProps {
3
+ items: BookmarkSettingsItemProps[];
4
+ loading?: boolean;
5
+ }
6
+ export declare const BookmarkSettingsList: ({ loading, items }: BookmarkSettingsListProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,19 @@
1
+ import { BookmarkSettingsListProps } from '..';
2
+ declare const meta: {
3
+ component: ({ loading, items }: BookmarkSettingsListProps) => import("react/jsx-runtime").JSX.Element | null;
4
+ title: string;
5
+ tags: string[];
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react-vite').ReactRenderer, {
10
+ items: import('./BookmarkSettingsItem').BookmarkSettingsItemProps[];
11
+ loading?: boolean | undefined;
12
+ }>, { args }: {
13
+ args: BookmarkSettingsListProps;
14
+ }) => import("react/jsx-runtime").JSX.Element)[];
15
+ args: {};
16
+ };
17
+ export default meta;
18
+ export declare const BookmarksList: () => import("react/jsx-runtime").JSX.Element;
19
+ export declare const BookmarksPage: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './BookmarkSettingsItem';
2
+ export * from './BookmarkSettingsList';
3
+ export * from './BookmarkModal';
@@ -1,9 +1,13 @@
1
- import { MenuItemColor, MenuItemProps } from '..';
2
- export type PageMenuTheme = 'default' | 'subtle' | 'base';
1
+ import { ButtonProps, SvgElement } from '..';
2
+ export interface PageMenuButtonProps extends ButtonProps {
3
+ id: string;
4
+ title: string;
5
+ icon?: SvgElement;
6
+ }
3
7
  export interface PageMenuProps {
4
- id?: string;
5
- theme?: PageMenuTheme;
6
- color?: MenuItemColor;
7
- items?: MenuItemProps[];
8
+ items?: PageMenuButtonProps[];
8
9
  }
9
- export declare const PageMenu: ({ theme, color, items }: PageMenuProps) => import("react/jsx-runtime").JSX.Element;
10
+ /**
11
+ * Page menu
12
+ */
13
+ export declare const PageMenu: ({ items }: PageMenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,4 +4,3 @@ declare const meta: Meta<typeof PageMenu>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
- export declare const BulkActionbar: Story;
@@ -5,5 +5,3 @@ export * from './SettingsSection';
5
5
  export * from './SettingsModal';
6
6
  export * from './UsedByLog';
7
7
  export * from './UsedByLogItem';
8
- export * from './BookmarksSettingsItem';
9
- export * from './BookmarksSettingsList';
@@ -5,6 +5,7 @@ export * from './Account';
5
5
  export * from './Alert';
6
6
  export * from './Badge';
7
7
  export * from './Banner';
8
+ export * from './Bookmarks';
8
9
  export * from './Breadcrumbs';
9
10
  export * from './Button';
10
11
  export * from './Byline';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.56.16",
3
+ "version": "0.56.18",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",
@@ -1,90 +0,0 @@
1
- import { jsx as r, jsxs as g } from "react/jsx-runtime";
2
- import "../../index-p1eeF8LQ.js";
3
- import { useState as y } from "react";
4
- import { Button as d } from "../Button/Button.js";
5
- import { ButtonGroup as h } from "../Button/ButtonGroup.js";
6
- import { ContextMenu as C } from "../ContextMenu/ContextMenu.js";
7
- import "react-dom";
8
- import "../RootProvider/RootProvider.js";
9
- import { QueryLabel as G } from "../Searchbar/QueryLabel.js";
10
- import { TextField as j } from "../Forms/TextField.js";
11
- import "../Snackbar/useSnackbar.js";
12
- import { SettingsItemBase as z } from "./SettingsItemBase.js";
13
- import { SettingsModal as L } from "./SettingsModal.js";
14
- import { BookmarksSettingsItemLabel as M } from "./BookmarksSettingsItemLabel.js";
15
- import { S as Q } from "../../MagnifyingGlass-bwVhw07z.js";
16
- const X = ({
17
- id: S,
18
- icon: m = Q,
19
- loading: l,
20
- title: n,
21
- untitled: T,
22
- highlightWords: u,
23
- params: a,
24
- controls: V,
25
- inputValue: s,
26
- titleField: f,
27
- saveButton: o,
28
- removeButton: i,
29
- contextMenu: p,
30
- onChange: c,
31
- open: k = !1,
32
- onClose: e,
33
- ...b
34
- }) => {
35
- const [x, I] = y("");
36
- return /* @__PURE__ */ r(
37
- z,
38
- {
39
- ...b,
40
- id: S,
41
- expanded: k,
42
- icon: m,
43
- loading: l,
44
- label: /* @__PURE__ */ r(M, { highlightWords: u, loading: l, params: a, title: n }),
45
- controls: p && /* @__PURE__ */ r(C, { ...p }),
46
- linkIcon: !0,
47
- children: /* @__PURE__ */ g(L, { icon: m, title: n, open: k, onClose: e, children: [
48
- /* @__PURE__ */ r(G, { params: a }),
49
- /* @__PURE__ */ r(
50
- j,
51
- {
52
- ...f,
53
- label: f?.label || "Gi søket et navn",
54
- size: "sm",
55
- name: "title",
56
- value: typeof s == "string" ? s : x,
57
- onChange: (t) => {
58
- typeof c == "function" ? c(t) : I(t.target.value);
59
- }
60
- }
61
- ),
62
- (o || i) && /* @__PURE__ */ g(h, { size: "md", children: [
63
- o && /* @__PURE__ */ r(
64
- d,
65
- {
66
- ...o,
67
- onClick: (t) => {
68
- o.onClick?.(t), e();
69
- }
70
- }
71
- ),
72
- i && /* @__PURE__ */ r(
73
- d,
74
- {
75
- ...i,
76
- variant: "outline",
77
- color: "danger",
78
- onClick: (t) => {
79
- i.onClick?.(t), e();
80
- }
81
- }
82
- )
83
- ] })
84
- ] })
85
- }
86
- );
87
- };
88
- export {
89
- X as BookmarksSettingsItem
90
- };
@@ -1,46 +0,0 @@
1
- import { jsxs as i, Fragment as s, jsx as o } from "react/jsx-runtime";
2
- import { Fragment as c, createElement as g } from "react";
3
- import "../../index-p1eeF8LQ.js";
4
- import { Typography as h } from "../Typography/Typography.js";
5
- import { Heading as f } from "../Typography/Heading.js";
6
- import "../Button/Button.js";
7
- import "react-dom";
8
- import "../RootProvider/RootProvider.js";
9
- import { Divider as k } from "../Divider/Divider.js";
10
- import { List as x } from "../List/List.js";
11
- import "../Snackbar/useSnackbar.js";
12
- import { Flex as F } from "../Page/Flex.js";
13
- import { SettingsSection as S } from "./SettingsSection.js";
14
- import { BookmarksSettingsItem as u } from "./BookmarksSettingsItem.js";
15
- const q = ({
16
- loading: e,
17
- title: n,
18
- description: m,
19
- items: t,
20
- untitled: l = "Untitled bookmark",
21
- expandedId: p,
22
- onToggle: d
23
- }) => /* @__PURE__ */ i(s, { children: [
24
- /* @__PURE__ */ o(f, { size: "lg", children: n }),
25
- t.length > 0 && /* @__PURE__ */ i(F, { direction: "col", spacing: 4, children: [
26
- /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(x, { size: "sm", children: t.map((r, a) => /* @__PURE__ */ i(c, { children: [
27
- a > 0 && /* @__PURE__ */ o(k, {}),
28
- /* @__PURE__ */ g(
29
- u,
30
- {
31
- ...r,
32
- key: r.id,
33
- title: r?.title,
34
- untitled: l,
35
- loading: e || r.loading,
36
- onToggle: () => d?.(r.id),
37
- expanded: p === r.id
38
- }
39
- )
40
- ] }, r.id)) }) }),
41
- /* @__PURE__ */ o(h, { color: "neutral", variant: "subtle", size: "xs", children: /* @__PURE__ */ o("p", { children: m }) })
42
- ] })
43
- ] });
44
- export {
45
- q as BookmarksSettingsList
46
- };
@@ -1,32 +0,0 @@
1
- import { ButtonProps, ContextMenuProps, QueryItemProps, SettingsItemProps, TextFieldProps } from '..';
2
- export interface BookmarksSettingsItemProps extends SettingsItemProps {
3
- /** Bookmark id */
4
- id: string;
5
- /** On close */
6
- onClose: () => void;
7
- /** Loading */
8
- loading?: boolean;
9
- /** Optional title */
10
- title?: string;
11
- /** Optional title */
12
- untitled?: string;
13
- /** Query params */
14
- params?: QueryItemProps[];
15
- /** Input value */
16
- inputValue?: string;
17
- /** Title field */
18
- titleField?: TextFieldProps;
19
- /** Save button */
20
- saveButton?: ButtonProps;
21
- /** Delete button */
22
- removeButton?: ButtonProps;
23
- /** Context menu */
24
- contextMenu?: ContextMenuProps;
25
- /** Render as **/
26
- as?: React.ElementType;
27
- /** Toggle function */
28
- onToggle?: () => void;
29
- /** Open */
30
- open?: boolean;
31
- }
32
- export declare const BookmarksSettingsItem: ({ id, icon, loading, title, untitled, highlightWords, params, controls, inputValue, titleField, saveButton, removeButton, contextMenu, onChange, open, onClose, ...rest }: BookmarksSettingsItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +0,0 @@
1
- import { BookmarksSettingsItemProps, TextFieldProps } from '../';
2
- export interface BookmarksSettingsListProps {
3
- title?: string;
4
- description?: string;
5
- items: BookmarksSettingsItemProps[];
6
- untitled?: string;
7
- expandedId?: string;
8
- onToggle?: (id: string) => void;
9
- loading?: boolean;
10
- titleField?: TextFieldProps;
11
- }
12
- export declare const BookmarksSettingsList: ({ loading, title, description, items, untitled, expandedId, onToggle, }: BookmarksSettingsListProps) => import("react/jsx-runtime").JSX.Element;