@mobielnl/elements 0.13.4 → 0.13.6

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.
@@ -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-CxWRyhe0.js";
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-C93P8_P-.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];
@@ -686,11 +699,29 @@ export declare type FixedBlock = {
686
699
  };
687
700
  };
688
701
 
702
+ export declare type FixedProviderSlug = Extract<ProviderSlug, 'kpn' | 'ziggo' | 'odido' | 'delta' | 'budget' | 'youfone'>;
703
+
689
704
  declare type GeneralClassNames = {
690
705
  /** The base slot of the general section, it is the container of the general section */
691
706
  base?: string;
692
707
  } & SectionClassNames;
693
708
 
709
+ export declare type GiftConfig = {
710
+ /** Initial bundle set unit key used to find an available fixed proposition
711
+ * @example '1636-11788' */
712
+ initialBundleSetUnitKey: string;
713
+ /** Optional fixed provider slug to narrow the gift proposition search to only one fixed provider
714
+ * @example 'odido' */
715
+ fixedProviderSlug?: FixedProviderSlug;
716
+ /** Locks customer benefit (klantvoordeel) to a single mobile provider. Skips the CombiDeal modal and
717
+ * mobile provider picker. Yes/No only asks whether the visitor is already a mobile customer of this provider.
718
+ * @example 'odido' */
719
+ mobileProviderSlug?: MobileProviderSlug;
720
+ /** Custom ReactNode content shown when no matching fixed proposition is found for the `initialBundleSetUnitKey` and address
721
+ * @note This will override the default not found state */
722
+ notFoundState?: ReactNode;
723
+ };
724
+
694
725
  /**
695
726
  * ClassNames for styling different parts of the `HandsetCreditSelector` component
696
727
  */
@@ -802,6 +833,8 @@ declare type MainImageClassNames = {
802
833
  };
803
834
  };
804
835
 
836
+ export declare type MobileProviderSlug = Extract<ProviderSlug, 'odido' | 'vodafone' | 'kpn' | 'hollandsnieuwe' | 'ben' | 'simyo' | 'budget' | 'youfone' | 'delta'>;
837
+
805
838
  declare type ModalClassNames = {
806
839
  /** The backdrop slot, it is displayed behind the modal */
807
840
  backdrop?: string;
@@ -1845,7 +1878,7 @@ declare type PropositionOverviewClassNames = {
1845
1878
  creditInfo?: CreditInfoClassNames_2;
1846
1879
  };
1847
1880
 
1848
- export declare function PropositionSelector({ propositionKey, classNames, initialProfile, onProfileChange, onPropositionKeyChange, onError, onAction, ...props }: PropositionSelectorProps): JSX.Element;
1881
+ export declare function PropositionSelector({ propositionKey, giftConfig, classNames, initialProfile, onProfileChange, onPropositionKeyChange, onError, onAction, ...props }: PropositionSelectorProps): JSX.Element;
1849
1882
 
1850
1883
  /**
1851
1884
  * ClassNames for styling different parts of the `PropositionSelector` component
@@ -1858,6 +1891,9 @@ export declare type PropositionSelectorClassNames = {
1858
1891
  /** Alert class styling slots - see type `AlertClassNames`
1859
1892
  * @note only visible for fixed propositions with the same fixed provider in profile */
1860
1893
  sameFixedProviderAlert?: AlertClassNames;
1894
+ /** Alert class styling slots - see type `AlertClassNames`
1895
+ * @note only visible when `giftConfig.initialBundleSetUnitKey` prop returns no matching fixed proposition for the address */
1896
+ noMatchingPropositionAlert?: AlertClassNames;
1861
1897
  /** ProductHeader class styling slots - see type `ProductHeaderClassNames` */
1862
1898
  productHeader?: ProductHeaderClassNames;
1863
1899
  /** StickySummary component class styling slots - see type `StickySummaryClassNames` */
@@ -1932,11 +1968,7 @@ export declare type PropositionSelectorClassNames = {
1932
1968
  };
1933
1969
  };
1934
1970
 
