@perses-dev/components 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/InfoTooltip/InfoTooltip.js +2 -2
  2. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  3. package/dist/JSONEditor.d.ts +1 -1
  4. package/dist/JSONEditor.d.ts.map +1 -1
  5. package/dist/JSONEditor.js +4 -1
  6. package/dist/JSONEditor.js.map +1 -1
  7. package/dist/Legend/CompactLegend.js +9 -2
  8. package/dist/Legend/CompactLegend.js.map +1 -1
  9. package/dist/Legend/ListLegendItem.d.ts.map +1 -1
  10. package/dist/Legend/ListLegendItem.js +0 -1
  11. package/dist/Legend/ListLegendItem.js.map +1 -1
  12. package/dist/LineChart/LineChart.d.ts +3 -2
  13. package/dist/LineChart/LineChart.d.ts.map +1 -1
  14. package/dist/LineChart/LineChart.js +4 -15
  15. package/dist/LineChart/LineChart.js.map +1 -1
  16. package/dist/LineChart/utils.d.ts +18 -0
  17. package/dist/LineChart/utils.d.ts.map +1 -1
  18. package/dist/LineChart/utils.js +35 -9
  19. package/dist/LineChart/utils.js.map +1 -1
  20. package/dist/YAxisLabel.d.ts +8 -0
  21. package/dist/YAxisLabel.d.ts.map +1 -0
  22. package/dist/YAxisLabel.js +39 -0
  23. package/dist/YAxisLabel.js.map +1 -0
  24. package/dist/cjs/InfoTooltip/InfoTooltip.js +2 -2
  25. package/dist/cjs/JSONEditor.js +4 -1
  26. package/dist/cjs/Legend/CompactLegend.js +9 -2
  27. package/dist/cjs/Legend/ListLegendItem.js +0 -1
  28. package/dist/cjs/LineChart/LineChart.js +3 -14
  29. package/dist/cjs/LineChart/utils.js +23 -1
  30. package/dist/cjs/YAxisLabel.js +45 -0
  31. package/dist/cjs/index.js +2 -0
  32. package/dist/cjs/theme/index.js +28 -0
  33. package/dist/cjs/theme/palette/background.js +40 -0
  34. package/dist/cjs/theme/palette/colors/blue.js +35 -0
  35. package/dist/cjs/theme/palette/colors/common.js +28 -0
  36. package/dist/cjs/theme/palette/colors/green.js +35 -0
  37. package/dist/cjs/theme/palette/colors/grey.js +35 -0
  38. package/dist/cjs/theme/palette/colors/index.js +35 -0
  39. package/dist/cjs/theme/palette/colors/orange.js +35 -0
  40. package/dist/cjs/theme/palette/colors/purple.js +35 -0
  41. package/dist/cjs/theme/palette/colors/red.js +35 -0
  42. package/dist/cjs/theme/palette/colors/types.js +16 -0
  43. package/dist/cjs/theme/palette/error.js +32 -0
  44. package/dist/cjs/theme/palette/grey.js +44 -0
  45. package/dist/cjs/theme/palette/index.js +28 -0
  46. package/dist/cjs/theme/palette/palette-options.js +59 -0
  47. package/dist/cjs/theme/palette/primary.js +32 -0
  48. package/dist/cjs/theme/palette/secondary.js +32 -0
  49. package/dist/cjs/theme/palette/success.js +32 -0
  50. package/dist/cjs/theme/palette/text.js +42 -0
  51. package/dist/cjs/theme/palette/warning.js +32 -0
  52. package/dist/cjs/theme/theme.js +45 -0
  53. package/dist/cjs/theme/types/ThemeExtension.d.js +17 -0
  54. package/dist/cjs/theme/typography.js +96 -0
  55. package/dist/index.d.ts +2 -0
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +2 -0
  58. package/dist/index.js.map +1 -1
  59. package/dist/theme/index.d.ts +37 -0
  60. package/dist/theme/index.d.ts.map +1 -0
  61. package/dist/theme/index.js +15 -0
  62. package/dist/theme/index.js.map +1 -0
  63. package/dist/theme/palette/background.d.ts +3 -0
  64. package/dist/theme/palette/background.d.ts.map +1 -0
  65. package/dist/theme/palette/background.js +34 -0
  66. package/dist/theme/palette/background.js.map +1 -0
  67. package/dist/theme/palette/colors/blue.d.ts +3 -0
  68. package/dist/theme/palette/colors/blue.d.ts.map +1 -0
  69. package/dist/theme/palette/colors/blue.js +29 -0
  70. package/dist/theme/palette/colors/blue.js.map +1 -0
  71. package/dist/theme/palette/colors/common.d.ts +3 -0
  72. package/dist/theme/palette/colors/common.d.ts.map +1 -0
  73. package/dist/theme/palette/colors/common.js +16 -0
  74. package/dist/theme/palette/colors/common.js.map +1 -0
  75. package/dist/theme/palette/colors/green.d.ts +3 -0
  76. package/dist/theme/palette/colors/green.d.ts.map +1 -0
  77. package/dist/theme/palette/colors/green.js +29 -0
  78. package/dist/theme/palette/colors/green.js.map +1 -0
  79. package/dist/theme/palette/colors/grey.d.ts +3 -0
  80. package/dist/theme/palette/colors/grey.d.ts.map +1 -0
  81. package/dist/theme/palette/colors/grey.js +29 -0
  82. package/dist/theme/palette/colors/grey.js.map +1 -0
  83. package/dist/theme/palette/colors/index.d.ts +9 -0
  84. package/dist/theme/palette/colors/index.d.ts.map +1 -0
  85. package/dist/theme/palette/colors/index.js +22 -0
  86. package/dist/theme/palette/colors/index.js.map +1 -0
  87. package/dist/theme/palette/colors/orange.d.ts +3 -0
  88. package/dist/theme/palette/colors/orange.d.ts.map +1 -0
  89. package/dist/theme/palette/colors/orange.js +29 -0
  90. package/dist/theme/palette/colors/orange.js.map +1 -0
  91. package/dist/theme/palette/colors/purple.d.ts +3 -0
  92. package/dist/theme/palette/colors/purple.d.ts.map +1 -0
  93. package/dist/theme/palette/colors/purple.js +29 -0
  94. package/dist/theme/palette/colors/purple.js.map +1 -0
  95. package/dist/theme/palette/colors/red.d.ts +3 -0
  96. package/dist/theme/palette/colors/red.d.ts.map +1 -0
  97. package/dist/theme/palette/colors/red.js +29 -0
  98. package/dist/theme/palette/colors/red.js.map +1 -0
  99. package/dist/theme/palette/colors/types.d.ts +17 -0
  100. package/dist/theme/palette/colors/types.d.ts.map +1 -0
  101. package/dist/theme/palette/colors/types.js +15 -0
  102. package/dist/theme/palette/colors/types.js.map +1 -0
  103. package/dist/theme/palette/error.d.ts +3 -0
  104. package/dist/theme/palette/error.d.ts.map +1 -0
  105. package/dist/theme/palette/error.js +26 -0
  106. package/dist/theme/palette/error.js.map +1 -0
  107. package/dist/theme/palette/grey.d.ts +3 -0
  108. package/dist/theme/palette/grey.d.ts.map +1 -0
  109. package/dist/theme/palette/grey.js +38 -0
  110. package/dist/theme/palette/grey.js.map +1 -0
  111. package/dist/theme/palette/index.d.ts +3 -0
  112. package/dist/theme/palette/index.d.ts.map +1 -0
  113. package/dist/theme/palette/index.js +15 -0
  114. package/dist/theme/palette/index.js.map +1 -0
  115. package/dist/theme/palette/palette-options.d.ts +6 -0
  116. package/dist/theme/palette/palette-options.d.ts.map +1 -0
  117. package/dist/theme/palette/palette-options.js +55 -0
  118. package/dist/theme/palette/palette-options.js.map +1 -0
  119. package/dist/theme/palette/primary.d.ts +3 -0
  120. package/dist/theme/palette/primary.d.ts.map +1 -0
  121. package/dist/theme/palette/primary.js +26 -0
  122. package/dist/theme/palette/primary.js.map +1 -0
  123. package/dist/theme/palette/secondary.d.ts +3 -0
  124. package/dist/theme/palette/secondary.d.ts.map +1 -0
  125. package/dist/theme/palette/secondary.js +26 -0
  126. package/dist/theme/palette/secondary.js.map +1 -0
  127. package/dist/theme/palette/success.d.ts +3 -0
  128. package/dist/theme/palette/success.d.ts.map +1 -0
  129. package/dist/theme/palette/success.js +26 -0
  130. package/dist/theme/palette/success.js.map +1 -0
  131. package/dist/theme/palette/text.d.ts +3 -0
  132. package/dist/theme/palette/text.d.ts.map +1 -0
  133. package/dist/theme/palette/text.js +36 -0
  134. package/dist/theme/palette/text.js.map +1 -0
  135. package/dist/theme/palette/warning.d.ts +3 -0
  136. package/dist/theme/palette/warning.d.ts.map +1 -0
  137. package/dist/theme/palette/warning.js +26 -0
  138. package/dist/theme/palette/warning.js.map +1 -0
  139. package/dist/theme/theme.d.ts +13 -0
  140. package/dist/theme/theme.d.ts.map +1 -0
  141. package/dist/theme/theme.js +48 -0
  142. package/dist/theme/theme.js.map +1 -0
  143. package/dist/theme/types/ThemeExtension.d.js +16 -0
  144. package/dist/theme/types/ThemeExtension.d.js.map +1 -0
  145. package/dist/theme/typography.d.ts +10 -0
  146. package/dist/theme/typography.d.ts.map +1 -0
  147. package/dist/theme/typography.js +92 -0
  148. package/dist/theme/typography.js.map +1 -0
  149. package/package.json +4 -3
