@cleartrip/talos-bus-trip-card 11.0.0 → 11.1.1
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.
|
@@ -61,6 +61,150 @@
|
|
|
61
61
|
}
|
|
62
62
|
})(jsxRuntime);
|
|
63
63
|
|
|
64
|
+
const staticContainerStyles = ctDesignStyleManager.makeStyles(() => {
|
|
65
|
+
return {
|
|
66
|
+
root: {
|
|
67
|
+
display: 'flex',
|
|
68
|
+
flexDirection: 'column',
|
|
69
|
+
pointerEvents: 'auto'
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
function getPointerEventsStyles(pointerEvents) {
|
|
74
|
+
if (pointerEvents === 'box-none') {
|
|
75
|
+
return {
|
|
76
|
+
pointerEvents: 'none',
|
|
77
|
+
'& > *': {
|
|
78
|
+
pointerEvents: 'auto'
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
if (pointerEvents === 'box-only') {
|
|
83
|
+
return {
|
|
84
|
+
pointerEvents: 'auto',
|
|
85
|
+
'& > *': {
|
|
86
|
+
pointerEvents: 'none'
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (pointerEvents === 'none') {
|
|
91
|
+
return {
|
|
92
|
+
pointerEvents: 'none'
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
pointerEvents: 'auto'
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const Container = React.forwardRef(({
|
|
100
|
+
id,
|
|
101
|
+
as: ContainerAs = 'div',
|
|
102
|
+
children,
|
|
103
|
+
styleConfig,
|
|
104
|
+
onClick,
|
|
105
|
+
onLayout,
|
|
106
|
+
onMouseEnter,
|
|
107
|
+
onMouseLeave,
|
|
108
|
+
onTransitionEnd,
|
|
109
|
+
onTouchStart,
|
|
110
|
+
onTouchEnd,
|
|
111
|
+
onTouchCancel,
|
|
112
|
+
onTouchMove,
|
|
113
|
+
pointerEvents,
|
|
114
|
+
hitSlop: _hitSlop,
|
|
115
|
+
hapticEnabled: _hapticEnabled,
|
|
116
|
+
hapticVariant: _hapticVariant,
|
|
117
|
+
hapticRepeat: _hapticRepeat
|
|
118
|
+
}, forwardedRef) => {
|
|
119
|
+
const localRef = React.useRef(null);
|
|
120
|
+
const handleFocus = React.useCallback(() => {
|
|
121
|
+
var _a;
|
|
122
|
+
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
123
|
+
}, []);
|
|
124
|
+
const handleGetBoundingRect = React.useCallback(callback => {
|
|
125
|
+
var _a;
|
|
126
|
+
const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
127
|
+
if (rect) {
|
|
128
|
+
callback === null || callback === void 0 ? void 0 : callback({
|
|
129
|
+
x: rect.x,
|
|
130
|
+
y: rect.y,
|
|
131
|
+
width: rect.width,
|
|
132
|
+
height: rect.height
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}, []);
|
|
136
|
+
const handleAddEventListener = React.useCallback((type, listener, options) => {
|
|
137
|
+
var _a;
|
|
138
|
+
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
|
|
139
|
+
}, []);
|
|
140
|
+
const handleRemoveEventListener = React.useCallback((type, listener, options) => {
|
|
141
|
+
var _a;
|
|
142
|
+
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
|
|
143
|
+
}, []);
|
|
144
|
+
React.useImperativeHandle(forwardedRef, () => {
|
|
145
|
+
var _a;
|
|
146
|
+
return {
|
|
147
|
+
focus: handleFocus,
|
|
148
|
+
getBoundingRectWithCallback: handleGetBoundingRect,
|
|
149
|
+
getElementRef: () => localRef,
|
|
150
|
+
style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
|
|
151
|
+
classList: {
|
|
152
|
+
add: className => {
|
|
153
|
+
var _a;
|
|
154
|
+
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
measure: _callback => {
|
|
158
|
+
var _a;
|
|
159
|
+
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
160
|
+
},
|
|
161
|
+
addEventListener: handleAddEventListener,
|
|
162
|
+
removeEventListener: handleRemoveEventListener
|
|
163
|
+
};
|
|
164
|
+
}, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
|
|
165
|
+
const {
|
|
166
|
+
root: rootStyles = []
|
|
167
|
+
} = styleConfig || {};
|
|
168
|
+
const pointerEventsStyle = React.useMemo(() => {
|
|
169
|
+
if (pointerEvents == null) return null;
|
|
170
|
+
return getPointerEventsStyles(pointerEvents);
|
|
171
|
+
}, [pointerEvents]);
|
|
172
|
+
const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
|
|
173
|
+
React.useLayoutEffect(() => {
|
|
174
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
175
|
+
onLayout === null || onLayout === void 0 ? void 0 : onLayout({
|
|
176
|
+
layout: {
|
|
177
|
+
height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
|
|
178
|
+
width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
|
|
179
|
+
x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
|
|
180
|
+
y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}, [onLayout]);
|
|
184
|
+
return jsxRuntimeExports.jsx(ContainerAs, {
|
|
185
|
+
id: id,
|
|
186
|
+
ref: localRef,
|
|
187
|
+
className: mergedRootStyles,
|
|
188
|
+
onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
|
|
189
|
+
stopPropagation: () => event.stopPropagation(),
|
|
190
|
+
preventDefault: () => event.preventDefault(),
|
|
191
|
+
nativeEvent: {
|
|
192
|
+
locationX: event.clientX,
|
|
193
|
+
locationY: event.clientY
|
|
194
|
+
}
|
|
195
|
+
}),
|
|
196
|
+
onMouseEnter: onMouseEnter,
|
|
197
|
+
onMouseLeave: onMouseLeave,
|
|
198
|
+
onTransitionEnd: onTransitionEnd,
|
|
199
|
+
onTouchStart: onTouchStart,
|
|
200
|
+
onTouchEnd: onTouchEnd,
|
|
201
|
+
onTouchCancel: onTouchCancel,
|
|
202
|
+
onTouchMove: onTouchMove,
|
|
203
|
+
children: children
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
Container.displayName = 'Container';
|
|
207
|
+
|
|
64
208
|
var isDevelopment$1 = false;
|
|
65
209
|
|
|
66
210
|
/*
|
|
@@ -1710,229 +1854,85 @@
|
|
|
1710
1854
|
}),
|
|
1711
1855
|
css = _createEmotion.css;
|
|
1712
1856
|
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1857
|
+
var TypographyVariant;
|
|
1858
|
+
(function (TypographyVariant) {
|
|
1859
|
+
TypographyVariant["HD1"] = "HD1";
|
|
1860
|
+
TypographyVariant["HD2"] = "HD2";
|
|
1861
|
+
TypographyVariant["HD3"] = "HD3";
|
|
1862
|
+
TypographyVariant["HM1"] = "HM1";
|
|
1863
|
+
TypographyVariant["HM2"] = "HM2";
|
|
1864
|
+
TypographyVariant["HM3"] = "HM3";
|
|
1865
|
+
TypographyVariant["HM4"] = "HM4";
|
|
1866
|
+
TypographyVariant["B1"] = "B1";
|
|
1867
|
+
TypographyVariant["B2"] = "B2";
|
|
1868
|
+
TypographyVariant["B3"] = "B3";
|
|
1869
|
+
TypographyVariant["B3CAPS"] = "B3CAPS";
|
|
1870
|
+
TypographyVariant["B4"] = "B4";
|
|
1871
|
+
TypographyVariant["B4CAPS"] = "B4CAPS";
|
|
1872
|
+
TypographyVariant["P1"] = "P1";
|
|
1873
|
+
TypographyVariant["P2"] = "P2";
|
|
1874
|
+
TypographyVariant["P3"] = "P3";
|
|
1875
|
+
TypographyVariant["P4"] = "P4";
|
|
1876
|
+
TypographyVariant["L1"] = "L1";
|
|
1877
|
+
TypographyVariant["L2"] = "L2";
|
|
1878
|
+
TypographyVariant["L3"] = "L3";
|
|
1879
|
+
TypographyVariant["OVERLINE"] = "OVERLINE";
|
|
1880
|
+
TypographyVariant["TAG"] = "TAG";
|
|
1881
|
+
TypographyVariant["M4BOLD"] = "M4BOLD";
|
|
1882
|
+
TypographyVariant["WRAPPER"] = "WRAPPER";
|
|
1883
|
+
})(TypographyVariant || (TypographyVariant = {}));
|
|
1884
|
+
var TypographyColor;
|
|
1885
|
+
(function (TypographyColor) {
|
|
1886
|
+
TypographyColor["PRIMARY"] = "primary";
|
|
1887
|
+
TypographyColor["SECONDARY"] = "secondary";
|
|
1888
|
+
TypographyColor["TERTIARY"] = "tertiary";
|
|
1889
|
+
TypographyColor["HEADING"] = "heading";
|
|
1890
|
+
TypographyColor["SUBHEADING"] = "subheading";
|
|
1891
|
+
TypographyColor["SUCCESS"] = "success";
|
|
1892
|
+
TypographyColor["ALERT"] = "alert";
|
|
1893
|
+
TypographyColor["WARNING"] = "warning";
|
|
1894
|
+
TypographyColor["DISABLED"] = "disabled";
|
|
1895
|
+
TypographyColor["LINK"] = "link";
|
|
1896
|
+
TypographyColor["NEUTRAL"] = "neutral";
|
|
1897
|
+
TypographyColor["LINK2"] = "link2";
|
|
1898
|
+
TypographyColor["PRIMARY2"] = "primary2";
|
|
1899
|
+
TypographyColor["SECONDARY2"] = "secondary2";
|
|
1900
|
+
TypographyColor["GRAPETINI"] = "grapetini900";
|
|
1901
|
+
TypographyColor["PINA_COLADA750"] = "pinacolada750";
|
|
1902
|
+
TypographyColor["BRAND"] = "brand";
|
|
1903
|
+
TypographyColor["ALERT500"] = "alert500";
|
|
1904
|
+
TypographyColor["NEUTRAL50"] = "neutral50";
|
|
1905
|
+
TypographyColor["MARGARITA750"] = "margarita750";
|
|
1906
|
+
TypographyColor["GREEN100"] = "green100";
|
|
1907
|
+
TypographyColor["RED100"] = "red100";
|
|
1908
|
+
TypographyColor["ALERT300"] = "alert300";
|
|
1909
|
+
TypographyColor["RED500"] = "red500";
|
|
1910
|
+
TypographyColor["CORALPINK"] = "coralpink";
|
|
1911
|
+
TypographyColor["WARNING500"] = "warning500";
|
|
1912
|
+
TypographyColor["BLUE700"] = "blue700";
|
|
1913
|
+
TypographyColor["NEUTRAL650"] = "neutral650";
|
|
1914
|
+
TypographyColor["GREY700"] = "grey700";
|
|
1915
|
+
TypographyColor["BLACK000"] = "black000";
|
|
1916
|
+
})(TypographyColor || (TypographyColor = {}));
|
|
1917
|
+
const getTypographyVariant = (theme, variant) => {
|
|
1918
|
+
switch (variant) {
|
|
1919
|
+
case TypographyVariant.HD1:
|
|
1920
|
+
{
|
|
1921
|
+
return {
|
|
1922
|
+
fontSize: theme.typography.size[48],
|
|
1923
|
+
fontWeight: theme.typography.weight.semibold,
|
|
1924
|
+
lineHeight: theme.typography.lineHeight[56]
|
|
1925
|
+
};
|
|
1728
1926
|
}
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1927
|
+
case TypographyVariant.HD2:
|
|
1928
|
+
{
|
|
1929
|
+
return {
|
|
1930
|
+
fontSize: theme.typography.size[40],
|
|
1931
|
+
fontWeight: theme.typography.weight.semibold,
|
|
1932
|
+
lineHeight: theme.typography.lineHeight[48]
|
|
1933
|
+
};
|
|
1736
1934
|
}
|
|
1737
|
-
|
|
1738
|
-
}
|
|
1739
|
-
if (pointerEvents === 'none') {
|
|
1740
|
-
return {
|
|
1741
|
-
pointerEvents: 'none'
|
|
1742
|
-
};
|
|
1743
|
-
}
|
|
1744
|
-
return {
|
|
1745
|
-
pointerEvents: 'auto'
|
|
1746
|
-
};
|
|
1747
|
-
}
|
|
1748
|
-
const Container$2 = React.forwardRef(({
|
|
1749
|
-
id,
|
|
1750
|
-
as: ContainerAs = 'div',
|
|
1751
|
-
children,
|
|
1752
|
-
styleConfig,
|
|
1753
|
-
onClick,
|
|
1754
|
-
onLayout,
|
|
1755
|
-
onMouseEnter,
|
|
1756
|
-
onMouseLeave,
|
|
1757
|
-
onTransitionEnd,
|
|
1758
|
-
onTouchStart,
|
|
1759
|
-
onTouchEnd,
|
|
1760
|
-
onTouchCancel,
|
|
1761
|
-
onTouchMove,
|
|
1762
|
-
pointerEvents,
|
|
1763
|
-
hitSlop: _hitSlop,
|
|
1764
|
-
hapticEnabled: _hapticEnabled,
|
|
1765
|
-
hapticVariant: _hapticVariant,
|
|
1766
|
-
hapticRepeat: _hapticRepeat
|
|
1767
|
-
}, forwardedRef) => {
|
|
1768
|
-
const localRef = React.useRef(null);
|
|
1769
|
-
const handleFocus = React.useCallback(() => {
|
|
1770
|
-
var _a;
|
|
1771
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1772
|
-
}, []);
|
|
1773
|
-
const handleGetBoundingRect = React.useCallback(callback => {
|
|
1774
|
-
var _a;
|
|
1775
|
-
const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
1776
|
-
if (rect) {
|
|
1777
|
-
callback === null || callback === void 0 ? void 0 : callback({
|
|
1778
|
-
x: rect.x,
|
|
1779
|
-
y: rect.y,
|
|
1780
|
-
width: rect.width,
|
|
1781
|
-
height: rect.height
|
|
1782
|
-
});
|
|
1783
|
-
}
|
|
1784
|
-
}, []);
|
|
1785
|
-
const handleAddEventListener = React.useCallback((type, listener, options) => {
|
|
1786
|
-
var _a;
|
|
1787
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
|
|
1788
|
-
}, []);
|
|
1789
|
-
const handleRemoveEventListener = React.useCallback((type, listener, options) => {
|
|
1790
|
-
var _a;
|
|
1791
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
|
|
1792
|
-
}, []);
|
|
1793
|
-
React.useImperativeHandle(forwardedRef, () => {
|
|
1794
|
-
var _a;
|
|
1795
|
-
return {
|
|
1796
|
-
focus: handleFocus,
|
|
1797
|
-
getBoundingRectWithCallback: handleGetBoundingRect,
|
|
1798
|
-
getElementRef: () => localRef,
|
|
1799
|
-
style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
|
|
1800
|
-
classList: {
|
|
1801
|
-
add: className => {
|
|
1802
|
-
var _a;
|
|
1803
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
|
|
1804
|
-
}
|
|
1805
|
-
},
|
|
1806
|
-
measure: _callback => {
|
|
1807
|
-
var _a;
|
|
1808
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
1809
|
-
},
|
|
1810
|
-
addEventListener: handleAddEventListener,
|
|
1811
|
-
removeEventListener: handleRemoveEventListener
|
|
1812
|
-
};
|
|
1813
|
-
}, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
|
|
1814
|
-
const {
|
|
1815
|
-
root: rootStyles = []
|
|
1816
|
-
} = styleConfig || {};
|
|
1817
|
-
const pointerEventsStyle = React.useMemo(() => {
|
|
1818
|
-
if (pointerEvents == null) return null;
|
|
1819
|
-
return getPointerEventsStyles$2(pointerEvents);
|
|
1820
|
-
}, [pointerEvents]);
|
|
1821
|
-
const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles$2.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
|
|
1822
|
-
React.useLayoutEffect(() => {
|
|
1823
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1824
|
-
onLayout === null || onLayout === void 0 ? void 0 : onLayout({
|
|
1825
|
-
layout: {
|
|
1826
|
-
height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
|
|
1827
|
-
width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
|
|
1828
|
-
x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
|
|
1829
|
-
y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
|
|
1830
|
-
}
|
|
1831
|
-
});
|
|
1832
|
-
}, [onLayout]);
|
|
1833
|
-
return jsxRuntimeExports.jsx(ContainerAs, {
|
|
1834
|
-
id: id,
|
|
1835
|
-
ref: localRef,
|
|
1836
|
-
className: mergedRootStyles,
|
|
1837
|
-
onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
|
|
1838
|
-
stopPropagation: () => event.stopPropagation(),
|
|
1839
|
-
preventDefault: () => event.preventDefault(),
|
|
1840
|
-
nativeEvent: {
|
|
1841
|
-
locationX: event.clientX,
|
|
1842
|
-
locationY: event.clientY
|
|
1843
|
-
}
|
|
1844
|
-
}),
|
|
1845
|
-
onMouseEnter: onMouseEnter,
|
|
1846
|
-
onMouseLeave: onMouseLeave,
|
|
1847
|
-
onTransitionEnd: onTransitionEnd,
|
|
1848
|
-
onTouchStart: onTouchStart,
|
|
1849
|
-
onTouchEnd: onTouchEnd,
|
|
1850
|
-
onTouchCancel: onTouchCancel,
|
|
1851
|
-
onTouchMove: onTouchMove,
|
|
1852
|
-
children: children
|
|
1853
|
-
});
|
|
1854
|
-
});
|
|
1855
|
-
Container$2.displayName = 'Container';
|
|
1856
|
-
|
|
1857
|
-
var TypographyVariant$1;
|
|
1858
|
-
(function (TypographyVariant) {
|
|
1859
|
-
TypographyVariant["HD1"] = "HD1";
|
|
1860
|
-
TypographyVariant["HD2"] = "HD2";
|
|
1861
|
-
TypographyVariant["HD3"] = "HD3";
|
|
1862
|
-
TypographyVariant["HM1"] = "HM1";
|
|
1863
|
-
TypographyVariant["HM2"] = "HM2";
|
|
1864
|
-
TypographyVariant["HM3"] = "HM3";
|
|
1865
|
-
TypographyVariant["HM4"] = "HM4";
|
|
1866
|
-
TypographyVariant["B1"] = "B1";
|
|
1867
|
-
TypographyVariant["B2"] = "B2";
|
|
1868
|
-
TypographyVariant["B3"] = "B3";
|
|
1869
|
-
TypographyVariant["B3CAPS"] = "B3CAPS";
|
|
1870
|
-
TypographyVariant["B4"] = "B4";
|
|
1871
|
-
TypographyVariant["B4CAPS"] = "B4CAPS";
|
|
1872
|
-
TypographyVariant["P1"] = "P1";
|
|
1873
|
-
TypographyVariant["P2"] = "P2";
|
|
1874
|
-
TypographyVariant["P3"] = "P3";
|
|
1875
|
-
TypographyVariant["P4"] = "P4";
|
|
1876
|
-
TypographyVariant["L1"] = "L1";
|
|
1877
|
-
TypographyVariant["L2"] = "L2";
|
|
1878
|
-
TypographyVariant["L3"] = "L3";
|
|
1879
|
-
TypographyVariant["OVERLINE"] = "OVERLINE";
|
|
1880
|
-
TypographyVariant["TAG"] = "TAG";
|
|
1881
|
-
TypographyVariant["M4BOLD"] = "M4BOLD";
|
|
1882
|
-
TypographyVariant["WRAPPER"] = "WRAPPER";
|
|
1883
|
-
})(TypographyVariant$1 || (TypographyVariant$1 = {}));
|
|
1884
|
-
var TypographyColor$1;
|
|
1885
|
-
(function (TypographyColor) {
|
|
1886
|
-
TypographyColor["PRIMARY"] = "primary";
|
|
1887
|
-
TypographyColor["SECONDARY"] = "secondary";
|
|
1888
|
-
TypographyColor["TERTIARY"] = "tertiary";
|
|
1889
|
-
TypographyColor["HEADING"] = "heading";
|
|
1890
|
-
TypographyColor["SUBHEADING"] = "subheading";
|
|
1891
|
-
TypographyColor["SUCCESS"] = "success";
|
|
1892
|
-
TypographyColor["ALERT"] = "alert";
|
|
1893
|
-
TypographyColor["WARNING"] = "warning";
|
|
1894
|
-
TypographyColor["DISABLED"] = "disabled";
|
|
1895
|
-
TypographyColor["LINK"] = "link";
|
|
1896
|
-
TypographyColor["NEUTRAL"] = "neutral";
|
|
1897
|
-
TypographyColor["LINK2"] = "link2";
|
|
1898
|
-
TypographyColor["PRIMARY2"] = "primary2";
|
|
1899
|
-
TypographyColor["SECONDARY2"] = "secondary2";
|
|
1900
|
-
TypographyColor["GRAPETINI"] = "grapetini900";
|
|
1901
|
-
TypographyColor["PINA_COLADA750"] = "pinacolada750";
|
|
1902
|
-
TypographyColor["BRAND"] = "brand";
|
|
1903
|
-
TypographyColor["ALERT500"] = "alert500";
|
|
1904
|
-
TypographyColor["NEUTRAL50"] = "neutral50";
|
|
1905
|
-
TypographyColor["MARGARITA750"] = "margarita750";
|
|
1906
|
-
TypographyColor["GREEN100"] = "green100";
|
|
1907
|
-
TypographyColor["RED100"] = "red100";
|
|
1908
|
-
TypographyColor["ALERT300"] = "alert300";
|
|
1909
|
-
TypographyColor["RED500"] = "red500";
|
|
1910
|
-
TypographyColor["CORALPINK"] = "coralpink";
|
|
1911
|
-
TypographyColor["WARNING500"] = "warning500";
|
|
1912
|
-
TypographyColor["BLUE700"] = "blue700";
|
|
1913
|
-
TypographyColor["NEUTRAL650"] = "neutral650";
|
|
1914
|
-
TypographyColor["GREY700"] = "grey700";
|
|
1915
|
-
TypographyColor["BLACK000"] = "black000";
|
|
1916
|
-
})(TypographyColor$1 || (TypographyColor$1 = {}));
|
|
1917
|
-
const getTypographyVariant$1 = (theme, variant) => {
|
|
1918
|
-
switch (variant) {
|
|
1919
|
-
case TypographyVariant$1.HD1:
|
|
1920
|
-
{
|
|
1921
|
-
return {
|
|
1922
|
-
fontSize: theme.typography.size[48],
|
|
1923
|
-
fontWeight: theme.typography.weight.semibold,
|
|
1924
|
-
lineHeight: theme.typography.lineHeight[56]
|
|
1925
|
-
};
|
|
1926
|
-
}
|
|
1927
|
-
case TypographyVariant$1.HD2:
|
|
1928
|
-
{
|
|
1929
|
-
return {
|
|
1930
|
-
fontSize: theme.typography.size[40],
|
|
1931
|
-
fontWeight: theme.typography.weight.semibold,
|
|
1932
|
-
lineHeight: theme.typography.lineHeight[48]
|
|
1933
|
-
};
|
|
1934
|
-
}
|
|
1935
|
-
case TypographyVariant$1.HD3:
|
|
1935
|
+
case TypographyVariant.HD3:
|
|
1936
1936
|
{
|
|
1937
1937
|
return {
|
|
1938
1938
|
fontSize: theme.typography.size[32],
|
|
@@ -1940,7 +1940,7 @@
|
|
|
1940
1940
|
lineHeight: theme.typography.lineHeight[40]
|
|
1941
1941
|
};
|
|
1942
1942
|
}
|
|
1943
|
-
case TypographyVariant
|
|
1943
|
+
case TypographyVariant.HM1:
|
|
1944
1944
|
{
|
|
1945
1945
|
return {
|
|
1946
1946
|
fontSize: theme.typography.size[24],
|
|
@@ -1948,7 +1948,7 @@
|
|
|
1948
1948
|
lineHeight: theme.typography.lineHeight[32]
|
|
1949
1949
|
};
|
|
1950
1950
|
}
|
|
1951
|
-
case TypographyVariant
|
|
1951
|
+
case TypographyVariant.HM2:
|
|
1952
1952
|
{
|
|
1953
1953
|
return {
|
|
1954
1954
|
fontSize: theme.typography.size[20],
|
|
@@ -1956,7 +1956,7 @@
|
|
|
1956
1956
|
lineHeight: theme.typography.lineHeight[28]
|
|
1957
1957
|
};
|
|
1958
1958
|
}
|
|
1959
|
-
case TypographyVariant
|
|
1959
|
+
case TypographyVariant.HM3:
|
|
1960
1960
|
{
|
|
1961
1961
|
return {
|
|
1962
1962
|
fontSize: theme.typography.size[16],
|
|
@@ -1964,7 +1964,7 @@
|
|
|
1964
1964
|
lineHeight: theme.typography.lineHeight[24]
|
|
1965
1965
|
};
|
|
1966
1966
|
}
|
|
1967
|
-
case TypographyVariant
|
|
1967
|
+
case TypographyVariant.HM4:
|
|
1968
1968
|
{
|
|
1969
1969
|
return {
|
|
1970
1970
|
fontSize: theme.typography.size[14],
|
|
@@ -1972,7 +1972,7 @@
|
|
|
1972
1972
|
lineHeight: theme.typography.lineHeight[20]
|
|
1973
1973
|
};
|
|
1974
1974
|
}
|
|
1975
|
-
case TypographyVariant
|
|
1975
|
+
case TypographyVariant.B1:
|
|
1976
1976
|
{
|
|
1977
1977
|
return {
|
|
1978
1978
|
fontSize: theme.typography.size[16],
|
|
@@ -1980,7 +1980,7 @@
|
|
|
1980
1980
|
lineHeight: theme.typography.lineHeight[24]
|
|
1981
1981
|
};
|
|
1982
1982
|
}
|
|
1983
|
-
case TypographyVariant
|
|
1983
|
+
case TypographyVariant.B2:
|
|
1984
1984
|
{
|
|
1985
1985
|
return {
|
|
1986
1986
|
fontSize: theme.typography.size[14],
|
|
@@ -1988,7 +1988,7 @@
|
|
|
1988
1988
|
lineHeight: theme.typography.lineHeight[20]
|
|
1989
1989
|
};
|
|
1990
1990
|
}
|
|
1991
|
-
case TypographyVariant
|
|
1991
|
+
case TypographyVariant.B3:
|
|
1992
1992
|
{
|
|
1993
1993
|
return {
|
|
1994
1994
|
fontSize: theme.typography.size[12],
|
|
@@ -1996,7 +1996,7 @@
|
|
|
1996
1996
|
lineHeight: theme.typography.lineHeight[16]
|
|
1997
1997
|
};
|
|
1998
1998
|
}
|
|
1999
|
-
case TypographyVariant
|
|
1999
|
+
case TypographyVariant.B3CAPS:
|
|
2000
2000
|
{
|
|
2001
2001
|
return {
|
|
2002
2002
|
fontSize: theme.typography.size[12],
|
|
@@ -2006,7 +2006,7 @@
|
|
|
2006
2006
|
textTransform: 'uppercase'
|
|
2007
2007
|
};
|
|
2008
2008
|
}
|
|
2009
|
-
case TypographyVariant
|
|
2009
|
+
case TypographyVariant.B4:
|
|
2010
2010
|
{
|
|
2011
2011
|
return {
|
|
2012
2012
|
fontSize: theme.typography.size[10],
|
|
@@ -2014,7 +2014,7 @@
|
|
|
2014
2014
|
lineHeight: theme.typography.lineHeight[14]
|
|
2015
2015
|
};
|
|
2016
2016
|
}
|
|
2017
|
-
case TypographyVariant
|
|
2017
|
+
case TypographyVariant.B4CAPS:
|
|
2018
2018
|
{
|
|
2019
2019
|
return {
|
|
2020
2020
|
fontSize: theme.typography.size[10],
|
|
@@ -2024,7 +2024,7 @@
|
|
|
2024
2024
|
textTransform: 'uppercase'
|
|
2025
2025
|
};
|
|
2026
2026
|
}
|
|
2027
|
-
case TypographyVariant
|
|
2027
|
+
case TypographyVariant.P1:
|
|
2028
2028
|
{
|
|
2029
2029
|
return {
|
|
2030
2030
|
fontSize: theme.typography.size[16],
|
|
@@ -2032,7 +2032,7 @@
|
|
|
2032
2032
|
lineHeight: theme.typography.lineHeight[22]
|
|
2033
2033
|
};
|
|
2034
2034
|
}
|
|
2035
|
-
case TypographyVariant
|
|
2035
|
+
case TypographyVariant.P2:
|
|
2036
2036
|
{
|
|
2037
2037
|
return {
|
|
2038
2038
|
fontSize: theme.typography.size[14],
|
|
@@ -2040,7 +2040,7 @@
|
|
|
2040
2040
|
lineHeight: theme.typography.lineHeight[20]
|
|
2041
2041
|
};
|
|
2042
2042
|
}
|
|
2043
|
-
case TypographyVariant
|
|
2043
|
+
case TypographyVariant.P3:
|
|
2044
2044
|
{
|
|
2045
2045
|
return {
|
|
2046
2046
|
fontSize: theme.typography.size[12],
|
|
@@ -2048,7 +2048,7 @@
|
|
|
2048
2048
|
lineHeight: theme.typography.lineHeight[16]
|
|
2049
2049
|
};
|
|
2050
2050
|
}
|
|
2051
|
-
case TypographyVariant
|
|
2051
|
+
case TypographyVariant.P4:
|
|
2052
2052
|
{
|
|
2053
2053
|
return {
|
|
2054
2054
|
fontSize: theme.typography.size[10],
|
|
@@ -2056,7 +2056,7 @@
|
|
|
2056
2056
|
lineHeight: theme.typography.lineHeight[14]
|
|
2057
2057
|
};
|
|
2058
2058
|
}
|
|
2059
|
-
case TypographyVariant
|
|
2059
|
+
case TypographyVariant.L1:
|
|
2060
2060
|
{
|
|
2061
2061
|
return {
|
|
2062
2062
|
fontSize: theme.typography.size[16],
|
|
@@ -2064,7 +2064,7 @@
|
|
|
2064
2064
|
lineHeight: theme.typography.lineHeight[24]
|
|
2065
2065
|
};
|
|
2066
2066
|
}
|
|
2067
|
-
case TypographyVariant
|
|
2067
|
+
case TypographyVariant.L2:
|
|
2068
2068
|
{
|
|
2069
2069
|
return {
|
|
2070
2070
|
fontSize: theme.typography.size[14],
|
|
@@ -2072,7 +2072,7 @@
|
|
|
2072
2072
|
lineHeight: theme.typography.lineHeight[20]
|
|
2073
2073
|
};
|
|
2074
2074
|
}
|
|
2075
|
-
case TypographyVariant
|
|
2075
|
+
case TypographyVariant.L3:
|
|
2076
2076
|
{
|
|
2077
2077
|
return {
|
|
2078
2078
|
fontSize: theme.typography.size[12],
|
|
@@ -2080,7 +2080,7 @@
|
|
|
2080
2080
|
lineHeight: theme.typography.lineHeight[16]
|
|
2081
2081
|
};
|
|
2082
2082
|
}
|
|
2083
|
-
case TypographyVariant
|
|
2083
|
+
case TypographyVariant.OVERLINE:
|
|
2084
2084
|
{
|
|
2085
2085
|
return {
|
|
2086
2086
|
fontSize: theme.typography.size[12],
|
|
@@ -2088,7 +2088,7 @@
|
|
|
2088
2088
|
lineHeight: theme.typography.lineHeight[16]
|
|
2089
2089
|
};
|
|
2090
2090
|
}
|
|
2091
|
-
case TypographyVariant
|
|
2091
|
+
case TypographyVariant.TAG:
|
|
2092
2092
|
{
|
|
2093
2093
|
return {
|
|
2094
2094
|
fontSize: theme.typography.size[10],
|
|
@@ -2107,122 +2107,122 @@
|
|
|
2107
2107
|
}
|
|
2108
2108
|
}
|
|
2109
2109
|
};
|
|
2110
|
-
const getTypographyColor
|
|
2110
|
+
const getTypographyColor = (theme, color) => {
|
|
2111
2111
|
switch (color) {
|
|
2112
|
-
case TypographyColor
|
|
2112
|
+
case TypographyColor.PRIMARY:
|
|
2113
2113
|
{
|
|
2114
2114
|
return theme.color.text.primary;
|
|
2115
2115
|
}
|
|
2116
|
-
case TypographyColor
|
|
2116
|
+
case TypographyColor.SECONDARY:
|
|
2117
2117
|
{
|
|
2118
2118
|
return theme.color.text.secondary;
|
|
2119
2119
|
}
|
|
2120
|
-
case TypographyColor
|
|
2120
|
+
case TypographyColor.TERTIARY:
|
|
2121
2121
|
{
|
|
2122
2122
|
return theme.color.text.tertiary;
|
|
2123
2123
|
}
|
|
2124
|
-
case TypographyColor
|
|
2124
|
+
case TypographyColor.ALERT:
|
|
2125
2125
|
{
|
|
2126
2126
|
return theme.color.text.alert;
|
|
2127
2127
|
}
|
|
2128
|
-
case TypographyColor
|
|
2128
|
+
case TypographyColor.DISABLED:
|
|
2129
2129
|
{
|
|
2130
2130
|
return theme.color.text.disabled;
|
|
2131
2131
|
}
|
|
2132
|
-
case TypographyColor
|
|
2132
|
+
case TypographyColor.HEADING:
|
|
2133
2133
|
{
|
|
2134
2134
|
return theme.color.text.heading;
|
|
2135
2135
|
}
|
|
2136
|
-
case TypographyColor
|
|
2136
|
+
case TypographyColor.LINK:
|
|
2137
2137
|
{
|
|
2138
2138
|
return theme.color.text.link;
|
|
2139
2139
|
}
|
|
2140
|
-
case TypographyColor
|
|
2140
|
+
case TypographyColor.SUBHEADING:
|
|
2141
2141
|
{
|
|
2142
2142
|
return theme.color.text.subHeading;
|
|
2143
2143
|
}
|
|
2144
|
-
case TypographyColor
|
|
2144
|
+
case TypographyColor.SUCCESS:
|
|
2145
2145
|
{
|
|
2146
2146
|
return theme.color.text.success;
|
|
2147
2147
|
}
|
|
2148
|
-
case TypographyColor
|
|
2148
|
+
case TypographyColor.WARNING:
|
|
2149
2149
|
{
|
|
2150
2150
|
return theme.color.text.warning;
|
|
2151
2151
|
}
|
|
2152
|
-
case TypographyColor
|
|
2152
|
+
case TypographyColor.NEUTRAL:
|
|
2153
2153
|
{
|
|
2154
2154
|
return theme.color.text.neutral;
|
|
2155
2155
|
}
|
|
2156
|
-
case TypographyColor
|
|
2156
|
+
case TypographyColor.LINK2:
|
|
2157
2157
|
{
|
|
2158
2158
|
return theme.color.text.link2;
|
|
2159
2159
|
}
|
|
2160
|
-
case TypographyColor
|
|
2160
|
+
case TypographyColor.PRIMARY2:
|
|
2161
2161
|
{
|
|
2162
2162
|
return theme.color.text.primary2;
|
|
2163
2163
|
}
|
|
2164
|
-
case TypographyColor
|
|
2164
|
+
case TypographyColor.SECONDARY2:
|
|
2165
2165
|
{
|
|
2166
2166
|
return theme.color.text.secondary2;
|
|
2167
2167
|
}
|
|
2168
|
-
case TypographyColor
|
|
2168
|
+
case TypographyColor.GRAPETINI:
|
|
2169
2169
|
{
|
|
2170
2170
|
return theme.color.text.grapetini900;
|
|
2171
2171
|
}
|
|
2172
|
-
case TypographyColor
|
|
2172
|
+
case TypographyColor.PINA_COLADA750:
|
|
2173
2173
|
{
|
|
2174
2174
|
return theme.color.text.pinaColada750;
|
|
2175
2175
|
}
|
|
2176
|
-
case TypographyColor
|
|
2176
|
+
case TypographyColor.CORALPINK:
|
|
2177
2177
|
{
|
|
2178
2178
|
return theme.color.text.coralpink;
|
|
2179
2179
|
}
|
|
2180
|
-
case TypographyColor
|
|
2180
|
+
case TypographyColor.NEUTRAL50:
|
|
2181
2181
|
{
|
|
2182
2182
|
return theme.color.text.neutral50;
|
|
2183
2183
|
}
|
|
2184
|
-
case TypographyColor
|
|
2185
|
-
case TypographyColor
|
|
2184
|
+
case TypographyColor.WARNING500:
|
|
2185
|
+
case TypographyColor.ALERT500:
|
|
2186
2186
|
{
|
|
2187
2187
|
return theme.color.text.alert500;
|
|
2188
2188
|
}
|
|
2189
|
-
case TypographyColor
|
|
2189
|
+
case TypographyColor.BRAND:
|
|
2190
2190
|
{
|
|
2191
2191
|
return theme.color.text.brand;
|
|
2192
2192
|
}
|
|
2193
|
-
case TypographyColor
|
|
2193
|
+
case TypographyColor.MARGARITA750:
|
|
2194
2194
|
{
|
|
2195
2195
|
return theme.color.text.margarita750;
|
|
2196
2196
|
}
|
|
2197
|
-
case TypographyColor
|
|
2197
|
+
case TypographyColor.GREEN100:
|
|
2198
2198
|
{
|
|
2199
2199
|
return theme.color.text.green100;
|
|
2200
2200
|
}
|
|
2201
|
-
case TypographyColor
|
|
2201
|
+
case TypographyColor.RED100:
|
|
2202
2202
|
{
|
|
2203
2203
|
return theme.color.text.red100;
|
|
2204
2204
|
}
|
|
2205
|
-
case TypographyColor
|
|
2205
|
+
case TypographyColor.ALERT300:
|
|
2206
2206
|
{
|
|
2207
2207
|
return theme.color.text.alert300;
|
|
2208
2208
|
}
|
|
2209
|
-
case TypographyColor
|
|
2209
|
+
case TypographyColor.RED500:
|
|
2210
2210
|
{
|
|
2211
2211
|
return theme.color.text.red500;
|
|
2212
2212
|
}
|
|
2213
|
-
case TypographyColor
|
|
2213
|
+
case TypographyColor.BLUE700:
|
|
2214
2214
|
{
|
|
2215
2215
|
return theme.color.text.blue700;
|
|
2216
2216
|
}
|
|
2217
|
-
case TypographyColor
|
|
2217
|
+
case TypographyColor.NEUTRAL650:
|
|
2218
2218
|
{
|
|
2219
2219
|
return theme.color.text.neutral650;
|
|
2220
2220
|
}
|
|
2221
|
-
case TypographyColor
|
|
2221
|
+
case TypographyColor.GREY700:
|
|
2222
2222
|
{
|
|
2223
2223
|
return theme.color.text.gray700;
|
|
2224
2224
|
}
|
|
2225
|
-
case TypographyColor
|
|
2225
|
+
case TypographyColor.BLACK000:
|
|
2226
2226
|
{
|
|
2227
2227
|
return theme.color.text.black000;
|
|
2228
2228
|
}
|
|
@@ -2232,7 +2232,7 @@
|
|
|
2232
2232
|
}
|
|
2233
2233
|
}
|
|
2234
2234
|
};
|
|
2235
|
-
const getLineClampStyles
|
|
2235
|
+
const getLineClampStyles = lineClamp => {
|
|
2236
2236
|
if (!lineClamp) {
|
|
2237
2237
|
return {};
|
|
2238
2238
|
}
|
|
@@ -2256,7 +2256,7 @@
|
|
|
2256
2256
|
minWidth: 0
|
|
2257
2257
|
};
|
|
2258
2258
|
};
|
|
2259
|
-
const getTypographyStyles
|
|
2259
|
+
const getTypographyStyles = ({
|
|
2260
2260
|
theme,
|
|
2261
2261
|
variant,
|
|
2262
2262
|
color,
|
|
@@ -2266,13 +2266,13 @@
|
|
|
2266
2266
|
showInItalics
|
|
2267
2267
|
}) => {
|
|
2268
2268
|
const textDecorationLine = isStriked ? 'line-through' : 'none';
|
|
2269
|
-
return Object.assign(Object.assign({}, getTypographyVariant
|
|
2270
|
-
color: colorCode || getTypographyColor
|
|
2269
|
+
return Object.assign(Object.assign({}, getTypographyVariant(theme, variant !== null && variant !== void 0 ? variant : TypographyVariant.HM2)), {
|
|
2270
|
+
color: colorCode || getTypographyColor(theme, color !== null && color !== void 0 ? color : TypographyColor.PRIMARY),
|
|
2271
2271
|
textDecorationLine: isUnderlined ? 'underline' : textDecorationLine,
|
|
2272
2272
|
fontStyle: showInItalics ? 'italic' : 'none'
|
|
2273
2273
|
});
|
|
2274
2274
|
};
|
|
2275
|
-
const getTextType
|
|
2275
|
+
const getTextType = variant => {
|
|
2276
2276
|
var _a;
|
|
2277
2277
|
const variantMapper = {
|
|
2278
2278
|
HD1: 'h1',
|
|
@@ -2302,10 +2302,10 @@
|
|
|
2302
2302
|
};
|
|
2303
2303
|
return (_a = variantMapper[variant]) !== null && _a !== void 0 ? _a : 'span';
|
|
2304
2304
|
};
|
|
2305
|
-
const Typography
|
|
2305
|
+
const Typography = ({
|
|
2306
2306
|
children = null,
|
|
2307
2307
|
variant,
|
|
2308
|
-
color = TypographyColor
|
|
2308
|
+
color = TypographyColor.PRIMARY,
|
|
2309
2309
|
isClickable,
|
|
2310
2310
|
isStriked = false,
|
|
2311
2311
|
isUnderlined = false,
|
|
@@ -2321,7 +2321,7 @@
|
|
|
2321
2321
|
const parsedIsClickable = typeof isClickable === 'boolean' ? isClickable : !!onClick;
|
|
2322
2322
|
const typographyStyles = ctDesignStyleManager.useStyles(theme => {
|
|
2323
2323
|
return {
|
|
2324
|
-
root: getTypographyStyles
|
|
2324
|
+
root: getTypographyStyles({
|
|
2325
2325
|
theme,
|
|
2326
2326
|
variant,
|
|
2327
2327
|
color,
|
|
@@ -2340,17 +2340,17 @@
|
|
|
2340
2340
|
container: customContainerStyles = []
|
|
2341
2341
|
} = styleConfig || {};
|
|
2342
2342
|
const clampClass = React.useMemo(() => {
|
|
2343
|
-
return /*#__PURE__*/css(getLineClampStyles
|
|
2343
|
+
return /*#__PURE__*/css(getLineClampStyles(lineClamp), "" , "" );
|
|
2344
2344
|
}, [lineClamp]);
|
|
2345
2345
|
const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([typographyStyles.root, clampClass, ...customRootStyles], [typographyStyles.root, clampClass, customRootStyles]);
|
|
2346
|
-
const ComponentToRender = lineClamp ? 'div' : componentNode || getTextType
|
|
2346
|
+
const ComponentToRender = lineClamp ? 'div' : componentNode || getTextType(variant) || 'p';
|
|
2347
2347
|
const isInlineNode = ComponentToRender === 'span';
|
|
2348
2348
|
if (parsedIsClickable) {
|
|
2349
2349
|
const containerAs = isInlineNode ? 'span' : 'div';
|
|
2350
2350
|
const clickableContainerStyles = isInlineNode ? [{
|
|
2351
2351
|
display: 'inline'
|
|
2352
2352
|
}, ...customContainerStyles] : customContainerStyles;
|
|
2353
|
-
return jsxRuntimeExports.jsx(Container
|
|
2353
|
+
return jsxRuntimeExports.jsx(Container, {
|
|
2354
2354
|
onClick: onClick,
|
|
2355
2355
|
styleConfig: {
|
|
2356
2356
|
root: clickableContainerStyles
|
|
@@ -2386,6 +2386,7 @@
|
|
|
2386
2386
|
BadgeColors["BLUE"] = "blue";
|
|
2387
2387
|
BadgeColors["DEFAULT"] = "default";
|
|
2388
2388
|
BadgeColors["GREEN"] = "green";
|
|
2389
|
+
BadgeColors["GREEN_500"] = "green500";
|
|
2389
2390
|
BadgeColors["MARGARITA_250"] = "margarita250";
|
|
2390
2391
|
BadgeColors["MARGARITA_100"] = "margarita100";
|
|
2391
2392
|
BadgeColors["MARGARITA_900"] = "margarita900";
|
|
@@ -2395,7 +2396,9 @@
|
|
|
2395
2396
|
BadgeColors["PINA_COLADA"] = "pinaColada";
|
|
2396
2397
|
BadgeColors["NEUTRAL_700"] = "neutral700";
|
|
2397
2398
|
BadgeColors["RED"] = "red";
|
|
2399
|
+
BadgeColors["RED_500"] = "red500";
|
|
2398
2400
|
BadgeColors["YELLOW"] = "yellow";
|
|
2401
|
+
BadgeColors["ALERT_500"] = "alert500";
|
|
2399
2402
|
BadgeColors["LINK"] = "link";
|
|
2400
2403
|
BadgeColors["LINK_TEXT"] = "linkText";
|
|
2401
2404
|
BadgeColors["BLUE100"] = "blue100";
|
|
@@ -2456,9 +2459,12 @@
|
|
|
2456
2459
|
[BadgeColors.ORANGE_250]: theme.color.badge.orange250,
|
|
2457
2460
|
[BadgeColors.ORANGE_500]: theme.color.badge.orange500,
|
|
2458
2461
|
[BadgeColors.PINA_COLADA]: theme.color.badge.pinaColada,
|
|
2462
|
+
[BadgeColors.NEUTRAL_700]: theme.color.badge.neutral700,
|
|
2459
2463
|
[BadgeColors.RED]: theme.color.badge.red,
|
|
2464
|
+
[BadgeColors.RED_500]: theme.color.badge.red500,
|
|
2460
2465
|
[BadgeColors.WHITE]: theme.color.badge.neutral100,
|
|
2461
2466
|
[BadgeColors.YELLOW]: theme.color.badge.yellow,
|
|
2467
|
+
[BadgeColors.ALERT_500]: theme.color.badge.alert500,
|
|
2462
2468
|
[BadgeColors.LINK]: theme.color.badge.link,
|
|
2463
2469
|
[BadgeColors.LINK_TEXT]: theme.color.badge.link,
|
|
2464
2470
|
[BadgeColors.BLUE100]: theme.color.badge.blue100,
|
|
@@ -2598,12 +2604,12 @@
|
|
|
2598
2604
|
}), getBadgePadding(theme, size)), getBadgeBorder(theme, colorScheme))
|
|
2599
2605
|
};
|
|
2600
2606
|
}, [colorScheme, size, textColor]);
|
|
2601
|
-
return jsxRuntimeExports.jsxs(Container
|
|
2607
|
+
return jsxRuntimeExports.jsxs(Container, {
|
|
2602
2608
|
ref: forwardedRef,
|
|
2603
2609
|
styleConfig: {
|
|
2604
2610
|
root: [badgeStaticStyles.root, dynamicStyles.root, ...root]
|
|
2605
2611
|
},
|
|
2606
|
-
children: [prefixIconNode, !!text && typeof text === 'string' ? jsxRuntimeExports.jsx(Typography
|
|
2612
|
+
children: [prefixIconNode, !!text && typeof text === 'string' ? jsxRuntimeExports.jsx(Typography, {
|
|
2607
2613
|
variant: getTextVariant(size),
|
|
2608
2614
|
styleConfig: {
|
|
2609
2615
|
root: textNodeContainer
|
|
@@ -2632,959 +2638,157 @@
|
|
|
2632
2638
|
}, refs);
|
|
2633
2639
|
};
|
|
2634
2640
|
|
|
2635
|
-
const
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
pointerEvents: 'auto'
|
|
2641
|
-
}
|
|
2642
|
-
};
|
|
2643
|
-
});
|
|
2644
|
-
function getPointerEventsStyles$1(pointerEvents) {
|
|
2645
|
-
if (pointerEvents === 'box-none') {
|
|
2646
|
-
return {
|
|
2647
|
-
pointerEvents: 'none',
|
|
2648
|
-
'& > *': {
|
|
2649
|
-
pointerEvents: 'auto'
|
|
2650
|
-
}
|
|
2651
|
-
};
|
|
2652
|
-
}
|
|
2653
|
-
if (pointerEvents === 'box-only') {
|
|
2654
|
-
return {
|
|
2655
|
-
pointerEvents: 'auto',
|
|
2656
|
-
'& > *': {
|
|
2657
|
-
pointerEvents: 'none'
|
|
2658
|
-
}
|
|
2659
|
-
};
|
|
2660
|
-
}
|
|
2661
|
-
if (pointerEvents === 'none') {
|
|
2662
|
-
return {
|
|
2663
|
-
pointerEvents: 'none'
|
|
2664
|
-
};
|
|
2665
|
-
}
|
|
2666
|
-
return {
|
|
2667
|
-
pointerEvents: 'auto'
|
|
2668
|
-
};
|
|
2669
|
-
}
|
|
2670
|
-
const Container$1 = React.forwardRef(({
|
|
2671
|
-
id,
|
|
2672
|
-
as: ContainerAs = 'div',
|
|
2673
|
-
children,
|
|
2674
|
-
styleConfig,
|
|
2675
|
-
onClick,
|
|
2676
|
-
onLayout,
|
|
2677
|
-
onMouseEnter,
|
|
2678
|
-
onMouseLeave,
|
|
2679
|
-
onTransitionEnd,
|
|
2680
|
-
onTouchStart,
|
|
2681
|
-
onTouchEnd,
|
|
2682
|
-
onTouchCancel,
|
|
2683
|
-
onTouchMove,
|
|
2684
|
-
pointerEvents,
|
|
2685
|
-
hitSlop: _hitSlop,
|
|
2686
|
-
hapticEnabled: _hapticEnabled,
|
|
2687
|
-
hapticVariant: _hapticVariant,
|
|
2688
|
-
hapticRepeat: _hapticRepeat
|
|
2689
|
-
}, forwardedRef) => {
|
|
2690
|
-
const localRef = React.useRef(null);
|
|
2691
|
-
const handleFocus = React.useCallback(() => {
|
|
2692
|
-
var _a;
|
|
2693
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
2694
|
-
}, []);
|
|
2695
|
-
const handleGetBoundingRect = React.useCallback(callback => {
|
|
2696
|
-
var _a;
|
|
2697
|
-
const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
2698
|
-
if (rect) {
|
|
2699
|
-
callback === null || callback === void 0 ? void 0 : callback({
|
|
2700
|
-
x: rect.x,
|
|
2701
|
-
y: rect.y,
|
|
2702
|
-
width: rect.width,
|
|
2703
|
-
height: rect.height
|
|
2704
|
-
});
|
|
2705
|
-
}
|
|
2706
|
-
}, []);
|
|
2707
|
-
const handleAddEventListener = React.useCallback((type, listener, options) => {
|
|
2708
|
-
var _a;
|
|
2709
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
|
|
2710
|
-
}, []);
|
|
2711
|
-
const handleRemoveEventListener = React.useCallback((type, listener, options) => {
|
|
2712
|
-
var _a;
|
|
2713
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
|
|
2714
|
-
}, []);
|
|
2715
|
-
React.useImperativeHandle(forwardedRef, () => {
|
|
2716
|
-
var _a;
|
|
2717
|
-
return {
|
|
2718
|
-
focus: handleFocus,
|
|
2719
|
-
getBoundingRectWithCallback: handleGetBoundingRect,
|
|
2720
|
-
getElementRef: () => localRef,
|
|
2721
|
-
style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
|
|
2722
|
-
classList: {
|
|
2723
|
-
add: className => {
|
|
2724
|
-
var _a;
|
|
2725
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
|
|
2726
|
-
}
|
|
2727
|
-
},
|
|
2728
|
-
measure: _callback => {
|
|
2729
|
-
var _a;
|
|
2730
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
2731
|
-
},
|
|
2732
|
-
addEventListener: handleAddEventListener,
|
|
2733
|
-
removeEventListener: handleRemoveEventListener
|
|
2734
|
-
};
|
|
2735
|
-
}, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
|
|
2736
|
-
const {
|
|
2737
|
-
root: rootStyles = []
|
|
2738
|
-
} = styleConfig || {};
|
|
2739
|
-
const pointerEventsStyle = React.useMemo(() => {
|
|
2740
|
-
if (pointerEvents == null) return null;
|
|
2741
|
-
return getPointerEventsStyles$1(pointerEvents);
|
|
2742
|
-
}, [pointerEvents]);
|
|
2743
|
-
const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles$1.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
|
|
2744
|
-
React.useLayoutEffect(() => {
|
|
2745
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2746
|
-
onLayout === null || onLayout === void 0 ? void 0 : onLayout({
|
|
2747
|
-
layout: {
|
|
2748
|
-
height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
|
|
2749
|
-
width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
|
|
2750
|
-
x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
|
|
2751
|
-
y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
|
|
2752
|
-
}
|
|
2753
|
-
});
|
|
2754
|
-
}, [onLayout]);
|
|
2755
|
-
return jsxRuntimeExports.jsx(ContainerAs, {
|
|
2756
|
-
id: id,
|
|
2757
|
-
ref: localRef,
|
|
2758
|
-
className: mergedRootStyles,
|
|
2759
|
-
onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
|
|
2760
|
-
stopPropagation: () => event.stopPropagation(),
|
|
2761
|
-
preventDefault: () => event.preventDefault(),
|
|
2762
|
-
nativeEvent: {
|
|
2763
|
-
locationX: event.clientX,
|
|
2764
|
-
locationY: event.clientY
|
|
2765
|
-
}
|
|
2766
|
-
}),
|
|
2767
|
-
onMouseEnter: onMouseEnter,
|
|
2768
|
-
onMouseLeave: onMouseLeave,
|
|
2769
|
-
onTransitionEnd: onTransitionEnd,
|
|
2770
|
-
onTouchStart: onTouchStart,
|
|
2771
|
-
onTouchEnd: onTouchEnd,
|
|
2772
|
-
onTouchCancel: onTouchCancel,
|
|
2773
|
-
onTouchMove: onTouchMove,
|
|
2774
|
-
children: children
|
|
2775
|
-
});
|
|
2776
|
-
});
|
|
2777
|
-
Container$1.displayName = 'Container';
|
|
2778
|
-
|
|
2779
|
-
const staticContainerStyles = ctDesignStyleManager.makeStyles(() => {
|
|
2780
|
-
return {
|
|
2781
|
-
root: {
|
|
2782
|
-
display: 'flex',
|
|
2783
|
-
flexDirection: 'column',
|
|
2784
|
-
pointerEvents: 'auto'
|
|
2785
|
-
}
|
|
2786
|
-
};
|
|
2787
|
-
});
|
|
2788
|
-
function getPointerEventsStyles(pointerEvents) {
|
|
2789
|
-
if (pointerEvents === 'box-none') {
|
|
2790
|
-
return {
|
|
2791
|
-
pointerEvents: 'none',
|
|
2792
|
-
'& > *': {
|
|
2793
|
-
pointerEvents: 'auto'
|
|
2794
|
-
}
|
|
2795
|
-
};
|
|
2796
|
-
}
|
|
2797
|
-
if (pointerEvents === 'box-only') {
|
|
2798
|
-
return {
|
|
2799
|
-
pointerEvents: 'auto',
|
|
2800
|
-
'& > *': {
|
|
2801
|
-
pointerEvents: 'none'
|
|
2802
|
-
}
|
|
2803
|
-
};
|
|
2804
|
-
}
|
|
2805
|
-
if (pointerEvents === 'none') {
|
|
2806
|
-
return {
|
|
2807
|
-
pointerEvents: 'none'
|
|
2808
|
-
};
|
|
2809
|
-
}
|
|
2810
|
-
return {
|
|
2811
|
-
pointerEvents: 'auto'
|
|
2812
|
-
};
|
|
2813
|
-
}
|
|
2814
|
-
const Container = React.forwardRef(({
|
|
2815
|
-
id,
|
|
2816
|
-
as: ContainerAs = 'div',
|
|
2817
|
-
children,
|
|
2818
|
-
styleConfig,
|
|
2819
|
-
onClick,
|
|
2820
|
-
onLayout,
|
|
2821
|
-
onMouseEnter,
|
|
2822
|
-
onMouseLeave,
|
|
2823
|
-
onTransitionEnd,
|
|
2824
|
-
onTouchStart,
|
|
2825
|
-
onTouchEnd,
|
|
2826
|
-
onTouchCancel,
|
|
2827
|
-
onTouchMove,
|
|
2828
|
-
pointerEvents,
|
|
2829
|
-
hitSlop: _hitSlop,
|
|
2830
|
-
hapticEnabled: _hapticEnabled,
|
|
2831
|
-
hapticVariant: _hapticVariant,
|
|
2832
|
-
hapticRepeat: _hapticRepeat
|
|
2833
|
-
}, forwardedRef) => {
|
|
2834
|
-
const localRef = React.useRef(null);
|
|
2835
|
-
const handleFocus = React.useCallback(() => {
|
|
2836
|
-
var _a;
|
|
2837
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
2838
|
-
}, []);
|
|
2839
|
-
const handleGetBoundingRect = React.useCallback(callback => {
|
|
2840
|
-
var _a;
|
|
2841
|
-
const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
2842
|
-
if (rect) {
|
|
2843
|
-
callback === null || callback === void 0 ? void 0 : callback({
|
|
2844
|
-
x: rect.x,
|
|
2845
|
-
y: rect.y,
|
|
2846
|
-
width: rect.width,
|
|
2847
|
-
height: rect.height
|
|
2848
|
-
});
|
|
2849
|
-
}
|
|
2850
|
-
}, []);
|
|
2851
|
-
const handleAddEventListener = React.useCallback((type, listener, options) => {
|
|
2852
|
-
var _a;
|
|
2853
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
|
|
2854
|
-
}, []);
|
|
2855
|
-
const handleRemoveEventListener = React.useCallback((type, listener, options) => {
|
|
2856
|
-
var _a;
|
|
2857
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
|
|
2858
|
-
}, []);
|
|
2859
|
-
React.useImperativeHandle(forwardedRef, () => {
|
|
2860
|
-
var _a;
|
|
2861
|
-
return {
|
|
2862
|
-
focus: handleFocus,
|
|
2863
|
-
getBoundingRectWithCallback: handleGetBoundingRect,
|
|
2864
|
-
getElementRef: () => localRef,
|
|
2865
|
-
style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
|
|
2866
|
-
classList: {
|
|
2867
|
-
add: className => {
|
|
2868
|
-
var _a;
|
|
2869
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
|
|
2870
|
-
}
|
|
2871
|
-
},
|
|
2872
|
-
measure: _callback => {
|
|
2873
|
-
var _a;
|
|
2874
|
-
(_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
2875
|
-
},
|
|
2876
|
-
addEventListener: handleAddEventListener,
|
|
2877
|
-
removeEventListener: handleRemoveEventListener
|
|
2878
|
-
};
|
|
2879
|
-
}, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
|
|
2880
|
-
const {
|
|
2881
|
-
root: rootStyles = []
|
|
2882
|
-
} = styleConfig || {};
|
|
2883
|
-
const pointerEventsStyle = React.useMemo(() => {
|
|
2884
|
-
if (pointerEvents == null) return null;
|
|
2885
|
-
return getPointerEventsStyles(pointerEvents);
|
|
2886
|
-
}, [pointerEvents]);
|
|
2887
|
-
const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
|
|
2888
|
-
React.useLayoutEffect(() => {
|
|
2889
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2890
|
-
onLayout === null || onLayout === void 0 ? void 0 : onLayout({
|
|
2891
|
-
layout: {
|
|
2892
|
-
height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
|
|
2893
|
-
width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
|
|
2894
|
-
x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
|
|
2895
|
-
y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
|
|
2896
|
-
}
|
|
2897
|
-
});
|
|
2898
|
-
}, [onLayout]);
|
|
2899
|
-
return jsxRuntimeExports.jsx(ContainerAs, {
|
|
2900
|
-
id: id,
|
|
2901
|
-
ref: localRef,
|
|
2902
|
-
className: mergedRootStyles,
|
|
2903
|
-
onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
|
|
2904
|
-
stopPropagation: () => event.stopPropagation(),
|
|
2905
|
-
preventDefault: () => event.preventDefault(),
|
|
2906
|
-
nativeEvent: {
|
|
2907
|
-
locationX: event.clientX,
|
|
2908
|
-
locationY: event.clientY
|
|
2909
|
-
}
|
|
2910
|
-
}),
|
|
2911
|
-
onMouseEnter: onMouseEnter,
|
|
2912
|
-
onMouseLeave: onMouseLeave,
|
|
2913
|
-
onTransitionEnd: onTransitionEnd,
|
|
2914
|
-
onTouchStart: onTouchStart,
|
|
2915
|
-
onTouchEnd: onTouchEnd,
|
|
2916
|
-
onTouchCancel: onTouchCancel,
|
|
2917
|
-
onTouchMove: onTouchMove,
|
|
2918
|
-
children: children
|
|
2919
|
-
});
|
|
2920
|
-
});
|
|
2921
|
-
Container.displayName = 'Container';
|
|
2922
|
-
|
|
2923
|
-
const horizontalScrollStyles = /*#__PURE__*/css({
|
|
2924
|
-
name: "1l33tog",
|
|
2925
|
-
styles: "display:flex;white-space:no-wrap;overflow-x:auto;scroll-behavior:smooth;-webkit-tap-highlight-color:transparent;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}"
|
|
2926
|
-
} );
|
|
2927
|
-
const HorizontalScroll = React.forwardRef(({
|
|
2641
|
+
const horizontalScrollStyles = /*#__PURE__*/css({
|
|
2642
|
+
name: "1l33tog",
|
|
2643
|
+
styles: "display:flex;white-space:no-wrap;overflow-x:auto;scroll-behavior:smooth;-webkit-tap-highlight-color:transparent;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}"
|
|
2644
|
+
} );
|
|
2645
|
+
const HorizontalScroll = React.forwardRef(({
|
|
2928
2646
|
children,
|
|
2929
2647
|
styleConfig = {},
|
|
2930
2648
|
onScroll
|
|
2931
|
-
}, forwardRef) => {
|
|
2932
|
-
const {
|
|
2933
|
-
root,
|
|
2934
|
-
childContainer
|
|
2935
|
-
} = styleConfig;
|
|
2936
|
-
const horizontalScrollRef = React.useRef(null);
|
|
2937
|
-
const parentContainerRef = React.useRef(null);
|
|
2938
|
-
const childContainerRef = React.useRef(null);
|
|
2939
|
-
const combinedParentContainerRef = useMergeRefs(parentContainerRef, forwardRef);
|
|
2940
|
-
const combinedParenAndChildContainerRef = useMergeRefs(parentContainerRef, childContainerRef);
|
|
2941
|
-
const rootStyles = ctDesignStyleManager.useWebMergeStyles([...(root || []), horizontalScrollStyles], [root]);
|
|
2942
|
-
const handleScroll = event => {
|
|
2943
|
-
onScroll === null || onScroll === void 0 ? void 0 : onScroll({
|
|
2944
|
-
nativeEvent: {
|
|
2945
|
-
contentOffset: {
|
|
2946
|
-
x: event.currentTarget.scrollLeft,
|
|
2947
|
-
y: event.currentTarget.scrollTop
|
|
2948
|
-
},
|
|
2949
|
-
layoutMeasurement: {
|
|
2950
|
-
height: event.currentTarget.clientHeight,
|
|
2951
|
-
width: event.currentTarget.clientWidth
|
|
2952
|
-
},
|
|
2953
|
-
contentSize: {
|
|
2954
|
-
height: event.currentTarget.scrollHeight,
|
|
2955
|
-
width: event.currentTarget.scrollWidth
|
|
2956
|
-
}
|
|
2957
|
-
}
|
|
2958
|
-
});
|
|
2959
|
-
};
|
|
2960
|
-
return jsxRuntimeExports.jsx("div", {
|
|
2961
|
-
ref: horizontalScrollRef,
|
|
2962
|
-
onScroll: handleScroll,
|
|
2963
|
-
children: jsxRuntimeExports.jsx("div", {
|
|
2964
|
-
ref: combinedParentContainerRef,
|
|
2965
|
-
className: rootStyles,
|
|
2966
|
-
children: jsxRuntimeExports.jsx(Container, {
|
|
2967
|
-
styleConfig: {
|
|
2968
|
-
root: childContainer
|
|
2969
|
-
},
|
|
2970
|
-
ref: combinedParenAndChildContainerRef,
|
|
2971
|
-
children: children
|
|
2972
|
-
})
|
|
2973
|
-
})
|
|
2974
|
-
});
|
|
2975
|
-
});
|
|
2976
|
-
HorizontalScroll.displayName = 'HorizontalScroll';
|
|
2977
|
-
var ARROW_DIRECTION;
|
|
2978
|
-
(function (ARROW_DIRECTION) {
|
|
2979
|
-
ARROW_DIRECTION["LEFT"] = "LEFT";
|
|
2980
|
-
ARROW_DIRECTION["RIGHT"] = "RIGHT";
|
|
2981
|
-
})(ARROW_DIRECTION || (ARROW_DIRECTION = {}));
|
|
2982
|
-
var ARROW_SIZE;
|
|
2983
|
-
(function (ARROW_SIZE) {
|
|
2984
|
-
ARROW_SIZE["SM"] = "sm";
|
|
2985
|
-
ARROW_SIZE["MD"] = "md";
|
|
2986
|
-
ARROW_SIZE["LG"] = "lg";
|
|
2987
|
-
})(ARROW_SIZE || (ARROW_SIZE = {}));
|
|
2988
|
-
|
|
2989
|
-
const staticGradientStyles = ctDesignStyleManager.makeStyles(() => ({
|
|
2990
|
-
root: {
|
|
2991
|
-
backgroundColor: 'linear-gradient(var(--angle), var(--colors))'
|
|
2992
|
-
}
|
|
2993
|
-
}));
|
|
2994
|
-
const matchLinearGradientString = gradientString => {
|
|
2995
|
-
const matches = gradientString.match(/linear-gradient\((\d+)deg,\s*([^)]+)\)/);
|
|
2996
|
-
if (!matches) return null;
|
|
2997
|
-
return {
|
|
2998
|
-
angle: parseInt(matches[1], 10),
|
|
2999
|
-
colors: matches[2].split(',').map(color => color.trim())
|
|
3000
|
-
};
|
|
3001
|
-
};
|
|
3002
|
-
const parseGradientStringNative = gradientString => {
|
|
3003
|
-
const parsed = matchLinearGradientString(gradientString);
|
|
3004
|
-
if (!parsed) return null;
|
|
3005
|
-
const rad = parsed.angle * Math.PI / 180;
|
|
3006
|
-
const start = {
|
|
3007
|
-
x: 0,
|
|
3008
|
-
y: 0
|
|
3009
|
-
};
|
|
3010
|
-
const end = {
|
|
3011
|
-
x: Math.sin(rad),
|
|
3012
|
-
y: Math.cos(rad)
|
|
3013
|
-
};
|
|
3014
|
-
return {
|
|
3015
|
-
colors: parsed.colors,
|
|
3016
|
-
start,
|
|
3017
|
-
end
|
|
3018
|
-
};
|
|
3019
|
-
};
|
|
3020
|
-
const buildWebGradientBackground = (colors, start, end, locations) => {
|
|
3021
|
-
const dx = end.x - start.x;
|
|
3022
|
-
const dy = end.y - start.y;
|
|
3023
|
-
const angleDeg = Math.round(Math.atan2(dy, dx) * 180 / Math.PI + 90);
|
|
3024
|
-
const stops = colors.map((color, index) => {
|
|
3025
|
-
var _a;
|
|
3026
|
-
if (colors.length === 1) {
|
|
3027
|
-
return color;
|
|
3028
|
-
}
|
|
3029
|
-
const location = (_a = locations === null || locations === void 0 ? void 0 : locations[index]) !== null && _a !== void 0 ? _a : index / (colors.length - 1);
|
|
3030
|
-
return `${color} ${Math.round(location * 100)}%`;
|
|
3031
|
-
});
|
|
3032
|
-
return `linear-gradient(${angleDeg}deg, ${stops.join(', ')})`;
|
|
3033
|
-
};
|
|
3034
|
-
const LinearGradient = ({
|
|
3035
|
-
colors = ['white', 'white'],
|
|
3036
|
-
locations,
|
|
3037
|
-
start = {
|
|
3038
|
-
x: 0,
|
|
3039
|
-
y: 0
|
|
3040
|
-
},
|
|
3041
|
-
end = {
|
|
3042
|
-
x: 0,
|
|
3043
|
-
y: 1
|
|
3044
|
-
},
|
|
3045
|
-
styleConfig = {
|
|
3046
|
-
root: []
|
|
3047
|
-
},
|
|
3048
|
-
children,
|
|
3049
|
-
bgGradient
|
|
3050
|
-
}) => {
|
|
3051
|
-
const className = ctDesignStyleManager.useWebMergeStyles([staticGradientStyles.root, ...styleConfig.root], [styleConfig.root]);
|
|
3052
|
-
const backgroundImage = React.useMemo(() => {
|
|
3053
|
-
if (bgGradient) {
|
|
3054
|
-
const trimmed = bgGradient.trim();
|
|
3055
|
-
if (/^linear-gradient\s*\(/i.test(trimmed)) {
|
|
3056
|
-
return trimmed;
|
|
3057
|
-
}
|
|
3058
|
-
const parsed = parseGradientStringNative(bgGradient);
|
|
3059
|
-
if (parsed) {
|
|
3060
|
-
return buildWebGradientBackground(parsed.colors, parsed.start, parsed.end, locations);
|
|
3061
|
-
}
|
|
3062
|
-
}
|
|
3063
|
-
return buildWebGradientBackground(colors, start, end, locations);
|
|
3064
|
-
}, [bgGradient, colors, start, end, locations]);
|
|
3065
|
-
return jsxRuntimeExports.jsx("div", {
|
|
3066
|
-
className: className,
|
|
3067
|
-
style: {
|
|
3068
|
-
backgroundImage
|
|
3069
|
-
},
|
|
3070
|
-
children: children
|
|
3071
|
-
});
|
|
3072
|
-
};
|
|
3073
|
-
var LinearGradient$1 = React__default.default.memo(LinearGradient);
|
|
3074
|
-
|
|
3075
|
-
var TypographyVariant;
|
|
3076
|
-
(function (TypographyVariant) {
|
|
3077
|
-
TypographyVariant["HD1"] = "HD1";
|
|
3078
|
-
TypographyVariant["HD2"] = "HD2";
|
|
3079
|
-
TypographyVariant["HD3"] = "HD3";
|
|
3080
|
-
TypographyVariant["HM1"] = "HM1";
|
|
3081
|
-
TypographyVariant["HM2"] = "HM2";
|
|
3082
|
-
TypographyVariant["HM3"] = "HM3";
|
|
3083
|
-
TypographyVariant["HM4"] = "HM4";
|
|
3084
|
-
TypographyVariant["B1"] = "B1";
|
|
3085
|
-
TypographyVariant["B2"] = "B2";
|
|
3086
|
-
TypographyVariant["B3"] = "B3";
|
|
3087
|
-
TypographyVariant["B3CAPS"] = "B3CAPS";
|
|
3088
|
-
TypographyVariant["B4"] = "B4";
|
|
3089
|
-
TypographyVariant["B4CAPS"] = "B4CAPS";
|
|
3090
|
-
TypographyVariant["P1"] = "P1";
|
|
3091
|
-
TypographyVariant["P2"] = "P2";
|
|
3092
|
-
TypographyVariant["P3"] = "P3";
|
|
3093
|
-
TypographyVariant["P4"] = "P4";
|
|
3094
|
-
TypographyVariant["L1"] = "L1";
|
|
3095
|
-
TypographyVariant["L2"] = "L2";
|
|
3096
|
-
TypographyVariant["L3"] = "L3";
|
|
3097
|
-
TypographyVariant["OVERLINE"] = "OVERLINE";
|
|
3098
|
-
TypographyVariant["TAG"] = "TAG";
|
|
3099
|
-
TypographyVariant["M4BOLD"] = "M4BOLD";
|
|
3100
|
-
TypographyVariant["WRAPPER"] = "WRAPPER";
|
|
3101
|
-
})(TypographyVariant || (TypographyVariant = {}));
|
|
3102
|
-
var TypographyColor;
|
|
3103
|
-
(function (TypographyColor) {
|
|
3104
|
-
TypographyColor["PRIMARY"] = "primary";
|
|
3105
|
-
TypographyColor["SECONDARY"] = "secondary";
|
|
3106
|
-
TypographyColor["TERTIARY"] = "tertiary";
|
|
3107
|
-
TypographyColor["HEADING"] = "heading";
|
|
3108
|
-
TypographyColor["SUBHEADING"] = "subheading";
|
|
3109
|
-
TypographyColor["SUCCESS"] = "success";
|
|
3110
|
-
TypographyColor["ALERT"] = "alert";
|
|
3111
|
-
TypographyColor["WARNING"] = "warning";
|
|
3112
|
-
TypographyColor["DISABLED"] = "disabled";
|
|
3113
|
-
TypographyColor["LINK"] = "link";
|
|
3114
|
-
TypographyColor["NEUTRAL"] = "neutral";
|
|
3115
|
-
TypographyColor["LINK2"] = "link2";
|
|
3116
|
-
TypographyColor["PRIMARY2"] = "primary2";
|
|
3117
|
-
TypographyColor["SECONDARY2"] = "secondary2";
|
|
3118
|
-
TypographyColor["GRAPETINI"] = "grapetini900";
|
|
3119
|
-
TypographyColor["PINA_COLADA750"] = "pinacolada750";
|
|
3120
|
-
TypographyColor["BRAND"] = "brand";
|
|
3121
|
-
TypographyColor["ALERT500"] = "alert500";
|
|
3122
|
-
TypographyColor["NEUTRAL50"] = "neutral50";
|
|
3123
|
-
TypographyColor["MARGARITA750"] = "margarita750";
|
|
3124
|
-
TypographyColor["GREEN100"] = "green100";
|
|
3125
|
-
TypographyColor["RED100"] = "red100";
|
|
3126
|
-
TypographyColor["ALERT300"] = "alert300";
|
|
3127
|
-
TypographyColor["RED500"] = "red500";
|
|
3128
|
-
TypographyColor["CORALPINK"] = "coralpink";
|
|
3129
|
-
TypographyColor["WARNING500"] = "warning500";
|
|
3130
|
-
TypographyColor["BLUE700"] = "blue700";
|
|
3131
|
-
TypographyColor["NEUTRAL650"] = "neutral650";
|
|
3132
|
-
TypographyColor["GREY700"] = "grey700";
|
|
3133
|
-
TypographyColor["BLACK000"] = "black000";
|
|
3134
|
-
})(TypographyColor || (TypographyColor = {}));
|
|
3135
|
-
const getTypographyVariant = (theme, variant) => {
|
|
3136
|
-
switch (variant) {
|
|
3137
|
-
case TypographyVariant.HD1:
|
|
3138
|
-
{
|
|
3139
|
-
return {
|
|
3140
|
-
fontSize: theme.typography.size[48],
|
|
3141
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3142
|
-
lineHeight: theme.typography.lineHeight[56]
|
|
3143
|
-
};
|
|
3144
|
-
}
|
|
3145
|
-
case TypographyVariant.HD2:
|
|
3146
|
-
{
|
|
3147
|
-
return {
|
|
3148
|
-
fontSize: theme.typography.size[40],
|
|
3149
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3150
|
-
lineHeight: theme.typography.lineHeight[48]
|
|
3151
|
-
};
|
|
3152
|
-
}
|
|
3153
|
-
case TypographyVariant.HD3:
|
|
3154
|
-
{
|
|
3155
|
-
return {
|
|
3156
|
-
fontSize: theme.typography.size[32],
|
|
3157
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3158
|
-
lineHeight: theme.typography.lineHeight[40]
|
|
3159
|
-
};
|
|
3160
|
-
}
|
|
3161
|
-
case TypographyVariant.HM1:
|
|
3162
|
-
{
|
|
3163
|
-
return {
|
|
3164
|
-
fontSize: theme.typography.size[24],
|
|
3165
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3166
|
-
lineHeight: theme.typography.lineHeight[32]
|
|
3167
|
-
};
|
|
3168
|
-
}
|
|
3169
|
-
case TypographyVariant.HM2:
|
|
3170
|
-
{
|
|
3171
|
-
return {
|
|
3172
|
-
fontSize: theme.typography.size[20],
|
|
3173
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3174
|
-
lineHeight: theme.typography.lineHeight[28]
|
|
3175
|
-
};
|
|
3176
|
-
}
|
|
3177
|
-
case TypographyVariant.HM3:
|
|
3178
|
-
{
|
|
3179
|
-
return {
|
|
3180
|
-
fontSize: theme.typography.size[16],
|
|
3181
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3182
|
-
lineHeight: theme.typography.lineHeight[24]
|
|
3183
|
-
};
|
|
3184
|
-
}
|
|
3185
|
-
case TypographyVariant.HM4:
|
|
3186
|
-
{
|
|
3187
|
-
return {
|
|
3188
|
-
fontSize: theme.typography.size[14],
|
|
3189
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3190
|
-
lineHeight: theme.typography.lineHeight[20]
|
|
3191
|
-
};
|
|
3192
|
-
}
|
|
3193
|
-
case TypographyVariant.B1:
|
|
3194
|
-
{
|
|
3195
|
-
return {
|
|
3196
|
-
fontSize: theme.typography.size[16],
|
|
3197
|
-
fontWeight: theme.typography.weight.medium,
|
|
3198
|
-
lineHeight: theme.typography.lineHeight[24]
|
|
3199
|
-
};
|
|
3200
|
-
}
|
|
3201
|
-
case TypographyVariant.B2:
|
|
3202
|
-
{
|
|
3203
|
-
return {
|
|
3204
|
-
fontSize: theme.typography.size[14],
|
|
3205
|
-
fontWeight: theme.typography.weight.medium,
|
|
3206
|
-
lineHeight: theme.typography.lineHeight[20]
|
|
3207
|
-
};
|
|
3208
|
-
}
|
|
3209
|
-
case TypographyVariant.B3:
|
|
3210
|
-
{
|
|
3211
|
-
return {
|
|
3212
|
-
fontSize: theme.typography.size[12],
|
|
3213
|
-
fontWeight: theme.typography.weight.medium,
|
|
3214
|
-
lineHeight: theme.typography.lineHeight[16]
|
|
3215
|
-
};
|
|
3216
|
-
}
|
|
3217
|
-
case TypographyVariant.B3CAPS:
|
|
3218
|
-
{
|
|
3219
|
-
return {
|
|
3220
|
-
fontSize: theme.typography.size[12],
|
|
3221
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3222
|
-
lineHeight: theme.typography.lineHeight[16],
|
|
3223
|
-
letterSpacing: theme.typography.letterSpacing.point4,
|
|
3224
|
-
textTransform: 'uppercase'
|
|
3225
|
-
};
|
|
3226
|
-
}
|
|
3227
|
-
case TypographyVariant.B4:
|
|
3228
|
-
{
|
|
3229
|
-
return {
|
|
3230
|
-
fontSize: theme.typography.size[10],
|
|
3231
|
-
fontWeight: theme.typography.weight.medium,
|
|
3232
|
-
lineHeight: theme.typography.lineHeight[14]
|
|
3233
|
-
};
|
|
3234
|
-
}
|
|
3235
|
-
case TypographyVariant.B4CAPS:
|
|
3236
|
-
{
|
|
3237
|
-
return {
|
|
3238
|
-
fontSize: theme.typography.size[10],
|
|
3239
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3240
|
-
lineHeight: theme.typography.lineHeight[12],
|
|
3241
|
-
letterSpacing: theme.typography.letterSpacing.point4,
|
|
3242
|
-
textTransform: 'uppercase'
|
|
3243
|
-
};
|
|
3244
|
-
}
|
|
3245
|
-
case TypographyVariant.P1:
|
|
3246
|
-
{
|
|
3247
|
-
return {
|
|
3248
|
-
fontSize: theme.typography.size[16],
|
|
3249
|
-
fontWeight: theme.typography.weight.normal,
|
|
3250
|
-
lineHeight: theme.typography.lineHeight[22]
|
|
3251
|
-
};
|
|
3252
|
-
}
|
|
3253
|
-
case TypographyVariant.P2:
|
|
3254
|
-
{
|
|
3255
|
-
return {
|
|
3256
|
-
fontSize: theme.typography.size[14],
|
|
3257
|
-
fontWeight: theme.typography.weight.normal,
|
|
3258
|
-
lineHeight: theme.typography.lineHeight[20]
|
|
3259
|
-
};
|
|
3260
|
-
}
|
|
3261
|
-
case TypographyVariant.P3:
|
|
3262
|
-
{
|
|
3263
|
-
return {
|
|
3264
|
-
fontSize: theme.typography.size[12],
|
|
3265
|
-
fontWeight: theme.typography.weight.normal,
|
|
3266
|
-
lineHeight: theme.typography.lineHeight[16]
|
|
3267
|
-
};
|
|
3268
|
-
}
|
|
3269
|
-
case TypographyVariant.P4:
|
|
3270
|
-
{
|
|
3271
|
-
return {
|
|
3272
|
-
fontSize: theme.typography.size[10],
|
|
3273
|
-
fontWeight: theme.typography.weight.normal,
|
|
3274
|
-
lineHeight: theme.typography.lineHeight[14]
|
|
3275
|
-
};
|
|
3276
|
-
}
|
|
3277
|
-
case TypographyVariant.L1:
|
|
3278
|
-
{
|
|
3279
|
-
return {
|
|
3280
|
-
fontSize: theme.typography.size[16],
|
|
3281
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3282
|
-
lineHeight: theme.typography.lineHeight[24]
|
|
3283
|
-
};
|
|
3284
|
-
}
|
|
3285
|
-
case TypographyVariant.L2:
|
|
3286
|
-
{
|
|
3287
|
-
return {
|
|
3288
|
-
fontSize: theme.typography.size[14],
|
|
3289
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3290
|
-
lineHeight: theme.typography.lineHeight[20]
|
|
3291
|
-
};
|
|
3292
|
-
}
|
|
3293
|
-
case TypographyVariant.L3:
|
|
3294
|
-
{
|
|
3295
|
-
return {
|
|
3296
|
-
fontSize: theme.typography.size[12],
|
|
3297
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3298
|
-
lineHeight: theme.typography.lineHeight[16]
|
|
3299
|
-
};
|
|
3300
|
-
}
|
|
3301
|
-
case TypographyVariant.OVERLINE:
|
|
3302
|
-
{
|
|
3303
|
-
return {
|
|
3304
|
-
fontSize: theme.typography.size[12],
|
|
3305
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3306
|
-
lineHeight: theme.typography.lineHeight[16]
|
|
3307
|
-
};
|
|
3308
|
-
}
|
|
3309
|
-
case TypographyVariant.TAG:
|
|
3310
|
-
{
|
|
3311
|
-
return {
|
|
3312
|
-
fontSize: theme.typography.size[10],
|
|
3313
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3314
|
-
lineHeight: theme.typography.lineHeight[12],
|
|
3315
|
-
letterSpacing: theme.typography.letterSpacing.point4
|
|
3316
|
-
};
|
|
3317
|
-
}
|
|
3318
|
-
default:
|
|
3319
|
-
{
|
|
3320
|
-
return {
|
|
3321
|
-
fontSize: theme.typography.size[20],
|
|
3322
|
-
fontWeight: theme.typography.weight.semibold,
|
|
3323
|
-
lineHeight: theme.typography.lineHeight[28]
|
|
3324
|
-
};
|
|
3325
|
-
}
|
|
3326
|
-
}
|
|
3327
|
-
};
|
|
3328
|
-
const getTypographyColor = (theme, color) => {
|
|
3329
|
-
switch (color) {
|
|
3330
|
-
case TypographyColor.PRIMARY:
|
|
3331
|
-
{
|
|
3332
|
-
return theme.color.text.primary;
|
|
3333
|
-
}
|
|
3334
|
-
case TypographyColor.SECONDARY:
|
|
3335
|
-
{
|
|
3336
|
-
return theme.color.text.secondary;
|
|
3337
|
-
}
|
|
3338
|
-
case TypographyColor.TERTIARY:
|
|
3339
|
-
{
|
|
3340
|
-
return theme.color.text.tertiary;
|
|
3341
|
-
}
|
|
3342
|
-
case TypographyColor.ALERT:
|
|
3343
|
-
{
|
|
3344
|
-
return theme.color.text.alert;
|
|
3345
|
-
}
|
|
3346
|
-
case TypographyColor.DISABLED:
|
|
3347
|
-
{
|
|
3348
|
-
return theme.color.text.disabled;
|
|
3349
|
-
}
|
|
3350
|
-
case TypographyColor.HEADING:
|
|
3351
|
-
{
|
|
3352
|
-
return theme.color.text.heading;
|
|
3353
|
-
}
|
|
3354
|
-
case TypographyColor.LINK:
|
|
3355
|
-
{
|
|
3356
|
-
return theme.color.text.link;
|
|
3357
|
-
}
|
|
3358
|
-
case TypographyColor.SUBHEADING:
|
|
3359
|
-
{
|
|
3360
|
-
return theme.color.text.subHeading;
|
|
3361
|
-
}
|
|
3362
|
-
case TypographyColor.SUCCESS:
|
|
3363
|
-
{
|
|
3364
|
-
return theme.color.text.success;
|
|
3365
|
-
}
|
|
3366
|
-
case TypographyColor.WARNING:
|
|
3367
|
-
{
|
|
3368
|
-
return theme.color.text.warning;
|
|
3369
|
-
}
|
|
3370
|
-
case TypographyColor.NEUTRAL:
|
|
3371
|
-
{
|
|
3372
|
-
return theme.color.text.neutral;
|
|
3373
|
-
}
|
|
3374
|
-
case TypographyColor.LINK2:
|
|
3375
|
-
{
|
|
3376
|
-
return theme.color.text.link2;
|
|
3377
|
-
}
|
|
3378
|
-
case TypographyColor.PRIMARY2:
|
|
3379
|
-
{
|
|
3380
|
-
return theme.color.text.primary2;
|
|
3381
|
-
}
|
|
3382
|
-
case TypographyColor.SECONDARY2:
|
|
3383
|
-
{
|
|
3384
|
-
return theme.color.text.secondary2;
|
|
3385
|
-
}
|
|
3386
|
-
case TypographyColor.GRAPETINI:
|
|
3387
|
-
{
|
|
3388
|
-
return theme.color.text.grapetini900;
|
|
3389
|
-
}
|
|
3390
|
-
case TypographyColor.PINA_COLADA750:
|
|
3391
|
-
{
|
|
3392
|
-
return theme.color.text.pinaColada750;
|
|
3393
|
-
}
|
|
3394
|
-
case TypographyColor.CORALPINK:
|
|
3395
|
-
{
|
|
3396
|
-
return theme.color.text.coralpink;
|
|
3397
|
-
}
|
|
3398
|
-
case TypographyColor.NEUTRAL50:
|
|
3399
|
-
{
|
|
3400
|
-
return theme.color.text.neutral50;
|
|
3401
|
-
}
|
|
3402
|
-
case TypographyColor.WARNING500:
|
|
3403
|
-
case TypographyColor.ALERT500:
|
|
3404
|
-
{
|
|
3405
|
-
return theme.color.text.alert500;
|
|
3406
|
-
}
|
|
3407
|
-
case TypographyColor.BRAND:
|
|
3408
|
-
{
|
|
3409
|
-
return theme.color.text.brand;
|
|
3410
|
-
}
|
|
3411
|
-
case TypographyColor.MARGARITA750:
|
|
3412
|
-
{
|
|
3413
|
-
return theme.color.text.margarita750;
|
|
3414
|
-
}
|
|
3415
|
-
case TypographyColor.GREEN100:
|
|
3416
|
-
{
|
|
3417
|
-
return theme.color.text.green100;
|
|
3418
|
-
}
|
|
3419
|
-
case TypographyColor.RED100:
|
|
3420
|
-
{
|
|
3421
|
-
return theme.color.text.red100;
|
|
3422
|
-
}
|
|
3423
|
-
case TypographyColor.ALERT300:
|
|
3424
|
-
{
|
|
3425
|
-
return theme.color.text.alert300;
|
|
3426
|
-
}
|
|
3427
|
-
case TypographyColor.RED500:
|
|
3428
|
-
{
|
|
3429
|
-
return theme.color.text.red500;
|
|
3430
|
-
}
|
|
3431
|
-
case TypographyColor.BLUE700:
|
|
3432
|
-
{
|
|
3433
|
-
return theme.color.text.blue700;
|
|
3434
|
-
}
|
|
3435
|
-
case TypographyColor.NEUTRAL650:
|
|
3436
|
-
{
|
|
3437
|
-
return theme.color.text.neutral650;
|
|
3438
|
-
}
|
|
3439
|
-
case TypographyColor.GREY700:
|
|
3440
|
-
{
|
|
3441
|
-
return theme.color.text.gray700;
|
|
3442
|
-
}
|
|
3443
|
-
case TypographyColor.BLACK000:
|
|
3444
|
-
{
|
|
3445
|
-
return theme.color.text.black000;
|
|
3446
|
-
}
|
|
3447
|
-
default:
|
|
3448
|
-
{
|
|
3449
|
-
return theme.color.text.primary;
|
|
2649
|
+
}, forwardRef) => {
|
|
2650
|
+
const {
|
|
2651
|
+
root,
|
|
2652
|
+
childContainer
|
|
2653
|
+
} = styleConfig;
|
|
2654
|
+
const horizontalScrollRef = React.useRef(null);
|
|
2655
|
+
const parentContainerRef = React.useRef(null);
|
|
2656
|
+
const childContainerRef = React.useRef(null);
|
|
2657
|
+
const combinedParentContainerRef = useMergeRefs(parentContainerRef, forwardRef);
|
|
2658
|
+
const combinedParenAndChildContainerRef = useMergeRefs(parentContainerRef, childContainerRef);
|
|
2659
|
+
const rootStyles = ctDesignStyleManager.useWebMergeStyles([...(root || []), horizontalScrollStyles], [root]);
|
|
2660
|
+
const handleScroll = event => {
|
|
2661
|
+
onScroll === null || onScroll === void 0 ? void 0 : onScroll({
|
|
2662
|
+
nativeEvent: {
|
|
2663
|
+
contentOffset: {
|
|
2664
|
+
x: event.currentTarget.scrollLeft,
|
|
2665
|
+
y: event.currentTarget.scrollTop
|
|
2666
|
+
},
|
|
2667
|
+
layoutMeasurement: {
|
|
2668
|
+
height: event.currentTarget.clientHeight,
|
|
2669
|
+
width: event.currentTarget.clientWidth
|
|
2670
|
+
},
|
|
2671
|
+
contentSize: {
|
|
2672
|
+
height: event.currentTarget.scrollHeight,
|
|
2673
|
+
width: event.currentTarget.scrollWidth
|
|
2674
|
+
}
|
|
3450
2675
|
}
|
|
2676
|
+
});
|
|
2677
|
+
};
|
|
2678
|
+
return jsxRuntimeExports.jsx("div", {
|
|
2679
|
+
ref: horizontalScrollRef,
|
|
2680
|
+
onScroll: handleScroll,
|
|
2681
|
+
children: jsxRuntimeExports.jsx("div", {
|
|
2682
|
+
ref: combinedParentContainerRef,
|
|
2683
|
+
className: rootStyles,
|
|
2684
|
+
children: jsxRuntimeExports.jsx(Container, {
|
|
2685
|
+
styleConfig: {
|
|
2686
|
+
root: childContainer
|
|
2687
|
+
},
|
|
2688
|
+
ref: combinedParenAndChildContainerRef,
|
|
2689
|
+
children: children
|
|
2690
|
+
})
|
|
2691
|
+
})
|
|
2692
|
+
});
|
|
2693
|
+
});
|
|
2694
|
+
HorizontalScroll.displayName = 'HorizontalScroll';
|
|
2695
|
+
var ARROW_DIRECTION;
|
|
2696
|
+
(function (ARROW_DIRECTION) {
|
|
2697
|
+
ARROW_DIRECTION["LEFT"] = "LEFT";
|
|
2698
|
+
ARROW_DIRECTION["RIGHT"] = "RIGHT";
|
|
2699
|
+
})(ARROW_DIRECTION || (ARROW_DIRECTION = {}));
|
|
2700
|
+
var ARROW_SIZE;
|
|
2701
|
+
(function (ARROW_SIZE) {
|
|
2702
|
+
ARROW_SIZE["SM"] = "sm";
|
|
2703
|
+
ARROW_SIZE["MD"] = "md";
|
|
2704
|
+
ARROW_SIZE["LG"] = "lg";
|
|
2705
|
+
})(ARROW_SIZE || (ARROW_SIZE = {}));
|
|
2706
|
+
|
|
2707
|
+
const staticGradientStyles = ctDesignStyleManager.makeStyles(() => ({
|
|
2708
|
+
root: {
|
|
2709
|
+
backgroundColor: 'linear-gradient(var(--angle), var(--colors))'
|
|
3451
2710
|
}
|
|
2711
|
+
}));
|
|
2712
|
+
const matchLinearGradientString = gradientString => {
|
|
2713
|
+
const matches = gradientString.match(/linear-gradient\((\d+)deg,\s*([^)]+)\)/);
|
|
2714
|
+
if (!matches) return null;
|
|
2715
|
+
return {
|
|
2716
|
+
angle: parseInt(matches[1], 10),
|
|
2717
|
+
colors: matches[2].split(',').map(color => color.trim())
|
|
2718
|
+
};
|
|
3452
2719
|
};
|
|
3453
|
-
const
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
};
|
|
3466
|
-
}
|
|
2720
|
+
const parseGradientStringNative = gradientString => {
|
|
2721
|
+
const parsed = matchLinearGradientString(gradientString);
|
|
2722
|
+
if (!parsed) return null;
|
|
2723
|
+
const rad = parsed.angle * Math.PI / 180;
|
|
2724
|
+
const start = {
|
|
2725
|
+
x: 0,
|
|
2726
|
+
y: 0
|
|
2727
|
+
};
|
|
2728
|
+
const end = {
|
|
2729
|
+
x: Math.sin(rad),
|
|
2730
|
+
y: Math.cos(rad)
|
|
2731
|
+
};
|
|
3467
2732
|
return {
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
overflow: 'hidden',
|
|
3472
|
-
textOverflow: 'ellipsis',
|
|
3473
|
-
width: '100%',
|
|
3474
|
-
minWidth: 0
|
|
2733
|
+
colors: parsed.colors,
|
|
2734
|
+
start,
|
|
2735
|
+
end
|
|
3475
2736
|
};
|
|
3476
2737
|
};
|
|
3477
|
-
const
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
color: colorCode || getTypographyColor(theme, color !== null && color !== void 0 ? color : TypographyColor.PRIMARY),
|
|
3489
|
-
textDecorationLine: isUnderlined ? 'underline' : textDecorationLine,
|
|
3490
|
-
fontStyle: showInItalics ? 'italic' : 'none'
|
|
2738
|
+
const buildWebGradientBackground = (colors, start, end, locations) => {
|
|
2739
|
+
const dx = end.x - start.x;
|
|
2740
|
+
const dy = end.y - start.y;
|
|
2741
|
+
const angleDeg = Math.round(Math.atan2(dy, dx) * 180 / Math.PI + 90);
|
|
2742
|
+
const stops = colors.map((color, index) => {
|
|
2743
|
+
var _a;
|
|
2744
|
+
if (colors.length === 1) {
|
|
2745
|
+
return color;
|
|
2746
|
+
}
|
|
2747
|
+
const location = (_a = locations === null || locations === void 0 ? void 0 : locations[index]) !== null && _a !== void 0 ? _a : index / (colors.length - 1);
|
|
2748
|
+
return `${color} ${Math.round(location * 100)}%`;
|
|
3491
2749
|
});
|
|
2750
|
+
return `linear-gradient(${angleDeg}deg, ${stops.join(', ')})`;
|
|
3492
2751
|
};
|
|
3493
|
-
const
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
P3: 'span',
|
|
3510
|
-
P4: 'span',
|
|
3511
|
-
L1: 'span',
|
|
3512
|
-
L2: 'span',
|
|
3513
|
-
L3: 'span',
|
|
3514
|
-
M4BOLD: 'span',
|
|
3515
|
-
B4CAPS: 'div',
|
|
3516
|
-
OVERLINE: 'div',
|
|
3517
|
-
B3CAPS: 'div',
|
|
3518
|
-
TAG: 'div',
|
|
3519
|
-
WRAPPER: 'div'
|
|
3520
|
-
};
|
|
3521
|
-
return (_a = variantMapper[variant]) !== null && _a !== void 0 ? _a : 'span';
|
|
3522
|
-
};
|
|
3523
|
-
const Typography = ({
|
|
3524
|
-
children = null,
|
|
3525
|
-
variant,
|
|
3526
|
-
color = TypographyColor.PRIMARY,
|
|
3527
|
-
isClickable,
|
|
3528
|
-
isStriked = false,
|
|
3529
|
-
isUnderlined = false,
|
|
3530
|
-
onClick,
|
|
3531
|
-
colorCode = '',
|
|
3532
|
-
showInItalics = false,
|
|
3533
|
-
lineClamp,
|
|
3534
|
-
componentNode,
|
|
3535
|
-
isDisabled = false,
|
|
3536
|
-
styleConfig = {}
|
|
2752
|
+
const LinearGradient = ({
|
|
2753
|
+
colors = ['white', 'white'],
|
|
2754
|
+
locations,
|
|
2755
|
+
start = {
|
|
2756
|
+
x: 0,
|
|
2757
|
+
y: 0
|
|
2758
|
+
},
|
|
2759
|
+
end = {
|
|
2760
|
+
x: 0,
|
|
2761
|
+
y: 1
|
|
2762
|
+
},
|
|
2763
|
+
styleConfig = {
|
|
2764
|
+
root: []
|
|
2765
|
+
},
|
|
2766
|
+
children,
|
|
2767
|
+
bgGradient
|
|
3537
2768
|
}) => {
|
|
3538
|
-
const
|
|
3539
|
-
const
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
root: customRootStyles = [],
|
|
3558
|
-
container: customContainerStyles = []
|
|
3559
|
-
} = styleConfig || {};
|
|
3560
|
-
const clampClass = React.useMemo(() => {
|
|
3561
|
-
return /*#__PURE__*/css(getLineClampStyles(lineClamp), "" , "" );
|
|
3562
|
-
}, [lineClamp]);
|
|
3563
|
-
const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([typographyStyles.root, clampClass, ...customRootStyles], [typographyStyles.root, clampClass, customRootStyles]);
|
|
3564
|
-
const ComponentToRender = lineClamp ? 'div' : componentNode || getTextType(variant) || 'p';
|
|
3565
|
-
const isInlineNode = ComponentToRender === 'span';
|
|
3566
|
-
if (parsedIsClickable) {
|
|
3567
|
-
const containerAs = isInlineNode ? 'span' : 'div';
|
|
3568
|
-
const clickableContainerStyles = isInlineNode ? [{
|
|
3569
|
-
display: 'inline'
|
|
3570
|
-
}, ...customContainerStyles] : customContainerStyles;
|
|
3571
|
-
return jsxRuntimeExports.jsx(Container$1, {
|
|
3572
|
-
onClick: onClick,
|
|
3573
|
-
styleConfig: {
|
|
3574
|
-
root: clickableContainerStyles
|
|
3575
|
-
},
|
|
3576
|
-
as: containerAs,
|
|
3577
|
-
children: jsxRuntimeExports.jsx(ComponentToRender, {
|
|
3578
|
-
className: mergedRootStyles,
|
|
3579
|
-
children: children
|
|
3580
|
-
})
|
|
3581
|
-
});
|
|
3582
|
-
}
|
|
3583
|
-
return jsxRuntimeExports.jsx(ComponentToRender, {
|
|
3584
|
-
className: mergedRootStyles,
|
|
2769
|
+
const className = ctDesignStyleManager.useWebMergeStyles([staticGradientStyles.root, ...styleConfig.root], [styleConfig.root]);
|
|
2770
|
+
const backgroundImage = React.useMemo(() => {
|
|
2771
|
+
if (bgGradient) {
|
|
2772
|
+
const trimmed = bgGradient.trim();
|
|
2773
|
+
if (/^linear-gradient\s*\(/i.test(trimmed)) {
|
|
2774
|
+
return trimmed;
|
|
2775
|
+
}
|
|
2776
|
+
const parsed = parseGradientStringNative(bgGradient);
|
|
2777
|
+
if (parsed) {
|
|
2778
|
+
return buildWebGradientBackground(parsed.colors, parsed.start, parsed.end, locations);
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
return buildWebGradientBackground(colors, start, end, locations);
|
|
2782
|
+
}, [bgGradient, colors, start, end, locations]);
|
|
2783
|
+
return jsxRuntimeExports.jsx("div", {
|
|
2784
|
+
className: className,
|
|
2785
|
+
style: {
|
|
2786
|
+
backgroundImage
|
|
2787
|
+
},
|
|
3585
2788
|
children: children
|
|
3586
2789
|
});
|
|
3587
2790
|
};
|
|
2791
|
+
var LinearGradient$1 = React__default.default.memo(LinearGradient);
|
|
3588
2792
|
|
|
3589
2793
|
exports.BusTripCardBadgeId = void 0;
|
|
3590
2794
|
(function (BusTripCardBadgeId) {
|
|
@@ -3810,9 +3014,9 @@
|
|
|
3810
3014
|
dispatchAll(onClick);
|
|
3811
3015
|
}, [dispatchAll, onClick]);
|
|
3812
3016
|
var badgeIconId = talosGeneralUtils.isEmpty(badge) ? "" : getBadgeIconId(badgeId !== null && badgeId !== void 0 ? badgeId : "");
|
|
3813
|
-
return (jsxRuntimeExports.jsxs(Container
|
|
3017
|
+
return (jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.root] }, onClick: handleClick, children: [badgeLabel && badgeIconId && (jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.badge] }, children: [jsxRuntimeExports.jsx(Container, { styleConfig: { root: [getBusTripCardStyle.badgeIcon] }, children: jsxRuntimeExports.jsx(talosIcon.IconImage, { icon: badgeIconId, width: 24, height: 24 }) }), jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B4CAPS, color: TypographyColor.LINK, componentNode: "span", styleConfig: {
|
|
3814
3018
|
root: [getBusTripCardStyle.badgeLabel],
|
|
3815
|
-
}, children: badgeLabel })] })), jsxRuntimeExports.jsxs(Container
|
|
3019
|
+
}, children: badgeLabel })] })), jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.contentSection] }, children: [jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.sectionWrapper] }, children: [jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.leftSectionWrapper] }, children: [jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B2, lineClamp: 1, children: operatorName }), jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.busTypeRow] }, children: [jsxRuntimeExports.jsx(talosIcon.Icon, { icon: busTypeIconId, width: 16, height: 16 }), jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B3, color: TypographyColor.SUBHEADING, children: busTypeText })] })] }), jsxRuntimeExports.jsx(Container, { styleConfig: { root: [getBusTripCardStyle.rightSectionWrapper] }, children: !talosGeneralUtils.isEmpty(rating) && (jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.ratingBox] }, children: [jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [ratingStyles.ratingValue] }, children: [jsxRuntimeExports.jsx(Container, { styleConfig: { root: [getBusTripCardStyle.ratingItemWrapper] }, children: jsxRuntimeExports.jsx(talosIcon.Icon, { icon: ratingIconId, width: 12, height: 12 }) }), jsxRuntimeExports.jsx(Container, { styleConfig: { root: [getBusTripCardStyle.ratingItemWrapper] }, children: jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.TAG, color: TypographyColor.NEUTRAL, children: ratingValue }) })] }), jsxRuntimeExports.jsx(Container, { styleConfig: { root: [ratingStyles.count] }, children: jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.TAG, color: TypographyColor.SUBHEADING, children: reviewCount }) })] })) })] }), jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.schedulePromoSection] }, children: [jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.sectionWrapper, getBusTripCardStyle.durationAndFareSection] }, children: [jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.leftSectionWrapper] }, children: [jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B3, color: TypographyColor.SUBHEADING, children: availableSeats }), jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.scheduleRow] }, children: [jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B1, color: TypographyColor.HEADING, children: departureTime }), jsxRuntimeExports.jsx(Container, { styleConfig: { root: [getBusTripCardStyle.durationWrapper] }, children: jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B4, color: TypographyColor.SUBHEADING, children: duration }) }), jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B1, color: TypographyColor.HEADING, children: arrivalTime })] })] }), jsxRuntimeExports.jsx(Container, { styleConfig: { root: [getBusTripCardStyle.rightSectionWrapper] }, children: jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.pricingSection] }, children: [jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.P3, color: TypographyColor.SUBHEADING, styleConfig: { root: [getBusTripCardStyle.strikedFare] }, children: strikedFare }), jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.L1, color: TypographyColor.HEADING, children: fare })] }) })] }), promotionBanner && (jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [getBusTripCardStyle.promoBanner] }, children: [jsxRuntimeExports.jsx(LinearGradient$1, { colors: ["#FFFFFF", "#ECF8F0"], start: { x: 0, y: 0 }, end: { x: 1, y: 0 }, locations: [0.3445, 1], styleConfig: { root: [getBusTripCardStyle.promoBannerGradientFill] } }), jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B3, color: TypographyColor.SUCCESS, children: promotionBanner })] }))] }), jsxRuntimeExports.jsx(Container, { styleConfig: { root: [getBusTripCardStyle.amenitiesSection] }, children: talosGeneralUtils.isEmpty(amenities) ? null : (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(HorizontalScroll, { styleConfig: {
|
|
3816
3020
|
childContainer: [getBusTripCardStyle.amenitiesRow]
|
|
3817
3021
|
}, children: amenities.map(function (amenity) {
|
|
3818
3022
|
if (talosGeneralUtils.isEmpty(amenity))
|