Skip to content

Commit d06c70f

Browse files
committed
chore: sync lace main branch
1 parent 3498124 commit d06c70f

File tree

7 files changed

+37
-31
lines changed

7 files changed

+37
-31
lines changed

src/design-system/action-card/action-card.component.tsx

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
import type { ReactNode } from 'react';
22
import React from 'react';
33

4+
import classNames from 'classnames';
5+
46
import { Box } from '../box';
57
import { Flex } from '../flex';
68
import { Text } from '../text';
9+
import { FontWeights } from '../text/create-text.util';
710

811
import * as cx from './action-card.css';
912

1013
import type { OmitClassName } from '../../types';
1114

1215
type Props = Omit<OmitClassName<'div'>, 'title'> & {
13-
title: { text: string; highlight: boolean }[];
16+
title: { text: string; highlight?: boolean; weight?: FontWeights }[];
1417
description?: string;
1518
icon: ReactNode;
19+
rootClassName?: string;
20+
iconClassName?: string;
1621
};
1722

1823
export const ActionCard = ({
@@ -21,9 +26,9 @@ export const ActionCard = ({
2126
icon,
2227
...props
2328
}: Readonly<Props>): JSX.Element => (
24-
<Box {...props} className={cx.root}>
29+
<Box {...props} className={classNames([cx.root, props.rootClassName])}>
2530
<Flex
26-
className={cx.iconBox}
31+
className={classNames([cx.iconBox, props.iconClassName])}
2732
mr="$24"
2833
alignItems="center"
2934
justifyContent="center"
@@ -33,9 +38,9 @@ export const ActionCard = ({
3338
<Box w="$fill">
3439
<Flex justifyContent="center" h="$fill" flexDirection="column">
3540
<Box>
36-
{title.map(({ text, highlight }) => (
41+
{title.map(({ text, highlight, weight }) => (
3742
<Text.Body.Normal
38-
weight="$medium"
43+
weight={weight || '$medium'}
3944
color={highlight ? 'highlight' : 'primary'}
4045
key={text}
4146
>

src/design-system/auto-suggest-box/auto-suggest-box-icon.component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface Props {
1515
}
1616

1717
export const Icon = ({ status }: Readonly<Props>): JSX.Element => {
18-
const isValidating = status === ValidationStatus.Validading;
18+
const isValidating = status === ValidationStatus.Validating;
1919
const isValidated = status === ValidationStatus.Validated;
2020

2121
if (status === undefined) {

src/design-system/auto-suggest-box/auto-suggest-box-suggestion.component.tsx

+20-20
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,29 @@ const getSuggestionComponent = (
3030
};
3131

3232
export const Suggestion = forwardRef<HTMLDivElement, SuggestionComponentProps>(
33-
({ onClick, suggestion }, ref): JSX.Element => (
34-
<Select.Item
35-
tabIndex={0}
36-
ref={ref}
37-
data-testid={`auto-suggest-box-suggestion-${suggestion.value}`}
38-
value={suggestion.value}
39-
className={cx.suggestion}
40-
onClick={(): void => {
41-
onClick(suggestion.value);
42-
}}
43-
onKeyDown={(event): void => {
44-
if (event.code === 'Enter') {
33+
function Suggestion({ onClick, suggestion }, ref): JSX.Element {
34+
return (
35+
<Select.Item
36+
tabIndex={0}
37+
ref={ref}
38+
data-testid={`auto-suggest-box-suggestion-${suggestion.value}`}
39+
value={suggestion.value}
40+
className={cx.suggestion}
41+
onClick={(): void => {
4542
onClick(suggestion.value);
46-
}
47-
}}
48-
>
49-
{getSuggestionComponent(suggestion)}
50-
</Select.Item>
51-
),
43+
}}
44+
onKeyDown={(event): void => {
45+
if (event.code === 'Enter') {
46+
onClick(suggestion.value);
47+
}
48+
}}
49+
>
50+
{getSuggestionComponent(suggestion)}
51+
</Select.Item>
52+
);
53+
},
5254
);
5355

54-
Suggestion.displayName = 'Suggestion';
55-
5656
export const SuggestionClassic = ({
5757
label,
5858
value,

src/design-system/auto-suggest-box/auto-suggest-box-types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export enum ValidationStatus {
22
Idle = 'Idle',
3-
Validading = 'Validading',
3+
Validating = 'Validating',
44
Validated = 'Validated',
55
}
66

src/design-system/box/box.component.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { forwardRef } from 'react';
1+
import React, { HTMLAttributes, forwardRef } from 'react';
22
import type { CSSProperties, PropsWithChildren } from 'react';
33

44
import classNames from 'classnames';
@@ -27,7 +27,8 @@ export type BoxProps = Pick<
2727
| 'w'
2828
> & { className?: string; style?: CSSProperties };
2929

30-
export type Props = PropsWithChildren<BoxProps>;
30+
export type Props = PropsWithChildren<BoxProps> &
31+
HTMLAttributes<HTMLDivElement>;
3132

3233
export const Box = forwardRef<HTMLDivElement | null, Readonly<Props>>(
3334
(

src/design-system/text/create-text.util.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { bold, medium, regular, semibold, typography } from './text.css';
88
import type { TypographyVariants } from './text.css';
99
import type { Theme } from '../../design-tokens';
1010

11-
type FontWeights = keyof Theme['fontWeights'];
11+
export type FontWeights = keyof Theme['fontWeights'];
1212

1313
type TextTypes = TypographyVariants['type'];
1414
type TextColor = TypographyVariants['color'];

src/design-tokens/sx.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const responsiveProperties = defineProperties({
3232
'grid',
3333
'inline-flex',
3434
],
35-
flexDirection: ['row', 'column', 'column-reverse'],
35+
flexDirection: ['row', 'column', 'column-reverse', 'row-reverse'],
3636
justifyContent: [
3737
'stretch',
3838
'flex-start',

0 commit comments

Comments
 (0)