@mobielnl/elements 0.12.25 → 0.13.0
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 +3 -1
- package/dist/elements.css +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.umd.cjs +68 -68
- package/dist/{index-CSAejUDF.js → index-B11Hef2h.js} +1 -1
- package/dist/{index-BkgkTFrf.js → index-uthJc1qy.js} +6830 -6750
- package/dist/index.d.ts +146 -39
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -105,6 +105,15 @@ export declare type Block = {
|
|
|
105
105
|
amount: number;
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
+
export declare type BundleInfoViewedEvent = {
|
|
109
|
+
type: 'bundle_info_viewed';
|
|
110
|
+
/** The bundle group with bundle options */
|
|
111
|
+
bundleTypeSet: BundleTypeSet;
|
|
112
|
+
/** The bundle option within the bundle group
|
|
113
|
+
* @note if this is `undefined`, the user clicked the info icon for the bundle group label */
|
|
114
|
+
bundleSet?: BundleSet;
|
|
115
|
+
};
|
|
116
|
+
|
|
108
117
|
/**
|
|
109
118
|
* ClassNames for styling different parts of the `BundleModal` component
|
|
110
119
|
*/
|
|
@@ -173,6 +182,10 @@ declare type BundleSelectorClassNames = {
|
|
|
173
182
|
bundleTypeSetCheckboxGroup?: CheckboxGroupClassNames;
|
|
174
183
|
};
|
|
175
184
|
|
|
185
|
+
export declare type BundleSet = BundleTypeSet['bundleSets'][number];
|
|
186
|
+
|
|
187
|
+
export declare type BundleTypeSet = NonNullable<NonNullable<PropositionSelectorQuery['propositionSelector']>['bundleTypeSets']>[number];
|
|
188
|
+
|
|
176
189
|
/**
|
|
177
190
|
* ClassNames for styling different parts of the `Carousel` component
|
|
178
191
|
*/
|
|
@@ -1440,7 +1453,7 @@ declare type ProductHeaderClassNames = {
|
|
|
1440
1453
|
};
|
|
1441
1454
|
/** Stock status indicator – see ProductStockStatus */
|
|
1442
1455
|
productStockStatus?: NonNullable<MainImageClassNames['phoneImage']>['stockIndicator'];
|
|
1443
|
-
/** Wrapper container for the proposition header and promotion list */
|
|
1456
|
+
/** Wrapper container for the proposition header and promotion list and more bundle info link */
|
|
1444
1457
|
propositionHeaderPromotionListWrapper?: string;
|
|
1445
1458
|
/** Proposition header class styling slots */
|
|
1446
1459
|
propositionHeader?: PropositionHeaderClassNames;
|
|
@@ -1448,6 +1461,8 @@ declare type ProductHeaderClassNames = {
|
|
|
1448
1461
|
carousel?: CarouselClassNames;
|
|
1449
1462
|
/** PromotionList class styling slots (special promotions in header) - see type `PromotionListClassNames` */
|
|
1450
1463
|
promotionList?: PromotionListClassNames;
|
|
1464
|
+
/** More bundle info link class styling slots */
|
|
1465
|
+
moreBundleInfoLink?: string;
|
|
1451
1466
|
};
|
|
1452
1467
|
|
|
1453
1468
|
export declare function ProductResults({ classNames, initialSelectedFilters, initialProfile, onProfileChange, onError, onAction, ...props }: ProductResultsProps): JSX.Element;
|
|
@@ -1843,8 +1858,6 @@ export declare type PropositionSelectorClassNames = {
|
|
|
1843
1858
|
/** Alert class styling slots - see type `AlertClassNames`
|
|
1844
1859
|
* @note only visible for fixed propositions with the same fixed provider in profile */
|
|
1845
1860
|
sameFixedProviderAlert?: AlertClassNames;
|
|
1846
|
-
/** HandsetCreditSelector component class styling slots - see type `HandsetCreditSelectorClassNames` */
|
|
1847
|
-
handsetCreditSelector?: HandsetCreditSelectorClassNames;
|
|
1848
1861
|
/** ProductHeader class styling slots - see type `ProductHeaderClassNames` */
|
|
1849
1862
|
productHeader?: ProductHeaderClassNames;
|
|
1850
1863
|
/** StickySummary component class styling slots - see type `StickySummaryClassNames` */
|
|
@@ -1853,23 +1866,6 @@ export declare type PropositionSelectorClassNames = {
|
|
|
1853
1866
|
costOverview?: CostOverviewClassNames;
|
|
1854
1867
|
/** PromotionList component class styling slots (benefits section) - see type `PromotionListClassNames` */
|
|
1855
1868
|
promotionList?: PromotionListClassNames;
|
|
1856
|
-
/** PropositionSpecifications class styling slots (bundle info section) */
|
|
1857
|
-
propositionSpecifications?: {
|
|
1858
|
-
/** Base container for the bundle info section */
|
|
1859
|
-
base?: string;
|
|
1860
|
-
/** Title for the bundle info section */
|
|
1861
|
-
title?: string;
|
|
1862
|
-
/** Link for the bundle info section */
|
|
1863
|
-
link?: string;
|
|
1864
|
-
/** Wrapper container for the specifications */
|
|
1865
|
-
wrapper?: string;
|
|
1866
|
-
/** Specification item */
|
|
1867
|
-
item?: string;
|
|
1868
|
-
/** Specification icon */
|
|
1869
|
-
icon?: string;
|
|
1870
|
-
};
|
|
1871
|
-
/** VersionSelect component class styling slots (smartphone product version selector) - see type `VersionSelectClassNames` */
|
|
1872
|
-
versionSelect?: VersionSelectClassNames;
|
|
1873
1869
|
/** Extra costs section root container class */
|
|
1874
1870
|
extraCosts?: string;
|
|
1875
1871
|
/** Sidebar card containing the cost overview, CTA button and extra costs */
|
|
@@ -1895,10 +1891,28 @@ export declare type PropositionSelectorClassNames = {
|
|
|
1895
1891
|
};
|
|
1896
1892
|
/** BundleSelector component class styling slots - see type `BundleSelectorClassNames` */
|
|
1897
1893
|
bundleSelector?: BundleSelectorClassNames;
|
|
1894
|
+
/** VersionSelect component class styling slots (smartphone product version selector) - see type `VersionSelectClassNames`
|
|
1895
|
+
* @note only visible for smartphone propositions */
|
|
1896
|
+
versionSelect?: VersionSelectClassNames & {
|
|
1897
|
+
/** Section class styling slots - see type `SectionClassNames` */
|
|
1898
|
+
section?: SectionClassNames_2;
|
|
1899
|
+
};
|
|
1898
1900
|
/** Retention section class styling slots - see type `SectionClassNames` */
|
|
1899
|
-
retentionSelector?: SectionClassNames_2
|
|
1901
|
+
retentionSelector?: SectionClassNames_2 & {
|
|
1902
|
+
/** Radio group class styling slots - see type `RadioGroupClassNames` */
|
|
1903
|
+
radioGroup?: RadioGroupClassNames;
|
|
1904
|
+
};
|
|
1900
1905
|
/** Modification section class styling slots - see type `SectionClassNames` */
|
|
1901
|
-
modificationSelector?: SectionClassNames_2
|
|
1906
|
+
modificationSelector?: SectionClassNames_2 & {
|
|
1907
|
+
/** Radio group class styling slots - see type `RadioGroupClassNames` */
|
|
1908
|
+
radioGroup?: RadioGroupClassNames;
|
|
1909
|
+
};
|
|
1910
|
+
/** HandsetCreditSelector component class styling slots - see type `HandsetCreditSelectorClassNames`
|
|
1911
|
+
* @note only visible for smartphone propositions with handset credits */
|
|
1912
|
+
handsetCreditSelector?: HandsetCreditSelectorClassNames & {
|
|
1913
|
+
/** Section class styling slots - see type `SectionClassNames` */
|
|
1914
|
+
section?: SectionClassNames_2;
|
|
1915
|
+
};
|
|
1902
1916
|
/** BundleModal component class styling slots - see type `BundleModalClassNames` */
|
|
1903
1917
|
bundleModal?: BundleModalClassNames;
|
|
1904
1918
|
/** Profile buttons component class styling slots - see type `SelectorClassNames` */
|
|
@@ -1928,8 +1942,9 @@ export declare type PropositionSelectorProps = {
|
|
|
1928
1942
|
/** Initial user profile */
|
|
1929
1943
|
initialProfile?: Partial<Profile>;
|
|
1930
1944
|
/** Target for the click-out URL on mobiel.nl
|
|
1931
|
-
* @default
|
|
1932
|
-
|
|
1945
|
+
* @default "cart"
|
|
1946
|
+
* @note `"upsell"`: only smartphone propositions have upsell options, other propositions will redirect to the cart */
|
|
1947
|
+
clickOutTarget?: 'cart' | 'upsell' | 'checkout';
|
|
1933
1948
|
/** Custom ReactNode content below the CTA card component
|
|
1934
1949
|
*
|
|
1935
1950
|
* @note Desktop: Content will be displayed below the CTA card component in the sidebar/second column
|
|
@@ -1951,22 +1966,26 @@ export declare type PropositionSelectorProps = {
|
|
|
1951
1966
|
* Callback function fired when user actions occur.
|
|
1952
1967
|
*
|
|
1953
1968
|
* Events:
|
|
1954
|
-
* - `details_viewed`: User opened proposition details modal
|
|
1955
1969
|
* - `add_to_cart`: User clicked the add-to-cart CTA
|
|
1970
|
+
* - `bundle_info_viewed`: User clicked the info icon for the bundle group or bundle option
|
|
1971
|
+
* - `details_viewed`: User opened proposition details modal
|
|
1956
1972
|
* - `profile_changed`: User profile changed (includes from/to values)
|
|
1957
1973
|
*
|
|
1958
1974
|
* @example
|
|
1959
1975
|
* onAction={(event) => {
|
|
1960
1976
|
* switch(event.type) {
|
|
1961
|
-
*
|
|
1962
|
-
*
|
|
1963
|
-
*
|
|
1964
|
-
*
|
|
1965
|
-
*
|
|
1966
|
-
*
|
|
1967
|
-
*
|
|
1968
|
-
*
|
|
1969
|
-
*
|
|
1977
|
+
* case 'add_to_cart':
|
|
1978
|
+
* console.log(event.proposition)
|
|
1979
|
+
* break
|
|
1980
|
+
* case 'bundle_info_viewed':
|
|
1981
|
+
* console.log(event.bundleTypeSet, event.bundleSet)
|
|
1982
|
+
* break
|
|
1983
|
+
* case 'details_viewed':
|
|
1984
|
+
* console.log(event.proposition, event.tab)
|
|
1985
|
+
* break
|
|
1986
|
+
* case 'profile_changed':
|
|
1987
|
+
* console.log(event.from, event.to)
|
|
1988
|
+
* break
|
|
1970
1989
|
* }
|
|
1971
1990
|
* }}
|
|
1972
1991
|
*/
|
|
@@ -1986,6 +2005,97 @@ export declare type PropositionSelectorProps = {
|
|
|
1986
2005
|
hideRetentionOnFilledProfile?: boolean;
|
|
1987
2006
|
};
|
|
1988
2007
|
|
|
2008
|
+
declare type PropositionSelectorQuery = {
|
|
2009
|
+
__typename?: 'RootQueryType';
|
|
2010
|
+
propositionSelector?: {
|
|
2011
|
+
__typename?: 'BundleSelector';
|
|
2012
|
+
key: string;
|
|
2013
|
+
planVariantKey: string;
|
|
2014
|
+
phoneVariantKey?: string | null;
|
|
2015
|
+
modificationKey?: string | null;
|
|
2016
|
+
providerSlug: string;
|
|
2017
|
+
handsetCreditKeys: Array<string>;
|
|
2018
|
+
phoneVariantKeys: Array<string>;
|
|
2019
|
+
modificationDescription?: string | null;
|
|
2020
|
+
modificationInfoUrl?: string | null;
|
|
2021
|
+
hasModifications: boolean;
|
|
2022
|
+
basePrice: number;
|
|
2023
|
+
creditFee: number;
|
|
2024
|
+
planVariant: {
|
|
2025
|
+
__typename?: 'BundleSelectorPlanVariant';
|
|
2026
|
+
contractType: string;
|
|
2027
|
+
};
|
|
2028
|
+
alternatePlanVariant?: {
|
|
2029
|
+
__typename?: 'BundleSelectorPlanVariant';
|
|
2030
|
+
unitKey: string;
|
|
2031
|
+
} | null;
|
|
2032
|
+
provider: {
|
|
2033
|
+
__typename?: 'Provider';
|
|
2034
|
+
name: string;
|
|
2035
|
+
slug: string;
|
|
2036
|
+
};
|
|
2037
|
+
planVariants: Array<{
|
|
2038
|
+
__typename?: 'BundleSelectorPlanVariant';
|
|
2039
|
+
unitKey: string;
|
|
2040
|
+
contractTerm: number;
|
|
2041
|
+
contractType: string;
|
|
2042
|
+
plan: string;
|
|
2043
|
+
}>;
|
|
2044
|
+
bundleTypeSets: Array<{
|
|
2045
|
+
__typename?: 'BundleSelectorBundleTypeSet';
|
|
2046
|
+
unitKey: string;
|
|
2047
|
+
name: string;
|
|
2048
|
+
required: boolean;
|
|
2049
|
+
multiSelect: boolean;
|
|
2050
|
+
requiredBundleTypeSetId?: string | null;
|
|
2051
|
+
infoUrl?: string | null;
|
|
2052
|
+
bundleTypes: Array<string>;
|
|
2053
|
+
bundleSets: Array<{
|
|
2054
|
+
__typename?: 'BundleSelectorBundleSet';
|
|
2055
|
+
infoUrl?: string | null;
|
|
2056
|
+
imageUrl?: string | null;
|
|
2057
|
+
unitKey: string;
|
|
2058
|
+
name: string;
|
|
2059
|
+
label: string;
|
|
2060
|
+
usps: Array<string>;
|
|
2061
|
+
requiredBundleTypeSetId?: string | null;
|
|
2062
|
+
requiredModificationGroupId?: string | null;
|
|
2063
|
+
baseMonthlyFee: number;
|
|
2064
|
+
lifetimeMonthlyFee: number;
|
|
2065
|
+
monthlyFees: Array<number>;
|
|
2066
|
+
content: {
|
|
2067
|
+
__typename?: 'PropositionContent';
|
|
2068
|
+
data: number;
|
|
2069
|
+
minutes: number;
|
|
2070
|
+
sms: number;
|
|
2071
|
+
sharedCredits?: Array<string | null> | null;
|
|
2072
|
+
dataSpeedDown: number;
|
|
2073
|
+
dataSpeedUp: number;
|
|
2074
|
+
channels: Array<string>;
|
|
2075
|
+
hdChannels: Array<string>;
|
|
2076
|
+
receivers: number;
|
|
2077
|
+
};
|
|
2078
|
+
modifications?: {
|
|
2079
|
+
__typename?: 'BundleSelectorModifications';
|
|
2080
|
+
name?: string | null;
|
|
2081
|
+
monthlyFees: Array<number>;
|
|
2082
|
+
content: {
|
|
2083
|
+
__typename?: 'PropositionContent';
|
|
2084
|
+
data: number;
|
|
2085
|
+
minutes: number;
|
|
2086
|
+
sms: number;
|
|
2087
|
+
};
|
|
2088
|
+
} | null;
|
|
2089
|
+
}>;
|
|
2090
|
+
}>;
|
|
2091
|
+
blacklists: Array<{
|
|
2092
|
+
__typename?: 'BundleSelectorBlacklist';
|
|
2093
|
+
unitKey: string;
|
|
2094
|
+
blacklist: Array<string>;
|
|
2095
|
+
}>;
|
|
2096
|
+
} | null;
|
|
2097
|
+
};
|
|
2098
|
+
|
|
1989
2099
|
export declare type ProviderOption = {
|
|
1990
2100
|
slug: string;
|
|
1991
2101
|
name: string;
|
|
@@ -2189,10 +2299,8 @@ declare type SelectFilterClassNames = {
|
|
|
2189
2299
|
/**
|
|
2190
2300
|
* Union type of all PropositionSelector action events.
|
|
2191
2301
|
*
|
|
2192
|
-
* Re-uses `DetailsViewedEvent` and `ProfileChangedEvent` from `ProductResults`
|
|
2193
|
-
|
|
2194
|
-
*/
|
|
2195
|
-
export declare type SelectorActionEvent = AddToCartEvent | DetailsViewedEvent | ProfileChangedEvent;
|
|
2302
|
+
* Re-uses `DetailsViewedEvent` and `ProfileChangedEvent` from `ProductResults` */
|
|
2303
|
+
export declare type SelectorActionEvent = AddToCartEvent | BundleInfoViewedEvent | DetailsViewedEvent | ProfileChangedEvent;
|
|
2196
2304
|
|
|
2197
2305
|
/**
|
|
2198
2306
|
* ClassNames for styling different parts of the `Selector` component
|
|
@@ -2693,7 +2801,6 @@ export declare type Translations = {
|
|
|
2693
2801
|
sameFixedProviderDescription: string;
|
|
2694
2802
|
productVersionTitle: string;
|
|
2695
2803
|
benefitsTitle: string;
|
|
2696
|
-
bundleSelectorTitle: string;
|
|
2697
2804
|
moreBundleInfo: string;
|
|
2698
2805
|
totalCostsOverviewTitle: string;
|
|
2699
2806
|
cta: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mobielnl/elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Mobiel.nl Elements - React component library for partner websites",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -86,12 +86,14 @@
|
|
|
86
86
|
"@types/react": "^19.2.9",
|
|
87
87
|
"@types/react-dom": "^19.2.3",
|
|
88
88
|
"@vitejs/plugin-react-swc": "^4.0.0",
|
|
89
|
+
"@vitest/coverage-v8": "4.1.10",
|
|
89
90
|
"chromatic": "^13.3.5",
|
|
90
91
|
"cross-env": "^7.0.3",
|
|
91
92
|
"dotenv": "^17.4.2",
|
|
92
93
|
"globals": "^16.3.0",
|
|
93
94
|
"graphql": "^16.11.0",
|
|
94
95
|
"graphql-request": "^7.2.0",
|
|
96
|
+
"happy-dom": "^20.10.6",
|
|
95
97
|
"i18next": "^25.7.3",
|
|
96
98
|
"js-cookie": "^3.0.7",
|
|
97
99
|
"lodash": "^4.18.1",
|
|
@@ -110,7 +112,7 @@
|
|
|
110
112
|
"typescript": "~5.8.3",
|
|
111
113
|
"vite": "7.3.5",
|
|
112
114
|
"vite-plugin-dts": "^4.5.0",
|
|
113
|
-
"vitest": "
|
|
115
|
+
"vitest": "4.1.10",
|
|
114
116
|
"zod": "^4.1.12"
|
|
115
117
|
},
|
|
116
118
|
"msw": {
|