@cleartrip/talos-dynamic-tile 11.0.0 → 12.0.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.
@@ -108,6 +108,150 @@
108
108
  }
109
109
  })(jsxRuntime);
110
110
 
111
+ const staticContainerStyles = ctDesignStyleManager.makeStyles(() => {
112
+ return {
113
+ root: {
114
+ display: 'flex',
115
+ flexDirection: 'column',
116
+ pointerEvents: 'auto'
117
+ }
118
+ };
119
+ });
120
+ function getPointerEventsStyles(pointerEvents) {
121
+ if (pointerEvents === 'box-none') {
122
+ return {
123
+ pointerEvents: 'none',
124
+ '& > *': {
125
+ pointerEvents: 'auto'
126
+ }
127
+ };
128
+ }
129
+ if (pointerEvents === 'box-only') {
130
+ return {
131
+ pointerEvents: 'auto',
132
+ '& > *': {
133
+ pointerEvents: 'none'
134
+ }
135
+ };
136
+ }
137
+ if (pointerEvents === 'none') {
138
+ return {
139
+ pointerEvents: 'none'
140
+ };
141
+ }
142
+ return {
143
+ pointerEvents: 'auto'
144
+ };
145
+ }
146
+ const Container = React.forwardRef(({
147
+ id,
148
+ as: ContainerAs = 'div',
149
+ children,
150
+ styleConfig,
151
+ onClick,
152
+ onLayout,
153
+ onMouseEnter,
154
+ onMouseLeave,
155
+ onTransitionEnd,
156
+ onTouchStart,
157
+ onTouchEnd,
158
+ onTouchCancel,
159
+ onTouchMove,
160
+ pointerEvents,
161
+ hitSlop: _hitSlop,
162
+ hapticEnabled: _hapticEnabled,
163
+ hapticVariant: _hapticVariant,
164
+ hapticRepeat: _hapticRepeat
165
+ }, forwardedRef) => {
166
+ const localRef = React.useRef(null);
167
+ const handleFocus = React.useCallback(() => {
168
+ var _a;
169
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
170
+ }, []);
171
+ const handleGetBoundingRect = React.useCallback(callback => {
172
+ var _a;
173
+ const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
174
+ if (rect) {
175
+ callback === null || callback === void 0 ? void 0 : callback({
176
+ x: rect.x,
177
+ y: rect.y,
178
+ width: rect.width,
179
+ height: rect.height
180
+ });
181
+ }
182
+ }, []);
183
+ const handleAddEventListener = React.useCallback((type, listener, options) => {
184
+ var _a;
185
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
186
+ }, []);
187
+ const handleRemoveEventListener = React.useCallback((type, listener, options) => {
188
+ var _a;
189
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
190
+ }, []);
191
+ React.useImperativeHandle(forwardedRef, () => {
192
+ var _a;
193
+ return {
194
+ focus: handleFocus,
195
+ getBoundingRectWithCallback: handleGetBoundingRect,
196
+ getElementRef: () => localRef,
197
+ style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
198
+ classList: {
199
+ add: className => {
200
+ var _a;
201
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
202
+ }
203
+ },
204
+ measure: _callback => {
205
+ var _a;
206
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
207
+ },
208
+ addEventListener: handleAddEventListener,
209
+ removeEventListener: handleRemoveEventListener
210
+ };
211
+ }, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
212
+ const {
213
+ root: rootStyles = []
214
+ } = styleConfig || {};
215
+ const pointerEventsStyle = React.useMemo(() => {
216
+ if (pointerEvents == null) return null;
217
+ return getPointerEventsStyles(pointerEvents);
218
+ }, [pointerEvents]);
219
+ const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
220
+ React.useLayoutEffect(() => {
221
+ var _a, _b, _c, _d, _e, _f, _g, _h;
222
+ onLayout === null || onLayout === void 0 ? void 0 : onLayout({
223
+ layout: {
224
+ height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
225
+ width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
226
+ x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
227
+ y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
228
+ }
229
+ });
230
+ }, [onLayout]);
231
+ return jsxRuntimeExports.jsx(ContainerAs, {
232
+ id: id,
233
+ ref: localRef,
234
+ className: mergedRootStyles,
235
+ onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
236
+ stopPropagation: () => event.stopPropagation(),
237
+ preventDefault: () => event.preventDefault(),
238
+ nativeEvent: {
239
+ locationX: event.clientX,
240
+ locationY: event.clientY
241
+ }
242
+ }),
243
+ onMouseEnter: onMouseEnter,
244
+ onMouseLeave: onMouseLeave,
245
+ onTransitionEnd: onTransitionEnd,
246
+ onTouchStart: onTouchStart,
247
+ onTouchEnd: onTouchEnd,
248
+ onTouchCancel: onTouchCancel,
249
+ onTouchMove: onTouchMove,
250
+ children: children
251
+ });
252
+ });
253
+ Container.displayName = 'Container';
254
+
111
255
  const border = {
112
256
  radius: {
113
257
  0: 0,
@@ -186,6 +330,7 @@
186
330
  neutral500: '#B3B3B3',
187
331
  neutral700: '#808080',
188
332
  neutral900: '#1A1A1A',
333
+ neutral900Muted: '#1A1A1ABF',
189
334
  orange100: '#FFF1EC',
190
335
  orange250: '#FFB8A5',
191
336
  orange500: '#FF4F17',
@@ -2554,150 +2699,6 @@
2554
2699
  styled[tagName] = styled(tagName);
2555
2700
  });
