@sanity/sanity-id 0.1.1 → 0.2.0

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 CHANGED
@@ -19,16 +19,16 @@ Create or update your `tailwind.config.ts` file:
19
19
  import { createConfig } from "@sanity/sanity-id"
20
20
 
21
21
  export default createConfig({
22
- content: [
23
- // Add your content paths here
24
- "./src/**/*.{js,ts,jsx,tsx}",
25
- ],
26
- // Optional: extend or override the base configuration
27
- theme: {
28
- extend: {
29
- // Your custom theme extensions
30
- },
31
- },
22
+ content: [
23
+ // Add your content paths here
24
+ "./src/**/*.{js,ts,jsx,tsx}",
25
+ ],
26
+ // Optional: extend or override the base configuration
27
+ theme: {
28
+ extend: {
29
+ // Your custom theme extensions
30
+ },
31
+ },
32
32
  })
33
33
  ```
34
34
 
@@ -38,13 +38,13 @@ For proper TypeScript resolution, add the following to your `tsconfig.json`:
38
38
 
39
39
  ```json
40
40
  {
41
- "compilerOptions": {
42
- "baseUrl": ".",
43
- "paths": {
44
- "@sanity/sanity-id": ["../../packages/sanity-id/src"],
45
- "@sanity/sanity-id/*": ["../../packages/sanity-id/src/*"]
46
- }
47
- }
41
+ "compilerOptions": {
42
+ "baseUrl": ".",
43
+ "paths": {
44
+ "@sanity/sanity-id": ["../../packages/sanity-id/src"],
45
+ "@sanity/sanity-id/*": ["../../packages/sanity-id/src/*"]
46
+ }
47
+ }
48
48
  }
49
49
  ```
50
50
 
@@ -57,47 +57,47 @@ up using Next.js Font:
57
57
  import Local from "next/font/local"
58
58
 
59
59
  const inter = Local({
60
- display: "swap",
61
- variable: "--font-sans",
62
- fallback: ["ui-sans-serif", "system-ui", "sans-serif"],
63
- src: [
64
- {
65
- path: "../assets/fonts/inter-variable.woff2",
66
- weight: "100 900",
67
- },
68
- {
69
- path: "../assets/fonts/inter-italic-variable.woff2",
70
- style: "italic",
71
- weight: "100 900",
72
- },
73
- ],
60
+ display: "swap",
61
+ variable: "--font-sans",
62
+ fallback: ["ui-sans-serif", "system-ui", "sans-serif"],
63
+ src: [
64
+ {
65
+ path: "../assets/fonts/inter-variable.woff2",
66
+ weight: "100 900",
67
+ },
68
+ {
69
+ path: "../assets/fonts/inter-italic-variable.woff2",
70
+ style: "italic",
71
+ weight: "100 900",
72
+ },
73
+ ],
74
74
  })
75
75
 
76
76
  const jetBrainsMono = Local({
77
- src: "../assets/fonts/jetbrains-mono-variable.woff2",
78
- display: "swap",
79
- variable: "--font-mono",
80
- fallback: ["ui-monospace", "monospace"],
81
- weight: "100 900",
77
+ src: "../assets/fonts/jetbrains-mono-variable.woff2",
78
+ display: "swap",
79
+ variable: "--font-mono",
80
+ fallback: ["ui-monospace", "monospace"],
81
+ weight: "100 900",
82
82
  })
83
83
 
84
84
  export const fontsClassName = [
85
- inter.variable,
86
- interItalic.variable,
87
- jetBrainsMono.variable,
85
+ inter.variable,
86
+ interItalic.variable,
87
+ jetBrainsMono.variable,
88
88
  ].join(" ")
89
89
 
90
90
  // Apply fonts to your app
91
91
  export default function RootLayout({
92
- children,
92
+ children,
93
93
  }: {
94
- children: React.ReactNode
94
+ children: React.ReactNode
95
95
  }) {
96
- return (
97
- <html className={fontsClassName}>
98
- <body>{children}</body>
99
- </html>
100
- )
96
+ return (
97
+ <html className={fontsClassName}>
98
+ <body>{children}</body>
99
+ </html>
100
+ )
101
101
  }
102
102
  ```
103
103
 
@@ -124,13 +124,13 @@ import { Card } from "@sanity/sanity-id/components/card"
124
124
  import { Dialog } from "@sanity/sanity-id/components/dialog"
125
125
 
126
126
  function MyComponent() {
127
- return (
128
- <Card>
129
- <Dialog>
130
- <Button>Click me</Button>
131
- </Dialog>
132
- </Card>
133
- )
127
+ return (
128
+ <Card>
129
+ <Dialog>
130
+ <Button>Click me</Button>
131
+ </Dialog>
132
+ </Card>
133
+ )
134
134
  }
135
135
  ```
136
136
 
@@ -141,8 +141,8 @@ The package supports light and dark themes through HTML data attributes:
141
141
  ```html
142
142
  <!-- Light theme (default) -->
143
143
  <html data-theme="light">
144
- <!-- Dark theme -->
145
- <html data-theme="dark"></html>
144
+ <!-- Dark theme -->
145
+ <html data-theme="dark"></html>
146
146
  </html>
147
147
  ```
148
148
 
@@ -155,17 +155,17 @@ use next-themes:
155
155
  import { ThemeProvider } from "next-themes"
156
156
 
157
157
  export default function RootLayout({
158
- children,
158
+ children,
159
159
  }: {
160
- children: React.ReactNode
160
+ children: React.ReactNode
161
161
  }) {
162
- return (
163
- <html>
164
- <ThemeProvider attribute="data-theme">
165
- <body>{children}</body>
166
- </ThemeProvider>
167
- </html>
168
- )
162
+ return (
163
+ <html>
164
+ <ThemeProvider attribute="data-theme">
165
+ <body>{children}</body>
166
+ </ThemeProvider>
167
+ </html>
168
+ )
169
169
  }
170
170
  ```
171
171
 
@@ -173,15 +173,15 @@ Alternatively, you can hardcode the theme in your layout:
173
173
 
174
174
  ```tsx
175
175
  export default function RootLayout({
176
- children,
176
+ children,
177
177
  }: {
178
- children: React.ReactNode
178
+ children: React.ReactNode
179
179
  }) {
180
- return (
181
- <html data-theme="light">
182
- <body>{children}</body>
183
- </html>
184
- )
180
+ return (
181
+ <html data-theme="light">
182
+ <body>{children}</body>
183
+ </html>
184
+ )
185
185
  }
186
186
  ```
187
187
 
@@ -190,8 +190,8 @@ The package supports light and dark themes through HTML data attributes:
190
190
  ```html
191
191
  <!-- Light theme (default) -->
192
192
  <html data-theme="light">
193
- <!-- Dark theme -->
194
- <html data-theme="dark"></html>
193
+ <!-- Dark theme -->
194
+ <html data-theme="dark"></html>
195
195
  </html>
196
196
  ```
197
197