@@ -0,0 +1,26 @@
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
+ import { green } from './colors';
14
+ export const success = (mode)=>{
15
+ return mode === 'light' ? {
16
+ main: green[500],
17
+ dark: green[700],
18
+ light: green[50]
19
+ } : {
20
+ main: green[400],
21
+ dark: green[800],
22
+ light: green[300]
23
+ };
24
+ };
25
+
26
+ //# sourceMappingURL=success.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/theme/palette/success.ts"],"sourcesContent":["// Copyright 2022 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PaletteMode, SimplePaletteColorOptions } from '@mui/material';\nimport { green } from './colors';\n\nexport const success = (mode: PaletteMode): SimplePaletteColorOptions => {\n return mode === 'light'\n ? {\n main: green[500],\n dark: green[700],\n light: green[50],\n }\n : {\n main: green[400],\n dark: green[800],\n light: green[300],\n };\n};\n"],"names":["green","success","mode","main","dark","light"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,KAAK,QAAQ,UAAU,CAAC;AAEjC,OAAO,MAAMC,OAAO,GAAG,CAACC,IAAiB,GAAgC;IACvE,OAAOA,IAAI,KAAK,OAAO,GACnB;QACEC,IAAI,EAAEH,KAAK,CAAC,GAAG,CAAC;QAChBI,IAAI,EAAEJ,KAAK,CAAC,GAAG,CAAC;QAChBK,KAAK,EAAEL,KAAK,CAAC,EAAE,CAAC;KACjB,GACD;QACEG,IAAI,EAAEH,KAAK,CAAC,GAAG,CAAC;QAChBI,IAAI,EAAEJ,KAAK,CAAC,GAAG,CAAC;QAChBK,KAAK,EAAEL,KAAK,CAAC,GAAG,CAAC;KAClB,CAAC;AACR,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { PaletteOptions, PaletteMode } from '@mui/material';
2
+ export declare const text: (mode: PaletteMode) => PaletteOptions['text'];
3
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/theme/palette/text.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5D,eAAO,MAAM,IAAI,SAAU,WAAW,KAAG,cAAc,CAAC,MAAM,CAsB7D,CAAC"}
@@ -0,0 +1,36 @@
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
+ import { grey, white, blue } from './colors';
14
+ export const text = (mode)=>{
15
+ const navigation = grey[800];
16
+ const accent = grey[300];
17
+ return mode === 'light' ? {
18
+ navigation,
19
+ accent,
20
+ primary: grey[800],
21
+ secondary: grey[700],
22
+ disabled: grey[300],
23
+ link: blue[500],
24
+ linkHover: blue[600]
25
+ } : {
26
+ navigation,
27
+ accent,
28
+ primary: white,
29
+ secondary: grey[50],
30
+ disabled: grey[600],
31
+ link: blue[400],
32
+ linkHover: blue[500]
33
+ };
34
+ };
35
+
36
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/theme/palette/text.ts"],"sourcesContent":["// Copyright 2022 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PaletteOptions, PaletteMode } from '@mui/material';\nimport { grey, white, blue } from './colors';\n\nexport const text = (mode: PaletteMode): PaletteOptions['text'] => {\n const navigation = grey[800];\n const accent = grey[300];\n return mode === 'light'\n ? {\n navigation,\n accent,\n primary: grey[800],\n secondary: grey[700],\n disabled: grey[300],\n link: blue[500],\n linkHover: blue[600],\n }\n : {\n navigation,\n accent,\n primary: white,\n secondary: grey[50],\n disabled: grey[600],\n link: blue[400],\n linkHover: blue[500],\n };\n};\n"],"names":["grey","white","blue","text","mode","navigation","accent","primary","secondary","disabled","link","linkHover"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,IAAI,EAAEC,KAAK,EAAEC,IAAI,QAAQ,UAAU,CAAC;AAE7C,OAAO,MAAMC,IAAI,GAAG,CAACC,IAAiB,GAA6B;IACjE,MAAMC,UAAU,GAAGL,IAAI,CAAC,GAAG,CAAC,AAAC;IAC7B,MAAMM,MAAM,GAAGN,IAAI,CAAC,GAAG,CAAC,AAAC;IACzB,OAAOI,IAAI,KAAK,OAAO,GACnB;QACEC,UAAU;QACVC,MAAM;QACNC,OAAO,EAAEP,IAAI,CAAC,GAAG,CAAC;QAClBQ,SAAS,EAAER,IAAI,CAAC,GAAG,CAAC;QACpBS,QAAQ,EAAET,IAAI,CAAC,GAAG,CAAC;QACnBU,IAAI,EAAER,IAAI,CAAC,GAAG,CAAC;QACfS,SAAS,EAAET,IAAI,CAAC,GAAG,CAAC;KACrB,GACD;QACEG,UAAU;QACVC,MAAM;QACNC,OAAO,EAAEN,KAAK;QACdO,SAAS,EAAER,IAAI,CAAC,EAAE,CAAC;QACnBS,QAAQ,EAAET,IAAI,CAAC,GAAG,CAAC;QACnBU,IAAI,EAAER,IAAI,CAAC,GAAG,CAAC;QACfS,SAAS,EAAET,IAAI,CAAC,GAAG,CAAC;KACrB,CAAC;AACR,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { PaletteMode, SimplePaletteColorOptions } from '@mui/material';
2
+ export declare const warning: (mode: PaletteMode) => SimplePaletteColorOptions;
3
+ //# sourceMappingURL=warning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../../src/theme/palette/warning.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAGvE,eAAO,MAAM,OAAO,SAAU,WAAW,KAAG,yBAY3C,CAAC"}
@@ -0,0 +1,26 @@
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
+ import { orange } from './colors';
14
+ export const warning = (mode)=>{
15
+ return mode === 'light' ? {
16
+ main: orange[500],
17
+ dark: orange[700],
18
+ light: orange[50]
19
+ } : {
20
+ main: orange[400],
21
+ dark: orange[800],
22
+ light: orange[300]
23
+ };
24
+ };
25
+
26
+ //# sourceMappingURL=warning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/theme/palette/warning.ts"],"sourcesContent":["// Copyright 2022 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PaletteMode, SimplePaletteColorOptions } from '@mui/material';\nimport { orange } from './colors';\n\nexport const warning = (mode: PaletteMode): SimplePaletteColorOptions => {\n return mode === 'light'\n ? {\n main: orange[500],\n dark: orange[700],\n light: orange[50],\n }\n : {\n main: orange[400],\n dark: orange[800],\n light: orange[300],\n };\n};\n"],"names":["orange","warning","mode","main","dark","light"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,MAAM,QAAQ,UAAU,CAAC;AAElC,OAAO,MAAMC,OAAO,GAAG,CAACC,IAAiB,GAAgC;IACvE,OAAOA,IAAI,KAAK,OAAO,GACnB;QACEC,IAAI,EAAEH,MAAM,CAAC,GAAG,CAAC;QACjBI,IAAI,EAAEJ,MAAM,CAAC,GAAG,CAAC;QACjBK,KAAK,EAAEL,MAAM,CAAC,EAAE,CAAC;KAClB,GACD;QACEG,IAAI,EAAEH,MAAM,CAAC,GAAG,CAAC;QACjBI,IAAI,EAAEJ,MAAM,CAAC,GAAG,CAAC;QACjBK,KAAK,EAAEL,MAAM,CAAC,GAAG,CAAC;KACnB,CAAC;AACR,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { PaletteMode } from '@mui/material';
2
+ /**
3
+ * Gets theme used by all components for the provided mode. For more details, see:
4
+ * - Base colors, typography, sizing - go/chrono-ui-theme
5
+ * - Material UI defaults: https://material-ui.com/customization/default-theme/
6
+ * - Material UI variables: https://material-ui.com/customization/theming/#theme-configuration-variables
7
+ * - Material UI global overrides and default props: https://material-ui.com/customization/globals/#css
8
+ *
9
+ * Need to reinstantiate the theme everytime to support switching between light and dark themes
10
+ * https://github.com/mui-org/material-ui/issues/18831
11
+ */
12
+ export declare function getTheme(mode: PaletteMode): import("@mui/material").Theme;
13
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAaA,OAAO,EAAe,WAAW,EAAgB,MAAM,eAAe,CAAC;AAIvE;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,iCAQzC"}
@@ -0,0 +1,48 @@
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
+ import { createTheme } from '@mui/material';
14
+ import { getPaletteOptions } from './palette/palette-options';
15
+ import { typography } from './typography';
16
+ /**
17
+ * Gets theme used by all components for the provided mode. For more details, see:
18
+ * - Base colors, typography, sizing - go/chrono-ui-theme
19
+ * - Material UI defaults: https://material-ui.com/customization/default-theme/
20
+ * - Material UI variables: https://material-ui.com/customization/theming/#theme-configuration-variables
21
+ * - Material UI global overrides and default props: https://material-ui.com/customization/globals/#css
22
+ *
23
+ * Need to reinstantiate the theme everytime to support switching between light and dark themes
24
+ * https://github.com/mui-org/material-ui/issues/18831
25
+ */ export function getTheme(mode) {
26
+ const theme = createTheme({
27
+ palette: getPaletteOptions(mode),
28
+ typography,
29
+ mixins: {},
30
+ components
31
+ });
32
+ return theme;
33
+ }
34
+ // Overrides for component default prop values and styles go here
35
+ const components = {
36
+ MuiFormControl: {
37
+ defaultProps: {
38
+ size: 'small'
39
+ }
40
+ },
41
+ MuiTextField: {
42
+ defaultProps: {
43
+ size: 'small'
44
+ }
45
+ }
46
+ };
47
+
48
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/theme/theme.ts"],"sourcesContent":["// Copyright 2022 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createTheme, PaletteMode, ThemeOptions } from '@mui/material';\nimport { getPaletteOptions } from './palette/palette-options';\nimport { typography } from './typography';\n\n/**\n * Gets theme used by all components for the provided mode. For more details, see:\n * - Base colors, typography, sizing - go/chrono-ui-theme\n * - Material UI defaults: https://material-ui.com/customization/default-theme/\n * - Material UI variables: https://material-ui.com/customization/theming/#theme-configuration-variables\n * - Material UI global overrides and default props: https://material-ui.com/customization/globals/#css\n *\n * Need to reinstantiate the theme everytime to support switching between light and dark themes\n * https://github.com/mui-org/material-ui/issues/18831\n */\nexport function getTheme(mode: PaletteMode) {\n const theme = createTheme({\n palette: getPaletteOptions(mode),\n typography,\n mixins: {},\n components,\n });\n return theme;\n}\n\n// Overrides for component default prop values and styles go here\nconst components: ThemeOptions['components'] = {\n MuiFormControl: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiTextField: {\n defaultProps: {\n size: 'small',\n },\n },\n};\n"],"names":["createTheme","getPaletteOptions","typography","getTheme","mode","theme","palette","mixins","components","MuiFormControl","defaultProps","size","MuiTextField"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,QAAmC,eAAe,CAAC;AACvE,SAASC,iBAAiB,QAAQ,2BAA2B,CAAC;AAC9D,SAASC,UAAU,QAAQ,cAAc,CAAC;AAE1C;;;;;;;;;CASC,GACD,OAAO,SAASC,QAAQ,CAACC,IAAiB,EAAE;IAC1C,MAAMC,KAAK,GAAGL,WAAW,CAAC;QACxBM,OAAO,EAAEL,iBAAiB,CAACG,IAAI,CAAC;QAChCF,UAAU;QACVK,MAAM,EAAE,EAAE;QACVC,UAAU;KACX,CAAC,AAAC;IACH,OAAOH,KAAK,CAAC;AACf,CAAC;AAED,iEAAiE;AACjE,MAAMG,UAAU,GAA+B;IAC7CC,cAAc,EAAE;QACdC,YAAY,EAAE;YACZC,IAAI,EAAE,OAAO;SACd;KACF;IACDC,YAAY,EAAE;QACZF,YAAY,EAAE;YACZC,IAAI,EAAE,OAAO;SACd;KACF;CACF,AAAC"}
@@ -0,0 +1,16 @@
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
+ export { };
15
+
16
+ //# sourceMappingURL=ThemeExtension.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/theme/types/ThemeExtension.d.ts"],"sourcesContent":["// Copyright 2022 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Allows extending Lab types/components also\nimport type {} from '@mui/lab/themeAugmentation';\n\n// Use Typescript interface augmentation to extend the MUI type definition\ndeclare module '@mui/material' {\n interface Color {\n 150: string;\n 250: string;\n 350: string;\n 450: string;\n 550: string;\n 650: string;\n 750: string;\n 850: string;\n 950: string;\n }\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,6CAA6C;AAC7C,WAeC"}
@@ -0,0 +1,10 @@
1
+ import '@fontsource/lato/300.css';
2
+ import '@fontsource/lato/400.css';
3
+ import '@fontsource/lato/700.css';
4
+ import '@fontsource/lato/900.css';
5
+ import { ThemeOptions } from '@mui/material';
6
+ /**
7
+ * Theme typography options that are the same across both the dark and light themes.
8
+ */
9
+ export declare const typography: ThemeOptions['typography'];
10
+ //# sourceMappingURL=typography.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/theme/typography.ts"],"names":[],"mappings":"AAaA,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAS7C;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,YAAY,CAqEjD,CAAC"}
@@ -0,0 +1,92 @@
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
+ import '@fontsource/lato/300.css';
14
+ import '@fontsource/lato/400.css';
15
+ import '@fontsource/lato/700.css';
16
+ import '@fontsource/lato/900.css';
17
+ // Font weights need to correspond with the imports at the top of the file
18
+ // (Lato supports 100, 300, 400, 700, 900)
19
+ const fontWeightLight = 300;
20
+ const fontWeightRegular = 400;
21
+ const fontWeightMedium = 700;
22
+ const fontWeightBold = 900;
23
+ /**
24
+ * Theme typography options that are the same across both the dark and light themes.
25
+ */ export const typography = {
26
+ fontFamily: '"Lato", sans-serif',
27
+ fontWeightLight,
28
+ fontWeightRegular,
29
+ fontWeightMedium,
30
+ fontWeightBold,
31
+ h1: {
32
+ fontSize: '1.5rem',
33
+ fontWeight: fontWeightMedium,
34
+ lineHeight: '32px'
35
+ },
36
+ h2: {
37
+ fontSize: '1.25rem',
38
+ fontWeight: fontWeightMedium,
39
+ lineHeight: '28px'
40
+ },
41
+ h3: {
42
+ fontSize: '1rem',
43
+ fontWeight: fontWeightMedium,
44
+ lineHeight: '24px'
45
+ },
46
+ h4: {
47
+ fontSize: '0.875rem',
48
+ fontWeight: fontWeightMedium,
49
+ lineHeight: '22px'
50
+ },
51
+ h5: undefined,
52
+ h6: undefined,
53
+ body1: {
54
+ fontSize: '0.875rem',
55
+ fontWeight: fontWeightRegular,
56
+ lineHeight: '20px'
57
+ },
58
+ body2: {
59
+ fontSize: '0.75rem',
60
+ fontWeight: fontWeightRegular,
61
+ lineHeight: '18px'
62
+ },
63
+ subtitle1: {
64
+ fontSize: '1rem',
65
+ fontWeight: fontWeightRegular,
66
+ lineHeight: '24px',
67
+ letterSpacing: '0.02rem'
68
+ },
69
+ subtitle2: {
70
+ fontSize: '0.875rem',
71
+ fontWeight: fontWeightMedium,
72
+ lineHeight: '22px',
73
+ letterSpacing: '0.03rem',
74
+ textTransform: 'uppercase'
75
+ },
76
+ button: {
77
+ // 14px
78
+ fontSize: '0.875rem',
79
+ fontWeight: fontWeightMedium,
80
+ // 20 px
81
+ lineHeight: '1.25rem',
82
+ textTransform: 'none',
83
+ letterSpacing: '0.03rem'
84
+ },
85
+ caption: {
86
+ fontSize: '0.6875rem',
87
+ fontWeight: fontWeightRegular,
88
+ lineHeight: '16px'
89
+ }
90
+ };
91
+
92
+ //# sourceMappingURL=typography.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/theme/typography.ts"],"sourcesContent":["// Copyright 2022 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport '@fontsource/lato/300.css';\nimport '@fontsource/lato/400.css';\nimport '@fontsource/lato/700.css';\nimport '@fontsource/lato/900.css';\nimport { ThemeOptions } from '@mui/material';\n\n// Font weights need to correspond with the imports at the top of the file\n// (Lato supports 100, 300, 400, 700, 900)\nconst fontWeightLight = 300;\nconst fontWeightRegular = 400;\nconst fontWeightMedium = 700;\nconst fontWeightBold = 900;\n\n/**\n * Theme typography options that are the same across both the dark and light themes.\n */\nexport const typography: ThemeOptions['typography'] = {\n fontFamily: '\"Lato\", sans-serif',\n\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold,\n\n h1: {\n fontSize: '1.5rem', // 24px\n fontWeight: fontWeightMedium,\n lineHeight: '32px',\n },\n h2: {\n fontSize: '1.25rem', // 20px\n fontWeight: fontWeightMedium,\n lineHeight: '28px',\n },\n h3: {\n fontSize: '1rem', // 16px\n fontWeight: fontWeightMedium,\n lineHeight: '24px',\n },\n h4: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightMedium,\n lineHeight: '22px',\n },\n h5: undefined,\n h6: undefined,\n\n body1: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightRegular,\n lineHeight: '20px',\n },\n body2: {\n fontSize: '0.75rem', // 12px\n fontWeight: fontWeightRegular,\n lineHeight: '18px',\n },\n subtitle1: {\n fontSize: '1rem', // 16px\n fontWeight: fontWeightRegular,\n lineHeight: '24px',\n letterSpacing: '0.02rem',\n },\n subtitle2: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightMedium,\n lineHeight: '22px',\n letterSpacing: '0.03rem',\n textTransform: 'uppercase',\n },\n\n button: {\n // 14px\n fontSize: '0.875rem',\n fontWeight: fontWeightMedium,\n // 20 px\n lineHeight: '1.25rem',\n textTransform: 'none',\n letterSpacing: '0.03rem',\n },\n caption: {\n fontSize: '0.6875rem', // 11px\n fontWeight: fontWeightRegular,\n lineHeight: '16px',\n },\n};\n"],"names":["fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","typography","fontFamily","h1","fontSize","fontWeight","lineHeight","h2","h3","h4","h5","undefined","h6","body1","body2","subtitle1","letterSpacing","subtitle2","textTransform","button","caption"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAGlC,0EAA0E;AAC1E,0CAA0C;AAC1C,MAAMA,eAAe,GAAG,GAAG,AAAC;AAC5B,MAAMC,iBAAiB,GAAG,GAAG,AAAC;AAC9B,MAAMC,gBAAgB,GAAG,GAAG,AAAC;AAC7B,MAAMC,cAAc,GAAG,GAAG,AAAC;AAE3B;;CAEC,GACD,OAAO,MAAMC,UAAU,GAA+B;IACpDC,UAAU,EAAE,oBAAoB;IAEhCL,eAAe;IACfC,iBAAiB;IACjBC,gBAAgB;IAChBC,cAAc;IAEdG,EAAE,EAAE;QACFC,QAAQ,EAAE,QAAQ;QAClBC,UAAU,EAAEN,gBAAgB;QAC5BO,UAAU,EAAE,MAAM;KACnB;IACDC,EAAE,EAAE;QACFH,QAAQ,EAAE,SAAS;QACnBC,UAAU,EAAEN,gBAAgB;QAC5BO,UAAU,EAAE,MAAM;KACnB;IACDE,EAAE,EAAE;QACFJ,QAAQ,EAAE,MAAM;QAChBC,UAAU,EAAEN,gBAAgB;QAC5BO,UAAU,EAAE,MAAM;KACnB;IACDG,EAAE,EAAE;QACFL,QAAQ,EAAE,UAAU;QACpBC,UAAU,EAAEN,gBAAgB;QAC5BO,UAAU,EAAE,MAAM;KACnB;IACDI,EAAE,EAAEC,SAAS;IACbC,EAAE,EAAED,SAAS;IAEbE,KAAK,EAAE;QACLT,QAAQ,EAAE,UAAU;QACpBC,UAAU,EAAEP,iBAAiB;QAC7BQ,UAAU,EAAE,MAAM;KACnB;IACDQ,KAAK,EAAE;QACLV,QAAQ,EAAE,SAAS;QACnBC,UAAU,EAAEP,iBAAiB;QAC7BQ,UAAU,EAAE,MAAM;KACnB;IACDS,SAAS,EAAE;QACTX,QAAQ,EAAE,MAAM;QAChBC,UAAU,EAAEP,iBAAiB;QAC7BQ,UAAU,EAAE,MAAM;QAClBU,aAAa,EAAE,SAAS;KACzB;IACDC,SAAS,EAAE;QACTb,QAAQ,EAAE,UAAU;QACpBC,UAAU,EAAEN,gBAAgB;QAC5BO,UAAU,EAAE,MAAM;QAClBU,aAAa,EAAE,SAAS;QACxBE,aAAa,EAAE,WAAW;KAC3B;IAEDC,MAAM,EAAE;QACN,OAAO;QACPf,QAAQ,EAAE,UAAU;QACpBC,UAAU,EAAEN,gBAAgB;QAC5B,QAAQ;QACRO,UAAU,EAAE,SAAS;QACrBY,aAAa,EAAE,MAAM;QACrBF,aAAa,EAAE,SAAS;KACzB;IACDI,OAAO,EAAE;QACPhB,QAAQ,EAAE,WAAW;QACrBC,UAAU,EAAEP,iBAAiB;QAC7BQ,UAAU,EAAE,MAAM;KACnB;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/components",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "Common UI components used across Perses features",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -32,8 +32,9 @@
32
32
  "lint:fix": "eslint --fix src --ext .ts,.tsx"
33
33
  },
34
34
  "dependencies": {
35
+ "@fontsource/lato": "^4.5.10",
35
36
  "@mui/x-date-pickers": "^5.0.0-beta.1",
36
- "@perses-dev/core": "^0.16.0",
37
+ "@perses-dev/core": "^0.18.0",
37
38
  "date-fns": "^2.28.0",
38
39
  "echarts": "^5.3.3",
39
40
  "lodash-es": "^4.17.21",
@@ -42,7 +43,7 @@
42
43
  "react-error-boundary": "^3.1.4"
43
44
  },
44
45
  "peerDependencies": {
45
- "@mui/material": "^5.6.0",
46
+ "@mui/material": "^5.10.0",
46
47
  "react": "^17.0.2 || ^18.0.0",
47
48
  "react-dom": "^17.0.2 || ^18.0.0"
48
49
  },