@adamjanicki/ui 1.5.6 → 1.5.8

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 (53) hide show
  1. package/components/Accordion/Accordion.d.ts +45 -0
  2. package/components/Accordion/Accordion.js +47 -0
  3. package/components/Accordion/index.d.ts +2 -0
  4. package/components/Accordion/index.js +2 -0
  5. package/components/Alert/Alert.d.ts +3 -2
  6. package/components/Alert/Alert.js +3 -2
  7. package/components/Animated/Animated.d.ts +3 -2
  8. package/components/Animated/Animated.js +3 -2
  9. package/components/Badge/Badge.d.ts +3 -2
  10. package/components/Badge/Badge.js +2 -1
  11. package/components/Banner/Banner.d.ts +3 -2
  12. package/components/Banner/Banner.js +2 -1
  13. package/components/Box/Box.d.ts +15 -0
  14. package/components/Box/Box.js +66 -0
  15. package/components/Box/index.d.ts +2 -0
  16. package/components/Box/index.js +2 -0
  17. package/components/Button/Button.d.ts +1 -9
  18. package/components/Button/Button.js +3 -7
  19. package/components/Button/index.d.ts +2 -2
  20. package/components/Button/index.js +2 -2
  21. package/components/Carousel/Carousel.d.ts +4 -3
  22. package/components/Carousel/Carousel.js +9 -7
  23. package/components/Hamburger/Hamburger.d.ts +1 -1
  24. package/components/Icon/Icon.d.ts +14 -0
  25. package/components/Icon/Icon.js +33 -0
  26. package/components/Icon/icons.d.ts +9 -0
  27. package/components/Icon/icons.js +26 -0
  28. package/components/Icon/index.d.ts +2 -0
  29. package/components/Icon/index.js +2 -0
  30. package/components/Input/IconInput.d.ts +1 -1
  31. package/components/Input/IconInput.js +2 -1
  32. package/components/Input/Input.d.ts +1 -1
  33. package/components/Input/Input.js +1 -1
  34. package/components/Input/TextArea.d.ts +1 -1
  35. package/components/Input/TextArea.js +1 -1
  36. package/components/Layer/Layer.d.ts +2 -2
  37. package/components/Layer/Layer.js +2 -1
  38. package/components/Link/Link.js +2 -2
  39. package/components/Select/Select.d.ts +1 -1
  40. package/components/Select/Select.js +3 -1
  41. package/components/Spinner/Spinner.d.ts +1 -1
  42. package/components/Spinner/Spinner.js +1 -1
  43. package/index.d.ts +3 -2
  44. package/index.js +3 -3
  45. package/package.json +3 -2
  46. package/style.css +355 -211
  47. package/utils/types.d.ts +62 -0
  48. package/components/InlineCode/InlineCode.d.ts +0 -13
  49. package/components/InlineCode/InlineCode.js +0 -50
  50. package/components/InlineCode/index.d.ts +0 -2
  51. package/components/InlineCode/index.js +0 -2
  52. package/types/index.d.ts +0 -17
  53. /package/{types/index.js → utils/types.js} +0 -0
@@ -0,0 +1,62 @@
1
+ import React from "react";
2
+ /**
3
+ * Default children type; can be a node or list of nodes
4
+ */
5
+ export type Children = React.ReactNode | React.ReactNode[];
6
+ /**
7
+ * The type of corner to display, controlling the border radius property.
8
+ */
9
+ export type CornerType = "pill" | "rounded" | "sharp";
10
+ /**
11
+ * The type of message associated with a piece of content.
12
+ */
13
+ export type ContentType = "success" | "warning" | "error" | "info" | "static";
14
+ /**
15
+ * Standard style object to apply inline styling to components.
16
+ */
17
+ export type Style = React.CSSProperties;
18
+ /**
19
+ * Size variants used for CSS.
20
+ */
21
+ type SizeToken = "xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl";
22
+ /**
23
+ * Size prop used to transform into a CSS class or style value if a number.
24
+ */
25
+ type Size = SizeToken | number;
26
+ /**
27
+ * Layout props for a box component.
28
+ */
29
+ export type Layout = {
30
+ /**
31
+ * Direction the box spans; along the x-axis or y-axis
32
+ * (Equivalent to flex-direction)
33
+ */
34
+ axis: "x" | "y";
35
+ /**
36
+ * Spacing between children of the box
37
+ */
38
+ gap?: Size;
39
+ /**
40
+ * Alignment orthogonal to the selected axis
41
+ * (Equivalent to align-items)
42
+ */
43
+ align?: "start" | "center" | "end";
44
+ /**
45
+ * How to layout the children
46
+ * (Equivalent to justify-content)
47
+ */
48
+ justify?: "start" | "center" | "between" | "end";
49
+ /**
50
+ * Padding on the inside of the box
51
+ */
52
+ padding?: Size;
53
+ /**
54
+ * Margin on the outside of the box
55
+ */
56
+ margin?: Size;
57
+ /**
58
+ * Whether to allow wrapping of box children
59
+ */
60
+ wrap?: boolean;
61
+ };
62
+ export {};
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- type Props = Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "children"> & {
3
- /**
4
- * Code string to render
5
- */
6
- children: string;
7
- /**
8
- * Whether to disable click to copy
9
- */
10
- disableCopy?: boolean;
11
- };
12
- declare const InlineCode: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLElement>>;
13
- export default InlineCode;
@@ -1,50 +0,0 @@
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 React, { useState, useRef } from "react";
25
- import { classNames } from "../../functions";
26
- var InlineCode = React.forwardRef(function (_a, ref) {
27
- var className = _a.className, disableCopy = _a.disableCopy, onClick = _a.onClick, children = _a.children, rest = __rest(_a, ["className", "disableCopy", "onClick", "children"]);
28
- var _b = useState(false), copied = _b[0], setCopied = _b[1];
29
- var timeoutRef = useRef(null);
30
- var handleCopy = function () {
31
- var timeout = timeoutRef.current;
32
- if (timeout) {
33
- clearTimeout(timeout);
34
- timeoutRef.current = null;
35
- }
36
- navigator.clipboard.writeText(children);
37
- setCopied(true);
38
- timeoutRef.current = window.setTimeout(function () {
39
- setCopied(false);
40
- timeoutRef.current = null;
41
- }, 3000);
42
- };
43
- return (_jsx("code", __assign({}, rest, { ref: ref, role: "button", className: classNames("ajui-inline-code", disableCopy ? undefined : "ajui-copy-cursor", copied ? "ajui-inline-code-copied" : undefined, className), onClick: function (e) {
44
- if (!disableCopy) {
45
- handleCopy();
46
- }
47
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
48
- }, children: children })));
49
- });
50
- export default InlineCode;
@@ -1,2 +0,0 @@
1
- import InlineCode from "./InlineCode";
2
- export default InlineCode;
@@ -1,2 +0,0 @@
1
- import InlineCode from "./InlineCode";
2
- export default InlineCode;
package/types/index.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- /**
3
- * The type of corner to display, controlling the border radius property.
4
- */
5
- export type CornerType = "pill" | "rounded" | "sharp";
6
- /**
7
- * The type of message associated with a piece of content.
8
- */
9
- export type ContentType = "success" | "warning" | "error" | "info" | "static";
10
- /**
11
- * Standard style object to apply inline styling to components.
12
- */
13
- export type Style = React.CSSProperties;
14
- /**
15
- * Default props for a div element
16
- */
17
- export type DivProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
File without changes