@altinn/altinn-components 0.6.12 → 0.7.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.
Files changed (87) hide show
  1. package/dist/assets/AutocompleteBase.css +1 -1
  2. package/dist/assets/AutocompleteGroup.css +1 -1
  3. package/dist/assets/DialogBorder.css +1 -1
  4. package/dist/assets/DialogHeaderBase.css +1 -1
  5. package/dist/assets/DialogHeadings.css +1 -1
  6. package/dist/assets/DialogListItem.css +1 -1
  7. package/dist/assets/DialogTitle.css +1 -1
  8. package/dist/assets/ListItemAction.css +1 -1
  9. package/dist/assets/ListItemBase.css +1 -1
  10. package/dist/assets/ListItemFooter.css +1 -0
  11. package/dist/assets/ListItemHeader.css +1 -0
  12. package/dist/assets/ListItemLabel.css +1 -1
  13. package/dist/assets/ListItemMedia.css +1 -1
  14. package/dist/assets/MetaItemBase.css +1 -0
  15. package/dist/assets/MetaItemLabel.css +1 -0
  16. package/dist/assets/MetaItemMedia.css +1 -0
  17. package/dist/components/Bookmarks/BookmarksList.d.ts +1 -1
  18. package/dist/components/Bookmarks/BookmarksListItem.d.ts +2 -13
  19. package/dist/components/Bookmarks/BookmarksListItem.js +5 -10
  20. package/dist/components/Button/Button.js +2 -2
  21. package/dist/components/Button/Buttons.stories.js +2 -2
  22. package/dist/components/Dialog/Dialog.stories.js +30 -20
  23. package/dist/components/Dialog/DialogBase.d.ts +2 -0
  24. package/dist/components/Dialog/DialogBorder.d.ts +1 -1
  25. package/dist/components/Dialog/DialogBorder.js +5 -5
  26. package/dist/components/Dialog/DialogContent.stories.js +1 -1
  27. package/dist/components/Dialog/DialogGroup.js +5 -5
  28. package/dist/components/Dialog/DialogHeader.d.ts +1 -1
  29. package/dist/components/Dialog/DialogHeader.js +6 -6
  30. package/dist/components/Dialog/DialogHeaderBase.d.ts +3 -1
  31. package/dist/components/Dialog/DialogHeaderBase.js +3 -3
  32. package/dist/components/Dialog/DialogHeadings.d.ts +2 -3
  33. package/dist/components/Dialog/DialogHeadings.js +24 -26
  34. package/dist/components/Dialog/DialogLabel.d.ts +13 -0
  35. package/dist/components/Dialog/DialogLabel.js +17 -0
  36. package/dist/components/Dialog/DialogListItem.d.ts +17 -5
  37. package/dist/components/Dialog/DialogListItem.js +86 -70
  38. package/dist/components/Dialog/DialogListItem.stories.js +117 -68
  39. package/dist/components/Dialog/DialogMetadata.d.ts +9 -1
  40. package/dist/components/Dialog/DialogMetadata.js +25 -21
  41. package/dist/components/Dialog/DialogNav.js +16 -16
  42. package/dist/components/Dialog/DialogTitle.d.ts +7 -9
  43. package/dist/components/Dialog/DialogTitle.js +9 -10
  44. package/dist/components/Dialog/Examples.stories.js +31 -0
  45. package/dist/components/Dialog/index.d.ts +1 -1
  46. package/dist/components/Dialog/index.js +41 -41
  47. package/dist/components/List/List.js +2 -3
  48. package/dist/components/List/ListItem.d.ts +5 -25
  49. package/dist/components/List/ListItem.js +46 -21
  50. package/dist/components/List/ListItem.stories.js +52 -42
  51. package/dist/components/List/ListItemAction.d.ts +2 -7
  52. package/dist/components/List/ListItemAction.js +6 -17
  53. package/dist/components/List/ListItemBase.d.ts +5 -10
  54. package/dist/components/List/ListItemBase.js +52 -48
  55. package/dist/components/List/ListItemFooter.d.ts +11 -0
  56. package/dist/components/List/ListItemFooter.js +17 -0
  57. package/dist/components/List/ListItemHeader.d.ts +8 -0
  58. package/dist/components/List/ListItemHeader.js +8 -0
  59. package/dist/components/List/ListItemLabel.js +7 -7
  60. package/dist/components/List/ListItemMedia.js +7 -7
  61. package/dist/components/List/index.d.ts +4 -3
  62. package/dist/components/List/index.js +14 -12
  63. package/dist/components/Meta/MetaItemBase.d.ts +1 -1
  64. package/dist/components/Meta/MetaItemBase.js +21 -20
  65. package/dist/components/Meta/MetaItemLabel.js +5 -4
  66. package/dist/components/Meta/MetaItemMedia.js +9 -8
  67. package/dist/components/Page/PageNav.js +7 -7
  68. package/dist/components/Searchbar/Autocomplete.stories.js +241 -13
  69. package/dist/components/Searchbar/AutocompleteBase.js +5 -5
  70. package/dist/components/Searchbar/AutocompleteGroup.js +9 -12
  71. package/dist/components/Searchbar/AutocompleteItem.d.ts +23 -11
  72. package/dist/components/Searchbar/AutocompleteItem.js +21 -8
  73. package/dist/components/Searchbar/ScopeListItem.d.ts +12 -0
  74. package/dist/components/Searchbar/ScopeListItem.js +11 -0
  75. package/dist/components/Toolbar/ToolbarButton.js +2 -1
  76. package/dist/components/index.js +153 -151
  77. package/dist/hooks/useMenu.js +19 -19
  78. package/dist/index.js +155 -153
  79. package/package.json +1 -1
  80. package/dist/assets/DialogListItemBase.css +0 -1
  81. package/dist/assets/metaItem.css +0 -1
  82. package/dist/components/Dialog/DialogListItemBase.d.ts +0 -28
  83. package/dist/components/Dialog/DialogListItemBase.js +0 -24
  84. package/dist/components/Dialog/DialogTitle.stories.js +0 -26
  85. package/dist/components/List/ListItemAction.stories.js +0 -45
  86. package/dist/metaItem.module-CfNiX769.js +0 -8
  87. /package/dist/assets/{AutocompleteItem.css → ScopeListItem.css} +0 -0
