@perses-dev/dashboards 0.44.0 → 0.45.0-rc1

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 (102) hide show
  1. package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +2 -2
  2. package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +3 -3
  3. package/dist/cjs/components/DownloadButton/DownloadButton.js +1 -2
  4. package/dist/cjs/components/EditJsonButton/EditJsonButton.js +1 -2
  5. package/dist/cjs/components/GridLayout/GridItemContent.js +1 -2
  6. package/dist/cjs/components/GridLayout/GridLayout.js +1 -1
  7. package/dist/cjs/components/GridLayout/GridTitle.js +0 -1
  8. package/dist/cjs/components/Panel/Panel.js +1 -0
  9. package/dist/cjs/components/Panel/PanelHeader.js +5 -1
  10. package/dist/cjs/components/Panel/PanelLinks.js +137 -0
  11. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +32 -8
  12. package/dist/cjs/components/PanelDrawer/PanelPreview.js +1 -2
  13. package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
  14. package/dist/cjs/components/index.js +0 -2
  15. package/dist/cjs/constants/user-interface-text.js +0 -2
  16. package/dist/cjs/context/DatasourceStoreProvider.js +3 -1
  17. package/dist/cjs/utils/index.js +0 -1
  18. package/dist/cjs/validation/panel.js +12 -2
  19. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +1 -1
  20. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
  21. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
  22. package/dist/components/DashboardToolbar/DashboardToolbar.js +2 -2
  23. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  24. package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
  25. package/dist/components/DownloadButton/DownloadButton.js +1 -2
  26. package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
  27. package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
  28. package/dist/components/EditJsonButton/EditJsonButton.js +1 -2
  29. package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
  30. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
  31. package/dist/components/GridLayout/GridItemContent.js +1 -2
  32. package/dist/components/GridLayout/GridItemContent.js.map +1 -1
  33. package/dist/components/GridLayout/GridLayout.js +1 -1
  34. package/dist/components/GridLayout/GridLayout.js.map +1 -1
  35. package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
  36. package/dist/components/GridLayout/GridTitle.js +0 -1
  37. package/dist/components/GridLayout/GridTitle.js.map +1 -1
  38. package/dist/components/Panel/Panel.d.ts.map +1 -1
  39. package/dist/components/Panel/Panel.js +1 -0
  40. package/dist/components/Panel/Panel.js.map +1 -1
  41. package/dist/components/Panel/PanelHeader.d.ts +5 -3
  42. package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
  43. package/dist/components/Panel/PanelHeader.js +8 -4
  44. package/dist/components/Panel/PanelHeader.js.map +1 -1
  45. package/dist/components/Panel/PanelLinks.d.ts +5 -0
  46. package/dist/components/Panel/PanelLinks.d.ts.map +1 -0
  47. package/dist/components/Panel/PanelLinks.js +124 -0
  48. package/dist/components/Panel/PanelLinks.js.map +1 -0
  49. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
  50. package/dist/components/PanelDrawer/PanelEditorForm.js +34 -10
  51. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  52. package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
  53. package/dist/components/PanelDrawer/PanelPreview.js +1 -2
  54. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
  55. package/dist/components/PanelDrawer/usePanelEditor.d.ts +1 -0
  56. package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -1
  57. package/dist/components/PanelDrawer/usePanelEditor.js +9 -6
  58. package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
  59. package/dist/components/index.d.ts +0 -2
  60. package/dist/components/index.d.ts.map +1 -1
  61. package/dist/components/index.js +0 -2
  62. package/dist/components/index.js.map +1 -1
  63. package/dist/constants/user-interface-text.d.ts +0 -2
  64. package/dist/constants/user-interface-text.d.ts.map +1 -1
  65. package/dist/constants/user-interface-text.js +0 -2
  66. package/dist/constants/user-interface-text.js.map +1 -1
  67. package/dist/context/DatasourceStoreProvider.js +3 -1
  68. package/dist/context/DatasourceStoreProvider.js.map +1 -1
  69. package/dist/utils/index.d.ts +0 -1
  70. package/dist/utils/index.d.ts.map +1 -1
  71. package/dist/utils/index.js +0 -1
  72. package/dist/utils/index.js.map +1 -1
  73. package/dist/validation/panel.d.ts +51 -3
  74. package/dist/validation/panel.d.ts.map +1 -1
  75. package/dist/validation/panel.js +12 -2
  76. package/dist/validation/panel.js.map +1 -1
  77. package/package.json +6 -6
  78. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -216
  79. package/dist/cjs/components/TimeRangeControls/index.js +0 -30
  80. package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -40
  81. package/dist/cjs/components/ToolbarIconButton/index.js +0 -30
  82. package/dist/cjs/utils/time.js +0 -29
  83. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +0 -13
  84. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +0 -1
  85. package/dist/components/TimeRangeControls/TimeRangeControls.js +0 -192
  86. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +0 -1
  87. package/dist/components/TimeRangeControls/index.d.ts +0 -2
  88. package/dist/components/TimeRangeControls/index.d.ts.map +0 -1
  89. package/dist/components/TimeRangeControls/index.js +0 -15
  90. package/dist/components/TimeRangeControls/index.js.map +0 -1
  91. package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +0 -6
  92. package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +0 -1
  93. package/dist/components/ToolbarIconButton/ToolbarIconButton.js +0 -32
  94. package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
  95. package/dist/components/ToolbarIconButton/index.d.ts +0 -2
  96. package/dist/components/ToolbarIconButton/index.d.ts.map +0 -1
  97. package/dist/components/ToolbarIconButton/index.js +0 -15
  98. package/dist/components/ToolbarIconButton/index.js.map +0 -1
  99. package/dist/utils/time.d.ts +0 -5
  100. package/dist/utils/time.d.ts.map +0 -1
  101. package/dist/utils/time.js +0 -23
  102. package/dist/utils/time.js.map +0 -1
@@ -1,192 +0,0 @@
1
- // Copyright 2023 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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- import RefreshIcon from 'mdi-material-ui/Refresh';
15
- import { Stack } from '@mui/material';
16
- import { DateTimeRangePicker, RefreshIntervalPicker, InfoTooltip } from '@perses-dev/components';
17
- import { useTimeRange } from '@perses-dev/plugin-system';
18
- import { isDurationString } from '@perses-dev/core';
19
- import { useCallback } from 'react';
20
- import { TOOLTIP_TEXT } from '../../constants';
21
- import { useDashboardDuration } from '../../context';
22
- import { ToolbarIconButton } from '../ToolbarIconButton';
23
- import { useDashboard } from '../../context/useDashboard';
24
- export const DEFAULT_TIME_RANGE_OPTIONS = [
25
- {
26
- value: {
27
- pastDuration: '5m'
28
- },
29
- display: 'Last 5 minutes'
30
- },
31
- {
32
- value: {
33
- pastDuration: '15m'
34
- },
35
- display: 'Last 15 minutes'
36
- },
37
- {
38
- value: {
39
- pastDuration: '30m'
40
- },
41
- display: 'Last 30 minutes'
42
- },
43
- {
44
- value: {
45
- pastDuration: '1h'
46
- },
47
- display: 'Last 1 hour'
48
- },
49
- {
50
- value: {
51
- pastDuration: '6h'
52
- },
53
- display: 'Last 6 hours'
54
- },
55
- {
56
- value: {
57
- pastDuration: '12h'
58
- },
59
- display: 'Last 12 hours'
60
- },
61
- {
62
- value: {
63
- pastDuration: '24h'
64
- },
65
- display: 'Last 1 day'
66
- },
67
- {
68
- value: {
69
- pastDuration: '7d'
70
- },
71
- display: 'Last 7 days'
72
- },
73
- {
74
- value: {
75
- pastDuration: '14d'
76
- },
77
- display: 'Last 14 days'
78
- }
79
- ];
80
- export const DEFAULT_REFRESH_INTERVAL_OPTIONS = [
81
- {
82
- value: {
83
- pastDuration: '0s'
84
- },
85
- display: 'Off'
86
- },
87
- {
88
- value: {
89
- pastDuration: '5s'
90
- },
91
- display: '5s'
92
- },
93
- {
94
- value: {
95
- pastDuration: '10s'
96
- },
97
- display: '10s'
98
- },
99
- {
100
- value: {
101
- pastDuration: '15s'
102
- },
103
- display: '15s'
104
- },
105
- {
106
- value: {
107
- pastDuration: '30s'
108
- },
109
- display: '30s'
110
- },
111
- {
112
- value: {
113
- pastDuration: '60s'
114
- },
115
- display: '1m'
116
- }
117
- ];
118
- const DEFAULT_HEIGHT = '34px';
119
- export function TimeRangeControls({ heightPx, showTimeRangeSelector = true, showRefreshButton = true, showRefreshInterval = true, timePresets = DEFAULT_TIME_RANGE_OPTIONS }) {
120
- const { timeRange, setTimeRange, refresh, refreshInterval, setRefreshInterval } = useTimeRange();
121
- // TODO: Remove this since it couples to the dashboard context
122
- const dashboardDuration = useDashboardDuration();
123
- const { dashboard, setDashboard } = useDashboard();
124
- // Convert height to a string, then use the string for styling
125
- const height = heightPx === undefined ? DEFAULT_HEIGHT : `${heightPx}px`;
126
- // add time shortcut if one does not match duration from dashboard JSON
127
- if (!timePresets.some((option)=>option.value.pastDuration === dashboardDuration)) {
128
- if (isDurationString(dashboardDuration)) {
129
- timePresets.push({
130
- value: {
131
- pastDuration: dashboardDuration
132
- },
133
- display: `Last ${dashboardDuration}`
134
- });
135
- }
136
- }
137
- // set the new refresh interval both in the dashboard context & as query param
138
- const handleRefreshIntervalChange = useCallback((duration)=>{
139
- setDashboard(dashboard.kind === 'Dashboard' ? {
140
- ...dashboard,
141
- spec: {
142
- ...dashboard.spec,
143
- refreshInterval: duration
144
- }
145
- } : {
146
- ...dashboard,
147
- spec: {
148
- ...dashboard.spec,
149
- refreshInterval: duration
150
- }
151
- });
152
- setRefreshInterval(duration);
153
- }, [
154
- dashboard,
155
- setDashboard,
156
- setRefreshInterval
157
- ]);
158
- return /*#__PURE__*/ _jsxs(Stack, {
159
- direction: "row",
160
- spacing: 1,
161
- children: [
162
- showTimeRangeSelector && /*#__PURE__*/ _jsx(DateTimeRangePicker, {
163
- timeOptions: timePresets,
164
- value: timeRange,
165
- onChange: setTimeRange,
166
- height: height
167
- }),
168
- showRefreshButton && /*#__PURE__*/ _jsx(InfoTooltip, {
169
- description: TOOLTIP_TEXT.refreshDashboard,
170
- children: /*#__PURE__*/ _jsx(ToolbarIconButton, {
171
- "aria-label": TOOLTIP_TEXT.refreshDashboard,
172
- onClick: refresh,
173
- sx: {
174
- height
175
- },
176
- children: /*#__PURE__*/ _jsx(RefreshIcon, {})
177
- })
178
- }),
179
- showRefreshInterval && /*#__PURE__*/ _jsx(InfoTooltip, {
180
- description: TOOLTIP_TEXT.refreshDashboardInterval,
181
- children: /*#__PURE__*/ _jsx(RefreshIntervalPicker, {
182
- timeOptions: DEFAULT_REFRESH_INTERVAL_OPTIONS,
183
- value: refreshInterval,
184
- onChange: handleRefreshIntervalChange,
185
- height: height
186
- })
187
- })
188
- ]
189
- });
190
- }
191
-
192
- //# sourceMappingURL=TimeRangeControls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"sourcesContent":["// Copyright 2023 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 RefreshIcon from 'mdi-material-ui/Refresh';\nimport { Stack } from '@mui/material';\nimport { DateTimeRangePicker, RefreshIntervalPicker, InfoTooltip, TimeOption } from '@perses-dev/components';\nimport { useTimeRange } from '@perses-dev/plugin-system';\nimport { isDurationString, DurationString, DashboardResource, EphemeralDashboardResource } from '@perses-dev/core';\nimport { useCallback } from 'react';\nimport { TOOLTIP_TEXT } from '../../constants';\nimport { useDashboardDuration } from '../../context';\nimport { ToolbarIconButton } from '../ToolbarIconButton';\nimport { useDashboard } from '../../context/useDashboard';\n\nexport const DEFAULT_TIME_RANGE_OPTIONS: TimeOption[] = [\n { value: { pastDuration: '5m' }, display: 'Last 5 minutes' },\n { value: { pastDuration: '15m' }, display: 'Last 15 minutes' },\n { value: { pastDuration: '30m' }, display: 'Last 30 minutes' },\n { value: { pastDuration: '1h' }, display: 'Last 1 hour' },\n { value: { pastDuration: '6h' }, display: 'Last 6 hours' },\n { value: { pastDuration: '12h' }, display: 'Last 12 hours' },\n { value: { pastDuration: '24h' }, display: 'Last 1 day' },\n { value: { pastDuration: '7d' }, display: 'Last 7 days' },\n { value: { pastDuration: '14d' }, display: 'Last 14 days' },\n];\n\nexport const DEFAULT_REFRESH_INTERVAL_OPTIONS: TimeOption[] = [\n { value: { pastDuration: '0s' }, display: 'Off' },\n { value: { pastDuration: '5s' }, display: '5s' },\n { value: { pastDuration: '10s' }, display: '10s' },\n { value: { pastDuration: '15s' }, display: '15s' },\n { value: { pastDuration: '30s' }, display: '30s' },\n { value: { pastDuration: '60s' }, display: '1m' },\n];\n\nconst DEFAULT_HEIGHT = '34px';\n\ninterface TimeRangeControlsProps {\n // The controls look best at heights >= 28 pixels\n heightPx?: number;\n showTimeRangeSelector?: boolean;\n showRefreshButton?: boolean;\n showRefreshInterval?: boolean;\n timePresets?: TimeOption[];\n}\n\nexport function TimeRangeControls({\n heightPx,\n showTimeRangeSelector = true,\n showRefreshButton = true,\n showRefreshInterval = true,\n timePresets = DEFAULT_TIME_RANGE_OPTIONS,\n}: TimeRangeControlsProps) {\n const { timeRange, setTimeRange, refresh, refreshInterval, setRefreshInterval } = useTimeRange();\n // TODO: Remove this since it couples to the dashboard context\n const dashboardDuration = useDashboardDuration();\n const { dashboard, setDashboard } = useDashboard();\n\n // Convert height to a string, then use the string for styling\n const height = heightPx === undefined ? DEFAULT_HEIGHT : `${heightPx}px`;\n\n // add time shortcut if one does not match duration from dashboard JSON\n if (!timePresets.some((option) => option.value.pastDuration === dashboardDuration)) {\n if (isDurationString(dashboardDuration)) {\n timePresets.push({\n value: { pastDuration: dashboardDuration },\n display: `Last ${dashboardDuration}`,\n });\n }\n }\n\n // set the new refresh interval both in the dashboard context & as query param\n const handleRefreshIntervalChange = useCallback(\n (duration: DurationString) => {\n setDashboard(\n dashboard.kind === 'Dashboard'\n ? ({\n ...dashboard,\n spec: {\n ...dashboard.spec,\n refreshInterval: duration,\n },\n } as DashboardResource)\n : ({\n ...dashboard,\n spec: {\n ...dashboard.spec,\n refreshInterval: duration,\n },\n } as EphemeralDashboardResource)\n );\n setRefreshInterval(duration);\n },\n [dashboard, setDashboard, setRefreshInterval]\n );\n\n return (\n <Stack direction=\"row\" spacing={1}>\n {showTimeRangeSelector && (\n <DateTimeRangePicker timeOptions={timePresets} value={timeRange} onChange={setTimeRange} height={height} />\n )}\n {showRefreshButton && (\n <InfoTooltip description={TOOLTIP_TEXT.refreshDashboard}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.refreshDashboard} onClick={refresh} sx={{ height }}>\n <RefreshIcon />\n </ToolbarIconButton>\n </InfoTooltip>\n )}\n {showRefreshInterval && (\n <InfoTooltip description={TOOLTIP_TEXT.refreshDashboardInterval}>\n <RefreshIntervalPicker\n timeOptions={DEFAULT_REFRESH_INTERVAL_OPTIONS}\n value={refreshInterval}\n onChange={handleRefreshIntervalChange}\n height={height}\n />\n </InfoTooltip>\n )}\n </Stack>\n );\n}\n"],"names":["RefreshIcon","Stack","DateTimeRangePicker","RefreshIntervalPicker","InfoTooltip","useTimeRange","isDurationString","useCallback","TOOLTIP_TEXT","useDashboardDuration","ToolbarIconButton","useDashboard","DEFAULT_TIME_RANGE_OPTIONS","value","pastDuration","display","DEFAULT_REFRESH_INTERVAL_OPTIONS","DEFAULT_HEIGHT","TimeRangeControls","heightPx","showTimeRangeSelector","showRefreshButton","showRefreshInterval","timePresets","timeRange","setTimeRange","refresh","refreshInterval","setRefreshInterval","dashboardDuration","dashboard","setDashboard","height","undefined","some","option","push","handleRefreshIntervalChange","duration","kind","spec","direction","spacing","timeOptions","onChange","description","refreshDashboard","aria-label","onClick","sx","refreshDashboardInterval"],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- export * from './TimeRangeControls';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TimeRangeControls/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC"}
@@ -1,15 +0,0 @@
1
- // Copyright 2023 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
- export * from './TimeRangeControls';
14
-
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/TimeRangeControls/index.ts"],"sourcesContent":["// Copyright 2023 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\nexport * from './TimeRangeControls';\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,cAAc,sBAAsB"}
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { ButtonProps } from '@mui/material';
3
- type ToolbarIconButtonProps = ButtonProps;
4
- export declare const ToolbarIconButton: import("react").ForwardRefExoticComponent<Omit<ToolbarIconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
5
- export {};
6
- //# sourceMappingURL=ToolbarIconButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToolbarIconButton.d.ts","sourceRoot":"","sources":["../../../src/components/ToolbarIconButton/ToolbarIconButton.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAkB,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5D,KAAK,sBAAsB,GAAG,WAAW,CAAC;AAa1C,eAAO,MAAM,iBAAiB,mIAAyB,CAAC"}
@@ -1,32 +0,0 @@
1
- // Copyright 2023 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 { jsx as _jsx } from "react/jsx-runtime";
14
- import { forwardRef } from 'react';
15
- import { Button, styled } from '@mui/material';
16
- function IconButton(props, ref) {
17
- return /*#__PURE__*/ _jsx(StyledIconButton, {
18
- ref: ref,
19
- variant: "outlined",
20
- color: "secondary",
21
- ...props
22
- });
23
- }
24
- const StyledIconButton = styled(Button)(({ theme })=>({
25
- // Using a button with some adjusted styles because it is easier to inherit
26
- // styling and variants from themes than with an IconButton.
27
- padding: theme.spacing(0.5),
28
- minWidth: 'auto'
29
- }));
30
- export const ToolbarIconButton = /*#__PURE__*/ forwardRef(IconButton);
31
-
32
- //# sourceMappingURL=ToolbarIconButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/ToolbarIconButton/ToolbarIconButton.tsx"],"sourcesContent":["// Copyright 2023 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 { ForwardedRef, forwardRef } from 'react';\nimport { Button, styled, ButtonProps } from '@mui/material';\n\ntype ToolbarIconButtonProps = ButtonProps;\n\nfunction IconButton(props: ToolbarIconButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n return <StyledIconButton ref={ref} variant=\"outlined\" color=\"secondary\" {...props} />;\n}\n\nconst StyledIconButton = styled(Button)(({ theme }) => ({\n // Using a button with some adjusted styles because it is easier to inherit\n // styling and variants from themes than with an IconButton.\n padding: theme.spacing(0.5),\n minWidth: 'auto',\n}));\n\nexport const ToolbarIconButton = forwardRef(IconButton);\n"],"names":["forwardRef","Button","styled","IconButton","props","ref","StyledIconButton","variant","color","theme","padding","spacing","minWidth","ToolbarIconButton"],"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,SAAuBA,UAAU,QAAQ,QAAQ;AACjD,SAASC,MAAM,EAAEC,MAAM,QAAqB,gBAAgB;AAI5D,SAASC,WAAWC,KAA6B,EAAEC,GAAoC;IACrF,qBAAO,KAACC;QAAiBD,KAAKA;QAAKE,SAAQ;QAAWC,OAAM;QAAa,GAAGJ,KAAK;;AACnF;AAEA,MAAME,mBAAmBJ,OAAOD,QAAQ,CAAC,EAAEQ,KAAK,EAAE,GAAM,CAAA;QACtD,2EAA2E;QAC3E,4DAA4D;QAC5DC,SAASD,MAAME,OAAO,CAAC;QACvBC,UAAU;IACZ,CAAA;AAEA,OAAO,MAAMC,kCAAoBb,WAAWG,YAAY"}
@@ -1,2 +0,0 @@
1
- export * from './ToolbarIconButton';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ToolbarIconButton/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC"}
@@ -1,15 +0,0 @@
1
- // Copyright 2023 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
- export * from './ToolbarIconButton';
14
-
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/ToolbarIconButton/index.ts"],"sourcesContent":["// Copyright 2023 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\nexport * from './ToolbarIconButton';\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,cAAc,sBAAsB"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Gets the suggested step for a graph query in ms for the currently selected time range.
3
- */
4
- export declare function useSuggestedStepMs(width?: number): number;
5
- //# sourceMappingURL=time.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,UAIhD"}
@@ -1,23 +0,0 @@
1
- // Copyright 2023 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 { getSuggestedStepMs } from '@perses-dev/core';
14
- import { useTimeRange } from '@perses-dev/plugin-system';
15
- /**
16
- * Gets the suggested step for a graph query in ms for the currently selected time range.
17
- */ export function useSuggestedStepMs(width) {
18
- const { absoluteTimeRange } = useTimeRange();
19
- if (width === undefined) return 0;
20
- return getSuggestedStepMs(absoluteTimeRange, width);
21
- }
22
-
23
- //# sourceMappingURL=time.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/time.ts"],"sourcesContent":["// Copyright 2023 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 { getSuggestedStepMs } from '@perses-dev/core';\nimport { useTimeRange } from '@perses-dev/plugin-system';\n\n/**\n * Gets the suggested step for a graph query in ms for the currently selected time range.\n */\nexport function useSuggestedStepMs(width?: number) {\n const { absoluteTimeRange } = useTimeRange();\n if (width === undefined) return 0;\n return getSuggestedStepMs(absoluteTimeRange, width);\n}\n"],"names":["getSuggestedStepMs","useTimeRange","useSuggestedStepMs","width","absoluteTimeRange","undefined"],"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,kBAAkB,QAAQ,mBAAmB;AACtD,SAASC,YAAY,QAAQ,4BAA4B;AAEzD;;CAEC,GACD,OAAO,SAASC,mBAAmBC,KAAc;IAC/C,MAAM,EAAEC,iBAAiB,EAAE,GAAGH;IAC9B,IAAIE,UAAUE,WAAW,OAAO;IAChC,OAAOL,mBAAmBI,mBAAmBD;AAC/C"}