Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(website): add Sidebar docs and fix minor component types #3217

Merged
merged 30 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e9c063d
fix(sidebar): type fixe
TheSisb May 5, 2023
dc663f3
fix(sidebar): dont pass onClick through when as=span on badge
TheSisb May 5, 2023
4d2eba2
docs: add Sidebar docs page
TheSisb May 5, 2023
b701d84
fix: lint fix
TheSisb May 5, 2023
f13bf88
fix: danger check
TheSisb May 5, 2023
5975715
chore: updated docs with more details about the child components
SiTaggart May 22, 2023
772b106
chore: linting imports
SiTaggart May 23, 2023
f9d114b
chore: sidebar dep
SiTaggart May 23, 2023
96b77fa
Merge branch 'main' into sidebar-docs
SiTaggart May 25, 2023
0e62883
chore: website deps
SiTaggart May 25, 2023
1a2159b
Merge branch 'main' into sidebar-docs
SiTaggart Jun 13, 2023
495698b
chore: updates to sidebar and full compositions
SiTaggart Jun 21, 2023
e44e3b1
feat: update the notifications, debugger, alarms
SiTaggart Jun 22, 2023
9a4f5b5
chore: pr feedback
SiTaggart Jun 22, 2023
c3bb9b7
chore: types
SiTaggart Jun 22, 2023
9e376f5
chore: icon colors for topbar
SiTaggart Jun 23, 2023
cbfcb68
chore: visual fixes to sidebar indentatinos
SiTaggart Jun 26, 2023
8ef7cfd
chore: lint and build
SiTaggart Jun 26, 2023
9d70e95
chore: lint
SiTaggart Jun 26, 2023
162fc6e
chore: changeset
SiTaggart Jun 26, 2023
5ef6a55
chore: implement hidden search box label in stories
SiTaggart Jun 26, 2023
077b769
Merge branch 'main' into sidebar-docs
SiTaggart Jun 27, 2023
264d16e
docs: sidebar docs
SiTaggart Jun 28, 2023
d1b4277
fix: scroll gradient
SiTaggart Jun 28, 2023
6781a06
Merge branch 'main' into sidebar-docs
SiTaggart Jun 28, 2023
97806cf
chore: lockfile
SiTaggart Jun 28, 2023
da96070
chore: packages after release
SiTaggart Jun 28, 2023
d3be530
Merge branch 'main' into sidebar-docs
SiTaggart Jun 28, 2023
d895cb6
chore: minor test tweaks
SiTaggart Jun 28, 2023
0167b5b
chore: final go
SiTaggart Jun 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/cuddly-wolves-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/product-switcher': patch
'@twilio-paste/core': patch
---

[Product Switcher] minor change to the size of the trigger button
5 changes: 5 additions & 0 deletions .changeset/few-poems-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@twilio-paste/icons': patch
---

Update the notification, Debugger and Alarms icons
6 changes: 6 additions & 0 deletions .changeset/neat-mugs-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/sidebar': patch
'@twilio-paste/core': patch
---

[Sidebar] `SidebarBetaBadge` no longer passes `onClick` when `as="span"`. Other miscellaneous typescript fixes.
5 changes: 5 additions & 0 deletions .changeset/purple-terms-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@twilio-paste/codemods': patch
---

Updating core exports list
6 changes: 6 additions & 0 deletions .changeset/selfish-chefs-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/sidebar': patch
'@twilio-paste/core': patch
---

[Sidebar] Style updates to the Sidebar navigation components
6 changes: 6 additions & 0 deletions .changeset/shaggy-seas-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/topbar': patch
'@twilio-paste/core': patch
---

[Topbar] Update to the size of the User Dialog trigger for better alignment with other topbar related components
6 changes: 6 additions & 0 deletions .changeset/tricky-rabbits-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/combobox': patch
'@twilio-paste/core': patch
---

