@oanda/labs-widget-common 1.0.222 → 1.0.224

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.
Files changed (196) hide show
  1. package/CHANGELOG.md +1764 -0
  2. package/dist/main/chart/BaseChart.js +10 -8
  3. package/dist/main/chart/BaseChart.js.map +1 -1
  4. package/dist/main/chart/formatters.js +4 -4
  5. package/dist/main/chart/formatters.js.map +1 -1
  6. package/dist/main/chart/getGridLines.js +12 -14
  7. package/dist/main/chart/getGridLines.js.map +1 -1
  8. package/dist/main/components/Button/Button.js +7 -4
  9. package/dist/main/components/Button/Button.js.map +1 -1
  10. package/dist/main/components/Card/Card.js +1 -2
  11. package/dist/main/components/Card/Card.js.map +1 -1
  12. package/dist/main/components/Card/rows/PriceCardRow.js +1 -1
  13. package/dist/main/components/Card/rows/PriceCardRow.js.map +1 -1
  14. package/dist/main/components/Disclaimer/Disclaimer.js +1 -2
  15. package/dist/main/components/Disclaimer/Disclaimer.js.map +1 -1
  16. package/dist/main/components/Input/NumberInput.js +13 -10
  17. package/dist/main/components/Input/NumberInput.js.map +1 -1
  18. package/dist/main/components/InstrumentRate/InstrumentRate.js +4 -3
  19. package/dist/main/components/InstrumentRate/InstrumentRate.js.map +1 -1
  20. package/dist/main/components/InstrumentRate/InstrumentRateWithChart.js +1 -1
  21. package/dist/main/components/InstrumentRate/InstrumentRateWithChart.js.map +1 -1
  22. package/dist/main/components/InstrumentRate/utils.js +1 -1
  23. package/dist/main/components/InstrumentRate/utils.js.map +1 -1
  24. package/dist/main/components/Label/Label.js +6 -3
  25. package/dist/main/components/Label/Label.js.map +1 -1
  26. package/dist/main/components/LastUpdated/LastUpdated.js +1 -1
  27. package/dist/main/components/LastUpdated/LastUpdated.js.map +1 -1
  28. package/dist/main/components/LineChart/LineChart.js +2 -2
  29. package/dist/main/components/LineChart/LineChart.js.map +1 -1
  30. package/dist/main/components/LineChart/utils.js +2 -2
  31. package/dist/main/components/LineChart/utils.js.map +1 -1
  32. package/dist/main/components/Pagination/Pagination.js +2 -2
  33. package/dist/main/components/Pagination/Pagination.js.map +1 -1
  34. package/dist/main/components/Price/Price.js +1 -2
  35. package/dist/main/components/Price/Price.js.map +1 -1
  36. package/dist/main/components/Select/Select.js +3 -4
  37. package/dist/main/components/Select/Select.js.map +1 -1
  38. package/dist/main/components/Sentiment/Sentiment.js +7 -7
  39. package/dist/main/components/Sentiment/Sentiment.js.map +1 -1
  40. package/dist/main/components/Sentiment/SentimentError.js +1 -1
  41. package/dist/main/components/Sentiment/SentimentError.js.map +1 -1
  42. package/dist/main/components/Sentiment/SentimentLoader.js +1 -1
  43. package/dist/main/components/Sentiment/SentimentLoader.js.map +1 -1
  44. package/dist/main/components/Sentiment/utils.js +3 -3
  45. package/dist/main/components/Sentiment/utils.js.map +1 -1
  46. package/dist/main/components/Switch/Switch.js +4 -5
  47. package/dist/main/components/Switch/Switch.js.map +1 -1
  48. package/dist/main/components/Switch/SwitchItem.js +1 -2
  49. package/dist/main/components/Switch/SwitchItem.js.map +1 -1
  50. package/dist/main/components/Table/Table.js +1 -2
  51. package/dist/main/components/Table/Table.js.map +1 -1
  52. package/dist/main/components/Table/TableCell.js +1 -1
  53. package/dist/main/components/Table/TableCell.js.map +1 -1
  54. package/dist/main/components/Table/TableHeader.js +1 -1
  55. package/dist/main/components/Table/TableHeader.js.map +1 -1
  56. package/dist/main/components/Table/TableRow.js +1 -2
  57. package/dist/main/components/Table/TableRow.js.map +1 -1
  58. package/dist/main/components/TableWidget/CardRecordRow.js +2 -1
  59. package/dist/main/components/TableWidget/CardRecordRow.js.map +1 -1
  60. package/dist/main/components/TableWidget/CardRenderer.js +6 -3
  61. package/dist/main/components/TableWidget/CardRenderer.js.map +1 -1
  62. package/dist/main/components/TableWidget/Cards.js +1 -1
  63. package/dist/main/components/TableWidget/Cards.js.map +1 -1
  64. package/dist/main/components/TableWidget/ColumnRenderer.js +7 -4
  65. package/dist/main/components/TableWidget/ColumnRenderer.js.map +1 -1
  66. package/dist/main/components/TableWidget/TableWidget.js +1 -1
  67. package/dist/main/components/TableWidget/TableWidget.js.map +1 -1
  68. package/dist/main/components/Tabs/Tabs.js +1 -1
  69. package/dist/main/components/Tabs/Tabs.js.map +1 -1
  70. package/dist/main/components/TextInput/TextInput.js +4 -4
  71. package/dist/main/components/TextInput/TextInput.js.map +1 -1
  72. package/dist/main/components/Truncate/Truncate.js +2 -3
  73. package/dist/main/components/Truncate/Truncate.js.map +1 -1
  74. package/dist/main/components/WidgetWrapper/WidgetWrapper.js +2 -2
  75. package/dist/main/components/WidgetWrapper/WidgetWrapper.js.map +1 -1
  76. package/dist/main/hooks/useLiveRatesMessage.js +7 -7
  77. package/dist/main/hooks/useLiveRatesMessage.js.map +1 -1
  78. package/dist/main/hooks/useLiveRatesQuery.js +5 -3
  79. package/dist/main/hooks/useLiveRatesQuery.js.map +1 -1
  80. package/dist/main/hooks/useRecords.js +5 -5
  81. package/dist/main/hooks/useRecords.js.map +1 -1
  82. package/dist/main/hooks/useVisibleLiveDataRecord.js +10 -10
  83. package/dist/main/hooks/useVisibleLiveDataRecord.js.map +1 -1
  84. package/dist/main/providers/Layout/LayoutProvider.js +1 -2
  85. package/dist/main/providers/Layout/LayoutProvider.js.map +1 -1
  86. package/dist/main/providers/LiveRates/LiveRatesProvider.js +16 -13
  87. package/dist/main/providers/LiveRates/LiveRatesProvider.js.map +1 -1
  88. package/dist/main/providers/Widget/WidgetProvider.js +7 -6
  89. package/dist/main/providers/Widget/WidgetProvider.js.map +1 -1
  90. package/dist/main/tailwind/preset.js +7 -3
  91. package/dist/main/tailwind/preset.js.map +1 -1
  92. package/dist/main/tailwind/themes/themeColors.js +7 -5
  93. package/dist/main/tailwind/themes/themeColors.js.map +1 -1
  94. package/dist/main/tailwind/utils.js +7 -3
  95. package/dist/main/tailwind/utils.js.map +1 -1
  96. package/dist/main/testUtils/index.js +2 -2
  97. package/dist/main/testUtils/index.js.map +1 -1
  98. package/dist/main/utils/dateUtils.js +3 -3
  99. package/dist/main/utils/dateUtils.js.map +1 -1
  100. package/dist/main/utils/getLocale.js +1 -1
  101. package/dist/main/utils/getLocale.js.map +1 -1
  102. package/dist/main/utils/liveRates/buildUrl.js +11 -9
  103. package/dist/main/utils/liveRates/buildUrl.js.map +1 -1
  104. package/dist/main/utils/liveRates/calculatePriceChangeFromOpen.js +1 -1
  105. package/dist/main/utils/liveRates/calculatePriceChangeFromOpen.js.map +1 -1
  106. package/dist/module/chart/BaseChart.js +9 -6
  107. package/dist/module/chart/BaseChart.js.map +1 -1
  108. package/dist/module/chart/formatters.js +4 -4
  109. package/dist/module/chart/formatters.js.map +1 -1
  110. package/dist/module/chart/getGridLines.js +12 -14
  111. package/dist/module/chart/getGridLines.js.map +1 -1
  112. package/dist/module/components/Button/Button.js +7 -4
  113. package/dist/module/components/Button/Button.js.map +1 -1
  114. package/dist/module/components/Card/rows/PriceCardRow.js +1 -1
  115. package/dist/module/components/Card/rows/PriceCardRow.js.map +1 -1
  116. package/dist/module/components/Input/NumberInput.js +13 -10
  117. package/dist/module/components/Input/NumberInput.js.map +1 -1
  118. package/dist/module/components/InstrumentRate/InstrumentRate.js +4 -3
  119. package/dist/module/components/InstrumentRate/InstrumentRate.js.map +1 -1
  120. package/dist/module/components/InstrumentRate/InstrumentRateWithChart.js +1 -1
  121. package/dist/module/components/InstrumentRate/InstrumentRateWithChart.js.map +1 -1
  122. package/dist/module/components/InstrumentRate/utils.js +1 -1
  123. package/dist/module/components/InstrumentRate/utils.js.map +1 -1
  124. package/dist/module/components/Label/Label.js +6 -3
  125. package/dist/module/components/Label/Label.js.map +1 -1
  126. package/dist/module/components/LastUpdated/LastUpdated.js +1 -1
  127. package/dist/module/components/LastUpdated/LastUpdated.js.map +1 -1
  128. package/dist/module/components/LineChart/LineChart.js +2 -2
  129. package/dist/module/components/LineChart/LineChart.js.map +1 -1
  130. package/dist/module/components/LineChart/utils.js +2 -2
  131. package/dist/module/components/LineChart/utils.js.map +1 -1
  132. package/dist/module/components/Pagination/Pagination.js +2 -2
  133. package/dist/module/components/Pagination/Pagination.js.map +1 -1
  134. package/dist/module/components/Select/Select.js +2 -2
  135. package/dist/module/components/Select/Select.js.map +1 -1
  136. package/dist/module/components/Sentiment/Sentiment.js +7 -7
  137. package/dist/module/components/Sentiment/Sentiment.js.map +1 -1
  138. package/dist/module/components/Sentiment/SentimentError.js +1 -1
  139. package/dist/module/components/Sentiment/SentimentError.js.map +1 -1
  140. package/dist/module/components/Sentiment/SentimentLoader.js +1 -1
  141. package/dist/module/components/Sentiment/SentimentLoader.js.map +1 -1
  142. package/dist/module/components/Sentiment/utils.js +3 -3
  143. package/dist/module/components/Sentiment/utils.js.map +1 -1
  144. package/dist/module/components/Switch/Switch.js +3 -3
  145. package/dist/module/components/Switch/Switch.js.map +1 -1
  146. package/dist/module/components/Table/TableCell.js +1 -1
  147. package/dist/module/components/Table/TableCell.js.map +1 -1
  148. package/dist/module/components/Table/TableHeader.js +1 -1
  149. package/dist/module/components/Table/TableHeader.js.map +1 -1
  150. package/dist/module/components/TableWidget/CardRecordRow.js +2 -1
  151. package/dist/module/components/TableWidget/CardRecordRow.js.map +1 -1
  152. package/dist/module/components/TableWidget/CardRenderer.js +6 -3
  153. package/dist/module/components/TableWidget/CardRenderer.js.map +1 -1
  154. package/dist/module/components/TableWidget/Cards.js +1 -1
  155. package/dist/module/components/TableWidget/Cards.js.map +1 -1
  156. package/dist/module/components/TableWidget/ColumnRenderer.js +7 -4
  157. package/dist/module/components/TableWidget/ColumnRenderer.js.map +1 -1
  158. package/dist/module/components/TableWidget/TableWidget.js +1 -1
  159. package/dist/module/components/TableWidget/TableWidget.js.map +1 -1
  160. package/dist/module/components/Tabs/Tabs.js +1 -1
  161. package/dist/module/components/Tabs/Tabs.js.map +1 -1
  162. package/dist/module/components/TextInput/TextInput.js +3 -2
  163. package/dist/module/components/TextInput/TextInput.js.map +1 -1
  164. package/dist/module/components/Truncate/Truncate.js +1 -1
  165. package/dist/module/components/Truncate/Truncate.js.map +1 -1
  166. package/dist/module/components/WidgetWrapper/WidgetWrapper.js +2 -2
  167. package/dist/module/components/WidgetWrapper/WidgetWrapper.js.map +1 -1
  168. package/dist/module/hooks/useLiveRatesMessage.js +7 -7
  169. package/dist/module/hooks/useLiveRatesMessage.js.map +1 -1
  170. package/dist/module/hooks/useLiveRatesQuery.js +5 -3
  171. package/dist/module/hooks/useLiveRatesQuery.js.map +1 -1
  172. package/dist/module/hooks/useRecords.js +5 -5
  173. package/dist/module/hooks/useRecords.js.map +1 -1
  174. package/dist/module/hooks/useVisibleLiveDataRecord.js +10 -10
  175. package/dist/module/hooks/useVisibleLiveDataRecord.js.map +1 -1
  176. package/dist/module/providers/LiveRates/LiveRatesProvider.js +15 -11
  177. package/dist/module/providers/LiveRates/LiveRatesProvider.js.map +1 -1
  178. package/dist/module/providers/Widget/WidgetProvider.js +6 -4
  179. package/dist/module/providers/Widget/WidgetProvider.js.map +1 -1
  180. package/dist/module/tailwind/preset.js +7 -3
  181. package/dist/module/tailwind/preset.js.map +1 -1
  182. package/dist/module/tailwind/themes/themeColors.js +7 -5
  183. package/dist/module/tailwind/themes/themeColors.js.map +1 -1
  184. package/dist/module/tailwind/utils.js +7 -3
  185. package/dist/module/tailwind/utils.js.map +1 -1
  186. package/dist/module/testUtils/index.js +2 -2
  187. package/dist/module/testUtils/index.js.map +1 -1
  188. package/dist/module/utils/dateUtils.js +3 -3
  189. package/dist/module/utils/dateUtils.js.map +1 -1
  190. package/dist/module/utils/getLocale.js +1 -1
  191. package/dist/module/utils/getLocale.js.map +1 -1
  192. package/dist/module/utils/liveRates/buildUrl.js +11 -9
  193. package/dist/module/utils/liveRates/buildUrl.js.map +1 -1
  194. package/dist/module/utils/liveRates/calculatePriceChangeFromOpen.js +1 -1
  195. package/dist/module/utils/liveRates/calculatePriceChangeFromOpen.js.map +1 -1
  196. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.js","names":["React","NumericFormat","ArrowDownIcon","ArrowUpIcon","Label","NumberInput","_ref","label","onIncrement","onDecrement","placeholder","disabled","decimalScale","value","withoutArrows","props","createElement","className","htmlFor","_extends","allowNegative","thousandSeparator","type","onClick"],"sources":["../../../../src/components/Input/NumberInput.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport type { FC } from 'react';\nimport React from 'react';\nimport { NumericFormat } from 'react-number-format';\n\nimport { ArrowDownIcon, ArrowUpIcon } from '../../images';\nimport { Label } from '../Label';\nimport type { NumberFormatInputProps } from './types';\n\nexport const NumberInput: FC<NumberFormatInputProps> = ({\n label,\n onIncrement,\n onDecrement,\n placeholder,\n disabled,\n decimalScale = 2,\n value,\n withoutArrows,\n ...props\n}) => (\n <div className=\"lw-group lw-grid lw-w-full lw-max-w-full lw-items-center lw-gap-2 lw-text-text-primary\">\n <Label className=\"lw-text-text-primary\" htmlFor={label}>\n {label}\n </Label>\n <div className=\"lw-flex lw-h-12 lw-w-full lw-rounded lw-border lw-px-3 lw-py-2 lw-text-sm lw-outline-2 lw-outline-offset-[-2px] lw-outline-primary focus-within:lw-outline\">\n <NumericFormat\n {...props}\n allowNegative={false}\n className=\"lw-w-full lw-bg-text-negative lw-text-sm focus:lw-outline-none\"\n decimalScale={decimalScale}\n disabled={disabled}\n placeholder={placeholder}\n thousandSeparator=\",\"\n value={value}\n />\n {!disabled && !withoutArrows && (\n <div className=\"lw-hidden lw-flex-col lw-justify-center group-hover:lw-flex\">\n <button\n className=\"lw-h-3 lw-justify-center focus:lw-outline-primary\"\n type=\"button\"\n onClick={onIncrement}\n >\n <ArrowUpIcon />\n </button>\n <button\n className=\"lw-justify-center focus:lw-outline-primary\"\n type=\"button\"\n onClick={onDecrement}\n >\n <ArrowDownIcon />\n </button>\n </div>\n )}\n </div>\n </div>\n);\n"],"mappings":";AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,qBAAqB;AAEnD,SAASC,aAAa,EAAEC,WAAW,QAAQ,cAA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DownIcon","ArrowUpIcon","Label","NumberInput","_ref","label","onIncrement","onDecrement","placeholder","disabled","decimalScale","value","withoutArrows","props","_objectWithoutProperties","_excluded","createElement","className","htmlFor","_extends","allowNegative","thousandSeparator","type","onClick"],"sources":["../../../../src/components/Input/NumberInput.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport type { FC } from 'react';\nimport React from 'react';\nimport { NumericFormat } from 'react-number-format';\n\nimport { ArrowDownIcon, ArrowUpIcon } from '../../images';\nimport { Label } from '../Label';\nimport type { NumberFormatInputProps } from './types';\n\nexport const NumberInput: FC<NumberFormatInputProps> = ({\n label,\n onIncrement,\n onDecrement,\n placeholder,\n disabled,\n decimalScale = 2,\n value,\n withoutArrows,\n ...props\n}) => (\n <div className=\"lw-group lw-grid lw-w-full lw-max-w-full lw-items-center lw-gap-2 lw-text-text-primary\">\n <Label className=\"lw-text-text-primary\" htmlFor={label}>\n {label}\n </Label>\n <div className=\"lw-flex lw-h-12 lw-w-full lw-rounded lw-border lw-px-3 lw-py-2 lw-text-sm lw-outline-2 lw-outline-offset-[-2px] lw-outline-primary focus-within:lw-outline\">\n <NumericFormat\n {...props}\n allowNegative={false}\n className=\"lw-w-full lw-bg-text-negative lw-text-sm focus:lw-outline-none\"\n decimalScale={decimalScale}\n disabled={disabled}\n placeholder={placeholder}\n thousandSeparator=\",\"\n value={value}\n />\n {!disabled && !withoutArrows && (\n <div className=\"lw-hidden lw-flex-col lw-justify-center group-hover:lw-flex\">\n <button\n className=\"lw-h-3 lw-justify-center focus:lw-outline-primary\"\n type=\"button\"\n onClick={onIncrement}\n >\n <ArrowUpIcon />\n </button>\n <button\n className=\"lw-justify-center focus:lw-outline-primary\"\n type=\"button\"\n onClick={onDecrement}\n >\n <ArrowDownIcon />\n </button>\n </div>\n )}\n </div>\n </div>\n);\n"],"mappings":";;;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,qBAAqB;AAEnD,SAASC,aAAa,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,CACP","ignoreList":[]}
