@nurvus/ui 0.1.0-alpha.11 → 0.1.0-alpha.13
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 +20 -9
- package/dist/index.js +1 -1
- package/dist/nurvus.css +15 -0
- package/dist/respawn.js +2 -0
- package/dist/respawn.js.LICENSE.txt +5 -0
- package/dist/theme.js +1 -0
- package/dist/themes/all.css +231 -0
- package/dist/themes/apollo-white.css +33 -0
- package/dist/themes/apollo-white.json +52 -0
- package/dist/themes/arcane.css +33 -0
- package/dist/themes/arcane.json +52 -0
- package/dist/themes/dopamine.css +33 -0
- package/dist/themes/dopamine.json +52 -0
- package/dist/themes/nether-neon.css +33 -0
- package/dist/themes/nether-neon.json +52 -0
- package/dist/themes/nether.css +33 -0
- package/dist/themes/nether.json +52 -0
- package/dist/themes/outworld.css +33 -0
- package/dist/themes/outworld.json +52 -0
- package/dist/themes/roles.json +29 -0
- package/dist/themes/tokyo-neon.css +33 -0
- package/dist/themes/tokyo-neon.json +52 -0
- package/dist/types/components/Button/Button.d.ts +19 -0
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +12 -0
- package/dist/types/components/FullPageModal/FullPageModal.d.ts +15 -0
- package/dist/types/components/HistoryList/HistoryList.d.ts +40 -0
- package/dist/types/components/Layout/Layout.d.ts +27 -0
- package/dist/types/components/Link/Link.d.ts +9 -0
- package/dist/types/components/Menu/Menu.d.ts +35 -0
- package/dist/types/components/NavList/NavList.d.ts +43 -0
- package/dist/types/components/Panel/Panel.d.ts +19 -0
- package/dist/types/components/Progress/Progress.d.ts +15 -0
- package/dist/types/components/Table/Table.d.ts +25 -0
- package/dist/types/components/Tag/Tag.d.ts +15 -0
- package/dist/types/components/Text/Text.d.ts +28 -0
- package/dist/types/components/Title/Title.d.ts +288 -0
- package/dist/types/constants.d.ts +5 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/navList.d.ts +7 -0
- package/dist/types/respawn/Button.d.ts +16 -0
- package/dist/types/respawn/ButtonGroup.d.ts +8 -0
- package/dist/types/respawn/FullPageModal.d.ts +32 -0
- package/dist/types/respawn/HistoryList.d.ts +36 -0
- package/dist/types/respawn/Layout.d.ts +22 -0
- package/dist/types/respawn/Link.d.ts +12 -0
- package/dist/types/respawn/Menu.d.ts +33 -0
- package/dist/types/respawn/NavList.d.ts +43 -0
- package/dist/types/respawn/Panel.d.ts +15 -0
- package/dist/types/respawn/Progress.d.ts +15 -0
- package/dist/types/respawn/Table.d.ts +22 -0
- package/dist/types/respawn/Tag.d.ts +11 -0
- package/dist/types/respawn/Text.d.ts +19 -0
- package/dist/types/respawn/Title.d.ts +14 -0
- package/dist/types/respawn/index.d.ts +35 -0
- package/dist/types/respawn/spawn.d.ts +50 -0
- package/dist/types/respawn/update.d.ts +13 -0
- package/dist/types/spacing.d.ts +8 -0
- package/dist/types/theme.d.ts +32 -0
- package/dist/types/themes/index.d.ts +45 -0
- package/package.json +40 -12
- package/src/components/Button/Button.md +5 -5
- package/src/components/Button/Button.tsx +44 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +23 -0
- package/src/components/FullPageModal/FullPageModal.scss +9 -5
- package/src/components/FullPageModal/FullPageModal.tsx +74 -0
- package/src/components/HistoryList/{HistoryList.jsx → HistoryList.tsx} +45 -58
- package/src/components/Layout/Layout.md +4 -4
- package/src/components/Layout/Layout.scss +14 -47
- package/src/components/Layout/Layout.tsx +56 -0
- package/src/components/Link/Link.scss +9 -9
- package/src/components/Link/Link.tsx +23 -0
- package/src/components/Menu/Menu.tsx +90 -0
- package/src/components/NavList/NavList.md +39 -0
- package/src/components/NavList/NavList.scss +149 -0
- package/src/components/NavList/NavList.tsx +129 -0
- package/src/components/Panel/{Panel.jsx → Panel.tsx} +17 -26
- package/src/components/Progress/Progress.md +5 -5
- package/src/components/Progress/Progress.tsx +36 -0
- package/src/components/Table/Table.tsx +59 -0
- package/src/components/Tag/{Tag.jsx → Tag.tsx} +13 -18
- package/src/components/Text/Text.md +13 -0
- package/src/components/Text/Text.scss +6 -0
- package/src/components/Text/Text.tsx +54 -0
- package/src/components/Title/Title.tsx +42 -0
- package/src/constants.ts +6 -0
- package/src/css.ts +17 -0
- package/src/global.d.ts +3 -0
- package/src/index.ts +42 -0
- package/src/navList.ts +9 -0
- package/src/respawn/Button.ts +31 -0
- package/src/respawn/ButtonGroup.ts +19 -0
- package/src/respawn/FullPageModal.ts +125 -0
- package/src/respawn/HistoryList.ts +100 -0
- package/src/respawn/Layout.ts +44 -0
- package/src/respawn/Link.ts +24 -0
- package/src/respawn/Menu.ts +86 -0
- package/src/respawn/NavList.ts +126 -0
- package/src/respawn/Panel.ts +36 -0
- package/src/respawn/Progress.ts +29 -0
- package/src/respawn/Table.ts +54 -0
- package/src/respawn/Tag.ts +25 -0
- package/src/respawn/Text.ts +35 -0
- package/src/respawn/Title.ts +30 -0
- package/src/respawn/index.ts +59 -0
- package/src/respawn/spawn.ts +155 -0
- package/src/respawn/update.ts +49 -0
- package/src/spacing.ts +23 -0
- package/src/styles/theme.scss +6 -197
- package/src/styles/type.json +35 -5
- package/src/theme.ts +92 -0
- package/src/themes/css/all.css +231 -0
- package/src/themes/css/apollo-white.css +33 -0
- package/src/themes/css/arcane.css +33 -0
- package/src/themes/css/dopamine.css +33 -0
- package/src/themes/css/nether-neon.css +33 -0
- package/src/themes/css/nether.css +33 -0
- package/src/themes/css/outworld.css +33 -0
- package/src/themes/css/tokyo-neon.css +33 -0
- package/src/themes/index.ts +61 -0
- package/src/themes/roles.json +1 -1
- package/src/app.js +0 -29
- package/src/components/Button/Button.jsx +0 -59
- package/src/components/ButtonGroup/ButtonGroup.jsx +0 -28
- package/src/components/FullPageModal/FullPageModal.jsx +0 -106
- package/src/components/Layout/Layout.jsx +0 -68
- package/src/components/Link/Link.jsx +0 -39
- package/src/components/Menu/Menu.jsx +0 -120
- package/src/components/Progress/Progress.jsx +0 -56
- package/src/components/Table/Table.jsx +0 -94
- package/src/components/Text/Text.jsx +0 -54
- package/src/components/Title/Title.jsx +0 -48
- package/src/constants.js +0 -3
- package/src/index.js +0 -20
- package/src/theme.js +0 -64
- package/src/themes/index.js +0 -22
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import CONSTANT from '../../constants.js';
|
|
5
|
-
import './Progress.scss';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Progress component. Use it to track progress!
|
|
9
|
-
* @returns {ReactElement} of Progress component.
|
|
10
|
-
*/
|
|
11
|
-
function Progress({
|
|
12
|
-
className,
|
|
13
|
-
percent = 0,
|
|
14
|
-
size = 'medium',
|
|
15
|
-
status = 'active'
|
|
16
|
-
}) {
|
|
17
|
-
return (
|
|
18
|
-
<div
|
|
19
|
-
className={ classNames(className, 'progress', CONSTANT.CLASS_PREFIX) }
|
|
20
|
-
data-size={ size }
|
|
21
|
-
data-status={ status }
|
|
22
|
-
>
|
|
23
|
-
<div className="bar" style={{ width: `${percent}%` }} />
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
Progress.propTypes = {
|
|
29
|
-
/**
|
|
30
|
-
* Custom class name.
|
|
31
|
-
*/
|
|
32
|
-
className: PropTypes.string,
|
|
33
|
-
/**
|
|
34
|
-
* Progress percent.
|
|
35
|
-
*/
|
|
36
|
-
percent: PropTypes.number,
|
|
37
|
-
/**
|
|
38
|
-
* Bar height.
|
|
39
|
-
*/
|
|
40
|
-
size: PropTypes.oneOf([
|
|
41
|
-
'small',
|
|
42
|
-
'medium',
|
|
43
|
-
'large'
|
|
44
|
-
]),
|
|
45
|
-
/**
|
|
46
|
-
* Progress status: the bar color (accent, success, warning, danger).
|
|
47
|
-
*/
|
|
48
|
-
status: PropTypes.oneOf([
|
|
49
|
-
'active',
|
|
50
|
-
'success',
|
|
51
|
-
'warning',
|
|
52
|
-
'critical'
|
|
53
|
-
])
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export default Progress;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import CONSTANT from '../../constants.js';
|
|
5
|
-
import './Table.scss';
|
|
6
|
-
|
|
7
|
-
class Table extends React.Component {
|
|
8
|
-
renderCells(rowProps) {
|
|
9
|
-
const { columns } = this.props;
|
|
10
|
-
|
|
11
|
-
return columns.map((columnProps, i) => {
|
|
12
|
-
// title and render describe the column; they are not <td> attributes.
|
|
13
|
-
const { dataKey, render, title, ...props } = columnProps;
|
|
14
|
-
const value = rowProps[columnProps.dataKey];
|
|
15
|
-
|
|
16
|
-
let children = value;
|
|
17
|
-
if (render) {
|
|
18
|
-
children = render(value, dataKey, rowProps);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<td key={ dataKey || i } { ...props }>
|
|
23
|
-
{ children }
|
|
24
|
-
</td>
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
renderHeader() {
|
|
30
|
-
const { columns } = this.props;
|
|
31
|
-
|
|
32
|
-
return columns.map((columnProps, i) => {
|
|
33
|
-
// render formats cells; passing it on to <th> made React warn.
|
|
34
|
-
const { dataKey, title, render, ...props } = columnProps;
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<th key={ dataKey || i } { ...props }>
|
|
38
|
-
{ title || dataKey }
|
|
39
|
-
</th>
|
|
40
|
-
);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
renderRows() {
|
|
45
|
-
const{ data } = this.props;
|
|
46
|
-
|
|
47
|
-
return data.map((rowProps, i) => {
|
|
48
|
-
const { key } = rowProps;
|
|
49
|
-
|
|
50
|
-
const isEven = i % 2 == 0;
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<tr key={ key || i } data-even={ isEven }>
|
|
54
|
-
{ this.renderCells(rowProps) }
|
|
55
|
-
</tr>
|
|
56
|
-
);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
render() {
|
|
61
|
-
const { className } = this.props;
|
|
62
|
-
return (
|
|
63
|
-
<table
|
|
64
|
-
className={ classNames(className, 'table', CONSTANT.CLASS_PREFIX) }
|
|
65
|
-
>
|
|
66
|
-
<thead>
|
|
67
|
-
<tr>
|
|
68
|
-
{ this.renderHeader() }
|
|
69
|
-
</tr>
|
|
70
|
-
</thead>
|
|
71
|
-
<tbody>
|
|
72
|
-
{ this.renderRows() }
|
|
73
|
-
</tbody>
|
|
74
|
-
</table>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
Table.propTypes = {
|
|
80
|
-
/**
|
|
81
|
-
* Custom class name.
|
|
82
|
-
*/
|
|
83
|
-
className: PropTypes.string,
|
|
84
|
-
/**
|
|
85
|
-
* Columns to render in table.
|
|
86
|
-
*/
|
|
87
|
-
columns: PropTypes.array,
|
|
88
|
-
/**
|
|
89
|
-
* Data to render in table.
|
|
90
|
-
*/
|
|
91
|
-
data: PropTypes.array
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export default Table;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import CONSTANT from '../../constants.js';
|
|
5
|
-
import './Text.scss';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Text in one of the type roles (display, title, body, caption, mono). The
|
|
9
|
-
* sizes come from the `--nv-type-*` tokens, so every NURVUS page uses the same
|
|
10
|
-
* scale. Without a `variant` it inherits its parent's type, as before.
|
|
11
|
-
*/
|
|
12
|
-
export default function Text({
|
|
13
|
-
as: Element = 'span',
|
|
14
|
-
variant,
|
|
15
|
-
tone,
|
|
16
|
-
children,
|
|
17
|
-
className,
|
|
18
|
-
...restProps
|
|
19
|
-
}) {
|
|
20
|
-
return (
|
|
21
|
-
<Element
|
|
22
|
-
className={ classNames(className, 'text', CONSTANT.CLASS_PREFIX) }
|
|
23
|
-
data-variant={ variant }
|
|
24
|
-
data-tone={ tone }
|
|
25
|
-
{ ...restProps }
|
|
26
|
-
>
|
|
27
|
-
{ children }
|
|
28
|
-
</Element>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
Text.propTypes = {
|
|
33
|
-
/**
|
|
34
|
-
* The element to render, e.g. 'p', 'h1', 'span'.
|
|
35
|
-
*/
|
|
36
|
-
as: PropTypes.elementType,
|
|
37
|
-
/**
|
|
38
|
-
* Type role: display (the one big headline), title (section headings),
|
|
39
|
-
* body (running text), caption (labels and notes), mono (values and code).
|
|
40
|
-
*/
|
|
41
|
-
variant: PropTypes.oneOf(['display', 'title', 'body', 'caption', 'mono']),
|
|
42
|
-
/**
|
|
43
|
-
* Text color from the theme: default (text), muted or subtle.
|
|
44
|
-
*/
|
|
45
|
-
tone: PropTypes.oneOf(['default', 'muted', 'subtle']),
|
|
46
|
-
/**
|
|
47
|
-
* Custom class name.
|
|
48
|
-
*/
|
|
49
|
-
className: PropTypes.string,
|
|
50
|
-
/**
|
|
51
|
-
* The text.
|
|
52
|
-
*/
|
|
53
|
-
children: PropTypes.node
|
|
54
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import CONSTANT from '../../constants.js';
|
|
5
|
-
import './Title.scss';
|
|
6
|
-
|
|
7
|
-
const TAGS = { 1: 'h1', 2: 'h2', 3: 'h3', 4: 'h4', 5: 'h5', 6: 'h6' };
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A heading, `<h1>` to `<h6>`, in the theme's text color. For the larger
|
|
11
|
-
* type roles (display, title, caption) use `Text` with a `variant`.
|
|
12
|
-
*/
|
|
13
|
-
export default function Title({
|
|
14
|
-
children,
|
|
15
|
-
className,
|
|
16
|
-
level = 1,
|
|
17
|
-
type = 'primary',
|
|
18
|
-
...restProps
|
|
19
|
-
}) {
|
|
20
|
-
return React.createElement(
|
|
21
|
-
TAGS[level] || 'h6',
|
|
22
|
-
{
|
|
23
|
-
className: classNames(className, 'title', CONSTANT.CLASS_PREFIX),
|
|
24
|
-
['data-type']: type,
|
|
25
|
-
...restProps
|
|
26
|
-
},
|
|
27
|
-
children
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
Title.propTypes = {
|
|
32
|
-
/**
|
|
33
|
-
* Heading level: 1 renders `<h1>` (24px) down to 6 (`<h6>`).
|
|
34
|
-
*/
|
|
35
|
-
level: PropTypes.oneOf([1, 2, 3, 4, 5, 6]),
|
|
36
|
-
/**
|
|
37
|
-
* `primary` uses the theme's text color; `secondary` the muted one.
|
|
38
|
-
*/
|
|
39
|
-
type: PropTypes.oneOf(['primary', 'secondary']),
|
|
40
|
-
/**
|
|
41
|
-
* Custom class name.
|
|
42
|
-
*/
|
|
43
|
-
className: PropTypes.string,
|
|
44
|
-
/**
|
|
45
|
-
* The heading text.
|
|
46
|
-
*/
|
|
47
|
-
children: PropTypes.node
|
|
48
|
-
};
|
package/src/constants.js
DELETED
package/src/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Themes: the primitives + every [data-theme] block, injected once.
|
|
2
|
-
import './styles/theme.scss';
|
|
3
|
-
|
|
4
|
-
export { themes, DEFAULT_THEME, THEME_STORAGE_KEY, THEME_CHANGE_EVENT, getTheme, currentTheme, setTheme, initTheme } from './theme';
|
|
5
|
-
export { roles as themeRoles } from './themes';
|
|
6
|
-
|
|
7
|
-
// Components
|
|
8
|
-
export { default as Button } from './components/Button/Button.jsx';
|
|
9
|
-
export { default as ButtonGroup } from './components/ButtonGroup/ButtonGroup.jsx';
|
|
10
|
-
export { default as Link } from './components/Link/Link.jsx';
|
|
11
|
-
export { default as Progress } from './components/Progress/Progress.jsx';
|
|
12
|
-
export { default as Layout } from './components/Layout/Layout.jsx';
|
|
13
|
-
export { default as Menu } from './components/Menu/Menu.jsx';
|
|
14
|
-
export { default as FullPageModal } from './components/FullPageModal/FullPageModal.jsx';
|
|
15
|
-
export { default as HistoryList } from './components/HistoryList/HistoryList.jsx';
|
|
16
|
-
export { default as Panel } from './components/Panel/Panel.jsx';
|
|
17
|
-
export { default as Table } from './components/Table/Table.jsx';
|
|
18
|
-
export { default as Tag } from './components/Tag/Tag.jsx';
|
|
19
|
-
export { default as Text } from './components/Text/Text.jsx';
|
|
20
|
-
export { default as Title } from './components/Title/Title.jsx';
|
package/src/theme.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { themes, DEFAULT_THEME } from './themes';
|
|
2
|
-
|
|
3
|
-
/** localStorage key that remembers the chosen theme. */
|
|
4
|
-
export const THEME_STORAGE_KEY = 'nurvus.theme';
|
|
5
|
-
|
|
6
|
-
/** Fired on the themed element (bubbles) after setTheme; detail = the theme. */
|
|
7
|
-
export const THEME_CHANGE_EVENT = 'nurvus:themechange';
|
|
8
|
-
|
|
9
|
-
/** A theme object by id, or undefined. */
|
|
10
|
-
export function getTheme(id) {
|
|
11
|
-
return themes.find((theme) => theme.id === id);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** The theme currently applied to `root` (defaults to <html>). */
|
|
15
|
-
export function currentTheme(root = document.documentElement) {
|
|
16
|
-
return getTheme(root.getAttribute('data-theme')) || getTheme(DEFAULT_THEME);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Apply a theme. Sets data-theme on `root` (default <html>), which swaps every
|
|
21
|
-
* --nv-* custom property underneath it. Pass any element as `root` to theme
|
|
22
|
-
* just that part of the page; themes nest.
|
|
23
|
-
*
|
|
24
|
-
* setTheme('tokyo-neon');
|
|
25
|
-
* setTheme('apollo-white', { root: sidebarEl, persist: false });
|
|
26
|
-
*/
|
|
27
|
-
export function setTheme(id, { root = document.documentElement, persist = true } = {}) {
|
|
28
|
-
const theme = getTheme(id);
|
|
29
|
-
if (!theme) throw new Error(`@nurvus/ui: unknown theme "${id}". Known: ${themes.map((t) => t.id).join(', ')}`);
|
|
30
|
-
root.setAttribute('data-theme', theme.id);
|
|
31
|
-
if (persist) {
|
|
32
|
-
try { window.localStorage.setItem(THEME_STORAGE_KEY, theme.id); } catch (e) { /* storage blocked */ }
|
|
33
|
-
}
|
|
34
|
-
root.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT, { detail: theme, bubbles: true }));
|
|
35
|
-
return theme;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Apply the saved theme, or `fallback` when nothing (valid) is saved.
|
|
40
|
-
* Call once at startup.
|
|
41
|
-
*/
|
|
42
|
-
export function initTheme(fallback = DEFAULT_THEME, options = {}) {
|
|
43
|
-
let saved = null;
|
|
44
|
-
try { saved = window.localStorage.getItem(THEME_STORAGE_KEY); } catch (e) { /* storage blocked */ }
|
|
45
|
-
return setTheme(getTheme(saved) ? saved : fallback, { persist: false, ...options });
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Runs once, when the package is imported: brings back the visitor's saved
|
|
50
|
-
* theme (whatever setTheme saved last time), so an app needs no theme code at
|
|
51
|
-
* all. Nothing saved: nothing changes, and the page shows its own data-theme,
|
|
52
|
-
* or Apollo White when it has none (the CSS default). Skipped outside a
|
|
53
|
-
* browser (server rendering).
|
|
54
|
-
*/
|
|
55
|
-
function restoreSavedTheme() {
|
|
56
|
-
if (typeof window === 'undefined' || typeof document === 'undefined') return;
|
|
57
|
-
let saved = null;
|
|
58
|
-
try { saved = window.localStorage.getItem(THEME_STORAGE_KEY); } catch (e) { return; /* storage blocked */ }
|
|
59
|
-
if (getTheme(saved)) document.documentElement.setAttribute('data-theme', saved);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
restoreSavedTheme();
|
|
63
|
-
|
|
64
|
-
export { themes, DEFAULT_THEME };
|
package/src/themes/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// The NURVUS themes. Each one is a complete, standalone palette: every role
|
|
2
|
-
// token has a value, and no theme inherits from another. Add a theme by adding
|
|
3
|
-
// a JSON file here (see roles.json for what each token is for) and listing it
|
|
4
|
-
// below; tools/build-tokens.js turns them into [data-theme="<id>"] CSS blocks.
|
|
5
|
-
import apolloWhite from './apollo-white.json';
|
|
6
|
-
import dopamine from './dopamine.json';
|
|
7
|
-
import tokyoNeon from './tokyo-neon.json';
|
|
8
|
-
import nether from './nether.json';
|
|
9
|
-
import netherNeon from './nether-neon.json';
|
|
10
|
-
import outworld from './outworld.json';
|
|
11
|
-
import arcane from './arcane.json';
|
|
12
|
-
import roles from './roles.json';
|
|
13
|
-
|
|
14
|
-
/** All themes, in display order (light first). */
|
|
15
|
-
export const themes = [apolloWhite, dopamine, tokyoNeon, nether, netherNeon, outworld, arcane]
|
|
16
|
-
.sort((a, b) => a.order - b.order);
|
|
17
|
-
|
|
18
|
-
/** The theme a page gets with no data-theme attribute at all. */
|
|
19
|
-
export const DEFAULT_THEME = 'apollo-white';
|
|
20
|
-
|
|
21
|
-
/** What each role token is for, and the contrast it must meet. */
|
|
22
|
-
export { roles };
|