-
Notifications
You must be signed in to change notification settings - Fork 152
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
feat: pink v2 cleanup #1621
feat: pink v2 cleanup #1621
Conversation
|
||
<svelte:component this={wrapper} {fullWidth}> | ||
<Label {required} {optionalText} hide={!showLabel} for={id}> | ||
{label} | ||
</Label> | ||
<Label {required} {optionalText} hide={!showLabel} for={id}> | ||
{label} | ||
</Label> | ||
|
||
<div class="input-text-wrapper"> | ||
<input | ||
{id} | ||
{disabled} | ||
{readonly} | ||
{required} | ||
step=".001" | ||
{min} | ||
{max} | ||
autocomplete={autocomplete ? 'on' : 'off'} | ||
type="date" | ||
style={disabled ? '' : 'cursor: pointer;'} | ||
class="input-text" | ||
bind:value | ||
bind:this={element} | ||
on:invalid={handleInvalid} | ||
on:click={function () { | ||
this.showPicker(); | ||
}} | ||
style:--amount-of-buttons={isNullable ? 2.75 : 1} | ||
style:--button-size={isNullable ? '2rem' : '1rem'} /> | ||
{#if isNullable} | ||
<ul | ||
class="buttons-list u-cross-center u-gap-8 u-position-absolute u-inset-block-start-8 u-inset-block-end-8 u-inset-inline-end-12"> | ||
<li class="buttons-list-item"> | ||
<NullCheckbox checked={value === null} on:change={handleNullChange} /> | ||
</li> | ||
</ul> | ||
{/if} | ||
</div> | ||
{#if error} | ||
<Helper type="warning">{error}</Helper> | ||
<div class="input-text-wrapper"> | ||
<input | ||
{id} | ||
{disabled} | ||
{readonly} | ||
{required} | ||
step=".001" | ||
{min} | ||
{max} | ||
autocomplete={autocomplete ? 'on' : 'off'} | ||
type="date" | ||
style={disabled ? '' : 'cursor: pointer;'} | ||
class="input-text" | ||
bind:value | ||
bind:this={element} | ||
on:invalid={handleInvalid} | ||
on:click={function () { | ||
this.showPicker(); | ||
}} | ||
style:--amount-of-buttons={isNullable ? 2.75 : 1} | ||
style:--button-size={isNullable ? '2rem' : '1rem'} /> | ||
{#if isNullable} | ||
<ul | ||
class="buttons-list u-cross-center u-gap-8 u-position-absolute u-inset-block-start-8 u-inset-block-end-8 u-inset-inline-end-12"> | ||
<li class="buttons-list-item"> | ||
<NullCheckbox checked={value === null} on:change={handleNullChange} /> | ||
</li> | ||
</ul> | ||
{/if} | ||
</svelte:component> | ||
</div> | ||
{#if error} | ||
<Helper type="warning">{error}</Helper> | ||
{/if} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to wrap the component in a Stack
otherwise the label and the error might be have the wrong gap with the input depending on the parent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah, these should be replaced completely anyway by pinkv2 component
<Label {required} {optionalText} hide={!showLabel} for={id}> | ||
{label} | ||
</Label> | ||
|
||
<div class="input-text-wrapper"> | ||
<input | ||
{id} | ||
{disabled} | ||
{readonly} | ||
{required} | ||
{value} | ||
{step} | ||
autocomplete={autocomplete ? 'on' : 'off'} | ||
type="datetime-local" | ||
class="input-text" | ||
bind:this={element} | ||
on:input={handleInput} | ||
on:invalid={handleInvalid} | ||
style:--amount-of-buttons={isNullable ? 2.75 : 1} | ||
style:--button-size={isNullable ? '2rem' : '1rem'} /> | ||
{#if isNullable} | ||
<ul | ||
class="buttons-list u-cross-center u-gap-8 u-position-absolute u-inset-block-start-8 u-inset-block-end-8 u-inset-inline-end-12"> | ||
<li class="buttons-list-item"> | ||
<NullCheckbox checked={value === null} on:change={handleNullChange} /> | ||
</li> | ||
</ul> | ||
{/if} | ||
</div> | ||
{#if error} | ||
<Helper type="warning">{error}</Helper> | ||
<div class="input-text-wrapper"> | ||
<input | ||
{id} | ||
{disabled} | ||
{readonly} | ||
{required} | ||
{value} | ||
{step} | ||
autocomplete={autocomplete ? 'on' : 'off'} | ||
type="datetime-local" | ||
class="input-text" | ||
bind:this={element} | ||
on:input={handleInput} | ||
on:invalid={handleInvalid} | ||
style:--amount-of-buttons={isNullable ? 2.75 : 1} | ||
style:--button-size={isNullable ? '2rem' : '1rem'} /> | ||
{#if isNullable} | ||
<ul | ||
class="buttons-list u-cross-center u-gap-8 u-position-absolute u-inset-block-start-8 u-inset-block-end-8 u-inset-inline-end-12"> | ||
<li class="buttons-list-item"> | ||
<NullCheckbox checked={value === null} on:change={handleNullChange} /> | ||
</li> | ||
</ul> | ||
{/if} | ||
</FormItem> | ||
</div> | ||
{#if error} | ||
<Helper type="warning">{error}</Helper> | ||
{/if} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one need to be wrapped too
<div class="options-list"> | ||
<slot name="options" /> | ||
</div> | ||
{#if label} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be wrapped?
{/if} | ||
|
||
<div class="input-text-wrapper"> | ||
<input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an OTP component in Pink 2
</div> | ||
<input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have input Tags in Pink 2
</Drop> | ||
{/if} | ||
</Label> | ||
<input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap
<Label {required} {optionalText} hide={!showLabel} for={id}> | ||
{label} | ||
</Label> | ||
<Label {required} {optionalText} hide={!showLabel} for={id}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap
@@ -347,7 +346,7 @@ | |||
Logs are retained in rolling {hoursToDays(limit)} intervals | |||
with the {tier} plan. | |||
{#if $organization.billingPlan === BillingPlan.FREE} | |||
<Button link href={$upgradeURL}>Upgrade</Button> to increase | |||
<Button href={$upgradeURL}>Upgrade</Button> to increase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use the Link
component here
@@ -259,7 +258,7 @@ | |||
<Label class="label u-margin-block-start-16">Select plan</Label> | |||
<p class="text"> | |||
For more details on our plans, visit our | |||
<Button href="https://appwrite.io/pricing" external link>pricing page</Button>. | |||
<Button href="https://appwrite.io/pricing" external>pricing page</Button>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Link
component
per resource listed below. <Button on:click={() => ($showUsageRatesModal = true)} | ||
>Learn more about plan usage limits.</Button> | ||
</p> | ||
{:else if $organization.billingPlan === BillingPlan.PRO} | ||
<p class="text"> | ||
On the Pro plan, you'll be charged only for any usage that exceeds the thresholds | ||
per resource listed below. <Button | ||
on:click={() => ($showUsageRatesModal = true)} | ||
link>Learn more about plan usage limits.</Button> | ||
per resource listed below. <Button on:click={() => ($showUsageRatesModal = true)} | ||
>Learn more about plan usage limits.</Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link
component
…to feat-pink-v2-partly-cleanup
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)