@@ -1 +1 @@
1
- ._autocomplete_1ccsg_1{width:100%;border:2px solid;border-radius:.25rem;background-color:var(--theme-background-default)}._autocomplete_1ccsg_1 ul{list-style:none;padding:0;margin:0}._autocomplete_1ccsg_1 li{padding:0;margin:.5rem 0}
1
+ ._autocomplete_1yzw8_1{width:100%;border:2px solid;border-radius:.25rem;background-color:var(--theme-background-default)}._autocomplete_1yzw8_1 ul{list-style:none;padding:0;margin:0}._autocomplete_1yzw8_1 li{padding:0;margin:0}
@@ -1 +1 @@
1
- ._group_da4mp_1+._group_da4mp_1{border-top:1px solid var(--theme-border-subtle)}
1
+ ._group_l096y_1{padding:.5rem 0}._group_l096y_1+._group_l096y_1{border-top:1px solid var(--theme-border-subtle)}._header_l096y_9{padding:.75rem}._title_l096y_13{font-size:.875rem;font-weight:400;line-height:1.25rem;color:var(--theme-text-subtle);margin:0}
@@ -1 +1 @@
1
- ._border_1yyjs_1{border-left:.25rem solid;border-color:var(--theme-surface-active)}._border_1yyjs_1[data-seen=true]{border-color:var(--neutral-surface-default)}
1
+ ._border_tdijc_1{border-left:.25rem solid;border-color:var(--theme-surface-active);display:flex;flex-direction:column}._border_tdijc_1[data-seen=true]{border-color:var(--neutral-surface-default)}
@@ -1 +1 @@
1
- ._header_e6sit_1{display:flex;flex-direction:column;row-gap:1.5em;margin-bottom:1.5rem}
1
+ ._header_45ink_1{display:flex;flex-direction:column}._header_45ink_1[data-size=xl]{row-gap:1.5em;margin-bottom:1.5rem}._header_45ink_1[data-size=md],._header_45ink_1[data-size=lg]{row-gap:.5rem}
@@ -1 +1 @@
1
- ._headings_1dhfw_1{display:flex;column-gap:.5em;align-items:center;font-size:16px}._headings_1dhfw_1[data-size=xs],._headings_1dhfw_1[data-size=sm]{font-size:14px}._text_1dhfw_16{display:inline-flex;color:var(--neutral-text-subtle)}._sender_1dhfw_21{font-weight:500;color:var(--neutral-text-default)}
1
+ ._headings_fci15_1{display:flex;column-gap:.5em;align-items:center}._headings_fci15_1[data-size=xs],._headings_fci15_1[data-size=sm]{font-size:12px}._headings_fci15_1[data-size=md],._headings_fci15_1[data-size=lg]{font-size:14px}._headings_fci15_1[data-size=xl]{font-size:16px}._text_fci15_21{display:inline;color:var(--neutral-text-subtle)}._sender_fci15_26{font-weight:500;color:var(--neutral-text-default)}._recipient_fci15_31{white-space:nowrap}
@@ -1 +1 @@
1
- ._border_6r71i_1{width:100%;display:flex;flex-direction:column;text-decoration:none;row-gap:1rem;padding-left:1rem}._header_6r71i_10{display:flex;flex-direction:column;row-gap:.25rem}._summary_6r71i_16{font-size:1rem;line-height:1.35;margin:0;font-weight:400;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;color:var(--neutral-text-subtle)}._footer_6r71i_30{width:100%}._touchedBy_6r71i_34{position:absolute;right:0;bottom:0;margin:8px}._border_6r71i_1[data-size=md]{padding-left:.75rem;row-gap:.5rem}._summary_6r71i_16[data-size=md]{font-size:1rem}._link_6r71i_58[data-size=xs],._link_6r71i_58[data-size=sm]{padding:.5rem .75rem}._summary_6r71i_16[data-size=xs],._summary_6r71i_16[data-size=sm]{font-size:.875rem}._header_6r71i_10[data-size=xs],._header_6r71i_10[data-size=sm]{row-gap:0}._footer_6r71i_30[data-size=xs]{display:none}._border_6r71i_1[data-size=xs],._border_6r71i_1[data-size=sm]{padding-left:.75rem;row-gap:.25rem}
1
+ ._item_vo44o_1[aria-selected=true]{background-color:var(--theme-background-subtle);outline:2px solid}._item_vo44o_1[aria-selected=false]:hover h2{text-decoration:underline}._item_vo44o_1[data-size=lg],._item_vo44o_1[data-size=md]{padding:1em}._item_vo44o_1[data-size=sm],._item_vo44o_1[data-size=xs]{padding:.5em .75em}._select_vo44o_20{position:absolute;top:0;right:0;margin:.375rem}._summary_vo44o_27{font-size:1rem;line-height:1.35;margin:0;font-weight:400}._summary_vo44o_27[data-size=lg]{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;margin-top:.5rem}._summary_vo44o_27[data-size=md]{display:none}._footer_vo44o_48{width:100%;margin-top:1rem;display:flex;flex-direction:column;row-gap:1rem}._touchedBy_vo44o_56{position:absolute;right:0;bottom:0;margin:8px}._border_vo44o_65[data-size=lg],._border_vo44o_65[data-size=md]{padding-left:1rem}._border_vo44o_65[data-size=xs],._border_vo44o_65[data-size=sm]{width:100%;flex-direction:row;align-items:center;padding-left:.75rem}
@@ -1 +1 @@
1
- ._title_ls5lr_1{font-weight:600;margin:0;padding-right:1.25rem;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}._title_ls5lr_1[data-size=xs],._title_ls5lr_1[data-size=sm]{font-size:1rem}._title_ls5lr_1[data-size=md]{font-size:1.125rem;line-height:1.2}._title_ls5lr_1[data-size=lg]{font-size:1.25rem;line-height:1.2}._title_ls5lr_1[data-size=xl]{font-size:1.5rem;line-height:1.25}._title_ls5lr_1[data-seen=true],._title_ls5lr_1[data-variant=archive]{font-weight:400}._title_ls5lr_1[data-variant=bin]{font-weight:400;text-decoration:line-through}
1
+ ._heading_1fk12_1{padding-right:1.25rem;display:inline-flex;column-gap:.5rem}._title_1fk12_7{font-weight:600;margin:0;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}._title_1fk12_7[data-size=xs],._title_1fk12_7[data-size=sm]{font-size:1rem}._title_1fk12_7[data-size=md],._title_1fk12_7[data-size=lg]{font-size:1.25rem;line-height:1.5rem}._title_1fk12_7[data-size=xl]{font-size:1.5rem;line-height:1.25}._title_1fk12_7[data-seen=true],._title_1fk12_7[data-variant=archived]{font-weight:400}._title_1fk12_7[data-variant=trashed]{font-weight:400;text-decoration:line-through}
@@ -1 +1 @@
1
- ._action_1lv65_3{display:flex;align-items:center;gap:.625rem;padding:.625rem}._linkText_1lv65_10{font-size:.875rem;white-space:nowrap}._linkIcon_1lv65_15{font-size:1.5rem}
1
+ ._action_mbqkv_3{display:flex;align-items:center;margin:.625rem}
@@ -1 +1 @@
1
- ._item_17cbe_3{border:0;color:inherit;font:inherit;text-align:inherit;text-decoration:none;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;user-select:none;cursor:pointer;position:relative;width:100%;display:flex;align-items:center}._item_17cbe_3[data-size=xs]{min-height:36px}._item_17cbe_3[data-size=sm]{min-height:44px}._item_17cbe_3[data-size=md]{min-height:56px}._item_17cbe_3[data-size=lg]{min-height:64px}._item_17cbe_3[data-size=xl]{min-height:72px}._content_17cbe_46{flex-grow:1;display:flex;align-items:center;gap:.625rem;padding:.5rem .625rem}._action_17cbe_56{display:flex;align-items:center;gap:.625rem;padding:.625rem}._linkText_17cbe_63{font-size:.875rem;white-space:nowrap}._linkIcon_17cbe_68{font-size:1.5rem}._item_17cbe_3{background-color:var(--theme-background-default);box-shadow:var(--ds-shadow-xs)}._item_17cbe_3:hover{outline:2px solid var(--theme-border-strong);z-index:2}._item_17cbe_3:hover strong{text-decoration:underline}._item_17cbe_3[data-active=true],._item_17cbe_3[data-color=accent]{background-color:var(--theme-surface-default)}._item_17cbe_3[data-color=accent]:hover{background-color:var(--theme-surface-hover)}
1
+ ._item_jxdl8_1{position:relative;width:100%;display:flex;align-items:stretch;justify-content:stretch}._item_jxdl8_1[data-shadow=xs]{box-shadow:var(--ds-shadow-xs)}._item_jxdl8_1[data-size=xs]{min-height:36px}._item_jxdl8_1[data-size=sm]{min-height:44px}._item_jxdl8_1[data-size=md]{min-height:56px}._item_jxdl8_1[data-size=lg]{min-height:64px}._item_jxdl8_1[data-size=xl]{min-height:72px}._item_jxdl8_1{background-color:var(--theme-background-default)}._item_jxdl8_1:hover{outline:2px solid var(--theme-border-strong);z-index:2}._item_jxdl8_1:hover strong,._item_jxdl8_1:hover h2{text-decoration:underline}._item_jxdl8_1[data-active=true],._item_jxdl8_1[data-color=accent]{background-color:var(--theme-surface-default)}._item_jxdl8_1[data-color=accent]:hover{background-color:var(--theme-surface-hover)}._link_jxdl8_69{padding:0;border:0;background-color:transparent;color:inherit;font:inherit;text-align:inherit;text-decoration:none;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;user-select:none;cursor:pointer}._link_jxdl8_69{flex-grow:1;display:flex;align-items:center}
@@ -0,0 +1 @@
1
+ ._footer_r3tc7_1{display:flex;align-items:center;gap:.625rem;padding:.625rem}._linkText_r3tc7_8{font-size:.875rem;white-space:nowrap}._linkIcon_r3tc7_13{font-size:1.5rem}
@@ -0,0 +1 @@
1
+ ._header_70chu_1{flex-grow:1;display:flex;align-items:center;gap:.625rem;padding:.5rem .625rem}
@@ -1 +1 @@
1
- ._label_1ajdw_3{display:flex;justify-content:center}._label_1ajdw_3[data-size=xs]{align-items:center;column-gap:.25em;font-size:.875rem}._label_1ajdw_3[data-size=sm]{align-items:center;column-gap:.25rem}._label_1ajdw_3[data-size=md],._label_1ajdw_3[data-size=lg],._label_1ajdw_3[data-size=xl]{flex-direction:column}._title_1ajdw_33{font-weight:600;margin:0}._title_1ajdw_33[data-size=lg]{font-size:1.125rem}._title_1ajdw_33[data-size=xl]{font-size:1.25rem}._description_1ajdw_46{color:var(--theme-text-subtle);margin:0}._description_1ajdw_46[data-size=md],._description_1ajdw_46[data-size=lg],._description_1ajdw_46[data-size=xl]{font-size:.875em}
1
+ ._label_1aaut_3{flex-grow:1;display:flex}._label_1aaut_3[data-size=xs]{align-items:center;column-gap:.25em;font-size:.875rem}._label_1aaut_3[data-size=sm]{align-items:center;column-gap:.25rem}._label_1aaut_3[data-size=md],._label_1aaut_3[data-size=lg],._label_1aaut_3[data-size=xl]{flex-direction:column}._title_1aaut_33{font-weight:600;margin:0}._title_1aaut_33[data-size=lg]{font-size:1.125rem}._title_1aaut_33[data-size=xl]{font-size:1.25rem}._description_1aaut_46{color:var(--theme-text-subtle);margin:0}._description_1aaut_46[data-size=md],._description_1aaut_46[data-size=lg],._description_1aaut_46[data-size=xl]{font-size:.875em}
@@ -1 +1 @@
1
- ._media_pfuu4_3{display:flex;align-items:center;justify-content:center;min-width:1em;height:1em}._media_pfuu4_3{font-size:1.5rem}._media_pfuu4_3[data-size=xs]{font-size:1.25rem}._media_pfuu4_3[data-size=md]{font-size:1.875rem}._media_pfuu4_3[data-size=md] ._icon_pfuu4_23{font-size:1.5rem}._media_pfuu4_3[data-size=lg]{font-size:2.25rem}._media_pfuu4_3[data-size=lg] ._icon_pfuu4_23{font-size:1.75rem}._media_pfuu4_3[data-size=xl]{font-size:2.75rem}._media_pfuu4_3[data-size=xl] ._icon_pfuu4_23{font-size:2rem}
1
+ ._media_14b0z_3{flex-shrink:0;display:flex;align-items:center;justify-content:center;min-width:1em;height:1em}._media_14b0z_3{font-size:1.5rem}._media_14b0z_3[data-size=xs]{font-size:1.25rem}._media_14b0z_3[data-size=md]{font-size:1.875rem}._media_14b0z_3[data-size=md] ._icon_14b0z_24{font-size:1.5rem}._media_14b0z_3[data-size=lg]{font-size:2.25rem}._media_14b0z_3[data-size=lg] ._icon_14b0z_24{font-size:1.75rem}._media_14b0z_3[data-size=xl]{font-size:2.75rem}._media_14b0z_3[data-size=xl] ._icon_14b0z_24{font-size:2rem}
@@ -0,0 +1 @@
1
+ ._item_o4xu8_1{border:1px;border-radius:2px;color:var(--neutral-text-subtle);display:inline-flex;align-items:center;column-gap:.25em;white-space:nowrap;text-decoration:none}button._item_o4xu8_1:hover,a._item_o4xu8_1:hover{color:var(--theme-base-hover)}._item_o4xu8_1[data-size=xs]{font-size:.875rem;height:1.5rem}._item_o4xu8_1[data-size=sm]{font-size:1rem}._item_o4xu8_1[data-size=md]{font-size:1.125rem}._item_o4xu8_1[data-variant=text]{border-color:transparent;padding-left:0;padding-right:0}._item_o4xu8_1[data-variant=outline]{border-color:var(--theme-border-subtle);border-style:solid}._item_o4xu8_1[data-variant=rounded]{border-color:var(--theme-border-subtle);border-style:solid;border-radius:.75rem}._item_o4xu8_1[data-variant=dotted]{border-color:var(--theme-base-hover);border-style:dashed}._item_o4xu8_1[data-variant=solid]{border-color:var(--theme-base-hover);background-color:var(--theme-base-hover);color:#fff}._item_o4xu8_1[data-variant=rounded],._item_o4xu8_1[data-variant=outline],._item_o4xu8_1[data-variant=dotted],._item_o4xu8_1[data-variant=solid]{padding:0 .25em}
@@ -0,0 +1 @@
1
+ ._label_8431v_1{display:inline-flex;font-weight:400;align-items:center}._label_8431v_1[data-size=xs]{font-size:.875rem}._label_8431v_1[data-size=sm]{font-size:1rem}._label_8431v_1[data-size=md]{font-size:1.125rem}._label_8431v_1[data-variant=rounded],._label_8431v_1[data-variant=outline],._label_8431v_1[data-variant=dotted],._label_8431v_1[data-variant=solid]{font-size:.875em;font-weight:500;padding:0 .25em}
@@ -0,0 +1 @@
1
+ ._media_m8ywm_1{display:inline-flex;align-items:center;justify-content:center}._media_m8ywm_1[data-size=xs]{font-size:1rem}._media_m8ywm_1[data-size=sm]{font-size:1.25rem}
@@ -1,4 +1,4 @@
1
- import { ListSpacing } from '../';
1
+ import { ListSpacing } from '..';
2
2
  import { BookmarksListItemProps } from './BookmarksListItem';
3
3
  export interface BookmarksListProps {
4
4
  items: BookmarksListItemProps[];
@@ -1,20 +1,9 @@
1
- import { ElementType } from 'react';
2
- import { ListItemSize } from '..';
1
+ import { ListItemProps } from '..';
3
2
  import { QueryItemProps } from './QueryLabel';
4
- export interface BookmarksListItemProps {
3
+ export interface BookmarksListItemProps extends ListItemProps {
5
4
  id: string;
6
- /** Element type to render */
7
- as?: ElementType;
8
- /** ELement link */
9
- href?: string;
10
- /** Optional onClick */
11
- onClick?(): void;
12
- /** Size of list item */
13
- size?: ListItemSize;
14
5
  /** Optional title */
15
6
  title?: string;
16
- /** Optional description */
17
- description?: string;
18
7
  /** Query params */
19
8
  params?: QueryItemProps[];
20
9
  }
@@ -1,16 +1,11 @@
1
- import { jsxs as e, jsx as o } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "../Icon/SvgIcon.js";
4
4
  import "react";
5
- import { QueryLabel as s } from "./QueryLabel.js";
5
+ import { QueryLabel as n } from "./QueryLabel.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { ListItemBase as n } from "../List/ListItemBase.js";
8
- import { ListItemLabel as p } from "../List/ListItemLabel.js";
9
- import { ListItemMedia as a } from "../List/ListItemMedia.js";
10
- const b = ({ size: r = "sm", title: m, description: c, params: i, ...t }) => /* @__PURE__ */ e(n, { size: r, linkIcon: "chevron-right", ...t, children: [
11
- /* @__PURE__ */ o(a, { size: r, icon: "magnifying-glass" }),
12
- /* @__PURE__ */ o(p, { title: m, size: r, children: !m && /* @__PURE__ */ o(s, { params: i }) })
13
- ] });
7
+ import { ListItem as e } from "../List/ListItem.js";
8
+ const k = ({ size: o = "sm", title: i, description: p, params: t, ...m }) => /* @__PURE__ */ r(e, { size: o, icon: "magnifying-glass", linkIcon: "chevron-right", ...m, children: !i && /* @__PURE__ */ r(n, { params: t }) });
14
9
  export {
15
- b as BookmarksListItem
10
+ k as BookmarksListItem
16
11
  };
@@ -42,8 +42,8 @@ import '../../assets/Button.css';const B = "_button_1ysmx_1", y = "_reverse_1ysm
42
42
  className: u(t.button, { [t.reverse]: n }),
43
43
  ...c,
44
44
  children: [
45
- /* @__PURE__ */ s(_, { size: r, children: i }),
46
- m && /* @__PURE__ */ s(x, { size: r, icon: m })
45
+ m && /* @__PURE__ */ s(x, { size: r, icon: m }),
46
+ /* @__PURE__ */ s(_, { size: r, children: i })
47
47
  ]
48
48
  }
49
49
  );
@@ -35,8 +35,8 @@ const g = {
35
35
  /* @__PURE__ */ o(c, { children: t }),
36
36
  n == null ? void 0 : n.map((r) => /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", columnGap: "1rem" }, children: [
37
37
  /* @__PURE__ */ o(p, { ...e, icon: "x-mark", variant: t, size: r }),
38
- /* @__PURE__ */ o(l, { ...e, reverse: !0, variant: t, icon: "arrow-left", size: r, children: "Button" }),
39
- /* @__PURE__ */ o(l, { ...e, variant: t, icon: "arrow-right", size: r, children: "Button" }),
38
+ /* @__PURE__ */ o(l, { ...e, variant: t, icon: "arrow-left", size: r, children: "Button" }),
39
+ /* @__PURE__ */ o(l, { ...e, reverse: !0, variant: t, icon: "arrow-right", size: r, children: "Button" }),
40
40
  /* @__PURE__ */ o(d, { ...e, variant: t, icon: "chevron-down", size: r, children: "ComboButton" }),
41
41
  /* @__PURE__ */ o(c, { children: r })
42
42
  ] }, r))
