@liquidcommerce/elements-sdk 2.6.0-beta.11 → 2.6.0-beta.110
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 +99 -2518
- package/dist/index.checkout.esm.js +18210 -0
- package/dist/index.esm.js +26253 -20673
- package/dist/ssr-stub.checkout.esm.js +17 -0
- package/dist/ssr-stub.esm.js +269 -0
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +50 -0
- package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +15 -2
- package/dist/types/clients/builder.d.ts +3 -0
- package/dist/types/clients/checkout.d.ts +6 -0
- package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +2 -1
- package/dist/types/clients/main.d.ts +3 -0
- package/dist/types/constants/core.constant.d.ts +13 -18
- package/dist/types/core/a11y/announcer.service.d.ts +16 -0
- package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
- package/dist/types/core/a11y/focusable.d.ts +5 -0
- package/dist/types/core/a11y/glyph-button.d.ts +8 -0
- package/dist/types/core/a11y/index.d.ts +6 -0
- package/dist/types/core/a11y/required.d.ts +1 -0
- package/dist/types/core/a11y/single-select.d.ts +20 -0
- package/dist/types/core/api/api-client.service.d.ts +19 -18
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +37 -13
- package/dist/types/core/api/http-client.service.d.ts +0 -8
- package/dist/types/core/base-component.service.d.ts +4 -1
- package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
- package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
- package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +69 -0
- package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
- package/dist/types/core/client/client-action.service.d.ts +6 -74
- package/dist/types/core/client/client-config.service.d.ts +8 -5
- package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -1
- package/dist/types/core/google-tag-manager.service.d.ts +3 -1
- package/dist/types/core/logger/logger.service.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +36 -51
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
- package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
- package/dist/types/core/singleton-manager.service.d.ts +12 -8
- package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +19 -108
- package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
- package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
- package/dist/types/core/store/store.constant.d.ts +5 -0
- package/dist/types/core/store/store.service.d.ts +1 -0
- package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
- package/dist/types/enums/core.enum.d.ts +39 -2
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/index.checkout.d.ts +8 -0
- package/dist/types/index.checkout.umd.d.ts +4 -0
- package/dist/types/index.d.ts +8 -3
- package/dist/types/interfaces/api/cart.interface.d.ts +12 -7
- package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
- package/dist/types/interfaces/api/index.d.ts +5 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +15 -6
- package/dist/types/interfaces/api/product.interface.d.ts +10 -4
- package/dist/types/interfaces/client.interface.d.ts +72 -0
- package/dist/types/interfaces/component.interface.d.ts +7 -0
- package/dist/types/interfaces/config.interface.d.ts +40 -0
- package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
- package/dist/types/interfaces/configs/global.interface.d.ts +9 -3
- package/dist/types/interfaces/configs/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +5 -1
- package/dist/types/interfaces/injection.interface.d.ts +50 -0
- package/dist/types/modules/address/address-display.component.d.ts +3 -1
- package/dist/types/modules/address/address-input.component.d.ts +10 -1
- package/dist/types/modules/address/address.command.d.ts +2 -1
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/cart/cart.commands.d.ts +4 -4
- package/dist/types/modules/cart/components/cart-body.component.d.ts +1 -0
- package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
- package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +34 -11
- package/dist/types/modules/checkout/checkout.component.d.ts +6 -1
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +5 -2
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
- package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
- package/dist/types/modules/checkout/components/checkout-order-summary.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +2 -1
- package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +15 -1
- package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
- package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +3 -0
- package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +4 -2
- package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +4 -2
- package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
- package/dist/types/modules/checkout/components/required-fields-legend.d.ts +1 -0
- package/dist/types/modules/checkout/constant.d.ts +3 -0
- package/dist/types/modules/checkout/payment-session-error.d.ts +4 -0
- package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product/components/components.d.ts +26 -2
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +7 -1
- package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
- package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
- package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +6 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +12 -2
- package/dist/types/modules/product/product.commands.d.ts +5 -5
- package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
- package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
- package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +1 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +2 -1
- package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
- package/dist/types/modules/product-list/components/index.d.ts +6 -2
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +37 -31
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -36
- package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +53 -0
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
- package/dist/types/modules/product-list/product-list-filter.registry.d.ts +42 -0
- package/dist/types/modules/product-list/product-list-filter.utils.d.ts +7 -0
- package/dist/types/modules/product-list/product-list-order.utils.d.ts +3 -0
- package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +22 -7
- package/dist/types/modules/product-list/product-list.component.d.ts +23 -47
- package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
- package/dist/types/modules/product-list/product-list.interface.d.ts +17 -28
- package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
- package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
- package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
- package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
- package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
- package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +8 -1
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
- package/dist/types/modules/ui-components/input/index.d.ts +0 -1
- package/dist/types/modules/ui-components/input/input.component.d.ts +14 -1
- package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
- package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
- package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
- package/dist/types/ssr/stub.checkout.d.ts +6 -0
- package/dist/types/ssr/stub.d.ts +10 -0
- package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
- package/dist/types/static/icon/bag.icon.d.ts +1 -1
- package/dist/types/static/icon/check.icon.d.ts +2 -0
- package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-up.icon.d.ts +1 -1
- package/dist/types/static/icon/close.icon.d.ts +1 -1
- package/dist/types/static/icon/error-info.icon.d.ts +1 -1
- package/dist/types/static/icon/filter.icon.d.ts +1 -1
- package/dist/types/static/icon/icon.a11y.d.ts +1 -0
- package/dist/types/static/icon/icon.types.d.ts +1 -0
- package/dist/types/static/icon/index.d.ts +2 -0
- package/dist/types/static/icon/info.icon.d.ts +1 -1
- package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
- package/dist/types/static/icon/search.icon.d.ts +1 -1
- package/dist/types/static/icon/success.icon.d.ts +1 -1
- package/dist/types/static/icon/trash.icon.d.ts +1 -1
- package/dist/types/static/icon/warning.icon.d.ts +1 -1
- package/dist/types/utils/dom-compat.d.ts +2 -0
- package/dist/types/utils/format.d.ts +5 -14
- package/dist/types/utils/image-bg-removal.d.ts +3 -0
- package/dist/types/utils/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +18 -0
- package/dist/types/utils/timezone.d.ts +6 -0
- package/docs/v1/README.md +213 -0
- package/docs/v1/api/actions/address-actions.md +286 -0
- package/docs/v1/api/actions/cart-actions.md +364 -0
- package/docs/v1/api/actions/checkout-actions.md +527 -0
- package/docs/v1/api/actions/product-actions.md +204 -0
- package/docs/v1/api/client.md +596 -0
- package/docs/v1/api/configuration.md +557 -0
- package/docs/v1/api/injection-methods.md +331 -0
- package/docs/v1/api/typescript-types.md +424 -0
- package/docs/v1/api/ui-helpers.md +200 -0
- package/docs/v1/examples/advanced-patterns.md +199 -0
- package/docs/v1/examples/checkout-flow.md +90 -0
- package/docs/v1/examples/custom-theming.md +63 -0
- package/docs/v1/examples/multi-product-page.md +90 -0
- package/docs/v1/examples/simple-product-page.md +89 -0
- package/docs/v1/getting-started/concepts.md +521 -0
- package/docs/v1/getting-started/installation.md +349 -0
- package/docs/v1/getting-started/quick-start.md +410 -0
- package/docs/v1/guides/accessibility.md +214 -0
- package/docs/v1/guides/address-component.md +435 -0
- package/docs/v1/guides/best-practices.md +365 -0
- package/docs/v1/guides/cart-component.md +757 -0
- package/docs/v1/guides/checkout-component.md +670 -0
- package/docs/v1/guides/events.md +939 -0
- package/docs/v1/guides/product-component.md +736 -0
- package/docs/v1/guides/product-list-component.md +730 -0
- package/docs/v1/guides/theming.md +229 -0
- package/docs/v1/integration/angular.md +39 -0
- package/docs/v1/integration/laravel.md +41 -0
- package/docs/v1/integration/nextjs.md +69 -0
- package/docs/v1/integration/proxy-setup.md +106 -0
- package/docs/v1/integration/react.md +64 -0
- package/docs/v1/integration/vanilla-js.md +84 -0
- package/docs/v1/integration/vue.md +58 -0
- package/docs/v1/reference/analytics.md +107 -0
- package/docs/v1/reference/browser-support.md +47 -0
- package/docs/v1/reference/error-handling.md +83 -0
- package/docs/v1/reference/performance.md +52 -0
- package/docs/v1/reference/telemetry.md +85 -0
- package/docs/v1/reference/troubleshooting.md +135 -0
- package/package.json +75 -45
- package/dist/types/elements-builder-client.d.ts +0 -2
- package/dist/types/elements-client.d.ts +0 -2
- package/dist/types/enums/cloud.enum.d.ts +0 -97
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/index.d.ts +0 -3
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
- package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
- package/dist/types/interfaces/core.interface.d.ts +0 -111
- package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
- package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
- package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
- package/dist/types/utils/helper.d.ts +0 -28
- package/docs/ACTIONS.md +0 -1300
- package/docs/BROWSER_SUPPORT.md +0 -279
- package/docs/CONFIGURATION.md +0 -853
- package/docs/DOCUMENTATION_INDEX.md +0 -311
- package/docs/EVENTS.md +0 -798
- package/docs/PROXY.md +0 -228
- package/docs/THEMING.md +0 -592
- package/docs/TROUBLESHOOTING.md +0 -793
- package/umd/elements.js +0 -1
- /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
# TypeScript Types Reference
|
|
2
|
+
|
|
3
|
+
All public types are exported from the main package entry point. Import them using the `type` keyword for optimal tree-shaking.
|
|
4
|
+
|
|
5
|
+
## Importing Types
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { Elements } from '@liquidcommerce/elements-sdk';
|
|
9
|
+
import type {
|
|
10
|
+
ILiquidCommerceElementsClient,
|
|
11
|
+
ILiquidCommerceElementsConfig,
|
|
12
|
+
IInjectProductElement,
|
|
13
|
+
IInjectedComponent
|
|
14
|
+
} from '@liquidcommerce/elements-sdk';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
For the checkout-only build:
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { ElementsCheckout } from '@liquidcommerce/elements-sdk/checkout';
|
|
21
|
+
import type {
|
|
22
|
+
IElementsCheckoutClient,
|
|
23
|
+
IElementsCheckoutActions,
|
|
24
|
+
ILiquidCommerceElementsCheckoutClientConfig,
|
|
25
|
+
IInjectedComponent
|
|
26
|
+
} from '@liquidcommerce/elements-sdk/checkout';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Client Types
|
|
32
|
+
|
|
33
|
+
### ILiquidCommerceElementsClient
|
|
34
|
+
|
|
35
|
+
Main SDK client interface returned by `Elements()`.
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
interface ILiquidCommerceElementsClient {
|
|
39
|
+
injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
|
|
40
|
+
injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
|
|
41
|
+
injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
|
|
42
|
+
injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
|
|
43
|
+
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
44
|
+
injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
|
|
45
|
+
injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
|
|
46
|
+
ui: ILiquidCommerceElementsUIMethod;
|
|
47
|
+
actions: ILiquidCommerceElementsActions;
|
|
48
|
+
getInjectedComponents(): Map<string, IInjectedComponent>;
|
|
49
|
+
destroy(): void;
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### ILiquidCommerceElementsBuilderClient
|
|
54
|
+
|
|
55
|
+
Builder-pattern client interface returned by `ElementsBuilder()`.
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
interface ILiquidCommerceElementsBuilderClient {
|
|
59
|
+
updateComponentGlobalConfigs(configs: UpdateComponentGlobalConfigs): Promise<void>;
|
|
60
|
+
updateProductComponent(configs: UpdateProductComponent): Promise<void>;
|
|
61
|
+
updateAddressComponent(configs: UpdateAddressComponent): void;
|
|
62
|
+
updateCartComponent(configs: UpdateCartComponent): void;
|
|
63
|
+
updateCheckoutComponent(configs: UpdateCheckoutComponent): void;
|
|
64
|
+
updateProductListComponent(configs: UpdateProductListComponent): void;
|
|
65
|
+
injectElement(params: IBuilderInjectElementParams): Promise<IInjectedComponent | null>;
|
|
66
|
+
injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
|
|
67
|
+
injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
|
|
68
|
+
injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
|
|
69
|
+
injectCheckoutElement(params: IInjectCheckoutBuilderParams): Promise<IInjectedComponent | null>;
|
|
70
|
+
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
71
|
+
actions: ILiquidCommerceElementsActions;
|
|
72
|
+
destroy(): void;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### IElementsCheckoutClient
|
|
77
|
+
|
|
78
|
+
Checkout-only client interface returned by `ElementsCheckout()`.
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
interface IElementsCheckoutClient {
|
|
82
|
+
injectCheckout(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
|
|
83
|
+
actions: { checkout: IElementsCheckoutActions };
|
|
84
|
+
destroy(): void;
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Configuration Types
|
|
91
|
+
|
|
92
|
+
### ILiquidCommerceElementsConfig
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
interface ILiquidCommerceElementsConfig {
|
|
96
|
+
env?: ElementsEnv;
|
|
97
|
+
promoTicker?: IPromoTicker[];
|
|
98
|
+
customTheme?: IClientCustomThemeConfig;
|
|
99
|
+
debugMode?: DebugMode;
|
|
100
|
+
checkout?: ILiquidCommerceElementsCheckoutConfig;
|
|
101
|
+
proxy?: IElementsProxyConfig;
|
|
102
|
+
development?: ILiquidCommerceElementsDevelopmentConfig;
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### ILiquidCommerceElementsBuilderConfig
|
|
107
|
+
|
|
108
|
+
Same shape as `ILiquidCommerceElementsConfig`, used by `ElementsBuilder()`.
|
|
109
|
+
|
|
110
|
+
### ILiquidCommerceElementsCheckoutClientConfig
|
|
111
|
+
|
|
112
|
+
Same shape as `ILiquidCommerceElementsConfig`, used for the checkout-only client.
|
|
113
|
+
|
|
114
|
+
### IClientCustomThemeConfig
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
interface IClientCustomThemeConfig {
|
|
118
|
+
global?: UpdateComponentGlobalConfigs;
|
|
119
|
+
product?: UpdateProductComponent;
|
|
120
|
+
address?: UpdateAddressComponent;
|
|
121
|
+
cart?: UpdateCartComponent;
|
|
122
|
+
checkout?: UpdateCheckoutComponent;
|
|
123
|
+
productList?: UpdateProductListComponent;
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### IElementsProxyConfig
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
interface IElementsProxyConfig {
|
|
131
|
+
baseUrl: string;
|
|
132
|
+
headers?: Record<string, string>;
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### ILiquidCommerceElementsDevelopmentConfig
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
interface ILiquidCommerceElementsDevelopmentConfig {
|
|
140
|
+
customApiUrl?: string;
|
|
141
|
+
openShadowDom?: boolean;
|
|
142
|
+
mockMode?: boolean; // when true, sends an 'X-Liquid-Api-Mock-Mode' header to receive mock data
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### ILiquidCommerceElementsCheckoutConfig
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
interface ILiquidCommerceElementsCheckoutConfig {
|
|
150
|
+
pageUrl?: string;
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
See [Configuration Reference](./configuration.md) for detailed property descriptions.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Injection Types
|
|
159
|
+
|
|
160
|
+
### IInjectProductElement
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
interface IInjectProductElement {
|
|
164
|
+
containerId: string;
|
|
165
|
+
identifier: string;
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### IInjectCheckoutParams
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
interface IInjectCheckoutParams {
|
|
173
|
+
containerId: string;
|
|
174
|
+
checkoutId?: string;
|
|
175
|
+
hideHeader?: boolean;
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### IInjectCheckoutBuilderParams
|
|
180
|
+
|
|
181
|
+
`simulatePresale` and `presaleExpiresInMinutes` are builder-only preview controls (presale lock defaults to 15 minutes) and only take effect via `ElementsBuilder().injectCheckoutElement()`.
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
interface IInjectCheckoutBuilderParams extends IInjectCheckoutParams {
|
|
185
|
+
simulatePresale?: boolean;
|
|
186
|
+
presaleExpiresInMinutes?: number;
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### IInjectProductListParams
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
interface IInjectProductListParams {
|
|
194
|
+
containerId: string;
|
|
195
|
+
slug: string;
|
|
196
|
+
rows?: number;
|
|
197
|
+
columns?: number;
|
|
198
|
+
filters?: ProductListFilterType[];
|
|
199
|
+
productUrl?: PLCProductUrl;
|
|
200
|
+
productOrder?: string[]; // display order, by UPC or grouping ID
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### PLCProductUrl
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
/**
|
|
208
|
+
* Product card link configuration.
|
|
209
|
+
*
|
|
210
|
+
* - String: template with `{upc}` (selected size's UPC) or `{grouping}`
|
|
211
|
+
* (product's salsifyGrouping ID). Replaced per product card.
|
|
212
|
+
* - Map: keyed by product identifier (UPC or salsifyGrouping ID — same
|
|
213
|
+
* identifier types accepted by `injectProductElement`). The card looks up
|
|
214
|
+
* UPC first, then grouping ID. Use this when partner PDPs have
|
|
215
|
+
* hand-curated URLs that aren't derivable from a single token.
|
|
216
|
+
*/
|
|
217
|
+
type PLCProductUrl = string | Record<string, string>;
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### IInjectProductListSearchParams
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
interface IInjectProductListSearchParams {
|
|
224
|
+
containerId: string;
|
|
225
|
+
slug: string;
|
|
226
|
+
filters?: ProductListFilterType[];
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### IInjectProductListFiltersParams
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
interface IInjectProductListFiltersParams {
|
|
234
|
+
containerId: string;
|
|
235
|
+
slug: string;
|
|
236
|
+
filters?: ProductListFilterType[];
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### IBuilderInjectElementParams
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
interface IBuilderInjectElementParams {
|
|
244
|
+
type: ComponentType;
|
|
245
|
+
containerId: string;
|
|
246
|
+
[key: string]: any;
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Component Types
|
|
253
|
+
|
|
254
|
+
### IInjectedComponent
|
|
255
|
+
|
|
256
|
+
Returned by all injection methods. Provides control over the injected component.
|
|
257
|
+
|
|
258
|
+
```typescript
|
|
259
|
+
interface IInjectedComponent {
|
|
260
|
+
getType(): ComponentType;
|
|
261
|
+
getElement(): HTMLElement;
|
|
262
|
+
rerender(): void;
|
|
263
|
+
destroy(): void;
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## UI Types
|
|
270
|
+
|
|
271
|
+
### ILiquidCommerceElementsUIMethod
|
|
272
|
+
|
|
273
|
+
```typescript
|
|
274
|
+
interface ILiquidCommerceElementsUIMethod {
|
|
275
|
+
cartButton(containerId: string, showItemsCount?: boolean): void;
|
|
276
|
+
floatingCartButton(showItemsCount?: boolean): void;
|
|
277
|
+
cartSubtotal(elementId: string): void;
|
|
278
|
+
cartItemsCount(elementId: string, options?: { hideZero: boolean }): void;
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Action Types
|
|
285
|
+
|
|
286
|
+
### ILiquidCommerceElementsActions
|
|
287
|
+
|
|
288
|
+
```typescript
|
|
289
|
+
interface ILiquidCommerceElementsActions {
|
|
290
|
+
product: IProductActions;
|
|
291
|
+
address: IAddressActions;
|
|
292
|
+
cart: ICartActions;
|
|
293
|
+
checkout: ICheckoutActions;
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### IElementsCheckoutActions
|
|
298
|
+
|
|
299
|
+
Checkout actions available in the checkout-only client. This is `ICheckoutActions` with `openCheckout`, `closeCheckout`, and `toggleCheckout` omitted -- the checkout-only client renders checkout independently and has no drawer navigation to open, close, or toggle.
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
interface IElementsCheckoutActions extends Omit<ICheckoutActions, 'openCheckout' | 'closeCheckout' | 'toggleCheckout'> {}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
See [Actions API](./actions/) for detailed method signatures.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Enum Types
|
|
310
|
+
|
|
311
|
+
### ElementsEnv
|
|
312
|
+
|
|
313
|
+
```typescript
|
|
314
|
+
type ElementsEnv = 'staging' | 'production';
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### DebugMode
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
type DebugMode = 'none' | 'console' | 'panel';
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### FulfillmentType
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
type FulfillmentType = 'onDemand' | 'shipping';
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### ComponentType
|
|
330
|
+
|
|
331
|
+
```typescript
|
|
332
|
+
type ComponentType =
|
|
333
|
+
| 'address' | 'product' | 'cart' | 'checkout'
|
|
334
|
+
| 'product-list' | 'product-list-card' | 'product-list-filters' | 'product-list-search'
|
|
335
|
+
| 'drawer' | 'input' | 'engraving-form' | 'engraving-view'
|
|
336
|
+
| 'buttons-cart-open' | 'powered-by' | 'lce-element'
|
|
337
|
+
| 'purchase-min-alert' | 'alert' | 'promo-code-ticker'
|
|
338
|
+
// ...and additional internal component types
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### DisplayModeType
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
type DisplayModeType = 'modal' | 'drawer';
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## Theme Configuration Types
|
|
350
|
+
|
|
351
|
+
### UpdateComponentGlobalConfigs
|
|
352
|
+
|
|
353
|
+
`DeepPartial<IComponentGlobalConfigs>` -- all properties optional.
|
|
354
|
+
|
|
355
|
+
### UpdateProductComponent
|
|
356
|
+
|
|
357
|
+
`DeepPartial<IProductComponent>` -- all properties optional.
|
|
358
|
+
|
|
359
|
+
### UpdateCartComponent
|
|
360
|
+
|
|
361
|
+
`DeepPartial<ICartComponent>` -- all properties optional.
|
|
362
|
+
|
|
363
|
+
### UpdateCheckoutComponent
|
|
364
|
+
|
|
365
|
+
`DeepPartial<ICheckoutComponent>` -- all properties optional.
|
|
366
|
+
|
|
367
|
+
### UpdateAddressComponent
|
|
368
|
+
|
|
369
|
+
`DeepPartial<IAddressComponent>` -- all properties optional.
|
|
370
|
+
|
|
371
|
+
### UpdateProductListComponent
|
|
372
|
+
|
|
373
|
+
Special structure for updating product list configuration by slug:
|
|
374
|
+
|
|
375
|
+
```typescript
|
|
376
|
+
interface UpdateProductListComponent {
|
|
377
|
+
theme?: { backgroundColor?: string };
|
|
378
|
+
layout?: {
|
|
379
|
+
lists?: Record<string, DeepPartial<IPLCList>>;
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
These `Update*Component` types are the arguments to the `ElementsBuilder()` client's `update*Component` methods; see [Client API](./client.md) for their behavior and usage.
|
|
385
|
+
|
|
386
|
+
See [Configuration Reference](./configuration.md) for detailed theme property descriptions.
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Promo Ticker Type
|
|
391
|
+
|
|
392
|
+
### IPromoTicker
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
interface IPromoTicker {
|
|
396
|
+
promoCode: string;
|
|
397
|
+
text: string[];
|
|
398
|
+
separator: string;
|
|
399
|
+
activeFrom: string; // ISO 8601 UTC
|
|
400
|
+
activeUntil: string; // ISO 8601 UTC
|
|
401
|
+
}
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## Utility Types
|
|
407
|
+
|
|
408
|
+
### DeepPartial
|
|
409
|
+
|
|
410
|
+
Used internally for theme update types. Makes all properties in `T` recursively optional.
|
|
411
|
+
|
|
412
|
+
```typescript
|
|
413
|
+
type DeepPartial<T> = {
|
|
414
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
415
|
+
};
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## See Also
|
|
421
|
+
|
|
422
|
+
- [Client API](./client.md) - Client initialization and usage
|
|
423
|
+
- [Configuration Reference](./configuration.md) - Detailed config options
|
|
424
|
+
- [Injection Methods](./injection-methods.md) - Component injection API
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# UI Helpers API
|
|
2
|
+
|
|
3
|
+
UI helper methods for creating cart buttons and displaying cart information.
|
|
4
|
+
|
|
5
|
+
## ui.cartButton()
|
|
6
|
+
|
|
7
|
+
Create a cart button in a specific container.
|
|
8
|
+
|
|
9
|
+
### Signature
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
cartButton(containerId: string, showItemsCount?: boolean): void
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Required | Description |
|
|
18
|
+
|-----------|------|----------|-------------|
|
|
19
|
+
| `containerId` | string | Yes | ID of container element |
|
|
20
|
+
| `showItemsCount` | boolean | No | Show item count badge (default: false) |
|
|
21
|
+
|
|
22
|
+
### Example
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
// Simple cart button
|
|
26
|
+
window.LiquidCommerce.elements.ui.cartButton('header-cart');
|
|
27
|
+
|
|
28
|
+
// Cart button with item count badge
|
|
29
|
+
window.LiquidCommerce.elements.ui.cartButton('header-cart', true);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## ui.floatingCartButton()
|
|
35
|
+
|
|
36
|
+
Create a floating cart button (bottom-right corner).
|
|
37
|
+
|
|
38
|
+
### Signature
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
floatingCartButton(showItemsCount?: boolean): void
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Parameters
|
|
45
|
+
|
|
46
|
+
| Parameter | Type | Required | Description |
|
|
47
|
+
|-----------|------|----------|-------------|
|
|
48
|
+
| `showItemsCount` | boolean | No | Show item count badge (default: false) |
|
|
49
|
+
|
|
50
|
+
### Example
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
// Floating button without badge
|
|
54
|
+
window.LiquidCommerce.elements.ui.floatingCartButton();
|
|
55
|
+
|
|
56
|
+
// Floating button with badge
|
|
57
|
+
window.LiquidCommerce.elements.ui.floatingCartButton(true);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## ui.cartSubtotal()
|
|
63
|
+
|
|
64
|
+
Display cart subtotal in an element.
|
|
65
|
+
|
|
66
|
+
### Signature
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
cartSubtotal(elementId: string): void
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Parameters
|
|
73
|
+
|
|
74
|
+
| Parameter | Type | Required | Description |
|
|
75
|
+
|-----------|------|----------|-------------|
|
|
76
|
+
| `elementId` | string | Yes | ID of element to update |
|
|
77
|
+
|
|
78
|
+
### Example
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<div>Total: <span id="cart-total"></span></div>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
85
|
+
window.LiquidCommerce.elements.ui.cartSubtotal('cart-total');
|
|
86
|
+
// Element now shows: "$49.99"
|
|
87
|
+
// Updates automatically when cart changes
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## ui.cartItemsCount()
|
|
93
|
+
|
|
94
|
+
Display number of items in cart.
|
|
95
|
+
|
|
96
|
+
### Signature
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
cartItemsCount(elementId: string, options?: { hideZero: boolean }): void
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Parameters
|
|
103
|
+
|
|
104
|
+
| Parameter | Type | Required | Description |
|
|
105
|
+
|-----------|------|----------|-------------|
|
|
106
|
+
| `elementId` | string | Yes | ID of element to update |
|
|
107
|
+
| `options.hideZero` | boolean | No | Hide when cart is empty (default: true) |
|
|
108
|
+
|
|
109
|
+
### Example
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<div>Cart (<span id="items-count"></span>)</div>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```javascript
|
|
116
|
+
// Hide when cart is empty
|
|
117
|
+
window.LiquidCommerce.elements.ui.cartItemsCount('items-count', { hideZero: true });
|
|
118
|
+
|
|
119
|
+
// Always show count (even "0")
|
|
120
|
+
window.LiquidCommerce.elements.ui.cartItemsCount('items-count', { hideZero: false });
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Use Cases
|
|
124
|
+
|
|
125
|
+
### Header Cart Button
|
|
126
|
+
|
|
127
|
+
```html
|
|
128
|
+
<header>
|
|
129
|
+
<nav>
|
|
130
|
+
<a href="/">Home</a>
|
|
131
|
+
<a href="/products">Products</a>
|
|
132
|
+
<div id="cart-btn"></div>
|
|
133
|
+
</nav>
|
|
134
|
+
</header>
|
|
135
|
+
|
|
136
|
+
<script>
|
|
137
|
+
window.addEventListener('lce:actions.client_ready', () => {
|
|
138
|
+
window.LiquidCommerce.elements.ui.cartButton('cart-btn', true);
|
|
139
|
+
}, { once: true });
|
|
140
|
+
</script>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Cart Summary Widget
|
|
144
|
+
|
|
145
|
+
```html
|
|
146
|
+
<aside class="cart-summary">
|
|
147
|
+
<h3>Your Cart</h3>
|
|
148
|
+
<p>Items: <span id="item-count"></span></p>
|
|
149
|
+
<p>Total: <span id="cart-total"></span></p>
|
|
150
|
+
</aside>
|
|
151
|
+
|
|
152
|
+
<script>
|
|
153
|
+
window.addEventListener('lce:actions.client_ready', () => {
|
|
154
|
+
window.LiquidCommerce.elements.ui.cartItemsCount('item-count');
|
|
155
|
+
window.LiquidCommerce.elements.ui.cartSubtotal('cart-total');
|
|
156
|
+
}, { once: true });
|
|
157
|
+
</script>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Floating Cart for Mobile
|
|
161
|
+
|
|
162
|
+
```javascript
|
|
163
|
+
// Show floating button only on mobile
|
|
164
|
+
if (window.innerWidth < 768) {
|
|
165
|
+
window.LiquidCommerce.elements.ui.floatingCartButton(true);
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Styling
|
|
170
|
+
|
|
171
|
+
Cart buttons and UI elements can be styled with CSS:
|
|
172
|
+
|
|
173
|
+
```css
|
|
174
|
+
/* Cart button container */
|
|
175
|
+
.lce-cart-desktop-button-container {
|
|
176
|
+
/* Your styles */
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Cart items count */
|
|
180
|
+
.lce-cart-items-count {
|
|
181
|
+
font-weight: bold;
|
|
182
|
+
color: #007bff;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* When cart is empty */
|
|
186
|
+
.lce-cart-items-count.no-items {
|
|
187
|
+
opacity: 0.5;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Cart subtotal */
|
|
191
|
+
.lce-cart-subtotal {
|
|
192
|
+
font-size: 1.2em;
|
|
193
|
+
font-weight: bold;
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## See Also
|
|
198
|
+
|
|
199
|
+
- [Cart Component Guide](../guides/cart-component.md)
|
|
200
|
+
- [Cart Actions](./actions/cart-actions.md)
|