@adamjanicki/ui 1.5.7 → 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.
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+ import type { Style } from "../../utils/types";
3
+ type Props = {
4
+ /**
5
+ * Drawers to render as accordion sections
6
+ */
7
+ drawers: Drawer[];
8
+ /**
9
+ * [Optional] additional class name to apply to the accordion
10
+ */
11
+ className?: string;
12
+ /**
13
+ * [Optional] additional styles to apply to the accordion
14
+ */
15
+ style?: Style;
16
+ /**
17
+ * Duration of the drawer animation (in seconds)
18
+ */
19
+ duration?: number;
20
+ /**
21
+ * Whether to hide the dividers between drawers
22
+ * @default false
23
+ */
24
+ hideDividers?: boolean;
25
+ };
26
+ declare const Accordion: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
27
+ type Drawer = {
28
+ /**
29
+ * Label for the accordion drawer
30
+ */
31
+ label: string;
32
+ /**
33
+ * Content hidden within this accordion drawer
34
+ */
35
+ content: React.ReactNode;
36
+ };
37
+ type DrawerProps = {
38
+ open: boolean;
39
+ onOpenChange: (open: boolean) => void;
40
+ item: Drawer;
41
+ duration?: number;
42
+ showDivider: boolean;
43
+ };
44
+ declare const Drawer: ({ item, open, onOpenChange, duration, showDivider, }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
45
+ export default Accordion;
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React, { useState, useRef, useEffect } from "react";
3
+ import Box from "../Box";
4
+ import Icon from "../Icon";
5
+ import { UnstyledButton } from "../Button";
6
+ import Animated from "../Animated";
7
+ import { classNames } from "../../functions";
8
+ var Accordion = React.forwardRef(function (_a, ref) {
9
+ var drawers = _a.drawers, className = _a.className, style = _a.style, duration = _a.duration, hideDividers = _a.hideDividers;
10
+ var _b = useState(new Set()), openIndices = _b[0], setOpenIndices = _b[1];
11
+ return (_jsx(Box, { layout: { axis: "y" }, className: classNames("aui-accordion aui-corners--rounded", className), style: style, ref: ref, children: drawers.map(function (item, i) { return (_jsx(Drawer, { item: item, open: openIndices.has(i), onOpenChange: function (open) {
12
+ return setOpenIndices(function (prev) {
13
+ var next = new Set(prev);
14
+ if (open) {
15
+ next.add(i);
16
+ }
17
+ else {
18
+ next.delete(i);
19
+ }
20
+ return next;
21
+ });
22
+ }, duration: duration, showDivider: !hideDividers && i < drawers.length - 1 }, i)); }) }));
23
+ });
24
+ var Drawer = function (_a) {
25
+ var item = _a.item, open = _a.open, onOpenChange = _a.onOpenChange, duration = _a.duration, showDivider = _a.showDivider;
26
+ var boxRef = useRef(null);
27
+ var _b = useState(), height = _b[0], setHeight = _b[1];
28
+ var children = item.content;
29
+ useEffect(function () {
30
+ if (open && children && boxRef.current) {
31
+ setHeight(boxRef.current.offsetHeight);
32
+ }
33
+ }, [open, children]);
34
+ // TODO: change this to use calc-size when supported
35
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/calc-size#browser_compatibility
36
+ return (_jsxs(_Fragment, { children: [_jsxs(Box, { layout: { axis: "y" }, children: [_jsx(UnstyledButton, { onClick: function () { return onOpenChange(!open); }, children: _jsxs(Box, { layout: { axis: "x", align: "center", gap: "m", padding: "l" }, children: [_jsx(Icon, { size: 12, icon: open ? "down" : "right", className: "aui-accordion-arrow" }), _jsx("span", { className: "aui-accordion-label", children: item.label })] }) }), _jsx(Animated, { style: { overflow: "hidden" }, keepMounted: true, duration: duration, animated: open, animateFrom: {
37
+ style: {
38
+ visibility: "hidden",
39
+ height: 0,
40
+ transform: "translateY(-4px)",
41
+ opacity: 0.9,
42
+ },
43
+ }, animateTo: {
44
+ style: { height: height, transform: "translateY(0)", opacity: 1 },
45
+ }, children: _jsx(Box, { ref: boxRef, children: children }) })] }), showDivider && _jsx("hr", { className: "aui-accordion-hr" })] }));
46
+ };
47
+ export default Accordion;
@@ -0,0 +1,2 @@
1
+ import Accordion from "./Accordion";
2
+ export default Accordion;
@@ -0,0 +1,2 @@
1
+ import Accordion from "./Accordion";
2
+ export default Accordion;
@@ -1,6 +1,10 @@
1
1
  import React from "react";
2
- import type { Layout } from "../../utils/types";
3
- type Props = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
2
+ import type { Layout, Children } from "../../utils/types";
3
+ type Props = Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children"> & {
4
+ /**
5
+ * Children to render inside the box
6
+ */
7
+ children?: Children;
4
8
  /**
5
9
  * The organization of the container and its children.
6
10
  */
@@ -14,13 +14,6 @@ type DefaultButtonProps = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTM
14
14
  */
15
15
  LinkElement?: CustomLinkElement;
16
16
  };
