Modals
1 month ago
skeletons
4 months ago
ActionButton.vue
5 months ago
ActionButtonsSection.vue
5 months ago
Banner.vue
3 months ago
FAQ.vue
5 months ago
FormItem.vue
2 months ago
FormsSection.vue
11 months ago
Hero.vue
1 month ago
Integrations.vue
4 months ago
Pagination.vue
10 months ago
PluginEntriesTable.vue
4 months ago
PluginEntry.vue
4 months ago
PluginExpansion.vue
8 months ago
ReachContactsSummary.vue
2 weeks ago
SyncStatusLabel.vue
6 months ago
Tabs.vue
9 months ago
Toggle.vue
10 months ago
UsageCard.vue
10 months ago
UsageCardsRow.vue
1 year ago
UsageCardsSection.vue
1 year ago
WooCommerce.vue
2 weeks ago
WooCommerceEntriesTable.vue
4 months ago
ActionButton.vue
104 lines
| 1 | <script setup lang="ts"> |
| 2 | import type { HIconUnion } from '@hostinger/hcomponents'; |
| 3 | |
| 4 | import { translate } from '@/utils/translate'; |
| 5 | |
| 6 | interface Props { |
| 7 | icon: HIconUnion; |
| 8 | text: string; |
| 9 | url?: string; |
| 10 | } |
| 11 | |
| 12 | const { url = '', text, icon } = defineProps<Props>(); |
| 13 | |
| 14 | const handleClick = () => { |
| 15 | if (url) { |
| 16 | window.open(url, '_blank'); |
| 17 | } |
| 18 | }; |
| 19 | </script> |
| 20 | |
| 21 | <template> |
| 22 | <HCard |
| 23 | class="action-button" |
| 24 | padding="16px 20px" |
| 25 | border-radius="999px" |
| 26 | role="button" |
| 27 | tabindex="0" |
| 28 | :aria-label="url ? `${text} (${translate('hostinger_reach_ui_opens_in_new_tab')})` : text" |
| 29 | @click="handleClick" |
| 30 | @keydown.enter="handleClick" |
| 31 | @keydown.space.prevent="handleClick" |
| 32 | > |
| 33 | <div class="button-content"> |
| 34 | <HIcon :name="icon" class="button-icon" aria-hidden="true" /> |
| 35 | <span class="button-text">{{ text }}</span> |
| 36 | </div> |
| 37 | <HIcon name="ic-arrow-up-right-square-16" class="arrow-icon" aria-hidden="true" /> |
| 38 | </HCard> |
| 39 | </template> |
| 40 | |
| 41 | <style scoped lang="scss"> |
| 42 | .action-button { |
| 43 | flex: 1; |
| 44 | cursor: pointer; |
| 45 | background-color: var(--neutral--0); |
| 46 | border: 1px solid var(--neutral--200); |
| 47 | transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); |
| 48 | display: flex; |
| 49 | align-items: center; |
| 50 | justify-content: space-between; |
| 51 | gap: 12px; |
| 52 | |
| 53 | &:hover { |
| 54 | background-color: var(--neutral--100); |
| 55 | border-color: var(--neutral--200); |
| 56 | } |
| 57 | |
| 58 | &:deep(.h-card) { |
| 59 | padding: 16px 20px; |
| 60 | border-radius: 999px; |
| 61 | background-color: var(--neutral--0); |
| 62 | border: 1px solid var(--neutral--200); |
| 63 | display: flex; |
| 64 | align-items: center; |
| 65 | justify-content: space-between; |
| 66 | gap: 12px; |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | .button-content { |
| 71 | display: flex; |
| 72 | align-items: center; |
| 73 | gap: 8px; |
| 74 | flex: 1; |
| 75 | } |
| 76 | |
| 77 | .button-icon, |
| 78 | .arrow-icon { |
| 79 | width: 16px; |
| 80 | height: 16px; |
| 81 | color: var(--neutral--600); |
| 82 | flex-shrink: 0; |
| 83 | } |
| 84 | |
| 85 | .button-text { |
| 86 | font-family: 'DM Sans', sans-serif; |
| 87 | font-weight: 700; |
| 88 | font-size: 12px; |
| 89 | line-height: 1.667; |
| 90 | color: var(--neutral--600); |
| 91 | margin: 0; |
| 92 | white-space: nowrap; |
| 93 | flex: 1; |
| 94 | } |
| 95 | |
| 96 | @media (max-width: 767px) { |
| 97 | .action-button { |
| 98 | &:deep(.h-card) { |
| 99 | padding: 12px 16px; |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | </style> |
| 104 |