Skip to content

Commit 58fb8db

Browse files
committed
Fix: remove resolveComponent from Tab
1 parent 3827b9c commit 58fb8db

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

src/components/Tabs/Tabs.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,12 @@ import {
140140
reactive,
141141
computed,
142142
h,
143-
resolveComponent,
144143
} from 'vue';
145144
import { useBreakpoints } from '@/use/useBreakpoints';
146145
import useI18n from '@/use/useI18n';
147146
import type { VueNode } from '@/utilities/types';
148147
import { useHasSlot } from '@/use/useHasSlot';
149-
import { Icon, Tooltip, Popover, Box } from '@/components';
148+
import { Icon, Tooltip, Popover, Box, Text, UnstyledButton } from '@/components';
150149
import { Tab, TabMeasurer, CreateViewModal, Panel, List } from './components';
151150
import type { TabMeasurements, TabProps, TabsEvents } from './types';
152151
import { getVisibleAndHiddenTabIndices } from './utilities';
@@ -529,7 +528,7 @@ watch(
529528
);
530529
531530
const activator = () => h(
532-
resolveComponent('UnstyledButton'),
531+
UnstyledButton,
533532
{
534533
type: 'button',
535534
className: classNames(styles.DisclosureActivator),
@@ -539,7 +538,7 @@ const activator = () => h(
539538
},
540539
() => [
541540
h(
542-
resolveComponent('Text'),
541+
Text,
543542
{ as: 'span', variant: 'bodySm', fontWeight: 'medium' },
544543
() => props.disclosureText ?? i18n.translate('Polaris.Tabs.toggleTabsLabel'),
545544
),
@@ -552,7 +551,7 @@ const activator = () => h(
552551
),
553552
},
554553
h(
555-
resolveComponent('Icon'),
554+
Icon,
556555
{ source: ChevronDownIcon, tone: 'subdued' },
557556
),
558557
),

src/components/Tabs/components/Tab/Tab.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,12 @@ import {
117117
getCurrentInstance,
118118
watch,
119119
h,
120-
resolveComponent,
121120
} from 'vue';
122121
import useI18n from '@/use/useI18n';
123122
import { focusFirstFocusableNode, handleMouseUpByBlurring } from '@/utilities/focus';
124123
import { classNames } from '@/utilities/css';
125124
import { useHasSlot } from '@/use/useHasSlot';
126-
import { Popover, ActionList, Modal, ModalSection } from '@/components';
125+
import { Popover, ActionList, Modal, ModalSection, InlineStack, UnstyledButton, UnstyledLink, Icon, Text, Badge } from '@/components';
127126
import styles from '@polaris/components/Tabs/Tabs.module.css';
128127
import InfoIcon from '@icons/InfoIcon.svg';
129128
import DuplicateIcon from '@icons/DuplicateIcon.svg';
@@ -302,8 +301,8 @@ const handleKeyDown = (event: KeyboardEvent) => {
302301
const activator = () => {
303302
return h(
304303
urlIfNotDisabledOrSelected.value
305-
? resolveComponent('UnstyledLink')
306-
: resolveComponent('UnstyledButton'),
304+
? UnstyledLink
305+
: UnstyledButton,
307306
{
308307
id: props.id,
309308
className: tabClassName.value,
@@ -321,16 +320,16 @@ const activator = () => {
321320
},
322321
() => [
323322
h(
324-
resolveComponent('InlineStack'),
323+
InlineStack,
325324
{
326-
gap: 200,
325+
gap: '200',
327326
align: 'center',
328327
blockAlign: 'center',
329328
wrap: false,
330329
},
331330
() => [
332331
h(
333-
resolveComponent('Text'),
332+
Text,
334333
{
335334
as: 'span',
336335
variant: 'bodySm',
@@ -341,7 +340,7 @@ const activator = () => {
341340
},
342341
),
343342
props.badge ? h(
344-
resolveComponent('Badge'),
343+
Badge,
345344
{ tone: props.selected ? undefined : 'new' },
346345
{ default: () => props.badge },
347346
) : null,
@@ -350,7 +349,7 @@ const activator = () => {
350349
props.selected && props.actions?.length ? h(
351350
'div',
352351
{ class: classNames(styles.IconWrap) },
353-
h(resolveComponent('Icon'), { source: ChevronDownIcon }),
352+
h(Icon, { source: ChevronDownIcon }),
354353
) : null,
355354
],
356355
);

0 commit comments

Comments
 (0)