@nurvus/ui 0.1.0-alpha.14 → 0.1.0-alpha.16
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 +13 -0
- package/dist/icons.svg +73 -0
- package/dist/index.js +1 -1
- package/dist/nurvus.css +14 -10
- package/dist/respawn.js +1 -1
- package/dist/types/breakpoints.d.ts +14 -0
- package/dist/types/components/FullPageModal/FullPageModal.d.ts +11 -2
- package/dist/types/components/Grid/Grid.d.ts +26 -0
- package/dist/types/components/Icon/Icon.d.ts +20 -0
- package/dist/types/components/Loader/Loader.d.ts +21 -0
- package/dist/types/components/Menu/Menu.d.ts +54 -19
- package/dist/types/components/Progress/Progress.d.ts +19 -5
- package/dist/types/components/Stack/Stack.d.ts +26 -0
- package/dist/types/dialog.d.ts +12 -0
- package/dist/types/icons.d.ts +83 -0
- package/dist/types/index.d.ts +13 -1
- package/dist/types/loader.d.ts +28 -0
- package/dist/types/logo.d.ts +5 -0
- package/dist/types/menu.d.ts +43 -14
- package/dist/types/progress.d.ts +11 -0
- package/dist/types/respawn/FullPageModal.d.ts +7 -1
- package/dist/types/respawn/Grid.d.ts +21 -0
- package/dist/types/respawn/Icon.d.ts +22 -0
- package/dist/types/respawn/Loader.d.ts +18 -0
- package/dist/types/respawn/Menu.d.ts +45 -15
- package/dist/types/respawn/Progress.d.ts +18 -6
- package/dist/types/respawn/Stack.d.ts +21 -0
- package/dist/types/respawn/index.d.ts +13 -1
- package/dist/types/respawn/spawn.d.ts +2 -0
- package/package.json +1 -3
- package/src/breakpoints.ts +28 -0
- package/src/components/Button/Button.scss +20 -20
- package/src/components/ButtonGroup/ButtonGroup.md +8 -12
- package/src/components/FullPageModal/FullPageModal.md +20 -17
- package/src/components/FullPageModal/FullPageModal.scss +5 -0
- package/src/components/FullPageModal/FullPageModal.tsx +37 -3
- package/src/components/Grid/Grid.md +37 -0
- package/src/components/Grid/Grid.scss +37 -0
- package/src/components/Grid/Grid.tsx +54 -0
- package/src/components/HistoryList/HistoryList.scss +2 -2
- package/src/components/Icon/Icon.md +22 -0
- package/src/components/Icon/Icon.scss +10 -0
- package/src/components/Icon/Icon.tsx +45 -0
- package/src/components/Layout/Layout.md +10 -18
- package/src/components/Loader/Loader.md +30 -0
- package/src/components/Loader/Loader.scss +42 -0
- package/src/components/Loader/Loader.tsx +68 -0
- package/src/components/Menu/Menu.md +68 -2
- package/src/components/Menu/Menu.scss +48 -18
- package/src/components/Menu/Menu.tsx +146 -39
- package/src/components/Progress/Progress.md +27 -26
- package/src/components/Progress/Progress.scss +41 -36
- package/src/components/Progress/Progress.tsx +50 -6
- package/src/components/Select/Select.scss +20 -19
- package/src/components/Stack/Stack.md +43 -0
- package/src/components/Stack/Stack.scss +36 -0
- package/src/components/Stack/Stack.tsx +52 -0
- package/src/components/Table/Table.scss +1 -1
- package/src/components/Tag/Tag.scss +2 -2
- package/src/components/Text/Text.md +3 -5
- package/src/components/Title/Title.scss +6 -6
- package/src/components/Tree/Tree.md +5 -5
- package/src/css.ts +4 -0
- package/src/dialog.ts +47 -0
- package/src/icons.ts +117 -0
- package/src/index.ts +13 -1
- package/src/loader.ts +43 -0
- package/src/logo.ts +12 -0
- package/src/menu.ts +91 -21
- package/src/progress.ts +21 -0
- package/src/respawn/FullPageModal.ts +30 -3
- package/src/respawn/Grid.ts +41 -0
- package/src/respawn/Icon.ts +47 -0
- package/src/respawn/Loader.ts +77 -0
- package/src/respawn/Menu.ts +138 -34
- package/src/respawn/Progress.ts +56 -13
- package/src/respawn/Stack.ts +37 -0
- package/src/respawn/index.ts +13 -1
- package/src/respawn/spawn.ts +5 -3
- package/src/styles/breakpoints.scss +3 -0
- package/src/styles/theme.scss +55 -55
- package/src/styles/type.json +9 -9
package/src/respawn/spawn.ts
CHANGED
|
@@ -46,9 +46,11 @@ export interface SpawnProps extends ElementProps {
|
|
|
46
46
|
children?: Child | ((el: HTMLElement) => void);
|
|
47
47
|
/** Appends the new element to this one. */
|
|
48
48
|
mountEl?: Element;
|
|
49
|
+
/** Makes the element in this namespace, e.g. 'http://www.w3.org/2000/svg' for SVG (Icon uses it). */
|
|
50
|
+
namespace?: string;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
const SKIP = new Set(['tag', 'children', 'className', 'events', 'style', 'mountEl', 'key', 'ref']);
|
|
53
|
+
const SKIP = new Set(['tag', 'children', 'className', 'events', 'style', 'mountEl', 'namespace', 'key', 'ref']);
|
|
52
54
|
const RENAME: Record<string, string> = { htmlFor: 'for', acceptCharset: 'accept-charset', httpEquiv: 'http-equiv' };
|
|
53
55
|
// Attributes whose value is the text "true" / "false" (React writes these as such).
|
|
54
56
|
const BOOLEANISH = new Set(['draggable', 'spellcheck', 'contenteditable']);
|
|
@@ -137,8 +139,8 @@ export function toNode(child: Child): Node {
|
|
|
137
139
|
*/
|
|
138
140
|
export function spawn<E extends HTMLElement = HTMLElement>(props: SpawnProps | HTMLElement = {}): E {
|
|
139
141
|
if (isNode(props)) return props as E;
|
|
140
|
-
const { tag = 'div', children, className, events, style, mountEl } = props;
|
|
141
|
-
const el = document.createElement(tag) as E;
|
|
142
|
+
const { tag = 'div', children, className, events, style, mountEl, namespace } = props;
|
|
143
|
+
const el = (namespace ? document.createElementNS(namespace, tag) : document.createElement(tag)) as E;
|
|
142
144
|
if (className) el.setAttribute('class', className);
|
|
143
145
|
Object.keys(props).forEach((key) => { if (!SKIP.has(key)) applyAttribute(el, key, props[key]); });
|
|
144
146
|
if (style) applyStyle(el, style);
|
package/src/styles/theme.scss
CHANGED
|
@@ -190,52 +190,52 @@
|
|
|
190
190
|
--pink-opacity--16: rgba(214, 1, 214, 0.1599999964237213);
|
|
191
191
|
--pink-opacity--8: rgba(214, 1, 214, 0.07999999821186066);
|
|
192
192
|
--pink-opacity--4: rgba(214, 1, 214, 0.03999999910593033);
|
|
193
|
-
--36--regular:
|
|
194
|
-
--36--semi-bold:
|
|
195
|
-
--36--bold:
|
|
196
|
-
--24--regular:
|
|
197
|
-
--24--medium:
|
|
198
|
-
--24--semi-bold:
|
|
199
|
-
--24--bold:
|
|
200
|
-
--16--regular:
|
|
201
|
-
--16--medium:
|
|
202
|
-
--16--semi-bold:
|
|
203
|
-
--16--bold:
|
|
204
|
-
--14--regular:
|
|
205
|
-
--14--medium:
|
|
206
|
-
--14--semibold:
|
|
207
|
-
--14--bold:
|
|
208
|
-
--13--regular:
|
|
209
|
-
--13--medium:
|
|
210
|
-
--13--semi-bold:
|
|
211
|
-
--13--bold:
|
|
212
|
-
--12--regular:
|
|
213
|
-
--12--medium:
|
|
214
|
-
--12--semi-bold:
|
|
215
|
-
--12--bold:
|
|
216
|
-
--11--regular:
|
|
217
|
-
--11--medium:
|
|
218
|
-
--11--semibold:
|
|
219
|
-
--11--bold:
|
|
220
|
-
--10--regular:
|
|
221
|
-
--10--medium:
|
|
222
|
-
--10--semibold:
|
|
223
|
-
--10--bold:
|
|
224
|
-
--32--medium:
|
|
225
|
-
--space--0:
|
|
226
|
-
--space--2:
|
|
227
|
-
--space--4:
|
|
228
|
-
--space--8:
|
|
229
|
-
--space--12:
|
|
230
|
-
--space--16:
|
|
231
|
-
--space--24:
|
|
232
|
-
--space--32:
|
|
233
|
-
--space--48:
|
|
234
|
-
--space--64:
|
|
235
|
-
--radius--2:
|
|
236
|
-
--radius--4:
|
|
237
|
-
--radius--8:
|
|
238
|
-
--radius--12:
|
|
193
|
+
--36--regular: 2.25rem;
|
|
194
|
+
--36--semi-bold: 2.25rem;
|
|
195
|
+
--36--bold: 2.25rem;
|
|
196
|
+
--24--regular: 1.5rem;
|
|
197
|
+
--24--medium: 1.5rem;
|
|
198
|
+
--24--semi-bold: 1.5rem;
|
|
199
|
+
--24--bold: 1.5rem;
|
|
200
|
+
--16--regular: 1rem;
|
|
201
|
+
--16--medium: 1rem;
|
|
202
|
+
--16--semi-bold: 1rem;
|
|
203
|
+
--16--bold: 1rem;
|
|
204
|
+
--14--regular: 0.875rem;
|
|
205
|
+
--14--medium: 0.875rem;
|
|
206
|
+
--14--semibold: 0.875rem;
|
|
207
|
+
--14--bold: 0.875rem;
|
|
208
|
+
--13--regular: 0.8125rem;
|
|
209
|
+
--13--medium: 0.8125rem;
|
|
210
|
+
--13--semi-bold: 0.8125rem;
|
|
211
|
+
--13--bold: 0.8125rem;
|
|
212
|
+
--12--regular: 0.75rem;
|
|
213
|
+
--12--medium: 0.75rem;
|
|
214
|
+
--12--semi-bold: 0.75rem;
|
|
215
|
+
--12--bold: 0.75rem;
|
|
216
|
+
--11--regular: 0.6875rem;
|
|
217
|
+
--11--medium: 0.6875rem;
|
|
218
|
+
--11--semibold: 0.6875rem;
|
|
219
|
+
--11--bold: 0.6875rem;
|
|
220
|
+
--10--regular: 0.625rem;
|
|
221
|
+
--10--medium: 0.625rem;
|
|
222
|
+
--10--semibold: 0.625rem;
|
|
223
|
+
--10--bold: 0.625rem;
|
|
224
|
+
--32--medium: 2rem;
|
|
225
|
+
--space--0: 0rem;
|
|
226
|
+
--space--2: 0.125rem;
|
|
227
|
+
--space--4: 0.25rem;
|
|
228
|
+
--space--8: 0.5rem;
|
|
229
|
+
--space--12: 0.75rem;
|
|
230
|
+
--space--16: 1rem;
|
|
231
|
+
--space--24: 1.5rem;
|
|
232
|
+
--space--32: 2rem;
|
|
233
|
+
--space--48: 3rem;
|
|
234
|
+
--space--64: 4rem;
|
|
235
|
+
--radius--2: 0.125rem;
|
|
236
|
+
--radius--4: 0.25rem;
|
|
237
|
+
--radius--8: 0.5rem;
|
|
238
|
+
--radius--12: 0.75rem;
|
|
239
239
|
--radius--full: 9999px;
|
|
240
240
|
--shadow---xs: 0px 1px 2px rgba(16, 24, 40, 0.04);
|
|
241
241
|
--shadow---sm: 0px 1px 3px rgba(16, 24, 40, 0.06);
|
|
@@ -249,24 +249,24 @@
|
|
|
249
249
|
:root {
|
|
250
250
|
--nv-font-sans: 'Inter Variable', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
251
251
|
--nv-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
252
|
-
--nv-type-display-size: clamp(
|
|
252
|
+
--nv-type-display-size: clamp(1.875rem, 4vw, 2.75rem);
|
|
253
253
|
--nv-type-display-line: 1.08;
|
|
254
254
|
--nv-type-display-weight: 600;
|
|
255
255
|
--nv-type-display-tracking: -0.02em;
|
|
256
|
-
--nv-type-title-size:
|
|
257
|
-
--nv-type-title-line:
|
|
256
|
+
--nv-type-title-size: 1.375rem;
|
|
257
|
+
--nv-type-title-line: 1.75rem;
|
|
258
258
|
--nv-type-title-weight: 600;
|
|
259
259
|
--nv-type-title-tracking: -0.01em;
|
|
260
|
-
--nv-type-body-size:
|
|
261
|
-
--nv-type-body-line:
|
|
260
|
+
--nv-type-body-size: 1rem;
|
|
261
|
+
--nv-type-body-line: 1.5rem;
|
|
262
262
|
--nv-type-body-weight: 400;
|
|
263
263
|
--nv-type-body-tracking: 0;
|
|
264
|
-
--nv-type-caption-size:
|
|
265
|
-
--nv-type-caption-line:
|
|
264
|
+
--nv-type-caption-size: 0.875rem;
|
|
265
|
+
--nv-type-caption-line: 1.25rem;
|
|
266
266
|
--nv-type-caption-weight: 400;
|
|
267
267
|
--nv-type-caption-tracking: 0;
|
|
268
|
-
--nv-type-mono-size:
|
|
269
|
-
--nv-type-mono-line:
|
|
268
|
+
--nv-type-mono-size: 0.8125rem;
|
|
269
|
+
--nv-type-mono-line: 1.25rem;
|
|
270
270
|
--nv-type-mono-weight: 400;
|
|
271
271
|
--nv-type-mono-tracking: 0;
|
|
272
272
|
}
|
package/src/styles/type.json
CHANGED
|
@@ -5,36 +5,36 @@
|
|
|
5
5
|
},
|
|
6
6
|
"roles": {
|
|
7
7
|
"display": {
|
|
8
|
-
"size": "clamp(
|
|
8
|
+
"size": "clamp(1.875rem, 4vw, 2.75rem)",
|
|
9
9
|
"line": "1.08",
|
|
10
10
|
"weight": "600",
|
|
11
11
|
"tracking": "-0.02em",
|
|
12
12
|
"use": "The one big headline on a page."
|
|
13
13
|
},
|
|
14
14
|
"title": {
|
|
15
|
-
"size": "
|
|
16
|
-
"line": "
|
|
15
|
+
"size": "1.375rem",
|
|
16
|
+
"line": "1.75rem",
|
|
17
17
|
"weight": "600",
|
|
18
18
|
"tracking": "-0.01em",
|
|
19
19
|
"use": "Section headings and panel titles."
|
|
20
20
|
},
|
|
21
21
|
"body": {
|
|
22
|
-
"size": "
|
|
23
|
-
"line": "
|
|
22
|
+
"size": "1rem",
|
|
23
|
+
"line": "1.5rem",
|
|
24
24
|
"weight": "400",
|
|
25
25
|
"tracking": "0",
|
|
26
26
|
"use": "Running text."
|
|
27
27
|
},
|
|
28
28
|
"caption": {
|
|
29
|
-
"size": "
|
|
30
|
-
"line": "
|
|
29
|
+
"size": "0.875rem",
|
|
30
|
+
"line": "1.25rem",
|
|
31
31
|
"weight": "400",
|
|
32
32
|
"tracking": "0",
|
|
33
33
|
"use": "Labels, captions, table cells, notes."
|
|
34
34
|
},
|
|
35
35
|
"mono": {
|
|
36
|
-
"size": "
|
|
37
|
-
"line": "
|
|
36
|
+
"size": "0.8125rem",
|
|
37
|
+
"line": "1.25rem",
|
|
38
38
|
"weight": "400",
|
|
39
39
|
"tracking": "0",
|
|
40
40
|
"use": "Values: hex codes, tokens, numbers, code."
|