@perses-dev/components 0.0.0-snapshot-time-range-height-80d08fc

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 (481) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +18 -0
  3. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +9 -0
  4. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -0
  5. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +181 -0
  6. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -0
  7. package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +12 -0
  8. package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -0
  9. package/dist/DateTimeRangePicker/DateTimeRangePicker.js +79 -0
  10. package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -0
  11. package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +17 -0
  12. package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +1 -0
  13. package/dist/DateTimeRangePicker/TimeRangeSelector.js +58 -0
  14. package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -0
  15. package/dist/DateTimeRangePicker/index.d.ts +4 -0
  16. package/dist/DateTimeRangePicker/index.d.ts.map +1 -0
  17. package/dist/DateTimeRangePicker/index.js +17 -0
  18. package/dist/DateTimeRangePicker/index.js.map +1 -0
  19. package/dist/DateTimeRangePicker/utils.d.ts +7 -0
  20. package/dist/DateTimeRangePicker/utils.d.ts.map +1 -0
  21. package/dist/DateTimeRangePicker/utils.js +37 -0
  22. package/dist/DateTimeRangePicker/utils.js.map +1 -0
  23. package/dist/Drawer/Drawer.d.ts +9 -0
  24. package/dist/Drawer/Drawer.d.ts.map +1 -0
  25. package/dist/Drawer/Drawer.js +34 -0
  26. package/dist/Drawer/Drawer.js.map +1 -0
  27. package/dist/Drawer/index.d.ts +2 -0
  28. package/dist/Drawer/index.d.ts.map +1 -0
  29. package/dist/Drawer/index.js +15 -0
  30. package/dist/Drawer/index.js.map +1 -0
  31. package/dist/EChart.d.ts +61 -0
  32. package/dist/EChart.d.ts.map +1 -0
  33. package/dist/EChart.js +143 -0
  34. package/dist/EChart.js.map +1 -0
  35. package/dist/ErrorAlert.d.ts +9 -0
  36. package/dist/ErrorAlert.d.ts.map +1 -0
  37. package/dist/ErrorAlert.js +25 -0
  38. package/dist/ErrorAlert.js.map +1 -0
  39. package/dist/ErrorBoundary.d.ts +3 -0
  40. package/dist/ErrorBoundary.d.ts.map +1 -0
  41. package/dist/ErrorBoundary.js +16 -0
  42. package/dist/ErrorBoundary.js.map +1 -0
  43. package/dist/GaugeChart/GaugeChart.d.ts +15 -0
  44. package/dist/GaugeChart/GaugeChart.d.ts.map +1 -0
  45. package/dist/GaugeChart/GaugeChart.js +172 -0
  46. package/dist/GaugeChart/GaugeChart.js.map +1 -0
  47. package/dist/GaugeChart/index.d.ts +2 -0
  48. package/dist/GaugeChart/index.d.ts.map +1 -0
  49. package/dist/GaugeChart/index.js +15 -0
  50. package/dist/GaugeChart/index.js.map +1 -0
  51. package/dist/InfoTooltip/InfoTooltip.d.ts +17 -0
  52. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -0
  53. package/dist/InfoTooltip/InfoTooltip.js +76 -0
  54. package/dist/InfoTooltip/InfoTooltip.js.map +1 -0
  55. package/dist/InfoTooltip/InfoTooltip.test.d.ts +2 -0
  56. package/dist/InfoTooltip/InfoTooltip.test.d.ts.map +1 -0
  57. package/dist/InfoTooltip/InfoTooltip.test.js +36 -0
  58. package/dist/InfoTooltip/InfoTooltip.test.js.map +1 -0
  59. package/dist/InfoTooltip/index.d.ts +2 -0
  60. package/dist/InfoTooltip/index.d.ts.map +1 -0
  61. package/dist/InfoTooltip/index.js +15 -0
  62. package/dist/InfoTooltip/index.js.map +1 -0
  63. package/dist/JSONEditor.d.ts +8 -0
  64. package/dist/JSONEditor.d.ts.map +1 -0
  65. package/dist/JSONEditor.js +51 -0
  66. package/dist/JSONEditor.js.map +1 -0
  67. package/dist/Legend/CompactLegend.d.ts +13 -0
  68. package/dist/Legend/CompactLegend.d.ts.map +1 -0
  69. package/dist/Legend/CompactLegend.js +45 -0
  70. package/dist/Legend/CompactLegend.js.map +1 -0
  71. package/dist/Legend/Legend.d.ts +11 -0
  72. package/dist/Legend/Legend.d.ts.map +1 -0
  73. package/dist/Legend/Legend.js +39 -0
  74. package/dist/Legend/Legend.js.map +1 -0
  75. package/dist/Legend/LegendColorBadge.d.ts +7 -0
  76. package/dist/Legend/LegendColorBadge.d.ts.map +1 -0
  77. package/dist/Legend/LegendColorBadge.js +31 -0
  78. package/dist/Legend/LegendColorBadge.js.map +1 -0
  79. package/dist/Legend/ListLegend.d.ts +11 -0
  80. package/dist/Legend/ListLegend.d.ts.map +1 -0
  81. package/dist/Legend/ListLegend.js +40 -0
  82. package/dist/Legend/ListLegend.js.map +1 -0
  83. package/dist/Legend/ListLegendItem.d.ts +9 -0
  84. package/dist/Legend/ListLegendItem.d.ts.map +1 -0
  85. package/dist/Legend/ListLegendItem.js +47 -0
  86. package/dist/Legend/ListLegendItem.js.map +1 -0
  87. package/dist/Legend/index.d.ts +2 -0
  88. package/dist/Legend/index.d.ts.map +1 -0
  89. package/dist/Legend/index.js +15 -0
  90. package/dist/Legend/index.js.map +1 -0
  91. package/dist/LineChart/LineChart.d.ts +19 -0
  92. package/dist/LineChart/LineChart.d.ts.map +1 -0
  93. package/dist/LineChart/LineChart.js +189 -0
  94. package/dist/LineChart/LineChart.js.map +1 -0
  95. package/dist/LineChart/index.d.ts +3 -0
  96. package/dist/LineChart/index.d.ts.map +1 -0
  97. package/dist/LineChart/index.js +15 -0
  98. package/dist/LineChart/index.js.map +1 -0
  99. package/dist/LineChart/utils.d.ts +30 -0
  100. package/dist/LineChart/utils.d.ts.map +1 -0
  101. package/dist/LineChart/utils.js +90 -0
  102. package/dist/LineChart/utils.js.map +1 -0
  103. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +13 -0
  104. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -0
  105. package/dist/OptionsEditorLayout/OptionsEditorColumn.js +28 -0
  106. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -0
  107. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +5 -0
  108. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -0
  109. package/dist/OptionsEditorLayout/OptionsEditorControl.js +50 -0
  110. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -0
  111. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +13 -0
  112. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -0
  113. package/dist/OptionsEditorLayout/OptionsEditorGrid.js +26 -0
  114. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -0
  115. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +13 -0
  116. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -0
  117. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +36 -0
  118. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -0
  119. package/dist/OptionsEditorLayout/index.d.ts +5 -0
  120. package/dist/OptionsEditorLayout/index.d.ts.map +1 -0
  121. package/dist/OptionsEditorLayout/index.js +18 -0
  122. package/dist/OptionsEditorLayout/index.js.map +1 -0
  123. package/dist/StatChart/StatChart.d.ts +19 -0
  124. package/dist/StatChart/StatChart.d.ts.map +1 -0
  125. package/dist/StatChart/StatChart.js +121 -0
  126. package/dist/StatChart/StatChart.js.map +1 -0
  127. package/dist/StatChart/StatChart.test.d.ts +2 -0
  128. package/dist/StatChart/StatChart.test.d.ts.map +1 -0
  129. package/dist/StatChart/StatChart.test.js +87 -0
  130. package/dist/StatChart/StatChart.test.js.map +1 -0
  131. package/dist/StatChart/index.d.ts +2 -0
  132. package/dist/StatChart/index.d.ts.map +1 -0
  133. package/dist/StatChart/index.js +15 -0
  134. package/dist/StatChart/index.js.map +1 -0
  135. package/dist/Tooltip/SeriesInfo.d.ts +12 -0
  136. package/dist/Tooltip/SeriesInfo.d.ts.map +1 -0
  137. package/dist/Tooltip/SeriesInfo.js +143 -0
  138. package/dist/Tooltip/SeriesInfo.js.map +1 -0
  139. package/dist/Tooltip/SeriesMarker.d.ts +7 -0
  140. package/dist/Tooltip/SeriesMarker.d.ts.map +1 -0
  141. package/dist/Tooltip/SeriesMarker.js +33 -0
  142. package/dist/Tooltip/SeriesMarker.js.map +1 -0
  143. package/dist/Tooltip/Tooltip.d.ts +13 -0
  144. package/dist/Tooltip/Tooltip.d.ts.map +1 -0
  145. package/dist/Tooltip/Tooltip.js +72 -0
  146. package/dist/Tooltip/Tooltip.js.map +1 -0
  147. package/dist/Tooltip/TooltipContent.d.ts +9 -0
  148. package/dist/Tooltip/TooltipContent.d.ts.map +1 -0
  149. package/dist/Tooltip/TooltipContent.js +89 -0
  150. package/dist/Tooltip/TooltipContent.js.map +1 -0
  151. package/dist/Tooltip/focused-series.d.ts +25 -0
  152. package/dist/Tooltip/focused-series.d.ts.map +1 -0
  153. package/dist/Tooltip/focused-series.js +111 -0
  154. package/dist/Tooltip/focused-series.js.map +1 -0
  155. package/dist/Tooltip/focused-series.test.d.ts +2 -0
  156. package/dist/Tooltip/focused-series.test.d.ts.map +1 -0
  157. package/dist/Tooltip/focused-series.test.js +93 -0
  158. package/dist/Tooltip/focused-series.test.js.map +1 -0
  159. package/dist/Tooltip/index.d.ts +3 -0
  160. package/dist/Tooltip/index.d.ts.map +1 -0
  161. package/dist/Tooltip/index.js +16 -0
  162. package/dist/Tooltip/index.js.map +1 -0
  163. package/dist/Tooltip/tooltip-model.d.ts +79 -0
  164. package/dist/Tooltip/tooltip-model.d.ts.map +1 -0
  165. package/dist/Tooltip/tooltip-model.js +80 -0
  166. package/dist/Tooltip/tooltip-model.js.map +1 -0
  167. package/dist/Tooltip/utils.d.ts +6 -0
  168. package/dist/Tooltip/utils.d.ts.map +1 -0
  169. package/dist/Tooltip/utils.js +46 -0
  170. package/dist/Tooltip/utils.js.map +1 -0
  171. package/dist/UnitSelector/UnitSelector.d.ts +8 -0
  172. package/dist/UnitSelector/UnitSelector.d.ts.map +1 -0
  173. package/dist/UnitSelector/UnitSelector.js +112 -0
  174. package/dist/UnitSelector/UnitSelector.js.map +1 -0
  175. package/dist/UnitSelector/UnitSelector.test.d.ts +2 -0
  176. package/dist/UnitSelector/UnitSelector.test.d.ts.map +1 -0
  177. package/dist/UnitSelector/UnitSelector.test.js +205 -0
  178. package/dist/UnitSelector/UnitSelector.test.js.map +1 -0
  179. package/dist/UnitSelector/index.d.ts +2 -0
  180. package/dist/UnitSelector/index.d.ts.map +1 -0
  181. package/dist/UnitSelector/index.js +15 -0
  182. package/dist/UnitSelector/index.js.map +1 -0
  183. package/dist/YAxisLabel.d.ts +8 -0
  184. package/dist/YAxisLabel.d.ts.map +1 -0
  185. package/dist/YAxisLabel.js +39 -0
  186. package/dist/YAxisLabel.js.map +1 -0
  187. package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +187 -0
  188. package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +85 -0
  189. package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +69 -0
  190. package/dist/cjs/DateTimeRangePicker/index.js +30 -0
  191. package/dist/cjs/DateTimeRangePicker/utils.js +45 -0
  192. package/dist/cjs/Drawer/Drawer.js +40 -0
  193. package/dist/cjs/Drawer/index.js +28 -0
  194. package/dist/cjs/EChart.js +188 -0
  195. package/dist/cjs/ErrorAlert.js +29 -0
  196. package/dist/cjs/ErrorBoundary.js +22 -0
  197. package/dist/cjs/GaugeChart/GaugeChart.js +178 -0
  198. package/dist/cjs/GaugeChart/index.js +28 -0
  199. package/dist/cjs/InfoTooltip/InfoTooltip.js +93 -0
  200. package/dist/cjs/InfoTooltip/InfoTooltip.test.js +43 -0
  201. package/dist/cjs/InfoTooltip/index.js +28 -0
  202. package/dist/cjs/JSONEditor.js +57 -0
  203. package/dist/cjs/Legend/CompactLegend.js +48 -0
  204. package/dist/cjs/Legend/Legend.js +45 -0
  205. package/dist/cjs/Legend/LegendColorBadge.js +42 -0
  206. package/dist/cjs/Legend/ListLegend.js +44 -0
  207. package/dist/cjs/Legend/ListLegendItem.js +91 -0
  208. package/dist/cjs/Legend/index.js +28 -0
  209. package/dist/cjs/LineChart/LineChart.js +195 -0
  210. package/dist/cjs/LineChart/index.js +28 -0
  211. package/dist/cjs/LineChart/utils.js +95 -0
  212. package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +32 -0
  213. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +61 -0
  214. package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +29 -0
  215. package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +40 -0
  216. package/dist/cjs/OptionsEditorLayout/index.js +31 -0
  217. package/dist/cjs/StatChart/StatChart.js +165 -0
  218. package/dist/cjs/StatChart/StatChart.test.js +89 -0
  219. package/dist/cjs/StatChart/index.js +28 -0
  220. package/dist/cjs/Tooltip/SeriesInfo.js +149 -0
  221. package/dist/cjs/Tooltip/SeriesMarker.js +39 -0
  222. package/dist/cjs/Tooltip/Tooltip.js +116 -0
  223. package/dist/cjs/Tooltip/TooltipContent.js +95 -0
  224. package/dist/cjs/Tooltip/focused-series.js +117 -0
  225. package/dist/cjs/Tooltip/focused-series.test.js +95 -0
  226. package/dist/cjs/Tooltip/index.js +29 -0
  227. package/dist/cjs/Tooltip/tooltip-model.js +98 -0
  228. package/dist/cjs/Tooltip/utils.js +50 -0
  229. package/dist/cjs/UnitSelector/UnitSelector.js +118 -0
  230. package/dist/cjs/UnitSelector/UnitSelector.test.js +212 -0
  231. package/dist/cjs/UnitSelector/index.js +28 -0
  232. package/dist/cjs/YAxisLabel.js +45 -0
  233. package/dist/cjs/context/ChartsThemeProvider.js +83 -0
  234. package/dist/cjs/context/TimeZoneProvider.js +90 -0
  235. package/dist/cjs/index.js +47 -0
  236. package/dist/cjs/model/graph.js +21 -0
  237. package/dist/cjs/model/index.js +30 -0
  238. package/dist/cjs/model/theme.js +16 -0
  239. package/dist/cjs/model/units/bytes.js +60 -0
  240. package/dist/cjs/model/units/constants.js +23 -0
  241. package/dist/cjs/model/units/decimal.js +67 -0
  242. package/dist/cjs/model/units/index.js +30 -0
  243. package/dist/cjs/model/units/percent.js +64 -0
  244. package/dist/cjs/model/units/time.js +102 -0
  245. package/dist/cjs/model/units/types.js +28 -0
  246. package/dist/cjs/model/units/units.js +104 -0
  247. package/dist/cjs/test/index.js +28 -0
  248. package/dist/cjs/test/render.js +36 -0
  249. package/dist/cjs/test/setup-tests.js +20 -0
  250. package/dist/cjs/test-utils/index.js +28 -0
  251. package/dist/cjs/test-utils/theme.js +28 -0
  252. package/dist/cjs/theme/index.js +28 -0
  253. package/dist/cjs/theme/palette/background.js +40 -0
  254. package/dist/cjs/theme/palette/colors/blue.js +35 -0
  255. package/dist/cjs/theme/palette/colors/common.js +28 -0
  256. package/dist/cjs/theme/palette/colors/green.js +35 -0
  257. package/dist/cjs/theme/palette/colors/grey.js +35 -0
  258. package/dist/cjs/theme/palette/colors/index.js +35 -0
  259. package/dist/cjs/theme/palette/colors/orange.js +35 -0
  260. package/dist/cjs/theme/palette/colors/purple.js +35 -0
  261. package/dist/cjs/theme/palette/colors/red.js +35 -0
  262. package/dist/cjs/theme/palette/colors/types.js +16 -0
  263. package/dist/cjs/theme/palette/error.js +32 -0
  264. package/dist/cjs/theme/palette/grey.js +44 -0
  265. package/dist/cjs/theme/palette/index.js +28 -0
  266. package/dist/cjs/theme/palette/palette-options.js +59 -0
  267. package/dist/cjs/theme/palette/primary.js +32 -0
  268. package/dist/cjs/theme/palette/secondary.js +32 -0
  269. package/dist/cjs/theme/palette/success.js +32 -0
  270. package/dist/cjs/theme/palette/text.js +42 -0
  271. package/dist/cjs/theme/palette/warning.js +32 -0
  272. package/dist/cjs/theme/theme.js +64 -0
  273. package/dist/cjs/theme/types/ThemeExtension.d.js +17 -0
  274. package/dist/cjs/theme/typography.js +96 -0
  275. package/dist/cjs/utils/combine-sx.js +29 -0
  276. package/dist/cjs/utils/component-ids.js +31 -0
  277. package/dist/cjs/utils/format.js +56 -0
  278. package/dist/cjs/utils/format.test.js +47 -0
  279. package/dist/cjs/utils/index.js +31 -0
  280. package/dist/cjs/utils/mathjs.js +25 -0
  281. package/dist/cjs/utils/theme-gen.js +188 -0
  282. package/dist/cjs/utils/theme-gen.test.js +197 -0
  283. package/dist/context/ChartsThemeProvider.d.ts +10 -0
  284. package/dist/context/ChartsThemeProvider.d.ts.map +1 -0
  285. package/dist/context/ChartsThemeProvider.js +31 -0
  286. package/dist/context/ChartsThemeProvider.js.map +1 -0
  287. package/dist/context/TimeZoneProvider.d.ts +13 -0
  288. package/dist/context/TimeZoneProvider.d.ts.map +1 -0
  289. package/dist/context/TimeZoneProvider.js +38 -0
  290. package/dist/context/TimeZoneProvider.js.map +1 -0
  291. package/dist/index.d.ts +21 -0
  292. package/dist/index.d.ts.map +1 -0
  293. package/dist/index.js +34 -0
  294. package/dist/index.js.map +1 -0
  295. package/dist/model/graph.d.ts +34 -0
  296. package/dist/model/graph.d.ts.map +1 -0
  297. package/dist/model/graph.js +16 -0
  298. package/dist/model/graph.js.map +1 -0
  299. package/dist/model/index.d.ts +4 -0
  300. package/dist/model/index.d.ts.map +1 -0
  301. package/dist/model/index.js +17 -0
  302. package/dist/model/index.js.map +1 -0
  303. package/dist/model/theme.d.ts +15 -0
  304. package/dist/model/theme.d.ts.map +1 -0
  305. package/dist/model/theme.js +15 -0
  306. package/dist/model/theme.js.map +1 -0
  307. package/dist/model/units/bytes.d.ts +12 -0
  308. package/dist/model/units/bytes.d.ts.map +1 -0
  309. package/dist/model/units/bytes.js +48 -0
  310. package/dist/model/units/bytes.js.map +1 -0
  311. package/dist/model/units/constants.d.ts +2 -0
  312. package/dist/model/units/constants.d.ts.map +1 -0
  313. package/dist/model/units/constants.js +17 -0
  314. package/dist/model/units/constants.js.map +1 -0
  315. package/dist/model/units/decimal.d.ts +24 -0
  316. package/dist/model/units/decimal.d.ts.map +1 -0
  317. package/dist/model/units/decimal.js +59 -0
  318. package/dist/model/units/decimal.js.map +1 -0
  319. package/dist/model/units/index.d.ts +4 -0
  320. package/dist/model/units/index.d.ts.map +1 -0
  321. package/dist/model/units/index.js +17 -0
  322. package/dist/model/units/index.js.map +1 -0
  323. package/dist/model/units/percent.d.ts +12 -0
  324. package/dist/model/units/percent.d.ts.map +1 -0
  325. package/dist/model/units/percent.js +51 -0
  326. package/dist/model/units/percent.js.map +1 -0
  327. package/dist/model/units/time.d.ts +22 -0
  328. package/dist/model/units/time.d.ts.map +1 -0
  329. package/dist/model/units/time.js +88 -0
  330. package/dist/model/units/time.js.map +1 -0
  331. package/dist/model/units/types.d.ts +38 -0
  332. package/dist/model/units/types.d.ts.map +1 -0
  333. package/dist/model/units/types.js +22 -0
  334. package/dist/model/units/types.js.map +1 -0
  335. package/dist/model/units/units.d.ts +40 -0
  336. package/dist/model/units/units.d.ts.map +1 -0
  337. package/dist/model/units/units.js +83 -0
  338. package/dist/model/units/units.js.map +1 -0
  339. package/dist/test/index.d.ts +2 -0
  340. package/dist/test/index.d.ts.map +1 -0
  341. package/dist/test/index.js +15 -0
  342. package/dist/test/index.js.map +1 -0
  343. package/dist/test/render.d.ts +7 -0
  344. package/dist/test/render.d.ts.map +1 -0
  345. package/dist/test/render.js +32 -0
  346. package/dist/test/render.js.map +1 -0
  347. package/dist/test/setup-tests.d.ts +2 -0
  348. package/dist/test/setup-tests.d.ts.map +1 -0
  349. package/dist/test/setup-tests.js +18 -0
  350. package/dist/test/setup-tests.js.map +1 -0
  351. package/dist/test-utils/index.d.ts +2 -0
  352. package/dist/test-utils/index.d.ts.map +1 -0
  353. package/dist/test-utils/index.js +15 -0
  354. package/dist/test-utils/index.js.map +1 -0
  355. package/dist/test-utils/theme.d.ts +3 -0
  356. package/dist/test-utils/theme.d.ts.map +1 -0
  357. package/dist/test-utils/theme.js +22 -0
  358. package/dist/test-utils/theme.js.map +1 -0
  359. package/dist/theme/index.d.ts +37 -0
  360. package/dist/theme/index.d.ts.map +1 -0
  361. package/dist/theme/index.js +15 -0
  362. package/dist/theme/index.js.map +1 -0
  363. package/dist/theme/palette/background.d.ts +3 -0
  364. package/dist/theme/palette/background.d.ts.map +1 -0
  365. package/dist/theme/palette/background.js +34 -0
  366. package/dist/theme/palette/background.js.map +1 -0
  367. package/dist/theme/palette/colors/blue.d.ts +3 -0
  368. package/dist/theme/palette/colors/blue.d.ts.map +1 -0
  369. package/dist/theme/palette/colors/blue.js +29 -0
  370. package/dist/theme/palette/colors/blue.js.map +1 -0
  371. package/dist/theme/palette/colors/common.d.ts +3 -0
  372. package/dist/theme/palette/colors/common.d.ts.map +1 -0
  373. package/dist/theme/palette/colors/common.js +16 -0
  374. package/dist/theme/palette/colors/common.js.map +1 -0
  375. package/dist/theme/palette/colors/green.d.ts +3 -0
  376. package/dist/theme/palette/colors/green.d.ts.map +1 -0
  377. package/dist/theme/palette/colors/green.js +29 -0
  378. package/dist/theme/palette/colors/green.js.map +1 -0
  379. package/dist/theme/palette/colors/grey.d.ts +3 -0
  380. package/dist/theme/palette/colors/grey.d.ts.map +1 -0
  381. package/dist/theme/palette/colors/grey.js +29 -0
  382. package/dist/theme/palette/colors/grey.js.map +1 -0
  383. package/dist/theme/palette/colors/index.d.ts +9 -0
  384. package/dist/theme/palette/colors/index.d.ts.map +1 -0
  385. package/dist/theme/palette/colors/index.js +22 -0
  386. package/dist/theme/palette/colors/index.js.map +1 -0
  387. package/dist/theme/palette/colors/orange.d.ts +3 -0
  388. package/dist/theme/palette/colors/orange.d.ts.map +1 -0
  389. package/dist/theme/palette/colors/orange.js +29 -0
  390. package/dist/theme/palette/colors/orange.js.map +1 -0
  391. package/dist/theme/palette/colors/purple.d.ts +3 -0
  392. package/dist/theme/palette/colors/purple.d.ts.map +1 -0
  393. package/dist/theme/palette/colors/purple.js +29 -0
  394. package/dist/theme/palette/colors/purple.js.map +1 -0
  395. package/dist/theme/palette/colors/red.d.ts +3 -0
  396. package/dist/theme/palette/colors/red.d.ts.map +1 -0
  397. package/dist/theme/palette/colors/red.js +29 -0
  398. package/dist/theme/palette/colors/red.js.map +1 -0
  399. package/dist/theme/palette/colors/types.d.ts +17 -0
  400. package/dist/theme/palette/colors/types.d.ts.map +1 -0
  401. package/dist/theme/palette/colors/types.js +15 -0
  402. package/dist/theme/palette/colors/types.js.map +1 -0
  403. package/dist/theme/palette/error.d.ts +3 -0
  404. package/dist/theme/palette/error.d.ts.map +1 -0
  405. package/dist/theme/palette/error.js +26 -0
  406. package/dist/theme/palette/error.js.map +1 -0
  407. package/dist/theme/palette/grey.d.ts +3 -0
  408. package/dist/theme/palette/grey.d.ts.map +1 -0
  409. package/dist/theme/palette/grey.js +38 -0
  410. package/dist/theme/palette/grey.js.map +1 -0
  411. package/dist/theme/palette/index.d.ts +3 -0
  412. package/dist/theme/palette/index.d.ts.map +1 -0
  413. package/dist/theme/palette/index.js +15 -0
  414. package/dist/theme/palette/index.js.map +1 -0
  415. package/dist/theme/palette/palette-options.d.ts +6 -0
  416. package/dist/theme/palette/palette-options.d.ts.map +1 -0
  417. package/dist/theme/palette/palette-options.js +55 -0
  418. package/dist/theme/palette/palette-options.js.map +1 -0
  419. package/dist/theme/palette/primary.d.ts +3 -0
  420. package/dist/theme/palette/primary.d.ts.map +1 -0
  421. package/dist/theme/palette/primary.js +26 -0
  422. package/dist/theme/palette/primary.js.map +1 -0
  423. package/dist/theme/palette/secondary.d.ts +3 -0
  424. package/dist/theme/palette/secondary.d.ts.map +1 -0
  425. package/dist/theme/palette/secondary.js +26 -0
  426. package/dist/theme/palette/secondary.js.map +1 -0
  427. package/dist/theme/palette/success.d.ts +3 -0
  428. package/dist/theme/palette/success.d.ts.map +1 -0
  429. package/dist/theme/palette/success.js +26 -0
  430. package/dist/theme/palette/success.js.map +1 -0
  431. package/dist/theme/palette/text.d.ts +3 -0
  432. package/dist/theme/palette/text.d.ts.map +1 -0
  433. package/dist/theme/palette/text.js +36 -0
  434. package/dist/theme/palette/text.js.map +1 -0
  435. package/dist/theme/palette/warning.d.ts +3 -0
  436. package/dist/theme/palette/warning.d.ts.map +1 -0
  437. package/dist/theme/palette/warning.js +26 -0
  438. package/dist/theme/palette/warning.js.map +1 -0
  439. package/dist/theme/theme.d.ts +13 -0
  440. package/dist/theme/theme.d.ts.map +1 -0
  441. package/dist/theme/theme.js +67 -0
  442. package/dist/theme/theme.js.map +1 -0
  443. package/dist/theme/types/ThemeExtension.d.js +16 -0
  444. package/dist/theme/types/ThemeExtension.d.js.map +1 -0
  445. package/dist/theme/typography.d.ts +10 -0
  446. package/dist/theme/typography.d.ts.map +1 -0
  447. package/dist/theme/typography.js +92 -0
  448. package/dist/theme/typography.js.map +1 -0
  449. package/dist/utils/combine-sx.d.ts +8 -0
  450. package/dist/utils/combine-sx.d.ts.map +1 -0
  451. package/dist/utils/combine-sx.js +27 -0
  452. package/dist/utils/combine-sx.js.map +1 -0
  453. package/dist/utils/component-ids.d.ts +8 -0
  454. package/dist/utils/component-ids.d.ts.map +1 -0
  455. package/dist/utils/component-ids.js +27 -0
  456. package/dist/utils/component-ids.js.map +1 -0
  457. package/dist/utils/format.d.ts +3 -0
  458. package/dist/utils/format.d.ts.map +1 -0
  459. package/dist/utils/format.js +44 -0
  460. package/dist/utils/format.js.map +1 -0
  461. package/dist/utils/format.test.d.ts +2 -0
  462. package/dist/utils/format.test.d.ts.map +1 -0
  463. package/dist/utils/format.test.js +45 -0
  464. package/dist/utils/format.test.js.map +1 -0
  465. package/dist/utils/index.d.ts +5 -0
  466. package/dist/utils/index.d.ts.map +1 -0
  467. package/dist/utils/index.js +18 -0
  468. package/dist/utils/index.js.map +1 -0
  469. package/dist/utils/mathjs.d.ts +6 -0
  470. package/dist/utils/mathjs.d.ts.map +1 -0
  471. package/dist/utils/mathjs.js +20 -0
  472. package/dist/utils/mathjs.js.map +1 -0
  473. package/dist/utils/theme-gen.d.ts +6 -0
  474. package/dist/utils/theme-gen.d.ts.map +1 -0
  475. package/dist/utils/theme-gen.js +182 -0
  476. package/dist/utils/theme-gen.js.map +1 -0
  477. package/dist/utils/theme-gen.test.d.ts +2 -0
  478. package/dist/utils/theme-gen.test.d.ts.map +1 -0
  479. package/dist/utils/theme-gen.test.js +195 -0
  480. package/dist/utils/theme-gen.test.js.map +1 -0
  481. package/package.json +54 -0
