Sha256: 04a10b01d778391b5495dca762005886eefadab3a52128451b563c60e014abe3

Contents?: true

Size: 925 Bytes

Versions: 485

Compression:

Stored size: 925 Bytes

Contents

import React from "react"

//CollapsibleTrail component
const CollapsibleTrail = ({ leftOffset }: { leftOffset: number }) => {
  const style: { [key: string]: string | number } = {
    position: "absolute",
    left: `${leftOffset}em`,
    top: 0,
    bottom: 0,
    width: "2px",
    backgroundColor: "#E4E8F0",
  }

  return (
    <div 
        className="collapsible-trail" 
        style={style} 
    />
  )
}

// Updated function to render multiple trails depending on depth
export const renderCollapsibleTrail = (currentDepth: number) => {
  const lines = []
  for (let i = 1; i <= currentDepth; i++) {
    // Calculate leftOffset with additional 0.4rem for each depth level above 1
    const additionalOffset = i > 1 ? (i - 1) * 0.25 : 0
    const leftOffset = i * 1.0 + additionalOffset
    lines.push(<CollapsibleTrail key={i} 
        leftOffset={leftOffset} 
               />
              )
  }
  return lines
}

Version data entries

485 entries across 485 versions & 1 rubygems

Version Path
playbook_ui-14.6.2.pre.alpha.PBNTR666advancedtablefirstcolumn4406 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.7.0.pre.rc.12 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PLAY15814384 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4380 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.7.0.pre.rc.11 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.7.0.pre.rc.10 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1551tiptapextbump4350 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PLAY15814348 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.7.0.pre.rc.9 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.7.0.pre.rc.8 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4316 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.7.0.pre.rc.7 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR576tooltiptruncatedformpills4312 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4305 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.7.0.pre.rc.6 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR576tooltiptruncatedformpills4304 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4303 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR576tooltiptruncatedformpills4296 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1550lazysizesupgrade4295 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4274 app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx