@adamjanicki/ui 1.5.5 → 1.5.7

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.
Files changed (42) hide show
  1. package/components/Alert/Alert.d.ts +4 -15
  2. package/components/Alert/Alert.js +3 -2
  3. package/components/Animated/Animated.d.ts +6 -16
  4. package/components/Animated/Animated.js +31 -14
  5. package/components/Badge/Badge.d.ts +4 -16
  6. package/components/Badge/Badge.js +2 -1
  7. package/components/Banner/Banner.d.ts +4 -15
  8. package/components/Banner/Banner.js +2 -1
  9. package/components/Box/Box.d.ts +11 -0
  10. package/components/Box/Box.js +66 -0
  11. package/components/Box/index.d.ts +2 -0
  12. package/components/Box/index.js +2 -0
  13. package/components/Button/Button.d.ts +3 -3
  14. package/components/Button/Button.js +4 -4
  15. package/components/Carousel/Carousel.d.ts +6 -12
  16. package/components/Carousel/Carousel.js +19 -7
  17. package/components/Hamburger/Hamburger.d.ts +6 -5
  18. package/components/Input/IconInput.d.ts +2 -2
  19. package/components/Input/IconInput.js +2 -1
  20. package/components/Input/Input.d.ts +1 -1
  21. package/components/Input/Input.js +1 -1
  22. package/components/Input/TextArea.d.ts +1 -1
  23. package/components/Input/TextArea.js +1 -1
  24. package/components/Layer/Layer.d.ts +4 -11
  25. package/components/Layer/Layer.js +2 -1
  26. package/components/Link/Link.d.ts +2 -4
  27. package/components/Link/Link.js +3 -3
  28. package/components/Select/Select.d.ts +1 -8
  29. package/components/Select/Select.js +3 -3
  30. package/components/Spinner/Spinner.d.ts +2 -2
  31. package/components/Spinner/Spinner.js +1 -1
  32. package/index.d.ts +1 -1
  33. package/index.js +1 -1
  34. package/package.json +3 -2
  35. package/style.css +329 -238
  36. package/utils/types.d.ts +58 -0
  37. package/components/InlineCode/InlineCode.d.ts +0 -13
  38. package/components/InlineCode/InlineCode.js +0 -50
  39. package/components/InlineCode/index.d.ts +0 -2
  40. package/components/InlineCode/index.js +0 -2
  41. package/types/index.d.ts +0 -8
  42. /package/{types/index.js → utils/types.js} +0 -0
@@ -28,11 +28,11 @@ var DefaultLinkElement = forwardRef(function (_a, ref) {
28
28
  return _jsx("a", __assign({}, props, { href: to, ref: ref }));
29
29
  });
30
30
  export var UnstyledLink = forwardRef(function (_a, ref) {
31
- var _b = _a.LinkElement, LinkElement = _b === void 0 ? DefaultLinkElement : _b, props = __rest(_a, ["LinkElement"]);
32
- return (_jsx(LinkElement, __assign({}, props, { ref: ref })));
31
+ var _b = _a.LinkElement, LinkElement = _b === void 0 ? DefaultLinkElement : _b, className = _a.className, props = __rest(_a, ["LinkElement", "className"]);
32
+ return (_jsx(LinkElement, __assign({}, props, { className: classNames("aui-action", className), ref: ref })));
33
33
  });
34
34
  var Link = forwardRef(function (_a, ref) {
35
35
  var className = _a.className, props = __rest(_a, ["className"]);
36
- return (_jsx(UnstyledLink, __assign({}, props, { className: classNames("ajui-link-default", className), ref: ref })));
36
+ return (_jsx(UnstyledLink, __assign({}, props, { className: classNames("aui-link-default", className), ref: ref })));
37
37
  });
38
38
  export default Link;
@@ -1,17 +1,10 @@
1
1
  import React from "react";
