@gyramais/gyra-design 0.2.2 β 0.2.22
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/dist/components/AiParecer/index.js +1 -1
- package/dist/components/AiParecer/index.js.map +1 -1
- package/dist/components/Email/Email.d.ts +3 -2
- package/dist/components/Email/index.js +1 -1
- package/dist/components/Email/index.js.map +1 -1
- package/dist/components/Filter/index.js +6 -6
- package/dist/components/Filter/index.js.map +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/MultiSelectPicker/MultiSelectPicker.d.ts +0 -3
- package/dist/components/MultiSelectPicker/index.js +1 -1
- package/dist/components/MultiSelectPicker/index.js.map +1 -1
- package/dist/components/RichInput/index.js +3 -3
- package/dist/components/RichInput/index.js.map +1 -1
- package/dist/components/SelectTree/index.js +1 -1
- package/dist/components/SelectTree/index.js.map +1 -1
- package/dist/components/TourGuide/TourGuide.d.ts +39 -0
- package/dist/components/TourGuide/index.d.ts +1 -0
- package/dist/components/TourGuide/index.js +7 -0
- package/dist/components/TourGuide/index.js.map +1 -0
- package/dist/emails/balance-sheet-finalized/components/AiParecer/AiParecer.d.ts +75 -0
- package/dist/emails/balance-sheet-finalized/components/AiParecer/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Avatar/Avatar.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/Avatar/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Brasil/Brasil.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/Brasil/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Button/Button.d.ts +19 -0
- package/dist/emails/balance-sheet-finalized/components/Button/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Card/Card.d.ts +27 -0
- package/dist/emails/balance-sheet-finalized/components/Card/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Chart/Chart.d.ts +43 -0
- package/dist/emails/balance-sheet-finalized/components/Chart/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/ChatWidget/ChatMessageBubble.d.ts +7 -0
- package/dist/emails/balance-sheet-finalized/components/ChatWidget/ChatWidget.d.ts +30 -0
- package/dist/emails/balance-sheet-finalized/components/ChatWidget/index.d.ts +3 -0
- package/dist/emails/balance-sheet-finalized/components/ChatWidget/types.d.ts +18 -0
- package/dist/emails/balance-sheet-finalized/components/Checkbox/Checkbox.d.ts +12 -0
- package/dist/emails/balance-sheet-finalized/components/Checkbox/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Col/Col.d.ts +17 -0
- package/dist/emails/balance-sheet-finalized/components/Col/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Collapse/Collapse.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/Collapse/CollapseIcon.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/Collapse/index.d.ts +2 -0
- package/dist/emails/balance-sheet-finalized/components/ContextMenu/ContextMenu.d.ts +45 -0
- package/dist/emails/balance-sheet-finalized/components/ContextMenu/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/DistributionBar/DistributionBar.d.ts +28 -0
- package/dist/emails/balance-sheet-finalized/components/DistributionBar/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Divider/Divider.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/Divider/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Drawer/Drawer.d.ts +16 -0
- package/dist/emails/balance-sheet-finalized/components/Drawer/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/DropdownMenu/DropdownMenu.d.ts +21 -0
- package/dist/emails/balance-sheet-finalized/components/DropdownMenu/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Email/Email.d.ts +26 -0
- package/dist/emails/balance-sheet-finalized/components/Email/index.d.ts +2 -0
- package/dist/emails/balance-sheet-finalized/components/Empty/Empty.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/Empty/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Filter/Filter.d.ts +21 -0
- package/dist/emails/balance-sheet-finalized/components/Filter/MultipleFilter.d.ts +27 -0
- package/dist/emails/balance-sheet-finalized/components/Filter/UniqueFilter.d.ts +27 -0
- package/dist/emails/balance-sheet-finalized/components/Filter/index.d.ts +3 -0
- package/dist/emails/balance-sheet-finalized/components/FloatingCard/FloatingCard.d.ts +12 -0
- package/dist/emails/balance-sheet-finalized/components/FloatingCard/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Form/Form.d.ts +3 -0
- package/dist/emails/balance-sheet-finalized/components/Form/Item.d.ts +11 -0
- package/dist/emails/balance-sheet-finalized/components/Form/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/HoverCard/HoverCard.d.ts +14 -0
- package/dist/emails/balance-sheet-finalized/components/HoverCard/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Icon/Icon.d.ts +11 -0
- package/dist/emails/balance-sheet-finalized/components/Icon/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/IconDisplay/IconDisplay.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/IconDisplay/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Information/Information.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/Information/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Input/Input.d.ts +55 -0
- package/dist/emails/balance-sheet-finalized/components/Input/Mention.d.ts +5 -0
- package/dist/emails/balance-sheet-finalized/components/Input/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Label/Label.d.ts +5 -0
- package/dist/emails/balance-sheet-finalized/components/Label/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Layout/Content.d.ts +9 -0
- package/dist/emails/balance-sheet-finalized/components/Layout/Footer.d.ts +9 -0
- package/dist/emails/balance-sheet-finalized/components/Layout/Header.d.ts +9 -0
- package/dist/emails/balance-sheet-finalized/components/Layout/Layout.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/Layout/Sider.d.ts +9 -0
- package/dist/emails/balance-sheet-finalized/components/Layout/index.d.ts +5 -0
- package/dist/emails/balance-sheet-finalized/components/List/List.d.ts +18 -0
- package/dist/emails/balance-sheet-finalized/components/List/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Loading/Loading.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/Loading/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Logo/Logo.d.ts +12 -0
- package/dist/emails/balance-sheet-finalized/components/Logo/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Menubar/Menubar.d.ts +24 -0
- package/dist/emails/balance-sheet-finalized/components/Menubar/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Modal/Modal.d.ts +25 -0
- package/dist/emails/balance-sheet-finalized/components/Modal/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/MultiSelectPicker/MultiSelectPicker.d.ts +42 -0
- package/dist/emails/balance-sheet-finalized/components/MultiSelectPicker/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/OperatorPicker/OperatorPicker.d.ts +26 -0
- package/dist/emails/balance-sheet-finalized/components/OperatorPicker/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/PickerPopover/PickerPopover.d.ts +56 -0
- package/dist/emails/balance-sheet-finalized/components/PickerPopover/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Popover/Popover.d.ts +16 -0
- package/dist/emails/balance-sheet-finalized/components/Popover/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/ProcessingChip/ProcessingChip.d.ts +20 -0
- package/dist/emails/balance-sheet-finalized/components/ProcessingChip/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Progress/Progress.d.ts +9 -0
- package/dist/emails/balance-sheet-finalized/components/Progress/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/RadioGroup/RadioGroup.d.ts +18 -0
- package/dist/emails/balance-sheet-finalized/components/RadioGroup/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/RichInput/RichInput.d.ts +15 -0
- package/dist/emails/balance-sheet-finalized/components/RichInput/images.d.ts +9 -0
- package/dist/emails/balance-sheet-finalized/components/RichInput/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Row/Row.d.ts +18 -0
- package/dist/emails/balance-sheet-finalized/components/Row/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/RuleSearchPicker/RuleSearchPicker.d.ts +46 -0
- package/dist/emails/balance-sheet-finalized/components/RuleSearchPicker/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/ScoreBar/ScoreBar.d.ts +30 -0
- package/dist/emails/balance-sheet-finalized/components/ScoreBar/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/SegmentedPicker/SegmentedPicker.d.ts +27 -0
- package/dist/emails/balance-sheet-finalized/components/SegmentedPicker/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/SegmentedToggle/SegmentedToggle.d.ts +25 -0
- package/dist/emails/balance-sheet-finalized/components/SegmentedToggle/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Select/Select.d.ts +27 -0
- package/dist/emails/balance-sheet-finalized/components/Select/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/SelectTree/SelectTree.d.ts +35 -0
- package/dist/emails/balance-sheet-finalized/components/SelectTree/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Selector/Selector.d.ts +27 -0
- package/dist/emails/balance-sheet-finalized/components/Selector/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/StatusTag/StatusTag.d.ts +16 -0
- package/dist/emails/balance-sheet-finalized/components/StatusTag/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Stepper/Stepper.d.ts +15 -0
- package/dist/emails/balance-sheet-finalized/components/Stepper/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Switch/Switch.d.ts +11 -0
- package/dist/emails/balance-sheet-finalized/components/Switch/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/SyncChip/SyncChip.d.ts +17 -0
- package/dist/emails/balance-sheet-finalized/components/SyncChip/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Table/Table.d.ts +29 -0
- package/dist/emails/balance-sheet-finalized/components/Table/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Tabs/Tabs.d.ts +20 -0
- package/dist/emails/balance-sheet-finalized/components/Tabs/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Tag/Tag.d.ts +10 -0
- package/dist/emails/balance-sheet-finalized/components/Tag/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Toast/Toast.d.ts +4 -0
- package/dist/emails/balance-sheet-finalized/components/Toast/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Tooltip/Tooltip.d.ts +16 -0
- package/dist/emails/balance-sheet-finalized/components/Tooltip/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/TourGuide/TourGuide.d.ts +39 -0
- package/dist/emails/balance-sheet-finalized/components/TourGuide/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/components/Waypoint/Waypoint.d.ts +7 -0
- package/dist/emails/balance-sheet-finalized/components/Waypoint/index.d.ts +1 -0
- package/dist/emails/balance-sheet-finalized/emails/balance-sheet-finalized/index.d.ts +33 -0
- package/dist/emails/balance-sheet-finalized/emails/email/index.d.ts +94 -0
- package/dist/emails/balance-sheet-finalized/index.d.ts +62 -33
- package/dist/emails/balance-sheet-finalized/index.esm.js +1 -1
- package/dist/emails/balance-sheet-finalized/index.esm.js.map +1 -1
- package/dist/emails/balance-sheet-finalized/index.js +1 -1
- package/dist/emails/balance-sheet-finalized/index.js.map +1 -1
- package/dist/emails/balance-sheet-finalized/shadcn/checkbox.d.ts +4 -0
- package/dist/emails/balance-sheet-finalized/shadcn/form.d.ts +23 -0
- package/dist/emails/balance-sheet-finalized/shadcn/hover-card.d.ts +6 -0
- package/dist/emails/balance-sheet-finalized/shadcn/label.d.ts +5 -0
- package/dist/emails/balance-sheet-finalized/shadcn/lib/utils.d.ts +2 -0
- package/dist/emails/balance-sheet-finalized/shadcn/menubar.d.ts +33 -0
- package/dist/emails/balance-sheet-finalized/shadcn/popover.d.ts +6 -0
- package/dist/emails/balance-sheet-finalized/shadcn/radio-group.d.ts +5 -0
- package/dist/emails/balance-sheet-finalized/shadcn/switch.d.ts +4 -0
- package/dist/emails/balance-sheet-finalized/shadcn/tabs.d.ts +7 -0
- package/dist/emails/balance-sheet-finalized/shadcn/tooltip.d.ts +7 -0
- package/dist/emails/balance-sheet-finalized/theme.d.ts +20 -0
- package/dist/emails/email/components/AiParecer/AiParecer.d.ts +75 -0
- package/dist/emails/email/components/AiParecer/index.d.ts +1 -0
- package/dist/emails/email/components/Avatar/Avatar.d.ts +10 -0
- package/dist/emails/email/components/Avatar/index.d.ts +1 -0
- package/dist/emails/email/components/Brasil/Brasil.d.ts +10 -0
- package/dist/emails/email/components/Brasil/index.d.ts +1 -0
- package/dist/emails/email/components/Button/Button.d.ts +19 -0
- package/dist/emails/email/components/Button/index.d.ts +1 -0
- package/dist/emails/email/components/Card/Card.d.ts +27 -0
- package/dist/emails/email/components/Card/index.d.ts +1 -0
- package/dist/emails/email/components/Chart/Chart.d.ts +43 -0
- package/dist/emails/email/components/Chart/index.d.ts +1 -0
- package/dist/emails/email/components/ChatWidget/ChatMessageBubble.d.ts +7 -0
- package/dist/emails/email/components/ChatWidget/ChatWidget.d.ts +30 -0
- package/dist/emails/email/components/ChatWidget/index.d.ts +3 -0
- package/dist/emails/email/components/ChatWidget/types.d.ts +18 -0
- package/dist/emails/email/components/Checkbox/Checkbox.d.ts +12 -0
- package/dist/emails/email/components/Checkbox/index.d.ts +1 -0
- package/dist/emails/email/components/Col/Col.d.ts +17 -0
- package/dist/emails/email/components/Col/index.d.ts +1 -0
- package/dist/emails/email/components/Collapse/Collapse.d.ts +10 -0
- package/dist/emails/email/components/Collapse/CollapseIcon.d.ts +10 -0
- package/dist/emails/email/components/Collapse/index.d.ts +2 -0
- package/dist/emails/email/components/ContextMenu/ContextMenu.d.ts +45 -0
- package/dist/emails/email/components/ContextMenu/index.d.ts +1 -0
- package/dist/emails/email/components/DistributionBar/DistributionBar.d.ts +28 -0
- package/dist/emails/email/components/DistributionBar/index.d.ts +1 -0
- package/dist/emails/email/components/Divider/Divider.d.ts +10 -0
- package/dist/emails/email/components/Divider/index.d.ts +1 -0
- package/dist/emails/email/components/Drawer/Drawer.d.ts +16 -0
- package/dist/emails/email/components/Drawer/index.d.ts +1 -0
- package/dist/emails/email/components/DropdownMenu/DropdownMenu.d.ts +21 -0
- package/dist/emails/email/components/DropdownMenu/index.d.ts +1 -0
- package/dist/emails/email/components/Email/Email.d.ts +26 -0
- package/dist/emails/email/components/Email/index.d.ts +2 -0
- package/dist/emails/email/components/Empty/Empty.d.ts +10 -0
- package/dist/emails/email/components/Empty/index.d.ts +1 -0
- package/dist/emails/email/components/Filter/Filter.d.ts +21 -0
- package/dist/emails/email/components/Filter/MultipleFilter.d.ts +27 -0
- package/dist/emails/email/components/Filter/UniqueFilter.d.ts +27 -0
- package/dist/emails/email/components/Filter/index.d.ts +3 -0
- package/dist/emails/email/components/FloatingCard/FloatingCard.d.ts +12 -0
- package/dist/emails/email/components/FloatingCard/index.d.ts +1 -0
- package/dist/emails/email/components/Form/Form.d.ts +3 -0
- package/dist/emails/email/components/Form/Item.d.ts +11 -0
- package/dist/emails/email/components/Form/index.d.ts +1 -0
- package/dist/emails/email/components/HoverCard/HoverCard.d.ts +14 -0
- package/dist/emails/email/components/HoverCard/index.d.ts +1 -0
- package/dist/emails/email/components/Icon/Icon.d.ts +11 -0
- package/dist/emails/email/components/Icon/index.d.ts +1 -0
- package/dist/emails/email/components/IconDisplay/IconDisplay.d.ts +10 -0
- package/dist/emails/email/components/IconDisplay/index.d.ts +1 -0
- package/dist/emails/email/components/Information/Information.d.ts +10 -0
- package/dist/emails/email/components/Information/index.d.ts +1 -0
- package/dist/emails/email/components/Input/Input.d.ts +55 -0
- package/dist/emails/email/components/Input/Mention.d.ts +5 -0
- package/dist/emails/email/components/Input/index.d.ts +1 -0
- package/dist/emails/email/components/Label/Label.d.ts +5 -0
- package/dist/emails/email/components/Label/index.d.ts +1 -0
- package/dist/emails/email/components/Layout/Content.d.ts +9 -0
- package/dist/emails/email/components/Layout/Footer.d.ts +9 -0
- package/dist/emails/email/components/Layout/Header.d.ts +9 -0
- package/dist/emails/email/components/Layout/Layout.d.ts +10 -0
- package/dist/emails/email/components/Layout/Sider.d.ts +9 -0
- package/dist/emails/email/components/Layout/index.d.ts +5 -0
- package/dist/emails/email/components/List/List.d.ts +18 -0
- package/dist/emails/email/components/List/index.d.ts +1 -0
- package/dist/emails/email/components/Loading/Loading.d.ts +10 -0
- package/dist/emails/email/components/Loading/index.d.ts +1 -0
- package/dist/emails/email/components/Logo/Logo.d.ts +12 -0
- package/dist/emails/email/components/Logo/index.d.ts +1 -0
- package/dist/emails/email/components/Menubar/Menubar.d.ts +24 -0
- package/dist/emails/email/components/Menubar/index.d.ts +1 -0
- package/dist/emails/email/components/Modal/Modal.d.ts +25 -0
- package/dist/emails/email/components/Modal/index.d.ts +1 -0
- package/dist/emails/email/components/MultiSelectPicker/MultiSelectPicker.d.ts +42 -0
- package/dist/emails/email/components/MultiSelectPicker/index.d.ts +1 -0
- package/dist/emails/email/components/OperatorPicker/OperatorPicker.d.ts +26 -0
- package/dist/emails/email/components/OperatorPicker/index.d.ts +1 -0
- package/dist/emails/email/components/PickerPopover/PickerPopover.d.ts +56 -0
- package/dist/emails/email/components/PickerPopover/index.d.ts +1 -0
- package/dist/emails/email/components/Popover/Popover.d.ts +16 -0
- package/dist/emails/email/components/Popover/index.d.ts +1 -0
- package/dist/emails/email/components/ProcessingChip/ProcessingChip.d.ts +20 -0
- package/dist/emails/email/components/ProcessingChip/index.d.ts +1 -0
- package/dist/emails/email/components/Progress/Progress.d.ts +9 -0
- package/dist/emails/email/components/Progress/index.d.ts +1 -0
- package/dist/emails/email/components/RadioGroup/RadioGroup.d.ts +18 -0
- package/dist/emails/email/components/RadioGroup/index.d.ts +1 -0
- package/dist/emails/email/components/RichInput/RichInput.d.ts +15 -0
- package/dist/emails/email/components/RichInput/images.d.ts +9 -0
- package/dist/emails/email/components/RichInput/index.d.ts +1 -0
- package/dist/emails/email/components/Row/Row.d.ts +18 -0
- package/dist/emails/email/components/Row/index.d.ts +1 -0
- package/dist/emails/email/components/RuleSearchPicker/RuleSearchPicker.d.ts +46 -0
- package/dist/emails/email/components/RuleSearchPicker/index.d.ts +1 -0
- package/dist/emails/email/components/ScoreBar/ScoreBar.d.ts +30 -0
- package/dist/emails/email/components/ScoreBar/index.d.ts +1 -0
- package/dist/emails/email/components/SegmentedPicker/SegmentedPicker.d.ts +27 -0
- package/dist/emails/email/components/SegmentedPicker/index.d.ts +1 -0
- package/dist/emails/email/components/SegmentedToggle/SegmentedToggle.d.ts +25 -0
- package/dist/emails/email/components/SegmentedToggle/index.d.ts +1 -0
- package/dist/emails/email/components/Select/Select.d.ts +27 -0
- package/dist/emails/email/components/Select/index.d.ts +1 -0
- package/dist/emails/email/components/SelectTree/SelectTree.d.ts +35 -0
- package/dist/emails/email/components/SelectTree/index.d.ts +1 -0
- package/dist/emails/email/components/Selector/Selector.d.ts +27 -0
- package/dist/emails/email/components/Selector/index.d.ts +1 -0
- package/dist/emails/email/components/StatusTag/StatusTag.d.ts +16 -0
- package/dist/emails/email/components/StatusTag/index.d.ts +1 -0
- package/dist/emails/email/components/Stepper/Stepper.d.ts +15 -0
- package/dist/emails/email/components/Stepper/index.d.ts +1 -0
- package/dist/emails/email/components/Switch/Switch.d.ts +11 -0
- package/dist/emails/email/components/Switch/index.d.ts +1 -0
- package/dist/emails/email/components/SyncChip/SyncChip.d.ts +17 -0
- package/dist/emails/email/components/SyncChip/index.d.ts +1 -0
- package/dist/emails/email/components/Table/Table.d.ts +29 -0
- package/dist/emails/email/components/Table/index.d.ts +1 -0
- package/dist/emails/email/components/Tabs/Tabs.d.ts +20 -0
- package/dist/emails/email/components/Tabs/index.d.ts +1 -0
- package/dist/emails/email/components/Tag/Tag.d.ts +10 -0
- package/dist/emails/email/components/Tag/index.d.ts +1 -0
- package/dist/emails/email/components/Toast/Toast.d.ts +4 -0
- package/dist/emails/email/components/Toast/index.d.ts +1 -0
- package/dist/emails/email/components/Tooltip/Tooltip.d.ts +16 -0
- package/dist/emails/email/components/Tooltip/index.d.ts +1 -0
- package/dist/emails/email/components/TourGuide/TourGuide.d.ts +39 -0
- package/dist/emails/email/components/TourGuide/index.d.ts +1 -0
- package/dist/emails/email/components/Waypoint/Waypoint.d.ts +7 -0
- package/dist/emails/email/components/Waypoint/index.d.ts +1 -0
- package/dist/emails/email/emails/balance-sheet-finalized/index.d.ts +33 -0
- package/dist/emails/email/emails/email/index.d.ts +94 -0
- package/dist/emails/email/index.d.ts +62 -94
- package/dist/emails/email/index.esm.js +1 -1
- package/dist/emails/email/index.esm.js.map +1 -1
- package/dist/emails/email/index.js +1 -1
- package/dist/emails/email/index.js.map +1 -1
- package/dist/emails/email/shadcn/checkbox.d.ts +4 -0
- package/dist/emails/email/shadcn/form.d.ts +23 -0
- package/dist/emails/email/shadcn/hover-card.d.ts +6 -0
- package/dist/emails/email/shadcn/label.d.ts +5 -0
- package/dist/emails/email/shadcn/lib/utils.d.ts +2 -0
- package/dist/emails/email/shadcn/menubar.d.ts +33 -0
- package/dist/emails/email/shadcn/popover.d.ts +6 -0
- package/dist/emails/email/shadcn/radio-group.d.ts +5 -0
- package/dist/emails/email/shadcn/switch.d.ts +4 -0
- package/dist/emails/email/shadcn/tabs.d.ts +7 -0
- package/dist/emails/email/shadcn/tooltip.d.ts +7 -0
- package/dist/emails/email/theme.d.ts +20 -0
- package/dist/index.css +176 -16
- package/package.json +1 -1
- package/dist/components/EmailBalanceSheetFinalized/EmailBalanceSheetFinalized.d.ts +0 -18
- package/dist/components/EmailBalanceSheetFinalized/index.d.ts +0 -2
- package/dist/components/EmailBalanceSheetFinalized/index.js +0 -2
- package/dist/components/EmailBalanceSheetFinalized/index.js.map +0 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email transacional genΓ©rico β Gyra+ design system.
|
|
3
|
+
*
|
|
4
|
+
* **FONTE DA VERDADE** dos layouts de email transacional. Usado por
|
|
5
|
+
* qualquer fluxo que precise mandar email no padrΓ£o visual Gyra+:
|
|
6
|
+
* - reset de senha, confirmaΓ§Γ£o de cadastro, alertas internos
|
|
7
|
+
* - finalizaΓ§Γ£o de processamento (Finsights, batch-report, etc)
|
|
8
|
+
* - notificaΓ§Γ΅es de operaΓ§Γ£o/crΓ©dito
|
|
9
|
+
* - convites, mudanΓ§a de plano, alerts de billing...
|
|
10
|
+
*
|
|
11
|
+
* **TS puro**: sem React, sem DOM, sem browser globals. Apenas funΓ§Γ΅es que
|
|
12
|
+
* retornam string HTML. Funciona igual em qualquer runtime Node (Nest) ou
|
|
13
|
+
* bundle browser (Next).
|
|
14
|
+
*
|
|
15
|
+
* **Email-safe**: tabelas + inline-style (clients ignoram <style> externo,
|
|
16
|
+
* flexbox e Material Symbols). Gradientes tΓͺm fallback sΓ³lido.
|
|
17
|
+
*
|
|
18
|
+
* Tokens visuais alinhados com gyra-design: azul #1256FF (acao/primary),
|
|
19
|
+
* roxo #7C4EFF (IA/parecer), neutrals Apple-gray, fonte Inter.
|
|
20
|
+
*
|
|
21
|
+
* **Como usar:**
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { buildEmail } from '@gyramais/gyra-design/dist/emails/email';
|
|
24
|
+
*
|
|
25
|
+
* const html = buildEmail({
|
|
26
|
+
* preheader: 'Senha redefinida com sucesso',
|
|
27
|
+
* greeting: 'OlΓ‘, Maria',
|
|
28
|
+
* title: 'Sua senha foi redefinida',
|
|
29
|
+
* paragraphs: ['Tudo certo. VocΓͺ jΓ‘ pode entrar com a nova senha.'],
|
|
30
|
+
* buttons: [{ label: 'Entrar', url: 'https://app.gyramais.com/login' }],
|
|
31
|
+
* footerNote: 'Se nΓ£o foi vocΓͺ, redefina novamente clicando em "Esqueci minha senha".',
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* Pra emails recorrentes (mesmo conteudo, payload variavel), criar um
|
|
36
|
+
* **preset** em `src/emails/<preset-name>/index.ts` que monta o
|
|
37
|
+
* `EmailLayoutInput` a partir de campos de dominio e delega aqui. Ver
|
|
38
|
+
* `balance-sheet-finalized` como exemplo.
|
|
39
|
+
*/
|
|
40
|
+
export type EmailButton = {
|
|
41
|
+
label: string;
|
|
42
|
+
url: string;
|
|
43
|
+
/** primary = botΓ£o azul preenchido, secondary = outline. Default primary. */
|
|
44
|
+
variant?: 'primary' | 'secondary';
|
|
45
|
+
};
|
|
46
|
+
export type EmailHighlight = {
|
|
47
|
+
/** label pequeno em cima (ex: "Score", "Nivel de risco"). */
|
|
48
|
+
label: string;
|
|
49
|
+
/** valor grande em baixo (ex: "820", "Baixo"). */
|
|
50
|
+
value: string;
|
|
51
|
+
/** cor do valor (ex: cor do risco). Default: tinta padrao Apple-gray. */
|
|
52
|
+
color?: string;
|
|
53
|
+
};
|
|
54
|
+
/** Tom semantico do chip de veredito do bloco Parecer GYRA+IA. */
|
|
55
|
+
export type AiParecerTone = 'ok' | 'warn' | 'danger' | 'info';
|
|
56
|
+
export type EmailAiParecer = {
|
|
57
|
+
/** chip de veredito (ex: "MΓ©dio", "Consistente"). Opcional. */
|
|
58
|
+
verdict?: string;
|
|
59
|
+
verdictTone?: AiParecerTone;
|
|
60
|
+
/** corpo do parecer. */
|
|
61
|
+
text: string;
|
|
62
|
+
/** rodape do bloco (ex: "GYRA+IA Β· ConfianΓ§a 96%"). Opcional. */
|
|
63
|
+
footer?: string;
|
|
64
|
+
};
|
|
65
|
+
export type EmailLayoutInput = {
|
|
66
|
+
/** Texto invisivel no preheader (preview no inbox). */
|
|
67
|
+
preheader?: string;
|
|
68
|
+
/** Linha curta acima do titulo (ex: "OlΓ‘, Maria"). */
|
|
69
|
+
greeting?: string;
|
|
70
|
+
/** Titulo principal (H1). */
|
|
71
|
+
title: string;
|
|
72
|
+
/** Paragrafos de corpo (sub-frases). */
|
|
73
|
+
paragraphs?: string[];
|
|
74
|
+
/** Cards lado-a-lado (1 a N). Largura dividida igualmente. */
|
|
75
|
+
highlights?: EmailHighlight[];
|
|
76
|
+
/** Bloco "Parecer GYRA+IA" (faixa roxa com chip + texto + rodape). */
|
|
77
|
+
aiParecer?: EmailAiParecer;
|
|
78
|
+
/** Botoes de acao. Multiplos viram lado-a-lado. */
|
|
79
|
+
buttons?: EmailButton[];
|
|
80
|
+
/** Texto pequeno no rodape do card (disclaimer, instrucoes extras). */
|
|
81
|
+
footerNote?: string;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Monta o HTML completo de um email no padrΓ£o Gyra+: logo no topo, card
|
|
85
|
+
* principal com greeting + tΓtulo + parΓ‘grafos + highlights (chips lado a
|
|
86
|
+
* lado) + bloco "Parecer GYRA+IA" + botΓ΅es, e rodapΓ© padrΓ£o.
|
|
87
|
+
*
|
|
88
|
+
* Email-safe (tabelas + inline-style, sem flexbox, sem <style>). Funciona
|
|
89
|
+
* em Gmail, Outlook (Windows/Web/Mac), Apple Mail, Thunderbird, mobile.
|
|
90
|
+
*
|
|
91
|
+
* Todas as seΓ§Γ΅es (greeting, paragraphs, highlights, aiParecer, buttons,
|
|
92
|
+
* footerNote) sΓ£o **opcionais** β sΓ³ `title` Γ© obrigatΓ³rio.
|
|
93
|
+
*/
|
|
94
|
+
export declare function buildEmail(input: EmailLayoutInput): string;
|
|
@@ -1,94 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
footer?: string;
|
|
64
|
-
};
|
|
65
|
-
export type EmailLayoutInput = {
|
|
66
|
-
/** Texto invisivel no preheader (preview no inbox). */
|
|
67
|
-
preheader?: string;
|
|
68
|
-
/** Linha curta acima do titulo (ex: "OlΓ‘, Maria"). */
|
|
69
|
-
greeting?: string;
|
|
70
|
-
/** Titulo principal (H1). */
|
|
71
|
-
title: string;
|
|
72
|
-
/** Paragrafos de corpo (sub-frases). */
|
|
73
|
-
paragraphs?: string[];
|
|
74
|
-
/** Cards lado-a-lado (1 a N). Largura dividida igualmente. */
|
|
75
|
-
highlights?: EmailHighlight[];
|
|
76
|
-
/** Bloco "Parecer GYRA+IA" (faixa roxa com chip + texto + rodape). */
|
|
77
|
-
aiParecer?: EmailAiParecer;
|
|
78
|
-
/** Botoes de acao. Multiplos viram lado-a-lado. */
|
|
79
|
-
buttons?: EmailButton[];
|
|
80
|
-
/** Texto pequeno no rodape do card (disclaimer, instrucoes extras). */
|
|
81
|
-
footerNote?: string;
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Monta o HTML completo de um email no padrΓ£o Gyra+: logo no topo, card
|
|
85
|
-
* principal com greeting + tΓtulo + parΓ‘grafos + highlights (chips lado a
|
|
86
|
-
* lado) + bloco "Parecer GYRA+IA" + botΓ΅es, e rodapΓ© padrΓ£o.
|
|
87
|
-
*
|
|
88
|
-
* Email-safe (tabelas + inline-style, sem flexbox, sem <style>). Funciona
|
|
89
|
-
* em Gmail, Outlook (Windows/Web/Mac), Apple Mail, Thunderbird, mobile.
|
|
90
|
-
*
|
|
91
|
-
* Todas as seΓ§Γ΅es (greeting, paragraphs, highlights, aiParecer, buttons,
|
|
92
|
-
* footerNote) sΓ£o **opcionais** β sΓ³ `title` Γ© obrigatΓ³rio.
|
|
93
|
-
*/
|
|
94
|
-
export declare function buildEmail(input: EmailLayoutInput): string;
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import "react-toastify/dist/ReactToastify.css";
|
|
3
|
+
import "react-modern-drawer/dist/index.css";
|
|
4
|
+
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
|
|
5
|
+
import "react-datepicker/dist/react-datepicker.css";
|
|
6
|
+
import "react-circular-progressbar/dist/styles.css";
|
|
7
|
+
import "./components/AiParecer/index.css";
|
|
8
|
+
import "./components/Avatar/index.css";
|
|
9
|
+
import "./components/Button/index.css";
|
|
10
|
+
import "./components/Card/index.css";
|
|
11
|
+
import "./components/Chart/index.css";
|
|
12
|
+
import "./components/ChatWidget/index.css";
|
|
13
|
+
import "./components/Checkbox/index.css";
|
|
14
|
+
import "./components/Col/index.css";
|
|
15
|
+
import "./components/Collapse/index.css";
|
|
16
|
+
import "./components/Divider/index.css";
|
|
17
|
+
import "./components/DistributionBar/index.css";
|
|
18
|
+
import "./components/Drawer/index.css";
|
|
19
|
+
import "./components/DropdownMenu/index.css";
|
|
20
|
+
import "./components/Empty/index.css";
|
|
21
|
+
import "./components/Filter/index.css";
|
|
22
|
+
import "./components/FloatingCard/index.css";
|
|
23
|
+
import "./components/Form/index.css";
|
|
24
|
+
import "./components/HoverCard/index.css";
|
|
25
|
+
import "./components/Icon/index.css";
|
|
26
|
+
import "./components/IconDisplay/index.css";
|
|
27
|
+
import "./components/Information/index.css";
|
|
28
|
+
import "./components/Input/index.css";
|
|
29
|
+
import "./components/Layout/index.css";
|
|
30
|
+
import "./components/List/index.css";
|
|
31
|
+
import "./components/Loading/index.css";
|
|
32
|
+
import "./components/Logo/index.css";
|
|
33
|
+
import "./components/Menubar/index.css";
|
|
34
|
+
import "./components/Modal/index.css";
|
|
35
|
+
import "./components/Popover/index.css";
|
|
36
|
+
import "./components/ProcessingChip/index.css";
|
|
37
|
+
import "./components/Progress/index.css";
|
|
38
|
+
import "./components/RadioGroup/index.css";
|
|
39
|
+
import "./components/RichInput/index.css";
|
|
40
|
+
import "./components/Row/index.css";
|
|
41
|
+
import "./components/ScoreBar/index.css";
|
|
42
|
+
import "./components/SegmentedPicker/index.css";
|
|
43
|
+
import "./components/SegmentedToggle/index.css";
|
|
44
|
+
import "./components/Select/index.css";
|
|
45
|
+
import "./components/Selector/index.css";
|
|
46
|
+
import "./components/SelectTree/index.css";
|
|
47
|
+
import "./components/PickerPopover/index.css";
|
|
48
|
+
import "./components/MultiSelectPicker/index.css";
|
|
49
|
+
import "./components/RuleSearchPicker/index.css";
|
|
50
|
+
import "./components/OperatorPicker/index.css";
|
|
51
|
+
import "./components/ContextMenu/index.css";
|
|
52
|
+
import "./components/StatusTag/index.css";
|
|
53
|
+
import "./components/Switch/index.css";
|
|
54
|
+
import "./components/SyncChip/index.css";
|
|
55
|
+
import "./components/Table/index.css";
|
|
56
|
+
import "./components/Tabs/index.css";
|
|
57
|
+
import "./components/Tag/index.css";
|
|
58
|
+
import "./components/Tooltip/index.css";
|
|
59
|
+
import "./components/Stepper/index.css";
|
|
60
|
+
import "./components/TourGuide/index.css";
|
|
61
|
+
import theme from "./theme";
|
|
62
|
+
export default theme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const t="#1256FF",n="#7C4EFF",e="#6635E0",i="#F5F5F7",l="#FFFFFF",r="#1D1D1F",
|
|
1
|
+
const t="#1256FF",n="#7C4EFF",e="#6635E0",i="#F5F5F7",l="#FFFFFF",r="#1D1D1F",a="#636366",o="#8E8E93",p="#D2D2D7",d="#E8E8ED",s="#F6F4FF",g="rgba(124,78,255,0.22)",c={ok:{bg:"#E8F9ED",color:"#1A7D37"},warn:{bg:"#FFF4E0",color:"#946200"},danger:{bg:"#FFEDEC",color:"#C93430"},info:{bg:"#EBF4FF",color:"#0055D4"}},x="'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif",h=t=>String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),f=["http:","https:","mailto:","tel:"];function m(n){const e="primary"===(n.variant??"primary"),i=e?"#FFFFFF":t;return`\n <table role="presentation" cellpadding="0" cellspacing="0" style="margin:8px 8px 0 0;display:inline-block;">\n <tr>\n <td style="border-radius:10px;background:${e?t:l};border:1px solid ${e?t:p};">\n <a href="${h(function(t){try{const n=new URL(String(t));return f.includes(n.protocol)?n.href:"#"}catch{return"#"}}(n.url))}" target="_blank"\n style="display:inline-block;padding:12px 22px;font-family:${x};font-size:14px;font-weight:600;color:${i};text-decoration:none;border-radius:10px;">\n ${h(n.label)}\n </a>\n </td>\n </tr>\n </table>`}function $(t){const{preheader:p,greeting:f,title:$,paragraphs:y=[],highlights:b=[],aiParecer:u,buttons:F=[],footerNote:v}=t,w=b.length?Math.floor(100/b.length):100,E=b.length?`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin:8px 0 4px;"><tr>${b.map(t=>function(t,n){return`\n <td width="${n}%" style="padding:6px;" valign="top">\n <table role="presentation" width="100%" cellpadding="0" cellspacing="0"\n style="background:#FAFAFA;border:1px solid ${d};border-radius:12px;">\n <tr><td style="padding:14px 16px;font-family:${x};">\n <div style="font-size:12px;color:${a};margin-bottom:4px;">${h(t.label)}</div>\n <div style="font-size:22px;font-weight:700;color:${t.color||r};font-family:'Lexend',${x};">${h(t.value)}</div>\n </td></tr>\n </table>\n </td>`}(t,w)).join("")}</tr></table>`:"",k=y.map(t=>`<p style="margin:0 0 14px;font-family:${x};font-size:15px;line-height:1.6;color:${a};">${h(t)}</p>`).join(""),z=F.length?`<div style="margin-top:18px;">${F.map(m).join("")}</div>`:"";return`<!DOCTYPE html>\n<html lang="pt-BR">\n<head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width,initial-scale=1.0" />\n <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n <title>${h($)}</title>\n</head>\n<body style="margin:0;padding:0;background:${i};">\n ${p?`<div style="display:none;max-height:0;overflow:hidden;opacity:0;">${h(p)}</div>`:""}\n <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:${i};padding:24px 0;">\n <tr>\n <td align="center">\n <table role="presentation" width="600" cellpadding="0" cellspacing="0" style="width:600px;max-width:92%;">\n <tr>\n <td style="padding:8px 4px 20px;">\n <img src="https://gyra-file-prod.s3.us-west-2.amazonaws.com/assets/gyra-logo-color.png" alt="GYRA+" height="30" style="height:30px;display:block;" />\n </td>\n </tr>\n <tr>\n <td style="background:${l};border:1px solid ${d};border-radius:16px;padding:32px;">\n ${f?`<p style="margin:0 0 6px;font-family:${x};font-size:14px;color:${a};">${h(f)}</p>`:""}\n <h1 style="margin:0 0 18px;font-family:'Lexend',${x};font-size:23px;line-height:1.3;color:${r};">${h($)}</h1>\n ${k}\n ${E}\n ${u?function(t){const i=t.verdict?(()=>{const n=c[t.verdictTone||"info"];return`<table role="presentation" cellpadding="0" cellspacing="0" style="display:inline-block;"><tr>\n <td style="background:${n.bg};border-radius:999px;padding:4px 10px;font-family:${x};font-size:11px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;color:${n.color};white-space:nowrap;">${h(t.verdict)}</td></tr></table>`})():"";return`\n <table role="presentation" width="100%" cellpadding="0" cellspacing="0"\n style="margin:18px 0 4px;background:${s};border:1px solid ${g};border-radius:12px;">\n <tr><td style="padding:16px 18px;font-family:${x};">\n <table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr>\n <td valign="middle" width="28">\n <div style="width:22px;height:22px;border-radius:50%;background:${n};color:#fff;text-align:center;line-height:22px;font-size:13px;">✦</div>\n </td>\n <td valign="middle" style="padding-left:8px;">\n <span style="font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:${e};">Parecer GYRA+IA</span>\n </td>\n <td valign="middle" align="right">${i}</td>\n </tr></table>\n <p style="margin:10px 0 0;font-size:14px;line-height:1.55;color:${a};">${h(t.text)}</p>\n ${t.footer?`<div style="margin-top:10px;padding-top:10px;border-top:1px dashed ${g};font-size:11px;color:${o};">${h(t.footer)}</div>`:""}\n </td></tr>\n </table>`}(u):""}\n ${z}\n </td>\n </tr>\n <tr>\n <td style="padding:20px 8px;font-family:${x};font-size:12px;line-height:1.5;color:${o};">\n ${v?`<p style="margin:0 0 8px;">${h(v)}</p>`:""}\n <p style="margin:0;">GYRA+ β’ Esta Γ© uma mensagem automΓ‘tica, nΓ£o responda este email.</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n</body>\n</html>`}export{$ as buildEmail};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/emails/email/index.ts"],"sourcesContent":["/**\n * Email transacional genΓ©rico β Gyra+ design system.\n *\n * **FONTE DA VERDADE** dos layouts de email transacional. Usado por\n * qualquer fluxo que precise mandar email no padrΓ£o visual Gyra+:\n * - reset de senha, confirmaΓ§Γ£o de cadastro, alertas internos\n * - finalizaΓ§Γ£o de processamento (Finsights, batch-report, etc)\n * - notificaΓ§Γ΅es de operaΓ§Γ£o/crΓ©dito\n * - convites, mudanΓ§a de plano, alerts de billing...\n *\n * **TS puro**: sem React, sem DOM, sem browser globals. Apenas funΓ§Γ΅es que\n * retornam string HTML. Funciona igual em qualquer runtime Node (Nest) ou\n * bundle browser (Next).\n *\n * **Email-safe**: tabelas + inline-style (clients ignoram <style> externo,\n * flexbox e Material Symbols). Gradientes tΓͺm fallback sΓ³lido.\n *\n * Tokens visuais alinhados com gyra-design: azul #1256FF (acao/primary),\n * roxo #7C4EFF (IA/parecer), neutrals Apple-gray, fonte Inter.\n *\n * **Como usar:**\n * ```ts\n * import { buildEmail } from '@gyramais/gyra-design/dist/emails/email';\n *\n * const html = buildEmail({\n * preheader: 'Senha redefinida com sucesso',\n * greeting: 'OlΓ‘, Maria',\n * title: 'Sua senha foi redefinida',\n * paragraphs: ['Tudo certo. VocΓͺ jΓ‘ pode entrar com a nova senha.'],\n * buttons: [{ label: 'Entrar', url: 'https://app.gyramais.com/login' }],\n * footerNote: 'Se nΓ£o foi vocΓͺ, redefina novamente clicando em \"Esqueci minha senha\".',\n * });\n * ```\n *\n * Pra emails recorrentes (mesmo conteudo, payload variavel), criar um\n * **preset** em `src/emails/<preset-name>/index.ts` que monta o\n * `EmailLayoutInput` a partir de campos de dominio e delega aqui. Ver\n * `balance-sheet-finalized` como exemplo.\n */\n\n// ββ Tipos publicos βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\nexport type EmailButton = {\n label: string;\n url: string;\n /** primary = botΓ£o azul preenchido, secondary = outline. Default primary. */\n variant?: 'primary' | 'secondary';\n};\n\nexport type EmailHighlight = {\n /** label pequeno em cima (ex: \"Score\", \"Nivel de risco\"). */\n label: string;\n /** valor grande em baixo (ex: \"820\", \"Baixo\"). */\n value: string;\n /** cor do valor (ex: cor do risco). Default: tinta padrao Apple-gray. */\n color?: string;\n};\n\n/** Tom semantico do chip de veredito do bloco Parecer GYRA+IA. */\nexport type AiParecerTone = 'ok' | 'warn' | 'danger' | 'info';\n\nexport type EmailAiParecer = {\n /** chip de veredito (ex: \"MΓ©dio\", \"Consistente\"). Opcional. */\n verdict?: string;\n verdictTone?: AiParecerTone;\n /** corpo do parecer. */\n text: string;\n /** rodape do bloco (ex: \"GYRA+IA Β· ConfianΓ§a 96%\"). Opcional. */\n footer?: string;\n};\n\nexport type EmailLayoutInput = {\n /** Texto invisivel no preheader (preview no inbox). */\n preheader?: string;\n /** Linha curta acima do titulo (ex: \"OlΓ‘, Maria\"). */\n greeting?: string;\n /** Titulo principal (H1). */\n title: string;\n /** Paragrafos de corpo (sub-frases). */\n paragraphs?: string[];\n /** Cards lado-a-lado (1 a N). Largura dividida igualmente. */\n highlights?: EmailHighlight[];\n /** Bloco \"Parecer GYRA+IA\" (faixa roxa com chip + texto + rodape). */\n aiParecer?: EmailAiParecer;\n /** Botoes de acao. Multiplos viram lado-a-lado. */\n buttons?: EmailButton[];\n /** Texto pequeno no rodape do card (disclaimer, instrucoes extras). */\n footerNote?: string;\n};\n\n// ββ Tokens (espelho de gyra-design CSS variables, hard-coded pra email) ββββ\n\nconst C = {\n blue: '#1256FF',\n teal: '#1FB58A',\n aiPurple: '#7C4EFF',\n aiPurpleText: '#6635E0',\n bg: '#F5F5F7',\n card: '#FFFFFF',\n fg1: '#1D1D1F',\n fg2: '#636366',\n fg3: '#8E8E93',\n border: '#D2D2D7',\n borderSubtle: '#E8E8ED',\n aiCardBg: '#F6F4FF',\n aiBorder: 'rgba(124,78,255,0.22)',\n};\n\nconst VERDICT: Record<AiParecerTone, { bg: string; color: string }> = {\n ok: { bg: '#E8F9ED', color: '#1A7D37' },\n warn: { bg: '#FFF4E0', color: '#946200' },\n danger: { bg: '#FFEDEC', color: '#C93430' },\n info: { bg: '#EBF4FF', color: '#0055D4' },\n};\n\nconst FONT =\n \"'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif\";\n\nconst LOGO_URL =\n 'https://gyra-file-prod.s3.us-west-2.amazonaws.com/assets/gyra-logo-color.png';\n\n// ββ Helpers internos βββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\nconst esc = (s: string): string =>\n String(s ?? '')\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n\n/**\n * SΓ³ permite http(s). Bloqueia schemes perigosos (javascript:, data:)\n * que poderiam virar href executΓ‘vel. URL invΓ‘lida vira '#'.\n */\nfunction safeUrl(url: string): string {\n try {\n const u = new URL(String(url));\n return u.protocol === 'http:' || u.protocol === 'https:' ? u.href : '#';\n } catch {\n return '#';\n }\n}\n\nfunction renderButton(btn: EmailButton): string {\n const isPrimary = (btn.variant ?? 'primary') === 'primary';\n const bg = isPrimary ? C.blue : C.card;\n const color = isPrimary ? '#FFFFFF' : C.blue;\n const border = isPrimary ? C.blue : C.border;\n return `\n <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:8px 8px 0 0;display:inline-block;\">\n <tr>\n <td style=\"border-radius:10px;background:${bg};border:1px solid ${border};\">\n <a href=\"${esc(safeUrl(btn.url))}\" target=\"_blank\"\n style=\"display:inline-block;padding:12px 22px;font-family:${FONT};font-size:14px;font-weight:600;color:${color};text-decoration:none;border-radius:10px;\">\n ${esc(btn.label)}\n </a>\n </td>\n </tr>\n </table>`;\n}\n\nfunction renderHighlight(h: EmailHighlight, widthPct: number): string {\n return `\n <td width=\"${widthPct}%\" style=\"padding:6px;\" valign=\"top\">\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"\n style=\"background:#FAFAFA;border:1px solid ${C.borderSubtle};border-radius:12px;\">\n <tr><td style=\"padding:14px 16px;font-family:${FONT};\">\n <div style=\"font-size:12px;color:${C.fg2};margin-bottom:4px;\">${esc(h.label)}</div>\n <div style=\"font-size:22px;font-weight:700;color:${h.color || C.fg1};font-family:'Lexend',${FONT};\">${esc(h.value)}</div>\n </td></tr>\n </table>\n </td>`;\n}\n\nfunction renderAiParecer(p: EmailAiParecer): string {\n const v = p.verdict\n ? (() => {\n const t = VERDICT[p.verdictTone || 'info'];\n // table/td (Outlook ignora padding/border-radius em <span>).\n return `<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"display:inline-block;\"><tr>\n <td style=\"background:${t.bg};border-radius:999px;padding:4px 10px;font-family:${FONT};font-size:11px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;color:${t.color};white-space:nowrap;\">${esc(\n p.verdict,\n )}</td></tr></table>`;\n })()\n : '';\n return `\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"\n style=\"margin:18px 0 4px;background:${C.aiCardBg};border:1px solid ${C.aiBorder};border-radius:12px;\">\n <tr><td style=\"padding:16px 18px;font-family:${FONT};\">\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr>\n <td valign=\"middle\" width=\"28\">\n <div style=\"width:22px;height:22px;border-radius:50%;background:${C.aiPurple};color:#fff;text-align:center;line-height:22px;font-size:13px;\">✦</div>\n </td>\n <td valign=\"middle\" style=\"padding-left:8px;\">\n <span style=\"font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:${C.aiPurpleText};\">Parecer GYRA+IA</span>\n </td>\n <td valign=\"middle\" align=\"right\">${v}</td>\n </tr></table>\n <p style=\"margin:10px 0 0;font-size:14px;line-height:1.55;color:${C.fg2};\">${esc(p.text)}</p>\n ${\n p.footer\n ? `<div style=\"margin-top:10px;padding-top:10px;border-top:1px dashed ${C.aiBorder};font-size:11px;color:${C.fg3};\">${esc(\n p.footer,\n )}</div>`\n : ''\n }\n </td></tr>\n </table>`;\n}\n\n// ββ API publica ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\n/**\n * Monta o HTML completo de um email no padrΓ£o Gyra+: logo no topo, card\n * principal com greeting + tΓtulo + parΓ‘grafos + highlights (chips lado a\n * lado) + bloco \"Parecer GYRA+IA\" + botΓ΅es, e rodapΓ© padrΓ£o.\n *\n * Email-safe (tabelas + inline-style, sem flexbox, sem <style>). Funciona\n * em Gmail, Outlook (Windows/Web/Mac), Apple Mail, Thunderbird, mobile.\n *\n * Todas as seΓ§Γ΅es (greeting, paragraphs, highlights, aiParecer, buttons,\n * footerNote) sΓ£o **opcionais** β sΓ³ `title` Γ© obrigatΓ³rio.\n */\nexport function buildEmail(input: EmailLayoutInput): string {\n const {\n preheader,\n greeting,\n title,\n paragraphs = [],\n highlights = [],\n aiParecer,\n buttons = [],\n footerNote,\n } = input;\n\n const highlightWidth = highlights.length\n ? Math.floor(100 / highlights.length)\n : 100;\n const highlightsRow = highlights.length\n ? `<table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:8px 0 4px;\"><tr>${highlights\n .map((h) => renderHighlight(h, highlightWidth))\n .join('')}</tr></table>`\n : '';\n\n const paragraphsHtml = paragraphs\n .map(\n (p) =>\n `<p style=\"margin:0 0 14px;font-family:${FONT};font-size:15px;line-height:1.6;color:${C.fg2};\">${esc(\n p,\n )}</p>`,\n )\n .join('');\n\n const buttonsHtml = buttons.length\n ? `<div style=\"margin-top:18px;\">${buttons.map(renderButton).join('')}</div>`\n : '';\n\n return `<!DOCTYPE html>\n<html lang=\"pt-BR\">\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <title>${esc(title)}</title>\n</head>\n<body style=\"margin:0;padding:0;background:${C.bg};\">\n ${\n preheader\n ? `<div style=\"display:none;max-height:0;overflow:hidden;opacity:0;\">${esc(preheader)}</div>`\n : ''\n }\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:${C.bg};padding:24px 0;\">\n <tr>\n <td align=\"center\">\n <table role=\"presentation\" width=\"600\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:600px;max-width:92%;\">\n <tr>\n <td style=\"padding:8px 4px 20px;\">\n <img src=\"${LOGO_URL}\" alt=\"GYRA+\" height=\"30\" style=\"height:30px;display:block;\" />\n </td>\n </tr>\n <tr>\n <td style=\"background:${C.card};border:1px solid ${C.borderSubtle};border-radius:16px;padding:32px;\">\n ${\n greeting\n ? `<p style=\"margin:0 0 6px;font-family:${FONT};font-size:14px;color:${C.fg2};\">${esc(\n greeting,\n )}</p>`\n : ''\n }\n <h1 style=\"margin:0 0 18px;font-family:'Lexend',${FONT};font-size:23px;line-height:1.3;color:${C.fg1};\">${esc(\n title,\n )}</h1>\n ${paragraphsHtml}\n ${highlightsRow}\n ${aiParecer ? renderAiParecer(aiParecer) : ''}\n ${buttonsHtml}\n </td>\n </tr>\n <tr>\n <td style=\"padding:20px 8px;font-family:${FONT};font-size:12px;line-height:1.5;color:${C.fg3};\">\n ${\n footerNote\n ? `<p style=\"margin:0 0 8px;\">${esc(footerNote)}</p>`\n : ''\n }\n <p style=\"margin:0;\">GYRA+ β’ Esta Γ© uma mensagem automΓ‘tica, nΓ£o responda este email.</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n</body>\n</html>`;\n}\n"],"names":["C","VERDICT","ok","bg","color","warn","danger","info","FONT","esc","s","String","replace","renderButton","btn","isPrimary","variant","url","u","URL","protocol","href","safeUrl","label","buildEmail","input","preheader","greeting","title","paragraphs","highlights","aiParecer","buttons","footerNote","highlightWidth","length","Math","floor","highlightsRow","map","h","widthPct","value","renderHighlight","join","paragraphsHtml","p","buttonsHtml","v","verdict","t","verdictTone","text","footer","renderAiParecer"],"mappings":"AA4FA,MAAMA,EACE,UADFA,EAGM,UAHNA,EAIU,UAJVA,EAKA,UALAA,EAME,UANFA,EAOC,UAPDA,EAQC,UARDA,EASC,UATDA,EAUI,UAVJA,EAWU,UAXVA,EAYM,UAZNA,EAaM,wBAGNC,EAAgE,CACpEC,GAAI,CAAEC,GAAI,UAAWC,MAAO,WAC5BC,KAAM,CAAEF,GAAI,UAAWC,MAAO,WAC9BE,OAAQ,CAAEH,GAAI,UAAWC,MAAO,WAChCG,KAAM,CAAEJ,GAAI,UAAWC,MAAO,YAG1BI,EACJ,8EAOIC,EAAOC,GACXC,OAAOD,GAAK,IACTE,QAAQ,KAAM,SACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,UACdA,QAAQ,KAAM,SAenB,SAASC,EAAaC,GACpB,MAAMC,EAA2C,aAA9BD,EAAIE,SAAW,WAE5BZ,EAAQW,EAAY,UAAYf,EAEtC,MAAO,oLAHIe,EAAYf,EAASA,sBAEjBe,EAAYf,EAASA,4BAKjBS,EAlBrB,SAAiBQ,GACf,IACE,MAAMC,EAAI,IAAIC,IAAIR,OAAOM,IACzB,MAAsB,UAAfC,EAAEE,UAAuC,WAAfF,EAAEE,SAAwBF,EAAEG,KAAO,GACtE,CAAE,MACA,MAAO,GACT,CACF,CAWyBC,CAAQR,EAAIG,kGACoCT,0CAA6CJ,6DACxGK,EAAIK,EAAIS,kEAKtB,CAgEM,SAAUC,EAAWC,GACzB,MAAMC,UACJA,EAASC,SACTA,EAAQC,MACRA,EAAKC,WACLA,EAAa,GAAEC,WACfA,EAAa,GAAEC,UACfA,EAASC,QACTA,EAAU,GAAEC,WACZA,GACER,EAEES,EAAiBJ,EAAWK,OAC9BC,KAAKC,MAAM,IAAMP,EAAWK,QAC5B,IACEG,EAAgBR,EAAWK,OAC7B,yGAAyGL,EACtGS,IAAKC,GA/Ed,SAAyBA,EAAmBC,GAC1C,MAAO,oBACQA,kLAEyCzC,iFACHQ,oDACVR,yBAA6BS,EAAI+B,EAAEjB,4EACnBiB,EAAEpC,OAASJ,0BAA8BQ,OAAUC,EAAI+B,EAAEE,6DAItH,CAoEoBC,CAAgBH,EAAGN,IAC9BU,KAAK,mBACR,GAEEC,EAAiBhB,EACpBU,IACEO,GACC,yCAAyCtC,0CAA6CR,OAAWS,EAC/FqC,UAGLF,KAAK,IAEFG,EAAcf,EAAQG,OACxB,iCAAiCH,EAAQO,IAAI1B,GAAc+B,KAAK,YAChE,GAEJ,MAAO,4NAMEnC,EAAImB,mEAE8B5B,WAEzC0B,EACI,qEAAqEjB,EAAIiB,WACzE,mGAEsF1B,4eAU1DA,sBAA2BA,uDAE/C2B,EACI,wCAAwCnB,0BAA6BR,OAAWS,EAC9EkB,SAEF,qEAE4CnB,0CAA6CR,OAAWS,EACxGmB,0BAEAiB,oBACAP,oBACAP,EAxHhB,SAAyBe,GACvB,MAAME,EAAIF,EAAEG,QACR,MACE,MAAMC,EAAIjD,EAAQ6C,EAAEK,aAAe,QAEnC,MAAO,kIACmBD,EAAE/C,uDAAuDK,yFAA4F0C,EAAE9C,8BAA8BK,EAC3MqC,EAAEG,4BAEP,EAPD,GAQA,GACJ,MAAO,iIAEwCjD,sBAA+BA,+EAC3BQ,sNAGyBR,4QAGiCA,4FAEjEgD,0GAE4BhD,OAAWS,EAAIqC,EAAEM,sBAEjFN,EAAEO,OACE,sEAAsErD,0BAAmCA,OAAWS,EAClHqC,EAAEO,gBAEJ,oCAId,CAsF4BC,CAAgBvB,GAAa,qBACzCgB,8GAIsCvC,0CAA6CR,uBAEnFiC,EACI,8BAA8BxB,EAAIwB,SAClC,yNAWpB"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/emails/email/index.ts"],"sourcesContent":["/**\n * Email transacional genΓ©rico β Gyra+ design system.\n *\n * **FONTE DA VERDADE** dos layouts de email transacional. Usado por\n * qualquer fluxo que precise mandar email no padrΓ£o visual Gyra+:\n * - reset de senha, confirmaΓ§Γ£o de cadastro, alertas internos\n * - finalizaΓ§Γ£o de processamento (Finsights, batch-report, etc)\n * - notificaΓ§Γ΅es de operaΓ§Γ£o/crΓ©dito\n * - convites, mudanΓ§a de plano, alerts de billing...\n *\n * **TS puro**: sem React, sem DOM, sem browser globals. Apenas funΓ§Γ΅es que\n * retornam string HTML. Funciona igual em qualquer runtime Node (Nest) ou\n * bundle browser (Next).\n *\n * **Email-safe**: tabelas + inline-style (clients ignoram <style> externo,\n * flexbox e Material Symbols). Gradientes tΓͺm fallback sΓ³lido.\n *\n * Tokens visuais alinhados com gyra-design: azul #1256FF (acao/primary),\n * roxo #7C4EFF (IA/parecer), neutrals Apple-gray, fonte Inter.\n *\n * **Como usar:**\n * ```ts\n * import { buildEmail } from '@gyramais/gyra-design/dist/emails/email';\n *\n * const html = buildEmail({\n * preheader: 'Senha redefinida com sucesso',\n * greeting: 'OlΓ‘, Maria',\n * title: 'Sua senha foi redefinida',\n * paragraphs: ['Tudo certo. VocΓͺ jΓ‘ pode entrar com a nova senha.'],\n * buttons: [{ label: 'Entrar', url: 'https://app.gyramais.com/login' }],\n * footerNote: 'Se nΓ£o foi vocΓͺ, redefina novamente clicando em \"Esqueci minha senha\".',\n * });\n * ```\n *\n * Pra emails recorrentes (mesmo conteudo, payload variavel), criar um\n * **preset** em `src/emails/<preset-name>/index.ts` que monta o\n * `EmailLayoutInput` a partir de campos de dominio e delega aqui. Ver\n * `balance-sheet-finalized` como exemplo.\n */\n\n// ββ Tipos publicos βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\nexport type EmailButton = {\n label: string;\n url: string;\n /** primary = botΓ£o azul preenchido, secondary = outline. Default primary. */\n variant?: 'primary' | 'secondary';\n};\n\nexport type EmailHighlight = {\n /** label pequeno em cima (ex: \"Score\", \"Nivel de risco\"). */\n label: string;\n /** valor grande em baixo (ex: \"820\", \"Baixo\"). */\n value: string;\n /** cor do valor (ex: cor do risco). Default: tinta padrao Apple-gray. */\n color?: string;\n};\n\n/** Tom semantico do chip de veredito do bloco Parecer GYRA+IA. */\nexport type AiParecerTone = 'ok' | 'warn' | 'danger' | 'info';\n\nexport type EmailAiParecer = {\n /** chip de veredito (ex: \"MΓ©dio\", \"Consistente\"). Opcional. */\n verdict?: string;\n verdictTone?: AiParecerTone;\n /** corpo do parecer. */\n text: string;\n /** rodape do bloco (ex: \"GYRA+IA Β· ConfianΓ§a 96%\"). Opcional. */\n footer?: string;\n};\n\nexport type EmailLayoutInput = {\n /** Texto invisivel no preheader (preview no inbox). */\n preheader?: string;\n /** Linha curta acima do titulo (ex: \"OlΓ‘, Maria\"). */\n greeting?: string;\n /** Titulo principal (H1). */\n title: string;\n /** Paragrafos de corpo (sub-frases). */\n paragraphs?: string[];\n /** Cards lado-a-lado (1 a N). Largura dividida igualmente. */\n highlights?: EmailHighlight[];\n /** Bloco \"Parecer GYRA+IA\" (faixa roxa com chip + texto + rodape). */\n aiParecer?: EmailAiParecer;\n /** Botoes de acao. Multiplos viram lado-a-lado. */\n buttons?: EmailButton[];\n /** Texto pequeno no rodape do card (disclaimer, instrucoes extras). */\n footerNote?: string;\n};\n\n// ββ Tokens (espelho de gyra-design CSS variables, hard-coded pra email) ββββ\n\nconst C = {\n blue: '#1256FF',\n teal: '#1FB58A',\n aiPurple: '#7C4EFF',\n aiPurpleText: '#6635E0',\n bg: '#F5F5F7',\n card: '#FFFFFF',\n fg1: '#1D1D1F',\n fg2: '#636366',\n fg3: '#8E8E93',\n border: '#D2D2D7',\n borderSubtle: '#E8E8ED',\n aiCardBg: '#F6F4FF',\n aiBorder: 'rgba(124,78,255,0.22)',\n};\n\nconst VERDICT: Record<AiParecerTone, { bg: string; color: string }> = {\n ok: { bg: '#E8F9ED', color: '#1A7D37' },\n warn: { bg: '#FFF4E0', color: '#946200' },\n danger: { bg: '#FFEDEC', color: '#C93430' },\n info: { bg: '#EBF4FF', color: '#0055D4' },\n};\n\nconst FONT =\n \"'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif\";\n\nconst LOGO_URL =\n 'https://gyra-file-prod.s3.us-west-2.amazonaws.com/assets/gyra-logo-color.png';\n\n// ββ Helpers internos βββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\nconst esc = (s: string): string =>\n String(s ?? '')\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n\n/**\n * SΓ³ permite http(s). Bloqueia schemes perigosos (javascript:, data:)\n * que poderiam virar href executΓ‘vel. URL invΓ‘lida vira '#'.\n */\nconst SAFE_URL_PROTOCOLS = ['http:', 'https:', 'mailto:', 'tel:'];\n\nfunction safeUrl(url: string): string {\n try {\n const u = new URL(String(url));\n // mailto:/tel: sao comuns e seguros em emails transacionais (contato,\n // suporte, telefone). Demais protocolos (javascript:, data:) viram '#'.\n return SAFE_URL_PROTOCOLS.includes(u.protocol) ? u.href : '#';\n } catch {\n return '#';\n }\n}\n\nfunction renderButton(btn: EmailButton): string {\n const isPrimary = (btn.variant ?? 'primary') === 'primary';\n const bg = isPrimary ? C.blue : C.card;\n const color = isPrimary ? '#FFFFFF' : C.blue;\n const border = isPrimary ? C.blue : C.border;\n return `\n <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:8px 8px 0 0;display:inline-block;\">\n <tr>\n <td style=\"border-radius:10px;background:${bg};border:1px solid ${border};\">\n <a href=\"${esc(safeUrl(btn.url))}\" target=\"_blank\"\n style=\"display:inline-block;padding:12px 22px;font-family:${FONT};font-size:14px;font-weight:600;color:${color};text-decoration:none;border-radius:10px;\">\n ${esc(btn.label)}\n </a>\n </td>\n </tr>\n </table>`;\n}\n\nfunction renderHighlight(h: EmailHighlight, widthPct: number): string {\n return `\n <td width=\"${widthPct}%\" style=\"padding:6px;\" valign=\"top\">\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"\n style=\"background:#FAFAFA;border:1px solid ${C.borderSubtle};border-radius:12px;\">\n <tr><td style=\"padding:14px 16px;font-family:${FONT};\">\n <div style=\"font-size:12px;color:${C.fg2};margin-bottom:4px;\">${esc(h.label)}</div>\n <div style=\"font-size:22px;font-weight:700;color:${h.color || C.fg1};font-family:'Lexend',${FONT};\">${esc(h.value)}</div>\n </td></tr>\n </table>\n </td>`;\n}\n\nfunction renderAiParecer(p: EmailAiParecer): string {\n const v = p.verdict\n ? (() => {\n const t = VERDICT[p.verdictTone || 'info'];\n // table/td (Outlook ignora padding/border-radius em <span>).\n return `<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"display:inline-block;\"><tr>\n <td style=\"background:${t.bg};border-radius:999px;padding:4px 10px;font-family:${FONT};font-size:11px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;color:${t.color};white-space:nowrap;\">${esc(\n p.verdict,\n )}</td></tr></table>`;\n })()\n : '';\n return `\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"\n style=\"margin:18px 0 4px;background:${C.aiCardBg};border:1px solid ${C.aiBorder};border-radius:12px;\">\n <tr><td style=\"padding:16px 18px;font-family:${FONT};\">\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr>\n <td valign=\"middle\" width=\"28\">\n <div style=\"width:22px;height:22px;border-radius:50%;background:${C.aiPurple};color:#fff;text-align:center;line-height:22px;font-size:13px;\">✦</div>\n </td>\n <td valign=\"middle\" style=\"padding-left:8px;\">\n <span style=\"font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:${C.aiPurpleText};\">Parecer GYRA+IA</span>\n </td>\n <td valign=\"middle\" align=\"right\">${v}</td>\n </tr></table>\n <p style=\"margin:10px 0 0;font-size:14px;line-height:1.55;color:${C.fg2};\">${esc(p.text)}</p>\n ${\n p.footer\n ? `<div style=\"margin-top:10px;padding-top:10px;border-top:1px dashed ${C.aiBorder};font-size:11px;color:${C.fg3};\">${esc(\n p.footer,\n )}</div>`\n : ''\n }\n </td></tr>\n </table>`;\n}\n\n// ββ API publica ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\n/**\n * Monta o HTML completo de um email no padrΓ£o Gyra+: logo no topo, card\n * principal com greeting + tΓtulo + parΓ‘grafos + highlights (chips lado a\n * lado) + bloco \"Parecer GYRA+IA\" + botΓ΅es, e rodapΓ© padrΓ£o.\n *\n * Email-safe (tabelas + inline-style, sem flexbox, sem <style>). Funciona\n * em Gmail, Outlook (Windows/Web/Mac), Apple Mail, Thunderbird, mobile.\n *\n * Todas as seΓ§Γ΅es (greeting, paragraphs, highlights, aiParecer, buttons,\n * footerNote) sΓ£o **opcionais** β sΓ³ `title` Γ© obrigatΓ³rio.\n */\nexport function buildEmail(input: EmailLayoutInput): string {\n const {\n preheader,\n greeting,\n title,\n paragraphs = [],\n highlights = [],\n aiParecer,\n buttons = [],\n footerNote,\n } = input;\n\n const highlightWidth = highlights.length\n ? Math.floor(100 / highlights.length)\n : 100;\n const highlightsRow = highlights.length\n ? `<table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:8px 0 4px;\"><tr>${highlights\n .map((h) => renderHighlight(h, highlightWidth))\n .join('')}</tr></table>`\n : '';\n\n const paragraphsHtml = paragraphs\n .map(\n (p) =>\n `<p style=\"margin:0 0 14px;font-family:${FONT};font-size:15px;line-height:1.6;color:${C.fg2};\">${esc(\n p,\n )}</p>`,\n )\n .join('');\n\n const buttonsHtml = buttons.length\n ? `<div style=\"margin-top:18px;\">${buttons.map(renderButton).join('')}</div>`\n : '';\n\n return `<!DOCTYPE html>\n<html lang=\"pt-BR\">\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <title>${esc(title)}</title>\n</head>\n<body style=\"margin:0;padding:0;background:${C.bg};\">\n ${\n preheader\n ? `<div style=\"display:none;max-height:0;overflow:hidden;opacity:0;\">${esc(preheader)}</div>`\n : ''\n }\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:${C.bg};padding:24px 0;\">\n <tr>\n <td align=\"center\">\n <table role=\"presentation\" width=\"600\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:600px;max-width:92%;\">\n <tr>\n <td style=\"padding:8px 4px 20px;\">\n <img src=\"${LOGO_URL}\" alt=\"GYRA+\" height=\"30\" style=\"height:30px;display:block;\" />\n </td>\n </tr>\n <tr>\n <td style=\"background:${C.card};border:1px solid ${C.borderSubtle};border-radius:16px;padding:32px;\">\n ${\n greeting\n ? `<p style=\"margin:0 0 6px;font-family:${FONT};font-size:14px;color:${C.fg2};\">${esc(\n greeting,\n )}</p>`\n : ''\n }\n <h1 style=\"margin:0 0 18px;font-family:'Lexend',${FONT};font-size:23px;line-height:1.3;color:${C.fg1};\">${esc(\n title,\n )}</h1>\n ${paragraphsHtml}\n ${highlightsRow}\n ${aiParecer ? renderAiParecer(aiParecer) : ''}\n ${buttonsHtml}\n </td>\n </tr>\n <tr>\n <td style=\"padding:20px 8px;font-family:${FONT};font-size:12px;line-height:1.5;color:${C.fg3};\">\n ${\n footerNote\n ? `<p style=\"margin:0 0 8px;\">${esc(footerNote)}</p>`\n : ''\n }\n <p style=\"margin:0;\">GYRA+ β’ Esta Γ© uma mensagem automΓ‘tica, nΓ£o responda este email.</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n</body>\n</html>`;\n}\n"],"names":["C","VERDICT","ok","bg","color","warn","danger","info","FONT","esc","s","String","replace","SAFE_URL_PROTOCOLS","renderButton","btn","isPrimary","variant","url","u","URL","includes","protocol","href","safeUrl","label","buildEmail","input","preheader","greeting","title","paragraphs","highlights","aiParecer","buttons","footerNote","highlightWidth","length","Math","floor","highlightsRow","map","h","widthPct","value","renderHighlight","join","paragraphsHtml","p","buttonsHtml","v","verdict","t","verdictTone","text","footer","renderAiParecer"],"mappings":"AA4FA,MAAMA,EACE,UADFA,EAGM,UAHNA,EAIU,UAJVA,EAKA,UALAA,EAME,UANFA,EAOC,UAPDA,EAQC,UARDA,EASC,UATDA,EAUI,UAVJA,EAWU,UAXVA,EAYM,UAZNA,EAaM,wBAGNC,EAAgE,CACpEC,GAAI,CAAEC,GAAI,UAAWC,MAAO,WAC5BC,KAAM,CAAEF,GAAI,UAAWC,MAAO,WAC9BE,OAAQ,CAAEH,GAAI,UAAWC,MAAO,WAChCG,KAAM,CAAEJ,GAAI,UAAWC,MAAO,YAG1BI,EACJ,8EAOIC,EAAOC,GACXC,OAAOD,GAAK,IACTE,QAAQ,KAAM,SACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,UACdA,QAAQ,KAAM,SAMbC,EAAqB,CAAC,QAAS,SAAU,UAAW,QAa1D,SAASC,EAAaC,GACpB,MAAMC,EAA2C,aAA9BD,EAAIE,SAAW,WAE5Bb,EAAQY,EAAY,UAAYhB,EAEtC,MAAO,oLAHIgB,EAAYhB,EAASA,sBAEjBgB,EAAYhB,EAASA,4BAKjBS,EApBrB,SAAiBS,GACf,IACE,MAAMC,EAAI,IAAIC,IAAIT,OAAOO,IAGzB,OAAOL,EAAmBQ,SAASF,EAAEG,UAAYH,EAAEI,KAAO,GAC5D,CAAE,MACA,MAAO,GACT,CACF,CAWyBC,CAAQT,EAAIG,kGACoCV,0CAA6CJ,6DACxGK,EAAIM,EAAIU,kEAKtB,CAgEM,SAAUC,EAAWC,GACzB,MAAMC,UACJA,EAASC,SACTA,EAAQC,MACRA,EAAKC,WACLA,EAAa,GAAEC,WACfA,EAAa,GAAEC,UACfA,EAASC,QACTA,EAAU,GAAEC,WACZA,GACER,EAEES,EAAiBJ,EAAWK,OAC9BC,KAAKC,MAAM,IAAMP,EAAWK,QAC5B,IACEG,EAAgBR,EAAWK,OAC7B,yGAAyGL,EACtGS,IAAKC,GA/Ed,SAAyBA,EAAmBC,GAC1C,MAAO,oBACQA,kLAEyC3C,iFACHQ,oDACVR,yBAA6BS,EAAIiC,EAAEjB,4EACnBiB,EAAEtC,OAASJ,0BAA8BQ,OAAUC,EAAIiC,EAAEE,6DAItH,CAoEoBC,CAAgBH,EAAGN,IAC9BU,KAAK,mBACR,GAEEC,EAAiBhB,EACpBU,IACEO,GACC,yCAAyCxC,0CAA6CR,OAAWS,EAC/FuC,UAGLF,KAAK,IAEFG,EAAcf,EAAQG,OACxB,iCAAiCH,EAAQO,IAAI3B,GAAcgC,KAAK,YAChE,GAEJ,MAAO,4NAMErC,EAAIqB,mEAE8B9B,WAEzC4B,EACI,qEAAqEnB,EAAImB,WACzE,mGAEsF5B,4eAU1DA,sBAA2BA,uDAE/C6B,EACI,wCAAwCrB,0BAA6BR,OAAWS,EAC9EoB,SAEF,qEAE4CrB,0CAA6CR,OAAWS,EACxGqB,0BAEAiB,oBACAP,oBACAP,EAxHhB,SAAyBe,GACvB,MAAME,EAAIF,EAAEG,QACR,MACE,MAAMC,EAAInD,EAAQ+C,EAAEK,aAAe,QAEnC,MAAO,kIACmBD,EAAEjD,uDAAuDK,yFAA4F4C,EAAEhD,8BAA8BK,EAC3MuC,EAAEG,4BAEP,EAPD,GAQA,GACJ,MAAO,iIAEwCnD,sBAA+BA,+EAC3BQ,sNAGyBR,4QAGiCA,4FAEjEkD,0GAE4BlD,OAAWS,EAAIuC,EAAEM,sBAEjFN,EAAEO,OACE,sEAAsEvD,0BAAmCA,OAAWS,EAClHuC,EAAEO,gBAEJ,oCAId,CAsF4BC,CAAgBvB,GAAa,qBACzCgB,8GAIsCzC,0CAA6CR,uBAEnFmC,EACI,8BAA8B1B,EAAI0B,SAClC,yNAWpB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t="#1256FF",n="#7C4EFF",e="#6635E0",i="#F5F5F7",l="#FFFFFF",r="#1D1D1F",
|
|
1
|
+
"use strict";const t="#1256FF",n="#7C4EFF",e="#6635E0",i="#F5F5F7",l="#FFFFFF",r="#1D1D1F",a="#636366",o="#8E8E93",p="#D2D2D7",d="#E8E8ED",s="#F6F4FF",g="rgba(124,78,255,0.22)",c={ok:{bg:"#E8F9ED",color:"#1A7D37"},warn:{bg:"#FFF4E0",color:"#946200"},danger:{bg:"#FFEDEC",color:"#C93430"},info:{bg:"#EBF4FF",color:"#0055D4"}},x="'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif",h=t=>String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),m=["http:","https:","mailto:","tel:"];function f(n){const e="primary"===(n.variant??"primary"),i=e?"#FFFFFF":t;return`\n <table role="presentation" cellpadding="0" cellspacing="0" style="margin:8px 8px 0 0;display:inline-block;">\n <tr>\n <td style="border-radius:10px;background:${e?t:l};border:1px solid ${e?t:p};">\n <a href="${h(function(t){try{const n=new URL(String(t));return m.includes(n.protocol)?n.href:"#"}catch{return"#"}}(n.url))}" target="_blank"\n style="display:inline-block;padding:12px 22px;font-family:${x};font-size:14px;font-weight:600;color:${i};text-decoration:none;border-radius:10px;">\n ${h(n.label)}\n </a>\n </td>\n </tr>\n </table>`}exports.buildEmail=function(t){const{preheader:p,greeting:m,title:$,paragraphs:b=[],highlights:y=[],aiParecer:u,buttons:F=[],footerNote:v}=t,w=y.length?Math.floor(100/y.length):100,E=y.length?`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin:8px 0 4px;"><tr>${y.map(t=>function(t,n){return`\n <td width="${n}%" style="padding:6px;" valign="top">\n <table role="presentation" width="100%" cellpadding="0" cellspacing="0"\n style="background:#FAFAFA;border:1px solid ${d};border-radius:12px;">\n <tr><td style="padding:14px 16px;font-family:${x};">\n <div style="font-size:12px;color:${a};margin-bottom:4px;">${h(t.label)}</div>\n <div style="font-size:22px;font-weight:700;color:${t.color||r};font-family:'Lexend',${x};">${h(t.value)}</div>\n </td></tr>\n </table>\n </td>`}(t,w)).join("")}</tr></table>`:"",k=b.map(t=>`<p style="margin:0 0 14px;font-family:${x};font-size:15px;line-height:1.6;color:${a};">${h(t)}</p>`).join(""),z=F.length?`<div style="margin-top:18px;">${F.map(f).join("")}</div>`:"";return`<!DOCTYPE html>\n<html lang="pt-BR">\n<head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width,initial-scale=1.0" />\n <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n <title>${h($)}</title>\n</head>\n<body style="margin:0;padding:0;background:${i};">\n ${p?`<div style="display:none;max-height:0;overflow:hidden;opacity:0;">${h(p)}</div>`:""}\n <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:${i};padding:24px 0;">\n <tr>\n <td align="center">\n <table role="presentation" width="600" cellpadding="0" cellspacing="0" style="width:600px;max-width:92%;">\n <tr>\n <td style="padding:8px 4px 20px;">\n <img src="https://gyra-file-prod.s3.us-west-2.amazonaws.com/assets/gyra-logo-color.png" alt="GYRA+" height="30" style="height:30px;display:block;" />\n </td>\n </tr>\n <tr>\n <td style="background:${l};border:1px solid ${d};border-radius:16px;padding:32px;">\n ${m?`<p style="margin:0 0 6px;font-family:${x};font-size:14px;color:${a};">${h(m)}</p>`:""}\n <h1 style="margin:0 0 18px;font-family:'Lexend',${x};font-size:23px;line-height:1.3;color:${r};">${h($)}</h1>\n ${k}\n ${E}\n ${u?function(t){const i=t.verdict?(()=>{const n=c[t.verdictTone||"info"];return`<table role="presentation" cellpadding="0" cellspacing="0" style="display:inline-block;"><tr>\n <td style="background:${n.bg};border-radius:999px;padding:4px 10px;font-family:${x};font-size:11px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;color:${n.color};white-space:nowrap;">${h(t.verdict)}</td></tr></table>`})():"";return`\n <table role="presentation" width="100%" cellpadding="0" cellspacing="0"\n style="margin:18px 0 4px;background:${s};border:1px solid ${g};border-radius:12px;">\n <tr><td style="padding:16px 18px;font-family:${x};">\n <table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr>\n <td valign="middle" width="28">\n <div style="width:22px;height:22px;border-radius:50%;background:${n};color:#fff;text-align:center;line-height:22px;font-size:13px;">✦</div>\n </td>\n <td valign="middle" style="padding-left:8px;">\n <span style="font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:${e};">Parecer GYRA+IA</span>\n </td>\n <td valign="middle" align="right">${i}</td>\n </tr></table>\n <p style="margin:10px 0 0;font-size:14px;line-height:1.55;color:${a};">${h(t.text)}</p>\n ${t.footer?`<div style="margin-top:10px;padding-top:10px;border-top:1px dashed ${g};font-size:11px;color:${o};">${h(t.footer)}</div>`:""}\n </td></tr>\n </table>`}(u):""}\n ${z}\n </td>\n </tr>\n <tr>\n <td style="padding:20px 8px;font-family:${x};font-size:12px;line-height:1.5;color:${o};">\n ${v?`<p style="margin:0 0 8px;">${h(v)}</p>`:""}\n <p style="margin:0;">GYRA+ β’ Esta Γ© uma mensagem automΓ‘tica, nΓ£o responda este email.</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n</body>\n</html>`};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/emails/email/index.ts"],"sourcesContent":["/**\n * Email transacional genΓ©rico β Gyra+ design system.\n *\n * **FONTE DA VERDADE** dos layouts de email transacional. Usado por\n * qualquer fluxo que precise mandar email no padrΓ£o visual Gyra+:\n * - reset de senha, confirmaΓ§Γ£o de cadastro, alertas internos\n * - finalizaΓ§Γ£o de processamento (Finsights, batch-report, etc)\n * - notificaΓ§Γ΅es de operaΓ§Γ£o/crΓ©dito\n * - convites, mudanΓ§a de plano, alerts de billing...\n *\n * **TS puro**: sem React, sem DOM, sem browser globals. Apenas funΓ§Γ΅es que\n * retornam string HTML. Funciona igual em qualquer runtime Node (Nest) ou\n * bundle browser (Next).\n *\n * **Email-safe**: tabelas + inline-style (clients ignoram <style> externo,\n * flexbox e Material Symbols). Gradientes tΓͺm fallback sΓ³lido.\n *\n * Tokens visuais alinhados com gyra-design: azul #1256FF (acao/primary),\n * roxo #7C4EFF (IA/parecer), neutrals Apple-gray, fonte Inter.\n *\n * **Como usar:**\n * ```ts\n * import { buildEmail } from '@gyramais/gyra-design/dist/emails/email';\n *\n * const html = buildEmail({\n * preheader: 'Senha redefinida com sucesso',\n * greeting: 'OlΓ‘, Maria',\n * title: 'Sua senha foi redefinida',\n * paragraphs: ['Tudo certo. VocΓͺ jΓ‘ pode entrar com a nova senha.'],\n * buttons: [{ label: 'Entrar', url: 'https://app.gyramais.com/login' }],\n * footerNote: 'Se nΓ£o foi vocΓͺ, redefina novamente clicando em \"Esqueci minha senha\".',\n * });\n * ```\n *\n * Pra emails recorrentes (mesmo conteudo, payload variavel), criar um\n * **preset** em `src/emails/<preset-name>/index.ts` que monta o\n * `EmailLayoutInput` a partir de campos de dominio e delega aqui. Ver\n * `balance-sheet-finalized` como exemplo.\n */\n\n// ββ Tipos publicos βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\nexport type EmailButton = {\n label: string;\n url: string;\n /** primary = botΓ£o azul preenchido, secondary = outline. Default primary. */\n variant?: 'primary' | 'secondary';\n};\n\nexport type EmailHighlight = {\n /** label pequeno em cima (ex: \"Score\", \"Nivel de risco\"). */\n label: string;\n /** valor grande em baixo (ex: \"820\", \"Baixo\"). */\n value: string;\n /** cor do valor (ex: cor do risco). Default: tinta padrao Apple-gray. */\n color?: string;\n};\n\n/** Tom semantico do chip de veredito do bloco Parecer GYRA+IA. */\nexport type AiParecerTone = 'ok' | 'warn' | 'danger' | 'info';\n\nexport type EmailAiParecer = {\n /** chip de veredito (ex: \"MΓ©dio\", \"Consistente\"). Opcional. */\n verdict?: string;\n verdictTone?: AiParecerTone;\n /** corpo do parecer. */\n text: string;\n /** rodape do bloco (ex: \"GYRA+IA Β· ConfianΓ§a 96%\"). Opcional. */\n footer?: string;\n};\n\nexport type EmailLayoutInput = {\n /** Texto invisivel no preheader (preview no inbox). */\n preheader?: string;\n /** Linha curta acima do titulo (ex: \"OlΓ‘, Maria\"). */\n greeting?: string;\n /** Titulo principal (H1). */\n title: string;\n /** Paragrafos de corpo (sub-frases). */\n paragraphs?: string[];\n /** Cards lado-a-lado (1 a N). Largura dividida igualmente. */\n highlights?: EmailHighlight[];\n /** Bloco \"Parecer GYRA+IA\" (faixa roxa com chip + texto + rodape). */\n aiParecer?: EmailAiParecer;\n /** Botoes de acao. Multiplos viram lado-a-lado. */\n buttons?: EmailButton[];\n /** Texto pequeno no rodape do card (disclaimer, instrucoes extras). */\n footerNote?: string;\n};\n\n// ββ Tokens (espelho de gyra-design CSS variables, hard-coded pra email) ββββ\n\nconst C = {\n blue: '#1256FF',\n teal: '#1FB58A',\n aiPurple: '#7C4EFF',\n aiPurpleText: '#6635E0',\n bg: '#F5F5F7',\n card: '#FFFFFF',\n fg1: '#1D1D1F',\n fg2: '#636366',\n fg3: '#8E8E93',\n border: '#D2D2D7',\n borderSubtle: '#E8E8ED',\n aiCardBg: '#F6F4FF',\n aiBorder: 'rgba(124,78,255,0.22)',\n};\n\nconst VERDICT: Record<AiParecerTone, { bg: string; color: string }> = {\n ok: { bg: '#E8F9ED', color: '#1A7D37' },\n warn: { bg: '#FFF4E0', color: '#946200' },\n danger: { bg: '#FFEDEC', color: '#C93430' },\n info: { bg: '#EBF4FF', color: '#0055D4' },\n};\n\nconst FONT =\n \"'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif\";\n\nconst LOGO_URL =\n 'https://gyra-file-prod.s3.us-west-2.amazonaws.com/assets/gyra-logo-color.png';\n\n// ββ Helpers internos βββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\nconst esc = (s: string): string =>\n String(s ?? '')\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n\n/**\n * SΓ³ permite http(s). Bloqueia schemes perigosos (javascript:, data:)\n * que poderiam virar href executΓ‘vel. URL invΓ‘lida vira '#'.\n */\nfunction safeUrl(url: string): string {\n try {\n const u = new URL(String(url));\n return u.protocol === 'http:' || u.protocol === 'https:' ? u.href : '#';\n } catch {\n return '#';\n }\n}\n\nfunction renderButton(btn: EmailButton): string {\n const isPrimary = (btn.variant ?? 'primary') === 'primary';\n const bg = isPrimary ? C.blue : C.card;\n const color = isPrimary ? '#FFFFFF' : C.blue;\n const border = isPrimary ? C.blue : C.border;\n return `\n <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:8px 8px 0 0;display:inline-block;\">\n <tr>\n <td style=\"border-radius:10px;background:${bg};border:1px solid ${border};\">\n <a href=\"${esc(safeUrl(btn.url))}\" target=\"_blank\"\n style=\"display:inline-block;padding:12px 22px;font-family:${FONT};font-size:14px;font-weight:600;color:${color};text-decoration:none;border-radius:10px;\">\n ${esc(btn.label)}\n </a>\n </td>\n </tr>\n </table>`;\n}\n\nfunction renderHighlight(h: EmailHighlight, widthPct: number): string {\n return `\n <td width=\"${widthPct}%\" style=\"padding:6px;\" valign=\"top\">\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"\n style=\"background:#FAFAFA;border:1px solid ${C.borderSubtle};border-radius:12px;\">\n <tr><td style=\"padding:14px 16px;font-family:${FONT};\">\n <div style=\"font-size:12px;color:${C.fg2};margin-bottom:4px;\">${esc(h.label)}</div>\n <div style=\"font-size:22px;font-weight:700;color:${h.color || C.fg1};font-family:'Lexend',${FONT};\">${esc(h.value)}</div>\n </td></tr>\n </table>\n </td>`;\n}\n\nfunction renderAiParecer(p: EmailAiParecer): string {\n const v = p.verdict\n ? (() => {\n const t = VERDICT[p.verdictTone || 'info'];\n // table/td (Outlook ignora padding/border-radius em <span>).\n return `<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"display:inline-block;\"><tr>\n <td style=\"background:${t.bg};border-radius:999px;padding:4px 10px;font-family:${FONT};font-size:11px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;color:${t.color};white-space:nowrap;\">${esc(\n p.verdict,\n )}</td></tr></table>`;\n })()\n : '';\n return `\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"\n style=\"margin:18px 0 4px;background:${C.aiCardBg};border:1px solid ${C.aiBorder};border-radius:12px;\">\n <tr><td style=\"padding:16px 18px;font-family:${FONT};\">\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr>\n <td valign=\"middle\" width=\"28\">\n <div style=\"width:22px;height:22px;border-radius:50%;background:${C.aiPurple};color:#fff;text-align:center;line-height:22px;font-size:13px;\">✦</div>\n </td>\n <td valign=\"middle\" style=\"padding-left:8px;\">\n <span style=\"font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:${C.aiPurpleText};\">Parecer GYRA+IA</span>\n </td>\n <td valign=\"middle\" align=\"right\">${v}</td>\n </tr></table>\n <p style=\"margin:10px 0 0;font-size:14px;line-height:1.55;color:${C.fg2};\">${esc(p.text)}</p>\n ${\n p.footer\n ? `<div style=\"margin-top:10px;padding-top:10px;border-top:1px dashed ${C.aiBorder};font-size:11px;color:${C.fg3};\">${esc(\n p.footer,\n )}</div>`\n : ''\n }\n </td></tr>\n </table>`;\n}\n\n// ββ API publica ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\n/**\n * Monta o HTML completo de um email no padrΓ£o Gyra+: logo no topo, card\n * principal com greeting + tΓtulo + parΓ‘grafos + highlights (chips lado a\n * lado) + bloco \"Parecer GYRA+IA\" + botΓ΅es, e rodapΓ© padrΓ£o.\n *\n * Email-safe (tabelas + inline-style, sem flexbox, sem <style>). Funciona\n * em Gmail, Outlook (Windows/Web/Mac), Apple Mail, Thunderbird, mobile.\n *\n * Todas as seΓ§Γ΅es (greeting, paragraphs, highlights, aiParecer, buttons,\n * footerNote) sΓ£o **opcionais** β sΓ³ `title` Γ© obrigatΓ³rio.\n */\nexport function buildEmail(input: EmailLayoutInput): string {\n const {\n preheader,\n greeting,\n title,\n paragraphs = [],\n highlights = [],\n aiParecer,\n buttons = [],\n footerNote,\n } = input;\n\n const highlightWidth = highlights.length\n ? Math.floor(100 / highlights.length)\n : 100;\n const highlightsRow = highlights.length\n ? `<table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:8px 0 4px;\"><tr>${highlights\n .map((h) => renderHighlight(h, highlightWidth))\n .join('')}</tr></table>`\n : '';\n\n const paragraphsHtml = paragraphs\n .map(\n (p) =>\n `<p style=\"margin:0 0 14px;font-family:${FONT};font-size:15px;line-height:1.6;color:${C.fg2};\">${esc(\n p,\n )}</p>`,\n )\n .join('');\n\n const buttonsHtml = buttons.length\n ? `<div style=\"margin-top:18px;\">${buttons.map(renderButton).join('')}</div>`\n : '';\n\n return `<!DOCTYPE html>\n<html lang=\"pt-BR\">\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <title>${esc(title)}</title>\n</head>\n<body style=\"margin:0;padding:0;background:${C.bg};\">\n ${\n preheader\n ? `<div style=\"display:none;max-height:0;overflow:hidden;opacity:0;\">${esc(preheader)}</div>`\n : ''\n }\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:${C.bg};padding:24px 0;\">\n <tr>\n <td align=\"center\">\n <table role=\"presentation\" width=\"600\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:600px;max-width:92%;\">\n <tr>\n <td style=\"padding:8px 4px 20px;\">\n <img src=\"${LOGO_URL}\" alt=\"GYRA+\" height=\"30\" style=\"height:30px;display:block;\" />\n </td>\n </tr>\n <tr>\n <td style=\"background:${C.card};border:1px solid ${C.borderSubtle};border-radius:16px;padding:32px;\">\n ${\n greeting\n ? `<p style=\"margin:0 0 6px;font-family:${FONT};font-size:14px;color:${C.fg2};\">${esc(\n greeting,\n )}</p>`\n : ''\n }\n <h1 style=\"margin:0 0 18px;font-family:'Lexend',${FONT};font-size:23px;line-height:1.3;color:${C.fg1};\">${esc(\n title,\n )}</h1>\n ${paragraphsHtml}\n ${highlightsRow}\n ${aiParecer ? renderAiParecer(aiParecer) : ''}\n ${buttonsHtml}\n </td>\n </tr>\n <tr>\n <td style=\"padding:20px 8px;font-family:${FONT};font-size:12px;line-height:1.5;color:${C.fg3};\">\n ${\n footerNote\n ? `<p style=\"margin:0 0 8px;\">${esc(footerNote)}</p>`\n : ''\n }\n <p style=\"margin:0;\">GYRA+ β’ Esta Γ© uma mensagem automΓ‘tica, nΓ£o responda este email.</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n</body>\n</html>`;\n}\n"],"names":["C","VERDICT","ok","bg","color","warn","danger","info","FONT","esc","s","String","replace","renderButton","btn","isPrimary","variant","url","u","URL","protocol","href","safeUrl","label","input","preheader","greeting","title","paragraphs","highlights","aiParecer","buttons","footerNote","highlightWidth","length","Math","floor","highlightsRow","map","h","widthPct","value","renderHighlight","join","paragraphsHtml","p","buttonsHtml","v","verdict","t","verdictTone","text","footer","renderAiParecer"],"mappings":"aA4FA,MAAMA,EACE,UADFA,EAGM,UAHNA,EAIU,UAJVA,EAKA,UALAA,EAME,UANFA,EAOC,UAPDA,EAQC,UARDA,EASC,UATDA,EAUI,UAVJA,EAWU,UAXVA,EAYM,UAZNA,EAaM,wBAGNC,EAAgE,CACpEC,GAAI,CAAEC,GAAI,UAAWC,MAAO,WAC5BC,KAAM,CAAEF,GAAI,UAAWC,MAAO,WAC9BE,OAAQ,CAAEH,GAAI,UAAWC,MAAO,WAChCG,KAAM,CAAEJ,GAAI,UAAWC,MAAO,YAG1BI,EACJ,8EAOIC,EAAOC,GACXC,OAAOD,GAAK,IACTE,QAAQ,KAAM,SACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,UACdA,QAAQ,KAAM,SAenB,SAASC,EAAaC,GACpB,MAAMC,EAA2C,aAA9BD,EAAIE,SAAW,WAE5BZ,EAAQW,EAAY,UAAYf,EAEtC,MAAO,oLAHIe,EAAYf,EAASA,sBAEjBe,EAAYf,EAASA,4BAKjBS,EAlBrB,SAAiBQ,GACf,IACE,MAAMC,EAAI,IAAIC,IAAIR,OAAOM,IACzB,MAAsB,UAAfC,EAAEE,UAAuC,WAAfF,EAAEE,SAAwBF,EAAEG,KAAO,GACtE,CAAE,MACA,MAAO,GACT,CACF,CAWyBC,CAAQR,EAAIG,kGACoCT,0CAA6CJ,6DACxGK,EAAIK,EAAIS,kEAKtB,oBAgEM,SAAqBC,GACzB,MAAMC,UACJA,EAASC,SACTA,EAAQC,MACRA,EAAKC,WACLA,EAAa,GAAEC,WACfA,EAAa,GAAEC,UACfA,EAASC,QACTA,EAAU,GAAEC,WACZA,GACER,EAEES,EAAiBJ,EAAWK,OAC9BC,KAAKC,MAAM,IAAMP,EAAWK,QAC5B,IACEG,EAAgBR,EAAWK,OAC7B,yGAAyGL,EACtGS,IAAKC,GA/Ed,SAAyBA,EAAmBC,GAC1C,MAAO,oBACQA,kLAEyCxC,iFACHQ,oDACVR,yBAA6BS,EAAI8B,EAAEhB,4EACnBgB,EAAEnC,OAASJ,0BAA8BQ,OAAUC,EAAI8B,EAAEE,6DAItH,CAoEoBC,CAAgBH,EAAGN,IAC9BU,KAAK,mBACR,GAEEC,EAAiBhB,EACpBU,IACEO,GACC,yCAAyCrC,0CAA6CR,OAAWS,EAC/FoC,UAGLF,KAAK,IAEFG,EAAcf,EAAQG,OACxB,iCAAiCH,EAAQO,IAAIzB,GAAc8B,KAAK,YAChE,GAEJ,MAAO,4NAMElC,EAAIkB,mEAE8B3B,WAEzCyB,EACI,qEAAqEhB,EAAIgB,WACzE,mGAEsFzB,4eAU1DA,sBAA2BA,uDAE/C0B,EACI,wCAAwClB,0BAA6BR,OAAWS,EAC9EiB,SAEF,qEAE4ClB,0CAA6CR,OAAWS,EACxGkB,0BAEAiB,oBACAP,oBACAP,EAxHhB,SAAyBe,GACvB,MAAME,EAAIF,EAAEG,QACR,MACE,MAAMC,EAAIhD,EAAQ4C,EAAEK,aAAe,QAEnC,MAAO,kIACmBD,EAAE9C,uDAAuDK,yFAA4FyC,EAAE7C,8BAA8BK,EAC3MoC,EAAEG,4BAEP,EAPD,GAQA,GACJ,MAAO,iIAEwChD,sBAA+BA,+EAC3BQ,sNAGyBR,4QAGiCA,4FAEjE+C,0GAE4B/C,OAAWS,EAAIoC,EAAEM,sBAEjFN,EAAEO,OACE,sEAAsEpD,0BAAmCA,OAAWS,EAClHoC,EAAEO,gBAEJ,oCAId,CAsF4BC,CAAgBvB,GAAa,qBACzCgB,8GAIsCtC,0CAA6CR,uBAEnFgC,EACI,8BAA8BvB,EAAIuB,SAClC,yNAWpB"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/emails/email/index.ts"],"sourcesContent":["/**\n * Email transacional genΓ©rico β Gyra+ design system.\n *\n * **FONTE DA VERDADE** dos layouts de email transacional. Usado por\n * qualquer fluxo que precise mandar email no padrΓ£o visual Gyra+:\n * - reset de senha, confirmaΓ§Γ£o de cadastro, alertas internos\n * - finalizaΓ§Γ£o de processamento (Finsights, batch-report, etc)\n * - notificaΓ§Γ΅es de operaΓ§Γ£o/crΓ©dito\n * - convites, mudanΓ§a de plano, alerts de billing...\n *\n * **TS puro**: sem React, sem DOM, sem browser globals. Apenas funΓ§Γ΅es que\n * retornam string HTML. Funciona igual em qualquer runtime Node (Nest) ou\n * bundle browser (Next).\n *\n * **Email-safe**: tabelas + inline-style (clients ignoram <style> externo,\n * flexbox e Material Symbols). Gradientes tΓͺm fallback sΓ³lido.\n *\n * Tokens visuais alinhados com gyra-design: azul #1256FF (acao/primary),\n * roxo #7C4EFF (IA/parecer), neutrals Apple-gray, fonte Inter.\n *\n * **Como usar:**\n * ```ts\n * import { buildEmail } from '@gyramais/gyra-design/dist/emails/email';\n *\n * const html = buildEmail({\n * preheader: 'Senha redefinida com sucesso',\n * greeting: 'OlΓ‘, Maria',\n * title: 'Sua senha foi redefinida',\n * paragraphs: ['Tudo certo. VocΓͺ jΓ‘ pode entrar com a nova senha.'],\n * buttons: [{ label: 'Entrar', url: 'https://app.gyramais.com/login' }],\n * footerNote: 'Se nΓ£o foi vocΓͺ, redefina novamente clicando em \"Esqueci minha senha\".',\n * });\n * ```\n *\n * Pra emails recorrentes (mesmo conteudo, payload variavel), criar um\n * **preset** em `src/emails/<preset-name>/index.ts` que monta o\n * `EmailLayoutInput` a partir de campos de dominio e delega aqui. Ver\n * `balance-sheet-finalized` como exemplo.\n */\n\n// ββ Tipos publicos βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\nexport type EmailButton = {\n label: string;\n url: string;\n /** primary = botΓ£o azul preenchido, secondary = outline. Default primary. */\n variant?: 'primary' | 'secondary';\n};\n\nexport type EmailHighlight = {\n /** label pequeno em cima (ex: \"Score\", \"Nivel de risco\"). */\n label: string;\n /** valor grande em baixo (ex: \"820\", \"Baixo\"). */\n value: string;\n /** cor do valor (ex: cor do risco). Default: tinta padrao Apple-gray. */\n color?: string;\n};\n\n/** Tom semantico do chip de veredito do bloco Parecer GYRA+IA. */\nexport type AiParecerTone = 'ok' | 'warn' | 'danger' | 'info';\n\nexport type EmailAiParecer = {\n /** chip de veredito (ex: \"MΓ©dio\", \"Consistente\"). Opcional. */\n verdict?: string;\n verdictTone?: AiParecerTone;\n /** corpo do parecer. */\n text: string;\n /** rodape do bloco (ex: \"GYRA+IA Β· ConfianΓ§a 96%\"). Opcional. */\n footer?: string;\n};\n\nexport type EmailLayoutInput = {\n /** Texto invisivel no preheader (preview no inbox). */\n preheader?: string;\n /** Linha curta acima do titulo (ex: \"OlΓ‘, Maria\"). */\n greeting?: string;\n /** Titulo principal (H1). */\n title: string;\n /** Paragrafos de corpo (sub-frases). */\n paragraphs?: string[];\n /** Cards lado-a-lado (1 a N). Largura dividida igualmente. */\n highlights?: EmailHighlight[];\n /** Bloco \"Parecer GYRA+IA\" (faixa roxa com chip + texto + rodape). */\n aiParecer?: EmailAiParecer;\n /** Botoes de acao. Multiplos viram lado-a-lado. */\n buttons?: EmailButton[];\n /** Texto pequeno no rodape do card (disclaimer, instrucoes extras). */\n footerNote?: string;\n};\n\n// ββ Tokens (espelho de gyra-design CSS variables, hard-coded pra email) ββββ\n\nconst C = {\n blue: '#1256FF',\n teal: '#1FB58A',\n aiPurple: '#7C4EFF',\n aiPurpleText: '#6635E0',\n bg: '#F5F5F7',\n card: '#FFFFFF',\n fg1: '#1D1D1F',\n fg2: '#636366',\n fg3: '#8E8E93',\n border: '#D2D2D7',\n borderSubtle: '#E8E8ED',\n aiCardBg: '#F6F4FF',\n aiBorder: 'rgba(124,78,255,0.22)',\n};\n\nconst VERDICT: Record<AiParecerTone, { bg: string; color: string }> = {\n ok: { bg: '#E8F9ED', color: '#1A7D37' },\n warn: { bg: '#FFF4E0', color: '#946200' },\n danger: { bg: '#FFEDEC', color: '#C93430' },\n info: { bg: '#EBF4FF', color: '#0055D4' },\n};\n\nconst FONT =\n \"'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif\";\n\nconst LOGO_URL =\n 'https://gyra-file-prod.s3.us-west-2.amazonaws.com/assets/gyra-logo-color.png';\n\n// ββ Helpers internos βββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\nconst esc = (s: string): string =>\n String(s ?? '')\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n\n/**\n * SΓ³ permite http(s). Bloqueia schemes perigosos (javascript:, data:)\n * que poderiam virar href executΓ‘vel. URL invΓ‘lida vira '#'.\n */\nconst SAFE_URL_PROTOCOLS = ['http:', 'https:', 'mailto:', 'tel:'];\n\nfunction safeUrl(url: string): string {\n try {\n const u = new URL(String(url));\n // mailto:/tel: sao comuns e seguros em emails transacionais (contato,\n // suporte, telefone). Demais protocolos (javascript:, data:) viram '#'.\n return SAFE_URL_PROTOCOLS.includes(u.protocol) ? u.href : '#';\n } catch {\n return '#';\n }\n}\n\nfunction renderButton(btn: EmailButton): string {\n const isPrimary = (btn.variant ?? 'primary') === 'primary';\n const bg = isPrimary ? C.blue : C.card;\n const color = isPrimary ? '#FFFFFF' : C.blue;\n const border = isPrimary ? C.blue : C.border;\n return `\n <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:8px 8px 0 0;display:inline-block;\">\n <tr>\n <td style=\"border-radius:10px;background:${bg};border:1px solid ${border};\">\n <a href=\"${esc(safeUrl(btn.url))}\" target=\"_blank\"\n style=\"display:inline-block;padding:12px 22px;font-family:${FONT};font-size:14px;font-weight:600;color:${color};text-decoration:none;border-radius:10px;\">\n ${esc(btn.label)}\n </a>\n </td>\n </tr>\n </table>`;\n}\n\nfunction renderHighlight(h: EmailHighlight, widthPct: number): string {\n return `\n <td width=\"${widthPct}%\" style=\"padding:6px;\" valign=\"top\">\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"\n style=\"background:#FAFAFA;border:1px solid ${C.borderSubtle};border-radius:12px;\">\n <tr><td style=\"padding:14px 16px;font-family:${FONT};\">\n <div style=\"font-size:12px;color:${C.fg2};margin-bottom:4px;\">${esc(h.label)}</div>\n <div style=\"font-size:22px;font-weight:700;color:${h.color || C.fg1};font-family:'Lexend',${FONT};\">${esc(h.value)}</div>\n </td></tr>\n </table>\n </td>`;\n}\n\nfunction renderAiParecer(p: EmailAiParecer): string {\n const v = p.verdict\n ? (() => {\n const t = VERDICT[p.verdictTone || 'info'];\n // table/td (Outlook ignora padding/border-radius em <span>).\n return `<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"display:inline-block;\"><tr>\n <td style=\"background:${t.bg};border-radius:999px;padding:4px 10px;font-family:${FONT};font-size:11px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;color:${t.color};white-space:nowrap;\">${esc(\n p.verdict,\n )}</td></tr></table>`;\n })()\n : '';\n return `\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"\n style=\"margin:18px 0 4px;background:${C.aiCardBg};border:1px solid ${C.aiBorder};border-radius:12px;\">\n <tr><td style=\"padding:16px 18px;font-family:${FONT};\">\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr>\n <td valign=\"middle\" width=\"28\">\n <div style=\"width:22px;height:22px;border-radius:50%;background:${C.aiPurple};color:#fff;text-align:center;line-height:22px;font-size:13px;\">✦</div>\n </td>\n <td valign=\"middle\" style=\"padding-left:8px;\">\n <span style=\"font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:${C.aiPurpleText};\">Parecer GYRA+IA</span>\n </td>\n <td valign=\"middle\" align=\"right\">${v}</td>\n </tr></table>\n <p style=\"margin:10px 0 0;font-size:14px;line-height:1.55;color:${C.fg2};\">${esc(p.text)}</p>\n ${\n p.footer\n ? `<div style=\"margin-top:10px;padding-top:10px;border-top:1px dashed ${C.aiBorder};font-size:11px;color:${C.fg3};\">${esc(\n p.footer,\n )}</div>`\n : ''\n }\n </td></tr>\n </table>`;\n}\n\n// ββ API publica ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n\n/**\n * Monta o HTML completo de um email no padrΓ£o Gyra+: logo no topo, card\n * principal com greeting + tΓtulo + parΓ‘grafos + highlights (chips lado a\n * lado) + bloco \"Parecer GYRA+IA\" + botΓ΅es, e rodapΓ© padrΓ£o.\n *\n * Email-safe (tabelas + inline-style, sem flexbox, sem <style>). Funciona\n * em Gmail, Outlook (Windows/Web/Mac), Apple Mail, Thunderbird, mobile.\n *\n * Todas as seΓ§Γ΅es (greeting, paragraphs, highlights, aiParecer, buttons,\n * footerNote) sΓ£o **opcionais** β sΓ³ `title` Γ© obrigatΓ³rio.\n */\nexport function buildEmail(input: EmailLayoutInput): string {\n const {\n preheader,\n greeting,\n title,\n paragraphs = [],\n highlights = [],\n aiParecer,\n buttons = [],\n footerNote,\n } = input;\n\n const highlightWidth = highlights.length\n ? Math.floor(100 / highlights.length)\n : 100;\n const highlightsRow = highlights.length\n ? `<table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:8px 0 4px;\"><tr>${highlights\n .map((h) => renderHighlight(h, highlightWidth))\n .join('')}</tr></table>`\n : '';\n\n const paragraphsHtml = paragraphs\n .map(\n (p) =>\n `<p style=\"margin:0 0 14px;font-family:${FONT};font-size:15px;line-height:1.6;color:${C.fg2};\">${esc(\n p,\n )}</p>`,\n )\n .join('');\n\n const buttonsHtml = buttons.length\n ? `<div style=\"margin-top:18px;\">${buttons.map(renderButton).join('')}</div>`\n : '';\n\n return `<!DOCTYPE html>\n<html lang=\"pt-BR\">\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <title>${esc(title)}</title>\n</head>\n<body style=\"margin:0;padding:0;background:${C.bg};\">\n ${\n preheader\n ? `<div style=\"display:none;max-height:0;overflow:hidden;opacity:0;\">${esc(preheader)}</div>`\n : ''\n }\n <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:${C.bg};padding:24px 0;\">\n <tr>\n <td align=\"center\">\n <table role=\"presentation\" width=\"600\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:600px;max-width:92%;\">\n <tr>\n <td style=\"padding:8px 4px 20px;\">\n <img src=\"${LOGO_URL}\" alt=\"GYRA+\" height=\"30\" style=\"height:30px;display:block;\" />\n </td>\n </tr>\n <tr>\n <td style=\"background:${C.card};border:1px solid ${C.borderSubtle};border-radius:16px;padding:32px;\">\n ${\n greeting\n ? `<p style=\"margin:0 0 6px;font-family:${FONT};font-size:14px;color:${C.fg2};\">${esc(\n greeting,\n )}</p>`\n : ''\n }\n <h1 style=\"margin:0 0 18px;font-family:'Lexend',${FONT};font-size:23px;line-height:1.3;color:${C.fg1};\">${esc(\n title,\n )}</h1>\n ${paragraphsHtml}\n ${highlightsRow}\n ${aiParecer ? renderAiParecer(aiParecer) : ''}\n ${buttonsHtml}\n </td>\n </tr>\n <tr>\n <td style=\"padding:20px 8px;font-family:${FONT};font-size:12px;line-height:1.5;color:${C.fg3};\">\n ${\n footerNote\n ? `<p style=\"margin:0 0 8px;\">${esc(footerNote)}</p>`\n : ''\n }\n <p style=\"margin:0;\">GYRA+ β’ Esta Γ© uma mensagem automΓ‘tica, nΓ£o responda este email.</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n</body>\n</html>`;\n}\n"],"names":["C","VERDICT","ok","bg","color","warn","danger","info","FONT","esc","s","String","replace","SAFE_URL_PROTOCOLS","renderButton","btn","isPrimary","variant","url","u","URL","includes","protocol","href","safeUrl","label","input","preheader","greeting","title","paragraphs","highlights","aiParecer","buttons","footerNote","highlightWidth","length","Math","floor","highlightsRow","map","h","widthPct","value","renderHighlight","join","paragraphsHtml","p","buttonsHtml","v","verdict","t","verdictTone","text","footer","renderAiParecer"],"mappings":"aA4FA,MAAMA,EACE,UADFA,EAGM,UAHNA,EAIU,UAJVA,EAKA,UALAA,EAME,UANFA,EAOC,UAPDA,EAQC,UARDA,EASC,UATDA,EAUI,UAVJA,EAWU,UAXVA,EAYM,UAZNA,EAaM,wBAGNC,EAAgE,CACpEC,GAAI,CAAEC,GAAI,UAAWC,MAAO,WAC5BC,KAAM,CAAEF,GAAI,UAAWC,MAAO,WAC9BE,OAAQ,CAAEH,GAAI,UAAWC,MAAO,WAChCG,KAAM,CAAEJ,GAAI,UAAWC,MAAO,YAG1BI,EACJ,8EAOIC,EAAOC,GACXC,OAAOD,GAAK,IACTE,QAAQ,KAAM,SACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,UACdA,QAAQ,KAAM,SAMbC,EAAqB,CAAC,QAAS,SAAU,UAAW,QAa1D,SAASC,EAAaC,GACpB,MAAMC,EAA2C,aAA9BD,EAAIE,SAAW,WAE5Bb,EAAQY,EAAY,UAAYhB,EAEtC,MAAO,oLAHIgB,EAAYhB,EAASA,sBAEjBgB,EAAYhB,EAASA,4BAKjBS,EApBrB,SAAiBS,GACf,IACE,MAAMC,EAAI,IAAIC,IAAIT,OAAOO,IAGzB,OAAOL,EAAmBQ,SAASF,EAAEG,UAAYH,EAAEI,KAAO,GAC5D,CAAE,MACA,MAAO,GACT,CACF,CAWyBC,CAAQT,EAAIG,kGACoCV,0CAA6CJ,6DACxGK,EAAIM,EAAIU,kEAKtB,oBAgEM,SAAqBC,GACzB,MAAMC,UACJA,EAASC,SACTA,EAAQC,MACRA,EAAKC,WACLA,EAAa,GAAEC,WACfA,EAAa,GAAEC,UACfA,EAASC,QACTA,EAAU,GAAEC,WACZA,GACER,EAEES,EAAiBJ,EAAWK,OAC9BC,KAAKC,MAAM,IAAMP,EAAWK,QAC5B,IACEG,EAAgBR,EAAWK,OAC7B,yGAAyGL,EACtGS,IAAKC,GA/Ed,SAAyBA,EAAmBC,GAC1C,MAAO,oBACQA,kLAEyC1C,iFACHQ,oDACVR,yBAA6BS,EAAIgC,EAAEhB,4EACnBgB,EAAErC,OAASJ,0BAA8BQ,OAAUC,EAAIgC,EAAEE,6DAItH,CAoEoBC,CAAgBH,EAAGN,IAC9BU,KAAK,mBACR,GAEEC,EAAiBhB,EACpBU,IACEO,GACC,yCAAyCvC,0CAA6CR,OAAWS,EAC/FsC,UAGLF,KAAK,IAEFG,EAAcf,EAAQG,OACxB,iCAAiCH,EAAQO,IAAI1B,GAAc+B,KAAK,YAChE,GAEJ,MAAO,4NAMEpC,EAAIoB,mEAE8B7B,WAEzC2B,EACI,qEAAqElB,EAAIkB,WACzE,mGAEsF3B,4eAU1DA,sBAA2BA,uDAE/C4B,EACI,wCAAwCpB,0BAA6BR,OAAWS,EAC9EmB,SAEF,qEAE4CpB,0CAA6CR,OAAWS,EACxGoB,0BAEAiB,oBACAP,oBACAP,EAxHhB,SAAyBe,GACvB,MAAME,EAAIF,EAAEG,QACR,MACE,MAAMC,EAAIlD,EAAQ8C,EAAEK,aAAe,QAEnC,MAAO,kIACmBD,EAAEhD,uDAAuDK,yFAA4F2C,EAAE/C,8BAA8BK,EAC3MsC,EAAEG,4BAEP,EAPD,GAQA,GACJ,MAAO,iIAEwClD,sBAA+BA,+EAC3BQ,sNAGyBR,4QAGiCA,4FAEjEiD,0GAE4BjD,OAAWS,EAAIsC,EAAEM,sBAEjFN,EAAEO,OACE,sEAAsEtD,0BAAmCA,OAAWS,EAClHsC,EAAEO,gBAEJ,oCAId,CAsF4BC,CAAgBvB,GAAa,qBACzCgB,8GAIsCxC,0CAA6CR,uBAEnFkC,EACI,8BAA8BzB,EAAIyB,SAClC,yNAWpB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Checkbox };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
3
|
+
import { ControllerProps, FieldPath, FieldValues, useForm } from 'react-hook-form';
|
|
4
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
5
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
|
|
6
|
+
declare const useFormField: () => {
|
|
7
|
+
invalid: boolean;
|
|
8
|
+
isDirty: boolean;
|
|
9
|
+
isTouched: boolean;
|
|
10
|
+
isValidating: boolean;
|
|
11
|
+
error?: import("react-hook-form").FieldError;
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
formItemId: string;
|
|
15
|
+
formDescriptionId: string;
|
|
16
|
+
formMessageId: string;
|
|
17
|
+
};
|
|
18
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
20
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
21
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
23
|
+
export { useForm, useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3
|
+
declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
|
|
4
|
+
declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
5
|
+
declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
export { Label };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
3
|
+
declare const MenubarMenu: {
|
|
4
|
+
(props: MenubarPrimitive.MenubarMenuProps & {
|
|
5
|
+
__scopeMenubar?: import("@radix-ui/react-context").Scope;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
declare const MenubarGroup: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const MenubarPortal: React.FC<MenubarPrimitive.MenubarPortalProps>;
|
|
11
|
+
declare const MenubarSub: React.FC<MenubarPrimitive.MenubarSubProps>;
|
|
12
|
+
declare const MenubarRadioGroup: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const Menubar: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const MenubarTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
declare const MenubarSubTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const MenubarSubContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const MenubarContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const MenubarItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const MenubarCheckboxItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
declare const MenubarRadioItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const MenubarLabel: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const MenubarSeparator: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
declare const MenubarShortcut: {
|
|
30
|
+
({ id, className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
31
|
+
displayname: string;
|
|
32
|
+
};
|
|
33
|
+
export { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarSub, MenubarShortcut, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Popover, PopoverTrigger, PopoverContent };
|