@altinn/altinn-components 0.8.2 → 0.9.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/dist/assets/ContextMenu.css +1 -0
- package/dist/assets/DialogListItem.css +1 -0
- package/dist/assets/ListItemControls.css +1 -0
- package/dist/assets/ListItemHeader.css +1 -0
- package/dist/assets/ListItemMenu.css +1 -0
- package/dist/assets/ScopeListItem.css +1 -0
- package/dist/components/Bookmarks/BookmarksList.js +2 -1
- package/dist/components/Bookmarks/BookmarksListItem.js +6 -4
- package/dist/components/Bookmarks/BookmarksListItem.stories.js +15 -14
- package/dist/components/Bookmarks/BookmarksSection.js +1 -1
- package/dist/components/Bookmarks/index.js +4 -4
- package/dist/components/Button/Buttons.stories.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +39 -5
- package/dist/components/ContextMenu/ContextMenu.stories.js +8 -8
- package/dist/components/ContextMenu/index.js +1 -1
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/Dialog/DialogActions.js +1 -1
- package/dist/components/Dialog/DialogGroup.js +1 -1
- package/dist/components/Dialog/DialogHistory.js +1 -1
- package/dist/components/Dialog/DialogList.js +6 -5
- package/dist/components/Dialog/DialogListItem.js +89 -12
- package/dist/components/Dialog/DialogListItem.stories.js +24 -23
- package/dist/components/Dialog/DialogNav.js +11 -11
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Dropdown/DrawerBase.d.ts +2 -2
- package/dist/components/Dropdown/DrawerBase.js +1 -1
- package/dist/components/Dropdown/DrawerButton.js +1 -1
- package/dist/components/Dropdown/DrawerOrDropdown.d.ts +4 -4
- package/dist/components/Dropdown/DrawerOrDropdown.js +22 -16
- package/dist/components/Dropdown/DropdownBase.d.ts +3 -2
- package/dist/components/Dropdown/DropdownBase.js +28 -21
- package/dist/components/GlobalMenu/AccountButton.js +1 -1
- package/dist/components/GlobalMenu/AccountMenu.js +1 -1
- package/dist/components/GlobalMenu/BackButton.js +1 -1
- package/dist/components/GlobalMenu/GlobalMenu.js +1 -1
- package/dist/components/Header/Header.js +24 -27
- package/dist/components/Header/HeaderBase.js +1 -1
- package/dist/components/History/HistoryItem.js +1 -1
- package/dist/components/Layout/Layout.js +1 -1
- package/dist/components/Layout/Layout.stories.js +10 -9
- package/dist/components/LayoutAction/ActionMenu.js +1 -1
- package/dist/components/List/List.js +5 -4
- package/dist/components/List/List.stories.js +1 -1
- package/dist/components/List/ListItem.js +47 -4
- package/dist/components/List/ListItem.stories.js +25 -23
- package/dist/components/List/ListItemControls.js +15 -5
- package/dist/components/List/ListItemHeader.js +73 -7
- package/dist/components/List/ListItemHeader.stories.js +20 -19
- package/dist/components/List/ListItemMenu.js +6 -3
- package/dist/components/List/index.js +14 -12
- package/dist/components/Menu/Menu.js +9 -9
- package/dist/components/Menu/MenuItem.stories.js +1 -1
- package/dist/components/Menu/MenuItems.js +63 -8
- package/dist/components/Menu/MenuItems.stories.js +1 -1
- package/dist/components/Menu/MenuSearch.js +1 -1
- package/dist/components/Menu/index.js +7 -7
- package/dist/components/Page/PageHeader.js +1 -1
- package/dist/components/ResourceList/ResourceList.d.ts +6 -0
- package/dist/components/ResourceList/ResourceList.js +12 -0
- package/dist/components/ResourceList/ResourceList.stories.js +270 -0
- package/dist/components/ResourceList/ResourceListItem.d.ts +11 -0
- package/dist/components/ResourceList/ResourceListItem.js +32 -0
- package/dist/components/ResourceList/ResourceListItem.stories.js +33 -0
- package/dist/components/ResourceList/index.d.ts +2 -0
- package/dist/components/ResourceList/index.js +6 -0
- package/dist/components/RootProvider/RootProvider.js +16 -15
- package/dist/components/Searchbar/Autocomplete.d.ts +2 -1
- package/dist/components/Searchbar/Autocomplete.js +39 -7
- package/dist/components/Searchbar/Autocomplete.stories.js +2 -2
- package/dist/components/Searchbar/AutocompleteItem.d.ts +1 -0
- package/dist/components/Searchbar/AutocompleteItem.js +21 -3
- package/dist/components/Searchbar/ScopeListItem.d.ts +1 -1
- package/dist/components/Searchbar/ScopeListItem.js +7 -3
- package/dist/components/Searchbar/Searchbar.js +16 -25
- package/dist/components/Toolbar/Toolbar.d.ts +2 -1
- package/dist/components/Toolbar/Toolbar.js +62 -63
- package/dist/components/Toolbar/Toolbar.stories.js +18 -15
- package/dist/components/Toolbar/ToolbarAdd.d.ts +2 -4
- package/dist/components/Toolbar/ToolbarAdd.js +15 -12
- package/dist/components/Toolbar/ToolbarBase.d.ts +0 -2
- package/dist/components/Toolbar/ToolbarDaterange.js +12 -12
- package/dist/components/Toolbar/ToolbarFilter.d.ts +3 -3
- package/dist/components/Toolbar/ToolbarFilter.js +42 -42
- package/dist/components/Toolbar/ToolbarMenu.d.ts +2 -4
- package/dist/components/Toolbar/ToolbarMenu.js +15 -12
- package/dist/components/Toolbar/ToolbarOptions.js +1 -1
- package/dist/components/Toolbar/ToolbarSearch.d.ts +2 -2
- package/dist/components/Toolbar/ToolbarSearch.js +1 -1
- package/dist/components/Transmission/TransmissionItem.js +14 -13
- package/dist/components/Transmission/TransmissionList.js +1 -1
- package/dist/components/Transmission/TransmissionSection.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +241 -231
- package/dist/hooks/useClickOutside.d.ts +1 -1
- package/dist/hooks/useClickOutside.js +6 -6
- package/dist/index.js +251 -241
- package/package.json +1 -1
- package/dist/Autocomplete-Cb9fQrzy.js +0 -367
- package/dist/assets/Autocomplete.css +0 -1
- package/dist/components/ContextMenu/ContextMenuBase.d.ts +0 -12
- package/dist/components/ContextMenu/ContextMenuBase.js +0 -11
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { ResourceList as n } from "./ResourceList.js";
|
|
2
|
+
const o = [
|
|
3
|
+
{
|
|
4
|
+
identifier: "se_SMUTFL_1",
|
|
5
|
+
resourceName: "Lese Samordnet registermelding - utfylling",
|
|
6
|
+
ownerName: "Brønnøysundregistrene",
|
|
7
|
+
ownerOrgCode: "brg",
|
|
8
|
+
ownerImageUrl: "https://altinncdn.no/orgs/brg/brreg.png"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
identifier: "se_5899_1",
|
|
12
|
+
resourceName: "Signering av digital innsending",
|
|
13
|
+
ownerName: "Brønnøysundregistrene",
|
|
14
|
+
ownerOrgCode: "brg",
|
|
15
|
+
ownerImageUrl: "https://altinncdn.no/orgs/brg/brreg.png"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
identifier: "se_3776_1",
|
|
19
|
+
resourceName: "Global Legal Entity Identifier Norway - signering",
|
|
20
|
+
ownerName: "Brønnøysundregistrene",
|
|
21
|
+
ownerOrgCode: "brg",
|
|
22
|
+
ownerImageUrl: "https://altinncdn.no/orgs/brg/brreg.png"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
identifier: "se_5059_1",
|
|
26
|
+
resourceName: "Årlig melding med krav om innsending av dokumentasjon for godkjent renholdsvirksomhet",
|
|
27
|
+
ownerName: "Arbeidstilsynet",
|
|
28
|
+
ownerOrgCode: "dat",
|
|
29
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dat/arbeidstilsynet.png"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
identifier: "se_5059_2",
|
|
33
|
+
resourceName: "Årlig melding for godkjent renholdsvirksomhet",
|
|
34
|
+
ownerName: "Arbeidstilsynet",
|
|
35
|
+
ownerOrgCode: "dat",
|
|
36
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dat/arbeidstilsynet.png"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
identifier: "se_2482_1",
|
|
40
|
+
resourceName: "Forhåndsmelding av arbeidsplass hvor det utføres midlertidig eller skiftende bygge- eller anleggsarbeid",
|
|
41
|
+
ownerName: "Arbeidstilsynet",
|
|
42
|
+
ownerOrgCode: "dat",
|
|
43
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dat/arbeidstilsynet.png"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
identifier: "se_4354_1",
|
|
47
|
+
resourceName: "Generell henvendelse for renholdsvirksomhet",
|
|
48
|
+
ownerName: "Arbeidstilsynet",
|
|
49
|
+
ownerOrgCode: "dat",
|
|
50
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dat/arbeidstilsynet.png"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
identifier: "se_5693_1",
|
|
54
|
+
resourceName: "Søknad om forhåndsgodkjenning av innkvartering i forbindelse med innreisekarantene",
|
|
55
|
+
ownerName: "Arbeidstilsynet",
|
|
56
|
+
ownerOrgCode: "dat",
|
|
57
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dat/arbeidstilsynet.png"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
identifier: "se_4352_2",
|
|
61
|
+
resourceName: "Lese Meldinger til organisasjoner fra DFØ",
|
|
62
|
+
ownerName: "Direktoratet for forvaltning og økonomistyring",
|
|
63
|
+
ownerOrgCode: "dfo",
|
|
64
|
+
ownerImageUrl: null
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
identifier: "se_4351_1",
|
|
68
|
+
resourceName: "Lese Meldinger til privatperson fra DFØ",
|
|
69
|
+
ownerName: "Direktoratet for forvaltning og økonomistyring",
|
|
70
|
+
ownerOrgCode: "dfo",
|
|
71
|
+
ownerImageUrl: null
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
identifier: "se_5786_1",
|
|
75
|
+
resourceName: "Publiser tilskudd i Tilskudd.no",
|
|
76
|
+
ownerName: "Direktoratet for forvaltning og økonomistyring",
|
|
77
|
+
ownerOrgCode: "dfo",
|
|
78
|
+
ownerImageUrl: null
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
identifier: "se_4965_2",
|
|
82
|
+
resourceName: "Erklæring om ansvarsrett",
|
|
83
|
+
ownerName: "Direktoratet for byggkvalitet",
|
|
84
|
+
ownerOrgCode: "dibk",
|
|
85
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dibk/dibk.png"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
identifier: "se_4398_6",
|
|
89
|
+
resourceName: "Gjennomføringsplan",
|
|
90
|
+
ownerName: "Direktoratet for byggkvalitet",
|
|
91
|
+
ownerOrgCode: "dibk",
|
|
92
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dibk/dibk.png"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
identifier: "se_5444_1",
|
|
96
|
+
resourceName: "Kontrollerklæring med sluttrapport",
|
|
97
|
+
ownerName: "Direktoratet for byggkvalitet",
|
|
98
|
+
ownerOrgCode: "dibk",
|
|
99
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dibk/dibk.png"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
identifier: "se_5445_1",
|
|
103
|
+
resourceName: "Kontrollerklæring med sluttrapport",
|
|
104
|
+
ownerName: "Direktoratet for byggkvalitet",
|
|
105
|
+
ownerOrgCode: "dibk",
|
|
106
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dibk/dibk.png"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
identifier: "se_4662_1",
|
|
110
|
+
resourceName: "Melding fra Fellestjenester Bygg",
|
|
111
|
+
ownerName: "Direktoratet for byggkvalitet",
|
|
112
|
+
ownerOrgCode: "dibk",
|
|
113
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dibk/dibk.png"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
identifier: "se_5968_1",
|
|
117
|
+
resourceName: "Varsel til arving",
|
|
118
|
+
ownerName: "Digitaliseringsdirektoratet",
|
|
119
|
+
ownerOrgCode: "digdir",
|
|
120
|
+
ownerImageUrl: ""
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
identifier: "se_5756_1",
|
|
124
|
+
resourceName: "Felles datakatalog - alle kataloger - lesetilgang",
|
|
125
|
+
ownerName: "Digitaliseringsdirektoratet",
|
|
126
|
+
ownerOrgCode: "digdir",
|
|
127
|
+
ownerImageUrl: ""
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
identifier: "se_5755_1",
|
|
131
|
+
resourceName: "Felles datakatalog - alle kataloger - skrivetilgang",
|
|
132
|
+
ownerName: "Digitaliseringsdirektoratet",
|
|
133
|
+
ownerOrgCode: "digdir",
|
|
134
|
+
ownerImageUrl: ""
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
identifier: "se_5913_1",
|
|
138
|
+
resourceName: "Søknad om helse- og omsorgstjeneste - varsel",
|
|
139
|
+
ownerName: "Digitale Helgeland",
|
|
140
|
+
ownerOrgCode: "dihe",
|
|
141
|
+
ownerImageUrl: ""
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
identifier: "se_4290_1",
|
|
145
|
+
resourceName: "Melding om innsendt driftsrapport",
|
|
146
|
+
ownerName: "Direktoratet for mineralforvaltning",
|
|
147
|
+
ownerOrgCode: "dmf",
|
|
148
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dmf/dmf.png"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
identifier: "se_4603_1",
|
|
152
|
+
resourceName: "Melding om avvik",
|
|
153
|
+
ownerName: "Datatilsynet",
|
|
154
|
+
ownerOrgCode: "dpa",
|
|
155
|
+
ownerImageUrl: null
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
identifier: "se_4963_1",
|
|
159
|
+
resourceName: "Registrering av personvernombud",
|
|
160
|
+
ownerName: "Datatilsynet",
|
|
161
|
+
ownerOrgCode: "dpa",
|
|
162
|
+
ownerImageUrl: null
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
identifier: "se_5733_1",
|
|
166
|
+
resourceName: "Avtale om oppbevaring om eksplosiver",
|
|
167
|
+
ownerName: "Direktoratet for samfunnssikkerhet og beredskap",
|
|
168
|
+
ownerOrgCode: "dsb",
|
|
169
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dsb/dsb.png"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
identifier: "se_5732_1",
|
|
173
|
+
resourceName: "Avtale om retur av eksplosiver",
|
|
174
|
+
ownerName: "Direktoratet for samfunnssikkerhet og beredskap",
|
|
175
|
+
ownerOrgCode: "dsb",
|
|
176
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dsb/dsb.png"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
identifier: "se_3354_2",
|
|
180
|
+
resourceName: "Registrering av virksomheter som prosjekterer, utfører, og vedlikeholder elektriske anlegg",
|
|
181
|
+
ownerName: "Direktoratet for samfunnssikkerhet og beredskap",
|
|
182
|
+
ownerOrgCode: "dsb",
|
|
183
|
+
ownerImageUrl: "https://altinncdn.no/orgs/dsb/dsb.png"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
identifier: "se_5925_1",
|
|
187
|
+
resourceName: "Energitilskudd-rapporteringsskjema",
|
|
188
|
+
ownerName: "Enova SF",
|
|
189
|
+
ownerOrgCode: "eno",
|
|
190
|
+
ownerImageUrl: null
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
identifier: "se_5894_1",
|
|
194
|
+
resourceName: "Energitilskuddsordningen",
|
|
195
|
+
ownerName: "Enova SF",
|
|
196
|
+
ownerOrgCode: "eno",
|
|
197
|
+
ownerImageUrl: null
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
identifier: "se_6001_1",
|
|
201
|
+
resourceName: "Akvakulturregisteret",
|
|
202
|
+
ownerName: "Fiskeridirektoratet",
|
|
203
|
+
ownerOrgCode: "fd",
|
|
204
|
+
ownerImageUrl: "https://altinncdn.no/orgs/fd/fiskeridirektoratet.png"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
identifier: "se_5817_1",
|
|
208
|
+
resourceName: "Akvakultursøknad",
|
|
209
|
+
ownerName: "Fiskeridirektoratet",
|
|
210
|
+
ownerOrgCode: "fd",
|
|
211
|
+
ownerImageUrl: "https://altinncdn.no/orgs/fd/fiskeridirektoratet.png"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
identifier: "se_5798_1",
|
|
215
|
+
resourceName: "Søknads- og rapporteringsportal for akvakultur",
|
|
216
|
+
ownerName: "Fiskeridirektoratet",
|
|
217
|
+
ownerOrgCode: "fd",
|
|
218
|
+
ownerImageUrl: "https://altinncdn.no/orgs/fd/fiskeridirektoratet.png"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
identifier: "se_5890_1",
|
|
222
|
+
resourceName: "Korrigering av fangst applikasjon",
|
|
223
|
+
ownerName: "Fiskeridirektoratet",
|
|
224
|
+
ownerOrgCode: "fd",
|
|
225
|
+
ownerImageUrl: "https://altinncdn.no/orgs/fd/fiskeridirektoratet.png"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
identifier: "se_2382_3",
|
|
229
|
+
resourceName: "Månedsrapport biomasse FD-0001 - versjon 3",
|
|
230
|
+
ownerName: "Fiskeridirektoratet",
|
|
231
|
+
ownerOrgCode: "fd",
|
|
232
|
+
ownerImageUrl: "https://altinncdn.no/orgs/fd/fiskeridirektoratet.png"
|
|
233
|
+
}
|
|
234
|
+
], r = o.map((e) => ({
|
|
235
|
+
id: e.identifier,
|
|
236
|
+
ownerName: e.ownerName ?? "",
|
|
237
|
+
resourceName: e.resourceName,
|
|
238
|
+
ownerLogoUrl: e.ownerImageUrl ?? "",
|
|
239
|
+
ownerLogoUrlAlt: `${e.ownerName} logo`
|
|
240
|
+
})), t = {
|
|
241
|
+
title: "List/ResourceList",
|
|
242
|
+
component: n,
|
|
243
|
+
tags: ["autodocs"],
|
|
244
|
+
parameters: {},
|
|
245
|
+
args: {
|
|
246
|
+
spacing: "md",
|
|
247
|
+
items: r,
|
|
248
|
+
size: "md"
|
|
249
|
+
},
|
|
250
|
+
argTypes: {
|
|
251
|
+
size: {
|
|
252
|
+
options: ["sm", "md", "lg"],
|
|
253
|
+
control: {
|
|
254
|
+
type: "inline-radio"
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
spacing: {
|
|
258
|
+
options: ["none", "xs", "sm", "md", "lg"],
|
|
259
|
+
control: {
|
|
260
|
+
type: "inline-radio"
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}, a = {
|
|
265
|
+
args: { items: r }
|
|
266
|
+
};
|
|
267
|
+
export {
|
|
268
|
+
a as Default,
|
|
269
|
+
t as default
|
|
270
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ListItemSize } from '../List';
|
|
2
|
+
export interface ResourceListItemProps {
|
|
3
|
+
id: string;
|
|
4
|
+
ownerName: string;
|
|
5
|
+
resourceName: string;
|
|
6
|
+
ownerLogoUrl?: string;
|
|
7
|
+
ownerLogoUrlAlt?: string;
|
|
8
|
+
size?: ListItemSize;
|
|
9
|
+
controls?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const ResourceListItem: ({ ownerName, resourceName, ownerLogoUrlAlt, ownerLogoUrl, size, controls, }: ResourceListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "../../index-L8X2o7IH.js";
|
|
3
|
+
import "../Icon/SvgIcon.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../RootProvider/RootProvider.js";
|
|
6
|
+
import "../Searchbar/AutocompleteBase.js";
|
|
7
|
+
import { ListItem as a } from "../List/ListItem.js";
|
|
8
|
+
const u = ({
|
|
9
|
+
ownerName: t,
|
|
10
|
+
resourceName: r,
|
|
11
|
+
ownerLogoUrlAlt: m,
|
|
12
|
+
ownerLogoUrl: i,
|
|
13
|
+
size: o = "md",
|
|
14
|
+
controls: p
|
|
15
|
+
}) => /* @__PURE__ */ e(
|
|
16
|
+
a,
|
|
17
|
+
{
|
|
18
|
+
avatar: {
|
|
19
|
+
name: t,
|
|
20
|
+
imageUrl: i,
|
|
21
|
+
imageUrlAlt: m,
|
|
22
|
+
type: "company"
|
|
23
|
+
},
|
|
24
|
+
title: r,
|
|
25
|
+
description: t,
|
|
26
|
+
size: o,
|
|
27
|
+
controls: p
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
export {
|
|
31
|
+
u as ResourceListItem
|
|
32
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "../../index-L8X2o7IH.js";
|
|
3
|
+
import "../Icon/SvgIcon.js";
|
|
4
|
+
import { Button as o } from "../Button/Button.js";
|
|
5
|
+
import { ResourceListItem as t } from "./ResourceListItem.js";
|
|
6
|
+
const m = {
|
|
7
|
+
title: "List/ResourceListItem",
|
|
8
|
+
component: t,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {},
|
|
11
|
+
args: {
|
|
12
|
+
size: "md",
|
|
13
|
+
id: "se_5733_1",
|
|
14
|
+
resourceName: "Avtale om oppbevaring om eksplosiver",
|
|
15
|
+
ownerName: "Direktoratet for samfunnssikkerhet og beredskap",
|
|
16
|
+
ownerLogoUrl: "https://altinncdn.no/orgs/dsb/dsb.png",
|
|
17
|
+
controls: /* @__PURE__ */ e(o, { icon: "pencil", variant: "text", size: "sm", children: "Endre" })
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
size: {
|
|
21
|
+
options: ["sm", "md", "lg"],
|
|
22
|
+
control: {
|
|
23
|
+
type: "inline-radio"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, p = {
|
|
28
|
+
args: {}
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
p as Default,
|
|
32
|
+
m as default
|
|
33
|
+
};
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as c } from "react/jsx-runtime";
|
|
3
|
-
import { createContext as
|
|
3
|
+
import { createContext as u, useContext as d, useState as I } from "react";
|
|
4
|
+
import { useEscapeKey as p } from "../../hooks/useEscapeKey.js";
|
|
4
5
|
const x = {
|
|
5
6
|
currentId: ""
|
|
6
|
-
}, s =
|
|
7
|
-
const [
|
|
7
|
+
}, s = u(x), R = ({ children: o, initialValue: t }) => {
|
|
8
|
+
const [n, e] = I((t == null ? void 0 : t.currentId) || "");
|
|
8
9
|
return /* @__PURE__ */ c(
|
|
9
10
|
s.Provider,
|
|
10
11
|
{
|
|
11
12
|
value: {
|
|
12
|
-
currentId:
|
|
13
|
-
setCurrentId:
|
|
13
|
+
currentId: n,
|
|
14
|
+
setCurrentId: e
|
|
14
15
|
},
|
|
15
16
|
children: o
|
|
16
17
|
}
|
|
17
18
|
);
|
|
18
|
-
},
|
|
19
|
-
const { currentId: o, setCurrentId: t } =
|
|
20
|
-
|
|
19
|
+
}, g = () => {
|
|
20
|
+
const { currentId: o, setCurrentId: t } = d(s), n = (r) => t(o === r ? "" : r), e = () => {
|
|
21
|
+
t("");
|
|
22
|
+
};
|
|
23
|
+
return p(e), {
|
|
21
24
|
currentId: o,
|
|
22
|
-
toggleId:
|
|
23
|
-
closeAll:
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
openId: (e) => t(e)
|
|
25
|
+
toggleId: n,
|
|
26
|
+
closeAll: e,
|
|
27
|
+
openId: (r) => t(r)
|
|
27
28
|
};
|
|
28
29
|
};
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
R as RootProvider,
|
|
32
|
+
g as useRootContext
|
|
32
33
|
};
|
|
@@ -3,7 +3,8 @@ import { AutocompleteItemProps } from './AutocompleteItem';
|
|
|
3
3
|
export interface AutocompleteProps {
|
|
4
4
|
items: AutocompleteItemProps[];
|
|
5
5
|
groups?: Record<string, AutocompleteGroupProps>;
|
|
6
|
+
onSelect?: () => void;
|
|
6
7
|
expanded?: boolean;
|
|
7
8
|
className?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare const Autocomplete:
|
|
10
|
+
export declare const Autocomplete: ({ className, items, groups, expanded, onSelect }: AutocompleteProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,41 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "../../hooks/useMenu.js";
|
|
4
|
-
import "
|
|
5
|
-
import "./
|
|
6
|
-
import {
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as E, createElement as x } from "react";
|
|
3
|
+
import { useMenu as A } from "../../hooks/useMenu.js";
|
|
4
|
+
import { useEnterKey as h } from "../../hooks/useEnterKey.js";
|
|
5
|
+
import { AutocompleteBase as v } from "./AutocompleteBase.js";
|
|
6
|
+
import { AutocompleteGroup as k } from "./AutocompleteGroup.js";
|
|
7
|
+
import { AutocompleteItem as I } from "./AutocompleteItem.js";
|
|
8
|
+
const P = ({ className: s, items: n, groups: i = {}, expanded: c, onSelect: r }) => {
|
|
9
|
+
const p = E(null);
|
|
10
|
+
h(() => {
|
|
11
|
+
var o;
|
|
12
|
+
const e = (o = p.current) == null ? void 0 : o.querySelector('[data-active="true"]'), t = e == null ? void 0 : e.querySelector("a, button");
|
|
13
|
+
t == null || t.dispatchEvent(new MouseEvent("click", { bubbles: !0 })), r == null || r();
|
|
14
|
+
});
|
|
15
|
+
const { menu: d, setActiveIndex: a } = A({
|
|
16
|
+
items: n,
|
|
17
|
+
groups: i,
|
|
18
|
+
groupByKey: "groupId",
|
|
19
|
+
keyboardEvents: !0
|
|
20
|
+
});
|
|
21
|
+
return /* @__PURE__ */ u(v, { className: s, expanded: c, ref: p, children: d.map((e, t) => /* @__PURE__ */ x(k, { ...e.props, key: t }, /* @__PURE__ */ u("ul", { children: e.items.map((o, f) => {
|
|
22
|
+
const {
|
|
23
|
+
active: l,
|
|
24
|
+
menuIndex: y,
|
|
25
|
+
props: { groupId: M, onClick: m, ...b }
|
|
26
|
+
} = o;
|
|
27
|
+
return /* @__PURE__ */ u("li", { tabIndex: -1, onMouseEnter: () => a(y), children: /* @__PURE__ */ u(
|
|
28
|
+
I,
|
|
29
|
+
{
|
|
30
|
+
...b,
|
|
31
|
+
onClick: () => {
|
|
32
|
+
m == null || m(), r == null || r();
|
|
33
|
+
},
|
|
34
|
+
active: l
|
|
35
|
+
}
|
|
36
|
+
) }, f);
|
|
37
|
+
}) }))) });
|
|
38
|
+
};
|
|
7
39
|
export {
|
|
8
|
-
|
|
40
|
+
P as Autocomplete
|
|
9
41
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Autocomplete as l } from "./Autocomplete.js";
|
|
3
3
|
const o = {
|
|
4
4
|
title: "Header/Autocomplete",
|
|
5
5
|
component: l,
|
|
@@ -276,7 +276,7 @@ const o = {
|
|
|
276
276
|
groupId: "2",
|
|
277
277
|
type: "bookmark",
|
|
278
278
|
href: "#",
|
|
279
|
-
|
|
279
|
+
title: "Skattemeldingen 2023",
|
|
280
280
|
params: [
|
|
281
281
|
{
|
|
282
282
|
label: "skatt"
|
|
@@ -5,6 +5,7 @@ import { BadgeProps } from '../Badge';
|
|
|
5
5
|
export type AutocompleteItemType = 'scope' | 'dialog' | 'bookmark' | 'information';
|
|
6
6
|
export interface AutoCompleteItemWithType {
|
|
7
7
|
type: AutocompleteItemType;
|
|
8
|
+
onClick?: () => void;
|
|
8
9
|
groupId?: string;
|
|
9
10
|
active?: boolean;
|
|
10
11
|
}
|
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import {
|
|
6
|
+
import { ListItem as e } from "../List/ListItem.js";
|
|
7
|
+
import { DialogListItem as m } from "../Dialog/DialogListItem.js";
|
|
8
|
+
import "./AutocompleteBase.js";
|
|
9
|
+
import { BookmarksListItem as a } from "../Bookmarks/BookmarksListItem.js";
|
|
10
|
+
import { ScopeListItem as i } from "./ScopeListItem.js";
|
|
11
|
+
const x = ({ type: o, ...t }) => {
|
|
12
|
+
switch (o) {
|
|
13
|
+
case "scope":
|
|
14
|
+
return /* @__PURE__ */ r(i, { ...t, color: "transparent", tabIndex: -1 });
|
|
15
|
+
case "bookmark":
|
|
16
|
+
return /* @__PURE__ */ r(a, { ...t, color: "transparent", size: "sm", tabIndex: -1 });
|
|
17
|
+
case "dialog":
|
|
18
|
+
return /* @__PURE__ */ r(m, { ...t, color: "transparent", size: "sm", tabIndex: -1 });
|
|
19
|
+
case "information":
|
|
20
|
+
return /* @__PURE__ */ r(e, { ...t, color: "transparent", tabIndex: -1, disabled: !0 });
|
|
21
|
+
default:
|
|
22
|
+
return /* @__PURE__ */ r(e, { ...t, color: "transparent", size: "sm", tabIndex: -1 });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
7
25
|
export {
|
|
8
|
-
|
|
26
|
+
x as AutocompleteItem
|
|
9
27
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "../Icon/SvgIcon.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import
|
|
6
|
+
import "./AutocompleteBase.js";
|
|
7
|
+
import { ListItem as m } from "../List/ListItem.js";
|
|
8
|
+
import '../../assets/ScopeListItem.css';const r = "_item_1a3bc_1", e = {
|
|
9
|
+
item: r
|
|
10
|
+
}, _ = ({ as: s = "a", label: t, ...o }) => /* @__PURE__ */ i(m, { className: e.item, linkIcon: "chevron-right", ...o, children: typeof t == "function" ? t() : t });
|
|
7
11
|
export {
|
|
8
|
-
|
|
12
|
+
_ as ScopeListItem
|
|
9
13
|
};
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
...
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return l(() => {
|
|
17
|
-
var i, f;
|
|
18
|
-
const m = (i = c.current) == null ? void 0 : i.querySelector('[data-active="true"]');
|
|
19
|
-
(f = m == null ? void 0 : m.firstElementChild) == null || f.dispatchEvent(new MouseEvent("click", { bubbles: !0 })), r == null || r();
|
|
20
|
-
}), /* @__PURE__ */ p(E, { className: o, expanded: e, autocomplete: !!t, children: [
|
|
21
|
-
/* @__PURE__ */ u(n, { ...a, expanded: e, onClose: r, tabIndex: s }),
|
|
22
|
-
t && /* @__PURE__ */ u(b, { ...t, expanded: e, ref: c })
|
|
23
|
-
] });
|
|
24
|
-
};
|
|
1
|
+
import { jsxs as f, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Autocomplete as s } from "./Autocomplete.js";
|
|
3
|
+
import { SearchField as a } from "./SearchField.js";
|
|
4
|
+
import { SearchbarBase as h } from "./SearchbarBase.js";
|
|
5
|
+
const j = ({
|
|
6
|
+
className: c,
|
|
7
|
+
autocomplete: r,
|
|
8
|
+
expanded: o = !1,
|
|
9
|
+
onClose: m,
|
|
10
|
+
tabIndex: e,
|
|
11
|
+
...i
|
|
12
|
+
}) => /* @__PURE__ */ f(h, { className: c, expanded: o, autocomplete: !!r, children: [
|
|
13
|
+
/* @__PURE__ */ t(a, { ...i, expanded: o, onClose: m, tabIndex: e }),
|
|
14
|
+
r && /* @__PURE__ */ t(s, { ...r, expanded: o, onSelect: m })
|
|
15
|
+
] });
|
|
25
16
|
export {
|
|
26
|
-
|
|
17
|
+
j as Searchbar
|
|
27
18
|
};
|
|
@@ -10,6 +10,7 @@ export interface ToolbarProps {
|
|
|
10
10
|
filterState?: FilterState;
|
|
11
11
|
getFilterLabel?: (name: string, value: ToolbarFilterProps['value']) => string;
|
|
12
12
|
onFilterStateChange?: (state: FilterState) => void;
|
|
13
|
+
showResultsLabel?: string;
|
|
13
14
|
children?: ReactNode;
|
|
14
15
|
}
|
|
15
|
-
export declare const Toolbar: ({ filters, filterState, onFilterStateChange, search, menu, getFilterLabel, children, }: ToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const Toolbar: ({ filters, filterState, onFilterStateChange, search, menu, getFilterLabel, children, showResultsLabel, }: ToolbarProps) => import("react/jsx-runtime").JSX.Element;
|