@liquidcommerce/elements-sdk 2.7.38 → 2.7.39
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/dist/index.checkout.esm.js +7952 -7891
- package/dist/index.esm.js +12838 -12714
- package/dist/ssr-stub.esm.js +1 -0
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/constants/prop65.constant.d.ts +8 -0
- package/dist/types/enums/core.enum.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-prop65-warning.component.d.ts +8 -0
- package/dist/types/modules/checkout/components/index.d.ts +1 -0
- package/dist/types/modules/product/components/product-prop65-warning.d.ts +1 -0
- package/dist/types/modules/product/product.component.d.ts +3 -0
- package/dist/types/modules/product/styles/prop65-warning.style.d.ts +1 -0
- package/docs/v1/api/configuration.md +1 -1
- package/docs/v1/guides/accessibility.md +11 -0
- package/docs/v1/guides/checkout-component.md +16 -0
- package/docs/v1/guides/product-component.md +16 -0
- package/docs/v1/guides/theming.md +1 -1
- package/package.json +1 -1
package/dist/ssr-stub.esm.js
CHANGED
|
@@ -214,6 +214,7 @@ const COMPONENT_TYPE = {
|
|
|
214
214
|
CHECKOUT_ITEM: 'checkout-item',
|
|
215
215
|
CHECKOUT_ITEM_QUANTITY: 'checkout-item-quantity',
|
|
216
216
|
CHECKOUT_PLACE_ORDER_BUTTON: 'checkout-place-order-button',
|
|
217
|
+
CHECKOUT_PROP65_WARNING: 'checkout-prop65-warning',
|
|
217
218
|
CHECKOUT_HEADER: 'checkout-header',
|
|
218
219
|
CHECKOUT_PRESALE_COUNTDOWN: 'checkout-presale-countdown',
|
|
219
220
|
CHECKOUT_PRESALE_EXPIRED: 'checkout-presale-expired',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PROP65: {
|
|
2
|
+
readonly LABEL: "CA WARNING";
|
|
3
|
+
readonly URL: "https://www.p65warnings.ca.gov/alcohol";
|
|
4
|
+
readonly URL_TEXT: "www.P65Warnings.ca.gov/alcohol";
|
|
5
|
+
readonly BODY_LEAD: "WARNING:";
|
|
6
|
+
readonly BODY: "Drinking distilled spirits, beer, coolers, wine and other alcoholic beverages may increase cancer risk, and, during pregnancy, can cause birth defects. For more information go to";
|
|
7
|
+
};
|
|
8
|
+
export declare function isProp65State(state: string | null | undefined): boolean;
|
|
@@ -133,6 +133,7 @@ export declare const COMPONENT_TYPE: {
|
|
|
133
133
|
readonly CHECKOUT_ITEM: "checkout-item";
|
|
134
134
|
readonly CHECKOUT_ITEM_QUANTITY: "checkout-item-quantity";
|
|
135
135
|
readonly CHECKOUT_PLACE_ORDER_BUTTON: "checkout-place-order-button";
|
|
136
|
+
readonly CHECKOUT_PROP65_WARNING: "checkout-prop65-warning";
|
|
136
137
|
readonly CHECKOUT_HEADER: "checkout-header";
|
|
137
138
|
readonly CHECKOUT_PRESALE_COUNTDOWN: "checkout-presale-countdown";
|
|
138
139
|
readonly CHECKOUT_PRESALE_EXPIRED: "checkout-presale-expired";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CheckoutProp65WarningComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
|
+
constructor();
|
|
5
|
+
get hostClasses(): string[];
|
|
6
|
+
private colorMode;
|
|
7
|
+
protected template(): HTMLElement;
|
|
8
|
+
}
|
|
@@ -18,6 +18,7 @@ export * from './checkout-place-order-button.component';
|
|
|
18
18
|
export * from './checkout-presale-countdown.component';
|
|
19
19
|
export * from './checkout-presale-expired.component';
|
|
20
20
|
export * from './checkout-promo-code.component';
|
|
21
|
+
export * from './checkout-prop65-warning.component';
|
|
21
22
|
export * from './checkout-send-as-gift.component';
|
|
22
23
|
export * from './checkout-stripe-form.component';
|
|
23
24
|
export * from './checkout-stripe-handler.component';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createProductProp65Warning(): HTMLDetailsElement;
|
|
@@ -5,9 +5,12 @@ export interface IProductComponentParams {
|
|
|
5
5
|
}
|
|
6
6
|
export declare class ProductComponent extends BaseComponent<IProductComponentParams, IProductComponent> {
|
|
7
7
|
private titleElement;
|
|
8
|
+
private contentElement;
|
|
9
|
+
private prop65Warning;
|
|
8
10
|
constructor();
|
|
9
11
|
private getProductId;
|
|
10
12
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
13
|
+
private syncProp65Warning;
|
|
11
14
|
protected template(): HTMLElement;
|
|
12
15
|
disconnected(): Promise<void>;
|
|
13
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getProp65WarningStyles: () => string;
|
|
@@ -143,7 +143,7 @@ interface IGlobalLayout {
|
|
|
143
143
|
| `enableOrderedProductSizes` | `boolean` | Enable a fixed display order for product/PLC size selectors (defined by `orderedProductSizes`) instead of the default ordering |
|
|
144
144
|
| `orderedProductSizes` | `string[]` | Ordered list of size values controlling the sequence in which size selectors are rendered; changes trigger targeted rerenders of the affected size selectors |
|
|
145
145
|
| `showPoweredBy` | `boolean` | Show "Powered by LiquidCommerce" badge |
|
|
146
|
-
| `poweredByMode` | `'light' \| 'dark'` |
|
|
146
|
+
| `poweredByMode` | `'light' \| 'dark'` | Colour mode for the checkout: the powered-by badge, the Stripe payment form, and the California Proposition 65 warning panel |
|
|
147
147
|
|
|
148
148
|
> **Note:** `showPoweredBy` is a server/plan-controlled setting and **cannot** be overridden by hosts. Any value supplied via `customTheme` (or a later config update) is stripped and the server value is restored. Only `poweredByMode` (`'light' \| 'dark'`) is host-overridable.
|
|
149
149
|
|
|
@@ -143,6 +143,11 @@ on render, and a live region recreated with its text already in place is not ann
|
|
|
143
143
|
`option` and `radio` have presentational children, so the name is the only channel: a delivery
|
|
144
144
|
option names the retailer, the price, the timing, the delivery fee and — for same-day — the
|
|
145
145
|
store address and whether it is currently closed.
|
|
146
|
+
- The California Proposition 65 warning on the product is a native `<details>` / `<summary>`
|
|
147
|
+
disclosure: the summary is a button that exposes its expanded state, and `Enter` / `Space` toggle
|
|
148
|
+
it with no scripting involved. Its `+` / `−` indicator is decorative and hidden. In checkout it is
|
|
149
|
+
a plain link whose accessible name ends "(opens in a new tab)", since following it leaves the
|
|
150
|
+
purchase mid-flow; the `·` separator is hidden.
|
|
146
151
|
|
|
147
152
|
### Headings
|
|
148
153
|
|
|
@@ -180,6 +185,12 @@ The tokens worth checking are `defaultTextColor`, `linkTextColor`, `warningColor
|
|
|
180
185
|
`successColor` against `drawerBackgroundColor` (or whatever your page puts behind the Element), plus
|
|
181
186
|
`selectedTextColor` against `primaryColor` for text on brand-filled buttons and badges.
|
|
182
187
|
|
|
188
|
+
`defaultTextColor` also colours the product's California Proposition 65 warning, which is legally
|
|
189
|
+
required copy, so it always uses the full-strength token, never a lighter variant — make sure it
|
|
190
|
+
reaches 4.5:1 on your product background. The checkout's warning panel does not use it: it is a
|
|
191
|
+
fixed colour pair chosen by `global.layout.poweredByMode` (over 13:1 in both `light` and `dark`), so
|
|
192
|
+
set that to `dark` if your checkout is dark.
|
|
193
|
+
|
|
183
194
|
Every token ships with a default that already passes on a light surface. Two are easy to forget
|
|
184
195
|
because they are optional — leave them out to keep the compliant defaults, or set them explicitly to
|
|
185
196
|
keep those details on-brand:
|
|
@@ -452,6 +452,22 @@ window.addEventListener('lce:actions.checkout_product_add_failed', (event) => {
|
|
|
452
452
|
});
|
|
453
453
|
```
|
|
454
454
|
|
|
455
|
+
## California Proposition 65 Warning
|
|
456
|
+
|
|
457
|
+
The order summary shows a panel directly above the place-order button reading **Adult signature
|
|
458
|
+
(21+) required at delivery.** When the shipping address is in California, the panel adds
|
|
459
|
+
**CA WARNING · California Proposition 65 information for these products**, so the warning is
|
|
460
|
+
presented before the purchase completes. The text links to the OEHHA alcohol page,
|
|
461
|
+
[www.P65Warnings.ca.gov/alcohol](https://www.p65warnings.ca.gov/alcohol), in a new tab. The full
|
|
462
|
+
27 CCR § 25607.4 text is on the product element.
|
|
463
|
+
|
|
464
|
+
The panel appears in the drawer checkout, the hosted checkout and the checkout-only build. The
|
|
465
|
+
adult-signature notice is always shown; the Prop 65 line follows the shipping address's state and
|
|
466
|
+
updates when the address changes. Neither can be turned off or reworded by configuration. Its colours follow `global.layout.poweredByMode` — the same
|
|
467
|
+
light/dark switch the Stripe payment form uses — as a fixed pair so the copy is always legible:
|
|
468
|
+
`light` is `#18181B` on `#F5F3EE`, `dark` is `#F5F3EE` on `#2A2824`. The font and corner radius come
|
|
469
|
+
from your theme. If your checkout is dark, set `poweredByMode: 'dark'`.
|
|
470
|
+
|
|
455
471
|
## Customization
|
|
456
472
|
|
|
457
473
|
### Theme Configuration
|
|
@@ -227,6 +227,22 @@ Adjust product quantity before adding to cart:
|
|
|
227
227
|
- Direct input field
|
|
228
228
|
- Inventory limits enforced
|
|
229
229
|
|
|
230
|
+
### California Proposition 65 Warning
|
|
231
|
+
|
|
232
|
+
When the shopper's address is in California, the product element ends with a collapsed
|
|
233
|
+
**CA WARNING — California Proposition 65** row. Expanding it shows the alcoholic-beverage warning
|
|
234
|
+
required by 27 CCR § 25607.4, verbatim, with a link to
|
|
235
|
+
[www.P65Warnings.ca.gov/alcohol](https://www.p65warnings.ca.gov/alcohol). The row appears and
|
|
236
|
+
disappears in place as the address changes; with no address set, or an address in another state, it
|
|
237
|
+
is not rendered.
|
|
238
|
+
|
|
239
|
+
This is a compliance requirement for alcohol sold online to California, so for a California address
|
|
240
|
+
it cannot be turned off: there is no layout option, theme token or attribute that removes the row or
|
|
241
|
+
changes its wording. It takes its
|
|
242
|
+
colours, fonts and dividers from your theme (`defaultTextColor`, `accentColor`, the heading and
|
|
243
|
+
paragraph fonts) so it fits your design — check that `defaultTextColor` reaches 4.5:1 against your
|
|
244
|
+
product background, since the SDK renders it as given.
|
|
245
|
+
|
|
230
246
|
## Actions API
|
|
231
247
|
|
|
232
248
|
Programmatically interact with products:
|
|
@@ -90,7 +90,7 @@ customTheme: {
|
|
|
90
90
|
inputFieldStyle: 'outlined', // or 'filled'
|
|
91
91
|
enableOrderedProductSizes: true, // enable custom ordering of the size selectors
|
|
92
92
|
orderedProductSizes: ['750ml', '1L', '1.75L'], // order applied to product and product-list size selectors
|
|
93
|
-
poweredByMode: 'light' // or 'dark'
|
|
93
|
+
poweredByMode: 'light' // or 'dark': badge, Stripe form and Prop 65 panel colours (note: showPoweredBy is controlled server-side and cannot be overridden via customTheme)
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
package/package.json
CHANGED