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

* 'develop' of https://github.com/leemonade/bubbles:
  chore: version bump
  feat: Add prop cleanOnMissingValue
  chore: version bump
  • Loading branch information
johan-fx committed Dec 18, 2023
2 parents 3f46c61 + ef4b3f5 commit 213383c
Show file tree
Hide file tree
Showing 17 changed files with 153 additions and 24 deletions.
18 changes: 18 additions & 0 deletions packages/calendars/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @bubbles-ui/calendars

## 1.2.61

### Patch Changes

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

## 1.2.60

### Patch Changes

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

## 1.2.59

### 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.59",
"version": "1.2.61",
"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.59",
"@bubbles-ui/icons": "^1.2.59",
"@bubbles-ui/components": "^1.2.61",
"@bubbles-ui/icons": "^1.2.61",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"webpack": "*"
Expand Down
16 changes: 16 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @bubbles-ui/components

## 1.2.61

### Patch Changes

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

## 1.2.60

### Patch Changes

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

## 1.2.59

### 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.59",
"version": "1.2.61",
"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.59",
"@bubbles-ui/icons": "^1.2.61",
"@emotion/react": "^11.10.0",
"@heroicons/react": "^1.0.5",
"@hookform/resolvers": "^3.3.2",
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/form/Select/Select.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const SELECT_PROP_TYPES = {
description: PropTypes.string,
placeholder: PropTypes.string,
data: PropTypes.any,
cleanOnMissingValue: PropTypes.bool,
required: PropTypes.bool,
size: PropTypes.oneOf(SELECT_SIZES),
variant: PropTypes.oneOf(SELECT_VARIANTS),
Expand Down
9 changes: 8 additions & 1 deletion packages/components/src/form/Select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { forwardRef, useEffect, useMemo, useState } from 'react';
import { ChevDownIcon, RemoveIcon } from '@bubbles-ui/icons/outline';
import { Select as MantineSelect } from '@mantine/core';
import { useId } from '@mantine/hooks';
import { isEmpty, isFunction, isNil, isString, map } from 'lodash';
import { find, isEmpty, isFunction, isNil, isString, map } from 'lodash';
import { InputWrapper } from '../InputWrapper';
import { ActionButton } from '../ActionButton';
import { SelectStyles } from './Select.styles';
Expand Down Expand Up @@ -44,6 +44,7 @@ const Select = forwardRef(
readOnly,
variant,
autoSelectOneOption,
cleanOnMissingValue,
ariaLabel,
withinPortal,
...props
Expand Down Expand Up @@ -95,6 +96,12 @@ const Select = forwardRef(
handleChange(valueComponent ? [data[0].value] : data[0].value);
}, [autoSelectOneOption, data]);

useEffect(() => {
if (cleanOnMissingValue && !!value && !find(data, { value })) {
handleClear();
}
}, [data]);

// ······················································
// STYLES

Expand Down
5 changes: 2 additions & 3 deletions packages/components/src/form/Select/Select.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ export default {
};

const Template = ({ value: valueProp, useValueComponent, onChange, data, ...props }) => {
const CustomValueComponent = forwardRef(({ label }, ref) => {
return <UserDisplayItem name={label} />;
});
const CustomValueComponent = forwardRef(({ label }, ref) => <UserDisplayItem name={label} />);
const [value, setValue] = React.useState(valueProp);
return (
<Box>
Expand Down Expand Up @@ -62,6 +60,7 @@ Playground.args = {
creatable: false,
readOnly: false,
autoSelectOneOption: false,
cleanOnMissingValue: false,
clearable: 'Clear select field',
error: 'Descriptive text for error ',
value: 'Carol Miller',
Expand Down
18 changes: 18 additions & 0 deletions packages/editors/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @bubbles-ui/editors

## 1.2.61

### Patch Changes

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

## 1.2.60

### Patch Changes

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

## 1.2.59

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/editors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bubbles-ui/editors",
"version": "1.2.59",
"version": "1.2.61",
"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 @@ -79,8 +79,8 @@
"styled-icons": "^10.45.0"
},
"peerDependencies": {
"@bubbles-ui/components": "^1.2.59",
"@bubbles-ui/icons": "^1.2.59",
"@bubbles-ui/components": "^1.2.61",
"@bubbles-ui/icons": "^1.2.61",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"webpack": "*"
Expand Down
18 changes: 18 additions & 0 deletions packages/extras/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @bubbles-ui/extras

## 1.2.61

### Patch Changes

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

## 1.2.60

### Patch Changes

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

## 1.2.59

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/extras/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bubbles-ui/extras",
"version": "1.2.59",
"version": "1.2.61",
"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 @@ -53,8 +53,8 @@
"swiper": "^8.1.4"
},
"peerDependencies": {
"@bubbles-ui/components": "^1.2.59",
"@bubbles-ui/icons": "^1.2.59",
"@bubbles-ui/components": "^1.2.61",
"@bubbles-ui/icons": "^1.2.61",
"@mantine/core": "5.2.4",
"@mantine/hooks": "5.2.4",
"react": "^17.0.1",
Expand Down
12 changes: 12 additions & 0 deletions packages/icons/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @bubbles-ui/icons

## 1.2.61

### Patch Changes

- Versions bump

## 1.2.60

### Patch Changes

- Versions bump

## 1.2.59

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bubbles-ui/icons",
"version": "1.2.59",
"version": "1.2.61",
"description": "The Bubbles Design System icons library.",
"license": "MIT",
"repository": {
Expand Down
22 changes: 22 additions & 0 deletions packages/leemons/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# @bubbles-ui/leemons

## 1.2.61

### Patch Changes

- Versions bump
- Updated dependencies
- @bubbles-ui/components@1.2.61
- @bubbles-ui/calendars@1.2.61
- @bubbles-ui/editors@1.2.61
- @bubbles-ui/icons@1.2.61

## 1.2.60

### Patch Changes

- Versions bump
- Updated dependencies
- @bubbles-ui/components@1.2.60
- @bubbles-ui/calendars@1.2.60
- @bubbles-ui/editors@1.2.60
- @bubbles-ui/icons@1.2.60

## 1.2.59

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/leemons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bubbles-ui/leemons",
"version": "1.2.59",
"version": "1.2.61",
"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 @@ -74,10 +74,10 @@
"ajv": "6.12.6"
},
"peerDependencies": {
"@bubbles-ui/calendars": "^1.2.59",
"@bubbles-ui/components": "^1.2.59",
"@bubbles-ui/editors": "^1.2.59",
"@bubbles-ui/icons": "^1.2.59",
"@bubbles-ui/calendars": "^1.2.61",
"@bubbles-ui/components": "^1.2.61",
"@bubbles-ui/editors": "^1.2.61",
"@bubbles-ui/icons": "^1.2.61",
"dayjs": "^1.10.7",
"react": "^17.0.1",
"react-dom": "^17.0.1",
Expand Down
18 changes: 18 additions & 0 deletions packages/notifications/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @bubbles-ui/notifications

## 1.2.61

### Patch Changes

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

## 1.2.60

### Patch Changes

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

## 1.2.59

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/notifications/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bubbles-ui/notifications",
"version": "1.2.59",
"version": "1.2.61",
"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 @@ -52,8 +52,8 @@
"react-transition-group": "^4.4.2"
},
"peerDependencies": {
"@bubbles-ui/components": "^1.2.59",
"@bubbles-ui/icons": "^1.2.59",
"@bubbles-ui/components": "^1.2.61",
"@bubbles-ui/icons": "^1.2.61",
"@mantine/core": "5.2.4",
"@mantine/hooks": "5.2.4",
"react": "^17.0.1",
Expand Down

0 comments on commit 213383c

Please sign in to comment.