@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.
Files changed (82) hide show
  1. package/README.md +13 -0
  2. package/dist/icons.svg +73 -0
  3. package/dist/index.js +1 -1
  4. package/dist/nurvus.css +14 -10
  5. package/dist/respawn.js +1 -1
  6. package/dist/types/breakpoints.d.ts +14 -0
  7. package/dist/types/components/FullPageModal/FullPageModal.d.ts +11 -2
  8. package/dist/types/components/Grid/Grid.d.ts +26 -0
  9. package/dist/types/components/Icon/Icon.d.ts +20 -0
  10. package/dist/types/components/Loader/Loader.d.ts +21 -0
  11. package/dist/types/components/Menu/Menu.d.ts +54 -19
  12. package/dist/types/components/Progress/Progress.d.ts +19 -5
  13. package/dist/types/components/Stack/Stack.d.ts +26 -0
  14. package/dist/types/dialog.d.ts +12 -0
  15. package/dist/types/icons.d.ts +83 -0
  16. package/dist/types/index.d.ts +13 -1
  17. package/dist/types/loader.d.ts +28 -0
  18. package/dist/types/logo.d.ts +5 -0
  19. package/dist/types/menu.d.ts +43 -14
  20. package/dist/types/progress.d.ts +11 -0
  21. package/dist/types/respawn/FullPageModal.d.ts +7 -1
  22. package/dist/types/respawn/Grid.d.ts +21 -0
  23. package/dist/types/respawn/Icon.d.ts +22 -0
  24. package/dist/types/respawn/Loader.d.ts +18 -0
  25. package/dist/types/respawn/Menu.d.ts +45 -15
  26. package/dist/types/respawn/Progress.d.ts +18 -6
  27. package/dist/types/respawn/Stack.d.ts +21 -0
  28. package/dist/types/respawn/index.d.ts +13 -1
  29. package/dist/types/respawn/spawn.d.ts +2 -0
  30. package/package.json +1 -3
  31. package/src/breakpoints.ts +28 -0
  32. package/src/components/Button/Button.scss +20 -20
  33. package/src/components/ButtonGroup/ButtonGroup.md +8 -12
  34. package/src/components/FullPageModal/FullPageModal.md +20 -17
  35. package/src/components/FullPageModal/FullPageModal.scss +5 -0
  36. package/src/components/FullPageModal/FullPageModal.tsx +37 -3
  37. package/src/components/Grid/Grid.md +37 -0
  38. package/src/components/Grid/Grid.scss +37 -0
  39. package/src/components/Grid/Grid.tsx +54 -0
  40. package/src/components/HistoryList/HistoryList.scss +2 -2
  41. package/src/components/Icon/Icon.md +22 -0
  42. package/src/components/Icon/Icon.scss +10 -0
  43. package/src/components/Icon/Icon.tsx +45 -0
  44. package/src/components/Layout/Layout.md +10 -18
  45. package/src/components/Loader/Loader.md +30 -0
  46. package/src/components/Loader/Loader.scss +42 -0
  47. package/src/components/Loader/Loader.tsx +68 -0
  48. package/src/components/Menu/Menu.md +68 -2
  49. package/src/components/Menu/Menu.scss +48 -18
  50. package/src/components/Menu/Menu.tsx +146 -39
  51. package/src/components/Progress/Progress.md +27 -26
  52. package/src/components/Progress/Progress.scss +41 -36
  53. package/src/components/Progress/Progress.tsx +50 -6
  54. package/src/components/Select/Select.scss +20 -19
  55. package/src/components/Stack/Stack.md +43 -0
  56. package/src/components/Stack/Stack.scss +36 -0
  57. package/src/components/Stack/Stack.tsx +52 -0
  58. package/src/components/Table/Table.scss +1 -1
  59. package/src/components/Tag/Tag.scss +2 -2
  60. package/src/components/Text/Text.md +3 -5
  61. package/src/components/Title/Title.scss +6 -6
  62. package/src/components/Tree/Tree.md +5 -5
  63. package/src/css.ts +4 -0
  64. package/src/dialog.ts +47 -0
  65. package/src/icons.ts +117 -0
  66. package/src/index.ts +13 -1
  67. package/src/loader.ts +43 -0
  68. package/src/logo.ts +12 -0
  69. package/src/menu.ts +91 -21
  70. package/src/progress.ts +21 -0
  71. package/src/respawn/FullPageModal.ts +30 -3
  72. package/src/respawn/Grid.ts +41 -0
  73. package/src/respawn/Icon.ts +47 -0
  74. package/src/respawn/Loader.ts +77 -0
  75. package/src/respawn/Menu.ts +138 -34
  76. package/src/respawn/Progress.ts +56 -13
  77. package/src/respawn/Stack.ts +37 -0
  78. package/src/respawn/index.ts +13 -1
  79. package/src/respawn/spawn.ts +5 -3
  80. package/src/styles/breakpoints.scss +3 -0
  81. package/src/styles/theme.scss +55 -55
  82. package/src/styles/type.json +9 -9
@@ -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);
@@ -0,0 +1,3 @@
1
+ // The breakpoints (src/breakpoints.ts has the same numbers for JavaScript).
2
+ // em, so a reader who sets bigger text gets the narrower layout sooner.
3
+ $nurvus-breakpoints: (sm: 40em, md: 48em, lg: 64em, xl: 80em);
@@ -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: 36px;
194
- --36--semi-bold: 36px;
195
- --36--bold: 36px;
196
- --24--regular: 24px;
197
- --24--medium: 24px;
198
- --24--semi-bold: 24px;
199
- --24--bold: 24px;
200
- --16--regular: 16px;
201
- --16--medium: 16px;
202
- --16--semi-bold: 16px;
203
- --16--bold: 16px;
204
- --14--regular: 14px;
205
- --14--medium: 14px;
206
- --14--semibold: 14px;
207
- --14--bold: 14px;
208
- --13--regular: 13px;
209
- --13--medium: 13px;
210
- --13--semi-bold: 13px;
211
- --13--bold: 13px;
212
- --12--regular: 12px;
213
- --12--medium: 12px;
214
- --12--semi-bold: 12px;
215
- --12--bold: 12px;
216
- --11--regular: 11px;
217
- --11--medium: 11px;
218
- --11--semibold: 11px;
219
- --11--bold: 11px;
220
- --10--regular: 10px;
221
- --10--medium: 10px;
222
- --10--semibold: 10px;
223
- --10--bold: 10px;
224
- --32--medium: 32px;
225
- --space--0: 0px;
226
- --space--2: 2px;
227
- --space--4: 4px;
228
- --space--8: 8px;
229
- --space--12: 12px;
230
- --space--16: 16px;
231
- --space--24: 24px;
232
- --space--32: 32px;
233
- --space--48: 48px;
234
- --space--64: 64px;
235
- --radius--2: 2px;
236
- --radius--4: 4px;
237
- --radius--8: 8px;
238
- --radius--12: 12px;
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(30px, 4vw, 44px);
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: 22px;
257
- --nv-type-title-line: 28px;
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: 16px;
261
- --nv-type-body-line: 24px;
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: 14px;
265
- --nv-type-caption-line: 20px;
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: 13px;
269
- --nv-type-mono-line: 20px;
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
  }
@@ -5,36 +5,36 @@
5
5
  },
6
6
  "roles": {
7
7
  "display": {
8
- "size": "clamp(30px, 4vw, 44px)",
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": "22px",
16
- "line": "28px",
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": "16px",
23
- "line": "24px",
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": "14px",
30
- "line": "20px",
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": "13px",
37
- "line": "20px",
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."