basalt-ui 1.28.0 → 1.29.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/AGENTS.md +11 -18
- package/CHANGELOG.md +13 -0
- package/MIGRATING.md +151 -7
- package/README.md +23 -66
- package/agent/rules/basalt-batteries.md +59 -182
- package/agent/rules/basalt-charts.md +56 -75
- package/agent/rules/basalt-controls.md +38 -69
- package/agent/rules/basalt-mantine.md +58 -103
- package/agent/rules/basalt-state.md +42 -60
- package/agent/rules/basalt-tokens.md +46 -67
- package/agent/skills/basalt-app/SKILL.md +2 -0
- package/agent/templates/CLAUDE-block.md.tpl +14 -14
- package/configs/oxlint-plugin.js +70 -167
- package/configs/oxlint-plugin.test.ts +20 -186
- package/configs/oxlint.json +0 -1
- package/dist/agent/ai-sdk-transport.d.ts.map +1 -1
- package/dist/agent/ai-sdk-transport.js +7 -4
- package/dist/agent/coalesce.js +1 -1
- package/dist/agent/merge.js +1 -1
- package/dist/agent/transport.d.ts +13 -2
- package/dist/agent/transport.d.ts.map +1 -1
- package/dist/agent/use-agent-thread-runs.d.ts +12 -1
- package/dist/agent/use-agent-thread-runs.d.ts.map +1 -1
- package/dist/agent/use-agent-thread-runs.js +20 -6
- package/dist/agent-chat/index.d.ts +1 -1
- package/dist/agent-chat/index.d.ts.map +1 -1
- package/dist/agent-chat/relative-time.js +1 -1
- package/dist/agent-chat/thread-detail-panel.js +1 -1
- package/dist/agent-chat/thread-feed-row.d.ts +32 -7
- package/dist/agent-chat/thread-feed-row.d.ts.map +1 -1
- package/dist/agent-chat/thread-feed-row.js +121 -86
- package/dist/agent-chat/thread-feed.d.ts +11 -1
- package/dist/agent-chat/thread-feed.d.ts.map +1 -1
- package/dist/agent-chat/thread-feed.js +10 -6
- package/dist/agent-chat/thread-message.js +1 -1
- package/dist/agent-chat/virtualize.d.ts +39 -0
- package/dist/agent-chat/virtualize.d.ts.map +1 -1
- package/dist/agent-chat/virtualize.js +15 -0
- package/dist/charts/index.d.ts +3 -3
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/charts/index.js +8 -4
- package/dist/charts/kinds/BandStrip.js +1 -1
- package/dist/charts/kinds/Bars.d.ts +1 -3
- package/dist/charts/kinds/Bars.d.ts.map +1 -1
- package/dist/charts/kinds/Bars.js +1 -1
- package/dist/charts/kinds/DualPanel.d.ts +3 -1
- package/dist/charts/kinds/DualPanel.d.ts.map +1 -1
- package/dist/charts/kinds/DualPanel.js +1 -1
- package/dist/charts/kinds/StackedArea.js +1 -1
- package/dist/charts/kinds/ZonedLine.d.ts +1 -3
- package/dist/charts/kinds/ZonedLine.d.ts.map +1 -1
- package/dist/charts/primitives/Axes.d.ts +21 -2
- package/dist/charts/primitives/Axes.d.ts.map +1 -1
- package/dist/charts/primitives/Axes.js +34 -2
- package/dist/charts/primitives/ChartCard.d.ts +20 -4
- package/dist/charts/primitives/ChartCard.d.ts.map +1 -1
- package/dist/charts/primitives/ChartCard.js +62 -33
- package/dist/charts/primitives/ChartFrame.d.ts.map +1 -1
- package/dist/charts/primitives/ChartFrame.js +8 -1
- package/dist/charts/primitives/ChartPending.d.ts +12 -6
- package/dist/charts/primitives/ChartPending.d.ts.map +1 -1
- package/dist/charts/primitives/ChartPending.js +1 -1
- package/dist/charts/utils/format.d.ts +5 -92
- package/dist/charts/utils/format.d.ts.map +1 -1
- package/dist/charts/utils/format.js +10 -80
- package/dist/cli/audit-allows.d.ts +24 -0
- package/dist/cli/audit-allows.d.ts.map +1 -0
- package/dist/cli/audit-allows.js +240 -0
- package/dist/cli/check-theme.d.ts +10 -0
- package/dist/cli/check-theme.d.ts.map +1 -0
- package/dist/cli/check-theme.js +139 -0
- package/dist/cli/doctor.d.ts +47 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +197 -0
- package/dist/cli/guard-hook.d.ts +9 -0
- package/dist/cli/guard-hook.d.ts.map +1 -0
- package/dist/cli/guard-hook.js +93 -0
- package/dist/cli/help.d.ts +9 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +53 -0
- package/dist/cli/index.d.ts +360 -270
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +85 -1901
- package/dist/cli/init.d.ts +4 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +165 -0
- package/dist/cli/sync.d.ts +43 -0
- package/dist/cli/sync.d.ts.map +1 -0
- package/dist/cli/sync.js +206 -0
- package/dist/cli/tokens-css.d.ts +51 -0
- package/dist/cli/tokens-css.d.ts.map +1 -0
- package/dist/cli/tokens-css.js +165 -0
- package/dist/commands/define-commands.js +1 -1
- package/dist/commands/define-overlays.js +1 -1
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +6 -0
- package/dist/commands/overlays-mount.d.ts +7 -9
- package/dist/commands/overlays-mount.d.ts.map +1 -1
- package/dist/commands/shell-bridge.d.ts +57 -0
- package/dist/commands/shell-bridge.d.ts.map +1 -0
- package/dist/commands/shell-bridge.js +32 -0
- package/dist/common/errors.d.ts +35 -0
- package/dist/common/errors.d.ts.map +1 -1
- package/dist/common/errors.js +29 -1
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +6 -0
- package/dist/common/is-dev.d.ts.map +1 -0
- package/dist/{motion/index.d.ts → common/motion.d.ts} +1 -1
- package/dist/common/motion.d.ts.map +1 -0
- package/dist/common/props.d.ts +1 -1
- package/dist/common/props.d.ts.map +1 -1
- package/dist/common/validate.js +1 -1
- package/dist/content/markdown.d.ts +3 -4
- package/dist/content/markdown.d.ts.map +1 -1
- package/dist/content/markdown.js +1 -4
- package/dist/controls/actions.d.ts +1 -1
- package/dist/controls/actions.d.ts.map +1 -1
- package/dist/controls/panel-row.js +1 -1
- package/dist/controls/range-filter.js +1 -1
- package/dist/dashboard/delta-badge.d.ts +18 -10
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +33 -1
- package/dist/dashboard/empty-state.d.ts +1 -4
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/empty-state.js +1 -2
- package/dist/dashboard/index.d.ts +4 -2
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +7 -1
- package/dist/dashboard/query-state.d.ts +4 -13
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +4 -7
- package/dist/{section → dashboard}/section.d.ts +2 -2
- package/dist/{section → dashboard}/section.d.ts.map +1 -1
- package/dist/{section → dashboard}/section.js +2 -2
- package/dist/dashboard/settings-section.d.ts +1 -1
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +1 -1
- package/dist/dashboard/stat-card.d.ts +1 -1
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +1 -1
- package/dist/dashboard/widget-header.d.ts.map +1 -0
- package/dist/data/data-table.js +2 -2
- package/dist/data/table.d.ts +1 -1
- package/dist/data/table.d.ts.map +1 -1
- package/dist/data/table.js +2 -16
- package/dist/data/virtual.d.ts +3 -3
- package/dist/dev-dock.d.ts +28 -0
- package/dist/dev-dock.d.ts.map +1 -0
- package/dist/dev-dock.js +85 -0
- package/dist/format/date.d.ts +62 -0
- package/dist/format/date.d.ts.map +1 -0
- package/dist/format/date.js +106 -0
- package/dist/format/index.d.ts +39 -0
- package/dist/format/index.d.ts.map +1 -0
- package/dist/format/index.js +54 -0
- package/dist/format/measure.d.ts +15 -0
- package/dist/format/measure.d.ts.map +1 -0
- package/dist/format/measure.js +16 -0
- package/dist/format/number.d.ts +69 -0
- package/dist/format/number.d.ts.map +1 -0
- package/dist/format/number.js +62 -0
- package/dist/format/shared.d.ts +27 -0
- package/dist/format/shared.d.ts.map +1 -0
- package/dist/format/shared.js +29 -0
- package/dist/forms/field.d.ts +4 -20
- package/dist/forms/field.d.ts.map +1 -1
- package/dist/forms/field.js +0 -4
- package/dist/forms/form-layout.d.ts +1 -1
- package/dist/forms/form-layout.d.ts.map +1 -1
- package/dist/forms/form-layout.js +1 -1
- package/dist/forms/index.d.ts +1 -1
- package/dist/forms/index.d.ts.map +1 -1
- package/dist/forms/index.js +1 -2
- package/dist/forms/use-form-submit.js +1 -1
- package/dist/guard/index.d.ts +2 -9
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +16 -26
- package/dist/guard/types.d.ts +8 -10
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/index.d.ts +16 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -29
- package/dist/notifications/index.d.ts +5 -5
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +0 -2
- package/dist/notifications/mount-guard.d.ts.map +1 -1
- package/dist/notifications/mount-guard.js +2 -2
- package/dist/provider/connectivity-indicator.d.ts.map +1 -0
- package/dist/{connectivity → provider}/connectivity-provider.d.ts +1 -1
- package/dist/provider/connectivity-provider.d.ts.map +1 -0
- package/dist/{connectivity/types.d.ts → provider/connectivity-types.d.ts} +1 -1
- package/dist/provider/connectivity-types.d.ts.map +1 -0
- package/dist/provider/error-fallback.module.css +21 -0
- package/dist/provider/error-fallback.module.css.d.ts +9 -0
- package/dist/provider/index.d.ts +20 -36
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +42 -32
- package/dist/provider/lab-theme.js +1 -1
- package/dist/provider/use-connectivity.d.ts +3 -0
- package/dist/provider/use-connectivity.d.ts.map +1 -0
- package/dist/query-client.d.ts +63 -0
- package/dist/query-client.d.ts.map +1 -0
- package/dist/query-client.js +33 -0
- package/dist/{query/devtools.d.ts → query-devtools.d.ts} +2 -2
- package/dist/query-devtools.d.ts.map +1 -0
- package/dist/register.d.ts +17 -3
- package/dist/register.d.ts.map +1 -1
- package/dist/router-tanstack/index.d.ts +4 -7
- package/dist/router-tanstack/index.d.ts.map +1 -1
- package/dist/router-tanstack/index.js +1 -9
- package/dist/router-tanstack/nav.d.ts +1 -1
- package/dist/router-tanstack/nav.d.ts.map +1 -1
- package/dist/router-tanstack/search-store.d.ts +3 -6
- package/dist/router-tanstack/search-store.d.ts.map +1 -1
- package/dist/router-tanstack/use-nav.d.ts +1 -1
- package/dist/router-tanstack/use-nav.d.ts.map +1 -1
- package/dist/shell/app-breadcrumbs.d.ts +1 -1
- package/dist/shell/app-breadcrumbs.d.ts.map +1 -1
- package/dist/shell/app-main.module.css +11 -0
- package/dist/shell/app-mobile-nav.d.ts +1 -1
- package/dist/shell/app-mobile-nav.d.ts.map +1 -1
- package/dist/shell/app-mobile-nav.js +24 -2
- package/dist/shell/app-sidebar.d.ts +1 -1
- package/dist/shell/app-sidebar.d.ts.map +1 -1
- package/dist/shell/app-sidebar.js +31 -2
- package/dist/shell/app-sidebar.module.css +10 -0
- package/dist/shell/index.d.ts +10 -4
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +13 -17
- package/dist/shell/mobile-nav-model.d.ts +1 -1
- package/dist/shell/mobile-nav-model.d.ts.map +1 -1
- package/dist/{nav/types.d.ts → shell/nav-types.d.ts} +1 -1
- package/dist/shell/nav-types.d.ts.map +1 -0
- package/dist/shell/page-aside.d.ts.map +1 -1
- package/dist/shell/page-aside.js +2 -29
- package/dist/shell/page-title.d.ts +14 -0
- package/dist/shell/page-title.d.ts.map +1 -0
- package/dist/shell/page-title.js +25 -0
- package/dist/shell/page-title.module.css +33 -0
- package/dist/shell/page-title.module.css.d.ts +11 -0
- package/dist/shell/sidebar-block-model.d.ts +1 -1
- package/dist/shell/sidebar-block-model.d.ts.map +1 -1
- package/dist/shell/sidebar-blocks.d.ts +1 -1
- package/dist/shell/sidebar-blocks.d.ts.map +1 -1
- package/dist/shell/use-breakpoint.d.ts +11 -0
- package/dist/shell/use-breakpoint.d.ts.map +1 -0
- package/dist/shell/use-breakpoint.js +33 -0
- package/dist/state/fields.d.ts +3 -19
- package/dist/state/fields.d.ts.map +1 -1
- package/dist/state/fields.js +6 -16
- package/dist/styles.css +36 -0
- package/dist/surfaces.d.ts +18 -41
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +46 -59
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/{theme-toggle/index.d.ts → theme/theme-toggle.d.ts} +1 -1
- package/dist/theme/theme-toggle.d.ts.map +1 -0
- package/dist/{theme-toggle/index.js → theme/theme-toggle.js} +1 -1
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +10 -0
- package/dist/tokens/palette.d.ts +12 -0
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +13 -1
- package/dist/tokens.css +1 -0
- package/llms.txt +9 -24
- package/package.json +12 -16
- package/src/agent/ai-sdk-transport.ts +11 -4
- package/src/agent/coalesce.ts +1 -1
- package/src/agent/merge.ts +1 -1
- package/src/agent/transport.ts +15 -2
- package/src/agent/use-agent-thread-runs.ts +65 -15
- package/src/agent-chat/index.ts +6 -4
- package/src/agent-chat/relative-time.ts +1 -1
- package/src/agent-chat/thread-detail-panel.tsx +1 -1
- package/src/agent-chat/thread-feed-row.tsx +105 -30
- package/src/agent-chat/thread-feed.tsx +51 -25
- package/src/agent-chat/thread-message.tsx +1 -1
- package/src/agent-chat/virtualize.ts +48 -0
- package/src/charts/index.ts +7 -10
- package/src/charts/kinds/BandStrip.tsx +1 -1
- package/src/charts/kinds/Bars.tsx +2 -5
- package/src/charts/kinds/DualPanel.tsx +4 -3
- package/src/charts/kinds/StackedArea.tsx +1 -1
- package/src/charts/kinds/ZonedLine.tsx +1 -4
- package/src/charts/primitives/Axes.tsx +49 -0
- package/src/charts/primitives/ChartCard.tsx +49 -6
- package/src/charts/primitives/ChartFrame.tsx +5 -1
- package/src/charts/primitives/ChartPending.tsx +14 -8
- package/src/charts/utils/format.ts +17 -186
- package/src/cli/audit-allows.ts +371 -0
- package/src/cli/check-theme.ts +197 -0
- package/src/cli/doctor.ts +331 -0
- package/src/cli/guard-hook.ts +115 -0
- package/src/cli/help.ts +101 -0
- package/src/cli/index.ts +269 -3439
- package/src/cli/init.ts +247 -0
- package/src/cli/sync.ts +324 -0
- package/src/cli/tokens-css.ts +252 -0
- package/src/commands/define-commands.ts +1 -1
- package/src/commands/define-overlays.ts +1 -1
- package/src/commands/index.ts +10 -1
- package/src/commands/overlays-mount.tsx +8 -10
- package/src/commands/shell-bridge.ts +86 -0
- package/src/common/errors.ts +70 -0
- package/src/common/index.ts +2 -0
- package/src/common/props.ts +1 -1
- package/src/common/validate.ts +1 -1
- package/src/content/markdown.tsx +4 -8
- package/src/controls/actions.tsx +1 -1
- package/src/controls/panel-row.tsx +1 -1
- package/src/controls/range-filter.tsx +1 -1
- package/src/dashboard/delta-badge.tsx +74 -7
- package/src/dashboard/empty-state.tsx +2 -6
- package/src/dashboard/index.ts +11 -2
- package/src/dashboard/query-state.tsx +5 -18
- package/src/{section → dashboard}/section.tsx +4 -4
- package/src/dashboard/settings-section.tsx +2 -2
- package/src/dashboard/stat-card.tsx +2 -2
- package/src/data/data-table.tsx +3 -3
- package/src/data/table.ts +6 -25
- package/src/data/virtual-list.tsx +1 -1
- package/src/data/virtual.ts +3 -3
- package/src/dev-dock.tsx +159 -0
- package/src/format/date.ts +184 -0
- package/src/format/index.ts +69 -0
- package/src/format/measure.ts +31 -0
- package/src/format/number.ts +129 -0
- package/src/format/shared.ts +63 -0
- package/src/forms/field.ts +4 -24
- package/src/forms/form-layout.tsx +2 -2
- package/src/forms/index.ts +1 -2
- package/src/forms/use-form-submit.ts +1 -1
- package/src/guard/index.ts +30 -56
- package/src/guard/types.ts +7 -10
- package/src/index.ts +38 -29
- package/src/notifications/index.ts +5 -7
- package/src/notifications/mount-guard.ts +7 -9
- package/src/{connectivity → provider}/connectivity-indicator.tsx +1 -1
- package/src/{connectivity → provider}/connectivity-provider.tsx +1 -1
- package/src/provider/error-fallback.module.css +21 -0
- package/src/provider/error-fallback.module.css.d.ts +9 -0
- package/src/provider/index.tsx +71 -71
- package/src/provider/lab-theme.ts +1 -1
- package/src/{connectivity → provider}/use-connectivity.ts +3 -3
- package/src/query-client.ts +100 -0
- package/src/{query/devtools.tsx → query-devtools.tsx} +5 -4
- package/src/register.ts +20 -4
- package/src/router-tanstack/index.ts +4 -15
- package/src/router-tanstack/nav.ts +1 -1
- package/src/router-tanstack/search-store.ts +3 -4
- package/src/router-tanstack/use-nav.ts +1 -1
- package/src/shell/app-breadcrumbs.tsx +1 -1
- package/src/shell/app-main.module.css +11 -0
- package/src/shell/app-mobile-nav.tsx +28 -1
- package/src/shell/app-sidebar.module.css +10 -0
- package/src/shell/app-sidebar.tsx +31 -2
- package/src/shell/index.tsx +23 -28
- package/src/shell/mobile-nav-model.ts +1 -1
- package/src/shell/page-aside.tsx +2 -52
- package/src/shell/page-title.module.css +33 -0
- package/src/shell/page-title.module.css.d.ts +11 -0
- package/src/shell/page-title.tsx +57 -0
- package/src/shell/sidebar-block-model.ts +1 -1
- package/src/shell/sidebar-blocks.tsx +1 -1
- package/src/shell/use-breakpoint.ts +73 -0
- package/src/state/fields.ts +7 -43
- package/src/styles.css +36 -0
- package/src/surfaces.ts +45 -60
- package/src/theme/index.ts +7 -0
- package/src/{theme-toggle/index.tsx → theme/theme-toggle.tsx} +1 -1
- package/src/tokens/index.ts +10 -0
- package/src/tokens/palette.ts +12 -0
- package/dist/connectivity/connectivity-indicator.d.ts.map +0 -1
- package/dist/connectivity/connectivity-provider.d.ts.map +0 -1
- package/dist/connectivity/index.d.ts +0 -14
- package/dist/connectivity/index.d.ts.map +0 -1
- package/dist/connectivity/index.js +0 -8
- package/dist/connectivity/types.d.ts.map +0 -1
- package/dist/connectivity/use-connectivity.d.ts +0 -3
- package/dist/connectivity/use-connectivity.d.ts.map +0 -1
- package/dist/data/index.d.ts +0 -38
- package/dist/data/index.d.ts.map +0 -1
- package/dist/data/index.js +0 -24
- package/dist/motion/index.d.ts.map +0 -1
- package/dist/nav/types.d.ts.map +0 -1
- package/dist/notifications/overlay.d.ts +0 -20
- package/dist/notifications/overlay.d.ts.map +0 -1
- package/dist/notifications/overlay.js +0 -14
- package/dist/query/devtools.d.ts.map +0 -1
- package/dist/query/error-message.d.ts +0 -41
- package/dist/query/error-message.d.ts.map +0 -1
- package/dist/query/error-message.js +0 -30
- package/dist/query/index.d.ts +0 -47
- package/dist/query/index.d.ts.map +0 -1
- package/dist/query/index.js +0 -56
- package/dist/router-tanstack/field.d.ts +0 -14
- package/dist/router-tanstack/field.d.ts.map +0 -1
- package/dist/router-tanstack/field.js +0 -4
- package/dist/router-tanstack/multi-search-param-store.d.ts +0 -43
- package/dist/router-tanstack/multi-search-param-store.d.ts.map +0 -1
- package/dist/router-tanstack/multi-search-param-store.js +0 -30
- package/dist/router-tanstack/search-param-store.d.ts +0 -42
- package/dist/router-tanstack/search-param-store.d.ts.map +0 -1
- package/dist/router-tanstack/search-param-store.js +0 -25
- package/dist/section/index.d.ts +0 -2
- package/dist/section/index.d.ts.map +0 -1
- package/dist/section/index.js +0 -4
- package/dist/theme-toggle/index.d.ts.map +0 -1
- package/dist/utils/is-dev.d.ts.map +0 -1
- package/dist/widget-header/delta-badge.d.ts +0 -19
- package/dist/widget-header/delta-badge.d.ts.map +0 -1
- package/dist/widget-header/delta-badge.js +0 -36
- package/dist/widget-header/index.d.ts +0 -3
- package/dist/widget-header/index.d.ts.map +0 -1
- package/dist/widget-header/index.js +0 -8
- package/dist/widget-header/widget-header.d.ts.map +0 -1
- package/src/connectivity/index.ts +0 -19
- package/src/data/index.ts +0 -69
- package/src/notifications/overlay.tsx +0 -66
- package/src/query/error-message.ts +0 -70
- package/src/query/index.ts +0 -97
- package/src/router-tanstack/field.ts +0 -36
- package/src/router-tanstack/multi-search-param-store.ts +0 -106
- package/src/router-tanstack/search-param-store.ts +0 -100
- package/src/section/index.ts +0 -1
- package/src/widget-header/delta-badge.tsx +0 -77
- package/src/widget-header/index.ts +0 -10
- /package/dist/{utils → common}/is-dev.d.ts +0 -0
- /package/dist/{utils → common}/is-dev.js +0 -0
- /package/dist/{motion/index.js → common/motion.js} +0 -0
- /package/dist/{section → dashboard}/section.module.css +0 -0
- /package/dist/{section → dashboard}/section.module.css.d.ts +0 -0
- /package/dist/{widget-header → dashboard}/widget-header.d.ts +0 -0
- /package/dist/{widget-header → dashboard}/widget-header.js +0 -0
- /package/dist/{widget-header → dashboard}/widget-header.module.css +0 -0
- /package/dist/{widget-header → dashboard}/widget-header.module.css.d.ts +0 -0
- /package/dist/{connectivity → provider}/connectivity-indicator.d.ts +0 -0
- /package/dist/{connectivity → provider}/connectivity-indicator.js +0 -0
- /package/dist/{connectivity → provider}/connectivity-provider.js +0 -0
- /package/dist/{connectivity/types.js → provider/connectivity-types.js} +0 -0
- /package/dist/{connectivity → provider}/use-connectivity.js +0 -0
- /package/dist/{query/devtools.js → query-devtools.js} +0 -0
- /package/dist/{nav/types.js → shell/nav-types.js} +0 -0
- /package/src/{utils → common}/is-dev.ts +0 -0
- /package/src/{motion/index.ts → common/motion.ts} +0 -0
- /package/src/{section → dashboard}/section.module.css +0 -0
- /package/src/{section → dashboard}/section.module.css.d.ts +0 -0
- /package/src/{widget-header → dashboard}/widget-header.module.css +0 -0
- /package/src/{widget-header → dashboard}/widget-header.module.css.d.ts +0 -0
- /package/src/{widget-header → dashboard}/widget-header.tsx +0 -0
- /package/src/{connectivity/types.ts → provider/connectivity-types.ts} +0 -0
- /package/src/{nav/types.ts → shell/nav-types.ts} +0 -0
|
@@ -7,12 +7,9 @@ import type { QueryStateLike } from '../common/query-state-like.js';
|
|
|
7
7
|
*
|
|
8
8
|
* Named `tier`, not `variant` (audit B #19): `tier` is already the package's word for "how loud is
|
|
9
9
|
* this" on `WidgetHeader` and `CtlSlot`, and `'section'` meant two different things across the two
|
|
10
|
-
* spellings.
|
|
11
|
-
* under a consumer.
|
|
10
|
+
* spellings.
|
|
12
11
|
*/
|
|
13
12
|
export type QueryStateTier = 'page' | 'section';
|
|
14
|
-
/** The former name of {@link QueryStateTier}. Kept as an alias; prefer `QueryStateTier`. */
|
|
15
|
-
export type QueryStateVariant = QueryStateTier;
|
|
16
13
|
/**
|
|
17
14
|
* The structural subset of a TanStack `UseQueryResult` these components read — defined in
|
|
18
15
|
* `common/query-state-like.ts` and re-exported here, where consumers have always imported it from.
|
|
@@ -33,13 +30,11 @@ export type QueryEmptyCopy = {
|
|
|
33
30
|
export type LoadingStateProps = BasaltProps & {
|
|
34
31
|
/** How loud this state is. Default `'page'`. */
|
|
35
32
|
tier?: QueryStateTier;
|
|
36
|
-
/** @deprecated Renamed to `tier` — see {@link QueryStateTier}. Still honoured; `tier` wins. */
|
|
37
|
-
variant?: QueryStateTier;
|
|
38
33
|
/** Accessible name for the spinner. Say what is loading. */
|
|
39
34
|
label?: string;
|
|
40
35
|
};
|
|
41
36
|
/** A spinner on its own — `tier="page"` centres it in a generous block, `'section'` is bare. */
|
|
42
|
-
export declare function LoadingState({ tier,
|
|
37
|
+
export declare function LoadingState({ tier, label, className, style, }: LoadingStateProps): ReactNode;
|
|
43
38
|
export type ErrorStateProps = BasaltProps & {
|
|
44
39
|
/** Whatever was thrown — the raw Eden/fetch envelope is fine, it gets decoded. */
|
|
45
40
|
error: unknown;
|
|
@@ -52,8 +47,6 @@ export type ErrorStateProps = BasaltProps & {
|
|
|
52
47
|
retrying?: boolean;
|
|
53
48
|
/** How loud this state is. Default `'page'`. */
|
|
54
49
|
tier?: QueryStateTier;
|
|
55
|
-
/** @deprecated Renamed to `tier` — see {@link QueryStateTier}. Still honoured; `tier` wins. */
|
|
56
|
-
variant?: QueryStateTier;
|
|
57
50
|
/** Extra controls beside Retry (e.g. a "Back to shares" link). */
|
|
58
51
|
action?: ReactNode;
|
|
59
52
|
};
|
|
@@ -61,7 +54,7 @@ export type ErrorStateProps = BasaltProps & {
|
|
|
61
54
|
* The error branch: the REAL server message (via `toErrorMessage`) plus a retry. Usable on its own,
|
|
62
55
|
* outside a query — an auth gate or a boundary fallback renders it directly.
|
|
63
56
|
*/
|
|
64
|
-
export declare function ErrorState({ error, title, fallback, onRetry, retrying, tier,
|
|
57
|
+
export declare function ErrorState({ error, title, fallback, onRetry, retrying, tier, action, className, style, }: ErrorStateProps): ReactNode;
|
|
65
58
|
/**
|
|
66
59
|
* ONE slot, and the single-member union is the statement (`common/props.ts` lists this among the
|
|
67
60
|
* composites): `root` is whichever branch is live — the error alert's stack, the spinner's centre,
|
|
@@ -89,8 +82,6 @@ export type QueryStateProps<TData> = BasaltProps & SlotStylesProps<QueryStateSlo
|
|
|
89
82
|
errorAction?: ReactNode;
|
|
90
83
|
/** How loud every branch is. Default `'page'`. */
|
|
91
84
|
tier?: QueryStateTier;
|
|
92
|
-
/** @deprecated Renamed to `tier` — see {@link QueryStateTier}. Still honoured; `tier` wins. */
|
|
93
|
-
variant?: QueryStateTier;
|
|
94
85
|
/** Replace the default spinner (e.g. with a skeleton grid). */
|
|
95
86
|
loading?: ReactNode;
|
|
96
87
|
};
|
|
@@ -113,5 +104,5 @@ export type QueryStateProps<TData> = BasaltProps & SlotStylesProps<QueryStateSlo
|
|
|
113
104
|
* {(data) => <ImageGrid images={data.rows} />}
|
|
114
105
|
* </QueryState>
|
|
115
106
|
*/
|
|
116
|
-
export declare function QueryState<TData>({ query, children, empty, isEmpty, errorTitle, errorFallback, errorAction, tier,
|
|
107
|
+
export declare function QueryState<TData>({ query, children, empty, isEmpty, errorTitle, errorFallback, errorAction, tier, loading, className, style, classNames, }: QueryStateProps<TData>): ReactNode;
|
|
117
108
|
//# sourceMappingURL=query-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-state.d.ts","sourceRoot":"","sources":["../../src/dashboard/query-state.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE
|
|
1
|
+
{"version":3,"file":"query-state.d.ts","sourceRoot":"","sources":["../../src/dashboard/query-state.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,CAAA;AAE/C;;;;;GAKG;AACH,YAAY,EAAE,cAAc,EAAE,CAAA;AAE9B,kGAAkG;AAClG,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB,CAAA;AAID,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG;IAC5C,gDAAgD;IAChD,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAiB,EACjB,SAAS,EACT,KAAK,GACN,EAAE,iBAAiB,GAAG,SAAS,CAuB/B;AAID,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,kFAAkF;IAClF,KAAK,EAAE,OAAO,CAAA;IACd,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gDAAgD;IAChD,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,kEAAkE;IAClE,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAA8B,EAC9B,QAAgC,EAChC,OAAO,EACP,QAAgB,EAChB,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,eAAe,GAAG,SAAS,CAmC7B;AAcD;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAA;AAEnC,MAAM,MAAM,eAAe,CAAC,KAAK,IAAI,WAAW,GAC9C,eAAe,CAAC,cAAc,CAAC,GAAG;IAChC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,CAAA;IAC5B,wFAAwF;IACxF,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,SAAS,CAAC,CAAA;IAClD,uDAAuD;IACvD,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAA;IAClC,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uDAAuD;IACvD,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,kDAAkD;IAClD,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,CAAA;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,EAChC,KAAK,EACL,QAAQ,EACR,KAAK,EACL,OAAO,EACP,UAA6B,EAC7B,aAAqC,EACrC,WAAW,EACX,IAAI,EACJ,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG,SAAS,CAqEpC"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Alert, Button, Center, Group, Loader, Stack, Text } from "@mantine/core";
|
|
3
|
-
import { toErrorMessage } from "../
|
|
3
|
+
import { toErrorMessage } from "../common/errors.js";
|
|
4
4
|
import { cx } from "../common/props.js";
|
|
5
5
|
import { EmptyState } from "./empty-state.js";
|
|
6
6
|
import { assertQueryStateLike } from "../common/query-state-like.js";
|
|
7
7
|
function LoadingState({
|
|
8
8
|
tier,
|
|
9
|
-
variant,
|
|
10
9
|
label = "Loading",
|
|
11
10
|
className,
|
|
12
11
|
style
|
|
13
12
|
}) {
|
|
14
|
-
const resolved = tier ??
|
|
13
|
+
const resolved = tier ?? "page";
|
|
15
14
|
if (resolved === "section") {
|
|
16
15
|
return /* @__PURE__ */ jsx(
|
|
17
16
|
Loader,
|
|
@@ -39,12 +38,11 @@ function ErrorState({
|
|
|
39
38
|
onRetry,
|
|
40
39
|
retrying = false,
|
|
41
40
|
tier,
|
|
42
|
-
variant,
|
|
43
41
|
action,
|
|
44
42
|
className,
|
|
45
43
|
style
|
|
46
44
|
}) {
|
|
47
|
-
const resolved = tier ??
|
|
45
|
+
const resolved = tier ?? "page";
|
|
48
46
|
const alert = /* @__PURE__ */ jsx(
|
|
49
47
|
Alert,
|
|
50
48
|
{
|
|
@@ -90,14 +88,13 @@ function QueryState({
|
|
|
90
88
|
errorFallback = "The request failed.",
|
|
91
89
|
errorAction,
|
|
92
90
|
tier,
|
|
93
|
-
variant,
|
|
94
91
|
loading,
|
|
95
92
|
className,
|
|
96
93
|
style,
|
|
97
94
|
classNames
|
|
98
95
|
}) {
|
|
99
96
|
assertQueryStateLike("QueryState", query);
|
|
100
|
-
const resolvedTier = tier ??
|
|
97
|
+
const resolvedTier = tier ?? "page";
|
|
101
98
|
const rootClassName = cx(classNames?.root, className) || void 0;
|
|
102
99
|
const { data, isError, error, fetchStatus } = query;
|
|
103
100
|
const retrying = fetchStatus === "fetching";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { BasaltProps, SlotStylesProps } from '../common/props.js';
|
|
3
3
|
import type { SlotActions } from '../controls/actions.js';
|
|
4
|
-
import type { QueryEmptyCopy, QueryStateLike } from '
|
|
5
|
-
import type { WidgetHeaderProps } from '
|
|
4
|
+
import type { QueryEmptyCopy, QueryStateLike } from './query-state.js';
|
|
5
|
+
import type { WidgetHeaderProps } from './widget-header.js';
|
|
6
6
|
/**
|
|
7
7
|
* The three boxes `Section` paints, and the whole styling seam it offers (`common/props.ts`):
|
|
8
8
|
* `root` is the outer stack, `header` is the `WidgetHeader` row, `body` is the collapsible content
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/dashboard/section.tsx"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAGtD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAGxD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAA;AAMpD,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC,GACnF,WAAW,GACX,eAAe,CAAC,WAAW,CAAC,GAAG;IAC7B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;IAC/B;;;;OAIG;IACH,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,gGAAgG;IAChG,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;8CAC0C;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;uBACmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;uGACmG;IACnG,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;uDAEmD;IACnD,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,qGAAqG;IACrG,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAyDH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,KAAK,EACL,KAAK,EACL,IAAI,EACJ,WAAmB,EACnB,UAAU,EACV,WAAkB,EAClB,OAAO,EACP,EAAE,EACF,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,EACV,GAAG,WAAW,EACf,EAAE,YAAY,+BA4Fd"}
|
|
@@ -6,9 +6,9 @@ import { useValidateProps } from "../common/validate.js";
|
|
|
6
6
|
import { CtlSlot } from "../theme/index.js";
|
|
7
7
|
import { BarActionSlot, isBarActionList } from "../controls/actions.js";
|
|
8
8
|
import { useFilterSurface } from "../controls/filter-context.js";
|
|
9
|
-
import { QueryState } from "
|
|
9
|
+
import { QueryState } from "./query-state.js";
|
|
10
10
|
import { usePersistedOrLocal } from "../state/persisted-or-local.js";
|
|
11
|
-
import { WidgetHeader } from "
|
|
11
|
+
import { WidgetHeader } from "./widget-header.js";
|
|
12
12
|
import classes from "./section.module.css";
|
|
13
13
|
function actionBudgetMessage(title, actions) {
|
|
14
14
|
const count = isBarActionList(actions) ? actions.length : Children.count(actions);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { WidgetHeaderTitleProps } from '
|
|
2
|
+
import type { WidgetHeaderTitleProps } from './widget-header.js';
|
|
3
3
|
import type { BasaltProps, SlotStylesProps } from '../common/props.js';
|
|
4
4
|
/** The three boxes `SettingsSection`/`DangerZone` paint (`common/props.ts`). */
|
|
5
5
|
export type SettingsSectionSlot = 'root' | 'header' | 'body';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-section.d.ts","sourceRoot":"","sources":["../../src/dashboard/settings-section.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"settings-section.d.ts","sourceRoot":"","sources":["../../src/dashboard/settings-section.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAI7D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAYnE,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE5D;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAC5C,eAAe,CAAC,mBAAmB,CAAC,GACpC,sBAAsB,GAAG;IACvB,wDAAwD;IACxD,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,0DAA0D;IAC1D,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAEH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,oBAAoB,+BAmBtB;AAED,gEAAgE;AAChE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;AAE1D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GACxC,eAAe,CAAC,eAAe,CAAC,GAAG;IACjC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mDAAmD;IACnD,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAEH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,gBAAgB,+BAelB;AAED,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAA;AAElD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,eAAe,+BAwBjB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Card, Stack } from "@mantine/core";
|
|
3
|
-
import { WidgetHeader } from "
|
|
3
|
+
import { WidgetHeader } from "./widget-header.js";
|
|
4
4
|
import { CtlSlot } from "../theme/index.js";
|
|
5
5
|
import { alpha, VX } from "../tokens/index.js";
|
|
6
6
|
import { cx } from "../common/props.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { WidgetHeaderDeltaProps, WidgetHeaderMetricProps, WidgetHeaderTitleProps } from '
|
|
2
|
+
import type { WidgetHeaderDeltaProps, WidgetHeaderMetricProps, WidgetHeaderTitleProps } from './widget-header.js';
|
|
3
3
|
import type { BasaltProps, SlotStylesProps, Tone } from '../common/props.js';
|
|
4
4
|
import type { QueryStateLike } from './query-state.js';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-card.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-card.tsx"],"names":[],"mappings":"AAgGA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"stat-card.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-card.tsx"],"names":[],"mappings":"AAgGA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,iBAAiB,CAAA;AAIxB,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAA;AAE/B;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAA;CAC7B,CAAA;AAcD;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAkDD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GACrC,eAAe,CAAC,YAAY,CAAC,GAC7B,sBAAsB,GACtB,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,GACtC,sBAAsB,GAAG;IACvB;iEAC6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAC3C;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;IAC/B;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,qBAAqB,KAAK,SAAS,CAAC,CAAA;IACpE;yFACqF;IACrF,kBAAkB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IACtC;mGAC+F;IAC/F,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB;;;+EAG2E;IAC3E,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB,CAAA;AAEH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,SAAS,EACT,KAAK,EACL,KAAK,EACL,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,kBAA4B,EAC5B,OAAO,EACP,IAAI,EACJ,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,aAAa,+BA6Jf"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Card, VisuallyHidden } from "@mantine/core";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import { WidgetHeader } from "
|
|
4
|
+
import { WidgetHeader } from "./widget-header.js";
|
|
5
5
|
import { CtlSlot } from "../theme/index.js";
|
|
6
6
|
import { VX } from "../tokens/index.js";
|
|
7
7
|
import { cx } from "../common/props.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-header.d.ts","sourceRoot":"","sources":["../../src/dashboard/widget-header.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAGlD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE7D;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEnE,MAAM,MAAM,iBAAiB,GAAG,WAAW,GACzC,eAAe,CAAC,gBAAgB,CAAC,GAAG;IAClC;;;;gDAI4C;IAC5C,IAAI,EAAE,gBAAgB,CAAA;IACtB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,iGAAiG;IACjG,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;4DACwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;qEACiE;IACjE,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC;4DACwD;IACxD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;yDACqD;IACrD,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;2EACuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4FAA4F;IAC5F,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,CAAA;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC,CAAA;AAEpG;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,CAAC,CAAA;AAE/E;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,iBAAiB,EACjB,OAAO,GAAG,aAAa,GAAG,eAAe,GAAG,aAAa,GAAG,YAAY,CACzE,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BA8CnD;AAED,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,iBAAiB,+BAoDnB"}
|
package/dist/data/data-table.js
CHANGED
|
@@ -28,10 +28,10 @@ import { EnumFilter } from "../controls/enum-filter.js";
|
|
|
28
28
|
import { MultiSelectFilter } from "../controls/multi-select-filter.js";
|
|
29
29
|
import { CtlSlot } from "../theme/index.js";
|
|
30
30
|
import { alpha, VX } from "../tokens/index.js";
|
|
31
|
-
import { WidgetHeader } from "../
|
|
31
|
+
import { WidgetHeader } from "../dashboard/index.js";
|
|
32
32
|
import { ErrorState } from "../dashboard/query-state.js";
|
|
33
33
|
import { dataQueryBranch } from "./query-branch.js";
|
|
34
|
-
import { isDev } from "../
|
|
34
|
+
import { isDev } from "../common/is-dev.js";
|
|
35
35
|
import classes from "./data-table.module.css";
|
|
36
36
|
const ALIGNMENTS = /* @__PURE__ */ new Set(["left", "center", "right"]);
|
|
37
37
|
function resolveAlign(column) {
|
package/dist/data/table.d.ts
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export { BasaltDataTable } from './data-table.js';
|
|
22
22
|
export type { BasaltDataTableProps, BasaltDataTableSlot, DataTableAlign, DataTableColumnId, DataTableColumnPinning, DataTableFacet, DataTableFacetOption, } from './data-table.js';
|
|
23
|
-
export { createColumnHelper
|
|
23
|
+
export { createColumnHelper } from '@tanstack/react-table';
|
|
24
24
|
//# sourceMappingURL=table.d.ts.map
|
package/dist/data/table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/data/table.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,oBAAoB,GACrB,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/data/table.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,oBAAoB,GACrB,MAAM,cAAc,CAAA;AAOrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA"}
|
package/dist/data/table.js
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import { BasaltDataTable } from "./data-table.js";
|
|
2
|
-
import {
|
|
3
|
-
createColumnHelper,
|
|
4
|
-
useReactTable,
|
|
5
|
-
flexRender,
|
|
6
|
-
getCoreRowModel,
|
|
7
|
-
getSortedRowModel,
|
|
8
|
-
getFilteredRowModel,
|
|
9
|
-
getPaginationRowModel
|
|
10
|
-
} from "@tanstack/react-table";
|
|
2
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
11
3
|
export {
|
|
12
4
|
BasaltDataTable,
|
|
13
|
-
createColumnHelper
|
|
14
|
-
flexRender,
|
|
15
|
-
getCoreRowModel,
|
|
16
|
-
getFilteredRowModel,
|
|
17
|
-
getPaginationRowModel,
|
|
18
|
-
getSortedRowModel,
|
|
19
|
-
useReactTable
|
|
5
|
+
createColumnHelper
|
|
20
6
|
};
|
package/dist/data/virtual.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* rendered with a Mantine Box scroll container.
|
|
4
4
|
*
|
|
5
5
|
* Optional peer: @tanstack/react-virtual >=3.13.26 <4. This list works on any 3.x — the floor is
|
|
6
|
-
* set by ./agent-chat's virtualize mode
|
|
6
|
+
* set by ./agent-chat's virtualize mode, so do not lower it.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* —
|
|
8
|
+
* This subpath does NOT value-import @tanstack/react-table, so the data-table peer is never
|
|
9
|
+
* required — use `./data/table` when your app only needs the table.
|
|
10
10
|
*
|
|
11
11
|
* Install with:
|
|
12
12
|
* bun add @tanstack/react-virtual
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BasaltProps } from './common/props.js';
|
|
3
|
+
import type { ThemeLabControlsProps } from './theme-lab/index.js';
|
|
4
|
+
/** Which panel is open. `null` renders nothing (the dock is unmounted, not hidden). */
|
|
5
|
+
export type BasaltDevDockTool = 'router' | 'query' | 'theme';
|
|
6
|
+
type DevDockRouter = {
|
|
7
|
+
__routerHasBeenSetup?: unknown;
|
|
8
|
+
} | Record<string, unknown>;
|
|
9
|
+
export type BasaltDevDockProps = BasaltProps & {
|
|
10
|
+
/** Which panel to show. `null` renders nothing. */
|
|
11
|
+
tool: BasaltDevDockTool | null;
|
|
12
|
+
/** Called when the dock's own close button fires, or a hosted panel asks to close itself
|
|
13
|
+
* (the router devtools' own `setIsOpen`, the query devtools' own `onClose`). */
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
/** The active TanStack `Router` instance — required only to render the `'router'` tool; a
|
|
16
|
+
* consumer that never opens it may omit this entirely. */
|
|
17
|
+
router?: DevDockRouter;
|
|
18
|
+
/** Forwarded to the hosted `ThemeLabControls` (icons, the copy callback — see its own props). */
|
|
19
|
+
themeLab?: ThemeLabControlsProps;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Lazy, production-excluded dock. Safe to mount unconditionally with `tool={null}` — the dynamic
|
|
23
|
+
* imports for whichever peer a tool needs only fire once that tool is actually selected, and
|
|
24
|
+
* never at all in production.
|
|
25
|
+
*/
|
|
26
|
+
export declare function BasaltDevDock({ tool, onClose, router, themeLab, className, style, }: BasaltDevDockProps): ReactNode;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=dev-dock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-dock.d.ts","sourceRoot":"","sources":["../src/dev-dock.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAExD,uFAAuF;AACvF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAA;AAY5D,KAAK,aAAa,GAAG;IAAE,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAuBjF,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG;IAC7C,mDAAmD;IACnD,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC9B;oFACgF;IAChF,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB;8DAC0D;IAC1D,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,qBAAqB,CAAA;CACjC,CAAA;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,kBAAkB,GAAG,SAAS,CA8DhC"}
|
package/dist/dev-dock.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { lazy, Suspense } from "react";
|
|
3
|
+
import { Box, CloseButton, Flex, Group, Text } from "@mantine/core";
|
|
4
|
+
const TOOL_TITLE = {
|
|
5
|
+
router: "Router Devtools",
|
|
6
|
+
query: "Query Devtools",
|
|
7
|
+
theme: "Theme Lab"
|
|
8
|
+
};
|
|
9
|
+
const LazyRouterDevtoolsPanel = lazy(
|
|
10
|
+
() => import("@tanstack/react-router-devtools").then((m) => ({
|
|
11
|
+
default: m.TanStackRouterDevtoolsPanel
|
|
12
|
+
}))
|
|
13
|
+
);
|
|
14
|
+
Object.assign(LazyRouterDevtoolsPanel, { displayName: "LazyRouterDevtoolsPanel" });
|
|
15
|
+
const LazyQueryDevtoolsPanel = lazy(
|
|
16
|
+
() => import("@tanstack/react-query-devtools").then((m) => ({ default: m.ReactQueryDevtoolsPanel }))
|
|
17
|
+
);
|
|
18
|
+
Object.assign(LazyQueryDevtoolsPanel, { displayName: "LazyQueryDevtoolsPanel" });
|
|
19
|
+
const LazyThemeLabControls = lazy(
|
|
20
|
+
() => import("./theme-lab/index.js").then((m) => ({ default: m.ThemeLabControls }))
|
|
21
|
+
);
|
|
22
|
+
Object.assign(LazyThemeLabControls, { displayName: "LazyThemeLabControls" });
|
|
23
|
+
function BasaltDevDock({
|
|
24
|
+
tool,
|
|
25
|
+
onClose,
|
|
26
|
+
router,
|
|
27
|
+
themeLab,
|
|
28
|
+
className,
|
|
29
|
+
style
|
|
30
|
+
}) {
|
|
31
|
+
if (process.env["NODE_ENV"] === "production") return null;
|
|
32
|
+
if (tool === null) return null;
|
|
33
|
+
return /* @__PURE__ */ jsxs(
|
|
34
|
+
Flex,
|
|
35
|
+
{
|
|
36
|
+
direction: "column",
|
|
37
|
+
...className !== void 0 && { className },
|
|
38
|
+
style: {
|
|
39
|
+
position: "fixed",
|
|
40
|
+
left: 0,
|
|
41
|
+
right: 0,
|
|
42
|
+
bottom: 0,
|
|
43
|
+
height: "42vh",
|
|
44
|
+
zIndex: 400,
|
|
45
|
+
background: "var(--mantine-color-body)",
|
|
46
|
+
borderTop: "1px solid var(--mantine-color-default-border)",
|
|
47
|
+
// Floating tier: a fixed dock sits above the page like a menu/drawer, so it takes
|
|
48
|
+
// basalt's overlay depth token rather than Mantine's raw shadow ramp.
|
|
49
|
+
boxShadow: "var(--vx-shadow-overlay)",
|
|
50
|
+
...style
|
|
51
|
+
},
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsxs(
|
|
54
|
+
Group,
|
|
55
|
+
{
|
|
56
|
+
justify: "space-between",
|
|
57
|
+
px: "sm",
|
|
58
|
+
py: 6,
|
|
59
|
+
style: { borderBottom: "1px solid var(--mantine-color-default-border)" },
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", fw: 600, tt: "uppercase", c: "dimmed", children: TOOL_TITLE[tool] }),
|
|
62
|
+
/* @__PURE__ */ jsx(CloseButton, { size: "sm", onClick: onClose, "aria-label": "Close devtools" })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ jsx(Box, { style: { flex: 1, minHeight: 0, overflow: "auto" }, children: /* @__PURE__ */ jsxs(Suspense, { fallback: null, children: [
|
|
67
|
+
tool === "router" && router !== void 0 && /* @__PURE__ */ jsx(
|
|
68
|
+
LazyRouterDevtoolsPanel,
|
|
69
|
+
{
|
|
70
|
+
router,
|
|
71
|
+
isOpen: true,
|
|
72
|
+
setIsOpen: onClose,
|
|
73
|
+
style: { height: "100%" }
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
tool === "query" && /* @__PURE__ */ jsx(LazyQueryDevtoolsPanel, { onClose, style: { height: "100%" } }),
|
|
77
|
+
tool === "theme" && /* @__PURE__ */ jsx(Box, { p: "md", children: /* @__PURE__ */ jsx(LazyThemeLabControls, { ...themeLab }) })
|
|
78
|
+
] }) })
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
BasaltDevDock
|
|
85
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { LocaleOption } from './shared.js';
|
|
2
|
+
/** Axis-friendly short date: DD.MM. A non-finite or invalid date prints {@link NON_FINITE}. */
|
|
3
|
+
export declare function fmtAxisDate(value: unknown): string;
|
|
4
|
+
/** Tooltip-friendly long date: "Mon Apr 21 2026". A non-finite or invalid date prints
|
|
5
|
+
* {@link NON_FINITE}. */
|
|
6
|
+
export declare function fmtTooltipDate(date: unknown): string;
|
|
7
|
+
export type ClockOptions = LocaleOption & {
|
|
8
|
+
/** IANA zone (`'Europe/Vienna'`). Default the runtime's own zone — the same "local" argo's
|
|
9
|
+
* `d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })` call sites meant. */
|
|
10
|
+
timeZone?: string;
|
|
11
|
+
/** Render `:ss` too. Default false. */
|
|
12
|
+
seconds?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/** A local clock reading — `"09:41"`. Seeds: `m365-explorer/explorer-page.tsx`,
|
|
15
|
+
* `walking-pad/session-history.tsx` (both `toLocaleTimeString([...], { hour: '2-digit', minute:
|
|
16
|
+
* '2-digit' })`). A non-finite/unparseable input prints {@link NON_FINITE}. */
|
|
17
|
+
export declare function clock(value: Date | number | string, options?: ClockOptions): string;
|
|
18
|
+
export type WeekdayOptions = LocaleOption & {
|
|
19
|
+
/** `Intl.DateTimeFormat`'s own weekday widths. Default `'short'` (`"Mon"`). */
|
|
20
|
+
format?: 'short' | 'long' | 'narrow';
|
|
21
|
+
};
|
|
22
|
+
/** Weekday name — seeded from `astro-window/formulas.ts#fmtWeekday`. A plain `YYYY-MM-DD` string
|
|
23
|
+
* is parsed as a LOCAL calendar date (never UTC), matching that seed's own rationale: the weekday
|
|
24
|
+
* must not shift a day depending on the reader's timezone. A non-finite/unparseable input prints
|
|
25
|
+
* {@link NON_FINITE}. */
|
|
26
|
+
export declare function weekday(value: Date | number | string, options?: WeekdayOptions): string;
|
|
27
|
+
export type RelativeTimeOptions = LocaleOption & {
|
|
28
|
+
/** The reference "now" instant, epoch ms. Default `Date.now()` — mainly for tests. */
|
|
29
|
+
now?: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Short relative phrase — `"3 hours ago"`, `"in 2 days"`, `"just now"`. Seeded from
|
|
33
|
+
* `agent-chat/relative-time.ts#formatRelativeTime` (epoch-ms, 'en'-hardcoded), generalized with a
|
|
34
|
+
* `locale` option and accepting `Date`/ISO-string inputs too (argo's
|
|
35
|
+
* `reading/format.ts#relativeTime` and `garmin-health/formulas.ts#formatRelativeTime` both take an
|
|
36
|
+
* ISO string). A non-finite/unparseable input prints {@link NON_FINITE} rather than throwing —
|
|
37
|
+
* `Intl.RelativeTimeFormat.format` throws a `RangeError` on non-finite input, and this is
|
|
38
|
+
* render-path code where one bad timestamp must not blank a whole list.
|
|
39
|
+
*/
|
|
40
|
+
export declare function relativeTime(value: number | Date | string, options?: RelativeTimeOptions): string;
|
|
41
|
+
export type DurationUnit = 'seconds' | 'minutes';
|
|
42
|
+
export type DurationOptions = {
|
|
43
|
+
/** Unit of the input value. Default `'seconds'`. */
|
|
44
|
+
unit?: DurationUnit;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Human duration — `"1h 02m"`, `"5m"`, `"42s"`. Minutes zero-pad once an hour is present (`"1h
|
|
48
|
+
* 02m"`, a clock-reading convention); alone they don't (`"5m"`). Seconds show only under a minute
|
|
49
|
+
* (`"42s"`). A non-finite value prints {@link NON_FINITE}.
|
|
50
|
+
*
|
|
51
|
+
* The one signature standing in for argo's four duration spellings: `walking-pad/
|
|
52
|
+
* formatters.ts#formatDuration` (seconds, `<60s` → `"Ns"` — this IS that shape),
|
|
53
|
+
* `reading/format.ts#formatReadTime` (seconds, no `<60s` branch, floors at `"0m"` — pass a value
|
|
54
|
+
* `>= 60` and the shapes match), `astro-window/formulas.ts#fmtMinutes` (minutes as input — pass
|
|
55
|
+
* `{ unit: 'minutes' }`). The fourth, `walking-pad/formatters.ts#formatDurationClock` (`h:mm:ss`),
|
|
56
|
+
* is {@link durationClock} below, not this.
|
|
57
|
+
*/
|
|
58
|
+
export declare function duration(value: number, options?: DurationOptions): string;
|
|
59
|
+
/** Clock-style duration — `"1:02:03"`, `"04:12"`. Seeded from `walking-pad/
|
|
60
|
+
* formatters.ts#formatDurationClock`. A non-finite value prints {@link NON_FINITE}. */
|
|
61
|
+
export declare function durationClock(seconds: number): string;
|
|
62
|
+
//# sourceMappingURL=date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/format/date.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAK5C,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAYlD;AAED;yBACyB;AACzB,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAWpD;AAED,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IACxC;8FAC0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;+EAE+E;AAC/E,wBAAgB,KAAK,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAWvF;AAED,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG;IAC1C,+EAA+E;IAC/E,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;CACrC,CAAA;AAED;;;yBAGyB;AACzB,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,MAAM,CAW3F;AAED,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG;IAC/C,sFAAsF;IACtF,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAyBD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,EAC7B,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAUR;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,CAAA;AAEhD,MAAM,MAAM,eAAe,GAAG;IAC5B,oDAAoD;IACpD,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,MAAM,CAU7E;AAED;uFACuF;AACvF,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CASrD"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { dateFormat, NON_FINITE, toDate } from "./shared.js";
|
|
2
|
+
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
3
|
+
const SHORT_DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
4
|
+
function fmtAxisDate(value) {
|
|
5
|
+
if (typeof value === "number" && !Number.isFinite(value)) return NON_FINITE;
|
|
6
|
+
if (value instanceof Date) {
|
|
7
|
+
if (Number.isNaN(value.getTime())) return NON_FINITE;
|
|
8
|
+
const dd = String(value.getDate()).padStart(2, "0");
|
|
9
|
+
const mm = String(value.getMonth() + 1).padStart(2, "0");
|
|
10
|
+
return `${dd}.${mm}`;
|
|
11
|
+
}
|
|
12
|
+
const s = String(value ?? "");
|
|
13
|
+
const match = s.match(/(\d{4})-(\d{2})-(\d{2})/);
|
|
14
|
+
if (match) return `${match[3]}.${match[2]}`;
|
|
15
|
+
return s;
|
|
16
|
+
}
|
|
17
|
+
function fmtTooltipDate(date) {
|
|
18
|
+
if (typeof date === "number" && !Number.isFinite(date)) return NON_FINITE;
|
|
19
|
+
if (date instanceof Date) {
|
|
20
|
+
if (Number.isNaN(date.getTime())) return NON_FINITE;
|
|
21
|
+
return `${SHORT_DAYS[date.getDay()]} ${MONTHS[date.getMonth()]} ${date.getDate()} ${date.getFullYear()}`;
|
|
22
|
+
}
|
|
23
|
+
const s = String(date ?? "");
|
|
24
|
+
const match = s.match(/(\d{4})-(\d{2})-(\d{2})/);
|
|
25
|
+
if (!match) return s;
|
|
26
|
+
const d = new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3]));
|
|
27
|
+
return `${SHORT_DAYS[d.getDay()]} ${MONTHS[d.getMonth()]} ${d.getDate()} ${d.getFullYear()}`;
|
|
28
|
+
}
|
|
29
|
+
function clock(value, options = {}) {
|
|
30
|
+
const date = toDate(value);
|
|
31
|
+
if (date === null) return NON_FINITE;
|
|
32
|
+
const { locale, timeZone, seconds = false } = options;
|
|
33
|
+
return dateFormat(locale, {
|
|
34
|
+
hour: "2-digit",
|
|
35
|
+
minute: "2-digit",
|
|
36
|
+
...seconds && { second: "2-digit" },
|
|
37
|
+
hour12: false,
|
|
38
|
+
...timeZone !== void 0 && { timeZone }
|
|
39
|
+
}).format(date);
|
|
40
|
+
}
|
|
41
|
+
function weekday(value, options = {}) {
|
|
42
|
+
const date = typeof value === "string" && /^\d{4}-\d{2}-\d{2}$/.test(value) ? (() => {
|
|
43
|
+
const [y, m, d] = value.split("-").map(Number);
|
|
44
|
+
return new Date(y ?? 1970, (m ?? 1) - 1, d ?? 1);
|
|
45
|
+
})() : toDate(value);
|
|
46
|
+
if (date === null) return NON_FINITE;
|
|
47
|
+
const { locale, format = "short" } = options;
|
|
48
|
+
return dateFormat(locale, { weekday: format }).format(date);
|
|
49
|
+
}
|
|
50
|
+
const RELATIVE_TIME_UNITS = [
|
|
51
|
+
{ unit: "year", ms: 31536e6 },
|
|
52
|
+
{ unit: "month", ms: 2628e6 },
|
|
53
|
+
{ unit: "week", ms: 6048e5 },
|
|
54
|
+
{ unit: "day", ms: 864e5 },
|
|
55
|
+
{ unit: "hour", ms: 36e5 },
|
|
56
|
+
{ unit: "minute", ms: 6e4 }
|
|
57
|
+
];
|
|
58
|
+
const relativeTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
59
|
+
function relativeTimeFormat(locale) {
|
|
60
|
+
const key = locale ?? "";
|
|
61
|
+
const cached = relativeTimeFormatterCache.get(key);
|
|
62
|
+
if (cached !== void 0) return cached;
|
|
63
|
+
const created = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
|
|
64
|
+
relativeTimeFormatterCache.set(key, created);
|
|
65
|
+
return created;
|
|
66
|
+
}
|
|
67
|
+
function relativeTime(value, options = {}) {
|
|
68
|
+
const { locale, now = Date.now() } = options;
|
|
69
|
+
const timestamp = value instanceof Date ? value.getTime() : typeof value === "number" ? value : Date.parse(value);
|
|
70
|
+
if (!Number.isFinite(timestamp)) return NON_FINITE;
|
|
71
|
+
const diffMs = timestamp - now;
|
|
72
|
+
const absMs = Math.abs(diffMs);
|
|
73
|
+
if (absMs < 6e4) return "just now";
|
|
74
|
+
const unit = RELATIVE_TIME_UNITS.find(({ ms }) => absMs >= ms) ?? RELATIVE_TIME_UNITS.at(-1);
|
|
75
|
+
return relativeTimeFormat(locale).format(Math.round(diffMs / unit.ms), unit.unit);
|
|
76
|
+
}
|
|
77
|
+
function duration(value, options = {}) {
|
|
78
|
+
if (!Number.isFinite(value)) return NON_FINITE;
|
|
79
|
+
const { unit = "seconds" } = options;
|
|
80
|
+
const totalSeconds = Math.max(0, Math.round(unit === "minutes" ? value * 60 : value));
|
|
81
|
+
if (totalSeconds < 60) return `${totalSeconds}s`;
|
|
82
|
+
const totalMinutes = Math.round(totalSeconds / 60);
|
|
83
|
+
const h = Math.floor(totalMinutes / 60);
|
|
84
|
+
const m = totalMinutes % 60;
|
|
85
|
+
if (h === 0) return `${m}m`;
|
|
86
|
+
return `${h}h ${String(m).padStart(2, "0")}m`;
|
|
87
|
+
}
|
|
88
|
+
function durationClock(seconds) {
|
|
89
|
+
if (!Number.isFinite(seconds)) return NON_FINITE;
|
|
90
|
+
const total = Math.max(0, Math.round(seconds));
|
|
91
|
+
const h = Math.floor(total / 3600);
|
|
92
|
+
const m = Math.floor(total % 3600 / 60);
|
|
93
|
+
const s = total % 60;
|
|
94
|
+
const mm = String(m).padStart(2, "0");
|
|
95
|
+
const ss = String(s).padStart(2, "0");
|
|
96
|
+
return h > 0 ? `${h}:${mm}:${ss}` : `${mm}:${ss}`;
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
clock,
|
|
100
|
+
duration,
|
|
101
|
+
durationClock,
|
|
102
|
+
fmtAxisDate,
|
|
103
|
+
fmtTooltipDate,
|
|
104
|
+
relativeTime,
|
|
105
|
+
weekday
|
|
106
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `basalt-ui/format` — Mantine-free, React-free `Intl`-backed formatting. One implementation for
|
|
3
|
+
* numbers/percentages/money, dates/times/durations and the two measurement units argo needed
|
|
4
|
+
* (`km`/`kcal`) — replacing argo's `features/*\/{formatters,formulas,format}.ts` (~350 of 643
|
|
5
|
+
* lines across four duration spellings) and the chart layer's own `charts/utils/format.ts`, which
|
|
6
|
+
* now re-exports from here.
|
|
7
|
+
*
|
|
8
|
+
* Every formatter takes `(value, opts?)`; `locale` on every `opts` defaults to `undefined` —
|
|
9
|
+
* `Intl`'s own "use the runtime's locale". Every non-finite/unparseable input prints the same
|
|
10
|
+
* {@link NON_FINITE} em dash rather than `"NaN"` or throwing.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { money, percent, duration, weekday, relativeTime } from 'basalt-ui/format'
|
|
14
|
+
*
|
|
15
|
+
* money(1234, { currency: 'USD' }) // "$1,234"
|
|
16
|
+
* percent(0.42) // "42%"
|
|
17
|
+
* duration(3_723) // "1h 02m"
|
|
18
|
+
* weekday('2026-09-02') // "Wed"
|
|
19
|
+
* relativeTime(Date.now() - 3_600_000) // "1 hour ago"
|
|
20
|
+
*/
|
|
21
|
+
export { compact, deltaPct, type DeltaPctOptions, fmtCompact, type FmtCompactOptions, fmtCurrency, type FmtCurrencyOptions, fmtInt, fmtPercent, type FmtPercentOptions, integer, type LocaleOption, money, NON_FINITE, percent, } from './number.js';
|
|
22
|
+
export { clock, type ClockOptions, duration, durationClock, type DurationOptions, type DurationUnit, fmtAxisDate, fmtTooltipDate, relativeTime, type RelativeTimeOptions, weekday, type WeekdayOptions, } from './date.js';
|
|
23
|
+
export { kcal, type KcalOptions, km, type KmOptions } from './measure.js';
|
|
24
|
+
import { fmtCompact, fmtCurrency, fmtInt, fmtPercent } from './number.js';
|
|
25
|
+
import { fmtAxisDate, fmtTooltipDate } from './date.js';
|
|
26
|
+
/**
|
|
27
|
+
* Every shipped chart-facing formatter under one name, so a chart can be handed the whole set
|
|
28
|
+
* (`format={formatters.compact}`). Unchanged shape from `charts/utils/format.ts` — this is the
|
|
29
|
+
* SAME object, not a second one, so an existing `formatters.x` call site keeps working verbatim.
|
|
30
|
+
*/
|
|
31
|
+
export declare const formatters: {
|
|
32
|
+
readonly compact: typeof fmtCompact;
|
|
33
|
+
readonly percent: typeof fmtPercent;
|
|
34
|
+
readonly currency: typeof fmtCurrency;
|
|
35
|
+
readonly int: typeof fmtInt;
|
|
36
|
+
readonly axisDate: typeof fmtAxisDate;
|
|
37
|
+
readonly tooltipDate: typeof fmtTooltipDate;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/format/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,OAAO,EACP,QAAQ,EACR,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,iBAAiB,EACtB,WAAW,EACX,KAAK,kBAAkB,EACvB,MAAM,EACN,UAAU,EACV,KAAK,iBAAiB,EACtB,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,EACL,UAAU,EACV,OAAO,GACR,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,KAAK,EACL,KAAK,YAAY,EACjB,QAAQ,EACR,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,KAAK,mBAAmB,EACxB,OAAO,EACP,KAAK,cAAc,GACpB,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,WAAW,EAAE,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAA;AAEtE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAEpD;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;;;;;CAOb,CAAA"}
|