@nurvus/ui 0.1.0-alpha.7 → 0.1.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -9
- package/package.json +3 -4
- package/src/components/Button/Button.jsx +7 -9
- package/src/components/FullPageModal/FullPageModal.jsx +7 -9
- package/src/components/Layout/Layout.jsx +10 -12
- package/src/components/Panel/Panel.jsx +8 -10
- package/src/components/Panel/Panel.md +1 -1
- package/src/components/Progress/Progress.jsx +6 -8
- package/src/components/Tag/Tag.jsx +6 -8
- package/src/components/Text/Text.jsx +8 -10
- package/src/components/Title/Title.jsx +7 -9
package/README.md
CHANGED
|
@@ -53,21 +53,20 @@ initTheme('tokyo-neon'); // at startup: the saved theme, or this default
|
|
|
53
53
|
setTheme('apollo-white'); // switch, and remember it (localStorage "nurvus.theme")
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Themes nest (`<nav data-theme="tokyo-neon">` inside a light page), and your own CSS should use the role tokens, never raw hex. Theme files live in `src/themes/*.json`; `npm run build:tokens` turns them into CSS and checks every theme's WCAG contrast (a failing `stable` theme fails the build). Each theme has its own page
|
|
56
|
+
Themes nest (`<nav data-theme="tokyo-neon">` inside a light page), and your own CSS should use the role tokens, never raw hex. Theme files live in `src/themes/*.json`; `npm run build:tokens` turns them into CSS and checks every theme's WCAG contrast (a failing `stable` theme fails the build). Each theme has its own page on the docs site.
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Latest preview version can be viewed here:
|
|
62
|
-
https://unstable.memoryleak.ai/nurvus-design-system
|
|
58
|
+
### Docs
|
|
59
|
+
Every component and theme, with live examples you can edit and each component's props: **https://design.nurvus.ai/**
|
|
63
60
|
|
|
64
61
|
## Contribute
|
|
65
62
|
### Getting Started
|
|
66
63
|
Run/Dev
|
|
67
64
|
1. `npm install` to install
|
|
68
|
-
2. `npm run styleguide` to run
|
|
69
|
-
3. Go to `http://localhost:
|
|
65
|
+
2. `npm run docs` (or `npm run styleguide`) to run the docs site with hot reload
|
|
66
|
+
3. Go to `http://localhost:6061/`
|
|
67
|
+
|
|
68
|
+
The docs site lives in `docs/` (Vite). Component pages come from each component's `<Name>.md` (examples in ```jsx blocks: imports work, every @nurvus/ui component is in scope, the last JSX renders) and its PropTypes + docblocks (the props table).
|
|
70
69
|
|
|
71
70
|
Build
|
|
72
71
|
1. `npm run build` to generate components package to `./dist`.
|
|
73
|
-
2. `npm run
|
|
72
|
+
2. `npm run docs:build` to build the docs site to `./docs/dist/` (what design.nurvus.ai serves; CI deploys it on every push to `main`).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nurvus/ui",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
4
|
"description": "NURVUS Design System",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"build": "rimraf dist && npm run build:tokens && cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --mode=production --json > stats.json",
|
|
11
11
|
"build:tokens": "node ./tools/build-tokens.js",
|
|
12
12
|
"prepare": "npm run build",
|
|
13
|
-
"styleguide": "npm run
|
|
14
|
-
"styleguide:build": "
|
|
13
|
+
"styleguide": "npm run docs",
|
|
14
|
+
"styleguide:build": "npm run docs:build",
|
|
15
15
|
"docs": "npm run build:tokens && vite --config docs/vite.config.js",
|
|
16
16
|
"docs:build": "npm run build:tokens && vite build --config docs/vite.config.js"
|
|
17
17
|
},
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"react": "^16.8.0",
|
|
55
55
|
"react-docgen": "^8.0.4",
|
|
56
56
|
"react-dom": "^16.8.0",
|
|
57
|
-
"react-styleguidist": "^11.1.7",
|
|
58
57
|
"resolve-url-loader": "^5.0.0",
|
|
59
58
|
"rimraf": "^3.0.2",
|
|
60
59
|
"sass": "^1.77.8",
|
|
@@ -8,15 +8,13 @@ import './Button.scss';
|
|
|
8
8
|
* Button component.
|
|
9
9
|
* @returns {ReactElement} of Button component.
|
|
10
10
|
*/
|
|
11
|
-
const Button = React.forwardRef(function Button(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = props;
|
|
19
|
-
|
|
11
|
+
const Button = React.forwardRef(function Button({
|
|
12
|
+
className,
|
|
13
|
+
children,
|
|
14
|
+
size = 'medium',
|
|
15
|
+
type = 'primary',
|
|
16
|
+
...restProps
|
|
17
|
+
}, ref) {
|
|
20
18
|
return (
|
|
21
19
|
<button
|
|
22
20
|
className={ classNames(`${CONSTANT.CLASS_PREFIX}`, 'button', className) }
|
|
@@ -9,15 +9,13 @@ import './FullPageModal.scss';
|
|
|
9
9
|
/**
|
|
10
10
|
* The FullPageModal shows additonal content overlayed on the screen.
|
|
11
11
|
*/
|
|
12
|
-
function FullPageModal(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = props;
|
|
20
|
-
|
|
12
|
+
function FullPageModal({
|
|
13
|
+
children,
|
|
14
|
+
headerActions,
|
|
15
|
+
title,
|
|
16
|
+
visible = false,
|
|
17
|
+
...restProps
|
|
18
|
+
}) {
|
|
21
19
|
function getAnimationState() {
|
|
22
20
|
if (visible) {
|
|
23
21
|
return 'reveal-in';
|
|
@@ -3,18 +3,16 @@ import classNames from 'classnames';
|
|
|
3
3
|
import CONSTANT from '../../constants.js';
|
|
4
4
|
import './Layout.scss';
|
|
5
5
|
|
|
6
|
-
export default function Layout(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} = props;
|
|
17
|
-
|
|
6
|
+
export default function Layout({
|
|
7
|
+
alignItems,
|
|
8
|
+
className,
|
|
9
|
+
display = 'block',
|
|
10
|
+
flexDirection,
|
|
11
|
+
justifyContent,
|
|
12
|
+
itemDisplay,
|
|
13
|
+
itemSpacing = 20,
|
|
14
|
+
...restProps
|
|
15
|
+
}) {
|
|
18
16
|
return (
|
|
19
17
|
<div
|
|
20
18
|
className={ classNames(`${CONSTANT.CLASS_PREFIX}`, 'layout', className) }
|
|
@@ -8,16 +8,14 @@ import './Panel.scss';
|
|
|
8
8
|
* A card: the theme's surface, a hairline border and 12px corners, with an
|
|
9
9
|
* optional title and a caption footer. Use it to group related content.
|
|
10
10
|
*/
|
|
11
|
-
export default function Panel(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = props;
|
|
20
|
-
|
|
11
|
+
export default function Panel({
|
|
12
|
+
title,
|
|
13
|
+
caption,
|
|
14
|
+
padding = 'medium',
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
...restProps
|
|
18
|
+
}) {
|
|
21
19
|
return (
|
|
22
20
|
<section
|
|
23
21
|
className={ classNames(`${CONSTANT.CLASS_PREFIX}`, 'panel', className) }
|
|
@@ -8,14 +8,12 @@ import './Progress.scss';
|
|
|
8
8
|
* Progress component. Use it to track progress!
|
|
9
9
|
* @returns {ReactElement} of Progress component.
|
|
10
10
|
*/
|
|
11
|
-
function Progress(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = props;
|
|
18
|
-
|
|
11
|
+
function Progress({
|
|
12
|
+
className,
|
|
13
|
+
percent = 0,
|
|
14
|
+
size = 'medium',
|
|
15
|
+
status = 'active'
|
|
16
|
+
}) {
|
|
19
17
|
return (
|
|
20
18
|
<div
|
|
21
19
|
className={ classNames(`${CONSTANT.CLASS_PREFIX}`, 'progress', className) }
|
|
@@ -8,14 +8,12 @@ import './Tag.scss';
|
|
|
8
8
|
* A small pill for a status or label ("new", "preview", "demo"). The text and
|
|
9
9
|
* the border take the tone's theme color; the fill is a faint tint of it.
|
|
10
10
|
*/
|
|
11
|
-
export default function Tag(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = props;
|
|
18
|
-
|
|
11
|
+
export default function Tag({
|
|
12
|
+
tone = 'neutral',
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
...restProps
|
|
16
|
+
}) {
|
|
19
17
|
return (
|
|
20
18
|
<span
|
|
21
19
|
className={ classNames(`${CONSTANT.CLASS_PREFIX}`, 'tag', className) }
|
|
@@ -9,16 +9,14 @@ import './Text.scss';
|
|
|
9
9
|
* sizes come from the `--nv-type-*` tokens, so every NURVUS page uses the same
|
|
10
10
|
* scale. Without a `variant` it inherits its parent's type, as before.
|
|
11
11
|
*/
|
|
12
|
-
export default function Text(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = props;
|
|
21
|
-
|
|
12
|
+
export default function Text({
|
|
13
|
+
as: Element = 'span',
|
|
14
|
+
variant,
|
|
15
|
+
tone,
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
...restProps
|
|
19
|
+
}) {
|
|
22
20
|
return (
|
|
23
21
|
<Element
|
|
24
22
|
className={ classNames(`${CONSTANT.CLASS_PREFIX}`, 'text', className) }
|
|
@@ -30,15 +30,13 @@ function getTag(level) {
|
|
|
30
30
|
* Title component.
|
|
31
31
|
* @returns {ReactElement} of Title component.
|
|
32
32
|
*/
|
|
33
|
-
export default function Title(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} = props;
|
|
41
|
-
|
|
33
|
+
export default function Title({
|
|
34
|
+
children,
|
|
35
|
+
className,
|
|
36
|
+
level = 1,
|
|
37
|
+
type = "primary",
|
|
38
|
+
...restProps
|
|
39
|
+
}) {
|
|
42
40
|
return React.createElement(
|
|
43
41
|
getTag(level),
|
|
44
42
|
{
|