💄(react) add styling for range selection on a cell
Integrate new styling classes for grid-cells to facilitate range selection in the DatePicker component. This implementation improves the visual representation and user experience of selecting a range. In addition, outside-month cells are now hidden, to avoid having a range selection that contains outside-month cells.
This commit is contained in:
committed by
aleb_the_flash
parent
87ec3a5061
commit
2886f0c992
@@ -4,41 +4,87 @@ import { useCalendarCell } from "@react-aria/calendar";
|
|||||||
import {
|
import {
|
||||||
CalendarDate,
|
CalendarDate,
|
||||||
getLocalTimeZone,
|
getLocalTimeZone,
|
||||||
|
isSameDay,
|
||||||
isToday,
|
isToday,
|
||||||
} from "@internationalized/date";
|
} from "@internationalized/date";
|
||||||
import { CalendarState } from "@react-stately/calendar";
|
import { CalendarState, RangeCalendarState } from "@react-stately/calendar";
|
||||||
import { Button } from ":/components/Button";
|
import { Button } from ":/components/Button";
|
||||||
|
|
||||||
interface CalendarCellProps {
|
interface CalendarCellProps {
|
||||||
state: CalendarState;
|
state: CalendarState | RangeCalendarState;
|
||||||
date: CalendarDate;
|
date: CalendarDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isRangeCalendar = (object: any): object is RangeCalendarState => {
|
||||||
|
return object?.highlightedRange;
|
||||||
|
};
|
||||||
|
|
||||||
export const CalendarCell = ({ state, date }: CalendarCellProps) => {
|
export const CalendarCell = ({ state, date }: CalendarCellProps) => {
|
||||||
const ref = useRef<HTMLButtonElement>(null);
|
const ref = useRef<HTMLButtonElement>(null);
|
||||||
const { cellProps, buttonProps, isSelected, formattedDate } = useCalendarCell(
|
const {
|
||||||
{ date },
|
cellProps,
|
||||||
state,
|
buttonProps,
|
||||||
ref
|
isSelected,
|
||||||
);
|
formattedDate,
|
||||||
|
isOutsideVisibleRange,
|
||||||
|
isDisabled,
|
||||||
|
} = useCalendarCell({ date }, state, ref);
|
||||||
|
|
||||||
|
const isSelectionEnd =
|
||||||
|
isRangeCalendar(state) && isSameDay(date, state?.highlightedRange?.end);
|
||||||
|
|
||||||
|
const isSelectionStart =
|
||||||
|
isRangeCalendar(state) && isSameDay(date, state?.highlightedRange?.start);
|
||||||
|
|
||||||
|
const isWithinHighlightedRange =
|
||||||
|
isRangeCalendar(state) &&
|
||||||
|
state?.highlightedRange?.start <= date &&
|
||||||
|
state?.highlightedRange?.end >= date;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<td {...cellProps}>
|
<td {...cellProps}>
|
||||||
<Button
|
<div
|
||||||
size="small"
|
hidden={isOutsideVisibleRange}
|
||||||
color={isSelected ? "primary" : "tertiary"}
|
className={classNames({
|
||||||
className={classNames("c__calendar__wrapper__grid__week-row__button", {
|
"c__calendar__wrapper__grid__week-row__background--range--disabled":
|
||||||
"c__calendar__wrapper__grid__week-row__button--selected": isSelected,
|
isWithinHighlightedRange && isDisabled,
|
||||||
"c__calendar__wrapper__grid__week-row__button--today": isToday(
|
"c__calendar__wrapper__grid__week-row__background--range":
|
||||||
date,
|
isWithinHighlightedRange,
|
||||||
getLocalTimeZone()
|
"c__calendar__wrapper__grid__week-row__background--range--end":
|
||||||
),
|
isSelectionEnd,
|
||||||
|
"c__calendar__wrapper__grid__week-row__background--range--start":
|
||||||
|
isSelectionStart,
|
||||||
})}
|
})}
|
||||||
disabled={!!cellProps["aria-disabled"]}
|
|
||||||
{...buttonProps}
|
|
||||||
ref={ref}
|
|
||||||
>
|
>
|
||||||
{formattedDate}
|
<Button
|
||||||
</Button>
|
size="small"
|
||||||
|
color={
|
||||||
|
(
|
||||||
|
isRangeCalendar(state)
|
||||||
|
? isSelectionStart || isSelectionEnd
|
||||||
|
: isSelected
|
||||||
|
)
|
||||||
|
? "primary"
|
||||||
|
: "tertiary"
|
||||||
|
}
|
||||||
|
className={classNames(
|
||||||
|
"c__calendar__wrapper__grid__week-row__button",
|
||||||
|
{
|
||||||
|
"c__calendar__wrapper__grid__week-row__button--selected":
|
||||||
|
isSelected,
|
||||||
|
"c__calendar__wrapper__grid__week-row__button--today": isToday(
|
||||||
|
date,
|
||||||
|
getLocalTimeZone()
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
disabled={isDisabled}
|
||||||
|
{...buttonProps}
|
||||||
|
ref={ref}
|
||||||
|
>
|
||||||
|
{formattedDate}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -110,5 +110,6 @@ Here are the custom design tokens defined by the datepicker.
|
|||||||
| menu-background-color | Background color of the menu (months/years menus) |
|
| menu-background-color | Background color of the menu (months/years menus) |
|
||||||
| grid-cell--border-color--today | Border color of the today grid-cell |
|
| grid-cell--border-color--today | Border color of the today grid-cell |
|
||||||
| grid-cell--color--today | Value color of the today grid-cell |
|
| grid-cell--color--today | Value color of the today grid-cell |
|
||||||
|
| range-selection-background-color | Value color of the selected grid-cells |
|
||||||
|
|
||||||
See also [Field](?path=/story/components-forms-field-doc--page)
|
See also [Field](?path=/story/components-forms-field-doc--page)
|
||||||
|
|||||||
@@ -186,6 +186,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__range {
|
||||||
|
min-width: px-to-rem(350px);
|
||||||
|
|
||||||
|
&__separator {
|
||||||
|
background-color: var(--c--theme--colors--greyscale-400);
|
||||||
|
height: px-to-rem(24px);
|
||||||
|
width: px-to-rem(1px);
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -224,6 +234,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding-top: 0.5rem;
|
padding-top: 0.5rem;
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
|
border-spacing: 0 0.4rem;
|
||||||
|
|
||||||
&__header-row {
|
&__header-row {
|
||||||
line-height: 3rem;
|
line-height: 3rem;
|
||||||
@@ -236,8 +247,33 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__week-row {
|
&__week-row {
|
||||||
|
|
||||||
|
td {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__background {
|
||||||
|
&--range {
|
||||||
|
background: var(--c--components--forms-datepicker--range-selection-background-color);
|
||||||
|
|
||||||
|
&:not(&--end):not(&--start):not(&--disabled) button {
|
||||||
|
color: var(--c--components--forms-datepicker--grid-cell--color--today);
|
||||||
|
}
|
||||||
|
|
||||||
|
&--end {
|
||||||
|
border-top-right-radius: 100%;
|
||||||
|
border-bottom-right-radius: 100%;
|
||||||
|
}
|
||||||
|
&--start {
|
||||||
|
border-top-left-radius: 100%;
|
||||||
|
border-bottom-left-radius: 100%;
|
||||||
|
}
|
||||||
|
&--disabled {
|
||||||
|
background: var(--c--components--forms-datepicker--range-selection-background-color--disabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
&__button {
|
&__button {
|
||||||
margin: 0.2rem auto;
|
|
||||||
&--today {
|
&--today {
|
||||||
border: 1px solid var(--c--components--forms-datepicker--grid-cell--border-color--today);
|
border: 1px solid var(--c--components--forms-datepicker--grid-cell--border-color--today);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -826,23 +826,26 @@ describe("<DatePicker/>", () => {
|
|||||||
// Get all the calendar's cells to check their state.
|
// Get all the calendar's cells to check their state.
|
||||||
let gridCells = await screen.findAllByRole("gridcell");
|
let gridCells = await screen.findAllByRole("gridcell");
|
||||||
|
|
||||||
// By default, calendar's cells outside the focused month are disabled (month n-1 and n+1).
|
// By default, calendar's cells outside the focused month are not visible (month n-1 and n+1).
|
||||||
// Cells within the focused month superior to the minDate should be clickable.
|
// Cells within the focused month superior to the minDate should be clickable.
|
||||||
// Cells inferior to the minDate should be disabled.
|
// Cells inferior to the minDate, within the month, should be disabled.
|
||||||
gridCells.forEach((gridCell) => {
|
gridCells.forEach((gridCell) => {
|
||||||
const button = within(gridCell).getByRole("button")!;
|
try {
|
||||||
const value = new Date(
|
const button = within(gridCell).getByRole("button")!;
|
||||||
button.getAttribute("aria-label")!.replace("First available date", "")
|
const value = new Date(
|
||||||
);
|
button.getAttribute("aria-label")!.replace("First available date", "")
|
||||||
if (
|
);
|
||||||
value.getMonth() === minValue.getMonth() &&
|
expect(value.getMonth() === minValue.getMonth());
|
||||||
value.getDate() < minValue.getDate()
|
if (value.getDate() < minValue.getDate()) {
|
||||||
) {
|
expect(button).toBeDisabled();
|
||||||
expect(button).toBeDisabled();
|
} else {
|
||||||
} else if (value.getMonth() === minValue.getMonth()) {
|
expect(button).not.toBeDisabled();
|
||||||
expect(button).not.toBeDisabled();
|
}
|
||||||
} else {
|
} catch (e: any) {
|
||||||
expect(button).toBeDisabled();
|
// Make sure outside grid-cells render any button element, even disabled.
|
||||||
|
expect(e.message).contains(
|
||||||
|
'Unable to find an accessible element with the role "button"'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -856,21 +859,24 @@ describe("<DatePicker/>", () => {
|
|||||||
|
|
||||||
gridCells = await screen.findAllByRole("gridcell");
|
gridCells = await screen.findAllByRole("gridcell");
|
||||||
gridCells.forEach((gridCell) => {
|
gridCells.forEach((gridCell) => {
|
||||||
const button = within(gridCell).getByRole("button")!;
|
try {
|
||||||
const buttonLabel = button
|
const button = within(gridCell).getByRole("button")!;
|
||||||
.getAttribute("aria-label")
|
const buttonLabel = button
|
||||||
?.replace("Last available date", "");
|
.getAttribute("aria-label")
|
||||||
expect(buttonLabel).toBeDefined();
|
?.replace("Last available date", "");
|
||||||
const value = new Date(buttonLabel!);
|
expect(buttonLabel).toBeDefined();
|
||||||
if (
|
const value = new Date(buttonLabel!);
|
||||||
value.getMonth() === maxValue.getMonth() &&
|
expect(value.getMonth() === minValue.getMonth());
|
||||||
value.getDate() > maxValue.getDate()
|
if (value.getDate() > maxValue.getDate()) {
|
||||||
) {
|
expect(button).toBeDisabled();
|
||||||
expect(button).toBeDisabled();
|
} else {
|
||||||
} else if (value.getMonth() === maxValue.getMonth()) {
|
expect(button).not.toBeDisabled();
|
||||||
expect(button).not.toBeDisabled();
|
}
|
||||||
} else {
|
} catch (e: any) {
|
||||||
expect(button).toBeDisabled();
|
// Make sure outside grid-cells render any button element, even disabled.
|
||||||
|
expect(e.message).contains(
|
||||||
|
'Unable to find an accessible element with the role "button"'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -983,7 +989,7 @@ describe("<DatePicker/>", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("can not select cells outside the focused month", async () => {
|
it("renders only cell within the focused month", async () => {
|
||||||
const user = userEvent.setup();
|
const user = userEvent.setup();
|
||||||
const defaultValue = new Date("2023-05-23");
|
const defaultValue = new Date("2023-05-23");
|
||||||
render(
|
render(
|
||||||
@@ -999,21 +1005,28 @@ describe("<DatePicker/>", () => {
|
|||||||
const toggleButton = (await screen.findAllByRole("button"))![1];
|
const toggleButton = (await screen.findAllByRole("button"))![1];
|
||||||
await user.click(toggleButton);
|
await user.click(toggleButton);
|
||||||
|
|
||||||
// Get all gridcells from the calendar.
|
// Get all grid-cells from the calendar.
|
||||||
const gridCells = await screen.findAllByRole("gridcell");
|
const gridCells = await screen.findAllByRole("gridcell");
|
||||||
|
let visibleValues: Array<Date> = [];
|
||||||
// Make sure that gridcells outside of the focused month are disabled.
|
// Make sure that all visible grid-cells are within the focused month.
|
||||||
gridCells.forEach((gridCell) => {
|
gridCells.forEach((gridCell) => {
|
||||||
const button = within(gridCell).getByRole("button")!;
|
try {
|
||||||
const value = new Date(
|
const button = within(gridCell).getByRole("button");
|
||||||
button.getAttribute("aria-label")!.replace("selected", "")
|
const value = new Date(
|
||||||
);
|
button.getAttribute("aria-label")!.replace("selected", "")
|
||||||
if (defaultValue.getMonth() === value.getMonth()) {
|
);
|
||||||
expect(button).not.toBeDisabled();
|
expect(button).not.toBeDisabled();
|
||||||
} else {
|
expect(defaultValue.getMonth() === value.getMonth());
|
||||||
expect(button).toBeDisabled();
|
visibleValues = [value, ...visibleValues];
|
||||||
|
} catch (e: any) {
|
||||||
|
// Make sure outside grid-cells render any button element, even disabled.
|
||||||
|
expect(e.message).contains(
|
||||||
|
'Unable to find an accessible element with the role "button"'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// Make sure we get as many visible values as days in the focused month.
|
||||||
|
expect(visibleValues.length).eq(31);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("navigate previous focused month with keyboard", async () => {
|
it("navigate previous focused month with keyboard", async () => {
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ export const tokens = (defaults: DefaultTokens) => ({
|
|||||||
"item-font-size": defaults.theme.font.sizes.l,
|
"item-font-size": defaults.theme.font.sizes.l,
|
||||||
"background-color": "white",
|
"background-color": "white",
|
||||||
"menu-background-color": "white",
|
"menu-background-color": "white",
|
||||||
|
"range-selection-background-color": defaults.theme.colors["primary-100"],
|
||||||
|
"range-selection-background-color--disabled":
|
||||||
|
defaults.theme.colors["greyscale-100"],
|
||||||
"grid-cell--border-color--today": defaults.theme.colors["primary-600"],
|
"grid-cell--border-color--today": defaults.theme.colors["primary-600"],
|
||||||
"grid-cell--color--today": defaults.theme.colors["primary-600"],
|
"grid-cell--color--today": defaults.theme.colors["primary-600"],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -78,6 +78,13 @@
|
|||||||
--c--theme--font--sizes--l: 1rem;
|
--c--theme--font--sizes--l: 1rem;
|
||||||
--c--theme--font--sizes--m: 0.8125rem;
|
--c--theme--font--sizes--m: 0.8125rem;
|
||||||
--c--theme--font--sizes--s: 0.6875rem;
|
--c--theme--font--sizes--s: 0.6875rem;
|
||||||
|
--c--theme--font--weights--thin: 200;
|
||||||
|
--c--theme--font--weights--light: 300;
|
||||||
|
--c--theme--font--weights--regular: 400;
|
||||||
|
--c--theme--font--weights--medium: 500;
|
||||||
|
--c--theme--font--weights--bold: 600;
|
||||||
|
--c--theme--font--weights--extrabold: 700;
|
||||||
|
--c--theme--font--weights--black: 800;
|
||||||
--c--theme--font--families--base: "Roboto Flex Variable", sans-serif;
|
--c--theme--font--families--base: "Roboto Flex Variable", sans-serif;
|
||||||
--c--theme--font--families--accent: "Roboto Flex Variable", sans-serif;
|
--c--theme--font--families--accent: "Roboto Flex Variable", sans-serif;
|
||||||
--c--theme--spacings--xl: 4rem;
|
--c--theme--spacings--xl: 4rem;
|
||||||
@@ -122,6 +129,7 @@
|
|||||||
--c--components--forms-radio--border-color: var(--c--theme--colors--greyscale-300);
|
--c--components--forms-radio--border-color: var(--c--theme--colors--greyscale-300);
|
||||||
--c--components--forms-radio--accent-color: var(--c--theme--colors--success-700);
|
--c--components--forms-radio--accent-color: var(--c--theme--colors--success-700);
|
||||||
--c--components--forms-radio--background-color: white;
|
--c--components--forms-radio--background-color: white;
|
||||||
|
--c--components--forms-input--font-weight: var(--c--theme--font--weights--regular);
|
||||||
--c--components--forms-input--font-size: var(--c--theme--font--sizes--l);
|
--c--components--forms-input--font-size: var(--c--theme--font--sizes--l);
|
||||||
--c--components--forms-input--border-radius: 8px;
|
--c--components--forms-input--border-radius: 8px;
|
||||||
--c--components--forms-input--border-radius--hover: 2px;
|
--c--components--forms-input--border-radius--hover: 2px;
|
||||||
@@ -147,6 +155,7 @@
|
|||||||
--c--components--forms-fileuploader--text-size: 0.6875rem;
|
--c--components--forms-fileuploader--text-size: 0.6875rem;
|
||||||
--c--components--forms-fileuploader--file-text-size: 0.8125rem;
|
--c--components--forms-fileuploader--file-text-size: 0.8125rem;
|
||||||
--c--components--forms-fileuploader--file-text-color: var(--c--theme--colors--greyscale-900);
|
--c--components--forms-fileuploader--file-text-color: var(--c--theme--colors--greyscale-900);
|
||||||
|
--c--components--forms-fileuploader--file-text-weight: var(--c--theme--font--weights--light);
|
||||||
--c--components--forms-fileuploader--file-border-color: var(--c--theme--colors--greyscale-300);
|
--c--components--forms-fileuploader--file-border-color: var(--c--theme--colors--greyscale-300);
|
||||||
--c--components--forms-fileuploader--file-border-width: 1px;
|
--c--components--forms-fileuploader--file-border-width: 1px;
|
||||||
--c--components--forms-fileuploader--file-border-radius: 0.5rem;
|
--c--components--forms-fileuploader--file-border-radius: 0.5rem;
|
||||||
@@ -173,11 +182,14 @@
|
|||||||
--c--components--forms-datepicker--item-font-size: var(--c--theme--font--sizes--l);
|
--c--components--forms-datepicker--item-font-size: var(--c--theme--font--sizes--l);
|
||||||
--c--components--forms-datepicker--background-color: white;
|
--c--components--forms-datepicker--background-color: white;
|
||||||
--c--components--forms-datepicker--menu-background-color: white;
|
--c--components--forms-datepicker--menu-background-color: white;
|
||||||
|
--c--components--forms-datepicker--range-selection-background-color: var(--c--theme--colors--primary-100);
|
||||||
|
--c--components--forms-datepicker--range-selection-background-color--disabled: var(--c--theme--colors--greyscale-100);
|
||||||
--c--components--forms-datepicker--grid-cell--border-color--today: var(--c--theme--colors--primary-600);
|
--c--components--forms-datepicker--grid-cell--border-color--today: var(--c--theme--colors--primary-600);
|
||||||
--c--components--forms-datepicker--grid-cell--color--today: var(--c--theme--colors--primary-600);
|
--c--components--forms-datepicker--grid-cell--color--today: var(--c--theme--colors--primary-600);
|
||||||
--c--components--forms-checkbox--background-color--hover: var(--c--theme--colors--greyscale-200);
|
--c--components--forms-checkbox--background-color--hover: var(--c--theme--colors--greyscale-200);
|
||||||
--c--components--forms-checkbox--background-color: white;
|
--c--components--forms-checkbox--background-color: white;
|
||||||
--c--components--forms-checkbox--font-size: var(--c--theme--font--sizes--m);
|
--c--components--forms-checkbox--font-size: var(--c--theme--font--sizes--m);
|
||||||
|
--c--components--forms-checkbox--font-weight: var(--c--theme--font--weights--medium);
|
||||||
--c--components--forms-checkbox--color: var(--c--theme--colors--greyscale-900);
|
--c--components--forms-checkbox--color: var(--c--theme--colors--greyscale-900);
|
||||||
--c--components--forms-checkbox--border-color: var(--c--theme--colors--greyscale-300);
|
--c--components--forms-checkbox--border-color: var(--c--theme--colors--greyscale-300);
|
||||||
--c--components--forms-checkbox--border-radius: 2px;
|
--c--components--forms-checkbox--border-radius: 2px;
|
||||||
@@ -189,4 +201,5 @@
|
|||||||
--c--components--button--small-height: 32px;
|
--c--components--button--small-height: 32px;
|
||||||
--c--components--button--medium-font-size: var(--c--theme--font--sizes--l);
|
--c--components--button--medium-font-size: var(--c--theme--font--sizes--l);
|
||||||
--c--components--button--small-font-size: var(--c--theme--font--sizes--m);
|
--c--components--button--small-font-size: var(--c--theme--font--sizes--m);
|
||||||
|
--c--components--button--font-weight: var(--c--theme--font--weights--regular);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
export const tokens = {"theme":{"colors":{"primary-text":"#FFFFFF","primary-100":"#EBF2FC","primary-200":"#8CB5EA","primary-300":"#5894E1","primary-400":"#377FDB","primary-500":"#055FD2","primary-600":"#0556BF","primary-700":"#044395","primary-800":"#033474","primary-900":"#022858","secondary-text":"#555F6B","secondary-100":"#F2F7FC","secondary-200":"#EBF3FA","secondary-300":"#E2EEF8","secondary-400":"#DDEAF7","secondary-500":"#D4E5F5","secondary-600":"#C1D0DF","secondary-700":"#97A3AE","secondary-800":"#757E87","secondary-900":"#596067","greyscale-000":"#FFFFFF","greyscale-100":"#FAFAFB","greyscale-200":"#F3F4F4","greyscale-300":"#E7E8EA","greyscale-400":"#C2C6CA","greyscale-500":"#9EA3AA","greyscale-600":"#79818A","greyscale-700":"#555F6B","greyscale-800":"#303C4B","greyscale-900":"#0C1A2B","success-text":"#FFFFFF","success-100":"#EFFCD3","success-200":"#DBFAA9","success-300":"#BEF27C","success-400":"#A0E659","success-500":"#76D628","success-600":"#5AB81D","success-700":"#419A14","success-800":"#2C7C0C","success-900":"#1D6607","info-text":"#FFFFFF","info-100":"#EBF2FC","info-200":"#8CB5EA","info-300":"#5894E1","info-400":"#377FDB","info-500":"#055FD2","info-600":"#0556BF","info-700":"#044395","info-800":"#033474","info-900":"#022858","warning-text":"#FFFFFF","warning-100":"#FFF8CD","warning-200":"#FFEF9B","warning-300":"#FFE469","warning-400":"#FFDA43","warning-500":"#FFC805","warning-600":"#DBA603","warning-700":"#B78702","warning-800":"#936901","warning-900":"#7A5400","danger-text":"#FFFFFF","danger-100":"#F4B0B0","danger-200":"#EE8A8A","danger-300":"#E65454","danger-400":"#E13333","danger-500":"#DA0000","danger-600":"#C60000","danger-700":"#9B0000","danger-800":"#780000","danger-900":"#5C0000"},"font":{"sizes":{"h1":"1.75rem","h2":"1.375rem","h3":"1.125rem","h4":"0.8125rem","h5":"0.625rem","h6":"0.5rem","l":"1rem","m":"0.8125rem","s":"0.6875rem"},"weights":{"thin":{},"light":{},"regular":{},"medium":{},"bold":{},"extrabold":{},"black":{}},"families":{"base":"\"Roboto Flex Variable\", sans-serif","accent":"\"Roboto Flex Variable\", sans-serif"}},"spacings":{"xl":"4rem","l":"3rem","b":"1.625rem","s":"1rem","t":"0.5rem","st":"0.25rem"},"transitions":{"ease-in":"cubic-bezier(0.32, 0, 0.67, 0)","ease-out":"cubic-bezier(0.33, 1, 0.68, 1)","ease-in-out":"cubic-bezier(0.65, 0, 0.35, 1)","duration":"250ms"}}};
|
export const tokens = {"theme":{"colors":{"primary-text":"#FFFFFF","primary-100":"#EBF2FC","primary-200":"#8CB5EA","primary-300":"#5894E1","primary-400":"#377FDB","primary-500":"#055FD2","primary-600":"#0556BF","primary-700":"#044395","primary-800":"#033474","primary-900":"#022858","secondary-text":"#555F6B","secondary-100":"#F2F7FC","secondary-200":"#EBF3FA","secondary-300":"#E2EEF8","secondary-400":"#DDEAF7","secondary-500":"#D4E5F5","secondary-600":"#C1D0DF","secondary-700":"#97A3AE","secondary-800":"#757E87","secondary-900":"#596067","greyscale-000":"#FFFFFF","greyscale-100":"#FAFAFB","greyscale-200":"#F3F4F4","greyscale-300":"#E7E8EA","greyscale-400":"#C2C6CA","greyscale-500":"#9EA3AA","greyscale-600":"#79818A","greyscale-700":"#555F6B","greyscale-800":"#303C4B","greyscale-900":"#0C1A2B","success-text":"#FFFFFF","success-100":"#EFFCD3","success-200":"#DBFAA9","success-300":"#BEF27C","success-400":"#A0E659","success-500":"#76D628","success-600":"#5AB81D","success-700":"#419A14","success-800":"#2C7C0C","success-900":"#1D6607","info-text":"#FFFFFF","info-100":"#EBF2FC","info-200":"#8CB5EA","info-300":"#5894E1","info-400":"#377FDB","info-500":"#055FD2","info-600":"#0556BF","info-700":"#044395","info-800":"#033474","info-900":"#022858","warning-text":"#FFFFFF","warning-100":"#FFF8CD","warning-200":"#FFEF9B","warning-300":"#FFE469","warning-400":"#FFDA43","warning-500":"#FFC805","warning-600":"#DBA603","warning-700":"#B78702","warning-800":"#936901","warning-900":"#7A5400","danger-text":"#FFFFFF","danger-100":"#F4B0B0","danger-200":"#EE8A8A","danger-300":"#E65454","danger-400":"#E13333","danger-500":"#DA0000","danger-600":"#C60000","danger-700":"#9B0000","danger-800":"#780000","danger-900":"#5C0000"},"font":{"sizes":{"h1":"1.75rem","h2":"1.375rem","h3":"1.125rem","h4":"0.8125rem","h5":"0.625rem","h6":"0.5rem","l":"1rem","m":"0.8125rem","s":"0.6875rem"},"weights":{"thin":200,"light":300,"regular":400,"medium":500,"bold":600,"extrabold":700,"black":800},"families":{"base":"\"Roboto Flex Variable\", sans-serif","accent":"\"Roboto Flex Variable\", sans-serif"}},"spacings":{"xl":"4rem","l":"3rem","b":"1.625rem","s":"1rem","t":"0.5rem","st":"0.25rem"},"transitions":{"ease-in":"cubic-bezier(0.32, 0, 0.67, 0)","ease-out":"cubic-bezier(0.33, 1, 0.68, 1)","ease-in-out":"cubic-bezier(0.65, 0, 0.35, 1)","duration":"250ms"}}};
|
||||||
|
|||||||
Reference in New Issue
Block a user