mirror of
https://github.com/navikt/aksel.git
synced 2026-10-13 01:02:02 +00:00
Compare commits
135
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c4c73cc2e | ||
|
|
324eb29f02 | ||
|
|
ce0bde9ea3 | ||
|
|
4c26512709 | ||
|
|
17f5f9e379 | ||
|
|
95eeb92a4e | ||
|
|
0673ab670f | ||
|
|
68d5e81076 | ||
|
|
b775a84493 | ||
|
|
27f491d452 | ||
|
|
129d159570 | ||
|
|
b5d1eb0105 | ||
|
|
0f03d9c538 | ||
|
|
29f1567601 | ||
|
|
2bd4fd52ff | ||
|
|
9af1c3b5d2 | ||
|
|
b1eebe5228 | ||
|
|
804a24f631 | ||
|
|
6918e1695b | ||
|
|
cffc4b6539 | ||
|
|
b575e39000 | ||
|
|
ced2b9b46b | ||
|
|
f19ea3d0fe | ||
|
|
260ee43f09 | ||
|
|
a1bdcd4df5 | ||
|
|
5669efc0dd | ||
|
|
00a02fa8ae | ||
|
|
93f1d199cd | ||
|
|
a69db74d79 | ||
|
|
717b70a011 | ||
|
|
ed937f68c5 | ||
|
|
47c4f9aa26 | ||
|
|
b166e5e5df | ||
|
|
e150b4f264 | ||
|
|
be9660948c | ||
|
|
26023c888b | ||
|
|
79b85169d1 | ||
|
|
4e5d410f9f | ||
|
|
83ba659219 | ||
|
|
af12f5aa47 | ||
|
|
7548ef086f | ||
|
|
077ccb81cb | ||
|
|
fc6bdd70c7 | ||
|
|
998f0c7752 | ||
|
|
900525fecf | ||
|
|
b20fa69869 | ||
|
|
1367a628d2 | ||
|
|
bf99605db2 | ||
|
|
f954bca955 | ||
|
|
887a76259e | ||
|
|
90114923c4 | ||
|
|
a170ca8998 | ||
|
|
347427c6e6 | ||
|
|
35aab3b672 | ||
|
|
5f4c0a7a2d | ||
|
|
fd120b65e0 | ||
|
|
3ae1be923e | ||
|
|
dab2c3f2c2 | ||
|
|
c0f1b8401e | ||
|
|
8ba8936fdd | ||
|
|
15c5845465 | ||
|
|
f6bc0c612f | ||
|
|
b796e306d5 | ||
|
|
0e9680dab9 | ||
|
|
6d2858c6e1 | ||
|
|
9294410ed8 | ||
|
|
e3653580e6 | ||
|
|
c9ab2e1516 | ||
|
|
bb1876df43 | ||
|
|
d98bff30f6 | ||
|
|
7f53011d91 | ||
|
|
4a451fe84a | ||
|
|
01adced0e7 | ||
|
|
e2bae872cf | ||
|
|
aff8f00ade | ||
|
|
ad28279bd3 | ||
|
|
9ec5d6a48e | ||
|
|
755cb409be | ||
|
|
7a9820ffa6 | ||
|
|
812e93a354 | ||
|
|
00e1e254f2 | ||
|
|
ee389a9497 | ||
|
|
4751e8048d | ||
|
|
78c29f06d5 | ||
|
|
58a25bbc00 | ||
|
|
4048a0aba6 | ||
|
|
006bd6f9ac | ||
|
|
58c3351d2f | ||
|
|
27e11acc33 | ||
|
|
e52a23fee9 | ||
|
|
017deefd77 | ||
|
|
99a4212f54 | ||
|
|
12da298e87 | ||
|
|
e9f4f721bb | ||
|
|
2c5ff8d702 | ||
|
|
40d8d369a4 | ||
|
|
032240f939 | ||
|
|
27d89d7a41 | ||
|
|
3a56f34a62 | ||
|
|
e7660412bc | ||
|
|
956afbb91a | ||
|
|
5fd28b0131 | ||
|
|
646f6b858e | ||
|
|
c5add547bc | ||
|
|
cac3a433c4 | ||
|
|
5eb5b6b617 | ||
|
|
19afca1ed6 | ||
|
|
7c341f7cd2 | ||
|
|
9a1a48d319 | ||
|
|
ce4afb17a8 | ||
|
|
146111e859 | ||
|
|
40a8965cec | ||
|
|
8f4e6a5e89 | ||
|
|
e73c9d2f3e | ||
|
|
0849fffe40 | ||
|
|
7a261e86a3 | ||
|
|
a2c48a9246 | ||
|
|
7c845ac464 | ||
|
|
6edd03a9c1 | ||
|
|
724a90eb28 | ||
|
|
43b686e769 | ||
|
|
c485e1bfc7 | ||
|
|
9533504b16 | ||
|
|
bca56d1c48 | ||
|
|
a656a19df5 | ||
|
|
a2ac8fedb1 | ||
|
|
bf0a71f1d4 | ||
|
|
e4b51f49fb | ||
|
|
ea49e12e23 | ||
|
|
4a29f5b449 | ||
|
|
7b7950dab1 | ||
|
|
bcb8d46c72 | ||
|
|
60dbbaedd9 | ||
|
|
8991704a09 | ||
|
|
4a22f10763 |
No files matched your search
@@ -30,10 +30,15 @@ jobs:
|
||||
- name: install
|
||||
if: steps.node-cache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
- name: postinstall
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Boot
|
||||
run: yarn boot
|
||||
- name: Eslint and Stylelint
|
||||
run: yarn lint
|
||||
- name: Test
|
||||
run: yarn test
|
||||
- name: add access token to .env
|
||||
run: echo "ACCESS_TOKEN=${{ secrets.VERKTOYKASSE_INNHOLD_TOKEN }}" >> website/.env
|
||||
- name: add branch token to .env
|
||||
@@ -50,15 +55,17 @@ jobs:
|
||||
publish-npm:
|
||||
needs: test-build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[fix]') || contains(github.event.head_commit.message, '[feature]') || contains(github.event.head_commit.message, '[breaking]')
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: "0"
|
||||
token: ${{secrets.GIT_REPO}}
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
registry-url: http://registry.npmjs.org
|
||||
registry-url: https://registry.npmjs.org
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
@@ -88,17 +95,9 @@ jobs:
|
||||
- name: Update changed packages with MAJOR
|
||||
if: "contains(github.event.head_commit.message, '[breaking]')"
|
||||
run: yarn lerna version major --include-merged-tags --yes
|
||||
|
||||
- name: Create a .npmrc file for NPM
|
||||
run: |
|
||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
|
||||
npm whoami
|
||||
env:
|
||||
NPM_TOKEN: ${{secrets.NPM_AUTOMATION}}
|
||||
- name: Publish to NPM registry
|
||||
run: |
|
||||
yarn lerna publish from-package --yes
|
||||
rm .npmrc
|
||||
run: yarn lerna publish --no-verify-access from-package --yes
|
||||
|
||||
- name: Create a .npmrc file for the github package repository
|
||||
uses: FerLuisxd/create-npmrc@3
|
||||
with:
|
||||
@@ -112,7 +111,7 @@ jobs:
|
||||
yarn lerna publish --registry https://npm.pkg.github.com from-package --yes
|
||||
|
||||
publish-pages:
|
||||
needs: publish-npm
|
||||
needs: test-build
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push'
|
||||
steps:
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
name: Update Icons
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 0 * * *
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
id: node-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: install
|
||||
if: steps.node-cache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
- name: postinstall
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Update Icons
|
||||
run: yarn update:icons
|
||||
env:
|
||||
FIGMA_TOKEN: ${{ secrets.FIGMA_IKONER_API }}
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GIT_REPO }}
|
||||
commit-message: "Ikoner synket fra figma"
|
||||
branch: figma-icons-sync
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||
signoff: false
|
||||
delete-branch: true
|
||||
title: "[FIX] Ikonsynk Figma"
|
||||
+2
-3
@@ -100,7 +100,6 @@ examples/webpack/out
|
||||
|
||||
*.d.ts
|
||||
*-exports.less
|
||||
**/css/
|
||||
*/figma-api/icons
|
||||
*/ds-icons/png
|
||||
packages/**/css
|
||||
@@ -108,8 +107,8 @@ utilities/**/css
|
||||
|
||||
*/static/*.zip
|
||||
*/static/png
|
||||
@navikt/ds-icons/NAV-ikonpakke-png.zip
|
||||
@navikt/ds-icons/NAV-ikonpakke-svg.zip
|
||||
@navikt/core/icons/NAV-ikonpakke-png.zip
|
||||
@navikt/core/icons/NAV-ikonpakke-svg.zip
|
||||
*/**/NAV-ikonpakke-png.zip
|
||||
*/**/NAV-ikonpakke-svg.zip
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ module.exports = {
|
||||
],
|
||||
addons: [
|
||||
"@storybook/addon-docs",
|
||||
"@storybook/addon-a11y",
|
||||
{
|
||||
name: "@storybook/addon-storysource",
|
||||
options: {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import "nav-frontend-core";
|
||||
import "@navikt/ds-css/index.css";
|
||||
import "@navikt/ds-css-internal/index.css";
|
||||
|
||||
export const parameters = {
|
||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||
|
||||
@@ -20,3 +20,16 @@ import "@navikt/ds-css"
|
||||
Dette vil også legge css-variabler på :root. For å få dette til å fungere med IE11, kan denne pakken tas i bruk: https://jhildenbiddle.github.io/css-vars-ponyfill/#/
|
||||
|
||||
Note: Disse komponentene kan ikke garanteres at fungerer som forventet i IE11 da vi har valgt og ikke unngå styling-valg basert på IE11 støtte eller ikke.
|
||||
|
||||
## Bruke styled-components eller emotion
|
||||
|
||||
Flere av våre komponenter er implementert med OverridableComponent. Dette vil si at komponenten tar i mot en prop, `as` som lar deg endre hvilken tag som blir satt.
|
||||
Bruk for dette er eks hvis du ønsker `Heading` stilen, men ikke en heading-tag. Da kan man lett skrive `<Heading as="div">` og man vil få en `div`-tag istedenfor.
|
||||
|
||||
Flere css-in-js bibliotek har også denne funksjonaliteten bygd inne, noe som kan komplisere ting når alle bruker samme navn `as` for dette.
|
||||
|
||||
### Løsninger
|
||||
|
||||
[Styled-components](https://styled-components.com/docs/api#forwardedas-prop)
|
||||
|
||||
> TLDR: Bruk `forwardedAs` istendenfor `as` på komponentene, SD fikser resten.
|
||||
@@ -0,0 +1,255 @@
|
||||
import { Meta } from "@storybook/addon-docs";
|
||||
|
||||
<Meta title="ds-react/Migration" />
|
||||
|
||||
# Migreringsguider
|
||||
|
||||
## Migrering til ds-react v0.11, ds-css v0.10
|
||||
|
||||
### ErrorSummary
|
||||
|
||||
- ErrorSummaryItem -> ErrorSummary.Item
|
||||
Må da slette import "ErrorSummaryItem" da denne ikke er eksponert alene lengre
|
||||
|
||||
### SearchField
|
||||
|
||||
- SearchFieldButton -> SearchField.Button
|
||||
- SearchFieldClearButton -> SearchField.Clear
|
||||
- SearchFieldInput -> SearchField.Input
|
||||
|
||||
SearchFieldButton, SearchFieldClearButton og SearchFieldInput må da slettes fra imports da de ikke er eksponert lengre.
|
||||
|
||||
### CopyToClipBoard
|
||||
|
||||
Komponenten er flyttet til pakkene "@navikt/ds-react-internal" og "@navikt/ds-css-internal". API er ikke endret
|
||||
så fikses med
|
||||
|
||||
```bash
|
||||
yarn install @navikt/ds-react-internal @navikt/ds-css-internal
|
||||
```
|
||||
|
||||
## Migrering til ds-react, ds-css v0.8.0
|
||||
|
||||
Denne guiden vil være til hjelp for de som allerede har begynt å ta i bruk de nye pakkene våre tidligere enn v0.8.0.
|
||||
For de som ikke har begynt å ta i bruk pakkene kan man se bort fra denne.
|
||||
|
||||
Fra versjon v0.7 til v0.8 er det komment flere store endringer både i ds-react og ds-css. For å lettere
|
||||
oppdatere til v0.8 har vi da laget en liten guide som forklarer de største endringene.
|
||||
|
||||
## Styling
|
||||
|
||||
De fleste komponenter har fått diverse justering på styling. Anbefales da å ta en rask sjekk om alt fortsatt stemmer
|
||||
etter oppdateringen.
|
||||
|
||||
## Sizing
|
||||
|
||||
Alle komponenter som tidligere var implementert med `size`-prop har fått oppdatert
|
||||
props fra "xs", "s", "m", "l", "xl", "2xl" -> "xsmall", "small", "medium", "large", "xlarge", "2xlarge".
|
||||
|
||||
Dette betyr også at css-stylingen er eks endret fra `.navds-body-short--s` -> `.navds-body-short--small`
|
||||
|
||||
## Overridable component
|
||||
|
||||
Komponenter som tidligere implementerte ovveridable component med bruk av `component`-prop bruker nå `as`.
|
||||
Implementasjonen av OverridableComponent er WIP så kan hende typene ender opp med å krangle i enkelte tilfeller. Om så ta gjerne kontakt med oss
|
||||
slik at vi får sett på det tilfellet!
|
||||
|
||||
```jsx
|
||||
/* Før */
|
||||
<BodyShort component="span" />
|
||||
|
||||
/* Etter */
|
||||
<BodyShort as="span" />
|
||||
```
|
||||
|
||||
## Navneendringer
|
||||
|
||||
### Buttons
|
||||
|
||||
- `Primary` -> `Secondary` (Normal)
|
||||
- `Action` -> `Primary` (Hoved)
|
||||
- `Secondary` -> `Tertiary` (Flat)
|
||||
|
||||
For alle som har brukt `<Button />` så må man fikse slik at riktige knapper blir brukt der de skal!
|
||||
|
||||
## Nytt
|
||||
|
||||
- GuidePanel (veilederpanel)
|
||||
- HelpText (Hjeleptext)
|
||||
|
||||
### Typography
|
||||
|
||||
Vi har valgt å endre fra `<Title/>` -> `<Heading/>` i typografien vår da dette ga mer mening i bruk.
|
||||
APIet til komponenten er ikke endret borsett fra "Sizing" endringene nevt lengre opp, så skal bare være en rask search/replace.
|
||||
|
||||
For de som har brukt css-en direkte, eks `navds-title` så må man endre til `navds-heading`
|
||||
|
||||
Endret `Header` -> `PageHeader`, samme som er nevnt ang endringen over gjelder her også: sjekk css hvis brukt direkte.
|
||||
|
||||
## Fjernet komponenter
|
||||
|
||||
Fjernet da den var utdaterte/må ses mer på
|
||||
|
||||
- ProductPageLayout
|
||||
|
||||
## Typography
|
||||
|
||||
Linjehøyder for alle typo-komponentene er oppdatert til å matche figma.
|
||||
|
||||
Lagt til en Heading lvl 6 og size="xsmall"
|
||||
|
||||
## AccordionMenu
|
||||
|
||||
Implementert med dot-notation
|
||||
|
||||
- Trenger bare importere AccordionMenu
|
||||
- AccordionMenuCollapsable -> AccordionMenu.Collapsable
|
||||
- AccordionMenuItem -> AccordionMenu.Item
|
||||
|
||||
## Accordion
|
||||
|
||||
Implementert med dot-notation
|
||||
|
||||
- Trenger bare importere Accordion nå
|
||||
|
||||
Fragmenterte komponenten:
|
||||
|
||||
- Accordion -> Accordion.Item
|
||||
- Header -> Accordion.Header
|
||||
- children -> Accordion.Content
|
||||
|
||||
La til prop: `defaultOpen` på `Accordion.Item`
|
||||
|
||||
```jsx
|
||||
/* Før */
|
||||
<Accordion heading="tittel" open={open} onClick={(open) => setOpen(!open)}>
|
||||
Eu magna fugiat officia
|
||||
</Accordion>
|
||||
<Accordion heading="tittel2" open={open2} onClick={(open2) => setOpen(!open2)}>
|
||||
Eu magna fugiat officia
|
||||
</Accordion>
|
||||
|
||||
/* Etter */
|
||||
<Accordion>
|
||||
<Accordion.Item open={open}>
|
||||
<Accordion.Header onClick={(open) => setOpen(!open)}>
|
||||
Accordion header text
|
||||
</Accordion.Header>
|
||||
<Accordion.Content>
|
||||
Magna aliquip aliquip fugiat nostrud nostrud velit pariatur veniam officia
|
||||
laboris voluptate officia pariatur.Lorem est ex anim velit
|
||||
</Accordion.Content>
|
||||
</Accordion.Item>
|
||||
<Accordion.Item open={open2}>
|
||||
<Accordion.Header onClick={(open2) => setOpen(!open2)}>
|
||||
Accordion header text
|
||||
</Accordion.Header>
|
||||
<Accordion.Content>
|
||||
Magna aliquip aliquip fugiat nostrud nostrud velit pariatur veniam officia
|
||||
laboris voluptate officia pariatur.Lorem est ex anim velit
|
||||
</Accordion.Content>
|
||||
</Accordion.Item>
|
||||
</Accordion>
|
||||
```
|
||||
|
||||
## Alert
|
||||
|
||||
- La til `fullWidth`-prop for alert uten border-radius og width 100%
|
||||
- La til `inline`-prop for alert med transparent border/background og 0 padding.
|
||||
|
||||
## Button
|
||||
|
||||
Oppdatert med Overridablecomponent.
|
||||
|
||||
Håndtering av sentrering, margins er oppdatert. Trenger ikke wrappe tekst med `span` når man skal bruke ikoner lengre.
|
||||
|
||||
Hvis man skal manuelt justere på alignment av innhold, eks bruke `flex-direction: column` må man sette
|
||||
det på css-klassen `.navds-button__inner` da children er wrappet i den.
|
||||
|
||||
## CopyToClipboard
|
||||
|
||||
Ekstender nå ButtonProps, slik at man eks kan ta i bruk `size`-proppen
|
||||
|
||||
`text`-prop -> `copyText`
|
||||
`label`-prop -> `popoverText`
|
||||
|
||||
Fjernet `icon`-prop, la til `popoverPlacement`
|
||||
|
||||
## Modal
|
||||
|
||||
Implementert med dot-notasjon
|
||||
|
||||
Innholds-padding er flyttet fra Modal -> Modal.Content
|
||||
|
||||
```
|
||||
/* Før */
|
||||
<Modal>Modal innhold</Modal>
|
||||
|
||||
/* Etter */
|
||||
<Modal><Modal.Content>Modal innhold</Modal.Content></Modal>
|
||||
```
|
||||
|
||||
## LinkPanel
|
||||
|
||||
Implementert med dot-notasjon
|
||||
|
||||
```jsx
|
||||
/* Før */
|
||||
<LinkPanel href="#">Consectetur eu duis aliqua eu irure fugiat fugiat eu.</LinkPanel>
|
||||
|
||||
/* Etter */
|
||||
<LinkPanel href="#">
|
||||
<LinkPanel.Title>
|
||||
Consectetur eu duis aliqua eu irure fugiat fugiat eu.
|
||||
</LinkPanel.Title>
|
||||
</LinkPanel>
|
||||
```
|
||||
|
||||
Kan nå legge til en beskrivelse med `Linkpanel.Description`
|
||||
|
||||
```jsx
|
||||
<LinkPanel href="#">
|
||||
<LinkPanel.Title>
|
||||
Consectetur eu duis aliqua eu irure fugiat fugiat eu.
|
||||
</LinkPanel.Title>
|
||||
<LinkPanel.Description>Aliqua id aliquip Lorem esse</LinkPanel.Description>
|
||||
</LinkPanel>
|
||||
```
|
||||
|
||||
## Popover
|
||||
|
||||
Implementert med dot-notasjon
|
||||
|
||||
Får nå padding rundt innhold med Popover.Content
|
||||
|
||||
```jsx
|
||||
|
||||
/* Før */
|
||||
|
||||
<Popover>Popover innhold</Popover>
|
||||
|
||||
/* Etter */
|
||||
|
||||
<Popover>
|
||||
<Popover.Content>Modal innhold</Popover.Content>
|
||||
</Popover>
|
||||
```
|
||||
|
||||
## Header -> PageHeader
|
||||
|
||||
Props må fikses for de som har brukt denne komponenten, i tilleg til å endre navn.
|
||||
|
||||
- `variant`-prop -> `align`
|
||||
- `theme`-prop -> `variant`
|
||||
|
||||
## MicroCard
|
||||
|
||||
- Oppdatert med OverridableComponent
|
||||
|
||||
## SpeechBubble
|
||||
|
||||
Implementert med Dot-notasjon
|
||||
|
||||
- `<Bubble/>` -> `<SpeechBubble.Bubble/>`
|
||||
|
||||
Bubble er fortsatt eksportert så vil ikke brekke noe for de som har begynt å ta denne i bruk.
|
||||
@@ -0,0 +1,269 @@
|
||||
import { Table as DsTable } from "@navikt/ds-react";
|
||||
import {
|
||||
SuccessFilled as SuccessIcon,
|
||||
ErrorFilled as ErrorIcon,
|
||||
} from "@navikt/ds-icons";
|
||||
import styled from "styled-components";
|
||||
|
||||
const Success = styled(SuccessIcon)`
|
||||
color: var(--navds-color-green-50);
|
||||
`;
|
||||
|
||||
const Error = styled(ErrorIcon)`
|
||||
color: var(--navds-color-red-50);
|
||||
`;
|
||||
|
||||
const Table = styled(DsTable)`
|
||||
.navds-table__cell > svg,
|
||||
.navds-table__cell > span {
|
||||
vertical-align: middle;
|
||||
margin-left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
`;
|
||||
|
||||
type CompT = {
|
||||
name: string;
|
||||
status: Partial<[boolean, boolean, boolean]>;
|
||||
desc?: React.ReactNode;
|
||||
};
|
||||
|
||||
const Components: CompT[] = [
|
||||
{
|
||||
name: "Alertstriper",
|
||||
status: [true, true, true],
|
||||
desc: "Navn: Alert",
|
||||
},
|
||||
{ name: "Chevron", status: [false], desc: "" },
|
||||
{
|
||||
name: "Core",
|
||||
status: [true, true, false],
|
||||
desc: <code>@navikt/ds-css</code>,
|
||||
},
|
||||
{
|
||||
name: "Ekspanderbartpanel",
|
||||
status: [true, true, true],
|
||||
desc: "Navn: Accordion, styling ikke oppdatert til nyeste versjon",
|
||||
},
|
||||
{ name: "Etiketter", status: [true, true, false], desc: "Navn: Tag" },
|
||||
{
|
||||
name: "Fullbreddeknapp-style",
|
||||
status: [false],
|
||||
desc: "",
|
||||
},
|
||||
{ name: "Grid", status: [true, true, false], desc: "Navn: Grid" },
|
||||
{ name: "Hjelpetekst", status: [true, true, true], desc: "Navn: HelpText" },
|
||||
{
|
||||
name: "Ikoner-assets",
|
||||
status: [true, true, true],
|
||||
desc: <code>@navikt/ds-icons</code>,
|
||||
},
|
||||
{
|
||||
name: "js-utils",
|
||||
status: [true, true, false],
|
||||
desc:
|
||||
"Diverse util-funksjoner blir eksponert gjennom ds-react, men tar for det meste i bruk npm pakker",
|
||||
},
|
||||
{ name: "Knapper", status: [true, true, true], desc: "Navn: Button" },
|
||||
{ name: "Lenkepanel", status: [true, true, true], desc: "Navn: LinkPanel" },
|
||||
{ name: "Lenker", status: [true, true, true], desc: "Navn: Link" },
|
||||
{ name: "Lesmerpanel", status: [false], desc: "" },
|
||||
{ name: "Lukknapp", status: [false], desc: `Bruk Button med "Close"-ikon` },
|
||||
{ name: "Modal", status: [true, true, true], desc: "Navn: Modal" },
|
||||
{ name: "Paneler", status: [true, true, true], desc: "Navn: Panel" },
|
||||
{
|
||||
name: "Bekrefcheckbokspanel",
|
||||
status: [true, true, true],
|
||||
desc: "Navn: ConfirmationPanel",
|
||||
},
|
||||
{
|
||||
name: "Checkbokspanel-gruppe",
|
||||
status: [false],
|
||||
desc: "Panel-versjon vil ikke tas videre i nytt system",
|
||||
},
|
||||
{
|
||||
name: "Checkbokspanel",
|
||||
status: [false],
|
||||
desc: "Panel-versjon vil ikke tas videre i nytt system",
|
||||
},
|
||||
{
|
||||
name: "Checkbox-gruppe",
|
||||
status: [true, true, true],
|
||||
desc: "Navn: CheckboxGroup",
|
||||
},
|
||||
{ name: "Checkbox", status: [true, true, true], desc: "Navn: Checkbox" },
|
||||
{
|
||||
name: "Feiloppsummering",
|
||||
status: [true, true, false],
|
||||
desc: "Navn: ErrorSummary, API vil bli endret for denne",
|
||||
},
|
||||
{
|
||||
name: "Fnr-input",
|
||||
status: [false],
|
||||
desc:
|
||||
"Skjema-elementer med validering vil ikke bli lagt til med det første, men vil diskuteres i fremtiden",
|
||||
},
|
||||
{ name: "Input", status: [true, true, true], desc: "Navn: TextField" },
|
||||
{
|
||||
name: "Label",
|
||||
status: [false],
|
||||
desc: "Skjema-elementer fikser dette selv",
|
||||
},
|
||||
{ name: "Radio-Gruppe", status: [true, true, true], desc: "RadioGroup" },
|
||||
{ name: "Radio", status: [true, true, true], desc: "Navn: Radio" },
|
||||
{
|
||||
name: "Radiopanel-gruppe",
|
||||
status: [false],
|
||||
desc: "Panel-versjon vil ikke tas videre i nytt system",
|
||||
},
|
||||
{
|
||||
name: "Radio-panel",
|
||||
status: [false],
|
||||
desc: "Panel-versjon vil ikke tas videre i nytt system",
|
||||
},
|
||||
{ name: "Select", status: [true, true, true], desc: "Navn: Select" },
|
||||
{ name: "Skjema-gruppe", status: [true, true, true], desc: "Navn: Fieldset" },
|
||||
{
|
||||
name: "Skjemaelement-feilemelding",
|
||||
status: [false],
|
||||
desc: "",
|
||||
},
|
||||
{ name: "Textarea", status: [true, true, true], desc: "Navn: Textarea" },
|
||||
{ name: "Togglegruppe", status: [true, false, false], desc: "" },
|
||||
{ name: "ToggleKnapp", status: [true, false, false], desc: "" },
|
||||
{
|
||||
name: "Toggle",
|
||||
status: [true, false, false],
|
||||
desc: "Vil bli samme komponent som ToggleKnapp",
|
||||
},
|
||||
{ name: "Popover", status: [true, true, true], desc: "Navn: Popover" },
|
||||
{ name: "Snakkeboble", status: [true, true, true], desc: "SpeechBubble" },
|
||||
{ name: "Spinner", status: [true, true, true], desc: "Navn: Loader" },
|
||||
{ name: "Stegindikator", status: [true, false, false], desc: "" },
|
||||
{
|
||||
name: "Tabell-style",
|
||||
status: [true, true, false],
|
||||
desc: "Navn: Table, Er nå publisert som React-component",
|
||||
},
|
||||
{ name: "Tabs", status: [true, false, false], desc: "" },
|
||||
{ name: "Tekstomrade", status: [false], desc: "" },
|
||||
{
|
||||
name: "Typografi",
|
||||
status: [true, true, true],
|
||||
desc: "Navn: se typography-mappen i storybook",
|
||||
},
|
||||
{ name: "veileder", status: [false], desc: "" },
|
||||
{
|
||||
name: "Veilederpanel",
|
||||
status: [true, true, true],
|
||||
desc: "Navn: GuidePanel",
|
||||
},
|
||||
];
|
||||
|
||||
const NewComps: CompT[] = [
|
||||
{
|
||||
name: "AccordionMenu",
|
||||
status: [true, true, true],
|
||||
desc: "",
|
||||
},
|
||||
{
|
||||
name: "SearcField",
|
||||
status: [true, true, false],
|
||||
desc: "Denne vil undergå større endringer",
|
||||
},
|
||||
{
|
||||
name: "MicroCard",
|
||||
status: [true, true, false],
|
||||
desc: "Vil flyttes over i egen navno pakke for eksterne sider",
|
||||
},
|
||||
{
|
||||
name: "PageHeader",
|
||||
status: [true, true, false],
|
||||
desc: "Vil flyttes over i egen navno pakke for eksterne sider",
|
||||
},
|
||||
{
|
||||
name: "CopyToClipboard",
|
||||
status: [true, true, false],
|
||||
desc: "Vil flyttes over til @navikt/ds-react-internal pakke",
|
||||
},
|
||||
{
|
||||
name: "Table",
|
||||
status: [true, true, false],
|
||||
desc:
|
||||
"Implementer stylingen til nav-frontend-table-styles, API vil videreutvikles",
|
||||
},
|
||||
{
|
||||
name: "Switch",
|
||||
status: [true, false, false],
|
||||
desc: "",
|
||||
},
|
||||
{
|
||||
name: "Tooltip",
|
||||
status: [true, false, false],
|
||||
desc: "",
|
||||
},
|
||||
{
|
||||
name: "Timeline",
|
||||
status: [true, false, false],
|
||||
desc: "",
|
||||
},
|
||||
];
|
||||
|
||||
const CompTable = ({ list }) => (
|
||||
<Table>
|
||||
<Table.Header>
|
||||
<Table.Row>
|
||||
<Table.HeaderCell>Komponent</Table.HeaderCell>
|
||||
<Table.HeaderCell>Med i nytt system</Table.HeaderCell>
|
||||
<Table.HeaderCell>Publisert i pakker</Table.HeaderCell>
|
||||
<Table.HeaderCell>Fullført**</Table.HeaderCell>
|
||||
<Table.HeaderCell>Info</Table.HeaderCell>
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
{list.map((comp) => {
|
||||
return (
|
||||
<Table.Row>
|
||||
<Table.HeaderCell>{comp.name}</Table.HeaderCell>
|
||||
<Table.DataCell>
|
||||
{comp.status?.[0] === undefined ? (
|
||||
<span>-</span>
|
||||
) : comp.status?.[0] ? (
|
||||
<Success />
|
||||
) : (
|
||||
<Error />
|
||||
)}
|
||||
</Table.DataCell>
|
||||
<Table.DataCell>
|
||||
{comp.status?.[1] === undefined ? (
|
||||
<span>-</span>
|
||||
) : comp.status?.[1] ? (
|
||||
<Success />
|
||||
) : (
|
||||
<Error />
|
||||
)}
|
||||
</Table.DataCell>
|
||||
<Table.DataCell>
|
||||
{comp.status?.[2] === undefined ? (
|
||||
<span>-</span>
|
||||
) : comp.status?.[1] ? (
|
||||
<Success />
|
||||
) : (
|
||||
<Error />
|
||||
)}
|
||||
</Table.DataCell>
|
||||
<Table.DataCell>{comp.desc ? comp.desc : "-"}</Table.DataCell>
|
||||
</Table.Row>
|
||||
);
|
||||
})}
|
||||
</Table.Body>
|
||||
</Table>
|
||||
);
|
||||
|
||||
export const NewCompTable = () => {
|
||||
return <CompTable list={NewComps} />;
|
||||
};
|
||||
|
||||
export const OldCompTable = () => {
|
||||
return <CompTable list={Components} />;
|
||||
};
|
||||
@@ -1,16 +1,30 @@
|
||||
import { Meta } from "@storybook/addon-docs";
|
||||
import { NewCompTable, OldCompTable } from "./roadmap-table.tsx";
|
||||
|
||||
<Meta title="ds-react/Roadmap" />
|
||||
|
||||
# Plan videre
|
||||
# Roadmap
|
||||
|
||||
Arbeidet med det nye pakke-oppsettet har nå foregått en stund og skulle egentlig vært
|
||||
lengre på vei en det er nå. Men arbeidet har på ingen måte stoppet opp! Vi jobber kontinuerlig med
|
||||
å finne bedre løsninger for å kunne bygge systemet opp fra bunnen av. Dette innegår da
|
||||
ny dokumentasjons-side bygd med Sanity, nye byggeblokker helt fra token-nivå og bedre sizing for eksterne/interne sider. Dette vil da forhåpentligvis la oss
|
||||
bygge mer robuste og fleksible løsninger for fremtiden.
|
||||
## Komponenter
|
||||
|
||||
(Rekkefølgen representer ikke faktisk tidsline eller prioritet)
|
||||
\*\* Fullført betyr i denne konteksten at vi føler API-et er ok og da kan forvente mindre breaking changes.
|
||||
Komponenten kan fortsatt bli utsatt for endringer i selve designet.
|
||||
|
||||
### Nye komponenter / wip
|
||||
|
||||
<NewCompTable />
|
||||
|
||||
### Migrering av gamle komponenter
|
||||
|
||||
<OldCompTable />
|
||||
|
||||
## Plan videre
|
||||
|
||||
Vi jobber kontinuerlig med å finne bedre løsninger for å kunne bygge systemet opp fra bunnen av. Dette innegår da
|
||||
ny dokumentasjon-side under Verktøykassen, nye byggeblokker helt fra token-nivå og bedre sizing for eksterne/interne sider.
|
||||
Dette vil la oss bygge mer robuste og fleksible løsninger for fremtiden som skal være bedre tilpasset produktene våre.
|
||||
|
||||
(Rekkefølgen representer ikke faktisk tidslinje)
|
||||
|
||||
## Tokens
|
||||
|
||||
@@ -20,12 +34,11 @@ Dette vil gjøre styling og overriding av komponenter enklere da man kan bruke c
|
||||
## Intern / Ekstern sizing
|
||||
|
||||
Komponenter tilpasses og standariseres bedre for skillet mellom interne/eksterne flater.
|
||||
Løsning er ikke fast bestemt, men eksempel på dette er `size="s" -> 32px, size="m"-> 48px`.
|
||||
Dette vil da eksempelvis kunne være en standard som er gjennomgående for de fleste komponentene.
|
||||
Eksempel på dette er `size="small" -> 32px, size="medium"-> 48px`.
|
||||
|
||||
## Ny dokumentasjon-side
|
||||
|
||||
Vi bygger en ny side for å dokumentere systemet, og mer rundt utvikling/design i nav med "Verktøykassen"
|
||||
Vi bygger en ny side for å dokumentere systemet, og mer rundt utvikling/design i NAV med "Verktøykassen"
|
||||
|
||||
## Migrere komponenter/styling fra nav-frontend-\* -> `@navikt/ds-css / @navikt/ds-react`
|
||||
|
||||
@@ -44,14 +57,8 @@ eks darkmode.
|
||||
Dette er noe vi ikke har på planene for tiden, men etterhvert som ting faller på plass så vil dette være
|
||||
noe vi kunne ta en titt på hvis vi ser at det trengs.
|
||||
|
||||
## Feature-flagging
|
||||
|
||||
Ideen om å ta i bruk feature-flagging er noe som virker veldig interessant og vil da se på muligheten for å kunne levere
|
||||
større endringe i feature-flags for testing, og da publisere under eks major-bump i faste intervaller. Dette vil da kunne
|
||||
gjøre det enklere for deg som consumer av pakkene å ha oversikt over endringer og hva som må migreres.
|
||||
|
||||
## Versjonering
|
||||
|
||||
To av de nye pakkene under `@navikt`, da `ds-css` og `ds-react` er nå versjonert under to store pakker med alle komponentene. I fremtiden vil vi se på å
|
||||
De nye pakkene under `@navikt`, da `ds-css` og `ds-react` er nå versjonert under to store pakker med alle komponentene. I fremtiden vil vi se på å
|
||||
ha både samversjonering (alle pakker under en eks ds-react versjon) og induvduell verjsonering da eks ds-react/button har en egen versjon
|
||||
slik at man kan ha mer finkontroll over komponentbruk på siden sin.
|
||||
@@ -6,7 +6,7 @@ module.exports = (baseConfig) => {
|
||||
test: /\.css$/,
|
||||
use: ["style-loader", "css-loader"],
|
||||
include: [
|
||||
path.resolve(__dirname, "../node_modules/@navikt/ds-css/index.css"),
|
||||
path.resolve(__dirname, "../node_modules/@navikt/core/css/index.css"),
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
# Designsystem v2
|
||||
# Designsystem v2
|
||||
|
||||
Storybook: https://navikt.github.io/Designsystemet/
|
||||
@@ -1,3 +1,11 @@
|
||||
:root {
|
||||
--navds-accordion-menu-color-text: var(--navds-color-text-link);
|
||||
--navds-accordion-menu-color-text-focus: var(--navds-color-darkgray);
|
||||
--navds-accordion-menu-color-background-hover: var(--navds-color-blue-10);
|
||||
--navds-accordion-menu-color-text-active: var(--navds-color-text);
|
||||
--navds-accordion-menu-outline-focus: var(--navds-text-focus);
|
||||
}
|
||||
|
||||
.navds-accordion-menu__list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
@@ -18,7 +26,7 @@
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
color: var(--navds-color-text-link);
|
||||
color: var(--navds-accordion-menu-color-text);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@@ -31,7 +39,7 @@
|
||||
|
||||
.navds-accordion-menu-collapsable__expand-icon {
|
||||
font-size: 1.5rem;
|
||||
color: var(--navds-color-text-link);
|
||||
color: var(--navds-accordion-menu-color);
|
||||
flex-shrink: 0;
|
||||
margin-left: var(--navds-spacing-2);
|
||||
}
|
||||
@@ -73,18 +81,23 @@
|
||||
|
||||
.navds-accordion-menu-item:focus,
|
||||
.navds-accordion-menu-collapsable__button:focus {
|
||||
outline: 3px solid var(--navds-text-focus);
|
||||
outline: 3px solid var(--navds-accordion-menu-outline-focus);
|
||||
outline-offset: -3px;
|
||||
color: var(--navds-color-darkgray);
|
||||
color: var(--navds-accordion-menu-color-text-focus);
|
||||
}
|
||||
|
||||
.navds-accordion-menu-collapsable__button:focus
|
||||
> .navds-accordion-menu-collapsable__expand-icon {
|
||||
color: var(--navds-accordion-menu-color-focus);
|
||||
}
|
||||
|
||||
.navds-accordion-menu-item:hover,
|
||||
.navds-accordion-menu-collapsable__button:hover {
|
||||
background-color: var(--navds-color-blue-10);
|
||||
background-color: var(--navds-accordion-menu-color-background-hover);
|
||||
}
|
||||
|
||||
.navds-accordion-menu-item--active {
|
||||
box-shadow: inset 0.5rem 0 var(--navds-color-text-link);
|
||||
color: var(--navds-color-text);
|
||||
color: var(--navds-accordion-menu-color-text-active);
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
:root {
|
||||
--navds-accordion-color-text: var(--navds-color-darkgray);
|
||||
--navds-accordion-color-background: var(--navds-color-background);
|
||||
--navds-accordion-color-text-hover: var(--navds-color-blue-50);
|
||||
--navds-accordion-color-border-hover: var(--navds-color-blue-50);
|
||||
--navds-accordion-color-border-focus: var(--navds-color-background);
|
||||
}
|
||||
|
||||
.navds-accordion .ReactCollapse--collapse {
|
||||
transition: height 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.navds-accordion {
|
||||
background: var(--navds-accordion-color-background);
|
||||
}
|
||||
|
||||
.navds-accordion__header:focus {
|
||||
outline: none;
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
border-color: var(--navds-accordion-color-border-focus);
|
||||
}
|
||||
|
||||
.navds-accordion__header:hover {
|
||||
color: var(--navds-accordion-color-text-hover);
|
||||
border-color: var(--navds-accordion-color-border-hover);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.navds-accordion__expand-icon {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.navds-accordion__expand-icon--flip {
|
||||
transform: rotateZ(180deg);
|
||||
}
|
||||
|
||||
.navds-accordion__header {
|
||||
padding: var(--navds-spacing-4) var(--navds-spacing-3);
|
||||
background: transparent;
|
||||
text-align: left;
|
||||
border: none;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 2px solid #a0a0a0;
|
||||
gap: var(--navds-spacing-4);
|
||||
}
|
||||
|
||||
.navds-accordion__content {
|
||||
color: var(--navds-accordion-color-text);
|
||||
padding: var(--navds-spacing-5) var(--navds-spacing-3) var(--navds-spacing-10);
|
||||
}
|
||||
|
||||
.navds-accordion__expand-icon--filled {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navds-accordion__header:hover
|
||||
> .navds-accordion__expand-icon.navds-accordion__expand-icon--filled {
|
||||
display: inherit;
|
||||
}
|
||||
|
||||
.navds-accordion__header:hover > .navds-accordion__expand-icon {
|
||||
display: none;
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
:root {
|
||||
--navds-alert-color-border: var(--navds-color-gray-40);
|
||||
--navds-alert-color-error-border: var(--navds-color-error-border);
|
||||
--navds-alert-color-error-background: var(--navds-color-error-background);
|
||||
--navds-alert-color-warning-border: var(--navds-color-warning-border);
|
||||
--navds-alert-color-warning-background: var(--navds-color-warning-background);
|
||||
--navds-alert-color-info-border: var(--navds-color-info-border);
|
||||
--navds-alert-color-info-background: var(--navds-color-info-background);
|
||||
--navds-alert-color-success-border: var(--navds-color-success-border);
|
||||
--navds-alert-color-success-background: var(--navds-color-success-background);
|
||||
--navds-alert-color-error-icon: var(--navds-color-red-60);
|
||||
--navds-alert-color-error-icon-background: var(--navds-color-white);
|
||||
--navds-alert-color-warning-icon: var(--navds-color-orange-40);
|
||||
--navds-alert-color-warning-icon-background: var(--navds-color-darkgray);
|
||||
--navds-alert-color-info-icon: var(--navds-color-lightblue-70);
|
||||
--navds-alert-color-info-icon-background: var(--navds-color-white);
|
||||
--navds-alert-color-success-icon: var(--navds-color-green-70);
|
||||
--navds-alert-color-success-icon-background: var(--navds-color-white);
|
||||
}
|
||||
|
||||
.navds-alert {
|
||||
border-radius: 4px;
|
||||
border: 1px solid;
|
||||
border-color: var(--navds-alert-color-border);
|
||||
padding: calc(var(--navds-spacing-4) + 1px) calc(var(--navds-spacing-4) + 1px);
|
||||
display: flex;
|
||||
gap: var(--navds-spacing-3);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navds-alert__wrapper {
|
||||
max-width: 43.5rem;
|
||||
}
|
||||
|
||||
.navds-alert--small {
|
||||
padding: calc(var(--navds-spacing-1) - 1px) var(--navds-spacing-4);
|
||||
}
|
||||
|
||||
.navds-alert--full-width {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.navds-alert > .navds-alert__icon {
|
||||
flex-shrink: 0;
|
||||
font-size: 1.5rem;
|
||||
align-self: flex-start;
|
||||
height: var(--navds-font-line-height-xlarge);
|
||||
}
|
||||
|
||||
.navds-alert--small > .navds-alert__icon {
|
||||
font-size: 1.25rem;
|
||||
height: var(--navds-font-line-height-large);
|
||||
}
|
||||
|
||||
.navds-alert--error {
|
||||
border-color: var(--navds-alert-color-error-border);
|
||||
background-color: var(--navds-alert-color-error-background);
|
||||
}
|
||||
|
||||
.navds-alert--error > .navds-alert__icon {
|
||||
color: var(--navds-alert-color-error-icon);
|
||||
background: radial-gradient(
|
||||
circle,
|
||||
var(--navds-alert-color-error-icon-background) 50%,
|
||||
0,
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.navds-alert--warning {
|
||||
border-color: var(--navds-alert-color-warning-border);
|
||||
background-color: var(--navds-alert-color-warning-background);
|
||||
}
|
||||
|
||||
.navds-alert--warning > .navds-alert__icon {
|
||||
color: var(--navds-alert-color-warning-icon);
|
||||
background: radial-gradient(
|
||||
circle,
|
||||
var(--navds-alert-color-warning-icon-background) 50%,
|
||||
0,
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.navds-alert--info {
|
||||
border-color: var(--navds-alert-color-info-border);
|
||||
background-color: var(--navds-alert-color-info-background);
|
||||
}
|
||||
|
||||
.navds-alert--info > .navds-alert__icon {
|
||||
color: var(--navds-alert-color-info-icon);
|
||||
background: radial-gradient(
|
||||
circle,
|
||||
var(--navds-alert-color-info-icon-background) 50%,
|
||||
0,
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.navds-alert--success {
|
||||
border-color: var(--navds-alert-color-success-border);
|
||||
background-color: var(--navds-alert-color-success-background);
|
||||
}
|
||||
|
||||
.navds-alert--success > .navds-alert__icon {
|
||||
color: var(--navds-alert-color-success-icon);
|
||||
background: radial-gradient(
|
||||
circle,
|
||||
var(--navds-alert-color-success-icon-background) 50%,
|
||||
0,
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.navds-alert--inline {
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
padding: 0;
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -7,6 +7,7 @@
|
||||
@import "utility.css";
|
||||
|
||||
/* Disabled because of UU concerns */
|
||||
|
||||
/* @import "smooth-scroll.css"; */
|
||||
|
||||
html {
|
||||
@@ -14,8 +15,8 @@ html {
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -9,7 +9,8 @@
|
||||
* https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
||||
*/
|
||||
|
||||
.sr-only {
|
||||
.sr-only,
|
||||
.navds-sr-only {
|
||||
border: 0;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
height: 1px;
|
||||
@@ -32,7 +33,9 @@
|
||||
*/
|
||||
|
||||
.sr-only.focusable:active,
|
||||
.sr-only.focusable:focus {
|
||||
.sr-only.focusable:focus,
|
||||
.navds-sr-only.focusable:active,
|
||||
.navds-sr-only.focusable:focus {
|
||||
clip: auto;
|
||||
height: auto;
|
||||
margin: 0;
|
||||
@@ -0,0 +1,208 @@
|
||||
:root {
|
||||
/* Primary */
|
||||
--navds-button-color-primary-text: var(--navds-color-white);
|
||||
--navds-button-color-primary-border-focus: var(--navds-color-white);
|
||||
--navds-button-color-primary-background: var(--navds-color-action-default);
|
||||
--navds-button-color-primary-background-hover: var(
|
||||
--navds-color-action-hover
|
||||
);
|
||||
--navds-button-color-primary-background-active: var(
|
||||
--navds-color-action-active
|
||||
);
|
||||
|
||||
/* Secondary */
|
||||
--navds-button-color-secondary-text: var(--navds-color-action-default);
|
||||
--navds-button-color-secondary-text-hover: var(--navds-color-text-inverse);
|
||||
--navds-button-color-secondary-text-active: var(--navds-color-text-inverse);
|
||||
--navds-button-color-secondary-border: var(--navds-color-action-default);
|
||||
--navds-button-color-secondary-border-focus-active-hover: var(
|
||||
--navds-color-white
|
||||
);
|
||||
--navds-button-color-secondary-background: var(--navds-color-background);
|
||||
--navds-button-color-secondary-background-hover: var(
|
||||
--navds-color-action-hover
|
||||
);
|
||||
--navds-button-color-secondary-background-active: var(
|
||||
--navds-color-action-active
|
||||
);
|
||||
|
||||
/* Tertiary */
|
||||
--navds-button-color-tertiary-text: var(--navds-color-action-default);
|
||||
--navds-button-color-tertiary-text-active: var(--navds-color-text-inverse);
|
||||
--navds-button-color-tertiary-border-hover: var(--navds-color-action-default);
|
||||
--navds-button-color-tertiary-border-focus: var(--navds-color-action-default);
|
||||
--navds-button-color-tertiary-border-active: var(--navds-color-white);
|
||||
--navds-button-color-tertiary-background-active: var(
|
||||
--navds-color-action-active
|
||||
);
|
||||
|
||||
/* Danger */
|
||||
--navds-button-color-danger-text: var(--navds-color-white);
|
||||
--navds-button-color-danger-background: var(--navds-color-danger-default);
|
||||
--navds-button-color-danger-background-hover: var(--navds-color-danger-hover);
|
||||
--navds-button-color-danger-background-active: var(
|
||||
--navds-color-danger-active
|
||||
);
|
||||
--navds-button-color-danger-border-focus: var(--navds-color-white);
|
||||
|
||||
/* Disabled */
|
||||
--navds-button-color-text-disabled: var(--navds-color-text-inverse);
|
||||
--navds-button-color-background-disabled: var(--navds-color-disabled);
|
||||
}
|
||||
|
||||
.navds-button {
|
||||
display: inline-flex;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
background: none;
|
||||
border-radius: 2px;
|
||||
min-width: 48px;
|
||||
padding: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-button--small {
|
||||
padding-top: 0.375rem;
|
||||
padding-bottom: 0.375rem;
|
||||
min-width: 32px;
|
||||
}
|
||||
|
||||
.navds-button:focus {
|
||||
outline: none;
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button__inner {
|
||||
margin: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-button svg {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.navds-button--small svg {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
/*************************
|
||||
* .navds-button--primary *
|
||||
*************************/
|
||||
|
||||
.navds-button--primary {
|
||||
background-color: var(--navds-button-color-primary-background);
|
||||
color: var(--navds-button-color-primary-text);
|
||||
}
|
||||
|
||||
.navds-button--primary:hover {
|
||||
background-color: var(--navds-button-color-primary-background-hover);
|
||||
}
|
||||
|
||||
.navds-button--primary:active {
|
||||
background-color: var(--navds-button-color-primary-background-active);
|
||||
}
|
||||
|
||||
.navds-button--primary:focus {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-primary-border-focus),
|
||||
var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
/**************************
|
||||
* .navds-button--secondary *
|
||||
**************************/
|
||||
|
||||
.navds-button--secondary {
|
||||
color: var(--navds-button-color-secondary-text);
|
||||
background-color: var(--navds-button-color-secondary-background);
|
||||
box-shadow: inset 0 0 0 2px var(--navds-button-color-secondary-border);
|
||||
}
|
||||
|
||||
.navds-button--secondary:hover {
|
||||
color: var(--navds-button-color-secondary-text-hover);
|
||||
background-color: var(--navds-button-color-secondary-background-hover);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.navds-button--secondary:focus {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-button-color-secondary-border),
|
||||
var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--secondary:active {
|
||||
color: var(--navds-button-color-secondary-text-active);
|
||||
background-color: var(--navds-button-color-secondary-background-active);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.navds-button--secondary:focus:hover,
|
||||
.navds-button--secondary:focus:active {
|
||||
box-shadow: inset 0 0 0 1px
|
||||
var(--navds-button-color-secondary-border-focus-active-hover),
|
||||
var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
/****************************
|
||||
* .navds-button--tertiary *
|
||||
****************************/
|
||||
|
||||
.navds-button--tertiary {
|
||||
color: var(--navds-button-color-tertiary-text);
|
||||
}
|
||||
|
||||
.navds-button--tertiary:hover {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-button-color-tertiary-border-hover);
|
||||
}
|
||||
|
||||
.navds-button--tertiary:focus {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-button-color-tertiary-border-focus),
|
||||
var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--tertiary:active {
|
||||
color: var(--navds-button-color-tertiary-text-active);
|
||||
background-color: var(--navds-button-color-tertiary-background-active);
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-tertiary-border-active);
|
||||
}
|
||||
|
||||
.navds-button--tertiary:active:focus {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-tertiary-border-active),
|
||||
var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
/*************************
|
||||
* .navds-button--danger *
|
||||
*************************/
|
||||
|
||||
.navds-button--danger {
|
||||
background-color: var(--navds-button-color-danger-background);
|
||||
color: var(--navds-button-color-danger-text);
|
||||
}
|
||||
|
||||
.navds-button--danger:hover {
|
||||
background-color: var(--navds-button-color-danger-background-hover);
|
||||
}
|
||||
|
||||
.navds-button--danger:active {
|
||||
background-color: var(--navds-button-color-danger-background-active);
|
||||
}
|
||||
|
||||
.navds-button--danger:focus {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-danger-border-focus),
|
||||
var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
/**************************
|
||||
* .navds-button:disabled *
|
||||
**************************/
|
||||
|
||||
.navds-button:disabled {
|
||||
color: var(--navds-button-color-text-disabled);
|
||||
background-color: var(--navds-button-color-background-disabled);
|
||||
cursor: not-allowed;
|
||||
box-shadow: none;
|
||||
transform: none;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
:root {
|
||||
--navds-card-micro-color-text: var(--navds-color-text-primary);
|
||||
--navds-card-micro-color-background: var(--navds-color-orange-20);
|
||||
--navds-card-micro-color-border: transparent;
|
||||
--navds-card-micro-color-text-hover: var(--navds-color-blue-50);
|
||||
--navds-card-micro-color-background-hover: var(--navds-color-white);
|
||||
--navds-card-micro-color-border-hover: var(--navds-color-blue-50);
|
||||
--navds-card-micro-color-text-focus: var(--navds-color-blue-50);
|
||||
--navds-card-micro-color-background-focus: var(--navds-color-white);
|
||||
--navds-card-micro-color-shadow-focus: var(--navds-color-blue-80);
|
||||
--navds-card-micro-color-background-active: var(--navds-color-blue-70);
|
||||
--navds-card-micro-color-text-active: var(--navds-color-white);
|
||||
}
|
||||
|
||||
/*
|
||||
MicroCard
|
||||
*/
|
||||
|
||||
.navds-card__micro {
|
||||
border-radius: 1rem;
|
||||
color: var(--navds-card-micro-color-text);
|
||||
display: inline-flex;
|
||||
padding: var(--navds-spacing-1) var(--navds-spacing-2);
|
||||
text-decoration: none;
|
||||
background-color: var(--navds-card-micro-color-background);
|
||||
border: 1px solid var(--navds-card-micro-color-border);
|
||||
}
|
||||
|
||||
.navds-card__micro:hover {
|
||||
background-color: var(--navds-card-micro-color-background-hover);
|
||||
border-color: var(--navds-card-micro-color-border-hover);
|
||||
color: var(--navds-card-micro-color-text-hover);
|
||||
}
|
||||
|
||||
.navds-card__micro:focus {
|
||||
background-color: var(--navds-card-micro-color-background-focus);
|
||||
color: var(--navds-card-micro-color-text-focus);
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px var(--navds-card-micro-color-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-card__micro:active {
|
||||
background-color: var(--navds-card-micro-color-background-active);
|
||||
color: var(--navds-card-micro-color-text-active);
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,13 @@
|
||||
.navds-checkbox-group--small > .navds-checkboxes {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.navds-fieldset.navds-checkbox-group--medium > .navds-checkboxes {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.navds-fieldset.navds-checkbox-group--medium > .navds-fieldset__error {
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
:root {
|
||||
--navds-checkbox-color-background: var(--navds-color-white);
|
||||
--navds-checkbox-color-border: var(--navds-color-gray-60);
|
||||
--navds-checkbox-color-label-hover: var(--navds-color-blue-50);
|
||||
--navds-checkbox-color-border-hover: var(--navds-color-blue-50);
|
||||
--navds-checkbox-color-background-hover: var(--navds-color-blue-10);
|
||||
--navds-checkbox-color-description: var(--navds-color-gray-80);
|
||||
--navds-checkbox-color-border-checked: var(--navds-color-blue-50);
|
||||
--navds-checkbox-color-background-checked: var(--navds-color-blue-50);
|
||||
--navds-checkbox-color-shadow-error: var(--navds-color-red-50);
|
||||
--navds-checkbox-color-border-error: var(--navds-color-red-50);
|
||||
|
||||
/* Disabled */
|
||||
--navds-checkbox-color-label-disabled: var(--navds-color-gray-40);
|
||||
--navds-checkbox-color-border-disabled: var(--navds-color-gray-60);
|
||||
--navds-checkbox-color-background-disabled: var(--navds-color-gray-10);
|
||||
--navds-checkbox-color-border-checked-disabled: var(--navds-color-gray-40);
|
||||
--navds-checkbox-color-background-checked-disabled: var(
|
||||
--navds-color-gray-40
|
||||
);
|
||||
}
|
||||
|
||||
.navds-checkbox {
|
||||
position: relative;
|
||||
padding: var(--navds-spacing-3) 0;
|
||||
}
|
||||
|
||||
.navds-checkbox__input {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
left: -12px;
|
||||
margin: 0;
|
||||
opacity: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.navds-checkbox__label {
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
gap: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.navds-checkbox__description {
|
||||
padding-left: calc(48px - 12px);
|
||||
color: var(--navds-checkbox-color-description);
|
||||
}
|
||||
|
||||
.navds-checkbox--with-description {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.navds-checkbox .navds-error-message {
|
||||
margin-top: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-checkbox--with-description .navds-error-message {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.navds-checkbox--with-error-message {
|
||||
padding-bottom: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-checkbox__label::before {
|
||||
content: "";
|
||||
background-color: var(--navds-checkbox-color-background);
|
||||
border: 1px solid var(--navds-checkbox-color-border);
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.navds-checkbox--small {
|
||||
padding: var(--navds-spacing-1) 0;
|
||||
}
|
||||
|
||||
.navds-checkbox--small > .navds-checkbox__input {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
top: 2px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.navds-checkbox--small > .navds-checkbox__label::before {
|
||||
margin-top: -2px;
|
||||
margin-bottom: -2px;
|
||||
}
|
||||
|
||||
.navds-checkbox__input:hover + .navds-checkbox__label {
|
||||
color: var(--navds-checkbox-color-label-hover);
|
||||
}
|
||||
|
||||
.navds-checkbox__input:hover + .navds-checkbox__label::before {
|
||||
border-color: var(--navds-checkbox-color-border-hover);
|
||||
background-color: var(--navds-checkbox-color-background-hover);
|
||||
}
|
||||
|
||||
.navds-checkbox__input:focus + .navds-checkbox__label::before {
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-checkbox__input:checked + .navds-checkbox__label::before {
|
||||
background-image: var(--navds-checkmark-image-white);
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 75%;
|
||||
border: 2px solid var(--navds-checkbox-color-border-checked);
|
||||
background-color: var(--navds-checkbox-color-background-checked);
|
||||
}
|
||||
|
||||
.navds-checkbox__input:checked:focus + .navds-checkbox__label::before {
|
||||
background-color: white;
|
||||
background-image: var(--navds-checkmark-image-blue);
|
||||
}
|
||||
|
||||
.navds-checkbox--error
|
||||
> .navds-checkbox__input:not(:hover):not(:focus):not(:disabled):not(:checked)
|
||||
+ .navds-checkbox__label::before {
|
||||
box-shadow: 0 0 0 1px var(--navds-checkbox-color-shadow-error);
|
||||
border-color: var(--navds-checkbox-color-border-error);
|
||||
}
|
||||
|
||||
.navds-checkbox--small .navds-error-message {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.navds-checkbox__input:disabled,
|
||||
.navds-checkbox__input:disabled + .navds-checkbox__label {
|
||||
color: var(--navds-checkbox-color-label-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.navds-checkbox__input:disabled + .navds-checkbox__label::before {
|
||||
background-color: var(--navds-checkbox-color-background-disabled);
|
||||
border-color: var(--navds-checkbox-color-border-disabled);
|
||||
}
|
||||
|
||||
.navds-checkbox__input:disabled:checked + .navds-checkbox__label::before {
|
||||
background-color: var(--navds-checkbox-color-background-checked-disabled);
|
||||
border-color: var(--navds-checkbox-color-border-checked-disabled);
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
:root {
|
||||
--navds-confirmation-panel-color-background: var(
|
||||
--navds-color-warning-background
|
||||
);
|
||||
--navds-confirmation-panel-color-background-checked: var(
|
||||
--navds-color-success-background
|
||||
);
|
||||
--navds-confirmation-panel-color-border-checked: var(
|
||||
--navds-color-success-background
|
||||
);
|
||||
--navds-confirmation-panel-color-background-error: var(
|
||||
--navds-color-error-background
|
||||
);
|
||||
--navds-confirmation-panel-color-checkbox-background-checked-hover: var(
|
||||
--navds-color-green-70
|
||||
);
|
||||
--navds-confirmation-panel-color-checkbox-border-checked-hover: var(
|
||||
--navds-color-green-70
|
||||
);
|
||||
--navds-confirmation-panel-color-checkbox-background-checked: var(
|
||||
--navds-color-green-50
|
||||
);
|
||||
--navds-confirmation-panel-color-checkbox-border-checked: var(
|
||||
--navds-color-green-50
|
||||
);
|
||||
--navds-confirmation-panel-color-checkbox-label-checked: var(
|
||||
--navds-color-darkgray
|
||||
);
|
||||
}
|
||||
|
||||
.navds-confirmation-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--navds-spacing-4);
|
||||
padding: var(--navds-spacing-4);
|
||||
border-radius: 4px;
|
||||
background-color: var(--navds-confirmation-panel-color-background);
|
||||
transition: background-color linear 100ms;
|
||||
}
|
||||
|
||||
.navds-confirmation-panel__content {
|
||||
max-width: 80ch;
|
||||
}
|
||||
|
||||
.navds-confirmation-panel--small {
|
||||
padding: var(--navds-spacing-3);
|
||||
gap: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-confirmation-panel--checked {
|
||||
background-color: var(--navds-confirmation-panel-color-background-checked);
|
||||
border-color: var(--navds-confirmation-panel-color-border-checked);
|
||||
}
|
||||
|
||||
.navds-confirmation-panel--error {
|
||||
background-color: var(--navds-confirmation-panel-color-background-error);
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.navds-confirmation-panel
|
||||
.navds-checkbox__input:hover
|
||||
+ .navds-checkbox__label {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.navds-confirmation-panel--checked
|
||||
.navds-checkbox__input:hover
|
||||
+ .navds-checkbox__label {
|
||||
color: var(--navds-confirmation-panel-color-checkbox-label-checked);
|
||||
}
|
||||
|
||||
.navds-confirmation-panel--checked
|
||||
.navds-checkbox__input
|
||||
+ .navds-checkbox__label::before {
|
||||
transition: none;
|
||||
background-color: var(
|
||||
--navds-confirmation-panel-color-checkbox-background-checked
|
||||
);
|
||||
border-color: var(--navds-confirmation-panel-color-checkbox-border-checked);
|
||||
background-image: var(--navds-checkmark-image-white);
|
||||
}
|
||||
|
||||
.navds-confirmation-panel--checked
|
||||
.navds-checkbox__input:hover
|
||||
+ .navds-checkbox__label::before {
|
||||
background-color: var(
|
||||
--navds-confirmation-panel-color-checkbox-background-checked-hover
|
||||
);
|
||||
border-color: var(
|
||||
--navds-confirmation-panel-color-checkbox-border-checked-hover
|
||||
);
|
||||
}
|
||||
|
||||
.navds-confirmation-panel--checked
|
||||
.navds-checkbox__input:focus:hover
|
||||
+ .navds-checkbox__label::before {
|
||||
background-image: var(--navds-checkmark-image-white);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
:root {
|
||||
--navds-error-message-color-text: var(--navds-color-text-error);
|
||||
}
|
||||
|
||||
.navds-error-message {
|
||||
display: block;
|
||||
color: var(--navds-error-message-color-text);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
:root {
|
||||
--navds-error-summary-color-background: var(--navds-color-white);
|
||||
--navds-error-summary-color-border: var(--navds-color-error-border);
|
||||
}
|
||||
|
||||
.navds-error-summary {
|
||||
background-color: var(--navds-error-summary-color-background);
|
||||
padding: var(--navds-spacing-4);
|
||||
border: 4px solid var(--navds-error-summary-color-border);
|
||||
}
|
||||
|
||||
.navds-error-summary--small {
|
||||
padding: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-error-summary:focus {
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.navds-error-summary__list {
|
||||
margin: 1rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.navds-error-summary--small > .navds-error-summary__list {
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.navds-fieldset--s > :not(:first-child):not(:empty) {
|
||||
.navds-fieldset--small > :not(:first-child):not(:empty) {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.navds-form-field--s > :not(:first-child):not(:empty),
|
||||
.navds-form-field--s > input:not(:first-child) {
|
||||
.navds-form-field--small > :not(:first-child):not(:empty),
|
||||
.navds-form-field--small > input:not(:first-child) {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,13 @@
|
||||
.navds-radio-group--small > .navds-radio-buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.navds-fieldset.navds-radio-group--medium > .navds-radio-buttons {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.navds-fieldset.navds-radio-group--medium > .navds-fieldset__error {
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
:root {
|
||||
--navds-radio-color-description: var(--navds-color-gray-80);
|
||||
--navds-radio-color-background: var(--navds-color-white);
|
||||
--navds-radio-color-border: var(--navds-color-gray-60);
|
||||
--navds-radio-color-label-hover: var(--navds-color-blue-50);
|
||||
--navds-radio-color-border-hover: var(--navds-color-blue-50);
|
||||
--navds-radio-color-background-hover: var(--navds-color-blue-10);
|
||||
--navds-radio-color-border-checked: var(--navds-color-blue-50);
|
||||
--navds-radio-color-shadow-checked: var(--navds-color-blue-50);
|
||||
--navds-radio-color-shadow-checked-focus: var(--navds-color-blue-80);
|
||||
--navds-radio-color-shadow-background-checked-focus: var(--navds-color-white);
|
||||
--navds-radio-color-shadow-dot-checked-focus: var(--navds-color-blue-50);
|
||||
--navds-radio-color-shadow-error: var(--navds-color-red-50);
|
||||
--navds-radio-color-border-error: var(--navds-color-red-50);
|
||||
|
||||
/* Disabled */
|
||||
--navds-radio-color-background-disabled: var(--navds-color-gray-10);
|
||||
--navds-radio-color-border-disabled: var(--navds-color-gray-60);
|
||||
--navds-radio-color-label-disabled: var(--navds-color-gray-40);
|
||||
--navds-radio-color-background-disabled-checked: var(--navds-color-gray-40);
|
||||
--navds-radio-color-border-disabled-checked: var(--navds-color-gray-40);
|
||||
--navds-radio-color-shadow-disabled-checked: var(--navds-color-gray-40);
|
||||
}
|
||||
|
||||
.navds-radio {
|
||||
position: relative;
|
||||
padding: var(--navds-spacing-3) 0;
|
||||
}
|
||||
|
||||
.navds-radio--with-description .navds-error-message {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.navds-radio .navds-error-message {
|
||||
margin-top: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-radio__input {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
left: -12px;
|
||||
margin: 0;
|
||||
opacity: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.navds-radio__label {
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
gap: 12px;
|
||||
min-width: 48px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.navds-radio__description {
|
||||
padding-left: calc(48px - 12px);
|
||||
color: var(--navds-radio-color-description);
|
||||
}
|
||||
|
||||
.navds-radio--with-description {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.navds-radio--with-error-message {
|
||||
padding-bottom: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-radio__label::before {
|
||||
content: "";
|
||||
background-color: var(--navds-radio-color-background);
|
||||
border: 1px solid var(--navds-radio-color-border);
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
flex-shrink: 0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.navds-radio--small {
|
||||
padding: var(--navds-spacing-1) 0;
|
||||
}
|
||||
|
||||
.navds-radio--small > .navds-radio__input {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
top: 2px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.navds-radio--small > .navds-radio__label::before {
|
||||
margin-top: -2px;
|
||||
margin-bottom: -2px;
|
||||
}
|
||||
|
||||
.navds-radio__input:hover + .navds-radio__label {
|
||||
color: var(--navds-radio-color-label-hover);
|
||||
}
|
||||
|
||||
.navds-radio__input:hover + .navds-radio__label::before {
|
||||
border-color: var(--navds-radio-color-border-hover);
|
||||
background-color: var(--navds-radio-color-background-hover);
|
||||
}
|
||||
|
||||
.navds-radio__input:focus + .navds-radio__label::before {
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-radio__input:checked + .navds-radio__label::before {
|
||||
border: 2px solid var(--navds-radio-color-border-checked);
|
||||
box-shadow: 0 0 0 3px #fff inset,
|
||||
0 0 0 2rem var(--navds-radio-color-shadow-checked) inset;
|
||||
}
|
||||
|
||||
.navds-radio__input:checked:focus + .navds-radio__label::before {
|
||||
transition: box-shadow 200ms cubic-bezier(0.465, 0.183, 0.153, 0.946);
|
||||
box-shadow: 0 0 0 3px var(--navds-radio-color-shadow-checked-focus),
|
||||
0 0 0 3px var(--navds-radio-color-shadow-background-checked-focus) inset,
|
||||
0 0 0 2rem var(--navds-radio-color-shadow-dot-checked-focus) inset;
|
||||
}
|
||||
|
||||
.navds-radio--error
|
||||
> .navds-radio__input:not(:hover):not(:focus):not(:disabled):not(:checked)
|
||||
+ .navds-radio__label::before {
|
||||
box-shadow: 0 0 0 1px var(--navds-radio-color-shadow-error);
|
||||
border-color: var(--navds-radio-color-border-error);
|
||||
}
|
||||
|
||||
.navds-radio--small .navds-error-message {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.navds-radio__input:disabled,
|
||||
.navds-radio__input:disabled + .navds-radio__label {
|
||||
color: var(--navds-radio-color-label-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.navds-radio__input:disabled + .navds-radio__label::before {
|
||||
background-color: var(--navds-radio-color-background-disabled);
|
||||
border-color: var(--navds-radio-color-border-disabled);
|
||||
}
|
||||
|
||||
.navds-radio__input:disabled:checked + .navds-radio__label::before {
|
||||
background-color: var(--navds-radio-color-background-disabled-checked);
|
||||
border-color: var(--navds-radio-color-border-disabled-checked);
|
||||
box-shadow: 0 0 0 3px #fff inset,
|
||||
0 0 0 2rem var(--navds-radio-color-shadow-disabled-checked) inset;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
:root {
|
||||
--navds-search-field-color-shadow-error: var(--navds-color-red-50);
|
||||
--navds-search-field-color-border-error: var(--navds-color-red-50);
|
||||
--navds-search-field-color-clearbutton-border: var(--navds-color-gray-60);
|
||||
}
|
||||
|
||||
.navds-search-field__input-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-search-field__input {
|
||||
padding: 0.15rem;
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
.navds-search-field__input-wrapper > *:not(:first-child):not(:last-child) {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.navds-search-field__input-wrapper > :first-child {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.navds-search-field__input-wrapper > :last-child {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.navds-search-field__input-wrapper > :last-child:first-child {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.navds-search-field__input-wrapper :focus {
|
||||
z-index: var(--navds-z-index-focus);
|
||||
}
|
||||
|
||||
.navds-search-field__button,
|
||||
.navds-search-field__clear-button {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.navds-search-field--error
|
||||
.navds-search-field__input:not(:hover):not(:focus):not(:disabled) {
|
||||
box-shadow: 0 0 0 1px var(--navds-search-field-color-shadow-error) inset;
|
||||
border-color: var(--navds-search-field-color-border-error);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
:root {
|
||||
--navds-select-color-background: var(--navds-color-white);
|
||||
--navds-select-color-border: var(--navds-color-gray-60);
|
||||
--navds-select-color-border-hover: var(--navds-color-blue-50);
|
||||
--navds-select-color-border-error: var(--navds-color-red-50);
|
||||
--navds-select-color-shadow-error: var(--navds-color-red-50);
|
||||
--navds-select-color-border-disabled: var(--navds-color-gray-40);
|
||||
--navds-select-color-background-disabled: var(--navds-color-gray-10);
|
||||
--navds-select-color-text-disabled: var(--navds-color-darkgray);
|
||||
}
|
||||
|
||||
.navds-select__input {
|
||||
appearance: none;
|
||||
padding: 0.5rem;
|
||||
background-color: var(--navds-select-color-background);
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--navds-select-color-border);
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
min-height: 48px;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
padding-right: 2.5rem;
|
||||
}
|
||||
|
||||
.navds-select__input:hover {
|
||||
border-color: var(--navds-select-color-border-hover);
|
||||
}
|
||||
|
||||
.navds-select__input:focus {
|
||||
outline: none;
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-select__container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navds-select__chevron {
|
||||
position: absolute;
|
||||
font-size: 1rem;
|
||||
right: 0.5rem;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-select__input {
|
||||
min-height: 32px;
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
/**
|
||||
Error handling
|
||||
*/
|
||||
.navds-select--error > * select:not(:hover):not(:focus):not(:disabled) {
|
||||
box-shadow: 0 0 0 1px var(--navds-select-color-shadow-error);
|
||||
border-color: var(--navds-select-color-border-error);
|
||||
}
|
||||
|
||||
/* Disabled handling */
|
||||
.navds-select__input:disabled,
|
||||
.navds-select__input[read-only] {
|
||||
background-color: var(--navds-select-color-background-disabled);
|
||||
border-color: var(--navds-select-color-border-disabled);
|
||||
box-shadow: none;
|
||||
color: var(--navds-select-color-text-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
:root {
|
||||
--navds-text-field-color-background: var(--navds-color-white);
|
||||
--navds-text-field-color-border: var(--navds-color-gray-60);
|
||||
--navds-text-field-color-border-hover: var(--navds-color-blue-50);
|
||||
--navds-text-field-color-border-error: var(--navds-color-red-50);
|
||||
--navds-text-field-color-shadow-error: var(--navds-color-red-50);
|
||||
--navds-text-field-color-border-disabled: var(--navds-color-gray-40);
|
||||
--navds-text-field-color-background-disabled: var(--navds-color-gray-10);
|
||||
--navds-text-field-color-text-disabled: var(--navds-color-darkgray);
|
||||
}
|
||||
|
||||
.navds-text-field__input {
|
||||
appearance: none;
|
||||
padding: 0.5rem;
|
||||
background-color: var(--navds-text-field-color-background);
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--navds-text-field-color-border);
|
||||
min-height: 48px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.navds-form-field--small > .navds-text-field__input {
|
||||
padding: 0.15rem;
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
.navds-text-field__input:hover {
|
||||
border-color: var(--navds-text-field-color-border-hover);
|
||||
}
|
||||
|
||||
.navds-text-field__input:focus {
|
||||
outline: none;
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
/**
|
||||
Error handling
|
||||
*/
|
||||
.navds-text-field--error
|
||||
> .navds-text-field__input:not(:hover):not(:focus):not(:disabled) {
|
||||
box-shadow: 0 0 0 1px var(--navds-text-field-color-shadow-error);
|
||||
border-color: var(--navds-text-field-color-border-error);
|
||||
}
|
||||
|
||||
/* Disabled handling */
|
||||
.navds-text-field__input:disabled,
|
||||
.navds-text-field__input[readonly] {
|
||||
background-color: var(--navds-text-field-color-background-disabled);
|
||||
border-color: var(--navds-text-field-color-border-disabled);
|
||||
box-shadow: none;
|
||||
color: var(--navds-text-field-color-text-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes default search icon
|
||||
*/
|
||||
.navds-text-field__input[type="search"]::-webkit-search-decoration,
|
||||
.navds-text-field__input[type="search"]::-webkit-search-cancel-button,
|
||||
.navds-text-field__input[type="search"]::-webkit-search-results-button,
|
||||
.navds-text-field__input[type="search"]::-webkit-search-results-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
:root {
|
||||
--navds-textarea-color-background: var(--navds-color-white);
|
||||
--navds-textarea-color-border: var(--navds-color-gray-60);
|
||||
--navds-textarea-color-border-hover: var(--navds-color-blue-50);
|
||||
--navds-textarea-color-border-error: var(--navds-color-red-50);
|
||||
--navds-textarea-color-shadow-error: var(--navds-color-red-50);
|
||||
--navds-textarea-color-counter-text: var(--navds-color-gray-40);
|
||||
--navds-textarea-color-counter-text-error: var(--navds-color-red-50);
|
||||
--navds-textarea-color-text-disabled: var(--navds-color-darkgray);
|
||||
--navds-textarea-color-border-disabled: var(--navds-color-gray-40);
|
||||
--navds-textarea-color-background-disabled: var(--navds-color-gray-10);
|
||||
}
|
||||
|
||||
.navds-textarea__wrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.navds-textarea__input {
|
||||
appearance: none;
|
||||
padding: var(--navds-spacing-2);
|
||||
background-color: var(--navds-textarea-color-background);
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--navds-textarea-color-border);
|
||||
resize: none;
|
||||
width: 100%;
|
||||
transition: height 0.1s ease-out;
|
||||
display: block;
|
||||
min-height: 48px;
|
||||
}
|
||||
|
||||
.navds-textarea--counter {
|
||||
padding-bottom: var(--navds-spacing-8);
|
||||
}
|
||||
|
||||
.navds-textarea__input:hover {
|
||||
border-color: var(--navds-textarea-color-border-hover);
|
||||
}
|
||||
|
||||
.navds-textarea__input:focus {
|
||||
outline: none;
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-textarea__input {
|
||||
padding: var(--navds-spacing-1);
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-textarea--counter.navds-textarea__input {
|
||||
padding-bottom: var(--navds-spacing-7);
|
||||
}
|
||||
|
||||
.navds-textarea__counter {
|
||||
pointer-events: none;
|
||||
color: var(--navds-textarea-color-counter-text);
|
||||
font-style: italic;
|
||||
position: absolute;
|
||||
text-align: right;
|
||||
left: var(--navds-spacing-3);
|
||||
right: var(--navds-spacing-3);
|
||||
bottom: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-textarea__counter--error {
|
||||
color: var(--navds-textarea-color-counter-text-error);
|
||||
}
|
||||
|
||||
/**
|
||||
Error handling
|
||||
*/
|
||||
.navds-textarea--error
|
||||
.navds-textarea__input:not(:hover):not(:focus):not(:disabled) {
|
||||
box-shadow: 0 0 0 1px var(--navds-textarea-color-shadow-error);
|
||||
border-color: var(--navds-textarea-color-border-error);
|
||||
}
|
||||
|
||||
/*
|
||||
Disabled handling
|
||||
*/
|
||||
.navds-textarea__input:disabled,
|
||||
.navds-textarea__input[readonly] {
|
||||
background-color: var(--navds-textarea-color-background-disabled);
|
||||
border-color: var(--navds-textarea-color-border-disabled);
|
||||
box-shadow: none;
|
||||
color: var(--navds-textarea-color-text-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,76 @@
|
||||
:root {
|
||||
--navds-guide-panel-color-background: var(--navds-color-background);
|
||||
--navds-guide-panel-color-border: var(--navds-color-blue-40);
|
||||
--navds-guide-panel-color-illustration-background: var(--navds-color-blue-20);
|
||||
}
|
||||
|
||||
/**
|
||||
* GuidePanel component
|
||||
*/
|
||||
.navds-guide-panel {
|
||||
position: relative;
|
||||
padding-left: 2.5rem;
|
||||
}
|
||||
|
||||
.navds-guide-panel__content {
|
||||
background-color: var(--navds-guide-panel-color-background);
|
||||
border-radius: 4px;
|
||||
border: 2px solid var(--navds-guide-panel-color-border);
|
||||
min-height: 7.25rem;
|
||||
padding: 1.5rem;
|
||||
padding-left: 3.5rem;
|
||||
}
|
||||
|
||||
.navds-guide-panel--poster {
|
||||
padding-left: 0;
|
||||
padding-top: 3.125rem;
|
||||
}
|
||||
|
||||
.navds-guide-panel--poster .navds-guide-panel__content {
|
||||
padding: 2rem;
|
||||
padding-top: 4.25rem;
|
||||
}
|
||||
|
||||
.navds-guide-panel .navds-guide {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.navds-guide-panel--poster .navds-guide {
|
||||
left: 50%;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Guide component
|
||||
*/
|
||||
.navds-guide {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* Guide illustration frame */
|
||||
.navds-guide__illustration {
|
||||
background: var(--navds-guide-panel-color-illustration-background);
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.navds-guide__illustration svg,
|
||||
.navds-guide__illustration img {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Illustration sizes */
|
||||
.navds-guide__illustration--small {
|
||||
height: 5rem;
|
||||
width: 5rem;
|
||||
}
|
||||
|
||||
.navds-guide__illustration--medium {
|
||||
height: 6.25rem;
|
||||
width: 6.25rem;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
:root {
|
||||
--navds-help-text-color-button-background: transparent;
|
||||
--navds-help-text-color-icon: var(--navds-color-blue-50);
|
||||
--navds-help-text-color-icon-hover: var(--navds-color-white);
|
||||
--navds-help-text-color-icon-background-hover: var(--navds-color-blue-50);
|
||||
--navds-help-text-color-icon-shadow-hover: var(--navds-color-blue-50);
|
||||
--navds-help-text-color-icon-focus: var(--navds-color-white);
|
||||
--navds-help-text-color-icon-background-focus: var(--navds-color-blue-50);
|
||||
--navds-help-text-color-icon-shadow-focus: var(--navds-color-blue-80);
|
||||
--navds-help-text-color-popover-background: var(--navds-color-lightblue-10);
|
||||
}
|
||||
|
||||
.navds-help-text__button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
background-color: var(--navds-help-text-color-button-background);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navds-help-text__button:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.navds-help-text__icon {
|
||||
border-radius: 50%;
|
||||
font-size: 1.5rem;
|
||||
color: var(--navds-help-text-color-icon);
|
||||
}
|
||||
|
||||
.navds-help-text__button:hover > .navds-help-text__icon {
|
||||
color: var(--navds-help-text-color-icon-hover);
|
||||
background: var(--navds-help-text-color-icon-background-hover);
|
||||
box-shadow: 0 0 0 2px var(--navds-help-text-color-icon-shadow-hover);
|
||||
}
|
||||
|
||||
.navds-help-text__button:focus > .navds-help-text__icon {
|
||||
outline: none;
|
||||
color: var(--navds-help-text-color-icon-focus);
|
||||
background: var(--navds-help-text-color-icon-background-focus);
|
||||
box-shadow: 0 0 0 3px var(--navds-help-text-color-icon-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-help-text__popover > .navds-popover__arrow::before {
|
||||
background-color: var(--navds-help-text-color-popover-background);
|
||||
}
|
||||
|
||||
.navds-help-text__popover.navds-popover {
|
||||
background-color: var(--navds-help-text-color-popover-background);
|
||||
}
|
||||
@@ -6,12 +6,10 @@
|
||||
@import "accordion-menu.css";
|
||||
@import "alert.css";
|
||||
@import "button.css";
|
||||
@import "card.css";
|
||||
@import "content-container.css";
|
||||
@import "copy-to-clipboard.css";
|
||||
@import "header.css";
|
||||
@import "internal-header.css";
|
||||
@import "guide-panel.css";
|
||||
@import "form/index.css";
|
||||
@import "help-text.css";
|
||||
@import "link.css";
|
||||
@import "loader.css";
|
||||
@import "modal.css";
|
||||
@@ -20,3 +18,8 @@
|
||||
@import "panel.css";
|
||||
@import "link-panel.css";
|
||||
@import "speech-bubble.css";
|
||||
@import "table.css";
|
||||
|
||||
/* Navno spesific packages */
|
||||
@import "page-header.css";
|
||||
@import "card.css";
|
||||
@@ -1,19 +1,26 @@
|
||||
.navds-link-panel {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
color: var(--navds-color-gray-90);
|
||||
:root {
|
||||
--navds-link-panel-color-text: var(--navds-color-gray-90);
|
||||
--navds-link-panel-color-border-hover: var(--navds-color-blue-50);
|
||||
--navds-link-panel-color-title-hover: var(--navds-color-text-link);
|
||||
}
|
||||
|
||||
.navds-link-panel:hover .navds-link-panel-title {
|
||||
.navds-link-panel {
|
||||
text-decoration: none;
|
||||
color: var(--navds-link-panel-color-text);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-link-panel:hover .navds-link-panel__title {
|
||||
text-decoration: underline;
|
||||
color: var(--navds-color-text-link);
|
||||
color: var(--navds-link-panel-color-title-hover);
|
||||
}
|
||||
|
||||
.navds-link-panel:hover {
|
||||
box-shadow: var(--navds-shadow-hover);
|
||||
border-color: var(--navds-color-blue-50);
|
||||
border-color: var(--navds-link-panel-color-border-hover);
|
||||
}
|
||||
|
||||
.navds-link-panel:focus {
|
||||
@@ -22,12 +29,16 @@
|
||||
}
|
||||
|
||||
.navds-link-panel__chevron {
|
||||
flex-shrink: 0;
|
||||
font-size: 1.5rem;
|
||||
transition: transform 200ms;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.navds-link-panel:hover > .navds-link-panel__chevron,
|
||||
.navds-link-panel:focus-within > .navds-link-panel__chevron {
|
||||
transform: translateX(4px);
|
||||
}
|
||||
|
||||
.navds-link-panel__description {
|
||||
margin-top: var(--navds-spacing-2);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
:root {
|
||||
--navds-link-color-text: var(--navds-color-text-link);
|
||||
--navds-link-color-text-focus: var(--navds-color-text-inverse);
|
||||
--navds-link-color-text-active: var(--navds-color-text-inverse);
|
||||
--navds-link-color-background-focus: var(--navds-text-focus);
|
||||
--navds-link-color-background-active: var(--navds-text-focus);
|
||||
--navds-link-color-icon: var(--navds-color-text-link);
|
||||
--navds-link-color-icon-focus: var(--navds-color-text-inverse);
|
||||
--navds-link-color-on-info-background: var(--navds-color-text-primary);
|
||||
--navds-link-color-on-error-background: var(--navds-color-text-primary);
|
||||
}
|
||||
|
||||
.navds-link {
|
||||
color: var(--navds-link-color-text);
|
||||
text-decoration: underline;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--navds-spacing-1);
|
||||
}
|
||||
|
||||
.navds-alert--info .navds-link {
|
||||
color: var(--navds-link-color-on-info-background);
|
||||
}
|
||||
|
||||
.navds-alert--error .navds-link,
|
||||
.navds-confirmation-panel--error .navds-link {
|
||||
color: var(--navds-link-color-on-error-background);
|
||||
}
|
||||
|
||||
.navds-link:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.navds-link:focus {
|
||||
outline: none;
|
||||
color: var(--navds-link-color-text-focus);
|
||||
text-decoration: none;
|
||||
background-color: var(--navds-link-color-background-focus);
|
||||
box-shadow: var(--navds-text-shadow);
|
||||
}
|
||||
|
||||
.navds-link:active {
|
||||
outline: none;
|
||||
color: var(--navds-link-color-text-active);
|
||||
text-decoration: none;
|
||||
background-color: var(--navds-link-color-background-active);
|
||||
box-shadow: var(--navds-text-shadow);
|
||||
}
|
||||
|
||||
.navds-link svg {
|
||||
color: var(--navds-link-color-icon);
|
||||
}
|
||||
|
||||
.navds-link:focus svg {
|
||||
color: var(--navds-link-color-icon-focus);
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
:root {
|
||||
--navds-loader-color-foreground: var(--navds-color-gray-40);
|
||||
--navds-loader-color-background: var(--navds-color-gray-10);
|
||||
--navds-loader-color-neutral-foreground: var(--navds-color-gray-40);
|
||||
--navds-loader-color-interaction-foreground: var(--navds-color-blue-50);
|
||||
--navds-loader-color-inverted-foreground: var(--navds-color-white);
|
||||
--navds-loader-color-inverted-background: rgba(255, 255, 255, 0.3);
|
||||
--navds-loader-color-transparent-background: transparent;
|
||||
--navds-loader-color-on-button-background: rgba(255, 255, 255, 0.3);
|
||||
--navds-loader-color-on-button-foreground: currentColor;
|
||||
}
|
||||
|
||||
.navds-loader {
|
||||
width: 1.5rem;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
animation: loader-rotate 1.4s linear infinite;
|
||||
}
|
||||
|
||||
.navds-loader__foreground {
|
||||
animation: loader-dasharray 1.4s ease-in-out infinite;
|
||||
stroke-dasharray: 80px, 200px;
|
||||
stroke-dashoffset: 0;
|
||||
stroke: var(--navds-loader-color-foreground);
|
||||
}
|
||||
|
||||
.navds-loader__background {
|
||||
stroke: var(--navds-loader-color-background);
|
||||
}
|
||||
|
||||
.navds-loader--neutral .navds-loader__foreground {
|
||||
stroke: var(--navds-loader-color-neutral-foreground);
|
||||
}
|
||||
|
||||
.navds-loader--interaction .navds-loader__foreground {
|
||||
stroke: var(--navds-loader-color-interaction-foreground);
|
||||
}
|
||||
|
||||
.navds-loader--inverted .navds-loader__foreground {
|
||||
stroke: var(--navds-loader-color-inverted-foreground);
|
||||
}
|
||||
|
||||
.navds-loader--inverted .navds-loader__background {
|
||||
stroke: var(--navds-loader-color-inverted-background);
|
||||
}
|
||||
|
||||
.navds-loader--transparent .navds-loader__background {
|
||||
stroke: var(--navds-loader-color-transparent-background);
|
||||
}
|
||||
|
||||
.navds-loader--2xlarge {
|
||||
width: 4rem;
|
||||
}
|
||||
|
||||
.navds-loader--xlarge {
|
||||
width: 2.5rem;
|
||||
}
|
||||
|
||||
.navds-loader--large {
|
||||
width: 2rem;
|
||||
}
|
||||
|
||||
.navds-loader--medium {
|
||||
width: 1.5rem;
|
||||
}
|
||||
|
||||
.navds-loader--small {
|
||||
width: 1.25rem;
|
||||
}
|
||||
|
||||
.navds-loader--xsmall {
|
||||
width: 1rem;
|
||||
}
|
||||
|
||||
/*
|
||||
* Button spesific styling
|
||||
*/
|
||||
|
||||
.navds-button .navds-loader .navds-loader__foreground {
|
||||
stroke: var(--navds-loader-color-on-button-foreground);
|
||||
}
|
||||
|
||||
.navds-button:hover .navds-loader .navds-loader__background {
|
||||
stroke: var(--navds-loader-color-on-button-background);
|
||||
}
|
||||
|
||||
.navds-button:active .navds-loader .navds-loader__background {
|
||||
stroke: var(--navds-loader-color-on-button-background);
|
||||
}
|
||||
|
||||
.navds-button--primary .navds-loader .navds-loader__background,
|
||||
.navds-button--danger .navds-loader .navds-loader__background {
|
||||
stroke: var(--navds-loader-color-on-button-background);
|
||||
}
|
||||
|
||||
@keyframes loader-rotate {
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loader-dasharray {
|
||||
0% {
|
||||
stroke-dasharray: 1px, 200px;
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
stroke-dasharray: 100px, 200px;
|
||||
stroke-dashoffset: -15px;
|
||||
}
|
||||
|
||||
100% {
|
||||
stroke-dasharray: 100px, 200px;
|
||||
stroke-dashoffset: -120px;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,23 @@
|
||||
:root {
|
||||
--navds-modal-color-background: var(--navds-color-background);
|
||||
--navds-modal-color-overlay: var(--navds-color-modal-overlay);
|
||||
}
|
||||
|
||||
.ReactModal__Body--open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.navds-modal {
|
||||
background-color: var(--navds-color-background);
|
||||
padding: var(--navds-spacing-4);
|
||||
background-color: var(--navds-modal-color-background);
|
||||
border-radius: 4px;
|
||||
display: block;
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
max-height: 100%;
|
||||
z-index: var(--navds-z-index-modal-content);
|
||||
}
|
||||
|
||||
.navds-modal__content {
|
||||
padding: var(--navds-spacing-4);
|
||||
}
|
||||
|
||||
.navds-modal:focus,
|
||||
@@ -21,12 +28,12 @@
|
||||
|
||||
.navds-modal__overlay {
|
||||
position: fixed;
|
||||
z-index: var(--navds-z-index-modal-overlay);
|
||||
z-index: var(--navds-z-index-modal);
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: var(--navds-color-modal-overlay);
|
||||
background-color: var(--navds-modal-color-overlay);
|
||||
padding: var(--navds-spacing-4);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-css",
|
||||
"version": "0.7.4",
|
||||
"version": "0.10.0",
|
||||
"private": false,
|
||||
"description": "Css for NAV Designsystem components",
|
||||
"author": "NAV Designsystem team",
|
||||
@@ -18,13 +18,13 @@
|
||||
"main": "./dist/index.css",
|
||||
"scripts": {
|
||||
"build": "postcss --use postcss-import -o dist/index.css index.css",
|
||||
"watch-css": "postcss -w --use postcss-import -o dist/index.css index.css"
|
||||
"watch": "postcss --watch --use postcss-import -o dist/index.css index.css"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@navikt/ds-tokens": "^0.4.4",
|
||||
"@navikt/ds-tokens": "^0.5.3",
|
||||
"normalize.css": "^8.0.1",
|
||||
"postcss": "^8.2.7",
|
||||
"postcss": "^8.3.6",
|
||||
"postcss-cli": "^8.3.1",
|
||||
"postcss-import": "^14.0.0"
|
||||
"postcss-import": "^14.0.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
:root {
|
||||
--navds-page-header-color-background: var(--navds-color-background);
|
||||
--navds-page-header-color-shadow-situation: var(--navds-color-orange-40);
|
||||
--navds-page-header-color-shadow-product: var(--navds-color-green-40);
|
||||
--navds-page-header-color-shadow-guide: var(--navds-color-deepblue-40);
|
||||
}
|
||||
|
||||
.navds-page-header {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
background-color: var(--navds-page-header-color-background);
|
||||
padding-top: 1.5rem;
|
||||
padding-bottom: 1.5rem;
|
||||
padding-left: calc((100vw - 100%) / 2);
|
||||
padding-right: calc((100vw - 100%) / 2);
|
||||
margin-left: calc((100vw - 100%) / -2);
|
||||
margin-right: calc((100vw - 100%) / -2);
|
||||
}
|
||||
|
||||
.navds-page-header__wrapper {
|
||||
width: 100%;
|
||||
max-width: 56.5rem;
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
.navds-page-header__title {
|
||||
display: flex;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.navds-page-header--left > .navds-page-header__wrapper {
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
.navds-page-header--center > .navds-page-header__wrapper {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.navds-page-header__illustration {
|
||||
margin-right: 1.5rem;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.navds-page-header__illustration > svg {
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
}
|
||||
|
||||
.navds-page-header--situation {
|
||||
box-shadow: 0 -4px 0 var(--navds-page-header-color-shadow-situation) inset;
|
||||
}
|
||||
.navds-page-header--product {
|
||||
box-shadow: 0 -4px 0 var(--navds-page-header-color-shadow-product) inset;
|
||||
}
|
||||
.navds-page-header--guide {
|
||||
box-shadow: 0 -4px 0 var(--navds-page-header-color-shadow-guide) inset;
|
||||
}
|
||||
|
||||
@media (max-width: 649px) {
|
||||
.navds-page-header__illustration > svg {
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
}
|
||||
.navds-page-header__title {
|
||||
font-size: var(--navds-font-size-heading-xlarge);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
:root {
|
||||
--navds-panel-color-background: var(--navds-color-white);
|
||||
--navds-panel-color-border: var(--navds-color-border);
|
||||
}
|
||||
|
||||
.navds-panel {
|
||||
background-color: var(--navds-panel-color-background);
|
||||
padding: var(--navds-spacing-4);
|
||||
border-radius: var(--navds-border-radius);
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.navds-panel--border {
|
||||
border-color: var(--navds-panel-color-border);
|
||||
}
|
||||
@@ -1,9 +1,20 @@
|
||||
:root {
|
||||
--navds-popover-color-background: var(--navds-color-background);
|
||||
--navds-popover-color-border: var(--navds-color-gray-40);
|
||||
--navds-popover-color-shadow: var(--navds-color-gray-20);
|
||||
}
|
||||
|
||||
.navds-popover {
|
||||
z-index: var(--navds-z-index-popover-default);
|
||||
background-color: var(--navds-color-background);
|
||||
box-shadow: 0 0.05rem 0.25rem 0.125rem rgba(0, 0, 0, 0.08);
|
||||
border: var(--navds-border-default);
|
||||
border-radius: 2px;
|
||||
z-index: var(--navds-z-index-popover);
|
||||
background-color: var(--navds-popover-color-background);
|
||||
box-shadow: 0 2px 4px 0 var(--navds-popover-color-shadow);
|
||||
border: 1px solid;
|
||||
border-color: var(--navds-popover-color-border);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.navds-popover__content {
|
||||
padding: var(--navds-spacing-4);
|
||||
}
|
||||
|
||||
.navds-popover--hidden {
|
||||
@@ -16,22 +27,20 @@
|
||||
}
|
||||
|
||||
.navds-popover__arrow {
|
||||
z-index: var(--navds-z-index-popover-arrow);
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.navds-popover__arrow::before {
|
||||
content: "";
|
||||
display: block;
|
||||
content: "";
|
||||
transform: rotate(45deg);
|
||||
background-color: var(--navds-popover-color-background);
|
||||
border: 1px solid;
|
||||
border-color: var(--navds-popover-color-border);
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
transform: rotate(45deg);
|
||||
background-color: var(--navds-color-background);
|
||||
border: var(--navds-border-default);
|
||||
}
|
||||
|
||||
.navds-popover__arrow::before .navds-popover--small {
|
||||
width: 0.67rem;
|
||||
height: 0.67rem;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.navds-popover[data-popper-placement^="top"] > .navds-popover__arrow {
|
||||
@@ -1,3 +1,13 @@
|
||||
:root {
|
||||
--navds-speechbubble-color-background: var(--navds-color-gray-10);
|
||||
--navds-speechbubble-color-shadow: var(--navds-color-gray-20);
|
||||
--navds-speechbubble-color-illustration: var(--navds-color-darkgray);
|
||||
--navds-speechbubble-color-illustration-background: var(
|
||||
--navds-color-gray-20
|
||||
);
|
||||
--navds-speechbubble-color-detail-text: var(--navds-color-gray-60);
|
||||
}
|
||||
|
||||
.navds-speechbubble {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
@@ -23,8 +33,8 @@
|
||||
|
||||
.navds-speechbubble__illustration {
|
||||
align-items: center;
|
||||
background: var(--navds-color-gray-20);
|
||||
color: var(--navds-color-darkgray);
|
||||
background: var(--navds-speechbubble-color-illustration-background);
|
||||
color: var(--navds-speechbubble-color-illustration);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
@@ -42,10 +52,10 @@
|
||||
|
||||
.navds-speechbubble__bubble {
|
||||
padding: 1rem;
|
||||
box-shadow: 0 2px 4px 0 var(--navds-color-gray-20);
|
||||
box-shadow: 0 2px 4px 0 var(--navds-speechbubble-color-shadow);
|
||||
width: fit-content;
|
||||
max-width: 37.5rem;
|
||||
background-color: var(--navds-color-gray-10);
|
||||
background-color: var(--navds-speechbubble-color-background);
|
||||
border-radius: 12px;
|
||||
border-bottom-left-radius: 2px;
|
||||
display: flex;
|
||||
@@ -61,9 +71,12 @@
|
||||
.navds-speechbubble--right .navds-speechbubble__bubble {
|
||||
border-radius: 12px;
|
||||
border-bottom-right-radius: 2px;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.navds-speechbubble__top-text {
|
||||
color: var(--navds-color-gray-60);
|
||||
color: var(--navds-speechbubble-color-detail-text);
|
||||
}
|
||||
|
||||
.navds-speechbubble--right .navds-speechbubble__top-text {
|
||||
align-self: flex-end;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
.navds-table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.navds-table__header {
|
||||
display: table-header-group;
|
||||
}
|
||||
|
||||
.navds-table__body {
|
||||
display: table-row-group;
|
||||
}
|
||||
|
||||
.navds-table__row {
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
.navds-table__cell {
|
||||
display: table-cell;
|
||||
padding: var(--navds-spacing-4);
|
||||
text-align: left;
|
||||
border-bottom: var(--navds-border-default);
|
||||
}
|
||||
|
||||
.navds-table--small .navds-table__cell {
|
||||
padding: var(--navds-spacing-2);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
:root {
|
||||
--navds-tag-color-border: var(--navds-color-gray-40);
|
||||
--navds-tag-color-background: var(--navds-color-gray-10);
|
||||
--navds-tag-color-info-background: var(--navds-color-tag-info-background);
|
||||
--navds-tag-color-info-border: var(--navds-color-tag-info-border);
|
||||
--navds-tag-color-warning-background: var(
|
||||
--navds-color-tag-warning-background
|
||||
);
|
||||
--navds-tag-color-warning-border: var(--navds-color-tag-warning-border);
|
||||
--navds-tag-color-success-background: var(
|
||||
--navds-color-tag-success-background
|
||||
);
|
||||
--navds-tag-color-success-border: var(--navds-color-tag-success-border);
|
||||
--navds-tag-color-error-background: var(--navds-color-tag-error-background);
|
||||
--navds-tag-color-error-border: var(--navds-color-tag-error-border);
|
||||
}
|
||||
|
||||
.navds-tag {
|
||||
border: 1px solid;
|
||||
border-color: var(--navds-tag-color-border);
|
||||
border-radius: 4px;
|
||||
background-color: var(--navds-tag-color-background);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.125rem var(--navds-spacing-3);
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
.navds-tag--small {
|
||||
min-height: 24px;
|
||||
padding-right: var(--navds-spacing-1);
|
||||
padding-left: var(--navds-spacing-1);
|
||||
}
|
||||
|
||||
.navds-tag--error {
|
||||
background-color: var(--navds-tag-color-error-background);
|
||||
border-color: var(--navds-tag-color-error-border);
|
||||
}
|
||||
|
||||
.navds-tag--success {
|
||||
background-color: var(--navds-tag-color-success-background);
|
||||
border-color: var(--navds-tag-color-success-border);
|
||||
}
|
||||
|
||||
.navds-tag--warning {
|
||||
background-color: var(--navds-tag-color-warning-background);
|
||||
border-color: var(--navds-tag-color-warning-border);
|
||||
}
|
||||
|
||||
.navds-tag--info {
|
||||
background-color: var(--navds-tag-color-info-background);
|
||||
border-color: var(--navds-tag-color-info-border);
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
/* Heading */
|
||||
.navds-heading {
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navds-heading--2xlarge {
|
||||
font-size: var(--navds-font-size-heading-2xlarge);
|
||||
letter-spacing: -0.01em;
|
||||
line-height: var(--navds-font-line-height-heading-2xlarge);
|
||||
}
|
||||
|
||||
.navds-heading--2xlarge.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-5);
|
||||
}
|
||||
|
||||
.navds-heading--xlarge {
|
||||
font-size: var(--navds-font-size-heading-xlarge);
|
||||
letter-spacing: -0.008em;
|
||||
line-height: var(--navds-font-line-height-heading-xlarge);
|
||||
}
|
||||
|
||||
.navds-heading--xlarge.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-4);
|
||||
}
|
||||
|
||||
.navds-heading--large {
|
||||
font-size: var(--navds-font-size-heading-large);
|
||||
letter-spacing: -0.004em;
|
||||
line-height: var(--navds-font-line-height-heading-large);
|
||||
}
|
||||
|
||||
.navds-heading--large.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-heading--medium {
|
||||
font-size: var(--navds-font-size-heading-medium);
|
||||
letter-spacing: -0.002em;
|
||||
line-height: var(--navds-font-line-height-heading-medium);
|
||||
}
|
||||
|
||||
.navds-heading--medium.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-heading--small {
|
||||
font-size: var(--navds-font-size-heading-small);
|
||||
letter-spacing: -0.001em;
|
||||
line-height: var(--navds-font-line-height-heading-small);
|
||||
}
|
||||
|
||||
.navds-heading--small.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-heading--xsmall {
|
||||
font-size: var(--navds-font-size-heading-xsmall);
|
||||
letter-spacing: -0.001em;
|
||||
line-height: var(--navds-font-line-height-heading-xsmall);
|
||||
}
|
||||
|
||||
.navds-heading--xsmall.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
/* Ingress */
|
||||
.navds-ingress {
|
||||
font-size: var(--navds-font-size-xlarge);
|
||||
font-weight: var(--navds-font-weight-regular);
|
||||
letter-spacing: -0.001em;
|
||||
line-height: var(--navds-font-line-height-xlarge);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navds-ingress.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-10);
|
||||
}
|
||||
|
||||
/* Body */
|
||||
.navds-body-long {
|
||||
font-size: var(--navds-font-size-large);
|
||||
font-weight: var(--navds-font-weight-regular);
|
||||
letter-spacing: 0;
|
||||
line-height: var(--navds-font-line-height-xlarge);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navds-body-long.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-7);
|
||||
}
|
||||
|
||||
.navds-body-long--small {
|
||||
font-size: var(--navds-font-size-medium);
|
||||
letter-spacing: 0.002em;
|
||||
line-height: var(--navds-font-line-height-large);
|
||||
}
|
||||
|
||||
.navds-body-long--small.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-6);
|
||||
}
|
||||
|
||||
.navds-body-short {
|
||||
font-size: var(--navds-font-size-large);
|
||||
font-weight: var(--navds-font-weight-regular);
|
||||
letter-spacing: 0;
|
||||
line-height: var(--navds-font-line-height-large);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navds-body-short.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-body-short--small {
|
||||
font-size: var(--navds-font-size-medium);
|
||||
letter-spacing: 0.002em;
|
||||
line-height: var(--navds-font-line-height-medium);
|
||||
}
|
||||
|
||||
.navds-body-short--small.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
/* Label */
|
||||
.navds-label {
|
||||
font-size: var(--navds-font-size-large);
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
letter-spacing: 0;
|
||||
line-height: var(--navds-font-line-height-large);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navds-label.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-label--small {
|
||||
font-size: var(--navds-font-size-medium);
|
||||
letter-spacing: 0.002em;
|
||||
line-height: var(--navds-font-line-height-medium);
|
||||
}
|
||||
|
||||
.navds-label--small.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
/* Small text */
|
||||
.navds-detail {
|
||||
font-size: var(--navds-font-size-small);
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
letter-spacing: 0.004em;
|
||||
line-height: var(--navds-font-line-height-medium);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navds-detail.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-detail--small {
|
||||
font-weight: var(--navds-font-weight-regular);
|
||||
}
|
||||
|
||||
.navds-detail--small.navds-typo--spacing {
|
||||
margin-bottom: var(--navds-spacing-2);
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
/src
|
||||
/png
|
||||
@@ -0,0 +1,16 @@
|
||||
const template = require("./template");
|
||||
|
||||
module.exports = {
|
||||
typescript: true,
|
||||
ref: true,
|
||||
icon: true,
|
||||
titleProp: true,
|
||||
svgProps: {
|
||||
focusable: false,
|
||||
role: "img",
|
||||
},
|
||||
replaceAttrValues: {
|
||||
"#262626": "currentColor",
|
||||
},
|
||||
template,
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
# @navikt/ds-icons
|
||||
|
||||
Leverer [NAVs ikoner](https://design.nav.no/resources/icons) i React og SVG.
|
||||
|
||||
## Installering
|
||||
|
||||
```sh
|
||||
// yarn
|
||||
yarn add @navikt/ds-icons
|
||||
|
||||
// npm
|
||||
npm install @navikt/ds-icons
|
||||
```
|
||||
|
||||
## Bruk
|
||||
|
||||
```jsx
|
||||
/* ESM (anbefalt for tree-shaking)*/
|
||||
import { Down } from "@navikt/ds-icons";
|
||||
/* CJS */
|
||||
import { Down } from "@navikt/cjs/ds-icons";
|
||||
|
||||
<Down aria-label="Åpne meny" />;
|
||||
```
|
||||
|
||||
## Dokumentasjon
|
||||
|
||||
- [Ikonsøk](https://design.nav.no/resources/icons)
|
||||
@@ -0,0 +1,48 @@
|
||||
import Axios from "axios";
|
||||
const { create, get } = Axios;
|
||||
|
||||
const FILE_KEY = "UmEVH3pZ71uJPsSz9ilP3Y";
|
||||
|
||||
const FigmaAxion = (token?: string) =>
|
||||
create({
|
||||
headers: {
|
||||
"X-FIGMA-TOKEN": token,
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* Published Figma-components
|
||||
* https://www.figma.com/file/UmEVH3pZ71uJPsSz9ilP3Y/%F0%9F%92%A0NAV-ikoner-2.5-Figma
|
||||
*/
|
||||
export const getPublishedIcons = async () => {
|
||||
const { data } = await FigmaAxion(process.env.FIGMA_TOKEN)
|
||||
.get(`https://api.figma.com/v1/files/${FILE_KEY}/components`)
|
||||
.catch((e) => {
|
||||
console.log("Failed getPublishedIcons ");
|
||||
throw e;
|
||||
});
|
||||
return data?.meta?.components;
|
||||
};
|
||||
|
||||
/**
|
||||
* Downloadable link to each icon in SVG-format
|
||||
*/
|
||||
export const getIconsDownloadableUrl = async (nodeIds: string) => {
|
||||
const {
|
||||
data: { images },
|
||||
} = await FigmaAxion(process.env.FIGMA_TOKEN)
|
||||
.get(
|
||||
`https://api.figma.com/v1/images/${FILE_KEY}/?ids=${nodeIds}&format=svg`
|
||||
)
|
||||
.catch((e) => {
|
||||
console.log("Failed getIconsDownloadableUrl ");
|
||||
throw e;
|
||||
});
|
||||
|
||||
return Object.values(images) as string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Download icon @url
|
||||
*/
|
||||
export const getIconContent = async (url: string) => get(url);
|
||||
@@ -0,0 +1,85 @@
|
||||
import {
|
||||
getPublishedIcons,
|
||||
getIconsDownloadableUrl,
|
||||
getIconContent,
|
||||
} from "./api";
|
||||
import { existsSync, writeFileSync, mkdirSync } from "fs";
|
||||
import { resolve } from "path";
|
||||
import pLimit from "p-limit";
|
||||
import rimraf from "rimraf";
|
||||
import startCase from "lodash.startcase";
|
||||
import { writeMeta } from "./write-meta";
|
||||
import dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
|
||||
export type ComponentT = {
|
||||
key: string;
|
||||
file_key: string;
|
||||
node_id: string;
|
||||
thumbnail_url: string;
|
||||
name: string;
|
||||
description: string;
|
||||
updated_at: string;
|
||||
created_at: string;
|
||||
user: any;
|
||||
containing_frame: any;
|
||||
};
|
||||
|
||||
const main = async () => {
|
||||
if (!process.env.FIGMA_TOKEN) {
|
||||
throw new Error("FIGMA_TOKEN not set in .env");
|
||||
}
|
||||
const iconFolder = "./svg";
|
||||
|
||||
// Limiting to ~20 concurrent downloads seems to lead to less errors
|
||||
const limit = pLimit(20);
|
||||
|
||||
const publishedIconNodes: ComponentT[] = await getPublishedIcons();
|
||||
|
||||
writeMeta(publishedIconNodes);
|
||||
/* Get all urls in one fetch rather than 300+ */
|
||||
const iconUrls: string[] = await getIconsDownloadableUrl(
|
||||
publishedIconNodes.map((node) => node.node_id).join(",")
|
||||
);
|
||||
|
||||
if (existsSync(iconFolder)) {
|
||||
rimraf.sync(iconFolder);
|
||||
}
|
||||
mkdirSync(iconFolder);
|
||||
|
||||
console.log("Total icons: " + publishedIconNodes.length);
|
||||
|
||||
await Promise.all(
|
||||
iconUrls.map((url, x) =>
|
||||
limit(() =>
|
||||
getIconContent(url)
|
||||
.then(({ data }) => {
|
||||
writeFileSync(
|
||||
resolve(
|
||||
iconFolder,
|
||||
`${startCase(publishedIconNodes[x].name).replace(
|
||||
/\s/g,
|
||||
""
|
||||
)}.svg`
|
||||
),
|
||||
data,
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
throw e;
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
console.log("\nDownloaded all icons from Figma!\n");
|
||||
};
|
||||
|
||||
try {
|
||||
main();
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { existsSync, unlinkSync, writeFileSync } from "fs";
|
||||
import startCase from "lodash.startcase";
|
||||
import { ComponentT } from ".";
|
||||
|
||||
const generateMetadata = (publishedIconNodes: ComponentT[]) => {
|
||||
return publishedIconNodes
|
||||
.map(({ name, description, created_at, containing_frame }) => {
|
||||
return {
|
||||
name: startCase(name).replace(/\s/g, ""),
|
||||
description,
|
||||
created_at,
|
||||
// strip emojis
|
||||
pageName: containing_frame.pageName.replace(
|
||||
/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,
|
||||
""
|
||||
),
|
||||
};
|
||||
})
|
||||
.sort((a, b) => a.name.localeCompare(b.name));
|
||||
};
|
||||
|
||||
export const writeMeta = (publishedIconNodes: ComponentT[]) => {
|
||||
const metadataFileName = "./meta.json";
|
||||
|
||||
if (existsSync(metadataFileName)) {
|
||||
unlinkSync(metadataFileName);
|
||||
}
|
||||
writeFileSync(
|
||||
metadataFileName,
|
||||
JSON.stringify(generateMetadata(publishedIconNodes)),
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
);
|
||||
};
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "@navikt/ds-icons",
|
||||
"version": "0.6.2",
|
||||
"private": false,
|
||||
"description": "NAVs egne ikoner i SVG og React format",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/ds-icons"
|
||||
},
|
||||
"keywords": [
|
||||
"NAV",
|
||||
"designsystem",
|
||||
"react"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": "NAV",
|
||||
"sideEffects": false,
|
||||
"main": "./cjs/index.js",
|
||||
"module": "./esm/index.js",
|
||||
"typings": "./esm/index.d.ts",
|
||||
"files": [
|
||||
"/cjs",
|
||||
"/esm",
|
||||
"/src",
|
||||
"/svg",
|
||||
"/meta.json"
|
||||
],
|
||||
"scripts": {
|
||||
"create-package-json-pointers-to-esm": "node ../../../utilities/scripts/createPackageJsonsWithESMPointers.js",
|
||||
"create-icons": "svgr --out-dir src svg",
|
||||
"convert-icons": "node scripts/pngConverter.mjs",
|
||||
"clean": "rimraf src cjs esm png NAV-ikonpakke-png.zip NAV-ikonpakke-svg.zip",
|
||||
"zip-icons": "node scripts/zipIcons.mjs",
|
||||
"build": "yarn clean && yarn create-icons && tsc && tsc -p tsconfig.esm.json && yarn create-package-json-pointers-to-esm && yarn run convert-icons && yarn zip-icons",
|
||||
"update": "ts-node figma/index.ts dotenv/config"
|
||||
},
|
||||
"dependencies": {
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@svgr/cli": "^5.5.0",
|
||||
"@types/lodash.startcase": "^4.4.6",
|
||||
"@types/uuid": "^8.3.1",
|
||||
"copyfiles": "^2.4.1",
|
||||
"dotenv": "^10.0.0",
|
||||
"lodash.kebabcase": "^4.1.1",
|
||||
"lodash.startcase": "4.4.0",
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"rimraf": "3.0.2",
|
||||
"sharp": "0.29.1",
|
||||
"ts-node": "^10.4.0",
|
||||
"zip-dir": "^2.0.0"
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
+1
-3
@@ -16,9 +16,7 @@ yarn add @navikt/ds-icons
|
||||
Import { Expand } from `@navikt/ds-icons`;
|
||||
|
||||
<Expand
|
||||
aria-label="Åpne meny"
|
||||
role="img"
|
||||
focusable="false"
|
||||
title="Åpne meny"
|
||||
/>
|
||||
```
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.4858 7.11888C20.7324 5.94771 20.7324 4.04887 19.4858 2.87769C18.2838 1.74835 16.3616 1.70802 15.1081 2.75669L14.9716 2.87769L3.6862 13.4807L3.52649 13.6372C1.61004 15.5983 1.66328 18.6487 3.6862 20.5493C4.61095 21.4181 5.79143 21.9002 7 21.9956V22H24V24L7 24C5.24586 23.9013 3.52179 23.2223 2.18147 21.963C-0.666561 19.2872 -0.725895 14.9835 2.00347 12.2399L2.18147 12.0669L13.4669 1.46396C15.5445 -0.487988 18.913 -0.487988 20.9905 1.46396C23.0135 3.36455 23.0667 6.41493 21.1502 8.37603L20.9905 8.53261L9.7051 19.1356L9.56865 19.2566C8.31517 20.3053 6.39296 20.2649 5.19092 19.1356C3.98889 18.0062 3.94596 16.2003 5.06213 15.0226L5.19092 14.8944L16.4764 4.29142L17.9811 5.70515L6.69565 16.3081L6.61297 16.3953C6.28225 16.7877 6.30981 17.3593 6.69565 17.7219C7.08149 18.0844 7.68993 18.1103 8.10757 17.7995L8.20038 17.7219L19.4858 7.11888Z" fill="#262626"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.4858 7.11888C20.7324 5.94771 20.7324 4.04887 19.4858 2.87769C18.2838 1.74835 16.3616 1.70802 15.1081 2.75669L14.9716 2.87769L3.6862 13.4807L3.52649 13.6372C1.61004 15.5983 1.66328 18.6487 3.6862 20.5493C4.61095 21.4181 5.79143 21.9002 7 21.9956V22H24V24L7 24C5.24586 23.9013 3.52179 23.2223 2.18147 21.963C-0.666561 19.2872 -0.725895 14.9835 2.00347 12.2399L2.18147 12.0669L13.4669 1.46396C15.5445 -0.487988 18.913 -0.487988 20.9905 1.46396C23.0135 3.36455 23.0667 6.41493 21.1503 8.37603L20.9905 8.53261L9.7051 19.1356L9.56865 19.2566C8.31517 20.3053 6.39296 20.2649 5.19092 19.1356C3.98889 18.0062 3.94596 16.2003 5.06214 15.0226L5.19092 14.8944L16.4764 4.29142L17.9811 5.70515L6.69565 16.3081L6.61297 16.3953C6.28225 16.7877 6.30981 17.3593 6.69565 17.7219C7.08149 18.0844 7.68993 18.1103 8.10757 17.7995L8.20038 17.7219L19.4858 7.11888Z" fill="#262626"/>
|
||||
</svg>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13 3C13 4.65685 11.6569 6 10 6C8.34315 6 7 4.65685 7 3C7 1.34315 8.34315 0 10 0C11.6569 0 13 1.34315 13 3ZM24 14.5C24 15.3284 23.3284 16 22.5 16C21.6716 16 21 15.3284 21 14.5C21 13.6716 21.6716 13 22.5 13C23.3284 13 24 13.6716 24 14.5ZM5.68636 6C4.98108 6 4.36366 6.47353 4.18079 7.15469L1.00073 19H2H4.25773V24H6.25773V19H8.25773V24H10.2577V19H12H13.0018L11.1893 11H14C14.5523 11 15 10.5523 15 10C15 9.44771 14.5523 9 14 9H10.5682C9.65406 7.19312 7.78502 6 5.68636 6ZM21 12C21 11.4477 20.5523 11 20 11C19.4477 11 19 11.4477 19 12V14H17.618L17.1708 13.1056C16.832 12.428 16.1395 12 15.382 12H15C14.4477 12 14 12.4477 14 13C14 13.5523 14.4477 14 15 14H15.382L15.8292 14.8944C16.168 15.572 16.8605 16 17.618 16H19C20.1046 16 21 15.1046 21 14V12ZM14 18C14 17.4477 14.4477 17 15 17H23C23.5523 17 24 17.4477 24 18C24 18.5523 23.5523 19 23 19H15C14.4477 19 14 18.5523 14 18Z" fill="#262626"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 795 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user