17
- type IconButtonProps = Omit<DefaultButtonProps, "children"> & {
18
- /**
19
- * Icon to display inside the button
20
- * I would usually use FontAwesome, but for added flexibility, it's any node
21
- */
22
- icon: React.ReactNode;
23
- };
24
17
  type ButtonProps = DefaultButtonProps & {
25
18
  /**
26
19
  * Type of button
@@ -39,6 +32,5 @@ type ButtonProps = DefaultButtonProps & {
39
32
  size?: "regular" | "small";
40
33
  };
41
34
  export declare const UnstyledButton: React.ForwardRefExoticComponent<Omit<DefaultButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
42
- export declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
43
35
  declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
44
36
  export default Button;
@@ -32,10 +32,6 @@ export var UnstyledButton = forwardRef(function (_a, ref) {
32
32
  }
33
33
  return (_jsx("button", __assign({}, props, { className: classNames("aui-action", className), ref: ref })));
34
34
  });
35
- export var IconButton = forwardRef(function (_a, ref) {
36
- var icon = _a.icon, className = _a.className, props = __rest(_a, ["icon", "className"]);
37
- return (_jsx(UnstyledButton, __assign({}, props, { className: classNames("aui-icon-button", className), ref: ref, children: icon })));
38
- });
39
35
  var Button = forwardRef(function (_a, ref) {
40
36
  var _b = _a.variant, variant = _b === void 0 ? "primary" : _b, _c = _a.corners, corners = _c === void 0 ? "rounded" : _c, className = _a.className, _d = _a.size, size = _d === void 0 ? "regular" : _d, rest = __rest(_a, ["variant", "corners", "className", "size"]);
41
37
  return (_jsx(UnstyledButton, __assign({}, rest, { className: classNames("aui-button--".concat(variant, " aui-button-size--").concat(size, " aui-corners--").concat(corners), className), ref: ref })));
@@ -1,3 +1,3 @@
1
- import Button, { UnstyledButton, IconButton } from "./Button";
2
- export { UnstyledButton, IconButton };
1
+ import Button, { UnstyledButton } from "./Button";
2
+ export { UnstyledButton };
3
3
  export default Button;
@@ -1,3 +1,3 @@
1
- import Button, { UnstyledButton, IconButton } from "./Button";
2
- export { UnstyledButton, IconButton };
1
+ import Button, { UnstyledButton } from "./Button";
2
+ export { UnstyledButton };
3
3
  export default Button;
@@ -1,11 +1,11 @@
1
1
  import React from "react";
2
- import type { Style } from "../../utils/types";
2
+ import type { Children, Style } from "../../utils/types";
3
3
  import { type BoxProps } from "../Box/Box";
4
4
  type ButtonProps = {
5
5
  /**
6
6
  * Children to render inside the button
7
7
  */
8
- children?: React.ReactNode | React.ReactNode[];
8
+ children?: Children;
9
9
  /**
10
10
  * Additional class name to apply to the button
11
11
  */
@@ -25,6 +25,7 @@ import React, { useState, useEffect, useRef, useCallback } from "react";
25
25
  import { classNames } from "../../functions";
26
26
  import Button from "../Button";
27
27
  import Box from "../Box/Box";
28
+ import Icon from "../Icon";
28
29
  var DEFAULT_DURATION_S = 1;
29
30
  var Carousel = React.forwardRef(function (_a, ref) {
30
31
  var _b, _c;
@@ -80,7 +81,7 @@ var Carousel = React.forwardRef(function (_a, ref) {
80
81
  transition: "transform ".concat(duration, "s ease-in-out"),
81
82
  }
82
83
  : undefined;
83
- return (_jsxs(Box, __assign({}, rest, { className: classNames("aui-carousel", className), ref: ref, children: [_jsxs(Box, { className: "aui-carousel-slider", style: __assign(__assign({}, animatingStyles), { flexDirection: delta >= 0 ? "row" : "row-reverse" }), onTransitionEnd: onTransitionEnd, children: [_jsx(Box, { className: "aui-carousel-item", children: children[cur] }), _jsx(Box, { className: "aui-carousel-item", "aria-hidden": true, children: children[next] })] }), length > 1 && (_jsxs(_Fragment, { children: [!hideArrows && (_jsxs(_Fragment, { children: [_jsx(Button, { className: classNames("aui-flex-x aui-align-center aui-justify-center aui-carousel-arrow", leftArrowProps === null || leftArrowProps === void 0 ? void 0 : leftArrowProps.className), style: __assign({ left: 8 }, leftArrowProps === null || leftArrowProps === void 0 ? void 0 : leftArrowProps.style), corners: "pill", "aria-label": "previous", onClick: function () { return startTransition(-1); }, children: (_b = leftArrowProps === null || leftArrowProps === void 0 ? void 0 : leftArrowProps.children) !== null && _b !== void 0 ? _b : "" }), _jsx(Button, { className: classNames("aui-flex-x aui-align-center aui-justify-center aui-carousel-arrow", rightArrowProps === null || rightArrowProps === void 0 ? void 0 : rightArrowProps.className), style: __assign({ right: 8 }, rightArrowProps === null || rightArrowProps === void 0 ? void 0 : rightArrowProps.style), corners: "pill", "aria-label": "next", onClick: function () { return startTransition(1); }, children: (_c = rightArrowProps === null || rightArrowProps === void 0 ? void 0 : rightArrowProps.children) !== null && _c !== void 0 ? _c : "" })] })), !hideDots && (_jsx(Box, { layout: { axis: "x", align: "center", gap: "xs" }, className: "aui-carousel-dots", children: children.map(function (_, i) { return (_jsx(Button, { className: classNames("aui-carousel-dot", dotProps === null || dotProps === void 0 ? void 0 : dotProps.className), corners: "pill", disabled: cur === i || animating, onClick: function () { return startTransition(i - cur); }, style: dotProps === null || dotProps === void 0 ? void 0 : dotProps.style }, i)); }) }))] }))] })));
84
+ return (_jsxs(Box, __assign({}, rest, { className: classNames("aui-carousel", className), ref: ref, children: [_jsxs(Box, { className: "aui-carousel-slider", style: __assign(__assign({}, animatingStyles), { flexDirection: delta >= 0 ? "row" : "row-reverse" }), onTransitionEnd: onTransitionEnd, children: [_jsx(Box, { className: "aui-carousel-item", children: children[cur] }), _jsx(Box, { className: "aui-carousel-item", "aria-hidden": true, children: children[next] })] }), length > 1 && (_jsxs(_Fragment, { children: [!hideArrows && (_jsxs(_Fragment, { children: [_jsx(Button, { className: classNames("aui-flex-x aui-align-center aui-justify-center aui-carousel-arrow", leftArrowProps === null || leftArrowProps === void 0 ? void 0 : leftArrowProps.className), style: __assign({ left: 8 }, leftArrowProps === null || leftArrowProps === void 0 ? void 0 : leftArrowProps.style), corners: "pill", "aria-label": "previous", onClick: function () { return startTransition(-1); }, children: (_b = leftArrowProps === null || leftArrowProps === void 0 ? void 0 : leftArrowProps.children) !== null && _b !== void 0 ? _b : (_jsx(Icon, { icon: "left", size: 12, style: { marginRight: 2 } })) }), _jsx(Button, { className: classNames("aui-flex-x aui-align-center aui-justify-center aui-carousel-arrow", rightArrowProps === null || rightArrowProps === void 0 ? void 0 : rightArrowProps.className), style: __assign({ right: 8 }, rightArrowProps === null || rightArrowProps === void 0 ? void 0 : rightArrowProps.style), corners: "pill", "aria-label": "next", onClick: function () { return startTransition(1); }, children: (_c = rightArrowProps === null || rightArrowProps === void 0 ? void 0 : rightArrowProps.children) !== null && _c !== void 0 ? _c : (_jsx(Icon, { icon: "right", size: 12, style: { marginLeft: 2 } })) })] })), !hideDots && (_jsx(Box, { layout: { axis: "x", align: "center", gap: "xs" }, className: "aui-carousel-dots", children: children.map(function (_, i) { return (_jsx(Button, { className: classNames("aui-carousel-dot", dotProps === null || dotProps === void 0 ? void 0 : dotProps.className), corners: "pill", disabled: cur === i || animating, onClick: function () { return startTransition(i - cur); }, style: dotProps === null || dotProps === void 0 ? void 0 : dotProps.style }, i)); }) }))] }))] })));
84
85
  });
85
86
  function safeMod(n, m) {
86
87
  return ((n % m) + m) % m;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { type IconType } from "./icons";
3
+ type Props = Omit<React.DetailedHTMLProps<React.SVGAttributes<SVGSVGElement>, SVGSVGElement>, "children" | "viewBox"> & {
4
+ /**
5
+ * The version of icon to render
6
+ */
7
+ icon: IconType;
8
+ /**
9
+ * Size of the icon
10
+ */
11
+ size?: number;
12
+ };
13
+ declare const Icon: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<SVGSVGElement>>;
14
+ export default Icon;
@@ -0,0 +1,33 @@
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 from "react";
25
+ import icons from "./icons";
26
+ import { classNames } from "../../functions";
27
+ var defaultViewBox = "0 0 512 512";
28
+ var Icon = React.forwardRef(function (_a, ref) {
29
+ var icon = _a.icon, className = _a.className, size = _a.size, style = _a.style, rest = __rest(_a, ["icon", "className", "size", "style"]);
30
+ var _b = icons[icon], contents = _b.contents, viewBox = _b.viewBox;
31
+ return (_jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: viewBox || defaultViewBox, className: classNames("aui-icon", className), style: __assign({ width: size, height: size }, style) }, rest, { ref: ref, children: contents.map(function (icon, i) { return (_jsx(React.Fragment, { children: icon }, i)); }) })));
32
+ });
33
+ export default Icon;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ type IconDefinition = {
3
+ readonly contents: React.JSX.Element[];
4
+ readonly viewBox?: string;
5
+ };
6
+ export declare const iconTypes: readonly ["up", "down", "left", "right"];
7
+ export type IconType = (typeof iconTypes)[number];
8
+ declare const icons: Record<IconType, IconDefinition>;
9
+ export default icons;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export var iconTypes = ["up", "down", "left", "right"];
3
+ var arrowPath = "M94.0908,296.3057c-29.82338,0-54-24.17662-54-54s24.17662-54,54-54c.00237,0,.00475,0,.00712,0c.0017,0,141.65138,0,221.99288,0v-222c0-29.82338,24.17662-54,54-54s54,24.17662,54,54c0,.00237,0,.00475,0,.00712s0,273.40726,0,275.97468c0,.00607,0,.01213,0,.0182c0,29.82338-24.17662,54-54,54h-276Z";
4
+ var icons = {
5
+ down: {
6
+ contents: [
7
+ _jsx("path", { d: arrowPath, transform: "matrix(.707107 0.707107-.707107 0.707107 165.642289-79.868246)" }),
8
+ ],
9
+ },
10
+ up: {
11
+ contents: [
12
+ _jsx("path", { d: arrowPath, transform: "matrix(-.707107-.707107 0.707107-.707107 346.357711 591.868246)" }),
13
+ ],
14
+ },
15
+ left: {
16
+ contents: [
17
+ _jsx("path", { d: arrowPath, transform: "matrix(-.707107 0.707107-.707107-.707107 591.868246 165.642289)" }),
18
+ ],
19
+ },
20
+ right: {
21
+ contents: [
22
+ _jsx("path", { d: arrowPath, transform: "matrix(.707107-.707107 0.707107 0.707107-79.868246 346.357711)" }),
23
+ ],
24
+ },
25
+ };
26
+ export default icons;
@@ -0,0 +1,2 @@
1
+ import Icon from "./Icon";
2
+ export default Icon;
@@ -0,0 +1,2 @@
1
+ import Icon from "./Icon";
2
+ export default Icon;
@@ -24,8 +24,9 @@ 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
26
  import Box from "../Box";
