Skip to content

Commit 6735c18

Browse files
Merge release/2.8.0 into main branch (#1200)
* Updates FontAwesome peer deps (#1189) * remove non-synth colors, add borderedMultiValue styles SingleSelect (#1196) * Add default containerClassName to loading skeleton (#1195)
1 parent 30a2ba6 commit 6735c18

File tree

9 files changed

+83
-105
lines changed

9 files changed

+83
-105
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@user-interviews/ui-design-system",
3-
"version": "2.7.2",
3+
"version": "2.8.0",
44
"dependencies": {
55
"@tiptap/core": "^2.0.3",
66
"@tiptap/extension-bold": "^2.0.3",
@@ -61,10 +61,10 @@
6161
]
6262
},
6363
"peerDependencies": {
64-
"@fortawesome/fontawesome-svg-core": "^1.2.28",
65-
"@fortawesome/free-brands-svg-icons": "^5.15.3",
66-
"@fortawesome/pro-regular-svg-icons": "^6.4.0",
67-
"@fortawesome/pro-solid-svg-icons": "^6.4.0",
64+
"@fortawesome/fontawesome-svg-core": "^6.5.1",
65+
"@fortawesome/free-brands-svg-icons": "^6.5.1",
66+
"@fortawesome/pro-regular-svg-icons": "^6.5.1",
67+
"@fortawesome/pro-solid-svg-icons": "^6.5.1",
6868
"@fortawesome/react-fontawesome": "^0.2.0",
6969
"@popperjs/core": "^2.5.3",
7070
"bootstrap": "5.1",

src/LoadingSkeleton/LoadingSkeleton.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import colors from '../Styles/colors/palette';
88

99
import './LoadingSkeleton.scss';
1010

11-
const LoadingSkeleton = ({ className, ...props }) => (
11+
const LoadingSkeleton = ({ className, containerClassName, ...props }) => (
1212
<SkeletonTheme baseColor={colors.UX_GRAY_300}>
1313
<Skeleton
1414
className={classNames('LoadingSkeleton', className)}
15+
containerClassName={classNames('loadingSkeletonContainer', containerClassName)}
1516
{...props}
1617
/>
1718
</SkeletonTheme>

src/LoadingSkeleton/LoadingSkeleton.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
}
99
}
1010

11+
// Per https://github.com/dvtng/react-loading-skeleton/issues/23#issuecomment-939231878
12+
.loadingSkeletonContainer {
13+
line-height: 1;
14+
}
15+
1116
.react-loading-skeleton {
1217
--base-color: #ebebeb;
1318
--highlight-color: #f5f5f5;

src/Select/SingleSelect.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import Select from 'react-select';
44
import propTypes from 'prop-types';
55

66
import zStack from 'src/Styles/zStack';
7-
import './select.scss';
87

9-
import { defaultTheme, defaultStyles, SELECT_SIZES } from './styles';
8+
import {
9+
borderedMultiValueStyles, defaultTheme, defaultStyles, SELECT_SIZES,
10+
} from './styles';
1011

1112
const SingleSelect = ({
1213
'aria-label': ariaLabel,
1314
'aria-labelledby': ariaLabelledBy,
15+
borderedMultiValue,
1416
className,
1517
closeMenuOnSelect,
1618
components,
@@ -57,6 +59,7 @@ const SingleSelect = ({
5759
placeholder={placeholder}
5860
styles={{
5961
...defaultStyles({ menuWidth, size }),
62+
...borderedMultiValueStyles(borderedMultiValue),
6063
menuPortal: (base) => (
6164
modal ?
6265
{ ...base, zIndex: zStack.zIndexModalBackdrop + 1 } :
@@ -72,6 +75,7 @@ const SingleSelect = ({
7275
SingleSelect.propTypes = {
7376
'aria-label': propTypes.string,
7477
'aria-labelledby': propTypes.string,
78+
borderedMultiValue: propTypes.bool,
7579
className: propTypes.string,
7680
closeMenuOnSelect: propTypes.bool,
7781
components: propTypes.any,
@@ -103,6 +107,7 @@ SingleSelect.propTypes = {
103107
SingleSelect.defaultProps = {
104108
'aria-label': undefined,
105109
'aria-labelledby': undefined,
110+
borderedMultiValue: undefined,
106111
className: undefined,
107112
closeMenuOnSelect: true,
108113
components: undefined,

src/Select/SingleSelect.mdx

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/Select/SingleSelect.stories.jsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,11 @@ import Option from './Option';
1212
import OptionWithDescription from './OptionWithDescription';
1313
import ValueContainer from './ValueContainer';
1414

15-
import mdx from './SingleSelect.mdx';
16-
1715
const onChange = () => action('Change');
1816

1917
export default {
2018
title: 'Components/Selects/Single',
2119
component: SingleSelect,
22-
parameters: {
23-
docs: {
24-
page: mdx,
25-
},
26-
},
2720
};
2821

2922
const options = [
@@ -33,6 +26,13 @@ const options = [
3326
{ label: 'Unmoderated task', value: 4 },
3427
];
3528

29+
const peopleOptions = [
30+
{ label: 'Riley Researcher', value: 5 },
31+
{ label: 'Mickey Moderator', value: 6 },
32+
{ label: 'Connie Collaborator', value: 7 },
33+
{ label: 'Ozzy Observer', value: 8 },
34+
];
35+
3636
export const Default = () => (
3737
<FormGroup
3838
label="Default select"
@@ -74,6 +74,21 @@ export const MultipleSelect = () => (
7474
</FormGroup>
7575
);
7676

77+
export const MultipleSelectBorderedPill = () => (
78+
<FormGroup
79+
label="Multiple select bordered pill"
80+
labelHtmlFor="multi-select-bordered-pill"
81+
>
82+
<SingleSelect
83+
borderedMultiValue
84+
inputId="multi-select-bordered-pill"
85+
isMulti
86+
options={peopleOptions}
87+
onChange={onChange}
88+
/>
89+
</FormGroup>
90+
);
91+
7792
export const InModal = () => {
7893
const [isOpen, setIsOpen] = useState(false);
7994

src/Select/select.scss

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/Select/styles.js

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ const defaultStyles = ({ menuWidth, size }) => ({
5151
indicatorSeparator: (styles) => ({ ...styles, display: 'none' }),
5252
multiValue: (styles) => ({
5353
...styles,
54-
backgroundColor: systemColors.UX_BLUE_100,
55-
color: systemColors.UX_BLUE_700,
54+
backgroundColor: systemColors.SYNTH_HOVER_STATE,
55+
color: systemColors.SYNTH_SUCCESS_GREEN_DARK,
5656
borderRadius: '4px',
5757
}),
5858
menu: (styles) => ({
@@ -61,20 +61,20 @@ const defaultStyles = ({ menuWidth, size }) => ({
6161
}),
6262
multiValueLabel: (styles) => ({
6363
...styles,
64-
color: systemColors.UX_BLUE_700,
64+
color: systemColors.SYNTH_SUCCESS_GREEN_DARK,
6565
fontSize: '0.875rem',
6666
fontWeight: 400,
6767
lineHeight: '1.25rem',
6868
paddingLeft: '8px',
6969
}),
7070
multiValueRemove: (styles) => ({
7171
...styles,
72-
color: systemColors.UX_BLUE,
72+
color: systemColors.SYNTH_SUCCESS_GREEN_DARK,
7373
cursor: 'pointer',
7474
':hover': {
7575
...styles[':hover'],
76-
backgroundColor: systemColors.selectOptionFocusedBg,
77-
color: systemColors.UX_BLUE_700,
76+
backgroundColor: systemColors.SYNTH_SELECTED_STATE_GREEN,
77+
color: systemColors.SYNTH_SUCCESS_GREEN_DARK,
7878
},
7979
}),
8080
placeholder: (styles) => ({
@@ -91,10 +91,12 @@ const defaultStyles = ({ menuWidth, size }) => ({
9191
}),
9292
option: (styles, {
9393
isDisabled,
94+
isFocused,
9495
isSelected,
9596
}) => ({
9697
...styles,
97-
backgroundColor: isSelected ? systemColors.UX_BLUE_200 : styles.backgroundColor,
98+
backgroundColor: isSelected || isFocused ?
99+
systemColors.SYNTH_HOVER_STATE : styles.backgroundColor,
98100
color: systemColors.UX_GRAY_900,
99101
fontWeight: fontWeights.light,
100102
fontSize: '0.875rem',
@@ -108,11 +110,39 @@ const defaultStyles = ({ menuWidth, size }) => ({
108110

109111
':hover': {
110112
...styles[':hover'],
111-
backgroundColor: isSelected ? systemColors.UX_BLUE_200 : systemColors.UX_BLUE_100,
113+
backgroundColor: isSelected ?
114+
systemColors.SYNTH_SELECTED_STATE_GREEN : systemColors.SYNTH_HOVER_STATE,
112115
},
113116
}),
114117
});
115118

119+
const borderedMultiValueStyles = (borderedMultiValue) => borderedMultiValue ? {
120+
multiValue: (styles) => (
121+
{
122+
...styles,
123+
border: `1px solid ${systemColors.SYNTH_DARK_BACKGROUND_SELECTED_BLUE}`,
124+
borderRadius: '4px',
125+
backgroundColor: systemColors.UX_WHITE,
126+
}
127+
),
128+
multiValueLabel: (styles) => (
129+
{
130+
...styles,
131+
color: systemColors.SYNTH_DARK_BACKGROUND_SELECTED_BLUE,
132+
}
133+
),
134+
multiValueRemove: (styles) => (
135+
{
136+
...styles,
137+
color: systemColors.SYNTH_DARK_BACKGROUND_SELECTED_BLUE,
138+
':hover': {
139+
backgroundColor: systemColors.UX_NAVY_500,
140+
color: systemColors.UX_WHITE,
141+
},
142+
}
143+
),
144+
} : {};
145+
116146
const defaultTheme = (theme) => ({
117147
...theme,
118148
colors: {
@@ -122,6 +152,7 @@ const defaultTheme = (theme) => ({
122152
});
123153

124154
export {
155+
borderedMultiValueStyles,
125156
defaultStyles,
126157
defaultTheme,
127158
};

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11815,9 +11815,9 @@ tar-stream@^2.1.4:
1181511815
readable-stream "^3.1.1"
1181611816

1181711817
tar@^6.0.2, tar@^6.1.11, tar@^6.1.13, tar@^6.1.2:
11818-
version "6.2.0"
11819-
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.0.tgz#b14ce49a79cb1cd23bc9b016302dea5474493f73"
11820-
integrity sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==
11818+
version "6.2.1"
11819+
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
11820+
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==
1182111821
dependencies:
1182211822
chownr "^2.0.0"
1182311823
fs-minipass "^2.0.0"

0 commit comments

Comments
 (0)