Skip to content

Classes2#1683

Merged
shinokada merged 2 commits intothemesberg:mainfrom
jjagielka:classes2
Jul 17, 2025
Merged

Classes2#1683
shinokada merged 2 commits intothemesberg:mainfrom
jjagielka:classes2

Conversation

@jjagielka
Copy link
Copy Markdown
Contributor

@jjagielka jjagielka commented Jul 17, 2025

📑 Description

More components with classes props.

Status

  • Not Completed
  • Completed

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • I have checked the page with https://validator.unl.edu/
  • All the tests have passed
  • My pull request is based on the latest commit (not the npm version).

ℹ Additional Information

Summary by CodeRabbit

  • New Features

    • Introduced a new classes prop for more flexible and unified styling across Breadcrumb, Card, and Device Mockup components.
    • Added deprecation warnings for legacy individual class props, ensuring backward compatibility.
    • Enhanced type safety and customization options for all affected components.
  • Refactor

    • Updated internal naming conventions for style keys (e.g., div to base) to improve consistency.
    • Standardized and simplified type definitions for component variants and props.
  • Style

    • Improved class composition using a new approach for easier and more consistent custom styling.
  • Chores

    • Cleaned up and updated type interfaces and removed deprecated or unused type aliases.

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 17, 2025

@jjagielka is attempting to deploy a commit to the Themesberg Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 17, 2025

Walkthrough

This update standardizes and refactors the styling API across multiple Svelte components and their themes. It introduces a new classes prop for flexible styling, deprecates older individual class props, and updates type definitions to reflect these changes. Theme slot keys are renamed for consistency, and type safety is improved throughout the codebase.

Changes

Files/Group Change Summary
src/lib/breadcrumb/Breadcrumb.svelte, BreadcrumbItem.svelte Added classes prop for styling, deprecated old class props, unified styling logic, and updated class composition.
src/lib/card/Card.svelte Replaced deprecated imgClass with classes prop, added deprecation warning, centralized styling logic.
src/lib/device-mockups/Android.svelte, DefaultMockup.svelte, Desktop.svelte, Ios.svelte, Laptop.svelte, Smartwatch.svelte, Tablet.svelte Introduced classes prop, deprecated individual div class props, unified styling logic, updated class composition, and renamed root slot key from div to base.
src/lib/breadcrumb/theme.ts, src/lib/card/theme.ts, src/lib/datepicker/theme.ts, src/lib/button-group/theme.ts, src/lib/device-mockups/theme.ts Updated slot keys (nav/divbase), added/updated type aliases to combine VariantProps and Classes, improved type safety and consistency.
src/lib/datepicker/Datepicker.svelte Removed usage of classes?.base from calendar dropdown, simplifying class composition.
src/lib/types.ts Updated interfaces to extend new variant types, added imports for new type aliases, removed deprecated/commented-out types, and improved formatting.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Component
    participant Theme
    participant DeprecationUtil

    User->>Component: Passes props (may include deprecated class props or new `classes`)
    Component->>DeprecationUtil: Warn if deprecated class props are used
    Component->>Theme: Retrieves default style slots (now using `base`)
    Component->>Component: Derives `styling` from `classes` or deprecated props
    Component->>Component: Composes final class names with `clsx`
    Component-->>User: Renders with unified styling
Loading

Possibly related PRs

  • Docs update to classes #1682: Updates documentation to introduce and explain the new classes prop, complementing this PR's code-level introduction and refactoring of the same prop.

Poem

🐇✨
A hop, a skip, new classes arrive,
Old props retire, but themes now thrive.
With warnings gentle, and types anew,
Each mockup shines in tailored hue.
So let your styles elegantly flow—
The rabbit’s touch makes components glow!
🥕

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (1)
src/lib/types.ts (1)

346-346: Address ESLint warnings about empty interfaces

Several interfaces are flagged as empty and equivalent to their supertypes. Consider converting these to type aliases for better clarity and to eliminate ESLint warnings.

