Skip to content

Conversation

@Kiarokh
Copy link
Contributor

@Kiarokh Kiarokh commented Jul 31, 2025

fix https://github.com/Lundalogik/crm-client/issues/216

Summary by CodeRabbit

  • New Features
    • Introduced a versatile list item with icons, images, actions menu, selectable modes (option/radio/checkbox), badges/chevrons, command text, and primary components.
    • Added multiple interactive examples (basic, actions, icons, icon size, pictures, multiple lines, radio/checkbox, command text, interactive).
  • Style
    • Refreshed list and item visuals: improved focus states, hover/active rounding, avatar styling, and default colors; increased list border radius.
  • Refactor
    • Lists and menus now render using the new list item for consistent behavior and accessibility.
    • Removed menu-list setting for max lines of secondary text (breaking).
  • Documentation
    • Clarified icon and image descriptions; updated deprecation notices.

MDC dependency

Completely removed the dependency on MDC's styles for list and list items. Now we own the CSS entirely, and only rely on MDC's foundation for a few details such as handling some interactions with list items, and dynamic switching of tabindex on items.

How to test

List items are everywhere; they are in menus, select-dropdowns, input field suggestions, list, radio button group, etc… Check all these to make sure they work like before.

Review:

  • Commits are atomic
  • Commits have the correct type for the changes made
  • Commits with breaking changes are marked as such

Browsers tested:

(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)

Windows:

  • Chrome
  • Edge
  • Firefox

Linux:

  • Chrome
  • Firefox

macOS:

  • Chrome
  • Firefox
  • Safari

Mobile:

  • Chrome on Android
  • iOS

@Kiarokh Kiarokh self-assigned this Jul 31, 2025
@Kiarokh Kiarokh added the maintenance Things that are important but not urgent, and not directly related to any specific bug or feature label Jul 31, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 31, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Introduces a new limel-list-item component and supporting styles. Refactors list and menu-list renderers to delegate item rendering to limel-list-item, updates tests to assert reflected attributes, and adjusts styles/partials accordingly. Adds a menu-item-meta subcomponent. Provides multiple example components and SCSS demonstrating icons, actions, selection, primary components, pictures, and layout options. Minor deprecation text updates.

Changes

Cohort / File(s) Summary of changes
New list item component
src/components/list-item/list-item.tsx, src/components/list-item/list-item.scss
Adds limel-list-item with props for text, secondaryText, icon/image, primaryComponent, actions, selection types (option/radio/checkbox), ARIA handling, keyboard interactions, and interact event; comprehensive styling for layout and states.
Menu item meta subcomponent
src/components/list-item/menu-item-meta/menu-item-meta.tsx, src/components/list-item/menu-item-meta/menu-item-meta.scss
Adds limel-menu-item-meta to display command text, badge, and optional chevron; exposes CSS properties for badge colors; styles layout within menu contexts.
List renderer refactor and styles
src/components/list/list-renderer.tsx, src/components/list/list.scss, src/components/list/partial-styles/_has-grid-layout.scss, src/components/list/partial-styles/_static-actions.scss, src/components/list/partial-styles/custom-styles.scss, src/components/list/partial-styles/enable-multiline-text.scss, src/components/list/list.e2e.ts, src/components/list/list.tsx, src/components/list/list-item.types.ts, src/components/list/examples/list-badge-icons.scss
Replaces LI-based/MDC paths with limel-list-item; simplifies rendering pipeline; updates list styles and partials, removes multiline override file; adjusts e2e tests to assert reflected attributes/roles; updates deprecation message; minor JSDoc edits; tweaks example list SCSS token.
Menu list refactor and API change
src/components/menu-list/menu-list-renderer.tsx, src/components/menu-list/menu-list.scss, src/components/menu-list/menu-list.e2e.ts, src/components/menu-list/menu-list.tsx
Switches to limel-list-item for items; introduces primary meta via limel-menu-item-meta; simplifies styles; updates tests to attribute assertions; removes maxLinesSecondaryText prop; updates deprecation message.
List-item examples and example styles
src/components/list-item/examples/list-item-basic.tsx, .../list-item-actions.tsx, .../list-item-checkbox.tsx, .../list-item-command-text.tsx, .../list-item-icon-size.tsx, .../list-item-icon.tsx, .../list-item-interactive.tsx, .../list-item-interactive.scss, .../list-item-multiple-lines.tsx, .../list-item-pictures.tsx, .../list-item-primary-component.tsx, .../list-item-basic.scss
Adds multiple example components showcasing basic usage, actions, checkbox/radio types, command text/badges/chevron, icon size/badgeIcon, interactive selection, multiline secondary text, pictures, and custom primary components; includes example styling.
Menu example updates
src/components/menu/examples/menu-badge-icons.tsx
Updates icon color tokens, adjusts separators, and adds a Delete item with icon and background color.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant List as limel-list / limel-menu-list
  participant Item as limel-list-item
  participant Menu as limel-menu (actions)
  participant App as Consumer

  User->>List: Focus/Click on item
  List->>Item: Render item props (text, icon, type, selected, actions, ...)
  User->>Item: Click / Enter / Space
  alt Item disabled
    Item-->>User: No action
  else Selectable (option/radio/checkbox)
    Item->>Item: Toggle selected
    Item-->>List: emit("interact", { selected, item })
    List-->>App: propagate change (selection state)
  else Non-selectable
    Item-->>List: emit("interact", { selected: false, item })
    List-->>App: propagate interaction
  end

  opt Actions menu provided
    User->>Item: Click action trigger
    Item->>Menu: Open with actions
    User->>Menu: Choose action
    Menu-->>App: action event with chosen item
  end
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested labels

