@dust-tt/sparkle 0.2.443-rc2 → 0.2.443-rc3

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.
@@ -1,8 +1,15 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
1
2
  import React from "react";
2
- declare const meta: {
3
- title: string;
4
- component: React.FC<{}>;
5
- };
3
+ interface TypographyProps {
4
+ variant: "font-size" | "heading" | "heading-mono" | "copy";
5
+ }
6
+ declare const Typography: React.FC<TypographyProps>;
7
+ declare const meta: Meta<typeof Typography>;
6
8
  export default meta;
7
- export declare const Default: () => React.JSX.Element;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
11
+ export declare const FontSize: Story;
12
+ export declare const Heading: Story;
13
+ export declare const HeadingMono: Story;
14
+ export declare const Copy: Story;
8
15
  //# sourceMappingURL=Typography.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/Typography.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiF1B,QAAA,MAAM,IAAI;;;CAGgC,CAAC;AAE3C,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,yBAAoB,CAAC"}
1
+ {"version":3,"file":"Typography.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/Typography.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,MAAM,OAAO,CAAC;AAsE1B,UAAU,eAAe;IACvB,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,cAAc,GAAG,MAAM,CAAC;CAC5D;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwJzC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAUjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAIlB,CAAC"}
@@ -9,6 +9,13 @@ var textSizes = {
9
9
  lg: "s-text-lg",
10
10
  xl: "s-text-xl",
11
11
  };
