Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/leemonade/bubbles into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
MIGUELez11 committed Jan 22, 2024
2 parents 6b76fe0 + fc07539 commit 768e4f1
Show file tree
Hide file tree
Showing 32 changed files with 204 additions and 145 deletions.
9 changes: 9 additions & 0 deletions packages/calendars/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @bubbles-ui/calendars

## 1.2.136

### Patch Changes

- Versions bump
- Updated dependencies
- @bubbles-ui/components@1.2.136
- @bubbles-ui/icons@1.2.136

## 1.2.135

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/calendars/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bubbles-ui/calendars",
"version": "1.2.135",
"version": "1.2.136",
"description": "The Bubbles Design System is Leemonade's open-source design system for products and experiences.",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -59,8 +59,8 @@
"rrule": "^2.6.8"
},
"peerDependencies": {
"@bubbles-ui/components": "^1.2.135",
"@bubbles-ui/icons": "^1.2.135",
"@bubbles-ui/components": "^1.2.136",
"@bubbles-ui/icons": "^1.2.136",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"webpack": "*"
Expand Down
22 changes: 11 additions & 11 deletions packages/calendars/src/BigCalendar/components/Event/EventCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const emptyPixel =
function eventCellStylesRoot(
colors,
{
zIndex = -1,
zIndex = 0,
desaturateColor = true,
rotate = 0,
isAllDay,
Expand All @@ -25,7 +25,7 @@ function eventCellStylesRoot(
leftArrow,
printMode,
},
imp
imp,
) {
const data = {
position: 'relative',
Expand All @@ -35,8 +35,8 @@ function eventCellStylesRoot(
? _.isArray(bgColor)
? bgColor[0]
: desaturateColor
? colord(bgColor).desaturate(0.2).alpha(0.2).toRgbString()
: bgColor
? colord(bgColor).desaturate(0.2).alpha(0.2).toRgbString()
: bgColor
: colors.uiBackground01
}${imp ? '!important' : ''}`,
color: `${colors.text01}${imp ? '!important' : ''}`,
Expand Down Expand Up @@ -132,10 +132,10 @@ const getArrowStyles = (rightArrow, leftArrow, bgColor, borderColor, printMode)
? '14px 0px 14px 4px'
: '16px 0 16px 4px'
: leftArrow
? printMode
? '14px 4px 14px 0px'
: '16px 4px 16px 0px'
: undefined,
? printMode
? '14px 4px 14px 0px'
: '16px 4px 16px 0px'
: undefined,
borderColor: transparentBgColor
? 'transparent transparent transparent transparent'
: `transparent ${leftArrow ? colord(bgColor).toRgbString() : 'transparent'} transparent ${
Expand Down Expand Up @@ -174,7 +174,7 @@ const eventCellStyles = createStyles(
printMode,
bgStartGradient,
bgEndGradient,
}
},
) => {
const root = eventCellStylesRoot(
theme.colors,
Expand All @@ -192,7 +192,7 @@ const eventCellStyles = createStyles(
leftArrow,
printMode,
},
true
true,
);
let item = {};
if (!isMonthView) {
Expand Down Expand Up @@ -270,7 +270,7 @@ const eventCellStyles = createStyles(
...getArrowStyles(rightArrow, leftArrow, bgColor, borderColor, printMode),
},
};
}
},
);

export function sameDay(d1, d2) {
Expand Down
8 changes: 8 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @bubbles-ui/components

## 1.2.136

### Patch Changes

- Versions bump
- Updated dependencies
- @bubbles-ui/icons@1.2.136

## 1.2.135

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bubbles-ui/components",
"version": "1.2.135",
"version": "1.2.136",
"description": "The Bubbles Design System is Leemonade's open-source design system for products and experiences.",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -61,7 +61,7 @@
"chromatic": "npx chromatic --project-token=7b10302a7b6b --build-script-name=build:storybook:raw"
},
"dependencies": {
"@bubbles-ui/icons": "^1.2.135",
"@bubbles-ui/icons": "^1.2.136",
"@emotion/react": "^11.10.0",
"@heroicons/react": "^1.0.5",
"@hookform/resolvers": "^3.3.2",
Expand Down
6 changes: 4 additions & 2 deletions packages/components/src/form/Textarea/Textarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ const Textarea = forwardRef(
autoComplete,
onKeyPress = () => {},
rightSection,
textareaStyles,
...props
},
ref
ref,
) => {
const [labels, setLabels] = useState(counterLabels);
const uuid = useId();
Expand Down Expand Up @@ -142,6 +143,7 @@ const Textarea = forwardRef(
placeholder={placeholder}
rightSection={rightSection}
name={name}
style={textareaStyles}
disabled={disabled}
onBlur={onBlur}
onChange={handleOnChange}
Expand All @@ -160,7 +162,7 @@ const Textarea = forwardRef(
)}
</InputWrapper>
);
}
},
);

Textarea.defaultProps = TEXTAREA_DEFAULT_PROPS;
Expand Down
12 changes: 11 additions & 1 deletion packages/components/src/informative/Badge/Badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const Badge = forwardRef(
className,
children,
onClick,
disableHover,
useAria,
...props
},
Expand All @@ -66,7 +67,16 @@ const Badge = forwardRef(
}

const { classes, cx } = BadgeStyles(
{ size, color, image, radius, severity, hasOnClick: isFunction(onClick), labelStyles },
{
size,
color,
image,
radius,
disableHover,
severity,
hasOnClick: isFunction(onClick),
labelStyles,
},
{ name: 'Badge' },
);

Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/informative/Badge/Badge.styles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createStyles } from '@mantine/styles';
import { pxToRem, getFontProductive } from '../../theme.mixins';
import { getFontProductive, pxToRem } from '../../theme.mixins';

const getPadding = (size, isMedium, image, severity) => {
const isMediumImage = !!image && isMedium;
Expand Down Expand Up @@ -61,7 +61,7 @@ const getColor = (theme, color) => {
};

export const BadgeStyles = createStyles(
(theme, { size, color, image, radius, severity, hasOnClick, labelStyles }) => {
(theme, { size, color, image, radius, severity, disableHover, hasOnClick, labelStyles }) => {
const isLarge = size === 'lg';
const isSmall = size === 'xs';
const isMedium = size === 'md';
Expand Down Expand Up @@ -124,6 +124,7 @@ export const BadgeStyles = createStyles(
paddingLeft: image && (isSmall ? pxToRem(29) : isMedium ? pxToRem(40) : null),
height: 'auto',
cursor: hasOnClick && 'pointer',
pointerEvents: disableHover ? 'none' : 'auto',
...getSeverity(),
},
inner: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ const ChatMessage = ({
isOnline,
locale,
selected,
previoudMessageIsSameUser,
highlight,
showUser = true,
showUserName = true,
isTeacher,
isAdmin,
}) => {
const { classes } = ChatMessageStyles(
{ isOwn, isTeacher, isAdmin, selected },
{ isOwn, isTeacher, isAdmin, selected, previoudMessageIsSameUser },
{ name: 'ChatMessage' },
);
const fullName = getUserFullName(user);
Expand Down
131 changes: 67 additions & 64 deletions packages/components/src/informative/ChatMessage/ChatMessage.styles.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,70 @@
import { createStyles } from '@mantine/styles';

export const ChatMessageStyles = createStyles((theme, { isOwn, isTeacher, isAdmin, selected }) => {
const messageBox = {};
if (isOwn) {
messageBox.borderRight = `2px solid #878D96`;
} else {
messageBox.borderLeft = `2px solid #878D96`;
}
export const ChatMessageStyles = createStyles(
(theme, { isOwn, previoudMessageIsSameUser, isTeacher, isAdmin, selected }) => {
const messageBox = {};
if (isOwn) {
messageBox.borderRight = `2px solid #878D96`;
} else {
messageBox.borderLeft = `2px solid #878D96`;
}

return {
root: {
marginTop: theme.spacing[4],
padding: theme.spacing[2],
background: selected ? '#E4F4E6' : 'transparent',
display: 'flex',
justifyContent: isOwn ? 'end' : 'start',
alignItems: 'end',
gap: theme.spacing[1],
transition: 'background 0.3s ease',
},
message: {
color: theme.other.global.content.color.text.default,
fontFamily: 'Albert Sans',
fontSize: 14,
fontStyle: 'normal',
fontWeight: 400,
lineHeight: '20px',
},
messageBox: {
padding: theme.spacing[2],
paddingLeft: theme.spacing[3],
borderRadius: '2px',
backgroundColor: '#FFFFFF',
...messageBox,
},
messageBoxInner: {
display: 'flex',
alignItems: 'end',
gap: theme.spacing[2],
},
messageDate: {
display: 'block',
textAlign: 'right',
color: theme.other.global.content.color.text.muted,
fontFamily: 'Albert Sans',
fontSize: 12,
fontStyle: 'normal',
fontWeight: 400,
lineHeight: '16px',
},
name: {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
color: theme.other.global.content.color.text.muted,
fontFamily: 'Albert Sans',
fontSize: 12,
fontStyle: 'normal',
fontWeight: 400,
lineHeight: '16px',
},
avatar: {
display: 'flex',
},
};
});
return {
root: {
marginTop: previoudMessageIsSameUser ? theme.spacing[1] : theme.spacing[2],
padding: theme.spacing[2],
background: selected ? '#E4F4E6' : 'transparent',
display: 'flex',
justifyContent: isOwn ? 'end' : 'start',
alignItems: 'end',
gap: theme.spacing[1],
transition: 'background 0.3s ease',
borderRadius: '4px 2px 2px 4px',
},
message: {
color: theme.other.global.content.color.text.default,
fontFamily: 'Albert Sans',
fontSize: 14,
fontStyle: 'normal',
fontWeight: 400,
lineHeight: '20px',
},
messageBox: {
padding: theme.spacing[2],
paddingLeft: theme.spacing[3],
borderRadius: '2px',
backgroundColor: '#FFFFFF',
...messageBox,
},
messageBoxInner: {
display: 'flex',
alignItems: 'end',
gap: theme.spacing[2],
},
messageDate: {
display: 'block',
textAlign: 'right',
color: theme.other.global.content.color.text.muted,
fontFamily: 'Albert Sans',
fontSize: 12,
fontStyle: 'normal',
fontWeight: 400,
lineHeight: '16px',
},
name: {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
color: theme.other.global.content.color.text.muted,
fontFamily: 'Albert Sans',
fontSize: 12,
fontStyle: 'normal',
fontWeight: 400,
lineHeight: '16px',
},
avatar: {
display: 'flex',
},
};
},
);
Loading

0 comments on commit 768e4f1

Please sign in to comment.