@oanda/labs-widget-common 1.0.252 → 1.0.254
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +774 -62520
- package/dist/main/components/style.css +1 -1
- package/dist/module/chart/BaseChart.js +15 -7
- package/dist/module/chart/BaseChart.js.map +1 -1
- package/dist/module/chart/formatters.js +12 -3
- package/dist/module/chart/formatters.js.map +1 -1
- package/dist/module/chart/getGridLines.js +16 -9
- package/dist/module/chart/getGridLines.js.map +1 -1
- package/dist/module/chart/getTheme.js +38 -31
- package/dist/module/chart/getTheme.js.map +1 -1
- package/dist/module/chart/getZoomControls.js +12 -5
- package/dist/module/chart/getZoomControls.js.map +1 -1
- package/dist/module/chart/index.js +82 -7
- package/dist/module/chart/index.js.map +1 -1
- package/dist/module/chart/sharedOptions.js +11 -4
- package/dist/module/chart/sharedOptions.js.map +1 -1
- package/dist/module/chart/types.js +5 -1
- package/dist/module/components/Button/Button.js +18 -11
- package/dist/module/components/Button/Button.js.map +1 -1
- package/dist/module/components/Button/index.js +27 -2
- package/dist/module/components/Button/index.js.map +1 -1
- package/dist/module/components/Button/types.js +8 -2
- package/dist/module/components/Button/types.js.map +1 -1
- package/dist/module/components/Card/Card.js +24 -16
- package/dist/module/components/Card/Card.js.map +1 -1
- package/dist/module/components/Card/CardHeader.js +21 -14
- package/dist/module/components/Card/CardHeader.js.map +1 -1
- package/dist/module/components/Card/index.js +38 -3
- package/dist/module/components/Card/index.js.map +1 -1
- package/dist/module/components/Card/rows/DailyChangeCardRow.js +15 -7
- package/dist/module/components/Card/rows/DailyChangeCardRow.js.map +1 -1
- package/dist/module/components/Card/rows/LineChartCardRow.js +17 -10
- package/dist/module/components/Card/rows/LineChartCardRow.js.map +1 -1
- package/dist/module/components/Card/rows/PriceCardRow.js +16 -8
- package/dist/module/components/Card/rows/PriceCardRow.js.map +1 -1
- package/dist/module/components/Card/rows/SentimentCardRow.js +18 -10
- package/dist/module/components/Card/rows/SentimentCardRow.js.map +1 -1
- package/dist/module/components/Card/rows/SpreadCardRow.js +15 -7
- package/dist/module/components/Card/rows/SpreadCardRow.js.map +1 -1
- package/dist/module/components/Card/rows/index.js +60 -5
- package/dist/module/components/Card/rows/index.js.map +1 -1
- package/dist/module/components/Card/types.js +5 -1
- package/dist/module/components/Disclaimer/Disclaimer.js +32 -24
- package/dist/module/components/Disclaimer/Disclaimer.js.map +1 -1
- package/dist/module/components/Disclaimer/index.js +16 -1
- package/dist/module/components/Disclaimer/index.js.map +1 -1
- package/dist/module/components/Error/Error.js +27 -18
- package/dist/module/components/Error/Error.js.map +1 -1
- package/dist/module/components/Error/index.js +16 -1
- package/dist/module/components/Error/index.js.map +1 -1
- package/dist/module/components/InfoBox/InfoBox.js +10 -3
- package/dist/module/components/InfoBox/InfoBox.js.map +1 -1
- package/dist/module/components/InfoBox/index.js +27 -2
- package/dist/module/components/InfoBox/index.js.map +1 -1
- package/dist/module/components/InfoBox/types.js +5 -1
- package/dist/module/components/Input/NumberInput.js +21 -13
- package/dist/module/components/Input/NumberInput.js.map +1 -1
- package/dist/module/components/Input/index.js +38 -3
- package/dist/module/components/Input/index.js.map +1 -1
- package/dist/module/components/Input/types.js +5 -1
- package/dist/module/components/Input/useNumberFormat.js +11 -4
- package/dist/module/components/Input/useNumberFormat.js.map +1 -1
- package/dist/module/components/InstrumentRate/InstrumentRate.js +37 -30
- package/dist/module/components/InstrumentRate/InstrumentRate.js.map +1 -1
- package/dist/module/components/InstrumentRate/InstrumentRateWithChart.js +19 -13
- package/dist/module/components/InstrumentRate/InstrumentRateWithChart.js.map +1 -1
- package/dist/module/components/InstrumentRate/index.js +38 -3
- package/dist/module/components/InstrumentRate/index.js.map +1 -1
- package/dist/module/components/InstrumentRate/types.js +5 -1
- package/dist/module/components/InstrumentRate/utils.js +13 -6
- package/dist/module/components/InstrumentRate/utils.js.map +1 -1
- package/dist/module/components/Label/Label.js +12 -6
- package/dist/module/components/Label/Label.js.map +1 -1
- package/dist/module/components/Label/index.js +16 -1
- package/dist/module/components/Label/index.js.map +1 -1
- package/dist/module/components/LabelWrapper/LabelWrapper.js +24 -17
- package/dist/module/components/LabelWrapper/LabelWrapper.js.map +1 -1
- package/dist/module/components/LabelWrapper/index.js +27 -2
- package/dist/module/components/LabelWrapper/index.js.map +1 -1
- package/dist/module/components/LabelWrapper/types.js +7 -1
- package/dist/module/components/LabelWrapper/types.js.map +1 -1
- package/dist/module/components/LastUpdated/LastUpdated.js +13 -6
- package/dist/module/components/LastUpdated/LastUpdated.js.map +1 -1
- package/dist/module/components/LastUpdated/index.js +27 -2
- package/dist/module/components/LastUpdated/index.js.map +1 -1
- package/dist/module/components/LastUpdated/types.js +5 -1
- package/dist/module/components/LineChart/LineChart.js +18 -11
- package/dist/module/components/LineChart/LineChart.js.map +1 -1
- package/dist/module/components/LineChart/LineChartWithData.js +14 -8
- package/dist/module/components/LineChart/LineChartWithData.js.map +1 -1
- package/dist/module/components/LineChart/index.js +49 -4
- package/dist/module/components/LineChart/index.js.map +1 -1
- package/dist/module/components/LineChart/types.js +7 -1
- package/dist/module/components/LineChart/types.js.map +1 -1
- package/dist/module/components/LineChart/utils.js +16 -8
- package/dist/module/components/LineChart/utils.js.map +1 -1
- package/dist/module/components/Loader/Loader.js +18 -11
- package/dist/module/components/Loader/Loader.js.map +1 -1
- package/dist/module/components/Loader/index.js +27 -2
- package/dist/module/components/Loader/index.js.map +1 -1
- package/dist/module/components/Loader/types.js +7 -1
- package/dist/module/components/Loader/types.js.map +1 -1
- package/dist/module/components/Pagination/Pagination.js +40 -33
- package/dist/module/components/Pagination/Pagination.js.map +1 -1
- package/dist/module/components/Pagination/index.js +27 -2
- package/dist/module/components/Pagination/index.js.map +1 -1
- package/dist/module/components/Pagination/types.js +5 -1
- package/dist/module/components/Pagination/utils.js +8 -1
- package/dist/module/components/Pagination/utils.js.map +1 -1
- package/dist/module/components/Price/Price.js +23 -15
- package/dist/module/components/Price/Price.js.map +1 -1
- package/dist/module/components/Price/index.js +27 -2
- package/dist/module/components/Price/index.js.map +1 -1
- package/dist/module/components/Price/types.js +7 -1
- package/dist/module/components/Price/types.js.map +1 -1
- package/dist/module/components/SearchInput/SearchInput.js +12 -5
- package/dist/module/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/module/components/SearchInput/index.js +27 -2
- package/dist/module/components/SearchInput/index.js.map +1 -1
- package/dist/module/components/SearchInput/types.js +5 -1
- package/dist/module/components/Select/Select.js +44 -36
- package/dist/module/components/Select/Select.js.map +1 -1
- package/dist/module/components/Select/index.js +27 -2
- package/dist/module/components/Select/index.js.map +1 -1
- package/dist/module/components/Select/types.js +5 -1
- package/dist/module/components/Sentiment/Sentiment.js +28 -20
- package/dist/module/components/Sentiment/Sentiment.js.map +1 -1
- package/dist/module/components/Sentiment/SentimentError.js +17 -10
- package/dist/module/components/Sentiment/SentimentError.js.map +1 -1
- package/dist/module/components/Sentiment/SentimentLoader.js +17 -10
- package/dist/module/components/Sentiment/SentimentLoader.js.map +1 -1
- package/dist/module/components/Sentiment/index.js +38 -3
- package/dist/module/components/Sentiment/index.js.map +1 -1
- package/dist/module/components/Sentiment/types.js +7 -1
- package/dist/module/components/Sentiment/types.js.map +1 -1
- package/dist/module/components/Sentiment/utils.js +7 -1
- package/dist/module/components/Sentiment/utils.js.map +1 -1
- package/dist/module/components/Spinner/Spinner.js +18 -10
- package/dist/module/components/Spinner/Spinner.js.map +1 -1
- package/dist/module/components/Spinner/index.js +27 -2
- package/dist/module/components/Spinner/index.js.map +1 -1
- package/dist/module/components/Spinner/types.js +7 -1
- package/dist/module/components/Spinner/types.js.map +1 -1
- package/dist/module/components/Switch/Switch.js +26 -18
- package/dist/module/components/Switch/Switch.js.map +1 -1
- package/dist/module/components/Switch/SwitchItem.js +18 -10
- package/dist/module/components/Switch/SwitchItem.js.map +1 -1
- package/dist/module/components/Switch/constants.js +7 -1
- package/dist/module/components/Switch/constants.js.map +1 -1
- package/dist/module/components/Switch/index.js +16 -1
- package/dist/module/components/Switch/index.js.map +1 -1
- package/dist/module/components/Switch/types.js +5 -1
- package/dist/module/components/Table/Table.js +21 -14
- package/dist/module/components/Table/Table.js.map +1 -1
- package/dist/module/components/Table/TableCell.js +19 -12
- package/dist/module/components/Table/TableCell.js.map +1 -1
- package/dist/module/components/Table/TableHeader.js +20 -13
- package/dist/module/components/Table/TableHeader.js.map +1 -1
- package/dist/module/components/Table/TableRow.js +15 -8
- package/dist/module/components/Table/TableRow.js.map +1 -1
- package/dist/module/components/Table/columns/ChartColumn.js +20 -12
- package/dist/module/components/Table/columns/ChartColumn.js.map +1 -1
- package/dist/module/components/Table/columns/DailyChangeColumn.js +15 -7
- package/dist/module/components/Table/columns/DailyChangeColumn.js.map +1 -1
- package/dist/module/components/Table/columns/InstrumentColumn.js +19 -11
- package/dist/module/components/Table/columns/InstrumentColumn.js.map +1 -1
- package/dist/module/components/Table/columns/PriceColumn.js +16 -8
- package/dist/module/components/Table/columns/PriceColumn.js.map +1 -1
- package/dist/module/components/Table/columns/SentimentColumn.js +16 -8
- package/dist/module/components/Table/columns/SentimentColumn.js.map +1 -1
- package/dist/module/components/Table/columns/SpreadColumn.js +17 -9
- package/dist/module/components/Table/columns/SpreadColumn.js.map +1 -1
- package/dist/module/components/Table/columns/index.js +71 -6
- package/dist/module/components/Table/columns/index.js.map +1 -1
- package/dist/module/components/Table/index.js +60 -5
- package/dist/module/components/Table/index.js.map +1 -1
- package/dist/module/components/Table/types.js +5 -1
- package/dist/module/components/TableWidget/CardRecordRow.js +22 -14
- package/dist/module/components/TableWidget/CardRecordRow.js.map +1 -1
- package/dist/module/components/TableWidget/CardRenderer.js +20 -12
- package/dist/module/components/TableWidget/CardRenderer.js.map +1 -1
- package/dist/module/components/TableWidget/Cards.js +14 -6
- package/dist/module/components/TableWidget/Cards.js.map +1 -1
- package/dist/module/components/TableWidget/ColumnRenderer.js +42 -34
- package/dist/module/components/TableWidget/ColumnRenderer.js.map +1 -1
- package/dist/module/components/TableWidget/DataRecordRow.js +20 -12
- package/dist/module/components/TableWidget/DataRecordRow.js.map +1 -1
- package/dist/module/components/TableWidget/TableWidget.js +34 -26
- package/dist/module/components/TableWidget/TableWidget.js.map +1 -1
- package/dist/module/components/TableWidget/index.js +27 -2
- package/dist/module/components/TableWidget/index.js.map +1 -1
- package/dist/module/components/TableWidget/types.js +5 -1
- package/dist/module/components/TableWidget/utils.js +12 -4
- package/dist/module/components/TableWidget/utils.js.map +1 -1
- package/dist/module/components/Tabs/Tab.js +16 -10
- package/dist/module/components/Tabs/Tab.js.map +1 -1
- package/dist/module/components/Tabs/Tabs.js +11 -5
- package/dist/module/components/Tabs/Tabs.js.map +1 -1
- package/dist/module/components/Tabs/index.js +16 -1
- package/dist/module/components/Tabs/index.js.map +1 -1
- package/dist/module/components/Tabs/types.js +5 -1
- package/dist/module/components/TextInput/TextInput.js +17 -10
- package/dist/module/components/TextInput/TextInput.js.map +1 -1
- package/dist/module/components/TextInput/index.js +16 -1
- package/dist/module/components/TextInput/index.js.map +1 -1
- package/dist/module/components/TimeUnitSwitch/TimeUnitSelect.js +14 -7
- package/dist/module/components/TimeUnitSwitch/TimeUnitSelect.js.map +1 -1
- package/dist/module/components/TimeUnitSwitch/TimeUnitSwitch.js +22 -15
- package/dist/module/components/TimeUnitSwitch/TimeUnitSwitch.js.map +1 -1
- package/dist/module/components/TimeUnitSwitch/index.js +16 -1
- package/dist/module/components/TimeUnitSwitch/index.js.map +1 -1
- package/dist/module/components/TimeUnitSwitch/types.js +5 -1
- package/dist/module/components/Tooltip/Tooltip.js +11 -4
- package/dist/module/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/module/components/Tooltip/index.js +27 -2
- package/dist/module/components/Tooltip/index.js.map +1 -1
- package/dist/module/components/Tooltip/types.js +5 -1
- package/dist/module/components/Truncate/Truncate.js +18 -11
- package/dist/module/components/Truncate/Truncate.js.map +1 -1
- package/dist/module/components/Truncate/index.js +27 -2
- package/dist/module/components/Truncate/index.js.map +1 -1
- package/dist/module/components/Truncate/types.js +5 -1
- package/dist/module/components/WidgetWrapper/WidgetWrapper.js +14 -6
- package/dist/module/components/WidgetWrapper/WidgetWrapper.js.map +1 -1
- package/dist/module/components/WidgetWrapper/index.js +16 -1
- package/dist/module/components/WidgetWrapper/index.js.map +1 -1
- package/dist/module/components/constant.js +8 -2
- package/dist/module/components/constant.js.map +1 -1
- package/dist/module/components/index.js +292 -27
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/style.css +1 -1
- package/dist/module/constants/index.js +13 -7
- package/dist/module/constants/index.js.map +1 -1
- package/dist/module/fonts/index.js +27 -4
- package/dist/module/fonts/index.js.map +1 -1
- package/dist/module/hooks/index.js +71 -6
- package/dist/module/hooks/index.js.map +1 -1
- package/dist/module/hooks/useFetchCombinedDataRecords.js +14 -7
- package/dist/module/hooks/useFetchCombinedDataRecords.js.map +1 -1
- package/dist/module/hooks/useLiveRates.js +12 -5
- package/dist/module/hooks/useLiveRates.js.map +1 -1
- package/dist/module/hooks/useLiveRatesMessage.js +26 -19
- package/dist/module/hooks/useLiveRatesMessage.js.map +1 -1
- package/dist/module/hooks/useLiveRatesQuery.js +12 -5
- package/dist/module/hooks/useLiveRatesQuery.js.map +1 -1
- package/dist/module/hooks/useRecords.js +13 -7
- package/dist/module/hooks/useRecords.js.map +1 -1
- package/dist/module/hooks/useVisibleLiveDataRecord.js +16 -9
- package/dist/module/hooks/useVisibleLiveDataRecord.js.map +1 -1
- package/dist/module/images/index.js +111 -16
- package/dist/module/images/index.js.map +1 -1
- package/dist/module/index.js +126 -11
- package/dist/module/index.js.map +1 -1
- package/dist/module/providers/ConditionalProvider.js +11 -3
- package/dist/module/providers/ConditionalProvider.js.map +1 -1
- package/dist/module/providers/Layout/LayoutContext.js +12 -4
- package/dist/module/providers/Layout/LayoutContext.js.map +1 -1
- package/dist/module/providers/Layout/LayoutProvider.js +30 -22
- package/dist/module/providers/Layout/LayoutProvider.js.map +1 -1
- package/dist/module/providers/Layout/LayoutProvider.test.js +61 -58
- package/dist/module/providers/Layout/LayoutProvider.test.js.map +1 -1
- package/dist/module/providers/Layout/index.js +27 -2
- package/dist/module/providers/Layout/index.js.map +1 -1
- package/dist/module/providers/LiveRates/LiveRatesContext.js +11 -4
- package/dist/module/providers/LiveRates/LiveRatesContext.js.map +1 -1
- package/dist/module/providers/LiveRates/LiveRatesProvider.js +37 -29
- package/dist/module/providers/LiveRates/LiveRatesProvider.js.map +1 -1
- package/dist/module/providers/LiveRates/index.js +27 -2
- package/dist/module/providers/LiveRates/index.js.map +1 -1
- package/dist/module/providers/Widget/WidgetProvider.js +26 -18
- package/dist/module/providers/Widget/WidgetProvider.js.map +1 -1
- package/dist/module/providers/Widget/index.js +16 -1
- package/dist/module/providers/Widget/index.js.map +1 -1
- package/dist/module/providers/index.js +38 -3
- package/dist/module/providers/index.js.map +1 -1
- package/dist/module/tailwind/cn.js +11 -4
- package/dist/module/tailwind/cn.js.map +1 -1
- package/dist/module/tailwind/colors.js +9 -3
- package/dist/module/tailwind/colors.js.map +1 -1
- package/dist/module/tailwind/index.js +39 -3
- package/dist/module/tailwind/index.js.map +1 -1
- package/dist/module/tailwind/preset.js +11 -5
- package/dist/module/tailwind/preset.js.map +1 -1
- package/dist/module/tailwind/themes/background.js +14 -8
- package/dist/module/tailwind/themes/background.js.map +1 -1
- package/dist/module/tailwind/themes/border.js +10 -4
- package/dist/module/tailwind/themes/border.js.map +1 -1
- package/dist/module/tailwind/themes/index.js +12 -6
- package/dist/module/tailwind/themes/index.js.map +1 -1
- package/dist/module/tailwind/themes/text.js +18 -12
- package/dist/module/tailwind/themes/text.js.map +1 -1
- package/dist/module/tailwind/themes/themeColors.js +26 -20
- package/dist/module/tailwind/themes/themeColors.js.map +1 -1
- package/dist/module/tailwind/types.js +5 -1
- package/dist/module/tailwind/utils.js +8 -1
- package/dist/module/tailwind/utils.js.map +1 -1
- package/dist/module/testUtils/index.js +15 -7
- package/dist/module/testUtils/index.js.map +1 -1
- package/dist/module/translations/index.js +15 -8
- package/dist/module/translations/index.js.map +1 -1
- package/dist/module/translations/translations.js +7 -1
- package/dist/module/translations/translations.js.map +1 -1
- package/dist/module/types/dataTypes.js +7 -1
- package/dist/module/types/dataTypes.js.map +1 -1
- package/dist/module/types/index.js +36 -4
- package/dist/module/types/index.js.map +1 -1
- package/dist/module/types/liveRatesTypes.js +5 -1
- package/dist/module/utils/dateUtils.js +9 -1
- package/dist/module/utils/dateUtils.js.map +1 -1
- package/dist/module/utils/getLocale.js +20 -13
- package/dist/module/utils/getLocale.js.map +1 -1
- package/dist/module/utils/index.js +38 -3
- package/dist/module/utils/index.js.map +1 -1
- package/dist/module/utils/liveRates/buildUrl.js +8 -1
- package/dist/module/utils/liveRates/buildUrl.js.map +1 -1
- package/dist/module/utils/liveRates/calculatePipsChangeFromOpen.js +7 -1
- package/dist/module/utils/liveRates/calculatePipsChangeFromOpen.js.map +1 -1
- package/dist/module/utils/liveRates/calculatePriceChange.js +8 -1
- package/dist/module/utils/liveRates/calculatePriceChange.js.map +1 -1
- package/dist/module/utils/liveRates/calculatePriceChangeFromOpen.js +8 -1
- package/dist/module/utils/liveRates/calculatePriceChangeFromOpen.js.map +1 -1
- package/dist/module/utils/liveRates/calculateSpread.js +8 -1
- package/dist/module/utils/liveRates/calculateSpread.js.map +1 -1
- package/dist/module/utils/liveRates/decodeLiveRateMessage.js +9 -2
- package/dist/module/utils/liveRates/decodeLiveRateMessage.js.map +1 -1
- package/dist/module/utils/liveRates/decodeUtilities.js +18 -6
- package/dist/module/utils/liveRates/decodeUtilities.js.map +1 -1
- package/dist/module/utils/liveRates/index.js +82 -7
- package/dist/module/utils/liveRates/index.js.map +1 -1
- package/dist/module/utils/validateToolParams.js +7 -1
- package/dist/module/utils/validateToolParams.js.map +1 -1
- package/package.json +9 -4
- package/src/components/style.css +1 -1
- package/tsconfig.types.json +2 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background.js","names":["
|
|
1
|
+
{"version":3,"file":"background.js","names":["_colors","require","backgroundColors","exports","bgPrimary","light","colorPalette","white","dark","black","bgTransparent50","white50","black50","bgSecondary","bgOk","bottleGreenDark","bgDanger","orange"],"sources":["../../../../src/tailwind/themes/background.ts"],"sourcesContent":["import type { KeysOf } from '../../types';\nimport { colorPalette } from '../colors';\n\nexport const backgroundColors = {\n bgPrimary: {\n light: colorPalette.white,\n dark: colorPalette.black,\n },\n bgTransparent50: {\n light: colorPalette.white50,\n dark: colorPalette.black50,\n },\n bgSecondary: {\n light: '#F4F8FA',\n dark: '#1C1C1C',\n },\n bgOk: {\n light: '#70D2AF',\n dark: colorPalette.bottleGreenDark,\n },\n bgDanger: {\n light: '#FE4084',\n dark: colorPalette.orange,\n },\n} as const;\n\nexport type BackgroundColorKeys = KeysOf<typeof backgroundColors>;\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC9BE,SAAS,EAAE;IACTC,KAAK,EAAEC,oBAAY,CAACC,KAAK;IACzBC,IAAI,EAAEF,oBAAY,CAACG;EACrB,CAAC;EACDC,eAAe,EAAE;IACfL,KAAK,EAAEC,oBAAY,CAACK,OAAO;IAC3BH,IAAI,EAAEF,oBAAY,CAACM;EACrB,CAAC;EACDC,WAAW,EAAE;IACXR,KAAK,EAAE,SAAS;IAChBG,IAAI,EAAE;EACR,CAAC;EACDM,IAAI,EAAE;IACJT,KAAK,EAAE,SAAS;IAChBG,IAAI,EAAEF,oBAAY,CAACS;EACrB,CAAC;EACDC,QAAQ,EAAE;IACRX,KAAK,EAAE,SAAS;IAChBG,IAAI,EAAEF,oBAAY,CAACW;EACrB;AACF,CAAU","ignoreList":[]}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.borderColors = void 0;
|
|
7
|
+
var _colors = require("../colors");
|
|
8
|
+
const borderColors = exports.borderColors = {
|
|
3
9
|
borderPrimary: {
|
|
4
10
|
light: '#D7D9D8',
|
|
5
11
|
dark: '#333333'
|
|
@@ -9,8 +15,8 @@ export const borderColors = {
|
|
|
9
15
|
dark: '#9EA4AC'
|
|
10
16
|
},
|
|
11
17
|
borderDisabled: {
|
|
12
|
-
light: colorPalette.grayLight,
|
|
13
|
-
dark: colorPalette.grayLight
|
|
18
|
+
light: _colors.colorPalette.grayLight,
|
|
19
|
+
dark: _colors.colorPalette.grayLight
|
|
14
20
|
}
|
|
15
21
|
};
|
|
16
22
|
//# sourceMappingURL=border.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"border.js","names":["
|
|
1
|
+
{"version":3,"file":"border.js","names":["_colors","require","borderColors","exports","borderPrimary","light","dark","borderSecondary","borderDisabled","colorPalette","grayLight"],"sources":["../../../../src/tailwind/themes/border.ts"],"sourcesContent":["import type { KeysOf } from '../../types';\nimport { colorPalette } from '../colors';\n\nexport const borderColors = {\n borderPrimary: {\n light: '#D7D9D8',\n dark: '#333333',\n },\n borderSecondary: {\n light: '#F1F1F1',\n dark: '#9EA4AC',\n },\n borderDisabled: {\n light: colorPalette.grayLight,\n dark: colorPalette.grayLight,\n },\n} as const;\n\nexport type BorderColorsKeys = KeysOf<typeof borderColors>;\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1BE,aAAa,EAAE;IACbC,KAAK,EAAE,SAAS;IAChBC,IAAI,EAAE;EACR,CAAC;EACDC,eAAe,EAAE;IACfF,KAAK,EAAE,SAAS;IAChBC,IAAI,EAAE;EACR,CAAC;EACDE,cAAc,EAAE;IACdH,KAAK,EAAEI,oBAAY,CAACC,SAAS;IAC7BJ,IAAI,EAAEG,oBAAY,CAACC;EACrB;AACF,CAAU","ignoreList":[]}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.themes = void 0;
|
|
7
|
+
var _twColors = require("tw-colors");
|
|
8
|
+
var _types = require("../../types");
|
|
9
|
+
var _themeColors = require("./themeColors");
|
|
4
10
|
const extractColorTheme = (colors, property) => Object.keys(colors).reduce((acc, key) => {
|
|
5
11
|
const color = colors[key];
|
|
6
12
|
return Object.assign(acc, {
|
|
7
13
|
[key]: color[property]
|
|
8
14
|
});
|
|
9
15
|
}, {});
|
|
10
|
-
|
|
11
|
-
light: extractColorTheme(twTheme, Theme.Light),
|
|
12
|
-
dark: extractColorTheme(twTheme, Theme.Dark)
|
|
16
|
+
const themes = exports.themes = (0, _twColors.createThemes)({
|
|
17
|
+
light: extractColorTheme(_themeColors.twTheme, _types.Theme.Light),
|
|
18
|
+
dark: extractColorTheme(_themeColors.twTheme, _types.Theme.Dark)
|
|
13
19
|
}, {
|
|
14
20
|
defaultTheme: 'light'
|
|
15
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_twColors","require","_types","_themeColors","extractColorTheme","colors","property","Object","keys","reduce","acc","key","color","assign","themes","exports","createThemes","light","twTheme","Theme","Light","dark","Dark","defaultTheme"],"sources":["../../../../src/tailwind/themes/index.ts"],"sourcesContent":["import { createThemes } from 'tw-colors';\n\nimport { Theme } from '../../types';\nimport type { ThemeColor, ThemeColorKeys } from '../types';\nimport { twTheme } from './themeColors';\n\nconst extractColorTheme = (\n colors: Record<string, ThemeColor>,\n property: ThemeColorKeys\n) =>\n Object.keys(colors).reduce((acc, key) => {\n const color = colors[key];\n return Object.assign(acc, { [key]: color[property] });\n }, {});\n\nexport const themes = createThemes(\n {\n light: extractColorTheme(twTheme, Theme.Light),\n dark: extractColorTheme(twTheme, Theme.Dark),\n },\n {\n defaultTheme: 'light',\n }\n);\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AAEA,MAAMG,iBAAiB,GAAGA,CACxBC,MAAkC,EAClCC,QAAwB,KAExBC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,CAACI,MAAM,CAAC,CAACC,GAAG,EAAEC,GAAG,KAAK;EACvC,MAAMC,KAAK,GAAGP,MAAM,CAACM,GAAG,CAAC;EACzB,OAAOJ,MAAM,CAACM,MAAM,CAACH,GAAG,EAAE;IAAE,CAACC,GAAG,GAAGC,KAAK,CAACN,QAAQ;EAAE,CAAC,CAAC;AACvD,CAAC,EAAE,CAAC,CAAC,CAAC;AAED,MAAMQ,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG,IAAAE,sBAAY,EAChC;EACEC,KAAK,EAAEb,iBAAiB,CAACc,oBAAO,EAAEC,YAAK,CAACC,KAAK,CAAC;EAC9CC,IAAI,EAAEjB,iBAAiB,CAACc,oBAAO,EAAEC,YAAK,CAACG,IAAI;AAC7C,CAAC,EACD;EACEC,YAAY,EAAE;AAChB,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.textColors = void 0;
|
|
7
|
+
var _colors = require("../colors");
|
|
8
|
+
const textColors = exports.textColors = {
|
|
3
9
|
textPrimary: {
|
|
4
|
-
dark: colorPalette.white,
|
|
10
|
+
dark: _colors.colorPalette.white,
|
|
5
11
|
light: '#0B0B0B'
|
|
6
12
|
},
|
|
7
13
|
textSecondary: {
|
|
8
14
|
dark: '#FBFEFF',
|
|
9
|
-
light: colorPalette.navyBlue
|
|
15
|
+
light: _colors.colorPalette.navyBlue
|
|
10
16
|
},
|
|
11
17
|
textSecondary75: {
|
|
12
18
|
dark: 'rgba(251, 254, 255, 0.75)',
|
|
13
19
|
light: 'rgba(0, 33, 74, 0.75)'
|
|
14
20
|
},
|
|
15
21
|
textNegative: {
|
|
16
|
-
dark: colorPalette.black,
|
|
17
|
-
light: colorPalette.white
|
|
22
|
+
dark: _colors.colorPalette.black,
|
|
23
|
+
light: _colors.colorPalette.white
|
|
18
24
|
},
|
|
19
25
|
textOk: {
|
|
20
|
-
dark: colorPalette.greenLight,
|
|
21
|
-
light: colorPalette.bottleGreenDark120
|
|
26
|
+
dark: _colors.colorPalette.greenLight,
|
|
27
|
+
light: _colors.colorPalette.bottleGreenDark120
|
|
22
28
|
},
|
|
23
29
|
textDanger: {
|
|
24
|
-
dark: colorPalette.redLight,
|
|
25
|
-
light: colorPalette.redDark
|
|
30
|
+
dark: _colors.colorPalette.redLight,
|
|
31
|
+
light: _colors.colorPalette.redDark
|
|
26
32
|
},
|
|
27
33
|
textDisabled: {
|
|
28
|
-
dark: colorPalette.grayLight,
|
|
29
|
-
light: colorPalette.gray
|
|
34
|
+
dark: _colors.colorPalette.grayLight,
|
|
35
|
+
light: _colors.colorPalette.gray
|
|
30
36
|
}
|
|
31
37
|
};
|
|
32
38
|
//# sourceMappingURL=text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","names":["
|
|
1
|
+
{"version":3,"file":"text.js","names":["_colors","require","textColors","exports","textPrimary","dark","colorPalette","white","light","textSecondary","navyBlue","textSecondary75","textNegative","black","textOk","greenLight","bottleGreenDark120","textDanger","redLight","redDark","textDisabled","grayLight","gray"],"sources":["../../../../src/tailwind/themes/text.ts"],"sourcesContent":["import type { KeysOf } from '../../types';\nimport { colorPalette } from '../colors';\n\nexport const textColors = {\n textPrimary: {\n dark: colorPalette.white,\n light: '#0B0B0B',\n },\n textSecondary: {\n dark: '#FBFEFF',\n light: colorPalette.navyBlue,\n },\n textSecondary75: {\n dark: 'rgba(251, 254, 255, 0.75)',\n light: 'rgba(0, 33, 74, 0.75)',\n },\n textNegative: {\n dark: colorPalette.black,\n light: colorPalette.white,\n },\n textOk: {\n dark: colorPalette.greenLight,\n light: colorPalette.bottleGreenDark120,\n },\n textDanger: {\n dark: colorPalette.redLight,\n light: colorPalette.redDark,\n },\n textDisabled: {\n dark: colorPalette.grayLight,\n light: colorPalette.gray,\n },\n} as const;\n\nexport type TextColorsKeys = KeysOf<typeof textColors>;\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACxBE,WAAW,EAAE;IACXC,IAAI,EAAEC,oBAAY,CAACC,KAAK;IACxBC,KAAK,EAAE;EACT,CAAC;EACDC,aAAa,EAAE;IACbJ,IAAI,EAAE,SAAS;IACfG,KAAK,EAAEF,oBAAY,CAACI;EACtB,CAAC;EACDC,eAAe,EAAE;IACfN,IAAI,EAAE,2BAA2B;IACjCG,KAAK,EAAE;EACT,CAAC;EACDI,YAAY,EAAE;IACZP,IAAI,EAAEC,oBAAY,CAACO,KAAK;IACxBL,KAAK,EAAEF,oBAAY,CAACC;EACtB,CAAC;EACDO,MAAM,EAAE;IACNT,IAAI,EAAEC,oBAAY,CAACS,UAAU;IAC7BP,KAAK,EAAEF,oBAAY,CAACU;EACtB,CAAC;EACDC,UAAU,EAAE;IACVZ,IAAI,EAAEC,oBAAY,CAACY,QAAQ;IAC3BV,KAAK,EAAEF,oBAAY,CAACa;EACtB,CAAC;EACDC,YAAY,EAAE;IACZf,IAAI,EAAEC,oBAAY,CAACe,SAAS;IAC5Bb,KAAK,EAAEF,oBAAY,CAACgB;EACtB;AACF,CAAU","ignoreList":[]}
|
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.twTheme = exports.themeColors = void 0;
|
|
7
|
+
var _colors = require("../colors");
|
|
8
|
+
var _utils = require("../utils");
|
|
9
|
+
var _background = require("./background");
|
|
10
|
+
var _border = require("./border");
|
|
11
|
+
var _text = require("./text");
|
|
12
|
+
const themeColors = exports.themeColors = {
|
|
13
|
+
..._text.textColors,
|
|
14
|
+
..._background.backgroundColors,
|
|
15
|
+
..._border.borderColors,
|
|
10
16
|
primary: {
|
|
11
|
-
dark: colorPalette.orange,
|
|
12
|
-
light: colorPalette.bottleGreenDark
|
|
17
|
+
dark: _colors.colorPalette.orange,
|
|
18
|
+
light: _colors.colorPalette.bottleGreenDark
|
|
13
19
|
},
|
|
14
20
|
secondary: {
|
|
15
|
-
dark: colorPalette.orange,
|
|
16
|
-
light: colorPalette.navyBlue
|
|
21
|
+
dark: _colors.colorPalette.orange,
|
|
22
|
+
light: _colors.colorPalette.navyBlue
|
|
17
23
|
},
|
|
18
24
|
ok: {
|
|
19
|
-
dark: colorPalette.bottleGreenDark,
|
|
20
|
-
light: colorPalette.greenLight
|
|
25
|
+
dark: _colors.colorPalette.bottleGreenDark,
|
|
26
|
+
light: _colors.colorPalette.greenLight
|
|
21
27
|
},
|
|
22
28
|
danger: {
|
|
23
|
-
dark: colorPalette.orange,
|
|
24
|
-
light: colorPalette.raspberryLight
|
|
29
|
+
dark: _colors.colorPalette.orange,
|
|
30
|
+
light: _colors.colorPalette.raspberryLight
|
|
25
31
|
},
|
|
26
32
|
chart: {
|
|
27
|
-
dark: colorPalette.orange,
|
|
28
|
-
light: colorPalette.turquoiseLight
|
|
33
|
+
dark: _colors.colorPalette.orange,
|
|
34
|
+
light: _colors.colorPalette.turquoiseLight
|
|
29
35
|
}
|
|
30
36
|
};
|
|
31
|
-
|
|
37
|
+
const twTheme = exports.twTheme = (0, _utils.toTwConfigKeys)(themeColors);
|
|
32
38
|
//# sourceMappingURL=themeColors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeColors.js","names":["
|
|
1
|
+
{"version":3,"file":"themeColors.js","names":["_colors","require","_utils","_background","_border","_text","themeColors","exports","textColors","backgroundColors","borderColors","primary","dark","colorPalette","orange","light","bottleGreenDark","secondary","navyBlue","ok","greenLight","danger","raspberryLight","chart","turquoiseLight","twTheme","toTwConfigKeys"],"sources":["../../../../src/tailwind/themes/themeColors.ts"],"sourcesContent":["import { colorPalette } from '../colors';\nimport type { ThemeColor } from '../types';\nimport { toTwConfigKeys } from '../utils';\nimport { type BackgroundColorKeys, backgroundColors } from './background';\nimport { borderColors, type BorderColorsKeys } from './border';\nimport { textColors, type TextColorsKeys } from './text';\n\ntype ThemeKeys =\n | 'primary'\n | 'secondary'\n | 'ok'\n | 'danger'\n | 'chart'\n | BackgroundColorKeys\n | BorderColorsKeys\n | TextColorsKeys;\n\nexport const themeColors: Record<ThemeKeys, ThemeColor> = {\n ...textColors,\n ...backgroundColors,\n ...borderColors,\n primary: {\n dark: colorPalette.orange,\n light: colorPalette.bottleGreenDark,\n },\n secondary: {\n dark: colorPalette.orange,\n light: colorPalette.navyBlue,\n },\n ok: {\n dark: colorPalette.bottleGreenDark,\n light: colorPalette.greenLight,\n },\n danger: {\n dark: colorPalette.orange,\n light: colorPalette.raspberryLight,\n },\n chart: {\n dark: colorPalette.orange,\n light: colorPalette.turquoiseLight,\n },\n};\n\nexport const twTheme = toTwConfigKeys(themeColors);\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAYO,MAAMK,WAA0C,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACxD,GAAGE,gBAAU;EACb,GAAGC,4BAAgB;EACnB,GAAGC,oBAAY;EACfC,OAAO,EAAE;IACPC,IAAI,EAAEC,oBAAY,CAACC,MAAM;IACzBC,KAAK,EAAEF,oBAAY,CAACG;EACtB,CAAC;EACDC,SAAS,EAAE;IACTL,IAAI,EAAEC,oBAAY,CAACC,MAAM;IACzBC,KAAK,EAAEF,oBAAY,CAACK;EACtB,CAAC;EACDC,EAAE,EAAE;IACFP,IAAI,EAAEC,oBAAY,CAACG,eAAe;IAClCD,KAAK,EAAEF,oBAAY,CAACO;EACtB,CAAC;EACDC,MAAM,EAAE;IACNT,IAAI,EAAEC,oBAAY,CAACC,MAAM;IACzBC,KAAK,EAAEF,oBAAY,CAACS;EACtB,CAAC;EACDC,KAAK,EAAE;IACLX,IAAI,EAAEC,oBAAY,CAACC,MAAM;IACzBC,KAAK,EAAEF,oBAAY,CAACW;EACtB;AACF,CAAC;AAEM,MAAMC,OAAO,GAAAlB,OAAA,CAAAkB,OAAA,GAAG,IAAAC,qBAAc,EAACpB,WAAW,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.toTwConfigKeys = void 0;
|
|
7
|
+
const toTwConfigKeys = obj => Object.keys(obj).reduce((result, key) => {
|
|
2
8
|
const kebabKey = key.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/([0-9]+)/g, '-$1').toLowerCase();
|
|
3
9
|
return {
|
|
4
10
|
...result,
|
|
5
11
|
[kebabKey]: obj[key]
|
|
6
12
|
};
|
|
7
13
|
}, {});
|
|
14
|
+
exports.toTwConfigKeys = toTwConfigKeys;
|
|
8
15
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["toTwConfigKeys","obj","Object","keys","reduce","result","key","kebabKey","replace","toLowerCase"],"sources":["../../../src/tailwind/utils.ts"],"sourcesContent":["import type { ThemeColor } from './types';\n\ntype KebabCase<S extends string> = S extends `${infer Head}${infer Tail}`\n ? Tail extends Capitalize<Tail>\n ? `${Lowercase<Head>}-${KebabCase<Tail>}`\n : `${Head}${KebabCase<Tail>}`\n : S;\n\ntype KebabCaseKeys<T extends Record<string, string | ThemeColor>> = {\n [K in keyof T as KebabCase<K & string>]: T[K];\n};\n\nexport const toTwConfigKeys = <T extends Record<string, string | ThemeColor>>(\n obj: T\n): KebabCaseKeys<T> =>\n Object.keys(obj).reduce((result, key) => {\n const kebabKey = key\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .replace(/([0-9]+)/g, '-$1')\n .toLowerCase();\n return {\n ...result,\n [kebabKey]: obj[key],\n };\n }, {} as KebabCaseKeys<T>);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","names":["toTwConfigKeys","obj","Object","keys","reduce","result","key","kebabKey","replace","toLowerCase","exports"],"sources":["../../../src/tailwind/utils.ts"],"sourcesContent":["import type { ThemeColor } from './types';\n\ntype KebabCase<S extends string> = S extends `${infer Head}${infer Tail}`\n ? Tail extends Capitalize<Tail>\n ? `${Lowercase<Head>}-${KebabCase<Tail>}`\n : `${Head}${KebabCase<Tail>}`\n : S;\n\ntype KebabCaseKeys<T extends Record<string, string | ThemeColor>> = {\n [K in keyof T as KebabCase<K & string>]: T[K];\n};\n\nexport const toTwConfigKeys = <T extends Record<string, string | ThemeColor>>(\n obj: T\n): KebabCaseKeys<T> =>\n Object.keys(obj).reduce((result, key) => {\n const kebabKey = key\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .replace(/([0-9]+)/g, '-$1')\n .toLowerCase();\n return {\n ...result,\n [kebabKey]: obj[key],\n };\n }, {} as KebabCaseKeys<T>);\n"],"mappings":";;;;;;AAYO,MAAMA,cAAc,GACzBC,GAAM,IAENC,MAAM,CAACC,IAAI,CAACF,GAAG,CAAC,CAACG,MAAM,CAAC,CAACC,MAAM,EAAEC,GAAG,KAAK;EACvC,MAAMC,QAAQ,GAAGD,GAAG,CACjBE,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CACnCA,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAC3BC,WAAW,CAAC,CAAC;EAChB,OAAO;IACL,GAAGJ,MAAM;IACT,CAACE,QAAQ,GAAGN,GAAG,CAACK,GAAG;EACrB,CAAC;AACH,CAAC,EAAE,CAAC,CAAqB,CAAC;AAACI,OAAA,CAAAV,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MockLayoutProvider = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _providers = require("../providers");
|
|
9
|
+
var _types = require("../types");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const MockLayoutProvider = _ref => {
|
|
5
12
|
let {
|
|
6
13
|
children,
|
|
7
14
|
size,
|
|
8
15
|
isDark
|
|
9
16
|
} = _ref;
|
|
10
|
-
return
|
|
17
|
+
return _react.default.createElement(_providers.LayoutContext.Provider, {
|
|
11
18
|
value: {
|
|
12
|
-
size: size ?? Size.DESKTOP,
|
|
19
|
+
size: size ?? _types.Size.DESKTOP,
|
|
13
20
|
isDark: isDark ?? true,
|
|
14
|
-
theme: Theme.Dark
|
|
21
|
+
theme: _types.Theme.Dark
|
|
15
22
|
}
|
|
16
23
|
}, children);
|
|
17
24
|
};
|
|
25
|
+
exports.MockLayoutProvider = MockLayoutProvider;
|
|
18
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_providers","_types","e","__esModule","default","MockLayoutProvider","_ref","children","size","isDark","createElement","LayoutContext","Provider","value","Size","DESKTOP","theme","Theme","Dark","exports"],"sources":["../../../src/testUtils/index.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport type { LayoutContextValue } from '../providers';\nimport { LayoutContext } from '../providers';\nimport { Size, Theme } from '../types';\n\nexport const MockLayoutProvider: FC<\n PropsWithChildren & Partial<LayoutContextValue>\n> = ({ children, size, isDark }) => (\n <LayoutContext.Provider\n value={{\n size: size ?? Size.DESKTOP,\n isDark: isDark ?? true,\n theme: Theme.Dark,\n }}\n >\n {children}\n </LayoutContext.Provider>\n);\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAuC,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,kBAEZ,GAAGC,IAAA;EAAA,IAAC;IAAEC,QAAQ;IAAEC,IAAI;IAAEC;EAAO,CAAC,GAAAH,IAAA;EAAA,OAC7BT,MAAA,CAAAO,OAAA,CAAAM,aAAA,CAACV,UAAA,CAAAW,aAAa,CAACC,QAAQ;IACrBC,KAAK,EAAE;MACLL,IAAI,EAAEA,IAAI,IAAIM,WAAI,CAACC,OAAO;MAC1BN,MAAM,EAAEA,MAAM,IAAI,IAAI;MACtBO,KAAK,EAAEC,YAAK,CAACC;IACf;EAAE,GAEDX,QACqB,CAAC;AAAA,CAC1B;AAACY,OAAA,CAAAd,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.translations = void 0;
|
|
7
|
+
var _monoI18n = require("@oanda/mono-i18n");
|
|
8
|
+
var _en = _interopRequireDefault(require("./sources/en.json"));
|
|
9
|
+
var _zh_TW = _interopRequireDefault(require("./sources/zh_TW.json"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const translations = exports.translations = {
|
|
12
|
+
[_monoI18n.Locale.en]: {
|
|
13
|
+
translation: _en.default
|
|
7
14
|
},
|
|
8
|
-
[Locale.zhTW]: {
|
|
9
|
-
translation:
|
|
15
|
+
[_monoI18n.Locale.zhTW]: {
|
|
16
|
+
translation: _zh_TW.default
|
|
10
17
|
}
|
|
11
18
|
};
|
|
12
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_monoI18n","require","_en","_interopRequireDefault","_zh_TW","e","__esModule","default","translations","exports","Locale","en","translation","zhTW"],"sources":["../../../src/translations/index.ts"],"sourcesContent":["import type { Translations } from '@oanda/mono-i18n';\nimport { Locale } from '@oanda/mono-i18n';\n\nimport en from './sources/en.json';\nimport zhTW from './sources/zh_TW.json';\nimport type { defaultTranslations } from './translations';\n\nexport type TranslationKey = keyof typeof defaultTranslations;\n\nexport const translations: Translations = {\n [Locale.en]: { translation: en },\n [Locale.zhTW]: { translation: zhTW },\n};\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,GAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAwC,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKjC,MAAMG,YAA0B,GAAAC,OAAA,CAAAD,YAAA,GAAG;EACxC,CAACE,gBAAM,CAACC,EAAE,GAAG;IAAEC,WAAW,EAAED;EAAG,CAAC;EAChC,CAACD,gBAAM,CAACG,IAAI,GAAG;IAAED,WAAW,EAAEC;EAAK;AACrC,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultTranslations = void 0;
|
|
7
|
+
const defaultTranslations = exports.defaultTranslations = {
|
|
2
8
|
data_unavailable: 'Data unavailable',
|
|
3
9
|
pagination_entries_range: '{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries'
|
|
4
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.js","names":["defaultTranslations","data_unavailable","pagination_entries_range"],"sources":["../../../src/translations/translations.ts"],"sourcesContent":["export const defaultTranslations = {\n data_unavailable: 'Data unavailable',\n pagination_entries_range:\n '{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries',\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.js","names":["defaultTranslations","exports","data_unavailable","pagination_entries_range"],"sources":["../../../src/translations/translations.ts"],"sourcesContent":["export const defaultTranslations = {\n data_unavailable: 'Data unavailable',\n pagination_entries_range:\n '{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries',\n};\n"],"mappings":";;;;;;AAAO,MAAMA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EACjCE,gBAAgB,EAAE,kBAAkB;EACpCC,wBAAwB,EACtB;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DataRecordType = void 0;
|
|
7
|
+
let DataRecordType = exports.DataRecordType = function (DataRecordType) {
|
|
2
8
|
DataRecordType["INSTRUMENT"] = "instrument";
|
|
3
9
|
DataRecordType["SELL"] = "sell";
|
|
4
10
|
DataRecordType["BUY"] = "buy";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataTypes.js","names":["DataRecordType"],"sources":["../../../src/types/dataTypes.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nexport interface DataRecord {\n [key: string]: string | number | SentimentValue | undefined | number[];\n instrument: string;\n displayName: string;\n buy?: number;\n sell?: number;\n spread?: number;\n sentiment?: SentimentValue;\n sellPriceMovement?: number;\n buyPriceMovement?: number;\n dailyPercentChange?: string;\n displayPrecision?: number;\n chart?: number[];\n high?: number;\n low?: number;\n tradeMode?: string;\n dataSource?: string;\n}\n\nexport interface SentimentValue {\n shortPercent: number;\n longPercent: number;\n}\n\nexport type EmptyRecord = Record<string, never>;\n\nexport interface QueryVariables {\n [key: string]: any;\n}\n\nexport enum DataRecordType {\n INSTRUMENT = 'instrument',\n SELL = 'sell',\n BUY = 'buy',\n DAILY_CHANGE = 'dailyChange',\n CHART = 'chart',\n SPREAD = 'spread',\n SENTIMENT = 'sentiment',\n LOW = 'low',\n HIGH = 'high',\n SYMBOL = 'symbol',\n TRADE_MODE = 'tradeMode',\n DATA_SOURCE = 'dataSource',\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataTypes.js","names":["DataRecordType","exports"],"sources":["../../../src/types/dataTypes.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nexport interface DataRecord {\n [key: string]: string | number | SentimentValue | undefined | number[];\n instrument: string;\n displayName: string;\n buy?: number;\n sell?: number;\n spread?: number;\n sentiment?: SentimentValue;\n sellPriceMovement?: number;\n buyPriceMovement?: number;\n dailyPercentChange?: string;\n displayPrecision?: number;\n chart?: number[];\n high?: number;\n low?: number;\n tradeMode?: string;\n dataSource?: string;\n}\n\nexport interface SentimentValue {\n shortPercent: number;\n longPercent: number;\n}\n\nexport type EmptyRecord = Record<string, never>;\n\nexport interface QueryVariables {\n [key: string]: any;\n}\n\nexport enum DataRecordType {\n INSTRUMENT = 'instrument',\n SELL = 'sell',\n BUY = 'buy',\n DAILY_CHANGE = 'dailyChange',\n CHART = 'chart',\n SPREAD = 'spread',\n SENTIMENT = 'sentiment',\n LOW = 'low',\n HIGH = 'high',\n SYMBOL = 'symbol',\n TRADE_MODE = 'tradeMode',\n DATA_SOURCE = 'dataSource',\n}\n"],"mappings":";;;;;;IA+BYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,aAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
|
|
@@ -1,14 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Theme: true,
|
|
8
|
+
Size: true
|
|
9
|
+
};
|
|
10
|
+
exports.Theme = exports.Size = void 0;
|
|
11
|
+
var _dataTypes = require("./dataTypes");
|
|
12
|
+
Object.keys(_dataTypes).forEach(function (key) {
|
|
13
|
+
if (key === "default" || key === "__esModule") return;
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
15
|
+
if (key in exports && exports[key] === _dataTypes[key]) return;
|
|
16
|
+
Object.defineProperty(exports, key, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _dataTypes[key];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
var _liveRatesTypes = require("./liveRatesTypes");
|
|
24
|
+
Object.keys(_liveRatesTypes).forEach(function (key) {
|
|
25
|
+
if (key === "default" || key === "__esModule") return;
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
27
|
+
if (key in exports && exports[key] === _liveRatesTypes[key]) return;
|
|
28
|
+
Object.defineProperty(exports, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () {
|
|
31
|
+
return _liveRatesTypes[key];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
let Theme = exports.Theme = function (Theme) {
|
|
2
36
|
Theme["Dark"] = "dark";
|
|
3
37
|
Theme["Light"] = "light";
|
|
4
38
|
return Theme;
|
|
5
39
|
}({});
|
|
6
|
-
|
|
40
|
+
let Size = exports.Size = function (Size) {
|
|
7
41
|
Size["MOBILE"] = "mobile";
|
|
8
42
|
Size["TABLET"] = "tablet";
|
|
9
43
|
Size["DESKTOP"] = "desktop";
|
|
10
44
|
return Size;
|
|
11
45
|
}({});
|
|
12
|
-
export * from './dataTypes';
|
|
13
|
-
export * from './liveRatesTypes';
|
|
14
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Theme","Size"],"sources":["../../../src/types/index.ts"],"sourcesContent":["import type { Locale } from '@oanda/mono-i18n';\nimport type { ReactElement } from 'react';\n\nexport type Voidable<T> = T | undefined;\nexport type VoidEffect = () => void;\nexport type Nullable<T> = T | null;\nexport type ValueOf<T> = T[keyof T];\nexport type KeysOf<T> = keyof T;\n\nexport enum Theme {\n Dark = 'dark',\n Light = 'light',\n}\n\nexport enum Size {\n MOBILE = 'mobile',\n TABLET = 'tablet',\n DESKTOP = 'desktop',\n}\n\nexport type WidgetConfig = WidgetStyling &\n Pick<WidgetLink, 'logoLink'> & {\n locale: Locale;\n graphqlUrl: string;\n theme?: Theme;\n isParamError?: boolean;\n };\n\nexport interface WidgetStyling {\n brandingSpace?: 'horizontal' | 'vertical';\n fitContent?: boolean;\n layout?: 'compact' | 'full';\n removePadding?: boolean;\n}\n\nexport interface WidgetLink {\n logoLink?: string;\n linkArea?: 'full' | 'logo';\n}\n\nexport type RenderComponentParams = WidgetStyling &\n WidgetLink & {\n Component: ReactElement;\n };\n\nexport * from './dataTypes';\nexport * from './liveRatesTypes';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_dataTypes","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_liveRatesTypes","Theme","Size"],"sources":["../../../src/types/index.ts"],"sourcesContent":["import type { Locale } from '@oanda/mono-i18n';\nimport type { ReactElement } from 'react';\n\nexport type Voidable<T> = T | undefined;\nexport type VoidEffect = () => void;\nexport type Nullable<T> = T | null;\nexport type ValueOf<T> = T[keyof T];\nexport type KeysOf<T> = keyof T;\n\nexport enum Theme {\n Dark = 'dark',\n Light = 'light',\n}\n\nexport enum Size {\n MOBILE = 'mobile',\n TABLET = 'tablet',\n DESKTOP = 'desktop',\n}\n\nexport type WidgetConfig = WidgetStyling &\n Pick<WidgetLink, 'logoLink'> & {\n locale: Locale;\n graphqlUrl: string;\n theme?: Theme;\n isParamError?: boolean;\n };\n\nexport interface WidgetStyling {\n brandingSpace?: 'horizontal' | 'vertical';\n fitContent?: boolean;\n layout?: 'compact' | 'full';\n removePadding?: boolean;\n}\n\nexport interface WidgetLink {\n logoLink?: string;\n linkArea?: 'full' | 'logo';\n}\n\nexport type RenderComponentParams = WidgetStyling &\n WidgetLink & {\n Component: ReactElement;\n };\n\nexport * from './dataTypes';\nexport * from './liveRatesTypes';\n"],"mappings":";;;;;;;;;;AA6CA,IAAAA,UAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,UAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,UAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,UAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,eAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,eAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,eAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,eAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AAAiC,IArCrBU,KAAK,GAAAL,OAAA,CAAAK,KAAA,aAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAAA,OAALA,KAAK;AAAA;AAAA,IAKLC,IAAI,GAAAN,OAAA,CAAAM,IAAA,aAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAA,OAAJA,IAAI;AAAA","ignoreList":[]}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatUpdatedTimestampTime = exports.formatUpdatedTimestampDate = exports.formatUpdatedTimestamp = void 0;
|
|
1
7
|
const addLeadingZero = value => String(value).padStart(2, '0');
|
|
2
8
|
const formatTimezone = timestamp => {
|
|
3
9
|
const date = new Date(timestamp);
|
|
@@ -10,12 +16,14 @@ const formatUpdatedTimestampTime = timestamp => {
|
|
|
10
16
|
const date = new Date(timestamp);
|
|
11
17
|
return `${addLeadingZero(date.getHours())}:${addLeadingZero(date.getMinutes())}:${addLeadingZero(date.getSeconds())}`;
|
|
12
18
|
};
|
|
19
|
+
exports.formatUpdatedTimestampTime = formatUpdatedTimestampTime;
|
|
13
20
|
const formatUpdatedTimestampDate = (timestamp, dateLabel) => {
|
|
14
21
|
const timestampDate = new Date(timestamp);
|
|
15
22
|
return new Date().toDateString() === timestampDate.toDateString() ? dateLabel : timestampDate.toLocaleDateString(undefined, {
|
|
16
23
|
dateStyle: 'short'
|
|
17
24
|
});
|
|
18
25
|
};
|
|
26
|
+
exports.formatUpdatedTimestampDate = formatUpdatedTimestampDate;
|
|
19
27
|
const formatUpdatedTimestamp = (timestamp, dateLabel) => timestamp ? `${formatUpdatedTimestampTime(timestamp)}, ${formatUpdatedTimestampDate(timestamp, dateLabel)} ${formatTimezone(timestamp)}.` : '';
|
|
20
|
-
|
|
28
|
+
exports.formatUpdatedTimestamp = formatUpdatedTimestamp;
|
|
21
29
|
//# sourceMappingURL=dateUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateUtils.js","names":["addLeadingZero","value","String","padStart","formatTimezone","timestamp","date","Date","timezoneOffset","getTimezoneOffset","timezoneSymbol","timezoneValue","formatUpdatedTimestampTime","getHours","getMinutes","getSeconds","formatUpdatedTimestampDate","dateLabel","timestampDate","toDateString","toLocaleDateString","undefined","dateStyle","formatUpdatedTimestamp"],"sources":["../../../src/utils/dateUtils.ts"],"sourcesContent":["const addLeadingZero = (value: number) => String(value).padStart(2, '0');\n\nconst formatTimezone = (timestamp: string) => {\n const date = new Date(timestamp);\n const timezoneOffset = date.getTimezoneOffset();\n const timezoneSymbol = timezoneOffset < 0 ? '+' : '';\n const timezoneValue = timezoneOffset / -60;\n\n return `(UTC${timezoneSymbol}${timezoneOffset ? timezoneValue : ''})`;\n};\n\nconst formatUpdatedTimestampTime = (timestamp: string) => {\n const date = new Date(timestamp);\n\n return `${addLeadingZero(date.getHours())}:${addLeadingZero(\n date.getMinutes()\n )}:${addLeadingZero(date.getSeconds())}`;\n};\n\nconst formatUpdatedTimestampDate = (timestamp: string, dateLabel: string) => {\n const timestampDate = new Date(timestamp);\n\n return new Date().toDateString() === timestampDate.toDateString()\n ? dateLabel\n : timestampDate.toLocaleDateString(undefined, { dateStyle: 'short' });\n};\n\nconst formatUpdatedTimestamp = (timestamp: string, dateLabel: string) =>\n timestamp\n ? `${formatUpdatedTimestampTime(timestamp)}, ${formatUpdatedTimestampDate(timestamp, dateLabel)} ${formatTimezone(timestamp)}.`\n : '';\n\nexport {\n formatUpdatedTimestamp,\n formatUpdatedTimestampDate,\n formatUpdatedTimestampTime,\n};\n"],"mappings":"AAAA,MAAMA,cAAc,GAAIC,KAAa,IAAKC,MAAM,CAACD,KAAK,CAAC,CAACE,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAExE,MAAMC,cAAc,GAAIC,SAAiB,IAAK;EAC5C,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAACF,SAAS,CAAC;EAChC,MAAMG,cAAc,GAAGF,IAAI,CAACG,iBAAiB,CAAC,CAAC;EAC/C,MAAMC,cAAc,GAAGF,cAAc,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE;EACpD,MAAMG,aAAa,GAAGH,cAAc,GAAG,CAAC,EAAE;EAE1C,OAAO,OAAOE,cAAc,GAAGF,cAAc,GAAGG,aAAa,GAAG,EAAE,GAAG;AACvE,CAAC;AAED,MAAMC,0BAA0B,GAAIP,SAAiB,IAAK;EACxD,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAACF,SAAS,CAAC;EAEhC,OAAO,GAAGL,cAAc,CAACM,IAAI,CAACO,QAAQ,CAAC,CAAC,CAAC,IAAIb,cAAc,CACzDM,IAAI,CAACQ,UAAU,CAAC,CAClB,CAAC,IAAId,cAAc,CAACM,IAAI,CAACS,UAAU,CAAC,CAAC,CAAC,EAAE;AAC1C,CAAC;
|
|
1
|
+
{"version":3,"file":"dateUtils.js","names":["addLeadingZero","value","String","padStart","formatTimezone","timestamp","date","Date","timezoneOffset","getTimezoneOffset","timezoneSymbol","timezoneValue","formatUpdatedTimestampTime","getHours","getMinutes","getSeconds","exports","formatUpdatedTimestampDate","dateLabel","timestampDate","toDateString","toLocaleDateString","undefined","dateStyle","formatUpdatedTimestamp"],"sources":["../../../src/utils/dateUtils.ts"],"sourcesContent":["const addLeadingZero = (value: number) => String(value).padStart(2, '0');\n\nconst formatTimezone = (timestamp: string) => {\n const date = new Date(timestamp);\n const timezoneOffset = date.getTimezoneOffset();\n const timezoneSymbol = timezoneOffset < 0 ? '+' : '';\n const timezoneValue = timezoneOffset / -60;\n\n return `(UTC${timezoneSymbol}${timezoneOffset ? timezoneValue : ''})`;\n};\n\nconst formatUpdatedTimestampTime = (timestamp: string) => {\n const date = new Date(timestamp);\n\n return `${addLeadingZero(date.getHours())}:${addLeadingZero(\n date.getMinutes()\n )}:${addLeadingZero(date.getSeconds())}`;\n};\n\nconst formatUpdatedTimestampDate = (timestamp: string, dateLabel: string) => {\n const timestampDate = new Date(timestamp);\n\n return new Date().toDateString() === timestampDate.toDateString()\n ? dateLabel\n : timestampDate.toLocaleDateString(undefined, { dateStyle: 'short' });\n};\n\nconst formatUpdatedTimestamp = (timestamp: string, dateLabel: string) =>\n timestamp\n ? `${formatUpdatedTimestampTime(timestamp)}, ${formatUpdatedTimestampDate(timestamp, dateLabel)} ${formatTimezone(timestamp)}.`\n : '';\n\nexport {\n formatUpdatedTimestamp,\n formatUpdatedTimestampDate,\n formatUpdatedTimestampTime,\n};\n"],"mappings":";;;;;;AAAA,MAAMA,cAAc,GAAIC,KAAa,IAAKC,MAAM,CAACD,KAAK,CAAC,CAACE,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAExE,MAAMC,cAAc,GAAIC,SAAiB,IAAK;EAC5C,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAACF,SAAS,CAAC;EAChC,MAAMG,cAAc,GAAGF,IAAI,CAACG,iBAAiB,CAAC,CAAC;EAC/C,MAAMC,cAAc,GAAGF,cAAc,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE;EACpD,MAAMG,aAAa,GAAGH,cAAc,GAAG,CAAC,EAAE;EAE1C,OAAO,OAAOE,cAAc,GAAGF,cAAc,GAAGG,aAAa,GAAG,EAAE,GAAG;AACvE,CAAC;AAED,MAAMC,0BAA0B,GAAIP,SAAiB,IAAK;EACxD,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAACF,SAAS,CAAC;EAEhC,OAAO,GAAGL,cAAc,CAACM,IAAI,CAACO,QAAQ,CAAC,CAAC,CAAC,IAAIb,cAAc,CACzDM,IAAI,CAACQ,UAAU,CAAC,CAClB,CAAC,IAAId,cAAc,CAACM,IAAI,CAACS,UAAU,CAAC,CAAC,CAAC,EAAE;AAC1C,CAAC;AAACC,OAAA,CAAAJ,0BAAA,GAAAA,0BAAA;AAEF,MAAMK,0BAA0B,GAAGA,CAACZ,SAAiB,EAAEa,SAAiB,KAAK;EAC3E,MAAMC,aAAa,GAAG,IAAIZ,IAAI,CAACF,SAAS,CAAC;EAEzC,OAAO,IAAIE,IAAI,CAAC,CAAC,CAACa,YAAY,CAAC,CAAC,KAAKD,aAAa,CAACC,YAAY,CAAC,CAAC,GAC7DF,SAAS,GACTC,aAAa,CAACE,kBAAkB,CAACC,SAAS,EAAE;IAAEC,SAAS,EAAE;EAAQ,CAAC,CAAC;AACzE,CAAC;AAACP,OAAA,CAAAC,0BAAA,GAAAA,0BAAA;AAEF,MAAMO,sBAAsB,GAAGA,CAACnB,SAAiB,EAAEa,SAAiB,KAClEb,SAAS,GACL,GAAGO,0BAA0B,CAACP,SAAS,CAAC,KAAKY,0BAA0B,CAACZ,SAAS,EAAEa,SAAS,CAAC,IAAId,cAAc,CAACC,SAAS,CAAC,GAAG,GAC7H,EAAE;AAACW,OAAA,CAAAQ,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validateLocale = exports.getLocale = void 0;
|
|
7
|
+
var _monoI18n = require("@oanda/mono-i18n");
|
|
2
8
|
const validateLocale = locale => {
|
|
3
9
|
const locales = ['en', 'zh', 'es', 'th', 'fr', 'de', 'pt', 'it', 'zhCN', 'vi', 'ja'];
|
|
4
10
|
return locales.includes(locale?.substring(0, 2));
|
|
5
11
|
};
|
|
12
|
+
exports.validateLocale = validateLocale;
|
|
6
13
|
const getLocale = locale => {
|
|
7
14
|
const languageCodeDictionary = {
|
|
8
|
-
en: Locale.en,
|
|
9
|
-
zh: Locale.zhTW,
|
|
10
|
-
es: Locale.es,
|
|
11
|
-
th: Locale.th,
|
|
12
|
-
fr: Locale.fr,
|
|
13
|
-
de: Locale.de,
|
|
14
|
-
pt: Locale.pt,
|
|
15
|
-
it: Locale.it,
|
|
16
|
-
['zh-CN']: Locale.zhCN,
|
|
17
|
-
vi: Locale.vi,
|
|
18
|
-
ja: Locale.ja
|
|
15
|
+
en: _monoI18n.Locale.en,
|
|
16
|
+
zh: _monoI18n.Locale.zhTW,
|
|
17
|
+
es: _monoI18n.Locale.es,
|
|
18
|
+
th: _monoI18n.Locale.th,
|
|
19
|
+
fr: _monoI18n.Locale.fr,
|
|
20
|
+
de: _monoI18n.Locale.de,
|
|
21
|
+
pt: _monoI18n.Locale.pt,
|
|
22
|
+
it: _monoI18n.Locale.it,
|
|
23
|
+
['zh-CN']: _monoI18n.Locale.zhCN,
|
|
24
|
+
vi: _monoI18n.Locale.vi,
|
|
25
|
+
ja: _monoI18n.Locale.ja
|
|
19
26
|
};
|
|
20
27
|
return languageCodeDictionary[locale] || languageCodeDictionary.en;
|
|
21
28
|
};
|
|
22
|
-
|
|
29
|
+
exports.getLocale = getLocale;
|
|
23
30
|
//# sourceMappingURL=getLocale.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocale.js","names":["
|
|
1
|
+
{"version":3,"file":"getLocale.js","names":["_monoI18n","require","validateLocale","locale","locales","includes","substring","exports","getLocale","languageCodeDictionary","en","Locale","zh","zhTW","es","th","fr","de","pt","it","zhCN","vi","ja"],"sources":["../../../src/utils/getLocale.ts"],"sourcesContent":["import { Locale } from '@oanda/mono-i18n';\n\nconst validateLocale = (locale?: string) => {\n const locales = [\n 'en',\n 'zh',\n 'es',\n 'th',\n 'fr',\n 'de',\n 'pt',\n 'it',\n 'zhCN',\n 'vi',\n 'ja',\n ];\n\n return locales.includes(locale?.substring(0, 2)!);\n};\n\nconst getLocale = (locale?: string) => {\n const languageCodeDictionary: Record<string, Locale> = {\n en: Locale.en,\n zh: Locale.zhTW,\n es: Locale.es,\n th: Locale.th,\n fr: Locale.fr,\n de: Locale.de,\n pt: Locale.pt,\n it: Locale.it,\n ['zh-CN']: Locale.zhCN,\n vi: Locale.vi,\n ja: Locale.ja,\n };\n\n return languageCodeDictionary[locale!] || languageCodeDictionary.en;\n};\n\nexport { getLocale, validateLocale };\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,MAAMC,cAAc,GAAIC,MAAe,IAAK;EAC1C,MAAMC,OAAO,GAAG,CACd,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,CACL;EAED,OAAOA,OAAO,CAACC,QAAQ,CAACF,MAAM,EAAEG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAE,CAAC;AACnD,CAAC;AAACC,OAAA,CAAAL,cAAA,GAAAA,cAAA;AAEF,MAAMM,SAAS,GAAIL,MAAe,IAAK;EACrC,MAAMM,sBAA8C,GAAG;IACrDC,EAAE,EAAEC,gBAAM,CAACD,EAAE;IACbE,EAAE,EAAED,gBAAM,CAACE,IAAI;IACfC,EAAE,EAAEH,gBAAM,CAACG,EAAE;IACbC,EAAE,EAAEJ,gBAAM,CAACI,EAAE;IACbC,EAAE,EAAEL,gBAAM,CAACK,EAAE;IACbC,EAAE,EAAEN,gBAAM,CAACM,EAAE;IACbC,EAAE,EAAEP,gBAAM,CAACO,EAAE;IACbC,EAAE,EAAER,gBAAM,CAACQ,EAAE;IACb,CAAC,OAAO,GAAGR,gBAAM,CAACS,IAAI;IACtBC,EAAE,EAAEV,gBAAM,CAACU,EAAE;IACbC,EAAE,EAAEX,gBAAM,CAACW;EACb,CAAC;EAED,OAAOb,sBAAsB,CAACN,MAAM,CAAE,IAAIM,sBAAsB,CAACC,EAAE;AACrE,CAAC;AAACH,OAAA,CAAAC,SAAA,GAAAA,SAAA","ignoreList":[]}
|