@neo-design/foundations 1.0.0-rc.4

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 (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -0
  3. package/css/alert.css +133 -0
  4. package/css/aspect-ratio.css +32 -0
  5. package/css/badge.css +57 -0
  6. package/css/banner.css +220 -0
  7. package/css/button-icon.css +14 -0
  8. package/css/button.css +174 -0
  9. package/css/checkbox.css +124 -0
  10. package/css/chips-group.css +26 -0
  11. package/css/chips.css +88 -0
  12. package/css/combobox.css +229 -0
  13. package/css/empty-state.css +149 -0
  14. package/css/index.css +36 -0
  15. package/css/link.css +39 -0
  16. package/css/menu.css +112 -0
  17. package/css/modal-dialog.css +204 -0
  18. package/css/modal-fullscreen.css +145 -0
  19. package/css/radio-button.css +132 -0
  20. package/css/select.css +181 -0
  21. package/css/snackbar.css +85 -0
  22. package/css/spinner.css +21 -0
  23. package/css/tabs.css +126 -0
  24. package/css/tag.css +38 -0
  25. package/css/text-field.css +224 -0
  26. package/css/toggle.css +53 -0
  27. package/css/tooltip.css +32 -0
  28. package/icon-aliases.mjs +57 -0
  29. package/icons/README.md +84 -0
  30. package/icons/icons.css +16 -0
  31. package/icons/index.json +843 -0
  32. package/icons/sprite.mjs +2 -0
  33. package/package.json +44 -0
  34. package/tokens/_brand.mjs +3 -0
  35. package/tokens/_primitives.mjs +44 -0
  36. package/tokens/_util.mjs +12 -0
  37. package/tokens/api-js.mjs +11 -0
  38. package/tokens/breakpoints.mjs +8 -0
  39. package/tokens/color-semantic.mjs +47 -0
  40. package/tokens/color.mjs +58 -0
  41. package/tokens/component-tokens.mjs +24 -0
  42. package/tokens/container.mjs +8 -0
  43. package/tokens/iconSize.mjs +18 -0
  44. package/tokens/neo-color.css +97 -0
  45. package/tokens/neo-foundations.css +250 -0
  46. package/tokens/radius.mjs +18 -0
  47. package/tokens/shadows.mjs +14 -0
  48. package/tokens/spacing.mjs +21 -0
  49. package/tokens/stroke.mjs +15 -0
  50. package/tokens/typography.mjs +59 -0
@@ -0,0 +1,18 @@
1
+ // packages/foundations/tokens/radius.mjs — emitted without comments. The reasoning behind each decision lives in Neo's source repository.
2
+ import { radius as P } from './_primitives.mjs';
3
+ import { dualPxVars } from './_util.mjs';
4
+
5
+ export const radius = {
6
+ none: P[0],
7
+ xs: P[50],
8
+ sm: P[100],
9
+ md: P[150],
10
+ lg: P[200],
11
+ xl: P[300],
12
+ '2xl': P[400],
13
+ pill: P.full,
14
+ };
15
+
16
+ export const themeSlice = { shape: { borderRadius: radius.sm }, neo: { radius } };
17
+
18
+ export const cssVars = dualPxVars('radius', radius);
@@ -0,0 +1,14 @@
1
+ // packages/foundations/tokens/shadows.mjs — emitted without comments. The reasoning behind each decision lives in Neo's source repository.
2
+ import { shadow as P } from './_primitives.mjs';
3
+ import { P as PFX } from './_brand.mjs';
4
+
5
+ export const elevation = { none: P[0], sm: P[1], md: P[2], lg: P[3], 'top-md': P[4] };
6
+
7
+ const fill = (n, v) => Array(n).fill(v);
8
+ export const shadows = ['none', ...fill(4, P[1]), ...fill(8, P[2]), ...fill(12, P[3])];
9
+
10
+ export const themeSlice = { shadows, neo: { elevation } };
11
+
12
+ export const cssVars = Object.fromEntries(
13
+ Object.entries(elevation).map(([k, v]) => [`--${PFX}-elevation-${k}`, v]),
14
+ );
@@ -0,0 +1,21 @@
1
+ // packages/foundations/tokens/spacing.mjs — emitted without comments. The reasoning behind each decision lives in Neo's source repository.
2
+ import { space as P } from './_primitives.mjs';
3
+ import { dualPxVars } from './_util.mjs';
4
+
5
+ export const space = {
6
+ none: P.none,
7
+ xs: P[50],
8
+ sm: P[100],
9
+ md: P[150],
10
+ lg: P[200],
11
+ xl: P[300],
12
+ '2xl': P[400],
13
+ '3xl': P[600],
14
+ '4xl': P[800],
15
+ '5xl': P[900],
16
+ '6xl': P[1000],
17
+ };
18
+
19
+ export const themeSlice = { spacing: 8, neo: { space } };
20
+
21
+ export const cssVars = dualPxVars('space', space);
@@ -0,0 +1,15 @@
1
+ // packages/foundations/tokens/stroke.mjs — emitted without comments. The reasoning behind each decision lives in Neo's source repository.
2
+ import { stroke as P } from './_primitives.mjs';
3
+ import { dualPxVars } from './_util.mjs';
4
+
5
+ export const stroke = {
6
+ none: P[0],
7
+ xs: P[25],
8
+ sm: P[50],
9
+ md: P[75],
10
+ 'focus-ring-width': P[50],
11
+ };
12
+
13
+ export const themeSlice = { neo: { stroke } };
14
+
15
+ export const cssVars = dualPxVars('stroke', stroke);
@@ -0,0 +1,59 @@
1
+ // packages/foundations/tokens/typography.mjs — emitted without comments. The reasoning behind each decision lives in Neo's source repository.
2
+ import { type as T } from './_primitives.mjs';
3
+ import { rem } from './_util.mjs';
4
+ import { P } from './_brand.mjs';
5
+
6
+ const V = [
7
+ ['displayXlBold', 'display-xl-bold', 64, 700, 72],
8
+ ['headlineLgBold', 'headline-lg-bold', 48, 700, 64],
9
+ ['headlineMdBold', 'headline-md-bold', 40, 700, 48],
10
+ ['headlineSmBold', 'headline-sm-bold', 32, 700, 40],
11
+ ['titleLgBold', 'title-lg-bold', 24, 700, 32],
12
+ ['titleLgMedium', 'title-lg-medium', 24, 500, 32],
13
+ ['titleMdBold', 'title-md-bold', 20, 700, 28],
14
+ ['titleMdMedium', 'title-md-medium', 20, 500, 28],
15
+ ['titleSmBold', 'title-sm-bold', 18, 700, 26],
16
+ ['titleSmMedium', 'title-sm-medium', 18, 500, 26],
17
+ ['titleXsBold', 'title-xs-bold', 14, 700, 20],
18
+ ['bodyXlBold', 'body-xl-bold', 20, 700, 28],
19
+ ['bodyXlMedium', 'body-xl-medium', 20, 500, 28],
20
+ ['bodyXlRegular', 'body-xl-regular', 20, 400, 28],
21
+ ['bodyLgBold', 'body-lg-bold', 16, 700, 24],
22
+ ['bodyLgMedium', 'body-lg-medium', 16, 500, 24],
23
+ ['bodyLgRegular', 'body-lg-regular', 16, 400, 24],
24
+ ['bodyMdBold', 'body-md-bold', 14, 700, 20],
25
+ ['bodyMdMedium', 'body-md-medium', 14, 500, 20],
26
+ ['bodyMdRegular', 'body-md-regular', 14, 400, 20],
27
+ ['captionSmMedium', 'caption-sm-medium', 12, 500, 16],
28
+ ['captionSmRegular','caption-sm-regular',12, 400, 16],
29
+ ];
30
+ export const _V = V;
31
+
32
+ const variant = (s, w, l) => ({ fontFamily: T.family, fontWeight: w, fontSize: rem(s), lineHeight: rem(l), letterSpacing: 0 });
33
+
34
+ export const variants = Object.fromEntries(V.map(([name, , s, w, l]) => [name, variant(s, w, l)]));
35
+
36
+ const std = {
37
+ h1: variant(64, 700, 72), h2: variant(48, 700, 64), h3: variant(40, 700, 48), h4: variant(32, 700, 40),
38
+ h5: variant(24, 500, 32), h6: variant(20, 500, 28),
39
+ subtitle1: variant(18, 500, 26), subtitle2: variant(14, 500, 20),
40
+ body1: variant(16, 400, 24), body2: variant(14, 400, 20),
41
+ button: { ...variant(14, 500, 20), textTransform: 'none' },
42
+ caption: variant(12, 400, 16),
43
+ overline: { ...variant(12, 500, 16), textTransform: 'uppercase' },
44
+ };
45
+
46
+ export const typography = { fontFamily: T.family, ...std, ...variants };
47
+
48
+ export const byFigmaName = Object.fromEntries(V.map(([camel, kebab]) => [kebab, variants[camel]]));
49
+
50
+ export const themeSlice = { typography, neo: { type: byFigmaName } };
51
+
52
+ export const cssVars = Object.fromEntries(V.flatMap(([, d, s, w, l]) => [
53
+ [`--${P}-type-${d}-size`, `${s}px`],
54
+ [`--${P}-type-${d}-size-rem`, rem(s)],
55
+ [`--${P}-type-${d}-weight`, `${w}`],
56
+ [`--${P}-type-${d}-line-height`, `${l}px`],
57
+ [`--${P}-type-${d}-line-height-rem`, rem(l)],
58
+ [`--${P}-type-${d}-letter-spacing`, `0`],
59
+ ]));