@geckoui/geckoui 1.5.0 → 1.6.0
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.
- package/README.md +1 -1
- package/dist/index.js +47 -52
- package/dist/index.mjs +62 -67
- package/dist/styles.css +26 -42
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -748,42 +748,24 @@ var X_default = X;
|
|
|
748
748
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
749
749
|
var Checkbox = (0, import_react6.forwardRef)(
|
|
750
750
|
(_a, ref) => {
|
|
751
|
-
var _b = _a, { id, disabled, className, checked, partial
|
|
751
|
+
var _b = _a, { id, disabled, className, checked, partial } = _b, rest = __objRest(_b, ["id", "disabled", "className", "checked", "partial"]);
|
|
752
752
|
const _id = (0, import_react6.useId)();
|
|
753
753
|
const Icon = partial ? IndeterminateIcon_default : CheckIcon_default;
|
|
754
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
children: [
|
|
770
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { style: { display: "contents" }, "aria-label": "checkbox-label", htmlFor: id != null ? id : _id, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: classNames("GeckoUICheckbox__box", className), style: { margin: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
771
|
-
"input",
|
|
772
|
-
__spreadProps(__spreadValues({
|
|
773
|
-
checked,
|
|
774
|
-
className: "GeckoUICheckbox__input",
|
|
775
|
-
disabled,
|
|
776
|
-
id: id != null ? id : _id,
|
|
777
|
-
ref,
|
|
778
|
-
style: __spreadValues({ display: "none" }, style)
|
|
779
|
-
}, rest), {
|
|
780
|
-
type: "checkbox"
|
|
781
|
-
})
|
|
782
|
-
) }) }),
|
|
783
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { className: "GeckoUICheckbox__icon" })
|
|
784
|
-
]
|
|
785
|
-
}
|
|
786
|
-
) });
|
|
754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "GeckoUICheckbox group", children: [
|
|
755
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
756
|
+
"input",
|
|
757
|
+
__spreadProps(__spreadValues({
|
|
758
|
+
checked,
|
|
759
|
+
className: classNames("GeckoUICheckbox__input", className),
|
|
760
|
+
disabled,
|
|
761
|
+
id: id != null ? id : _id,
|
|
762
|
+
ref
|
|
763
|
+
}, rest), {
|
|
764
|
+
type: "checkbox"
|
|
765
|
+
})
|
|
766
|
+
),
|
|
767
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { className: "GeckoUICheckbox__icon" })
|
|
768
|
+
] });
|
|
787
769
|
}
|
|
788
770
|
);
|
|
789
771
|
Checkbox.displayName = "Checkbox";
|
|
@@ -800,7 +782,7 @@ var CounterInput = (0, import_react7.forwardRef)(
|
|
|
800
782
|
min = -Infinity,
|
|
801
783
|
max = Infinity,
|
|
802
784
|
step = 1,
|
|
803
|
-
size = "md",
|
|
785
|
+
size: size2 = "md",
|
|
804
786
|
className,
|
|
805
787
|
inputClassName,
|
|
806
788
|
buttonClassName,
|
|
@@ -852,7 +834,7 @@ var CounterInput = (0, import_react7.forwardRef)(
|
|
|
852
834
|
"div",
|
|
853
835
|
{
|
|
854
836
|
className: classNames("GeckoUICounterInput", className),
|
|
855
|
-
"data-size":
|
|
837
|
+
"data-size": size2,
|
|
856
838
|
"data-state": disabled ? "disabled" : readOnly ? "readonly" : void 0,
|
|
857
839
|
children: [
|
|
858
840
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -1549,10 +1531,7 @@ var import_react9 = require("react");
|
|
|
1549
1531
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1550
1532
|
function CalendarYearPicker(_a) {
|
|
1551
1533
|
var _b = _a, { activeYear, onSelectYear } = _b, headerProps = __objRest(_b, ["activeYear", "onSelectYear"]);
|
|
1552
|
-
|
|
1553
|
-
if (activeYear + 1 === start) {
|
|
1554
|
-
start -= 10;
|
|
1555
|
-
}
|
|
1534
|
+
const start = Math.floor(activeYear / 10) * 10;
|
|
1556
1535
|
const [years, setYears] = (0, import_react9.useState)(
|
|
1557
1536
|
() => Array.from({ length: 12 }).map((_, index) => start - 1 + index)
|
|
1558
1537
|
);
|
|
@@ -2690,13 +2669,13 @@ var import_react19 = require("react");
|
|
|
2690
2669
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2691
2670
|
var Button = (0, import_react19.forwardRef)(
|
|
2692
2671
|
(_a, ref) => {
|
|
2693
|
-
var _b = _a, { children, className, variant = "filled", size = "md", color = "primary" } = _b, rest = __objRest(_b, ["children", "className", "variant", "size", "color"]);
|
|
2672
|
+
var _b = _a, { children, className, variant = "filled", size: size2 = "md", color = "primary" } = _b, rest = __objRest(_b, ["children", "className", "variant", "size", "color"]);
|
|
2694
2673
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2695
2674
|
"button",
|
|
2696
2675
|
__spreadProps(__spreadValues({
|
|
2697
2676
|
"data-variant": variant,
|
|
2698
2677
|
"data-color": color,
|
|
2699
|
-
"data-size":
|
|
2678
|
+
"data-size": size2,
|
|
2700
2679
|
className: classNames("GeckoUIButton", className),
|
|
2701
2680
|
ref,
|
|
2702
2681
|
type: "button"
|
|
@@ -2744,7 +2723,7 @@ var LoadingButton = (_a) => {
|
|
|
2744
2723
|
className,
|
|
2745
2724
|
children,
|
|
2746
2725
|
disabled,
|
|
2747
|
-
size,
|
|
2726
|
+
size: size2,
|
|
2748
2727
|
variant = "filled",
|
|
2749
2728
|
color
|
|
2750
2729
|
} = _b, buttonProps = __objRest(_b, [
|
|
@@ -2773,7 +2752,7 @@ var LoadingButton = (_a) => {
|
|
|
2773
2752
|
"data-loading": loading || void 0,
|
|
2774
2753
|
className: classNames("GeckoUILoadingButton", className),
|
|
2775
2754
|
disabled: loading || disabled,
|
|
2776
|
-
size,
|
|
2755
|
+
size: size2,
|
|
2777
2756
|
color,
|
|
2778
2757
|
variant
|
|
2779
2758
|
}, buttonProps), {
|
|
@@ -3246,8 +3225,8 @@ var import_react23 = require("react");
|
|
|
3246
3225
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3247
3226
|
var Switch = (0, import_react23.forwardRef)(
|
|
3248
3227
|
(_a, ref) => {
|
|
3249
|
-
var _b = _a, { size = "md", className, thumbClassName, onChange, onKeyDown } = _b, rest = __objRest(_b, ["size", "className", "thumbClassName", "onChange", "onKeyDown"]);
|
|
3250
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: classNames("GeckoUISwitch", className), "data-size":
|
|
3228
|
+
var _b = _a, { size: size2 = "md", className, thumbClassName, onChange, onKeyDown } = _b, rest = __objRest(_b, ["size", "className", "thumbClassName", "onChange", "onKeyDown"]);
|
|
3229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: classNames("GeckoUISwitch", className), "data-size": size2, children: [
|
|
3251
3230
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3252
3231
|
"input",
|
|
3253
3232
|
__spreadValues({
|
|
@@ -3265,7 +3244,7 @@ var Switch = (0, import_react23.forwardRef)(
|
|
|
3265
3244
|
}
|
|
3266
3245
|
}, rest)
|
|
3267
3246
|
),
|
|
3268
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: classNames("GeckoUISwitch__thumb", thumbClassName), "data-size":
|
|
3247
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: classNames("GeckoUISwitch__thumb", thumbClassName), "data-size": size2 })
|
|
3269
3248
|
] });
|
|
3270
3249
|
}
|
|
3271
3250
|
);
|
|
@@ -3282,7 +3261,7 @@ var RHFSwitch = (_a) => {
|
|
|
3282
3261
|
disabled,
|
|
3283
3262
|
value,
|
|
3284
3263
|
uncheckedValue,
|
|
3285
|
-
size,
|
|
3264
|
+
size: size2,
|
|
3286
3265
|
onChange,
|
|
3287
3266
|
className,
|
|
3288
3267
|
thumbClassName,
|
|
@@ -3334,7 +3313,7 @@ var RHFSwitch = (_a) => {
|
|
|
3334
3313
|
}
|
|
3335
3314
|
},
|
|
3336
3315
|
onChange: handleUpdate,
|
|
3337
|
-
size,
|
|
3316
|
+
size: size2,
|
|
3338
3317
|
thumbClassName: classNames("GeckoUIRHFSwitch__thumb", thumbClassName),
|
|
3339
3318
|
value: void 0
|
|
3340
3319
|
})
|
|
@@ -4117,6 +4096,7 @@ function SelectButton({ prefix, suffix, className }) {
|
|
|
4117
4096
|
clearable
|
|
4118
4097
|
} = useSelect();
|
|
4119
4098
|
const id = (0, import_react29.useId)();
|
|
4099
|
+
const pointerDownRef = (0, import_react29.useRef)(false);
|
|
4120
4100
|
const { hasValue, handleInputChange, handleKeyboardInteraction } = useSelectTrigger();
|
|
4121
4101
|
const trigger = (0, import_react29.useMemo)(() => import_react29.Children.toArray(children).find(isSelectTrigger), [children]);
|
|
4122
4102
|
const handleClear = (e) => {
|
|
@@ -4138,8 +4118,15 @@ function SelectButton({ prefix, suffix, className }) {
|
|
|
4138
4118
|
className: classNames("GeckoUISelectButton", className),
|
|
4139
4119
|
"data-state": disabled ? "disabled" : "enabled"
|
|
4140
4120
|
}, !filterable && { "data-readonly": "" }), {
|
|
4141
|
-
|
|
4121
|
+
onPointerDown: () => {
|
|
4122
|
+
pointerDownRef.current = true;
|
|
4123
|
+
},
|
|
4124
|
+
onClick: (e) => {
|
|
4142
4125
|
var _a;
|
|
4126
|
+
e.preventDefault();
|
|
4127
|
+
const isPointerClick = pointerDownRef.current;
|
|
4128
|
+
pointerDownRef.current = false;
|
|
4129
|
+
if (!isPointerClick) return;
|
|
4143
4130
|
if (open && !keyword) {
|
|
4144
4131
|
closeMenu();
|
|
4145
4132
|
return;
|
|
@@ -4474,7 +4461,15 @@ var Select = (props) => {
|
|
|
4474
4461
|
const floating = (0, import_react31.useFloating)({
|
|
4475
4462
|
placement,
|
|
4476
4463
|
strategy: floatingStrategy,
|
|
4477
|
-
middleware: [
|
|
4464
|
+
middleware: [
|
|
4465
|
+
(0, import_react31.flip)({ padding: 6 }),
|
|
4466
|
+
(0, import_react31.offset)({ mainAxis: 6 }),
|
|
4467
|
+
(0, import_react31.size)({
|
|
4468
|
+
apply({ rects, elements }) {
|
|
4469
|
+
elements.floating.style.width = `${rects.reference.width}px`;
|
|
4470
|
+
}
|
|
4471
|
+
})
|
|
4472
|
+
],
|
|
4478
4473
|
whileElementsMounted: import_react31.autoUpdate,
|
|
4479
4474
|
open,
|
|
4480
4475
|
onOpenChange: setOpen
|
|
@@ -4706,7 +4701,7 @@ var SelectOption = (_a) => {
|
|
|
4706
4701
|
onClick: disabled ? void 0 : handleOnClick,
|
|
4707
4702
|
children: [
|
|
4708
4703
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Content, {}),
|
|
4709
|
-
|
|
4704
|
+
!hideCheckIcon && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "GeckoUI-icon__check GeckoUISelectOption__check-icon" })
|
|
4710
4705
|
]
|
|
4711
4706
|
})
|
|
4712
4707
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -652,42 +652,24 @@ var X_default = X;
|
|
|
652
652
|
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
653
653
|
var Checkbox = forwardRef(
|
|
654
654
|
(_a, ref) => {
|
|
655
|
-
var _b = _a, { id, disabled, className, checked, partial
|
|
655
|
+
var _b = _a, { id, disabled, className, checked, partial } = _b, rest = __objRest(_b, ["id", "disabled", "className", "checked", "partial"]);
|
|
656
656
|
const _id = useId();
|
|
657
657
|
const Icon = partial ? IndeterminateIcon_default : CheckIcon_default;
|
|
658
|
-
return /* @__PURE__ */
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
children: [
|
|
674
|
-
/* @__PURE__ */ jsx5("label", { style: { display: "contents" }, "aria-label": "checkbox-label", htmlFor: id != null ? id : _id, children: /* @__PURE__ */ jsx5("div", { className: classNames("GeckoUICheckbox__box", className), style: { margin: 0 }, children: /* @__PURE__ */ jsx5(
|
|
675
|
-
"input",
|
|
676
|
-
__spreadProps(__spreadValues({
|
|
677
|
-
checked,
|
|
678
|
-
className: "GeckoUICheckbox__input",
|
|
679
|
-
disabled,
|
|
680
|
-
id: id != null ? id : _id,
|
|
681
|
-
ref,
|
|
682
|
-
style: __spreadValues({ display: "none" }, style)
|
|
683
|
-
}, rest), {
|
|
684
|
-
type: "checkbox"
|
|
685
|
-
})
|
|
686
|
-
) }) }),
|
|
687
|
-
/* @__PURE__ */ jsx5(Icon, { className: "GeckoUICheckbox__icon" })
|
|
688
|
-
]
|
|
689
|
-
}
|
|
690
|
-
) });
|
|
658
|
+
return /* @__PURE__ */ jsxs2("div", { className: "GeckoUICheckbox group", children: [
|
|
659
|
+
/* @__PURE__ */ jsx5(
|
|
660
|
+
"input",
|
|
661
|
+
__spreadProps(__spreadValues({
|
|
662
|
+
checked,
|
|
663
|
+
className: classNames("GeckoUICheckbox__input", className),
|
|
664
|
+
disabled,
|
|
665
|
+
id: id != null ? id : _id,
|
|
666
|
+
ref
|
|
667
|
+
}, rest), {
|
|
668
|
+
type: "checkbox"
|
|
669
|
+
})
|
|
670
|
+
),
|
|
671
|
+
/* @__PURE__ */ jsx5(Icon, { className: "GeckoUICheckbox__icon" })
|
|
672
|
+
] });
|
|
691
673
|
}
|
|
692
674
|
);
|
|
693
675
|
Checkbox.displayName = "Checkbox";
|
|
@@ -704,7 +686,7 @@ var CounterInput = forwardRef2(
|
|
|
704
686
|
min = -Infinity,
|
|
705
687
|
max = Infinity,
|
|
706
688
|
step = 1,
|
|
707
|
-
size = "md",
|
|
689
|
+
size: size2 = "md",
|
|
708
690
|
className,
|
|
709
691
|
inputClassName,
|
|
710
692
|
buttonClassName,
|
|
@@ -756,7 +738,7 @@ var CounterInput = forwardRef2(
|
|
|
756
738
|
"div",
|
|
757
739
|
{
|
|
758
740
|
className: classNames("GeckoUICounterInput", className),
|
|
759
|
-
"data-size":
|
|
741
|
+
"data-size": size2,
|
|
760
742
|
"data-state": disabled ? "disabled" : readOnly ? "readonly" : void 0,
|
|
761
743
|
children: [
|
|
762
744
|
/* @__PURE__ */ jsx6(
|
|
@@ -1453,10 +1435,7 @@ import { useState as useState4 } from "react";
|
|
|
1453
1435
|
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1454
1436
|
function CalendarYearPicker(_a) {
|
|
1455
1437
|
var _b = _a, { activeYear, onSelectYear } = _b, headerProps = __objRest(_b, ["activeYear", "onSelectYear"]);
|
|
1456
|
-
|
|
1457
|
-
if (activeYear + 1 === start) {
|
|
1458
|
-
start -= 10;
|
|
1459
|
-
}
|
|
1438
|
+
const start = Math.floor(activeYear / 10) * 10;
|
|
1460
1439
|
const [years, setYears] = useState4(
|
|
1461
1440
|
() => Array.from({ length: 12 }).map((_, index) => start - 1 + index)
|
|
1462
1441
|
);
|
|
@@ -2602,13 +2581,13 @@ import { forwardRef as forwardRef4 } from "react";
|
|
|
2602
2581
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2603
2582
|
var Button = forwardRef4(
|
|
2604
2583
|
(_a, ref) => {
|
|
2605
|
-
var _b = _a, { children, className, variant = "filled", size = "md", color = "primary" } = _b, rest = __objRest(_b, ["children", "className", "variant", "size", "color"]);
|
|
2584
|
+
var _b = _a, { children, className, variant = "filled", size: size2 = "md", color = "primary" } = _b, rest = __objRest(_b, ["children", "className", "variant", "size", "color"]);
|
|
2606
2585
|
return /* @__PURE__ */ jsx21(
|
|
2607
2586
|
"button",
|
|
2608
2587
|
__spreadProps(__spreadValues({
|
|
2609
2588
|
"data-variant": variant,
|
|
2610
2589
|
"data-color": color,
|
|
2611
|
-
"data-size":
|
|
2590
|
+
"data-size": size2,
|
|
2612
2591
|
className: classNames("GeckoUIButton", className),
|
|
2613
2592
|
ref,
|
|
2614
2593
|
type: "button"
|
|
@@ -2656,7 +2635,7 @@ var LoadingButton = (_a) => {
|
|
|
2656
2635
|
className,
|
|
2657
2636
|
children,
|
|
2658
2637
|
disabled,
|
|
2659
|
-
size,
|
|
2638
|
+
size: size2,
|
|
2660
2639
|
variant = "filled",
|
|
2661
2640
|
color
|
|
2662
2641
|
} = _b, buttonProps = __objRest(_b, [
|
|
@@ -2685,7 +2664,7 @@ var LoadingButton = (_a) => {
|
|
|
2685
2664
|
"data-loading": loading || void 0,
|
|
2686
2665
|
className: classNames("GeckoUILoadingButton", className),
|
|
2687
2666
|
disabled: loading || disabled,
|
|
2688
|
-
size,
|
|
2667
|
+
size: size2,
|
|
2689
2668
|
color,
|
|
2690
2669
|
variant
|
|
2691
2670
|
}, buttonProps), {
|
|
@@ -3158,8 +3137,8 @@ import { forwardRef as forwardRef6 } from "react";
|
|
|
3158
3137
|
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3159
3138
|
var Switch = forwardRef6(
|
|
3160
3139
|
(_a, ref) => {
|
|
3161
|
-
var _b = _a, { size = "md", className, thumbClassName, onChange, onKeyDown } = _b, rest = __objRest(_b, ["size", "className", "thumbClassName", "onChange", "onKeyDown"]);
|
|
3162
|
-
return /* @__PURE__ */ jsxs18("label", { className: classNames("GeckoUISwitch", className), "data-size":
|
|
3140
|
+
var _b = _a, { size: size2 = "md", className, thumbClassName, onChange, onKeyDown } = _b, rest = __objRest(_b, ["size", "className", "thumbClassName", "onChange", "onKeyDown"]);
|
|
3141
|
+
return /* @__PURE__ */ jsxs18("label", { className: classNames("GeckoUISwitch", className), "data-size": size2, children: [
|
|
3163
3142
|
/* @__PURE__ */ jsx34(
|
|
3164
3143
|
"input",
|
|
3165
3144
|
__spreadValues({
|
|
@@ -3177,7 +3156,7 @@ var Switch = forwardRef6(
|
|
|
3177
3156
|
}
|
|
3178
3157
|
}, rest)
|
|
3179
3158
|
),
|
|
3180
|
-
/* @__PURE__ */ jsx34("span", { className: classNames("GeckoUISwitch__thumb", thumbClassName), "data-size":
|
|
3159
|
+
/* @__PURE__ */ jsx34("span", { className: classNames("GeckoUISwitch__thumb", thumbClassName), "data-size": size2 })
|
|
3181
3160
|
] });
|
|
3182
3161
|
}
|
|
3183
3162
|
);
|
|
@@ -3194,7 +3173,7 @@ var RHFSwitch = (_a) => {
|
|
|
3194
3173
|
disabled,
|
|
3195
3174
|
value,
|
|
3196
3175
|
uncheckedValue,
|
|
3197
|
-
size,
|
|
3176
|
+
size: size2,
|
|
3198
3177
|
onChange,
|
|
3199
3178
|
className,
|
|
3200
3179
|
thumbClassName,
|
|
@@ -3246,7 +3225,7 @@ var RHFSwitch = (_a) => {
|
|
|
3246
3225
|
}
|
|
3247
3226
|
},
|
|
3248
3227
|
onChange: handleUpdate,
|
|
3249
|
-
size,
|
|
3228
|
+
size: size2,
|
|
3250
3229
|
thumbClassName: classNames("GeckoUIRHFSwitch__thumb", thumbClassName),
|
|
3251
3230
|
value: void 0
|
|
3252
3231
|
})
|
|
@@ -3780,8 +3759,8 @@ RHFFilePicker.displayName = "RHFFilePicker";
|
|
|
3780
3759
|
var RHFFilePicker_default = RHFFilePicker;
|
|
3781
3760
|
|
|
3782
3761
|
// src/components/Select/Select/Select.tsx
|
|
3783
|
-
import { autoUpdate as autoUpdate3, flip as flip4, offset as offset4, useFloating as useFloating4 } from "@floating-ui/react";
|
|
3784
|
-
import { Children as Children4, useMemo as useMemo4, useRef as
|
|
3762
|
+
import { autoUpdate as autoUpdate3, flip as flip4, offset as offset4, size, useFloating as useFloating4 } from "@floating-ui/react";
|
|
3763
|
+
import { Children as Children4, useMemo as useMemo4, useRef as useRef10, useState as useState10 } from "react";
|
|
3785
3764
|
|
|
3786
3765
|
// src/utils/isTextIncludes.ts
|
|
3787
3766
|
function isTextIncludes(baseString = "", searchString) {
|
|
@@ -3850,7 +3829,7 @@ function findSelectOptions(el) {
|
|
|
3850
3829
|
}
|
|
3851
3830
|
|
|
3852
3831
|
// src/components/Select/SelectButton/SelectButton.tsx
|
|
3853
|
-
import { Children as Children2, useId as useId5, useMemo as useMemo2 } from "react";
|
|
3832
|
+
import { Children as Children2, useId as useId5, useMemo as useMemo2, useRef as useRef9 } from "react";
|
|
3854
3833
|
|
|
3855
3834
|
// src/utils/createLabel.ts
|
|
3856
3835
|
function createLabel(item) {
|
|
@@ -4029,6 +4008,7 @@ function SelectButton({ prefix, suffix, className }) {
|
|
|
4029
4008
|
clearable
|
|
4030
4009
|
} = useSelect();
|
|
4031
4010
|
const id = useId5();
|
|
4011
|
+
const pointerDownRef = useRef9(false);
|
|
4032
4012
|
const { hasValue, handleInputChange, handleKeyboardInteraction } = useSelectTrigger();
|
|
4033
4013
|
const trigger = useMemo2(() => Children2.toArray(children).find(isSelectTrigger), [children]);
|
|
4034
4014
|
const handleClear = (e) => {
|
|
@@ -4050,8 +4030,15 @@ function SelectButton({ prefix, suffix, className }) {
|
|
|
4050
4030
|
className: classNames("GeckoUISelectButton", className),
|
|
4051
4031
|
"data-state": disabled ? "disabled" : "enabled"
|
|
4052
4032
|
}, !filterable && { "data-readonly": "" }), {
|
|
4053
|
-
|
|
4033
|
+
onPointerDown: () => {
|
|
4034
|
+
pointerDownRef.current = true;
|
|
4035
|
+
},
|
|
4036
|
+
onClick: (e) => {
|
|
4054
4037
|
var _a;
|
|
4038
|
+
e.preventDefault();
|
|
4039
|
+
const isPointerClick = pointerDownRef.current;
|
|
4040
|
+
pointerDownRef.current = false;
|
|
4041
|
+
if (!isPointerClick) return;
|
|
4055
4042
|
if (open && !keyword) {
|
|
4056
4043
|
closeMenu();
|
|
4057
4044
|
return;
|
|
@@ -4351,8 +4338,8 @@ var SelectMenu_default = SelectMenu;
|
|
|
4351
4338
|
// src/components/Select/Select/Select.tsx
|
|
4352
4339
|
import { jsx as jsx48, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4353
4340
|
var Select = (props) => {
|
|
4354
|
-
const inputRef =
|
|
4355
|
-
const menuScrollContainerRef =
|
|
4341
|
+
const inputRef = useRef10(null);
|
|
4342
|
+
const menuScrollContainerRef = useRef10(null);
|
|
4356
4343
|
const _a = props, {
|
|
4357
4344
|
disabled,
|
|
4358
4345
|
inputRef: customInputRef,
|
|
@@ -4386,7 +4373,15 @@ var Select = (props) => {
|
|
|
4386
4373
|
const floating = useFloating4({
|
|
4387
4374
|
placement,
|
|
4388
4375
|
strategy: floatingStrategy,
|
|
4389
|
-
middleware: [
|
|
4376
|
+
middleware: [
|
|
4377
|
+
flip4({ padding: 6 }),
|
|
4378
|
+
offset4({ mainAxis: 6 }),
|
|
4379
|
+
size({
|
|
4380
|
+
apply({ rects, elements }) {
|
|
4381
|
+
elements.floating.style.width = `${rects.reference.width}px`;
|
|
4382
|
+
}
|
|
4383
|
+
})
|
|
4384
|
+
],
|
|
4390
4385
|
whileElementsMounted: autoUpdate3,
|
|
4391
4386
|
open,
|
|
4392
4387
|
onOpenChange: setOpen
|
|
@@ -4491,7 +4486,7 @@ Select.displayName = "Select";
|
|
|
4491
4486
|
var Select_default = Select;
|
|
4492
4487
|
|
|
4493
4488
|
// src/components/Select/SelectOption/SelectOption.tsx
|
|
4494
|
-
import { useEffect as useEffect8, useRef as
|
|
4489
|
+
import { useEffect as useEffect8, useRef as useRef11 } from "react";
|
|
4495
4490
|
import { jsx as jsx49, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4496
4491
|
var SelectOption = (_a) => {
|
|
4497
4492
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
@@ -4514,7 +4509,7 @@ var SelectOption = (_a) => {
|
|
|
4514
4509
|
"onRemove",
|
|
4515
4510
|
"disabled"
|
|
4516
4511
|
]);
|
|
4517
|
-
const ref =
|
|
4512
|
+
const ref = useRef11(null);
|
|
4518
4513
|
const { preventDefault, attachPreventDefault } = usePreventDefault_default();
|
|
4519
4514
|
const {
|
|
4520
4515
|
closeMenuOnSelect,
|
|
@@ -4618,7 +4613,7 @@ var SelectOption = (_a) => {
|
|
|
4618
4613
|
onClick: disabled ? void 0 : handleOnClick,
|
|
4619
4614
|
children: [
|
|
4620
4615
|
/* @__PURE__ */ jsx49(Content, {}),
|
|
4621
|
-
|
|
4616
|
+
!hideCheckIcon && /* @__PURE__ */ jsx49("div", { className: "GeckoUI-icon__check GeckoUISelectOption__check-icon" })
|
|
4622
4617
|
]
|
|
4623
4618
|
})
|
|
4624
4619
|
);
|
|
@@ -4825,7 +4820,7 @@ var Pagination_default = Pagination;
|
|
|
4825
4820
|
import { useCallback as useCallback3, useEffect as useEffect10, useState as useState12 } from "react";
|
|
4826
4821
|
|
|
4827
4822
|
// src/components/Dialog/Dialog.tsx
|
|
4828
|
-
import { useEffect as useEffect9, useRef as
|
|
4823
|
+
import { useEffect as useEffect9, useRef as useRef12, useState as useState11 } from "react";
|
|
4829
4824
|
import { createRoot } from "react-dom/client";
|
|
4830
4825
|
|
|
4831
4826
|
// src/components/Dialog/DialogContainer.tsx
|
|
@@ -4876,7 +4871,7 @@ function DialogContent(_a) {
|
|
|
4876
4871
|
}
|
|
4877
4872
|
return acc;
|
|
4878
4873
|
}, {});
|
|
4879
|
-
const ref =
|
|
4874
|
+
const ref = useRef12(null);
|
|
4880
4875
|
const [animationState, setAnimationState] = useState11("entering");
|
|
4881
4876
|
const handleDismiss = () => {
|
|
4882
4877
|
setAnimationState("closing");
|
|
@@ -5035,7 +5030,7 @@ var GeckoUIPortal = ({ toastOptions = {} }) => {
|
|
|
5035
5030
|
var GeckoUIPortal_default = GeckoUIPortal;
|
|
5036
5031
|
|
|
5037
5032
|
// src/components/Drawer/Drawer.tsx
|
|
5038
|
-
import { useRef as
|
|
5033
|
+
import { useRef as useRef13 } from "react";
|
|
5039
5034
|
import { createRoot as createRoot2 } from "react-dom/client";
|
|
5040
5035
|
import { jsx as jsx58, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5041
5036
|
function Drawer({
|
|
@@ -5049,7 +5044,7 @@ function Drawer({
|
|
|
5049
5044
|
children,
|
|
5050
5045
|
dismissOnEscape = true
|
|
5051
5046
|
}) {
|
|
5052
|
-
const drawerRootRef =
|
|
5047
|
+
const drawerRootRef = useRef13(null);
|
|
5053
5048
|
const handleDismiss = () => {
|
|
5054
5049
|
if (open) handleClose == null ? void 0 : handleClose();
|
|
5055
5050
|
};
|
|
@@ -5103,7 +5098,7 @@ var Drawer_default = Drawer;
|
|
|
5103
5098
|
|
|
5104
5099
|
// src/components/Menu/Menu/Menu.tsx
|
|
5105
5100
|
import { autoUpdate as autoUpdate4, flip as flip5, offset as offset5, useFloating as useFloating5 } from "@floating-ui/react";
|
|
5106
|
-
import { Children as Children5, useCallback as useCallback4, useRef as
|
|
5101
|
+
import { Children as Children5, useCallback as useCallback4, useRef as useRef15, useState as useState13 } from "react";
|
|
5107
5102
|
|
|
5108
5103
|
// src/components/Menu/Menu.utils.ts
|
|
5109
5104
|
import { isValidElement as isValidElement3 } from "react";
|
|
@@ -5163,7 +5158,7 @@ MenuButton.displayName = "MenuButton";
|
|
|
5163
5158
|
var MenuButton_default = MenuButton;
|
|
5164
5159
|
|
|
5165
5160
|
// src/components/Menu/MenuPanel/MenuPanel.tsx
|
|
5166
|
-
import { useEffect as useEffect11, useRef as
|
|
5161
|
+
import { useEffect as useEffect11, useRef as useRef14 } from "react";
|
|
5167
5162
|
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
5168
5163
|
var MenuPanel = ({ children, className }) => {
|
|
5169
5164
|
const {
|
|
@@ -5173,7 +5168,7 @@ var MenuPanel = ({ children, className }) => {
|
|
|
5173
5168
|
menuRef,
|
|
5174
5169
|
floating: { refs, floatingStyles }
|
|
5175
5170
|
} = useMenu();
|
|
5176
|
-
const panelRef =
|
|
5171
|
+
const panelRef = useRef14(null);
|
|
5177
5172
|
useEffect11(() => {
|
|
5178
5173
|
if (!open || !panelRef.current) return;
|
|
5179
5174
|
panelRef.current.focus();
|
|
@@ -5238,7 +5233,7 @@ var Menu = ({
|
|
|
5238
5233
|
buttonClassName,
|
|
5239
5234
|
children
|
|
5240
5235
|
}) => {
|
|
5241
|
-
const menuRef =
|
|
5236
|
+
const menuRef = useRef15(null);
|
|
5242
5237
|
const [open, setOpen] = useState13(false);
|
|
5243
5238
|
const floating = useFloating5({
|
|
5244
5239
|
placement,
|
package/dist/styles.css
CHANGED
|
@@ -194,6 +194,7 @@
|
|
|
194
194
|
.GeckoUIMenu__items {
|
|
195
195
|
z-index: 50;
|
|
196
196
|
display: flex;
|
|
197
|
+
max-height: 240px;
|
|
197
198
|
width: fit-content;
|
|
198
199
|
flex-direction: column;
|
|
199
200
|
justify-content: flex-start;
|
|
@@ -1348,76 +1349,51 @@
|
|
|
1348
1349
|
border-width: 0;
|
|
1349
1350
|
border-style: solid;
|
|
1350
1351
|
border-color: #e5e7eb;
|
|
1351
|
-
|
|
1352
|
-
}
|
|
1353
|
-
.GeckoUICheckbox:focus-visible {
|
|
1354
|
-
outline: 2px solid var(--color-primary-300);
|
|
1355
|
-
outline-offset: 2px;
|
|
1356
|
-
}
|
|
1357
|
-
.GeckoUICheckbox {
|
|
1352
|
+
position: relative;
|
|
1358
1353
|
display: inline-flex;
|
|
1359
1354
|
align-items: center;
|
|
1360
1355
|
justify-content: center;
|
|
1361
1356
|
}
|
|
1362
1357
|
.GeckoUICheckbox__input {
|
|
1363
|
-
display: none;
|
|
1364
|
-
}
|
|
1365
|
-
.GeckoUICheckbox__button {
|
|
1366
1358
|
box-sizing: border-box;
|
|
1367
1359
|
border-width: 0;
|
|
1368
1360
|
border-style: solid;
|
|
1369
1361
|
border-color: #e5e7eb;
|
|
1370
|
-
|
|
1371
|
-
font-feature-settings: inherit;
|
|
1372
|
-
font-variation-settings: inherit;
|
|
1373
|
-
font-size: 100%;
|
|
1374
|
-
font-weight: inherit;
|
|
1375
|
-
line-height: inherit;
|
|
1376
|
-
letter-spacing: inherit;
|
|
1377
|
-
color: inherit;
|
|
1378
|
-
margin: 0;
|
|
1379
|
-
padding: 0;
|
|
1380
|
-
text-transform: none;
|
|
1381
|
-
-webkit-appearance: button;
|
|
1382
|
-
cursor: pointer;
|
|
1383
|
-
background-color: transparent;
|
|
1384
|
-
background-image: none;
|
|
1385
|
-
position: relative;
|
|
1386
|
-
cursor: default;
|
|
1387
|
-
border-radius: 0.25rem;
|
|
1362
|
+
outline: none;
|
|
1388
1363
|
}
|
|
1389
|
-
.
|
|
1390
|
-
|
|
1364
|
+
.GeckoUICheckbox__input:focus-visible {
|
|
1365
|
+
outline: 2px solid var(--color-primary-300);
|
|
1366
|
+
outline-offset: 2px;
|
|
1391
1367
|
}
|
|
1392
|
-
.
|
|
1393
|
-
|
|
1394
|
-
border-width: 0;
|
|
1395
|
-
border-style: solid;
|
|
1396
|
-
border-color: #e5e7eb;
|
|
1368
|
+
.GeckoUICheckbox__input {
|
|
1369
|
+
margin: calc(var(--spacing, 0.25rem) * 0);
|
|
1397
1370
|
height: calc(var(--spacing, 0.25rem) * 4);
|
|
1398
1371
|
width: calc(var(--spacing, 0.25rem) * 4);
|
|
1399
1372
|
cursor: pointer;
|
|
1373
|
+
appearance: none;
|
|
1400
1374
|
border-radius: 0.25rem;
|
|
1401
1375
|
border-style: var(--tw-border-style);
|
|
1402
1376
|
border-width: 1px;
|
|
1403
1377
|
border-color: var(--color-border-primary);
|
|
1404
1378
|
}
|
|
1405
|
-
.
|
|
1406
|
-
.GeckoUICheckbox__box:has(:hover) {
|
|
1379
|
+
.GeckoUICheckbox__input:hover {
|
|
1407
1380
|
border-color: var(--color-primary-400);
|
|
1408
1381
|
}
|
|
1409
|
-
.
|
|
1382
|
+
.GeckoUICheckbox__input:checked {
|
|
1383
|
+
border-color: var(--color-primary-600);
|
|
1384
|
+
background-color: var(--color-primary-600);
|
|
1385
|
+
}
|
|
1386
|
+
.GeckoUICheckbox__input:disabled {
|
|
1410
1387
|
cursor: not-allowed;
|
|
1411
1388
|
border-color: var(--color-border-disabled);
|
|
1412
1389
|
background-color: var(--color-surface-disabled);
|
|
1413
1390
|
}
|
|
1414
|
-
.
|
|
1391
|
+
.GeckoUICheckbox__input:checked:disabled {
|
|
1415
1392
|
border-color: var(--color-primary-600);
|
|
1416
1393
|
background-color: var(--color-primary-600);
|
|
1417
1394
|
}
|
|
1418
|
-
.GeckoUICheckbox:has(:checked:disabled)
|
|
1419
|
-
|
|
1420
|
-
background-color: var(--color-primary-600);
|
|
1395
|
+
.GeckoUICheckbox:has(:checked:disabled) {
|
|
1396
|
+
opacity: 40%;
|
|
1421
1397
|
}
|
|
1422
1398
|
.GeckoUICheckbox__icon {
|
|
1423
1399
|
pointer-events: none;
|
|
@@ -2113,6 +2089,7 @@
|
|
|
2113
2089
|
display: flex;
|
|
2114
2090
|
flex-direction: column;
|
|
2115
2091
|
gap: 1px;
|
|
2092
|
+
overflow-x: hidden;
|
|
2116
2093
|
overflow-y: auto;
|
|
2117
2094
|
overscroll-behavior: contain;
|
|
2118
2095
|
padding: calc(var(--spacing, 0.25rem) * 2);
|
|
@@ -2157,6 +2134,7 @@
|
|
|
2157
2134
|
}
|
|
2158
2135
|
.GeckoUISelectOption {
|
|
2159
2136
|
display: flex;
|
|
2137
|
+
min-width: calc(var(--spacing, 0.25rem) * 0);
|
|
2160
2138
|
cursor: pointer;
|
|
2161
2139
|
scroll-margin: calc(var(--spacing, 0.25rem) * 2);
|
|
2162
2140
|
flex-direction: row;
|
|
@@ -2168,6 +2146,7 @@
|
|
|
2168
2146
|
padding-right: 16px;
|
|
2169
2147
|
padding-left: 12px;
|
|
2170
2148
|
text-align: left;
|
|
2149
|
+
overflow-wrap: anywhere;
|
|
2171
2150
|
}
|
|
2172
2151
|
.GeckoUISelectOption[data-focused] {
|
|
2173
2152
|
background-color: var(--color-surface-hover-strong);
|
|
@@ -2177,8 +2156,13 @@
|
|
|
2177
2156
|
opacity: 50%;
|
|
2178
2157
|
}
|
|
2179
2158
|
.GeckoUISelectOption__check-icon {
|
|
2159
|
+
visibility: hidden;
|
|
2180
2160
|
height: calc(var(--spacing, 0.25rem) * 3.5);
|
|
2181
2161
|
width: calc(var(--spacing, 0.25rem) * 3.5);
|
|
2162
|
+
flex-shrink: 0;
|
|
2163
|
+
}
|
|
2164
|
+
.GeckoUISelectOption[data-state=selected] .GeckoUISelectOption__check-icon {
|
|
2165
|
+
visibility: visible;
|
|
2182
2166
|
}
|
|
2183
2167
|
.GeckoUISelectButton {
|
|
2184
2168
|
box-sizing: border-box;
|