Skip to content

feat(core)!: Extend colors with base color for text based components#143

Merged
michaelcozzolino merged 9 commits into3.xfrom
feat/extend-colors-for-text-based-components
Mar 13, 2026
Merged

feat(core)!: Extend colors with base color for text based components#143
michaelcozzolino merged 9 commits into3.xfrom
feat/extend-colors-for-text-based-components

Conversation

@michaelcozzolino
Copy link
Owner

@michaelcozzolino michaelcozzolino commented Mar 13, 2026

Summary by CodeRabbit

  • New Features

    • Added explicit "base" text color option across Heading, Link, Divider, Loading and examples.
  • Documentation

    • Upgrade guide updated: new default text-color behavior and how to use color="base" to restore legacy appearance.
  • Chores

    • Public type renamed to TextColorableComponentName (update local types/props accordingly).
  • Tests

    • Updated tests to assert the new base-color behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e6602ce-2c9b-46bd-abc2-6bc17d0d6694

📥 Commits

Reviewing files that changed from the base of the PR and between f35f82a and b3a7108.

📒 Files selected for processing (1)
  • packages/docs/UpgradeGuide.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/docs/UpgradeGuide.md

Walkthrough

This pull request refactors the text color system. It adds a TextColor type ('base' | Color) and a TextColorable interface with an optional color property, and renames ColorableTextComponentName to TextColorableComponentName. The useTextColor function now treats 'base' as a special value and returns text-base-content directly. Text-related component prop types (Divider, Heading, Link, Loading) now extend TextColorable instead of Colorable. Documentation and examples were updated to pass color="base" where appropriate.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: extending colors with a 'base' color for text-based components, which is reflected across all file modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/extend-colors-for-text-based-components
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@michaelcozzolino michaelcozzolino changed the base branch from 2.x to 3.x March 13, 2026 20:26
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 13, 2026

Deploying flyonui-vue with  Cloudflare Pages  Cloudflare Pages

Latest commit: b3a7108
Status: ✅  Deploy successful!
Preview URL: https://34ca640e.flyonui-vue.pages.dev
Branch Preview URL: https://feat-extend-colors-for-text.flyonui-vue.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 13, 2026

Deploying flyonui-vue-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: b3a7108
Status: ✅  Deploy successful!
Preview URL: https://f0e6703a.flyonui-vue-v3.pages.dev
Branch Preview URL: https://feat-extend-colors-for-text.flyonui-vue-v3.pages.dev

View logs

@michaelcozzolino michaelcozzolino marked this pull request as ready for review March 13, 2026 20:35
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
packages/docs/Next/Content/Divider/DashedDivider.vue (1)

60-64: Optional: add a horizontal Base dashed sample for parity.

Line 60 onward starts the horizontal set, but unlike the vertical set, it doesn’t include a color="base" example. Adding one would keep both sections symmetric.

Suggested doc-only patch
 <FoDivider preset="dash"
            orientation="horizontal"
 >
     Default
 </FoDivider>