visual design, accessibility

Suggested reviewers

  • adrianschmidt
  • Befkadu1
  • john-traas
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch list-item

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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

@github-actions
Copy link

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3628/

@Kiarokh Kiarokh force-pushed the list-item branch 2 times, most recently from 2af18fa to cd1dc2e Compare August 5, 2025 12:20
@Kiarokh Kiarokh mentioned this pull request Aug 5, 2025
@Kiarokh Kiarokh changed the title feat(list-item): add new component feat(list-item): add new @private component Aug 12, 2025
@Kiarokh Kiarokh force-pushed the list-item branch 8 times, most recently from 9c618e2 to f139cae Compare August 19, 2025 13:40
@Kiarokh Kiarokh force-pushed the list-item branch 4 times, most recently from 0065952 to 4a753da Compare August 21, 2025 13:42
@Kiarokh Kiarokh changed the title feat(list-item): add new @private component @coderabbitai Aug 21, 2025
@Kiarokh Kiarokh marked this pull request as ready for review August 21, 2025 13:42
@coderabbitai coderabbitai bot changed the title @coderabbitai Add limel-list-item and menu-item-meta; refactor list renderers Aug 21, 2025
Copy link

@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: 49

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
src/components/list/partial-styles/custom-styles.scss (1)

11-24: Zebra-stripe CSS variables look swapped (even uses “odd” var and vice versa)

The var names suggest “odd” colors for odd rows, but they’re applied to the opposite nth-child. If that’s unintentional, swap them.

-        &:nth-child(even) {
-            background-color: var(
-                --list-background-color-of-odd-interactive-items,
-                rgb(var(--contrast-200))
-            );
-        }
-        &:nth-child(odd) {
-            background-color: var(
-                --list-background-color-of-even-interactive-items,
-                rgb(var(--contrast-100))
-            );
-        }
+        &:nth-child(even) {
+            background-color: var(
+                --list-background-color-of-even-interactive-items,
+                rgb(var(--contrast-200))
+            );
+        }
+        &:nth-child(odd) {
+            background-color: var(
+                --list-background-color-of-odd-interactive-items,
+                rgb(var(--contrast-100))
+            );
+        }
src/components/menu-list/menu-list.e2e.ts (1)

58-59: Remove unnecessary microtask delay; waitForChanges is sufficient

The extra setTimeout(0) shouldn’t be needed after await page.waitForChanges() and will slow tests.

-            await new Promise((resolve) => setTimeout(resolve, 0));
src/components/list/list.e2e.ts (1)

1-1: Replace absolute imports with relative, type-only imports

Per repo guidelines, non-example TS/TSX files must not import from the package’s public API. Using relative, type-only imports for internal types prevents build issues and removes unnecessary runtime dependencies.

• File src/components/list/list.e2e.ts, line 1:

- import { ListItem, ListSeparator } from '@limetech/lime-elements';
+ import type { ListItem } from './list-item.types';
+ import type { ListSeparator } from '../../global/shared-types/separator.types';

To catch similar violations across the repo, run:

rg -nP -g '*.ts' -g '*.tsx' -g '!src/components/**/examples/**' -e "from\s+['\"]@limetech/lime-elements['\"]"
src/components/menu-list/menu-list-renderer.tsx (1)

29-33: Add maxLinesSecondaryText to MenuListRendererConfig and make it configurable

The renderer is currently hard-coding --maxLinesSecondaryText: '2', but the MenuListRendererConfig interface doesn’t expose this option. This needs a mandatory refactor to restore configurability and avoid breaking consumers.

• In src/components/menu-list/menu-list-renderer.tsx (around line 32), replace the hard-coded style with a dynamic config fallback
• In src/components/menu-list/menu-list-renderer-config.ts, extend the interface with maxLinesSecondaryText?: number
• Document the new option in the CHANGELOG and note that the default remains 2 (breaking change)

Suggested diff:

