@ctrl-ui/react 0.8.2 → 0.8.5
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 +32 -23
- package/dist/action-bar.d.ts +11 -12
- package/dist/activity.d.ts +24 -25
- package/dist/audio-recorder.d.ts +16 -16
- package/dist/audio-visualizer.d.ts +3 -4
- package/dist/audio-visualizer.js +1 -1
- package/dist/blocks/chat.d.ts +3 -4
- package/dist/blocks/chat.js +6 -3
- package/dist/blocks/coding-agent.d.ts +11 -12
- package/dist/blocks/coding-agent.js +10 -9
- package/dist/blocks/file-explorer-data.d.ts +11 -12
- package/dist/blocks/file-explorer.d.ts +3 -3
- package/dist/blocks/settings-data.d.ts +8 -9
- package/dist/blocks/settings.d.ts +4 -4
- package/dist/blocks/theme-toggle.d.ts +11 -12
- package/dist/blocks/theme-toggle.js +14 -4
- package/dist/chat-composer-attachment.d.ts +20 -21
- package/dist/chat-composer-attachment.js +24 -20
- package/dist/chat-composer-editor/extensions/mention.d.ts +5 -6
- package/dist/chat-composer-editor/extensions/mention.js +4 -0
- package/dist/chat-composer-editor/ghost.d.ts +3 -4
- package/dist/chat-composer-editor/schema.d.ts +2 -3
- package/dist/chat-composer-editor/serialize.d.ts +3 -4
- package/dist/chat-composer-editor/types.d.ts +5 -6
- package/dist/chat-composer-editor.d.ts +2 -3
- package/dist/chat-composer-editor.js +18 -4
- package/dist/chat-composer.d.ts +17 -18
- package/dist/chat-composer.js +14 -8
- package/dist/chat-layout.d.ts +17 -21
- package/dist/chat-layout.js +72 -86
- package/dist/chat-message.d.ts +19 -15
- package/dist/chat-message.js +19 -2
- package/dist/context-model.d.ts +7 -8
- package/dist/context.d.ts +21 -22
- package/dist/context.js +0 -2
- package/dist/control-props.d.ts +10 -11
- package/dist/control-variants.d.ts +6 -7
- package/dist/dynamic-notification-glass.d.ts +3 -4
- package/dist/dynamic-notification-liquid.d.ts +3 -4
- package/dist/dynamic-notification-siri-wave.d.ts +2 -3
- package/dist/dynamic-notification.d.ts +28 -29
- package/dist/email/email-brand.d.ts +60 -0
- package/dist/email/email-brand.js +101 -0
- package/dist/email/email-code.d.ts +18 -0
- package/dist/email/email-code.js +172 -0
- package/dist/email/email-footer.d.ts +63 -0
- package/dist/email/email-footer.js +98 -0
- package/dist/email/email.d.ts +62 -14
- package/dist/email/email.js +155 -24
- package/dist/email/length.d.ts +2 -3
- package/dist/email/templates.d.ts +56 -12
- package/dist/email/templates.js +314 -116
- package/dist/email/theme.d.ts +15 -8
- package/dist/email/theme.js +30 -8
- package/dist/environment-variables.d.ts +35 -36
- package/dist/extensions/create-track-highlight.d.ts +3 -4
- package/dist/extensions/supports-anchor-transitions.d.ts +2 -3
- package/dist/extensions/track-highlight.d.ts +3 -4
- package/dist/hooks/use-audio-recorder.d.ts +14 -15
- package/dist/hooks/use-chat-composer.d.ts +5 -6
- package/dist/hooks/use-chat-message.d.ts +8 -8
- package/dist/hooks/use-chat-message.js +1 -0
- package/dist/hooks/use-chat-thread-scroll.d.ts +8 -0
- package/dist/hooks/use-chat-thread-scroll.js +66 -0
- package/dist/hooks/use-color-area.d.ts +5 -6
- package/dist/hooks/use-copy-to-clipboard.d.ts +7 -8
- package/dist/hooks/use-dropzone.d.ts +11 -12
- package/dist/hooks/use-dynamic-notification.d.ts +6 -7
- package/dist/hooks/use-environment-variables.d.ts +9 -10
- package/dist/hooks/use-keyboard-navigation.d.ts +3 -0
- package/dist/hooks/use-keyboard-navigation.js +22 -0
- package/dist/hooks/use-mobile.d.ts +2 -3
- package/dist/hooks/use-textarea-trigger-menu.d.ts +2 -3
- package/dist/hooks/use-trigger-menu.d.ts +7 -8
- package/dist/hooks/use-user-ask.d.ts +11 -10
- package/dist/hooks/use-user-ask.js +56 -17
- package/dist/inline-attachment.d.ts +16 -17
- package/dist/inline-attachment.js +1 -1
- package/dist/inline-citation.d.ts +22 -23
- package/dist/knob-contracts/accordion-knobs.d.ts +3 -4
- package/dist/knob-contracts/accordion-knobs.js +1 -0
- package/dist/knob-contracts/action-bar-knobs.d.ts +3 -4
- package/dist/knob-contracts/action-bar-knobs.js +1 -1
- package/dist/knob-contracts/activity-knobs.d.ts +3 -4
- package/dist/knob-contracts/activity-knobs.js +2 -1
- package/dist/knob-contracts/alert-knobs.d.ts +3 -4
- package/dist/knob-contracts/alert-knobs.js +12 -1
- package/dist/knob-contracts/audio-recorder-knobs.d.ts +3 -4
- package/dist/knob-contracts/audio-visualizer-knobs.d.ts +3 -4
- package/dist/knob-contracts/audio-visualizer-knobs.js +1 -0
- package/dist/knob-contracts/avatar-knobs.d.ts +3 -4
- package/dist/knob-contracts/avatar-knobs.js +2 -1
- package/dist/knob-contracts/badge-knobs.d.ts +3 -4
- package/dist/knob-contracts/button-group-knobs.d.ts +3 -4
- package/dist/knob-contracts/button-knobs.d.ts +3 -4
- package/dist/knob-contracts/button-knobs.js +1 -0
- package/dist/knob-contracts/calendar-knobs.d.ts +3 -4
- package/dist/knob-contracts/card-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-composer-attachment-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-composer-attachment-knobs.js +5 -1
- package/dist/knob-contracts/chat-composer-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-composer-knobs.js +2 -0
- package/dist/knob-contracts/chat-layout-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-layout-knobs.js +2 -2
- package/dist/knob-contracts/chat-message-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-message-knobs.js +3 -1
- package/dist/knob-contracts/choice-knobs.d.ts +3 -4
- package/dist/knob-contracts/choice-knobs.js +2 -1
- package/dist/knob-contracts/code-diff-knobs.d.ts +3 -4
- package/dist/knob-contracts/code-diff-knobs.js +1 -0
- package/dist/knob-contracts/code-knobs.d.ts +3 -4
- package/dist/knob-contracts/code-knobs.js +3 -1
- package/dist/knob-contracts/collapsible-knobs.d.ts +3 -4
- package/dist/knob-contracts/color-picker-knobs.d.ts +3 -4
- package/dist/knob-contracts/context-knobs.d.ts +3 -4
- package/dist/knob-contracts/context-knobs.js +3 -0
- package/dist/knob-contracts/dockable-panel-knobs.d.ts +3 -4
- package/dist/knob-contracts/dockable-panel-knobs.js +1 -0
- package/dist/knob-contracts/dropzone-knobs.d.ts +3 -4
- package/dist/knob-contracts/dropzone-knobs.js +1 -0
- package/dist/knob-contracts/dynamic-notification-knobs.d.ts +3 -4
- package/dist/knob-contracts/empty-knobs.d.ts +3 -4
- package/dist/knob-contracts/empty-knobs.js +14 -1
- package/dist/knob-contracts/environment-variables-knobs.d.ts +3 -4
- package/dist/knob-contracts/environment-variables-knobs.js +2 -1
- package/dist/knob-contracts/field-knobs.d.ts +3 -4
- package/dist/knob-contracts/gradient-editor-knobs.d.ts +3 -4
- package/dist/knob-contracts/gradient-editor-knobs.js +3 -1
- package/dist/knob-contracts/infinite-canvas-knobs.d.ts +3 -4
- package/dist/knob-contracts/inline-attachment-knobs.d.ts +3 -4
- package/dist/knob-contracts/inline-attachment-knobs.js +6 -1
- package/dist/knob-contracts/inline-citation-knobs.d.ts +3 -4
- package/dist/knob-contracts/inline-citation-knobs.js +4 -1
- package/dist/knob-contracts/item-knobs.d.ts +3 -4
- package/dist/knob-contracts/kbd-knobs.d.ts +3 -4
- package/dist/knob-contracts/markdown-block-knobs.d.ts +3 -4
- package/dist/knob-contracts/markdown-block-knobs.js +2 -0
- package/dist/knob-contracts/markdown-knobs.d.ts +3 -4
- package/dist/knob-contracts/markdown-knobs.js +1 -0
- package/dist/knob-contracts/morphing-panel-knobs.d.ts +3 -4
- package/dist/knob-contracts/page-layout-knobs.d.ts +4 -0
- package/dist/knob-contracts/page-layout-knobs.js +15 -0
- package/dist/knob-contracts/pagination-knobs.d.ts +3 -4
- package/dist/knob-contracts/phone-input-knobs.d.ts +3 -4
- package/dist/knob-contracts/phone-input-knobs.js +1 -0
- package/dist/knob-contracts/popup-knobs.d.ts +3 -4
- package/dist/knob-contracts/progressive-blur-knobs.d.ts +3 -4
- package/dist/knob-contracts/progressive-blur-knobs.js +1 -0
- package/dist/knob-contracts/range-knobs.d.ts +3 -4
- package/dist/knob-contracts/resizable-knobs.d.ts +3 -4
- package/dist/knob-contracts/resizable-knobs.js +1 -0
- package/dist/knob-contracts/rich-tooltip-knobs.d.ts +3 -4
- package/dist/knob-contracts/scroll-area-knobs.d.ts +3 -4
- package/dist/knob-contracts/separator-knobs.d.ts +3 -4
- package/dist/knob-contracts/sidebar-knobs.d.ts +3 -4
- package/dist/knob-contracts/sidebar-knobs.js +1 -0
- package/dist/knob-contracts/skeleton-knobs.d.ts +3 -4
- package/dist/knob-contracts/skeleton-knobs.js +9 -1
- package/dist/knob-contracts/source-badge-knobs.d.ts +3 -4
- package/dist/knob-contracts/spinner-knobs.d.ts +3 -4
- package/dist/knob-contracts/stepper-knobs.d.ts +3 -4
- package/dist/knob-contracts/stepper-knobs.js +1 -0
- package/dist/knob-contracts/switch-knobs.d.ts +3 -4
- package/dist/knob-contracts/switch-knobs.js +7 -1
- package/dist/knob-contracts/table-knobs.d.ts +3 -4
- package/dist/knob-contracts/table-of-contents-knobs.d.ts +3 -4
- package/dist/knob-contracts/table-of-contents-knobs.js +25 -0
- package/dist/knob-contracts/tabs-knobs.d.ts +3 -4
- package/dist/knob-contracts/tabs-knobs.js +2 -1
- package/dist/knob-contracts/task-list-knobs.d.ts +3 -4
- package/dist/knob-contracts/task-list-knobs.js +5 -0
- package/dist/knob-contracts/thread-rail-knobs.d.ts +3 -4
- package/dist/knob-contracts/timeline-knobs.d.ts +3 -4
- package/dist/knob-contracts/toolbar-knobs.d.ts +3 -4
- package/dist/knob-contracts/toolbar-knobs.js +1 -0
- package/dist/knob-contracts/track-highlight-knobs.d.ts +3 -4
- package/dist/knob-contracts/transcript-divider-knobs.d.ts +3 -4
- package/dist/knob-contracts/tree-knobs.d.ts +3 -4
- package/dist/knob-contracts/user-ask-knobs.d.ts +3 -4
- package/dist/knob-contracts/user-ask-knobs.js +5 -0
- package/dist/lib/cn.d.ts +2 -3
- package/dist/lib/code-tokens.d.ts +12 -13
- package/dist/lib/color.d.ts +26 -27
- package/dist/lib/contrast.d.ts +12 -13
- package/dist/lib/diff.d.ts +14 -15
- package/dist/lib/dropzone-validation.d.ts +25 -26
- package/dist/lib/env-file.d.ts +12 -13
- package/dist/lib/format-audio-recorder-duration.d.ts +2 -3
- package/dist/lib/liquid-glass-optics.d.ts +2 -3
- package/dist/lib/phone-input-format.d.ts +3 -4
- package/dist/lib/phone-number.d.ts +8 -9
- package/dist/lib/trigger-detect.d.ts +4 -5
- package/dist/markdown-block.d.ts +11 -12
- package/dist/markdown-block.js +1 -1
- package/dist/scripts/contrast-eval.d.ts +16 -17
- package/dist/scripts/contrast-eval.js +13 -7
- package/dist/skin-provider.d.ts +14 -0
- package/dist/skin-provider.js +21 -0
- package/dist/skin.d.ts +14 -33
- package/dist/skin.js +3 -46
- package/dist/source-badge.d.ts +7 -8
- package/dist/styles/index.css +3 -5
- package/dist/styles/recipes/accordion.css +8 -2
- package/dist/styles/recipes/action-bar.css +40 -5
- package/dist/styles/recipes/activity.css +36 -3
- package/dist/styles/recipes/alert.css +97 -16
- package/dist/styles/recipes/audio-visualizer.css +8 -1
- package/dist/styles/recipes/avatar.css +17 -1
- package/dist/styles/recipes/badge.css +0 -1
- package/dist/styles/recipes/button-group.css +8 -0
- package/dist/styles/recipes/button.css +49 -8
- package/dist/styles/recipes/calendar.css +21 -6
- package/dist/styles/recipes/card.css +2 -0
- package/dist/styles/recipes/chat-composer-attachment.css +83 -54
- package/dist/styles/recipes/chat-composer.css +41 -22
- package/dist/styles/recipes/chat-layout.css +37 -54
- package/dist/styles/recipes/chat-message.css +78 -5
- package/dist/styles/recipes/choice.css +21 -2
- package/dist/styles/recipes/code-diff.css +9 -1
- package/dist/styles/recipes/code.css +64 -17
- package/dist/styles/recipes/collapsible.css +0 -3
- package/dist/styles/recipes/color-picker-details.css +1 -2
- package/dist/styles/recipes/color-picker-values.css +0 -4
- package/dist/styles/recipes/context.css +30 -18
- package/dist/styles/recipes/dockable-panel.css +8 -1
- package/dist/styles/recipes/dropzone.css +9 -2
- package/dist/styles/recipes/dynamic-notification-input.css +6 -0
- package/dist/styles/recipes/dynamic-notification.css +1 -0
- package/dist/styles/recipes/empty.css +118 -17
- package/dist/styles/recipes/environment-variables.css +9 -1
- package/dist/styles/recipes/field-parts.css +3 -6
- package/dist/styles/recipes/field.css +15 -5
- package/dist/styles/recipes/gradient-editor.css +33 -5
- package/dist/styles/recipes/inline-attachment.css +68 -20
- package/dist/styles/recipes/inline-citation.css +52 -10
- package/dist/styles/recipes/item.css +4 -2
- package/dist/styles/recipes/kbd.css +8 -0
- package/dist/styles/recipes/markdown-block.css +17 -2
- package/dist/styles/recipes/markdown.css +19 -0
- package/dist/styles/recipes/morphing-panel.css +1 -1
- package/dist/styles/recipes/page-layout.css +203 -0
- package/dist/styles/recipes/pagination.css +16 -4
- package/dist/styles/recipes/phone-input.css +8 -4
- package/dist/styles/recipes/popup-drawer.css +3 -1
- package/dist/styles/recipes/popup-lists.css +11 -0
- package/dist/styles/recipes/popup-toast.css +3 -29
- package/dist/styles/recipes/popup.css +10 -14
- package/dist/styles/recipes/progressive-blur.css +28 -7
- package/dist/styles/recipes/range.css +74 -3
- package/dist/styles/recipes/resizable.css +8 -10
- package/dist/styles/recipes/rich-tooltip.css +1 -4
- package/dist/styles/recipes/scroll-area.css +8 -2
- package/dist/styles/recipes/sidebar-menu.css +0 -6
- package/dist/styles/recipes/sidebar.css +56 -17
- package/dist/styles/recipes/skeleton.css +85 -3
- package/dist/styles/recipes/source-badge.css +20 -3
- package/dist/styles/recipes/stepper.css +8 -1
- package/dist/styles/recipes/switch.css +89 -17
- package/dist/styles/recipes/table-of-contents.css +211 -45
- package/dist/styles/recipes/table.css +0 -1
- package/dist/styles/recipes/tabs.css +35 -2
- package/dist/styles/recipes/task-list.css +68 -9
- package/dist/styles/recipes/thread-rail.css +19 -17
- package/dist/styles/recipes/toolbar.css +39 -4
- package/dist/styles/recipes/track-highlight.css +63 -5
- package/dist/styles/recipes/transcript-divider.css +1 -0
- package/dist/styles/recipes/tree.css +2 -0
- package/dist/styles/recipes/user-ask.css +65 -18
- package/dist/styles/theme.css +164 -138
- package/dist/surface-variants.d.ts +4 -5
- package/dist/task-list.d.ts +16 -17
- package/dist/thread-rail.d.ts +21 -22
- package/dist/thread-rail.js +1 -1
- package/dist/transcript-divider.d.ts +6 -7
- package/dist/ui/accordion.d.ts +10 -11
- package/dist/ui/alert-dialog.d.ts +11 -12
- package/dist/ui/alert-dialog.js +9 -7
- package/dist/ui/alert.d.ts +9 -10
- package/dist/ui/alert.js +3 -3
- package/dist/ui/aspect-ratio.d.ts +3 -4
- package/dist/ui/autocomplete.d.ts +19 -20
- package/dist/ui/autocomplete.js +6 -4
- package/dist/ui/avatar.d.ts +9 -10
- package/dist/ui/badge.d.ts +9 -10
- package/dist/ui/button-group.d.ts +7 -8
- package/dist/ui/button-group.js +3 -2
- package/dist/ui/button.d.ts +17 -18
- package/dist/ui/button.js +20 -5
- package/dist/ui/calendar.d.ts +3 -4
- package/dist/ui/card.d.ts +16 -17
- package/dist/ui/checkbox-group.d.ts +4 -5
- package/dist/ui/checkbox-group.js +3 -2
- package/dist/ui/checkbox.d.ts +3 -4
- package/dist/ui/code-diff.d.ts +8 -9
- package/dist/ui/code.d.ts +32 -23
- package/dist/ui/code.js +41 -20
- package/dist/ui/collapsible.d.ts +7 -8
- package/dist/ui/color-picker.d.ts +40 -41
- package/dist/ui/color-picker.js +8 -6
- package/dist/ui/combobox-disabled-selection.d.ts +3 -4
- package/dist/ui/combobox.d.ts +19 -20
- package/dist/ui/combobox.js +6 -4
- package/dist/ui/command.d.ts +22 -19
- package/dist/ui/command.js +63 -13
- package/dist/ui/context-menu.d.ts +30 -31
- package/dist/ui/context-menu.js +10 -7
- package/dist/ui/dialog.d.ts +13 -13
- package/dist/ui/dialog.js +11 -9
- package/dist/ui/dockable-panel-geometry.d.ts +7 -8
- package/dist/ui/dockable-panel.d.ts +21 -22
- package/dist/ui/drawer.d.ts +17 -18
- package/dist/ui/drawer.js +9 -8
- package/dist/ui/dropdown-menu.d.ts +32 -33
- package/dist/ui/dropdown-menu.js +6 -4
- package/dist/ui/dropzone.d.ts +24 -24
- package/dist/ui/dropzone.js +4 -1
- package/dist/ui/empty.d.ts +14 -14
- package/dist/ui/empty.js +3 -3
- package/dist/ui/field.d.ts +26 -27
- package/dist/ui/form.d.ts +4 -5
- package/dist/ui/gradient-editor.d.ts +16 -17
- package/dist/ui/gradient-editor.js +2 -2
- package/dist/ui/hover-card.d.ts +6 -7
- package/dist/ui/hover-card.js +6 -4
- package/dist/ui/infinite-canvas.d.ts +11 -12
- package/dist/ui/infinite-canvas.js +1 -0
- package/dist/ui/input-group.d.ts +6 -7
- package/dist/ui/input-otp.d.ts +7 -8
- package/dist/ui/input.d.ts +3 -4
- package/dist/ui/item.d.ts +20 -21
- package/dist/ui/kbd.d.ts +7 -5
- package/dist/ui/kbd.js +4 -2
- package/dist/ui/markdown-elements.d.ts +20 -21
- package/dist/ui/markdown.d.ts +5 -6
- package/dist/ui/menubar.d.ts +25 -26
- package/dist/ui/menubar.js +10 -7
- package/dist/ui/meter.d.ts +11 -12
- package/dist/ui/morphing-panel.d.ts +8 -9
- package/dist/ui/native-select.d.ts +3 -4
- package/dist/ui/native-select.js +1 -1
- package/dist/ui/navigation-menu.d.ts +17 -18
- package/dist/ui/navigation-menu.js +6 -4
- package/dist/ui/number-field.d.ts +15 -16
- package/dist/ui/number-field.js +1 -1
- package/dist/ui/page-layout.d.ts +44 -0
- package/dist/ui/page-layout.js +108 -0
- package/dist/ui/pagination.d.ts +10 -11
- package/dist/ui/phone-input.d.ts +5 -6
- package/dist/ui/phone-input.js +39 -36
- package/dist/ui/popover.d.ts +11 -12
- package/dist/ui/popover.js +6 -4
- package/dist/ui/progress.d.ts +11 -12
- package/dist/ui/progressive-blur.d.ts +4 -5
- package/dist/ui/radio-group.d.ts +5 -6
- package/dist/ui/resizable.d.ts +12 -13
- package/dist/ui/resizable.js +1 -1
- package/dist/ui/responsive-dialog.d.ts +11 -12
- package/dist/ui/rich-tooltip-tour.d.ts +5 -6
- package/dist/ui/rich-tooltip.d.ts +21 -23
- package/dist/ui/rich-tooltip.js +6 -6
- package/dist/ui/scroll-area.d.ts +7 -8
- package/dist/ui/scroll-area.js +9 -6
- package/dist/ui/select.d.ts +21 -14
- package/dist/ui/select.js +8 -5
- package/dist/ui/separator.d.ts +2 -3
- package/dist/ui/sheet.d.ts +8 -9
- package/dist/ui/sheet.js +9 -7
- package/dist/ui/sidebar-menu.d.ts +18 -19
- package/dist/ui/sidebar-menu.js +4 -3
- package/dist/ui/sidebar-provider.d.ts +32 -7
- package/dist/ui/sidebar-provider.js +82 -22
- package/dist/ui/sidebar-resize-rail.d.ts +8 -0
- package/dist/ui/sidebar-resize-rail.js +192 -0
- package/dist/ui/sidebar.d.ts +19 -13
- package/dist/ui/sidebar.js +120 -55
- package/dist/ui/skeleton.d.ts +7 -4
- package/dist/ui/skeleton.js +9 -2
- package/dist/ui/slider.d.ts +6 -5
- package/dist/ui/slider.js +16 -13
- package/dist/ui/spinner.d.ts +3 -4
- package/dist/ui/stepper.d.ts +22 -23
- package/dist/ui/switch.d.ts +3 -4
- package/dist/ui/switch.js +12 -1
- package/dist/ui/table-of-contents.d.ts +7 -8
- package/dist/ui/table-of-contents.js +4 -2
- package/dist/ui/table.d.ts +17 -18
- package/dist/ui/tabs.d.ts +14 -11
- package/dist/ui/textarea.d.ts +3 -4
- package/dist/ui/timeline.d.ts +18 -19
- package/dist/ui/toast.d.ts +9 -9
- package/dist/ui/toast.js +23 -16
- package/dist/ui/toggle.d.ts +5 -6
- package/dist/ui/toggle.js +3 -2
- package/dist/ui/toolbar.d.ts +15 -16
- package/dist/ui/toolbar.js +15 -4
- package/dist/ui/tooltip.d.ts +6 -13
- package/dist/ui/tooltip.js +8 -9
- package/dist/ui/tree.d.ts +18 -19
- package/dist/ui/tree.js +3 -2
- package/dist/ui/trigger-menu.d.ts +15 -16
- package/dist/ui/trigger-menu.js +6 -4
- package/dist/ui/use-switch-drag.d.ts +7 -0
- package/dist/ui/use-switch-drag.js +104 -0
- package/dist/user-ask.d.ts +28 -27
- package/dist/user-ask.js +38 -13
- package/package.json +17 -16
- package/dist/code-block-editor.d.ts +0 -59
- package/dist/code-block-editor.js +0 -250
- package/dist/knob-contracts/code-block-editor-knobs.d.ts +0 -5
- package/dist/knob-contracts/code-block-editor-knobs.js +0 -11
- package/dist/lib/code-block-shiki.d.ts +0 -9
- package/dist/lib/code-block-shiki.js +0 -6
- package/dist/skin.config.d.ts +0 -5
- package/dist/skin.config.js +0 -12
- package/dist/styles/recipes/code-block-editor.css +0 -136
- package/dist/styles/skin-theme.css +0 -137
- package/dist/styles/skin.css +0 -143
package/dist/email/templates.js
CHANGED
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
import { EmailButton, EmailHeading, EmailLayout, EmailLink, EmailText } from "./email.js";
|
|
1
|
+
import { EmailBulletList, EmailButton, EmailCaption, EmailColumns, EmailDetailRow, EmailDivider, EmailHeading, EmailLayout, EmailLink, EmailOneTimeCode, EmailPanel, EmailSection, EmailText } from "./email.js";
|
|
2
|
+
import { EmailBrandFooter, EmailBrandHeader } from "./email-brand.js";
|
|
3
|
+
import { EmailCodeBlock, EmailInlineCode, EmailMarkdown } from "./email-code.js";
|
|
2
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Column,
|
|
5
|
+
import { Column, Img, Row } from "react-email";
|
|
4
6
|
//#region src/email/templates.tsx
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
/* @__PURE__ */ jsx(Hr, { className: "my-6 border-0 border-t border-solid border-t-border" }),
|
|
8
|
-
/* @__PURE__ */ jsx(EmailText, {
|
|
9
|
-
tone: "muted",
|
|
10
|
-
className: "mb-1 text-caption",
|
|
11
|
-
children: brand
|
|
12
|
-
}),
|
|
13
|
-
/* @__PURE__ */ jsx(EmailText, {
|
|
14
|
-
tone: "muted",
|
|
15
|
-
className: "mb-0 text-caption",
|
|
16
|
-
children
|
|
17
|
-
})
|
|
18
|
-
] });
|
|
19
|
-
}
|
|
20
|
-
function InvitationEmail({ theme, brand, footer, inviter, workspace, inviteUrl }) {
|
|
21
|
-
return /* @__PURE__ */ jsxs(EmailLayout, {
|
|
7
|
+
function InvitationEmail({ theme, variant, head, brand, browserUrl, footer, inviter, workspace, inviteUrl }) {
|
|
8
|
+
const layout = {
|
|
22
9
|
theme,
|
|
10
|
+
variant,
|
|
11
|
+
head,
|
|
12
|
+
footer: /* @__PURE__ */ jsx(EmailBrandFooter, { footer }),
|
|
13
|
+
footerPlacement: footer.placement
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ jsxs(EmailLayout, {
|
|
16
|
+
...layout,
|
|
23
17
|
preview: `${inviter} invited you to ${workspace}`,
|
|
24
18
|
children: [
|
|
25
|
-
/* @__PURE__ */ jsx(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
/* @__PURE__ */ jsx(EmailBrandHeader, {
|
|
20
|
+
brand,
|
|
21
|
+
browserUrl,
|
|
22
|
+
colorScheme: theme.colorScheme
|
|
29
23
|
}),
|
|
30
24
|
/* @__PURE__ */ jsx(EmailHeading, { children: "A place for your next idea." }),
|
|
31
25
|
/* @__PURE__ */ jsxs(EmailText, { children: [
|
|
@@ -34,36 +28,43 @@ function InvitationEmail({ theme, brand, footer, inviter, workspace, inviteUrl }
|
|
|
34
28
|
/* @__PURE__ */ jsx("strong", { children: workspace }),
|
|
35
29
|
". Bring your work, share a little inspiration, and make something together."
|
|
36
30
|
] }),
|
|
37
|
-
/* @__PURE__ */ jsxs(
|
|
38
|
-
|
|
39
|
-
children:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
children: "Projects, conversations, and the details that move work forward. All in one shared space."
|
|
45
|
-
})]
|
|
46
|
-
}),
|
|
31
|
+
/* @__PURE__ */ jsxs(EmailPanel, { children: [/* @__PURE__ */ jsx(EmailHeading, {
|
|
32
|
+
as: "h3",
|
|
33
|
+
children: "Your team is waiting"
|
|
34
|
+
}), /* @__PURE__ */ jsx(EmailText, {
|
|
35
|
+
className: "mb-0",
|
|
36
|
+
children: "Projects, conversations, and the details that move work forward. All in one shared space."
|
|
37
|
+
})] }),
|
|
47
38
|
/* @__PURE__ */ jsxs(EmailButton, {
|
|
48
39
|
href: inviteUrl,
|
|
40
|
+
width: "full",
|
|
49
41
|
children: ["Join ", workspace]
|
|
50
|
-
}),
|
|
51
|
-
/* @__PURE__ */ jsx(EmailFooter, {
|
|
52
|
-
brand,
|
|
53
|
-
children: footer
|
|
54
42
|
})
|
|
55
43
|
]
|
|
56
44
|
});
|
|
57
45
|
}
|
|
58
|
-
function ProductEmail({ theme, brand, footer, title, description, imageUrl, imageAlt, actionUrl }) {
|
|
59
|
-
|
|
46
|
+
function ProductEmail({ theme, variant, head, brand, browserUrl, footer, title, description, imageUrl, imageAlt, highlights = [], actionUrl }) {
|
|
47
|
+
const layout = {
|
|
60
48
|
theme,
|
|
49
|
+
variant,
|
|
50
|
+
head,
|
|
51
|
+
footer: /* @__PURE__ */ jsx(EmailBrandFooter, { footer }),
|
|
52
|
+
footerPlacement: footer.placement
|
|
53
|
+
};
|
|
54
|
+
return /* @__PURE__ */ jsxs(EmailLayout, {
|
|
55
|
+
...layout,
|
|
61
56
|
preview: title,
|
|
62
57
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
/* @__PURE__ */ jsx(EmailBrandHeader, {
|
|
59
|
+
brand,
|
|
60
|
+
browserUrl,
|
|
61
|
+
colorScheme: theme.colorScheme,
|
|
62
|
+
align: "center"
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ jsx(EmailCaption, {
|
|
65
|
+
align: "center",
|
|
66
|
+
className: "mb-6",
|
|
67
|
+
children: "ANNOUNCEMENT"
|
|
67
68
|
}),
|
|
68
69
|
/* @__PURE__ */ jsx(Img, {
|
|
69
70
|
src: imageUrl,
|
|
@@ -71,45 +72,74 @@ function ProductEmail({ theme, brand, footer, title, description, imageUrl, imag
|
|
|
71
72
|
width: "552",
|
|
72
73
|
className: "mb-6 block h-auto w-full rounded-scene"
|
|
73
74
|
}),
|
|
74
|
-
/* @__PURE__ */ jsx(EmailHeading, {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
children: "Explore what’s new"
|
|
75
|
+
/* @__PURE__ */ jsx(EmailHeading, {
|
|
76
|
+
size: "display",
|
|
77
|
+
align: "center",
|
|
78
|
+
children: title
|
|
79
79
|
}),
|
|
80
|
-
/* @__PURE__ */ jsx(
|
|
81
|
-
|
|
82
|
-
children:
|
|
80
|
+
/* @__PURE__ */ jsx(EmailText, {
|
|
81
|
+
align: "center",
|
|
82
|
+
children: description
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ jsx(EmailColumns, { children: highlights.map((highlight) => /* @__PURE__ */ jsxs(EmailSection, {
|
|
85
|
+
align: "center",
|
|
86
|
+
children: [/* @__PURE__ */ jsx(EmailHeading, {
|
|
87
|
+
as: "h4",
|
|
88
|
+
align: "center",
|
|
89
|
+
className: "mb-1",
|
|
90
|
+
children: highlight.title
|
|
91
|
+
}), /* @__PURE__ */ jsx(EmailCaption, {
|
|
92
|
+
align: "center",
|
|
93
|
+
className: "mb-0",
|
|
94
|
+
children: highlight.description
|
|
95
|
+
})]
|
|
96
|
+
}, highlight.title)) }),
|
|
97
|
+
/* @__PURE__ */ jsx(EmailSection, {
|
|
98
|
+
align: "center",
|
|
99
|
+
children: /* @__PURE__ */ jsx(EmailButton, {
|
|
100
|
+
href: actionUrl,
|
|
101
|
+
children: "Explore what’s new"
|
|
102
|
+
})
|
|
83
103
|
})
|
|
84
104
|
]
|
|
85
105
|
});
|
|
86
106
|
}
|
|
87
|
-
function EditorialEmail({ theme, brand, footer, title, description, imageUrl, imageAlt, articleUrl }) {
|
|
88
|
-
|
|
107
|
+
function EditorialEmail({ theme, variant, head, brand, browserUrl, footer, title, description, imageUrl, imageAlt, articleUrl }) {
|
|
108
|
+
const layout = {
|
|
89
109
|
theme,
|
|
110
|
+
variant,
|
|
111
|
+
head,
|
|
112
|
+
footer: /* @__PURE__ */ jsx(EmailBrandFooter, { footer }),
|
|
113
|
+
footerPlacement: footer.placement
|
|
114
|
+
};
|
|
115
|
+
return /* @__PURE__ */ jsxs(EmailLayout, {
|
|
116
|
+
...layout,
|
|
90
117
|
preview: title,
|
|
91
118
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}),
|
|
97
|
-
/* @__PURE__ */ jsx(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
119
|
+
/* @__PURE__ */ jsx(EmailBrandHeader, {
|
|
120
|
+
brand,
|
|
121
|
+
browserUrl,
|
|
122
|
+
colorScheme: theme.colorScheme
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ jsx(EmailCaption, {
|
|
125
|
+
className: "mb-6",
|
|
126
|
+
children: "IN GOOD COMPANY"
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ jsx(EmailHeading, {
|
|
129
|
+
size: "heading-2",
|
|
130
|
+
children: "Fresh perspectives."
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ jsxs(EmailColumns, {
|
|
133
|
+
widths: ["36%", "64%"],
|
|
134
|
+
children: [/* @__PURE__ */ jsx(Img, {
|
|
102
135
|
src: imageUrl,
|
|
103
136
|
alt: imageAlt,
|
|
104
137
|
width: "198",
|
|
105
138
|
className: "block h-auto w-full rounded-scene"
|
|
106
|
-
})
|
|
107
|
-
}), /* @__PURE__ */ jsxs(Column, {
|
|
108
|
-
width: "64%",
|
|
109
|
-
className: "pl-5 align-top",
|
|
110
|
-
children: [
|
|
139
|
+
}), /* @__PURE__ */ jsxs(EmailSection, { children: [
|
|
111
140
|
/* @__PURE__ */ jsx(EmailHeading, {
|
|
112
141
|
as: "h2",
|
|
142
|
+
size: "heading-3",
|
|
113
143
|
children: title
|
|
114
144
|
}),
|
|
115
145
|
/* @__PURE__ */ jsx(EmailText, { children: description }),
|
|
@@ -117,31 +147,45 @@ function EditorialEmail({ theme, brand, footer, title, description, imageUrl, im
|
|
|
117
147
|
href: articleUrl,
|
|
118
148
|
children: "Read the story"
|
|
119
149
|
})
|
|
120
|
-
]
|
|
121
|
-
})] }),
|
|
122
|
-
/* @__PURE__ */ jsx(EmailFooter, {
|
|
123
|
-
brand,
|
|
124
|
-
children: footer
|
|
150
|
+
] })]
|
|
125
151
|
})
|
|
126
152
|
]
|
|
127
153
|
});
|
|
128
154
|
}
|
|
129
|
-
function NewsletterEmail({ theme, brand, footer, articles
|
|
130
|
-
|
|
155
|
+
function NewsletterEmail({ theme, variant, head, brand, browserUrl, footer, articles }) {
|
|
156
|
+
const layout = {
|
|
131
157
|
theme,
|
|
158
|
+
variant,
|
|
159
|
+
head,
|
|
160
|
+
footer: /* @__PURE__ */ jsx(EmailBrandFooter, { footer }),
|
|
161
|
+
footerPlacement: footer.placement
|
|
162
|
+
};
|
|
163
|
+
return /* @__PURE__ */ jsxs(EmailLayout, {
|
|
164
|
+
...layout,
|
|
132
165
|
preview: "A few things worth making time for.",
|
|
133
166
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
167
|
+
/* @__PURE__ */ jsx(EmailBrandHeader, {
|
|
168
|
+
brand,
|
|
169
|
+
browserUrl,
|
|
170
|
+
colorScheme: theme.colorScheme,
|
|
171
|
+
align: "center"
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ jsx(EmailCaption, {
|
|
174
|
+
align: "center",
|
|
175
|
+
className: "mb-6",
|
|
176
|
+
children: "THE WEEKLY EDIT"
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ jsx(EmailHeading, {
|
|
179
|
+
align: "center",
|
|
180
|
+
children: "A little room for inspiration."
|
|
138
181
|
}),
|
|
139
|
-
/* @__PURE__ */ jsx(EmailHeading, { children: "A little room for inspiration." }),
|
|
140
182
|
/* @__PURE__ */ jsx(EmailText, {
|
|
183
|
+
align: "center",
|
|
141
184
|
tone: "muted",
|
|
185
|
+
className: "mb-8",
|
|
142
186
|
children: "A few things worth making time for. Stories, spaces, and ideas from our community."
|
|
143
187
|
}),
|
|
144
|
-
articles.map((article) => /* @__PURE__ */ jsxs(
|
|
188
|
+
articles.map((article) => /* @__PURE__ */ jsxs(EmailSection, {
|
|
145
189
|
className: "mb-6",
|
|
146
190
|
children: [
|
|
147
191
|
/* @__PURE__ */ jsx(Img, {
|
|
@@ -160,69 +204,223 @@ function NewsletterEmail({ theme, brand, footer, articles, unsubscribeUrl }) {
|
|
|
160
204
|
children: "Read the story"
|
|
161
205
|
})
|
|
162
206
|
]
|
|
163
|
-
}, article.href))
|
|
164
|
-
/* @__PURE__ */ jsx(EmailFooter, {
|
|
165
|
-
brand,
|
|
166
|
-
children: footer
|
|
167
|
-
}),
|
|
168
|
-
/* @__PURE__ */ jsx(EmailLink, {
|
|
169
|
-
href: unsubscribeUrl,
|
|
170
|
-
className: "text-caption",
|
|
171
|
-
children: "Unsubscribe"
|
|
172
|
-
})
|
|
207
|
+
}, article.href))
|
|
173
208
|
]
|
|
174
209
|
});
|
|
175
210
|
}
|
|
176
|
-
function SummaryEmail({ theme, brand, footer, period, metrics, details, dashboardUrl }) {
|
|
177
|
-
|
|
211
|
+
function SummaryEmail({ theme, variant, head, brand, browserUrl, footer, period, metrics, details, dashboardUrl }) {
|
|
212
|
+
const layout = {
|
|
178
213
|
theme,
|
|
214
|
+
variant,
|
|
215
|
+
head,
|
|
216
|
+
footer: /* @__PURE__ */ jsx(EmailBrandFooter, { footer }),
|
|
217
|
+
footerPlacement: footer.placement
|
|
218
|
+
};
|
|
219
|
+
return /* @__PURE__ */ jsxs(EmailLayout, {
|
|
220
|
+
...layout,
|
|
179
221
|
preview: `Your team’s progress · ${period}`,
|
|
180
222
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
223
|
+
/* @__PURE__ */ jsx(EmailBrandHeader, {
|
|
224
|
+
brand,
|
|
225
|
+
browserUrl,
|
|
226
|
+
colorScheme: theme.colorScheme
|
|
227
|
+
}),
|
|
228
|
+
/* @__PURE__ */ jsx(EmailCaption, {
|
|
229
|
+
className: "mb-6",
|
|
230
|
+
children: period
|
|
231
|
+
}),
|
|
232
|
+
/* @__PURE__ */ jsx(EmailHeading, {
|
|
233
|
+
size: "heading-2",
|
|
234
|
+
children: "Good work adds up."
|
|
189
235
|
}),
|
|
190
|
-
/* @__PURE__ */ jsx(EmailHeading, { children: "Good work adds up." }),
|
|
191
236
|
/* @__PURE__ */ jsx(EmailText, { children: "Here’s what your team moved forward this week." }),
|
|
192
|
-
/* @__PURE__ */ jsx(
|
|
193
|
-
className: "
|
|
237
|
+
/* @__PURE__ */ jsx(EmailPanel, {
|
|
238
|
+
className: "p-4",
|
|
194
239
|
children: /* @__PURE__ */ jsx(Row, {
|
|
195
240
|
className: "table-fixed",
|
|
196
241
|
children: metrics.map((metric) => /* @__PURE__ */ jsxs(Column, {
|
|
197
242
|
className: "px-2 align-top",
|
|
198
243
|
children: [/* @__PURE__ */ jsx(EmailText, {
|
|
244
|
+
align: "center",
|
|
199
245
|
className: "mb-1 text-heading-2 font-semibold",
|
|
200
246
|
children: metric.value
|
|
201
|
-
}), /* @__PURE__ */ jsx(
|
|
202
|
-
|
|
203
|
-
className: "mb-0
|
|
247
|
+
}), /* @__PURE__ */ jsx(EmailCaption, {
|
|
248
|
+
align: "center",
|
|
249
|
+
className: "mb-0",
|
|
204
250
|
children: metric.label
|
|
205
251
|
})]
|
|
206
252
|
}, metric.label))
|
|
207
253
|
})
|
|
208
254
|
}),
|
|
209
|
-
details.map((detail) => /* @__PURE__ */
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
align: "right",
|
|
213
|
-
children: /* @__PURE__ */ jsx(EmailText, { children: detail.value })
|
|
214
|
-
})]
|
|
255
|
+
details.map((detail) => /* @__PURE__ */ jsx(EmailDetailRow, {
|
|
256
|
+
label: detail.label,
|
|
257
|
+
value: detail.value
|
|
215
258
|
}, detail.label)),
|
|
216
259
|
/* @__PURE__ */ jsx(EmailButton, {
|
|
217
260
|
href: dashboardUrl,
|
|
261
|
+
className: "mt-4",
|
|
218
262
|
children: "View your workspace"
|
|
263
|
+
})
|
|
264
|
+
]
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function VerificationEmail({ theme, variant, head, brand, footer, code, expiresInMinutes, supportUrl }) {
|
|
268
|
+
const layout = {
|
|
269
|
+
theme,
|
|
270
|
+
variant,
|
|
271
|
+
head,
|
|
272
|
+
footer: /* @__PURE__ */ jsx(EmailBrandFooter, { footer }),
|
|
273
|
+
footerPlacement: footer.placement
|
|
274
|
+
};
|
|
275
|
+
return /* @__PURE__ */ jsxs(EmailLayout, {
|
|
276
|
+
...layout,
|
|
277
|
+
preview: `${code} is your verification code`,
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ jsx(EmailBrandHeader, {
|
|
280
|
+
brand,
|
|
281
|
+
colorScheme: theme.colorScheme,
|
|
282
|
+
align: "center"
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ jsx(EmailHeading, {
|
|
285
|
+
size: "heading-2",
|
|
286
|
+
align: "center",
|
|
287
|
+
children: "Confirm your email address"
|
|
288
|
+
}),
|
|
289
|
+
/* @__PURE__ */ jsx(EmailText, {
|
|
290
|
+
align: "center",
|
|
291
|
+
children: "Enter this code to finish signing in. It works once, and only for this device."
|
|
292
|
+
}),
|
|
293
|
+
/* @__PURE__ */ jsx(EmailOneTimeCode, { children: code }),
|
|
294
|
+
/* @__PURE__ */ jsxs(EmailCaption, {
|
|
295
|
+
align: "center",
|
|
296
|
+
className: "mb-6",
|
|
297
|
+
children: [
|
|
298
|
+
"The code expires in ",
|
|
299
|
+
expiresInMinutes,
|
|
300
|
+
" minutes."
|
|
301
|
+
]
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ jsxs(EmailText, {
|
|
304
|
+
align: "center",
|
|
305
|
+
className: "mb-0",
|
|
306
|
+
children: [
|
|
307
|
+
"Didn’t ask for this code? Ignore this email, or ",
|
|
308
|
+
/* @__PURE__ */ jsx(EmailLink, {
|
|
309
|
+
href: supportUrl,
|
|
310
|
+
children: "tell our team"
|
|
311
|
+
}),
|
|
312
|
+
"."
|
|
313
|
+
]
|
|
314
|
+
})
|
|
315
|
+
]
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
function ReceiptEmail({ theme, variant, head, brand, footer, orderNumber, orderDate, lines, total, paymentMethod, invoiceUrl }) {
|
|
319
|
+
const layout = {
|
|
320
|
+
theme,
|
|
321
|
+
variant,
|
|
322
|
+
head,
|
|
323
|
+
footer: /* @__PURE__ */ jsx(EmailBrandFooter, { footer }),
|
|
324
|
+
footerPlacement: footer.placement
|
|
325
|
+
};
|
|
326
|
+
return /* @__PURE__ */ jsxs(EmailLayout, {
|
|
327
|
+
...layout,
|
|
328
|
+
preview: `Receipt ${orderNumber} · ${total}`,
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ jsx(EmailBrandHeader, {
|
|
331
|
+
brand,
|
|
332
|
+
colorScheme: theme.colorScheme
|
|
333
|
+
}),
|
|
334
|
+
/* @__PURE__ */ jsx(EmailCaption, {
|
|
335
|
+
className: "mb-6",
|
|
336
|
+
children: "RECEIPT"
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ jsx(EmailHeading, {
|
|
339
|
+
size: "heading-3",
|
|
340
|
+
children: "Thanks for your order."
|
|
341
|
+
}),
|
|
342
|
+
/* @__PURE__ */ jsxs(EmailText, { children: [
|
|
343
|
+
"Order ",
|
|
344
|
+
/* @__PURE__ */ jsx(EmailInlineCode, { children: orderNumber }),
|
|
345
|
+
" was confirmed on ",
|
|
346
|
+
orderDate,
|
|
347
|
+
". Keep this receipt for your records."
|
|
348
|
+
] }),
|
|
349
|
+
/* @__PURE__ */ jsxs(EmailPanel, { children: [
|
|
350
|
+
lines.map((line) => /* @__PURE__ */ jsx(EmailDetailRow, {
|
|
351
|
+
label: line.label,
|
|
352
|
+
value: line.value
|
|
353
|
+
}, line.label)),
|
|
354
|
+
/* @__PURE__ */ jsx(EmailDivider, { className: "my-3" }),
|
|
355
|
+
/* @__PURE__ */ jsx(EmailDetailRow, {
|
|
356
|
+
label: "Total",
|
|
357
|
+
value: total,
|
|
358
|
+
emphasis: true
|
|
359
|
+
})
|
|
360
|
+
] }),
|
|
361
|
+
/* @__PURE__ */ jsxs(EmailCaption, {
|
|
362
|
+
className: "mb-6",
|
|
363
|
+
children: [
|
|
364
|
+
"Paid with ",
|
|
365
|
+
paymentMethod,
|
|
366
|
+
"."
|
|
367
|
+
]
|
|
219
368
|
}),
|
|
220
|
-
/* @__PURE__ */ jsx(
|
|
369
|
+
/* @__PURE__ */ jsx(EmailButton, {
|
|
370
|
+
href: invoiceUrl,
|
|
371
|
+
children: "View invoice"
|
|
372
|
+
})
|
|
373
|
+
]
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
function ReleaseNotesEmail({ theme, variant, head, brand, browserUrl, footer, version, summary, sections, migration, changelogUrl }) {
|
|
377
|
+
const layout = {
|
|
378
|
+
theme,
|
|
379
|
+
variant,
|
|
380
|
+
head,
|
|
381
|
+
footer: /* @__PURE__ */ jsx(EmailBrandFooter, { footer }),
|
|
382
|
+
footerPlacement: footer.placement
|
|
383
|
+
};
|
|
384
|
+
return /* @__PURE__ */ jsxs(EmailLayout, {
|
|
385
|
+
...layout,
|
|
386
|
+
preview: `What shipped in ${version}`,
|
|
387
|
+
children: [
|
|
388
|
+
/* @__PURE__ */ jsx(EmailBrandHeader, {
|
|
221
389
|
brand,
|
|
222
|
-
|
|
390
|
+
browserUrl,
|
|
391
|
+
colorScheme: theme.colorScheme
|
|
392
|
+
}),
|
|
393
|
+
/* @__PURE__ */ jsxs(EmailCaption, {
|
|
394
|
+
className: "mb-6",
|
|
395
|
+
children: ["RELEASE ", version]
|
|
396
|
+
}),
|
|
397
|
+
/* @__PURE__ */ jsx(EmailHeading, {
|
|
398
|
+
size: "heading-2",
|
|
399
|
+
children: "What shipped this month."
|
|
400
|
+
}),
|
|
401
|
+
/* @__PURE__ */ jsx(EmailText, { children: summary }),
|
|
402
|
+
sections.map((section) => /* @__PURE__ */ jsxs(EmailSection, {
|
|
403
|
+
className: "mb-4",
|
|
404
|
+
children: [/* @__PURE__ */ jsx(EmailHeading, {
|
|
405
|
+
as: "h3",
|
|
406
|
+
children: section.title
|
|
407
|
+
}), /* @__PURE__ */ jsx(EmailBulletList, { items: section.changes })]
|
|
408
|
+
}, section.title)),
|
|
409
|
+
migration ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(EmailMarkdown, {
|
|
410
|
+
theme,
|
|
411
|
+
variant,
|
|
412
|
+
children: migration.notes
|
|
413
|
+
}), /* @__PURE__ */ jsx(EmailCodeBlock, {
|
|
414
|
+
theme,
|
|
415
|
+
language: migration.language,
|
|
416
|
+
code: migration.code
|
|
417
|
+
})] }) : null,
|
|
418
|
+
/* @__PURE__ */ jsx(EmailButton, {
|
|
419
|
+
href: changelogUrl,
|
|
420
|
+
children: "Read the full changelog"
|
|
223
421
|
})
|
|
224
422
|
]
|
|
225
423
|
});
|
|
226
424
|
}
|
|
227
425
|
//#endregion
|
|
228
|
-
export { EditorialEmail, InvitationEmail, NewsletterEmail, ProductEmail, SummaryEmail };
|
|
426
|
+
export { EditorialEmail, InvitationEmail, NewsletterEmail, ProductEmail, ReceiptEmail, ReleaseNotesEmail, SummaryEmail, VerificationEmail };
|
package/dist/email/theme.d.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
//#region src/email/theme.d.ts
|
|
2
2
|
declare const emailColors: readonly ["background", "foreground", "card", "card-foreground", "primary", "primary-foreground", "primary-text", "muted", "muted-foreground", "border"];
|
|
3
|
-
declare const
|
|
3
|
+
declare const titleSizes: readonly ["display", "heading-1", "heading-2", "heading-3", "heading-4"];
|
|
4
4
|
type EmailColor = (typeof emailColors)[number];
|
|
5
|
-
type
|
|
5
|
+
type EmailTitleSize = (typeof titleSizes)[number];
|
|
6
|
+
type EmailCodeToken = "foreground" | "comment" | "keyword" | "string" | "function" | "constant" | "punctuation" | "parameter";
|
|
6
7
|
type EmailTypeStyle = {
|
|
7
8
|
fontSize: string;
|
|
8
9
|
lineHeight: string;
|
|
9
10
|
fontWeight: string;
|
|
10
11
|
letterSpacing: string;
|
|
11
12
|
};
|
|
12
|
-
type
|
|
13
|
+
export type EmailColorScheme = "light" | "dark";
|
|
14
|
+
export type EmailTheme = {
|
|
15
|
+
colorScheme: EmailColorScheme;
|
|
13
16
|
colors: Record<EmailColor, string>;
|
|
14
17
|
fonts: {
|
|
15
18
|
body: string;
|
|
16
19
|
display: string;
|
|
20
|
+
mono: string;
|
|
17
21
|
};
|
|
18
22
|
radii: {
|
|
19
23
|
control: string;
|
|
@@ -27,9 +31,12 @@ type EmailTheme = {
|
|
|
27
31
|
fontSize: string;
|
|
28
32
|
lineHeight: string;
|
|
29
33
|
};
|
|
30
|
-
text: Record<
|
|
34
|
+
text: Record<EmailTitleSize | "body" | "caption", EmailTypeStyle>;
|
|
35
|
+
code: Record<EmailCodeToken, string>;
|
|
31
36
|
};
|
|
32
|
-
declare function createEmailTheme(tokens: ReadonlyMap<string, string>, rootFontSize?:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
export declare function createEmailTheme(tokens: ReadonlyMap<string, string>, { rootFontSize, colorScheme }?: {
|
|
38
|
+
rootFontSize?: number;
|
|
39
|
+
colorScheme?: EmailColorScheme;
|
|
40
|
+
}): EmailTheme;
|
|
41
|
+
export declare function emailThemeFromCss(cssSources: string[], mode?: EmailColorScheme, rootFontSize?: number): EmailTheme;
|
|
42
|
+
//#endregion
|
package/dist/email/theme.js
CHANGED
|
@@ -25,7 +25,7 @@ function numericStyle(name, tokens, fallback) {
|
|
|
25
25
|
if (!/^\d*\.?\d+(px|em)?$/.test(value)) throw new Error(`Email theme: unsupported ${name}: ${value}.`);
|
|
26
26
|
return value;
|
|
27
27
|
}
|
|
28
|
-
function createEmailTheme(tokens, rootFontSize = 16) {
|
|
28
|
+
function createEmailTheme(tokens, { rootFontSize = 16, colorScheme = "light" } = {}) {
|
|
29
29
|
if (!Number.isFinite(rootFontSize) || rootFontSize <= 0) throw new Error("Email theme: rootFontSize must be a positive pixel value.");
|
|
30
30
|
function lengthPixels(name, allowZero = false) {
|
|
31
31
|
return emailLengthPixels(name, tokenValue(name, tokens), rootFontSize, allowZero);
|
|
@@ -43,11 +43,17 @@ function createEmailTheme(tokens, rootFontSize = 16) {
|
|
|
43
43
|
if (background.alpha !== 1) throw new Error("Email theme: --background must be opaque.");
|
|
44
44
|
const card = composite(color("card"), background);
|
|
45
45
|
const primary = composite(color("primary"), card);
|
|
46
|
+
const muted = composite(color("muted"), card);
|
|
46
47
|
function opaqueColor(name, surface = card) {
|
|
47
48
|
const result = composite(color(name), surface);
|
|
48
49
|
return `rgb(${Math.round(result.r)}, ${Math.round(result.g)}, ${Math.round(result.b)})`;
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function codeColor(token) {
|
|
52
|
+
const syntaxToken = token === "foreground" ? "code-foreground" : `code-token-${token}`;
|
|
53
|
+
const withoutCodeCss = token === "comment" ? "muted-foreground" : "card-foreground";
|
|
54
|
+
return opaqueColor(tokens.has(`--${syntaxToken}`) ? syntaxToken : withoutCodeCss, muted);
|
|
55
|
+
}
|
|
56
|
+
function title(name) {
|
|
51
57
|
const spacing = tokenValue(`--text-${name}--letter-spacing`, tokens, "0");
|
|
52
58
|
if (!/^-?\d*\.?\d+(px|em)?$/.test(spacing)) throw new Error(`Email theme: unsupported ${name} letter spacing: ${spacing}.`);
|
|
53
59
|
return {
|
|
@@ -58,6 +64,7 @@ function createEmailTheme(tokens, rootFontSize = 16) {
|
|
|
58
64
|
};
|
|
59
65
|
}
|
|
60
66
|
return {
|
|
67
|
+
colorScheme,
|
|
61
68
|
colors: {
|
|
62
69
|
background: opaqueColor("background", background),
|
|
63
70
|
foreground: opaqueColor("foreground", background),
|
|
@@ -72,7 +79,8 @@ function createEmailTheme(tokens, rootFontSize = 16) {
|
|
|
72
79
|
},
|
|
73
80
|
fonts: {
|
|
74
81
|
body: tokenValue("--font-body", tokens),
|
|
75
|
-
display: tokenValue("--font-display", tokens)
|
|
82
|
+
display: tokenValue("--font-display", tokens),
|
|
83
|
+
mono: tokenValue("--font-mono", tokens)
|
|
76
84
|
},
|
|
77
85
|
radii: {
|
|
78
86
|
control: `${lengthPixels("--radius-control", true)}px`,
|
|
@@ -99,15 +107,29 @@ function createEmailTheme(tokens, rootFontSize = 16) {
|
|
|
99
107
|
fontWeight: "400",
|
|
100
108
|
letterSpacing: "0"
|
|
101
109
|
},
|
|
102
|
-
|
|
103
|
-
"heading-
|
|
104
|
-
"heading-
|
|
105
|
-
"heading-
|
|
110
|
+
display: title("display"),
|
|
111
|
+
"heading-1": title("heading-1"),
|
|
112
|
+
"heading-2": title("heading-2"),
|
|
113
|
+
"heading-3": title("heading-3"),
|
|
114
|
+
"heading-4": title("heading-4")
|
|
115
|
+
},
|
|
116
|
+
code: {
|
|
117
|
+
foreground: codeColor("foreground"),
|
|
118
|
+
comment: codeColor("comment"),
|
|
119
|
+
keyword: codeColor("keyword"),
|
|
120
|
+
string: codeColor("string"),
|
|
121
|
+
function: codeColor("function"),
|
|
122
|
+
constant: codeColor("constant"),
|
|
123
|
+
punctuation: codeColor("punctuation"),
|
|
124
|
+
parameter: codeColor("parameter")
|
|
106
125
|
}
|
|
107
126
|
};
|
|
108
127
|
}
|
|
109
128
|
function emailThemeFromCss(cssSources, mode = "light", rootFontSize = 16) {
|
|
110
|
-
return createEmailTheme(tokenMaps(cssSources)[mode],
|
|
129
|
+
return createEmailTheme(tokenMaps(cssSources)[mode], {
|
|
130
|
+
rootFontSize,
|
|
131
|
+
colorScheme: mode
|
|
132
|
+
});
|
|
111
133
|
}
|
|
112
134
|
//#endregion
|
|
113
135
|
export { createEmailTheme, emailThemeFromCss };
|