@altinn/altinn-components 0.0.1
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/.github/workflows/ci-cd-main.yml +44 -0
- package/.github/workflows/ci-cd-pull-request.yml +39 -0
- package/.node-version +1 -0
- package/.storybook/main.ts +22 -0
- package/.storybook/preview.ts +15 -0
- package/CHANGELOG.md +13 -0
- package/README.md +2 -0
- package/biome.jsonc +65 -0
- package/lib/components/Avatar/Avatar.tsx +91 -0
- package/lib/components/Avatar/AvatarGroup.stories.ts +67 -0
- package/lib/components/Avatar/AvatarGroup.tsx +42 -0
- package/lib/components/Avatar/avatar.module.css +59 -0
- package/lib/components/Avatar/avatar.stories.tsx +44 -0
- package/lib/components/Avatar/avatarGroup.module.css +78 -0
- package/lib/components/Avatar/color.ts +71 -0
- package/lib/components/Avatar/index.ts +2 -0
- package/lib/components/Badge/Badge.tsx +19 -0
- package/lib/components/Badge/badge.module.css +36 -0
- package/lib/components/Badge/index.tsx +1 -0
- package/lib/components/Button/Button.stories.ts +44 -0
- package/lib/components/Button/Button.tsx +39 -0
- package/lib/components/Button/ButtonBase.tsx +53 -0
- package/lib/components/Button/ComboButton.stories.ts +45 -0
- package/lib/components/Button/ComboButton.tsx +44 -0
- package/lib/components/Button/button.module.css +82 -0
- package/lib/components/Button/buttonBase.module.css +77 -0
- package/lib/components/Button/comboButton.module.css +83 -0
- package/lib/components/Button/index.ts +3 -0
- package/lib/components/Header/DigdirLogomark.tsx +23 -0
- package/lib/components/Header/GlobalMenu.stories.tsx +202 -0
- package/lib/components/Header/GlobalMenu.tsx +131 -0
- package/lib/components/Header/Header.stories.ts +85 -0
- package/lib/components/Header/Header.tsx +64 -0
- package/lib/components/Header/HeaderBase.tsx +10 -0
- package/lib/components/Header/HeaderButton.stories.ts +54 -0
- package/lib/components/Header/HeaderButton.tsx +55 -0
- package/lib/components/Header/HeaderLogo.stories.ts +17 -0
- package/lib/components/Header/HeaderLogo.tsx +22 -0
- package/lib/components/Header/HeaderSearch.stories.ts +20 -0
- package/lib/components/Header/HeaderSearch.tsx +44 -0
- package/lib/components/Header/globalMenu.module.css +28 -0
- package/lib/components/Header/header.module.css +39 -0
- package/lib/components/Header/headerButton.module.css +35 -0
- package/lib/components/Header/headerLogo.module.css +24 -0
- package/lib/components/Header/headerSearch.module.css +30 -0
- package/lib/components/Header/index.tsx +5 -0
- package/lib/components/Icon/CheckboxIcon.stories.ts +25 -0
- package/lib/components/Icon/CheckboxIcon.tsx +29 -0
- package/lib/components/Icon/Icon.stories.ts +24 -0
- package/lib/components/Icon/Icon.tsx +23 -0
- package/lib/components/Icon/RadioIcon.stories.ts +25 -0
- package/lib/components/Icon/RadioIcon.tsx +29 -0
- package/lib/components/Icon/SvgIcon.tsx +18 -0
- package/lib/components/Icon/__AkselIcon.tsx +37 -0
- package/lib/components/Icon/checkboxIcon.module.css +21 -0
- package/lib/components/Icon/icon.module.css +4 -0
- package/lib/components/Icon/iconsMap.tsx +2078 -0
- package/lib/components/Icon/index.ts +5 -0
- package/lib/components/Icon/radioIcon.module.css +21 -0
- package/lib/components/Layout/Layout.stories.ts +127 -0
- package/lib/components/Layout/Layout.tsx +40 -0
- package/lib/components/Layout/LayoutBase.stories.ts +17 -0
- package/lib/components/Layout/LayoutBase.tsx +30 -0
- package/lib/components/Layout/LayoutBody.stories.ts +17 -0
- package/lib/components/Layout/LayoutBody.tsx +16 -0
- package/lib/components/Layout/LayoutContent.stories.ts +17 -0
- package/lib/components/Layout/LayoutContent.tsx +15 -0
- package/lib/components/Layout/LayoutSidebar.stories.ts +17 -0
- package/lib/components/Layout/LayoutSidebar.tsx +16 -0
- package/lib/components/Layout/index.tsx +4 -0
- package/lib/components/Layout/layout.module.css +63 -0
- package/lib/components/Menu/Menu.stories.ts +495 -0
- package/lib/components/Menu/Menu.tsx +123 -0
- package/lib/components/Menu/MenuBase.tsx +17 -0
- package/lib/components/Menu/MenuGroup.tsx +18 -0
- package/lib/components/Menu/MenuHeader.tsx +13 -0
- package/lib/components/Menu/MenuItem.stories.ts +127 -0
- package/lib/components/Menu/MenuItem.tsx +58 -0
- package/lib/components/Menu/MenuItemBase.tsx +62 -0
- package/lib/components/Menu/MenuItemLabel.tsx +30 -0
- package/lib/components/Menu/MenuItemMedia.tsx +42 -0
- package/lib/components/Menu/MenuOption.stories.ts +50 -0
- package/lib/components/Menu/MenuOption.tsx +45 -0
- package/lib/components/Menu/MenuSearch.stories.ts +18 -0
- package/lib/components/Menu/MenuSearch.tsx +25 -0
- package/lib/components/Menu/index.ts +10 -0
- package/lib/components/Menu/menu.module.css +26 -0
- package/lib/components/Menu/menuHeader.module.css +12 -0
- package/lib/components/Menu/menuItem.module.css +136 -0
- package/lib/components/Menu/menuOption.module.css +29 -0
- package/lib/components/Menu/menuSearch.module.css +29 -0
- package/lib/components/Menu/useClickOutside.ts +21 -0
- package/lib/components/Menu/useEscapeKey.ts +16 -0
- package/lib/components/Toolbar/Toolbar.stories.tsx +188 -0
- package/lib/components/Toolbar/Toolbar.tsx +138 -0
- package/lib/components/Toolbar/ToolbarAdd.stories.ts +25 -0
- package/lib/components/Toolbar/ToolbarAdd.tsx +25 -0
- package/lib/components/Toolbar/ToolbarBase.tsx +27 -0
- package/lib/components/Toolbar/ToolbarButton.stories.ts +32 -0
- package/lib/components/Toolbar/ToolbarButton.tsx +65 -0
- package/lib/components/Toolbar/ToolbarFilter.stories.ts +66 -0
- package/lib/components/Toolbar/ToolbarFilter.tsx +70 -0
- package/lib/components/Toolbar/ToolbarMenu.stories.ts +37 -0
- package/lib/components/Toolbar/ToolbarMenu.tsx +28 -0
- package/lib/components/Toolbar/ToolbarOptions.stories.ts +108 -0
- package/lib/components/Toolbar/ToolbarOptions.tsx +61 -0
- package/lib/components/Toolbar/ToolbarSearch.stories.ts +19 -0
- package/lib/components/Toolbar/ToolbarSearch.tsx +24 -0
- package/lib/components/Toolbar/index.js +3 -0
- package/lib/components/Toolbar/toolbar.module.css +43 -0
- package/lib/components/Toolbar/toolbarButton.module.css +3 -0
- package/lib/components/Toolbar/toolbarSearch.module.css +28 -0
- package/lib/components/index.ts +1 -0
- package/lib/css/colors.css +113 -0
- package/lib/css/global.css +12 -0
- package/lib/css/theme-company.css +15 -0
- package/lib/css/theme-global.css +15 -0
- package/lib/css/theme-neutral.css +15 -0
- package/lib/css/theme-person.css +15 -0
- package/lib/css/theme.css +24 -0
- package/lib/index.ts +1 -0
- package/package.json +52 -0
- package/tsconfig.json +23 -0
- package/tsconfig.node.json +11 -0
- package/typings.d.ts +1 -0
- package/vite.config.ts +20 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ChangeEventHandler, MouseEventHandler } from 'react';
|
|
2
|
+
import type { MenuOptionProps } from '../Menu';
|
|
3
|
+
import { ToolbarButton } from './ToolbarButton';
|
|
4
|
+
import { ToolbarOptions } from './ToolbarOptions';
|
|
5
|
+
import styles from './toolbar.module.css';
|
|
6
|
+
|
|
7
|
+
type ToolbarFilterValue = (string | number)[];
|
|
8
|
+
export interface ToolbarFilterProps {
|
|
9
|
+
name: string;
|
|
10
|
+
options: MenuOptionProps[];
|
|
11
|
+
label: string;
|
|
12
|
+
value?: ToolbarFilterValue;
|
|
13
|
+
optionType: 'checkbox' | 'radio';
|
|
14
|
+
expanded?: boolean;
|
|
15
|
+
removable?: boolean;
|
|
16
|
+
getSelectedLabel?: (name: string, value?: ToolbarFilterValue) => string;
|
|
17
|
+
className?: string;
|
|
18
|
+
onChange?: ChangeEventHandler;
|
|
19
|
+
onToggle?: MouseEventHandler;
|
|
20
|
+
onRemove?: MouseEventHandler;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const defaultGetSelectedLabel = (_: string, value?: ToolbarFilterValue) => {
|
|
24
|
+
if (Array.isArray(value)) {
|
|
25
|
+
return value.join(', ');
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const ToolbarFilter = ({
|
|
31
|
+
expanded,
|
|
32
|
+
removable,
|
|
33
|
+
label,
|
|
34
|
+
name,
|
|
35
|
+
value,
|
|
36
|
+
options,
|
|
37
|
+
onToggle,
|
|
38
|
+
onChange,
|
|
39
|
+
onRemove,
|
|
40
|
+
getSelectedLabel,
|
|
41
|
+
optionType,
|
|
42
|
+
}: ToolbarFilterProps) => {
|
|
43
|
+
const filterOptions = (options ?? []).map(
|
|
44
|
+
(item): MenuOptionProps => ({
|
|
45
|
+
...item,
|
|
46
|
+
name,
|
|
47
|
+
checked: Array.isArray(value) ? value.includes(item.value) : item.value === value,
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const valueLabel = getSelectedLabel?.(name, value) ?? defaultGetSelectedLabel(name, value);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className={styles.toggle}>
|
|
55
|
+
<ToolbarButton
|
|
56
|
+
as="div"
|
|
57
|
+
type="select"
|
|
58
|
+
removable={removable}
|
|
59
|
+
active={Array.isArray(value) ? value.length > 0 : typeof value !== 'undefined'}
|
|
60
|
+
onToggle={onToggle}
|
|
61
|
+
onRemove={onRemove}
|
|
62
|
+
>
|
|
63
|
+
{valueLabel || label}
|
|
64
|
+
</ToolbarButton>
|
|
65
|
+
<div className={styles.dropdown} aria-expanded={expanded}>
|
|
66
|
+
<ToolbarOptions options={filterOptions} onChange={onChange} optionType={optionType} />
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { fn } from '@storybook/test';
|
|
3
|
+
|
|
4
|
+
import { ToolbarMenu } from './ToolbarMenu';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Toolbar/ToolbarMenu',
|
|
8
|
+
component: ToolbarMenu,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {},
|
|
11
|
+
args: {
|
|
12
|
+
label: 'Skattetetaten',
|
|
13
|
+
value: 'skatt',
|
|
14
|
+
items: [
|
|
15
|
+
{
|
|
16
|
+
title: 'Skatteetaten',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: 'Digdir',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: 'Helstilsynet',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
} satisfies Meta<typeof ToolbarMenu>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
|
|
31
|
+
export const Default: Story = {};
|
|
32
|
+
|
|
33
|
+
export const Expanded: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
expanded: true,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { MouseEventHandler } from 'react';
|
|
2
|
+
import { Menu, type MenuGroups, type MenuItemProps, type MenuSearchProps } from '../Menu';
|
|
3
|
+
import { ToolbarButton } from './ToolbarButton';
|
|
4
|
+
import styles from './toolbar.module.css';
|
|
5
|
+
|
|
6
|
+
export interface ToolbarMenuProps {
|
|
7
|
+
onToggle?: MouseEventHandler;
|
|
8
|
+
label: string;
|
|
9
|
+
value: string | number;
|
|
10
|
+
items: MenuItemProps[];
|
|
11
|
+
groups?: MenuGroups;
|
|
12
|
+
search?: MenuSearchProps;
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const ToolbarMenu = ({ expanded = false, onToggle, label, value, groups, search, items }: ToolbarMenuProps) => {
|
|
18
|
+
return (
|
|
19
|
+
<div className={styles.toggle}>
|
|
20
|
+
<ToolbarButton as="div" type="switch" onToggle={onToggle} active={!!value}>
|
|
21
|
+
{label}
|
|
22
|
+
</ToolbarButton>
|
|
23
|
+
<div className={styles.dropdown} aria-expanded={expanded}>
|
|
24
|
+
<Menu theme="global" defaultItemColor="subtle" groups={groups} search={search} items={items} />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ToolbarOptions } from './ToolbarOptions';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Toolbar/ToolbarOptions',
|
|
6
|
+
component: ToolbarOptions,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: {},
|
|
9
|
+
args: {},
|
|
10
|
+
} satisfies Meta<typeof ToolbarOptions>;
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
|
|
15
|
+
export const Checkboxes: Story = {
|
|
16
|
+
args: {
|
|
17
|
+
optionType: 'checkbox',
|
|
18
|
+
options: [
|
|
19
|
+
{
|
|
20
|
+
type: 'checkbox',
|
|
21
|
+
label: 'Skatteetaten',
|
|
22
|
+
value: '1',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'checkbox',
|
|
26
|
+
label: 'Digdir',
|
|
27
|
+
value: '2',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'checkbox',
|
|
31
|
+
checked: true,
|
|
32
|
+
label: 'Helstilsynet',
|
|
33
|
+
value: '3',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Radio: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
optionType: 'radio',
|
|
42
|
+
options: [
|
|
43
|
+
{
|
|
44
|
+
type: 'radio',
|
|
45
|
+
label: 'Skatteetaten',
|
|
46
|
+
value: '1',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 'radio',
|
|
50
|
+
label: 'Digdir',
|
|
51
|
+
value: '2',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: 'radio',
|
|
55
|
+
checked: true,
|
|
56
|
+
label: 'Helstilsynet',
|
|
57
|
+
value: '3',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const RadioCheckbox: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
optionGroups: {
|
|
66
|
+
a: {
|
|
67
|
+
title: 'Velg skadedyr',
|
|
68
|
+
optionType: 'radio',
|
|
69
|
+
},
|
|
70
|
+
b: {
|
|
71
|
+
title: 'Velg straff',
|
|
72
|
+
optionType: 'checkbox',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
options: [
|
|
76
|
+
{
|
|
77
|
+
group: 'a',
|
|
78
|
+
name: 'animal',
|
|
79
|
+
label: 'Katt',
|
|
80
|
+
value: 'cat',
|
|
81
|
+
checked: true,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
group: 'a',
|
|
85
|
+
name: 'animal',
|
|
86
|
+
label: 'Mus',
|
|
87
|
+
value: 'mouse',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
group: 'a',
|
|
91
|
+
name: 'animal',
|
|
92
|
+
label: 'Veggdyr',
|
|
93
|
+
value: 'spider',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
group: 'b',
|
|
97
|
+
label: 'Husarrest',
|
|
98
|
+
value: 'digdir',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
group: 'b',
|
|
102
|
+
checked: true,
|
|
103
|
+
label: 'Piskeslag',
|
|
104
|
+
value: 'helse',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ChangeEventHandler } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
MenuBase,
|
|
4
|
+
MenuGroup,
|
|
5
|
+
MenuHeader,
|
|
6
|
+
MenuOption,
|
|
7
|
+
type MenuOptionProps,
|
|
8
|
+
MenuSearch,
|
|
9
|
+
type MenuSearchProps,
|
|
10
|
+
} from '../Menu';
|
|
11
|
+
|
|
12
|
+
export type ToolbarOptionType = 'checkbox' | 'radio';
|
|
13
|
+
|
|
14
|
+
export interface OptionGroup {
|
|
15
|
+
title?: string;
|
|
16
|
+
optionType?: ToolbarOptionType;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ToolbarOptionsProps {
|
|
20
|
+
options: MenuOptionProps[];
|
|
21
|
+
onChange?: ChangeEventHandler;
|
|
22
|
+
search?: MenuSearchProps;
|
|
23
|
+
optionType: ToolbarOptionType;
|
|
24
|
+
optionGroups?: { [key: string]: OptionGroup };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const ToolbarOptions = ({ search, optionGroups, options, onChange, optionType }: ToolbarOptionsProps) => {
|
|
28
|
+
const sections = options.reduce(
|
|
29
|
+
(acc, option) => {
|
|
30
|
+
const group = option.group || '';
|
|
31
|
+
acc[group] = acc[group] || [];
|
|
32
|
+
acc[group].push(option);
|
|
33
|
+
return acc;
|
|
34
|
+
},
|
|
35
|
+
{} as Record<string, MenuOptionProps[]>,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<MenuBase theme="global">
|
|
40
|
+
{search && <MenuSearch {...search} />}
|
|
41
|
+
{Object.keys(sections)?.map((key) => {
|
|
42
|
+
const headerTitle = optionGroups?.[key]?.title;
|
|
43
|
+
return (
|
|
44
|
+
<MenuGroup key={key}>
|
|
45
|
+
{headerTitle && <MenuHeader title={headerTitle} />}
|
|
46
|
+
{sections[key]?.map((item) => (
|
|
47
|
+
<MenuOption
|
|
48
|
+
key={item.value}
|
|
49
|
+
onChange={onChange}
|
|
50
|
+
label={item.label}
|
|
51
|
+
type={optionGroups?.[key]?.optionType || optionType}
|
|
52
|
+
value={item.value}
|
|
53
|
+
checked={item.checked}
|
|
54
|
+
/>
|
|
55
|
+
))}
|
|
56
|
+
</MenuGroup>
|
|
57
|
+
);
|
|
58
|
+
})}
|
|
59
|
+
</MenuBase>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { fn } from '@storybook/test';
|
|
3
|
+
|
|
4
|
+
import { ToolbarSearch } from './ToolbarSearch';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Toolbar/ToolbarSearch',
|
|
8
|
+
component: ToolbarSearch,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {},
|
|
11
|
+
args: {},
|
|
12
|
+
} satisfies Meta<typeof ToolbarSearch>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {},
|
|
19
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ChangeEventHandler } from 'react';
|
|
2
|
+
import styles from './toolbarSearch.module.css';
|
|
3
|
+
|
|
4
|
+
export interface ToolbarSearchProps {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: ChangeEventHandler;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const ToolbarSearch = ({ value, name, placeholder = 'Søk', onChange }: ToolbarSearchProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<div className={styles.field}>
|
|
14
|
+
<input
|
|
15
|
+
type="search"
|
|
16
|
+
value={value}
|
|
17
|
+
name={name}
|
|
18
|
+
placeholder={placeholder}
|
|
19
|
+
className={styles.input}
|
|
20
|
+
onChange={onChange}
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.input {
|
|
2
|
+
font-size: 0.875rem;
|
|
3
|
+
line-height: 1rem;
|
|
4
|
+
font-weight: 600;
|
|
5
|
+
padding: 9px;
|
|
6
|
+
border-radius: 2px;
|
|
7
|
+
border: 1px solid;
|
|
8
|
+
border-color: var(--theme-border-default);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.button[aria-selected="true"] {
|
|
12
|
+
background-color: var(--theme-background-subtle);
|
|
13
|
+
color: var(--theme-text-default);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.close {
|
|
17
|
+
padding: 6px 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.icon {
|
|
21
|
+
border-left: 1px solid;
|
|
22
|
+
border-color: var(--theme-background-subtle);
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
font-size: 1.25rem;
|
|
27
|
+
padding: 0 6px;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Avatar';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--colors-neutral-1: #ffffff;
|
|
3
|
+
--colors-neutral-2: #f3f4f5;
|
|
4
|
+
--colors-neutral-3: #e2e3e5;
|
|
5
|
+
--colors-neutral-4: #cfd1d4;
|
|
6
|
+
--colors-neutral-5: #bec1c6;
|
|
7
|
+
--colors-neutral-6: #b9bcc1;
|
|
8
|
+
--colors-neutral-7: #7c818b;
|
|
9
|
+
--colors-neutral-8: #464e5c;
|
|
10
|
+
--colors-neutral-9: #212b3b;
|
|
11
|
+
--colors-neutral-10: #333c4a;
|
|
12
|
+
--colors-neutral-11: #464e5c;
|
|
13
|
+
--colors-neutral-12: #5d6470;
|
|
14
|
+
--colors-neutral-13: #232c3c;
|
|
15
|
+
|
|
16
|
+
--colors-company-1: #ffffff;
|
|
17
|
+
--colors-company-2: #e9f5ff;
|
|
18
|
+
--colors-company-3: #d3eafd;
|
|
19
|
+
--colors-company-4: #a5d6fb;
|
|
20
|
+
--colors-company-5: #78c1f9;
|
|
21
|
+
--colors-company-6: #4badf7;
|
|
22
|
+
--colors-company-7: #1e98f5;
|
|
23
|
+
--colors-company-8: #4086d7;
|
|
24
|
+
--colors-company-9: #111d46;
|
|
25
|
+
--colors-company-10: #364163;
|
|
26
|
+
--colors-company-11: #166aac;
|
|
27
|
+
--colors-company-12: #5a637f;
|
|
28
|
+
--colors-company-13: #1e2950;
|
|
29
|
+
|
|
30
|
+
--colors-person-1: #ffffff;
|
|
31
|
+
--colors-person-2: #eaf7ef;
|
|
32
|
+
--colors-person-3: #a8f3d0;
|
|
33
|
+
--colors-person-4: #6ee7b7;
|
|
34
|
+
--colors-person-5: #34d399;
|
|
35
|
+
--colors-person-6: #10b981;
|
|
36
|
+
--colors-person-7: #079669;
|
|
37
|
+
--colors-person-8: #347659;
|
|
38
|
+
--colors-person-9: #084826;
|
|
39
|
+
--colors-person-10: #076046;
|
|
40
|
+
--colors-person-11: #3b6d52;
|
|
41
|
+
--colors-person-12: #3b6d52;
|
|
42
|
+
--colors-person-13: #06331b;
|
|
43
|
+
|
|
44
|
+
/* link **/
|
|
45
|
+
|
|
46
|
+
--link-base-default: #2a4dd0;
|
|
47
|
+
--link-base-hover: #213ca3;
|
|
48
|
+
--link-base-active: #192d7b;
|
|
49
|
+
|
|
50
|
+
/* global */
|
|
51
|
+
|
|
52
|
+
--global-background-default: var(--colors-neutral-2);
|
|
53
|
+
--global-background-subtle: var(--colors-neutral-1);
|
|
54
|
+
--global-base-default: var(--colors-neutral-9);
|
|
55
|
+
--global-base-hover: var(--colors-neutral-10);
|
|
56
|
+
--global-base-active: var(--colors-neutral-11);
|
|
57
|
+
--global-border-default: var(--colors-neutral-7);
|
|
58
|
+
--global-border-strong: var(--colors-neutral-8);
|
|
59
|
+
--global-border-subtle: var(--colors-neutral-6);
|
|
60
|
+
--global-surface-active: var(--colors-neutral-5);
|
|
61
|
+
--global-surface-default: var(--colors-neutral-3);
|
|
62
|
+
--global-surface-hover: var(--colors-neutral-4);
|
|
63
|
+
--global-text-default: var(--colors-neutral-13);
|
|
64
|
+
--global-text-subtle: var(--colors-neutral-12);
|
|
65
|
+
|
|
66
|
+
/* neutral */
|
|
67
|
+
|
|
68
|
+
--neutral-background-default: var(--colors-neutral-1);
|
|
69
|
+
--neutral-background-subtle: var(--colors-neutral-2);
|
|
70
|
+
--neutral-base-default: var(--colors-neutral-9);
|
|
71
|
+
--neutral-base-hover: var(--colors-neutral-10);
|
|
72
|
+
--neutral-base-active: var(--colors-neutral-11);
|
|
73
|
+
--neutral-border-default: var(--colors-neutral-7);
|
|
74
|
+
--neutral-border-strong: var(--colors-neutral-8);
|
|
75
|
+
--neutral-border-subtle: var(--colors-neutral-6);
|
|
76
|
+
--neutral-surface-active: var(--colors-neutral-5);
|
|
77
|
+
--neutral-surface-default: var(--colors-neutral-3);
|
|
78
|
+
--neutral-surface-hover: var(--colors-neutral-4);
|
|
79
|
+
--neutral-text-default: var(--colors-neutral-13);
|
|
80
|
+
--neutral-text-subtle: var(--colors-neutral-12);
|
|
81
|
+
|
|
82
|
+
/* company */
|
|
83
|
+
|
|
84
|
+
--company-background-default: var(--colors-company-1);
|
|
85
|
+
--company-background-subtle: var(--colors-company-2);
|
|
86
|
+
--company-base-default: var(--colors-company-9);
|
|
87
|
+
--company-base-hover: var(--colors-company-10);
|
|
88
|
+
--company-base-active: var(--colors-company-11);
|
|
89
|
+
--company-border-default: var(--colors-company-7);
|
|
90
|
+
--company-border-strong: var(--colors-company-8);
|
|
91
|
+
--company-border-subtle: var(--colors-company-6);
|
|
92
|
+
--company-surface-active: var(--colors-company-5);
|
|
93
|
+
--company-surface-default: var(--colors-company-3);
|
|
94
|
+
--company-surface-hover: var(--colors-company-4);
|
|
95
|
+
--company-text-default: var(--colors-company-13);
|
|
96
|
+
--company-text-subtle: var(--colors-company-12);
|
|
97
|
+
|
|
98
|
+
/* person */
|
|
99
|
+
|
|
100
|
+
--person-background-default: var(--colors-person-1);
|
|
101
|
+
--person-background-subtle: var(--colors-person-2);
|
|
102
|
+
--person-base-default: var(--colors-person-9);
|
|
103
|
+
--person-base-hover: var(--colors-person-10);
|
|
104
|
+
--person-base-active: var(--colors-person-11);
|
|
105
|
+
--person-border-default: var(--colors-person-7);
|
|
106
|
+
--person-border-strong: var(--colors-person-8);
|
|
107
|
+
--person-border-subtle: var(--colors-person-6);
|
|
108
|
+
--person-surface-active: var(--colors-person-5);
|
|
109
|
+
--person-surface-default: var(--colors-person-3);
|
|
110
|
+
--person-surface-hover: var(--colors-person-4);
|
|
111
|
+
--person-text-default: var(--colors-person-13);
|
|
112
|
+
--person-text-subtle: var(--colors-person-12);
|
|
113
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@import "https://altinncdn.no/fonts/inter/inter.css";
|
|
2
|
+
@import "./colors.css";
|
|
3
|
+
@import "./theme-global.css";
|
|
4
|
+
@import "./theme-neutral.css";
|
|
5
|
+
@import "./theme-company.css";
|
|
6
|
+
@import "./theme-person.css";
|
|
7
|
+
@import "./theme.css";
|
|
8
|
+
|
|
9
|
+
* {
|
|
10
|
+
font-family: "Inter", sans-serif;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[data-theme="company"] {
|
|
2
|
+
--theme-background-default: var(--company-background-default);
|
|
3
|
+
--theme-background-subtle: var(--company-background-subtle);
|
|
4
|
+
--theme-base-active: var(--company-base-active);
|
|
5
|
+
--theme-base-default: var(--company-base-default);
|
|
6
|
+
--theme-base-hover: var(--company-base-hover);
|
|
7
|
+
--theme-border-default: var(--company-border-default);
|
|
8
|
+
--theme-border-strong: var(--company-border-strong);
|
|
9
|
+
--theme-border-subtle: var(--company-border-subtle);
|
|
10
|
+
--theme-surface-active: var(--company-surface-active);
|
|
11
|
+
--theme-surface-default: var(--company-surface-default);
|
|
12
|
+
--theme-surface-hover: var(--company-surface-hover);
|
|
13
|
+
--theme-text-default: var(--company-text-default);
|
|
14
|
+
--theme-text-subtle: var(--company-text-subtle);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[data-theme="global"] {
|
|
2
|
+
--theme-background-default: var(--neutral-background-subtle);
|
|
3
|
+
--theme-background-subtle: var(--neutral-background-default);
|
|
4
|
+
--theme-base-active: var(--company-base-active);
|
|
5
|
+
--theme-base-default: var(--company-base-default);
|
|
6
|
+
--theme-base-hover: var(--company-base-hover);
|
|
7
|
+
--theme-border-default: var(--neutral-border-default);
|
|
8
|
+
--theme-border-strong: var(--neutral-border-strong);
|
|
9
|
+
--theme-border-subtle: var(--neutral-border-subtle);
|
|
10
|
+
--theme-surface-active: var(--neutral-surface-active);
|
|
11
|
+
--theme-surface-default: var(--neutral-surface-default);
|
|
12
|
+
--theme-surface-hover: var(--neutral-surface-hover);
|
|
13
|
+
--theme-text-default: var(--neutral-text-default);
|
|
14
|
+
--theme-text-subtle: var(--neutral-text-subtle);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[data-theme="neutral"] {
|
|
2
|
+
--theme-background-default: var(--neutral-background-default);
|
|
3
|
+
--theme-background-subtle: var(--neutral-background-subtle);
|
|
4
|
+
--theme-base-active: var(--neutral-base-active);
|
|
5
|
+
--theme-base-default: var(--neutral-base-default);
|
|
6
|
+
--theme-base-hover: var(--neutral-base-hover);
|
|
7
|
+
--theme-border-default: var(--neutral-border-default);
|
|
8
|
+
--theme-border-strong: var(--neutral-border-strong);
|
|
9
|
+
--theme-border-subtle: var(--neutral-border-subtle);
|
|
10
|
+
--theme-surface-active: var(--neutral-surface-active);
|
|
11
|
+
--theme-surface-default: var(--neutral-surface-default);
|
|
12
|
+
--theme-surface-hover: var(--neutral-surface-hover);
|
|
13
|
+
--theme-text-default: var(--neutral-text-default);
|
|
14
|
+
--theme-text-subtle: var(--neutral-text-subtle);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[data-theme="person"] {
|
|
2
|
+
--theme-background-default: var(--person-background-default);
|
|
3
|
+
--theme-background-subtle: var(--person-background-subtle);
|
|
4
|
+
--theme-base-active: var(--person-base-active);
|
|
5
|
+
--theme-base-default: var(--person-base-default);
|
|
6
|
+
--theme-base-hover: var(--person-base-hover);
|
|
7
|
+
--theme-border-default: var(--person-border-default);
|
|
8
|
+
--theme-border-strong: var(--person-border-strong);
|
|
9
|
+
--theme-border-subtle: var(--person-border-subtle);
|
|
10
|
+
--theme-surface-active: var(--person-surface-active);
|
|
11
|
+
--theme-surface-default: var(--person-surface-default);
|
|
12
|
+
--theme-surface-hover: var(--person-surface-hover);
|
|
13
|
+
--theme-text-default: var(--person-text-default);
|
|
14
|
+
--theme-text-subtle: var(--person-text-subtle);
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--theme-background-default: var(--global-background-default);
|
|
3
|
+
--theme-background-subtle: var(--global-background-subtle);
|
|
4
|
+
--theme-base-active: var(--global-base-active);
|
|
5
|
+
--theme-base-default: var(--global-base-default);
|
|
6
|
+
--theme-base-hover: var(--global-base-hover);
|
|
7
|
+
--theme-border-default: var(--global-border-default);
|
|
8
|
+
--theme-border-strong: var(--global-border-strong);
|
|
9
|
+
--theme-border-subtle: var(--global-border-subtle);
|
|
10
|
+
--theme-surface-active: var(--global-surface-active);
|
|
11
|
+
--theme-surface-default: var(--global-surface-default);
|
|
12
|
+
--theme-surface-hover: var(--global-surface-hover);
|
|
13
|
+
--theme-text-default: var(--global-text-default);
|
|
14
|
+
--theme-text-subtle: var(--global-text-subtle);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
body {
|
|
18
|
+
background: var(--neutral-background-default);
|
|
19
|
+
color: var(--neutral-text-default);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
body[data-theme] {
|
|
23
|
+
background: var(--theme-background-subtle);
|
|
24
|
+
}
|
package/lib/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|