--- a/src/components/menu-list/menu-list-renderer.tsx
@@ export class MenuListRenderer {
-            <ul
-                class="mdc-deprecated-list"
-                role="menu"
-                aria-orientation="vertical"
-                style={{ '--maxLinesSecondaryText': '2' }}
-            >
+            <ul
+                class="mdc-deprecated-list"
+                role="menu"
+                aria-orientation="vertical"
+                style={{
+                    '--maxLinesSecondaryText': String(
+                        this.config.maxLinesSecondaryText ?? 2
+                    ),
+                }}
+            >
--- a/src/components/menu-list/menu-list-renderer-config.ts
@@ export interface MenuListRendererConfig {
     iconSize?: IconSize;
+    /** Max number of lines for secondary text before truncation */
+    maxLinesSecondaryText?: number;
 }
src/components/list/list.scss (1)

26-38: UL reset looks good; consider exposing list margin as a public variable

--list-margin is currently internal. If consumers need to align lists with surrounding content, consider documenting it as public; otherwise prefix with --limel-list-margin to clarify scope.

♻️ Duplicate comments (1)
src/components/list-item/list-item.tsx (1)

44-44: API extractor error needs resolution.

Based on the past review comment, the api-extractor fails to analyze ListItemInterface export. This issue may persist and needs to be addressed before merging.

#!/bin/bash
# Verify if the API extractor issue has been resolved
# Check if ListItemInterface is properly exported from list-item.types.ts
fd -e ts "list-item.types" --exec cat {} \; | head -20
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c2b86b8 and 24f47f1.

📒 Files selected for processing (32)
  • src/components/list-item/examples/list-item-actions.tsx (1 hunks)
  • src/components/list-item/examples/list-item-basic.scss (1 hunks)
  • src/components/list-item/examples/list-item-basic.tsx (1 hunks)
  • src/components/list-item/examples/list-item-checkbox.tsx (1 hunks)
  • src/components/list-item/examples/list-item-command-text.tsx (1 hunks)
  • src/components/list-item/examples/list-item-icon-size.tsx (1 hunks)
  • src/components/list-item/examples/list-item-icon.tsx (1 hunks)
  • src/components/list-item/examples/list-item-interactive.scss (1 hunks)
  • src/components/list-item/examples/list-item-interactive.tsx (1 hunks)
  • src/components/list-item/examples/list-item-multiple-lines.tsx (1 hunks)
  • src/components/list-item/examples/list-item-pictures.tsx (1 hunks)
  • src/components/list-item/examples/list-item-primary-component.tsx (1 hunks)
  • src/components/list-item/examples/list-item-radio.tsx (1 hunks)
  • src/components/list-item/list-item.scss (1 hunks)
  • src/components/list-item/list-item.tsx (1 hunks)
  • src/components/list-item/menu-item-meta/menu-item-meta.scss (1 hunks)
  • src/components/list-item/menu-item-meta/menu-item-meta.tsx (1 hunks)
  • src/components/list/examples/list-badge-icons.scss (1 hunks)
  • src/components/list/list-item.types.ts (2 hunks)
  • src/components/list/list-renderer.tsx (2 hunks)
  • src/components/list/list.e2e.ts (5 hunks)
  • src/components/list/list.scss (3 hunks)
  • src/components/list/list.tsx (1 hunks)
  • src/components/list/partial-styles/_has-grid-layout.scss (2 hunks)
  • src/components/list/partial-styles/_static-actions.scss (2 hunks)
  • src/components/list/partial-styles/custom-styles.scss (2 hunks)
  • src/components/list/partial-styles/enable-multiline-text.scss (0 hunks)
  • src/components/menu-list/menu-list-renderer.tsx (2 hunks)
  • src/components/menu-list/menu-list.e2e.ts (3 hunks)
  • src/components/menu-list/menu-list.scss (1 hunks)
  • src/components/menu-list/menu-list.tsx (1 hunks)
  • src/components/menu/examples/menu-badge-icons.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • src/components/list/partial-styles/enable-multiline-text.scss
🧰 Additional context used
📓 Path-based instructions (6)
src/components/**/*.scss

📄 CodeRabbit inference engine (.cursor/rules/css-class-names-in-components-using-shadow-dom.mdc)

Do not use BEM-style class names in CSS for components, as components use shadow-DOM.

Files:

  • src/components/list-item/examples/list-item-interactive.scss
  • src/components/list/partial-styles/_has-grid-layout.scss
  • src/components/list/partial-styles/custom-styles.scss
  • src/components/list/examples/list-badge-icons.scss
  • src/components/list-item/examples/list-item-basic.scss
  • src/components/menu-list/menu-list.scss
  • src/components/list-item/list-item.scss
  • src/components/list-item/menu-item-meta/menu-item-meta.scss
  • src/components/list/partial-styles/_static-actions.scss
  • src/components/list/list.scss
**/*.{tsx,scss}

⚙️ CodeRabbit configuration file

**/*.{tsx,scss}: Almost all our components use shadow-DOM. Therefore, we have no need of BEM-style class names in our CSS.

Files:

  • src/components/list-item/examples/list-item-interactive.scss
  • src/components/list/list.tsx
  • src/components/list/partial-styles/_has-grid-layout.scss
  • src/components/list-item/examples/list-item-icon.tsx
  • src/components/list-item/examples/list-item-interactive.tsx
  • src/components/list/partial-styles/custom-styles.scss
  • src/components/list/examples/list-badge-icons.scss
  • src/components/list-item/examples/list-item-radio.tsx
  • src/components/list-item/list-item.tsx
  • src/components/list-item/examples/list-item-icon-size.tsx
  • src/components/list-item/menu-item-meta/menu-item-meta.tsx
  • src/components/list-item/examples/list-item-basic.scss
  • src/components/list-item/examples/list-item-command-text.tsx
  • src/components/list-item/examples/list-item-pictures.tsx
  • src/components/list-item/examples/list-item-primary-component.tsx
  • src/components/menu-list/menu-list.scss
  • src/components/list-item/list-item.scss
  • src/components/list-item/examples/list-item-checkbox.tsx
  • src/components/menu-list/menu-list.tsx
  • src/components/list/list-renderer.tsx
  • src/components/list-item/menu-item-meta/menu-item-meta.scss
  • src/components/list-item/examples/list-item-basic.tsx
  • src/components/list-item/examples/list-item-actions.tsx
  • src/components/menu-list/menu-list-renderer.tsx
  • src/components/menu/examples/menu-badge-icons.tsx
  • src/components/list-item/examples/list-item-multiple-lines.tsx
  • src/components/list/partial-styles/_static-actions.scss
  • src/components/list/list.scss
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/wrap-multiple-jsx-elements-in-host-not-in-array.mdc)

When returning multiple JSX elements from the render method, never wrap them in an array literal. Instead, always wrap them in the special <Host> element. When there is already a single top-level element, it does not have to be wrapped in <Host>.

Files:

  • src/components/list/list.tsx
  • src/components/list-item/examples/list-item-icon.tsx
  • src/components/list-item/examples/list-item-interactive.tsx
  • src/components/list-item/examples/list-item-radio.tsx
  • src/components/list-item/list-item.tsx
  • src/components/list-item/examples/list-item-icon-size.tsx
  • src/components/list-item/menu-item-meta/menu-item-meta.tsx
  • src/components/list-item/examples/list-item-command-text.tsx
  • src/components/list-item/examples/list-item-pictures.tsx
  • src/components/list-item/examples/list-item-primary-component.tsx
  • src/components/list-item/examples/list-item-checkbox.tsx
  • src/components/menu-list/menu-list.tsx
  • src/components/list/list-renderer.tsx
  • src/components/list-item/examples/list-item-basic.tsx
  • src/components/list-item/examples/list-item-actions.tsx
  • src/components/menu-list/menu-list-renderer.tsx
  • src/components/menu/examples/menu-badge-icons.tsx
  • src/components/list-item/examples/list-item-multiple-lines.tsx

⚙️ CodeRabbit configuration file

**/*.tsx: Our .tsx files are typically using StencilJS, not React. When a developer wants to return multiple top-level JSX elements from the render method, they will sometimes wrap them in an array literal. In these cases, rather than recommending they add key properties to the elements, recommend removing the hardcoded array literal. Recommend wrapping the elements in StencilJS's special <Host> element.

Files:

  • src/components/list/list.tsx
  • src/components/list-item/examples/list-item-icon.tsx
  • src/components/list-item/examples/list-item-interactive.tsx
  • src/components/list-item/examples/list-item-radio.tsx
  • src/components/list-item/list-item.tsx
  • src/components/list-item/examples/list-item-icon-size.tsx
  • src/components/list-item/menu-item-meta/menu-item-meta.tsx
  • src/components/list-item/examples/list-item-command-text.tsx
  • src/components/list-item/examples/list-item-pictures.tsx
  • src/components/list-item/examples/list-item-primary-component.tsx
  • src/components/list-item/examples/list-item-checkbox.tsx
  • src/components/menu-list/menu-list.tsx
  • src/components/list/list-renderer.tsx
  • src/components/list-item/examples/list-item-basic.tsx
  • src/components/list-item/examples/list-item-actions.tsx
  • src/components/menu-list/menu-list-renderer.tsx
  • src/components/menu/examples/menu-badge-icons.tsx
  • src/components/list-item/examples/list-item-multiple-lines.tsx
**/*.{ts,tsx}

⚙️ CodeRabbit configuration file

**/*.{ts,tsx}: Imports from other files in the same module (lime-elements) must use relative paths. Using absolute paths for imports will cause the production build to fail.

Files:

  • src/components/list/list.tsx
  • src/components/menu-list/menu-list.e2e.ts
  • src/components/list-item/examples/list-item-icon.tsx
  • src/components/list-item/examples/list-item-interactive.tsx
  • src/components/list-item/examples/list-item-radio.tsx
  • src/components/list-item/list-item.tsx
  • src/components/list/list-item.types.ts
  • src/components/list/list.e2e.ts
  • src/components/list-item/examples/list-item-icon-size.tsx
  • src/components/list-item/menu-item-meta/menu-item-meta.tsx
  • src/components/list-item/examples/list-item-command-text.tsx
  • src/components/list-item/examples/list-item-pictures.tsx
  • src/components/list-item/examples/list-item-primary-component.tsx
  • src/components/list-item/examples/list-item-checkbox.tsx
  • src/components/menu-list/menu-list.tsx
  • src/components/list/list-renderer.tsx
  • src/components/list-item/examples/list-item-basic.tsx
  • src/components/list-item/examples/list-item-actions.tsx
  • src/components/menu-list/menu-list-renderer.tsx
  • src/components/menu/examples/menu-badge-icons.tsx
  • src/components/list-item/examples/list-item-multiple-lines.tsx
src/components/**/*.tsx

⚙️ CodeRabbit configuration file

src/components/**/*.tsx: When contributors add new props to existing components in the lime-elements repository, they should always add documentation examples that demonstrate the new prop's usage and explain how it works. This helps with user adoption, feature discoverability, and maintains comprehensive documentation.

Files:

  • src/components/list/list.tsx
  • src/components/list-item/examples/list-item-icon.tsx
  • src/components/list-item/examples/list-item-interactive.tsx
  • src/components/list-item/examples/list-item-radio.tsx
  • src/components/list-item/list-item.tsx
  • src/components/list-item/examples/list-item-icon-size.tsx
  • src/components/list-item/menu-item-meta/menu-item-meta.tsx
  • src/components/list-item/examples/list-item-command-text.tsx
  • src/components/list-item/examples/list-item-pictures.tsx
  • src/components/list-item/examples/list-item-primary-component.tsx
  • src/components/list-item/examples/list-item-checkbox.tsx
  • src/components/menu-list/menu-list.tsx
  • src/components/list/list-renderer.tsx
  • src/components/list-item/examples/list-item-basic.tsx
  • src/components/list-item/examples/list-item-actions.tsx
  • src/components/menu-list/menu-list-renderer.tsx
  • src/components/menu/examples/menu-badge-icons.tsx
  • src/components/list-item/examples/list-item-multiple-lines.tsx
src/components/**/examples/**/*.{ts,tsx}

⚙️ CodeRabbit configuration file

src/components/**/examples/**/*.{ts,tsx}: These files are an exception to the rule that all imports should use relative paths. When these example files import something that is publicly exported by lime-elements, the import should be made from @limetech/lime-elements. If they import something from another file inside the example folder, the import should use a relative path.

Files:

  • src/components/list-item/examples/list-item-icon.tsx
  • src/components/list-item/examples/list-item-interactive.tsx
  • src/components/list-item/examples/list-item-radio.tsx
  • src/components/list-item/examples/list-item-icon-size.tsx
  • src/components/list-item/examples/list-item-command-text.tsx
  • src/components/list-item/examples/list-item-pictures.tsx
  • src/components/list-item/examples/list-item-primary-component.tsx
  • src/components/list-item/examples/list-item-checkbox.tsx
  • src/components/list-item/examples/list-item-basic.tsx
  • src/components/list-item/examples/list-item-actions.tsx
  • src/components/menu/examples/menu-badge-icons.tsx
  • src/components/list-item/examples/list-item-multiple-lines.tsx
