|
23 | 23 | IconHomeFill, |
24 | 24 | IconJobs, |
25 | 25 | IconJobsFill, |
26 | | - IconChevron16Up, |
| 26 | + IconChevronUp, |
27 | 27 | IconQuestion, |
28 | 28 | IconQuestionFill, |
29 | 29 | IconChallenge, |
|
40 | 40 | IconHelpFill, |
41 | 41 | IconStar, |
42 | 42 | IconStarFill, |
| 43 | + IconCompose, |
43 | 44 | } from "@stackoverflow/stacks-icons/icons"; |
44 | 45 | const { Story } = defineMeta({ |
45 | 46 | title: "Components/Navigation", |
|
342 | 343 | (item) => item.group === group |
343 | 344 | )} |
344 | 345 | {@const isCollapsed = tCollapsed[group]} |
345 | | - <NavigationTitle title={group} class="bc-black-200 bt ps-relative"> |
| 346 | + {@const selectedItem = groupItems.find( |
| 347 | + (item) => tSelected === item.text |
| 348 | + )} |
| 349 | + <NavigationTitle |
| 350 | + title={group} |
| 351 | + class={`bc-black-200 bt ps-relative ${isCollapsed && !selectedItem ? "mbn24" : ""}`} |
| 352 | + > |
346 | 353 | {#snippet trailing()} |
347 | | - <Button |
348 | | - class="ps-absolute r0" |
349 | | - size="xs" |
350 | | - weight="clear" |
351 | | - onclick={() => (tCollapsed[group] = !tCollapsed[group])} |
352 | | - aria-label={`${isCollapsed ? "Expand" : "Collapse"} ${group} Section`} |
353 | | - > |
354 | | - <span |
355 | | - style:display="inline-block" |
356 | | - style:transform="rotate({isCollapsed ? 180 : 0}deg)" |
357 | | - style:transition="transform 0.2s ease" |
| 354 | + <div class="ps-absolute r0 as-center d-flex ai-center"> |
| 355 | + {#if !isCollapsed && group === "Resources"} |
| 356 | + <Button |
| 357 | + class="p6" |
| 358 | + weight="clear" |
| 359 | + aria-label="Edit Section" |
| 360 | + > |
| 361 | + <Icon src={IconCompose} /> |
| 362 | + </Button> |
| 363 | + {/if} |
| 364 | + {#if isCollapsed && groupItems.some((i) => i.activity)} |
| 365 | + <ActivityIndicator |
| 366 | + label="There is one or more activity in this section" |
| 367 | + /> |
| 368 | + {/if} |
| 369 | + <Button |
| 370 | + class="p6" |
| 371 | + weight="clear" |
| 372 | + onclick={() => |
| 373 | + (tCollapsed[group] = !tCollapsed[group])} |
| 374 | + aria-label={`${isCollapsed ? "Expand" : "Collapse"} ${group} Section`} |
358 | 375 | > |
359 | | - <Icon src={IconChevron16Up} /> |
360 | | - </span> |
361 | | - </Button> |
| 376 | + <span |
| 377 | + style:display="inline-block" |
| 378 | + style:transform="rotate({isCollapsed |
| 379 | + ? 180 |
| 380 | + : 0}deg)" |
| 381 | + style:transition="transform 0.2s ease" |
| 382 | + > |
| 383 | + <Icon src={IconChevronUp} /> |
| 384 | + </span> |
| 385 | + </Button> |
| 386 | + </div> |
362 | 387 | {/snippet} |
363 | 388 | </NavigationTitle> |
364 | 389 |
|
365 | | - {@const selectedItem = groupItems.find( |
366 | | - (item) => tSelected === item.text |
367 | | - )} |
368 | 390 | {@const selectedIndex = groupItems.findIndex( |
369 | 391 | (item) => tSelected === item.text |
370 | 392 | )} |
|
0 commit comments