New pink v2 tooltips

This commit is contained in:
ernstmul committed 2025-01-03 07:11:35 +01:00
1 parent efdf60c766
commit 1f963be17e
30 files changed
+374 -409

No files matched your search

@@ -1,7 +1,7 @@
<script lang="ts">
import { tooltip } from '$lib/actions/tooltip';
import { formatCurrency } from '$lib/helpers/numbers';
import type { Coupon } from '$lib/sdk/billing';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let couponData: Partial<Coupon> = {
code: null,
@@ -19,9 +19,12 @@
{#if couponData.credits >= 100}
{couponData?.code?.toUpperCase()}
{:else}
<span use:tooltip={{ content: couponData?.code?.toUpperCase() }}>
Credits applied
</span>
<span
><Tooltip
>Credits applied <span slot="tooltip"
>{couponData?.code?.toUpperCase()}</span
></Tooltip
></span>
{/if}
</p>
{#if !fixedCoupon}
+5 -4
View File
@@ -20,7 +20,7 @@
import type { OrganizationUsage } from '$lib/sdk/billing';
import { sdk } from '$lib/stores/sdk';
import { BillingPlan } from '$lib/constants';
import { tooltip } from '$lib/actions/tooltip';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let tier: Tier;
export let members: number;
@@ -74,9 +74,10 @@
<TableCellHead>Resource</TableCellHead>
<TableCellHead>Free limit</TableCellHead>
<TableCellHead>
Excess usage <span
use:tooltip={{ content: 'Metrics are estimates updated every 24 hours' }}
class="icon-info"></span>
Excess usage <Tooltip
><span class="icon-info"></span>
<span slot="tooltip">Metrics are estimates updated every 24 hours</span>
</Tooltip>
</TableCellHead>
</TableHeader>
<TableBody>
+16 -17
View File
@@ -1,23 +1,22 @@
<script lang="ts">
import { tooltip } from '$lib/actions/tooltip';
import { queries, tagFormat, tags } from './store';
import { Tooltip } from '@appwrite.io/pink-svelte';
</script>
{#each $tags as tag (tag)}
<button
use:tooltip={{
content: tag?.value?.toString(),
disabled: Array.isArray(tag.value) ? tag.value?.length < 3 : true
}}
type="button"
class="tag"
on:click|preventDefault={() => {
queries.removeFilter(tag);
queries.apply();
}}>
<span class="text" use:tagFormat>
{tag.tag}
</span>
<i class="icon-x" />
</button>
<Tooltip disabled={Array.isArray(tag.value) ? tag.value?.length < 3 : true}>
<button
type="button"
class="tag"
on:click|preventDefault={() => {
queries.removeFilter(tag);
queries.apply();
}}>
<span class="text" use:tagFormat>
{tag.tag}
</span>
<i class="icon-x" />
</button>
<span slot="tooltip">{tag?.value?.toString()}</span>
</Tooltip>
{/each}
+21 -63
View File
@@ -1,6 +1,5 @@
<script lang="ts">
import { tooltip } from '$lib/actions/tooltip';
import { Card } from '@appwrite.io/pink-svelte';
import { Card, Tooltip } from '@appwrite.io/pink-svelte';
import { type ComponentProps } from 'svelte';
import type Selector from '@appwrite.io/pink-svelte/dist/card/Selector.svelte';
@@ -33,67 +32,26 @@
let slotTitle: HTMLSpanElement;
</script>
<div use:tooltip={{ content: tooltipText, disabled: !tooltipText || !tooltipShow }}>
<Card.Selector
{padding}
{src}
{imageRadius}
{alt}
{variant}
{value}
{disabled}
title={title ?? slotTitle?.innerText}
bind:group>
<p>
<slot />
</p>
</Card.Selector>
</div>
<Tooltip disabled={!tooltipText || !tooltipShow}>
<div>
<Card.Selector
{padding}
{src}
{imageRadius}
{alt}
{variant}
{value}
{disabled}
title={title ?? slotTitle?.innerText}
bind:group>
<p>
<slot />
</p>
</Card.Selector>
</div>
<span slot="tooltip">{tooltipText}</span>
</Tooltip>
<span style="display: none" bind:this={slotTitle}>
<slot name="title" />
</span>
<!-- <label
class="card u-cursor-pointer"
class:is-allow-focus={!disabled}
class:is-disabled={disabled}
class:u-height-100-percent={fullHeight}
style:--card-border-radius={`var(${Radius[borderRadius]})`}
style:--p-card-bg-color-default={backgroundColor}
style:--p-card-bg-color-hover={backgroundColorHover}
use:tooltip={{ content: tooltipText, disabled: !tooltipText || !tooltipShow }}>
<div class="u-flex u-gap-8">
<input
class="is-small u-margin-block-start-2"
type="radio"
{name}
{disabled}
{value}
bind:group
on:click />
{#if $$slots.custom}
<slot name="custom" {disabled} />
{:else}
<div class="u-flex u-flex-vertical u-gap-4" class:u-opacity-50={disabled}>
{#if $$slots.title}
<h4 class="body-text-2 u-bold"><slot name="title" /></h4>
{/if}
{#if $$slots.default}
<p class="u-color-text-gray u-small">
<slot />
</p>
{/if}
</div>
{#if icon}
<span class={`icon-${icon} u-margin-inline-start-auto`} aria-hidden="true" />
{/if}
{#if imageIcon}
<img
class="u-margin-inline-start-auto"
style:max-inline-size="1.25rem"
style:max-block-size="1.25rem"
src={`${base}/icons/${$app.themeInUse}/color/${imageIcon}.svg`}
alt={imageIcon} />
{/if}
{/if}
</div>
</label> -->
@@ -1,6 +1,6 @@
<script lang="ts">
import { tooltip } from '$lib/actions/tooltip';
import type { ProgressbarData, ProgressbarProps } from '$lib/components';
import { Tooltip } from '@appwrite.io/pink-svelte';
type $$Props = ProgressbarProps;
@@ -22,16 +22,16 @@
<section class="progressbar__container">
{#each $$props.data as item}
<div
class="progressbar__content"
style:background-color={item.color}
style:width={`${(item.size / maxSize) * 100}%`}
use:tooltip={{
disabled: !item.tooltip,
allowHTML: true,
content: `<span class="u-bold">${item.tooltip.title}</span> ${item.tooltip.label}`
}}>
</div>
<Tooltip disabled={!item.tooltip}>
<div
class="progressbar__content"
style:background-color={item.color}
style:width={`${(item.size / maxSize) * 100}%`}>
</div>
<div slot="tooltip">
<span class="u-bold">${item.tooltip.title}</span> ${item.tooltip.label}
</div>
</Tooltip>
{/each}
{#if remainder > 0}
<div class="progressbar__content" style:width={`${(remainder / maxSize) * 100}%`} />
+14 -12
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import { trackEvent } from '$lib/actions/analytics';
import { tooltip } from '$lib/actions/tooltip';
import { Copy } from '.';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let show = false;
export let value: string;
@@ -15,17 +15,19 @@
<span class="text">••••••••••••</span>
{/if}
<div class="u-flex u-cross-child-start u-gap-8">
<button
class="interactive-text-output-button"
aria-label="show hidden text"
type="button"
on:click={() => {
show = !show;
trackEvent(`click_secret_${show ? 'show' : 'hide'}`);
}}
use:tooltip={{ content: show ? 'Hide secret' : 'Show secret', hideOnClick: false }}>
<span class:icon-eye-off={show} class:icon-eye={!show} aria-hidden="true" />
</button>
<Tooltip>
<button
class="interactive-text-output-button"
aria-label="show hidden text"
type="button"
on:click={() => {
show = !show;
trackEvent(`click_secret_${show ? 'show' : 'hide'}`);
}}>
<span class:icon-eye-off={show} class:icon-eye={!show} aria-hidden="true" />
</button>
<span slot="tooltip">{show ? 'Hide secret' : 'Show secret'}</span>
</Tooltip>
<Copy {value} event={copyEvent} eventContext="click_secret_copy">
<button class="interactive-text-output-button" aria-label="copy text" type="button">
<span class="icon-duplicate" aria-hidden="true" />
+25 -25
View File
@@ -6,8 +6,8 @@
import { preferences } from '$lib/stores/preferences';
import { onMount } from 'svelte';
import { View } from '$lib/helpers/load';
import { tooltip } from '$lib/actions/tooltip';
import type { Column } from '$lib/helpers/types';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let columns: Writable<Column[]>;
export let view: View;
@@ -113,32 +113,32 @@
<ul class="toggle-button-list">
{#key $page.url}
<li class="toggle-button-item">
<a
href={getViewLink(View.Table)}
on:click={() => updateViewPreferences(View.Table)}
class="toggle-button-element"
aria-label="List View"
type="button"
class:is-selected={view === View.Table}
use:tooltip={{
content: 'List View'
}}>
<span class="icon-view-list" aria-hidden="true" />
</a>
<Tooltip>
<a
href={getViewLink(View.Table)}
on:click={() => updateViewPreferences(View.Table)}
class="toggle-button-element"
aria-label="List View"
type="button"
class:is-selected={view === View.Table}>
<span class="icon-view-list" aria-hidden="true" />
</a>
<span slot="tooltip">List View</span>
</Tooltip>
</li>
<li class="toggle-button-item">
<a
href={getViewLink(View.Grid)}
on:click={() => updateViewPreferences(View.Grid)}
class="toggle-button-element"
aria-label="Grid View"
type="button"
class:is-selected={view === View.Grid}
use:tooltip={{
content: 'Grid View'
}}>
<span class="icon-view-grid" aria-hidden="true" />
</a>
<Tooltip>
<a
href={getViewLink(View.Grid)}
on:click={() => updateViewPreferences(View.Grid)}
class="toggle-button-element"
aria-label="Grid View"
type="button"
class:is-selected={view === View.Grid}>
<span class="icon-view-grid" aria-hidden="true" />
</a>
<span slot="tooltip">Grid View</span>
</Tooltip>
</li>
{/key}
</ul>
+22 -21
View File
@@ -19,6 +19,7 @@
import { Button } from '$lib/elements/forms';
import { BillingPlan } from '$lib/constants';
import { tooltip } from '$lib/actions/tooltip';
import { Tooltip } from '@appwrite.io/pink-svelte';
let selectedRequest = 'parameters';
let selectedResponse = 'logs';
@@ -129,27 +130,27 @@
{/if}
</ul>
<div class="status u-margin-inline-start-auto">
<div
use:tooltip={{
content: `Scheduled to execute on ${toLocaleDateTime(execution.scheduledAt)}`,
disabled:
!execution?.scheduledAt || execution.status !== 'scheduled',
maxWidth: 180
}}>
<Pill
warning={execution.status === 'waiting' ||
execution.status === 'building'}
danger={execution.status === 'failed'}
info={execution.status === 'completed' ||
execution.status === 'ready'}>
{#if execution.status === 'scheduled'}
<span class="icon-clock" aria-hidden="true" />
{timeFromNow(execution.scheduledAt)}
{:else}
{execution.status}
{/if}
</Pill>
</div>
<Tooltip
maxWidth="180px"
disabled={!execution?.scheduledAt || execution.status !== 'scheduled'}>
<div>
<Pill
warning={execution.status === 'waiting' ||
execution.status === 'building'}
danger={execution.status === 'failed'}
info={execution.status === 'completed' ||
execution.status === 'ready'}>
{#if execution.status === 'scheduled'}
<span class="icon-clock" aria-hidden="true" />
{timeFromNow(execution.scheduledAt)}
{:else}
{execution.status}
{/if}
</Pill>
</div>
<span slot="tooltip"
>{`Scheduled to execute on ${toLocaleDateTime(execution.scheduledAt)}`}</span>
</Tooltip>
</div>
</div>
</div>
+17 -17
View File
@@ -40,10 +40,10 @@
import Repositories from './components/repositories.svelte';
import CreateManual from './createManual.svelte';
import CreateGit from './createGit.svelte';
import { tooltip } from '$lib/actions/tooltip';
import { isSelfHosted } from '$lib/system';
import { consoleVariables } from '$routes/(console)/store';
import { featuredTemplatesList, starterTemplate } from '$lib/stores/templates';
import { Tooltip } from '@appwrite.io/pink-svelte';
const isVcsEnabled = $consoleVariables?._APP_VCS_ENABLED === true;
let hasInstallations: boolean;
@@ -168,22 +168,22 @@
{/each}
{#if templates.length < 6}
<li
use:tooltip={{
content: 'More runtimes coming soon'
}}>
<Box
class="u-width-full-line u-flex u-cross-center u-gap-8"
padding={16}
radius="small">
<AvatarGroup
icons={['dotnet', 'deno']}
total={4}
avatarSize="small"
color="u-color-text-gray"
bordered />
</Box>
</li>
<Tooltip>
<li>
<Box
class="u-width-full-line u-flex u-cross-center u-gap-8"
padding={16}
radius="small">
<AvatarGroup
icons={['dotnet', 'deno']}
total={4}
avatarSize="small"
color="u-color-text-gray"
bordered />
</Box>
</li>
<span slot="tooltip">More runtimes coming soon</span>
</Tooltip>
{/if}
{/await}
</ul>
@@ -4,7 +4,7 @@
import { WizardStep } from '$lib/layout';
import { onMount } from 'svelte';
import { template, templateConfig } from '../store';
import { tooltip } from '$lib/actions/tooltip';
import { Tooltip } from '@appwrite.io/pink-svelte';
let templateScopes = [];
onMount(() => {
@@ -36,12 +36,11 @@
<span class="user-profile-info u-flex u-main-space-between u-gap-16">
<div>
<p class="name u-bold">
Public (anyone can execute) <span
class="icon-info"
use:tooltip={{
content:
'You can further customize execute permissions in your function settings.'
}} />
Public (anyone can execute) <Tooltip
><span class="icon-info" /><span slot="tooltip"
>You can further customize execute permissions in your function
settings.</span
></Tooltip>
</p>
<p class="text u-margin-block-start-4">
This could include unauthorized users and bots.
@@ -23,7 +23,7 @@
import { trackEvent } from '$lib/actions/analytics';
import { upgradeURL } from '$lib/stores/billing';
import { Pill } from '$lib/elements';
import { tooltip } from '$lib/actions/tooltip';
import { Tooltip } from '@appwrite.io/pink-svelte';
let offset = 0;
let creditList: CreditList = {
@@ -147,12 +147,13 @@
</TableCellText>
<TableCellText title="expiry date">
{#if credit.status === 'expired'}
<span
use:tooltip={{
content: toLocaleDate(credit.expiration)
}}>
<Pill>Expired</Pill>
</span>
<Tooltip>
<span>
<Pill>Expired</Pill>
</span>
<span slot="tooltip"
>{toLocaleDate(credit.expiration)}</span>
</Tooltip>
{:else}
{toLocaleDate(credit.expiration)}
{/if}
@@ -20,9 +20,9 @@
import DeleteOrgPayment from './deleteOrgPayment.svelte';
import ReplaceCard from './replaceCard.svelte';
import EditPaymentModal from '$routes/(console)/account/payments/editPaymentModal.svelte';
import { tooltip } from '$lib/actions/tooltip';
import PaymentModal from '$lib/components/billing/paymentModal.svelte';
import { user } from '$lib/stores/user';
import { Tooltip } from '@appwrite.io/pink-svelte';
let showDropdown = false;
let showDropdownBackup = false;
@@ -290,13 +290,12 @@
</div>
<div class="common-section u-flex u-cross-center u-gap-4">
<span class="text"> Add a backup payment method </span>
<span
class="icon-info"
style="font-size: var(--icon-size-small)"
use:tooltip={{
content:
'When your default payment method fails, a backup method will be used to pay your invoice automatically'
}} />
<Tooltip>
<span class="icon-info" style="font-size: var(--icon-size-small)" />
<span slot="tooltip"
>When your default payment method fails, a backup method will be
used to pay your invoice automatically</span>
</Tooltip>
</div>
</div>
</article>
@@ -40,6 +40,7 @@
isOwner
} from '$lib/stores/roles';
import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system';
import { Tooltip } from '@appwrite.io/pink-svelte';
let areMembersLimited: boolean;
$: organization.subscribe(() => {
@@ -119,17 +120,17 @@
>FREE</Pill>
{/if}
{#if isCloud && $organization?.billingTrialStartDate && $daysLeftInTrial > 0 && $organization.billingPlan !== BillingPlan.FREE && $plansInfo.get($organization.billingPlan)?.trialDays}
<div
class="u-flex u-cross-center"
use:tooltip={{
content: `Your trial ends on ${toLocaleDate(
<Tooltip>
<div class="u-flex u-cross-center">
<Pill
class="eyebrow-heading-3"
style="--p-tag-content-height:2rem">TRIAL</Pill>
</div>
<span slot="tooltip"
>{`Your trial ends on ${toLocaleDate(
$organization.billingStartDate
)}. ${$daysLeftInTrial} days remaining.`
}}>
<Pill
class="eyebrow-heading-3"
style="--p-tag-content-height:2rem">TRIAL</Pill>
</div>
)}. ${$daysLeftInTrial} days remaining.`}</span>
</Tooltip>
{/if}
</span>
<span
@@ -160,26 +161,25 @@
<a href={`${path}/members`} class="is-not-mobile">
<AvatarGroup size={40} {avatars} total={$members?.total ?? 0} />
</a>
<div
use:tooltip={{
content:
$organization?.billingPlan === BillingPlan.FREE
? `Upgrade to add more members`
: `You've reached the members limit for the ${
tierToPlan($organization?.billingPlan)?.name
} plan`,
disabled: !areMembersLimited
}}>
{#if $isOwner}
<Button
secondary
on:click={() => newMemberModal.set(true)}
disabled={areMembersLimited}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Invite</span>
</Button>
{/if}
</div>
<Tooltip disabled={!areMembersLimited}>
<div>
{#if $isOwner}
<Button
secondary
on:click={() => newMemberModal.set(true)}
disabled={areMembersLimited}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Invite</span>
</Button>
{/if}
</div>
<span slot="tooltip"
>{$organization?.billingPlan === BillingPlan.FREE
? `Upgrade to add more members`
: `You've reached the members limit for the ${
tierToPlan($organization?.billingPlan)?.name
} plan`}</span>
</Tooltip>
</div>
</div>
</svelte:fragment>
@@ -1,5 +1,4 @@
<script lang="ts">
import { tooltip } from '$lib/actions/tooltip';
import { AvatarInitials, CardGrid, Heading, Paginator } from '$lib/components';
import { EmptyCardCloud } from '$lib/components/billing';
import { BillingPlan } from '$lib/constants';
@@ -18,6 +17,7 @@
import { plansInfo, tierToPlan } from '$lib/stores/billing';
import { newMemberModal, organization } from '$lib/stores/organization';
import type { Models } from '@appwrite.io/console';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let members: Models.MembershipList;
@@ -43,11 +43,11 @@
</div>
<p class="body-text-2">
Unlimited
<span
class="icon-info"
use:tooltip={{
content: `You can add unlimited organization members on the ${tierToPlan($organization.billingPlan).name} plan ${$organization.billingPlan === BillingPlan.PRO ? `for ${formatCurrency(plan.addons.member.price)} each per billing period.` : '.'}`
}}></span>
<Tooltip>
<span class="icon-info"></span>
<span slot="tooltip"
>{`You can add unlimited organization members on the ${tierToPlan($organization.billingPlan).name} plan ${$organization.billingPlan === BillingPlan.PRO ? `for ${formatCurrency(plan.addons.member.price)} each per billing period.` : '.'}`}</span>
</Tooltip>
</p>
</div>
<Paginator
@@ -21,8 +21,7 @@
import { writable } from 'svelte/store';
import type { PageData } from './$types';
import Create from './createUser.svelte';
import { tooltip } from '$lib/actions/tooltip';
import { Badge, Icon, Table, Layout } from '@appwrite.io/pink-svelte';
import { Badge, Icon, Table, Layout, Tooltip } from '@appwrite.io/pink-svelte';
import { Tag } from '@appwrite.io/pink-svelte';
import { IconDuplicate } from '@appwrite.io/pink-icons-svelte';
import { canWriteUsers } from '$lib/stores/roles';
@@ -39,19 +38,18 @@
<ContainerHeader title="Users" isFlex={false} total={data.users.total} let:isButtonDisabled>
<SearchQuery search={data.search} placeholder="Search by name, email, phone, or ID">
{#if $canWriteUsers}
<div
use:tooltip={{
content: `Upgrade to add more users`,
disabled: !isButtonDisabled
}}>
<Button
on:mousedown={() => ($showCreateUser = true)}
event="create_user"
disabled={isButtonDisabled}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create user</span>
</Button>
</div>
<Tooltip disabled={!isButtonDisabled}>
<div>
<Button
on:mousedown={() => ($showCreateUser = true)}
event="create_user"
disabled={isButtonDisabled}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create user</span>
</Button>
</div>
<span slot="tooltip">Upgrade to add more users</span>
</Tooltip>
{/if}
</SearchQuery>
</ContainerHeader>
@@ -164,12 +164,14 @@
required>
<button
slot="options"
use:tooltip={{ content: 'Regenerate', placement: 'bottom' }}
on:click={() => (number.phone = generateNumber())}
class="options-list-button"
aria-label="regenerate text"
type="button">
<span class="icon-refresh" aria-hidden="true"></span>
<Tooltip>
<span class="icon-refresh" aria-hidden="true"></span>
<span slot="tooltip">Regenerate</span>
</Tooltip>
</button>
</InputPhone>
<InputOTP
@@ -33,6 +33,7 @@
import { readOnly } from '$lib/stores/billing';
import { isCloud } from '$lib/system';
import { canWriteTeams } from '$lib/stores/roles';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let data: PageData;
@@ -51,19 +52,18 @@
let:isButtonDisabled>
<SearchQuery search={data.search} placeholder="Search by name">
{#if $canWriteTeams}
<div
use:tooltip={{
content: `Upgrade to add more teams`,
disabled: !isButtonDisabled
}}>
<Button
on:click={() => ($showCreateTeam = true)}
event="create_team"
disabled={isButtonDisabled}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create team</span>
</Button>
</div>
<Tooltip disabled={!isButtonDisabled}>
<div>
<Button
on:click={() => ($showCreateTeam = true)}
event="create_team"
disabled={isButtonDisabled}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create team</span>
</Button>
</div>
<span slot="tooltip">Upgrade to add more teams</span>
</Tooltip>
{/if}
</SearchQuery>
</ContainerHeader>
@@ -15,6 +15,7 @@
import { registerCommands } from '$lib/commandCenter';
import { tooltip } from '$lib/actions/tooltip';
import { canWriteDatabases } from '$lib/stores/roles';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let data: PageData;
@@ -57,19 +58,18 @@
hideColumns={!data.databases.total}
hideView={!data.databases.total} />
{#if $canWriteDatabases}
<div
use:tooltip={{
content: `Upgrade to add more databases`,
disabled: !isCreationDisabled
}}>
<Button
on:click={() => (showCreate = true)}
event="create_database"
disabled={isCreationDisabled}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create database</span>
</Button>
</div>
<Tooltip disabled={!isCreationDisabled}>
<div>
<Button
on:click={() => (showCreate = true)}
event="create_database"
disabled={isCreationDisabled}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create database</span>
</Button>
</div>
<span slot="tooltip">Upgrade to add more databases</span>
</Tooltip>
{/if}
</div>
</svelte:fragment>
@@ -18,6 +18,7 @@
import type { BackupPolicy, BackupPolicyList } from '$lib/sdk/backups';
import { backupFrequencies } from '$lib/helpers/backups';
import { trackEvent } from '$lib/actions/analytics';
import { Tooltip } from '@appwrite.io/pink-svelte';
let showDropdown = [];
let showDelete = false;
@@ -180,9 +181,12 @@
class="policy-item-subtitles u-flex u-gap-6"
style="width: fit-content;">
{#if shouldUseTooltip}
<span use:tooltip={{ content: policyDescription }}>
{policyDescriptionShort}
</span>
<Tooltip>
<span>
{policyDescriptionShort}
</span>
<span slot="tooltip">{policyDescription}</span>
</Tooltip>
{:else}
{policyDescription}
{/if}
@@ -27,6 +27,7 @@
import { copy } from '$lib/helpers/copy';
import { LabelCard } from '$lib/components/index.js';
import { Dependencies } from '$lib/constants';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let data: PageData;
@@ -155,12 +156,12 @@
<TableRow>
<TableCellCheck id={backup.$id} bind:selectedIds={selectedBackups} />
<TableCell title={backup.$createdAt}>
<span
use:tooltip={{
content: timeFromNow(backup.$createdAt)
}}>
{cleanBackupName(backup)}
</span>
<Tooltip>
<span>
{cleanBackupName(backup)}
</span>
<span slot="tooltip">{timeFromNow(backup.$createdAt)}</span>
</Tooltip>
</TableCell>
<TableCell title="Backup Size">
{#if backup.status === 'completed'}
@@ -184,14 +185,15 @@
</TableCell>
<TableCell title="Backup Policy">
<div class="u-flex u-main-space-between u-cross-baseline">
<span
use:tooltip={{
content: policy
<Tooltip>
<span>
{policy?.name || 'Manual'}
</span>
<span slot="tooltip"
>{policy
? `Retained until: ${formattedRetainedUntil}`
: `Retained forever`
}}>
{policy?.name || 'Manual'}
</span>
: `Retained forever`}</span>
</Tooltip>
</div>
</TableCell>
@@ -3,7 +3,6 @@
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
import { tooltip } from '$lib/actions/tooltip';
import { Alert, FloatingActionBar, Id, Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button, InputChoice } from '$lib/elements/forms';
@@ -31,6 +30,7 @@
import { clickOnEnter } from '$lib/helpers/a11y';
import type { ColumnType } from '$lib/helpers/types';
import { toLocaleDateTime } from '$lib/helpers/date';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let data: PageData;
@@ -221,15 +221,12 @@
{:else}
{@const formatted = formatColumn(document[column.id])}
<TableCell>
<div
class="u-width-fit-content"
use:tooltip={{
content: formatted.whole,
disabled: !formatted.truncated
}}
data-private>
{formatted.value}
</div>
<Tooltip disabled={!formatted.truncated}>
<div class="u-width-fit-content" data-private>
{formatted.value}
</div>
<span>{formatted.whole}</span>
</Tooltip>
</TableCell>
{/if}
{/if}
@@ -26,6 +26,7 @@
import type { PageData } from './$types';
import { columns } from './store';
import Cell from '$lib/elements/table/cell.svelte';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let data: PageData;
const projectId = $page.params.project;
@@ -111,19 +112,16 @@
.join(', ')}
<Cell title={column.title} width={column.width}>
<span
class="u-trim"
use:tooltip={{
placement: 'bottom',
disabled: !policies || !lastBackup,
content: `Last backup: ${lastBackup}`
}}>
{#if !policies}
<span class="icon-exclamation" /> No backup policies
{:else}
{description}
{/if}
</span>
<Tooltip placement="bottom" disabled={!policies || !lastBackup}>
<span class="u-trim">
{#if !policies}
<span class="icon-exclamation" /> No backup policies
{:else}
{description}
{/if}
</span>
<span slot="tooltip">{`Last backup: ${lastBackup}`}</span>
</Tooltip>
</Cell>
{:else}
<TableCellText width={column.width} title={column.title}>
@@ -28,6 +28,7 @@
import { functionsList } from './store';
import { canWriteFunctions } from '$lib/stores/roles';
import type { Models } from '@appwrite.io/console';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let data;
@@ -113,13 +114,12 @@
<svelte:fragment slot="icons">
{#if func.schedule}
<li>
<span
class="icon-clock"
aria-hidden="true"
use:tooltip={{
content: `Next execution:
${getNextScheduledExecution(func)}`
}} />
<Tooltip>
<span class="icon-clock" aria-hidden="true" />
<span slot="tooltip"
>{`Next execution:
${getNextScheduledExecution(func)}`}</span>
</Tooltip>
</li>
{/if}
</svelte:fragment>
@@ -46,6 +46,7 @@
import CreateManual from './wizard/createManual.svelte';
import { repository } from '$lib/stores/vcs';
import { Repositories } from '$lib/components/git';
import { Tooltip } from '@appwrite.io/pink-svelte';
const isVcsEnabled = $consoleVariables?._APP_VCS_ENABLED === true;
let hasInstallations: boolean;
@@ -175,22 +176,22 @@
{/each}
{#if templates.length < 6}
<li
use:tooltip={{
content: 'More runtimes coming soon'
}}>
<Box
class="u-width-full-line u-flex u-cross-center u-gap-8"
padding={16}
radius="small">
<AvatarGroup
icons={['dotnet', 'deno']}
total={4}
avatarSize="small"
color="u-color-text-gray"
bordered />
</Box>
</li>
<Tooltip inline={false}>
<li>
<Box
class="u-width-full-line u-flex u-cross-center u-gap-8"
padding={16}
radius="small">
<AvatarGroup
icons={['dotnet', 'deno']}
total={4}
avatarSize="small"
color="u-color-text-gray"
bordered />
</Box>
</li>
<span>More runtimes coming soon</span>
</Tooltip>
{/if}
{/await}
</ul>
@@ -4,7 +4,7 @@
import { WizardStep } from '$lib/layout';
import { onMount } from 'svelte';
import { template, templateConfig } from '../../store';
import { tooltip } from '$lib/actions/tooltip';
import { Tooltip } from '@appwrite.io/pink-svelte';
let templateScopes = [];
onMount(() => {
@@ -36,12 +36,12 @@
<span class="user-profile-info u-flex u-main-space-between u-gap-16">
<div>
<p class="name u-bold">
Public (anyone can execute) <span
class="icon-info"
use:tooltip={{
content:
'You can further customize execute permissions in your function settings.'
}} />
Public (anyone can execute) <Tooltip
><span class="icon-info" />
<span
>You can further customize execute permissions in your function
settings.</span>
</Tooltip>
</p>
<p class="text u-margin-block-start-4">
This could include unauthorized users and bots.
@@ -19,6 +19,7 @@
import { func } from '../store';
import Delete from './delete.svelte';
import { Button } from '$lib/elements/forms';
import { Tooltip } from '@appwrite.io/pink-svelte';
let showDropdown = [];
let showDelete = false;
@@ -64,23 +65,24 @@
{:else if column.id === 'status'}
<TableCell width={column.width} title={column.title}>
{@const status = execution.status}
<div
use:tooltip={{
content: `Scheduled to execute on ${toLocaleDateTime(execution.scheduledAt)}`,
disabled: !execution?.scheduledAt || status !== 'scheduled'
}}>
<Pill
warning={status === 'waiting' || status === 'building'}
danger={status === 'failed'}
info={status === 'completed' || status === 'ready'}>
{#if status === 'scheduled'}
<span class="icon-clock" aria-hidden="true" />
{timeFromNow(execution.scheduledAt)}
{:else}
{status}
{/if}
</Pill>
</div>
<Tooltip
disabled={!execution?.scheduledAt || status !== 'scheduled'}>
<div>
<Pill
warning={status === 'waiting' || status === 'building'}
danger={status === 'failed'}
info={status === 'completed' || status === 'ready'}>
{#if status === 'scheduled'}
<span class="icon-clock" aria-hidden="true" />
{timeFromNow(execution.scheduledAt)}
{:else}
{status}
{/if}
</Pill>
</div>
<span slot="tooltip"
>{`Scheduled to execute on ${toLocaleDateTime(execution.scheduledAt)}`}</span>
</Tooltip>
</TableCell>
{:else if column.id === '$createdAt'}
<TableCellText width={column.width} title={column.title}>
@@ -2,7 +2,6 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { tooltip } from '$lib/actions/tooltip.js';
import {
Collapsible,
CollapsibleItem,
@@ -21,6 +20,7 @@
import type { Models } from '@appwrite.io/console';
import { functionsList } from '../store';
import { debounce } from '$lib/helpers/debounce';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let data;
@@ -228,15 +228,15 @@
{/each}
{#if hidden.length}
<li class="avatars-group-item">
<div
class="avatar is-size-small"
use:tooltip={{
content: hidden
<Tooltip>
<div class="avatar is-size-small">
+{hidden.length}
</div>
<span slot="tooltip"
>{hidden
.map((n) => n.name)
.join(', ')
}}>
+{hidden.length}
</div>
.join(', ')}</span>
</Tooltip>
</li>
{/if}
</ul>
@@ -9,12 +9,12 @@
import Create from './create.svelte';
import { Container, ContainerHeader } from '$lib/layout';
import { base } from '$app/paths';
import { tooltip } from '$lib/actions/tooltip';
import { page } from '$app/stores';
import type { Models } from '@appwrite.io/console';
import { writable } from 'svelte/store';
import type { PageData } from './$types';
import { canWriteBuckets } from '$lib/stores/roles';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let data: PageData;
@@ -54,26 +54,28 @@
<svelte:fragment slot="icons">
<li>
<span
class:u-opacity-20={!bucket.encryption}
class="icon-lock-closed"
aria-hidden="true"
use:tooltip={{
content: bucket.encryption
<Tooltip>
<span
class:u-opacity-20={!bucket.encryption}
class="icon-lock-closed"
aria-hidden="true" />
<span slot="tooltip"
>{bucket.encryption
? 'Encryption enabled'
: 'Encryption disabled'
}} />
: 'Encryption disabled'}</span>
</Tooltip>
</li>
<li>
<span
class:u-opacity-20={!bucket.antivirus}
class="icon-shield-check"
aria-hidden="true"
use:tooltip={{
content: bucket.antivirus
<Tooltip>
<span
class:u-opacity-20={!bucket.antivirus}
class="icon-shield-check"
aria-hidden="true" />
<span slot="tooltip"
>{bucket.antivirus
? 'Antivirus enabled'
: 'Antivirus disabled'
}} />
: 'Antivirus disabled'}</span>
</Tooltip>
</li>
</svelte:fragment>
</GridItem1>
@@ -44,12 +44,12 @@
import { addNotification } from '$lib/stores/notifications';
import { uploader } from '$lib/stores/uploader';
import { wizard } from '$lib/stores/wizard';
import { tooltip } from '$lib/actions/tooltip';
import { getServiceLimit, showUsageRatesModal, tierToPlan } from '$lib/stores/billing';
import { sdk } from '$lib/stores/sdk.js';
import Create from './create-file/create.svelte';
import DeleteFile from './deleteFile.svelte';
import { isCloud } from '$lib/system';
import { Tooltip } from '@appwrite.io/pink-svelte';
export let data;
@@ -96,19 +96,18 @@
<ContainerHeader title="Files" serviceId="storage" isFlex={false} total={usedStorage}>
<svelte:fragment let:isButtonDisabled>
<SearchQuery search={data.search} placeholder="Search by filename">
<div
use:tooltip={{
content: `Upgrade to add more files`,
disabled: !isButtonDisabled
}}>
<Button
on:click={() => wizard.start(Create)}
event="create_file"
disabled={isButtonDisabled}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create file</span>
</Button>
</div>
<Tooltip disabled={!isButtonDisabled}>
<div>
<Button
on:click={() => wizard.start(Create)}
event="create_file"
disabled={isButtonDisabled}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create file</span>
</Button>
</div>
<span slot="tooltip">Upgrade to add more files</span>
</Tooltip>
</SearchQuery>
</svelte:fragment>
<svelte:fragment slot="tooltip" let:limit let:tier let:upgradeMethod>
+5 -8
View File
@@ -7,6 +7,7 @@
import Badge from './hackathon-badge.svg';
import { tooltip } from '$lib/actions/tooltip';
import { base } from '$app/paths';
import { Tooltip } from '@appwrite.io/pink-svelte';
</script>
<svelte:head>
@@ -71,14 +72,10 @@
</section>
<section class="ht-img">
<div class="card ht-card ht-card-main u-flex u-cross-center u-main-center">
<img
height="200"
width="200"
src={Badge}
alt="hackathon-badge"
use:tooltip={{
content: 'Join the hackathon to unlock this badge'
}} />
<Tooltip>
<img height="200" width="200" src={Badge} alt="hackathon-badge" />
<span slot="tooltip">Join the hackathon to unlock this badge</span>
</Tooltip>
</div>
<div class="card ht-card u-flex u-flex-vertical">
<div class="ht-tag ht-tag-primary u-cross-child-center">