@@ -5,6 +5,7 @@ import { LabelSize, LabelWrapper } from '../LabelWrapper';
5
5
  import { Price } from '../Price';
6
6
  import { Truncate } from '../Truncate';
7
7
  const InstrumentRate = _ref => {
8
+ var _record$buy;
8
9
  let {
9
10
  isError,
10
11
  record,
@@ -16,7 +17,7 @@ const InstrumentRate = _ref => {
16
17
  const {
17
18
  isDark
18
19
  } = useLayoutProvider();
19
- const checkLoading = id => !isError && record?.[id] === undefined;
20
+ const checkLoading = id => !isError && (record === null || record === void 0 ? void 0 : record[id]) === undefined;
20
21
  const isExpanded = size === 'full' || size === 'fullWithChart';
21
22
  return React.createElement("div", {
22
23
  className: cn('lw-flex lw-flex-col', isExpanded && 'lw-h-full'),
@@ -43,7 +44,7 @@ const InstrumentRate = _ref => {
43
44
  }, React.createElement(Price, {
44
45
  movementIndicator: "text",
45
46
  priceMovement: record.buyPriceMovement
46
- }, React.createElement("span", null, record.buy?.toFixed(record.displayPrecision)))))), isExpanded && React.createElement("div", {
47
+ }, React.createElement("span", null, (_record$buy = record.buy) === null || _record$buy === void 0 ? void 0 : _record$buy.toFixed(record.displayPrecision)))))), isExpanded && React.createElement("div", {
47
48
  className: cn('lw-flex lw-h-1/2 lw-w-fit lw-items-center lw-gap-x-2 lw-pr-2.5', !isDark && 'lw-bg-whiteOpacity', isDark && 'lw-bg-blackOpacity', !slim && 'lw-py-1', slim && 'lw-pb-1'),
48
49
  "data-testid": "instrument-rate-wrapper-expanded"
49
50
  }, React.createElement(LabelWrapper, {
@@ -59,7 +60,7 @@ const InstrumentRate = _ref => {
59
60
  size: LabelSize.sm
60
61
  }, React.createElement("span", {
61
62
  className: cn('lw-font-bold', indicator > 0 && 'lw-text-text-ok', indicator < 0 && 'lw-text-text-danger', indicator === 0 && 'lw-text-text-disabled')
62
- }, `(${record.dailyPipsChange})`))));
63
+ }, "(".concat(record.dailyPipsChange, ")")))));
63
64
  };
64
65
  export { InstrumentRate };
65
66
  //# sourceMappingURL=InstrumentRate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InstrumentRate.js","names":["React","useLayoutProvider","cn","LabelSize","LabelWrapper","Price","Truncate","InstrumentRate","_ref","isError","record","tooltipId","size","slim","colorIndicator","indicator","isDark","checkLoading","id","undefined","isExpanded","createElement","className","isLoading","lg","maxWidth","text","displayName","movementIndicator","priceMovement","buyPriceMovement","buy","toFixed","displayPrecision","sm","dailyPercentChange","withoutLoader","dailyPipsChange"],"sources":["../../../../src/components/InstrumentRate/InstrumentRate.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useLayoutProvider } from '../../providers';\nimport { cn } from '../../tailwind';\nimport { LabelSize, LabelWrapper } from '../LabelWrapper';\nimport { Price } from '../Price';\nimport { Truncate } from '../Truncate';\nimport type { InstrumentRateProps } from './types';\n\nconst InstrumentRate = ({\n isError,\n record,\n tooltipId,\n size,\n slim,\n colorIndicator: indicator,\n}: InstrumentRateProps) => {\n const { isDark } = useLayoutProvider();\n const checkLoading = (id: string) => !isError && record?.[id] === undefined;\n const isExpanded = size === 'full' || size === 'fullWithChart';\n\n return (\n <div\n className={cn('lw-flex lw-flex-col', isExpanded && 'lw-h-full')}\n data-testid=\"instrument-rate-wrapper\"\n >\n <div\n className={cn(\n 'lw-flex lw-gap-x-2 lw-text-xl',\n isExpanded && 'lw-h-1/2',\n !slim && 'lw-py-2',\n slim && 'lw-py-1'\n )}\n data-testid=\"instrument-rate-wrapper-label\"\n >\n <LabelWrapper\n isError={!!isError}\n isLoading={checkLoading('instrument')}\n size={LabelSize.lg}\n >\n <span className=\"lw-font-bold\">\n <Truncate\n maxWidth={100}\n text={record.displayName}\n tooltipId={tooltipId}\n />\n </span>\n </LabelWrapper>\n <LabelWrapper\n isError={!!isError}\n isLoading={checkLoading('buy')}\n size={LabelSize.lg}\n >\n <div className=\"lw-font-bold\">\n <Price\n movementIndicator=\"text\"\n priceMovement={record.buyPriceMovement}\n >\n <span>{record.buy?.toFixed(record.displayPrecision)}</span>\n </Price>\n </div>\n </LabelWrapper>\n </div>\n {isExpanded && (\n <div\n className={cn(\n 'lw-flex lw-h-1/2 lw-w-fit lw-items-center lw-gap-x-2 lw-pr-2.5',\n !isDark && 'lw-bg-whiteOpacity',\n isDark && 'lw-bg-blackOpacity',\n !slim && 'lw-py-1',\n slim && 'lw-pb-1'\n )}\n data-testid=\"instrument-rate-wrapper-expanded\"\n >\n <LabelWrapper\n isError={!!isError}\n isLoading={checkLoading('dailyPercentChange')}\n size={LabelSize.sm}\n >\n <span\n className={cn(\n 'lw-font-bold',\n indicator > 0 && 'lw-text-text-ok',\n indicator < 0 && 'lw-text-text-danger',\n indicator === 0 && 'lw-text-text-disabled'\n )}\n >\n {record.dailyPercentChange}\n </span>\n </LabelWrapper>\n <LabelWrapper\n withoutLoader\n isError={!!isError}\n isLoading={checkLoading('dailyPipsChange')}\n size={LabelSize.sm}\n >\n <span\n className={cn(\n 'lw-font-bold',\n indicator > 0 && 'lw-text-text-ok',\n indicator < 0 && 'lw-text-text-danger',\n indicator === 0 && 'lw-text-text-disabled'\n )}\n >\n {`(${record.dailyPipsChange})`}\n </span>\n </LabelWrapper>\n </div>\n )}\n </div>\n );\n};\n\nexport { InstrumentRate };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,EAAE,QAAQ,gBAAgB;AACnC,SAASC,SAAS,EAAEC,YAAY,QAAQ,iBAAiB;AACzD,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,QAAQ,QAAQ,aAAa;AAGtC,MAAMC,cAAc,GAAGC,IAAA,IAOI;EAAA,IAPH;IACtBC,OAAO;IACPC,MAAM;IACNC,SAAS;IACTC,IAAI;IACJC,IAAI;IACJC,cAAc,EAAEC;EACG,CAAC,GAAAP,IAAA;EACpB,MAAM;IAAEQ;EAAO,CAAC,GAAGf,iBAAiB,CAAC,CAAC;EACtC,MAAMgB,YAAY,GAAIC,EAAU,IAAK,CAACT,OAAO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,CACrD,CACJ,CACO,CACX,CAAC,EACLb,UAAU,IACTpB,KAAA,CAAAqB,aAAA;IACEC,SAAS,EAAEpB,EAAE,CACX,gEAAgE,EAChE,CAACc,MAAM,IAAI,oBAAoB,EAC/BA,MAAM,IAAI,oBAAoB,EAC9B,CAACH,IAAI,IAAI,SAAS,EAClBA,IAAI,IAAI,SACV,CAAE;IACF,eAAY;EAAkC,GAE9Cb,KAAA,CAAAqB,aAAA,CAACjB,YAAY;IACXK,OAAO,EAAE,CAAC,CAACA,OAAQ;IACnBc,SAAS,EAAEN,YAAY,CAAC,oBAAoB,CAAE;IAC9CL,IAAI,EAAET,SAAS,CAAC+B;EAAG,GAEnBlC,KAAA,CAAAqB,aAAA;IACEC,SAAS,EAAEpB,EAAE,CACX,cAAc,EACda,SAAS,GAAG,CAAC,IAAI,iBAAiB,EAClCA,SAAS,GAAG,CAAC,IAAI,qBAAqB,EACtCA,SAAS,KAAK,CAAC,IAAI,uBACrB;EAAE,GAEDL,MAAM,CAACyB,kBACJ,CACM,CAAC,EACfnC,KAAA,CAAAqB,aAAA,CAACjB,YAAY;IACXgC,aAAa;IACb3B,OAAO,EAAE,CAAC,CAACA,OAAQ;IACnBc,SAAS,EAAEN,YAAY,CAAC,iBAAiB,CAAE;IAC3CL,IAAI,EAAET,SAAS,CAAC+B;EAAG,GAEnBlC,KAAA,CAAAqB,aAAA;IACEC,SAAS,EAAEpB,EAAE,CACX,cAAc,EACda,SAAS,GAAG,CAAC,IAAI,iBAAiB,EAClCA,SAAS,GAAG,CAAC,IAAI,qBAAqB,EACtCA,SAAS,KAAK,CAAC,IAAI,uBACrB;EAAE,GAED,IAAIL,MAAM,CAAC2B,eAAe,GACvB,CACM,CACX,CAEJ,CAAC;AAEV,CAAC;AAED,SAAS9B,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"InstrumentRate.js","names":["React","useLayoutProvider","cn","LabelSize","LabelWrapper","Price","Truncate","InstrumentRate","_ref","_record$buy","isError","record","tooltipId","size","slim","colorIndicator","indicator","isDark","checkLoading","id","undefined","isExpanded","createElement","className","isLoading","lg","maxWidth","text","displayName","movementIndicator","priceMovement","buyPriceMovement","buy","toFixed","displayPrecision","sm","dailyPercentChange","withoutLoader","concat","dailyPipsChange"],"sources":["../../../../src/components/InstrumentRate/InstrumentRate.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useLayoutProvider } from '../../providers';\nimport { cn } from '../../tailwind';\nimport { LabelSize, LabelWrapper } from '../LabelWrapper';\nimport { Price } from '../Price';\nimport { Truncate } from '../Truncate';\nimport type { InstrumentRateProps } from './types';\n\nconst InstrumentRate = ({\n isError,\n record,\n tooltipId,\n size,\n slim,\n colorIndicator: indicator,\n}: InstrumentRateProps) => {\n const { isDark } = useLayoutProvider();\n const checkLoading = (id: string) => !isError && record?.[id] === undefined;\n const isExpanded = size === 'full' || size === 'fullWithChart';\n\n return (\n <div\n className={cn('lw-flex lw-flex-col', isExpanded && 'lw-h-full')}\n data-testid=\"instrument-rate-wrapper\"\n >\n <div\n className={cn(\n 'lw-flex lw-gap-x-2 lw-text-xl',\n isExpanded && 'lw-h-1/2',\n !slim && 'lw-py-2',\n slim && 'lw-py-1'\n )}\n data-testid=\"instrument-rate-wrapper-label\"\n >\n <LabelWrapper\n isError={!!isError}\n isLoading={checkLoading('instrument')}\n size={LabelSize.lg}\n >\n <span className=\"lw-font-bold\">\n <Truncate\n maxWidth={100}\n text={record.displayName}\n tooltipId={tooltipId}\n />\n </span>\n </LabelWrapper>\n <LabelWrapper\n isError={!!isError}\n isLoading={checkLoading('buy')}\n size={LabelSize.lg}\n >\n <div className=\"lw-font-bold\">\n <Price\n movementIndicator=\"text\"\n priceMovement={record.buyPriceMovement}\n >\n <span>{record.buy?.toFixed(record.displayPrecision)}</span>\n </Price>\n </div>\n </LabelWrapper>\n </div>\n {isExpanded && (\n <div\n className={cn(\n 'lw-flex lw-h-1/2 lw-w-fit lw-items-center lw-gap-x-2 lw-pr-2.5',\n !isDark && 'lw-bg-whiteOpacity',\n isDark && 'lw-bg-blackOpacity',\n !slim && 'lw-py-1',\n slim && 'lw-pb-1'\n )}\n data-testid=\"instrument-rate-wrapper-expanded\"\n >\n <LabelWrapper\n isError={!!isError}\n isLoading={checkLoading('dailyPercentChange')}\n size={LabelSize.sm}\n >\n <span\n className={cn(\n 'lw-font-bold',\n indicator > 0 && 'lw-text-text-ok',\n indicator < 0 && 'lw-text-text-danger',\n indicator === 0 && 'lw-text-text-disabled'\n )}\n >\n {record.dailyPercentChange}\n </span>\n </LabelWrapper>\n <LabelWrapper\n withoutLoader\n isError={!!isError}\n isLoading={checkLoading('dailyPipsChange')}\n size={LabelSize.sm}\n >\n <span\n className={cn(\n 'lw-font-bold',\n indicator > 0 && 'lw-text-text-ok',\n indicator < 0 && 'lw-text-text-danger',\n indicator === 0 && 'lw-text-text-disabled'\n )}\n >\n {`(${record.dailyPipsChange})`}\n </span>\n </LabelWrapper>\n </div>\n )}\n </div>\n );\n};\n\nexport { InstrumentRate };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,EAAE,QAAQ,gBAAgB;AACnC,SAASC,SAAS,EAAEC,YAAY,QAAQ,iBAAiB;AACzD,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,QAAQ,QAAQ,aAAa;AAGtC,MAAMC,cAAc,GAAGC,IAAA,IAOI;EAAA,IAAAC,WAAA;EAAA,IAPH;IACtBC,OAAO;IACPC,MAAM;IACNC,SAAS;IACTC,IAAI;IACJC,IAAI;IACJC,cAAc,EAAEC;EACG,CAAC,GAAAR,IAAA;EACpB,MAAM;IAAES;EAAO,CAAC,GAAGhB,iBAAiB,CAAC,CAAC;EACtC,MAAMiB,YAAY,GAAIC,EAAU,IAAK,CAACT,OAAO,IAAI,CAAAC,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAGQ,EAAE,CAAC,MAAKC,SAAS;EAC3E,MAAMC,UAAU,GAAGR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,EACLb,UAAU,IACTrB,KAAA,CAAAsB,aAAA;IACEC,SAAS,EAAErB,EAAE,CACX,gEAAgE,EAChE,CAACe,MAAM,IAAI,oBAAoB,EAC/BA,MAAM,IAAI,oBAAoB,EAC9B,CAACH,IAAI,IAAI,SAAS,EAClBA,IAAI,IAAI,SACV,CAAE;IACF,eAAY;EAAkC,GAE9Cd,KAAA,CAAAsB,aAAA,CAAClB,YAAY;IACXM,OAAO,EAAE,CAAC,CAACA,OAAQ;IACnBc,SAAS,EAAEN,YAAY,CAAC,oBAAoB,CAAE;IAC9CL,IAAI,EAAEV,SAAS,CAACgC;EAAG,GAEnBnC,KAAA,CAAAsB,aAAA;IACEC,SAAS,EAAErB,EAAE,CACX,cAAc,EACdc,SAAS,GAAG,CAAC,IAAI,iBAAiB,EAClCA,SAAS,GAAG,CAAC,IAAI,qBAAqB,EACtCA,SAAS,KAAK,CAAC,IAAI,uBACrB;EAAE,GAEDL,MAAM,CAACyB,kBACJ,CACM,CAAC,EACfpC,KAAA,CAAAsB,aAAA,CAAClB,YAAY;IACXiC,aAAa;IACb3B,OAAO,EAAE,CAAC,CAACA,OAAQ;IACnBc,SAAS,EAAEN,YAAY,CAAC,iBAAiB,CAAE;IAC3CL,IAAI,EAAEV,SAAS,CAACgC;EAAG,GAEnBnC,KAAA,CAAAsB,aAAA;IACEC,SAAS,EAAErB,EAAE,CACX,cAAc,EACdc,SAAS,GAAG,CAAC,IAAI,iBAAiB,EAClCA,SAAS,GAAG,CAAC,IAAI,qBAAqB,EACtCA,SAAS,KAAK,CAAC,IAAI,uBACrB;EAAE,OAAAsB,MAAA,CAEG3B,MAAM,CAAC4B,eAAe,MACvB,CACM,CACX,CAEJ,CAAC;AAEV,CAAC;AAED,SAAShC,cAAc","ignoreList":[]}