+<FoDivider color="base"
+           preset="dash"
+           orientation="horizontal"
+>
+    Base
+</FoDivider>
+
 <FoDivider color="neutral"
            preset="dash"
            orientation="horizontal"
 >
     Neutral
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/docs/Next/Content/Divider/DashedDivider.vue` around lines 60 - 64,
Add a horizontal "Base" dashed example to match the vertical section by adding
another FoDivider instance in the horizontal group using preset="dash" and
orientation="horizontal" with color="base" (i.e., a second FoDivider alongside
the existing Default example). Ensure the new FoDivider uses the same structure
and props as the Default horizontal sample but adds color="base" so both
sections are symmetric.
packages/core/tests/Lib/UseColor/Internal/Lib/UseTextColor.spec.ts (1)

14-18: Test coverage gap: undefined color path is no longer tested.

The new test for 'base' color is correct. However, per the AI summary, a test for the undefined color case was removed. The implementation in UseTextColor.ts still accepts TextColor | undefined and passes undefined to useColor. Components like FoLink may call useTextColor with props.color being undefined.

Consider adding a test case to verify the behavior when color is undefined:

it('returns a default color class if the color is undefined', () => {
    const config = ref<FlyonUIVueAppDefaultConfig>({ ...flyonUIVueAppDefaultConfig });

    expect(useTextColor(config, 'FoLink', () => undefined).value).toBe(/* expected default */);
});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/tests/Lib/UseColor/Internal/Lib/UseTextColor.spec.ts` around
lines 14 - 18, Add a test that covers the undefined color path for useTextColor:
call useTextColor with config (ref of FlyonUIVueAppDefaultConfig from
flyonUIVueAppDefaultConfig), the component name 'FoLink', and a color provider
that returns undefined (e.g., () => undefined), then assert the returned .value
equals the expected default text class (the same fallback class used by
useTextColor/useColor, e.g., 'text-base-content'); this ensures useTextColor and
useColor handle props.color === undefined correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/core/src/Lib/UseColor/Internal/Lib/UseTextColor.ts`:
- Around line 1-4: Reorder the imports to satisfy perfectionist/sort-imports:
group and alphabetize by module and separate type-only imports from value
imports. Specifically, keep the type-only Vue imports together (ComputedRef,
MaybeRefOrGetter, Ref) and the value Vue imports together (computed, toValue),
then import types from '@/Lib' (FlyonUIVueAppDefaultConfig, TextColor,
TextColorableComponentName), and finally the value import useColor from
'@/Lib/UseColor/Internal'; update the four import statements to that order so
ESLint stops flagging them.
- Around line 12-19: The computed in useTextColor currently returns
useColor(config, componentName, c).value which can be undefined, violating the
declared ComputedRef<string>; update the computed to guard the result (e.g.
capture const value = useColor(config, componentName, c).value and return value
?? 'text-base-content' or another appropriate default) so the computed always
yields a string; keep references to toValue(color), c, config and componentName
intact.

In `@packages/docs/UpgradeGuide.md`:
- Around line 40-44: Fix the awkward phrasing in the sentence describing the
color prop for FoDivider / FoHeading / FoLink / FoLoading: change "if you want
now this color you have to pass the `base` value to the `color` prop." to "if
you now want this color, you have to pass the `base` value to the `color` prop."
so the sentence reads smoothly and includes the comma before the clause.

---

Nitpick comments:
In `@packages/core/tests/Lib/UseColor/Internal/Lib/UseTextColor.spec.ts`:
- Around line 14-18: Add a test that covers the undefined color path for
useTextColor: call useTextColor with config (ref of FlyonUIVueAppDefaultConfig
from flyonUIVueAppDefaultConfig), the component name 'FoLink', and a color
provider that returns undefined (e.g., () => undefined), then assert the
returned .value equals the expected default text class (the same fallback class
used by useTextColor/useColor, e.g., 'text-base-content'); this ensures
useTextColor and useColor handle props.color === undefined correctly.

In `@packages/docs/Next/Content/Divider/DashedDivider.vue`:
- Around line 60-64: Add a horizontal "Base" dashed example to match the
vertical section by adding another FoDivider instance in the horizontal group
using preset="dash" and orientation="horizontal" with color="base" (i.e., a
second FoDivider alongside the existing Default example). Ensure the new
FoDivider uses the same structure and props as the Default horizontal sample but
adds color="base" so both sections are symmetric.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 92c9c7c1-d649-4454-a01d-920a6c352f91

📥 Commits

Reviewing files that changed from the base of the PR and between cc0ba4c and f35f82a.

⛔ Files ignored due to path filters (6)
  • packages/docs/tests/EndToEnd/Docs.browser.spec.ts-snapshots/content-divider-dashed-chromium-linux.png is excluded by !**/*.png
  • packages/docs/tests/EndToEnd/Docs.browser.spec.ts-snapshots/content-divider-dotted-chromium-linux.png is excluded by !**/*.png
  • packages/docs/tests/EndToEnd/Docs.browser.spec.ts-snapshots/content-divider-solid-chromium-linux.png is excluded by !**/*.png
  • packages/docs/tests/EndToEnd/Docs.browser.spec.ts-snapshots/content-divider-with-custom-thickness-chromium-linux.png is excluded by !**/*.png
  • packages/docs/tests/EndToEnd/Docs.browser.spec.ts-snapshots/content-heading-color-chromium-linux.png is excluded by !**/*.png
  • packages/docs/tests/EndToEnd/Docs.browser.spec.ts-snapshots/content-link-color-chromium-linux.png is excluded by !**/*.png
📒 Files selected for processing (26)
  • packages/core/src/Lib/UseColor/Internal/Lib/UseTextColor.ts
  • packages/core/src/Lib/UseColor/Types/Color.ts
  • packages/core/src/UI/Components/Loading/Types/Loading.ts
  • packages/core/src/UI/Content/Divider/Types/Divider.ts
  • packages/core/src/UI/Content/Heading/Types/Heading.ts
  • packages/core/src/UI/Content/Heading/UI/FoHeading.vue
  • packages/core/src/UI/Content/Link/Types/Link.ts
  • packages/core/tests/Lib/UseColor/Internal/Lib/UseTextColor.spec.ts
  • packages/docs/Components/Loading/LoadingAnimation.vue
  • packages/docs/Components/Loading/LoadingColor.vue
  • packages/docs/Content/Heading/HeadingColor.vue
  • packages/docs/Content/Heading/HeadingLevel.vue
  • packages/docs/Content/Link/AnimatedUnderlineLink.vue
  • packages/docs/Content/Link/DefaultLink.vue
  • packages/docs/Content/Link/LinkColor.vue
  • packages/docs/Content/Link/UnderlineOnHoverLink.vue
  • packages/docs/Next/Content/Divider/DashedDivider.vue
  • packages/docs/Next/Content/Divider/DividerContentAlignment.vue
  • packages/docs/Next/Content/Divider/DividerWithCustomThickness.vue
  • packages/docs/Next/Content/Divider/DottedDivider.vue
  • packages/docs/Next/Content/Divider/HorizontalDivider.vue
  • packages/docs/Next/Content/Divider/HorizontallyResponsiveDivider.vue
  • packages/docs/Next/Content/Divider/SolidDivider.vue
  • packages/docs/Next/Content/Divider/VerticalDivider.vue
  • packages/docs/Next/Content/Divider/VerticallyResponsiveDivider.vue
  • packages/docs/UpgradeGuide.md

@michaelcozzolino michaelcozzolino merged commit 18c97cc into 3.x Mar 13, 2026
7 checks passed
@michaelcozzolino michaelcozzolino deleted the feat/extend-colors-for-text-based-components branch March 13, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant