mirror of
https://github.com/navikt/aksel.git
synced 2026-10-13 17:22:02 +00:00
Compare commits
27
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49ddb2094c | ||
|
|
8a5f209735 | ||
|
|
d3bd1202ed | ||
|
|
4bf6027518 | ||
|
|
c8e203c523 | ||
|
|
267799ca0e | ||
|
|
42934af3a1 | ||
|
|
eff8a902c5 | ||
|
|
d34a8f45ef | ||
|
|
d1ceb40439 | ||
|
|
e033b34c3b | ||
|
|
de3991d0f0 | ||
|
|
9641215506 | ||
|
|
8a82e1c1f6 | ||
|
|
a2dfc8699b | ||
|
|
492cfc1801 | ||
|
|
9ca5932fed | ||
|
|
5950673fbf | ||
|
|
5b42ff07ee | ||
|
|
09ba52ea76 | ||
|
|
a82bccf707 | ||
|
|
89ae778c24 | ||
|
|
5b2669d35d | ||
|
|
8a82bb4a96 | ||
|
|
7871e0f95c | ||
|
|
3182888a07 | ||
|
|
f2742da085 |
No files matched your search
@@ -10,6 +10,11 @@ module.exports = (indexers) => {
|
||||
const exampleIndexer = async (fileName: string, opts) => {
|
||||
let code = readFileSync(fileName, "utf-8").toString();
|
||||
|
||||
code = code
|
||||
.split("\n")
|
||||
.filter((line) => !line.includes("withDsExample"))
|
||||
.join("\n");
|
||||
|
||||
code = code.replace("export const args =", "const args =");
|
||||
|
||||
code += `\nexport default { title: "Eksempler/${fileName
|
||||
|
||||
+3
-8
@@ -1,5 +1,4 @@
|
||||
const storyIndexers = require("./indexer");
|
||||
|
||||
const path = require("path");
|
||||
const { mergeConfig } = require("vite");
|
||||
|
||||
@@ -59,15 +58,11 @@ module.exports = {
|
||||
},
|
||||
async viteFinal(config) {
|
||||
return mergeConfig(config, {
|
||||
define: { "process.env": {} },
|
||||
define: {
|
||||
"process.env": {},
|
||||
},
|
||||
resolve: {
|
||||
alias: [
|
||||
/*
|
||||
// Example
|
||||
{
|
||||
find: "@components",
|
||||
replacement: path.resolve(__dirname, "./src/components"),
|
||||
}, */
|
||||
{
|
||||
find: "components",
|
||||
replacement: path.resolve(
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @navikt/aksel-icons
|
||||
|
||||
## 4.10.2
|
||||
|
||||
## 4.10.1
|
||||
|
||||
## 4.10.0
|
||||
|
||||
## 4.9.1
|
||||
|
||||
## 4.9.0
|
||||
|
||||
## 4.8.0
|
||||
|
||||
## 4.7.4
|
||||
|
||||
## 4.7.3
|
||||
|
||||
## 4.7.2
|
||||
|
||||
## 4.7.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/aksel-icons",
|
||||
"version": "4.7.2",
|
||||
"version": "4.10.2",
|
||||
"author": "Aksel | NAV",
|
||||
"homepage": "https://aksel.nav.no/ikoner",
|
||||
"repository": {
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @navikt/aksel-stylelint
|
||||
|
||||
## 4.10.2
|
||||
|
||||
## 4.10.1
|
||||
|
||||
## 4.10.0
|
||||
|
||||
## 4.9.1
|
||||
|
||||
## 4.9.0
|
||||
|
||||
## 4.8.0
|
||||
|
||||
## 4.7.4
|
||||
|
||||
## 4.7.3
|
||||
|
||||
## 4.7.2
|
||||
|
||||
## 4.7.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/aksel-stylelint",
|
||||
"version": "4.7.2",
|
||||
"version": "4.10.2",
|
||||
"author": "Aksel | NAV",
|
||||
"homepage": "https://aksel.nav.no/grunnleggende/kode/stylelint",
|
||||
"repository": {
|
||||
@@ -35,8 +35,8 @@
|
||||
"dev": "yarn watch:lint"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@navikt/ds-css": "^4.7.2",
|
||||
"@navikt/ds-tokens": "^4.7.2",
|
||||
"@navikt/ds-css": "^4.10.2",
|
||||
"@navikt/ds-tokens": "^4.10.2",
|
||||
"@types/jest": "^29.0.0",
|
||||
"concurrently": "7.2.1",
|
||||
"copyfiles": "2.4.1",
|
||||
|
||||
@@ -1,5 +1,61 @@
|
||||
# @navikt/aksel
|
||||
|
||||
## 4.10.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-css@4.10.2
|
||||
|
||||
## 4.10.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`d3bd1202e`](https://github.com/navikt/aksel/commit/d3bd1202eddb23dd3f1f09c3e4086ff3b19737d6)]:
|
||||
- @navikt/ds-css@4.10.1
|
||||
|
||||
## 4.10.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`267799ca0`](https://github.com/navikt/aksel/commit/267799ca0ecc0c549e159f94124befb654e29331)]:
|
||||
- @navikt/ds-css@4.10.0
|
||||
|
||||
## 4.9.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`eff8a902c`](https://github.com/navikt/aksel/commit/eff8a902c50fd5ebc56616e866aa0a61b9eb5efc)]:
|
||||
- @navikt/ds-css@4.9.1
|
||||
|
||||
## 4.9.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`e033b34c3`](https://github.com/navikt/aksel/commit/e033b34c3b85fb98dd11dd0300bb20075e1b06e8)]:
|
||||
- @navikt/ds-css@4.9.0
|
||||
|
||||
## 4.8.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`8a82e1c1f`](https://github.com/navikt/aksel/commit/8a82e1c1f66ea38fca77b25d74b14926bd817dd9)]:
|
||||
- @navikt/ds-css@4.8.0
|
||||
|
||||
## 4.7.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`492cfc180`](https://github.com/navikt/aksel/commit/492cfc1801df4ab16306185345d5089e24a0d659)]:
|
||||
- @navikt/ds-css@4.7.4
|
||||
|
||||
## 4.7.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-css@4.7.3
|
||||
|
||||
## 4.7.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/aksel",
|
||||
"version": "4.7.2",
|
||||
"version": "4.10.2",
|
||||
"description": "Aksel command line interface. Handles css-imports, codemods and more",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"license": "MIT",
|
||||
@@ -29,7 +29,7 @@
|
||||
},
|
||||
"homepage": "https://aksel.nav.no/grunnleggende/kode/kommandolinje",
|
||||
"dependencies": {
|
||||
"@navikt/ds-css": "4.7.2",
|
||||
"@navikt/ds-css": "4.10.2",
|
||||
"axios": "1.3.6",
|
||||
"chalk": "4.1.0",
|
||||
"clipboardy": "^2.3.0",
|
||||
|
||||
@@ -1,5 +1,43 @@
|
||||
# @navikt/ds-css
|
||||
|
||||
## 4.10.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Link: Fikset visited farger og inline SVG-reset ved bruk av tailwind
|
||||
|
||||
## 4.10.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Link: La til 'variant', 'underline' og 'inlineText'-prop ([#2093](https://github.com/navikt/aksel/pull/2093))
|
||||
|
||||
## 4.9.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Tweaks to combobox - updated example, small bugfixes, better affordance for selected options and added flag for "isAddedByUser" to onToggleSelected ([#2144](https://github.com/navikt/aksel/pull/2144))
|
||||
|
||||
## 4.9.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Table: ExpandableRow kan nå åpnes med 'expandOnRowClick'-prop ([#2127](https://github.com/navikt/aksel/pull/2127))
|
||||
|
||||
## 4.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Nye komponenter `VStack`, `HStack` og `Spacer` for å enklere kunne lage layout med flexbox og spacing-variabler. ([#2040](https://github.com/navikt/aksel/pull/2040))
|
||||
|
||||
## 4.7.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Oppdatert bruk av REM i komponenter for forbedret utrykk ved font-scaling i browser ([#2126](https://github.com/navikt/aksel/pull/2126))
|
||||
|
||||
## 4.7.3
|
||||
|
||||
## 4.7.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
padding: 0 var(--a-spacing-3);
|
||||
text-decoration: none;
|
||||
border-radius: var(--a-border-radius-full);
|
||||
min-height: 32px;
|
||||
min-height: 2rem;
|
||||
}
|
||||
|
||||
.navds-chips--small .navds-chips__chip {
|
||||
min-height: 24px;
|
||||
min-height: 1.5rem;
|
||||
padding: 0 var(--a-spacing-2);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ const StyleMappings = {
|
||||
{
|
||||
component: "UNSAFE_Combobox",
|
||||
main: "combobox.css",
|
||||
dependencies: [typoCss],
|
||||
dependencies: [typoCss, "chips.css"],
|
||||
},
|
||||
{
|
||||
component: "ConfirmationPanel",
|
||||
@@ -134,6 +134,18 @@ const StyleMappings = {
|
||||
{ component: "Select", main: formCss, dependencies: [typoCss] },
|
||||
{ component: "Skeleton", main: "skeleton.css", dependencies: [] },
|
||||
{ component: "Stepper", main: "stepper.css", dependencies: [typoCss] },
|
||||
{
|
||||
component: "HStack",
|
||||
main: "stack.css",
|
||||
},
|
||||
{
|
||||
component: "VStack",
|
||||
main: "stack.css",
|
||||
},
|
||||
{
|
||||
component: "Spacer",
|
||||
main: "stack.css",
|
||||
},
|
||||
{ component: "Switch", main: formCss, dependencies: [typoCss] },
|
||||
{ component: "Table", main: "table.css", dependencies: [typoCss] },
|
||||
{ component: "Tabs", main: "tabs.css", dependencies: [typoCss] },
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
.navds-copybutton__icon {
|
||||
font-size: 1.5rem;
|
||||
display: flex;
|
||||
margin-left: -4px;
|
||||
margin-left: -0.25rem;
|
||||
}
|
||||
|
||||
.navds-copybutton__icon:only-child {
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
|
||||
:where(.navds-copybutton--small, .navds-copybutton--xsmall):where(:not(:only-child)) {
|
||||
margin: -2px;
|
||||
margin: -0.125rem;
|
||||
}
|
||||
|
||||
.navds-copybutton:focus-visible {
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
|
||||
.navds-date__field-button {
|
||||
position: absolute;
|
||||
right: 1px;
|
||||
right: 0.0625rem;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: var(--ac-date-input-button-text, var(--a-text-default));
|
||||
@@ -238,7 +238,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1.5rem;
|
||||
height: calc(100% - 2px);
|
||||
height: calc(100% - 0.125rem);
|
||||
border-start-start-radius: 0;
|
||||
border-end-start-radius: 0;
|
||||
}
|
||||
@@ -284,7 +284,6 @@
|
||||
}
|
||||
|
||||
/* Readonly */
|
||||
|
||||
.navds-date__field--readonly .navds-date__field-button {
|
||||
cursor: default;
|
||||
}
|
||||
@@ -66,7 +66,7 @@
|
||||
*************************/
|
||||
|
||||
.navds-expansioncard__title--small {
|
||||
margin-top: 10px;
|
||||
margin-top: 0.625rem;
|
||||
}
|
||||
|
||||
.navds-expansioncard__title--medium {
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
border: 1px solid black;
|
||||
padding: calc(var(--a-spacing-2) - 2px) var(--a-spacing-2);
|
||||
}
|
||||
|
||||
.navds-combobox__wrapper-inner > :first-child {
|
||||
@@ -33,6 +34,7 @@
|
||||
|
||||
.navds-combobox__selected-options {
|
||||
gap: var(--a-spacing-2);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navds-combobox__selected-options > li {
|
||||
@@ -52,7 +54,7 @@
|
||||
letter-spacing: 0;
|
||||
line-height: var(--a-font-line-height-large);
|
||||
margin: 0;
|
||||
padding-left: calc(0.5rem - 4px);
|
||||
padding-left: 0.25rem;
|
||||
}
|
||||
|
||||
.navds-combobox__input-wrapper {
|
||||
@@ -67,6 +69,7 @@
|
||||
margin: 0;
|
||||
min-width: 10ch;
|
||||
width: 100%;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.navds-combobox__input:focus-visible {
|
||||
@@ -85,7 +88,7 @@
|
||||
}
|
||||
|
||||
@supports not selector(:focus-visible) {
|
||||
.navds-combobox__input:focus-visible {
|
||||
.navds-combobox__input:focus {
|
||||
outline: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
@@ -101,6 +104,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
@supports not selector(:has) {
|
||||
.navds-combobox--focused .navds-combobox__wrapper-inner {
|
||||
box-shadow: 0 0 0 1px var(--a-surface-default) inset, var(--a-shadow-focus);
|
||||
box-shadow: var(--a-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-combobox--focused .navds-combobox__wrapper-inner.navds-combobox__wrapper-inner--virtually-unfocused {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.navds-combobox__button-clear {
|
||||
border-radius: var(--a-border-radius-medium);
|
||||
color: var(--ac-combobox-clear-icon, var(--a-text-subtle));
|
||||
@@ -190,8 +204,8 @@
|
||||
align-items: flex-start;
|
||||
padding: 0;
|
||||
box-shadow: var(--a-shadow-small);
|
||||
border-radius: 4px;
|
||||
gap: 4px 0;
|
||||
border-radius: var(--a-border-radius-medium);
|
||||
gap: var(--a-spacing-1) 0;
|
||||
background-color: var(--ac-combobox-list-bg, var(--a-surface-default));
|
||||
color: var(--ac-combobox-list-text, var(--a-text-default));
|
||||
}
|
||||
@@ -243,6 +257,10 @@
|
||||
background-color: var(--ac-combobox-list-item-selected-bg, var(--a-surface-selected));
|
||||
}
|
||||
|
||||
.navds-combobox__list-item--selected p {
|
||||
font-weight: var(--a-font-weight-bold);
|
||||
}
|
||||
|
||||
.navds-combobox__list-item--selected.navds-combobox__list-item--focus,
|
||||
.navds-combobox__list-item--selected:hover {
|
||||
background-color: var(--ac-combobox-list-item-selected-hover-bg, var(--a-surface-action-subtle-hover));
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
.navds-form-field__description {
|
||||
margin-top: -6px;
|
||||
margin-top: -0.375rem;
|
||||
color: var(--ac-form-description, var(--a-text-subtle));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
.navds-checkbox__input,
|
||||
.navds-radio__input {
|
||||
position: absolute;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
top: 0;
|
||||
left: -12px;
|
||||
left: -0.75rem;
|
||||
z-index: 1;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
@@ -51,15 +51,15 @@
|
||||
|
||||
.navds-checkbox--small > .navds-checkbox__input,
|
||||
.navds-radio--small > .navds-radio__input {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
top: 0;
|
||||
left: -6px;
|
||||
left: -0.375rem;
|
||||
}
|
||||
|
||||
.navds-checkbox--small > .navds-checkbox__label,
|
||||
.navds-radio--small > .navds-radio__label {
|
||||
padding: 6px 0;
|
||||
padding: 0.375rem 0;
|
||||
}
|
||||
|
||||
.navds-checkbox--small > .navds-checkbox__label::before,
|
||||
@@ -115,15 +115,15 @@
|
||||
|
||||
.navds-checkbox__input:checked + .navds-checkbox__label::before {
|
||||
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMyAxMCI+ICAgIDxnPiAgICA8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNNCwxMGMtMC40LDAtMC44LTAuMS0xLjEtMC40TDAuNCw3LjFDMC4xLDYuOCwwLDYuNCwwLDZzMC4yLTAuOCwwLjUtMS4xQzEsNC40LDIsNC40LDIuNSw0LjlMNCw2LjRsNi40LTYgICAgQzEwLjgsMC4xLDExLjEsMCwxMS41LDBjMC40LDAsMC44LDAuMiwxLDAuNWMwLjYsMC42LDAuNSwxLjYtMC4xLDIuMXYwTDUsOS42QzQuNyw5LjksNC40LDEwLDQsMTB6IE0xMS44LDEuOUwxMS44LDEuOSAgICBDMTEuOCwxLjksMTEuOCwxLjksMTEuOCwxLjl6IE0xMS4yLDEuMUMxMS4yLDEuMSwxMS4yLDEuMSwxMS4yLDEuMUwxMS4yLDEuMXoiLz4gICAgPC9nPjwvc3ZnPg==);
|
||||
background-position: 6px center;
|
||||
background-position: 0.375rem center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 13px;
|
||||
background-size: 0.8125rem;
|
||||
box-shadow: none;
|
||||
background-color: var(--ac-radio-checkbox-action, var(--a-surface-action));
|
||||
}
|
||||
|
||||
.navds-checkbox--small > .navds-checkbox__input:checked + .navds-checkbox__label::before {
|
||||
background-position: 4px center;
|
||||
background-position: 0.25rem center;
|
||||
}
|
||||
|
||||
.navds-checkbox__input:indeterminate:focus-visible + .navds-checkbox__label::before,
|
||||
|
||||
@@ -104,8 +104,8 @@
|
||||
|
||||
.navds-search__button-search {
|
||||
flex-shrink: 0;
|
||||
min-width: 64px;
|
||||
min-height: 32px;
|
||||
min-width: 4rem;
|
||||
min-height: 2rem;
|
||||
border-radius: 0;
|
||||
border-top-right-radius: var(--a-border-radius-medium);
|
||||
border-bottom-right-radius: var(--a-border-radius-medium);
|
||||
@@ -116,7 +116,7 @@
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-search__button-search {
|
||||
min-width: 40px;
|
||||
min-width: 2.5rem;
|
||||
}
|
||||
|
||||
.navds-search__button-search.navds-button--secondary {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
color: var(--ac-select-text, var(--a-text-default));
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
min-height: 48px;
|
||||
min-height: 3rem;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
padding: 0.5rem;
|
||||
@@ -45,7 +45,7 @@
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-select__input {
|
||||
min-height: 32px;
|
||||
min-height: 2rem;
|
||||
padding: 0 2rem 0 0.25rem;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.navds-switch {
|
||||
position: relative;
|
||||
min-height: 48px;
|
||||
min-height: 3rem;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
.navds-switch--small {
|
||||
position: relative;
|
||||
min-height: 32px;
|
||||
min-height: 2rem;
|
||||
}
|
||||
|
||||
/* Input */
|
||||
@@ -18,14 +18,14 @@
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
opacity: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.navds-switch--small > .navds-switch__input {
|
||||
height: 32px;
|
||||
height: 2rem;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
@@ -47,11 +47,11 @@
|
||||
}
|
||||
|
||||
.navds-switch--small > .navds-switch__label-wrapper > .navds-switch__content {
|
||||
padding: calc(var(--a-spacing-2) - 2px) 0 calc(var(--a-spacing-2) - 2px) 3.25rem;
|
||||
padding: calc(var(--a-spacing-2) - var(--a-spacing-05)) 0 calc(var(--a-spacing-2) - var(--a-spacing-05)) 3.25rem;
|
||||
}
|
||||
|
||||
.navds-switch--right.navds-switch--small > .navds-switch__label-wrapper > .navds-switch__content {
|
||||
padding: calc(var(--a-spacing-2) - 2px) 3.25rem calc(var(--a-spacing-2) - 2px) 0;
|
||||
padding: calc(var(--a-spacing-2) - var(--a-spacing-05)) 3.25rem calc(var(--a-spacing-2) - var(--a-spacing-05)) 0;
|
||||
}
|
||||
|
||||
.navds-switch--with-description,
|
||||
@@ -70,8 +70,8 @@
|
||||
|
||||
/* Track */
|
||||
.navds-switch__track {
|
||||
width: 44px;
|
||||
height: 24px;
|
||||
width: 2.75rem;
|
||||
height: 1.5rem;
|
||||
background-color: var(--ac-switch-bg, var(--a-surface-neutral));
|
||||
position: absolute;
|
||||
top: var(--a-spacing-3);
|
||||
@@ -125,12 +125,12 @@
|
||||
background-color: var(--ac-switch-thumb-bg, var(--a-surface-default));
|
||||
color: var(--ac-switch-thumb-icon, var(--a-icon-subtle));
|
||||
border-radius: var(--a-border-radius-full);
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
position: absolute;
|
||||
transform: translateX(0);
|
||||
left: 2px;
|
||||
top: 2px;
|
||||
left: var(--a-spacing-05);
|
||||
top: var(--a-spacing-05);
|
||||
transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -138,17 +138,17 @@
|
||||
}
|
||||
|
||||
.navds-switch__input:checked ~ .navds-switch__track > .navds-switch__thumb {
|
||||
transform: translateX(20px);
|
||||
transform: translateX(1.25rem);
|
||||
color: var(--ac-switch-thumb-icon-checked, var(--a-icon-success));
|
||||
}
|
||||
|
||||
@media (hover: hover) and (pointer: fine) {
|
||||
.navds-switch__input:hover ~ .navds-switch__track > .navds-switch__thumb {
|
||||
transform: translateX(2px);
|
||||
transform: translateX(0.125rem);
|
||||
}
|
||||
|
||||
.navds-switch__input:checked:hover ~ .navds-switch__track > .navds-switch__thumb {
|
||||
transform: translateX(18px);
|
||||
transform: translateX(1.125rem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
}
|
||||
|
||||
.navds-switch__input:checked:disabled:hover ~ .navds-switch__track > .navds-switch__thumb {
|
||||
transform: translateX(20px);
|
||||
transform: translateX(1.25rem);
|
||||
}
|
||||
|
||||
/* Loader */
|
||||
@@ -216,6 +216,6 @@
|
||||
}
|
||||
|
||||
.navds-switch--readonly > .navds-switch__input:checked:hover ~ .navds-switch__track > .navds-switch__thumb {
|
||||
transform: translateX(20px);
|
||||
transform: translateX(1.25rem);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
background-color: var(--ac-textfield-bg, var(--a-surface-default));
|
||||
border-radius: var(--a-border-radius-medium);
|
||||
border: 1px solid var(--ac-textfield-border, var(--a-border-default));
|
||||
min-height: 48px;
|
||||
min-height: 3rem;
|
||||
width: 100%;
|
||||
color: var(--ac-textfield-text, var(--a-text-default));
|
||||
}
|
||||
@@ -27,8 +27,8 @@
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-text-field__input {
|
||||
padding: 0 0.5rem;
|
||||
min-height: 32px;
|
||||
padding: 0 var(--a-spacing-2);
|
||||
min-height: 2rem;
|
||||
}
|
||||
|
||||
.navds-text-field__input:hover {
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-textarea__input {
|
||||
padding: 6px;
|
||||
padding: 0.375rem;
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-textarea--counter.navds-textarea__input {
|
||||
@@ -64,8 +64,8 @@
|
||||
font-style: italic;
|
||||
position: absolute;
|
||||
text-align: left;
|
||||
left: 1px;
|
||||
bottom: 1px;
|
||||
left: 0.0625rem;
|
||||
bottom: 0.0625rem;
|
||||
padding: var(--a-spacing-1) var(--a-spacing-2);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
@import "link-panel.css";
|
||||
@import "read-more.css";
|
||||
@import "skeleton.css";
|
||||
@import "stack.css";
|
||||
@import "stepper.css";
|
||||
@import "table.css";
|
||||
@import "tabs.css";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
display: flex;
|
||||
align-self: stretch;
|
||||
background: var(--ac-internalheader-bg, var(--a-surface-inverted));
|
||||
min-height: var(--a-spacing-12);
|
||||
min-height: 3rem;
|
||||
|
||||
--navds-internalheader-focus: inset 0 0 0 2px var(--a-border-focus-on-inverted);
|
||||
}
|
||||
|
||||
@@ -6,15 +6,35 @@
|
||||
gap: var(--a-spacing-1);
|
||||
}
|
||||
|
||||
.navds-alert .navds-link,
|
||||
.navds-confirmation-panel .navds-link {
|
||||
color: var(--a-text-default);
|
||||
.navds-link.navds-link--inline-text {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.navds-link.navds-link--inline-text > svg {
|
||||
/* stylelint-disable-next-line plugin/declaration-block-no-ignored-properties */
|
||||
margin: 0.1em 0.1em -0.1em;
|
||||
transform: translateY(0.05em);
|
||||
display: inline;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
.navds-link:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.navds-link.navds-link--remove-underline {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.navds-link.navds-link--remove-underline:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.navds-alert .navds-link,
|
||||
.navds-confirmation-panel .navds-link {
|
||||
color: var(--a-text-default);
|
||||
}
|
||||
|
||||
.navds-link:focus-visible {
|
||||
outline: none;
|
||||
color: var(--ac-link-focus-text, var(--a-text-on-action));
|
||||
@@ -45,3 +65,15 @@
|
||||
color: inherit;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.navds-link--action {
|
||||
color: var(--ac-link-action-text, var(--a-text-action));
|
||||
}
|
||||
|
||||
.navds-link--neutral {
|
||||
color: var(--ac-link-neutral-text, var(--a-text-default));
|
||||
}
|
||||
|
||||
.navds-link--subtle {
|
||||
color: var(--ac-link-subtle-text, var(--a-text-subtle));
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
.navds-list .navds-list__item-marker--bullet {
|
||||
display: flex;
|
||||
margin-top: 6px;
|
||||
margin-top: 0.375rem;
|
||||
grid-column: 1 / 2;
|
||||
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
|
||||
color: var(--ac-list-marker-ul-color, var(--ac-list-marker-color, var(--a-icon-default)));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-css",
|
||||
"version": "4.7.2",
|
||||
"version": "4.10.2",
|
||||
"description": "CSS for NAV Designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
@@ -27,11 +27,11 @@
|
||||
"css:get-version": "node config/get-version.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@navikt/ds-tokens": "^4.7.2",
|
||||
"@navikt/ds-tokens": "^4.10.2",
|
||||
"cssnano": "6.0.0",
|
||||
"fast-glob": "3.2.11",
|
||||
"lodash": "4.17.21",
|
||||
"nodemon": "^2.0.12",
|
||||
"nodemon": "^3.0.1",
|
||||
"normalize.css": "^8.0.1",
|
||||
"postcss": "^8.4.0",
|
||||
"postcss-cli": "^9.0.0",
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
gap: var(--a-spacing-05);
|
||||
color: var(--ac-read-more-text, var(--a-text-action));
|
||||
border-radius: var(--a-border-radius-small);
|
||||
padding: var(--a-spacing-1) var(--a-spacing-1) var(--a-spacing-1) 2px;
|
||||
padding: var(--a-spacing-1) var(--a-spacing-1) var(--a-spacing-1) var(--a-spacing-05);
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
.navds-read-more--small .navds-read-more__button {
|
||||
padding: 2px var(--a-spacing-1) 2px 2px;
|
||||
padding: var(--a-spacing-05) var(--a-spacing-1) var(--a-spacing-05) var(--a-spacing-05);
|
||||
}
|
||||
|
||||
.navds-read-more__button:hover {
|
||||
@@ -39,14 +39,14 @@
|
||||
.navds-read-more__content {
|
||||
margin-top: var(--a-spacing-1);
|
||||
border-left: 2px solid var(--ac-read-more-line, var(--a-border-divider));
|
||||
margin-left: 13px;
|
||||
padding-left: 13px;
|
||||
margin-left: 0.8125rem;
|
||||
padding-left: 0.8125rem;
|
||||
color: var(--a-text-default);
|
||||
}
|
||||
|
||||
.navds-read-more--small .navds-read-more__content {
|
||||
margin-left: 11px;
|
||||
padding-left: 11px;
|
||||
margin-left: 0.6875rem;
|
||||
padding-left: 0.6875rem;
|
||||
}
|
||||
|
||||
.navds-read-more__content--closed {
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/* stylelint-disable csstools/value-no-unknown-custom-properties */
|
||||
/* stylelint-disable aksel/design-token-exists */
|
||||
.navds-stack {
|
||||
--ac-stack-align: initial;
|
||||
--ac-stack-justify: initial;
|
||||
--ac-stack-direction: initial;
|
||||
--ac-stack-wrap: initial;
|
||||
--ac-stack-gap-xs: initial;
|
||||
--ac-stack-gap-sm: initial;
|
||||
--ac-stack-gap-md: initial;
|
||||
--ac-stack-gap-lg: initial;
|
||||
--ac-stack-gap-xl: initial;
|
||||
--__ac-stack-gap: var(--ac-stack-gap-xs);
|
||||
|
||||
gap: var(--__ac-stack-gap);
|
||||
display: flex;
|
||||
align-items: var(--ac-stack-align);
|
||||
justify-content: var(--ac-stack-justify);
|
||||
flex-flow: var(--ac-stack-direction) var(--ac-stack-wrap);
|
||||
}
|
||||
|
||||
.navds-stack__spacer {
|
||||
flex: 1;
|
||||
justify-self: stretch;
|
||||
align-self: stretch;
|
||||
}
|
||||
|
||||
.navds-stack > .navds-stack__spacer {
|
||||
margin-block-start: calc(var(--__ac-stack-gap) * -1);
|
||||
}
|
||||
|
||||
.navds-hstack > .navds-stack__spacer {
|
||||
margin-inline-start: calc(var(--__ac-stack-gap) * -1);
|
||||
}
|
||||
|
||||
@media (min-width: 480px) {
|
||||
.navds-stack {
|
||||
--__ac-stack-gap: var(--ac-stack-gap-sm, var(--ac-stack-gap-xs));
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.navds-stack {
|
||||
--__ac-stack-gap: var(--ac-stack-gap-md, var(--ac-stack-gap-sm, var(--ac-stack-gap-xs)));
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.navds-stack {
|
||||
--__ac-stack-gap: var(--ac-stack-gap-lg, var(--ac-stack-gap-md, var(--ac-stack-gap-sm, var(--ac-stack-gap-xs))));
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.navds-stack {
|
||||
--__ac-stack-gap: var(
|
||||
--ac-stack-gap-xl,
|
||||
var(--ac-stack-gap-lg, var(--ac-stack-gap-md, var(--ac-stack-gap-sm, var(--ac-stack-gap-xs))))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ button.navds-stepper__step {
|
||||
.navds-stepper__circle--success {
|
||||
border: none;
|
||||
background: none;
|
||||
font-size: 28px;
|
||||
font-size: 1.75rem;
|
||||
color: var(--a-text-on-action);
|
||||
background-color: var(--ac-stepper-text, var(--a-surface-action));
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
.navds-table__body .navds-table__row--shade-on-hover:hover {
|
||||
.navds-table__body .navds-table__row--shade-on-hover:not(.navds-table__expandable-row--expansion-disabled):hover {
|
||||
background-color: var(--ac-table-row-hover, var(--a-bg-subtle));
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@
|
||||
}
|
||||
|
||||
.navds-table .navds-checkbox .navds-checkbox__input {
|
||||
top: -12px;
|
||||
top: -0.75rem;
|
||||
}
|
||||
|
||||
.navds-table .navds-checkbox--small .navds-checkbox__input {
|
||||
top: -6px;
|
||||
top: -0.375rem;
|
||||
}
|
||||
|
||||
.navds-table .navds-checkbox .navds-checkbox__label {
|
||||
@@ -154,6 +154,10 @@
|
||||
transition: border-bottom-color 190ms cubic-bezier(0.6, 0.04, 0.98, 0.335);
|
||||
}
|
||||
|
||||
.navds-table__expandable-row:not(.navds-table__expandable-row--expansion-disabled):hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.navds-table__expandable-row--open .navds-table__data-cell {
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
@@ -168,12 +172,12 @@
|
||||
|
||||
.navds-table__toggle-expand-cell {
|
||||
padding: 0;
|
||||
width: 56px;
|
||||
width: 3.5rem;
|
||||
}
|
||||
|
||||
.navds-table--small .navds-table__toggle-expand-cell {
|
||||
padding: 0;
|
||||
width: 36px;
|
||||
width: 2.25rem;
|
||||
}
|
||||
|
||||
.navds-table__toggle-expand-button {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
.navds-tabs__scroll-button {
|
||||
padding: var(--a-spacing-3) var(--a-spacing-4);
|
||||
width: 44px;
|
||||
width: 2.75rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@@ -38,11 +38,11 @@
|
||||
|
||||
.navds-tabs--small .navds-tabs__scroll-button {
|
||||
padding: 0.375rem var(--a-spacing-4);
|
||||
width: 32px;
|
||||
width: 2rem;
|
||||
}
|
||||
|
||||
.navds-tabs__tab {
|
||||
min-height: 48px;
|
||||
min-height: 3rem;
|
||||
padding: var(--a-spacing-3) var(--a-spacing-4);
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
@@ -92,7 +92,7 @@
|
||||
}
|
||||
|
||||
.navds-tabs__tab--small {
|
||||
min-height: 32px;
|
||||
min-height: 2rem;
|
||||
padding: 0.375rem var(--a-spacing-4);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--a-spacing-05) var(--a-spacing-2);
|
||||
min-height: 32px;
|
||||
min-height: 2rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.navds-tag--small {
|
||||
min-height: 24px;
|
||||
min-height: 1.5rem;
|
||||
padding: 0 0.375rem;
|
||||
}
|
||||
|
||||
.navds-tag--xsmall {
|
||||
min-height: 20px;
|
||||
min-height: 1.25rem;
|
||||
padding: 0 var(--a-spacing-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
height: 1rem;
|
||||
box-sizing: content-box;
|
||||
grid-column: 2;
|
||||
margin-bottom: var(--a-spacing-1);
|
||||
}
|
||||
|
||||
.navds-timeline__row-label {
|
||||
@@ -181,7 +182,7 @@
|
||||
0 0 0 4px var(--ac-timeline-pin-bg, var(--a-surface-danger)), 0 0 0 5px var(--a-surface-default);
|
||||
z-index: 2;
|
||||
border-radius: var(--a-border-radius-full);
|
||||
padding: 3.5px;
|
||||
padding: var(--a-spacing-1);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -232,7 +233,7 @@
|
||||
.navds-timeline__pin-wrapper::before {
|
||||
content: "";
|
||||
top: var(--navdsc-timeline-pin-size);
|
||||
height: calc(94% - var(--navdsc-timeline-pin-size));
|
||||
height: calc(88% - var(--navdsc-timeline-pin-size));
|
||||
width: 1px;
|
||||
margin: 0 auto;
|
||||
background: var(--a-surface-inverted);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
border-radius: var(--a-border-radius-medium);
|
||||
background-color: var(--ac-toggle-group-bg, var(--a-surface-transparent));
|
||||
box-shadow: inset 0 0 0 1px var(--ac-toggle-group-border, var(--a-border-default));
|
||||
padding: calc(var(--a-spacing-1) + 1px);
|
||||
padding: calc(var(--a-spacing-1) + 0.0625rem);
|
||||
gap: var(--a-spacing-1);
|
||||
display: inline-grid;
|
||||
grid-auto-flow: column;
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
|
||||
.navds-toggle-group--small {
|
||||
padding: calc(var(--a-spacing-05) + 1px);
|
||||
padding: calc(var(--a-spacing-05) + 0.0625rem);
|
||||
}
|
||||
|
||||
.navds-toggle-group--neutral {
|
||||
@@ -29,7 +29,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--a-spacing-1) var(--a-spacing-3);
|
||||
min-height: 38px;
|
||||
min-height: 2.375rem;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
background-color: var(--ac-toggle-group-button-bg, var(--a-surface-transparent));
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
.navds-toggle-group--small > .navds-toggle-group__button {
|
||||
padding: var(--a-spacing-05) var(--a-spacing-3);
|
||||
min-height: 26px;
|
||||
min-height: 1.625rem;
|
||||
min-width: fit-content;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,10 @@
|
||||
"--ac-link-focus-border": "--a-border-focus",
|
||||
"--ac-link-active-text": "--a-text-on-action",
|
||||
"--ac-link-active-bg": "--a-border-focus",
|
||||
"--ac-link-active-border": "--a-border-focus"
|
||||
"--ac-link-active-border": "--a-border-focus",
|
||||
"--ac-link-action-text": "--a-text-action",
|
||||
"--ac-link-neutral-text": "--a-text-default",
|
||||
"--ac-link-subtle-text": "--a-text-subtle"
|
||||
},
|
||||
"list": {
|
||||
"--ac-list-marker-ul-color": "--ac-list-marker-color",
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
}
|
||||
|
||||
.navds-tooltip__arrow {
|
||||
height: 7px;
|
||||
width: 7px;
|
||||
height: 0.4375rem;
|
||||
width: 0.4375rem;
|
||||
transform: rotate(45deg);
|
||||
z-index: -1;
|
||||
background-color: var(--ac-tooltip-bg, var(--a-surface-inverted));
|
||||
@@ -45,8 +45,8 @@
|
||||
color: var(--ac-tooltip-key-text, var(--a-text-on-inverted));
|
||||
border-radius: var(--a-border-radius-small);
|
||||
padding: 0 var(--a-spacing-1);
|
||||
min-width: 18px;
|
||||
height: 18px;
|
||||
min-width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@@ -1,5 +1,81 @@
|
||||
# @navikt/ds-react
|
||||
|
||||
## 4.10.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/aksel-icons@4.10.2
|
||||
|
||||
## 4.10.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/aksel-icons@4.10.1
|
||||
|
||||
## 4.10.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Link: La til 'variant', 'underline' og 'inlineText'-prop ([#2093](https://github.com/navikt/aksel/pull/2093))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/aksel-icons@4.10.0
|
||||
|
||||
## 4.9.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Button: Fikset aria-live bug der knapp alltid ble lest opp av skjermleser ved render ([#2143](https://github.com/navikt/aksel/pull/2143))
|
||||
|
||||
- Tweaks to combobox - updated example, small bugfixes, better affordance for selected options and added flag for "isAddedByUser" to onToggleSelected ([#2144](https://github.com/navikt/aksel/pull/2144))
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/aksel-icons@4.9.1
|
||||
|
||||
## 4.9.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Table: ExpandableRow kan nå åpnes med 'expandOnRowClick'-prop ([#2127](https://github.com/navikt/aksel/pull/2127))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/aksel-icons@4.9.0
|
||||
|
||||
## 4.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Nye komponenter `VStack`, `HStack` og `Spacer` for å enklere kunne lage layout med flexbox og spacing-variabler. ([#2040](https://github.com/navikt/aksel/pull/2040))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/aksel-icons@4.8.0
|
||||
|
||||
## 4.7.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Textfield: La til type 'time' som tilgjengelig option ([#2137](https://github.com/navikt/aksel/pull/2137))
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/aksel-icons@4.7.4
|
||||
|
||||
## 4.7.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Chips: Removable Chips submitter ikke forms ved klikk lengre ([#2124](https://github.com/navikt/aksel/pull/2124))
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/aksel-icons@4.7.3
|
||||
|
||||
## 4.7.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-react",
|
||||
"version": "4.7.2",
|
||||
"version": "4.10.2",
|
||||
"description": "Aksel react-components for NAV designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"license": "MIT",
|
||||
@@ -38,7 +38,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@floating-ui/react": "0.24.1",
|
||||
"@navikt/aksel-icons": "^4.7.2",
|
||||
"@navikt/aksel-icons": "^4.10.2",
|
||||
"@radix-ui/react-tabs": "1.0.0",
|
||||
"@radix-ui/react-toggle-group": "1.0.0",
|
||||
"clsx": "^1.2.1",
|
||||
|
||||
@@ -126,11 +126,7 @@ export const Button: OverridableComponent<ButtonProps, HTMLButtonElement> =
|
||||
<span className="navds-button__icon">{icon}</span>
|
||||
)}
|
||||
{children && (
|
||||
<Label
|
||||
as="span"
|
||||
size={size === "medium" ? "medium" : "small"}
|
||||
aria-live="polite"
|
||||
>
|
||||
<Label as="span" size={size === "medium" ? "medium" : "small"}>
|
||||
{children}
|
||||
</Label>
|
||||
)}
|
||||
|
||||
@@ -148,8 +148,9 @@ export const Loading = {
|
||||
</div>
|
||||
),
|
||||
|
||||
args: { chromatic: { disableSnapshot: true } },
|
||||
chromatic: { disableSnapshot: true },
|
||||
parameters: {
|
||||
chromatic: { disableSnapshot: true },
|
||||
},
|
||||
};
|
||||
|
||||
export const Icon = () => (
|
||||
@@ -275,6 +276,7 @@ export const LoadingWithAs = {
|
||||
</div>
|
||||
),
|
||||
|
||||
args: { chromatic: { disableSnapshot: true } },
|
||||
chromatic: { disableSnapshot: true },
|
||||
parameters: {
|
||||
chromatic: { disableSnapshot: true },
|
||||
},
|
||||
};
|
||||
@@ -1,7 +1,6 @@
|
||||
import { XMarkIcon } from "@navikt/aksel-icons";
|
||||
import cl from "clsx";
|
||||
import React, { forwardRef } from "react";
|
||||
import { OverridableComponent } from "../util/OverridableComponent";
|
||||
|
||||
export interface RemovableChipsProps
|
||||
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
@@ -22,26 +21,27 @@ export interface RemovableChipsProps
|
||||
onDelete?: () => void;
|
||||
}
|
||||
|
||||
export const RemovableChips: OverridableComponent<
|
||||
RemovableChipsProps,
|
||||
HTMLButtonElement
|
||||
> = forwardRef(
|
||||
export const RemovableChips = forwardRef<
|
||||
HTMLButtonElement,
|
||||
RemovableChipsProps
|
||||
>(
|
||||
(
|
||||
{
|
||||
className,
|
||||
children,
|
||||
variant = "action",
|
||||
as: Component = "button",
|
||||
removeLabel = "slett",
|
||||
onDelete,
|
||||
type = "button",
|
||||
...rest
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
return (
|
||||
<Component
|
||||
<button
|
||||
{...rest}
|
||||
ref={ref}
|
||||
type={type}
|
||||
className={cl(
|
||||
"navds-chips__chip navds-chips__removable navds-chips--icon-right",
|
||||
className,
|
||||
@@ -57,7 +57,7 @@ export const RemovableChips: OverridableComponent<
|
||||
<span className="navds-chips__removable-icon">
|
||||
<XMarkIcon aria-hidden />
|
||||
</span>
|
||||
</Component>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,8 +1,8 @@
|
||||
import cl from "clsx";
|
||||
import React, { forwardRef } from "react";
|
||||
import { OverridableComponent } from "../../../util/OverridableComponent";
|
||||
import GroupedHeading, { GroupedHeadingProps } from "./Heading";
|
||||
import GroupedItem, { GroupedItemProps } from "./Item";
|
||||
import GroupedHeading, { GroupedHeadingProps } from "./GroupedHeading";
|
||||
import GroupedItem, { GroupedItemProps } from "./GroupedItem";
|
||||
|
||||
export interface GroupedListProps
|
||||
extends React.HTMLAttributes<HTMLDListElement> {
|
||||
|
||||
@@ -31,7 +31,7 @@ export interface TextFieldProps
|
||||
* Type of form control. Picking the correct type helps user fill inn their required information
|
||||
* @default "text"
|
||||
*/
|
||||
type?: "email" | "number" | "password" | "tel" | "text" | "url";
|
||||
type?: "email" | "number" | "password" | "tel" | "text" | "url" | "time";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import cl from "clsx";
|
||||
import React, { useRef } from "react";
|
||||
import React, { useRef, useState } from "react";
|
||||
|
||||
type ComboboxWrapperProps = {
|
||||
children: any;
|
||||
@@ -23,6 +23,7 @@ const ComboboxWrapper = ({
|
||||
toggleListButtonRef,
|
||||
}: ComboboxWrapperProps) => {
|
||||
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
||||
const [hasFocusWithin, setHasFocusWithin] = useState(false);
|
||||
|
||||
function onFocusInsideWrapper(e) {
|
||||
if (
|
||||
@@ -30,12 +31,14 @@ const ComboboxWrapper = ({
|
||||
toggleListButtonRef?.current !== e.target
|
||||
) {
|
||||
toggleIsListOpen(true);
|
||||
setHasFocusWithin(true);
|
||||
}
|
||||
}
|
||||
|
||||
function onBlurWrapper(e) {
|
||||
if (!wrapperRef.current?.contains(e.relatedTarget)) {
|
||||
toggleIsListOpen(false);
|
||||
setHasFocusWithin(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,10 +53,12 @@ const ComboboxWrapper = ({
|
||||
{
|
||||
"navds-search--error": hasError,
|
||||
"navds-search--disabled": !!inputProps.disabled,
|
||||
"navds-combobox--focused": hasFocusWithin,
|
||||
}
|
||||
)}
|
||||
onFocus={onFocusInsideWrapper}
|
||||
onBlur={onBlurWrapper}
|
||||
tabIndex={-1}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useInputContext } from "../Input/inputContext";
|
||||
|
||||
const FilteredOptions = () => {
|
||||
const {
|
||||
clearInput,
|
||||
inputProps: { id },
|
||||
size,
|
||||
value,
|
||||
@@ -48,7 +49,10 @@ const FilteredOptions = () => {
|
||||
{isValueNew && allowNewValues && (
|
||||
<li
|
||||
tabIndex={-1}
|
||||
onPointerUp={(event) => toggleOption(value, event)}
|
||||
onPointerUp={(event) => {
|
||||
toggleOption(value, event);
|
||||
clearInput(event);
|
||||
}}
|
||||
id={`${id}-combobox-new-option`}
|
||||
className={cl("navds-combobox__list-item__new-option", {
|
||||
"navds-combobox__list-item__new-option--focus":
|
||||
@@ -88,6 +92,7 @@ const FilteredOptions = () => {
|
||||
tabIndex={-1}
|
||||
onPointerUp={(event) => {
|
||||
toggleOption(option, event);
|
||||
clearInput(event);
|
||||
if (!isMultiSelect) {
|
||||
toggleIsListOpen(false);
|
||||
}
|
||||
|
||||
@@ -60,11 +60,10 @@ export const SelectedOptionsProvider = ({
|
||||
|
||||
const addSelectedOption = useCallback(
|
||||
(option: string) => {
|
||||
if (
|
||||
!options
|
||||
.map((opt) => opt.toLowerCase())
|
||||
.includes(option?.toLowerCase?.())
|
||||
) {
|
||||
const isAddedByUser = !options
|
||||
.map((opt) => opt.toLowerCase())
|
||||
.includes(option?.toLowerCase?.());
|
||||
if (isAddedByUser) {
|
||||
allowNewValues && addCustomOption(option);
|
||||
} else if (isMultiSelect) {
|
||||
setSelectedOptions((prevSelectedOptions) => [
|
||||
@@ -74,14 +73,15 @@ export const SelectedOptionsProvider = ({
|
||||
} else {
|
||||
setSelectedOptions([option]);
|
||||
}
|
||||
onToggleSelected?.(option, true);
|
||||
onToggleSelected?.(option, true, isAddedByUser);
|
||||
},
|
||||
[addCustomOption, allowNewValues, isMultiSelect, onToggleSelected, options]
|
||||
);
|
||||
|
||||
const removeSelectedOption = useCallback(
|
||||
(option: string) => {
|
||||
if (customOptions.includes(option)) {
|
||||
const isAddedByUser = customOptions.includes(option);
|
||||
if (isAddedByUser) {
|
||||
removeCustomOption(option);
|
||||
} else {
|
||||
setSelectedOptions((prevSelectedOptions) =>
|
||||
@@ -90,7 +90,7 @@ export const SelectedOptionsProvider = ({
|
||||
)
|
||||
);
|
||||
}
|
||||
onToggleSelected?.(option, false);
|
||||
onToggleSelected?.(option, false, isAddedByUser);
|
||||
},
|
||||
[customOptions, onToggleSelected, removeCustomOption]
|
||||
);
|
||||
|
||||
@@ -82,6 +82,7 @@ export function MultiSelect(props) {
|
||||
label="Komboboks - velg flere"
|
||||
options={props.options}
|
||||
isMultiSelect={props.isMultiSelect}
|
||||
size={props.size}
|
||||
/>
|
||||
</DemoContainer>
|
||||
);
|
||||
@@ -90,6 +91,7 @@ export function MultiSelect(props) {
|
||||
MultiSelect.args = {
|
||||
options,
|
||||
isMultiSelect: true,
|
||||
size: "medium",
|
||||
};
|
||||
|
||||
export function MultiSelectWithAddNewOptions(props) {
|
||||
|
||||
@@ -78,10 +78,15 @@ export interface ComboboxProps
|
||||
* Callback function triggered whenever an option is selected or de-selected
|
||||
*
|
||||
* @param option
|
||||
* @param isSelected
|
||||
* @param isSelected - Whether the option has been selected or unselected
|
||||
* @param isAddedByUser - Whether the option comes from user input, instead of from the list
|
||||
* @returns
|
||||
*/
|
||||
onToggleSelected?: (option: string, isSelected: boolean) => void;
|
||||
onToggleSelected?: (
|
||||
option: string,
|
||||
isSelected: boolean,
|
||||
isAddedByUser: boolean
|
||||
) => void;
|
||||
/**
|
||||
* List of selected options.
|
||||
*
|
||||
|
||||
@@ -32,3 +32,4 @@ export * from "./toggle-group";
|
||||
export * from "./tooltip";
|
||||
export * from "./typography";
|
||||
export * from "./util";
|
||||
export * from "./layout/stack";
|
||||
@@ -0,0 +1,30 @@
|
||||
import React, { forwardRef } from "react";
|
||||
import { OverridableComponent } from "../../util/OverridableComponent";
|
||||
import { StackProps, Stack } from "./Stack";
|
||||
|
||||
export type HStackProps = Omit<StackProps, "direction">;
|
||||
|
||||
/**
|
||||
* Layout-primitive for horizontal flexbox
|
||||
*
|
||||
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/Stack)
|
||||
* @see 🏷️ {@link HStackProps}
|
||||
* @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
|
||||
*
|
||||
* @example
|
||||
* <HStack gap="8">
|
||||
* <MyComponent />
|
||||
* <MyComponent />
|
||||
* </HStack>
|
||||
*
|
||||
* @example
|
||||
* // Responsive gap
|
||||
* <HStack gap={{xs: "2", md: "6"}}>
|
||||
* <MyComponent />
|
||||
* <MyComponent />
|
||||
* </HStack>
|
||||
*/
|
||||
export const HStack: OverridableComponent<HStackProps, HTMLDivElement> =
|
||||
forwardRef((props, ref) => {
|
||||
return <Stack {...props} ref={ref} direction="row" />;
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import React from "react";
|
||||
|
||||
/**
|
||||
* Layout-primitive for auto-spacing between elements
|
||||
*
|
||||
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/Stack)
|
||||
*
|
||||
* @example
|
||||
* <HStack gap="8">
|
||||
* <MyComponent />
|
||||
* <Spacer />
|
||||
* <MyComponent />
|
||||
* </HStack>
|
||||
*/
|
||||
export const Spacer = () => <div className="navds-stack__spacer" />;
|
||||
@@ -0,0 +1,76 @@
|
||||
import cl from "clsx";
|
||||
import React, { forwardRef, HTMLAttributes } from "react";
|
||||
import { OverridableComponent } from "../../util/OverridableComponent";
|
||||
import {
|
||||
getResponsiveProps,
|
||||
ResponsiveProp,
|
||||
SpacingScale,
|
||||
} from "../utilities/css";
|
||||
|
||||
export interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
||||
children: React.ReactNode;
|
||||
/**
|
||||
* Justify-content
|
||||
*/
|
||||
justify?:
|
||||
| "start"
|
||||
| "center"
|
||||
| "end"
|
||||
| "space-around"
|
||||
| "space-between"
|
||||
| "space-evenly";
|
||||
/**
|
||||
* Align-items
|
||||
*/
|
||||
align?: "start" | "center" | "end" | "baseline" | "stretch";
|
||||
/**
|
||||
* flex-wrap
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* @example
|
||||
* gap='4'
|
||||
* gap={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
||||
*/
|
||||
gap?: ResponsiveProp<SpacingScale>;
|
||||
direction: "row" | "column";
|
||||
}
|
||||
|
||||
export const Stack: OverridableComponent<StackProps, HTMLDivElement> =
|
||||
forwardRef(
|
||||
(
|
||||
{
|
||||
as: Component = "div",
|
||||
className,
|
||||
align,
|
||||
justify,
|
||||
wrap = true,
|
||||
gap,
|
||||
style: _style,
|
||||
direction,
|
||||
...rest
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
const style = {
|
||||
"--ac-stack-direction": direction,
|
||||
"--ac-stack-align": align,
|
||||
"--ac-stack-justify": justify,
|
||||
"--ac-stack-wrap": wrap ? "wrap" : "nowrap",
|
||||
...getResponsiveProps(`stack`, "gap", "spacing", gap),
|
||||
..._style,
|
||||
} as React.CSSProperties;
|
||||
|
||||
return (
|
||||
<Component
|
||||
{...rest}
|
||||
ref={ref}
|
||||
style={style}
|
||||
className={cl("navds-stack", className, {
|
||||
"navds-vstack": direction === "column",
|
||||
"navds-hstack": direction === "row",
|
||||
})}
|
||||
/>
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,30 @@
|
||||
import React, { forwardRef } from "react";
|
||||
import { OverridableComponent } from "../../util/OverridableComponent";
|
||||
import { StackProps, Stack } from "./Stack";
|
||||
|
||||
export type VStackProps = Omit<StackProps, "direction" | "wrap">;
|
||||
|
||||
/**
|
||||
* Layout-primitive for vetical flexbox
|
||||
*
|
||||
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/Stack)
|
||||
* @see 🏷️ {@link VStackProps}
|
||||
* @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
|
||||
*
|
||||
* @example
|
||||
* <VStack gap="8">
|
||||
* <MyComponent />
|
||||
* <MyComponent />
|
||||
* </VStack>
|
||||
*
|
||||
* @example
|
||||
* // Responsive gap
|
||||
* <VStack gap={{xs: "2", md: "6"}}>
|
||||
* <MyComponent />
|
||||
* <MyComponent />
|
||||
* </VStack>
|
||||
*/
|
||||
export const VStack: OverridableComponent<VStackProps, HTMLDivElement> =
|
||||
forwardRef((props, ref) => {
|
||||
return <Stack {...props} ref={ref} direction="column" wrap={false} />;
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
export { HStack, type HStackProps } from "./HStack";
|
||||
export { VStack, type VStackProps } from "./VStack";
|
||||
export { Spacer } from "./Spacer";
|
||||
@@ -0,0 +1,161 @@
|
||||
import React from "react";
|
||||
import type { Meta } from "@storybook/react";
|
||||
import { HStack, VStack, Spacer } from ".";
|
||||
|
||||
export default {
|
||||
title: "ds-react/Stack",
|
||||
component: HStack,
|
||||
} satisfies Meta<typeof HStack>;
|
||||
|
||||
export const Horizontal = {
|
||||
render: () => (
|
||||
<HStack gap="4">
|
||||
<Placeholders count={4} />
|
||||
</HStack>
|
||||
),
|
||||
};
|
||||
|
||||
export const Spacing = {
|
||||
render: () => (
|
||||
<div style={{ height: "80vh", display: "flex" }}>
|
||||
<VStack gap="8">
|
||||
<Spacer />
|
||||
<HStack gap="4">
|
||||
<Placeholders count={1} />
|
||||
<Spacer />
|
||||
<Placeholders count={1} />
|
||||
</HStack>
|
||||
<HStack gap="4">
|
||||
<Placeholders count={1} />
|
||||
<Placeholders count={1} />
|
||||
</HStack>
|
||||
<HStack gap="4">
|
||||
<Placeholders count={2} />
|
||||
</HStack>
|
||||
</VStack>
|
||||
</div>
|
||||
),
|
||||
parameters: {
|
||||
layout: "fullscreen",
|
||||
},
|
||||
};
|
||||
|
||||
export const Vertical = {
|
||||
render: () => (
|
||||
<VStack gap="4">
|
||||
<Placeholders count={4} />
|
||||
</VStack>
|
||||
),
|
||||
};
|
||||
|
||||
export const VerticalDemo = {
|
||||
render: () => (
|
||||
<VStack gap="2">
|
||||
<VStack>
|
||||
<Placeholders count={4} />
|
||||
</VStack>
|
||||
<Placeholders count={4} />
|
||||
<VStack>
|
||||
<Placeholders count={4} />
|
||||
</VStack>
|
||||
</VStack>
|
||||
),
|
||||
};
|
||||
|
||||
export const VerticalAlign = {
|
||||
render: () => (
|
||||
<VStack gap="4">
|
||||
<VStack align="start">
|
||||
<Placeholders count={2} />
|
||||
</VStack>
|
||||
<VStack align="center">
|
||||
<Placeholders count={2} />
|
||||
</VStack>
|
||||
<VStack align="end">
|
||||
<Placeholders count={2} />
|
||||
</VStack>
|
||||
</VStack>
|
||||
),
|
||||
parameters: {
|
||||
layout: "fullscreen",
|
||||
},
|
||||
};
|
||||
|
||||
export const OverrideComponent = {
|
||||
render: () => (
|
||||
<VStack gap="4" as="form" onSubmit={(e) => e.preventDefault()}>
|
||||
<Placeholders count={4} />
|
||||
</VStack>
|
||||
),
|
||||
};
|
||||
|
||||
export const Responsive = {
|
||||
render: () => (
|
||||
<VStack gap={{ xs: "1", sm: "3", md: "6", lg: "10", xl: "16" }}>
|
||||
<Placeholders count={4} />
|
||||
</VStack>
|
||||
),
|
||||
};
|
||||
|
||||
export const Nested = {
|
||||
render: () => (
|
||||
<VStack gap="16">
|
||||
<Placeholders count={2}>
|
||||
<VStack gap="4">
|
||||
<Placeholders count={2} color="gray" />
|
||||
</VStack>
|
||||
</Placeholders>
|
||||
</VStack>
|
||||
),
|
||||
};
|
||||
|
||||
export const DividerDemo = {
|
||||
render: () => (
|
||||
<div style={{ height: "80vh", width: "40rem" }}>
|
||||
<VStack gap={{ xs: "2", md: "6", lg: "12" }}>
|
||||
<HStack gap={{ xs: "2", md: "6", lg: "12" }}>
|
||||
<Placeholders count={1} />
|
||||
<Spacer />
|
||||
<Placeholders count={1} />
|
||||
</HStack>
|
||||
<hr
|
||||
style={{
|
||||
border: "none",
|
||||
borderBottom: "1px solid var(--a-border-divider)",
|
||||
margin: 0,
|
||||
}}
|
||||
/>
|
||||
<HStack gap={{ xs: "2", md: "6", lg: "12" }}>
|
||||
<Placeholders count={2} />
|
||||
</HStack>
|
||||
</VStack>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
|
||||
function Placeholders({
|
||||
count,
|
||||
children,
|
||||
color,
|
||||
}: {
|
||||
count: number;
|
||||
children?: React.ReactNode;
|
||||
color?: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
{Array.from({ length: count }, (_, i) => (
|
||||
<div
|
||||
key={i}
|
||||
style={{
|
||||
backgroundColor: color ?? "var(--a-purple-200)",
|
||||
height: children ? "" : "3rem",
|
||||
width: children ? "" : "3rem",
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
export type BreakpointsAlias = "xs" | "sm" | "md" | "lg" | "xl";
|
||||
export type SpacingScale =
|
||||
| "0"
|
||||
| "05"
|
||||
| "1"
|
||||
| "2"
|
||||
| "3"
|
||||
| "4"
|
||||
| "5"
|
||||
| "6"
|
||||
| "7"
|
||||
| "8"
|
||||
| "9"
|
||||
| "10"
|
||||
| "11"
|
||||
| "12"
|
||||
| "14"
|
||||
| "16"
|
||||
| "18"
|
||||
| "20"
|
||||
| "24"
|
||||
| "32";
|
||||
|
||||
export type ResponsiveProp<T> =
|
||||
| T
|
||||
| {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
[Breakpoint in BreakpointsAlias]?: T;
|
||||
};
|
||||
|
||||
export function getResponsiveProps(
|
||||
componentName: string,
|
||||
componentProp: string,
|
||||
tokenSubgroup: string,
|
||||
responsiveProp?:
|
||||
| string
|
||||
| {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
[Breakpoint in BreakpointsAlias]?: string;
|
||||
}
|
||||
) {
|
||||
if (!responsiveProp) return {};
|
||||
|
||||
if (typeof responsiveProp === "string") {
|
||||
return {
|
||||
[`--ac-${componentName}-${componentProp}-xs`]: `var(--a-${tokenSubgroup}-${responsiveProp})`,
|
||||
};
|
||||
}
|
||||
|
||||
return Object.fromEntries(
|
||||
Object.entries(responsiveProp).map(([breakpointAlias, aliasOrScale]) => [
|
||||
`--ac-${componentName}-${componentProp}-${breakpointAlias}`,
|
||||
`var(--a-${tokenSubgroup}-${aliasOrScale})`,
|
||||
])
|
||||
);
|
||||
}
|
||||
@@ -4,6 +4,23 @@ import { OverridableComponent } from "../util/OverridableComponent";
|
||||
|
||||
export interface LinkProps
|
||||
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
||||
/**
|
||||
* Inverts when the underline appears. If this is false,
|
||||
* the underline does not appear by default, but does appear when the link is hovered.
|
||||
* This makes it more suitable for use when inlined in text.
|
||||
* @default true
|
||||
*/
|
||||
underline?: boolean;
|
||||
/**
|
||||
* Renders link with `display: inline` for better wrapping in text.
|
||||
* @default false
|
||||
*/
|
||||
inlineText?: boolean;
|
||||
/**
|
||||
* Variant of the component to use.
|
||||
* @default "action"
|
||||
*/
|
||||
variant?: "action" | "neutral" | "subtle";
|
||||
/**
|
||||
* Link text
|
||||
*/
|
||||
@@ -22,10 +39,37 @@ export interface LinkProps
|
||||
* <Link href="#">lenke til ny side</Link>
|
||||
* <Link as={ReactRouter.Link} to="#">lenke til ny side</Link>
|
||||
* ```
|
||||
* @example
|
||||
* ```jsx
|
||||
* <BodyLong>
|
||||
* ...
|
||||
* <Link href="#" inlineText>lenke til ny side</Link>
|
||||
* ...
|
||||
* </BodyLong>
|
||||
* ```
|
||||
*/
|
||||
export const Link: OverridableComponent<LinkProps, HTMLAnchorElement> =
|
||||
forwardRef(({ as: Component = "a", className, ...rest }, ref) => (
|
||||
<Component {...rest} ref={ref} className={cl("navds-link", className)} />
|
||||
));
|
||||
forwardRef(
|
||||
(
|
||||
{
|
||||
as: Component = "a",
|
||||
className,
|
||||
underline = true,
|
||||
variant = "action",
|
||||
inlineText = false,
|
||||
...rest
|
||||
},
|
||||
ref
|
||||
) => (
|
||||
<Component
|
||||
{...rest}
|
||||
ref={ref}
|
||||
className={cl("navds-link", className, `navds-link--${variant}`, {
|
||||
"navds-link--remove-underline": !underline,
|
||||
"navds-link--inline-text": inlineText,
|
||||
})}
|
||||
/>
|
||||
)
|
||||
);
|
||||
|
||||
export default Link;
|
||||
@@ -6,29 +6,76 @@ import {
|
||||
ConfirmationPanel as DsConfirmationPanel,
|
||||
Link,
|
||||
} from "..";
|
||||
import { RandomIcon } from "../util/RandomIcon";
|
||||
|
||||
export default {
|
||||
title: "ds-react/Link",
|
||||
component: Link,
|
||||
};
|
||||
|
||||
const LinkWrapper = ({
|
||||
children = "Ex aliqua incididunt",
|
||||
iconRight = false,
|
||||
iconLeft = false,
|
||||
variant = "action",
|
||||
underline = false,
|
||||
inlineText = true,
|
||||
}) => (
|
||||
<>
|
||||
{" "}
|
||||
<Link
|
||||
href="#"
|
||||
underline={underline}
|
||||
variant={variant as "action" | "neutral" | "subtle"}
|
||||
inlineText={inlineText}
|
||||
>
|
||||
{iconLeft && (
|
||||
<>
|
||||
<RandomIcon />{" "}
|
||||
</>
|
||||
)}
|
||||
{children}
|
||||
{iconRight && (
|
||||
<>
|
||||
{" "}
|
||||
<RandomIcon />
|
||||
</>
|
||||
)}
|
||||
</Link>{" "}
|
||||
</>
|
||||
);
|
||||
|
||||
export const Default = {
|
||||
render: (props) => {
|
||||
render: ({ icon, inline }) => {
|
||||
const LinkD = () => (
|
||||
<Link href="#">
|
||||
{props.icon && <PlusCircleFillIcon />}Ex aliqua incididunt{" "}
|
||||
{props.icon && <PlusCircleFillIcon />}
|
||||
</Link>
|
||||
<>
|
||||
{" "}
|
||||
<Link href="#" underline={!inline} inlineText={inline}>
|
||||
{icon && <PlusCircleFillIcon />}Ex aliqua incididunt
|
||||
{icon && <PlusCircleFillIcon />}
|
||||
</Link>{" "}
|
||||
</>
|
||||
);
|
||||
|
||||
if (props.inline) {
|
||||
if (inline) {
|
||||
return (
|
||||
<BodyLong>
|
||||
Incididunt laborum nisi nisi Lorem <LinkD /> in. Laborum aute fugiat
|
||||
officia adipisicing non veniam dolor nulla non ex consectetur fugiat
|
||||
eiusmod aute. Culpa sit aute est duis minim in in voluptate velit
|
||||
fugiat. Laboris est id deserunt ut ea Lorem eu. Esse elit laboris aute
|
||||
commodo sint laborum fugiat aliqua.
|
||||
</BodyLong>
|
||||
<div
|
||||
className="colgap"
|
||||
style={{
|
||||
width: "800px",
|
||||
border: "1px solid black",
|
||||
borderRadius: "8px",
|
||||
}}
|
||||
>
|
||||
<BodyLong>
|
||||
Incididunt laborum nisi nisi Lorem
|
||||
<LinkD />
|
||||
in. Laborum aute fugiat officia adipisicing non veniam dolor nulla
|
||||
non ex consectetur fugiat eiusmod aute. Culpa sit aute est duis
|
||||
minim in in voluptate velit fugiat. Laboris est id deserunt ut ea
|
||||
Lorem eu. Esse elit laboris aute commodo sint laborum fugiat aliqua.
|
||||
</BodyLong>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return <LinkD />;
|
||||
@@ -40,6 +87,49 @@ export const Default = {
|
||||
},
|
||||
};
|
||||
|
||||
export const InlineInsideBodyLong = {
|
||||
render: ({ iconLeft, iconRight }) => {
|
||||
return (
|
||||
<div
|
||||
className="colgap"
|
||||
style={{
|
||||
width: "800px",
|
||||
border: "1px solid black",
|
||||
borderRadius: "8px",
|
||||
}}
|
||||
>
|
||||
<style>{`.storybook-custom-spacing { white-space: pre;}`}</style>
|
||||
<BodyLong>
|
||||
<LinkWrapper underline iconLeft={iconLeft} iconRight={iconRight} />
|
||||
Eiusmod aute.
|
||||
<LinkWrapper underline iconLeft={iconLeft} iconRight={iconRight} />
|
||||
Culpa sit aute est duis minim in in voluptate velit Incididunt laborum
|
||||
nisi nisi Lorem officia adipisicing non veniam
|
||||
<LinkWrapper underline iconLeft={iconLeft} iconRight={iconRight}>
|
||||
blah blah blah blah blah blah blah blah blah blah blah blah blah
|
||||
blah blah blah blah blah blah blah blah
|
||||
</LinkWrapper>
|
||||
dolor eu. Esse elit laboris aute commodo sint laborum fugiat aliqua.
|
||||
<LinkWrapper underline iconLeft={iconLeft} iconRight={iconRight}>
|
||||
Link
|
||||
</LinkWrapper>
|
||||
</BodyLong>
|
||||
<BodyLong className="storybook-custom-spacing">
|
||||
Custom{" "}
|
||||
<LinkWrapper underline iconLeft={iconLeft} iconRight={iconRight}>
|
||||
link
|
||||
</LinkWrapper>
|
||||
{" "}spacing.
|
||||
</BodyLong>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
args: {
|
||||
iconLeft: false,
|
||||
iconRight: false,
|
||||
},
|
||||
};
|
||||
|
||||
const DemoLink = () => (
|
||||
<Link href="#">
|
||||
<PlusCircleFillIcon aria-hidden /> Ex aliqua incididunt{" "}
|
||||
@@ -83,3 +173,43 @@ export const ConfirmationPanel = () => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const Variants = {
|
||||
render: ({ iconLeft, iconRight }) => {
|
||||
return (
|
||||
<div className="colgap">
|
||||
{["action", "neutral", "subtle"].map((variant) => (
|
||||
<>
|
||||
<div>
|
||||
<LinkWrapper
|
||||
iconLeft={iconLeft}
|
||||
iconRight={iconRight}
|
||||
variant={variant}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
args: {
|
||||
iconLeft: false,
|
||||
iconRight: false,
|
||||
},
|
||||
};
|
||||
|
||||
export const InlineLink = {
|
||||
render: () => (
|
||||
<BodyLong>
|
||||
Officia incididunt Culpa sit aute est duis minim in in voluptate velit
|
||||
Incididunt laborum nisi nisi Lorem officia adipisicing non veniam{" "}
|
||||
<Link href="#" inlineText={true}>
|
||||
lenke til ny side
|
||||
<PlusCircleFillIcon aria-hidden />
|
||||
</Link>{" "}
|
||||
Culpa sit aute est duis minim in in voluptate velit Incididunt laborum
|
||||
nisi nisi Lorem officia adipisicing non veniam occaecat commodo id ad
|
||||
aliquip.
|
||||
</BodyLong>
|
||||
),
|
||||
};
|
||||
@@ -5,7 +5,7 @@ import { useId } from "..";
|
||||
export interface LoaderProps extends SVGProps<SVGSVGElement> {
|
||||
/**
|
||||
* Changes Loader width/height
|
||||
* 64px | 40px | 32px | 24px | 20px | 16px
|
||||
* 88px | 64px | 40px | 32px | 24px | 20px | 16px
|
||||
* @default "medium"
|
||||
*/
|
||||
size?:
|
||||
|
||||
@@ -31,10 +31,15 @@ export interface ExpandableRowProps extends Omit<RowProps, "content"> {
|
||||
*/
|
||||
onOpenChange?: (open: boolean) => void;
|
||||
/**
|
||||
* Disable expansio
|
||||
* Disable expansion. shadeOnHover will not be visible.
|
||||
* @default false
|
||||
*/
|
||||
expansionDisabled?: boolean;
|
||||
/**
|
||||
* Makes the whole row clickable
|
||||
* @default false
|
||||
*/
|
||||
expandOnRowClick?: boolean;
|
||||
/**
|
||||
* The width of the expanded row's internal cell
|
||||
* @default 999
|
||||
@@ -58,6 +63,7 @@ export const ExpandableRow: ExpandableRowType = forwardRef(
|
||||
open,
|
||||
onOpenChange,
|
||||
expansionDisabled = false,
|
||||
expandOnRowClick = false,
|
||||
colSpan = 999,
|
||||
...rest
|
||||
},
|
||||
@@ -65,9 +71,22 @@ export const ExpandableRow: ExpandableRowType = forwardRef(
|
||||
) => {
|
||||
const [internalOpen, setInternalOpen] = useState<boolean>(defaultOpen);
|
||||
const id = useId();
|
||||
|
||||
const isOpen = open ?? internalOpen;
|
||||
|
||||
const expansionHandler = (e) => {
|
||||
onOpenChange?.(!isOpen);
|
||||
if (open === undefined) {
|
||||
setInternalOpen((open) => !open);
|
||||
}
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
const onRowClick = (e) => {
|
||||
if (e.target.nodeName === "TD" || e.target.nodeName === "TH") {
|
||||
expansionHandler(e);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Row
|
||||
@@ -75,7 +94,13 @@ export const ExpandableRow: ExpandableRowType = forwardRef(
|
||||
ref={ref}
|
||||
className={cl("navds-table__expandable-row", className, {
|
||||
"navds-table__expandable-row--open": isOpen,
|
||||
"navds-table__expandable-row--expansion-disabled":
|
||||
expansionDisabled,
|
||||
})}
|
||||
onClick={(e) => {
|
||||
!expansionDisabled && expandOnRowClick && onRowClick(e);
|
||||
rest?.onClick?.(e);
|
||||
}}
|
||||
>
|
||||
{togglePlacement === "right" && children}
|
||||
<DataCell
|
||||
@@ -89,12 +114,7 @@ export const ExpandableRow: ExpandableRowType = forwardRef(
|
||||
className="navds-table__toggle-expand-button"
|
||||
aria-controls={id}
|
||||
aria-expanded={isOpen}
|
||||
onClick={() => {
|
||||
onOpenChange?.(!isOpen);
|
||||
if (open === undefined) {
|
||||
setInternalOpen((open) => !open);
|
||||
}
|
||||
}}
|
||||
onClick={expansionHandler}
|
||||
>
|
||||
<ChevronDownIcon
|
||||
className="navds-table__expandable-icon"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from "react";
|
||||
import { Table } from "..";
|
||||
import { Link } from "../..";
|
||||
import { Button, Checkbox, Link } from "../..";
|
||||
|
||||
export default {
|
||||
title: "ds-react/Table",
|
||||
@@ -37,6 +37,7 @@ export const Expandable = () => {
|
||||
};
|
||||
|
||||
export const ExpandableSmall = () => {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
const [open, setOpen] = useState(false);
|
||||
return (
|
||||
<Table size="small">
|
||||
@@ -227,3 +228,63 @@ export const ExpandableOpen = () => {
|
||||
</Table>
|
||||
);
|
||||
};
|
||||
|
||||
export const ClickableRow = {
|
||||
render: () => {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
const [isRowOpen1, setIsRowOpen1] = useState(false);
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
const [isRowOpen2, setIsRowOpen2] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Table zebraStripes>
|
||||
<Table.Header>
|
||||
<Table.Row>
|
||||
<Table.HeaderCell>Navn</Table.HeaderCell>
|
||||
<Table.HeaderCell>Info</Table.HeaderCell>
|
||||
<Table.HeaderCell aria-hidden />
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
<Table.ExpandableRow
|
||||
content={<div>placeholder row 1</div>}
|
||||
togglePlacement="right"
|
||||
onOpenChange={setIsRowOpen1}
|
||||
data-testid="row1"
|
||||
open={isRowOpen1}
|
||||
expandOnRowClick
|
||||
>
|
||||
<Table.DataCell>Ola</Table.DataCell>
|
||||
<Table.DataCell>
|
||||
<Button
|
||||
size="xsmall"
|
||||
onClick={(e) => {
|
||||
alert("Mer info");
|
||||
}}
|
||||
>
|
||||
Mer info
|
||||
</Button>
|
||||
</Table.DataCell>
|
||||
</Table.ExpandableRow>
|
||||
<Table.ExpandableRow
|
||||
content={<div>placeholder row 2</div>}
|
||||
togglePlacement="right"
|
||||
onOpenChange={setIsRowOpen2}
|
||||
data-testid="row2"
|
||||
open={isRowOpen2}
|
||||
expandOnRowClick
|
||||
>
|
||||
<Table.DataCell>Hans</Table.DataCell>
|
||||
<Table.DataCell>
|
||||
<Checkbox hideLabel size="small">
|
||||
Sett
|
||||
</Checkbox>
|
||||
</Table.DataCell>
|
||||
</Table.ExpandableRow>
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</>
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as AllIcons from "@navikt/aksel-icons";
|
||||
import React from "react";
|
||||
|
||||
const icons = Object.keys(AllIcons).map((key) => AllIcons[key]);
|
||||
|
||||
export const RandomIcon = () => {
|
||||
const Icon = icons[Math.floor(Math.random() * icons.length)];
|
||||
return <Icon />;
|
||||
};
|
||||
@@ -1,5 +1,21 @@
|
||||
# @navikt/ds-tailwind
|
||||
|
||||
## 4.10.2
|
||||
|
||||
## 4.10.1
|
||||
|
||||
## 4.10.0
|
||||
|
||||
## 4.9.1
|
||||
|
||||
## 4.9.0
|
||||
|
||||
## 4.8.0
|
||||
|
||||
## 4.7.4
|
||||
|
||||
## 4.7.3
|
||||
|
||||
## 4.7.2
|
||||
|
||||
## 4.7.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-tailwind",
|
||||
"version": "4.7.2",
|
||||
"version": "4.10.2",
|
||||
"description": "Tailwind config based on @navikt/ds-tokens",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
@@ -22,7 +22,7 @@
|
||||
"directory": "@navikt/core/tailwind"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@navikt/ds-tokens": "^4.7.2",
|
||||
"@navikt/ds-tokens": "^4.10.2",
|
||||
"@types/jest": "^29.0.0",
|
||||
"color": "4.2.3",
|
||||
"jest": "^29.0.0",
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @navikt/ds-tokens
|
||||
|
||||
## 4.10.2
|
||||
|
||||
## 4.10.1
|
||||
|
||||
## 4.10.0
|
||||
|
||||
## 4.9.1
|
||||
|
||||
## 4.9.0
|
||||
|
||||
## 4.8.0
|
||||
|
||||
## 4.7.4
|
||||
|
||||
## 4.7.3
|
||||
|
||||
## 4.7.2
|
||||
|
||||
## 4.7.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-tokens",
|
||||
"version": "4.7.2",
|
||||
"version": "4.10.2",
|
||||
"description": "Design-tokens for NAV designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
@@ -33,7 +33,7 @@
|
||||
"color": "4.2.3",
|
||||
"jest": "^29.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
"nodemon": "^2.0.12",
|
||||
"nodemon": "^3.0.1",
|
||||
"style-dictionary": "^3.0.2",
|
||||
"ts-jest": "^29.0.0",
|
||||
"ts-node": "10.9.0",
|
||||
|
||||
+110
-46
@@ -1,5 +1,69 @@
|
||||
# Changelog
|
||||
|
||||
## 4.10.2
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- Link: Fikset visited farger og inline SVG-reset ved bruk av tailwind
|
||||
|
||||
## 4.10.0
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- Link: La til 'variant', 'underline' og 'inlineText'-prop ([#2093](https://github.com/navikt/aksel/pull/2093))
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Link: La til 'variant', 'underline' og 'inlineText'-prop ([#2093](https://github.com/navikt/aksel/pull/2093))
|
||||
|
||||
## 4.9.1
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- Tweaks to combobox - updated example, small bugfixes, better affordance for selected options and added flag for "isAddedByUser" to onToggleSelected ([#2144](https://github.com/navikt/aksel/pull/2144))
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Button: Fikset aria-live bug der knapp alltid ble lest opp av skjermleser ved render ([#2143](https://github.com/navikt/aksel/pull/2143))
|
||||
|
||||
- Tweaks to combobox - updated example, small bugfixes, better affordance for selected options and added flag for "isAddedByUser" to onToggleSelected ([#2144](https://github.com/navikt/aksel/pull/2144))
|
||||
|
||||
## 4.9.0
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- Table: ExpandableRow kan nå åpnes med 'expandOnRowClick'-prop ([#2127](https://github.com/navikt/aksel/pull/2127))
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Table: ExpandableRow kan nå åpnes med 'expandOnRowClick'-prop ([#2127](https://github.com/navikt/aksel/pull/2127))
|
||||
|
||||
## 4.8.0
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- Nye komponenter `VStack`, `HStack` og `Spacer` for å enklere kunne lage layout med flexbox og spacing-variabler. ([#2040](https://github.com/navikt/aksel/pull/2040))
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Nye komponenter `VStack`, `HStack` og `Spacer` for å enklere kunne lage layout med flexbox og spacing-variabler. ([#2040](https://github.com/navikt/aksel/pull/2040))
|
||||
|
||||
## 4.7.4
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- Oppdatert bruk av REM i komponenter for forbedret utrykk ved font-scaling i browser ([#2126](https://github.com/navikt/aksel/pull/2126))
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Textfield: La til type 'time' som tilgjengelig option ([#2137](https://github.com/navikt/aksel/pull/2137))
|
||||
|
||||
## 4.7.3
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Chips: Removable Chips submitter ikke forms ved klikk lengre ([#2124](https://github.com/navikt/aksel/pull/2124))
|
||||
|
||||
## 4.7.2
|
||||
|
||||
### @navikt/ds-css
|
||||
@@ -80,24 +144,24 @@
|
||||
|
||||
## 4.4.0
|
||||
|
||||
### @navikt/ds-tokens
|
||||
|
||||
- Shadow-tokens er oppdatert til mer tydeligere varianter ([PR](https://github.com/navikt/aksel/pull/2041))
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- Shadow-tokens er oppdatert: Datepicker har nå ikke border, Modal bruker shadow-xlarge, LinkCard bruker shadow-xsmall ([PR](https://github.com/navikt/aksel/pull/2041))
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Fikset klassenavn brukt for popover i Datepicker og Monthpicker ([PR](https://github.com/navikt/aksel/pull/2041))
|
||||
|
||||
### @navikt/ds-tailwind
|
||||
|
||||
- Shadow-tokens er oppdatert ([PR](https://github.com/navikt/aksel/pull/2041))
|
||||
|
||||
- Oppdatert text-subtle og icon-subtle tokens til 700-skala (tidligere 600). ([PR](https://github.com/navikt/aksel/pull/2036))
|
||||
|
||||
### @navikt/ds-tokens
|
||||
|
||||
- Shadow-tokens er oppdatert til mer tydeligere varianter ([PR](https://github.com/navikt/aksel/pull/2041))
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Fikset klassenavn brukt for popover i Datepicker og Monthpicker ([PR](https://github.com/navikt/aksel/pull/2041))
|
||||
|
||||
## 4.3.0
|
||||
|
||||
### @navikt/ds-css
|
||||
@@ -174,9 +238,15 @@
|
||||
|
||||
## 4.1.0
|
||||
|
||||
### @navikt/aksel-stylelint
|
||||
### @navikt/ds-css
|
||||
|
||||
- Deprecated klassenavn `navds-chips--icon-left` ([PR](https://github.com/navikt/aksel/pull/2035))
|
||||
- Chips: `neutral` og `action`-varianter av Chips.Toggle. Opt-out mulighet for Checkmark. Oppdatert checkmark-ikon ([PR](https://github.com/navikt/aksel/pull/2035))
|
||||
|
||||
- Alle description-felter på fieldsets har nå `text-subtle` som farge. ([PR](https://github.com/navikt/aksel/pull/2036))
|
||||
|
||||
### @navikt/ds-tailwind
|
||||
|
||||
- :tada: Fargetokens for datavisualisering. ([PR](https://github.com/navikt/aksel/pull/2032))
|
||||
|
||||
### @navikt/ds-tokens
|
||||
|
||||
@@ -184,12 +254,6 @@
|
||||
|
||||
- Oppdatert text-subtle og icon-subtle tokens til 700-skala (tidligere 600). ([PR](https://github.com/navikt/aksel/pull/2036))
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- Chips: `neutral` og `action`-varianter av Chips.Toggle. Opt-out mulighet for Checkmark. Oppdatert checkmark-ikon ([PR](https://github.com/navikt/aksel/pull/2035))
|
||||
|
||||
- Alle description-felter på fieldsets har nå `text-subtle` som farge. ([PR](https://github.com/navikt/aksel/pull/2036))
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Chips: `neutral` og `action`-varianter for Chips.Toggle. `checkmark`-prop for Chips.Toggle ([PR](https://github.com/navikt/aksel/pull/2035))
|
||||
@@ -202,18 +266,12 @@
|
||||
|
||||
- Accordion: La til `indent`-prop ([PR](https://github.com/navikt/aksel/pull/2027))
|
||||
|
||||
### @navikt/ds-tailwind
|
||||
### @navikt/aksel-stylelint
|
||||
|
||||
- :tada: Fargetokens for datavisualisering. ([PR](https://github.com/navikt/aksel/pull/2032))
|
||||
- Deprecated klassenavn `navds-chips--icon-left` ([PR](https://github.com/navikt/aksel/pull/2035))
|
||||
|
||||
## 4.0.0
|
||||
|
||||
### @navikt/aksel
|
||||
|
||||
- Codemod for migrering av Datepicker/Monthpicker ut av Beta. `npx @navikt/aksel codemod v4-date` ([PR](https://github.com/navikt/aksel/pull/2026))
|
||||
|
||||
- Codemods for migrering fra `@navikt/ds-react-internal` til `@navikt/ds-react` [Guide](https://aksel.nav.no/grunnleggende/kode/migrering#h3b8538e1981d) ([PR](https://github.com/navikt/aksel/pull/2026))
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- All styling fra `@navikt/ds-css-internal` er flyttet til `@navikt/ds-css`. ([PR](https://github.com/navikt/aksel/pull/2026))
|
||||
@@ -230,6 +288,12 @@
|
||||
|
||||
- Komponenter i `@navikt/ds-react-internal` er flyttet over til `@navikt/ds-react`. [Guide](https://aksel.nav.no/grunnleggende/kode/migrering#h3b8538e1981d) ([PR](https://github.com/navikt/aksel/pull/2026))
|
||||
|
||||
### @navikt/aksel
|
||||
|
||||
- Codemod for migrering av Datepicker/Monthpicker ut av Beta. `npx @navikt/aksel codemod v4-date` ([PR](https://github.com/navikt/aksel/pull/2026))
|
||||
|
||||
- Codemods for migrering fra `@navikt/ds-react-internal` til `@navikt/ds-react` [Guide](https://aksel.nav.no/grunnleggende/kode/migrering#h3b8538e1981d) ([PR](https://github.com/navikt/aksel/pull/2026))
|
||||
|
||||
## 3.4.2
|
||||
|
||||
### @navikt/aksel-stylelint
|
||||
@@ -244,10 +308,6 @@
|
||||
|
||||
## 3.4.0
|
||||
|
||||
### @navikt/aksel-stylelint
|
||||
|
||||
- Stylelint-pakke for Aksel ([PR](https://github.com/navikt/aksel/pull/1973))
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- Tag: `moderate`-variant ([PR](https://github.com/navikt/aksel/pull/2010))
|
||||
@@ -256,6 +316,10 @@
|
||||
|
||||
- Tag: `moderate`-variant ([PR](https://github.com/navikt/aksel/pull/2010))
|
||||
|
||||
### @navikt/aksel-stylelint
|
||||
|
||||
- Stylelint-pakke for Aksel ([PR](https://github.com/navikt/aksel/pull/1973))
|
||||
|
||||
## 3.3.1
|
||||
|
||||
### @navikt/ds-react
|
||||
@@ -544,14 +608,14 @@
|
||||
|
||||
## 2.5.0
|
||||
|
||||
### @navikt/ds-tokens
|
||||
|
||||
- Breakpoint-tokens lagt til ([PR](https://github.com/navikt/aksel/pull/1832))
|
||||
|
||||
### @navikt/ds-tailwind
|
||||
|
||||
- Breakpoint-tokens er lagt til. Overskriver native tailwind-breakpoints ([PR](https://github.com/navikt/aksel/pull/1832))
|
||||
|
||||
### @navikt/ds-tokens
|
||||
|
||||
- Breakpoint-tokens lagt til ([PR](https://github.com/navikt/aksel/pull/1832))
|
||||
|
||||
## 2.4.3
|
||||
|
||||
### @navikt/ds-css
|
||||
@@ -598,18 +662,18 @@
|
||||
|
||||
## 2.2.0
|
||||
|
||||
### @navikt/ds-tokens
|
||||
|
||||
- Justeringer av semantiske fargetokens, statusfarger nå mer tydelig ([PR](https://github.com/navikt/aksel/pull/1787))
|
||||
|
||||
- Oppdatert neutral-tokens ([PR](https://github.com/navikt/aksel/pull/1789))
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- ToggleGroup: `Neutral`-variant. ([PR](https://github.com/navikt/aksel/pull/1789))
|
||||
|
||||
- Button: `Neutral`-variant.
|
||||
|
||||
### @navikt/ds-tokens
|
||||
|
||||
- Justeringer av semantiske fargetokens, statusfarger nå mer tydelig ([PR](https://github.com/navikt/aksel/pull/1787))
|
||||
|
||||
- Oppdatert neutral-tokens ([PR](https://github.com/navikt/aksel/pull/1789))
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- ToggleGroup: `neutral`-variant ([PR](https://github.com/navikt/aksel/pull/1789))
|
||||
@@ -730,24 +794,24 @@
|
||||
|
||||
## 2.0.0
|
||||
|
||||
### @navikt/ds-tokens
|
||||
|
||||
- Alle token er oppdatert til nytt format. ([Guide](https://aksel.nav.no/grunnleggende/kode/migrering#h76f47744d112))
|
||||
|
||||
### @navikt/ds-css
|
||||
|
||||
- Fontlasting: Fonter lastes nå fra NAV-CDN
|
||||
|
||||
- Tokens: Alle komponenter bruker nå semantiske tokens for som standard, med innebygd støtte for komponent-spesifikke tokens.
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Fonter blir bruk i all typografi blir nå lastet fra CDN
|
||||
|
||||
### @navikt/ds-tailwind
|
||||
|
||||
- Alle token er oppdatert til nytt format. ([Guide](https://aksel.nav.no/grunnleggende/kode/migrering#h76f47744d112))
|
||||
|
||||
### @navikt/ds-tokens
|
||||
|
||||
- Alle token er oppdatert til nytt format. ([Guide](https://aksel.nav.no/grunnleggende/kode/migrering#h76f47744d112))
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
- Fonter blir bruk i all typografi blir nå lastet fra CDN
|
||||
|
||||
## 1.5.10
|
||||
|
||||
### @navikt/ds-react
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
"website"
|
||||
],
|
||||
"dependencies": {
|
||||
"@navikt/aksel-icons": "^4.7.2",
|
||||
"@navikt/ds-css": "^4.7.2",
|
||||
"@navikt/ds-react": "^4.7.2",
|
||||
"@navikt/ds-tailwind": "^4.7.2",
|
||||
"@navikt/ds-tokens": "^4.7.2"
|
||||
"@navikt/aksel-icons": "^4.10.2",
|
||||
"@navikt/ds-css": "^4.10.2",
|
||||
"@navikt/ds-react": "^4.10.2",
|
||||
"@navikt/ds-tailwind": "^4.10.2",
|
||||
"@navikt/ds-tokens": "^4.10.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier-plugin-tailwindcss": "^0.2.3"
|
||||
|
||||
@@ -75,7 +75,7 @@ export const WithSidebar = ({
|
||||
<>
|
||||
<Header />
|
||||
<div className="bg-bg-default">
|
||||
<div className="mx-auto mb-24 mt-6 flex w-full max-w-screen-2xl gap-6">
|
||||
<div className="mx-auto mb-24 flex w-full max-w-screen-2xl gap-6 pt-6">
|
||||
<Sidebar kategori={pageType.type} links={sidebar} />
|
||||
<div className="relative w-full">
|
||||
<main
|
||||
|
||||
@@ -186,7 +186,7 @@ const options: {
|
||||
icon: <ChangeLogIconOutline />,
|
||||
},
|
||||
"komponent-beta": {
|
||||
text: "Komponenten er under utvikling, men klar for adopsjon. Vi er ønsker gjerne innspill på hvordan den fungerer og hvilken forbedringer vi kan gjøre.",
|
||||
text: "Komponenten er under utvikling, men klar for adopsjon. Vi ønsker gjerne innspill på hvordan den fungerer og hvilken forbedringer vi kan gjøre.",
|
||||
link: `${issueUrl}&labels=forespørsel+🥰%2Ckomponenter+🧩%2Cbeta+🧪&template=update-component.yml&title=%5BInnspill+til+komponent%5D%3A+`,
|
||||
heading: "Beta",
|
||||
icon: (
|
||||
|
||||
@@ -23,6 +23,8 @@ const initialSelectedOptions = ["Norge"];
|
||||
|
||||
export const Example = () => {
|
||||
const [value, setValue] = useState("");
|
||||
const mockPersistUserAddedValues = (value, isSelected) => undefined;
|
||||
|
||||
const [selectedOptions, setSelectedOptions] = useState(
|
||||
initialSelectedOptions
|
||||
);
|
||||
@@ -31,17 +33,25 @@ export const Example = () => {
|
||||
[value]
|
||||
);
|
||||
|
||||
const onToggleSelected = (option, isSelected) => {
|
||||
const onToggleSelected = (
|
||||
option: string,
|
||||
isSelected: boolean,
|
||||
isAddedByUser: boolean
|
||||
) => {
|
||||
if (isSelected) {
|
||||
setSelectedOptions([...selectedOptions, option]);
|
||||
} else {
|
||||
setSelectedOptions(selectedOptions.filter((o) => o !== option));
|
||||
}
|
||||
if (isAddedByUser) {
|
||||
mockPersistUserAddedValues(option, isSelected);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<UNSAFE_Combobox
|
||||
allowNewValues
|
||||
label="Hvilke land har du besøkt de siste 6 ukene? Velg opptil flere."
|
||||
filteredOptions={filteredOptions}
|
||||
isMultiSelect
|
||||
|
||||
@@ -20,6 +20,7 @@ export const Example = () => {
|
||||
return (
|
||||
<div>
|
||||
<UNSAFE_Combobox
|
||||
allowNewValues
|
||||
label="Hva er dine favorittdrikker? Legg gjerne til flere alternativer."
|
||||
options={initialOptions}
|
||||
isMultiSelect
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Button, DatePicker } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
import format from "date-fns/format";
|
||||
import nbLocale from "date-fns/locale/nb";
|
||||
import { useState } from "react";
|
||||
|
||||
const Example = () => {
|
||||
@@ -20,7 +22,9 @@ const Example = () => {
|
||||
{days && (
|
||||
<div className="pt-4">
|
||||
{days.map((x) => (
|
||||
<div key={x.toString()}>{x.toDateString()}</div>
|
||||
<div key={x.toString()}>
|
||||
{format(x, "dd.MM.yyyy", { locale: nbLocale })}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { DatePicker, useRangeDatepicker } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
import format from "date-fns/format";
|
||||
import nbLocale from "date-fns/locale/nb";
|
||||
|
||||
const Example = () => {
|
||||
const { datepickerProps, toInputProps, fromInputProps, selectedRange } =
|
||||
@@ -18,8 +20,14 @@ const Example = () => {
|
||||
</DatePicker>
|
||||
{selectedRange && (
|
||||
<div className="pt-4">
|
||||
<div>{selectedRange?.from && selectedRange.from.toDateString()}</div>
|
||||
<div>{selectedRange?.to && selectedRange.to.toDateString()}</div>
|
||||
<div>
|
||||
{selectedRange?.from &&
|
||||
format(selectedRange.from, "dd.MM.yyyy", { locale: nbLocale })}
|
||||
</div>
|
||||
<div>
|
||||
{selectedRange?.to &&
|
||||
format(selectedRange.to, "dd.MM.yyyy", { locale: nbLocale })}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { DatePicker, useDatepicker } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
import format from "date-fns/format";
|
||||
import nbLocale from "date-fns/locale/nb";
|
||||
|
||||
const Example = () => {
|
||||
const { datepickerProps, inputProps, selectedDay } = useDatepicker({
|
||||
@@ -12,7 +14,9 @@ const Example = () => {
|
||||
<DatePicker {...datepickerProps}>
|
||||
<DatePicker.Input {...inputProps} label="Velg dato" />
|
||||
</DatePicker>
|
||||
<div className="pt-4">{selectedDay && selectedDay.toDateString()}</div>
|
||||
<div className="pt-4">
|
||||
{selectedDay && format(selectedDay, "dd.MM.yyyy", { locale: nbLocale })}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -7,6 +7,8 @@ import {
|
||||
} from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
import { useEffect, useState } from "react";
|
||||
import format from "date-fns/format";
|
||||
import nbLocale from "date-fns/locale/nb";
|
||||
|
||||
const Example = () => {
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -40,7 +42,8 @@ const Example = () => {
|
||||
<DatePicker.Input {...inputProps} label="Velg dato" />
|
||||
</DatePicker>
|
||||
<div className="pt-4">
|
||||
{selectedDay && selectedDay.toDateString()}
|
||||
{selectedDay &&
|
||||
format(selectedDay, "dd.MM.yyyy", { locale: nbLocale })}
|
||||
</div>
|
||||
</div>
|
||||
</Modal.Content>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { DatePicker, useDatepicker } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
import format from "date-fns/format";
|
||||
import nbLocale from "date-fns/locale/nb";
|
||||
|
||||
const Example = () => {
|
||||
const { datepickerProps, inputProps, selectedDay } = useDatepicker({
|
||||
@@ -13,7 +15,9 @@ const Example = () => {
|
||||
<DatePicker {...datepickerProps}>
|
||||
<DatePicker.Input {...inputProps} label="Velg dato" />
|
||||
</DatePicker>
|
||||
<div className="pt-4">{selectedDay && selectedDay.toDateString()}</div>
|
||||
<div className="pt-4">
|
||||
{selectedDay && format(selectedDay, "dd.MM.yyyy", { locale: nbLocale })}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
import { HStack, VStack } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<VStack gap="12">
|
||||
<HStack gap="3" align="center">
|
||||
<Placeholder text="center" />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
<HStack gap="3" align="end">
|
||||
<Placeholder text="end" />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
<HStack gap="3" align="start">
|
||||
<Placeholder text="start" />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
<HStack gap="3" align="stretch">
|
||||
<Placeholder text="stretch" />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
<HStack gap="3" align="baseline">
|
||||
<Placeholder text="baseline" />
|
||||
<Placeholder text="text" noPadding />
|
||||
<Placeholder text="text" noPadding />
|
||||
<Placeholder text="text" noPadding />
|
||||
<Placeholder text="text" noPadding />
|
||||
</HStack>
|
||||
</VStack>
|
||||
);
|
||||
};
|
||||
|
||||
export default withDsExample(Example);
|
||||
|
||||
/* Storybook story */
|
||||
export const Demo = {
|
||||
render: Example,
|
||||
};
|
||||
|
||||
export const args = {
|
||||
index: 2,
|
||||
desc: "Endrer 'align-items'.",
|
||||
};
|
||||
|
||||
const Placeholder = ({
|
||||
text,
|
||||
noPadding,
|
||||
}: {
|
||||
text?: string;
|
||||
noPadding?: boolean;
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className="min-h-4 text-text-on-action h-auto w-auto rounded bg-teal-600 p-2"
|
||||
style={{ padding: noPadding && 0 }}
|
||||
>
|
||||
{text}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
import { HStack } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<HStack gap="4">
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
);
|
||||
};
|
||||
|
||||
export default withDsExample(Example);
|
||||
|
||||
/* Storybook story */
|
||||
export const Demo = {
|
||||
render: Example,
|
||||
};
|
||||
|
||||
export const args = {
|
||||
index: 0,
|
||||
desc: "HStack er en enkel layout-komponent for flexbox.",
|
||||
};
|
||||
|
||||
const Placeholder = () => {
|
||||
return <div className="aspect-square h-12 rounded bg-teal-500" />;
|
||||
};
|
||||
@@ -0,0 +1,76 @@
|
||||
import { HStack, VStack } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<div className="min-w-72 bg-deepblue-50">
|
||||
<VStack gap="12">
|
||||
<HStack gap="3" justify="center">
|
||||
<Placeholder text="center" />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
<HStack gap="3" justify="end">
|
||||
<Placeholder text="end" />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
<HStack gap="3" justify="start">
|
||||
<Placeholder text="start" />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
<HStack gap="3" justify="space-around">
|
||||
<Placeholder text="around" />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
<HStack gap="3" justify="space-between">
|
||||
<Placeholder text="between" />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
<HStack gap="3" justify="space-evenly">
|
||||
<Placeholder text="evenly" />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
</VStack>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default withDsExample(Example);
|
||||
|
||||
/* Storybook story */
|
||||
export const Demo = {
|
||||
render: Example,
|
||||
};
|
||||
|
||||
export const args = {
|
||||
index: 3,
|
||||
desc: "Endrer 'justify-content'.",
|
||||
};
|
||||
|
||||
const Placeholder = ({
|
||||
text,
|
||||
noPadding,
|
||||
}: {
|
||||
text?: string;
|
||||
noPadding?: boolean;
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className="min-h-4 text-text-on-action h-auto w-auto rounded bg-teal-600 p-2"
|
||||
style={{ padding: noPadding && 0 }}
|
||||
>
|
||||
{text}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
import { HStack } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<HStack gap="4" wrap={false}>
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
);
|
||||
};
|
||||
|
||||
export default withDsExample(Example);
|
||||
|
||||
/* Storybook story */
|
||||
export const Demo = {
|
||||
render: Example,
|
||||
};
|
||||
|
||||
export const args = {
|
||||
index: 1,
|
||||
desc: "Som standard er 'wrap' satt til 'true'.",
|
||||
};
|
||||
|
||||
const Placeholder = () => {
|
||||
return <div className="aspect-square h-12 rounded bg-teal-500" />;
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
import { HStack } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<HStack gap={{ xs: "4", sm: "6", md: "8", lg: "10", xl: "12" }}>
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
);
|
||||
};
|
||||
|
||||
export default withDsExample(Example);
|
||||
|
||||
/* Storybook story */
|
||||
export const Demo = {
|
||||
render: Example,
|
||||
};
|
||||
|
||||
export const args = {
|
||||
index: 4,
|
||||
desc: "Med responsive gap kan man redusere/øke mellomrom basert på brekkpunktene våre. Implementasjonen er mobile-first, slik at man 'sm: 8' vil sette gap for 'md', 'lg' og 'xl' også.",
|
||||
};
|
||||
|
||||
const Placeholder = () => {
|
||||
return <div className="aspect-square h-12 rounded bg-teal-500" />;
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
import { HStack, Spacer } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<div className="bg-deepblue-50">
|
||||
<HStack gap="3" wrap={false}>
|
||||
<Placeholder />
|
||||
<Spacer />
|
||||
<Placeholder />
|
||||
</HStack>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default withDsExample(Example, "static");
|
||||
|
||||
/* Storybook story */
|
||||
export const Demo = {
|
||||
render: Example,
|
||||
};
|
||||
|
||||
export const args = {
|
||||
index: 7,
|
||||
desc: "Spacer lar deg lett legge inn automatisk stretch mellom elementer. Dette kan komme inn nyttig når man f.eks skal plassere knapper i 'InternalHeader'.",
|
||||
};
|
||||
|
||||
const Placeholder = ({
|
||||
text,
|
||||
noPadding,
|
||||
}: {
|
||||
text?: string;
|
||||
noPadding?: boolean;
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className="min-h-8 text-text-on-action aspect-square h-auto w-auto rounded bg-teal-600 p-2"
|
||||
style={{ padding: noPadding && 0 }}
|
||||
>
|
||||
{text}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,11 +1,12 @@
|
||||
import { InternalHeader } from "@navikt/ds-react";
|
||||
import { InternalHeader, Spacer } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<InternalHeader>
|
||||
<InternalHeader.Title as="h1">Sykepenger</InternalHeader.Title>
|
||||
<InternalHeader.User name="Ola Normann" className="ml-auto" />
|
||||
<Spacer />
|
||||
<InternalHeader.User name="Ola Normann" />
|
||||
</InternalHeader>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import { InternalHeader } from "@navikt/ds-react";
|
||||
import { InternalHeader, Spacer } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<InternalHeader>
|
||||
<InternalHeader.Title as="h1">Sykepenger</InternalHeader.Title>
|
||||
<InternalHeader.User
|
||||
name="Ola Normann"
|
||||
description="D123456"
|
||||
className="ml-auto"
|
||||
/>
|
||||
<Spacer />
|
||||
<InternalHeader.User name="Ola Normann" description="D123456" />
|
||||
</InternalHeader>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { InternalHeader } from "@navikt/ds-react";
|
||||
import { InternalHeader, Spacer } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<InternalHeader>
|
||||
<InternalHeader.Title href="#home">Sykepenger</InternalHeader.Title>
|
||||
<InternalHeader.User name="Ola Normann" className="ml-auto" />
|
||||
<Spacer />
|
||||
<InternalHeader.User name="Ola Normann" />
|
||||
</InternalHeader>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { Dropdown, InternalHeader } from "@navikt/ds-react";
|
||||
import { Dropdown, InternalHeader, Spacer } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<InternalHeader>
|
||||
<InternalHeader.Title as="h1">Sykepenger</InternalHeader.Title>
|
||||
<Spacer />
|
||||
<Dropdown>
|
||||
<InternalHeader.UserButton
|
||||
as={Dropdown.Toggle}
|
||||
name="Ola Normann"
|
||||
description="Enhet: Skien"
|
||||
className="ml-auto"
|
||||
/>
|
||||
<Dropdown.Menu>
|
||||
<Dropdown.Menu.List>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Search } from "@navikt/ds-react";
|
||||
import { Search, Spacer } from "@navikt/ds-react";
|
||||
import { InternalHeader } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
@@ -20,7 +20,8 @@ const Example = () => {
|
||||
placeholder="Søk"
|
||||
/>
|
||||
</form>
|
||||
<InternalHeader.User name="Ola Normann" className="ml-auto" />
|
||||
<Spacer />
|
||||
<InternalHeader.User name="Ola Normann" />
|
||||
</InternalHeader>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { MenuGridIcon } from "@navikt/aksel-icons";
|
||||
import { Dropdown, InternalHeader } from "@navikt/ds-react";
|
||||
import { Dropdown, InternalHeader, Spacer } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<InternalHeader>
|
||||
<InternalHeader.Title as="h1">Sykepenger</InternalHeader.Title>
|
||||
<Spacer />
|
||||
<Dropdown>
|
||||
<InternalHeader.Button as={Dropdown.Toggle} className="ml-auto">
|
||||
<InternalHeader.Button as={Dropdown.Toggle}>
|
||||
<MenuGridIcon
|
||||
style={{ fontSize: "1.5rem" }}
|
||||
title="Systemer og oppslagsverk"
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import { PlusCircleFillIcon } from "@navikt/aksel-icons";
|
||||
import { BodyLong, Link } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<BodyLong>
|
||||
Officia incididunt Culpa sit aute est duis minim in in voluptate velit
|
||||
Incididunt laborum nisi nisi Lorem officia adipisicing non veniam{" "}
|
||||
<Link href="#" inlineText>
|
||||
lenke til ny side
|
||||
<PlusCircleFillIcon aria-hidden />
|
||||
</Link>{" "}
|
||||
Culpa sit aute est duis minim in in voluptate velit Incididunt laborum
|
||||
nisi nisi Lorem officia adipisicing non veniam occaecat commodo id ad
|
||||
aliquip.
|
||||
</BodyLong>
|
||||
);
|
||||
};
|
||||
|
||||
export default withDsExample(Example);
|
||||
|
||||
/* Storybook story */
|
||||
export const Demo = {
|
||||
render: Example,
|
||||
};
|
||||
|
||||
export const args = {
|
||||
index: 0,
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
import { BodyLong, Link } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<BodyLong>
|
||||
Officia incididunt{" "}
|
||||
<Link href="#" underline={false}>
|
||||
lenke til ny side
|
||||
</Link>{" "}
|
||||
occaecat commodo id ad aliquip.
|
||||
</BodyLong>
|
||||
);
|
||||
};
|
||||
|
||||
export default withDsExample(Example);
|
||||
|
||||
/* Storybook story */
|
||||
export const Demo = {
|
||||
render: Example,
|
||||
};
|
||||
|
||||
export const args = {
|
||||
index: 0,
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Link } from "@navikt/ds-react";
|
||||
import { withDsExample } from "components/website-modules/examples/withDsExample";
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<div className="colgap">
|
||||
{["action", "neutral", "subtle"].map((variant) => (
|
||||
<>
|
||||
<div>
|
||||
<Link variant={variant as "action" | "neutral" | "subtle"}>
|
||||
Ex aliqua incididunt
|
||||
</Link>
|
||||
</div>
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default withDsExample(Example);
|
||||
|
||||
/* Storybook story */
|
||||
export const Demo = {
|
||||
render: Example,
|
||||
};
|
||||
|
||||
export const args = {
|
||||
index: 0,
|
||||
};
|
||||
@@ -3,7 +3,7 @@ import { withDsExample } from "components/website-modules/examples/withDsExample
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<Select label="Hvilket land har du bosted i.">
|
||||
<Select label="Hvilket land har du bosted i?">
|
||||
<option value="">Velg land</option>
|
||||
<option value="norge">Norge</option>
|
||||
<option value="sverige">Sverige</option>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { withDsExample } from "components/website-modules/examples/withDsExample
|
||||
const Example = () => {
|
||||
return (
|
||||
<Select
|
||||
label="Hvilket land har du bosted i."
|
||||
label="Hvilket land har du bosted i?"
|
||||
description="Velg det landet du tilbringer mest tid."
|
||||
>
|
||||
<option value="">Velg land</option>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { withDsExample } from "components/website-modules/examples/withDsExample
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<Select label="Hvilket land har du bosted i." disabled>
|
||||
<Select label="Hvilket land har du bosted i?" disabled>
|
||||
<option value="">Velg land</option>
|
||||
<option value="norge">Norge</option>
|
||||
<option value="sverige">Sverige</option>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { withDsExample } from "components/website-modules/examples/withDsExample
|
||||
const Example = () => {
|
||||
return (
|
||||
<Select
|
||||
label="Hvilket land har du bosted i."
|
||||
label="Hvilket land har du bosted i?"
|
||||
error="Adressen matcher ikke landet du har satt som bosted."
|
||||
>
|
||||
<option value="">Velg land</option>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { withDsExample } from "components/website-modules/examples/withDsExample
|
||||
|
||||
const Example = () => {
|
||||
return (
|
||||
<Select label="Hvilket land har du bosted i." hideLabel>
|
||||
<Select label="Hvilket land har du bosted i?" hideLabel>
|
||||
<option value="">Velg land</option>
|
||||
<option value="norge">Norge</option>
|
||||
<option value="sverige">Sverige</option>
|
||||
|
||||
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user