Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ new FormSummary component #2802

Merged
merged 88 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
7620416
:construction: wip on Summary
JulianNymark Mar 18, 2024
65f9e07
:sparkles: new HR component
JulianNymark Mar 19, 2024
1d75ede
:necktie: fancy utility function to inject components into children
JulianNymark Mar 19, 2024
971d9ae
:art: improved version of Summary component
JulianNymark Mar 19, 2024
a9e6089
Remove (some) magic
HalvorHaugan Mar 22, 2024
0319b44
Fix children type in injectHRBetween
HalvorHaugan Mar 22, 2024
99cc74c
css
HalvorHaugan Mar 22, 2024
ab710c9
header gap and bg
HalvorHaugan Mar 22, 2024
cb0a212
responsive story + example with long texts
HalvorHaugan Mar 22, 2024
8a9d5cf
:truck: Summary -> FormSummary
JulianNymark Mar 22, 2024
b81125f
:art: update stories
JulianNymark Mar 22, 2024
5e8169b
:art: update story + tweak CSS for EditButton
JulianNymark Mar 22, 2024
217fc4b
:memo: add JSDoc
JulianNymark Apr 2, 2024
a8e57a4
export FormSummary in core/react/src/index.ts
JulianNymark Apr 2, 2024
1bc9a5d
FormSummaryValue bruker BodyLong
HalvorHaugan Apr 2, 2024
0030552
:memo: update JSDoc
JulianNymark Apr 2, 2024
179803f
:memo: add demo
JulianNymark Apr 2, 2024
fae2477
:memo: update README.md for eksempler
JulianNymark Apr 2, 2024
e3e3042
forwardRef på Answers
HalvorHaugan Apr 2, 2024
c80d9b7
forwardRef på Header
HalvorHaugan Apr 2, 2024
2453179
forwardRef på Label og Value
HalvorHaugan Apr 2, 2024
1b5b13a
forwardRef på Heading og Edit
HalvorHaugan Apr 2, 2024
4bce5a9
Answer export
HalvorHaugan Apr 2, 2024
1e28123
spread props
HalvorHaugan Apr 2, 2024
0e3d024
:fire: remove HR component
JulianNymark Apr 2, 2024
9c6879d
:memo: update JSDoc
JulianNymark Apr 2, 2024
32bd337
:art: export more FormSummary
JulianNymark Apr 2, 2024
c4cd03c
:fire: duplicate dependency of _mapping (same as main)
JulianNymark Apr 2, 2024
d51a365
:memo: update JSDoc for FormSummary
JulianNymark Apr 2, 2024
e2ae7ab
changeset
HalvorHaugan Apr 2, 2024
bde19f7
:bookmark: changeset
JulianNymark Apr 3, 2024
53bef1f
Merge branch 'summary-component' of github.com:navikt/aksel into summ…
JulianNymark Apr 3, 2024
52b39ce
:fire: duplicate changeset
JulianNymark Apr 3, 2024
79e4e46
Rename EditButton -> Edit
HalvorHaugan Apr 4, 2024
f7c6197
oops
HalvorHaugan Apr 4, 2024
e22aca5
Link er vel valgfritt
HalvorHaugan Apr 4, 2024
cd80107
:bug: add correct CSS dependency for FormSummary
JulianNymark Apr 5, 2024
f2f9602
:lipstick: FormSummary
JulianNymark Apr 5, 2024
1562283
:lipstick: FormSummary
JulianNymark Apr 5, 2024
b620e7e
className navds-form-summary
HalvorHaugan Apr 5, 2024
eb59650
className navds-form-summary__answers
HalvorHaugan Apr 5, 2024
f84d567
className navds-form-summary__header
HalvorHaugan Apr 5, 2024
bae2725
Update @navikt/core/css/form/form-summary.css
HalvorHaugan Apr 5, 2024
d533d6a
Update @navikt/core/react/src/form-summary/FormSummaryLabel.tsx
HalvorHaugan Apr 5, 2024
8c94fac
Update @navikt/core/react/src/form-summary/FormSummaryValue.tsx
HalvorHaugan Apr 5, 2024
2142a50
Header wrapper på små skjermer
HalvorHaugan Apr 5, 2024
b6f92dc
Rekkefølgen på selectors samme som DOM
HalvorHaugan Apr 5, 2024
8e413c5
:art: structure consistency (ref, then ...rest, then className, then …
JulianNymark Apr 5, 2024
7d7dbdc
Merge branch 'summary-component' of github.com:navikt/aksel into summ…
JulianNymark Apr 5, 2024
19fac50
update mappings
HalvorHaugan Apr 5, 2024
a0ed421
Flytt border slik at du kan ha flere dd etter hverandre
HalvorHaugan Apr 8, 2024
356611b
:art: update stories
JulianNymark Apr 10, 2024
880d247
:art: update stories (more empty values)
JulianNymark Apr 10, 2024
15c7446
:truck: story ComplexData -> RealisticUsage
JulianNymark Apr 10, 2024
5c0cfd4
Mindre padding på små skjermer
HalvorHaugan Apr 10, 2024
7363e2d
Merge branch 'summary-component' of github.com:navikt/aksel into summ…
JulianNymark Apr 10, 2024
2e56bae
:art: update stories
JulianNymark Apr 10, 2024
f9ef6ec
Answer forwardRef
HalvorHaugan Apr 10, 2024
9e9e685
:art: update stories
JulianNymark Apr 10, 2024
932d4b2
Merge branch 'summary-component' of github.com:navikt/aksel into summ…
JulianNymark Apr 10, 2024
4f8f6c4
Eksempel på linjeskift i value i story
HalvorHaugan Apr 10, 2024
9d27dea
:art: update story
JulianNymark Apr 10, 2024
32611f5
:art: update story
JulianNymark Apr 10, 2024
7808197
Merge branch 'main' into summary-component
HalvorHaugan Apr 11, 2024
f1df418
:truck: FormSummary -> Form/FormSummary
JulianNymark Apr 11, 2024
49944f4
:art: update Demo and story
JulianNymark Apr 11, 2024
46e9049
Merge branch 'main' into summary-component
JulianNymark Apr 11, 2024
bf8ecc4
:label: make href required for FormSummaryEdit
JulianNymark Apr 11, 2024
61d9c97
Merge branch 'summary-component' of github.com:navikt/aksel into summ…
JulianNymark Apr 11, 2024
0ad021e
:label: + :construction: typing woes
JulianNymark Apr 11, 2024
4b9f1e6
:lipstick: tweak CSS to make it look just right
JulianNymark Apr 11, 2024
cfb7321
:label: correct typing using Exclude > Omit
JulianNymark Apr 11, 2024
77b56c0
:art: use div over section without label
JulianNymark Apr 11, 2024
85d431e
:lipstick: FormSummary, last-child padding removal
JulianNymark Apr 11, 2024
104b0ba
Fjernet kommentar
HalvorHaugan Apr 11, 2024
a9eef6a
typo i readme
HalvorHaugan Apr 12, 2024
fb3bfdb
:truck: FormSummary.Edit -> FormSummary.EditLink
JulianNymark Apr 12, 2024
b429703
Merge branch 'summary-component' of github.com:navikt/aksel into summ…
JulianNymark Apr 12, 2024
deb2bd6
:label: make href for EditLink optional
JulianNymark Apr 12, 2024
bb3470c
:truck: rename FormSummaryEdit -> FormSummaryEditLink
JulianNymark Apr 12, 2024
6577bcc
FormSummaryEdit -> FormSummaryEditLink
HalvorHaugan Apr 12, 2024
2850038
:sparkles: add example to FormSummary
JulianNymark Apr 12, 2024
bedee58
Merge branch 'summary-component' of github.com:navikt/aksel into summ…
JulianNymark Apr 12, 2024
19398d2
:art: update examples
JulianNymark Apr 15, 2024
8887f42
:art: update examples
JulianNymark Apr 15, 2024
e6409bb
:lipstick: FormSummary
JulianNymark Apr 15, 2024
e6a43ac
:art: types + jsdoc tweaks (FormSummary)
JulianNymark Apr 15, 2024
f7f80f2
Merge branch 'main' into summary-component
JulianNymark Apr 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/happy-stingrays-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@navikt/ds-react": minor
"@navikt/ds-css": minor
---

:sparkles: Ny komponent FormSummary
5 changes: 5 additions & 0 deletions @navikt/core/css/config/_mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ const StyleMappings = {
{ component: "Tag", main: "tag.css", dependencies: [typoCss] },
{ component: "TextField", main: formCss, dependencies: [typoCss] },
{ component: "Textarea", main: formCss, dependencies: [typoCss] },
{
component: "FormSummary",
main: formCss,
dependencies: [typoCss, "link.css"],
},
{
component: "ToggleGroup",
main: "toggle-group.css",
Expand Down
58 changes: 58 additions & 0 deletions @navikt/core/css/form/form-summary.css
JulianNymark marked this conversation as resolved.
Show resolved Hide resolved
JulianNymark marked this conversation as resolved.
Show resolved Hide resolved
JulianNymark marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.navds-form-summary {
overflow: hidden;
border: 1px solid var(--a-border-subtle);
border-radius: var(--a-border-radius-large);
}

.navds-form-summary__header {
background-color: var(--a-surface-subtle);
padding: var(--a-spacing-4) var(--a-spacing-6);
display: flex;
justify-content: space-between;
gap: 0 var(--a-spacing-2);
}

@media (max-width: 479px) {
.navds-form-summary__header {
padding: var(--a-spacing-3) var(--a-spacing-4);
flex-wrap: wrap;
}
}

.navds-form-summary__edit {
flex-shrink: 0;
margin-top: var(--a-spacing-1);
align-self: flex-start;
}

.navds-form-summary > .navds-form-summary__answers {
border-top: 1px solid var(--a-border-subtle);
}

.navds-form-summary__answers {
padding: var(--a-spacing-5) var(--a-spacing-6) var(--a-spacing-6);
margin: 0;
}

@media (max-width: 479px) {
.navds-form-summary__answers {
padding: var(--a-spacing-4);
}
}

.navds-form-summary__answer:not(:last-child) {
margin-bottom: var(--a-spacing-4);
padding-bottom: var(--a-spacing-4);
border-bottom: 1px solid var(--a-border-divider);
}

.navds-form-summary__value:first-of-type {
margin-top: var(--a-spacing-1);
}

.navds-form-summary__value :where(.navds-form-summary__answers) {
margin-top: var(--a-spacing-2);
padding: var(--a-spacing-4);
background: var(--a-surface-action-subtle);
JulianNymark marked this conversation as resolved.
Show resolved Hide resolved
border-radius: var(--a-border-radius-large);
}
1 change: 1 addition & 0 deletions @navikt/core/css/form/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
@import "textarea.css";
@import "search.css";
@import "combobox.css";
@import "form-summary.css";
10 changes: 10 additions & 0 deletions @navikt/core/react/package.json
HalvorHaugan marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,16 @@
"default": "./cjs/form/file-upload/index.js"
}
},
"./FormSummary": {
"import": {
"types": "./esm/form/form-summary/index.d.ts",
"default": "./esm/form/form-summary/index.js"
},
"require": {
"types": "./cjs/form/form-summary/index.d.ts",
"default": "./cjs/form/form-summary/index.js"
}
},
"./package.json": "./package.json"
},
"scripts": {
Expand Down
Loading
Loading