feat: add Dot Background component with interactive examples and documentation#8
Merged
feat: add Dot Background component with interactive examples and documentation#8
Conversation
Greptile SummaryAdds a new
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| registry/radix-nova/dot-background.tsx | New DotBackground component with semantic color/spacing variants and CSS variable overrides. Well-structured, follows existing codebase patterns (Slot import, CVA usage, cn utility). Uses a clever approach of inline CSS custom properties for theming while leveraging CVA for variant key registration. |
| components/docs/interactive-examples/dot-background.tsx | Interactive example demonstrating all color variants, spacing variants, and custom overrides. Clean, stateless component with well-typed const arrays. |
| components/docs/interactive-examples/index.ts | Barrel export file updated with new DotBackgroundInteractiveExample export in correct alphabetical order. |
| content/docs/components/dot-background.mdx | Documentation page with install instructions, live example, usage snippets, and a complete configuration table. Accurate and consistent with the component API. |
| registry.json | New dot-background component entry added in correct position. Follows existing registry structure. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["DotBackground Props"] --> B{"variant?"}
B -->|"default/muted/card/accent/secondary"| C["Lookup colorVariant from dotBackgroundColorVariants"]
B -->|"custom"| D["Use fallback defaults"]
A --> E{"spacing?"}
E -->|"dense/default/relaxed/loose"| F["Lookup spacingVariant from dotBackgroundSpacingVariants"]
E -->|"custom"| G["Use fallback defaults"]
A --> H{"vars provided?"}
H -->|Yes| I["Set --dot-background-* CSS vars"]
H -->|No| J["CSS vars omitted, fallbacks used"]
C --> K["Build resolvedStyle"]
D --> K
F --> K
G --> K
I --> K
J --> K
K --> L["--dot-pattern-bg = var(--dot-background-color, colorVariant)"]
K --> M["--dot-pattern-color = var(--dot-background-dot-color, colorVariant)"]
K --> N["--dot-pattern-spacing = var(--dot-background-spacing, spacingVariant)"]
K --> O["--dot-pattern-dot-size = var(--dot-background-dot-size, 1px)"]
L --> P["Render div/Slot with radial-gradient background"]
M --> P
N --> P
O --> P
Last reviewed commit: 3bb06f8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.