@perses-dev/dashboards 0.29.1 → 0.30.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 (69) hide show
  1. package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +79 -0
  2. package/dist/cjs/{stories/decorators/WithQueryClient.js → components/DashboardStickyToolbar/index.js} +11 -12
  3. package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +3 -2
  4. package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +5 -0
  5. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +5 -5
  6. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +1 -1
  7. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -8
  8. package/dist/cjs/components/Variables/VariableList.js +16 -55
  9. package/dist/cjs/components/index.js +1 -0
  10. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +3 -4
  11. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +4 -4
  12. package/dist/cjs/context/useDashboard.js +4 -4
  13. package/dist/cjs/stories/decorators/index.js +0 -5
  14. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +9 -0
  15. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -0
  16. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +68 -0
  17. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -0
  18. package/dist/components/DashboardStickyToolbar/index.d.ts +2 -0
  19. package/dist/components/DashboardStickyToolbar/index.d.ts.map +1 -0
  20. package/dist/{stories/decorators/WithQueryClient.js → components/DashboardStickyToolbar/index.js} +2 -10
  21. package/dist/components/DashboardStickyToolbar/index.js.map +1 -0
  22. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
  23. package/dist/components/DashboardToolbar/DashboardToolbar.js +4 -3
  24. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  25. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
  26. package/dist/components/EditJsonDialog/EditJsonDialog.js +5 -0
  27. package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
  28. package/dist/components/TimeRangeControls/TimeRangeControls.js +6 -6
  29. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  30. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +1 -1
  31. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  32. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  33. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -8
  34. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  35. package/dist/components/Variables/VariableList.d.ts +1 -7
  36. package/dist/components/Variables/VariableList.d.ts.map +1 -1
  37. package/dist/components/Variables/VariableList.js +18 -52
  38. package/dist/components/Variables/VariableList.js.map +1 -1
  39. package/dist/components/index.d.ts +1 -0
  40. package/dist/components/index.d.ts.map +1 -1
  41. package/dist/components/index.js +1 -0
  42. package/dist/components/index.js.map +1 -1
  43. package/dist/context/DashboardProvider/DashboardProvider.d.ts +2 -2
  44. package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
  45. package/dist/context/DashboardProvider/DashboardProvider.js +3 -4
  46. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
  47. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -1
  48. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
  49. package/dist/context/DashboardProvider/dashboard-provider-api.js +3 -3
  50. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
  51. package/dist/context/useDashboard.d.ts.map +1 -1
  52. package/dist/context/useDashboard.js +4 -4
  53. package/dist/context/useDashboard.js.map +1 -1
  54. package/dist/stories/decorators/index.js +0 -5
  55. package/dist/stories/decorators/index.js.map +1 -1
  56. package/package.json +6 -6
  57. package/dist/cjs/stories/decorators/WithDataQueriesProvider.js +0 -39
  58. package/dist/cjs/stories/decorators/WithPluginRegistry.js +0 -94
  59. package/dist/cjs/stories/decorators/WithQueryParams.js +0 -29
  60. package/dist/cjs/stories/decorators/WithTimeRange.js +0 -38
  61. package/dist/stories/decorators/WithDataQueriesProvider.js +0 -33
  62. package/dist/stories/decorators/WithDataQueriesProvider.js.map +0 -1
  63. package/dist/stories/decorators/WithPluginRegistry.js +0 -49
  64. package/dist/stories/decorators/WithPluginRegistry.js.map +0 -1
  65. package/dist/stories/decorators/WithQueryClient.js.map +0 -1
  66. package/dist/stories/decorators/WithQueryParams.js +0 -23
  67. package/dist/stories/decorators/WithQueryParams.js.map +0 -1
  68. package/dist/stories/decorators/WithTimeRange.js +0 -32
  69. package/dist/stories/decorators/WithTimeRange.js.map +0 -1