27
+ import Icon from "../Icon";
27
28
  var Select = function (_a, ref) {
28
29
  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
+ 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(Icon, { icon: "down", className: "aui-select-icon", "aria-hidden": true })] }));
30
31
  };
31
32
  export default forwardRef(Select);
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { default as Accordion } from "./components/Accordion";
1
2
  export { default as Alert } from "./components/Alert";
2
3
  export { default as Animated } from "./components/Animated";
3
4
  export { default as Badge } from "./components/Badge";
@@ -9,6 +10,7 @@ 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";
13
+ export { default as Icon } from "./components/Icon";
12
14
  export { default as Input } from "./components/Input";
13
15
  export * from "./components/Input";
14
16
  export { default as Layer } from "./components/Layer";
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // Components
2
+ export { default as Accordion } from "./components/Accordion";
2
3
  export { default as Alert } from "./components/Alert";
3
4
  export { default as Animated } from "./components/Animated";
4
5
  export { default as Badge } from "./components/Badge";
@@ -10,6 +11,7 @@ export { default as Carousel } from "./components/Carousel";
10
11
  export { default as ClickOutside } from "./components/ClickOutside";
11
12
  export { default as Hamburger } from "./components/Hamburger";
12
13
  export * from "./components/Hamburger";
14
+ export { default as Icon } from "./components/Icon";
13
15
  export { default as Input } from "./components/Input";
