@mobielnl/elements 0.13.3 → 0.13.5
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/elements.css +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.umd.cjs +181 -126
- package/dist/{index-DqXrmLgh.js → index-CrTnLElc.js} +10225 -9981
- package/dist/{index-Hz7Cp6-d.js → index-D5K8YEVP.js} +1 -1
- package/dist/index.d.ts +60 -9
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { n as ne, i as Ot, a as z, m as ie, r as $e, h as je, b as Ft, w as se, c as Te, d as Ce, e as qe, f as de, g as De, t as L, j as Rt, k as H, l as E, o as $, p as Kt, s as R, v as Lt, M as j, W as ze, q as xe, N as Et, u as Bt, x as Gt, y as Nt, z as Ht, K as Xe, A as _t, B as Ae, C as Wt, D as Ut, E as $t, F as jt, G as Ye, H as qt, I as zt, J as Xt, L as Pe, O as ke, P as Y, Q as Ie, R as Yt, V as Zt, S as Jt, T as Qt, U as en, X as tn, Y as nn, Z as Ze, _ as sn, $ as rn, a0 as on, a1 as an, a2 as cn, a3 as Je, a4 as Qe, a5 as et, a6 as tt, a7 as ln } from "./index-
|
|
2
|
+
import { n as ne, i as Ot, a as z, m as ie, r as $e, h as je, b as Ft, w as se, c as Te, d as Ce, e as qe, f as de, g as De, t as L, j as Rt, k as H, l as E, o as $, p as Kt, s as R, v as Lt, M as j, W as ze, q as xe, N as Et, u as Bt, x as Gt, y as Nt, z as Ht, K as Xe, A as _t, B as Ae, C as Wt, D as Ut, E as $t, F as jt, G as Ye, H as qt, I as zt, J as Xt, L as Pe, O as ke, P as Y, Q as Ie, R as Yt, V as Zt, S as Jt, T as Qt, U as en, X as tn, Y as nn, Z as Ze, _ as sn, $ as rn, a0 as on, a1 as an, a2 as cn, a3 as Je, a4 as Qe, a5 as et, a6 as tt, a7 as ln } from "./index-CrTnLElc.js";
|
|
3
3
|
import { Fragment as un } from "react";
|
|
4
4
|
var It = typeof globalThis < "u" && globalThis.process ? globalThis.process : { env: { NODE_ENV: "production" } };
|
|
5
5
|
const re = (...t) => t.reduce((e, n) => (i) => n(e(i))), nt = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -180,6 +180,19 @@ declare type BundleSelectorClassNames = {
|
|
|
180
180
|
bundleTypeSetRadioGroup?: RadioGroupClassNames;
|
|
181
181
|
/** Bundle type set checkbox group class styling slots (used when `multiSelect` is true) - see type `CheckboxGroupClassNames` */
|
|
182
182
|
bundleTypeSetCheckboxGroup?: CheckboxGroupClassNames;
|
|
183
|
+
/** Collapsed bundle summary card (shown for names in `collapsibleBundleTypeSets` after a selection) */
|
|
184
|
+
collapsedBundleSet?: {
|
|
185
|
+
/** Clickable card wrapper */
|
|
186
|
+
base?: string;
|
|
187
|
+
/** Wrapper around the selected bundle image */
|
|
188
|
+
imageWrapper?: string;
|
|
189
|
+
/** Selected bundle image */
|
|
190
|
+
image?: string;
|
|
191
|
+
/** Selected bundle set name */
|
|
192
|
+
title?: string;
|
|
193
|
+
/** Edit icon */
|
|
194
|
+
icon?: string;
|
|
195
|
+
};
|
|
183
196
|
};
|
|
184
197
|
|
|
185
198
|
export declare type BundleSet = BundleTypeSet['bundleSets'][number];
|
|
@@ -691,6 +704,18 @@ declare type GeneralClassNames = {
|
|
|
691
704
|
base?: string;
|
|
692
705
|
} & SectionClassNames;
|
|
693
706
|
|
|
707
|
+
export declare type GiftConfig = {
|
|
708
|
+
/** Initial bundle set unit key used to find an available fixed proposition
|
|
709
|
+
* @example '1636-11788' */
|
|
710
|
+
initialBundleSetUnitKey: string;
|
|
711
|
+
/** Optional fixed provider slug to narrow the gift proposition search
|
|
712
|
+
* @example 'odido' */
|
|
713
|
+
fixedProviderSlug?: string;
|
|
714
|
+
/** Custom ReactNode content shown when no matching fixed proposition is found for the `initialBundleSetUnitKey` and address
|
|
715
|
+
* @note This will override the default not found state */
|
|
716
|
+
notFoundState?: ReactNode;
|
|
717
|
+
};
|
|
718
|
+
|
|
694
719
|
/**
|
|
695
720
|
* ClassNames for styling different parts of the `HandsetCreditSelector` component
|
|
696
721
|
*/
|
|
@@ -1845,7 +1870,7 @@ declare type PropositionOverviewClassNames = {
|
|
|
1845
1870
|
creditInfo?: CreditInfoClassNames_2;
|
|
1846
1871
|
};
|
|
1847
1872
|
|
|
1848
|
-
export declare function PropositionSelector({ propositionKey, classNames, initialProfile, onProfileChange, onPropositionKeyChange, onError, onAction, ...props }: PropositionSelectorProps): JSX.Element;
|
|
1873
|
+
export declare function PropositionSelector({ propositionKey, giftConfig, classNames, initialProfile, onProfileChange, onPropositionKeyChange, onError, onAction, ...props }: PropositionSelectorProps): JSX.Element;
|
|
1849
1874
|
|
|
1850
1875
|
/**
|
|
1851
1876
|
* ClassNames for styling different parts of the `PropositionSelector` component
|
|
@@ -1858,6 +1883,9 @@ export declare type PropositionSelectorClassNames = {
|
|
|
1858
1883
|
/** Alert class styling slots - see type `AlertClassNames`
|
|
1859
1884
|
* @note only visible for fixed propositions with the same fixed provider in profile */
|
|
1860
1885
|
sameFixedProviderAlert?: AlertClassNames;
|
|
1886
|
+
/** Alert class styling slots - see type `AlertClassNames`
|
|
1887
|
+
* @note only visible when `giftConfig.initialBundleSetUnitKey` prop returns no matching fixed proposition for the address */
|
|
1888
|
+
noMatchingPropositionAlert?: AlertClassNames;
|
|
1861
1889
|
/** ProductHeader class styling slots - see type `ProductHeaderClassNames` */
|
|
1862
1890
|
productHeader?: ProductHeaderClassNames;
|
|
1863
1891
|
/** StickySummary component class styling slots - see type `StickySummaryClassNames` */
|
|
@@ -1932,11 +1960,7 @@ export declare type PropositionSelectorClassNames = {
|
|
|
1932
1960
|
};
|
|
1933
1961
|
};
|
|
1934
1962
|
|
|
1935
|
-
export declare type PropositionSelectorProps = {
|
|
1936
|
-
/** Initial proposition key
|
|
1937
|
-
* @example
|
|
1938
|
-
* '1412-10116|1413-10646|plv-398' */
|
|
1939
|
-
propositionKey: string;
|
|
1963
|
+
export declare type PropositionSelectorProps = RequiredProps & {
|
|
1940
1964
|
/** Class slots for styling */
|
|
1941
1965
|
classNames?: PropositionSelectorClassNames;
|
|
1942
1966
|
/** Initial user profile */
|
|
@@ -1945,6 +1969,8 @@ export declare type PropositionSelectorProps = {
|
|
|
1945
1969
|
* @default "cart"
|
|
1946
1970
|
* @note `"upsell"`: only smartphone propositions have upsell options, other propositions will redirect to the cart */
|
|
1947
1971
|
clickOutTarget?: 'cart' | 'upsell' | 'checkout';
|
|
1972
|
+
/** Custom loading UI ReactNode content shown during postcode check, proposition search and data fetch */
|
|
1973
|
+
loadingState?: ReactNode;
|
|
1948
1974
|
/** Custom ReactNode content below the CTA card component
|
|
1949
1975
|
*
|
|
1950
1976
|
* @note Desktop: Content will be displayed below the CTA card component in the sidebar/second column
|
|
@@ -1952,6 +1978,17 @@ export declare type PropositionSelectorProps = {
|
|
|
1952
1978
|
* @default null
|
|
1953
1979
|
*/
|
|
1954
1980
|
contentBelowCTA?: ReactNode;
|
|
1981
|
+
/** Boolean to hide number retention question when profile if filled. Does not apply to fixed propositions */
|
|
1982
|
+
hideRetentionOnFilledProfile?: boolean;
|
|
1983
|
+
/**
|
|
1984
|
+
* Collapse designated bundle type set options; only displays selected bundle option with edit icon
|
|
1985
|
+
*
|
|
1986
|
+
* Matching is exact on `bundleTypeSet.name`. Bundle type sets that are not listed keep their existing expanded selection UI.
|
|
1987
|
+
*
|
|
1988
|
+
* @note Only applicable for radio button bundle type sets (single selection).
|
|
1989
|
+
*
|
|
1990
|
+
* @example collapsibleBundleTypeSets={['Kies je welkomstcadeau']} */
|
|
1991
|
+
collapsibleBundleTypeSets?: string[];
|
|
1955
1992
|
/** Callback function to handle proposition key changes */
|
|
1956
1993
|
onPropositionKeyChange?: (propositionKey: string) => void;
|
|
1957
1994
|
/** Callback function to handle profile changes */
|
|
@@ -1960,7 +1997,8 @@ export declare type PropositionSelectorProps = {
|
|
|
1960
1997
|
addClickoutSearchParams?: (searchParams: URLSearchParams) => URLSearchParams;
|
|
1961
1998
|
/** Callback function called when an error occurs */
|
|
1962
1999
|
onError?: (error: Error) => void;
|
|
1963
|
-
/** Callback function to handle return click
|
|
2000
|
+
/** Callback function to handle return click
|
|
2001
|
+
* @note The return link will not be displayed if this function is not provided */
|
|
1964
2002
|
onReturnClick?: () => void;
|
|
1965
2003
|
/**
|
|
1966
2004
|
* Callback function fired when user actions occur.
|
|
@@ -2001,8 +2039,6 @@ export declare type PropositionSelectorProps = {
|
|
|
2001
2039
|
* }}
|
|
2002
2040
|
*/
|
|
2003
2041
|
onRender?: () => void;
|
|
2004
|
-
/** Boolean to hide number retention question when profile if filled. Does not apply to fixed propositions */
|
|
2005
|
-
hideRetentionOnFilledProfile?: boolean;
|
|
2006
2042
|
};
|
|
2007
2043
|
|
|
2008
2044
|
declare type PropositionSelectorQuery = {
|
|
@@ -2180,6 +2216,19 @@ declare type RadioGroupClassNames = {
|
|
|
2180
2216
|
};
|
|
2181
2217
|
};
|
|
2182
2218
|
|
|
2219
|
+
declare type RequiredProps = {
|
|
2220
|
+
/** Initial proposition key
|
|
2221
|
+
* @example '1412-10116|1413-10646|plv-398'
|
|
2222
|
+
* @note Required unless `giftConfig` is provided with a valid address in `initialProfile` */
|
|
2223
|
+
propositionKey: string;
|
|
2224
|
+
giftConfig?: never;
|
|
2225
|
+
} | {
|
|
2226
|
+
propositionKey?: never;
|
|
2227
|
+
/** Configuration for pre-selected gift bundle set unit key and provider used to find an available fixed proposition
|
|
2228
|
+
* @note Cannot be used together with `propositionKey` prop. Only applicable for fixed propositions */
|
|
2229
|
+
giftConfig: GiftConfig;
|
|
2230
|
+
};
|
|
2231
|
+
|
|
2183
2232
|
declare type ResultsClassNames = {
|
|
2184
2233
|
/** Title above top propositions (only shown when `showTopPropositions` is set to `true`)
|
|
2185
2234
|
* @example "Beste providers voor jou" */
|
|
@@ -2799,6 +2848,8 @@ export declare type Translations = {
|
|
|
2799
2848
|
return: string;
|
|
2800
2849
|
sameFixedProviderTitle: string;
|
|
2801
2850
|
sameFixedProviderDescription: string;
|
|
2851
|
+
noMatchingPropositionTitle: string;
|
|
2852
|
+
noMatchingPropositionDescription: string;
|
|
2802
2853
|
productVersionTitle: string;
|
|
2803
2854
|
benefitsTitle: string;
|
|
2804
2855
|
moreBundleInfo: string;
|