-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(portal): use examples as documentation for all comp
affects: @fremtind/jkl-accordion-react, @fremtind/jkl-button-react, @fremtind/jkl-card-react, @fremtind/jkl-checkbox-react, @fremtind/jkl-core, @fremtind/jkl-datepicker-react, @fremtind/jkl-divider-line-react, @fremtind/jkl-field-group-react, @fremtind/jkl-hamburger-react, @fremtind/jkl-list-react, @fremtind/jkl-loader-react, @fremtind/jkl-logo-react, @fremtind/jkl-message-box-react, @fremtind/jkl-radio-button-react, @fremtind/jkl-react-hooks, @fremtind/jkl-select-react, @fremtind/jkl-table-react, @fremtind/jkl-text-input-react, @fremtind/jkl-toggle-switch-react, @fremtind/jkl-typography-react, @fremtind/jkl-webfonts
- Loading branch information
Leiv Fredrik Berge
committed
Dec 12, 2019
1 parent
1c47601
commit e99e56a
Showing
111 changed files
with
574 additions
and
309 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
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
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,9 @@ | ||
--- | ||
title: Card | ||
react: card-react | ||
scss: card | ||
--- | ||
|
||
import Example from "./Example"; | ||
|
||
<Example /> |
File renamed without changes
File renamed without changes
File renamed without changes.
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
4 changes: 2 additions & 2 deletions
4
packages/loader-react/example/index.tsx → packages/card-react/documentation/index.tsx
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,6 +1,6 @@ | ||
import "@fremtind/jkl-loader/loader.min.css"; | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import { Example } from "./Example"; | ||
import Example from "./Example"; | ||
import "../../webfonts/documentation/internal.scss"; | ||
|
||
ReactDOM.render(<Example />, document.getElementById("app")); |
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
--- | ||
title: Checkbox | ||
react: checkbox-react | ||
scss: checkbox | ||
--- | ||
|
||
import Example from "./Example"; | ||
|
||
<Example /> |
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
File renamed without changes.
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,9 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import { initTabListener } from "@fremtind/jkl-core"; | ||
import Example from "./Example"; | ||
import "../../webfonts/documentation/internal.scss"; | ||
|
||
initTabListener(); | ||
|
||
ReactDOM.render(<Example />, document.getElementById("app")); |
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,67 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import "../core.scss"; | ||
import "./style.scss"; | ||
|
||
interface BoxProps { | ||
type: "color" | "component" | "layout"; | ||
number: number; | ||
} | ||
|
||
const Box = ({ type, number }: BoxProps) => <div className={`demo-${type}--${number + 1}`} />; | ||
|
||
Box.propTypes = { | ||
type: PropTypes.string, | ||
number: PropTypes.number, | ||
}; | ||
|
||
export const Colors = () => ( | ||
<section className="jkl-spacing--top-3 jkl-spacing--bottom-3"> | ||
<h1 className="jkl-h1">Colors</h1> | ||
<div className="demo-wrapper"> | ||
{[...Array(14)].map((_, idx) => ( | ||
<Box key={idx} type="color" number={idx} /> | ||
))} | ||
</div> | ||
</section> | ||
); | ||
|
||
export const Typo = () => ( | ||
<section className="jkl-spacing--top-3 jkl-spacing--bottom-3"> | ||
<h1 className="jkl-h1">Heading1</h1> | ||
<h2 className="jkl-h2">Heading2</h2> | ||
<h3 className="jkl-h3">Heading3</h3> | ||
<h4 className="jkl-h4">Heading4</h4> | ||
<p className="jkl-lead">Lead paragraph</p> | ||
<p className="jkl-body">Paragraph</p> | ||
<p className="jkl-small-text">Small paragraph</p> | ||
</section> | ||
); | ||
|
||
export const Spacing = () => ( | ||
<section className="jkl-spacing--top-3 jkl-spacing--bottom-3"> | ||
<h1 className="jkl-h1">Spacing</h1> | ||
<h2 className="jkl-h2">Layout spacing</h2> | ||
<div className="demo-wrapper"> | ||
{[...Array(7)].map((_, idx) => ( | ||
<Box key={idx} type="layout" number={idx} /> | ||
))} | ||
</div> | ||
<h2 className="jkl-h2">Component spacing</h2> | ||
<div className="demo-wrapper"> | ||
{[...Array(9)].map((_, idx) => ( | ||
<Box key={idx} type="component" number={idx} /> | ||
))} | ||
</div> | ||
</section> | ||
); | ||
|
||
const Example = () => ( | ||
<section className="jkl-spacing--top-3 jkl-spacing--bottom-3"> | ||
<Colors /> | ||
<Typo /> | ||
<Spacing /> | ||
</section> | ||
); | ||
|
||
export default Example; |
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,11 @@ | ||
--- | ||
title: Core | ||
scss: core | ||
react: core | ||
--- | ||
|
||
import { Colors, Typo, Spacing } from "./Example"; | ||
|
||
<Colors /> | ||
<Typo /> | ||
<Spacing /> |
File renamed without changes.
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,6 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import Example from "./Example"; | ||
import "../../webfonts/documentation/internal.scss"; | ||
|
||
ReactDOM.render(<Example />, document.getElementById("app")); |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
--- | ||
title: Datepicker | ||
react: datepicker-react | ||
scss: datepicker | ||
--- | ||
|
||
import Example from "./Example"; | ||
|
||
<Example /> |
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
File renamed without changes.
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,9 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import { initTabListener } from "@fremtind/jkl-core"; | ||
import Example from "./Example"; | ||
import "../../webfonts/documentation/internal.scss"; | ||
|
||
initTabListener(); | ||
|
||
ReactDOM.render(<Example />, document.getElementById("app")); |
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,9 @@ | ||
--- | ||
title: Divider line | ||
react: divider-line-react | ||
scss: divider-line | ||
--- | ||
|
||
import Example from "./Example"; | ||
|
||
<Example /> |
Oops, something went wrong.