From 4261fca9af93d1159340851e9cd95170d66376df Mon Sep 17 00:00:00 2001 From: Cyrine Ben Romdhane <135605630+anicyne@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:03:55 +0100 Subject: [PATCH] Apply BEM refactoring to tree-item Refs: #7036 --- .../src/components/tree-item/component.tsx | 20 +++--- .../src/components/tree-item/shadow.tsx | 1 - .../src/components/tree-item/style.scss | 37 +++++----- .../test/__snapshots__/snapshot.spec.tsx.snap | 40 +++++------ .../default/src/components/tree-item.scss | 59 ++++++++-------- .../ecl/src/ecl-ec/components/tree-item.scss | 65 +++++++++--------- .../ecl/src/ecl-eu/components/tree-item.scss | 67 ++++++++++--------- .../itzbund/src/components/tree-item.scss | 66 +++++++++--------- 8 files changed, 181 insertions(+), 174 deletions(-) diff --git a/packages/components/src/components/tree-item/component.tsx b/packages/components/src/components/tree-item/component.tsx index 7411029f3d..2b87642742 100644 --- a/packages/components/src/components/tree-item/component.tsx +++ b/packages/components/src/components/tree-item/component.tsx @@ -4,6 +4,7 @@ import type { ActivePropType, HrefPropType, LabelPropType, OpenPropType, TreeIte import { validateActive, validateHref, validateLabel, validateOpen } from '../../schema'; import { KolLinkWcTag, KolIconTag, KolTreeTag } from '../../core/component-names'; import { nonce } from '../../utils/dev.utils'; +import clsx from 'clsx'; @Component({ tag: `kol-tree-item-wc`, @@ -19,19 +20,15 @@ export class KolTreeItemWc implements TreeItemAPI { public render(): JSX.Element { const { _href, _active, _hasChildren, _open, _label } = this.state; return ( - +
  • {_hasChildren && ( // eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events - (_open ? void this.handleCollapseClick(event) : void this.handleExpandClick(event))}> + (_open ? void this.handleCollapseClick(event) : void this.handleExpandClick(event))} + > @@ -54,7 +54,7 @@ export class KolTreeItemWc implements TreeItemAPI { {_label} -