@signalcore/ui 0.1.0 → 1.0.0-beta.1
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 +896 -513
- package/dist/AgentAbout.d.ts +186 -0
- package/dist/AgentAbout.js +1020 -0
- package/dist/AgentAbout.js.map +1 -0
- package/dist/AgentCard.d.ts +49 -0
- package/dist/AgentCard.js +77 -0
- package/dist/AgentCard.js.map +1 -0
- package/dist/AgentChat.d.ts +233 -0
- package/dist/AgentChat.js +1127 -0
- package/dist/AgentChat.js.map +1 -0
- package/dist/AgentSpace.d.ts +112 -0
- package/dist/AgentSpace.js +339 -0
- package/dist/AgentSpace.js.map +1 -0
- package/dist/AgentTasks.d.ts +48 -0
- package/dist/AgentTasks.js +120 -0
- package/dist/AgentTasks.js.map +1 -0
- package/dist/BrowserView.d.ts +52 -0
- package/dist/BrowserView.js +328 -0
- package/dist/BrowserView.js.map +1 -0
- package/dist/FileView.d.ts +63 -0
- package/dist/FileView.js +449 -0
- package/dist/FileView.js.map +1 -0
- package/dist/Modes.d.ts +13 -0
- package/dist/Modes.js +75 -0
- package/dist/Modes.js.map +1 -0
- package/dist/VoiceCall.d.ts +91 -0
- package/dist/VoiceCall.js +302 -0
- package/dist/VoiceCall.js.map +1 -0
- package/dist/about.d.ts +212 -0
- package/dist/about.js +136 -0
- package/dist/about.js.map +1 -0
- package/dist/agentIcons.d.ts +33 -0
- package/dist/agentIcons.js +36 -0
- package/dist/agentIcons.js.map +1 -0
- package/dist/automation/Automation.d.ts +35 -0
- package/dist/automation/Automation.js +268 -0
- package/dist/automation/Automation.js.map +1 -0
- package/dist/automation/RunView.d.ts +25 -0
- package/dist/automation/RunView.js +187 -0
- package/dist/automation/RunView.js.map +1 -0
- package/dist/automation/cron.d.ts +41 -0
- package/dist/automation/cron.js +169 -0
- package/dist/automation/cron.js.map +1 -0
- package/dist/automation/marks.js +121 -0
- package/dist/automation/marks.js.map +1 -0
- package/dist/automation/messages.d.ts +113 -0
- package/dist/automation/messages.js +113 -0
- package/dist/automation/messages.js.map +1 -0
- package/dist/automation/record.d.ts +47 -0
- package/dist/automation/record.js +177 -0
- package/dist/automation/record.js.map +1 -0
- package/dist/automation/types.d.ts +143 -0
- package/dist/automation/when.d.ts +36 -0
- package/dist/automation/when.js +168 -0
- package/dist/automation/when.js.map +1 -0
- package/dist/blocks.d.ts +185 -0
- package/dist/browser.js +292 -0
- package/dist/browser.js.map +1 -0
- package/dist/call.d.ts +89 -0
- package/dist/call.js +218 -0
- package/dist/call.js.map +1 -0
- package/dist/channelParts.js +26 -0
- package/dist/channelParts.js.map +1 -0
- package/dist/classes.js +8 -3
- package/dist/classes.js.map +1 -0
- package/dist/client.d.ts +146 -54
- package/dist/client.js +204 -1
- package/dist/client.js.map +1 -0
- package/dist/conversationFiles.js +46 -0
- package/dist/conversationFiles.js.map +1 -0
- package/dist/credentials.d.ts +45 -0
- package/dist/credentials.js +98 -0
- package/dist/credentials.js.map +1 -0
- package/dist/dev.js +17 -0
- package/dist/dev.js.map +1 -0
- package/dist/es.d.ts +17 -0
- package/dist/es.js +382 -0
- package/dist/es.js.map +1 -0
- package/dist/files.d.ts +21 -0
- package/dist/files.js +214 -0
- package/dist/files.js.map +1 -0
- package/dist/frames.d.ts +115 -0
- package/dist/frames.js +219 -0
- package/dist/frames.js.map +1 -0
- package/dist/icons.js +29 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +63 -60
- package/dist/index.js +59 -45
- package/dist/kit/AudioPlayer.d.ts +20 -0
- package/dist/kit/AudioPlayer.js +116 -0
- package/dist/kit/AudioPlayer.js.map +1 -0
- package/dist/kit/Button.d.ts +29 -0
- package/dist/kit/Button.js +59 -0
- package/dist/kit/Button.js.map +1 -0
- package/dist/kit/Card.d.ts +16 -0
- package/dist/kit/Card.js +36 -0
- package/dist/kit/Card.js.map +1 -0
- package/dist/kit/Chart.js +152 -0
- package/dist/kit/Chart.js.map +1 -0
- package/dist/kit/Choices.d.ts +21 -0
- package/dist/kit/Choices.js +99 -0
- package/dist/kit/Choices.js.map +1 -0
- package/dist/kit/Combobox.d.ts +26 -0
- package/dist/kit/Combobox.js +190 -0
- package/dist/kit/Combobox.js.map +1 -0
- package/dist/kit/DateField.d.ts +17 -0
- package/dist/kit/DateField.js +133 -0
- package/dist/kit/DateField.js.map +1 -0
- package/dist/kit/Field.d.ts +40 -0
- package/dist/kit/Field.js +98 -0
- package/dist/kit/Field.js.map +1 -0
- package/dist/kit/FileField.d.ts +113 -0
- package/dist/kit/FileField.js +341 -0
- package/dist/kit/FileField.js.map +1 -0
- package/dist/kit/FileMark.d.ts +15 -0
- package/dist/kit/FileMark.js +39 -0
- package/dist/kit/FileMark.js.map +1 -0
- package/dist/kit/Inputs.d.ts +59 -0
- package/dist/kit/Inputs.js +205 -0
- package/dist/kit/Inputs.js.map +1 -0
- package/dist/kit/List.d.ts +47 -0
- package/dist/kit/List.js +85 -0
- package/dist/kit/List.js.map +1 -0
- package/dist/kit/Mark.d.ts +30 -0
- package/dist/kit/Mark.js +27 -0
- package/dist/kit/Mark.js.map +1 -0
- package/dist/kit/MarkStack.d.ts +15 -0
- package/dist/kit/MarkStack.js +26 -0
- package/dist/kit/MarkStack.js.map +1 -0
- package/dist/kit/Note.d.ts +11 -0
- package/dist/kit/Note.js +31 -0
- package/dist/kit/Note.js.map +1 -0
- package/dist/kit/Popover.js +90 -0
- package/dist/kit/Popover.js.map +1 -0
- package/dist/kit/RangeField.d.ts +14 -0
- package/dist/kit/RangeField.js +47 -0
- package/dist/kit/RangeField.js.map +1 -0
- package/dist/kit/RatingField.d.ts +14 -0
- package/dist/kit/RatingField.js +50 -0
- package/dist/kit/RatingField.js.map +1 -0
- package/dist/kit/Stat.d.ts +26 -0
- package/dist/kit/Stat.js +46 -0
- package/dist/kit/Stat.js.map +1 -0
- package/dist/kit/Switch.d.ts +14 -0
- package/dist/kit/Switch.js +21 -0
- package/dist/kit/Switch.js.map +1 -0
- package/dist/kit/Tag.d.ts +16 -0
- package/dist/kit/Tag.js +20 -0
- package/dist/kit/Tag.js.map +1 -0
- package/dist/kit/Tile.d.ts +34 -0
- package/dist/kit/Tile.js +52 -0
- package/dist/kit/Tile.js.map +1 -0
- package/dist/kit/TimeField.d.ts +31 -0
- package/dist/kit/TimeField.js +109 -0
- package/dist/kit/TimeField.js.map +1 -0
- package/dist/kit/context.d.ts +22 -0
- package/dist/kit/context.js +46 -0
- package/dist/kit/context.js.map +1 -0
- package/dist/kit/dates.d.ts +14 -0
- package/dist/kit/dates.js +129 -0
- package/dist/kit/dates.js.map +1 -0
- package/dist/kit/messages.d.ts +99 -0
- package/dist/kit/messages.js +66 -0
- package/dist/kit/messages.js.map +1 -0
- package/dist/kit/numbers.d.ts +12 -0
- package/dist/kit/numbers.js +40 -0
- package/dist/kit/numbers.js.map +1 -0
- package/dist/kit/options.d.ts +10 -0
- package/dist/kit/options.js +23 -0
- package/dist/kit/options.js.map +1 -0
- package/dist/kit/uploads.d.ts +42 -0
- package/dist/kit/uploads.js +165 -0
- package/dist/kit/uploads.js.map +1 -0
- package/dist/kit/waveform.js +76 -0
- package/dist/kit/waveform.js.map +1 -0
- package/dist/locale.d.ts +1 -0
- package/dist/locale.js +1 -0
- package/dist/markdown.js +84 -0
- package/dist/markdown.js.map +1 -0
- package/dist/marks.js +217 -0
- package/dist/marks.js.map +1 -0
- package/dist/reveal.js +48 -0
- package/dist/reveal.js.map +1 -0
- package/dist/stepGlyphs.js +62 -0
- package/dist/stepGlyphs.js.map +1 -0
- package/dist/surface/Form.js +264 -0
- package/dist/surface/Form.js.map +1 -0
- package/dist/surface/Markdown.js +42 -0
- package/dist/surface/Markdown.js.map +1 -0
- package/dist/surface/Surface.d.ts +31 -17
- package/dist/surface/Surface.js +480 -57
- package/dist/surface/Surface.js.map +1 -0
- package/dist/surface/scope.d.ts +32 -0
- package/dist/surface/scope.js +23 -0
- package/dist/surface/scope.js.map +1 -0
- package/dist/surface/values.d.ts +44 -0
- package/dist/surface/values.js +237 -0
- package/dist/surface/values.js.map +1 -0
- package/dist/tint.d.ts +10 -0
- package/dist/tint.js +19 -0
- package/dist/tint.js.map +1 -0
- package/dist/types.d.ts +541 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/dist/useAgentFace.d.ts +18 -0
- package/dist/useAgentFace.js +45 -0
- package/dist/useAgentFace.js.map +1 -0
- package/dist/useCall.d.ts +39 -0
- package/dist/useCall.js +273 -0
- package/dist/useCall.js.map +1 -0
- package/dist/useConversation.d.ts +77 -0
- package/dist/useConversation.js +523 -0
- package/dist/useConversation.js.map +1 -0
- package/dist/useDictation.d.ts +17 -0
- package/dist/useDictation.js +68 -0
- package/dist/useDictation.js.map +1 -0
- package/dist/useLive.d.ts +26 -0
- package/dist/useLive.js +88 -0
- package/dist/useLive.js.map +1 -0
- package/dist/usePolled.js +68 -0
- package/dist/usePolled.js.map +1 -0
- package/dist/voice/Orb.d.ts +10 -9
- package/dist/voice/Orb.js +43 -39
- package/dist/voice/Orb.js.map +1 -0
- package/dist/voice/StillOrb.js +33 -0
- package/dist/voice/StillOrb.js.map +1 -0
- package/dist/voice/WebGLOrb.js +98 -0
- package/dist/voice/WebGLOrb.js.map +1 -0
- package/dist/voice/fluidDots.js +161 -0
- package/dist/voice/fluidDots.js.map +1 -0
- package/dist/voice/motion.js +84 -0
- package/dist/voice/motion.js.map +1 -0
- package/dist/voice/orbs.d.ts +32 -0
- package/dist/voice/orbs.js +16 -0
- package/dist/voice/orbs.js.map +1 -0
- package/dist/voice/useReducedMotion.js +16 -16
- package/dist/voice/useReducedMotion.js.map +1 -0
- package/dist/voice/wave.js +116 -0
- package/dist/voice/wave.js.map +1 -0
- package/dist/voice/webgl.js +177 -0
- package/dist/voice/webgl.js.map +1 -0
- package/dist/widget.js +284 -8
- package/package.json +49 -39
- package/src/AgentAbout.tsx +1621 -0
- package/src/AgentCard.tsx +123 -0
- package/src/AgentChat.tsx +1812 -0
- package/src/AgentSpace.tsx +540 -0
- package/src/AgentTasks.tsx +163 -0
- package/src/BrowserView.tsx +442 -0
- package/src/FileView.tsx +620 -0
- package/src/Modes.tsx +112 -0
- package/src/VoiceCall.tsx +411 -0
- package/src/about.ts +355 -0
- package/src/agentIcons.ts +56 -0
- package/src/automation/Automation.tsx +308 -0
- package/src/automation/RunView.tsx +213 -0
- package/src/automation/cron.ts +196 -0
- package/src/automation/marks.tsx +144 -0
- package/src/automation/messages.ts +231 -0
- package/src/automation/record.ts +206 -0
- package/src/automation/types.ts +146 -0
- package/src/automation/when.ts +195 -0
- package/src/blocks.ts +249 -0
- package/src/browser.ts +334 -0
- package/src/call.ts +300 -0
- package/src/channelParts.ts +17 -0
- package/src/classes.ts +10 -0
- package/src/client.ts +397 -0
- package/src/conversationFiles.ts +54 -0
- package/src/credentials.ts +158 -0
- package/src/dev.ts +20 -0
- package/src/es.ts +423 -0
- package/src/files.ts +238 -0
- package/src/frames.ts +291 -0
- package/src/icons.tsx +49 -0
- package/src/index.ts +271 -0
- package/src/kit/AudioPlayer.tsx +129 -0
- package/src/kit/Button.tsx +97 -0
- package/src/kit/Card.tsx +47 -0
- package/src/kit/Chart.tsx +129 -0
- package/src/kit/Choices.tsx +131 -0
- package/src/kit/Combobox.tsx +247 -0
- package/src/kit/DateField.tsx +156 -0
- package/src/kit/Field.tsx +137 -0
- package/src/kit/FileField.tsx +492 -0
- package/src/kit/FileMark.tsx +56 -0
- package/src/kit/Inputs.tsx +250 -0
- package/src/kit/List.tsx +135 -0
- package/src/kit/Mark.tsx +64 -0
- package/src/kit/MarkStack.tsx +29 -0
- package/src/kit/Note.tsx +42 -0
- package/src/kit/Popover.tsx +121 -0
- package/src/kit/RangeField.tsx +53 -0
- package/src/kit/RatingField.tsx +62 -0
- package/src/kit/Stat.tsx +60 -0
- package/src/kit/Switch.tsx +28 -0
- package/src/kit/Tag.tsx +32 -0
- package/src/kit/Tile.tsx +74 -0
- package/src/kit/TimeField.tsx +157 -0
- package/src/kit/context.tsx +246 -0
- package/src/kit/dates.ts +150 -0
- package/src/kit/messages.ts +160 -0
- package/src/kit/numbers.ts +44 -0
- package/src/kit/options.ts +30 -0
- package/src/kit/uploads.ts +244 -0
- package/src/kit/waveform.ts +84 -0
- package/src/locale.ts +6 -0
- package/src/markdown.ts +69 -0
- package/src/marks.tsx +328 -0
- package/src/reveal.ts +52 -0
- package/src/stepGlyphs.ts +83 -0
- package/src/styles.css +6970 -0
- package/src/surface/Form.tsx +299 -0
- package/src/surface/Markdown.tsx +55 -0
- package/src/surface/Surface.tsx +605 -0
- package/src/surface/scope.ts +82 -0
- package/src/surface/values.ts +361 -0
- package/src/tint.ts +14 -0
- package/src/types.ts +604 -0
- package/src/useAgentFace.ts +47 -0
- package/src/useCall.ts +292 -0
- package/src/useConversation.ts +627 -0
- package/src/useDictation.ts +83 -0
- package/src/useLive.ts +115 -0
- package/src/usePolled.ts +60 -0
- package/src/voice/Orb.tsx +45 -0
- package/src/voice/StillOrb.tsx +29 -0
- package/src/voice/WebGLOrb.tsx +98 -0
- package/src/voice/fluidDots.tsx +171 -0
- package/src/voice/motion.ts +112 -0
- package/src/voice/orbs.ts +39 -0
- package/src/voice/useReducedMotion.ts +24 -0
- package/src/voice/wave.tsx +129 -0
- package/src/voice/webgl.ts +209 -0
- package/src/widget/css.d.ts +5 -0
- package/src/widget/element.tsx +535 -0
- package/src/widget/index.ts +10 -0
- package/src/widget/mount.ts +27 -0
- package/src/widget/widget.css +253 -0
- package/dist/SignalcoreProvider.d.ts +0 -113
- package/dist/SignalcoreProvider.js +0 -84
- package/dist/automations/AppMarks.d.ts +0 -11
- package/dist/automations/AppMarks.js +0 -18
- package/dist/automations/AutomationCard.d.ts +0 -27
- package/dist/automations/AutomationCard.js +0 -53
- package/dist/automations/AutomationsWindow.d.ts +0 -38
- package/dist/automations/AutomationsWindow.js +0 -57
- package/dist/automations/Card.d.ts +0 -46
- package/dist/automations/Card.js +0 -45
- package/dist/automations/ScheduleMarks.d.ts +0 -13
- package/dist/automations/ScheduleMarks.js +0 -24
- package/dist/automations/presentationIcons.d.ts +0 -7
- package/dist/automations/presentationIcons.js +0 -67
- package/dist/automations/schedule.d.ts +0 -25
- package/dist/automations/schedule.js +0 -59
- package/dist/automations/time.d.ts +0 -3
- package/dist/automations/time.js +0 -25
- package/dist/browser/BrowserView.d.ts +0 -43
- package/dist/browser/BrowserView.js +0 -94
- package/dist/browser/room.d.ts +0 -21
- package/dist/browser/room.js +0 -33
- package/dist/browser/useBrowserSession.d.ts +0 -17
- package/dist/browser/useBrowserSession.js +0 -67
- package/dist/builder/BuilderChat.d.ts +0 -32
- package/dist/builder/BuilderChat.js +0 -41
- package/dist/builder/BuilderTranscript.d.ts +0 -49
- package/dist/builder/BuilderTranscript.js +0 -62
- package/dist/builder/StatusLine.d.ts +0 -8
- package/dist/builder/StatusLine.js +0 -17
- package/dist/builder/answer.d.ts +0 -7
- package/dist/builder/answer.js +0 -8
- package/dist/builder/blocks.d.ts +0 -31
- package/dist/builder/blocks.js +0 -74
- package/dist/builder/items.d.ts +0 -15
- package/dist/builder/items.js +0 -21
- package/dist/builder/steps.d.ts +0 -20
- package/dist/builder/steps.js +0 -120
- package/dist/builder/time.d.ts +0 -4
- package/dist/builder/time.js +0 -24
- package/dist/builder/useBuildSession.d.ts +0 -36
- package/dist/builder/useBuildSession.js +0 -130
- package/dist/builder/workingOn.d.ts +0 -7
- package/dist/builder/workingOn.js +0 -15
- package/dist/chat/AgentChat.d.ts +0 -37
- package/dist/chat/AgentChat.js +0 -21
- package/dist/chat/ChatView.d.ts +0 -25
- package/dist/chat/ChatView.js +0 -34
- package/dist/chat/Composer.d.ts +0 -20
- package/dist/chat/Composer.js +0 -22
- package/dist/chat/MessageRow.d.ts +0 -22
- package/dist/chat/MessageRow.js +0 -32
- package/dist/chat/arrival.d.ts +0 -15
- package/dist/chat/arrival.js +0 -25
- package/dist/chat/history.d.ts +0 -24
- package/dist/chat/history.js +0 -45
- package/dist/chat/moments.d.ts +0 -25
- package/dist/chat/moments.js +0 -72
- package/dist/chat/types.d.ts +0 -12
- package/dist/chat/types.js +0 -1
- package/dist/chat/useComposer.d.ts +0 -46
- package/dist/chat/useComposer.js +0 -62
- package/dist/chat/useConversation.d.ts +0 -35
- package/dist/chat/useConversation.js +0 -71
- package/dist/chat/useStickToBottom.d.ts +0 -9
- package/dist/chat/useStickToBottom.js +0 -33
- package/dist/chat/useTurns.d.ts +0 -49
- package/dist/chat/useTurns.js +0 -111
- package/dist/classes.d.ts +0 -2
- package/dist/development.d.ts +0 -5
- package/dist/development.js +0 -8
- package/dist/flow/FlowWindow.d.ts +0 -42
- package/dist/flow/FlowWindow.js +0 -126
- package/dist/flow/index.d.ts +0 -16
- package/dist/flow/index.js +0 -16
- package/dist/flow/kinds.d.ts +0 -23
- package/dist/flow/kinds.js +0 -48
- package/dist/flow/map.d.ts +0 -44
- package/dist/flow/map.js +0 -225
- package/dist/flow/nodePaths.d.ts +0 -7
- package/dist/flow/nodePaths.js +0 -17
- package/dist/flow/relations.d.ts +0 -42
- package/dist/flow/relations.js +0 -174
- package/dist/host.d.ts +0 -124
- package/dist/host.js +0 -1
- package/dist/live/LiveView.d.ts +0 -28
- package/dist/live/LiveView.js +0 -55
- package/dist/live/capture.d.ts +0 -20
- package/dist/live/capture.js +0 -100
- package/dist/live/follow.d.ts +0 -26
- package/dist/live/follow.js +0 -72
- package/dist/live/paint.d.ts +0 -13
- package/dist/live/paint.js +0 -77
- package/dist/live/useLiveStream.d.ts +0 -16
- package/dist/live/useLiveStream.js +0 -57
- package/dist/look.d.ts +0 -33
- package/dist/look.js +0 -241
- package/dist/messages/en.d.ts +0 -3
- package/dist/messages/en.js +0 -251
- package/dist/messages/es.d.ts +0 -3
- package/dist/messages/es.js +0 -251
- package/dist/messages/index.d.ts +0 -16
- package/dist/messages/index.js +0 -33
- package/dist/messages/types.d.ts +0 -246
- package/dist/messages/types.js +0 -1
- package/dist/parts/Button.d.ts +0 -18
- package/dist/parts/Button.js +0 -17
- package/dist/parts/Icon.d.ts +0 -39
- package/dist/parts/Icon.js +0 -37
- package/dist/parts/Input.d.ts +0 -6
- package/dist/parts/Input.js +0 -11
- package/dist/parts/Spinner.d.ts +0 -2
- package/dist/parts/Spinner.js +0 -7
- package/dist/patterns.d.ts +0 -15
- package/dist/patterns.js +0 -5
- package/dist/presets.d.ts +0 -82
- package/dist/presets.js +0 -81
- package/dist/primitives.d.ts +0 -22
- package/dist/primitives.js +0 -58
- package/dist/request/RequestCard.d.ts +0 -34
- package/dist/request/RequestCard.js +0 -101
- package/dist/request/approval/ApprovalPreview.d.ts +0 -5
- package/dist/request/approval/ApprovalPreview.js +0 -27
- package/dist/request/approval/shapes.d.ts +0 -32
- package/dist/request/approval/shapes.js +0 -68
- package/dist/request/apps.d.ts +0 -11
- package/dist/request/apps.js +0 -27
- package/dist/request/cards.d.ts +0 -12
- package/dist/request/cards.js +0 -24
- package/dist/request/deliver.d.ts +0 -12
- package/dist/request/deliver.js +0 -21
- package/dist/request/handOver.d.ts +0 -18
- package/dist/request/handOver.js +0 -33
- package/dist/request/kinds/Approval.d.ts +0 -3
- package/dist/request/kinds/Approval.js +0 -9
- package/dist/request/kinds/Choice.d.ts +0 -3
- package/dist/request/kinds/Choice.js +0 -8
- package/dist/request/kinds/Connect.d.ts +0 -9
- package/dist/request/kinds/Connect.js +0 -119
- package/dist/request/kinds/FreeText.d.ts +0 -3
- package/dist/request/kinds/FreeText.js +0 -20
- package/dist/request/kinds/HandOver.d.ts +0 -13
- package/dist/request/kinds/HandOver.js +0 -20
- package/dist/request/kinds/Secret.d.ts +0 -7
- package/dist/request/kinds/Secret.js +0 -49
- package/dist/request/kinds/Upload.d.ts +0 -6
- package/dist/request/kinds/Upload.js +0 -47
- package/dist/request/types.d.ts +0 -83
- package/dist/request/types.js +0 -1
- package/dist/safeUrl.d.ts +0 -6
- package/dist/safeUrl.js +0 -8
- package/dist/stream/builder.d.ts +0 -176
- package/dist/stream/builder.js +0 -202
- package/dist/stream/reduce.d.ts +0 -51
- package/dist/stream/reduce.js +0 -58
- package/dist/stream/untilAborted.d.ts +0 -7
- package/dist/stream/untilAborted.js +0 -32
- package/dist/stream/useRunStream.d.ts +0 -26
- package/dist/stream/useRunStream.js +0 -137
- package/dist/styles.css +0 -2318
- package/dist/surface/HostNode.d.ts +0 -14
- package/dist/surface/HostNode.js +0 -30
- package/dist/surface/Node.d.ts +0 -7
- package/dist/surface/Node.js +0 -49
- package/dist/surface/SurfaceBoundary.d.ts +0 -26
- package/dist/surface/SurfaceBoundary.js +0 -20
- package/dist/surface/bindings.d.ts +0 -14
- package/dist/surface/bindings.js +0 -37
- package/dist/surface/check.d.ts +0 -27
- package/dist/surface/check.js +0 -102
- package/dist/surface/format.d.ts +0 -10
- package/dist/surface/format.js +0 -32
- package/dist/surface/hosts.d.ts +0 -6
- package/dist/surface/hosts.js +0 -11
- package/dist/surface/scene.d.ts +0 -21
- package/dist/surface/scene.js +0 -8
- package/dist/surface/templates/Browser.d.ts +0 -6
- package/dist/surface/templates/Browser.js +0 -11
- package/dist/surface/templates/Chart.d.ts +0 -6
- package/dist/surface/templates/Chart.js +0 -13
- package/dist/surface/templates/Choices.d.ts +0 -3
- package/dist/surface/templates/Choices.js +0 -12
- package/dist/surface/templates/Form.d.ts +0 -3
- package/dist/surface/templates/Form.js +0 -44
- package/dist/surface/templates/KeyValue.d.ts +0 -3
- package/dist/surface/templates/KeyValue.js +0 -7
- package/dist/surface/templates/Layout.d.ts +0 -5
- package/dist/surface/templates/Layout.js +0 -16
- package/dist/surface/templates/Live.d.ts +0 -6
- package/dist/surface/templates/Live.js +0 -9
- package/dist/surface/templates/Media.d.ts +0 -5
- package/dist/surface/templates/Media.js +0 -13
- package/dist/surface/templates/Slots.d.ts +0 -3
- package/dist/surface/templates/Slots.js +0 -19
- package/dist/surface/templates/Table.d.ts +0 -3
- package/dist/surface/templates/Table.js +0 -12
- package/dist/surface/templates/Text.d.ts +0 -4
- package/dist/surface/templates/Text.js +0 -15
- package/dist/surface/templates/index.d.ts +0 -7
- package/dist/surface/templates/index.js +0 -32
- package/dist/surface/types.d.ts +0 -68
- package/dist/surface/types.js +0 -6
- package/dist/theme.d.ts +0 -62
- package/dist/theme.js +0 -9
- package/dist/useTokens.d.ts +0 -7
- package/dist/useTokens.js +0 -41
- package/dist/voice/VoiceWindow.d.ts +0 -18
- package/dist/voice/VoiceWindow.js +0 -35
- package/dist/voice/index.d.ts +0 -13
- package/dist/voice/index.js +0 -12
- package/dist/voice/meter.d.ts +0 -16
- package/dist/voice/meter.js +0 -52
- package/dist/voice/orbColors.d.ts +0 -16
- package/dist/voice/orbColors.js +0 -75
- package/dist/voice/pushable.d.ts +0 -16
- package/dist/voice/pushable.js +0 -56
- package/dist/voice/useDictation.d.ts +0 -24
- package/dist/voice/useDictation.js +0 -60
- package/dist/voice/useReducedMotion.d.ts +0 -5
- package/dist/voice/useVoice.d.ts +0 -70
- package/dist/voice/useVoice.js +0 -197
- package/dist/voice/useVoicePrimitives.d.ts +0 -7
- package/dist/voice/useVoicePrimitives.js +0 -11
- package/dist/voice/voice.d.ts +0 -55
- package/dist/voice/voice.js +0 -9
- package/dist/voice/webSpeech.d.ts +0 -33
- package/dist/voice/webSpeech.js +0 -258
- package/dist/widget.js.map +0 -1
- package/dist/windows/AgentSpace.d.ts +0 -78
- package/dist/windows/AgentSpace.js +0 -135
- package/dist/windows/Captions.d.ts +0 -13
- package/dist/windows/Captions.js +0 -22
- package/dist/windows/Dock.d.ts +0 -37
- package/dist/windows/Dock.js +0 -22
- package/dist/windows/Journal.d.ts +0 -15
- package/dist/windows/Journal.js +0 -19
- package/dist/windows/KindMark.d.ts +0 -7
- package/dist/windows/KindMark.js +0 -31
- package/dist/windows/Pending.d.ts +0 -8
- package/dist/windows/Pending.js +0 -17
- package/dist/windows/Stage.d.ts +0 -18
- package/dist/windows/Stage.js +0 -21
- package/dist/windows/StatusLabel.d.ts +0 -9
- package/dist/windows/StatusLabel.js +0 -7
- package/dist/windows/Strip.d.ts +0 -17
- package/dist/windows/Strip.js +0 -42
- package/dist/windows/SurfaceWindow.d.ts +0 -20
- package/dist/windows/SurfaceWindow.js +0 -12
- package/dist/windows/WindowFrame.d.ts +0 -23
- package/dist/windows/WindowFrame.js +0 -22
- package/dist/windows/hearing.d.ts +0 -11
- package/dist/windows/hearing.js +0 -26
- package/dist/windows/kinds.d.ts +0 -47
- package/dist/windows/kinds.js +0 -28
- package/dist/windows/reduce.d.ts +0 -98
- package/dist/windows/reduce.js +0 -151
- package/dist/windows/registry.d.ts +0 -18
- package/dist/windows/registry.js +0 -61
- package/dist/windows/reveal.d.ts +0 -9
- package/dist/windows/reveal.js +0 -6
- package/dist/windows/space.d.ts +0 -21
- package/dist/windows/space.js +0 -6
- package/dist/windows/status.d.ts +0 -11
- package/dist/windows/status.js +0 -30
- package/dist/windows/types.d.ts +0 -15
- package/dist/windows/types.js +0 -1
- package/dist/windows/useLoaded.d.ts +0 -44
- package/dist/windows/useLoaded.js +0 -58
- package/dist/windows/useUnread.d.ts +0 -7
- package/dist/windows/useUnread.js +0 -21
- package/dist/windows/useWindows.d.ts +0 -70
- package/dist/windows/useWindows.js +0 -60
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NumberBounds } from "./numbers.js";
|
|
2
|
+
import { ControlBase } from "./Field.js";
|
|
3
|
+
//#region src/kit/RangeField.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A number on a slider between its least and its most: the value rides over the thumb in a
|
|
6
|
+
* bubble, with its unit, and the two ends sit under the track.
|
|
7
|
+
*/
|
|
8
|
+
export declare function RangeField({ value, onChange, min, max, step, unit, ...control }: ControlBase & NumberBounds & {
|
|
9
|
+
value: number;
|
|
10
|
+
onChange: (value: number) => void;
|
|
11
|
+
unit?: string | undefined;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
//# sourceMappingURL=RangeField.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { formatNumber, withUnit } from "./numbers.js";
|
|
2
|
+
import { useKit, useParts } from "./context.js";
|
|
3
|
+
import { ariaOf } from "./Field.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/kit/RangeField.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A number on a slider between its least and its most: the value rides over the thumb in a
|
|
8
|
+
* bubble, with its unit, and the two ends sit under the track.
|
|
9
|
+
*/
|
|
10
|
+
function RangeField({ value, onChange, min = 0, max = 100, step, unit, ...control }) {
|
|
11
|
+
const { code } = useKit();
|
|
12
|
+
const part = useParts();
|
|
13
|
+
const share = max > min ? (Math.min(max, Math.max(min, value)) - min) / (max - min) : 0;
|
|
14
|
+
const said = withUnit(formatNumber(value, code), unit);
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
16
|
+
className: part("sc-range"),
|
|
17
|
+
style: { "--_share": share },
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx("output", {
|
|
20
|
+
htmlFor: control.id,
|
|
21
|
+
"aria-hidden": true,
|
|
22
|
+
children: said
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ jsx("input", {
|
|
25
|
+
id: control.id,
|
|
26
|
+
type: "range",
|
|
27
|
+
min,
|
|
28
|
+
max,
|
|
29
|
+
step: step ?? 1,
|
|
30
|
+
value,
|
|
31
|
+
disabled: control.disabled,
|
|
32
|
+
onChange: (event) => onChange(Number(event.target.value)),
|
|
33
|
+
"aria-valuetext": said,
|
|
34
|
+
...ariaOf(control),
|
|
35
|
+
"aria-required": void 0
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ jsxs("span", {
|
|
38
|
+
"aria-hidden": true,
|
|
39
|
+
children: [/* @__PURE__ */ jsx("span", { children: withUnit(formatNumber(min, code), unit) }), /* @__PURE__ */ jsx("span", { children: withUnit(formatNumber(max, code), unit) })]
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { RangeField };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=RangeField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeField.js","names":[],"sources":["../../src/kit/RangeField.tsx"],"sourcesContent":["import type { CSSProperties } from \"react\";\n\nimport { useKit, useParts } from \"./context\";\nimport { ariaOf, type ControlBase } from \"./Field\";\nimport { formatNumber, withUnit, type NumberBounds } from \"./numbers\";\n\n/**\n * A number on a slider between its least and its most: the value rides over the thumb in a\n * bubble, with its unit, and the two ends sit under the track.\n */\nexport function RangeField({\n value,\n onChange,\n min = 0,\n max = 100,\n step,\n unit,\n ...control\n}: ControlBase &\n NumberBounds & {\n value: number;\n onChange: (value: number) => void;\n unit?: string | undefined;\n }) {\n const { code } = useKit();\n const part = useParts();\n const share = max > min ? (Math.min(max, Math.max(min, value)) - min) / (max - min) : 0;\n const said = withUnit(formatNumber(value, code), unit);\n return (\n <div className={part(\"sc-range\")} style={{ \"--_share\": share } as CSSProperties}>\n <output htmlFor={control.id} aria-hidden>\n {said}\n </output>\n <input\n id={control.id}\n type=\"range\"\n min={min}\n max={max}\n step={step ?? 1}\n value={value}\n disabled={control.disabled}\n onChange={(event) => onChange(Number(event.target.value))}\n aria-valuetext={said}\n {...ariaOf(control)}\n aria-required={undefined}\n />\n <span aria-hidden>\n <span>{withUnit(formatNumber(min, code), unit)}</span>\n <span>{withUnit(formatNumber(max, code), unit)}</span>\n </span>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgB,WAAW,EACzB,OACA,UACA,MAAM,GACN,MAAM,KACN,MACA,MACA,GAAG,WAMA;CACH,MAAM,EAAE,SAAS,OAAO;CACxB,MAAM,OAAO,SAAS;CACtB,MAAM,QAAQ,MAAM,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC,IAAI,QAAQ,MAAM,OAAO;CACtF,MAAM,OAAO,SAAS,aAAa,OAAO,IAAI,GAAG,IAAI;CACrD,OACE,qBAAC,OAAD;EAAK,WAAW,KAAK,UAAU;EAAG,OAAO,EAAE,YAAY,MAAM;EAA7D,UAAA;GACE,oBAAC,UAAD;IAAQ,SAAS,QAAQ;IAAI,eAAA;IAC1B,UAAA;GACK,CAAA;GACR,oBAAC,SAAD;IACE,IAAI,QAAQ;IACZ,MAAK;IACA;IACA;IACL,MAAM,QAAQ;IACP;IACP,UAAU,QAAQ;IAClB,WAAW,UAAU,SAAS,OAAO,MAAM,OAAO,KAAK,CAAC;IACxD,kBAAgB;IAChB,GAAI,OAAO,OAAO;IAClB,iBAAe,KAAA;GAChB,CAAA;GACD,qBAAC,QAAD;IAAM,eAAA;IAAN,UAAA,CACE,oBAAC,QAAD,EAAA,UAAO,SAAS,aAAa,KAAK,IAAI,GAAG,IAAI,EAAQ,CAAA,GACrD,oBAAC,QAAD,EAAA,UAAO,SAAS,aAAa,KAAK,IAAI,GAAG,IAAI,EAAQ,CAAA,CACjD;;EACH;;AAET"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ControlBase } from "./Field.js";
|
|
2
|
+
//#region src/kit/RatingField.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Stars up to `max`, as a group of radios: the arrows move the rating, the pointer lights the
|
|
5
|
+
* stars it is over before the press, and the rating reads beside them.
|
|
6
|
+
*/
|
|
7
|
+
export declare function RatingField({ value, onChange, max, ...control }: ControlBase & {
|
|
8
|
+
/** The stars given, or none. */
|
|
9
|
+
value: number | null;
|
|
10
|
+
onChange: (value: number) => void;
|
|
11
|
+
max?: number | undefined;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
//# sourceMappingURL=RatingField.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useKit, useParts } from "./context.js";
|
|
2
|
+
import { ariaOf } from "./Field.js";
|
|
3
|
+
import { useRadios } from "./Choices.js";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { StarIcon } from "@phosphor-icons/react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
const MOST = 10;
|
|
8
|
+
/**
|
|
9
|
+
* Stars up to `max`, as a group of radios: the arrows move the rating, the pointer lights the
|
|
10
|
+
* stars it is over before the press, and the rating reads beside them.
|
|
11
|
+
*/
|
|
12
|
+
function RatingField({ value, onChange, max = 5, ...control }) {
|
|
13
|
+
const { messages } = useKit();
|
|
14
|
+
const part = useParts();
|
|
15
|
+
const stars = Math.min(MOST, Math.max(1, Math.round(max)));
|
|
16
|
+
const rating = value === null ? 0 : Math.round(value);
|
|
17
|
+
const [over, setOver] = useState(0);
|
|
18
|
+
const radios = useRadios(stars, rating - 1, (index) => onChange(index + 1));
|
|
19
|
+
const lit = over || rating;
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
role: "radiogroup",
|
|
22
|
+
...ariaOf(control),
|
|
23
|
+
onMouseLeave: () => setOver(0),
|
|
24
|
+
className: part("sc-rating"),
|
|
25
|
+
children: [Array.from({ length: stars }, (_, index) => /* @__PURE__ */ jsx("button", {
|
|
26
|
+
ref: radios.ref(index),
|
|
27
|
+
type: "button",
|
|
28
|
+
role: "radio",
|
|
29
|
+
"aria-checked": rating === index + 1,
|
|
30
|
+
"aria-label": messages.stars(index + 1),
|
|
31
|
+
tabIndex: radios.tabIndex(index),
|
|
32
|
+
disabled: control.disabled,
|
|
33
|
+
"data-lit": index < lit || void 0,
|
|
34
|
+
onKeyDown: (event) => radios.onKeyDown(event, index),
|
|
35
|
+
onMouseEnter: () => setOver(index + 1),
|
|
36
|
+
onClick: () => onChange(index + 1),
|
|
37
|
+
children: /* @__PURE__ */ jsx(StarIcon, {
|
|
38
|
+
"aria-hidden": true,
|
|
39
|
+
weight: index < lit ? "fill" : "regular"
|
|
40
|
+
})
|
|
41
|
+
}, index)), rating > 0 && /* @__PURE__ */ jsx("span", {
|
|
42
|
+
"aria-hidden": true,
|
|
43
|
+
children: messages.rated(rating, stars)
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { RatingField };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=RatingField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RatingField.js","names":[],"sources":["../../src/kit/RatingField.tsx"],"sourcesContent":["import { StarIcon } from \"@phosphor-icons/react\";\nimport { useState } from \"react\";\n\nimport { useRadios } from \"./Choices\";\nimport { useKit, useParts } from \"./context\";\nimport { ariaOf, type ControlBase } from \"./Field\";\n\n/** Stars when none are given, and the most a rating draws. */\nexport const STARS = 5;\nconst MOST = 10;\n\n/**\n * Stars up to `max`, as a group of radios: the arrows move the rating, the pointer lights the\n * stars it is over before the press, and the rating reads beside them.\n */\nexport function RatingField({\n value,\n onChange,\n max = STARS,\n ...control\n}: ControlBase & {\n /** The stars given, or none. */\n value: number | null;\n onChange: (value: number) => void;\n max?: number | undefined;\n}) {\n const { messages } = useKit();\n const part = useParts();\n const stars = Math.min(MOST, Math.max(1, Math.round(max)));\n const rating = value === null ? 0 : Math.round(value);\n const [over, setOver] = useState(0);\n const radios = useRadios(stars, rating - 1, (index) => onChange(index + 1));\n const lit = over || rating;\n return (\n <div\n role=\"radiogroup\"\n {...ariaOf(control)}\n onMouseLeave={() => setOver(0)}\n className={part(\"sc-rating\")}\n >\n {Array.from({ length: stars }, (_, index) => (\n <button\n key={index}\n ref={radios.ref(index)}\n type=\"button\"\n role=\"radio\"\n aria-checked={rating === index + 1}\n aria-label={messages.stars(index + 1)}\n tabIndex={radios.tabIndex(index)}\n disabled={control.disabled}\n data-lit={index < lit || undefined}\n onKeyDown={(event) => radios.onKeyDown(event, index)}\n onMouseEnter={() => setOver(index + 1)}\n onClick={() => onChange(index + 1)}\n >\n <StarIcon aria-hidden weight={index < lit ? \"fill\" : \"regular\"} />\n </button>\n ))}\n {rating > 0 && <span aria-hidden>{messages.rated(rating, stars)}</span>}\n </div>\n );\n}\n"],"mappings":";;;;;;AASA,MAAM,OAAO;;;;;AAMb,SAAgB,YAAY,EAC1B,OACA,UACA,MAAA,GACA,GAAG,WAMF;CACD,MAAM,EAAE,aAAa,OAAO;CAC5B,MAAM,OAAO,SAAS;CACtB,MAAM,QAAQ,KAAK,IAAI,MAAM,KAAK,IAAI,GAAG,KAAK,MAAM,GAAG,CAAC,CAAC;CACzD,MAAM,SAAS,UAAU,OAAO,IAAI,KAAK,MAAM,KAAK;CACpD,MAAM,CAAC,MAAM,WAAW,SAAS,CAAC;CAClC,MAAM,SAAS,UAAU,OAAO,SAAS,IAAI,UAAU,SAAS,QAAQ,CAAC,CAAC;CAC1E,MAAM,MAAM,QAAQ;CACpB,OACE,qBAAC,OAAD;EACE,MAAK;EACL,GAAI,OAAO,OAAO;EAClB,oBAAoB,QAAQ,CAAC;EAC7B,WAAW,KAAK,WAAW;EAJ7B,UAAA,CAMG,MAAM,KAAK,EAAE,QAAQ,MAAM,IAAI,GAAG,UACjC,oBAAC,UAAD;GAEE,KAAK,OAAO,IAAI,KAAK;GACrB,MAAK;GACL,MAAK;GACL,gBAAc,WAAW,QAAQ;GACjC,cAAY,SAAS,MAAM,QAAQ,CAAC;GACpC,UAAU,OAAO,SAAS,KAAK;GAC/B,UAAU,QAAQ;GAClB,YAAU,QAAQ,OAAO,KAAA;GACzB,YAAY,UAAU,OAAO,UAAU,OAAO,KAAK;GACnD,oBAAoB,QAAQ,QAAQ,CAAC;GACrC,eAAe,SAAS,QAAQ,CAAC;GAEjC,UAAA,oBAAC,UAAD;IAAU,eAAA;IAAY,QAAQ,QAAQ,MAAM,SAAS;GAAY,CAAA;EAC3D,GAdD,KAcC,CACT,GACA,SAAS,KAAK,oBAAC,QAAD;GAAM,eAAA;GAAa,UAAA,SAAS,MAAM,QAAQ,KAAK;EAAQ,CAAA,CACnE;;AAET"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/kit/Stat.d.ts
|
|
3
|
+
export type Tone = "info" | "success" | "warning" | "danger";
|
|
4
|
+
/** One number that matters: a quiet label, the figure large, a line of context in its tone. */
|
|
5
|
+
export declare function Stat({ label, value, hint, tone, className }: {
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
value: ReactNode;
|
|
8
|
+
hint?: ReactNode;
|
|
9
|
+
/** The hint's: a rise in success, a fall in danger. */
|
|
10
|
+
tone?: Tone | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Figures side by side in one hairline box, a hairline between each, their figures a size
|
|
15
|
+
* quieter than a `Stat` alone: a day at a glance. All in a row where the box has room, two
|
|
16
|
+
* across where it has not.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Stats({ label, className, children }: {
|
|
19
|
+
/** What the figures are, for screen readers, when no heading above them says it. */
|
|
20
|
+
label?: string | undefined;
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
/** The figures, each a `Stat`. */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}): import("react").JSX.Element;
|
|
25
|
+
//#endregion
|
|
26
|
+
//# sourceMappingURL=Stat.d.ts.map
|
package/dist/kit/Stat.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { joined, useParts } from "./context.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/kit/Stat.tsx
|
|
4
|
+
/** One number that matters: a quiet label, the figure large, a line of context in its tone. */
|
|
5
|
+
function Stat({ label, value, hint, tone, className }) {
|
|
6
|
+
const part = useParts();
|
|
7
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8
|
+
part: "stat",
|
|
9
|
+
className: joined(part("sc-stat", ...tone !== void 0 ? [`sc-stat--${tone}`] : []), className),
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx("span", {
|
|
12
|
+
className: part("sc-stat__label"),
|
|
13
|
+
children: label
|
|
14
|
+
}),
|
|
15
|
+
/* @__PURE__ */ jsx("strong", {
|
|
16
|
+
className: part("sc-stat__value"),
|
|
17
|
+
children: value
|
|
18
|
+
}),
|
|
19
|
+
hint !== void 0 && /* @__PURE__ */ jsx("small", {
|
|
20
|
+
className: part("sc-stat__hint"),
|
|
21
|
+
children: hint
|
|
22
|
+
})
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Figures side by side in one hairline box, a hairline between each, their figures a size
|
|
28
|
+
* quieter than a `Stat` alone: a day at a glance. All in a row where the box has room, two
|
|
29
|
+
* across where it has not.
|
|
30
|
+
*/
|
|
31
|
+
function Stats({ label, className, children }) {
|
|
32
|
+
const part = useParts();
|
|
33
|
+
return /* @__PURE__ */ jsx("div", {
|
|
34
|
+
role: "group",
|
|
35
|
+
"aria-label": label,
|
|
36
|
+
className: joined(part("sc-stats"), className),
|
|
37
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
38
|
+
className: part("sc-stats__grid"),
|
|
39
|
+
children
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Stat, Stats };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=Stat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stat.js","names":[],"sources":["../../src/kit/Stat.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { joined, useParts } from \"./context\";\n\nexport type Tone = \"info\" | \"success\" | \"warning\" | \"danger\";\n\n/** One number that matters: a quiet label, the figure large, a line of context in its tone. */\nexport function Stat({\n label,\n value,\n hint,\n tone,\n className,\n}: {\n label: ReactNode;\n value: ReactNode;\n hint?: ReactNode;\n /** The hint's: a rise in success, a fall in danger. */\n tone?: Tone | undefined;\n className?: string | undefined;\n}) {\n const part = useParts();\n return (\n <div\n part=\"stat\"\n className={joined(\n part(\"sc-stat\", ...(tone !== undefined ? ([`sc-stat--${tone}`] as const) : [])),\n className,\n )}\n >\n <span className={part(\"sc-stat__label\")}>{label}</span>\n <strong className={part(\"sc-stat__value\")}>{value}</strong>\n {hint !== undefined && <small className={part(\"sc-stat__hint\")}>{hint}</small>}\n </div>\n );\n}\n\n/**\n * Figures side by side in one hairline box, a hairline between each, their figures a size\n * quieter than a `Stat` alone: a day at a glance. All in a row where the box has room, two\n * across where it has not.\n */\nexport function Stats({\n label,\n className,\n children,\n}: {\n /** What the figures are, for screen readers, when no heading above them says it. */\n label?: string | undefined;\n className?: string | undefined;\n /** The figures, each a `Stat`. */\n children: ReactNode;\n}) {\n const part = useParts();\n return (\n <div role=\"group\" aria-label={label} className={joined(part(\"sc-stats\"), className)}>\n <div className={part(\"sc-stats__grid\")}>{children}</div>\n </div>\n );\n}\n"],"mappings":";;;;AAOA,SAAgB,KAAK,EACnB,OACA,OACA,MACA,MACA,aAQC;CACD,MAAM,OAAO,SAAS;CACtB,OACE,qBAAC,OAAD;EACE,MAAK;EACL,WAAW,OACT,KAAK,WAAW,GAAI,SAAS,KAAA,IAAa,CAAC,YAAY,MAAM,IAAc,CAAC,CAAE,GAC9E,SACF;EALF,UAAA;GAOE,oBAAC,QAAD;IAAM,WAAW,KAAK,gBAAgB;IAAI,UAAA;GAAY,CAAA;GACtD,oBAAC,UAAD;IAAQ,WAAW,KAAK,gBAAgB;IAAI,UAAA;GAAc,CAAA;GACzD,SAAS,KAAA,KAAa,oBAAC,SAAD;IAAO,WAAW,KAAK,eAAe;IAAI,UAAA;GAAY,CAAA;EAC1E;;AAET;;;;;;AAOA,SAAgB,MAAM,EACpB,OACA,WACA,YAOC;CACD,MAAM,OAAO,SAAS;CACtB,OACE,oBAAC,OAAD;EAAK,MAAK;EAAQ,cAAY;EAAO,WAAW,OAAO,KAAK,UAAU,GAAG,SAAS;EAChF,UAAA,oBAAC,OAAD;GAAK,WAAW,KAAK,gBAAgB;GAAI;EAAc,CAAA;CACpD,CAAA;AAET"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/kit/Switch.d.ts
|
|
2
|
+
export interface SwitchProps {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
onChange: (checked: boolean) => void;
|
|
5
|
+
/** What it turns on and off, for screen readers when no label beside it says so. */
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
labelledBy?: string | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
className?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
/** On or off at once, as the ARIA switch: a track lit in the accent when on, its knob across. */
|
|
12
|
+
export declare function Switch({ checked, onChange, label, labelledBy, disabled, className }: SwitchProps): import("react").JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
//# sourceMappingURL=Switch.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { joined, useParts } from "./context.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/kit/Switch.tsx
|
|
4
|
+
/** On or off at once, as the ARIA switch: a track lit in the accent when on, its knob across. */
|
|
5
|
+
function Switch({ checked, onChange, label, labelledBy, disabled, className }) {
|
|
6
|
+
const part = useParts();
|
|
7
|
+
return /* @__PURE__ */ jsx("button", {
|
|
8
|
+
type: "button",
|
|
9
|
+
role: "switch",
|
|
10
|
+
"aria-checked": checked,
|
|
11
|
+
"aria-label": labelledBy === void 0 ? label : void 0,
|
|
12
|
+
"aria-labelledby": labelledBy,
|
|
13
|
+
disabled,
|
|
14
|
+
onClick: () => onChange(!checked),
|
|
15
|
+
className: joined(part("sc-switch"), className)
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Switch };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","names":[],"sources":["../../src/kit/Switch.tsx"],"sourcesContent":["import { joined, useParts } from \"./context\";\n\nexport interface SwitchProps {\n checked: boolean;\n onChange: (checked: boolean) => void;\n /** What it turns on and off, for screen readers when no label beside it says so. */\n label?: string | undefined;\n labelledBy?: string | undefined;\n disabled?: boolean | undefined;\n className?: string | undefined;\n}\n\n/** On or off at once, as the ARIA switch: a track lit in the accent when on, its knob across. */\nexport function Switch({ checked, onChange, label, labelledBy, disabled, className }: SwitchProps) {\n const part = useParts();\n return (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n aria-label={labelledBy === undefined ? label : undefined}\n aria-labelledby={labelledBy}\n disabled={disabled}\n onClick={() => onChange(!checked)}\n className={joined(part(\"sc-switch\"), className)}\n />\n );\n}\n"],"mappings":";;;;AAaA,SAAgB,OAAO,EAAE,SAAS,UAAU,OAAO,YAAY,UAAU,aAA0B;CACjG,MAAM,OAAO,SAAS;CACtB,OACE,oBAAC,UAAD;EACE,MAAK;EACL,MAAK;EACL,gBAAc;EACd,cAAY,eAAe,KAAA,IAAY,QAAQ,KAAA;EAC/C,mBAAiB;EACP;EACV,eAAe,SAAS,CAAC,OAAO;EAChC,WAAW,OAAO,KAAK,WAAW,GAAG,SAAS;CAC/C,CAAA;AAEL"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Tone } from "./Stat.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/kit/Tag.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A short word beside what it qualifies, no pill: how something stands, in its tone ("Falló" in
|
|
6
|
+
* danger, "Espera tu respuesta" in the accent), a small glyph or dot before the words when
|
|
7
|
+
* `children` starts with one. For state only: a property a row always has is said by where the
|
|
8
|
+
* row sits (under a heading), not by a word on each.
|
|
9
|
+
*/
|
|
10
|
+
export declare function Tag({ tone, className, children }: {
|
|
11
|
+
tone?: Tone | undefined;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
//# sourceMappingURL=Tag.d.ts.map
|
package/dist/kit/Tag.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { joined, useParts } from "./context.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/kit/Tag.tsx
|
|
4
|
+
/**
|
|
5
|
+
* A short word beside what it qualifies, no pill: how something stands, in its tone ("Falló" in
|
|
6
|
+
* danger, "Espera tu respuesta" in the accent), a small glyph or dot before the words when
|
|
7
|
+
* `children` starts with one. For state only: a property a row always has is said by where the
|
|
8
|
+
* row sits (under a heading), not by a word on each.
|
|
9
|
+
*/
|
|
10
|
+
function Tag({ tone, className, children }) {
|
|
11
|
+
const part = useParts();
|
|
12
|
+
return /* @__PURE__ */ jsx("span", {
|
|
13
|
+
className: joined(part("sc-tag", ...tone !== void 0 ? [`sc-tag--${tone}`] : []), className),
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Tag };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=Tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.js","names":[],"sources":["../../src/kit/Tag.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { joined, useParts } from \"./context\";\nimport type { Tone } from \"./Stat\";\n\n/**\n * A short word beside what it qualifies, no pill: how something stands, in its tone (\"Falló\" in\n * danger, \"Espera tu respuesta\" in the accent), a small glyph or dot before the words when\n * `children` starts with one. For state only: a property a row always has is said by where the\n * row sits (under a heading), not by a word on each.\n */\nexport function Tag({\n tone,\n className,\n children,\n}: {\n tone?: Tone | undefined;\n className?: string | undefined;\n children: ReactNode;\n}) {\n const part = useParts();\n return (\n <span\n className={joined(\n part(\"sc-tag\", ...(tone !== undefined ? ([`sc-tag--${tone}`] as const) : [])),\n className,\n )}\n >\n {children}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,SAAgB,IAAI,EAClB,MACA,WACA,YAKC;CACD,MAAM,OAAO,SAAS;CACtB,OACE,oBAAC,QAAD;EACE,WAAW,OACT,KAAK,UAAU,GAAI,SAAS,KAAA,IAAa,CAAC,WAAW,MAAM,IAAc,CAAC,CAAE,GAC5E,SACF;EAEC;CACG,CAAA;AAEV"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/kit/Tile.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Tiles in a grid that asks its own width, not the window's: two across, one when narrow, three
|
|
5
|
+
* when there is room. What an agent works with, a squad's agents at a glance.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Tiles({ label, className, children }: {
|
|
8
|
+
/** The grid's name, for screen readers, when no heading above it says it. */
|
|
9
|
+
label?: string | undefined;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
export interface TileProps {
|
|
14
|
+
/** At its start, usually a small `Mark`: what kind of thing it is. */
|
|
15
|
+
mark?: ReactNode;
|
|
16
|
+
/** What it is, in a word or two. */
|
|
17
|
+
title: ReactNode;
|
|
18
|
+
/** How many it holds, at its end, in figures that line up. */
|
|
19
|
+
count?: ReactNode;
|
|
20
|
+
/** In the count's place, what says it better: a few logos and how many more. */
|
|
21
|
+
end?: ReactNode;
|
|
22
|
+
/** Pressing the tile: it opens what it stands for. */
|
|
23
|
+
onPress?: (() => void) | undefined;
|
|
24
|
+
/** Holding nothing yet: quieter, still to press. */
|
|
25
|
+
quiet?: boolean | undefined;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* One tile of `Tiles`, on one line: its mark, its name, and at its end its count (or what says it
|
|
30
|
+
* better). With `onPress` the whole tile is a button.
|
|
31
|
+
*/
|
|
32
|
+
export declare function Tile({ mark, title, count, end, onPress, quiet, className }: TileProps): import("react").JSX.Element;
|
|
33
|
+
//#endregion
|
|
34
|
+
//# sourceMappingURL=Tile.d.ts.map
|
package/dist/kit/Tile.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { joined, useParts } from "./context.js";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/kit/Tile.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Tiles in a grid that asks its own width, not the window's: two across, one when narrow, three
|
|
6
|
+
* when there is room. What an agent works with, a squad's agents at a glance.
|
|
7
|
+
*/
|
|
8
|
+
function Tiles({ label, className, children }) {
|
|
9
|
+
const part = useParts();
|
|
10
|
+
return /* @__PURE__ */ jsx("div", {
|
|
11
|
+
className: joined(part("sc-tiles"), className),
|
|
12
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
13
|
+
"aria-label": label,
|
|
14
|
+
className: part("sc-tiles__grid"),
|
|
15
|
+
children
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One tile of `Tiles`, on one line: its mark, its name, and at its end its count (or what says it
|
|
21
|
+
* better). With `onPress` the whole tile is a button.
|
|
22
|
+
*/
|
|
23
|
+
function Tile({ mark, title, count, end, onPress, quiet, className }) {
|
|
24
|
+
const part = useParts();
|
|
25
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26
|
+
mark,
|
|
27
|
+
/* @__PURE__ */ jsx("span", {
|
|
28
|
+
className: part("sc-tile__title"),
|
|
29
|
+
children: title
|
|
30
|
+
}),
|
|
31
|
+
end ?? (count !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
32
|
+
className: part("sc-tile__count"),
|
|
33
|
+
children: count
|
|
34
|
+
}))
|
|
35
|
+
] });
|
|
36
|
+
return /* @__PURE__ */ jsx("li", {
|
|
37
|
+
className: joined(part("sc-tile", ...quiet ? ["sc-tile--quiet"] : []), className),
|
|
38
|
+
children: onPress ? /* @__PURE__ */ jsx("button", {
|
|
39
|
+
type: "button",
|
|
40
|
+
onClick: onPress,
|
|
41
|
+
className: part("sc-tile__main"),
|
|
42
|
+
children: body
|
|
43
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
44
|
+
className: part("sc-tile__main"),
|
|
45
|
+
children: body
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { Tile, Tiles };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=Tile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tile.js","names":[],"sources":["../../src/kit/Tile.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { joined, useParts } from \"./context\";\n\n/**\n * Tiles in a grid that asks its own width, not the window's: two across, one when narrow, three\n * when there is room. What an agent works with, a squad's agents at a glance.\n */\nexport function Tiles({\n label,\n className,\n children,\n}: {\n /** The grid's name, for screen readers, when no heading above it says it. */\n label?: string | undefined;\n className?: string | undefined;\n children: ReactNode;\n}) {\n const part = useParts();\n return (\n <div className={joined(part(\"sc-tiles\"), className)}>\n <ul aria-label={label} className={part(\"sc-tiles__grid\")}>\n {children}\n </ul>\n </div>\n );\n}\n\nexport interface TileProps {\n /** At its start, usually a small `Mark`: what kind of thing it is. */\n mark?: ReactNode;\n /** What it is, in a word or two. */\n title: ReactNode;\n /** How many it holds, at its end, in figures that line up. */\n count?: ReactNode;\n /** In the count's place, what says it better: a few logos and how many more. */\n end?: ReactNode;\n /** Pressing the tile: it opens what it stands for. */\n onPress?: (() => void) | undefined;\n /** Holding nothing yet: quieter, still to press. */\n quiet?: boolean | undefined;\n className?: string | undefined;\n}\n\n/**\n * One tile of `Tiles`, on one line: its mark, its name, and at its end its count (or what says it\n * better). With `onPress` the whole tile is a button.\n */\nexport function Tile({ mark, title, count, end, onPress, quiet, className }: TileProps) {\n const part = useParts();\n const body = (\n <>\n {mark}\n <span className={part(\"sc-tile__title\")}>{title}</span>\n {end ?? (count !== undefined && <span className={part(\"sc-tile__count\")}>{count}</span>)}\n </>\n );\n return (\n <li\n className={joined(\n part(\"sc-tile\", ...(quiet ? ([\"sc-tile--quiet\"] as const) : [])),\n className,\n )}\n >\n {onPress ? (\n <button type=\"button\" onClick={onPress} className={part(\"sc-tile__main\")}>\n {body}\n </button>\n ) : (\n <div className={part(\"sc-tile__main\")}>{body}</div>\n )}\n </li>\n );\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,MAAM,EACpB,OACA,WACA,YAMC;CACD,MAAM,OAAO,SAAS;CACtB,OACE,oBAAC,OAAD;EAAK,WAAW,OAAO,KAAK,UAAU,GAAG,SAAS;EAChD,UAAA,oBAAC,MAAD;GAAI,cAAY;GAAO,WAAW,KAAK,gBAAgB;GACpD;EACC,CAAA;CACD,CAAA;AAET;;;;;AAsBA,SAAgB,KAAK,EAAE,MAAM,OAAO,OAAO,KAAK,SAAS,OAAO,aAAwB;CACtF,MAAM,OAAO,SAAS;CACtB,MAAM,OACJ,qBAAA,UAAA,EAAA,UAAA;EACG;EACD,oBAAC,QAAD;GAAM,WAAW,KAAK,gBAAgB;GAAI,UAAA;EAAY,CAAA;EACrD,QAAQ,UAAU,KAAA,KAAa,oBAAC,QAAD;GAAM,WAAW,KAAK,gBAAgB;GAAI,UAAA;EAAY,CAAA;CACtF,EAAA,CAAA;CAEJ,OACE,oBAAC,MAAD;EACE,WAAW,OACT,KAAK,WAAW,GAAI,QAAS,CAAC,gBAAgB,IAAc,CAAC,CAAE,GAC/D,SACF;EAEC,UAAA,UACC,oBAAC,UAAD;GAAQ,MAAK;GAAS,SAAS;GAAS,WAAW,KAAK,eAAe;GACpE,UAAA;EACK,CAAA,IAER,oBAAC,OAAD;GAAK,WAAW,KAAK,eAAe;GAAI,UAAA;EAAU,CAAA;CAElD,CAAA;AAER"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ControlBase } from "./Field.js";
|
|
2
|
+
import { DayBounds } from "./dates.js";
|
|
3
|
+
//#region src/kit/TimeField.d.ts
|
|
4
|
+
export interface TimeFieldProps extends ControlBase {
|
|
5
|
+
/** The time picked, "HH:MM", or none. */
|
|
6
|
+
value: string | null;
|
|
7
|
+
onChange: (time: string | null) => void;
|
|
8
|
+
/** The only slots, "HH:MM". */
|
|
9
|
+
times?: string[] | undefined;
|
|
10
|
+
placeholder?: string | undefined;
|
|
11
|
+
/** It is where a stretch of the day ends: the day's end ("24:00") is offered last, and typed. */
|
|
12
|
+
endOfDay?: boolean | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A time: the slots offered as chips to pick one of, when there are; else a list of the half
|
|
16
|
+
* hours to search, which also takes a time typed ("9:15", "21.30").
|
|
17
|
+
*/
|
|
18
|
+
export declare function TimeField(props: TimeFieldProps): import("react").JSX.Element;
|
|
19
|
+
export interface DateTimeFieldProps extends ControlBase, DayBounds {
|
|
20
|
+
/** "YYYY-MM-DDTHH:MM"; held as "YYYY-MM-DDT" or "THH:MM" while half picked; none when neither. */
|
|
21
|
+
value: string | null;
|
|
22
|
+
onChange: (moment: string | null) => void;
|
|
23
|
+
times?: string[] | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A moment: a day and a time side by side, one over the other when narrow or when the time is
|
|
27
|
+
* a grid of slots. Each half is kept while the other is still to pick.
|
|
28
|
+
*/
|
|
29
|
+
export declare function DateTimeField({ value, onChange, dates, earliest, latest, times, ...control }: DateTimeFieldProps): import("react").JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=TimeField.d.ts.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { useKit, useParts } from "./context.js";
|
|
2
|
+
import { ariaOf } from "./Field.js";
|
|
3
|
+
import { useRadios } from "./Choices.js";
|
|
4
|
+
import { Combobox } from "./Combobox.js";
|
|
5
|
+
import { DAY_END, formatTime, halfHours, momentOf, momentParts, parseEndTime, parseTime } from "./dates.js";
|
|
6
|
+
import { DateField } from "./DateField.js";
|
|
7
|
+
import { ClockIcon } from "@phosphor-icons/react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/kit/TimeField.tsx
|
|
10
|
+
/** Where a list of times opens while none is picked: the start of a working day. */
|
|
11
|
+
const MORNING = "09:00";
|
|
12
|
+
/**
|
|
13
|
+
* A time: the slots offered as chips to pick one of, when there are; else a list of the half
|
|
14
|
+
* hours to search, which also takes a time typed ("9:15", "21.30").
|
|
15
|
+
*/
|
|
16
|
+
function TimeField(props) {
|
|
17
|
+
return props.times ? /* @__PURE__ */ jsx(Slots, {
|
|
18
|
+
...props,
|
|
19
|
+
times: props.times
|
|
20
|
+
}) : /* @__PURE__ */ jsx(AnyTime, { ...props });
|
|
21
|
+
}
|
|
22
|
+
/** The slots, a chip each in a grid, as one group of radios. */
|
|
23
|
+
function Slots({ value, onChange, times, endOfDay: _, ...control }) {
|
|
24
|
+
const { code } = useKit();
|
|
25
|
+
const part = useParts();
|
|
26
|
+
const checked = value === null ? -1 : times.indexOf(value);
|
|
27
|
+
const radios = useRadios(times.length, checked, (index) => {
|
|
28
|
+
const time = times[index];
|
|
29
|
+
if (time !== void 0) onChange(time);
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ jsx("div", {
|
|
32
|
+
role: "radiogroup",
|
|
33
|
+
...ariaOf(control),
|
|
34
|
+
className: part("sc-slots"),
|
|
35
|
+
children: times.map((time, index) => /* @__PURE__ */ jsx("button", {
|
|
36
|
+
ref: radios.ref(index),
|
|
37
|
+
type: "button",
|
|
38
|
+
role: "radio",
|
|
39
|
+
"aria-checked": index === checked,
|
|
40
|
+
tabIndex: radios.tabIndex(index),
|
|
41
|
+
disabled: control.disabled,
|
|
42
|
+
onKeyDown: (event) => radios.onKeyDown(event, index),
|
|
43
|
+
onClick: () => onChange(time),
|
|
44
|
+
className: part("sc-chip"),
|
|
45
|
+
children: formatTime(time, code)
|
|
46
|
+
}, time))
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/** Any time of the day: the half hours to pick from, or one typed; an end, the day's end too. */
|
|
50
|
+
function AnyTime({ value, onChange, placeholder, times: _, endOfDay = false, ...control }) {
|
|
51
|
+
const { code, messages } = useKit();
|
|
52
|
+
const parse = endOfDay ? parseEndTime : parseTime;
|
|
53
|
+
const time = value !== null && parse(value) ? value : null;
|
|
54
|
+
const times = endOfDay ? [...halfHours(), DAY_END] : halfHours();
|
|
55
|
+
if (time !== null && !times.includes(time)) times.push(time);
|
|
56
|
+
return /* @__PURE__ */ jsx(Combobox, {
|
|
57
|
+
...control,
|
|
58
|
+
options: times.toSorted().map((at) => ({
|
|
59
|
+
id: at,
|
|
60
|
+
label: formatTime(at, code)
|
|
61
|
+
})),
|
|
62
|
+
value: time === null ? [] : [time],
|
|
63
|
+
multiple: false,
|
|
64
|
+
onChange: (ids) => onChange(ids[0] ?? null),
|
|
65
|
+
typed: (text) => {
|
|
66
|
+
const typed = parse(text);
|
|
67
|
+
return typed === null ? null : {
|
|
68
|
+
id: typed,
|
|
69
|
+
label: formatTime(typed, code)
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
start: MORNING,
|
|
73
|
+
placeholder: placeholder ?? messages.chooseTime,
|
|
74
|
+
icon: ClockIcon
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A moment: a day and a time side by side, one over the other when narrow or when the time is
|
|
79
|
+
* a grid of slots. Each half is kept while the other is still to pick.
|
|
80
|
+
*/
|
|
81
|
+
function DateTimeField({ value, onChange, dates, earliest, latest, times, ...control }) {
|
|
82
|
+
const part = useParts();
|
|
83
|
+
const [date, time] = momentParts(value);
|
|
84
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
85
|
+
role: "group",
|
|
86
|
+
...ariaOf(control),
|
|
87
|
+
"aria-required": void 0,
|
|
88
|
+
"data-slots": times ? "" : void 0,
|
|
89
|
+
className: part("sc-moment"),
|
|
90
|
+
children: [/* @__PURE__ */ jsx(DateField, {
|
|
91
|
+
...control,
|
|
92
|
+
value: date || null,
|
|
93
|
+
dates,
|
|
94
|
+
earliest,
|
|
95
|
+
latest,
|
|
96
|
+
onChange: (day) => onChange(momentOf(day, time))
|
|
97
|
+
}), /* @__PURE__ */ jsx(TimeField, {
|
|
98
|
+
...control,
|
|
99
|
+
id: control.id === void 0 ? void 0 : `${control.id}-time`,
|
|
100
|
+
value: time || null,
|
|
101
|
+
times,
|
|
102
|
+
onChange: (at) => onChange(momentOf(date, at ?? ""))
|
|
103
|
+
})]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { DateTimeField, TimeField };
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=TimeField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeField.js","names":[],"sources":["../../src/kit/TimeField.tsx"],"sourcesContent":["import { ClockIcon } from \"@phosphor-icons/react\";\n\nimport { useRadios } from \"./Choices\";\nimport { Combobox } from \"./Combobox\";\nimport { useKit, useParts } from \"./context\";\nimport { DateField } from \"./DateField\";\nimport {\n DAY_END,\n formatTime,\n halfHours,\n momentOf,\n momentParts,\n parseEndTime,\n parseTime,\n type DayBounds,\n} from \"./dates\";\nimport { ariaOf, type ControlBase } from \"./Field\";\n\n/** Where a list of times opens while none is picked: the start of a working day. */\nconst MORNING = \"09:00\";\n\nexport interface TimeFieldProps extends ControlBase {\n /** The time picked, \"HH:MM\", or none. */\n value: string | null;\n onChange: (time: string | null) => void;\n /** The only slots, \"HH:MM\". */\n times?: string[] | undefined;\n placeholder?: string | undefined;\n /** It is where a stretch of the day ends: the day's end (\"24:00\") is offered last, and typed. */\n endOfDay?: boolean | undefined;\n}\n\n/**\n * A time: the slots offered as chips to pick one of, when there are; else a list of the half\n * hours to search, which also takes a time typed (\"9:15\", \"21.30\").\n */\nexport function TimeField(props: TimeFieldProps) {\n return props.times ? <Slots {...props} times={props.times} /> : <AnyTime {...props} />;\n}\n\n/** The slots, a chip each in a grid, as one group of radios. */\nfunction Slots({\n value,\n onChange,\n times,\n endOfDay: _,\n ...control\n}: TimeFieldProps & { times: string[] }) {\n const { code } = useKit();\n const part = useParts();\n const checked = value === null ? -1 : times.indexOf(value);\n const radios = useRadios(times.length, checked, (index) => {\n const time = times[index];\n if (time !== undefined) onChange(time);\n });\n return (\n <div role=\"radiogroup\" {...ariaOf(control)} className={part(\"sc-slots\")}>\n {times.map((time, index) => (\n <button\n key={time}\n ref={radios.ref(index)}\n type=\"button\"\n role=\"radio\"\n aria-checked={index === checked}\n tabIndex={radios.tabIndex(index)}\n disabled={control.disabled}\n onKeyDown={(event) => radios.onKeyDown(event, index)}\n onClick={() => onChange(time)}\n className={part(\"sc-chip\")}\n >\n {formatTime(time, code)}\n </button>\n ))}\n </div>\n );\n}\n\n/** Any time of the day: the half hours to pick from, or one typed; an end, the day's end too. */\nfunction AnyTime({\n value,\n onChange,\n placeholder,\n times: _,\n endOfDay = false,\n ...control\n}: TimeFieldProps) {\n const { code, messages } = useKit();\n const parse = endOfDay ? parseEndTime : parseTime;\n const time = value !== null && parse(value) ? value : null;\n const times = endOfDay ? [...halfHours(), DAY_END] : halfHours();\n if (time !== null && !times.includes(time)) times.push(time);\n return (\n <Combobox\n {...control}\n options={times.toSorted().map((at) => ({ id: at, label: formatTime(at, code) }))}\n value={time === null ? [] : [time]}\n multiple={false}\n onChange={(ids) => onChange(ids[0] ?? null)}\n typed={(text) => {\n const typed = parse(text);\n return typed === null ? null : { id: typed, label: formatTime(typed, code) };\n }}\n start={MORNING}\n placeholder={placeholder ?? messages.chooseTime}\n icon={ClockIcon}\n />\n );\n}\n\nexport interface DateTimeFieldProps extends ControlBase, DayBounds {\n /** \"YYYY-MM-DDTHH:MM\"; held as \"YYYY-MM-DDT\" or \"THH:MM\" while half picked; none when neither. */\n value: string | null;\n onChange: (moment: string | null) => void;\n times?: string[] | undefined;\n}\n\n/**\n * A moment: a day and a time side by side, one over the other when narrow or when the time is\n * a grid of slots. Each half is kept while the other is still to pick.\n */\nexport function DateTimeField({\n value,\n onChange,\n dates,\n earliest,\n latest,\n times,\n ...control\n}: DateTimeFieldProps) {\n const part = useParts();\n const [date, time] = momentParts(value);\n return (\n <div\n role=\"group\"\n {...ariaOf(control)}\n aria-required={undefined}\n data-slots={times ? \"\" : undefined}\n className={part(\"sc-moment\")}\n >\n <DateField\n {...control}\n value={date || null}\n dates={dates}\n earliest={earliest}\n latest={latest}\n onChange={(day) => onChange(momentOf(day, time))}\n />\n <TimeField\n {...control}\n id={control.id === undefined ? undefined : `${control.id}-time`}\n value={time || null}\n times={times}\n onChange={(at) => onChange(momentOf(date, at ?? \"\"))}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAmBA,MAAM,UAAU;;;;;AAiBhB,SAAgB,UAAU,OAAuB;CAC/C,OAAO,MAAM,QAAQ,oBAAC,OAAD;EAAO,GAAI;EAAO,OAAO,MAAM;CAAQ,CAAA,IAAI,oBAAC,SAAD,EAAS,GAAI,MAAQ,CAAA;AACvF;;AAGA,SAAS,MAAM,EACb,OACA,UACA,OACA,UAAU,GACV,GAAG,WACoC;CACvC,MAAM,EAAE,SAAS,OAAO;CACxB,MAAM,OAAO,SAAS;CACtB,MAAM,UAAU,UAAU,OAAO,KAAK,MAAM,QAAQ,KAAK;CACzD,MAAM,SAAS,UAAU,MAAM,QAAQ,UAAU,UAAU;EACzD,MAAM,OAAO,MAAM;EACnB,IAAI,SAAS,KAAA,GAAW,SAAS,IAAI;CACvC,CAAC;CACD,OACE,oBAAC,OAAD;EAAK,MAAK;EAAa,GAAI,OAAO,OAAO;EAAG,WAAW,KAAK,UAAU;EACnE,UAAA,MAAM,KAAK,MAAM,UAChB,oBAAC,UAAD;GAEE,KAAK,OAAO,IAAI,KAAK;GACrB,MAAK;GACL,MAAK;GACL,gBAAc,UAAU;GACxB,UAAU,OAAO,SAAS,KAAK;GAC/B,UAAU,QAAQ;GAClB,YAAY,UAAU,OAAO,UAAU,OAAO,KAAK;GACnD,eAAe,SAAS,IAAI;GAC5B,WAAW,KAAK,SAAS;GAExB,UAAA,WAAW,MAAM,IAAI;EAChB,GAZD,IAYC,CACT;CACE,CAAA;AAET;;AAGA,SAAS,QAAQ,EACf,OACA,UACA,aACA,OAAO,GACP,WAAW,OACX,GAAG,WACc;CACjB,MAAM,EAAE,MAAM,aAAa,OAAO;CAClC,MAAM,QAAQ,WAAW,eAAe;CACxC,MAAM,OAAO,UAAU,QAAQ,MAAM,KAAK,IAAI,QAAQ;CACtD,MAAM,QAAQ,WAAW,CAAC,GAAG,UAAU,GAAG,OAAO,IAAI,UAAU;CAC/D,IAAI,SAAS,QAAQ,CAAC,MAAM,SAAS,IAAI,GAAG,MAAM,KAAK,IAAI;CAC3D,OACE,oBAAC,UAAD;EACE,GAAI;EACJ,SAAS,MAAM,SAAS,CAAC,CAAC,KAAK,QAAQ;GAAE,IAAI;GAAI,OAAO,WAAW,IAAI,IAAI;EAAE,EAAE;EAC/E,OAAO,SAAS,OAAO,CAAC,IAAI,CAAC,IAAI;EACjC,UAAU;EACV,WAAW,QAAQ,SAAS,IAAI,MAAM,IAAI;EAC1C,QAAQ,SAAS;GACf,MAAM,QAAQ,MAAM,IAAI;GACxB,OAAO,UAAU,OAAO,OAAO;IAAE,IAAI;IAAO,OAAO,WAAW,OAAO,IAAI;GAAE;EAC7E;EACA,OAAO;EACP,aAAa,eAAe,SAAS;EACrC,MAAM;CACP,CAAA;AAEL;;;;;AAaA,SAAgB,cAAc,EAC5B,OACA,UACA,OACA,UACA,QACA,OACA,GAAG,WACkB;CACrB,MAAM,OAAO,SAAS;CACtB,MAAM,CAAC,MAAM,QAAQ,YAAY,KAAK;CACtC,OACE,qBAAC,OAAD;EACE,MAAK;EACL,GAAI,OAAO,OAAO;EAClB,iBAAe,KAAA;EACf,cAAY,QAAQ,KAAK,KAAA;EACzB,WAAW,KAAK,WAAW;EAL7B,UAAA,CAOE,oBAAC,WAAD;GACE,GAAI;GACJ,OAAO,QAAQ;GACR;GACG;GACF;GACR,WAAW,QAAQ,SAAS,SAAS,KAAK,IAAI,CAAC;EAChD,CAAA,GACD,oBAAC,WAAD;GACE,GAAI;GACJ,IAAI,QAAQ,OAAO,KAAA,IAAY,KAAA,IAAY,GAAG,QAAQ,GAAG;GACzD,OAAO,QAAQ;GACR;GACP,WAAW,OAAO,SAAS,SAAS,MAAM,MAAM,EAAE,CAAC;EACpD,CAAA,CACE;;AAET"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { KitLocale, KitMessages } from "./messages.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/kit/context.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The kit's parts, by the class each carries: one BEM family per primitive. `classNames` adds a
|
|
6
|
+
* host's own under the same keys, so a host styles every place a primitive appears at once.
|
|
7
|
+
* (`sc-card` is the Ficha's; the kit's card is `sc-panel`.)
|
|
8
|
+
*/
|
|
9
|
+
export type KitPart = "sc-panel" | "sc-panel__head" | "sc-panel__head--image" | "sc-panel__heading" | "sc-panel__title" | "sc-panel__subtitle" | "sc-list" | "sc-row" | "sc-row--quiet" | "sc-row--pressed" | "sc-row__main" | "sc-row__text" | "sc-row__title" | "sc-row__subtitle" | "sc-row__error" | "sc-row__meta" | "sc-row__trailing" | "sc-mark" | "sc-mark--logo" | "sc-mark--photo" | "sc-mark--round" | "sc-tiles" | "sc-tiles__grid" | "sc-tile" | "sc-tile--quiet" | "sc-tile__main" | "sc-tile__count" | "sc-tile__title" | "sc-stack" | "sc-stack__item" | "sc-stack__more" | "sc-tag" | "sc-tag--info" | "sc-tag--success" | "sc-tag--warning" | "sc-tag--danger" | "sc-stat" | "sc-stat--info" | "sc-stat--success" | "sc-stat--warning" | "sc-stat--danger" | "sc-stat__label" | "sc-stat__value" | "sc-stat__hint" | "sc-stats" | "sc-stats__grid" | "sc-chart" | "sc-chart--bar" | "sc-chart--line" | "sc-chart__row" | "sc-chart__label" | "sc-chart__track" | "sc-chart__bar" | "sc-chart__value" | "sc-chart__top" | "sc-chart__plot" | "sc-chart__wash" | "sc-chart__axis" | "sc-chart__line" | "sc-chart__dot" | "sc-chart__tip" | "sc-chart__ends" | "sc-chart__data" | "sc-note" | "sc-note--info" | "sc-note--success" | "sc-note--warning" | "sc-note--danger" | "sc-note__body" | "sc-button" | "sc-button--primary" | "sc-button--neutral" | "sc-button--danger" | "sc-button--ghost" | "sc-button--sm" | "sc-button--icon" | "sc-switch" | "sc-audio" | "sc-audio--compact" | "sc-audio__play" | "sc-audio__wave" | "sc-audio__time" | "sc-field" | "sc-field__label" | "sc-field__optional" | "sc-field__help" | "sc-field__error" | "sc-control" | "sc-control--trigger" | "sc-control__input" | "sc-control__unit" | "sc-control__steppers" | "sc-control__reveal" | "sc-control__tag" | "sc-check" | "sc-popover" | "sc-listbox" | "sc-listbox__item" | "sc-listbox__empty" | "sc-calendar" | "sc-picks" | "sc-segments" | "sc-pick" | "sc-chips" | "sc-chip" | "sc-slots" | "sc-moment" | "sc-range" | "sc-rating" | "sc-upload" | "sc-upload__zone" | "sc-upload__icon" | "sc-upload__text" | "sc-attachments" | "sc-attachment" | "sc-attachment--failed" | "sc-attachment__main" | "sc-attachment__text" | "sc-attachment__name" | "sc-attachment__meta" | "sc-attachment__action" | "sc-attachment__bar" | "sc-orb" | "sc-orb--idle" | "sc-orb--listening" | "sc-orb--thinking" | "sc-orb--speaking" | "sc-orb--still" | "sc-orb--loading" | "sc-orb__ring" | "sc-orb__core" | "sc-automation" | "sc-automation--gone" | "sc-automation__head" | "sc-automation__heading" | "sc-automation__title" | "sc-automation__when" | "sc-automation__end" | "sc-automation__dot" | "sc-automation__summary" | "sc-automation__section" | "sc-automation__label" | "sc-automation__steps" | "sc-automation__step" | "sc-automation__number" | "sc-automation__name" | "sc-automation__uses" | "sc-automation__use" | "sc-automation__board" | "sc-automation__more" | "sc-automation__runs" | "sc-automation__run--open" | "sc-automation__status" | "sc-automation__empty" | "sc-run" | "sc-run__head" | "sc-run__by" | "sc-run__end" | "sc-run__took" | "sc-run__heading" | "sc-run__title" | "sc-run__meta" | "sc-run__summary" | "sc-run__section" | "sc-run__label" | "sc-run__steps" | "sc-run__step" | "sc-run__number" | "sc-run__name" | "sc-run__calls" | "sc-run__call" | "sc-run__call--would" | "sc-run__call--failed" | "sc-run__count" | "sc-run__error" | "sc-run__live" | "sc-run__links" | "sc-run__empty";
|
|
10
|
+
export type KitClassNames = Partial<Record<KitPart, string>> | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Gives the primitives under it the host's classes, words and language; without it they are
|
|
13
|
+
* the package's, in English.
|
|
14
|
+
*/
|
|
15
|
+
export declare function KitProvider({ classNames, messages, locale, children }: {
|
|
16
|
+
classNames?: KitClassNames;
|
|
17
|
+
messages?: Partial<KitMessages> | undefined;
|
|
18
|
+
locale?: KitLocale | undefined;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
//# sourceMappingURL=context.d.ts.map
|