14
16
  export * from "./components/Input";
15
17
  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.7",
3
+ "version": "1.5.8",
4
4
  "description": "Basic UI components and hooks for React in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/style.css CHANGED
@@ -21,6 +21,7 @@
21
21
  --aui-disabled-opacity: 0.5;
22
22
  --aui-default-transition: 0.25s ease-in-out;
23
23
  --aui-default-opacity-dim: 0.75;
24
+ --aui-container-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
24
25
  /* Corners */
25
26
  --aui-sharp-radius: 0;
26
27
  --aui-rounded-radius: 8px;
@@ -53,6 +54,8 @@
53
54
  --aui-layer-backdrop-background: rgba(200, 200, 200, 0.7);
54
55
  /* Link */
55
56
  --aui-link-color: #0070ff;
57
+ /* Select */
58
+ --aui-select-icon: var(--aui-dark-gray);
56
59
  }
57
60
 
58
61
  [data-theme="dark"] {
@@ -61,6 +64,7 @@
61
64
  --aui-default-text-color: white;
62
65
  --aui-default-background: var(--aui-obsidian);
63
66
  --aui-default-border: var(--aui-dark-gray);
67
+ --aui-container-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.36);
64
68
  /* Buttons */
65
69
  --aui-button-primary-background: white;
66
70
  --aui-button-primary-color: var(--aui-obsidian);
