@adamjanicki/ui 1.4.6 → 1.4.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.
|
@@ -4,6 +4,10 @@ export type Props = {
|
|
|
4
4
|
* @default 36
|
|
5
5
|
*/
|
|
6
6
|
size?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Line height of the bars in pixels
|
|
9
|
+
*/
|
|
10
|
+
lineHeight?: number;
|
|
7
11
|
/**
|
|
8
12
|
* Direction the animation originates from;
|
|
9
13
|
* play around with this to see how it affects the animation because some of the animations are complicated
|
|
@@ -32,8 +32,8 @@ export var flipAngles = {
|
|
|
32
32
|
left: -225,
|
|
33
33
|
};
|
|
34
34
|
var Hamburger = function (props) {
|
|
35
|
-
var _a = props.size, size = _a === void 0 ? 36 : _a, _b = props.duration, duration = _b === void 0 ? 0.25 : _b, double = props.double, openStyle = props.openStyle, open = props.open, style = props.style, rounded = props.rounded, buttonProps = __rest(props, ["size", "duration", "double", "openStyle", "open", "style", "rounded"]);
|
|
36
|
-
var lineHeight = Math.max(1, Math.round(size / 20));
|
|
35
|
+
var _a = props.size, size = _a === void 0 ? 36 : _a, _b = props.duration, duration = _b === void 0 ? 0.25 : _b, double = props.double, openStyle = props.openStyle, open = props.open, style = props.style, rounded = props.rounded, inputLineHeight = props.lineHeight, buttonProps = __rest(props, ["size", "duration", "double", "openStyle", "open", "style", "rounded", "lineHeight"]);
|
|
36
|
+
var lineHeight = inputLineHeight || Math.max(1, Math.round(size / 20));
|
|
37
37
|
var buttonStyle = {
|
|
38
38
|
width: size,
|
|
39
39
|
height: size,
|
|
@@ -48,7 +48,7 @@ var Hamburger = function (props) {
|
|
|
48
48
|
width: size * 0.7,
|
|
49
49
|
backgroundColor: "currentColor",
|
|
50
50
|
position: "absolute",
|
|
51
|
-
transition: "
|
|
51
|
+
transition: "transform ".concat(duration, "s ease, opacity ").concat(duration, "s ease"),
|
|
52
52
|
borderRadius: rounded ? 10000 : 0,
|
|
53
53
|
};
|
|
54
54
|
var yTranslateMagnitude = useMemo(function () { return size / (double ? 7 : 4); }, [size, double]);
|
|
@@ -28,14 +28,6 @@ type Props = Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectE
|
|
|
28
28
|
* Name of the select for accessibility purposes
|
|
29
29
|
*/
|
|
30
30
|
"aria-label": string;
|
|
31
|
-
/**
|
|
32
|
-
* [Optional] The styles to apply to the select element
|
|
33
|
-
*/
|
|
34
|
-
innerStyle?: React.CSSProperties;
|
|
35
|
-
/**
|
|
36
|
-
* [Optional] The class name to apply to the select element
|
|
37
|
-
*/
|
|
38
|
-
innerClassName?: string;
|
|
39
31
|
};
|
|
40
32
|
declare const _default: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLSelectElement>>;
|
|
41
33
|
export default _default;
|
|
@@ -25,7 +25,7 @@ import { forwardRef } from "react";
|
|
|
25
25
|
import classNames from "../../functions/classNames";
|
|
26
26
|
var identity = function (x) { return x; };
|
|
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,
|
|
29
|
-
return (_jsxs("div", { className: classNames("ajui-select-container", disabled ? "ajui-select-disabled" : undefined, className) || undefined, style: style, children: [_jsx("select", __assign({}, props, { ref: ref, className:
|
|
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" }) })] }));
|
|
30
30
|
};
|
|
31
31
|
export default forwardRef(Select);
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -113,7 +113,7 @@ button:not([disabled]):focus-visible {
|
|
|
113
113
|
outline-offset: 0;
|
|
114
114
|
}
|
|
115
115
|
.ajui-input-default:not([disabled]):focus-within,
|
|
116
|
-
.ajui-select-
|
|
116
|
+
.ajui-select-container:not([disabled]):focus-within {
|
|
117
117
|
outline: 3px solid var(--ajui-focus-ring-color);
|
|
118
118
|
outline-offset: 0;
|
|
119
119
|
}
|
|
@@ -298,6 +298,10 @@ a {
|
|
|
298
298
|
position: relative;
|
|
299
299
|
padding: 0;
|
|
300
300
|
width: fit-content;
|
|
301
|
+
transition: outline var(--ajui-default-transition);
|
|
302
|
+
outline: 0px solid transparent;
|
|
303
|
+
box-shadow: inset 0 0 0 1px var(--ajui-select-border);
|
|
304
|
+
background-color: inherit;
|
|
301
305
|
}
|
|
302
306
|
|
|
303
307
|
.ajui-select-disabled {
|
|
@@ -308,16 +312,14 @@ a {
|
|
|
308
312
|
.ajui-select-base {
|
|
309
313
|
width: 100%;
|
|
310
314
|
color: inherit;
|
|
311
|
-
outline: 0px solid transparent;
|
|
312
315
|
border: none;
|
|
316
|
+
outline: none;
|
|
317
|
+
box-shadow: none;
|
|
313
318
|
cursor: pointer;
|
|
314
319
|
background-color: inherit;
|
|
315
320
|
padding: 0.75rem 1.75rem 0.75rem 0.5rem;
|
|
316
321
|
font-size: 1rem;
|
|
317
322
|
font-weight: 400;
|
|
318
|
-
transition: outline var(--ajui-default-transition);
|
|
319
|
-
outline: 0px solid transparent;
|
|
320
|
-
box-shadow: inset 0 0 0 1px var(--ajui-select-border);
|
|
321
323
|
appearance: none;
|
|
322
324
|
-webkit-appearance: none;
|
|
323
325
|
-moz-appearance: none;
|