@@ -1,10 +1,20 @@
1
1
  import { jsxs as t, Fragment as r, jsx as e } from "react/jsx-runtime";
2
- import { Dialog as a } from "./Dialog.js";
3
- const d = {
2
+ import { withThemeByDataAttribute as a } from "@storybook/addon-themes";
3
+ import { Dialog as i } from "./Dialog.js";
4
+ const m = {
4
5
  title: "Dialog/Dialog",
5
- component: a,
6
+ component: i,
6
7
  tags: ["autodocs"],
7
8
  parameters: {},
9
+ decorators: [
10
+ a({
11
+ themes: {
12
+ company: "company",
13
+ person: "person"
14
+ },
15
+ defaultTheme: "company"
16
+ })
17
+ ],
8
18
  argTypes: { body: { control: "text" } },
9
19
  args: {
10
20
  seenBy: {
@@ -59,7 +69,7 @@ const d = {
59
69
  title: "Title",
60
70
  summary: "Summary"
61
71
  }
62
- }, o = {
72
+ }, p = {
63
73
  args: {
64
74
  body: /* @__PURE__ */ t(r, { children: [
65
75
  /* @__PURE__ */ e("h2", { children: "Heading 2" }),
@@ -71,7 +81,7 @@ const d = {
71
81
  ] })
72
82
  ] })
73
83
  }
74
- }, m = {
84
+ }, g = {
75
85
  args: {
76
86
  attachments: {
77
87
  title: "2 vedlegg",
@@ -87,7 +97,7 @@ const d = {
87
97
  ]
88
98
  }
89
99
  }
90
- }, p = {
100
+ }, c = {
91
101
  args: {
92
102
  actions: [
93
103
  {
@@ -102,7 +112,7 @@ const d = {
102
112
  }
103
113
  ]
104
114
  }
105
- }, i = {
115
+ }, n = {
106
116
  args: {
107
117
  status: { label: "Krever handling", value: "requires-attention" },
108
118
  sender: {
@@ -137,9 +147,9 @@ const d = {
137
147
  ]
138
148
  }
139
149
  }
140
- }, g = {
150
+ }, h = {
141
151
  args: {
142
- ...i.args,
152
+ ...n.args,
143
153
  status: { value: "in-progress", label: "Under arbeid" },
144
154
  dueAt: null,
145
155
  dueAtLabel: null,
@@ -198,7 +208,7 @@ const d = {
198
208
  ]
199
209
  }
200
210
  }
201
- }, n = {
211
+ }, s = {
202
212
  args: {
203
213
  status: { value: "draft", label: "Utkast" },
204
214
  sender: {
@@ -224,9 +234,9 @@ const d = {
224
234
  ],
225
235
  attachments: {}
226
236
  }
227
- }, c = {
237
+ }, u = {
228
238
  args: {
229
- ...n.args,
239
+ ...s.args,
230
240
  status: { value: "sent", label: "Sendt" },
231
241
  actions: null,
232
242
  summary: "Skjema er sendt inn.",
@@ -242,12 +252,12 @@ const d = {
242
252
  }
243
253
  };
244
254
  export {
245
- p as Actions,
246
- m as Attachments,
247
- o as Body,
248
- n as Draft,
249
- g as InProgress,
250
- i as RequiresAttention,
251
- c as Sent,
252
- d as default
255
+ c as Actions,
256
+ g as Attachments,
257
+ p as Body,
258
+ s as Draft,
259
+ h as InProgress,
260
+ n as RequiresAttention,
261
+ u as Sent,
262
+ m as default
253
263
  };
@@ -1,4 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
+ export type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
+ export type DialogVariant = 'neutral' | 'draft' | 'trashed' | 'archived';
2
4
  export interface DialogBaseProps {
3
5
  children?: ReactNode;
4
6
  }
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { DialogListItemSize } from './DialogListItemBase';
2
+ import { DialogListItemSize } from './DialogListItem.tsx';
3
3
  export interface DialogBorderProps {
4
4
  seen?: boolean;
5
5
  size?: DialogListItemSize;
@@ -1,8 +1,8 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { c as a } from "../../index-L8X2o7IH.js";
3
- import '../../assets/DialogBorder.css';const d = "_border_1yyjs_1", c = {
4
- border: d
5
- }, n = ({ seen: r = !0, size: o = "lg", className: e, children: s }) => /* @__PURE__ */ t("div", { className: a(c.border, e), "data-size": o, "data-seen": r, children: s });
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { c as d } from "../../index-L8X2o7IH.js";
3
+ import '../../assets/DialogBorder.css';const a = "_border_tdijc_1", c = {
4
+ border: a
5
+ }, n = ({ seen: r = !0, size: o = "lg", className: e, children: t }) => /* @__PURE__ */ s("div", { className: d(c.border, e), "data-size": o, "data-seen": r, children: t });
6
6
  export {
7
7
  n as DialogBorder
8
8
  };
@@ -1,6 +1,6 @@
1
1
  import { DialogContent as t } from "./DialogContent.js";
2
2
  const o = {
3
- title: "Dialog/DialogContent",
3
+ title: "Dialog/Sections/DialogContent",
4
4
  component: t,
5
5
  tags: ["autodocs"],
6
6
  args: {
@@ -4,16 +4,16 @@ import "../Icon/SvgIcon.js";
4
4
  import "react";
5
5
  import { Button as t } from "../Button/Button.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { Heading as m } from "../Typography/Heading.js";
7
+ import { Heading as e } from "../Typography/Heading.js";
8
8
  import { ListBase as n } from "../List/ListBase.js";
9
9
  import { SectionBase as p } from "../Page/SectionBase.js";
10
10
  import { SectionHeader as a } from "../Page/SectionHeader.js";
11
- const j = ({ title: i, children: e }) => /* @__PURE__ */ o(p, { spacing: "md", children: [
11
+ const j = ({ title: i, children: m }) => /* @__PURE__ */ o(p, { spacing: "md", children: [
12
12
  i && /* @__PURE__ */ o(a, { padding: !0, margin: !0, children: [
13
- /* @__PURE__ */ r(m, { children: i }),
14
- /* @__PURE__ */ r(t, { variant: "text", icon: "checkmark", size: "sm", reverse: !0, children: "Velg alle" })
13
+ /* @__PURE__ */ r(e, { children: i }),
14
+ /* @__PURE__ */ r(t, { variant: "text", icon: "checkmark", size: "sm", children: "Velg alle" })
15
15
  ] }),
16
- /* @__PURE__ */ r(n, { spacing: "md", children: e })
16
+ /* @__PURE__ */ r(n, { spacing: "md", children: m })
17
17
  ] });
18
18
  export {
19
19
  j as DialogGroup
@@ -1,5 +1,5 @@
1
1
  import { DialogRecipientProps, DialogSenderProps } from './DialogHeadings';
2
- import { DialogListItemVariant } from './DialogListItemBase.tsx';
2
+ import { DialogListItemVariant } from './DialogListItem.tsx';
3
3
  export interface DialogHeaderProps {
4
4
  title: string;
5
5
  seen: boolean;
@@ -1,10 +1,10 @@
1
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
- import { DialogHeaderBase as s } from "./DialogHeaderBase.js";
1
+ import { jsxs as a, jsx as i } from "react/jsx-runtime";
2
+ import { DialogHeaderBase as m } from "./DialogHeaderBase.js";
3
3
  import { DialogHeadings as t } from "./DialogHeadings.js";
4
- import { DialogTitle as d } from "./DialogTitle.js";
5
- const f = ({ title: i, sender: o, recipient: e, seen: l, variant: a }) => /* @__PURE__ */ m(s, { children: [
6
- /* @__PURE__ */ r(d, { seen: l, size: "xl", variant: a, children: i }),
7
- /* @__PURE__ */ r(t, { size: "xl", sender: o, recipient: e })
4
+ import { DialogTitle as x } from "./DialogTitle.js";
5
+ const f = ({ title: r, sender: e, recipient: o, seen: l, variant: s }) => /* @__PURE__ */ a(m, { size: "xl", children: [
6
+ /* @__PURE__ */ i(x, { seen: l, size: "xl", variant: s, children: r }),
7
+ /* @__PURE__ */ i(t, { size: "xl", sender: e, recipient: o })
8
8
  ] });
9
9
  export {
10
10
  f as DialogHeader
@@ -1,5 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
+ import { DialogSize } from './DialogBase';
2
3
  export interface DialogHeaderBaseProps {
4
+ size?: DialogSize;
3
5
  children?: ReactNode;
4
6
  }
5
- export declare const DialogHeaderBase: ({ children }: DialogHeaderBaseProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const DialogHeaderBase: ({ size, children }: DialogHeaderBaseProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import '../../assets/DialogHeaderBase.css';const a = "_header_e6sit_1", s = {
3
- header: a
4
- }, o = ({ children: e }) => /* @__PURE__ */ r("header", { className: s.header, children: e });
2
+ import '../../assets/DialogHeaderBase.css';const s = "_header_45ink_1", t = {
3
+ header: s
4
+ }, o = ({ size: e, children: a }) => /* @__PURE__ */ r("header", { className: t.header, "data-size": e, children: a });
5
5
  export {
6
6
  o as DialogHeaderBase
7
7
  };
@@ -1,3 +1,4 @@
1
+ import { DialogSize } from './DialogBase';
1
2
  export type DialogSenderType = 'company' | 'person';
2
3
  export type DialogRecipientType = 'company' | 'person';
3
4
  export interface DialogSenderProps {
@@ -9,9 +10,8 @@ export interface DialogRecipientProps {
9
10
  type?: DialogRecipientType;
10
11
  name: string;
11
12
  }
12
- type DialogHeadingsSize = 'sm' | 'xs' | 'sm' | 'lg' | 'xl';
13
13
  export interface DialogHeadingsProps {
14
- size: DialogHeadingsSize;
14
+ size: DialogSize;
15
15
  /** Group sender and recipient avatars */
16
16
  grouped?: boolean;
17
17
  /** Sender */
@@ -21,4 +21,3 @@ export interface DialogHeadingsProps {
21
21
  }
22
22
  /** Dialog headings for sender and recipient. Should present an avatar for the sender. */
23
23
  export declare const DialogHeadings: ({ grouped, size, sender, recipient, }: DialogHeadingsProps) => import("react/jsx-runtime").JSX.Element;
24
- export {};
@@ -1,14 +1,12 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as m } from "react/jsx-runtime";
2
2
  import { Avatar as l } from "../Avatar/Avatar.js";
3
- import { AvatarGroup as c } from "../Avatar/AvatarGroup.js";
4
- import { MetaItem as d } from "../Meta/MetaItem.js";
5
- import "../../index-L8X2o7IH.js";
6
- import "../Icon/SvgIcon.js";
7
- import '../../assets/DialogHeadings.css';const x = "_headings_1dhfw_1", h = "_text_1dhfw_16", g = "_sender_1dhfw_21", m = {
8
- headings: x,
9
- text: h,
10
- sender: g
11
- }, s = {
3
+ import { AvatarGroup as o } from "../Avatar/AvatarGroup.js";
4
+ import '../../assets/DialogHeadings.css';const i = "_headings_fci15_1", p = "_text_fci15_21", x = "_sender_fci15_26", d = "_recipient_fci15_31", s = {
5
+ headings: i,
6
+ text: p,
7
+ sender: x,
8
+ recipient: d
9
+ }, t = {
12
10
  avatar: {
13
11
  xs: "xs",
14
12
  sm: "xs",
@@ -16,37 +14,37 @@ import '../../assets/DialogHeadings.css';const x = "_headings_1dhfw_1", h = "_te
16
14
  lg: "xs",
17
15
  xl: "lg"
18
16
  }
19
- }, N = ({
17
+ }, v = ({
20
18
  grouped: r,
21
19
  size: n = "lg",
22
20
  sender: a = { type: "company", name: "Sender" },
23
- recipient: t = { type: "person", name: "Recipient" }
24
- }) => /* @__PURE__ */ o("div", { className: m.headings, "data-size": n, children: [
25
- r ? /* @__PURE__ */ e(
26
- c,
21
+ recipient: e = { type: "person", name: "Recipient" }
22
+ }) => /* @__PURE__ */ c("div", { className: s.headings, "data-size": n, children: [
23
+ r ? /* @__PURE__ */ m(
24
+ o,
27
25
  {
28
- items: [{ ...a, type: "company" }, t],
29
- size: s == null ? void 0 : s.avatar[n],
30
- className: m.avatar
26
+ items: [{ ...a, type: "company" }, e],
27
+ size: t == null ? void 0 : t.avatar[n],
28
+ className: s.avatar
31
29
  }
32
- ) : /* @__PURE__ */ e(
30
+ ) : /* @__PURE__ */ m(
33
31
  l,
34
32
  {
35
33
  type: "company",
36
34
  imageUrl: a == null ? void 0 : a.imageUrl,
37
35
  name: a.name,
38
- size: s == null ? void 0 : s.avatar[n],
39
- className: m.avatar
36
+ size: t == null ? void 0 : t.avatar[n],
37
+ className: s.avatar
40
38
  }
41
39
  ),
42
- /* @__PURE__ */ o(d, { size: "xs", className: m.text, children: [
43
- /* @__PURE__ */ e("span", { className: m.sender, children: a.name }),
44
- (t == null ? void 0 : t.name) && /* @__PURE__ */ o("span", { children: [
40
+ /* @__PURE__ */ c("span", { "data-size": n, className: s.text, children: [
41
+ /* @__PURE__ */ m("span", { className: s.sender, children: a.name }),
42
+ (e == null ? void 0 : e.name) && /* @__PURE__ */ c("span", { className: s.recipient, children: [
45
43
  " til ",
46
- /* @__PURE__ */ e("span", { children: t.name })
44
+ /* @__PURE__ */ m("span", { children: e.name })
47
45
  ] })
48
46
  ] })
49
47
  ] });
50
48
  export {
51
- N as DialogHeadings
49
+ v as DialogHeadings
52
50
  };
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { MetaItemSize } from '../Meta';
3
+ import { DialogVariant } from './DialogBase';
4
+ export interface DialogLabelProps {
5
+ size?: MetaItemSize;
6
+ variant?: DialogVariant;
7
+ label?: string;
8
+ children?: ReactNode;
9
+ }
10
+ /**
11
+ * Dialog label.
12
+ */
13
+ export declare const DialogLabel: ({ size, variant, label, children }: DialogLabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { MetaItem as e } from "../Meta/MetaItem.js";
3
+ import "../../index-L8X2o7IH.js";
4
+ import "../Icon/SvgIcon.js";
5
+ const u = ({ size: r = "xs", variant: n, label: t, children: a }) => {
6
+ switch (n) {
7
+ case "trashed":
8
+ return /* @__PURE__ */ o(e, { size: r, icon: "trash", variant: "rounded", children: a || t });
9
+ case "archived":
10
+ return /* @__PURE__ */ o(e, { size: r, icon: "archive", variant: "rounded", children: a || t });
11
+ default:
12
+ return /* @__PURE__ */ o(e, { size: r, variant: "rounded", children: a || t });
13
+ }
14
+ };
15
+ export {
16
+ u as DialogLabel
17
+ };
@@ -1,11 +1,13 @@
1
1
  import { ElementType } from 'react';
2
+ import { ListItemBaseProps } from '../List';
2
3
  import { DialogRecipientProps, DialogSenderProps } from './DialogHeadings';
4
+ import { DialogSeenByProps } from './DialogSeenBy';
3
5
  import { DialogSelectProps } from './DialogSelect';
4
6
  import { DialogStatusProps } from './DialogStatus';
5
7
  import { DialogTouchedByActor } from './DialogTouchedBy';
6
- import { DialogListItemSize, DialogListItemVariant } from './DialogListItemBase';
7
- import { DialogSeenByProps } from './DialogSeenBy';
8
- export type DialogListItemProps = {
8
+ export type DialogListItemSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
+ export type DialogListItemVariant = 'neutral' | 'draft' | 'trashed' | 'archived';
10
+ export interface DialogListItemProps extends ListItemBaseProps {
9
11
  /** Dialog title */
10
12
  title: string;
11
13
  /** Render as */
@@ -38,6 +40,16 @@ export type DialogListItemProps = {
38
40
  dueAt?: string;
39
41
  /** Dialog due date label */
40
42
  dueAtLabel?: string;
43
+ /** Archived date time */
44
+ archivedAt?: string;
45
+ /** Archived label */
46
+ archivedAtLabel?: string;
47
+ /** Deleted at date time */
48
+ trashedAt?: string;
49
+ /** Deleted label */
50
+ trashedAtLabel?: string;
51
+ /** Custom label */
52
+ label?: string;
41
53
  /** Dialog has been seen */
42
54
  seen?: boolean;
43
55
  /** Dialog is seen by the user */
@@ -50,10 +62,10 @@ export type DialogListItemProps = {
50
62
  onClick?: () => void;
51
63
  /** Group id */
52
64
  groupId?: string;
53
- };
65
+ }
54
66
  /**
55
67
  * Represents a dialog in list view, displaying information such as the title,
56
68
  * summary, sender, and receiver.
57
69
  * to mark the item as checked/unchecked and can visually indicate if it is unread.
58
70
  */
59
- export declare const DialogListItem: ({ as, size, variant, href, onClick, select, selected, status, sender, recipient, grouped, updatedAt, updatedAtLabel, dueAt, dueAtLabel, seen, seenBy, touchedBy, attachmentsCount, title, summary, }: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
71
+ export declare const DialogListItem: ({ size, variant, select, status, sender, recipient, grouped, updatedAt, updatedAtLabel, archivedAt, archivedAtLabel, trashedAt, trashedAtLabel, label, dueAt, dueAtLabel, seen, seenBy, touchedBy, attachmentsCount, title, summary, ...rest }: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;