Skip to content
Open
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
2 changes: 1 addition & 1 deletion app/components/Button/Base.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const Secondary: Story = {
export const Small: Story = {
args: {
default: 'Small Button',
size: 'small',
size: 'sm',
variant: 'secondary',
},
}
Expand Down
10 changes: 5 additions & 5 deletions app/components/Button/Base.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const props = withDefaults(
type?: 'button' | 'submit'
/** @default "secondary" */
variant?: 'primary' | 'secondary'
/** @default "medium" */
size?: 'small' | 'medium'
/** @default "md" */
size?: 'sm' | 'md'
/** Keyboard shortcut hint */
ariaKeyshortcuts?: string
/** Forces the button to occupy the entire width of its container. */
Expand All @@ -20,7 +20,7 @@ const props = withDefaults(
{
type: 'button',
variant: 'secondary',
size: 'medium',
size: 'md',
},
)

Expand All @@ -41,8 +41,8 @@ defineExpose({
:class="{
'inline-flex': !block,
'flex': block,
'text-sm px-4 py-2': size === 'medium',
'text-xs px-2 py-0.5': size === 'small',
'text-sm px-4 py-2': size === 'md',
'text-xs px-2 py-0.5': size === 'sm',
'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))':
variant === 'secondary',
'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))':
Expand Down
6 changes: 3 additions & 3 deletions app/components/Compare/FacetSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function isCategoryNoneSelected(category: string): boolean {
:aria-pressed="isCategoryAllSelected(category)"
:disabled="isCategoryAllSelected(category)"
@click="selectCategory(category)"
size="small"
size="sm"
>
{{ $t('compare.facets.all') }}
</ButtonBase>
Expand All @@ -52,7 +52,7 @@ function isCategoryNoneSelected(category: string): boolean {
:aria-pressed="isCategoryNoneSelected(category)"
:disabled="isCategoryNoneSelected(category)"
@click="deselectCategory(category)"
size="small"
size="sm"
>
{{ $t('compare.facets.none') }}
</ButtonBase>
Expand All @@ -64,7 +64,7 @@ function isCategoryNoneSelected(category: string): boolean {
<ButtonBase
v-for="facet in facetsByCategory[category]"
:key="facet.id"
size="small"
size="sm"
:title="facet.comingSoon ? $t('compare.facets.coming_soon') : facet.description"
:disabled="facet.comingSoon"
:aria-pressed="isFacetSelected(facet.id)"
Expand Down
3 changes: 1 addition & 2 deletions app/components/Compare/PackageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ onClickOutside(containerRef, () => {
{{ pkg }}
</LinkBase>
<ButtonBase
size="small"
size="sm"
:aria-label="
$t('compare.selector.remove_package', {
package: pkg === NO_DEPENDENCY_ID ? $t('compare.no_dependency.label') : pkg,
Expand Down Expand Up @@ -246,7 +246,6 @@ onClickOutside(containerRef, () => {
: $t('compare.selector.search_add')
"
no-correct
size="medium"
class="w-full min-w-25 ps-7"
aria-autocomplete="list"
ref="inputRef"
Expand Down
4 changes: 2 additions & 2 deletions app/components/Compare/ReplacementSuggestion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ const docUrl = computed(() => {
<!-- No dependency action button -->
<ButtonBase
v-if="variant === 'nodep' && showAction !== false"
size="small"
size="sm"
:aria-label="$t('compare.no_dependency.add_column')"
@click="emit('addNoDep')"
>
{{ $t('package.replacement.consider_no_dep') }}
</ButtonBase>

<!-- Info link -->
<LinkBase v-else-if="docUrl" :to="docUrl" variant="button-secondary" size="small">
<LinkBase v-else-if="docUrl" :to="docUrl" variant="button-secondary" size="sm">
{{ $t('package.replacement.learn_more') }}
</LinkBase>
</div>
Expand Down
3 changes: 1 addition & 2 deletions app/components/Filter/Panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
:placeholder="searchPlaceholder"
autocomplete="off"
class="w-full min-w-25"
size="medium"
no-correct
/>
</div>
Expand Down Expand Up @@ -328,7 +327,7 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
<ButtonBase
v-for="keyword in displayedKeywords"
:key="keyword"
size="small"
size="sm"
:aria-pressed="filters.keywords.includes(keyword)"
@click="emit('toggleKeyword', keyword)"
>
Expand Down
1 change: 0 additions & 1 deletion app/components/Header/AuthModal.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ watch(user, async newUser => {
:placeholder="$t('auth.modal.handle_placeholder')"
no-correct
class="w-full"
size="medium"
/>
<p v-if="errorMessage" class="text-red-500 text-xs mt-1" role="alert">
{{ errorMessage }}
Expand Down
2 changes: 0 additions & 2 deletions app/components/Header/ConnectorModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ const executeNpmxConnectorCommand = computed(() => {
:placeholder="$t('connector.modal.token_placeholder')"
no-correct
class="w-full"
size="medium"
/>
</div>

Expand All @@ -151,7 +150,6 @@ const executeNpmxConnectorCommand = computed(() => {
inputmode="numeric"
autocomplete="off"
class="w-full"
size="medium"
/>

<div class="border-t border-border my-3" />
Expand Down
2 changes: 1 addition & 1 deletion app/components/Header/SearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ defineExpose({ focus })
class="w-full min-w-25 ps-7 pe-8"
@focus="isSearchFocused = true"
@blur="isSearchFocused = false"
size="small"
size="sm"
ariaKeyshortcuts="/"
/>
<button
Expand Down
10 changes: 5 additions & 5 deletions app/components/Input/Base.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const meta = {
disabled: { control: 'boolean' },
size: {
control: 'select',
options: ['small', 'medium', 'large'],
options: ['sm', 'md', 'lg'],
},
noCorrect: {
control: 'boolean',
Expand All @@ -29,10 +29,10 @@ export const Snapshot: Story = {
render: () => ({
template: `
<div style="display: flex; flex-direction: column; gap: 1rem; padding: 1rem;">
<Component size="small" model-value="Small input" />
<Component size="medium" model-value="Medium input" />
<Component size="large" model-value="Large input" />
<Component size="large" model-value="disabled" disabled />
<Component size="sm" model-value="Small input" />
<Component size="md" model-value="Medium input" />
<Component size="lg" model-value="Large input" />
<Component size="lg" model-value="disabled" disabled />
</div>
`,
components: { Component },
Expand Down
12 changes: 6 additions & 6 deletions app/components/Input/Base.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const model = defineModel<string>({ default: '' })
const props = withDefaults(
defineProps<{
disabled?: boolean
/** @default 'medium' */
size?: 'small' | 'medium' | 'large'
/** @default 'md' */
size?: 'sm' | 'md' | 'lg'
/**
* Prevents the browser from automatically modifying user input
* (e.g. autocorrect, autocomplete, autocapitalize, and spellcheck).
Expand All @@ -18,7 +18,7 @@ const props = withDefaults(
ariaKeyshortcuts?: string
}>(),
{
size: 'medium',
size: 'md',
noCorrect: true,
},
)
Expand Down Expand Up @@ -47,9 +47,9 @@ defineExpose({
@blur="emit('blur', $event)"
class="appearance-none bg-bg-subtle border border-border font-mono text-fg placeholder:text-fg-subtle transition-[border-color,outline-color] duration-300 hover:border-fg-subtle outline-2 outline-transparent outline-offset-2 focus:border-accent focus-visible:outline-accent/70 disabled:(opacity-50 cursor-not-allowed)"
:class="{
'text-xs leading-[1.2] px-2 py-2 rounded-md': size === 'small',
'text-sm leading-none px-3 py-2.5 rounded-lg': size === 'medium',
'text-base leading-[1.4] px-6 py-4 rounded-xl': size === 'large',
'text-xs leading-[1.2] px-2 py-2 rounded-md': size === 'sm',
'text-sm leading-none px-3 py-2.5 rounded-lg': size === 'md',
'text-base leading-[1.4] px-6 py-4 rounded-xl': size === 'lg',
}"
:disabled="
/** Catching Vue render-bug of invalid `disabled=false` attribute in the final HTML */
Expand Down
8 changes: 4 additions & 4 deletions app/components/Link/Base.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const props = withDefaults(
/** Visual style of the link */
variant?: 'button-primary' | 'button-secondary' | 'link'
/** Size (only applicable for button variants) */
size?: 'small' | 'medium'
size?: 'sm' | 'md'
/** Makes the link take full width */
block?: boolean

Expand Down Expand Up @@ -48,7 +48,7 @@ const props = withDefaults(
*/
noNewTabIcon?: boolean
}>(),
{ variant: 'link', size: 'medium' },
{ variant: 'link', size: 'md' },
)

const isLinkExternal = computed(
Expand All @@ -64,8 +64,8 @@ const isLinkAnchor = computed(
/** size is only applicable for button like links */
const isLink = computed(() => props.variant === 'link')
const isButton = computed(() => !isLink.value)
const isButtonSmall = computed(() => props.size === 'small' && !isLink.value)
const isButtonMedium = computed(() => props.size === 'medium' && !isLink.value)
const isButtonSmall = computed(() => props.size === 'sm' && !isLink.value)
const isButtonMedium = computed(() => props.size === 'md' && !isLink.value)
const keyboardShortcutsEnabled = useKeyboardShortcuts()
</script>

Expand Down
8 changes: 4 additions & 4 deletions app/components/Link/Link.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const ButtonSecondary: Story = {
export const SmallButton: Story = {
args: {
variant: 'button-primary',
size: 'small',
size: 'sm',
default: 'Small Button',
},
}
Expand Down Expand Up @@ -113,16 +113,16 @@ export const Snapshot: Story = {
<LinkBase to="/" classicon="i-lucide:check">Link with icon</LinkBase>
<LinkBase to="/" no-underline>Link without underline</LinkBase>
<LinkBase to="/" disabled>Disabled Link</LinkBase>

<div style="display: flex; gap: 1rem; flex-wrap: wrap;">
<LinkBase to="/" variant="button-primary">Primary</LinkBase>
<LinkBase to="/" variant="button-secondary">Secondary</LinkBase>
<LinkBase to="/" variant="button-primary" disabled>Disabled</LinkBase>
<LinkBase to="/" variant="button-primary" classicon="i-lucide:copy">With Icon</LinkBase>
</div>

<div style="display: flex; gap: 1rem;">
<LinkBase to="/" variant="button-primary" size="small">Small Button</LinkBase>
<LinkBase to="/" variant="button-primary" size="sm">Small Button</LinkBase>
</div>
<LinkBase to="/" variant="button-primary" block>Full Width Button</LinkBase>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/components/Org/MembersPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ watch(lastExecutionTime, () => {
:placeholder="$t('org.members.filter_placeholder')"
no-correct
class="w-full min-w-25 ps-7"
size="small"
size="sm"
/>
</div>
<div
Expand Down Expand Up @@ -526,7 +526,7 @@ watch(lastExecutionTime, () => {
:placeholder="$t('org.members.username_placeholder')"
no-correct
class="w-full min-w-25"
size="small"
size="sm"
/>
<div class="flex items-center gap-2">
<SelectField
Expand Down
2 changes: 1 addition & 1 deletion app/components/Org/OperationsQueue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ watch(isExecuting, executing => {
autocomplete="one-time-code"
spellcheck="false"
:class="['flex-1 min-w-25', otpError ? 'border-red-500 focus:outline-red-500' : '']"
size="small"
size="sm"
@input="otpError = ''"
/>
<button
Expand Down
3 changes: 0 additions & 3 deletions app/components/Org/TeamsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ watch(lastExecutionTime, () => {
:placeholder="$t('org.teams.filter_placeholder')"
no-correct
class="w-full min-w-25 ps-7"
size="medium"
/>
</div>
<div
Expand Down Expand Up @@ -452,7 +451,6 @@ watch(lastExecutionTime, () => {
:placeholder="$t('org.teams.username_placeholder')"
no-correct
class="flex-1 min-w-25"
size="medium"
/>
<button
type="submit"
Expand Down Expand Up @@ -509,7 +507,6 @@ watch(lastExecutionTime, () => {
:placeholder="$t('org.teams.team_name_placeholder')"
no-correct
class="flex-1 min-w-25 rounded-is-none"
size="medium"
/>
</div>
<button
Expand Down
2 changes: 1 addition & 1 deletion app/components/Package/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const numberFormatter = useNumberFormatter()
<li v-for="keyword in result.package.keywords.slice(0, 5)" :key="keyword">
<ButtonBase
class="pointer-events-auto"
size="small"
size="sm"
:aria-pressed="props.filters?.keywords.includes(keyword)"
:title="`Filter by ${keyword}`"
@click.stop="emit('clickKeyword', keyword)"
Expand Down
1 change: 0 additions & 1 deletion app/components/Package/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ const likeAction = async () => {
>
<ButtonBase
@click="likeAction"
size="medium"
:aria-label="
likesData?.userHasLiked ? $t('package.likes.unlike') : $t('package.likes.like')
"
Expand Down
2 changes: 1 addition & 1 deletion app/components/Package/Keywords.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { model } = useGlobalSearch()
<li v-for="keyword in keywords.slice(0, 15)" :key="keyword">
<LinkBase
variant="button-secondary"
size="small"
size="sm"
:to="{ name: 'search', query: { q: `keyword:${keyword}` } }"
@click="model = `keyword:${keyword}`"
>
Expand Down
1 change: 0 additions & 1 deletion app/components/Package/ListControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const showFilteredCount = computed(() => {
:placeholder="placeholder ?? $t('package.list.filter_placeholder')"
no-correct
class="w-full min-w-25 ps-10"
size="medium"
/>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/components/Package/Maintainers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ watch(
:placeholder="$t('package.maintainers.username_placeholder')"
no-correct
class="flex-1 min-w-25 m-1"
size="small"
size="sm"
/>
<ButtonBase type="submit" :disabled="!newOwnerUsername.trim() || isAdding">
{{ isAdding ? '…' : $t('package.maintainers.add_button') }}
Expand Down
2 changes: 1 addition & 1 deletion app/components/Package/MetricsBadges.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const typesHref = computed(() => {
<LinkBase
v-if="typesHref"
variant="button-secondary"
size="small"
size="sm"
:to="typesHref"
classicon="i-lucide:check"
>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Package/TableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const allMaintainersText = computed(() => {
<ButtonBase
v-for="keyword in pkg.keywords.slice(0, 3)"
:key="keyword"
size="small"
size="sm"
:aria-pressed="props.filters?.keywords.includes(keyword)"
:title="`Filter by ${keyword}`"
@click.stop="emit('clickKeyword', keyword)"
Expand Down
2 changes: 0 additions & 2 deletions app/components/Package/TrendsChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,6 @@ watch(selectedMetric, value => {
type="date"
:max="DATE_INPUT_MAX"
class="w-full min-w-0 bg-transparent"
size="medium"
/>
</div>
</div>
Expand All @@ -1640,7 +1639,6 @@ watch(selectedMetric, value => {
type="date"
:max="DATE_INPUT_MAX"
class="w-full min-w-0 bg-transparent"
size="medium"
/>
</div>
</div>
Expand Down
Loading
Loading