aidos-ui 5.0.0 → 5.0.2
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/dist/index.d.ts +12 -2
- package/dist/index.js +326 -197
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React34, { useState, useId, useContext, useMemo, cloneElement, useRef, useEffect, useCallback, useSyncExternalStore, createContext, startTransition } from 'react';
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { Icon as Icon$1 } from '@iconify/react';
|
|
4
4
|
|
|
5
|
-
// src/
|
|
5
|
+
// src/Avatar.tsx
|
|
6
6
|
|
|
7
7
|
// src/hash.ts
|
|
8
8
|
function hash(source, modulus) {
|
|
@@ -604,9 +604,9 @@ var styles = {
|
|
|
604
604
|
flexShrink: 1
|
|
605
605
|
}
|
|
606
606
|
};
|
|
607
|
-
var BaseView =
|
|
607
|
+
var BaseView = React34.forwardRef(function BaseView2({ jss, children, tag, grow, shrink, relative, ...otherProps }, ref) {
|
|
608
608
|
const Tag = tag ?? "div";
|
|
609
|
-
return
|
|
609
|
+
return React34.createElement(
|
|
610
610
|
Tag,
|
|
611
611
|
{
|
|
612
612
|
...otherProps,
|
|
@@ -621,6 +621,279 @@ var BaseView = React33.forwardRef(function BaseView2({ jss, children, tag, grow,
|
|
|
621
621
|
children
|
|
622
622
|
);
|
|
623
623
|
});
|
|
624
|
+
var styles2 = {
|
|
625
|
+
root: {
|
|
626
|
+
display: "flex",
|
|
627
|
+
justifyContent: "center",
|
|
628
|
+
alignItems: "center",
|
|
629
|
+
" svg": {
|
|
630
|
+
height: "inherit",
|
|
631
|
+
width: "inherit"
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
xsmall: {
|
|
635
|
+
height: 8,
|
|
636
|
+
width: 8
|
|
637
|
+
},
|
|
638
|
+
small: {
|
|
639
|
+
height: 12,
|
|
640
|
+
width: 12
|
|
641
|
+
},
|
|
642
|
+
medium: {
|
|
643
|
+
height: 18,
|
|
644
|
+
width: 18
|
|
645
|
+
},
|
|
646
|
+
large: {
|
|
647
|
+
height: 24,
|
|
648
|
+
width: 24
|
|
649
|
+
},
|
|
650
|
+
xlarge: {
|
|
651
|
+
height: 32,
|
|
652
|
+
width: 32
|
|
653
|
+
},
|
|
654
|
+
xxlarge: {
|
|
655
|
+
height: 48,
|
|
656
|
+
width: 48
|
|
657
|
+
},
|
|
658
|
+
xxxlarge: {
|
|
659
|
+
height: 64,
|
|
660
|
+
width: 64
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
function Icon({
|
|
664
|
+
icon,
|
|
665
|
+
size,
|
|
666
|
+
color,
|
|
667
|
+
ariaLabel
|
|
668
|
+
}) {
|
|
669
|
+
return /* @__PURE__ */ jsx(
|
|
670
|
+
BaseView,
|
|
671
|
+
{
|
|
672
|
+
"aria-label": ariaLabel,
|
|
673
|
+
jss: [
|
|
674
|
+
styles2.root,
|
|
675
|
+
size === "xsmall" && styles2.xsmall,
|
|
676
|
+
size === "small" && styles2.small,
|
|
677
|
+
size === "medium" && styles2.medium,
|
|
678
|
+
size === "large" && styles2.large,
|
|
679
|
+
size === "xlarge" && styles2.xlarge,
|
|
680
|
+
size === "xxlarge" && styles2.xxlarge,
|
|
681
|
+
size === "xxxlarge" && styles2.xxxlarge,
|
|
682
|
+
getTextColor(color)
|
|
683
|
+
],
|
|
684
|
+
children: /* @__PURE__ */ jsx(Icon$1, { icon: `lucide:${icon}`, width: "100%", height: "100%" })
|
|
685
|
+
}
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// src/typography.ts
|
|
690
|
+
var fontSize = {
|
|
691
|
+
xsmall: cssVar("--font-xsmall"),
|
|
692
|
+
small: cssVar("--font-small"),
|
|
693
|
+
medium: cssVar("--font-medium"),
|
|
694
|
+
large: cssVar("--font-large"),
|
|
695
|
+
xlarge: cssVar("--font-xlarge"),
|
|
696
|
+
xxlarge: cssVar("--font-xxlarge"),
|
|
697
|
+
xxxlarge: cssVar("--font-xxxlarge")
|
|
698
|
+
};
|
|
699
|
+
var lineHeight = {
|
|
700
|
+
xsmall: 14 / 10,
|
|
701
|
+
small: 16 / 12,
|
|
702
|
+
medium: 20 / 14,
|
|
703
|
+
large: 24 / 18,
|
|
704
|
+
xlarge: 28 / 22,
|
|
705
|
+
xxlarge: 34 / 28,
|
|
706
|
+
xxxlarge: 42 / 36
|
|
707
|
+
};
|
|
708
|
+
function getTypography(size) {
|
|
709
|
+
return {
|
|
710
|
+
fontSize: fontSize[size],
|
|
711
|
+
lineHeight: lineHeight[size]
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
function Text({
|
|
715
|
+
children,
|
|
716
|
+
color = "primary",
|
|
717
|
+
size = "medium",
|
|
718
|
+
align = "none",
|
|
719
|
+
bold = false,
|
|
720
|
+
ellipsis = "default",
|
|
721
|
+
grow,
|
|
722
|
+
type: Type = "span",
|
|
723
|
+
jss,
|
|
724
|
+
htmlFor,
|
|
725
|
+
...elementProps
|
|
726
|
+
}) {
|
|
727
|
+
if (ellipsis === "default") {
|
|
728
|
+
ellipsis = Type === "span" || Type === "label";
|
|
729
|
+
}
|
|
730
|
+
const isHeading = Type === "h1" || Type === "h2" || Type === "h3" || Type === "h4";
|
|
731
|
+
const className = toClassnames([
|
|
732
|
+
getTextColor(color),
|
|
733
|
+
{ ...getTypography(size), padding: 0, margin: 0 },
|
|
734
|
+
isHeading && { fontWeight: "inherit" },
|
|
735
|
+
bold && { fontWeight: 600 },
|
|
736
|
+
align === "center" && { textAlign: "center" },
|
|
737
|
+
ellipsis && {
|
|
738
|
+
overflow: "hidden",
|
|
739
|
+
textOverflow: "ellipsis",
|
|
740
|
+
whiteSpace: "nowrap"
|
|
741
|
+
},
|
|
742
|
+
grow && { flexGrow: 1 },
|
|
743
|
+
jss
|
|
744
|
+
]);
|
|
745
|
+
return /* @__PURE__ */ jsx(Type, { ...elementProps, className, htmlFor, children });
|
|
746
|
+
}
|
|
747
|
+
function Label({ size = "medium", type = "label", ...rest }) {
|
|
748
|
+
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
749
|
+
}
|
|
750
|
+
function Span({ size = "medium", type = "span", ...rest }) {
|
|
751
|
+
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
752
|
+
}
|
|
753
|
+
function P({ size = "medium", type = "p", ...rest }) {
|
|
754
|
+
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
755
|
+
}
|
|
756
|
+
function H1({ size = "xxlarge", type = "h1", ...rest }) {
|
|
757
|
+
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
758
|
+
}
|
|
759
|
+
function H2({ size = "xlarge", type = "h2", ...rest }) {
|
|
760
|
+
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
761
|
+
}
|
|
762
|
+
function H3({ size = "large", type = "h3", ...rest }) {
|
|
763
|
+
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
764
|
+
}
|
|
765
|
+
function H4({ size = "medium", type = "h4", ...rest }) {
|
|
766
|
+
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
767
|
+
}
|
|
768
|
+
function Li({ size = "medium", type = "li", ...rest }) {
|
|
769
|
+
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
770
|
+
}
|
|
771
|
+
var dimensions = {
|
|
772
|
+
small: 24,
|
|
773
|
+
medium: 34,
|
|
774
|
+
large: 48
|
|
775
|
+
};
|
|
776
|
+
var textSizes = {
|
|
777
|
+
small: "small",
|
|
778
|
+
medium: "medium",
|
|
779
|
+
large: "large"
|
|
780
|
+
};
|
|
781
|
+
function normalizeName(name) {
|
|
782
|
+
return name.normalize("NFKC").trim();
|
|
783
|
+
}
|
|
784
|
+
function getInitial(name) {
|
|
785
|
+
const normalized = normalizeName(name);
|
|
786
|
+
if (normalized === "") return null;
|
|
787
|
+
const meaningfulCharacter = normalized.match(/[\p{L}\p{N}]/u)?.[0];
|
|
788
|
+
const character = meaningfulCharacter ?? Array.from(normalized)[0];
|
|
789
|
+
return Array.from(character.toLocaleUpperCase())[0] ?? null;
|
|
790
|
+
}
|
|
791
|
+
function getGradient(name) {
|
|
792
|
+
const seed = hash(normalizeName(name).toLocaleLowerCase());
|
|
793
|
+
const firstHue = seed % 360;
|
|
794
|
+
const secondHue = (firstHue + 35 + seed % 55) % 360;
|
|
795
|
+
return `radial-gradient(circle at 24% 18%, hsl(${secondHue} 68% 58%), transparent 54%), linear-gradient(145deg, hsl(${firstHue} 62% 48%), hsl(${secondHue} 58% 38%))`;
|
|
796
|
+
}
|
|
797
|
+
var Avatar = React34.forwardRef(function Avatar2({ name, src, size = "medium", badge, jss }, ref) {
|
|
798
|
+
const [failedSrc, setFailedSrc] = useState();
|
|
799
|
+
const dimension = dimensions[size];
|
|
800
|
+
const initial = getInitial(name);
|
|
801
|
+
const showImage = src != null && src !== "" && failedSrc !== src;
|
|
802
|
+
return /* @__PURE__ */ jsxs(
|
|
803
|
+
BaseView,
|
|
804
|
+
{
|
|
805
|
+
ref,
|
|
806
|
+
tag: "span",
|
|
807
|
+
role: "img",
|
|
808
|
+
"aria-label": name || "User",
|
|
809
|
+
jss: [
|
|
810
|
+
{
|
|
811
|
+
position: "relative",
|
|
812
|
+
display: "inline-flex",
|
|
813
|
+
width: dimension,
|
|
814
|
+
height: dimension,
|
|
815
|
+
flex: `0 0 ${dimension}px`,
|
|
816
|
+
verticalAlign: "middle"
|
|
817
|
+
},
|
|
818
|
+
jss
|
|
819
|
+
],
|
|
820
|
+
children: [
|
|
821
|
+
/* @__PURE__ */ jsxs(
|
|
822
|
+
BaseView,
|
|
823
|
+
{
|
|
824
|
+
tag: "span",
|
|
825
|
+
jss: {
|
|
826
|
+
position: "relative",
|
|
827
|
+
display: "flex",
|
|
828
|
+
width: "100%",
|
|
829
|
+
height: "100%",
|
|
830
|
+
alignItems: "center",
|
|
831
|
+
justifyContent: "center",
|
|
832
|
+
overflow: "hidden",
|
|
833
|
+
borderRadius: "50%",
|
|
834
|
+
background: getGradient(name),
|
|
835
|
+
color: cssVar("--light-text"),
|
|
836
|
+
userSelect: "none"
|
|
837
|
+
},
|
|
838
|
+
children: [
|
|
839
|
+
initial == null ? /* @__PURE__ */ jsx(Icon, { icon: "user", size: textSizes[size], color: "light" }) : /* @__PURE__ */ jsx(
|
|
840
|
+
Span,
|
|
841
|
+
{
|
|
842
|
+
size: textSizes[size],
|
|
843
|
+
color: "light",
|
|
844
|
+
bold: true,
|
|
845
|
+
"aria-hidden": "true",
|
|
846
|
+
jss: { lineHeight: 1, textShadow: "0 1px 2px rgba(0, 0, 0, 0.2)" },
|
|
847
|
+
children: initial
|
|
848
|
+
}
|
|
849
|
+
),
|
|
850
|
+
showImage && /* @__PURE__ */ jsx(
|
|
851
|
+
"img",
|
|
852
|
+
{
|
|
853
|
+
ref: (image) => {
|
|
854
|
+
if (image?.complete && image.naturalWidth === 0) {
|
|
855
|
+
setFailedSrc(src);
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
src,
|
|
859
|
+
alt: "",
|
|
860
|
+
draggable: false,
|
|
861
|
+
onError: () => setFailedSrc(src),
|
|
862
|
+
style: {
|
|
863
|
+
position: "absolute",
|
|
864
|
+
inset: 0,
|
|
865
|
+
width: "100%",
|
|
866
|
+
height: "100%",
|
|
867
|
+
objectFit: "cover"
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
src
|
|
871
|
+
)
|
|
872
|
+
]
|
|
873
|
+
}
|
|
874
|
+
),
|
|
875
|
+
badge != null && /* @__PURE__ */ jsx(
|
|
876
|
+
BaseView,
|
|
877
|
+
{
|
|
878
|
+
tag: "span",
|
|
879
|
+
"aria-hidden": "true",
|
|
880
|
+
jss: {
|
|
881
|
+
position: "absolute",
|
|
882
|
+
right: 0,
|
|
883
|
+
bottom: 0,
|
|
884
|
+
display: "flex",
|
|
885
|
+
borderRadius: "50%",
|
|
886
|
+
boxShadow: `0 0 0 2px ${cssVar("--overlay-background")}`,
|
|
887
|
+
pointerEvents: "none"
|
|
888
|
+
},
|
|
889
|
+
children: badge
|
|
890
|
+
}
|
|
891
|
+
)
|
|
892
|
+
]
|
|
893
|
+
}
|
|
894
|
+
);
|
|
895
|
+
});
|
|
896
|
+
Avatar.displayName = "Avatar";
|
|
624
897
|
var sizes2 = {
|
|
625
898
|
xsmall: 4,
|
|
626
899
|
small: 6,
|
|
@@ -652,7 +925,7 @@ function Badge({
|
|
|
652
925
|
}
|
|
653
926
|
|
|
654
927
|
// src/Interactable.tsx
|
|
655
|
-
var
|
|
928
|
+
var styles3 = {
|
|
656
929
|
root: {
|
|
657
930
|
cursor: "pointer",
|
|
658
931
|
display: "inline-flex",
|
|
@@ -725,18 +998,18 @@ function getInteractableJSS({
|
|
|
725
998
|
border
|
|
726
999
|
}) {
|
|
727
1000
|
return [
|
|
728
|
-
|
|
729
|
-
color === "primary" &&
|
|
730
|
-
color === "secondary" &&
|
|
731
|
-
color === "negative" &&
|
|
732
|
-
color === "inverse" &&
|
|
1001
|
+
styles3.root,
|
|
1002
|
+
color === "primary" && styles3.primary,
|
|
1003
|
+
color === "secondary" && styles3.secondary,
|
|
1004
|
+
color === "negative" && styles3.negative,
|
|
1005
|
+
color === "inverse" && styles3.inverse,
|
|
733
1006
|
border && {
|
|
734
1007
|
border: `1px solid ${getCSSColor(color, disabled, bare)}`
|
|
735
1008
|
},
|
|
736
|
-
bare &&
|
|
737
|
-
disabled &&
|
|
1009
|
+
bare && styles3.bare,
|
|
1010
|
+
disabled && styles3.disabled,
|
|
738
1011
|
!bare && !disabled && { boxShadow: cssVar("--shadow-sm") },
|
|
739
|
-
|
|
1012
|
+
styles3.opacityHover,
|
|
740
1013
|
animateInteraction && !disabled && {
|
|
741
1014
|
position: "relative",
|
|
742
1015
|
":active": {
|
|
@@ -790,6 +1063,9 @@ var getInteractableListItemJSS = ({
|
|
|
790
1063
|
flexGrow: 1,
|
|
791
1064
|
borderRadius: cssVar("--border-radius-m"),
|
|
792
1065
|
textDecoration: "none",
|
|
1066
|
+
":focus-visible": {
|
|
1067
|
+
outlineOffset: -2
|
|
1068
|
+
},
|
|
793
1069
|
":hover": {
|
|
794
1070
|
backgroundColor: cssVar("--hovered-background")
|
|
795
1071
|
},
|
|
@@ -814,7 +1090,7 @@ var getInteractableListItemJSS = ({
|
|
|
814
1090
|
}
|
|
815
1091
|
];
|
|
816
1092
|
};
|
|
817
|
-
var BaseButton =
|
|
1093
|
+
var BaseButton = React34.forwardRef(function BaseButton2({
|
|
818
1094
|
onClick,
|
|
819
1095
|
children,
|
|
820
1096
|
jss,
|
|
@@ -855,90 +1131,7 @@ var BaseButton = React33.forwardRef(function BaseButton2({
|
|
|
855
1131
|
}
|
|
856
1132
|
);
|
|
857
1133
|
});
|
|
858
|
-
|
|
859
|
-
// src/typography.ts
|
|
860
|
-
var fontSize = {
|
|
861
|
-
xsmall: cssVar("--font-xsmall"),
|
|
862
|
-
small: cssVar("--font-small"),
|
|
863
|
-
medium: cssVar("--font-medium"),
|
|
864
|
-
large: cssVar("--font-large"),
|
|
865
|
-
xlarge: cssVar("--font-xlarge"),
|
|
866
|
-
xxlarge: cssVar("--font-xxlarge"),
|
|
867
|
-
xxxlarge: cssVar("--font-xxxlarge")
|
|
868
|
-
};
|
|
869
|
-
var lineHeight = {
|
|
870
|
-
xsmall: 14 / 10,
|
|
871
|
-
small: 16 / 12,
|
|
872
|
-
medium: 20 / 14,
|
|
873
|
-
large: 24 / 18,
|
|
874
|
-
xlarge: 28 / 22,
|
|
875
|
-
xxlarge: 34 / 28,
|
|
876
|
-
xxxlarge: 42 / 36
|
|
877
|
-
};
|
|
878
|
-
function getTypography(size) {
|
|
879
|
-
return {
|
|
880
|
-
fontSize: fontSize[size],
|
|
881
|
-
lineHeight: lineHeight[size]
|
|
882
|
-
};
|
|
883
|
-
}
|
|
884
|
-
function Text({
|
|
885
|
-
children,
|
|
886
|
-
color = "primary",
|
|
887
|
-
size = "medium",
|
|
888
|
-
align = "none",
|
|
889
|
-
bold = false,
|
|
890
|
-
ellipsis = "default",
|
|
891
|
-
grow,
|
|
892
|
-
type: Type = "span",
|
|
893
|
-
jss,
|
|
894
|
-
htmlFor,
|
|
895
|
-
...elementProps
|
|
896
|
-
}) {
|
|
897
|
-
if (ellipsis === "default") {
|
|
898
|
-
ellipsis = Type === "span" || Type === "label";
|
|
899
|
-
}
|
|
900
|
-
const isHeading = Type === "h1" || Type === "h2" || Type === "h3" || Type === "h4";
|
|
901
|
-
const className = toClassnames([
|
|
902
|
-
getTextColor(color),
|
|
903
|
-
{ ...getTypography(size), padding: 0, margin: 0 },
|
|
904
|
-
isHeading && { fontWeight: "inherit" },
|
|
905
|
-
bold && { fontWeight: 600 },
|
|
906
|
-
align === "center" && { textAlign: "center" },
|
|
907
|
-
ellipsis && {
|
|
908
|
-
overflow: "hidden",
|
|
909
|
-
textOverflow: "ellipsis",
|
|
910
|
-
whiteSpace: "nowrap"
|
|
911
|
-
},
|
|
912
|
-
grow && { flexGrow: 1 },
|
|
913
|
-
jss
|
|
914
|
-
]);
|
|
915
|
-
return /* @__PURE__ */ jsx(Type, { ...elementProps, className, htmlFor, children });
|
|
916
|
-
}
|
|
917
|
-
function Label({ size = "medium", type = "label", ...rest }) {
|
|
918
|
-
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
919
|
-
}
|
|
920
|
-
function Span({ size = "medium", type = "span", ...rest }) {
|
|
921
|
-
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
922
|
-
}
|
|
923
|
-
function P({ size = "medium", type = "p", ...rest }) {
|
|
924
|
-
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
925
|
-
}
|
|
926
|
-
function H1({ size = "xxlarge", type = "h1", ...rest }) {
|
|
927
|
-
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
928
|
-
}
|
|
929
|
-
function H2({ size = "xlarge", type = "h2", ...rest }) {
|
|
930
|
-
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
931
|
-
}
|
|
932
|
-
function H3({ size = "large", type = "h3", ...rest }) {
|
|
933
|
-
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
934
|
-
}
|
|
935
|
-
function H4({ size = "medium", type = "h4", ...rest }) {
|
|
936
|
-
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
937
|
-
}
|
|
938
|
-
function Li({ size = "medium", type = "li", ...rest }) {
|
|
939
|
-
return /* @__PURE__ */ jsx(Text, { size, type, ...rest });
|
|
940
|
-
}
|
|
941
|
-
var BaseInput = React33.forwardRef(function BaseInput2({
|
|
1134
|
+
var BaseInput = React34.forwardRef(function BaseInput2({
|
|
942
1135
|
jss,
|
|
943
1136
|
label,
|
|
944
1137
|
labelPosition = "end",
|
|
@@ -971,8 +1164,8 @@ var BaseInput = React33.forwardRef(function BaseInput2({
|
|
|
971
1164
|
label && labelPosition === "end" && labelElement
|
|
972
1165
|
] });
|
|
973
1166
|
});
|
|
974
|
-
var BaseLinkComponentOverrideContext =
|
|
975
|
-
var BaseLink =
|
|
1167
|
+
var BaseLinkComponentOverrideContext = React34.createContext((props) => /* @__PURE__ */ jsx("a", { ...props }));
|
|
1168
|
+
var BaseLink = React34.forwardRef(function BaseLink2({
|
|
976
1169
|
onClick,
|
|
977
1170
|
children,
|
|
978
1171
|
jss,
|
|
@@ -1017,7 +1210,7 @@ var BaseLink = React33.forwardRef(function BaseLink2({
|
|
|
1017
1210
|
}
|
|
1018
1211
|
);
|
|
1019
1212
|
});
|
|
1020
|
-
var FlexLayout =
|
|
1213
|
+
var FlexLayout = React34.forwardRef(function FlexLayout2({
|
|
1021
1214
|
jss,
|
|
1022
1215
|
gap = "none",
|
|
1023
1216
|
justify = "none",
|
|
@@ -1045,10 +1238,10 @@ var FlexLayout = React33.forwardRef(function FlexLayout2({
|
|
|
1045
1238
|
}
|
|
1046
1239
|
);
|
|
1047
1240
|
});
|
|
1048
|
-
var Column =
|
|
1241
|
+
var Column = React34.forwardRef(function Column2(props, ref) {
|
|
1049
1242
|
return /* @__PURE__ */ jsx(FlexLayout, { ref, direction: "column", ...props });
|
|
1050
1243
|
});
|
|
1051
|
-
var BaseList =
|
|
1244
|
+
var BaseList = React34.forwardRef(function BaseList2({ jss, ...otherProps }, ref) {
|
|
1052
1245
|
return /* @__PURE__ */ jsx(
|
|
1053
1246
|
Column,
|
|
1054
1247
|
{
|
|
@@ -1069,10 +1262,10 @@ var BaseList = React33.forwardRef(function BaseList2({ jss, ...otherProps }, ref
|
|
|
1069
1262
|
}
|
|
1070
1263
|
);
|
|
1071
1264
|
});
|
|
1072
|
-
var BaseListAddOn =
|
|
1265
|
+
var BaseListAddOn = React34.forwardRef(function BaseListAddOn2(props, ref) {
|
|
1073
1266
|
return /* @__PURE__ */ jsx(BaseView, { ...props, ref });
|
|
1074
1267
|
});
|
|
1075
|
-
var Row =
|
|
1268
|
+
var Row = React34.forwardRef(function Row2(props, ref) {
|
|
1076
1269
|
return /* @__PURE__ */ jsx(FlexLayout, { ref, direction: "row", ...props });
|
|
1077
1270
|
});
|
|
1078
1271
|
function TextPairing({
|
|
@@ -1157,7 +1350,7 @@ function TextPairing({
|
|
|
1157
1350
|
}
|
|
1158
1351
|
return textElement;
|
|
1159
1352
|
}
|
|
1160
|
-
var BaseListItem =
|
|
1353
|
+
var BaseListItem = React34.forwardRef(function BaseListItem2({
|
|
1161
1354
|
children,
|
|
1162
1355
|
jss,
|
|
1163
1356
|
headline,
|
|
@@ -1227,71 +1420,7 @@ function Box({
|
|
|
1227
1420
|
}
|
|
1228
1421
|
);
|
|
1229
1422
|
}
|
|
1230
|
-
var
|
|
1231
|
-
root: {
|
|
1232
|
-
display: "flex",
|
|
1233
|
-
justifyContent: "center",
|
|
1234
|
-
alignItems: "center",
|
|
1235
|
-
" svg": {
|
|
1236
|
-
height: "inherit",
|
|
1237
|
-
width: "inherit"
|
|
1238
|
-
}
|
|
1239
|
-
},
|
|
1240
|
-
xsmall: {
|
|
1241
|
-
height: 8,
|
|
1242
|
-
width: 8
|
|
1243
|
-
},
|
|
1244
|
-
small: {
|
|
1245
|
-
height: 12,
|
|
1246
|
-
width: 12
|
|
1247
|
-
},
|
|
1248
|
-
medium: {
|
|
1249
|
-
height: 18,
|
|
1250
|
-
width: 18
|
|
1251
|
-
},
|
|
1252
|
-
large: {
|
|
1253
|
-
height: 24,
|
|
1254
|
-
width: 24
|
|
1255
|
-
},
|
|
1256
|
-
xlarge: {
|
|
1257
|
-
height: 32,
|
|
1258
|
-
width: 32
|
|
1259
|
-
},
|
|
1260
|
-
xxlarge: {
|
|
1261
|
-
height: 48,
|
|
1262
|
-
width: 48
|
|
1263
|
-
},
|
|
1264
|
-
xxxlarge: {
|
|
1265
|
-
height: 64,
|
|
1266
|
-
width: 64
|
|
1267
|
-
}
|
|
1268
|
-
};
|
|
1269
|
-
function Icon({
|
|
1270
|
-
icon,
|
|
1271
|
-
size,
|
|
1272
|
-
color,
|
|
1273
|
-
ariaLabel
|
|
1274
|
-
}) {
|
|
1275
|
-
return /* @__PURE__ */ jsx(
|
|
1276
|
-
BaseView,
|
|
1277
|
-
{
|
|
1278
|
-
"aria-label": ariaLabel,
|
|
1279
|
-
jss: [
|
|
1280
|
-
styles3.root,
|
|
1281
|
-
size === "xsmall" && styles3.xsmall,
|
|
1282
|
-
size === "small" && styles3.small,
|
|
1283
|
-
size === "medium" && styles3.medium,
|
|
1284
|
-
size === "large" && styles3.large,
|
|
1285
|
-
size === "xlarge" && styles3.xlarge,
|
|
1286
|
-
size === "xxlarge" && styles3.xxlarge,
|
|
1287
|
-
size === "xxxlarge" && styles3.xxxlarge,
|
|
1288
|
-
getTextColor(color)
|
|
1289
|
-
],
|
|
1290
|
-
children: /* @__PURE__ */ jsx(Icon$1, { icon: `lucide:${icon}`, width: "100%", height: "100%" })
|
|
1291
|
-
}
|
|
1292
|
-
);
|
|
1293
|
-
}
|
|
1294
|
-
var Button = React33.forwardRef(function Button2({
|
|
1423
|
+
var Button = React34.forwardRef(function Button2({
|
|
1295
1424
|
children,
|
|
1296
1425
|
color,
|
|
1297
1426
|
bare,
|
|
@@ -1561,7 +1690,7 @@ var THU = dateFormatter.format(new Date(2e3, 1, 10));
|
|
|
1561
1690
|
var FRI = dateFormatter.format(new Date(2e3, 1, 11));
|
|
1562
1691
|
var SAT = dateFormatter.format(new Date(2e3, 1, 12));
|
|
1563
1692
|
var SUN = dateFormatter.format(new Date(2e3, 1, 13));
|
|
1564
|
-
var Calendar =
|
|
1693
|
+
var Calendar = React34.forwardRef(function Calendar2({
|
|
1565
1694
|
date,
|
|
1566
1695
|
cell,
|
|
1567
1696
|
header,
|
|
@@ -1814,7 +1943,7 @@ function Circle({
|
|
|
1814
1943
|
}
|
|
1815
1944
|
);
|
|
1816
1945
|
}
|
|
1817
|
-
var IconButton =
|
|
1946
|
+
var IconButton = React34.forwardRef(function IconButton2({ icon, color, bare, disabled, jss, label, ...buttonProps }, ref) {
|
|
1818
1947
|
return /* @__PURE__ */ jsxs(
|
|
1819
1948
|
BaseButton,
|
|
1820
1949
|
{
|
|
@@ -1871,7 +2000,7 @@ function Toggle({
|
|
|
1871
2000
|
}
|
|
1872
2001
|
);
|
|
1873
2002
|
}
|
|
1874
|
-
var DarkModeContext =
|
|
2003
|
+
var DarkModeContext = React34.createContext({
|
|
1875
2004
|
enabled: false,
|
|
1876
2005
|
toggle: () => {
|
|
1877
2006
|
}
|
|
@@ -1938,7 +2067,7 @@ function DarkModeToggle() {
|
|
|
1938
2067
|
}
|
|
1939
2068
|
);
|
|
1940
2069
|
}
|
|
1941
|
-
var InputFrame =
|
|
2070
|
+
var InputFrame = React34.forwardRef(function InputFrame2({ children, jss, ...rowProps }, ref) {
|
|
1942
2071
|
return /* @__PURE__ */ jsx(
|
|
1943
2072
|
Row,
|
|
1944
2073
|
{
|
|
@@ -1977,7 +2106,7 @@ var InputFrame = React33.forwardRef(function InputFrame2({ children, jss, ...row
|
|
|
1977
2106
|
}
|
|
1978
2107
|
);
|
|
1979
2108
|
});
|
|
1980
|
-
var NumericInputSegment =
|
|
2109
|
+
var NumericInputSegment = React34.forwardRef(
|
|
1981
2110
|
function NumericInputSegment2({
|
|
1982
2111
|
value,
|
|
1983
2112
|
label,
|
|
@@ -2534,7 +2663,7 @@ function DateCalendar({
|
|
|
2534
2663
|
)
|
|
2535
2664
|
] });
|
|
2536
2665
|
}
|
|
2537
|
-
var DateInput =
|
|
2666
|
+
var DateInput = React34.forwardRef(function DateInput2({
|
|
2538
2667
|
date,
|
|
2539
2668
|
onDateChange,
|
|
2540
2669
|
label,
|
|
@@ -2719,7 +2848,7 @@ var styles6 = {
|
|
|
2719
2848
|
}
|
|
2720
2849
|
}
|
|
2721
2850
|
};
|
|
2722
|
-
var DatetimeInput =
|
|
2851
|
+
var DatetimeInput = React34.forwardRef(function DatetimeInput2({ date, onDateChange, jss, icon, addOn, ...inputProps }, ref) {
|
|
2723
2852
|
return /* @__PURE__ */ jsxs(Row, { jss: styles6.root, children: [
|
|
2724
2853
|
icon && /* @__PURE__ */ jsx(Box, { padding: "medium", children: /* @__PURE__ */ jsx(Icon, { size: "medium", color: "secondary", icon }) }),
|
|
2725
2854
|
/* @__PURE__ */ jsx(
|
|
@@ -2805,7 +2934,7 @@ var Dialog = ({
|
|
|
2805
2934
|
/* @__PURE__ */ jsx(BaseView, { jss: styles8.content, children })
|
|
2806
2935
|
] });
|
|
2807
2936
|
};
|
|
2808
|
-
var DialogContext =
|
|
2937
|
+
var DialogContext = React34.createContext({
|
|
2809
2938
|
setDialog: () => {
|
|
2810
2939
|
}
|
|
2811
2940
|
});
|
|
@@ -2892,7 +3021,7 @@ function guid() {
|
|
|
2892
3021
|
return v.toString(16);
|
|
2893
3022
|
});
|
|
2894
3023
|
}
|
|
2895
|
-
var IconLink =
|
|
3024
|
+
var IconLink = React34.forwardRef(function IconLink2({ icon, color, bare, disabled, jss, ...otherProps }, ref) {
|
|
2896
3025
|
return /* @__PURE__ */ jsx(
|
|
2897
3026
|
BaseLink,
|
|
2898
3027
|
{
|
|
@@ -2924,7 +3053,7 @@ var IconLink = React33.forwardRef(function IconLink2({ icon, color, bare, disabl
|
|
|
2924
3053
|
}
|
|
2925
3054
|
);
|
|
2926
3055
|
});
|
|
2927
|
-
var Link =
|
|
3056
|
+
var Link = React34.forwardRef(function Link2({
|
|
2928
3057
|
children,
|
|
2929
3058
|
color,
|
|
2930
3059
|
bare,
|
|
@@ -3030,7 +3159,7 @@ function List({
|
|
|
3030
3159
|
}
|
|
3031
3160
|
);
|
|
3032
3161
|
}
|
|
3033
|
-
var ListButtonItem =
|
|
3162
|
+
var ListButtonItem = React34.forwardRef(function ListButtonItem2({
|
|
3034
3163
|
onClick,
|
|
3035
3164
|
color = "secondary",
|
|
3036
3165
|
disabled = false,
|
|
@@ -3089,10 +3218,10 @@ function ListHeaderItem({
|
|
|
3089
3218
|
}
|
|
3090
3219
|
);
|
|
3091
3220
|
}
|
|
3092
|
-
var ListItem =
|
|
3221
|
+
var ListItem = React34.forwardRef(function ListItem2(props, ref) {
|
|
3093
3222
|
return /* @__PURE__ */ jsx(BaseListItem, { ...props, jss: props.jss, ref, children: ({ content }) => content });
|
|
3094
3223
|
});
|
|
3095
|
-
var ListLinkItem =
|
|
3224
|
+
var ListLinkItem = React34.forwardRef(function ListLinkItem2({
|
|
3096
3225
|
onClick,
|
|
3097
3226
|
href,
|
|
3098
3227
|
disabled = false,
|
|
@@ -3651,13 +3780,13 @@ function Providers({
|
|
|
3651
3780
|
initialValue: false,
|
|
3652
3781
|
loadingValue: false
|
|
3653
3782
|
});
|
|
3654
|
-
const toggleDarkMode =
|
|
3783
|
+
const toggleDarkMode = React34.useCallback(
|
|
3655
3784
|
() => setDarkModeEnabled((x) => !x),
|
|
3656
3785
|
[setDarkModeEnabled]
|
|
3657
3786
|
);
|
|
3658
3787
|
return /* @__PURE__ */ jsx(JSSProvider, { themes, children: /* @__PURE__ */ jsx(DarkModeProvider, { enabled: darkModeEnabled, toggle: toggleDarkMode, children: /* @__PURE__ */ jsx(DialogProvider, { children }) }) });
|
|
3659
3788
|
}
|
|
3660
|
-
var RangeInput =
|
|
3789
|
+
var RangeInput = React34.forwardRef(function RangeInput2({
|
|
3661
3790
|
value,
|
|
3662
3791
|
onValueChange,
|
|
3663
3792
|
jssRoot,
|
|
@@ -3724,7 +3853,7 @@ var RangeInput = React33.forwardRef(function RangeInput2({
|
|
|
3724
3853
|
}
|
|
3725
3854
|
);
|
|
3726
3855
|
});
|
|
3727
|
-
var StackContext =
|
|
3856
|
+
var StackContext = React34.createContext({
|
|
3728
3857
|
subscribe: () => {
|
|
3729
3858
|
return () => {
|
|
3730
3859
|
};
|
|
@@ -3864,7 +3993,7 @@ function Select({
|
|
|
3864
3993
|
);
|
|
3865
3994
|
}
|
|
3866
3995
|
function stateMachineContextFactory(stateMachineConfig) {
|
|
3867
|
-
const StateMachineContext =
|
|
3996
|
+
const StateMachineContext = React34.createContext({
|
|
3868
3997
|
subscribe: () => {
|
|
3869
3998
|
throw new Error("Not implemented");
|
|
3870
3999
|
},
|
|
@@ -3972,7 +4101,7 @@ function createStorage({
|
|
|
3972
4101
|
}
|
|
3973
4102
|
function useStorage(selector) {
|
|
3974
4103
|
const [localState, setLocalState] = useState(() => selector(state.current));
|
|
3975
|
-
const { subscribe } =
|
|
4104
|
+
const { subscribe } = React34.useContext(StorageContext);
|
|
3976
4105
|
useEffect(() => {
|
|
3977
4106
|
return subscribe((newState) => {
|
|
3978
4107
|
const newLocalState = selector(newState);
|
|
@@ -3982,11 +4111,11 @@ function createStorage({
|
|
|
3982
4111
|
return localState;
|
|
3983
4112
|
}
|
|
3984
4113
|
function useMutation() {
|
|
3985
|
-
const { mutate } =
|
|
4114
|
+
const { mutate } = React34.useContext(StorageContext);
|
|
3986
4115
|
return mutate;
|
|
3987
4116
|
}
|
|
3988
4117
|
function usePersist() {
|
|
3989
|
-
const { persist } =
|
|
4118
|
+
const { persist } = React34.useContext(StorageContext);
|
|
3990
4119
|
return persist;
|
|
3991
4120
|
}
|
|
3992
4121
|
const dbPromise = new Promise((resolve, reject) => {
|
|
@@ -4106,7 +4235,7 @@ function Sublist({
|
|
|
4106
4235
|
jss,
|
|
4107
4236
|
secondaryAddOn
|
|
4108
4237
|
}) {
|
|
4109
|
-
const [collapsed, setCollapsed] =
|
|
4238
|
+
const [collapsed, setCollapsed] = React34.useState(initialState.collapsed);
|
|
4110
4239
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4111
4240
|
/* @__PURE__ */ jsx(
|
|
4112
4241
|
ListButtonItem,
|
|
@@ -4511,7 +4640,7 @@ function Tabs({
|
|
|
4511
4640
|
}
|
|
4512
4641
|
);
|
|
4513
4642
|
}
|
|
4514
|
-
var TextArea =
|
|
4643
|
+
var TextArea = React34.forwardRef(function TextArea2({
|
|
4515
4644
|
jss,
|
|
4516
4645
|
onValueChange,
|
|
4517
4646
|
value,
|
|
@@ -4549,7 +4678,7 @@ var TextArea = React33.forwardRef(function TextArea2({
|
|
|
4549
4678
|
}
|
|
4550
4679
|
);
|
|
4551
4680
|
});
|
|
4552
|
-
var TextInput =
|
|
4681
|
+
var TextInput = React34.forwardRef(function TextInput2({
|
|
4553
4682
|
value,
|
|
4554
4683
|
onValueChange,
|
|
4555
4684
|
jssRoot,
|
|
@@ -4661,7 +4790,7 @@ function parseSegments2(segments, base) {
|
|
|
4661
4790
|
minute
|
|
4662
4791
|
);
|
|
4663
4792
|
}
|
|
4664
|
-
var TimeInput =
|
|
4793
|
+
var TimeInput = React34.forwardRef(function TimeInput2({
|
|
4665
4794
|
time,
|
|
4666
4795
|
onTimeChange,
|
|
4667
4796
|
label,
|
|
@@ -4929,6 +5058,6 @@ function usePromise(promiseFactory, inputs, initialValue) {
|
|
|
4929
5058
|
return [value, error];
|
|
4930
5059
|
}
|
|
4931
5060
|
|
|
4932
|
-
export { Badge, BaseButton, BaseInput, BaseLink, BaseLinkComponentOverrideContext, BaseList, BaseListAddOn, BaseListItem, BaseView, Box, Button, ButtonGroup, Calendar, Card, Checkbox, Circle, Column, DESKTOP_MEDIA, DarkModeContext, DarkModeProvider, DarkModeToggle, DateInput, DatetimeInput, Dialog, DialogProvider, FlexLayout, H1, H2, H3, H4, Icon, IconButton, IconLink, JSSProvider, JSServerStyles, LAPTOP, LAPTOP_MEDIA, Label, Li, Link, List, ListButtonItem, ListDivider, ListHeaderItem, ListItem, ListLinkItem, ListSpacer, MOBILE, MOBILE_MEDIA, MenuIcon, NavigationSplitView, OnVisible, P, Popover, PopoverTrigger, ProgressBar, ProgressCircle, Providers, RangeInput, RootView, Row, Select, Span, StackContextProvider, StaticCheckbox, Sublist, SubmitIconInput, TABLET, TABLET_MEDIA, TabBar, Table, Tabs, Text, TextArea, TextInput, TextInputWithState, TextPairing, TimeInput, Toggle, Tooltip, baseStyles, createEmitter, createStorage, cssVar, darkTheme, desktop, getBackground, getBaseStyles, getColorValue, getCookie, getMargin, getMaterial, getPadding, getSize, getSpacing, getTextColor, guid, hasCookie, hash, laptop, lightTheme, mobile, numberToBase, sizes3 as sizes, stateMachineContextFactory, tablet, timeFormatter, toClassnames, useCookie, useDialog, useIsTopOfStack, useKeyboard, useNavigation, usePromise, useRefEffect, useStream };
|
|
5061
|
+
export { Avatar, Badge, BaseButton, BaseInput, BaseLink, BaseLinkComponentOverrideContext, BaseList, BaseListAddOn, BaseListItem, BaseView, Box, Button, ButtonGroup, Calendar, Card, Checkbox, Circle, Column, DESKTOP_MEDIA, DarkModeContext, DarkModeProvider, DarkModeToggle, DateInput, DatetimeInput, Dialog, DialogProvider, FlexLayout, H1, H2, H3, H4, Icon, IconButton, IconLink, JSSProvider, JSServerStyles, LAPTOP, LAPTOP_MEDIA, Label, Li, Link, List, ListButtonItem, ListDivider, ListHeaderItem, ListItem, ListLinkItem, ListSpacer, MOBILE, MOBILE_MEDIA, MenuIcon, NavigationSplitView, OnVisible, P, Popover, PopoverTrigger, ProgressBar, ProgressCircle, Providers, RangeInput, RootView, Row, Select, Span, StackContextProvider, StaticCheckbox, Sublist, SubmitIconInput, TABLET, TABLET_MEDIA, TabBar, Table, Tabs, Text, TextArea, TextInput, TextInputWithState, TextPairing, TimeInput, Toggle, Tooltip, baseStyles, createEmitter, createStorage, cssVar, darkTheme, desktop, getBackground, getBaseStyles, getColorValue, getCookie, getMargin, getMaterial, getPadding, getSize, getSpacing, getTextColor, guid, hasCookie, hash, laptop, lightTheme, mobile, numberToBase, sizes3 as sizes, stateMachineContextFactory, tablet, timeFormatter, toClassnames, useCookie, useDialog, useIsTopOfStack, useKeyboard, useNavigation, usePromise, useRefEffect, useStream };
|
|
4933
5062
|
//# sourceMappingURL=index.js.map
|
|
4934
5063
|
//# sourceMappingURL=index.js.map
|