Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various style consistency fixes #4379

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions app/web/src/components/Actions/FuncRunTabGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
v-if="props.selectedAction"
class="absolute w-[500px] h-full left-[-500px] bg-neutral-800 z-[-10]"
>
<TabGroup
ref="tabGroupRef"
variant="fullsize"
@closeButtonTabClicked="props.close"
>
<TabGroup ref="tabGroupRef" @closeButtonTabClicked="props.close">
<TabGroupCloseButton />
<ChangesPanelHistorySubpanelTab
label="Arguments"
Expand Down
2 changes: 1 addition & 1 deletion app/web/src/components/AssetActionsDetails.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="h-full relative">
<TabGroup
variant="minimal"
variant="secondary"
:startSelectedTabSlug="componentsStore.detailsTabSlugs[1] || undefined"
marginTop="2xs"
@update:selectedTab="onTabSelected"
Expand Down
1 change: 1 addition & 0 deletions app/web/src/components/AssetFuncAttachDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<IconButton
iconTone="action"
icon="link"
size="sm"
:requestStatus="requestStatus"
:selected="menuRef?.isOpen"
tooltip="Attach Function"
Expand Down
1 change: 1 addition & 0 deletions app/web/src/components/AssetFuncListPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
>
<AssetFuncAttachDropdown
v-if="assetStore.selectedVariantId"
variant="simple"
:disabled="!assetStore.selectedSchemaVariant?.schemaVariantId"
@selected-attach-type="openAttachFuncModal"
/>
Expand Down
4 changes: 2 additions & 2 deletions app/web/src/components/AssetPalette.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Icon
v-tooltip="{
content:
'Drag the assets that you wish to include in your application into the canvas to the right.',
'Drag the assets that you wish to include in your application on to the canvas to the right.',
theme: 'w-380',
}"
class="cursor-pointer hover:text-shade-100 dark:hover:text-shade-0"
Expand Down Expand Up @@ -76,7 +76,7 @@
@click.right.prevent
>
<template #label>
<TruncateWithTooltip class="text-sm">
<TruncateWithTooltip class="text-xs">
{{ schemaVariantDisplayName(schemaVariant) }}
</TruncateWithTooltip>
<!-- <div
Expand Down
9 changes: 4 additions & 5 deletions app/web/src/components/ComponentDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
<TabGroup
ref="tabsRef"
trackingSlug="asset_details"
variant="fullsize"
:startSelectedTabSlug="
componentsStore.detailsTabSlugs[0] || undefined
"
Expand All @@ -84,7 +83,7 @@
<TabGroupItem slug="component">
<template #label>
<Inline noWrap alignY="center">
<span>Component</span>
<span class="uppercase">Component</span>
<StatusIndicatorIcon
v-if="selectedComponentQualificationStatus"
type="qualification"
Expand All @@ -96,7 +95,7 @@
<TabGroup
ref="componentSubTabsRef"
trackingSlug="asset_details/component"
variant="minimal"
variant="secondary"
:startSelectedTabSlug="
componentsStore.detailsTabSlugs[1] || undefined
"
Expand Down Expand Up @@ -149,7 +148,7 @@
<TabGroupItem slug="actions">
<template #label>
<Inline noWrap alignY="center">
<span>Actions</span>
<span class="uppercase">Actions</span>
<PillCounter
:count="selectedComponentActionsCount"
hideIfZero
Expand All @@ -161,7 +160,7 @@
<TabGroupItem slug="resource">
<template #label>
<Inline noWrap alignY="center">
<span>Resource</span>
<span class="uppercase">Resource</span>
<StatusIndicatorIcon
v-if="selectedComponent.hasResource"
type="resource"
Expand Down
1 change: 0 additions & 1 deletion app/web/src/components/CustomizeTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
ref="group"
:startSelectedTabSlug="tabContentSlug"
marginTop="2xs"
variant="fullsize"
@update:selected-tab="onTabChange"
>
<TabGroupItem slug="assets" label="ASSETS">
Expand Down
7 changes: 2 additions & 5 deletions app/web/src/components/FuncEditor/FuncDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
:class="clsx(!unlocking && 'hover:scale-125')"
:loading="unlocking"
icon="sliders-vertical"
size="sm"
tooltip="Edit"
tooltipPlacement="top"
variant="simple"
Expand Down Expand Up @@ -101,11 +102,7 @@
</div>
</div>
<div class="flex-grow relative">
<TabGroup
ref="funcDetailsTabGroupRef"
growTabsToFillWidth
variant="fullsize"
>
<TabGroup ref="funcDetailsTabGroupRef" growTabsToFillWidth>
<TabGroupItem label="Properties" slug="properties">
<div
class="flex flex-col absolute inset-0 overflow-y-auto overflow-x-hidden border-t border-neutral-200 dark:border-neutral-600"
Expand Down
1 change: 1 addition & 0 deletions app/web/src/components/FuncEditor/FuncTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
ref="funcTestTabsRef"
startSelectedTabSlug="input"
growTabsToFillWidth
variant="secondary"
marginTop="2xs"
>
<TabGroupItem label="Input" slug="input">
Expand Down
7 changes: 3 additions & 4 deletions app/web/src/components/NoSelectionDetailsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@
startSelectedTabSlug="changes"
rememberSelectedTabKey="no-selection-details-panel"
trackingSlug="no-selection-details-panel"
variant="fullsize"
>
<TabGroupItem label="CHANGES" slug="changes">
<TabGroupItem label="Changes" slug="changes">
<ChangesPanelProposed />
</TabGroupItem>
<TabGroupItem label="HISTORY" slug="history">
<TabGroupItem label="History" slug="history">
<ChangesPanelHistory />
</TabGroupItem>
<TabGroupItem label="SECRETS" slug="secrets">
<TabGroupItem label="Secrets" slug="secrets">
<SecretsPanel />
</TabGroupItem>
</TabGroup>
Expand Down
42 changes: 19 additions & 23 deletions lib/vue-lib/src/design-system/tabs/TabGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ref="tabContainerRef"
:class="
clsx(
variant !== 'fullsize' &&
variant !== 'primary' &&
{
none: '',
'2xs': 'mt-2xs',
Expand All @@ -30,7 +30,7 @@
v-if="
firstTabMarginLeft &&
firstTabMarginLeft !== 'none' &&
variant !== 'fullsize'
variant !== 'primary'
"
:class="
clsx(
Expand Down Expand Up @@ -67,7 +67,14 @@
@click="clickedTab($event, tab.props.slug)"
@auxclick.prevent.stop="closeTab(tab)"
>
<div class="max-w-full truncate">
<div
:class="
clsx(
'max-w-full truncate',
variant === 'primary' && 'uppercase',
)
"
>
<template v-if="tab.slots.label">
<component :is="tab.slots.label" />
</template>
Expand All @@ -90,7 +97,7 @@
</button>
</a>
<div
v-if="variant !== 'fullsize' && !growTabs"
v-if="variant !== 'primary' && !growTabs"
class="border-b border-neutral-300 dark:border-neutral-600 w-2xs shrink-0"
/>
</template>
Expand Down Expand Up @@ -183,11 +190,10 @@ import { themeClasses } from "../utils/theme_tools";
import { TabGroupItemDefinition } from "./TabGroupItem.vue";

// TabGroupVariant is used to determine the styling for a TabGroup
// "classic" is the original design for TabGroup used throughout the product up until May 2024
// "minimal" is the first variant added for a TabGroup which is a child of another TabGroups to use
// "fullsize" is the newest design for TabGroup added in May 2024
// "primary" is the newest design for TabGroup added in May 2024
// "secondary" is the first variant added for a TabGroup which is a child of another TabGroups to use
// If you intend to add another style variant, please update this comment accordingly!
export type TabGroupVariant = "classic" | "minimal" | "fullsize";
export type TabGroupVariant = "primary" | "secondary";

const unmounting = ref(false);
const showOverflowDropdown = ref(false);
Expand All @@ -209,30 +215,30 @@ const props = defineProps({
default: "none",
},
trackingSlug: String,
growTabsToFillWidth: { type: Boolean, default: undefined }, // the "fullsize" variant does this by default
variant: { type: String as PropType<TabGroupVariant>, default: "classic" },
growTabsToFillWidth: { type: Boolean, default: undefined }, // the primary variant does this by default
variant: { type: String as PropType<TabGroupVariant>, default: "primary" },
disableOverflowDropdown: { type: Boolean },
});

const growTabs = computed(() => {
if (
props.growTabsToFillWidth ||
(props.growTabsToFillWidth === undefined && props.variant === "fullsize")
(props.growTabsToFillWidth === undefined && props.variant === "primary")
)
return true;
else return false;
});

const variantStyles = (slug: string) => {
switch (props.variant) {
case "minimal":
case "secondary":
return [
"border-b hover:border-b-2",
slug === selectedTabSlug.value
? "border-current text-action-500 dark:text-action-300 font-bold"
: "border-neutral-300 dark:border-neutral-600 hover:border-shade-100 dark:hover:border-shade-0",
];
case "fullsize":
default: // PRIMARY
return [
"font-bold",
slug === selectedTabSlug.value && slug !== "closeButton"
Expand All @@ -246,16 +252,6 @@ const variantStyles = (slug: string) => {
),
slug === "closeButton" && themeClasses("bg-shade-0", "bg-neutral-800"),
];
default: // CLASSIC
return [
"text-neutral-400 border-b border-neutral-300 dark:border-neutral-600 border-x border-t border-x-neutral-300 border-t-neutral-300 dark:border-x-neutral-600 dark:border-t-neutral-600 rounded-t group-hover:border-shade-100 dark:group-hover:border-shade-0",
slug === selectedTabSlug.value
? "border-b-white dark:border-b-neutral-800 border-b text-action-700 dark:text-action-300 font-bold"
: themeClasses(
"hover:text-neutral-400 font-medium hover:bg-neutral-100",
"hover:text-neutral-300 font-medium hover:bg-neutral-900",
),
];
}
};

Expand Down