@orion-ds/react 1.1.4 → 1.1.6
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
|
@@ -33,14 +33,13 @@ yarn add @orion/react @orion/core
|
|
|
33
33
|
## Quick Start
|
|
34
34
|
|
|
35
35
|
\`\`\`tsx
|
|
36
|
-
import { Button, Card, Field, useTheme, ThemeProvider
|
|
36
|
+
import { Button, Card, Field, useTheme, ThemeProvider } from '@orion-ds/react';
|
|
37
37
|
import '@orion-ds/core/theme.css';
|
|
38
38
|
import '@orion-ds/react/dist/react.css';
|
|
39
39
|
|
|
40
40
|
function App() {
|
|
41
41
|
return (
|
|
42
|
-
<ThemeProvider>
|
|
43
|
-
<FontLoader /> {/* Automatically loads Google Fonts */}
|
|
42
|
+
<ThemeProvider> {/* Fonts load automatically! */}
|
|
44
43
|
<MyApp />
|
|
45
44
|
</ThemeProvider>
|
|
46
45
|
);
|
|
@@ -63,30 +62,30 @@ function MyApp() {
|
|
|
63
62
|
}
|
|
64
63
|
\`\`\`
|
|
65
64
|
|
|
66
|
-
## Google Fonts (
|
|
65
|
+
## Google Fonts (Automatic)
|
|
67
66
|
|
|
68
|
-
|
|
67
|
+
**Fonts are loaded automatically by `ThemeProvider`** (since v1.1.4). No manual setup required!
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
\`\`\`tsx
|
|
70
|
+
// ✅ Just use ThemeProvider - fonts load automatically
|
|
71
|
+
<ThemeProvider>
|
|
72
|
+
<YourApp />
|
|
73
|
+
</ThemeProvider>
|
|
74
|
+
\`\`\`
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
### Opt-out of Automatic Font Loading
|
|
73
77
|
|
|
74
|
-
|
|
75
|
-
import { ThemeProvider, FontLoader } from '@orion-ds/react';
|
|
78
|
+
If you need to manage fonts manually (e.g., self-hosted fonts, custom font strategy):
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<YourApp />
|
|
82
|
-
</ThemeProvider>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
80
|
+
\`\`\`tsx
|
|
81
|
+
<ThemeProvider disableAutoFontLoading>
|
|
82
|
+
<YourApp />
|
|
83
|
+
</ThemeProvider>
|
|
85
84
|
\`\`\`
|
|
86
85
|
|
|
87
|
-
###
|
|
86
|
+
### Manual HTML Setup (Alternative)
|
|
88
87
|
|
|
89
|
-
|
|
88
|
+
For vanilla HTML projects or if you disabled auto-loading, add these links to your HTML `<head>`:
|
|
90
89
|
|
|
91
90
|
\`\`\`html
|
|
92
91
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
@@ -4,22 +4,27 @@
|
|
|
4
4
|
* Automatically injects Google Fonts into the document head.
|
|
5
5
|
* This ensures all brand fonts are available without manual HTML setup.
|
|
6
6
|
*
|
|
7
|
+
* **Note:** Since v1.1.4, ThemeProvider includes FontLoader automatically.
|
|
8
|
+
* You don't need to add this component manually unless you've disabled
|
|
9
|
+
* auto font loading with `disableAutoFontLoading` prop.
|
|
10
|
+
*
|
|
7
11
|
* @example
|
|
8
12
|
* ```tsx
|
|
9
|
-
*
|
|
13
|
+
* // ThemeProvider loads fonts automatically - no FontLoader needed!
|
|
14
|
+
* import { ThemeProvider } from '@orion-ds/react';
|
|
10
15
|
*
|
|
11
16
|
* function App() {
|
|
12
17
|
* return (
|
|
13
18
|
* <ThemeProvider>
|
|
14
|
-
* <FontLoader />
|
|
15
19
|
* <YourComponents />
|
|
16
20
|
* </ThemeProvider>
|
|
17
21
|
* );
|
|
18
22
|
* }
|
|
19
23
|
* ```
|
|
20
24
|
*
|
|
21
|
-
*
|
|
25
|
+
* @example
|
|
22
26
|
* ```tsx
|
|
27
|
+
* // Use standalone only if you need callbacks or custom loading behavior
|
|
23
28
|
* <FontLoader onLoad={() => console.log('Fonts ready!')} />
|
|
24
29
|
* ```
|
|
25
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FontLoader.d.ts","sourceRoot":"","sources":["../../../src/components/FontLoader/FontLoader.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"FontLoader.d.ts","sourceRoot":"","sources":["../../../src/components/FontLoader/FontLoader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,OAAO,EACP,gBAAwB,EACxB,gBAAgB,EAChB,QAAQ,GACT,EAAE,eAAe,kDAyEjB;yBA/Ee,UAAU"}
|