1935
- export declare type PropositionSelectorProps = {
1936
- /** Initial proposition key
1937
- * @example
1938
- * '1412-10116|1413-10646|plv-398' */
1939
- propositionKey: string;
1971
+ export declare type PropositionSelectorProps = RequiredProps & {
1940
1972
  /** Class slots for styling */
1941
1973
  classNames?: PropositionSelectorClassNames;
1942
1974
  /** Initial user profile */
@@ -1945,6 +1977,8 @@ export declare type PropositionSelectorProps = {
1945
1977
  * @default "cart"
1946
1978
  * @note `"upsell"`: only smartphone propositions have upsell options, other propositions will redirect to the cart */
1947
1979
  clickOutTarget?: 'cart' | 'upsell' | 'checkout';
1980
+ /** Custom loading UI ReactNode content shown during postcode check, proposition search and data fetch */
1981
+ loadingState?: ReactNode;
1948
1982
  /** Custom ReactNode content below the CTA card component
1949
1983
  *
1950
1984
  * @note Desktop: Content will be displayed below the CTA card component in the sidebar/second column
@@ -1952,6 +1986,17 @@ export declare type PropositionSelectorProps = {
1952
1986
  * @default null
1953
1987
  */
1954
1988
  contentBelowCTA?: ReactNode;
1989
+ /** Boolean to hide number retention question when profile if filled. Does not apply to fixed propositions */
1990
+ hideRetentionOnFilledProfile?: boolean;
1991
+ /**
1992
+ * Collapse designated bundle type set options; only displays selected bundle option with edit icon
1993
+ *
1994
+ * Matching is exact on `bundleTypeSet.name`. Bundle type sets that are not listed keep their existing expanded selection UI.
1995
+ *
1996
+ * @note Only applicable for radio button bundle type sets (single selection).
1997
+ *
1998
+ * @example collapsibleBundleTypeSets={['Kies je welkomstcadeau']} */
1999
+ collapsibleBundleTypeSets?: string[];
1955
2000
  /** Callback function to handle proposition key changes */
1956
2001
  onPropositionKeyChange?: (propositionKey: string) => void;
1957
2002
  /** Callback function to handle profile changes */
@@ -2002,8 +2047,6 @@ export declare type PropositionSelectorProps = {
2002
2047
  * }}
2003
2048
  */
2004
2049
  onRender?: () => void;
2005
- /** Boolean to hide number retention question when profile if filled. Does not apply to fixed propositions */
2006
- hideRetentionOnFilledProfile?: boolean;
2007
2050
  };
2008
2051
 
2009
2052
  declare type PropositionSelectorQuery = {
@@ -2097,6 +2140,8 @@ declare type PropositionSelectorQuery = {
2097
2140
  } | null;
2098
2141
  };
2099
2142
 
2143
+ export declare type ProviderName = Providers[ProviderSlug];
2144
+
2100
2145
  export declare type ProviderOption = {
2101
2146
  slug: string;
2102
2147
  name: string;
@@ -2104,7 +2149,29 @@ export declare type ProviderOption = {
2104
2149
  Icon?: ElementType;
2105
2150
  };
2106
2151
 
2107
- export declare const PROVIDERS: Record<string, string>;
2152
+ export declare const PROVIDERS: {
2153
+ readonly odido: "Odido";
2154
+ readonly kpn: "KPN";
2155
+ readonly vodafone: "Vodafone";
2156
+ readonly ben: "Ben";
2157
+ readonly hollandsnieuwe: "hollandsnieuwe";
2158
+ readonly lebara: "Lebara";
2159
+ readonly youfone: "Youfone";
2160
+ readonly simyo: "Simyo";
2161
+ readonly delta: "Delta";
2162
+ readonly caiway: "Caiway";
2163
+ readonly budget: "Budget Mobiel";
2164
+ readonly 'budget-alles-in-1': "Budget Alles-in-1";
2165
+ readonly 'budget-internet': "Budget Internet";
2166
+ readonly '50plusmobiel': "50+ Mobiel";
2167
+ readonly ziggo: "Ziggo";
2168
+ readonly other: "Andere / geen provider";
2169
+ readonly 'other/moving': "Geen i.v.m. verhuizing";
2170
+ };
2171
+
2172
+ declare type Providers = typeof PROVIDERS;
2173
+
2174
+ export declare type ProviderSlug = keyof Providers;
2108
2175
 
2109
2176
  /**
2110
2177
  * ClassNames for styling different parts of the `RadioFilter` component
@@ -2181,6 +2248,19 @@ declare type RadioGroupClassNames = {
2181
2248
  };
2182
2249
  };
2183
2250
 
2251
+ declare type RequiredProps = {
2252
+ /** Initial proposition key
2253
+ * @example '1412-10116|1413-10646|plv-398'
2254
+ * @note Required unless `giftConfig` is provided with a valid address in `initialProfile` */
2255
+ propositionKey: string;
2256
+ giftConfig?: never;
2257
+ } | {
2258
+ propositionKey?: never;
2259
+ /** Configuration for pre-selected gift bundle set unit key and provider used to find an available fixed proposition
2260
+ * @note Cannot be used together with `propositionKey` prop. Only applicable for fixed propositions */
2261
+ giftConfig: GiftConfig;
2262
+ };
2263
+
2184
2264
  declare type ResultsClassNames = {
2185
2265
  /** Title above top propositions (only shown when `showTopPropositions` is set to `true`)
2186
2266
  * @example "Beste providers voor jou" */
@@ -2800,6 +2880,8 @@ export declare type Translations = {
2800
2880
  return: string;
2801
2881
  sameFixedProviderTitle: string;
2802
2882
  sameFixedProviderDescription: string;
2883
+ noMatchingPropositionTitle: string;
2884
+ noMatchingPropositionDescription: string;
2803
2885
  productVersionTitle: string;
2804
2886
  benefitsTitle: string;
2805
2887
  moreBundleInfo: string;
@@ -2821,6 +2903,7 @@ export declare type Translations = {
2821
2903
  modificationTitle: string;
2822
2904
  modificationDescription: string;
2823
2905
  modificationFixedDescription: string;
2906
+ modificationLockedDescription: string;
2824
2907
  modificationYes: string;
2825
2908
  modificationNo: string;
2826
2909
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobielnl/elements",
3
- "version": "0.13.4",
3
+ "version": "0.13.6",
4
4
  "description": "Mobiel.nl Elements - React component library for partner websites",
5
5
  "private": false,
6
6
  "type": "module",