@nova-design-system/nova-base 3.0.0-beta.30 → 3.0.0-beta.33

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 (35) hide show
  1. package/dist/css/mccs.css +1378 -0
  2. package/dist/css/nova-utils.css +951 -73
  3. package/dist/css/ocean.css +453 -28446
  4. package/dist/css/spark.css +434 -28427
  5. package/dist/js/ocean_dark.d.ts +119 -124
  6. package/dist/js/ocean_dark.js +152 -157
  7. package/dist/js/ocean_light.d.ts +119 -124
  8. package/dist/js/ocean_light.js +143 -148
  9. package/dist/js/primitives.d.ts +0 -6
  10. package/dist/js/primitives.js +0 -6
  11. package/dist/js/spacings.d.ts +2 -0
  12. package/dist/js/spacings.js +3 -1
  13. package/dist/js/spark_dark.d.ts +108 -113
  14. package/dist/js/spark_dark.js +120 -125
  15. package/dist/js/spark_light.d.ts +108 -113
  16. package/dist/js/spark_light.js +108 -113
  17. package/dist/lib/cjs/generated/nova-tailwind-components.js +292 -0
  18. package/dist/lib/cjs/{nova-plugin.js → lib/nova-plugin.js} +30 -82
  19. package/dist/lib/cjs/{nova-safelist.js → lib/nova-safelist.js} +13 -5
  20. package/dist/lib/cjs/{nova-theme.js → lib/nova-theme.js} +14 -2
  21. package/dist/lib/generated/nova-tailwind-components.d.ts +288 -0
  22. package/dist/lib/generated/nova-tailwind-components.js +289 -0
  23. package/dist/lib/{nova-plugin.js → lib/nova-plugin.js} +12 -64
  24. package/dist/lib/{nova-safelist.d.ts → lib/nova-safelist.d.ts} +2 -2
  25. package/dist/lib/{nova-safelist.js → lib/nova-safelist.js} +14 -4
  26. package/dist/lib/{nova-theme.js → lib/nova-theme.js} +14 -2
  27. package/package.json +7 -2
  28. /package/dist/lib/cjs/{nova-tailwind-tokens.js → generated/nova-tailwind-tokens.js} +0 -0
  29. /package/dist/lib/cjs/{index.js → lib/index.js} +0 -0
  30. /package/dist/lib/{nova-tailwind-tokens.d.ts → generated/nova-tailwind-tokens.d.ts} +0 -0
  31. /package/dist/lib/{nova-tailwind-tokens.js → generated/nova-tailwind-tokens.js} +0 -0
  32. /package/dist/lib/{index.d.ts → lib/index.d.ts} +0 -0
  33. /package/dist/lib/{index.js → lib/index.js} +0 -0
  34. /package/dist/lib/{nova-plugin.d.ts → lib/nova-plugin.d.ts} +0 -0
  35. /package/dist/lib/{nova-theme.d.ts → lib/nova-theme.d.ts} +0 -0
@@ -2,6 +2,8 @@
2
2
  * @fileoverview This file contains various tailwind utilities for nova
3
3
  */
4
4
  import plugin from 'tailwindcss/plugin.js';