2
- import { CornerType } from "../../types";
2
+ import type { CornerType } from "../../utils/types";
3
3
  type Props = React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement> & {
4
4
  /**
5
5
  * Array of options to display in the select
6
6
  */
7
7
  options: string[];
8
- /**
9
- * Mapper function to get the value of the option
10
- *
11
- * @param option the option to get the value of
12
- * @returns the value of the option
13
- */
14
- getOptionValue?: (option: string) => string;
15
8
  /**
16
9
  * Mapper function to get the label of the option
17
10
  *
@@ -23,9 +23,9 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import { forwardRef } from "react";
25
25
  import classNames from "../../functions/classNames";
26
- var identity = function (x) { return x; };
26
+ import Box from "../Box";
27
27
  var Select = function (_a, ref) {
28
- var className = _a.className, options = _a.options, _b = _a.getOptionValue, getOptionValue = _b === void 0 ? identity : _b, _c = _a.getOptionLabel, getOptionLabel = _c === void 0 ? identity : _c, _d = _a.corners, corners = _d === void 0 ? "rounded" : _d, style = _a.style, disabled = _a.disabled, props = __rest(_a, ["className", "options", "getOptionValue", "getOptionLabel", "corners", "style", "disabled"]);
29
- return (_jsxs("div", { className: classNames("ajui-select-container", "corners--".concat(corners), disabled ? "ajui-select-disabled" : undefined, className) || undefined, style: style, children: [_jsx("select", __assign({}, props, { ref: ref, className: "ajui-select-base corners--".concat(corners), disabled: disabled, children: options.map(function (option, index) { return (_jsx("option", { value: getOptionValue(option), children: getOptionLabel(option) }, index)); }) })), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", className: "ajui-select-triangle", "aria-hidden": "true", children: _jsx("path", { fill: "currentColor", d: "M 29.175781 50.824219 C 30.738281 52.386719 33.273438 52.386719 34.835938 50.824219 L 58.835938 26.824219 C 60.398438 25.261719 60.398438 22.726562 58.835938 21.164062 C 57.273438 19.601562 54.738281 19.601562 53.175781 21.164062 L 32 42.335938 L 10.824219 21.175781 C 9.261719 19.613281 6.726562 19.613281 5.164062 21.175781 C 3.601562 22.738281 3.601562 25.273438 5.164062 26.835938 L 29.164062 50.835938 Z M 29.175781 50.824219" }) })] }));
28
+ var className = _a.className, options = _a.options, getOptionLabel = _a.getOptionLabel, _b = _a.corners, corners = _b === void 0 ? "rounded" : _b, style = _a.style, disabled = _a.disabled, props = __rest(_a, ["className", "options", "getOptionLabel", "corners", "style", "disabled"]);
29
+ return (_jsxs(Box, { className: classNames("aui-select-container", "aui-corners--".concat(corners), disabled ? "aui-select-disabled" : undefined, className), style: style, children: [_jsx("select", __assign({}, props, { ref: ref, className: "aui-select-base aui-corners--".concat(corners), disabled: disabled, children: options.map(function (option, index) { return (_jsx("option", { value: option, children: (getOptionLabel === null || getOptionLabel === void 0 ? void 0 : getOptionLabel(option)) || option }, index)); }) })), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", className: "aui-select-triangle", "aria-hidden": "true", children: _jsx("path", { fill: "currentColor", d: "M 29.175781 50.824219 C 30.738281 52.386719 33.273438 52.386719 34.835938 50.824219 L 58.835938 26.824219 C 60.398438 25.261719 60.398438 22.726562 58.835938 21.164062 C 57.273438 19.601562 54.738281 19.601562 53.175781 21.164062 L 32 42.335938 L 10.824219 21.175781 C 9.261719 19.613281 6.726562 19.613281 5.164062 21.175781 C 3.601562 22.738281 3.601562 25.273438 5.164062 26.835938 L 29.164062 50.835938 Z M 29.175781 50.824219" }) })] }));
30
30
  };
31
31
  export default forwardRef(Select);
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import type { Style } from "../../utils/types";
2
2
  type Props = {
3
3
  /**
4
4
  * [Optional] Additional class names to apply to the spinner.
@@ -7,7 +7,7 @@ type Props = {
7
7
  /**
8
8
  * [Optional] Additional styles to apply to the spinner.
9
9
  */
10
- style?: React.CSSProperties;
10
+ style?: Style;
11
11
  };
12
12
  declare const Spinner: ({ className, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
13
13
  export default Spinner;
@@ -26,6 +26,6 @@ var Spinner = function (_a) {
26
26
  var className = _a.className, props = __rest(_a, ["className"]);
27
27
  return (
28
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" }) })));
29
+ _jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", className: classNames("aui-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
30
  };
31
31
  export default Spinner;
package/index.d.ts CHANGED
@@ -2,13 +2,13 @@ export { default as Alert } from "./components/Alert";
2
2
  export { default as Animated } from "./components/Animated";
3
3
  export { default as Badge } from "./components/Badge";
4
4
  export { default as Banner } from "./components/Banner";
5
+ export { default as Box } from "./components/Box";
5
6
  export { default as Button } from "./components/Button";
6
7
  export * from "./components/Button";
7
8
  export { default as Carousel } from "./components/Carousel";
8
9
  export { default as ClickOutside } from "./components/ClickOutside";
9
10
  export { default as Hamburger } from "./components/Hamburger";
10
11
  export * from "./components/Hamburger";
11
- export { default as InlineCode } from "./components/InlineCode";
12
12
  export { default as Input } from "./components/Input";
13
13
  export * from "./components/Input";
14
14
  export { default as Layer } from "./components/Layer";
package/index.js CHANGED
@@ -3,13 +3,13 @@ export { default as Alert } from "./components/Alert";
3
3
  export { default as Animated } from "./components/Animated";
4
4
  export { default as Badge } from "./components/Badge";
5
5
  export { default as Banner } from "./components/Banner";
6
+ export { default as Box } from "./components/Box";
6
7
  export { default as Button } from "./components/Button";
7
8
  export * from "./components/Button";
8
9
  export { default as Carousel } from "./components/Carousel";
9
10
  export { default as ClickOutside } from "./components/ClickOutside";
10
11
  export { default as Hamburger } from "./components/Hamburger";
11
12
  export * from "./components/Hamburger";
12
- export { default as InlineCode } from "./components/InlineCode";
13
13
  export { default as Input } from "./components/Input";
14
14
  export * from "./components/Input";
15
15
  export { default as Layer } from "./components/Layer";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamjanicki/ui",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "description": "Basic UI components and hooks for React in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -15,7 +15,8 @@
15
15
  "clean": "./clean.sh",
16
16
  "lint": "eslint src --max-warnings=0",
17
17
  "build": "npm run clean && npm run lint && tsc; cp src/style.css ./style.css",
18
- "prepare": "npm run build"
18
+ "prepare": "npm run build",
19
+ "dryrun": "npm publish --dry-run"
19
20
  },
20
21
  "peerDependencies": {
21
22
  "react": ">=18",