mirror of
https://github.com/navikt/aksel.git
synced 2026-10-13 09:12:03 +00:00
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
709c20ed6d | ||
|
|
6530211445 | ||
|
|
88a665f772 | ||
|
|
dc2b063fda | ||
|
|
1414f85484 | ||
|
|
2fd93bb2be | ||
|
|
1360789bc3 | ||
|
|
cecc905f58 | ||
|
|
1cda942e61 | ||
|
|
ab3a4289ea | ||
|
|
9bafdd3c06 |
No files matched your search
@@ -71,7 +71,7 @@ jobs:
|
||||
- run: git remote set-url origin https://github-actions[bot]:$NAV_DS_TOKEN@github.com/$GITHUB_REPOSITORY.git
|
||||
env:
|
||||
NAV_DS_TOKEN: ${{secrets.GIT_REPO}}
|
||||
- run: yarn lerna version patch --include-merged-tags --no-private --yes
|
||||
- run: yarn lerna version patch --include-merged-tags --yes
|
||||
- run: yarn lerna publish from-package --yes
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTOMATION}}
|
||||
|
||||
@@ -111,3 +111,7 @@ utilities/**/css
|
||||
@navikt/ds-icons/NAV-ikonpakke-svg.zip
|
||||
*/**/NAV-ikonpakke-png.zip
|
||||
*/**/NAV-ikonpakke-svg.zip
|
||||
|
||||
react-docgen.json
|
||||
cjs
|
||||
esm
|
||||
+28
-3
@@ -1,7 +1,32 @@
|
||||
module.exports = {
|
||||
webpackFinal: async (config, { configType }) => {
|
||||
config.devServer = { stats: "errors-only" };
|
||||
return config;
|
||||
},
|
||||
devServer: { stats: "errors-only" },
|
||||
stories: [
|
||||
"../packages/**/*.stories.@(js|jsx|ts|tsx)",
|
||||
"../@navikt/**/*.stories.@(js|jsx|ts|tsx)",
|
||||
"../.storybook/**/*.stories.@(mdx)",
|
||||
"../packages/**/*.stories.@(js|jsx|ts|tsx|mdx)",
|
||||
"../@navikt/**/*.stories.@(js|jsx|ts|tsx|mdx)",
|
||||
],
|
||||
addons: [
|
||||
"@storybook/addon-links",
|
||||
"@storybook/addon-docs",
|
||||
{
|
||||
name: "@storybook/addon-storysource",
|
||||
options: {
|
||||
loaderOptions: {
|
||||
injectStoryParameters: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "@storybook/addon-essentials",
|
||||
options: {
|
||||
actions: false,
|
||||
controls: { hideNoControlsWarning: true },
|
||||
},
|
||||
},
|
||||
"@whitespace/storybook-addon-html",
|
||||
],
|
||||
addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import { addons } from "@storybook/addons";
|
||||
import NavTheme from "./theme.js";
|
||||
|
||||
addons.setConfig({
|
||||
theme: NavTheme,
|
||||
});
|
||||
@@ -1,14 +1,13 @@
|
||||
import "nav-frontend-core";
|
||||
import "@navikt/ds-css/baseline/index.css";
|
||||
import "@navikt/ds-css";
|
||||
|
||||
export const parameters = {
|
||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||
options: {
|
||||
// Makes sure `all` story is first
|
||||
storySort: (a, b) => {
|
||||
if (a[0].indexOf("all") !== -1) return -1;
|
||||
if (b[0].indexOf("all") !== -1) return 1;
|
||||
return 0;
|
||||
storySort: {
|
||||
method: "",
|
||||
order: [],
|
||||
locales: "",
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Meta } from "@storybook/addon-docs/blocks";
|
||||
|
||||
<Meta title="ds-react/Introduksjon" />
|
||||
|
||||
# Ta i bruk `@navikt/ds-react` pakken
|
||||
|
||||
## Oppsett
|
||||
|
||||
```bash
|
||||
yarn install @navikt/ds-react
|
||||
```
|
||||
|
||||
Importer `@navikt/ds-tokens` høyt opp i dom-strukturen (må nås av alle komponentene)
|
||||
Dette vil legge til css-variabler på :root. For å få dette til å fungere med IE11, kan denne pakken tas i bruk: https://jhildenbiddle.github.io/css-vars-ponyfill/#/
|
||||
|
||||
```bash
|
||||
import "@navikt/ds-tokens";
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
import { create } from "@storybook/theming";
|
||||
|
||||
export default create({
|
||||
base: "light",
|
||||
brandTitle: "NAV Designsystem",
|
||||
});
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,18 @@
|
||||
@import "@navikt/ds-tokens";
|
||||
@import "normalize.css";
|
||||
@import "Source-Sans-Pro-regular.css";
|
||||
@import "Source-Sans-Pro-italic.css";
|
||||
@import "Source-Sans-Pro-600.css";
|
||||
@import "print.css";
|
||||
@import "utility.css";
|
||||
|
||||
body {
|
||||
font-family: var(--navds-font-family);
|
||||
line-height: 1.375;
|
||||
color: var(--navds-color-text-primary);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--navds-color-text-link);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
@import url(~normalize.css);
|
||||
@import url(~@navikt/ds-tokens/dist/tokens.css);
|
||||
@import url(Source-Sans-Pro-regular.css);
|
||||
@import url(Source-Sans-Pro-italic.css);
|
||||
@import url(Source-Sans-Pro-600.css);
|
||||
@import url(print.css);
|
||||
@import url(utility.css);
|
||||
|
||||
body {
|
||||
font-family: var(--navds-font-family);
|
||||
line-height: 1.375;
|
||||
color: var(--navds-color-text-primary);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--navds-color-text-link);
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,23 @@
|
||||
/**************************
|
||||
* .navds-grid *
|
||||
**************************/
|
||||
|
||||
.navds-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(12, minmax(0, 1fr));
|
||||
grid-gap: var(--navds-grid-gutter-small);
|
||||
}
|
||||
|
||||
@media (min-width: 448px) {
|
||||
.navds-grid {
|
||||
grid-gap: var(--navds-grid-gutter-medium-and-larger);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************
|
||||
* .navds-grid__cell *
|
||||
**************************/
|
||||
|
||||
.navds-grid__cell--xs-1 {
|
||||
grid-column: span 1;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
.navds-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(12, minmax(0, 1fr));
|
||||
grid-gap: var(--navds-grid-gutter-small);
|
||||
}
|
||||
|
||||
@media (min-width: 448px) {
|
||||
.navds-grid {
|
||||
grid-gap: var(--navds-grid-gutter-medium-and-larger);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
@import "./grid.css";
|
||||
@import "./cell.css";
|
||||
@@ -0,0 +1,13 @@
|
||||
@import "baseline/baseline.css";
|
||||
@import "accordion.css";
|
||||
@import "alert.css";
|
||||
@import "button.css";
|
||||
@import "content-container.css";
|
||||
@import "grid.css";
|
||||
@import "internal-header.css";
|
||||
@import "layout.css";
|
||||
@import "link.css";
|
||||
@import "modal.css";
|
||||
@import "popover.css";
|
||||
@import "tag.css";
|
||||
@import "typography.css";
|
||||
@@ -0,0 +1,72 @@
|
||||
/**************************
|
||||
* .navds-header *
|
||||
**************************/
|
||||
|
||||
.navds-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: var(--navds-color-darkgray);
|
||||
color: white;
|
||||
max-width: 100vw;
|
||||
min-height: 50px;
|
||||
}
|
||||
|
||||
.navds-header__column {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/**************************
|
||||
* .navds-header__title *
|
||||
**************************/
|
||||
|
||||
.navds-header__title {
|
||||
padding: 0 1.5rem 0 1.5rem;
|
||||
border-right: 1px solid var(--navds-color-gray-40);
|
||||
display: flex;
|
||||
align-self: stretch;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
margin: 0;
|
||||
color: var(--navds-color-text-inverse);
|
||||
font-size: var(--navds-font-size-medium);
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
line-height: var(--navds-font-line-height-medium);
|
||||
}
|
||||
|
||||
.navds-header__title > span > a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.navds-header__title > span > a:focus {
|
||||
box-shadow: var(--navds-shadow-focus-on-dark);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/**************************
|
||||
* .navds-header__user *
|
||||
**************************/
|
||||
|
||||
.navds-header__user {
|
||||
color: var(--navds-color-text-inverse);
|
||||
padding: 0 1.5rem 0 1.5rem;
|
||||
margin-left: auto;
|
||||
border-left: 1px solid var(--navds-color-gray-40);
|
||||
display: flex;
|
||||
align-self: stretch;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navds-header__name {
|
||||
margin-right: 1rem;
|
||||
font-size: var(--navds-font-size-small);
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
line-height: var(--navds-font-line-height-small);
|
||||
}
|
||||
|
||||
.navds-header__ident {
|
||||
font-size: var(--navds-font-size-xs);
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
line-height: var(--navds-font-line-height-xs);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
@import "./title.css";
|
||||
@import "./user.css";
|
||||
|
||||
.navds-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: var(--navds-color-darkgray);
|
||||
color: white;
|
||||
max-width: 100vw;
|
||||
min-height: 50px;
|
||||
}
|
||||
|
||||
.navds-header__column {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
.navds-header__title {
|
||||
padding: 0 1.5rem 0 1.5rem;
|
||||
border-right: 1px solid var(--navds-color-gray-40);
|
||||
display: flex;
|
||||
align-self: stretch;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
margin: 0;
|
||||
color: var(--navds-color-text-inverse);
|
||||
font-size: var(--navds-font-size-medium);
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
line-height: var(--navds-font-line-height-medium);
|
||||
}
|
||||
|
||||
.navds-header__title > span > a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.navds-header__title > span > a:focus {
|
||||
box-shadow: var(--navds-shadow-focus-on-dark);
|
||||
outline: none;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
.navds-header__user {
|
||||
color: var(--navds-color-text-inverse);
|
||||
padding: 0 1.5rem 0 1.5rem;
|
||||
margin-left: auto;
|
||||
border-left: 1px solid var(--navds-color-gray-40);
|
||||
display: flex;
|
||||
align-self: stretch;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navds-header__name {
|
||||
margin-right: 1rem;
|
||||
font-size: var(--navds-font-size-small);
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
line-height: var(--navds-font-line-height-small);
|
||||
}
|
||||
|
||||
.navds-header__ident {
|
||||
font-size: var(--navds-font-size-xs);
|
||||
font-weight: var(--navds-font-weight-bold);
|
||||
line-height: var(--navds-font-line-height-xs);
|
||||
}
|
||||
File renamed without changes.
@@ -1 +0,0 @@
|
||||
@import "./layout.css";
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-css",
|
||||
"version": "0.1.17",
|
||||
"version": "0.2.0",
|
||||
"private": false,
|
||||
"description": "Css for NAV Designsystem components",
|
||||
"author": "NAV Designsystem team",
|
||||
@@ -15,8 +15,15 @@
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/navikt/nav-frontend-moduler.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"main": "./dist/index.css",
|
||||
"scripts": {
|
||||
"build": "postcss --use postcss-import -o dist/index.css index.css"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@navikt/ds-tokens": "^0.1.0",
|
||||
"normalize.css": "^8.0.1"
|
||||
"normalize.css": "^8.0.1",
|
||||
"postcss": "^8.2.7",
|
||||
"postcss-cli": "^8.3.1",
|
||||
"postcss-import": "^14.0.0"
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"type": "commonjs",
|
||||
"main": "index.js",
|
||||
"typings": "../esm/index.d.ts",
|
||||
"sideEffects": false
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// https://levelup.gitconnected.com/learn-svg-to-react-using-figma-api-be0a5f9c0ca
|
||||
// used for reference/implementation
|
||||
|
||||
const api = require("axios");
|
||||
import { create, get } from "axios";
|
||||
|
||||
// Requires user to add a personalized figma token in .env
|
||||
const headers = {
|
||||
@@ -11,7 +11,7 @@ const headers = {
|
||||
* Api connection for icon components
|
||||
* https://www.figma.com/file/UmEVH3pZ71uJPsSz9ilP3Y/NAV-ikoner-2.1-Figma-i-test?node-id=0%3A1
|
||||
*/
|
||||
const instanceFiles = api.create({
|
||||
const instanceFiles = create({
|
||||
baseURL: `https://api.figma.com/v1/files/${process.env.FILE_KEY}/components`,
|
||||
headers,
|
||||
});
|
||||
@@ -19,7 +19,7 @@ const instanceFiles = api.create({
|
||||
/**
|
||||
* api endpoint for images
|
||||
*/
|
||||
const instanceImages = api.create({
|
||||
const instanceImages = create({
|
||||
baseURL: `https://api.figma.com/v1/images/${process.env.FILE_KEY}`,
|
||||
headers,
|
||||
});
|
||||
@@ -45,9 +45,9 @@ const getSvgImageUrls = async (nodeIds) => {
|
||||
/**
|
||||
* Gets raw svg data from url
|
||||
*/
|
||||
const getIconContent = async (url) => api.get(url);
|
||||
const getIconContent = async (url) => get(url);
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
getNodeChildren,
|
||||
getSvgImageUrls,
|
||||
getIconContent,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const api = require("./api");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const pLimit = require("p-limit");
|
||||
const rimraf = require("rimraf");
|
||||
const startCase = require("lodash.startcase");
|
||||
import { getNodeChildren, getSvgImageUrls, getIconContent } from "./api";
|
||||
import { existsSync, unlinkSync, writeFileSync, mkdirSync } from "fs";
|
||||
import { resolve } from "path";
|
||||
import pLimit from "p-limit";
|
||||
import rimraf from "rimraf";
|
||||
import startCase from "lodash.startcase";
|
||||
|
||||
const generateMetadata = (iconNodesArr) => {
|
||||
return iconNodesArr
|
||||
@@ -32,14 +32,14 @@ const main = async () => {
|
||||
// Limiting to ~20 concurrent downloads seems to lead to fewer erros
|
||||
const limit = pLimit(20);
|
||||
|
||||
const iconNodesArr = await api.getNodeChildren().catch((e) => {
|
||||
const iconNodesArr = await getNodeChildren().catch((e) => {
|
||||
throw e;
|
||||
});
|
||||
|
||||
if (fs.existsSync(metadataFileName)) {
|
||||
fs.unlinkSync(metadataFileName);
|
||||
if (existsSync(metadataFileName)) {
|
||||
unlinkSync(metadataFileName);
|
||||
}
|
||||
fs.writeFileSync(
|
||||
writeFileSync(
|
||||
metadataFileName,
|
||||
JSON.stringify(generateMetadata(iconNodesArr), null, 4),
|
||||
{
|
||||
@@ -47,25 +47,24 @@ const main = async () => {
|
||||
}
|
||||
);
|
||||
|
||||
const iconUrls = await api.getSvgImageUrls(
|
||||
const iconUrls = await getSvgImageUrls(
|
||||
iconNodesArr.map((node) => node.node_id).join(",")
|
||||
);
|
||||
|
||||
if (fs.existsSync(iconFolder)) {
|
||||
if (existsSync(iconFolder)) {
|
||||
rimraf.sync(iconFolder);
|
||||
}
|
||||
fs.mkdirSync(iconFolder);
|
||||
mkdirSync(iconFolder);
|
||||
|
||||
console.log("Total icons: " + iconNodesArr.length);
|
||||
|
||||
await Promise.all(
|
||||
iconUrls.map((url, x) =>
|
||||
limit(() =>
|
||||
api
|
||||
.getIconContent(url)
|
||||
getIconContent(url)
|
||||
.then(({ data }) => {
|
||||
fs.writeFileSync(
|
||||
path.resolve(
|
||||
writeFileSync(
|
||||
resolve(
|
||||
iconFolder,
|
||||
`${startCase(iconNodesArr[x].name).replace(/\s/g, "")}.svg`
|
||||
),
|
||||
@@ -86,8 +85,8 @@ const main = async () => {
|
||||
);
|
||||
|
||||
if (misses.length > 0) {
|
||||
fs.writeFileSync(
|
||||
path.resolve("./", `misses.txt`),
|
||||
writeFileSync(
|
||||
resolve("./", `misses.txt`),
|
||||
JSON.stringify(misses, null, 4),
|
||||
{
|
||||
encoding: "utf8",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const fs = require("fs");
|
||||
const sharp = require("sharp");
|
||||
const rimraf = require("rimraf");
|
||||
const pLimit = require("p-limit");
|
||||
import { existsSync, mkdirSync, readdirSync } from "fs";
|
||||
import sharp from "sharp";
|
||||
import rimraf from "rimraf";
|
||||
import pLimit from "p-limit";
|
||||
|
||||
const convertToPng = async () => {
|
||||
const inputDir = "./svg/";
|
||||
@@ -11,14 +11,14 @@ const convertToPng = async () => {
|
||||
|
||||
const limit = pLimit(20);
|
||||
|
||||
if (fs.existsSync(outDir)) {
|
||||
if (existsSync(outDir)) {
|
||||
rimraf.sync(outDir);
|
||||
}
|
||||
fs.mkdirSync(outDir);
|
||||
sizes.forEach((size) => fs.mkdirSync(outDir + size.toString()));
|
||||
mkdirSync(outDir);
|
||||
sizes.forEach((size) => mkdirSync(outDir + size.toString()));
|
||||
|
||||
await Promise.all(
|
||||
fs.readdirSync(inputDir).map((file) => {
|
||||
readdirSync(inputDir).map((file) => {
|
||||
return limit(() =>
|
||||
sizes.forEach((size) => {
|
||||
const density = (100 * size) / 16;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const zipdir = require("zip-dir");
|
||||
import zipdir from "zip-dir";
|
||||
|
||||
const zipDir = async (dir, name) => {
|
||||
await zipdir(dir, { saveTo: name }, function (err, buffer) {
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
{
|
||||
"name": "@navikt/ds-icons",
|
||||
"version": "0.1.7",
|
||||
"version": "0.2.0",
|
||||
"private": false,
|
||||
"description": "NAVs egne ikoner i SVG og React format",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/ds-icons"
|
||||
},
|
||||
"keywords": [
|
||||
"NAV",
|
||||
"designsystem",
|
||||
@@ -10,29 +14,30 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": "NAV",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"main": "esm/index.js",
|
||||
"module": "esm/index.js",
|
||||
"typings": "esm/index.d.ts",
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"files": [
|
||||
"/lib",
|
||||
"/src",
|
||||
"/cjs",
|
||||
"/esm",
|
||||
"/svg"
|
||||
],
|
||||
"scripts": {
|
||||
"cjs-package": "copyfiles -f config/package.json cjs",
|
||||
"dl-icons": "FILE_KEY=UmEVH3pZ71uJPsSz9ilP3Y node -r dotenv/config figma-api/index.js dotenv_config_path=figma-api/.env",
|
||||
"create-icons": "svgr --silent --typescript --ref --icon --title-prop --replace-attr-values \"#3E3832=currentColor\" -d src svg",
|
||||
"convert-icons": "node figma-api/pngConverter.js",
|
||||
"clean": "rm -rf src && rm -rf lib && rm -rf png && rm -rf NAV-ikonpakke-png.zip && rm -rf NAV-ikonpakke-svg.zip",
|
||||
"build": "npm run clean && npm run create-icons && tsc && npm run convert-icons && node figma-api/zipIcons.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/ds-icons"
|
||||
"clean": "rm -rf src && rm -rf esm && rm -rf cjs && rm -rf png && rm -rf NAV-ikonpakke-png.zip && rm -rf NAV-ikonpakke-svg.zip",
|
||||
"build": "npm run clean && npm run create-icons && tsc && tsc -p tsconfig-esm.json && yarn cjs-package && npm run convert-icons && node figma-api/zipIcons.js"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@svgr/cli": "^5.4.0",
|
||||
"copyfiles": "^2.4.1",
|
||||
"dotenv": "^8.2.0",
|
||||
"lodash.kebabcase": "^4.1.1",
|
||||
"lodash.startcase": "4.4.0",
|
||||
@@ -40,6 +45,5 @@
|
||||
"rimraf": "3.0.2",
|
||||
"sharp": "0.27.1",
|
||||
"zip-dir": "^2.0.0"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Meta } from "@storybook/addon-docs/blocks";
|
||||
|
||||
<Meta title="ds-icons/Introduksjon" />
|
||||
|
||||
# Ta i bruk ikonpakken `@navikt/ds-icons`
|
||||
|
||||
Alle ikoner kan bli funnet her https://design.nav.no/resources/icons
|
||||
|
||||
## Oppsett
|
||||
|
||||
```bash
|
||||
yarn install @navikt/ds-icons
|
||||
```
|
||||
|
||||
```bash
|
||||
Import { Expand } from `@navikt/ds-icons`;
|
||||
|
||||
<Expand
|
||||
aria-label="Åpne meny"
|
||||
role="img"
|
||||
focusable="false"
|
||||
/>
|
||||
```
|
||||
@@ -1,35 +1,65 @@
|
||||
import React from "react";
|
||||
// also exported from '@storybook/react' if you can deal with breaking changes in 6.1
|
||||
// import { Story, Meta } from '@storybook/react/types-6-0';
|
||||
import { storiesOf } from "@storybook/react";
|
||||
|
||||
import * as Icons from "../src";
|
||||
export default {
|
||||
title: "ds-icons/Ikoner",
|
||||
argTypes: {
|
||||
Icon: {
|
||||
defaultValue: "System",
|
||||
control: {
|
||||
type: "select",
|
||||
options: Object.entries(Icons).map(([Name, _]) => Name),
|
||||
},
|
||||
},
|
||||
color: { control: "color" },
|
||||
},
|
||||
};
|
||||
|
||||
const iconsStories = storiesOf("@navikt/icons", module);
|
||||
if (process.env.STORYBOOK_CHROMATIC === "true") {
|
||||
const iconsStories = storiesOf("ds-icons/Ikoner", module);
|
||||
|
||||
Object.entries(Icons).forEach(([name, Icon]) => {
|
||||
iconsStories.add(name, () => (
|
||||
<div>
|
||||
<Icon title="hello, world" />
|
||||
<Icon style={{ height: "2em", width: "2em" }} />
|
||||
<Icon style={{ height: "4em", width: "4em" }} />
|
||||
<Icon style={{ height: "4em", width: "4em", color: "white" }} />
|
||||
<Icon style={{ height: "4em", width: "4em", color: "crimson" }} />
|
||||
<br />
|
||||
<Icon style={{ height: "4em", width: "4em", backgroundColor: "#aaa" }} />
|
||||
<Icon style={{ height: "4em", width: "4em", backgroundColor: "#777" }} />
|
||||
<Icon style={{ height: "4em", width: "4em", backgroundColor: "#333" }} />
|
||||
<Icon style={{ height: "4em", width: "4em", backgroundColor: "#000" }} />
|
||||
<br />
|
||||
<Icon
|
||||
style={{ height: "4em", width: "4em", transform: "rotate(45deg)" }}
|
||||
/>
|
||||
<Icon
|
||||
style={{ height: "4em", width: "4em", transform: "rotate(90deg)" }}
|
||||
/>
|
||||
<Icon
|
||||
style={{ height: "4em", width: "4em", transform: "rotate(180deg)" }}
|
||||
/>
|
||||
</div>
|
||||
));
|
||||
});
|
||||
Object.entries(Icons).forEach(([name, Icon]) => {
|
||||
iconsStories.add(name, () => (
|
||||
<div>
|
||||
<Icon title="hello, world" />
|
||||
<Icon style={{ height: "2em", width: "2em" }} />
|
||||
<Icon style={{ height: "4em", width: "4em" }} />
|
||||
<Icon style={{ height: "4em", width: "4em", color: "white" }} />
|
||||
<Icon style={{ height: "4em", width: "4em", color: "crimson" }} />
|
||||
<br />
|
||||
<Icon
|
||||
style={{ height: "4em", width: "4em", backgroundColor: "#aaa" }}
|
||||
/>
|
||||
<Icon
|
||||
style={{ height: "4em", width: "4em", backgroundColor: "#777" }}
|
||||
/>
|
||||
<Icon
|
||||
style={{ height: "4em", width: "4em", backgroundColor: "#333" }}
|
||||
/>
|
||||
<Icon
|
||||
style={{ height: "4em", width: "4em", backgroundColor: "#000" }}
|
||||
/>
|
||||
<br />
|
||||
<Icon
|
||||
style={{ height: "4em", width: "4em", transform: "rotate(45deg)" }}
|
||||
/>
|
||||
<Icon
|
||||
style={{ height: "4em", width: "4em", transform: "rotate(90deg)" }}
|
||||
/>
|
||||
<Icon
|
||||
style={{ height: "4em", width: "4em", transform: "rotate(180deg)" }}
|
||||
/>
|
||||
</div>
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
const Template = ({ Icon, color, size, ...args }) => {
|
||||
const Iconname = Icons[Icon];
|
||||
return <Iconname style={{ fontSize: size, color }} {...args} />;
|
||||
};
|
||||
export const Ikon = Template.bind({});
|
||||
Ikon.args = {
|
||||
size: "24px",
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "../../utilities/build/tsconfig-pakker.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"esModuleInterop": true,
|
||||
"module": "ES2020",
|
||||
"target": "ES2015",
|
||||
"outDir": "./esm",
|
||||
"sourceMap": true,
|
||||
"declaration": true
|
||||
},
|
||||
"include": ["./src"]
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
{
|
||||
"extends": "../../utilities/build/tsconfig-pakker.json",
|
||||
"compilerOptions": {
|
||||
"module": "ES6",
|
||||
"outDir": "./lib",
|
||||
"module": "commonjs",
|
||||
"outDir": "./cjs",
|
||||
"target": "es2015",
|
||||
"rootDir": "./src",
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": true
|
||||
"sourceMap": false,
|
||||
"declaration": false
|
||||
},
|
||||
"include": ["./src"]
|
||||
}
|
||||
@@ -3,7 +3,6 @@ import cl from "classnames";
|
||||
import { UnmountClosed, Collapse } from "react-collapse";
|
||||
|
||||
import { Expand } from "@navikt/ds-icons";
|
||||
import "@navikt/ds-css/accordion/index.css";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
export interface AccordionProps
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useState } from "react";
|
||||
import { Accordion } from "../index";
|
||||
|
||||
export default {
|
||||
title: "@navikt/accordion",
|
||||
title: "ds-react/accordion",
|
||||
component: Accordion,
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
InformationFilled,
|
||||
SuccessFilled,
|
||||
} from "@navikt/ds-icons";
|
||||
import "@navikt/ds-css/alert/index.css";
|
||||
|
||||
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
variant: "error" | "warning" | "info" | "success";
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import { Alert } from "../index";
|
||||
|
||||
export default {
|
||||
title: "@navikt/alert",
|
||||
title: "ds-react/alert",
|
||||
component: Alert,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { forwardRef } from "react";
|
||||
import cl from "classnames";
|
||||
import "@navikt/ds-css/button/index.css";
|
||||
|
||||
export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
||||
variant?: "primary" | "secondary" | "action" | "danger";
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import { Button } from "../index";
|
||||
|
||||
export default {
|
||||
title: "@navikt/button",
|
||||
title: "ds-react/button",
|
||||
component: Button,
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"type": "commonjs",
|
||||
"main": "index.js",
|
||||
"typings": "../esm/index.d.ts",
|
||||
"sideEffects": false
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { forwardRef, HTMLAttributes } from "react";
|
||||
import cl from "classnames";
|
||||
import "@navikt/ds-css/content-container/index.css";
|
||||
|
||||
export type ContentContainerProps = HTMLAttributes<HTMLDivElement>;
|
||||
const ContentContainer = forwardRef<HTMLDivElement, ContentContainerProps>(
|
||||
|
||||
@@ -5,7 +5,7 @@ import "./style.css";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default {
|
||||
title: "@navikt/content-container",
|
||||
title: "ds-react/content-container",
|
||||
component: ContentContainer,
|
||||
decorators: [
|
||||
(Story) => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { forwardRef, HTMLAttributes } from "react";
|
||||
import cl from "classnames";
|
||||
import "@navikt/ds-css/grid/index.css";
|
||||
|
||||
type Column = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
||||
export interface CellProps extends HTMLAttributes<HTMLDivElement> {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { forwardRef, HTMLAttributes } from "react";
|
||||
import cl from "classnames";
|
||||
import "@navikt/ds-css/grid/index.css";
|
||||
|
||||
export type GridProps = HTMLAttributes<HTMLDivElement>;
|
||||
const Grid = forwardRef<HTMLDivElement, GridProps>(
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ContentContainer } from "../../index";
|
||||
import "./styles.css";
|
||||
|
||||
export default {
|
||||
title: "@navikt/grid",
|
||||
title: "ds-react/grid",
|
||||
component: { Grid, Cell },
|
||||
parameters: {
|
||||
layout: "fullscreen",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import React, { forwardRef, HTMLAttributes } from "react";
|
||||
import cl from "classnames";
|
||||
import "@navikt/ds-css/internal-header/index.css";
|
||||
import "@navikt/ds-css/typography/index.css";
|
||||
|
||||
export interface InternalHeaderProps extends HTMLAttributes<HTMLElement> {
|
||||
children?: React.ReactNode;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import React, { forwardRef, HTMLAttributes, createElement } from "react";
|
||||
import cl from "classnames";
|
||||
import "@navikt/ds-css/internal-header/index.css";
|
||||
import "@navikt/ds-css/typography/index.css";
|
||||
|
||||
export interface InternalHeaderTitleProps extends HTMLAttributes<HTMLElement> {
|
||||
children?: React.ReactNode;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import React, { forwardRef, HTMLAttributes } from "react";
|
||||
import cl from "classnames";
|
||||
import "@navikt/ds-css/internal-header/index.css";
|
||||
import "@navikt/ds-css/typography/index.css";
|
||||
|
||||
export interface InternalHeaderUserProps
|
||||
extends HTMLAttributes<HTMLDivElement> {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from "../index";
|
||||
|
||||
export default {
|
||||
title: "@navikt/internal-header",
|
||||
title: "ds-react/internal-header",
|
||||
component: InternalHeader,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import "@navikt/ds-css/layout/index.css";
|
||||
import cl from "classnames";
|
||||
import React, {
|
||||
Children,
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Right } from "./components/sections/Right";
|
||||
import "./components/styles.css";
|
||||
|
||||
export default {
|
||||
title: "@navikt/layout/Article",
|
||||
title: "ds-react/layout/Article",
|
||||
component: { Layout },
|
||||
decorators: [
|
||||
(Story) => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { forwardRef } from "react";
|
||||
import cl from "classnames";
|
||||
import "@navikt/ds-css/link/index.css";
|
||||
|
||||
export interface LinkProps
|
||||
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import { Link } from "../index";
|
||||
import { Add } from "@navikt/ds-icons";
|
||||
export default {
|
||||
title: "@navikt/link",
|
||||
title: "ds-react/link",
|
||||
component: Link,
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import cl from "classnames";
|
||||
import ReactModal from "react-modal";
|
||||
import mergeRefs from "react-merge-refs";
|
||||
import { Close } from "@navikt/ds-icons";
|
||||
import "@navikt/ds-css/modal/index.css";
|
||||
import { Button } from "../index";
|
||||
|
||||
// TODO: Has to be documented well that the user has to import react-modal and call
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Modal } from "../index";
|
||||
import ReactModal from "react-modal";
|
||||
|
||||
export default {
|
||||
title: "@navikt/modal",
|
||||
title: "ds-react/modal",
|
||||
component: Modal,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,34 +1,38 @@
|
||||
{
|
||||
"name": "@navikt/ds-react",
|
||||
"version": "0.1.2",
|
||||
"version": "0.2.0",
|
||||
"private": false,
|
||||
"description": "NAV designsystem react components",
|
||||
"author": "NAV Designsystem team",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"react",
|
||||
"typescript",
|
||||
"javascript"
|
||||
],
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/ds-react"
|
||||
},
|
||||
"main": "esm/index.js",
|
||||
"module": "esm/index.js",
|
||||
"typings": "esm/index.d.ts",
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"/lib"
|
||||
"/cjs",
|
||||
"/esm"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/navikt/nav-frontend-moduler.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"cjs-package": "copyfiles -f config/package.json cjs",
|
||||
"build": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && yarn cjs-package",
|
||||
"watch": "tsc --watch -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@navikt/ds-css": "^0.1.17",
|
||||
"@navikt/ds-icons": "^0.1.7",
|
||||
"@navikt/ds-icons": "^0.2.0",
|
||||
"@popperjs/core": "^2.5.4",
|
||||
"classnames": "^2.2.6",
|
||||
"react-collapse": "^5.1.0",
|
||||
@@ -38,6 +42,7 @@
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"copyfiles": "^2.4.1",
|
||||
"react-router-dom": "^5.2.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -9,7 +9,6 @@ import { usePopper } from "react-popper";
|
||||
import { Placement } from "@popperjs/core";
|
||||
import mergeRefs from "react-merge-refs";
|
||||
import cl from "classnames";
|
||||
import "@navikt/ds-css/popover/index.css";
|
||||
|
||||
export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Popover } from "../index";
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
import { placements } from "@popperjs/core";
|
||||
export default {
|
||||
title: "@navikt/popover",
|
||||
title: "ds-react/popover",
|
||||
component: Popover,
|
||||
parameters: {
|
||||
chromatic: { disable: true },
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { forwardRef, HTMLAttributes } from "react";
|
||||
import cl from "classnames";
|
||||
import "@navikt/ds-css/tag/index.css";
|
||||
|
||||
export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import { Tag } from "../index";
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
export default {
|
||||
title: "@navikt/tag",
|
||||
title: "ds-react/tag",
|
||||
component: Tag,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "../../utilities/build/tsconfig-pakker.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./esm",
|
||||
"rootDir": "./",
|
||||
"esModuleInterop": true,
|
||||
"module": "ES2020",
|
||||
"target": "ES2015",
|
||||
"sourceMap": true,
|
||||
"declaration": true
|
||||
},
|
||||
"include": ["./*"]
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
{
|
||||
"extends": "../../utilities/build/tsconfig-pakker.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"outDir": "./cjs",
|
||||
"rootDir": "./",
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": true
|
||||
"module": "commonjs",
|
||||
"target": "es2015",
|
||||
"sourceMap": false,
|
||||
"declaration": false
|
||||
},
|
||||
"include": ["./*"]
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
import "@navikt/ds-css/typography/index.css";
|
||||
|
||||
export { default as Heading } from "./Heading";
|
||||
export * from "./Heading";
|
||||
export { default as Text } from "./Text";
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import { Heading, Text, Paragraph, Lead } from "../index";
|
||||
|
||||
export default {
|
||||
title: "@navikt/typography",
|
||||
title: "ds-react/typography",
|
||||
component: Heading,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# Endringslogg
|
||||
|
||||
## 10. Mars 2021
|
||||
|
||||
### Oppdatert feil-styling og state-handling for skjemakomponenter
|
||||
|
||||
[#1018](https://github.com/navikt/nav-frontend-moduler/pull/1018)
|
||||
|
||||
- Feil på Skjemagruppe vil føre til feil-styling på checkbox/radio og checkboxpanel/radiopanel
|
||||
- Checkboxpanel, Radiopanel og Radio har nå feil-prop
|
||||
- Feil + disabled styling er satt til bare disabled nå.
|
||||
- checkbox/radio og checkboxpanel/radiopanel kan nå alle ta i bruk utenFeilPropagerings-prop
|
||||
|
||||
## 01. Mars 2021
|
||||
|
||||
### Nav-frontend-typografi-style støtter nå Less v4
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
@@ -0,0 +1,48 @@
|
||||
# Nytt oppsett for design.nav.no
|
||||
|
||||
Planener er at nytt design og innhold for design.nav.no vil bli utviklet her med hjelp av nextjs.
|
||||
|
||||
## Kom i gang
|
||||
|
||||
> Note: Kjøres fra root, ikke docs/package.json
|
||||
|
||||
- `yarn install`
|
||||
- `yarn boot`
|
||||
- `yarn next-dev`
|
||||
|
||||
## Nextjs default Readme
|
||||
|
||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||
|
||||
## Getting Started
|
||||
|
||||
First, run the development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
|
||||
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
|
||||
|
||||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
|
||||
|
||||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
||||
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
||||
@@ -0,0 +1,11 @@
|
||||
interface SidebarProps {}
|
||||
|
||||
const Sidebar = ({ ...props }: SidebarProps) => {
|
||||
return (
|
||||
<>
|
||||
<div>Current path</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Sidebar;
|
||||
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
|
||||
return config;
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "docs",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/react": "^17.0.2",
|
||||
"next": "10.0.8",
|
||||
"react": "17.0.1",
|
||||
"react-dom": "17.0.1",
|
||||
"typescript": "^4.2.3",
|
||||
"@navikt/ds-css": "^0.2.0-beta.1",
|
||||
"@navikt/ds-react": "^0.2.0-beta.1"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"rules": {
|
||||
"react/react-in-jsx-scope": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import Sidebar from "../components/sidebar/Sidebar";
|
||||
/* import "@navikt/ds-css/baseline/index.css"; */
|
||||
|
||||
const Website = ({ Component, pageProps }) => {
|
||||
const route = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>NAV Designsystem</title>
|
||||
<link rel="icon" href="/favicon-32x32.png" />
|
||||
</Head>
|
||||
<Sidebar route={route} />
|
||||
<Component {...pageProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Website;
|
||||
@@ -0,0 +1,5 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
|
||||
export default (req, res) => {
|
||||
res.status(200).json({ name: "John Doe" });
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
export default function Home() {
|
||||
return (
|
||||
<div>
|
||||
<main>Website</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
interface Props {}
|
||||
|
||||
const KomIGang = ({ ...props }: Props) => {
|
||||
return (
|
||||
<>
|
||||
<div>Kom-i-gang</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default KomIGang;
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="283" height="64" viewBox="0 0 283 64" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M141.04 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.46 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM248.72 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.45 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM200.24 34c0 6 3.92 10 10 10 4.12 0 7.21-1.87 8.8-4.92l7.68 4.43c-3.18 5.3-9.14 8.49-16.48 8.49-11.05 0-19-7.2-19-18s7.96-18 19-18c7.34 0 13.29 3.19 16.48 8.49l-7.68 4.43c-1.59-3.05-4.68-4.92-8.8-4.92-6.07 0-10 4-10 10zm82.48-29v46h-9V5h9zM36.95 0L73.9 64H0L36.95 0zm92.38 5l-27.71 48L73.91 5H84.3l17.32 30 17.32-30h10.39zm58.91 12v9.69c-1-.29-2.06-.49-3.2-.49-5.81 0-10 4-10 10V51h-9V17h9v9.2c0-5.08 5.91-9.2 13.2-9.2z" fill="#000"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,14 @@
|
||||
html,
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": false,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve"
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
+20
-14
@@ -8,11 +8,11 @@
|
||||
"start": "yarn workspace website start",
|
||||
"boot": "yarn clean:lib && yarn lerna:build",
|
||||
"clean": "yarn workspace website clean",
|
||||
"build:gatsby": "yarn workspace website build:gatsby",
|
||||
"build:gatsby": "yarn react-docgen && yarn workspace website build:gatsby",
|
||||
"serve": "yarn workspace website serve",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"storybook": "yarn run start-storybook -p 6006",
|
||||
"build-storybook": "build-storybook",
|
||||
"chromatic": "npx chromatic --project-token x3xqdfgkujg",
|
||||
"chromatic": "STORYBOOK_CHROMATIC=true npx chromatic --project-token x3xqdfgkujg",
|
||||
"lerna:watch": "yarn run lerna run watch --parallel",
|
||||
"lerna:watch-css": "yarn run lerna run watch-css --parallel",
|
||||
"lerna:build": "yarn run --silent lerna run build",
|
||||
@@ -24,17 +24,20 @@
|
||||
"lint:css": "npx stylelint --syntax css @navikt/**/*.css",
|
||||
"clean:lib": "node utilities/scripts/clean.js",
|
||||
"fix:versions": "node utilities/scripts/fixDependencyVersions.js",
|
||||
"gen:docs": "node utilities/scripts/generateReadmes.js"
|
||||
"gen:docs": "node utilities/scripts/generateReadmes.js",
|
||||
"react-docgen": "node utilities/scripts/react-docgen.js",
|
||||
"next-dev": "yarn workspace docs run dev",
|
||||
"next-prod": "yarn workspace docs run start"
|
||||
},
|
||||
"workspaces": [
|
||||
"website",
|
||||
"docs",
|
||||
"packages/*",
|
||||
"@navikt/ds-css",
|
||||
"@navikt/ds-css/*",
|
||||
"@navikt/ds-react",
|
||||
"@navikt/ds-icons",
|
||||
"@navikt/ds-tokens",
|
||||
"./utilities/build/props-resolver"
|
||||
"@navikt/ds-tokens"
|
||||
],
|
||||
"prettier": {},
|
||||
"eslintConfig": {
|
||||
@@ -45,7 +48,9 @@
|
||||
"node_modules",
|
||||
"lib",
|
||||
"public",
|
||||
"examples"
|
||||
"examples",
|
||||
"esm",
|
||||
"cjs"
|
||||
]
|
||||
},
|
||||
"stylelint": {
|
||||
@@ -68,14 +73,16 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@popperjs/core": "^2.5.4",
|
||||
"@storybook/addon-storysource": "^6.1.21",
|
||||
"@storybook/addons": "^6.1.21",
|
||||
"@storybook/theming": "^6.1.21",
|
||||
"@whitespace/storybook-addon-html": "^4.2.0",
|
||||
"axios": "^0.21.0",
|
||||
"babel-plugin-react-docgen": "^1.8.1",
|
||||
"chalk": "^1.1.3",
|
||||
"color": "^3.1.3",
|
||||
"copyfiles": "^2.4.0",
|
||||
"depth-first": "^4.0.0",
|
||||
"extend": "^3.0.2",
|
||||
"gatsby-transformer-react-docgen-typescript-custom": "0.1.0",
|
||||
"gh-pages": "^3.1.0",
|
||||
"glob": "^7.1.6",
|
||||
"gulp": "^4.0.2",
|
||||
@@ -86,14 +93,12 @@
|
||||
"husky": "^5.0.0",
|
||||
"inquirer": "^7.3.3",
|
||||
"jszip": "^3.5.0",
|
||||
"lerna": "^3.22.1",
|
||||
"lerna": "^4.0.0",
|
||||
"less-vars-to-js": "^1.3.0",
|
||||
"lodash.camelcase": "^4.3.0",
|
||||
"mustache": "^4.0.1",
|
||||
"p-limit": "^3.1.0",
|
||||
"pretty-quick": "^3.1.0",
|
||||
"react-docgen": "^5.3.0",
|
||||
"react-docgen-exports-handler": "^1.0.0",
|
||||
"react-merge-refs": "^1.1.0",
|
||||
"react-popper": "^2.2.4",
|
||||
"react-router-dom": "^5.2.0",
|
||||
@@ -106,6 +111,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@storybook/addon-actions": "^6.1.15",
|
||||
"@storybook/addon-docs": "^6.1.21",
|
||||
"@storybook/addon-essentials": "^6.1.15",
|
||||
"@storybook/addon-links": "^6.1.15",
|
||||
"@storybook/react": "^6.1.15",
|
||||
@@ -123,7 +129,6 @@
|
||||
"eslint-plugin-jsx-a11y": "^6.3.1",
|
||||
"eslint-plugin-react": "^7.21.2",
|
||||
"eslint-plugin-react-hooks": "^4.1.2",
|
||||
"gatsby-transformer-react-docgen-typescript-custom": "0.1.0",
|
||||
"js-beautify": "^1.13.0",
|
||||
"lerna-changelog": "^1.0.1",
|
||||
"less": "^4.1.0",
|
||||
@@ -138,6 +143,7 @@
|
||||
"svg-url-loader": "^7.1.1",
|
||||
"typescript": "^3.7.3",
|
||||
"webpack": "^5.4.0",
|
||||
"webpack-cli": "^4.2.0"
|
||||
"webpack-cli": "^4.2.0",
|
||||
"react-docgen-typescript": "^1.21.0"
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import Alertstripe, {
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Alertstripe",
|
||||
title: "nav-frontend/Alertstripe",
|
||||
component: Alertstripe,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import NavFrontendChevron, {
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Chevron",
|
||||
title: "nav-frontend/Chevron",
|
||||
component: NavFrontendChevron,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import Etikett from "nav-frontend-etiketter";
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Ekspanderbartpanel",
|
||||
title: "nav-frontend/Ekspanderbartpanel",
|
||||
component: Ekspanderbartpanel,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import EtikettBase, {
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Etiketter",
|
||||
title: "nav-frontend/Etiketter",
|
||||
component: EtikettBase,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import Hjelpetekst from "../src/hjelpetekst";
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Hjelpetekst",
|
||||
title: "nav-frontend/Hjelpetekst",
|
||||
component: Hjelpetekst,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Ikonknapper",
|
||||
title: "nav-frontend/Ikonknapper",
|
||||
component: Hamburgerknapp,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ const Cog = () => (
|
||||
);
|
||||
|
||||
export default {
|
||||
title: "Knapper",
|
||||
title: "nav-frontend/Knapper",
|
||||
component: Knapp,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import Lenkepanel from "../src/index";
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Lenkepanel",
|
||||
title: "nav-frontend/Lenkepanel",
|
||||
component: Lenkepanel,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import Lenke from "../src/lenke";
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Lenke",
|
||||
title: "nav-frontend/Lenke",
|
||||
component: Lenke,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import Lesmerpanel from "../src/lesmerpanel";
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Lesmerpanel",
|
||||
title: "nav-frontend/Lesmerpanel",
|
||||
component: Lesmerpanel,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import Modal from "../src/index";
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Modal",
|
||||
title: "nav-frontend/Modal",
|
||||
component: Modal,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import Panel from "../src/index";
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Panel",
|
||||
title: "nav-frontend/Panel",
|
||||
component: Panel,
|
||||
} as Meta;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import Popover from "../src/popover";
|
||||
import { Meta } from "@storybook/react/types-6-0";
|
||||
|
||||
export default {
|
||||
title: "Popover",
|
||||
title: "nav-frontend/Popover",
|
||||
component: Popover,
|
||||
parameters: {
|
||||
chromatic: { disable: true },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nav-frontend-skjema-style",
|
||||
"version": "2.0.33",
|
||||
"version": "2.1.0",
|
||||
"main": "src/index.less",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
|
||||
Loaded 100 of 152 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user