Skip to content

Commit

Permalink
feat(sidebar): add SidebarNavigation elements (#3224)
Browse files Browse the repository at this point in the history
* fix(sidebar): use flexbox to space apart navigation header, nav, footer

* feat(sidebar): checkpoint sidebar navigation

* fix: smol fixes

* fix(sidebar): `SidebarNavigation` fixes and animation

* fix: many fixes and improvements

* chore: changeset

* fix: small fixes

* fix: story

* chore: add dep

* fix: checkpoint improvements

* fix(button): allow passing styles to reset button

* fix: sidebar navigation item to use button under the hood

* feat: icon on compact collapsed

* fix: incorrect padding on SidebarNavigation

* fix(button): set width=100% on button's inner span to fix truncating content

* fix(sidebar): finalize compact icon api

* test(sidebar): mostly finish writing tests for SidebarNavigation

* chore: pr review

* chore(website): fix multiselect combobox airtable endpoint

* fix: move disclosure icon on hover

* fix(icon): apply flex-shrink 0 by default

* chore: many styles fixes from pr review

* chore: ci fixes

* chore: add missing packages

* fix: regular and nested disclosures both flexGrow 1

* fix: style issues

* test: update snapshot

* fix: use correct focus styles
  • Loading branch information
TheSisb authored Jun 5, 2023
1 parent 53e20c6 commit 9e5b3b7
Show file tree
Hide file tree
Showing 38 changed files with 1,364 additions and 128 deletions.
6 changes: 6 additions & 0 deletions .changeset/forty-insects-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/button': patch
'@twilio-paste/core': patch
---

[Button] allow passing all style props to Button with variant="reset", effectively making it a Button primitive.
6 changes: 6 additions & 0 deletions .changeset/fresh-grapes-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/sidebar': minor
'@twilio-paste/core': minor
---

[Sidebar] add SidebarNavigation and all relevant sub-components
6 changes: 6 additions & 0 deletions .changeset/moody-deers-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/core': patch
'@twilio-paste/design-tokens': patch
---

[Design tokens] update the `shadowFocusInverseInset` token in the `twilio` and `twilio-dark` themes
6 changes: 6 additions & 0 deletions .changeset/new-wolves-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/codemods': patch
'@twilio-paste/core': patch
---

[Codemods] add SidebarNavigation components
5 changes: 5 additions & 0 deletions .changeset/tiny-poems-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@twilio-paste/icons': patch
---

[Icons] apply `flex-shrink: 0` to IconWrapper by default, as we never want icons to be compressed unexpectedly
7 changes: 7 additions & 0 deletions packages/paste-codemods/tools/.cache/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,15 @@
"SidebarHeader": "@twilio-paste/core/sidebar",
"SidebarHeaderIconButton": "@twilio-paste/core/sidebar",
"SidebarHeaderLabel": "@twilio-paste/core/sidebar",
"SidebarNavigation": "@twilio-paste/core/sidebar",
"SidebarNavigationDisclosure": "@twilio-paste/core/sidebar",
"SidebarNavigationDisclosureContent": "@twilio-paste/core/sidebar",
"SidebarNavigationDisclosureHeading": "@twilio-paste/core/sidebar",
"SidebarNavigationDisclosureHeadingWrapper": "@twilio-paste/core/sidebar",
"SidebarNavigationItem": "@twilio-paste/core/sidebar",
"SidebarOverlayContentWrapper": "@twilio-paste/core/sidebar",
"SidebarPushContentWrapper": "@twilio-paste/core/sidebar",
"useSidebarNavigationDisclosureState": "@twilio-paste/core/sidebar",
"SkeletonLoader": "@twilio-paste/core/skeleton-loader",
"Spinner": "@twilio-paste/core/spinner",
"StatusBadge": "@twilio-paste/core/status",
Expand Down
4 changes: 2 additions & 2 deletions packages/paste-core/components/button/src/ResetButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import type {BoxStyleProps} from '@twilio-paste/box';
import {Box, safelySpreadBoxProps} from '@twilio-paste/box';
import {Box} from '@twilio-paste/box';
import merge from 'deepmerge';

import {SizeStyles, BaseStyles} from './styles';
Expand Down Expand Up @@ -29,9 +29,9 @@ const ResetButton = React.forwardRef<HTMLButtonElement, DirectButtonProps>(
<Box
ref={ref}
width={fullWidth ? '100%' : 'auto'}
{...safelySpreadBoxProps(props)}
{...ButtonStyleMapping[buttonState]}
{...SizeStyles[size]}
{...(props as any)}
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions packages/paste-core/components/button/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const ButtonContents: React.FC<React.PropsWithChildren<ButtonContentsProps>> = (
justifyContent={buttonVariantHasBoundingBox ? null : 'center'}
columnGap="space20"
alignItems="center"
width="100%"
>
{children}
</Box>
Expand Down
Loading

0 comments on commit 9e5b3b7

Please sign in to comment.