tempest-react-sdk 0.25.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 +14 -1
- 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/palette.cjs +1 -1
- package/dist/charts/palette.cjs.map +1 -1
- package/dist/charts/palette.js +2 -2
- package/dist/charts/palette.js.map +1 -1
- package/dist/charts.d.ts +5 -3
- 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/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/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/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 +1 -1
- package/dist/components/Wizard/Wizard.cjs.map +1 -1
- package/dist/components/Wizard/Wizard.js +53 -53
- package/dist/components/Wizard/Wizard.js.map +1 -1
- 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/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 +585 -3
- package/dist/tempest-react-sdk.js +189 -183
- 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/color.cjs +1 -1
- package/dist/theme/color.cjs.map +1 -1
- package/dist/theme/color.js +77 -46
- package/dist/theme/color.js.map +1 -1
- package/dist/theme/create-theme.cjs +1 -1
- package/dist/theme/create-theme.cjs.map +1 -1
- package/dist/theme/create-theme.js +9 -3
- package/dist/theme/create-theme.js.map +1 -1
- 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 +12 -3
- package/template/package.json +1 -1
|
@@ -79,186 +79,192 @@ import { useInstallPrompt as Me } from "./hooks/use-install-prompt.js";
|
|
|
79
79
|
import { registerServiceWorker as Ne, skipWaiting as Pe, unregisterAllServiceWorkers as Fe } from "./sw/register-service-worker.js";
|
|
80
80
|
import { useServiceWorkerUpdate as Ie } from "./hooks/use-service-worker-update.js";
|
|
81
81
|
import { estimateStorage as Le, requestPersistentStorage as Re, useStorageEstimate as ze } from "./hooks/use-storage-estimate.js";
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import { relativeTime as
|
|
123
|
-
import {
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
130
|
-
import {
|
|
131
|
-
import {
|
|
132
|
-
import {
|
|
133
|
-
import {
|
|
134
|
-
import {
|
|
135
|
-
import {
|
|
136
|
-
import {
|
|
137
|
-
import {
|
|
138
|
-
import {
|
|
139
|
-
import {
|
|
140
|
-
import {
|
|
141
|
-
import {
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
144
|
-
import {
|
|
145
|
-
import {
|
|
146
|
-
import {
|
|
147
|
-
import {
|
|
148
|
-
import {
|
|
149
|
-
import {
|
|
150
|
-
import {
|
|
151
|
-
import {
|
|
152
|
-
import {
|
|
153
|
-
import {
|
|
154
|
-
import {
|
|
155
|
-
import {
|
|
156
|
-
import {
|
|
157
|
-
import {
|
|
158
|
-
import {
|
|
159
|
-
import {
|
|
160
|
-
import {
|
|
161
|
-
import {
|
|
162
|
-
import {
|
|
163
|
-
import {
|
|
164
|
-
import {
|
|
165
|
-
import {
|
|
166
|
-
import {
|
|
167
|
-
import {
|
|
168
|
-
import {
|
|
169
|
-
import {
|
|
170
|
-
import {
|
|
171
|
-
import {
|
|
172
|
-
import {
|
|
173
|
-
import {
|
|
174
|
-
import {
|
|
175
|
-
import {
|
|
176
|
-
import {
|
|
177
|
-
import {
|
|
178
|
-
import {
|
|
179
|
-
import {
|
|
180
|
-
import {
|
|
181
|
-
import {
|
|
182
|
-
import {
|
|
183
|
-
import {
|
|
184
|
-
import {
|
|
185
|
-
import {
|
|
186
|
-
import {
|
|
187
|
-
import {
|
|
188
|
-
import {
|
|
189
|
-
import {
|
|
190
|
-
import {
|
|
191
|
-
import {
|
|
192
|
-
import {
|
|
193
|
-
import {
|
|
194
|
-
import {
|
|
195
|
-
import {
|
|
196
|
-
import {
|
|
197
|
-
import {
|
|
198
|
-
import {
|
|
199
|
-
import {
|
|
200
|
-
import {
|
|
201
|
-
import {
|
|
202
|
-
import {
|
|
203
|
-
import {
|
|
204
|
-
import {
|
|
205
|
-
import {
|
|
206
|
-
import {
|
|
207
|
-
import {
|
|
208
|
-
import {
|
|
209
|
-
import {
|
|
210
|
-
import {
|
|
211
|
-
import {
|
|
212
|
-
import {
|
|
213
|
-
import {
|
|
214
|
-
import {
|
|
215
|
-
import {
|
|
216
|
-
import {
|
|
217
|
-
import {
|
|
218
|
-
import {
|
|
219
|
-
import {
|
|
220
|
-
import {
|
|
221
|
-
import {
|
|
222
|
-
import {
|
|
223
|
-
import {
|
|
224
|
-
import {
|
|
225
|
-
import {
|
|
226
|
-
import {
|
|
227
|
-
import {
|
|
228
|
-
import {
|
|
229
|
-
import {
|
|
230
|
-
import {
|
|
231
|
-
import {
|
|
232
|
-
import {
|
|
233
|
-
import {
|
|
234
|
-
import {
|
|
235
|
-
import {
|
|
236
|
-
import {
|
|
237
|
-
import {
|
|
238
|
-
import {
|
|
239
|
-
import {
|
|
240
|
-
import {
|
|
241
|
-
import {
|
|
242
|
-
import {
|
|
243
|
-
import {
|
|
244
|
-
import {
|
|
245
|
-
import {
|
|
246
|
-
import {
|
|
247
|
-
import {
|
|
248
|
-
import {
|
|
249
|
-
import {
|
|
250
|
-
import {
|
|
251
|
-
import {
|
|
252
|
-
import {
|
|
253
|
-
import {
|
|
254
|
-
import {
|
|
255
|
-
import {
|
|
256
|
-
import {
|
|
257
|
-
import {
|
|
258
|
-
import {
|
|
259
|
-
import {
|
|
260
|
-
import {
|
|
261
|
-
import {
|
|
262
|
-
import {
|
|
263
|
-
import {
|
|
264
|
-
|
|
82
|
+
import { moveItem as Be, useSortable as Ve } from "./hooks/use-sortable.js";
|
|
83
|
+
import { OfflineIndicator as He } from "./components/OfflineIndicator/OfflineIndicator.js";
|
|
84
|
+
import { useOfflineSync as Ue, useSyncStatus as We } from "./offline/use-offline-sync.js";
|
|
85
|
+
import { SyncStatusBadge as Ge } from "./components/SyncStatusBadge/SyncStatusBadge.js";
|
|
86
|
+
import { UpdatePrompt as Ke } from "./components/UpdatePrompt/UpdatePrompt.js";
|
|
87
|
+
import { Kanban as qe, applyKanbanMove as Je } from "./components/Kanban/Kanban.js";
|
|
88
|
+
import { Kbd as Ye } from "./components/Kbd/Kbd.js";
|
|
89
|
+
import { ModalsProvider as Xe, useModals as Ze } from "./components/ModalsManager/ModalsManager.js";
|
|
90
|
+
import { Navbar as Qe } from "./components/Navbar/Navbar.js";
|
|
91
|
+
import { NProgressBar as $e, nprogress as et } from "./components/NProgress/NProgress.js";
|
|
92
|
+
import { Page as tt } from "./components/Page/Page.js";
|
|
93
|
+
import { Pagination as nt } from "./components/Pagination/Pagination.js";
|
|
94
|
+
import { PasswordInput as rt, estimatePasswordStrength as it } from "./components/PasswordInput/PasswordInput.js";
|
|
95
|
+
import { PinInput as at } from "./components/PinInput/PinInput.js";
|
|
96
|
+
import { Popover as ot } from "./components/Popover/Popover.js";
|
|
97
|
+
import { Progress as st } from "./components/Progress/Progress.js";
|
|
98
|
+
import { Radio as ct, RadioGroup as lt } from "./components/Radio/Radio.js";
|
|
99
|
+
import { RangeSlider as ut } from "./components/RangeSlider/RangeSlider.js";
|
|
100
|
+
import { RatingStars as dt } from "./components/RatingStars/RatingStars.js";
|
|
101
|
+
import { Hide as ft, Show as pt } from "./components/Responsive/Responsive.js";
|
|
102
|
+
import { SafeArea as mt } from "./components/SafeArea/SafeArea.js";
|
|
103
|
+
import { SearchBar as ht } from "./components/SearchBar/SearchBar.js";
|
|
104
|
+
import { SegmentedControl as gt } from "./components/SegmentedControl/SegmentedControl.js";
|
|
105
|
+
import { Select as _t } from "./components/Select/Select.js";
|
|
106
|
+
import { Sidebar as vt } from "./components/Sidebar/Sidebar.js";
|
|
107
|
+
import { Skeleton as yt } from "./components/Skeleton/Skeleton.js";
|
|
108
|
+
import { Spacer as bt } from "./components/Spacer/Spacer.js";
|
|
109
|
+
import { Spinner as xt } from "./components/Spinner/Spinner.js";
|
|
110
|
+
import { Stat as St } from "./components/Stat/Stat.js";
|
|
111
|
+
import { Stepper as Ct } from "./components/Stepper/Stepper.js";
|
|
112
|
+
import { clamp as wt, formatBytes as Tt, formatCompactNumber as Et } from "./utils/numbers.js";
|
|
113
|
+
import { StepperInput as Dt } from "./components/StepperInput/StepperInput.js";
|
|
114
|
+
import { Switch as Ot } from "./components/Switch/Switch.js";
|
|
115
|
+
import { Tag as kt } from "./components/Tag/Tag.js";
|
|
116
|
+
import { Table as At } from "./components/Table/Table.js";
|
|
117
|
+
import { Tabs as jt } from "./components/Tabs/Tabs.js";
|
|
118
|
+
import { Textarea as Mt } from "./components/Textarea/Textarea.js";
|
|
119
|
+
import { Timeline as Nt } from "./components/Timeline/Timeline.js";
|
|
120
|
+
import { Tooltip as Pt } from "./components/Tooltip/Tooltip.js";
|
|
121
|
+
import { ToastProvider as Ft, useToast as It } from "./components/Toast/ToastProvider.js";
|
|
122
|
+
import { relativeTime as Lt } from "./utils/relative-time.js";
|
|
123
|
+
import { NotificationCenter as Rt } from "./components/NotificationCenter/NotificationCenter.js";
|
|
124
|
+
import { useNotificationInbox as zt } from "./components/NotificationCenter/use-notification-inbox.js";
|
|
125
|
+
import { VirtualList as Bt } from "./components/VirtualList/VirtualList.js";
|
|
126
|
+
import { compareValues as Vt } from "./utils/compare-values.js";
|
|
127
|
+
import { VirtualTable as Ht } from "./components/VirtualTable/VirtualTable.js";
|
|
128
|
+
import { CopyButton as Ut } from "./components/CopyButton/CopyButton.js";
|
|
129
|
+
import { RelativeTime as Wt } from "./components/RelativeTime/RelativeTime.js";
|
|
130
|
+
import { Money as Gt } from "./components/Money/Money.js";
|
|
131
|
+
import { TreeView as Kt } from "./components/TreeView/TreeView.js";
|
|
132
|
+
import { TruncateText as qt } from "./components/TruncateText/TruncateText.js";
|
|
133
|
+
import { VisuallyHidden as Jt } from "./components/VisuallyHidden/VisuallyHidden.js";
|
|
134
|
+
import { Portal as Yt } from "./components/Portal/Portal.js";
|
|
135
|
+
import { ClickOutside as Xt } from "./components/ClickOutside/ClickOutside.js";
|
|
136
|
+
import { ConditionalWrapper as Zt } from "./components/ConditionalWrapper/ConditionalWrapper.js";
|
|
137
|
+
import { For as Qt } from "./components/For/For.js";
|
|
138
|
+
import { ErrorText as $t } from "./components/ErrorText/ErrorText.js";
|
|
139
|
+
import { Image as en } from "./components/Image/Image.js";
|
|
140
|
+
import { DataList as tn } from "./components/DataList/DataList.js";
|
|
141
|
+
import { DescriptionList as nn } from "./components/DescriptionList/DescriptionList.js";
|
|
142
|
+
import { Toggle as rn } from "./components/Toggle/Toggle.js";
|
|
143
|
+
import { ToggleGroup as an, ToggleGroupItem as on } from "./components/ToggleGroup/ToggleGroup.js";
|
|
144
|
+
import { Label as sn } from "./components/Label/Label.js";
|
|
145
|
+
import { Collapsible as cn } from "./components/Collapsible/Collapsible.js";
|
|
146
|
+
import { ContextMenu as ln } from "./components/ContextMenu/ContextMenu.js";
|
|
147
|
+
import { HoverCard as un } from "./components/HoverCard/HoverCard.js";
|
|
148
|
+
import { Command as dn } from "./components/Command/Command.js";
|
|
149
|
+
import { ScrollArea as fn } from "./components/ScrollArea/ScrollArea.js";
|
|
150
|
+
import { Resizable as pn } from "./components/Resizable/Resizable.js";
|
|
151
|
+
import { Calendar as mn } from "./components/Calendar/Calendar.js";
|
|
152
|
+
import { Slider as hn } from "./components/Slider/Slider.js";
|
|
153
|
+
import { MultiSelect as gn } from "./components/MultiSelect/MultiSelect.js";
|
|
154
|
+
import { DateRangePicker as _n } from "./components/DateRangePicker/DateRangePicker.js";
|
|
155
|
+
import { NavigationMenu as vn } from "./components/NavigationMenu/NavigationMenu.js";
|
|
156
|
+
import { Menubar as yn } from "./components/Menubar/Menubar.js";
|
|
157
|
+
import { Carousel as bn } from "./components/Carousel/Carousel.js";
|
|
158
|
+
import { DataTable as xn } from "./components/DataTable/DataTable.js";
|
|
159
|
+
import { ListTile as Sn } from "./components/ListTile/ListTile.js";
|
|
160
|
+
import { FloatingActionButton as Cn } from "./components/FloatingActionButton/FloatingActionButton.js";
|
|
161
|
+
import { NavigationRail as wn } from "./components/NavigationRail/NavigationRail.js";
|
|
162
|
+
import { TimePicker as Tn } from "./components/TimePicker/TimePicker.js";
|
|
163
|
+
import { RefreshIndicator as En } from "./components/RefreshIndicator/RefreshIndicator.js";
|
|
164
|
+
import { Wizard as Dn } from "./components/Wizard/Wizard.js";
|
|
165
|
+
import { Lightbox as On } from "./components/Lightbox/Lightbox.js";
|
|
166
|
+
import { SignaturePad as kn } from "./components/SignaturePad/SignaturePad.js";
|
|
167
|
+
import { formatCPF as An, formatCurrency as jn, formatDate as Mn, formatDateTime as Nn, formatPercent as Pn, formatPhone as Fn } from "./utils/format.js";
|
|
168
|
+
import { storage as In } from "./utils/storage.js";
|
|
169
|
+
import { camelCase as Ln, capitalize as Rn, kebabCase as zn, pluralize as Bn, slugify as Vn, truncate as Hn } from "./utils/strings.js";
|
|
170
|
+
import { chunk as Un, groupBy as Wn, range as Gn, uniqueBy as Kn } from "./utils/arrays.js";
|
|
171
|
+
import { deepMerge as qn, isEmpty as Jn, omit as Yn, pick as Xn } from "./utils/objects.js";
|
|
172
|
+
import { assertNever as Zn, isDefined as Qn, isNumber as $n, isPlainObject as er, isString as tr } from "./utils/guards.js";
|
|
173
|
+
import { debounce as nr, memoizeOne as rr, once as ir, throttle as ar } from "./utils/functions.js";
|
|
174
|
+
import { sleep as or, withTimeout as sr } from "./utils/promises.js";
|
|
175
|
+
import { randomId as cr } from "./utils/ids.js";
|
|
176
|
+
import { writeXlsx as lr } from "./utils/xlsx.js";
|
|
177
|
+
import { TempestApiError as ur, buildApiError as dr, isApiError as fr } from "./http/errors.js";
|
|
178
|
+
import { createApiClient as pr } from "./http/api-client.js";
|
|
179
|
+
import { parseResponse as mr } from "./http/parse-response.js";
|
|
180
|
+
import { uploadWithProgress as hr } from "./http/upload-with-progress.js";
|
|
181
|
+
import { retry as gr } from "./http/retry.js";
|
|
182
|
+
import { generateIdempotencyKey as _r } from "./http/idempotency.js";
|
|
183
|
+
import { usePoll as vr } from "./http/use-poll.js";
|
|
184
|
+
import { createAuthStore as yr } from "./auth/create-auth-store.js";
|
|
185
|
+
import { AuthGuard as br } from "./auth/AuthGuard.js";
|
|
186
|
+
import { decodeJWT as xr, isJWTExpired as Sr } from "./auth/jwt.js";
|
|
187
|
+
import { lazyWithRetry as Cr } from "./auth/lazy-with-retry.js";
|
|
188
|
+
import { createRefreshQueue as wr } from "./auth/refresh-queue.js";
|
|
189
|
+
import { createTempestAuth as Tr } from "./auth/create-tempest-auth.js";
|
|
190
|
+
import { AccessControlProvider as Er, useAccessControl as Dr } from "./access/access-control-context.js";
|
|
191
|
+
import { useCan as Or } from "./access/use-can.js";
|
|
192
|
+
import { Can as kr } from "./access/Can.js";
|
|
193
|
+
import { createRoleAccessControl as Ar } from "./access/create-role-access-control.js";
|
|
194
|
+
import { permissionsFromToken as jr } from "./access/permissions-from-token.js";
|
|
195
|
+
import { GoogleSignIn as Mr } from "./oauth/GoogleSignIn.js";
|
|
196
|
+
import { useOAuthCallback as Nr } from "./oauth/use-oauth-callback.js";
|
|
197
|
+
import { CACHE_TIME as Pr, REFETCH_TIME as Fr, STALE_TIME as Ir } from "./query/constants.js";
|
|
198
|
+
import { createQueryKeys as Lr } from "./query/create-query-keys.js";
|
|
199
|
+
import { QueryProvider as Rr } from "./query/QueryProvider.js";
|
|
200
|
+
import { emptyOffsetPage as zr, isCursorPage as Br, isOffsetPage as Vr } from "./query/pagination.js";
|
|
201
|
+
import { usePaginatedQuery as Hr } from "./query/use-paginated-query.js";
|
|
202
|
+
import { useCursorQuery as Ur } from "./query/use-cursor-query.js";
|
|
203
|
+
import { useOfflineMutation as Wr } from "./query/use-offline-mutation.js";
|
|
204
|
+
import { removeById as Gr, upsertById as Kr } from "./query/optimistic.js";
|
|
205
|
+
import { createOfflineStore as qr } from "./offline/create-offline-store.js";
|
|
206
|
+
import { persistQueryClientOffline as Jr } from "./query/offline-persistence.js";
|
|
207
|
+
import { createDataProvider as Yr } from "./data/create-data-provider.js";
|
|
208
|
+
import { TempestDataProvider as Xr, useDataProvider as Zr } from "./data/data-provider-context.js";
|
|
209
|
+
import { listQueryKey as Qr, oneQueryKey as $r, useCreate as ei, useDelete as ti, useList as ni, useOne as ri, useUpdate as ii } from "./data/use-resource.js";
|
|
210
|
+
import { RouteGuard as ai } from "./router/RouteGuard.js";
|
|
211
|
+
import { AppRouter as oi, defineRoutes as si } from "./router/AppRouter.js";
|
|
212
|
+
import { BrowserRouter as ci, HashRouter as li, Link as ui, MemoryRouter as di, NavLink as fi, Navigate as pi, Outlet as mi, Route as hi, Routes as gi, redirect as _i, useLocation as vi, useMatch as yi, useNavigate as bi, useParams as xi, useRouteError as Si, useSearchParams as Ci } from "./router/index.js";
|
|
213
|
+
import { createStore as wi } from "./store/create-store.js";
|
|
214
|
+
import { createSelectors as Ti } from "./store/create-selectors.js";
|
|
215
|
+
import { ThemeProvider as Ei, useTheme as Di } from "./theme/ThemeProvider.js";
|
|
216
|
+
import { createI18n as Oi } from "./i18n/create-i18n.js";
|
|
217
|
+
import { I18nProvider as ki, useI18n as Ai, useTranslate as ji } from "./i18n/I18nProvider.js";
|
|
218
|
+
import { ErrorBoundary as Mi } from "./error-boundary/ErrorBoundary.js";
|
|
219
|
+
import { AppProviders as Ni } from "./app/AppProviders.js";
|
|
220
|
+
import { createEventStream as Pi } from "./sse/create-event-stream.js";
|
|
221
|
+
import { useEventStream as Fi } from "./sse/use-event-stream.js";
|
|
222
|
+
import { isPushSupported as Ii, urlBase64ToUint8Array as Li } from "./push/utils.js";
|
|
223
|
+
import { WebPushClient as Ri, WebPushPermissionDeniedError as zi, WebPushUnsupportedError as Bi } from "./push/web-push-client.js";
|
|
224
|
+
import { usePushSubscription as Vi } from "./push/use-push-subscription.js";
|
|
225
|
+
import { installNotificationClickHandler as Hi, installPushHandler as Ui, installSkipWaitingListener as Wi } from "./sw/create-push-handler.js";
|
|
226
|
+
import { createPartialResponse as Gi, installPrecache as Ki, installRuntimeCache as qi } from "./sw/cache.js";
|
|
227
|
+
import { installBackgroundSync as Ji } from "./sw/background-sync.js";
|
|
228
|
+
import { registerPeriodicSync as Yi } from "./sw/periodic-sync.js";
|
|
229
|
+
import { clearCaches as Xi, inspectCaches as Zi } from "./sw/cache-inspect.js";
|
|
230
|
+
import { createAudioPlayer as Qi, playAudio as $i, stopAudio as ea } from "./audio/audio-player.js";
|
|
231
|
+
import { useAudio as ta } from "./audio/use-audio.js";
|
|
232
|
+
import { createOfflineSync as na } from "./offline/create-offline-sync.js";
|
|
233
|
+
import { higherVersionWins as ra, lastWriteWins as ia } from "./offline/conflict.js";
|
|
234
|
+
import { useErrorHandler as aa } from "./error-boundary/use-error-handler.js";
|
|
235
|
+
import { FormField as oa } from "./forms/FormField.js";
|
|
236
|
+
import { validateForm as sa } from "./forms/validate-form.js";
|
|
237
|
+
import { zodResolver as ca } from "./forms/zod-resolver.js";
|
|
238
|
+
import { useZodForm as la } from "./forms/use-zod-form.js";
|
|
239
|
+
import { formatCEP as ua, formatCNPJ as da, unmask as fa, validateCNPJ as pa, validateCPF as ma } from "./forms/br-validators.js";
|
|
240
|
+
import { CEPInput as ha, CNPJInput as ga, CPFInput as _a, MoneyInput as va, PhoneInput as ya } from "./forms/masked-inputs.js";
|
|
241
|
+
import { useViaCEP as ba } from "./forms/use-viacep.js";
|
|
242
|
+
import { Controller as xa, FormProvider as Sa, useFieldArray as Ca, useForm as wa, useFormContext as Ta, useFormState as Ea, useWatch as Da } from "./forms/index.js";
|
|
243
|
+
import { createWebSocket as Oa } from "./ws/create-web-socket.js";
|
|
244
|
+
import { useWebSocket as ka } from "./ws/use-web-socket.js";
|
|
245
|
+
import { clampLatitude as Aa, isCoordinate as ja, isValidLatitude as Ma, isValidLongitude as Na, normalizeLongitude as Pa } from "./geo/types.js";
|
|
246
|
+
import { EARTH_RADIUS_KM as Fa, bearingDeg as Ia, haversineKm as La, pathLengthKm as Ra, toRadians as za } from "./geo/distance.js";
|
|
247
|
+
import { DEFAULT_CAR_SPEED_KMH as Ba, DEFAULT_CIRCUITY_FACTOR as Va, DEFAULT_MODE_DURATION_FACTORS as Ha, durationFactor as Ua, estimateTravel as Wa } from "./geo/estimate.js";
|
|
248
|
+
import { boundingBox as Ga, boundsCenter as Ka, expandBounds as qa } from "./geo/bounds.js";
|
|
249
|
+
import { MERCATOR_MAX_LATITUDE as Ja, fitProjection as Ya, projectMercator as Xa, unprojectMercator as Za } from "./geo/projection.js";
|
|
250
|
+
import { createOSRMBackend as Qa } from "./geo/routing.js";
|
|
251
|
+
import { createPositionTracker as $a } from "./geo/create-position-tracker.js";
|
|
252
|
+
import { usePositionTracker as eo } from "./geo/use-position-tracker.js";
|
|
253
|
+
import { TrajectoryMap as to } from "./geo/TrajectoryMap.js";
|
|
254
|
+
import { THEME_STYLE_ID as no, applyTheme as ro, readThemeToken as io } from "./theme/apply-theme.js";
|
|
255
|
+
import { contrastRatio as ao, createColorScale as oo, hexToOklch as so, hexToRgb as co, hexToRgbaString as lo, oklchToHex as uo, readableForeground as fo, relativeLuminance as po, rgbToHex as mo } from "./theme/color.js";
|
|
256
|
+
import { createTheme as ho, themeContrast as go } from "./theme/create-theme.js";
|
|
257
|
+
import { getThemePreset as _o, themePresets as vo } from "./theme/theme-presets.js";
|
|
258
|
+
import { getInitialTheme as yo, themeInitScript as bo } from "./theme/initial-theme.js";
|
|
259
|
+
import { consoleSink as xo, createLogger as So } from "./logger/logger.js";
|
|
260
|
+
import { TelemetryProvider as Co, useTelemetry as wo } from "./telemetry/TelemetryProvider.js";
|
|
261
|
+
import { consoleTelemetryAdapter as To } from "./telemetry/console-adapter.js";
|
|
262
|
+
import { createSentryTelemetryAdapter as Eo } from "./telemetry/sentry-adapter.js";
|
|
263
|
+
import { createPostHogTelemetryAdapter as Do } from "./telemetry/posthog-adapter.js";
|
|
264
|
+
import { FeatureFlagsProvider as Oo, useFeatureFlag as ko, useFlagValue as Ao } from "./feature-flags/FeatureFlagsProvider.js";
|
|
265
|
+
import { createInMemoryFlags as jo } from "./feature-flags/in-memory-adapter.js";
|
|
266
|
+
import { createGrowthBookFeatureFlagsAdapter as Mo } from "./feature-flags/growthbook-adapter.js";
|
|
267
|
+
import { createLaunchDarklyFeatureFlagsAdapter as No } from "./feature-flags/launchdarkly-adapter.js";
|
|
268
|
+
import { isShareSupported as Po, share as Fo } from "./share/share.js";
|
|
269
|
+
import { shareOrDownloadBlob as Io } from "./share/share-or-download.js";
|
|
270
|
+
export { Er as AccessControlProvider, t as Accordion, n as Alert, r as AppBar, Ni as AppProviders, oi as AppRouter, o as AppShell, s as AspectRatio, br as AuthGuard, c as Avatar, l as AvatarGroup, i as BREAKPOINTS, u as Badge, d as Banner, f as BottomNavigation, p as BottomSheet, m as Breadcrumbs, ci as BrowserRouter, h as Button, Pr as CACHE_TIME, ha as CEPInput, ga as CNPJInput, _a as CPFInput, mn as Calendar, kr as Can, g as Card, bn as Carousel, _ as Center, v as Checkbox, y as ChipInput, Xt as ClickOutside, cn as Collapsible, b as Combobox, dn as Command, Zt as ConditionalWrapper, S as ConfirmDialog, I as Container, ln as ContextMenu, xa as Controller, Ut as CopyButton, Ba as DEFAULT_CAR_SPEED_KMH, Va as DEFAULT_CIRCUITY_FACTOR, Ha as DEFAULT_MODE_DURATION_FACTORS, tn as DataList, xn as DataTable, w as DatePicker, _n as DateRangePicker, nn as DescriptionList, T as Divider, E as Drawer, D as DropdownMenu, O as Dropzone, Fa as EARTH_RADIUS_KM, k as EmptyState, Mi as ErrorBoundary, A as ErrorState, $t as ErrorText, Oo as FeatureFlagsProvider, j as FileUpload, Cn as FloatingActionButton, Qt as For, M as Form, N as FormActions, oa as FormField, Sa as FormProvider, P as FormRow, F as FormSection, Mr as GoogleSignIn, L as Grid, li as HashRouter, ft as Hide, un as HoverCard, ki as I18nProvider, en as Image, C as Input, B as InstallBanner, V as InstallButton, qe as Kanban, Ye as Kbd, sn as Label, On as Lightbox, ui as Link, Sn as ListTile, Ja as MERCATOR_MAX_LATITUDE, di as MemoryRouter, yn as Menubar, x as Modal, Xe as ModalsProvider, Gt as Money, va as MoneyInput, gn as MultiSelect, $e as NProgressBar, fi as NavLink, Qe as Navbar, pi as Navigate, vn as NavigationMenu, wn as NavigationRail, Rt as NotificationCenter, He as OfflineIndicator, mi as Outlet, tt as Page, nt as Pagination, rt as PasswordInput, ya as PhoneInput, at as PinInput, ot as Popover, Yt as Portal, st as Progress, Rr as QueryProvider, Fr as REFETCH_TIME, ct as Radio, lt as RadioGroup, ut as RangeSlider, dt as RatingStars, En as RefreshIndicator, Wt as RelativeTime, pn as Resizable, hi as Route, ai as RouteGuard, gi as Routes, Ir as STALE_TIME, mt as SafeArea, fn as ScrollArea, ht as SearchBar, gt as SegmentedControl, _t as Select, pt as Show, vt as Sidebar, kn as SignaturePad, yt as Skeleton, hn as Slider, bt as Spacer, xt as Spinner, R as Stack, St as Stat, Ct as Stepper, Dt as StepperInput, Ot as Switch, Ge as SyncStatusBadge, no as THEME_STYLE_ID, At as Table, jt as Tabs, kt as Tag, Co as TelemetryProvider, ur as TempestApiError, Xr as TempestDataProvider, Mt as Textarea, Ei as ThemeProvider, Tn as TimePicker, Nt as Timeline, Ft as ToastProvider, rn as Toggle, an as ToggleGroup, on as ToggleGroupItem, Pt as Tooltip, to as TrajectoryMap, Kt as TreeView, qt as TruncateText, Ke as UpdatePrompt, Bt as VirtualList, Ht as VirtualTable, Jt as VisuallyHidden, Ri as WebPushClient, zi as WebPushPermissionDeniedError, Bi as WebPushUnsupportedError, Dn as Wizard, Je as applyKanbanMove, ro as applyTheme, Zn as assertNever, Ia as bearingDeg, Ga as boundingBox, Ka as boundsCenter, dr as buildApiError, De as buildOpenInChromeIntent, Ln as camelCase, Rn as capitalize, Un as chunk, wt as clamp, Aa as clampLatitude, Xi as clearCaches, e as cn, Vt as compareValues, xo as consoleSink, To as consoleTelemetryAdapter, ao as contrastRatio, pr as createApiClient, Qi as createAudioPlayer, yr as createAuthStore, oo as createColorScale, Yr as createDataProvider, Pi as createEventStream, Mo as createGrowthBookFeatureFlagsAdapter, Oi as createI18n, jo as createInMemoryFlags, No as createLaunchDarklyFeatureFlagsAdapter, So as createLogger, Qa as createOSRMBackend, qr as createOfflineStore, na as createOfflineSync, Gi as createPartialResponse, $a as createPositionTracker, Do as createPostHogTelemetryAdapter, Lr as createQueryKeys, wr as createRefreshQueue, Ar as createRoleAccessControl, Ti as createSelectors, Eo as createSentryTelemetryAdapter, wi as createStore, Tr as createTempestAuth, ho as createTheme, Oa as createWebSocket, nr as debounce, xr as decodeJWT, qn as deepMerge, si as defineRoutes, Ua as durationFactor, zr as emptyOffsetPage, it as estimatePasswordStrength, Le as estimateStorage, Wa as estimateTravel, qa as expandBounds, Ya as fitProjection, Tt as formatBytes, ua as formatCEP, da as formatCNPJ, An as formatCPF, Et as formatCompactNumber, jn as formatCurrency, Mn as formatDate, Nn as formatDateTime, Pn as formatPercent, Fn as formatPhone, _r as generateIdempotencyKey, yo as getInitialTheme, _o as getThemePreset, Wn as groupBy, La as haversineKm, so as hexToOklch, co as hexToRgb, lo as hexToRgbaString, ra as higherVersionWins, Zi as inspectCaches, Ji as installBackgroundSync, Hi as installNotificationClickHandler, Ki as installPrecache, Ui as installPushHandler, qi as installRuntimeCache, Wi as installSkipWaitingListener, Oe as isAndroid, ke as isAndroidWithoutPromptApi, fr as isApiError, ja as isCoordinate, Br as isCursorPage, Qn as isDefined, Jn as isEmpty, Ae as isIOS, Sr as isJWTExpired, $n as isNumber, Vr as isOffsetPage, er as isPlainObject, Ii as isPushSupported, Po as isShareSupported, je as isStandalone, tr as isString, Ma as isValidLatitude, Na as isValidLongitude, zn as kebabCase, ia as lastWriteWins, Cr as lazyWithRetry, Qr as listQueryKey, rr as memoizeOne, Be as moveItem, Pa as normalizeLongitude, et as nprogress, uo as oklchToHex, Yn as omit, ir as once, $r as oneQueryKey, mr as parseResponse, Ra as pathLengthKm, jr as permissionsFromToken, Jr as persistQueryClientOffline, Xn as pick, $i as playAudio, Bn as pluralize, Xa as projectMercator, cr as randomId, Gn as range, io as readThemeToken, fo as readableForeground, _i as redirect, Yi as registerPeriodicSync, Ne as registerServiceWorker, po as relativeLuminance, Lt as relativeTime, Gr as removeById, Re as requestPersistentStorage, gr as retry, mo as rgbToHex, Fo as share, Io as shareOrDownloadBlob, Pe as skipWaiting, or as sleep, Vn as slugify, ea as stopAudio, In as storage, go as themeContrast, bo as themeInitScript, vo as themePresets, ar as throttle, za as toRadians, Hn as truncate, Kn as uniqueBy, fa as unmask, Za as unprojectMercator, Fe as unregisterAllServiceWorkers, hr as uploadWithProgress, Kr as upsertById, Li as urlBase64ToUint8Array, Dr as useAccessControl, Y as useAsync, ta as useAudio, z as useBeforeInstallPrompt, a as useBreakpoint, Or as useCan, Ce as useClickOutside, W as useClientFilter, ee as useClipboard, _e as useCounter, ei as useCreate, Ur as useCursorQuery, Zr as useDataProvider, H as useDebounce, se as useDeepMemo, ti as useDelete, he as useDisclosure, ve as useDocumentTitle, Z as useDocumentVisibility, aa as useErrorHandler, K as useEventListener, Fi as useEventStream, ye as useFavicon, ko as useFeatureFlag, Ca as useFieldArray, Ao as useFlagValue, ae as useFocusTrap, wa as useForm, Ta as useFormContext, Ea as useFormState, re as useGeolocation, pe as useHover, Ai as useI18n, ne as useIdle, Me as useInstallPrompt, Q as useIntersectionObserver, le as useInterval, we as useIsFirstRender, te as useKeyboardShortcut, ni as useList, ge as useListState, q as useLocalStorage, vi as useLocation, me as useLongPress, Ee as useLongPressHandlers, be as useMap, yi as useMatch, G as useMediaQuery, Ze as useModals, bi as useNavigate, zt as useNotificationInbox, Nr as useOAuthCallback, Te as useObjectUrl, Wr as useOfflineMutation, Ue as useOfflineSync, ri as useOne, X as useOnline, Hr as usePaginatedQuery, U as usePagination, xi as useParams, vr as usePoll, eo as usePositionTracker, ce as usePrevious, Vi as usePushSubscription, Se as useQueue, $ as useResizeObserver, Si as useRouteError, ie as useScrollLock, Ci as useSearchParams, Ie as useServiceWorkerUpdate, xe as useSet, Ve as useSortable, oe as useStableCallback, ze as useStorageEstimate, We as useSyncStatus, wo as useTelemetry, Di as useTheme, de as useThrottle, ue as useTimeout, It as useToast, J as useToggle, ji as useTranslate, ii as useUpdate, ba as useViaCEP, Da as useWatch, ka as useWebSocket, fe as useWindowSize, la as useZodForm, pa as validateCNPJ, ma as validateCPF, sa as validateForm, sr as withTimeout, lr as writeXlsx, ca as zodResolver };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e=require("react"),t=require("react/jsx-runtime");var n=(0,e.createContext)(null);function r(e){return e===`dark`||e===`light`?e:typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function i(e,t,n,r){let i=Array.isArray(n)?n:[n];for(let n of i)e.setAttribute(n,t);if(r&&typeof document<`u`){let e=document.querySelector(`meta[name="theme-color"]`);e&&(e.content=r[t])}}function a(e){if(!e||typeof window>`u`)return null;try{let t=window.localStorage.getItem(e);return t===`light`||t===`dark`||t===`system`?t:null}catch{return null}}function o({children:o,defaultTheme:s=`system`,storageKey:c=`tempest-theme`,target:l,attribute:u=`data-tempest-theme`,themeColor:d}){let[f,p]=(0,e.useState)(()=>a(c)??s),[m,h]=(0,e.useState)(()=>r(f)),g=(0,e.useRef)(l);g.current=l;let _=Array.isArray(u)?u.join(`,`):u,v=(0,e.useRef)(d);v.current=d,(0,e.useEffect)(()=>{let e=g.current?.()??document.documentElement;if(!e)return;let t=r(f);i(e,t,u,v.current),h(t)},[f,_]),(0,e.useEffect)(()=>{if(f!==`system`||typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{let t=g.current?.()??document.documentElement;if(!t)return;let n=e.matches?`dark`:`light`;i(t,n,u,v.current),h(n)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[f,_]);let y=(0,e.useCallback)(e=>{if(p(e),c&&typeof window<`u`)try{window.localStorage.setItem(c,e)}catch{}},[c]),b=(0,e.useCallback)(()=>{y(m===`dark`?`light`:`dark`)},[m,y]),x=(0,e.useMemo)(()=>({theme:f,resolvedTheme:m,setTheme:y,toggle:b}),[f,m,y,b]);return(0,t.jsx)(n.Provider,{value:x,children:o})}function s(){let t=(0,e.useContext)(n);if(!t)throw Error(`useTheme must be used inside a <ThemeProvider>`);return t}exports.ThemeProvider=o,exports.useTheme=s;
|
|
1
|
+
let e=require("react"),t=require("react/jsx-runtime");var n=(0,e.createContext)(null);function r(e){return e===`dark`||e===`light`?e:typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function i(e,t,n,r){let i=Array.isArray(n)?n:[n];for(let n of i)e.setAttribute(n,t);if(r&&typeof document<`u`){let e=document.querySelector(`meta[name="theme-color"]`);e&&(e.content=r[t])}}function a(e){if(!e||typeof window>`u`)return null;try{let t=window.localStorage.getItem(e);return t===`light`||t===`dark`||t===`system`?t:null}catch{return null}}function o({children:o,defaultTheme:s=`system`,storageKey:c=`tempest-theme`,target:l,attribute:u=`data-tempest-theme`,themeColor:d}){let[f,p]=(0,e.useState)(()=>a(c)??s),[m,h]=(0,e.useState)(()=>r(f)),g=(0,e.useRef)(l);(0,e.useEffect)(()=>{g.current=l},[l]);let _=Array.isArray(u)?u.join(`,`):u,v=(0,e.useRef)(d);(0,e.useEffect)(()=>{v.current=d},[d]),(0,e.useEffect)(()=>{let e=g.current?.()??document.documentElement;if(!e)return;let t=r(f);i(e,t,u,v.current),h(t)},[f,_]),(0,e.useEffect)(()=>{if(f!==`system`||typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{let t=g.current?.()??document.documentElement;if(!t)return;let n=e.matches?`dark`:`light`;i(t,n,u,v.current),h(n)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[f,_]);let y=(0,e.useCallback)(e=>{if(p(e),c&&typeof window<`u`)try{window.localStorage.setItem(c,e)}catch{}},[c]),b=(0,e.useCallback)(()=>{y(m===`dark`?`light`:`dark`)},[m,y]),x=(0,e.useMemo)(()=>({theme:f,resolvedTheme:m,setTheme:y,toggle:b}),[f,m,y,b]);return(0,t.jsx)(n.Provider,{value:x,children:o})}function s(){let t=(0,e.useContext)(n);if(!t)throw Error(`useTheme must be used inside a <ThemeProvider>`);return t}exports.ThemeProvider=o,exports.useTheme=s;
|
|
2
2
|
//# sourceMappingURL=ThemeProvider.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.cjs","names":[],"sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ReactNode } from \"react\";\nimport type { ResolvedTheme, ThemeMode } from \"./types\";\n\nexport interface ThemeContextValue {\n /** Raw user preference (light / dark / system). */\n theme: ThemeMode;\n /** Effective theme actually applied to the DOM (light or dark). */\n resolvedTheme: ResolvedTheme;\n /** Update the preference. Persisted to localStorage when `storageKey` is set. */\n setTheme: (next: ThemeMode) => void;\n /** Convenience: flip light ↔ dark. When in `system` mode, switches to the opposite of the current resolved theme. */\n toggle: () => void;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\nexport interface ThemeProviderProps {\n children: ReactNode;\n /** Initial preference when nothing is stored. Default: `\"system\"`. */\n defaultTheme?: ThemeMode;\n /** localStorage key used to persist the preference. Pass `null` to disable persistence. Default: `\"tempest-theme\"`. */\n storageKey?: string | null;\n /**\n * Element that receives the theme attribute(s). Defaults to\n * `document.documentElement`. Override when scoping the theme to a subtree.\n */\n target?: () => HTMLElement | null;\n /**\n * Attribute name(s) written on the target with the resolved theme\n * (`\"light\"` / `\"dark\"`). Default: `\"data-tempest-theme\"`.\n *\n * Pass an array to mirror the theme onto more than one attribute — handy\n * when the SDK components read `data-tempest-theme` but the host app's own\n * CSS keys off a different attribute (e.g. `[\"data-tempest-theme\",\n * \"data-theme\"]`). Avoids a separate sync effect in the consumer.\n */\n attribute?: string | string[];\n /**\n * When set, keeps `<meta name=\"theme-color\">` in sync with the resolved\n * theme — `content` becomes `themeColor.dark` in dark mode and\n * `themeColor.light` in light mode. The meta tag must already exist in the\n * document `<head>`. No-op when omitted.\n */\n themeColor?: { light: string; dark: string };\n}\n\nfunction resolve(mode: ThemeMode): ResolvedTheme {\n if (mode === \"dark\" || mode === \"light\") return mode;\n if (typeof window === \"undefined\") return \"light\";\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n}\n\n/**\n * Write the resolved theme onto every configured attribute and, when a\n * `themeColor` map is provided, sync the `<meta name=\"theme-color\">` tag.\n */\nfunction applyResolved(\n element: HTMLElement,\n resolved: ResolvedTheme,\n attribute: string | string[],\n themeColor?: { light: string; dark: string },\n): void {\n const attrs = Array.isArray(attribute) ? attribute : [attribute];\n for (const attr of attrs) element.setAttribute(attr, resolved);\n if (themeColor && typeof document !== \"undefined\") {\n const meta = document.querySelector<HTMLMetaElement>('meta[name=\"theme-color\"]');\n if (meta) meta.content = themeColor[resolved];\n }\n}\n\nfunction readStored(storageKey: string | null): ThemeMode | null {\n if (!storageKey || typeof window === \"undefined\") return null;\n try {\n const value = window.localStorage.getItem(storageKey);\n if (value === \"light\" || value === \"dark\" || value === \"system\") return value;\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * Wire dark/light theming. Writes a data attribute on a target element (the\n * `<html>` element by default) and exposes the current preference via\n * {@link useTheme}.\n *\n * Pair with `themeInitScript()` in the HTML head to prevent the flash of\n * incorrect theme on first paint.\n */\nexport function ThemeProvider({\n children,\n defaultTheme = \"system\",\n storageKey = \"tempest-theme\",\n target,\n attribute = \"data-tempest-theme\",\n themeColor,\n}: ThemeProviderProps) {\n const [theme, setThemeState] = useState<ThemeMode>(\n () => readStored(storageKey) ?? defaultTheme,\n );\n const [resolvedTheme, setResolvedTheme] = useState<ResolvedTheme>(() => resolve(theme));\n\n const targetRef = useRef<typeof target>(target);\n targetRef.current = target;\n\n const attributeKey = Array.isArray(attribute) ? attribute.join(\",\") : attribute;\n const themeColorRef = useRef(themeColor);\n themeColorRef.current = themeColor;\n\n useEffect(() => {\n const element = targetRef.current?.() ?? document.documentElement;\n if (!element) return;\n const next = resolve(theme);\n applyResolved(element, next, attribute, themeColorRef.current);\n setResolvedTheme(next);\n // attributeKey is the stable string form of `attribute`.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [theme, attributeKey]);\n\n useEffect(() => {\n if (theme !== \"system\" || typeof window === \"undefined\") return;\n const list = window.matchMedia(\"(prefers-color-scheme: dark)\");\n const handler = (): void => {\n const element = targetRef.current?.() ?? document.documentElement;\n if (!element) return;\n const next: ResolvedTheme = list.matches ? \"dark\" : \"light\";\n applyResolved(element, next, attribute, themeColorRef.current);\n setResolvedTheme(next);\n };\n list.addEventListener(\"change\", handler);\n return () => list.removeEventListener(\"change\", handler);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [theme, attributeKey]);\n\n const setTheme = useCallback(\n (next: ThemeMode) => {\n setThemeState(next);\n if (storageKey && typeof window !== \"undefined\") {\n try {\n window.localStorage.setItem(storageKey, next);\n } catch {\n /* ignore quota errors */\n }\n }\n },\n [storageKey],\n );\n\n const toggle = useCallback(() => {\n setTheme(resolvedTheme === \"dark\" ? \"light\" : \"dark\");\n }, [resolvedTheme, setTheme]);\n\n const value = useMemo<ThemeContextValue>(\n () => ({ theme, resolvedTheme, setTheme, toggle }),\n [theme, resolvedTheme, setTheme, toggle],\n );\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n/**\n * Read and mutate the current theme. Must be used inside a {@link ThemeProvider}.\n */\nexport function useTheme(): ThemeContextValue {\n const ctx = useContext(ThemeContext);\n if (!ctx) throw new Error(\"useTheme must be used inside a <ThemeProvider>\");\n return ctx;\n}\n"],"mappings":"sDAuBA,IAAM,GAAA,EAAA,EAAA,cAAA,CAAuD,IAAI,EAgCjE,SAAS,EAAQ,EAAgC,CAG7C,OAFI,IAAS,QAAU,IAAS,QAAgB,EAC5C,OAAO,OAAW,IAAoB,QACnC,OAAO,WAAW,8BAA8B,CAAC,CAAC,QAAU,OAAS,OAChF,CAMA,SAAS,EACL,EACA,EACA,EACA,EACI,CACJ,IAAM,EAAQ,MAAM,QAAQ,CAAS,EAAI,EAAY,CAAC,CAAS,EAC/D,IAAK,IAAM,KAAQ,EAAO,EAAQ,aAAa,EAAM,CAAQ,EAC7D,GAAI,GAAc,OAAO,SAAa,IAAa,CAC/C,IAAM,EAAO,SAAS,cAA+B,0BAA0B,EAC3E,IAAM,EAAK,QAAU,EAAW,GACxC,CACJ,CAEA,SAAS,EAAW,EAA6C,CAC7D,GAAI,CAAC,GAAc,OAAO,OAAW,IAAa,OAAO,KACzD,GAAI,CACA,IAAM,EAAQ,OAAO,aAAa,QAAQ,CAAU,EAEpD,OADI,IAAU,SAAW,IAAU,QAAU,IAAU,SAAiB,EACjE,IACX,MAAQ,CACJ,OAAO,IACX,CACJ,CAUA,SAAgB,EAAc,CAC1B,WACA,eAAe,SACf,aAAa,gBACb,SACA,YAAY,qBACZ,cACmB,CACnB,GAAM,CAAC,EAAO,IAAA,EAAA,EAAA,SAAA,KACJ,EAAW,CAAU,GAAK,CACpC,EACM,CAAC,EAAe,IAAA,EAAA,EAAA,SAAA,KAAkD,EAAQ,CAAK,CAAC,EAEhF,GAAA,EAAA,EAAA,OAAA,CAAkC,CAAM,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.cjs","names":[],"sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ReactNode } from \"react\";\nimport type { ResolvedTheme, ThemeMode } from \"./types\";\n\nexport interface ThemeContextValue {\n /** Raw user preference (light / dark / system). */\n theme: ThemeMode;\n /** Effective theme actually applied to the DOM (light or dark). */\n resolvedTheme: ResolvedTheme;\n /** Update the preference. Persisted to localStorage when `storageKey` is set. */\n setTheme: (next: ThemeMode) => void;\n /** Convenience: flip light ↔ dark. When in `system` mode, switches to the opposite of the current resolved theme. */\n toggle: () => void;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\nexport interface ThemeProviderProps {\n children: ReactNode;\n /** Initial preference when nothing is stored. Default: `\"system\"`. */\n defaultTheme?: ThemeMode;\n /** localStorage key used to persist the preference. Pass `null` to disable persistence. Default: `\"tempest-theme\"`. */\n storageKey?: string | null;\n /**\n * Element that receives the theme attribute(s). Defaults to\n * `document.documentElement`. Override when scoping the theme to a subtree.\n */\n target?: () => HTMLElement | null;\n /**\n * Attribute name(s) written on the target with the resolved theme\n * (`\"light\"` / `\"dark\"`). Default: `\"data-tempest-theme\"`.\n *\n * Pass an array to mirror the theme onto more than one attribute — handy\n * when the SDK components read `data-tempest-theme` but the host app's own\n * CSS keys off a different attribute (e.g. `[\"data-tempest-theme\",\n * \"data-theme\"]`). Avoids a separate sync effect in the consumer.\n */\n attribute?: string | string[];\n /**\n * When set, keeps `<meta name=\"theme-color\">` in sync with the resolved\n * theme — `content` becomes `themeColor.dark` in dark mode and\n * `themeColor.light` in light mode. The meta tag must already exist in the\n * document `<head>`. No-op when omitted.\n */\n themeColor?: { light: string; dark: string };\n}\n\nfunction resolve(mode: ThemeMode): ResolvedTheme {\n if (mode === \"dark\" || mode === \"light\") return mode;\n if (typeof window === \"undefined\") return \"light\";\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n}\n\n/**\n * Write the resolved theme onto every configured attribute and, when a\n * `themeColor` map is provided, sync the `<meta name=\"theme-color\">` tag.\n */\nfunction applyResolved(\n element: HTMLElement,\n resolved: ResolvedTheme,\n attribute: string | string[],\n themeColor?: { light: string; dark: string },\n): void {\n const attrs = Array.isArray(attribute) ? attribute : [attribute];\n for (const attr of attrs) element.setAttribute(attr, resolved);\n if (themeColor && typeof document !== \"undefined\") {\n const meta = document.querySelector<HTMLMetaElement>('meta[name=\"theme-color\"]');\n if (meta) meta.content = themeColor[resolved];\n }\n}\n\nfunction readStored(storageKey: string | null): ThemeMode | null {\n if (!storageKey || typeof window === \"undefined\") return null;\n try {\n const value = window.localStorage.getItem(storageKey);\n if (value === \"light\" || value === \"dark\" || value === \"system\") return value;\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * Wire dark/light theming. Writes a data attribute on a target element (the\n * `<html>` element by default) and exposes the current preference via\n * {@link useTheme}.\n *\n * Pair with `themeInitScript()` in the HTML head to prevent the flash of\n * incorrect theme on first paint.\n */\nexport function ThemeProvider({\n children,\n defaultTheme = \"system\",\n storageKey = \"tempest-theme\",\n target,\n attribute = \"data-tempest-theme\",\n themeColor,\n}: ThemeProviderProps) {\n const [theme, setThemeState] = useState<ThemeMode>(\n () => readStored(storageKey) ?? defaultTheme,\n );\n const [resolvedTheme, setResolvedTheme] = useState<ResolvedTheme>(() => resolve(theme));\n\n const targetRef = useRef<typeof target>(target);\n useEffect(() => {\n targetRef.current = target;\n }, [target]);\n\n const attributeKey = Array.isArray(attribute) ? attribute.join(\",\") : attribute;\n const themeColorRef = useRef(themeColor);\n useEffect(() => {\n themeColorRef.current = themeColor;\n }, [themeColor]);\n\n useEffect(() => {\n const element = targetRef.current?.() ?? document.documentElement;\n if (!element) return;\n const next = resolve(theme);\n applyResolved(element, next, attribute, themeColorRef.current);\n setResolvedTheme(next);\n // attributeKey is the stable string form of `attribute`.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [theme, attributeKey]);\n\n useEffect(() => {\n if (theme !== \"system\" || typeof window === \"undefined\") return;\n const list = window.matchMedia(\"(prefers-color-scheme: dark)\");\n const handler = (): void => {\n const element = targetRef.current?.() ?? document.documentElement;\n if (!element) return;\n const next: ResolvedTheme = list.matches ? \"dark\" : \"light\";\n applyResolved(element, next, attribute, themeColorRef.current);\n setResolvedTheme(next);\n };\n list.addEventListener(\"change\", handler);\n return () => list.removeEventListener(\"change\", handler);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [theme, attributeKey]);\n\n const setTheme = useCallback(\n (next: ThemeMode) => {\n setThemeState(next);\n if (storageKey && typeof window !== \"undefined\") {\n try {\n window.localStorage.setItem(storageKey, next);\n } catch {\n /* ignore quota errors */\n }\n }\n },\n [storageKey],\n );\n\n const toggle = useCallback(() => {\n setTheme(resolvedTheme === \"dark\" ? \"light\" : \"dark\");\n }, [resolvedTheme, setTheme]);\n\n const value = useMemo<ThemeContextValue>(\n () => ({ theme, resolvedTheme, setTheme, toggle }),\n [theme, resolvedTheme, setTheme, toggle],\n );\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n/**\n * Read and mutate the current theme. Must be used inside a {@link ThemeProvider}.\n */\nexport function useTheme(): ThemeContextValue {\n const ctx = useContext(ThemeContext);\n if (!ctx) throw new Error(\"useTheme must be used inside a <ThemeProvider>\");\n return ctx;\n}\n"],"mappings":"sDAuBA,IAAM,GAAA,EAAA,EAAA,cAAA,CAAuD,IAAI,EAgCjE,SAAS,EAAQ,EAAgC,CAG7C,OAFI,IAAS,QAAU,IAAS,QAAgB,EAC5C,OAAO,OAAW,IAAoB,QACnC,OAAO,WAAW,8BAA8B,CAAC,CAAC,QAAU,OAAS,OAChF,CAMA,SAAS,EACL,EACA,EACA,EACA,EACI,CACJ,IAAM,EAAQ,MAAM,QAAQ,CAAS,EAAI,EAAY,CAAC,CAAS,EAC/D,IAAK,IAAM,KAAQ,EAAO,EAAQ,aAAa,EAAM,CAAQ,EAC7D,GAAI,GAAc,OAAO,SAAa,IAAa,CAC/C,IAAM,EAAO,SAAS,cAA+B,0BAA0B,EAC3E,IAAM,EAAK,QAAU,EAAW,GACxC,CACJ,CAEA,SAAS,EAAW,EAA6C,CAC7D,GAAI,CAAC,GAAc,OAAO,OAAW,IAAa,OAAO,KACzD,GAAI,CACA,IAAM,EAAQ,OAAO,aAAa,QAAQ,CAAU,EAEpD,OADI,IAAU,SAAW,IAAU,QAAU,IAAU,SAAiB,EACjE,IACX,MAAQ,CACJ,OAAO,IACX,CACJ,CAUA,SAAgB,EAAc,CAC1B,WACA,eAAe,SACf,aAAa,gBACb,SACA,YAAY,qBACZ,cACmB,CACnB,GAAM,CAAC,EAAO,IAAA,EAAA,EAAA,SAAA,KACJ,EAAW,CAAU,GAAK,CACpC,EACM,CAAC,EAAe,IAAA,EAAA,EAAA,SAAA,KAAkD,EAAQ,CAAK,CAAC,EAEhF,GAAA,EAAA,EAAA,OAAA,CAAkC,CAAM,GAC9C,EAAA,EAAA,UAAA,KAAgB,CACZ,EAAU,QAAU,CACxB,EAAG,CAAC,CAAM,CAAC,EAEX,IAAM,EAAe,MAAM,QAAQ,CAAS,EAAI,EAAU,KAAK,GAAG,EAAI,EAChE,GAAA,EAAA,EAAA,OAAA,CAAuB,CAAU,GACvC,EAAA,EAAA,UAAA,KAAgB,CACZ,EAAc,QAAU,CAC5B,EAAG,CAAC,CAAU,CAAC,GAEf,EAAA,EAAA,UAAA,KAAgB,CACZ,IAAM,EAAU,EAAU,UAAU,GAAK,SAAS,gBAClD,GAAI,CAAC,EAAS,OACd,IAAM,EAAO,EAAQ,CAAK,EAC1B,EAAc,EAAS,EAAM,EAAW,EAAc,OAAO,EAC7D,EAAiB,CAAI,CAGzB,EAAG,CAAC,EAAO,CAAY,CAAC,GAExB,EAAA,EAAA,UAAA,KAAgB,CACZ,GAAI,IAAU,UAAY,OAAO,OAAW,IAAa,OACzD,IAAM,EAAO,OAAO,WAAW,8BAA8B,EACvD,MAAsB,CACxB,IAAM,EAAU,EAAU,UAAU,GAAK,SAAS,gBAClD,GAAI,CAAC,EAAS,OACd,IAAM,EAAsB,EAAK,QAAU,OAAS,QACpD,EAAc,EAAS,EAAM,EAAW,EAAc,OAAO,EAC7D,EAAiB,CAAI,CACzB,EAEA,OADA,EAAK,iBAAiB,SAAU,CAAO,MAC1B,EAAK,oBAAoB,SAAU,CAAO,CAE3D,EAAG,CAAC,EAAO,CAAY,CAAC,EAExB,IAAM,GAAA,EAAA,EAAA,YAAA,CACD,GAAoB,CAEjB,GADA,EAAc,CAAI,EACd,GAAc,OAAO,OAAW,IAChC,GAAI,CACA,OAAO,aAAa,QAAQ,EAAY,CAAI,CAChD,MAAQ,CAER,CAER,EACA,CAAC,CAAU,CACf,EAEM,GAAA,EAAA,EAAA,YAAA,KAA2B,CAC7B,EAAS,IAAkB,OAAS,QAAU,MAAM,CACxD,EAAG,CAAC,EAAe,CAAQ,CAAC,EAEtB,GAAA,EAAA,EAAA,QAAA,MACK,CAAE,QAAO,gBAAe,WAAU,QAAO,GAChD,CAAC,EAAO,EAAe,EAAU,CAAM,CAC3C,EAEA,OAAO,EAAA,EAAA,IAAA,CAAC,EAAa,SAAd,CAA8B,QAAQ,UAAgC,CAAA,CACjF,CAKA,SAAgB,GAA8B,CAC1C,IAAM,GAAA,EAAA,EAAA,WAAA,CAAiB,CAAY,EACnC,GAAI,CAAC,EAAK,MAAU,MAAM,gDAAgD,EAC1E,OAAO,CACX"}
|
|
@@ -24,9 +24,13 @@ function d(e) {
|
|
|
24
24
|
}
|
|
25
25
|
function f({ children: e, defaultTheme: n = "system", storageKey: f = "tempest-theme", target: p, attribute: m = "data-tempest-theme", themeColor: h }) {
|
|
26
26
|
let [g, _] = o(() => d(f) ?? n), [v, y] = o(() => l(g)), b = a(p);
|
|
27
|
-
|
|
27
|
+
r(() => {
|
|
28
|
+
b.current = p;
|
|
29
|
+
}, [p]);
|
|
28
30
|
let x = Array.isArray(m) ? m.join(",") : m, S = a(h);
|
|
29
|
-
|
|
31
|
+
r(() => {
|
|
32
|
+
S.current = h;
|
|
33
|
+
}, [h]), r(() => {
|
|
30
34
|
let e = b.current?.() ?? document.documentElement;
|
|
31
35
|
if (!e) return;
|
|
32
36
|
let t = l(g);
|