@@ -19,7 +19,7 @@ function InstrumentRateWithChart(_ref) {
19
19
  const {
20
20
  updatedRecord,
21
21
  error
22
- } = useRecords(record, record?.instrument ? target : null);
22
+ } = useRecords(record, record !== null && record !== void 0 && record.instrument ? target : null);
23
23
  const indicator = getColorIndicator(updatedRecord.dailyPercentChange);
24
24
  return React.createElement(React.Fragment, null, React.createElement(InstrumentRate, {
25
25
  colorIndicator: indicator,
@@ -1 +1 @@
1
- {"version":3,"file":"InstrumentRateWithChart.js","names":["React","useRecords","useLayoutProvider","LineChartWithData","InstrumentRate","getChartColor","getColorIndicator","InstrumentRateWithChart","_ref","record","target","tooltipId","size","queryRef","slim","isDark","updatedRecord","error","instrument","indicator","dailyPercentChange","createElement","Fragment","colorIndicator","isError","color"],"sources":["../../../../src/components/InstrumentRate/InstrumentRateWithChart.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useRecords } from '../../hooks';\nimport { useLayoutProvider } from '../../providers';\nimport { LineChartWithData } from '../LineChart';\nimport { InstrumentRate } from './InstrumentRate';\nimport type { InstrumentRateWithChartProps } from './types';\nimport { getChartColor, getColorIndicator } from './utils';\n\nfunction InstrumentRateWithChart<T>({\n record,\n target,\n tooltipId,\n size,\n queryRef,\n slim,\n}: InstrumentRateWithChartProps<T>) {\n const { isDark } = useLayoutProvider();\n const { updatedRecord, error } = useRecords(\n record,\n record?.instrument ? target : null\n );\n\n const indicator = getColorIndicator(updatedRecord.dailyPercentChange);\n\n return (\n <>\n <InstrumentRate\n colorIndicator={indicator}\n isError={!!error}\n record={updatedRecord}\n size={size}\n slim={slim}\n tooltipId={tooltipId}\n />\n {size === 'fullWithChart' && (\n <LineChartWithData<T>\n color={getChartColor(indicator, isDark)}\n queryRef={queryRef}\n />\n )}\n </>\n );\n}\n\nexport { InstrumentRateWithChart };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,SAAS;AAE1D,SAASC,uBAAuBA,CAAAC,IAAA,EAOI;EAAA,IAPA;IAClCC,MAAM;IACNC,MAAM;IACNC,SAAS;IACTC,IAAI;IACJC,QAAQ;IACRC;EAC+B,CAAC,GAAAN,IAAA;EAChC,MAAM;IAAEO;EAAO,CAAC,GAAGb,iBAAiB,CAAC,CAAC;EACtC,MAAM;IAAEc,aAAa;IAAEC;EAAM,CAAC,GAAGhB,UAAU,CACzCQ,MAAM,EACNA,MAAM,EAAES,UAAU,GAAGR,MAAM,GAAG,IAChC,CAAC;EAED,MAAMS,SAAS,GAAGb,iBAAiB,CAACU,aAAa,CAACI,kBAAkB,CAAC;EAErE,OACEpB,KAAA,CAAAqB,aAAA,CAAArB,KAAA,CAAAsB,QAAA,QACEtB,KAAA,CAAAqB,aAAA,CAACjB,cAAc;IACbmB,cAAc,EAAEJ,SAAU;IAC1BK,OAAO,EAAE,CAAC,CAACP,KAAM;IACjBR,MAAM,EAAEO,aAAc;IACtBJ,IAAI,EAAEA,IAAK;IACXE,IAAI,EAAEA,IAAK;IACXH,SAAS,EAAEA;EAAU,CACtB,CAAC,EACDC,IAAI,KAAK,eAAe,IACvBZ,KAAA,CAAAqB,aAAA,CAAClB,iBAAiB;IAChBsB,KAAK,EAAEpB,aAAa,CAACc,SAAS,EAAEJ,MAAM,CAAE;IACxCF,QAAQ,EAAEA;EAAS,CACpB,CAEH,CAAC;AAEP;AAEA,SAASN,uBAAuB","ignoreList":[]}
1
+ {"version":3,"file":"InstrumentRateWithChart.js","names":["React","useRecords","useLayoutProvider","LineChartWithData","InstrumentRate","getChartColor","getColorIndicator","InstrumentRateWithChart","_ref","record","target","tooltipId","size","queryRef","slim","isDark","updatedRecord","error","instrument","indicator","dailyPercentChange","createElement","Fragment","colorIndicator","isError","color"],"sources":["../../../../src/components/InstrumentRate/InstrumentRateWithChart.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useRecords } from '../../hooks';\nimport { useLayoutProvider } from '../../providers';\nimport { LineChartWithData } from '../LineChart';\nimport { InstrumentRate } from './InstrumentRate';\nimport type { InstrumentRateWithChartProps } from './types';\nimport { getChartColor, getColorIndicator } from './utils';\n\nfunction InstrumentRateWithChart<T>({\n record,\n target,\n tooltipId,\n size,\n queryRef,\n slim,\n}: InstrumentRateWithChartProps<T>) {\n const { isDark } = useLayoutProvider();\n const { updatedRecord, error } = useRecords(\n record,\n record?.instrument ? target : null\n );\n\n const indicator = getColorIndicator(updatedRecord.dailyPercentChange);\n\n return (\n <>\n <InstrumentRate\n colorIndicator={indicator}\n isError={!!error}\n record={updatedRecord}\n size={size}\n slim={slim}\n tooltipId={tooltipId}\n />\n {size === 'fullWithChart' && (\n <LineChartWithData<T>\n color={getChartColor(indicator, isDark)}\n queryRef={queryRef}\n />\n )}\n </>\n );\n}\n\nexport { InstrumentRateWithChart };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,SAAS;AAE1D,SAASC,uBAAuBA,CAAAC,IAAA,EAOI;EAAA,IAPA;IAClCC,MAAM;IACNC,MAAM;IACNC,SAAS;IACTC,IAAI;IACJC,QAAQ;IACRC;EAC+B,CAAC,GAAAN,IAAA;EAChC,MAAM;IAAEO;EAAO,CAAC,GAAGb,iBAAiB,CAAC,CAAC;EACtC,MAAM;IAAEc,aAAa;IAAEC;EAAM,CAAC,GAAGhB,UAAU,CACzCQ,MAAM,EACNA,MAAM,aAANA,MAAM,eAANA,MAAM,CAAES,UAAU,GAAGR,MAAM,GAAG,IAChC,CAAC;EAED,MAAMS,SAAS,GAAGb,iBAAiB,CAACU,aAAa,CAACI,kBAAkB,CAAC;EAErE,OACEpB,KAAA,CAAAqB,aAAA,CAAArB,KAAA,CAAAsB,QAAA,QACEtB,KAAA,CAAAqB,aAAA,CAACjB,cAAc;IACbmB,cAAc,EAAEJ,SAAU;IAC1BK,OAAO,EAAE,CAAC,CAACP,KAAM;IACjBR,MAAM,EAAEO,aAAc;IACtBJ,IAAI,EAAEA,IAAK;IACXE,IAAI,EAAEA,IAAK;IACXH,SAAS,EAAEA;EAAU,CACtB,CAAC,EACDC,IAAI,KAAK,eAAe,IACvBZ,KAAA,CAAAqB,aAAA,CAAClB,iBAAiB;IAChBsB,KAAK,EAAEpB,aAAa,CAACc,SAAS,EAAEJ,MAAM,CAAE;IACxCF,QAAQ,EAAEA;EAAS,CACpB,CAEH,CAAC;AAEP;AAEA,SAASN,uBAAuB","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import { Theme, themeColors } from '@oanda/labs-widget-common';
2
2
  const getColorIndicator = dailyChange => {
3
- const numberValue = Number(dailyChange?.substring(0, dailyChange.length - 1));
3
+ const numberValue = Number(dailyChange === null || dailyChange === void 0 ? void 0 : dailyChange.substring(0, dailyChange.length - 1));
4
4
  return Math.sign(numberValue);
5
5
  };
6
6
  const getChartColor = (indicator, isDarkMode) => {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["Theme","themeColors","getColorIndicator","dailyChange","numberValue","Number","substring","length","Math","sign","getChartColor","indicator","isDarkMode","theme","Dark","Light","textOk","textDanger","textDisabled"],"sources":["../../../../src/components/InstrumentRate/utils.ts"],"sourcesContent":["import { Theme, themeColors } from '@oanda/labs-widget-common';\n\nconst getColorIndicator = (dailyChange?: string) => {\n const numberValue = Number(dailyChange?.substring(0, dailyChange.length - 1));\n\n return Math.sign(numberValue);\n};\n\nconst getChartColor = (indicator?: number, isDarkMode?: boolean) => {\n const theme = isDarkMode ? Theme.Dark : Theme.Light;\n\n switch (indicator) {\n case 1:\n return themeColors.textOk[theme];\n case -1:\n return themeColors.textDanger[theme];\n default:\n return themeColors.textDisabled[theme];\n }\n};\n\nexport { getChartColor, getColorIndicator };\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,WAAW,QAAQ,2BAA2B;AAE9D,MAAMC,iBAAiB,GAAIC,WAAoB,IAAK;EAClD,MAAMC,WAAW,GAAGC,MAAM,CAACF,WAAW,EAAEG,SAAS,CAAC,CAAC,EAAEH,WAAW,CAACI,MAAM,GAAG,CAAC,CAAC,CAAC;EAE7E,OAAOC,IAAI,CAACC,IAAI,CAACL,WAAW,CAAC;AAC/B,CAAC;AAED,MAAMM,aAAa,GAAGA,CAACC,SAAkB,EAAEC,UAAoB,KAAK;EAClE,MAAMC,KAAK,GAAGD,UAAU,GAAGZ,KAAK,CAACc,IAAI,GAAGd,KAAK,CAACe,KAAK;EAEnD,QAAQJ,SAAS;IACf,KAAK,CAAC;MACJ,OAAOV,WAAW,CAACe,MAAM,CAACH,KAAK,CAAC;IAClC,KAAK,CAAC,CAAC;MACL,OAAOZ,WAAW,CAACgB,UAAU,CAACJ,KAAK,CAAC;IACtC;MACE,OAAOZ,WAAW,CAACiB,YAAY,CAACL,KAAK,CAAC;EAC1C;AACF,CAAC;AAED,SAASH,aAAa,EAAER,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"utils.js","names":["Theme","themeColors","getColorIndicator","dailyChange","numberValue","Number","substring","length","Math","sign","getChartColor","indicator","isDarkMode","theme","Dark","Light","textOk","textDanger","textDisabled"],"sources":["../../../../src/components/InstrumentRate/utils.ts"],"sourcesContent":["import { Theme, themeColors } from '@oanda/labs-widget-common';\n\nconst getColorIndicator = (dailyChange?: string) => {\n const numberValue = Number(dailyChange?.substring(0, dailyChange.length - 1));\n\n return Math.sign(numberValue);\n};\n\nconst getChartColor = (indicator?: number, isDarkMode?: boolean) => {\n const theme = isDarkMode ? Theme.Dark : Theme.Light;\n\n switch (indicator) {\n case 1:\n return themeColors.textOk[theme];\n case -1:\n return themeColors.textDanger[theme];\n default:\n return themeColors.textDisabled[theme];\n }\n};\n\nexport { getChartColor, getColorIndicator };\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,WAAW,QAAQ,2BAA2B;AAE9D,MAAMC,iBAAiB,GAAIC,WAAoB,IAAK;EAClD,MAAMC,WAAW,GAAGC,MAAM,CAACF,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEG,SAAS,CAAC,CAAC,EAAEH,WAAW,CAACI,MAAM,GAAG,CAAC,CAAC,CAAC;EAE7E,OAAOC,IAAI,CAACC,IAAI,CAACL,WAAW,CAAC;AAC/B,CAAC;AAED,MAAMM,aAAa,GAAGA,CAACC,SAAkB,EAAEC,UAAoB,KAAK;EAClE,MAAMC,KAAK,GAAGD,UAAU,GAAGZ,KAAK,CAACc,IAAI,GAAGd,KAAK,CAACe,KAAK;EAEnD,QAAQJ,SAAS;IACf,KAAK,CAAC;MACJ,OAAOV,WAAW,CAACe,MAAM,CAACH,KAAK,CAAC;IAClC,KAAK,CAAC,CAAC;MACL,OAAOZ,WAAW,CAACgB,UAAU,CAACJ,KAAK,CAAC;IACtC;MACE,OAAOZ,WAAW,CAACiB,YAAY,CAACL,KAAK,CAAC;EAC1C;AACF,CAAC;AAED,SAASH,aAAa,EAAER,iBAAiB","ignoreList":[]}
@@ -1,11 +1,14 @@
1
+ const _excluded = ["className"];
1
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
2
5
  import React from 'react';
3
6
  import { cn } from '../../tailwind';
4
7
  const Label = React.forwardRef((_ref, ref) => {
5
8
  let {
6
- className,
7
- ...props
8
- } = _ref;
9
+ className
10
+ } = _ref,
11
+ props = _objectWithoutProperties(_ref, _excluded);
9
12
  return React.createElement("label", _extends({}, props, {
10
13
  ref: ref,
11
14
  className: cn('lw-font-sans lw-text-base lw-font-medium lw-leading-none peer-disabled:lw-cursor-not-allowed peer-disabled:lw-opacity-70', className)
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","names":["React","cn","Label","forwardRef","_ref","ref","className","props","createElement","_extends","displayName"],"sources":["../../../../src/components/Label/Label.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\n/* eslint-disable jsx-a11y/label-has-associated-control */\nimport React from 'react';\n\nimport { cn } from '../../tailwind';\n\ninterface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n {...props}\n ref={ref}\n className={cn(\n 'lw-font-sans lw-text-base lw-font-medium lw-leading-none peer-disabled:lw-cursor-not-allowed peer-disabled:lw-opacity-70',\n className\n )}\n />\n )\n);\nLabel.displayName = 'Label';\n\nexport { Label };\n"],"mappings":";AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,EAAE,QAAQ,gBAAgB;AAInC,MAAMC,KAAK,GAAGF,KAAK,CAACG,UAAU,CAC5B,CAAAC,IAAA,EAA0BC,GAAG;EAAA,IAA5B;IAAEC,SAAS;IAAE,GAAGC;EAAM,CAAC,GAAAH,IAAA;EAAA,OACtBJ,KAAA,CAAAQ,aAAA,UAAAC,QAAA,KACMF,KAAK;IACTF,GAAG,EAAEA,GAAI;IACTC,SAAS,EAAEL,EAAE,CACX,0HAA0H,EAC1HK,SACF;EAAE,EACH,CAAC;AAAA,CAEN,CAAC;AACDJ,KAAK,CAACQ,WAAW,GAAG,OAAO;AAE3B,SAASR,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"Label.js","names":["React","cn","Label","forwardRef","_ref","ref","className","props","_objectWithoutProperties","_excluded","createElement","_extends","displayName"],"sources":["../../../../src/components/Label/Label.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\n/* eslint-disable jsx-a11y/label-has-associated-control */\nimport React from 'react';\n\nimport { cn } from '../../tailwind';\n\ninterface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n {...props}\n ref={ref}\n className={cn(\n 'lw-font-sans lw-text-base lw-font-medium lw-leading-none peer-disabled:lw-cursor-not-allowed peer-disabled:lw-opacity-70',\n className\n )}\n />\n )\n);\nLabel.displayName = 'Label';\n\nexport { Label };\n"],"mappings":";;;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,EAAE,QAAQ,gBAAgB;AAInC,MAAMC,KAAK,GAAGF,KAAK,CAACG,UAAU,CAC5B,CAAAC,IAAA,EAA0BC,GAAG;EAAA,IAA5B;MAAEC;IAAoB,CAAC,GAAAF,IAAA;IAAPG,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EAAA,OACpBT,KAAA,CAAAU,aAAA,UAAAC,QAAA,KACMJ,KAAK;IACTF,GAAG,EAAEA,GAAI;IACTC,SAAS,EAAEL,EAAE,CACX,0HAA0H,EAC1HK,SACF;EAAE,EACH,CAAC;AAAA,CAEN,CAAC;AACDJ,KAAK,CAACU,WAAW,GAAG,OAAO;AAE3B,SAASV,KAAK","ignoreList":[]}
@@ -9,7 +9,7 @@ const LastUpdated = _ref => {
9
9
  return React.createElement("span", {
10
10
  className: "lw-ml-1 lw-font-sans lw-text-xs lw-font-bold",
11
11
  "data-testid": "last-updated"
12
- }, `${labelCallback('last_updated')}: ${timestamp?.endsWith('Z') ? formatUpdatedTimestamp(timestamp, labelCallback('today')) : EMPTY_VALUE}`);
12
+ }, "".concat(labelCallback('last_updated'), ": ").concat(timestamp !== null && timestamp !== void 0 && timestamp.endsWith('Z') ? formatUpdatedTimestamp(timestamp, labelCallback('today')) : EMPTY_VALUE));
13
13
  };
14
14
  export { LastUpdated };
15
15
  //# sourceMappingURL=LastUpdated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LastUpdated.js","names":["React","EMPTY_VALUE","formatUpdatedTimestamp","LastUpdated","_ref","timestamp","labelCallback","createElement","className","endsWith"],"sources":["../../../../src/components/LastUpdated/LastUpdated.tsx"],"sourcesContent":["import React from 'react';\n\nimport { EMPTY_VALUE } from '../../constants';\nimport { formatUpdatedTimestamp } from '../../utils';\nimport type { LastUpdatedProps } from './types';\n\nconst LastUpdated = ({ timestamp, labelCallback }: LastUpdatedProps) => (\n <span\n className=\"lw-ml-1 lw-font-sans lw-text-xs lw-font-bold\"\n data-testid=\"last-updated\"\n >\n {`${labelCallback('last_updated')}: ${timestamp?.endsWith('Z') ? formatUpdatedTimestamp(timestamp, labelCallback('today')) : EMPTY_VALUE}`}\n </span>\n);\n\nexport { LastUpdated };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,sBAAsB,QAAQ,aAAa;AAGpD,MAAMC,WAAW,GAAGC,IAAA;EAAA,IAAC;IAAEC,SAAS;IAAEC;EAAgC,CAAC,GAAAF,IAAA;EAAA,OACjEJ,KAAA,CAAAO,aAAA;IACEC,SAAS,EAAC,8CAA8C;IACxD,eAAY;EAAc,GAEzB,GAAGF,aAAa,CAAC,cAAc,CAAC,KAAKD,SAAS,EAAEI,QAAQ,CAAC,GAAG,CAAC,GAAGP,sBAAsB,CAACG,SAAS,EAAEC,aAAa,CAAC,OAAO,CAAC,CAAC,GAAGL,WAAW,EACpI,CAAC;AAAA,CACR;AAED,SAASE,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"LastUpdated.js","names":["React","EMPTY_VALUE","formatUpdatedTimestamp","LastUpdated","_ref","timestamp","labelCallback","createElement","className","concat","endsWith"],"sources":["../../../../src/components/LastUpdated/LastUpdated.tsx"],"sourcesContent":["import React from 'react';\n\nimport { EMPTY_VALUE } from '../../constants';\nimport { formatUpdatedTimestamp } from '../../utils';\nimport type { LastUpdatedProps } from './types';\n\nconst LastUpdated = ({ timestamp, labelCallback }: LastUpdatedProps) => (\n <span\n className=\"lw-ml-1 lw-font-sans lw-text-xs lw-font-bold\"\n data-testid=\"last-updated\"\n >\n {`${labelCallback('last_updated')}: ${timestamp?.endsWith('Z') ? formatUpdatedTimestamp(timestamp, labelCallback('today')) : EMPTY_VALUE}`}\n </span>\n);\n\nexport { LastUpdated };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,sBAAsB,QAAQ,aAAa;AAGpD,MAAMC,WAAW,GAAGC,IAAA;EAAA,IAAC;IAAEC,SAAS;IAAEC;EAAgC,CAAC,GAAAF,IAAA;EAAA,OACjEJ,KAAA,CAAAO,aAAA;IACEC,SAAS,EAAC,8CAA8C;IACxD,eAAY;EAAc,MAAAC,MAAA,CAEtBH,aAAa,CAAC,cAAc,CAAC,QAAAG,MAAA,CAAKJ,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEK,QAAQ,CAAC,GAAG,CAAC,GAAGR,sBAAsB,CAACG,SAAS,EAAEC,aAAa,CAAC,OAAO,CAAC,CAAC,GAAGL,WAAW,CACpI,CAAC;AAAA,CACR;AAED,SAASE,WAAW","ignoreList":[]}
@@ -31,10 +31,10 @@ const LineChart = _ref => {
31
31
  className: "lw-font-sans",
32
32
  "data-testid": "line-chart-empty-value"
33
33
  }, CELL_EMPTY_VALUE), data.length >= CHART_DEFAULT_POINTS_NUMBER && React.createElement("div", {
34
- className: `${sizes[size].class}`,
34
+ className: "".concat(sizes[size].class),
35
35
  "data-testid": "line-chart"
36
36
  }, React.createElement("svg", {
37
- viewBox: `0 0 ${sizes[size].width} ${sizes[size].height}`,
37
+ viewBox: "0 0 ".concat(sizes[size].width, " ").concat(sizes[size].height),
38
38
  xmlns: "http://www.w3.org/2000/svg"
39
39
  }, React.createElement("path", {
40
40
  d: svgPath,
@@ -1 +1 @@
1
- {"version":3,"file":"LineChart.js","names":["React","CELL_EMPTY_VALUE","CHART_DEFAULT_POINTS_NUMBER","LineChartSize","getSvgPath","sizes","xs","class","width","height","sm","LineChart","_ref","data","color","size","padding","svgPath","createElement","Fragment","length","className","viewBox","xmlns","d","fill","stroke","strokeLinecap","strokeWidth"],"sources":["../../../../src/components/LineChart/LineChart.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CELL_EMPTY_VALUE, CHART_DEFAULT_POINTS_NUMBER } from '../constant';\nimport type { LineChartProps, SizeConfig } from './types';\nimport { LineChartSize } from './types';\nimport { getSvgPath } from './utils';\n\nconst sizes: { [key in LineChartSize]: SizeConfig } = {\n xs: {\n class: 'lw-h-[24px] lw-w-[100px]',\n width: 100,\n height: 24,\n },\n sm: {\n class: 'lw-h-[40px] lw-w-[100px]',\n width: 100,\n height: 40,\n },\n};\n\nconst LineChart = ({\n data,\n color,\n size = LineChartSize.sm,\n padding = 8,\n}: LineChartProps) => {\n const svgPath = getSvgPath({\n data,\n width: sizes[size].width,\n height: sizes[size].height,\n padding,\n });\n\n return (\n <>\n {data.length < CHART_DEFAULT_POINTS_NUMBER && (\n <span className=\"lw-font-sans\" data-testid=\"line-chart-empty-value\">\n {CELL_EMPTY_VALUE}\n </span>\n )}\n {data.length >= CHART_DEFAULT_POINTS_NUMBER && (\n <div className={`${sizes[size].class}`} data-testid=\"line-chart\">\n <svg\n viewBox={`0 0 ${sizes[size].width} ${sizes[size].height}`}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d={svgPath}\n fill=\"none\"\n stroke={color}\n strokeLinecap=\"round\"\n strokeWidth={1}\n />\n </svg>\n </div>\n )}\n </>\n );\n};\n\nexport { LineChart };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,S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ACEM,CAAC,EAAEP,OAAQ;IACXQ,IAAI,EAAC,MAAM;IACXC,MAAM,EAAEZ,KAAM;IACda,aAAa,EAAC,OAAO;IACrBC,WAAW,EAAE;EAAE,CAChB,CACE,CACF,CAEP,CAAC;AAEP,CAAC;AAED,SAASjB,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"LineChart.js","names":["React","CELL_EMPTY_VALUE","CHART_DEFAULT_POINTS_NUMBER","LineChartSize","getSvgPath","sizes","xs","class","width","height","sm","LineChart","_ref","data","color","size","padding","svgPath","createElement","Fragment","length","className","concat","viewBox","xmlns","d","fill","stroke","strokeLinecap","strokeWidth"],"sources":["../../../../src/components/LineChart/LineChart.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CELL_EMPTY_VALUE, CHART_DEFAULT_POINTS_NUMBER } from '../constant';\nimport type { LineChartProps, SizeConfig } from './types';\nimport { LineChartSize } from './types';\nimport { getSvgPath } from './utils';\n\nconst sizes: { [key in LineChartSize]: SizeConfig } = {\n xs: {\n class: 'lw-h-[24px] lw-w-[100px]',\n width: 100,\n height: 24,\n },\n sm: {\n class: 'lw-h-[40px] lw-w-[100px]',\n width: 100,\n height: 40,\n },\n};\n\nconst LineChart = ({\n data,\n color,\n size = LineChartSize.sm,\n padding = 8,\n}: LineChartProps) => {\n const svgPath = getSvgPath({\n data,\n width: sizes[size].width,\n height: sizes[size].height,\n padding,\n });\n\n return (\n <>\n {data.length < CHART_DEFAULT_POINTS_NUMBER && (\n <span className=\"lw-font-sans\" data-testid=\"line-chart-empty-value\">\n {CELL_EMPTY_VALUE}\n </span>\n )}\n {data.length >= CHART_DEFAULT_POINTS_NUMBER && (\n <div className={`${sizes[size].class}`} data-testid=\"line-chart\">\n <svg\n viewBox={`0 0 ${sizes[size].width} ${sizes[size].height}`}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d={svgPath}\n fill=\"none\"\n stroke={color}\n strokeLinecap=\"round\"\n strokeWidth={1}\n />\n </svg>\n </div>\n )}\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jB,KAAK,CAACU,IAAI,CAAC,CAACN,MAAM,CAAG;IAC1De,KAAK,EAAC;EAA4B,GAElCxB,KAAA,CAAAkB,aAAA;IACEO,CAAC,EAAER,OAAQ;IACXS,IAAI,EAAC,MAAM;IACXC,MAAM,EAAEb,KAAM;IACdc,aAAa,EAAC,OAAO;IACrBC,WAAW,EAAE;EAAE,CAChB,CACE,CACF,CAEP,CAAC;AAEP,CAAC;AAED,SAASlB,SAAS","ignoreList":[]}
@@ -17,12 +17,12 @@ export const getSvgPath = _ref => {
17
17
  return data.map((item, index) => {
18
18
  const x = usableWidth * (index / (length - 1)) + padding;
19
19
  const y = min === max ? usableHeight / 2 : usableHeight - usableHeight * ((item - min) / (max - min)) + padding;
20
- return index ? `${x} ${y}` : `M${x} ${y}`;
20
+ return index ? "".concat(x, " ").concat(y) : "M".concat(x, " ").concat(y);
21
21
  }).join(' ');
22
22
  };
23
23
  export const getChartColor = (dailyChange, isDarkMode) => {
24
24
  const theme = isDarkMode ? Theme.Dark : Theme.Light;
25
- switch (dailyChange?.charAt(0)) {
25
+ switch (dailyChange === null || dailyChange === void 0 ? void 0 : dailyChange.charAt(0)) {
26
26
  case '+':
27
27
  return themeColors.ok[theme];
28
28
  case '-':
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["themeColors","Theme","getSvgPath","_ref","data","width","height","padding","min","Math","max","usableHeight","usableWidth","length","map","item","index","x","y","join","getChartColor","dailyChange","isDarkMode","theme","Dark","Light","charAt","ok","danger","borderDisabled"],"sources":["../../../../src/components/LineChart/utils.tsx"],"sourcesContent":["import { themeColors } from '../../tailwind';\nimport { Theme } from '../../types';\n\nexport const getSvgPath = ({\n data,\n width,\n height,\n padding,\n}: {\n data: number[];\n width: number;\n height: number;\n padding: number;\n}) => {\n const min = Math.min(...data);\n const max = Math.max(...data);\n const usableHeight = height - padding * 2;\n const usableWidth = width - padding * 2;\n const { length } = data;\n\n return data\n .map((item, index) => {\n const x = usableWidth * (index / (length - 1)) + padding;\n const y =\n min === max\n ? usableHeight / 2\n : usableHeight -\n usableHeight * ((item - min) / (max - min)) +\n padding;\n\n return index ? `${x} ${y}` : `M${x} ${y}`;\n })\n .join(' ');\n};\n\nexport const getChartColor = (dailyChange?: string, isDarkMode?: boolean) => {\n const theme = isDarkMode ? Theme.Dark : Theme.Light;\n\n switch (dailyChange?.charAt(0)) {\n case '+':\n return themeColors.ok[theme];\n case '-':\n return themeColors.danger[theme];\n default:\n return themeColors.borderDisabled[theme];\n }\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,KAAK,QAAQ,aAAa;AAEnC,OAAO,MAAMC,UAAU,GAAGC,IAAA,IAUpB;EAAA,IAVqB;IACzBC,IAAI;IACJC,KAAK;IACLC,MAAM;IACNC;EAMF,CAAC,GAAAJ,IAAA;EACC,MAAMK,GAAG,GAAGC,IAAI,CAACD,GAAG,CAAC,GAAGJ,IAAI,CAAC;EAC7B,MAAMM,GAAG,GAAGD,IAAI,CAACC,GAAG,CAAC,GAAGN,IAAI,CAAC;EAC7B,MAAMO,YAAY,GAAGL,MAAM,GAAGC,OAAO,GAAG,CAAC;EACzC,MAAMK,WAAW,GAAGP,KAAK,GAAGE,OAAO,GAAG,CAAC;EACvC,MAAM;IAAEM;EAAO,CAAC,GAAGT,IAAI;EAEvB,OAAOA,IAAI,CACRU,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;IACpB,MAAMC,CAAC,GAAGL,WAAW,IAAII,KAAK,IAAIH,MAAM,GAAG,CAAC,CAAC,CAAC,GAAGN,OAAO;IACxD,MAAMW,CAAC,GACLV,GAAG,KAAKE,GAAG,GACPC,YAAY,GAAG,CAAC,GAChBA,YAAY,GACZA,YAAY,IAAI,CAACI,IAAI,GAAGP,GAAG,KAAKE,GAAG,GAAGF,GAAG,CAAC,CAAC,GAC3CD,OAAO;IAEb,OAAOS,KAAK,GAAG,GAAGC,CAAC,IAAIC,CAAC,EAAE,GAAG,IAAID,CAAC,IAAIC,CAAC,EAAE;EAC3C,CAAC,CAAC,CACDC,IAAI,CAAC,GAAG,CAAC;AACd,CAAC;AAED,OAAO,MAAMC,aAAa,GAAGA,CAACC,WAAoB,EAAEC,UAAoB,KAAK;EAC3E,MAAMC,KAAK,GAAGD,UAAU,GAAGrB,KAAK,CAACuB,IAAI,GAAGvB,KAAK,CAACwB,KAAK;EAEnD,QAAQJ,WAAW,EAAEK,MAAM,CAAC,CAAC,CAAC;IAC5B,KAAK,GAAG;MACN,OAAO1B,WAAW,CAAC2B,EAAE,CAACJ,KAAK,CAAC;IAC9B,KAAK,GAAG;MACN,OAAOvB,WAAW,CAAC4B,MAAM,CAACL,KAAK,CAAC;IAClC;MACE,OAAOvB,WAAW,CAAC6B,cAAc,CAACN,KAAK,CAAC;EAC5C;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"utils.js","names":["themeColors","Theme","getSvgPath","_ref","data","width","height","padding","min","Math","max","usableHeight","usableWidth","length","map","item","index","x","y","concat","join","getChartColor","dailyChange","isDarkMode","theme","Dark","Light","charAt","ok","danger","borderDisabled"],"sources":["../../../../src/components/LineChart/utils.tsx"],"sourcesContent":["import { themeColors } from '../../tailwind';\nimport { Theme } from '../../types';\n\nexport const getSvgPath = ({\n data,\n width,\n height,\n padding,\n}: {\n data: number[];\n width: number;\n height: number;\n padding: number;\n}) => {\n const min = Math.min(...data);\n const max = Math.max(...data);\n const usableHeight = height - padding * 2;\n const usableWidth = width - padding * 2;\n const { length } = data;\n\n return data\n .map((item, index) => {\n const x = usableWidth * (index / (length - 1)) + padding;\n const y =\n min === max\n ? usableHeight / 2\n : usableHeight -\n usableHeight * ((item - min) / (max - min)) +\n padding;\n\n return index ? `${x} ${y}` : `M${x} ${y}`;\n })\n .join(' ');\n};\n\nexport const getChartColor = (dailyChange?: string, isDarkMode?: boolean) => {\n const theme = isDarkMode ? Theme.Dark : Theme.Light;\n\n switch (dailyChange?.charAt(0)) {\n case '+':\n return themeColors.ok[theme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B,KAAK,CAACyB,KAAK;EAEnD,QAAQJ,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEK,MAAM,CAAC,CAAC,CAAC;IAC5B,KAAK,GAAG;MACN,OAAO3B,WAAW,CAAC4B,EAAE,CAACJ,KAAK,CAAC;IAC9B,KAAK,GAAG;MACN,OAAOxB,WAAW,CAAC6B,MAAM,CAACL,KAAK,CAAC;IAClC;MACE,OAAOxB,WAAW,CAAC8B,cAAc,CAACN,KAAK,CAAC;EAC5C;AACF,CAAC","ignoreList":[]}
@@ -69,14 +69,14 @@ const Pagination = _ref => {
69
69
  }
70
70
  }
71
71
  }, React.createElement(ChevronLeft, null))), pages.map((pageNumber, index) => pageNumber === undefined ? React.createElement("li", {
72
- key: `placeholder_${index + 1}`
72
+ key: "placeholder_".concat(index + 1)
73
73
  }, React.createElement("span", {
74
74
  className: "lw-block lw-h-[20px] lw-w-[20px] lw-justify-center lw-rounded-full lw-text-center lw-align-baseline lw-font-sans lw-text-xs lw-leading-[18px]"
75
75
  }, '...')) : React.createElement("li", {
76
76
  key: pageNumber
77
77
  }, React.createElement("a", {
78
78
  "aria-current": pageNumber === currentPage ? 'true' : undefined,
79
- "aria-label": `Goto Page ${pageNumber + 1}`,
79
+ "aria-label": "Goto Page ".concat(pageNumber + 1),
80
80
  className: cn('lw-flex lw-items-center lw-justify-center focus:lw-outline-primary lw-rounded-full', {
81
81
  'lw-pointer-events-none': pageNumber === currentPage || disabled,
82
82
  'lw-h-6 lw-w-6': isDesktop,
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","names":["useLocale","React","ChevronLeft","ChevronRight","useLayoutProvider","cn","Size","generatePaginationArray","Pagination","_ref","currentPage","onPageChange","totalRecords","recordsPerPage","disabled","lang","isDark","size","isDesktop","DESKTOP","totalPages","Math","ceil","lastPage","pages","recordsOnCurrentPage","createElement","className","firstItemOnPage","lastItemOnPage","itemCount","role","href","tabIndex","undefined","onClick","e","preventDefault","map","pageNumber","index","key"],"sources":["../../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/anchor-is-valid */\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChevronLeft, ChevronRight } from '../../images';\nimport { useLayoutProvider } from '../../providers';\nimport { cn } from '../../tailwind';\nimport { Size } from '../../types';\nimport type { PaginationProps } from './types';\nimport { generatePaginationArray } from './utils';\n\nconst Pagination = ({\n currentPage,\n onPageChange,\n totalRecords,\n recordsPerPage,\n disabled,\n}: PaginationProps) => {\n const { lang } = useLocale();\n const { isDark, size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const totalPages = Math.ceil(totalRecords / recordsPerPage);\n const lastPage = totalPages - 1;\n const pages = generatePaginationArray(totalPages, currentPage);\n\n const recordsOnCurrentPage =\n currentPage === lastPage\n ? totalRecords\n : recordsPerPage * (currentPage + 1);\n\n return (\n <div\n className={cn('lw-flex lw-items-center lw-justify-between', {\n 'lw-flex-row lw-px-6 lw-py-4': isDesktop,\n 'lw-flex-col': !isDesktop,\n })}\n data-testid=\"pagination\"\n >\n <div\n className={cn('lw-font-sans', {\n 'lw-my-3': !isDesktop,\n })}\n >\n <span>\n {lang('pagination_entries_range', {\n firstItemOnPage: currentPage * recordsPerPage + 1,\n lastItemOnPage: recordsOnCurrentPage,\n itemCount: totalRecords,\n })}\n </span>\n </div>\n <nav aria-label=\"Pagination Navigation\" role=\"navigation\">\n <ul\n className={cn(\n 'lw-flex lw-items-center lw-gap-1 lw-text-text-primary',\n {\n 'lw-my-0': isDesktop,\n 'lw-mb-6': !isDesktop,\n }\n )}\n >\n <li className=\"lw-font-sans lw-text-xs\">\n <a\n aria-label=\"Goto previous page\"\n className={cn(\n 'lw-text-xs lw-tracking-normal lw-flex lw-mr-1 lw-items-center lw-justify-center lw-rounded-full focus:lw-outline-primary',\n {\n 'hover:lw-bg-border-primary': isDark,\n 'hover:lw-bg-bg-secondary': !isDark,\n 'lw-pointer-events-none [&>svg]:lw-stroke-text-primary':\n isDark && (currentPage === 0 || disabled),\n 'lw-pointer-events-none [&>svg]:lw-stroke-border-disabled':\n !isDark && (currentPage === 0 || disabled),\n 'lw-h-[20px] lw-w-[20px]': isDesktop,\n 'lw-h-[30px] lw-w-[30px]': !isDesktop,\n }\n )}\n data-testid=\"pagination-button\"\n href=\"#\"\n tabIndex={currentPage === 0 || disabled ? -1 : undefined}\n onClick={(e) => {\n e.preventDefault();\n if (currentPage !== 0 && !disabled) {\n onPageChange(currentPage - 1);\n }\n }}\n >\n <ChevronLeft />\n </a>\n </li>\n {pages.map((pageNumber, index) =>\n pageNumber === undefined ? (\n <li key={`placeholder_${index + 1}`}>\n <span className=\"lw-block lw-h-[20px] lw-w-[20px] lw-justify-center lw-rounded-full lw-text-center lw-align-baseline lw-font-sans lw-text-xs lw-leading-[18px]\">\n {'...'}\n </span>\n </li>\n ) : (\n <li key={pageNumber}>\n <a\n aria-current={pageNumber === currentPage ? 'true' : undefined}\n aria-label={`Goto Page ${pageNumber + 1}`}\n className={cn(\n 'lw-flex lw-items-center lw-justify-center focus:lw-outline-primary lw-rounded-full',\n {\n 'lw-pointer-events-none':\n pageNumber === currentPage || disabled,\n 'lw-h-6 lw-w-6': isDesktop,\n 'lw-h-[40px] lw-w-[40px]': !isDesktop,\n }\n )}\n data-testid=\"pagination-button\"\n href=\"#\"\n tabIndex={\n pageNumber === currentPage || disabled ? -1 : undefined\n }\n onClick={(e) => {\n e.preventDefault();\n if (currentPage !== pageNumber && !disabled) {\n onPageChange(pageNumber);\n }\n }}\n >\n <span\n className={cn(\n 'lw-text-xs lw-text-center lw-font-sans lw-align-baseline lw-block lw-justify-center lw-rounded-full',\n {\n 'lw-bg-ok lw-font-bold':\n !isDark && pageNumber === currentPage,\n 'lw-bg-primary lw-text-text-negative lw-font-bold':\n isDark && pageNumber === currentPage,\n 'hover:lw-bg-border-primary':\n isDark && pageNumber !== currentPage,\n 'hover:lw-bg-bg-secondary':\n !isDark && pageNumber !== currentPage,\n 'lw-text-border-disabled': disabled,\n 'lw-bg-border-primary':\n isDark && pageNumber === currentPage && disabled,\n 'lw-bg-bg-secondary':\n !isDark && pageNumber === currentPage && disabled,\n 'lw-h-[20px] lw-w-[20px] lw-leading-[18px]': isDesktop,\n 'lw-h-[30px] lw-w-[30px] lw-leading-[28px]': !isDesktop,\n }\n )}\n >\n {pageNumber + 1}\n </span>\n </a>\n </li>\n )\n )}\n <li>\n <a\n aria-label=\"Goto next page\"\n className={cn(\n 'lw-text-xs lw-flex lw-ml-1 lw-items-center lw-justify-center lw-rounded-full focus:lw-outline-primary',\n {\n 'hover:lw-bg-border-primary': isDark,\n 'hover:lw-bg-bg-secondary': !isDark,\n 'lw-pointer-events-none [&>svg]:lw-stroke-text-primary':\n isDark && (currentPage === lastPage || disabled),\n 'lw-pointer-events-none [&>svg]:lw-stroke-border-disabled':\n !isDark && (currentPage === lastPage || disabled),\n 'lw-h-[20px] lw-w-[20px]': isDesktop,\n 'lw-h-[30px] lw-w-[30px]': !isDesktop,\n }\n )}\n data-testid=\"pagination-button\"\n href=\"#\"\n tabIndex={currentPage === lastPage || disabled ? -1 : undefined}\n onClick={(e) => {\n e.preventDefault();\n if (currentPage !== lastPage && !disabled) {\n onPageChange(currentPage + 1);\n }\n }}\n >\n <ChevronRight />\n </a>\n </li>\n </ul>\n </nav>\n </div>\n );\n};\n\nexport { Pagination };\n"],"mappings":"AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,EAAEC,YAAY,QAAQ,cAAc;AACxD,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,EAAE,QAAQ,gBAAgB;AACnC,SAASC,IAAI,QAAQ,aAAa;AAElC,SAASC,uBAAuB,QAAQ,SAAS;AAEjD,MAAMC,UAAU,GAAGC,IAAA,IAMI;EAAA,IANH;IAClBC,WAAW;IACXC,YAAY;IACZC,YAAY;IACZC,cAAc;IACdC;EACe,CAAC,GAAAL,IA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MACnC,uDAAuD,EACrDA,MAAM,KAAKN,WAAW,KAAKa,QAAQ,IAAIT,QAAQ,CAAC;MAClD,0DAA0D,EACxD,CAACE,MAAM,KAAKN,WAAW,KAAKa,QAAQ,IAAIT,QAAQ,CAAC;MACnD,yBAAyB,EAAEI,SAAS;MACpC,yBAAyB,EAAE,CAACA;IAC9B,CACF,CAAE;IACF,eAAY,mBAAmB;IAC/Bc,IAAI,EAAC,GAAG;IACRC,QAAQ,EAAEvB,WAAW,KAAKa,QAAQ,IAAIT,QAAQ,GAAG,CAAC,CAAC,GAAGoB,SAAU;IAChEC,OAAO,EAAGC,CAAC,IAAK;MACdA,CAAC,CAACC,cAAc,CAAC,CAAC;MAClB,IAAI3B,WAAW,KAAKa,QAAQ,IAAI,CAACT,QAAQ,EAAE;QACzCH,YAAY,CAACD,WAAW,GAAG,CAAC,CAAC;MAC/B;IACF;EAAE,GAEFT,KAAA,CAAAyB,aAAA,CAACvB,YAAY,MAAE,CACd,CACD,CACF,CACD,CACF,CAAC;AAEV,CAAC;AAED,SAASK,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"Pagination.js","names":["useLocale","React","ChevronLeft","ChevronRight","useLayoutProvider","cn","Size","generatePaginationArray","Pagination","_ref","currentPage","onPageChange","totalRecords","recordsPerPage","disabled","lang","isDark","size","isDesktop","DESKTOP","totalPages","Math","ceil","lastPage","pages","recordsOnCurrentPage","createElement","className","firstItemOnPage","lastItemOnPage","itemCount","role","href","tabIndex","undefined","onClick","e","preventDefault","map","pageNumber","index","key","concat"],"sources":["../../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/anchor-is-valid */\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChevronLeft, ChevronRight } from '../../images';\nimport { useLayoutProvider } from '../../providers';\nimport { cn } from '../../tailwind';\nimport { Size } from '../../types';\nimport type { PaginationProps } from './types';\nimport { generatePaginationArray } from './utils';\n\nconst Pagination = ({\n currentPage,\n onPageChange,\n totalRecords,\n recordsPerPage,\n disabled,\n}: PaginationProps) => {\n const { lang } = useLocale();\n const { isDark, size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const totalPages = Math.ceil(totalRecords / recordsPerPage);\n const lastPage = totalPages - 1;\n const pages = generatePaginationArray(totalPages, currentPage);\n\n const recordsOnCurrentPage =\n currentPage === lastPage\n ? totalRecords\n : recordsPerPage * (currentPage + 1);\n\n return (\n <div\n className={cn('lw-flex lw-items-center lw-justify-between', {\n 'lw-flex-row lw-px-6 lw-py-4': isDesktop,\n 'lw-flex-col': !isDesktop,\n })}\n data-testid=\"pagination\"\n >\n <div\n className={cn('lw-font-sans', {\n 'lw-my-3': !isDesktop,\n })}\n >\n <span>\n {lang('pagination_entries_range', {\n firstItemOnPage: currentPage * recordsPerPage + 1,\n lastItemOnPage: recordsOnCurrentPage,\n itemCount: totalRecords,\n })}\n </span>\n </div>\n <nav aria-label=\"Pagination Navigation\" role=\"navigation\">\n <ul\n className={cn(\n 'lw-flex lw-items-center lw-gap-1 lw-text-text-primary',\n {\n 'lw-my-0': isDesktop,\n 'lw-mb-6': !isDesktop,\n }\n )}\n >\n <li className=\"lw-font-sans lw-text-xs\">\n <a\n aria-label=\"Goto previous page\"\n className={cn(\n 'lw-text-xs lw-tracking-normal lw-flex lw-mr-1 lw-items-center lw-justify-center lw-rounded-full focus:lw-outline-primary',\n {\n 'hover:lw-bg-border-primary': isDark,\n 'hover:lw-bg-bg-secondary': !isDark,\n 'lw-pointer-events-none [&>svg]:lw-stroke-text-primary':\n isDark && (currentPage === 0 || disabled),\n 'lw-pointer-events-none [&>svg]:lw-stroke-border-disabled':\n !isDark && (currentPage === 0 || disabled),\n 'lw-h-[20px] lw-w-[20px]': isDesktop,\n 'lw-h-[30px] lw-w-[30px]': !isDesktop,\n }\n )}\n data-testid=\"pagination-button\"\n href=\"#\"\n tabIndex={currentPage === 0 || disabled ? -1 : undefined}\n onClick={(e) => {\n e.preventDefault();\n if (currentPage !== 0 && !disabled) {\n onPageChange(currentPage - 1);\n }\n }}\n >\n <ChevronLeft />\n </a>\n </li>\n {pages.map((pageNumber, index) =>\n pageNumber === undefined ? (\n <li key={`placeholder_${index + 1}`}>\n <span className=\"lw-block lw-h-[20px] lw-w-[20px] lw-justify-center lw-rounded-full lw-text-center lw-align-baseline lw-font-sans lw-text-xs lw-leading-[18px]\">\n {'...'}\n </span>\n </li>\n ) : (\n <li key={pageNumber}>\n <a\n aria-current={pageNumber === currentPage ? 'true' : undefined}\n aria-label={`Goto Page ${pageNumber + 1}`}\n className={cn(\n 'lw-flex lw-items-center lw-justify-center focus:lw-outline-primary lw-rounded-full',\n {\n 'lw-pointer-events-none':\n pageNumber === currentPage || disabled,\n 'lw-h-6 lw-w-6': isDesktop,\n 'lw-h-[40px] lw-w-[40px]': !isDesktop,\n }\n )}\n data-testid=\"pagination-button\"\n href=\"#\"\n tabIndex={\n pageNumber === currentPage || disabled ? -1 : undefined\n }\n onClick={(e) => {\n e.preventDefault();\n if (currentPage !== pageNumber && !disabled) {\n onPageChange(pageNumber);\n }\n }}\n >\n <span\n className={cn(\n 'lw-text-xs lw-text-center lw-font-sans lw-align-baseline lw-block lw-justify-center lw-rounded-full',\n {\n 'lw-bg-ok lw-font-bold':\n !isDark && pageNumber === currentPage,\n 'lw-bg-primary lw-text-text-negative lw-font-bold':\n isDark && pageNumber === currentPage,\n 'hover:lw-bg-border-primary':\n isDark && pageNumber !== currentPage,\n 'hover:lw-bg-bg-secondary':\n !isDark && pageNumber !== currentPage,\n 'lw-text-border-disabled': disabled,\n 'lw-bg-border-primary':\n isDark && pageNumber === currentPage && disabled,\n 'lw-bg-bg-secondary':\n !isDark && pageNumber === currentPage && disabled,\n 'lw-h-[20px] lw-w-[20px] lw-leading-[18px]': isDesktop,\n 'lw-h-[30px] lw-w-[30px] lw-leading-[28px]': !isDesktop,\n }\n )}\n >\n {pageNumber + 1}\n </span>\n </a>\n </li>\n )\n )}\n <li>\n <a\n aria-label=\"Goto next page\"\n className={cn(\n 'lw-text-xs lw-flex lw-ml-1 lw-items-center lw-justify-center lw-rounded-full focus:lw-outline-primary',\n {\n 'hover:lw-bg-border-primary': isDark,\n 'hover:lw-bg-bg-secondary': !isDark,\n 'lw-pointer-events-none [&>svg]:lw-stroke-text-primary':\n isDark && (currentPage === lastPage || disabled),\n 'lw-pointer-events-none [&>svg]:lw-stroke-border-disabled':\n !isDark && (currentPage === lastPage || disabled),\n 'lw-h-[20px] lw-w-[20px]': isDesktop,\n 'lw-h-[30px] lw-w-[30px]': !isDesktop,\n }\n )}\n data-testid=\"pagination-button\"\n href=\"#\"\n tabIndex={currentPage === lastPage || disabled ? -1 : undefined}\n onClick={(e) => {\n e.preventDefault();\n if (currentPage !== lastPage && !disabled) {\n onPageChange(currentPage + 1);\n }\n }}\n >\n <ChevronRight />\n </a>\n </li>\n </ul>\n </nav>\n </div>\n );\n};\n\nexport { Pagination };\n"],"mappings":"AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,EAAEC,YAAY,QAAQ,cAAc;AACxD,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,EAAE,QAAQ,gBAAgB;AACnC,SAASC,IAAI,QAAQ,aAAa;AAElC,SAASC,uBAAuB,QAAQ,SAAS;AAEjD,MAAMC,UAAU,GAAGC,IAAA,IAMI;EAAA,IANH;IAClBC,WAAW;IACXC,YAAY;IACZC,YAAY;IACZC,cAAc;IACdC;EACe,CAAC,GAAAL,IAAA;EAChB,MAAM;IAAEM;EAAK,CAAC,GAAGf,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEgB,MAAM;IAAEC;EAAK,CAAC,GAAGb,iBAAiB,CAAC,CAAC;EAC5C,MAAMc,SAAS,GAAGD,IAAI,KAAKX,IAAI,CAACa,OAAO;EACvC,MAAMC,UAAU,GAAGC,IAAI,CAACC,IAAI,CAACV,YAAY,GAAGC,cAAc,CAAC;E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C/Bc,IAAI,EAAC,GAAG;IACRC,QAAQ,EAAEvB,WAAW,KAAKa,QAAQ,IAAIT,QAAQ,GAAG,CAAC,CAAC,GAAGoB,SAAU;IAChEC,OAAO,EAAGC,CAAC,IAAK;MACdA,CAAC,CAACC,cAAc,CAAC,CAAC;MAClB,IAAI3B,WAAW,KAAKa,QAAQ,IAAI,CAACT,QAAQ,EAAE;QACzCH,YAAY,CAACD,WAAW,GAAG,CAAC,CAAC;MAC/B;IACF;EAAE,GAEFT,KAAA,CAAAyB,aAAA,CAACvB,YAAY,MAAE,CACd,CACD,CACF,CACD,CACF,CAAC;AAEV,CAAC;AAED,SAASK,UAAU","ignoreList":[]}
@@ -40,7 +40,7 @@ const Select = _ref => {
40
40
  "data-testid": "single-option-select"
41
41
  }, selectLabel && React.createElement("span", {
42
42
  className: "lw-text-base lw-font-bold"
43
- }, `${selectLabel}:`), React.createElement("div", {
43
+ }, "".concat(selectLabel, ":")), React.createElement("div", {
44
44
  className: "lw-flex lw-h-[50px] lw-w-full lw-items-center lw-rounded lw-border lw-px-3"
45
45
  }, React.createElement(Truncate, {
46
46
  maxWidth: 190,
@@ -51,7 +51,7 @@ const Select = _ref => {
51
51
  "data-testid": "select"
52
52
  }, selectLabel && React.createElement("span", {
53
53
  className: "lw-text-base lw-font-bold"
54
- }, `${selectLabel}:`), React.createElement("div", {
54
+ }, "".concat(selectLabel, ":")), React.createElement("div", {
55
55
  className: "lw-flex lw-w-full lw-items-center lw-justify-between lw-rounded lw-border lw-stroke-text-primary lw-px-3 lw-py-2 focus:lw-outline-primary",
56
56
  role: "button",
57
57
  tabIndex: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","names":["classnames","React","useEffect","useRef","useState","useOnClickOutside","ChevronDown","useLayoutProvider","cn","SearchInput","Truncate","Select","_ref","searchPlaceholder","selectLabel","options","selectedOption","setSelectedOption","className","maxHeight","isDark","ref","open","setOpen","active","setActive","searchValue","setSearchValue","singleSelect","length","withSearch","handleClickOutside","handleSearch","value","createElement","Fragment","maxWidth","text","label","role","tabIndex","onClick","onKeyDown","e","key","style","autoFocus","placeholder","onChange","filter","option","toLowerCase","includes","map","index","array","id","type","onBlur","onFocus","onMouseOut","onMouseOver"],"sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useOnClickOutside } from 'usehooks-ts';\n\nimport { ChevronDown } from '../../images';\nimport { useLayoutProvider } from '../../providers';\nimport { cn } from '../../tailwind';\nimport { SearchInput } from '../SearchInput';\nimport { Truncate } from '../Truncate';\nimport type { SelectProps } from './types';\n\nconst Select = ({\n searchPlaceholder,\n selectLabel,\n options,\n selectedOption,\n setSelectedOption,\n className,\n maxHeight,\n}: SelectProps) => {\n const { isDark } = useLayoutProvider();\n const ref = useRef(null);\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState('');\n const [searchValue, setSearchValue] = useState('');\n const singleSelect = options.length === 1;\n const withSearch = options.length > 6;\n\n const handleClickOutside = () => {\n setOpen(false);\n };\n\n const handleSearch = (value: string) => {\n setSearchValue(value);\n };\n\n useEffect(() => {\n setSearchValue('');\n }, [options]);\n\n useOnClickOutside(ref, handleClickOutside);\n\n return (\n <>\n {singleSelect ? (\n <div\n className={cn('lw-relative lw-grow lw-text-text-primary', className)}\n data-testid=\"single-option-select\"\n >\n {selectLabel && (\n <span className=\"lw-text-base lw-font-bold\">{`${selectLabel}:`}</span>\n )}\n <div className=\"lw-flex lw-h-[50px] lw-w-full lw-items-center lw-rounded lw-border lw-px-3\">\n <Truncate maxWidth={190} text={selectedOption.label} />\n </div>\n </div>\n ) : (\n <div\n ref={ref}\n className={cn('lw-relative lw-grow lw-text-text-primary', className)}\n data-testid=\"select\"\n >\n {selectLabel && (\n <span className=\"lw-text-base lw-font-bold\">{`${selectLabel}:`}</span>\n )}\n <div\n className=\"lw-flex lw-w-full lw-items-center lw-justify-between lw-rounded lw-border lw-stroke-text-primary lw-px-3 lw-py-2 focus:lw-outline-primary\"\n role=\"button\"\n tabIndex={0}\n onClick={() => setOpen(!open)}\n onKeyDown={(e: React.KeyboardEvent) => {\n if (e.key === 'Enter') {\n setOpen(!open);\n }\n }}\n >\n <Truncate maxWidth={190} text={selectedOption.label} />\n <ChevronDown\n className={classnames(\n 'lw-transition lw-duration-200 lw-ease-linear',\n {\n 'lw-rotate-180': open,\n }\n )}\n />\n </div>\n {open && (\n <ul\n className={cn(\n 'lw-absolute lw-z-[100] lw-mx-0 lw-mt-2 lw-w-full lw-list-none lw-appearance-none lw-overflow-y-auto lw-overflow-x-hidden lw-bg-bg-secondary lw-p-4',\n !isDark && 'lw-shadow-lg',\n !maxHeight && 'lw-max-h-60'\n )}\n data-testid=\"select-options\"\n style={{ maxHeight }}\n >\n {withSearch && (\n <li>\n <SearchInput\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n placeholder={searchPlaceholder}\n value={searchValue}\n onChange={handleSearch}\n />\n </li>\n )}\n {options\n .filter((option) =>\n option.label.toLowerCase().includes(searchValue.toLowerCase())\n )\n .map((option, index, array) => (\n <li\n key={option.id}\n className=\"lw-mb-0 lw-font-sans\"\n value={option.id}\n >\n <button\n className={classnames(\n 'lw-w-full lw-cursor-pointer lw-text-left lw-text-sm focus:lw-outline-none',\n {\n 'lw-mb-4': array.length - 1 !== index,\n 'lw-text-primary': active === option.id,\n }\n )}\n type=\"button\"\n onBlur={() => setActive('')}\n onClick={() => {\n setSelectedOption(option);\n setOpen(false);\n }}\n onFocus={() => setActive(option.id)}\n onMouseOut={() => setActive('')}\n onMouseOver={() => setActive(option.id)}\n >\n <span\n className={classnames({\n 'lw-font-bold': option.id === selectedOption.id,\n })}\n >\n {option.label}\n </span>\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n </>\n );\n};\n\nexport { Select };\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ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,KAAMnC,SAAS,CAAC,EAAE,CAAE;IAChCoC,WAAW,EAAEA,CAAA,KAAMpC,SAAS,CAACyB,MAAM,CAACM,EAAE;EAAE,GAExCvD,KAAA,CAAAiC,aAAA;IACEhB,SAAS,EAAElB,UAAU,CAAC;MACpB,cAAc,EAAEkD,MAAM,CAACM,EAAE,KAAKxC,cAAc,CAACwC;IAC/C,CAAC;EAAE,GAEFN,MAAM,CAACZ,KACJ,CACA,CACN,CACL,CACD,CAEH,CAEP,CAAC;AAEP,CAAC;AAED,SAAS3B,MAAM","ignoreList":[]}
1
+ {"version":3,"file":"Select.js","names":["classnames","React","useEffect","useRef","useState","useOnClickOutside","ChevronDown","useLayoutProvider","cn","SearchInput","Truncate","Select","_ref","searchPlaceholder","selectLabel","options","selectedOption","setSelectedOption","className","maxHeight","isDark","ref","open","setOpen","active","setActive","searchValue","setSearchValue","singleSelect","length","withSearch","handleClickOutside","handleSearch","value","createElement","Fragment","concat","maxWidth","text","label","role","tabIndex","onClick","onKeyDown","e","key","style","autoFocus","placeholder","onChange","filter","option","toLowerCase","includes","map","index","array","id","type","onBlur","onFocus","onMouseOut","onMouseOver"],"sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useOnClickOutside } from 'usehooks-ts';\n\nimport { ChevronDown } from '../../images';\nimport { useLayoutProvider } from '../../providers';\nimport { cn } from '../../tailwind';\nimport { SearchInput } from '../SearchInput';\nimport { Truncate } from '../Truncate';\nimport type { SelectProps } from './types';\n\nconst Select = ({\n searchPlaceholder,\n selectLabel,\n options,\n selectedOption,\n setSelectedOption,\n className,\n maxHeight,\n}: SelectProps) => {\n const { isDark } = useLayoutProvider();\n const ref = useRef(null);\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState('');\n const [searchValue, setSearchValue] = useState('');\n const singleSelect = options.length === 1;\n const withSearch = options.length > 6;\n\n const handleClickOutside = () => {\n setOpen(false);\n };\n\n const handleSearch = (value: string) => {\n setSearchValue(value);\n };\n\n useEffect(() => {\n setSearchValue('');\n }, [options]);\n\n useOnClickOutside(ref, handleClickOutside);\n\n return (\n <>\n {singleSelect ? (\n <div\n className={cn('lw-relative lw-grow lw-text-text-primary', className)}\n data-testid=\"single-option-select\"\n >\n {selectLabel && (\n <span className=\"lw-text-base lw-font-bold\">{`${selectLabel}:`}</span>\n )}\n <div className=\"lw-flex lw-h-[50px] lw-w-full lw-items-center lw-rounded lw-border lw-px-3\">\n <Truncate maxWidth={190} text={selectedOption.label} />\n </div>\n </div>\n ) : (\n <div\n ref={ref}\n className={cn('lw-relative lw-grow lw-text-text-primary', className)}\n data-testid=\"select\"\n >\n {selectLabel && (\n <span className=\"lw-text-base lw-font-bold\">{`${selectLabel}:`}</span>\n )}\n <div\n className=\"lw-flex lw-w-full lw-items-center lw-justify-between lw-rounded lw-border lw-stroke-text-primary lw-px-3 lw-py-2 focus:lw-outline-primary\"\n role=\"button\"\n tabIndex={0}\n onClick={() => setOpen(!open)}\n onKeyDown={(e: React.KeyboardEvent) => {\n if (e.key === 'Enter') {\n setOpen(!open);\n }\n }}\n >\n <Truncate maxWidth={190} text={selectedOption.label} />\n <ChevronDown\n className={classnames(\n 'lw-transition lw-duration-200 lw-ease-linear',\n {\n 'lw-rotate-180': open,\n }\n )}\n />\n </div>\n {open && (\n <ul\n className={cn(\n 'lw-absolute lw-z-[100] lw-mx-0 lw-mt-2 lw-w-full lw-list-none lw-appearance-none lw-overflow-y-auto lw-overflow-x-hidden lw-bg-bg-secondary lw-p-4',\n !isDark && 'lw-shadow-lg',\n !maxHeight && 'lw-max-h-60'\n )}\n data-testid=\"select-options\"\n style={{ maxHeight }}\n >\n {withSearch && (\n <li>\n <SearchInput\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n placeholder={searchPlaceholder}\n value={searchValue}\n onChange={handleSearch}\n />\n </li>\n )}\n {options\n .filter((option) =>\n option.label.toLowerCase().includes(searchValue.toLowerCase())\n )\n .map((option, index, array) => (\n <li\n key={option.id}\n className=\"lw-mb-0 lw-font-sans\"\n value={option.id}\n >\n <button\n className={classnames(\n 'lw-w-full lw-cursor-pointer lw-text-left lw-text-sm focus:lw-outline-none',\n {\n 'lw-mb-4': array.length - 1 !== index,\n 'lw-text-primary': active === option.id,\n }\n )}\n type=\"button\"\n onBlur={() => setActive('')}\n onClick={() => {\n setSelectedOption(option);\n setOpen(false);\n }}\n onFocus={() => setActive(option.id)}\n onMouseOut={() => setActive('')}\n onMouseOver={() => setActive(option.id)}\n >\n <span\n className={classnames({\n 'lw-font-bold': option.id === selectedOption.id,\n })}\n >\n {option.label}\n </span>\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n </>\n );\n};\n\nexport { Select };\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,iBAAiB,QAAQ,aAAa;AAE/C,SAASC,WAAW,QAAQ,cAAc;AAC1C,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,EAAE,QAAQ,gBAAgB;AACnC,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,QAAQ,QAAQ,aAAa;AAGtC,MAAMC,MAAM,GAAGC,IAAA,IAQI;EAAA,IARH;IACdC,iBAAiB;IACjBC,WAAW;IACXC,OAAO;IACPC,cAAc;IACdC,iBAAiB;IACjBC,SAAS;IACTC;EACW,CAAC,GAAAP,IAAA;EACZ,MAAM;IAAEQ;EAAO,CAAC,GAAGb,iBAAiB,CAAC,CAAC;EACtC,MAAMc,GAAG,GAAGlB,MAAM,CAAC,IAAI,CAAC;EACxB,MAAM,CAACmB,IAAI,EAAEC,OAAO,CAAC,GAAGnB,QAAQ,CAAC,KAAK,CAAC;EACvC,MAAM,CAACoB,MAAM,EAAEC,SAAS,CAAC,GAAGrB,QAAQ,CAAC,EAAE,CAAC;EACxC,MAAM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EM,MAAM,CAACM,EAAG;IACfvC,SAAS,EAAC,sBAAsB;IAChCe,KAAK,EAAEkB,MAAM,CAACM;EAAG,GAEjBxD,KAAA,CAAAiC,aAAA;IACEhB,SAAS,EAAElB,UAAU,CACnB,2EAA2E,EAC3E;MACE,SAAS,EAAEwD,KAAK,CAAC3B,MAAM,GAAG,CAAC,KAAK0B,KAAK;MACrC,iBAAiB,EAAE/B,MAAM,KAAK2B,MAAM,CAACM;IACvC,CACF,CAAE;IACFC,IAAI,EAAC,QAAQ;IACbC,MAAM,EAAEA,CAAA,KAAMlC,SAAS,CAAC,EAAE,CAAE;IAC5BiB,OAAO,EAAEA,CAAA,KAAM;MACbzB,iBAAiB,CAACkC,MAAM,CAAC;MACzB5B,OAAO,CAAC,KAAK,CAAC;IAChB,CAAE;IACFqC,OAAO,EAAEA,CAAA,KAAMnC,SAAS,CAAC0B,MAAM,CAACM,EAAE,CAAE;IACpCI,UAAU,EAAEA,CAAA,KAAMpC,SAAS,CAAC,EAAE,CAAE;IAChCqC,WAAW,EAAEA,CAAA,KAAMrC,SAAS,CAAC0B,MAAM,CAACM,EAAE;EAAE,GAExCxD,KAAA,CAAAiC,aAAA;IACEhB,SAAS,EAAElB,UAAU,CAAC;MACpB,cAAc,EAAEmD,MAAM,CAACM,EAAE,KAAKzC,cAAc,CAACyC;IAC/C,CAAC;EAAE,GAEFN,MAAM,CAACZ,KACJ,CACA,CACN,CACL,CACD,CAEH,CAEP,CAAC;AAEP,CAAC;AAED,SAAS5B,MAAM","ignoreList":[]}
@@ -13,8 +13,8 @@ export const Sentiment = _ref => {
13
13
  withError = true,
14
14
  isLoading
15
15
  } = _ref;
16
- const short = Math.round(sentiment?.shortPercent || 0);
17
- const long = Math.round(sentiment?.longPercent || 0);
16
+ const short = Math.round((sentiment === null || sentiment === void 0 ? void 0 : sentiment.shortPercent) || 0);
17
+ const long = Math.round((sentiment === null || sentiment === void 0 ? void 0 : sentiment.longPercent) || 0);
18
18
  const sentimentHeight = height || SentimentHeight.sm;
19
19
  const hasData = sentimentHasData(sentiment);
20
20
  return React.createElement("div", {
@@ -26,27 +26,27 @@ export const Sentiment = _ref => {
26
26
  'lw-w-5': compactMode,
27
27
  'lw-w-8': !compactMode
28
28
  })
29
- }, `${short}%`), React.createElement("div", {
29
+ }, "".concat(short, "%")), React.createElement("div", {
30
30
  className: "lw-mx-2 lw-my-0 lw-grow lw-p-px"
31
31
  }, React.createElement("div", {
32
- className: `lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ${sentimentHeight}`,
32
+ className: "lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ".concat(sentimentHeight),
33
33
  "data-testid": "sentiment"
34
34
  }, React.createElement("div", {
35
35
  className: "lw-bg-danger",
36
36
  style: {
37
- width: `${short}%`
37
+ width: "".concat(short, "%")
38
38
  }
39
39
  }), React.createElement("div", {
40
40
  className: "lw-bg-ok",
41
41
  style: {
42
- width: `${long}%`
42
+ width: "".concat(long, "%")
43
43
  }
44
44
  }))), React.createElement("span", {
45
45
  className: classnames('lw-text-right lw-font-sans lw-font-normal lw-tracking-wide', {
46
46
  'lw-w-5': compactMode,
47
47
  'lw-w-8': !compactMode
48
48
  })
49
- }, `${long}%`)), withError && !isLoading && !hasData && React.createElement(SentimentError, {
49
+ }, "".concat(long, "%"))), withError && !isLoading && !hasData && React.createElement(SentimentError, {
50
50
  compactMode: compactMode,
51
51
  height: sentimentHeight
52
52
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"Sentiment.js","names":["classnames","React","SentimentError","SentimentLoader","SentimentHeight","sentimentHasData","Sentiment","_ref","height","sentiment","compactMode","withLoader","withError","isLoading","short","Math","round","shortPercent","long","longPercent","sentimentHeight","sm","hasData","createElement","className","Fragment","style","width"],"sources":["../../../../src/components/Sentiment/Sentiment.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport { SentimentError } from './SentimentError';\nimport { SentimentLoader } from './SentimentLoader';\nimport type { SentimentProps } from './types';\nimport { SentimentHeight } from './types';\nimport { sentimentHasData } from './utils';\n\nexport const Sentiment = ({\n height,\n sentiment,\n compactMode = false,\n withLoader = true,\n withError = true,\n isLoading,\n}: SentimentProps) => {\n const short = Math.round(sentiment?.shortPercent || 0);\n const long = Math.round(sentiment?.longPercent || 0);\n\n const sentimentHeight = height || SentimentHeight.sm;\n\n const hasData = sentimentHasData(sentiment);\n\n return (\n <div className=\"lw-flex lw-w-full lw-flex-row lw-items-center\">\n {withLoader && isLoading && <SentimentLoader height={sentimentHeight} />}\n {!isLoading && hasData && (\n <>\n <span\n className={classnames(\n 'lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {`${short}%`}\n </span>\n <div className=\"lw-mx-2 lw-my-0 lw-grow lw-p-px\">\n <div\n className={`lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ${sentimentHeight}`}\n data-testid=\"sentiment\"\n >\n <div className=\"lw-bg-danger\" style={{ width: `${short}%` }} />\n <div className=\"lw-bg-ok\" style={{ width: `${long}%` }} />\n </div>\n </div>\n <span\n className={classnames(\n 'lw-text-right lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {`${long}%`}\n </span>\n </>\n )}\n {withError && !isLoading && !hasData && (\n <SentimentError compactMode={compactMode} height={sentimentHeight} />\n )}\n </div>\n );\n};\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,eAAe,QAAQ,SAAS;AACzC,SAASC,gBAAgB,QAAQ,SAAS;AAE1C,OAAO,MAAMC,SAAS,GAAGC,IAAA,IAOH;EAAA,IAPI;IACxBC,M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AAE,CACtD,CACF,CAAC,EACNjB,KAAA,CAAAsB,aAAA;IACEC,SAAS,EAAExB,UAAU,CACnB,4DAA4D,EAC5D;MACE,QAAQ,EAAEU,WAAW;MACrB,QAAQ,EAAE,CAACA;IACb,CACF;EAAE,GAED,GAAGQ,IAAI,GACJ,CACN,CACH,EACAN,SAAS,IAAI,CAACC,SAAS,IAAI,CAACS,OAAO,IAClCrB,KAAA,CAAAsB,aAAA,CAACrB,cAAc;IAACQ,WAAW,EAAEA,WAAY;IAACF,MAAM,EAAEY;EAAgB,CAAE,CAEnE,CAAC;AAEV,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Sentiment.js","names":["classnames","React","SentimentError","SentimentLoader","SentimentHeight","sentimentHasData","Sentiment","_ref","height","sentiment","compactMode","withLoader","withError","isLoading","short","Math","round","shortPercent","long","longPercent","sentimentHeight","sm","hasData","createElement","className","Fragment","concat","style","width"],"sources":["../../../../src/components/Sentiment/Sentiment.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport { SentimentError } from './SentimentError';\nimport { SentimentLoader } from './SentimentLoader';\nimport type { SentimentProps } from './types';\nimport { SentimentHeight } from './types';\nimport { sentimentHasData } from './utils';\n\nexport const Sentiment = ({\n height,\n sentiment,\n compactMode = false,\n withLoader = true,\n withError = true,\n isLoading,\n}: SentimentProps) => {\n const short = Math.round(sentiment?.shortPercent || 0);\n const long = Math.round(sentiment?.longPercent || 0);\n\n const sentimentHeight = height || SentimentHeight.sm;\n\n const hasData = sentimentHasData(sentiment);\n\n return (\n <div className=\"lw-flex lw-w-full lw-flex-row lw-items-center\">\n {withLoader && isLoading && <SentimentLoader height={sentimentHeight} />}\n {!isLoading && hasData && (\n <>\n <span\n className={classnames(\n 'lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {`${short}%`}\n </span>\n <div className=\"lw-mx-2 lw-my-0 lw-grow lw-p-px\">\n <div\n className={`lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ${sentimentHeight}`}\n data-testid=\"sentiment\"\n >\n <div className=\"lw-bg-danger\" style={{ width: `${short}%` }} />\n <div className=\"lw-bg-ok\" style={{ width: `${long}%` }} />\n </div>\n </div>\n <span\n className={classnames(\n 'lw-text-right lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {`${long}%`}\n </span>\n </>\n )}\n {withError && !isLoading && !hasData && (\n <SentimentError compactMode={compactMode} height={sentimentHeight} />\n )}\n </div>\n );\n};\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,eAAe,QAAQ,SAAS;AACzC,SAASC,gBAAgB,QAAQ,SAAS;AAE1C,OAAO,MAAMC,SAAS,GAAGC,IAAA,IAOH;EAAA,IAPI;IACxBC,MAAM;IACNC,SAAS;IACTC,WAAW,GAAG,KAAK;IACnBC,UAAU,GAAG,IAAI;IACjBC,SAAS,GAAG,IAAI;IAChBC;EACc,CAAC,GAAAN,IAAA;EACf,MAAMO,KAAK,GAAGC,IAAI,CAACC,KAAK,CAAC,CAAAP,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEQ,YAAY,KAAI,CAAC,CAAC;EACtD,MAAMC,IAAI,GAAGH,IAAI,CAACC,KAAK,CAAC,CAAAP,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEU,WAAW,KAAI,CAAC,CAAC;EAEpD,MAAMC,eAAe,GAAGZ,MAAM,IAAIJ,eAAe,CAACiB,EAAE;EAEpD,MAAMC,OAAO,GAAGjB,gBAAgB,CAACI,SAAS,CAAC;EAE3C,OACER,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAA+C,GAC3Db,UAAU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
14
  className: "lw-mx-2 lw-mt-1 lw-grow lw-p-px"
15
15
  }, React.createElement("div", {
16
- className: `lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ${height}`,
16
+ className: "lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ".concat(height),
17
17
  "data-testid": "no-data-sentiment"
18
18
  }, React.createElement("div", {
19
19
  className: "lw-w-full lw-bg-border-primary"
@@ -1 +1 @@
1
- {"version":3,"file":"SentimentError.js","names":["classnames","React","SentimentError","_ref","height","compactMode","createElement","Fragment","className"],"sources":["../../../../src/components/Sentiment/SentimentError.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport type { SentimentErrorProps } from './types';\n\nconst SentimentError = ({ height, compactMode }: SentimentErrorProps) => (\n <>\n <span\n className={classnames(\n 'lw-text-center lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {'\\u2014'}\n </span>\n <div className=\"lw-mx-2 lw-mt-1 lw-grow lw-p-px\">\n <div\n className={`lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ${height}`}\n data-testid=\"no-data-sentiment\"\n >\n <div className=\"lw-w-full lw-bg-border-primary\" />\n </div>\n </div>\n <span\n className={classnames(\n 'lw-text-center lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {'\\u2014'}\n </span>\n </>\n);\n\nexport { SentimentError };\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAIzB,MAAMC,cAAc,GAAGC,IAAA;EAAA,IAAC;IAAEC,MAAM;IAAEC;EAAiC,CAAC,GAAAF,IAAA;EAAA,OAClEF,KAAA,CAAAK,aAAA,CAAAL,KAAA,CAAAM,QAAA,QACEN,KAAA,CAAAK,aAAA;IACEE,SAAS,EAAER,UAAU,CACnB,6DAA6D,EAC7D;MACE,QAAQ,EAAEK,WAAW;MACrB,QAAQ,EAAE,CAACA;IACb,CACF;EAAE,GAED,QACG,CAAC,EACPJ,KAAA,CAAAK,aAAA;IAAKE,SAAS,EAAC;EAAiC,GAC9CP,KAAA,CAAAK,aAAA;IACEE,SAAS,EAAE,8EAA8EJ,MAAM,EAAG;IAClG,eAAY;EAAmB,GAE/BH,KAAA,CAAAK,aAAA;IAAKE,SAAS,EAAC;EAAgC,CAAE,CAC9C,CACF,CAAC,EACNP,KAAA,CAAAK,aAAA;IACEE,SAAS,EAAER,UAAU,CACnB,6DAA6D,EAC7D;MACE,QAAQ,EAAEK,WAAW;MACrB,QAAQ,EAAE,CAACA;IACb,CACF;EAAE,GAED,QACG,CACN,CAAC;AAAA,CACJ;AAED,SAASH,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"SentimentError.js","names":["classnames","React","SentimentError","_ref","height","compactMode","createElement","Fragment","className","concat"],"sources":["../../../../src/components/Sentiment/SentimentError.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport type { SentimentErrorProps } from './types';\n\nconst SentimentError = ({ height, compactMode }: SentimentErrorProps) => (\n <>\n <span\n className={classnames(\n 'lw-text-center lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {'\\u2014'}\n </span>\n <div className=\"lw-mx-2 lw-mt-1 lw-grow lw-p-px\">\n <div\n className={`lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ${height}`}\n data-testid=\"no-data-sentiment\"\n >\n <div className=\"lw-w-full lw-bg-border-primary\" />\n </div>\n </div>\n <span\n className={classnames(\n 'lw-text-center lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {'\\u2014'}\n </span>\n </>\n);\n\nexport { SentimentError };\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAIzB,MAAMC,cAAc,GAAGC,IAAA;EAAA,IAAC;IAAEC,MAAM;IAAEC;EAAiC,CAAC,GAAAF,IAAA;EAAA,OAClEF,KAAA,CAAAK,aAAA,CAAAL,KAAA,CAAAM,QAAA,QACEN,KAAA,CAAAK,aAAA;IACEE,SAAS,EAAER,UAAU,CACnB,6DAA6D,EAC7D;MACE,QAAQ,EAAEK,WAAW;MACrB,QAAQ,EAAE,CAACA;IACb,CACF;EAAE,GAED,QACG,CAAC,EACPJ,KAAA,CAAAK,aAAA;IAAKE,SAAS,EAAC;EAAiC,GAC9CP,KAAA,CAAAK,aAAA;IACEE,SAAS,gFAAAC,MAAA,CAAgFL,MAAM,CAAG;IAClG,eAAY;EAAmB,GAE/BH,KAAA,CAAAK,aAAA;IAAKE,SAAS,EAAC;EAAgC,CAAE,CAC9C,CACF,CAAC,EACNP,KAAA,CAAAK,aAAA;IACEE,SAAS,EAAER,UAAU,CACnB,6DAA6D,EAC7D;MACE,QAAQ,EAAEK,WAAW;MACrB,QAAQ,EAAE,CAACA;IACb,CACF;EAAE,GAED,QACG,CACN,CAAC;AAAA,CACJ;AAED,SAASH,cAAc","ignoreList":[]}
@@ -7,7 +7,7 @@ const SentimentLoader = _ref => {
7
7
  return React.createElement(React.Fragment, null, React.createElement(Loader, {
8
8
  size: LoaderSize.md
9
9
  }), React.createElement("div", {
10
- className: `${height} lw-mx-2 lw-w-full`
10
+ className: "".concat(height, " lw-mx-2 lw-w-full")
11
11
  }, React.createElement(Loader, {
12
12
  size: LoaderSize.full
13
13
  })), React.createElement(Loader, {
@@ -1 +1 @@
1
- {"version":3,"file":"SentimentLoader.js","names":["React","Loader","LoaderSize","SentimentLoader","_ref","height","createElement","Fragment","size","md","className","full"],"sources":["../../../../src/components/Sentiment/SentimentLoader.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Loader, LoaderSize } from '../Loader';\nimport type { SentimentLoaderProps } from './types';\n\nconst SentimentLoader = ({ height }: SentimentLoaderProps) => (\n <>\n <Loader size={LoaderSize.md} />\n <div className={`${height} lw-mx-2 lw-w-full`}>\n <Loader size={LoaderSize.full} />\n </div>\n <Loader size={LoaderSize.md} />\n </>\n);\n\nexport { SentimentLoader };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,MAAM,EAAEC,UAAU,QAAQ,WAAW;AAG9C,MAAMC,eAAe,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAA6B,CAAC,GAAAD,IAAA;EAAA,OACvDJ,KAAA,CAAAM,aAAA,CAAAN,KAAA,CAAAO,QAAA,QACEP,KAAA,CAAAM,aAAA,CAACL,MAAM;IAACO,IAAI,EAAEN,UAAU,CAACO;EAAG,CAAE,CAAC,EAC/BT,KAAA,CAAAM,aAAA;IAAKI,SAAS,EAAE,GAAGL,MAAM;EAAqB,GAC5CL,KAAA,CAAAM,aAAA,CAACL,MAAM;IAACO,IAAI,EAAEN,UAAU,CAACS;EAAK,CAAE,CAC7B,CAAC,EACNX,KAAA,CAAAM,aAAA,CAACL,MAAM;IAACO,IAAI,EAAEN,UAAU,CAACO;EAAG,CAAE,CAC9B,CAAC;AAAA,CACJ;AAED,SAASN,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"SentimentLoader.js","names":["React","Loader","LoaderSize","SentimentLoader","_ref","height","createElement","Fragment","size","md","className","concat","full"],"sources":["../../../../src/components/Sentiment/SentimentLoader.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Loader, LoaderSize } from '../Loader';\nimport type { SentimentLoaderProps } from './types';\n\nconst SentimentLoader = ({ height }: SentimentLoaderProps) => (\n <>\n <Loader size={LoaderSize.md} />\n <div className={`${height} lw-mx-2 lw-w-full`}>\n <Loader size={LoaderSize.full} />\n </div>\n <Loader size={LoaderSize.md} />\n </>\n);\n\nexport { SentimentLoader };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,MAAM,EAAEC,UAAU,QAAQ,WAAW;AAG9C,MAAMC,eAAe,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAA6B,CAAC,GAAAD,IAAA;EAAA,OACvDJ,KAAA,CAAAM,aAAA,CAAAN,KAAA,CAAAO,QAAA,QACEP,KAAA,CAAAM,aAAA,CAACL,MAAM;IAACO,IAAI,EAAEN,UAAU,CAACO;EAAG,CAAE,CAAC,EAC/BT,KAAA,CAAAM,aAAA;IAAKI,SAAS,KAAAC,MAAA,CAAKN,MAAM;EAAqB,GAC5CL,KAAA,CAAAM,aAAA,CAACL,MAAM;IAACO,IAAI,EAAEN,UAAU,CAACU;EAAK,CAAE,CAC7B,CAAC,EACNZ,KAAA,CAAAM,aAAA,CAACL,MAAM;IAACO,IAAI,EAAEN,UAAU,CAACO;EAAG,CAAE,CAC9B,CAAC;AAAA,CACJ;AAED,SAASN,eAAe","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  const sentimentHasData = sentiment => {
2
- const longPercent = sentiment?.longPercent !== undefined;
3
- const shortPercent = sentiment?.shortPercent !== undefined;
4
- const noData = sentiment?.shortPercent === 0 && sentiment?.longPercent === 0;
2
+ const longPercent = (sentiment === null || sentiment === void 0 ? void 0 : sentiment.longPercent) !== undefined;
3
+ const shortPercent = (sentiment === null || sentiment === void 0 ? void 0 : sentiment.shortPercent) !== undefined;
4
+ const noData = (sentiment === null || sentiment === void 0 ? void 0 : sentiment.shortPercent) === 0 && (sentiment === null || sentiment === void 0 ? void 0 : sentiment.longPercent) === 0;
5
5
  return longPercent && shortPercent && !noData;
6
6
  };
7
7
  export { sentimentHasData };
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["sentimentHasData","sentiment","longPercent","undefined","shortPercent","noData"],"sources":["../../../../src/components/Sentiment/utils.ts"],"sourcesContent":["import type { SentimentPercentage } from './types';\n\nconst sentimentHasData = (sentiment: SentimentPercentage | undefined) => {\n const longPercent = sentiment?.longPercent !== undefined;\n const shortPercent = sentiment?.shortPercent !== undefined;\n const noData = sentiment?.shortPercent === 0 && sentiment?.longPercent === 0;\n\n return longPercent && shortPercent && !noData;\n};\n\nexport { sentimentHasData };\n"],"mappings":"AAEA,MAAMA,gBAAgB,GAAIC,SAA0C,IAAK;EACvE,MAAMC,WAAW,GAAGD,SAAS,EAAEC,WAAW,KAAKC,SAAS;EACxD,MAAMC,YAAY,GAAGH,SAAS,EAAEG,YAAY,KAAKD,SAAS;EAC1D,MAAME,MAAM,GAAGJ,SAAS,EAAEG,YAAY,KAAK,CAAC,IAAIH,SAAS,EAAEC,WAAW,KAAK,CAAC;EAE5E,OAAOA,WAAW,IAAIE,YAAY,IAAI,CAACC,MAAM;AAC/C,CAAC;AAED,SAASL,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"utils.js","names":["sentimentHasData","sentiment","longPercent","undefined","shortPercent","noData"],"sources":["../../../../src/components/Sentiment/utils.ts"],"sourcesContent":["import type { SentimentPercentage } from './types';\n\nconst sentimentHasData = (sentiment: SentimentPercentage | undefined) => {\n const longPercent = sentiment?.longPercent !== undefined;\n const shortPercent = sentiment?.shortPercent !== undefined;\n const noData = sentiment?.shortPercent === 0 && sentiment?.longPercent === 0;\n\n return longPercent && shortPercent && !noData;\n};\n\nexport { sentimentHasData };\n"],"mappings":"AAEA,MAAMA,gBAAgB,GAAIC,SAA0C,IAAK;EACvE,MAAMC,WAAW,GAAG,CAAAD,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEC,WAAW,MAAKC,SAAS;EACxD,MAAMC,YAAY,GAAG,CAAAH,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEG,YAAY,MAAKD,SAAS;EAC1D,MAAME,MAAM,GAAG,CAAAJ,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEG,YAAY,MAAK,CAAC,IAAI,CAAAH,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEC,WAAW,MAAK,CAAC;EAE5E,OAAOA,WAAW,IAAIE,YAAY,IAAI,CAACC,MAAM;AAC/C,CAAC;AAED,SAASL,gBAAgB","ignoreList":[]}