5
+ import { NOVA_TAILWIND_TOKENS } from '../generated/nova-tailwind-tokens.js';
6
+ import { NOVA_TAILWIND_COMPONENTS } from '../generated/nova-tailwind-components.js';
5
7
  export const novaTailwindPlugin = plugin(({ addUtilities, addComponents, addBase, theme }) => {
6
8
  addBase({
7
9
  'body, html': {
@@ -20,61 +22,55 @@ export const novaTailwindPlugin = plugin(({ addUtilities, addComponents, addBase
20
22
  'border-radius': 'var(--radius-rounded)',
21
23
  },
22
24
  a: {
23
- color: 'var(--color-interaction-link-inline-text)',
25
+ color: 'var(--color-interaction-link-high-text)',
24
26
  'text-decoration': 'underline',
25
27
  fontWeight: '700',
26
28
  },
27
29
  'a:hover': {
28
- color: 'var(--color-interaction-link-inline-text-hover)',
30
+ color: 'var(--color-interaction-link-high-text-hover)',
29
31
  },
30
32
  h1: {
31
33
  fontSize: 'var(--global-typography-h1-font-size)',
32
34
  lineHeight: 'var(--global-typography-h1-line-height)',
33
35
  fontWeight: 'var(--global-typography-h1-font-weight)',
34
- color: 'var(--color-base-content-high-emphasis)',
36
+ color: 'var(--color-content-high-text)',
35
37
  },
36
38
  h2: {
37
39
  fontSize: 'var(--global-typography-h2-font-size)',
38
40
  lineHeight: 'var(--global-typography-h2-line-height)',
39
41
  fontWeight: 'var(--global-typography-h2-font-weight)',
40
- color: 'var(--color-base-content-high-emphasis)',
42
+ color: 'var(--color-content-high-text)',
41
43
  },
42
44
  h3: {
43
45
  fontSize: 'var(--global-typography-h3-font-size)',
44
46
  lineHeight: 'var(--global-typography-h3-line-height)',
45
47
  fontWeight: 'var(--global-typography-h3-font-weight)',
46
- color: 'var(--color-base-content-high-emphasis)',
48
+ color: 'var(--color-content-high-text)',
47
49
  },
48
50
  h4: {
49
51
  fontSize: 'var(--global-typography-h4-font-size)',
50
52
  lineHeight: 'var(--global-typography-h4-line-height)',
51
53
  fontWeight: 'var(--global-typography-h4-font-weight)',
52
- color: 'var(--color-base-content-high-emphasis)',
54
+ color: 'var(--color-content-high-text)',
53
55
  },
54
56
  h5: {
55
57
  fontSize: 'var(--global-typography-h4-font-size)',
56
58
  lineHeight: 'var(--global-typography-h4-line-height)',
57
59
  fontWeight: 'var(--font-weight-medium-emphasis)',
58
- color: 'var(--color-base-content-medium-emphasis)',
60
+ color: 'var(--color-content-medium-text)',
59
61
  },
60
62
  h6: {
61
63
  fontSize: 'var(--global-typography-h4-font-size)',
62
64
  lineHeight: 'var(--global-typography-h4-line-height)',
63
65
  fontWeight: 'var(--font-weight-low-emphasis)',
64
- color: 'var(--color-base-content-low-emphasis)',
66
+ color: 'var(--color-content-low-text)',
65
67
  },
66
68
  });
67
69
  addComponents({
68
- '.link': {
69
- color: 'var(--color-interaction-link-standalone-text)',
70
- fontWeight: '500',
71
- 'text-decoration': 'none',
72
- },
73
- '.link:hover': {
74
- color: 'var(--color-interaction-link-standalone-text-hover)',
75
- },
70
+ ...NOVA_TAILWIND_COMPONENTS,
76
71
  });
77
72
  addUtilities({
73
+ ...NOVA_TAILWIND_TOKENS,
78
74
  '.visually-hidden': {
79
75
  position: 'absolute',
80
76
  padding: '0',
@@ -86,54 +82,6 @@ export const novaTailwindPlugin = plugin(({ addUtilities, addComponents, addBase
86
82
  margin: '-1px',
87
83
  clip: 'rect(0, 0, 0, 0)',
88
84
  },
89
- '.text-high-emphasis': {
90
- color: 'var(--color-base-content-high-emphasis)',
91
- },
92
- '.text-medium-emphasis': {
93
- color: 'var(--color-base-content-medium-emphasis)',
94
- },
95
- '.text-low-emphasis': {
96
- color: 'var(--color-base-content-low-emphasis)',
97
- },
98
- '.bg-level-00': {
99
- 'background-color': 'var(--color-base-level-00)',
100
- },
101
- '.bg-level-00-hover': {
102
- 'background-color': 'var(--color-base-level-00-hover)',
103
- },
104
- '.bg-level-10': {
105
- 'background-color': 'var(--color-base-level-10)',
106
- },
107
- '.bg-level-10-hover': {
108
- 'background-color': 'var(--color-base-level-10-hover)',
109
- },
110
- '.bg-level-20': {
111
- 'background-color': 'var(--color-base-level-20)',
112
- },
113
- '.bg-level-20-hover': {
114
- 'background-color': 'var(--color-base-level-20-hover)',
115
- },
116
- '.bg-level-30': {
117
- 'background-color': 'var(--color-base-level-30)',
118
- },
119
- '.bg-level-30-hover': {
120
- 'background-color': 'var(--color-base-level-30-hover)',
121
- },
122
- '.bg-level-40': {
123
- 'background-color': 'var(--color-base-level-40)',
124
- },
125
- '.bg-level-40-hover': {
126
- 'background-color': 'var(--color-base-level-40-hover)',
127
- },
128
- '.border-high-emphasis': {
129
- 'border-color': 'var(--color-base-border-high-emphasis)',
130
- },
131
- '.border-medium-emphasis': {
132
- 'border-color': 'var(--color-base-border-medium-emphasis)',
133
- },
134
- '.border-low-emphasis': {
135
- 'border-color': 'var(--color-base-border-low-emphasis)',
136
- },
137
85
  '.w-inherit': {
138
86
  width: 'inherit',
139
87
  },
@@ -21,6 +21,6 @@ export declare const gap: {
21
21
  pattern: RegExp;
22
22
  variants: string[];
23
23
  }[];
24
- export declare const novaThemeSafelist: {
24
+ export declare const novaThemeSafelist: (string | {
25
25
  pattern: RegExp;
26
- }[];
26
+ })[];
@@ -7,6 +7,8 @@
7
7
  * they can configure Tailwind directly without using the predefined safelists.
8
8
  */
9
9
  import { spacing } from './nova-theme.js';
10
+ import { NOVA_TAILWIND_TOKENS } from '../generated/nova-tailwind-tokens.js';
11
+ import { NOVA_TAILWIND_COMPONENTS } from '../generated/nova-tailwind-components.js';
10
12
  // Enables responsive spacing modifiers for safelist variants
11
13
  export const responsive = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'];
12
14
  // Enables responsive color schemes for safelist variants
@@ -312,12 +314,19 @@ const resize = [
312
314
  // From the nova tailwind plugin (nova-plugin.ts)
313
315
  const utils = [
314
316
  { pattern: /^visually-hidden$/, variants: responsive },
315
- { pattern: /^font-(high|medium|low)-emphasis$/ },
317
+ { pattern: /^text-(high|medium|low)$/ },
316
318
  { pattern: /^bg-level-(00|10|20|30|40)(-hover)?$/ },
317
- { pattern: /^border-(high|medium|low)-emphasis$/ },
319
+ { pattern: /^border-(high|medium|low)$/ },
320
+ ];
321
+ // From the nova tailwind components (nova-tailwind-components.ts)
322
+ const components = [
323
+ ...Object.keys(NOVA_TAILWIND_COMPONENTS).filter((key) => /^\.[a-zA-Z0-9-]+$/.test(key)),
324
+ ];
325
+ // From the nova tailwind tokens (nova-tailwind-tokens.ts)
326
+ const tokens = [
327
+ ...Object.keys(NOVA_TAILWIND_TOKENS),
328
+ { pattern: /-hover$/, variants: ['hover'] },
318
329
  ];
319
- // From the nova tailwind plugin (nova-plugin.ts)
320
- const components = [{ pattern: /^link$/, variants: pointer }];
321
330
  export const novaThemeSafelist = [
322
331
  ...padding,
323
332
  ...margin,
@@ -341,4 +350,5 @@ export const novaThemeSafelist = [
341
350
  ...resize,
342
351
  ...utils,
343
352
  ...components,
353
+ ...tokens,
344
354
  ];
@@ -84,8 +84,20 @@ export const lineHeight = {
84
84
  '9xl': 'var(--line-height-9xl)',
85
85
  };
86
86
  export const colors = {
87
- background: 'var(--color-base-level-00)',
88
- text: 'var(--color-base-content-medium-emphasis)',
87
+ background: 'var(--color-level-00-background)',
88
+ text: 'var(--color-content-medium-text)',
89
+ brand: {
90
+ 50: 'var(--color-brand-50)',
91
+ 100: 'var(--color-brand-100)',
92
+ 200: 'var(--color-brand-200)',
93
+ 300: 'var(--color-brand-300)',
94
+ 400: 'var(--color-brand-400)',
95
+ 500: 'var(--color-brand-500)',
96
+ 600: 'var(--color-brand-600)',
97
+ 700: 'var(--color-brand-700)',
98
+ 800: 'var(--color-brand-800)',
99
+ 900: 'var(--color-brand-900)',
100
+ },
89
101
  green: {
90
102
  50: 'var(--color-green-50)',
91
103
  100: 'var(--color-green-100)',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nova-design-system/nova-base",
3
- "version": "3.0.0-beta.30",
3
+ "version": "3.0.0-beta.33",
4
4
  "description": "Nova is a design system created by Elia Group to empower creators to efficiently build solutions that people love to use.",
5
5
  "author": "Elia Group",
6
6
  "homepage": "https://nova.eliagroup.io",
@@ -14,9 +14,10 @@
14
14
  "generate-tokens": "tsx scripts/extract-tokens.ts && tsx scripts/generate-token-files.ts",
15
15
  "generate-css-utils": "tailwindcss -i ./lib/tailwind.css -o ./dist/css/nova-utils.css",
16
16
  "generate-tailwind-tokens": "tsx scripts/generate-tailwind-tokens.ts",
17
+ "generate-tailwind-components": "tsx scripts/generate-tailwind-components.ts",
17
18
  "build-lib": "tsc && tsc --module CommonJS --moduleResolution Node --declaration false --outDir ./dist/lib/cjs",
18
19
  "merge-css": "tsx scripts/merge-css.ts",
19
- "build": "tsx scripts/generate-tokens.ts && npm run merge-css && npm run generate-tailwind-tokens && npm run generate-css-utils && npm run build-lib",
20
+ "build": "npm run clean && tsx scripts/generate-tokens.ts && npm run generate-tailwind-components && npm run merge-css && npm run generate-tailwind-tokens && npm run generate-css-utils && npm run build-lib",
20
21
  "clean": "rimraf dist",
21
22
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.node.json --noEmit"
22
23
  },
@@ -28,6 +29,10 @@
28
29
  "style-dictionary": "4.0.0",
29
30
  "tailwindcss": "3.4.10"
30
31
  },
32
+ "devDependencies": {
33
+ "nova-utils": "*",
34
+ "sass": "1.83.4"
35
+ },
31
36
  "exports": {
32
37
  "./dist/*": "./dist/*",
33
38
  "./assets/*": "./assets/*",
File without changes
File without changes
File without changes