🧠 Learnings (9)
📓 Common learnings
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3518
File: src/components/notched-outline/examples/notched-outline-basic.scss:11-22
Timestamp: 2025-04-14T10:01:18.721Z
Learning: Examples in Lime Elements use Shadow DOM (with `shadow: true` in the component decorator) for style encapsulation, making additional class-based selectors unnecessary. This ensures styles are automatically scoped to each component without leaking to the rest of the application.
📚 Learning: 2025-04-29T14:15:32.104Z
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3529
File: src/components/ai-avatar/ai-avatar.scss:20-22
Timestamp: 2025-04-29T14:15:32.104Z
Learning: In components using Shadow DOM (like those in lime-elements), the universal selector `*` is already scoped to the component's shadow tree and won't cause unwanted side effects outside the component. There's no functional difference between `*` and `:host *` in this context.

Applied to files:

  • src/components/list-item/examples/list-item-interactive.scss
  • src/components/list-item/examples/list-item-basic.scss
  • src/components/menu-list/menu-list.scss
  • src/components/list-item/list-item.scss
📚 Learning: 2025-04-14T10:01:18.721Z
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3518
File: src/components/notched-outline/examples/notched-outline-basic.scss:11-22
Timestamp: 2025-04-14T10:01:18.721Z
Learning: Examples in Lime Elements use Shadow DOM (with `shadow: true` in the component decorator) for style encapsulation, making additional class-based selectors unnecessary. This ensures styles are automatically scoped to each component without leaking to the rest of the application.

Applied to files:

  • src/components/list-item/examples/list-item-interactive.scss
  • src/components/list-item/list-item.scss
📚 Learning: 2025-08-12T14:01:27.846Z
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3638
File: src/components/radio-button-group/radio-button-group.tsx:91-91
Timestamp: 2025-08-12T14:01:27.846Z
Learning: The `limel-radio-button-group` component has accessibility concerns because it uses `limel-list` for rendering, which doesn't follow WAI-ARIA APG keyboard navigation patterns for radio button groups. Arrow keys should move focus AND select in radio groups, but limel-list requires arrow keys to move focus, then Enter/Space to select.

Applied to files:

  • src/components/list/list.tsx
  • src/components/list-item/examples/list-item-radio.tsx
  • src/components/list-item/list-item.scss
📚 Learning: 2025-07-30T14:20:41.791Z
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3624
File: src/components/button-group/button-group.scss:115-118
Timestamp: 2025-07-30T14:20:41.791Z
Learning: In lime-elements, CSS custom properties like `--limel-theme-surface-background-color` are applied at :root level via `core-styles.scss` and should be expected to be available without fallbacks. The library's architecture guarantees these theme variables are present, so adding fallbacks would be redundant and go against the design intention.

Applied to files:

  • src/components/list/examples/list-badge-icons.scss
  • src/components/list-item/list-item.scss
📚 Learning: 2025-08-12T14:01:27.846Z
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3638
File: src/components/radio-button-group/radio-button-group.tsx:91-91
Timestamp: 2025-08-12T14:01:27.846Z
Learning: The `limel-radio-button-group` component allows deselection of radio buttons (unlike native radio buttons), which improves UX by letting users leave questions unanswered, but diverges from standard radio button behavior expectations.

Applied to files:

  • src/components/list-item/examples/list-item-radio.tsx
  • src/components/list-item/list-item.scss
📚 Learning: 2025-08-07T14:39:00.053Z
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3638
File: src/components/radio-button-group/radio-button-group.tsx:32-32
Timestamp: 2025-08-07T14:39:00.053Z
Learning: The `limel-radio-button-group` component uses `shadow: false` because it's a pure wrapper around `limel-list` with no component-specific styles, following the pattern of other wrapper components like `limel-action-bar-overflow-menu`.

Applied to files:

  • src/components/list-item/examples/list-item-radio.tsx
  • src/components/menu-list/menu-list.scss
  • src/components/list-item/list-item.scss
  • src/components/list/list.scss
📚 Learning: 2025-04-25T14:22:02.157Z
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3529
File: src/components/lime-ai-avatar/lime-ai-avatar.scss:24-28
Timestamp: 2025-04-25T14:22:02.157Z
Learning: In lime-elements, CSS custom properties follow a specific naming convention:
1. Internal use variables (not for consumers) are prefixed with `--limel-component-name-`
2. External use variables (intended for consumers) are prefixed with `--component-name-`
Variables documented with JSDoc comments are typically meant for external use.

Applied to files:

  • src/components/list-item/list-item.scss
📚 Learning: 2025-04-16T14:14:18.253Z
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. Example files should only import public exports from 'limetech/lime-elements' or use relative imports for other files within the examples folder. Duplicating simple type definitions in example files is preferred over importing internal types.

Applied to files:

  • src/components/list-item/examples/list-item-checkbox.tsx
  • src/components/list-item/examples/list-item-basic.tsx
🧬 Code graph analysis (13)
src/components/list-item/examples/list-item-interactive.tsx (3)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/list-item/examples/list-item-actions.tsx (1)
  • Component (18-89)
src/components/list-item/examples/list-item-checkbox.tsx (1)
  • Component (27-138)
src/components/list-item/examples/list-item-radio.tsx (2)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/list-item/examples/list-item-checkbox.tsx (1)
  • Component (27-138)