2556
2701
 
2557
- const staticContainerStyles = ctDesignStyleManager.makeStyles(() => {
2558
- return {
2559
- root: {
2560
- display: 'flex',
2561
- flexDirection: 'column',
2562
- pointerEvents: 'auto'
2563
- }
2564
- };
2565
- });
2566
- function getPointerEventsStyles(pointerEvents) {
2567
- if (pointerEvents === 'box-none') {
2568
- return {
2569
- pointerEvents: 'none',
2570
- '& > *': {
2571
- pointerEvents: 'auto'
2572
- }
2573
- };
2574
- }
2575
- if (pointerEvents === 'box-only') {
2576
- return {
2577
- pointerEvents: 'auto',
2578
- '& > *': {
2579
- pointerEvents: 'none'
2580
- }
2581
- };
2582
- }
2583
- if (pointerEvents === 'none') {
2584
- return {
2585
- pointerEvents: 'none'
2586
- };
2587
- }
2588
- return {
2589
- pointerEvents: 'auto'
2590
- };
2591
- }
2592
- const Container = React.forwardRef(({
2593
- id,
2594
- as: ContainerAs = 'div',
2595
- children,
2596
- styleConfig,
2597
- onClick,
2598
- onLayout,
2599
- onMouseEnter,
2600
- onMouseLeave,
2601
- onTransitionEnd,
2602
- onTouchStart,
2603
- onTouchEnd,
2604
- onTouchCancel,
2605
- onTouchMove,
2606
- pointerEvents,
2607
- hitSlop: _hitSlop,
2608
- hapticEnabled: _hapticEnabled,
2609
- hapticVariant: _hapticVariant,
2610
- hapticRepeat: _hapticRepeat
2611
- }, forwardedRef) => {
2612
- const localRef = React.useRef(null);
2613
- const handleFocus = React.useCallback(() => {
2614
- var _a;
2615
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
2616
- }, []);
2617
- const handleGetBoundingRect = React.useCallback(callback => {
2618
- var _a;
2619
- const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2620
- if (rect) {
2621
- callback === null || callback === void 0 ? void 0 : callback({
2622
- x: rect.x,
2623
- y: rect.y,
2624
- width: rect.width,
2625
- height: rect.height
2626
- });
2627
- }
2628
- }, []);
2629
- const handleAddEventListener = React.useCallback((type, listener, options) => {
2630
- var _a;
2631
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
2632
- }, []);
2633
- const handleRemoveEventListener = React.useCallback((type, listener, options) => {
2634
- var _a;
2635
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
2636
- }, []);
2637
- React.useImperativeHandle(forwardedRef, () => {
2638
- var _a;
2639
- return {
2640
- focus: handleFocus,
2641
- getBoundingRectWithCallback: handleGetBoundingRect,
2642
- getElementRef: () => localRef,
2643
- style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
2644
- classList: {
2645
- add: className => {
2646
- var _a;
2647
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
2648
- }
2649
- },
2650
- measure: _callback => {
2651
- var _a;
2652
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2653
- },
2654
- addEventListener: handleAddEventListener,
2655
- removeEventListener: handleRemoveEventListener
2656
- };
2657
- }, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
2658
- const {
2659
- root: rootStyles = []
2660
- } = styleConfig || {};
2661
- const pointerEventsStyle = React.useMemo(() => {
2662
- if (pointerEvents == null) return null;
2663
- return getPointerEventsStyles(pointerEvents);
2664
- }, [pointerEvents]);
2665
- const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
2666
- React.useLayoutEffect(() => {
2667
- var _a, _b, _c, _d, _e, _f, _g, _h;
2668
- onLayout === null || onLayout === void 0 ? void 0 : onLayout({
2669
- layout: {
2670
- height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
2671
- width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
2672
- x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
2673
- y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
2674
- }
2675
- });
2676
- }, [onLayout]);
2677
- return jsxRuntimeExports.jsx(ContainerAs, {
2678
- id: id,
2679
- ref: localRef,
2680
- className: mergedRootStyles,
2681
- onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
2682
- stopPropagation: () => event.stopPropagation(),
2683
- preventDefault: () => event.preventDefault(),
2684
- nativeEvent: {
2685
- locationX: event.clientX,
2686
- locationY: event.clientY
2687
- }
2688
- }),
2689
- onMouseEnter: onMouseEnter,
2690
- onMouseLeave: onMouseLeave,
2691
- onTransitionEnd: onTransitionEnd,
2692
- onTouchStart: onTouchStart,
2693
- onTouchEnd: onTouchEnd,
2694
- onTouchCancel: onTouchCancel,
2695
- onTouchMove: onTouchMove,
2696
- children: children
2697
- });
2698
- });
2699
- Container.displayName = 'Container';
2700
-
2701
2702
  const duration = {
2702
2703
  shortest: 150,
2703
2704
  shorter: 200,
@@ -2789,6 +2790,10 @@
2789
2790
  onBrand: colors.orange200,
2790
2791
  pink500: colors.pink500,
2791
2792
  pink400: colors.pink400,
2793
+ calloutSuccessTitle: colors.couponGreen,
2794
+ calloutDangerTitle: colors.red500,
2795
+ calloutInfoTitle: colors.link,
2796
+ calloutNeutralTitle: colors.neutral900Muted,
2792
2797
  black000: colors.black000,
2793
2798
  blue550: colors.blue550,
2794
2799
  green400: colors.green400,
@@ -2824,6 +2829,16 @@
2824
2829
  outlinedNeutralLabel: colors.neutral900,
2825
2830
  outlinedNeutralBorder: colors.neutral900,
2826
2831
  outlinedNeutralBg: colors.neutral100,
2832
+ containedSuccessLabel: colors.neutral100,
2833
+ containedSuccessBg: colors.success500,
2834
+ outlinedSuccessLabel: colors.success500,
2835
+ outlinedSuccessBorder: colors.success500,
2836
+ outlinedSuccessBg: colors.neutral100,
2837
+ containedDangerLabel: colors.neutral100,
2838
+ containedDangerBg: colors.red500,
2839
+ outlinedDangerLabel: colors.red500,
2840
+ outlinedDangerBorder: colors.red500,
2841
+ outlinedDangerBg: colors.neutral100,
2827
2842
  hover: {
2828
2843
  [colors.neutral100]: colors.neutral100,
2829
2844
  [colors.neutral900]: colors.neutral900,
@@ -2880,6 +2895,10 @@
2880
2895
  alertSoft: colors.alert100,
2881
2896
  warning: colors.warning,
2882
2897
  warningLightBg: colors.warningBg,
2898
+ calloutSuccessBg: colors.freshGreen100,
2899
+ calloutDangerBg: colors.red200,
2900
+ calloutInfoBg: colors.blue100,
2901
+ calloutNeutralBg: colors.neutral300,
2883
2902
  neutral: colors.neutral100,
2884
2903
  disabled: colors.neutral300,
2885
2904
  disabledSecondaryLight: colors.neutral350,
@@ -3143,7 +3162,7 @@
3143
3162
  }
3144
3163
  })
