@adamjanicki/ui 1.0.8 → 1.0.9

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.
@@ -0,0 +1,12 @@
1
+ type Props = {
2
+ /**
3
+ * [Optional] Additional class names to apply to the spinner.
4
+ */
5
+ className?: string;
6
+ /**
7
+ * [Optional] Additional styles to apply to the spinner.
8
+ */
9
+ style?: React.CSSProperties;
10
+ };
11
+ declare const Spinner: ({ className, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export default Spinner;
@@ -0,0 +1,31 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { classNames } from "../../utils/util";
25
+ var Spinner = function (_a) {
26
+ var className = _a.className, props = __rest(_a, ["className"]);
27
+ return (
28
+ // Designed on 2023-08-18
29
+ _jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", className: classNames("ajui-spinner", className) }, props, { children: _jsx("path", { fill: "currentColor", d: "M256,0C114.62,0,0,114.62,0,256S114.62,512,256,512c70.64,0,134.59-28.61,180.91-74.88l-31.11-31.11c-38.35,38.3-91.31,61.99-149.8,61.99-117.08,0-212-94.92-212-212S138.92,44,256,44V0Z" }) })));
30
+ };
31
+ export default Spinner;
@@ -0,0 +1,2 @@
1
+ import Spinner from "./Spinner";
2
+ export default Spinner;
@@ -0,0 +1,2 @@
1
+ import Spinner from "./Spinner";
2
+ export default Spinner;
package/index.d.ts CHANGED
@@ -11,4 +11,5 @@ export { default as Select } from "./components/Select";
11
11
  export { default as ClickOutside } from "./components/ClickOutside";
12
12
  export { default as Modal } from "./components/Modal";
13
13
  export { default as Layer } from "./components/Layer";
14
+ export { default as Spinner } from "./components/Spinner";
14
15
  export * from "./hooks";
package/index.js CHANGED
@@ -12,5 +12,6 @@ export { default as Select } from "./components/Select";
12
12
  export { default as ClickOutside } from "./components/ClickOutside";
13
13
  export { default as Modal } from "./components/Modal";
14
14
  export { default as Layer } from "./components/Layer";
15
+ export { default as Spinner } from "./components/Spinner";
15
16
  // Hooks
16
17
  export * from "./hooks";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamjanicki/ui",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Basic UI components and hooks for React in TypeScript",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/style.css CHANGED
@@ -192,7 +192,6 @@ a {
192
192
  .ajui-button-base {
193
193
  background: none;
194
194
  color: inherit;
195
- fill: inherit;
196
195
  border: none;
197
196
  padding: 0;
198
197
  cursor: pointer;
@@ -220,7 +219,6 @@ a {
220
219
  .ajui-button--primary {
221
220
  background-color: var(--ajui-button-primary-background);
222
221
  color: var(--ajui-button-primary-color);
223
- fill: var(--ajui-button-primary-color);
224
222
  transition: opacity var(--ajui-default-transition);
225
223
  }
226
224
 
@@ -329,3 +327,19 @@ a {
329
327
  font-size: 1.5rem;
330
328
  padding: 0 0.25rem;
331
329
  }
330
+
331
+ /* Spinner */
332
+ .ajui-spinner {
333
+ animation: ajui-spinner-animation 1s linear infinite;
334
+ transform-origin: center;
335
+ height: 1.5rem;
336
+ }
337
+
338
+ @keyframes ajui-spinner-animation {
339
+ 0% {
340
+ transform: rotate(0deg);
341
+ }
342
+ 100% {
343
+ transform: rotate(360deg);
344
+ }
345
+ }