[Combobox]: ability to have a truly visually hidden label for search comboboxes
1 change: 1 addition & 0 deletions cypress/integration/sitemap-vrt/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const SITEMAP = [
'/components/screen-reader-only/',
'/components/select/',
'/components/separator/',
'/components/sidebar/',
'/components/stack/',
'/components/status-badge/',
'/components/status-menu/',
Expand Down
5 changes: 4 additions & 1 deletion packages/paste-codemods/tools/.cache/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@
"useSideModalState": "@twilio-paste/core/side-modal",
"Sidebar": "@twilio-paste/core/sidebar",
"SidebarBetaBadge": "@twilio-paste/core/sidebar",
"SidebarBody": "@twilio-paste/core/sidebar",
"SidebarCollapseButton": "@twilio-paste/core/sidebar",
"SidebarCollapseButtonWrapper": "@twilio-paste/core/sidebar",
"SidebarContext": "@twilio-paste/core/sidebar",
"SidebarFooter": "@twilio-paste/core/sidebar",
"SidebarHeader": "@twilio-paste/core/sidebar",
"SidebarHeaderIconButton": "@twilio-paste/core/sidebar",
"SidebarHeaderLabel": "@twilio-paste/core/sidebar",
Expand All @@ -232,6 +233,7 @@
"SidebarNavigationDisclosureHeading": "@twilio-paste/core/sidebar",
"SidebarNavigationDisclosureHeadingWrapper": "@twilio-paste/core/sidebar",
"SidebarNavigationItem": "@twilio-paste/core/sidebar",
"SidebarNavigationSeparator": "@twilio-paste/core/sidebar",
"SidebarOverlayContentWrapper": "@twilio-paste/core/sidebar",
"SidebarPushContentWrapper": "@twilio-paste/core/sidebar",
"useSidebarNavigationDisclosureState": "@twilio-paste/core/sidebar",
Expand Down Expand Up @@ -279,6 +281,7 @@
"Tooltip": "@twilio-paste/core/tooltip",
"useTooltipState": "@twilio-paste/core/tooltip",
"Topbar": "@twilio-paste/core/topbar",
"TopbarActions": "@twilio-paste/core/topbar",
"UserDialog": "@twilio-paste/core/topbar",
"UserDialogContainer": "@twilio-paste/core/topbar",
"UserDialogContext": "@twilio-paste/core/topbar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const Combobox = React.forwardRef<HTMLInputElement, ComboboxProps>(
disabled,
element = 'COMBOBOX',
hasError,
hideVisibleLabel,
helpText,
initialSelectedItem,
disabledItems,
Expand Down Expand Up @@ -145,9 +146,11 @@ const Combobox = React.forwardRef<HTMLInputElement, ComboboxProps>(

return (
<Box position="relative" element={`${element}_WRAPPER`}>
<Label disabled={disabled} required={required} variant={variant} {...getLabelProps()}>
{labelText}
</Label>
{!hideVisibleLabel && (
<Label disabled={disabled} required={required} variant={variant} {...getLabelProps()}>
{labelText}
</Label>
)}
<InputBox
disabled={disabled}
element={element}
Expand All @@ -165,6 +168,7 @@ const Combobox = React.forwardRef<HTMLInputElement, ComboboxProps>(
{...(!autocomplete ? {onChange: (event: React.ChangeEvent) => event.preventDefault()} : undefined)}
autocomplete={autocomplete}
aria-describedby={helpTextId}
aria-label={hideVisibleLabel ? labelText : null}
element={`${element}_ELEMENT`}
/>
{!autocomplete && (
Expand Down
3 changes: 3 additions & 0 deletions packages/paste-core/components/combobox/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface ComboboxProps
variant?: InputVariants;
disabledItems?: any[];
emptyState?: React.FC;
hideVisibleLabel?: boolean;

// Downshift useCombobox Hook Props. Thes are mainly covered in https://github.com/downshift-js/downshift/blob/master/src/hooks/useCombobox/README.md#advanced-props docs
initialIsOpen?: UseComboboxPrimitiveProps<any>['initialIsOpen'];
Expand Down Expand Up @@ -92,6 +93,8 @@ export interface MultiselectComboboxProps
| 'getA11yStatusMessage'
| 'getA11ySelectionMessage'
| 'state'
// until such time as we have a usecase for hidden multi-select comboboxes
| 'hideVisibleLabel'
> {
initialSelectedItems?: any[];
onSelectedItemsChange?: (newSelectedItems: any[]) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ export const ComboboxAutocomplete: StoryFn = () => {

ComboboxAutocomplete.storyName = 'Combobox - Autocomplete';

export const ComboboxHiddenLabel: StoryFn = () => {
return <Combobox items={items} labelText="Choose a component:" hideVisibleLabel helpText="This is the help text" />;
};

ComboboxHiddenLabel.storyName = 'Combobox - Non-visble label';

export const ComboboxRequired: StoryFn = () => {
return <Combobox items={items} labelText="Choose a component:" helpText="This is the help text" required />;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface ProductSwitcherButtonProps extends Omit<MenuButtonProps, 'varia
const ProductSwitcherButton = React.forwardRef<HTMLButtonElement, ProductSwitcherButtonProps>(
({element = 'PRODUCT_SWITCHER_BUTTON', i18nButtonLabel, ...props}, ref) => {
return (
<MenuButton element={element} {...props} variant="secondary_icon" size="icon_small" ref={ref}>
<MenuButton element={element} {...props} variant="secondary_icon" size="reset" ref={ref}>
<ProductSwitcherIcon decorative={true} />
<ScreenReaderOnly>{i18nButtonLabel}</ScreenReaderOnly>
</MenuButton>
Expand Down
2 changes: 1 addition & 1 deletion packages/paste-core/components/sidebar/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

### Minor Changes

- [`d1d3088ca`](https://github.com/twilio-labs/paste/commit/d1d3088ca0c300740f640f80ebfc532168b35263) [#3160](https://github.com/twilio-labs/paste/pull/3160) Thanks [@nkrantz](https://github.com/nkrantz)! - [Sidebar] Add `SidebarCollapseButton` and `SidebarCollapseButtonWrapper` components. Renamed ContentWrappers
- [`d1d3088ca`](https://github.com/twilio-labs/paste/commit/d1d3088ca0c300740f640f80ebfc532168b35263) [#3160](https://github.com/twilio-labs/paste/pull/3160) Thanks [@nkrantz](https://github.com/nkrantz)! - [Sidebar] Add `SidebarCollapseButton` and `SidebarFooter` components. Renamed ContentWrappers

* [`0c3861824`](https://github.com/twilio-labs/paste/commit/0c38618244d1494c7153b341cfd4e486afafc47d) [#3154](https://github.com/twilio-labs/paste/pull/3154) Thanks [@TheSisb](https://github.com/TheSisb)! - [Sidebar] add new Sidebar component with several variant styles

Expand Down
24 changes: 12 additions & 12 deletions packages/paste-core/components/sidebar/__tests__/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
SidebarHeaderLabel,
SidebarHeaderIconButton,
SidebarCollapseButton,
SidebarCollapseButtonWrapper,
SidebarFooter,
SidebarPushContentWrapper,
SidebarOverlayContentWrapper,
SidebarBetaBadge,
Expand All @@ -29,14 +29,14 @@ const MockPushSidebar = ({
<Theme.Provider theme="twilio">
<Sidebar aria-label="main" collapsed={collapsed} variant={variant}>
<SidebarHeader>
<SidebarHeaderIconButton>
<SidebarHeaderIconButton as="button">
<ProductFlexIcon size="sizeIcon20" decorative={false} title="Go to Flex product homepage" />
</SidebarHeaderIconButton>
<SidebarHeaderLabel>Twilio Flex</SidebarHeaderLabel>
</SidebarHeader>
<SidebarCollapseButtonWrapper>
<SidebarFooter>
<SidebarCollapseButton i18nCollapseLabel="Close sidebar" i18nExpandLabel="Open sidebar" />
</SidebarCollapseButtonWrapper>
</SidebarFooter>
</Sidebar>
<SidebarPushContentWrapper collapsed={collapsed} variant={variant}>
<div>Content area</div>
Expand All @@ -56,14 +56,14 @@ const MockOverlaySidebar = ({
<Theme.Provider theme="twilio">
<Sidebar aria-label="main" collapsed={collapsed} variant={variant}>
<SidebarHeader>
<SidebarHeaderIconButton>
<SidebarHeaderIconButton as="button">
<ProductFlexIcon size="sizeIcon20" decorative={false} title="Go to Flex product homepage" />
</SidebarHeaderIconButton>
<SidebarHeaderLabel>Twilio Flex</SidebarHeaderLabel>
</SidebarHeader>
<SidebarCollapseButtonWrapper>
<SidebarFooter>
<SidebarCollapseButton i18nCollapseLabel="Close sidebar" i18nExpandLabel="Open sidebar" />
</SidebarCollapseButtonWrapper>
</SidebarFooter>
</Sidebar>
<SidebarOverlayContentWrapper collapsed={collapsed} variant={variant}>
<div>Content area</div>
Expand Down Expand Up @@ -224,7 +224,7 @@ describe('Sidebar', () => {
SIDEBAR_COLLAPSE_BUTTON: {
padding: 'space40',
},
SIDEBAR_COLLAPSE_BUTTON_WRAPPER: {
SIDEBAR_FOOTER: {
padding: 'space40',
},
SIDEBAR_PUSH_CONTENT_WRAPPER: {backgroundColor: 'colorBackgroundPrimary', margin: 'space50'},
Expand All @@ -236,9 +236,9 @@ describe('Sidebar', () => {
<Sidebar aria-label="main" variant="compact" data-testid="aaa">
<Box color="colorTextInverse">Sidebar header</Box>
<SidebarBetaBadge as="span">Beta</SidebarBetaBadge>
<SidebarCollapseButtonWrapper data-testid="collapseButtonWrapper">
<SidebarFooter data-testid="collapseButtonWrapper">
<SidebarCollapseButton i18nCollapseLabel="Close sidebar" i18nExpandLabel="Open sidebar" />
</SidebarCollapseButtonWrapper>
</SidebarFooter>
</Sidebar>

{/* Must wrap content area */}
Expand Down Expand Up @@ -289,13 +289,13 @@ describe('Sidebar', () => {
<SidebarBetaBadge as="span" element="XSIDE_BETA_BADGE">
Beta
</SidebarBetaBadge>
<SidebarCollapseButtonWrapper element="XSIDE_COLLAPSE_BUTTON_WRAPPER" data-testid="collapseButtonWrapper">
<SidebarFooter element="XSIDE_COLLAPSE_BUTTON_WRAPPER" data-testid="collapseButtonWrapper">
<SidebarCollapseButton
element="XSIDE_COLLAPSE_BUTTON"
i18nCollapseLabel="Close sidebar"
i18nExpandLabel="Open sidebar"
/>
</SidebarCollapseButtonWrapper>
</SidebarFooter>
</Sidebar>

{/* Must wrap content area */}
Expand Down