Skip to content

Commit

Permalink
feat(Box): add a scrollable prop (#1836)
Browse files Browse the repository at this point in the history
  • Loading branch information
talkor authored Dec 20, 2023
1 parent 82cb3b8 commit 95b4383
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/components/Box/Box.module.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
// Monday ui styles dependencies
@import "~monday-ui-style/src/common";
@import "~monday-ui-style/dist/mixins";

// Utilities map
@import "../../styles/utilities/utilities-settings";

.box{
.box {
overflow: hidden;

&.scrollable {
/* TODO: make default in the next major version */
overflow: auto;
@include scroller;
}
}

// Generating Utility class locally for Box component
@include utility-class-factory($utilities-modules, $export: "modules");

9 changes: 7 additions & 2 deletions src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ interface BoxProps extends VibeComponentProps {
paddingStart?: ValueOf<PaddingStart>;
backgroundColor?: ValueOf<BackgroundColor>;
textColor?: ValueOf<Color>;
/**
* TODO: make default in next major version
*/
scrollable?: boolean;
}

const Box: VibeComponent<BoxProps> & {
Expand Down Expand Up @@ -121,7 +125,8 @@ const Box: VibeComponent<BoxProps> & {
paddingBottom,
paddingStart,
textColor,
backgroundColor
backgroundColor,
scrollable
},
ref
) => {
Expand All @@ -134,7 +139,7 @@ const Box: VibeComponent<BoxProps> & {
className: cx(
styles.box,
className,
{ [DISABLED.DISABLED]: disabled },
{ [DISABLED.DISABLED]: disabled, [styles.scrollable]: scrollable },
border,
borderColor,
rounded,
Expand Down

0 comments on commit 95b4383

Please sign in to comment.