@@ -1,49 +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 { PluginRegistry, dynamicImportPluginLoader } from '@perses-dev/plugin-system';
15
- // NOTE: the aliases we use for components break these top level imports, so we
16
- // import relatively.
17
- // eslint-disable-next-line @typescript-eslint/no-var-requires
18
- const prometheusResource = require('../../../../prometheus-plugin/plugin.json');
19
- // eslint-disable-next-line @typescript-eslint/no-var-requires
20
- const panelsResource = require('../../../../panels-plugin/plugin.json');
21
- const bundledPluginLoader = dynamicImportPluginLoader([
22
- {
23
- resource: prometheusResource,
24
- // This throws an error in CI (but not locally for some reason), likely because
25
- // this package isn't a dependency for dashboards. We probably do not want to
26
- // make it one solely for type-checking in storybook.
27
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
28
- // @ts-ignore
29
- importPlugin: ()=>import('@perses-dev/prometheus-plugin')
30
- },
31
- {
32
- resource: panelsResource,
33
- // Same comment as above.
34
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
35
- // @ts-ignore
36
- importPlugin: ()=>import('@perses-dev/panels-plugin')
37
- }
38
- ]);
39
- export const WithPluginRegistry = (Story)=>{
40
- return /*#__PURE__*/ _jsx(PluginRegistry, {
41
- pluginLoader: bundledPluginLoader,
42
- defaultPluginKinds: {
43
- TimeSeriesQuery: 'PrometheusTimeSeriesQuery'
44
- },
45
- children: /*#__PURE__*/ _jsx(Story, {})
46
- });
47
- };
48
-
49
- //# sourceMappingURL=WithPluginRegistry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/stories/decorators/WithPluginRegistry.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 { StoryFn } from '@storybook/react';\nimport {\n PluginRegistry,\n PluginLoader,\n PluginModuleResource,\n dynamicImportPluginLoader,\n} from '@perses-dev/plugin-system';\n\n// NOTE: the aliases we use for components break these top level imports, so we\n// import relatively.\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst prometheusResource = require('../../../../prometheus-plugin/plugin.json');\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst panelsResource = require('../../../../panels-plugin/plugin.json');\n\nconst bundledPluginLoader: PluginLoader = dynamicImportPluginLoader([\n {\n resource: prometheusResource as PluginModuleResource,\n // This throws an error in CI (but not locally for some reason), likely because\n // this package isn't a dependency for dashboards. We probably do not want to\n // make it one solely for type-checking in storybook.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n importPlugin: () => import('@perses-dev/prometheus-plugin'),\n },\n {\n resource: panelsResource as PluginModuleResource,\n // Same comment as above.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n importPlugin: () => import('@perses-dev/panels-plugin'),\n },\n]);\n\nexport const WithPluginRegistry = (Story: StoryFn) => {\n return (\n <PluginRegistry\n pluginLoader={bundledPluginLoader}\n defaultPluginKinds={{ TimeSeriesQuery: 'PrometheusTimeSeriesQuery' }}\n >\n <Story />\n </PluginRegistry>\n );\n};\n"],"names":["PluginRegistry","dynamicImportPluginLoader","prometheusResource","require","panelsResource","bundledPluginLoader","resource","importPlugin","WithPluginRegistry","Story","pluginLoader","defaultPluginKinds","TimeSeriesQuery"],"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;AACA,SACEA,cAAc,EAGdC,yBAAyB,QACpB,2BAA2B,CAAC;AAEnC,+EAA+E;AAC/E,qBAAqB;AACrB,8DAA8D;AAC9D,MAAMC,kBAAkB,GAAGC,OAAO,CAAC,2CAA2C,CAAC,AAAC;AAChF,8DAA8D;AAC9D,MAAMC,cAAc,GAAGD,OAAO,CAAC,uCAAuC,CAAC,AAAC;AAExE,MAAME,mBAAmB,GAAiBJ,yBAAyB,CAAC;IAClE;QACEK,QAAQ,EAAEJ,kBAAkB;QAC5B,+EAA+E;QAC/E,6EAA6E;QAC7E,qDAAqD;QACrD,6DAA6D;QAC7D,aAAa;QACbK,YAAY,EAAE,IAAM,MAAM,CAAC,+BAA+B,CAAC;KAC5D;IACD;QACED,QAAQ,EAAEF,cAAc;QACxB,yBAAyB;QACzB,6DAA6D;QAC7D,aAAa;QACbG,YAAY,EAAE,IAAM,MAAM,CAAC,2BAA2B,CAAC;KACxD;CACF,CAAC,AAAC;AAEH,OAAO,MAAMC,kBAAkB,GAAG,CAACC,KAAc,GAAK;IACpD,qBACE,KAACT,cAAc;QACbU,YAAY,EAAEL,mBAAmB;QACjCM,kBAAkB,EAAE;YAAEC,eAAe,EAAE,2BAA2B;SAAE;kBAEpE,cAAA,KAACH,KAAK,KAAG;MACM,CACjB;AACJ,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/stories/decorators/WithQueryClient.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 { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { StoryFn } from '@storybook/react';\n\nexport const WithQueryClient = (Story: StoryFn) => {\n const queryClient = new QueryClient({});\n\n return (\n <QueryClientProvider client={queryClient}>\n <Story />\n </QueryClientProvider>\n );\n};\n"],"names":["QueryClient","QueryClientProvider","WithQueryClient","Story","queryClient","client"],"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;AAAA,SAASA,WAAW,EAAEC,mBAAmB,QAAQ,uBAAuB,CAAC;AAGzE,OAAO,MAAMC,eAAe,GAAG,CAACC,KAAc,GAAK;IACjD,MAAMC,WAAW,GAAG,IAAIJ,WAAW,CAAC,EAAE,CAAC,AAAC;IAExC,qBACE,KAACC,mBAAmB;QAACI,MAAM,EAAED,WAAW;kBACtC,cAAA,KAACD,KAAK,KAAG;MACW,CACtB;AACJ,CAAC,CAAC"}
@@ -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 { jsx as _jsx } from "react/jsx-runtime";
14
- import { WindowHistoryAdapter } from 'use-query-params/adapters/window';
15
- import { QueryParamProvider } from 'use-query-params';
16
- export const WithQueryParams = (Story)=>{
17
- return /*#__PURE__*/ _jsx(QueryParamProvider, {
18
- adapter: WindowHistoryAdapter,
19
- children: /*#__PURE__*/ _jsx(Story, {})
20
- });
21
- };
22
-
23
- //# sourceMappingURL=WithQueryParams.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/stories/decorators/WithQueryParams.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 { WindowHistoryAdapter } from 'use-query-params/adapters/window';\nimport { QueryParamProvider } from 'use-query-params';\nimport { StoryFn } from '@storybook/react';\n\nexport const WithQueryParams = (Story: StoryFn) => {\n return (\n <QueryParamProvider adapter={WindowHistoryAdapter}>\n <Story />\n </QueryParamProvider>\n );\n};\n"],"names":["WindowHistoryAdapter","QueryParamProvider","WithQueryParams","Story","adapter"],"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;AAAA,SAASA,oBAAoB,QAAQ,kCAAkC,CAAC;AACxE,SAASC,kBAAkB,QAAQ,kBAAkB,CAAC;AAGtD,OAAO,MAAMC,eAAe,GAAG,CAACC,KAAc,GAAK;IACjD,qBACE,KAACF,kBAAkB;QAACG,OAAO,EAAEJ,oBAAoB;kBAC/C,cAAA,KAACG,KAAK,KAAG;MACU,CACrB;AACJ,CAAC,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 { TimeRangeProvider } from '@perses-dev/plugin-system';
15
- // Type guard because storybook types parameters as `any`
16
- function isWithTimeRangeParameter(parameter) {
17
- return !!parameter && typeof parameter === 'object' && 'props' in parameter;
18
- }
19
- export const WithTimeRange = (Story, context)=>{
20
- const initParameter = context.parameters.withTimeRange;
21
- const parameter = isWithTimeRangeParameter(initParameter) ? initParameter : undefined;
22
- const props = parameter === null || parameter === void 0 ? void 0 : parameter.props;
23
- return /*#__PURE__*/ _jsx(TimeRangeProvider, {
24
- initialTimeRange: {
25
- pastDuration: '1h'
26
- },
27
- ...props,
28
- children: /*#__PURE__*/ _jsx(Story, {})
29
- });
30
- };
31
-
32
- //# sourceMappingURL=WithTimeRange.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/stories/decorators/WithTimeRange.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 { StoryFn, StoryContext } from '@storybook/react';\nimport { TimeRangeProvider, TimeRangeProviderProps } from '@perses-dev/plugin-system';\n\nexport type WithTimeRangeParameter = {\n props: Partial<TimeRangeProviderProps>;\n};\n\n// Type guard because storybook types parameters as `any`\nfunction isWithTimeRangeParameter(parameter: unknown | WithTimeRangeParameter): parameter is WithTimeRangeParameter {\n return !!parameter && typeof parameter === 'object' && 'props' in parameter;\n}\n\nexport const WithTimeRange = (Story: StoryFn, context: StoryContext<unknown>) => {\n const initParameter = context.parameters.withTimeRange;\n const parameter = isWithTimeRangeParameter(initParameter) ? initParameter : undefined;\n const props = parameter?.props;\n\n return (\n <TimeRangeProvider initialTimeRange={{ pastDuration: '1h' }} {...props}>\n <Story />\n </TimeRangeProvider>\n );\n};\n"],"names":["TimeRangeProvider","isWithTimeRangeParameter","parameter","WithTimeRange","Story","context","initParameter","parameters","withTimeRange","undefined","props","initialTimeRange","pastDuration"],"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;AACA,SAASA,iBAAiB,QAAgC,2BAA2B,CAAC;AAMtF,yDAAyD;AACzD,SAASC,wBAAwB,CAACC,SAA2C,EAAuC;IAClH,OAAO,CAAC,CAACA,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,OAAO,IAAIA,SAAS,CAAC;AAC9E,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG,CAACC,KAAc,EAAEC,OAA8B,GAAK;IAC/E,MAAMC,aAAa,GAAGD,OAAO,CAACE,UAAU,CAACC,aAAa,AAAC;IACvD,MAAMN,SAAS,GAAGD,wBAAwB,CAACK,aAAa,CAAC,GAAGA,aAAa,GAAGG,SAAS,AAAC;IACtF,MAAMC,KAAK,GAAGR,SAAS,aAATA,SAAS,WAAO,GAAhBA,KAAAA,CAAgB,GAAhBA,SAAS,CAAEQ,KAAK,AAAC;IAE/B,qBACE,KAACV,iBAAiB;QAACW,gBAAgB,EAAE;YAAEC,YAAY,EAAE,IAAI;SAAE;QAAG,GAAGF,KAAK;kBACpE,cAAA,KAACN,KAAK,KAAG;MACS,CACpB;AACJ,CAAC,CAAC"}