@kuroson/cse-common-website 0.1.0
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/LICENSE +21 -0
- package/README.md +79 -0
- package/dist/index.cjs +402 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +48 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +395 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1326 -0
- package/package.json +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Alvin Cherk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# @kuroson/cse-common-website
|
|
2
|
+
|
|
3
|
+
Common website React components for UNSW CSE courses.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @kuroson/cse-common-website
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @kuroson/cse-common-website
|
|
11
|
+
# or
|
|
12
|
+
yarn add @kuroson/cse-common-website
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- Node.js >= 22
|
|
18
|
+
- React >= 19.0.0
|
|
19
|
+
- Tailwind CSS >= 4.0.0
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
First, import the compiled CSS file in your application:
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import "@kuroson/cse-common-website/styles.css";
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Then use the components:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { Admonition } from "@kuroson/cse-common-website";
|
|
33
|
+
|
|
34
|
+
function App() {
|
|
35
|
+
return (
|
|
36
|
+
<Admonition type="info" title="Note">
|
|
37
|
+
This is an informational admonition.
|
|
38
|
+
</Admonition>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### CSS Import Options
|
|
44
|
+
|
|
45
|
+
You can import the CSS in several ways:
|
|
46
|
+
|
|
47
|
+
**In your main entry file:**
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import "@kuroson/cse-common-website/styles.css";
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**In your CSS/SCSS file:**
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
@import "@kuroson/cse-common-website/styles.css";
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**In HTML (if using a bundler that supports it):**
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<link rel="stylesheet" href="@kuroson/cse-common-website/styles.css" />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Components
|
|
66
|
+
|
|
67
|
+
### Admonition
|
|
68
|
+
|
|
69
|
+
A styled callout component for highlighting important information.
|
|
70
|
+
|
|
71
|
+
**Props:**
|
|
72
|
+
|
|
73
|
+
- `type`: The type of admonition (e.g., 'info', 'warning', 'error', 'tip')
|
|
74
|
+
- `title`: Optional title for the admonition
|
|
75
|
+
- `children`: Content to display inside the admonition
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React6 = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var React6__default = /*#__PURE__*/_interopDefault(React6);
|
|
9
|
+
|
|
10
|
+
// src/Admonition.tsx
|
|
11
|
+
var DangerIcon = (props) => {
|
|
12
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 12 16", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
|
+
"path",
|
|
14
|
+
{
|
|
15
|
+
fillRule: "evenodd",
|
|
16
|
+
d: "M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"
|
|
17
|
+
}
|
|
18
|
+
) });
|
|
19
|
+
};
|
|
20
|
+
var InfoIcon = (props) => {
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 14 16", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22
|
+
"path",
|
|
23
|
+
{
|
|
24
|
+
fillRule: "evenodd",
|
|
25
|
+
d: "M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"
|
|
26
|
+
}
|
|
27
|
+
) });
|
|
28
|
+
};
|
|
29
|
+
var NoteIcon = (props) => {
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 14 16", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
+
"path",
|
|
32
|
+
{
|
|
33
|
+
fillRule: "evenodd",
|
|
34
|
+
d: "M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"
|
|
35
|
+
}
|
|
36
|
+
) });
|
|
37
|
+
};
|
|
38
|
+
var TipIcon = (props) => {
|
|
39
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 12 16", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
40
|
+
"path",
|
|
41
|
+
{
|
|
42
|
+
fillRule: "evenodd",
|
|
43
|
+
d: "M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
46
|
+
};
|
|
47
|
+
var WarnIcon = (props) => {
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
+
"path",
|
|
50
|
+
{
|
|
51
|
+
fillRule: "evenodd",
|
|
52
|
+
d: "M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"
|
|
53
|
+
}
|
|
54
|
+
) });
|
|
55
|
+
};
|
|
56
|
+
var applyCodeStyle = (element, type) => {
|
|
57
|
+
const style = AdmonitionStyles[type];
|
|
58
|
+
return React6__default.default.cloneElement(element, {
|
|
59
|
+
className: `bg-[${style.codeBackground.light}] dark:bg-[${style.codeBackground.dark}] border-[${style.codeBorder.light}] dark:border-[${style.codeBorder.dark}] text-[${style.text.light}] dark:text-[${style.text.dark}]`
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
var applyParagraphStyle = (element) => {
|
|
63
|
+
return React6__default.default.cloneElement(element, {
|
|
64
|
+
className: "m-0"
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
var applyAnchorStyle = (element, type) => {
|
|
68
|
+
const style = AdmonitionStyles[type];
|
|
69
|
+
return React6__default.default.cloneElement(element, {
|
|
70
|
+
className: `custom-link-style underline text-[${style.text.light}] dark:text-[${style.text.dark}] decoration-[${style.decoration.light}] decoration-2 hover:decoration-[2.25px]`
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
var applyStrongStyle = (element, type) => {
|
|
74
|
+
const style = AdmonitionStyles[type];
|
|
75
|
+
return React6__default.default.cloneElement(element, {
|
|
76
|
+
className: `text-[${style.text.light}] dark:text-[${style.text.dark}] font-bold`
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
var recursivelyModifyChildren = (children, type) => {
|
|
80
|
+
return React6__default.default.Children.map(children, (c) => {
|
|
81
|
+
if (React6__default.default.isValidElement(c)) {
|
|
82
|
+
const child = c;
|
|
83
|
+
if (child.type === "code") {
|
|
84
|
+
return applyCodeStyle(child, type);
|
|
85
|
+
}
|
|
86
|
+
if (child.type === "strong") {
|
|
87
|
+
return applyStrongStyle(child, type);
|
|
88
|
+
}
|
|
89
|
+
if (child.props?.title !== void 0) {
|
|
90
|
+
return child;
|
|
91
|
+
}
|
|
92
|
+
if (child.props?.href !== void 0) {
|
|
93
|
+
const updatedAnchor = applyAnchorStyle(child, type);
|
|
94
|
+
const updatedChildren = recursivelyModifyChildren(updatedAnchor.props.children, type);
|
|
95
|
+
return React6__default.default.cloneElement(updatedAnchor, {
|
|
96
|
+
children: updatedChildren
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (child.type === "p") {
|
|
100
|
+
const updatedParagraph = applyParagraphStyle(child);
|
|
101
|
+
const updatedChildren = recursivelyModifyChildren(updatedParagraph.props.children, type);
|
|
102
|
+
return React6__default.default.cloneElement(updatedParagraph, {
|
|
103
|
+
children: updatedChildren
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (React6__default.default.Children.count(child.props.children) > 0) {
|
|
107
|
+
return React6__default.default.cloneElement(child, {
|
|
108
|
+
children: recursivelyModifyChildren(child.props.children, type)
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return c;
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
var StyleWrapper = ({ children, type }) => {
|
|
116
|
+
const modifiedChildren = recursivelyModifyChildren(children, type);
|
|
117
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: modifiedChildren });
|
|
118
|
+
};
|
|
119
|
+
var StyleWrapper_default = StyleWrapper;
|
|
120
|
+
var DangerAdmonition = ({
|
|
121
|
+
title,
|
|
122
|
+
children,
|
|
123
|
+
testId = "danger-admonition",
|
|
124
|
+
Icon
|
|
125
|
+
}) => {
|
|
126
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
id: "admonition",
|
|
130
|
+
className: "p-4 bg-[#FEEAEC] dark:bg-[#4B1012] !border-l-[#E13339] !dark:border-l-[#E13339] text-[#4B1012] dark:text-[#FEEAEC] !border-l-[5px] !border-transparent rounded-lg shadow-md my-4 last:mb-0",
|
|
131
|
+
"data-testid": testId,
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h5", { className: "flex items-center mb-2", "data-testid": `${testId}-title`, children: [
|
|
134
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2 text-[#4B1012] dark:text-[#FEEAEC]", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { height: 25, width: 25, className: "fill-current" }) }),
|
|
135
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold uppercase leading-none text-center", "data-testid": `${testId}-title-text`, children: title })
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": `${testId}-content`, children: /* @__PURE__ */ jsxRuntime.jsx(StyleWrapper_default, { type: "danger", children }) })
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
var InfoAdmonition = ({
|
|
143
|
+
title,
|
|
144
|
+
children,
|
|
145
|
+
testId = "info-admonition",
|
|
146
|
+
Icon
|
|
147
|
+
}) => {
|
|
148
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
id: "admonition",
|
|
152
|
+
className: "p-4 bg-[#EFF9FC] dark:bg-[#193C47] !border-l-[#4CB2D5] !dark:border-l-[#4CB2D5] text-[#193C47] dark:text-[#EFF9FC] !border-l-[5px] !border-transparent rounded-lg shadow-md my-4 last:mb-0",
|
|
153
|
+
"data-testid": testId,
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h5", { className: "flex items-center mb-2", "data-testid": `${testId}-title`, children: [
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2 text-[#193C47] dark:text-[#EFF9FC]", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { height: 25, width: 25, className: "fill-current" }) }),
|
|
157
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold uppercase leading-none text-center", "data-testid": `${testId}-title-text`, children: title })
|
|
158
|
+
] }),
|
|
159
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": `${testId}-content`, children: /* @__PURE__ */ jsxRuntime.jsx(StyleWrapper_default, { type: "info", children }) })
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
var NoteAdmonition = ({
|
|
165
|
+
title,
|
|
166
|
+
children,
|
|
167
|
+
testId = "note-admonition",
|
|
168
|
+
Icon
|
|
169
|
+
}) => {
|
|
170
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
171
|
+
"div",
|
|
172
|
+
{
|
|
173
|
+
id: "admonition",
|
|
174
|
+
className: "p-4 bg-[#FCFDFF] dark:bg-[#464648] !border-l-[#D5D4D8] !dark:border-l-[#D5D4D8] text-[#464648] dark:text-[#FCFDFF] !border-l-[5px] !border-transparent rounded-lg shadow-md my-4 last:mb-0",
|
|
175
|
+
"data-testid": testId,
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h5", { className: "flex items-center mb-2", "data-testid": `${testId}-title`, children: [
|
|
178
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2 text-[#464648] dark:text-[#FCFDFF]", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { height: 25, width: 25, className: "fill-current" }) }),
|
|
179
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold uppercase leading-none text-center", "data-testid": `${testId}-title-text`, children: title })
|
|
180
|
+
] }),
|
|
181
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": `${testId}-content`, children: /* @__PURE__ */ jsxRuntime.jsx(StyleWrapper_default, { type: "note", children }) })
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
};
|
|
186
|
+
var TipAdmonition = ({
|
|
187
|
+
title,
|
|
188
|
+
children,
|
|
189
|
+
testId = "tip-admonition",
|
|
190
|
+
Icon
|
|
191
|
+
}) => {
|
|
192
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
id: "admonition",
|
|
196
|
+
className: "p-4 bg-[#E6F6E6] dark:bg-[#003100] !border-l-[#009400] !dark:border-l-[#009400] text-[#003100] dark:text-[#E6F6E6] !border-l-[5px] !border-transparent rounded-lg shadow-md my-4 last:mb-0",
|
|
197
|
+
"data-testid": testId,
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h5", { className: "flex items-center mb-2", "data-testid": `${testId}-title`, children: [
|
|
200
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2 text-[#003100] dark:text-[#E6F6E6]", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { height: 25, width: 25, className: "fill-current" }) }),
|
|
201
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold uppercase leading-none text-center", "data-testid": `${testId}-title-text`, children: title })
|
|
202
|
+
] }),
|
|
203
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": `${testId}-content`, children: /* @__PURE__ */ jsxRuntime.jsx(StyleWrapper_default, { type: "tip", children }) })
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
};
|
|
208
|
+
var WarnAdmonition = ({
|
|
209
|
+
title,
|
|
210
|
+
children,
|
|
211
|
+
testId = "warn-admonition",
|
|
212
|
+
Icon
|
|
213
|
+
}) => {
|
|
214
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
215
|
+
"div",
|
|
216
|
+
{
|
|
217
|
+
id: "admonition",
|
|
218
|
+
className: "p-4 bg-[#FEF8E7] dark:bg-[#4C3900] !border-l-[#E6A601] !dark:border-l-[#E6A601] text-[#4C3900] dark:text-[#FEF8E7] !border-l-[5px] !border-transparent rounded-lg shadow-md my-4 last:mb-0",
|
|
219
|
+
"data-testid": testId,
|
|
220
|
+
children: [
|
|
221
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h5", { className: "flex items-center mb-2", "data-testid": `${testId}-title`, children: [
|
|
222
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2 text-[#4C3900] dark:text-[#FEF8E7]", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { height: 25, width: 25, className: "fill-current" }) }),
|
|
223
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold uppercase leading-none text-center", "data-testid": `${testId}-title-text`, children: title })
|
|
224
|
+
] }),
|
|
225
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": `${testId}-content`, children: /* @__PURE__ */ jsxRuntime.jsx(StyleWrapper_default, { type: "warn", children }) })
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
var Admonition = ({
|
|
231
|
+
type = "info",
|
|
232
|
+
title: givenTitle,
|
|
233
|
+
children,
|
|
234
|
+
testId
|
|
235
|
+
}) => {
|
|
236
|
+
const title = React6__default.default.useMemo(() => givenTitle ?? defaultTitle[type], [givenTitle, type]);
|
|
237
|
+
const Icon = React6__default.default.useMemo(() => defaultIcons[type], [type]);
|
|
238
|
+
switch (type) {
|
|
239
|
+
case "danger":
|
|
240
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DangerAdmonition, { title, Icon, testId, children });
|
|
241
|
+
case "warn":
|
|
242
|
+
return /* @__PURE__ */ jsxRuntime.jsx(WarnAdmonition, { title, Icon, testId, children });
|
|
243
|
+
case "info":
|
|
244
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InfoAdmonition, { title, Icon, testId, children });
|
|
245
|
+
case "tip":
|
|
246
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TipAdmonition, { title, Icon, testId, children });
|
|
247
|
+
case "note":
|
|
248
|
+
return /* @__PURE__ */ jsxRuntime.jsx(NoteAdmonition, { title, Icon, testId, children });
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
var defaultTitle = {
|
|
252
|
+
danger: "Danger",
|
|
253
|
+
warn: "Warning",
|
|
254
|
+
info: "Info",
|
|
255
|
+
tip: "Tip",
|
|
256
|
+
note: "Note"
|
|
257
|
+
};
|
|
258
|
+
var defaultIcons = {
|
|
259
|
+
danger: DangerIcon,
|
|
260
|
+
warn: WarnIcon,
|
|
261
|
+
info: InfoIcon,
|
|
262
|
+
tip: TipIcon,
|
|
263
|
+
note: NoteIcon
|
|
264
|
+
};
|
|
265
|
+
var AdmonitionStyles = {
|
|
266
|
+
danger: {
|
|
267
|
+
highlight: {
|
|
268
|
+
light: "#E13339",
|
|
269
|
+
dark: "#E13339"
|
|
270
|
+
},
|
|
271
|
+
text: {
|
|
272
|
+
light: "#4B1012",
|
|
273
|
+
dark: "#FEEAEC"
|
|
274
|
+
},
|
|
275
|
+
background: {
|
|
276
|
+
light: "#FEEAEC",
|
|
277
|
+
dark: "#4B1012"
|
|
278
|
+
},
|
|
279
|
+
codeBackground: {
|
|
280
|
+
light: "#FFD1D2",
|
|
281
|
+
dark: "#651619"
|
|
282
|
+
},
|
|
283
|
+
codeBorder: {
|
|
284
|
+
light: "#E5BABD",
|
|
285
|
+
dark: "#5A1417"
|
|
286
|
+
},
|
|
287
|
+
decoration: {
|
|
288
|
+
light: "#E13339",
|
|
289
|
+
dark: "#E13339"
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
info: {
|
|
293
|
+
highlight: {
|
|
294
|
+
light: "#4CB2D5",
|
|
295
|
+
dark: "#4CB2D5"
|
|
296
|
+
},
|
|
297
|
+
text: {
|
|
298
|
+
light: "#193C47",
|
|
299
|
+
dark: "#EFF9FC"
|
|
300
|
+
},
|
|
301
|
+
background: {
|
|
302
|
+
light: "#EFF9FC",
|
|
303
|
+
dark: "#193C47"
|
|
304
|
+
},
|
|
305
|
+
codeBackground: {
|
|
306
|
+
light: "#D8F3FB",
|
|
307
|
+
dark: "#22505E"
|
|
308
|
+
},
|
|
309
|
+
codeBorder: {
|
|
310
|
+
light: "#C3D8E1",
|
|
311
|
+
dark: "#1E4954"
|
|
312
|
+
},
|
|
313
|
+
decoration: {
|
|
314
|
+
light: "#4CB2D5",
|
|
315
|
+
dark: "#4CB2D5"
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
tip: {
|
|
319
|
+
highlight: {
|
|
320
|
+
light: "#009400",
|
|
321
|
+
dark: "#009400"
|
|
322
|
+
},
|
|
323
|
+
text: {
|
|
324
|
+
light: "#003100",
|
|
325
|
+
dark: "#E6F6E6"
|
|
326
|
+
},
|
|
327
|
+
background: {
|
|
328
|
+
light: "#E6F6E6",
|
|
329
|
+
dark: "#003100"
|
|
330
|
+
},
|
|
331
|
+
codeBackground: {
|
|
332
|
+
light: "#C4E9C4",
|
|
333
|
+
dark: "#014300"
|
|
334
|
+
},
|
|
335
|
+
codeBorder: {
|
|
336
|
+
light: "#B0D0B1",
|
|
337
|
+
dark: "#003100"
|
|
338
|
+
},
|
|
339
|
+
decoration: {
|
|
340
|
+
light: "#009400",
|
|
341
|
+
dark: "#009400"
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
note: {
|
|
345
|
+
highlight: {
|
|
346
|
+
light: "#D5D4D8",
|
|
347
|
+
dark: "#D5D4D8"
|
|
348
|
+
},
|
|
349
|
+
text: {
|
|
350
|
+
light: "#464648",
|
|
351
|
+
dark: "#FCFDFF"
|
|
352
|
+
},
|
|
353
|
+
background: {
|
|
354
|
+
light: "#FCFDFF",
|
|
355
|
+
dark: "#464648"
|
|
356
|
+
},
|
|
357
|
+
codeBackground: {
|
|
358
|
+
light: "#FBFBFC",
|
|
359
|
+
dark: "#5E5E61"
|
|
360
|
+
},
|
|
361
|
+
codeBorder: {
|
|
362
|
+
light: "#E0E1E3",
|
|
363
|
+
dark: "#555557"
|
|
364
|
+
},
|
|
365
|
+
decoration: {
|
|
366
|
+
light: "#D5D4D8",
|
|
367
|
+
dark: "#D5D4D8"
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
warn: {
|
|
371
|
+
highlight: {
|
|
372
|
+
light: "#E6A601",
|
|
373
|
+
dark: "#E6A601"
|
|
374
|
+
},
|
|
375
|
+
text: {
|
|
376
|
+
light: "#4C3900",
|
|
377
|
+
dark: "#FEF8E7"
|
|
378
|
+
},
|
|
379
|
+
background: {
|
|
380
|
+
light: "#FEF8E7",
|
|
381
|
+
dark: "#4C3900"
|
|
382
|
+
},
|
|
383
|
+
codeBackground: {
|
|
384
|
+
light: "#FEEEC4",
|
|
385
|
+
dark: "#694C01"
|
|
386
|
+
},
|
|
387
|
+
codeBorder: {
|
|
388
|
+
light: "#E4D6B0",
|
|
389
|
+
dark: "#5D4400"
|
|
390
|
+
},
|
|
391
|
+
decoration: {
|
|
392
|
+
light: "#E6A601",
|
|
393
|
+
dark: "#E6A601"
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
var Admonition_default = Admonition;
|
|
398
|
+
|
|
399
|
+
exports.Admonition = Admonition_default;
|
|
400
|
+
exports.AdmonitionStyles = AdmonitionStyles;
|
|
401
|
+
//# sourceMappingURL=index.cjs.map
|
|
402
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/icons/DangerIcon.tsx","../src/icons/InfoIcon.tsx","../src/icons/NoteIcon.tsx","../src/icons/TipIcon.tsx","../src/icons/WarnIcon.tsx","../src/StyleWrapper.tsx","../src/views/Danger.tsx","../src/views/Info.tsx","../src/views/Note.tsx","../src/views/Tip.tsx","../src/views/Warn.tsx","../src/Admonition.tsx"],"names":["jsx","React","Fragment","jsxs"],"mappings":";;;;;;;;;;AAEO,IAAM,UAAA,GAAa,CAAC,KAAA,KAAsD;AAC/E,EAAA,uBACEA,cAAA,CAAC,KAAA,EAAA,EAAI,OAAA,EAAQ,WAAA,EAAa,GAAG,KAAA,EAC3B,QAAA,kBAAAA,cAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAS,SAAA;AAAA,MACT,CAAA,EAAE;AAAA;AAAA,GACJ,EACF,CAAA;AAEJ,CAAA;ACTO,IAAM,QAAA,GAAW,CAAC,KAAA,KA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AA,MACP,IAAA,EAAM;AAAA,KACR;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,KACR;AAAA,IACA,UAAA,EAAY;AAAA,MACV,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,KACR;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,KACR;AAAA,IACA,UAAA,EAAY;AAAA,MACV,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,KACR;AAAA,IACA,UAAA,EAAY;AAAA,MACV,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA;AACR,GACF;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,KACR;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,KACR;AAAA,IACA,UAAA,EAAY;AAAA,MACV,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,KACR;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,KACR;AAAA,IACA,UAAA,EAAY;AAAA,MACV,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,KACR;AAAA,IACA,UAAA,EAAY;AAAA,MACV,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA;AACR;AAEJ;AAEA,IAAO,kBAAA,GAAQ","file":"index.cjs","sourcesContent":["import React, { type SVGProps } from 'react';\n\nexport const DangerIcon = (props: SVGProps<SVGSVGElement>): React.JSX.Element => {\n return (\n <svg viewBox=\"0 0 12 16\" {...props}>\n <path\n fillRule=\"evenodd\"\n d=\"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z\"\n />\n </svg>\n );\n};\n","import React, { type SVGProps } from 'react';\n\nexport const InfoIcon = (props: SVGProps<SVGSVGElement>): React.JSX.Element => {\n return (\n <svg viewBox=\"0 0 14 16\" {...props}>\n <path\n fillRule=\"evenodd\"\n d=\"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z\"\n />\n </svg>\n );\n};\n","import React, { type SVGProps } from 'react';\n\nexport const NoteIcon = (props: SVGProps<SVGSVGElement>): React.JSX.Element => {\n return (\n <svg viewBox=\"0 0 14 16\" {...props}>\n <path\n fillRule=\"evenodd\"\n d=\"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z\"\n />\n </svg>\n );\n};\n","import React, { type SVGProps } from 'react';\n\nexport const TipIcon = (props: SVGProps<SVGSVGElement>): React.JSX.Element => {\n return (\n <svg viewBox=\"0 0 12 16\" {...props}>\n <path\n fillRule=\"evenodd\"\n d=\"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z\"\n />\n </svg>\n );\n};\n","import React, { type SVGProps } from 'react';\n\nexport const WarnIcon = (props: SVGProps<SVGSVGElement>): React.JSX.Element => {\n return (\n <svg viewBox=\"0 0 16 16\" {...props}>\n <path\n fillRule=\"evenodd\"\n d=\"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z\"\n />\n </svg>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport { AdmonitionStyles } from './Admonition';\nimport type { AdmonitionTypes } from './types';\n\nconst applyCodeStyle = (element: React.ReactElement, type: AdmonitionTypes): React.ReactElement<any> => {\n const style = AdmonitionStyles[type];\n return React.cloneElement<any>(element, {\n className: `bg-[${style.codeBackground.light}] dark:bg-[${style.codeBackground.dark}] border-[${style.codeBorder.light}] dark:border-[${style.codeBorder.dark}] text-[${style.text.light}] dark:text-[${style.text.dark}]`,\n });\n};\n\nconst applyParagraphStyle = (element: React.ReactElement): React.ReactElement<any> => {\n return React.cloneElement<any>(element, {\n className: 'm-0',\n });\n};\n\nconst applyAnchorStyle = (element: React.ReactElement, type: AdmonitionTypes): React.ReactElement<any> => {\n const style = AdmonitionStyles[type];\n return React.cloneElement<any>(element, {\n className: `custom-link-style underline text-[${style.text.light}] dark:text-[${style.text.dark}] decoration-[${style.decoration.light}] decoration-2 hover:decoration-[2.25px]`,\n });\n};\n\nconst applyStrongStyle = (element: React.ReactElement, type: AdmonitionTypes): React.ReactElement<any> => {\n const style = AdmonitionStyles[type];\n return React.cloneElement<any>(element, {\n className: `text-[${style.text.light}] dark:text-[${style.text.dark}] font-bold`,\n });\n};\n\nconst recursivelyModifyChildren = (children: React.ReactNode, type: AdmonitionTypes): React.ReactNode => {\n return React.Children.map(children, (c) => {\n if (React.isValidElement(c)) {\n const child = c as React.ReactElement<any>;\n if (child.type === 'code') {\n return applyCodeStyle(child, type);\n }\n\n if (child.type === 'strong') {\n return applyStrongStyle(child, type);\n }\n\n // code block\n if (child.props?.title !== undefined) {\n return child;\n }\n\n // anchor\n if (child.props?.href !== undefined) {\n const updatedAnchor = applyAnchorStyle(child, type);\n const updatedChildren = recursivelyModifyChildren(updatedAnchor.props.children, type);\n return React.cloneElement(updatedAnchor, {\n children: updatedChildren,\n });\n }\n\n if (child.type === 'p') {\n const updatedParagraph = applyParagraphStyle(child);\n const updatedChildren = recursivelyModifyChildren(updatedParagraph.props.children, type);\n return React.cloneElement(updatedParagraph, {\n children: updatedChildren,\n });\n }\n\n // If the child is an element with children, recurse into its children\n if (React.Children.count(child.props.children) > 0) {\n return React.cloneElement<any>(child as React.ReactElement, {\n children: recursivelyModifyChildren(child.props.children, type),\n });\n }\n }\n\n return c;\n });\n};\n\ntype CodeWrapperProps = {\n children: React.ReactNode;\n type: AdmonitionTypes;\n};\n\nconst StyleWrapper = ({ children, type }: CodeWrapperProps): React.JSX.Element => {\n const modifiedChildren = recursivelyModifyChildren(children, type);\n return <>{modifiedChildren}</>;\n};\n\nexport default StyleWrapper;\n","import React from 'react';\nimport StyleWrapper from '../StyleWrapper';\nimport type { SingleAdmonitionProps } from '../types';\n\nexport const DangerAdmonition = ({\n title,\n children,\n testId = 'danger-admonition',\n Icon,\n}: SingleAdmonitionProps): React.JSX.Element => {\n return (\n <div\n id=\"admonition\"\n className=\"p-4 bg-[#FEEAEC] dark:bg-[#4B1012] !border-l-[#E13339] !dark:border-l-[#E13339] text-[#4B1012] dark:text-[#FEEAEC] !border-l-[5px] !border-transparent rounded-lg shadow-md my-4 last:mb-0\"\n data-testid={testId}\n >\n <h5 className=\"flex items-center mb-2\" data-testid={`${testId}-title`}>\n <span className=\"mr-2 text-[#4B1012] dark:text-[#FEEAEC]\">\n <Icon height={25} width={25} className=\"fill-current\" />\n </span>\n <span className=\"text-base font-bold uppercase leading-none text-center\" data-testid={`${testId}-title-text`}>\n {title}\n </span>\n </h5>\n <div data-testid={`${testId}-content`}>\n <StyleWrapper type=\"danger\">{children}</StyleWrapper>\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport StyleWrapper from '../StyleWrapper';\nimport type { SingleAdmonitionProps } from '../types';\n\nexport const InfoAdmonition = ({\n title,\n children,\n testId = 'info-admonition',\n Icon,\n}: SingleAdmonitionProps): React.JSX.Element => {\n return (\n <div\n id=\"admonition\"\n className=\"p-4 bg-[#EFF9FC] dark:bg-[#193C47] !border-l-[#4CB2D5] !dark:border-l-[#4CB2D5] text-[#193C47] dark:text-[#EFF9FC] !border-l-[5px] !border-transparent rounded-lg shadow-md my-4 last:mb-0\"\n data-testid={testId}\n >\n <h5 className=\"flex items-center mb-2\" data-testid={`${testId}-title`}>\n <span className=\"mr-2 text-[#193C47] dark:text-[#EFF9FC]\">\n <Icon height={25} width={25} className=\"fill-current\" />\n </span>\n <span className=\"text-base font-bold uppercase leading-none text-center\" data-testid={`${testId}-title-text`}>\n {title}\n </span>\n </h5>\n <div data-testid={`${testId}-content`}>\n <StyleWrapper type=\"info\">{children}</StyleWrapper>\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport StyleWrapper from '../StyleWrapper';\nimport type { SingleAdmonitionProps } from '../types';\n\nexport const NoteAdmonition = ({\n title,\n children,\n testId = 'note-admonition',\n Icon,\n}: SingleAdmonitionProps): React.JSX.Element => {\n return (\n <div\n id=\"admonition\"\n className=\"p-4 bg-[#FCFDFF] dark:bg-[#464648] !border-l-[#D5D4D8] !dark:border-l-[#D5D4D8] text-[#464648] dark:text-[#FCFDFF] !border-l-[5px] !border-transparent rounded-lg shadow-md my-4 last:mb-0\"\n data-testid={testId}\n >\n <h5 className=\"flex items-center mb-2\" data-testid={`${testId}-title`}>\n <span className=\"mr-2 text-[#464648] dark:text-[#FCFDFF]\">\n <Icon height={25} width={25} className=\"fill-current\" />\n </span>\n <span className=\"text-base font-bold uppercase leading-none text-center\" data-testid={`${testId}-title-text`}>\n {title}\n </span>\n </h5>\n <div data-testid={`${testId}-content`}>\n <StyleWrapper type=\"note\">{children}</StyleWrapper>\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport StyleWrapper from '../StyleWrapper';\nimport type { SingleAdmonitionProps } from '../types';\n\nexport const TipAdmonition = ({\n title,\n children,\n testId = 'tip-admonition',\n Icon,\n}: SingleAdmonitionProps): React.JSX.Element => {\n return (\n <div\n id=\"admonition\"\n className=\"p-4 bg-[#E6F6E6] dark:bg-[#003100] !border-l-[#009400] !dark:border-l-[#009400] text-[#003100] dark:text-[#E6F6E6] !border-l-[5px] !border-transparent rounded-lg shadow-md my-4 last:mb-0\"\n data-testid={testId}\n >\n <h5 className=\"flex items-center mb-2\" data-testid={`${testId}-title`}>\n <span className=\"mr-2 text-[#003100] dark:text-[#E6F6E6]\">\n <Icon height={25} width={25} className=\"fill-current\" />\n </span>\n <span className=\"text-base font-bold uppercase leading-none text-center\" data-testid={`${testId}-title-text`}>\n {title}\n </span>\n </h5>\n <div data-testid={`${testId}-content`}>\n <StyleWrapper type=\"tip\">{children}</StyleWrapper>\n </div>\n </div>\n );\n};\n\n// tip: {\n// highlight: {\n// light: '#009400',\n// dark: '#009400',\n// },\n// text: {\n// light: '#003100',\n// dark: '#E6F6E6',\n// },\n// background: {\n// light: '#E6F6E6',\n// dark: '#003100',\n// },\n// codeBackground: {\n// light: '#C4E9C4',\n// dark: '#014300',\n// },\n// codeBorder: {\n// light: '#B0D0B1',\n// dark: '#003100',\n// },\n// decoration: {\n// light: '#009400',\n// dark: '#009400',\n// },\n// },\n","import React from 'react';\nimport StyleWrapper from '../StyleWrapper';\nimport type { SingleAdmonitionProps } from '../types';\n\nexport const WarnAdmonition = ({\n title,\n children,\n testId = 'warn-admonition',\n Icon,\n}: SingleAdmonitionProps): React.JSX.Element => {\n return (\n <div\n id=\"admonition\"\n className=\"p-4 bg-[#FEF8E7] dark:bg-[#4C3900] !border-l-[#E6A601] !dark:border-l-[#E6A601] text-[#4C3900] dark:text-[#FEF8E7] !border-l-[5px] !border-transparent rounded-lg shadow-md my-4 last:mb-0\"\n data-testid={testId}\n >\n <h5 className=\"flex items-center mb-2\" data-testid={`${testId}-title`}>\n <span className=\"mr-2 text-[#4C3900] dark:text-[#FEF8E7]\">\n <Icon height={25} width={25} className=\"fill-current\" />\n </span>\n <span className=\"text-base font-bold uppercase leading-none text-center\" data-testid={`${testId}-title-text`}>\n {title}\n </span>\n </h5>\n <div data-testid={`${testId}-content`}>\n <StyleWrapper type=\"warn\">{children}</StyleWrapper>\n </div>\n </div>\n );\n};\n\n// warn: {\n// highlight: {\n// light: '#E6A601',\n// dark: '#E6A601',\n// },\n// text: {\n// light: '#4C3900',\n// dark: '#FEF8E7',\n// },\n// background: {\n// light: '#FEF8E7',\n// dark: '#4C3900',\n// },\n// codeBackground: {\n// light: '#FEEEC4',\n// dark: '#694C01',\n// },\n// codeBorder: {\n// light: '#E4D6B0',\n// dark: '#5D4400',\n// },\n// decoration: {\n// light: '#E6A601',\n// dark: '#E6A601',\n// },\n// },\n","import React from 'react';\nimport { DangerIcon, TipIcon, WarnIcon, InfoIcon, NoteIcon } from './icons';\nimport type { AdmonitionProps, AdmonitionTypes } from './types';\nimport { DangerAdmonition } from './views/Danger';\nimport { InfoAdmonition } from './views/Info';\nimport { NoteAdmonition } from './views/Note';\nimport { TipAdmonition } from './views/Tip';\nimport { WarnAdmonition } from './views/Warn';\n\n/**\n * @note based on https://docusaurus.io/docs/markdown-features/admonitions\n */\nexport const Admonition = ({\n type = 'info',\n title: givenTitle,\n children,\n testId,\n}: AdmonitionProps): React.JSX.Element => {\n const title = React.useMemo(() => givenTitle ?? defaultTitle[type], [givenTitle, type]);\n const Icon = React.useMemo(() => defaultIcons[type], [type]);\n\n switch (type) {\n case 'danger':\n return (\n <DangerAdmonition title={title} Icon={Icon} testId={testId}>\n {children}\n </DangerAdmonition>\n );\n case 'warn':\n return (\n <WarnAdmonition title={title} Icon={Icon} testId={testId}>\n {children}\n </WarnAdmonition>\n );\n case 'info':\n return (\n <InfoAdmonition title={title} Icon={Icon} testId={testId}>\n {children}\n </InfoAdmonition>\n );\n case 'tip':\n return (\n <TipAdmonition title={title} Icon={Icon} testId={testId}>\n {children}\n </TipAdmonition>\n );\n case 'note':\n return (\n <NoteAdmonition title={title} Icon={Icon} testId={testId}>\n {children}\n </NoteAdmonition>\n );\n }\n};\n\nconst defaultTitle: Record<AdmonitionTypes, string> = {\n danger: 'Danger',\n warn: 'Warning',\n info: 'Info',\n tip: 'Tip',\n note: 'Note',\n};\n\nconst defaultIcons: Record<AdmonitionTypes, (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element> = {\n danger: DangerIcon,\n warn: WarnIcon,\n info: InfoIcon,\n tip: TipIcon,\n note: NoteIcon,\n};\n\n/**\n * @note the tailwindcss classes are generated because they're in `views`\n */\nexport const AdmonitionStyles: Record<\n AdmonitionTypes,\n {\n highlight: {\n light: string;\n dark: string;\n };\n text: {\n light: string;\n dark: string;\n };\n background: {\n light: string;\n dark: string;\n };\n codeBackground: {\n light: string;\n dark: string;\n };\n codeBorder: {\n light: string;\n dark: string;\n };\n decoration: {\n light: string;\n dark: string;\n };\n }\n> = {\n danger: {\n highlight: {\n light: '#E13339',\n dark: '#E13339',\n },\n text: {\n light: '#4B1012',\n dark: '#FEEAEC',\n },\n background: {\n light: '#FEEAEC',\n dark: '#4B1012',\n },\n codeBackground: {\n light: '#FFD1D2',\n dark: '#651619',\n },\n codeBorder: {\n light: '#E5BABD',\n dark: '#5A1417',\n },\n decoration: {\n light: '#E13339',\n dark: '#E13339',\n },\n },\n info: {\n highlight: {\n light: '#4CB2D5',\n dark: '#4CB2D5',\n },\n text: {\n light: '#193C47',\n dark: '#EFF9FC',\n },\n background: {\n light: '#EFF9FC',\n dark: '#193C47',\n },\n codeBackground: {\n light: '#D8F3FB',\n dark: '#22505E',\n },\n codeBorder: {\n light: '#C3D8E1',\n dark: '#1E4954',\n },\n decoration: {\n light: '#4CB2D5',\n dark: '#4CB2D5',\n },\n },\n tip: {\n highlight: {\n light: '#009400',\n dark: '#009400',\n },\n text: {\n light: '#003100',\n dark: '#E6F6E6',\n },\n background: {\n light: '#E6F6E6',\n dark: '#003100',\n },\n codeBackground: {\n light: '#C4E9C4',\n dark: '#014300',\n },\n codeBorder: {\n light: '#B0D0B1',\n dark: '#003100',\n },\n decoration: {\n light: '#009400',\n dark: '#009400',\n },\n },\n note: {\n highlight: {\n light: '#D5D4D8',\n dark: '#D5D4D8',\n },\n text: {\n light: '#464648',\n dark: '#FCFDFF',\n },\n background: {\n light: '#FCFDFF',\n dark: '#464648',\n },\n codeBackground: {\n light: '#FBFBFC',\n dark: '#5E5E61',\n },\n codeBorder: {\n light: '#E0E1E3',\n dark: '#555557',\n },\n decoration: {\n light: '#D5D4D8',\n dark: '#D5D4D8',\n },\n },\n warn: {\n highlight: {\n light: '#E6A601',\n dark: '#E6A601',\n },\n text: {\n light: '#4C3900',\n dark: '#FEF8E7',\n },\n background: {\n light: '#FEF8E7',\n dark: '#4C3900',\n },\n codeBackground: {\n light: '#FEEEC4',\n dark: '#694C01',\n },\n codeBorder: {\n light: '#E4D6B0',\n dark: '#5D4400',\n },\n decoration: {\n light: '#E6A601',\n dark: '#E6A601',\n },\n },\n};\n\nexport default Admonition;\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type AdmonitionProps = {
|
|
4
|
+
type: AdmonitionTypes;
|
|
5
|
+
title?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Admonition contents.
|
|
8
|
+
*/
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
testId?: string;
|
|
11
|
+
};
|
|
12
|
+
type AdmonitionTypes = 'danger' | 'warn' | 'info' | 'tip' | 'note';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @note based on https://docusaurus.io/docs/markdown-features/admonitions
|
|
16
|
+
*/
|
|
17
|
+
declare const Admonition: ({ type, title: givenTitle, children, testId, }: AdmonitionProps) => React.JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* @note the tailwindcss classes are generated because they're in `views`
|
|
20
|
+
*/
|
|
21
|
+
declare const AdmonitionStyles: Record<AdmonitionTypes, {
|
|
22
|
+
highlight: {
|
|
23
|
+
light: string;
|
|
24
|
+
dark: string;
|
|
25
|
+
};
|
|
26
|
+
text: {
|
|
27
|
+
light: string;
|
|
28
|
+
dark: string;
|
|
29
|
+
};
|
|
30
|
+
background: {
|
|
31
|
+
light: string;
|
|
32
|
+
dark: string;
|
|
33
|
+
};
|
|
34
|
+
codeBackground: {
|
|
35
|
+
light: string;
|
|
36
|
+
dark: string;
|
|
37
|
+
};
|
|
38
|
+
codeBorder: {
|
|
39
|
+
light: string;
|
|
40
|
+
dark: string;
|
|
41
|
+
};
|
|
42
|
+
decoration: {
|
|
43
|
+
light: string;
|
|
44
|
+
dark: string;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
|
|
48
|
+
export { Admonition, AdmonitionStyles };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type AdmonitionProps = {
|
|
4
|
+
type: AdmonitionTypes;
|
|
5
|
+
title?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Admonition contents.
|
|
8
|
+
*/
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
testId?: string;
|
|
11
|
+
};
|
|
12
|
+
type AdmonitionTypes = 'danger' | 'warn' | 'info' | 'tip' | 'note';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @note based on https://docusaurus.io/docs/markdown-features/admonitions
|
|
16
|
+
*/
|
|
17
|
+
declare const Admonition: ({ type, title: givenTitle, children, testId, }: AdmonitionProps) => React.JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* @note the tailwindcss classes are generated because they're in `views`
|
|
20
|
+
*/
|
|
21
|
+
declare const AdmonitionStyles: Record<AdmonitionTypes, {
|
|
22
|
+
highlight: {
|
|
23
|
+
light: string;
|
|
24
|
+
dark: string;
|
|
25
|
+
};
|
|
26
|
+
text: {
|
|
27
|
+
light: string;
|
|
28
|
+
dark: string;
|
|
29
|
+
};
|
|
30
|
+
background: {
|
|
31
|
+
light: string;
|
|
32
|
+
dark: string;
|
|
33
|
+
};
|
|
34
|
+
codeBackground: {
|
|
35
|
+
light: string;
|
|
36
|
+
dark: string;
|
|
37
|
+
};
|
|
38
|
+
codeBorder: {
|
|
39
|
+
light: string;
|
|
40
|
+
dark: string;
|
|
41
|
+
};
|
|
42
|
+
decoration: {
|
|
43
|
+
light: string;
|
|
44
|
+
dark: string;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
|
|
48
|
+
export { Admonition, AdmonitionStyles };
|