mirror of
https://github.com/navikt/aksel.git
synced 2026-10-13 09:12:03 +00:00
Compare commits
260
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
609678667f | ||
|
|
180ecd89bf | ||
|
|
635b0859b8 | ||
|
|
10cbe105bc | ||
|
|
f97eed8396 | ||
|
|
119d9df7b5 | ||
|
|
846d18cd23 | ||
|
|
833c35cbbc | ||
|
|
08353f50b5 | ||
|
|
fba81fb4eb | ||
|
|
9d9c6e9bfa | ||
|
|
4dad81714f | ||
|
|
8e9135149b | ||
|
|
852b53d6b9 | ||
|
|
ede1f5858a | ||
|
|
ad9e7165bb | ||
|
|
77302a30b8 | ||
|
|
0ef12ef601 | ||
|
|
4174f9a7b4 | ||
|
|
608f158d70 | ||
|
|
34d41ecc78 | ||
|
|
7e62365a60 | ||
|
|
8565f410a1 | ||
|
|
46d70820df | ||
|
|
67e66ffe02 | ||
|
|
e19bf67b33 | ||
|
|
97c5f60e91 | ||
|
|
ea5293c28d | ||
|
|
6a58efa9a9 | ||
|
|
c95f33679e | ||
|
|
b52a5e02a0 | ||
|
|
ab3ef0d34b | ||
|
|
69798f6ee2 | ||
|
|
ee14586beb | ||
|
|
82470ba669 | ||
|
|
6286f0e8e6 | ||
|
|
3c08651df2 | ||
|
|
e6d55fdcd6 | ||
|
|
8c445f020c | ||
|
|
78a76bac5d | ||
|
|
75b334af61 | ||
|
|
5d98c50b80 | ||
|
|
27803fd37c | ||
|
|
1bdb7e3777 | ||
|
|
20bcc28cb0 | ||
|
|
f43ec5c48c | ||
|
|
40f0b3340d | ||
|
|
1f023a84be | ||
|
|
f170a2201c | ||
|
|
7df8ee5dd3 | ||
|
|
713ccfb2eb | ||
|
|
99c35f4aed | ||
|
|
981f41c047 | ||
|
|
330e7867e1 | ||
|
|
82ed5ff3f0 | ||
|
|
17cf7f4ac2 | ||
|
|
decd2bac2a | ||
|
|
0a13a225c1 | ||
|
|
69a7dc76d9 | ||
|
|
433687a967 | ||
|
|
febf6543b9 | ||
|
|
aa506975b4 | ||
|
|
cb3201a788 | ||
|
|
0f70394cf4 | ||
|
|
b26cb5ef51 | ||
|
|
d66e6c7c94 | ||
|
|
48ed9934e6 | ||
|
|
dec60f90b4 | ||
|
|
9aa756b76e | ||
|
|
50573701ef | ||
|
|
79509fc900 | ||
|
|
976083c4c1 | ||
|
|
b95fc33649 | ||
|
|
57ca52a5de | ||
|
|
03fe9dec02 | ||
|
|
5af875d981 | ||
|
|
e452a003c1 | ||
|
|
651757a5f1 | ||
|
|
7d064772ad | ||
|
|
dd92454d05 | ||
|
|
c43611c06c | ||
|
|
1e580ae25e | ||
|
|
dcef32d47f | ||
|
|
7e311cef06 | ||
|
|
051b11d035 | ||
|
|
b6900e2da4 | ||
|
|
841ed3529e | ||
|
|
71bde5a24c | ||
|
|
e48f29153b | ||
|
|
7960fbb256 | ||
|
|
02268671f3 | ||
|
|
6486beb4a3 | ||
|
|
017e8f6217 | ||
|
|
c57ae5fd05 | ||
|
|
cdd2fb3cd2 | ||
|
|
82d9372289 | ||
|
|
248c9bbf64 | ||
|
|
00cef8cedf | ||
|
|
12a0a4baaa | ||
|
|
f4a02ee052 | ||
|
|
b9ae29f7e4 | ||
|
|
cad7341208 | ||
|
|
82e7036142 | ||
|
|
a531474076 | ||
|
|
616f0ac391 | ||
|
|
c021865342 | ||
|
|
8fc2d63815 | ||
|
|
0d4ce0107a | ||
|
|
3e9c8e9fc3 | ||
|
|
d7ba63fdde | ||
|
|
917abc8b9c | ||
|
|
95f0da7140 | ||
|
|
81b479eb11 | ||
|
|
ab084c93a6 | ||
|
|
5634f955ff | ||
|
|
ed3c7b9ad3 | ||
|
|
dc440b356f | ||
|
|
84fe0fba63 | ||
|
|
ab0c3432e6 | ||
|
|
23f70d4ae0 | ||
|
|
d59eda2dcd | ||
|
|
1c55312a1e | ||
|
|
2bfbe6f5b1 | ||
|
|
02ba20c315 | ||
|
|
ba3666a0e6 | ||
|
|
c5be69a9fb | ||
|
|
f0f74b87a4 | ||
|
|
fc81812ff8 | ||
|
|
83762fd85e | ||
|
|
6a1b3c387e | ||
|
|
8c40785bc1 | ||
|
|
965ba7c3d0 | ||
|
|
d94ace2aee | ||
|
|
db2f776f42 | ||
|
|
d2959f0bb5 | ||
|
|
0a40b4054f | ||
|
|
5f65cfc5b7 | ||
|
|
8010a117f1 | ||
|
|
4adaa8ee18 | ||
|
|
2ebe2735bb | ||
|
|
d94a0e9c78 | ||
|
|
4ea393ecdc | ||
|
|
5179b09e67 | ||
|
|
619b6b5459 | ||
|
|
9ea0384254 | ||
|
|
b224ef6810 | ||
|
|
4e7766789c | ||
|
|
e2b31808c0 | ||
|
|
58df6f75aa | ||
|
|
0a48a4ed17 | ||
|
|
c093e6668e | ||
|
|
933119ea56 | ||
|
|
4a2afb9b79 | ||
|
|
0081a2c224 | ||
|
|
ad34640601 | ||
|
|
f7df3e5b08 | ||
|
|
eba46bf4cd | ||
|
|
cc227e775f | ||
|
|
4bee31771d | ||
|
|
dd9f88d886 | ||
|
|
e6d82ad04b | ||
|
|
9e7a926fe9 | ||
|
|
ef79af2b4a | ||
|
|
fae51638b1 | ||
|
|
8983650075 | ||
|
|
7777df7b7d | ||
|
|
a8d726d6a5 | ||
|
|
4baad26b5f | ||
|
|
c548ba399e | ||
|
|
d4be8674e8 | ||
|
|
1989371a68 | ||
|
|
0b4909dd85 | ||
|
|
7bffd4020e | ||
|
|
7034f8faa2 | ||
|
|
de6961cb1d | ||
|
|
baf905d76c | ||
|
|
373810f5f4 | ||
|
|
19a9fa7034 | ||
|
|
6a06999761 | ||
|
|
1c13cb1728 | ||
|
|
9662155dde | ||
|
|
e91e307177 | ||
|
|
225e882eae | ||
|
|
77c4833c42 | ||
|
|
fbced203b1 | ||
|
|
fff3d22f1a | ||
|
|
c5689ab543 | ||
|
|
d1edf960e6 | ||
|
|
64ec281fb2 | ||
|
|
9c9174d3a6 | ||
|
|
51dcf4f60a | ||
|
|
f3929075e3 | ||
|
|
943a39d30d | ||
|
|
85518226c6 | ||
|
|
6a7f14e71c | ||
|
|
9b3efc6e1f | ||
|
|
b6d65ad805 | ||
|
|
7ab5e10f57 | ||
|
|
6f3aa4690f | ||
|
|
f4ff216e45 | ||
|
|
01a6f250da | ||
|
|
1ccc97d8e5 | ||
|
|
ed2537dc58 | ||
|
|
16b7176fe3 | ||
|
|
f2eab3f636 | ||
|
|
00747ac364 | ||
|
|
ad3f7e174c | ||
|
|
4708688b02 | ||
|
|
940e1255f1 | ||
|
|
c8b041154e | ||
|
|
7da8246ce3 | ||
|
|
38bccf08eb | ||
|
|
ed817bf04c | ||
|
|
4f8d6f8fa1 | ||
|
|
d13b7b19c9 | ||
|
|
2e7535037c | ||
|
|
5b8290e77e | ||
|
|
a19cad1bce | ||
|
|
8b8e59349b | ||
|
|
f87d020db2 | ||
|
|
91cb70c5a3 | ||
|
|
eda041ec74 | ||
|
|
d875804d2b | ||
|
|
6b77a04e12 | ||
|
|
3f18280557 | ||
|
|
1b9c7b90ff | ||
|
|
1ef6ebafd4 | ||
|
|
058969c0f0 | ||
|
|
8f43b09205 | ||
|
|
155c556fea | ||
|
|
151ec81036 | ||
|
|
c5d52a4c9a | ||
|
|
6ef57ee106 | ||
|
|
dd2167dab5 | ||
|
|
0c179d92af | ||
|
|
abace10750 | ||
|
|
03949990b1 | ||
|
|
bdb777df0c | ||
|
|
5d2ed071e1 | ||
|
|
e152c92bf4 | ||
|
|
840b4dddd3 | ||
|
|
136ab3aa97 | ||
|
|
6b9ecd239a | ||
|
|
0b8f9a9d4b | ||
|
|
4611a9e806 | ||
|
|
fe19e8390e | ||
|
|
9a91e9b3d2 | ||
|
|
147fb90550 | ||
|
|
4007711cf3 | ||
|
|
c4259221c1 | ||
|
|
45ffd93728 | ||
|
|
346e45b153 | ||
|
|
8f1e628f8d | ||
|
|
2807bc28e8 | ||
|
|
2c2db2e657 | ||
|
|
2734b90d0f | ||
|
|
88e8a71412 | ||
|
|
e1222ac0e1 | ||
|
|
43251ae7c3 | ||
|
|
eeb9f5ab71 |
No files matched your search
@@ -0,0 +1,39 @@
|
||||
# Changesets
|
||||
|
||||
For versjonering bruker vi løsningen [Changesets](https://github.com/changesets/changesets) for å [versjonering](https://semver.org/) og publisering av pakker.
|
||||
|
||||
## Howto
|
||||
|
||||
- For å lage en ny versjons-entry: `yarn changeset`
|
||||
- Velg pakkene som skal versjoneres med `arrowkeys` + `Space`
|
||||
|
||||
`🦋 Which packages would you like to include?`
|
||||
|
||||
Trykk `Space` for å velge pakkene som skal versjoneres, for så trykke `Enter` for å gå videre.
|
||||
|
||||
`🦋 Which packages should have a major bump?`
|
||||
|
||||
Trykk `Enter` for å gå videre _*eller*_ velg pakkene som skal marjor-bumpes med `arrowkeys` + `Space`
|
||||
|
||||
`🦋 Which packages should have a minor bump?`
|
||||
|
||||
Trykk `Enter` for å gå videre _*eller*_ velg pakkene som skal marjor-bumpes med `arrowkeys` + `Space`
|
||||
|
||||
Hvis du ikke velger major eller minor, så blir pakkene få en patch-bump
|
||||
|
||||
- Commit og push.
|
||||
|
||||
## Fixed versjonering
|
||||
|
||||
Alle base-pakkene våre har `fixed versjonering`. Dette tilsier at en bump på en av disse vil bumpe alle til samme versjon
|
||||
|
||||
```sh
|
||||
"@navikt/ds-react",
|
||||
"@navikt/ds-css",
|
||||
"@navikt/ds-icons",
|
||||
"@navikt/ds-tokens",
|
||||
"@navikt/ds-tailwind",
|
||||
"@navikt/ds-css-internal",
|
||||
"@navikt/ds-react-internal",
|
||||
"@navikt/ds-codemod"
|
||||
```
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
|
||||
"changelog": [
|
||||
"@changesets/changelog-github",
|
||||
{ "repo": "navikt/Designsystemet" }
|
||||
],
|
||||
"commit": false,
|
||||
"fixed": [
|
||||
[
|
||||
"@navikt/ds-react",
|
||||
"@navikt/ds-css",
|
||||
"@navikt/ds-icons",
|
||||
"@navikt/ds-tokens",
|
||||
"@navikt/ds-tailwind",
|
||||
"@navikt/ds-css-internal",
|
||||
"@navikt/ds-react-internal",
|
||||
"@navikt/ds-codemod"
|
||||
]
|
||||
],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "master",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": ["nextjs-demo", "shadow-dom", "aksel.nav.no"],
|
||||
|
||||
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
|
||||
"updateInternalDependents": "always"
|
||||
}
|
||||
}
|
||||
@@ -3,25 +3,12 @@ name: Bug Report
|
||||
about: Meld inn bugs eller feil
|
||||
title: "[BUG]"
|
||||
labels: "bug \U0001F41B"
|
||||
assignees: ''
|
||||
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
## Hvilken av tjenestene våre gjelder det?
|
||||
## Hva er feilen/problemet?
|
||||
|
||||
<!--
|
||||
Sett en x i type pakke det gjelder:
|
||||
- [x] type
|
||||
-->
|
||||
|
||||
- [ ] `Komponenter`
|
||||
- [ ] `Stiler`
|
||||
- [ ] `Ikoner`
|
||||
- [ ] `Annet`
|
||||
|
||||
## Beskriv feilen/problemet
|
||||
|
||||
<!--
|
||||
> Beskriv hva slags problem(er) som oppstår
|
||||
|
||||
> Hva forventet du skulle oppstå?
|
||||
@@ -31,7 +18,7 @@ assignees: ''
|
||||
|
||||
(skriv her.)
|
||||
|
||||
## Steg for å reprodusere problemet
|
||||
## Steg for å reprodusere problemet (valgfri)
|
||||
|
||||
<!--
|
||||
1. Steg en
|
||||
@@ -41,11 +28,11 @@ assignees: ''
|
||||
|
||||
(skriv her.)
|
||||
|
||||
## Eksempel/Tilleggsinformasjon
|
||||
## Eksempel/Tilleggsinformasjon (valgfri)
|
||||
|
||||
<!--
|
||||
Screenshots eller kodesnippets
|
||||
Legg gjerne ved ekstrainfo som nettleser, desktop/mobil etc
|
||||
Legg gjerne ved ekstrainfo som nettleser eller desktop/mobil hvis det er relevant.
|
||||
-->
|
||||
|
||||
```
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Foreslå noe nytt for designsystemet
|
||||
about: Foreslå noe nytt!
|
||||
title: "[NEW]"
|
||||
labels: new ✨
|
||||
assignees: ''
|
||||
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
## Beskriv forespørselen
|
||||
## Hva?
|
||||
|
||||
(skriv her.)
|
||||
|
||||
## Hvilken funksjon vil dette har for bruker?
|
||||
## Hva løser dette?
|
||||
|
||||
(skriv her.)
|
||||
|
||||
## Eksempler/Tilleggsinformasjon
|
||||
## Eksempler/Info
|
||||
|
||||
<!--
|
||||
Del gjerne eksempel av lignende løsninger som er i bruk idag, URL/Screenshots etc.
|
||||
Del gjerne eksempel av lignende løsninger som er i bruk idag, URL/Screenshots etc.
|
||||
Link gjerne til relaterte issues her også.
|
||||
-->
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
name: Deploy aksel.dev.nav.no
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- next
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/designsystemet
|
||||
|
||||
jobs:
|
||||
build_and_deploy:
|
||||
name: Build and deploy to dev-gcp
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "14"
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: "next"
|
||||
- name: add tokens to .env
|
||||
run: |
|
||||
echo "SANITY_WRITE_KEY=${{ secrets.SANITY_FEEDBACK_WRITE_KEY }}" >> aksel.nav.no/website/.env
|
||||
echo "ALGOLIA_ADMIN=${{ secrets.ALGOLIA_ADMIN }}" >> aksel.nav.no/website/.env
|
||||
echo "ALGOLIA_ID=${{ secrets.ALGOLIA_ID}}" >> aksel.nav.no/website/.env
|
||||
echo "TRELLO_TOKEN=${{ secrets.TRELLO_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PREVIEW_TOKEN=${{ secrets.SANITY_PREVIEW_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PRIVATE_NO_DRAFTS=${{ secrets.SANITY_PRIVATE_NO_DRAFTS }}" >> aksel.nav.no/website/.env
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-dev-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dev-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Build application
|
||||
run: |
|
||||
yarn boot
|
||||
yarn docgen
|
||||
yarn workspace aksel.nav.no build:next
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@ab80d026d4753220c4243394c07c7d80f9638d06 # Use commit-sha1 instead of tag for security concerns
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get complete tag
|
||||
run: echo "TAG=DEV-$( date +%s )" >> $GITHUB_ENV
|
||||
- name: Create docker image tags
|
||||
run: echo "DOCKER_TAG=${{ env.IMAGE }}:${{ env.TAG }}" >> $GITHUB_ENV
|
||||
- name: Build docker image
|
||||
run: docker build -t ${{ env.DOCKER_TAG }} . -f aksel.nav.no/Dockerfile
|
||||
- name: Push docker image
|
||||
run: |
|
||||
docker push ${{ env.DOCKER_TAG }}
|
||||
|
||||
- name: Deploy to dev-gcp
|
||||
uses: nais/deploy/actions/deploy@master
|
||||
env:
|
||||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
|
||||
RESOURCE: aksel.nav.no/nais-dev.yaml
|
||||
CLUSTER: dev-gcp
|
||||
IMAGE: ${{ env.DOCKER_TAG }}
|
||||
@@ -0,0 +1,81 @@
|
||||
name: Deploy aksel.nav.no
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/designsystemet
|
||||
|
||||
jobs:
|
||||
build_and_deploy:
|
||||
name: Build and deploy to prod-gcp
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "14"
|
||||
- uses: actions/checkout@v2
|
||||
- name: add tokens to .env
|
||||
run: |
|
||||
echo "SANITY_WRITE_KEY=${{ secrets.SANITY_FEEDBACK_WRITE_KEY }}" >> aksel.nav.no/website/.env
|
||||
echo "ALGOLIA_ADMIN=${{ secrets.ALGOLIA_ADMIN }}" >> aksel.nav.no/website/.env
|
||||
echo "ALGOLIA_ID=${{ secrets.ALGOLIA_ID}}" >> aksel.nav.no/website/.env
|
||||
echo "TRELLO_TOKEN=${{ secrets.TRELLO_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PREVIEW_TOKEN=${{ secrets.SANITY_PREVIEW_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PRIVATE_NO_DRAFTS=${{ secrets.SANITY_PRIVATE_NO_DRAFTS }}" >> aksel.nav.no/website/.env
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-prod-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-prod-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: build packages
|
||||
run: |
|
||||
yarn boot
|
||||
yarn docgen
|
||||
|
||||
- name: Tests
|
||||
run: yarn workspace aksel.nav.no test
|
||||
|
||||
- name: E2E
|
||||
run: NEXT_PUBLIC_TEST=true yarn workspace website e2e
|
||||
|
||||
- name: Update sanity sync
|
||||
run: yarn workspace aksel.nav.no sanity:update
|
||||
|
||||
- name: Build application
|
||||
run: yarn workspace aksel.nav.no build:next
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@ab80d026d4753220c4243394c07c7d80f9638d06 # Use commit-sha1 instead of tag for security concerns
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get complete tag
|
||||
run: echo "TAG=$( date +%s )" >> $GITHUB_ENV
|
||||
- name: Create docker image tags
|
||||
run: echo "DOCKER_TAG=${{ env.IMAGE }}:${{ env.TAG }}" >> $GITHUB_ENV
|
||||
- name: Build docker image
|
||||
run: docker build -t ${{ env.DOCKER_TAG }} . -f aksel.nav.no/Dockerfile
|
||||
- name: Push docker image
|
||||
run: |
|
||||
docker push ${{ env.DOCKER_TAG }}
|
||||
|
||||
- name: Deploy to prod-gcp
|
||||
uses: nais/deploy/actions/deploy@master
|
||||
env:
|
||||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
|
||||
RESOURCE: aksel.nav.no/nais-prod.yaml
|
||||
CLUSTER: prod-gcp
|
||||
IMAGE: ${{ env.DOCKER_TAG }}
|
||||
@@ -0,0 +1,41 @@
|
||||
name: Redeploy image to for aksel.nav.no
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Docker image tag"
|
||||
required: true
|
||||
default: ""
|
||||
dry:
|
||||
description: "Dry-run"
|
||||
required: true
|
||||
default: "false"
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/designsystemet
|
||||
|
||||
jobs:
|
||||
redeploy:
|
||||
name: Redeploy image
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "14"
|
||||
- uses: actions/checkout@v2
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@ab80d026d4753220c4243394c07c7d80f9638d06 # Use commit-sha1 instead of tag for security concerns
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Create docker image tag
|
||||
run: echo "DOCKER_TAG=${{ env.IMAGE }}:${{ github.event.inputs.tag }}" >> $GITHUB_ENV
|
||||
- name: Deploy to prod-gcp
|
||||
uses: nais/deploy/actions/deploy@master
|
||||
env:
|
||||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
|
||||
RESOURCE: aksel.nav.no/nais-prod.yaml
|
||||
CLUSTER: prod-gcp
|
||||
IMAGE: ${{ env.DOCKER_TAG }}
|
||||
DRY_RUN: ${{ github.event.inputs.dry }}
|
||||
@@ -0,0 +1,39 @@
|
||||
name: Backup sanity dateset to gcp
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# 12.00 every 3 days
|
||||
- cron: "0 0 */3 * *"
|
||||
jobs:
|
||||
execute:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # Required to retrieve git history
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-build-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Export dataset
|
||||
run: SANITY_TOKEN=${{secrets.SANITY_DATASET_EDITOR_TOKEN}} yarn workspace aksel.nav.no sanity:backup
|
||||
- name: Upload GCP bucket
|
||||
uses: "google-github-actions/auth@v0"
|
||||
with:
|
||||
credentials_json: "${{ secrets.gcp_credentials_prod }}"
|
||||
- uses: "google-github-actions/upload-cloud-storage@v0"
|
||||
with:
|
||||
path: ./aksel.nav.no/sanity
|
||||
destination: "aksel-website-prod/backups"
|
||||
glob: "**/backup-*.tar.gz"
|
||||
@@ -1,99 +0,0 @@
|
||||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
||||
|
||||
name: Build -> Test -> Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test-build:
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # Required to retrieve git history
|
||||
- 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: Boot
|
||||
run: yarn boot
|
||||
- name: Eslint and Stylelint
|
||||
run: yarn lint
|
||||
- name: Test
|
||||
run: yarn test
|
||||
|
||||
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@v2
|
||||
with:
|
||||
registry-url: https://registry.npmjs.org
|
||||
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 --frozen-lockfile
|
||||
- name: Boot
|
||||
run: yarn boot
|
||||
- name: Generate docs
|
||||
run: yarn docgen
|
||||
- name: Setup github connection for auth
|
||||
run: |
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git remote set-url origin https://github-actions[bot]:$NAV_DS_TOKEN@github.com/$GITHUB_REPOSITORY.git
|
||||
env:
|
||||
NAV_DS_TOKEN: ${{secrets.GIT_REPO}}
|
||||
|
||||
- name: Update changed packages with PATCH
|
||||
if: "contains(github.event.head_commit.message, '[fix]')"
|
||||
run: yarn lerna version patch --include-merged-tags --yes
|
||||
- name: Update changed packages with MINOR
|
||||
if: "contains(github.event.head_commit.message, '[feature]')"
|
||||
run: yarn lerna version minor --include-merged-tags --yes
|
||||
- name: Update changed packages with MAJOR
|
||||
if: "contains(github.event.head_commit.message, '[breaking]')"
|
||||
run: yarn lerna version major --include-merged-tags --yes
|
||||
- name: Publish to NPM registry
|
||||
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:
|
||||
org_name: navikt
|
||||
env:
|
||||
AUTH_TOKEN: ${{secrets.GIT_REPO}}
|
||||
- name: Publish to Github registry
|
||||
run: |
|
||||
yarn lerna publish --registry https://npm.pkg.github.com from-package --yes
|
||||
@@ -1,46 +1,58 @@
|
||||
name: Chromatic
|
||||
name: Visual Regression Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
branches:
|
||||
- "master"
|
||||
paths:
|
||||
- "@navikt/**"
|
||||
pull_request:
|
||||
branches: [master]
|
||||
branches: [master, next]
|
||||
paths:
|
||||
- "@navikt/**"
|
||||
|
||||
jobs:
|
||||
chromatic-pr:
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
|
||||
visual_regression_test:
|
||||
name: "visual regression test (chromatic)"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v1
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
id: node-cache
|
||||
node-version: 16.13.0
|
||||
cache: yarn
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
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: Boot
|
||||
key: ${{ runner.os }}-visual-regression-test-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-visual-regression-test-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Build packages
|
||||
run: yarn boot
|
||||
- name: run chromatic
|
||||
|
||||
- name: Chromatic
|
||||
uses: chromaui/action@v1
|
||||
id: chromatic_tests
|
||||
continue-on-error: true
|
||||
with:
|
||||
autoAcceptChanges: "master"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
projectToken: x3xqdfgkujg
|
||||
exitZeroOnChanges: false
|
||||
env:
|
||||
STORYBOOK_GITHUB_SHA: ${{ github.sha }}
|
||||
|
||||
- name: replace storybook url
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
|
||||
uses: frabert/replace-string-action@v2.0
|
||||
id: storybook_url
|
||||
with:
|
||||
@@ -49,12 +61,14 @@ jobs:
|
||||
replace-with: ""
|
||||
|
||||
- name: Get commit sha
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
|
||||
id: vars
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
|
||||
- name: Find Comment
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
|
||||
uses: peter-evans/find-comment@v1
|
||||
id: fc
|
||||
with:
|
||||
@@ -63,7 +77,7 @@ jobs:
|
||||
body-includes: Chromatic build-output
|
||||
|
||||
- name: Create or update comment
|
||||
if: steps.chromatic_tests.outcome == 'success'
|
||||
if: steps.chromatic_tests.outcome == 'success' && !contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
with:
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
@@ -73,13 +87,13 @@ jobs:
|
||||
|
||||
- :clipboard: [Review](${{steps.chromatic_tests.outputs.url}})
|
||||
- :tada: [Storybook preview](${{steps.storybook_url.outputs.replaced}})
|
||||
- :white_check_mark: SUCCESS :white_check_mark:
|
||||
- :white_check_mark: No changes detected :white_check_mark:
|
||||
|
||||
commit: `${{ steps.vars.outputs.sha_short }}`
|
||||
edit-mode: replace
|
||||
|
||||
- name: Create or update failed comment
|
||||
if: steps.chromatic_tests.outcome != 'success'
|
||||
if: steps.chromatic_tests.outcome != 'success' && !contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
with:
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
@@ -89,38 +103,7 @@ jobs:
|
||||
|
||||
- :clipboard: [Review](${{steps.chromatic_tests.outputs.url}})
|
||||
- :tada: [Storybook preview](${{steps.storybook_url.outputs.replaced}})
|
||||
- :no_entry_sign: FAILED :no_entry_sign:, review endringer.
|
||||
- :no_entry_sign: Changes detected :no_entry_sign:, review endringer.
|
||||
|
||||
commit: `${{ steps.vars.outputs.sha_short }}`
|
||||
edit-mode: replace
|
||||
|
||||
chromatic-push:
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name == 'push'"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- 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: Boot
|
||||
run: yarn boot
|
||||
- name: run chromatic
|
||||
uses: chromaui/action@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
projectToken: x3xqdfgkujg
|
||||
autoAcceptChanges: true
|
||||
@@ -0,0 +1,44 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "Validate build"
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.13.0
|
||||
cache: yarn
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-test-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-test
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Boot (build packages)
|
||||
run: yarn boot
|
||||
|
||||
- name: Lint
|
||||
run: yarn lint
|
||||
|
||||
- name: Test
|
||||
run: yarn test
|
||||
@@ -0,0 +1,71 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, next]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [master]
|
||||
schedule:
|
||||
- cron: "41 8 * * 6"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: ["javascript"]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
|
||||
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
||||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
||||
|
||||
# - run: |
|
||||
# echo "Run, Build Application using script"
|
||||
# ./location_of_script_within_repo/buildscript.sh
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
@@ -0,0 +1,56 @@
|
||||
name: E2E / Playwright Tests
|
||||
on:
|
||||
push:
|
||||
branches: [master, next]
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
pull_request:
|
||||
branches: [master, next]
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
|
||||
jobs:
|
||||
playwright:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: add tokens to .env
|
||||
run: |
|
||||
echo "SANITY_WRITE_KEY=${{ secrets.SANITY_FEEDBACK_WRITE_KEY }}" >> aksel.nav.no/website/.env
|
||||
echo "ALGOLIA_ADMIN=${{ secrets.ALGOLIA_ADMIN }}" >> aksel.nav.no/website/.env
|
||||
echo "ALGOLIA_ID=${{ secrets.ALGOLIA_ID}}" >> aksel.nav.no/website/.env
|
||||
echo "TRELLO_TOKEN=${{ secrets.TRELLO_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PREVIEW_TOKEN=${{ secrets.SANITY_PREVIEW_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PRIVATE_NO_DRAFTS=${{ secrets.SANITY_PRIVATE_NO_DRAFTS }}" >> aksel.nav.no/website/.env
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-e2e-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-e2e-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: build packages
|
||||
run: |
|
||||
yarn boot
|
||||
yarn docgen
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
- name: Run Playwright tests
|
||||
run: yarn workspace website e2e
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: aksel.nav.no/website/playwright-report/
|
||||
retention-days: 10
|
||||
@@ -0,0 +1,31 @@
|
||||
name: "push-to-cdn"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
paths:
|
||||
- "fonts/**"
|
||||
|
||||
jobs:
|
||||
upload:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: "read"
|
||||
id-token: "write"
|
||||
|
||||
steps:
|
||||
- uses: "actions/checkout@v3"
|
||||
|
||||
- id: upload
|
||||
uses: nais/frontend-plattform-cdn-upload-action@main
|
||||
with:
|
||||
cdn-environment: cdn.nav.no
|
||||
cdn-team-name: aksel
|
||||
source: ./fonts
|
||||
destination: "" # uploads folder to team root
|
||||
|
||||
- run: echo uploaded file ${{ steps.upload.outputs.uploaded }}
|
||||
shell: bash
|
||||
@@ -0,0 +1,67 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "Release packages"
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.13.0
|
||||
cache: yarn
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-prod-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-prod
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Create release Pull Request or publish to NPM
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
version: yarn version
|
||||
publish: yarn release
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
|
||||
- name: Creating .npmrc
|
||||
run: |
|
||||
cat << EOF > "$HOME/.npmrc"
|
||||
@navikt:registry=https://npm.pkg.github.com
|
||||
//npm.pkg.github.com/:_authToken=$NPM_TOKEN
|
||||
EOF
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.GIT_REPO }}
|
||||
|
||||
- name: Publish to GPR
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
id: changesets-gpr
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
publish: yarn changeset publish
|
||||
createGithubReleases: false
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
GITHUB_TOKEN: ${{ secrets.GIT_REPO }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Indexing search
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# 01.00 & 12.00 every day
|
||||
- cron: "00 01,12 * * *"
|
||||
|
||||
jobs:
|
||||
searchcrawl:
|
||||
name: Search-indexing aksel.nav.no
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
APPLICATION_ID: ${{ secrets.ALGOLIA_ID}}
|
||||
API_KEY: ${{ secrets.ALGOLIA_ADMIN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Read crawler.json
|
||||
id: algolia_config
|
||||
run: echo "::set-output name=config::$(cat ./aksel.nav.no/crawler.json | jq -r tostring)"
|
||||
- name: Push indices to Algolia
|
||||
uses: signcl/docsearch-scraper-action@master
|
||||
env:
|
||||
APPLICATION_ID: ${{ secrets.ALGOLIA_ID}}
|
||||
API_KEY: ${{ secrets.ALGOLIA_ADMIN }}
|
||||
CONFIG: ${{ steps.algolia_config.outputs.config }}
|
||||
@@ -1,20 +1,20 @@
|
||||
name: Update Icons
|
||||
|
||||
on:
|
||||
# schedule:
|
||||
# - cron: 0 0 * * *
|
||||
# schedule:
|
||||
# - cron: 0 0 * * *
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
id: node-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Update Icons
|
||||
run: yarn update:icons
|
||||
run: yarn workspace @navikt/ds-icons update
|
||||
env:
|
||||
FIGMA_TOKEN: ${{ secrets.FIGMA_IKONER_API }}
|
||||
- name: Create Pull Request
|
||||
@@ -39,4 +39,4 @@ jobs:
|
||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||
signoff: false
|
||||
delete-branch: true
|
||||
title: "[FIX] Ikonsynk Figma"
|
||||
title: "Ikonsynk Figma"
|
||||
@@ -7,12 +7,12 @@ jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
id: node-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Update tokens
|
||||
run: yarn update:tokens
|
||||
run: yarn workspace @navikt/ds-tokens update
|
||||
env:
|
||||
FIGMA_TOKEN: ${{ secrets.FIGMA_IKONER_API }}
|
||||
- name: Create Pull Request
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: figma-tokens-sync
|
||||
delete-branch: true
|
||||
title: "[FEATURE] Tokens sync Figma"
|
||||
title: "Tokens sync Figma"
|
||||
commit-message: "Tokens synket fra figma"
|
||||
committer: GitHub <noreply@github.com>
|
||||
signoff: false
|
||||
+25
-3
@@ -107,8 +107,8 @@ utilities/**/css
|
||||
|
||||
*/static/*.zip
|
||||
*/static/png
|
||||
@navikt/core/icons/NAV-ikonpakke-png.zip
|
||||
@navikt/core/icons/NAV-ikonpakke-svg.zip
|
||||
@navikt/icons/NAV-ikonpakke-png.zip
|
||||
@navikt/icons/NAV-ikonpakke-svg.zip
|
||||
*/**/NAV-ikonpakke-png.zip
|
||||
*/**/NAV-ikonpakke-svg.zip
|
||||
|
||||
@@ -125,4 +125,26 @@ _docs.json
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
!.yarn/versions
|
||||
*/icons/src
|
||||
*/icons/png
|
||||
*/core/icons
|
||||
/storybook-static
|
||||
|
||||
# Aksel.nav.no
|
||||
.next
|
||||
!*/website/lib/
|
||||
!*/website/public/
|
||||
!aksel.nav.no/**/*.d.ts
|
||||
!*/sanity/lib/
|
||||
!*/sanity/static/
|
||||
out
|
||||
test-urls.json
|
||||
videos
|
||||
sanity/scripts/renameField.js
|
||||
tmp.json
|
||||
/test-results/
|
||||
/playwright-report/
|
||||
/playwright/.cache/
|
||||
playwright-report/
|
||||
/test-results/
|
||||
+12
-6
@@ -1,10 +1,12 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
if [ -z "$husky_skip_init" ]; then
|
||||
debug () {
|
||||
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
|
||||
if [ "$HUSKY_DEBUG" = "1" ]; then
|
||||
echo "husky (debug) - $1"
|
||||
fi
|
||||
}
|
||||
|
||||
readonly hook_name="$(basename "$0")"
|
||||
readonly hook_name="$(basename -- "$0")"
|
||||
debug "starting $hook_name..."
|
||||
|
||||
if [ "$HUSKY" = "0" ]; then
|
||||
@@ -17,14 +19,18 @@ if [ -z "$husky_skip_init" ]; then
|
||||
. ~/.huskyrc
|
||||
fi
|
||||
|
||||
export readonly husky_skip_init=1
|
||||
readonly husky_skip_init=1
|
||||
export husky_skip_init
|
||||
sh -e "$0" "$@"
|
||||
exitCode="$?"
|
||||
|
||||
if [ $exitCode != 0 ]; then
|
||||
echo "husky - $hook_name hook exited with code $exitCode (error)"
|
||||
exit $exitCode
|
||||
fi
|
||||
|
||||
exit 0
|
||||
if [ $exitCode = 127 ]; then
|
||||
echo "husky - command not found in PATH=$PATH"
|
||||
fi
|
||||
|
||||
exit $exitCode
|
||||
fi
|
||||
@@ -0,0 +1,2 @@
|
||||
**/nais-dev.yaml
|
||||
**/nais-prod.yaml
|
||||
@@ -1,12 +0,0 @@
|
||||
import { Meta, Canvas } from "@storybook/addon-docs";
|
||||
|
||||
<Meta title="ds-react(deprecated)/intro" />
|
||||
|
||||
# Utdaterte pakker
|
||||
|
||||
På sikt vil komponentene under bli flyttet ut av ds-react eller erstattes av andre komponenter
|
||||
|
||||
- PageHeader -> @navikt/ds-react-navno
|
||||
- MicroCard -> @navikt/ds-react-navno
|
||||
|
||||
- StepIndicator -> Horizontal `<Stepper />`
|
||||
@@ -15,3 +15,7 @@
|
||||
.rowgap[data-theme="dark"] {
|
||||
background-color: #262626;
|
||||
}
|
||||
|
||||
.rowgap-wrap {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
@@ -17,10 +17,7 @@ module.exports = {
|
||||
},
|
||||
stories: () => [...getStories(), "./*.stories.mdx"],
|
||||
addons: [
|
||||
"@storybook/addon-docs",
|
||||
"@storybook/addon-a11y",
|
||||
"@whitespace/storybook-addon-html",
|
||||
"storybook-addon-css-user-preferences",
|
||||
{
|
||||
name: "@storybook/addon-storysource",
|
||||
options: {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { addons } from "@storybook/addons";
|
||||
import NavTheme from "./theme.js";
|
||||
import logoUrl from "./public/logo.svg";
|
||||
/* import logoUrl from "./public/logo.svg"; */
|
||||
|
||||
addons.setConfig({
|
||||
theme: NavTheme,
|
||||
});
|
||||
|
||||
const link = document.createElement("link");
|
||||
/* const link = document.createElement("link");
|
||||
link.setAttribute("rel", "shortcut icon");
|
||||
link.setAttribute("href", logoUrl);
|
||||
document.head.appendChild(link);
|
||||
document.head.appendChild(link); */
|
||||
+27
-7
@@ -7,7 +7,7 @@ export const parameters = {
|
||||
options: {
|
||||
storySort: {
|
||||
method: "",
|
||||
order: ["Intro", "ds-icons", "ds-react", ["Default"]],
|
||||
order: ["Intro", "ds-icons", "ds-react", ["form"], ["Default"]],
|
||||
locales: "",
|
||||
},
|
||||
},
|
||||
@@ -21,13 +21,33 @@ export const parameters = {
|
||||
value: "#ffffff",
|
||||
},
|
||||
{
|
||||
name: "Alternate",
|
||||
value: "#f7f7f7",
|
||||
},
|
||||
{
|
||||
name: "Inverted",
|
||||
value: "#292929",
|
||||
name: "Darkmode",
|
||||
value: "#262626",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const globalTypes = {
|
||||
theme: {
|
||||
name: "Theme",
|
||||
description: "Global theme for components",
|
||||
defaultValue: "light",
|
||||
toolbar: {
|
||||
icon: "circlehollow",
|
||||
items: [
|
||||
{ value: "light", icon: "circlehollow", title: "light" },
|
||||
{ value: "dark", icon: "circle", title: "dark" },
|
||||
],
|
||||
showName: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const withTheme = (StoryFn, context) => (
|
||||
<div data-theme={context.parameters.theme || context.globals.theme} lang="no">
|
||||
<StoryFn />
|
||||
</div>
|
||||
);
|
||||
|
||||
export const decorators = [withTheme];
|
||||
+2
-2
@@ -9,7 +9,7 @@ export default create({
|
||||
fontCode: "monospace",
|
||||
|
||||
// Text colors
|
||||
textColor: "#292929",
|
||||
textColor: "#262626",
|
||||
textInverseColor: "rgba(255,255,255,0.9)",
|
||||
|
||||
colorSecondary: "rgba(0, 36, 58, 1)",
|
||||
@@ -18,5 +18,5 @@ export default create({
|
||||
barTextColor: "rgba(0, 91, 130, 1)",
|
||||
barSelectedColor: "rgba(0, 36, 58, 1)",
|
||||
|
||||
brandTitle: "NAV Designsystem",
|
||||
brandTitle: "Aksel",
|
||||
});
|
||||
@@ -2,7 +2,7 @@ import { Meta, Canvas } from "@storybook/addon-docs";
|
||||
|
||||
<Meta title="Intro/Velkommen" />
|
||||
|
||||
# NAV designsystem-komponenter
|
||||
# Aksel, NAVs designsystem
|
||||
|
||||
- [Dokumentasjon](https://aksel.nav.no/designsystem)
|
||||
- [Komponenter](https://aksel.nav.no/designsystem/side/oversikt-komponenter)
|
||||
@@ -12,27 +12,28 @@ import { Meta, Canvas } from "@storybook/addon-docs";
|
||||
### Kjernepakke
|
||||
|
||||
```bash
|
||||
yarn add @navikt/ds-react @navikt/ds-css @navikt/ds-icons
|
||||
yarn add @navikt/ds-react @navikt/ds-css
|
||||
```
|
||||
|
||||
### Pakke for interne-flater
|
||||
### Interne-flater
|
||||
|
||||
```bash
|
||||
yarn add @navikt/ds-react-internal @navikt/ds-css-internal
|
||||
```
|
||||
|
||||
### Ikonpakke
|
||||
|
||||
```bash
|
||||
yarn add @navikt/ds-icons
|
||||
```
|
||||
|
||||
### Bruk
|
||||
|
||||
```jsx
|
||||
import { Heading } from "@navikt/ds-react";
|
||||
import "@navikt/ds-css";
|
||||
|
||||
<Heading level="1" size="xlarge">
|
||||
Sidetitel
|
||||
</Heading>;
|
||||
```
|
||||
|
||||
## Bidra
|
||||
|
||||
Hjelp oss med å forbedre designsystemet med feedback eller kode-hjelp
|
||||
|
||||
- [Kode](https://github.com/navikt/Designsystemet/tree/master/%40navikt)
|
||||
@@ -1,3 +1,5 @@
|
||||
enableImmutableInstalls: false
|
||||
|
||||
nodeLinker: node-modules
|
||||
|
||||
plugins:
|
||||
|
||||
@@ -3,4 +3,7 @@
|
||||
bin/*.js
|
||||
*.js.map
|
||||
!transforms/**/__testfixtures__/**/*.js
|
||||
!transforms/**/tests/**/*.output.js
|
||||
!transforms/**/tests/**/*.input.js
|
||||
transforms/**/tests/**/*.test.js
|
||||
!jest.config.js
|
||||
@@ -0,0 +1,37 @@
|
||||
# @navikt/ds-codemod
|
||||
|
||||
## 1.5.8
|
||||
|
||||
## 1.5.7
|
||||
|
||||
## 1.5.6
|
||||
|
||||
## 1.5.5
|
||||
|
||||
## 1.5.4
|
||||
|
||||
## 1.5.3
|
||||
|
||||
## 1.5.2
|
||||
|
||||
## 1.5.1
|
||||
|
||||
## 1.5.0
|
||||
|
||||
## 1.4.4
|
||||
|
||||
## 1.4.3
|
||||
|
||||
## 1.4.2
|
||||
|
||||
## 1.4.1
|
||||
|
||||
## 1.4.0
|
||||
|
||||
## 1.3.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [`40f0b3340`](https://github.com/navikt/Designsystemet/commit/40f0b3340d01bf85fecc04f2f3a8e8b2acf996f1) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Bump for latest-tag
|
||||
|
||||
## 1.3.38
|
||||
@@ -0,0 +1,106 @@
|
||||
# NAV designsystem Codemods
|
||||
|
||||
Collection of Codemods for easier migration between breaking changes.
|
||||
|
||||
Highly inspired by both MUI and NEXT
|
||||
|
||||
- [NEXT](https://nextjs.org/docs/advanced-features/codemods)
|
||||
- [MUI](https://github.com/mui/material-ui/tree/master/packages/mui-codemod)
|
||||
|
||||
## Usage
|
||||
|
||||
Codemod transformations runs code-transformations programmatically in your project. This helps when migrating lots of breaking changes without spending hours doing it manually.
|
||||
|
||||
NOTE: This codemod only supports fairly "default" usage of components. Components used with dynamic imports, styled-components, non-default imports (example `import * as DS from "@navikt/ds-react"` or `from "@navikt/ds-react/cjs"`) will not work as expected.
|
||||
|
||||
```javascript
|
||||
npx @navikt/ds-codemod <transform> <path>
|
||||
```
|
||||
|
||||
transform - name of transform, see available transforms below.
|
||||
path - files or directory to transform
|
||||
--dry Do a dry-run, no code will be edited
|
||||
--print Prints the changed output for comparison
|
||||
|
||||
## Beta (0.19.x) -> v1.0.0
|
||||
|
||||
`npx @navikt/ds-codemod v1.0.0/preset src`
|
||||
|
||||
### preset
|
||||
|
||||
Combines all avaliable codemods for migrating from beta -> v1.0.0. This transform should only be ran once.
|
||||
|
||||
Includes these transforms
|
||||
|
||||
- v1.0.0/tabs
|
||||
- v1.0.0/chat
|
||||
- v1.0.0/pagination
|
||||
|
||||
### tabs
|
||||
|
||||
`npx @navikt/ds-codemod v1.0.0/tabs src`
|
||||
|
||||
```diff
|
||||
<Tabs
|
||||
defaultValue="logg"
|
||||
onChange={(x) => console.log(x)}
|
||||
- loop
|
||||
+ iconPosition="left"
|
||||
>
|
||||
<Tabs.List
|
||||
- loop
|
||||
>
|
||||
<Tabs.Tab
|
||||
value="logg"
|
||||
label="logg"
|
||||
- iconPosition="left"
|
||||
/>
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
</Tabs>
|
||||
```
|
||||
|
||||
### chat
|
||||
|
||||
`npx @navikt/ds-codemodmod v1.0.0/chat src`
|
||||
|
||||
```diff
|
||||
-<SpeechBubble
|
||||
+<Chat
|
||||
- illustration={<Illustration />}
|
||||
- topText="Ola Normann 01.01.21 14:00"
|
||||
- illustrationBgColor="blue"
|
||||
+ avatar={<Illustration />}
|
||||
+ name="Ola Normann 01.01.21 14:00"
|
||||
+ avatarBgColor="blue"
|
||||
backgroundColor="red"
|
||||
>
|
||||
- <SpeechBubble.Bubble>
|
||||
+ <Chat.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
- </SpeechBubble.Bubble>
|
||||
+ </Chat.Bubble>
|
||||
-</SpeechBubble>
|
||||
+</Chat>
|
||||
```
|
||||
|
||||
### pagination
|
||||
|
||||
`npx @navikt/ds-codemod v1.0.0/pagination src`
|
||||
|
||||
This codemod should only be ran once, since the size-scale will keep decreasing for each subsequent iteration.
|
||||
|
||||
```diff
|
||||
-<Pagiation />
|
||||
+<Pagiation size="small"/>
|
||||
|
||||
-<Pagiation size="medium"/>
|
||||
+<Pagiation size="small"/>
|
||||
|
||||
-<Pagiation size="small"/>
|
||||
+<Pagiation size="xsmall"/>
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/navikt/Designsystemet/blob/master/LICENCE)
|
||||
@@ -35,7 +35,7 @@ export function checkGitStatus(force) {
|
||||
if (force) {
|
||||
console.log(`WARNING: ${errorMessage}. Forcibly continuing.`);
|
||||
} else {
|
||||
console.log("Thank you for using @@navikt/ds-codemod");
|
||||
console.log("Thank you for using @navikt/ds-codemod");
|
||||
console.log(
|
||||
chalk.yellow(
|
||||
"\nBut before we continue, please stash or commit your git changes."
|
||||
@@ -94,6 +94,18 @@ export function runTransform({ files, flags, transformer }) {
|
||||
}
|
||||
|
||||
const TRANSFORMER_INQUIRER_CHOICES = [
|
||||
{
|
||||
name: "v1.0.0/preset: Runs all codemods for beta to v1 migration",
|
||||
value: "v1.0.0/preset",
|
||||
},
|
||||
{
|
||||
name: "v1.0.0/pagination: Fixes breaking API-changes from <Pagination /> component",
|
||||
value: "v1.0.0/pagination",
|
||||
},
|
||||
{
|
||||
name: "v1.0.0/tabs: Fixes breaking API-changes from <Tabs /> component",
|
||||
value: "v1.0.0/tabs",
|
||||
},
|
||||
{
|
||||
name: "v1.0.0/chat: Fixes breaking API-changes from <SpeechBubble /> (now <Chat/>) component",
|
||||
value: "v1.0.0/chat",
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { deleteSync } from "del";
|
||||
|
||||
deleteSync([
|
||||
"utils/**/*.js",
|
||||
"bin/**/*.js",
|
||||
"transforms/**/*.js",
|
||||
"!transforms/**/__testfixtures__",
|
||||
"!transforms/**/tests/*.input.*",
|
||||
"!transforms/**/tests/*.output.*",
|
||||
]);
|
||||
@@ -1,5 +1,5 @@
|
||||
const customJestConfig = {
|
||||
testMatch: ["**/__tests__/**/*.js"],
|
||||
testMatch: ["**/__tests__/**/*.js", "**/tests/*.test.js"],
|
||||
verbose: true,
|
||||
rootDir: "./transforms",
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-codemod",
|
||||
"version": "1.0.2",
|
||||
"private": true,
|
||||
"version": "1.5.8",
|
||||
"description": "NAV designsystem codemods",
|
||||
"author": "NAV Designsystem team",
|
||||
"license": "MIT",
|
||||
@@ -11,16 +10,17 @@
|
||||
"jscodeshift"
|
||||
],
|
||||
"files": [
|
||||
"transforms/*.js",
|
||||
"transforms/**/*.js",
|
||||
"bin/*.js",
|
||||
"lib/**/*.js",
|
||||
"lib/cra-to-next/gitignore"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"dev": "tsc --watch -p tsconfig.json",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch"
|
||||
"build": "yarn clean && tsc -p tsconfig.json",
|
||||
"dev": "yarn clean && tsc --watch -p tsconfig.json",
|
||||
"test": "yarn build && jest",
|
||||
"test:watch": "jest --watch",
|
||||
"clean": "node clean.mjs"
|
||||
},
|
||||
"bin": "./bin/ds-codemod.js",
|
||||
"repository": {
|
||||
@@ -36,18 +36,26 @@
|
||||
"globby": "11.0.1",
|
||||
"inquirer": "7.3.3",
|
||||
"is-git-clean": "1.1.0",
|
||||
"jest": "^27.5.0",
|
||||
"jest": "^29.0.0",
|
||||
"jscodeshift": "0.13.1",
|
||||
"jscodeshift-add-imports": "1.0.10",
|
||||
"meow": "7.0.1"
|
||||
"lodash": "4.17.21",
|
||||
"meow": "7.0.1",
|
||||
"prettier": "2.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.0.0",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/jscodeshift": "0.11.5",
|
||||
"@types/react": "^18.0.0",
|
||||
"typescript": "^4.7.2"
|
||||
"del": "7.0.0",
|
||||
"typescript": "^4.8.0"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
export {};
|
||||
|
||||
jest.autoMockOff();
|
||||
const defineTest = require("jscodeshift/dist/testUtils").defineTest;
|
||||
|
||||
const tests = [
|
||||
{
|
||||
fixture: "rename",
|
||||
options: {
|
||||
component: "SpeechBubble",
|
||||
from: "illustration",
|
||||
to: "avatar",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
for (const test of tests) {
|
||||
defineTest(
|
||||
__dirname,
|
||||
"rename-prop",
|
||||
test.options,
|
||||
`rename-prop/${test.fixture}`
|
||||
);
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import renameProps from "./utils/rename-props";
|
||||
import renameProps from "../../utils/rename-props";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
@@ -0,0 +1,17 @@
|
||||
import { check } from "../../../utils/check";
|
||||
|
||||
const migration = "rename-prop";
|
||||
const fixtures = ["rename"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "js",
|
||||
options: {
|
||||
component: "SpeechBubble",
|
||||
from: "illustration",
|
||||
to: "avatar",
|
||||
},
|
||||
});
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -8,8 +8,9 @@ export const Page = () => {
|
||||
topText="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
illustrationBgColor="blue"
|
||||
{...testProps}
|
||||
>
|
||||
<SpeechBubble.Bubble>
|
||||
<SpeechBubble.Bubble {...testProps}>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</SpeechBubble.Bubble>
|
||||
<SpeechBubble.Bubble>
|
||||
|
||||
@@ -8,8 +8,9 @@ export const Page = () => {
|
||||
name="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
avatarBgColor="blue"
|
||||
{...testProps}
|
||||
>
|
||||
<Chat.Bubble>
|
||||
<Chat.Bubble {...testProps}>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
|
||||
@@ -3,9 +3,16 @@ import { Pagination, Button } from "@navikt/ds-react";
|
||||
export const Demo = () => {
|
||||
return (
|
||||
<div>
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination
|
||||
size="small"
|
||||
onPageChange={setPage}
|
||||
data-version="v1"
|
||||
{...testProps}
|
||||
/>
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="xsmall" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination onPageChange={setPage} />
|
||||
<Pagination size="small" onPageChange={setPage} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -3,7 +3,14 @@ import { Pagination, Button } from "@navikt/ds-react";
|
||||
export const Demo = () => {
|
||||
return (
|
||||
<div>
|
||||
<Pagination
|
||||
size="small"
|
||||
onPageChange={setPage}
|
||||
data-version="v1"
|
||||
{...testProps}
|
||||
/>
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="xsmall" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="xsmall" onPageChange={setPage} data-version="v1" />
|
||||
</div>
|
||||
|
||||
@@ -3,9 +3,9 @@ import { Pagination as DsPagination, Button } from "@navikt/ds-react";
|
||||
export const Demo = () => {
|
||||
return (
|
||||
<div>
|
||||
<DsPagination size="small" onPageChange={setPage} />
|
||||
<DsPagination size="small" onPageChange={setPage} />
|
||||
<DsPagination size="xsmall" onPageChange={setPage} />
|
||||
<DsPagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<DsPagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<DsPagination size="xsmall" onPageChange={setPage} data-version="v1" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -3,9 +3,9 @@ import { Pagination, Button } from "@navikt/ds-react";
|
||||
export const Demo = () => {
|
||||
return (
|
||||
<div>
|
||||
<Pagination size="small" onPageChange={setPage} />
|
||||
<Pagination size="small" onPageChange={setPage} />
|
||||
<Pagination size="xsmall" onPageChange={setPage} />
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="xsmall" onPageChange={setPage} data-version="v1" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -4,9 +4,9 @@ const TabComp = () => {
|
||||
return (
|
||||
/* prettier-ignore */
|
||||
<div>
|
||||
<Tabs defaultValue="logg" onChange={(x) => console.log(x)}>
|
||||
<Tabs.List loop={false}>
|
||||
<Tabs.Tab value="logg" iconPosition={props.left} label="logg" />
|
||||
<Tabs defaultValue="logg" onChange={(x) => console.log(x)} {...testProps}>
|
||||
<Tabs.List loop={false} {...testProps}>
|
||||
<Tabs.Tab value="logg" iconPosition={props.left} label="logg" {...testProps}/>
|
||||
<Tabs.Tab value="logg2" iconPosition="top" label="logg2medlangtekst" />
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
|
||||
@@ -7,10 +7,11 @@ const TabComp = () => {
|
||||
<Tabs
|
||||
defaultValue="logg"
|
||||
onChange={(x) => console.log(x)}
|
||||
{...testProps}
|
||||
loop={false}
|
||||
iconPosition={props.left}>
|
||||
<Tabs.List>
|
||||
<Tabs.Tab value="logg" label="logg" />
|
||||
<Tabs.List {...testProps}>
|
||||
<Tabs.Tab value="logg" label="logg" {...testProps} />
|
||||
<Tabs.Tab value="logg2" label="logg2medlangtekst" />
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import renameProps from "../utils/rename-props";
|
||||
import renameProps from "../../utils/rename-props";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
@@ -28,7 +28,7 @@ export default function transformer(file, api, options) {
|
||||
});
|
||||
});
|
||||
|
||||
if (!!j(file.source).findJSXElements(localName)) {
|
||||
if (j(file.source).findJSXElements(localName)) {
|
||||
renameProps({
|
||||
root,
|
||||
componentName: localName,
|
||||
|
||||
@@ -8,6 +8,22 @@ export default function transformer(file, api, options) {
|
||||
|
||||
const root = j(file.source);
|
||||
|
||||
function addMigrationTag(node) {
|
||||
const attributes = node.openingElement.attributes;
|
||||
const isMigrated = attributes.find(
|
||||
(node) =>
|
||||
node.type === "JSXAttribute" &&
|
||||
node.name.name === "data-version" &&
|
||||
node.value.value === "v1"
|
||||
);
|
||||
|
||||
if (!isMigrated) {
|
||||
attributes.push(
|
||||
j.jsxAttribute(j.jsxIdentifier("data-version"), j.literal("v1"))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/* https://github.com/mui/material-ui/blob/master/packages/mui-codemod/src/v5.0.0/variant-prop.js */
|
||||
function addExplicitStandardProp(node) {
|
||||
const attributes = node.openingElement.attributes;
|
||||
@@ -19,6 +35,7 @@ export default function transformer(file, api, options) {
|
||||
attributes.unshift(
|
||||
j.jsxAttribute(j.jsxIdentifier("size"), j.literal("small"))
|
||||
);
|
||||
addMigrationTag(node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,19 +54,25 @@ export default function transformer(file, api, options) {
|
||||
});
|
||||
});
|
||||
|
||||
if (!!j(file.source).findJSXElements(localName)) {
|
||||
if (j(file.source).findJSXElements(localName)) {
|
||||
root.findJSXElements(`${localName}`).forEach((parent) => {
|
||||
const skip = !!parent.value.openingElement?.attributes.find(
|
||||
(x) => x.name.name === "data-version" && x.value.value === "v1"
|
||||
);
|
||||
|
||||
parent.value.openingElement?.attributes.forEach((x, index) => {
|
||||
let didUpdate = false;
|
||||
if (x.name?.name === "size" && x.type === "JSXAttribute" && !skip) {
|
||||
/* addExplicitStandardProp */
|
||||
if (x.value.value === "medium") {
|
||||
x.value = j.literal("small");
|
||||
didUpdate = true;
|
||||
} else if (x.value.value === "small") {
|
||||
x.value = j.literal("xsmall");
|
||||
didUpdate = true;
|
||||
}
|
||||
|
||||
didUpdate && addMigrationTag(parent.value);
|
||||
}
|
||||
});
|
||||
addExplicitStandardProp(parent.value);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import transformTabs from "./tabs";
|
||||
import transformChat from "./chat";
|
||||
import transformPagination from "./pagination";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api, options) {
|
||||
file.source = transformTabs(file, api, options);
|
||||
file.source = transformChat(file, api, options);
|
||||
file.source = transformPagination(file, api, options);
|
||||
|
||||
return file.source;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import renameProps from "../utils/rename-props";
|
||||
import renameProps from "../../utils/rename-props";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
@@ -23,7 +23,7 @@ export default function transformer(file, api, options) {
|
||||
});
|
||||
});
|
||||
|
||||
if (!!j(file.source).findJSXElements(localName)) {
|
||||
if (j(file.source).findJSXElements(localName)) {
|
||||
renameProps({
|
||||
root,
|
||||
componentName: `${localName}.List`,
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
.test {
|
||||
color: var(--navds-global-color-blue-100);
|
||||
color: var(--navds-global-color-red-100);
|
||||
|
||||
--navds-global-color-red-100: var(--navds-global-color-green-100);
|
||||
--navds-global-color-blue-100: red;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
const StyledDiv = styled`
|
||||
--navds-global-color-red-100: var(--navds-global-color-green-100);
|
||||
--navds-global-color-blue-100: red;
|
||||
|
||||
.test{
|
||||
color: var(--navds-global-color-blue-100);
|
||||
}
|
||||
`;
|
||||
|
||||
<style>
|
||||
{`
|
||||
.test{
|
||||
color: var(--navds-global-color-blue-100);
|
||||
}
|
||||
`}
|
||||
</style>;
|
||||
@@ -0,0 +1,7 @@
|
||||
.test {
|
||||
color: var(--a-blue-100);
|
||||
color: var(--a-red-100);
|
||||
|
||||
--a-red-100: var(--a-green-100);
|
||||
--a-blue-100: red;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
const StyledDiv = styled`
|
||||
--a-red-100: var(--a-green-100);
|
||||
--a-blue-100: red;
|
||||
|
||||
.test{
|
||||
color: var(--a-blue-100);
|
||||
}
|
||||
`;
|
||||
|
||||
<style>
|
||||
{`
|
||||
.test{
|
||||
color: var(--a-blue-100);
|
||||
}
|
||||
`}
|
||||
</style>;
|
||||
@@ -0,0 +1,18 @@
|
||||
import { check } from "../../../../utils/check";
|
||||
|
||||
const migration = "update-css-tokens";
|
||||
const fixtures = ["complete"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "js",
|
||||
});
|
||||
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "css",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// TODO: Hent utenfra
|
||||
export const tokens = [
|
||||
["--navds-global-color-red-100", "--a-red-100"],
|
||||
["--navds-global-color-green-100", "--a-green-100"],
|
||||
["--navds-global-color-blue-100", "--a-blue-100"],
|
||||
["--navds-global-color-blue-200", "--a-blue-200"],
|
||||
["--navds-global-color-blue-400", "--a-blue-400"],
|
||||
["--navds-global-color-green-100", "--a-green-100"],
|
||||
["--navds-global-color-green-500", "--a-green-500"],
|
||||
["--navds-semantic-color-link", "--a-text-action"],
|
||||
["--navds-global-color-gray-100", "--a-gray-100"],
|
||||
["--navds-global-color-gray-400", "--a-gray-400"],
|
||||
["--navds-global-color-gray-600", "--a-gray-600"],
|
||||
[
|
||||
"--navds-semantic-color-interaction-primary-hover-subtle",
|
||||
"--a-surface-action-subtle",
|
||||
],
|
||||
["--navds-semantic-color-canvas-background-inverted", "--a-surface-inverted"],
|
||||
];
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api, options) {
|
||||
let src = file.source;
|
||||
|
||||
tokens.forEach((tok) => {
|
||||
const rgx = new RegExp("(" + tok[0] + ")", "gm");
|
||||
src = src.replace(rgx, tok[1]);
|
||||
});
|
||||
|
||||
return src;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
NavdsGlobalColorBlue400 as abc132,
|
||||
NavdsGlobalColorGray100,
|
||||
NavdsGlobalColorGray400,
|
||||
NavdsSemanticColorLink,
|
||||
} from "@navikt/ds-tokens/dist/tokens";
|
||||
import { BodyShort } from "@navikt/ds-react";
|
||||
|
||||
const StyledNavLink = styled(NavLink)`
|
||||
border-bottom: 5px solid white;
|
||||
color: inherit;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
width: 100%;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
:hover {
|
||||
border-bottom: 5px solid ${abc132};
|
||||
p {
|
||||
color: ${NavdsSemanticColorLink};
|
||||
}
|
||||
}
|
||||
&.active {
|
||||
background-color: ${NavdsGlobalColorGray100};
|
||||
border-bottom: 5px solid ${NavdsSemanticColorLink};
|
||||
|
||||
.typo-normal {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledLenketekst = styled(BodyShort)`
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
`;
|
||||
|
||||
const StyledTekst = styled(BodyShort)`
|
||||
border-bottom: 5px solid white;
|
||||
color: ${NavdsGlobalColorGray400};
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
width: 100%;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
`;
|
||||
|
||||
const Fane = ({ side, behandlingId, index, deaktivert }) => {
|
||||
const { gåTilUrl } = useApp();
|
||||
const fanenavn = side.navn;
|
||||
return (
|
||||
<>
|
||||
{deaktivert && (
|
||||
<StyledTekst size={"small"}>
|
||||
{index + 1}. {fanenavn}
|
||||
</StyledTekst>
|
||||
)}
|
||||
{!deaktivert && (
|
||||
<StyledNavLink
|
||||
key={side.navn}
|
||||
to={`/behandling/${behandlingId}/${side.href}`}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
gåTilUrl(`/behandling/${behandlingId}/${side.href}`);
|
||||
}}
|
||||
>
|
||||
<StyledLenketekst size={"small"}>
|
||||
{index + 1}. {fanenavn}
|
||||
</StyledLenketekst>
|
||||
</StyledNavLink>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Fane;
|
||||
@@ -0,0 +1,88 @@
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
ABlue400,
|
||||
AGray100,
|
||||
AGray400,
|
||||
ATextAction,
|
||||
} from "@navikt/ds-tokens/dist/tokens";
|
||||
import { BodyShort } from "@navikt/ds-react";
|
||||
|
||||
const StyledNavLink = styled(NavLink)`
|
||||
border-bottom: 5px solid white;
|
||||
color: inherit;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
width: 100%;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
:hover {
|
||||
border-bottom: 5px solid ${ABlue400};
|
||||
p {
|
||||
color: ${ATextAction};
|
||||
}
|
||||
}
|
||||
&.active {
|
||||
background-color: ${AGray100};
|
||||
border-bottom: 5px solid ${ATextAction};
|
||||
|
||||
.typo-normal {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledLenketekst = styled(BodyShort)`
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
`;
|
||||
|
||||
const StyledTekst = styled(BodyShort)`
|
||||
border-bottom: 5px solid white;
|
||||
color: ${AGray400};
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
width: 100%;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
`;
|
||||
|
||||
const Fane = ({ side, behandlingId, index, deaktivert }) => {
|
||||
const { gåTilUrl } = useApp();
|
||||
const fanenavn = side.navn;
|
||||
return (
|
||||
<>
|
||||
{deaktivert && (
|
||||
<StyledTekst size={"small"}>
|
||||
{index + 1}. {fanenavn}
|
||||
</StyledTekst>
|
||||
)}
|
||||
{!deaktivert && (
|
||||
<StyledNavLink
|
||||
key={side.navn}
|
||||
to={`/behandling/${behandlingId}/${side.href}`}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
gåTilUrl(`/behandling/${behandlingId}/${side.href}`);
|
||||
}}
|
||||
>
|
||||
<StyledLenketekst size={"small"}>
|
||||
{index + 1}. {fanenavn}
|
||||
</StyledLenketekst>
|
||||
</StyledNavLink>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Fane;
|
||||
@@ -0,0 +1,12 @@
|
||||
import { check } from "../../../../utils/check";
|
||||
|
||||
const migration = "update-js-tokens";
|
||||
const fixtures = ["complete"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "js",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import type { JSCodeshift } from "jscodeshift";
|
||||
import {
|
||||
getImportSpecifier,
|
||||
getImportSpecifierName,
|
||||
renameImportSpecifier,
|
||||
} from "../../../utils/imports";
|
||||
import { translateToken } from "../../../utils/translate-token";
|
||||
import { tokens } from "../update-css-tokens/update-css-tokens";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file: JSCodeshift, api) {
|
||||
let src = file.source;
|
||||
|
||||
const j = api.jscodeshift as JSCodeshift;
|
||||
|
||||
let root = j(file.source);
|
||||
|
||||
const jsImport = root.find(j.ImportDeclaration).filter((x) => {
|
||||
return ["@navikt/ds-tokens/dist/tokens"].includes(
|
||||
x.node.source.value as string
|
||||
);
|
||||
});
|
||||
|
||||
if (!jsImport) {
|
||||
return src;
|
||||
}
|
||||
|
||||
tokens.forEach((x) => {
|
||||
const name = translateToken(x[0], "js");
|
||||
const out = translateToken(x[1], "js");
|
||||
|
||||
let foundName: string = "";
|
||||
|
||||
getImportSpecifier(j, root, name, "@navikt/ds-tokens/dist/tokens").forEach(
|
||||
(x) => (foundName = x.node.imported.name)
|
||||
);
|
||||
|
||||
if (name === foundName) {
|
||||
const localName =
|
||||
getImportSpecifierName(
|
||||
j,
|
||||
root,
|
||||
name,
|
||||
"@navikt/ds-tokens/dist/tokens"
|
||||
) || name;
|
||||
|
||||
renameImportSpecifier(
|
||||
j,
|
||||
root,
|
||||
name,
|
||||
out,
|
||||
"@navikt/ds-tokens/dist/tokens"
|
||||
);
|
||||
|
||||
let code = root.toSource();
|
||||
|
||||
const rgx = new RegExp("(" + localName + ")", "gm");
|
||||
code = code.replace(rgx, out);
|
||||
root = j(code);
|
||||
}
|
||||
});
|
||||
|
||||
return root.toSource();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
.filtersMenu {
|
||||
box-shadow: @navds-global-color-blue-200 inset 0 0 0 8px;
|
||||
border-radius: 0.2em;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.filterExplanationHighlight {
|
||||
background-color: @navds-global-color-green-100;
|
||||
border: 1px solid @navds-global-color-green-500;
|
||||
transition: all 0.4s linear;
|
||||
}
|
||||
|
||||
.lenkepanelNavno {
|
||||
border: 1px solid @navds-semantic-color-link;
|
||||
|
||||
.navds-link-panel__content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.navds-link-panel__title,
|
||||
.navds-link-panel__chevron {
|
||||
color: @navds-semantic-color-link;
|
||||
}
|
||||
|
||||
background-color: @navds-global-color-gray-600;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
.filtersMenu {
|
||||
box-shadow: @a-blue-200 inset 0 0 0 8px;
|
||||
border-radius: 0.2em;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.filterExplanationHighlight {
|
||||
background-color: @a-green-100;
|
||||
border: 1px solid @a-green-500;
|
||||
transition: all 0.4s linear;
|
||||
}
|
||||
|
||||
.lenkepanelNavno {
|
||||
border: 1px solid @a-text-action;
|
||||
|
||||
.navds-link-panel__content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.navds-link-panel__title,
|
||||
.navds-link-panel__chevron {
|
||||
color: @a-text-action;
|
||||
}
|
||||
|
||||
background-color: @a-gray-600;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { check } from "../../../../utils/check";
|
||||
|
||||
const migration = "update-less-tokens";
|
||||
const fixtures = ["complete"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "less",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { translateToken } from "../../../utils/translate-token";
|
||||
import { tokens } from "../update-css-tokens/update-css-tokens";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file) {
|
||||
let src = file.source;
|
||||
|
||||
tokens.forEach((tok) => {
|
||||
const lessToken = translateToken(tok[0], "less");
|
||||
|
||||
const rgx = new RegExp("(\\" + lessToken + ")", "gm");
|
||||
src = src.replace(rgx, translateToken(tok[1], "less"));
|
||||
});
|
||||
|
||||
return src;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
.filtersMenu {
|
||||
box-shadow: common.$navds-global-color-blue-200 inset 0 0 0 8px;
|
||||
border-radius: 0.2em;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.filterExplanationHighlight {
|
||||
background-color: common.$navds-global-color-green-100;
|
||||
border: 1px solid common.$navds-global-color-green-500;
|
||||
transition: all 0.4s linear;
|
||||
}
|
||||
|
||||
.lenkepanelNavno {
|
||||
&:global(.navds-link-panel) {
|
||||
border: 1px solid common.$navds-semantic-color-link;
|
||||
}
|
||||
|
||||
:global {
|
||||
.navds-link-panel__content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.navds-link-panel__title,
|
||||
.navds-link-panel__chevron {
|
||||
color: common.$navds-semantic-color-link;
|
||||
}
|
||||
}
|
||||
|
||||
background-color: common.$navds-global-color-gray-600;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
.filtersMenu {
|
||||
box-shadow: common.$a-blue-200 inset 0 0 0 8px;
|
||||
border-radius: 0.2em;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.filterExplanationHighlight {
|
||||
background-color: common.$a-green-100;
|
||||
border: 1px solid common.$a-green-500;
|
||||
transition: all 0.4s linear;
|
||||
}
|
||||
|
||||
.lenkepanelNavno {
|
||||
&:global(.navds-link-panel) {
|
||||
border: 1px solid common.$a-text-action;
|
||||
}
|
||||
|
||||
:global {
|
||||
.navds-link-panel__content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.navds-link-panel__title,
|
||||
.navds-link-panel__chevron {
|
||||
color: common.$a-text-action;
|
||||
}
|
||||
}
|
||||
|
||||
background-color: common.$a-gray-600;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { check } from "../../../../utils/check";
|
||||
|
||||
const migration = "update-sass-tokens";
|
||||
const fixtures = ["complete"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "scss",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { translateToken } from "../../../utils/translate-token";
|
||||
import { tokens } from "../update-css-tokens/update-css-tokens";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file) {
|
||||
let src = file.source;
|
||||
|
||||
tokens.forEach((tok) => {
|
||||
const scssToken = translateToken(tok[0], "scss");
|
||||
|
||||
const rgx = new RegExp("(\\" + scssToken + ")", "gm");
|
||||
src = src.replace(rgx, translateToken(tok[1], "scss"));
|
||||
});
|
||||
|
||||
return src;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.test {
|
||||
@apply bg-canvas-background-inverted text-interaction-primary-hover-subtle/20;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export const demo = () => (
|
||||
<div
|
||||
className={cl(
|
||||
"bg-white text-text shadow-small ring-gray-900/10 hover:shadow-medium active:text-link",
|
||||
className
|
||||
)}
|
||||
>
|
||||
<div className="bg-canvas-background-inverted text-interaction-primary-hover-subtle"></div>
|
||||
</div>
|
||||
);
|
||||
@@ -0,0 +1,3 @@
|
||||
.test {
|
||||
@apply bg-surface-inverted text-surface-action-subtle/20;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export const demo = () => (
|
||||
<div
|
||||
className={cl(
|
||||
"bg-white text-text shadow-small ring-gray-900/10 hover:shadow-medium active:text-text-action",
|
||||
className
|
||||
)}
|
||||
>
|
||||
<div className="bg-surface-inverted text-surface-action-subtle"></div>
|
||||
</div>
|
||||
);
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { check } from "../../../../utils/check";
|
||||
|
||||
const migration = "update-tailwind-tokens";
|
||||
const fixtures = ["complete"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "js",
|
||||
});
|
||||
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "css",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { tokens } from "../update-css-tokens/update-css-tokens";
|
||||
|
||||
/* Cherry-picks object keys we want */
|
||||
const semanticTokens = () =>
|
||||
tokens
|
||||
.filter((val) => val[0].startsWith("--navds-semantic-color"))
|
||||
.map((val) => {
|
||||
return [
|
||||
val[0].replace("--navds-semantic-color-", ""),
|
||||
val[1].replace("--a-", ""),
|
||||
];
|
||||
});
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api, options) {
|
||||
let src = file.source;
|
||||
const colors = semanticTokens();
|
||||
const duplicateText: string[][] = [];
|
||||
|
||||
colors.forEach(
|
||||
(x) =>
|
||||
x[0].startsWith("text-") && duplicateText.push(["text-" + x[0], x[1]])
|
||||
);
|
||||
|
||||
[...duplicateText, ...colors].forEach((tok) => {
|
||||
const rgx = new RegExp("(" + tok[0] + ")", "gm");
|
||||
src = src.replace(rgx, tok[1]);
|
||||
});
|
||||
|
||||
return src;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
import prettier from "prettier";
|
||||
|
||||
const applyTransform = require("jscodeshift/dist/testUtils").applyTransform;
|
||||
|
||||
interface TestT {
|
||||
fixture: string;
|
||||
migration: string;
|
||||
extension?: "js" | "scss" | "less" | "css";
|
||||
options?: { [option: string]: any };
|
||||
}
|
||||
|
||||
export function check(
|
||||
dirName: string,
|
||||
{ fixture, migration, extension = "js", options = {} }: TestT
|
||||
) {
|
||||
describe(migration, () => {
|
||||
it(fixture, async () => {
|
||||
const fixtureDir = path.join(dirName);
|
||||
const inputPath = path.join(fixtureDir, `${fixture}.input.${extension}`);
|
||||
const parser = extension;
|
||||
const source = fs.readFileSync(inputPath, "utf8");
|
||||
const expected = fs.readFileSync(
|
||||
path.join(fixtureDir, `${fixture}.output.${extension}`),
|
||||
"utf8"
|
||||
);
|
||||
// Assumes transform is one level up from tests directory
|
||||
const module = await import(path.join(dirName, "..", migration));
|
||||
const output = applyTransform({ ...module, parser: "tsx" }, options, {
|
||||
source,
|
||||
});
|
||||
|
||||
// Format output and expected with prettier for white spaces and line breaks consistency
|
||||
expect(
|
||||
prettier.format(output, {
|
||||
parser: parser === "js" ? "typescript" : parser,
|
||||
})
|
||||
).toBe(
|
||||
prettier.format(expected, {
|
||||
parser: parser === "js" ? "typescript" : parser,
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import core, { Collection } from "jscodeshift";
|
||||
|
||||
export function getImportSpecifier(
|
||||
j: core.JSCodeshift,
|
||||
source: Collection<any>,
|
||||
specifier: string,
|
||||
sourcePath: string
|
||||
) {
|
||||
return source
|
||||
.find(j.ImportDeclaration)
|
||||
.filter((path) => path.node.source.value === sourcePath)
|
||||
.find(j.ImportSpecifier)
|
||||
.filter((path) => path.value.imported.name === specifier);
|
||||
}
|
||||
|
||||
export function renameImportSpecifier(
|
||||
j: core.JSCodeshift,
|
||||
source: Collection<any>,
|
||||
specifier: string,
|
||||
newSpecifier: string,
|
||||
sourcePath: string
|
||||
) {
|
||||
getImportSpecifier(j, source, specifier, sourcePath).replaceWith(
|
||||
j.importSpecifier(j.identifier(newSpecifier))
|
||||
);
|
||||
}
|
||||
|
||||
export function getImportSpecifierName(
|
||||
j: core.JSCodeshift,
|
||||
source: Collection<any>,
|
||||
specifier: string,
|
||||
sourcePath: string
|
||||
) {
|
||||
const specifiers = getImportSpecifier(j, source, specifier, sourcePath);
|
||||
|
||||
return specifiers.length > 0 ? specifiers.nodes()[0]!.local!.name : null;
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,36 @@
|
||||
import { translateToken } from "../translate-token";
|
||||
|
||||
export {};
|
||||
|
||||
jest.autoMockOff();
|
||||
|
||||
const tokens = [
|
||||
{
|
||||
name: "--navds-global-color-red-100",
|
||||
scss: "$navds-global-color-red-100",
|
||||
less: "@navds-global-color-red-100",
|
||||
js: "NavdsGlobalColorRed100",
|
||||
},
|
||||
{
|
||||
name: "--a-blue-100",
|
||||
scss: "$a-blue-100",
|
||||
less: "@a-blue-100",
|
||||
js: "ABlue100",
|
||||
},
|
||||
];
|
||||
|
||||
describe("Translating tokens to correct format", () => {
|
||||
test("To scss", () => {
|
||||
tokens.forEach((x) =>
|
||||
expect(translateToken(x.name, "scss")).toEqual(x.scss)
|
||||
);
|
||||
});
|
||||
test("To less", () => {
|
||||
tokens.forEach((x) =>
|
||||
expect(translateToken(x.name, "less")).toEqual(x.less)
|
||||
);
|
||||
});
|
||||
test("To js", () => {
|
||||
tokens.forEach((x) => expect(translateToken(x.name, "js")).toEqual(x.js));
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import _ from "lodash";
|
||||
|
||||
export const translateToken = (token: string, type: "scss" | "less" | "js") => {
|
||||
switch (type) {
|
||||
case "scss":
|
||||
return token.replace("--", "$");
|
||||
case "less":
|
||||
return token.replace("--", "@");
|
||||
case "js":
|
||||
return _.startCase(token).split(" ").join("");
|
||||
|
||||
default:
|
||||
return token;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
# @navikt/ds-css
|
||||
|
||||
## 1.5.8
|
||||
|
||||
## 1.5.7
|
||||
|
||||
## 1.5.6
|
||||
|
||||
## 1.5.5
|
||||
|
||||
## 1.5.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#1709](https://github.com/navikt/Designsystemet/pull/1709) [`77302a30b`](https://github.com/navikt/Designsystemet/commit/77302a30b8eef8dc00b2d2e9c904a3f57da81a11) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Oppdatert ikoner
|
||||
|
||||
## 1.5.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Byttet om på alt-farge rekkefølge
|
||||
|
||||
## 1.5.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- :memo: Rename FilterChips to ToggleChips
|
||||
|
||||
## 1.5.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Flex-wrap chips.css
|
||||
|
||||
## 1.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#1684](https://github.com/navikt/Designsystemet/pull/1684) [`e19bf67b3`](https://github.com/navikt/Designsystemet/commit/e19bf67b337dea39989c68b5e9c2591cf0d5b40f) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :sparkles: Oppdaterte tag-varianter
|
||||
|
||||
- [#1668](https://github.com/navikt/Designsystemet/pull/1668) [`97c5f60e9`](https://github.com/navikt/Designsystemet/commit/97c5f60e9111da7e08f55c8d0aa29581f0a9b1ca) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Chips komponent :sparkles:
|
||||
|
||||
## 1.4.4
|
||||
|
||||
## 1.4.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- :sparkles: Validering og inputFormat i Date-komponenter
|
||||
|
||||
## 1.4.2
|
||||
|
||||
## 1.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [`3c08651df`](https://github.com/navikt/Designsystemet/commit/3c08651df28c3e19dd8c8a7a1d0032200bec473d) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Date-komponenter følger språkrådets dato-formatering for måneder.
|
||||
|
||||
## 1.4.0
|
||||
|
||||
## 1.3.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [`40f0b3340`](https://github.com/navikt/Designsystemet/commit/40f0b3340d01bf85fecc04f2f3a8e8b2acf996f1) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Bump for latest-tag
|
||||
|
||||
## 1.3.38
|
||||
@@ -0,0 +1,50 @@
|
||||
# NAV designsystem styling
|
||||
|
||||
CSS-package containing design for @navikt/ds-react and more.
|
||||
|
||||
- All our tokens (Colors, border, shadows etc)
|
||||
- Component-styling for `@navikt/ds-react` packages
|
||||
- Normalize.css v8
|
||||
- Fonts
|
||||
|
||||
## Installation
|
||||
|
||||
Install `@navikt/ds-css` with yarn
|
||||
|
||||
```bash
|
||||
yarn add @navikt/ds-css
|
||||
```
|
||||
|
||||
Install `@navikt/ds-css` with npm
|
||||
|
||||
```bash
|
||||
npm install @navikt/ds-css
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You can import these styles once to make it accessible in your entire project. Typically you will add the following line to your root .js or .ts files.
|
||||
|
||||
```javascript
|
||||
import "@navikt/ds-css";
|
||||
|
||||
function App() {
|
||||
return <Component />;
|
||||
}
|
||||
```
|
||||
|
||||
But you can also import it in a .css-file like this
|
||||
|
||||
```css
|
||||
@import "@navikt/ds-css";
|
||||
```
|
||||
|
||||
## Learn more
|
||||
|
||||
- [Designsystem documentation](https://aksel.nav.no/designsystem)
|
||||
- [Storybook](https://master--5f801fb2aea7820022de2936.chromatic.com/)
|
||||
- [ds-react README](https://github.com/navikt/Designsystemet/blob/master/%40navikt/core/react/README.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/navikt/Designsystemet/blob/master/LICENCE)
|
||||
@@ -1,28 +1,9 @@
|
||||
:root {
|
||||
--navds-accordion-color-text: var(--navds-semantic-color-text);
|
||||
--navds-accordion-color-background: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
--navds-accordion-color-text-hover: var(--navds-semantic-color-link);
|
||||
--navds-accordion-color-border: var(--navds-semantic-color-border-muted);
|
||||
--navds-accordion-color-border-hover: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-accordion-color-text-open: var(--navds-semantic-color-text);
|
||||
--navds-accordion-color-text-open-hover: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-accordion-color-background-open: var(
|
||||
--navds-semantic-color-interaction-primary-hover-subtle
|
||||
);
|
||||
}
|
||||
|
||||
.navds-accordion .ReactCollapse--collapse {
|
||||
transition: height 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.navds-accordion {
|
||||
background: var(--navds-accordion-color-background);
|
||||
:root,
|
||||
:host {
|
||||
--navds-accordion-color-text-hover: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-accordion-color-border: var(--navds-semantic-color-border);
|
||||
--navds-accordion-color-border-hover: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-accordion-color-background-open: var(--navds-semantic-color-interaction-primary-hover-subtle);
|
||||
}
|
||||
|
||||
.navds-accordion__item:focus-within {
|
||||
@@ -33,9 +14,9 @@
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: var(--navds-spacing-4);
|
||||
padding: var(--navds-spacing-4) var(--navds-spacing-3);
|
||||
align-items: flex-start;
|
||||
gap: var(--navds-spacing-2);
|
||||
padding: 14px var(--navds-spacing-3) var(--navds-spacing-3);
|
||||
margin: 0;
|
||||
text-align: left;
|
||||
background: transparent;
|
||||
@@ -54,37 +35,32 @@
|
||||
border-color: var(--navds-accordion-color-border-hover);
|
||||
}
|
||||
|
||||
.navds-accordion__item--open > .navds-accordion__header {
|
||||
background-color: var(--navds-accordion-color-background-open);
|
||||
color: var(--navds-accordion-color-text-open);
|
||||
border-color: transparent;
|
||||
.navds-accordion__header-content {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.navds-accordion__item--open > .navds-accordion__header:hover {
|
||||
border-color: transparent;
|
||||
color: var(--navds-accordion-color-text-open-hover);
|
||||
.navds-accordion__item--open > .navds-accordion__header {
|
||||
background-color: var(--navds-accordion-color-background-open);
|
||||
border-color: var(--navds-accordion-color-background-open);
|
||||
}
|
||||
|
||||
.navds-accordion__content {
|
||||
color: var(--navds-accordion-color-text);
|
||||
padding: var(--navds-spacing-5) var(--navds-spacing-3) var(--navds-spacing-10);
|
||||
padding: var(--navds-spacing-3) var(--navds-spacing-3) 18px;
|
||||
border-bottom: 2px solid var(--navds-accordion-color-border);
|
||||
}
|
||||
|
||||
.navds-accordion__item--open
|
||||
> .navds-accordion__header:hover
|
||||
+ *
|
||||
.navds-accordion__content {
|
||||
.navds-accordion__item--open > .navds-accordion__header:hover + * .navds-accordion__content {
|
||||
border-color: var(--navds-accordion-color-border-hover);
|
||||
}
|
||||
|
||||
.navds-accordion__expand-icon {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
font-size: 1.5rem;
|
||||
height: 1.75rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.navds-accordion__expand-icon--flip {
|
||||
.navds-accordion__item--open > .navds-accordion__header > .navds-accordion__expand-icon {
|
||||
transform: rotateZ(180deg);
|
||||
}
|
||||
|
||||
@@ -92,8 +68,7 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navds-accordion__header:hover
|
||||
> .navds-accordion__expand-icon.navds-accordion__expand-icon--filled {
|
||||
.navds-accordion__header:hover > .navds-accordion__expand-icon.navds-accordion__expand-icon--filled {
|
||||
display: inherit;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
:root {
|
||||
:root,
|
||||
:host {
|
||||
--navds-alert-color-border: var(--navds-semantic-color-border-muted);
|
||||
--navds-alert-color-error-border: var(
|
||||
--navds-semantic-color-feedback-danger-border
|
||||
);
|
||||
--navds-alert-color-error-border: var(--navds-semantic-color-feedback-danger-border);
|
||||
--navds-alert-color-error-background: var(--navds-global-color-red-50);
|
||||
--navds-alert-color-warning-border: var(
|
||||
--navds-semantic-color-feedback-warning-border
|
||||
);
|
||||
--navds-alert-color-warning-border: var(--navds-semantic-color-feedback-warning-border);
|
||||
--navds-alert-color-warning-background: var(--navds-global-color-orange-50);
|
||||
--navds-alert-color-info-border: var(
|
||||
--navds-semantic-color-feedback-info-border
|
||||
);
|
||||
--navds-alert-color-info-border: var(--navds-semantic-color-feedback-info-border);
|
||||
--navds-alert-color-info-background: var(--navds-global-color-lightblue-50);
|
||||
--navds-alert-color-success-border: var(
|
||||
--navds-semantic-color-feedback-success-border
|
||||
);
|
||||
--navds-alert-color-success-border: var(--navds-semantic-color-feedback-success-border);
|
||||
--navds-alert-color-success-background: var(--navds-global-color-green-50);
|
||||
}
|
||||
|
||||
@@ -33,19 +26,13 @@
|
||||
}
|
||||
|
||||
.navds-alert--small {
|
||||
padding: var(--navds-spacing-2);
|
||||
gap: var(--navds-spacing-2);
|
||||
padding: var(--navds-spacing-2) var(--navds-spacing-4);
|
||||
}
|
||||
|
||||
.navds-alert--full-width {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.navds-alert--full-width.navds-alert--small {
|
||||
padding-right: var(--navds-spacing-4);
|
||||
padding-left: var(--navds-spacing-4);
|
||||
}
|
||||
|
||||
.navds-alert > .navds-alert__icon {
|
||||
flex-shrink: 0;
|
||||
font-size: 1.5rem;
|
||||
@@ -80,6 +67,6 @@
|
||||
|
||||
.navds-alert--inline {
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -6,11 +6,8 @@
|
||||
@import "print.css";
|
||||
@import "utility.css";
|
||||
|
||||
/* Disabled because of UU concerns */
|
||||
|
||||
/* @import "smooth-scroll.css"; */
|
||||
|
||||
html {
|
||||
html,
|
||||
:host {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -21,6 +18,7 @@ html {
|
||||
}
|
||||
|
||||
:root,
|
||||
:host,
|
||||
[data-theme="light"] {
|
||||
--navds-shadow-focus: 0 0 0 3px var(--navds-semantic-color-focus);
|
||||
|
||||
@@ -33,8 +31,9 @@ html {
|
||||
color: var(--navds-semantic-color-text-inverted);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: var(--navds-font-family);
|
||||
body,
|
||||
:host {
|
||||
font-family: var(--navds-font-family, "Source Sans Pro", Arial, sans-serif);
|
||||
line-height: 1.333;
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
@@ -43,6 +42,10 @@ a {
|
||||
color: var(--navds-semantic-color-link);
|
||||
}
|
||||
|
||||
button {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
/* https://web.dev/prefers-reduced-motion/ */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*:not(.navds-loader *):not(.navds-loader),
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* Solution copied from blogpost
|
||||
* https://schepp.dev/posts/smooth-scrolling-and-page-search/
|
||||
* Currently disabled
|
||||
*/
|
||||
|
||||
@keyframes smoothscroll1 {
|
||||
from,
|
||||
to {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes smoothscroll2 {
|
||||
from,
|
||||
to {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
animation: smoothscroll1 1s;
|
||||
}
|
||||
|
||||
html:focus-within {
|
||||
animation-name: smoothscroll2;
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
+90
-125
@@ -1,80 +1,37 @@
|
||||
:root,
|
||||
:host,
|
||||
[data-theme="light"] {
|
||||
/* Primary */
|
||||
--navds-button-color-primary-text: var(--navds-semantic-color-text-inverted);
|
||||
--navds-button-color-primary-border-focus: var(
|
||||
--navds-semantic-color-text-inverted
|
||||
);
|
||||
--navds-button-color-primary-background: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-button-color-primary-background-hover: var(
|
||||
--navds-semantic-color-interaction-primary-hover
|
||||
);
|
||||
--navds-button-color-primary-background-active: var(
|
||||
--navds-semantic-color-interaction-primary-selected
|
||||
);
|
||||
--navds-button-color-primary-border-focus: var(--navds-semantic-color-text-inverted);
|
||||
--navds-button-color-primary-background: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-button-color-primary-background-hover: var(--navds-semantic-color-interaction-primary-hover);
|
||||
--navds-button-color-primary-background-active: var(--navds-semantic-color-interaction-primary-selected);
|
||||
|
||||
/* Secondary */
|
||||
--navds-button-color-secondary-text: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-button-color-secondary-text-hover: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-button-color-secondary-text-active: var(
|
||||
--navds-semantic-color-text-inverted
|
||||
);
|
||||
--navds-button-color-secondary-border: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-button-color-secondary-border-focus-active-hover: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
--navds-button-color-secondary-background: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
--navds-button-color-secondary-background-hover: var(
|
||||
--navds-semantic-color-interaction-primary-hover-subtle
|
||||
);
|
||||
--navds-button-color-secondary-background-active: var(
|
||||
--navds-semantic-color-interaction-primary-selected
|
||||
);
|
||||
--navds-button-color-secondary-text: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-button-color-secondary-text-hover: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-button-color-secondary-text-active: var(--navds-semantic-color-text-inverted);
|
||||
--navds-button-color-secondary-border: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-button-color-secondary-border-focus-active-hover: var(--navds-semantic-color-component-background-light);
|
||||
--navds-button-color-secondary-background: var(--navds-semantic-color-component-background-light);
|
||||
--navds-button-color-secondary-background-hover: var(--navds-semantic-color-interaction-primary-hover-subtle);
|
||||
--navds-button-color-secondary-background-active: var(--navds-semantic-color-interaction-primary-selected);
|
||||
|
||||
/* Tertiary */
|
||||
--navds-button-color-tertiary-text: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-button-color-tertiary-text-active: var(
|
||||
--navds-semantic-color-text-inverted
|
||||
);
|
||||
--navds-button-color-tertiary-background-hover: var(
|
||||
--navds-semantic-color-interaction-primary-hover-subtle
|
||||
);
|
||||
--navds-button-color-tertiary-border-focus: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-button-color-tertiary-border-active: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
--navds-button-color-tertiary-background-active: var(
|
||||
--navds-semantic-color-interaction-primary-selected
|
||||
);
|
||||
--navds-button-color-tertiary-text: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-button-color-tertiary-text-active: var(--navds-semantic-color-text-inverted);
|
||||
--navds-button-color-tertiary-background-hover: var(--navds-semantic-color-interaction-primary-hover-subtle);
|
||||
--navds-button-color-tertiary-border-focus: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-button-color-tertiary-border-active: var(--navds-semantic-color-component-background-light);
|
||||
--navds-button-color-tertiary-background-active: var(--navds-semantic-color-interaction-primary-selected);
|
||||
|
||||
/* Danger */
|
||||
--navds-button-color-danger-text: var(--navds-semantic-color-text-inverted);
|
||||
--navds-button-color-danger-background: var(
|
||||
--navds-semantic-color-interaction-danger
|
||||
);
|
||||
--navds-button-color-danger-background-hover: var(
|
||||
--navds-semantic-color-interaction-danger-hover
|
||||
);
|
||||
--navds-button-color-danger-background-active: var(
|
||||
--navds-semantic-color-interaction-danger-selected
|
||||
);
|
||||
--navds-button-color-danger-border-focus: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
--navds-button-color-danger-background: var(--navds-semantic-color-interaction-danger);
|
||||
--navds-button-color-danger-background-hover: var(--navds-semantic-color-interaction-danger-hover);
|
||||
--navds-button-color-danger-background-active: var(--navds-semantic-color-interaction-danger-selected);
|
||||
--navds-button-color-danger-border-focus: var(--navds-semantic-color-component-background-light);
|
||||
|
||||
/* Loader */
|
||||
--navds-loader-color-on-button-background: rgb(255 255 255 / 0.3);
|
||||
@@ -86,54 +43,53 @@
|
||||
--navds-button-color-primary-text: var(--navds-semantic-color-text);
|
||||
--navds-button-color-primary-border-focus: var(--navds-semantic-color-text);
|
||||
--navds-button-color-primary-background: var(--navds-global-color-blue-200);
|
||||
--navds-button-color-primary-background-hover: var(
|
||||
--navds-global-color-blue-300
|
||||
);
|
||||
--navds-button-color-primary-background-active: var(
|
||||
--navds-global-color-blue-400
|
||||
);
|
||||
--navds-button-color-primary-background-hover: var(--navds-global-color-blue-300);
|
||||
--navds-button-color-primary-background-active: var(--navds-global-color-blue-400);
|
||||
|
||||
/* Secondary */
|
||||
--navds-button-color-secondary-text: var(--navds-global-color-white);
|
||||
--navds-button-color-secondary-text-hover: var(--navds-global-color-white);
|
||||
--navds-button-color-secondary-text-active: var(--navds-global-color-white);
|
||||
--navds-button-color-secondary-border: var(--navds-global-color-blue-200);
|
||||
--navds-button-color-secondary-border-focus-active-hover: var(
|
||||
--navds-semantic-color-text
|
||||
);
|
||||
--navds-button-color-secondary-background: var(
|
||||
--navds-semantic-color-component-background-inverted
|
||||
);
|
||||
--navds-button-color-secondary-background-hover: var(
|
||||
--navds-global-color-gray-800
|
||||
);
|
||||
--navds-button-color-secondary-background-active: var(
|
||||
--navds-global-color-gray-700
|
||||
);
|
||||
--navds-button-color-secondary-border-focus-active-hover: var(--navds-semantic-color-text);
|
||||
--navds-button-color-secondary-background: var(--navds-semantic-color-component-background-inverted);
|
||||
--navds-button-color-secondary-background-hover: var(--navds-global-color-gray-800);
|
||||
--navds-button-color-secondary-background-active: var(--navds-global-color-gray-700);
|
||||
}
|
||||
|
||||
.navds-button {
|
||||
display: inline-flex;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
background: none;
|
||||
border-radius: var(--navds-border-radius-small);
|
||||
min-width: 48px;
|
||||
padding: var(--navds-spacing-3);
|
||||
padding: var(--navds-spacing-3) var(--navds-spacing-5);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-button--small {
|
||||
padding-top: 0.375rem;
|
||||
padding-bottom: 0.375rem;
|
||||
min-width: 32px;
|
||||
padding: 0.375rem var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-button--xsmall {
|
||||
padding: 0.125rem 0.375rem;
|
||||
min-width: 24px;
|
||||
padding: 0.125rem var(--navds-spacing-2);
|
||||
gap: var(--navds-spacing-1);
|
||||
}
|
||||
|
||||
.navds-button--icon-only {
|
||||
padding: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-button--small.navds-button--icon-only {
|
||||
padding: 0.375rem;
|
||||
}
|
||||
|
||||
.navds-button--xsmall.navds-button--icon-only {
|
||||
padding: var(--navds-spacing-1);
|
||||
}
|
||||
|
||||
.navds-button:focus {
|
||||
@@ -141,22 +97,37 @@
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button__inner {
|
||||
margin: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--navds-spacing-2);
|
||||
}
|
||||
.navds-button__icon {
|
||||
--navds-button-icon-adjustment: -4px;
|
||||
|
||||
.navds-button svg {
|
||||
font-size: 1.5rem;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.navds-button--small svg,
|
||||
.navds-button--xsmall svg {
|
||||
.navds-button__icon:first-child {
|
||||
margin-left: var(--navds-button-icon-adjustment);
|
||||
}
|
||||
|
||||
.navds-button__icon:last-child {
|
||||
margin-right: var(--navds-button-icon-adjustment);
|
||||
}
|
||||
|
||||
.navds-button__icon:only-child {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navds-button--small .navds-button__icon {
|
||||
--navds-button-icon-adjustment: -2px;
|
||||
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.navds-button--xsmall .navds-button__icon {
|
||||
--navds-button-icon-adjustment: -2px;
|
||||
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
/*************************
|
||||
* .navds-button--primary *
|
||||
*************************/
|
||||
@@ -175,12 +146,11 @@
|
||||
}
|
||||
|
||||
.navds-button--primary:focus {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-primary-border-focus),
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-primary-border-focus), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--primary:hover:disabled,
|
||||
.navds-button--primary:active:disabled {
|
||||
.navds-button--primary:hover:where(:disabled, .navds-button--disabled),
|
||||
.navds-button--primary:active:where(:disabled, .navds-button--disabled) {
|
||||
background-color: var(--navds-button-color-primary-background);
|
||||
}
|
||||
|
||||
@@ -200,8 +170,7 @@
|
||||
}
|
||||
|
||||
.navds-button--secondary:focus {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-button-color-secondary-border),
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: inset 0 0 0 2px var(--navds-button-color-secondary-border), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--secondary:active {
|
||||
@@ -211,13 +180,11 @@
|
||||
}
|
||||
|
||||
.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);
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-secondary-border-focus-active-hover), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--secondary:disabled,
|
||||
.navds-button--secondary:hover:disabled {
|
||||
.navds-button--secondary:where(:disabled, .navds-button--disabled),
|
||||
.navds-button--secondary:hover:where(:disabled, .navds-button--disabled) {
|
||||
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);
|
||||
@@ -236,8 +203,7 @@
|
||||
}
|
||||
|
||||
.navds-button--tertiary:focus {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-button-color-tertiary-border-focus),
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: inset 0 0 0 2px var(--navds-button-color-tertiary-border-focus), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--tertiary:active {
|
||||
@@ -251,13 +217,13 @@
|
||||
}
|
||||
|
||||
.navds-button--tertiary:active:focus {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-tertiary-border-active),
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-tertiary-border-active), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--tertiary:disabled,
|
||||
.navds-button--tertiary:active:disabled,
|
||||
.navds-button--tertiary:active:hover:disabled {
|
||||
.navds-button--tertiary:where(:disabled, .navds-button--disabled),
|
||||
.navds-button--tertiary:hover:where(:disabled, .navds-button--disabled),
|
||||
.navds-button--tertiary:active:where(:disabled, .navds-button--disabled),
|
||||
.navds-button--tertiary:active:hover:where(:disabled, .navds-button--disabled) {
|
||||
color: var(--navds-button-color-tertiary-text);
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
@@ -281,12 +247,11 @@
|
||||
}
|
||||
|
||||
.navds-button--danger:focus {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-danger-border-focus),
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: inset 0 0 0 1px var(--navds-button-color-danger-border-focus), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--danger:hover:disabled,
|
||||
.navds-button--danger:active:disabled {
|
||||
.navds-button--danger:active:where(:disabled, .navds-button--disabled),
|
||||
.navds-button--danger:hover:where(:disabled, .navds-button--disabled) {
|
||||
background-color: var(--navds-button-color-danger-background);
|
||||
}
|
||||
|
||||
@@ -294,11 +259,11 @@
|
||||
* .navds-button:disabled *
|
||||
**************************/
|
||||
|
||||
.navds-button:disabled {
|
||||
.navds-button:where(:disabled, .navds-button--disabled) {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.navds-button:disabled:not(.navds-button--loading) {
|
||||
.navds-button:not(.navds-button--loading):where(:disabled, .navds-button--disabled) {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
:root {
|
||||
--navds-card-micro-color-text: var(--navds-semantic-color-text);
|
||||
--navds-card-micro-color-background: var(--navds-global-color-orange-200);
|
||||
--navds-card-micro-color-border: transparent;
|
||||
--navds-card-micro-color-text-hover: var(--navds-semantic-color-link);
|
||||
--navds-card-micro-color-background-hover: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
--navds-card-micro-color-border-hover: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-card-micro-color-text-focus: var(--navds-semantic-color-link);
|
||||
--navds-card-micro-color-background-focus: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
--navds-card-micro-color-shadow-focus: var(--navds-semantic-color-focus);
|
||||
--navds-card-micro-color-background-active: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-card-micro-color-text-active: var(
|
||||
--navds-semantic-color-text-inverted
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
MicroCard
|
||||
*/
|
||||
|
||||
.navds-card__micro {
|
||||
border-radius: var(--navds-border-radius-full);
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
:root,
|
||||
:host {
|
||||
--navds-chat-color-background: var(--navds-semantic-color-canvas-background);
|
||||
--navds-chat-color-avatar: var(--navds-semantic-color-text);
|
||||
--navds-chat-color-avatar-background: var(--navds-semantic-color-canvas-background);
|
||||
}
|
||||
|
||||
.navds-chat {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: var(--navds-spacing-4);
|
||||
padding-right: var(--navds-spacing-16);
|
||||
}
|
||||
|
||||
.navds-chat--right {
|
||||
flex-direction: row-reverse;
|
||||
padding-right: 0;
|
||||
padding-left: var(--navds-spacing-16);
|
||||
}
|
||||
|
||||
.navds-chat__bubble-wrapper {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-chat--right .navds-chat__bubble-wrapper {
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.navds-chat__avatar {
|
||||
align-items: center;
|
||||
background: var(--navds-chat-color-avatar-background);
|
||||
color: var(--navds-chat-color-avatar);
|
||||
border-radius: var(--navds-border-radius-full);
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
height: 3rem;
|
||||
width: 3rem;
|
||||
}
|
||||
|
||||
.navds-chat__avatar svg {
|
||||
align-self: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.navds-chat__bubble {
|
||||
padding: 1rem;
|
||||
box-shadow: var(--navds-shadow-small);
|
||||
width: fit-content;
|
||||
max-width: 37.5rem;
|
||||
background-color: var(--navds-chat-color-background);
|
||||
border-radius: var(--navds-border-radius-xlarge);
|
||||
border-bottom-left-radius: 2px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-chat__bubble:focus {
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.navds-chat--right .navds-chat__bubble {
|
||||
border-radius: var(--navds-border-radius-xlarge);
|
||||
border-bottom-right-radius: 2px;
|
||||
}
|
||||
|
||||
.navds-chat__top-text {
|
||||
color: var(--navds-semantic-color-text);
|
||||
display: flex;
|
||||
gap: var(--navds-spacing-2);
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.navds-chat--right .navds-chat__top-text {
|
||||
align-self: flex-end;
|
||||
}
|
||||
|
||||
.navds-chat__name {
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
.navds-chips {
|
||||
display: flex;
|
||||
gap: var(--navds-spacing-2);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.navds-chips :where(li) {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.navds-chips__chip {
|
||||
all: unset;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.125rem;
|
||||
margin: 0;
|
||||
padding: 0 var(--navds-spacing-3);
|
||||
text-decoration: none;
|
||||
border-radius: var(--navds-border-radius-full);
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
.navds-chips--small .navds-chips__chip {
|
||||
min-height: 24px;
|
||||
padding: 0 var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-chips__toggle {
|
||||
box-shadow: inset 0 0 0 1px var(--ac-chip-toggle-border, var(--navds-global-color-gray-500));
|
||||
background-color: var(--ac-chip-toggle-bg, rgb(0 0 0 / 0.055));
|
||||
}
|
||||
|
||||
.navds-chips--small .navds-chips__toggle {
|
||||
gap: var(--navds-spacing-1);
|
||||
}
|
||||
|
||||
.navds-chips__toggle:hover {
|
||||
box-shadow: inset 0 0 0 1px var(--ac-chip-toggle-border-hover, var(--navds-global-color-gray-600));
|
||||
background-color: var(--ac-chip-toggle-bg-hover, rgb(0 0 0 / 0.1));
|
||||
}
|
||||
|
||||
.navds-chips__toggle[aria-pressed="true"] {
|
||||
box-shadow: none;
|
||||
background-color: var(--ac-chip-toggle-bg-pressed, var(--navds-global-color-deepblue-500));
|
||||
color: var(--ac-chip-toggle-text-pressed, var(--navds-global-color-white));
|
||||
}
|
||||
|
||||
.navds-chips__toggle[aria-pressed="true"]:hover {
|
||||
background-color: var(--ac-chip-toggle-bg-pressed-hover, var(--navds-global-color-deepblue-600));
|
||||
}
|
||||
|
||||
.navds-chips__toggle:focus-visible {
|
||||
box-shadow: 0 0 0 2px var(--navds-global-color-blue-800);
|
||||
}
|
||||
|
||||
.navds-chips__toggle[aria-pressed="true"]:focus-visible,
|
||||
.navds-chips__toggle:active:focus-visible {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-global-color-white), 0 0 0 2px var(--navds-global-color-blue-800);
|
||||
}
|
||||
|
||||
.navds-chips__removable--action {
|
||||
background-color: var(--ac-chip-removable-action-bg, var(--navds-global-color-deepblue-500));
|
||||
color: var(--ac-chip-removable-action-text, var(--navds-global-color-white));
|
||||
}
|
||||
|
||||
.navds-chips__removable--neutral {
|
||||
color: var(--ac-chip-removable-neutral-text, var(--navds-global-color-gray-900));
|
||||
background-color: var(--ac-chip-removable-neutral-bg, rgb(0 0 0/ 0.055));
|
||||
box-shadow: inset 0 0 0 1px var(--ac-chip-removable-neutral-border, var(--navds-global-color-gray-500));
|
||||
}
|
||||
|
||||
.navds-chips__removable-icon {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border-radius: var(--navds-border-radius-full);
|
||||
}
|
||||
|
||||
.navds-chips__toggle-icon {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border-radius: var(--navds-border-radius-full);
|
||||
}
|
||||
|
||||
.navds-chips--small .navds-chips__toggle-icon {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
.navds-chips--small .navds-chips__removable-icon {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
}
|
||||
|
||||
.navds-chips--small .navds-chips__removable-icon > svg {
|
||||
width: 0.75rem;
|
||||
}
|
||||
|
||||
.navds-chips__removable--action:focus-visible {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-global-color-white), 0 0 0 2px var(--navds-global-color-blue-800);
|
||||
}
|
||||
|
||||
.navds-chips__removable--neutral:focus-visible {
|
||||
box-shadow: 0 0 0 2px var(--navds-global-color-blue-800);
|
||||
}
|
||||
|
||||
.navds-chips__removable--action:hover {
|
||||
background-color: var(--ac-chip-removable-action-bg-hover, var(--navds-global-color-deepblue-700));
|
||||
}
|
||||
|
||||
.navds-chips__removable--neutral:hover {
|
||||
background-color: var(--ac-chip-removable-action-bg-hover, rgb(0 0 0 / 0.1));
|
||||
box-shadow: inset 0 0 0 1px var(--ac-chip-removable-neutral-border-hover, var(--navds-global-color-gray-600));
|
||||
}
|
||||
|
||||
.navds-chips--icon-left {
|
||||
padding-left: 0.375rem;
|
||||
}
|
||||
|
||||
.navds-chips--icon-right {
|
||||
padding-right: var(--navds-spacing-1);
|
||||
}
|
||||
|
||||
.navds-chips--small .navds-chips--icon-right {
|
||||
padding-right: 0.125rem;
|
||||
}
|
||||
|
||||
.navds-chips--small .navds-chips--icon-left {
|
||||
padding-left: 0.375rem;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
:root {
|
||||
:root,
|
||||
:host {
|
||||
--navds-content-container-max-width: 79.5rem;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
.navds-date {
|
||||
padding: var(--navds-spacing-3);
|
||||
}
|
||||
|
||||
.navds-date .rdp-day_range_middle.rdp-day_disabled {
|
||||
color: var(--navds-global-color-white);
|
||||
background: var(--navds-global-color-deepblue-500);
|
||||
}
|
||||
|
||||
.navds-date .rdp-month,
|
||||
.navds-date.rdp-month {
|
||||
display: grid;
|
||||
gap: var(--navds-spacing-5);
|
||||
}
|
||||
|
||||
.navds-date__caption-label {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.navds-date .rdp-head_cell {
|
||||
text-transform: capitalize;
|
||||
font-size: var(--navds-font-size-small);
|
||||
}
|
||||
|
||||
.navds-date .rdp-weeknumber {
|
||||
color: var(--navds-global-color-white);
|
||||
background: var(--navds-global-color-gray-800);
|
||||
font-size: var(--navds-font-size-small);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 0.125rem var(--navds-spacing-1);
|
||||
border-radius: var(--navds-border-radius-small);
|
||||
}
|
||||
|
||||
.navds-date__caption-dropdown {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: var(--navds-spacing-2);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navds-date__caption__month-wrapper {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: var(--navds-spacing-2);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navds-date__caption__month .navds-select__container select {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.navds-date .rdp-button {
|
||||
all: unset;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
text-align: center;
|
||||
border-radius: var(--navds-border-radius-medium);
|
||||
}
|
||||
|
||||
.navds-date .rdp-day_range_start {
|
||||
border-radius: 12px 2px 2px 12px;
|
||||
border-radius: var(--navds-border-radius-xlarge) var(--navds-border-radius-small) var(--navds-border-radius-small)
|
||||
var(--navds-border-radius-xlarge);
|
||||
}
|
||||
|
||||
.navds-date .rdp-day_range_end:not(.rdp-day_range_start) {
|
||||
border-radius: var(--navds-border-radius-small) var(--navds-border-radius-xlarge) var(--navds-border-radius-xlarge)
|
||||
var(--navds-border-radius-small);
|
||||
}
|
||||
|
||||
.navds-date .rdp-day_range_start.rdp-day_range_end {
|
||||
border-radius: var(--navds-border-radius-xlarge);
|
||||
}
|
||||
|
||||
.navds-date .rdp-button:not(.rdp-day_selected):not([disabled]):focus,
|
||||
.navds-date .navds-date__month-button:not(.rdp-day_selected):not([disabled]):focus {
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-date .rdp-button.rdp-day_selected:not([disabled]):focus,
|
||||
.navds-date .navds-date__month-button.rdp-day_selected:not([disabled]):focus {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-global-color-white), 0 0 0 3px var(--navds-global-color-blue-800);
|
||||
}
|
||||
|
||||
/* Monthpicker */
|
||||
.navds-date__month-button {
|
||||
all: unset;
|
||||
text-align: center;
|
||||
width: 3rem;
|
||||
height: 2.75rem;
|
||||
text-transform: capitalize;
|
||||
border-radius: var(--navds-border-radius-medium);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.navds-date__month-button:focus,
|
||||
.navds-monthpicker__caption-button:focus {
|
||||
box-shadow: var(--navds-shadow-focus);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.navds-date__year-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navds-date__wrapper,
|
||||
.navds-date__standalone-wrapper {
|
||||
height: fit-content;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.navds-date .navds-date__field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.navds-date__field-wrapper {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
/* Focus layering */
|
||||
.navds-date__field-input:focus,
|
||||
.navds-date__field-button {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.navds-date .rdp-day_selected,
|
||||
.navds-monthpicker__month--selected {
|
||||
color: var(--navds-global-color-white);
|
||||
background: var(--navds-global-color-deepblue-500);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.navds-date .rdp-day_disabled {
|
||||
cursor: not-allowed;
|
||||
text-decoration: line-through;
|
||||
background-color: var(--navds-global-color-gray-100);
|
||||
color: var(--navds-global-color-gray-600);
|
||||
}
|
||||
|
||||
.navds-date .rdp-button:where(:not(.rdp-day_selected):not([disabled])):hover,
|
||||
.navds-date__month-button:where(:not(.rdp-day_selected):not([disabled])):hover {
|
||||
background: var(--navds-global-color-blue-50);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.navds-date .rdp-day_today {
|
||||
box-shadow: 0 0 0 1px var(--navds-global-color-deepblue-500);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.navds-date__caption {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: var(--navds-spacing-2);
|
||||
}
|
||||
|
||||
.navds-date__caption-button {
|
||||
color: var(--navds-global-color-gray-900);
|
||||
}
|
||||
|
||||
.navds-date__field-input {
|
||||
padding-right: var(--navds-spacing-12);
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-date__field-input {
|
||||
padding-right: var(--navds-spacing-8);
|
||||
}
|
||||
|
||||
/* Error-handling */
|
||||
.navds-date__field--error .navds-date__field-input:not(:hover):not(:disabled) {
|
||||
border-color: var(--navds-search-color-border-error);
|
||||
box-shadow: inset 0 0 0 1px var(--navds-search-color-border-error);
|
||||
}
|
||||
|
||||
.navds-date__field--error .navds-date__field-input:focus:not(:hover):not(:disabled) {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-search-color-border-error), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-date__field-button {
|
||||
position: absolute;
|
||||
right: var(--navds-spacing-2);
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: var(--navds-global-color-gray-900);
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-date__field-button {
|
||||
right: var(--navds-spacing-2);
|
||||
height: 1.5rem;
|
||||
width: 1.5rem;
|
||||
}
|
||||
|
||||
.navds-form-field--small .navds-date__field-button svg {
|
||||
font-size: var(--navds-font-size-medium);
|
||||
}
|
||||
|
||||
.navds-form-field--disabled .navds-date__field-button {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.navds-date__caption__year {
|
||||
width: 5rem;
|
||||
}
|
||||
|
||||
.navds-date .rdp-day_outside {
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -1,22 +1,11 @@
|
||||
:root {
|
||||
--navds-confirmation-panel-color-background: var(
|
||||
--navds-global-color-orange-50
|
||||
);
|
||||
--navds-confirmation-panel-color-background-checked: var(
|
||||
--navds-global-color-green-50
|
||||
);
|
||||
--navds-confirmation-panel-color-background-error: var(
|
||||
--navds-global-color-red-50
|
||||
);
|
||||
--navds-confirmation-panel-color-border: var(
|
||||
--navds-semantic-color-feedback-warning-border
|
||||
);
|
||||
--navds-confirmation-panel-color-border-checked: var(
|
||||
--navds-semantic-color-feedback-success-border
|
||||
);
|
||||
--navds-confirmation-panel-color-border-error: var(
|
||||
--navds-semantic-color-feedback-danger-border
|
||||
);
|
||||
:root,
|
||||
:host {
|
||||
--navds-confirmation-panel-color-background: var(--navds-global-color-orange-50);
|
||||
--navds-confirmation-panel-color-background-checked: var(--navds-global-color-green-50);
|
||||
--navds-confirmation-panel-color-background-error: var(--navds-global-color-red-50);
|
||||
--navds-confirmation-panel-color-border: var(--navds-semantic-color-feedback-warning-border);
|
||||
--navds-confirmation-panel-color-border-checked: var(--navds-semantic-color-feedback-success-border);
|
||||
--navds-confirmation-panel-color-border-error: var(--navds-semantic-color-feedback-danger-border);
|
||||
}
|
||||
|
||||
.navds-confirmation-panel__inner {
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
:root {
|
||||
--navds-error-summary-color-background: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
--navds-error-summary-color-border: var(
|
||||
--navds-semantic-color-feedback-danger-border
|
||||
);
|
||||
:root,
|
||||
:host {
|
||||
--navds-error-summary-color-background: var(--navds-semantic-color-component-background-light);
|
||||
--navds-error-summary-color-border: var(--navds-semantic-color-feedback-danger-border);
|
||||
}
|
||||
|
||||
.navds-error-summary {
|
||||
|
||||
@@ -1,30 +1,14 @@
|
||||
:root {
|
||||
--navds-radio-checkbox-color-background: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
:root,
|
||||
:host {
|
||||
--navds-radio-checkbox-color-background: var(--navds-semantic-color-component-background-light);
|
||||
--navds-radio-checkbox-color-text: var(--navds-semantic-color-text);
|
||||
--navds-radio-checkbox-color-description: var(
|
||||
--navds-semantic-color-text-muted
|
||||
);
|
||||
--navds-radio-checkbox-color-background-hover: var(
|
||||
--navds-semantic-color-interaction-primary-hover-subtle
|
||||
);
|
||||
--navds-radio-checkbox-color-background-checked: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-radio-checkbox-color-background-hover: var(--navds-semantic-color-interaction-primary-hover-subtle);
|
||||
--navds-radio-checkbox-color-background-checked: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-radio-checkbox-color-shadow: var(--navds-semantic-color-border);
|
||||
--navds-radio-checkbox-color-shadow-hover: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-radio-checkbox-color-shadow-checked: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-radio-checkbox-color-shadow-error: var(
|
||||
--navds-semantic-color-interaction-danger
|
||||
);
|
||||
--navds-radio-checkbox-color-label-hover: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-radio-checkbox-color-shadow-hover: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-radio-checkbox-color-shadow-checked: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-radio-checkbox-color-shadow-error: var(--navds-semantic-color-interaction-danger);
|
||||
--navds-radio-checkbox-color-label-hover: var(--navds-semantic-color-interaction-primary);
|
||||
}
|
||||
|
||||
.navds-checkbox,
|
||||
@@ -75,11 +59,6 @@
|
||||
gap: var(--navds-spacing-1);
|
||||
}
|
||||
|
||||
.navds-checkbox__description,
|
||||
.navds-radio__description {
|
||||
color: var(--navds-radio-checkbox-color-description);
|
||||
}
|
||||
|
||||
.navds-checkbox--small > .navds-checkbox__input,
|
||||
.navds-radio--small > .navds-radio__input {
|
||||
width: 32px;
|
||||
@@ -101,14 +80,12 @@
|
||||
|
||||
.navds-checkbox__input:focus + .navds-checkbox__label::before,
|
||||
.navds-radio__input:focus + .navds-radio__label::before {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow),
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-checkbox__input:hover:focus + .navds-checkbox__label::before,
|
||||
.navds-radio__input:hover:focus + .navds-radio__label::before {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow-hover),
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow-hover), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-checkbox__input:indeterminate + .navds-checkbox__label::before {
|
||||
@@ -128,9 +105,7 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.navds-checkbox--small
|
||||
.navds-checkbox__input:indeterminate
|
||||
+ .navds-checkbox__label::after {
|
||||
.navds-checkbox--small .navds-checkbox__input:indeterminate + .navds-checkbox__label::after {
|
||||
transform: translate(0.25rem, -50%);
|
||||
}
|
||||
|
||||
@@ -143,9 +118,7 @@
|
||||
background-color: var(--navds-radio-checkbox-color-background-checked);
|
||||
}
|
||||
|
||||
.navds-checkbox--small
|
||||
> .navds-checkbox__input:checked
|
||||
+ .navds-checkbox__label::before {
|
||||
.navds-checkbox--small > .navds-checkbox__input:checked + .navds-checkbox__label::before {
|
||||
background-position: 4px center;
|
||||
}
|
||||
|
||||
@@ -155,14 +128,12 @@
|
||||
}
|
||||
|
||||
.navds-radio__input:checked + .navds-radio__label::before {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow-checked),
|
||||
inset 0 0 0 4px #fff;
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow-checked), inset 0 0 0 4px #fff;
|
||||
background-color: var(--navds-radio-checkbox-color-background-checked);
|
||||
}
|
||||
|
||||
.navds-radio__input:checked:focus + .navds-radio__label::before {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow-checked),
|
||||
inset 0 0 0 4px #fff, var(--navds-shadow-focus);
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow-checked), inset 0 0 0 4px #fff, var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-checkbox__input:hover:not(:disabled) + .navds-checkbox__label,
|
||||
@@ -170,17 +141,13 @@
|
||||
color: var(--navds-radio-checkbox-color-label-hover);
|
||||
}
|
||||
|
||||
.navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate):not(:focus)
|
||||
+ .navds-checkbox__label::before,
|
||||
.navds-radio__input:hover:not(:disabled):not(:checked):not(:focus)
|
||||
+ .navds-radio__label::before {
|
||||
.navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate):not(:focus) + .navds-checkbox__label::before,
|
||||
.navds-radio__input:hover:not(:disabled):not(:checked):not(:focus) + .navds-radio__label::before {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow-hover);
|
||||
}
|
||||
|
||||
.navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate)
|
||||
+ .navds-checkbox__label::before,
|
||||
.navds-radio__input:hover:not(:disabled):not(:checked)
|
||||
+ .navds-radio__label::before {
|
||||
.navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate) + .navds-checkbox__label::before,
|
||||
.navds-radio__input:hover:not(:disabled):not(:checked) + .navds-radio__label::before {
|
||||
background-color: var(--navds-radio-checkbox-color-background-hover);
|
||||
}
|
||||
|
||||
@@ -199,8 +166,7 @@
|
||||
.navds-radio--error
|
||||
> .navds-radio__input:focus:not(:hover):not(:disabled):not(:checked):not(:indeterminate)
|
||||
+ .navds-radio__label::before {
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow-error),
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: inset 0 0 0 2px var(--navds-radio-checkbox-color-shadow-error), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-checkbox--disabled,
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
:root,
|
||||
:host,
|
||||
[data-theme="light"] {
|
||||
--navds-search-color-text: var(--navds-semantic-color-text);
|
||||
--navds-search-color-border: var(--navds-semantic-color-border);
|
||||
--navds-search-color-border-hover: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-search-color-border-hover: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-search-color-clear-hover: var(--navds-global-color-blue-500);
|
||||
--navds-search-color-border-error: var(--navds-global-color-red-500);
|
||||
}
|
||||
@@ -120,32 +119,26 @@
|
||||
}
|
||||
|
||||
.navds-search__button-search.navds-button--secondary {
|
||||
box-shadow: -1px 0 0 0 var(--navds-search-color-border) inset,
|
||||
0 1px 0 0 var(--navds-search-color-border) inset,
|
||||
box-shadow: -1px 0 0 0 var(--navds-search-color-border) inset, 0 1px 0 0 var(--navds-search-color-border) inset,
|
||||
0 -1px 0 0 var(--navds-search-color-border) inset;
|
||||
}
|
||||
|
||||
.navds-search__button-search.navds-button--secondary:hover {
|
||||
box-shadow: -1px 0 0 0 var(--navds-search-color-border-hover) inset,
|
||||
0 1px 0 0 var(--navds-search-color-border-hover) inset,
|
||||
0 -1px 0 0 var(--navds-search-color-border-hover) inset,
|
||||
-1px 0 0 0 var(--navds-search-color-border-hover);
|
||||
box-shadow: -1px 0 0 0 var(--navds-search-color-border-hover) inset, 0 1px 0 0 var(--navds-search-color-border-hover) inset,
|
||||
0 -1px 0 0 var(--navds-search-color-border-hover) inset, -1px 0 0 0 var(--navds-search-color-border-hover);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.navds-search__wrapper-inner:focus-within
|
||||
+ .navds-search__button-search.navds-button--secondary:hover {
|
||||
.navds-search__wrapper-inner:focus-within + .navds-search__button-search.navds-button--secondary:hover {
|
||||
z-index: auto;
|
||||
}
|
||||
|
||||
.navds-search__button-search.navds-button--secondary:focus {
|
||||
box-shadow: 0 0 0 1px var(--navds-search-color-border) inset,
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: 0 0 0 1px var(--navds-search-color-border) inset, var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-search__button-search.navds-button--secondary:focus:hover {
|
||||
box-shadow: 0 0 0 1px var(--navds-search-color-border-hover) inset,
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: 0 0 0 1px var(--navds-search-color-border-hover) inset, var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-search__button-search.navds-button--secondary:focus:active {
|
||||
@@ -159,8 +152,7 @@
|
||||
}
|
||||
|
||||
.navds-search--error .navds-search__input:focus:not(:hover):not(:disabled) {
|
||||
box-shadow: inset 0 0 0 1px var(--navds-search-color-border-error),
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: inset 0 0 0 1px var(--navds-search-color-border-error), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
/* Focus layering */
|
||||
|
||||
@@ -1,22 +1,12 @@
|
||||
:root {
|
||||
--navds-select-color-background: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
:root,
|
||||
:host {
|
||||
--navds-select-color-background: var(--navds-semantic-color-component-background-light);
|
||||
--navds-select-color-border: var(--navds-semantic-color-border);
|
||||
--navds-select-color-border-hover: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-select-color-border-error: var(
|
||||
--navds-semantic-color-interaction-danger
|
||||
);
|
||||
--navds-select-color-shadow-error: var(
|
||||
--navds-semantic-color-interaction-danger
|
||||
);
|
||||
--navds-select-color-border-hover: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-select-color-border-error: var(--navds-semantic-color-interaction-danger);
|
||||
--navds-select-color-shadow-error: var(--navds-semantic-color-interaction-danger);
|
||||
--navds-select-color-border-disabled: var(--navds-global-color-gray-400);
|
||||
--navds-select-color-background-disabled: var(
|
||||
--navds-semantic-color-component-background-alternate
|
||||
);
|
||||
--navds-select-color-text-disabled: var(--navds-semantic-color-text);
|
||||
--navds-select-color-background-disabled: var(--navds-semantic-color-component-background-alternate);
|
||||
}
|
||||
|
||||
.navds-select__input {
|
||||
@@ -30,7 +20,7 @@
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
padding: 0.5rem;
|
||||
padding-right: 2.5rem;
|
||||
padding-right: 2rem;
|
||||
}
|
||||
|
||||
.navds-select__input:hover {
|
||||
@@ -47,6 +37,7 @@
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
color: var(--navds-semantic-color-text);
|
||||
}
|
||||
|
||||
.navds-select__chevron {
|
||||
|
||||
@@ -1,31 +1,16 @@
|
||||
:root {
|
||||
:root,
|
||||
:host {
|
||||
--navds-switch-color-label: var(--navds-semantic-color-text);
|
||||
--navds-switch-color-label-hover: var(
|
||||
--navds-semantic-color-interaction-primary
|
||||
);
|
||||
--navds-switch-color-label-hover: var(--navds-semantic-color-interaction-primary);
|
||||
--navds-switch-color-track-background: var(--navds-semantic-color-text-muted);
|
||||
--navds-switch-color-track-background-checked: var(
|
||||
--navds-semantic-color-feedback-success-border
|
||||
);
|
||||
--navds-switch-color-track-background-hover: var(
|
||||
--navds-global-color-gray-800
|
||||
);
|
||||
--navds-switch-color-track-background-hover-checked: var(
|
||||
--navds-semantic-color-feedback-success-icon
|
||||
);
|
||||
--navds-switch-color-track-shadow-inner-focus: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
--navds-switch-color-thumb: var(
|
||||
--navds-semantic-color-component-background-light
|
||||
);
|
||||
--navds-switch-color-track-background-checked: var(--navds-semantic-color-feedback-success-border);
|
||||
--navds-switch-color-track-background-hover: var(--navds-global-color-gray-800);
|
||||
--navds-switch-color-track-background-hover-checked: var(--navds-semantic-color-feedback-success-icon);
|
||||
--navds-switch-color-track-shadow-inner-focus: var(--navds-semantic-color-component-background-light);
|
||||
--navds-switch-color-thumb: var(--navds-semantic-color-component-background-light);
|
||||
--navds-switch-color-thumb-icon: var(--navds-semantic-color-text-muted);
|
||||
--navds-switch-color-thumb-icon-checked: var(
|
||||
--navds-semantic-color-feedback-success-border
|
||||
);
|
||||
--navds-switch-color-thumb-loader-checked: var(
|
||||
--navds-semantic-color-feedback-success-border
|
||||
);
|
||||
--navds-switch-color-thumb-icon-checked: var(--navds-semantic-color-feedback-success-border);
|
||||
--navds-switch-color-thumb-loader-checked: var(--navds-semantic-color-feedback-success-border);
|
||||
}
|
||||
|
||||
.navds-switch {
|
||||
@@ -72,30 +57,20 @@
|
||||
padding: 0.75rem 0 0.75rem 3.25rem;
|
||||
}
|
||||
|
||||
.navds-switch__description {
|
||||
color: var(--navds-semantic-color-text-muted);
|
||||
}
|
||||
|
||||
.navds-switch--right > .navds-switch__label-wrapper > .navds-switch__content {
|
||||
padding: 0.75rem 3.25rem 0.75rem 0;
|
||||
}
|
||||
|
||||
.navds-switch--small > .navds-switch__label-wrapper > .navds-switch__content {
|
||||
padding: calc(var(--navds-spacing-2) - 2px) 0
|
||||
calc(var(--navds-spacing-2) - 2px) 3.25rem;
|
||||
padding: calc(var(--navds-spacing-2) - 2px) 0 calc(var(--navds-spacing-2) - 2px) 3.25rem;
|
||||
}
|
||||
|
||||
.navds-switch--right.navds-switch--small
|
||||
> .navds-switch__label-wrapper
|
||||
> .navds-switch__content {
|
||||
padding: calc(var(--navds-spacing-2) - 2px) 3.25rem
|
||||
calc(var(--navds-spacing-2) - 2px) 0;
|
||||
.navds-switch--right.navds-switch--small > .navds-switch__label-wrapper > .navds-switch__content {
|
||||
padding: calc(var(--navds-spacing-2) - 2px) 3.25rem calc(var(--navds-spacing-2) - 2px) 0;
|
||||
}
|
||||
|
||||
.navds-switch--with-description,
|
||||
.navds-switch--small
|
||||
> .navds-switch__label-wrapper
|
||||
> .navds-switch--with-description {
|
||||
.navds-switch--small > .navds-switch__label-wrapper > .navds-switch--with-description {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
@@ -151,8 +126,7 @@
|
||||
}
|
||||
|
||||
.navds-switch__input:focus ~ .navds-switch__track {
|
||||
box-shadow: 0 0 0 1px var(--navds-switch-color-track-shadow-inner-focus),
|
||||
var(--navds-shadow-focus);
|
||||
box-shadow: 0 0 0 1px var(--navds-switch-color-track-shadow-inner-focus), var(--navds-shadow-focus);
|
||||
}
|
||||
|
||||
/* Thumb */
|
||||
@@ -182,30 +156,21 @@
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
.navds-switch__input:checked:hover
|
||||
~ .navds-switch__track
|
||||
> .navds-switch__thumb {
|
||||
.navds-switch__input:checked:hover ~ .navds-switch__track > .navds-switch__thumb {
|
||||
transform: translateX(18px);
|
||||
}
|
||||
}
|
||||
|
||||
.navds-switch__input:disabled:hover
|
||||
~ .navds-switch__track
|
||||
> .navds-switch__thumb {
|
||||
.navds-switch__input:disabled:hover ~ .navds-switch__track > .navds-switch__thumb {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.navds-switch__input:checked:disabled:hover
|
||||
~ .navds-switch__track
|
||||
> .navds-switch__thumb {
|
||||
.navds-switch__input:checked:disabled:hover ~ .navds-switch__track > .navds-switch__thumb {
|
||||
transform: translateX(20px);
|
||||
}
|
||||
|
||||
/* Loader */
|
||||
.navds-switch__input:checked
|
||||
~ .navds-switch__track
|
||||
> .navds-switch__thumb
|
||||
.navds-loader__foreground {
|
||||
.navds-switch__input:checked ~ .navds-switch__track > .navds-switch__thumb .navds-loader__foreground {
|
||||
stroke: var(--navds-switch-color-thumb-loader-checked);
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 1425 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user