@altinn/altinn-components 0.4.1 → 0.5.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/CHANGELOG.md +7 -0
- package/biome.jsonc +1 -1
- package/lib/components/Attachment/AttachmentLink.stories.ts +1 -1
- package/lib/components/Attachment/AttachmentList.stories.ts +1 -1
- package/lib/components/Button/Button.tsx +13 -10
- package/lib/components/Button/ButtonBase.tsx +1 -1
- package/lib/components/Button/ButtonIcon.tsx +16 -0
- package/lib/components/Button/ButtonLabel.tsx +16 -0
- package/lib/components/Button/Buttons.stories.tsx +64 -0
- package/lib/components/Button/ComboButton.tsx +9 -7
- package/lib/components/Button/IconButton.stories.tsx +47 -0
- package/lib/components/Button/IconButton.tsx +15 -5
- package/lib/components/Button/button.module.css +5 -46
- package/lib/components/Button/buttonBase.module.css +55 -23
- package/lib/components/Button/buttonIcon.module.css +17 -0
- package/lib/components/Button/buttonLabel.module.css +17 -0
- package/lib/components/Button/comboButton.module.css +15 -65
- package/lib/components/Button/iconButton.module.css +21 -4
- package/lib/components/Button/index.ts +2 -0
- package/lib/components/ContextMenu/ContextMenu.stories.ts +49 -0
- package/lib/components/ContextMenu/ContextMenu.tsx +12 -20
- package/lib/components/ContextMenu/ContextMenuBase.tsx +33 -0
- package/lib/components/Dialog/Dialog.tsx +2 -0
- package/lib/components/Dialog/DialogGroup.tsx +24 -0
- package/lib/components/Dialog/DialogList.stories.ts +14 -10
- package/lib/components/Dialog/DialogList.tsx +26 -11
- package/lib/components/Dialog/DialogListItem.tsx +12 -2
- package/lib/components/Dialog/DialogListItemBase.tsx +4 -2
- package/lib/components/Dialog/DialogNav.stories.ts +5 -5
- package/lib/components/Dialog/DialogNav.tsx +2 -6
- package/lib/components/Dialog/DialogSelect.tsx +1 -1
- package/lib/components/Dialog/dialogGroup.module.css +35 -0
- package/lib/components/Dropdown/Backdrop.tsx +4 -3
- package/lib/components/Dropdown/DrawerBase.tsx +5 -2
- package/lib/components/Dropdown/DrawerBody.tsx +12 -0
- package/lib/components/Dropdown/DrawerButton.tsx +17 -0
- package/lib/components/Dropdown/DrawerFooter.tsx +12 -0
- package/lib/components/Dropdown/DrawerHeader.tsx +19 -0
- package/lib/components/Dropdown/DrawerOrDropdown.tsx +29 -0
- package/lib/components/Dropdown/DropdownBase.tsx +5 -2
- package/lib/components/Dropdown/backdrop.module.css +3 -0
- package/lib/components/Dropdown/drawerBase.module.css +9 -0
- package/lib/components/Dropdown/drawerBody.module.css +5 -0
- package/lib/components/Dropdown/drawerButton.module.css +6 -0
- package/lib/components/Dropdown/drawerFooter.module.css +13 -0
- package/lib/components/Dropdown/drawerHeader.module.css +17 -0
- package/lib/components/Dropdown/drawerOrDropdown.module.css +19 -0
- package/lib/components/Dropdown/dropdownBase.module.css +15 -3
- package/lib/components/Dropdown/index.ts +7 -1
- package/lib/components/Footer/footerMenu.module.css +5 -0
- package/lib/components/GlobalMenu/GlobalMenu.stories.tsx +9 -9
- package/lib/components/GlobalMenu/GlobalMenu.tsx +5 -5
- package/lib/components/Header/{Header.stories.ts → Header.stories.tsx} +79 -20
- package/lib/components/Header/Header.tsx +24 -37
- package/lib/components/Header/HeaderBase.tsx +7 -3
- package/lib/components/Header/header.module.css +10 -42
- package/lib/components/Header/headerBase.module.css +43 -0
- package/lib/components/Header/headerButton.module.css +1 -0
- package/lib/components/Layout/Layout.stories.tsx +77 -38
- package/lib/components/Layout/Layout.tsx +5 -3
- package/lib/components/Layout/LayoutBase.tsx +3 -2
- package/lib/components/Layout/layoutBase.module.css +11 -0
- package/lib/components/Layout/layoutBody.module.css +1 -0
- package/lib/components/LayoutAction/ActionHeader.tsx +1 -1
- package/lib/components/LayoutAction/ActionMenu.tsx +2 -4
- package/lib/components/LayoutAction/actionMenu.module.css +3 -0
- package/lib/components/List/List.stories.tsx +43 -0
- package/lib/components/List/List.tsx +6 -6
- package/lib/components/List/ListBase.tsx +6 -6
- package/lib/components/List/ListItem.tsx +4 -1
- package/lib/components/List/ListItemBase.tsx +20 -4
- package/lib/components/List/listBase.module.css +3 -3
- package/lib/components/List/listItemBase.module.css +4 -0
- package/lib/components/Menu/Menu.stories.ts +46 -46
- package/lib/components/Menu/Menu.tsx +3 -102
- package/lib/components/Menu/MenuBase.tsx +47 -3
- package/lib/components/Menu/MenuItem.tsx +6 -4
- package/lib/components/Menu/MenuItemBase.tsx +7 -0
- package/lib/components/Menu/MenuItems.stories.ts +438 -0
- package/lib/components/Menu/MenuItems.tsx +96 -0
- package/lib/components/Menu/MenuOption.tsx +4 -1
- package/lib/components/Menu/{MenuGroup.tsx → __MenuGroup.tsx} +1 -1
- package/lib/components/Menu/index.ts +1 -1
- package/lib/components/Menu/menu.module.css +2 -3
- package/lib/components/Menu/menuBase.module.css +25 -0
- package/lib/components/Menu/menuItemBase.module.css +5 -4
- package/lib/components/Meta/MetaItemBase.tsx +1 -1
- package/lib/components/Meta/MetaItemLabel.tsx +1 -1
- package/lib/components/Meta/MetaItemMedia.tsx +1 -1
- package/lib/components/Page/PageBase.tsx +14 -0
- package/lib/components/Page/PageHeader.tsx +21 -0
- package/lib/components/Page/PageHeaderMedia.tsx +25 -0
- package/lib/components/Page/SectionBase.tsx +52 -0
- package/lib/components/Page/SectionFooter.tsx +15 -0
- package/lib/components/Page/SectionHeader.tsx +16 -0
- package/lib/components/Page/index.ts +5 -0
- package/lib/components/Page/pageHeader.module.css +5 -0
- package/lib/components/Page/sectionBase.module.css +82 -0
- package/lib/components/Page/sectionFooter.module.css +8 -0
- package/lib/components/Page/sectionHeader.module.css +9 -0
- package/lib/components/RootProvider/RootProvider.tsx +43 -7
- package/lib/components/Searchbar/Autocomplete.stories.tsx +77 -0
- package/lib/components/Searchbar/Autocomplete.tsx +44 -0
- package/lib/components/Searchbar/AutocompleteBase.tsx +16 -0
- package/lib/components/Searchbar/AutocompleteGroup.tsx +17 -0
- package/lib/components/Searchbar/AutocompleteItem.tsx +23 -0
- package/lib/components/Searchbar/SearchField.tsx +78 -0
- package/lib/components/Searchbar/Searchbar.stories.tsx +151 -0
- package/lib/components/Searchbar/Searchbar.tsx +18 -0
- package/lib/components/Searchbar/SearchbarBase.tsx +23 -0
- package/lib/components/Searchbar/autocompleteBase.module.css +17 -0
- package/lib/components/Searchbar/autocompleteGroup.module.css +3 -0
- package/lib/components/Searchbar/autocompleteItem.module.css +19 -0
- package/lib/components/Searchbar/index.ts +1 -0
- package/lib/components/Searchbar/searchField.module.css +54 -0
- package/lib/components/Searchbar/searchbarBase.module.css +20 -0
- package/lib/components/Toolbar/Toolbar.stories.tsx +10 -10
- package/lib/components/Toolbar/Toolbar.tsx +28 -10
- package/lib/components/Toolbar/ToolbarAdd.tsx +6 -5
- package/lib/components/Toolbar/ToolbarBase.tsx +5 -20
- package/lib/components/Toolbar/ToolbarButton.tsx +1 -1
- package/lib/components/Toolbar/ToolbarFilter.tsx +11 -6
- package/lib/components/Toolbar/ToolbarMenu.tsx +8 -7
- package/lib/components/Toolbar/ToolbarOptions.stories.ts +5 -5
- package/lib/components/Toolbar/ToolbarOptions.tsx +34 -21
- package/lib/components/Toolbar/toolbarAdd.module.css +7 -0
- package/lib/components/Toolbar/toolbarBase.module.css +19 -0
- package/lib/components/Toolbar/toolbarButton.module.css +1 -1
- package/lib/components/Toolbar/toolbarFilter.module.css +25 -0
- package/lib/components/Toolbar/toolbarMenu.module.css +7 -0
- package/lib/components/Typography/Heading.tsx +23 -0
- package/lib/components/Typography/Typography.tsx +8 -5
- package/lib/components/Typography/heading.module.css +21 -0
- package/lib/components/Typography/index.ts +1 -0
- package/lib/components/Typography/typography.module.css +8 -0
- package/lib/components/index.ts +2 -0
- package/lib/hooks/index.ts +3 -0
- package/lib/{components/Menu → hooks}/useEscapeKey.ts +2 -2
- package/lib/hooks/useMenu.tsx +80 -0
- package/lib/index.ts +1 -0
- package/lib/stories/Color/MenuItem.stories.tsx +43 -0
- package/lib/stories/Color/Swatches.stories.tsx +19 -0
- package/lib/stories/Color/Swatches.tsx +42 -0
- package/lib/stories/Color/colors.json +62 -0
- package/lib/stories/Color/swatches.module.css +14 -0
- package/lib/stories/Inbox/BookmarksPage.tsx +52 -0
- package/lib/stories/Inbox/DialogPage.tsx +15 -0
- package/lib/stories/Inbox/Inbox.stories.tsx +55 -0
- package/lib/stories/Inbox/Inbox.tsx +12 -0
- package/lib/stories/Inbox/InboxLayout.tsx +50 -0
- package/lib/stories/Inbox/InboxPage.tsx +50 -0
- package/lib/stories/Inbox/InboxProvider.tsx +136 -0
- package/lib/stories/Inbox/InboxSection.tsx +39 -0
- package/lib/stories/Inbox/InboxToolbar.tsx +94 -0
- package/lib/stories/Inbox/ProfilePage.tsx +35 -0
- package/lib/stories/Inbox/SettingsPage.tsx +19 -0
- package/lib/stories/Inbox/accounts/accounts.ts +24 -0
- package/lib/stories/Inbox/accounts/index.ts +1 -0
- package/lib/stories/Inbox/actionMenu.ts +24 -0
- package/lib/stories/Inbox/dialogs/brreg-completed.json +35 -0
- package/lib/stories/Inbox/dialogs/brreg-draft.json +45 -0
- package/lib/stories/Inbox/dialogs/index.ts +10 -0
- package/lib/stories/Inbox/dialogs/skatt-2023.json +33 -0
- package/lib/stories/Inbox/groupBy.ts +19 -0
- package/lib/stories/Inbox/inboxSection.module.css +19 -0
- package/lib/stories/Inbox/index.ts +15 -0
- package/lib/stories/Inbox/layout/footer.ts +27 -0
- package/lib/stories/Inbox/layout/header.ts +11 -0
- package/lib/stories/Inbox/layout/index.ts +3 -0
- package/lib/stories/Inbox/layout/menu.ts +64 -0
- package/package.json +1 -1
- package/tsconfig.json +7 -2
- package/lib/components/Header/HeaderSearch.stories.ts +0 -20
- package/lib/components/Header/HeaderSearch.tsx +0 -44
- package/lib/components/Header/headerSearch.module.css +0 -30
- package/lib/components/Toolbar/toolbar.module.css +0 -43
- /package/lib/components/ContextMenu/{contextMenu.module.css → contextMenuBase.module.css} +0 -0
- /package/lib/{components/Menu → hooks}/useClickOutside.ts +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const footer = {
|
|
2
|
+
address: 'Postboks 1382 Vika, 0114 Oslo.',
|
|
3
|
+
menu: {
|
|
4
|
+
items: [
|
|
5
|
+
{
|
|
6
|
+
id: '1',
|
|
7
|
+
href: '#',
|
|
8
|
+
title: 'Om Altinn',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: '2',
|
|
12
|
+
href: '#',
|
|
13
|
+
title: 'Driftsmeldinger',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: '3',
|
|
17
|
+
href: '#',
|
|
18
|
+
title: 'Personvern',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: '4',
|
|
22
|
+
href: '#',
|
|
23
|
+
title: 'Tilgjengelighet',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export const menu = {
|
|
2
|
+
groups: {
|
|
3
|
+
shortcuts: {
|
|
4
|
+
title: 'Snarveier',
|
|
5
|
+
defaultItemColor: 'neutral',
|
|
6
|
+
},
|
|
7
|
+
},
|
|
8
|
+
items: [
|
|
9
|
+
{
|
|
10
|
+
id: 'inbox',
|
|
11
|
+
groupId: 1,
|
|
12
|
+
size: 'lg',
|
|
13
|
+
icon: 'inbox',
|
|
14
|
+
title: 'Innboks',
|
|
15
|
+
color: 'strong',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'drafts',
|
|
19
|
+
groupId: 2,
|
|
20
|
+
icon: 'doc-pencil',
|
|
21
|
+
title: 'Utkast',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'sent',
|
|
25
|
+
groupId: 2,
|
|
26
|
+
icon: 'file-checkmark',
|
|
27
|
+
selected: true,
|
|
28
|
+
title: 'Sendt',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'bookmarks',
|
|
32
|
+
groupId: 3,
|
|
33
|
+
icon: 'bookmark',
|
|
34
|
+
// disabled: true,
|
|
35
|
+
title: 'Lagrede søk',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'archived',
|
|
39
|
+
groupId: 4,
|
|
40
|
+
disabled: true,
|
|
41
|
+
icon: 'archive',
|
|
42
|
+
title: 'Arkivert',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'trash',
|
|
46
|
+
groupId: 4,
|
|
47
|
+
disabled: true,
|
|
48
|
+
icon: 'trash',
|
|
49
|
+
title: 'Papirkurv',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'profile',
|
|
53
|
+
groupId: 'shortcuts',
|
|
54
|
+
icon: 'person-circle',
|
|
55
|
+
title: 'Din profil',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'settings',
|
|
59
|
+
groupId: 'shortcuts',
|
|
60
|
+
icon: 'cog',
|
|
61
|
+
title: 'Innstillinger',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -17,7 +17,12 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"allowSyntheticDefaultImports": true
|
|
19
19
|
},
|
|
20
|
-
"include": ["./lib/**/*.ts", "./lib
|
|
21
|
-
"exclude": [
|
|
20
|
+
"include": ["./lib/**/*.ts", "./lib/hooks/*.tsx", "./**/*.d.ts"],
|
|
21
|
+
"exclude": [
|
|
22
|
+
"./lib/stories/**/*",
|
|
23
|
+
"lib/components/**/*.stories.ts",
|
|
24
|
+
"lib/components/**/*.stories.tsx",
|
|
25
|
+
"./lib/components/Icon/__AkselIcon.tsx"
|
|
26
|
+
],
|
|
22
27
|
"references": [{ "path": "./tsconfig.node.json" }]
|
|
23
28
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { HeaderSearch } from './HeaderSearch';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Header/HeaderSearch',
|
|
6
|
-
component: HeaderSearch,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {},
|
|
9
|
-
args: {},
|
|
10
|
-
} satisfies Meta<typeof HeaderSearch>;
|
|
11
|
-
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof meta>;
|
|
14
|
-
|
|
15
|
-
export const Default: Story = {
|
|
16
|
-
args: {
|
|
17
|
-
placeholder: 'Search',
|
|
18
|
-
name: 'search',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import cx from 'classnames';
|
|
2
|
-
import type { ChangeEventHandler, FocusEventHandler } from 'react';
|
|
3
|
-
import { Icon } from '../Icon';
|
|
4
|
-
import styles from './headerSearch.module.css';
|
|
5
|
-
|
|
6
|
-
export interface HeaderSearchProps {
|
|
7
|
-
className?: string;
|
|
8
|
-
expanded?: boolean;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
name: string;
|
|
11
|
-
value?: string;
|
|
12
|
-
onFocus?: FocusEventHandler;
|
|
13
|
-
onBlur?: FocusEventHandler;
|
|
14
|
-
onChange?: ChangeEventHandler;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const HeaderSearch = ({
|
|
18
|
-
className,
|
|
19
|
-
expanded = false,
|
|
20
|
-
name = 'q',
|
|
21
|
-
value,
|
|
22
|
-
placeholder = 'Søk',
|
|
23
|
-
onFocus,
|
|
24
|
-
onBlur,
|
|
25
|
-
onChange,
|
|
26
|
-
}: HeaderSearchProps) => {
|
|
27
|
-
return (
|
|
28
|
-
<div className={cx(styles.form, className)} aria-expanded={expanded}>
|
|
29
|
-
<div className={styles.field}>
|
|
30
|
-
<input
|
|
31
|
-
onFocus={onFocus}
|
|
32
|
-
onBlur={onBlur}
|
|
33
|
-
name={name}
|
|
34
|
-
value={value}
|
|
35
|
-
onChange={onChange}
|
|
36
|
-
placeholder={placeholder}
|
|
37
|
-
className={styles.input}
|
|
38
|
-
type="search"
|
|
39
|
-
/>
|
|
40
|
-
<Icon name="magnifying-glass" className={styles.icon} />
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
.field {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
font-size: 1.125rem;
|
|
6
|
-
color: currentColor;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.input {
|
|
10
|
-
font-size: inherit;
|
|
11
|
-
flex-grow: 1;
|
|
12
|
-
padding-left: 2.5rem;
|
|
13
|
-
padding-right: 1rem;
|
|
14
|
-
padding-top: 1rem;
|
|
15
|
-
padding-bottom: 1rem;
|
|
16
|
-
border-radius: 4px;
|
|
17
|
-
border: 2px solid;
|
|
18
|
-
background-color: transparent;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.input[value] {
|
|
22
|
-
background-color: white;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.icon {
|
|
26
|
-
position: absolute;
|
|
27
|
-
left: 0;
|
|
28
|
-
font-size: 1.25rem;
|
|
29
|
-
margin: 0 1rem;
|
|
30
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
.toolbar {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
flex-wrap: wrap;
|
|
5
|
-
width: 100%;
|
|
6
|
-
gap: 0.5rem;
|
|
7
|
-
padding: 0 0.5rem;
|
|
8
|
-
margin: 1.125rem 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@media (min-width: 1024px) {
|
|
12
|
-
.toolbar {
|
|
13
|
-
padding: 0;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/* TIDI; move styles below */
|
|
18
|
-
|
|
19
|
-
.button {
|
|
20
|
-
display: inline-block;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.remove-button > button:hover + * + * {
|
|
24
|
-
text-decoration: line-through;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.dropdown {
|
|
28
|
-
display: none;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.dropdown[aria-expanded="true"] {
|
|
32
|
-
display: block;
|
|
33
|
-
position: absolute;
|
|
34
|
-
z-index: 2;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.dropdown {
|
|
38
|
-
margin-top: 0.5rem;
|
|
39
|
-
padding: 0 0.5rem;
|
|
40
|
-
background-color: var(--neutral-background-default);
|
|
41
|
-
border-radius: 2px;
|
|
42
|
-
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.1);
|
|
43
|
-
}
|
|
File without changes
|
|
File without changes
|