@adamjanicki/ui 1.0.7 → 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.
@@ -8,7 +8,7 @@ type Props = {
8
8
  /**
9
9
  * The content to display in the alert.
10
10
  */
11
- children: string;
11
+ children: React.ReactNode | React.ReactNode[];
12
12
  /**
13
13
  * [Optional] Additional class names to apply to the alert.
14
14
  */
@@ -9,7 +9,7 @@ type Props = {
9
9
  * The content to display in the badge.
10
10
  * Should be short.
11
11
  */
12
- children: React.ReactNode;
12
+ children: React.ReactNode | React.ReactNode[];
13
13
  /**
14
14
  * [Optional] Additional class names to apply to the badge.
15
15
  */
@@ -8,7 +8,7 @@ type Props = {
8
8
  /**
9
9
  * The content to display in the banner.
10
10
  */
11
- children: React.ReactNode;
11
+ children: React.ReactNode | React.ReactNode[];
12
12
  /**
13
13
  * [Optional] Additional class names to apply to the banner.
14
14
  */
@@ -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.7",
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
@@ -53,7 +53,7 @@
53
53
  --ajui-static-color: #424242;
54
54
  --ajui-static-border: #bdbdbd;
55
55
  /* Modal */
56
- --ajui-layer-backdrop-background: rgba(0, 0, 0, 0.5);
56
+ --ajui-layer-backdrop-background: rgba(0, 0, 0, 0.25);
57
57
  /* Link */
58
58
  --ajui-link-color: #0070ff;
59
59
  }
@@ -98,7 +98,7 @@
98
98
  --ajui-static-color: #e5e5e5;
99
99
  --ajui-static-border: #595959;
100
100
  /* Modal */
101
- --ajui-layer-backdrop-background: rgba(0, 0, 0, 0.8);
101
+ --ajui-layer-backdrop-background: rgba(0, 0, 0, 0.4);
102
102
  /* Link */
103
103
  --ajui-link-color: #ffa500;
104
104
  }
@@ -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;
@@ -239,14 +238,14 @@ a {
239
238
  }
240
239
 
241
240
  @media (hover: hover) {
242
- .ajui-button--primary:not([disabled]):is(:hover, :focus-within),
243
- .ajui-icon-button:not([disabled]):is(:hover, :focus-within),
244
- .ajui-link-default:is(:hover, :focus-within) {
241
+ .ajui-button--primary:not([disabled]):is(:hover, :focus-visible),
242
+ .ajui-icon-button:not([disabled]):is(:hover, :focus-visible),
243
+ .ajui-link-default:is(:hover, :focus-visible) {
245
244
  opacity: var(--ajui-default-opacity-dim);
246
245
  }
247
246
 
248
- .ajui-button--transparent:not([disabled]):is(:hover, :focus-within),
249
- .ajui-button--secondary:not([disabled]):is(:hover, :focus-within) {
247
+ .ajui-button--transparent:not([disabled]):is(:hover, :focus-visible),
248
+ .ajui-button--secondary:not([disabled]):is(:hover, :focus-visible) {
250
249
  box-shadow: inset 0 0 0 1px var(--ajui-button-secondary-border-hover);
251
250
  }
252
251
  }
@@ -328,3 +327,19 @@ a {
328
327
  font-size: 1.5rem;
329
328
  padding: 0 0.25rem;
330
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
+ }