From e2ada536fdde1b204f074882c1cd0fa1c1d2acf1 Mon Sep 17 00:00:00 2001 From: zurdi Date: Wed, 13 May 2026 23:27:42 +0000 Subject: [PATCH] feat: Refactor RList and RListItem components for improved accessibility and styling - Enhanced RList component to provide a semantic outer wrapper for list items, supporting custom properties for density, color, and background color. - Updated RListItem to support polymorphic behavior with dynamic rendering based on props (to, href, click handlers). - Introduced new styling for RList and RListItem, including density variations and improved hover/active states. - Modified RToolbar to allow for customizable height, color, and rounded corners, enhancing its usability in various contexts. - Updated storybook examples for RList, RListItem, and RToolbar to demonstrate new features and styling options. - Changed button variants from 'tonal' to 'translucent' in various components for a more consistent design language. --- frontend/.storybook/preview.ts | 19 + .../Collections/NewCollectionRow.vue | 2 +- .../components/Dialogs/DeleteManualDialog.vue | 2 +- .../v2/components/Dialogs/DeleteRomDialog.vue | 2 +- .../v2/components/Dialogs/EditRomDialog.vue | 2 +- .../v2/components/Dialogs/MatchRomDialog.vue | 2 +- .../Dialogs/RefreshMetadataDialog.vue | 2 +- .../src/v2/components/Gallery/GameListRow.vue | 4 +- .../src/v2/components/GameCard/GameCard.vue | 1 - .../GameDetails/SoundtrackPanel.vue | 4 +- frontend/src/v2/components/Home/CardRow.vue | 4 +- .../Player/EmulatorJSCacheDialog.vue | 2 +- .../src/v2/components/Settings/ScopeCell.vue | 2 +- .../lib/forms/RCheckbox/RCheckbox.stories.ts | 279 +++++++- .../src/v2/lib/forms/RCheckbox/RCheckbox.vue | 621 ++++++++++++++---- .../v2/lib/overlays/RCarousel/RCarousel.vue | 4 +- .../lib/primitives/RAlert/RAlert.stories.css | 17 + .../lib/primitives/RAlert/RAlert.stories.ts | 184 +++++- .../src/v2/lib/primitives/RAlert/RAlert.vue | 377 ++++++++++- .../lib/primitives/RAvatar/RAvatar.stories.ts | 255 ++++++- .../src/v2/lib/primitives/RAvatar/RAvatar.vue | 222 ++++++- .../lib/primitives/RBadge/RBadge.stories.ts | 244 ++++++- .../src/v2/lib/primitives/RBadge/RBadge.vue | 277 +++++++- .../v2/lib/primitives/RBtn/RBtn.stories.ts | 320 ++++++++- frontend/src/v2/lib/primitives/RBtn/RBtn.vue | 555 +++++++++++++--- .../v2/lib/primitives/RCard/RCard.stories.ts | 196 +++++- .../src/v2/lib/primitives/RCard/RCard.vue | 295 ++++++++- .../v2/lib/primitives/RChip/RChip.stories.ts | 252 ++++++- .../src/v2/lib/primitives/RChip/RChip.vue | 359 ++++++++-- .../primitives/RDivider/RDivider.stories.ts | 150 ++++- .../v2/lib/primitives/RDivider/RDivider.vue | 143 +++- .../v2/lib/primitives/RIcon/RIcon.stories.css | 34 + .../v2/lib/primitives/RIcon/RIcon.stories.ts | 254 ++++++- .../src/v2/lib/primitives/RIcon/RIcon.vue | 112 +++- .../v2/lib/primitives/RImg/RImg.stories.css | 41 ++ .../v2/lib/primitives/RImg/RImg.stories.ts | 250 ++++++- frontend/src/v2/lib/primitives/RImg/RImg.vue | 187 +++++- .../RProgressCircular.stories.ts | 199 +++++- .../RProgressCircular/RProgressCircular.vue | 239 ++++++- .../v2/lib/structural/RList/RList.stories.ts | 137 +++- .../src/v2/lib/structural/RList/RList.vue | 112 +++- .../structural/RListItem/RListItem.stories.ts | 158 ++++- .../v2/lib/structural/RListItem/RListItem.vue | 298 ++++++++- .../structural/RToolbar/RToolbar.stories.ts | 198 +++++- .../v2/lib/structural/RToolbar/RToolbar.vue | 188 +++++- .../structural/RTooltip/RTooltip.stories.ts | 2 +- frontend/src/v2/views/Gallery/Collection.vue | 2 +- frontend/src/v2/views/Gallery/Platform.vue | 2 +- frontend/src/v2/views/Pair.vue | 2 +- frontend/src/v2/views/Player/EmulatorJS.vue | 2 +- frontend/src/v2/views/Player/Ruffle.vue | 2 +- .../src/v2/views/Settings/MetadataSources.vue | 12 +- 52 files changed, 6648 insertions(+), 581 deletions(-) create mode 100644 frontend/src/v2/lib/primitives/RAlert/RAlert.stories.css create mode 100644 frontend/src/v2/lib/primitives/RIcon/RIcon.stories.css create mode 100644 frontend/src/v2/lib/primitives/RImg/RImg.stories.css diff --git a/frontend/.storybook/preview.ts b/frontend/.storybook/preview.ts index 4ef6e4ed6..7d7d8fb80 100644 --- a/frontend/.storybook/preview.ts +++ b/frontend/.storybook/preview.ts @@ -51,6 +51,25 @@ const preview: Preview = { date: /Date$/i, }, }, + // Sidebar order: build up from atoms to compound surfaces. Primitives + // are the foundation everything else composes from, then form + // controls, structural layout pieces, data displays, and finally + // positioned UI (menus + overlays). Media (domain-aware icons) is + // last because it's the most specialised. Categories not listed + // here fall through to Storybook's default alphabetical sort. + options: { + storySort: { + order: [ + "Primitives", + "Forms", + "Structural", + "Data", + "Menus", + "Overlays", + "Media", + ], + }, + }, }, decorators: [ withThemeByClassName({ diff --git a/frontend/src/v2/components/Collections/NewCollectionRow.vue b/frontend/src/v2/components/Collections/NewCollectionRow.vue index 083468138..f9d00f021 100644 --- a/frontend/src/v2/components/Collections/NewCollectionRow.vue +++ b/frontend/src/v2/components/Collections/NewCollectionRow.vue @@ -109,7 +109,7 @@ function onInput(e: Event) { {{ t("common.cancel") }}
{ v-for="l in rom.languages?.slice(0, 3) ?? []" :key="`lang-${l}`" size="x-small" - variant="tonal" + variant="translucent" > {{ l }} @@ -227,7 +227,7 @@ onBeforeUnmount(() => { v-for="r in rom.regions?.slice(0, 3) ?? []" :key="`reg-${r}`" size="x-small" - variant="tonal" + variant="translucent" > {{ r }} diff --git a/frontend/src/v2/components/GameCard/GameCard.vue b/frontend/src/v2/components/GameCard/GameCard.vue index 810f91d8a..40b096e54 100644 --- a/frontend/src/v2/components/GameCard/GameCard.vue +++ b/frontend/src/v2/components/GameCard/GameCard.vue @@ -160,7 +160,6 @@ const morphStyle = computed(() => { icon size="x-small" variant="text" - :ripple="false" class="r-gc__platform-icon" :aria-label="`Browse ${platformShort}`" @click="onPlatformClick" diff --git a/frontend/src/v2/components/GameDetails/SoundtrackPanel.vue b/frontend/src/v2/components/GameDetails/SoundtrackPanel.vue index fc1812d6c..7e44f8d15 100644 --- a/frontend/src/v2/components/GameDetails/SoundtrackPanel.vue +++ b/frontend/src/v2/components/GameDetails/SoundtrackPanel.vue @@ -369,7 +369,7 @@ function seekValueText(v: number): string { v-for="(c, i) in headerChips(activeMeta)" :key="`h-${i}`" size="small" - variant="tonal" + variant="translucent" :color="c.color" :prepend-icon="c.icon" > @@ -490,7 +490,7 @@ function seekValueText(v: number): string { v-for="(c, i) in rowChips(track.id)" :key="`r-${track.id}-${i}`" size="x-small" - variant="tonal" + variant="translucent" :color="c.color" :prepend-icon="c.icon" > diff --git a/frontend/src/v2/components/Home/CardRow.vue b/frontend/src/v2/components/Home/CardRow.vue index df73a74ee..ac3edcc1f 100644 --- a/frontend/src/v2/components/Home/CardRow.vue +++ b/frontend/src/v2/components/Home/CardRow.vue @@ -158,7 +158,7 @@ onBeforeUnmount(() => { {
{