Skip to content

Commit

Permalink
Merge branch 'main' into skeleton-inline-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KenAJoh committed Sep 13, 2023
2 parents a0aafef + f6fcf0c commit 714bb25
Show file tree
Hide file tree
Showing 41 changed files with 1,614 additions and 428 deletions.
7 changes: 7 additions & 0 deletions .changeset/happy-pianos-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@navikt/ds-tokens": minor
"@navikt/ds-react": minor
"@navikt/ds-css": minor
---

Box: Ny primitive, erstatter dagens `Panel`
2 changes: 2 additions & 0 deletions @navikt/core/css/baseline/_utilities.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
.navds-sr-only {
border: 0;
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
Expand All @@ -50,6 +51,7 @@
.navds-sr-only.focusable:active,
.navds-sr-only.focusable:focus {
clip: auto;
clip-path: none;
height: auto;
margin: 0;
overflow: visible;
Expand Down
52 changes: 28 additions & 24 deletions @navikt/core/css/config/_mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,34 @@ const StyleMappings = {
},
],
components: [
{
component: "Box",
main: primitivesCss,
},
{
component: "HGrid",
main: primitivesCss,
},
{
component: "HStack",
main: primitivesCss,
},
{
component: "VStack",
main: primitivesCss,
},
{
component: "Spacer",
main: primitivesCss,
},
{
component: "Show",
main: primitivesCss,
},
{
component: "Hide",
main: primitivesCss,
},
{
component: "Accordion",
main: "accordion.css",
Expand Down Expand Up @@ -100,10 +128,6 @@ const StyleMappings = {
main: "help-text.css",
dependencies: ["popover.css"],
},
{
component: "HGrid",
main: primitivesCss,
},
{ component: "Ingress", main: typoCss },
{
component: "InternalHeader",
Expand Down Expand Up @@ -139,26 +163,6 @@ const StyleMappings = {
{ component: "Select", main: formCss, dependencies: [typoCss] },
{ component: "Skeleton", main: "skeleton.css", dependencies: [] },
{ component: "Stepper", main: "stepper.css", dependencies: [typoCss] },
{
component: "HStack",
main: primitivesCss,
},
{
component: "VStack",
main: primitivesCss,
},
{
component: "Spacer",
main: primitivesCss,
},
{
component: "Show",
main: primitivesCss,
},
{
component: "Hide",
main: primitivesCss,
},
{ component: "Switch", main: formCss, dependencies: [typoCss] },
{ component: "Table", main: "table.css", dependencies: [typoCss] },
{ component: "Tabs", main: "tabs.css", dependencies: [typoCss] },
Expand Down
117 changes: 117 additions & 0 deletions @navikt/core/css/primitives/box.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
.navds-box {
--__ac-box-padding-xs: initial;
--__ac-box-padding-sm: initial;
--__ac-box-padding-md: initial;
--__ac-box-padding-lg: initial;
--__ac-box-padding-xl: initial;
--__ac-box-padding-block-xs: initial;
--__ac-box-padding-inline-xs: initial;
--__ac-box-padding-block-sm: initial;
--__ac-box-padding-inline-sm: initial;
--__ac-box-padding-block-md: initial;
--__ac-box-padding-inline-md: initial;
--__ac-box-padding-block-lg: initial;
--__ac-box-padding-inline-lg: initial;
--__ac-box-padding-block-xl: initial;
--__ac-box-padding-inline-xl: initial;
--__ac-box-padding: var(--__ac-box-padding-xs);
--__ac-box-padding-inline: var(--__ac-box-padding-inline-xs);
--__ac-box-padding-block: var(--__ac-box-padding-block-xs);
--__ac-box-background: initial;
--__ac-box-border-color: initial;
--__ac-box-shadow: initial;
--__ac-box-border-width: initial;
--__ac-box-border-radius-xs: initial;
--__ac-box-border-radius-sm: initial;
--__ac-box-border-radius-md: initial;
--__ac-box-border-radius-lg: initial;
--__ac-box-border-radius-xl: initial;
--__ac-box-border-radius: var(--__ac-box-border-radius-xs);

padding-inline: var(--__ac-box-padding-inline, var(--__ac-box-padding));
padding-block: var(--__ac-box-padding-block, var(--__ac-box-padding));
background-color: var(--__ac-box-background);
border-style: solid;
border-color: var(--__ac-box-border-color);
border-radius: var(--__ac-box-border-radius);
box-shadow: var(--__ac-box-shadow);
border-width: var(--__ac-box-border-width, 0);
}

@media (min-width: 480px) {
.navds-box {
--__ac-box-padding: var(--__ac-box-padding-sm, var(--__ac-box-padding-xs));
--__ac-box-padding-inline: var(--__ac-box-padding-inline-sm, var(--__ac-box-padding-inline-xs));
--__ac-box-padding-block: var(--__ac-box-padding-block-sm, var(--__ac-box-padding-block-xs));
--__ac-box-border-radius: var(--__ac-box-border-radius-sm, var(--__ac-box-border-radius-xs));
}
}

@media (min-width: 768px) {
.navds-box {
--__ac-box-padding: var(--__ac-box-padding-md, var(--__ac-box-padding-sm, var(--__ac-box-padding-xs)));
--__ac-box-padding-inline: var(
--__ac-box-padding-inline-md,
var(--__ac-box-padding-inline-sm, var(--__ac-box-padding-inline-xs))
);
--__ac-box-padding-block: var(
--__ac-box-padding-block-md,
var(--__ac-box-padding-block-sm, var(--__ac-box-padding-block-xs))
);
--__ac-box-border-radius: var(
--__ac-box-border-radius-md,
var(--__ac-box-border-radius-sm, var(--__ac-box-border-radius-xs))
);
}
}

@media (min-width: 1024px) {
.navds-box {
--__ac-box-padding: var(
--__ac-box-padding-lg,
var(--__ac-box-padding-md, var(--__ac-box-padding-sm, var(--__ac-box-padding-xs)))
);
--__ac-box-padding-inline: var(
--__ac-box-padding-inline-lg,
var(--__ac-box-padding-inline-md, var(--__ac-box-padding-inline-sm, var(--__ac-box-padding-inline-xs)))
);
--__ac-box-padding-block: var(
--__ac-box-padding-block-lg,
var(--__ac-box-padding-block-md, var(--__ac-box-padding-block-sm, var(--__ac-box-padding-block-xs)))
);
--__ac-box-border-radius: var(
--__ac-box-border-radius-lg,
var(--__ac-box-border-radius-md, var(--__ac-box-border-radius-sm, var(--__ac-box-border-radius-xs)))
);
}
}

@media (min-width: 1280px) {
.navds-box {
--__ac-box-padding: var(
--__ac-box-padding-xl,
var(--__ac-box-padding-lg, var(--__ac-box-padding-md, var(--__ac-box-padding-sm, var(--__ac-box-padding-xs))))
);
--__ac-box-padding-inline: var(
--__ac-box-padding-inline-xl,
var(
--__ac-box-padding-inline-lg,
var(--__ac-box-padding-inline-md, var(--__ac-box-padding-inline-sm, var(--__ac-box-padding-inline-xs)))
)
);
--__ac-box-padding-block: var(
--__ac-box-padding-block-xl,
var(
--__ac-box-padding-block-lg,
var(--__ac-box-padding-block-md, var(--__ac-box-padding-block-sm, var(--__ac-box-padding-block-xs)))
)
);
--__ac-box-border-radius: var(
--__ac-box-border-radius-xl,
var(
--__ac-box-border-radius-lg,
var(--__ac-box-border-radius-md, var(--__ac-box-border-radius-sm, var(--__ac-box-border-radius-xs)))
)
);
}
}
1 change: 1 addition & 0 deletions @navikt/core/css/primitives/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "box.css";
@import "hgrid.css";
@import "stack.css";
@import "responsive.css";
1 change: 1 addition & 0 deletions @navikt/core/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"dependencies": {
"@floating-ui/react": "0.24.1",
"@navikt/aksel-icons": "^5.4.1",
"@navikt/ds-tokens": "^5.4.1",
"@radix-ui/react-tabs": "1.0.0",
"@radix-ui/react-toggle-group": "1.0.0",
"clsx": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion @navikt/core/react/src/grid/grid.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from "react";
import { BodyLong, Grid, Cell, ContentContainer } from "../index";

export default {
title: "ds-react/Grid",
title: "ds-react/Primitives/Grid",
component: { Grid, Cell },
parameters: {
layout: "fullscreen",
Expand Down
1 change: 1 addition & 0 deletions @navikt/core/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export * from "./toggle-group";
export * from "./tooltip";
export * from "./typography";
export * from "./util";
export * from "./layout/box";
export * from "./layout/stack";
export * from "./layout/grid";
export * from "./layout/content-container";
Expand Down
Loading

0 comments on commit 714bb25

Please sign in to comment.