@@ -0,0 +1,44 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "greyOption", {
18
+ enumerable: true,
19
+ get: ()=>greyOption
20
+ });
21
+ const _grey = require("./colors/grey");
22
+ const greyOption = (mode)=>{
23
+ return mode === 'light' ? {
24
+ 100: _grey.grey[100],
25
+ 200: _grey.grey[200],
26
+ 300: _grey.grey[300],
27
+ 400: _grey.grey[400],
28
+ 500: _grey.grey[500],
29
+ 600: _grey.grey[600],
30
+ 700: _grey.grey[700],
31
+ 800: _grey.grey[800],
32
+ 900: _grey.grey[900]
33
+ } : {
34
+ 100: _grey.grey[900],
35
+ 200: _grey.grey[800],
36
+ 300: _grey.grey[700],
37
+ 400: _grey.grey[600],
38
+ 500: _grey.grey[500],
39
+ 600: _grey.grey[400],
40
+ 700: _grey.grey[300],
41
+ 800: _grey.grey[200],
42
+ 900: _grey.grey[100]
43
+ };
44
+ };
@@ -0,0 +1,28 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ _exportStar(require("./palette-options"), exports);
18
+ function _exportStar(from, to) {
19
+ Object.keys(from).forEach(function(k) {
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
+ enumerable: true,
22
+ get: function() {
23
+ return from[k];
24
+ }
25
+ });
26
+ });
27
+ return from;
28
+ }
@@ -0,0 +1,59 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "getPaletteOptions", {
18
+ enumerable: true,
19
+ get: ()=>getPaletteOptions
20
+ });
21
+ const _text = require("./text");
22
+ const _background = require("./background");
23
+ const _grey = require("./grey");
24
+ const _common = require("./colors/common");
25
+ const _primary = require("./primary");
26
+ const _secondary = require("./secondary");
27
+ const _colors = require("./colors");
28
+ const _error = require("./error");
29
+ const _success = require("./success");
30
+ const _warning = require("./warning");
31
+ function getPaletteOptions(mode) {
32
+ // Palette options should be split out into their own files with functions
33
+ // for creating the option values based on light/dark mode
34
+ return {
35
+ mode,
36
+ primary: (0, _primary.primary)(mode),
37
+ secondary: (0, _secondary.secondary)(mode),
38
+ grey: (0, _grey.greyOption)(mode),
39
+ background: (0, _background.background)(mode),
40
+ text: (0, _text.text)(mode),
41
+ error: (0, _error.error)(mode),
42
+ warning: (0, _warning.warning)(mode),
43
+ info: (0, _primary.primary)(mode),
44
+ success: (0, _success.success)(mode),
45
+ common: {
46
+ white: _common.white,
47
+ black: _common.black
48
+ },
49
+ // custom colors
50
+ designSystem: {
51
+ blue: _colors.blue,
52
+ green: _colors.green,
53
+ grey: _colors.grey,
54
+ orange: _colors.orange,
55
+ purple: _colors.purple,
56
+ red: _colors.red
57
+ }
58
+ };
59
+ }
@@ -0,0 +1,32 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "primary", {
18
+ enumerable: true,
19
+ get: ()=>primary
20
+ });
21
+ const _colors = require("./colors");
22
+ const primary = (mode)=>{
23
+ return mode === 'light' ? {
24
+ main: _colors.blue[500],
25
+ dark: _colors.blue[600],
26
+ light: _colors.blue[50]
27
+ } : {
28
+ main: _colors.blue[400],
29
+ dark: _colors.blue[800],
30
+ light: _colors.blue[200]
31
+ };
32
+ };
@@ -0,0 +1,32 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "secondary", {
18
+ enumerable: true,
19
+ get: ()=>secondary
20
+ });
21
+ const _colors = require("./colors");
22
+ const secondary = (mode)=>{
23
+ return mode === 'light' ? {
24
+ main: _colors.grey[600],
25
+ dark: _colors.grey[900],
26
+ light: _colors.grey[100]
27
+ } : {
28
+ main: _colors.white,
29
+ dark: _colors.white,
30
+ light: _colors.white
31
+ };
32
+ };
@@ -0,0 +1,32 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "success", {
18
+ enumerable: true,
19
+ get: ()=>success
20
+ });
21
+ const _colors = require("./colors");
22
+ const success = (mode)=>{
23
+ return mode === 'light' ? {
24
+ main: _colors.green[500],
25
+ dark: _colors.green[700],
26
+ light: _colors.green[50]
27
+ } : {
28
+ main: _colors.green[400],
29
+ dark: _colors.green[800],
30
+ light: _colors.green[300]
31
+ };
32
+ };
@@ -0,0 +1,42 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "text", {
18
+ enumerable: true,
19
+ get: ()=>text
20
+ });
21
+ const _colors = require("./colors");
22
+ const text = (mode)=>{
23
+ const navigation = _colors.grey[800];
24
+ const accent = _colors.grey[300];
25
+ return mode === 'light' ? {
26
+ navigation,
27
+ accent,
28
+ primary: _colors.grey[800],
29
+ secondary: _colors.grey[700],
30
+ disabled: _colors.grey[300],
31
+ link: _colors.blue[500],
32
+ linkHover: _colors.blue[600]
33
+ } : {
34
+ navigation,
35
+ accent,
36
+ primary: _colors.white,
37
+ secondary: _colors.grey[50],
38
+ disabled: _colors.grey[600],
39
+ link: _colors.blue[400],
40
+ linkHover: _colors.blue[500]
41
+ };
42
+ };
@@ -0,0 +1,32 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "warning", {
18
+ enumerable: true,
19
+ get: ()=>warning
20
+ });
21
+ const _colors = require("./colors");
22
+ const warning = (mode)=>{
23
+ return mode === 'light' ? {
24
+ main: _colors.orange[500],
25
+ dark: _colors.orange[700],
26
+ light: _colors.orange[50]
27
+ } : {
28
+ main: _colors.orange[400],
29
+ dark: _colors.orange[800],
30
+ light: _colors.orange[300]
31
+ };
32
+ };
@@ -0,0 +1,64 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "getTheme", {
18
+ enumerable: true,
19
+ get: ()=>getTheme
20
+ });
21
+ const _material = require("@mui/material");
22
+ const _paletteOptions = require("./palette/palette-options");
23
+ const _typography = require("./typography");
24
+ const getModalBackgroundStyle = ({ theme })=>{
25
+ const backgroundStyle = theme.palette.mode === 'light' ? {} : {
26
+ backgroundImage: 'unset',
27
+ backgroundColor: theme.palette.designSystem.grey[800]
28
+ };
29
+ return {
30
+ ...backgroundStyle
31
+ };
32
+ };
33
+ function getTheme(mode) {
34
+ const theme = (0, _material.createTheme)({
35
+ palette: (0, _paletteOptions.getPaletteOptions)(mode),
36
+ typography: _typography.typography,
37
+ mixins: {},
38
+ components
39
+ });
40
+ return theme;
41
+ }
42
+ // Overrides for component default prop values and styles go here
43
+ const components = {
44
+ MuiFormControl: {
45
+ defaultProps: {
46
+ size: 'small'
47
+ }
48
+ },
49
+ MuiTextField: {
50
+ defaultProps: {
51
+ size: 'small'
52
+ }
53
+ },
54
+ MuiDrawer: {
55
+ styleOverrides: {
56
+ paper: getModalBackgroundStyle
57
+ }
58
+ },
59
+ MuiDialog: {
60
+ styleOverrides: {
61
+ paper: getModalBackgroundStyle
62
+ }
63
+ }
64
+ };
@@ -0,0 +1,17 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ // Allows extending Lab types/components also
14
+ "use strict";
15
+ Object.defineProperty(exports, "__esModule", {
16
+ value: true
17
+ });
@@ -0,0 +1,96 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "typography", {
18
+ enumerable: true,
19
+ get: ()=>typography
20
+ });
21
+ require("@fontsource/lato/300.css");
22
+ require("@fontsource/lato/400.css");
23
+ require("@fontsource/lato/700.css");
24
+ require("@fontsource/lato/900.css");
25
+ // Font weights need to correspond with the imports at the top of the file
26
+ // (Lato supports 100, 300, 400, 700, 900)
27
+ const fontWeightLight = 300;
28
+ const fontWeightRegular = 400;
29
+ const fontWeightMedium = 700;
30
+ const fontWeightBold = 900;
31
+ const typography = {
32
+ fontFamily: '"Lato", sans-serif',
33
+ fontWeightLight,
34
+ fontWeightRegular,
35
+ fontWeightMedium,
36
+ fontWeightBold,
37
+ h1: {
38
+ fontSize: '1.5rem',
39
+ fontWeight: fontWeightMedium,
40
+ lineHeight: '32px'
41
+ },
42
+ h2: {
43
+ fontSize: '1.25rem',
44
+ fontWeight: fontWeightMedium,
45
+ lineHeight: '28px'
46
+ },
47
+ h3: {
48
+ fontSize: '1rem',
49
+ fontWeight: fontWeightMedium,
50
+ lineHeight: '24px'
51
+ },
52
+ h4: {
53
+ fontSize: '0.875rem',
54
+ fontWeight: fontWeightMedium,
55
+ lineHeight: '22px'
56
+ },
57
+ h5: undefined,
58
+ h6: undefined,
59
+ body1: {
60
+ fontSize: '0.875rem',
61
+ fontWeight: fontWeightRegular,
62
+ lineHeight: '20px'
63
+ },
64
+ body2: {
65
+ fontSize: '0.75rem',
66
+ fontWeight: fontWeightRegular,
67
+ lineHeight: '18px'
68
+ },
69
+ subtitle1: {
70
+ fontSize: '1rem',
71
+ fontWeight: fontWeightRegular,
72
+ lineHeight: '24px',
73
+ letterSpacing: '0.02rem'
74
+ },
75
+ subtitle2: {
76
+ fontSize: '0.875rem',
77
+ fontWeight: fontWeightMedium,
78
+ lineHeight: '22px',
79
+ letterSpacing: '0.03rem',
80
+ textTransform: 'uppercase'
81
+ },
82
+ button: {
83
+ // 14px
84
+ fontSize: '0.875rem',
85
+ fontWeight: fontWeightMedium,
86
+ // 20 px
87
+ lineHeight: '1.25rem',
88
+ textTransform: 'none',
89
+ letterSpacing: '0.03rem'
90
+ },
91
+ caption: {
92
+ fontSize: '0.6875rem',
93
+ fontWeight: fontWeightRegular,
94
+ lineHeight: '16px'
95
+ }
96
+ };
@@ -0,0 +1,29 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "combineSx", {
18
+ enumerable: true,
19
+ get: ()=>combineSx
20
+ });
21
+ function combineSx(...sxProps) {
22
+ return sxProps.flatMap((sx)=>{
23
+ if (sx === undefined) return [];
24
+ if (Array.isArray(sx)) return sx;
25
+ return [
26
+ sx
27
+ ];
28
+ });
29
+ }
@@ -0,0 +1,31 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "useId", {
18
+ enumerable: true,
19
+ get: ()=>useId
20
+ });
21
+ const _react = require("react");
22
+ function useId(prefix) {
23
+ if (globalThis.useIdValue === undefined) {
24
+ globalThis.useIdValue = 0;
25
+ }
26
+ const id = (0, _react.useRef)(undefined);
27
+ if (id.current === undefined) {
28
+ id.current = `${prefix}-${globalThis.useIdValue++}`;
29
+ }
30
+ return id.current;
31
+ }
@@ -0,0 +1,56 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: all[name]
21
+ });
22
+ }
23
+ _export(exports, {
24
+ dateFormatOptionsWithTimeZone: ()=>dateFormatOptionsWithTimeZone,
25
+ formatWithTimeZone: ()=>formatWithTimeZone
26
+ });
27
+ const _dateFnsTz = require("date-fns-tz");
28
+ const _dateFns = require("date-fns");
29
+ function dateFormatOptionsWithTimeZone(dateFormatOptions, timeZone) {
30
+ /*
31
+ * if timeZone is provided, and is not local|browser,
32
+ * then set timeZone option (recognize UTC regardless of uppercase/lowercase)
33
+ * otherwise, default to browser timeZone setting
34
+ */ if (timeZone) {
35
+ const lowerTimeZone = timeZone.toLowerCase();
36
+ if (lowerTimeZone !== 'local' && lowerTimeZone !== 'browser') {
37
+ return {
38
+ ...dateFormatOptions,
39
+ timeZone: lowerTimeZone === 'utc' ? 'UTC' : timeZone
40
+ };
41
+ }
42
+ }
43
+ return dateFormatOptions;
44
+ }
45
+ function formatWithTimeZone(date, formatString, timeZone) {
46
+ /*
47
+ * if timeZone is provided, and is not local|browser,
48
+ * then format using timeZone option (recognize UTC regardless of uppercase/lowercase)
49
+ * otherwise, format without timeZone option, defaulting to browser timeZone setting
50
+ */ const lowerTimeZone = timeZone === null || timeZone === void 0 ? void 0 : timeZone.toLowerCase();
51
+ if (!timeZone || lowerTimeZone === 'local' || lowerTimeZone === 'browser') {
52
+ return (0, _dateFns.format)(date, formatString);
53
+ } else {
54
+ return (0, _dateFnsTz.formatInTimeZone)(date, lowerTimeZone === 'utc' ? 'UTC' : timeZone, formatString);
55
+ }
56
+ }
@@ -0,0 +1,47 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ const _format = require("./format");
18
+ const DATE = new Date(168523200000);
19
+ const DATE_FORMAT_OPTIONS = {
20
+ hour: 'numeric',
21
+ minute: 'numeric',
22
+ hourCycle: 'h23'
23
+ };
24
+ describe('formatWithTimeZone', ()=>{
25
+ it('should format in Los Angeles timezone', ()=>{
26
+ expect((0, _format.formatWithTimeZone)(DATE, 'yyyy-MM-dd HH:mm:ss', 'America/Los_Angeles')).toBe('1975-05-05 05:00:00');
27
+ });
28
+ it('should format in UTC timezone', ()=>{
29
+ expect((0, _format.formatWithTimeZone)(DATE, 'yyyy-MM-dd HH:mm:ss', 'UTC')).toBe('1975-05-05 12:00:00');
30
+ expect((0, _format.formatWithTimeZone)(DATE, 'yyyy-MM-dd HH:mm:ss', 'utc')).toBe('1975-05-05 12:00:00');
31
+ });
32
+ });
33
+ describe('dateFormatOptionsWithTimeZone', ()=>{
34
+ it('should format in Los Angeles timezone', ()=>{
35
+ const dateFormatOptions = (0, _format.dateFormatOptionsWithTimeZone)(DATE_FORMAT_OPTIONS, 'America/Los_Angeles');
36
+ expect(new Intl.DateTimeFormat(undefined, dateFormatOptions).format(DATE)).toBe('05:00');
37
+ });
38
+ it('should format in UTC timezone', ()=>{
39
+ const dateFormatOptions = (0, _format.dateFormatOptionsWithTimeZone)(DATE_FORMAT_OPTIONS, 'utc');
40
+ expect(new Intl.DateTimeFormat(undefined, dateFormatOptions).format(DATE)).toBe('12:00');
41
+ });
42
+ it('should use browser local timezone', ()=>{
43
+ expect((0, _format.dateFormatOptionsWithTimeZone)(DATE_FORMAT_OPTIONS, 'browser').timeZone).toBeUndefined();
44
+ expect((0, _format.dateFormatOptionsWithTimeZone)(DATE_FORMAT_OPTIONS, 'local').timeZone).toBeUndefined();
45
+ expect((0, _format.dateFormatOptionsWithTimeZone)(DATE_FORMAT_OPTIONS).timeZone).toBeUndefined();
46
+ });
47
+ });