@bundle-stats/ui 4.23.0-beta.1 → 4.23.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/app.js +16 -5
- package/lib/app/app.js.map +1 -1
- package/lib/app/app.module.css +13 -9
- package/lib/app/header/header.module.css +1 -3
- package/lib/components/asset-name/asset-name.js +8 -7
- package/lib/components/asset-name/asset-name.js.map +1 -1
- package/lib/components/asset-name/asset-name.module.css +11 -10
- package/lib/components/bundle-assets/bundle-assets.js +4 -2
- package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib/components/bundle-assets/bundle-assets.module.css +0 -12
- package/lib/components/bundle-assets/index.js +2 -1
- package/lib/components/bundle-assets/index.js.map +1 -1
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js +4 -2
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +5 -3
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.module.css +2 -16
- package/lib/components/bundle-modules/index.js +2 -1
- package/lib/components/bundle-modules/index.js.map +1 -1
- package/lib/components/bundle-packages/bundle-packages.js +5 -3
- package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib/components/bundle-packages/bundle-packages.module.css +18 -22
- package/lib/components/entry-info/entry-info.js +4 -2
- package/lib/components/entry-info/entry-info.js.map +1 -1
- package/lib/components/entry-info/entry-info.module.css +8 -2
- package/lib/components/jobs-header/jobs-header.js +1 -1
- package/lib/components/jobs-header/jobs-header.js.map +1 -1
- package/lib/components/jobs-header/jobs-header.module.css +0 -1
- package/lib/components/metric-change-legend/metric-change-legend.js +2 -2
- package/lib/components/metric-change-legend/metric-change-legend.js.map +1 -1
- package/lib/components/metric-change-legend/metric-change-legend.module.css +11 -0
- package/lib/components/metric-run-info/metric-run-info.js +4 -11
- package/lib/components/metric-run-info/metric-run-info.js.map +1 -1
- package/lib/components/metrics-display-selector/metrics-display-selector.module.css +4 -4
- package/lib/components/metrics-table/metrics-table.js +31 -20
- package/lib/components/metrics-table/metrics-table.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.module.css +4 -12
- package/lib/components/metrics-table-options/metrics-table-options.js +5 -6
- package/lib/components/metrics-table-options/metrics-table-options.js.map +1 -1
- package/lib/components/metrics-table-row-count/index.js +18 -0
- package/lib/components/metrics-table-row-count/index.js.map +1 -0
- package/lib/components/metrics-table-row-count/metrics-table-row-count.js +17 -0
- package/lib/components/metrics-table-row-count/metrics-table-row-count.js.map +1 -0
- package/lib/components/metrics-table-row-count/metrics-table-row-count.module.css +5 -0
- package/lib/components/metrics-treemap/metrics-treemap.constants.js +3 -1
- package/lib/components/metrics-treemap/metrics-treemap.constants.js.map +1 -1
- package/lib/components/metrics-treemap/metrics-treemap.js +46 -113
- package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -1
- package/lib/components/metrics-treemap/metrics-treemap.module.css +3 -274
- package/lib/components/metrics-treemap/metrics-treemap.utils.js +81 -16
- package/lib/components/metrics-treemap/metrics-treemap.utils.js.map +1 -1
- package/lib/components/metrics-treemap/tile/index.js +18 -0
- package/lib/components/metrics-treemap/tile/index.js.map +1 -0
- package/lib/components/metrics-treemap/tile/tile.js +79 -0
- package/lib/components/metrics-treemap/tile/tile.js.map +1 -0
- package/lib/components/metrics-treemap/tile/tile.module.css +146 -0
- package/lib/components/metrics-treemap/tile-group/index.js +18 -0
- package/lib/components/metrics-treemap/tile-group/index.js.map +1 -0
- package/lib/components/metrics-treemap/tile-group/tile-group.js +75 -0
- package/lib/components/metrics-treemap/tile-group/tile-group.js.map +1 -0
- package/lib/components/metrics-treemap/tile-group/tile-group.module.css +59 -0
- package/lib/components/metrics-treemap/tile-group-title/index.js +18 -0
- package/lib/components/metrics-treemap/tile-group-title/index.js.map +1 -0
- package/lib/components/metrics-treemap/tile-group-title/tile-group-title.js +24 -0
- package/lib/components/metrics-treemap/tile-group-title/tile-group-title.js.map +1 -0
- package/lib/components/metrics-treemap/tile-group-title/tile-group-title.module.css +44 -0
- package/lib/components/run-info/run-info.module.css +6 -6
- package/lib/components/sort-button/sort-button.module.css +5 -4
- package/lib/components/summary/summary.js +5 -4
- package/lib/components/summary/summary.js.map +1 -1
- package/lib/components/summary/summary.module.css +18 -18
- package/lib/css/default.css +9 -4
- package/lib/css/variables.css +42 -28
- package/lib/layout/box/box.module.css +4 -2
- package/lib/layout/flex-stack/flex-stack.js +2 -2
- package/lib/layout/flex-stack/flex-stack.js.map +1 -1
- package/lib/layout/flex-stack/flex-stack.module.css +65 -10
- package/lib/query-state.js +6 -3
- package/lib/query-state.js.map +1 -1
- package/lib/ui/button/button.js +3 -2
- package/lib/ui/button/button.js.map +1 -1
- package/lib/ui/button/button.module.css +41 -28
- package/lib/ui/control-group/control-group.js +1 -1
- package/lib/ui/control-group/control-group.js.map +1 -1
- package/lib/ui/copy-to-clipboard/copy-to-clipboard.module.css +4 -2
- package/lib/ui/dialog/dialog.js +3 -1
- package/lib/ui/dialog/dialog.js.map +1 -1
- package/lib/ui/dialog/dialog.module.css +16 -5
- package/lib/ui/dropdown/dropdown.js +11 -3
- package/lib/ui/dropdown/dropdown.js.map +1 -1
- package/lib/ui/dropdown/dropdown.module.css +56 -9
- package/lib/ui/filters/filters.js +28 -16
- package/lib/ui/filters/filters.js.map +1 -1
- package/lib/ui/filters/filters.module.css +7 -21
- package/lib/ui/hover-card/hover-card.js +7 -1
- package/lib/ui/hover-card/hover-card.js.map +1 -1
- package/lib/ui/hover-card/hover-card.module.css +14 -10
- package/lib/ui/input/input.module.css +4 -2
- package/lib/ui/table/table.module.css +14 -5
- package/lib/ui/tabs/tabs.module.css +17 -9
- package/lib/ui/tag/tag.module.css +0 -2
- package/lib/ui/textarea/textarea.module.css +4 -2
- package/lib/ui/toolbar/toolbar.js +2 -1
- package/lib/ui/toolbar/toolbar.js.map +1 -1
- package/lib/ui/toolbar/toolbar.module.css +0 -6
- package/lib/ui/tooltip/tooltip.js +6 -1
- package/lib/ui/tooltip/tooltip.js.map +1 -1
- package/lib/ui/tooltip/tooltip.module.css +5 -3
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/portal.js +26 -0
- package/lib/utils/portal.js.map +1 -0
- package/lib-esm/app/app.js +16 -5
- package/lib-esm/app/app.js.map +1 -1
- package/lib-esm/app/app.module.css +13 -9
- package/lib-esm/app/header/header.module.css +1 -3
- package/lib-esm/components/asset-name/asset-name.js +8 -7
- package/lib-esm/components/asset-name/asset-name.js.map +1 -1
- package/lib-esm/components/asset-name/asset-name.module.css +11 -10
- package/lib-esm/components/bundle-assets/bundle-assets.js +4 -2
- package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +0 -12
- package/lib-esm/components/bundle-assets/index.js +2 -1
- package/lib-esm/components/bundle-assets/index.js.map +1 -1
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js +4 -2
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.js +5 -3
- package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.module.css +2 -16
- package/lib-esm/components/bundle-modules/index.js +2 -1
- package/lib-esm/components/bundle-modules/index.js.map +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.js +5 -3
- package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +18 -22
- package/lib-esm/components/entry-info/entry-info.js +4 -2
- package/lib-esm/components/entry-info/entry-info.js.map +1 -1
- package/lib-esm/components/entry-info/entry-info.module.css +8 -2
- package/lib-esm/components/jobs-header/jobs-header.js +1 -1
- package/lib-esm/components/jobs-header/jobs-header.js.map +1 -1
- package/lib-esm/components/jobs-header/jobs-header.module.css +0 -1
- package/lib-esm/components/metric-change-legend/metric-change-legend.js +2 -2
- package/lib-esm/components/metric-change-legend/metric-change-legend.js.map +1 -1
- package/lib-esm/components/metric-change-legend/metric-change-legend.module.css +11 -0
- package/lib-esm/components/metric-run-info/metric-run-info.js +5 -12
- package/lib-esm/components/metric-run-info/metric-run-info.js.map +1 -1
- package/lib-esm/components/metrics-display-selector/metrics-display-selector.module.css +4 -4
- package/lib-esm/components/metrics-table/metrics-table.js +32 -20
- package/lib-esm/components/metrics-table/metrics-table.js.map +1 -1
- package/lib-esm/components/metrics-table/metrics-table.module.css +4 -12
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +6 -7
- package/lib-esm/components/metrics-table-options/metrics-table-options.js.map +1 -1
- package/lib-esm/components/metrics-table-row-count/index.js +2 -0
- package/lib-esm/components/metrics-table-row-count/index.js.map +1 -0
- package/lib-esm/components/metrics-table-row-count/metrics-table-row-count.js +10 -0
- package/lib-esm/components/metrics-table-row-count/metrics-table-row-count.js.map +1 -0
- package/lib-esm/components/metrics-table-row-count/metrics-table-row-count.module.css +5 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js +2 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js.map +1 -1
- package/lib-esm/components/metrics-treemap/metrics-treemap.js +52 -120
- package/lib-esm/components/metrics-treemap/metrics-treemap.js.map +1 -1
- package/lib-esm/components/metrics-treemap/metrics-treemap.module.css +3 -274
- package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js +80 -18
- package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js.map +1 -1
- package/lib-esm/components/metrics-treemap/tile/index.js +2 -0
- package/lib-esm/components/metrics-treemap/tile/index.js.map +1 -0
- package/lib-esm/components/metrics-treemap/tile/tile.js +40 -0
- package/lib-esm/components/metrics-treemap/tile/tile.js.map +1 -0
- package/lib-esm/components/metrics-treemap/tile/tile.module.css +146 -0
- package/lib-esm/components/metrics-treemap/tile-group/index.js +2 -0
- package/lib-esm/components/metrics-treemap/tile-group/index.js.map +1 -0
- package/lib-esm/components/metrics-treemap/tile-group/tile-group.js +35 -0
- package/lib-esm/components/metrics-treemap/tile-group/tile-group.js.map +1 -0
- package/lib-esm/components/metrics-treemap/tile-group/tile-group.module.css +59 -0
- package/lib-esm/components/metrics-treemap/tile-group-title/index.js +2 -0
- package/lib-esm/components/metrics-treemap/tile-group-title/index.js.map +1 -0
- package/lib-esm/components/metrics-treemap/tile-group-title/tile-group-title.js +17 -0
- package/lib-esm/components/metrics-treemap/tile-group-title/tile-group-title.js.map +1 -0
- package/lib-esm/components/metrics-treemap/tile-group-title/tile-group-title.module.css +44 -0
- package/lib-esm/components/run-info/run-info.module.css +6 -6
- package/lib-esm/components/sort-button/sort-button.module.css +5 -4
- package/lib-esm/components/summary/summary.js +5 -4
- package/lib-esm/components/summary/summary.js.map +1 -1
- package/lib-esm/components/summary/summary.module.css +18 -18
- package/lib-esm/css/default.css +9 -4
- package/lib-esm/css/variables.css +42 -28
- package/lib-esm/layout/box/box.module.css +4 -2
- package/lib-esm/layout/flex-stack/flex-stack.js +3 -2
- package/lib-esm/layout/flex-stack/flex-stack.js.map +1 -1
- package/lib-esm/layout/flex-stack/flex-stack.module.css +65 -10
- package/lib-esm/query-state.js +7 -4
- package/lib-esm/query-state.js.map +1 -1
- package/lib-esm/ui/button/button.js +3 -2
- package/lib-esm/ui/button/button.js.map +1 -1
- package/lib-esm/ui/button/button.module.css +41 -28
- package/lib-esm/ui/control-group/control-group.js +1 -1
- package/lib-esm/ui/control-group/control-group.js.map +1 -1
- package/lib-esm/ui/copy-to-clipboard/copy-to-clipboard.module.css +4 -2
- package/lib-esm/ui/dialog/dialog.js +3 -1
- package/lib-esm/ui/dialog/dialog.js.map +1 -1
- package/lib-esm/ui/dialog/dialog.module.css +16 -5
- package/lib-esm/ui/dropdown/dropdown.js +9 -2
- package/lib-esm/ui/dropdown/dropdown.js.map +1 -1
- package/lib-esm/ui/dropdown/dropdown.module.css +56 -9
- package/lib-esm/ui/filters/filters.js +29 -17
- package/lib-esm/ui/filters/filters.js.map +1 -1
- package/lib-esm/ui/filters/filters.module.css +7 -21
- package/lib-esm/ui/hover-card/hover-card.js +7 -1
- package/lib-esm/ui/hover-card/hover-card.js.map +1 -1
- package/lib-esm/ui/hover-card/hover-card.module.css +14 -10
- package/lib-esm/ui/input/input.module.css +4 -2
- package/lib-esm/ui/table/table.module.css +14 -5
- package/lib-esm/ui/tabs/tabs.module.css +17 -9
- package/lib-esm/ui/tag/tag.module.css +0 -2
- package/lib-esm/ui/textarea/textarea.module.css +4 -2
- package/lib-esm/ui/toolbar/toolbar.js +2 -1
- package/lib-esm/ui/toolbar/toolbar.js.map +1 -1
- package/lib-esm/ui/toolbar/toolbar.module.css +0 -6
- package/lib-esm/ui/tooltip/tooltip.js +6 -1
- package/lib-esm/ui/tooltip/tooltip.js.map +1 -1
- package/lib-esm/ui/tooltip/tooltip.module.css +5 -3
- package/lib-esm/utils/index.js +1 -0
- package/lib-esm/utils/index.js.map +1 -1
- package/lib-esm/utils/portal.js +21 -0
- package/lib-esm/utils/portal.js.map +1 -0
- package/package.json +17 -17
- package/src/app/app.jsx +31 -12
- package/src/app/app.module.css +13 -9
- package/src/app/header/header.module.css +1 -3
- package/src/components/asset-name/asset-name.module.css +11 -10
- package/src/components/asset-name/asset-name.tsx +17 -14
- package/src/components/bundle-assets/bundle-assets.module.css +0 -12
- package/src/components/bundle-assets/bundle-assets.tsx +8 -1
- package/src/components/bundle-assets/index.tsx +3 -1
- package/src/components/bundle-assets-totals/bundle-assets-totals.jsx +6 -4
- package/src/components/bundle-modules/bundle-modules.module.css +2 -16
- package/src/components/bundle-modules/bundle-modules.tsx +10 -3
- package/src/components/bundle-modules/index.tsx +3 -1
- package/src/components/bundle-packages/bundle-packages.jsx +14 -3
- package/src/components/bundle-packages/bundle-packages.module.css +18 -22
- package/src/components/entry-info/entry-info.module.css +8 -2
- package/src/components/entry-info/entry-info.tsx +9 -3
- package/src/components/jobs-header/jobs-header.module.css +0 -1
- package/src/components/jobs-header/jobs-header.tsx +2 -2
- package/src/components/metric-change-legend/metric-change-legend.module.css +11 -0
- package/src/components/metric-change-legend/metric-change-legend.tsx +2 -2
- package/src/components/metric-run-info/metric-run-info.stories.tsx +9 -0
- package/src/components/metric-run-info/metric-run-info.tsx +10 -12
- package/src/components/metrics-display-selector/metrics-display-selector.module.css +4 -4
- package/src/components/metrics-table/metrics-table.module.css +4 -12
- package/src/components/metrics-table/metrics-table.tsx +70 -39
- package/src/components/metrics-table-options/metrics-table-options.tsx +14 -15
- package/src/components/metrics-table-row-count/index.ts +1 -0
- package/src/components/metrics-table-row-count/metrics-table-row-count.module.css +5 -0
- package/src/components/metrics-table-row-count/metrics-table-row-count.tsx +21 -0
- package/src/components/metrics-treemap/metrics-treemap.constants.ts +9 -0
- package/src/components/metrics-treemap/metrics-treemap.module.css +3 -274
- package/src/components/metrics-treemap/metrics-treemap.stories.utils.ts +46 -0
- package/src/components/metrics-treemap/metrics-treemap.tsx +123 -428
- package/src/components/metrics-treemap/metrics-treemap.utils.ts +161 -27
- package/src/components/metrics-treemap/tile/index.ts +1 -0
- package/src/components/metrics-treemap/tile/tile.module.css +146 -0
- package/src/components/metrics-treemap/tile/tile.stories.tsx +139 -0
- package/src/components/metrics-treemap/tile/tile.tsx +121 -0
- package/src/components/metrics-treemap/tile-group/index.ts +1 -0
- package/src/components/metrics-treemap/tile-group/tile-group.module.css +59 -0
- package/src/components/metrics-treemap/tile-group/tile-group.stories.tsx +163 -0
- package/src/components/metrics-treemap/tile-group/tile-group.tsx +177 -0
- package/src/components/metrics-treemap/tile-group-title/index.ts +1 -0
- package/src/components/metrics-treemap/tile-group-title/tile-group-title.module.css +44 -0
- package/src/components/metrics-treemap/tile-group-title/tile-group-title.stories.tsx +88 -0
- package/src/components/metrics-treemap/tile-group-title/tile-group-title.tsx +51 -0
- package/src/components/run-info/run-info.module.css +6 -6
- package/src/components/sort-button/sort-button.module.css +5 -4
- package/src/components/summary/summary.module.css +18 -18
- package/src/components/summary/summary.tsx +9 -8
- package/src/css/default.css +9 -4
- package/src/css/variables.css +42 -28
- package/src/layout/box/box.module.css +4 -2
- package/src/layout/flex-stack/flex-stack.module.css +65 -10
- package/src/layout/flex-stack/flex-stack.stories.tsx +68 -9
- package/src/layout/flex-stack/flex-stack.tsx +24 -4
- package/src/query-state.tsx +9 -4
- package/src/ui/button/button.module.css +41 -28
- package/src/ui/button/button.stories.tsx +1 -1
- package/src/ui/button/button.tsx +3 -1
- package/src/ui/control-group/control-group.tsx +1 -1
- package/src/ui/copy-to-clipboard/copy-to-clipboard.module.css +4 -2
- package/src/ui/dialog/dialog.module.css +16 -5
- package/src/ui/dialog/dialog.stories.tsx +8 -0
- package/src/ui/dialog/dialog.tsx +7 -0
- package/src/ui/dropdown/dropdown.module.css +56 -9
- package/src/ui/dropdown/dropdown.stories.tsx +6 -0
- package/src/ui/dropdown/dropdown.tsx +13 -2
- package/src/ui/filters/filters.module.css +7 -21
- package/src/ui/filters/filters.tsx +131 -67
- package/src/ui/hover-card/hover-card.module.css +14 -10
- package/src/ui/hover-card/hover-card.tsx +7 -1
- package/src/ui/input/input.module.css +4 -2
- package/src/ui/table/table.module.css +14 -5
- package/src/ui/tabs/tabs.module.css +17 -9
- package/src/ui/tag/tag.module.css +0 -2
- package/src/ui/textarea/textarea.module.css +4 -2
- package/src/ui/toolbar/toolbar.jsx +4 -1
- package/src/ui/toolbar/toolbar.module.css +0 -6
- package/src/ui/tooltip/tooltip.module.css +5 -3
- package/src/ui/tooltip/tooltip.tsx +6 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/portal.ts +34 -0
- package/types/components/metric-run-info/metric-run-info.d.ts +1 -0
- package/types/components/metrics-table/metrics-table.d.ts +2 -1
- package/types/components/metrics-table-row-count/index.d.ts +1 -0
- package/types/components/metrics-table-row-count/metrics-table-row-count.d.ts +7 -0
- package/types/components/metrics-treemap/metrics-treemap.constants.d.ts +2 -0
- package/types/components/metrics-treemap/metrics-treemap.utils.d.ts +16 -5
- package/types/components/metrics-treemap/tile/index.d.ts +1 -0
- package/types/components/metrics-treemap/tile/tile.d.ts +11 -0
- package/types/components/metrics-treemap/tile-group/index.d.ts +1 -0
- package/types/components/metrics-treemap/tile-group/tile-group.d.ts +20 -0
- package/types/components/metrics-treemap/tile-group-title/index.d.ts +1 -0
- package/types/components/metrics-treemap/tile-group-title/tile-group-title.d.ts +12 -0
- package/types/layout/flex-stack/flex-stack.d.ts +6 -2
- package/types/ui/button/button.d.ts +1 -0
- package/types/ui/dropdown/dropdown.d.ts +3 -1
- package/types/ui/filters/filters.d.ts +2 -1
- package/types/utils/index.d.ts +1 -0
- package/types/utils/portal.d.ts +2 -0
- package/vitest.config.ts +4 -0
- package/lib/components/metrics-table-options/metrics-table-options.module.css +0 -15
- package/lib-esm/components/metrics-table-options/metrics-table-options.module.css +0 -15
- package/src/components/metrics-table-options/metrics-table-options.module.css +0 -15
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { action } from 'storybook/actions';
|
|
4
|
+
import { HierarchyRectangularNode, hierarchy, treemap, treemapSquarify } from 'd3';
|
|
5
|
+
import type { ReportMetricRow } from '@bundle-stats/utils';
|
|
6
|
+
|
|
7
|
+
import { getWrapperDecorator } from '../../../stories';
|
|
8
|
+
import {
|
|
9
|
+
type Tree,
|
|
10
|
+
type TreeNode,
|
|
11
|
+
SQUARIFY_RATIO,
|
|
12
|
+
PADDING_OUTER,
|
|
13
|
+
PADDING_INNER,
|
|
14
|
+
NESTED_PADDING,
|
|
15
|
+
NESTED_PADDING_TOP,
|
|
16
|
+
NESTED_PADDING_LEFT,
|
|
17
|
+
} from '../metrics-treemap.constants';
|
|
18
|
+
import {
|
|
19
|
+
CURRENT_VALUE_BY_DELTA_TYPE as VALUES,
|
|
20
|
+
createReportMetricRow,
|
|
21
|
+
} from '../metrics-treemap.stories.utils';
|
|
22
|
+
import { getTreemapNodes, getTreemapNodesGroupedByPath } from '../metrics-treemap.utils';
|
|
23
|
+
import { TileGroup } from '.';
|
|
24
|
+
|
|
25
|
+
const WIDTH = 480;
|
|
26
|
+
const HEIGHT = 270;
|
|
27
|
+
|
|
28
|
+
const ITEMS = [
|
|
29
|
+
createReportMetricRow('src/components/button/button.tsx', VALUES.NEGATIVE),
|
|
30
|
+
createReportMetricRow('src/components/button/button.css', VALUES.NO_CHANGE),
|
|
31
|
+
createReportMetricRow('src/components/input/input.tsx', VALUES.HIGH_NEGATIVE),
|
|
32
|
+
createReportMetricRow('src/components/input/input.css', VALUES.LOW_POSITIVE),
|
|
33
|
+
createReportMetricRow('src/utils/format.ts', VALUES.POSITIVE),
|
|
34
|
+
createReportMetricRow('src/assets/logo.svg', VALUES.NO_CHANGE),
|
|
35
|
+
createReportMetricRow('src/index.ts', VALUES.NO_CHANGE),
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const ITEMS_NO_CHANGE = [
|
|
39
|
+
createReportMetricRow('src/components/button.tsx', VALUES.NO_CHANGE),
|
|
40
|
+
createReportMetricRow('src/components/input.tsx', VALUES.NO_CHANGE),
|
|
41
|
+
createReportMetricRow('src/index.ts', VALUES.NO_CHANGE),
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
const ITEMS_POSITIVE = [
|
|
45
|
+
createReportMetricRow('src/components/button.tsx', VALUES.POSITIVE),
|
|
46
|
+
createReportMetricRow('src/components/input.tsx', VALUES.HIGH_POSITIVE),
|
|
47
|
+
createReportMetricRow('src/index.ts', VALUES.NO_CHANGE),
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Resolve the root tile group props - same layout as `MetricsTreemap`
|
|
52
|
+
*/
|
|
53
|
+
function getTileGroupArgs(
|
|
54
|
+
treeNodes: Tree,
|
|
55
|
+
options: { nested?: boolean; width?: number; height?: number } = {},
|
|
56
|
+
) {
|
|
57
|
+
const { nested = false, width = WIDTH, height = HEIGHT } = options;
|
|
58
|
+
|
|
59
|
+
const customHierarchy = hierarchy<Tree>(treeNodes);
|
|
60
|
+
customHierarchy.sum((node) => node.value);
|
|
61
|
+
// @ts-expect-error
|
|
62
|
+
customHierarchy.sort((a, b) => b.value - a.value);
|
|
63
|
+
|
|
64
|
+
let createTreemapLayout = treemap()
|
|
65
|
+
.size([width, height])
|
|
66
|
+
.tile(treemapSquarify.ratio(SQUARIFY_RATIO))
|
|
67
|
+
.paddingOuter(PADDING_OUTER);
|
|
68
|
+
|
|
69
|
+
if (nested) {
|
|
70
|
+
createTreemapLayout = createTreemapLayout
|
|
71
|
+
.padding(NESTED_PADDING)
|
|
72
|
+
.paddingLeft(NESTED_PADDING_LEFT)
|
|
73
|
+
.paddingTop(NESTED_PADDING_TOP);
|
|
74
|
+
} else {
|
|
75
|
+
createTreemapLayout = createTreemapLayout.paddingInner(PADDING_INNER);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// @ts-expect-error
|
|
79
|
+
const rootNode = createTreemapLayout(customHierarchy) as HierarchyRectangularNode<TreeNode>;
|
|
80
|
+
const rootData = rootNode.data as Tree;
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
title: nested ? rootData.label : undefined,
|
|
84
|
+
total: rootData.total,
|
|
85
|
+
id: rootData.id,
|
|
86
|
+
childNodes: rootNode.children,
|
|
87
|
+
nested,
|
|
88
|
+
left: rootNode.x0,
|
|
89
|
+
top: rootNode.y0,
|
|
90
|
+
absoluteLeft: rootNode.x0,
|
|
91
|
+
absoluteTop: rootNode.y0,
|
|
92
|
+
width: rootNode.x1 - rootNode.x0,
|
|
93
|
+
height: rootNode.y1 - rootNode.y0,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function getNestedTileGroupArgs(
|
|
98
|
+
items: Array<ReportMetricRow>,
|
|
99
|
+
options: { width?: number; height?: number } = {},
|
|
100
|
+
) {
|
|
101
|
+
return getTileGroupArgs(getTreemapNodesGroupedByPath(items), { ...options, nested: true });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const meta = {
|
|
105
|
+
title: 'Components/MetricsTreemap/TileGroup',
|
|
106
|
+
component: TileGroup,
|
|
107
|
+
decorators: [
|
|
108
|
+
// Tile groups are absolutely positioned inside the treemap canvas
|
|
109
|
+
(Story, { args }) => (
|
|
110
|
+
<div
|
|
111
|
+
style={{
|
|
112
|
+
position: 'relative',
|
|
113
|
+
width: args.width,
|
|
114
|
+
height: args.height,
|
|
115
|
+
background: 'var(--color-background)',
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
<Story />
|
|
119
|
+
</div>
|
|
120
|
+
),
|
|
121
|
+
getWrapperDecorator(),
|
|
122
|
+
],
|
|
123
|
+
args: {
|
|
124
|
+
...getTileGroupArgs(getTreemapNodes(ITEMS)),
|
|
125
|
+
onItemClick: action('ITEM_CLICK'),
|
|
126
|
+
onGroupClick: action('GROUP_CLICK'),
|
|
127
|
+
},
|
|
128
|
+
} satisfies Meta<typeof TileGroup>;
|
|
129
|
+
|
|
130
|
+
export default meta;
|
|
131
|
+
|
|
132
|
+
type Story = StoryObj<typeof meta>;
|
|
133
|
+
|
|
134
|
+
export const Default: Story = {};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Nested
|
|
138
|
+
*/
|
|
139
|
+
export const Nested: Story = {
|
|
140
|
+
args: getNestedTileGroupArgs(ITEMS),
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Delta type
|
|
145
|
+
*/
|
|
146
|
+
export const NestedNoChange: Story = {
|
|
147
|
+
args: getNestedTileGroupArgs(ITEMS_NO_CHANGE),
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const NestedPositive: Story = {
|
|
151
|
+
args: getNestedTileGroupArgs(ITEMS_POSITIVE),
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Size
|
|
156
|
+
*/
|
|
157
|
+
export const SizeSmall: Story = {
|
|
158
|
+
args: getNestedTileGroupArgs(ITEMS, { height: 28 }),
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const SizeMinimal: Story = {
|
|
162
|
+
args: getNestedTileGroupArgs(ITEMS, { height: 20 }),
|
|
163
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import React, { type ComponentProps, type MouseEventHandler, useCallback, useMemo } from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import type { HierarchyRectangularNode } from 'd3';
|
|
4
|
+
|
|
5
|
+
import type { TreeLeaf, TreeNode, Tree } from '../metrics-treemap.constants';
|
|
6
|
+
import * as I18N from '../metrics-treemap.i18n';
|
|
7
|
+
import { getGroupRunInfo, resolveTileGroupSizeDisplay } from '../metrics-treemap.utils';
|
|
8
|
+
import { type TileProps, Tile } from '../tile';
|
|
9
|
+
import { TileGroupTitle } from '../tile-group-title';
|
|
10
|
+
import css from './tile-group.module.css';
|
|
11
|
+
|
|
12
|
+
export interface TileGroupProps extends ComponentProps<'div'> {
|
|
13
|
+
/**
|
|
14
|
+
* Node title
|
|
15
|
+
*/
|
|
16
|
+
title?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Group sum
|
|
19
|
+
*/
|
|
20
|
+
total?: Tree['total'];
|
|
21
|
+
/**
|
|
22
|
+
* Node id
|
|
23
|
+
*/
|
|
24
|
+
id: string;
|
|
25
|
+
/**
|
|
26
|
+
* Node children
|
|
27
|
+
*/
|
|
28
|
+
childNodes: HierarchyRectangularNode<TreeNode>['children'];
|
|
29
|
+
/**
|
|
30
|
+
* Nested treemap variation
|
|
31
|
+
*/
|
|
32
|
+
nested?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* On click tile handler
|
|
35
|
+
*/
|
|
36
|
+
onItemClick: TileProps['onClick'];
|
|
37
|
+
/**
|
|
38
|
+
* On click group title
|
|
39
|
+
*/
|
|
40
|
+
onGroupClick?: (groupId: string) => void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Node rectangle dimensions
|
|
44
|
+
*/
|
|
45
|
+
width?: number;
|
|
46
|
+
height?: number;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Node rectangle relative coordinates (relative to parent)
|
|
50
|
+
*/
|
|
51
|
+
left: number;
|
|
52
|
+
top: number;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Node rectangle absolute coordinates (relative to canvas)
|
|
56
|
+
*/
|
|
57
|
+
absoluteLeft: number;
|
|
58
|
+
absoluteTop: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const TileGroup = (props: TileGroupProps) => {
|
|
62
|
+
const {
|
|
63
|
+
title = '',
|
|
64
|
+
total,
|
|
65
|
+
id,
|
|
66
|
+
childNodes,
|
|
67
|
+
nested = false,
|
|
68
|
+
onItemClick,
|
|
69
|
+
onGroupClick,
|
|
70
|
+
left,
|
|
71
|
+
top,
|
|
72
|
+
width,
|
|
73
|
+
height,
|
|
74
|
+
absoluteLeft,
|
|
75
|
+
absoluteTop,
|
|
76
|
+
} = props;
|
|
77
|
+
|
|
78
|
+
const onClick: MouseEventHandler<HTMLDivElement> = useCallback(
|
|
79
|
+
(event) => {
|
|
80
|
+
onGroupClick?.(id);
|
|
81
|
+
event.stopPropagation();
|
|
82
|
+
},
|
|
83
|
+
[onGroupClick, id],
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const displaySize = useMemo(
|
|
87
|
+
() => resolveTileGroupSizeDisplay(width || 0, height || 0),
|
|
88
|
+
[width, height],
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
// Prepare data
|
|
92
|
+
const groupRunInfo = useMemo(() => (total ? getGroupRunInfo(total) : undefined), [total]);
|
|
93
|
+
|
|
94
|
+
const rootClassName = cx(
|
|
95
|
+
css.root,
|
|
96
|
+
css[`tileGroup--${groupRunInfo?.deltaType}`],
|
|
97
|
+
css[`tileGroup--${displaySize}`],
|
|
98
|
+
nested && css.nested,
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus */
|
|
102
|
+
if (title && displaySize === 'minimal') {
|
|
103
|
+
return (
|
|
104
|
+
<div
|
|
105
|
+
onClick={onClick}
|
|
106
|
+
role="button"
|
|
107
|
+
aria-label={I18N.TILE_GROUP_LABEL}
|
|
108
|
+
className={rootClassName}
|
|
109
|
+
style={{ left, top, width, height }}
|
|
110
|
+
>
|
|
111
|
+
<TileGroupTitle id={id} fill />
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (title && displaySize === 'small') {
|
|
117
|
+
return (
|
|
118
|
+
<div
|
|
119
|
+
onClick={onClick}
|
|
120
|
+
role="button"
|
|
121
|
+
aria-label={I18N.TILE_GROUP_LABEL}
|
|
122
|
+
style={{ left, top, width, height }}
|
|
123
|
+
className={rootClassName}
|
|
124
|
+
>
|
|
125
|
+
<TileGroupTitle id={id} title={title} fill />
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<div
|
|
132
|
+
onClick={onClick}
|
|
133
|
+
role="button"
|
|
134
|
+
aria-label={I18N.TILE_GROUP_LABEL}
|
|
135
|
+
className={cx(rootClassName, css.tileGroupSizeDefault)}
|
|
136
|
+
style={{ left, top, width, height }}
|
|
137
|
+
>
|
|
138
|
+
<TileGroupTitle id={id} title={title} runInfo={groupRunInfo?.runInfo} />
|
|
139
|
+
{childNodes?.map((childNode) => {
|
|
140
|
+
if ('children' in childNode) {
|
|
141
|
+
const groupData = childNode.data as Tree;
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<TileGroup
|
|
145
|
+
title={groupData.label}
|
|
146
|
+
total={groupData.total}
|
|
147
|
+
id={groupData.id}
|
|
148
|
+
childNodes={childNode.children}
|
|
149
|
+
nested={nested}
|
|
150
|
+
left={childNode.x0 - absoluteLeft}
|
|
151
|
+
top={childNode.y0 - absoluteTop}
|
|
152
|
+
absoluteLeft={childNode.x0}
|
|
153
|
+
absoluteTop={childNode.y0}
|
|
154
|
+
width={childNode.x1 - childNode.x0}
|
|
155
|
+
height={childNode.y1 - childNode.y0}
|
|
156
|
+
onItemClick={onItemClick}
|
|
157
|
+
onGroupClick={onGroupClick}
|
|
158
|
+
key={groupData.id}
|
|
159
|
+
/>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
<Tile
|
|
165
|
+
data={childNode.data as TreeLeaf}
|
|
166
|
+
left={childNode.x0 - absoluteLeft}
|
|
167
|
+
top={childNode.y0 - absoluteTop}
|
|
168
|
+
width={childNode.x1 - childNode.x0}
|
|
169
|
+
height={childNode.y1 - childNode.y0}
|
|
170
|
+
onClick={onItemClick}
|
|
171
|
+
key={childNode.data.id}
|
|
172
|
+
/>
|
|
173
|
+
);
|
|
174
|
+
})}
|
|
175
|
+
</div>
|
|
176
|
+
);
|
|
177
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tile-group-title';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
width: 100%;
|
|
3
|
+
cursor: default;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tileGroupTitleContent {
|
|
7
|
+
width: 100%;
|
|
8
|
+
padding: var(--space-xxxsmall) calc(var(--space-xxxsmall) / 2) var(--space-xxxsmall)
|
|
9
|
+
var(--space-xxsmall);
|
|
10
|
+
border-radius: var(--radius-xsmall);
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
color: var(--color-text);
|
|
14
|
+
font-family: var(--font-family-fixed);
|
|
15
|
+
font-size: 10px;
|
|
16
|
+
line-height: var(--space-small);
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.tileGroupTitleText,
|
|
23
|
+
.tileGroupTitleTotal {
|
|
24
|
+
flex: 0 0 auto;
|
|
25
|
+
min-width: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.tileGroupTitleTotal {
|
|
29
|
+
margin-left: var(--space-xxsmall);
|
|
30
|
+
color: var(--color-text-light);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.root:hover .tileGroupTitleText {
|
|
34
|
+
text-decoration: underline;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Fill variation */
|
|
38
|
+
.fill {
|
|
39
|
+
height: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.fill .tileGroupTitleContent {
|
|
43
|
+
min-height: 100%;
|
|
44
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { type MetricRunInfo, METRIC_TYPE_CONFIGS, getMetricRunInfo } from '@bundle-stats/utils';
|
|
4
|
+
|
|
5
|
+
import { getWrapperDecorator } from '../../../stories';
|
|
6
|
+
import { BASELINE_VALUE, CURRENT_VALUE_BY_DELTA_TYPE } from '../metrics-treemap.stories.utils';
|
|
7
|
+
import { TileGroupTitle } from '.';
|
|
8
|
+
|
|
9
|
+
const meta = {
|
|
10
|
+
title: 'Components/MetricsTreemap/TileGroupTitle',
|
|
11
|
+
component: TileGroupTitle,
|
|
12
|
+
decorators: [
|
|
13
|
+
// Outline the group area to visualize the title size
|
|
14
|
+
(Story) => (
|
|
15
|
+
<div style={{ width: 320, height: 48, outline: '1px dashed var(--color-outline)' }}>
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
18
|
+
),
|
|
19
|
+
getWrapperDecorator(),
|
|
20
|
+
],
|
|
21
|
+
args: {
|
|
22
|
+
id: 'src/components',
|
|
23
|
+
title: 'components',
|
|
24
|
+
runInfo: getMetricRunInfo(
|
|
25
|
+
METRIC_TYPE_CONFIGS.METRIC_TYPE_FILE_SIZE,
|
|
26
|
+
CURRENT_VALUE_BY_DELTA_TYPE.NEGATIVE,
|
|
27
|
+
BASELINE_VALUE,
|
|
28
|
+
) as MetricRunInfo,
|
|
29
|
+
fill: false,
|
|
30
|
+
},
|
|
31
|
+
argTypes: {
|
|
32
|
+
fill: {
|
|
33
|
+
control: { type: 'boolean' },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
} satisfies Meta<typeof TileGroupTitle>;
|
|
37
|
+
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
type Story = StoryObj<typeof meta>;
|
|
41
|
+
|
|
42
|
+
export const Default: Story = {};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Run info
|
|
46
|
+
*/
|
|
47
|
+
export const NoBaseline: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
runInfo: getMetricRunInfo(
|
|
50
|
+
METRIC_TYPE_CONFIGS.METRIC_TYPE_FILE_SIZE,
|
|
51
|
+
CURRENT_VALUE_BY_DELTA_TYPE.NEGATIVE,
|
|
52
|
+
) as MetricRunInfo,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const NoRunInfo: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
runInfo: undefined,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Title
|
|
64
|
+
*/
|
|
65
|
+
export const NoTitle: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
title: undefined,
|
|
68
|
+
runInfo: undefined,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Fill
|
|
74
|
+
*/
|
|
75
|
+
export const Fill: Story = {
|
|
76
|
+
args: {
|
|
77
|
+
fill: true,
|
|
78
|
+
runInfo: undefined,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const FillNoTitle: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
fill: true,
|
|
85
|
+
title: undefined,
|
|
86
|
+
runInfo: undefined,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import type { MetricRunInfo } from '@bundle-stats/utils';
|
|
4
|
+
|
|
5
|
+
import css from './tile-group-title.module.css';
|
|
6
|
+
|
|
7
|
+
interface TileGroupTitleContentProps {
|
|
8
|
+
title?: string;
|
|
9
|
+
runInfo?: MetricRunInfo;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const TileGroupTitleContent = (props: TileGroupTitleContentProps) => {
|
|
13
|
+
const { title, runInfo } = props;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div className={css.tileGroupTitleContent}>
|
|
17
|
+
{title && <span className={css.tileGroupTitleText}>{title}</span>}
|
|
18
|
+
{runInfo && (
|
|
19
|
+
<span className={css.tileGroupTitleTotal}>
|
|
20
|
+
{runInfo.displayValue}
|
|
21
|
+
{'displayDelta' in runInfo && `(${runInfo.displayDeltaPercentage})`}
|
|
22
|
+
</span>
|
|
23
|
+
)}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type TileGroupTitleProps = TileGroupTitleContentProps & {
|
|
29
|
+
/**
|
|
30
|
+
* Node id - used to resolve the tooltip content on hover
|
|
31
|
+
*/
|
|
32
|
+
id: string;
|
|
33
|
+
/**
|
|
34
|
+
* Fill the group height - when the title is missing or the group does not render any children
|
|
35
|
+
*/
|
|
36
|
+
fill?: boolean;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const TileGroupTitle = (props: TileGroupTitleProps) => {
|
|
40
|
+
const { id, fill = false, ...restProps } = props;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
className={cx(css.root, fill && css.fill)}
|
|
45
|
+
data-treemap-id={id}
|
|
46
|
+
data-treemap-tile-group-title
|
|
47
|
+
>
|
|
48
|
+
<TileGroupTitleContent {...restProps} />
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
line-height: inherit;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
47
46
|
.delta {
|
|
48
47
|
font-weight: bold;
|
|
49
48
|
font-size: var(--size-small);
|
|
@@ -62,10 +61,11 @@
|
|
|
62
61
|
.titleTooltipIcon[aria-controls=''] {
|
|
63
62
|
opacity: 0;
|
|
64
63
|
visibility: hidden;
|
|
64
|
+
/* delay hiding until the fade-out completes */
|
|
65
65
|
transition:
|
|
66
|
-
opacity var(--transition-duration-out)
|
|
67
|
-
color var(--transition-duration-out)
|
|
68
|
-
visibility 0s;
|
|
66
|
+
opacity var(--transition-duration-out) var(--transition-timing-function),
|
|
67
|
+
color var(--transition-duration-out) var(--transition-timing-function),
|
|
68
|
+
visibility 0s linear var(--transition-duration-out);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.root:hover .titleHoverCardIcon span,
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
opacity: 1;
|
|
74
74
|
visibility: visible;
|
|
75
75
|
transition:
|
|
76
|
-
opacity var(--transition-duration-in)
|
|
77
|
-
color var(--transition-duration-in)
|
|
76
|
+
opacity var(--transition-duration-in) var(--transition-timing-function),
|
|
77
|
+
color var(--transition-duration-in) var(--transition-timing-function),
|
|
78
78
|
visibility 0s;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
overflow: hidden;
|
|
19
19
|
right: -2px; /* compensate for the button padding */
|
|
20
20
|
color: var(--color-text-ultra-light);
|
|
21
|
-
transition: var(--transition-out);
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
.directionIcon {
|
|
@@ -29,14 +28,13 @@
|
|
|
29
28
|
|
|
30
29
|
.directionActive {
|
|
31
30
|
color: var(--color-text);
|
|
32
|
-
transition: var(--transition-in);
|
|
31
|
+
transition-duration: var(--transition-duration-in);
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
.direction:hover,
|
|
36
35
|
.direction:active,
|
|
37
36
|
.direction:focus {
|
|
38
37
|
color: var(--color-text-dark);
|
|
39
|
-
transition: var(--transition-in);
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
.directionAsc {
|
|
@@ -71,6 +69,9 @@
|
|
|
71
69
|
.direction {
|
|
72
70
|
pointer-events: none;
|
|
73
71
|
opacity: 0;
|
|
72
|
+
transition-property: color, opacity;
|
|
73
|
+
transition-duration: var(--transition-duration-out);
|
|
74
|
+
transition-timing-function: var(--transition-timing-function);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
.active .direction,
|
|
@@ -79,5 +80,5 @@
|
|
|
79
80
|
.interactive:hover:focus .direction {
|
|
80
81
|
pointer-events: auto;
|
|
81
82
|
opacity: 1;
|
|
82
|
-
transition: var(--transition-in);
|
|
83
|
+
transition-duration: var(--transition-duration-in);
|
|
83
84
|
}
|
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
.row {
|
|
7
7
|
width: 100%;
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: stretch;
|
|
10
|
-
flex-wrap: wrap;
|
|
11
|
-
gap: var(--space-small);
|
|
12
8
|
}
|
|
13
9
|
|
|
14
10
|
.rowGroup {
|
|
@@ -26,13 +22,6 @@
|
|
|
26
22
|
margin-top: var(--summary-gap);
|
|
27
23
|
}
|
|
28
24
|
|
|
29
|
-
.items {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: stretch;
|
|
32
|
-
flex-wrap: wrap;
|
|
33
|
-
gap: var(--space-medium);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
25
|
.item {
|
|
37
26
|
flex: 1 1 10%; /* force equal sizes */
|
|
38
27
|
min-width: 8em;
|
|
@@ -42,7 +31,7 @@
|
|
|
42
31
|
}
|
|
43
32
|
|
|
44
33
|
.item::before {
|
|
45
|
-
content:
|
|
34
|
+
content: '';
|
|
46
35
|
border-radius: var(--radius-medium);
|
|
47
36
|
background: var(--color-highlight);
|
|
48
37
|
display: block;
|
|
@@ -53,16 +42,20 @@
|
|
|
53
42
|
bottom: calc(0px - var(--space-xsmall));
|
|
54
43
|
left: calc(0px - var(--space-xsmall));
|
|
55
44
|
opacity: 0;
|
|
56
|
-
transition:
|
|
45
|
+
transition-property: opacity;
|
|
46
|
+
transition-duration: var(--transition-duration-out);
|
|
47
|
+
transition-timing-function: var(--transition-timing-function);
|
|
57
48
|
}
|
|
58
49
|
|
|
50
|
+
.item:focus::before,
|
|
51
|
+
.item:active::before,
|
|
59
52
|
.item:hover::before {
|
|
60
53
|
opacity: 1;
|
|
61
|
-
transition: var(--transition-in);
|
|
54
|
+
transition-duration: var(--transition-duration-in);
|
|
62
55
|
}
|
|
63
56
|
|
|
64
57
|
.item + .item::after {
|
|
65
|
-
content:
|
|
58
|
+
content: '';
|
|
66
59
|
border-radius: var(--radius-medium);
|
|
67
60
|
background: var(--color-outline);
|
|
68
61
|
display: block;
|
|
@@ -72,10 +65,17 @@
|
|
|
72
65
|
top: var(--space-xxsmall);
|
|
73
66
|
bottom: var(--space-xxsmall);
|
|
74
67
|
opacity: 1;
|
|
75
|
-
transition:
|
|
68
|
+
transition-property: opacity;
|
|
69
|
+
transition-duration: var(--transition-duration-out);
|
|
70
|
+
transition-timing-function: var(--transition-timing-function);
|
|
76
71
|
}
|
|
77
72
|
|
|
78
|
-
.item:
|
|
73
|
+
.item:focus::after,
|
|
74
|
+
.item:active::after,
|
|
75
|
+
.item:hover::after,
|
|
76
|
+
.item:focus + .item::after,
|
|
77
|
+
.item:active + .item::after,
|
|
78
|
+
.item:hover + .item::after {
|
|
79
79
|
opacity: 0;
|
|
80
|
-
transition: var(--transition-in);
|
|
80
|
+
transition-duration: var(--transition-duration-in);
|
|
81
81
|
}
|