@@ -89,6 +93,8 @@
89
93
  --aui-layer-backdrop-background: rgba(55, 55, 55, 0.7);
90
94
  /* Link */
91
95
  --aui-link-color: #33bfff;
96
+ /* Select */
97
+ --aui-select-icon: var(--aui-moon-gray);
92
98
  }
93
99
 
94
100
  /* General */
@@ -134,6 +140,28 @@
134
140
  border-color: var(--aui-default-border);
135
141
  }
136
142
 
143
+ /* Accordion */
144
+ .aui-accordion {
145
+ background-color: var(--aui-default-background);
146
+ box-shadow: 0 0 0 1px var(--aui-default-border) inset,
147
+ var(--aui-container-box-shadow);
148
+ }
149
+ .aui-accordion-label {
150
+ font-weight: 600;
151
+ }
152
+
153
+ .aui-accordion-hr {
154
+ border: none;
155
+ height: var(--aui-xxs);
156
+ background-color: var(--aui-default-border);
157
+ width: 100%;
158
+ margin: 0;
159
+ }
160
+
161
+ .aui-accordion-arrow {
162
+ color: var(--aui-select-icon);
163
+ }
164
+
137
165
  /* Alert */
138
166
  .aui-alert {
139
167
  padding: var(--aui-l);
@@ -175,7 +203,6 @@
175
203
  /* Button */
176
204
  .aui-button-base {
177
205
  background: none;
178
- color: inherit;
179
206
  border: none;
180
207
  padding: 0;
181
208
  }
@@ -191,14 +218,6 @@
191
218
  font-weight: 600;
192
219
  }
193
220
 
194
- .aui-icon-button {
195
- display: flex;
196
- justify-content: center;
197
- align-items: center;
198
- transition: opacity var(--aui-default-transition);
199
- padding: var(--aui-m);
200
- }
201
-
202
221
  .aui-button-base:disabled {
203
222
  cursor: default !important;
204
223
  opacity: var(--aui-disabled-opacity);
@@ -212,6 +231,7 @@
212
231
  }
213
232
 
214
233
  .aui-button--secondary {
234
+ color: var(--aui-default-text-color);
215
235
  background-color: var(--aui-default-background);
216
236
  box-shadow: 0 0 0 1px var(--aui-default-border) inset,
217
237
  var(--aui-subtle-box-shadow);
@@ -226,7 +246,6 @@
226
246
 
227
247
  @media (hover: hover) {
228
248
  .aui-button--primary:not([disabled]):hover,
229
- .aui-icon-button:not([disabled]):hover,
230
249
  .aui-link-default:hover {
231
250
  opacity: var(--aui-default-opacity-dim);
232
251
  }
@@ -309,14 +328,15 @@
309
328
  cursor: default;
310
329
  }
311
330
 
312
- .aui-select-triangle {
313
- --size: 12px;
331
+ .aui-select-icon {
332
+ --size: 10px;
333
+ color: var(--aui-select-icon);
314
334
  width: var(--size);
315
335
  height: var(--size);
316
336
  position: absolute;
317
- top: 50%;
337
+ top: calc(50% + 1px);
318
338
  transform: translateY(-50%);
319
- right: calc(var(--size) - 4px);
339
+ right: var(--size);
320
340
  pointer-events: none;
321
341
  }
322
342
 
@@ -331,6 +351,11 @@
331
351
  background: var(--aui-layer-backdrop-background);
332
352
  }
333
353
 
354
+ /* Icons */
355
+ .aui-icon * {
356
+ fill: currentColor;
357
+ }
358
+
334
359
  /* Spinner */
335
360
  .aui-spinner {
336
361
  animation: aui-spinner-animation 1s linear infinite;
package/utils/types.d.ts CHANGED
@@ -1,4 +1,8 @@
1
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[];
2
6
  /**
3
7
  * The type of corner to display, controlling the border radius property.
4
8
  */