Skip to content

Commit 5cd7930

Browse files
Merge release/v3.3.2 into main branch (#1269)
* fix alignment of Option with checkbox and description (#1267) * REC-25 add a new accordion alert component (#1268)
1 parent a276bb9 commit 5cd7930

File tree

9 files changed

+74
-13
lines changed

9 files changed

+74
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@user-interviews/ui-design-system",
3-
"version": "3.3.1",
3+
"version": "3.3.2",
44
"dependencies": {
55
"@tiptap/core": "^2.4.0",
66
"@tiptap/extension-bold": "^2.4.0",

src/Accordion/Accordion.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ When multiple Cards are stacked, you want to ensure there is proper content alig
6565
### Disabled
6666

6767
<Canvas of={ComponentStories.Disabled} />
68+
69+
### Alert
70+
71+
<Canvas of={ComponentStories.AccordionAlert} />

src/Accordion/Accordion.stories.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,3 +390,27 @@ Disabled.args = {
390390
helperText: 'helper text',
391391
title: 'Accordion Toggle -- disabled',
392392
};
393+
394+
export const AccordionAlert = (args) => (
395+
<Accordion>
396+
<AccordionItem borderless eventKey="0" variant="info">
397+
<AccordionToggle
398+
eventKey="0"
399+
{...args}
400+
/>
401+
<AccordionCollapse eventKey="0" variant="info">
402+
<div>
403+
Add content here.
404+
</div>
405+
</AccordionCollapse>
406+
</AccordionItem>
407+
</Accordion>
408+
);
409+
410+
AccordionAlert.args = {
411+
chevronLateral: true,
412+
chevronLeft: true,
413+
disabled: false,
414+
helperText: 'helper text',
415+
title: 'Accordion Alert',
416+
};

src/Accordion/AccordionCollapse.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,13 @@
66
&__container {
77
padding: 16px 24px;
88
}
9+
10+
&--info {
11+
border-top: none !important;
12+
color: var(--ux-gray-900);
13+
}
14+
15+
&--noTopPadding {
16+
padding-top: 0px !important;
17+
}
918
}

src/Accordion/AccordionCollapse.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import RBAccordionCollapse from 'react-bootstrap/AccordionCollapse';
66
import './AccordionCollapse.scss';
77

88
type AccordionCollapseProps = {
9+
variant?: string;
910
children: React.ReactNode;
1011
/**
1112
A unique key used to control this item's collapse/expand.
@@ -16,6 +17,7 @@ type AccordionCollapseProps = {
1617
};
1718

1819
const AccordionCollapse = ({
20+
variant,
1921
children,
2022
eventKey,
2123

@@ -25,17 +27,28 @@ const AccordionCollapse = ({
2527
...props
2628
}: AccordionCollapseProps) => (
2729
<RBAccordionCollapse
28-
className={classNames(UNSAFE_className, 'AccordionCollapse')}
30+
className={classNames(
31+
UNSAFE_className,
32+
'AccordionCollapse',
33+
variant === 'info' && 'AccordionCollapse--info',
34+
)}
2935
eventKey={eventKey}
3036
{...props}
3137
>
32-
<div className="AccordionCollapse__container">
38+
<div
39+
className={classNames(
40+
UNSAFE_className,
41+
'AccordionCollapse__container',
42+
variant === 'info' && 'AccordionCollapse--noTopPadding',
43+
)}
44+
>
3345
{children}
3446
</div>
3547
</RBAccordionCollapse>
3648
);
3749

3850
AccordionCollapse.defaultProps = {
51+
variant: undefined,
3952
UNSAFE_className: undefined,
4053
};
4154

src/Accordion/AccordionItem.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@
1717
&--borderless {
1818
border: none;
1919
}
20+
21+
&--info {
22+
background-color: var(--ux-blue-100);
23+
color: var(--ux-blue-800);
24+
}
2025
}

src/Accordion/AccordionItem.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ type AccordionItemProps = {
1818
UNSAFE_className?: string;
1919
children: React.ReactNode;
2020
eventKey: string;
21+
variant?: string;
2122
};
2223

2324
const AccordionItem = ({
25+
variant,
2426
as,
2527
borderless,
2628
children,
@@ -33,6 +35,7 @@ const AccordionItem = ({
3335
className={classNames(
3436
UNSAFE_className,
3537
'AccordionItem',
38+
variant === 'info' && 'AccordionItem--info',
3639
borderless && 'AccordionItem--borderless',
3740
)}
3841
eventKey={eventKey}
@@ -42,6 +45,7 @@ const AccordionItem = ({
4245
);
4346

4447
AccordionItem.defaultProps = {
48+
variant: undefined,
4549
as: undefined,
4650
borderless: undefined,
4751
UNSAFE_className: undefined,

src/Select/Option.jsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ import './Option.scss';
1717
const Option = forwardRef(({ indeterminate, ...props }, ref) => (
1818
<components.Option {...props}>
1919
<div className="Option">
20-
<CheckboxButton
21-
checked={props.isSelected}
22-
className="Checkbox"
23-
id={props.label}
24-
indeterminate={indeterminate}
25-
ref={ref}
26-
onChange={() => null}
27-
/>
20+
<div className="CheckboxContainer">
21+
<CheckboxButton
22+
checked={props.isSelected}
23+
className="Checkbox"
24+
id={props.label}
25+
indeterminate={indeterminate}
26+
ref={ref}
27+
onChange={() => null}
28+
/>
29+
</div>
2830
<div className="TitleDescriptionContainer">
2931
<label
3032
className={classNames({

src/Select/Option.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.Option {
22
display: flex;
3-
align-items: center;
4-
3+
54
.Checkbox {
5+
margin-top: var(--synth-spacing-1);
66
margin-right: var(--synth-spacing-3);
77
}
88

0 commit comments

Comments
 (0)