@dmsi/wedgekit-react 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SY3HT54E.js → chunk-3WTXVSHO.js} +1 -1
- package/dist/{chunk-UU3FA6LV.js → chunk-5TLFMKSR.js} +1 -1
- package/dist/{chunk-6ZY524ID.js → chunk-DBYSGYST.js} +7 -2
- package/dist/{chunk-TAW5ZZ4Z.js → chunk-GCPJH5R6.js} +5 -4
- package/dist/{chunk-TRUPPHBQ.js → chunk-KDEPZ6I7.js} +1 -1
- package/dist/{chunk-DKKYR6DS.js → chunk-N32PXOA5.js} +2 -2
- package/dist/{chunk-BWRHL2AG.js → chunk-OISE6NMA.js} +2 -2
- package/dist/{chunk-FY7PTP6E.js → chunk-OUTEIXV4.js} +16 -26
- package/dist/{chunk-KX3O6GJ6.js → chunk-RDLEIAQU.js} +11 -0
- package/dist/{chunk-4C66DLIJ.js → chunk-S7R37IUP.js} +1 -1
- package/dist/{chunk-KENSVWOY.js → chunk-T6HZARR7.js} +1 -1
- package/dist/{chunk-TYI74BSP.js → chunk-TJ44JJCB.js} +1 -1
- package/dist/{chunk-GTCSRHPF.js → chunk-TWP6YSFO.js} +1 -1
- package/dist/{chunk-K3IKUSZW.js → chunk-UIQ733QP.js} +1 -1
- package/dist/{chunk-XUIPGYP5.js → chunk-UK3WG7HQ.js} +13 -4
- package/dist/{chunk-BNHSAFMP.js → chunk-VELXLFMJ.js} +1 -1
- package/dist/{chunk-Q3FKEKIN.js → chunk-WIDBAFBU.js} +6 -1
- package/dist/{chunk-E5ALT5W7.js → chunk-YDREJNAS.js} +3 -3
- package/dist/{chunk-2G2E2JMA.js → chunk-YZQNTOIF.js} +4 -2
- package/dist/{chunk-TWZZB4WO.js → chunk-Z2LOGSGE.js} +3 -3
- package/dist/{chunk-5GOBP2JS.js → chunk-ZCBSLV7U.js} +1 -1
- package/dist/{chunk-27KIIUAR.js → chunk-ZFGGZXB6.js} +1 -1
- package/dist/components/Breadcrumbs.cjs +15 -3
- package/dist/components/Breadcrumbs.js +8 -5
- package/dist/components/Button.cjs +9 -0
- package/dist/components/Button.js +2 -2
- package/dist/components/CalendarRange.cjs +22 -21
- package/dist/components/CalendarRange.js +2 -2
- package/dist/components/Caption.cjs +9 -0
- package/dist/components/Caption.js +1 -1
- package/dist/components/Checkbox.cjs +9 -0
- package/dist/components/Checkbox.js +3 -3
- package/dist/components/ContentTab.cjs +9 -0
- package/dist/components/ContentTab.js +3 -3
- package/dist/components/ContentTabs.cjs +9 -0
- package/dist/components/ContentTabs.js +3 -3
- package/dist/components/DataGrid.cjs +12 -2
- package/dist/components/DataGrid.js +12 -12
- package/dist/components/DataGridCell.cjs +10 -1
- package/dist/components/DataGridCell.js +7 -7
- package/dist/components/DateInput.cjs +22 -21
- package/dist/components/DateInput.js +4 -4
- package/dist/components/DateRangeInput.cjs +22 -21
- package/dist/components/DateRangeInput.js +4 -4
- package/dist/components/Display.cjs +9 -0
- package/dist/components/Display.js +2 -2
- package/dist/components/FilterGroup.cjs +9 -0
- package/dist/components/FilterGroup.js +9 -9
- package/dist/components/Heading.cjs +9 -0
- package/dist/components/Heading.js +2 -2
- package/dist/components/Input.cjs +9 -0
- package/dist/components/Input.js +3 -3
- package/dist/components/InputGroup.cjs +9 -0
- package/dist/components/InputGroup.js +2 -2
- package/dist/components/Label.cjs +9 -0
- package/dist/components/Label.js +2 -2
- package/dist/components/Link.cjs +9 -0
- package/dist/components/Link.js +2 -2
- package/dist/components/MainBar.cjs +10 -1
- package/dist/components/MainBar.js +3 -2
- package/dist/components/MenuOption.cjs +9 -0
- package/dist/components/MenuOption.js +4 -4
- package/dist/components/MobileDataGrid.cjs +9 -0
- package/dist/components/MobileDataGrid.js +4 -4
- package/dist/components/Modal.cjs +26 -10
- package/dist/components/Modal.js +6 -6
- package/dist/components/ModalButtons.cjs +11 -1
- package/dist/components/ModalButtons.js +3 -3
- package/dist/components/ModalContent.cjs +131 -2
- package/dist/components/ModalContent.js +2 -1
- package/dist/components/ModalHeader.cjs +16 -2
- package/dist/components/ModalHeader.js +4 -4
- package/dist/components/NavigationTab.cjs +9 -0
- package/dist/components/NavigationTab.js +3 -3
- package/dist/components/NavigationTabs.cjs +9 -0
- package/dist/components/NavigationTabs.js +3 -3
- package/dist/components/Notification.cjs +9 -0
- package/dist/components/Notification.js +4 -4
- package/dist/components/OptionPill.cjs +9 -0
- package/dist/components/OptionPill.js +4 -4
- package/dist/components/Paragraph.cjs +9 -0
- package/dist/components/Paragraph.js +2 -2
- package/dist/components/Password.cjs +9 -0
- package/dist/components/Password.js +3 -3
- package/dist/components/ProjectBar.cjs +9 -0
- package/dist/components/ProjectBar.js +1 -1
- package/dist/components/Radio.cjs +12 -2
- package/dist/components/Radio.js +7 -5
- package/dist/components/Search.cjs +9 -0
- package/dist/components/Search.js +4 -4
- package/dist/components/Select.cjs +9 -0
- package/dist/components/Select.js +4 -4
- package/dist/components/SideMenuGroup.cjs +9 -0
- package/dist/components/SideMenuGroup.js +2 -2
- package/dist/components/SideMenuItem.cjs +9 -0
- package/dist/components/SideMenuItem.js +2 -2
- package/dist/components/StatusPill.cjs +13 -2
- package/dist/components/StatusPill.js +9 -4
- package/dist/components/Stepper.cjs +13 -1
- package/dist/components/Stepper.js +10 -5
- package/dist/components/Subheader.cjs +9 -0
- package/dist/components/Subheader.js +2 -2
- package/dist/components/Swatch.cjs +9 -0
- package/dist/components/Swatch.js +4 -4
- package/dist/components/Textarea.cjs +13 -8
- package/dist/components/Textarea.js +7 -9
- package/dist/components/Time.cjs +9 -0
- package/dist/components/Time.js +3 -3
- package/dist/components/Toast.cjs +14 -3
- package/dist/components/Toast.js +13 -7
- package/dist/components/Tooltip.cjs +11 -1
- package/dist/components/Tooltip.js +2 -2
- package/dist/components/TopBar.cjs +9 -0
- package/dist/components/TopBar.js +1 -1
- package/dist/index.css +23 -69
- package/package.json +1 -1
- package/src/classNames.ts +12 -0
- package/src/components/Breadcrumbs.tsx +6 -3
- package/src/components/CalendarRange.tsx +11 -21
- package/src/components/DataGridCell.tsx +2 -2
- package/src/components/MainBar.tsx +2 -1
- package/src/components/ModalButtons.tsx +3 -1
- package/src/components/ModalContent.tsx +3 -1
- package/src/components/ModalHeader.tsx +9 -2
- package/src/components/Radio.tsx +4 -3
- package/src/components/StatusPill.tsx +4 -1
- package/src/components/Stepper.tsx +5 -1
- package/src/components/Textarea.tsx +4 -9
- package/src/components/Toast.tsx +7 -3
- package/src/components/Tooltip.tsx +3 -2
|
@@ -3,10 +3,8 @@ import {
|
|
|
3
3
|
typography,
|
|
4
4
|
componentGap,
|
|
5
5
|
componentPadding,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
componentPaddingXUsingComponentGap,
|
|
9
|
-
componentPaddingYUsingComponentGap,
|
|
6
|
+
layoutPaddding,
|
|
7
|
+
layoutGap,
|
|
10
8
|
} from "../classNames";
|
|
11
9
|
import { Icon } from "./Icon";
|
|
12
10
|
import React, { useState } from "react";
|
|
@@ -242,8 +240,8 @@ export function CalendarRange({
|
|
|
242
240
|
<div
|
|
243
241
|
className={clsx(
|
|
244
242
|
"relative bg-background-grouped-primary-normal rounded-base w-fit",
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
layoutPaddding,
|
|
244
|
+
layoutGap,
|
|
247
245
|
cardStyle && "shadow-4",
|
|
248
246
|
// baseTransition,
|
|
249
247
|
"overflow-hidden",
|
|
@@ -252,8 +250,7 @@ export function CalendarRange({
|
|
|
252
250
|
<div
|
|
253
251
|
className={clsx(
|
|
254
252
|
"flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
|
|
255
|
-
|
|
256
|
-
paddingUsingComponentGap,
|
|
253
|
+
layoutGap,
|
|
257
254
|
)}
|
|
258
255
|
>
|
|
259
256
|
{(mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
|
|
@@ -267,17 +264,11 @@ export function CalendarRange({
|
|
|
267
264
|
// key={month.name + month.year}
|
|
268
265
|
className={clsx(
|
|
269
266
|
"flex flex-col",
|
|
270
|
-
componentGap,
|
|
271
|
-
componentPadding,
|
|
272
267
|
)}
|
|
273
268
|
>
|
|
274
269
|
<div
|
|
275
270
|
className={clsx(
|
|
276
271
|
"flex flex-row items-center justify-between",
|
|
277
|
-
componentGap,
|
|
278
|
-
componentPaddingXUsingComponentGap,
|
|
279
|
-
componentPaddingYUsingComponentGap,
|
|
280
|
-
"mb-3",
|
|
281
272
|
typography.label,
|
|
282
273
|
"text-text-action-primary-normal",
|
|
283
274
|
)}
|
|
@@ -286,9 +277,8 @@ export function CalendarRange({
|
|
|
286
277
|
<button
|
|
287
278
|
type="button"
|
|
288
279
|
className={clsx(
|
|
289
|
-
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-primary-normal",
|
|
280
|
+
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
290
281
|
componentPadding,
|
|
291
|
-
"mr-1",
|
|
292
282
|
)}
|
|
293
283
|
aria-label="Previous month"
|
|
294
284
|
onClick={() =>
|
|
@@ -312,9 +302,8 @@ export function CalendarRange({
|
|
|
312
302
|
<button
|
|
313
303
|
type="button"
|
|
314
304
|
className={clsx(
|
|
315
|
-
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-primary-normal",
|
|
305
|
+
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
316
306
|
componentPadding,
|
|
317
|
-
"ml-1",
|
|
318
307
|
)}
|
|
319
308
|
aria-label="Next month"
|
|
320
309
|
onClick={() => setBaseMonth(baseMonth.add({ months: 1 }))}
|
|
@@ -325,13 +314,14 @@ export function CalendarRange({
|
|
|
325
314
|
<span className={clsx(componentPadding, "ml-1")} />
|
|
326
315
|
)}
|
|
327
316
|
</div>
|
|
328
|
-
<div className={clsx("grid grid-cols-7
|
|
317
|
+
<div className={clsx("grid grid-cols-7")}>
|
|
329
318
|
{weekDays.map((d) => (
|
|
330
319
|
<span
|
|
331
320
|
key={d}
|
|
332
321
|
className={clsx(
|
|
333
322
|
typography.caption,
|
|
334
323
|
"text-text-secondary-normal text-center",
|
|
324
|
+
"w-10"
|
|
335
325
|
)}
|
|
336
326
|
>
|
|
337
327
|
{d}
|
|
@@ -402,7 +392,7 @@ export function CalendarRange({
|
|
|
402
392
|
isRangeEnd={!!isRangeEnd}
|
|
403
393
|
isRangeDisabled={mode === "single" && disableRange}
|
|
404
394
|
// Add cell padding for spacing
|
|
405
|
-
cellPadding=
|
|
395
|
+
cellPadding={componentPadding}
|
|
406
396
|
/>
|
|
407
397
|
);
|
|
408
398
|
})}
|
|
@@ -411,7 +401,7 @@ export function CalendarRange({
|
|
|
411
401
|
{mode === "double" && idx === 0 && (
|
|
412
402
|
<div
|
|
413
403
|
className={clsx(
|
|
414
|
-
"self-stretch bg-border-primary-normal rounded-base
|
|
404
|
+
"self-stretch bg-border-primary-normal rounded-base",
|
|
415
405
|
|
|
416
406
|
// 1px width, full height, matches Figma divider
|
|
417
407
|
"w-px",
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
useRef,
|
|
21
21
|
useState,
|
|
22
22
|
} from "react";
|
|
23
|
-
import { paddingUsingComponentGap } from "../classNames";
|
|
23
|
+
import { componentPadding, paddingUsingComponentGap } from "../classNames";
|
|
24
24
|
import { AsProps } from "../types";
|
|
25
25
|
import { Icon } from "./Icon";
|
|
26
26
|
import { Search } from "./Search";
|
|
@@ -152,7 +152,7 @@ export const DataGridCell = memo(
|
|
|
152
152
|
"border-border-primary-normal",
|
|
153
153
|
component === "input" && error && "border-border-primary-error",
|
|
154
154
|
component === "input" && warning && "border-background-warning-normal",
|
|
155
|
-
!["button", "icon"].includes(component) && !noPadding &&
|
|
155
|
+
!["button", "icon"].includes(component) && !noPadding && componentPadding,
|
|
156
156
|
paddedLeft && "pl-2",
|
|
157
157
|
component === "icon" && "border-l",
|
|
158
158
|
isGrabbing && "!cursor-grabbing",
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
containerPaddingY,
|
|
6
6
|
containerPaddingX,
|
|
7
7
|
layoutGroupGap,
|
|
8
|
+
layoutGap,
|
|
8
9
|
} from "../classNames";
|
|
9
10
|
|
|
10
11
|
type MainBarProps = {
|
|
@@ -52,7 +53,7 @@ export const MainBar = ({
|
|
|
52
53
|
<div
|
|
53
54
|
className={clsx(
|
|
54
55
|
"hidden desktop:flex items-center ml-auto",
|
|
55
|
-
|
|
56
|
+
layoutGap,
|
|
56
57
|
)}
|
|
57
58
|
>
|
|
58
59
|
{right}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
1
2
|
import { Button } from "./Button";
|
|
2
3
|
import { Icon } from "./Icon";
|
|
4
|
+
import { layoutGroupGap, layoutPaddding } from "../classNames";
|
|
3
5
|
|
|
4
6
|
type ModalButtonsProps = {
|
|
5
7
|
title?: string;
|
|
@@ -15,7 +17,7 @@ export const ModalButtons = ({
|
|
|
15
17
|
customActions,
|
|
16
18
|
}: ModalButtonsProps) => {
|
|
17
19
|
return (
|
|
18
|
-
<div className="border-t border-neutral-300
|
|
20
|
+
<div className={clsx("border-t border-neutral-300 flex justify-end", layoutPaddding, layoutGroupGap)}>
|
|
19
21
|
{customActions ?? (
|
|
20
22
|
<>
|
|
21
23
|
<Button
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
|
+
import { layoutPaddding } from "../classNames";
|
|
2
3
|
|
|
3
4
|
export interface ModalContentProps {
|
|
4
5
|
fixedHeightScrolling?: boolean;
|
|
@@ -11,7 +12,8 @@ export function ModalContent({
|
|
|
11
12
|
return (
|
|
12
13
|
<div
|
|
13
14
|
className={clsx(
|
|
14
|
-
"flex-grow desktop:flex-grow-0
|
|
15
|
+
"flex-grow desktop:flex-grow-0",
|
|
16
|
+
layoutPaddding,
|
|
15
17
|
fixedHeightScrolling && "overflow-auto",
|
|
16
18
|
)}
|
|
17
19
|
>
|
|
@@ -2,6 +2,8 @@ import { Heading2 } from "./Heading";
|
|
|
2
2
|
|
|
3
3
|
import { Button } from "./Button";
|
|
4
4
|
import { Icon } from "./Icon";
|
|
5
|
+
import { layoutGroupGap, layoutPaddding } from "../classNames";
|
|
6
|
+
import clsx from "clsx";
|
|
5
7
|
|
|
6
8
|
type ModalHeaderProps = {
|
|
7
9
|
title?: string;
|
|
@@ -17,11 +19,16 @@ export const ModalHeader = ({
|
|
|
17
19
|
onClose,
|
|
18
20
|
}: ModalHeaderProps) => {
|
|
19
21
|
return (
|
|
20
|
-
<div className=
|
|
21
|
-
|
|
22
|
+
<div className={clsx(
|
|
23
|
+
"flex justify-between items-center",
|
|
24
|
+
layoutPaddding,
|
|
25
|
+
layoutGroupGap
|
|
26
|
+
)}>
|
|
27
|
+
<div className={clsx("flex items-center", layoutGroupGap)}>
|
|
22
28
|
{headerIcon}
|
|
23
29
|
{title && <Heading2 as="p">{title}</Heading2>}
|
|
24
30
|
</div>
|
|
31
|
+
|
|
25
32
|
{!hideCloseIcon && (
|
|
26
33
|
<Button
|
|
27
34
|
iconOnly
|
package/src/components/Radio.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
|
-
import { baseTransition } from "../classNames";
|
|
5
|
+
import { baseTransition, componentGap } from "../classNames";
|
|
6
6
|
import { Paragraph } from "./Paragraph";
|
|
7
7
|
import { TextColorTokens } from "../types";
|
|
8
8
|
|
|
@@ -59,7 +59,8 @@ export const Radio = ({
|
|
|
59
59
|
<label
|
|
60
60
|
htmlFor={radioId}
|
|
61
61
|
className={clsx(
|
|
62
|
-
"flex items-center
|
|
62
|
+
"flex items-center",
|
|
63
|
+
componentGap,
|
|
63
64
|
disabled ? "cursor-default" : "cursor-pointer",
|
|
64
65
|
className,
|
|
65
66
|
)}
|
|
@@ -103,7 +104,7 @@ export const Radio = ({
|
|
|
103
104
|
</div>
|
|
104
105
|
|
|
105
106
|
{label && (
|
|
106
|
-
<Paragraph
|
|
107
|
+
<Paragraph padded color={paragraphColor}>
|
|
107
108
|
{label}
|
|
108
109
|
</Paragraph>
|
|
109
110
|
)}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
import { Label } from "./Label";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import { componentPaddingYUsingComponentGap, paddingXUsingLayoutGroupGap } from "../classNames";
|
|
4
5
|
|
|
5
6
|
type StatusPillProps = PropsWithChildren<{
|
|
6
7
|
intent?: "neutral" | "warning" | "success" | "critical";
|
|
@@ -38,9 +39,11 @@ export const StatusPill = ({
|
|
|
38
39
|
<div
|
|
39
40
|
{...props}
|
|
40
41
|
className={clsx(
|
|
41
|
-
"
|
|
42
|
+
"rounded flex items-center",
|
|
42
43
|
textColor,
|
|
43
44
|
backgroundColor,
|
|
45
|
+
paddingXUsingLayoutGroupGap,
|
|
46
|
+
componentPaddingYUsingComponentGap
|
|
44
47
|
)}
|
|
45
48
|
>
|
|
46
49
|
<Label>{children}</Label>
|
|
@@ -3,6 +3,7 @@ import { Button } from "./Button";
|
|
|
3
3
|
import { InputBase } from "./Input";
|
|
4
4
|
import { Icon } from "./Icon";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
+
import { componentGap } from "../classNames";
|
|
6
7
|
|
|
7
8
|
type StepperProps = {
|
|
8
9
|
error?: boolean;
|
|
@@ -34,7 +35,10 @@ export const Stepper = ({
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
return (
|
|
37
|
-
<div className=
|
|
38
|
+
<div className={clsx(
|
|
39
|
+
"flex items-center",
|
|
40
|
+
componentGap
|
|
41
|
+
)}>
|
|
38
42
|
<Button
|
|
39
43
|
iconOnly
|
|
40
44
|
variant="tertiary"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
|
-
import { baseTransition, typography } from "../classNames";
|
|
4
|
+
import { baseTransition, componentGap, componentPaddingMinusBorder, typography } from "../classNames";
|
|
5
5
|
|
|
6
6
|
interface TextareaProps
|
|
7
7
|
extends Omit<
|
|
@@ -13,17 +13,11 @@ interface TextareaProps
|
|
|
13
13
|
caption?: ReactNode;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const textareaComponentPaddingMinusBorder = clsx(
|
|
17
|
-
"p-[calc(var(--spacing-mobile-component-padding)_+_var(--spacing-mobile-component-gap)_-_1px)]",
|
|
18
|
-
"desktop:p-[calc(var(--spacing-desktop-component-padding)_+_var(--spacing-desktop-component-gap)_-_1px)]",
|
|
19
|
-
"compact:p-[calc(var(--spacing-desktop-compact-component-padding)_+_var(--spacing-desktop-compact-component-gap)_-_1px)]",
|
|
20
|
-
);
|
|
21
|
-
|
|
22
16
|
const textareaBaseClass = clsx(
|
|
23
17
|
"w-full min-h-19",
|
|
24
18
|
"rounded-base border border-border-primary-normal bg-background-primary-normal caret-text-action-normal",
|
|
25
19
|
"outline-transparent outline-2",
|
|
26
|
-
|
|
20
|
+
componentPaddingMinusBorder,
|
|
27
21
|
baseTransition,
|
|
28
22
|
);
|
|
29
23
|
|
|
@@ -56,11 +50,12 @@ export const Textarea = ({
|
|
|
56
50
|
return (
|
|
57
51
|
<label
|
|
58
52
|
className={clsx(
|
|
59
|
-
"
|
|
53
|
+
"flex flex-col w-full",
|
|
60
54
|
"text-text-primary-normal has-disabled:text-text-primary-disabled",
|
|
61
55
|
!props.disabled &&
|
|
62
56
|
!props.readOnly &&
|
|
63
57
|
"has-[[data-error]]:text-text-primary-error",
|
|
58
|
+
componentGap
|
|
64
59
|
)}
|
|
65
60
|
>
|
|
66
61
|
{label && (
|
package/src/components/Toast.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import { Paragraph } from "./Paragraph";
|
|
|
7
7
|
import { Icon } from "./Icon";
|
|
8
8
|
import { Button } from "./Button";
|
|
9
9
|
import { createRoot } from "react-dom/client";
|
|
10
|
+
import { componentGap, componentPadding, layoutGroupGap } from "../classNames";
|
|
10
11
|
|
|
11
12
|
export interface ToastProps {
|
|
12
13
|
variant?: "success" | "warning" | "error" | "info";
|
|
@@ -194,18 +195,21 @@ export const Toast = ({
|
|
|
194
195
|
onMouseEnter={handleMouseEnter}
|
|
195
196
|
onMouseLeave={handleMouseLeave}
|
|
196
197
|
className={clsx(
|
|
197
|
-
"flex items-start
|
|
198
|
+
"flex items-start border-2 rounded-sm bg-white shadow-md cursor-pointer pointer-events-auto transition-all duration-300 ease-in-out w-fit",
|
|
199
|
+
componentPadding,
|
|
200
|
+
layoutGroupGap,
|
|
198
201
|
className,
|
|
199
202
|
)}
|
|
200
203
|
{...props}
|
|
201
204
|
style={props.style}
|
|
202
205
|
>
|
|
203
206
|
{iconElement}
|
|
204
|
-
<div className="flex
|
|
205
|
-
<div className="flex flex-col
|
|
207
|
+
<div className={clsx("flex items-center", layoutGroupGap)}>
|
|
208
|
+
<div className={clsx("flex flex-col w-68", componentGap)}>
|
|
206
209
|
{title && <Heading3>{title}</Heading3>}
|
|
207
210
|
{message && <Paragraph>{message}</Paragraph>}
|
|
208
211
|
</div>
|
|
212
|
+
|
|
209
213
|
{showViewButton && (
|
|
210
214
|
<Button variant="tertiary" href={viewButtonLink}>
|
|
211
215
|
View
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { PropsWithChildren, ReactNode, useEffect, useRef, useState } from "react";
|
|
5
5
|
import { createPortal } from "react-dom";
|
|
6
|
-
import { typography } from "../classNames";
|
|
6
|
+
import { componentPadding, typography } from "../classNames";
|
|
7
7
|
|
|
8
8
|
export type TooltipProps = PropsWithChildren<{
|
|
9
9
|
message: string;
|
|
@@ -107,7 +107,8 @@ export const Tooltip = ({
|
|
|
107
107
|
}}
|
|
108
108
|
className={clsx(
|
|
109
109
|
typography.caption,
|
|
110
|
-
"
|
|
110
|
+
"bg-neutral-500 text-neutral-100 rounded whitespace-nowrap shadow-2 pointer-events-none transition-opacity duration-100 ease-in-out",
|
|
111
|
+
componentPadding,
|
|
111
112
|
!removeOpacity && "opacity-0"
|
|
112
113
|
)}
|
|
113
114
|
>
|