@proveanything/smartlinks-utils-ui 0.1.3 → 0.1.5

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
@@ -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.