@proveanything/smartlinks-utils-ui 0.1.1 → 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 CHANGED
@@ -22,10 +22,14 @@ Import the pre-compiled styles in your app's entry point:
22
22
 
23
23
  ```tsx
24
24
  import '@proveanything/smartlinks-ui/styles.css';
25
+ // — OR, if you import the main barrel, CSS is included automatically:
26
+ import { AssetPicker } from '@proveanything/smartlinks-ui';
25
27
  ```
26
28
 
27
29
  This provides all the Tailwind utility classes used by the components. Your app still needs to define the CSS variables (e.g., `--primary`, `--border`) — these come from your own design system (shadcn, custom theme, etc.).
28
30
 
31
+ **Note:** If you use sub-path imports (e.g., `@proveanything/smartlinks-ui/asset-picker`), you must also import the styles separately since sub-path entry points don't include the CSS.
32
+
29
33
  ## Components
30
34
 
31
35
  ### Asset Picker
@@ -76,6 +80,35 @@ import { IconPicker } from '@proveanything/smartlinks-ui/icon-picker';
76
80
  />
77
81
  ```
78
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
+
79
112
  ## Prerequisites
80
113
 
81
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.