3145
3164
  });
3146
- const hover$1 = key => {
3165
+ const hover$2 = key => {
3147
3166
  const bg = {
3148
3167
  [colors.neutral100]: colors.neutral100,
3149
3168
  [colors.neutral900]: colors.neutral900,
@@ -3186,7 +3205,7 @@
3186
3205
  containedPrimarySoftBg: colors.blueSecondary,
3187
3206
  containedSecondaryLabel: colors.primaryNeutral900,
3188
3207
  containedSecondaryBg: colors.yellowSecondary,
3189
- hover: hover$1
3208
+ hover: hover$2
3190
3209
  }),
3191
3210
  chip: Object.assign(Object.assign({}, BaseTheme.color.chip), {
3192
3211
  selectedPrimaryLabel: colors.link2,
@@ -3223,7 +3242,7 @@
3223
3242
  }
3224
3243
  })
3225
3244
  });
3226
- const hover = key => {
3245
+ const hover$1 = key => {
3227
3246
  const bg = {
3228
3247
  [colors.neutral100]: colors.neutral100,
3229
3248
  [colors.brand]: colors.bgPrimaryHover,
@@ -3264,7 +3283,7 @@
3264
3283
  containedTertiaryLabel: colors.superGrey300,
3265
3284
  containedDisabledLabel: colors.disabledText,
3266
3285
  containedPrimaryLabel: colors.neutral100,
3267
- hover: hover
3286
+ hover: hover$1
3268
3287
  }),
3269
3288
  chip: Object.assign(Object.assign({}, BaseTheme.color.chip), {
3270
3289
  selectedPrimaryLabel: colors.superBlue500,
@@ -3294,6 +3313,39 @@
3294
3313
  })
3295
3314
  })
