@mobielnl/elements 0.12.11 → 0.12.13

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 j, i as N, m as Z, r as ze, h as qe, a as Lt, w as Q, b as pe, c as Ce, d as Xe, e as oe, f as Pe, t as O, g as Nt, j as G, v as Gt, k as $, M as H, K as Ye, l as $t, o as Ht, p as ge, q as Wt, s as _t, u as jt, x as Je, y as Ut, z as zt, A as qt, B as ke, C as Fe, D as z, E as Oe, F as Xt, V as Yt, G as Jt, H as Zt, I as Qt, J as en, L as tn, N as Ze, O as nn, P as sn, Q as rn, R as an, S as on, T as Qe, U as et, W as tt, X as nt, Y as ln } from "./index-DZOjiJEi.js";
2
+ import { n as j, i as N, m as Z, r as ze, h as qe, a as Lt, w as Q, b as pe, c as Ce, d as Xe, e as oe, f as Pe, t as O, g as Nt, j as G, v as Gt, k as $, M as H, K as Ye, l as $t, o as Ht, p as ge, q as Wt, s as _t, u as jt, x as Je, y as Ut, z as zt, A as qt, B as ke, C as Fe, D as z, E as Oe, F as Xt, V as Yt, G as Jt, H as Zt, I as Qt, J as en, L as tn, N as Ze, O as nn, P as sn, Q as rn, R as an, S as on, T as Qe, U as et, W as tt, X as nt, Y as ln } from "./index-D9WG7ZWU.js";
3
3
  import { Fragment as un } from "react";
4
4
  var Bt = typeof globalThis < "u" && globalThis.process ? globalThis.process : { env: { NODE_ENV: "production" } };
5
5
  // @__NO_SIDE_EFFECTS__
