Show the whole Rule on one review card, with quiet flags for missing cards and Continue once each question has one.
This commit is contained in:
1 parent
cc878e3c19
commit
6e2e1915ae
30 files changed
+571
-218
No files matched your search
@@ -20,6 +20,7 @@ const MultiSelectContainer = memo<MultiSelectProps>(
|
||||
onAddClick,
|
||||
addButton: addButtonProp = true,
|
||||
addButtonText,
|
||||
flag,
|
||||
formHeader = true,
|
||||
helperText,
|
||||
errorMessage,
|
||||
@@ -45,11 +46,13 @@ const MultiSelectContainer = memo<MultiSelectProps>(
|
||||
onAddClick={onAddClick}
|
||||
addButton={addButtonProp}
|
||||
addButtonText={addButtonText}
|
||||
flag={flag}
|
||||
addButtonAriaLabel={
|
||||
addButtonText || t("multiSelectAddFallback")
|
||||
}
|
||||
chipSelectAriaLabel={t("chipSelect")}
|
||||
chipDeselectAriaLabel={t("chipDeselect")}
|
||||
chipMissingWordsAriaLabel={t("chipMissingWords")}
|
||||
formHeader={formHeader}
|
||||
helperText={helperText}
|
||||
errorMessage={errorMessage}
|
||||
|
||||
@@ -7,6 +7,8 @@ export interface ChipOption {
|
||||
id: string;
|
||||
label: string;
|
||||
state?: ChipStateValue;
|
||||
/** Figma Has Warning on Control / Chip. */
|
||||
hasWarning?: boolean;
|
||||
}
|
||||
|
||||
export type MultiSelectSizeValue = "s" | "m";
|
||||
@@ -49,6 +51,11 @@ export interface MultiSelectProps {
|
||||
* Text for the add button
|
||||
*/
|
||||
addButtonText?: string;
|
||||
/**
|
||||
* Figma Has Flag: short line after the add chip in the same row, with no
|
||||
* fill and no extra height.
|
||||
*/
|
||||
flag?: string;
|
||||
/**
|
||||
* Whether to show form header (label and help icon) above multi-select (Figma prop).
|
||||
* @default true
|
||||
@@ -93,7 +100,9 @@ export interface MultiSelectViewProps {
|
||||
onAddClick?: () => void;
|
||||
addButton: boolean;
|
||||
addButtonText?: string;
|
||||
flag?: string;
|
||||
addButtonAriaLabel: string;
|
||||
chipMissingWordsAriaLabel: string;
|
||||
chipSelectAriaLabel: string;
|
||||
chipDeselectAriaLabel: string;
|
||||
formHeader: boolean;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { memo } from "react";
|
||||
import Chip from "../Chip";
|
||||
import Icon from "../../asset/icon/Icon";
|
||||
import InputLabel from "../../type/InputLabel";
|
||||
import type { MultiSelectViewProps } from "./MultiSelect.types";
|
||||
|
||||
@@ -15,9 +16,11 @@ function MultiSelectView({
|
||||
onAddClick,
|
||||
addButton,
|
||||
addButtonText,
|
||||
flag,
|
||||
addButtonAriaLabel,
|
||||
chipSelectAriaLabel,
|
||||
chipDeselectAriaLabel,
|
||||
chipMissingWordsAriaLabel,
|
||||
formHeader = true,
|
||||
helperText: helperTextProp,
|
||||
errorMessage,
|
||||
@@ -94,13 +97,19 @@ function MultiSelectView({
|
||||
palette={palette}
|
||||
size={chipSize}
|
||||
disabled={chipDisabled}
|
||||
hasWarning={option.hasWarning}
|
||||
ariaLabel={
|
||||
isCustom || !option.label
|
||||
? undefined
|
||||
: (isSelected
|
||||
? chipDeselectAriaLabel
|
||||
: chipSelectAriaLabel
|
||||
).replace("{label}", option.label)
|
||||
: option.hasWarning
|
||||
? chipMissingWordsAriaLabel.replace(
|
||||
"{label}",
|
||||
option.label,
|
||||
)
|
||||
: (isSelected
|
||||
? chipDeselectAriaLabel
|
||||
: chipSelectAriaLabel
|
||||
).replace("{label}", option.label)
|
||||
}
|
||||
onClick={() => {
|
||||
if (!isCustom && !chipDisabled && onChipClick) {
|
||||
@@ -180,6 +189,22 @@ function MultiSelectView({
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
{flag ? (
|
||||
<span
|
||||
className={`inline-flex items-center gap-[var(--space-100)] text-x-small-paragraph ${
|
||||
isInverse
|
||||
? "text-[color:var(--color-content-invert-primary)]"
|
||||
: "text-[color:var(--color-content-default-primary)]"
|
||||
}`}
|
||||
>
|
||||
<Icon
|
||||
name="warning"
|
||||
size={12}
|
||||
className="shrink-0 text-current"
|
||||
/>
|
||||
{flag}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
{errorMessage ? (
|
||||
<p
|
||||
|
||||
Reference in new issue
Block a user