Repository navigation
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Review could not proceed because the required external GoodDollar contribution guidelines could not be retrieved with the available tools.
No open issues 🎉
What changed in this PR
Updates shared @goodwidget/ui primitives to address the light/dark rendering issues in #303, complementing the streaming-widget theme changes in #291.
Changes:
- Adjusts button theme selection and semantic text colors for buttons and token amounts.
- Updates separator sizing, input placeholder colors, and select option styling.
- Adds light/dark Storybook coverage for buttons, separators, and token amounts.
| File | Description |
|---|---|
packages/ui/src/theme.ts |
Adds textColor fields to base and component themes. |
packages/ui/src/components/TokenAmount.tsx |
Changes primary and secondary text color tokens. |
packages/ui/src/components/Separator.ts |
Overrides horizontal height clamps and adjusts vertical constraints. |
packages/ui/src/components/CircularActionButton.tsx |
Uses semantic colors for disabled/pending labels and spinners. |
packages/ui/src/components/Button.tsx |
Changes frame theme selection and adds variant-aware label styles. |
packages/ui/src/components-test/Select.tsx |
Removes default option borders and outlines. |
packages/ui/src/components-test/Input.tsx |
Adds a themed placeholder color. |
examples/storybook/src/stories/design-system/TokenAmount.stories.tsx |
Adds dedicated light and dark amount stories. |
examples/storybook/src/stories/design-system/Separator.stories.tsx |
Adds stories for sizes, colors, and orientations in both themes. |
examples/storybook/src/stories/design-system/Button.stories.tsx |
Adds all-variant stories and a side-by-side theme comparison. |
Review effort: Balanced
|
Please make yourself and your possible agent aware of our contribution guidelines: https://github.com/GoodDollar/.github/blob/master/CONTRIBUTING.md and verify if your submissions has followed the rules, not only for this PR, the others as well |
|
Thank you @L03TJ3 for pointing this out. We have reviewed the updated GoodDollar contribution guidelines and payment rules in full and are aligning our submissions accordingly:
We appreciate the guidance and are committed to adhering strictly to the repository standards. |
…verage (GoodDollar#303) Fixes GoodDollar#303 - packages/ui/src/components/Button.tsx: * Stop non-primary variants from re-entering light_Button sub-theme. * Add variant-aware coloring to ButtonText (primary: $textColor; non-primary: $color). * Only bind 'Button' component theme to primary buttons so non-primary variants render readable dark text in Light. - packages/ui/src/components/CircularActionButton.tsx: * Replace hardcoded $grey600 with $colorDim for pending/disabled label and spinner to adapt to light/dark themes. - packages/ui/src/components/Separator.ts: * Add maxHeight: 'none' and explicit height/minHeight/maxHeight to prevent Tamagui's horizontal maxHeight: 0 clamp from collapsing dividers to 0px. - packages/ui/src/components/TokenAmount.tsx: * Replace unresolved $text token with $color. * Replace $secondaryColor with $placeholderColor. - packages/ui/src/components-test/Input.tsx & Select.tsx: * Add placeholderTextColor: '$placeholderColor' to InputFrame. * Add borderWidth: 0 and outlineWidth: 0 to OptionItem in Select to remove browser 2px button outset border. - packages/ui/src/theme.ts: * Add textColor to base light/dark themes for consistent token resolution. - examples/storybook/src/stories/design-system/: * Add Button.stories.tsx covering all variants across Light and Dark. * Add Separator.stories.tsx covering horizontal sizes and vertical mode. * Add LightTheme and DarkTheme coverage to TokenAmount.stories.tsx. Payout: 0x759797593fed8f313d8fdba7a3a0d491f0e4b9f7 (USDC on Base L2)
e184574 to
84c2e7f
Compare
Summary
Fixes #303. Resolves the shared UI primitive rendering and theme resolution bugs identified in
@goodwidget/uiduring the Storybook-to-Penpot pass, ensuring full parity and readability across both Light and Dark themes.Changes by Item
Non-primary
Buttonlabels render white in Light:packages/ui/src/components/Button.tsx, stoppedButtonFramefrom imposing thelight_Buttonsub-theme onto non-primary variants.theme="Button"exclusively to primary buttons (variant === 'primary'). Non-primary variants (secondary, outline, ghost, pill, text, list) now inherit ambient theme text color directly.ButtonTextvariant-aware (primary: $textColor, non-primary:$color), ensuring high-contrast readable text in both Light (#333333) and Dark (#E0E0E0) themes.textColorto baselightanddarkthemes inpackages/ui/src/theme.tsfor consistent token resolution.CircularActionButtonhardcoded$grey600:packages/ui/src/components/CircularActionButton.tsx, replaced hardcoded$grey600for both the disabled/pending label and the spinner with semantic theme token$colorDim. Adapts dynamically to Light (#555555) and Dark (#888888).Horizontal
Separator0px height clamp:packages/ui/src/components/Separator.ts, overridden Tamagui's native horizontalmaxHeight: 0clamp withmaxHeight: 'none'and explicitheight/minHeight/maxHeightper size variant (sm: 1px,md: 2px,lg: 4px), allowing horizontal dividers to render visibly. Checked and preserved vertical mode (vertical: true).TokenAmountempty (0x0) spans in Light:packages/ui/src/components/TokenAmount.tsx, replaced non-existent$texttoken with$coloronTokenAmountText.$secondaryColorwith$placeholderColorfor the secondary variant.Streaming widget inputs falling back to browser defaults:
packages/ui/src/components-test/Input.tsx, addedplaceholderTextColor: '$placeholderColor'toInputFrameso input placeholders resolve cleanly against the theme instead of browser-default grey (#757575).packages/ui/src/components-test/Select.tsx, addedborderWidth: 0,borderColor: 'transparent', andoutlineWidth: 0toOptionItemto remove the default 2px outset button border.Relation to #255 / #291
packages/streaming-widget.@goodwidget/ui, resolving all remaining styling and theme fallback bugs at the source as requested.Storybook Coverage
examples/storybook/src/stories/design-system/Button.stories.tsxcovering all 7 button variants across Light and Dark themes side-by-side.examples/storybook/src/stories/design-system/Separator.stories.tsxcovering all horizontal sizes, colors, and vertical orientation.examples/storybook/src/stories/design-system/TokenAmount.stories.tsxwith dedicatedLightThemeandDarkThemestories.Verification
pnpm --filter @goodwidget/ui lint: PASS (0 errors)pnpm --filter @goodwidget/ui build: PASS (100% clean tsup build, ESM + CJS + DTS)core.autocrlf false) with zero noise diffs.Payout Coordinates:
0x759797593fed8f313d8fdba7a3a0d491f0e4b9f7(USDC on Base L2)Summary by Sourcery
Fix theme-aware rendering across shared UI primitives and expand Storybook coverage for light and dark themes.
Bug Fixes:
Enhancements:
Tests: