@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,325 +0,0 @@
|
|
|
1
|
-
import {gsap} from 'gsap';
|
|
2
|
-
import {InertiaPlugin} from 'gsap/InertiaPlugin';
|
|
3
|
-
import type React from 'react';
|
|
4
|
-
import {useCallback, useEffect, useMemo, useRef} from 'react';
|
|
5
|
-
import {cn} from 'utils';
|
|
6
|
-
|
|
7
|
-
gsap.registerPlugin(InertiaPlugin);
|
|
8
|
-
|
|
9
|
-
const HEX_COLOR_REGEX = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;
|
|
10
|
-
|
|
11
|
-
const throttle = <T extends (...args: never[]) => void>(func: T, limit: number): T => {
|
|
12
|
-
let lastCall = 0;
|
|
13
|
-
return ((...args: Parameters<T>) => {
|
|
14
|
-
const now = performance.now();
|
|
15
|
-
if (now - lastCall >= limit) {
|
|
16
|
-
lastCall = now;
|
|
17
|
-
func(...args);
|
|
18
|
-
}
|
|
19
|
-
}) as T;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
interface Dot {
|
|
23
|
-
cx: number;
|
|
24
|
-
cy: number;
|
|
25
|
-
xOffset: number;
|
|
26
|
-
yOffset: number;
|
|
27
|
-
_inertiaApplied: boolean;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface DotGridProps {
|
|
31
|
-
dotSize?: number;
|
|
32
|
-
gap?: number;
|
|
33
|
-
baseColor?: string;
|
|
34
|
-
activeColor?: string;
|
|
35
|
-
proximity?: number;
|
|
36
|
-
speedTrigger?: number;
|
|
37
|
-
shockRadius?: number;
|
|
38
|
-
shockStrength?: number;
|
|
39
|
-
maxSpeed?: number;
|
|
40
|
-
resistance?: number;
|
|
41
|
-
returnDuration?: number;
|
|
42
|
-
className?: string;
|
|
43
|
-
style?: React.CSSProperties;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
type RgbColor = {
|
|
47
|
-
r: number;
|
|
48
|
-
g: number;
|
|
49
|
-
b: number;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
function hexToRgb(hex: string): RgbColor {
|
|
53
|
-
const m = hex.match(HEX_COLOR_REGEX);
|
|
54
|
-
if (!m) return {r: 0, g: 0, b: 0};
|
|
55
|
-
return {
|
|
56
|
-
r: parseInt(m[1], 16),
|
|
57
|
-
g: parseInt(m[2], 16),
|
|
58
|
-
b: parseInt(m[3], 16),
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function DotGrid({
|
|
63
|
-
dotSize = 16,
|
|
64
|
-
gap = 32,
|
|
65
|
-
baseColor = '#5227FF',
|
|
66
|
-
activeColor = '#5227FF',
|
|
67
|
-
proximity = 150,
|
|
68
|
-
speedTrigger = 100,
|
|
69
|
-
shockRadius = 250,
|
|
70
|
-
shockStrength = 5,
|
|
71
|
-
maxSpeed = 5000,
|
|
72
|
-
resistance = 750,
|
|
73
|
-
returnDuration = 1.5,
|
|
74
|
-
className = '',
|
|
75
|
-
style,
|
|
76
|
-
}: DotGridProps): React.JSX.Element {
|
|
77
|
-
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
78
|
-
const canvasRef = useRef<HTMLCanvasElement>(null);
|
|
79
|
-
const dotsRef = useRef<Dot[]>([]);
|
|
80
|
-
const pointerRef = useRef({
|
|
81
|
-
x: 0,
|
|
82
|
-
y: 0,
|
|
83
|
-
vx: 0,
|
|
84
|
-
vy: 0,
|
|
85
|
-
speed: 0,
|
|
86
|
-
lastTime: 0,
|
|
87
|
-
lastX: 0,
|
|
88
|
-
lastY: 0,
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
const baseRgb = useMemo(() => hexToRgb(baseColor), [baseColor]);
|
|
92
|
-
const activeRgb = useMemo(() => hexToRgb(activeColor), [activeColor]);
|
|
93
|
-
|
|
94
|
-
const colorGradient = useMemo(() => {
|
|
95
|
-
const gradient: string[] = new Array(256);
|
|
96
|
-
for (let i = 0; i < 256; i++) {
|
|
97
|
-
const normalizedSqDist = i / 255;
|
|
98
|
-
const normalizedDist = Math.sqrt(normalizedSqDist);
|
|
99
|
-
const t = 1 - normalizedDist;
|
|
100
|
-
const r = Math.round(baseRgb.r + (activeRgb.r - baseRgb.r) * t);
|
|
101
|
-
const g = Math.round(baseRgb.g + (activeRgb.g - baseRgb.g) * t);
|
|
102
|
-
const b = Math.round(baseRgb.b + (activeRgb.b - baseRgb.b) * t);
|
|
103
|
-
gradient[i] = `rgb(${r},${g},${b})`;
|
|
104
|
-
}
|
|
105
|
-
return gradient;
|
|
106
|
-
}, [baseRgb, activeRgb]);
|
|
107
|
-
|
|
108
|
-
const circlePath = useMemo(() => {
|
|
109
|
-
if (typeof window === 'undefined' || !window.Path2D) return null;
|
|
110
|
-
|
|
111
|
-
const p = new Path2D();
|
|
112
|
-
p.arc(0, 0, dotSize / 2, 0, Math.PI * 2);
|
|
113
|
-
return p;
|
|
114
|
-
}, [dotSize]);
|
|
115
|
-
|
|
116
|
-
const buildGrid = useCallback(() => {
|
|
117
|
-
const wrap = wrapperRef.current;
|
|
118
|
-
const canvas = canvasRef.current;
|
|
119
|
-
if (!wrap || !canvas) return;
|
|
120
|
-
|
|
121
|
-
const {width, height} = wrap.getBoundingClientRect();
|
|
122
|
-
const dpr = window.devicePixelRatio || 1;
|
|
123
|
-
|
|
124
|
-
canvas.width = width * dpr;
|
|
125
|
-
canvas.height = height * dpr;
|
|
126
|
-
canvas.style.width = `${width}px`;
|
|
127
|
-
canvas.style.height = `${height}px`;
|
|
128
|
-
const ctx = canvas.getContext('2d');
|
|
129
|
-
if (ctx) ctx.scale(dpr, dpr);
|
|
130
|
-
|
|
131
|
-
const cols = Math.floor((width + gap) / (dotSize + gap));
|
|
132
|
-
const rows = Math.floor((height + gap) / (dotSize + gap));
|
|
133
|
-
const cell = dotSize + gap;
|
|
134
|
-
|
|
135
|
-
const gridW = cell * cols - gap;
|
|
136
|
-
const gridH = cell * rows - gap;
|
|
137
|
-
|
|
138
|
-
const extraX = width - gridW;
|
|
139
|
-
const extraY = height - gridH;
|
|
140
|
-
|
|
141
|
-
const startX = extraX / 2 + dotSize / 2;
|
|
142
|
-
const startY = extraY / 2 + dotSize / 2;
|
|
143
|
-
|
|
144
|
-
const dots: Dot[] = [];
|
|
145
|
-
for (let y = 0; y < rows; y++) {
|
|
146
|
-
for (let x = 0; x < cols; x++) {
|
|
147
|
-
const cx = startX + x * cell;
|
|
148
|
-
const cy = startY + y * cell;
|
|
149
|
-
dots.push({cx, cy, xOffset: 0, yOffset: 0, _inertiaApplied: false});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
dotsRef.current = dots;
|
|
153
|
-
}, [dotSize, gap]);
|
|
154
|
-
|
|
155
|
-
useEffect(() => {
|
|
156
|
-
if (!circlePath) return;
|
|
157
|
-
|
|
158
|
-
let rafId: number;
|
|
159
|
-
const proxSq = proximity * proximity;
|
|
160
|
-
|
|
161
|
-
const draw = () => {
|
|
162
|
-
const canvas = canvasRef.current;
|
|
163
|
-
if (!canvas) return;
|
|
164
|
-
const ctx = canvas.getContext('2d');
|
|
165
|
-
if (!ctx) return;
|
|
166
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
167
|
-
|
|
168
|
-
const {x: px, y: py} = pointerRef.current;
|
|
169
|
-
|
|
170
|
-
for (const dot of dotsRef.current) {
|
|
171
|
-
const ox = dot.cx + dot.xOffset;
|
|
172
|
-
const oy = dot.cy + dot.yOffset;
|
|
173
|
-
const dx = dot.cx - px;
|
|
174
|
-
const dy = dot.cy - py;
|
|
175
|
-
const dsq = dx * dx + dy * dy;
|
|
176
|
-
|
|
177
|
-
let fillColor = baseColor;
|
|
178
|
-
if (dsq <= proxSq) {
|
|
179
|
-
const normalizedSqDist = dsq / proxSq;
|
|
180
|
-
const index = Math.min(255, Math.max(0, Math.round(normalizedSqDist * 255)));
|
|
181
|
-
fillColor = colorGradient[index];
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
ctx.save();
|
|
185
|
-
ctx.translate(ox, oy);
|
|
186
|
-
ctx.fillStyle = fillColor;
|
|
187
|
-
ctx.fill(circlePath);
|
|
188
|
-
ctx.restore();
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
rafId = requestAnimationFrame(draw);
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
draw();
|
|
195
|
-
return () => cancelAnimationFrame(rafId);
|
|
196
|
-
}, [proximity, baseColor, colorGradient, circlePath]);
|
|
197
|
-
|
|
198
|
-
useEffect(() => {
|
|
199
|
-
buildGrid();
|
|
200
|
-
let ro: ResizeObserver | null = null;
|
|
201
|
-
if ('ResizeObserver' in window) {
|
|
202
|
-
ro = new ResizeObserver(buildGrid);
|
|
203
|
-
wrapperRef.current && ro.observe(wrapperRef.current);
|
|
204
|
-
} else {
|
|
205
|
-
(window as Window).addEventListener('resize', buildGrid);
|
|
206
|
-
}
|
|
207
|
-
return () => {
|
|
208
|
-
if (ro) ro.disconnect();
|
|
209
|
-
else window.removeEventListener('resize', buildGrid);
|
|
210
|
-
};
|
|
211
|
-
}, [buildGrid]);
|
|
212
|
-
|
|
213
|
-
useEffect(() => {
|
|
214
|
-
const onMove = (e: MouseEvent) => {
|
|
215
|
-
const now = performance.now();
|
|
216
|
-
const pr = pointerRef.current;
|
|
217
|
-
const dt = pr.lastTime ? now - pr.lastTime : 16;
|
|
218
|
-
const dx = e.clientX - pr.lastX;
|
|
219
|
-
const dy = e.clientY - pr.lastY;
|
|
220
|
-
let vx = (dx / dt) * 1000;
|
|
221
|
-
let vy = (dy / dt) * 1000;
|
|
222
|
-
let speed = Math.hypot(vx, vy);
|
|
223
|
-
if (speed > maxSpeed) {
|
|
224
|
-
const scale = maxSpeed / speed;
|
|
225
|
-
vx *= scale;
|
|
226
|
-
vy *= scale;
|
|
227
|
-
speed = maxSpeed;
|
|
228
|
-
}
|
|
229
|
-
pr.lastTime = now;
|
|
230
|
-
pr.lastX = e.clientX;
|
|
231
|
-
pr.lastY = e.clientY;
|
|
232
|
-
pr.vx = vx;
|
|
233
|
-
pr.vy = vy;
|
|
234
|
-
pr.speed = speed;
|
|
235
|
-
|
|
236
|
-
const canvas = canvasRef.current;
|
|
237
|
-
if (!canvas) return;
|
|
238
|
-
const rect = canvas.getBoundingClientRect();
|
|
239
|
-
pr.x = e.clientX - rect.left;
|
|
240
|
-
pr.y = e.clientY - rect.top;
|
|
241
|
-
|
|
242
|
-
for (const dot of dotsRef.current) {
|
|
243
|
-
const dist = Math.hypot(dot.cx - pr.x, dot.cy - pr.y);
|
|
244
|
-
if (speed > speedTrigger && dist < proximity && !dot._inertiaApplied) {
|
|
245
|
-
dot._inertiaApplied = true;
|
|
246
|
-
gsap.killTweensOf(dot);
|
|
247
|
-
const pushX = dot.cx - pr.x + vx * 0.005;
|
|
248
|
-
const pushY = dot.cy - pr.y + vy * 0.005;
|
|
249
|
-
gsap.to(dot, {
|
|
250
|
-
inertia: {xOffset: pushX, yOffset: pushY, resistance},
|
|
251
|
-
onComplete: () => {
|
|
252
|
-
gsap.to(dot, {
|
|
253
|
-
xOffset: 0,
|
|
254
|
-
yOffset: 0,
|
|
255
|
-
duration: returnDuration,
|
|
256
|
-
ease: 'elastic.out(1,0.75)',
|
|
257
|
-
});
|
|
258
|
-
dot._inertiaApplied = false;
|
|
259
|
-
},
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
const onClick = (e: MouseEvent) => {
|
|
266
|
-
const canvas = canvasRef.current;
|
|
267
|
-
if (!canvas) return;
|
|
268
|
-
const rect = canvas.getBoundingClientRect();
|
|
269
|
-
const cx = e.clientX - rect.left;
|
|
270
|
-
const cy = e.clientY - rect.top;
|
|
271
|
-
for (const dot of dotsRef.current) {
|
|
272
|
-
const dist = Math.hypot(dot.cx - cx, dot.cy - cy);
|
|
273
|
-
if (dist < shockRadius && !dot._inertiaApplied) {
|
|
274
|
-
dot._inertiaApplied = true;
|
|
275
|
-
gsap.killTweensOf(dot);
|
|
276
|
-
const falloff = Math.max(0, 1 - dist / shockRadius);
|
|
277
|
-
const pushX = (dot.cx - cx) * shockStrength * falloff;
|
|
278
|
-
const pushY = (dot.cy - cy) * shockStrength * falloff;
|
|
279
|
-
gsap.to(dot, {
|
|
280
|
-
inertia: {xOffset: pushX, yOffset: pushY, resistance},
|
|
281
|
-
onComplete: () => {
|
|
282
|
-
gsap.to(dot, {
|
|
283
|
-
xOffset: 0,
|
|
284
|
-
yOffset: 0,
|
|
285
|
-
duration: returnDuration,
|
|
286
|
-
ease: 'elastic.out(1,0.75)',
|
|
287
|
-
});
|
|
288
|
-
dot._inertiaApplied = false;
|
|
289
|
-
},
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
const throttledMove = throttle(onMove, 50) as (e: MouseEvent) => void;
|
|
296
|
-
const wrapper = wrapperRef.current;
|
|
297
|
-
if (wrapper) {
|
|
298
|
-
wrapper.addEventListener('mousemove', throttledMove, {passive: true});
|
|
299
|
-
wrapper.addEventListener('click', onClick);
|
|
300
|
-
}
|
|
301
|
-
return () => {
|
|
302
|
-
if (wrapper) {
|
|
303
|
-
wrapper.removeEventListener('mousemove', throttledMove);
|
|
304
|
-
wrapper.removeEventListener('click', onClick);
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
}, [maxSpeed, speedTrigger, proximity, resistance, returnDuration, shockRadius, shockStrength]);
|
|
308
|
-
|
|
309
|
-
return (
|
|
310
|
-
<section
|
|
311
|
-
className={cn('p-4 flex items-center justify-center h-full w-full relative', className)}
|
|
312
|
-
style={style}
|
|
313
|
-
role="presentation"
|
|
314
|
-
>
|
|
315
|
-
<div ref={wrapperRef} className="w-full h-full relative">
|
|
316
|
-
{/** biome-ignore lint/a11y/noAriaHiddenOnFocusable: <canvas is not focusable> */}
|
|
317
|
-
<canvas
|
|
318
|
-
ref={canvasRef}
|
|
319
|
-
className="absolute inset-0 w-full h-full pointer-events-none"
|
|
320
|
-
aria-hidden="true"
|
|
321
|
-
/>
|
|
322
|
-
</div>
|
|
323
|
-
</section>
|
|
324
|
-
);
|
|
325
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dot-grid';
|
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
import {argosScreenshot} from '@argos-ci/storybook/vitest';
|
|
2
|
-
import type {Meta, StoryObj} from '@storybook/react';
|
|
3
|
-
import {screen, within} from '@testing-library/react';
|
|
4
|
-
import type {UserEvent} from '@testing-library/user-event';
|
|
5
|
-
import userEvent from '@testing-library/user-event';
|
|
6
|
-
import {useState} from 'react';
|
|
7
|
-
import {Avatar} from '../avatar';
|
|
8
|
-
import {Button} from '../button';
|
|
9
|
-
import {
|
|
10
|
-
DropdownMenu,
|
|
11
|
-
DropdownMenuCheckboxItem,
|
|
12
|
-
DropdownMenuContent,
|
|
13
|
-
DropdownMenuGroup,
|
|
14
|
-
DropdownMenuItem,
|
|
15
|
-
DropdownMenuLabel,
|
|
16
|
-
DropdownMenuRadioGroup,
|
|
17
|
-
DropdownMenuRadioItem,
|
|
18
|
-
DropdownMenuSeparator,
|
|
19
|
-
DropdownMenuSub,
|
|
20
|
-
DropdownMenuSubContent,
|
|
21
|
-
DropdownMenuSubTrigger,
|
|
22
|
-
DropdownMenuTrigger,
|
|
23
|
-
} from './dropdown-menu';
|
|
24
|
-
|
|
25
|
-
const OPEN_MENU_REGEX = /open menu/i;
|
|
26
|
-
const ACTIONS_REGEX = /actions/i;
|
|
27
|
-
const ORGANIZATION_REGEX = /organization/i;
|
|
28
|
-
const COMPLETE_MENU_REGEX = /complete menu/i;
|
|
29
|
-
const SWITCH_ORGANIZATION_REGEX = /switch organization/i;
|
|
30
|
-
|
|
31
|
-
const isTestEnvironment = () => typeof navigator !== 'undefined' && navigator.webdriver === true;
|
|
32
|
-
|
|
33
|
-
type StoryContext = Parameters<NonNullable<Story['play']>>[0];
|
|
34
|
-
type AdditionalStepsCallback = (ctx: StoryContext, user: UserEvent) => Promise<void>;
|
|
35
|
-
|
|
36
|
-
async function openMenuAndScreenshot(
|
|
37
|
-
ctx: StoryContext,
|
|
38
|
-
triggerRegex: RegExp,
|
|
39
|
-
screenshotName: string,
|
|
40
|
-
additionalSteps?: AdditionalStepsCallback,
|
|
41
|
-
): Promise<void> {
|
|
42
|
-
const {canvasElement, step} = ctx;
|
|
43
|
-
const canvas = within(canvasElement);
|
|
44
|
-
const user = userEvent.setup();
|
|
45
|
-
|
|
46
|
-
let triggerButton: HTMLElement | null = null;
|
|
47
|
-
|
|
48
|
-
await step('Open the dropdown menu', async () => {
|
|
49
|
-
triggerButton = canvas.getByRole('button', {name: triggerRegex});
|
|
50
|
-
await user.click(triggerButton);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
await step('Wait for menu to appear and render', async () => {
|
|
54
|
-
await screen.findByRole('menu');
|
|
55
|
-
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
56
|
-
|
|
57
|
-
if (isTestEnvironment() && triggerButton instanceof HTMLElement) {
|
|
58
|
-
triggerButton.style.display = 'none';
|
|
59
|
-
}
|
|
60
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
await argosScreenshot(ctx, screenshotName);
|
|
64
|
-
|
|
65
|
-
if (additionalSteps) {
|
|
66
|
-
await additionalSteps(ctx, user);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const meta = {
|
|
71
|
-
title: 'Components/DropdownMenu',
|
|
72
|
-
component: DropdownMenuContent,
|
|
73
|
-
subcomponents: {
|
|
74
|
-
DropdownMenu,
|
|
75
|
-
DropdownMenuTrigger,
|
|
76
|
-
DropdownMenuItem,
|
|
77
|
-
DropdownMenuCheckboxItem,
|
|
78
|
-
DropdownMenuRadioGroup,
|
|
79
|
-
DropdownMenuRadioItem,
|
|
80
|
-
DropdownMenuLabel,
|
|
81
|
-
DropdownMenuSeparator,
|
|
82
|
-
DropdownMenuGroup,
|
|
83
|
-
DropdownMenuSub,
|
|
84
|
-
DropdownMenuSubTrigger,
|
|
85
|
-
DropdownMenuSubContent,
|
|
86
|
-
},
|
|
87
|
-
parameters: {
|
|
88
|
-
layout: 'centered',
|
|
89
|
-
},
|
|
90
|
-
tags: ['autodocs'],
|
|
91
|
-
argTypes: {
|
|
92
|
-
side: {
|
|
93
|
-
control: 'select',
|
|
94
|
-
options: ['top', 'right', 'bottom', 'left'],
|
|
95
|
-
description: 'The preferred side of the trigger to render against',
|
|
96
|
-
table: {defaultValue: {summary: 'bottom'}},
|
|
97
|
-
},
|
|
98
|
-
align: {
|
|
99
|
-
control: 'select',
|
|
100
|
-
options: ['start', 'center', 'end'],
|
|
101
|
-
description: 'The preferred alignment against the trigger',
|
|
102
|
-
table: {defaultValue: {summary: 'start'}},
|
|
103
|
-
},
|
|
104
|
-
sideOffset: {
|
|
105
|
-
control: {type: 'number', min: 0, max: 20, step: 1},
|
|
106
|
-
description: 'Distance in pixels from the trigger',
|
|
107
|
-
table: {defaultValue: {summary: '4'}},
|
|
108
|
-
},
|
|
109
|
-
alignOffset: {
|
|
110
|
-
control: {type: 'number', min: -20, max: 20, step: 1},
|
|
111
|
-
description: 'Offset in pixels from the alignment edge',
|
|
112
|
-
table: {defaultValue: {summary: '0'}},
|
|
113
|
-
},
|
|
114
|
-
size: {
|
|
115
|
-
control: 'select',
|
|
116
|
-
options: ['sm', 'md', 'lg'],
|
|
117
|
-
description: 'Size variant of the dropdown content',
|
|
118
|
-
table: {defaultValue: {summary: 'md'}},
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
args: {
|
|
122
|
-
side: 'bottom',
|
|
123
|
-
align: 'center',
|
|
124
|
-
sideOffset: 8,
|
|
125
|
-
alignOffset: 0,
|
|
126
|
-
size: 'md',
|
|
127
|
-
},
|
|
128
|
-
} satisfies Meta<typeof DropdownMenuContent>;
|
|
129
|
-
|
|
130
|
-
export default meta;
|
|
131
|
-
type Story = StoryObj<typeof meta>;
|
|
132
|
-
|
|
133
|
-
export const Default: Story = {
|
|
134
|
-
play: (ctx) => openMenuAndScreenshot(ctx, OPEN_MENU_REGEX, 'DropdownMenu Default Open'),
|
|
135
|
-
render: function DefaultStory(args) {
|
|
136
|
-
const [container, setContainer] = useState<HTMLDivElement | null>(null);
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<div
|
|
140
|
-
ref={setContainer}
|
|
141
|
-
className="relative flex h-500 w-500 items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip overflow-visible"
|
|
142
|
-
>
|
|
143
|
-
{container && (
|
|
144
|
-
<DropdownMenu>
|
|
145
|
-
<DropdownMenuTrigger asChild>
|
|
146
|
-
<Button variant="secondary">Open Menu</Button>
|
|
147
|
-
</DropdownMenuTrigger>
|
|
148
|
-
<DropdownMenuContent {...args} container={container} side="bottom" align="center">
|
|
149
|
-
<DropdownMenuItem icon="editLine">Edit</DropdownMenuItem>
|
|
150
|
-
<DropdownMenuItem icon="addLine">Add</DropdownMenuItem>
|
|
151
|
-
<DropdownMenuSeparator />
|
|
152
|
-
<DropdownMenuItem icon="deleteBinLine">Delete</DropdownMenuItem>
|
|
153
|
-
</DropdownMenuContent>
|
|
154
|
-
</DropdownMenu>
|
|
155
|
-
)}
|
|
156
|
-
</div>
|
|
157
|
-
);
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export const WithShortcuts: Story = {
|
|
162
|
-
play: (ctx) => openMenuAndScreenshot(ctx, ACTIONS_REGEX, 'DropdownMenu With Shortcuts Open'),
|
|
163
|
-
render: function WithShortcutsStory(args) {
|
|
164
|
-
const [container, setContainer] = useState<HTMLDivElement | null>(null);
|
|
165
|
-
|
|
166
|
-
return (
|
|
167
|
-
<div
|
|
168
|
-
ref={setContainer}
|
|
169
|
-
className="relative flex h-500 w-500 items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip overflow-visible"
|
|
170
|
-
>
|
|
171
|
-
{container && (
|
|
172
|
-
<DropdownMenu>
|
|
173
|
-
<DropdownMenuTrigger asChild>
|
|
174
|
-
<Button variant="secondary">Actions</Button>
|
|
175
|
-
</DropdownMenuTrigger>
|
|
176
|
-
<DropdownMenuContent {...args} container={container} side="bottom" align="center">
|
|
177
|
-
<DropdownMenuItem icon="fileCopyLine" shortcut="⌘C">
|
|
178
|
-
Copy
|
|
179
|
-
</DropdownMenuItem>
|
|
180
|
-
<DropdownMenuItem icon="clipboardLine" shortcut="⌘V">
|
|
181
|
-
Paste
|
|
182
|
-
</DropdownMenuItem>
|
|
183
|
-
<DropdownMenuSeparator />
|
|
184
|
-
<DropdownMenuItem icon="deleteBinLine" shortcut="⌘⌫">
|
|
185
|
-
Delete
|
|
186
|
-
</DropdownMenuItem>
|
|
187
|
-
</DropdownMenuContent>
|
|
188
|
-
</DropdownMenu>
|
|
189
|
-
)}
|
|
190
|
-
</div>
|
|
191
|
-
);
|
|
192
|
-
},
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
function UserProfileSection() {
|
|
196
|
-
return (
|
|
197
|
-
<div className="flex items-center gap-8 px-8 py-6">
|
|
198
|
-
<Avatar
|
|
199
|
-
size="sm"
|
|
200
|
-
content="image"
|
|
201
|
-
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=100&h=100&fit=crop&crop=faces"
|
|
202
|
-
fallback="John Doe"
|
|
203
|
-
/>
|
|
204
|
-
<div className="flex flex-col">
|
|
205
|
-
<span className="text-sm font-medium leading-20 text-foreground-neutral-base">
|
|
206
|
-
John Doe
|
|
207
|
-
</span>
|
|
208
|
-
<span className="text-xs leading-16 text-foreground-neutral-muted">john@example.com</span>
|
|
209
|
-
</div>
|
|
210
|
-
</div>
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
function OrganizationItem() {
|
|
215
|
-
return (
|
|
216
|
-
<div className="flex items-center gap-8 px-8 py-6">
|
|
217
|
-
<Avatar size="3xs" content="logo" logoName="stripe" radius="rounded" />
|
|
218
|
-
<span className="text-sm leading-20 text-foreground-neutral-subtle">
|
|
219
|
-
Stripe's organization
|
|
220
|
-
</span>
|
|
221
|
-
</div>
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export const OrganizationMenu: Story = {
|
|
226
|
-
args: {
|
|
227
|
-
size: 'md',
|
|
228
|
-
},
|
|
229
|
-
play: (ctx) =>
|
|
230
|
-
openMenuAndScreenshot(
|
|
231
|
-
ctx,
|
|
232
|
-
ORGANIZATION_REGEX,
|
|
233
|
-
'DropdownMenu Organization Menu Open',
|
|
234
|
-
async ({step}, user) => {
|
|
235
|
-
await step('Hover over submenu trigger', async () => {
|
|
236
|
-
const submenuTrigger = screen.getByRole('menuitem', {name: SWITCH_ORGANIZATION_REGEX});
|
|
237
|
-
await user.hover(submenuTrigger);
|
|
238
|
-
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
await argosScreenshot(ctx, 'DropdownMenu Organization Menu Submenu Open');
|
|
242
|
-
},
|
|
243
|
-
),
|
|
244
|
-
render: function OrganizationMenuStory(args) {
|
|
245
|
-
const [container, setContainer] = useState<HTMLDivElement | null>(null);
|
|
246
|
-
|
|
247
|
-
return (
|
|
248
|
-
<div
|
|
249
|
-
ref={setContainer}
|
|
250
|
-
className="relative flex h-600 w-600 items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip overflow-visible"
|
|
251
|
-
>
|
|
252
|
-
{container && (
|
|
253
|
-
<DropdownMenu>
|
|
254
|
-
<DropdownMenuTrigger asChild>
|
|
255
|
-
<Button variant="secondary" iconLeft="buildingLine">
|
|
256
|
-
Organization
|
|
257
|
-
</Button>
|
|
258
|
-
</DropdownMenuTrigger>
|
|
259
|
-
<DropdownMenuContent {...args} container={container} side="bottom" align="start">
|
|
260
|
-
<OrganizationItem />
|
|
261
|
-
<DropdownMenuSeparator />
|
|
262
|
-
<DropdownMenuItem icon="settings3Line">Settings</DropdownMenuItem>
|
|
263
|
-
<DropdownMenuSub>
|
|
264
|
-
<DropdownMenuSubTrigger icon="arrowLeftRightLine">
|
|
265
|
-
Switch organization
|
|
266
|
-
</DropdownMenuSubTrigger>
|
|
267
|
-
<DropdownMenuSubContent>
|
|
268
|
-
<DropdownMenuItem
|
|
269
|
-
icon="shipfox"
|
|
270
|
-
iconStyle="text-foreground-neutral-base"
|
|
271
|
-
className="text-foreground-neutral-base"
|
|
272
|
-
>
|
|
273
|
-
Shipfox
|
|
274
|
-
</DropdownMenuItem>
|
|
275
|
-
<DropdownMenuItem
|
|
276
|
-
icon="github"
|
|
277
|
-
iconStyle="text-foreground-neutral-base"
|
|
278
|
-
className="text-foreground-neutral-base"
|
|
279
|
-
>
|
|
280
|
-
Github
|
|
281
|
-
</DropdownMenuItem>
|
|
282
|
-
<DropdownMenuItem
|
|
283
|
-
icon="google"
|
|
284
|
-
iconStyle="text-foreground-neutral-base"
|
|
285
|
-
className="text-foreground-neutral-base"
|
|
286
|
-
>
|
|
287
|
-
Google
|
|
288
|
-
</DropdownMenuItem>
|
|
289
|
-
</DropdownMenuSubContent>
|
|
290
|
-
</DropdownMenuSub>
|
|
291
|
-
<DropdownMenuItem icon="addLine">New organization</DropdownMenuItem>
|
|
292
|
-
</DropdownMenuContent>
|
|
293
|
-
</DropdownMenu>
|
|
294
|
-
)}
|
|
295
|
-
</div>
|
|
296
|
-
);
|
|
297
|
-
},
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
export const CompleteExample: Story = {
|
|
301
|
-
args: {
|
|
302
|
-
size: 'lg',
|
|
303
|
-
side: 'bottom',
|
|
304
|
-
},
|
|
305
|
-
play: (ctx) =>
|
|
306
|
-
openMenuAndScreenshot(ctx, COMPLETE_MENU_REGEX, 'DropdownMenu Complete Example Open'),
|
|
307
|
-
render: function CompleteExampleStory(args) {
|
|
308
|
-
const [container, setContainer] = useState<HTMLDivElement | null>(null);
|
|
309
|
-
const [showNotifications, setShowNotifications] = useState(true);
|
|
310
|
-
const [showBadges, setShowBadges] = useState(false);
|
|
311
|
-
const [theme, setTheme] = useState('dark');
|
|
312
|
-
|
|
313
|
-
return (
|
|
314
|
-
<div
|
|
315
|
-
ref={setContainer}
|
|
316
|
-
className="relative flex h-600 w-500 items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip overflow-visible"
|
|
317
|
-
>
|
|
318
|
-
{container && (
|
|
319
|
-
<DropdownMenu>
|
|
320
|
-
<DropdownMenuTrigger asChild>
|
|
321
|
-
<Button variant="secondary" iconLeft="menu3Line">
|
|
322
|
-
Complete Menu
|
|
323
|
-
</Button>
|
|
324
|
-
</DropdownMenuTrigger>
|
|
325
|
-
<DropdownMenuContent
|
|
326
|
-
{...args}
|
|
327
|
-
className="w-260"
|
|
328
|
-
container={container}
|
|
329
|
-
side="bottom"
|
|
330
|
-
align="start"
|
|
331
|
-
>
|
|
332
|
-
<UserProfileSection />
|
|
333
|
-
<DropdownMenuSeparator />
|
|
334
|
-
|
|
335
|
-
<DropdownMenuLabel>Actions</DropdownMenuLabel>
|
|
336
|
-
<DropdownMenuGroup>
|
|
337
|
-
<DropdownMenuItem icon="sparklingLine">Getting started</DropdownMenuItem>
|
|
338
|
-
<DropdownMenuItem icon="userLine">Profile settings</DropdownMenuItem>
|
|
339
|
-
</DropdownMenuGroup>
|
|
340
|
-
|
|
341
|
-
<DropdownMenuSeparator />
|
|
342
|
-
|
|
343
|
-
<DropdownMenuLabel>Preferences</DropdownMenuLabel>
|
|
344
|
-
<DropdownMenuGroup>
|
|
345
|
-
<DropdownMenuCheckboxItem
|
|
346
|
-
checked={showNotifications}
|
|
347
|
-
onCheckedChange={setShowNotifications}
|
|
348
|
-
closeOnSelect={false}
|
|
349
|
-
>
|
|
350
|
-
Show notifications
|
|
351
|
-
</DropdownMenuCheckboxItem>
|
|
352
|
-
<DropdownMenuCheckboxItem
|
|
353
|
-
checked={showBadges}
|
|
354
|
-
onCheckedChange={setShowBadges}
|
|
355
|
-
closeOnSelect={false}
|
|
356
|
-
>
|
|
357
|
-
Show badges
|
|
358
|
-
</DropdownMenuCheckboxItem>
|
|
359
|
-
</DropdownMenuGroup>
|
|
360
|
-
|
|
361
|
-
<DropdownMenuSeparator />
|
|
362
|
-
|
|
363
|
-
<DropdownMenuLabel>Theme</DropdownMenuLabel>
|
|
364
|
-
<DropdownMenuRadioGroup value={theme} onValueChange={setTheme}>
|
|
365
|
-
<DropdownMenuRadioItem value="light" closeOnSelect={false}>
|
|
366
|
-
Light
|
|
367
|
-
</DropdownMenuRadioItem>
|
|
368
|
-
<DropdownMenuRadioItem value="dark" closeOnSelect={false}>
|
|
369
|
-
Dark
|
|
370
|
-
</DropdownMenuRadioItem>
|
|
371
|
-
<DropdownMenuRadioItem value="system" closeOnSelect={false}>
|
|
372
|
-
System
|
|
373
|
-
</DropdownMenuRadioItem>
|
|
374
|
-
</DropdownMenuRadioGroup>
|
|
375
|
-
|
|
376
|
-
<DropdownMenuSeparator />
|
|
377
|
-
<DropdownMenuItem icon="logoutCircleLine">Log out</DropdownMenuItem>
|
|
378
|
-
</DropdownMenuContent>
|
|
379
|
-
</DropdownMenu>
|
|
380
|
-
)}
|
|
381
|
-
</div>
|
|
382
|
-
);
|
|
383
|
-
},
|
|
384
|
-
};
|