src/components/list-item/list-item.tsx (7)
src/components/list/list-item.types.ts (2)
  • ListItem (11-72)
  • ListSeparator (90-90)
src/components/icon/icon.types.ts (1)
  • IconSize (4-4)
src/util/random-string.ts (1)
  • createRandomString (1-10)
src/components/icon/get-icon-props.ts (1)
  • getIconName (11-24)
src/components/menu/menu.types.ts (1)
  • MenuItem (58-135)
src/components/radio-button-group/radio-button.template.tsx (1)
  • RadioButtonTemplate (39-64)
src/components/checkbox/checkbox.template.tsx (1)
  • CheckboxTemplate (20-102)
src/components/list-item/examples/list-item-icon-size.tsx (3)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/icon/icon.types.ts (1)
  • IconSize (4-4)
src/components/select/option.types.ts (1)
  • Option (7-56)
src/components/list-item/menu-item-meta/menu-item-meta.tsx (2)
src/components/list-item/examples/list-item-command-text.tsx (1)
  • Component (14-60)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/list-item/examples/list-item-command-text.tsx (2)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/list-item/menu-item-meta/menu-item-meta.tsx (1)
  • Component (13-70)
src/components/list-item/examples/list-item-pictures.tsx (2)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/list-item/examples/list-item-icon.tsx (1)
  • Component (10-64)
src/components/list-item/examples/list-item-primary-component.tsx (2)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/menu/menu.types.ts (1)
  • MenuItem (58-135)
src/components/list-item/examples/list-item-checkbox.tsx (3)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/list-item/examples/list-item-radio.tsx (1)
  • Component (27-115)
src/components/list/list-item.types.ts (1)
  • ListItem (11-72)
src/components/list-item/examples/list-item-basic.tsx (1)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/list-item/examples/list-item-actions.tsx (4)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/list-item/examples/list-item-checkbox.tsx (1)
  • Component (27-138)
src/components/menu/menu.types.ts (1)
  • MenuItem (58-135)
src/components/list/list-item.types.ts (2)
  • ListSeparator (90-90)
  • ListItem (11-72)
src/components/menu-list/menu-list-renderer.tsx (1)
src/components/list/list-item.types.ts (1)
  • ListSeparator (90-90)
src/components/list-item/examples/list-item-multiple-lines.tsx (2)
src/components/list-item/list-item.tsx (1)
  • Component (37-400)
src/components/select/option.types.ts (1)
  • Option (7-56)
🪛 Biome (2.1.2)
src/components/list-item/examples/list-item-interactive.tsx

[error] 41-50: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)


[error] 51-51: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)


[error] 63-63: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

src/components/list-item/list-item.tsx

[error] 177-178: A form label must be associated with an input.

Consider adding a for or htmlFor attribute to the label element or moving the input element to inside the label element.

(lint/a11y/noLabelWithoutControl)

src/components/list-item/examples/list-item-checkbox.tsx

[error] 76-76: The elements with this role can be changed to the following elements:

For examples and more information, see WAI-ARIA Roles

(lint/a11y/useSemanticElements)

src/components/list/list-renderer.tsx

[error] 42-46: The ARIA attribute 'aria-orientation' is not supported by this element.

Ensure that ARIA attributes are valid for the role of the element.

(lint/a11y/useAriaPropsSupportedByRole)

🔇 Additional comments (27)
src/components/list/examples/list-badge-icons.scss (1)

4-4: Token switch to glaucous-dark looks consistent with our palette.

No functional concerns from me. Please confirm visual contrast with common icon glyphs in both light/dark themes during visual QA.

src/components/list/partial-styles/_has-grid-layout.scss (1)

2-2: Grid gap reduced to 0.5rem — check dense layouts and hover/focus states.

Looks good with the PR-wide radius/spacing updates. Please verify that:

  • Focus ring and selection backgrounds don’t visually collide at tighter gaps.
  • Two- and three-column breakpoints still read well for long secondary text.
src/components/menu/examples/menu-badge-icons.tsx (1)

17-41: LGTM on token updates and separator addition

The color token changes and the new Delete entry align with the Icon interface and badge icon styling. No API issues spotted.

src/components/list-item/examples/list-item-radio.tsx (2)

57-74: Consider adding arrow-key selection to match WAI-ARIA Radio Group APG

Current behavior requires Enter/Space to select; arrow keys only move focus. If you want to match APG, handle ArrowLeft/Right/Up/Down on the radiogroup container to update selectedValue and call .focus() on the newly selected limel-list-item.

Do you want me to add a minimal arrow-key handler example here?


1-1: Use a type-only import to avoid bundling types

Import the ListItem type with import type to ensure it’s erased at compile time and not included in runtime bundles.

-import { ListItem } from '@limetech/lime-elements';
+import type { ListItem } from '@limetech/lime-elements';
⛔ Skipped due to learnings
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using 'limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3464
File: src/components/text-editor/prosemirror-adapter/plugins/image/inserter.ts:1-11
Timestamp: 2025-03-04T13:48:44.712Z
Learning: The lime-elements codebase must use relative imports (even with multiple "../") rather than alias imports or re-exports because they export types to `<repo-root>/dist/types`. Using non-relative imports breaks type generation as import paths from generated type files point to full .ts files rather than .d.ts files.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. This includes not importing types from internal files like '../types.ts', especially those marked with beta. Duplicating simple type definitions in example files is preferred over importing internal types that may change.
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3464
File: src/components/text-editor/prosemirror-adapter/plugins/image/inserter.ts:1-11
Timestamp: 2025-03-04T14:27:29.714Z
Learning: In example components (typically found in `src/components/*/examples/`), imports of lime-elements exports should use `limetech/lime-elements` instead of relative paths. This is because example components aren't included in type declarations and are used in documentation to show developers how to properly use lime-elements components.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. Example files should only import public exports from 'limetech/lime-elements' or use relative imports for other files within the examples folder. Duplicating simple type definitions in example files is preferred over importing internal types.
src/components/menu-list/menu-list.tsx (1)

