@syscore/ui-library 1.15.3 → 1.16.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/client/components/icons/UtilityCompare.tsx +37 -35
- package/client/components/icons/UtilityFeedback.tsx +30 -0
- package/client/components/icons/UtilityRevisionsHide.tsx +1 -1
- package/client/components/icons/UtilityRevisionsShow.tsx +40 -0
- package/client/components/icons/imperative-badges/BadgeImperativePrimary.tsx +45 -0
- package/client/components/icons/imperative-badges/BadgeImperativeSecondary.tsx +53 -0
- package/client/components/icons/imperative-badges/index.tsx +2 -0
- package/client/components/ui/mobile-nav.tsx +278 -0
- package/client/components/ui/tooltip.tsx +39 -20
- package/client/global.css +104 -7
- package/client/ui/Icons.stories.tsx +52 -30
- package/client/ui/MobileNav.stories.tsx +317 -0
- package/client/ui/PageHeader.stories.tsx +82 -0
- package/client/ui/Tooltip.stories.tsx +38 -30
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.es.js +449 -41
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import React__default, { useState, useEffect, useCallback, useRef } from "react";
|
|
4
|
-
import { motion, AnimatePresence } from "motion/react";
|
|
3
|
+
import React__default, { useState, useEffect, useCallback, useRef, createContext, useMemo, useContext } from "react";
|
|
4
|
+
import { motion, AnimatePresence, useMotionValue, animate } from "motion/react";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
import { twMerge } from "tailwind-merge";
|
|
7
7
|
import { cva } from "class-variance-authority";
|
|
@@ -926,6 +926,17 @@ const UtilityClose = ({ className }) => {
|
|
|
926
926
|
}
|
|
927
927
|
);
|
|
928
928
|
};
|
|
929
|
+
const tooltipContentVariants = cva("tooltip-content", {
|
|
930
|
+
variants: {
|
|
931
|
+
variant: {
|
|
932
|
+
default: "tooltip-content--default",
|
|
933
|
+
simple: "tooltip-content--simple"
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
defaultVariants: {
|
|
937
|
+
variant: "default"
|
|
938
|
+
}
|
|
939
|
+
});
|
|
929
940
|
const TooltipContext = React.createContext({
|
|
930
941
|
trigger: "hover",
|
|
931
942
|
toggle: () => {
|
|
@@ -1018,6 +1029,7 @@ function TooltipTrigger({
|
|
|
1018
1029
|
}
|
|
1019
1030
|
function TooltipContent({
|
|
1020
1031
|
className,
|
|
1032
|
+
variant: variant2,
|
|
1021
1033
|
sideOffset = 0,
|
|
1022
1034
|
side: side2 = "bottom",
|
|
1023
1035
|
children,
|
|
@@ -1053,10 +1065,10 @@ function TooltipContent({
|
|
|
1053
1065
|
sideOffset,
|
|
1054
1066
|
alignOffset,
|
|
1055
1067
|
side: side2,
|
|
1056
|
-
className: cn(
|
|
1068
|
+
className: cn(tooltipContentVariants({ variant: variant2 }), className),
|
|
1057
1069
|
...props,
|
|
1058
1070
|
children: [
|
|
1059
|
-
/* @__PURE__ */ jsx("div", { className: "tooltip-arrow", children: /* @__PURE__ */ jsx(
|
|
1071
|
+
variant2 !== "simple" && /* @__PURE__ */ jsx("div", { className: "tooltip-arrow", children: /* @__PURE__ */ jsx(
|
|
1060
1072
|
"svg",
|
|
1061
1073
|
{
|
|
1062
1074
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1068,12 +1080,12 @@ function TooltipContent({
|
|
|
1068
1080
|
"path",
|
|
1069
1081
|
{
|
|
1070
1082
|
d: "M10 -1.74846e-06L-7.36867e-07 0C-3.29906e-07 2.76142 2.23858 5 5 5C7.76142 5 10 2.76142 10 -1.74846e-06Z",
|
|
1071
|
-
fill: "
|
|
1083
|
+
fill: "currentColor"
|
|
1072
1084
|
}
|
|
1073
1085
|
)
|
|
1074
1086
|
}
|
|
1075
1087
|
) }),
|
|
1076
|
-
!hideClose && /* @__PURE__ */ jsx(ToggleClose, { className: "absolute top-4 right-4" }),
|
|
1088
|
+
variant2 !== "simple" && !hideClose && /* @__PURE__ */ jsx(ToggleClose, { className: "absolute top-4 right-4" }),
|
|
1077
1089
|
children
|
|
1078
1090
|
]
|
|
1079
1091
|
}
|
|
@@ -5764,70 +5776,72 @@ const UtilityCompare = ({
|
|
|
5764
5776
|
"svg",
|
|
5765
5777
|
{
|
|
5766
5778
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5767
|
-
width: "
|
|
5768
|
-
height: "
|
|
5769
|
-
viewBox: "0 0
|
|
5779
|
+
width: "31",
|
|
5780
|
+
height: "34",
|
|
5781
|
+
viewBox: "0 0 31 34",
|
|
5770
5782
|
fill: "none",
|
|
5771
|
-
className: cn("
|
|
5783
|
+
className: cn("text-inherit w-full h-full"),
|
|
5772
5784
|
children: [
|
|
5773
5785
|
/* @__PURE__ */ jsx(
|
|
5774
5786
|
"path",
|
|
5775
5787
|
{
|
|
5776
|
-
d: "
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5788
|
+
d: "M10.6002 5.79905C10.6002 8.44949 8.45114 10.5981 5.80011 10.5981C3.14908 10.5981 1 8.44949 1 5.79905C1 3.14861 3.14908 1 5.80011 1C8.45114 1 10.6002 3.14861 10.6002 5.79905Z",
|
|
5789
|
+
fill: "#E0FBF5",
|
|
5790
|
+
stroke: "#282A31",
|
|
5791
|
+
"stroke-width": "2",
|
|
5792
|
+
"stroke-linecap": "round",
|
|
5793
|
+
"stroke-linejoin": "round"
|
|
5781
5794
|
}
|
|
5782
5795
|
),
|
|
5783
5796
|
/* @__PURE__ */ jsx(
|
|
5784
5797
|
"path",
|
|
5785
5798
|
{
|
|
5786
|
-
d: "
|
|
5787
|
-
stroke: "
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5799
|
+
d: "M5.80078 16.998L5.80078 24.9965C5.80078 25.845 6.13793 26.6588 6.73806 27.2587C7.33819 27.8587 8.15214 28.1958 9.00086 28.1958L20.2011 28.1958",
|
|
5800
|
+
stroke: "#282A31",
|
|
5801
|
+
"stroke-width": "2",
|
|
5802
|
+
"stroke-linecap": "round",
|
|
5803
|
+
"stroke-linejoin": "round"
|
|
5791
5804
|
}
|
|
5792
5805
|
),
|
|
5793
5806
|
/* @__PURE__ */ jsx(
|
|
5794
5807
|
"path",
|
|
5795
5808
|
{
|
|
5796
|
-
d: "
|
|
5797
|
-
stroke: "
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5809
|
+
d: "M10.6002 21.7971L5.80011 16.998L1 21.7971",
|
|
5810
|
+
stroke: "#282A31",
|
|
5811
|
+
"stroke-width": "2",
|
|
5812
|
+
"stroke-linecap": "round",
|
|
5813
|
+
"stroke-linejoin": "round"
|
|
5801
5814
|
}
|
|
5802
5815
|
),
|
|
5803
5816
|
/* @__PURE__ */ jsx(
|
|
5804
5817
|
"path",
|
|
5805
5818
|
{
|
|
5806
|
-
d: "
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5819
|
+
d: "M29.8001 28.2014C29.8001 30.8518 27.651 33.0004 24.9999 33.0004C22.3489 33.0004 20.1998 30.8518 20.1998 28.2014C20.1998 25.551 22.3489 23.4023 24.9999 23.4023C27.651 23.4023 29.8001 25.5509 29.8001 28.2014Z",
|
|
5820
|
+
fill: "#EFF5FB",
|
|
5821
|
+
stroke: "#282A31",
|
|
5822
|
+
"stroke-width": "2",
|
|
5823
|
+
"stroke-linecap": "round",
|
|
5824
|
+
"stroke-linejoin": "round"
|
|
5811
5825
|
}
|
|
5812
5826
|
),
|
|
5813
5827
|
/* @__PURE__ */ jsx(
|
|
5814
5828
|
"path",
|
|
5815
5829
|
{
|
|
5816
|
-
d: "
|
|
5817
|
-
stroke: "
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5830
|
+
d: "M25.0002 16.9946V8.99624C25.0002 8.14771 24.663 7.33394 24.0629 6.73395C23.4628 6.13395 22.6488 5.79687 21.8001 5.79687L10.5999 5.79688",
|
|
5831
|
+
stroke: "#282A31",
|
|
5832
|
+
"stroke-width": "2",
|
|
5833
|
+
"stroke-linecap": "round",
|
|
5834
|
+
"stroke-linejoin": "round"
|
|
5821
5835
|
}
|
|
5822
5836
|
),
|
|
5823
5837
|
/* @__PURE__ */ jsx(
|
|
5824
5838
|
"path",
|
|
5825
5839
|
{
|
|
5826
|
-
d: "
|
|
5827
|
-
stroke: "
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5840
|
+
d: "M20.1998 12.2012L24.9999 17.0002L29.8001 12.2012",
|
|
5841
|
+
stroke: "#282A31",
|
|
5842
|
+
"stroke-width": "2",
|
|
5843
|
+
"stroke-linecap": "round",
|
|
5844
|
+
"stroke-linejoin": "round"
|
|
5831
5845
|
}
|
|
5832
5846
|
)
|
|
5833
5847
|
]
|
|
@@ -6703,7 +6717,7 @@ function UtilityRevisionsHide({ className }) {
|
|
|
6703
6717
|
height: "15",
|
|
6704
6718
|
viewBox: "0 0 17 15",
|
|
6705
6719
|
fill: "none",
|
|
6706
|
-
className: cn("
|
|
6720
|
+
className: cn("text-inherit"),
|
|
6707
6721
|
children: [
|
|
6708
6722
|
/* @__PURE__ */ jsx(
|
|
6709
6723
|
"path",
|
|
@@ -6852,6 +6866,90 @@ const UtilityTriangleInfo = ({
|
|
|
6852
6866
|
}
|
|
6853
6867
|
);
|
|
6854
6868
|
};
|
|
6869
|
+
function UtilityFeedback({ className }) {
|
|
6870
|
+
return /* @__PURE__ */ jsx(
|
|
6871
|
+
"div",
|
|
6872
|
+
{
|
|
6873
|
+
className: cn(
|
|
6874
|
+
"size-4 flex items-center justify-center text-gray-500",
|
|
6875
|
+
className
|
|
6876
|
+
),
|
|
6877
|
+
children: /* @__PURE__ */ jsx(
|
|
6878
|
+
"svg",
|
|
6879
|
+
{
|
|
6880
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6881
|
+
width: "30",
|
|
6882
|
+
height: "28",
|
|
6883
|
+
viewBox: "0 0 30 28",
|
|
6884
|
+
fill: "none",
|
|
6885
|
+
className: cn("text-inherit"),
|
|
6886
|
+
children: /* @__PURE__ */ jsx(
|
|
6887
|
+
"path",
|
|
6888
|
+
{
|
|
6889
|
+
d: "M29 20.162C29 20.888 28.705 21.5843 28.1799 22.0977C27.6548 22.611 26.9426 22.8995 26.2 22.8995H7.7592C7.01665 22.8996 6.30458 23.1881 5.7796 23.7015L2.6968 26.7154C2.55779 26.8513 2.38068 26.9438 2.18788 26.9813C1.99508 27.0188 1.79524 26.9996 1.61363 26.926C1.43202 26.8525 1.27678 26.728 1.16756 26.5682C1.05834 26.4084 1.00003 26.2205 1 26.0283V3.73743C1 3.01142 1.295 2.31514 1.8201 1.80178C2.3452 1.28841 3.05739 1 3.8 1H26.2C26.9426 1 27.6548 1.28841 28.1799 1.80178C28.705 2.31514 29 3.01142 29 3.73743V20.162Z",
|
|
6890
|
+
fill: "#D6F4FB",
|
|
6891
|
+
stroke: "#71747D",
|
|
6892
|
+
"stroke-width": "2",
|
|
6893
|
+
"stroke-linecap": "round",
|
|
6894
|
+
"stroke-linejoin": "round"
|
|
6895
|
+
}
|
|
6896
|
+
)
|
|
6897
|
+
}
|
|
6898
|
+
)
|
|
6899
|
+
}
|
|
6900
|
+
);
|
|
6901
|
+
}
|
|
6902
|
+
function UtilityRevisionsShow({ className }) {
|
|
6903
|
+
return /* @__PURE__ */ jsx(
|
|
6904
|
+
"div",
|
|
6905
|
+
{
|
|
6906
|
+
className: cn(
|
|
6907
|
+
"size-4 flex items-center justify-center text-gray-500",
|
|
6908
|
+
className
|
|
6909
|
+
),
|
|
6910
|
+
children: /* @__PURE__ */ jsxs(
|
|
6911
|
+
"svg",
|
|
6912
|
+
{
|
|
6913
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6914
|
+
width: "30",
|
|
6915
|
+
height: "26",
|
|
6916
|
+
viewBox: "0 0 30 26",
|
|
6917
|
+
fill: "none",
|
|
6918
|
+
className: cn("text-inherit"),
|
|
6919
|
+
children: [
|
|
6920
|
+
/* @__PURE__ */ jsx(
|
|
6921
|
+
"path",
|
|
6922
|
+
{
|
|
6923
|
+
d: "M9.84194 11.5L1 20.5006V25.0009H14.2629L18.6839 20.5006",
|
|
6924
|
+
fill: "#F6EFD0"
|
|
6925
|
+
}
|
|
6926
|
+
),
|
|
6927
|
+
/* @__PURE__ */ jsx(
|
|
6928
|
+
"path",
|
|
6929
|
+
{
|
|
6930
|
+
d: "M9.84194 11.5L1 20.5006V25.0009H14.2629L18.6839 20.5006",
|
|
6931
|
+
stroke: "#282A31",
|
|
6932
|
+
"stroke-width": "2",
|
|
6933
|
+
"stroke-linecap": "round",
|
|
6934
|
+
"stroke-linejoin": "round"
|
|
6935
|
+
}
|
|
6936
|
+
),
|
|
6937
|
+
/* @__PURE__ */ jsx(
|
|
6938
|
+
"path",
|
|
6939
|
+
{
|
|
6940
|
+
d: "M28.9999 13.0008L22.2211 19.9013C21.6702 20.451 20.9295 20.7589 20.158 20.7589C19.3865 20.7589 18.6458 20.451 18.0949 19.9013L10.4319 12.1008C9.89184 11.5399 9.58936 10.7859 9.58936 10.0006C9.58936 9.21531 9.89184 8.4613 10.4319 7.90048L17.2107 1",
|
|
6941
|
+
stroke: "#282A31",
|
|
6942
|
+
"stroke-width": "2",
|
|
6943
|
+
"stroke-linecap": "round",
|
|
6944
|
+
"stroke-linejoin": "round"
|
|
6945
|
+
}
|
|
6946
|
+
)
|
|
6947
|
+
]
|
|
6948
|
+
}
|
|
6949
|
+
)
|
|
6950
|
+
}
|
|
6951
|
+
);
|
|
6952
|
+
}
|
|
6855
6953
|
const SealWell = ({ className }) => {
|
|
6856
6954
|
return /* @__PURE__ */ jsxs(
|
|
6857
6955
|
"svg",
|
|
@@ -12146,6 +12244,308 @@ const BadgeSurveyProvider = () => {
|
|
|
12146
12244
|
}
|
|
12147
12245
|
);
|
|
12148
12246
|
};
|
|
12247
|
+
const BadgeImperativePrimary = ({
|
|
12248
|
+
className
|
|
12249
|
+
}) => {
|
|
12250
|
+
return /* @__PURE__ */ jsx("div", { className: cn("size-6 flex items-center justify-center", className), children: /* @__PURE__ */ jsxs(
|
|
12251
|
+
"svg",
|
|
12252
|
+
{
|
|
12253
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12254
|
+
width: "20",
|
|
12255
|
+
height: "22",
|
|
12256
|
+
viewBox: "0 0 20 22",
|
|
12257
|
+
fill: "none",
|
|
12258
|
+
children: [
|
|
12259
|
+
/* @__PURE__ */ jsx(
|
|
12260
|
+
"path",
|
|
12261
|
+
{
|
|
12262
|
+
d: "M19.2133 7.81921C19.2133 6.38498 18.4454 5.06051 17.2008 4.3479L11.5941 1.13788C10.3629 0.432974 8.85042 0.432974 7.61921 1.13788L2.01255 4.3479C0.767878 5.06051 0 6.38498 0 7.81921V14.1808C0 15.615 0.767878 16.9395 2.01255 17.6521L7.61921 20.8621C8.85042 21.567 10.3629 21.567 11.5941 20.8621L17.2008 17.6521C18.4454 16.9395 19.2133 15.615 19.2133 14.1808V7.81921Z",
|
|
12263
|
+
fill: "#905C84"
|
|
12264
|
+
}
|
|
12265
|
+
),
|
|
12266
|
+
/* @__PURE__ */ jsx(
|
|
12267
|
+
"path",
|
|
12268
|
+
{
|
|
12269
|
+
d: "M9.68994 5.5V16.5023",
|
|
12270
|
+
stroke: "white",
|
|
12271
|
+
"stroke-width": "1.5",
|
|
12272
|
+
"stroke-linecap": "round",
|
|
12273
|
+
"stroke-linejoin": "round"
|
|
12274
|
+
}
|
|
12275
|
+
),
|
|
12276
|
+
/* @__PURE__ */ jsx(
|
|
12277
|
+
"path",
|
|
12278
|
+
{
|
|
12279
|
+
d: "M14.4542 8.25055L4.92627 13.7517",
|
|
12280
|
+
stroke: "white",
|
|
12281
|
+
"stroke-width": "1.5",
|
|
12282
|
+
"stroke-linecap": "round",
|
|
12283
|
+
"stroke-linejoin": "round"
|
|
12284
|
+
}
|
|
12285
|
+
),
|
|
12286
|
+
/* @__PURE__ */ jsx(
|
|
12287
|
+
"path",
|
|
12288
|
+
{
|
|
12289
|
+
d: "M4.92627 8.25055L14.4542 13.7517",
|
|
12290
|
+
stroke: "white",
|
|
12291
|
+
"stroke-width": "1.5",
|
|
12292
|
+
"stroke-linecap": "round",
|
|
12293
|
+
"stroke-linejoin": "round"
|
|
12294
|
+
}
|
|
12295
|
+
)
|
|
12296
|
+
]
|
|
12297
|
+
}
|
|
12298
|
+
) });
|
|
12299
|
+
};
|
|
12300
|
+
const BadgeImperativeSecondary = ({
|
|
12301
|
+
className
|
|
12302
|
+
}) => {
|
|
12303
|
+
return /* @__PURE__ */ jsx("div", { className: cn("size-6 flex items-center justify-center", className), children: /* @__PURE__ */ jsxs(
|
|
12304
|
+
"svg",
|
|
12305
|
+
{
|
|
12306
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12307
|
+
width: "20",
|
|
12308
|
+
height: "22",
|
|
12309
|
+
viewBox: "0 0 20 22",
|
|
12310
|
+
fill: "none",
|
|
12311
|
+
children: [
|
|
12312
|
+
/* @__PURE__ */ jsx(
|
|
12313
|
+
"path",
|
|
12314
|
+
{
|
|
12315
|
+
d: "M19.2133 7.81921C19.2133 6.38498 18.4454 5.06051 17.2008 4.3479L11.5941 1.13788C10.3629 0.432974 8.85042 0.432974 7.61921 1.13788L2.01255 4.3479C0.767878 5.06051 0 6.38498 0 7.81921V14.1808C0 15.615 0.767878 16.9395 2.01255 17.6521L7.61921 20.8621C8.85042 21.567 10.3629 21.567 11.5941 20.8621L17.2008 17.6521C18.4454 16.9395 19.2133 15.615 19.2133 14.1808V7.81921Z",
|
|
12316
|
+
fill: "#128BA6",
|
|
12317
|
+
"fill-opacity": "0.08"
|
|
12318
|
+
}
|
|
12319
|
+
),
|
|
12320
|
+
/* @__PURE__ */ jsx(
|
|
12321
|
+
"path",
|
|
12322
|
+
{
|
|
12323
|
+
d: "M7.86719 1.57227C8.9445 0.955469 10.2684 0.955469 11.3457 1.57227L16.9521 4.78223C18.0412 5.40577 18.7129 6.56439 18.7129 7.81934V14.1807C18.7129 15.4356 18.0412 16.5942 16.9521 17.2178L11.3457 20.4277C10.2684 21.0445 8.9445 21.0445 7.86719 20.4277L2.26074 17.2178C1.17187 16.5942 0.5 15.4355 0.5 14.1807V7.81934C0.5 6.56452 1.17187 5.40582 2.26074 4.78223L7.86719 1.57227Z",
|
|
12324
|
+
stroke: "#128BA6",
|
|
12325
|
+
"stroke-opacity": "0.16",
|
|
12326
|
+
"stroke-linecap": "round",
|
|
12327
|
+
"stroke-linejoin": "round"
|
|
12328
|
+
}
|
|
12329
|
+
),
|
|
12330
|
+
/* @__PURE__ */ jsx(
|
|
12331
|
+
"path",
|
|
12332
|
+
{
|
|
12333
|
+
d: "M9.68994 5.5V16.5023",
|
|
12334
|
+
stroke: "#0F748A",
|
|
12335
|
+
"stroke-width": "1.5",
|
|
12336
|
+
"stroke-linecap": "round",
|
|
12337
|
+
"stroke-linejoin": "round"
|
|
12338
|
+
}
|
|
12339
|
+
),
|
|
12340
|
+
/* @__PURE__ */ jsx(
|
|
12341
|
+
"path",
|
|
12342
|
+
{
|
|
12343
|
+
d: "M14.4542 8.25055L4.92627 13.7517",
|
|
12344
|
+
stroke: "#0F748A",
|
|
12345
|
+
"stroke-width": "1.5",
|
|
12346
|
+
"stroke-linecap": "round",
|
|
12347
|
+
"stroke-linejoin": "round"
|
|
12348
|
+
}
|
|
12349
|
+
),
|
|
12350
|
+
/* @__PURE__ */ jsx(
|
|
12351
|
+
"path",
|
|
12352
|
+
{
|
|
12353
|
+
d: "M4.92627 8.25055L14.4542 13.7517",
|
|
12354
|
+
stroke: "#0F748A",
|
|
12355
|
+
"stroke-width": "1.5",
|
|
12356
|
+
"stroke-linecap": "round",
|
|
12357
|
+
"stroke-linejoin": "round"
|
|
12358
|
+
}
|
|
12359
|
+
)
|
|
12360
|
+
]
|
|
12361
|
+
}
|
|
12362
|
+
) });
|
|
12363
|
+
};
|
|
12364
|
+
const SPRING_CONFIG = { stiffness: 300, damping: 30 };
|
|
12365
|
+
const MobileNavContext = createContext(null);
|
|
12366
|
+
const useMobileNav = () => {
|
|
12367
|
+
const ctx = useContext(MobileNavContext);
|
|
12368
|
+
if (!ctx)
|
|
12369
|
+
throw new Error(
|
|
12370
|
+
"MobileNav compound components must be used within <MobileNav>"
|
|
12371
|
+
);
|
|
12372
|
+
return ctx;
|
|
12373
|
+
};
|
|
12374
|
+
const MobileNav = ({ className, children }) => {
|
|
12375
|
+
const [activeKey, setActiveKey] = useState(null);
|
|
12376
|
+
const [open, setOpen] = useState(false);
|
|
12377
|
+
const toggle = useCallback(
|
|
12378
|
+
(key) => {
|
|
12379
|
+
if (activeKey === key && open) {
|
|
12380
|
+
setOpen(false);
|
|
12381
|
+
setActiveKey(null);
|
|
12382
|
+
} else {
|
|
12383
|
+
setActiveKey(key);
|
|
12384
|
+
setOpen(true);
|
|
12385
|
+
}
|
|
12386
|
+
},
|
|
12387
|
+
[activeKey, open]
|
|
12388
|
+
);
|
|
12389
|
+
const close = useCallback(() => {
|
|
12390
|
+
setOpen(false);
|
|
12391
|
+
setActiveKey(null);
|
|
12392
|
+
}, []);
|
|
12393
|
+
const value = useMemo(
|
|
12394
|
+
() => ({ activeKey, open, toggle, close }),
|
|
12395
|
+
[activeKey, open, toggle, close]
|
|
12396
|
+
);
|
|
12397
|
+
return /* @__PURE__ */ jsx(MobileNavContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { className: cn("mobile-nav", className), children }) });
|
|
12398
|
+
};
|
|
12399
|
+
const MobileNavPanel = ({ className, children }) => {
|
|
12400
|
+
const { activeKey, open, close } = useMobileNav();
|
|
12401
|
+
const panelRef = useRef(null);
|
|
12402
|
+
const contentRef = useRef(null);
|
|
12403
|
+
const heightMV = useMotionValue(0);
|
|
12404
|
+
const stopAnimation = useRef(null);
|
|
12405
|
+
const stateRef = useRef("closed");
|
|
12406
|
+
const cachedInitialHeight = useRef(0);
|
|
12407
|
+
const getNavBarHeight = () => {
|
|
12408
|
+
var _a;
|
|
12409
|
+
const nav = (_a = panelRef.current) == null ? void 0 : _a.nextElementSibling;
|
|
12410
|
+
return (nav == null ? void 0 : nav.offsetHeight) ?? 0;
|
|
12411
|
+
};
|
|
12412
|
+
const getAvailableHeight = () => {
|
|
12413
|
+
var _a;
|
|
12414
|
+
const parent = (_a = panelRef.current) == null ? void 0 : _a.parentElement;
|
|
12415
|
+
const container = (parent == null ? void 0 : parent.clientHeight) ?? window.innerHeight;
|
|
12416
|
+
return container - getNavBarHeight();
|
|
12417
|
+
};
|
|
12418
|
+
const measureContentHeight = () => {
|
|
12419
|
+
const content = contentRef.current;
|
|
12420
|
+
if (!content) return 0;
|
|
12421
|
+
const child = content.firstElementChild;
|
|
12422
|
+
const raw = ((child == null ? void 0 : child.offsetHeight) ?? content.scrollHeight) + 40;
|
|
12423
|
+
const max = getAvailableHeight() * 0.7;
|
|
12424
|
+
return Math.min(raw, max);
|
|
12425
|
+
};
|
|
12426
|
+
const springTo = (target) => {
|
|
12427
|
+
var _a;
|
|
12428
|
+
(_a = stopAnimation.current) == null ? void 0 : _a.call(stopAnimation);
|
|
12429
|
+
const controls = animate(heightMV, target, {
|
|
12430
|
+
type: "spring",
|
|
12431
|
+
...SPRING_CONFIG
|
|
12432
|
+
});
|
|
12433
|
+
stopAnimation.current = () => controls.stop();
|
|
12434
|
+
};
|
|
12435
|
+
useEffect(() => {
|
|
12436
|
+
let cancelled = false;
|
|
12437
|
+
if (open) {
|
|
12438
|
+
stateRef.current = "initial";
|
|
12439
|
+
requestAnimationFrame(() => {
|
|
12440
|
+
if (cancelled) return;
|
|
12441
|
+
const h = measureContentHeight();
|
|
12442
|
+
cachedInitialHeight.current = h;
|
|
12443
|
+
springTo(h);
|
|
12444
|
+
});
|
|
12445
|
+
} else {
|
|
12446
|
+
stateRef.current = "closed";
|
|
12447
|
+
cachedInitialHeight.current = 0;
|
|
12448
|
+
springTo(0);
|
|
12449
|
+
}
|
|
12450
|
+
return () => {
|
|
12451
|
+
cancelled = true;
|
|
12452
|
+
};
|
|
12453
|
+
}, [open]);
|
|
12454
|
+
useEffect(() => {
|
|
12455
|
+
if (!open) return;
|
|
12456
|
+
let cancelled = false;
|
|
12457
|
+
requestAnimationFrame(() => {
|
|
12458
|
+
requestAnimationFrame(() => {
|
|
12459
|
+
if (cancelled) return;
|
|
12460
|
+
const h = measureContentHeight();
|
|
12461
|
+
cachedInitialHeight.current = h;
|
|
12462
|
+
if (stateRef.current === "initial" || stateRef.current === "closed") {
|
|
12463
|
+
stateRef.current = "initial";
|
|
12464
|
+
springTo(h);
|
|
12465
|
+
}
|
|
12466
|
+
});
|
|
12467
|
+
});
|
|
12468
|
+
return () => {
|
|
12469
|
+
cancelled = true;
|
|
12470
|
+
};
|
|
12471
|
+
}, [activeKey]);
|
|
12472
|
+
const dragDirection = useRef(null);
|
|
12473
|
+
const handlePanStart = () => {
|
|
12474
|
+
dragDirection.current = null;
|
|
12475
|
+
};
|
|
12476
|
+
const handlePan = (_, info) => {
|
|
12477
|
+
dragDirection.current = info.offset.y < 0 ? "up" : "down";
|
|
12478
|
+
};
|
|
12479
|
+
const handlePanEnd = () => {
|
|
12480
|
+
const dir = dragDirection.current;
|
|
12481
|
+
if (!dir) return;
|
|
12482
|
+
if (dir === "up") {
|
|
12483
|
+
if (stateRef.current === "initial") {
|
|
12484
|
+
stateRef.current = "full";
|
|
12485
|
+
springTo(getAvailableHeight());
|
|
12486
|
+
}
|
|
12487
|
+
} else {
|
|
12488
|
+
if (stateRef.current === "full") {
|
|
12489
|
+
stateRef.current = "initial";
|
|
12490
|
+
springTo(cachedInitialHeight.current);
|
|
12491
|
+
} else if (stateRef.current === "initial") {
|
|
12492
|
+
stateRef.current = "closed";
|
|
12493
|
+
springTo(0);
|
|
12494
|
+
close();
|
|
12495
|
+
}
|
|
12496
|
+
}
|
|
12497
|
+
};
|
|
12498
|
+
return /* @__PURE__ */ jsxs(
|
|
12499
|
+
motion.div,
|
|
12500
|
+
{
|
|
12501
|
+
ref: panelRef,
|
|
12502
|
+
className: cn("mobile-nav-panel", className),
|
|
12503
|
+
"data-closed": !open || void 0,
|
|
12504
|
+
style: { height: heightMV },
|
|
12505
|
+
children: [
|
|
12506
|
+
/* @__PURE__ */ jsx(
|
|
12507
|
+
motion.div,
|
|
12508
|
+
{
|
|
12509
|
+
className: "mobile-nav-handle",
|
|
12510
|
+
onPanStart: handlePanStart,
|
|
12511
|
+
onPan: handlePan,
|
|
12512
|
+
onPanEnd: handlePanEnd,
|
|
12513
|
+
children: /* @__PURE__ */ jsx("div", { className: "mobile-nav-handle-bar" })
|
|
12514
|
+
}
|
|
12515
|
+
),
|
|
12516
|
+
/* @__PURE__ */ jsx("div", { ref: contentRef, className: "mobile-nav-content", children: activeKey ? children(activeKey) : null })
|
|
12517
|
+
]
|
|
12518
|
+
}
|
|
12519
|
+
);
|
|
12520
|
+
};
|
|
12521
|
+
const MobileNavBar = ({ className, children }) => /* @__PURE__ */ jsx("nav", { className: cn("mobile-nav-bar", className), children: /* @__PURE__ */ jsx("div", { className: "mobile-nav-bar-inner", children }) });
|
|
12522
|
+
const MobileNavTrigger = ({
|
|
12523
|
+
value,
|
|
12524
|
+
children,
|
|
12525
|
+
label,
|
|
12526
|
+
onAction,
|
|
12527
|
+
className
|
|
12528
|
+
}) => {
|
|
12529
|
+
const { activeKey, open, toggle, close } = useMobileNav();
|
|
12530
|
+
const handleClick = () => {
|
|
12531
|
+
if (onAction) {
|
|
12532
|
+
if (open) close();
|
|
12533
|
+
onAction();
|
|
12534
|
+
} else {
|
|
12535
|
+
toggle(value);
|
|
12536
|
+
}
|
|
12537
|
+
};
|
|
12538
|
+
return /* @__PURE__ */ jsx(
|
|
12539
|
+
"button",
|
|
12540
|
+
{
|
|
12541
|
+
onClick: handleClick,
|
|
12542
|
+
"data-active": activeKey === value || void 0,
|
|
12543
|
+
className: cn("mobile-nav-trigger group", className),
|
|
12544
|
+
"aria-label": label,
|
|
12545
|
+
children
|
|
12546
|
+
}
|
|
12547
|
+
);
|
|
12548
|
+
};
|
|
12149
12549
|
const X = ({ className = "", color = "#71747D" }) => {
|
|
12150
12550
|
return /* @__PURE__ */ jsxs(
|
|
12151
12551
|
"svg",
|
|
@@ -12797,6 +13197,8 @@ export {
|
|
|
12797
13197
|
BadgeCertificationPlatinum,
|
|
12798
13198
|
BadgeCertificationSilver,
|
|
12799
13199
|
BadgeEnterpriseProvider,
|
|
13200
|
+
BadgeImperativePrimary,
|
|
13201
|
+
BadgeImperativeSecondary,
|
|
12800
13202
|
BadgePerformanceTestingProvider,
|
|
12801
13203
|
BadgeProductProvider,
|
|
12802
13204
|
BadgeRatingCoworking,
|
|
@@ -12938,6 +13340,10 @@ export {
|
|
|
12938
13340
|
MenubarSubContent,
|
|
12939
13341
|
MenubarSubTrigger,
|
|
12940
13342
|
MenubarTrigger,
|
|
13343
|
+
MobileNav,
|
|
13344
|
+
MobileNavBar,
|
|
13345
|
+
MobileNavPanel,
|
|
13346
|
+
MobileNavTrigger,
|
|
12941
13347
|
NavAccount,
|
|
12942
13348
|
NavBullet,
|
|
12943
13349
|
NavLogo,
|
|
@@ -13084,12 +13490,14 @@ export {
|
|
|
13084
13490
|
UtilityCompare,
|
|
13085
13491
|
UtilityDrag,
|
|
13086
13492
|
UtilityEdit,
|
|
13493
|
+
UtilityFeedback,
|
|
13087
13494
|
UtilityHome,
|
|
13088
13495
|
UtilityMessage,
|
|
13089
13496
|
UtilityOptions,
|
|
13090
13497
|
UtilityPortfolio,
|
|
13091
13498
|
UtilityReset,
|
|
13092
13499
|
UtilityRevisionsHide,
|
|
13500
|
+
UtilityRevisionsShow,
|
|
13093
13501
|
UtilitySave,
|
|
13094
13502
|
UtilityScopeLarge,
|
|
13095
13503
|
UtilityScoring,
|