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
|
@@ -32,6 +32,7 @@ import { InfiniteData } from '@tanstack/react-query';
|
|
|
32
32
|
import { InputEventHandler } from 'react';
|
|
33
33
|
import { InputHTMLAttributes } from 'react';
|
|
34
34
|
import { JSX } from 'react';
|
|
35
|
+
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
35
36
|
import { KeyboardEventHandler } from 'react';
|
|
36
37
|
import { LabelHTMLAttributes } from 'react';
|
|
37
38
|
import { lazy } from 'react';
|
|
@@ -46,6 +47,7 @@ import { Outlet } from 'react-router';
|
|
|
46
47
|
import { Params } from 'react-router';
|
|
47
48
|
import { Path } from 'react-hook-form';
|
|
48
49
|
import { PersistOptions } from 'zustand/middleware';
|
|
50
|
+
import { PointerEvent as PointerEvent_2 } from 'react';
|
|
49
51
|
import { PointerEventHandler } from 'react';
|
|
50
52
|
import { QueryClient } from '@tanstack/react-query';
|
|
51
53
|
import { QueryKey } from '@tanstack/react-query';
|
|
@@ -304,6 +306,59 @@ export declare interface AppBarProps extends Omit<HTMLAttributes<HTMLElement>, "
|
|
|
304
306
|
|
|
305
307
|
export declare type AppBarTone = "surface" | "primary" | "transparent";
|
|
306
308
|
|
|
309
|
+
/**
|
|
310
|
+
* Apply a {@link KanbanMove} to a column list, returning new arrays.
|
|
311
|
+
*
|
|
312
|
+
* Exported because every consumer needs the same reducer.
|
|
313
|
+
*
|
|
314
|
+
* `toIndex` is the position of the card that was dropped **onto**, read from the
|
|
315
|
+
* board as it looked before the move. Inserting at that same index *after* removing
|
|
316
|
+
* the dragged card lands where the user aimed in both directions — moving down, the
|
|
317
|
+
* removal shifts the target up by one and the insertion lands after it; moving up,
|
|
318
|
+
* nothing shifted. Compensating for the shift (the "obvious" `toIndex - 1`) is what
|
|
319
|
+
* turns a one-step move down into a no-op.
|
|
320
|
+
*
|
|
321
|
+
* @param columns - Current board.
|
|
322
|
+
* @param move - The move reported by `onMove`.
|
|
323
|
+
* @returns A new column list, or the same reference when the move cannot apply.
|
|
324
|
+
*/
|
|
325
|
+
export declare function applyKanbanMove(columns: KanbanColumn[], move: KanbanMove): KanbanColumn[];
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Install a generated theme (or raw CSS) into the document.
|
|
329
|
+
*
|
|
330
|
+
* Safe to call outside a browser: with no `document` it is a no-op returning a
|
|
331
|
+
* no-op disposer, so app bootstrap code does not need a `typeof window` guard.
|
|
332
|
+
*
|
|
333
|
+
* @param theme - A {@link GeneratedTheme} from `createTheme`, or CSS text.
|
|
334
|
+
* @param options - Style element id and mount target.
|
|
335
|
+
* @returns A function that removes the injected `<style>` element.
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* ```ts
|
|
339
|
+
* import { applyTheme, createTheme, themePresets } from "tempest-react-sdk";
|
|
340
|
+
*
|
|
341
|
+
* const dispose = applyTheme(createTheme(themePresets.violet));
|
|
342
|
+
* // later: dispose();
|
|
343
|
+
* ```
|
|
344
|
+
*/
|
|
345
|
+
export declare function applyTheme(theme: GeneratedTheme | string, options?: ApplyThemeOptions): () => void;
|
|
346
|
+
|
|
347
|
+
/** Options for {@link applyTheme}. */
|
|
348
|
+
export declare interface ApplyThemeOptions {
|
|
349
|
+
/**
|
|
350
|
+
* `id` of the managed `<style>` element. Reusing the same id replaces the
|
|
351
|
+
* previous theme; a distinct id lets two themes coexist (e.g. a scoped
|
|
352
|
+
* preview under its own selector). Default `"tempest-theme"`.
|
|
353
|
+
*/
|
|
354
|
+
id?: string;
|
|
355
|
+
/**
|
|
356
|
+
* Node the `<style>` is appended to. Default `document.head`. Pass a shadow
|
|
357
|
+
* root to theme a single web component.
|
|
358
|
+
*/
|
|
359
|
+
target?: Document | ShadowRoot | HTMLElement;
|
|
360
|
+
}
|
|
361
|
+
|
|
307
362
|
/**
|
|
308
363
|
* Compose the Tempest app-wide providers in one place: error boundary →
|
|
309
364
|
* TanStack Query → theme → i18n. Query and theme are on by default; i18n and
|
|
@@ -498,6 +553,55 @@ export declare interface AuthState<TUser> {
|
|
|
498
553
|
*/
|
|
499
554
|
export declare function Avatar({ src, alt, name, size, status, className, onClick, }: AvatarProps): JSX.Element;
|
|
500
555
|
|
|
556
|
+
/**
|
|
557
|
+
* Overlapping row of avatars with a `+N` overflow chip — participants of a
|
|
558
|
+
* meeting, assignees of a task, members of a team.
|
|
559
|
+
*
|
|
560
|
+
* The whole row is one `role="group"` with a single accessible name, and each
|
|
561
|
+
* avatar's name is exposed as its label. That is deliberate: announcing seven
|
|
562
|
+
* separate images with no relation between them is noise, and the overflow chip
|
|
563
|
+
* carries the remaining count so the total is never hidden from a screen reader.
|
|
564
|
+
*
|
|
565
|
+
* @example
|
|
566
|
+
* ```tsx
|
|
567
|
+
* <AvatarGroup
|
|
568
|
+
* label="Participantes"
|
|
569
|
+
* max={3}
|
|
570
|
+
* items={[
|
|
571
|
+
* { name: "Ada Lovelace", src: ada },
|
|
572
|
+
* { name: "Grace Hopper" },
|
|
573
|
+
* { name: "Alan Turing" },
|
|
574
|
+
* { name: "Edsger Dijkstra" },
|
|
575
|
+
* ]}
|
|
576
|
+
* onOverflowClick={() => setDrawerOpen(true)}
|
|
577
|
+
* />
|
|
578
|
+
* ```
|
|
579
|
+
*/
|
|
580
|
+
export declare function AvatarGroup({ items, max, size, label, onOverflowClick, className, }: AvatarGroupProps): JSX.Element;
|
|
581
|
+
|
|
582
|
+
/** One participant of the group. */
|
|
583
|
+
export declare interface AvatarGroupItem {
|
|
584
|
+
/** Image URL. Falls back to initials from `name`. */
|
|
585
|
+
src?: string;
|
|
586
|
+
/** Full name — drives the initials and the accessible label. */
|
|
587
|
+
name: string;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export declare interface AvatarGroupProps {
|
|
591
|
+
items: AvatarGroupItem[];
|
|
592
|
+
/** How many avatars to show before collapsing into `+N`. Default `4`. */
|
|
593
|
+
max?: number;
|
|
594
|
+
size?: AvatarSize;
|
|
595
|
+
/** Accessible name of the group, e.g. `"Participantes"`. */
|
|
596
|
+
label?: string;
|
|
597
|
+
/**
|
|
598
|
+
* Called when the `+N` chip is activated — a natural hook for "see all
|
|
599
|
+
* participants". Without it the chip is plain text and not focusable.
|
|
600
|
+
*/
|
|
601
|
+
onOverflowClick?: () => void;
|
|
602
|
+
className?: string;
|
|
603
|
+
}
|
|
604
|
+
|
|
501
605
|
export declare interface AvatarProps {
|
|
502
606
|
src?: string;
|
|
503
607
|
alt?: string;
|
|
@@ -1134,6 +1238,33 @@ export declare interface CollapsibleProps extends HTMLAttributes<HTMLDivElement>
|
|
|
1134
1238
|
children: ReactNode;
|
|
1135
1239
|
}
|
|
1136
1240
|
|
|
1241
|
+
/** A generated tint scale, keyed by step. */
|
|
1242
|
+
export declare type ColorScale = Record<ScaleStep, string>;
|
|
1243
|
+
|
|
1244
|
+
/** Options for {@link createColorScale}. */
|
|
1245
|
+
declare interface ColorScaleOptions {
|
|
1246
|
+
/**
|
|
1247
|
+
* Pin step `500` to the input color's exact lightness. Default `true`.
|
|
1248
|
+
*
|
|
1249
|
+
* Right for a **brand** color: the hex a designer hands over is the one the
|
|
1250
|
+
* buttons must be. Wrong for a **neutral**: nobody checks that `gray-500` is
|
|
1251
|
+
* exactly the input, while everybody notices that a surface stopped being
|
|
1252
|
+
* near-white — anchoring rescales both halves around the input and compresses
|
|
1253
|
+
* exactly the range a neutral needs wide. With `false`, the ramp keeps the
|
|
1254
|
+
* tuned lightness curve and the input only contributes hue and chroma (a warm
|
|
1255
|
+
* or cool neutral, as asked).
|
|
1256
|
+
*/
|
|
1257
|
+
anchor?: boolean;
|
|
1258
|
+
/**
|
|
1259
|
+
* Use the neutral lightness curve instead of the brand one. Default `false`.
|
|
1260
|
+
*
|
|
1261
|
+
* The neutral curve is wider at both ends, which is what keeps
|
|
1262
|
+
* `text-muted`-on-`surface-3` above AA. Implies the ramp is meant for
|
|
1263
|
+
* surfaces, borders and text rather than for an action color.
|
|
1264
|
+
*/
|
|
1265
|
+
neutral?: boolean;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1137
1268
|
/**
|
|
1138
1269
|
* Combobox — text input with a filterable dropdown of options.
|
|
1139
1270
|
*
|
|
@@ -1202,6 +1333,25 @@ export declare interface CommandProps {
|
|
|
1202
1333
|
className?: string;
|
|
1203
1334
|
}
|
|
1204
1335
|
|
|
1336
|
+
/**
|
|
1337
|
+
* Compare two arbitrary cell values with stable, type-aware ordering.
|
|
1338
|
+
*
|
|
1339
|
+
* The comparator every table in the SDK sorts with, so `DataTable` and
|
|
1340
|
+
* `VirtualTable` agree on what "sorted" means. The type-aware branches exist
|
|
1341
|
+
* because the naive `String(a) < String(b)` gets the two most common cases wrong:
|
|
1342
|
+
* numbers would sort `10` before `9`, and dates would sort by their formatted
|
|
1343
|
+
* text. Strings fall back to `localeCompare` with `numeric: true`, so `"item 2"`
|
|
1344
|
+
* lands before `"item 10"`.
|
|
1345
|
+
*
|
|
1346
|
+
* `null` and `undefined` sort first, together — a missing value is not smaller
|
|
1347
|
+
* than another missing value.
|
|
1348
|
+
*
|
|
1349
|
+
* @param a - First value.
|
|
1350
|
+
* @param b - Second value.
|
|
1351
|
+
* @returns Negative when `a < b`, positive when `a > b`, zero when equal.
|
|
1352
|
+
*/
|
|
1353
|
+
export declare function compareValues(a: unknown, b: unknown): number;
|
|
1354
|
+
|
|
1205
1355
|
/**
|
|
1206
1356
|
* Conditionally wraps its children with `wrapper`.
|
|
1207
1357
|
*
|
|
@@ -1311,6 +1461,9 @@ export declare interface ContextMenuProps {
|
|
|
1311
1461
|
className?: string;
|
|
1312
1462
|
}
|
|
1313
1463
|
|
|
1464
|
+
/** WCAG 2.x contrast ratio between two hex colors, from `1` to `21`. */
|
|
1465
|
+
export declare function contrastRatio(a: string, b: string): number;
|
|
1466
|
+
|
|
1314
1467
|
export { Control }
|
|
1315
1468
|
|
|
1316
1469
|
export { Controller }
|
|
@@ -1412,6 +1565,20 @@ export declare interface CreateAuthStoreOptions<TUser> {
|
|
|
1412
1565
|
initialToken?: string | null;
|
|
1413
1566
|
}
|
|
1414
1567
|
|
|
1568
|
+
/**
|
|
1569
|
+
* Build a ten-step tint scale from a single color.
|
|
1570
|
+
*
|
|
1571
|
+
* The input color's hue is kept throughout and its chroma sets the intensity of
|
|
1572
|
+
* the whole ramp, so a muted brand color yields a muted scale instead of being
|
|
1573
|
+
* "corrected" into something the brand never approved.
|
|
1574
|
+
*
|
|
1575
|
+
* @param hex - Any hex color (`#abc` or `#aabbcc`), the intended `500` step.
|
|
1576
|
+
* @param mode - `"light"` for a light→dark ramp, `"dark"` for the inverted ramp
|
|
1577
|
+
* used under `[data-tempest-theme="dark"]`.
|
|
1578
|
+
* @param options - See {@link ColorScaleOptions}.
|
|
1579
|
+
*/
|
|
1580
|
+
export declare function createColorScale(hex: string, mode?: "light" | "dark", options?: ColorScaleOptions): ColorScale;
|
|
1581
|
+
|
|
1415
1582
|
/**
|
|
1416
1583
|
* Create a {@link DataProvider} bound to an {@link ApiClient}.
|
|
1417
1584
|
*
|
|
@@ -1974,6 +2141,60 @@ export declare interface CreateTempestAuthOptions<TUser> {
|
|
|
1974
2141
|
refreshBody?: (refreshToken: string | null) => unknown;
|
|
1975
2142
|
}
|
|
1976
2143
|
|
|
2144
|
+
/**
|
|
2145
|
+
* Generate `--tempest-*` overrides from a small brand description.
|
|
2146
|
+
*
|
|
2147
|
+
* Only the families you pass are generated; everything else falls through to the
|
|
2148
|
+
* SDK's own tokens, so a theme stays a patch and not a fork of `colors.css`.
|
|
2149
|
+
*
|
|
2150
|
+
* @example
|
|
2151
|
+
* ```ts
|
|
2152
|
+
* import { applyTheme, createTheme } from "tempest-react-sdk";
|
|
2153
|
+
*
|
|
2154
|
+
* const theme = createTheme({
|
|
2155
|
+
* primary: "#7c3aed",
|
|
2156
|
+
* radius: "lg",
|
|
2157
|
+
* chart: ["#7c3aed", "#0ea5e9", "#22c55e", "#f59e0b"],
|
|
2158
|
+
* });
|
|
2159
|
+
*
|
|
2160
|
+
* applyTheme(theme);
|
|
2161
|
+
* ```
|
|
2162
|
+
*
|
|
2163
|
+
* @param options - Brand colors plus optional radius / chart / focus-ring tuning.
|
|
2164
|
+
* @returns The light and dark token maps and the CSS text that carries them.
|
|
2165
|
+
*/
|
|
2166
|
+
export declare function createTheme(options?: CreateThemeOptions): GeneratedTheme;
|
|
2167
|
+
|
|
2168
|
+
/** Input for {@link createTheme}. Every field is optional — omitted families keep the built-in tokens. */
|
|
2169
|
+
export declare interface CreateThemeOptions {
|
|
2170
|
+
/** Brand color, used as the `500` step of the primary scale. */
|
|
2171
|
+
primary?: string;
|
|
2172
|
+
/** Neutral color, used as the `500` step of the gray scale (surfaces, borders, text). */
|
|
2173
|
+
gray?: string;
|
|
2174
|
+
/** Success color (`--tempest-success*`). */
|
|
2175
|
+
success?: string;
|
|
2176
|
+
/** Warning color (`--tempest-warning*`). */
|
|
2177
|
+
warning?: string;
|
|
2178
|
+
/** Danger color (`--tempest-danger*`). */
|
|
2179
|
+
danger?: string;
|
|
2180
|
+
/** Info color (`--tempest-info*`). */
|
|
2181
|
+
info?: string;
|
|
2182
|
+
/**
|
|
2183
|
+
* Categorical series colors for `tempest-react-sdk/charts`, in cycle order.
|
|
2184
|
+
* Written to `--tempest-chart-1` … `--tempest-chart-N`, so charts follow the
|
|
2185
|
+
* theme instead of a hardcoded palette.
|
|
2186
|
+
*/
|
|
2187
|
+
chart?: string[];
|
|
2188
|
+
/** Corner radius scale. A preset name, or explicit per-step values. */
|
|
2189
|
+
radius?: ThemeRadius | Partial<Record<"xs" | "sm" | "md" | "lg" | "xl" | "2xl", string>>;
|
|
2190
|
+
/** Alpha of `--tempest-focus-ring-color`, derived from the brand color. Default `0.35`. */
|
|
2191
|
+
focusRingAlpha?: number;
|
|
2192
|
+
/** Selector the light tokens are written under. Default `":root"`. */
|
|
2193
|
+
selector?: string;
|
|
2194
|
+
/** Selector the dark tokens are written under. Default `'[data-tempest-theme="dark"]'`. */
|
|
2195
|
+
darkSelector?: string;
|
|
2196
|
+
}
|
|
2197
|
+
|
|
1977
2198
|
/**
|
|
1978
2199
|
* Open a WebSocket with automatic exponential-backoff reconnect, optional
|
|
1979
2200
|
* heartbeat pings, and typed JSON parsing.
|
|
@@ -3068,6 +3289,16 @@ export declare interface ForProps<T> {
|
|
|
3068
3289
|
fallback?: ReactNode;
|
|
3069
3290
|
}
|
|
3070
3291
|
|
|
3292
|
+
/** A generated theme: token maps per color scheme, plus the CSS text that carries them. */
|
|
3293
|
+
export declare interface GeneratedTheme {
|
|
3294
|
+
/** Light-scheme custom properties, without the leading `--`-less names (keys include `--`). */
|
|
3295
|
+
light: Record<string, string>;
|
|
3296
|
+
/** Dark-scheme custom properties. */
|
|
3297
|
+
dark: Record<string, string>;
|
|
3298
|
+
/** Both blocks rendered as CSS, ready for {@link applyTheme} or a stylesheet. */
|
|
3299
|
+
css: string;
|
|
3300
|
+
}
|
|
3301
|
+
|
|
3071
3302
|
/**
|
|
3072
3303
|
* Generate an RFC4122 v4 idempotency key (UUID). Use as the value for an
|
|
3073
3304
|
* `Idempotency-Key` header on POST/PATCH requests that must not run twice.
|
|
@@ -3138,6 +3369,15 @@ export declare interface GetListParams {
|
|
|
3138
3369
|
filters?: DataFilters;
|
|
3139
3370
|
}
|
|
3140
3371
|
|
|
3372
|
+
/**
|
|
3373
|
+
* Look up a preset by name.
|
|
3374
|
+
*
|
|
3375
|
+
* @param name - Preset name.
|
|
3376
|
+
* @returns The preset options, or `undefined` when the name is unknown (so a
|
|
3377
|
+
* value coming from `localStorage` or a query string cannot crash boot).
|
|
3378
|
+
*/
|
|
3379
|
+
export declare function getThemePreset(name: string): CreateThemeOptions | undefined;
|
|
3380
|
+
|
|
3141
3381
|
/**
|
|
3142
3382
|
* Thin wrapper over `@react-oauth/google`'s `<GoogleLogin>` that:
|
|
3143
3383
|
*
|
|
@@ -3258,6 +3498,19 @@ export { HashRouter }
|
|
|
3258
3498
|
*/
|
|
3259
3499
|
export declare function haversineKm(origin: Coordinate, destination: Coordinate): number;
|
|
3260
3500
|
|
|
3501
|
+
/** Convert a hex color to OKLCH. */
|
|
3502
|
+
export declare function hexToOklch(hex: string): Oklch;
|
|
3503
|
+
|
|
3504
|
+
/** Parse a hex color into sRGB channels in the `0`–`1` range. */
|
|
3505
|
+
export declare function hexToRgb(hex: string): {
|
|
3506
|
+
r: number;
|
|
3507
|
+
g: number;
|
|
3508
|
+
b: number;
|
|
3509
|
+
};
|
|
3510
|
+
|
|
3511
|
+
/** Format a hex color as `rgb(r g b / alpha)`, for focus rings and overlays. */
|
|
3512
|
+
export declare function hexToRgbaString(hex: string, alpha: number): string;
|
|
3513
|
+
|
|
3261
3514
|
/** Inverse of `<Show>` — hides children when the condition matches. */
|
|
3262
3515
|
export declare function Hide({ above, below, only, children }: HideProps): ReactNode;
|
|
3263
3516
|
|
|
@@ -3780,6 +4033,109 @@ export declare function isValidLatitude(value: number): boolean;
|
|
|
3780
4033
|
/** True when `value` is a finite longitude in `[-180, 180]`. */
|
|
3781
4034
|
export declare function isValidLongitude(value: number): boolean;
|
|
3782
4035
|
|
|
4036
|
+
/**
|
|
4037
|
+
* Kanban board: columns of cards, reorderable within a column and movable across
|
|
4038
|
+
* columns, by pointer **or** keyboard.
|
|
4039
|
+
*
|
|
4040
|
+
* The drag machine is `useSortable` — the board does not reimplement it. Cards are
|
|
4041
|
+
* indexed globally across columns so a single sortable can span the whole board;
|
|
4042
|
+
* the component translates that flat index back into `{ column, index }` for
|
|
4043
|
+
* `onMove`, which is the shape an app actually needs.
|
|
4044
|
+
*
|
|
4045
|
+
* Nothing is mutated here: `onMove` reports the intent once and the parent applies
|
|
4046
|
+
* it. That keeps the board a controlled value and avoids a re-render per pointer
|
|
4047
|
+
* frame.
|
|
4048
|
+
*
|
|
4049
|
+
* ARIA shape: **one `listbox` per column**, named by the column title, containing
|
|
4050
|
+
* only `option` cards. A single board-wide listbox does not survive the markup a
|
|
4051
|
+
* board needs — `listbox` requires `option`/`group` children, and the column header
|
|
4052
|
+
* and card wrapper in between break that ownership. Per-column listboxes also read
|
|
4053
|
+
* better: a screen reader announces which column it is in and how many cards it
|
|
4054
|
+
* holds. The column header is a plain `div`, not a `<header>`, because outside a
|
|
4055
|
+
* sectioning element every `<header>` becomes a page-level banner landmark — with
|
|
4056
|
+
* three columns that is three duplicate banners. An **empty** column is not marked
|
|
4057
|
+
* as a listbox at all: a listbox with zero options fails `aria-required-children`,
|
|
4058
|
+
* and "no cards" is exactly zero options.
|
|
4059
|
+
*
|
|
4060
|
+
* Known limitation: a **keyboard** move can only target positions that hold a card,
|
|
4061
|
+
* because the move walks the flat index space of existing cards. Dropping into an
|
|
4062
|
+
* empty column works by pointer; by keyboard it does not. Moving a card to a column
|
|
4063
|
+
* that already has one card, then reordering, is the workaround until column-switch
|
|
4064
|
+
* keys land.
|
|
4065
|
+
*
|
|
4066
|
+
* @example
|
|
4067
|
+
* ```tsx
|
|
4068
|
+
* const [columns, setColumns] = useState<KanbanColumn[]>([
|
|
4069
|
+
* { id: "todo", title: "A fazer", cards: [{ id: "1", content: "Corrigir login" }] },
|
|
4070
|
+
* { id: "doing", title: "Fazendo", cards: [] },
|
|
4071
|
+
* { id: "done", title: "Feito", cards: [], locked: true },
|
|
4072
|
+
* ]);
|
|
4073
|
+
*
|
|
4074
|
+
* <Kanban
|
|
4075
|
+
* columns={columns}
|
|
4076
|
+
* onMove={({ cardId, fromColumn, toColumn, toIndex }) =>
|
|
4077
|
+
* setColumns((current) => applyKanbanMove(current, { cardId, fromColumn, toColumn, toIndex }))
|
|
4078
|
+
* }
|
|
4079
|
+
* />
|
|
4080
|
+
* ```
|
|
4081
|
+
*/
|
|
4082
|
+
export declare function Kanban({ columns, onMove, renderCard, emptyLabel, cardRoleDescription, label, disabled, className, }: KanbanProps): JSX.Element;
|
|
4083
|
+
|
|
4084
|
+
/** One card on the board. */
|
|
4085
|
+
export declare interface KanbanCard {
|
|
4086
|
+
/** Stable identifier, unique across the whole board. */
|
|
4087
|
+
id: string;
|
|
4088
|
+
/** Card body. A string renders as the card's title. */
|
|
4089
|
+
content: ReactNode;
|
|
4090
|
+
}
|
|
4091
|
+
|
|
4092
|
+
/** One column of the board. */
|
|
4093
|
+
export declare interface KanbanColumn {
|
|
4094
|
+
/** Stable identifier, used as the drop group. */
|
|
4095
|
+
id: string;
|
|
4096
|
+
/** Column heading. */
|
|
4097
|
+
title: ReactNode;
|
|
4098
|
+
/** Cards in display order. */
|
|
4099
|
+
cards: KanbanCard[];
|
|
4100
|
+
/**
|
|
4101
|
+
* Refuses drops into this column. The cards inside can still be picked up and
|
|
4102
|
+
* moved elsewhere — a "done" column that no longer accepts work, for instance.
|
|
4103
|
+
*/
|
|
4104
|
+
locked?: boolean;
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
/** Where a card ended up. */
|
|
4108
|
+
export declare interface KanbanMove {
|
|
4109
|
+
cardId: string;
|
|
4110
|
+
fromColumn: string;
|
|
4111
|
+
toColumn: string;
|
|
4112
|
+
/** Index within the destination column. */
|
|
4113
|
+
toIndex: number;
|
|
4114
|
+
}
|
|
4115
|
+
|
|
4116
|
+
export declare interface KanbanProps {
|
|
4117
|
+
columns: KanbanColumn[];
|
|
4118
|
+
/**
|
|
4119
|
+
* Called once per committed move — on pointer release or on a keyboard drop.
|
|
4120
|
+
* You own the data: apply the move and pass the new `columns` back.
|
|
4121
|
+
*/
|
|
4122
|
+
onMove: (move: KanbanMove) => void;
|
|
4123
|
+
/** Renders a card. Defaults to its `content`. */
|
|
4124
|
+
renderCard?: (card: KanbanCard, column: KanbanColumn) => ReactNode;
|
|
4125
|
+
/** Text shown in a column with no cards. */
|
|
4126
|
+
emptyLabel?: ReactNode;
|
|
4127
|
+
/** Announced per card, so a screen reader user learns the keyboard contract. */
|
|
4128
|
+
cardRoleDescription?: string;
|
|
4129
|
+
/**
|
|
4130
|
+
* Accessible name of the board. A `listbox` without a name is unusable with a
|
|
4131
|
+
* screen reader, so this has a default rather than being optional in practice.
|
|
4132
|
+
*/
|
|
4133
|
+
label?: string;
|
|
4134
|
+
/** Blocks all dragging. */
|
|
4135
|
+
disabled?: boolean;
|
|
4136
|
+
className?: string;
|
|
4137
|
+
}
|
|
4138
|
+
|
|
3783
4139
|
/**
|
|
3784
4140
|
* Renders a `<kbd>` styled like a keyboard key — useful for shortcut hints.
|
|
3785
4141
|
* Compose multiple keys by rendering siblings: `<Kbd>Ctrl</Kbd> + <Kbd>K</Kbd>`.
|
|
@@ -3902,6 +4258,67 @@ export declare interface LDClientLike {
|
|
|
3902
4258
|
off?: (event: string, handler: () => void) => void;
|
|
3903
4259
|
}
|
|
3904
4260
|
|
|
4261
|
+
/**
|
|
4262
|
+
* Full-screen image viewer with keyboard navigation.
|
|
4263
|
+
*
|
|
4264
|
+
* `Esc` closes, `←`/`→` walk the gallery, `Home`/`End` jump to the ends. Focus is
|
|
4265
|
+
* trapped inside while open and the page behind is scroll-locked, so the overlay
|
|
4266
|
+
* behaves like the dialog it is instead of a fancy `<div>` the keyboard can escape.
|
|
4267
|
+
*
|
|
4268
|
+
* Only the current image is mounted; neighbours are **preloaded** via `Image()` so
|
|
4269
|
+
* pressing `→` does not flash an empty frame.
|
|
4270
|
+
*
|
|
4271
|
+
* @example
|
|
4272
|
+
* ```tsx
|
|
4273
|
+
* const [open, setOpen] = useState(false);
|
|
4274
|
+
* const [index, setIndex] = useState(0);
|
|
4275
|
+
*
|
|
4276
|
+
* <Lightbox
|
|
4277
|
+
* open={open}
|
|
4278
|
+
* items={photos.map((p) => ({ src: p.url, alt: p.description }))}
|
|
4279
|
+
* index={index}
|
|
4280
|
+
* onIndexChange={setIndex}
|
|
4281
|
+
* onClose={() => setOpen(false)}
|
|
4282
|
+
* />
|
|
4283
|
+
* ```
|
|
4284
|
+
*/
|
|
4285
|
+
export declare function Lightbox({ items, open, index, onIndexChange, onClose, showThumbnails, showCounter, loop, closeLabel, previousLabel, nextLabel, className, }: LightboxProps): JSX.Element | null;
|
|
4286
|
+
|
|
4287
|
+
/** One item of the gallery. */
|
|
4288
|
+
export declare interface LightboxItem {
|
|
4289
|
+
/** Full-size image URL. */
|
|
4290
|
+
src: string;
|
|
4291
|
+
/** Alt text. Required: a gallery of unlabeled images is unusable with a screen reader. */
|
|
4292
|
+
alt: string;
|
|
4293
|
+
/** Caption rendered under the image. */
|
|
4294
|
+
caption?: string;
|
|
4295
|
+
/** Thumbnail URL for the strip. Falls back to `src`. */
|
|
4296
|
+
thumbnail?: string;
|
|
4297
|
+
}
|
|
4298
|
+
|
|
4299
|
+
export declare interface LightboxProps {
|
|
4300
|
+
items: LightboxItem[];
|
|
4301
|
+
/** Whether the overlay is open. */
|
|
4302
|
+
open: boolean;
|
|
4303
|
+
/** Index shown while open. Default `0`. */
|
|
4304
|
+
index?: number;
|
|
4305
|
+
onIndexChange?: (index: number) => void;
|
|
4306
|
+
onClose: () => void;
|
|
4307
|
+
/** Renders the thumbnail strip. Default `true` when there is more than one item. */
|
|
4308
|
+
showThumbnails?: boolean;
|
|
4309
|
+
/** Renders the `3 / 12` counter. Default `true`. */
|
|
4310
|
+
showCounter?: boolean;
|
|
4311
|
+
/**
|
|
4312
|
+
* Wrap around at the ends. Default `true` — in a photo viewer, hitting a dead
|
|
4313
|
+
* end at the last image reads as a bug more often than as a boundary.
|
|
4314
|
+
*/
|
|
4315
|
+
loop?: boolean;
|
|
4316
|
+
closeLabel?: string;
|
|
4317
|
+
previousLabel?: string;
|
|
4318
|
+
nextLabel?: string;
|
|
4319
|
+
className?: string;
|
|
4320
|
+
}
|
|
4321
|
+
|
|
3905
4322
|
export { Link }
|
|
3906
4323
|
|
|
3907
4324
|
export declare interface ListOptions<TItem> {
|
|
@@ -4206,6 +4623,9 @@ export declare interface MoneyProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
4206
4623
|
locale?: string;
|
|
4207
4624
|
}
|
|
4208
4625
|
|
|
4626
|
+
/** Reorder helper: move `from` to `to`, returning a new array. */
|
|
4627
|
+
export declare function moveItem<T>(items: T[], from: number, to: number): T[];
|
|
4628
|
+
|
|
4209
4629
|
/**
|
|
4210
4630
|
* MultiSelect — a filterable dropdown that selects many options, shown as
|
|
4211
4631
|
* removable chips inside the field. Selecting toggles a value; Backspace on an
|
|
@@ -4377,6 +4797,78 @@ export { NavLink }
|
|
|
4377
4797
|
*/
|
|
4378
4798
|
export declare function normalizeLongitude(longitude: number): number;
|
|
4379
4799
|
|
|
4800
|
+
/**
|
|
4801
|
+
* Inbox panel for notifications the app has received.
|
|
4802
|
+
*
|
|
4803
|
+
* Deliberately presentational and controlled: it takes a list and emits intent.
|
|
4804
|
+
* Where the list comes from — an API, a service-worker push, `localStorage` — and
|
|
4805
|
+
* where read state is written are app decisions, and a component that assumed any
|
|
4806
|
+
* of them would be wrong for most apps. `useNotificationInbox` is the companion
|
|
4807
|
+
* that holds the state, including the service-worker bridge.
|
|
4808
|
+
*
|
|
4809
|
+
* It is also just the panel, not a popover: apps mount it inside their own
|
|
4810
|
+
* `Popover`, `Drawer` or route. That keeps one component from owning both the
|
|
4811
|
+
* inbox and a positioning strategy.
|
|
4812
|
+
*
|
|
4813
|
+
* @example
|
|
4814
|
+
* const inbox = useNotificationInbox();
|
|
4815
|
+
*
|
|
4816
|
+
* <Popover trigger={<Button>Notificações ({inbox.unreadCount})</Button>}>
|
|
4817
|
+
* <NotificationCenter
|
|
4818
|
+
* items={inbox.items}
|
|
4819
|
+
* onMarkRead={inbox.markRead}
|
|
4820
|
+
* onMarkAllRead={inbox.markAllRead}
|
|
4821
|
+
* onDismiss={inbox.remove}
|
|
4822
|
+
* onSelect={(item) => item.url && navigate(item.url)}
|
|
4823
|
+
* />
|
|
4824
|
+
* </Popover>
|
|
4825
|
+
*/
|
|
4826
|
+
export declare function NotificationCenter({ items, title, onSelect, onMarkRead, onMarkAllRead, onDismiss, renderIcon, locale, emptyState, now, className, ...rest }: NotificationCenterProps): JSX.Element;
|
|
4827
|
+
|
|
4828
|
+
export declare interface NotificationCenterProps extends Omit<HTMLAttributes<HTMLDivElement>, OverriddenDomProps> {
|
|
4829
|
+
/** Entries to show. Rendered in the order given — `useNotificationInbox` sorts newest first. */
|
|
4830
|
+
items: readonly NotificationItem[];
|
|
4831
|
+
/**
|
|
4832
|
+
* Panel heading. Pass `null` to render the list with no header.
|
|
4833
|
+
*
|
|
4834
|
+
* Widened from the DOM `title` attribute (a `string`) on purpose: this is a
|
|
4835
|
+
* rendered heading, not a tooltip, so it takes a node.
|
|
4836
|
+
*/
|
|
4837
|
+
title?: ReactNode;
|
|
4838
|
+
/** Activate an entry: click, `Enter` or `Space`. Also marks it read when `onMarkRead` is set. */
|
|
4839
|
+
onSelect?: (item: NotificationItem) => void;
|
|
4840
|
+
/** Mark one entry as read. Enables the per-item read control. */
|
|
4841
|
+
onMarkRead?: (id: string) => void;
|
|
4842
|
+
/** Mark every entry as read. Enables the header action. */
|
|
4843
|
+
onMarkAllRead?: () => void;
|
|
4844
|
+
/** Remove one entry. Enables the per-item dismiss control. */
|
|
4845
|
+
onDismiss?: (id: string) => void;
|
|
4846
|
+
/** Icon rendered at the leading edge of each row — an `<Icon name={…} />`, say. */
|
|
4847
|
+
renderIcon?: (item: NotificationItem) => ReactNode;
|
|
4848
|
+
/** Locale for the relative timestamps. Default `"pt-BR"`. */
|
|
4849
|
+
locale?: RelativeTimeLocale;
|
|
4850
|
+
/** Shown when `items` is empty. */
|
|
4851
|
+
emptyState?: ReactNode;
|
|
4852
|
+
/** Reference point for the relative timestamps. Default: now, at render time. */
|
|
4853
|
+
now?: number;
|
|
4854
|
+
}
|
|
4855
|
+
|
|
4856
|
+
/** One entry in the inbox. */
|
|
4857
|
+
export declare interface NotificationItem {
|
|
4858
|
+
/** Stable id. Re-adding an existing id updates that entry instead of duplicating it. */
|
|
4859
|
+
id: string;
|
|
4860
|
+
title: string;
|
|
4861
|
+
/** Body text. Optional — a title-only notification is a legitimate shape. */
|
|
4862
|
+
body?: string;
|
|
4863
|
+
/** Epoch milliseconds. Used for ordering and for the relative timestamp. */
|
|
4864
|
+
receivedAt: number;
|
|
4865
|
+
read?: boolean;
|
|
4866
|
+
/** Where activating the notification should take the user. */
|
|
4867
|
+
url?: string;
|
|
4868
|
+
/** Free-form payload the app passes through, e.g. the entity it refers to. */
|
|
4869
|
+
data?: Record<string, unknown>;
|
|
4870
|
+
}
|
|
4871
|
+
|
|
4380
4872
|
/**
|
|
4381
4873
|
* Module-level singleton progress controller. Drive it imperatively from
|
|
4382
4874
|
* anywhere (router transitions, fetch interceptors) and render the visual bar
|
|
@@ -4701,6 +5193,35 @@ export declare interface OffsetParams {
|
|
|
4701
5193
|
ascending?: boolean;
|
|
4702
5194
|
}
|
|
4703
5195
|
|
|
5196
|
+
/**
|
|
5197
|
+
* Color math behind {@link createTheme} — OKLab/OKLCH conversions, tint scale
|
|
5198
|
+
* generation and WCAG contrast picking.
|
|
5199
|
+
*
|
|
5200
|
+
* Everything here is pure and dependency-free: the SDK generates brand ramps at
|
|
5201
|
+
* runtime in the browser, so a color library would be a disproportionate cost
|
|
5202
|
+
* for ~150 lines of well-specified math. OKLCH is used instead of HSL because
|
|
5203
|
+
* HSL lightness is not perceptual — an HSL ramp of a yellow and of a blue at the
|
|
5204
|
+
* same `L` read as wildly different brightness, which is exactly what breaks a
|
|
5205
|
+
* generated palette.
|
|
5206
|
+
*/
|
|
5207
|
+
/** A color in the OKLCH space: perceptual lightness, chroma and hue. */
|
|
5208
|
+
export declare interface Oklch {
|
|
5209
|
+
/** Perceptual lightness, `0` (black) to `1` (white). */
|
|
5210
|
+
l: number;
|
|
5211
|
+
/** Chroma (colorfulness). `0` is gray; sRGB rarely exceeds `~0.37`. */
|
|
5212
|
+
c: number;
|
|
5213
|
+
/** Hue angle in degrees, `0`–`360`. */
|
|
5214
|
+
h: number;
|
|
5215
|
+
}
|
|
5216
|
+
|
|
5217
|
+
/**
|
|
5218
|
+
* Convert OKLCH to a hex color, reducing chroma until the result fits sRGB.
|
|
5219
|
+
*
|
|
5220
|
+
* Lightness and hue are preserved: desaturating is far less noticeable than
|
|
5221
|
+
* shifting either of them, and a naive channel clamp would do both.
|
|
5222
|
+
*/
|
|
5223
|
+
export declare function oklchToHex(color: Oklch): string;
|
|
5224
|
+
|
|
4704
5225
|
/**
|
|
4705
5226
|
* Create a new object with the given `keys` removed from `obj`.
|
|
4706
5227
|
*
|
|
@@ -4785,7 +5306,12 @@ export declare interface OutboxEntry<TPayload = unknown> {
|
|
|
4785
5306
|
op: OutboxOp;
|
|
4786
5307
|
/** Primary key of the record the mutation targets. */
|
|
4787
5308
|
recordId: string;
|
|
4788
|
-
/**
|
|
5309
|
+
/**
|
|
5310
|
+
* Epoch milliseconds when the mutation was queued, and the FIFO sort key for
|
|
5311
|
+
* `listPending()` and the delivery loop. Strictly increasing per engine
|
|
5312
|
+
* instance: entries queued inside the same millisecond are spaced by 1ms so
|
|
5313
|
+
* the order never depends on how the index breaks a tie.
|
|
5314
|
+
*/
|
|
4789
5315
|
enqueuedAt: number;
|
|
4790
5316
|
/** How many delivery attempts have been made so far. */
|
|
4791
5317
|
attempts: number;
|
|
@@ -4807,6 +5333,16 @@ export declare type OutboxOp = "create" | "update" | "delete";
|
|
|
4807
5333
|
|
|
4808
5334
|
export { Outlet }
|
|
4809
5335
|
|
|
5336
|
+
/**
|
|
5337
|
+
* DOM attributes this component redefines.
|
|
5338
|
+
*
|
|
5339
|
+
* `title` becomes a rendered heading node instead of a tooltip string, and
|
|
5340
|
+
* `onSelect` becomes "an entry was activated" instead of the DOM text-selection
|
|
5341
|
+
* event. Both would be type errors if merged, and silently confusing if allowed
|
|
5342
|
+
* through.
|
|
5343
|
+
*/
|
|
5344
|
+
declare type OverriddenDomProps = "children" | "title" | "onSelect";
|
|
5345
|
+
|
|
4810
5346
|
/**
|
|
4811
5347
|
* Page wrapper with header + (optional) toolbar + content + footer. Pairs
|
|
4812
5348
|
* with `Container` when you want a max-width content well.
|
|
@@ -5351,6 +5887,29 @@ export declare interface RatingStarsProps {
|
|
|
5351
5887
|
className?: string;
|
|
5352
5888
|
}
|
|
5353
5889
|
|
|
5890
|
+
/**
|
|
5891
|
+
* Pick the readable foreground for a background, by contrast ratio.
|
|
5892
|
+
*
|
|
5893
|
+
* Used for `--tempest-primary-foreground`: a generated brand color can land
|
|
5894
|
+
* anywhere on the lightness axis, and hardcoding white would silently produce
|
|
5895
|
+
* unreadable buttons for light brands (yellow, lime, cyan).
|
|
5896
|
+
*/
|
|
5897
|
+
export declare function readableForeground(background: string, light?: string, dark?: string): string;
|
|
5898
|
+
|
|
5899
|
+
/**
|
|
5900
|
+
* Read a token's computed value from an element (default: `<html>`).
|
|
5901
|
+
*
|
|
5902
|
+
* Useful to bridge CSS tokens into JS that cannot take a `var()` — canvas
|
|
5903
|
+
* drawing, chart libraries that set SVG attributes, `<meta name="theme-color">`.
|
|
5904
|
+
*
|
|
5905
|
+
* @param name - Token name, with or without the leading `--`.
|
|
5906
|
+
* @param element - Element to resolve against. Omit for `document.documentElement`;
|
|
5907
|
+
* an explicit `null` (a ref that has not attached yet) reads nothing rather than
|
|
5908
|
+
* silently falling back to the root, whose value may be a different theme.
|
|
5909
|
+
* @returns The trimmed value, or `""` when unset or outside a browser.
|
|
5910
|
+
*/
|
|
5911
|
+
export declare function readThemeToken(name: string, element?: Element | null): string;
|
|
5912
|
+
|
|
5354
5913
|
export { redirect }
|
|
5355
5914
|
|
|
5356
5915
|
/** Recommended refetch intervals (milliseconds). */
|
|
@@ -5472,6 +6031,9 @@ export declare interface RegisterServiceWorkerOptions {
|
|
|
5472
6031
|
reloadOnActivate?: boolean;
|
|
5473
6032
|
}
|
|
5474
6033
|
|
|
6034
|
+
/** WCAG 2.x relative luminance of a hex color. */
|
|
6035
|
+
export declare function relativeLuminance(hex: string): number;
|
|
6036
|
+
|
|
5475
6037
|
/**
|
|
5476
6038
|
* Render a date as a human-friendly relative-time string (e.g. "5 min atrás")
|
|
5477
6039
|
* inside a semantic `<time>` element with a machine-readable `dateTime`.
|
|
@@ -5635,6 +6197,9 @@ export declare interface RetryOptions {
|
|
|
5635
6197
|
signal?: AbortSignal;
|
|
5636
6198
|
}
|
|
5637
6199
|
|
|
6200
|
+
/** Serialize sRGB channels (`0`–`1`, clamped) back to a `#rrggbb` string. */
|
|
6201
|
+
export declare function rgbToHex(r: number, g: number, b: number): string;
|
|
6202
|
+
|
|
5638
6203
|
export declare interface RoleAccessControlConfig {
|
|
5639
6204
|
/** Permission strings granted directly, regardless of role. */
|
|
5640
6205
|
permissions?: string[];
|
|
@@ -5759,6 +6324,9 @@ export declare interface SafeAreaProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
5759
6324
|
children?: ReactNode;
|
|
5760
6325
|
}
|
|
5761
6326
|
|
|
6327
|
+
/** The ten steps of a Tempest tint scale, lightest to darkest. */
|
|
6328
|
+
export declare type ScaleStep = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
6329
|
+
|
|
5762
6330
|
/**
|
|
5763
6331
|
* A styled scroll container that overflows on the chosen axis and renders a
|
|
5764
6332
|
* thin custom scrollbar (WebKit) while staying fully functional in browsers
|
|
@@ -5988,6 +6556,77 @@ export declare interface SidebarProps extends Omit<HTMLAttributes<HTMLElement>,
|
|
|
5988
6556
|
collapsedWidth?: number | string;
|
|
5989
6557
|
}
|
|
5990
6558
|
|
|
6559
|
+
/**
|
|
6560
|
+
* Signature capture on a canvas — the "sign here" field of a delivery receipt,
|
|
6561
|
+
* a service order, a term of acceptance.
|
|
6562
|
+
*
|
|
6563
|
+
* Strokes are kept as point lists and the canvas is **redrawn** from them, which
|
|
6564
|
+
* is what makes `undo` possible at all: a canvas holds pixels, not history, so
|
|
6565
|
+
* removing the last stroke means replaying the rest.
|
|
6566
|
+
*
|
|
6567
|
+
* The backing store is scaled by `devicePixelRatio`, so the line is crisp on a
|
|
6568
|
+
* phone instead of the blurry 1x bitmap a naive canvas produces.
|
|
6569
|
+
*
|
|
6570
|
+
* @example
|
|
6571
|
+
* ```tsx
|
|
6572
|
+
* const pad = useRef<SignaturePadHandle>(null);
|
|
6573
|
+
* const [empty, setEmpty] = useState(true);
|
|
6574
|
+
*
|
|
6575
|
+
* async function submit() {
|
|
6576
|
+
* const blob = await pad.current?.toBlob("image/png");
|
|
6577
|
+
* if (blob) await api.upload("/receipts/42/signature", blob);
|
|
6578
|
+
* }
|
|
6579
|
+
*
|
|
6580
|
+
* <SignaturePad ref={pad} label="Assinatura do cliente" onEmptyChange={setEmpty} />
|
|
6581
|
+
* <Button disabled={empty} onClick={submit}>Enviar</Button>
|
|
6582
|
+
* ```
|
|
6583
|
+
*/
|
|
6584
|
+
export declare const SignaturePad: ForwardRefExoticComponent<SignaturePadProps & RefAttributes<SignaturePadHandle>>;
|
|
6585
|
+
|
|
6586
|
+
/** Imperative handle exposed through `ref`. */
|
|
6587
|
+
export declare interface SignaturePadHandle {
|
|
6588
|
+
/** Drop every stroke. */
|
|
6589
|
+
clear: () => void;
|
|
6590
|
+
/** Drop the last stroke. */
|
|
6591
|
+
undo: () => void;
|
|
6592
|
+
/** `true` while nothing has been drawn. */
|
|
6593
|
+
isEmpty: () => boolean;
|
|
6594
|
+
/** Export as a data URL. Returns `""` when the canvas is unavailable. */
|
|
6595
|
+
toDataURL: (type?: string, quality?: number) => string;
|
|
6596
|
+
/** Export as a `Blob` — what you actually upload. `null` when unavailable. */
|
|
6597
|
+
toBlob: (type?: string, quality?: number) => Promise<Blob | null>;
|
|
6598
|
+
}
|
|
6599
|
+
|
|
6600
|
+
export declare interface SignaturePadProps {
|
|
6601
|
+
/** Drawing surface width in CSS pixels. Default `400`. */
|
|
6602
|
+
width?: number;
|
|
6603
|
+
/** Drawing surface height in CSS pixels. Default `160`. */
|
|
6604
|
+
height?: number;
|
|
6605
|
+
/**
|
|
6606
|
+
* Stroke color. Defaults to the canvas' computed `color`, which the
|
|
6607
|
+
* stylesheet binds to `--tempest-text` — so the signature follows the theme
|
|
6608
|
+
* (including dark mode) instead of being hardcoded black.
|
|
6609
|
+
*/
|
|
6610
|
+
penColor?: string;
|
|
6611
|
+
/** Stroke width in CSS pixels. Default `2`. */
|
|
6612
|
+
penWidth?: number;
|
|
6613
|
+
/** Blocks drawing and dims the surface. */
|
|
6614
|
+
disabled?: boolean;
|
|
6615
|
+
/** Accessible name of the surface. Default `"Signature"`. */
|
|
6616
|
+
label?: string;
|
|
6617
|
+
/** Called on the first move of each stroke. */
|
|
6618
|
+
onBegin?: () => void;
|
|
6619
|
+
/** Called when a stroke ends, with the current image as a data URL. */
|
|
6620
|
+
onEnd?: (dataUrl: string) => void;
|
|
6621
|
+
/** Called whenever the emptiness changes — wire it to a submit button. */
|
|
6622
|
+
onEmptyChange?: (isEmpty: boolean) => void;
|
|
6623
|
+
/** Renders the Clear/Undo buttons. Default `true`. */
|
|
6624
|
+
showActions?: boolean;
|
|
6625
|
+
clearLabel?: string;
|
|
6626
|
+
undoLabel?: string;
|
|
6627
|
+
className?: string;
|
|
6628
|
+
}
|
|
6629
|
+
|
|
5991
6630
|
/** Loading placeholder block. Use `variant="text"` for inline lines, `circle` for avatars. */
|
|
5992
6631
|
export declare function Skeleton({ variant, width, height, className, style }: SkeletonProps): JSX.Element;
|
|
5993
6632
|
|
|
@@ -6049,6 +6688,40 @@ export declare interface SliderProps {
|
|
|
6049
6688
|
*/
|
|
6050
6689
|
export declare function slugify(input: string): string;
|
|
6051
6690
|
|
|
6691
|
+
/** Where a dragged item would land if dropped now. */
|
|
6692
|
+
export declare interface SortableDropTarget {
|
|
6693
|
+
/** Index the item started at, within its own group. */
|
|
6694
|
+
from: number;
|
|
6695
|
+
/** Index it would move to, within the destination group. */
|
|
6696
|
+
to: number;
|
|
6697
|
+
/**
|
|
6698
|
+
* Group the item started in — a Kanban column, for instance. `undefined` for a
|
|
6699
|
+
* plain single-list sortable.
|
|
6700
|
+
*/
|
|
6701
|
+
fromGroup?: string;
|
|
6702
|
+
/** Destination group. Equal to `fromGroup` when the move stays in one group. */
|
|
6703
|
+
toGroup?: string;
|
|
6704
|
+
}
|
|
6705
|
+
|
|
6706
|
+
/** Props to spread on each sortable item. */
|
|
6707
|
+
export declare interface SortableItemProps {
|
|
6708
|
+
/** Marks the item for hit-testing. */
|
|
6709
|
+
"data-sortable-index": number;
|
|
6710
|
+
/** Group the item belongs to, when the sortable spans several lists. */
|
|
6711
|
+
"data-sortable-group"?: string;
|
|
6712
|
+
/** `true` while this item is the one being moved. */
|
|
6713
|
+
"data-sortable-active"?: boolean;
|
|
6714
|
+
/** Grab handle wiring: starts a pointer drag. */
|
|
6715
|
+
onPointerDown: (event: PointerEvent_2<HTMLElement>) => void;
|
|
6716
|
+
/** Keyboard reordering — see {@link UseSortableResult}. */
|
|
6717
|
+
onKeyDown: (event: KeyboardEvent_2<HTMLElement>) => void;
|
|
6718
|
+
/** Puts the item in the tab order so the keyboard path is reachable. */
|
|
6719
|
+
tabIndex: number;
|
|
6720
|
+
role: "option";
|
|
6721
|
+
"aria-roledescription": string;
|
|
6722
|
+
"aria-selected": boolean;
|
|
6723
|
+
}
|
|
6724
|
+
|
|
6052
6725
|
export declare type SortDirection = "asc" | "desc";
|
|
6053
6726
|
|
|
6054
6727
|
/**
|
|
@@ -6158,6 +6831,8 @@ export declare type StatTrend = "up" | "down" | "flat";
|
|
|
6158
6831
|
|
|
6159
6832
|
export declare interface StepItem {
|
|
6160
6833
|
label: ReactNode;
|
|
6834
|
+
/** Secondary line under the label — a hint, or "optional". */
|
|
6835
|
+
description?: ReactNode;
|
|
6161
6836
|
}
|
|
6162
6837
|
|
|
6163
6838
|
/**
|
|
@@ -6165,7 +6840,7 @@ export declare interface StepItem {
|
|
|
6165
6840
|
* render as completed; the step at `current` is active; later steps are
|
|
6166
6841
|
* upcoming.
|
|
6167
6842
|
*/
|
|
6168
|
-
export declare function Stepper({ steps, current, orientation, className }: StepperProps): JSX.Element;
|
|
6843
|
+
export declare function Stepper({ steps, current, orientation, onStepClick, className, }: StepperProps): JSX.Element;
|
|
6169
6844
|
|
|
6170
6845
|
/**
|
|
6171
6846
|
* Numeric +/− stepper. Common in checkout quantity selectors and admin
|
|
@@ -6208,6 +6883,12 @@ export declare interface StepperProps {
|
|
|
6208
6883
|
/** Index of the currently active step (0-based). */
|
|
6209
6884
|
current: number;
|
|
6210
6885
|
orientation?: "horizontal" | "vertical";
|
|
6886
|
+
/**
|
|
6887
|
+
* Makes each step activatable. Without it the steps are a read-only
|
|
6888
|
+
* indicator, which is the right default — in a gated flow, jumping ahead
|
|
6889
|
+
* would skip the gates.
|
|
6890
|
+
*/
|
|
6891
|
+
onStepClick?: (index: number) => void;
|
|
6211
6892
|
className?: string;
|
|
6212
6893
|
}
|
|
6213
6894
|
|
|
@@ -6601,6 +7282,9 @@ export declare interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAr
|
|
|
6601
7282
|
wrapperClassName?: string;
|
|
6602
7283
|
}
|
|
6603
7284
|
|
|
7285
|
+
/** The default `<style>` element id owned by {@link applyTheme}. */
|
|
7286
|
+
export declare const THEME_STYLE_ID = "tempest-theme";
|
|
7287
|
+
|
|
6604
7288
|
export declare interface ThemeContextValue {
|
|
6605
7289
|
/** Raw user preference (light / dark / system). */
|
|
6606
7290
|
theme: ThemeMode;
|
|
@@ -6612,6 +7296,17 @@ export declare interface ThemeContextValue {
|
|
|
6612
7296
|
toggle: () => void;
|
|
6613
7297
|
}
|
|
6614
7298
|
|
|
7299
|
+
/**
|
|
7300
|
+
* Contrast ratio of `--tempest-primary-foreground` over the brand color.
|
|
7301
|
+
*
|
|
7302
|
+
* Exposed so an app (or a test) can assert its own brand clears WCAG AA (4.5) for
|
|
7303
|
+
* body text or AA-large (3.0) for button labels, instead of trusting the pick.
|
|
7304
|
+
*
|
|
7305
|
+
* @param options - The same input given to {@link createTheme}.
|
|
7306
|
+
* @returns The ratio, or `null` when no `primary` was provided.
|
|
7307
|
+
*/
|
|
7308
|
+
export declare function themeContrast(options: CreateThemeOptions): number | null;
|
|
7309
|
+
|
|
6615
7310
|
/**
|
|
6616
7311
|
* Plain HTML snippet that sets `data-tempest-theme` on `<html>` before React
|
|
6617
7312
|
* hydrates. Inline this in `<head>` to avoid a flash of the wrong theme on
|
|
@@ -6624,6 +7319,17 @@ export declare function themeInitScript(options?: GetInitialThemeOptions): strin
|
|
|
6624
7319
|
|
|
6625
7320
|
export declare type ThemeMode = "light" | "dark" | "system";
|
|
6626
7321
|
|
|
7322
|
+
/** Name of a bundled preset. */
|
|
7323
|
+
export declare type ThemePresetName = "tempest" | "violet" | "emerald" | "rose" | "slate" | "amber";
|
|
7324
|
+
|
|
7325
|
+
/**
|
|
7326
|
+
* The bundled presets.
|
|
7327
|
+
*
|
|
7328
|
+
* `tempest` restates the SDK's own defaults — useful as a starting point to
|
|
7329
|
+
* tweak, and as the "reset to default" entry in a theme picker.
|
|
7330
|
+
*/
|
|
7331
|
+
export declare const themePresets: Record<ThemePresetName, CreateThemeOptions>;
|
|
7332
|
+
|
|
6627
7333
|
/**
|
|
6628
7334
|
* Wire dark/light theming. Writes a data attribute on a target element (the
|
|
6629
7335
|
* `<html>` element by default) and exposes the current preference via
|
|
@@ -6667,6 +7373,12 @@ export declare interface ThemeProviderProps {
|
|
|
6667
7373
|
};
|
|
6668
7374
|
}
|
|
6669
7375
|
|
|
7376
|
+
/** Radius presets, applied to the whole `--tempest-radius-*` family at once. */
|
|
7377
|
+
export declare type ThemeRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
|
|
7378
|
+
|
|
7379
|
+
/** Status token families that {@link createTheme} can regenerate. */
|
|
7380
|
+
export declare type ThemeStatus = "success" | "warning" | "danger" | "info";
|
|
7381
|
+
|
|
6670
7382
|
/**
|
|
6671
7383
|
* Create a throttled version of `fn` with leading and trailing edges.
|
|
6672
7384
|
*
|
|
@@ -6973,6 +7685,80 @@ export declare interface TravelEstimate {
|
|
|
6973
7685
|
*/
|
|
6974
7686
|
export declare type TravelMode = "car" | "motorcycle" | "bus";
|
|
6975
7687
|
|
|
7688
|
+
/** One node of the tree. Children make it a branch; no children makes it a leaf. */
|
|
7689
|
+
export declare interface TreeNode {
|
|
7690
|
+
/** Stable identifier, unique across the whole tree. */
|
|
7691
|
+
id: string;
|
|
7692
|
+
/** Rendered label. */
|
|
7693
|
+
label: ReactNode;
|
|
7694
|
+
/** Child nodes. An empty array still renders as a branch (an empty folder). */
|
|
7695
|
+
children?: TreeNode[];
|
|
7696
|
+
/** Icon rendered before the label. */
|
|
7697
|
+
icon?: ReactNode;
|
|
7698
|
+
/** Blocks selection and expansion, and skips the node in keyboard navigation. */
|
|
7699
|
+
disabled?: boolean;
|
|
7700
|
+
}
|
|
7701
|
+
|
|
7702
|
+
/**
|
|
7703
|
+
* Accessible tree for hierarchical data — categories, permissions, folders, an
|
|
7704
|
+
* org chart.
|
|
7705
|
+
*
|
|
7706
|
+
* Implements the `tree` role with **roving tabindex**: exactly one row is
|
|
7707
|
+
* tabbable, and the arrow keys move focus within the widget. That is what keeps a
|
|
7708
|
+
* 500-node tree from adding 500 stops to the page's tab order.
|
|
7709
|
+
*
|
|
7710
|
+
* Keyboard map: `↓`/`↑` move, `→` expands (or descends), `←` collapses (or goes to
|
|
7711
|
+
* the parent), `Home`/`End` jump to the first/last visible row, `Enter`/`Space`
|
|
7712
|
+
* select.
|
|
7713
|
+
*
|
|
7714
|
+
* The chevron is decoration (`aria-hidden`), not a button: the row itself carries
|
|
7715
|
+
* `aria-expanded`, so a second focusable control there would only add noise for a
|
|
7716
|
+
* screen reader while duplicating an action the keyboard map already has. It still
|
|
7717
|
+
* accepts a click, with the event stopped so it toggles without also selecting.
|
|
7718
|
+
*
|
|
7719
|
+
* @example
|
|
7720
|
+
* ```tsx
|
|
7721
|
+
* const nodes: TreeNode[] = [
|
|
7722
|
+
* {
|
|
7723
|
+
* id: "vendas",
|
|
7724
|
+
* label: "Vendas",
|
|
7725
|
+
* children: [
|
|
7726
|
+
* { id: "vendas.ler", label: "Ler" },
|
|
7727
|
+
* { id: "vendas.editar", label: "Editar" },
|
|
7728
|
+
* ],
|
|
7729
|
+
* },
|
|
7730
|
+
* { id: "config", label: "Configurações", children: [] },
|
|
7731
|
+
* ];
|
|
7732
|
+
*
|
|
7733
|
+
* <TreeView nodes={nodes} defaultExpandedIds={["vendas"]} onSelect={(node) => console.log(node.id)} />
|
|
7734
|
+
* ```
|
|
7735
|
+
*/
|
|
7736
|
+
export declare function TreeView({ nodes, expandedIds, defaultExpandedIds, onExpandedChange, selectedId, defaultSelectedId, onSelect, toggleOnSelect, label, className, }: TreeViewProps): JSX.Element;
|
|
7737
|
+
|
|
7738
|
+
export declare interface TreeViewProps {
|
|
7739
|
+
/** Root nodes. */
|
|
7740
|
+
nodes: TreeNode[];
|
|
7741
|
+
/** Controlled expanded ids. */
|
|
7742
|
+
expandedIds?: string[];
|
|
7743
|
+
/** Uncontrolled initial expanded ids. */
|
|
7744
|
+
defaultExpandedIds?: string[];
|
|
7745
|
+
onExpandedChange?: (expandedIds: string[]) => void;
|
|
7746
|
+
/** Controlled selected id. `null` means nothing selected. */
|
|
7747
|
+
selectedId?: string | null;
|
|
7748
|
+
/** Uncontrolled initial selection. */
|
|
7749
|
+
defaultSelectedId?: string | null;
|
|
7750
|
+
onSelect?: (node: TreeNode) => void;
|
|
7751
|
+
/**
|
|
7752
|
+
* Selecting a branch also toggles it. Default `true` — matches how a file
|
|
7753
|
+
* explorer behaves; set `false` when a branch is itself a meaningful choice
|
|
7754
|
+
* (a category that owns items, for instance).
|
|
7755
|
+
*/
|
|
7756
|
+
toggleOnSelect?: boolean;
|
|
7757
|
+
/** Accessible name for the tree. */
|
|
7758
|
+
label?: string;
|
|
7759
|
+
className?: string;
|
|
7760
|
+
}
|
|
7761
|
+
|
|
6976
7762
|
/**
|
|
6977
7763
|
* Truncate a string to `max` characters, appending `suffix` when cut.
|
|
6978
7764
|
* Returns the original when shorter than (or equal to) `max`.
|
|
@@ -7189,6 +7975,11 @@ export declare interface UseAsyncResult<T> {
|
|
|
7189
7975
|
}
|
|
7190
7976
|
|
|
7191
7977
|
/**
|
|
7978
|
+
* The player lives in a state initializer, not in a lazily-written ref: the
|
|
7979
|
+
* initializer runs exactly once and is not a side effect during render, which is
|
|
7980
|
+
* what the ref version was. The player identity never changes, so state holds it
|
|
7981
|
+
* fine and the value is non-null from the first render.
|
|
7982
|
+
*
|
|
7192
7983
|
* Hook-managed audio player. Each component instance gets its own
|
|
7193
7984
|
* {@link AudioPlayer}, so unmounting cleanly stops playback. Useful for
|
|
7194
7985
|
* notification chimes, UI feedback sounds, and per-component soundtracks.
|
|
@@ -7393,6 +8184,11 @@ export declare function useDebounce<T>(value: T, delay?: number): T;
|
|
|
7393
8184
|
* Memoize a value with a structural equality check. Use when an object/array
|
|
7394
8185
|
* created during render is fed to `useEffect` dependencies and you want to
|
|
7395
8186
|
* avoid spurious effect runs when only the reference changes.
|
|
8187
|
+
*
|
|
8188
|
+
* The cache is a ref read and written during render. That is flagged by the React
|
|
8189
|
+
* Compiler rules and is nonetheless correct here: the write is idempotent — a
|
|
8190
|
+
* discarded render either wrote a structurally equal value or nothing at all — so
|
|
8191
|
+
* replaying the render cannot change the result.
|
|
7396
8192
|
*/
|
|
7397
8193
|
export declare function useDeepMemo<T>(value: T): T;
|
|
7398
8194
|
|
|
@@ -7669,6 +8465,11 @@ export declare function useInterval(fn: () => void, delay: number | null): void;
|
|
|
7669
8465
|
/**
|
|
7670
8466
|
* Return `true` on the first render of the component and `false` thereafter.
|
|
7671
8467
|
*
|
|
8468
|
+
* Reads *and* flips a ref during render, which the React Compiler rules flag on
|
|
8469
|
+
* sight — here it is the entire hook. Under StrictMode's double render in dev the
|
|
8470
|
+
* second pass already sees `false`, so treat the result as "first committed
|
|
8471
|
+
* render" and not as a strict render counter.
|
|
8472
|
+
*
|
|
7672
8473
|
* @returns Whether the current render is the first one.
|
|
7673
8474
|
*/
|
|
7674
8475
|
export declare function useIsFirstRender(): boolean;
|
|
@@ -7841,6 +8642,76 @@ export declare function useModals(): ModalsApi;
|
|
|
7841
8642
|
|
|
7842
8643
|
export { useNavigate }
|
|
7843
8644
|
|
|
8645
|
+
/**
|
|
8646
|
+
* Client-side inbox state for received notifications.
|
|
8647
|
+
*
|
|
8648
|
+
* Newest first, deduplicated by `id`, capped at `limit`. Pairs with
|
|
8649
|
+
* `NotificationCenter` for the UI and with the `push` module for the source:
|
|
8650
|
+
* point a service worker's `postMessage` at it and a push that arrives while the
|
|
8651
|
+
* app is open shows up in the inbox instead of only as an OS notification.
|
|
8652
|
+
*
|
|
8653
|
+
* Persistence is deliberately left out — where an inbox belongs (server, Dexie,
|
|
8654
|
+
* `localStorage`) is an app decision. Use `onChange` to write it wherever it goes,
|
|
8655
|
+
* and `initialItems` to read it back.
|
|
8656
|
+
*
|
|
8657
|
+
* @example
|
|
8658
|
+
* const inbox = useNotificationInbox({
|
|
8659
|
+
* initialItems: await api.notifications.list(),
|
|
8660
|
+
* onChange: (items) => storage.set("inbox", items),
|
|
8661
|
+
* });
|
|
8662
|
+
*
|
|
8663
|
+
* <NotificationCenter
|
|
8664
|
+
* items={inbox.items}
|
|
8665
|
+
* onMarkRead={inbox.markRead}
|
|
8666
|
+
* onMarkAllRead={inbox.markAllRead}
|
|
8667
|
+
* onDismiss={inbox.remove}
|
|
8668
|
+
* />
|
|
8669
|
+
*/
|
|
8670
|
+
export declare function useNotificationInbox(options?: UseNotificationInboxOptions): UseNotificationInboxResult;
|
|
8671
|
+
|
|
8672
|
+
export declare interface UseNotificationInboxOptions {
|
|
8673
|
+
/** Entries the inbox starts with — typically what the API returned. */
|
|
8674
|
+
initialItems?: readonly NotificationItem[];
|
|
8675
|
+
/**
|
|
8676
|
+
* Listen for `message` events from the service worker and add whatever
|
|
8677
|
+
* arrives. Default `true`.
|
|
8678
|
+
*
|
|
8679
|
+
* This is the missing half of web push: a service worker runs outside the
|
|
8680
|
+
* page and cannot touch React state, so a push that arrives while the app is
|
|
8681
|
+
* open shows an OS notification and then vanishes as far as the UI is
|
|
8682
|
+
* concerned. Have the worker `postMessage` the payload and it lands here.
|
|
8683
|
+
*/
|
|
8684
|
+
listenToServiceWorker?: boolean;
|
|
8685
|
+
/**
|
|
8686
|
+
* Message `type` to accept from the worker. Default `"tempest:notification"`.
|
|
8687
|
+
*
|
|
8688
|
+
* Filtering by type matters because the SW message channel is shared — a
|
|
8689
|
+
* sync-progress ping or a cache-updated notice would otherwise show up in the
|
|
8690
|
+
* user's inbox.
|
|
8691
|
+
*/
|
|
8692
|
+
messageType?: string;
|
|
8693
|
+
/**
|
|
8694
|
+
* Cap on stored entries; the oldest are dropped past it. Default `100`.
|
|
8695
|
+
*
|
|
8696
|
+
* An inbox fed by push grows without bound otherwise, and it lives in memory.
|
|
8697
|
+
*/
|
|
8698
|
+
limit?: number;
|
|
8699
|
+
/** Called whenever the list changes — the hook for persisting it. */
|
|
8700
|
+
onChange?: (items: readonly NotificationItem[]) => void;
|
|
8701
|
+
}
|
|
8702
|
+
|
|
8703
|
+
export declare interface UseNotificationInboxResult {
|
|
8704
|
+
items: NotificationItem[];
|
|
8705
|
+
unreadCount: number;
|
|
8706
|
+
/** Add an entry, or update the existing one with the same id. */
|
|
8707
|
+
add: (item: NotificationItem) => void;
|
|
8708
|
+
markRead: (id: string) => void;
|
|
8709
|
+
markUnread: (id: string) => void;
|
|
8710
|
+
markAllRead: () => void;
|
|
8711
|
+
remove: (id: string) => void;
|
|
8712
|
+
clear: () => void;
|
|
8713
|
+
}
|
|
8714
|
+
|
|
7844
8715
|
/**
|
|
7845
8716
|
* Run an OAuth-callback "exchange" exactly once on mount. Designed for
|
|
7846
8717
|
* `/callback` routes that receive provider redirects and need to swap a
|
|
@@ -8383,10 +9254,126 @@ export declare interface UseSetResult<T> {
|
|
|
8383
9254
|
size: number;
|
|
8384
9255
|
}
|
|
8385
9256
|
|
|
9257
|
+
/**
|
|
9258
|
+
* Drag-to-reorder for a list, with a **keyboard path of equal standing**.
|
|
9259
|
+
*
|
|
9260
|
+
* Pointer events cover mouse, touch and stylus through one code path, and pointer
|
|
9261
|
+
* capture keeps the drag alive when the pointer leaves the item. `Space` picks an
|
|
9262
|
+
* item up, the arrows move it, `Space`/`Enter` drops it and `Escape` cancels —
|
|
9263
|
+
* because a reorder that only works by dragging excludes keyboard users
|
|
9264
|
+
* completely, which is where most drag-and-drop implementations fail.
|
|
9265
|
+
*
|
|
9266
|
+
* The hook owns interaction only: it never mutates your data. `onReorder` fires
|
|
9267
|
+
* once per committed move and you apply it, typically with {@link moveItem}. That
|
|
9268
|
+
* keeps the list a controlled value and avoids a re-render per pointer frame.
|
|
9269
|
+
*
|
|
9270
|
+
* Hit-testing reads the live DOM rects of `[data-sortable-index]` children rather
|
|
9271
|
+
* than assuming a fixed row height, so it works with rows of different sizes.
|
|
9272
|
+
*
|
|
9273
|
+
* A change in `itemCount` cancels an in-flight drag: the list no longer has the
|
|
9274
|
+
* indices the drag was based on, and committing anyway would move the wrong row.
|
|
9275
|
+
*
|
|
9276
|
+
* Note for consumers: the indices and groups are exposed as **state** (so rendering
|
|
9277
|
+
* from them is reactive) and mirrored into refs only so the window-level `pointerup`
|
|
9278
|
+
* listener can read both synchronously. Because the handlers returned by
|
|
9279
|
+
* `getItemProps` close over those mirrors, the React Compiler `refs` rule reports
|
|
9280
|
+
* the *call site* — a component spreading these props may need a file-level
|
|
9281
|
+
* exemption, as `Kanban` documents.
|
|
9282
|
+
*
|
|
9283
|
+
* @example
|
|
9284
|
+
* ```tsx
|
|
9285
|
+
* const [items, setItems] = useState(["Alfa", "Bravo", "Charlie"]);
|
|
9286
|
+
* const sortable = useSortable({
|
|
9287
|
+
* itemCount: items.length,
|
|
9288
|
+
* onReorder: ({ from, to }) => setItems((current) => moveItem(current, from, to)),
|
|
9289
|
+
* });
|
|
9290
|
+
*
|
|
9291
|
+
* <ul {...sortable.getListProps()} aria-label="Prioridade" ref={sortable.setContainer}>
|
|
9292
|
+
* {items.map((item, index) => (
|
|
9293
|
+
* <li key={item} {...sortable.getItemProps(index)}>
|
|
9294
|
+
* {item}
|
|
9295
|
+
* </li>
|
|
9296
|
+
* ))}
|
|
9297
|
+
* </ul>
|
|
9298
|
+
* ```
|
|
9299
|
+
*/
|
|
9300
|
+
export declare function useSortable(options: UseSortableOptions): UseSortableResult;
|
|
9301
|
+
|
|
9302
|
+
export declare interface UseSortableOptions {
|
|
9303
|
+
/**
|
|
9304
|
+
* How many items are in the sortable. Changing it cancels an in-flight drag.
|
|
9305
|
+
*
|
|
9306
|
+
* With groups, pass the **total** across groups: the number only has to change
|
|
9307
|
+
* whenever the indices the drag was based on stop being valid.
|
|
9308
|
+
*/
|
|
9309
|
+
itemCount: number;
|
|
9310
|
+
/**
|
|
9311
|
+
* Called once, when a move is committed — on pointer release or on a keyboard
|
|
9312
|
+
* move. Never called mid-drag, so a controlled list re-renders once instead of
|
|
9313
|
+
* on every pointer frame.
|
|
9314
|
+
*/
|
|
9315
|
+
onReorder: (target: SortableDropTarget) => void;
|
|
9316
|
+
/** Blocks all interaction. */
|
|
9317
|
+
disabled?: boolean;
|
|
9318
|
+
/**
|
|
9319
|
+
* Description announced for each item, so a screen reader user learns the
|
|
9320
|
+
* keyboard contract. Default is in English — override it to localize.
|
|
9321
|
+
*/
|
|
9322
|
+
roleDescription?: string;
|
|
9323
|
+
}
|
|
9324
|
+
|
|
9325
|
+
export declare interface UseSortableResult {
|
|
9326
|
+
/** Index being dragged, or `null` when idle. */
|
|
9327
|
+
activeIndex: number | null;
|
|
9328
|
+
/** Index the item would land on, or `null` when idle. */
|
|
9329
|
+
overIndex: number | null;
|
|
9330
|
+
/** Group the dragged item came from, when using groups. */
|
|
9331
|
+
activeGroup?: string;
|
|
9332
|
+
/** Group the item is currently over, when using groups. */
|
|
9333
|
+
overGroup?: string;
|
|
9334
|
+
/**
|
|
9335
|
+
* Spread on each item. Pass `group` when the sortable spans several lists (a
|
|
9336
|
+
* Kanban column id), so a drop can land in a different group.
|
|
9337
|
+
*/
|
|
9338
|
+
getItemProps: (index: number, group?: string) => SortableItemProps;
|
|
9339
|
+
/**
|
|
9340
|
+
* Spread on an **empty** group's drop area, so an item can be moved into a
|
|
9341
|
+
* column that has no cards yet — hit-testing works off item rects, and a group
|
|
9342
|
+
* with no items has none.
|
|
9343
|
+
*/
|
|
9344
|
+
getEmptyGroupProps: (group: string) => {
|
|
9345
|
+
"data-sortable-group": string;
|
|
9346
|
+
"data-sortable-empty": true;
|
|
9347
|
+
};
|
|
9348
|
+
/** Spread on the list container (`role="listbox"` + a label of your own). */
|
|
9349
|
+
getListProps: () => {
|
|
9350
|
+
role: "listbox";
|
|
9351
|
+
"aria-orientation": "vertical";
|
|
9352
|
+
};
|
|
9353
|
+
/** Abort the current drag without reordering. */
|
|
9354
|
+
cancel: () => void;
|
|
9355
|
+
/**
|
|
9356
|
+
* Callback ref for the element that contains the sortable items — hit-testing
|
|
9357
|
+
* searches inside it.
|
|
9358
|
+
*
|
|
9359
|
+
* Named `setContainer` rather than `ref` because it is a **callback**, not a ref
|
|
9360
|
+
* object: `ref={sortable.setContainer}`. The old name also read as a readable
|
|
9361
|
+
* ref to the React Compiler rules, which flagged every consumer.
|
|
9362
|
+
*/
|
|
9363
|
+
setContainer: (node: HTMLElement | null) => void;
|
|
9364
|
+
}
|
|
9365
|
+
|
|
8386
9366
|
/**
|
|
8387
9367
|
* Returns a stable function reference that always invokes the latest
|
|
8388
9368
|
* `callback` argument. Use to break dependency cycles in effects without
|
|
8389
9369
|
* triggering re-runs when the callback identity changes.
|
|
9370
|
+
*
|
|
9371
|
+
* The assignment happens **during render** on purpose. Moving it into an effect
|
|
9372
|
+
* would satisfy the React Compiler rules but open a one-commit staleness window:
|
|
9373
|
+
* an effect declared before this hook's own effect, in the same commit, would call
|
|
9374
|
+
* the previous render's callback. This is a primitive other hooks build on, so a
|
|
9375
|
+
* subtle staleness here is worse than the rule violation. Prefer React's
|
|
9376
|
+
* `useEffectEvent` once it ships as stable.
|
|
8390
9377
|
*/
|
|
8391
9378
|
export declare function useStableCallback<TArgs extends unknown[], TReturn>(callback: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
8392
9379
|
|
|
@@ -8635,6 +9622,95 @@ export declare interface VirtualListProps<T> {
|
|
|
8635
9622
|
style?: CSSProperties;
|
|
8636
9623
|
}
|
|
8637
9624
|
|
|
9625
|
+
/**
|
|
9626
|
+
* A table that stays responsive at 10k+ rows by rendering only the visible window.
|
|
9627
|
+
*
|
|
9628
|
+
* `Table` renders every row it is given and `DataTable` paginates to keep that
|
|
9629
|
+
* count small; neither has an answer for "show me all 40 000 rows in one
|
|
9630
|
+
* scrollable grid". This does, at the cost of one constraint: **`rowHeight` must
|
|
9631
|
+
* be uniform**, since mapping a scroll offset to a row index is what makes the
|
|
9632
|
+
* window computable without measuring anything.
|
|
9633
|
+
*
|
|
9634
|
+
* It stays a real `<table>`. The window is produced by two spacer rows — one
|
|
9635
|
+
* above the visible slice, one below — instead of absolutely positioning rows.
|
|
9636
|
+
* That is deliberate: `position: absolute` on `<tr>` collapses table layout, so
|
|
9637
|
+
* every column width would have to be computed by hand, and the element would
|
|
9638
|
+
* stop being a table for assistive technology. With spacer rows the browser keeps
|
|
9639
|
+
* doing column layout and screen readers keep announcing a grid.
|
|
9640
|
+
*
|
|
9641
|
+
* Because only a slice is in the DOM, `aria-rowcount` on the table and
|
|
9642
|
+
* `aria-rowindex` on each row carry the real numbers — without them a screen
|
|
9643
|
+
* reader announces "row 3 of 20" while the user is on row 5003 of 40 000.
|
|
9644
|
+
*
|
|
9645
|
+
* @example
|
|
9646
|
+
* <VirtualTable
|
|
9647
|
+
* data={rows}
|
|
9648
|
+
* columns={[
|
|
9649
|
+
* { key: "id", header: "#", width: 80, sortable: true },
|
|
9650
|
+
* { key: "name", header: "Nome", width: 240, sortable: true },
|
|
9651
|
+
* { key: "total", header: "Total", align: "right", width: 120, sortable: true },
|
|
9652
|
+
* ]}
|
|
9653
|
+
* rowHeight={40}
|
|
9654
|
+
* height={480}
|
|
9655
|
+
* rowKey={(row) => row.id}
|
|
9656
|
+
* />
|
|
9657
|
+
*/
|
|
9658
|
+
export declare function VirtualTable<T>({ data, columns, rowHeight, height, overscan, rowKey, initialSort, onRowClick, emptyMessage, caption, scrollToIndex, className, ...rest }: VirtualTableProps<T>): JSX.Element;
|
|
9659
|
+
|
|
9660
|
+
export declare interface VirtualTableColumn<T> {
|
|
9661
|
+
/** Property of the row this column reads from. Doubles as the cell key. */
|
|
9662
|
+
key: keyof T;
|
|
9663
|
+
/** Column heading. */
|
|
9664
|
+
header: ReactNode;
|
|
9665
|
+
/** Custom cell renderer. Defaults to `row[key]`. */
|
|
9666
|
+
render?: (row: T, index: number) => ReactNode;
|
|
9667
|
+
/** Enable click-to-sort on this column's header. */
|
|
9668
|
+
sortable?: boolean;
|
|
9669
|
+
/** Text alignment. */
|
|
9670
|
+
align?: TableAlign;
|
|
9671
|
+
/**
|
|
9672
|
+
* Column width. Recommended for every column: virtualized rows enter and
|
|
9673
|
+
* leave the DOM as you scroll, so letting the browser auto-size columns from
|
|
9674
|
+
* whatever is currently rendered makes them jump mid-scroll.
|
|
9675
|
+
*/
|
|
9676
|
+
width?: string | number;
|
|
9677
|
+
}
|
|
9678
|
+
|
|
9679
|
+
export declare interface VirtualTableProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
9680
|
+
/** Full dataset. Every row is accounted for; only the visible ones render. */
|
|
9681
|
+
data: T[];
|
|
9682
|
+
/** Column definitions. */
|
|
9683
|
+
columns: VirtualTableColumn<T>[];
|
|
9684
|
+
/**
|
|
9685
|
+
* Row height in px. Must be uniform and must match what the CSS produces,
|
|
9686
|
+
* because it is what maps scroll offset to row index.
|
|
9687
|
+
*/
|
|
9688
|
+
rowHeight: number;
|
|
9689
|
+
/** Height of the scroll viewport — a number of px or any CSS length. */
|
|
9690
|
+
height: number | string;
|
|
9691
|
+
/** Rows rendered above and below the viewport. Default `4`. */
|
|
9692
|
+
overscan?: number;
|
|
9693
|
+
/** Stable key extractor. Defaults to the row's index in `data`. */
|
|
9694
|
+
rowKey?: (row: T, index: number) => string | number;
|
|
9695
|
+
/** Sort applied before any header interaction. */
|
|
9696
|
+
initialSort?: VirtualTableSort<T>;
|
|
9697
|
+
/** Called when a row is activated by click, `Enter` or `Space`. */
|
|
9698
|
+
onRowClick?: (row: T, index: number) => void;
|
|
9699
|
+
/** Content shown when `data` is empty. */
|
|
9700
|
+
emptyMessage?: ReactNode;
|
|
9701
|
+
/** Accessible name for the table. Rendered as a visually hidden `<caption>`. */
|
|
9702
|
+
caption?: ReactNode;
|
|
9703
|
+
/** Scroll this row into view whenever it changes. */
|
|
9704
|
+
scrollToIndex?: number;
|
|
9705
|
+
}
|
|
9706
|
+
|
|
9707
|
+
export declare interface VirtualTableSort<T> {
|
|
9708
|
+
key: keyof T;
|
|
9709
|
+
direction: VirtualTableSortDirection;
|
|
9710
|
+
}
|
|
9711
|
+
|
|
9712
|
+
export declare type VirtualTableSortDirection = "asc" | "desc";
|
|
9713
|
+
|
|
8638
9714
|
/**
|
|
8639
9715
|
* Render content that is hidden visually but remains available to screen
|
|
8640
9716
|
* readers — the standard "sr-only" pattern. Useful for accessible labels on
|
|
@@ -9067,6 +10143,115 @@ export declare type WithSelectors<S> = S extends {
|
|
|
9067
10143
|
*/
|
|
9068
10144
|
export declare function withTimeout<T>(promise: Promise<T>, ms: number, message?: string): Promise<T>;
|
|
9069
10145
|
|
|
10146
|
+
/**
|
|
10147
|
+
* Multi-step flow: step indicator, one body at a time, and navigation that
|
|
10148
|
+
* respects per-step validation.
|
|
10149
|
+
*
|
|
10150
|
+
* `Stepper` draws the indicator; this owns the part every app was rewriting — the
|
|
10151
|
+
* active index, the async gate before advancing, the disabled/pending buttons and
|
|
10152
|
+
* the completion call.
|
|
10153
|
+
*
|
|
10154
|
+
* Only the active step's body is mounted. Uncommitted input in a step you leave is
|
|
10155
|
+
* therefore lost unless the state lives outside (react-hook-form's `FormProvider`,
|
|
10156
|
+
* a store, a parent `useState`) — which is the right place for it anyway, since
|
|
10157
|
+
* the last step usually needs to submit everything at once.
|
|
10158
|
+
*
|
|
10159
|
+
* @example
|
|
10160
|
+
* ```tsx
|
|
10161
|
+
* const form = useZodForm(schema);
|
|
10162
|
+
*
|
|
10163
|
+
* <FormProvider {...form}>
|
|
10164
|
+
* <Wizard
|
|
10165
|
+
* steps={[
|
|
10166
|
+
* {
|
|
10167
|
+
* id: "dados",
|
|
10168
|
+
* label: "Dados",
|
|
10169
|
+
* validate: () => form.trigger(["nome", "email"]),
|
|
10170
|
+
* content: (
|
|
10171
|
+
* <>
|
|
10172
|
+
* <FormField name="nome" label="Nome"><Input /></FormField>
|
|
10173
|
+
* <FormField name="email" label="E-mail"><Input type="email" /></FormField>
|
|
10174
|
+
* </>
|
|
10175
|
+
* ),
|
|
10176
|
+
* },
|
|
10177
|
+
* { id: "revisao", label: "Revisão", content: <Review /> },
|
|
10178
|
+
* ]}
|
|
10179
|
+
* onComplete={form.handleSubmit(onSubmit)}
|
|
10180
|
+
* />
|
|
10181
|
+
* </FormProvider>
|
|
10182
|
+
* ```
|
|
10183
|
+
*/
|
|
10184
|
+
export declare function Wizard({ steps, activeIndex, defaultActiveIndex, onStepChange, onComplete, nextLabel, backLabel, finishLabel, optionalLabel, clickableSteps, renderActions, className, }: WizardProps): JSX.Element;
|
|
10185
|
+
|
|
10186
|
+
/** Flow controls handed to a step body and to `renderActions`. */
|
|
10187
|
+
export declare interface WizardControls {
|
|
10188
|
+
/** Zero-based index of the current step. */
|
|
10189
|
+
activeIndex: number;
|
|
10190
|
+
/** The current step. */
|
|
10191
|
+
step: WizardStep;
|
|
10192
|
+
/** `true` while a `validate` promise is pending. */
|
|
10193
|
+
validating: boolean;
|
|
10194
|
+
isFirst: boolean;
|
|
10195
|
+
isLast: boolean;
|
|
10196
|
+
/** Run the current step's `validate` and advance when it passes. */
|
|
10197
|
+
next: () => Promise<void>;
|
|
10198
|
+
/** Go back one step. No validation — going back never blocks. */
|
|
10199
|
+
back: () => void;
|
|
10200
|
+
/** Jump to an index. Forward jumps validate every step in between. */
|
|
10201
|
+
goTo: (index: number) => Promise<void>;
|
|
10202
|
+
}
|
|
10203
|
+
|
|
10204
|
+
export declare interface WizardProps {
|
|
10205
|
+
steps: WizardStep[];
|
|
10206
|
+
/** Controlled active index. */
|
|
10207
|
+
activeIndex?: number;
|
|
10208
|
+
/** Uncontrolled initial index. Default `0`. */
|
|
10209
|
+
defaultActiveIndex?: number;
|
|
10210
|
+
onStepChange?: (index: number, step: WizardStep) => void;
|
|
10211
|
+
/** Called when the last step passes validation. */
|
|
10212
|
+
onComplete?: () => void | Promise<void>;
|
|
10213
|
+
/** Label of the advance button. Default `"Next"`. */
|
|
10214
|
+
nextLabel?: string;
|
|
10215
|
+
/** Label of the back button. Default `"Back"`. */
|
|
10216
|
+
backLabel?: string;
|
|
10217
|
+
/** Label of the button on the last step. Default `"Finish"`. */
|
|
10218
|
+
finishLabel?: string;
|
|
10219
|
+
/**
|
|
10220
|
+
* Suffix appended to an optional step's description in the indicator.
|
|
10221
|
+
* Default `"(optional)"` — override it to localize, since the SDK ships no
|
|
10222
|
+
* translation for component-internal copy.
|
|
10223
|
+
*/
|
|
10224
|
+
optionalLabel?: string;
|
|
10225
|
+
/**
|
|
10226
|
+
* Allow clicking the indicator to jump. Default `false` — a wizard exists
|
|
10227
|
+
* because order matters, and a free jump skips the gates.
|
|
10228
|
+
*/
|
|
10229
|
+
clickableSteps?: boolean;
|
|
10230
|
+
/** Replace the default button row. */
|
|
10231
|
+
renderActions?: (controls: WizardControls) => ReactNode;
|
|
10232
|
+
className?: string;
|
|
10233
|
+
}
|
|
10234
|
+
|
|
10235
|
+
/** One step of the flow. */
|
|
10236
|
+
export declare interface WizardStep {
|
|
10237
|
+
/** Stable identifier. */
|
|
10238
|
+
id: string;
|
|
10239
|
+
/** Step label shown in the indicator. */
|
|
10240
|
+
label: string;
|
|
10241
|
+
/** Optional description under the label. */
|
|
10242
|
+
description?: string;
|
|
10243
|
+
/** Step body. A function receives the flow controls, for a "skip" link inside the form. */
|
|
10244
|
+
content: ReactNode | ((controls: WizardControls) => ReactNode);
|
|
10245
|
+
/**
|
|
10246
|
+
* Gate for leaving this step forward. Return `false` (or a rejected/`false`
|
|
10247
|
+
* promise) to keep the user here — typically `() => form.trigger()`.
|
|
10248
|
+
* Async is supported: the Next button shows a pending state while it runs.
|
|
10249
|
+
*/
|
|
10250
|
+
validate?: () => boolean | Promise<boolean>;
|
|
10251
|
+
/** Marks the step as optional, so `onComplete` can ignore it. */
|
|
10252
|
+
optional?: boolean;
|
|
10253
|
+
}
|
|
10254
|
+
|
|
9070
10255
|
/**
|
|
9071
10256
|
* Write a minimal single-sheet Office Open XML (`.xlsx`) workbook and return
|
|
9072
10257
|
* its bytes. No extra dependency beyond `fflate` — the archive is assembled and
|