Skip to content

Commit

Permalink
Merge release/2.4.0 into main branch (#1098)
Browse files Browse the repository at this point in the history
* Bump @adobe/css-tools from 4.3.1 to 4.3.2 (#1085)

* remove box shadow from MoneyInput, add step and prefix props (#1094)

* update DropdownItem hover state, remove danger variant (#1091)

* give default sizes to levels, make weight optional, add notes to props (#1096)
  • Loading branch information
github-actions[bot] authored Dec 12, 2023
1 parent a211ea3 commit 098514c
Show file tree
Hide file tree
Showing 12 changed files with 342 additions and 70 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@user-interviews/ui-design-system",
"version": "2.3.1",
"version": "2.4.0",
"dependencies": {
"@tiptap/core": "^2.0.3",
"@tiptap/extension-bold": "^2.0.3",
Expand Down
173 changes: 163 additions & 10 deletions spec/__snapshots__/Storyshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9054,16 +9054,16 @@ Array [
`;

exports[`Storyshots Components/Heading Default 1`] = `
<h2
className="Heading Heading--xxl Heading--bold"
<h1
className="Heading Heading--xxxl Heading--bold"
style={
Object {
"textAlign": undefined,
}
}
>
The fastest way to recruit research participants
</h2>
</h1>
`;

exports[`Storyshots Components/Heading Levels 1`] = `
Expand Down Expand Up @@ -9128,16 +9128,81 @@ Array [
>
The fastest way to recruit research participants
</h6>,
<h6
]
`;

exports[`Storyshots Components/Heading Sizes 1`] = `
Array [
<h2
className="Heading Heading--xxxl Heading--bold"
style={
Object {
"textAlign": undefined,
}
}
>
This is a heading level 2 with size="xxxl"
</h2>,
<h2
className="Heading Heading--xxl Heading--bold"
style={
Object {
"textAlign": undefined,
}
}
>
This is a heading level 2 with size="xxl"
</h2>,
<h2
className="Heading Heading--xl Heading--bold"
style={
Object {
"textAlign": undefined,
}
}
>
This is a heading level 2 with size="xl"
</h2>,
<h2
className="Heading Heading--lg Heading--bold"
style={
Object {
"textAlign": undefined,
}
}
>
This is a heading level 2 with size="lg"
</h2>,
<h2
className="Heading Heading--md Heading--bold"
style={
Object {
"textAlign": undefined,
}
}
>
This is a heading level 2 with size="md"
</h2>,
<h2
className="Heading Heading--sm Heading--bold"
style={
Object {
"textAlign": undefined,
}
}
>
This is a heading level 2 with size="sm"
</h2>,
<h2
className="Heading Heading--xs Heading--bold"
style={
Object {
"textAlign": undefined,
}
}
>
The fastest way to recruit research participants
</h6>,
This is a heading level 2 with size="xs"
</h2>,
]
`;

Expand Down Expand Up @@ -10425,11 +10490,11 @@ exports[`Storyshots Components/MoneyInput Default 1`] = `
onKeyUp={[Function]}
placeholder="Please enter a number"
type="text"
value="$1,250.99"
value="$ 1,250.99"
/>
<br />
<h2
className="Heading Heading--xxl Heading--bold"
<h1
className="Heading Heading--xxxl Heading--bold"
style={
Object {
"textAlign": undefined,
Expand All @@ -10438,7 +10503,95 @@ exports[`Storyshots Components/MoneyInput Default 1`] = `
>
Value:
1250.99
</h2>
</h1>
</div>
`;

exports[`Storyshots Components/MoneyInput Prefix 1`] = `
<div
className="FormGroup"
>
<label
className="InputLabel"
htmlFor="money-input-3"
>
Incentive amount
</label>
<div
className="FormGroup__helper-text"
>
Change the prefix
</div>
<input
className="MoneyInput form-control"
disabled={false}
id="money-input-3"
inputMode="decimal"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
placeholder="Please enter a number"
type="text"
value="USD$ 500"
/>
<br />
<h1
className="Heading Heading--xxxl Heading--bold"
style={
Object {
"textAlign": undefined,
}
}
>
Value:
500
</h1>
</div>
`;

exports[`Storyshots Components/MoneyInput Step 1`] = `
<div
className="FormGroup"
>
<label
className="InputLabel"
htmlFor="money-input-2"
>
Incentive amount
</label>
<div
className="FormGroup__helper-text"
>
Use the Up Arrow (↑) or Down Arrow (↓) to adjust the incremental value change
</div>
<input
className="MoneyInput form-control"
disabled={false}
id="money-input-2"
inputMode="decimal"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
placeholder="Please enter a number"
type="text"
value="$ 200"
/>
<br />
<h1
className="Heading Heading--xxxl Heading--bold"
style={
Object {
"textAlign": undefined,
}
}
>
Value:
200
</h1>
</div>
`;

Expand Down
16 changes: 3 additions & 13 deletions src/Dropdown/DropdownItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

import { Dropdown as RBDropdown } from 'react-bootstrap';

import './DropdownItem.scss';

const DropdownItemVariants = {
DANGER: 'danger',
};
import styles from './DropdownItem.module.scss';

const DropdownItem = ({
active,
Expand All @@ -22,7 +18,6 @@ const DropdownItem = ({
href,
leadingIcon,
onClick,
variant,
bsPrefix,
...props
}) => (
Expand All @@ -33,15 +28,15 @@ const DropdownItem = ({
className={classNames(
className,
'DropdownItem',
variant && `DropdownItem--${variant}`,
styles.DropdownItem,
)}
disabled={disabled}
eventKey={eventKey}
href={href}
onClick={onClick}
{...props}
>
{ leadingIcon && <FontAwesomeIcon className="icon-left fa-fw" icon={leadingIcon} /> }
{ leadingIcon && <FontAwesomeIcon className={classNames(styles.DropdownItemIcon, 'icon-left', 'fa-fw')} icon={leadingIcon} /> }
{ children }
</RBDropdown.Item>
);
Expand Down Expand Up @@ -74,10 +69,6 @@ DropdownItem.propTypes = {
*/
href: PropTypes.string,
leadingIcon: PropTypes.object,
/**
Optional variant for controlling color and hover states (e.g. destructive actions)
*/
variant: PropTypes.oneOf(Object.values(DropdownItemVariants)),
/**
Callback fired when the menu item is clicked.
*/
Expand All @@ -93,7 +84,6 @@ DropdownItem.defaultProps = {
eventKey: undefined,
href: undefined,
leadingIcon: undefined,
variant: undefined,
onClick: undefined,
};

Expand Down
20 changes: 20 additions & 0 deletions src/Dropdown/DropdownItem.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@import '../../scss/theme';

.DropdownItem {
@include synth-font-type-30;
color: $ux-gray-900;

&:hover {
background-color: $synth-hover-state;
text-decoration: none;
}

&:focus {
background-color: $synth-selected-state-green;
color: $ux-gray-900;
}
}

.DropdownItemIcon {
margin-right: $ux-spacing-20;
}
31 changes: 0 additions & 31 deletions src/Dropdown/DropdownItem.scss

This file was deleted.

32 changes: 25 additions & 7 deletions src/Heading/Heading.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Story = StoryObj<typeof Heading>;
export const Default: Story = {
args: {
children: 'The fastest way to recruit research participants',
level: 1,
},
};

Expand Down Expand Up @@ -61,13 +62,30 @@ export const Default: Story = {
export const Levels: Story = {
render: () => (
<>
<Heading level={1} size="xxxl" weight="bold">The fastest way to recruit research participants</Heading>
<Heading level={2} size="xxl" weight="bold">The fastest way to recruit research participants</Heading>
<Heading level={3} size="xl" weight="bold">The fastest way to recruit research participants</Heading>
<Heading level={4} size="lg" weight="bold">The fastest way to recruit research participants</Heading>
<Heading level={5} size="md" weight="bold">The fastest way to recruit research participants</Heading>
<Heading level={6} size="sm" weight="bold">The fastest way to recruit research participants</Heading>
<Heading level={6} size="xs" weight="bold">The fastest way to recruit research participants</Heading>
<Heading level={1} size="xxxl">The fastest way to recruit research participants</Heading>
<Heading level={2} size="xxl">The fastest way to recruit research participants</Heading>
<Heading level={3} size="xl">The fastest way to recruit research participants</Heading>
<Heading level={4} size="lg">The fastest way to recruit research participants</Heading>
<Heading level={5} size="md">The fastest way to recruit research participants</Heading>
<Heading level={6} size="sm">The fastest way to recruit research participants</Heading>
</>
),
};

/**
Headings come with default sizes based on their level, but you are able to
adjust its size based on visual hierarchy needs.
*/
export const Sizes: Story = {
render: () => (
<>
<Heading level={2} size="xxxl">This is a heading level 2 with size="xxxl"</Heading>
<Heading level={2} size="xxl">This is a heading level 2 with size="xxl"</Heading>
<Heading level={2} size="xl">This is a heading level 2 with size="xl"</Heading>
<Heading level={2} size="lg">This is a heading level 2 with size="lg"</Heading>
<Heading level={2} size="md">This is a heading level 2 with size="md"</Heading>
<Heading level={2} size="sm">This is a heading level 2 with size="sm"</Heading>
<Heading level={2} size="xs">This is a heading level 2 with size="xs"</Heading>
</>
),
};
Expand Down
Loading

0 comments on commit 098514c

Please sign in to comment.