tempest-react-sdk 0.24.0 → 0.26.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/README.md +25 -4
- package/bin/lib/alias/collect.mjs +94 -0
- package/bin/lib/alias/collect.test.mjs +95 -0
- package/bin/lib/alias/discover.mjs +77 -0
- package/bin/lib/alias/discover.test.mjs +189 -0
- package/bin/lib/alias/index.mjs +88 -0
- package/bin/lib/alias/index.test.mjs +138 -0
- package/bin/lib/alias/rewrite-css.mjs +76 -0
- package/bin/lib/alias/rewrite-css.test.mjs +85 -0
- package/bin/lib/alias/rewrite.mjs +141 -0
- package/bin/lib/alias/rewrite.test.mjs +148 -0
- package/bin/lib/alias/specifier.mjs +49 -0
- package/bin/lib/alias/specifier.test.mjs +85 -0
- package/bin/lib/alias/tsconfig.mjs +116 -0
- package/bin/lib/alias/typescript.mjs +23 -0
- package/bin/lib/icons/generate.mjs +156 -0
- package/bin/lib/icons/generate.test.mjs +125 -0
- package/bin/tempest.mjs +158 -13
- package/dist/audio/use-audio.cjs +1 -1
- package/dist/audio/use-audio.cjs.map +1 -1
- package/dist/audio/use-audio.js +12 -12
- package/dist/audio/use-audio.js.map +1 -1
- package/dist/charts/AreaChart.cjs +1 -1
- package/dist/charts/AreaChart.cjs.map +1 -1
- package/dist/charts/AreaChart.js +7 -7
- package/dist/charts/AreaChart.js.map +1 -1
- package/dist/charts/BarChart.cjs +1 -1
- package/dist/charts/BarChart.cjs.map +1 -1
- package/dist/charts/BarChart.js +7 -7
- package/dist/charts/BarChart.js.map +1 -1
- package/dist/charts/LineChart.cjs +1 -1
- package/dist/charts/LineChart.cjs.map +1 -1
- package/dist/charts/LineChart.js +6 -6
- package/dist/charts/LineChart.js.map +1 -1
- package/dist/charts/PieChart.cjs +1 -1
- package/dist/charts/PieChart.cjs.map +1 -1
- package/dist/charts/PieChart.js +6 -6
- package/dist/charts/PieChart.js.map +1 -1
- package/dist/charts/RadarChart.cjs +1 -1
- package/dist/charts/RadarChart.cjs.map +1 -1
- package/dist/charts/RadarChart.js +6 -6
- package/dist/charts/RadarChart.js.map +1 -1
- package/dist/charts/palette.cjs +1 -1
- package/dist/charts/palette.cjs.map +1 -1
- package/dist/charts/palette.js +19 -2
- package/dist/charts/palette.js.map +1 -1
- package/dist/charts/use-chart-colors.cjs +2 -0
- package/dist/charts/use-chart-colors.cjs.map +1 -0
- package/dist/charts/use-chart-colors.js +29 -0
- package/dist/charts/use-chart-colors.js.map +1 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +61 -10
- package/dist/charts.js +8 -7
- package/dist/components/AvatarGroup/AvatarGroup.cjs +2 -0
- package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +39 -0
- package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.module.cjs +2 -0
- package/dist/components/AvatarGroup/AvatarGroup.module.cjs.map +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.module.js +16 -0
- package/dist/components/AvatarGroup/AvatarGroup.module.js.map +1 -0
- package/dist/components/ClickOutside/ClickOutside.cjs +1 -1
- package/dist/components/ClickOutside/ClickOutside.cjs.map +1 -1
- package/dist/components/ClickOutside/ClickOutside.js +3 -1
- package/dist/components/ClickOutside/ClickOutside.js.map +1 -1
- package/dist/components/DataTable/DataTable.cjs +1 -1
- package/dist/components/DataTable/DataTable.cjs.map +1 -1
- package/dist/components/DataTable/DataTable.js +21 -23
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/Kanban/Kanban.cjs +2 -0
- package/dist/components/Kanban/Kanban.cjs.map +1 -0
- package/dist/components/Kanban/Kanban.js +102 -0
- package/dist/components/Kanban/Kanban.js.map +1 -0
- package/dist/components/Kanban/Kanban.module.cjs +2 -0
- package/dist/components/Kanban/Kanban.module.cjs.map +1 -0
- package/dist/components/Kanban/Kanban.module.js +19 -0
- package/dist/components/Kanban/Kanban.module.js.map +1 -0
- package/dist/components/Lightbox/Lightbox.cjs +2 -0
- package/dist/components/Lightbox/Lightbox.cjs.map +1 -0
- package/dist/components/Lightbox/Lightbox.js +148 -0
- package/dist/components/Lightbox/Lightbox.js.map +1 -0
- package/dist/components/Lightbox/Lightbox.module.cjs +2 -0
- package/dist/components/Lightbox/Lightbox.module.cjs.map +1 -0
- package/dist/components/Lightbox/Lightbox.module.js +21 -0
- package/dist/components/Lightbox/Lightbox.module.js.map +1 -0
- package/dist/components/NotificationCenter/NotificationCenter.cjs +2 -0
- package/dist/components/NotificationCenter/NotificationCenter.cjs.map +1 -0
- package/dist/components/NotificationCenter/NotificationCenter.js +83 -0
- package/dist/components/NotificationCenter/NotificationCenter.js.map +1 -0
- package/dist/components/NotificationCenter/NotificationCenter.module.cjs +2 -0
- package/dist/components/NotificationCenter/NotificationCenter.module.cjs.map +1 -0
- package/dist/components/NotificationCenter/NotificationCenter.module.js +21 -0
- package/dist/components/NotificationCenter/NotificationCenter.module.js.map +1 -0
- package/dist/components/NotificationCenter/use-notification-inbox.cjs +2 -0
- package/dist/components/NotificationCenter/use-notification-inbox.cjs.map +1 -0
- package/dist/components/NotificationCenter/use-notification-inbox.js +63 -0
- package/dist/components/NotificationCenter/use-notification-inbox.js.map +1 -0
- package/dist/components/RefreshIndicator/RefreshIndicator.cjs +1 -1
- package/dist/components/RefreshIndicator/RefreshIndicator.cjs.map +1 -1
- package/dist/components/RefreshIndicator/RefreshIndicator.js +17 -17
- package/dist/components/RefreshIndicator/RefreshIndicator.js.map +1 -1
- package/dist/components/SignaturePad/SignaturePad.cjs +2 -0
- package/dist/components/SignaturePad/SignaturePad.cjs.map +1 -0
- package/dist/components/SignaturePad/SignaturePad.js +115 -0
- package/dist/components/SignaturePad/SignaturePad.js.map +1 -0
- package/dist/components/SignaturePad/SignaturePad.module.cjs +2 -0
- package/dist/components/SignaturePad/SignaturePad.module.cjs.map +1 -0
- package/dist/components/SignaturePad/SignaturePad.module.js +11 -0
- package/dist/components/SignaturePad/SignaturePad.module.js.map +1 -0
- package/dist/components/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.cjs.map +1 -1
- package/dist/components/Stepper/Stepper.js +43 -19
- package/dist/components/Stepper/Stepper.js.map +1 -1
- package/dist/components/Stepper/Stepper.module.cjs +1 -1
- package/dist/components/Stepper/Stepper.module.cjs.map +1 -1
- package/dist/components/Stepper/Stepper.module.js +6 -3
- package/dist/components/Stepper/Stepper.module.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +26 -20
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/TreeView/TreeView.cjs +2 -0
- package/dist/components/TreeView/TreeView.cjs.map +1 -0
- package/dist/components/TreeView/TreeView.js +124 -0
- package/dist/components/TreeView/TreeView.js.map +1 -0
- package/dist/components/TreeView/TreeView.module.cjs +2 -0
- package/dist/components/TreeView/TreeView.module.cjs.map +1 -0
- package/dist/components/TreeView/TreeView.module.js +17 -0
- package/dist/components/TreeView/TreeView.module.js.map +1 -0
- package/dist/components/VirtualTable/VirtualTable.cjs +2 -0
- package/dist/components/VirtualTable/VirtualTable.cjs.map +1 -0
- package/dist/components/VirtualTable/VirtualTable.js +116 -0
- package/dist/components/VirtualTable/VirtualTable.js.map +1 -0
- package/dist/components/VirtualTable/VirtualTable.module.cjs +2 -0
- package/dist/components/VirtualTable/VirtualTable.module.cjs.map +1 -0
- package/dist/components/VirtualTable/VirtualTable.module.js +20 -0
- package/dist/components/VirtualTable/VirtualTable.module.js.map +1 -0
- package/dist/components/Wizard/Wizard.cjs +2 -0
- package/dist/components/Wizard/Wizard.cjs.map +1 -0
- package/dist/components/Wizard/Wizard.js +111 -0
- package/dist/components/Wizard/Wizard.js.map +1 -0
- package/dist/components/Wizard/Wizard.module.cjs +2 -0
- package/dist/components/Wizard/Wizard.module.cjs.map +1 -0
- package/dist/components/Wizard/Wizard.module.js +10 -0
- package/dist/components/Wizard/Wizard.module.js.map +1 -0
- package/dist/geo/use-position-tracker.cjs +1 -1
- package/dist/geo/use-position-tracker.cjs.map +1 -1
- package/dist/geo/use-position-tracker.js +3 -1
- package/dist/geo/use-position-tracker.js.map +1 -1
- package/dist/hooks/use-async.cjs +1 -1
- package/dist/hooks/use-async.cjs.map +1 -1
- package/dist/hooks/use-async.js +3 -1
- package/dist/hooks/use-async.js.map +1 -1
- package/dist/hooks/use-click-outside.cjs +1 -1
- package/dist/hooks/use-click-outside.cjs.map +1 -1
- package/dist/hooks/use-click-outside.js +3 -1
- package/dist/hooks/use-click-outside.js.map +1 -1
- package/dist/hooks/use-deep-memo.cjs.map +1 -1
- package/dist/hooks/use-deep-memo.js.map +1 -1
- package/dist/hooks/use-event-listener.cjs +1 -1
- package/dist/hooks/use-event-listener.cjs.map +1 -1
- package/dist/hooks/use-event-listener.js +3 -1
- package/dist/hooks/use-event-listener.js.map +1 -1
- package/dist/hooks/use-interval.cjs +1 -1
- package/dist/hooks/use-interval.cjs.map +1 -1
- package/dist/hooks/use-interval.js +3 -1
- package/dist/hooks/use-interval.js.map +1 -1
- package/dist/hooks/use-is-first-render.cjs.map +1 -1
- package/dist/hooks/use-is-first-render.js.map +1 -1
- package/dist/hooks/use-long-press-handlers.cjs +1 -1
- package/dist/hooks/use-long-press-handlers.cjs.map +1 -1
- package/dist/hooks/use-long-press-handlers.js +25 -23
- package/dist/hooks/use-long-press-handlers.js.map +1 -1
- package/dist/hooks/use-long-press.cjs +1 -1
- package/dist/hooks/use-long-press.cjs.map +1 -1
- package/dist/hooks/use-long-press.js +3 -1
- package/dist/hooks/use-long-press.js.map +1 -1
- package/dist/hooks/use-online.cjs +1 -1
- package/dist/hooks/use-online.cjs.map +1 -1
- package/dist/hooks/use-online.js +6 -4
- package/dist/hooks/use-online.js.map +1 -1
- package/dist/hooks/use-previous.cjs.map +1 -1
- package/dist/hooks/use-previous.js.map +1 -1
- package/dist/hooks/use-service-worker-update.cjs +1 -1
- package/dist/hooks/use-service-worker-update.cjs.map +1 -1
- package/dist/hooks/use-service-worker-update.js +3 -1
- package/dist/hooks/use-service-worker-update.js.map +1 -1
- package/dist/hooks/use-sortable.cjs +2 -0
- package/dist/hooks/use-sortable.cjs.map +1 -0
- package/dist/hooks/use-sortable.js +169 -0
- package/dist/hooks/use-sortable.js.map +1 -0
- package/dist/hooks/use-stable-callback.cjs.map +1 -1
- package/dist/hooks/use-stable-callback.js.map +1 -1
- package/dist/hooks/use-timeout.cjs +1 -1
- package/dist/hooks/use-timeout.cjs.map +1 -1
- package/dist/hooks/use-timeout.js +3 -1
- package/dist/hooks/use-timeout.js.map +1 -1
- package/dist/icons/Icon.cjs +2 -0
- package/dist/icons/Icon.cjs.map +1 -0
- package/dist/icons/Icon.js +24 -0
- package/dist/icons/Icon.js.map +1 -0
- package/dist/icons/IconProvider.cjs +2 -0
- package/dist/icons/IconProvider.cjs.map +1 -0
- package/dist/icons/IconProvider.js +24 -0
- package/dist/icons/IconProvider.js.map +1 -0
- package/dist/icons/generated/aliases.cjs +2 -0
- package/dist/icons/generated/aliases.cjs.map +1 -0
- package/dist/icons/generated/aliases.js +255 -0
- package/dist/icons/generated/aliases.js.map +1 -0
- package/dist/icons/generated/icon-names.cjs +2 -0
- package/dist/icons/generated/icon-names.cjs.map +1 -0
- package/dist/icons/generated/icon-names.js +6 -0
- package/dist/icons/generated/icon-names.js.map +1 -0
- package/dist/icons/generated/loaders.cjs +2 -0
- package/dist/icons/generated/loaders.cjs.map +1 -0
- package/dist/icons/generated/loaders.js +32 -0
- package/dist/icons/generated/loaders.js.map +1 -0
- package/dist/icons/generated/shard-a.cjs +2 -0
- package/dist/icons/generated/shard-a.cjs.map +1 -0
- package/dist/icons/generated/shard-a.js +114 -0
- package/dist/icons/generated/shard-a.js.map +1 -0
- package/dist/icons/generated/shard-b.cjs +2 -0
- package/dist/icons/generated/shard-b.cjs.map +1 -0
- package/dist/icons/generated/shard-b.js +156 -0
- package/dist/icons/generated/shard-b.js.map +1 -0
- package/dist/icons/generated/shard-c.cjs +2 -0
- package/dist/icons/generated/shard-c.cjs.map +1 -0
- package/dist/icons/generated/shard-c.js +269 -0
- package/dist/icons/generated/shard-c.js.map +1 -0
- package/dist/icons/generated/shard-d.cjs +2 -0
- package/dist/icons/generated/shard-d.cjs.map +1 -0
- package/dist/icons/generated/shard-d.js +62 -0
- package/dist/icons/generated/shard-d.js.map +1 -0
- package/dist/icons/generated/shard-e.cjs +2 -0
- package/dist/icons/generated/shard-e.cjs.map +1 -0
- package/dist/icons/generated/shard-e.js +32 -0
- package/dist/icons/generated/shard-e.js.map +1 -0
- package/dist/icons/generated/shard-f.cjs +2 -0
- package/dist/icons/generated/shard-f.cjs.map +1 -0
- package/dist/icons/generated/shard-f.js +139 -0
- package/dist/icons/generated/shard-f.js.map +1 -0
- package/dist/icons/generated/shard-g.cjs +2 -0
- package/dist/icons/generated/shard-g.cjs.map +1 -0
- package/dist/icons/generated/shard-g.js +61 -0
- package/dist/icons/generated/shard-g.js.map +1 -0
- package/dist/icons/generated/shard-h.cjs +2 -0
- package/dist/icons/generated/shard-h.cjs.map +1 -0
- package/dist/icons/generated/shard-h.js +63 -0
- package/dist/icons/generated/shard-h.js.map +1 -0
- package/dist/icons/generated/shard-i.cjs +2 -0
- package/dist/icons/generated/shard-i.cjs.map +1 -0
- package/dist/icons/generated/shard-i.js +30 -0
- package/dist/icons/generated/shard-i.js.map +1 -0
- package/dist/icons/generated/shard-j.cjs +2 -0
- package/dist/icons/generated/shard-j.cjs.map +1 -0
- package/dist/icons/generated/shard-j.js +10 -0
- package/dist/icons/generated/shard-j.js.map +1 -0
- package/dist/icons/generated/shard-k.cjs +2 -0
- package/dist/icons/generated/shard-k.cjs.map +1 -0
- package/dist/icons/generated/shard-k.js +16 -0
- package/dist/icons/generated/shard-k.js.map +1 -0
- package/dist/icons/generated/shard-l.cjs +2 -0
- package/dist/icons/generated/shard-l.cjs.map +1 -0
- package/dist/icons/generated/shard-l.js +88 -0
- package/dist/icons/generated/shard-l.js.map +1 -0
- package/dist/icons/generated/shard-m.cjs +2 -0
- package/dist/icons/generated/shard-m.cjs.map +1 -0
- package/dist/icons/generated/shard-m.js +140 -0
- package/dist/icons/generated/shard-m.js.map +1 -0
- package/dist/icons/generated/shard-n.cjs +2 -0
- package/dist/icons/generated/shard-n.cjs.map +1 -0
- package/dist/icons/generated/shard-n.js +24 -0
- package/dist/icons/generated/shard-n.js.map +1 -0
- package/dist/icons/generated/shard-o.cjs +2 -0
- package/dist/icons/generated/shard-o.cjs.map +1 -0
- package/dist/icons/generated/shard-o.js +17 -0
- package/dist/icons/generated/shard-o.js.map +1 -0
- package/dist/icons/generated/shard-p.cjs +2 -0
- package/dist/icons/generated/shard-p.cjs.map +1 -0
- package/dist/icons/generated/shard-p.js +115 -0
- package/dist/icons/generated/shard-p.js.map +1 -0
- package/dist/icons/generated/shard-q.cjs +2 -0
- package/dist/icons/generated/shard-q.cjs.map +1 -0
- package/dist/icons/generated/shard-q.js +10 -0
- package/dist/icons/generated/shard-q.js.map +1 -0
- package/dist/icons/generated/shard-r.cjs +2 -0
- package/dist/icons/generated/shard-r.cjs.map +1 -0
- package/dist/icons/generated/shard-r.js +77 -0
- package/dist/icons/generated/shard-r.js.map +1 -0
- package/dist/icons/generated/shard-s.cjs +2 -0
- package/dist/icons/generated/shard-s.cjs.map +1 -0
- package/dist/icons/generated/shard-s.js +255 -0
- package/dist/icons/generated/shard-s.js.map +1 -0
- package/dist/icons/generated/shard-t.cjs +2 -0
- package/dist/icons/generated/shard-t.cjs.map +1 -0
- package/dist/icons/generated/shard-t.js +109 -0
- package/dist/icons/generated/shard-t.js.map +1 -0
- package/dist/icons/generated/shard-u.cjs +2 -0
- package/dist/icons/generated/shard-u.cjs.map +1 -0
- package/dist/icons/generated/shard-u.js +49 -0
- package/dist/icons/generated/shard-u.js.map +1 -0
- package/dist/icons/generated/shard-v.cjs +2 -0
- package/dist/icons/generated/shard-v.cjs.map +1 -0
- package/dist/icons/generated/shard-v.js +30 -0
- package/dist/icons/generated/shard-v.js.map +1 -0
- package/dist/icons/generated/shard-w.cjs +2 -0
- package/dist/icons/generated/shard-w.cjs.map +1 -0
- package/dist/icons/generated/shard-w.js +48 -0
- package/dist/icons/generated/shard-w.js.map +1 -0
- package/dist/icons/generated/shard-x.cjs +2 -0
- package/dist/icons/generated/shard-x.cjs.map +1 -0
- package/dist/icons/generated/shard-x.js +10 -0
- package/dist/icons/generated/shard-x.js.map +1 -0
- package/dist/icons/generated/shard-z.cjs +2 -0
- package/dist/icons/generated/shard-z.cjs.map +1 -0
- package/dist/icons/generated/shard-z.js +25 -0
- package/dist/icons/generated/shard-z.js.map +1 -0
- package/dist/icons/icon-context.cjs +2 -0
- package/dist/icons/icon-context.cjs.map +1 -0
- package/dist/icons/icon-context.js +13 -0
- package/dist/icons/icon-context.js.map +1 -0
- package/dist/icons/is-icon-name.cjs +2 -0
- package/dist/icons/is-icon-name.cjs.map +1 -0
- package/dist/icons/is-icon-name.js +10 -0
- package/dist/icons/is-icon-name.js.map +1 -0
- package/dist/icons/shard-cache.cjs +2 -0
- package/dist/icons/shard-cache.cjs.map +1 -0
- package/dist/icons/shard-cache.js +41 -0
- package/dist/icons/shard-cache.js.map +1 -0
- package/dist/icons/use-icon.cjs +2 -0
- package/dist/icons/use-icon.cjs.map +1 -0
- package/dist/icons/use-icon.js +20 -0
- package/dist/icons/use-icon.js.map +1 -0
- package/dist/icons-virtual.d.ts +22 -0
- package/dist/icons.cjs +1 -0
- package/dist/icons.d.ts +220 -0
- package/dist/icons.js +9 -0
- package/dist/offline/create-offline-sync.cjs +1 -1
- package/dist/offline/create-offline-sync.cjs.map +1 -1
- package/dist/offline/create-offline-sync.js +8 -2
- package/dist/offline/create-offline-sync.js.map +1 -1
- package/dist/offline/use-offline-sync.cjs +1 -1
- package/dist/offline/use-offline-sync.cjs.map +1 -1
- package/dist/offline/use-offline-sync.js +3 -1
- package/dist/offline/use-offline-sync.js.map +1 -1
- package/dist/push/use-push-subscription.cjs +1 -1
- package/dist/push/use-push-subscription.cjs.map +1 -1
- package/dist/push/use-push-subscription.js +3 -1
- package/dist/push/use-push-subscription.js.map +1 -1
- package/dist/sse/use-event-stream.cjs +1 -1
- package/dist/sse/use-event-stream.cjs.map +1 -1
- package/dist/sse/use-event-stream.js +3 -1
- package/dist/sse/use-event-stream.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tempest-react-sdk.cjs +1 -1
- package/dist/tempest-react-sdk.d.ts +1187 -2
- package/dist/tempest-react-sdk.js +261 -246
- package/dist/theme/ThemeProvider.cjs +1 -1
- package/dist/theme/ThemeProvider.cjs.map +1 -1
- package/dist/theme/ThemeProvider.js +6 -2
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/apply-theme.cjs +2 -0
- package/dist/theme/apply-theme.cjs.map +1 -0
- package/dist/theme/apply-theme.js +24 -0
- package/dist/theme/apply-theme.js.map +1 -0
- package/dist/theme/color.cjs +2 -0
- package/dist/theme/color.cjs.map +1 -0
- package/dist/theme/color.js +161 -0
- package/dist/theme/color.js.map +1 -0
- package/dist/theme/create-theme.cjs +5 -0
- package/dist/theme/create-theme.cjs.map +1 -0
- package/dist/theme/create-theme.js +141 -0
- package/dist/theme/create-theme.js.map +1 -0
- package/dist/theme/theme-presets.cjs +2 -0
- package/dist/theme/theme-presets.cjs.map +1 -0
- package/dist/theme/theme-presets.js +82 -0
- package/dist/theme/theme-presets.js.map +1 -0
- package/dist/utilities.css +432 -0
- package/dist/utils/compare-values.cjs +2 -0
- package/dist/utils/compare-values.cjs.map +1 -0
- package/dist/utils/compare-values.js +8 -0
- package/dist/utils/compare-values.js.map +1 -0
- package/dist/vision/use-camera-stream.cjs +1 -1
- package/dist/vision/use-camera-stream.cjs.map +1 -1
- package/dist/vision/use-camera-stream.js +3 -1
- package/dist/vision/use-camera-stream.js.map +1 -1
- package/dist/vite/create-vite-config.cjs +1 -1
- package/dist/vite/create-vite-config.cjs.map +1 -1
- package/dist/vite/create-vite-config.js +30 -22
- package/dist/vite/create-vite-config.js.map +1 -1
- package/dist/vite/tempest-icons.cjs +9 -0
- package/dist/vite/tempest-icons.cjs.map +1 -0
- package/dist/vite/tempest-icons.js +99 -0
- package/dist/vite/tempest-icons.js.map +1 -0
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.ts +79 -0
- package/dist/vite.js +6 -5
- package/dist/ws/use-web-socket.cjs +1 -1
- package/dist/ws/use-web-socket.cjs.map +1 -1
- package/dist/ws/use-web-socket.js +3 -1
- package/dist/ws/use-web-socket.js.map +1 -1
- package/package.json +14 -4
- package/template/package.json +1 -1
package/bin/tempest.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// tempest doctor health-check the current project (à la flutter doctor)
|
|
5
5
|
// tempest lint [paths…] run ESLint (report only)
|
|
6
|
-
// tempest fix [paths…]
|
|
6
|
+
// tempest fix [paths…] alias imports (../ → @/) + ESLint --fix + Prettier
|
|
7
7
|
// tempest format [paths…] Prettier --write
|
|
8
8
|
// tempest --help | --version
|
|
9
9
|
import { spawnSync } from "node:child_process";
|
|
@@ -11,6 +11,10 @@ import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
|
11
11
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
12
12
|
import { dirname, join, resolve } from "node:path";
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
14
|
+
import { aliasImports } from "./lib/alias/index.mjs";
|
|
15
|
+
import { loadTypeScript } from "./lib/alias/typescript.mjs";
|
|
16
|
+
import { readTsconfig } from "./lib/alias/tsconfig.mjs";
|
|
17
|
+
import { generateRegistry, loadIconTables } from "./lib/icons/generate.mjs";
|
|
14
18
|
import { generate } from "./lib/openapi/generate.mjs";
|
|
15
19
|
import { loadSpec } from "./lib/openapi/load.mjs";
|
|
16
20
|
|
|
@@ -414,10 +418,10 @@ function doctor() {
|
|
|
414
418
|
}
|
|
415
419
|
|
|
416
420
|
// ── TypeScript ────────────────────────────────────────────────────────────
|
|
417
|
-
const tsc =
|
|
421
|
+
const tsc = readTsconfig({ root: ROOT, ts: loadTypeScript(ROOT) });
|
|
418
422
|
if (tsc) {
|
|
419
423
|
checks.push(["section", "TypeScript"]);
|
|
420
|
-
const co = tsc.compilerOptions
|
|
424
|
+
const co = tsc.compilerOptions;
|
|
421
425
|
checks.push(
|
|
422
426
|
co.paths?.["@/*"]
|
|
423
427
|
? ["ok", 'tsconfig "@/*" alias']
|
|
@@ -625,12 +629,93 @@ function requireBin(name) {
|
|
|
625
629
|
return bin;
|
|
626
630
|
}
|
|
627
631
|
|
|
628
|
-
|
|
629
|
-
|
|
632
|
+
/**
|
|
633
|
+
* Split argv into flags and positional paths.
|
|
634
|
+
*
|
|
635
|
+
* Needed because these commands used to hand `rest` straight through as their
|
|
636
|
+
* path list, so `tempest lint --max-warnings 0` counted the flag as a path and
|
|
637
|
+
* ESLint ran with a flag but no pattern. Flags are kept in order for forwarding.
|
|
638
|
+
*
|
|
639
|
+
* @param {string[]} args - The argv tail for the command.
|
|
640
|
+
* @returns {{ flags: string[], paths: string[] }}
|
|
641
|
+
*/
|
|
642
|
+
function splitArgs(args) {
|
|
643
|
+
const flags = [];
|
|
644
|
+
const paths = [];
|
|
645
|
+
for (const arg of args) (arg.startsWith("-") ? flags : paths).push(arg);
|
|
646
|
+
return { flags, paths };
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
function lint(args) {
|
|
650
|
+
const { flags, paths } = splitArgs(args);
|
|
651
|
+
return run(requireBin("eslint"), [...(paths.length ? paths : ["."]), ...flags]);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/** Flags `fix` owns itself; anything else is rejected rather than forwarded. */
|
|
655
|
+
const FIX_FLAGS = new Set(["--no-alias", "--dry-run"]);
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Print the alias pass result.
|
|
659
|
+
*
|
|
660
|
+
* @param {object} result - Return value of `aliasImports`.
|
|
661
|
+
* @param {boolean} dryRun - Whether the pass wrote anything.
|
|
662
|
+
* @returns {void}
|
|
663
|
+
*/
|
|
664
|
+
function reportAlias(result, dryRun) {
|
|
665
|
+
if (result.status === "no-typescript") {
|
|
666
|
+
console.log(
|
|
667
|
+
`${c.yellow}! typescript not installed — skipping alias pass${c.reset} ${c.dim}(npm i -D typescript)${c.reset}`,
|
|
668
|
+
);
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
if (result.status === "no-alias") {
|
|
672
|
+
console.log(
|
|
673
|
+
`${c.yellow}! no path alias found — skipping alias pass${c.reset} ${c.dim}add "paths": { "@/*": ["./src/*"] } to tsconfig.json${c.reset}`,
|
|
674
|
+
);
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
for (const file of result.files) {
|
|
678
|
+
console.log(` ${file.path} ${c.dim}${file.changes.length}${c.reset}`);
|
|
679
|
+
if (dryRun) {
|
|
680
|
+
for (const ch of file.changes) {
|
|
681
|
+
console.log(` ${c.dim}${ch.line}:${c.reset} "${ch.from}" → "${ch.to}"`);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
for (const err of result.errors) {
|
|
686
|
+
console.log(` ${c.red}✗ ${err.path}${c.reset} ${c.dim}${err.message}${c.reset}`);
|
|
687
|
+
}
|
|
688
|
+
if (!result.total) {
|
|
689
|
+
console.log(` ${c.dim}nothing to convert${c.reset}`);
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
const verb = dryRun ? "would convert" : "converted";
|
|
693
|
+
console.log(
|
|
694
|
+
` ${c.green}✓${c.reset} ${verb} ${result.total} import(s) in ${result.files.length} file(s)`,
|
|
695
|
+
);
|
|
630
696
|
}
|
|
631
697
|
|
|
632
|
-
function fix(
|
|
698
|
+
function fix(args) {
|
|
699
|
+
const { flags, paths } = splitArgs(args);
|
|
700
|
+
const unknown = flags.filter((f) => !FIX_FLAGS.has(f));
|
|
701
|
+
if (unknown.length) {
|
|
702
|
+
console.error(
|
|
703
|
+
`${c.red}✗ Unknown flag for fix: ${unknown.join(", ")}${c.reset} — supported: ${[...FIX_FLAGS].join(", ")}`,
|
|
704
|
+
);
|
|
705
|
+
return 1;
|
|
706
|
+
}
|
|
633
707
|
const targets = paths.length ? paths : ["."];
|
|
708
|
+
const dryRun = flags.includes("--dry-run");
|
|
709
|
+
|
|
710
|
+
let aliasStatus = 0;
|
|
711
|
+
if (!flags.includes("--no-alias")) {
|
|
712
|
+
console.log(`${c.dim}→ alias imports (../ → @/)${dryRun ? " [dry-run]" : ""}${c.reset}`);
|
|
713
|
+
const result = aliasImports({ root: ROOT, targets, dryRun });
|
|
714
|
+
reportAlias(result, dryRun);
|
|
715
|
+
aliasStatus = result.status === "error" ? 1 : 0;
|
|
716
|
+
}
|
|
717
|
+
if (dryRun) return aliasStatus;
|
|
718
|
+
|
|
634
719
|
console.log(`${c.dim}→ eslint --fix (sort imports · drop unused · tidy whitespace)${c.reset}`);
|
|
635
720
|
const eslintStatus = run(requireBin("eslint"), [...targets, "--fix"]);
|
|
636
721
|
const prettier = localBin("prettier");
|
|
@@ -641,11 +726,12 @@ function fix(paths) {
|
|
|
641
726
|
} else {
|
|
642
727
|
console.log(`${c.yellow}! prettier not installed — skipping format pass${c.reset}`);
|
|
643
728
|
}
|
|
644
|
-
return eslintStatus || prettierStatus;
|
|
729
|
+
return aliasStatus || eslintStatus || prettierStatus;
|
|
645
730
|
}
|
|
646
731
|
|
|
647
|
-
function format(
|
|
648
|
-
|
|
732
|
+
function format(args) {
|
|
733
|
+
const { flags, paths } = splitArgs(args);
|
|
734
|
+
return run(requireBin("prettier"), ["--write", ...(paths.length ? paths : ["."]), ...flags]);
|
|
649
735
|
}
|
|
650
736
|
|
|
651
737
|
// -------------------------------------------------------------- gen api ----
|
|
@@ -701,15 +787,67 @@ async function genApi(args) {
|
|
|
701
787
|
return 0;
|
|
702
788
|
}
|
|
703
789
|
|
|
790
|
+
// ------------------------------------------------------------ gen icons ----
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* `tempest gen icons [--out src/icons.generated.ts] [--dir src]` — write a static
|
|
794
|
+
* icon registry from the slugs the project's source mentions.
|
|
795
|
+
*
|
|
796
|
+
* The `tempestIcons()` Vite plugin does the same thing as a virtual module and
|
|
797
|
+
* needs no file; this exists for a project that is not on Vite, or that prefers a
|
|
798
|
+
* registry it can read and commit.
|
|
799
|
+
*/
|
|
800
|
+
async function genIcons(args) {
|
|
801
|
+
const outRel = parseOut(args, "src/icons.generated.ts");
|
|
802
|
+
const dirIndex = args.indexOf("--dir");
|
|
803
|
+
const dirRel = dirIndex >= 0 && args[dirIndex + 1] ? args[dirIndex + 1] : "src";
|
|
804
|
+
const dir = resolve(ROOT, dirRel);
|
|
805
|
+
|
|
806
|
+
let tables;
|
|
807
|
+
try {
|
|
808
|
+
tables = await loadIconTables(SELF_DIR);
|
|
809
|
+
} catch {
|
|
810
|
+
console.error(
|
|
811
|
+
`${c.red}✗ Could not read the icon tables from the installed SDK.${c.reset} Is tempest-react-sdk installed and built?`,
|
|
812
|
+
);
|
|
813
|
+
return 1;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
console.log(`${c.dim}→ scanning ${dirRel}${c.reset}`);
|
|
817
|
+
const { source, slugs, files } = await generateRegistry({
|
|
818
|
+
dir,
|
|
819
|
+
known: tables.known,
|
|
820
|
+
aliases: tables.aliases,
|
|
821
|
+
});
|
|
822
|
+
|
|
823
|
+
const dest = resolve(ROOT, outRel);
|
|
824
|
+
await mkdir(dirname(dest), { recursive: true });
|
|
825
|
+
await writeFile(dest, source);
|
|
826
|
+
|
|
827
|
+
console.log(
|
|
828
|
+
`\n${c.green}✓ ${slugs.length} icon(s)${c.reset} from ${files} file(s) → ${c.bold}${outRel}${c.reset}`,
|
|
829
|
+
);
|
|
830
|
+
const prettier = localBin("prettier");
|
|
831
|
+
if (prettier) run(prettier, ["--write", outRel]);
|
|
832
|
+
console.log(`\n${c.dim}Wire it up:${c.reset}`);
|
|
833
|
+
console.log(` import { IconProvider } from "tempest-react-sdk/icons";`);
|
|
834
|
+
console.log(` import { icons } from "@/icons.generated";`);
|
|
835
|
+
console.log(` <IconProvider registry={icons}>…</IconProvider>`);
|
|
836
|
+
return 0;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
const GEN_TARGETS = { api: genApi, icons: genIcons };
|
|
840
|
+
|
|
704
841
|
function gen(args) {
|
|
705
842
|
const what = args[0];
|
|
706
|
-
|
|
843
|
+
const target = GEN_TARGETS[what];
|
|
844
|
+
if (!target) {
|
|
707
845
|
console.error(
|
|
708
|
-
`${c.red}✗ Unknown gen target: ${what ?? "(none)"}${c.reset} —
|
|
846
|
+
`${c.red}✗ Unknown gen target: ${what ?? "(none)"}${c.reset} — supported: ${Object.keys(GEN_TARGETS).join(", ")}.`,
|
|
709
847
|
);
|
|
710
848
|
return 1;
|
|
711
849
|
}
|
|
712
|
-
return
|
|
850
|
+
return target(args.slice(1));
|
|
713
851
|
}
|
|
714
852
|
|
|
715
853
|
// ------------------------------------------------------------------ main ----
|
|
@@ -724,10 +862,17 @@ ${c.bold}Usage${c.reset}
|
|
|
724
862
|
${c.bold}Commands${c.reset}
|
|
725
863
|
${c.bold}doctor${c.reset} Health-check the current project
|
|
726
864
|
${c.bold}lint${c.reset} [paths] Run ESLint (report only)
|
|
727
|
-
${c.bold}fix${c.reset} [paths] ESLint --fix (sort imports, remove
|
|
865
|
+
${c.bold}fix${c.reset} [paths] Alias imports (../ → @/) + ESLint --fix (sort imports, remove
|
|
866
|
+
unused, tidy whitespace) + Prettier
|
|
728
867
|
${c.bold}format${c.reset} [paths] Prettier --write
|
|
729
868
|
${c.bold}gen api${c.reset} <src> Generate Zod schemas + types + service classes from an OpenAPI spec
|
|
730
869
|
(e.g. tempest gen api http://127.0.0.1:8000/openapi.json --out src/api)
|
|
870
|
+
${c.bold}gen icons${c.reset} Write a static icon registry from the slugs your source uses
|
|
871
|
+
(e.g. tempest gen icons --out src/icons.generated.ts --dir src)
|
|
872
|
+
|
|
873
|
+
${c.bold}fix options${c.reset}
|
|
874
|
+
--dry-run List the imports that would be rewritten; write nothing
|
|
875
|
+
--no-alias Skip the alias pass (ESLint + Prettier only)
|
|
731
876
|
|
|
732
877
|
${c.bold}Options${c.reset}
|
|
733
878
|
-h, --help Show this help
|
package/dist/audio/use-audio.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./audio-player.cjs");let t=require("react");function n(){let
|
|
1
|
+
const e=require("./audio-player.cjs");let t=require("react");function n(){let[n]=(0,t.useState)(()=>e.createAudioPlayer()),[r,i]=(0,t.useState)(!1);return(0,t.useEffect)(()=>()=>{n.stop()},[n]),{play:(0,t.useCallback)(async(e,t)=>{await n.play(e,t)&&i(!0)},[n]),stop:(0,t.useCallback)(()=>{n.stop()},[n]),unlocked:r}}exports.useAudio=n;
|
|
2
2
|
//# sourceMappingURL=use-audio.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-audio.cjs","names":[],"sources":["../../src/audio/use-audio.ts"],"sourcesContent":["import { useCallback, useEffect,
|
|
1
|
+
{"version":3,"file":"use-audio.cjs","names":[],"sources":["../../src/audio/use-audio.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from \"react\";\nimport { createAudioPlayer, type AudioPlayer, type PlayAudioOptions } from \"./audio-player\";\n\nexport interface UseAudioResult {\n /** Play `src` on the hook's private player. */\n play: (src: string, options?: PlayAudioOptions) => Promise<void>;\n /** Stop the current clip. */\n stop: () => void;\n /**\n * Whether the browser's autoplay policy has been satisfied. Becomes\n * `true` after the first successful `play()`.\n */\n unlocked: boolean;\n}\n\n/**\n * The player lives in a state initializer, not in a lazily-written ref: the\n * initializer runs exactly once and is not a side effect during render, which is\n * what the ref version was. The player identity never changes, so state holds it\n * fine and the value is non-null from the first render.\n *\n * Hook-managed audio player. Each component instance gets its own\n * {@link AudioPlayer}, so unmounting cleanly stops playback. Useful for\n * notification chimes, UI feedback sounds, and per-component soundtracks.\n */\nexport function useAudio(): UseAudioResult {\n const [player] = useState<AudioPlayer>(() => createAudioPlayer());\n const [unlocked, setUnlocked] = useState<boolean>(false);\n\n useEffect(() => {\n return () => {\n player.stop();\n };\n }, [player]);\n\n const play = useCallback(\n async (src: string, options?: PlayAudioOptions): Promise<void> => {\n const result = await player.play(src, options);\n if (result) setUnlocked(true);\n },\n [player],\n );\n\n const stop = useCallback((): void => {\n player.stop();\n }, [player]);\n\n return { play, stop, unlocked };\n}\n"],"mappings":"6DAyBA,SAAgB,GAA2B,CACvC,GAAM,CAAC,IAAA,EAAA,EAAA,SAAA,KAAsC,EAAA,kBAAkB,CAAC,EAC1D,CAAC,EAAU,IAAA,EAAA,EAAA,SAAA,CAAiC,EAAK,EAoBvD,OAlBA,EAAA,EAAA,UAAA,SACiB,CACT,EAAO,KAAK,CAChB,EACD,CAAC,CAAM,CAAC,EAcJ,CAAE,MAAA,EAAA,EAAA,YAAA,CAXL,MAAO,EAAa,IAA8C,CAE1D,MADiB,EAAO,KAAK,EAAK,CAAO,GACjC,EAAY,EAAI,CAChC,EACA,CAAC,CAAM,CAOF,EAAM,MAAA,EAAA,EAAA,YAAA,KAJsB,CACjC,EAAO,KAAK,CAChB,EAAG,CAAC,CAAM,CAEK,EAAM,UAAS,CAClC"}
|
package/dist/audio/use-audio.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { createAudioPlayer as e } from "./audio-player.js";
|
|
2
|
-
import { useCallback as t, useEffect as n,
|
|
2
|
+
import { useCallback as t, useEffect as n, useState as r } from "react";
|
|
3
3
|
//#region src/audio/use-audio.ts
|
|
4
|
-
function
|
|
5
|
-
let
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
}, []), {
|
|
4
|
+
function i() {
|
|
5
|
+
let [i] = r(() => e()), [a, o] = r(!1);
|
|
6
|
+
return n(() => () => {
|
|
7
|
+
i.stop();
|
|
8
|
+
}, [i]), {
|
|
9
9
|
play: t(async (e, t) => {
|
|
10
|
-
await
|
|
11
|
-
}, []),
|
|
10
|
+
await i.play(e, t) && o(!0);
|
|
11
|
+
}, [i]),
|
|
12
12
|
stop: t(() => {
|
|
13
|
-
|
|
14
|
-
}, []),
|
|
15
|
-
unlocked:
|
|
13
|
+
i.stop();
|
|
14
|
+
}, [i]),
|
|
15
|
+
unlocked: a
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
export {
|
|
19
|
+
export { i as useAudio };
|
|
20
20
|
|
|
21
21
|
//# sourceMappingURL=use-audio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-audio.js","names":[],"sources":["../../src/audio/use-audio.ts"],"sourcesContent":["import { useCallback, useEffect,
|
|
1
|
+
{"version":3,"file":"use-audio.js","names":[],"sources":["../../src/audio/use-audio.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from \"react\";\nimport { createAudioPlayer, type AudioPlayer, type PlayAudioOptions } from \"./audio-player\";\n\nexport interface UseAudioResult {\n /** Play `src` on the hook's private player. */\n play: (src: string, options?: PlayAudioOptions) => Promise<void>;\n /** Stop the current clip. */\n stop: () => void;\n /**\n * Whether the browser's autoplay policy has been satisfied. Becomes\n * `true` after the first successful `play()`.\n */\n unlocked: boolean;\n}\n\n/**\n * The player lives in a state initializer, not in a lazily-written ref: the\n * initializer runs exactly once and is not a side effect during render, which is\n * what the ref version was. The player identity never changes, so state holds it\n * fine and the value is non-null from the first render.\n *\n * Hook-managed audio player. Each component instance gets its own\n * {@link AudioPlayer}, so unmounting cleanly stops playback. Useful for\n * notification chimes, UI feedback sounds, and per-component soundtracks.\n */\nexport function useAudio(): UseAudioResult {\n const [player] = useState<AudioPlayer>(() => createAudioPlayer());\n const [unlocked, setUnlocked] = useState<boolean>(false);\n\n useEffect(() => {\n return () => {\n player.stop();\n };\n }, [player]);\n\n const play = useCallback(\n async (src: string, options?: PlayAudioOptions): Promise<void> => {\n const result = await player.play(src, options);\n if (result) setUnlocked(true);\n },\n [player],\n );\n\n const stop = useCallback((): void => {\n player.stop();\n }, [player]);\n\n return { play, stop, unlocked };\n}\n"],"mappings":";;;AAyBA,SAAgB,IAA2B;CACvC,IAAM,CAAC,KAAU,QAA4B,EAAkB,CAAC,GAC1D,CAAC,GAAU,KAAe,EAAkB,EAAK;CAoBvD,OAlBA,cACiB;EACT,EAAO,KAAK;CAChB,GACD,CAAC,CAAM,CAAC,GAcJ;EAAE,MAZI,EACT,OAAO,GAAa,MAA8C;GAE9D,AAAI,MADiB,EAAO,KAAK,GAAK,CAAO,KACjC,EAAY,EAAI;EAChC,GACA,CAAC,CAAM,CAOF;EAAM,MAJF,QAAwB;GACjC,EAAO,KAAK;EAChB,GAAG,CAAC,CAAM,CAEK;EAAM;CAAS;AAClC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../utils/cn.cjs"),t=require("./
|
|
1
|
+
const e=require("../utils/cn.cjs"),t=require("./use-chart-colors.cjs"),n=require("./types.cjs");let r=require("react/jsx-runtime"),i=require("recharts");function a({data:a,index:o,categories:s,colors:c,height:l=300,width:u,stack:d=!1,showLegend:f=!0,showGrid:p=!0,showTooltip:m=!0,valueFormatter:h,className:g}){let _=t.useChartColors(c),v=d?`stack`:void 0,y=(0,r.jsxs)(i.AreaChart,{data:a,width:u,height:l,children:[p?(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`}):null,(0,r.jsx)(i.XAxis,{dataKey:o}),(0,r.jsx)(i.YAxis,{tickFormatter:h}),m?(0,r.jsx)(i.Tooltip,{formatter:n.toTooltipFormatter(h)}):null,f?(0,r.jsx)(i.Legend,{}):null,s.map((e,t)=>{let n=_[t%_.length];return(0,r.jsx)(i.Area,{type:`monotone`,dataKey:e,stackId:v,stroke:n,fill:n,fillOpacity:.3},e)})]});return(0,r.jsx)(`div`,{className:e.cn(g),children:u===void 0?(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:l,children:y}):y})}exports.AreaChart=a;
|
|
2
2
|
//# sourceMappingURL=AreaChart.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.cjs","names":[],"sources":["../../src/charts/AreaChart.tsx"],"sourcesContent":["import {\n Area,\n AreaChart as RAreaChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport {
|
|
1
|
+
{"version":3,"file":"AreaChart.cjs","names":[],"sources":["../../src/charts/AreaChart.tsx"],"sourcesContent":["import {\n Area,\n AreaChart as RAreaChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport { useChartColors } from \"./use-chart-colors\";\nimport { toTooltipFormatter } from \"./types\";\nimport type { CartesianChartProps } from \"./types\";\n\n/**\n * AreaChart — themed wrapper over recharts `AreaChart`.\n *\n * Plots one filled area per entry in `categories`, colored from `colors`\n * (cycling the `--tempest-chart-*` theme tokens by default). When `stack` is set, all\n * areas share a stackId. When `width` is provided the chart renders at that\n * fixed size without a ResponsiveContainer; otherwise it fills its parent.\n */\nexport function AreaChart({\n data,\n index,\n categories,\n colors,\n height = 300,\n width,\n stack = false,\n showLegend = true,\n showGrid = true,\n showTooltip = true,\n valueFormatter,\n className,\n}: CartesianChartProps) {\n const palette = useChartColors(colors);\n const stackId = stack ? \"stack\" : undefined;\n\n const chart = (\n <RAreaChart data={data} width={width} height={height}>\n {showGrid ? <CartesianGrid strokeDasharray=\"3 3\" /> : null}\n <XAxis dataKey={index} />\n <YAxis tickFormatter={valueFormatter} />\n {showTooltip ? <Tooltip formatter={toTooltipFormatter(valueFormatter)} /> : null}\n {showLegend ? <Legend /> : null}\n {categories.map((category, i) => {\n const color = palette[i % palette.length];\n return (\n <Area\n key={category}\n type=\"monotone\"\n dataKey={category}\n stackId={stackId}\n stroke={color}\n fill={color}\n fillOpacity={0.3}\n />\n );\n })}\n </RAreaChart>\n );\n\n return (\n <div className={cn(className)}>\n {width !== undefined ? (\n chart\n ) : (\n <ResponsiveContainer width=\"100%\" height={height}>\n {chart}\n </ResponsiveContainer>\n )}\n </div>\n );\n}\n"],"mappings":"yJAuBA,SAAgB,EAAU,CACtB,OACA,QACA,aACA,SACA,SAAS,IACT,QACA,QAAQ,GACR,aAAa,GACb,WAAW,GACX,cAAc,GACd,iBACA,aACoB,CACpB,IAAM,EAAU,EAAA,eAAe,CAAM,EAC/B,EAAU,EAAQ,QAAU,IAAA,GAE5B,GACF,EAAA,EAAA,KAAA,CAAC,EAAA,UAAD,CAAkB,OAAa,QAAe,kBAA9C,CACK,GAAW,EAAA,EAAA,IAAA,CAAC,EAAA,cAAD,CAAe,gBAAgB,KAAO,CAAA,EAAI,MACtD,EAAA,EAAA,IAAA,CAAC,EAAA,MAAD,CAAO,QAAS,CAAQ,CAAA,GACxB,EAAA,EAAA,IAAA,CAAC,EAAA,MAAD,CAAO,cAAe,CAAiB,CAAA,EACtC,GAAc,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAS,UAAW,EAAA,mBAAmB,CAAc,CAAI,CAAA,EAAI,KAC3E,GAAa,EAAA,EAAA,IAAA,CAAC,EAAA,OAAD,CAAS,CAAA,EAAI,KAC1B,EAAW,KAAK,EAAU,IAAM,CAC7B,IAAM,EAAQ,EAAQ,EAAI,EAAQ,QAClC,OACI,EAAA,EAAA,IAAA,CAAC,EAAA,KAAD,CAEI,KAAK,WACL,QAAS,EACA,UACT,OAAQ,EACR,KAAM,EACN,YAAa,EAChB,EAPQ,CAOR,CAET,CAAC,CACO,IAGhB,OACI,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,GAAG,CAAS,WACvB,IAAU,IAAA,IAGP,EAAA,EAAA,IAAA,CAAC,EAAA,oBAAD,CAAqB,MAAM,OAAe,kBACrC,CACgB,CAAA,EAJrB,CAMH,CAAA,CAEb"}
|
package/dist/charts/AreaChart.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useChartColors as t } from "./use-chart-colors.js";
|
|
3
3
|
import { toTooltipFormatter as n } from "./types.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { Area as a, AreaChart as o, CartesianGrid as s, Legend as c, ResponsiveContainer as l, Tooltip as u, XAxis as d, YAxis as f } from "recharts";
|
|
6
6
|
//#region src/charts/AreaChart.tsx
|
|
7
|
-
function p({ data: p, index: m, categories: h, colors: g
|
|
8
|
-
let T = y ? "stack" : void 0,
|
|
7
|
+
function p({ data: p, index: m, categories: h, colors: g, height: _ = 300, width: v, stack: y = !1, showLegend: b = !0, showGrid: x = !0, showTooltip: S = !0, valueFormatter: C, className: w }) {
|
|
8
|
+
let T = t(g), E = y ? "stack" : void 0, D = /* @__PURE__ */ i(o, {
|
|
9
9
|
data: p,
|
|
10
10
|
width: v,
|
|
11
11
|
height: _,
|
|
@@ -16,11 +16,11 @@ function p({ data: p, index: m, categories: h, colors: g = t, height: _ = 300, w
|
|
|
16
16
|
S ? /* @__PURE__ */ r(u, { formatter: n(C) }) : null,
|
|
17
17
|
b ? /* @__PURE__ */ r(c, {}) : null,
|
|
18
18
|
h.map((e, t) => {
|
|
19
|
-
let n =
|
|
19
|
+
let n = T[t % T.length];
|
|
20
20
|
return /* @__PURE__ */ r(a, {
|
|
21
21
|
type: "monotone",
|
|
22
22
|
dataKey: e,
|
|
23
|
-
stackId:
|
|
23
|
+
stackId: E,
|
|
24
24
|
stroke: n,
|
|
25
25
|
fill: n,
|
|
26
26
|
fillOpacity: .3
|
|
@@ -33,8 +33,8 @@ function p({ data: p, index: m, categories: h, colors: g = t, height: _ = 300, w
|
|
|
33
33
|
children: v === void 0 ? /* @__PURE__ */ r(l, {
|
|
34
34
|
width: "100%",
|
|
35
35
|
height: _,
|
|
36
|
-
children:
|
|
37
|
-
}) :
|
|
36
|
+
children: D
|
|
37
|
+
}) : D
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.js","names":[],"sources":["../../src/charts/AreaChart.tsx"],"sourcesContent":["import {\n Area,\n AreaChart as RAreaChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport {
|
|
1
|
+
{"version":3,"file":"AreaChart.js","names":[],"sources":["../../src/charts/AreaChart.tsx"],"sourcesContent":["import {\n Area,\n AreaChart as RAreaChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport { useChartColors } from \"./use-chart-colors\";\nimport { toTooltipFormatter } from \"./types\";\nimport type { CartesianChartProps } from \"./types\";\n\n/**\n * AreaChart — themed wrapper over recharts `AreaChart`.\n *\n * Plots one filled area per entry in `categories`, colored from `colors`\n * (cycling the `--tempest-chart-*` theme tokens by default). When `stack` is set, all\n * areas share a stackId. When `width` is provided the chart renders at that\n * fixed size without a ResponsiveContainer; otherwise it fills its parent.\n */\nexport function AreaChart({\n data,\n index,\n categories,\n colors,\n height = 300,\n width,\n stack = false,\n showLegend = true,\n showGrid = true,\n showTooltip = true,\n valueFormatter,\n className,\n}: CartesianChartProps) {\n const palette = useChartColors(colors);\n const stackId = stack ? \"stack\" : undefined;\n\n const chart = (\n <RAreaChart data={data} width={width} height={height}>\n {showGrid ? <CartesianGrid strokeDasharray=\"3 3\" /> : null}\n <XAxis dataKey={index} />\n <YAxis tickFormatter={valueFormatter} />\n {showTooltip ? <Tooltip formatter={toTooltipFormatter(valueFormatter)} /> : null}\n {showLegend ? <Legend /> : null}\n {categories.map((category, i) => {\n const color = palette[i % palette.length];\n return (\n <Area\n key={category}\n type=\"monotone\"\n dataKey={category}\n stackId={stackId}\n stroke={color}\n fill={color}\n fillOpacity={0.3}\n />\n );\n })}\n </RAreaChart>\n );\n\n return (\n <div className={cn(className)}>\n {width !== undefined ? (\n chart\n ) : (\n <ResponsiveContainer width=\"100%\" height={height}>\n {chart}\n </ResponsiveContainer>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAuBA,SAAgB,EAAU,EACtB,SACA,UACA,eACA,WACA,YAAS,KACT,UACA,WAAQ,IACR,gBAAa,IACb,cAAW,IACX,iBAAc,IACd,mBACA,gBACoB;CACpB,IAAM,IAAU,EAAe,CAAM,GAC/B,IAAU,IAAQ,UAAU,KAAA,GAE5B,IACF,kBAAC,GAAD;EAAkB;EAAa;EAAe;YAA9C;GACK,IAAW,kBAAC,GAAD,EAAe,iBAAgB,MAAO,CAAA,IAAI;GACtD,kBAAC,GAAD,EAAO,SAAS,EAAQ,CAAA;GACxB,kBAAC,GAAD,EAAO,eAAe,EAAiB,CAAA;GACtC,IAAc,kBAAC,GAAD,EAAS,WAAW,EAAmB,CAAc,EAAI,CAAA,IAAI;GAC3E,IAAa,kBAAC,GAAD,CAAS,CAAA,IAAI;GAC1B,EAAW,KAAK,GAAU,MAAM;IAC7B,IAAM,IAAQ,EAAQ,IAAI,EAAQ;IAClC,OACI,kBAAC,GAAD;KAEI,MAAK;KACL,SAAS;KACA;KACT,QAAQ;KACR,MAAM;KACN,aAAa;IAChB,GAPQ,CAOR;GAET,CAAC;EACO;;CAGhB,OACI,kBAAC,OAAD;EAAK,WAAW,EAAG,CAAS;YACvB,MAAU,KAAA,IAGP,kBAAC,GAAD;GAAqB,OAAM;GAAe;aACrC;EACgB,CAAA,IAJrB;CAMH,CAAA;AAEb"}
|
package/dist/charts/BarChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../utils/cn.cjs"),t=require("./
|
|
1
|
+
const e=require("../utils/cn.cjs"),t=require("./use-chart-colors.cjs"),n=require("./types.cjs");let r=require("react/jsx-runtime"),i=require("recharts");function a({data:a,index:o,categories:s,colors:c,height:l=300,width:u,stack:d=!1,showLegend:f=!0,showGrid:p=!0,showTooltip:m=!0,valueFormatter:h,className:g}){let _=t.useChartColors(c),v=d?`stack`:void 0,y=(0,r.jsxs)(i.BarChart,{data:a,width:u,height:l,children:[p?(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`}):null,(0,r.jsx)(i.XAxis,{dataKey:o}),(0,r.jsx)(i.YAxis,{tickFormatter:h}),m?(0,r.jsx)(i.Tooltip,{formatter:n.toTooltipFormatter(h)}):null,f?(0,r.jsx)(i.Legend,{}):null,s.map((e,t)=>(0,r.jsx)(i.Bar,{dataKey:e,stackId:v,fill:_[t%_.length]},e))]});return(0,r.jsx)(`div`,{className:e.cn(g),children:u===void 0?(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:l,children:y}):y})}exports.BarChart=a;
|
|
2
2
|
//# sourceMappingURL=BarChart.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.cjs","names":[],"sources":["../../src/charts/BarChart.tsx"],"sourcesContent":["import {\n Bar,\n BarChart as RBarChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport {
|
|
1
|
+
{"version":3,"file":"BarChart.cjs","names":[],"sources":["../../src/charts/BarChart.tsx"],"sourcesContent":["import {\n Bar,\n BarChart as RBarChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport { useChartColors } from \"./use-chart-colors\";\nimport { toTooltipFormatter } from \"./types\";\nimport type { CartesianChartProps } from \"./types\";\n\n/**\n * BarChart — themed wrapper over recharts `BarChart`.\n *\n * Plots one bar series per entry in `categories`, colored from `colors`\n * (cycling the `--tempest-chart-*` theme tokens by default). When `stack` is set, all\n * bars share a stackId. When `width` is provided the chart renders at that\n * fixed size without a ResponsiveContainer; otherwise it fills its parent.\n */\nexport function BarChart({\n data,\n index,\n categories,\n colors,\n height = 300,\n width,\n stack = false,\n showLegend = true,\n showGrid = true,\n showTooltip = true,\n valueFormatter,\n className,\n}: CartesianChartProps) {\n const palette = useChartColors(colors);\n const stackId = stack ? \"stack\" : undefined;\n\n const chart = (\n <RBarChart data={data} width={width} height={height}>\n {showGrid ? <CartesianGrid strokeDasharray=\"3 3\" /> : null}\n <XAxis dataKey={index} />\n <YAxis tickFormatter={valueFormatter} />\n {showTooltip ? <Tooltip formatter={toTooltipFormatter(valueFormatter)} /> : null}\n {showLegend ? <Legend /> : null}\n {categories.map((category, i) => (\n <Bar\n key={category}\n dataKey={category}\n stackId={stackId}\n fill={palette[i % palette.length]}\n />\n ))}\n </RBarChart>\n );\n\n return (\n <div className={cn(className)}>\n {width !== undefined ? (\n chart\n ) : (\n <ResponsiveContainer width=\"100%\" height={height}>\n {chart}\n </ResponsiveContainer>\n )}\n </div>\n );\n}\n"],"mappings":"yJAuBA,SAAgB,EAAS,CACrB,OACA,QACA,aACA,SACA,SAAS,IACT,QACA,QAAQ,GACR,aAAa,GACb,WAAW,GACX,cAAc,GACd,iBACA,aACoB,CACpB,IAAM,EAAU,EAAA,eAAe,CAAM,EAC/B,EAAU,EAAQ,QAAU,IAAA,GAE5B,GACF,EAAA,EAAA,KAAA,CAAC,EAAA,SAAD,CAAiB,OAAa,QAAe,kBAA7C,CACK,GAAW,EAAA,EAAA,IAAA,CAAC,EAAA,cAAD,CAAe,gBAAgB,KAAO,CAAA,EAAI,MACtD,EAAA,EAAA,IAAA,CAAC,EAAA,MAAD,CAAO,QAAS,CAAQ,CAAA,GACxB,EAAA,EAAA,IAAA,CAAC,EAAA,MAAD,CAAO,cAAe,CAAiB,CAAA,EACtC,GAAc,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAS,UAAW,EAAA,mBAAmB,CAAc,CAAI,CAAA,EAAI,KAC3E,GAAa,EAAA,EAAA,IAAA,CAAC,EAAA,OAAD,CAAS,CAAA,EAAI,KAC1B,EAAW,KAAK,EAAU,KACvB,EAAA,EAAA,IAAA,CAAC,EAAA,IAAD,CAEI,QAAS,EACA,UACT,KAAM,EAAQ,EAAI,EAAQ,OAC7B,EAJQ,CAIR,CACJ,CACM,IAGf,OACI,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,GAAG,CAAS,WACvB,IAAU,IAAA,IAGP,EAAA,EAAA,IAAA,CAAC,EAAA,oBAAD,CAAqB,MAAM,OAAe,kBACrC,CACgB,CAAA,EAJrB,CAMH,CAAA,CAEb"}
|
package/dist/charts/BarChart.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useChartColors as t } from "./use-chart-colors.js";
|
|
3
3
|
import { toTooltipFormatter as n } from "./types.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { Bar as a, BarChart as o, CartesianGrid as s, Legend as c, ResponsiveContainer as l, Tooltip as u, XAxis as d, YAxis as f } from "recharts";
|
|
6
6
|
//#region src/charts/BarChart.tsx
|
|
7
|
-
function p({ data: p, index: m, categories: h, colors: g
|
|
8
|
-
let T = y ? "stack" : void 0,
|
|
7
|
+
function p({ data: p, index: m, categories: h, colors: g, height: _ = 300, width: v, stack: y = !1, showLegend: b = !0, showGrid: x = !0, showTooltip: S = !0, valueFormatter: C, className: w }) {
|
|
8
|
+
let T = t(g), E = y ? "stack" : void 0, D = /* @__PURE__ */ i(o, {
|
|
9
9
|
data: p,
|
|
10
10
|
width: v,
|
|
11
11
|
height: _,
|
|
@@ -17,8 +17,8 @@ function p({ data: p, index: m, categories: h, colors: g = t, height: _ = 300, w
|
|
|
17
17
|
b ? /* @__PURE__ */ r(c, {}) : null,
|
|
18
18
|
h.map((e, t) => /* @__PURE__ */ r(a, {
|
|
19
19
|
dataKey: e,
|
|
20
|
-
stackId:
|
|
21
|
-
fill:
|
|
20
|
+
stackId: E,
|
|
21
|
+
fill: T[t % T.length]
|
|
22
22
|
}, e))
|
|
23
23
|
]
|
|
24
24
|
});
|
|
@@ -27,8 +27,8 @@ function p({ data: p, index: m, categories: h, colors: g = t, height: _ = 300, w
|
|
|
27
27
|
children: v === void 0 ? /* @__PURE__ */ r(l, {
|
|
28
28
|
width: "100%",
|
|
29
29
|
height: _,
|
|
30
|
-
children:
|
|
31
|
-
}) :
|
|
30
|
+
children: D
|
|
31
|
+
}) : D
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.js","names":[],"sources":["../../src/charts/BarChart.tsx"],"sourcesContent":["import {\n Bar,\n BarChart as RBarChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport {
|
|
1
|
+
{"version":3,"file":"BarChart.js","names":[],"sources":["../../src/charts/BarChart.tsx"],"sourcesContent":["import {\n Bar,\n BarChart as RBarChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport { useChartColors } from \"./use-chart-colors\";\nimport { toTooltipFormatter } from \"./types\";\nimport type { CartesianChartProps } from \"./types\";\n\n/**\n * BarChart — themed wrapper over recharts `BarChart`.\n *\n * Plots one bar series per entry in `categories`, colored from `colors`\n * (cycling the `--tempest-chart-*` theme tokens by default). When `stack` is set, all\n * bars share a stackId. When `width` is provided the chart renders at that\n * fixed size without a ResponsiveContainer; otherwise it fills its parent.\n */\nexport function BarChart({\n data,\n index,\n categories,\n colors,\n height = 300,\n width,\n stack = false,\n showLegend = true,\n showGrid = true,\n showTooltip = true,\n valueFormatter,\n className,\n}: CartesianChartProps) {\n const palette = useChartColors(colors);\n const stackId = stack ? \"stack\" : undefined;\n\n const chart = (\n <RBarChart data={data} width={width} height={height}>\n {showGrid ? <CartesianGrid strokeDasharray=\"3 3\" /> : null}\n <XAxis dataKey={index} />\n <YAxis tickFormatter={valueFormatter} />\n {showTooltip ? <Tooltip formatter={toTooltipFormatter(valueFormatter)} /> : null}\n {showLegend ? <Legend /> : null}\n {categories.map((category, i) => (\n <Bar\n key={category}\n dataKey={category}\n stackId={stackId}\n fill={palette[i % palette.length]}\n />\n ))}\n </RBarChart>\n );\n\n return (\n <div className={cn(className)}>\n {width !== undefined ? (\n chart\n ) : (\n <ResponsiveContainer width=\"100%\" height={height}>\n {chart}\n </ResponsiveContainer>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAuBA,SAAgB,EAAS,EACrB,SACA,UACA,eACA,WACA,YAAS,KACT,UACA,WAAQ,IACR,gBAAa,IACb,cAAW,IACX,iBAAc,IACd,mBACA,gBACoB;CACpB,IAAM,IAAU,EAAe,CAAM,GAC/B,IAAU,IAAQ,UAAU,KAAA,GAE5B,IACF,kBAAC,GAAD;EAAiB;EAAa;EAAe;YAA7C;GACK,IAAW,kBAAC,GAAD,EAAe,iBAAgB,MAAO,CAAA,IAAI;GACtD,kBAAC,GAAD,EAAO,SAAS,EAAQ,CAAA;GACxB,kBAAC,GAAD,EAAO,eAAe,EAAiB,CAAA;GACtC,IAAc,kBAAC,GAAD,EAAS,WAAW,EAAmB,CAAc,EAAI,CAAA,IAAI;GAC3E,IAAa,kBAAC,GAAD,CAAS,CAAA,IAAI;GAC1B,EAAW,KAAK,GAAU,MACvB,kBAAC,GAAD;IAEI,SAAS;IACA;IACT,MAAM,EAAQ,IAAI,EAAQ;GAC7B,GAJQ,CAIR,CACJ;EACM;;CAGf,OACI,kBAAC,OAAD;EAAK,WAAW,EAAG,CAAS;YACvB,MAAU,KAAA,IAGP,kBAAC,GAAD;GAAqB,OAAM;GAAe;aACrC;EACgB,CAAA,IAJrB;CAMH,CAAA;AAEb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../utils/cn.cjs"),t=require("./
|
|
1
|
+
const e=require("../utils/cn.cjs"),t=require("./use-chart-colors.cjs"),n=require("./types.cjs");let r=require("react/jsx-runtime"),i=require("recharts");function a({data:a,index:o,categories:s,colors:c,height:l=300,width:u,showLegend:d=!0,showGrid:f=!0,showTooltip:p=!0,valueFormatter:m,className:h}){let g=t.useChartColors(c),_=(0,r.jsxs)(i.LineChart,{data:a,width:u,height:l,children:[f?(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`}):null,(0,r.jsx)(i.XAxis,{dataKey:o}),(0,r.jsx)(i.YAxis,{tickFormatter:m}),p?(0,r.jsx)(i.Tooltip,{formatter:n.toTooltipFormatter(m)}):null,d?(0,r.jsx)(i.Legend,{}):null,s.map((e,t)=>(0,r.jsx)(i.Line,{type:`monotone`,dataKey:e,stroke:g[t%g.length],dot:!1},e))]});return(0,r.jsx)(`div`,{className:e.cn(h),children:u===void 0?(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:l,children:_}):_})}exports.LineChart=a;
|
|
2
2
|
//# sourceMappingURL=LineChart.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.cjs","names":[],"sources":["../../src/charts/LineChart.tsx"],"sourcesContent":["import {\n CartesianGrid,\n Legend,\n Line,\n LineChart as RLineChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport {
|
|
1
|
+
{"version":3,"file":"LineChart.cjs","names":[],"sources":["../../src/charts/LineChart.tsx"],"sourcesContent":["import {\n CartesianGrid,\n Legend,\n Line,\n LineChart as RLineChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport { useChartColors } from \"./use-chart-colors\";\nimport { toTooltipFormatter } from \"./types\";\nimport type { CartesianChartProps } from \"./types\";\n\n/**\n * LineChart — themed wrapper over recharts `LineChart`.\n *\n * Plots one line per entry in `categories`, colored from `colors` (cycling\n * the `--tempest-chart-*` theme tokens by default). `stack` is accepted for API parity\n * but does not visually stack lines. When `width` is provided the chart renders\n * at that fixed size without a ResponsiveContainer; otherwise it fills its\n * parent.\n */\nexport function LineChart({\n data,\n index,\n categories,\n colors,\n height = 300,\n width,\n showLegend = true,\n showGrid = true,\n showTooltip = true,\n valueFormatter,\n className,\n}: CartesianChartProps) {\n const palette = useChartColors(colors);\n const chart = (\n <RLineChart data={data} width={width} height={height}>\n {showGrid ? <CartesianGrid strokeDasharray=\"3 3\" /> : null}\n <XAxis dataKey={index} />\n <YAxis tickFormatter={valueFormatter} />\n {showTooltip ? <Tooltip formatter={toTooltipFormatter(valueFormatter)} /> : null}\n {showLegend ? <Legend /> : null}\n {categories.map((category, i) => (\n <Line\n key={category}\n type=\"monotone\"\n dataKey={category}\n stroke={palette[i % palette.length]}\n dot={false}\n />\n ))}\n </RLineChart>\n );\n\n return (\n <div className={cn(className)}>\n {width !== undefined ? (\n chart\n ) : (\n <ResponsiveContainer width=\"100%\" height={height}>\n {chart}\n </ResponsiveContainer>\n )}\n </div>\n );\n}\n"],"mappings":"yJAwBA,SAAgB,EAAU,CACtB,OACA,QACA,aACA,SACA,SAAS,IACT,QACA,aAAa,GACb,WAAW,GACX,cAAc,GACd,iBACA,aACoB,CACpB,IAAM,EAAU,EAAA,eAAe,CAAM,EAC/B,GACF,EAAA,EAAA,KAAA,CAAC,EAAA,UAAD,CAAkB,OAAa,QAAe,kBAA9C,CACK,GAAW,EAAA,EAAA,IAAA,CAAC,EAAA,cAAD,CAAe,gBAAgB,KAAO,CAAA,EAAI,MACtD,EAAA,EAAA,IAAA,CAAC,EAAA,MAAD,CAAO,QAAS,CAAQ,CAAA,GACxB,EAAA,EAAA,IAAA,CAAC,EAAA,MAAD,CAAO,cAAe,CAAiB,CAAA,EACtC,GAAc,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAS,UAAW,EAAA,mBAAmB,CAAc,CAAI,CAAA,EAAI,KAC3E,GAAa,EAAA,EAAA,IAAA,CAAC,EAAA,OAAD,CAAS,CAAA,EAAI,KAC1B,EAAW,KAAK,EAAU,KACvB,EAAA,EAAA,IAAA,CAAC,EAAA,KAAD,CAEI,KAAK,WACL,QAAS,EACT,OAAQ,EAAQ,EAAI,EAAQ,QAC5B,IAAK,EACR,EALQ,CAKR,CACJ,CACO,IAGhB,OACI,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,GAAG,CAAS,WACvB,IAAU,IAAA,IAGP,EAAA,EAAA,IAAA,CAAC,EAAA,oBAAD,CAAqB,MAAM,OAAe,kBACrC,CACgB,CAAA,EAJrB,CAMH,CAAA,CAEb"}
|
package/dist/charts/LineChart.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useChartColors as t } from "./use-chart-colors.js";
|
|
3
3
|
import { toTooltipFormatter as n } from "./types.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { CartesianGrid as a, Legend as o, Line as s, LineChart as c, ResponsiveContainer as l, Tooltip as u, XAxis as d, YAxis as f } from "recharts";
|
|
6
6
|
//#region src/charts/LineChart.tsx
|
|
7
|
-
function p({ data: p, index: m, categories: h, colors: g
|
|
8
|
-
let w = /* @__PURE__ */ i(c, {
|
|
7
|
+
function p({ data: p, index: m, categories: h, colors: g, height: _ = 300, width: v, showLegend: y = !0, showGrid: b = !0, showTooltip: x = !0, valueFormatter: S, className: C }) {
|
|
8
|
+
let w = t(g), T = /* @__PURE__ */ i(c, {
|
|
9
9
|
data: p,
|
|
10
10
|
width: v,
|
|
11
11
|
height: _,
|
|
@@ -18,7 +18,7 @@ function p({ data: p, index: m, categories: h, colors: g = t, height: _ = 300, w
|
|
|
18
18
|
h.map((e, t) => /* @__PURE__ */ r(s, {
|
|
19
19
|
type: "monotone",
|
|
20
20
|
dataKey: e,
|
|
21
|
-
stroke:
|
|
21
|
+
stroke: w[t % w.length],
|
|
22
22
|
dot: !1
|
|
23
23
|
}, e))
|
|
24
24
|
]
|
|
@@ -28,8 +28,8 @@ function p({ data: p, index: m, categories: h, colors: g = t, height: _ = 300, w
|
|
|
28
28
|
children: v === void 0 ? /* @__PURE__ */ r(l, {
|
|
29
29
|
width: "100%",
|
|
30
30
|
height: _,
|
|
31
|
-
children:
|
|
32
|
-
}) :
|
|
31
|
+
children: T
|
|
32
|
+
}) : T
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.js","names":[],"sources":["../../src/charts/LineChart.tsx"],"sourcesContent":["import {\n CartesianGrid,\n Legend,\n Line,\n LineChart as RLineChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport {
|
|
1
|
+
{"version":3,"file":"LineChart.js","names":[],"sources":["../../src/charts/LineChart.tsx"],"sourcesContent":["import {\n CartesianGrid,\n Legend,\n Line,\n LineChart as RLineChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport { useChartColors } from \"./use-chart-colors\";\nimport { toTooltipFormatter } from \"./types\";\nimport type { CartesianChartProps } from \"./types\";\n\n/**\n * LineChart — themed wrapper over recharts `LineChart`.\n *\n * Plots one line per entry in `categories`, colored from `colors` (cycling\n * the `--tempest-chart-*` theme tokens by default). `stack` is accepted for API parity\n * but does not visually stack lines. When `width` is provided the chart renders\n * at that fixed size without a ResponsiveContainer; otherwise it fills its\n * parent.\n */\nexport function LineChart({\n data,\n index,\n categories,\n colors,\n height = 300,\n width,\n showLegend = true,\n showGrid = true,\n showTooltip = true,\n valueFormatter,\n className,\n}: CartesianChartProps) {\n const palette = useChartColors(colors);\n const chart = (\n <RLineChart data={data} width={width} height={height}>\n {showGrid ? <CartesianGrid strokeDasharray=\"3 3\" /> : null}\n <XAxis dataKey={index} />\n <YAxis tickFormatter={valueFormatter} />\n {showTooltip ? <Tooltip formatter={toTooltipFormatter(valueFormatter)} /> : null}\n {showLegend ? <Legend /> : null}\n {categories.map((category, i) => (\n <Line\n key={category}\n type=\"monotone\"\n dataKey={category}\n stroke={palette[i % palette.length]}\n dot={false}\n />\n ))}\n </RLineChart>\n );\n\n return (\n <div className={cn(className)}>\n {width !== undefined ? (\n chart\n ) : (\n <ResponsiveContainer width=\"100%\" height={height}>\n {chart}\n </ResponsiveContainer>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAwBA,SAAgB,EAAU,EACtB,SACA,UACA,eACA,WACA,YAAS,KACT,UACA,gBAAa,IACb,cAAW,IACX,iBAAc,IACd,mBACA,gBACoB;CACpB,IAAM,IAAU,EAAe,CAAM,GAC/B,IACF,kBAAC,GAAD;EAAkB;EAAa;EAAe;YAA9C;GACK,IAAW,kBAAC,GAAD,EAAe,iBAAgB,MAAO,CAAA,IAAI;GACtD,kBAAC,GAAD,EAAO,SAAS,EAAQ,CAAA;GACxB,kBAAC,GAAD,EAAO,eAAe,EAAiB,CAAA;GACtC,IAAc,kBAAC,GAAD,EAAS,WAAW,EAAmB,CAAc,EAAI,CAAA,IAAI;GAC3E,IAAa,kBAAC,GAAD,CAAS,CAAA,IAAI;GAC1B,EAAW,KAAK,GAAU,MACvB,kBAAC,GAAD;IAEI,MAAK;IACL,SAAS;IACT,QAAQ,EAAQ,IAAI,EAAQ;IAC5B,KAAK;GACR,GALQ,CAKR,CACJ;EACO;;CAGhB,OACI,kBAAC,OAAD;EAAK,WAAW,EAAG,CAAS;YACvB,MAAU,KAAA,IAGP,kBAAC,GAAD;GAAqB,OAAM;GAAe;aACrC;EACgB,CAAA,IAJrB;CAMH,CAAA;AAEb"}
|
package/dist/charts/PieChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../utils/cn.cjs"),t=require("./
|
|
1
|
+
const e=require("../utils/cn.cjs"),t=require("./use-chart-colors.cjs"),n=require("./types.cjs");let r=require("react/jsx-runtime"),i=require("recharts");function a({data:a,category:o,index:s,colors:c,height:l=300,width:u,donut:d=!1,showLegend:f=!0,showTooltip:p=!0,valueFormatter:m,className:h}){let g=t.useChartColors(c),_=(0,r.jsxs)(i.PieChart,{width:u,height:l,children:[p?(0,r.jsx)(i.Tooltip,{formatter:n.toTooltipFormatter(m)}):null,f?(0,r.jsx)(i.Legend,{}):null,(0,r.jsx)(i.Pie,{data:a,dataKey:o,nameKey:s,innerRadius:d?`60%`:0,outerRadius:`80%`,children:a.map((e,t)=>(0,r.jsx)(i.Cell,{fill:g[t%g.length]},`${String(e[s])}-${t}`))})]});return(0,r.jsx)(`div`,{className:e.cn(h),children:u===void 0?(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:l,children:_}):_})}exports.PieChart=a;
|
|
2
2
|
//# sourceMappingURL=PieChart.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChart.cjs","names":[],"sources":["../../src/charts/PieChart.tsx"],"sourcesContent":["import { Cell, Legend, Pie, PieChart as RPieChart, ResponsiveContainer, Tooltip } from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport {
|
|
1
|
+
{"version":3,"file":"PieChart.cjs","names":[],"sources":["../../src/charts/PieChart.tsx"],"sourcesContent":["import { Cell, Legend, Pie, PieChart as RPieChart, ResponsiveContainer, Tooltip } from \"recharts\";\nimport { cn } from \"@/utils/cn\";\nimport { useChartColors } from \"./use-chart-colors\";\nimport { toTooltipFormatter } from \"./types\";\nimport type { PieChartProps } from \"./types\";\n\n/**\n * PieChart — themed wrapper over recharts `PieChart`.\n *\n * Renders one slice per row, reading the numeric value from `category` and the\n * label from `index`. Each slice is colored from `colors` (cycling\n * the `--tempest-chart-*` theme tokens by default). When `donut` is set the pie gets a\n * non-zero inner radius. When `width` is provided the chart renders at that\n * fixed size without a ResponsiveContainer; otherwise it fills its parent.\n */\nexport function PieChart({\n data,\n category,\n index,\n colors,\n height = 300,\n width,\n donut = false,\n showLegend = true,\n showTooltip = true,\n valueFormatter,\n className,\n}: PieChartProps) {\n const palette = useChartColors(colors);\n const chart = (\n <RPieChart width={width} height={height}>\n {showTooltip ? <Tooltip formatter={toTooltipFormatter(valueFormatter)} /> : null}\n {showLegend ? <Legend /> : null}\n <Pie\n data={data}\n dataKey={category}\n nameKey={index}\n innerRadius={donut ? \"60%\" : 0}\n outerRadius=\"80%\"\n >\n {data.map((row, i) => (\n <Cell key={`${String(row[index])}-${i}`} fill={palette[i % palette.length]} />\n ))}\n </Pie>\n </RPieChart>\n );\n\n return (\n <div className={cn(className)}>\n {width !== undefined ? (\n chart\n ) : (\n <ResponsiveContainer width=\"100%\" height={height}>\n {chart}\n </ResponsiveContainer>\n )}\n </div>\n );\n}\n"],"mappings":"yJAeA,SAAgB,EAAS,CACrB,OACA,WACA,QACA,SACA,SAAS,IACT,QACA,QAAQ,GACR,aAAa,GACb,cAAc,GACd,iBACA,aACc,CACd,IAAM,EAAU,EAAA,eAAe,CAAM,EAC/B,GACF,EAAA,EAAA,KAAA,CAAC,EAAA,SAAD,CAAkB,QAAe,kBAAjC,CACK,GAAc,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAS,UAAW,EAAA,mBAAmB,CAAc,CAAI,CAAA,EAAI,KAC3E,GAAa,EAAA,EAAA,IAAA,CAAC,EAAA,OAAD,CAAS,CAAA,EAAI,MAC3B,EAAA,EAAA,IAAA,CAAC,EAAA,IAAD,CACU,OACN,QAAS,EACT,QAAS,EACT,YAAa,EAAQ,MAAQ,EAC7B,YAAY,eAEX,EAAK,KAAK,EAAK,KACZ,EAAA,EAAA,IAAA,CAAC,EAAA,KAAD,CAAyC,KAAM,EAAQ,EAAI,EAAQ,OAAU,EAAlE,GAAG,OAAO,EAAI,EAAM,EAAE,GAAG,GAAyC,CAChF,CACA,CAAA,CACE,IAGf,OACI,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,GAAG,CAAS,WACvB,IAAU,IAAA,IAGP,EAAA,EAAA,IAAA,CAAC,EAAA,oBAAD,CAAqB,MAAM,OAAe,kBACrC,CACgB,CAAA,EAJrB,CAMH,CAAA,CAEb"}
|
package/dist/charts/PieChart.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useChartColors as t } from "./use-chart-colors.js";
|
|
3
3
|
import { toTooltipFormatter as n } from "./types.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { Cell as a, Legend as o, Pie as s, PieChart as c, ResponsiveContainer as l, Tooltip as u } from "recharts";
|
|
6
6
|
//#region src/charts/PieChart.tsx
|
|
7
|
-
function d({ data: d, category: f, index: p, colors: m
|
|
8
|
-
let S = /* @__PURE__ */ i(c, {
|
|
7
|
+
function d({ data: d, category: f, index: p, colors: m, height: h = 300, width: g, donut: _ = !1, showLegend: v = !0, showTooltip: y = !0, valueFormatter: b, className: x }) {
|
|
8
|
+
let S = t(m), C = /* @__PURE__ */ i(c, {
|
|
9
9
|
width: g,
|
|
10
10
|
height: h,
|
|
11
11
|
children: [
|
|
@@ -17,7 +17,7 @@ function d({ data: d, category: f, index: p, colors: m = t, height: h = 300, wid
|
|
|
17
17
|
nameKey: p,
|
|
18
18
|
innerRadius: _ ? "60%" : 0,
|
|
19
19
|
outerRadius: "80%",
|
|
20
|
-
children: d.map((e, t) => /* @__PURE__ */ r(a, { fill:
|
|
20
|
+
children: d.map((e, t) => /* @__PURE__ */ r(a, { fill: S[t % S.length] }, `${String(e[p])}-${t}`))
|
|
21
21
|
})
|
|
22
22
|
]
|
|
23
23
|
});
|
|
@@ -26,8 +26,8 @@ function d({ data: d, category: f, index: p, colors: m = t, height: h = 300, wid
|
|
|
26
26
|
children: g === void 0 ? /* @__PURE__ */ r(l, {
|
|
27
27
|
width: "100%",
|
|
28
28
|
height: h,
|
|
29
|
-
children:
|
|
30
|
-
}) :
|
|
29
|
+
children: C
|
|
30
|
+
}) : C
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|