@proveanything/smartlinks-utils-ui 0.1.3 → 0.1.4
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 +29 -0
- package/dist/chunk-4Z46C4MJ.js +1090 -0
- package/dist/chunk-4Z46C4MJ.js.map +1 -0
- package/dist/{chunk-V7JHAER7.js → chunk-WOCLZGRB.js} +64 -64
- package/dist/chunk-WOCLZGRB.js.map +1 -0
- package/dist/components/AssetPicker/index.js +1 -1
- package/dist/components/FontPicker/index.d.ts +134 -0
- package/dist/components/FontPicker/index.js +4 -0
- package/dist/components/FontPicker/index.js.map +1 -0
- package/dist/index.css +139 -103
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/package.json +5 -1
- package/dist/chunk-V7JHAER7.js.map +0 -1
package/README.md
CHANGED
|
@@ -80,6 +80,35 @@ import { IconPicker } from '@proveanything/smartlinks-ui/icon-picker';
|
|
|
80
80
|
/>
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
### Font Picker
|
|
84
|
+
|
|
85
|
+
Searchable font picker with Google Fonts catalog and support for custom uploaded fonts. Returns full loading metadata (CSS URLs, `@font-face` blocks, `cssFontFamily` strings) so the consumer knows exactly how to load the selected font.
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import { FontPicker } from '@proveanything/smartlinks-ui/font-picker';
|
|
89
|
+
|
|
90
|
+
<FontPicker
|
|
91
|
+
mode="dialog"
|
|
92
|
+
value="Inter"
|
|
93
|
+
showPreview
|
|
94
|
+
onSelect={(font) => {
|
|
95
|
+
console.log(font.family); // "Inter"
|
|
96
|
+
console.log(font.cssFontFamily); // "'Inter', ui-sans-serif, system-ui, sans-serif"
|
|
97
|
+
console.log(font.loadSnippet); // <link href="..." rel="stylesheet">
|
|
98
|
+
}}
|
|
99
|
+
trigger={<button>Pick Font</button>}
|
|
100
|
+
/>
|
|
101
|
+
|
|
102
|
+
{/* With custom uploaded fonts from SmartLinks */}
|
|
103
|
+
<FontPicker
|
|
104
|
+
mode="dialog"
|
|
105
|
+
showCustomFonts
|
|
106
|
+
scope={{ collectionId: 'abc123' }}
|
|
107
|
+
admin
|
|
108
|
+
onSelect={(font) => console.log(font)}
|
|
109
|
+
/>
|
|
110
|
+
```
|
|
111
|
+
|
|
83
112
|
## Prerequisites
|
|
84
113
|
|
|
85
114
|
All components assume `@proveanything/smartlinks` is already initialized in your app via `SL.initializeApi()`. Components that interact with the SmartLinks API (Asset Picker) will use the global SDK import directly.
|