Skip to content

Commit

Permalink
Merge branch 'main' into removable-chips-type-button
Browse files Browse the repository at this point in the history
  • Loading branch information
it-vegard committed Aug 3, 2023
2 parents a3ba0fe + 5b2669d commit 984d4f6
Show file tree
Hide file tree
Showing 9 changed files with 1,870 additions and 1,066 deletions.
15 changes: 8 additions & 7 deletions .storybook/main.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const storyIndexers = require("./indexer");

const path = require("path");
const { mergeConfig } = require("vite");

Expand Down Expand Up @@ -59,15 +58,17 @@ module.exports = {
},
async viteFinal(config) {
return mergeConfig(config, {
define: { "process.env": {} },
define: {
"process.env": {},
},
resolve: {
alias: [
/*
// Example
{
find: "@components",
replacement: path.resolve(__dirname, "./src/components"),
}, */
// Example
{
find: "@components",
replacement: path.resolve(__dirname, "./src/components"),
}, */
{
find: "components",
replacement: path.resolve(
Expand Down
2 changes: 1 addition & 1 deletion aksel.nav.no/website/components/layout/WithSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const WithSidebar = ({
<>
<Header />
<div className="bg-bg-default">
<div className="mx-auto mb-24 mt-6 flex w-full max-w-screen-2xl gap-6">
<div className="mx-auto mb-24 flex w-full max-w-screen-2xl gap-6 pt-6">
<Sidebar kategori={pageType.type} links={sidebar} />
<div className="relative w-full">
<main
Expand Down
6 changes: 5 additions & 1 deletion aksel.nav.no/website/pages/eksempler/datepicker/anchor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Button, DatePicker } from "@navikt/ds-react";
import { withDsExample } from "components/website-modules/examples/withDsExample";
import format from "date-fns/format";
import nbLocale from "date-fns/locale/nb";
import { useState } from "react";

const Example = () => {
Expand All @@ -20,7 +22,9 @@ const Example = () => {
{days && (
<div className="pt-4">
{days.map((x) => (
<div key={x.toString()}>{x.toDateString()}</div>
<div key={x.toString()}>
{format(x, "dd.MM.yyyy", { locale: nbLocale })}
</div>
))}
</div>
)}
Expand Down
12 changes: 10 additions & 2 deletions aksel.nav.no/website/pages/eksempler/datepicker/input-range.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { DatePicker, useRangeDatepicker } from "@navikt/ds-react";
import { withDsExample } from "components/website-modules/examples/withDsExample";
import format from "date-fns/format";
import nbLocale from "date-fns/locale/nb";

const Example = () => {
const { datepickerProps, toInputProps, fromInputProps, selectedRange } =
Expand All @@ -18,8 +20,14 @@ const Example = () => {
</DatePicker>
{selectedRange && (
<div className="pt-4">
<div>{selectedRange?.from && selectedRange.from.toDateString()}</div>
<div>{selectedRange?.to && selectedRange.to.toDateString()}</div>
<div>
{selectedRange?.from &&
format(selectedRange.from, "dd.MM.yyyy", { locale: nbLocale })}
</div>
<div>
{selectedRange?.to &&
format(selectedRange.to, "dd.MM.yyyy", { locale: nbLocale })}
</div>
</div>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { DatePicker, useDatepicker } from "@navikt/ds-react";
import { withDsExample } from "components/website-modules/examples/withDsExample";
import format from "date-fns/format";
import nbLocale from "date-fns/locale/nb";

const Example = () => {
const { datepickerProps, inputProps, selectedDay } = useDatepicker({
Expand All @@ -12,7 +14,9 @@ const Example = () => {
<DatePicker {...datepickerProps}>
<DatePicker.Input {...inputProps} label="Velg dato" />
</DatePicker>
<div className="pt-4">{selectedDay && selectedDay.toDateString()}</div>
<div className="pt-4">
{selectedDay && format(selectedDay, "dd.MM.yyyy", { locale: nbLocale })}
</div>
</div>
);
};
Expand Down
5 changes: 4 additions & 1 deletion aksel.nav.no/website/pages/eksempler/datepicker/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
} from "@navikt/ds-react";
import { withDsExample } from "components/website-modules/examples/withDsExample";
import { useEffect, useState } from "react";
import format from "date-fns/format";
import nbLocale from "date-fns/locale/nb";

const Example = () => {
const [open, setOpen] = useState(false);
Expand Down Expand Up @@ -40,7 +42,8 @@ const Example = () => {
<DatePicker.Input {...inputProps} label="Velg dato" />
</DatePicker>
<div className="pt-4">
{selectedDay && selectedDay.toDateString()}
{selectedDay &&
format(selectedDay, "dd.MM.yyyy", { locale: nbLocale })}
</div>
</div>
</Modal.Content>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { DatePicker, useDatepicker } from "@navikt/ds-react";
import { withDsExample } from "components/website-modules/examples/withDsExample";
import format from "date-fns/format";
import nbLocale from "date-fns/locale/nb";

const Example = () => {
const { datepickerProps, inputProps, selectedDay } = useDatepicker({
Expand All @@ -13,7 +15,9 @@ const Example = () => {
<DatePicker {...datepickerProps}>
<DatePicker.Input {...inputProps} label="Velg dato" />
</DatePicker>
<div className="pt-4">{selectedDay && selectedDay.toDateString()}</div>
<div className="pt-4">
{selectedDay && format(selectedDay, "dd.MM.yyyy", { locale: nbLocale })}
</div>
</div>
);
};
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,21 +211,21 @@
},
"devDependencies": {
"@changesets/cli": "2.25.0",
"@storybook/addon-a11y": "7.0.4",
"@storybook/addon-actions": "7.0.4",
"@storybook/addon-essentials": "7.0.4",
"@storybook/addon-interactions": "7.0.4",
"@storybook/addon-storysource": "7.0.4",
"@storybook/addons": "7.0.4",
"@storybook/csf-tools": "7.0.4",
"@storybook/addon-a11y": "7.2.0",
"@storybook/addon-actions": "7.2.0",
"@storybook/addon-essentials": "7.2.0",
"@storybook/addon-interactions": "7.2.0",
"@storybook/addon-storysource": "7.2.0",
"@storybook/addons": "7.2.0",
"@storybook/csf-tools": "7.2.0",
"@storybook/jest": "^0.1.0",
"@storybook/react": "7.0.4",
"@storybook/react-vite": "7.0.4",
"@storybook/testing-library": "^0.1.0",
"@storybook/theming": "7.0.4",
"@storybook/react": "7.2.0",
"@storybook/react-vite": "7.2.0",
"@storybook/testing-library": "^0.2.0",
"@storybook/theming": "7.2.0",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@typescript-eslint/parser": "^5.41.0",
"@whitespace/storybook-addon-html": "^5.1.4",
"@whitespace/storybook-addon-html": "^5.1.6",
"chromatic": "6.5.4",
"concurrently": "7.2.1",
"cross-env": "^7.0.0",
Expand All @@ -244,7 +244,7 @@
"react": "^18.0.0",
"react-docgen-typescript": "2.2.2",
"react-dom": "^18.0.0",
"storybook": "7.0.4",
"storybook": "7.2.0",
"stylelint": "^14.8.5",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^25.0.0",
Expand Down
Loading

0 comments on commit 984d4f6

Please sign in to comment.