Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51bbeb00b0 |
No files matched your search
@@ -30,8 +30,10 @@ Alle base-pakkene våre har `fixed versjonering`. Dette tilsier at en bump på e
|
||||
```sh
|
||||
"@navikt/ds-react",
|
||||
"@navikt/ds-css",
|
||||
"@navikt/aksel-icons",
|
||||
"@navikt/ds-icons",
|
||||
"@navikt/ds-tokens",
|
||||
"@navikt/ds-tailwind",
|
||||
"@navikt/ds-css-internal",
|
||||
"@navikt/ds-react-internal",
|
||||
"@navikt/ds-codemod"
|
||||
```
|
||||
@@ -1,26 +1,27 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
|
||||
"changelog": [
|
||||
"@svitejs/changesets-changelog-github-compact",
|
||||
{ "repo": "navikt/aksel" }
|
||||
"@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/aksel-icons",
|
||||
"@navikt/aksel",
|
||||
"@navikt/aksel-stylelint"
|
||||
"@navikt/ds-css-internal",
|
||||
"@navikt/ds-react-internal",
|
||||
"@navikt/ds-codemod"
|
||||
]
|
||||
],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "main",
|
||||
"baseBranch": "master",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": ["aksel.nav.no", "aksel-icons-figma-plugin"],
|
||||
"ignore": ["shadow-dom", "aksel.nav.no", "@navikt/ds-navno"],
|
||||
|
||||
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
|
||||
"updateInternalDependents": "always"
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
// TODO: Convert to new format: https://eslint.org/docs/latest/use/configure/migration-guide
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
es6: true,
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended",
|
||||
//"plugin:react/jsx-runtime", // Not sure if this will cause problems for projects not using the new JSX transform
|
||||
"plugin:react-hooks/recommended",
|
||||
"plugin:jsx-a11y/recommended",
|
||||
"plugin:import/recommended",
|
||||
"plugin:import/typescript",
|
||||
"plugin:storybook/recommended",
|
||||
// TODO: Look into opinionated stylistic plugin
|
||||
// TODO: Replace @typescript-eslint/recommended with @typescript-eslint/recommended-type-checked
|
||||
],
|
||||
settings: { react: { version: "detect" } },
|
||||
rules: {
|
||||
"import/no-unresolved": "off",
|
||||
"react/jsx-curly-brace-presence": [
|
||||
"error",
|
||||
{ propElementValues: "always" },
|
||||
],
|
||||
"array-callback-return": "error",
|
||||
"object-shorthand": "error",
|
||||
// TODO: Consider adding the rule "id-length"
|
||||
// Temporary:
|
||||
"react/prop-types": "off",
|
||||
"react/display-name": "off",
|
||||
"import/no-named-as-default": "off",
|
||||
// "import/no-cycle": [1],
|
||||
},
|
||||
reportUnusedDisableDirectives: true,
|
||||
overrides: [
|
||||
{
|
||||
files: ["**/*.ts?(x)"],
|
||||
extends: ["plugin:@typescript-eslint/recommended"],
|
||||
rules: {
|
||||
"@typescript-eslint/no-shadow": ["error", { hoist: "all" }], // TODO: Consider { builtinGlobals: true }
|
||||
"@typescript-eslint/no-explicit-any": "off", // Temporary
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["**/*.test.*", "**/__tests__/*"],
|
||||
extends: ["plugin:jest/recommended", "plugin:testing-library/react"],
|
||||
},
|
||||
{
|
||||
files: ["aksel.nav.no/website/**"],
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true,
|
||||
},
|
||||
extends: ["plugin:@next/next/recommended"],
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
ecmaVersion: 12,
|
||||
sourceType: "module",
|
||||
},
|
||||
rules: {
|
||||
"react/no-unknown-property": [2, { ignore: ["jsx", "global"] }],
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"@next/next/no-html-link-for-pages": [
|
||||
"error",
|
||||
"aksel.nav.no/website/pages/",
|
||||
],
|
||||
"@typescript-eslint/ban-ts-comment": "off", // Temporary
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["aksel.nav.no/website/pages/eksempler/**"],
|
||||
rules: {
|
||||
"jsx-a11y/anchor-is-valid": "off",
|
||||
},
|
||||
},
|
||||
],
|
||||
globals: {
|
||||
Locale: "readonly",
|
||||
JSX: "readonly",
|
||||
},
|
||||
ignorePatterns: [
|
||||
"node_modules",
|
||||
"lib",
|
||||
"public",
|
||||
"examples",
|
||||
"esm",
|
||||
"cjs",
|
||||
"dist",
|
||||
"**/codemod/**/*.js",
|
||||
"!.storybook",
|
||||
],
|
||||
};
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Eksempel på bruk
|
||||
description: Send et eksempel på ting fra Aksel som er brukt i det fri (tokens, komponenter, maler, etc)
|
||||
title: "[Eksempel på bruk]: "
|
||||
labels: ["dokumentasjon 📖"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Takk for at du bidrar til Aksel!
|
||||
- type: input
|
||||
id: title
|
||||
attributes:
|
||||
label: Lenke til side
|
||||
description: Lenke til siden hvor eksemplet er
|
||||
placeholder:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: examples
|
||||
attributes:
|
||||
label: Forklaring
|
||||
description: Forklar om det er noe man må gjøre for å se eksemplet, eller hvor på siden det ligger
|
||||
@@ -3,7 +3,7 @@ description: Send et ønske om en eller flere nye komponenter
|
||||
title: "[Ny komponent]: "
|
||||
labels: ["nytt ✨", "forespørsel 🥰", "komponenter 🧩"]
|
||||
assignees:
|
||||
- KenAJoh
|
||||
- olejorgenbakken
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
||||
@@ -3,7 +3,7 @@ description: Send et ønske om et eller flere nye ikoner
|
||||
title: "[Nytt ikon]: "
|
||||
labels: ["nytt ✨", "ikoner 🖼", "forespørsel 🥰"]
|
||||
assignees:
|
||||
- KenAJoh
|
||||
- olejorgenbakken
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
||||
@@ -3,7 +3,7 @@ description: Send inn innspill til komponent
|
||||
title: "[Innspill til komponent]: "
|
||||
labels: ["forespørsel 🥰", "komponenter 🧩", "nytt ✨", "beta 🧪"]
|
||||
assignees:
|
||||
- KenAJoh
|
||||
- olejorgenbakken
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
name: Innspill til ikon
|
||||
description: Send inn innspill til ikon
|
||||
title: "[Tilbakemelding på ikon]: "
|
||||
labels: ["forespørsel 🥰", "ikoner 🖼️"]
|
||||
title: "[Innspill til ikon]: "
|
||||
labels: ["forespørsel 🥰", "nytt ✨"]
|
||||
assignees:
|
||||
- KenAJoh
|
||||
- olejorgenbakken
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
### Description
|
||||
|
||||
<!-- PR description/motivation
|
||||
add links to project-tasks, slack discussions etc here
|
||||
-->
|
||||
|
||||
### Change summary
|
||||
|
||||
<!-- Short summary of changes in PR
|
||||
- added variant x
|
||||
- fixed bug in y
|
||||
-->
|
||||
|
||||
### PR Checklist 📝 (Remove fields after check!)
|
||||
|
||||
#### New component? ✨
|
||||
|
||||
- Check that component-styling is correctly configured in `@navikt/core/css/config/_mappings.js`. This is needed for correct build and CDN upload.
|
||||
- Check that styling is correctly exported from `@navikt/core/css/index.css`
|
||||
- Check that correct tokens for component is documented in `@navikt/core/css/tokens.json`
|
||||
- Check that only needed components and types are exported from `@navikt/core/react/src/index.ts`
|
||||
- Add JSDoc to component (see other components for reference)
|
||||
- Create storybook-stories for relevant component variations and compositions. Stories are used for [visual regression testing](https://www.chromatic.com/docs/), so make sure they are complete.
|
||||
- Is the component sufficiently complex to warrant tests? Add some unit-tests for jest.
|
||||
|
||||
#### Component-updates 🎉
|
||||
|
||||
- Revalidate if everything under `New component` is still accounted for
|
||||
- Deprecating/removing a CSS class? Add it to `@navikt/aksel-stylelint/src/deprecations.ts` with a suitable description. This helps stylelint-users keep their code clean and bug-free.
|
||||
|
||||
#### Documentation 📝
|
||||
|
||||
- Add/update component-demos for component `aksel.nav.no/website/pages/eksempler`
|
||||
- Create/Update documentation in sanity if needed
|
||||
Note: Props, tokens and examples only updates to sanity on merge to main
|
||||
|
||||
#### Versioning 🏷️
|
||||
|
||||
- Run `yarn changeset` to generate a version-entry for change.
|
||||
- - Bug/hotfix: Patch
|
||||
- - New feature: Minor
|
||||
- - Breaking change: Major
|
||||
- Adding breaking changes? Consider adding a codemod for easier migration.
|
||||
- Breaking changes also needs documentation under "Migration"-page on website
|
||||
@@ -5,29 +5,52 @@ on:
|
||||
branches:
|
||||
- next
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/designsystemet
|
||||
|
||||
jobs:
|
||||
snyk-monitor:
|
||||
name: monitor dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
continue-on-error: true
|
||||
uses: snyk/actions/node@master
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
with:
|
||||
command: monitor
|
||||
args: --org=designsystemet --severity-threshold=high
|
||||
snyk-test:
|
||||
name: analyze dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
uses: snyk/actions/node@master
|
||||
continue-on-error: true
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
with:
|
||||
command: test
|
||||
args: --org=designsystemet --severity-threshold=high
|
||||
build_and_deploy:
|
||||
name: Build and deploy to dev-gcp
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
packages: "write"
|
||||
contents: "read"
|
||||
id-token: "write"
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "20"
|
||||
- uses: actions/checkout@v3
|
||||
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 "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
|
||||
echo "USE_CDN_ASSETS=true" >> aksel.nav.no/website/.env
|
||||
|
||||
- name: Hide page from search engines
|
||||
run: |
|
||||
echo "User-agent: *\nDisallow: /" > aksel.nav.no/website/public/robots.txt
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
@@ -45,24 +68,21 @@ jobs:
|
||||
yarn boot
|
||||
yarn workspace aksel.nav.no build:next
|
||||
|
||||
- name: Upload static files to NAV CDN
|
||||
uses: navikt/frontend/actions/cdn-upload/v1@main
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # Use commit-sha1 instead of tag for security concerns
|
||||
with:
|
||||
cdn-team-name: aksel
|
||||
source: ./aksel.nav.no/website/.next/static
|
||||
destination: "/website/_next"
|
||||
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get complete tag
|
||||
run: echo "TAG=DEV-$( date +%s )" >> $GITHUB_ENV
|
||||
|
||||
- uses: nais/docker-build-push@v0
|
||||
id: docker-push
|
||||
with:
|
||||
team: designsystem
|
||||
push_image: true
|
||||
dockerfile: aksel.nav.no/Dockerfile
|
||||
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
|
||||
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
|
||||
- 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
|
||||
@@ -70,4 +90,4 @@ jobs:
|
||||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
|
||||
RESOURCE: aksel.nav.no/nais-dev.yaml
|
||||
CLUSTER: dev-gcp
|
||||
IMAGE: ${{ steps.docker-push.outputs.image }}
|
||||
IMAGE: ${{ env.DOCKER_TAG }}
|
||||
@@ -2,22 +2,50 @@ name: Deploy aksel.nav.no
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/aksel
|
||||
IMAGE: ghcr.io/navikt/designsystemet
|
||||
|
||||
jobs:
|
||||
snyk-monitor:
|
||||
name: monitor dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
continue-on-error: true
|
||||
uses: snyk/actions/node@master
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
with:
|
||||
command: monitor
|
||||
args: --org=designsystemet --severity-threshold=high
|
||||
snyk-test:
|
||||
name: analyze dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
uses: snyk/actions/node@master
|
||||
continue-on-error: true
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
with:
|
||||
command: test
|
||||
args: --org=designsystemet --severity-threshold=high
|
||||
sync_data_with_sanity:
|
||||
name: Update component data
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "20"
|
||||
- uses: actions/checkout@v3
|
||||
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
|
||||
@@ -44,21 +72,17 @@ jobs:
|
||||
build_and_deploy:
|
||||
name: Build and deploy to prod-gcp
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: "write"
|
||||
contents: "read"
|
||||
id-token: "write"
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "20"
|
||||
- uses: actions/checkout@v3
|
||||
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 "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
|
||||
echo "USE_CDN_ASSETS=true" >> aksel.nav.no/website/.env
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
@@ -80,25 +104,18 @@ jobs:
|
||||
- name: Build application
|
||||
run: yarn workspace aksel.nav.no build:next
|
||||
|
||||
- name: Upload static files to NAV CDN
|
||||
uses: navikt/frontend/actions/cdn-upload/v1@main
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # Use commit-sha1 instead of tag for security concerns
|
||||
with:
|
||||
cdn-team-name: aksel
|
||||
source: ./aksel.nav.no/website/.next/static
|
||||
destination: "/website/_next"
|
||||
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get complete tag
|
||||
run: echo "TAG=PROD-$( date +%s )" >> $GITHUB_ENV
|
||||
|
||||
- uses: nais/docker-build-push@v0
|
||||
id: docker-push
|
||||
with:
|
||||
team: designsystem
|
||||
push_image: true
|
||||
dockerfile: aksel.nav.no/Dockerfile
|
||||
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
|
||||
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
|
||||
|
||||
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: Wait for e2e-tests to succeed
|
||||
uses: lewagon/wait-on-check-action@v1.2.0
|
||||
with:
|
||||
@@ -106,6 +123,9 @@ jobs:
|
||||
check-name: "Smoketest Aksel"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
wait-interval: 10
|
||||
- name: Push docker image
|
||||
run: |
|
||||
docker push ${{ env.DOCKER_TAG }}
|
||||
|
||||
- name: Deploy to prod-gcp
|
||||
uses: nais/deploy/actions/deploy@master
|
||||
@@ -113,4 +133,4 @@ jobs:
|
||||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
|
||||
RESOURCE: aksel.nav.no/nais-prod.yaml
|
||||
CLUSTER: prod-gcp
|
||||
IMAGE: ${{ steps.docker-push.outputs.image }}
|
||||
IMAGE: ${{ env.DOCKER_TAG }}
|
||||
@@ -12,17 +12,17 @@ on:
|
||||
default: "false"
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/aksel
|
||||
IMAGE: ghcr.io/navikt/designsystemet
|
||||
|
||||
jobs:
|
||||
redeploy:
|
||||
name: Redeploy image
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "20"
|
||||
- uses: actions/checkout@v3
|
||||
node-version: "14"
|
||||
- uses: actions/checkout@v2
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # Use commit-sha1 instead of tag for security concerns
|
||||
with:
|
||||
|
||||
@@ -8,12 +8,12 @@ jobs:
|
||||
execute:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # Required to retrieve git history
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "20"
|
||||
node-version: 14
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
|
||||
@@ -3,11 +3,11 @@ name: Visual Regression Tests
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
- "master"
|
||||
paths:
|
||||
- "@navikt/**"
|
||||
pull_request:
|
||||
branches: [main, next]
|
||||
branches: [master, next]
|
||||
paths:
|
||||
- "@navikt/**"
|
||||
|
||||
@@ -15,10 +15,6 @@ jobs:
|
||||
visual_regression_test:
|
||||
name: "visual regression test (chromatic)"
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -26,7 +22,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "20"
|
||||
node-version: 16.13.0
|
||||
cache: yarn
|
||||
|
||||
- name: Restore cache
|
||||
@@ -48,17 +44,16 @@ jobs:
|
||||
id: chromatic_tests
|
||||
continue-on-error: true
|
||||
with:
|
||||
autoAcceptChanges: "main"
|
||||
autoAcceptChanges: "master"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
projectToken: x3xqdfgkujg
|
||||
exitZeroOnChanges: false
|
||||
buildScriptName: "build:storybook"
|
||||
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
|
||||
uses: frabert/replace-string-action@v2.0
|
||||
id: storybook_url
|
||||
with:
|
||||
pattern: "(iframe.html)"
|
||||
@@ -74,35 +69,41 @@ jobs:
|
||||
|
||||
- name: Find Comment
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
|
||||
uses: peter-evans/find-comment@v2
|
||||
uses: peter-evans/find-comment@v1
|
||||
id: fc
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
comment-author: "github-actions[bot]"
|
||||
body-includes: Storybook demo
|
||||
body-includes: Chromatic build-output
|
||||
|
||||
- name: Create or update comment
|
||||
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@v3
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
with:
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: |
|
||||
## [Storybook demo](${{steps.storybook_url.outputs.replaced}})
|
||||
Chromatic build-output:
|
||||
|
||||
[${{ steps.vars.outputs.sha_short }}](https://github.com/navikt/aksel/commit/${{ steps.vars.outputs.sha_short }}) | ${{steps.chromatic_tests.outputs.componentCount}} komponenter | ${{steps.chromatic_tests.outputs.specCount}} stories
|
||||
- :clipboard: [Review](${{steps.chromatic_tests.outputs.url}})
|
||||
- :tada: [Storybook preview](${{steps.storybook_url.outputs.replaced}})
|
||||
- :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' && !contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'
|
||||
uses: peter-evans/create-or-update-comment@v3
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
with:
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: |
|
||||
## [Storybook demo](${{steps.storybook_url.outputs.replaced}})
|
||||
**Chromatic build-output**:
|
||||
|
||||
### [Endringer til review](${{steps.chromatic_tests.outputs.url}}): ${{steps.chromatic_tests.outputs.changeCount}}
|
||||
- :clipboard: [Review](${{steps.chromatic_tests.outputs.url}})
|
||||
- :tada: [Storybook preview](${{steps.storybook_url.outputs.replaced}})
|
||||
- :no_entry_sign: Changes detected :no_entry_sign:, review endringer.
|
||||
|
||||
[${{ steps.vars.outputs.sha_short }}](https://github.com/navikt/aksel/commit/${{ steps.vars.outputs.sha_short }}) | ${{steps.chromatic_tests.outputs.componentCount}} komponenter | ${{steps.chromatic_tests.outputs.specCount}} stories
|
||||
commit: `${{ steps.vars.outputs.sha_short }}`
|
||||
edit-mode: replace
|
||||
@@ -3,7 +3,7 @@ name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- next
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
@@ -13,8 +13,6 @@ jobs:
|
||||
name: "Validate build"
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: "write"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -22,7 +20,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "20"
|
||||
node-version: 16.13.0
|
||||
cache: yarn
|
||||
|
||||
- name: Restore cache
|
||||
|
||||
@@ -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
|
||||
@@ -1,11 +1,11 @@
|
||||
name: E2E / Playwright Tests
|
||||
on:
|
||||
push:
|
||||
branches: [main, next]
|
||||
branches: [master, next]
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
pull_request:
|
||||
branches: [main, next]
|
||||
branches: [master, next]
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
|
||||
@@ -13,16 +13,17 @@ jobs:
|
||||
playwright:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mcr.microsoft.com/playwright:v1.35.1-jammy
|
||||
image: mcr.microsoft.com/playwright:v1.30.0-focal
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "20"
|
||||
node-version: 16
|
||||
|
||||
- name: add tokens to .env
|
||||
run: |
|
||||
echo "SANITY_WRITE_KEY=${{ secrets.SANITY_FEEDBACK_WRITE_KEY }}" >> 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
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
- "master"
|
||||
paths:
|
||||
- "fonts/**"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ name: Release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -11,13 +11,8 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
jobs:
|
||||
build:
|
||||
name: "Release packages"
|
||||
if: ${{!contains(github.event.head_commit.message, '[ci skip]')}}
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: "write"
|
||||
contents: "write"
|
||||
packages: "write"
|
||||
pull-requests: "write"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -25,13 +20,9 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "20"
|
||||
node-version: 16.13.0
|
||||
cache: yarn
|
||||
|
||||
- uses: denoland/setup-deno@v1
|
||||
with:
|
||||
deno-version: v1.x
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
@@ -49,7 +40,6 @@ jobs:
|
||||
with:
|
||||
version: yarn version
|
||||
publish: yarn release
|
||||
createGithubReleases: false
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -75,29 +65,3 @@ jobs:
|
||||
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
GITHUB_TOKEN: ${{ secrets.GIT_REPO }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
|
||||
- name: Generate icon.zip
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
run: yarn zip:icons
|
||||
|
||||
- name: Upload updated icon.zip to NAV CDN
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
uses: navikt/frontend/actions/cdn-upload/v1@main
|
||||
with:
|
||||
cdn-team-name: aksel
|
||||
source: ./@navikt/aksel-icons/aksel-icons.zip
|
||||
destination: "/icons/zip"
|
||||
|
||||
- name: Get @navikt/ds-css version
|
||||
run: |
|
||||
VERSION=$(yarn css:get-version)
|
||||
echo "version=$VERSION" >> $GITHUB_ENV
|
||||
echo "Version of @navikt/ds-css: ${{ env.version }}"
|
||||
|
||||
- name: Upload CSS to NAV CDN
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
uses: navikt/frontend/actions/cdn-upload/v1@main
|
||||
with:
|
||||
cdn-team-name: aksel
|
||||
source: ./@navikt/core/css/dist/version/${{env.version}}
|
||||
destination: "@navikt/ds-css"
|
||||
@@ -2,27 +2,28 @@ name: Smoketest aksel.nav.no
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/aksel
|
||||
IMAGE: ghcr.io/navikt/designsystemet
|
||||
|
||||
jobs:
|
||||
smoketest:
|
||||
name: Smoketest Aksel
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mcr.microsoft.com/playwright:v1.35.1-jammy
|
||||
image: mcr.microsoft.com/playwright:v1.30.0-focal
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "20"
|
||||
- uses: actions/checkout@v3
|
||||
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 "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
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
name: Update Icons
|
||||
|
||||
on:
|
||||
# schedule:
|
||||
# - cron: 0 0 * * *
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v3
|
||||
id: node-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: install
|
||||
if: steps.node-cache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
- name: postinstall
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Update Icons
|
||||
run: yarn workspace @navikt/ds-icons update
|
||||
env:
|
||||
FIGMA_TOKEN: ${{ secrets.FIGMA_IKONER_API }}
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GIT_REPO }}
|
||||
commit-message: "Ikoner synket fra figma"
|
||||
branch: figma-icons-sync
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||
signoff: false
|
||||
delete-branch: true
|
||||
title: "Ikonsynk Figma"
|
||||
@@ -0,0 +1,39 @@
|
||||
name: Update tokens
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v3
|
||||
id: node-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: install
|
||||
if: steps.node-cache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
- name: postinstall
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Update tokens
|
||||
run: yarn workspace @navikt/ds-tokens update
|
||||
env:
|
||||
FIGMA_TOKEN: ${{ secrets.FIGMA_IKONER_API }}
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: figma-tokens-sync
|
||||
delete-branch: true
|
||||
title: "Tokens sync Figma"
|
||||
commit-message: "Tokens synket fra figma"
|
||||
committer: GitHub <noreply@github.com>
|
||||
signoff: false
|
||||
@@ -150,5 +150,4 @@ playwright-report/
|
||||
/test-results/
|
||||
backup-*.tar.gz
|
||||
sitemap-urls.json
|
||||
*.tar.gz
|
||||
searchindex.json
|
||||
*.tar.gz
|
||||
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 285 KiB |
|
Before Width: | Height: | Size: 388 KiB |
@@ -1,175 +0,0 @@
|
||||
import { Meta } from "@storybook/blocks";
|
||||
|
||||
import AkselThumbnail from "./assets/aksel-thumbnail.png";
|
||||
import Setup from "./assets/setup.png";
|
||||
import Components from "./assets/components.png";
|
||||
|
||||
<Meta title="Getting started" />
|
||||
|
||||
<div className="sb-container">
|
||||
<div className='sb-section-title'>
|
||||
|
||||
# Getting started
|
||||
|
||||
Aksel is the toolbox for product development <a href="https://aksel.nav.no"target="_blank">@NAV</a> (Norwegian Labour and Welfare Administration)
|
||||
|
||||
This includes a designsystem, best practices for product-development, principles for user-experience and a blog. <a href="https://aksel.nav.no/god-praksis/artikler/om-aksel" target="_blank">
|
||||
Read more about Aksel.</a>
|
||||
|
||||
</div>
|
||||
<div className="sb-section">
|
||||
<div className="sb-section-item">
|
||||
<img
|
||||
src={AkselThumbnail}
|
||||
alt="Aksel-thumbnail"
|
||||
aria-hidden
|
||||
/>
|
||||
|
||||
<h3 className="sb-section-item-heading"><a
|
||||
href="https://aksel.nav.no"
|
||||
target="_blank"
|
||||
className="sb-link"
|
||||
>Website</a></h3>
|
||||
<p className="sb-section-item-paragraph">Includes everything you need to get started building and developing digital products for NAV today.</p>
|
||||
|
||||
</div>
|
||||
<div className="sb-section-item">
|
||||
<img
|
||||
src={Setup}
|
||||
alt="Setup-thumbnail"
|
||||
aria-hidden
|
||||
/>
|
||||
|
||||
<h3 className="sb-section-item-heading"><a
|
||||
href="https://aksel.nav.no/grunnleggende/introduksjon/kom-i-gang-med-kodepakkene"
|
||||
target="_blank"
|
||||
className="sb-link"
|
||||
>Setup</a></h3>
|
||||
<p className="sb-section-item-paragraph">Get started developing using our solutions. How to install, setup and use our React, CSS and Icons.</p>
|
||||
|
||||
</div>
|
||||
<div className="sb-section-item">
|
||||
<img
|
||||
src={Components}
|
||||
alt="Components-thumbnail"
|
||||
aria-hidden
|
||||
/>
|
||||
|
||||
<h3 className="sb-section-item-heading"><a
|
||||
href="https://aksel.nav.no/komponenter"
|
||||
target="_blank"
|
||||
className="sb-link"
|
||||
>Components</a></h3>
|
||||
<p className="sb-section-item-paragraph">Browse trough 40+ components with examples, do and don't, props and accessibility information.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div className="sb-container">
|
||||
<div className='sb-section-title'>
|
||||
## More than just a component library
|
||||
|
||||
Aksel offers tools that makes developing frontend-applications easier.
|
||||
|
||||
</div>
|
||||
|
||||
<div className="sb-section">
|
||||
<div className="sb-section-item">
|
||||
|
||||
<h3 className="sb-section-item-heading"><a
|
||||
href="https://aksel.nav.no/ikoner"
|
||||
target="_blank"
|
||||
className="sb-link"
|
||||
>Icons</a></h3>
|
||||
<p className="sb-section-item-paragraph">We provide an icon library with 800+ open-source icons.</p>
|
||||
|
||||
</div>
|
||||
<div className="sb-section-item">
|
||||
|
||||
<h3 className="sb-section-item-heading"><a
|
||||
href="https://aksel.nav.no/grunnleggende/styling/design-tokens"
|
||||
target="_blank"
|
||||
className="sb-link"
|
||||
>Tokens</a></h3>
|
||||
<p className="sb-section-item-paragraph">Colors, spacing, shadows and more. All available for CSS, SASS, Less and JS.</p>
|
||||
|
||||
</div>
|
||||
<div className="sb-section-item">
|
||||
|
||||
|
||||
<h3 className="sb-section-item-heading"><a
|
||||
href="https://aksel.nav.no/grunnleggende/kode/stylelint"
|
||||
target="_blank"
|
||||
className="sb-link"
|
||||
>Stylelint</a></h3>
|
||||
<p className="sb-section-item-paragraph">Using our Stylelint-plugin helps keep your code free from bugs and makes adopting updates safer.</p>
|
||||
|
||||
</div>
|
||||
<div className="sb-section-item">
|
||||
<h3 className="sb-section-item-heading"><a
|
||||
href="https://aksel.nav.no/grunnleggende/kode/tailwind"
|
||||
target="_blank"
|
||||
className="sb-link"
|
||||
>Tailwind</a></h3>
|
||||
<p className="sb-section-item-paragraph">Our tokens made available as a simple tailwind-config.</p>
|
||||
</div>
|
||||
<div className="sb-section-item">
|
||||
<h3 className="sb-section-item-heading"><a
|
||||
href="https://aksel.nav.no/grunnleggende/kode/kommandolinje"
|
||||
target="_blank"
|
||||
className="sb-link"
|
||||
>CLI</a></h3>
|
||||
<p className="sb-section-item-paragraph">CLI for codemods and advanced CSS-imports</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
{`
|
||||
.sb-container {
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
|
||||
.sb-section {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-gap: var(--a-spacing-6);
|
||||
}
|
||||
|
||||
.sb-link{
|
||||
text-decoration: underline;
|
||||
color: var(--a-text-default);
|
||||
}
|
||||
|
||||
img {
|
||||
object-fit: cover;
|
||||
padding-bottom: var(--a-spacing-5);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.sb-section-title {
|
||||
margin-bottom: var(--a-spacing-8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.sb-section-item-heading {
|
||||
padding-bottom: var(--a-spacing-1);
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.sb-section-item-paragraph {
|
||||
margin: 0;
|
||||
padding-bottom: var(--a-spacing-3);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.sb-section {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
.colgap[data-theme="dark"],
|
||||
.rowgap[data-theme="dark"] {
|
||||
background-color: var(--a-gray-900);
|
||||
background-color: #262626;
|
||||
}
|
||||
|
||||
.rowgap-wrap {
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
const getStories = () => {
|
||||
return process.env.stories
|
||||
? [`../@navikt/**/${process.env.stories}.stories.@(js|jsx|ts|tsx|mdx)`]
|
||||
: ["../@navikt/**/*.stories.@(js|jsx|ts|tsx|mdx)"];
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
webpackFinal: async (config, { configType }) => {
|
||||
config.devServer = {
|
||||
stats: "errors-only",
|
||||
};
|
||||
return config;
|
||||
},
|
||||
staticDirs: ["./public"],
|
||||
devServer: {
|
||||
stats: "errors-only",
|
||||
},
|
||||
stories: () => [...getStories(), "./*.stories.mdx"],
|
||||
addons: [
|
||||
"@storybook/addon-a11y",
|
||||
"@whitespace/storybook-addon-html",
|
||||
{
|
||||
name: "@storybook/addon-storysource",
|
||||
options: {
|
||||
loaderOptions: {
|
||||
injectStoryParameters: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "@storybook/addon-essentials",
|
||||
options: {
|
||||
actions: false,
|
||||
controls: {
|
||||
hideNoControlsWarning: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
features: {
|
||||
storyStoreV7: true,
|
||||
},
|
||||
core: {
|
||||
builder: {
|
||||
name: "webpack5",
|
||||
options: {
|
||||
lazyCompilation: false,
|
||||
fsCache: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
framework: "@storybook/react",
|
||||
typescript: {
|
||||
check: false,
|
||||
checkOptions: {},
|
||||
reactDocgen: false,
|
||||
},
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
module.exports = {
|
||||
staticDirs: ["./public"],
|
||||
|
||||
stories: () => [
|
||||
"../@navikt/**/*.stories.@(js|jsx|ts|tsx|mdx)",
|
||||
"./*.stories.mdx",
|
||||
],
|
||||
addons: [
|
||||
"@storybook/addon-a11y",
|
||||
"@whitespace/storybook-addon-html",
|
||||
"@storybook/addon-interactions",
|
||||
{
|
||||
name: "@storybook/addon-storysource",
|
||||
options: {
|
||||
loaderOptions: {
|
||||
injectStoryParameters: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "@storybook/addon-essentials",
|
||||
options: {
|
||||
actions: false,
|
||||
controls: {
|
||||
hideNoControlsWarning: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
framework: {
|
||||
name: "@storybook/react-vite",
|
||||
options: {},
|
||||
},
|
||||
features: {
|
||||
storyStoreV7: true,
|
||||
},
|
||||
docs: {
|
||||
autodocs: "tag",
|
||||
},
|
||||
typescript: {
|
||||
check: false,
|
||||
checkOptions: {},
|
||||
reactDocgen: false,
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import { addons } from "@storybook/addons";
|
||||
import NavTheme from "./theme.js";
|
||||
/* import logoUrl from "./public/logo.svg"; */
|
||||
|
||||
addons.setConfig({
|
||||
theme: NavTheme,
|
||||
});
|
||||
|
||||
/* const link = document.createElement("link");
|
||||
link.setAttribute("rel", "shortcut icon");
|
||||
link.setAttribute("href", logoUrl);
|
||||
document.head.appendChild(link); */
|
||||
@@ -1,6 +0,0 @@
|
||||
import { addons } from "@storybook/manager-api";
|
||||
import AkselTheme from "./theme.js";
|
||||
|
||||
addons.setConfig({
|
||||
theme: AkselTheme,
|
||||
});
|
||||
@@ -0,0 +1,53 @@
|
||||
import "@navikt/ds-css/index.css";
|
||||
import "@navikt/ds-css-internal/index.css";
|
||||
import "./layout.css";
|
||||
|
||||
export const parameters = {
|
||||
/* actions: { argTypesRegex: "^on[A-Z].*" }, */
|
||||
options: {
|
||||
storySort: {
|
||||
method: "",
|
||||
order: ["Intro", "ds-icons", "ds-react", ["form"], ["Default"]],
|
||||
locales: "",
|
||||
},
|
||||
},
|
||||
viewMode: "docs",
|
||||
layout: "centered",
|
||||
backgrounds: {
|
||||
default: "Canvas",
|
||||
values: [
|
||||
{
|
||||
name: "Canvas",
|
||||
value: "#ffffff",
|
||||
},
|
||||
{
|
||||
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];
|
||||
@@ -1,59 +0,0 @@
|
||||
import React from "react";
|
||||
import "@navikt/ds-css/index.css";
|
||||
import "./layout.css";
|
||||
|
||||
export const parameters = {
|
||||
options: {
|
||||
storySort: {
|
||||
method: "alphabetical",
|
||||
order: [
|
||||
"Getting started",
|
||||
"ds-react",
|
||||
["Primitives"],
|
||||
["Default"],
|
||||
"Aksel-icons",
|
||||
],
|
||||
},
|
||||
},
|
||||
layout: "centered",
|
||||
backgrounds: {
|
||||
values: [
|
||||
{
|
||||
name: "Canvas",
|
||||
value: "#ffffff",
|
||||
},
|
||||
{
|
||||
name: "Darkmode",
|
||||
value: "#23262a",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const globalTypes = {
|
||||
theme: {
|
||||
name: "Theme",
|
||||
toolbar: {
|
||||
icon: "circlehollow",
|
||||
items: [
|
||||
{ value: "light", icon: "circlehollow", title: "light" },
|
||||
{ value: "dark", icon: "circle", title: "dark" },
|
||||
],
|
||||
showName: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const withTheme = (StoryFn, context) => {
|
||||
return (
|
||||
<div
|
||||
data-theme={context.parameters.theme || context.globals.theme || "light"}
|
||||
lang="no"
|
||||
id="root"
|
||||
>
|
||||
<StoryFn />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const decorators = [withTheme];
|
||||
@@ -1,38 +1,20 @@
|
||||
<svg
|
||||
width="119"
|
||||
height="26"
|
||||
viewBox="0 0 119 26"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="44"
|
||||
height="44"
|
||||
fill="none"
|
||||
viewBox="0 0 44 44"
|
||||
>
|
||||
<path
|
||||
d="M56.9682 23.3413L48.1959 1.94542C47.9106 1.30354 47.2687 0.839966 46.5199 0.839966C45.8067 0.839966 45.1292 1.30354 44.8795 1.94542L36.1072 23.3413C36.0359 23.5196 36.0002 23.6623 36.0002 23.7692C36.0002 24.3398 36.4638 24.839 37.07 24.839C37.498 24.839 37.9259 24.5537 38.0685 24.1615L40.1724 18.8838H52.903L55.0069 24.1615C55.1496 24.5537 55.5418 24.839 56.0054 24.839C56.6116 24.839 57.0752 24.3398 57.0752 23.7692C57.0752 23.5909 57.0039 23.4483 56.9682 23.3413ZM40.9213 17.0295L46.5199 2.9439L52.1541 17.0295H40.9213Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M75.0623 23.2343L68.1086 15.3179L74.884 8.93474C75.0623 8.75645 75.1693 8.50683 75.1693 8.29287C75.1693 7.82929 74.8127 7.40137 74.3135 7.40137C74.0995 7.40137 73.8855 7.47269 73.7072 7.61533L63.4729 17.3148V1.76712C63.4729 1.26788 63.045 0.839966 62.5457 0.839966C62.0465 0.839966 61.6186 1.26788 61.6186 1.76712V23.9119C61.6186 24.4111 62.0465 24.839 62.5457 24.839C63.045 24.839 63.4729 24.4111 63.4729 23.9119V19.5614L66.6823 16.5303L73.6003 24.5181C73.7786 24.732 74.0282 24.839 74.3491 24.839C74.884 24.839 75.2763 24.4111 75.2763 23.8762C75.2763 23.6266 75.205 23.4126 75.0623 23.2343Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M79.0353 22.9491C80.747 24.5181 82.6726 25.16 85.1331 25.16C89.448 25.16 91.5876 22.8777 91.5876 20.0963C91.5876 16.4233 88.2712 15.6031 85.3114 14.8543C82.9222 14.2481 80.7113 13.7132 80.7113 11.7519C80.7113 9.96888 82.3517 8.64947 85.0262 8.64947C86.9518 8.64947 88.5565 9.327 89.6619 10.3968C89.7689 10.5038 89.9829 10.6108 90.1612 10.6108C90.6247 10.6108 90.9813 10.2185 90.9813 9.79058C90.9813 9.5053 90.8744 9.327 90.6961 9.1487C89.4123 7.93627 87.5937 7.08043 85.0262 7.08043C81.1392 7.08043 78.8927 9.22002 78.8927 11.8589C78.8927 15.2109 82.0664 15.9597 84.9548 16.6729C87.4154 17.3148 89.7689 17.9567 89.7689 20.1676C89.7689 22.1645 88.0572 23.5909 85.1688 23.5909C83.0649 23.5909 81.3532 22.7708 80.1408 21.6296C79.9981 21.487 79.8198 21.4157 79.6059 21.4157C79.1066 21.4157 78.7144 21.8079 78.7144 22.3072C78.7144 22.5568 78.857 22.8064 79.0353 22.9491Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M95.2069 16.1024C95.2069 21.4157 98.8086 25.16 103.837 25.16C106.404 25.16 108.365 24.3398 110.077 22.8421C110.255 22.6638 110.362 22.4855 110.362 22.2359C110.362 21.7723 110.041 21.4513 109.614 21.4513C109.435 21.4513 109.257 21.487 109.15 21.594C107.688 22.9134 105.941 23.5553 103.979 23.5553C99.914 23.5553 97.4179 20.4529 97.2396 16.7086H110.541C111.254 16.7086 111.646 16.3163 111.646 15.6745C111.646 11.2526 108.758 7.08043 103.516 7.08043C98.7373 7.08043 95.2069 11.11 95.2069 16.1024ZM103.48 8.68513C107.795 8.68513 109.72 12.3224 109.756 15.2465H97.2396C97.3822 12.2511 99.4148 8.68513 103.48 8.68513Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M117.365 24.839C117.865 24.839 118.293 24.4111 118.293 23.9119V1.76712C118.293 1.26788 117.865 0.839966 117.365 0.839966C116.866 0.839966 116.438 1.26788 116.438 1.76712V23.9119C116.438 24.4111 116.866 24.839 117.365 24.839Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
fill="rgba(153, 196, 221, 1)"
|
||||
fill-rule="evenodd"
|
||||
d="M9.07 3.03A10.33 10.33 0 0 1 16.37 0h17.3C39.37 0 44 4.62 44 10.33v17.3c0 2.73-1.09 5.36-3.03 7.3l-6.04 6.04a10.33 10.33 0 0 1-7.3 3.03h-17.3C4.63 44 0 39.38 0 33.67v-17.3c0-2.73 1.09-5.36 3.03-7.3l6.04-6.04Z"
|
||||
clip-rule="evenodd"
|
||||
d="M0.292684 8.54331C-0.0977248 8.15267 -0.0975372 7.5195 0.293103 7.1291L5.44967 1.97558C5.47463 1.95063 5.4999 1.92606 5.52546 1.90187L5.52289 1.8993C6.03155 1.39065 6.65771 1.07111 7.314 0.9407C7.59976 0.874273 7.89433 0.839967 8.19243 0.839967L20.12 0.839966C22.2629 0.839967 24 2.5771 24 4.71997V16.6435C24 16.9198 23.9705 17.1931 23.9133 17.4591C23.7914 18.1347 23.4693 18.7813 22.9471 19.3035L22.9458 19.3022C22.9189 19.3309 22.8915 19.3592 22.8636 19.3871L17.7071 24.5435C17.3166 24.934 16.6834 24.934 16.2929 24.5435C15.9024 24.153 15.9024 23.5198 16.2929 23.1293L21.4494 17.9728C21.6986 17.7236 21.8706 17.4116 21.9501 17.074C22.0233 16.6182 21.8843 16.1349 21.5329 15.7835L9.06289 3.31352C8.70098 2.95161 8.20044 2.81283 7.73221 2.89716C7.40619 2.97949 7.10531 3.14852 6.86347 3.39021L1.7069 8.54373C1.31626 8.93414 0.683092 8.93395 0.292684 8.54331ZM11.4178 2.83997L22 13.4222V4.71997C22 3.68167 21.1583 2.83997 20.12 2.83997L11.4178 2.83997Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
></path>
|
||||
<path
|
||||
d="M0.292893 24.5435C-0.0976311 24.153 -0.0976311 23.5198 0.292893 23.1293L9.29289 14.1293C9.68342 13.7388 10.3166 13.7388 10.7071 14.1293C11.0976 14.5198 11.0976 15.153 10.7071 15.5435L1.70711 24.5435C1.31658 24.934 0.683417 24.934 0.292893 24.5435Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
fill="rgba(0, 36, 58, 1)"
|
||||
fill-rule="evenodd"
|
||||
d="M12.96 6.92a4.82 4.82 0 0 1 3.42-1.42h17.29a4.83 4.83 0 0 1 4.83 4.83v17.29a4.8 4.8 0 0 1-1.42 3.42l-.37.37-6.65 6.65a1.5 1.5 0 1 1-2.12-2.12l6.64-6.64v-.01c.72-.72.72-1.87 0-2.59L17.3 9.42a1.83 1.83 0 0 0-2.6 0l-6.64 6.64a1.5 1.5 0 1 1-2.12-2.12l7.02-7.02Zm22.54 3.41v13.05L20.62 8.5h13.05c1 0 1.83.82 1.83 1.83ZM20.06 26.06a1.5 1.5 0 0 0-2.12-2.12l-11 11a1.5 1.5 0 1 0 2.12 2.12l11-11Z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 925 B |
@@ -1,8 +1,22 @@
|
||||
import { create } from "@storybook/theming";
|
||||
import logoUrl from "./public/logo.svg";
|
||||
/* import logoUrl from "./public/logo.svg"; */
|
||||
|
||||
export default create({
|
||||
brandImage: logoUrl,
|
||||
/* brandImage: process.env.NODE_ENV === "production" ? logoUrl : "/logo.svg", */
|
||||
base: "light",
|
||||
// Typography
|
||||
fontBase: '"Source Sans Pro", sans-serif',
|
||||
fontCode: "monospace",
|
||||
|
||||
// Text colors
|
||||
textColor: "#262626",
|
||||
textInverseColor: "rgba(255,255,255,0.9)",
|
||||
|
||||
colorSecondary: "rgba(0, 36, 58, 1)",
|
||||
colorPrimary: "rgba(153, 196, 221, 1)",
|
||||
|
||||
barTextColor: "rgba(0, 91, 130, 1)",
|
||||
barSelectedColor: "rgba(0, 36, 58, 1)",
|
||||
|
||||
brandTitle: "Aksel",
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
import { Meta, Canvas } from "@storybook/addon-docs";
|
||||
|
||||
<Meta title="Intro/Velkommen" />
|
||||
|
||||
# Aksel, NAVs designsystem
|
||||
|
||||
- [Dokumentasjon](https://aksel.nav.no/designsystem)
|
||||
- [Komponenter](https://aksel.nav.no/designsystem/side/oversikt-komponenter)
|
||||
|
||||
## Kom i gang
|
||||
|
||||
### Kjernepakke
|
||||
|
||||
```bash
|
||||
yarn add @navikt/ds-react @navikt/ds-css
|
||||
```
|
||||
|
||||
### 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>;
|
||||
```
|
||||
@@ -0,0 +1,25 @@
|
||||
const path = require("path");
|
||||
|
||||
module.exports = (baseConfig) => {
|
||||
baseConfig.config.module.rules.push({
|
||||
test: /\.css$/,
|
||||
use: ["style-loader", "css-loader"],
|
||||
include: [
|
||||
path.resolve(__dirname, "../node_modules/@navikt/core/css/index.css"),
|
||||
path.resolve(__dirname, "../node_modules/@navikt/internal/css/index.css"),
|
||||
],
|
||||
});
|
||||
baseConfig.config.resolve.alias = {
|
||||
...baseConfig.config.resolve.alias,
|
||||
"./normalize.css": path.resolve(
|
||||
__dirname,
|
||||
"../node_modules/normalize.css/normalize.css"
|
||||
),
|
||||
"./@navikt/ds-tokens": path.resolve(
|
||||
__dirname,
|
||||
"../node_modules/@navikt/ds-tokens/dist/tokens.css"
|
||||
),
|
||||
};
|
||||
|
||||
return baseConfig.config;
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
dist
|
||||
src
|
||||
svgtest
|
||||
core-icons
|
||||
*.zip
|
||||
@@ -1,16 +0,0 @@
|
||||
const template = require("./config/template");
|
||||
|
||||
module.exports = {
|
||||
typescript: true,
|
||||
ref: true,
|
||||
icon: true,
|
||||
titleProp: true,
|
||||
svgProps: {
|
||||
focusable: false,
|
||||
role: "img",
|
||||
},
|
||||
replaceAttrValues: {
|
||||
"#23262A": "currentColor",
|
||||
},
|
||||
template,
|
||||
};
|
||||
@@ -1,215 +0,0 @@
|
||||
# @navikt/aksel-icons
|
||||
|
||||
## 5.9.2
|
||||
|
||||
## 5.9.1
|
||||
|
||||
## 5.9.0
|
||||
|
||||
## 5.8.0
|
||||
|
||||
## 5.7.6
|
||||
|
||||
## 5.7.5
|
||||
|
||||
## 5.7.4
|
||||
|
||||
## 5.7.3
|
||||
|
||||
## 5.7.2
|
||||
|
||||
## 5.7.1
|
||||
|
||||
## 5.7.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Ikoner: Nye ikoner `ChevronLeftFirstCircle` og `ChevronRightLastCircle` ([#2365](https://github.com/navikt/aksel/pull/2365))
|
||||
|
||||
## 5.6.5
|
||||
|
||||
## 5.6.4
|
||||
|
||||
## 5.6.3
|
||||
|
||||
## 5.6.2
|
||||
|
||||
## 5.6.1
|
||||
|
||||
## 5.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Ikoner: SVG export setter nå `height="1em"`, `width="1em"` og `fill="currentColor"`. ([#2300](https://github.com/navikt/aksel/pull/2300))
|
||||
|
||||
- Ikoner: Nye ikoner `book` og `books` ([#2313](https://github.com/navikt/aksel/pull/2313))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Ikoner: Nye ikoner `ClipboardCheckmark` og `ClipboardLink` ([#2307](https://github.com/navikt/aksel/pull/2307))
|
||||
|
||||
## 5.5.0
|
||||
|
||||
## 5.4.1
|
||||
|
||||
## 5.4.0
|
||||
|
||||
## 5.3.5
|
||||
|
||||
## 5.3.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- :bug: SVG import map er nå riktig path ([#2250](https://github.com/navikt/aksel/pull/2250))
|
||||
|
||||
## 5.3.3
|
||||
|
||||
## 5.3.2
|
||||
|
||||
## 5.3.1
|
||||
|
||||
## 5.3.0
|
||||
|
||||
## 5.2.1
|
||||
|
||||
## 5.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Ikoner: Oppdatert ikonpakke ([#2197](https://github.com/navikt/aksel/pull/2197))
|
||||
|
||||
## 5.1.0
|
||||
|
||||
## 5.0.3
|
||||
|
||||
## 5.0.2
|
||||
|
||||
## 5.0.1
|
||||
|
||||
## 5.0.0
|
||||
|
||||
## 4.12.1
|
||||
|
||||
## 4.12.0
|
||||
|
||||
## 4.11.2
|
||||
|
||||
## 4.11.1
|
||||
|
||||
## 4.11.0
|
||||
|
||||
## 4.10.2
|
||||
|
||||
## 4.10.1
|
||||
|
||||
## 4.10.0
|
||||
|
||||
## 4.9.1
|
||||
|
||||
## 4.9.0
|
||||
|
||||
## 4.8.0
|
||||
|
||||
## 4.7.4
|
||||
|
||||
## 4.7.3
|
||||
|
||||
## 4.7.2
|
||||
|
||||
## 4.7.1
|
||||
|
||||
## 4.7.0
|
||||
|
||||
## 4.6.1
|
||||
|
||||
## 4.6.0
|
||||
|
||||
## 4.5.0
|
||||
|
||||
## 4.4.2
|
||||
|
||||
## 4.4.1
|
||||
|
||||
## 4.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Nye ikoner `ChevronRightLast` og `ChevronLeftLast` ([PR](https://github.com/navikt/aksel/pull/2054))
|
||||
|
||||
## 3.2.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Nye ikoner `FileParagraph` og `FilePlus` ([PR](https://github.com/navikt/aksel/pull/1998))
|
||||
|
||||
## 2.9.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Oppdatert Statusikoner til å være tydeligere og mer konsistente. ([PR](https://github.com/navikt/aksel/pull/1959))
|
||||
|
||||
## 2.9.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fikset `CheckmarkIcon`-bug
|
||||
|
||||
## 2.9.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fikset `CheckmarkCircleIcon`-bug ([PR](https://github.com/navikt/aksel/pull/1956))
|
||||
|
||||
## 2.9.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Nye ikoner `BulletList` og `NumberList` ([PR](https://github.com/navikt/aksel/pull/1950))
|
||||
|
||||
## 2.8.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- :tada: Nye ikoner `HandKnot` og `HandKnotFilled` ([PR](https://github.com/navikt/aksel/pull/1928))
|
||||
|
||||
## 2.8.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Oppdatert `InformationSquare`-ikon ([PR](https://github.com/navikt/aksel/pull/1921))
|
||||
|
||||
## 2.8.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Oppdatert `VideoSlack`, `Questionmark` og `Information`-ikoner ([PR](https://github.com/navikt/aksel/pull/1909))
|
||||
|
||||
## 2.8.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Nye ikoner `VideoSlash` og `VideoSlashFill`
|
||||
|
||||
## 2.8.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fikset Sourcemap-bug
|
||||
|
||||
## 2.7.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Nye ikoner `CaretUpDownFilledDown`, `CaretUpDownFilledUp`, `CloudDown`, `CloudDownFill`, `CloudUp`, `CloudUpFill`, `HddDown`, `HddDownFill`, `HddUp`, `HddUpFill`, `Inbox`, `InboxDown`, `InboxDownFill`, `InboxFill`, `InboxUp`, `InboxUpFill`, `ShoppingBasket`, `ShoppingBasketFill`
|
||||
|
||||
## 2.7.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Nye ikoner, `CaretDownFill`, `CaretLeft`, `CaretLeftFill`, `CaretLeftRight`, `CaretLeftRightFill`, `CaretRight`, `CaretRightFill`, `CaretUpDownFill`, `CaretUpFill`, `Escalator`, `Moon`, `MoonFill`. Fjernet `EscalatorStroke` ([PR](https://github.com/navikt/aksel/pull/1852))
|
||||
|
||||
## 2.7.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Ny ikonpakke med for core icons 3! `@navikt/aksel-icons` ([PR](https://github.com/navikt/aksel/pull/1847))
|
||||
@@ -1,59 +0,0 @@
|
||||
# Aksel icons - Bidrag
|
||||
|
||||
## Foreslå nye ikoner
|
||||
|
||||
Om du ikke finner et ikonet du leter etter kan du [åpne et issue på github](https://github.com/navikt/aksel/issues/new?labels=nytt+✨%2Cikoner+🖼%2Cforespørsel+🥰&template&template=new-icon.yaml&title=%5BNytt+ikon%5D%3A+).
|
||||
|
||||
## Oppdatere ikon
|
||||
|
||||
Hvis du tenker et ikon fortjener en oppdatering eller er utdatert kan [du foreslå det her.](https://github.com/navikt/aksel/issues/new?labels=forespørsel+🥰&template=update-icon.yml&title=%5BInnspill+til+ikon%5D%3A+)
|
||||
|
||||
## Legge til nye ikoner selv
|
||||
|
||||
Hvis du selv ønsker å legge til nye ikoner kan du kopiere filenes fra `/template` og legge de inn i `/icons` med egen data. Alle ikonene har naming-format `PascalCase`. Alle ikonene har 1 SVG-fil og 1 tilhørende YML-fil.
|
||||
|
||||
### Svg
|
||||
|
||||
- Sizing, width og height må være 24x24: `width="24" height="24" `
|
||||
- Viewbox: `viewBox="0 0 24 24"`
|
||||
- Fill på path: `fill="#23262A"`
|
||||
|
||||
### Yml
|
||||
|
||||
```yml
|
||||
name: Template # Samme som filnavn
|
||||
category: Template category # Hovedkategori
|
||||
sub_category: Sub category # Underkategori
|
||||
keywords: # Samling med søkeord
|
||||
- template1
|
||||
- template2
|
||||
- template3
|
||||
variant: Stroke # Stroke eller Fill
|
||||
updated_at: 02.01.2023 # Dato for siste oppdatering
|
||||
created_at: 01.01.2023 # Dato for opprettelse
|
||||
```
|
||||
|
||||
### Publisere oppdatering
|
||||
|
||||
Når du har lagt til nye ikoner kan du opprette en pull request. Denne vil bli automatisk testet og så gått gjennom av Aksel-teamet.
|
||||
Legg gjerne til en `changeset` ved å kjøre `yarn changeset` i terminalen. Dette vil gi oss bedre oversikt over hva som er endret i endringslogger og automatisk bumpe pakke-versjonen ved merge.
|
||||
|
||||
#### Teste nytt ikon
|
||||
|
||||
Hvis du ønsker å teste om alt stemmer, både i `svg` og `yml` før du lager en PR kan du kjøre `yarn && cd navikt/aksel-icons && yarn test` i terminalen lokalt.
|
||||
|
||||
## Design av nye ikoner
|
||||
|
||||
### Generelt
|
||||
|
||||
- Designet følger Keyline-malen (under assets i figma-pakken).
|
||||
- Alle lag og grupper skal bruke `#23262A` for stroke og fill.
|
||||
|
||||
### Stroke (linje)
|
||||
|
||||
- Ikonet må bestå av kun linjer
|
||||
- Linjene skal være 1.5px, center-aligned
|
||||
|
||||
### Fill (fylt)
|
||||
|
||||
- Ikoner hvor shapes kan fylles, bør fylles
|
||||
@@ -1,66 +0,0 @@
|
||||
# Aksel icons
|
||||
|
||||
800+ open source icons made by Aksel, NAVs designsystem-team
|
||||
|
||||
- Designed for 24x24px
|
||||
- Available in React and SVG
|
||||
- Accessible with use of `title`-prop
|
||||
- Suffixed with `Icon`
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
yarn add @navikt/aksel-icons
|
||||
npm install @navikt/aksel-icons
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
For previous users of `@navikt/ds-icons`, this package utilizes the same API. The only difference is that the icons are suffixed with `Icon` to avoid naming conflicts and visual changes to the icons themselves.
|
||||
|
||||
```jsx
|
||||
import { StarIcon } from "@navikt/aksel-icons";
|
||||
|
||||
function App() {
|
||||
return <StarIcon title="star" fontSize="1.5rem" />;
|
||||
}
|
||||
```
|
||||
|
||||
Tip: Use the `title` prop for accessible icons.
|
||||
|
||||
### Sizing
|
||||
|
||||
Each icons `width` and `height` is default `1em`. This allows you to use the native `fontSize`-prop to adjust sizing. We recommend using at least 1.5rem/24px for best possible visual representation.
|
||||
|
||||
```jsx
|
||||
<StarIcon fontSize="1.5rem" />
|
||||
```
|
||||
|
||||
### Direct svg-import
|
||||
|
||||
All icons are available in raw SVG-format behind `/svg`. Note that svg-files do not have the suffix `Icon`.
|
||||
|
||||
```js
|
||||
import StarIcon from "@navikt/aksel-icons/svg/Star.svg";
|
||||
```
|
||||
|
||||
If using typescript, TS might complain about not finding types related to the svg-format. Add a `*.d.ts` file with this declaration to fix this. (This was copied from next/image-types/global.d.ts since next solves this internally, but should work elsewhere)
|
||||
|
||||
```ts
|
||||
declare module "*.svg" {
|
||||
/**
|
||||
* Use `any` to avoid conflicts with
|
||||
* `@svgr/webpack` plugin or
|
||||
* `babel-plugin-inline-react-svg` plugin.
|
||||
*/
|
||||
const content: any;
|
||||
|
||||
export default content;
|
||||
}
|
||||
```
|
||||
|
||||
## [Learn more](https://aksel.nav.no/ikoner)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/navikt/aksel/blob/main/LICENSE)
|
||||
@@ -1,34 +0,0 @@
|
||||
const fastglob = require("fast-glob");
|
||||
const path = require("path");
|
||||
const jsYaml = require("js-yaml");
|
||||
const fs = require("fs");
|
||||
|
||||
const basePath = path.resolve(__dirname, "../icons");
|
||||
|
||||
const ymlList = fastglob
|
||||
.sync("*.yml", { cwd: basePath })
|
||||
.map((fileN) => path.basename(fileN));
|
||||
|
||||
describe(`Each icons YML-config is valid`, () => {
|
||||
ymlList.forEach((file) => {
|
||||
it(`${file} has valid YML-config`, () => {
|
||||
const ymlData = jsYaml.load(fs.readFileSync(`${basePath}/${file}`), {
|
||||
schema: jsYaml.JSON_SCHEMA,
|
||||
});
|
||||
expect(ymlData.name).toBeTruthy();
|
||||
expect(ymlData.category).toBeTruthy();
|
||||
expect(ymlData.sub_category).toBeTruthy();
|
||||
expect(ymlData.keywords).toBeTruthy();
|
||||
expect(ymlData.variant).toBeTruthy();
|
||||
expect(ymlData.keywords.length).toBeGreaterThan(0);
|
||||
expect(ymlData.updated_at).toBeTruthy();
|
||||
expect(isDate(ymlData.updated_at)).toBeTruthy();
|
||||
expect(ymlData.created_at).toBeTruthy();
|
||||
expect(isDate(ymlData.created_at)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function isDate(dateStr) {
|
||||
return !isNaN(new Date(dateStr.split(".").reverse().join(".")).getDate());
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
const fastglob = require("fast-glob");
|
||||
const path = require("path");
|
||||
|
||||
const basePath = path.resolve(__dirname, "../icons");
|
||||
|
||||
const svgList = fastglob
|
||||
.sync("*.svg", { cwd: basePath })
|
||||
.map((fileN) => path.basename(fileN));
|
||||
|
||||
const ymlList = fastglob
|
||||
.sync("*.yml", { cwd: basePath })
|
||||
.map((fileN) => path.basename(fileN));
|
||||
|
||||
describe(`Each SVG-file has a matching YML file`, () => {
|
||||
it(`must have a corresponding YML file`, () => {
|
||||
expect(
|
||||
ymlList
|
||||
.map((yml) => yml.replace(".yml", ".svg"))
|
||||
.filter((file) => !svgList.includes(file))
|
||||
).toStrictEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe(`Each YML-file has a matching SVG file`, () => {
|
||||
it(`must have a corresponding SVG file`, () => {
|
||||
expect(
|
||||
svgList
|
||||
.map((svg) => svg.replace(".svg", ".yml"))
|
||||
.filter((file) => !ymlList.includes(file))
|
||||
).toStrictEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -1,34 +0,0 @@
|
||||
import { parseIcon } from "../config/parse-svg";
|
||||
|
||||
describe(`SVG should be correctly parsed`, () => {
|
||||
const simpleSvg = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="18.1559 9.81056 17.4392Z" fill="#23262A"/>
|
||||
</svg>
|
||||
`;
|
||||
|
||||
const simpleSvgResult = `<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="18.1559 9.81056 17.4392Z" fill="currentColor"/>
|
||||
</svg>
|
||||
`;
|
||||
|
||||
const advancedSvg = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="18.1559 9.81056 17.4392Z" fill="#23262A"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="18.1559 9.81056 17.4392Z" fill="#23262A"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="18.1559 9.81056 17.4392Z" fill="#23262A"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="18.1559 9.81056 17.4392Z" fill="#23262A"/>
|
||||
</svg>
|
||||
`;
|
||||
|
||||
const advancedSvgResult = `<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="18.1559 9.81056 17.4392Z" fill="currentColor"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="18.1559 9.81056 17.4392Z" fill="currentColor"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="18.1559 9.81056 17.4392Z" fill="currentColor"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="18.1559 9.81056 17.4392Z" fill="currentColor"/>
|
||||
</svg>
|
||||
`;
|
||||
|
||||
it("a", () => {
|
||||
expect(parseIcon(simpleSvg)).toEqual(simpleSvgResult);
|
||||
expect(parseIcon(advancedSvg)).toEqual(advancedSvgResult);
|
||||
});
|
||||
});
|
||||
@@ -1,71 +0,0 @@
|
||||
import { basename } from "path";
|
||||
import { unified } from "unified";
|
||||
import parse from "rehype-parse";
|
||||
import fastglob from "fast-glob";
|
||||
import { readFileSync } from "fs";
|
||||
import { select, selectAll } from "hast-util-select";
|
||||
|
||||
const basePath = "./icons";
|
||||
|
||||
const svgList = fastglob
|
||||
.sync("*.svg", { cwd: basePath })
|
||||
.map((fileN) => basename(fileN));
|
||||
|
||||
describe(`Each icons has a valid code`, () => {
|
||||
svgList.forEach((file) => {
|
||||
describe(`${file} has valid code`, () => {
|
||||
const iconAst = unified()
|
||||
.use(parse, { fragment: true, space: "svg" })
|
||||
.parse(readFileSync(`${basePath}/${file}`));
|
||||
|
||||
it(`has valid attributes on root-node`, () => {
|
||||
const properties = Object.keys(
|
||||
select(":root", iconAst).properties
|
||||
).sort();
|
||||
|
||||
expect(properties).toStrictEqual(
|
||||
["viewBox", "xmlns", "height", "width", "fill"].sort()
|
||||
);
|
||||
});
|
||||
|
||||
it(`has valid xml-attr`, () => {
|
||||
const xmlns = select(":root", iconAst).properties.xmlns;
|
||||
expect(xmlns).toBe("http://www.w3.org/2000/svg");
|
||||
});
|
||||
|
||||
it(`has valid viewbox`, () => {
|
||||
const viewbox = select(":root", iconAst).properties.viewBox;
|
||||
expect(viewbox).toBe("0 0 24 24");
|
||||
});
|
||||
|
||||
it(`root fill is none`, () => {
|
||||
const fill = select(":root", iconAst).properties.fill;
|
||||
expect(fill).toBe("none");
|
||||
});
|
||||
|
||||
it(`has valid width and height`, () => {
|
||||
const width = select(":root", iconAst).properties.width;
|
||||
const height = select(":root", iconAst).properties.height;
|
||||
expect(width).toBe("24");
|
||||
expect(height).toBe("24");
|
||||
});
|
||||
|
||||
it(`has valid stroke`, () => {
|
||||
const nodes = selectAll("*", iconAst);
|
||||
|
||||
nodes.forEach((n) => {
|
||||
n.properties?.stroke &&
|
||||
expect(n.properties.stroke).toEqual("#23262A");
|
||||
});
|
||||
});
|
||||
|
||||
it(`has valid stroke-width`, () => {
|
||||
const nodes = selectAll("*", iconAst);
|
||||
nodes.forEach((n) => {
|
||||
n.properties?.strokeWidth &&
|
||||
expect(n.properties?.strokeWidth).toEqual("1.5");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Fikser https://github.com/navikt/aksel/issues/1758
|
||||
*/
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const basePath = "./dist/react/esm";
|
||||
|
||||
const files = fs.readdirSync(basePath).filter((x) => x.endsWith(".d.ts"));
|
||||
|
||||
files.forEach((file) => {
|
||||
let data = fs.readFileSync(`${basePath}/${file}`).toString().split("\n");
|
||||
|
||||
data = data.map((x) => {
|
||||
return x.includes("React.ForwardRefExoticComponent")
|
||||
? x.split(":")[0] +
|
||||
`: React.ForwardRefExoticComponent<React.SVGProps<SVGSVGElement> & SVGRProps & React.RefAttributes<SVGSVGElement>>;`
|
||||
: x;
|
||||
});
|
||||
|
||||
fs.writeFileSync(`${basePath}/${file}`, data.join("\n"));
|
||||
});
|
||||
@@ -1,59 +0,0 @@
|
||||
const file_key = "wEdyFjCQSBR3U7FvrMbPXa";
|
||||
|
||||
export const fetchIcons = async () => {
|
||||
const data = await fetch(
|
||||
`https://api.figma.com/v1/files/${file_key}/components`,
|
||||
{
|
||||
headers: {
|
||||
"Content-type": "application/json",
|
||||
"X-FIGMA-TOKEN": process.env.FIGMA_TOKEN,
|
||||
},
|
||||
}
|
||||
)
|
||||
.then((x) => x.json())
|
||||
.catch((e) => {
|
||||
throw e.message;
|
||||
});
|
||||
|
||||
if (!data?.meta?.components || data?.meta?.components.length === 0) {
|
||||
throw new Error("Fant ingen publiserte ikoner");
|
||||
}
|
||||
|
||||
return data?.meta?.components;
|
||||
};
|
||||
|
||||
export const fetchDownloadUrls = async (idArray) => {
|
||||
const urls = { images: null };
|
||||
|
||||
for (let ids of idArray) {
|
||||
await fetch(
|
||||
`https://api.figma.com/v1/images/${file_key}/?ids=${ids}&format=svg`,
|
||||
{
|
||||
headers: {
|
||||
"Content-type": "application/json",
|
||||
"X-FIGMA-TOKEN": process.env.FIGMA_TOKEN,
|
||||
},
|
||||
}
|
||||
)
|
||||
.then((x) => x.json())
|
||||
.then((x) => {
|
||||
urls.images = {
|
||||
...urls.images,
|
||||
...x.images,
|
||||
};
|
||||
})
|
||||
.catch((e) => {
|
||||
throw e.message;
|
||||
});
|
||||
}
|
||||
return urls;
|
||||
};
|
||||
|
||||
export const fetchIcon = async (url) => {
|
||||
return await fetch(url)
|
||||
.then((x) => x.text())
|
||||
.catch((e) => {
|
||||
console.log("Error fetching icon: ", e.message);
|
||||
throw e.message;
|
||||
});
|
||||
};
|
||||
@@ -1,15 +0,0 @@
|
||||
import startCase from "lodash.startcase";
|
||||
import camelCase from "lodash.camelCase";
|
||||
|
||||
export const resolveName = (icon) => {
|
||||
const isVariant = icon.name.startsWith("Variant=");
|
||||
|
||||
if (isVariant) {
|
||||
const variant = icon.name.replace("Variant=", "").replace("Stroke", "");
|
||||
const actualName = icon["containing_frame"]?.["containingStateGroup"]?.name;
|
||||
const name = `${actualName}${variant}`;
|
||||
return `${startCase(camelCase(name)).replace(/ /g, "")}.svg`;
|
||||
}
|
||||
|
||||
return `${startCase(camelCase(icon.name)).replace(/ /g, "")}.svg`;
|
||||
};
|
||||
@@ -1,64 +0,0 @@
|
||||
import { config } from "dotenv";
|
||||
import { fetchIcons, fetchDownloadUrls, fetchIcon } from "./fetch-icons.mjs";
|
||||
import { makeConfig } from "./make-configs.mjs";
|
||||
import { existsSync, writeFileSync, mkdirSync, rmSync, readdirSync } from "fs";
|
||||
import { resolve } from "path";
|
||||
import { resolveName } from "./icon-name.mjs";
|
||||
import { paginate } from "./paginate.mjs";
|
||||
config();
|
||||
/* https://www.figma.com/file/wEdyFjCQSBR3U7FvrMbPXa/Core-Icons-Next?node-id=277%3A1221&t=mUJzFvnsceYYXNL5-0 */
|
||||
|
||||
const iconFolder = "./icons";
|
||||
|
||||
if (!process.env.FIGMA_TOKEN) {
|
||||
throw new Error("FIGMA_TOKEN not set in .env");
|
||||
}
|
||||
|
||||
async function main() {
|
||||
let icons = await fetchIcons();
|
||||
|
||||
const totalIcons = icons.length;
|
||||
|
||||
const { images } = await fetchDownloadUrls(
|
||||
paginate(
|
||||
icons.map((x) => x.node_id),
|
||||
400
|
||||
).map((x) => x.join(","))
|
||||
);
|
||||
|
||||
if (existsSync(iconFolder)) {
|
||||
rmSync(iconFolder, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
mkdirSync(iconFolder);
|
||||
|
||||
console.log(`Laster ned ${Object.keys(images).length} ikoner`);
|
||||
|
||||
for (const [key, value] of Object.entries(images)) {
|
||||
const icon = await fetchIcon(value).catch((e) => {
|
||||
throw e;
|
||||
});
|
||||
await new Promise((r) => setTimeout(r, 20));
|
||||
|
||||
icon &&
|
||||
writeFileSync(
|
||||
resolve(iconFolder, resolveName(icons.find((x) => x.node_id === key))),
|
||||
icon,
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
makeConfig(icons, iconFolder);
|
||||
|
||||
readdirSync(iconFolder, (_, files) => {
|
||||
if (files.length * 2 !== totalIcons) {
|
||||
throw new Error(`Ikoner mangler!`);
|
||||
}
|
||||
});
|
||||
|
||||
console.log(`Success! ${Object.keys(images).length} ikoner lastet ned`);
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -1,36 +0,0 @@
|
||||
import { writeFileSync } from "fs";
|
||||
import jsYaml from "js-yaml";
|
||||
import { resolve } from "path";
|
||||
import { resolveName } from "./icon-name.mjs";
|
||||
|
||||
export const makeConfig = (icons, folder) => {
|
||||
icons.forEach((icon) => {
|
||||
const config = {
|
||||
name: resolveName(icon).replace(".svg", ""),
|
||||
category: icon.containing_frame.pageName,
|
||||
sub_category: icon.containing_frame.name,
|
||||
keywords: [...icon.description.split(",").map((x) => x.trim())],
|
||||
variant: icon.name.includes("Variant=")
|
||||
? icon.name.replace("Variant=", "")
|
||||
: "Stroke",
|
||||
updated_at: new Date(icon.updated_at)
|
||||
.toISOString()
|
||||
.split("T")[0]
|
||||
.split("-")
|
||||
.reverse()
|
||||
.join("."),
|
||||
created_at: new Date(icon.created_at)
|
||||
.toISOString()
|
||||
.split("T")[0]
|
||||
.split("-")
|
||||
.reverse()
|
||||
.join("."),
|
||||
};
|
||||
|
||||
const yml = jsYaml.dump(config, { noRefs: true, skipInvalid: false });
|
||||
|
||||
writeFileSync(resolve(folder, `${config.name}.yml`), yml, {
|
||||
encoding: "utf8",
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
export function paginate(arr, size) {
|
||||
return arr.reduce((acc, val, i) => {
|
||||
let idx = Math.floor(i / size);
|
||||
let page = acc[idx] || (acc[idx] = []);
|
||||
page.push(val);
|
||||
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
const path = require("path");
|
||||
|
||||
const defaultIndexTemplate = (paths) => {
|
||||
const exportEntries = paths.map((filePath) => {
|
||||
const basename = path.basename(filePath, path.extname(filePath));
|
||||
return `export { default as ${basename}Icon } from './${basename}'`;
|
||||
});
|
||||
|
||||
return exportEntries.join("\n");
|
||||
};
|
||||
|
||||
module.exports = defaultIndexTemplate;
|
||||
@@ -1,50 +0,0 @@
|
||||
const fastglob = require("fast-glob");
|
||||
const path = require("path");
|
||||
const jsYaml = require("js-yaml");
|
||||
const fs = require("fs");
|
||||
|
||||
const basePath = path.resolve(__dirname, "../icons");
|
||||
|
||||
const ymlList = fastglob
|
||||
.sync("*.yml", { cwd: basePath })
|
||||
.map((fileN) => path.basename(fileN));
|
||||
|
||||
const metadata = {};
|
||||
|
||||
ymlList.forEach((file) => {
|
||||
const ymlData = jsYaml.load(fs.readFileSync(`${basePath}/${file}`), {
|
||||
schema: jsYaml.JSON_SCHEMA,
|
||||
});
|
||||
const iconName = file.replace(".yml", "");
|
||||
metadata[iconName] = { id: iconName, ...ymlData };
|
||||
});
|
||||
|
||||
fs.writeFileSync(
|
||||
path.resolve(__dirname, "../dist/metadata.js"),
|
||||
`const metadata = ${JSON.stringify(metadata)};\n\n module.exports = metadata;`
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
path.resolve(__dirname, "../dist/metadata.mjs"),
|
||||
`const metadata = ${JSON.stringify(metadata)};\n\n export default metadata;`
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
path.resolve(__dirname, "../dist/metadata.d.ts"),
|
||||
`export type AkselIcon = {
|
||||
id: string;
|
||||
name: string;
|
||||
category: string;
|
||||
sub_category: "Time",
|
||||
keywords: string[];
|
||||
variant: "stroke" | "fill";
|
||||
updated_at: Date;
|
||||
created_at: Date;
|
||||
}
|
||||
|
||||
declare const metadata: {
|
||||
[iconId: string]: AkselIcon;
|
||||
};
|
||||
|
||||
export default metadata;`
|
||||
);
|
||||
@@ -1,42 +0,0 @@
|
||||
const fastglob = require("fast-glob");
|
||||
const path = require("path");
|
||||
const {
|
||||
existsSync,
|
||||
readFileSync,
|
||||
mkdirSync,
|
||||
rmSync,
|
||||
writeFileSync,
|
||||
} = require("fs");
|
||||
|
||||
function main() {
|
||||
const basePath = path.resolve(__dirname, "../icons");
|
||||
const iconFolder = path.resolve(__dirname, "../dist/svg");
|
||||
|
||||
const svgList = fastglob.sync("*.svg", { cwd: basePath });
|
||||
|
||||
if (existsSync(iconFolder)) {
|
||||
rmSync(iconFolder, { recursive: true, force: true });
|
||||
}
|
||||
mkdirSync(iconFolder);
|
||||
|
||||
svgList.forEach((svg) => {
|
||||
const icon = readFileSync(`${basePath}/${svg}`).toString();
|
||||
writeFileSync(`${iconFolder}/${svg}`, parseIcon(icon));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} SVG-string
|
||||
* @returns {string} Parsed SVG-string
|
||||
*/
|
||||
function parseIcon(svgString) {
|
||||
let icon = svgString;
|
||||
icon = icon.replace(`width="24"`, `width="1em"`);
|
||||
icon = icon.replace(`height="24"`, `height="1em"`);
|
||||
icon = icon.replaceAll(`#23262A`, `currentColor`);
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
module.exports = { parseIcon, main };
|
||||
@@ -1,62 +0,0 @@
|
||||
const AdmZip = require("adm-zip");
|
||||
const {
|
||||
existsSync,
|
||||
readFileSync,
|
||||
mkdirSync,
|
||||
rmSync,
|
||||
copyFileSync,
|
||||
} = require("fs");
|
||||
const path = require("path");
|
||||
const fastGlob = require("fast-glob");
|
||||
const jsYaml = require("js-yaml");
|
||||
|
||||
const iconFolder = "./core-icons";
|
||||
|
||||
async function generateFile() {
|
||||
if (existsSync(iconFolder)) {
|
||||
rmSync(iconFolder, { recursive: true, force: true });
|
||||
}
|
||||
mkdirSync(iconFolder);
|
||||
|
||||
const basePath = path.resolve(__dirname, "../icons");
|
||||
|
||||
const ymlList = fastGlob
|
||||
.sync("*.yml", { cwd: basePath })
|
||||
.map((fileN) => path.basename(fileN));
|
||||
const categories = new Map();
|
||||
|
||||
ymlList.forEach((file) => {
|
||||
const ymlData = jsYaml.load(readFileSync(`${basePath}/${file}`), {
|
||||
schema: jsYaml.JSON_SCHEMA,
|
||||
});
|
||||
categories.set(
|
||||
ymlData.category,
|
||||
categories.get(ymlData.category)
|
||||
? [...categories.get(ymlData.category), ymlData.name]
|
||||
: [ymlData.name]
|
||||
);
|
||||
});
|
||||
|
||||
categories.forEach((value, key) => {
|
||||
mkdirSync(`${iconFolder}/${key}`);
|
||||
value.forEach((icon) =>
|
||||
copyFileSync(
|
||||
`${basePath}/${icon}.svg`,
|
||||
`${iconFolder}/${key}/${icon}.svg`
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
async function createZipArchive() {
|
||||
const zip = new AdmZip();
|
||||
const outputFile = "aksel-icons.zip";
|
||||
|
||||
await generateFile();
|
||||
|
||||
zip.addLocalFolder("./core-icons");
|
||||
zip.writeZip(outputFile);
|
||||
console.log(`Created ${outputFile} successfully`);
|
||||
}
|
||||
|
||||
createZipArchive();
|
||||
@@ -1,26 +0,0 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
!src
|
||||
!*.d.ts
|
||||
@@ -1,22 +0,0 @@
|
||||

|
||||
|
||||
# Aksel Icons plugin
|
||||
|
||||
Pluginen gir deg mulighet til å se gjennom og hente ut alle ikonene i fra ikonpakken `@navikt/aksel-icons`. Du slipper da å hente nye oppdateringer fra Figma Community.
|
||||
|
||||
Referer til [ikon-dokumentasjonen](https://aksel.nav.no/ikoner) for å se alle ikonene.
|
||||
Har du ønsker om nye ikoner, eller ønsker å bidra med å lage nye, lag et issue på [GitHub-repoet for designsystemet](https://github.com/navikt/aksel).
|
||||
|
||||
## Quickstart
|
||||
|
||||
- `yarn dev` for development
|
||||
- `yarn build` for production-build
|
||||
|
||||
### Test with Figma
|
||||
|
||||
- Open `Figma` -> `Plugins` -> `Development` -> `Import plugin from manifest...` and choose `manifest.json` file from this repo.
|
||||
|
||||
### Publish to Figma
|
||||
|
||||
- Open `Figma` -> `Plugins` -> `Find more plugins` -> `Publish new versions`
|
||||
(requires publish-access)
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"name": "Aksel Icons",
|
||||
"id": "1221057403873975172",
|
||||
"api": "1.0.0",
|
||||
"main": "dist/plugin.js",
|
||||
"ui": "dist/index.html",
|
||||
"capabilities": [],
|
||||
"enableProposedApi": false,
|
||||
"editorType": ["figma", "figjam"]
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"name": "aksel-icons-figma-plugin",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite -c ./vite.config.ui.ts",
|
||||
"build:icon-plugin": "tsc && npm run build:ui && npm run build:plugin",
|
||||
"build:ui": "vite build -c ./vite.config.ui.ts --emptyOutDir",
|
||||
"build:plugin": "vite build -c ./vite.config.plugin.ts",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@navikt/ds-css": "*",
|
||||
"@navikt/ds-react": "*",
|
||||
"fuse.js": "^6.6.2",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@figma/plugin-typings": "^1.62.0",
|
||||
"@svgr/core": "^6.5.1",
|
||||
"@types/node": "^18.15.11",
|
||||
"@types/postcss-url": "^10.0.0",
|
||||
"@types/react": "^18.0.0",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
"@vitejs/plugin-react": "^3.1.0",
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-url": "^10.1.3",
|
||||
"typescript": "^5.1.6",
|
||||
"vite": "^4.2.0",
|
||||
"vite-plugin-singlefile": "^0.13.3",
|
||||
"vite-plugin-svgr": "^2.4.0"
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
import fs from "fs";
|
||||
import { Plugin } from "vite";
|
||||
|
||||
function svgToDataURL(svgStr: string) {
|
||||
const encoded = encodeURIComponent(svgStr)
|
||||
.replace(/'/g, "%27")
|
||||
.replace(/"/g, "%22");
|
||||
|
||||
const header = "data:image/svg+xml,";
|
||||
const dataUrl = header + encoded;
|
||||
|
||||
return dataUrl;
|
||||
}
|
||||
|
||||
export default function (): Plugin {
|
||||
return {
|
||||
name: "vite-inline-svg",
|
||||
enforce: "pre",
|
||||
|
||||
async load(id) {
|
||||
const [path, query] = id.split("?", 2);
|
||||
|
||||
if (!path.endsWith(".svg")) return;
|
||||
if (query !== "inline") return;
|
||||
|
||||
const svg = await fs.promises.readFile(path, "utf-8");
|
||||
return `export default "${svgToDataURL(svg)}"`;
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
import { createFilter, FilterPattern } from "@rollup/pluginutils";
|
||||
import type { Config } from "@svgr/core";
|
||||
import fs from "fs";
|
||||
import type { Plugin } from "vite";
|
||||
import { transformWithEsbuild } from "vite";
|
||||
|
||||
export interface ViteSvgrOptions {
|
||||
svgrOptions?: Config;
|
||||
esbuildOptions?: Parameters<typeof transformWithEsbuild>[2];
|
||||
exclude?: FilterPattern;
|
||||
include?: FilterPattern;
|
||||
}
|
||||
|
||||
export default function viteSvgr({
|
||||
svgrOptions,
|
||||
esbuildOptions,
|
||||
include = "**/*.svg?component",
|
||||
exclude,
|
||||
}: ViteSvgrOptions = {}): Plugin {
|
||||
const filter = createFilter(include, exclude);
|
||||
|
||||
return {
|
||||
name: "vite-svgr-component",
|
||||
|
||||
async transform(code, id) {
|
||||
if (filter(id)) {
|
||||
const { transform } = await import("@svgr/core");
|
||||
const svgCode = await fs.promises.readFile(
|
||||
id.replace(/\?.*$/, ""),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
const componentCode = await transform(svgCode, svgrOptions, {
|
||||
filePath: id,
|
||||
caller: { previousExport: null },
|
||||
});
|
||||
|
||||
const res = await transformWithEsbuild(componentCode, id, {
|
||||
loader: "jsx",
|
||||
...esbuildOptions,
|
||||
});
|
||||
|
||||
return {
|
||||
code: res.code,
|
||||
map: null,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,4 +0,0 @@
|
||||
<svg width="32" height="32" viewBox="0 0 170 170" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.07318 54.5734C-0.692218 51.806 -0.690888 47.3204 2.07614 44.5546L38.6019 8.04512C38.7787 7.8684 38.9576 7.69433 39.1387 7.52295L39.1205 7.50476C42.7235 3.90124 47.1588 1.63753 51.8075 0.71364C53.8316 0.243049 55.9182 1.07479e-05 58.0297 1.01387e-05L142.517 0C157.695 5.55246e-06 170 12.3065 170 27.4874V111.958C170 113.916 169.791 115.852 169.386 117.737C168.522 122.523 166.241 127.103 162.542 130.803L162.533 130.794C162.342 130.997 162.148 131.197 161.95 131.395L125.425 167.925C122.659 170.692 118.174 170.692 115.408 167.925C112.642 165.158 112.642 160.673 115.408 157.906L151.933 121.376C153.698 119.61 154.917 117.4 155.48 115.008C155.999 111.779 155.014 108.355 152.525 105.866L64.1955 17.5236C61.632 14.9597 58.0865 13.9765 54.7698 14.574C52.4605 15.1572 50.3292 16.3547 48.6162 18.0669L12.0905 54.5764C9.32349 57.3422 4.83857 57.3409 2.07318 54.5734ZM80.8759 14.1688L155.833 89.1374V27.4874C155.833 20.1317 149.871 14.1688 142.517 14.1688L80.8759 14.1688Z" fill="#004367"/>
|
||||
<path d="M2.07466 167.925C-0.691554 165.158 -0.691554 160.673 2.07466 157.906L65.8247 94.1468C68.5909 91.3801 73.0758 91.3801 75.842 94.1468C78.6082 96.9134 78.6082 101.399 75.842 104.166L12.092 167.925C9.32579 170.692 4.84087 170.692 2.07466 167.925Z" fill="#004367"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,46 +0,0 @@
|
||||
figma.showUI(__html__, { width: 480, height: 600 });
|
||||
|
||||
figma.ui.onmessage = (msg) => {
|
||||
if (msg.type === "create-icon") {
|
||||
const nodes = [];
|
||||
|
||||
const icon = figma.createNodeFromSvg(msg.svg);
|
||||
icon.name = msg.name;
|
||||
icon.resize(msg.size, msg.size);
|
||||
nodes.push(icon);
|
||||
|
||||
figma.currentPage.appendChild(icon);
|
||||
|
||||
figma.viewport.scrollAndZoomIntoView(nodes);
|
||||
|
||||
figma.ui.postMessage({
|
||||
type: "create-icon",
|
||||
message: `Created ${msg.name} icon}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// https://github.com/figma/plugin-samples#icon-drag-and-drop
|
||||
figma.on("drop", (event) => {
|
||||
const { files, node } = event;
|
||||
|
||||
if (files.length > 0 && files[0].type === "image/svg+xml") {
|
||||
files[0].getTextAsync().then((text) => {
|
||||
const newNode = figma.createNodeFromSvg(text);
|
||||
newNode.name = `${files[0].name.replace(".svg", "")}Icon`;
|
||||
newNode.resize(24, 24);
|
||||
|
||||
// We can only append page nodes to documents
|
||||
if ("appendChild" in node && node.type !== "DOCUMENT") {
|
||||
node.appendChild(newNode);
|
||||
}
|
||||
|
||||
newNode.x = event.x;
|
||||
newNode.y = event.y;
|
||||
|
||||
figma.currentPage.selection = [newNode];
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@@ -1,193 +0,0 @@
|
||||
/* eslint-disable react/react-in-jsx-scope */
|
||||
import { Heading, Search, ToggleGroup } from "@navikt/ds-react";
|
||||
import Fuse from "fuse.js";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import * as Icons from "../../../";
|
||||
import meta from "../../../dist/metadata";
|
||||
import "./app.css";
|
||||
import { categorizeIcons, getFillIcon } from "./utils";
|
||||
|
||||
const fuseStroke = new Fuse(
|
||||
Object.values(meta).filter((x) => x.variant.toLowerCase() === "stroke"),
|
||||
{
|
||||
threshold: 0.2,
|
||||
keys: [
|
||||
{ name: "name", weight: 3 },
|
||||
{ name: "category", weight: 2 },
|
||||
{ name: "sub_category", weight: 2 },
|
||||
{ name: "keywords", weight: 3 },
|
||||
{ name: "variant", weight: 1 },
|
||||
],
|
||||
shouldSort: false,
|
||||
}
|
||||
);
|
||||
|
||||
const fuseFill = new Fuse(getFillIcon(Object.values(meta)), {
|
||||
threshold: 0.2,
|
||||
keys: [
|
||||
{ name: "name", weight: 3 },
|
||||
{ name: "category", weight: 2 },
|
||||
{ name: "sub_category", weight: 2 },
|
||||
{ name: "keywords", weight: 3 },
|
||||
{ name: "variant", weight: 1 },
|
||||
],
|
||||
shouldSort: false,
|
||||
});
|
||||
|
||||
const App = () => {
|
||||
const [query, setQuery] = useState("");
|
||||
const [toggle, setToggle] = useState<"stroke" | "fill">("stroke");
|
||||
|
||||
const [strokeIcons] = useState(
|
||||
Object.values(meta).filter((x) => x.variant.toLowerCase() === "stroke")
|
||||
);
|
||||
|
||||
const [fillIcons] = useState(getFillIcon(Object.values(meta)));
|
||||
|
||||
const categories = useMemo(() => {
|
||||
if (toggle === "fill") {
|
||||
return categorizeIcons(
|
||||
query
|
||||
? fuseFill.search(query).map((result) => result.item as any)
|
||||
: fillIcons
|
||||
);
|
||||
}
|
||||
return categorizeIcons(
|
||||
query
|
||||
? fuseStroke.search(query).map((result) => result.item as any)
|
||||
: strokeIcons
|
||||
);
|
||||
}, [toggle, query, strokeIcons, fillIcons]);
|
||||
|
||||
const onCreate = (id: string, name: string) => {
|
||||
const svg = document.getElementById(id)?.outerHTML;
|
||||
const size = 24;
|
||||
parent.postMessage(
|
||||
{
|
||||
pluginMessage: {
|
||||
type: "create-icon",
|
||||
svg,
|
||||
size,
|
||||
name,
|
||||
},
|
||||
},
|
||||
"*"
|
||||
);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const dragEvent = (e) => {
|
||||
// Don't proceed if the item was dropped inside the plugin window.
|
||||
if (e.view.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const file = new File([e.target.innerHTML], `${e.target.id}.svg`, {
|
||||
type: "image/svg+xml",
|
||||
});
|
||||
|
||||
window.parent.postMessage(
|
||||
{
|
||||
pluginDrop: {
|
||||
clientX: e.clientX,
|
||||
clientY: e.clientY,
|
||||
files: [file],
|
||||
name: e.target.id,
|
||||
},
|
||||
},
|
||||
"*"
|
||||
);
|
||||
};
|
||||
|
||||
const icons = document.getElementsByClassName("icon-classname");
|
||||
for (const icon of icons) {
|
||||
icon.addEventListener("dragend", dragEvent);
|
||||
}
|
||||
|
||||
return () => {
|
||||
for (const icon of icons) {
|
||||
icon.removeEventListener("dragend", dragEvent);
|
||||
}
|
||||
};
|
||||
}, [categories]);
|
||||
|
||||
return (
|
||||
<main tabIndex={-1} className="wrapper">
|
||||
<form onSubmit={(e) => e.preventDefault()} className="form">
|
||||
<div className="form-togglegroup">
|
||||
<ToggleGroup
|
||||
value={toggle}
|
||||
onChange={(v) => setToggle(v as any)}
|
||||
variant="neutral"
|
||||
>
|
||||
<ToggleGroup.Item value="stroke">Stroke</ToggleGroup.Item>
|
||||
<ToggleGroup.Item value="fill">Fill</ToggleGroup.Item>
|
||||
</ToggleGroup>
|
||||
</div>
|
||||
<div className="form-search">
|
||||
<Search
|
||||
variant="simple"
|
||||
label="Ikonsøk"
|
||||
style={{ border: "none" }}
|
||||
placeholder="Søk"
|
||||
autoComplete="off"
|
||||
onChange={setQuery}
|
||||
value={query}
|
||||
clearButton={false}
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div className="categories">
|
||||
{categories.map((cat) => {
|
||||
return (
|
||||
<div key={cat.category}>
|
||||
<Heading level="2" size="small" spacing>
|
||||
{cat.category}
|
||||
</Heading>
|
||||
<div className="sub-categories">
|
||||
{cat.sub_categories.map((sub) => {
|
||||
return (
|
||||
<div key={sub.sub_category}>
|
||||
<Heading level="3" size="xsmall" className="sub-heading">
|
||||
{sub.sub_category}
|
||||
</Heading>
|
||||
<div className="icons-wrapper">
|
||||
{sub.icons.map((i) => {
|
||||
const T = Icons[`${i.id}Icon`]; // eslint-disable-line import/namespace
|
||||
if (T === undefined) {
|
||||
console.log(i);
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<button
|
||||
key={i.id}
|
||||
id={i.id}
|
||||
onClick={() => {
|
||||
onCreate(`icon-id-${i.id}`, `${i.id}Icon`);
|
||||
}}
|
||||
draggable="true"
|
||||
className="icon-classname icon-button"
|
||||
>
|
||||
<T
|
||||
font-size="2rem"
|
||||
title={i.id}
|
||||
id={`icon-id-${i.id}`}
|
||||
/>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
@@ -1,79 +0,0 @@
|
||||
@import "@navikt/ds-css";
|
||||
|
||||
.wrapper {
|
||||
background-color: var(--a-bg-default);
|
||||
}
|
||||
|
||||
.form {
|
||||
border-bottom: 1px solid var(--a-border-subtle);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: fit-content;
|
||||
width: 100%;
|
||||
gap: 1rem;
|
||||
padding-block: 0.5rem;
|
||||
padding-inline: 1rem;
|
||||
background-color: var(--a-bg-default);
|
||||
}
|
||||
|
||||
.form-togglegroup {
|
||||
min-width: 10rem;
|
||||
}
|
||||
|
||||
.form-search {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.categories {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
place-content: start;
|
||||
gap: 2rem;
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.sub-categories {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.sub-heading {
|
||||
color: var(--a-text-subtle);
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.icons-wrapper {
|
||||
gap: 0.125rem;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.icon-button {
|
||||
min-height: 3rem;
|
||||
min-width: 3rem;
|
||||
border-radius: var(--a-border-radius-small);
|
||||
display: grid;
|
||||
place-content: center;
|
||||
background-color: var(--a-surface-default);
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.icon-button:hover {
|
||||
background-color: var(--a-surface-hover);
|
||||
}
|
||||
|
||||
.icon-button:active {
|
||||
background-color: var(--a-surface-neutral-subtle-hover);
|
||||
}
|
||||
|
||||
.icon-button:focus-visible {
|
||||
outline: 2px solid var(--a-border-focus);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Aksel icons</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="./main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,9 +0,0 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import App from "./App";
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
@@ -1,56 +0,0 @@
|
||||
import meta from "@navikt/aksel-icons/metadata";
|
||||
|
||||
const subCategorizeIcons = (
|
||||
icons: (typeof meta)[1][]
|
||||
): { sub_category: string; icons: (typeof meta)[1][] }[] => {
|
||||
const categories: { sub_category: string; icons: (typeof meta)[1][] }[] = [];
|
||||
|
||||
for (const icon of icons) {
|
||||
const i = categories.findIndex(
|
||||
({ sub_category }) => icon.sub_category === sub_category
|
||||
);
|
||||
i !== -1
|
||||
? categories[i].icons.push(icon)
|
||||
: categories.push({ sub_category: icon.sub_category, icons: [icon] });
|
||||
}
|
||||
return categories.sort((a, b) =>
|
||||
a.sub_category.localeCompare(b.sub_category)
|
||||
);
|
||||
};
|
||||
|
||||
export const categorizeIcons = (
|
||||
icons: (typeof meta)[1][]
|
||||
): {
|
||||
category: string;
|
||||
sub_categories: { sub_category: string; icons: (typeof meta)[1][] }[];
|
||||
}[] => {
|
||||
const categories: {
|
||||
category: string;
|
||||
icons: (typeof meta)[1][];
|
||||
}[] = [];
|
||||
|
||||
for (const icon of icons) {
|
||||
const i = categories.findIndex(
|
||||
({ category }) => icon.category === category
|
||||
);
|
||||
i !== -1
|
||||
? categories[i].icons.push(icon)
|
||||
: categories.push({ category: icon.category, icons: [icon] });
|
||||
}
|
||||
return categories
|
||||
.sort((a, b) => a.category.localeCompare(b.category))
|
||||
.map((x) => ({ ...x, sub_categories: subCategorizeIcons(x.icons) }));
|
||||
};
|
||||
|
||||
const noFill = (icon: (typeof meta)[1], icons: (typeof meta)[1][]) => {
|
||||
const foundFill = icons.find(
|
||||
(x) => x.name.endsWith("Fill") && x.name.replace("Fill", "") === icon.name
|
||||
);
|
||||
return !foundFill;
|
||||
};
|
||||
|
||||
export const getFillIcon = (icons: (typeof meta)[1][]) => {
|
||||
return icons.filter(
|
||||
(x, _, z) => x.variant.toLowerCase() === "fill" || noFill(x, z)
|
||||
);
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
declare module "*.svg?component" {
|
||||
import * as React from "react";
|
||||
|
||||
const ReactComponent: React.FunctionComponent<
|
||||
React.ComponentProps<"svg"> & { title?: string }
|
||||
>;
|
||||
|
||||
export default ReactComponent;
|
||||
}
|
||||
|
||||
declare module "**/metadata.mjs" {
|
||||
export type AkselIcon = {
|
||||
id: string;
|
||||
name: string;
|
||||
category: string;
|
||||
sub_category: "Time";
|
||||
keywords: string[];
|
||||
variant: "stroke" | "fill";
|
||||
updated_at: Date;
|
||||
created_at: Date;
|
||||
};
|
||||
|
||||
declare const metadata: {
|
||||
[iconId: string]: AkselIcon;
|
||||
};
|
||||
|
||||
export default metadata;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "CommonJS",
|
||||
"allowJs": false,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "Node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": false,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"rootDir": ".",
|
||||
"baseUrl": ".",
|
||||
"outDir": "dist/",
|
||||
"sourceMap": false,
|
||||
"noImplicitAny": false,
|
||||
"types": ["@figma/plugin-typings"]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.d.ts",
|
||||
"src/**/*.d.ts",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.js",
|
||||
"src/**/*.jsx"
|
||||
],
|
||||
"exclude": ["src/common/**/*"]
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": [
|
||||
"vite.config.plugin.ts",
|
||||
"vite.config.ui.ts",
|
||||
"./scripts/vite/*.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import path from "path";
|
||||
import { defineConfig } from "vite";
|
||||
import { viteSingleFile } from "vite-plugin-singlefile";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [viteSingleFile()],
|
||||
build: {
|
||||
lib: {
|
||||
name: "Aksel Icons",
|
||||
entry: path.resolve(__dirname, "./src/plugin/plugin.ts"),
|
||||
fileName: "plugin",
|
||||
formats: ["es"],
|
||||
},
|
||||
emptyOutDir: false,
|
||||
outDir: path.resolve(__dirname, "./dist"),
|
||||
},
|
||||
});
|
||||
@@ -1,25 +0,0 @@
|
||||
import { defineConfig } from "vite";
|
||||
import path from "path";
|
||||
|
||||
import { viteSingleFile } from "vite-plugin-singlefile";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
import inlineSvg from "./scripts/vite/vite-inline-svg";
|
||||
import svgComponent from "./scripts/vite/vite-svgr-component";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react(), svgComponent(), inlineSvg(), viteSingleFile()],
|
||||
root: path.resolve(__dirname, "./src/ui/"),
|
||||
build: {
|
||||
outDir: path.resolve(__dirname, "./dist"),
|
||||
rollupOptions: {
|
||||
input: {
|
||||
ui: path.relative(__dirname, "./src/ui/index.html"),
|
||||
},
|
||||
output: {
|
||||
entryFileNames: "[name].js",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -1,64 +0,0 @@
|
||||
import * as AkselIcons from "@navikt/aksel-icons";
|
||||
import { StarFillIcon } from "@navikt/aksel-icons";
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
import React from "react";
|
||||
|
||||
const meta = {
|
||||
title: "aksel-icons/Icons",
|
||||
} satisfies Meta<typeof StarFillIcon>;
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Icons: Story = {
|
||||
render: () => {
|
||||
return (
|
||||
<div className="icons">
|
||||
{Object.entries(AkselIcons).map(([key, Value]) => (
|
||||
<React.Fragment key={key}>
|
||||
<Value fontSize="3rem" aria-hidden title={key} />
|
||||
</React.Fragment>
|
||||
))}
|
||||
<style>
|
||||
{`
|
||||
.icons{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const IconsInverted: Story = {
|
||||
render: () => {
|
||||
return (
|
||||
<div className="icons">
|
||||
{Object.entries(AkselIcons).map(([key, Value]) => (
|
||||
<React.Fragment key={key}>
|
||||
<Value
|
||||
fontSize="3rem"
|
||||
aria-hidden
|
||||
title={key}
|
||||
className="icon-color"
|
||||
/>
|
||||
</React.Fragment>
|
||||
))}
|
||||
<style>
|
||||
{`
|
||||
.icons{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
background: var(--a-gray-900);
|
||||
}
|
||||
.icon-color{
|
||||
color: var(--a-icon-on-inverted);
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.38832 3.62499C6.15657 3.69144 5.9709 3.86524 5.88931 4.0921C5.80771 4.31895 5.84014 4.5712 5.97647 4.77004L8.36835 8.25872L8.11301 8.33194L5.79544 6.68857C5.60958 6.55678 5.3739 6.51662 5.15489 6.57942L3.23236 7.13069C2.97861 7.20346 2.7818 7.40426 2.71414 7.65943C2.64649 7.91459 2.71796 8.18653 2.90233 8.37546L5.97257 11.5216C7.44996 13.0355 9.63928 13.6159 11.6727 13.0329L20.337 10.5484C21.3272 10.2645 21.5682 8.97202 20.747 8.35025L19.1525 7.14299C17.9605 6.24051 16.4131 5.95191 14.976 6.36402L13.4288 6.80766L8.98964 3.21187C8.79947 3.05782 8.5461 3.00626 8.31084 3.07372L6.38832 3.62499ZM8.17996 9.87319L9.26244 9.5628L9.55282 9.98633C9.78704 10.328 10.2539 10.415 10.5955 10.1808C10.9371 9.94658 11.0242 9.47976 10.79 9.13813L7.80203 4.78006L8.34893 4.62324L12.7881 8.21903C12.9783 8.37308 13.2316 8.42464 13.4669 8.35719L15.3894 7.80591C16.3728 7.52394 17.4315 7.72141 18.247 8.33889L19.4429 9.24433L11.2592 11.591C9.75627 12.0219 8.13808 11.5929 7.04609 10.4739L4.85284 8.22648L5.22184 8.12067L7.53941 9.76404C7.72527 9.89583 7.96095 9.93599 8.17996 9.87319ZM9.81056 17.4392C9.7791 17.4038 9.74692 17.3691 9.71403 17.335C10.473 16.6649 11.8213 15.75 13.4998 15.75C16.5856 15.75 18.2498 17.9142 18.2498 20C18.2498 20.4142 18.5856 20.75 18.9998 20.75C19.414 20.75 19.7498 20.4142 19.7498 20C19.7498 17.0858 17.414 14.25 13.4998 14.25C11.0483 14.25 9.2246 15.7083 8.41735 16.4919C7.99415 16.3357 7.52002 16.25 7 16.25C5.79648 16.25 4.83873 16.7088 4.18944 17.4392C3.55242 18.1559 3.25 19.0902 3.25 20C3.25 20.4142 3.58579 20.75 4 20.75C4.41421 20.75 4.75 20.4142 4.75 20C4.75 19.4098 4.94758 18.8441 5.31056 18.4358C5.66127 18.0412 6.20352 17.75 7 17.75C7.79648 17.75 8.33873 18.0412 8.68944 18.4358C9.05242 18.8441 9.25 19.4098 9.25 20C9.25 20.4142 9.58579 20.75 10 20.75C10.4142 20.75 10.75 20.4142 10.75 20C10.75 19.0902 10.4476 18.1559 9.81056 17.4392Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.0 KiB |
@@ -1,10 +0,0 @@
|
||||
name: Airplane
|
||||
category: Transportation
|
||||
sub_category: Vehicles
|
||||
keywords:
|
||||
- fly
|
||||
- reise
|
||||
- travel
|
||||
variant: Stroke
|
||||
updated_at: 19.08.2023
|
||||
created_at: 07.03.2023
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.38826 3.62505C6.15652 3.6915 5.97084 3.8653 5.88925 4.09216C5.80765 4.31901 5.84009 4.57126 5.97641 4.7701L8.36829 8.25878L8.11295 8.332L5.79538 6.68863C5.60952 6.55684 5.37384 6.51668 5.15483 6.57948L3.23231 7.13075C2.97855 7.20352 2.78174 7.40432 2.71408 7.65949C2.64643 7.91465 2.7179 8.18659 2.90227 8.37552L5.97251 11.5216C7.4499 13.0355 9.63922 13.616 11.6726 13.0329L20.337 10.5485C21.3271 10.2645 21.5682 8.97208 20.7469 8.35031L19.1524 7.14305C17.9604 6.24057 16.4131 5.95197 14.9759 6.36408L13.4288 6.80772L8.98958 3.21193C8.79941 3.05788 8.54604 3.00632 8.31078 3.07377L6.38826 3.62505ZM10.0595 15.2359C9.8993 15.3303 9.90495 15.561 10.0577 15.6671C10.3786 15.8898 10.6712 16.1496 10.9317 16.4427C11.8431 17.4679 12.2501 18.7711 12.2501 20L12.25 20.0141C12.249 20.1747 12.3791 20.3143 12.5393 20.303C13.0023 20.2704 13.455 20.25 13.8625 20.25C15.61 20.25 18.1887 20.6258 18.844 20.7258C18.9487 20.7418 19.0543 20.7555 19.1579 20.7333C19.4962 20.6608 19.7499 20.36 19.7499 20C19.7499 17.0858 17.4141 14.25 13.4999 14.25C12.1367 14.25 10.9677 14.7009 10.0595 15.2359ZM4.18944 17.4392C4.83873 16.7088 5.79648 16.25 7 16.25C8.20352 16.25 9.16127 16.7088 9.81056 17.4392C10.4476 18.1559 10.75 19.0902 10.75 20C10.75 20.3184 10.5516 20.5905 10.2716 20.6993C10.0998 20.7661 9.91096 20.7245 9.73237 20.6789C9.19197 20.5408 7.94182 20.25 7 20.25C6.05818 20.25 4.80803 20.5408 4.26763 20.6789C4.08904 20.7245 3.90023 20.7661 3.72842 20.6993C3.44845 20.5905 3.25 20.3184 3.25 20C3.25 19.0902 3.55242 18.1559 4.18944 17.4392Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,10 +0,0 @@
|
||||
name: AirplaneFill
|
||||
category: Transportation
|
||||
sub_category: Vehicles
|
||||
keywords:
|
||||
- fly
|
||||
- reise
|
||||
- travel
|
||||
variant: Fill
|
||||
updated_at: 19.08.2023
|
||||
created_at: 07.03.2023
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 17.75C5.58579 17.75 5.25 17.4142 5.25 17L5.25 4C5.25 3.58579 5.58579 3.25 6 3.25H10C10.4142 3.25 10.75 3.58579 10.75 4L10.75 17C10.75 17.4142 10.4142 17.75 10 17.75H6ZM6.75 16.25H9.25L9.25 4.75L6.75 4.75L6.75 16.25ZM3.25 20C3.25 19.5858 3.58579 19.25 4 19.25L20 19.25C20.4142 19.25 20.75 19.5858 20.75 20C20.75 20.4142 20.4142 20.75 20 20.75H4C3.58579 20.75 3.25 20.4142 3.25 20ZM13.25 17C13.25 17.4142 13.5858 17.75 14 17.75H18C18.4142 17.75 18.75 17.4142 18.75 17V10C18.75 9.58579 18.4142 9.25 18 9.25H14C13.5858 9.25 13.25 9.58579 13.25 10V17ZM17.25 16.25H14.75V10.75H17.25V16.25Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 757 B |
@@ -1,19 +0,0 @@
|
||||
name: AlignBottom
|
||||
category: Interface
|
||||
sub_category: Design
|
||||
keywords:
|
||||
- positioning
|
||||
- arrangement
|
||||
- layout
|
||||
- design
|
||||
- composition
|
||||
- formatting
|
||||
- posisjonering
|
||||
- ordning
|
||||
- layout
|
||||
- design
|
||||
- sammensetning
|
||||
- formatering
|
||||
variant: Stroke
|
||||
updated_at: 19.08.2023
|
||||
created_at: 07.03.2023
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 17.75C5.58579 17.75 5.25 17.4142 5.25 17L5.25 4C5.25 3.58579 5.58579 3.25 6 3.25H10C10.4142 3.25 10.75 3.58579 10.75 4L10.75 17C10.75 17.4142 10.4142 17.75 10 17.75H6ZM3.25 20C3.25 19.5858 3.58579 19.25 4 19.25L20 19.25C20.4142 19.25 20.75 19.5858 20.75 20C20.75 20.4142 20.4142 20.75 20 20.75H4C3.58579 20.75 3.25 20.4142 3.25 20ZM13.25 17C13.25 17.4142 13.5858 17.75 14 17.75H18C18.4142 17.75 18.75 17.4142 18.75 17V10C18.75 9.58579 18.4142 9.25 18 9.25H14C13.5858 9.25 13.25 9.58579 13.25 10V17Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 672 B |
@@ -1,19 +0,0 @@
|
||||
name: AlignBottomFill
|
||||
category: Interface
|
||||
sub_category: Design
|
||||
keywords:
|
||||
- positioning
|
||||
- arrangement
|
||||
- layout
|
||||
- design
|
||||
- composition
|
||||
- formatting
|
||||
- posisjonering
|
||||
- ordning
|
||||
- layout
|
||||
- design
|
||||
- sammensetning
|
||||
- formatering
|
||||
variant: Fill
|
||||
updated_at: 19.08.2023
|
||||
created_at: 07.03.2023
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 3.25C12.4142 3.25 12.75 3.58579 12.75 4V5.25H18.5C18.9142 5.25 19.25 5.58579 19.25 6V10C19.25 10.4142 18.9142 10.75 18.5 10.75H12.75V13.25H15.5C15.9142 13.25 16.25 13.5858 16.25 14V18C16.25 18.4142 15.9142 18.75 15.5 18.75H12.75V20C12.75 20.4142 12.4142 20.75 12 20.75C11.5858 20.75 11.25 20.4142 11.25 20V18.75H8.5C8.08579 18.75 7.75 18.4142 7.75 18V14C7.75 13.5858 8.08579 13.25 8.5 13.25H11.25V10.75H5.5C5.08579 10.75 4.75 10.4142 4.75 10V6C4.75 5.58579 5.08579 5.25 5.5 5.25H11.25V4C11.25 3.58579 11.5858 3.25 12 3.25ZM11.25 14.75H9.25V17.25H11.25V14.75ZM12.75 17.25H14.75V14.75H12.75V17.25ZM6.25 6.75H11.25V9.25H6.25V6.75ZM12.75 6.75V9.25H17.75V6.75H12.75Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 836 B |
@@ -1,19 +0,0 @@
|
||||
name: AlignCenter
|
||||
category: Interface
|
||||
sub_category: Design
|
||||
keywords:
|
||||
- positioning
|
||||
- arrangement
|
||||
- layout
|
||||
- design
|
||||
- composition
|
||||
- formatting
|
||||
- posisjonering
|
||||
- ordning
|
||||
- layout
|
||||
- design
|
||||
- sammensetning
|
||||
- formatering
|
||||
variant: Stroke
|
||||
updated_at: 19.08.2023
|
||||
created_at: 07.03.2023
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 3.25C12.4142 3.25 12.75 3.58579 12.75 4V5.25H18.5C18.9142 5.25 19.25 5.58579 19.25 6V10C19.25 10.4142 18.9142 10.75 18.5 10.75H12.75V13.25H15.5C15.9142 13.25 16.25 13.5858 16.25 14V18C16.25 18.4142 15.9142 18.75 15.5 18.75H12.75V20C12.75 20.4142 12.4142 20.75 12 20.75C11.5858 20.75 11.25 20.4142 11.25 20V18.75H8.5C8.08579 18.75 7.75 18.4142 7.75 18V14C7.75 13.5858 8.08579 13.25 8.5 13.25H11.25V10.75H5.5C5.08579 10.75 4.75 10.4142 4.75 10V6C4.75 5.58579 5.08579 5.25 5.5 5.25H11.25V4C11.25 3.58579 11.5858 3.25 12 3.25Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 697 B |
@@ -1,19 +0,0 @@
|
||||
name: AlignCenterFill
|
||||
category: Interface
|
||||
sub_category: Design
|
||||
keywords:
|
||||
- positioning
|
||||
- arrangement
|
||||
- layout
|
||||
- design
|
||||
- composition
|
||||
- formatting
|
||||
- posisjonering
|
||||
- ordning
|
||||
- layout
|
||||
- design
|
||||
- sammensetning
|
||||
- formatering
|
||||
variant: Fill
|
||||
updated_at: 19.08.2023
|
||||
created_at: 07.03.2023
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 3.25C4.41421 3.25 4.75 3.58579 4.75 4V20C4.75 20.4142 4.41421 20.75 4 20.75C3.58579 20.75 3.25 20.4142 3.25 20V4C3.25 3.58579 3.58579 3.25 4 3.25ZM6.25 6C6.25 5.58579 6.58579 5.25 7 5.25H20C20.4142 5.25 20.75 5.58579 20.75 6V10C20.75 10.4142 20.4142 10.75 20 10.75H7C6.58579 10.75 6.25 10.4142 6.25 10V6ZM7.75 6.75V9.25H19.25V6.75H7.75ZM7 13.25C6.58579 13.25 6.25 13.5858 6.25 14V18C6.25 18.4142 6.58579 18.75 7 18.75H14C14.4142 18.75 14.75 18.4142 14.75 18V14C14.75 13.5858 14.4142 13.25 14 13.25H7ZM7.75 17.25V14.75H13.25V17.25H7.75Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 709 B |
@@ -1,19 +0,0 @@
|
||||
name: AlignLeft
|
||||
category: Interface
|
||||
sub_category: Design
|
||||
keywords:
|
||||
- positioning
|
||||
- arrangement
|
||||
- layout
|
||||
- design
|
||||
- composition
|
||||
- formatting
|
||||
- posisjonering
|
||||
- ordning
|
||||
- layout
|
||||
- design
|
||||
- sammensetning
|
||||
- formatering
|
||||
variant: Stroke
|
||||
updated_at: 19.08.2023
|
||||
created_at: 07.03.2023
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 3.25C4.41421 3.25 4.75 3.58579 4.75 4V20C4.75 20.4142 4.41421 20.75 4 20.75C3.58579 20.75 3.25 20.4142 3.25 20V4C3.25 3.58579 3.58579 3.25 4 3.25ZM6.25 6C6.25 5.58579 6.58579 5.25 7 5.25H20C20.4142 5.25 20.75 5.58579 20.75 6V10C20.75 10.4142 20.4142 10.75 20 10.75H7C6.58579 10.75 6.25 10.4142 6.25 10V6ZM7 13.25C6.58579 13.25 6.25 13.5858 6.25 14V18C6.25 18.4142 6.58579 18.75 7 18.75H14C14.4142 18.75 14.75 18.4142 14.75 18V14C14.75 13.5858 14.4142 13.25 14 13.25H7Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 642 B |
@@ -1,19 +0,0 @@
|
||||
name: AlignLeftFill
|
||||
category: Interface
|
||||
sub_category: Design
|
||||
keywords:
|
||||
- positioning
|
||||
- arrangement
|
||||
- layout
|
||||
- design
|
||||
- composition
|
||||
- formatting
|
||||
- posisjonering
|
||||
- ordning
|
||||
- layout
|
||||
- design
|
||||
- sammensetning
|
||||
- formatering
|
||||
variant: Fill
|
||||
updated_at: 19.08.2023
|
||||
created_at: 07.03.2023
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 19.25C5.58579 19.25 5.25 18.9142 5.25 18.5L5.25 12.75H4C3.58579 12.75 3.25 12.4142 3.25 12C3.25 11.5858 3.58579 11.25 4 11.25H5.25L5.25 5.5C5.25 5.08579 5.58579 4.75 6 4.75H10C10.4142 4.75 10.75 5.08579 10.75 5.5V11.25H13.25V8.5C13.25 8.08579 13.5858 7.75 14 7.75L18 7.75C18.4142 7.75 18.75 8.08579 18.75 8.5V11.25H20C20.4142 11.25 20.75 11.5858 20.75 12C20.75 12.4142 20.4142 12.75 20 12.75H18.75V15.5C18.75 15.9142 18.4142 16.25 18 16.25H14C13.5858 16.25 13.25 15.9142 13.25 15.5V12.75H10.75V18.5C10.75 18.9142 10.4142 19.25 10 19.25H6ZM14.75 12.75V14.75H17.25V12.75L14.75 12.75ZM17.25 11.25V9.25H14.75V11.25L17.25 11.25ZM6.75 17.75L6.75 12.75H9.25V17.75H6.75ZM9.25 6.25V11.25H6.75L6.75 6.25L9.25 6.25Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 878 B |
@@ -1,19 +0,0 @@
|
||||
name: AlignMiddle
|
||||
category: Interface
|
||||
sub_category: Design
|
||||
keywords:
|
||||
- positioning
|
||||
- arrangement
|
||||
- layout
|
||||
- design
|
||||
- composition
|
||||
- formatting
|
||||
- posisjonering
|
||||
- ordning
|
||||
- layout
|
||||
- design
|
||||
- sammensetning
|
||||
- formatering
|
||||
variant: Stroke
|
||||
updated_at: 19.08.2023
|
||||
created_at: 07.03.2023
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 19.25C5.58579 19.25 5.25 18.9142 5.25 18.5L5.25 12.75H4C3.58579 12.75 3.25 12.4142 3.25 12C3.25 11.5858 3.58579 11.25 4 11.25H5.25L5.25 5.5C5.25 5.08579 5.58579 4.75 6 4.75H10C10.4142 4.75 10.75 5.08579 10.75 5.5V11.25H13.25V8.5C13.25 8.08579 13.5858 7.75 14 7.75L18 7.75C18.4142 7.75 18.75 8.08579 18.75 8.5V11.25H20C20.4142 11.25 20.75 11.5858 20.75 12C20.75 12.4142 20.4142 12.75 20 12.75H18.75V15.5C18.75 15.9142 18.4142 16.25 18 16.25H14C13.5858 16.25 13.25 15.9142 13.25 15.5V12.75H10.75V18.5C10.75 18.9142 10.4142 19.25 10 19.25H6Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 712 B |
@@ -1,19 +0,0 @@
|
||||
name: AlignMiddleFill
|
||||
category: Interface
|
||||
sub_category: Design
|
||||
keywords:
|
||||
- positioning
|
||||
- arrangement
|
||||
- layout
|
||||
- design
|
||||
- composition
|
||||
- formatting
|
||||
- posisjonering
|
||||
- ordning
|
||||
- layout
|
||||
- design
|
||||
- sammensetning
|
||||
- formatering
|
||||
variant: Fill
|
||||
updated_at: 19.08.2023
|
||||
created_at: 07.03.2023
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M20 20.75C19.5858 20.75 19.25 20.4142 19.25 20L19.25 4C19.25 3.58579 19.5858 3.25 20 3.25C20.4142 3.25 20.75 3.58579 20.75 4L20.75 20C20.75 20.4142 20.4142 20.75 20 20.75ZM17.75 10C17.75 10.4142 17.4142 10.75 17 10.75L4 10.75C3.58579 10.75 3.25 10.4142 3.25 10V6C3.25 5.58579 3.58579 5.25 4 5.25L17 5.25C17.4142 5.25 17.75 5.58579 17.75 6V10ZM16.25 9.25V6.75L4.75 6.75L4.75 9.25L16.25 9.25ZM17 18.75C17.4142 18.75 17.75 18.4142 17.75 18V14C17.75 13.5858 17.4142 13.25 17 13.25L10 13.25C9.58579 13.25 9.25 13.5858 9.25 14L9.25 18C9.25 18.4142 9.58579 18.75 10 18.75L17 18.75ZM16.25 14.75V17.25L10.75 17.25L10.75 14.75L16.25 14.75Z" fill="#23262A"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 800 B |