12
+ var copySizes = {
13
+ xs: "s-copy-xs",
14
+ sm: "s-copy-sm",
15
+ base: "s-copy-base",
16
+ lg: "s-copy-lg",
17
+ xl: "s-copy-xl",
18
+ };
12
19
  var extraTextSizes = {
13
20
  "2xl": "s-text-2xl",
14
21
  "3xl": "s-text-3xl",
@@ -19,47 +26,165 @@ var extraTextSizes = {
19
26
  "8xl": "s-text-8xl",
20
27
  "9xl": "s-text-9xl",
21
28
  };
29
+ var headingSizes = {
30
+ lg: "s-heading-lg",
31
+ xl: "s-heading-xl",
32
+ "2xl": "s-heading-2xl",
33
+ "3xl": "s-heading-3xl",
34
+ "4xl": "s-heading-4xl",
35
+ "5xl": "s-heading-5xl",
36
+ "6xl": "s-heading-6xl",
37
+ "7xl": "s-heading-7xl",
38
+ "8xl": "s-heading-8xl",
39
+ "9xl": "s-heading-9xl",
40
+ };
41
+ var headingMonoSizes = {
42
+ lg: "s-heading-mono-lg",
43
+ xl: "s-heading-mono-xl",
44
+ "2xl": "s-heading-mono-2xl",
45
+ "3xl": "s-heading-mono-3xl",
46
+ "4xl": "s-heading-mono-4xl",
47
+ "5xl": "s-heading-mono-5xl",
48
+ "6xl": "s-heading-mono-6xl",
49
+ "7xl": "s-heading-mono-7xl",
50
+ "8xl": "s-heading-mono-8xl",
51
+ "9xl": "s-heading-mono-9xl",
52
+ };
22
53
  var fontWeights = {
23
54
  normal: "s-font-normal",
24
55
  medium: "s-font-medium",
25
56
  semibold: "s-font-semibold",
26
57
  bold: "s-font-bold",
27
58
  };
28
- var loremIpsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
29
- // SVG Pattern as a background image
30
- var svgBackground = "\n <svg width=\"4\" height=\"8\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect width=\"4\" height=\"4\" fill=\"red\" fill-opacity=\"0.05\"/>\n </svg>\n";
31
- // Create a component to display the text styles
32
- var TextStylesDisplay = function () {
33
- return (React.createElement("div", null,
34
- React.createElement("div", { className: "s-grid s-gap-4 s-bg-repeat s-py-8", style: {
35
- backgroundImage: "url(\"data:image/svg+xml;utf8,".concat(encodeURIComponent(svgBackground), "\")"),
36
- gridTemplateColumns: "repeat(".concat(Object.keys(fontWeights).length, ", minmax(0, 1fr))"),
37
- } }, Object.entries(textSizes).map(function (_a) {
38
- var _b = __read(_a, 2), sizeKey = _b[0], sizeClass = _b[1];
39
- return Object.entries(fontWeights).map(function (_a) {
40
- var _b = __read(_a, 2), weightKey = _b[0], weightClass = _b[1];
41
- return (React.createElement("div", { key: "".concat(sizeKey, "-").concat(weightKey), className: classNames(sizeClass, weightClass) },
42
- React.createElement("div", null, "".concat(sizeKey, " ").concat(weightKey)),
59
+ var loremIpsum = "Geist. Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
60
+ var copyLoremIpsum = "Geist. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
61
+ var Typography = function (_a) {
62
+ var variant = _a.variant;
63
+ if (variant === "font-size") {
64
+ return (React.createElement("div", null,
65
+ React.createElement("div", { className: "s-grid s-gap-4 s-bg-repeat s-py-8", style: {
66
+ gridTemplateColumns: "repeat(".concat(Object.keys(fontWeights).length, ", minmax(0, 1fr))"),
67
+ } }, Object.entries(textSizes).map(function (_a) {
68
+ var _b = __read(_a, 2), sizeKey = _b[0], sizeClass = _b[1];
69
+ return Object.entries(fontWeights).map(function (_a) {
70
+ var _b = __read(_a, 2), weightKey = _b[0], weightClass = _b[1];
71
+ return (React.createElement("div", { key: "".concat(sizeKey, "-").concat(weightKey), className: classNames(sizeClass, weightClass) },
72
+ React.createElement("div", null, "".concat(sizeKey, " ").concat(weightKey)),
73
+ React.createElement("p", null, loremIpsum)));
74
+ });
75
+ })),
76
+ React.createElement("div", { className: "s-mt-6 s-grid s-gap-16 s-bg-repeat s-py-8" }, Object.entries(extraTextSizes).map(function (_a) {
77
+ var _b = __read(_a, 2), sizeKey = _b[0], sizeClass = _b[1];
78
+ return (React.createElement("div", { key: sizeKey, className: classNames(sizeClass, "s-font-medium") },
79
+ React.createElement("div", null, "".concat(sizeKey, " medium")),
43
80
  React.createElement("p", null, loremIpsum)));
44
- });
45
- })),
46
- React.createElement("div", { className: "s-mt-6 s-grid s-gap-16 s-bg-repeat s-py-8", style: {
47
- backgroundImage: "url(\"data:image/svg+xml;utf8,".concat(encodeURIComponent(svgBackground), "\")"),
48
- } }, Object.entries(extraTextSizes).map(function (_a) {
49
- var _b = __read(_a, 2), sizeKey = _b[0], sizeClass = _b[1];
50
- return (React.createElement("div", { key: sizeKey, className: classNames(sizeClass, "s-font-medium") },
51
- React.createElement("div", null, "".concat(sizeKey, " medium")),
81
+ }))));
82
+ }
83
+ if (variant === "copy") {
84
+ return (React.createElement("div", { className: "s-space-y-12 s-bg-repeat s-py-8", style: {
85
+ // backgroundImage: `url("data:image/svg+xml;utf8,${encodeURIComponent(svgBackground)}")`,
86
+ } }, Object.entries(copySizes).map(function (_a) {
87
+ var _b = __read(_a, 2), sizeKey = _b[0], copyClass = _b[1];
88
+ return (React.createElement("div", { key: sizeKey, className: "s-space-y-4" },
89
+ React.createElement("div", { className: copyClass },
90
+ React.createElement("div", null, "Copy ".concat(sizeKey)),
91
+ React.createElement("div", { className: "s-mt-2", style: {
92
+ maxWidth: sizeKey === "xs"
93
+ ? "20rem"
94
+ : sizeKey === "sm"
95
+ ? "24rem"
96
+ : sizeKey === "base"
97
+ ? "32rem"
98
+ : sizeKey === "lg"
99
+ ? "40rem"
100
+ : "48rem",
101
+ } },
102
+ React.createElement("p", null, copyLoremIpsum))),
103
+ React.createElement("div", { className: classNames(copyClass, "s-italic") },
104
+ React.createElement("div", null, "Copy ".concat(sizeKey, " Italic")),
105
+ React.createElement("div", { className: "s-mt-2", style: {
106
+ maxWidth: sizeKey === "xs"
107
+ ? "20rem"
108
+ : sizeKey === "sm"
109
+ ? "24rem"
110
+ : sizeKey === "base"
111
+ ? "32rem"
112
+ : sizeKey === "lg"
113
+ ? "40rem"
114
+ : "48rem",
115
+ } },
116
+ React.createElement("p", null, copyLoremIpsum))),
117
+ React.createElement("div", { className: classNames(copyClass, "s-font-mono") },
118
+ React.createElement("div", null, "Copy ".concat(sizeKey, " Mono")),
119
+ React.createElement("div", { className: "s-mt-2", style: {
120
+ maxWidth: sizeKey === "xs"
121
+ ? "20rem"
122
+ : sizeKey === "sm"
123
+ ? "24rem"
124
+ : sizeKey === "base"
125
+ ? "32rem"
126
+ : sizeKey === "lg"
127
+ ? "40rem"
128
+ : "48rem",
129
+ } },
130
+ React.createElement("p", null, copyLoremIpsum)))));
131
+ })));
132
+ }
133
+ if (variant === "heading-mono") {
134
+ return (React.createElement("div", { className: "s-space-y-8 s-bg-repeat s-py-8", style: {
135
+ // backgroundImage: `url("data:image/svg+xml;utf8,${encodeURIComponent(svgBackground)}")`,
136
+ } }, Object.entries(headingMonoSizes).map(function (_a) {
137
+ var _b = __read(_a, 2), sizeKey = _b[0], headingClass = _b[1];
138
+ return (React.createElement("div", { key: sizeKey, className: headingClass },
139
+ React.createElement("div", null, "Heading Mono ".concat(sizeKey)),
52
140
  React.createElement("p", null, loremIpsum)));
53
- }))));
141
+ })));
142
+ }
143
+ return (React.createElement("div", { className: "s-space-y-8 s-bg-repeat s-py-8", style: {
144
+ // backgroundImage: `url("data:image/svg+xml;utf8,${encodeURIComponent(svgBackground)}")`,
145
+ } }, Object.entries(headingSizes).map(function (_a) {
146
+ var _b = __read(_a, 2), sizeKey = _b[0], headingClass = _b[1];
147
+ return (React.createElement("div", { key: sizeKey, className: headingClass },
148
+ React.createElement("div", null, "Heading ".concat(sizeKey)),
149
+ React.createElement("p", null, loremIpsum)));
150
+ })));
54
151
  };
55
- // Storybook metadata
56
152
  var meta = {
57
153
  title: "Theme/Typography",
58
- component: TextStylesDisplay,
154
+ component: Typography,
155
+ tags: ["autodocs"],
156
+ parameters: {
157
+ layout: "padded",
158
+ },
159
+ args: {
160
+ variant: "font-size",
161
+ },
59
162
  };
60
163
  export default meta;
61
- // Define a template for the story
62
- var Template = function () { return React.createElement(TextStylesDisplay, null); };
63
- // Export the default story
64
- export var Default = Template.bind({});
164
+ // Add a Default story that matches the expected ID
165
+ export var Default = {
166
+ args: {
167
+ variant: "font-size",
168
+ },
169
+ };
170
+ export var FontSize = {
171
+ args: {
172
+ variant: "font-size",
173
+ },
174
+ };
175
+ export var Heading = {
176
+ args: {
177
+ variant: "heading",
178
+ },
179
+ };
180
+ export var HeadingMono = {
181
+ args: {
182
+ variant: "heading-mono",
183
+ },
184
+ };
185
+ export var Copy = {
186
+ args: {
187
+ variant: "copy",
188
+ },
189
+ };
65
190
  //# sourceMappingURL=Typography.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.stories.js","sourceRoot":"","sources":["../../../src/stories/Typography.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,oCAAoC;AACpC,IAAM,SAAS,GAAG;IAChB,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;IACf,EAAE,EAA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ACtC,+BAAI,UAAU,CAAK,CACf,CACP;YAR6D,CAQ7D,CAAC;QARF,CAQE,CACH,CACG;QACN,6BACE,SAAS,EAAC,2CAA2C,EACrD,KAAK,EAAE;gBACL,eAAe,EAAE,wCAAgC,kBAAkB,CAAC,aAAa,CAAC,QAAI;aACvF,IAEA,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,UAAC,EAAoB;gBAApB,KAAA,aAAoB,EAAnB,OAAO,QAAA,EAAE,SAAS,QAAA;YAAM,OAAA,CAC5D,6BAAK,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,eAAe,CAAC;gBAClE,iCAAM,UAAG,OAAO,YAAS,CAAO;gBAChC,+BAAI,UAAU,CAAK,CACf,CACP;QAL6D,CAK7D,CAAC,CACE,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,qBAAqB;AACrB,IAAM,IAAI,GAAG;IACX,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,iBAAiB;CACY,CAAC;AAE3C,eAAe,IAAI,CAAC;AAEpB,kCAAkC;AAClC,IAAM,QAAQ,GAAG,cAAM,OAAA,oBAAC,iBAAiB,OAAG,EAArB,CAAqB,CAAC;AAE7C,2BAA2B;AAC3B,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"Typography.stories.js","sourceRoot":"","sources":["../../../src/stories/Typography.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,oCAAoC;AACpC,IAAM,SAAS,GAAG;IAChB,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,aAAa;IACjB,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;CAChB,CAAC;AAEF,IAAM,SAAS,GAAG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CAAC,CAAC;AAEF,IAAM,IAAI,GAA4B;IACpC,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,QAAQ;KACjB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,WAAW;KACrB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,mDAAmD;AACnD,MAAM,CAAC,IAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE,WAAW;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,IAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,OAAO,EAAE,WAAW;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,IAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE,SAAS;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,IAAM,WAAW,GAAU;IAChC,IAAI,EAAE;QACJ,OAAO,EAAE,cAAc;KACxB;CACF,CAAC;AAEF,MAAM,CAAC,IAAM,IAAI,GAAU;IACzB,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM;KAChB;CACF,CAAC"}
package/dist/sparkle.css CHANGED
@@ -588,6 +588,191 @@ select {
588
588
  outline: 1px auto -webkit-focus-ring-color;
589
589
  }
590
590
 
591
+ .s-heading-lg {
592
+ font-size: 18px;
593
+ line-height: 28px;
594
+ letter-spacing: normal;
595
+ font-weight: 600;
596
+ }
597
+
598
+ .s-heading-xl {
599
+ font-size: 20px;
600
+ line-height: 26px;
601
+ letter-spacing: -0.4px;
602
+ font-weight: 600;
603
+ }
604
+
605
+ .s-heading-2xl {
606
+ font-size: 24px;
607
+ line-height: 32px;
608
+ letter-spacing: -0.96px;
609
+ font-weight: 600;
610
+ }
611
+
612
+ .s-heading-3xl {
613
+ font-size: 32px;
614
+ line-height: 40px;
615
+ letter-spacing: -1.28px;
616
+ font-weight: 600;
617
+ }
618
+
619
+ .s-heading-4xl {
620
+ font-size: 40px;
621
+ line-height: 48px;
622
+ letter-spacing: -2.4px;
623
+ font-weight: 500;
624
+ }
625
+
626
+ .s-heading-5xl {
627
+ font-size: 48px;
628
+ line-height: 56px;
629
+ letter-spacing: -2.88px;
630
+ font-weight: 500;
631
+ }
632
+
633
+ .s-heading-6xl {
634
+ font-size: 56px;
635
+ line-height: 56px;
636
+ letter-spacing: -3.36px;
637
+ font-weight: 500;
638
+ }
639
+
640
+ .s-heading-7xl {
641
+ font-size: 64px;
642
+ line-height: 64px;
643
+ letter-spacing: -3.84px;
644
+ font-weight: 500;
645
+ }
646
+
647
+ .s-heading-8xl {
648
+ font-size: 72px;
649
+ line-height: 72px;
650
+ letter-spacing: -4.32px;
651
+ font-weight: 500;
652
+ }
653
+
654
+ .s-heading-9xl {
655
+ font-size: 80px;
656
+ line-height: 80px;
657
+ letter-spacing: -4.8px;
658
+ font-weight: 500;
659
+ }
660
+
661
+ .s-heading-mono-lg {
662
+ font-size: 18px;
663
+ line-height: 28px;
664
+ letter-spacing: normal;
665
+ font-weight: 400;
666
+ font-family: Geist Mono, monospace;
667
+ }
668
+
669
+ .s-heading-mono-xl {
670
+ font-size: 20px;
671
+ line-height: 26px;
672
+ letter-spacing: -0.4px;
673
+ font-weight: 400;
674
+ font-family: Geist Mono, monospace;
675
+ }
676
+
677
+ .s-heading-mono-2xl {
678
+ font-size: 24px;
679
+ line-height: 32px;
680
+ letter-spacing: -0.96px;
681
+ font-weight: 400;
682
+ font-family: Geist Mono, monospace;
683
+ }
684
+
685
+ .s-heading-mono-3xl {
686
+ font-size: 32px;
687
+ line-height: 40px;
688
+ letter-spacing: -1.28px;
689
+ font-weight: 400;
690
+ font-family: Geist Mono, monospace;
691
+ }
692
+
693
+ .s-heading-mono-4xl {
694
+ font-size: 40px;
695
+ line-height: 48px;
696
+ letter-spacing: -2.4px;
697
+ font-weight: 400;
698
+ font-family: Geist Mono, monospace;
699
+ }
700
+
701
+ .s-heading-mono-5xl {
702
+ font-size: 48px;
703
+ line-height: 56px;
704
+ letter-spacing: -2.88px;
705
+ font-weight: 400;
706
+ font-family: Geist Mono, monospace;
707
+ }
708
+
709
+ .s-heading-mono-6xl {
710
+ font-size: 56px;
711
+ line-height: 56px;
712
+ letter-spacing: -3.36px;
713
+ font-weight: 400;
714
+ font-family: Geist Mono, monospace;
715
+ }
716
+
717
+ .s-heading-mono-7xl {
718
+ font-size: 64px;
719
+ line-height: 64px;
720
+ letter-spacing: -3.84px;
721
+ font-weight: 400;
722
+ font-family: Geist Mono, monospace;
723
+ }
724
+
725
+ .s-heading-mono-8xl {
726
+ font-size: 72px;
727
+ line-height: 72px;
728
+ letter-spacing: -4.32px;
729
+ font-weight: 400;
730
+ font-family: Geist Mono, monospace;
731
+ }
732
+
733
+ .s-heading-mono-9xl {
734
+ font-size: 80px;
735
+ line-height: 80px;
736
+ letter-spacing: -4.8px;
737
+ font-weight: 400;
738
+ font-family: Geist Mono, monospace;
739
+ }
740
+
741
+ .s-copy-xs {
742
+ font-size: 12px;
743
+ line-height: 16px;
744
+ letter-spacing: normal;
745
+ font-weight: 400;
746
+ }
747
+
748
+ .s-copy-sm {
749
+ font-size: 14px;
750
+ line-height: 20px;
751
+ letter-spacing: -0.28px;
752
+ font-weight: 400;
753
+ }
754
+
755
+ .s-copy-base {
756
+ font-size: 16px;
757
+ line-height: 24px;
758
+ letter-spacing: -0.32px;
759
+ font-weight: 400;
760
+ }
761
+
762
+ .s-copy-lg {
763
+ font-size: 18px;
764
+ line-height: 28px;
765
+ letter-spacing: normal;
766
+ font-weight: 400;
767
+ }
768
+
769
+ .s-copy-xl {
770
+ font-size: 20px;
771
+ line-height: 26px;
772
+ letter-spacing: -0.4px;
773
+ font-weight: 400;
774
+ }
775
+
591
776
  *, ::before, ::after {
592
777
  --tw-border-spacing-x: 0;
593
778
  --tw-border-spacing-y: 0;
@@ -1927,6 +2112,12 @@ select {
1927
2112
  margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
1928
2113
  }
1929
2114
 
2115
+ .s-space-y-12 > :not([hidden]) ~ :not([hidden]) {
2116
+ --tw-space-y-reverse: 0;
2117
+ margin-top: calc(3rem * calc(1 - var(--tw-space-y-reverse)));
2118
+ margin-bottom: calc(3rem * var(--tw-space-y-reverse));
2119
+ }
2120
+
1930
2121
  .s-space-y-2 > :not([hidden]) ~ :not([hidden]) {
1931
2122
  --tw-space-y-reverse: 0;
1932
2123
  margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
@@ -1945,6 +2136,12 @@ select {
1945
2136
  margin-bottom: calc(1rem * var(--tw-space-y-reverse));
1946
2137
  }
1947
2138
 
2139
+ .s-space-y-8 > :not([hidden]) ~ :not([hidden]) {
2140
+ --tw-space-y-reverse: 0;
2141
+ margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));
2142
+ margin-bottom: calc(2rem * var(--tw-space-y-reverse));
2143
+ }
2144
+
1948
2145
  .s-self-center {
1949
2146
  align-self: center;
1950
2147
  }
@@ -3195,15 +3392,15 @@ select {
3195
3392
  }
3196
3393
 
3197
3394
  .s-bg-muted-foreground\/40 {
3198
- background-color: rgb(123 129 141 / 0.4);
3395
+ background-color: rgb(84 93 108 / 0.4);
3199
3396
  }
3200
3397
 
3201
3398
  .s-bg-muted-foreground\/70 {
3202
- background-color: rgb(123 129 141 / 0.7);
3399
+ background-color: rgb(84 93 108 / 0.7);
3203
3400
  }
3204
3401
 
3205
3402
  .s-bg-muted-foreground\/75 {
3206
- background-color: rgb(123 129 141 / 0.75);
3403
+ background-color: rgb(84 93 108 / 0.75);
3207
3404
  }
3208
3405
 
3209
3406
  .s-bg-orange-100 {
@@ -4877,7 +5074,7 @@ select {
4877
5074
 
4878
5075
  .s-text-muted-foreground {
4879
5076
  --tw-text-opacity: 1;
4880
- color: rgb(123 129 141 / var(--tw-text-opacity));
5077
+ color: rgb(84 93 108 / var(--tw-text-opacity));
4881
5078
  }
4882
5079
 
4883
5080
  .s-text-orange-500 {
@@ -5579,12 +5776,12 @@ select {
5579
5776
 
5580
5777
  .placeholder\:s-text-muted-foreground::-moz-placeholder {
5581
5778
  --tw-text-opacity: 1;
5582
- color: rgb(123 129 141 / var(--tw-text-opacity));
5779
+ color: rgb(84 93 108 / var(--tw-text-opacity));
5583
5780
  }
5584
5781
 
5585
5782
  .placeholder\:s-text-muted-foreground::placeholder {
5586
5783
  --tw-text-opacity: 1;
5587
- color: rgb(123 129 141 / var(--tw-text-opacity));
5784
+ color: rgb(84 93 108 / var(--tw-text-opacity));
5588
5785
  }
5589
5786
 
5590
5787
  .after\:s-absolute::after {
@@ -5714,11 +5911,11 @@ select {
5714
5911
  }
5715
5912
 
5716
5913
  .hover\:s-bg-muted-foreground\/70:hover {
5717
- background-color: rgb(123 129 141 / 0.7);
5914
+ background-color: rgb(84 93 108 / 0.7);
5718
5915
  }
5719
5916
 
5720
5917
  .hover\:s-bg-muted-foreground\/80:hover {
5721
- background-color: rgb(123 129 141 / 0.8);
5918
+ background-color: rgb(84 93 108 / 0.8);
5722
5919
  }
5723
5920
 
5724
5921
  .hover\:s-bg-primary-100:hover {
@@ -5996,7 +6193,7 @@ select {
5996
6193
 
5997
6194
  .disabled\:s-text-muted-foreground:disabled {
5998
6195
  --tw-text-opacity: 1;
5999
- color: rgb(123 129 141 / var(--tw-text-opacity));
6196
+ color: rgb(84 93 108 / var(--tw-text-opacity));
6000
6197
  }
6001
6198
 
6002
6199
  .disabled\:s-text-primary-400:disabled {
@@ -6161,7 +6358,7 @@ select {
6161
6358
 
6162
6359
  .data-\[disabled\]\:s-text-muted-foreground[data-disabled] {
6163
6360
  --tw-text-opacity: 1;
6164
- color: rgb(123 129 141 / var(--tw-text-opacity));
6361
+ color: rgb(84 93 108 / var(--tw-text-opacity));
6165
6362
  }
6166
6363
 
6167
6364
  .data-\[disabled\]\:s-text-primary-400[data-disabled] {
@@ -7544,15 +7741,15 @@ select {
7544
7741
  }
7545
7742
 
7546
7743
  :is(.s-dark .dark\:s-bg-muted-foreground-night\/40) {
7547
- background-color: rgb(123 129 141 / 0.4);
7744
+ background-color: rgb(150 156 165 / 0.4);
7548
7745
  }
7549
7746
 
7550
7747
  :is(.s-dark .dark\:s-bg-muted-foreground-night\/70) {
7551
- background-color: rgb(123 129 141 / 0.7);
7748
+ background-color: rgb(150 156 165 / 0.7);
7552
7749
  }
7553
7750
 
7554
7751
  :is(.s-dark .dark\:s-bg-muted-foreground-night\/75) {
7555
- background-color: rgb(123 129 141 / 0.75);
7752
+ background-color: rgb(150 156 165 / 0.75);
7556
7753
  }
7557
7754
 
7558
7755
  :is(.s-dark .dark\:s-bg-muted-night) {
@@ -8683,7 +8880,7 @@ select {
8683
8880
 
8684
8881
  :is(.s-dark .dark\:s-text-muted-foreground-night) {
8685
8882
  --tw-text-opacity: 1;
8686
- color: rgb(123 129 141 / var(--tw-text-opacity));
8883
+ color: rgb(150 156 165 / var(--tw-text-opacity));
8687
8884
  }
8688
8885
 
8689
8886
  :is(.s-dark .dark\:s-text-muted-night) {
@@ -9036,12 +9233,12 @@ select {
9036
9233
 
9037
9234
  :is(.s-dark .dark\:placeholder\:s-text-muted-foreground-night)::-moz-placeholder {
9038
9235
  --tw-text-opacity: 1;
9039
- color: rgb(123 129 141 / var(--tw-text-opacity));
9236
+ color: rgb(150 156 165 / var(--tw-text-opacity));
9040
9237
  }
9041
9238
 
9042
9239
  :is(.s-dark .dark\:placeholder\:s-text-muted-foreground-night)::placeholder {
9043
9240
  --tw-text-opacity: 1;
9044
- color: rgb(123 129 141 / var(--tw-text-opacity));
9241
+ color: rgb(150 156 165 / var(--tw-text-opacity));
9045
9242
  }
9046
9243
 
9047
9244
  :is(.s-dark .dark\:after\:s-bg-foreground-night)::after {
@@ -9071,11 +9268,11 @@ select {
9071
9268
  }
9072
9269
 
9073
9270
  :is(.s-dark .dark\:hover\:s-bg-muted-foreground-night\/70:hover) {
9074
- background-color: rgb(123 129 141 / 0.7);
9271
+ background-color: rgb(150 156 165 / 0.7);
9075
9272
  }
9076
9273
 
9077
9274
  :is(.s-dark .dark\:hover\:s-bg-muted-foreground-night\/80:hover) {
9078
- background-color: rgb(123 129 141 / 0.8);
9275
+ background-color: rgb(150 156 165 / 0.8);
9079
9276
  }
9080
9277
 
9081
9278
  :is(.s-dark .dark\:hover\:s-bg-muted-night:hover) {
@@ -9288,7 +9485,7 @@ select {
9288
9485
 
9289
9486
  :is(.s-dark .dark\:disabled\:s-text-muted-foreground-night:disabled) {
9290
9487
  --tw-text-opacity: 1;
9291
- color: rgb(123 129 141 / var(--tw-text-opacity));
9488
+ color: rgb(150 156 165 / var(--tw-text-opacity));
9292
9489
  }
9293
9490
 
9294
9491
  :is(.s-dark .dark\:disabled\:s-text-primary-400-night:disabled) {
@@ -9326,7 +9523,7 @@ select {
9326
9523
 
9327
9524
  :is(.s-dark .dark\:data-\[disabled\]\:s-text-muted-foreground-night[data-disabled]) {
9328
9525
  --tw-text-opacity: 1;
9329
- color: rgb(123 129 141 / var(--tw-text-opacity));
9526
+ color: rgb(150 156 165 / var(--tw-text-opacity));
9330
9527
  }
9331
9528
 
9332
9529
  :is(.s-dark .dark\:data-\[disabled\]\:s-text-primary-400-night[data-disabled]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dust-tt/sparkle",
3
- "version": "0.2.443-rc2",
3
+ "version": "0.2.443-rc3",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs",
6
6
  "tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css",
@@ -1,5 +1,5 @@
1
1
  // TextStyles.stories.tsx
2
- import { Meta } from "@storybook/react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
3
  import React from "react";
4
4
 
5
5
  import { classNames } from "@sparkle/lib/utils";
@@ -13,6 +13,14 @@ const textSizes = {
13
13
  xl: "s-text-xl",
14
14
  };
15
15
 
16
+ const copySizes = {
17
+ xs: "s-copy-xs",
18
+ sm: "s-copy-sm",
19
+ base: "s-copy-base",
20
+ lg: "s-copy-lg",
21
+ xl: "s-copy-xl",
22
+ };
23
+
16
24
  const extraTextSizes = {
17
25
  "2xl": "s-text-2xl",
18
26
  "3xl": "s-text-3xl",
@@ -24,6 +32,32 @@ const extraTextSizes = {
24
32
  "9xl": "s-text-9xl",
25
33
  };
26
34
 
35
+ const headingSizes = {
36
+ lg: "s-heading-lg",
37
+ xl: "s-heading-xl",
38
+ "2xl": "s-heading-2xl",
39
+ "3xl": "s-heading-3xl",
40
+ "4xl": "s-heading-4xl",
41
+ "5xl": "s-heading-5xl",
42
+ "6xl": "s-heading-6xl",
43
+ "7xl": "s-heading-7xl",
44
+ "8xl": "s-heading-8xl",
45
+ "9xl": "s-heading-9xl",
46
+ };
47
+
48
+ const headingMonoSizes = {
49
+ lg: "s-heading-mono-lg",
50
+ xl: "s-heading-mono-xl",
51
+ "2xl": "s-heading-mono-2xl",
52
+ "3xl": "s-heading-mono-3xl",
53
+ "4xl": "s-heading-mono-4xl",
54
+ "5xl": "s-heading-mono-5xl",
55
+ "6xl": "s-heading-mono-6xl",
56
+ "7xl": "s-heading-mono-7xl",
57
+ "8xl": "s-heading-mono-8xl",
58
+ "9xl": "s-heading-mono-9xl",
59
+ };
60
+
27
61
  const fontWeights = {
28
62
  normal: "s-font-normal",
29
63
  medium: "s-font-medium",
@@ -31,65 +65,211 @@ const fontWeights = {
31
65
  bold: "s-font-bold",
32
66
  };
33
67
 
34
- const loremIpsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
68
+ const loremIpsum =
69
+ "Geist. Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
35
70
 
36
- // SVG Pattern as a background image
37
- const svgBackground = `
38
- <svg width="4" height="8" xmlns="http://www.w3.org/2000/svg">
39
- <rect width="4" height="4" fill="red" fill-opacity="0.05"/>
40
- </svg>
41
- `;
71
+ const copyLoremIpsum = `Geist. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`;
42
72
 
43
- // Create a component to display the text styles
44
- const TextStylesDisplay: React.FC = () => {
45
- return (
46
- <div>
47
- <div
48
- className="s-grid s-gap-4 s-bg-repeat s-py-8"
49
- style={{
50
- backgroundImage: `url("data:image/svg+xml;utf8,${encodeURIComponent(svgBackground)}")`,
51
- gridTemplateColumns: `repeat(${Object.keys(fontWeights).length}, minmax(0, 1fr))`,
52
- }}
53
- >
54
- {Object.entries(textSizes).map(([sizeKey, sizeClass]) =>
55
- Object.entries(fontWeights).map(([weightKey, weightClass]) => (
73
+ interface TypographyProps {
74
+ variant: "font-size" | "heading" | "heading-mono" | "copy";
75
+ }
76
+
77
+ const Typography: React.FC<TypographyProps> = ({ variant }) => {
78
+ if (variant === "font-size") {
79
+ return (
80
+ <div>
81
+ <div
82
+ className="s-grid s-gap-4 s-bg-repeat s-py-8"
83
+ style={{
84
+ gridTemplateColumns: `repeat(${Object.keys(fontWeights).length}, minmax(0, 1fr))`,
85
+ }}
86
+ >
87
+ {Object.entries(textSizes).map(([sizeKey, sizeClass]) =>
88
+ Object.entries(fontWeights).map(([weightKey, weightClass]) => (
89
+ <div
90
+ key={`${sizeKey}-${weightKey}`}
91
+ className={classNames(sizeClass, weightClass)}
92
+ >
93
+ <div>{`${sizeKey} ${weightKey}`}</div>
94
+ <p>{loremIpsum}</p>
95
+ </div>
96
+ ))
97
+ )}
98
+ </div>
99
+ <div className="s-mt-6 s-grid s-gap-16 s-bg-repeat s-py-8">
100
+ {Object.entries(extraTextSizes).map(([sizeKey, sizeClass]) => (
56
101
  <div
57
- key={`${sizeKey}-${weightKey}`}
58
- className={classNames(sizeClass, weightClass)}
102
+ key={sizeKey}
103
+ className={classNames(sizeClass, "s-font-medium")}
59
104
  >
60
- <div>{`${sizeKey} ${weightKey}`}</div>
105
+ <div>{`${sizeKey} medium`}</div>
61
106
  <p>{loremIpsum}</p>
62
107
  </div>
63
- ))
64
- )}
108
+ ))}
109
+ </div>
65
110
  </div>
111
+ );
112
+ }
113
+
114
+ if (variant === "copy") {
115
+ return (
66
116
  <div
67
- className="s-mt-6 s-grid s-gap-16 s-bg-repeat s-py-8"
68
- style={{
69
- backgroundImage: `url("data:image/svg+xml;utf8,${encodeURIComponent(svgBackground)}")`,
70
- }}
117
+ className="s-space-y-12 s-bg-repeat s-py-8"
118
+ style={
119
+ {
120
+ // backgroundImage: `url("data:image/svg+xml;utf8,${encodeURIComponent(svgBackground)}")`,
121
+ }
122
+ }
71
123
  >
72
- {Object.entries(extraTextSizes).map(([sizeKey, sizeClass]) => (
73
- <div key={sizeKey} className={classNames(sizeClass, "s-font-medium")}>
74
- <div>{`${sizeKey} medium`}</div>
124
+ {Object.entries(copySizes).map(([sizeKey, copyClass]) => (
125
+ <div key={sizeKey} className="s-space-y-4">
126
+ <div className={copyClass}>
127
+ <div>{`Copy ${sizeKey}`}</div>
128
+ <div
129
+ className="s-mt-2"
130
+ style={{
131
+ maxWidth:
132
+ sizeKey === "xs"
133
+ ? "20rem"
134
+ : sizeKey === "sm"
135
+ ? "24rem"
136
+ : sizeKey === "base"
137
+ ? "32rem"
138
+ : sizeKey === "lg"
139
+ ? "40rem"
140
+ : "48rem",
141
+ }}
142
+ >
143
+ <p>{copyLoremIpsum}</p>
144
+ </div>
145
+ </div>
146
+ <div className={classNames(copyClass, "s-italic")}>
147
+ <div>{`Copy ${sizeKey} Italic`}</div>
148
+ <div
149
+ className="s-mt-2"
150
+ style={{
151
+ maxWidth:
152
+ sizeKey === "xs"
153
+ ? "20rem"
154
+ : sizeKey === "sm"
155
+ ? "24rem"
156
+ : sizeKey === "base"
157
+ ? "32rem"
158
+ : sizeKey === "lg"
159
+ ? "40rem"
160
+ : "48rem",
161
+ }}
162
+ >
163
+ <p>{copyLoremIpsum}</p>
164
+ </div>
165
+ </div>
166
+ <div className={classNames(copyClass, "s-font-mono")}>
167
+ <div>{`Copy ${sizeKey} Mono`}</div>
168
+ <div
169
+ className="s-mt-2"
170
+ style={{
171
+ maxWidth:
172
+ sizeKey === "xs"
173
+ ? "20rem"
174
+ : sizeKey === "sm"
175
+ ? "24rem"
176
+ : sizeKey === "base"
177
+ ? "32rem"
178
+ : sizeKey === "lg"
179
+ ? "40rem"
180
+ : "48rem",
181
+ }}
182
+ >
183
+ <p>{copyLoremIpsum}</p>
184
+ </div>
185
+ </div>
186
+ </div>
187
+ ))}
188
+ </div>
189
+ );
190
+ }
191
+
192
+ if (variant === "heading-mono") {
193
+ return (
194
+ <div
195
+ className="s-space-y-8 s-bg-repeat s-py-8"
196
+ style={
197
+ {
198
+ // backgroundImage: `url("data:image/svg+xml;utf8,${encodeURIComponent(svgBackground)}")`,
199
+ }
200
+ }
201
+ >
202
+ {Object.entries(headingMonoSizes).map(([sizeKey, headingClass]) => (
203
+ <div key={sizeKey} className={headingClass}>
204
+ <div>{`Heading Mono ${sizeKey}`}</div>
75
205
  <p>{loremIpsum}</p>
76
206
  </div>
77
207
  ))}
78
208
  </div>
209
+ );
210
+ }
211
+
212
+ return (
213
+ <div
214
+ className="s-space-y-8 s-bg-repeat s-py-8"
215
+ style={
216
+ {
217
+ // backgroundImage: `url("data:image/svg+xml;utf8,${encodeURIComponent(svgBackground)}")`,
218
+ }
219
+ }
220
+ >
221
+ {Object.entries(headingSizes).map(([sizeKey, headingClass]) => (
222
+ <div key={sizeKey} className={headingClass}>
223
+ <div>{`Heading ${sizeKey}`}</div>
224
+ <p>{loremIpsum}</p>
225
+ </div>
226
+ ))}
79
227
  </div>
80
228
  );
81
229
  };
82
230
 
83
- // Storybook metadata
84
- const meta = {
231
+ const meta: Meta<typeof Typography> = {
85
232
  title: "Theme/Typography",
86
- component: TextStylesDisplay,
87
- } satisfies Meta<typeof TextStylesDisplay>;
233
+ component: Typography,
234
+ tags: ["autodocs"],
235
+ parameters: {
236
+ layout: "padded",
237
+ },
238
+ args: {
239
+ variant: "font-size",
240
+ },
241
+ };
88
242
 
89
243
  export default meta;
244
+ type Story = StoryObj<typeof meta>;
90
245
 
91
- // Define a template for the story
92
- const Template = () => <TextStylesDisplay />;
246
+ // Add a Default story that matches the expected ID
247
+ export const Default: Story = {
248
+ args: {
249
+ variant: "font-size",
250
+ },
251
+ };
93
252
 
94
- // Export the default story
95
- export const Default = Template.bind({});
253
+ export const FontSize: Story = {
254
+ args: {
255
+ variant: "font-size",
256
+ },
257
+ };
258
+
259
+ export const Heading: Story = {
260
+ args: {
261
+ variant: "heading",
262
+ },
263
+ };
264
+
265
+ export const HeadingMono: Story = {
266
+ args: {
267
+ variant: "heading-mono",
268
+ },
269
+ };
270
+
271
+ export const Copy: Story = {
272
+ args: {
273
+ variant: "copy",
274
+ },
275
+ };