@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
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { EmailColorScheme } from "./theme.js";
|
|
2
|
+
import { EmailFooterPlacement } from "./email.js";
|
|
3
|
+
import { EmailFooterAlign, EmailNavLink, EmailSocialLink } from "./email-footer.js";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
//#region src/email/email-brand.d.ts
|
|
6
|
+
export type EmailBrand = {
|
|
7
|
+
name: string;
|
|
8
|
+
homeUrl: string;
|
|
9
|
+
logoUrl?: string;
|
|
10
|
+
logoDarkUrl?: string;
|
|
11
|
+
logoWidth?: number;
|
|
12
|
+
logoHeight?: number;
|
|
13
|
+
};
|
|
14
|
+
export type EmailFooterContent = {
|
|
15
|
+
tagline: string;
|
|
16
|
+
socialLinks: EmailSocialLink[];
|
|
17
|
+
socialIconBaseUrl?: string;
|
|
18
|
+
helpLinks: EmailNavLink[];
|
|
19
|
+
sender: {
|
|
20
|
+
company: string;
|
|
21
|
+
addressLines: string[];
|
|
22
|
+
};
|
|
23
|
+
reason: string;
|
|
24
|
+
legal: string;
|
|
25
|
+
align?: EmailFooterAlign;
|
|
26
|
+
placement?: EmailFooterPlacement;
|
|
27
|
+
} & ({
|
|
28
|
+
mailing: "transactional";
|
|
29
|
+
} | {
|
|
30
|
+
mailing: "marketing";
|
|
31
|
+
unsubscribeUrl: string;
|
|
32
|
+
preferencesUrl?: string;
|
|
33
|
+
});
|
|
34
|
+
export declare function EmailLogo({ name, src, width, height, href }: {
|
|
35
|
+
name: string;
|
|
36
|
+
src?: string;
|
|
37
|
+
width?: number;
|
|
38
|
+
height?: number;
|
|
39
|
+
href?: string;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
export declare function EmailBrowserLink({ href, children }: {
|
|
42
|
+
href: string;
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
45
|
+
export type EmailHeaderAlign = "split" | "center";
|
|
46
|
+
export declare function EmailHeader({ children, aside, align }: {
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
aside?: ReactNode;
|
|
49
|
+
align?: EmailHeaderAlign;
|
|
50
|
+
}): import("react").JSX.Element;
|
|
51
|
+
export declare function EmailBrandHeader({ brand, browserUrl, colorScheme, align }: {
|
|
52
|
+
brand: EmailBrand;
|
|
53
|
+
browserUrl?: string;
|
|
54
|
+
colorScheme?: EmailColorScheme;
|
|
55
|
+
align?: EmailHeaderAlign;
|
|
56
|
+
}): import("react").JSX.Element;
|
|
57
|
+
export declare function EmailBrandFooter({ footer }: {
|
|
58
|
+
footer: EmailFooterContent;
|
|
59
|
+
}): import("react").JSX.Element;
|
|
60
|
+
//#endregion
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { EmailCaption, EmailMutedLink, EmailSection } from "./email.js";
|
|
2
|
+
import { EmailAddress, EmailFooter, EmailFooterLegal, EmailFooterLinks, EmailSocialLinks, EmailUnsubscribe } from "./email-footer.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Column, Img, Link, Row } from "react-email";
|
|
5
|
+
//#region src/email/email-brand.tsx
|
|
6
|
+
function EmailLogo({ name, src, width = 120, height = 32, href }) {
|
|
7
|
+
const mark = src ? /* @__PURE__ */ jsx(Img, {
|
|
8
|
+
src,
|
|
9
|
+
alt: name,
|
|
10
|
+
width,
|
|
11
|
+
height,
|
|
12
|
+
className: "inline-block"
|
|
13
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
14
|
+
className: "font-display text-heading-4 font-semibold text-card-foreground",
|
|
15
|
+
children: name
|
|
16
|
+
});
|
|
17
|
+
return href ? /* @__PURE__ */ jsx(Link, {
|
|
18
|
+
href,
|
|
19
|
+
className: "text-card-foreground no-underline",
|
|
20
|
+
children: mark
|
|
21
|
+
}) : mark;
|
|
22
|
+
}
|
|
23
|
+
function EmailBrowserLink({ href, children = "View in browser" }) {
|
|
24
|
+
return /* @__PURE__ */ jsx(EmailMutedLink, {
|
|
25
|
+
href,
|
|
26
|
+
children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function EmailHeader({ children, aside, align = "split" }) {
|
|
30
|
+
if (align === "center") return /* @__PURE__ */ jsxs(EmailSection, {
|
|
31
|
+
align: "center",
|
|
32
|
+
className: "mb-8",
|
|
33
|
+
children: [children, aside ? /* @__PURE__ */ jsx(EmailSection, {
|
|
34
|
+
align: "center",
|
|
35
|
+
className: "mt-3",
|
|
36
|
+
children: aside
|
|
37
|
+
}) : null]
|
|
38
|
+
});
|
|
39
|
+
return /* @__PURE__ */ jsxs(Row, {
|
|
40
|
+
className: "mb-8",
|
|
41
|
+
children: [/* @__PURE__ */ jsx(Column, {
|
|
42
|
+
className: "align-middle",
|
|
43
|
+
children
|
|
44
|
+
}), aside ? /* @__PURE__ */ jsx(Column, {
|
|
45
|
+
align: "right",
|
|
46
|
+
className: "align-middle",
|
|
47
|
+
children: aside
|
|
48
|
+
}) : null]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function EmailBrandHeader({ brand, browserUrl, colorScheme = "light", align = "split" }) {
|
|
52
|
+
const logoUrl = colorScheme === "dark" ? brand.logoDarkUrl ?? brand.logoUrl : brand.logoUrl;
|
|
53
|
+
return /* @__PURE__ */ jsx(EmailHeader, {
|
|
54
|
+
align,
|
|
55
|
+
aside: browserUrl ? /* @__PURE__ */ jsx(EmailBrowserLink, { href: browserUrl }) : null,
|
|
56
|
+
children: /* @__PURE__ */ jsx(EmailLogo, {
|
|
57
|
+
name: brand.name,
|
|
58
|
+
src: logoUrl,
|
|
59
|
+
width: brand.logoWidth,
|
|
60
|
+
height: brand.logoHeight,
|
|
61
|
+
href: brand.homeUrl
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function EmailBrandFooter({ footer }) {
|
|
66
|
+
return /* @__PURE__ */ jsxs(EmailFooter, {
|
|
67
|
+
align: footer.align,
|
|
68
|
+
placement: footer.placement,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsx(EmailSocialLinks, {
|
|
71
|
+
links: footer.socialLinks,
|
|
72
|
+
iconBaseUrl: footer.socialIconBaseUrl
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ jsx(EmailFooterLinks, { links: footer.helpLinks }),
|
|
75
|
+
/* @__PURE__ */ jsx(EmailCaption, {
|
|
76
|
+
className: "mb-0",
|
|
77
|
+
children: footer.tagline
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ jsxs(EmailFooterLegal, { children: [
|
|
80
|
+
/* @__PURE__ */ jsx(EmailAddress, {
|
|
81
|
+
company: footer.sender.company,
|
|
82
|
+
lines: footer.sender.addressLines
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ jsx(EmailCaption, {
|
|
85
|
+
className: "mb-2",
|
|
86
|
+
children: footer.reason
|
|
87
|
+
}),
|
|
88
|
+
footer.mailing === "marketing" ? /* @__PURE__ */ jsx(EmailUnsubscribe, {
|
|
89
|
+
unsubscribeUrl: footer.unsubscribeUrl,
|
|
90
|
+
preferencesUrl: footer.preferencesUrl
|
|
91
|
+
}) : null,
|
|
92
|
+
/* @__PURE__ */ jsx(EmailCaption, {
|
|
93
|
+
className: "mb-0",
|
|
94
|
+
children: footer.legal
|
|
95
|
+
})
|
|
96
|
+
] })
|
|
97
|
+
]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { EmailBrandFooter, EmailBrandHeader, EmailBrowserLink, EmailHeader, EmailLogo };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EmailTheme } from "./theme.js";
|
|
2
|
+
import { EmailVariant } from "./email.js";
|
|
3
|
+
import { CodeInlineProps, PrismLanguage } from "react-email";
|
|
4
|
+
//#region src/email/email-code.d.ts
|
|
5
|
+
export declare function EmailInlineCode({ className, ...props }: CodeInlineProps): import("react").JSX.Element;
|
|
6
|
+
export declare function EmailCodeBlock({ theme, code, language, lineNumbers, className }: {
|
|
7
|
+
theme: EmailTheme;
|
|
8
|
+
code: string;
|
|
9
|
+
language: PrismLanguage;
|
|
10
|
+
lineNumbers?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
export declare function EmailMarkdown({ theme, variant, children }: {
|
|
14
|
+
theme: EmailTheme;
|
|
15
|
+
variant?: EmailVariant;
|
|
16
|
+
children: string;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
//#endregion
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { surfaceColors } from "./email.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { CodeBlock, CodeInline, Markdown, Section } from "react-email";
|
|
4
|
+
//#region src/email/email-code.tsx
|
|
5
|
+
function EmailInlineCode({ className = "", ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(CodeInline, {
|
|
7
|
+
...props,
|
|
8
|
+
className: `rounded-control bg-muted px-1 font-mono text-card-foreground ${className}`
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function prismTheme(theme) {
|
|
12
|
+
const { code } = theme;
|
|
13
|
+
return {
|
|
14
|
+
base: {
|
|
15
|
+
margin: "0",
|
|
16
|
+
padding: "16px",
|
|
17
|
+
background: theme.colors.muted,
|
|
18
|
+
color: code.foreground,
|
|
19
|
+
borderRadius: theme.radii.panel,
|
|
20
|
+
fontFamily: theme.fonts.mono,
|
|
21
|
+
fontSize: theme.text.caption.fontSize,
|
|
22
|
+
lineHeight: "1.6",
|
|
23
|
+
whiteSpace: "pre-wrap",
|
|
24
|
+
wordBreak: "break-word"
|
|
25
|
+
},
|
|
26
|
+
comment: { color: code.comment },
|
|
27
|
+
prolog: { color: code.comment },
|
|
28
|
+
doctype: { color: code.comment },
|
|
29
|
+
cdata: { color: code.comment },
|
|
30
|
+
punctuation: { color: code.punctuation },
|
|
31
|
+
operator: { color: code.punctuation },
|
|
32
|
+
keyword: { color: code.keyword },
|
|
33
|
+
atrule: { color: code.keyword },
|
|
34
|
+
"attr-value": { color: code.string },
|
|
35
|
+
string: { color: code.string },
|
|
36
|
+
char: { color: code.string },
|
|
37
|
+
inserted: { color: code.string },
|
|
38
|
+
regex: { color: code.string },
|
|
39
|
+
"attr-name": { color: code.parameter },
|
|
40
|
+
property: { color: code.parameter },
|
|
41
|
+
variable: { color: code.parameter },
|
|
42
|
+
function: { color: code.function },
|
|
43
|
+
"class-name": { color: code.function },
|
|
44
|
+
tag: { color: code.function },
|
|
45
|
+
boolean: { color: code.constant },
|
|
46
|
+
number: { color: code.constant },
|
|
47
|
+
constant: { color: code.constant },
|
|
48
|
+
symbol: { color: code.constant },
|
|
49
|
+
deleted: { color: code.constant },
|
|
50
|
+
builtin: { color: code.constant }
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function EmailCodeBlock({ theme, code, language, lineNumbers = false, className = "" }) {
|
|
54
|
+
return /* @__PURE__ */ jsx(Section, {
|
|
55
|
+
className: `mb-6 ${className}`,
|
|
56
|
+
children: /* @__PURE__ */ jsx(CodeBlock, {
|
|
57
|
+
code,
|
|
58
|
+
language,
|
|
59
|
+
lineNumbers,
|
|
60
|
+
fontFamily: theme.fonts.mono,
|
|
61
|
+
theme: prismTheme(theme)
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function markdownStyles(theme, variant) {
|
|
66
|
+
const colors = surfaceColors(theme, variant);
|
|
67
|
+
const body = {
|
|
68
|
+
margin: "0 0 16px",
|
|
69
|
+
fontFamily: theme.fonts.body,
|
|
70
|
+
fontSize: theme.text.body.fontSize,
|
|
71
|
+
lineHeight: theme.text.body.lineHeight,
|
|
72
|
+
color: colors["card-foreground"]
|
|
73
|
+
};
|
|
74
|
+
function headingStyle(size) {
|
|
75
|
+
const style = theme.text[size];
|
|
76
|
+
return {
|
|
77
|
+
margin: "0 0 16px",
|
|
78
|
+
fontFamily: theme.fonts.display,
|
|
79
|
+
fontSize: style.fontSize,
|
|
80
|
+
lineHeight: style.lineHeight,
|
|
81
|
+
fontWeight: style.fontWeight,
|
|
82
|
+
letterSpacing: style.letterSpacing,
|
|
83
|
+
color: colors["card-foreground"]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const monospace = {
|
|
87
|
+
fontFamily: theme.fonts.mono,
|
|
88
|
+
fontSize: theme.text.caption.fontSize,
|
|
89
|
+
background: theme.colors.muted,
|
|
90
|
+
color: theme.code.foreground,
|
|
91
|
+
borderRadius: theme.radii.control
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
p: body,
|
|
95
|
+
li: {
|
|
96
|
+
...body,
|
|
97
|
+
margin: "0 0 4px"
|
|
98
|
+
},
|
|
99
|
+
ul: {
|
|
100
|
+
...body,
|
|
101
|
+
paddingLeft: "20px"
|
|
102
|
+
},
|
|
103
|
+
ol: {
|
|
104
|
+
...body,
|
|
105
|
+
paddingLeft: "20px"
|
|
106
|
+
},
|
|
107
|
+
h1: headingStyle("heading-1"),
|
|
108
|
+
h2: headingStyle("heading-2"),
|
|
109
|
+
h3: headingStyle("heading-3"),
|
|
110
|
+
h4: headingStyle("heading-4"),
|
|
111
|
+
h5: headingStyle("heading-4"),
|
|
112
|
+
h6: headingStyle("heading-4"),
|
|
113
|
+
bold: { fontWeight: 600 },
|
|
114
|
+
italic: { fontStyle: "italic" },
|
|
115
|
+
link: {
|
|
116
|
+
color: colors["primary-text"],
|
|
117
|
+
textDecoration: "underline"
|
|
118
|
+
},
|
|
119
|
+
codeInline: {
|
|
120
|
+
...monospace,
|
|
121
|
+
padding: "2px 4px"
|
|
122
|
+
},
|
|
123
|
+
codeBlock: {
|
|
124
|
+
...monospace,
|
|
125
|
+
display: "block",
|
|
126
|
+
padding: "16px",
|
|
127
|
+
borderRadius: theme.radii.panel,
|
|
128
|
+
whiteSpace: "pre-wrap"
|
|
129
|
+
},
|
|
130
|
+
blockQuote: {
|
|
131
|
+
...body,
|
|
132
|
+
borderLeft: `3px solid ${theme.colors.border}`,
|
|
133
|
+
paddingLeft: "16px",
|
|
134
|
+
color: colors["muted-foreground"]
|
|
135
|
+
},
|
|
136
|
+
hr: {
|
|
137
|
+
border: "none",
|
|
138
|
+
borderTop: `1px solid ${theme.colors.border}`,
|
|
139
|
+
margin: "24px 0"
|
|
140
|
+
},
|
|
141
|
+
image: {
|
|
142
|
+
maxWidth: "100%",
|
|
143
|
+
borderRadius: theme.radii.scene
|
|
144
|
+
},
|
|
145
|
+
table: {
|
|
146
|
+
width: "100%",
|
|
147
|
+
borderCollapse: "collapse",
|
|
148
|
+
marginBottom: "16px"
|
|
149
|
+
},
|
|
150
|
+
th: {
|
|
151
|
+
...body,
|
|
152
|
+
margin: "0",
|
|
153
|
+
textAlign: "left",
|
|
154
|
+
padding: "8px 0",
|
|
155
|
+
borderBottom: `1px solid ${theme.colors.border}`
|
|
156
|
+
},
|
|
157
|
+
td: {
|
|
158
|
+
...body,
|
|
159
|
+
margin: "0",
|
|
160
|
+
padding: "8px 0",
|
|
161
|
+
borderBottom: `1px solid ${theme.colors.border}`
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function EmailMarkdown({ theme, variant = "contained", children }) {
|
|
166
|
+
return /* @__PURE__ */ jsx(Markdown, {
|
|
167
|
+
markdownCustomStyles: markdownStyles(theme, variant),
|
|
168
|
+
children
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
export { EmailCodeBlock, EmailInlineCode, EmailMarkdown };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { EmailFooterPlacement } from "./email.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/email/email-footer.d.ts
|
|
4
|
+
export type EmailNavLink = {
|
|
5
|
+
label: string;
|
|
6
|
+
href: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const emailSocialPlatformNames: {
|
|
9
|
+
readonly x: "X";
|
|
10
|
+
readonly bluesky: "Bluesky";
|
|
11
|
+
readonly threads: "Threads";
|
|
12
|
+
readonly instagram: "Instagram";
|
|
13
|
+
readonly facebook: "Facebook";
|
|
14
|
+
readonly linkedin: "LinkedIn";
|
|
15
|
+
readonly youtube: "YouTube";
|
|
16
|
+
readonly tiktok: "TikTok";
|
|
17
|
+
readonly github: "GitHub";
|
|
18
|
+
readonly discord: "Discord";
|
|
19
|
+
readonly slack: "Slack";
|
|
20
|
+
readonly mastodon: "Mastodon";
|
|
21
|
+
};
|
|
22
|
+
export type EmailSocialPlatform = keyof typeof emailSocialPlatformNames;
|
|
23
|
+
export type EmailSocialLink = {
|
|
24
|
+
href: string;
|
|
25
|
+
iconAlt?: string;
|
|
26
|
+
} & ({
|
|
27
|
+
platform: EmailSocialPlatform;
|
|
28
|
+
label?: string;
|
|
29
|
+
iconUrl?: string;
|
|
30
|
+
} | {
|
|
31
|
+
platform?: undefined;
|
|
32
|
+
label: string;
|
|
33
|
+
iconUrl?: string;
|
|
34
|
+
});
|
|
35
|
+
export type EmailFooterAlign = "start" | "center";
|
|
36
|
+
export declare function EmailFooter({ children, align, placement }: {
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
align?: EmailFooterAlign;
|
|
39
|
+
placement?: EmailFooterPlacement;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
export declare function EmailFooterLegal({ children, className }: {
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
className?: string;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
45
|
+
export declare function EmailSocialLinks({ links, iconBaseUrl, iconSize }: {
|
|
46
|
+
links: EmailSocialLink[];
|
|
47
|
+
iconBaseUrl?: string;
|
|
48
|
+
iconSize?: number;
|
|
49
|
+
}): import("react").JSX.Element | null;
|
|
50
|
+
export declare function EmailFooterLinks({ links }: {
|
|
51
|
+
links: EmailNavLink[];
|
|
52
|
+
}): import("react").JSX.Element | null;
|
|
53
|
+
export declare function EmailAddress({ company, lines }: {
|
|
54
|
+
company: string;
|
|
55
|
+
lines: string[];
|
|
56
|
+
}): import("react").JSX.Element;
|
|
57
|
+
export declare function EmailUnsubscribe({ unsubscribeUrl, preferencesUrl, unsubscribeLabel, preferencesLabel }: {
|
|
58
|
+
unsubscribeUrl: string;
|
|
59
|
+
preferencesUrl?: string;
|
|
60
|
+
unsubscribeLabel?: string;
|
|
61
|
+
preferencesLabel?: string;
|
|
62
|
+
}): import("react").JSX.Element;
|
|
63
|
+
//#endregion
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { EmailCaption, EmailDivider, EmailMutedLink } from "./email.js";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Img, Section } from "react-email";
|
|
5
|
+
//#region src/email/email-footer.tsx
|
|
6
|
+
const emailSocialPlatformNames = {
|
|
7
|
+
x: "X",
|
|
8
|
+
bluesky: "Bluesky",
|
|
9
|
+
threads: "Threads",
|
|
10
|
+
instagram: "Instagram",
|
|
11
|
+
facebook: "Facebook",
|
|
12
|
+
linkedin: "LinkedIn",
|
|
13
|
+
youtube: "YouTube",
|
|
14
|
+
tiktok: "TikTok",
|
|
15
|
+
github: "GitHub",
|
|
16
|
+
discord: "Discord",
|
|
17
|
+
slack: "Slack",
|
|
18
|
+
mastodon: "Mastodon"
|
|
19
|
+
};
|
|
20
|
+
function separatedLinks(links) {
|
|
21
|
+
return links.map((link, index) => /* @__PURE__ */ jsxs(Fragment, { children: [index > 0 ? " · " : null, /* @__PURE__ */ jsx(EmailMutedLink, {
|
|
22
|
+
href: link.href,
|
|
23
|
+
children: link.label
|
|
24
|
+
})] }, link.href));
|
|
25
|
+
}
|
|
26
|
+
function EmailFooter({ children, align = "start", placement = "inside" }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [placement === "inside" ? /* @__PURE__ */ jsx(EmailDivider, {}) : null, /* @__PURE__ */ jsx(Section, {
|
|
28
|
+
className: `${placement === "inside" ? "" : "pt-6"} ${align === "center" ? "text-center" : "text-left"}`,
|
|
29
|
+
children
|
|
30
|
+
})] });
|
|
31
|
+
}
|
|
32
|
+
function EmailFooterLegal({ children, className = "" }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(Section, {
|
|
34
|
+
className: `mt-6 ${className}`,
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function resolveSocialLink(link, iconBaseUrl) {
|
|
39
|
+
const label = link.platform ? link.label ?? emailSocialPlatformNames[link.platform] : link.label;
|
|
40
|
+
const base = iconBaseUrl?.replace(/\/$/, "");
|
|
41
|
+
return {
|
|
42
|
+
label,
|
|
43
|
+
iconUrl: link.iconUrl ?? (link.platform && base ? `${base}/${link.platform}.png` : void 0),
|
|
44
|
+
alt: link.iconAlt ?? label
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function EmailSocialLinks({ links, iconBaseUrl, iconSize = 24 }) {
|
|
48
|
+
if (links.length === 0) return null;
|
|
49
|
+
return /* @__PURE__ */ jsx(Section, {
|
|
50
|
+
className: "mb-4",
|
|
51
|
+
children: links.map((link, index) => {
|
|
52
|
+
const { label, iconUrl, alt } = resolveSocialLink(link, iconBaseUrl);
|
|
53
|
+
const spacing = index < links.length - 1 ? "mr-3" : "";
|
|
54
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [index > 0 ? " " : null, /* @__PURE__ */ jsx(EmailMutedLink, {
|
|
55
|
+
href: link.href,
|
|
56
|
+
className: `${iconUrl ? "no-underline" : "underline"} ${spacing}`,
|
|
57
|
+
children: iconUrl ? /* @__PURE__ */ jsx(Img, {
|
|
58
|
+
src: iconUrl,
|
|
59
|
+
alt,
|
|
60
|
+
width: iconSize,
|
|
61
|
+
height: iconSize,
|
|
62
|
+
className: "inline-block align-middle"
|
|
63
|
+
}) : label
|
|
64
|
+
})] }, link.href);
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function EmailFooterLinks({ links }) {
|
|
69
|
+
if (links.length === 0) return null;
|
|
70
|
+
return /* @__PURE__ */ jsx(EmailCaption, {
|
|
71
|
+
className: "mb-2",
|
|
72
|
+
children: separatedLinks(links)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function EmailAddress({ company, lines }) {
|
|
76
|
+
return /* @__PURE__ */ jsxs(EmailCaption, {
|
|
77
|
+
className: "mb-2",
|
|
78
|
+
children: [/* @__PURE__ */ jsx("strong", {
|
|
79
|
+
className: "font-semibold",
|
|
80
|
+
children: company
|
|
81
|
+
}), lines.map((line) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("br", {}), line] }, line))]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function EmailUnsubscribe({ unsubscribeUrl, preferencesUrl, unsubscribeLabel = "Unsubscribe", preferencesLabel = "Manage preferences" }) {
|
|
85
|
+
const unsubscribe = {
|
|
86
|
+
label: unsubscribeLabel,
|
|
87
|
+
href: unsubscribeUrl
|
|
88
|
+
};
|
|
89
|
+
return /* @__PURE__ */ jsx(EmailCaption, {
|
|
90
|
+
className: "mb-2",
|
|
91
|
+
children: separatedLinks(preferencesUrl ? [unsubscribe, {
|
|
92
|
+
label: preferencesLabel,
|
|
93
|
+
href: preferencesUrl
|
|
94
|
+
}] : [unsubscribe])
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
export { EmailAddress, EmailFooter, EmailFooterLegal, EmailFooterLinks, EmailSocialLinks, EmailUnsubscribe, emailSocialPlatformNames };
|
package/dist/email/email.d.ts
CHANGED
|
@@ -1,28 +1,76 @@
|
|
|
1
1
|
import { EmailTheme } from "./theme.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import { ButtonProps, HeadingProps, LinkProps, TextProps } from "react-email";
|
|
3
|
+
import { ButtonProps, HeadingProps, HrProps, LinkProps, SectionProps, TextProps } from "react-email";
|
|
4
4
|
//#region src/email/email.d.ts
|
|
5
|
-
|
|
5
|
+
export type EmailVariant = "contained" | "plain";
|
|
6
|
+
export type EmailFooterPlacement = "inside" | "outside";
|
|
7
|
+
export declare function surfaceColors(theme: EmailTheme, variant: EmailVariant): Record<"background" | "border" | "card" | "card-foreground" | "foreground" | "muted" | "muted-foreground" | "primary" | "primary-foreground" | "primary-text", string>;
|
|
8
|
+
export declare function EmailLayout({ theme, preview, children, footer, footerPlacement, head, lang, dir, variant }: {
|
|
6
9
|
theme: EmailTheme;
|
|
7
10
|
preview: string;
|
|
8
11
|
children: ReactNode;
|
|
12
|
+
footer?: ReactNode;
|
|
13
|
+
footerPlacement?: EmailFooterPlacement;
|
|
9
14
|
head?: ReactNode;
|
|
10
15
|
lang?: string;
|
|
11
16
|
dir?: "ltr" | "rtl";
|
|
17
|
+
variant?: EmailVariant;
|
|
12
18
|
}): import("react").JSX.Element;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
export type EmailAlign = "left" | "center" | "right";
|
|
20
|
+
declare const headingSizeClasses: {
|
|
21
|
+
display: string;
|
|
22
|
+
"heading-1": string;
|
|
23
|
+
"heading-2": string;
|
|
24
|
+
"heading-3": string;
|
|
25
|
+
"heading-4": string;
|
|
18
26
|
};
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
type EmailHeadingSize = keyof typeof headingSizeClasses;
|
|
28
|
+
declare const headingSizeForTag: {
|
|
29
|
+
readonly h1: "heading-1";
|
|
30
|
+
readonly h2: "heading-2";
|
|
31
|
+
readonly h3: "heading-3";
|
|
32
|
+
readonly h4: "heading-4";
|
|
33
|
+
};
|
|
34
|
+
export declare function EmailHeading({ as, size, align, className, ...props }: Omit<HeadingProps, "as"> & {
|
|
35
|
+
as?: keyof typeof headingSizeForTag;
|
|
36
|
+
size?: EmailHeadingSize;
|
|
37
|
+
align?: EmailAlign;
|
|
38
|
+
}): import("react").JSX.Element;
|
|
39
|
+
export declare function EmailSection({ align, className, ...props }: SectionProps & {
|
|
40
|
+
align?: EmailAlign;
|
|
21
41
|
}): import("react").JSX.Element;
|
|
22
|
-
declare function EmailText({ tone, className, style, ...props }: TextProps & {
|
|
42
|
+
export declare function EmailText({ tone, align, className, style, ...props }: TextProps & {
|
|
23
43
|
tone?: "default" | "muted";
|
|
44
|
+
align?: EmailAlign;
|
|
45
|
+
}): import("react").JSX.Element;
|
|
46
|
+
export declare function EmailButton({ width, className, ...props }: ButtonProps & {
|
|
47
|
+
width?: "auto" | "full";
|
|
48
|
+
}): import("react").JSX.Element;
|
|
49
|
+
export declare function EmailLink({ className, ...props }: LinkProps): import("react").JSX.Element;
|
|
50
|
+
export declare function EmailCaption({ className, ...props }: TextProps & {
|
|
51
|
+
align?: EmailAlign;
|
|
52
|
+
}): import("react").JSX.Element;
|
|
53
|
+
export declare function EmailMutedLink({ className, ...props }: LinkProps): import("react").JSX.Element;
|
|
54
|
+
export declare function EmailDivider({ className, ...props }: HrProps): import("react").JSX.Element;
|
|
55
|
+
export declare function EmailPanel({ className, ...props }: SectionProps): import("react").JSX.Element;
|
|
56
|
+
export declare function EmailOneTimeCode({ children, className }: {
|
|
57
|
+
children: ReactNode;
|
|
58
|
+
className?: string;
|
|
59
|
+
}): import("react").JSX.Element;
|
|
60
|
+
export declare function EmailBulletList({ items, className }: {
|
|
61
|
+
items: ReactNode[];
|
|
62
|
+
className?: string;
|
|
63
|
+
}): import("react").JSX.Element | null;
|
|
64
|
+
export declare function EmailColumns({ children, widths, gap, verticalAlign, className }: {
|
|
65
|
+
children: ReactNode[];
|
|
66
|
+
widths?: string[];
|
|
67
|
+
gap?: number;
|
|
68
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
69
|
+
className?: string;
|
|
70
|
+
}): import("react").JSX.Element | null;
|
|
71
|
+
export declare function EmailDetailRow({ label, value, emphasis }: {
|
|
72
|
+
label: ReactNode;
|
|
73
|
+
value: ReactNode;
|
|
74
|
+
emphasis?: boolean;
|
|
24
75
|
}): import("react").JSX.Element;
|
|
25
|
-
|
|
26
|
-
declare function EmailLink({ className, ...props }: LinkProps): import("react").JSX.Element;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { EmailButton, EmailHeading, EmailLayout, EmailLink, EmailText };
|
|
76
|
+
//#endregion
|