@souldi/try-on 0.4.5 → 0.5.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ ## 0.5.0
4
+
5
+ **Breaking.** `init({ appearance })` replaces the `theme` option.
6
+
7
+ - **New: `appearance`.** `init({ appearance: { ink, fill, corners, font } })` styles the try-on button, the result dialog and the sign-in and upload screens. It is the same closed set of values a Shopify merchant sets on the Souldi block. Missing or unknown values fall back to the defaults, one by one, and never throw. See [Appearance](README.md#appearance).
8
+ - **Removed: `theme`.** Its properties (`mode`, `accentColor`, `accentTextColor`, `borderRadius`, `fontFamily`, `headingFontFamily`, `buttonOutlineColor`) are gone, not deprecated. A `theme` that is still passed is ignored and logs one console warning.
9
+ - **Removed: dark mode.** The widget is light-only, like its result dialog. An embedder who passed `theme: { mode: 'dark' }` now gets the light sign-in and upload screens.
10
+ - **Contrast is reported, never corrected.** The `ink` is used as given. If it is below 4.5:1 against white, the widget logs one console warning.
11
+
12
+ **CDN embedders get this on the day it is published.** The README's script tag, `https://unpkg.com/@souldi/try-on/dist/widget.umd.js`, names no version, so it serves the newest release. To stay on 0.4 while you move from `theme` to `appearance`, pin the version in the URL (`https://unpkg.com/@souldi/try-on@0.4/dist/widget.umd.js`) or in your `package.json`.
package/README.md CHANGED
@@ -97,7 +97,7 @@ Call once per page load to configure the widget.
97
97
  | Option | Type | Required | Description |
98
98
  |--------|------|----------|-------------|
99
99
  | `tenantApiKey` | `string` | Yes | Your publishable API key (from your Souldi dashboard) |
100
- | `theme` | `object` | No | Customize the widget appearance ([see Theming](#theming)) |
100
+ | `appearance` | `object` | No | How the widget looks: ink, fill, corners and font ([see Appearance](#appearance)) |
101
101
  | `fontsUrl` | `string` | No | Where you serve the package's `dist/fonts` directory, to load the fonts from your own origin instead of unpkg ([see Fonts](#fonts)) |
102
102
  | `declareFonts` | `boolean` | No | Default `true`: the widget declares its fonts in your page ([see Fonts](#fonts)). Pass `false` only if your page already declares them |
103
103
  | `onGenerationStart` | `function(info)` | No | Called when AI generation begins |
@@ -222,51 +222,40 @@ It returns a handle for that button. Among its methods:
222
222
 
223
223
  ---
224
224
 
225
- ## Theming
225
+ ## Appearance
226
226
 
227
- The widget ships with **dark** and **light** themes and supports deep customization to match your store's brand.
228
-
229
- ### Theme Modes
227
+ One **appearance** styles the whole widget: the try-on button, the result dialog, and the sign-in and upload screens. It is the same closed set of choices a Shopify merchant makes on the Souldi block, so every embed has one appearance contract.
230
228
 
231
229
  ```javascript
232
230
  VirtualTryOn.init({
233
231
  tenantApiKey: 'your_key',
234
- theme: {
235
- mode: 'light', // 'dark' (default) or 'light'
232
+ appearance: {
233
+ ink: '#7A1F5C', // your brand colour, as six hex digits
234
+ fill: 'filled', // 'outlined' (default) or 'filled'
235
+ corners: 'rounded', // 'square' (default), 'rounded' or 'pill'
236
+ font: 'theme', // 'souldi' (default) or 'theme'
236
237
  },
237
238
  });
238
239
  ```
239
240
 
240
- ### Custom Brand Colors
241
+ | Property | Values | Default | What it does |
242
+ |----------|--------|---------|--------------|
243
+ | `ink` | `#rrggbb` | `#1F201F` | Colours the accents only: the primary action, selected states, the size stamp and focus rings. Never body text. |
244
+ | `fill` | `'outlined'` \| `'filled'` | `'outlined'` | The primary action is the ink on white (outlined) or white on the ink (filled). Secondary actions stay outlined. |
245
+ | `corners` | `'square'` \| `'rounded'` \| `'pill'` | `'square'` | Buttons take the shape as chosen. Cards and sheets cap it (0, 12px and 20px), so a dialog never turns into an oval. |
246
+ | `font` | `'souldi'` \| `'theme'` | `'souldi'` | The widget's own faces ([see Fonts](#fonts)), or your page's font, inherited everywhere, headings included. |
241
247
 
242
- Override individual properties to match your brand:
248
+ Each value is checked on its own. A missing or unknown value falls back to its default and never throws, so a typo can't break your page. An `ink` that isn't six hex digits (`#FFF`, `red`) falls back to the default ink.
243
249
 
244
- ```javascript
245
- VirtualTryOn.init({
246
- tenantApiKey: 'your_key',
247
- theme: {
248
- mode: 'dark',
249
- accentColor: '#7C3AED', // Primary button & accent color
250
- accentTextColor: '#FFFFFF', // Text color on accent buttons
251
- borderRadius: '8px', // Border radius for cards & modals
252
- fontFamily: '"Inter", sans-serif',
253
- headingFontFamily: '"Playfair Display", serif',
254
- buttonOutlineColor: '#7C3AED', // Outline on the split button
255
- },
256
- });
257
- ```
250
+ **Pick an ink that reads on white.** The ink is used exactly as you give it. If it is below 4.5:1 contrast against white (the WCAG AA minimum for text), the widget logs one console warning and still uses it. It doesn't darken the colour for you.
258
251
 
259
- ### Available Theme Options
252
+ There is no `size` option. One that is passed is ignored.
260
253
 
261
- | Property | Type | Default | Description |
262
- |----------|------|---------|-------------|
263
- | `mode` | `'dark' \| 'light'` | `'dark'` | Base color palette |
264
- | `accentColor` | CSS color | `#5e8b5c` (dark) / `#1F201F` (light) | Primary action color on the sign-in and upload screens |
265
- | `accentTextColor` | CSS color | `#193620` (dark) / `#FFFFFF` (light) | Text on accent buttons |
266
- | `borderRadius` | CSS value | `0` (square) | Corner rounding for buttons; cards take about 1.7× it |
267
- | `fontFamily` | CSS font stack | `'Souldi Manrope', system-ui, sans-serif` | Body text font |
268
- | `headingFontFamily` | CSS font stack | `'Souldi Newsreader', serif` | Heading font |
269
- | `buttonOutlineColor` | CSS color | `transparent` | Border color on the try-on button |
254
+ > **Removed in 0.5.0:** `theme` (`mode`, `accentColor`, `accentTextColor`,
255
+ > `borderRadius`, `fontFamily`, `headingFontFamily`, `buttonOutlineColor`) and
256
+ > the dark mode it selected. The widget is light-only. A `theme` that is still
257
+ > passed is ignored and logs one console warning. Move to `appearance`. See the
258
+ > [changelog](CHANGELOG.md).
270
259
 
271
260
  All UI is rendered inside a **Shadow DOM**, so your site's CSS will never leak into the widget and the widget will never break your styles.
272
261
 
@@ -309,7 +298,7 @@ The widget then contacts no one but you for its fonts, and a `font-src 'self'` p
309
298
  <script>
310
299
  VirtualTryOn.init({
311
300
  tenantApiKey: 'pk_live_abc123',
312
- theme: { mode: 'light', accentColor: '#2563EB' },
301
+ appearance: { ink: '#2563EB', corners: 'rounded' },
313
302
  onGenerationSuccess: (url) => {
314
303
  console.log('Try-on result:', url);
315
304
  },