-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial box (heavily inspired by shopify Box) (#2195)
* initial box (heavily inspired by shopify Box) * 🎨 Theming-demo * rm printHidden prop * sr-only: clip is deprecated, adding clip-path * setting up padding story box primitive * 95% complete padding example for Box (dynamic css code unfolding with types) * WIP on padding/margin for box * working box padding/block/inline/margin? * remove console.log * story for Box, copy implementation from padding to apply to margin as well * remove unwanted props on Box * refactor semantic-colors.json, use json import for types in Box.tsx * squashme * Box: working border & background * 🔥 remove props on Box we will not implement in v1 * refactoring / less things needed (no margin) and things that are broken show up in stories * 🐛 fix erroneous padding assignment (a flipped index) * fully recreated LinkPanel * box: add all borderRadius props * box: complete example for chat bubbles * 📝 refactor box hover props to be an object instead * checkout main yarn.lock * yarn changeset * 📝 add jsdoc for Box * 📝 add token documentation * 🚧 Box: add barrel file * 🔥 remove overriding tokens for Box * ♻️ refactor the borderRadius API * 🔥 remove console.logs * bump ts version (make them all equal) * fix new type error that surfaced when upgrading TS * add yarn.lock * 🚧 testing with older TS version again * Revert "🚧 testing with older TS version again" This reverts commit ca09f3c. * add minimum permissions check utility (official github action) * Revert "add minimum permissions check utility (official github action)" This reverts commit f9dd5ea. * test with "read-all|write-all" for a chromatic.yml action * remove unused comments * 🚧 try skip a test suite * Revert "🚧 try skip a test suite" This reverts commit ccf4711. * 🚧 update all node-version to 19 * 💥 Force-tester GHA * 💥 bump node-version to 20 * 💥 test with jsonModules again, but this time with node v20 * 🚧 revert type erasure (for tests) * 🔥 remove hover from Box * 🚧 test with module identifier import * 🚧 squashme * a working token type solution * 📝 group Primitives in storybook * no longer assert type, hint instead * 📝 improve jsdoc for Box * 📝 improve jsdoc for Box * 🚧 test relative import for github action * 🚧 test ordering of yarn builds * 🚧 test ordering of yarn workspaces * 🚧 test dependency for yarn workspaces * 🐛 fix human error in token refactoring * 📝 reword jsdoc * ♻️ refactor * 🚧 test again with module identifier import * squashme * 🚧 fully revert to importing .json * 🚧 remove duplicate types * 🔥 remove style-dicitonary format (now unused), fix shadow.json refs * remove devDependency on tokens (for react) * 📝♻️ update comments & naming * 🚚 Oppdatert CSS-config etter ny primitives gruppering * make border-color also control border-style * add examples for Box to aksel.nav.no * ⬆️ Yarn sort av dependencies * 🎨 BorderWidth tokens * 🎨 Css for borderRadius * 🎨 Setup responsiveRadius utility * ♻️ Forenklet borderRadius * 🎨 refactor padding in box * 🔥 Fjernet unødvendig kode * 🎨 Oppdatert token for borderWidth * 🐛 Default 0px border * 🏷️ Refactor types * 🐛 Fikset stories * ♻️ refactor away one of the getResponsiveProps(), renaming * ♻️ refactor + add token exceptions * 🐛 new props based on BoxProps * 📝 Oppdatert box-eksempler * 📝 border-eksempler * 📝 shadow-eksempel * 📝 header demo * 🔥 Fjernet theming demo, la til panel-demo * 🚚 Flyttet show/hide inn i primitives * 🚚 extract stateful colors to separate files * 🚚 move shadow stateful tokens as well * ♻️ rename some Box types * 🚚 re-add missing token * 🚚 move types file to utils, (bonus: fix some jsdoc) * ➕ add @navikt/ds-tokens to react * Update .changeset/happy-pianos-cheat.md --------- Co-authored-by: Ken <ken.aleksander@gmail.com> Co-authored-by: Lars Hansen <lars.eirik.korsgaard.hansen@nav.no> Co-authored-by: Ken <26967723+KenAJoh@users.noreply.github.com>
- Loading branch information
1 parent
f5f859f
commit 83c9194
Showing
41 changed files
with
1,622 additions
and
416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.