Skip to content

Commit 5924009

Browse files
chore: align base components size prop values (#2069)
Co-authored-by: Willow (GHOST) <git@willow.sh>
1 parent 4294ada commit 5924009

33 files changed

+57
-72
lines changed

app/components/Button/Base.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const props = withDefaults(
1515
type?: 'button' | 'submit'
1616
/** @default "secondary" */
1717
variant?: 'primary' | 'secondary'
18-
/** @default "medium" */
19-
size?: 'small' | 'medium'
18+
/** @default "md" */
19+
size?: 'sm' | 'md'
2020
/** Keyboard shortcut hint */
2121
ariaKeyshortcuts?: string
2222
/** Forces the button to occupy the entire width of its container. */
@@ -27,7 +27,7 @@ const props = withDefaults(
2727
{
2828
type: 'button',
2929
variant: 'secondary',
30-
size: 'medium',
30+
size: 'md',
3131
},
3232
)
3333
@@ -48,8 +48,8 @@ defineExpose({
4848
:class="{
4949
'inline-flex': !block,
5050
'flex': block,
51-
'text-sm px-4 py-2': size === 'medium',
52-
'text-xs px-2 py-0.5': size === 'small',
51+
'text-sm px-4 py-2': size === 'md',
52+
'text-xs px-2 py-0.5': size === 'sm',
5353
'bg-transparent text-fg hover:enabled:(bg-fg/10) focus-visible:enabled:(bg-fg/10) aria-pressed:(bg-fg/10 border-fg/20 hover:enabled:(bg-fg/20 text-fg/50))':
5454
variant === 'secondary',
5555
'text-bg bg-fg hover:enabled:(bg-fg/50) focus-visible:enabled:(bg-fg/50) aria-pressed:(bg-fg text-bg border-fg hover:enabled:(text-bg/50))':

app/components/Button/ButtonBase.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const Secondary: Story = {
5252

5353
export const Small: Story = {
5454
args: {
55-
size: 'small',
55+
size: 'sm',
5656
},
5757
render: args => ({
5858
components: { ButtonBase },

app/components/Compare/FacetSelector.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function isCategoryNoneSelected(category: string): boolean {
4040
:aria-pressed="isCategoryAllSelected(category)"
4141
:disabled="isCategoryAllSelected(category)"
4242
@click="selectCategory(category)"
43-
size="small"
43+
size="sm"
4444
>
4545
{{ $t('compare.facets.all') }}
4646
</ButtonBase>
@@ -52,7 +52,7 @@ function isCategoryNoneSelected(category: string): boolean {
5252
:aria-pressed="isCategoryNoneSelected(category)"
5353
:disabled="isCategoryNoneSelected(category)"
5454
@click="deselectCategory(category)"
55-
size="small"
55+
size="sm"
5656
>
5757
{{ $t('compare.facets.none') }}
5858
</ButtonBase>
@@ -64,7 +64,7 @@ function isCategoryNoneSelected(category: string): boolean {
6464
<ButtonBase
6565
v-for="facet in facetsByCategory[category]"
6666
:key="facet.id"
67-
size="small"
67+
size="sm"
6868
:title="facet.comingSoon ? $t('compare.facets.coming_soon') : facet.description"
6969
:disabled="facet.comingSoon"
7070
:aria-pressed="isFacetSelected(facet.id)"

app/components/Compare/PackageSelector.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ onClickOutside(containerRef, () => {
213213
{{ pkg }}
214214
</LinkBase>
215215
<ButtonBase
216-
size="small"
216+
size="sm"
217217
:aria-label="
218218
$t('compare.selector.remove_package', {
219219
package: pkg === NO_DEPENDENCY_ID ? $t('compare.no_dependency.label') : pkg,
@@ -246,7 +246,6 @@ onClickOutside(containerRef, () => {
246246
: $t('compare.selector.search_add')
247247
"
248248
no-correct
249-
size="medium"
250249
class="w-full min-w-25 ps-7"
251250
aria-autocomplete="list"
252251
ref="inputRef"

app/components/Compare/ReplacementSuggestion.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ const docUrl = computed(() => {
6565
<!-- No dependency action button -->
6666
<ButtonBase
6767
v-if="variant === 'nodep' && showAction !== false"
68-
size="small"
68+
size="sm"
6969
:aria-label="$t('compare.no_dependency.add_column')"
7070
@click="emit('addNoDep')"
7171
>
7272
{{ $t('package.replacement.consider_no_dep') }}
7373
</ButtonBase>
7474

7575
<!-- Info link -->
76-
<LinkBase v-else-if="docUrl" :to="docUrl" variant="button-secondary" size="small">
76+
<LinkBase v-else-if="docUrl" :to="docUrl" variant="button-secondary" size="sm">
7777
{{ $t('package.replacement.learn_more') }}
7878
</LinkBase>
7979
</div>

app/components/Filter/Panel.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
246246
:placeholder="searchPlaceholder"
247247
autocomplete="off"
248248
class="w-full min-w-25"
249-
size="medium"
250249
no-correct
251250
/>
252251
</div>
@@ -328,7 +327,7 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
328327
<ButtonBase
329328
v-for="keyword in displayedKeywords"
330329
:key="keyword"
331-
size="small"
330+
size="sm"
332331
:aria-pressed="filters.keywords.includes(keyword)"
333332
@click="emit('toggleKeyword', keyword)"
334333
>

app/components/Header/AuthModal.client.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ watch(user, async newUser => {
112112
:placeholder="$t('auth.modal.handle_placeholder')"
113113
no-correct
114114
class="w-full"
115-
size="medium"
116115
/>
117116
<p v-if="errorMessage" class="text-red-500 text-xs mt-1" role="alert">
118117
{{ errorMessage }}

app/components/Header/ConnectorModal.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ const executeNpmxConnectorCommand = computed(() => {
128128
:placeholder="$t('connector.modal.token_placeholder')"
129129
no-correct
130130
class="w-full"
131-
size="medium"
132131
/>
133132
</div>
134133

@@ -151,7 +150,6 @@ const executeNpmxConnectorCommand = computed(() => {
151150
inputmode="numeric"
152151
autocomplete="off"
153152
class="w-full"
154-
size="medium"
155153
/>
156154

157155
<div class="border-t border-border my-3" />

app/components/Header/SearchBox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ defineExpose({ focus })
6262
class="w-full min-w-25 ps-7 pe-8"
6363
@focus="isSearchFocused = true"
6464
@blur="isSearchFocused = false"
65-
size="small"
65+
size="sm"
6666
ariaKeyshortcuts="/"
6767
/>
6868
<button

app/components/Input/Base.stories.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const meta = {
88
disabled: { control: 'boolean' },
99
size: {
1010
control: 'select',
11-
options: ['small', 'medium', 'large'],
11+
options: ['sm', 'md', 'lg'],
1212
},
1313
noCorrect: {
1414
control: 'boolean',
@@ -29,10 +29,10 @@ export const Snapshot: Story = {
2929
render: () => ({
3030
template: `
3131
<div style="display: flex; flex-direction: column; gap: 1rem; padding: 1rem;">
32-
<Component size="small" model-value="Small input" />
33-
<Component size="medium" model-value="Medium input" />
34-
<Component size="large" model-value="Large input" />
35-
<Component size="large" model-value="disabled" disabled />
32+
<Component size="sm" model-value="Small input" />
33+
<Component size="md" model-value="Medium input" />
34+
<Component size="lg" model-value="Large input" />
35+
<Component size="lg" model-value="disabled" disabled />
3636
</div>
3737
`,
3838
components: { Component },

0 commit comments

Comments
 (0)