@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 +33 -0
- package/dist/chunk-4Z46C4MJ.js +1090 -0
- package/dist/chunk-4Z46C4MJ.js.map +1 -0
- package/dist/chunk-HLFNSOPD.js +518 -0
- package/dist/chunk-HLFNSOPD.js.map +1 -0
- package/dist/chunk-IVUFK6SS.js +780 -0
- package/dist/chunk-IVUFK6SS.js.map +1 -0
- package/dist/chunk-L7FQ52F5.js +11 -0
- package/dist/chunk-L7FQ52F5.js.map +1 -0
- package/dist/chunk-WOCLZGRB.js +920 -0
- package/dist/chunk-WOCLZGRB.js.map +1 -0
- package/dist/components/AssetPicker/index.js +4 -0
- package/dist/components/AssetPicker/index.js.map +1 -0
- package/dist/components/ConditionsEditor/index.js +4 -0
- package/dist/components/ConditionsEditor/index.js.map +1 -0
- 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/components/IconPicker/index.js +4 -0
- package/dist/components/IconPicker/index.js.map +1 -0
- package/dist/index.css +1034 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/package.json +17 -13
- package/dist/styles.d.ts +0 -2
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.
|