@@ -502,7 +502,7 @@ class we extends Se {
502
502
  if (f) {
503
503
  const g = Math.min(this.currentTime, s) / a;
504
504
  let D = Math.floor(g), C = g % 1;
505
- !C && g >= 1 && (C = 1), C === 1 && D--, D = Math.min(D, f + 1), !!(D % 2) && (h === "reverse" ? (C = 1 - C, p && (C -= p / a)) : h === "mirror" && (M = o)), b = $(0, 1, C) * a;
505
+ !C && g >= 1 && (C = 1), C === 1 && D--, D = Math.min(D, f + 1), D % 2 && (h === "reverse" ? (C = 1 - C, p && (C -= p / a)) : h === "mirror" && (M = o)), b = $(0, 1, C) * a;
506
506
  }
507
507
  const m = A ? { done: !1, value: u[0] } : M.next(b);
508
508
  r && (m.value = r(m.value));
package/dist/index.d.ts CHANGED
@@ -23,6 +23,13 @@ declare const addressSchema: z.ZodObject<{
23
23
  city: z.ZodString;
24
24
  }, z.core.$strip>;
25
25
 
26
+ /** Event fired when the add-to-cart CTA is clicked */
27
+ export declare type AddToCartEvent = {
28
+ type: 'add_to_cart';
29
+ /** The full proposition data */
30
+ proposition: ProductCardPropositionFragment;
31
+ };
32
+
26
33
  declare type AverageSectionClassNames = {
27
34
  /** Container for the average per month section */
28
35
  container?: string;
@@ -81,6 +88,84 @@ export declare type Block = {
81
88
  amount: number;
82
89
  };
83
90
 
91
+ /**
92
+ * ClassNames for styling different parts of the `BundleModal` component
93
+ */
94
+ declare type BundleModalClassNames = {
95
+ /** The backdrop slot, it is displayed behind the modal */
96
+ backdrop?: string;
97
+ /** The wrapper slot of the modal. It wraps the base and the backdrop slots */
98
+ wrapper?: string;
99
+ /** The main slot of the modal content */
100
+ base?: string;
101
+ /** The header of the modal, it is displayed at the top of the modal */
102
+ header?: string;
103
+ /** The body of the modal, it is displayed in the middle of the modal */
104
+ body?: string;
105
+ /** The footer of the modal, it is displayed at the bottom of the modal */
106
+ footer?: string;
107
+ /** The close button (X) of the modal in top-right corner */
108
+ closeButton?: string;
109
+ };
110
+
111
+ /**
112
+ * ClassNames for styling different parts of the `BundleSelector` component
113
+ */
114
+ declare type BundleSelectorClassNames = {
115
+ /** Root container wrapping all bundle sections */
116
+ base?: string;
117
+ /** Container wrapping the contract term heading and radio group */
118
+ contractTermGroup?: string;
119
+ /** Contract term section heading */
120
+ contractTermLabel?: string;
121
+ /** Contract term radio group class styling slots - see type `RadioGroupClassNames` */
122
+ contractTermRadioGroup?: RadioGroupClassNames;
123
+ /** Container wrapping each bundle type set heading and its radio/checkbox group */
124
+ bundleTypeSetGroup?: string;
125
+ /** Bundle type set section heading */
126
+ bundleTypeSetLabel?: string;
127
+ /** Bundle type set radio group class styling slots (used when `multiSelect` is false) - see type `RadioGroupClassNames` */
128
+ bundleTypeSetRadioGroup?: RadioGroupClassNames;
129
+ /** Bundle type set checkbox group class styling slots (used when `multiSelect` is true) - see type `CheckboxGroupClassNames` */
130
+ bundleTypeSetCheckboxGroup?: CheckboxGroupClassNames;
131
+ };
132
+
133
+ /**
134
+ * ClassNames for styling different parts of the `Carousel` component
135
+ */
136
+ declare type CarouselClassNames = {
137
+ /** Root container */
138
+ base?: string;
139
+ /** Image */
140
+ image?: string;
141
+ /** Image wrapper */
142
+ imageWrapper?: string;
143
+ /** Thumbnail Card area */
144
+ thumbnailCard?: string;
145
+ /** Thumbnail Image */
146
+ thumbnailImage?: string;
147
+ /** Counter for hidden amount of thumbnails */
148
+ counter?: string;
149
+ /** Modal class names */
150
+ modal?: CarouselModalClassNames;
151
+ };
152
+
153
+ /**
154
+ * ClassNames for styling different parts of the `Carousel` component
155
+ */
156
+ declare type CarouselModalClassNames = {
157
+ /** Image */
158
+ image?: string;
159
+ /** Image wrapper */
160
+ imageWrapper?: string;
161
+ /** Thumbnail Card area */
162
+ thumbnailCard?: string;
163
+ /** Thumbnail Image */
164
+ thumbnailImage?: string;
165
+ /** Modal class names */
166
+ modal?: ModalClassNames_6;
167
+ };
168
+
84
169
  declare type ChannelsClassNames = {
85
170
  /** The base slot of the channels section, it is the container of the channels section */
86
171
  base?: string;
@@ -96,6 +181,32 @@ declare type ChannelsClassNames = {
96
181
  hdIcon?: string;
97
182
  };
98
183
 
184
+ declare type CheckboxGroupClassNames = {
185
+ /** Checkbox group root wrapper, it wraps the label and the wrapper */
186
+ base?: string;
187
+ /** Checkbox group wrapper, it wraps all checkboxes */
188
+ wrapper?: string;
189
+ /** Checkbox group label, it is placed before the wrapper */
190
+ label?: string;
191
+ /** The description of the checkbox group */
192
+ description?: string;
193
+ /** The error message of the checkbox group */
194
+ errorMessage?: string;
195
+ /** Individual checkboxes located within `checkboxGroup` */
196
+ checkbox?: {
197
+ /** Checkbox wrapper, it handles alignment, placement, and general appearance */
198
+ base?: string;
199
+ /** An inner container that includes styles for relative positioning, flex properties, overflow handling and managing hover and selected states */
200
+ wrapper?: string;
201
+ /** The hidden input element that is used to handle the checkbox state */
202
+ hiddenInput?: string;
203
+ /** Icon within the checkbox, controlling size, visibility, and changes when checked */
204
+ icon?: string;
205
+ /** The text associated with the checkbox */
206
+ label?: string;
207
+ };
208
+ };
209
+
99
210
  declare type CombiDealModalClassNames = {
100
211
  /** Modal dialog class styling slots - see type `ModalClassNames` */
101
212
  modal?: ModalClassNames_3;
@@ -713,6 +824,23 @@ declare type ModalClassNames_5 = {
713
824
  closeButton?: string;
714
825
  };
715
826
 
827
+ declare type ModalClassNames_6 = {
828
+ /** The backdrop slot, it is displayed behind the modal */
829
+ backdrop?: string;
830
+ /** The wrapper slot of the modal. It wraps the base and the backdrop slots */
831
+ wrapper?: string;
832
+ /** The main slot of the modal content */
833
+ base?: string;
834
+ /** The header of the modal, it is displayed at the top of the modal */
835
+ header?: string;
836
+ /** The body of the modal, it is displayed in the middle of the modal */
837
+ body?: string;
838
+ /** The footer of the modal, it is displayed at the bottom of the modal */
839
+ footer?: string;
840
+ /** The close button (X) of the modal in top-right corner */
841
+ closeButton?: string;
842
+ };
843
+
716
844
  declare type MonthlyFeeClassNames = {
717
845
  /** Container for the monthly fee row */
718
846
  container?: string;
@@ -809,6 +937,13 @@ declare type NumberPreservationModalClassNames = {
809
937
  /** Radio styling */
810
938
  radio?: string;
811
939
  };
940
+ /** Extra benefit section */
941
+ extraBenefit?: {
942
+ /** Extra benefit title styling */
943
+ title?: string;
944
+ /** Extra benefit description styling */
945
+ description?: string;
946
+ };
812
947
  /** Submit button styling */
813
948
  submitButton?: string;
814
949
  };
@@ -993,6 +1128,37 @@ declare type PricingClassNames = {
993
1128
  averagePriceValue?: string;
994
1129
  };
995
1130
 
1131
+ /**
1132
+ * ClassNames for styling the `Pricing` component within `PropositionCard`
1133
+ */
1134
+ declare type PricingClassNames_2 = {
1135
+ /** Wrapper container for the pricing section */
1136
+ wrapper?: string;
1137
+ /** Promotion text for monthly fee
1138
+ * @example "12 mnd van 10,- voor:" */
1139
+ promotionText?: string;
1140
+ /** Wrapper container for the monthly fee */
1141
+ monthlyFeeWrapper?: string;
1142
+ /** Monthly fee value text (price per month)
1143
+ * @example "10,-" */
1144
+ monthlyFeeValue?: string;
1145
+ /** Monthly fee label text
1146
+ /* @example "/ maand" */
1147
+ monthlyFeeLabel?: string;
1148
+ /** Product price text (one-time fee for phone)
1149
+ *
1150
+ * Only visible for Smartphone Propositions
1151
+ * @example "+ 100,- eenmalig" */
1152
+ oneTimeFee?: string;
1153
+ /** Wrapper container for the average price */
1154
+ averagePriceWrapper?: string;
1155
+ /** Average price Icon */
1156
+ averagePriceIcon?: string;
1157
+ /** Average price value text (TCO per month)
1158
+ * @example "gem. 54,- / maand" */
1159
+ averagePriceValue?: string;
1160
+ };
1161
+
996
1162
  declare type ProductCardPropositionFragment = {
997
1163
  __typename?: 'Proposition';
998
1164
  key: string;
@@ -1222,6 +1388,10 @@ declare type ProductHeaderClassNames = {
1222
1388
  productStockStatus?: NonNullable<MainImageClassNames['phoneImage']>['stockIndicator'];
1223
1389
  /** Proposition header class styling slots */
1224
1390
  propositionHeader?: PropositionHeaderClassNames;
1391
+ /** Carousel class styling slots (smartphone product images) - see type `CarouselClassNames` */
1392
+ carousel?: CarouselClassNames;
1393
+ /** PromotionList class styling slots (special promotions in header) - see type `PromotionListClassNames` */
1394
+ promotionList?: PromotionListClassNames;
1225
1395
  };
1226
1396
 
1227
1397
  export declare function ProductResults({ classNames, initialSelectedFilters, initialProfile, onProfileChange, onError, onAction, ...props }: ProductResultsProps): JSX.Element;
@@ -1436,7 +1606,9 @@ declare const profileSchema: z.ZodObject<{
1436
1606
  scope: z.ZodString;
1437
1607
  value: z.ZodString;
1438
1608
  }, z.core.$strip>>>;
1609
+ birthdate: z.ZodOptional<z.ZodString>;
1439
1610
  customerSegment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1611
+ customerSegmentUpdatedAt: z.ZodOptional<z.ZodString>;
1440
1612
  address: z.ZodOptional<z.ZodObject<{
1441
1613
  postcode: z.ZodString;
1442
1614
  number: z.ZodString;
@@ -1602,14 +1774,63 @@ declare type PropositionOverviewClassNames = {
1602
1774
  creditInfo?: CreditInfoClassNames_2;
1603
1775
  };
1604
1776
 
1605
- export declare function PropositionSelector({ propositionKey, classNames, initialProfile, onProfileChange, onError, ...props }: PropositionSelectorProps): JSX.Element;
1777
+ export declare function PropositionSelector({ propositionKey, classNames, initialProfile, onProfileChange, onError, onAction, ...props }: PropositionSelectorProps): JSX.Element;
1606
1778
 
1779
+ /**
1780
+ * ClassNames for styling different parts of the `PropositionSelector` component
1781
+ */
1607
1782
  export declare type PropositionSelectorClassNames = {
1783
+ /** Wrapper container for the entire proposition selector */
1608
1784
  base?: string;
1609
- /** HandsetCreditSelector component class styling slots */
1785
+ /** HandsetCreditSelector component class styling slots - see type `HandsetCreditSelectorClassNames` */
1610
1786
  handsetCreditSelector?: HandsetCreditSelectorClassNames;
1611
- /** ProductHeader class styling slots (base, productImage, providerImage, productStockStatus, propositionHeader) */
1787
+ /** ProductHeader class styling slots - see type `ProductHeaderClassNames` */
1612
1788
  productHeader?: ProductHeaderClassNames;
1789
+ /** StickySummary component class styling slots - see type `StickySummaryClassNames` */
1790
+ stickySummary?: StickySummaryClassNames;
1791
+ /** CostOverview component class styling slots (sticky sidebar card) - see type `CostOverviewClassNames` */
1792
+ costOverview?: CostOverviewClassNames;
1793
+ /** PromotionList component class styling slots (benefits section) - see type `PromotionListClassNames` */
1794
+ promotionList?: PromotionListClassNames;
1795
+ /** PropositionSpecifications class styling slots (bundle info section) */
1796
+ propositionSpecifications?: {
1797
+ /** Wrapper container for the specifications */
1798
+ wrapper?: string;
1799
+ /** Specification item */
1800
+ item?: string;
1801
+ /** Specification icon */
1802
+ icon?: string;
1803
+ };
1804
+ /** VersionSelect component class styling slots (smartphone product version selector) - see type `VersionSelectClassNames` */
1805
+ versionSelect?: VersionSelectClassNames;
1806
+ /** Extra costs section root container class */
1807
+ extraCosts?: string;
1808
+ /** Sidebar card containing the cost overview, CTA button and extra costs */
1809
+ sidebarCard?: {
1810
+ /** The Card wrapper element */
1811
+ base?: string;
1812
+ /** The "Totale kosten overzicht" title heading */
1813
+ title?: string;
1814
+ /** The add-to-cart CTA button */
1815
+ ctaButton?: string;
1816
+ };
1817
+ /** BundleSelector component class styling slots - see type `BundleSelectorClassNames` */
1818
+ bundleSelector?: BundleSelectorClassNames;
1819
+ /** BundleModal component class styling slots - see type `BundleModalClassNames` */
1820
+ bundleModal?: BundleModalClassNames;
1821
+ /** Profile buttons component class styling slots - see type `SelectorClassNames` */
1822
+ profileButton?: SelectorClassNames;
1823
+ /** Profile banner component class styling slots - see type `ProfileBannerClassNames` */
1824
+ profileBanner?: ProfileBannerClassNames;
1825
+ /** Error alert class styling slots - see type `ErrorAlertClassNames` */
1826
+ errorAlert?: ErrorAlertClassNames;
1827
+ /** Proposition results class styling slots (shared sub-keys with ProductResultsClassNames.results) */
1828
+ results?: {
1829
+ /** Details modal class styling slots - see type `DetailsModalClassNames` */
1830
+ detailsModal?: DetailsModalClassNames;
1831
+ /** Credit info class styling slots - see type `CreditInfoClassNames` */
1832
+ creditInfo?: CreditInfoClassNames_2;
1833
+ };
1613
1834
  };
1614
1835
 
1615
1836
  export declare type PropositionSelectorProps = {
@@ -1632,6 +1853,30 @@ export declare type PropositionSelectorProps = {
1632
1853
  onError?: (error: Error) => void;
1633
1854
  /** Callback function to handle return click */
1634
1855
  onReturnClick?: () => void;
1856
+ /**
1857
+ * Callback function fired when user actions occur.
1858
+ *
1859
+ * Events:
1860
+ * - `details_viewed`: User opened proposition details modal
1861
+ * - `add_to_cart`: User clicked the add-to-cart CTA
1862
+ * - `profile_changed`: User profile changed (includes from/to values)
1863
+ *
1864
+ * @example
1865
+ * onAction={(event) => {
1866
+ * switch(event.type) {
1867
+ * case 'details_viewed':
1868
+ * console.log(event.proposition, event.tab)
1869
+ * break
1870
+ * case 'add_to_cart':
1871
+ * console.log(event.proposition)
1872
+ * break
1873
+ * case 'profile_changed':
1874
+ * console.log(event.from, event.to)
1875
+ * break
1876
+ * }
1877
+ * }}
1878
+ */
1879
+ onAction?: (event: SelectorActionEvent) => void;
1635
1880
  };
1636
1881
 
1637
1882
  export declare type ProviderOption = {
@@ -1679,6 +1924,39 @@ declare type RadioFilterClassNames = {
1679
1924
  };
1680
1925
  };
1681
1926
 
1927
+ /**
1928
+ * ClassNames for styling different parts of the `RadioGroup` component
1929
+ */
1930
+ declare type RadioGroupClassNames = {
1931
+ /** Radio group root wrapper, it wraps the label and the wrapper */
1932
+ base?: string;
1933
+ /** Radio group wrapper, it wraps all radio items */
1934
+ wrapper?: string;
1935
+ /** Radio group label, it is placed before the wrapper */
1936
+ label?: string;
1937
+ /** Description slot for the radio group */
1938
+ description?: string;
1939
+ /** Error message slot for the radio group */
1940
+ errorMessage?: string;
1941
+ /** Individual radio items */
1942
+ radio?: {
1943
+ /** Radio root wrapper, it wraps all elements */
1944
+ base?: string;
1945
+ /** Radio wrapper, it wraps the control element */
1946
+ wrapper?: string;
1947
+ /** The hidden input element that is used to handle the radio state */
1948
+ hiddenInput?: string;
1949
+ /** Label and description wrapper */
1950
+ labelWrapper?: string;
1951
+ /** The label text associated with the radio */
1952
+ label?: string;
1953
+ /** Control element, it is the circle element */
1954
+ control?: string;
1955
+ /** Description slot for the radio */
1956
+ description?: string;
1957
+ };
1958
+ };
1959
+
1682
1960
  declare type ResultsClassNames = {
1683
1961
  /** Title above top propositions (only shown when `showTopPropositions` is set to `true`)
1684
1962
  * @example "Beste providers voor jou" */
@@ -1779,6 +2057,14 @@ declare type SelectFilterClassNames = {
1779
2057
  collapseLink?: string;
1780
2058
  };
1781
2059
 
2060
+ /**
2061
+ * Union type of all PropositionSelector action events.
2062
+ *
2063
+ * Re-uses `DetailsViewedEvent` and `ProfileChangedEvent` from `ProductResults`
2064
+ * since the shape is identical.
2065
+ */
2066
+ export declare type SelectorActionEvent = AddToCartEvent | DetailsViewedEvent | ProfileChangedEvent;
2067
+
1782
2068
  /**
1783
2069
  * ClassNames for styling different parts of the `Selector` component
1784
2070
  */
@@ -1867,6 +2153,16 @@ declare type SortSelectClassNames = {
1867
2153
  endWrapper?: string;
1868
2154
  };
1869
2155
 
2156
+ /**
2157
+ * ClassNames for styling different parts of the `Sticky` component
2158
+ */
2159
+ declare type StickySummaryClassNames = {
2160
+ /** Container */
2161
+ container?: string;
2162
+ /** Pricing section class styling slots - see type `PricingClassNames` */
2163
+ pricing?: PricingClassNames_2;
2164
+ };
2165
+
1870
2166
  declare type TableClassNames = {
1871
2167
  /** Defines a flexible column layout and relative positioning for the table component */
1872
2168
  base?: string;
@@ -1948,6 +2244,12 @@ export declare type Translations = {
1948
2244
  subscription: string;
1949
2245
  prepaid: string;
1950
2246
  otherProvider: string;
2247
+ question: string;
2248
+ yes: string;
2249
+ no: string;
2250
+ invalidBirthdate: string;
2251
+ extraBenefitTitle: string;
2252
+ extraBenefitDescription: string;
1951
2253
  };
1952
2254
  combiDeal: {
1953
2255
  title: string;
@@ -1962,6 +2264,7 @@ export declare type Translations = {
1962
2264
  movingOption: string;
1963
2265
  otherProvider: string;
1964
2266
  question: string;
2267
+ questionOtherSubscriptions: string;
1965
2268
  yes: string;
1966
2269
  no: string;
1967
2270
  };
@@ -2281,4 +2584,25 @@ export declare type Translations = {
2281
2584
  };
2282
2585
  };
2283
2586
 
2587
+ declare type VersionSelectClassNames = {
2588
+ description?: string;
2589
+ errorMessage?: string;
2590
+ label?: string;
2591
+ base?: string;
2592
+ cardBody?: string;
2593
+ value?: string;
2594
+ selectorIcon?: string;
2595
+ endContent?: string;
2596
+ trigger?: string;
2597
+ mainWrapper?: string;
2598
+ innerWrapper?: string;
2599
+ spinner?: string;
2600
+ listboxWrapper?: string;
2601
+ listbox?: string;
2602
+ popoverContent?: string;
2603
+ helperWrapper?: string;
2604
+ endWrapper?: string;
2605
+ clearButton?: string;
2606
+ };
2607
+
2284
2608
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobielnl/elements",
3
- "version": "0.12.11",
3
+ "version": "0.12.13",
4
4
  "description": "Mobiel.nl Elements - React component library for partner websites",
5
5
  "private": false,
6
6
  "type": "module",
@@ -79,7 +79,7 @@
79
79
  "@testing-library/react": "^16.3.1",
80
80
  "@types/jest": "^30.0.0",
81
81
  "@types/js-cookie": "^3.0.6",
82
- "@types/lodash": "^4.17.23",
82
+ "@types/lodash": "^4.17.24",
83
83
  "@types/node": "^22.13.1",
84
84
  "@types/postcss-prefix-selector": "^1.16.3",
85
85
  "@types/react": "^19.2.9",
@@ -92,7 +92,7 @@
92
92
  "graphql-request": "^7.2.0",
93
93
  "i18next": "^25.7.3",
94
94
  "js-cookie": "^3.0.5",
95
- "lodash": "^4.17.23",
95
+ "lodash": "^4.18.1",
96
96
  "msw": "^2.12.7",
97
97
  "msw-storybook-addon": "^2.0.6",
98
98
  "postcss-prefix-selector": "^2.1.1",
@@ -105,7 +105,7 @@
105
105
  "swr": "^2.3.2",
106
106
  "tailwindcss": "^4.1.18",
107
107
  "typescript": "~5.8.3",
108
- "vite": "7.1.11",
108
+ "vite": "7.3.2",
109
109
  "vite-plugin-dts": "^4.5.0",
110
110
  "vitest": "^3.2.4",
111
111
  "zod": "^4.1.12"