For example, convert empty interfaces to type aliases:

-export interface CheckIconProps extends SVGAttributes<SVGSVGElement> { }
+export type CheckIconProps = SVGAttributes<SVGSVGElement>;

-export interface DropdownDividerProps extends HTMLAttributes<HTMLDivElement> { }
+export type DropdownDividerProps = HTMLAttributes<HTMLDivElement>;

-export interface NavBrandProps extends HTMLAnchorAttributes { }
+export type NavBrandProps = HTMLAnchorAttributes;

-export interface ToolbarGroupProps extends ToolbarGroupVariants, HTMLAttributes<HTMLDivElement> { }
+export type ToolbarGroupProps = ToolbarGroupVariants & HTMLAttributes<HTMLDivElement>;

-export interface TestimonialPlaceholderProps extends HTMLAttributes<HTMLDivElement> { }
+export type TestimonialPlaceholderProps = HTMLAttributes<HTMLDivElement>;

-export interface WidgetPlaceholderProps extends HTMLAttributes<HTMLDivElement> { }
+export type WidgetPlaceholderProps = HTMLAttributes<HTMLDivElement>;

Also applies to: 572-572, 1073-1073, 1109-1109, 1418-1418, 1428-1428

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97f8514 and ca90215.

📒 Files selected for processing (17)
  • src/lib/breadcrumb/Breadcrumb.svelte (1 hunks)
  • src/lib/breadcrumb/BreadcrumbItem.svelte (2 hunks)
  • src/lib/breadcrumb/theme.ts (2 hunks)
  • src/lib/button-group/theme.ts (1 hunks)
  • src/lib/card/Card.svelte (2 hunks)
  • src/lib/card/theme.ts (1 hunks)
  • src/lib/datepicker/Datepicker.svelte (1 hunks)
  • src/lib/datepicker/theme.ts (1 hunks)
  • src/lib/device-mockups/Android.svelte (1 hunks)
  • src/lib/device-mockups/DefaultMockup.svelte (1 hunks)
  • src/lib/device-mockups/Desktop.svelte (1 hunks)
  • src/lib/device-mockups/Ios.svelte (1 hunks)
  • src/lib/device-mockups/Laptop.svelte (1 hunks)
  • src/lib/device-mockups/Smartwatch.svelte (1 hunks)
  • src/lib/device-mockups/Tablet.svelte (1 hunks)
  • src/lib/device-mockups/theme.ts (5 hunks)
  • src/lib/types.ts (18 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components, both the regular focus styling (controlled by ringClasses) and focus-within styling need to be dynamically adjusted based on validation state. For proper validation styling, create separate objects for focus-within classes (like focusWithinClasses) that use the same color as ringClasses when inputInvalid=true.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components like MultiInput, when handling focus states for validation, avoid hardcoding focus-within classes like 'focus-within:border-primary-500'. Instead, create a dynamic mapping object (e.g., focusWithinClasses) that changes the focus ring color based on the current color state, especially when inputInvalid=true.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T12:47:33.307Z
Learning: In the Flowbite Svelte library's composite form components like MultiInput, when implementing focus styles with focus-within, create a dedicated focusWithinClasses object with appropriate colors for each state (base, primary, green, red). Using just 'focus-within:ring-1' without color specification won't correctly apply color-specific styling when the input receives focus directly.
src/lib/datepicker/Datepicker.svelte (4)
Learnt from: Chizaruu
PR: themesberg/flowbite-svelte#1465
File: src/lib/forms/Timepicker.svelte:105-116
Timestamp: 2024-10-18T09:38:03.879Z
Learning: In `Timepicker.svelte`, the `Dropdown` opens as intended and is used exclusively with the 'dropdown' and 'timerange-dropdown' Timepicker types.
Learnt from: mrh1997
PR: themesberg/flowbite-svelte#1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.
Learnt from: Chizaruu
PR: themesberg/flowbite-svelte#1464
File: src/routes/component-data/Datepicker.json:0-0
Timestamp: 2024-10-15T22:41:47.429Z
Learning: The component should be named 'Datepicker' (with lowercase 'p') throughout the codebase to maintain consistency.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components, both the regular focus styling (controlled by ringClasses) and focus-within styling need to be dynamically adjusted based on validation state. For proper validation styling, create separate objects for focus-within classes (like focusWithinClasses) that use the same color as ringClasses when inputInvalid=true.
src/lib/breadcrumb/BreadcrumbItem.svelte (1)
Learnt from: mrh1997
PR: themesberg/flowbite-svelte#1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.
src/lib/card/Card.svelte (1)
Learnt from: mrh1997
PR: themesberg/flowbite-svelte#1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.
src/lib/device-mockups/DefaultMockup.svelte (1)
Learnt from: mrh1997
PR: themesberg/flowbite-svelte#1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.
src/lib/datepicker/theme.ts (2)
Learnt from: Chizaruu
PR: themesberg/flowbite-svelte#1464
File: src/routes/component-data/Datepicker.json:0-0
Timestamp: 2024-10-15T22:41:47.429Z
Learning: The component should be named 'Datepicker' (with lowercase 'p') throughout the codebase to maintain consistency.
Learnt from: Chizaruu
PR: themesberg/flowbite-svelte#1465
File: src/lib/forms/Timepicker.svelte:105-116
Timestamp: 2024-10-18T09:38:03.879Z
Learning: In `Timepicker.svelte`, the `Dropdown` opens as intended and is used exclusively with the 'dropdown' and 'timerange-dropdown' Timepicker types.
src/lib/device-mockups/Ios.svelte (4)
Learnt from: mrh1997
PR: themesberg/flowbite-svelte#1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components, both the regular focus styling (controlled by ringClasses) and focus-within styling need to be dynamically adjusted based on validation state. For proper validation styling, create separate objects for focus-within classes (like focusWithinClasses) that use the same color as ringClasses when inputInvalid=true.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T12:47:33.307Z
Learning: In the Flowbite Svelte library's composite form components like MultiInput, when implementing focus styles with focus-within, create a dedicated focusWithinClasses object with appropriate colors for each state (base, primary, green, red). Using just 'focus-within:ring-1' without color specification won't correctly apply color-specific styling when the input receives focus directly.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components like MultiInput, when handling focus states for validation, avoid hardcoding focus-within classes like 'focus-within:border-primary-500'. Instead, create a dynamic mapping object (e.g., focusWithinClasses) that changes the focus ring color based on the current color state, especially when inputInvalid=true.
src/lib/breadcrumb/Breadcrumb.svelte (2)
Learnt from: mrh1997
PR: themesberg/flowbite-svelte#1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components, both the regular focus styling (controlled by ringClasses) and focus-within styling need to be dynamically adjusted based on validation state. For proper validation styling, create separate objects for focus-within classes (like focusWithinClasses) that use the same color as ringClasses when inputInvalid=true.
src/lib/device-mockups/Desktop.svelte (1)
Learnt from: mrh1997
PR: themesberg/flowbite-svelte#1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.
src/lib/device-mockups/Smartwatch.svelte (1)
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components, both the regular focus styling (controlled by ringClasses) and focus-within styling need to be dynamically adjusted based on validation state. For proper validation styling, create separate objects for focus-within classes (like focusWithinClasses) that use the same color as ringClasses when inputInvalid=true.
src/lib/device-mockups/Tablet.svelte (1)
Learnt from: mrh1997
PR: themesberg/flowbite-svelte#1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.
src/lib/types.ts (2)
Learnt from: Chizaruu
PR: themesberg/flowbite-svelte#1465
File: src/lib/forms/Timepicker.svelte:105-116
Timestamp: 2024-10-18T09:38:03.879Z
Learning: In `Timepicker.svelte`, the `Dropdown` opens as intended and is used exclusively with the 'dropdown' and 'timerange-dropdown' Timepicker types.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:11:53.953Z
Learning: In the Flowbite Svelte library's MultiInput component, the 'inputInvalid' property should be exported and passed to the Wrapper component to properly style the component's ring with red color when validation fails, similar to how the Input component handles validation states.
🧬 Code Graph Analysis (4)
src/lib/breadcrumb/theme.ts (2)
src/lib/breadcrumb/index.ts (2)
  • breadcrumb (3-3)
  • breadcrumbItem (3-3)
src/lib/theme/themeUtils.ts (1)
  • Classes (11-13)
src/lib/datepicker/theme.ts (1)
src/lib/theme/themeUtils.ts (1)
  • Classes (11-13)
src/lib/device-mockups/theme.ts (2)
src/lib/device-mockups/index.ts (7)
  • android (9-9)
  • defaultMockup (9-9)
  • desktop (9-9)
  • ios (9-9)
  • laptop (9-9)
  • smartwatch (9-9)
  • tablet (9-9)
src/lib/theme/themeUtils.ts (1)
  • Classes (11-13)
src/lib/types.ts (5)
src/lib/breadcrumb/theme.ts (2)
  • BreadcrumbVariants (5-5)
  • BreadcrumbItemVariants (25-25)
src/lib/button-group/theme.ts (1)
  • ButtonGroupVariants (4-4)
src/lib/device-mockups/theme.ts (7)
  • DesktopVariants (33-33)
  • LaptopVariants (59-59)
  • AndroidVariants (4-4)
  • DefaultMockupVariants (19-19)
  • IosVariants (45-45)
  • SmartwatchVariants (71-71)
  • TabletVariants (85-85)
src/lib/forms/helper/theme.ts (1)
  • HelperVariants (4-4)
src/lib/toolbar/theme.ts (1)
  • ToolbarGroupVariants (91-91)
🪛 ESLint
src/lib/types.ts

[error] 346-346: An interface declaring no members is equivalent to its supertype.

(@typescript-eslint/no-empty-object-type)


[error] 572-572: An interface declaring no members is equivalent to its supertype.

(@typescript-eslint/no-empty-object-type)


[error] 1073-1073: An interface declaring no members is equivalent to its supertype.

(@typescript-eslint/no-empty-object-type)


[error] 1418-1418: An interface declaring no members is equivalent to its supertype.

(@typescript-eslint/no-empty-object-type)


[error] 1428-1428: An interface declaring no members is equivalent to its supertype.

(@typescript-eslint/no-empty-object-type)

🔇 Additional comments (64)
src/lib/button-group/theme.ts (1)

2-4: LGTM! Clean type definition implementation.

The addition of VariantProps import and ButtonGroupVariants type alias properly follows the established pattern for standardizing variant types across the codebase. This enhances type safety while maintaining consistency.

src/lib/card/theme.ts (1)

3-5: LGTM! Proper type enhancement for classes support.

The addition of Classes<typeof card> to the CardVariants type alias correctly extends the type to support the new classes prop system. This intersection type provides both variant props and class customization capabilities.

src/lib/datepicker/Datepicker.svelte (1)

287-287: Verify removal of classes?.base from calendar container.

The removal of classes?.base from the calendar dropdown div seems inconsistent with the broader refactoring pattern. Other elements in the component still support classes customization (e.g., classes?.button, classes?.titleVariant, classes?.nav), but the main calendar container no longer does.

This could be a breaking change for users who were styling the calendar container through classes.base. Please verify if this removal is intentional or if it should be retained for consistency.

src/lib/card/Card.svelte (2)

3-10: LGTM! Excellent implementation of classes prop with backward compatibility.

The implementation properly handles the transition from individual class props to the unified classes prop:

  • Proper deprecation warning for imgClass using themeDeprecated
  • Clean fallback mechanism through the styling derived variable
  • Maintains backward compatibility while encouraging migration to the new API

28-28: Clean styling implementation.

The use of styling.image provides a unified way to handle both the new classes.image prop and the deprecated imgClass prop, maintaining consistency with the new styling API.

src/lib/breadcrumb/BreadcrumbItem.svelte (2)

7-9: LGTM! Clean implementation of classes prop.

The addition of the classes prop and styling derived variable follows the established pattern. The safe fallback to an empty object ensures no runtime errors.


38-38: Good use of styling customization.

The separator SVG now supports customization through styling.separator, providing users with more flexibility for styling while maintaining the existing theme classes.

src/lib/device-mockups/Tablet.svelte (5)

4-5: Good addition of required imports for the refactor.

The imports for themeDeprecated and clsx are correctly added to support the new styling API and deprecation warnings.


7-7: Proper props destructuring with new styling API.

The destructuring correctly includes the new classes prop and renames class to className to avoid conflicts, while maintaining all deprecated class props for backward compatibility.


9-18: Excellent implementation of deprecation warning and reactive styling.

The themeDeprecated call properly warns about deprecated props, and the $derived reactive variable elegantly handles the fallback from classes to individual deprecated props.


20-20: Consistent slot key renaming from div to base.

The destructuring correctly uses the updated slot keys from the theme function, maintaining consistency with the broader refactor.


23-33: Proper implementation of class composition with clsx.

The template correctly uses the new theme functions with clsx for class composition, properly handling both the new className prop and the styling object for consistent class application.

src/lib/breadcrumb/Breadcrumb.svelte (4)

5-5: Correct import of theme utilities.

The import of themeDeprecated is properly added to support the deprecation warning functionality.


7-7: Proper props destructuring with new styling API.

The destructuring correctly includes the new classes prop while maintaining the deprecated olClass prop for backward compatibility.


9-10: Excellent deprecation handling and reactive styling.

The deprecation warning for olClass is properly implemented, and the reactive styling logic elegantly handles the fallback pattern.


14-16: Consistent slot key usage and class composition.

The destructuring uses the updated base slot key (renamed from nav), and the class derivations properly use clsx for composition with both theme and user-provided classes.

src/lib/datepicker/theme.ts (2)

1-1: Correct import of standardized Classes type.

The import of Classes from theme utilities follows the established pattern for type standardization across the library.


5-5: Improved type definition with standardized pattern.

The DatepickerVariants type now uses the generic Classes<typeof datepicker> type, which is more consistent and reusable than the previous inline partial type definition.

src/lib/device-mockups/DefaultMockup.svelte (4)

2-5: Correct imports for the refactor pattern.

The imports are properly updated to include the required utilities for the new styling API and deprecation handling.


7-18: Consistent implementation of new styling API.

The props destructuring, deprecation warning, and reactive styling logic follow the established pattern perfectly, maintaining backward compatibility while introducing the new classes prop.


20-20: Proper slot key renaming alignment.

The destructuring correctly uses the updated slot keys from the theme function, maintaining consistency with the broader refactor across all device mockups.


23-33: Correct template implementation with clsx.

The template properly uses the new theme functions with clsx for class composition, correctly handling both the new styling approach and backward compatibility.

src/lib/breadcrumb/theme.ts (5)

1-3: Correct imports for enhanced type definitions.

The imports properly add VariantProps and Classes types to support the standardized typing pattern across the library.


5-5: Improved type definition with standardized pattern.

The BreadcrumbVariants type now follows the established pattern of combining VariantProps and Classes types for consistent typing across components.


9-9: Consistent slot key renaming.

The renaming of nav to base aligns with the broader refactor pattern and maintains consistency with other components.


15-15: Proper slot key usage in variant.

The solid variant correctly uses the updated base slot key, maintaining consistency with the renamed slot.


25-25: Consistent type definition for breadcrumb item.

The BreadcrumbItemVariants type follows the same standardized pattern, ensuring consistency across all breadcrumb-related components.

src/lib/device-mockups/Ios.svelte (5)

4-5: LGTM: Proper imports for new functionality

The imports correctly add themeDeprecated for deprecation warnings and clsx for class composition.


7-7: LGTM: Comprehensive props destructuring with new classes prop

The destructuring properly includes the new className (from class prop) and classes object alongside the existing legacy props.


9-18: LGTM: Proper deprecation handling and fallback logic

The implementation correctly:

  • Issues deprecation warnings for legacy props
  • Provides fallback styling that maps old props to new structure
  • Uses reactive $derived for optimal performance

20-20: LGTM: Updated theme slot destructuring

The destructuring correctly uses the new base slot key instead of the old div key, maintaining consistency with the theme refactoring.


23-32: LGTM: Consistent class application with clsx

The class application is consistent across all elements:

  • Uses clsx for proper class composition
  • Applies fallback logic (new prop ?? old prop)
  • Maintains proper styling structure
src/lib/device-mockups/Android.svelte (5)

2-4: LGTM: Proper imports for refactored component

The imports correctly add the necessary utilities for the new classes prop functionality.


7-7: LGTM: Complete props destructuring including all legacy props

The destructuring properly includes all 7 legacy div class props (div2Class through div7Class) alongside the new className and classes props.


9-19: LGTM: Consistent deprecation and fallback implementation

The implementation follows the same pattern as other components with proper deprecation warnings and fallback mapping from legacy props to the new structure.


21-21: LGTM: Updated theme destructuring with base slot

The destructuring correctly uses the new base slot key and includes the leftMid slot specific to the Android component.


24-34: LGTM: Consistent class application pattern

The class application maintains consistency with other components using clsx and proper fallback logic.

src/lib/device-mockups/Smartwatch.svelte (5)

2-4: LGTM: Proper imports for component refactoring

The imports correctly add the necessary utilities for the new classes prop functionality.


7-7: LGTM: Complete props destructuring

The destructuring properly includes all legacy props alongside the new className and classes props.


9-18: LGTM: Consistent deprecation and fallback logic

The implementation correctly maps legacy props to smartwatch-specific slot keys (rightTop, rightBot, etc.) while maintaining the same deprecation pattern.


19-19: LGTM: Updated theme destructuring for smartwatch

The destructuring correctly uses the new base slot key and includes smartwatch-specific slots.


23-33: LGTM: Consistent class application with smartwatch structure

The class application maintains consistency while properly applying to the smartwatch's specific DOM structure.

src/lib/device-mockups/Desktop.svelte (5)

2-4: LGTM: Proper imports for component refactoring

The imports correctly add the necessary utilities for the new classes prop functionality.


7-7: LGTM: Complete props destructuring for desktop mockup

The destructuring properly includes all 4 legacy div class props alongside the new className and classes props.


9-16: LGTM: Consistent deprecation and fallback logic

The implementation correctly maps legacy props to desktop-specific slot keys (inner, bot, botUnder) while maintaining the same deprecation pattern. The component name "DesktopMockup" in the deprecation warning is appropriate.


18-18: LGTM: Updated theme destructuring for desktop

The destructuring correctly uses the new base slot key and includes desktop-specific slots.


21-29: LGTM: Consistent class application with desktop structure

The class application maintains consistency while properly applying to the desktop's specific DOM structure with separate elements for bot and botUnder.

src/lib/device-mockups/theme.ts (3)

1-2: LGTM: Proper imports for enhanced type safety

The imports correctly add Classes and VariantProps types to support the new styling API.


4-4: LGTM: Comprehensive type exports for all device variants

The type exports properly combine VariantProps and Classes types for each device variant, providing enhanced type safety for the new classes prop.

Also applies to: 19-19, 33-33, 45-45, 59-59, 71-71, 85-85


9-9: LGTM: Consistent slot key renaming from div to base

The slot key renaming from div to base is applied consistently across all device variants, aligning with the component refactoring and maintaining consistency with other theme modules.

Also applies to: 24-24, 38-38, 50-50, 64-64, 76-76, 90-90

src/lib/device-mockups/Laptop.svelte (5)

2-4: LGTM: Proper imports for the new styling API

The imports correctly include the new LaptopProps type, themeDeprecated utility for deprecation warnings, and clsx for class composition. This aligns with the broader refactoring effort.


7-8: LGTM: Comprehensive props destructuring with backward compatibility

The props destructuring properly includes the new classes prop alongside the existing deprecated individual class props, maintaining backward compatibility while introducing the new styling API.


9-16: LGTM: Proper deprecation handling and styling logic

The implementation correctly:

  • Uses themeDeprecated to warn about deprecated props
  • Implements fallback logic from new classes prop to old individual props
  • Uses $derived for efficient reactive computation

The styling object properly maps deprecated props to their corresponding new keys.


18-18: LGTM: Consistent slot key naming

The destructuring correctly uses the updated slot key base instead of the old div key, maintaining consistency with the theme refactor mentioned in the AI summary.


22-32: LGTM: Proper template updates with class composition

The template updates correctly:

  • Use the renamed slot keys (base, inner, bot, botCen)
  • Apply clsx for class composition
  • Handle both new (className) and deprecated (divClass) props appropriately
  • Use the styling object for consistent class application

This maintains backward compatibility while implementing the new styling API.

src/lib/types.ts (9)

70-72: LGTM: Proper variant type imports

The imports correctly bring in the new variant types from their respective theme files, supporting the enhanced type safety and styling API. This aligns with the broader refactoring effort.


271-276: LGTM: Enhanced breadcrumb props with variant types

The BreadcrumbProps interface properly extends BreadcrumbVariants, providing better type safety and access to the new classes prop functionality.


278-286: LGTM: Enhanced breadcrumb item props with variant types

The BreadcrumbItemProps interface properly extends BreadcrumbItemVariants, maintaining consistency with the breadcrumb refactor.


289-293: LGTM: Enhanced button group props with variant types

The ButtonGroupProps interface properly extends ButtonGroupVariants, providing access to the new styling API.


480-486: LGTM: Enhanced desktop mockup props with variant types

The DesktopProps interface properly extends DesktopVariants, providing access to the new classes prop while maintaining backward compatibility with individual class props.


488-494: LGTM: Enhanced laptop mockup props with variant types

The LaptopProps interface properly extends LaptopVariants, consistent with the changes in the Laptop.svelte component.


496-545: LGTM: Consistent device mockup props updates

All device mockup props interfaces (AndroidProps, DefaultMockupProps, IosProps, SmartwatchProps, TabletProps) consistently extend their respective variant types, providing uniform access to the new styling API.


906-906: LGTM: Proper type consolidation

The change from a separate ButtonGroupSizeType to ButtonGroupVariants["size"] represents proper type consolidation, eliminating duplication and ensuring consistency.


729-729: LGTM: Enhanced helper props with variant types

The HelperProps interface properly extends HelperVariants, providing better type safety consistent with the overall refactor.

@shinokada shinokada merged commit 376df98 into themesberg:main Jul 17, 2025
1 of 2 checks passed
@jjagielka jjagielka deleted the classes2 branch July 17, 2025 11:40
@coderabbitai coderabbitai bot mentioned this pull request Jul 19, 2025
8 tasks
@coderabbitai coderabbitai bot mentioned this pull request Aug 11, 2025
8 tasks
This was referenced Oct 28, 2025
@coderabbitai coderabbitai bot mentioned this pull request Nov 6, 2025
16 tasks
@coderabbitai coderabbitai bot mentioned this pull request Nov 24, 2025
15 tasks
This was referenced Dec 19, 2025
This was referenced Dec 28, 2025
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.

2 participants