@gobolt/genesis 0.0.8 → 0.0.10
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/README.md +10 -0
- package/dist/{AntdIcon-c395a1c4.js → AntdIcon-BoLh1dP8.js} +66 -68
- package/dist/CheckOutlined-CeTKr6II.js +13 -0
- package/dist/{CloseCircleFilled-ddc51e7e.js → CloseCircleFilled-DXCxlIQL.js} +8 -11
- package/dist/{CloseOutlined-14b8bba1.js → CloseOutlined-ClXDNn82.js} +9 -12
- package/dist/{Compact-c39ed20d.js → Compact-CGY560JF.js} +63 -65
- package/dist/ContextIsolator-D5x2Ih51.js +20 -0
- package/dist/{ExclamationCircleFilled-23ef9812.js → ExclamationCircleFilled-C0Kj5KQV.js} +16 -22
- package/dist/KeyCode-DM2sFh3-.js +517 -0
- package/dist/LoadingOutlined-8EnJdZ7I.js +13 -0
- package/dist/{Overflow-a570fa69.js → Overflow-PBZD-PFm.js} +63 -64
- package/dist/{DownOutlined-64a4732a.js → PurePanel-BqPLRtc2.js} +67 -70
- package/dist/{SearchOutlined-a9014e08.js → SearchOutlined-BP3Z2K6j.js} +8 -11
- package/dist/{TextArea-20825221.js → TextArea-DKwCct3i.js} +583 -588
- package/dist/Typography-aGoDUl4R.js +710 -0
- package/dist/bundle.css +1204 -0
- package/dist/{button-fa1c119c.js → button-CDQgO1OK.js} +274 -278
- package/dist/{collapse-345bc884.js → collapse-Dtpt-6W_.js} +2 -2
- package/dist/compact-item-DH13cl8A.js +61 -0
- package/dist/components/Badge/Badge.d.ts +2 -2
- package/dist/components/Badge/Badge.js +63 -62
- package/dist/components/Badge/__tests__/Badge.test.js +11 -65
- package/dist/components/Badge/index.js +2 -21
- package/dist/components/Badge/styles.js +7 -8
- package/dist/components/Breadcrumb/Breadcrumb.js +8 -24
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +21 -7
- package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +13 -60
- package/dist/components/Breadcrumb/index.js +2 -25
- package/dist/components/Breadcrumb/styles.d.ts +10 -6
- package/dist/components/Breadcrumb/styles.js +787 -808
- package/dist/components/Button/Button.d.ts +6 -4
- package/dist/components/Button/Button.js +20 -40
- package/dist/components/Button/__tests__/Button.test.js +9 -54
- package/dist/components/Button/index.js +2 -20
- package/dist/components/Button/styles.d.ts +9 -5
- package/dist/components/Button/styles.js +19 -30
- package/dist/components/Checkbox/Checkbox.js +8 -38
- package/dist/components/Checkbox/__tests__/Checkbox.test.js +16 -62
- package/dist/components/Checkbox/index.js +2 -47
- package/dist/components/Checkbox/styles.d.ts +8 -1
- package/dist/components/Checkbox/styles.js +181 -188
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.d.ts +2 -4
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +19 -51
- package/dist/components/ErrorBoundaryFallback/index.d.ts +1 -0
- package/dist/components/ErrorBoundaryFallback/index.js +2 -49
- package/dist/components/ErrorBoundaryFallback/styles.d.ts +1 -3
- package/dist/components/ErrorBoundaryFallback/styles.js +34 -37
- package/dist/components/Form/Form.d.ts +18 -5
- package/dist/components/Form/Form.js +4 -45
- package/dist/components/Form/__stories__/FormStory.js +44 -81
- package/dist/components/Form/__tests__/form.test.d.ts +1 -0
- package/dist/components/Form/__tests__/form.test.js +18 -0
- package/dist/components/Form/index.js +2 -46
- package/dist/components/Form/styles.d.ts +3 -0
- package/dist/components/Form/styles.js +5 -0
- package/dist/components/Input/Input.js +6 -29
- package/dist/components/Input/__tests__/Input.test.js +21 -66
- package/dist/components/Input/index.js +2 -29
- package/dist/components/Input/styles.d.ts +5 -2
- package/dist/components/Input/styles.js +319 -332
- package/dist/components/Message/Message.d.ts +4 -4
- package/dist/components/Message/Message.js +53 -80
- package/dist/components/Message/__tests__/Message.test.js +24 -70
- package/dist/components/Message/index.js +2 -48
- package/dist/components/Message/styles.d.ts +4 -1
- package/dist/components/Message/styles.js +24 -18
- package/dist/components/Notification/Notification.d.ts +11 -10
- package/dist/components/Notification/Notification.js +306 -372
- package/dist/components/Notification/NotificationRightChevron.d.ts +2 -0
- package/dist/components/Notification/NotificationRightChevron.js +23 -0
- package/dist/components/Notification/__tests__/Notification.test.js +8 -69
- package/dist/components/Notification/index.js +2 -59
- package/dist/components/Notification/styles.d.ts +13 -3
- package/dist/components/Notification/styles.js +36 -20
- package/dist/components/Radio/Radio.js +20 -106
- package/dist/components/Radio/RadioGroup.js +18 -71
- package/dist/components/Radio/__stories__/RadioGroup.stories.d.ts +1 -1
- package/dist/components/Radio/__tests__/RadioGroup.test.js +15 -70
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/Radio/index.js +2 -56
- package/dist/components/Select/DropdownChevron.d.ts +2 -0
- package/dist/components/Select/DropdownChevron.js +23 -0
- package/dist/components/Select/Select.d.ts +9 -4
- package/dist/components/Select/Select.js +29 -41
- package/dist/components/Select/__tests__/Select.test.js +10752 -93
- package/dist/components/Select/index.js +2 -28
- package/dist/components/Select/styles.d.ts +20 -6
- package/dist/components/Select/styles.js +1381 -1370
- package/dist/components/Toast/Toast.d.ts +4 -4
- package/dist/components/Toast/Toast.js +8 -37
- package/dist/components/Toast/__stories__/Toast.stories.d.ts +1 -0
- package/dist/components/Toast/__tests__/Toast.test.js +10 -55
- package/dist/components/Toast/index.js +2 -46
- package/dist/components/Toast/styles.d.ts +6 -1
- package/dist/components/Toast/styles.js +36 -21
- package/dist/components/Typography/Typography.d.ts +7 -4
- package/dist/components/Typography/Typography.js +2 -42
- package/dist/components/Typography/__stories__/Typography.stories.d.ts +1 -0
- package/dist/components/Typography/__tests__/Typography.test.js +19 -56
- package/dist/components/Typography/index.js +2 -46
- package/dist/components/Typography/styles.d.ts +18 -4
- package/dist/components/Typography/styles.js +36 -43
- package/dist/components/index.d.ts +13 -5
- package/dist/components/index.js +24 -70
- package/dist/{context-3b8a39af.js → context-BMW3aJEf.js} +538 -548
- package/dist/genesis/GenesisThemeBreakdown.js +38 -55
- package/dist/genesis/GenesisThemeDemo.js +3 -53
- package/dist/genesis/styles.d.ts +6 -2
- package/dist/genesis/styles.js +496 -521
- package/dist/{index-e2b72ca8.js → index-1CBpubM3.js} +97 -102
- package/dist/index-BZAhCB_K.js +97 -0
- package/dist/{index-501fc13d.js → index-C0SmxWLS.js} +367 -392
- package/dist/index-C8haFnXI.js +1112 -0
- package/dist/index-CfDY25LP.js +873 -0
- package/dist/index-DPW8XdWj.js +952 -0
- package/dist/{index-8c8d2d0c.js → index-bKlRxQp4.js} +114 -114
- package/dist/index-oK7z6jnz.js +22795 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +31 -77
- package/dist/{isVisible-729780f5.js → isVisible-A-IfeFoT.js} +67 -94
- package/dist/{magic-string.es-b7491176.js → magic-string.es-D2FWSwU3.js} +56 -103
- package/dist/{pickAttrs-00ba4687.js → pickAttrs-B0YTfcV1.js} +1 -1
- package/dist/providers/GenesisProvider.d.ts +0 -5
- package/dist/providers/GenesisProvider.js +9 -59
- package/dist/providers/ThemeProvider.d.ts +1 -2
- package/dist/providers/ThemeProvider.js +11 -13
- package/dist/providers/ToastProvider.d.ts +11 -4
- package/dist/providers/ToastProvider.js +10 -39
- package/dist/providers/index.d.ts +2 -3
- package/dist/providers/index.js +4 -51
- package/dist/providers/useGenesis.d.ts +7 -0
- package/dist/providers/useGenesis.js +6 -0
- package/dist/setup-BvfREoHl.js +33891 -0
- package/dist/{styled-components.browser.esm-02f500bc.js → styled-components.browser.esm-CZ1XM4o4.js} +72 -134
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +15 -45
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +15 -45
- package/dist/styles/design-tokens/{typography → typography-tokens}/TypographyTokens.stories.d.ts +1 -0
- package/dist/styles/design-tokens/variables.d.ts +10 -10
- package/dist/styles/design-tokens/variables.js +1 -1
- package/dist/styles/global-styles.d.ts +1 -0
- package/dist/styles/global-styles.js +14 -31
- package/dist/styles/theme/genesis-theme.js +257 -212
- package/dist/styles/theme/genesis-theme.types.d.ts +46 -0
- package/dist/styles/theme/index.js +4 -5
- package/dist/styles-CT_fyXBd.js +1808 -0
- package/dist/test/setup.js +3 -46
- package/dist/useLocale-DT-z_vQ6.js +16 -0
- package/dist/useVariants-DvhXfgJY.js +30 -0
- package/dist/utils/isAllEnglishString.js +1 -2
- package/dist/{presets-83ccb923.js → warning-C63HNL9U.js} +358 -356
- package/package.json +51 -43
- package/dist/CheckOutlined-52d9ac25.js +0 -29
- package/dist/ContextIsolator-b09b2c52.js +0 -20
- package/dist/EllipsisOutlined-60122660.js +0 -1115
- package/dist/InfoCircleFilled-c5f90c20.js +0 -16
- package/dist/RightOutlined-83515eb4.js +0 -16
- package/dist/compact-item-b8f85aa6.js +0 -75
- package/dist/index-0a886e53.js +0 -100
- package/dist/index-0b9ee239.js +0 -955
- package/dist/index-1a33c134.js +0 -1389
- package/dist/index-4003d75b.js +0 -3748
- package/dist/index-89035ea5.js +0 -3242
- package/dist/providers/ToastWrapper.d.ts +0 -7
- package/dist/providers/ToastWrapper.js +0 -56
- package/dist/setup-aaca7b6f.js +0 -21158
- package/dist/styles/theme/global-styles.d.ts +0 -1
- package/dist/styles/theme/global-styles.js +0 -36
- package/dist/useVariants-a0d64298.js +0 -30
- /package/dist/{presetColors-ccf8cb4c.js → presetColors-Cl8UP3Nw.js} +0 -0
- /package/dist/{reactNode-f4391605.js → reactNode-sKPeiqPL.js} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { STATE } from '../../constants';
|
|
1
|
+
import { STATE, SIZE } from '../../constants';
|
|
2
2
|
|
|
3
3
|
export interface MessageProps {
|
|
4
4
|
state: keyof typeof STATE;
|
|
5
5
|
message: string;
|
|
6
6
|
action?: {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
label?: string;
|
|
8
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
9
9
|
};
|
|
10
|
-
size
|
|
10
|
+
size?: Extract<keyof typeof SIZE, "small" | "standard">;
|
|
11
11
|
}
|
|
12
12
|
declare const Message: ({ state, message, action, size, }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default Message;
|
|
@@ -1,105 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { TYPOGRAPHY_VARIANT as f, STATE as s, SIZE as m } from "../../constants/index.js";
|
|
3
|
+
import { n as p } from "../../styled-components.browser.esm-CZ1XM4o4.js";
|
|
4
|
+
import "../Badge/styles.js";
|
|
5
|
+
import "../Breadcrumb/styles.js";
|
|
4
6
|
import "../../providers/ThemeProvider.js";
|
|
7
|
+
import { a as u, R as g, b as d, c as I, d as R, e as y } from "../../Typography-aGoDUl4R.js";
|
|
8
|
+
import "../Button/styles.js";
|
|
5
9
|
import "../Checkbox/styles.js";
|
|
6
10
|
import "../ErrorBoundaryFallback/styles.js";
|
|
7
|
-
import { T as u, I as d, M as f, C as g, d as C, E as y } from "../../index-89035ea5.js";
|
|
8
11
|
import "../Input/styles.js";
|
|
12
|
+
import "../Notification/styles.js";
|
|
9
13
|
import "react";
|
|
10
14
|
import "../Select/styles.js";
|
|
11
|
-
import { n as h } from "../../styled-components.browser.esm-02f500bc.js";
|
|
12
|
-
import "../Badge/styles.js";
|
|
13
15
|
import "../Toast/styles.js";
|
|
14
|
-
import { MessageRow as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import "../../index-4003d75b.js";
|
|
19
|
-
import "react-dom";
|
|
20
|
-
import "../../index-e2b72ca8.js";
|
|
21
|
-
import "../../reactNode-f4391605.js";
|
|
22
|
-
import "../../Compact-c39ed20d.js";
|
|
23
|
-
import "../../presetColors-ccf8cb4c.js";
|
|
24
|
-
import "../../compact-item-b8f85aa6.js";
|
|
25
|
-
import "../../AntdIcon-c395a1c4.js";
|
|
26
|
-
import "../../styles/theme/genesis-theme.js";
|
|
27
|
-
import "../../styles/design-tokens/variables.js";
|
|
28
|
-
import "../../context-3b8a39af.js";
|
|
29
|
-
import "../../ExclamationCircleFilled-23ef9812.js";
|
|
30
|
-
import "../../CloseCircleFilled-ddc51e7e.js";
|
|
31
|
-
import "../Typography/styles.js";
|
|
32
|
-
import "../../index-501fc13d.js";
|
|
33
|
-
import "../../index-8c8d2d0c.js";
|
|
34
|
-
import "../../CheckOutlined-52d9ac25.js";
|
|
35
|
-
import "../../index-0b9ee239.js";
|
|
36
|
-
import "../../index-1a33c134.js";
|
|
37
|
-
import "../../ContextIsolator-b09b2c52.js";
|
|
38
|
-
import "../../TextArea-20825221.js";
|
|
39
|
-
import "../../useVariants-a0d64298.js";
|
|
40
|
-
import "../../CloseOutlined-14b8bba1.js";
|
|
41
|
-
import "../../InfoCircleFilled-c5f90c20.js";
|
|
42
|
-
import "../../pickAttrs-00ba4687.js";
|
|
43
|
-
import "../../collapse-345bc884.js";
|
|
44
|
-
import "../../SearchOutlined-a9014e08.js";
|
|
45
|
-
import "../../Overflow-a570fa69.js";
|
|
46
|
-
import "../../DownOutlined-64a4732a.js";
|
|
47
|
-
const I = (i, r) => {
|
|
48
|
-
switch (i) {
|
|
49
|
-
case t.error:
|
|
16
|
+
import { MessageRow as T, MessageContent as w, ActionButton as h } from "./styles.js";
|
|
17
|
+
const x = (o, r) => {
|
|
18
|
+
switch (o) {
|
|
19
|
+
case s.error:
|
|
50
20
|
return r.colors.status.error.onsurface;
|
|
51
|
-
case
|
|
21
|
+
case s.success:
|
|
52
22
|
return r.colors.status.success.onsurface;
|
|
53
|
-
case
|
|
23
|
+
case s.warning:
|
|
54
24
|
return r.colors.status.warning.onsurface;
|
|
55
|
-
case
|
|
25
|
+
case s.generic:
|
|
56
26
|
return r.colors.status.generic.onsurface;
|
|
57
|
-
case
|
|
27
|
+
case s.info:
|
|
58
28
|
default:
|
|
59
29
|
return r.colors.status.info.onsurface;
|
|
60
30
|
}
|
|
61
|
-
},
|
|
62
|
-
switch (
|
|
63
|
-
case
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
case
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
case
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
case
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
case
|
|
31
|
+
}, A = (o, r) => {
|
|
32
|
+
switch (o) {
|
|
33
|
+
case s.warning:
|
|
34
|
+
return /* @__PURE__ */ e(y, { style: { color: r } });
|
|
35
|
+
case s.error:
|
|
36
|
+
return /* @__PURE__ */ e(R, { style: { color: r } });
|
|
37
|
+
case s.success:
|
|
38
|
+
return /* @__PURE__ */ e(I, { style: { color: r } });
|
|
39
|
+
case s.generic:
|
|
40
|
+
return /* @__PURE__ */ e(d, { style: { color: r } });
|
|
41
|
+
case s.info:
|
|
72
42
|
default:
|
|
73
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ e(g, { style: { color: r } });
|
|
74
44
|
}
|
|
75
|
-
},
|
|
76
|
-
state:
|
|
45
|
+
}, V = ({
|
|
46
|
+
state: o = s.info,
|
|
77
47
|
message: r,
|
|
78
|
-
action:
|
|
79
|
-
size:
|
|
48
|
+
action: t,
|
|
49
|
+
size: l = m.standard
|
|
80
50
|
}) => {
|
|
81
|
-
const
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
/* @__PURE__ */
|
|
51
|
+
const n = p(), c = x(o, n), a = f.message;
|
|
52
|
+
return /* @__PURE__ */ i(T, { state: o, size: l, children: [
|
|
53
|
+
/* @__PURE__ */ i(w, { children: [
|
|
54
|
+
A(o, c),
|
|
55
|
+
/* @__PURE__ */ e(
|
|
56
|
+
u,
|
|
57
|
+
{
|
|
58
|
+
variant: a,
|
|
59
|
+
color: c,
|
|
60
|
+
isText: !0,
|
|
61
|
+
children: r
|
|
62
|
+
}
|
|
63
|
+
)
|
|
86
64
|
] }),
|
|
87
|
-
|
|
88
|
-
|
|
65
|
+
t ? /* @__PURE__ */ e(h, { onClick: t.onClick, children: /* @__PURE__ */ e(
|
|
66
|
+
u,
|
|
89
67
|
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
background: "none",
|
|
95
|
-
cursor: "pointer",
|
|
96
|
-
cursorEvents: "all"
|
|
97
|
-
},
|
|
98
|
-
children: /* @__PURE__ */ o(u, { variant: c, children: e.text })
|
|
68
|
+
variant: a,
|
|
69
|
+
color: n.colors.interactive.link.active,
|
|
70
|
+
isText: !0,
|
|
71
|
+
children: t.label
|
|
99
72
|
}
|
|
100
|
-
) : null
|
|
73
|
+
) }) : null
|
|
101
74
|
] });
|
|
102
75
|
};
|
|
103
76
|
export {
|
|
104
|
-
|
|
77
|
+
V as default
|
|
105
78
|
};
|
|
@@ -1,88 +1,42 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { STATE as
|
|
5
|
-
import { c as n } from "../../../setup-aaca7b6f.js";
|
|
6
|
-
import "../../Button/styles.js";
|
|
7
|
-
import "../../../styled-components.browser.esm-02f500bc.js";
|
|
8
|
-
import "react";
|
|
9
|
-
import "../../../button-fa1c119c.js";
|
|
10
|
-
import "../../../presets-83ccb923.js";
|
|
11
|
-
import "../../../isVisible-729780f5.js";
|
|
12
|
-
import "../../../index-4003d75b.js";
|
|
13
|
-
import "react-dom";
|
|
14
|
-
import "../../../index-e2b72ca8.js";
|
|
15
|
-
import "../../../reactNode-f4391605.js";
|
|
16
|
-
import "../../../Compact-c39ed20d.js";
|
|
17
|
-
import "../../../presetColors-ccf8cb4c.js";
|
|
18
|
-
import "../../../compact-item-b8f85aa6.js";
|
|
19
|
-
import "../../../AntdIcon-c395a1c4.js";
|
|
20
|
-
import "../../../providers/ThemeProvider.js";
|
|
21
|
-
import "../../../styles/theme/genesis-theme.js";
|
|
22
|
-
import "../../../styles/design-tokens/variables.js";
|
|
23
|
-
import "../../Checkbox/styles.js";
|
|
24
|
-
import "../../../context-3b8a39af.js";
|
|
25
|
-
import "../../ErrorBoundaryFallback/styles.js";
|
|
26
|
-
import "../../../ExclamationCircleFilled-23ef9812.js";
|
|
27
|
-
import "../../../CloseCircleFilled-ddc51e7e.js";
|
|
28
|
-
import "../../../index-89035ea5.js";
|
|
29
|
-
import "../../Input/styles.js";
|
|
30
|
-
import "../../../TextArea-20825221.js";
|
|
31
|
-
import "../../../index-8c8d2d0c.js";
|
|
32
|
-
import "../../../useVariants-a0d64298.js";
|
|
33
|
-
import "../../../ContextIsolator-b09b2c52.js";
|
|
34
|
-
import "../../../pickAttrs-00ba4687.js";
|
|
35
|
-
import "../../../SearchOutlined-a9014e08.js";
|
|
36
|
-
import "../../Select/styles.js";
|
|
37
|
-
import "../../../index-1a33c134.js";
|
|
38
|
-
import "../../../Overflow-a570fa69.js";
|
|
39
|
-
import "../../../DownOutlined-64a4732a.js";
|
|
40
|
-
import "../../../CheckOutlined-52d9ac25.js";
|
|
41
|
-
import "../../../CloseOutlined-14b8bba1.js";
|
|
42
|
-
import "../../Typography/styles.js";
|
|
43
|
-
import "../../../index-501fc13d.js";
|
|
44
|
-
import "../../../index-0b9ee239.js";
|
|
45
|
-
import "../../Badge/styles.js";
|
|
46
|
-
import "../../../InfoCircleFilled-c5f90c20.js";
|
|
47
|
-
import "../../Toast/styles.js";
|
|
48
|
-
import "../../../collapse-345bc884.js";
|
|
49
|
-
import "../styles.js";
|
|
50
|
-
import "../../../providers/GenesisProvider.js";
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { v as r, f as a, a as i } from "../../../setup-BvfREoHl.js";
|
|
3
|
+
import m from "../Message.js";
|
|
4
|
+
import { STATE as s } from "../../../constants/index.js";
|
|
51
5
|
describe("<Message />", () => {
|
|
52
|
-
const
|
|
6
|
+
const t = (e) => i(/* @__PURE__ */ c(m, { ...e }));
|
|
53
7
|
it("should render message text correctly", () => {
|
|
54
|
-
const { getByText:
|
|
8
|
+
const { getByText: e } = t({
|
|
55
9
|
message: "Test message",
|
|
56
|
-
state:
|
|
10
|
+
state: s.info
|
|
57
11
|
});
|
|
58
|
-
expect(
|
|
12
|
+
expect(e("Test message")).toBeInTheDocument();
|
|
59
13
|
}), it("should render success state correctly", () => {
|
|
60
|
-
const { getByText:
|
|
14
|
+
const { getByText: e } = t({
|
|
61
15
|
message: "Success message",
|
|
62
|
-
state:
|
|
16
|
+
state: s.success
|
|
63
17
|
});
|
|
64
|
-
expect(
|
|
18
|
+
expect(e("Success message")).toBeInTheDocument();
|
|
65
19
|
}), it("should render error state correctly", () => {
|
|
66
|
-
const { getByText:
|
|
20
|
+
const { getByText: e } = t({
|
|
67
21
|
message: "Error message",
|
|
68
|
-
state:
|
|
22
|
+
state: s.error
|
|
69
23
|
});
|
|
70
|
-
expect(
|
|
24
|
+
expect(e("Error message")).toBeInTheDocument();
|
|
71
25
|
}), it("should render action button when action prop is provided", () => {
|
|
72
|
-
const
|
|
26
|
+
const e = r.fn(), { getByText: o } = t({
|
|
73
27
|
message: "Message with action",
|
|
74
|
-
state:
|
|
28
|
+
state: s.info,
|
|
75
29
|
action: {
|
|
76
|
-
|
|
77
|
-
onClick:
|
|
30
|
+
label: "Click me",
|
|
31
|
+
onClick: e
|
|
78
32
|
}
|
|
79
|
-
}),
|
|
80
|
-
expect(
|
|
33
|
+
}), n = o("Click me");
|
|
34
|
+
expect(n).toBeInTheDocument(), a.click(n), expect(e).toHaveBeenCalled();
|
|
81
35
|
}), it("should not render action button when action prop is not provided", () => {
|
|
82
|
-
const { container:
|
|
36
|
+
const { container: e } = t({
|
|
83
37
|
message: "Message without action",
|
|
84
|
-
state:
|
|
85
|
-
}),
|
|
86
|
-
expect(
|
|
38
|
+
state: s.info
|
|
39
|
+
}), o = e.querySelector("button");
|
|
40
|
+
expect(o).not.toBeInTheDocument();
|
|
87
41
|
});
|
|
88
42
|
});
|
|
@@ -1,50 +1,4 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import "react/jsx-runtime";
|
|
3
|
-
import "../../constants/index.js";
|
|
4
|
-
import "../Button/styles.js";
|
|
5
|
-
import "../../styled-components.browser.esm-02f500bc.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "../../button-fa1c119c.js";
|
|
8
|
-
import "../../presets-83ccb923.js";
|
|
9
|
-
import "../../isVisible-729780f5.js";
|
|
10
|
-
import "../../index-4003d75b.js";
|
|
11
|
-
import "react-dom";
|
|
12
|
-
import "../../index-e2b72ca8.js";
|
|
13
|
-
import "../../reactNode-f4391605.js";
|
|
14
|
-
import "../../Compact-c39ed20d.js";
|
|
15
|
-
import "../../presetColors-ccf8cb4c.js";
|
|
16
|
-
import "../../compact-item-b8f85aa6.js";
|
|
17
|
-
import "../../AntdIcon-c395a1c4.js";
|
|
18
|
-
import "../../providers/ThemeProvider.js";
|
|
19
|
-
import "../../styles/theme/genesis-theme.js";
|
|
20
|
-
import "../../styles/design-tokens/variables.js";
|
|
21
|
-
import "../Checkbox/styles.js";
|
|
22
|
-
import "../../context-3b8a39af.js";
|
|
23
|
-
import "../ErrorBoundaryFallback/styles.js";
|
|
24
|
-
import "../../ExclamationCircleFilled-23ef9812.js";
|
|
25
|
-
import "../../CloseCircleFilled-ddc51e7e.js";
|
|
26
|
-
import "../../index-89035ea5.js";
|
|
27
|
-
import "../Input/styles.js";
|
|
28
|
-
import "../../TextArea-20825221.js";
|
|
29
|
-
import "../../index-8c8d2d0c.js";
|
|
30
|
-
import "../../useVariants-a0d64298.js";
|
|
31
|
-
import "../../ContextIsolator-b09b2c52.js";
|
|
32
|
-
import "../../pickAttrs-00ba4687.js";
|
|
33
|
-
import "../../SearchOutlined-a9014e08.js";
|
|
34
|
-
import "../Select/styles.js";
|
|
35
|
-
import "../../index-1a33c134.js";
|
|
36
|
-
import "../../Overflow-a570fa69.js";
|
|
37
|
-
import "../../DownOutlined-64a4732a.js";
|
|
38
|
-
import "../../CheckOutlined-52d9ac25.js";
|
|
39
|
-
import "../../CloseOutlined-14b8bba1.js";
|
|
40
|
-
import "../Typography/styles.js";
|
|
41
|
-
import "../../index-501fc13d.js";
|
|
42
|
-
import "../../index-0b9ee239.js";
|
|
43
|
-
import "../Badge/styles.js";
|
|
44
|
-
import "../../InfoCircleFilled-c5f90c20.js";
|
|
45
|
-
import "../Toast/styles.js";
|
|
46
|
-
import "../../collapse-345bc884.js";
|
|
47
|
-
import "./styles.js";
|
|
1
|
+
import { default as o } from "./Message.js";
|
|
48
2
|
export {
|
|
49
|
-
|
|
3
|
+
o as default
|
|
50
4
|
};
|
|
@@ -2,4 +2,7 @@ export declare const MessageRow: import('styled-components/dist/types').IStyledC
|
|
|
2
2
|
state: string;
|
|
3
3
|
size: string;
|
|
4
4
|
}>> & string;
|
|
5
|
-
export declare const MessageContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').
|
|
5
|
+
export declare const MessageContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
6
|
+
size?: string;
|
|
7
|
+
}>> & string;
|
|
8
|
+
export declare const ActionButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { SIZE as
|
|
3
|
-
|
|
4
|
-
const p = a.div`
|
|
1
|
+
import { d as o } from "../../styled-components.browser.esm-CZ1XM4o4.js";
|
|
2
|
+
import { SIZE as n } from "../../constants/index.js";
|
|
3
|
+
const s = o.div`
|
|
5
4
|
display: flex;
|
|
6
5
|
justify-content: space-between;
|
|
7
6
|
align-items: center;
|
|
8
|
-
gap: ${({ theme:
|
|
9
|
-
padding: ${({ theme:
|
|
10
|
-
background-color: ${({ theme:
|
|
11
|
-
width: ${({ theme:
|
|
12
|
-
|
|
7
|
+
gap: ${({ theme: t }) => t.sizing.Size4}px;
|
|
8
|
+
padding: ${({ theme: t }) => t.sizing.Size3}px;
|
|
9
|
+
background-color: ${({ theme: t, state: e }) => t.colors.status[e].surface};
|
|
10
|
+
width: ${({ theme: t, state: e, size: i }) => i === "standard" ? "320px" : "240px"};
|
|
11
|
+
pointer-events: none;
|
|
13
12
|
cursor: default;
|
|
14
|
-
border-radius: ${({ theme:
|
|
15
|
-
`, d =
|
|
13
|
+
border-radius: ${({ theme: t }) => t.borderRadius.BorderRadiusSm}px;
|
|
14
|
+
`, d = o.div`
|
|
16
15
|
display: flex;
|
|
17
16
|
align-items: center;
|
|
18
|
-
gap: ${({ theme:
|
|
17
|
+
gap: ${({ theme: t }) => t.sizing.Size2}px;
|
|
19
18
|
flex: 1;
|
|
20
|
-
max-width: ${({
|
|
19
|
+
max-width: ${({ size: t }) => t === "standard" ? "320px" : "240px"};
|
|
21
20
|
|
|
22
21
|
.ant-typography {
|
|
23
22
|
display: -webkit-box;
|
|
24
|
-
-webkit-line-clamp: 2;
|
|
25
23
|
-webkit-box-orient: vertical;
|
|
26
24
|
overflow: hidden;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
font-family: ${({ theme: t }) => t.typography.fontFamily};
|
|
26
|
+
line-height: ${({ theme: t, size: e }) => e === n.standard ? t.typography.lineHeight : "23px"};
|
|
27
|
+
font-size: ${({ theme: t, size: e }) => e === "standard" ? t.typography.body2 : t.typography.body1};
|
|
30
28
|
}
|
|
29
|
+
`, p = o.button`
|
|
30
|
+
text-decoration: underline;
|
|
31
|
+
border: none;
|
|
32
|
+
background: none;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
pointer-events: all;
|
|
35
|
+
color: ${({ theme: t }) => t.colors.interactive.link.active};
|
|
31
36
|
`;
|
|
32
37
|
export {
|
|
38
|
+
p as ActionButton,
|
|
33
39
|
d as MessageContent,
|
|
34
|
-
|
|
40
|
+
s as MessageRow
|
|
35
41
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { STATE } from '../../constants';
|
|
2
|
-
|
|
1
|
+
import { STATE, SIZE } from '../../constants';
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
export interface NotificationProps {
|
|
4
|
-
state: keyof typeof STATE;
|
|
5
4
|
message: string;
|
|
5
|
+
state?: keyof typeof STATE;
|
|
6
|
+
date?: string | Date;
|
|
6
7
|
action?: {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
label: string;
|
|
9
|
+
onClick: () => void;
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
size
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
onArrowClick?: () => void;
|
|
12
|
+
size?: keyof typeof SIZE;
|
|
13
|
+
isUnread?: boolean;
|
|
14
|
+
hasFormattedDate?: boolean;
|
|
14
15
|
}
|
|
15
|
-
declare const Notification:
|
|
16
|
+
declare const Notification: React.FC<NotificationProps>;
|
|
16
17
|
export default Notification;
|