146-162: Double emission of select event in limel-menu-list
The handleSingleSelect method (src/components/menu-list/menu-list.tsx, lines 136–165) currently emits the select event twice: once to “deselect” the previously selected item, and then again for the newly clicked item. However, the @Event() JSDoc for select only describes “a new value [being] selected.”

Please confirm which API is intended:

  • If you want to notify both deselection and selection, consider splitting these into two distinct events (e.g. deselect and select) or updating the documentation and event name to reflect a dual-emission API.
  • If only the activation of the clicked item should be announced, remove the first emission so that select fires exactly once per interaction.

After confirming, update the implementation, add or adjust tests accordingly, and clarify the public API in the documentation.

src/components/list-item/examples/list-item-icon.tsx (2)

19-58: Solid example structure and Stencil patterns are correct

  • Uses <Host> for multiple top-level nodes per our Stencil guideline.
  • Local state + typed handler (CustomEvent<boolean>) is correct; stopPropagation() matches our example conventions.
  • Props passed to limel-list-item align with the component API (icon object, badgeIcon, secondaryText).

23-34: Consider aligning focus/semantics: keep tabindex for demo, but also set type to “menuitem”

These items are focusable (tabindex="0") but are not selectable. Setting type="menuitem" improves ARIA semantics without changing behavior. Keep tabindex="0" so keyboard users can still focus items in this example.

Please confirm this example is intended to be focusable. If not, drop the tabindex attributes instead.

 <limel-list-item
   value={1}
+  type="menuitem"
   tabindex="0"
   text="Santa Hat"
   secondaryText="Santa's favorite"
   icon={{
     name: 'santas_hat',
     title: 'Icon of Santa Hat',
     color: 'rgb(var(--color-coral-default))',
   }}
   badgeIcon={this.badgeIcon}
 />
 <limel-list-item
   value={2}
+  type="menuitem"
   tabindex="0"
   text="Party Hat"
   secondaryText="For the party animals"
   icon={{
     name: 'party_hat',
     title: 'Icon of Party Hat',
     color: 'rgb(var(--color-white))',
     backgroundColor: 'rgb(var(--color-pink-default))',
   }}
   badgeIcon={this.badgeIcon}
 />

Also applies to: 35-47

⛔ Skipped due to learnings
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3638
File: src/components/radio-button-group/radio-button-group.tsx:91-91
Timestamp: 2025-08-12T14:01:27.846Z
Learning: The `limel-radio-button-group` component has accessibility concerns because it uses `limel-list` for rendering, which doesn't follow WAI-ARIA APG keyboard navigation patterns for radio button groups. Arrow keys should move focus AND select in radio groups, but limel-list requires arrow keys to move focus, then Enter/Space to select.
src/components/list/partial-styles/custom-styles.scss (1)

27-31: Hover/focus stacking context: verify no regression after removing z-index logic

Previous MDC styles often bumped z-index on hover to avoid box-shadow/outline clipping. We now only apply is-flat-clickable() with no z-index change. Please verify focus ring/hover visuals aren’t obscured by adjacent items or containers.

src/components/list-item/examples/list-item-multiple-lines.tsx (1)

1-3: Imports follow our examples guideline

