Skip to content

Commit

Permalink
Padding, border-radius fixes (#2062)
Browse files Browse the repository at this point in the history
* Small padding fixes

* Styling to unround search attributes

* Add padding-top to loading on labs mode to better center the logo

* Fix datetime rounded, fix max height on menu, add gap

* Unround boolean filter
  • Loading branch information
Alex-Tideman authored Apr 30, 2024
1 parent 340ed37 commit ee67885
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 38 deletions.
4 changes: 1 addition & 3 deletions src/lib/components/schedule/schedules-interval-view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<p>
{translate('schedules.offset-description')}
</p>
<div class="flex w-48 gap-0">
<div class="flex w-48 gap-2">
<Input
id="phase"
class="w-28"
Expand All @@ -111,12 +111,10 @@
maxLength={3}
hideCount
error={error(phase)}
unroundRight
/>
<Select
label={translate('schedules.offset-unit')}
labelHidden
unroundLeft
id="phase-unit"
bind:value={offsetUnit}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

<MenuContainer>
<MenuButton
unroundLeft
class="!border-l-0"
id="boolean-filter"
controls="boolean-filter-menu"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

<MenuContainer>
<MenuButton
unround
class="{noBorderRight ? '!border-r-0' : ''} {noBorderLeft
? '!border-l-0'
: ''} whitespace-nowrap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
/>
<MenuContainer>
<MenuButton
unroundLeft
id="time-range-filter"
controls="time-range-filter-menu"
class="whitespace-nowrap"
Expand All @@ -148,7 +147,7 @@
<Menu
keepOpen
id="time-range-filter-menu"
class="w-[27rem] !overflow-visible"
class="max-h-fit w-[27rem] !overflow-visible"
>
{#if isTimeRange}
<MenuItem>
Expand Down Expand Up @@ -198,20 +197,18 @@
name="time-filter-type"
group={type}
/>
<div class="ml-6 flex gap-0 pt-2">
<div class="ml-6 flex gap-2 pt-2">
<Input
label={translate('common.relative')}
labelHidden
id="relative-datetime-input"
bind:value={relativeTime}
placeholder="00"
error={error(relativeTime)}
unroundRight
class="h-10"
disabled={$type !== 'relative'}
/>
<Select
unroundLeft
bind:value={timeUnit}
id="relative-datetime-unit-input"
label={translate('common.time-unit')}
Expand Down
13 changes: 13 additions & 0 deletions src/lib/components/workflow/filter-search/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,17 @@
.filter {
@apply grow;
}
:global(.attribute-selected) {
@apply rounded-r-none;
}
:global(#conditional-menu-button) {
@apply rounded-none;
}
:global(#time-range-filter),
:global(#boolean-filter) {
@apply rounded-l-none;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@
<MenuContainer>
<MenuButton
controls="search-attribute-menu"
unroundRight={Boolean($filter.attribute)}
disabled={$activeQueryIndex !== null}
count={$filter.attribute ? 0 : $workflowFilters.length}
on:click={() => (searchAttributeValue = '')}
class="text-nowrap"
class="text-nowrap {!!$filter.attribute && 'attribute-selected'}"
>
<svelte:fragment slot="leading">
{#if !$filter.attribute}
Expand Down
3 changes: 0 additions & 3 deletions src/lib/holocene/menu/menu-button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
hasIndicator?: boolean;
id?: string;
label?: string;
unround?: boolean;
unroundRight?: boolean;
unroundLeft?: boolean;
variant?: MenuButtonVariant;
class?: string;
active?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/holocene/menu/menu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<ul
in:fly={{ duration: 100 }}
role="menu"
class={merge('menu', position, className)}
class={merge(['menu', 'max-h-[320px]'], position, className)}
class:hidden={!$open}
aria-labelledby={id}
tabindex={-1}
Expand All @@ -58,7 +58,7 @@

<style lang="postcss">
.menu {
@apply surface-primary absolute z-20 mt-1 max-h-[320px] min-w-full list-none overflow-auto rounded-lg border border-primary text-primary shadow;
@apply surface-primary absolute z-20 mt-1 min-w-full list-none overflow-auto rounded-lg border border-primary text-primary shadow;
&.left {
@apply left-0 origin-top-left;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/holocene/radio-input/radio-group.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
});
</script>

<div class={merge('flex flex-col gap-2', className)} {...$$restProps}>
<div class={merge('flex flex-col gap-2 p-1', className)} {...$$restProps}>
{#if description}
<p class="font-secondary text-sm font-medium">{description}</p>
{/if}
Expand Down
12 changes: 0 additions & 12 deletions src/lib/holocene/select/select.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
leadingIcon: undefined,
labelHidden: false,
disabled: false,
unroundLeft: false,
unroundRight: false,
},
argTypes: {
label: { name: 'Label', control: 'text' },
Expand All @@ -29,16 +27,6 @@
},
disabled: { name: 'Disabled', control: 'boolean' },
labelHidden: { name: 'Label Hidden', control: 'boolean' },
unroundLeft: {
name: 'Left',
control: 'boolean',
table: { category: 'Styling', subcategory: 'Unround' },
},
unroundRight: {
name: 'Right',
control: 'boolean',
table: { category: 'Styling', subcategory: 'Unround' },
},
onChange: { table: { disable: true } },
value: { table: { disable: true } },
},
Expand Down
6 changes: 0 additions & 6 deletions src/lib/holocene/select/select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
placeholder?: string;
disabled?: boolean;
leadingIcon?: IconName;
unroundRight?: boolean;
unroundLeft?: boolean;
onChange?: (value: T) => void;
'data-testid'?: string;
variant?: MenuButtonVariant;
Expand All @@ -55,8 +53,6 @@
export let placeholder = '';
export let disabled = false;
export let leadingIcon: IconName = null;
export let unroundRight = false;
export let unroundLeft = false;
export let onChange: (value: T) => void = noop;
export let variant: MenuButtonVariant = 'secondary';
Expand Down Expand Up @@ -107,8 +103,6 @@
<MenuButton
hasIndicator={!disabled}
{disabled}
{unroundLeft}
{unroundRight}
controls="{id}-select"
{variant}
>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/holocene/split-button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{label}
</Button>
<MenuButton
class="max-w-fit grow-0 px-1"
class="max-w-fit grow-0 px-3"
id="{id}-menu-button"
label={menuLabel}
controls="{id}-menu"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/layouts/workflow-run-layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
{#if workflowError}
<WorkflowError error={workflowError} />
{:else if !$workflowRun.workflow}
<Loading />
<Loading class="pt-24" />
{:else}
<div class="px-8 pt-24 md:pt-20">
<WorkflowHeader namespace={$page.params.namespace} />
Expand Down

0 comments on commit ee67885

Please sign in to comment.