@discourser/design-system 0.22.0 → 0.22.2

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 (33) hide show
  1. package/dist/{chunk-VJN7TIGL.js → chunk-GLPWI7OF.js} +3 -3
  2. package/dist/chunk-GLPWI7OF.js.map +1 -0
  3. package/dist/{chunk-IGCGVSG4.cjs → chunk-NN4YW27E.cjs} +3 -3
  4. package/dist/chunk-NN4YW27E.cjs.map +1 -0
  5. package/dist/figma-codex.json +2 -2
  6. package/dist/index.cjs +4 -4
  7. package/dist/index.js +1 -1
  8. package/dist/languages/transform.d.ts +1 -1
  9. package/dist/preset/index.cjs +2 -2
  10. package/dist/preset/index.js +1 -1
  11. package/dist/stories/foundations/components/ColorSwatch.d.ts +1 -15
  12. package/dist/stories/foundations/components/ColorSwatch.d.ts.map +1 -1
  13. package/dist/stories/foundations/components/ElevationCard.d.ts +3 -6
  14. package/dist/stories/foundations/components/ElevationCard.d.ts.map +1 -1
  15. package/dist/stories/foundations/components/SpacingBox.d.ts.map +1 -1
  16. package/dist/stories/foundations/components/TypeSpecimen.d.ts +2 -1
  17. package/dist/stories/foundations/components/TypeSpecimen.d.ts.map +1 -1
  18. package/package.json +4 -3
  19. package/src/languages/transform.ts +1 -1
  20. package/src/stories/foundations/Borders.stories.tsx +138 -0
  21. package/src/stories/foundations/ColorScale.stories.tsx +737 -0
  22. package/src/stories/foundations/Colors.mdx +2 -131
  23. package/src/stories/foundations/Elevation.mdx +26 -45
  24. package/src/stories/foundations/Motion.stories.tsx +306 -0
  25. package/src/stories/foundations/Shape.stories.tsx +159 -0
  26. package/src/stories/foundations/Spacing.mdx +24 -25
  27. package/src/stories/foundations/Typography.mdx +93 -79
  28. package/src/stories/foundations/components/ColorSwatch.tsx +72 -109
  29. package/src/stories/foundations/components/ElevationCard.tsx +19 -22
  30. package/src/stories/foundations/components/SpacingBox.tsx +15 -2
  31. package/src/stories/foundations/components/TypeSpecimen.tsx +20 -21
  32. package/dist/chunk-IGCGVSG4.cjs.map +0 -1
  33. package/dist/chunk-VJN7TIGL.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import { type CSSProperties } from 'react';
2
2
 
3
3
  interface TypeSpecimenProps {
4
+ styleName: string;
4
5
  name: string;
5
6
  fontSize: string;
6
7
  lineHeight: string;
@@ -11,6 +12,7 @@ interface TypeSpecimenProps {
11
12
  }
12
13
 
13
14
  export const TypeSpecimen = ({
15
+ styleName: _styleName,
14
16
  name,
15
17
  fontSize,
16
18
  lineHeight,
@@ -39,16 +41,6 @@ export const TypeSpecimen = ({
39
41
  color: '#333',
40
42
  };
41
43
 
42
- const specimenStyle: CSSProperties = {
43
- fontSize,
44
- lineHeight,
45
- fontWeight,
46
- letterSpacing,
47
- fontFamily: getFontFamilyString(fontFamily),
48
- marginBottom: '16px',
49
- color: '#000',
50
- };
51
-
52
44
  const propertiesStyle: CSSProperties = {
53
45
  display: 'grid',
54
46
  gridTemplateColumns: 'repeat(auto-fit, minmax(150px, 1fr))',
@@ -79,7 +71,24 @@ export const TypeSpecimen = ({
79
71
  <div style={headerStyle}>
80
72
  <div style={nameStyle}>{name}</div>
81
73
  </div>
82
- <div style={specimenStyle}>{sampleText}</div>
74
+ <div
75
+ style={{
76
+ color: '#000',
77
+ marginBottom: '16px',
78
+ fontFamily:
79
+ fontFamily === 'display'
80
+ ? 'var(--fonts-display)'
81
+ : fontFamily === 'mono'
82
+ ? 'var(--fonts-mono)'
83
+ : 'var(--fonts-body)',
84
+ fontSize,
85
+ lineHeight,
86
+ fontWeight,
87
+ letterSpacing,
88
+ }}
89
+ >
90
+ {sampleText}
91
+ </div>
83
92
  <div style={propertiesStyle}>
84
93
  <div style={propertyStyle}>
85
94
  <div style={propertyLabelStyle}>Font Size</div>
@@ -105,13 +114,3 @@ export const TypeSpecimen = ({
105
114
  </div>
106
115
  );
107
116
  };
108
-
109
- function getFontFamilyString(family: string): string {
110
- const fontFamilies = {
111
- display: '"Fraunces", Georgia, "Times New Roman", serif',
112
- body: '"Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
113
- mono: '"JetBrains Mono", "Fira Code", Consolas, monospace',
114
- };
115
-
116
- return fontFamilies[family as keyof typeof fontFamilies] || family;
117
- }