3296
3315
  });
3316
+ const hover = key => {
3317
+ const bg = {
3318
+ [colors.neutral100]: colors.neutral100,
3319
+ [colors.neutral900]: colors.neutral900,
3320
+ [colors.blue500]: colors.blue900,
3321
+ [colors.disabledText]: colors.disabledText,
3322
+ [colors.neutral300]: colors.neutral300,
3323
+ [colors.link2]: colors.link2Hover
3324
+ };
3325
+ return bg[key];
3326
+ };
3327
+ Object.assign(Object.assign({}, B2CTheme), {
3328
+ color: Object.assign(Object.assign({}, B2CTheme.color), {
3329
+ text: Object.assign(Object.assign({}, B2CTheme.color.text), {
3330
+ secondary: colors.blue500,
3331
+ brand: colors.blue500
3332
+ }),
3333
+ button: Object.assign(Object.assign({}, B2CTheme.color.button), {
3334
+ outlinedSecondaryLabel: colors.blue500,
3335
+ outlinedSecondaryBorder: colors.blue500,
3336
+ containedSecondaryBg: colors.blue500,
3337
+ hover
3338
+ }),
3339
+ background: Object.assign(Object.assign({}, B2CTheme.color.background), {
3340
+ secondary: colors.blue500,
3341
+ brand: colors.blue500
3342
+ }),
3343
+ border: Object.assign(Object.assign({}, B2CTheme.color.border), {
3344
+ secondary: colors.blue500,
3345
+ brand: colors.blue500
3346
+ })
3347
+ })
3348
+ });
3297
3349
  Object.assign(Object.assign({}, B2CTheme), {
3298
3350
  typography: Object.assign(Object.assign({}, B2CTheme.typography), {
3299
3351
  fontFamily: 'Manrope'