Importing Option from @limetech/lime-elements is correct for files under src/components/**/examples/**.

src/components/list-item/examples/list-item-basic.scss (1)

34-57: Good: shadow-DOM scoped selectors, no BEM, and consistent interaction visuals

  • Selectors target limel-list-item directly and avoid BEM as per our guideline.
  • Uses our shared mixins for clickable + keyboard focus.
  • Corner rounding on first/last items is a nice touch for demos.
src/components/list-item/examples/list-item-command-text.tsx (1)

20-58: Clear, focused example; primaryComponent usage is correct

  • Demonstrates limel-menu-item-meta via primaryComponent as intended.
  • Single root element (<ul>) is fine per our Stencil rule.
src/components/list-item/examples/list-item-pictures.tsx (1)

56-59: LGTM: state handling for the control is correct

Stops propagation and updates state from event.detail as expected.

src/components/list-item/examples/list-item-basic.tsx (1)

29-50: LGTM: minimal, well-documented example aligned with component semantics

Single <ul> root is fine (no need for <Host>), and the note on focusability and consumer-applied mixins matches our guidance.

src/components/list-item/menu-item-meta/menu-item-meta.tsx (1)

11-12: Confirm public API exposure of limel-menu-item-meta

I didn’t find any re-exports of the limel-menu-item-meta component in src/index.ts or any barrel files, so it isn’t part of the TypeScript public API. However, by default Stencil will still include every component in its loader bundle—JSDoc’s @private only hides it from generated docs, not from consumers’ runtime.

Please verify the following before merging:

  • The published loader (e.g. in dist/loader) does not register the limel-menu-item-meta tag.
  • There’s no reference to this component in the package’s published entrypoints (main, module, or exports in package.json).
  • If the intent is to fully hide it, consider configuring Stencil to exclude it (for example via an internal flag in stencil.config.ts or moving it out of the scanned components directory).
src/components/list-item/examples/list-item-primary-component.tsx (1)

26-32: LGTM after type fix: action items demonstrate the actions menu correctly

Good coverage of enabled/disabled actions and separators.

src/components/list/list.e2e.ts (4)

45-46: LGTM: Assert item content via reflected attributes.

Asserting text via reflected attributes on <limel-list-item> is robust and avoids DOM structure coupling.


73-74: LGTM: Disabled item text assertion via attributes.


183-192: LGTM: Selectable semantics verified on items (role/type="option").

This aligns with the new renderer mapping selectableoption.


205-205: LGTM: Interact with limel-list-item directly.

Querying the component rather than internal DOM reduces brittleness of the test.

src/components/list/list-renderer.tsx (2)

116-123: LGTM: Clear, explicit mapping from list config to item type.

The mapping maintains semantics while decoupling the renderer from MDC internals.


126-141: LGTM: Unified item rendering through <limel-list-item>.

Passing reflected attributes + data-index preserves testability and reduces DOM coupling.

src/components/list/partial-styles/_static-actions.scss (1)

21-31: Spacing tweaks: check for layout shifts with sticky headers/footers

Changing margins/padding to fixed rem values affects the scroll snapping experience and can shift content when the sticky header/footers toggle classes. Validate in long lists with both top and bottom static actions to ensure no jump or overlap occurs at the transition.

src/components/list/list.scss (3)

3-3: Border radius change: verify across list variants and themes

Increasing $list-border-radius to 0.5rem affects list-group visuals (grid layout, striped rows, static actions, nested lists). Confirm there are no visual regressions, especially where items abut container edges.


64-95: Interactive states: good focus visualization; consider motion preferences and stacking

The focus/hover/active rules and visualize-keyboard-focus() usage are solid. Since you bump z-index to 1, ensure it doesn't conflict with sticky headers/footers or menus that also use z-index. You may also want to disable transitions under prefers-reduced-motion.


40-63: Divider primitives: API looks cleaner than MDC—nice

The new .limel-list-divider-* primitives improve clarity and control. Good use of truncation and token colors.

src/components/list-item/list-item.tsx (1)

24-35: Documentation examples for iconSize, badgeIcon, and type already exist

No further additions are needed—the existing example files cover the new props:

  • iconSize: demonstrated in src/components/list-item/examples/list-item-icon-size.tsx
  • badgeIcon: used in list-item-icon.tsx, list-item-pictures.tsx, list-item-radio.tsx, and list-item-checkbox.tsx
  • type: shown in list-item-radio.tsx, list-item-interactive.tsx, list-item-checkbox.tsx, and list-item-actions.tsx

Likely an incorrect or invalid review comment.

coderabbitai[bot]

This comment was marked as outdated.

@Kiarokh Kiarokh force-pushed the list-item branch 2 times, most recently from 97c4258 to 06ea394 Compare August 28, 2025 13:05
limel-list-item:not([disabled]):not([disabled='true']):hover,
limel-list-item:not([disabled]):not([disabled='true']):focus-visible,
limel-list-item:not([disabled]):not([disabled='true']):focus-within {
background-color: rgb(var(--contrast-400));
Copy link
Contributor

@LucyChyzhova LucyChyzhova Sep 22, 2025

Choose a reason for hiding this comment

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

When the first item is selected and another item is active it looks confusing
Screenshot 2025-09-22 at 10 14 52

@Kiarokh Kiarokh force-pushed the list-item branch 3 times, most recently from 10f3f3a to c5f885b Compare September 23, 2025 10:43
@Kiarokh Kiarokh enabled auto-merge (rebase) September 23, 2025 10:45
@LucyChyzhova
Copy link
Contributor

LucyChyzhova commented Sep 24, 2025

Tested both light and dark mode. Also linked to webclient. Looks good! 🚀 Great Job Kia! ❤️

This internal component will make the implementation of
the new `limel-list-item` easier in the `menu-list-renderer`.
renamed `rendertext` to `renderTextForSeparator` for
clearance and consistency with the `list-renderer`
Use `limel-list-item` to render the menu items.
Note: if the deprecated `iconColor` is defined as a prop for menu items,
it will have no visible visual effect any longer.
The `iconColor` prop however, is not removed yet.
Therefore your builds will not fail!
But you are highly encouraged to use the `Icon` interface instead,
to set the `color` or `backgroundColor` of the icons,
as well described in the documentations.
The deprecated `iconColor` property will be removed soon.
The maximum number of lines of `secondaryText` has never been
decided by the consumer. It has been defined as an inline style
in the `menu-list-renderer`.
Use `limel-list-item` to render the list items.
Note: if the deprecated `iconColor` is defined as a prop for list items,
it will have no visible visual effect any longer.
The `iconColor` prop however, is not removed yet.
Therefore your builds will not fail!
But you are highly encouraged to use the `Icon` interface instead,
to set the `color` or `backgroundColor` of the icons,
as well described in the documentations.
The deprecated `iconColor` property will be removed soon.
The `aria-orientation` attribute is simply not valid for `role="group"`
(which is used for checkboxes), according to the ARIA spec.
This is regardless of how the keyboard navigation actually works.
Using `aria-haspopup="menu"` + `aria-expanded` we properly inform
assistive tech that a menuitem has nested items.
…item` folder

Updated imports in: list-item.tsx, list-renderer.tsx, list.tsx,
interface.ts, select.tsx, select.template.tsx, menu.tsx,
menu-list-renderer.tsx, menu-list.tsx, input-field.tsx,
file-viewer.tsx, progress-flow.types.ts, radio-button-group.tsx,
picker.tsx, and a few examples.
@Kiarokh Kiarokh merged commit daa3421 into main Sep 29, 2025
11 checks passed
@Kiarokh Kiarokh deleted the list-item branch September 29, 2025 18:34
@lime-opensource
Copy link
Collaborator

🎉 This PR is included in version 38.24.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Things that are important but not urgent, and not directly related to any specific bug or feature released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants