@shipfox/react-ui 0.15.0 → 0.17.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.
- package/dist/components/button-group/button-group.stories.js +4 -4
- package/dist/components/card/card.d.ts +24 -0
- package/dist/components/card/card.js +56 -0
- package/dist/components/card/card.stories.js +216 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +3 -0
- package/dist/components/dashboard/components/charts/bar-chart.d.ts +30 -0
- package/dist/components/dashboard/components/charts/bar-chart.js +150 -0
- package/dist/components/dashboard/components/charts/bar-chart.stories.js +287 -0
- package/dist/components/dashboard/components/charts/chart-tooltip.d.ts +14 -0
- package/dist/components/dashboard/components/charts/chart-tooltip.js +46 -0
- package/dist/components/dashboard/components/charts/colors.d.ts +12 -0
- package/dist/components/dashboard/components/charts/colors.js +20 -0
- package/dist/components/dashboard/components/charts/index.d.ts +6 -0
- package/dist/components/dashboard/components/charts/index.js +7 -0
- package/dist/components/dashboard/components/charts/line-chart.d.ts +28 -0
- package/dist/components/dashboard/components/charts/line-chart.js +152 -0
- package/dist/components/dashboard/components/charts/line-chart.stories.js +257 -0
- package/dist/components/dashboard/components/charts/utils.d.ts +13 -0
- package/dist/components/dashboard/components/charts/utils.js +18 -0
- package/dist/components/dashboard/components/dashboard-alert.d.ts +8 -0
- package/dist/components/dashboard/components/dashboard-alert.js +24 -0
- package/dist/components/dashboard/components/kpi-card.d.ts +15 -0
- package/dist/components/dashboard/components/kpi-card.js +77 -0
- package/dist/components/dashboard/components/mobile-sidebar.d.ts +19 -0
- package/dist/components/dashboard/components/mobile-sidebar.js +50 -0
- package/dist/components/dashboard/components/organization-selector.d.ts +24 -1
- package/dist/components/dashboard/components/organization-selector.js +93 -70
- package/dist/components/dashboard/components/sidebar.d.ts +24 -0
- package/dist/components/dashboard/components/sidebar.js +218 -0
- package/dist/components/dashboard/context/dashboard-context.d.ts +70 -0
- package/dist/components/dashboard/context/dashboard-context.js +175 -0
- package/dist/components/dashboard/context/index.d.ts +8 -0
- package/dist/components/dashboard/context/index.js +6 -0
- package/dist/components/dashboard/context/types.d.ts +50 -0
- package/dist/components/dashboard/context/types.js +7 -0
- package/dist/components/dashboard/context/utils.d.ts +28 -0
- package/dist/components/dashboard/context/utils.js +53 -0
- package/dist/components/dashboard/dashboard.d.ts +27 -1
- package/dist/components/dashboard/dashboard.js +76 -36
- package/dist/components/dashboard/filters/expression-filter-bar.d.ts +42 -0
- package/dist/components/dashboard/filters/expression-filter-bar.js +80 -0
- package/dist/components/dashboard/filters/index.d.ts +6 -0
- package/dist/components/dashboard/filters/index.js +5 -0
- package/dist/components/dashboard/index.d.ts +25 -1
- package/dist/components/dashboard/index.js +22 -1
- package/dist/components/dashboard/pages/analytics-page.d.ts +20 -0
- package/dist/components/dashboard/pages/analytics-page.js +258 -0
- package/dist/components/dashboard/pages/index.d.ts +6 -0
- package/dist/components/dashboard/pages/index.js +6 -0
- package/dist/components/dashboard/pages/jobs-page.d.ts +20 -0
- package/dist/components/dashboard/pages/jobs-page.js +56 -0
- package/dist/components/dashboard/table/index.d.ts +6 -0
- package/dist/components/dashboard/table/index.js +5 -0
- package/dist/components/dashboard/table/table-wrapper.d.ts +104 -0
- package/dist/components/dashboard/table/table-wrapper.js +93 -0
- package/dist/components/dashboard/toolbar/filter-button.d.ts +12 -0
- package/dist/components/dashboard/toolbar/filter-button.js +124 -0
- package/dist/components/dashboard/toolbar/index.d.ts +13 -0
- package/dist/components/dashboard/toolbar/index.js +10 -0
- package/dist/components/dashboard/toolbar/page-toolbar.d.ts +75 -0
- package/dist/components/dashboard/toolbar/page-toolbar.js +208 -0
- package/dist/components/dashboard/toolbar/toolbar-actions.d.ts +52 -0
- package/dist/components/dashboard/toolbar/toolbar-actions.js +51 -0
- package/dist/components/dashboard/toolbar/toolbar-search.d.ts +21 -0
- package/dist/components/dashboard/toolbar/toolbar-search.js +123 -0
- package/dist/components/dashboard/toolbar/view-dropdown.d.ts +11 -0
- package/dist/components/dashboard/toolbar/view-dropdown.js +113 -0
- package/dist/components/empty-state/empty-state.d.ts +10 -0
- package/dist/components/empty-state/empty-state.js +40 -0
- package/dist/components/empty-state/empty-state.stories.js +74 -0
- package/dist/components/empty-state/index.d.ts +2 -0
- package/dist/components/empty-state/index.js +3 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/components/modal/modal.js +3 -3
- package/dist/components/search/search-inline.js +1 -1
- package/dist/components/search/search-modal.js +13 -7
- package/dist/components/select/select.d.ts +3 -1
- package/dist/components/select/select.js +2 -1
- package/dist/components/sheet/index.d.ts +2 -0
- package/dist/components/sheet/index.js +3 -0
- package/dist/components/sheet/sheet.d.ts +33 -0
- package/dist/components/sheet/sheet.js +163 -0
- package/dist/components/sheet/sheet.stories.js +368 -0
- package/dist/components/table/data-table.d.ts +19 -2
- package/dist/components/table/data-table.js +89 -72
- package/dist/components/table/table.js +1 -1
- package/dist/components/table/table.stories.components.js +6 -28
- package/dist/styles.css +1 -1
- package/package.json +12 -4
- package/.storybook/main.ts +0 -35
- package/.storybook/preview.tsx +0 -66
- package/.storybook/vitest.setup.ts +0 -4
- package/.turbo/turbo-build.log +0 -19
- package/.turbo/turbo-check.log +0 -6
- package/.turbo/turbo-type.log +0 -5
- package/CHANGELOG.md +0 -114
- package/argos.config.ts +0 -33
- package/dist/build-css-entry.js.map +0 -1
- package/dist/colors.stories.conts.d.ts.map +0 -1
- package/dist/colors.stories.conts.js.map +0 -1
- package/dist/colors.stories.js.map +0 -1
- package/dist/components/alert/alert.d.ts.map +0 -1
- package/dist/components/alert/alert.js.map +0 -1
- package/dist/components/alert/alert.stories.js.map +0 -1
- package/dist/components/alert/index.d.ts.map +0 -1
- package/dist/components/alert/index.js.map +0 -1
- package/dist/components/avatar/avatar-group.d.ts.map +0 -1
- package/dist/components/avatar/avatar-group.js.map +0 -1
- package/dist/components/avatar/avatar.d.ts.map +0 -1
- package/dist/components/avatar/avatar.js.map +0 -1
- package/dist/components/avatar/avatar.stories.js.map +0 -1
- package/dist/components/avatar/index.d.ts.map +0 -1
- package/dist/components/avatar/index.js.map +0 -1
- package/dist/components/badge/badge.d.ts.map +0 -1
- package/dist/components/badge/badge.js.map +0 -1
- package/dist/components/badge/badge.stories.js.map +0 -1
- package/dist/components/badge/icon-badge.d.ts.map +0 -1
- package/dist/components/badge/icon-badge.js.map +0 -1
- package/dist/components/badge/index.d.ts.map +0 -1
- package/dist/components/badge/index.js.map +0 -1
- package/dist/components/badge/status-badge.d.ts.map +0 -1
- package/dist/components/badge/status-badge.js.map +0 -1
- package/dist/components/badge/user-badge.d.ts.map +0 -1
- package/dist/components/badge/user-badge.js.map +0 -1
- package/dist/components/button/button-link.d.ts.map +0 -1
- package/dist/components/button/button-link.js.map +0 -1
- package/dist/components/button/button-link.stories.js.map +0 -1
- package/dist/components/button/button.d.ts.map +0 -1
- package/dist/components/button/button.js.map +0 -1
- package/dist/components/button/button.stories.js.map +0 -1
- package/dist/components/button/icon-button.d.ts.map +0 -1
- package/dist/components/button/icon-button.js.map +0 -1
- package/dist/components/button/icon-button.stories.js.map +0 -1
- package/dist/components/button/index.d.ts.map +0 -1
- package/dist/components/button/index.js.map +0 -1
- package/dist/components/button-group/button-group.d.ts.map +0 -1
- package/dist/components/button-group/button-group.js.map +0 -1
- package/dist/components/button-group/button-group.stories.js.map +0 -1
- package/dist/components/button-group/index.d.ts.map +0 -1
- package/dist/components/button-group/index.js.map +0 -1
- package/dist/components/calendar/calendar.d.ts.map +0 -1
- package/dist/components/calendar/calendar.js.map +0 -1
- package/dist/components/calendar/index.d.ts.map +0 -1
- package/dist/components/calendar/index.js.map +0 -1
- package/dist/components/checkbox/checkbox-label.d.ts.map +0 -1
- package/dist/components/checkbox/checkbox-label.js.map +0 -1
- package/dist/components/checkbox/checkbox-links.d.ts.map +0 -1
- package/dist/components/checkbox/checkbox-links.js.map +0 -1
- package/dist/components/checkbox/checkbox.d.ts.map +0 -1
- package/dist/components/checkbox/checkbox.js.map +0 -1
- package/dist/components/checkbox/checkbox.stories.js.map +0 -1
- package/dist/components/checkbox/index.d.ts.map +0 -1
- package/dist/components/checkbox/index.js.map +0 -1
- package/dist/components/code-block/code-block-footer.d.ts.map +0 -1
- package/dist/components/code-block/code-block-footer.js.map +0 -1
- package/dist/components/code-block/code-block.d.ts.map +0 -1
- package/dist/components/code-block/code-block.js.map +0 -1
- package/dist/components/code-block/code-block.stories.js.map +0 -1
- package/dist/components/code-block/code-content.d.ts.map +0 -1
- package/dist/components/code-block/code-content.js.map +0 -1
- package/dist/components/code-block/code-copy-button.d.ts.map +0 -1
- package/dist/components/code-block/code-copy-button.js.map +0 -1
- package/dist/components/code-block/code-tabs.d.ts.map +0 -1
- package/dist/components/code-block/code-tabs.js.map +0 -1
- package/dist/components/code-block/index.d.ts.map +0 -1
- package/dist/components/code-block/index.js.map +0 -1
- package/dist/components/command/command.d.ts.map +0 -1
- package/dist/components/command/command.js.map +0 -1
- package/dist/components/command/command.stories.js.map +0 -1
- package/dist/components/command/index.d.ts.map +0 -1
- package/dist/components/command/index.js.map +0 -1
- package/dist/components/confetti/confetti.d.ts.map +0 -1
- package/dist/components/confetti/confetti.js.map +0 -1
- package/dist/components/confetti/confetti.stories.js.map +0 -1
- package/dist/components/confetti/index.d.ts.map +0 -1
- package/dist/components/confetti/index.js.map +0 -1
- package/dist/components/dashboard/components/analytics-content.d.ts +0 -2
- package/dist/components/dashboard/components/analytics-content.d.ts.map +0 -1
- package/dist/components/dashboard/components/analytics-content.js +0 -180
- package/dist/components/dashboard/components/analytics-content.js.map +0 -1
- package/dist/components/dashboard/components/animated-logo.d.ts.map +0 -1
- package/dist/components/dashboard/components/animated-logo.js.map +0 -1
- package/dist/components/dashboard/components/complete-setup-button.d.ts.map +0 -1
- package/dist/components/dashboard/components/complete-setup-button.js.map +0 -1
- package/dist/components/dashboard/components/jobs-content.d.ts +0 -2
- package/dist/components/dashboard/components/jobs-content.d.ts.map +0 -1
- package/dist/components/dashboard/components/jobs-content.js +0 -69
- package/dist/components/dashboard/components/jobs-content.js.map +0 -1
- package/dist/components/dashboard/components/mobile-menu.d.ts.map +0 -1
- package/dist/components/dashboard/components/mobile-menu.js.map +0 -1
- package/dist/components/dashboard/components/organization-selector.d.ts.map +0 -1
- package/dist/components/dashboard/components/organization-selector.js.map +0 -1
- package/dist/components/dashboard/components/top-menu.d.ts.map +0 -1
- package/dist/components/dashboard/components/top-menu.js.map +0 -1
- package/dist/components/dashboard/components/topbar-button.d.ts.map +0 -1
- package/dist/components/dashboard/components/topbar-button.js.map +0 -1
- package/dist/components/dashboard/components/topbar.d.ts.map +0 -1
- package/dist/components/dashboard/components/topbar.js.map +0 -1
- package/dist/components/dashboard/components/user-profile.d.ts.map +0 -1
- package/dist/components/dashboard/components/user-profile.js.map +0 -1
- package/dist/components/dashboard/dashboard.d.ts.map +0 -1
- package/dist/components/dashboard/dashboard.js.map +0 -1
- package/dist/components/dashboard/dashboard.stories.js.map +0 -1
- package/dist/components/dashboard/index.d.ts.map +0 -1
- package/dist/components/dashboard/index.js.map +0 -1
- package/dist/components/date-picker/date-picker.d.ts.map +0 -1
- package/dist/components/date-picker/date-picker.js.map +0 -1
- package/dist/components/date-picker/date-picker.stories.js.map +0 -1
- package/dist/components/date-picker/index.d.ts.map +0 -1
- package/dist/components/date-picker/index.js.map +0 -1
- package/dist/components/date-time-range-picker/date-time-range-picker.d.ts.map +0 -1
- package/dist/components/date-time-range-picker/date-time-range-picker.js.map +0 -1
- package/dist/components/date-time-range-picker/index.d.ts.map +0 -1
- package/dist/components/date-time-range-picker/index.js.map +0 -1
- package/dist/components/dot-grid/dot-grid.d.ts.map +0 -1
- package/dist/components/dot-grid/dot-grid.js.map +0 -1
- package/dist/components/dot-grid/index.d.ts.map +0 -1
- package/dist/components/dot-grid/index.js.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.js.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.stories.js.map +0 -1
- package/dist/components/dropdown-menu/index.d.ts.map +0 -1
- package/dist/components/dropdown-menu/index.js.map +0 -1
- package/dist/components/dynamic-item/dynamic-item.d.ts.map +0 -1
- package/dist/components/dynamic-item/dynamic-item.js.map +0 -1
- package/dist/components/dynamic-item/dynamic-item.stories.js.map +0 -1
- package/dist/components/dynamic-item/index.d.ts.map +0 -1
- package/dist/components/dynamic-item/index.js.map +0 -1
- package/dist/components/form/form.d.ts.map +0 -1
- package/dist/components/form/form.js.map +0 -1
- package/dist/components/form/form.stories.js.map +0 -1
- package/dist/components/form/index.d.ts.map +0 -1
- package/dist/components/form/index.js.map +0 -1
- package/dist/components/icon/custom/badge.d.ts.map +0 -1
- package/dist/components/icon/custom/badge.js.map +0 -1
- package/dist/components/icon/custom/check-circle-solid.d.ts.map +0 -1
- package/dist/components/icon/custom/check-circle-solid.js.map +0 -1
- package/dist/components/icon/custom/circle-dotted-line.d.ts.map +0 -1
- package/dist/components/icon/custom/circle-dotted-line.js.map +0 -1
- package/dist/components/icon/custom/component-fill.d.ts.map +0 -1
- package/dist/components/icon/custom/component-fill.js.map +0 -1
- package/dist/components/icon/custom/component-line.d.ts.map +0 -1
- package/dist/components/icon/custom/component-line.js.map +0 -1
- package/dist/components/icon/custom/ellipse-mini-solid.d.ts.map +0 -1
- package/dist/components/icon/custom/ellipse-mini-solid.js.map +0 -1
- package/dist/components/icon/custom/index.d.ts.map +0 -1
- package/dist/components/icon/custom/index.js.map +0 -1
- package/dist/components/icon/custom/info-tooltip-fill.d.ts.map +0 -1
- package/dist/components/icon/custom/info-tooltip-fill.js.map +0 -1
- package/dist/components/icon/custom/resize.d.ts.map +0 -1
- package/dist/components/icon/custom/resize.js.map +0 -1
- package/dist/components/icon/custom/shipfox-logo.d.ts.map +0 -1
- package/dist/components/icon/custom/shipfox-logo.js.map +0 -1
- package/dist/components/icon/custom/slack-logo.d.ts.map +0 -1
- package/dist/components/icon/custom/slack-logo.js.map +0 -1
- package/dist/components/icon/custom/spinner.d.ts.map +0 -1
- package/dist/components/icon/custom/spinner.js.map +0 -1
- package/dist/components/icon/custom/stripe-logo.d.ts.map +0 -1
- package/dist/components/icon/custom/stripe-logo.js.map +0 -1
- package/dist/components/icon/custom/thunder.d.ts.map +0 -1
- package/dist/components/icon/custom/thunder.js.map +0 -1
- package/dist/components/icon/custom/x-circle-solid.d.ts.map +0 -1
- package/dist/components/icon/custom/x-circle-solid.js.map +0 -1
- package/dist/components/icon/icon.d.ts.map +0 -1
- package/dist/components/icon/icon.js.map +0 -1
- package/dist/components/icon/icon.stories.js.map +0 -1
- package/dist/components/icon/index.d.ts.map +0 -1
- package/dist/components/icon/index.js.map +0 -1
- package/dist/components/icon/remixicon-registry.d.ts.map +0 -1
- package/dist/components/icon/remixicon-registry.js.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/inline-tips/index.d.ts.map +0 -1
- package/dist/components/inline-tips/index.js.map +0 -1
- package/dist/components/inline-tips/inline-tips.d.ts.map +0 -1
- package/dist/components/inline-tips/inline-tips.js.map +0 -1
- package/dist/components/inline-tips/inline-tips.stories.js.map +0 -1
- package/dist/components/input/index.d.ts.map +0 -1
- package/dist/components/input/index.js.map +0 -1
- package/dist/components/input/input.d.ts.map +0 -1
- package/dist/components/input/input.js.map +0 -1
- package/dist/components/input/input.stories.js.map +0 -1
- package/dist/components/item/index.d.ts.map +0 -1
- package/dist/components/item/index.js.map +0 -1
- package/dist/components/item/item.d.ts.map +0 -1
- package/dist/components/item/item.js.map +0 -1
- package/dist/components/item/item.stories.js.map +0 -1
- package/dist/components/kbd/index.d.ts.map +0 -1
- package/dist/components/kbd/index.js.map +0 -1
- package/dist/components/kbd/kbd.d.ts.map +0 -1
- package/dist/components/kbd/kbd.js.map +0 -1
- package/dist/components/kbd/kbd.stories.js.map +0 -1
- package/dist/components/label/index.d.ts.map +0 -1
- package/dist/components/label/index.js.map +0 -1
- package/dist/components/label/label.d.ts.map +0 -1
- package/dist/components/label/label.js.map +0 -1
- package/dist/components/label/label.stories.js.map +0 -1
- package/dist/components/modal/index.d.ts.map +0 -1
- package/dist/components/modal/index.js.map +0 -1
- package/dist/components/modal/modal.d.ts.map +0 -1
- package/dist/components/modal/modal.js.map +0 -1
- package/dist/components/modal/modal.stories.js.map +0 -1
- package/dist/components/moving-border/index.d.ts.map +0 -1
- package/dist/components/moving-border/index.js.map +0 -1
- package/dist/components/moving-border/moving-border.d.ts.map +0 -1
- package/dist/components/moving-border/moving-border.js.map +0 -1
- package/dist/components/popover/index.d.ts.map +0 -1
- package/dist/components/popover/index.js.map +0 -1
- package/dist/components/popover/popover.d.ts.map +0 -1
- package/dist/components/popover/popover.js.map +0 -1
- package/dist/components/search/index.d.ts.map +0 -1
- package/dist/components/search/index.js.map +0 -1
- package/dist/components/search/search-context.d.ts.map +0 -1
- package/dist/components/search/search-context.js.map +0 -1
- package/dist/components/search/search-inline.d.ts.map +0 -1
- package/dist/components/search/search-inline.js.map +0 -1
- package/dist/components/search/search-modal.d.ts.map +0 -1
- package/dist/components/search/search-modal.js.map +0 -1
- package/dist/components/search/search-trigger.d.ts.map +0 -1
- package/dist/components/search/search-trigger.js.map +0 -1
- package/dist/components/search/search-variants.d.ts.map +0 -1
- package/dist/components/search/search-variants.js.map +0 -1
- package/dist/components/search/search.d.ts.map +0 -1
- package/dist/components/search/search.js.map +0 -1
- package/dist/components/search/search.stories.js.map +0 -1
- package/dist/components/select/index.d.ts.map +0 -1
- package/dist/components/select/index.js.map +0 -1
- package/dist/components/select/select.d.ts.map +0 -1
- package/dist/components/select/select.js.map +0 -1
- package/dist/components/select/select.stories.js.map +0 -1
- package/dist/components/shiny-text/index.d.ts.map +0 -1
- package/dist/components/shiny-text/index.js.map +0 -1
- package/dist/components/shiny-text/shiny-text.d.ts.map +0 -1
- package/dist/components/shiny-text/shiny-text.js.map +0 -1
- package/dist/components/skeleton/index.d.ts.map +0 -1
- package/dist/components/skeleton/index.js.map +0 -1
- package/dist/components/skeleton/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton/skeleton.js.map +0 -1
- package/dist/components/skeleton/skeleton.stories.js.map +0 -1
- package/dist/components/table/data-table.d.ts.map +0 -1
- package/dist/components/table/data-table.js.map +0 -1
- package/dist/components/table/index.d.ts.map +0 -1
- package/dist/components/table/index.js.map +0 -1
- package/dist/components/table/table-column-header.d.ts.map +0 -1
- package/dist/components/table/table-column-header.js.map +0 -1
- package/dist/components/table/table-pagination.d.ts.map +0 -1
- package/dist/components/table/table-pagination.js.map +0 -1
- package/dist/components/table/table.d.ts.map +0 -1
- package/dist/components/table/table.js.map +0 -1
- package/dist/components/table/table.stories.columns.d.ts.map +0 -1
- package/dist/components/table/table.stories.columns.js.map +0 -1
- package/dist/components/table/table.stories.components.d.ts.map +0 -1
- package/dist/components/table/table.stories.components.js.map +0 -1
- package/dist/components/table/table.stories.data.d.ts.map +0 -1
- package/dist/components/table/table.stories.data.js.map +0 -1
- package/dist/components/table/table.stories.js.map +0 -1
- package/dist/components/tabs/index.d.ts.map +0 -1
- package/dist/components/tabs/index.js.map +0 -1
- package/dist/components/tabs/tabs.d.ts.map +0 -1
- package/dist/components/tabs/tabs.js.map +0 -1
- package/dist/components/tabs/tabs.stories.js.map +0 -1
- package/dist/components/textarea/index.d.ts.map +0 -1
- package/dist/components/textarea/index.js.map +0 -1
- package/dist/components/textarea/textarea.d.ts.map +0 -1
- package/dist/components/textarea/textarea.js.map +0 -1
- package/dist/components/textarea/textarea.stories.js.map +0 -1
- package/dist/components/theme/index.d.ts.map +0 -1
- package/dist/components/theme/index.js.map +0 -1
- package/dist/components/theme/theme-provider.d.ts.map +0 -1
- package/dist/components/theme/theme-provider.js.map +0 -1
- package/dist/components/toast/index.d.ts.map +0 -1
- package/dist/components/toast/index.js.map +0 -1
- package/dist/components/toast/toast-custom.d.ts.map +0 -1
- package/dist/components/toast/toast-custom.js.map +0 -1
- package/dist/components/toast/toast.d.ts.map +0 -1
- package/dist/components/toast/toast.js.map +0 -1
- package/dist/components/toast/toast.stories.js.map +0 -1
- package/dist/components/tooltip/index.d.ts.map +0 -1
- package/dist/components/tooltip/index.js.map +0 -1
- package/dist/components/tooltip/tooltip.d.ts.map +0 -1
- package/dist/components/tooltip/tooltip.js.map +0 -1
- package/dist/components/tooltip/tooltip.stories.js.map +0 -1
- package/dist/components/typography/code.d.ts.map +0 -1
- package/dist/components/typography/code.js.map +0 -1
- package/dist/components/typography/code.stories.js.map +0 -1
- package/dist/components/typography/header.d.ts.map +0 -1
- package/dist/components/typography/header.js.map +0 -1
- package/dist/components/typography/header.stories.js.map +0 -1
- package/dist/components/typography/index.d.ts.map +0 -1
- package/dist/components/typography/index.js.map +0 -1
- package/dist/components/typography/text.d.ts.map +0 -1
- package/dist/components/typography/text.js.map +0 -1
- package/dist/components/typography/text.stories.js.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/useCopy.d.ts.map +0 -1
- package/dist/hooks/useCopy.js.map +0 -1
- package/dist/hooks/useCopyToClipboard.d.ts.map +0 -1
- package/dist/hooks/useCopyToClipboard.js.map +0 -1
- package/dist/hooks/useMediaQuery.d.ts.map +0 -1
- package/dist/hooks/useMediaQuery.js.map +0 -1
- package/dist/hooks/useResolvedTheme.d.ts.map +0 -1
- package/dist/hooks/useResolvedTheme.js.map +0 -1
- package/dist/hooks/useShikiHighlight.d.ts.map +0 -1
- package/dist/hooks/useShikiHighlight.js.map +0 -1
- package/dist/hooks/useShikiStyleInjection.d.ts.map +0 -1
- package/dist/hooks/useShikiStyleInjection.js.map +0 -1
- package/dist/hooks/useTheme.d.ts.map +0 -1
- package/dist/hooks/useTheme.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/onboarding/sign-in.stories.js.map +0 -1
- package/dist/state/theme.d.ts.map +0 -1
- package/dist/state/theme.js.map +0 -1
- package/dist/utils/avatar.d.ts.map +0 -1
- package/dist/utils/avatar.js.map +0 -1
- package/dist/utils/clipboard.d.ts.map +0 -1
- package/dist/utils/clipboard.js.map +0 -1
- package/dist/utils/cn.d.ts.map +0 -1
- package/dist/utils/cn.js.map +0 -1
- package/dist/utils/date.d.ts.map +0 -1
- package/dist/utils/date.js.map +0 -1
- package/dist/utils/debounce.d.ts.map +0 -1
- package/dist/utils/debounce.js.map +0 -1
- package/dist/utils/format/chart.d.ts.map +0 -1
- package/dist/utils/format/chart.js.map +0 -1
- package/dist/utils/format/date.d.ts.map +0 -1
- package/dist/utils/format/date.js.map +0 -1
- package/dist/utils/format/duration.d.ts.map +0 -1
- package/dist/utils/format/duration.js.map +0 -1
- package/dist/utils/format/index.d.ts.map +0 -1
- package/dist/utils/format/index.js.map +0 -1
- package/dist/utils/format/number.d.ts.map +0 -1
- package/dist/utils/format/number.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/index.css +0 -1018
- package/src/assets/illustration-1.svg +0 -92
- package/src/assets/illustration-2.svg +0 -14
- package/src/assets/illustration-gradient.svg +0 -7049
- package/src/build-css-entry.ts +0 -3
- package/src/colors.stories.conts.ts +0 -164
- package/src/colors.stories.tsx +0 -66
- package/src/components/alert/alert.stories.tsx +0 -178
- package/src/components/alert/alert.tsx +0 -291
- package/src/components/alert/index.ts +0 -1
- package/src/components/avatar/avatar-group.tsx +0 -186
- package/src/components/avatar/avatar.stories.tsx +0 -179
- package/src/components/avatar/avatar.tsx +0 -219
- package/src/components/avatar/index.ts +0 -2
- package/src/components/badge/badge.stories.tsx +0 -468
- package/src/components/badge/badge.tsx +0 -147
- package/src/components/badge/icon-badge.tsx +0 -43
- package/src/components/badge/index.ts +0 -4
- package/src/components/badge/status-badge.tsx +0 -43
- package/src/components/badge/user-badge.tsx +0 -34
- package/src/components/button/button-link.stories.tsx +0 -86
- package/src/components/button/button-link.tsx +0 -76
- package/src/components/button/button.stories.tsx +0 -138
- package/src/components/button/button.tsx +0 -91
- package/src/components/button/icon-button.stories.tsx +0 -228
- package/src/components/button/icon-button.tsx +0 -95
- package/src/components/button/index.ts +0 -3
- package/src/components/button-group/button-group.stories.tsx +0 -361
- package/src/components/button-group/button-group.tsx +0 -111
- package/src/components/button-group/index.ts +0 -1
- package/src/components/calendar/calendar.tsx +0 -90
- package/src/components/calendar/index.ts +0 -1
- package/src/components/checkbox/checkbox-label.tsx +0 -125
- package/src/components/checkbox/checkbox-links.tsx +0 -92
- package/src/components/checkbox/checkbox.stories.tsx +0 -391
- package/src/components/checkbox/checkbox.tsx +0 -71
- package/src/components/checkbox/index.ts +0 -3
- package/src/components/code-block/code-block-footer.tsx +0 -197
- package/src/components/code-block/code-block.stories.tsx +0 -323
- package/src/components/code-block/code-block.tsx +0 -283
- package/src/components/code-block/code-content.tsx +0 -63
- package/src/components/code-block/code-copy-button.tsx +0 -73
- package/src/components/code-block/code-tabs.tsx +0 -170
- package/src/components/code-block/index.ts +0 -3
- package/src/components/command/command.stories.tsx +0 -133
- package/src/components/command/command.tsx +0 -265
- package/src/components/command/index.ts +0 -1
- package/src/components/confetti/confetti.stories.tsx +0 -38
- package/src/components/confetti/confetti.tsx +0 -140
- package/src/components/confetti/index.ts +0 -1
- package/src/components/dashboard/components/analytics-content.tsx +0 -102
- package/src/components/dashboard/components/animated-logo.tsx +0 -25
- package/src/components/dashboard/components/complete-setup-button.tsx +0 -30
- package/src/components/dashboard/components/jobs-content.tsx +0 -51
- package/src/components/dashboard/components/mobile-menu.tsx +0 -50
- package/src/components/dashboard/components/organization-selector.tsx +0 -51
- package/src/components/dashboard/components/top-menu.tsx +0 -26
- package/src/components/dashboard/components/topbar-button.tsx +0 -27
- package/src/components/dashboard/components/topbar.tsx +0 -40
- package/src/components/dashboard/components/user-profile.tsx +0 -90
- package/src/components/dashboard/dashboard.stories.tsx +0 -25
- package/src/components/dashboard/dashboard.tsx +0 -61
- package/src/components/dashboard/index.ts +0 -1
- package/src/components/date-picker/date-picker.stories.tsx +0 -230
- package/src/components/date-picker/date-picker.tsx +0 -179
- package/src/components/date-picker/index.ts +0 -1
- package/src/components/date-time-range-picker/date-time-range-picker.tsx +0 -211
- package/src/components/date-time-range-picker/index.ts +0 -1
- package/src/components/dot-grid/dot-grid.tsx +0 -325
- package/src/components/dot-grid/index.ts +0 -1
- package/src/components/dropdown-menu/dropdown-menu.stories.tsx +0 -384
- package/src/components/dropdown-menu/dropdown-menu.tsx +0 -416
- package/src/components/dropdown-menu/index.ts +0 -1
- package/src/components/dynamic-item/dynamic-item.stories.tsx +0 -266
- package/src/components/dynamic-item/dynamic-item.tsx +0 -74
- package/src/components/dynamic-item/index.ts +0 -1
- package/src/components/form/form.stories.tsx +0 -505
- package/src/components/form/form.tsx +0 -154
- package/src/components/form/index.ts +0 -1
- package/src/components/icon/custom/badge.tsx +0 -17
- package/src/components/icon/custom/check-circle-solid.tsx +0 -24
- package/src/components/icon/custom/circle-dotted-line.tsx +0 -17
- package/src/components/icon/custom/component-fill.tsx +0 -17
- package/src/components/icon/custom/component-line.tsx +0 -17
- package/src/components/icon/custom/ellipse-mini-solid.tsx +0 -17
- package/src/components/icon/custom/index.ts +0 -14
- package/src/components/icon/custom/info-tooltip-fill.tsx +0 -21
- package/src/components/icon/custom/resize.tsx +0 -17
- package/src/components/icon/custom/shipfox-logo.tsx +0 -20
- package/src/components/icon/custom/slack-logo.tsx +0 -35
- package/src/components/icon/custom/spinner.tsx +0 -144
- package/src/components/icon/custom/stripe-logo.tsx +0 -27
- package/src/components/icon/custom/thunder.tsx +0 -17
- package/src/components/icon/custom/x-circle-solid.tsx +0 -24
- package/src/components/icon/icon.stories.tsx +0 -31
- package/src/components/icon/icon.tsx +0 -90
- package/src/components/icon/index.ts +0 -1
- package/src/components/icon/remixicon-registry.ts +0 -24
- package/src/components/index.ts +0 -36
- package/src/components/inline-tips/index.ts +0 -1
- package/src/components/inline-tips/inline-tips.stories.tsx +0 -131
- package/src/components/inline-tips/inline-tips.tsx +0 -132
- package/src/components/input/index.ts +0 -1
- package/src/components/input/input.stories.tsx +0 -138
- package/src/components/input/input.tsx +0 -43
- package/src/components/item/index.ts +0 -1
- package/src/components/item/item.stories.tsx +0 -159
- package/src/components/item/item.tsx +0 -182
- package/src/components/kbd/index.ts +0 -1
- package/src/components/kbd/kbd.stories.tsx +0 -64
- package/src/components/kbd/kbd.tsx +0 -32
- package/src/components/label/index.ts +0 -1
- package/src/components/label/label.stories.tsx +0 -67
- package/src/components/label/label.tsx +0 -15
- package/src/components/modal/index.ts +0 -1
- package/src/components/modal/modal.stories.tsx +0 -448
- package/src/components/modal/modal.tsx +0 -311
- package/src/components/moving-border/index.ts +0 -1
- package/src/components/moving-border/moving-border.tsx +0 -67
- package/src/components/popover/index.ts +0 -1
- package/src/components/popover/popover.tsx +0 -60
- package/src/components/renovate.json +0 -23
- package/src/components/search/index.ts +0 -28
- package/src/components/search/search-context.tsx +0 -78
- package/src/components/search/search-inline.tsx +0 -107
- package/src/components/search/search-modal.tsx +0 -198
- package/src/components/search/search-trigger.tsx +0 -47
- package/src/components/search/search-variants.ts +0 -88
- package/src/components/search/search.stories.tsx +0 -392
- package/src/components/search/search.tsx +0 -47
- package/src/components/select/index.ts +0 -1
- package/src/components/select/select.stories.tsx +0 -207
- package/src/components/select/select.tsx +0 -220
- package/src/components/shiny-text/index.ts +0 -1
- package/src/components/shiny-text/shiny-text.tsx +0 -21
- package/src/components/skeleton/index.ts +0 -1
- package/src/components/skeleton/skeleton.stories.tsx +0 -178
- package/src/components/skeleton/skeleton.tsx +0 -14
- package/src/components/table/data-table.tsx +0 -254
- package/src/components/table/index.ts +0 -5
- package/src/components/table/table-column-header.tsx +0 -141
- package/src/components/table/table-pagination.tsx +0 -161
- package/src/components/table/table.stories.columns.tsx +0 -198
- package/src/components/table/table.stories.components.tsx +0 -104
- package/src/components/table/table.stories.data.ts +0 -117
- package/src/components/table/table.stories.tsx +0 -256
- package/src/components/table/table.tsx +0 -95
- package/src/components/tabs/index.ts +0 -1
- package/src/components/tabs/tabs.stories.tsx +0 -100
- package/src/components/tabs/tabs.tsx +0 -380
- package/src/components/textarea/index.ts +0 -1
- package/src/components/textarea/textarea.stories.tsx +0 -196
- package/src/components/textarea/textarea.tsx +0 -42
- package/src/components/theme/index.ts +0 -1
- package/src/components/theme/theme-provider.tsx +0 -50
- package/src/components/toast/index.ts +0 -2
- package/src/components/toast/toast-custom.tsx +0 -154
- package/src/components/toast/toast.stories.tsx +0 -369
- package/src/components/toast/toast.tsx +0 -41
- package/src/components/tooltip/index.ts +0 -1
- package/src/components/tooltip/tooltip.stories.tsx +0 -284
- package/src/components/tooltip/tooltip.tsx +0 -121
- package/src/components/typography/code.stories.tsx +0 -36
- package/src/components/typography/code.tsx +0 -38
- package/src/components/typography/header.stories.tsx +0 -27
- package/src/components/typography/header.tsx +0 -41
- package/src/components/typography/index.ts +0 -3
- package/src/components/typography/text.stories.tsx +0 -67
- package/src/components/typography/text.tsx +0 -50
- package/src/hooks/index.ts +0 -6
- package/src/hooks/useCopy.ts +0 -0
- package/src/hooks/useCopyToClipboard.ts +0 -20
- package/src/hooks/useMediaQuery.ts +0 -87
- package/src/hooks/useResolvedTheme.ts +0 -34
- package/src/hooks/useShikiHighlight.ts +0 -140
- package/src/hooks/useShikiStyleInjection.ts +0 -34
- package/src/hooks/useTheme.ts +0 -10
- package/src/index.ts +0 -4
- package/src/onboarding/sign-in.stories.tsx +0 -85
- package/src/state/theme.ts +0 -15
- package/src/utils/avatar.ts +0 -27
- package/src/utils/clipboard.ts +0 -4
- package/src/utils/cn.ts +0 -6
- package/src/utils/date.test.ts +0 -119
- package/src/utils/date.ts +0 -99
- package/src/utils/debounce.ts +0 -15
- package/src/utils/format/chart.ts +0 -16
- package/src/utils/format/date.test.ts +0 -65
- package/src/utils/format/date.ts +0 -75
- package/src/utils/format/duration.test.ts +0 -58
- package/src/utils/format/duration.ts +0 -82
- package/src/utils/format/index.ts +0 -4
- package/src/utils/format/number.test.ts +0 -38
- package/src/utils/format/number.ts +0 -33
- package/src/utils/index.ts +0 -6
- package/test/global.ts +0 -3
- package/test/setup.ts +0 -9
- package/tsconfig.build.json +0 -19
- package/tsconfig.json +0 -11
- package/tsconfig.test.json +0 -12
- package/vercel.json +0 -8
- package/vite.css.config.ts +0 -30
- package/vitest.config.ts +0 -44
|
@@ -1,87 +1,110 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Avatar } from '../../../components/avatar/index.js';
|
|
3
3
|
import { Button } from '../../../components/button/index.js';
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from '../../../components/dropdown-menu/index.js';
|
|
4
5
|
import { Icon } from '../../../components/icon/index.js';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import { cn } from '../../../utils/cn.js';
|
|
8
|
+
const organizations = [
|
|
9
|
+
{
|
|
10
|
+
id: 'stripe',
|
|
11
|
+
name: 'Stripe',
|
|
12
|
+
logo: 'stripe'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 'shipfox',
|
|
16
|
+
name: 'Shipfox',
|
|
17
|
+
logo: 'shipfox'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'github',
|
|
21
|
+
name: 'GitHub',
|
|
22
|
+
logo: 'github'
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
export function OrganizationSelector({ defaultValue = 'stripe', onOrganizationChange, onSettingsClick, onNewOrganizationClick, className }) {
|
|
26
|
+
const [selectedOrg, setSelectedOrg] = useState(defaultValue);
|
|
27
|
+
const currentOrg = organizations.find((org)=>org.id === selectedOrg) || organizations[0];
|
|
28
|
+
const handleOrganizationSelect = (orgId)=>{
|
|
29
|
+
setSelectedOrg(orgId);
|
|
30
|
+
onOrganizationChange?.(orgId);
|
|
31
|
+
};
|
|
32
|
+
return /*#__PURE__*/ _jsxs(DropdownMenu, {
|
|
9
33
|
children: [
|
|
10
|
-
/*#__PURE__*/ _jsx(
|
|
11
|
-
|
|
12
|
-
children: /*#__PURE__*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
34
|
+
/*#__PURE__*/ _jsx(DropdownMenuTrigger, {
|
|
35
|
+
asChild: true,
|
|
36
|
+
children: /*#__PURE__*/ _jsxs(Button, {
|
|
37
|
+
variant: "transparent",
|
|
38
|
+
className: cn('w-200 h-40 shadow-none bg-background-neutral-base hover:bg-background-neutral-hover', 'rounded-none gap-8 pl-12 border-l min-[321px]:border-r border-border-neutral-strong', 'justify-start', className),
|
|
39
|
+
children: [
|
|
40
|
+
/*#__PURE__*/ _jsx(Avatar, {
|
|
41
|
+
size: "3xs",
|
|
42
|
+
content: "logo",
|
|
43
|
+
logoName: currentOrg.logo,
|
|
44
|
+
radius: "rounded"
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ _jsx("span", {
|
|
47
|
+
className: "flex-1 text-left truncate text-sm text-foreground-neutral-subtle",
|
|
48
|
+
children: currentOrg.name
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ _jsx(Icon, {
|
|
51
|
+
name: "expandUpDownLine",
|
|
52
|
+
className: "size-14 text-foreground-neutral-muted shrink-0"
|
|
53
|
+
})
|
|
54
|
+
]
|
|
17
55
|
})
|
|
18
56
|
}),
|
|
19
|
-
/*#__PURE__*/ _jsxs(
|
|
57
|
+
/*#__PURE__*/ _jsxs(DropdownMenuContent, {
|
|
58
|
+
side: "bottom",
|
|
59
|
+
align: "start",
|
|
60
|
+
size: "md",
|
|
61
|
+
className: "min-w-200",
|
|
20
62
|
children: [
|
|
21
|
-
/*#__PURE__*/
|
|
22
|
-
|
|
23
|
-
children:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/*#__PURE__*/ _jsx(SelectItem, {
|
|
39
|
-
value: "shipfox",
|
|
40
|
-
children: /*#__PURE__*/ _jsxs("div", {
|
|
41
|
-
className: "flex items-center gap-8",
|
|
42
|
-
children: [
|
|
43
|
-
/*#__PURE__*/ _jsx(Avatar, {
|
|
44
|
-
size: "3xs",
|
|
45
|
-
content: "logo",
|
|
46
|
-
logoName: "shipfox",
|
|
47
|
-
radius: "rounded"
|
|
48
|
-
}),
|
|
49
|
-
/*#__PURE__*/ _jsx("span", {
|
|
50
|
-
children: "Shipfox"
|
|
51
|
-
})
|
|
52
|
-
]
|
|
53
|
-
})
|
|
63
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
64
|
+
className: "flex items-center gap-8 px-8 py-6 rounded-6",
|
|
65
|
+
children: [
|
|
66
|
+
/*#__PURE__*/ _jsx(Avatar, {
|
|
67
|
+
size: "3xs",
|
|
68
|
+
content: "logo",
|
|
69
|
+
logoName: currentOrg.logo,
|
|
70
|
+
radius: "rounded"
|
|
71
|
+
}),
|
|
72
|
+
/*#__PURE__*/ _jsxs("span", {
|
|
73
|
+
className: "flex-1 text-sm text-foreground-neutral-subtle truncate",
|
|
74
|
+
children: [
|
|
75
|
+
currentOrg.name,
|
|
76
|
+
"'s organization"
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
]
|
|
54
80
|
}),
|
|
55
|
-
/*#__PURE__*/ _jsx(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/*#__PURE__*/ _jsx(Avatar, {
|
|
61
|
-
size: "3xs",
|
|
62
|
-
content: "logo",
|
|
63
|
-
logoName: "github",
|
|
64
|
-
radius: "rounded"
|
|
65
|
-
}),
|
|
66
|
-
/*#__PURE__*/ _jsx("span", {
|
|
67
|
-
children: "GitHub"
|
|
68
|
-
})
|
|
69
|
-
]
|
|
70
|
-
})
|
|
81
|
+
/*#__PURE__*/ _jsx(DropdownMenuSeparator, {}),
|
|
82
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
83
|
+
icon: "settings3Line",
|
|
84
|
+
onSelect: onSettingsClick,
|
|
85
|
+
children: "Settings"
|
|
71
86
|
}),
|
|
72
|
-
/*#__PURE__*/
|
|
73
|
-
/*#__PURE__*/ _jsxs(Button, {
|
|
74
|
-
variant: "transparent",
|
|
75
|
-
className: "w-full justify-start text-foreground-neutral-subtle",
|
|
87
|
+
/*#__PURE__*/ _jsxs(DropdownMenuSub, {
|
|
76
88
|
children: [
|
|
77
|
-
/*#__PURE__*/ _jsx(
|
|
78
|
-
|
|
79
|
-
|
|
89
|
+
/*#__PURE__*/ _jsx(DropdownMenuSubTrigger, {
|
|
90
|
+
icon: "arrowLeftRightLine",
|
|
91
|
+
children: "Switch organization"
|
|
80
92
|
}),
|
|
81
|
-
/*#__PURE__*/ _jsx(
|
|
82
|
-
children:
|
|
93
|
+
/*#__PURE__*/ _jsx(DropdownMenuSubContent, {
|
|
94
|
+
children: organizations.map((org)=>/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
95
|
+
icon: org.logo,
|
|
96
|
+
iconStyle: org.id === selectedOrg ? 'text-foreground-highlight-interactive' : 'text-foreground-neutral-base',
|
|
97
|
+
className: cn(org.id === selectedOrg && 'text-foreground-neutral-base font-medium'),
|
|
98
|
+
onSelect: ()=>handleOrganizationSelect(org.id),
|
|
99
|
+
children: org.name
|
|
100
|
+
}, org.id))
|
|
83
101
|
})
|
|
84
102
|
]
|
|
103
|
+
}),
|
|
104
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
105
|
+
icon: "addLine",
|
|
106
|
+
onSelect: onNewOrganizationClick,
|
|
107
|
+
children: "New organization"
|
|
85
108
|
})
|
|
86
109
|
]
|
|
87
110
|
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type IconName } from '../../../components/icon';
|
|
2
|
+
export type SidebarNavItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon: IconName;
|
|
6
|
+
href?: string;
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export interface SidebarProps {
|
|
10
|
+
items: SidebarNavItem[];
|
|
11
|
+
activeItemId?: string;
|
|
12
|
+
onItemClick?: (item: SidebarNavItem) => void;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
open?: boolean;
|
|
15
|
+
onOpenChange?: (open: boolean) => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function Sidebar({ items, activeItemId, onItemClick, defaultOpen, open: openProp, onOpenChange: setOpenProp, className, }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* Default sidebar items for Analytics page
|
|
21
|
+
* These represent sub-sections within Analytics
|
|
22
|
+
*/
|
|
23
|
+
export declare const defaultSidebarItems: SidebarNavItem[];
|
|
24
|
+
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../../../components/button/index.js';
|
|
3
|
+
import { Icon } from '../../../components/icon/index.js';
|
|
4
|
+
import { Kbd } from '../../../components/kbd/index.js';
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../../components/tooltip/index.js';
|
|
6
|
+
import { Text } from '../../../components/typography/index.js';
|
|
7
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
8
|
+
import { cn } from '../../../utils/cn.js';
|
|
9
|
+
const SIDEBAR_WIDTH = '16rem'; // 256px
|
|
10
|
+
const SIDEBAR_WIDTH_ICON = '4rem'; // 64px
|
|
11
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
|
12
|
+
const SidebarContext = /*#__PURE__*/ createContext(undefined);
|
|
13
|
+
function useSidebarContext() {
|
|
14
|
+
const context = useContext(SidebarContext);
|
|
15
|
+
if (!context) {
|
|
16
|
+
throw new Error('useSidebarContext must be used within Sidebar');
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
export function Sidebar({ items, activeItemId, onItemClick, defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className }) {
|
|
21
|
+
// Internal state for uncontrolled mode
|
|
22
|
+
const [_open, _setOpen] = useState(defaultOpen);
|
|
23
|
+
const open = openProp ?? _open;
|
|
24
|
+
const setOpen = useCallback((value)=>{
|
|
25
|
+
const openState = typeof value === 'function' ? value(open) : value;
|
|
26
|
+
if (setOpenProp) {
|
|
27
|
+
setOpenProp(openState);
|
|
28
|
+
} else {
|
|
29
|
+
_setOpen(openState);
|
|
30
|
+
}
|
|
31
|
+
}, [
|
|
32
|
+
setOpenProp,
|
|
33
|
+
open
|
|
34
|
+
]);
|
|
35
|
+
const toggleSidebar = useCallback(()=>{
|
|
36
|
+
setOpen((prev)=>!prev);
|
|
37
|
+
}, [
|
|
38
|
+
setOpen
|
|
39
|
+
]);
|
|
40
|
+
// Keyboard shortcut: Cmd/Ctrl + B
|
|
41
|
+
useEffect(()=>{
|
|
42
|
+
const handleKeyDown = (event)=>{
|
|
43
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
toggleSidebar();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
49
|
+
return ()=>window.removeEventListener('keydown', handleKeyDown);
|
|
50
|
+
}, [
|
|
51
|
+
toggleSidebar
|
|
52
|
+
]);
|
|
53
|
+
const state = open ? 'expanded' : 'collapsed';
|
|
54
|
+
const contextValue = useMemo(()=>({
|
|
55
|
+
state,
|
|
56
|
+
open,
|
|
57
|
+
setOpen,
|
|
58
|
+
toggleSidebar
|
|
59
|
+
}), [
|
|
60
|
+
state,
|
|
61
|
+
open,
|
|
62
|
+
setOpen,
|
|
63
|
+
toggleSidebar
|
|
64
|
+
]);
|
|
65
|
+
return /*#__PURE__*/ _jsx(SidebarContext.Provider, {
|
|
66
|
+
value: contextValue,
|
|
67
|
+
children: /*#__PURE__*/ _jsx(TooltipProvider, {
|
|
68
|
+
delayDuration: 0,
|
|
69
|
+
children: /*#__PURE__*/ _jsx("aside", {
|
|
70
|
+
style: {
|
|
71
|
+
width: state === 'collapsed' ? SIDEBAR_WIDTH_ICON : SIDEBAR_WIDTH
|
|
72
|
+
},
|
|
73
|
+
className: cn('group/sidebar flex flex-col shrink-0 h-full', 'transition-[width] duration-150 ease-linear', className),
|
|
74
|
+
"data-state": state,
|
|
75
|
+
"data-collapsible": state === 'collapsed' ? 'icon' : '',
|
|
76
|
+
children: /*#__PURE__*/ _jsxs("nav", {
|
|
77
|
+
className: "flex flex-col flex-1 overflow-hidden gap-4",
|
|
78
|
+
children: [
|
|
79
|
+
/*#__PURE__*/ _jsx(SidebarHeader, {}),
|
|
80
|
+
/*#__PURE__*/ _jsx(SidebarContent, {
|
|
81
|
+
children: /*#__PURE__*/ _jsx(SidebarMenu, {
|
|
82
|
+
items: items,
|
|
83
|
+
activeItemId: activeItemId,
|
|
84
|
+
onItemClick: onItemClick
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function SidebarHeader() {
|
|
94
|
+
const { state, toggleSidebar } = useSidebarContext();
|
|
95
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
96
|
+
"data-slot": "sidebar-header",
|
|
97
|
+
className: cn('flex items-center h-32 shrink-0', 'transition-all duration-200', state === 'collapsed' ? 'justify-center px-0' : 'justify-between pl-24 pr-16'),
|
|
98
|
+
children: [
|
|
99
|
+
state === 'expanded' && /*#__PURE__*/ _jsx(Text, {
|
|
100
|
+
size: "xs",
|
|
101
|
+
className: "flex-1 font-medium text-foreground-neutral-muted whitespace-nowrap",
|
|
102
|
+
children: "Analytics"
|
|
103
|
+
}),
|
|
104
|
+
/*#__PURE__*/ _jsxs(Tooltip, {
|
|
105
|
+
children: [
|
|
106
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
107
|
+
asChild: true,
|
|
108
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
109
|
+
variant: "transparent",
|
|
110
|
+
size: "2xs",
|
|
111
|
+
className: cn('shrink-0 text-foreground-neutral-muted hover:text-foreground-neutral-subtle', 'transition-all duration-200', 'p-6 rounded-6', 'size-32'),
|
|
112
|
+
onClick: toggleSidebar,
|
|
113
|
+
"aria-label": state === 'expanded' ? 'Collapse sidebar' : 'Expand sidebar',
|
|
114
|
+
"aria-expanded": state === 'expanded',
|
|
115
|
+
children: /*#__PURE__*/ _jsx(Icon, {
|
|
116
|
+
name: state === 'expanded' ? 'sidebarFoldLine' : 'sidebarUnfoldLine',
|
|
117
|
+
className: "size-16"
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
}),
|
|
121
|
+
/*#__PURE__*/ _jsxs(TooltipContent, {
|
|
122
|
+
side: "right",
|
|
123
|
+
className: "flex items-center gap-8",
|
|
124
|
+
children: [
|
|
125
|
+
/*#__PURE__*/ _jsxs("span", {
|
|
126
|
+
children: [
|
|
127
|
+
state === 'expanded' ? 'Collapse' : 'Expand',
|
|
128
|
+
" sidebar"
|
|
129
|
+
]
|
|
130
|
+
}),
|
|
131
|
+
/*#__PURE__*/ _jsx(Kbd, {
|
|
132
|
+
className: "h-16 !text-foreground-neutral-subtle",
|
|
133
|
+
children: "⌘B"
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
})
|
|
137
|
+
]
|
|
138
|
+
})
|
|
139
|
+
]
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function SidebarContent({ className, children }) {
|
|
143
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
144
|
+
"data-slot": "sidebar-content",
|
|
145
|
+
className: cn('flex min-h-0 flex-1 flex-col gap-4 overflow-auto scrollbar', 'px-16 pb-16', 'group-data-[collapsible=icon]/sidebar:overflow-hidden', className),
|
|
146
|
+
children: children
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function SidebarMenu({ items, activeItemId, onItemClick }) {
|
|
150
|
+
return /*#__PURE__*/ _jsx("ul", {
|
|
151
|
+
"data-slot": "sidebar-menu",
|
|
152
|
+
className: "flex w-full min-w-0 flex-col gap-4",
|
|
153
|
+
children: items.map((item)=>{
|
|
154
|
+
const isActive = item.isActive ?? item.id === activeItemId;
|
|
155
|
+
return /*#__PURE__*/ _jsx(SidebarMenuItem, {
|
|
156
|
+
item: item,
|
|
157
|
+
isActive: isActive,
|
|
158
|
+
onClick: ()=>onItemClick?.(item)
|
|
159
|
+
}, item.id);
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function SidebarMenuItem({ item, isActive, onClick }) {
|
|
164
|
+
const { state } = useSidebarContext();
|
|
165
|
+
const button = /*#__PURE__*/ _jsxs("button", {
|
|
166
|
+
type: "button",
|
|
167
|
+
onClick: onClick,
|
|
168
|
+
"data-slot": "sidebar-menu-button",
|
|
169
|
+
"data-active": isActive,
|
|
170
|
+
className: cn('peer/menu-button flex w-full items-center gap-10 overflow-hidden rounded-6', 'text-left text-sm outline-hidden', 'transition-[width,height,padding] duration-200 ease-linear', 'hover:bg-background-neutral-hover', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-highlight-interactive', 'active:bg-background-neutral-hover', 'disabled:pointer-events-none disabled:opacity-50', 'h-32 p-8', 'group-data-[collapsible=icon]/sidebar:size-32! group-data-[collapsible=icon]/sidebar:p-8!', isActive ? 'bg-background-neutral-hover font-medium text-foreground-neutral-base' : 'text-foreground-neutral-subtle', '[&>span:last-child]:truncate', 'relative'),
|
|
171
|
+
"aria-current": isActive ? 'page' : undefined,
|
|
172
|
+
children: [
|
|
173
|
+
/*#__PURE__*/ _jsx(Icon, {
|
|
174
|
+
name: item.icon,
|
|
175
|
+
className: cn('size-16 shrink-0 transition-colors duration-200', isActive ? 'text-[#FF4B00]' : 'text-foreground-neutral-muted')
|
|
176
|
+
}),
|
|
177
|
+
/*#__PURE__*/ _jsx("span", {
|
|
178
|
+
className: "flex-1 truncate text-sm font-normal",
|
|
179
|
+
children: item.label
|
|
180
|
+
})
|
|
181
|
+
]
|
|
182
|
+
});
|
|
183
|
+
return /*#__PURE__*/ _jsx("li", {
|
|
184
|
+
"data-slot": "sidebar-menu-item",
|
|
185
|
+
className: "group/menu-item relative",
|
|
186
|
+
children: /*#__PURE__*/ _jsxs(Tooltip, {
|
|
187
|
+
children: [
|
|
188
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
189
|
+
asChild: true,
|
|
190
|
+
children: button
|
|
191
|
+
}),
|
|
192
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
193
|
+
side: "right",
|
|
194
|
+
align: "center",
|
|
195
|
+
hidden: state !== 'collapsed',
|
|
196
|
+
children: item.label
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
})
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Default sidebar items for Analytics page
|
|
204
|
+
* These represent sub-sections within Analytics
|
|
205
|
+
*/ export const defaultSidebarItems = [
|
|
206
|
+
{
|
|
207
|
+
id: 'reliability',
|
|
208
|
+
label: 'Reliability',
|
|
209
|
+
icon: 'shieldCheckLine'
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
id: 'performance',
|
|
213
|
+
label: 'Performance',
|
|
214
|
+
icon: 'speedLine'
|
|
215
|
+
}
|
|
216
|
+
];
|
|
217
|
+
|
|
218
|
+
//# sourceMappingURL=sidebar.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard Context Provider
|
|
3
|
+
*
|
|
4
|
+
* Provides centralized state management for dashboard components including
|
|
5
|
+
* search, filters, column visibility, time period, and sidebar navigation.
|
|
6
|
+
*/
|
|
7
|
+
import { type ReactNode } from 'react';
|
|
8
|
+
import type { DashboardState, FilterOption, ResourceType, TimePeriod, ViewColumn } from './types';
|
|
9
|
+
export interface DashboardProviderProps {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Initial columns configuration
|
|
13
|
+
* @default DEFAULT_COLUMNS
|
|
14
|
+
*/
|
|
15
|
+
initialColumns?: ViewColumn[];
|
|
16
|
+
/**
|
|
17
|
+
* Initial filters configuration
|
|
18
|
+
* @default DEFAULT_FILTERS
|
|
19
|
+
*/
|
|
20
|
+
initialFilters?: FilterOption[];
|
|
21
|
+
/**
|
|
22
|
+
* Initial time period
|
|
23
|
+
* @default '2days'
|
|
24
|
+
*/
|
|
25
|
+
initialTimePeriod?: TimePeriod;
|
|
26
|
+
/**
|
|
27
|
+
* Initial active sidebar item
|
|
28
|
+
* @default 'reliability'
|
|
29
|
+
*/
|
|
30
|
+
initialActiveSidebarItem?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Initial resource type
|
|
33
|
+
* @default 'ci-pipeline'
|
|
34
|
+
*/
|
|
35
|
+
initialResourceType?: ResourceType;
|
|
36
|
+
/**
|
|
37
|
+
* Custom column ID to accessor key mapping
|
|
38
|
+
* @default DEFAULT_COLUMN_ID_TO_ACCESSOR_KEY from utils
|
|
39
|
+
*/
|
|
40
|
+
columnMapping?: Record<string, string>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Dashboard Provider Component
|
|
44
|
+
*
|
|
45
|
+
* Wraps dashboard components to provide shared state management.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <DashboardProvider initialTimePeriod="7days">
|
|
50
|
+
* <AnalyticsContent />
|
|
51
|
+
* </DashboardProvider>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function DashboardProvider({ children, initialColumns, initialFilters, initialTimePeriod, initialActiveSidebarItem, initialResourceType, columnMapping, }: DashboardProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* Hook to access dashboard context
|
|
57
|
+
*
|
|
58
|
+
* @throws Error if used outside of DashboardProvider
|
|
59
|
+
* @returns Dashboard state and setters
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* function MyComponent() {
|
|
64
|
+
* const { searchQuery, setSearchQuery } = useDashboardContext();
|
|
65
|
+
* return <input value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} />;
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function useDashboardContext(): DashboardState;
|
|
70
|
+
//# sourceMappingURL=dashboard-context.d.ts.map
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard Context Provider
|
|
3
|
+
*
|
|
4
|
+
* Provides centralized state management for dashboard components including
|
|
5
|
+
* search, filters, column visibility, time period, and sidebar navigation.
|
|
6
|
+
*/ import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { createContext, useCallback, useContext, useMemo, useState } from 'react';
|
|
8
|
+
import { updateViewColumnsFromVisibility, viewColumnsToVisibilityState } from './utils.js';
|
|
9
|
+
const DashboardContext = /*#__PURE__*/ createContext(undefined);
|
|
10
|
+
/**
|
|
11
|
+
* Default columns configuration
|
|
12
|
+
*/ const DEFAULT_COLUMNS = [
|
|
13
|
+
{
|
|
14
|
+
id: 'total',
|
|
15
|
+
label: 'Total',
|
|
16
|
+
visible: true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 'success',
|
|
20
|
+
label: 'Success',
|
|
21
|
+
visible: true
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'failed',
|
|
25
|
+
label: 'Failed',
|
|
26
|
+
visible: true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'neutral',
|
|
30
|
+
label: 'Neutral',
|
|
31
|
+
visible: true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'flaked',
|
|
35
|
+
label: 'Flaked',
|
|
36
|
+
visible: true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'failure-rate',
|
|
40
|
+
label: 'Failure rate',
|
|
41
|
+
visible: true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'flake-rate',
|
|
45
|
+
label: 'Flake rate',
|
|
46
|
+
visible: true
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'repository',
|
|
50
|
+
label: 'Repository',
|
|
51
|
+
visible: false
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'branch',
|
|
55
|
+
label: 'Branch',
|
|
56
|
+
visible: false
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
/**
|
|
60
|
+
* Default filters configuration
|
|
61
|
+
*/ const DEFAULT_FILTERS = [
|
|
62
|
+
{
|
|
63
|
+
id: 'success',
|
|
64
|
+
label: 'Success',
|
|
65
|
+
checked: false
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'failed',
|
|
69
|
+
label: 'Failed',
|
|
70
|
+
checked: false
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'neutral',
|
|
74
|
+
label: 'Neutral',
|
|
75
|
+
checked: false
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'flaked',
|
|
79
|
+
label: 'Flaked',
|
|
80
|
+
checked: false
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 'running',
|
|
84
|
+
label: 'Running',
|
|
85
|
+
checked: false
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
/**
|
|
89
|
+
* Dashboard Provider Component
|
|
90
|
+
*
|
|
91
|
+
* Wraps dashboard components to provide shared state management.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```tsx
|
|
95
|
+
* <DashboardProvider initialTimePeriod="7days">
|
|
96
|
+
* <AnalyticsContent />
|
|
97
|
+
* </DashboardProvider>
|
|
98
|
+
* ```
|
|
99
|
+
*/ export function DashboardProvider({ children, initialColumns = DEFAULT_COLUMNS, initialFilters = DEFAULT_FILTERS, initialTimePeriod = '2days', initialActiveSidebarItem = 'reliability', initialResourceType = 'ci-pipeline', columnMapping }) {
|
|
100
|
+
// State management
|
|
101
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
102
|
+
const [timePeriod, setTimePeriod] = useState(initialTimePeriod);
|
|
103
|
+
const [lastUpdated, setLastUpdated] = useState('13s ago');
|
|
104
|
+
const [columns, setColumns] = useState(initialColumns);
|
|
105
|
+
const [filters, setFilters] = useState(initialFilters);
|
|
106
|
+
const [activeSidebarItem, setActiveSidebarItem] = useState(initialActiveSidebarItem);
|
|
107
|
+
const [resourceType, setResourceType] = useState(initialResourceType);
|
|
108
|
+
// Compute column visibility state
|
|
109
|
+
const columnVisibility = useMemo(()=>viewColumnsToVisibilityState(columns, columnMapping), [
|
|
110
|
+
columns,
|
|
111
|
+
columnMapping
|
|
112
|
+
]);
|
|
113
|
+
// Handle column visibility updates from table
|
|
114
|
+
const updateColumnVisibility = useCallback((visibility)=>{
|
|
115
|
+
const updatedColumns = updateViewColumnsFromVisibility(columns, visibility, columnMapping);
|
|
116
|
+
setColumns(updatedColumns);
|
|
117
|
+
}, [
|
|
118
|
+
columns,
|
|
119
|
+
columnMapping
|
|
120
|
+
]);
|
|
121
|
+
const value = useMemo(()=>({
|
|
122
|
+
searchQuery,
|
|
123
|
+
setSearchQuery,
|
|
124
|
+
timePeriod,
|
|
125
|
+
setTimePeriod,
|
|
126
|
+
lastUpdated,
|
|
127
|
+
setLastUpdated,
|
|
128
|
+
columns,
|
|
129
|
+
setColumns,
|
|
130
|
+
columnVisibility,
|
|
131
|
+
updateColumnVisibility,
|
|
132
|
+
filters,
|
|
133
|
+
setFilters,
|
|
134
|
+
activeSidebarItem,
|
|
135
|
+
setActiveSidebarItem,
|
|
136
|
+
resourceType,
|
|
137
|
+
setResourceType
|
|
138
|
+
}), [
|
|
139
|
+
searchQuery,
|
|
140
|
+
timePeriod,
|
|
141
|
+
lastUpdated,
|
|
142
|
+
columns,
|
|
143
|
+
columnVisibility,
|
|
144
|
+
updateColumnVisibility,
|
|
145
|
+
filters,
|
|
146
|
+
activeSidebarItem,
|
|
147
|
+
resourceType
|
|
148
|
+
]);
|
|
149
|
+
return /*#__PURE__*/ _jsx(DashboardContext.Provider, {
|
|
150
|
+
value: value,
|
|
151
|
+
children: children
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Hook to access dashboard context
|
|
156
|
+
*
|
|
157
|
+
* @throws Error if used outside of DashboardProvider
|
|
158
|
+
* @returns Dashboard state and setters
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```tsx
|
|
162
|
+
* function MyComponent() {
|
|
163
|
+
* const { searchQuery, setSearchQuery } = useDashboardContext();
|
|
164
|
+
* return <input value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} />;
|
|
165
|
+
* }
|
|
166
|
+
* ```
|
|
167
|
+
*/ export function useDashboardContext() {
|
|
168
|
+
const context = useContext(DashboardContext);
|
|
169
|
+
if (!context) {
|
|
170
|
+
throw new Error('useDashboardContext must be used within a DashboardProvider');
|
|
171
|
+
}
|
|
172
|
+
return context;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
//# sourceMappingURL=dashboard-context.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard Context exports
|
|
3
|
+
*/
|
|
4
|
+
export type { DashboardProviderProps } from './dashboard-context';
|
|
5
|
+
export { DashboardProvider, useDashboardContext } from './dashboard-context';
|
|
6
|
+
export type { DashboardState, FilterOption, ResourceType, TimePeriod, ViewColumn } from './types';
|
|
7
|
+
export { DEFAULT_COLUMN_ID_TO_ACCESSOR_KEY, updateViewColumnsFromVisibility, viewColumnsToVisibilityState, } from './utils';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|