@theguild/components 9.7.0-alpha-20250402165345-c0aef32f80bd0f0771b4957f9dc5fb44cf881617 → 9.7.0-alpha-20250402173604-e0e2ed262a7fd4cf986308e9e4725dd6363a71ea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.mts +1 -1
- package/dist/components/{input.d.mts → input/index.d.mts} +1 -1
- package/dist/components/{input.js → input/index.js} +3 -1
- package/dist/components/input/input-shake.d.mts +13 -0
- package/dist/components/input/input-shake.js +21 -0
- package/dist/index.d.mts +1 -1
- package/package.json +1 -1
- package/style.css +59 -0
|
@@ -10,7 +10,7 @@ export { ReactComponent as AccountBox, ReactComponent as AppsIcon, ReactComponen
|
|
|
10
10
|
export { DiscordIcon, GitHubIcon, InformationCircleIcon } from 'nextra/icons';
|
|
11
11
|
export { Image } from './image.mjs';
|
|
12
12
|
export { InfoList } from './info-list.mjs';
|
|
13
|
-
export { Input } from './input.mjs';
|
|
13
|
+
export { Input } from './input/index.mjs';
|
|
14
14
|
export { LegacyPackageCmd } from './legacy-package-cmd.mjs';
|
|
15
15
|
export { MarketplaceList } from './marketplace-list.mjs';
|
|
16
16
|
export { MarketplaceSearch } from './marketplace-search.mjs';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "
|
|
2
|
+
import { cn } from "../../cn";
|
|
3
|
+
import { InputShake } from "./input-shake";
|
|
3
4
|
function Input({ severity, message, ...props }) {
|
|
4
5
|
return /* @__PURE__ */ jsxs(
|
|
5
6
|
"div",
|
|
@@ -12,6 +13,7 @@ function Input({ severity, message, ...props }) {
|
|
|
12
13
|
severity === "positive" && "border-positive-dark/50 outline-positive-dark dark:border-positive-dark/50"
|
|
13
14
|
),
|
|
14
15
|
children: [
|
|
16
|
+
/* @__PURE__ */ jsx(InputShake, { severity }),
|
|
15
17
|
/* @__PURE__ */ jsx(
|
|
16
18
|
"input",
|
|
17
19
|
{
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Severity } from '../../types/severity.mjs';
|
|
3
|
+
|
|
4
|
+
interface InputShakeProps {
|
|
5
|
+
severity?: Severity;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* We need this hack to avoid shaking the input when it's first rendered
|
|
9
|
+
* already as critical.
|
|
10
|
+
*/
|
|
11
|
+
declare function InputShake({ severity }: InputShakeProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { InputShake };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
function InputShake({ severity }) {
|
|
5
|
+
const ref = useRef(null);
|
|
6
|
+
const prevSeverityRef = useRef(severity);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const shouldShake = prevSeverityRef.current !== "critical" && severity === "critical";
|
|
9
|
+
prevSeverityRef.current = severity;
|
|
10
|
+
const container = ref.current?.parentElement;
|
|
11
|
+
if (container && shouldShake) {
|
|
12
|
+
container.classList.add("animate-shake");
|
|
13
|
+
const cleanUp = () => container.classList.remove("animate-shake");
|
|
14
|
+
container.addEventListener("animationend", cleanUp, { once: true });
|
|
15
|
+
}
|
|
16
|
+
}, [severity]);
|
|
17
|
+
return /* @__PURE__ */ jsx("div", { ref, className: "hidden" });
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
InputShake
|
|
21
|
+
};
|
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ export { ReactComponent as AccountBox, ReactComponent as AngularLogo, ReactCompo
|
|
|
13
13
|
export { DiscordIcon, GitHubIcon, InformationCircleIcon } from 'nextra/icons';
|
|
14
14
|
export { Image } from './components/image.mjs';
|
|
15
15
|
export { InfoList } from './components/info-list.mjs';
|
|
16
|
-
export { Input } from './components/input.mjs';
|
|
16
|
+
export { Input } from './components/input/index.mjs';
|
|
17
17
|
export { LegacyPackageCmd } from './components/legacy-package-cmd.mjs';
|
|
18
18
|
export { MarketplaceList } from './components/marketplace-list.mjs';
|
|
19
19
|
export { MarketplaceSearch } from './components/marketplace-search.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theguild/components",
|
|
3
|
-
"version": "9.7.0-alpha-
|
|
3
|
+
"version": "9.7.0-alpha-20250402173604-e0e2ed262a7fd4cf986308e9e4725dd6363a71ea",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/the-guild-org/docs",
|
|
6
6
|
"directory": "packages/components"
|
package/style.css
CHANGED
|
@@ -149,3 +149,62 @@
|
|
|
149
149
|
--nextra-navbar-height: 64px;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
+
|
|
153
|
+
:root {
|
|
154
|
+
--hive-ease-overshoot-far: linear(
|
|
155
|
+
0 0%,
|
|
156
|
+
0.5007 7.21%,
|
|
157
|
+
0.7803 12.29%,
|
|
158
|
+
0.8883 14.93%,
|
|
159
|
+
0.9724 17.63%,
|
|
160
|
+
1.0343 20.44%,
|
|
161
|
+
1.0754 23.44%,
|
|
162
|
+
1.0898 25.22%,
|
|
163
|
+
1.0984 27.11%,
|
|
164
|
+
1.1014 29.15%,
|
|
165
|
+
1.0989 31.4%,
|
|
166
|
+
1.0854 35.23%,
|
|
167
|
+
1.0196 48.86%,
|
|
168
|
+
1.0043 54.06%,
|
|
169
|
+
0.9956 59.6%,
|
|
170
|
+
0.9925 68.11%,
|
|
171
|
+
1 100%
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
--hive-ease-overshoot-a-bit: linear(
|
|
175
|
+
0 0%,
|
|
176
|
+
0.5007 7.21%,
|
|
177
|
+
0.7803 12.29%,
|
|
178
|
+
0.8883 14.93%,
|
|
179
|
+
0.9724 17.63%,
|
|
180
|
+
1.011319 20.44%,
|
|
181
|
+
1.024882 23.44%,
|
|
182
|
+
1.029634 25.22%,
|
|
183
|
+
1.032472 27.11%,
|
|
184
|
+
1.033462 29.15%,
|
|
185
|
+
1.032637 31.4%,
|
|
186
|
+
1.028182 35.23%,
|
|
187
|
+
1.006468 48.86%,
|
|
188
|
+
1.001419 54.06%,
|
|
189
|
+
0.9956 59.6%,
|
|
190
|
+
0.9925 68.11%,
|
|
191
|
+
1 100%
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@keyframes hive-shake {
|
|
196
|
+
0%,
|
|
197
|
+
100% {
|
|
198
|
+
transform: translateX(0);
|
|
199
|
+
}
|
|
200
|
+
25% {
|
|
201
|
+
transform: rotate(-0.4deg);
|
|
202
|
+
}
|
|
203
|
+
75% {
|
|
204
|
+
transform: rotate(0.3deg);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.animate-shake:not(:focus-within) {
|
|
209
|
+
animation: hive-shake 0.3s ease;
|
|
210
|
+
}
|