Compare commits

..
Author SHA1 Message Date
github-actions[bot]andgithub-actions[bot] 18d6f63e3e Version Packages (#2006)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-25 15:12:17 +02:00
Ken 4953e6725e 🐛 Ignore figma-plugin 2023-05-25 14:53:43 +02:00
Christian Skrøvseth 5533fbd5a3 Migrate CopyButton from deprecated to modern clipboard (#2005) 2023-05-25 14:40:22 +02:00
Ken 2c54cd077b 🎨 Icon-plugin (#1997) 2023-05-25 13:38:37 +02:00
Ken c84efa5ee9 🐛 Disable chromatic-snapshot av flaky button-story 2023-05-25 13:08:13 +02:00
Ken 9f3bcb8974 🐛 Endret rekkefølge på timeline-eksempler 2023-05-25 13:03:55 +02:00
github-actions[bot]andgithub-actions[bot] c8375ba46f Version Packages (#2002)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-25 12:36:22 +02:00
Ken 288cef591a Timeline viser popover på hover (#1995) 2023-05-25 12:25:26 +02:00
Ken aa3b4c22d6 🎨 Mulighet for manuell sortering av elementer i grunnleggende-sidebar 2023-05-24 18:26:38 +02:00
github-actions[bot]andgithub-actions[bot] 46af5defd9 Version Packages (#2001)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-24 15:32:35 +02:00
Ken 30eee0dac4 🐛 Fikset htmlSize-prop for <Search /> (#2000) 2023-05-24 14:36:34 +02:00
Ken 76b3a65572 Update README.md 2023-05-23 12:39:10 +02:00
github-actions[bot]andgithub-actions[bot] cb7a78e20c Version Packages (#1999)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-22 16:43:10 +02:00
Ken 475e994f49 🐛 DatepickerInput button refactor (#1993) 2023-05-22 16:36:33 +02:00
Ken 53c98181c3 🎨 Oppdatert ikoner (#1998) 2023-05-22 16:34:49 +02:00
Ken 444e905e01 🎨 xsmall variant for CopyButton (#1994) 2023-05-22 16:29:25 +02:00
Ken b7a97339f8 🚚 Flyttet Hva er aksel under 'Om nettstedet' i footer 2023-05-22 10:51:35 +02:00
Ken 1ac0f25420 ⬆️ Oppdatert sanity (#1992) 2023-05-22 09:09:11 +02:00
102 changed files with 2660 additions and 441 deletions

No files matched your search

+6 -1
View File
@@ -20,7 +20,12 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["shadow-dom", "aksel.nav.no", "@navikt/ds-navno"],
"ignore": [
"shadow-dom",
"aksel.nav.no",
"@navikt/ds-navno",
"aksel-icons-figma-plugin"
],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"updateInternalDependents": "always"
+15
View File
@@ -1,5 +1,20 @@
# @navikt/aksel-icons
## 3.3.1
## 3.3.0
## 3.2.4
## 3.2.3
### Patch Changes
- [#1998](https://github.com/navikt/aksel/pull/1998) [`53c98181c`](https://github.com/navikt/aksel/commit/53c98181c327ead3406bec3487c10232af7d463a) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :tada: Nye ikoner!
- :sparkles: FileParagraph
- :sparkles: FilePlus
## 3.2.2
## 3.2.1
+5
View File
@@ -24,6 +24,11 @@ fs.writeFileSync(
`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 = {
@@ -0,0 +1,26 @@
# 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
@@ -0,0 +1,22 @@
![](/src/assets/gh-cover.png)
# 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)
@@ -0,0 +1,10 @@
{
"name": "Aksel Icons",
"id": "1221057403873975172",
"api": "1.0.0",
"main": "dist/plugin.js",
"ui": "dist/index.html",
"capabilities": [],
"enableProposedApi": false,
"editorType": ["figma", "figjam"]
}
@@ -0,0 +1,35 @@
{
"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.0",
"postcss-url": "^10.1.3",
"typescript": "^4.8.0",
"vite": "^4.2.0",
"vite-plugin-singlefile": "^0.13.3",
"vite-plugin-svgr": "^2.4.0"
}
}
@@ -0,0 +1,31 @@
/* eslint-disable import/no-anonymous-default-export */
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)}"`;
},
};
}
@@ -0,0 +1,50 @@
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,
};
}
},
};
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,4 @@
<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>

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,21 @@
/* eslint-disable no-restricted-globals */
/* eslint-disable no-undef */
import * as Networker from "monorepo-networker";
import { NetworkMessages } from "@common/network/messages";
import { NetworkSide } from "@common/network/sides";
export const initializeNetwork = Networker.createInitializer({
messagesRegistry: NetworkMessages.registry,
initTransports: function (register) {
register(NetworkSide.PLUGIN, NetworkSide.UI, (message) => {
// @ts-ignore
figma.ui.postMessage(message);
});
register(NetworkSide.UI, NetworkSide.PLUGIN, (message) => {
// @ts-ignore
parent.postMessage({ pluginMessage: message }, "*");
});
},
});
@@ -0,0 +1,21 @@
import { CreateRectMessage } from "@common/network/messages/CreateRectMessage";
import { HelloMessage } from "@common/network/messages/HelloMessage";
import { PingMessage } from "@common/network/messages/PingMessage";
import { NetworkSide } from "@common/network/sides";
import * as Networker from "monorepo-networker";
export namespace NetworkMessages {
export const registry = new Networker.MessageTypeRegistry();
export const PING = registry.register(new PingMessage("ping"));
export const HELLO_PLUGIN = registry.register(
new HelloMessage(NetworkSide.PLUGIN)
);
export const HELLO_UI = registry.register(new HelloMessage(NetworkSide.UI));
export const CREATE_RECT = registry.register(
new CreateRectMessage("create-rect")
);
}
@@ -0,0 +1,42 @@
/* eslint-disable no-undef */
import { NetworkSide } from "@common/network/sides";
import * as Networker from "monorepo-networker";
interface Payload {
width: number;
height: number;
}
export class CreateRectMessage extends Networker.MessageType<Payload> {
public receivingSide(): Networker.Side {
return NetworkSide.PLUGIN;
}
public handle(payload: Payload, from: Networker.Side): void {
// @ts-ignore
if (figma.editorType === "figma") {
// @ts-ignore
const rect = figma.createRectangle();
rect.x = 0;
rect.y = 0;
rect.name = "Plugin Rectangle # " + Math.floor(Math.random() * 9999);
rect.fills = [
{
type: "SOLID",
color: {
r: Math.random(),
g: Math.random(),
b: Math.random(),
},
},
];
rect.resize(payload.width, payload.height);
// @ts-ignore
figma.currentPage.appendChild(rect);
// @ts-ignore
figma.viewport.scrollAndZoomIntoView([rect]);
// @ts-ignore
figma.closePlugin();
}
}
}
@@ -0,0 +1,19 @@
import * as Networker from "monorepo-networker";
interface Payload {
text: string;
}
export class HelloMessage extends Networker.MessageType<Payload> {
constructor(private side: Networker.Side) {
super("hello-" + side.getName());
}
receivingSide(): Networker.Side {
return this.side;
}
handle(payload: Payload, from: Networker.Side) {
console.log(`${from.getName()} said "${payload.text}"`);
}
}
@@ -0,0 +1,17 @@
import * as Networker from "monorepo-networker";
import { NetworkSide } from "@common/network/sides";
interface Payload {}
type Response = string;
export class PingMessage extends Networker.MessageType<Payload, Response> {
receivingSide(): Networker.Side {
return NetworkSide.PLUGIN;
}
handle(payload: Payload, from: Networker.Side): string {
console.log(from.getName(), "has pinged us!");
return `Pong, ${from.getName()}!`;
}
}
@@ -0,0 +1,24 @@
/* eslint-disable no-undef */
import * as Networker from "monorepo-networker";
export namespace NetworkSide {
export const PLUGIN = Networker.Side.register(
new Networker.Side<MessageEvent<any>>("Plugin", {
// @ts-ignore
attachListener: (callback) => figma.ui.on("message", callback),
// @ts-ignore
detachListener: (callback) => figma.ui.off("message", callback),
})
);
export const UI = Networker.Side.register(
new Networker.Side("UI", {
shouldHandle: (event) => event.data?.pluginId != null,
messageGetter: (event) => event.data.pluginMessage,
attachListener: (callback) =>
window.addEventListener("message", callback),
detachListener: (callback) =>
window.removeEventListener("message", callback),
})
);
}
@@ -0,0 +1,48 @@
/* eslint-disable no-undef */
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;
}
});
@@ -0,0 +1,193 @@
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) => {
let svg = document.getElementById(id)?.outerHTML;
let size = 24;
// eslint-disable-next-line no-restricted-globals
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`];
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;
@@ -0,0 +1,79 @@
@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: 2px;
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);
}
@@ -0,0 +1,12 @@
<!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>
@@ -0,0 +1,9 @@
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>
);
@@ -0,0 +1,56 @@
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)
);
};
+30
View File
@@ -0,0 +1,30 @@
/// <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;
}
@@ -0,0 +1,30 @@
{
"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/**/*"]
}
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": [
"vite.config.plugin.ts",
"vite.config.ui.ts",
"./scripts/vite/*.ts"
]
}
@@ -0,0 +1,17 @@
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"),
},
});
@@ -0,0 +1,25 @@
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 -1
View File
@@ -15,5 +15,5 @@ keywords:
- skråning
- helning
variant: Stroke
updated_at: 08.03.2023
updated_at: 22.05.2023
created_at: 07.03.2023
@@ -11,5 +11,5 @@ keywords:
- handel
- økonomi
variant: Stroke
updated_at: 08.03.2023
updated_at: 16.05.2023
created_at: 07.03.2023
+1 -1
View File
@@ -7,5 +7,5 @@ keywords:
- lukket
- hidden
variant: Stroke
updated_at: 08.03.2023
updated_at: 05.05.2023
created_at: 07.03.2023
@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.75 4.75V19.25H17.25V8.75H14.5C13.8096 8.75 13.25 8.19036 13.25 7.5V4.75H6.75ZM14.75 5.81066L16.1893 7.25H14.75V5.81066ZM5.25 4.5C5.25 3.80964 5.80964 3.25 6.5 3.25H14C14.1989 3.25 14.3897 3.32902 14.5303 3.46967L18.5303 7.46967C18.671 7.61032 18.75 7.80109 18.75 8V19.5C18.75 20.1904 18.1904 20.75 17.5 20.75H6.5C5.80964 20.75 5.25 20.1904 5.25 19.5V4.5ZM9.96599 11.0256C9.96599 9.906 10.8749 9 11.9927 9C12.5664 9 13.0857 9.23917 13.4539 9.62112C13.7414 9.91932 13.7327 10.3941 13.4345 10.6816C13.1363 10.9691 12.6615 10.9604 12.3741 10.6622C12.2767 10.5613 12.1424 10.5 11.9927 10.5C11.7016 10.5 11.466 10.7362 11.466 11.0256C11.466 11.2386 11.5945 11.4305 11.7915 11.5116L13.7023 12.2984C14.5828 12.661 15.039 13.6373 14.7523 14.5454C14.6107 14.9939 14.3133 15.3485 13.9395 15.57C13.9933 15.7527 14.0218 15.9449 14.0218 16.1418C14.0218 17.2614 13.1128 18.1674 11.995 18.1674C11.0546 18.1674 10.264 17.5278 10.0337 16.6602C9.92739 16.2599 10.1658 15.8492 10.5661 15.7429C10.9665 15.6366 11.3772 15.875 11.4835 16.2753C11.5434 16.5012 11.7509 16.6674 11.995 16.6674C12.2862 16.6674 12.5218 16.4312 12.5218 16.1418C12.5218 15.9288 12.3932 15.7369 12.1963 15.6558L10.2855 14.869C9.40497 14.5065 8.9487 13.5301 9.23544 12.6221C9.37709 12.1735 9.67447 11.8189 10.0483 11.5974C9.99448 11.4147 9.96599 11.2225 9.96599 11.0256ZM10.8566 13.482L12.6473 14.2194C12.6562 14.2222 12.6651 14.2252 12.6739 14.2284L12.8915 14.3067C13.0695 14.3708 13.265 14.274 13.3219 14.0937C13.374 13.9287 13.2911 13.7513 13.1311 13.6854L11.3404 12.9481C11.3315 12.9452 11.3227 12.9422 11.3138 12.939L11.0962 12.8607C10.9183 12.7966 10.7228 12.8934 10.6658 13.0738C10.6137 13.2387 10.6966 13.4161 10.8566 13.482Z" fill="#262626"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,17 @@
name: FileParagraph
category: Files and application
sub_category: Files
keywords:
- document
- dokument
- fil
- file
- error
- feil
- feilmelding
- corrupt
- bad file
- korrupt fil
variant: Stroke
updated_at: 22.05.2023
created_at: 22.05.2023
@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.25 7.5V3.5C13.25 3.36193 13.1381 3.25 13 3.25H6.5C5.80964 3.25 5.25 3.80964 5.25 4.5V19.5C5.25 20.1904 5.80964 20.75 6.5 20.75H17.5C18.1904 20.75 18.75 20.1904 18.75 19.5V9C18.75 8.86193 18.6381 8.75 18.5 8.75H14.5C13.8096 8.75 13.25 8.19036 13.25 7.5ZM15 7.25C14.8619 7.25 14.75 7.13807 14.75 7V4.29289C14.75 4.07017 15.0193 3.95863 15.1768 4.11612L17.8839 6.82322C18.0414 6.98071 17.9298 7.25 17.7071 7.25H15ZM9.96599 11.0256C9.96599 9.906 10.8749 9 11.9927 9C12.5664 9 13.0857 9.23917 13.4539 9.62112C13.7414 9.91932 13.7327 10.3941 13.4345 10.6816C13.1363 10.9691 12.6615 10.9604 12.3741 10.6622C12.2767 10.5613 12.1424 10.5 11.9927 10.5C11.7016 10.5 11.466 10.7362 11.466 11.0256C11.466 11.2386 11.5945 11.4305 11.7915 11.5116L13.7023 12.2984C14.5828 12.661 15.039 13.6373 14.7523 14.5454C14.6318 14.927 14.3985 15.2407 14.1012 15.4622C14.0095 15.5306 13.9637 15.6466 13.9853 15.7589C14.0093 15.8836 14.0218 16.0117 14.0218 16.1418C14.0218 17.2614 13.1128 18.1674 11.995 18.1674C11.0546 18.1674 10.264 17.5278 10.0337 16.6602C9.92739 16.2599 10.1658 15.8492 10.5661 15.7429C10.9665 15.6366 11.3772 15.875 11.4835 16.2753C11.5434 16.5012 11.7509 16.6674 11.995 16.6674C12.2862 16.6674 12.5218 16.4312 12.5218 16.1418C12.5218 15.9288 12.3932 15.7369 12.1963 15.6558L10.2855 14.869C9.40497 14.5065 8.9487 13.5301 9.23544 12.6221C9.35598 12.2404 9.58928 11.9267 9.8865 11.7052C9.97822 11.6368 10.024 11.5208 10.0024 11.4085C9.97844 11.2838 9.96599 11.1557 9.96599 11.0256ZM10.8566 13.482L12.6473 14.2194C12.6562 14.2222 12.6651 14.2252 12.6739 14.2284L12.8915 14.3067C13.0695 14.3708 13.265 14.274 13.3219 14.0937C13.374 13.9287 13.2911 13.7513 13.1311 13.6854L11.3404 12.9481C11.3315 12.9452 11.3227 12.9422 11.3138 12.939L11.0962 12.8607C10.9183 12.7966 10.7228 12.8934 10.6658 13.0738C10.6137 13.2387 10.6966 13.4161 10.8566 13.482Z" fill="#262626"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -0,0 +1,17 @@
name: FileParagraphFill
category: Files and application
sub_category: Files
keywords:
- document
- dokument
- fil
- file
- error
- feil
- feilmelding
- corrupt
- bad file
- korrupt fil
variant: Fill
updated_at: 22.05.2023
created_at: 22.05.2023
+3
View File
@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.75 19.25V4.75H13.25V7.5C13.25 8.19036 13.8096 8.75 14.5 8.75H17.25V19.25H6.75ZM16.1893 7.25L14.75 5.81066V7.25H16.1893ZM6.5 3.25C5.80964 3.25 5.25 3.80964 5.25 4.5V19.5C5.25 20.1904 5.80964 20.75 6.5 20.75H17.5C18.1904 20.75 18.75 20.1904 18.75 19.5V8C18.75 7.80109 18.671 7.61032 18.5303 7.46967L14.5303 3.46967C14.3897 3.32902 14.1989 3.25 14 3.25H6.5ZM9.12868 14C9.12868 13.5858 9.46447 13.25 9.87868 13.25H11.25V11.8787C11.25 11.4645 11.5858 11.1287 12 11.1287C12.4142 11.1287 12.75 11.4645 12.75 11.8787V13.25H14.1213C14.5355 13.25 14.8713 13.5858 14.8713 14C14.8713 14.4142 14.5355 14.75 14.1213 14.75H12.75V16.1213C12.75 16.5355 12.4142 16.8713 12 16.8713C11.5858 16.8713 11.25 16.5355 11.25 16.1213V14.75H9.87868C9.46447 14.75 9.12868 14.4142 9.12868 14Z" fill="#262626"/>
</svg>

After

Width:  |  Height:  |  Size: 936 B

+17
View File
@@ -0,0 +1,17 @@
name: FilePlus
category: Files and application
sub_category: Files
keywords:
- document
- dokument
- fil
- file
- error
- feil
- feilmelding
- corrupt
- bad file
- korrupt fil
variant: Stroke
updated_at: 22.05.2023
created_at: 22.05.2023
@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.25 7.5V3.5C13.25 3.36193 13.1381 3.25 13 3.25H6.5C5.80964 3.25 5.25 3.80964 5.25 4.5V19.5C5.25 20.1904 5.80964 20.75 6.5 20.75H17.5C18.1904 20.75 18.75 20.1904 18.75 19.5V9C18.75 8.86193 18.6381 8.75 18.5 8.75H14.5C13.8096 8.75 13.25 8.19036 13.25 7.5ZM15 7.25C14.8619 7.25 14.75 7.13807 14.75 7V4.29289C14.75 4.07017 15.0193 3.95863 15.1768 4.11612L17.8839 6.82322C18.0414 6.98071 17.9298 7.25 17.7071 7.25H15ZM12.0001 11.1287C12.4143 11.1287 12.7501 11.4645 12.7501 11.8787V13C12.7501 13.1381 12.862 13.25 13.0001 13.25H14.1214C14.5356 13.25 14.8714 13.5858 14.8714 14C14.8714 14.4142 14.5356 14.75 14.1214 14.75H13.0001C12.862 14.75 12.7501 14.8619 12.7501 15V16.1213C12.7501 16.5355 12.4143 16.8713 12.0001 16.8713C11.5858 16.8713 11.2501 16.5355 11.2501 16.1213V15C11.2501 14.8619 11.1381 14.75 11.0001 14.75H9.87874C9.46453 14.75 9.12874 14.4142 9.12874 14C9.12874 13.5858 9.46453 13.25 9.87874 13.25H11.0001C11.1381 13.25 11.2501 13.1381 11.2501 13V11.8787C11.2501 11.4645 11.5858 11.1287 12.0001 11.1287Z" fill="#262626"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,17 @@
name: FilePlusFill
category: Files and application
sub_category: Files
keywords:
- document
- dokument
- fil
- file
- error
- feil
- feilmelding
- corrupt
- bad file
- korrupt fil
variant: Fill
updated_at: 22.05.2023
created_at: 22.05.2023
@@ -1,3 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 3.25C3.58579 3.25 3.25 3.58579 3.25 4V20C3.25 20.4142 3.58579 20.75 4 20.75H20C20.4142 20.75 20.75 20.4142 20.75 20V4C20.75 3.58579 20.4142 3.25 20 3.25H4ZM4.75 19.25V4.75H19.25V19.25H4.75ZM12 7C11.4477 7 11 7.44772 11 8C11 8.55228 11.4477 9 12 9C12.5523 9 13 8.55228 13 8C13 7.44772 12.5523 7 12 7ZM10.5 10.25C10.0858 10.25 9.75 10.5858 9.75 11C9.75 11.4142 10.0858 11.75 10.5 11.75H11.25V15.75H10.5C10.0858 15.75 9.75 16.0858 9.75 16.5C9.75 16.9142 10.0858 17.25 10.5 17.25H12H13.5C13.9142 17.25 14.25 16.9142 14.25 16.5C14.25 16.0858 13.9142 15.75 13.5 15.75H12.75V11C12.75 10.5858 12.4142 10.25 12 10.25H10.5Z" fill="#262626"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 3.25C3.58579 3.25 3.25 3.58579 3.25 4V20C3.25 20.4142 3.58579 20.75 4 20.75H20C20.4142 20.75 20.75 20.4142 20.75 20V4C20.75 3.58579 20.4142 3.25 20 3.25H4ZM4.75 19.25V4.75H19.25V19.25H4.75ZM12 6.75C11.4477 6.75 11 7.19772 11 7.75C11 8.30228 11.4477 8.75 12 8.75C12.5523 8.75 13 8.30228 13 7.75C13 7.19772 12.5523 6.75 12 6.75ZM10.5 10C10.0858 10 9.75 10.3358 9.75 10.75C9.75 11.1642 10.0858 11.5 10.5 11.5H11.25V15.5H10.5C10.0858 15.5 9.75 15.8358 9.75 16.25C9.75 16.6642 10.0858 17 10.5 17H12H13.5C13.9142 17 14.25 16.6642 14.25 16.25C14.25 15.8358 13.9142 15.5 13.5 15.5H12.75V10.75C12.75 10.3358 12.4142 10 12 10H10.5Z" fill="#262626"/>
</svg>

Before

Width:  |  Height:  |  Size: 787 B

After

Width:  |  Height:  |  Size: 795 B

@@ -1,3 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.25 4C3.25 3.58579 3.58579 3.25 4 3.25H20C20.4142 3.25 20.75 3.58579 20.75 4V20C20.75 20.4142 20.4142 20.75 20 20.75H4C3.58579 20.75 3.25 20.4142 3.25 20V4ZM11 8C11 7.44772 11.4477 7 12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8ZM9.75 11C9.75 10.5858 10.0858 10.25 10.5 10.25H12C12.4142 10.25 12.75 10.5858 12.75 11V15.75H13.5C13.9142 15.75 14.25 16.0858 14.25 16.5C14.25 16.9142 13.9142 17.25 13.5 17.25H12H10.5C10.0858 17.25 9.75 16.9142 9.75 16.5C9.75 16.0858 10.0858 15.75 10.5 15.75H11.25V11.75H10.5C10.0858 11.75 9.75 11.4142 9.75 11Z" fill="#262626"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.25 4C3.25 3.58579 3.58579 3.25 4 3.25H20C20.4142 3.25 20.75 3.58579 20.75 4V20C20.75 20.4142 20.4142 20.75 20 20.75H4C3.58579 20.75 3.25 20.4142 3.25 20V4ZM11 7.75C11 7.19772 11.4477 6.75 12 6.75C12.5523 6.75 13 7.19772 13 7.75C13 8.30228 12.5523 8.75 12 8.75C11.4477 8.75 11 8.30228 11 7.75ZM9.75 10.75C9.75 10.3358 10.0858 10 10.5 10H12C12.4142 10 12.75 10.3358 12.75 10.75V15.5H13.5C13.9142 15.5 14.25 15.8358 14.25 16.25C14.25 16.6642 13.9142 17 13.5 17H12H10.5C10.0858 17 9.75 16.6642 9.75 16.25C9.75 15.8358 10.0858 15.5 10.5 15.5H11.25V11.5H10.5C10.0858 11.5 9.75 11.1642 9.75 10.75Z" fill="#262626"/>
</svg>

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 764 B

+1 -1
View File
@@ -5,5 +5,5 @@ keywords:
- "%"
- prosent
variant: Stroke
updated_at: 08.03.2023
updated_at: 05.05.2023
created_at: 07.03.2023
+1 -1
View File
@@ -15,5 +15,5 @@ keywords:
- strand
- natur
variant: Stroke
updated_at: 08.03.2023
updated_at: 08.05.2023
created_at: 07.03.2023
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/aksel-icons",
"version": "3.2.2",
"version": "3.3.1",
"author": "Aksel | NAV",
"homepage": "https://aksel.nav.no/ikoner",
"repository": {
+28
View File
@@ -1,5 +1,33 @@
# @navikt/aksel
## 3.3.1
### Patch Changes
- Updated dependencies []:
- @navikt/ds-css@3.3.1
## 3.3.0
### Patch Changes
- Updated dependencies []:
- @navikt/ds-css@3.3.0
## 3.2.4
### Patch Changes
- Updated dependencies [[`30eee0dac`](https://github.com/navikt/aksel/commit/30eee0dac4e3e5a1379033283a6885e646e80458)]:
- @navikt/ds-css@3.2.4
## 3.2.3
### Patch Changes
- Updated dependencies [[`475e994f4`](https://github.com/navikt/aksel/commit/475e994f494b2080ffc05eb1684b6a244e3e2969), [`444e905e0`](https://github.com/navikt/aksel/commit/444e905e01965fd5cac40ff20c5225b072e67221)]:
- @navikt/ds-css@3.2.3
## 3.2.2
### Patch Changes
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/aksel",
"version": "3.2.2",
"version": "3.3.1",
"description": "Aksel command line interface. Handles css-imports, codemods and more",
"author": "Aksel | NAV designsystem team",
"license": "MIT",
@@ -29,7 +29,7 @@
},
"homepage": "https://aksel.nav.no/grunnleggende/kode/kommandolinje",
"dependencies": {
"@navikt/ds-css": "3.2.2",
"@navikt/ds-css": "3.3.1",
"axios": "1.3.6",
"chalk": "4.1.0",
"clipboardy": "^2.3.0",
+8
View File
@@ -1,5 +1,13 @@
# @navikt/ds-codemod
## 3.3.1
## 3.3.0
## 3.2.4
## 3.2.3
## 3.2.2
## 3.2.1
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-codemod",
"version": "3.2.2",
"version": "3.3.1",
"description": "Aksel codemods for NAVs designsystem",
"author": "Aksel | NAV designsystem team",
"license": "MIT",
+2 -2
View File
@@ -40,8 +40,8 @@
"build-pict": "svgr --silent --index-template index-template.js --out-dir src/pictograms pictograms"
},
"dependencies": {
"@navikt/ds-icons": "^3.2.2",
"@navikt/ds-react": "^3.2.2",
"@navikt/ds-icons": "^3.3.1",
"@navikt/ds-react": "^3.3.1",
"clsx": "^1.1.1"
},
"devDependencies": {
+22
View File
@@ -1,5 +1,27 @@
# @navikt/ds-css
## 3.3.1
## 3.3.0
## 3.2.4
### Patch Changes
- [#2000](https://github.com/navikt/aksel/pull/2000) [`30eee0dac`](https://github.com/navikt/aksel/commit/30eee0dac4e3e5a1379033283a6885e646e80458) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :bug: Search støtter nå htmlSize-prop
## 3.2.3
### Patch Changes
- [#1993](https://github.com/navikt/aksel/pull/1993) [`475e994f4`](https://github.com/navikt/aksel/commit/475e994f494b2080ffc05eb1684b6a244e3e2969) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :bug: Fikset small-variant av datepicker-input
- :recycle: Refactored Datepicker.Input-button for bugfix
- [#1994](https://github.com/navikt/aksel/pull/1994) [`444e905e0`](https://github.com/navikt/aksel/commit/444e905e01965fd5cac40ff20c5225b072e67221) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :tada: CopyButton har nå en `xsmall`-variant
- Kan nå lettere brukes i tabeller
## 3.2.2
## 3.2.1
+22
View File
@@ -27,6 +27,12 @@
min-height: 2rem;
}
.navds-copybutton--xsmall {
--__ac-copybutton-padding: var(--a-spacing-05) var(--a-spacing-2);
min-height: 1.5rem;
}
.navds-copybutton--icon-only {
--__ac-copybutton-padding: var(--a-spacing-3);
}
@@ -35,6 +41,14 @@
--__ac-copybutton-padding: var(--a-spacing-1);
}
.navds-copybutton--xsmall.navds-copybutton--icon-only {
--__ac-copybutton-padding: var(--a-spacing-05);
}
.navds-copybutton--xsmall .navds-copybutton__icon {
font-size: 1.25rem;
}
.navds-copybutton__icon {
font-size: 1.5rem;
display: flex;
@@ -45,6 +59,10 @@
margin: 0;
}
:where(.navds-copybutton--small, .navds-copybutton--xsmall):where(:not(:only-child)) {
margin: -2px;
}
.navds-copybutton:focus-visible {
outline: none;
box-shadow: var(--a-shadow-focus);
@@ -108,6 +126,10 @@
gap: var(--a-spacing-2);
}
.navds-copybutton--xsmall > .navds-copybutton__content {
gap: var(--a-spacing-1);
}
.navds-copybutton--active > .navds-copybutton__content {
animation: var(--ac-copybutton-animation, akselCopyButtonAnimation 0.4s linear);
}
+35 -8
View File
@@ -198,11 +198,11 @@
}
.navds-date__field-input {
padding-right: var(--a-spacing-12);
padding-right: var(--a-spacing-14);
}
.navds-form-field--small .navds-date__field-input {
padding-right: var(--a-spacing-8);
padding-right: var(--a-spacing-10);
}
/* Error-handling */
@@ -223,24 +223,51 @@
.navds-date__field-button {
position: absolute;
right: var(--a-spacing-2);
right: 1px;
top: 50%;
transform: translateY(-50%);
color: var(--ac-date-input-button-text, var(--a-text-default));
display: inline-flex;
cursor: pointer;
margin: 0;
text-decoration: none;
border: none;
background: none;
border-radius: 3px;
padding: var(--a-spacing-3);
align-items: center;
justify-content: center;
font-size: 1.5rem;
height: calc(100% - 2px);
border-start-start-radius: 0;
border-end-start-radius: 0;
}
.navds-form-field--small .navds-date__field-button {
right: var(--a-spacing-2);
height: 1.5rem;
width: 1.5rem;
padding: var(--a-spacing-1);
}
.navds-form-field--small .navds-date__field-button svg {
font-size: var(--a-font-size-medium);
.navds-date__field-button:hover:where(:not([disabled])) {
color: var(--ac-date-input-button-hover-text, var(--a-text-action-on-action-subtle));
background-color: var(--ac-date-input-button-hover-bg, var(--a-surface-action-subtle-hover));
}
.navds-form-field--disabled .navds-date__field-button {
opacity: 1;
cursor: not-allowed;
}
.navds-date__field-button:focus-visible {
outline: none;
box-shadow: var(--a-shadow-focus);
border-radius: var(--a-border-radius-medium);
}
@supports not selector(:focus-visible) {
.navds-date__field-button:focus {
outline: none;
box-shadow: var(--a-shadow-focus);
}
}
.navds-date__caption__year {
+4
View File
@@ -17,6 +17,10 @@
width: 100%;
}
.navds-search--with-size :where(.navds-search__wrapper-inner) {
width: inherit;
}
.navds-search__wrapper {
display: inline-flex;
align-items: center;
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-css",
"version": "3.2.2",
"version": "3.3.1",
"description": "CSS for NAV Designsystem",
"author": "Aksel | NAV designsystem team",
"keywords": [
@@ -27,7 +27,7 @@
"css:get-version": "node config/get-version.js"
},
"devDependencies": {
"@navikt/ds-tokens": "^3.2.2",
"@navikt/ds-tokens": "^3.3.1",
"cssnano": "6.0.0",
"fast-glob": "3.2.11",
"lodash": "4.17.21",
+3 -1
View File
@@ -131,7 +131,9 @@
"--ac-date-today-border": "--a-border-action-selected",
"--ac-date-caption-text": "--a-text-default",
"--ac-date-input-error-border": "--a-border-danger",
"--ac-date-input-button-text": "--a-text-default"
"--ac-date-input-button-text": "--a-text-default",
"--ac-date-input-button-hover-text": "--a-text-action-on-action-subtle",
"--ac-date-input-button-hover-bg": "--a-surface-action-subtle-hover"
},
"expansioncard": {
"--ac-expansioncard-bg": "--a-surface-default",
+50
View File
@@ -1,5 +1,55 @@
# @navikt/ds-react
## 3.3.1
### Patch Changes
- [#2005](https://github.com/navikt/aksel/pull/2005) [`5533fbd5a`](https://github.com/navikt/aksel/commit/5533fbd5a3a2b3e08f3c818e2669daccafb6212a) Thanks [@cskrov](https://github.com/cskrov)! - Migrert `CopyButton` til `Clipboard API`
- `CopyButton` bruker nå [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API).
- `execCommand()` er fjernet fordi den [er deprecated](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand).
- Nettlesere som ikke støtter `Clipboard API` vil falle tilbake på `window.prompt()`.
- Updated dependencies []:
- @navikt/aksel-icons@3.3.1
## 3.3.0
### Patch Changes
- [#1995](https://github.com/navikt/aksel/pull/1995) [`288cef591`](https://github.com/navikt/aksel/commit/288cef591abb0557295e50cf6e696d7a51607c32) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :tada: Timeline viser nå popover/tooltip på hover.
- Popover vises nå ikke lengre ved klikk.
- Period og Pin bruker nå begge ny popover.
- Kode og styling for Popover er nå inlinet i Timeline, og bruker ikke `@navikt/ds-react` sin versjon.
- Updated dependencies []:
- @navikt/aksel-icons@3.3.0
## 3.2.4
### Patch Changes
- [#2000](https://github.com/navikt/aksel/pull/2000) [`30eee0dac`](https://github.com/navikt/aksel/commit/30eee0dac4e3e5a1379033283a6885e646e80458) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :bug: Search støtter nå htmlSize-prop
- Updated dependencies []:
- @navikt/aksel-icons@3.2.4
## 3.2.3
### Patch Changes
- [#1993](https://github.com/navikt/aksel/pull/1993) [`475e994f4`](https://github.com/navikt/aksel/commit/475e994f494b2080ffc05eb1684b6a244e3e2969) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :bug: Fikset small-variant av datepicker-input
- :recycle: Refactored Datepicker.Input-button for bugfix
- [#1994](https://github.com/navikt/aksel/pull/1994) [`444e905e0`](https://github.com/navikt/aksel/commit/444e905e01965fd5cac40ff20c5225b072e67221) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :tada: CopyButton har nå en `xsmall`-variant
- Kan nå lettere brukes i tabeller
- Updated dependencies [[`53c98181c`](https://github.com/navikt/aksel/commit/53c98181c327ead3406bec3487c10232af7d463a)]:
- @navikt/aksel-icons@3.2.3
## 3.2.2
### Patch Changes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-react",
"version": "3.2.2",
"version": "3.3.1",
"description": "Aksel react-components for NAV designsystem",
"author": "Aksel | NAV designsystem team",
"license": "MIT",
@@ -37,8 +37,8 @@
"test": "TZ=UTC jest"
},
"dependencies": {
"@floating-ui/react": "0.17.0",
"@navikt/aksel-icons": "^3.2.2",
"@floating-ui/react": "0.24.1",
"@navikt/aksel-icons": "^3.3.1",
"@radix-ui/react-tabs": "1.0.0",
"@radix-ui/react-toggle-group": "1.0.0",
"clsx": "^1.2.1",
@@ -123,7 +123,7 @@ export const Link = () => (
export const Loading = {
render: () => (
<div className="colgap">
<div className="colgap chromatic-ignore">
<div className="rowgap">
{variants.map((variant) => (
<Button key={variant} variant={variant} loading>
@@ -153,7 +153,7 @@ export const Loading = {
};
export const Icon = () => (
<div className="colgap">
<div className="colgap ">
<div className="rowgap">
{variants.map((variant) => (
<Button
@@ -250,7 +250,7 @@ export const Disabled = () => (
export const LoadingWithAs = {
render: () => (
<div className="colgap">
<div className="colgap chromatic-ignore">
<div className="rowgap">
{variants.map((variant) => (
<Button key={variant} variant={variant} loading size="small">
@@ -14,8 +14,9 @@ export interface CopyButtonProps
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
/**
* @default "medium"
* xsmall should only be used in tables/
*/
size?: "medium" | "small";
size?: "medium" | "small" | "xsmall";
/**
* @default "neutral"
*/
@@ -11,7 +11,7 @@ export default {
size: {
defaultValue: "medium",
control: { type: "radio" },
options: ["small", "medium"],
options: ["small", "medium", "xsmall"],
},
variant: {
defaultValue: undefined,
@@ -85,6 +85,22 @@ export const Sizes = {
text="Kopier"
/>
</div>
<div className="rowgap">
<CopyButton size="xsmall" copyText="3.14" variant="action" />
<CopyButton size="xsmall" copyText="3.14" variant="neutral" />
<CopyButton
size="xsmall"
copyText="3.14"
variant="action"
text="Kopier"
/>
<CopyButton
size="xsmall"
copyText="3.14"
variant="neutral"
text="Kopier"
/>
</div>
</div>
),
};
@@ -107,6 +123,14 @@ export const Texts = {
activeText="Kopierte XYZ"
/>
</div>
<div>
<CopyButton
copyText="3.14"
size="xsmall"
text="Kopier XYZ"
activeText="Kopierte XYZ"
/>
</div>
</div>
),
};
@@ -129,6 +153,14 @@ export const Icons = {
activeIcon={<ThumbUpIcon title="Kopiert" />}
/>
</div>
<div>
<CopyButton
copyText="3.14"
size="xsmall"
icon={<LinkIcon title="Kopier" />}
activeIcon={<ThumbUpIcon title="Kopiert" />}
/>
</div>
</div>
),
};
+16 -18
View File
@@ -1,7 +1,7 @@
import { CalendarIcon } from "@navikt/aksel-icons";
import cl from "clsx";
import React, { forwardRef, InputHTMLAttributes } from "react";
import { BodyShort, Button, ErrorMessage, Label, omit } from "..";
import { BodyShort, ErrorMessage, Label, omit } from "..";
import { FormFieldProps, useFormField } from "../form/useFormField";
import { useDateInputContext } from "./context";
@@ -115,24 +115,22 @@ const DateInput: DateInputType = forwardRef<HTMLInputElement, DateInputProps>(
)}
size={14}
/>
<Button
variant="tertiary"
type="button"
size="small"
onClick={() => onOpen()}
className="navds-date__field-button"
tabIndex={open ? -1 : 0}
<button
disabled={inputProps.disabled}
icon={
<CalendarIcon
title={
open
? conditionalVariables.iconTitle.close
: conditionalVariables.iconTitle.open
}
/>
}
/>
tabIndex={open ? -1 : 0}
onClick={() => onOpen()}
type="button"
className="navds-date__field-button"
>
<CalendarIcon
pointerEvents="none"
title={
open
? conditionalVariables.iconTitle.close
: conditionalVariables.iconTitle.open
}
/>
</button>
</div>
<div
className="navds-form-field__error"
@@ -324,3 +324,22 @@ export const defaultShownMonth = () => {
</div>
);
};
export const Size = () => {
const { datepickerProps, inputProps } = UNSAFE_useDatepicker({
fromDate: new Date("Aug 23 2019"),
toDate: new Date("Feb 23 2024"),
onDateChange: console.log,
});
return (
<div style={{ display: "flex", gap: "1rem" }}>
<DatePicker {...datepickerProps} dropdownCaption>
<DatePicker.Input size="medium" {...inputProps} label="Velg dato" />
</DatePicker>
<DatePicker {...datepickerProps} dropdownCaption>
<DatePicker.Input size="small" {...inputProps} label="Velg dato" />
</DatePicker>
</div>
);
};
@@ -67,6 +67,10 @@ export interface SearchProps
* @default "primary"
*/
variant?: "primary" | "secondary" | "simple";
/**
* Exposes the HTML size attribute
*/
htmlSize?: number | string;
}
interface SearchComponent
@@ -112,6 +116,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
defaultValue,
onChange,
onSearchClick,
htmlSize,
...rest
} = props;
@@ -164,9 +169,11 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
"navds-form-field",
`navds-form-field--${size}`,
"navds-search",
{
"navds-search--error": hasError,
"navds-search--disabled": !!inputProps.disabled,
"navds-search--with-size": !!htmlSize,
}
)}
>
@@ -215,6 +222,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
"navds-body-short",
`navds-body-${size}`
)}
{...(htmlSize ? { size: Number(htmlSize) } : {})}
/>
{(value ?? internalValue) && clearButton && (
<button
@@ -164,3 +164,28 @@ export const NoClearButton = () => (
/>
</div>
);
export const HtmlSize = () => (
<div className="colgap">
<Search
label="Lorem ipsum dolor sit amet"
description="Saepe laborum delectus officia perferendis quaerat excepturi possimus hic enim dicta assumenda."
hideLabel={false}
htmlSize="20"
/>
<Search
label="Lorem ipsum dolor sit amet"
description="Saepe laborum delectus officia perferendis quaerat excepturi possimus hic enim dicta assumenda."
hideLabel={false}
htmlSize="20"
variant="secondary"
/>
<Search
label="Lorem ipsum dolor sit amet"
description="Saepe laborum delectus officia perferendis quaerat excepturi possimus hic enim dicta assumenda."
hideLabel={false}
htmlSize="20"
variant="simple"
/>
</div>
);
+3 -5
View File
@@ -102,8 +102,6 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
const {
x,
y,
reference,
floating,
strategy,
context,
update,
@@ -129,12 +127,12 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
]);
useClientLayoutEffect(() => {
reference(anchorEl);
refs.setReference(anchorEl);
}, [anchorEl]);
const floatingRef = useMemo(
() => mergeRefs([floating, ref]),
[floating, ref]
() => mergeRefs([refs.setFloating, ref]),
[refs.setFloating, ref]
);
useClientLayoutEffect(() => {
+5 -6
View File
@@ -101,8 +101,6 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
const {
x,
y,
reference,
floating,
strategy,
context,
placement,
@@ -110,6 +108,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
arrow: { x: arrowX, y: arrowY } = {},
hide: { referenceHidden } = {},
},
refs,
} = useFloating({
placement: _placement,
open: userOpen ?? open,
@@ -132,12 +131,12 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
const ariaId = useId(id);
const mergedRef = useMemo(
() => mergeRefs([ref, floating]),
[floating, ref]
() => mergeRefs([ref, refs.setFloating]),
[refs.setFloating, ref]
);
const childMergedRef = useMemo(
() => mergeRefs([(children as any).ref, reference]),
[children, reference]
() => mergeRefs([(children as any).ref, refs.setReference]),
[children, refs.setReference]
);
if (
+8 -75
View File
@@ -1,81 +1,14 @@
// https://github.com/sudodoki/copy-to-clipboard/blob/main/index.js
const defaultMessage = "Kopier til utklippstavle: #{key}, Enter";
function format(message) {
const copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
return message.replace(/#{\s*key\s*}/g, copyKey);
}
export default function copy(text) {
let debug,
message,
range,
selection,
mark,
success = false;
debug = process.env.NODE_ENV !== "production";
export default async function copy(text: string): Promise<void> {
try {
range = document.createRange();
selection = document.getSelection();
mark = document.createElement("span");
mark.textContent = text;
// avoid screen readers from reading out loud the text
mark.ariaHidden = "true";
// reset user styles for span element
mark.style.all = "unset";
// prevents scrolling to the end of the page
mark.style.position = "fixed";
mark.style.top = 0;
mark.style.clip = "rect(0, 0, 0, 0)";
// used to preserve spaces and line breaks
mark.style.whiteSpace = "pre";
// do not inherit user-select (it may be `none`)
mark.style.webkitUserSelect = "text";
mark.style.MozUserSelect = "text";
mark.style.msUserSelect = "text";
mark.style.userSelect = "text";
mark.addEventListener("copy", function (e) {
e.stopPropagation();
});
document.body.appendChild(mark);
range.selectNodeContents(mark);
selection.addRange(range);
const successful = document.execCommand("copy");
if (!successful) {
throw new Error("copy command was unsuccessful");
}
success = true;
await navigator.clipboard.writeText(text);
} catch (err) {
debug && console.error("unable to copy using execCommand: ", err);
debug && console.warn("trying IE specific stuff");
try {
(window as any).clipboardData.setData("text", text);
success = true;
} catch (err) {
debug && console.error("unable to copy using clipboardData: ", err);
debug && console.error("falling back to prompt");
message = format(defaultMessage);
window.prompt(message, text);
}
} finally {
if (selection) {
if (typeof selection.removeRange == "function") {
selection.removeRange(range);
} else {
selection.removeAllRanges();
}
if (process.env.NODE_ENV !== "production") {
console.error("Unable to copy using Clipboard API", err);
}
if (mark) {
document.body.removeChild(mark);
}
// Fallback for browsers that do not support the Clipboard API.
const copyKey = /mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl";
const message = `Kopier til utklippstavle: ${copyKey}+C, Enter`;
window.prompt(message, text);
}
return success;
}
+8
View File
@@ -1,5 +1,13 @@
# @navikt/ds-tailwind
## 3.3.1
## 3.3.0
## 3.2.4
## 3.2.3
## 3.2.2
## 3.2.1
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-tailwind",
"version": "3.2.2",
"version": "3.3.1",
"description": "Tailwind config based on @navikt/ds-tokens",
"author": "Aksel | NAV designsystem team",
"keywords": [
@@ -22,7 +22,7 @@
"directory": "@navikt/core/tailwind"
},
"devDependencies": {
"@navikt/ds-tokens": "^3.2.2",
"@navikt/ds-tokens": "^3.3.1",
"@types/jest": "^29.0.0",
"color": "4.2.3",
"jest": "^29.0.0",
+8
View File
@@ -1,5 +1,13 @@
# @navikt/ds-tokens
## 3.3.1
## 3.3.0
## 3.2.4
## 3.2.3
## 3.2.2
## 3.2.1
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-tokens",
"version": "3.2.2",
"version": "3.3.1",
"description": "Design-tokens for NAV designsystem",
"author": "Aksel | NAV designsystem team",
"keywords": [
+8
View File
@@ -1,5 +1,13 @@
# @navikt/ds-icons
## 3.3.1
## 3.3.0
## 3.2.4
## 3.2.3
## 3.2.2
## 3.2.1
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-icons",
"version": "3.2.2",
"version": "3.3.1",
"description": "Aksel icons for NAV",
"author": "Aksel | NAV designsystem team",
"repository": {
+16
View File
@@ -1,5 +1,21 @@
# @navikt/ds-css-internal
## 3.3.1
## 3.3.0
### Minor Changes
- [#1995](https://github.com/navikt/aksel/pull/1995) [`288cef591`](https://github.com/navikt/aksel/commit/288cef591abb0557295e50cf6e696d7a51607c32) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :tada: Timeline viser nå popover/tooltip på hover.
- Popover vises nå ikke lengre ved klikk.
- Period og Pin bruker nå begge ny popover.
- Kode og styling for Popover er nå inlinet i Timeline, og bruker ikke `@navikt/ds-react` sin versjon.
## 3.2.4
## 3.2.3
## 3.2.2
## 3.2.1
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-css-internal",
"version": "3.2.2",
"version": "3.3.1",
"description": "CSS for NAV internal Designsystem-components",
"author": "Aksel | NAV designsystem team",
"keywords": [
+53 -1
View File
@@ -74,7 +74,7 @@
}
.navdsi-timeline__period--inner {
margin: 0 var(--a-spacing-1) 0 var(--a-spacing-2);
margin: 0 var(--a-spacing-1);
overflow: hidden;
white-space: nowrap;
text-overflow: clip;
@@ -321,3 +321,55 @@
padding-right: 6px;
}
}
/**
* Timeline Popover
*/
.navds-timeline__popover {
z-index: var(--a-z-index-popover);
background-color: var(--ac-popover-bg, var(--a-surface-default));
box-shadow: var(--a-shadow-medium);
border: 1px solid;
border-color: var(--ac-popover-border, var(--a-border-default));
border-radius: var(--a-border-radius-medium);
}
.navds-timeline__popover:focus {
outline: none;
}
.navds-timeline__popover-content {
padding: var(--a-spacing-3);
}
.navds-timeline__popover-arrow {
position: absolute;
z-index: -1;
transform: rotate(45deg);
background-color: var(--ac-popover-bg, var(--a-surface-default));
border: 1px solid;
border-color: var(--ac-popover-border, var(--a-border-default));
width: 1rem;
height: 1rem;
}
.navds-timeline__popover[data-placement^="top"] > .navds-timeline__popover-arrow {
border-left-color: transparent;
border-top-color: transparent;
}
.navds-timeline__popover[data-placement^="bottom"] > .navds-timeline__popover-arrow {
border-bottom-color: transparent;
border-right-color: transparent;
}
.navds-timeline__popover[data-placement^="left"] > .navds-timeline__popover-arrow {
border-left-color: transparent;
border-bottom-color: transparent;
}
.navds-timeline__popover[data-placement^="right"] > .navds-timeline__popover-arrow {
border-right-color: transparent;
border-top-color: transparent;
}
+40
View File
@@ -1,5 +1,45 @@
# @navikt/ds-react-internal
## 3.3.1
### Patch Changes
- Updated dependencies [[`5533fbd5a`](https://github.com/navikt/aksel/commit/5533fbd5a3a2b3e08f3c818e2669daccafb6212a)]:
- @navikt/ds-react@3.3.1
- @navikt/aksel-icons@3.3.1
## 3.3.0
### Minor Changes
- [#1995](https://github.com/navikt/aksel/pull/1995) [`288cef591`](https://github.com/navikt/aksel/commit/288cef591abb0557295e50cf6e696d7a51607c32) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :tada: Timeline viser nå popover/tooltip på hover.
- Popover vises nå ikke lengre ved klikk.
- Period og Pin bruker nå begge ny popover.
- Kode og styling for Popover er nå inlinet i Timeline, og bruker ikke `@navikt/ds-react` sin versjon.
### Patch Changes
- Updated dependencies [[`288cef591`](https://github.com/navikt/aksel/commit/288cef591abb0557295e50cf6e696d7a51607c32)]:
- @navikt/ds-react@3.3.0
- @navikt/aksel-icons@3.3.0
## 3.2.4
### Patch Changes
- Updated dependencies [[`30eee0dac`](https://github.com/navikt/aksel/commit/30eee0dac4e3e5a1379033283a6885e646e80458)]:
- @navikt/ds-react@3.2.4
- @navikt/aksel-icons@3.2.4
## 3.2.3
### Patch Changes
- Updated dependencies [[`475e994f4`](https://github.com/navikt/aksel/commit/475e994f494b2080ffc05eb1684b6a244e3e2969), [`53c98181c`](https://github.com/navikt/aksel/commit/53c98181c327ead3406bec3487c10232af7d463a), [`444e905e0`](https://github.com/navikt/aksel/commit/444e905e01965fd5cac40ff20c5225b072e67221)]:
- @navikt/ds-react@3.2.3
- @navikt/aksel-icons@3.2.3
## 3.2.2
### Patch Changes
+4 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-react-internal",
"version": "3.2.2",
"version": "3.3.1",
"description": "Aksel react components for internal UIs in NAV",
"author": "Aksel | NAV designsystem team",
"license": "MIT",
@@ -36,8 +36,9 @@
"watch": "tsc --watch -p tsconfig.esm.json"
},
"dependencies": {
"@navikt/aksel-icons": "^3.2.2",
"@navikt/ds-react": "^3.2.2",
"@floating-ui/react": "0.24.1",
"@navikt/aksel-icons": "^3.3.1",
"@navikt/ds-react": "^3.3.1",
"clsx": "^1.1.1",
"copy-to-clipboard": "^3.3.1"
},
+116 -14
View File
@@ -1,11 +1,31 @@
import { mergeRefs, Popover } from "@navikt/ds-react";
import {
autoUpdate,
arrow as flArrow,
flip,
offset,
safePolygon,
shift,
useDismiss,
useFloating,
useFocus,
useHover,
useInteractions,
} from "@floating-ui/react";
import { mergeRefs, useEventListener } from "@navikt/ds-react";
import { format } from "date-fns";
import React, { forwardRef, useMemo, useRef, useState } from "react";
import React, {
forwardRef,
useCallback,
useMemo,
useRef,
useState,
} from "react";
import { useTimelineContext } from "./hooks/useTimelineContext";
import { position } from "./utils/calc";
import { TimelineComponentTypes } from "./utils/types.internal";
export interface TimelinePinProps {
export interface TimelinePinProps
extends React.HTMLAttributes<HTMLButtonElement> {
/**
* Date position for the pin.
*/
@@ -27,9 +47,64 @@ export const Pin = forwardRef<HTMLButtonElement, TimelinePinProps>(
({ date, children, ...rest }, ref) => {
const { startDate, endDate, direction } = useTimelineContext();
const [open, setOpen] = useState(false);
const arrowRef = useRef<HTMLDivElement | null>(null);
const buttonRef = useRef<HTMLButtonElement | null>(null);
const mergedRef = useMemo(() => mergeRefs([buttonRef, ref]), [ref]);
const {
context,
placement,
middlewareData: { arrow: { x: arrowX, y: arrowY } = {} },
refs,
floatingStyles,
} = useFloating({
placement: "top",
open: open,
onOpenChange: setOpen,
middleware: [
offset(16),
shift(),
flip({ padding: 5, fallbackPlacements: ["bottom", "top"] }),
flArrow({ element: arrowRef, padding: 5 }),
],
whileElementsMounted: autoUpdate,
});
const { getFloatingProps, getReferenceProps } = useInteractions([
useHover(context, {
handleClose: safePolygon(),
restMs: 25,
delay: { open: 1000 },
}),
useFocus(context),
useDismiss(context),
]);
const mergedRef = useMemo(
() => mergeRefs([refs.setReference, ref]),
[ref, refs.setReference]
);
useEventListener(
"focusin",
useCallback(
(e: FocusEvent) => {
if (
![refs.domReference.current, refs?.floating?.current].some(
(element) => element?.contains(e.target as Node)
)
) {
open && setOpen(false);
}
},
[open, refs.domReference, refs?.floating]
)
);
const staticSide = {
top: "bottom",
right: "left",
bottom: "top",
left: "right",
}[placement.split("-")[0]];
return (
<>
@@ -41,21 +116,48 @@ export const Pin = forwardRef<HTMLButtonElement, TimelinePinProps>(
{...rest}
ref={mergedRef}
className="navdsi-timeline__pin-button"
onClick={() => setOpen(!open)}
aria-label={`pin:${format(date, "dd.MM.yyyy")}`}
aria-expanded={open}
type="button"
aria-expanded={children ? open : undefined}
{...getReferenceProps({
onKeyDown: (e) => {
rest?.onKeyDown?.(e as React.KeyboardEvent<HTMLButtonElement>);
if (e.key === "Enter") {
setOpen((prev) => !prev);
} else if (e.key === " ") {
setOpen(false);
}
},
})}
/>
</div>
{children && (
<Popover
open={open}
onClose={() => setOpen(false)}
anchorEl={buttonRef.current}
offset={18}
<div
className="navds-timeline__popover"
data-placement={placement}
aria-hidden={!open}
ref={refs.setFloating}
{...getFloatingProps({
tabIndex: -1,
})}
style={{
...floatingStyles,
display: open ? undefined : "none",
}}
>
<Popover.Content>{children}</Popover.Content>
</Popover>
<div className="navds-timeline__popover-content">{children}</div>
<div
ref={(node) => {
arrowRef.current = node;
}}
style={{
...(arrowX != null ? { left: arrowX } : {}),
...(arrowY != null ? { top: arrowY } : {}),
...(staticSide ? { [staticSide]: "-0.5rem" } : {}),
}}
className="navds-timeline__popover-arrow"
/>
</div>
)}
</>
);
@@ -1,6 +1,19 @@
import { mergeRefs, Popover } from "@navikt/ds-react";
import {
autoUpdate,
arrow as flArrow,
flip,
offset,
safePolygon,
shift,
useDismiss,
useFloating,
useFocus,
useHover,
useInteractions,
} from "@floating-ui/react";
import { mergeRefs, useEventListener } from "@navikt/ds-react";
import cl from "clsx";
import React, { useMemo, useRef, useState } from "react";
import React, { useCallback, useMemo, useRef, useState } from "react";
import { usePeriodContext } from "../hooks/usePeriodContext";
import { useRowContext } from "../hooks/useRowContext";
import { useTimelineContext } from "../hooks/useTimelineContext";
@@ -8,7 +21,9 @@ import { ariaLabel, getConditionalClasses } from "../utils/period";
import { PeriodProps } from "./index";
interface TimelineClickablePeriodProps extends PeriodProps {
onSelectPeriod?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
onSelectPeriod?: (
e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>
) => void;
isActive?: boolean;
periodRef: React.ForwardedRef<HTMLButtonElement>;
}
@@ -30,17 +45,69 @@ const ClickablePeriod = React.memo(
restProps,
periodRef,
}: TimelineClickablePeriodProps) => {
const buttonRef = useRef<HTMLButtonElement | null>(null);
const [selected, setSelected] = useState(false);
const [open, setOpen] = useState(false);
const { index } = useRowContext();
const { firstFocus } = usePeriodContext();
const { initiate, addFocusable } = useTimelineContext();
const arrowRef = useRef<HTMLDivElement | null>(null);
const {
context,
placement,
middlewareData: { arrow: { x: arrowX, y: arrowY } = {} },
refs,
floatingStyles,
} = useFloating({
placement: "top",
open: open,
onOpenChange: setOpen,
middleware: [
offset(16),
shift(),
flip({ padding: 5, fallbackPlacements: ["bottom", "top"] }),
flArrow({ element: arrowRef, padding: 5 }),
],
whileElementsMounted: autoUpdate,
});
const { getFloatingProps, getReferenceProps } = useInteractions([
useHover(context, {
handleClose: safePolygon(),
restMs: 25,
delay: { open: 1000 },
}),
useFocus(context),
useDismiss(context),
]);
const mergedRef = useMemo(
() => mergeRefs([buttonRef, periodRef]),
[periodRef]
() => mergeRefs([refs.setReference, periodRef]),
[periodRef, refs.setReference]
);
useEventListener(
"focusin",
useCallback(
(e: FocusEvent) => {
if (
![refs.domReference.current, refs?.floating?.current].some(
(element) => element?.contains(e.target as Node)
)
) {
open && setOpen(false);
}
},
[open, refs.domReference, refs?.floating]
)
);
const staticSide = {
top: "bottom",
right: "left",
bottom: "top",
left: "right",
}[placement.split("-")[0]];
return (
<>
<button
@@ -50,10 +117,6 @@ const ClickablePeriod = React.memo(
firstFocus && addFocusable(r, index);
mergedRef(r);
}}
onClick={(e) => {
children && setSelected((x) => !x);
onSelectPeriod?.(e);
}}
aria-label={ariaLabel(start, end, status, statusLabel)}
className={cl(
"navdsi-timeline__period--clickable",
@@ -63,26 +126,64 @@ const ClickablePeriod = React.memo(
"navdsi-timeline__period--selected": isActive,
}
)}
style={{
width: `${width}%`,
[direction]: `${left}%`,
}}
aria-expanded={children ? selected : undefined}
onFocus={() => {
initiate(index);
}}
aria-expanded={children ? open : undefined}
aria-current={isActive || undefined}
{...getReferenceProps({
onFocus: () => {
initiate(index);
},
onKeyDown: (e) => {
restProps?.onKeydown?.(e);
if (e.key === "Enter") {
setOpen((prev) => !prev);
}
if (e.key === " ") {
onSelectPeriod?.(e);
setOpen(false);
}
},
style: {
width: `${width}%`,
[direction]: `${left}%`,
},
onClick: (e) => {
restProps?.onClick?.(e);
if (e.detail === 0) {
return;
}
onSelectPeriod?.(e);
},
})}
>
<span className="navdsi-timeline__period--inner">{icon}</span>
</button>
{children && (
<Popover
open={selected}
onClose={() => setSelected(false)}
anchorEl={buttonRef.current}
strategy="fixed"
<div
className="navds-timeline__popover"
data-placement={placement}
aria-hidden={!open}
ref={refs.setFloating}
{...getFloatingProps({
tabIndex: -1,
})}
style={{
...floatingStyles,
display: open ? undefined : "none",
}}
>
<Popover.Content>{children}</Popover.Content>
</Popover>
<div className="navds-timeline__popover-content">{children}</div>
<div
ref={(node) => {
arrowRef.current = node;
}}
style={{
...(arrowX != null ? { left: arrowX } : {}),
...(arrowY != null ? { top: arrowY } : {}),
...(staticSide ? { [staticSide]: "-0.5rem" } : {}),
}}
className="navds-timeline__popover-arrow"
/>
</div>
)}
</>
);
@@ -256,6 +256,7 @@ export const ActivePeriod = () => {
onSelectPeriod={() => {
setActivePeriod(p);
p?.onSelectPeriod?.();
console.log("PERIOD SELECTED!");
}}
icon={p.icon}
isActive={activePeriod.id === p.id}
@@ -357,3 +358,87 @@ export const WithYearLabels = () => {
</div>
);
};
export const ContentDemo = () => {
const [activePeriod, setActivePeriod] = useState<any>(undefined);
return (
<div style={{ width: "80vw" }}>
<Timeline>
<Timeline.Pin date={new Date("Apr 15 2022")}>Pin 1</Timeline.Pin>
<Timeline.Pin date={new Date("Jun 12 2022")}>
Pin 2 <button>test</button>
</Timeline.Pin>
<Timeline.Pin date={new Date("Jul 28 2022")}>Pin 3</Timeline.Pin>
<Timeline.Row
label="Rad 1"
icon={<CheckmarkCircleFillIcon aria-hidden />}
>
{row1.map((p: any, i) => {
return (
<Timeline.Period
key={p.id}
start={p.start}
end={p.end}
status={p.status}
onSelectPeriod={() => {
setActivePeriod(p);
p?.onSelectPeriod?.();
console.log("PERIOD SELECTED!");
}}
icon={p.icon}
isActive={activePeriod?.id === p.id}
statusLabel={p.statusLabel}
aria-controls={
activePeriod?.id === p.id ? "timeline-data" : undefined
}
id={p.id}
>
{p.children}
</Timeline.Period>
);
})}
</Timeline.Row>
<Timeline.Row label="Rad 2">
{row2.map((p: any, i) => {
return (
<Timeline.Period
key={p.id}
start={p.start}
end={p.end}
status={p.status}
onSelectPeriod={() => {
setActivePeriod(p);
p?.onSelectPeriod?.();
}}
icon={p.icon}
isActive={activePeriod?.id === p.id}
statusLabel={p.statusLabel}
aria-controls={
activePeriod?.id === p.id ? "timeline-data" : undefined
}
id={p.id}
>
{p.children}
</Timeline.Period>
);
})}
</Timeline.Row>
<Timeline.Row label="Rad 3">
<Timeline.Period
start={new Date("Jan 1 2022")}
end={new Date("Aug 20 2022")}
status="info"
icon={<CheckmarkCircleFillIcon aria-hidden />}
/>
</Timeline.Row>
</Timeline>
{activePeriod && (
<div id="timeline-data" aria-controls={activePeriod.id}>
<h2>Period-data</h2>
<p>{`Periode:${activePeriod.id}, dato:${activePeriod.start}`}</p>
</div>
)}
</div>
);
};
+1 -1
View File
@@ -15,7 +15,7 @@
<img src="https://img.shields.io/badge/PRs-welcome-green.svg?color=%23262626"" />
</a>
</div>
<div><a href="https://www.npmjs.com/package/@navikt/ds-css"><img alt="npm" src="https://img.shields.io/npm/v/@navikt/ds-css?label=%40navikt%2Fds-*"></a></div>
<div><a href="https://www.npmjs.com/package/@navikt/ds-css"><img alt="npm" src="https://img.shields.io/npm/v/@navikt/ds-css?label=version"></a></div>
<br/>
<a href="https://aksel.nav.no">Nettside</a> | <a href="https://github.com/navikt/aksel/issues">Issues</a>
<br/>
+9 -9
View File
@@ -15,15 +15,15 @@
"website"
],
"dependencies": {
"@navikt/aksel-icons": "^3.2.2",
"@navikt/ds-codemod": "^3.2.2",
"@navikt/ds-css": "^3.2.2",
"@navikt/ds-css-internal": "^3.2.2",
"@navikt/ds-icons": "^3.2.2",
"@navikt/ds-react": "^3.2.2",
"@navikt/ds-react-internal": "^3.2.2",
"@navikt/ds-tailwind": "^3.2.2",
"@navikt/ds-tokens": "^3.2.2"
"@navikt/aksel-icons": "^3.3.1",
"@navikt/ds-codemod": "^3.3.1",
"@navikt/ds-css": "^3.3.1",
"@navikt/ds-css-internal": "^3.3.1",
"@navikt/ds-icons": "^3.3.1",
"@navikt/ds-react": "^3.3.1",
"@navikt/ds-react-internal": "^3.3.1",
"@navikt/ds-tailwind": "^3.3.1",
"@navikt/ds-tokens": "^3.3.1"
},
"devDependencies": {
"prettier-plugin-tailwindcss": "^0.2.3"
@@ -43,9 +43,6 @@ function Snarveier() {
Snarveier
</Heading>
<BodyShort as="ul" className="mt-3 grid gap-3">
<FooterLink href="/god-praksis/artikler/om-aksel">
Hva er Aksel?
</FooterLink>
<FooterLink href="/god-praksis/artikler/skriv-for-aksel">
Skriv for Aksel
</FooterLink>
@@ -94,6 +91,9 @@ function SideLenker() {
Om nettstedet
</Heading>
<BodyShort as="ul" className="mt-3 grid gap-3">
<FooterLink href="/god-praksis/artikler/om-aksel">
Hva er Aksel?
</FooterLink>
<FooterLink href="/side/personvernerklaering">
Personvernserklæring
</FooterLink>
@@ -152,6 +152,16 @@ export const Sidebar = ({
return -1;
}
if (a.sidebarindex !== null || b.sidebarindex !== null) {
if (a.sidebarindex !== null && b.sidebarindex !== null) {
return a.sidebarindex - b.sidebarindex;
} else if (a.sidebarindex !== null) {
return -1;
} else {
return 1;
}
}
return a?.heading.localeCompare(b?.heading);
}),
}))
+8 -9
View File
@@ -27,15 +27,15 @@
},
"dependencies": {
"@sanity/block-content-to-react": "^3.0.0",
"@sanity/client": "^5.4.2",
"@sanity/code-input": "4.1.0",
"@sanity/color-input": "^3.0.2",
"@sanity/client": "^6.1.1",
"@sanity/code-input": "4.1.1",
"@sanity/color-input": "^3.1.0",
"@sanity/icons": "2.3.1",
"@sanity/image-url": "1.0.2",
"@sanity/preview-kit": "^1.4.0",
"@sanity/preview-kit": "^1.5.3",
"@sanity/table": "1.0.1",
"@sanity/ui": "^1.3.2",
"@sanity/vision": "3.9.1",
"@sanity/ui": "^1.3.3",
"@sanity/vision": "3.11.1",
"@svgr/webpack": "^5.5.0",
"amplitude-js": "^8.21.5",
"boring-avatars": "1.7.0",
@@ -46,7 +46,7 @@
"fuse.js": "^6.6.2",
"lodash": "^4.17.21",
"next": "^13.2.1",
"next-sanity": "^4.1.7",
"next-sanity": "^4.3.2",
"prism-react-renderer": "^1.3.0",
"prismjs": "^1.27.0",
"react": "^18.0.0",
@@ -54,7 +54,7 @@
"react-modal": "3.15.1",
"react-responsive-masonry": "^2.1.7",
"recharts": "^2.2.0",
"sanity": "3.9.1",
"sanity": "3.11.1",
"sanity-plugin-asset-source-unsplash": "^1.0.6",
"sanity-plugin-iframe-pane": "^2.3.0",
"sanity-plugin-media": "^2.0.5",
@@ -71,7 +71,6 @@
"@next/bundle-analyzer": "^12.1.0",
"@next/eslint-plugin-next": "^12.2.0",
"@playwright/test": "^1.30.0",
"@sanity-codegen/types": "1.0.0-alpha.13",
"@testing-library/jest-dom": "^5.16.0",
"@testing-library/react": "^13.3.0",
"@types/jest": "^29.0.0",
@@ -12,5 +12,5 @@ const Example = () => {
export default withDsExample(Example, "inverted");
export const args = {
index: 6,
index: 7,
};
@@ -21,5 +21,5 @@ export const Demo = {
};
export const args = {
index: 5,
index: 6,
};
@@ -0,0 +1,26 @@
import { Search } from "@navikt/ds-react";
import { withDsExample } from "components/website-modules/examples/withDsExample";
const Example = () => {
return (
<form>
<Search
label="Hva er artikkelnummeret til denne varen?"
description="Art.nr. finner du på varens produktside eller i katalogen."
hideLabel={false}
htmlSize="12"
/>
</form>
);
};
export default withDsExample(Example);
/* Storybook story */
export const Demo = {
render: Example,
};
export const args = {
index: 5,
};
@@ -11,7 +11,7 @@ import { withDsExample } from "components/website-modules/examples/withDsExample
import { useState } from "react";
const Example = () => {
const [activePeriod, setActivePeriod] = useState();
const [activePeriod, setActivePeriod] = useState<any>();
return (
<div className="min-w-[800px] overflow-x-auto">
@@ -27,6 +27,8 @@ const Example = () => {
icon={p.icon}
onSelectPeriod={() => setActivePeriod(p.id)}
isActive={activePeriod && activePeriod === p.id}
aria-controls="timeline-panel"
id={p.id}
/>
);
})}
@@ -42,13 +44,19 @@ const Example = () => {
icon={p.icon}
onSelectPeriod={() => setActivePeriod(p.id)}
isActive={activePeriod && activePeriod === p.id}
aria-controls="timeline-panel"
id={p.id}
/>
);
})}
</Timeline.Row>
</Timeline>
{activePeriod && (
<div className="mt-8">{`${activePeriod}: ${
<div
aria-controls={activePeriod.id}
id="timeline-panel"
className="mt-8"
>{`${activePeriod}: ${
[...person, ...jobb].find((x) => x.id === activePeriod).start
}`}</div>
)}
@@ -0,0 +1,159 @@
import {
VirusIcon,
PencilIcon,
HospitalIcon,
PiggybankIcon,
PersonGroupIcon,
ParasolBeachIcon,
} from "@navikt/aksel-icons";
import { Timeline } from "@navikt/ds-react-internal";
import { withDsExample } from "components/website-modules/examples/withDsExample";
import { useState } from "react";
const Example = () => {
const [activePeriod, setActivePeriod] = useState<any>();
return (
<div className="min-w-[800px] overflow-x-auto">
<Timeline>
<Timeline.Pin date={new Date("Mar 15 2022")}>
<p>Utbetalt: 12 345 kr</p>
</Timeline.Pin>
<Timeline.Row label="Person" icon={<PersonGroupIcon aria-hidden />}>
{person.map((p: any, i) => {
return (
<Timeline.Period
key={i}
start={p.start}
end={p.end}
status={p.status}
icon={p.icon}
onSelectPeriod={() => setActivePeriod(p.id)}
isActive={activePeriod && activePeriod === p.id}
aria-controls="timeline-panel"
id={p.id}
>
{p?.children ?? null}
</Timeline.Period>
);
})}
</Timeline.Row>
<Timeline.Row label="Sykehus A" icon={<HospitalIcon aria-hidden />}>
{jobb.map((p: any, i) => {
return (
<Timeline.Period
key={i}
start={p.start}
end={p.end}
status={p.status}
icon={p.icon}
onSelectPeriod={() => setActivePeriod(p.id)}
isActive={activePeriod && activePeriod === p.id}
aria-controls="timeline-panel"
id={p.id}
>
{p?.children ?? null}
</Timeline.Period>
);
})}
</Timeline.Row>
</Timeline>
{activePeriod && (
<div
aria-controls={activePeriod.id}
id="timeline-panel"
className="mt-8"
>{`${activePeriod}: ${
[...person, ...jobb].find((x) => x.id === activePeriod).start
}`}</div>
)}
</div>
);
};
const person = [
{
start: new Date("Jan 1 2022"),
end: new Date("Jan 31 2022"),
status: "warning",
icon: <PencilIcon aria-hidden />,
statusLabel: "Sykemeldt",
children: <div>50% sykemeldt</div>,
id: 1,
},
{
start: new Date("Apr 1 2022"),
end: new Date("Apr 30 2022"),
status: "neutral",
icon: <ParasolBeachIcon aria-hidden />,
label: "test",
statusLabel: "Ferie",
id: 2,
},
{
start: new Date("Jul 1 2022"),
end: new Date("Jul 31 2022"),
status: "warning",
icon: <PencilIcon aria-hidden />,
statusLabel: "Sykemeldt",
id: 3,
},
{
start: new Date("Aug 1 2022"),
end: new Date("Aug 30 2022"),
status: "warning",
icon: <VirusIcon aria-hidden />,
statusLabel: "Stønad korona",
id: 4,
},
];
const jobb = [
{
start: new Date("Feb 2 2022"),
end: new Date("Mar 1 2022"),
status: "success",
statusLabel: "Utbetaling",
icon: <PiggybankIcon aria-hidden />,
children: <div>100% utbetaling</div>,
id: 11,
},
{
start: new Date("Mar 2 2022"),
end: new Date("Apr 1 2022"),
status: "success",
statusLabel: "Utbetaling",
icon: <PiggybankIcon aria-hidden />,
children: <div>100% utbetaling</div>,
id: 22,
},
{
start: new Date("May 2 2022"),
end: new Date("June 1 2022"),
status: "success",
statusLabel: "Utbetaling",
icon: <PiggybankIcon aria-hidden />,
children: <div>100% utbetaling</div>,
id: 33,
},
{
start: new Date("June 2 2022"),
end: new Date("July 1 2022"),
status: "success",
statusLabel: "Utbetaling",
icon: <PiggybankIcon aria-hidden />,
id: 44,
},
];
export default withDsExample(Example);
/* Storybook story */
export const Demo = {
render: Example,
};
export const args = {
index: 4,
desc: "Vi anbefaler å bruke 'aria-controls' begge veier mellom aktive perioder og panelet det refererer til. Dette gir brukere av enkelte skjermlesere keyboard-shortcuts for å hoppe mellom perioder og panelet.",
};
@@ -6,6 +6,7 @@ export const sanityClient = createClient({
...clientConfig,
token: process.env.SANITY_PRIVATE_NO_DRAFTS,
ignoreBrowserTokenWarning: process.env.NODE_ENV === "test",
useCdn: true,
});
// Set up a preview client with serverless authentication for drafts
@@ -180,6 +180,7 @@ export const sidebarQuery = `"sidebar": *[_type == $type && defined(kategori)] {
"slug": slug.current,
kategori,
"tag": status.tag,
"sidebarindex": sidebarindex,
}`;
export const landingPageQuery = (t) => {
@@ -20,11 +20,7 @@ export const PanesWithCount = async (
)
.child(
S.documentList()
.title(
`${title} (${
ids.filter((x) => x?.kategori === x.value).length ?? 0
})`
)
.title(title)
.schemaType(docType)
.filter(`_type == $docType && $kat == kategori`)
.params({ kat: value, docType })
@@ -68,6 +68,14 @@ export const GrunnleggendeArtikkel = defineType({
collapsed: false,
},
}),
defineField({
title: "Sidebar-index",
description:
"Overstyrer sortering av artikler i sidebar. Hvis feltet er tomt, sorteres den alfabetisk.",
name: "sidebarindex",
type: "number",
group: "settings",
}),
defineField({
title: "Innhold",
description:
+1 -6
View File
@@ -15,12 +15,7 @@
"jsx": "preserve",
"noImplicitAny": false,
"incremental": true,
"types": [
"node",
"jest",
"@testing-library/jest-dom",
"@sanity-codegen/types"
],
"types": ["node", "jest", "@testing-library/jest-dom"],
"baseUrl": ".",
"paths": {
"@/components": ["components/index.ts"],
@@ -141,6 +141,7 @@ export type AkselSidebarT = Array<{
slug: string;
kategori: typeof komponentKategorier[number]["value"];
tag: "beta" | "new" | "ready" | "deprecated";
sidebarindex: number | null;
}>;
export type ArticleListT = Array<{
+2 -2
View File
@@ -10,8 +10,8 @@
"preview": "vite preview"
},
"dependencies": {
"@navikt/ds-css": "3.2.2",
"@navikt/ds-react": "3.2.2",
"@navikt/ds-css": "3.3.1",
"@navikt/ds-react": "3.3.1",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
Loaded 100 of 102 files, more files were not shown because too many files have changed in this diff. Show more