@redocly/theme 0.64.0-next.2 → 0.64.0-next.3
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/lib/components/Admonition/Admonition.d.ts +1 -1
- package/lib/components/Admonition/Admonition.js +2 -0
- package/lib/components/Admonition/variables.dark.js +3 -0
- package/lib/components/Admonition/variables.js +13 -0
- package/lib/components/Button/variables.dark.js +2 -2
- package/lib/components/Button/variables.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +3 -1
- package/lib/components/Filter/variables.js +1 -1
- package/lib/components/Link/Link.js +2 -2
- package/lib/components/Menu/MenuItem.js +1 -0
- package/lib/components/Menu/variables.dark.js +2 -0
- package/lib/components/Menu/variables.js +4 -3
- package/lib/components/SvgViewer/variables.dark.js +1 -1
- package/lib/components/Switch/variables.dark.js +2 -2
- package/lib/components/Switch/variables.js +1 -1
- package/lib/components/TableOfContent/TableOfContent.js +1 -0
- package/lib/components/TableOfContent/variables.js +3 -2
- package/lib/components/Toast/Toast.d.ts +14 -0
- package/lib/components/Toast/Toast.js +239 -0
- package/lib/components/Toast/variables.d.ts +1 -0
- package/lib/components/Toast/variables.js +64 -0
- package/lib/components/Tooltip/JsTooltip.js +1 -1
- package/lib/core/constants/toast.d.ts +1 -0
- package/lib/core/constants/toast.js +5 -0
- package/lib/core/contexts/Toast/ToastContext.d.ts +2 -0
- package/lib/core/contexts/Toast/ToastContext.js +6 -0
- package/lib/core/contexts/Toast/ToastProvider.d.ts +3 -0
- package/lib/core/contexts/Toast/ToastProvider.js +156 -0
- package/lib/core/contexts/index.d.ts +2 -0
- package/lib/core/contexts/index.js +2 -0
- package/lib/core/hooks/index.d.ts +2 -0
- package/lib/core/hooks/index.js +2 -0
- package/lib/core/hooks/use-toast-logic.d.ts +18 -0
- package/lib/core/hooks/use-toast-logic.js +141 -0
- package/lib/core/hooks/use-toast.d.ts +11 -0
- package/lib/core/hooks/use-toast.js +17 -0
- package/lib/core/styles/dark.js +35 -38
- package/lib/core/styles/global.js +54 -52
- package/lib/core/styles/palette.dark.js +15 -30
- package/lib/core/styles/palette.js +130 -134
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/search.d.ts +1 -0
- package/lib/core/types/toast.d.ts +23 -0
- package/lib/core/types/toast.js +3 -0
- package/lib/core/utils/get-auto-dismiss-duration.d.ts +2 -0
- package/lib/core/utils/get-auto-dismiss-duration.js +15 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/icons/CheckboxIcon/CheckboxIcon.js +6 -4
- package/lib/icons/CheckboxIcon/variables.dark.js +2 -1
- package/lib/icons/CheckboxIcon/variables.js +3 -3
- package/lib/icons/IdeaIcon/IdeaIcon.d.ts +9 -0
- package/lib/icons/IdeaIcon/IdeaIcon.js +24 -0
- package/lib/icons/NewChatIcon/NewChatIcon.d.ts +11 -0
- package/lib/icons/NewChatIcon/NewChatIcon.js +25 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/markdoc/components/Mermaid/Mermaid.js +0 -2
- package/lib/markdoc/components/Tabs/variables.js +3 -3
- package/lib/markdoc/components/default.d.ts +0 -1
- package/lib/markdoc/components/default.js +0 -1
- package/lib/markdoc/tags/admonition.js +1 -1
- package/package.json +2 -2
- package/src/components/Admonition/Admonition.tsx +3 -1
- package/src/components/Admonition/variables.dark.ts +3 -0
- package/src/components/Admonition/variables.ts +13 -0
- package/src/components/Button/variables.dark.ts +2 -2
- package/src/components/Button/variables.ts +3 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +3 -1
- package/src/components/Filter/variables.ts +1 -1
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/Menu/MenuItem.tsx +5 -1
- package/src/components/Menu/variables.dark.ts +2 -0
- package/src/components/Menu/variables.ts +4 -3
- package/src/components/SvgViewer/variables.dark.ts +1 -1
- package/src/components/Switch/variables.dark.ts +2 -2
- package/src/components/Switch/variables.ts +1 -1
- package/src/components/TableOfContent/TableOfContent.tsx +1 -0
- package/src/components/TableOfContent/variables.ts +3 -2
- package/src/components/Toast/Toast.tsx +289 -0
- package/src/components/Toast/variables.ts +61 -0
- package/src/components/Tooltip/JsTooltip.tsx +1 -1
- package/src/core/constants/toast.ts +1 -0
- package/src/core/contexts/Toast/ToastContext.tsx +5 -0
- package/src/core/contexts/Toast/ToastProvider.tsx +206 -0
- package/src/core/contexts/index.ts +2 -0
- package/src/core/hooks/index.ts +2 -0
- package/src/core/hooks/use-toast-logic.ts +203 -0
- package/src/core/hooks/use-toast.ts +47 -0
- package/src/core/styles/dark.ts +5 -8
- package/src/core/styles/global.ts +26 -24
- package/src/core/styles/palette.dark.ts +15 -30
- package/src/core/styles/palette.ts +130 -134
- package/src/core/types/index.ts +1 -0
- package/src/core/types/search.ts +1 -0
- package/src/core/types/toast.ts +28 -0
- package/src/core/utils/get-auto-dismiss-duration.ts +20 -0
- package/src/core/utils/index.ts +1 -0
- package/src/icons/CheckboxIcon/CheckboxIcon.tsx +26 -17
- package/src/icons/CheckboxIcon/variables.dark.ts +2 -1
- package/src/icons/CheckboxIcon/variables.ts +3 -3
- package/src/icons/IdeaIcon/IdeaIcon.tsx +32 -0
- package/src/icons/NewChatIcon/NewChatIcon.tsx +39 -0
- package/src/index.ts +4 -0
- package/src/markdoc/components/Mermaid/Mermaid.tsx +0 -2
- package/src/markdoc/components/Tabs/variables.ts +3 -3
- package/src/markdoc/components/default.ts +0 -1
- package/src/markdoc/tags/admonition.ts +1 -1
- package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.d.ts +0 -7
- package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.js +0 -95
- package/lib/markdoc/components/ExcalidrawDiagram/variables.d.ts +0 -1
- package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.d.ts +0 -1
- package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.js +0 -8
- package/lib/markdoc/components/ExcalidrawDiagram/variables.js +0 -15
- package/src/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.tsx +0 -85
- package/src/markdoc/components/ExcalidrawDiagram/variables.dark.ts +0 -5
- package/src/markdoc/components/ExcalidrawDiagram/variables.ts +0 -12
|
@@ -2,169 +2,165 @@ import { css, type FlattenSimpleInterpolation } from 'styled-components';
|
|
|
2
2
|
|
|
3
3
|
function brandPaletteLight(palette: string | undefined): FlattenSimpleInterpolation {
|
|
4
4
|
switch (palette) {
|
|
5
|
-
case 'default':
|
|
6
|
-
return css`
|
|
7
|
-
--color-brand-1: var(--color-blueberry-1);
|
|
8
|
-
--color-brand-2: var(--color-blueberry-2);
|
|
9
|
-
--color-brand-3: var(--color-blueberry-3);
|
|
10
|
-
--color-brand-4: var(--color-blueberry-4);
|
|
11
|
-
--color-brand-5: var(--color-blueberry-5);
|
|
12
|
-
--color-brand-6: var(--color-blueberry-6);
|
|
13
|
-
--color-brand-7: var(--color-blueberry-7);
|
|
14
|
-
--color-brand-8: var(--color-blueberry-8);
|
|
15
|
-
--color-brand-9: var(--color-blueberry-9);
|
|
16
|
-
--color-brand-10: var(--color-blueberry-10);
|
|
17
|
-
--color-brand-11: var(--color-blueberry-11);
|
|
18
|
-
`;
|
|
19
5
|
case 'slate':
|
|
20
6
|
return css`
|
|
21
|
-
--color-brand-1: #ededf2;
|
|
22
|
-
--color-brand-2: #dcdde5;
|
|
23
|
-
--color-brand-3: #c4c6d1;
|
|
24
|
-
--color-brand-4: #9b9ca8;
|
|
25
|
-
--color-brand-5: #6e6f7a;
|
|
26
|
-
--color-brand-6: #1a1c21;
|
|
27
|
-
--color-brand-7: #22242b;
|
|
28
|
-
--color-brand-8: #2a2b33;
|
|
29
|
-
--color-brand-9: #3b3c45;
|
|
30
|
-
--color-brand-10: #555761;
|
|
31
|
-
--color-brand-11: #6e6f7a;
|
|
32
|
-
--text-color-on-color: #ffffff;
|
|
7
|
+
--color-brand-1: #ededf2; // @presenter Color
|
|
8
|
+
--color-brand-2: #dcdde5; // @presenter Color
|
|
9
|
+
--color-brand-3: #c4c6d1; // @presenter Color
|
|
10
|
+
--color-brand-4: #9b9ca8; // @presenter Color
|
|
11
|
+
--color-brand-5: #6e6f7a; // @presenter Color
|
|
12
|
+
--color-brand-6: #1a1c21; // @presenter Color
|
|
13
|
+
--color-brand-7: #22242b; // @presenter Color
|
|
14
|
+
--color-brand-8: #2a2b33; // @presenter Color
|
|
15
|
+
--color-brand-9: #3b3c45; // @presenter Color
|
|
16
|
+
--color-brand-10: #555761; // @presenter Color
|
|
17
|
+
--color-brand-11: #6e6f7a; // @presenter Color
|
|
18
|
+
--text-color-on-color: #ffffff; // @presenter Color
|
|
33
19
|
`;
|
|
34
20
|
case 'pink':
|
|
35
21
|
return css`
|
|
36
|
-
--color-brand-1: #ffe8f7;
|
|
37
|
-
--color-brand-2: #f7bfe2;
|
|
38
|
-
--color-brand-3: #ef99cf;
|
|
39
|
-
--color-brand-4: #e677bd;
|
|
40
|
-
--color-brand-5: #de59ad;
|
|
41
|
-
--color-brand-6: #d6409f;
|
|
42
|
-
--color-brand-7: #bb3d8d;
|
|
43
|
-
--color-brand-8: #a03a7b;
|
|
44
|
-
--color-brand-9: #853668;
|
|
45
|
-
--color-brand-10: #6a3055;
|
|
46
|
-
--color-brand-11: #4f2841;
|
|
47
|
-
--text-color-on-color: #ffffff;
|
|
22
|
+
--color-brand-1: #ffe8f7; // @presenter Color
|
|
23
|
+
--color-brand-2: #f7bfe2; // @presenter Color
|
|
24
|
+
--color-brand-3: #ef99cf; // @presenter Color
|
|
25
|
+
--color-brand-4: #e677bd; // @presenter Color
|
|
26
|
+
--color-brand-5: #de59ad; // @presenter Color
|
|
27
|
+
--color-brand-6: #d6409f; // @presenter Color
|
|
28
|
+
--color-brand-7: #bb3d8d; // @presenter Color
|
|
29
|
+
--color-brand-8: #a03a7b; // @presenter Color
|
|
30
|
+
--color-brand-9: #853668; // @presenter Color
|
|
31
|
+
--color-brand-10: #6a3055; // @presenter Color
|
|
32
|
+
--color-brand-11: #4f2841; // @presenter Color
|
|
33
|
+
--text-color-on-color: #ffffff; // @presenter Color
|
|
48
34
|
`;
|
|
49
35
|
case 'coral':
|
|
50
36
|
return css`
|
|
51
|
-
--color-brand-1: #ffe8ea;
|
|
52
|
-
--color-brand-2: #fac5c9;
|
|
53
|
-
--color-brand-3: #f5a3aa;
|
|
54
|
-
--color-brand-4: #ef858d;
|
|
55
|
-
--color-brand-5: #ea6a75;
|
|
56
|
-
--color-brand-6: #e5535f;
|
|
57
|
-
--color-brand-7: #c74b55;
|
|
58
|
-
--color-brand-8: #a9434c;
|
|
59
|
-
--color-brand-9: #8b3c42;
|
|
60
|
-
--color-brand-10: #6d3338;
|
|
61
|
-
--color-brand-11: #4f282b;
|
|
62
|
-
--text-color-on-color: #ffffff;
|
|
37
|
+
--color-brand-1: #ffe8ea; // @presenter Color
|
|
38
|
+
--color-brand-2: #fac5c9; // @presenter Color
|
|
39
|
+
--color-brand-3: #f5a3aa; // @presenter Color
|
|
40
|
+
--color-brand-4: #ef858d; // @presenter Color
|
|
41
|
+
--color-brand-5: #ea6a75; // @presenter Color
|
|
42
|
+
--color-brand-6: #e5535f; // @presenter Color
|
|
43
|
+
--color-brand-7: #c74b55; // @presenter Color
|
|
44
|
+
--color-brand-8: #a9434c; // @presenter Color
|
|
45
|
+
--color-brand-9: #8b3c42; // @presenter Color
|
|
46
|
+
--color-brand-10: #6d3338; // @presenter Color
|
|
47
|
+
--color-brand-11: #4f282b; // @presenter Color
|
|
48
|
+
--text-color-on-color: #ffffff; // @presenter Color
|
|
63
49
|
`;
|
|
64
50
|
case 'amber':
|
|
65
51
|
return css`
|
|
66
|
-
--color-brand-1: #fff4e8;
|
|
67
|
-
--color-brand-2: #feddba;
|
|
68
|
-
--color-brand-3: #fdc78c;
|
|
69
|
-
--color-brand-4: #fcb261;
|
|
70
|
-
--color-brand-5: #fb9f3a;
|
|
71
|
-
--color-brand-6: #fa8d15;
|
|
72
|
-
--color-brand-7: #d88121;
|
|
73
|
-
--color-brand-8: #b6732a;
|
|
74
|
-
--color-brand-9: #93632f;
|
|
75
|
-
--color-brand-10: #71512e;
|
|
76
|
-
--color-brand-11: #4f3c28;
|
|
77
|
-
--text-color-on-color: #ffffff;
|
|
52
|
+
--color-brand-1: #fff4e8; // @presenter Color
|
|
53
|
+
--color-brand-2: #feddba; // @presenter Color
|
|
54
|
+
--color-brand-3: #fdc78c; // @presenter Color
|
|
55
|
+
--color-brand-4: #fcb261; // @presenter Color
|
|
56
|
+
--color-brand-5: #fb9f3a; // @presenter Color
|
|
57
|
+
--color-brand-6: #fa8d15; // @presenter Color
|
|
58
|
+
--color-brand-7: #d88121; // @presenter Color
|
|
59
|
+
--color-brand-8: #b6732a; // @presenter Color
|
|
60
|
+
--color-brand-9: #93632f; // @presenter Color
|
|
61
|
+
--color-brand-10: #71512e; // @presenter Color
|
|
62
|
+
--color-brand-11: #4f3c28; // @presenter Color
|
|
63
|
+
--text-color-on-color: #ffffff; // @presenter Color
|
|
78
64
|
`;
|
|
79
65
|
case 'jade':
|
|
80
66
|
return css`
|
|
81
|
-
--color-brand-1: #e8fff9;
|
|
82
|
-
--color-brand-2: #b5edde;
|
|
83
|
-
--color-brand-3: #88dac4;
|
|
84
|
-
--color-brand-4: #61c8ad;
|
|
85
|
-
--color-brand-5: #42b597;
|
|
86
|
-
--color-brand-6: #29a383;
|
|
87
|
-
--color-brand-7: #2a9277;
|
|
88
|
-
--color-brand-8: #2b816b;
|
|
89
|
-
--color-brand-9: #2b715e;
|
|
90
|
-
--color-brand-10: #2a6052;
|
|
91
|
-
--color-brand-11: #284f45;
|
|
92
|
-
--text-color-on-color: #ffffff;
|
|
67
|
+
--color-brand-1: #e8fff9; // @presenter Color
|
|
68
|
+
--color-brand-2: #b5edde; // @presenter Color
|
|
69
|
+
--color-brand-3: #88dac4; // @presenter Color
|
|
70
|
+
--color-brand-4: #61c8ad; // @presenter Color
|
|
71
|
+
--color-brand-5: #42b597; // @presenter Color
|
|
72
|
+
--color-brand-6: #29a383; // @presenter Color
|
|
73
|
+
--color-brand-7: #2a9277; // @presenter Color
|
|
74
|
+
--color-brand-8: #2b816b; // @presenter Color
|
|
75
|
+
--color-brand-9: #2b715e; // @presenter Color
|
|
76
|
+
--color-brand-10: #2a6052; // @presenter Color
|
|
77
|
+
--color-brand-11: #284f45; // @presenter Color
|
|
78
|
+
--text-color-on-color: #ffffff; // @presenter Color
|
|
93
79
|
`;
|
|
94
80
|
case 'cyan':
|
|
95
81
|
return css`
|
|
96
|
-
--color-brand-1: #e8fbff;
|
|
97
|
-
--color-brand-2: #aee7f4;
|
|
98
|
-
--color-brand-3: #79d4e9;
|
|
99
|
-
--color-brand-4: #4ac2dd;
|
|
100
|
-
--color-brand-5: #22b2d2;
|
|
101
|
-
--color-brand-6: #00a2c7;
|
|
102
|
-
--color-brand-7: #0f91af;
|
|
103
|
-
--color-brand-8: #1b8097;
|
|
104
|
-
--color-brand-9: #246e7f;
|
|
105
|
-
--color-brand-10: #285c67;
|
|
106
|
-
--color-brand-11: #28484f;
|
|
107
|
-
--text-color-on-color: #ffffff;
|
|
82
|
+
--color-brand-1: #e8fbff; // @presenter Color
|
|
83
|
+
--color-brand-2: #aee7f4; // @presenter Color
|
|
84
|
+
--color-brand-3: #79d4e9; // @presenter Color
|
|
85
|
+
--color-brand-4: #4ac2dd; // @presenter Color
|
|
86
|
+
--color-brand-5: #22b2d2; // @presenter Color
|
|
87
|
+
--color-brand-6: #00a2c7; // @presenter Color
|
|
88
|
+
--color-brand-7: #0f91af; // @presenter Color
|
|
89
|
+
--color-brand-8: #1b8097; // @presenter Color
|
|
90
|
+
--color-brand-9: #246e7f; // @presenter Color
|
|
91
|
+
--color-brand-10: #285c67; // @presenter Color
|
|
92
|
+
--color-brand-11: #28484f; // @presenter Color
|
|
93
|
+
--text-color-on-color: #ffffff; // @presenter Color
|
|
108
94
|
`;
|
|
109
95
|
case 'ocean':
|
|
110
96
|
return css`
|
|
111
|
-
--color-brand-1: #e8f5ff;
|
|
112
|
-
--color-brand-2: #b6dfff;
|
|
113
|
-
--color-brand-3: #85caff;
|
|
114
|
-
--color-brand-4: #56b5ff;
|
|
115
|
-
--color-brand-5: #29a2ff;
|
|
116
|
-
--color-brand-6: #0090ff;
|
|
117
|
-
--color-brand-7: #1384dc;
|
|
118
|
-
--color-brand-8: #2277b9;
|
|
119
|
-
--color-brand-9: #2a6795;
|
|
120
|
-
--color-brand-10: #2d5472;
|
|
121
|
-
--color-brand-11: #283e4f;
|
|
122
|
-
--text-color-on-color: #ffffff;
|
|
97
|
+
--color-brand-1: #e8f5ff; // @presenter Color
|
|
98
|
+
--color-brand-2: #b6dfff; // @presenter Color
|
|
99
|
+
--color-brand-3: #85caff; // @presenter Color
|
|
100
|
+
--color-brand-4: #56b5ff; // @presenter Color
|
|
101
|
+
--color-brand-5: #29a2ff; // @presenter Color
|
|
102
|
+
--color-brand-6: #0090ff; // @presenter Color
|
|
103
|
+
--color-brand-7: #1384dc; // @presenter Color
|
|
104
|
+
--color-brand-8: #2277b9; // @presenter Color
|
|
105
|
+
--color-brand-9: #2a6795; // @presenter Color
|
|
106
|
+
--color-brand-10: #2d5472; // @presenter Color
|
|
107
|
+
--color-brand-11: #283e4f; // @presenter Color
|
|
108
|
+
--text-color-on-color: #ffffff; // @presenter Color
|
|
123
109
|
`;
|
|
124
110
|
case 'indigo':
|
|
125
111
|
return css`
|
|
126
|
-
--color-brand-1: #e8edff;
|
|
127
|
-
--color-brand-2: #b5d7ff;
|
|
128
|
-
--color-brand-3: #99aef1;
|
|
129
|
-
--color-brand-4: #7691eb;
|
|
130
|
-
--color-brand-5: #5879e4;
|
|
131
|
-
--color-brand-6: #3e63dd;
|
|
132
|
-
--color-brand-7: #3c5bc1;
|
|
133
|
-
--color-brand-8: #3952a4;
|
|
134
|
-
--color-brand-9: #364988;
|
|
135
|
-
--color-brand-10: #303e6b;
|
|
136
|
-
--color-brand-11: #28314f;
|
|
137
|
-
--text-color-on-color: #ffffff;
|
|
112
|
+
--color-brand-1: #e8edff; // @presenter Color
|
|
113
|
+
--color-brand-2: #b5d7ff; // @presenter Color
|
|
114
|
+
--color-brand-3: #99aef1; // @presenter Color
|
|
115
|
+
--color-brand-4: #7691eb; // @presenter Color
|
|
116
|
+
--color-brand-5: #5879e4; // @presenter Color
|
|
117
|
+
--color-brand-6: #3e63dd; // @presenter Color
|
|
118
|
+
--color-brand-7: #3c5bc1; // @presenter Color
|
|
119
|
+
--color-brand-8: #3952a4; // @presenter Color
|
|
120
|
+
--color-brand-9: #364988; // @presenter Color
|
|
121
|
+
--color-brand-10: #303e6b; // @presenter Color
|
|
122
|
+
--color-brand-11: #28314f; // @presenter Color
|
|
123
|
+
--text-color-on-color: #ffffff; // @presenter Color
|
|
138
124
|
`;
|
|
139
125
|
case 'iris':
|
|
140
126
|
return css`
|
|
141
|
-
--color-brand-1: #ebebff;
|
|
142
|
-
--color-brand-2: #c8c8f7;
|
|
143
|
-
--color-brand-3: #a7a7ef;
|
|
144
|
-
--color-brand-4: #8a8ae6;
|
|
145
|
-
--color-brand-5: #7070de;
|
|
146
|
-
--color-brand-6: #5b5bd6;
|
|
147
|
-
--color-brand-7: #5353bb;
|
|
148
|
-
--color-brand-8: #4c4ca0;
|
|
149
|
-
--color-brand-9: #434385;
|
|
150
|
-
--color-brand-10: #3a3a6a;
|
|
151
|
-
--color-brand-11: #2e2e4f;
|
|
152
|
-
--text-color-on-color: #ffffff;
|
|
127
|
+
--color-brand-1: #ebebff; // @presenter Color
|
|
128
|
+
--color-brand-2: #c8c8f7; // @presenter Color
|
|
129
|
+
--color-brand-3: #a7a7ef; // @presenter Color
|
|
130
|
+
--color-brand-4: #8a8ae6; // @presenter Color
|
|
131
|
+
--color-brand-5: #7070de; // @presenter Color
|
|
132
|
+
--color-brand-6: #5b5bd6; // @presenter Color
|
|
133
|
+
--color-brand-7: #5353bb; // @presenter Color
|
|
134
|
+
--color-brand-8: #4c4ca0; // @presenter Color
|
|
135
|
+
--color-brand-9: #434385; // @presenter Color
|
|
136
|
+
--color-brand-10: #3a3a6a; // @presenter Color
|
|
137
|
+
--color-brand-11: #2e2e4f; // @presenter Color
|
|
138
|
+
--text-color-on-color: #ffffff; // @presenter Color
|
|
153
139
|
`;
|
|
154
140
|
default:
|
|
155
141
|
return css`
|
|
156
|
-
--color-
|
|
157
|
-
--color-
|
|
158
|
-
--color-
|
|
159
|
-
|
|
160
|
-
--color-
|
|
161
|
-
--color-
|
|
162
|
-
|
|
163
|
-
--color-
|
|
164
|
-
--color-
|
|
165
|
-
|
|
166
|
-
--color-
|
|
167
|
-
|
|
142
|
+
--button-bg-color-primary-legacy: var(--color-blue-6); // @presenter Color
|
|
143
|
+
--button-bg-color-primary-hover-legacy: var(--color-blue-7); // @presenter Color
|
|
144
|
+
--button-bg-color-primary-pressed-legacy: var(--color-blue-8); // @presenter Color
|
|
145
|
+
|
|
146
|
+
--toc-item-text-color-active-legacy: var(--text-color-primary); // @presenter Color
|
|
147
|
+
--toc-item-border-color-active-legacy: var(--border-color-invers); // @presenter Color
|
|
148
|
+
|
|
149
|
+
--checkbox-border-color-legacy: var(--border-color-primary); // @presenter Color
|
|
150
|
+
--checkbox-box-color-active-legacy: var(--color-warm-grey-10); // @presenter Color
|
|
151
|
+
|
|
152
|
+
--switch-bg-color-selected-legacy: var(--color-warm-grey-9); // @presenter Color
|
|
153
|
+
|
|
154
|
+
--md-tabs-active-tab-bg-color-legacy: var(--bg-color-active); // @presenter Color
|
|
155
|
+
--md-tabs-active-tab-text-color-legacy: var(--text-color-primary); // @presenter Color
|
|
156
|
+
--md-tabs-active-tab-border-color-legacy: var(--text-color-primary); // @presenter Color
|
|
157
|
+
|
|
158
|
+
--admonition-default-bg-color-legacy: var(--color-warm-grey-2); // @presenter Color
|
|
159
|
+
--admonition-default-icon-color-legacy: var(--color-warm-grey-11); // @presenter Color
|
|
160
|
+
--admonition-default-border-color-legacy: var(--color-warm-grey-4); // @presenter Color
|
|
161
|
+
|
|
162
|
+
--menu-item-bg-color-active-legacy: var(--tree-bg-color-active); // @presenter Color
|
|
163
|
+
--menu-item-color-active-legacy: var(--tree-content-color-default); // @presenter Color
|
|
168
164
|
`;
|
|
169
165
|
}
|
|
170
166
|
}
|
package/src/core/types/index.ts
CHANGED
package/src/core/types/search.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ToastType = 'info' | 'success' | 'warning' | 'error' | 'loading';
|
|
4
|
+
|
|
5
|
+
export interface ToastOptions {
|
|
6
|
+
type?: ToastType;
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
duration?: number;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ToastItem extends ToastOptions {
|
|
14
|
+
id: string;
|
|
15
|
+
type: ToastType;
|
|
16
|
+
isExiting: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ToastContextValue {
|
|
20
|
+
showToast: (options: ToastOptions) => string;
|
|
21
|
+
dismissToast: (id: string) => void;
|
|
22
|
+
updateToast: (id: string, updates: Partial<ToastOptions>) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ToastProviderProps {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
mountId?: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ToastType } from '../types/toast';
|
|
2
|
+
|
|
3
|
+
const SIMPLE_TOAST_DURATION_MS = 2500;
|
|
4
|
+
const DETAILED_TOAST_DURATION_MS = 4000;
|
|
5
|
+
|
|
6
|
+
export function getAutoDismissDuration(
|
|
7
|
+
hasDetails: boolean,
|
|
8
|
+
type: ToastType,
|
|
9
|
+
duration?: number,
|
|
10
|
+
): number | null {
|
|
11
|
+
if (duration !== undefined) {
|
|
12
|
+
return duration;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (type === 'loading') {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return hasDetails ? DETAILED_TOAST_DURATION_MS : SIMPLE_TOAST_DURATION_MS;
|
|
20
|
+
}
|
package/src/core/utils/index.ts
CHANGED
|
@@ -13,37 +13,46 @@ const Icon = ({
|
|
|
13
13
|
<span className={className} onClick={onClick}>
|
|
14
14
|
{checked ? (
|
|
15
15
|
<svg
|
|
16
|
-
width="
|
|
17
|
-
height="
|
|
18
|
-
viewBox="0 0
|
|
16
|
+
width="14"
|
|
17
|
+
height="14"
|
|
18
|
+
viewBox="0 0 14 14"
|
|
19
19
|
fill="none"
|
|
20
20
|
xmlns="http://www.w3.org/2000/svg"
|
|
21
21
|
>
|
|
22
22
|
<path
|
|
23
|
-
d="M0 4C0 1.79086 1.79086 0 4
|
|
23
|
+
d="M0 4C0 1.79086 1.79086 0 4 0H10C12.2091 0 14 1.79086 14 4V10C14 12.2091 12.2091 14 10 14H4C1.79086 14 0 12.2091 0 10V4Z"
|
|
24
|
+
fill="var(--checkbox-content-color-inverse)"
|
|
25
|
+
/>
|
|
26
|
+
<path
|
|
27
|
+
fillRule="evenodd"
|
|
28
|
+
clipRule="evenodd"
|
|
29
|
+
d="M10 1H4C2.34315 1 1 2.34315 1 4V10C1 11.6569 2.34315 13 4 13H10C11.6569 13 13 11.6569 13 10V4C13 2.34315 11.6569 1 10 1ZM4 0C1.79086 0 0 1.79086 0 4V10C0 12.2091 1.79086 14 4 14H10C12.2091 14 14 12.2091 14 10V4C14 1.79086 12.2091 0 10 0H4Z"
|
|
24
30
|
fill="var(--checkbox-box-color-active)"
|
|
25
31
|
/>
|
|
26
32
|
<path
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
fillRule="evenodd"
|
|
34
|
+
clipRule="evenodd"
|
|
35
|
+
d="M6.36018 9.98574L10.9106 4.21938C11.0343 4.06448 10.9203 3.83984 10.7272 3.83984H10.0758C9.93597 3.83984 9.80268 3.90389 9.71608 4.01474L9.03424 4.8785L5.99975 8.72257L4.28308 6.54742C4.24025 6.49305 4.18567 6.44909 4.12342 6.41883C4.06118 6.38858 3.99269 6.37282 3.92348 6.37273H3.27208C3.07619 6.37273 2.96673 6.59854 3.08778 6.75208L5.64029 9.98581C5.82388 10.2182 6.17616 10.2168 6.36018 9.98574Z"
|
|
36
|
+
fill="var(--checkbox-box-color-active)"
|
|
30
37
|
/>
|
|
31
38
|
</svg>
|
|
32
39
|
) : (
|
|
33
40
|
<svg
|
|
34
|
-
width="
|
|
35
|
-
height="
|
|
36
|
-
viewBox="0 0
|
|
41
|
+
width="14"
|
|
42
|
+
height="14"
|
|
43
|
+
viewBox="0 0 14 14"
|
|
37
44
|
fill="var(--checkbox-box-color)"
|
|
38
45
|
xmlns="http://www.w3.org/2000/svg"
|
|
39
46
|
>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
<path
|
|
48
|
+
d="M0 4C0 1.79086 1.79086 0 4 0H10C12.2091 0 14 1.79086 14 4V10C14 12.2091 12.2091 14 10 14H4C1.79086 14 0 12.2091 0 10V4Z"
|
|
49
|
+
fill="var(--checkbox-content-color-inverse)"
|
|
50
|
+
/>
|
|
51
|
+
<path
|
|
52
|
+
fillRule="evenodd"
|
|
53
|
+
clipRule="evenodd"
|
|
54
|
+
d="M10 1H4C2.34315 1 1 2.34315 1 4V10C1 11.6569 2.34315 13 4 13H10C11.6569 13 13 11.6569 13 10V4C13 2.34315 11.6569 1 10 1ZM4 0C1.79086 0 0 1.79086 0 4V10C0 12.2091 1.79086 14 4 14H10C12.2091 14 14 12.2091 14 10V4C14 1.79086 12.2091 0 10 0H4Z"
|
|
55
|
+
fill="var(--checkbox-border-color)"
|
|
47
56
|
/>
|
|
48
57
|
</svg>
|
|
49
58
|
)}
|
|
@@ -3,5 +3,6 @@ import { css } from 'styled-components';
|
|
|
3
3
|
export const checkboxDarkMode = css`
|
|
4
4
|
--checkbox-box-color-disabled: var(--color-warm-grey-3);
|
|
5
5
|
--checkbox-border-color-disabled: var(--border-color-primary);
|
|
6
|
-
--checkbox-content-color-inverse:
|
|
6
|
+
--checkbox-content-color-inverse: transparent;
|
|
7
|
+
--checkbox-border-color: var(--color-brand-subtle-border, var(--checkbox-border-color-legacy));
|
|
7
8
|
`;
|
|
@@ -7,13 +7,13 @@ export const checkbox = css`
|
|
|
7
7
|
--checkbox-content-color-disabled: var(--text-color-disabled);
|
|
8
8
|
|
|
9
9
|
--checkbox-box-color: transparent;
|
|
10
|
-
--checkbox-box-color-active: var(--color-
|
|
10
|
+
--checkbox-box-color-active: var(--color-primary-base, var(--checkbox-box-color-active-legacy));
|
|
11
11
|
--checkbox-box-color-focused: var(--color-warm-grey-9);
|
|
12
12
|
--checkbox-box-color-disabled: var(--color-warm-grey-1);
|
|
13
13
|
|
|
14
|
-
--checkbox-border-color: var(--border-color-
|
|
14
|
+
--checkbox-border-color: var(--color-primary-border, var(--checkbox-border-color-legacy));
|
|
15
15
|
--checkbox-border-color-active: var(--color-warm-grey-8);
|
|
16
16
|
--checkbox-border-color-disabled: var(--border-color-secondary);
|
|
17
17
|
|
|
18
|
-
--checkbox-content-color-inverse:
|
|
18
|
+
--checkbox-content-color-inverse: transparent;
|
|
19
19
|
`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
width="12"
|
|
12
|
+
height="16"
|
|
13
|
+
viewBox="0 0 12 16"
|
|
14
|
+
fill="none"
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
<path d="M8.44309 12.375H2.81809V13.5H8.44309V12.375Z" />
|
|
18
|
+
<path d="M7.31809 14.625H3.94309V15.75H7.31809V14.625Z" />
|
|
19
|
+
<path d="M5.63059 0C4.13874 0 2.708 0.592632 1.65311 1.64752C0.59822 2.70242 0.00558778 4.13316 0.00558778 5.625C-0.0324517 6.4425 0.124148 7.25735 0.462504 8.00252C0.80086 8.74768 1.3113 9.40187 1.95184 9.91125C2.51434 10.4344 2.81809 10.7325 2.81809 11.25H3.94309C3.94309 10.215 3.31871 9.63562 2.71121 9.07875C2.18548 8.67615 1.76648 8.15078 1.49091 7.54866C1.21535 6.94654 1.09163 6.28603 1.13059 5.625C1.13059 4.43153 1.60469 3.28693 2.44861 2.44302C3.29252 1.59911 4.43711 1.125 5.63059 1.125C6.82406 1.125 7.96865 1.59911 8.81257 2.44302C9.65648 3.28693 10.1306 4.43153 10.1306 5.625C10.1689 6.28652 10.0443 6.94734 9.76775 7.5495C9.49119 8.15166 9.0711 8.67676 8.54434 9.07875C7.94246 9.64125 7.31809 10.2037 7.31809 11.25H8.44309C8.44309 10.7325 8.74121 10.4344 9.30934 9.90563C9.94943 9.39711 10.4596 8.74389 10.798 7.99971C11.1364 7.25552 11.2932 6.44163 11.2556 5.625C11.2556 4.88631 11.1101 4.15486 10.8274 3.47241C10.5447 2.78995 10.1304 2.16985 9.60806 1.64752C9.08573 1.12519 8.46564 0.71086 7.78318 0.428178C7.10073 0.145495 6.36927 0 5.63059 0Z" />
|
|
20
|
+
</svg>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const IdeaIcon = styled(Icon).attrs(() => ({
|
|
24
|
+
'data-component-name': 'icons/IdeaIcon/IdeaIcon',
|
|
25
|
+
}))<IconProps>`
|
|
26
|
+
path {
|
|
27
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
height: ${({ size }) => size || '16px'};
|
|
31
|
+
width: ${({ size }) => size || '16px'};
|
|
32
|
+
`;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
function Icon(props: IconProps) {
|
|
9
|
+
return (
|
|
10
|
+
<svg
|
|
11
|
+
width="14"
|
|
12
|
+
height="14"
|
|
13
|
+
viewBox="0 0 14 14"
|
|
14
|
+
fill="none"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
{...props}
|
|
17
|
+
>
|
|
18
|
+
<path
|
|
19
|
+
fill="currentColor"
|
|
20
|
+
d="M11.375 11.375H2.625V2.625H7V1.75H2.625C2.39301 1.75023 2.17058 1.84249 2.00654 2.00654C1.84249 2.17058 1.75023 2.39301 1.75 2.625V11.375C1.75023 11.607 1.84249 11.8294 2.00654 11.9935C2.17058 12.1575 2.39301 12.2498 2.625 12.25H11.375C11.607 12.2498 11.8294 12.1575 11.9935 11.9935C12.1575 11.8294 12.2498 11.607 12.25 11.375V7H11.375V11.375Z"
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
fill="currentColor"
|
|
24
|
+
d="M11.375 2.625V0.875H10.5V2.625H8.75V3.5H10.5V5.25H11.375V3.5H13.125V2.625H11.375Z"
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const NewChatIcon = styled(Icon).attrs(() => ({
|
|
31
|
+
'data-component-name': 'icons/NewChatIcon/NewChatIcon',
|
|
32
|
+
}))<IconProps>`
|
|
33
|
+
path {
|
|
34
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
height: ${({ size = '14px' }) => size};
|
|
38
|
+
width: ${({ size = '14px' }) => size};
|
|
39
|
+
`;
|
package/src/index.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from '@redocly/theme/components/Loaders/Loading';
|
|
|
19
19
|
export * from '@redocly/theme/components/LoadMore/LoadMore';
|
|
20
20
|
export * from '@redocly/theme/components/Link/Link';
|
|
21
21
|
export * from '@redocly/theme/components/Portal/Portal';
|
|
22
|
+
export * from '@redocly/theme/components/Toast/Toast';
|
|
23
|
+
export * from '@redocly/theme/core/contexts/Toast/ToastProvider';
|
|
22
24
|
export * from '@redocly/theme/components/Segmented/Segmented';
|
|
23
25
|
export * from '@redocly/theme/components/LanguagePicker/LanguagePicker';
|
|
24
26
|
export * from '@redocly/theme/components/Tooltip/Tooltip';
|
|
@@ -298,6 +300,8 @@ export * from '@redocly/theme/icons/ShareIcon/ShareIcon';
|
|
|
298
300
|
export * from '@redocly/theme/icons/HashtagIcon/HashtagIcon';
|
|
299
301
|
export * from '@redocly/theme/icons/FitToViewIcon/FitToViewIcon';
|
|
300
302
|
export * from '@redocly/theme/icons/ColorPaletteIcon/ColorPaletteIcon';
|
|
303
|
+
export * from '@redocly/theme/icons/IdeaIcon/IdeaIcon';
|
|
304
|
+
export * from '@redocly/theme/icons/NewChatIcon/NewChatIcon';
|
|
301
305
|
/* Layouts */
|
|
302
306
|
export * from '@redocly/theme/layouts/RootLayout';
|
|
303
307
|
export * from '@redocly/theme/layouts/PageLayout';
|
|
@@ -52,11 +52,11 @@ export const markdownTabs = css`
|
|
|
52
52
|
--md-tabs-small-tab-line-height: var(--line-height-base); // @presenter LineHeight
|
|
53
53
|
--md-tabs-small-tab-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
54
54
|
|
|
55
|
-
--md-tabs-active-tab-text-color: var(--text-color-
|
|
55
|
+
--md-tabs-active-tab-text-color: var(--color-primary-text, var(--md-tabs-active-tab-text-color-legacy)); // @presenter Color
|
|
56
56
|
--md-tabs-active-tab-font-family: var(--md-tabs-tab-font-family); // @presenter FontFamily
|
|
57
57
|
--md-tabs-active-tab-font-style: normal; // @presenter FontStyle
|
|
58
|
-
--md-tabs-active-tab-bg-color: var(--bg-color-
|
|
59
|
-
--md-tabs-active-tab-border-color: var(--
|
|
58
|
+
--md-tabs-active-tab-bg-color: var(--color-primary-bg, var(--md-tabs-active-tab-bg-color-legacy)); // @presenter Color
|
|
59
|
+
--md-tabs-active-tab-border-color: var(--color-primary-active, var(--md-tabs-active-tab-border-color-legacy)); // @presenter Color
|
|
60
60
|
|
|
61
61
|
--md-tabs-medium-active-tab-font-size: var(--md-tabs-medium-tab-font-size); // @presenter FontSize
|
|
62
62
|
--md-tabs-medium-active-tab-font-weight: var(--md-tabs-medium-tab-font-weight); // @presenter FontWeight
|
|
@@ -3,7 +3,6 @@ export * from '@redocly/theme/markdoc/components/InlineSvg/InlineSvg';
|
|
|
3
3
|
export * from '@redocly/theme/markdoc/components/MarkdocExample/MarkdocExample';
|
|
4
4
|
export * from '@redocly/theme/markdoc/components/Heading/Heading';
|
|
5
5
|
export * from '@redocly/theme/markdoc/components/Mermaid/Mermaid';
|
|
6
|
-
export * from '@redocly/theme/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram';
|
|
7
6
|
export * from '@redocly/theme/markdoc/components/HtmlBlock/HtmlBlock';
|
|
8
7
|
export * from '@redocly/theme/markdoc/components/Tabs/Tab';
|
|
9
8
|
export * from '@redocly/theme/markdoc/components/Tabs/TabList';
|