@speakeasy-api/moonshine 1.20.1 → 1.20.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.
- package/README.md +22 -13
- package/dist/createCustomLucideIcon-XbD-heqT.mjs +19 -0
- package/dist/{createCustomLucideIcon-D8H_xOy5.mjs.map → createCustomLucideIcon-XbD-heqT.mjs.map} +1 -1
- package/dist/{gems-R4jcxQdp.mjs → gems-TBSqj4DF.mjs} +2 -2
- package/dist/{gems-R4jcxQdp.mjs.map → gems-TBSqj4DF.mjs.map} +1 -1
- package/dist/{go-BchvLEyK.mjs → go--uba-LB-.mjs} +2 -2
- package/dist/{go-BchvLEyK.mjs.map → go--uba-LB-.mjs.map} +1 -1
- package/dist/{index-BRVoJfBI.mjs → index-DqLwaWEQ.mjs} +8038 -9579
- package/dist/index-DqLwaWEQ.mjs.map +1 -0
- package/dist/{maven-BZzM9oe9.mjs → maven-BdyALhSy.mjs} +2 -2
- package/dist/{maven-BZzM9oe9.mjs.map → maven-BdyALhSy.mjs.map} +1 -1
- package/dist/moonshine.es.js +1 -1
- package/dist/{npm-D2cA6Fuf.mjs → npm-UvfadGAl.mjs} +2 -2
- package/dist/{npm-D2cA6Fuf.mjs.map → npm-UvfadGAl.mjs.map} +1 -1
- package/dist/{nuget-BFojJe54.mjs → nuget-CAb9Y_bT.mjs} +2 -2
- package/dist/{nuget-BFojJe54.mjs.map → nuget-CAb9Y_bT.mjs.map} +1 -1
- package/dist/{packagist-C5a5lTKV.mjs → packagist-B4ZVDGbG.mjs} +2 -2
- package/dist/{packagist-C5a5lTKV.mjs.map → packagist-B4ZVDGbG.mjs.map} +1 -1
- package/dist/{pypi-a56O4qOB.mjs → pypi-DX10SEq1.mjs} +2 -2
- package/dist/{pypi-a56O4qOB.mjs.map → pypi-DX10SEq1.mjs.map} +1 -1
- package/package.json +2 -2
- package/types/utilities.d.ts +1 -1
- package/dist/createCustomLucideIcon-D8H_xOy5.mjs +0 -19
- package/dist/index-BRVoJfBI.mjs.map +0 -1
- package/dist/lucide-icons-BDw0imyx.mjs +0 -28054
- package/dist/lucide-icons-BDw0imyx.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -10,7 +10,12 @@ Speakeasy's design system.
|
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
pnpm add @speakeasy-api/moonshine
|
|
13
|
-
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Make sure you install Lucide as it is a peer dependency of this package:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
pnpm add lucide-react
|
|
14
19
|
```
|
|
15
20
|
|
|
16
21
|
### 2. Configure Tailwind CSS
|
|
@@ -41,8 +46,7 @@ Wrap your application in the `MoonshineConfigProvider` component:
|
|
|
41
46
|
|
|
42
47
|
```tsx
|
|
43
48
|
import { MoonshineConfigProvider } from '@speakeasy-api/moonshine'
|
|
44
|
-
|
|
45
|
-
<MoonshineConfigProvider themeElement={document.documentElement}>
|
|
49
|
+
;<MoonshineConfigProvider themeElement={document.documentElement}>
|
|
46
50
|
<App />
|
|
47
51
|
</MoonshineConfigProvider>
|
|
48
52
|
```
|
|
@@ -54,16 +58,16 @@ Moonshine uses custom fonts (Diatype, Tobias). If you have licenses for these fo
|
|
|
54
58
|
```css
|
|
55
59
|
/* In your global CSS */
|
|
56
60
|
@font-face {
|
|
57
|
-
font-family:
|
|
58
|
-
src: url(
|
|
61
|
+
font-family: 'Diatype';
|
|
62
|
+
src: url('/fonts/diatype/ABCDiatype-Regular.woff2') format('woff2');
|
|
59
63
|
font-weight: 400;
|
|
60
64
|
font-style: normal;
|
|
61
65
|
font-display: block;
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
@font-face {
|
|
65
|
-
font-family:
|
|
66
|
-
src: url(
|
|
69
|
+
font-family: 'Diatype';
|
|
70
|
+
src: url('/fonts/diatype/ABCDiatype-Light.woff2') format('woff2');
|
|
67
71
|
font-weight: 300;
|
|
68
72
|
font-style: normal;
|
|
69
73
|
font-display: block;
|
|
@@ -80,9 +84,7 @@ If you don't have these fonts, the design system will fall back to system fonts.
|
|
|
80
84
|
import { Grid } from '@speakeasy-api/moonshine'
|
|
81
85
|
|
|
82
86
|
// Use semantic utility classes
|
|
83
|
-
|
|
84
|
-
Hello Moonshine!
|
|
85
|
-
</div>
|
|
87
|
+
;<div className="text-heading-lg bg-surface-primary">Hello Moonshine!</div>
|
|
86
88
|
```
|
|
87
89
|
|
|
88
90
|
### TypeScript Support for Utility Classes
|
|
@@ -102,6 +104,7 @@ const styles: MoonshineClasses = 'text-heading-lg' // ✅ Autocompletes!
|
|
|
102
104
|
```
|
|
103
105
|
|
|
104
106
|
The types are automatically generated during the build process and include:
|
|
107
|
+
|
|
105
108
|
- All custom utilities (`text-heading-xl`, `bg-surface-primary`, etc.)
|
|
106
109
|
- All semantic color utilities (`bg-warning`, `text-success`, etc.)
|
|
107
110
|
- Full IntelliSense support in your IDE
|
|
@@ -124,11 +127,8 @@ return (
|
|
|
124
127
|
Lorem Ipsum
|
|
125
128
|
</span>
|
|
126
129
|
)
|
|
127
|
-
|
|
128
130
|
```
|
|
129
131
|
|
|
130
|
-
|
|
131
|
-
|
|
132
132
|
## Design System Architecture
|
|
133
133
|
|
|
134
134
|
Moonshine is a utility-first design system built on top of [Tailwind CSS v4](https://tailwindcss.com/). It provides a curated set of design tokens and utilities that enforce consistency while preventing common pitfalls.
|
|
@@ -138,11 +138,13 @@ Moonshine is a utility-first design system built on top of [Tailwind CSS v4](htt
|
|
|
138
138
|
Our CSS is organized into three main files:
|
|
139
139
|
|
|
140
140
|
1. **`base.css`** - Primitive design tokens (colors, fonts, spacing scales)
|
|
141
|
+
|
|
141
142
|
- Contains raw values that should **not** be used directly in components
|
|
142
143
|
- Defines theme-aware semantic tokens that adapt to light/dark mode
|
|
143
144
|
- Houses base element styles and resets
|
|
144
145
|
|
|
145
146
|
2. **`utilities.css`** - The public API of our design system
|
|
147
|
+
|
|
146
148
|
- Exposes carefully crafted utility classes like `text-heading-xl`, `bg-surface-primary`
|
|
147
149
|
- Enforces typography combinations to prevent arbitrary text styling
|
|
148
150
|
- Provides semantic color utilities that automatically handle theming
|
|
@@ -162,11 +164,13 @@ Our CSS is organized into three main files:
|
|
|
162
164
|
### Usage Guidelines
|
|
163
165
|
|
|
164
166
|
✅ **Do:**
|
|
167
|
+
|
|
165
168
|
- Use semantic utilities: `bg-warning`, `text-body`, `border-error`
|
|
166
169
|
- Leverage pre-defined typography scales: `text-heading-xl`, `text-body-sm`
|
|
167
170
|
- Stick to the exposed utility classes in `utilities.css`
|
|
168
171
|
|
|
169
172
|
❌ **Don't:**
|
|
173
|
+
|
|
170
174
|
- Access raw color values: `bg-[var(--color-neutral-200)]`
|
|
171
175
|
- Create arbitrary combinations: `text-[1.813rem] leading-[1.5]`
|
|
172
176
|
- Override the design system without discussing with the team
|
|
@@ -176,16 +180,21 @@ For more technical details about the CSS architecture, see [CLAUDE.md](./CLAUDE.
|
|
|
176
180
|
## Troubleshooting
|
|
177
181
|
|
|
178
182
|
### Utilities not working
|
|
183
|
+
|
|
179
184
|
Make sure you've added the `@reference` directive to your global CSS file. This is required for Tailwind v4 to pick up Moonshine's utility classes.
|
|
180
185
|
|
|
181
186
|
### Fonts not loading
|
|
187
|
+
|
|
182
188
|
The custom fonts (Diatype, Tobias) require licenses. If you don't have them, the system will use fallback fonts. Ensure your font files are in the correct path if you do have licenses.
|
|
183
189
|
|
|
184
190
|
### Dark mode not working
|
|
191
|
+
|
|
185
192
|
Ensure the `themeElement` prop in `MoonshineConfigProvider` points to the element where your `dark` class is applied (usually `document.documentElement`).
|
|
186
193
|
|
|
187
194
|
### TypeScript types not found
|
|
195
|
+
|
|
188
196
|
Make sure you're importing from the correct path:
|
|
197
|
+
|
|
189
198
|
```tsx
|
|
190
199
|
import type { MoonshineClasses } from '@speakeasy-api/moonshine/types/utilities'
|
|
191
200
|
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { c as s, t as n } from "./index-DqLwaWEQ.mjs";
|
|
2
|
+
import { Icon as p } from "lucide-react";
|
|
3
|
+
import { forwardRef as f, createElement as i } from "react";
|
|
4
|
+
const C = (e, t, r) => {
|
|
5
|
+
const o = f(
|
|
6
|
+
({ className: a, ...c }, m) => i(p, {
|
|
7
|
+
ref: m,
|
|
8
|
+
iconNode: t,
|
|
9
|
+
className: s(`lucide-${n(e)}`, a),
|
|
10
|
+
...r ?? {},
|
|
11
|
+
...c
|
|
12
|
+
})
|
|
13
|
+
);
|
|
14
|
+
return o.displayName = `${e}`, o;
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
C as c
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=createCustomLucideIcon-XbD-heqT.mjs.map
|
package/dist/{createCustomLucideIcon-D8H_xOy5.mjs.map → createCustomLucideIcon-XbD-heqT.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCustomLucideIcon-
|
|
1
|
+
{"version":3,"file":"createCustomLucideIcon-XbD-heqT.mjs","sources":["../src/components/Icon/customIcons/createCustomLucideIcon.ts"],"sourcesContent":["import { cn, toKebabCase } from '@/lib/utils'\nimport { Icon, IconNode, LucideProps } from 'lucide-react'\nimport { createElement, forwardRef } from 'react'\n\nconst createCustomLucideIcon = (\n iconName: string,\n iconNode: IconNode,\n lucideProps?: Partial<LucideProps>\n) => {\n const Component = forwardRef<SVGSVGElement, LucideProps>(\n ({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n iconNode,\n className: cn(`lucide-${toKebabCase(iconName)}`, className),\n ...{ ...(lucideProps ?? {}), ...props },\n })\n )\n\n Component.displayName = `${iconName}`\n\n return Component\n}\n\nexport default createCustomLucideIcon\n"],"names":["createCustomLucideIcon","iconName","iconNode","lucideProps","Component","forwardRef","className","props","ref","createElement","Icon","cn","toKebabCase"],"mappings":";;;AAIA,MAAMA,IAAyB,CAC7BC,GACAC,GACAC,MACG;AACH,QAAMC,IAAYC;AAAA,IAChB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAS,GAAAC,MACxBC,EAAcC,GAAM;AAAA,MAClB,KAAAF;AAAA,MACA,UAAAN;AAAA,MACA,WAAWS,EAAG,UAAUC,EAAYX,CAAQ,CAAC,IAAIK,CAAS;AAAA,MACrD,GAAIH,KAAe,CAAC;AAAA,MAAI,GAAGI;AAAA,IACjC,CAAA;AAAA,EACL;AAEU,SAAAH,EAAA,cAAc,GAAGH,CAAQ,IAE5BG;AACT;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as L } from "./createCustomLucideIcon-
|
|
1
|
+
import { c as L } from "./createCustomLucideIcon-XbD-heqT.mjs";
|
|
2
2
|
const o = [
|
|
3
3
|
[
|
|
4
4
|
"path",
|
|
@@ -21,4 +21,4 @@ const o = [
|
|
|
21
21
|
export {
|
|
22
22
|
e as default
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=gems-
|
|
24
|
+
//# sourceMappingURL=gems-TBSqj4DF.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gems-
|
|
1
|
+
{"version":3,"file":"gems-TBSqj4DF.mjs","sources":["../src/components/Icon/customIcons/gems.ts"],"sourcesContent":["import { IconNode } from 'lucide-react'\nimport createCustomLucideIcon from './createCustomLucideIcon'\n\nconst iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M156.139 157.469L196.307 117.301L168.177 89.1397V89.0126H88.2885L88.4113 89.2582L88.2885 89.1354L60.6496 117.296L128.5 184.929',\n key: 'path-1',\n },\n ],\n [\n 'path',\n {\n d: 'M128.5 14L29 71.0835V185.25L128.5 242.333L228 185.25V71.0829L128.5 14ZM208.96 174.341L128.5 220.767L48.0401 174.34V81.7386L128.5 35.3114L208.96 81.3762',\n key: 'path-2',\n },\n ],\n]\n\nconst icon = createCustomLucideIcon('gems', iconNode, {\n viewBox: '0 0 256 256',\n fill: 'currentColor',\n})\n\nexport { icon as default }\n"],"names":["iconNode","icon","createCustomLucideIcon"],"mappings":";AAGA,MAAMA,IAAqB;AAAA,EACzB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IAAA;AAAA,EAET;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IAAA;AAAA,EACP;AAEJ,GAEMC,IAAOC,EAAuB,QAAQF,GAAU;AAAA,EACpD,SAAS;AAAA,EACT,MAAM;AACR,CAAC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c } from "./createCustomLucideIcon-
|
|
1
|
+
import { c } from "./createCustomLucideIcon-XbD-heqT.mjs";
|
|
2
2
|
const o = [
|
|
3
3
|
[
|
|
4
4
|
"path",
|
|
@@ -21,4 +21,4 @@ const o = [
|
|
|
21
21
|
export {
|
|
22
22
|
e as default
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=go-
|
|
24
|
+
//# sourceMappingURL=go--uba-LB-.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"go-
|
|
1
|
+
{"version":3,"file":"go--uba-LB-.mjs","sources":["../src/components/Icon/customIcons/go.ts"],"sourcesContent":["import { IconNode } from 'lucide-react'\nimport createCustomLucideIcon from './createCustomLucideIcon'\n\nconst iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M11.156 54.829c-.243 0-.303-.122-.182-.303l1.273-1.637c.12-.182.424-.303.666-.303H34.55c.243 0 .303.182.182.364l-1.03 1.576c-.121.181-.424.363-.606.363zM2.004 60.404c-.242 0-.303-.12-.182-.303l1.273-1.636c.121-.182.424-.303.667-.303h27.636c.242 0 .364.182.303.364l-.485 1.454c-.06.243-.303.364-.545.364zM16.67 65.98c-.242 0-.302-.182-.181-.364l.848-1.515c.122-.182.364-.363.607-.363h12.12c.243 0 .364.181.364.424l-.12 1.454c0 .243-.243.425-.425.425zM79.58 53.738c-3.819.97-6.425 1.697-10.182 2.666-.91.243-.97.303-1.758-.606-.909-1.03-1.576-1.697-2.848-2.303-3.819-1.878-7.516-1.333-10.97.91-4.121 2.666-6.242 6.605-6.182 11.514.06 4.849 3.394 8.849 8.182 9.516 4.121.545 7.576-.91 10.303-4 .545-.667 1.03-1.394 1.636-2.243H56.064c-1.272 0-1.575-.788-1.151-1.818.788-1.879 2.242-5.03 3.09-6.606.183-.364.607-.97 1.516-.97h22.06c-.12 1.637-.12 3.273-.363 4.91-.667 4.363-2.303 8.363-4.97 11.878-4.364 5.758-10.06 9.333-17.273 10.303-5.939.788-11.454-.364-16.302-4-4.485-3.394-7.03-7.879-7.697-13.454-.788-6.606 1.151-12.546 5.151-17.758 4.303-5.636 10-9.212 16.97-10.485 5.697-1.03 11.151-.363 16.06 2.97 3.212 2.121 5.515 5.03 7.03 8.545.364.546.122.849-.606 1.03z',\n key: 'path-1',\n },\n ],\n [\n 'path',\n {\n d: 'M99.64 87.253c-5.515-.122-10.546-1.697-14.788-5.334-3.576-3.09-5.818-7.03-6.545-11.697-1.091-6.848.787-12.909 4.909-18.302 4.424-5.819 9.757-8.849 16.97-10.122 6.181-1.09 12-.484 17.272 3.091 4.788 3.273 7.757 7.697 8.545 13.515 1.03 8.182-1.333 14.849-6.97 20.546-4 4.06-8.909 6.606-14.545 7.757-1.636.303-3.273.364-4.848.546zm14.424-24.485c-.06-.788-.06-1.394-.182-2-1.09-6-6.606-9.394-12.363-8.06-5.637 1.272-9.273 4.848-10.606 10.545-1.091 4.727 1.212 9.515 5.575 11.454 3.334 1.455 6.667 1.273 9.879-.363 4.788-2.485 7.394-6.364 7.697-11.576z',\n key: 'path-2',\n },\n ],\n]\n\nconst icon = createCustomLucideIcon('go', iconNode, {\n viewBox: '0 0 128 128',\n fill: 'currentColor',\n})\n\nexport { icon as default }\n"],"names":["iconNode","icon","createCustomLucideIcon"],"mappings":";AAGA,MAAMA,IAAqB;AAAA,EACzB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IAAA;AAAA,EAET;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IAAA;AAAA,EACP;AAEJ,GAEMC,IAAOC,EAAuB,MAAMF,GAAU;AAAA,EAClD,SAAS;AAAA,EACT,MAAM;AACR,CAAC;"}
|