@sofya-ds/react 1.10.0 → 1.12.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 +45 -45
- package/dist/index.cjs +1743 -882
- package/dist/index.css +3 -3
- package/dist/index.d.cts +337 -13
- package/dist/index.d.ts +337 -13
- package/dist/index.js +1661 -814
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -107,14 +107,27 @@ import * as React2 from "react";
|
|
|
107
107
|
// src/components/icon-data.ts
|
|
108
108
|
import {
|
|
109
109
|
IconAdjustmentsHorizontalFilled,
|
|
110
|
+
IconAlignCenter,
|
|
111
|
+
IconAlignJustified,
|
|
112
|
+
IconAlignLeft,
|
|
113
|
+
IconAlignRight,
|
|
110
114
|
IconArrowUp,
|
|
111
115
|
IconArchive,
|
|
116
|
+
IconBold,
|
|
112
117
|
IconBuildingHospital,
|
|
113
118
|
IconBooks,
|
|
114
119
|
IconBulb,
|
|
115
120
|
IconChartBar,
|
|
116
121
|
IconCheck,
|
|
117
122
|
IconChecklist,
|
|
123
|
+
IconCode,
|
|
124
|
+
IconItalic,
|
|
125
|
+
IconLink,
|
|
126
|
+
IconList,
|
|
127
|
+
IconListNumbers,
|
|
128
|
+
IconQuote,
|
|
129
|
+
IconStrikethrough,
|
|
130
|
+
IconUnderline,
|
|
118
131
|
IconChevronLeft,
|
|
119
132
|
IconChevronDown,
|
|
120
133
|
IconChevronUp,
|
|
@@ -135,6 +148,7 @@ import {
|
|
|
135
148
|
IconSquareToggle,
|
|
136
149
|
IconSparkles,
|
|
137
150
|
IconStar,
|
|
151
|
+
IconStarFilled,
|
|
138
152
|
IconUser,
|
|
139
153
|
IconUserFilled,
|
|
140
154
|
IconUserCircle,
|
|
@@ -152,14 +166,27 @@ import {
|
|
|
152
166
|
} from "@tabler/icons-react";
|
|
153
167
|
var tablerIconRegistry = {
|
|
154
168
|
IconAdjustmentsHorizontalFilled,
|
|
169
|
+
IconAlignCenter,
|
|
170
|
+
IconAlignJustified,
|
|
171
|
+
IconAlignLeft,
|
|
172
|
+
IconAlignRight,
|
|
155
173
|
IconArrowUp,
|
|
156
174
|
IconArchive,
|
|
175
|
+
IconBold,
|
|
157
176
|
IconBuildingHospital,
|
|
158
177
|
IconBooks,
|
|
159
178
|
IconBulb,
|
|
160
179
|
IconChartBar,
|
|
161
180
|
IconCheck,
|
|
162
181
|
IconChecklist,
|
|
182
|
+
IconCode,
|
|
183
|
+
IconItalic,
|
|
184
|
+
IconLink,
|
|
185
|
+
IconList,
|
|
186
|
+
IconListNumbers,
|
|
187
|
+
IconQuote,
|
|
188
|
+
IconStrikethrough,
|
|
189
|
+
IconUnderline,
|
|
163
190
|
IconChevronLeft,
|
|
164
191
|
IconChevronDown,
|
|
165
192
|
IconChevronUp,
|
|
@@ -180,6 +207,7 @@ var tablerIconRegistry = {
|
|
|
180
207
|
IconSquareToggle,
|
|
181
208
|
IconSparkles,
|
|
182
209
|
IconStar,
|
|
210
|
+
IconStarFilled,
|
|
183
211
|
IconUser,
|
|
184
212
|
IconUserFilled,
|
|
185
213
|
IconUserCircle,
|
|
@@ -239,6 +267,7 @@ var legacyIconToTablerNameMap = {
|
|
|
239
267
|
"copy": "IconCopy",
|
|
240
268
|
"logout": "IconLogout",
|
|
241
269
|
"star": "IconStar",
|
|
270
|
+
"star-filled": "IconStarFilled",
|
|
242
271
|
"users-group": "IconUsersGroup",
|
|
243
272
|
"archive": "IconArchive",
|
|
244
273
|
"folder": "IconFolder",
|
|
@@ -252,7 +281,20 @@ var legacyIconToTablerNameMap = {
|
|
|
252
281
|
"remove": "IconTrashX",
|
|
253
282
|
"lixeira": "IconTrash",
|
|
254
283
|
"settings": "IconSettings",
|
|
255
|
-
"edit": "IconEdit"
|
|
284
|
+
"edit": "IconEdit",
|
|
285
|
+
"bold": "IconBold",
|
|
286
|
+
"italic": "IconItalic",
|
|
287
|
+
"underline": "IconUnderline",
|
|
288
|
+
"strikethrough": "IconStrikethrough",
|
|
289
|
+
"list-bullet": "IconList",
|
|
290
|
+
"list-numbers": "IconListNumbers",
|
|
291
|
+
"link": "IconLink",
|
|
292
|
+
"quote": "IconQuote",
|
|
293
|
+
"code": "IconCode",
|
|
294
|
+
"align-left": "IconAlignLeft",
|
|
295
|
+
"align-center": "IconAlignCenter",
|
|
296
|
+
"align-right": "IconAlignRight",
|
|
297
|
+
"align-justify": "IconAlignJustified"
|
|
256
298
|
};
|
|
257
299
|
var iconNames = Object.keys(legacyIconToTablerNameMap);
|
|
258
300
|
var iconRegistry = Object.fromEntries(
|
|
@@ -405,7 +447,13 @@ import {
|
|
|
405
447
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
406
448
|
var textSizeOptions = sofyaTextStyleNames;
|
|
407
449
|
var textVariantOptions = ["default", "gradient", "shiny", "split"];
|
|
450
|
+
var textToneOptions = ["default", "soft", "subtle"];
|
|
408
451
|
var textSplitTypeOptions = ["chars", "words", "words, chars"];
|
|
452
|
+
var textToneClassNames = {
|
|
453
|
+
default: "text-[color:var(--sofya-text-default)]",
|
|
454
|
+
soft: "text-[color:var(--sofya-text-soft)]",
|
|
455
|
+
subtle: "text-[color:var(--sofya-text-subtle)]"
|
|
456
|
+
};
|
|
409
457
|
var defaultElements = {
|
|
410
458
|
"display-xl": "h1",
|
|
411
459
|
"display-lg": "h1",
|
|
@@ -509,6 +557,7 @@ var Text = React3.forwardRef(function Text2({
|
|
|
509
557
|
splitThreshold = 0.1,
|
|
510
558
|
splitType = "chars",
|
|
511
559
|
style,
|
|
560
|
+
tone = "default",
|
|
512
561
|
variant = "default",
|
|
513
562
|
weight,
|
|
514
563
|
...props
|
|
@@ -631,16 +680,17 @@ var Text = React3.forwardRef(function Text2({
|
|
|
631
680
|
ref: setRefs,
|
|
632
681
|
"data-text-size": size,
|
|
633
682
|
"data-text-variant": variant,
|
|
683
|
+
"data-text-tone": tone,
|
|
634
684
|
"aria-label": shouldSplit ? props["aria-label"] ?? splitText ?? void 0 : props["aria-label"],
|
|
635
|
-
className: cn("m-0
|
|
685
|
+
className: cn("m-0", textToneClassNames[tone], textVariantClassNames[variant], className),
|
|
636
686
|
style: { ...textSizeStyles[size], ...textVariantStyles[variant], ...weight != null && { fontWeight: weight }, ...style },
|
|
637
687
|
...props,
|
|
638
688
|
children: shouldSplit ? renderSplitChildren() : children
|
|
639
689
|
}
|
|
640
690
|
);
|
|
641
691
|
});
|
|
642
|
-
function renderTextContent(children, { as, className, size = "body", style, variant = "default", weight } = {}) {
|
|
643
|
-
return isTextContent(children) ? /* @__PURE__ */ jsx3(Text, { as, className, size, style, variant, weight, children }) : children;
|
|
692
|
+
function renderTextContent(children, { as, className, size = "body", style, tone = "default", variant = "default", weight } = {}) {
|
|
693
|
+
return isTextContent(children) ? /* @__PURE__ */ jsx3(Text, { as, className, size, style, tone, variant, weight, children }) : children;
|
|
644
694
|
}
|
|
645
695
|
|
|
646
696
|
// src/components/accordion.tsx
|
|
@@ -797,193 +847,17 @@ var AccordionContent = React4.forwardRef(({ className, children, contentClassNam
|
|
|
797
847
|
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
798
848
|
|
|
799
849
|
// src/components/alert.tsx
|
|
800
|
-
import * as
|
|
801
|
-
import { cva as cva2 } from "class-variance-authority";
|
|
802
|
-
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
803
|
-
var alertToneOptions = [
|
|
804
|
-
"default",
|
|
805
|
-
"info",
|
|
806
|
-
"success",
|
|
807
|
-
"warning",
|
|
808
|
-
"destructive"
|
|
809
|
-
];
|
|
810
|
-
var alertSizeOptions = ["sm", "default", "lg"];
|
|
811
|
-
var alertVariants = cva2("flex w-full items-start border", {
|
|
812
|
-
variants: {
|
|
813
|
-
size: {
|
|
814
|
-
sm: "gap-2 rounded-[14px] px-4 py-2",
|
|
815
|
-
default: "gap-4 rounded-[16px] px-4 py-4",
|
|
816
|
-
lg: "gap-4 rounded-[18px] px-6 py-4"
|
|
817
|
-
},
|
|
818
|
-
tone: {
|
|
819
|
-
default: "border-[color:var(--sofya-tone-default-border)] bg-[color:var(--sofya-tone-default-background)] text-[color:var(--sofya-tone-default-foreground)]",
|
|
820
|
-
info: "border-[color:var(--sofya-tone-info-border)] bg-[color:var(--sofya-tone-info-background)] text-[color:var(--sofya-tone-info-foreground)]",
|
|
821
|
-
success: "border-[color:var(--sofya-tone-success-border)] bg-[color:var(--sofya-tone-success-background)] text-[color:var(--sofya-tone-success-foreground)]",
|
|
822
|
-
warning: "border-[color:var(--sofya-tone-warning-border)] bg-[color:var(--sofya-tone-warning-background)] text-[color:var(--sofya-tone-warning-foreground)]",
|
|
823
|
-
destructive: "border-[color:var(--sofya-tone-destructive-border)] bg-[color:var(--sofya-tone-destructive-background)] text-[color:var(--sofya-tone-destructive-foreground)]"
|
|
824
|
-
}
|
|
825
|
-
},
|
|
826
|
-
defaultVariants: {
|
|
827
|
-
size: "default",
|
|
828
|
-
tone: "default"
|
|
829
|
-
}
|
|
830
|
-
});
|
|
831
|
-
var toneIconMap = {
|
|
832
|
-
info: "lightbulb",
|
|
833
|
-
success: "check",
|
|
834
|
-
warning: "question",
|
|
835
|
-
destructive: "x"
|
|
836
|
-
};
|
|
837
|
-
var Alert = React5.forwardRef(function Alert2({
|
|
838
|
-
children,
|
|
839
|
-
className,
|
|
840
|
-
icon,
|
|
841
|
-
role,
|
|
842
|
-
showToneIcon = true,
|
|
843
|
-
size,
|
|
844
|
-
tone,
|
|
845
|
-
...props
|
|
846
|
-
}, ref) {
|
|
847
|
-
const resolvedSize = size ?? "default";
|
|
848
|
-
const resolvedTone = tone ?? "default";
|
|
849
|
-
const resolvedRole = role ?? (resolvedTone === "warning" || resolvedTone === "destructive" ? "alert" : "status");
|
|
850
|
-
const toneIconName = resolvedTone !== "default" ? toneIconMap[resolvedTone] : void 0;
|
|
851
|
-
const resolvedIcon = icon ?? (showToneIcon && toneIconName ? /* @__PURE__ */ jsx5(Icon, { name: toneIconName, size: 16, "aria-hidden": "true" }) : null);
|
|
852
|
-
return /* @__PURE__ */ jsxs2(
|
|
853
|
-
"div",
|
|
854
|
-
{
|
|
855
|
-
ref,
|
|
856
|
-
"data-size": resolvedSize,
|
|
857
|
-
"data-slot": "alert",
|
|
858
|
-
"data-tone": resolvedTone,
|
|
859
|
-
role: resolvedRole,
|
|
860
|
-
className: cn(
|
|
861
|
-
alertVariants({ size: resolvedSize, tone: resolvedTone }),
|
|
862
|
-
className
|
|
863
|
-
),
|
|
864
|
-
...props,
|
|
865
|
-
children: [
|
|
866
|
-
resolvedIcon ? /* @__PURE__ */ jsx5(
|
|
867
|
-
"span",
|
|
868
|
-
{
|
|
869
|
-
"data-slot": "alert-icon",
|
|
870
|
-
className: "mt-2 inline-flex h-4 w-4 shrink-0 items-center justify-center text-current [&>svg]:h-4 [&>svg]:w-4",
|
|
871
|
-
children: resolvedIcon
|
|
872
|
-
}
|
|
873
|
-
) : null,
|
|
874
|
-
/* @__PURE__ */ jsx5("div", { "data-slot": "alert-content", className: "flex min-w-0 flex-1 flex-col", children })
|
|
875
|
-
]
|
|
876
|
-
}
|
|
877
|
-
);
|
|
878
|
-
});
|
|
879
|
-
var AlertTitle = React5.forwardRef(function AlertTitle2({ children, className, ...props }, ref) {
|
|
880
|
-
return /* @__PURE__ */ jsx5(
|
|
881
|
-
"div",
|
|
882
|
-
{
|
|
883
|
-
ref,
|
|
884
|
-
"data-slot": "alert-title",
|
|
885
|
-
className: cn("text-current", className),
|
|
886
|
-
...props,
|
|
887
|
-
children: renderTextContent(children, {
|
|
888
|
-
as: "span",
|
|
889
|
-
className: "block text-current",
|
|
890
|
-
size: "h4"
|
|
891
|
-
})
|
|
892
|
-
}
|
|
893
|
-
);
|
|
894
|
-
});
|
|
895
|
-
var AlertDescription = React5.forwardRef(function AlertDescription2({ children, className, ...props }, ref) {
|
|
896
|
-
return /* @__PURE__ */ jsx5(
|
|
897
|
-
"div",
|
|
898
|
-
{
|
|
899
|
-
ref,
|
|
900
|
-
"data-slot": "alert-description",
|
|
901
|
-
className: cn("[&:not(:first-child)]:mt-2 text-current/80", className),
|
|
902
|
-
...props,
|
|
903
|
-
children: renderTextContent(children, {
|
|
904
|
-
as: "span",
|
|
905
|
-
className: "block text-current/80",
|
|
906
|
-
size: "tiny"
|
|
907
|
-
})
|
|
908
|
-
}
|
|
909
|
-
);
|
|
910
|
-
});
|
|
911
|
-
Alert.displayName = "Alert";
|
|
912
|
-
AlertTitle.displayName = "AlertTitle";
|
|
913
|
-
AlertDescription.displayName = "AlertDescription";
|
|
914
|
-
|
|
915
|
-
// src/components/badge.tsx
|
|
850
|
+
import * as React9 from "react";
|
|
916
851
|
import { cva as cva3 } from "class-variance-authority";
|
|
917
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
918
|
-
var badgeVariantOptions = [
|
|
919
|
-
"default",
|
|
920
|
-
"secondary",
|
|
921
|
-
"outline",
|
|
922
|
-
"success",
|
|
923
|
-
"warning",
|
|
924
|
-
"destructive",
|
|
925
|
-
"pill"
|
|
926
|
-
];
|
|
927
|
-
var badgeAlertOptions = ["default", "medium", "high"];
|
|
928
|
-
var badgePillToneOptions = ["neutral", "danger"];
|
|
929
|
-
var badgeVariants = cva3(
|
|
930
|
-
"inline-flex min-h-[34px] items-center justify-center whitespace-nowrap rounded-[5px] px-4 py-2 [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] font-semibold uppercase leading-none tracking-[0.08em] transition-colors duration-sofya ease-sofya",
|
|
931
|
-
{
|
|
932
|
-
variants: {
|
|
933
|
-
variant: {
|
|
934
|
-
default: "border-transparent bg-accent/10 text-accent",
|
|
935
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
|
936
|
-
outline: "border border-border bg-background text-foreground",
|
|
937
|
-
success: "border-transparent bg-success/10 text-success",
|
|
938
|
-
warning: "border-transparent bg-warning/10 text-warning",
|
|
939
|
-
destructive: "border-transparent bg-destructive/10 text-destructive",
|
|
940
|
-
pill: ""
|
|
941
|
-
}
|
|
942
|
-
},
|
|
943
|
-
defaultVariants: {
|
|
944
|
-
variant: "default"
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
);
|
|
948
|
-
var badgeAlertVariants = cva3(
|
|
949
|
-
"inline-flex min-h-[34px] items-center justify-center whitespace-nowrap rounded-[5px] px-4 py-2 [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] font-semibold uppercase leading-none tracking-[0.08em] transition-colors duration-sofya ease-sofya",
|
|
950
|
-
{
|
|
951
|
-
variants: {
|
|
952
|
-
alert: {
|
|
953
|
-
default: "border-transparent bg-accent/10 text-accent",
|
|
954
|
-
medium: "border-transparent bg-[color:var(--sofya-tone-warning-background)] text-warning",
|
|
955
|
-
high: "border-transparent bg-[color:var(--sofya-tone-destructive-background)] text-destructive"
|
|
956
|
-
}
|
|
957
|
-
},
|
|
958
|
-
defaultVariants: {
|
|
959
|
-
alert: "default"
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
);
|
|
963
|
-
var badgePillVariants = cva3(
|
|
964
|
-
"inline-flex h-[30px] items-center justify-center whitespace-nowrap rounded-full border px-4 py-2 [font-family:var(--sofya-text-extra-tiny-font-family)] text-[length:var(--sofya-text-extra-tiny-font-size)] font-semibold leading-none tracking-normal transition-colors duration-sofya ease-sofya",
|
|
965
|
-
{
|
|
966
|
-
variants: {
|
|
967
|
-
tone: {
|
|
968
|
-
neutral: "border-[color:var(--sofya-tone-default-border)] bg-[color:var(--sofya-tone-default-background)] text-[color:var(--sofya-tone-default-foreground)]",
|
|
969
|
-
danger: "border-[color:var(--sofya-tone-destructive-border)] bg-[color:var(--sofya-tone-destructive-background)] text-[color:var(--sofya-tone-destructive-foreground)]"
|
|
970
|
-
}
|
|
971
|
-
},
|
|
972
|
-
defaultVariants: {
|
|
973
|
-
tone: "neutral"
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
);
|
|
977
|
-
function Badge({ className, variant, alert, pillTone, ...props }) {
|
|
978
|
-
const badgeClassName = variant === "pill" ? badgePillVariants({ tone: pillTone }) : alert ? badgeAlertVariants({ alert }) : badgeVariants({ variant });
|
|
979
|
-
return /* @__PURE__ */ jsx6("div", { className: cn(badgeClassName, className), ...props });
|
|
980
|
-
}
|
|
981
852
|
|
|
982
|
-
// src/components/button.tsx
|
|
853
|
+
// src/components/close-button.tsx
|
|
983
854
|
import * as React8 from "react";
|
|
855
|
+
|
|
856
|
+
// src/components/button.tsx
|
|
857
|
+
import * as React7 from "react";
|
|
984
858
|
import { IconLoader2 } from "@tabler/icons-react";
|
|
985
859
|
import { Slot } from "@radix-ui/react-slot";
|
|
986
|
-
import { cva as
|
|
860
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
987
861
|
|
|
988
862
|
// src/components/button-language-flags.ts
|
|
989
863
|
function createFlagDataUri(svg) {
|
|
@@ -1108,9 +982,9 @@ var dropdownLanguageFlagSrc = {
|
|
|
1108
982
|
};
|
|
1109
983
|
|
|
1110
984
|
// src/components/button-ripple.tsx
|
|
1111
|
-
import * as
|
|
985
|
+
import * as React5 from "react";
|
|
1112
986
|
import { motion, useReducedMotion } from "motion/react";
|
|
1113
|
-
import { jsx as
|
|
987
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1114
988
|
var MAX_ACTIVE_RIPPLES = 3;
|
|
1115
989
|
var buttonRippleVariantClasses = {
|
|
1116
990
|
default: "bg-[hsl(var(--sofya-primary-foreground)/0.82)] mix-blend-screen",
|
|
@@ -1137,15 +1011,15 @@ function useButtonRippleState({
|
|
|
1137
1011
|
variant
|
|
1138
1012
|
}) {
|
|
1139
1013
|
const prefersReducedMotion = Boolean(useReducedMotion());
|
|
1140
|
-
const [ripples, setRipples] =
|
|
1141
|
-
const rippleIdRef =
|
|
1142
|
-
const lastRippleAtRef =
|
|
1143
|
-
const handleRippleComplete =
|
|
1014
|
+
const [ripples, setRipples] = React5.useState([]);
|
|
1015
|
+
const rippleIdRef = React5.useRef(0);
|
|
1016
|
+
const lastRippleAtRef = React5.useRef(0);
|
|
1017
|
+
const handleRippleComplete = React5.useCallback((rippleId) => {
|
|
1144
1018
|
setRipples(
|
|
1145
1019
|
(currentRipples) => currentRipples.filter((currentRipple) => currentRipple.id !== rippleId)
|
|
1146
1020
|
);
|
|
1147
1021
|
}, []);
|
|
1148
|
-
const createRipple =
|
|
1022
|
+
const createRipple = React5.useCallback(
|
|
1149
1023
|
(currentTarget, clientX, clientY) => {
|
|
1150
1024
|
const now = performance.now();
|
|
1151
1025
|
if (now - lastRippleAtRef.current < 48) {
|
|
@@ -1184,7 +1058,7 @@ function useButtonRippleState({
|
|
|
1184
1058
|
},
|
|
1185
1059
|
[size]
|
|
1186
1060
|
);
|
|
1187
|
-
const handlePointerDown =
|
|
1061
|
+
const handlePointerDown = React5.useCallback(
|
|
1188
1062
|
(event) => {
|
|
1189
1063
|
onPointerDown?.(event);
|
|
1190
1064
|
if (event.defaultPrevented || disabled) {
|
|
@@ -1203,7 +1077,7 @@ function useButtonRippleState({
|
|
|
1203
1077
|
},
|
|
1204
1078
|
[createRipple, disabled, onPointerDown, prefersReducedMotion]
|
|
1205
1079
|
);
|
|
1206
|
-
const handleClick =
|
|
1080
|
+
const handleClick = React5.useCallback(
|
|
1207
1081
|
(event) => {
|
|
1208
1082
|
if (!disabled && !prefersReducedMotion && event.detail === 0) {
|
|
1209
1083
|
createRipple(event.currentTarget);
|
|
@@ -1230,12 +1104,12 @@ function ButtonRippleLayer({
|
|
|
1230
1104
|
if (ripples.length === 0) {
|
|
1231
1105
|
return null;
|
|
1232
1106
|
}
|
|
1233
|
-
return /* @__PURE__ */
|
|
1107
|
+
return /* @__PURE__ */ jsx5(
|
|
1234
1108
|
"span",
|
|
1235
1109
|
{
|
|
1236
1110
|
"aria-hidden": "true",
|
|
1237
1111
|
className: "pointer-events-none absolute inset-0 z-[1] overflow-hidden rounded-[inherit]",
|
|
1238
|
-
children: ripples.map((ripple) => /* @__PURE__ */
|
|
1112
|
+
children: ripples.map((ripple) => /* @__PURE__ */ jsx5(
|
|
1239
1113
|
motion.span,
|
|
1240
1114
|
{
|
|
1241
1115
|
className: cn(
|
|
@@ -1267,7 +1141,7 @@ function ButtonRippleLayer({
|
|
|
1267
1141
|
}
|
|
1268
1142
|
|
|
1269
1143
|
// src/components/button-loading-state.ts
|
|
1270
|
-
import * as
|
|
1144
|
+
import * as React6 from "react";
|
|
1271
1145
|
var BUTTON_SEQUENCE_MS = 250;
|
|
1272
1146
|
function useButtonLoadingState({
|
|
1273
1147
|
buttonRef,
|
|
@@ -1276,15 +1150,15 @@ function useButtonLoadingState({
|
|
|
1276
1150
|
loading,
|
|
1277
1151
|
rightIcon
|
|
1278
1152
|
}) {
|
|
1279
|
-
const expandedWidthRef =
|
|
1280
|
-
const previousLoadingRef =
|
|
1281
|
-
const timeoutsRef =
|
|
1282
|
-
const frameRef =
|
|
1283
|
-
const [animatedWidth, setAnimatedWidth] =
|
|
1284
|
-
const [loadingPhase, setLoadingPhase] =
|
|
1153
|
+
const expandedWidthRef = React6.useRef(void 0);
|
|
1154
|
+
const previousLoadingRef = React6.useRef(loading);
|
|
1155
|
+
const timeoutsRef = React6.useRef([]);
|
|
1156
|
+
const frameRef = React6.useRef(null);
|
|
1157
|
+
const [animatedWidth, setAnimatedWidth] = React6.useState(void 0);
|
|
1158
|
+
const [loadingPhase, setLoadingPhase] = React6.useState(
|
|
1285
1159
|
loading ? "loading" : "idle"
|
|
1286
1160
|
);
|
|
1287
|
-
const clearAnimationTimers =
|
|
1161
|
+
const clearAnimationTimers = React6.useCallback(() => {
|
|
1288
1162
|
for (const timeoutId of timeoutsRef.current) {
|
|
1289
1163
|
window.clearTimeout(timeoutId);
|
|
1290
1164
|
}
|
|
@@ -1294,7 +1168,7 @@ function useButtonLoadingState({
|
|
|
1294
1168
|
frameRef.current = null;
|
|
1295
1169
|
}
|
|
1296
1170
|
}, []);
|
|
1297
|
-
|
|
1171
|
+
React6.useLayoutEffect(() => {
|
|
1298
1172
|
const element = buttonRef.current;
|
|
1299
1173
|
if (element && loadingPhase === "idle" && !loading) {
|
|
1300
1174
|
expandedWidthRef.current = element.offsetWidth;
|
|
@@ -1303,12 +1177,12 @@ function useButtonLoadingState({
|
|
|
1303
1177
|
setAnimatedWidth(element.offsetHeight);
|
|
1304
1178
|
}
|
|
1305
1179
|
}, [animatedWidth, buttonRef, loading, loadingPhase, children, leftIcon, rightIcon]);
|
|
1306
|
-
|
|
1180
|
+
React6.useEffect(() => {
|
|
1307
1181
|
return () => {
|
|
1308
1182
|
clearAnimationTimers();
|
|
1309
1183
|
};
|
|
1310
1184
|
}, [clearAnimationTimers]);
|
|
1311
|
-
|
|
1185
|
+
React6.useEffect(() => {
|
|
1312
1186
|
const element = buttonRef.current;
|
|
1313
1187
|
if (!element) {
|
|
1314
1188
|
return;
|
|
@@ -1371,7 +1245,7 @@ function useButtonLoadingState({
|
|
|
1371
1245
|
}
|
|
1372
1246
|
|
|
1373
1247
|
// src/components/button.tsx
|
|
1374
|
-
import { Fragment, jsx as
|
|
1248
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1375
1249
|
var buttonVariantOptions = [
|
|
1376
1250
|
"default",
|
|
1377
1251
|
"gradient",
|
|
@@ -1384,20 +1258,22 @@ var buttonVariantOptions = [
|
|
|
1384
1258
|
"destructive"
|
|
1385
1259
|
];
|
|
1386
1260
|
var buttonSizeOptions = ["default", "sm", "lg", "icon"];
|
|
1387
|
-
var buttonVariants =
|
|
1388
|
-
"relative isolate inline-flex items-center justify-center gap-2 overflow-hidden whitespace-nowrap rounded-full font-medium tracking-[0.025em] transform-gpu transition-[width,transform,filter,background-color,border-color,color,box-shadow] duration-sofya ease-sofya motion-safe:active:scale-[0.985] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:
|
|
1261
|
+
var buttonVariants = cva2(
|
|
1262
|
+
"relative isolate inline-flex items-center justify-center gap-2 overflow-hidden whitespace-nowrap rounded-full font-medium tracking-[0.025em] transform-gpu transition-[width,transform,filter,background-color,border-color,color,box-shadow] duration-sofya ease-sofya motion-safe:active:scale-[0.985] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none data-[disabled=true]:cursor-not-allowed",
|
|
1389
1263
|
{
|
|
1390
1264
|
variants: {
|
|
1391
1265
|
variant: {
|
|
1392
|
-
default: "bg-primary text-primary-foreground hover:brightness-[1.04]",
|
|
1393
|
-
gradient: "sofya-gradient-motion [--sofya-gradient-motion-duration:4s] bg-[linear-gradient(90deg,hsl(var(--sofya-button-gradient-from))_0%,hsl(var(--sofya-button-gradient-to))_100%)] text-primary-foreground hover:brightness-[1.05]",
|
|
1394
|
-
dropdown: "justify-between border border-[color:var(--sofya-border-strong)] bg-card font-normal tracking-normal text-primary shadow-none hover:bg-card hover:border-[color:var(--sofya-border-strong)]",
|
|
1395
|
-
|
|
1266
|
+
default: "bg-primary text-primary-foreground hover:brightness-[1.04] data-[disabled=true]:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:shadow-none",
|
|
1267
|
+
gradient: "sofya-gradient-motion [--sofya-gradient-motion-duration:4s] bg-[linear-gradient(90deg,hsl(var(--sofya-button-gradient-from))_0%,hsl(var(--sofya-button-gradient-to))_100%)] text-primary-foreground hover:brightness-[1.05] data-[disabled=true]:bg-none data-[disabled=true]:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1268
|
+
dropdown: "justify-between border border-[color:var(--sofya-border-strong)] bg-card font-normal tracking-normal text-primary shadow-none hover:bg-card hover:border-[color:var(--sofya-border-strong)] data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:bg-muted",
|
|
1269
|
+
// Flat/ghost by default — same contract as `IconButton` so icon-only
|
|
1270
|
+
// actions never paint a box/background or shadow on light surfaces.
|
|
1271
|
+
icon: "border-0 bg-transparent text-[color:var(--sofya-text-soft)] shadow-none hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)] data-[disabled=true]:bg-transparent data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:shadow-none",
|
|
1396
1272
|
language: "border-0 bg-muted bg-cover bg-center bg-no-repeat text-primary-foreground shadow-none hover:brightness-[1.03]",
|
|
1397
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85",
|
|
1398
|
-
outline: "border border-primary/15 bg-background text-foreground hover:border-primary/30 hover:bg-background active:bg-background",
|
|
1399
|
-
ghost: "bg-transparent text-foreground hover:bg-muted",
|
|
1400
|
-
destructive: "bg-destructive text-destructive-foreground hover:brightness-[1.04]"
|
|
1273
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 data-[disabled=true]:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1274
|
+
outline: "border border-primary/15 bg-background text-foreground hover:border-primary/30 hover:bg-background active:bg-background data-[disabled=true]:border-[color:var(--sofya-border-soft)] data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1275
|
+
ghost: "bg-transparent text-foreground hover:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1276
|
+
destructive: "bg-destructive text-destructive-foreground hover:brightness-[1.04] data-[disabled=true]:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)]"
|
|
1401
1277
|
},
|
|
1402
1278
|
size: {
|
|
1403
1279
|
default: "h-11 px-10",
|
|
@@ -1427,7 +1303,7 @@ var languageButtonSizeClasses = {
|
|
|
1427
1303
|
function ButtonSpinner({
|
|
1428
1304
|
size
|
|
1429
1305
|
}) {
|
|
1430
|
-
return /* @__PURE__ */
|
|
1306
|
+
return /* @__PURE__ */ jsx6(
|
|
1431
1307
|
IconLoader2,
|
|
1432
1308
|
{
|
|
1433
1309
|
"aria-hidden": "true",
|
|
@@ -1438,7 +1314,7 @@ function ButtonSpinner({
|
|
|
1438
1314
|
}
|
|
1439
1315
|
);
|
|
1440
1316
|
}
|
|
1441
|
-
var Button =
|
|
1317
|
+
var Button = React7.forwardRef(
|
|
1442
1318
|
({
|
|
1443
1319
|
active = false,
|
|
1444
1320
|
disabled,
|
|
@@ -1457,9 +1333,9 @@ var Button = React8.forwardRef(
|
|
|
1457
1333
|
style,
|
|
1458
1334
|
...props
|
|
1459
1335
|
}, ref) => {
|
|
1460
|
-
const buttonRef =
|
|
1336
|
+
const buttonRef = React7.useRef(null);
|
|
1461
1337
|
const Component = asChild ? Slot : "button";
|
|
1462
|
-
const hasChildren =
|
|
1338
|
+
const hasChildren = React7.Children.count(children) > 0;
|
|
1463
1339
|
const isIconOnly = !hasChildren && Boolean(leftIcon || rightIcon);
|
|
1464
1340
|
const isIconOnlyAction = variant === "icon" && isIconOnly;
|
|
1465
1341
|
const resolvedSize = size ?? (isIconOnly ? "icon" : "default");
|
|
@@ -1478,13 +1354,14 @@ var Button = React8.forwardRef(
|
|
|
1478
1354
|
rightIcon
|
|
1479
1355
|
});
|
|
1480
1356
|
const isDisabled = disabled || loadingPhase !== "idle";
|
|
1357
|
+
const showDisabledTreatment = Boolean(disabled) && !loading;
|
|
1481
1358
|
const resolvedWidthStyle = animatedWidth === void 0 ? style?.width : `${animatedWidth}px`;
|
|
1482
1359
|
const isCompactPhase = loadingPhase === "collapsing" || loadingPhase === "loading" || loadingPhase === "hiding-spinner";
|
|
1483
1360
|
const hideContent = loadingPhase === "hiding-content" || loadingPhase === "collapsing" || loadingPhase === "loading" || loadingPhase === "hiding-spinner" || loadingPhase === "expanding";
|
|
1484
1361
|
const showSpinner = loadingPhase === "loading";
|
|
1485
1362
|
const iconOnlyActionClassName = isIconOnlyAction ? cn(
|
|
1486
|
-
"h-10 w-10 rounded-[10px] border-0 p-2
|
|
1487
|
-
active ? "bg-[color:var(--sofya-surface-selected)] hover:bg-[color:var(--sofya-surface-selected)]" : "bg-
|
|
1363
|
+
"h-10 w-10 rounded-[10px] border-0 p-2 shadow-none",
|
|
1364
|
+
active ? "bg-[color:var(--sofya-surface-selected)] text-primary hover:bg-[color:var(--sofya-surface-selected)]" : "bg-transparent text-[color:var(--sofya-text-soft)] hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)]"
|
|
1488
1365
|
) : void 0;
|
|
1489
1366
|
const languageButtonClassName = isLanguageButton ? cn(
|
|
1490
1367
|
"min-w-0 overflow-hidden border-0 text-primary-foreground shadow-none",
|
|
@@ -1513,12 +1390,12 @@ var Button = React8.forwardRef(
|
|
|
1513
1390
|
size: resolvedSize,
|
|
1514
1391
|
variant: resolvedVariant
|
|
1515
1392
|
});
|
|
1516
|
-
|
|
1393
|
+
React7.useImperativeHandle(
|
|
1517
1394
|
ref,
|
|
1518
1395
|
() => buttonRef.current
|
|
1519
1396
|
);
|
|
1520
|
-
const buttonContent = isLanguageButton ? null : isIconOnly ? /* @__PURE__ */
|
|
1521
|
-
leftIcon ? /* @__PURE__ */
|
|
1397
|
+
const buttonContent = isLanguageButton ? null : isIconOnly ? /* @__PURE__ */ jsx6("span", { className: iconSlotClassName, children: iconOnlyNode }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1398
|
+
leftIcon ? /* @__PURE__ */ jsx6("span", { className: iconSlotClassName, children: leftIcon }) : null,
|
|
1522
1399
|
hasChildren ? renderTextContent(children, {
|
|
1523
1400
|
as: "span",
|
|
1524
1401
|
className: "inline-flex items-center text-current",
|
|
@@ -1528,9 +1405,9 @@ var Button = React8.forwardRef(
|
|
|
1528
1405
|
letterSpacing: "inherit"
|
|
1529
1406
|
}
|
|
1530
1407
|
}) : null,
|
|
1531
|
-
rightIcon ? /* @__PURE__ */
|
|
1408
|
+
rightIcon ? /* @__PURE__ */ jsx6("span", { className: iconSlotClassName, children: rightIcon }) : null
|
|
1532
1409
|
] });
|
|
1533
|
-
return /* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ jsxs2(
|
|
1534
1411
|
Component,
|
|
1535
1412
|
{
|
|
1536
1413
|
className: cn(
|
|
@@ -1543,6 +1420,7 @@ var Button = React8.forwardRef(
|
|
|
1543
1420
|
"aria-label": props["aria-label"] ?? (isLanguageButton ? resolvedLanguageLabel : void 0),
|
|
1544
1421
|
"aria-pressed": isIconOnlyAction ? active : props["aria-pressed"],
|
|
1545
1422
|
"aria-busy": loading,
|
|
1423
|
+
"data-disabled": showDisabledTreatment ? "true" : void 0,
|
|
1546
1424
|
disabled: asChild ? void 0 : isDisabled,
|
|
1547
1425
|
onClick: handleClick,
|
|
1548
1426
|
onPointerDown: handlePointerDown,
|
|
@@ -1551,7 +1429,7 @@ var Button = React8.forwardRef(
|
|
|
1551
1429
|
style: { ...resolvedButtonStyle, width: resolvedWidthStyle },
|
|
1552
1430
|
...props,
|
|
1553
1431
|
children: [
|
|
1554
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ jsx6(
|
|
1555
1433
|
ButtonRippleLayer,
|
|
1556
1434
|
{
|
|
1557
1435
|
onAnimationComplete: handleRippleComplete,
|
|
@@ -1560,7 +1438,7 @@ var Button = React8.forwardRef(
|
|
|
1560
1438
|
ripples
|
|
1561
1439
|
}
|
|
1562
1440
|
),
|
|
1563
|
-
/* @__PURE__ */
|
|
1441
|
+
/* @__PURE__ */ jsx6(
|
|
1564
1442
|
"span",
|
|
1565
1443
|
{
|
|
1566
1444
|
className: cn(
|
|
@@ -1570,7 +1448,7 @@ var Button = React8.forwardRef(
|
|
|
1570
1448
|
children: buttonContent
|
|
1571
1449
|
}
|
|
1572
1450
|
),
|
|
1573
|
-
/* @__PURE__ */
|
|
1451
|
+
/* @__PURE__ */ jsx6(
|
|
1574
1452
|
"span",
|
|
1575
1453
|
{
|
|
1576
1454
|
"aria-hidden": "true",
|
|
@@ -1578,7 +1456,7 @@ var Button = React8.forwardRef(
|
|
|
1578
1456
|
"pointer-events-none absolute inset-0 z-[2] flex items-center justify-center transition-opacity duration-sofya ease-sofya",
|
|
1579
1457
|
showSpinner ? "opacity-100" : "opacity-0"
|
|
1580
1458
|
),
|
|
1581
|
-
children: /* @__PURE__ */
|
|
1459
|
+
children: /* @__PURE__ */ jsx6(ButtonSpinner, { size: resolvedSize })
|
|
1582
1460
|
}
|
|
1583
1461
|
)
|
|
1584
1462
|
]
|
|
@@ -1588,70 +1466,295 @@ var Button = React8.forwardRef(
|
|
|
1588
1466
|
);
|
|
1589
1467
|
Button.displayName = "Button";
|
|
1590
1468
|
|
|
1591
|
-
// src/components/
|
|
1592
|
-
import
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
...props
|
|
1624
|
-
}
|
|
1625
|
-
);
|
|
1626
|
-
}
|
|
1627
|
-
var SurfaceBase = React9.forwardRef(SurfaceComponent);
|
|
1628
|
-
SurfaceBase.displayName = "Surface";
|
|
1629
|
-
var Surface = SurfaceBase;
|
|
1469
|
+
// src/components/close-button.tsx
|
|
1470
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1471
|
+
var CloseButton = React8.forwardRef(
|
|
1472
|
+
function CloseButton2({
|
|
1473
|
+
className,
|
|
1474
|
+
iconSize = 18,
|
|
1475
|
+
label = "Fechar",
|
|
1476
|
+
size = "icon",
|
|
1477
|
+
type = "button",
|
|
1478
|
+
...props
|
|
1479
|
+
}, ref) {
|
|
1480
|
+
const ariaLabel = props["aria-label"] ?? label;
|
|
1481
|
+
return /* @__PURE__ */ jsx7(
|
|
1482
|
+
Button,
|
|
1483
|
+
{
|
|
1484
|
+
ref,
|
|
1485
|
+
type,
|
|
1486
|
+
variant: "ghost",
|
|
1487
|
+
size,
|
|
1488
|
+
"data-slot": "close-button",
|
|
1489
|
+
"aria-label": ariaLabel,
|
|
1490
|
+
leftIcon: /* @__PURE__ */ jsx7(Icon, { name: "x", size: iconSize }),
|
|
1491
|
+
className: cn(
|
|
1492
|
+
"h-8 w-8 shrink-0 rounded-full bg-transparent text-[color:var(--sofya-text-soft)] hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)]",
|
|
1493
|
+
className
|
|
1494
|
+
),
|
|
1495
|
+
...props
|
|
1496
|
+
}
|
|
1497
|
+
);
|
|
1498
|
+
}
|
|
1499
|
+
);
|
|
1500
|
+
CloseButton.displayName = "CloseButton";
|
|
1630
1501
|
|
|
1631
|
-
// src/components/
|
|
1632
|
-
import { jsx as
|
|
1633
|
-
var
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1502
|
+
// src/components/alert.tsx
|
|
1503
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1504
|
+
var alertToneOptions = [
|
|
1505
|
+
"default",
|
|
1506
|
+
"info",
|
|
1507
|
+
"success",
|
|
1508
|
+
"warning",
|
|
1509
|
+
"destructive"
|
|
1510
|
+
];
|
|
1511
|
+
var alertSizeOptions = ["sm", "default", "lg"];
|
|
1512
|
+
var alertVariants = cva3("flex w-full items-start border", {
|
|
1513
|
+
variants: {
|
|
1514
|
+
size: {
|
|
1515
|
+
sm: "gap-2 rounded-[14px] px-4 py-2",
|
|
1516
|
+
default: "gap-4 rounded-[16px] px-4 py-4",
|
|
1517
|
+
lg: "gap-4 rounded-[18px] px-6 py-4"
|
|
1518
|
+
},
|
|
1519
|
+
tone: {
|
|
1520
|
+
default: "border-[color:var(--sofya-tone-default-border)] bg-[color:var(--sofya-tone-default-background)] text-[color:var(--sofya-tone-default-foreground)]",
|
|
1521
|
+
info: "border-[color:var(--sofya-tone-info-border)] bg-[color:var(--sofya-tone-info-background)] text-[color:var(--sofya-tone-info-foreground)]",
|
|
1522
|
+
success: "border-[color:var(--sofya-tone-success-border)] bg-[color:var(--sofya-tone-success-background)] text-[color:var(--sofya-tone-success-foreground)]",
|
|
1523
|
+
warning: "border-[color:var(--sofya-tone-warning-border)] bg-[color:var(--sofya-tone-warning-background)] text-[color:var(--sofya-tone-warning-foreground)]",
|
|
1524
|
+
destructive: "border-[color:var(--sofya-tone-destructive-border)] bg-[color:var(--sofya-tone-destructive-background)] text-[color:var(--sofya-tone-destructive-foreground)]"
|
|
1525
|
+
}
|
|
1526
|
+
},
|
|
1527
|
+
defaultVariants: {
|
|
1528
|
+
size: "default",
|
|
1529
|
+
tone: "default"
|
|
1530
|
+
}
|
|
1531
|
+
});
|
|
1532
|
+
var toneIconMap = {
|
|
1533
|
+
info: "lightbulb",
|
|
1534
|
+
success: "check",
|
|
1535
|
+
warning: "question",
|
|
1536
|
+
destructive: "x"
|
|
1537
|
+
};
|
|
1538
|
+
var Alert = React9.forwardRef(function Alert2({
|
|
1539
|
+
children,
|
|
1540
|
+
className,
|
|
1541
|
+
dismissLabel = "Dispensar",
|
|
1542
|
+
icon,
|
|
1543
|
+
onDismiss,
|
|
1544
|
+
role,
|
|
1545
|
+
showToneIcon = true,
|
|
1546
|
+
size,
|
|
1547
|
+
tone,
|
|
1548
|
+
...props
|
|
1549
|
+
}, ref) {
|
|
1550
|
+
const resolvedSize = size ?? "default";
|
|
1551
|
+
const resolvedTone = tone ?? "default";
|
|
1552
|
+
const resolvedRole = role ?? (resolvedTone === "warning" || resolvedTone === "destructive" ? "alert" : "status");
|
|
1553
|
+
const toneIconName = resolvedTone !== "default" ? toneIconMap[resolvedTone] : void 0;
|
|
1554
|
+
const resolvedIcon = icon ?? (showToneIcon && toneIconName ? /* @__PURE__ */ jsx8(Icon, { name: toneIconName, size: 16, "aria-hidden": "true" }) : null);
|
|
1555
|
+
return /* @__PURE__ */ jsxs3(
|
|
1556
|
+
"div",
|
|
1557
|
+
{
|
|
1558
|
+
ref,
|
|
1559
|
+
"data-size": resolvedSize,
|
|
1560
|
+
"data-slot": "alert",
|
|
1561
|
+
"data-tone": resolvedTone,
|
|
1562
|
+
role: resolvedRole,
|
|
1563
|
+
className: cn(
|
|
1564
|
+
alertVariants({ size: resolvedSize, tone: resolvedTone }),
|
|
1565
|
+
className
|
|
1566
|
+
),
|
|
1567
|
+
...props,
|
|
1568
|
+
children: [
|
|
1569
|
+
resolvedIcon ? /* @__PURE__ */ jsx8(
|
|
1570
|
+
"span",
|
|
1571
|
+
{
|
|
1572
|
+
"data-slot": "alert-icon",
|
|
1573
|
+
className: "mt-2 inline-flex h-4 w-4 shrink-0 items-center justify-center text-current [&>svg]:h-4 [&>svg]:w-4",
|
|
1574
|
+
children: resolvedIcon
|
|
1575
|
+
}
|
|
1576
|
+
) : null,
|
|
1577
|
+
/* @__PURE__ */ jsx8("div", { "data-slot": "alert-content", className: "flex min-w-0 flex-1 flex-col", children }),
|
|
1578
|
+
onDismiss ? /* @__PURE__ */ jsx8(
|
|
1579
|
+
CloseButton,
|
|
1580
|
+
{
|
|
1581
|
+
label: dismissLabel,
|
|
1582
|
+
onClick: onDismiss,
|
|
1583
|
+
iconSize: 16,
|
|
1584
|
+
className: "-mr-1 -mt-1 text-current hover:text-current"
|
|
1585
|
+
}
|
|
1586
|
+
) : null
|
|
1587
|
+
]
|
|
1588
|
+
}
|
|
1589
|
+
);
|
|
1590
|
+
});
|
|
1591
|
+
var AlertTitle = React9.forwardRef(function AlertTitle2({ children, className, ...props }, ref) {
|
|
1592
|
+
return /* @__PURE__ */ jsx8(
|
|
1593
|
+
"div",
|
|
1594
|
+
{
|
|
1595
|
+
ref,
|
|
1596
|
+
"data-slot": "alert-title",
|
|
1597
|
+
className: cn("text-current", className),
|
|
1598
|
+
...props,
|
|
1599
|
+
children: renderTextContent(children, {
|
|
1600
|
+
as: "span",
|
|
1601
|
+
className: "block text-current",
|
|
1602
|
+
size: "h4"
|
|
1603
|
+
})
|
|
1604
|
+
}
|
|
1605
|
+
);
|
|
1606
|
+
});
|
|
1607
|
+
var AlertDescription = React9.forwardRef(function AlertDescription2({ children, className, ...props }, ref) {
|
|
1608
|
+
return /* @__PURE__ */ jsx8(
|
|
1609
|
+
"div",
|
|
1610
|
+
{
|
|
1611
|
+
ref,
|
|
1612
|
+
"data-slot": "alert-description",
|
|
1613
|
+
className: cn("[&:not(:first-child)]:mt-2 text-current/80", className),
|
|
1614
|
+
...props,
|
|
1615
|
+
children: renderTextContent(children, {
|
|
1616
|
+
as: "span",
|
|
1617
|
+
className: "block text-current/80",
|
|
1618
|
+
size: "tiny"
|
|
1619
|
+
})
|
|
1620
|
+
}
|
|
1621
|
+
);
|
|
1622
|
+
});
|
|
1623
|
+
Alert.displayName = "Alert";
|
|
1624
|
+
AlertTitle.displayName = "AlertTitle";
|
|
1625
|
+
AlertDescription.displayName = "AlertDescription";
|
|
1626
|
+
|
|
1627
|
+
// src/components/badge.tsx
|
|
1628
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
1629
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1630
|
+
var badgeVariantOptions = [
|
|
1631
|
+
"default",
|
|
1632
|
+
"secondary",
|
|
1633
|
+
"outline",
|
|
1634
|
+
"success",
|
|
1635
|
+
"warning",
|
|
1636
|
+
"destructive",
|
|
1637
|
+
"pill"
|
|
1638
|
+
];
|
|
1639
|
+
var badgeAlertOptions = ["default", "medium", "high"];
|
|
1640
|
+
var badgePillToneOptions = ["neutral", "danger"];
|
|
1641
|
+
var badgeVariants = cva4(
|
|
1642
|
+
"inline-flex min-h-[34px] items-center justify-center whitespace-nowrap rounded-[5px] px-4 py-2 [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] font-semibold uppercase leading-none tracking-[0.08em] transition-colors duration-sofya ease-sofya",
|
|
1643
|
+
{
|
|
1644
|
+
variants: {
|
|
1645
|
+
variant: {
|
|
1646
|
+
default: "border-transparent bg-accent/10 text-accent",
|
|
1647
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
|
1648
|
+
outline: "border border-border bg-background text-foreground",
|
|
1649
|
+
success: "border-transparent bg-success/10 text-success",
|
|
1650
|
+
warning: "border-transparent bg-warning/10 text-warning",
|
|
1651
|
+
destructive: "border-transparent bg-destructive/10 text-destructive",
|
|
1652
|
+
pill: ""
|
|
1653
|
+
}
|
|
1654
|
+
},
|
|
1655
|
+
defaultVariants: {
|
|
1656
|
+
variant: "default"
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
);
|
|
1660
|
+
var badgeAlertVariants = cva4(
|
|
1661
|
+
"inline-flex min-h-[34px] items-center justify-center whitespace-nowrap rounded-[5px] px-4 py-2 [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] font-semibold uppercase leading-none tracking-[0.08em] transition-colors duration-sofya ease-sofya",
|
|
1662
|
+
{
|
|
1663
|
+
variants: {
|
|
1664
|
+
alert: {
|
|
1665
|
+
default: "border-transparent bg-accent/10 text-accent",
|
|
1666
|
+
medium: "border-transparent bg-[color:var(--sofya-tone-warning-background)] text-warning",
|
|
1667
|
+
high: "border-transparent bg-[color:var(--sofya-tone-destructive-background)] text-destructive"
|
|
1668
|
+
}
|
|
1669
|
+
},
|
|
1670
|
+
defaultVariants: {
|
|
1671
|
+
alert: "default"
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
);
|
|
1675
|
+
var badgePillVariants = cva4(
|
|
1676
|
+
"inline-flex h-[30px] items-center justify-center whitespace-nowrap rounded-full border px-4 py-2 [font-family:var(--sofya-text-extra-tiny-font-family)] text-[length:var(--sofya-text-extra-tiny-font-size)] font-semibold leading-none tracking-normal transition-colors duration-sofya ease-sofya",
|
|
1677
|
+
{
|
|
1678
|
+
variants: {
|
|
1679
|
+
tone: {
|
|
1680
|
+
neutral: "border-[color:var(--sofya-tone-default-border)] bg-[color:var(--sofya-tone-default-background)] text-[color:var(--sofya-tone-default-foreground)]",
|
|
1681
|
+
danger: "border-[color:var(--sofya-tone-destructive-border)] bg-[color:var(--sofya-tone-destructive-background)] text-[color:var(--sofya-tone-destructive-foreground)]"
|
|
1682
|
+
}
|
|
1683
|
+
},
|
|
1684
|
+
defaultVariants: {
|
|
1685
|
+
tone: "neutral"
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
);
|
|
1689
|
+
function Badge({ className, variant, alert, pillTone, ...props }) {
|
|
1690
|
+
const badgeClassName = variant === "pill" ? badgePillVariants({ tone: pillTone }) : alert ? badgeAlertVariants({ alert }) : badgeVariants({ variant });
|
|
1691
|
+
return /* @__PURE__ */ jsx9("div", { className: cn(badgeClassName, className), ...props });
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
// src/components/surface.tsx
|
|
1695
|
+
import * as React10 from "react";
|
|
1696
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
1697
|
+
import {
|
|
1698
|
+
sofyaSurfaceNames
|
|
1699
|
+
} from "@sofya-ds/tokens";
|
|
1700
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1701
|
+
var surfaceVariantOptions = sofyaSurfaceNames;
|
|
1702
|
+
function toCssTokenName(name) {
|
|
1703
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1704
|
+
}
|
|
1705
|
+
function getSurfaceStyle(variant) {
|
|
1706
|
+
const cssName = toCssTokenName(variant);
|
|
1707
|
+
return {
|
|
1708
|
+
backgroundColor: `hsl(var(--sofya-surface-${cssName}-background))`,
|
|
1709
|
+
borderColor: `hsl(var(--sofya-surface-${cssName}-border-color))`,
|
|
1710
|
+
borderWidth: `var(--sofya-surface-${cssName}-border-width)`,
|
|
1711
|
+
borderStyle: "solid",
|
|
1712
|
+
borderRadius: `var(--sofya-surface-${cssName}-radius)`,
|
|
1713
|
+
"--sofya-surface-shadow-base": `var(--sofya-surface-${cssName}-shadow)`,
|
|
1714
|
+
boxShadow: "var(--sofya-surface-shadow-override, var(--sofya-surface-shadow-base))"
|
|
1715
|
+
};
|
|
1716
|
+
}
|
|
1717
|
+
function SurfaceComponent({ as, asChild = false, variant = "card", className, style, ...props }, ref) {
|
|
1718
|
+
const Component = asChild ? Slot2 : as ?? "div";
|
|
1719
|
+
return /* @__PURE__ */ jsx10(
|
|
1720
|
+
Component,
|
|
1721
|
+
{
|
|
1722
|
+
ref,
|
|
1723
|
+
"data-surface-variant": variant,
|
|
1724
|
+
className: cn("relative text-foreground", className),
|
|
1725
|
+
style: { ...getSurfaceStyle(variant), ...style },
|
|
1726
|
+
...props
|
|
1727
|
+
}
|
|
1728
|
+
);
|
|
1729
|
+
}
|
|
1730
|
+
var SurfaceBase = React10.forwardRef(SurfaceComponent);
|
|
1731
|
+
SurfaceBase.displayName = "Surface";
|
|
1732
|
+
var Surface = SurfaceBase;
|
|
1733
|
+
|
|
1734
|
+
// src/components/card.tsx
|
|
1735
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1736
|
+
var cardVariants = ["card", "focus"];
|
|
1737
|
+
function Card({ className, variant = "card", ...props }) {
|
|
1738
|
+
const hasHoverShadow = variant === "card";
|
|
1739
|
+
return /* @__PURE__ */ jsx11(
|
|
1740
|
+
Surface,
|
|
1741
|
+
{
|
|
1742
|
+
variant,
|
|
1743
|
+
className: cn(
|
|
1744
|
+
"w-full text-card-foreground",
|
|
1745
|
+
hasHoverShadow && "transition-shadow duration-sofya ease-sofya hover:[--sofya-surface-shadow-override:var(--sofya-shadow-md)]",
|
|
1746
|
+
className
|
|
1747
|
+
),
|
|
1748
|
+
...props
|
|
1749
|
+
}
|
|
1750
|
+
);
|
|
1751
|
+
}
|
|
1752
|
+
function CardHeader({ className, ...props }) {
|
|
1753
|
+
return /* @__PURE__ */ jsx11("div", { className: cn("flex flex-col gap-2 p-6", className), ...props });
|
|
1754
|
+
}
|
|
1755
|
+
function CardTitle({ children, className, ...props }) {
|
|
1756
|
+
return /* @__PURE__ */ jsx11(
|
|
1757
|
+
"h3",
|
|
1655
1758
|
{
|
|
1656
1759
|
className: cn("text-card-foreground", className),
|
|
1657
1760
|
...props,
|
|
@@ -1668,26 +1771,26 @@ function CardDescription({
|
|
|
1668
1771
|
className,
|
|
1669
1772
|
...props
|
|
1670
1773
|
}) {
|
|
1671
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ jsx11("p", { className: cn("text-muted-foreground", className), ...props, children: renderTextContent(children, {
|
|
1672
1775
|
as: "span",
|
|
1673
1776
|
className: "block text-muted-foreground",
|
|
1674
1777
|
size: "body"
|
|
1675
1778
|
}) });
|
|
1676
1779
|
}
|
|
1677
1780
|
function CardContent({ children, className, ...props }) {
|
|
1678
|
-
return /* @__PURE__ */
|
|
1781
|
+
return /* @__PURE__ */ jsx11("div", { className: cn("p-6 pt-0", className), ...props, children: renderTextContent(children, {
|
|
1679
1782
|
as: "span"
|
|
1680
1783
|
}) });
|
|
1681
1784
|
}
|
|
1682
1785
|
function CardFooter({ children, className, ...props }) {
|
|
1683
|
-
return /* @__PURE__ */
|
|
1786
|
+
return /* @__PURE__ */ jsx11("div", { className: cn("flex items-center gap-4 p-6 pt-0", className), ...props, children: renderTextContent(children, {
|
|
1684
1787
|
as: "span"
|
|
1685
1788
|
}) });
|
|
1686
1789
|
}
|
|
1687
1790
|
|
|
1688
1791
|
// src/components/checkbox.tsx
|
|
1689
|
-
import * as
|
|
1690
|
-
import { IconCheck as IconCheck2 } from "@tabler/icons-react";
|
|
1792
|
+
import * as React11 from "react";
|
|
1793
|
+
import { IconCheck as IconCheck2, IconMinus } from "@tabler/icons-react";
|
|
1691
1794
|
|
|
1692
1795
|
// src/lib/selection-control-classes.ts
|
|
1693
1796
|
var selectionControlContainerBaseClasses = "flex w-fit gap-4";
|
|
@@ -1709,8 +1812,8 @@ function selectionControlContainerClasses({
|
|
|
1709
1812
|
}
|
|
1710
1813
|
|
|
1711
1814
|
// src/components/checkbox.tsx
|
|
1712
|
-
import { jsx as
|
|
1713
|
-
var Checkbox =
|
|
1815
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1816
|
+
var Checkbox = React11.forwardRef(
|
|
1714
1817
|
function Checkbox2({
|
|
1715
1818
|
checked,
|
|
1716
1819
|
className,
|
|
@@ -1718,15 +1821,24 @@ var Checkbox = React10.forwardRef(
|
|
|
1718
1821
|
description,
|
|
1719
1822
|
descriptionClassName,
|
|
1720
1823
|
disabled,
|
|
1824
|
+
error = false,
|
|
1721
1825
|
id,
|
|
1826
|
+
indeterminate = false,
|
|
1722
1827
|
label,
|
|
1723
1828
|
labelClassName,
|
|
1724
1829
|
...props
|
|
1725
1830
|
}, ref) {
|
|
1726
|
-
const generatedId =
|
|
1831
|
+
const generatedId = React11.useId();
|
|
1727
1832
|
const resolvedId = id ?? generatedId;
|
|
1728
1833
|
const descriptionId = description ? `${resolvedId}-description` : void 0;
|
|
1729
1834
|
const alignClassName2 = description ? "items-start" : "items-center";
|
|
1835
|
+
const innerRef = React11.useRef(null);
|
|
1836
|
+
React11.useImperativeHandle(ref, () => innerRef.current);
|
|
1837
|
+
React11.useEffect(() => {
|
|
1838
|
+
if (innerRef.current) {
|
|
1839
|
+
innerRef.current.indeterminate = indeterminate;
|
|
1840
|
+
}
|
|
1841
|
+
}, [indeterminate, checked]);
|
|
1730
1842
|
return /* @__PURE__ */ jsxs4(
|
|
1731
1843
|
"label",
|
|
1732
1844
|
{
|
|
@@ -1737,34 +1849,58 @@ var Checkbox = React10.forwardRef(
|
|
|
1737
1849
|
disabled
|
|
1738
1850
|
}),
|
|
1739
1851
|
children: [
|
|
1740
|
-
/* @__PURE__ */
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
"
|
|
1758
|
-
|
|
1759
|
-
"
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1852
|
+
/* @__PURE__ */ jsxs4("span", { className: "relative inline-flex h-5 w-5 shrink-0", children: [
|
|
1853
|
+
/* @__PURE__ */ jsx12(
|
|
1854
|
+
"input",
|
|
1855
|
+
{
|
|
1856
|
+
ref: innerRef,
|
|
1857
|
+
id: resolvedId,
|
|
1858
|
+
type: "checkbox",
|
|
1859
|
+
className: "peer sr-only",
|
|
1860
|
+
checked,
|
|
1861
|
+
defaultChecked,
|
|
1862
|
+
disabled,
|
|
1863
|
+
"aria-invalid": error || void 0,
|
|
1864
|
+
"aria-describedby": descriptionId,
|
|
1865
|
+
...props
|
|
1866
|
+
}
|
|
1867
|
+
),
|
|
1868
|
+
/* @__PURE__ */ jsx12(
|
|
1869
|
+
"span",
|
|
1870
|
+
{
|
|
1871
|
+
"aria-hidden": "true",
|
|
1872
|
+
"data-error": error ? "true" : void 0,
|
|
1873
|
+
className: cn(
|
|
1874
|
+
"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-[8px]",
|
|
1875
|
+
selectionControlControlBaseClasses,
|
|
1876
|
+
// Visible resting border on light surfaces (token-based, ~3.5:1).
|
|
1877
|
+
"border-muted-foreground",
|
|
1878
|
+
"peer-checked:border-primary peer-checked:bg-primary peer-indeterminate:border-primary peer-indeterminate:bg-primary",
|
|
1879
|
+
"peer-focus-visible:ring-2 peer-focus-visible:ring-[color:var(--sofya-focus-ring-soft)] peer-focus-visible:ring-offset-0",
|
|
1880
|
+
// Error state overrides the border/ring with destructive tokens.
|
|
1881
|
+
"data-[error=true]:border-destructive peer-focus-visible:data-[error=true]:ring-[color:var(--sofya-tone-destructive-border)]"
|
|
1882
|
+
)
|
|
1883
|
+
}
|
|
1884
|
+
),
|
|
1885
|
+
/* @__PURE__ */ jsx12(
|
|
1886
|
+
IconCheck2,
|
|
1887
|
+
{
|
|
1888
|
+
"aria-hidden": "true",
|
|
1889
|
+
className: "pointer-events-none absolute left-1/2 top-1/2 h-4 w-4 -translate-x-1/2 -translate-y-1/2 text-primary-foreground opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-0",
|
|
1890
|
+
stroke: 2.4
|
|
1891
|
+
}
|
|
1892
|
+
),
|
|
1893
|
+
/* @__PURE__ */ jsx12(
|
|
1894
|
+
IconMinus,
|
|
1895
|
+
{
|
|
1896
|
+
"aria-hidden": "true",
|
|
1897
|
+
className: "pointer-events-none absolute left-1/2 top-1/2 h-4 w-4 -translate-x-1/2 -translate-y-1/2 text-primary-foreground opacity-0 peer-indeterminate:opacity-100",
|
|
1898
|
+
stroke: 2.4
|
|
1899
|
+
}
|
|
1900
|
+
)
|
|
1901
|
+
] }),
|
|
1766
1902
|
label || description ? /* @__PURE__ */ jsxs4("span", { className: selectionControlContentBaseClasses, children: [
|
|
1767
|
-
label ? /* @__PURE__ */
|
|
1903
|
+
label ? /* @__PURE__ */ jsx12(
|
|
1768
1904
|
"span",
|
|
1769
1905
|
{
|
|
1770
1906
|
className: cn(
|
|
@@ -1778,7 +1914,7 @@ var Checkbox = React10.forwardRef(
|
|
|
1778
1914
|
})
|
|
1779
1915
|
}
|
|
1780
1916
|
) : null,
|
|
1781
|
-
description ? /* @__PURE__ */
|
|
1917
|
+
description ? /* @__PURE__ */ jsx12(
|
|
1782
1918
|
"span",
|
|
1783
1919
|
{
|
|
1784
1920
|
id: descriptionId,
|
|
@@ -1802,20 +1938,20 @@ var Checkbox = React10.forwardRef(
|
|
|
1802
1938
|
Checkbox.displayName = "Checkbox";
|
|
1803
1939
|
|
|
1804
1940
|
// src/components/dropdown.tsx
|
|
1805
|
-
import * as
|
|
1941
|
+
import * as React13 from "react";
|
|
1806
1942
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1807
1943
|
|
|
1808
1944
|
// src/lib/use-controllable-state.ts
|
|
1809
|
-
import * as
|
|
1945
|
+
import * as React12 from "react";
|
|
1810
1946
|
function useControllableState({
|
|
1811
1947
|
defaultValue,
|
|
1812
1948
|
onChange,
|
|
1813
1949
|
value
|
|
1814
1950
|
}) {
|
|
1815
1951
|
const isControlled = value !== void 0;
|
|
1816
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
1952
|
+
const [uncontrolledValue, setUncontrolledValue] = React12.useState(defaultValue);
|
|
1817
1953
|
const currentValue = isControlled ? value : uncontrolledValue;
|
|
1818
|
-
const setValue =
|
|
1954
|
+
const setValue = React12.useCallback(
|
|
1819
1955
|
(nextValue) => {
|
|
1820
1956
|
if (!isControlled) {
|
|
1821
1957
|
setUncontrolledValue(nextValue);
|
|
@@ -1828,7 +1964,7 @@ function useControllableState({
|
|
|
1828
1964
|
}
|
|
1829
1965
|
|
|
1830
1966
|
// src/components/dropdown.tsx
|
|
1831
|
-
import { jsx as
|
|
1967
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1832
1968
|
var dropdownVariantOptions = [
|
|
1833
1969
|
"card",
|
|
1834
1970
|
"language",
|
|
@@ -1921,11 +2057,11 @@ function resolveAccessibleText(node) {
|
|
|
1921
2057
|
if (typeof node === "string" || typeof node === "number") {
|
|
1922
2058
|
return String(node);
|
|
1923
2059
|
}
|
|
1924
|
-
const parts =
|
|
2060
|
+
const parts = React13.Children.toArray(node).map((child) => {
|
|
1925
2061
|
if (typeof child === "string" || typeof child === "number") {
|
|
1926
2062
|
return String(child);
|
|
1927
2063
|
}
|
|
1928
|
-
if (
|
|
2064
|
+
if (React13.isValidElement(child)) {
|
|
1929
2065
|
return resolveAccessibleText(child.props.children);
|
|
1930
2066
|
}
|
|
1931
2067
|
return void 0;
|
|
@@ -1935,7 +2071,7 @@ function resolveAccessibleText(node) {
|
|
|
1935
2071
|
}
|
|
1936
2072
|
function DefaultDropdownTriggerIcon({ variant }) {
|
|
1937
2073
|
if (variant === "selected") {
|
|
1938
|
-
return /* @__PURE__ */
|
|
2074
|
+
return /* @__PURE__ */ jsx13(
|
|
1939
2075
|
Icon,
|
|
1940
2076
|
{
|
|
1941
2077
|
name: "caret-down",
|
|
@@ -1943,16 +2079,16 @@ function DefaultDropdownTriggerIcon({ variant }) {
|
|
|
1943
2079
|
}
|
|
1944
2080
|
);
|
|
1945
2081
|
}
|
|
1946
|
-
return /* @__PURE__ */
|
|
2082
|
+
return /* @__PURE__ */ jsx13("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px]", children: /* @__PURE__ */ jsx13(Icon, { name: "caret-down", className: "!h-4 !w-4" }) });
|
|
1947
2083
|
}
|
|
1948
2084
|
function DefaultDropdownItemIndicator() {
|
|
1949
|
-
return /* @__PURE__ */
|
|
2085
|
+
return /* @__PURE__ */ jsx13(Icon, { name: "check", size: 16 });
|
|
1950
2086
|
}
|
|
1951
2087
|
function DefaultDropdownInlineCheck() {
|
|
1952
|
-
return /* @__PURE__ */
|
|
2088
|
+
return /* @__PURE__ */ jsx13(Icon, { name: "check", size: 14 });
|
|
1953
2089
|
}
|
|
1954
2090
|
function LanguageFlagIcon({ locale }) {
|
|
1955
|
-
return /* @__PURE__ */
|
|
2091
|
+
return /* @__PURE__ */ jsx13(
|
|
1956
2092
|
"img",
|
|
1957
2093
|
{
|
|
1958
2094
|
alt: "",
|
|
@@ -1992,7 +2128,7 @@ function Dropdown({
|
|
|
1992
2128
|
const resolvedAppearance = resolveDropdownAppearance({ appearance, variant });
|
|
1993
2129
|
const triggerSizeFamily = isIconOnlyTrigger ? "action" : resolveDropdownTriggerSizeFamily(variant);
|
|
1994
2130
|
const usesDefaultListStyle = !isLanguageVariant && !isActionVariant;
|
|
1995
|
-
const resolvedItems =
|
|
2131
|
+
const resolvedItems = React13.useMemo(
|
|
1996
2132
|
() => isLanguageVariant ? items && items.length > 0 ? items : dropdownLanguageItems : items ?? [],
|
|
1997
2133
|
[isLanguageVariant, items]
|
|
1998
2134
|
);
|
|
@@ -2002,14 +2138,14 @@ function Dropdown({
|
|
|
2002
2138
|
onChange: onValueChange,
|
|
2003
2139
|
value
|
|
2004
2140
|
});
|
|
2005
|
-
const [subValues, setSubValues] =
|
|
2141
|
+
const [subValues, setSubValues] = React13.useState({});
|
|
2006
2142
|
const radioValue = selectedValue ?? "";
|
|
2007
2143
|
const selectedItem = resolvedItems.find(
|
|
2008
2144
|
(item) => item.value === selectedValue
|
|
2009
2145
|
);
|
|
2010
2146
|
const hasSelectedItem = selectedItem !== void 0;
|
|
2011
2147
|
const selectedLanguageLocale = resolveItemLanguageLocale(selectedItem);
|
|
2012
|
-
|
|
2148
|
+
React13.useEffect(() => {
|
|
2013
2149
|
if (value !== void 0) {
|
|
2014
2150
|
return;
|
|
2015
2151
|
}
|
|
@@ -2024,7 +2160,7 @@ function Dropdown({
|
|
|
2024
2160
|
setUncontrolledSelectedValue,
|
|
2025
2161
|
value
|
|
2026
2162
|
]);
|
|
2027
|
-
const resolvedTriggerIcon = isLanguageVariant || isActionVariant || isIconOnlyTrigger ? void 0 : triggerIcon === void 0 ? /* @__PURE__ */
|
|
2163
|
+
const resolvedTriggerIcon = isLanguageVariant || isActionVariant || isIconOnlyTrigger ? void 0 : triggerIcon === void 0 ? /* @__PURE__ */ jsx13(DefaultDropdownTriggerIcon, { variant }) : triggerIcon;
|
|
2028
2164
|
const triggerLabel = selectedItem?.triggerLabel ?? selectedItem?.label ?? placeholder;
|
|
2029
2165
|
const iconOnlyAriaLabel = isIconOnlyTrigger ? resolveAccessibleText(triggerLabel) : void 0;
|
|
2030
2166
|
const selectedTriggerToneClassName = isSelectedVariant ? hasSelectedItem ? "text-foreground" : "text-[color:var(--sofya-text-soft)]" : void 0;
|
|
@@ -2036,7 +2172,7 @@ function Dropdown({
|
|
|
2036
2172
|
onOpenChange,
|
|
2037
2173
|
open,
|
|
2038
2174
|
children: [
|
|
2039
|
-
/* @__PURE__ */
|
|
2175
|
+
/* @__PURE__ */ jsx13(DropdownMenuPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ jsx13(
|
|
2040
2176
|
Button,
|
|
2041
2177
|
{
|
|
2042
2178
|
type: "button",
|
|
@@ -2054,16 +2190,16 @@ function Dropdown({
|
|
|
2054
2190
|
isIconOnlyTrigger && "flex items-center justify-center",
|
|
2055
2191
|
triggerClassName
|
|
2056
2192
|
),
|
|
2057
|
-
leftIcon: isActionVariant || isIconOnlyTrigger ? iconTriggerSize !== void 0 ? /* @__PURE__ */
|
|
2193
|
+
leftIcon: isActionVariant || isIconOnlyTrigger ? iconTriggerSize !== void 0 ? /* @__PURE__ */ jsx13("span", { style: { fontSize: iconTriggerSize }, children: iconTrigger }) : iconTrigger : void 0,
|
|
2058
2194
|
rightIcon: resolvedTriggerIcon,
|
|
2059
|
-
children: isLanguageVariant || isActionVariant || isIconOnlyTrigger ? null : /* @__PURE__ */
|
|
2195
|
+
children: isLanguageVariant || isActionVariant || isIconOnlyTrigger ? null : /* @__PURE__ */ jsx13("span", { className: "min-w-0 truncate", children: renderTextContent(triggerLabel, {
|
|
2060
2196
|
as: "span",
|
|
2061
2197
|
className: "block min-w-0 truncate text-inherit",
|
|
2062
2198
|
size: "tiny"
|
|
2063
2199
|
}) })
|
|
2064
2200
|
}
|
|
2065
2201
|
) }),
|
|
2066
|
-
/* @__PURE__ */
|
|
2202
|
+
/* @__PURE__ */ jsx13(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx13(
|
|
2067
2203
|
DropdownMenuPrimitive.Content,
|
|
2068
2204
|
{
|
|
2069
2205
|
align,
|
|
@@ -2075,7 +2211,7 @@ function Dropdown({
|
|
|
2075
2211
|
dropdownAppearanceClasses[resolvedAppearance].content,
|
|
2076
2212
|
contentClassName
|
|
2077
2213
|
),
|
|
2078
|
-
children: /* @__PURE__ */
|
|
2214
|
+
children: /* @__PURE__ */ jsx13(
|
|
2079
2215
|
DropdownMenuPrimitive.RadioGroup,
|
|
2080
2216
|
{
|
|
2081
2217
|
value: radioValue,
|
|
@@ -2084,8 +2220,8 @@ function Dropdown({
|
|
|
2084
2220
|
children: resolvedItems.map((item) => {
|
|
2085
2221
|
const isSelected = item.value === selectedValue;
|
|
2086
2222
|
const itemLanguageLocale = resolveItemLanguageLocale(item);
|
|
2087
|
-
const indicator = item.indicator ?? /* @__PURE__ */
|
|
2088
|
-
const itemIcon = item.icon ?? (variant === "language" && itemLanguageLocale ? /* @__PURE__ */
|
|
2223
|
+
const indicator = item.indicator ?? /* @__PURE__ */ jsx13(DefaultDropdownItemIndicator, {});
|
|
2224
|
+
const itemIcon = item.icon ?? (variant === "language" && itemLanguageLocale ? /* @__PURE__ */ jsx13(LanguageFlagIcon, { locale: itemLanguageLocale }) : null);
|
|
2089
2225
|
if (isActionVariant && item.subItems && item.subItems.length > 0) {
|
|
2090
2226
|
const currentSubValue = subValues[item.value];
|
|
2091
2227
|
return /* @__PURE__ */ jsxs5(DropdownMenuPrimitive.Sub, { children: [
|
|
@@ -2100,17 +2236,17 @@ function Dropdown({
|
|
|
2100
2236
|
itemClassName
|
|
2101
2237
|
),
|
|
2102
2238
|
children: [
|
|
2103
|
-
itemIcon && /* @__PURE__ */
|
|
2104
|
-
/* @__PURE__ */
|
|
2239
|
+
itemIcon && /* @__PURE__ */ jsx13("span", { className: "flex shrink-0 items-center justify-center", children: itemIcon }),
|
|
2240
|
+
/* @__PURE__ */ jsx13("span", { className: "min-w-0 flex-1 truncate", children: renderTextContent(item.label, {
|
|
2105
2241
|
as: "span",
|
|
2106
2242
|
className: "block truncate text-inherit",
|
|
2107
2243
|
size: "tiny"
|
|
2108
2244
|
}) }),
|
|
2109
|
-
/* @__PURE__ */
|
|
2245
|
+
/* @__PURE__ */ jsx13("span", { className: "flex shrink-0 items-center justify-center text-[color:var(--sofya-text-subtle)]", children: /* @__PURE__ */ jsx13(Icon, { name: "caret-right", size: 12 }) })
|
|
2110
2246
|
]
|
|
2111
2247
|
}
|
|
2112
2248
|
),
|
|
2113
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ jsx13(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx13(
|
|
2114
2250
|
DropdownMenuPrimitive.SubContent,
|
|
2115
2251
|
{
|
|
2116
2252
|
sideOffset: 4,
|
|
@@ -2118,7 +2254,7 @@ function Dropdown({
|
|
|
2118
2254
|
"sofya-dropdown-content z-50 w-[224px] min-w-[224px] overflow-hidden border bg-card p-2 outline-none",
|
|
2119
2255
|
"rounded-[20px] border-[color:var(--sofya-border-strong)] text-foreground shadow-[var(--sofya-shadow-soft)]"
|
|
2120
2256
|
),
|
|
2121
|
-
children: /* @__PURE__ */
|
|
2257
|
+
children: /* @__PURE__ */ jsx13(
|
|
2122
2258
|
DropdownMenuPrimitive.RadioGroup,
|
|
2123
2259
|
{
|
|
2124
2260
|
value: currentSubValue ?? "",
|
|
@@ -2142,13 +2278,13 @@ function Dropdown({
|
|
|
2142
2278
|
"data-[highlighted]:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-40"
|
|
2143
2279
|
),
|
|
2144
2280
|
children: [
|
|
2145
|
-
subItem.icon && /* @__PURE__ */
|
|
2146
|
-
/* @__PURE__ */
|
|
2281
|
+
subItem.icon && /* @__PURE__ */ jsx13("span", { className: "flex shrink-0 items-center justify-center", children: subItem.icon }),
|
|
2282
|
+
/* @__PURE__ */ jsx13("span", { className: "min-w-0 flex-1 truncate", children: renderTextContent(subItem.label, {
|
|
2147
2283
|
as: "span",
|
|
2148
2284
|
className: "block truncate text-inherit",
|
|
2149
2285
|
size: "tiny"
|
|
2150
2286
|
}) }),
|
|
2151
|
-
/* @__PURE__ */
|
|
2287
|
+
/* @__PURE__ */ jsx13(
|
|
2152
2288
|
"span",
|
|
2153
2289
|
{
|
|
2154
2290
|
"aria-hidden": "true",
|
|
@@ -2156,7 +2292,7 @@ function Dropdown({
|
|
|
2156
2292
|
"flex h-4 w-4 shrink-0 items-center justify-center text-primary transition-opacity duration-sofya ease-sofya",
|
|
2157
2293
|
isSubSelected ? "opacity-100" : "opacity-0"
|
|
2158
2294
|
),
|
|
2159
|
-
children: /* @__PURE__ */
|
|
2295
|
+
children: /* @__PURE__ */ jsx13(DefaultDropdownItemIndicator, {})
|
|
2160
2296
|
}
|
|
2161
2297
|
)
|
|
2162
2298
|
]
|
|
@@ -2173,7 +2309,7 @@ function Dropdown({
|
|
|
2173
2309
|
if (usesDefaultListStyle && item.subItems && item.subItems.length > 0) {
|
|
2174
2310
|
const currentSubValue = subValues[item.value];
|
|
2175
2311
|
return /* @__PURE__ */ jsxs5(DropdownMenuPrimitive.Sub, { children: [
|
|
2176
|
-
/* @__PURE__ */
|
|
2312
|
+
/* @__PURE__ */ jsx13(
|
|
2177
2313
|
DropdownMenuPrimitive.SubTrigger,
|
|
2178
2314
|
{
|
|
2179
2315
|
disabled: item.disabled,
|
|
@@ -2189,19 +2325,19 @@ function Dropdown({
|
|
|
2189
2325
|
"data-dropdown-item-body": true,
|
|
2190
2326
|
className: "inline-flex min-w-0 items-center gap-2 rounded-full px-4 py-2 transition-colors duration-sofya ease-sofya bg-transparent",
|
|
2191
2327
|
children: [
|
|
2192
|
-
itemIcon ? /* @__PURE__ */
|
|
2193
|
-
/* @__PURE__ */
|
|
2328
|
+
itemIcon ? /* @__PURE__ */ jsx13("span", { className: "flex shrink-0 items-center justify-center", children: itemIcon }) : null,
|
|
2329
|
+
/* @__PURE__ */ jsx13("span", { className: "truncate", children: renderTextContent(item.label, {
|
|
2194
2330
|
as: "span",
|
|
2195
2331
|
className: "block truncate text-inherit",
|
|
2196
2332
|
size: "tiny"
|
|
2197
2333
|
}) }),
|
|
2198
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ jsx13("span", { className: "flex shrink-0 items-center justify-center text-[color:var(--sofya-text-subtle)]", children: /* @__PURE__ */ jsx13(Icon, { name: "caret-right", size: 12 }) })
|
|
2199
2335
|
]
|
|
2200
2336
|
}
|
|
2201
2337
|
)
|
|
2202
2338
|
}
|
|
2203
2339
|
),
|
|
2204
|
-
/* @__PURE__ */
|
|
2340
|
+
/* @__PURE__ */ jsx13(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx13(
|
|
2205
2341
|
DropdownMenuPrimitive.SubContent,
|
|
2206
2342
|
{
|
|
2207
2343
|
sideOffset: 4,
|
|
@@ -2209,7 +2345,7 @@ function Dropdown({
|
|
|
2209
2345
|
"sofya-dropdown-content z-50 w-auto min-w-[var(--radix-dropdown-menu-trigger-width)] max-w-[224px] overflow-hidden border bg-card p-2 outline-none",
|
|
2210
2346
|
"rounded-[20px] border-[color:var(--sofya-border-strong)] text-foreground shadow-[var(--sofya-shadow-soft)]"
|
|
2211
2347
|
),
|
|
2212
|
-
children: /* @__PURE__ */
|
|
2348
|
+
children: /* @__PURE__ */ jsx13(
|
|
2213
2349
|
DropdownMenuPrimitive.RadioGroup,
|
|
2214
2350
|
{
|
|
2215
2351
|
value: currentSubValue ?? "",
|
|
@@ -2223,7 +2359,7 @@ function Dropdown({
|
|
|
2223
2359
|
className: "grid gap-1",
|
|
2224
2360
|
children: item.subItems.map((subItem) => {
|
|
2225
2361
|
const isSubSelected = subItem.value === currentSubValue;
|
|
2226
|
-
return /* @__PURE__ */
|
|
2362
|
+
return /* @__PURE__ */ jsx13(
|
|
2227
2363
|
DropdownMenuPrimitive.RadioItem,
|
|
2228
2364
|
{
|
|
2229
2365
|
value: subItem.value,
|
|
@@ -2241,18 +2377,18 @@ function Dropdown({
|
|
|
2241
2377
|
isSubSelected ? "bg-[color:var(--sofya-surface-selected)]" : "bg-transparent"
|
|
2242
2378
|
),
|
|
2243
2379
|
children: [
|
|
2244
|
-
subItem.icon ? /* @__PURE__ */
|
|
2245
|
-
/* @__PURE__ */
|
|
2380
|
+
subItem.icon ? /* @__PURE__ */ jsx13("span", { className: "flex shrink-0 items-center justify-center", children: subItem.icon }) : null,
|
|
2381
|
+
/* @__PURE__ */ jsx13("span", { className: "min-w-0 truncate", children: renderTextContent(subItem.label, {
|
|
2246
2382
|
as: "span",
|
|
2247
2383
|
className: "block truncate text-inherit",
|
|
2248
2384
|
size: "tiny"
|
|
2249
2385
|
}) }),
|
|
2250
|
-
isSubSelected ? /* @__PURE__ */
|
|
2386
|
+
isSubSelected ? /* @__PURE__ */ jsx13(
|
|
2251
2387
|
"span",
|
|
2252
2388
|
{
|
|
2253
2389
|
"aria-hidden": "true",
|
|
2254
2390
|
className: "flex h-[14px] w-[14px] shrink-0 items-center justify-center",
|
|
2255
|
-
children: /* @__PURE__ */
|
|
2391
|
+
children: /* @__PURE__ */ jsx13(DefaultDropdownInlineCheck, {})
|
|
2256
2392
|
}
|
|
2257
2393
|
) : null
|
|
2258
2394
|
]
|
|
@@ -2281,13 +2417,13 @@ function Dropdown({
|
|
|
2281
2417
|
itemClassName
|
|
2282
2418
|
),
|
|
2283
2419
|
children: [
|
|
2284
|
-
itemIcon && /* @__PURE__ */
|
|
2285
|
-
/* @__PURE__ */
|
|
2420
|
+
itemIcon && /* @__PURE__ */ jsx13("span", { className: "flex shrink-0 items-center justify-center", children: itemIcon }),
|
|
2421
|
+
/* @__PURE__ */ jsx13("span", { className: "min-w-0 flex-1 truncate", children: renderTextContent(item.label, {
|
|
2286
2422
|
as: "span",
|
|
2287
2423
|
className: "block truncate text-inherit",
|
|
2288
2424
|
size: "tiny"
|
|
2289
2425
|
}) }),
|
|
2290
|
-
/* @__PURE__ */
|
|
2426
|
+
/* @__PURE__ */ jsx13(
|
|
2291
2427
|
"span",
|
|
2292
2428
|
{
|
|
2293
2429
|
"aria-hidden": "true",
|
|
@@ -2303,7 +2439,7 @@ function Dropdown({
|
|
|
2303
2439
|
item.value
|
|
2304
2440
|
);
|
|
2305
2441
|
}
|
|
2306
|
-
return /* @__PURE__ */
|
|
2442
|
+
return /* @__PURE__ */ jsx13(
|
|
2307
2443
|
DropdownMenuPrimitive.RadioItem,
|
|
2308
2444
|
{
|
|
2309
2445
|
value: item.value,
|
|
@@ -2323,18 +2459,18 @@ function Dropdown({
|
|
|
2323
2459
|
isSelected ? "bg-[color:var(--sofya-surface-selected)]" : "bg-transparent"
|
|
2324
2460
|
),
|
|
2325
2461
|
children: [
|
|
2326
|
-
itemIcon ? /* @__PURE__ */
|
|
2327
|
-
/* @__PURE__ */
|
|
2462
|
+
itemIcon ? /* @__PURE__ */ jsx13("span", { className: "flex shrink-0 items-center justify-center", children: itemIcon }) : null,
|
|
2463
|
+
/* @__PURE__ */ jsx13("span", { className: "truncate", children: renderTextContent(item.label, {
|
|
2328
2464
|
as: "span",
|
|
2329
2465
|
className: "block truncate text-inherit",
|
|
2330
2466
|
size: "tiny"
|
|
2331
2467
|
}) }),
|
|
2332
|
-
isSelected ? /* @__PURE__ */
|
|
2468
|
+
isSelected ? /* @__PURE__ */ jsx13(
|
|
2333
2469
|
"span",
|
|
2334
2470
|
{
|
|
2335
2471
|
"aria-hidden": "true",
|
|
2336
2472
|
className: "flex h-[14px] w-[14px] shrink-0 items-center justify-center",
|
|
2337
|
-
children: /* @__PURE__ */
|
|
2473
|
+
children: /* @__PURE__ */ jsx13(DefaultDropdownInlineCheck, {})
|
|
2338
2474
|
}
|
|
2339
2475
|
) : null
|
|
2340
2476
|
]
|
|
@@ -2354,14 +2490,14 @@ function Dropdown({
|
|
|
2354
2490
|
}
|
|
2355
2491
|
|
|
2356
2492
|
// src/components/dropdown-search.tsx
|
|
2357
|
-
import * as
|
|
2493
|
+
import * as React19 from "react";
|
|
2358
2494
|
|
|
2359
2495
|
// src/components/input.tsx
|
|
2360
|
-
import * as
|
|
2496
|
+
import * as React16 from "react";
|
|
2361
2497
|
import { REGEXP_ONLY_DIGITS as REGEXP_ONLY_DIGITS2 } from "input-otp";
|
|
2362
2498
|
|
|
2363
2499
|
// src/lib/field-shell.tsx
|
|
2364
|
-
import { jsx as
|
|
2500
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2365
2501
|
function FieldLabel({
|
|
2366
2502
|
children,
|
|
2367
2503
|
className,
|
|
@@ -2376,7 +2512,7 @@ function FieldLabel({
|
|
|
2376
2512
|
return null;
|
|
2377
2513
|
}
|
|
2378
2514
|
const Component = htmlFor ? "label" : "div";
|
|
2379
|
-
return /* @__PURE__ */
|
|
2515
|
+
return /* @__PURE__ */ jsx14(
|
|
2380
2516
|
Component,
|
|
2381
2517
|
{
|
|
2382
2518
|
className: cn("text-[color:var(--sofya-text-default)]", className),
|
|
@@ -2404,7 +2540,7 @@ function FieldShell({
|
|
|
2404
2540
|
return control;
|
|
2405
2541
|
}
|
|
2406
2542
|
return /* @__PURE__ */ jsxs6("div", { className: cn("grid w-full gap-2", containerClassName), children: [
|
|
2407
|
-
label ? /* @__PURE__ */
|
|
2543
|
+
label ? /* @__PURE__ */ jsx14(
|
|
2408
2544
|
FieldLabel,
|
|
2409
2545
|
{
|
|
2410
2546
|
className: labelClassName,
|
|
@@ -2420,7 +2556,7 @@ function FieldShell({
|
|
|
2420
2556
|
}
|
|
2421
2557
|
|
|
2422
2558
|
// src/components/input-upload.tsx
|
|
2423
|
-
import * as
|
|
2559
|
+
import * as React14 from "react";
|
|
2424
2560
|
import {
|
|
2425
2561
|
IconFileText,
|
|
2426
2562
|
IconPhoto,
|
|
@@ -2428,7 +2564,7 @@ import {
|
|
|
2428
2564
|
IconVideo
|
|
2429
2565
|
} from "@tabler/icons-react";
|
|
2430
2566
|
import { AnimatePresence, motion as motion2, useReducedMotion as useReducedMotion2 } from "motion/react";
|
|
2431
|
-
import { jsx as
|
|
2567
|
+
import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2432
2568
|
var uploadKindOptions = ["document", "image", "video"];
|
|
2433
2569
|
var uploadAcceptByKind = {
|
|
2434
2570
|
document: ".pdf,.doc,.docx,.txt,.rtf,.odt,.jpg,.jpeg,.png,.webp,.gif",
|
|
@@ -2522,7 +2658,7 @@ function resolveUploadFileVisualKind(file, fallbackKind) {
|
|
|
2522
2658
|
return "document";
|
|
2523
2659
|
}
|
|
2524
2660
|
function UploadGlyph({ className }) {
|
|
2525
|
-
return /* @__PURE__ */
|
|
2661
|
+
return /* @__PURE__ */ jsx15(
|
|
2526
2662
|
IconUpload,
|
|
2527
2663
|
{
|
|
2528
2664
|
"aria-hidden": "true",
|
|
@@ -2535,7 +2671,7 @@ function UploadFileTypeGlyph({
|
|
|
2535
2671
|
kind
|
|
2536
2672
|
}) {
|
|
2537
2673
|
if (kind === "image") {
|
|
2538
|
-
return /* @__PURE__ */
|
|
2674
|
+
return /* @__PURE__ */ jsx15(
|
|
2539
2675
|
IconPhoto,
|
|
2540
2676
|
{
|
|
2541
2677
|
"aria-hidden": "true",
|
|
@@ -2544,7 +2680,7 @@ function UploadFileTypeGlyph({
|
|
|
2544
2680
|
);
|
|
2545
2681
|
}
|
|
2546
2682
|
if (kind === "video") {
|
|
2547
|
-
return /* @__PURE__ */
|
|
2683
|
+
return /* @__PURE__ */ jsx15(
|
|
2548
2684
|
IconVideo,
|
|
2549
2685
|
{
|
|
2550
2686
|
"aria-hidden": "true",
|
|
@@ -2552,7 +2688,7 @@ function UploadFileTypeGlyph({
|
|
|
2552
2688
|
}
|
|
2553
2689
|
);
|
|
2554
2690
|
}
|
|
2555
|
-
return /* @__PURE__ */
|
|
2691
|
+
return /* @__PURE__ */ jsx15(
|
|
2556
2692
|
IconFileText,
|
|
2557
2693
|
{
|
|
2558
2694
|
"aria-hidden": "true",
|
|
@@ -2560,7 +2696,7 @@ function UploadFileTypeGlyph({
|
|
|
2560
2696
|
}
|
|
2561
2697
|
);
|
|
2562
2698
|
}
|
|
2563
|
-
var UploadInputControl =
|
|
2699
|
+
var UploadInputControl = React14.forwardRef(function UploadInputControl2({
|
|
2564
2700
|
accept,
|
|
2565
2701
|
"aria-label": ariaLabel,
|
|
2566
2702
|
className,
|
|
@@ -2574,17 +2710,17 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2574
2710
|
resolvedId,
|
|
2575
2711
|
...uploadProps
|
|
2576
2712
|
}, ref) {
|
|
2577
|
-
const inputRef =
|
|
2578
|
-
const [isDragActive, setIsDragActive] =
|
|
2579
|
-
const [selectedFiles, setSelectedFiles] =
|
|
2713
|
+
const inputRef = React14.useRef(null);
|
|
2714
|
+
const [isDragActive, setIsDragActive] = React14.useState(false);
|
|
2715
|
+
const [selectedFiles, setSelectedFiles] = React14.useState([]);
|
|
2580
2716
|
const resolvedMultiple = multiple ?? true;
|
|
2581
2717
|
const prefersReducedMotion = useReducedMotion2();
|
|
2582
|
-
|
|
2718
|
+
React14.useImperativeHandle(ref, () => inputRef.current);
|
|
2583
2719
|
const resolvedAccept = accept ?? uploadAcceptByKind[uploadKind];
|
|
2584
2720
|
const resolvedAriaLabel = ariaLabel ?? uploadAriaLabelByKind[uploadKind];
|
|
2585
2721
|
const resolvedTitle = uploadTitle ?? "Arraste arquivos aqui ou clique para selecionar";
|
|
2586
2722
|
const resolvedDescription = uploadDescription ?? uploadDescriptionByKind[uploadKind];
|
|
2587
|
-
const syncSelectedFiles =
|
|
2723
|
+
const syncSelectedFiles = React14.useCallback(
|
|
2588
2724
|
(files) => {
|
|
2589
2725
|
const normalizedFiles = resolvedMultiple ? files : files.slice(0, 1);
|
|
2590
2726
|
setSelectedFiles(normalizedFiles);
|
|
@@ -2592,7 +2728,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2592
2728
|
},
|
|
2593
2729
|
[onFilesChange, resolvedMultiple]
|
|
2594
2730
|
);
|
|
2595
|
-
const applyFilesToInput =
|
|
2731
|
+
const applyFilesToInput = React14.useCallback((files) => {
|
|
2596
2732
|
const inputElement = inputRef.current;
|
|
2597
2733
|
if (!inputElement || typeof DataTransfer === "undefined") {
|
|
2598
2734
|
return false;
|
|
@@ -2611,7 +2747,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2611
2747
|
return false;
|
|
2612
2748
|
}
|
|
2613
2749
|
}, []);
|
|
2614
|
-
const handleInputChange =
|
|
2750
|
+
const handleInputChange = React14.useCallback(
|
|
2615
2751
|
(event) => {
|
|
2616
2752
|
const nextFiles = mergeUploadFiles(
|
|
2617
2753
|
selectedFiles,
|
|
@@ -2630,12 +2766,12 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2630
2766
|
syncSelectedFiles
|
|
2631
2767
|
]
|
|
2632
2768
|
);
|
|
2633
|
-
const openPicker =
|
|
2769
|
+
const openPicker = React14.useCallback(() => {
|
|
2634
2770
|
if (!disabled) {
|
|
2635
2771
|
inputRef.current?.click();
|
|
2636
2772
|
}
|
|
2637
2773
|
}, [disabled]);
|
|
2638
|
-
const handleKeyDown =
|
|
2774
|
+
const handleKeyDown = React14.useCallback(
|
|
2639
2775
|
(event) => {
|
|
2640
2776
|
if (disabled) {
|
|
2641
2777
|
return;
|
|
@@ -2647,7 +2783,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2647
2783
|
},
|
|
2648
2784
|
[disabled, openPicker]
|
|
2649
2785
|
);
|
|
2650
|
-
const handleDragEnter =
|
|
2786
|
+
const handleDragEnter = React14.useCallback(
|
|
2651
2787
|
(event) => {
|
|
2652
2788
|
event.preventDefault();
|
|
2653
2789
|
if (!disabled) {
|
|
@@ -2656,7 +2792,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2656
2792
|
},
|
|
2657
2793
|
[disabled]
|
|
2658
2794
|
);
|
|
2659
|
-
const handleDragLeave =
|
|
2795
|
+
const handleDragLeave = React14.useCallback(
|
|
2660
2796
|
(event) => {
|
|
2661
2797
|
if (disabled) {
|
|
2662
2798
|
return;
|
|
@@ -2669,7 +2805,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2669
2805
|
},
|
|
2670
2806
|
[disabled]
|
|
2671
2807
|
);
|
|
2672
|
-
const handleDragOver =
|
|
2808
|
+
const handleDragOver = React14.useCallback(
|
|
2673
2809
|
(event) => {
|
|
2674
2810
|
event.preventDefault();
|
|
2675
2811
|
if (disabled) {
|
|
@@ -2680,7 +2816,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2680
2816
|
},
|
|
2681
2817
|
[disabled]
|
|
2682
2818
|
);
|
|
2683
|
-
const handleDrop =
|
|
2819
|
+
const handleDrop = React14.useCallback(
|
|
2684
2820
|
(event) => {
|
|
2685
2821
|
event.preventDefault();
|
|
2686
2822
|
if (disabled) {
|
|
@@ -2713,7 +2849,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2713
2849
|
syncSelectedFiles
|
|
2714
2850
|
]
|
|
2715
2851
|
);
|
|
2716
|
-
const handleRemoveFile =
|
|
2852
|
+
const handleRemoveFile = React14.useCallback(
|
|
2717
2853
|
(fileIndex) => {
|
|
2718
2854
|
if (disabled) {
|
|
2719
2855
|
return;
|
|
@@ -2725,7 +2861,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2725
2861
|
[applyFilesToInput, disabled, selectedFiles, syncSelectedFiles]
|
|
2726
2862
|
);
|
|
2727
2863
|
return /* @__PURE__ */ jsxs7("div", { className: "grid w-full gap-4", children: [
|
|
2728
|
-
/* @__PURE__ */
|
|
2864
|
+
/* @__PURE__ */ jsx15(
|
|
2729
2865
|
"input",
|
|
2730
2866
|
{
|
|
2731
2867
|
...uploadProps,
|
|
@@ -2760,8 +2896,8 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2760
2896
|
onDrop: handleDrop,
|
|
2761
2897
|
onKeyDown: handleKeyDown,
|
|
2762
2898
|
children: [
|
|
2763
|
-
/* @__PURE__ */
|
|
2764
|
-
/* @__PURE__ */
|
|
2899
|
+
/* @__PURE__ */ jsx15("span", { className: "flex size-10 items-center justify-center rounded-[6px] p-2 text-[color:var(--sofya-text-default)]", children: /* @__PURE__ */ jsx15(UploadGlyph, { className: "size-[18px]" }) }),
|
|
2900
|
+
/* @__PURE__ */ jsx15("span", { className: "text-[color:var(--sofya-text-default)]", children: renderTextContent(resolvedTitle, {
|
|
2765
2901
|
as: "span",
|
|
2766
2902
|
className: "block text-[color:var(--sofya-text-default)]",
|
|
2767
2903
|
size: "tiny",
|
|
@@ -2769,7 +2905,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2769
2905
|
fontWeight: 500
|
|
2770
2906
|
}
|
|
2771
2907
|
}) }),
|
|
2772
|
-
resolvedDescription ? /* @__PURE__ */
|
|
2908
|
+
resolvedDescription ? /* @__PURE__ */ jsx15("span", { className: "text-[color:var(--sofya-text-subtle)]", children: renderTextContent(resolvedDescription, {
|
|
2773
2909
|
as: "span",
|
|
2774
2910
|
className: "block text-[color:var(--sofya-text-subtle)]",
|
|
2775
2911
|
size: "extra-tiny"
|
|
@@ -2777,9 +2913,9 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2777
2913
|
]
|
|
2778
2914
|
}
|
|
2779
2915
|
),
|
|
2780
|
-
/* @__PURE__ */
|
|
2916
|
+
/* @__PURE__ */ jsx15("div", { role: "list", className: "grid gap-4 overflow-hidden", children: /* @__PURE__ */ jsx15(AnimatePresence, { initial: false, children: selectedFiles.map((file, index) => {
|
|
2781
2917
|
const fileKey = resolveUploadFileSignature(file);
|
|
2782
|
-
return /* @__PURE__ */
|
|
2918
|
+
return /* @__PURE__ */ jsx15(
|
|
2783
2919
|
motion2.div,
|
|
2784
2920
|
{
|
|
2785
2921
|
role: "listitem",
|
|
@@ -2789,7 +2925,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2789
2925
|
exit: prefersReducedMotion ? { opacity: 0 } : { opacity: 0, y: -6 },
|
|
2790
2926
|
transition: uploadListItemTransition,
|
|
2791
2927
|
children: /* @__PURE__ */ jsxs7(Card, { variant: "card", className: "flex items-center gap-4 p-4", children: [
|
|
2792
|
-
/* @__PURE__ */
|
|
2928
|
+
/* @__PURE__ */ jsx15("span", { className: "flex size-11 shrink-0 items-center justify-center rounded-full bg-[color:var(--sofya-surface-hover)] text-primary", children: /* @__PURE__ */ jsx15(
|
|
2793
2929
|
UploadFileTypeGlyph,
|
|
2794
2930
|
{
|
|
2795
2931
|
className: "size-[18px]",
|
|
@@ -2797,7 +2933,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2797
2933
|
}
|
|
2798
2934
|
) }),
|
|
2799
2935
|
/* @__PURE__ */ jsxs7("div", { className: "min-w-0 flex-1", children: [
|
|
2800
|
-
/* @__PURE__ */
|
|
2936
|
+
/* @__PURE__ */ jsx15("p", { className: "truncate text-[color:var(--sofya-text-default)]", children: renderTextContent(file.name, {
|
|
2801
2937
|
as: "span",
|
|
2802
2938
|
className: "block truncate text-[color:var(--sofya-text-default)]",
|
|
2803
2939
|
size: "tiny",
|
|
@@ -2805,7 +2941,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2805
2941
|
fontWeight: 500
|
|
2806
2942
|
}
|
|
2807
2943
|
}) }),
|
|
2808
|
-
/* @__PURE__ */
|
|
2944
|
+
/* @__PURE__ */ jsx15("p", { className: "mt-2 text-[color:var(--sofya-text-subtle)]", children: renderTextContent(
|
|
2809
2945
|
`${resolveUploadFileBadge(
|
|
2810
2946
|
file
|
|
2811
2947
|
)} \xB7 ${formatUploadFileSize(file.size)}`,
|
|
@@ -2816,7 +2952,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2816
2952
|
}
|
|
2817
2953
|
) })
|
|
2818
2954
|
] }),
|
|
2819
|
-
/* @__PURE__ */
|
|
2955
|
+
/* @__PURE__ */ jsx15(
|
|
2820
2956
|
"button",
|
|
2821
2957
|
{
|
|
2822
2958
|
"aria-label": `Remover ${file.name}`,
|
|
@@ -2828,7 +2964,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2828
2964
|
event.stopPropagation();
|
|
2829
2965
|
handleRemoveFile(index);
|
|
2830
2966
|
},
|
|
2831
|
-
children: /* @__PURE__ */
|
|
2967
|
+
children: /* @__PURE__ */ jsx15(
|
|
2832
2968
|
Icon,
|
|
2833
2969
|
{
|
|
2834
2970
|
"aria-hidden": "true",
|
|
@@ -2849,15 +2985,15 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2849
2985
|
UploadInputControl.displayName = "UploadInputControl";
|
|
2850
2986
|
|
|
2851
2987
|
// src/components/input-otp.tsx
|
|
2852
|
-
import * as
|
|
2988
|
+
import * as React15 from "react";
|
|
2853
2989
|
import {
|
|
2854
2990
|
OTPInput,
|
|
2855
2991
|
OTPInputContext,
|
|
2856
2992
|
REGEXP_ONLY_DIGITS
|
|
2857
2993
|
} from "input-otp";
|
|
2858
|
-
import { jsx as
|
|
2859
|
-
var InputOTP =
|
|
2860
|
-
return /* @__PURE__ */
|
|
2994
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2995
|
+
var InputOTP = React15.forwardRef(({ className, containerClassName, ...props }, ref) => {
|
|
2996
|
+
return /* @__PURE__ */ jsx16(
|
|
2861
2997
|
OTPInput,
|
|
2862
2998
|
{
|
|
2863
2999
|
ref,
|
|
@@ -2871,8 +3007,8 @@ var InputOTP = React14.forwardRef(({ className, containerClassName, ...props },
|
|
|
2871
3007
|
);
|
|
2872
3008
|
});
|
|
2873
3009
|
InputOTP.displayName = "InputOTP";
|
|
2874
|
-
var InputOTPGroup =
|
|
2875
|
-
return /* @__PURE__ */
|
|
3010
|
+
var InputOTPGroup = React15.forwardRef(({ className, ...props }, ref) => {
|
|
3011
|
+
return /* @__PURE__ */ jsx16(
|
|
2876
3012
|
"div",
|
|
2877
3013
|
{
|
|
2878
3014
|
ref,
|
|
@@ -2885,12 +3021,12 @@ var InputOTPGroup = React14.forwardRef(({ className, ...props }, ref) => {
|
|
|
2885
3021
|
);
|
|
2886
3022
|
});
|
|
2887
3023
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
2888
|
-
var InputOTPSlot =
|
|
3024
|
+
var InputOTPSlot = React15.forwardRef(
|
|
2889
3025
|
({ className, index, ...props }, ref) => {
|
|
2890
|
-
const otpContext =
|
|
3026
|
+
const otpContext = React15.useContext(OTPInputContext);
|
|
2891
3027
|
const slot = otpContext.slots[index];
|
|
2892
3028
|
if (!slot) {
|
|
2893
|
-
return /* @__PURE__ */
|
|
3029
|
+
return /* @__PURE__ */ jsx16(
|
|
2894
3030
|
"div",
|
|
2895
3031
|
{
|
|
2896
3032
|
ref,
|
|
@@ -2914,15 +3050,15 @@ var InputOTPSlot = React14.forwardRef(
|
|
|
2914
3050
|
...props,
|
|
2915
3051
|
children: [
|
|
2916
3052
|
slot.char ?? null,
|
|
2917
|
-
slot.hasFakeCaret ? /* @__PURE__ */
|
|
3053
|
+
slot.hasFakeCaret ? /* @__PURE__ */ jsx16("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx16("div", { className: "h-10 w-[2px] animate-pulse rounded-full bg-primary shadow-[var(--sofya-shadow-caret-glow)]" }) }) : null
|
|
2918
3054
|
]
|
|
2919
3055
|
}
|
|
2920
3056
|
);
|
|
2921
3057
|
}
|
|
2922
3058
|
);
|
|
2923
3059
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
2924
|
-
var InputOTPSeparator =
|
|
2925
|
-
return /* @__PURE__ */
|
|
3060
|
+
var InputOTPSeparator = React15.forwardRef(({ className, ...props }, ref) => {
|
|
3061
|
+
return /* @__PURE__ */ jsx16(
|
|
2926
3062
|
"div",
|
|
2927
3063
|
{
|
|
2928
3064
|
ref,
|
|
@@ -2932,22 +3068,22 @@ var InputOTPSeparator = React14.forwardRef(({ className, ...props }, ref) => {
|
|
|
2932
3068
|
className
|
|
2933
3069
|
),
|
|
2934
3070
|
...props,
|
|
2935
|
-
children: /* @__PURE__ */
|
|
3071
|
+
children: /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: "." })
|
|
2936
3072
|
}
|
|
2937
3073
|
);
|
|
2938
3074
|
});
|
|
2939
3075
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
2940
3076
|
|
|
2941
3077
|
// src/components/input.tsx
|
|
2942
|
-
import { Fragment as Fragment2, jsx as
|
|
3078
|
+
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2943
3079
|
var inputVariantOptions = [
|
|
2944
3080
|
"default",
|
|
2945
3081
|
"search",
|
|
2946
3082
|
"otp",
|
|
2947
3083
|
"upload"
|
|
2948
3084
|
];
|
|
2949
|
-
var Input =
|
|
2950
|
-
const generatedId =
|
|
3085
|
+
var Input = React16.forwardRef((props, ref) => {
|
|
3086
|
+
const generatedId = React16.useId();
|
|
2951
3087
|
const resolvedId = props.id ?? generatedId;
|
|
2952
3088
|
const variant = props.variant ?? "default";
|
|
2953
3089
|
if (variant === "otp") {
|
|
@@ -2988,7 +3124,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
2988
3124
|
containerClassName: className2,
|
|
2989
3125
|
...otpProps,
|
|
2990
3126
|
children: [
|
|
2991
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ jsx17(InputOTPGroup, { className: otpGroupClassName, children: Array.from({ length: resolvedSplitIndex }, (_, index) => /* @__PURE__ */ jsx17(
|
|
2992
3128
|
InputOTPSlot,
|
|
2993
3129
|
{
|
|
2994
3130
|
className: otpSlotClassName,
|
|
@@ -2996,10 +3132,10 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
2996
3132
|
},
|
|
2997
3133
|
`otp-leading-${index}`
|
|
2998
3134
|
)) }),
|
|
2999
|
-
hasTrailingGroup ? otpSeparator ?? /* @__PURE__ */
|
|
3000
|
-
hasTrailingGroup ? /* @__PURE__ */
|
|
3135
|
+
hasTrailingGroup ? otpSeparator ?? /* @__PURE__ */ jsx17(InputOTPSeparator, { className: otpSeparatorClassName }) : null,
|
|
3136
|
+
hasTrailingGroup ? /* @__PURE__ */ jsx17(InputOTPGroup, { className: otpGroupClassName, children: Array.from(
|
|
3001
3137
|
{ length: resolvedLength - resolvedSplitIndex },
|
|
3002
|
-
(_, index) => /* @__PURE__ */
|
|
3138
|
+
(_, index) => /* @__PURE__ */ jsx17(
|
|
3003
3139
|
InputOTPSlot,
|
|
3004
3140
|
{
|
|
3005
3141
|
className: otpSlotClassName,
|
|
@@ -3011,7 +3147,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
3011
3147
|
]
|
|
3012
3148
|
}
|
|
3013
3149
|
);
|
|
3014
|
-
return /* @__PURE__ */
|
|
3150
|
+
return /* @__PURE__ */ jsx17(
|
|
3015
3151
|
FieldShell,
|
|
3016
3152
|
{
|
|
3017
3153
|
containerClassName: containerClassName2,
|
|
@@ -3030,7 +3166,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
3030
3166
|
variant: _variant2,
|
|
3031
3167
|
...uploadProps
|
|
3032
3168
|
} = props;
|
|
3033
|
-
const uploadControl = /* @__PURE__ */
|
|
3169
|
+
const uploadControl = /* @__PURE__ */ jsx17(
|
|
3034
3170
|
UploadInputControl,
|
|
3035
3171
|
{
|
|
3036
3172
|
...uploadProps,
|
|
@@ -3047,13 +3183,13 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
3047
3183
|
fontWeight: 700
|
|
3048
3184
|
}
|
|
3049
3185
|
}),
|
|
3050
|
-
uploadOptionalLabel ? /* @__PURE__ */
|
|
3186
|
+
uploadOptionalLabel ? /* @__PURE__ */ jsx17("span", { className: "ml-2 text-[color:var(--sofya-text-subtle)]", children: renderTextContent(uploadOptionalLabel, {
|
|
3051
3187
|
as: "span",
|
|
3052
3188
|
className: "text-[color:var(--sofya-text-subtle)]",
|
|
3053
3189
|
size: "tiny"
|
|
3054
3190
|
}) }) : null
|
|
3055
3191
|
] }) : void 0;
|
|
3056
|
-
return /* @__PURE__ */
|
|
3192
|
+
return /* @__PURE__ */ jsx17(
|
|
3057
3193
|
FieldShell,
|
|
3058
3194
|
{
|
|
3059
3195
|
containerClassName: containerClassName2,
|
|
@@ -3077,7 +3213,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
3077
3213
|
const resolvedType = type ?? (isSearch ? "search" : void 0);
|
|
3078
3214
|
const ariaLabel = nativeProps["aria-label"] ?? (typeof label === "string" ? label : isSearch ? "Search" : void 0);
|
|
3079
3215
|
const nativeControl = isSearch ? /* @__PURE__ */ jsxs9("div", { className: "flex h-[88px] w-full items-center gap-6 rounded-full border border-[color:var(--sofya-border-strong)] bg-card px-8 shadow-none transition-[border-color,box-shadow,background-color] duration-sofya ease-sofya hover:border-[color:var(--sofya-border-hover)] hover:ring-2 hover:ring-[color:var(--sofya-focus-ring-soft)] focus-within:border-transparent focus-within:ring-2 focus-within:ring-[color:var(--sofya-focus-ring-soft)] has-[:active]:border-transparent has-[:active]:ring-2 has-[:active]:ring-[color:var(--sofya-focus-ring-soft)]", children: [
|
|
3080
|
-
/* @__PURE__ */
|
|
3216
|
+
/* @__PURE__ */ jsx17(
|
|
3081
3217
|
Icon,
|
|
3082
3218
|
{
|
|
3083
3219
|
"aria-hidden": "true",
|
|
@@ -3086,7 +3222,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
3086
3222
|
size: 32
|
|
3087
3223
|
}
|
|
3088
3224
|
),
|
|
3089
|
-
/* @__PURE__ */
|
|
3225
|
+
/* @__PURE__ */ jsx17(
|
|
3090
3226
|
"input",
|
|
3091
3227
|
{
|
|
3092
3228
|
id: resolvedId,
|
|
@@ -3102,7 +3238,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
3102
3238
|
placeholder: nativeProps.placeholder ?? "Search"
|
|
3103
3239
|
}
|
|
3104
3240
|
)
|
|
3105
|
-
] }) : /* @__PURE__ */
|
|
3241
|
+
] }) : /* @__PURE__ */ jsx17(
|
|
3106
3242
|
"input",
|
|
3107
3243
|
{
|
|
3108
3244
|
id: resolvedId,
|
|
@@ -3116,7 +3252,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
3116
3252
|
"aria-label": ariaLabel
|
|
3117
3253
|
}
|
|
3118
3254
|
);
|
|
3119
|
-
return /* @__PURE__ */
|
|
3255
|
+
return /* @__PURE__ */ jsx17(
|
|
3120
3256
|
FieldShell,
|
|
3121
3257
|
{
|
|
3122
3258
|
containerClassName,
|
|
@@ -3130,22 +3266,33 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
3130
3266
|
Input.displayName = "Input";
|
|
3131
3267
|
|
|
3132
3268
|
// src/components/popover.tsx
|
|
3133
|
-
import * as
|
|
3269
|
+
import * as React17 from "react";
|
|
3134
3270
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3135
|
-
import { jsx as
|
|
3271
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
3136
3272
|
var Popover = PopoverPrimitive.Root;
|
|
3137
3273
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
3138
3274
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
3139
3275
|
var PopoverPortal = PopoverPrimitive.Portal;
|
|
3140
3276
|
var PopoverClose = PopoverPrimitive.Close;
|
|
3141
|
-
var
|
|
3277
|
+
var PopoverCloseButton = React17.forwardRef(function PopoverCloseButton2({ className, ...props }, ref) {
|
|
3278
|
+
return /* @__PURE__ */ jsx18(PopoverPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx18(
|
|
3279
|
+
CloseButton,
|
|
3280
|
+
{
|
|
3281
|
+
ref,
|
|
3282
|
+
className: cn("absolute right-2 top-2", className),
|
|
3283
|
+
...props
|
|
3284
|
+
}
|
|
3285
|
+
) });
|
|
3286
|
+
});
|
|
3287
|
+
PopoverCloseButton.displayName = "PopoverCloseButton";
|
|
3288
|
+
var PopoverContent = React17.forwardRef(function PopoverContent2({
|
|
3142
3289
|
align = "center",
|
|
3143
3290
|
className,
|
|
3144
3291
|
collisionPadding = 8,
|
|
3145
3292
|
sideOffset = 8,
|
|
3146
3293
|
...props
|
|
3147
3294
|
}, ref) {
|
|
3148
|
-
return /* @__PURE__ */
|
|
3295
|
+
return /* @__PURE__ */ jsx18(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx18(
|
|
3149
3296
|
PopoverPrimitive.Content,
|
|
3150
3297
|
{
|
|
3151
3298
|
ref,
|
|
@@ -3162,8 +3309,8 @@ var PopoverContent = React16.forwardRef(function PopoverContent2({
|
|
|
3162
3309
|
) });
|
|
3163
3310
|
});
|
|
3164
3311
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
3165
|
-
var PopoverTitle =
|
|
3166
|
-
return /* @__PURE__ */
|
|
3312
|
+
var PopoverTitle = React17.forwardRef(function PopoverTitle2({ children, className, ...props }, ref) {
|
|
3313
|
+
return /* @__PURE__ */ jsx18(
|
|
3167
3314
|
"h4",
|
|
3168
3315
|
{
|
|
3169
3316
|
ref,
|
|
@@ -3179,8 +3326,8 @@ var PopoverTitle = React16.forwardRef(function PopoverTitle2({ children, classNa
|
|
|
3179
3326
|
);
|
|
3180
3327
|
});
|
|
3181
3328
|
PopoverTitle.displayName = "PopoverTitle";
|
|
3182
|
-
var PopoverDescription =
|
|
3183
|
-
return /* @__PURE__ */
|
|
3329
|
+
var PopoverDescription = React17.forwardRef(function PopoverDescription2({ children, className, ...props }, ref) {
|
|
3330
|
+
return /* @__PURE__ */ jsx18(
|
|
3184
3331
|
"p",
|
|
3185
3332
|
{
|
|
3186
3333
|
ref,
|
|
@@ -3198,11 +3345,11 @@ var PopoverDescription = React16.forwardRef(function PopoverDescription2({ child
|
|
|
3198
3345
|
PopoverDescription.displayName = "PopoverDescription";
|
|
3199
3346
|
|
|
3200
3347
|
// src/components/spinner.tsx
|
|
3201
|
-
import * as
|
|
3348
|
+
import * as React18 from "react";
|
|
3202
3349
|
import { IconLoader2 as IconLoader22 } from "@tabler/icons-react";
|
|
3203
|
-
import { jsx as
|
|
3350
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
3204
3351
|
var spinnerSizeOptions = ["sm", "default", "lg"];
|
|
3205
|
-
var Spinner =
|
|
3352
|
+
var Spinner = React18.forwardRef(function Spinner2({
|
|
3206
3353
|
"aria-label": ariaLabelProp,
|
|
3207
3354
|
"aria-labelledby": ariaLabelledby,
|
|
3208
3355
|
className,
|
|
@@ -3211,7 +3358,7 @@ var Spinner = React17.forwardRef(function Spinner2({
|
|
|
3211
3358
|
...props
|
|
3212
3359
|
}, ref) {
|
|
3213
3360
|
const ariaLabel = ariaLabelProp ?? (ariaLabelledby ? void 0 : "Loading");
|
|
3214
|
-
return /* @__PURE__ */
|
|
3361
|
+
return /* @__PURE__ */ jsx19(
|
|
3215
3362
|
IconLoader22,
|
|
3216
3363
|
{
|
|
3217
3364
|
ref,
|
|
@@ -3231,8 +3378,8 @@ var Spinner = React17.forwardRef(function Spinner2({
|
|
|
3231
3378
|
Spinner.displayName = "Spinner";
|
|
3232
3379
|
|
|
3233
3380
|
// src/components/dropdown-search.tsx
|
|
3234
|
-
import { jsx as
|
|
3235
|
-
var DropdownSearch =
|
|
3381
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3382
|
+
var DropdownSearch = React19.forwardRef(
|
|
3236
3383
|
function DropdownSearch2({
|
|
3237
3384
|
className,
|
|
3238
3385
|
containerClassName,
|
|
@@ -3250,8 +3397,8 @@ var DropdownSearch = React18.forwardRef(
|
|
|
3250
3397
|
query: queryProp,
|
|
3251
3398
|
value: valueProp
|
|
3252
3399
|
}, ref) {
|
|
3253
|
-
const listboxId =
|
|
3254
|
-
const [open, setOpen] =
|
|
3400
|
+
const listboxId = React19.useId();
|
|
3401
|
+
const [open, setOpen] = React19.useState(false);
|
|
3255
3402
|
const [query, setQuery] = useControllableState({
|
|
3256
3403
|
defaultValue: defaultQuery,
|
|
3257
3404
|
onChange: onQueryChange,
|
|
@@ -3262,9 +3409,9 @@ var DropdownSearch = React18.forwardRef(
|
|
|
3262
3409
|
onChange,
|
|
3263
3410
|
value: valueProp
|
|
3264
3411
|
});
|
|
3265
|
-
const inputRef =
|
|
3266
|
-
const listRef =
|
|
3267
|
-
const setInputRef =
|
|
3412
|
+
const inputRef = React19.useRef(null);
|
|
3413
|
+
const listRef = React19.useRef(null);
|
|
3414
|
+
const setInputRef = React19.useCallback(
|
|
3268
3415
|
(node) => {
|
|
3269
3416
|
inputRef.current = node;
|
|
3270
3417
|
if (typeof ref === "function") {
|
|
@@ -3326,7 +3473,7 @@ var DropdownSearch = React18.forwardRef(
|
|
|
3326
3473
|
setOpen(false);
|
|
3327
3474
|
}
|
|
3328
3475
|
return /* @__PURE__ */ jsxs10(Popover, { open, onOpenChange: setOpen, children: [
|
|
3329
|
-
/* @__PURE__ */
|
|
3476
|
+
/* @__PURE__ */ jsx20(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsx20("div", { className: cn("w-full", containerClassName), children: /* @__PURE__ */ jsx20(
|
|
3330
3477
|
Input,
|
|
3331
3478
|
{
|
|
3332
3479
|
ref: setInputRef,
|
|
@@ -3347,7 +3494,7 @@ var DropdownSearch = React18.forwardRef(
|
|
|
3347
3494
|
onKeyDown: handleInputKeyDown
|
|
3348
3495
|
}
|
|
3349
3496
|
) }) }),
|
|
3350
|
-
/* @__PURE__ */
|
|
3497
|
+
/* @__PURE__ */ jsx20(
|
|
3351
3498
|
PopoverContent,
|
|
3352
3499
|
{
|
|
3353
3500
|
align: "start",
|
|
@@ -3358,7 +3505,7 @@ var DropdownSearch = React18.forwardRef(
|
|
|
3358
3505
|
e.preventDefault();
|
|
3359
3506
|
}
|
|
3360
3507
|
},
|
|
3361
|
-
children: loading ? /* @__PURE__ */
|
|
3508
|
+
children: loading ? /* @__PURE__ */ jsx20("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ jsx20(Spinner, { size: "sm" }) }) : options.length === 0 ? /* @__PURE__ */ jsx20("div", { className: "px-3 py-4 text-center", children: /* @__PURE__ */ jsx20(
|
|
3362
3509
|
Text,
|
|
3363
3510
|
{
|
|
3364
3511
|
as: "span",
|
|
@@ -3366,7 +3513,7 @@ var DropdownSearch = React18.forwardRef(
|
|
|
3366
3513
|
className: "text-[color:var(--sofya-text-subtle)]",
|
|
3367
3514
|
children: emptyMessage
|
|
3368
3515
|
}
|
|
3369
|
-
) }) : /* @__PURE__ */
|
|
3516
|
+
) }) : /* @__PURE__ */ jsx20(
|
|
3370
3517
|
"ul",
|
|
3371
3518
|
{
|
|
3372
3519
|
ref: listRef,
|
|
@@ -3374,7 +3521,7 @@ var DropdownSearch = React18.forwardRef(
|
|
|
3374
3521
|
role: "listbox",
|
|
3375
3522
|
"aria-label": typeof label === "string" ? label : "Options",
|
|
3376
3523
|
className: "flex flex-col gap-0.5",
|
|
3377
|
-
children: options.map((option) => /* @__PURE__ */
|
|
3524
|
+
children: options.map((option) => /* @__PURE__ */ jsx20(
|
|
3378
3525
|
"li",
|
|
3379
3526
|
{
|
|
3380
3527
|
role: "option",
|
|
@@ -3398,8 +3545,8 @@ var DropdownSearch = React18.forwardRef(
|
|
|
3398
3545
|
onKeyDown: (e) => handleItemKeyDown(e, option),
|
|
3399
3546
|
children: [
|
|
3400
3547
|
/* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
3401
|
-
/* @__PURE__ */
|
|
3402
|
-
option.description ? /* @__PURE__ */
|
|
3548
|
+
/* @__PURE__ */ jsx20(Text, { as: "span", size: "tiny", className: "truncate", children: option.label }),
|
|
3549
|
+
option.description ? /* @__PURE__ */ jsx20(
|
|
3403
3550
|
Text,
|
|
3404
3551
|
{
|
|
3405
3552
|
as: "span",
|
|
@@ -3409,7 +3556,7 @@ var DropdownSearch = React18.forwardRef(
|
|
|
3409
3556
|
}
|
|
3410
3557
|
) : null
|
|
3411
3558
|
] }),
|
|
3412
|
-
value === option.value ? /* @__PURE__ */
|
|
3559
|
+
value === option.value ? /* @__PURE__ */ jsx20(
|
|
3413
3560
|
Icon,
|
|
3414
3561
|
{
|
|
3415
3562
|
"aria-hidden": "true",
|
|
@@ -3434,17 +3581,17 @@ var DropdownSearch = React18.forwardRef(
|
|
|
3434
3581
|
DropdownSearch.displayName = "DropdownSearch";
|
|
3435
3582
|
|
|
3436
3583
|
// src/components/dialog.tsx
|
|
3437
|
-
import * as
|
|
3584
|
+
import * as React20 from "react";
|
|
3438
3585
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3439
|
-
import { jsx as
|
|
3586
|
+
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3440
3587
|
var Dialog = DialogPrimitive.Root;
|
|
3441
3588
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
3442
3589
|
var DialogPortal = DialogPrimitive.Portal;
|
|
3443
3590
|
var DialogClose = DialogPrimitive.Close;
|
|
3444
|
-
var DialogInternalContext =
|
|
3591
|
+
var DialogInternalContext = React20.createContext({
|
|
3445
3592
|
showCloseButton: true
|
|
3446
3593
|
});
|
|
3447
|
-
var DialogOverlay =
|
|
3594
|
+
var DialogOverlay = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
3448
3595
|
DialogPrimitive.Overlay,
|
|
3449
3596
|
{
|
|
3450
3597
|
ref,
|
|
@@ -3456,7 +3603,7 @@ var DialogOverlay = React19.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
3456
3603
|
}
|
|
3457
3604
|
));
|
|
3458
3605
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
3459
|
-
var DialogContent =
|
|
3606
|
+
var DialogContent = React20.forwardRef(
|
|
3460
3607
|
({
|
|
3461
3608
|
className,
|
|
3462
3609
|
children,
|
|
@@ -3472,9 +3619,9 @@ var DialogContent = React19.forwardRef(
|
|
|
3472
3619
|
"--sofya-surface-shadow-override": surfaceShadow,
|
|
3473
3620
|
...cardStyle
|
|
3474
3621
|
};
|
|
3475
|
-
return /* @__PURE__ */
|
|
3476
|
-
/* @__PURE__ */
|
|
3477
|
-
/* @__PURE__ */
|
|
3622
|
+
return /* @__PURE__ */ jsx21(DialogInternalContext.Provider, { value: { showCloseButton }, children: /* @__PURE__ */ jsxs11(DialogPortal, { children: [
|
|
3623
|
+
/* @__PURE__ */ jsx21(DialogOverlay, { className: overlayClassName }),
|
|
3624
|
+
/* @__PURE__ */ jsx21("div", { className: "sofya-dialog-positioner fixed inset-0 z-50 flex items-center justify-center p-4", children: /* @__PURE__ */ jsx21(
|
|
3478
3625
|
DialogPrimitive.Content,
|
|
3479
3626
|
{
|
|
3480
3627
|
ref,
|
|
@@ -3483,7 +3630,7 @@ var DialogContent = React19.forwardRef(
|
|
|
3483
3630
|
className
|
|
3484
3631
|
),
|
|
3485
3632
|
...props,
|
|
3486
|
-
children: /* @__PURE__ */
|
|
3633
|
+
children: /* @__PURE__ */ jsx21(
|
|
3487
3634
|
Card,
|
|
3488
3635
|
{
|
|
3489
3636
|
variant,
|
|
@@ -3502,31 +3649,21 @@ var DialogContent = React19.forwardRef(
|
|
|
3502
3649
|
);
|
|
3503
3650
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
3504
3651
|
function DialogHeader({ className, children, ...props }) {
|
|
3505
|
-
const { showCloseButton } =
|
|
3652
|
+
const { showCloseButton } = React20.useContext(DialogInternalContext);
|
|
3506
3653
|
return /* @__PURE__ */ jsxs11(
|
|
3507
3654
|
"div",
|
|
3508
3655
|
{
|
|
3509
3656
|
className: cn("flex w-full items-start justify-between gap-4", className),
|
|
3510
3657
|
...props,
|
|
3511
3658
|
children: [
|
|
3512
|
-
/* @__PURE__ */
|
|
3513
|
-
showCloseButton ? /* @__PURE__ */
|
|
3514
|
-
Button,
|
|
3515
|
-
{
|
|
3516
|
-
type: "button",
|
|
3517
|
-
variant: "ghost",
|
|
3518
|
-
size: "icon",
|
|
3519
|
-
"aria-label": "Close",
|
|
3520
|
-
leftIcon: /* @__PURE__ */ jsx20(Icon, { name: "x", size: 18 }),
|
|
3521
|
-
className: "shrink-0 text-muted-foreground hover:text-foreground"
|
|
3522
|
-
}
|
|
3523
|
-
) }) : null
|
|
3659
|
+
/* @__PURE__ */ jsx21("div", { className: "flex min-w-0 flex-1 flex-col gap-2 text-left", children }),
|
|
3660
|
+
showCloseButton ? /* @__PURE__ */ jsx21(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx21(CloseButton, { label: "Fechar" }) }) : null
|
|
3524
3661
|
]
|
|
3525
3662
|
}
|
|
3526
3663
|
);
|
|
3527
3664
|
}
|
|
3528
3665
|
function DialogBody({ className, ...props }) {
|
|
3529
|
-
return /* @__PURE__ */
|
|
3666
|
+
return /* @__PURE__ */ jsx21(
|
|
3530
3667
|
"div",
|
|
3531
3668
|
{
|
|
3532
3669
|
className: cn("flex flex-col gap-4", className),
|
|
@@ -3535,7 +3672,7 @@ function DialogBody({ className, ...props }) {
|
|
|
3535
3672
|
);
|
|
3536
3673
|
}
|
|
3537
3674
|
function DialogFooter({ className, ...props }) {
|
|
3538
|
-
return /* @__PURE__ */
|
|
3675
|
+
return /* @__PURE__ */ jsx21(
|
|
3539
3676
|
"div",
|
|
3540
3677
|
{
|
|
3541
3678
|
className: cn("flex items-center justify-end gap-2", className),
|
|
@@ -3543,11 +3680,11 @@ function DialogFooter({ className, ...props }) {
|
|
|
3543
3680
|
}
|
|
3544
3681
|
);
|
|
3545
3682
|
}
|
|
3546
|
-
var DialogCancel =
|
|
3547
|
-
({ type = "button", variant = "ghost", ...props }, ref) => /* @__PURE__ */
|
|
3683
|
+
var DialogCancel = React20.forwardRef(
|
|
3684
|
+
({ type = "button", variant = "ghost", ...props }, ref) => /* @__PURE__ */ jsx21(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx21(Button, { ref, type, variant, ...props }) })
|
|
3548
3685
|
);
|
|
3549
3686
|
DialogCancel.displayName = "DialogCancel";
|
|
3550
|
-
var DialogTitle =
|
|
3687
|
+
var DialogTitle = React20.forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
3551
3688
|
DialogPrimitive.Title,
|
|
3552
3689
|
{
|
|
3553
3690
|
ref,
|
|
@@ -3561,7 +3698,7 @@ var DialogTitle = React19.forwardRef(({ children, className, ...props }, ref) =>
|
|
|
3561
3698
|
}
|
|
3562
3699
|
));
|
|
3563
3700
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
3564
|
-
var DialogDescription =
|
|
3701
|
+
var DialogDescription = React20.forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
3565
3702
|
DialogPrimitive.Description,
|
|
3566
3703
|
{
|
|
3567
3704
|
ref,
|
|
@@ -3577,9 +3714,9 @@ var DialogDescription = React19.forwardRef(({ children, className, ...props }, r
|
|
|
3577
3714
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
3578
3715
|
|
|
3579
3716
|
// src/components/document-card.tsx
|
|
3580
|
-
import * as
|
|
3581
|
-
import { jsx as
|
|
3582
|
-
var DocumentCard =
|
|
3717
|
+
import * as React21 from "react";
|
|
3718
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3719
|
+
var DocumentCard = React21.forwardRef(
|
|
3583
3720
|
({
|
|
3584
3721
|
actions,
|
|
3585
3722
|
className,
|
|
@@ -3611,7 +3748,7 @@ var DocumentCard = React20.forwardRef(
|
|
|
3611
3748
|
),
|
|
3612
3749
|
...props,
|
|
3613
3750
|
children: [
|
|
3614
|
-
leading ? /* @__PURE__ */
|
|
3751
|
+
leading ? /* @__PURE__ */ jsx22(
|
|
3615
3752
|
"span",
|
|
3616
3753
|
{
|
|
3617
3754
|
"data-slot": "document-card-leading",
|
|
@@ -3620,11 +3757,11 @@ var DocumentCard = React20.forwardRef(
|
|
|
3620
3757
|
}
|
|
3621
3758
|
) : null,
|
|
3622
3759
|
/* @__PURE__ */ jsxs12("span", { "data-slot": "document-card-content", className: "min-w-0", children: [
|
|
3623
|
-
/* @__PURE__ */
|
|
3624
|
-
description ? /* @__PURE__ */
|
|
3625
|
-
meta ? /* @__PURE__ */
|
|
3760
|
+
/* @__PURE__ */ jsx22(Text, { as: "span", size: "label-md", className: "block truncate text-foreground", children: title }),
|
|
3761
|
+
description ? /* @__PURE__ */ jsx22(Text, { as: "span", size: "caption", className: "block truncate text-muted-foreground", children: description }) : null,
|
|
3762
|
+
meta ? /* @__PURE__ */ jsx22(Text, { as: "span", size: "caption", className: "block truncate text-muted-foreground", children: meta }) : null
|
|
3626
3763
|
] }),
|
|
3627
|
-
actions ? /* @__PURE__ */
|
|
3764
|
+
actions ? /* @__PURE__ */ jsx22(
|
|
3628
3765
|
"span",
|
|
3629
3766
|
{
|
|
3630
3767
|
"data-slot": "document-card-actions",
|
|
@@ -3640,9 +3777,9 @@ var DocumentCard = React20.forwardRef(
|
|
|
3640
3777
|
DocumentCard.displayName = "DocumentCard";
|
|
3641
3778
|
|
|
3642
3779
|
// src/components/empty.tsx
|
|
3643
|
-
import * as
|
|
3780
|
+
import * as React22 from "react";
|
|
3644
3781
|
import { cva as cva5 } from "class-variance-authority";
|
|
3645
|
-
import { Fragment as Fragment3, jsx as
|
|
3782
|
+
import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3646
3783
|
var emptyMediaVariantOptions = ["default", "icon"];
|
|
3647
3784
|
var emptyMediaVariants = cva5(
|
|
3648
3785
|
"inline-flex shrink-0 items-center justify-center transition-[background-color,border-color,color,box-shadow] duration-sofya ease-sofya",
|
|
@@ -3658,11 +3795,11 @@ var emptyMediaVariants = cva5(
|
|
|
3658
3795
|
}
|
|
3659
3796
|
}
|
|
3660
3797
|
);
|
|
3661
|
-
var EmptyMedia =
|
|
3662
|
-
return /* @__PURE__ */
|
|
3798
|
+
var EmptyMedia = React22.forwardRef(function EmptyMedia2({ className, variant, ...props }, ref) {
|
|
3799
|
+
return /* @__PURE__ */ jsx23("div", { ref, className: cn(emptyMediaVariants({ variant }), className), ...props });
|
|
3663
3800
|
});
|
|
3664
3801
|
function EmptyHeader({ className, ...props }) {
|
|
3665
|
-
return /* @__PURE__ */
|
|
3802
|
+
return /* @__PURE__ */ jsx23(
|
|
3666
3803
|
"div",
|
|
3667
3804
|
{
|
|
3668
3805
|
className: cn("flex max-w-[34rem] flex-col items-center gap-4 text-center", className),
|
|
@@ -3671,7 +3808,7 @@ function EmptyHeader({ className, ...props }) {
|
|
|
3671
3808
|
);
|
|
3672
3809
|
}
|
|
3673
3810
|
function EmptyTitle({ children, className, ...props }) {
|
|
3674
|
-
return /* @__PURE__ */
|
|
3811
|
+
return /* @__PURE__ */ jsx23(
|
|
3675
3812
|
"h2",
|
|
3676
3813
|
{
|
|
3677
3814
|
className: cn("text-foreground", className),
|
|
@@ -3689,7 +3826,7 @@ function EmptyDescription({
|
|
|
3689
3826
|
className,
|
|
3690
3827
|
...props
|
|
3691
3828
|
}) {
|
|
3692
|
-
return /* @__PURE__ */
|
|
3829
|
+
return /* @__PURE__ */ jsx23(
|
|
3693
3830
|
"p",
|
|
3694
3831
|
{
|
|
3695
3832
|
className: cn("max-w-full text-muted-foreground whitespace-nowrap", className),
|
|
@@ -3703,7 +3840,7 @@ function EmptyDescription({
|
|
|
3703
3840
|
);
|
|
3704
3841
|
}
|
|
3705
3842
|
function EmptyContent({ children, className, ...props }) {
|
|
3706
|
-
return /* @__PURE__ */
|
|
3843
|
+
return /* @__PURE__ */ jsx23(
|
|
3707
3844
|
"div",
|
|
3708
3845
|
{
|
|
3709
3846
|
className: cn("flex flex-wrap items-center justify-center gap-4 text-center", className),
|
|
@@ -3714,9 +3851,9 @@ function EmptyContent({ children, className, ...props }) {
|
|
|
3714
3851
|
}
|
|
3715
3852
|
);
|
|
3716
3853
|
}
|
|
3717
|
-
var Empty =
|
|
3718
|
-
const hasCustomChildren =
|
|
3719
|
-
return /* @__PURE__ */
|
|
3854
|
+
var Empty = React22.forwardRef(function Empty2({ children, className, content, description, media, title, ...props }, ref) {
|
|
3855
|
+
const hasCustomChildren = React22.Children.count(children) > 0;
|
|
3856
|
+
return /* @__PURE__ */ jsx23(
|
|
3720
3857
|
"div",
|
|
3721
3858
|
{
|
|
3722
3859
|
ref,
|
|
@@ -3727,11 +3864,11 @@ var Empty = React21.forwardRef(function Empty2({ children, className, content, d
|
|
|
3727
3864
|
...props,
|
|
3728
3865
|
children: hasCustomChildren ? children : /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
3729
3866
|
/* @__PURE__ */ jsxs13(EmptyHeader, { children: [
|
|
3730
|
-
media ?? /* @__PURE__ */
|
|
3731
|
-
/* @__PURE__ */
|
|
3732
|
-
/* @__PURE__ */
|
|
3867
|
+
media ?? /* @__PURE__ */ jsx23(EmptyMedia, { variant: "icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx23(Icon, { name: "folders", size: 28 }) }),
|
|
3868
|
+
/* @__PURE__ */ jsx23(EmptyTitle, { children: title ?? "Nada por aqui" }),
|
|
3869
|
+
/* @__PURE__ */ jsx23(EmptyDescription, { children: description ?? "Quando houver conte\xFAdo dispon\xEDvel, ele aparecer\xE1 aqui." })
|
|
3733
3870
|
] }),
|
|
3734
|
-
content !== void 0 && content !== null ? /* @__PURE__ */
|
|
3871
|
+
content !== void 0 && content !== null ? /* @__PURE__ */ jsx23(EmptyContent, { children: content }) : null
|
|
3735
3872
|
] })
|
|
3736
3873
|
}
|
|
3737
3874
|
);
|
|
@@ -3743,12 +3880,58 @@ EmptyTitle.displayName = "EmptyTitle";
|
|
|
3743
3880
|
EmptyDescription.displayName = "EmptyDescription";
|
|
3744
3881
|
EmptyContent.displayName = "EmptyContent";
|
|
3745
3882
|
|
|
3883
|
+
// src/components/icon-button.tsx
|
|
3884
|
+
import * as React23 from "react";
|
|
3885
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3886
|
+
var iconButtonVariantOptions = [
|
|
3887
|
+
"ghost",
|
|
3888
|
+
"subtle",
|
|
3889
|
+
"solid",
|
|
3890
|
+
"destructive"
|
|
3891
|
+
];
|
|
3892
|
+
var iconButtonSizeOptions = ["sm", "md", "lg"];
|
|
3893
|
+
var iconButtonSizeClasses = {
|
|
3894
|
+
sm: "size-8",
|
|
3895
|
+
md: "size-10",
|
|
3896
|
+
lg: "size-12"
|
|
3897
|
+
};
|
|
3898
|
+
var iconButtonVariantClasses = {
|
|
3899
|
+
ghost: "bg-transparent text-[color:var(--sofya-text-soft)] shadow-none hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)] data-[selected=true]:bg-[color:var(--sofya-surface-selected)] data-[selected=true]:text-primary",
|
|
3900
|
+
subtle: "bg-[color:var(--sofya-surface-muted)] text-[color:var(--sofya-text-default)] shadow-none hover:bg-[color:var(--sofya-surface-hover-strong)] data-[selected=true]:bg-[color:var(--sofya-surface-selected)] data-[selected=true]:text-primary",
|
|
3901
|
+
solid: "bg-primary text-primary-foreground shadow-none hover:brightness-[1.04] data-[selected=true]:bg-primary",
|
|
3902
|
+
destructive: "bg-transparent text-[color:var(--sofya-text-soft)] shadow-none hover:bg-[color:var(--sofya-surface-destructive)] hover:text-destructive"
|
|
3903
|
+
};
|
|
3904
|
+
var IconButton = React23.forwardRef(
|
|
3905
|
+
function IconButton2({ className, icon, selected, size = "sm", variant = "ghost", ...props }, ref) {
|
|
3906
|
+
return /* @__PURE__ */ jsx24(
|
|
3907
|
+
Button,
|
|
3908
|
+
{
|
|
3909
|
+
ref,
|
|
3910
|
+
"data-slot": "icon-button",
|
|
3911
|
+
"data-selected": selected ? "true" : void 0,
|
|
3912
|
+
"aria-pressed": selected === void 0 ? void 0 : selected,
|
|
3913
|
+
variant: "ghost",
|
|
3914
|
+
size: "icon",
|
|
3915
|
+
leftIcon: icon,
|
|
3916
|
+
className: cn(
|
|
3917
|
+
"rounded-[var(--sofya-radius-md)] p-0 shadow-none",
|
|
3918
|
+
iconButtonSizeClasses[size],
|
|
3919
|
+
iconButtonVariantClasses[variant],
|
|
3920
|
+
className
|
|
3921
|
+
),
|
|
3922
|
+
...props
|
|
3923
|
+
}
|
|
3924
|
+
);
|
|
3925
|
+
}
|
|
3926
|
+
);
|
|
3927
|
+
IconButton.displayName = "IconButton";
|
|
3928
|
+
|
|
3746
3929
|
// src/components/label.tsx
|
|
3747
|
-
import * as
|
|
3748
|
-
import { jsx as
|
|
3749
|
-
var Label =
|
|
3930
|
+
import * as React24 from "react";
|
|
3931
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3932
|
+
var Label = React24.forwardRef(
|
|
3750
3933
|
({ children, className, ...props }, ref) => {
|
|
3751
|
-
return /* @__PURE__ */
|
|
3934
|
+
return /* @__PURE__ */ jsx25(
|
|
3752
3935
|
"label",
|
|
3753
3936
|
{
|
|
3754
3937
|
ref,
|
|
@@ -3772,8 +3955,8 @@ var Label = React22.forwardRef(
|
|
|
3772
3955
|
Label.displayName = "Label";
|
|
3773
3956
|
|
|
3774
3957
|
// src/components/layout.tsx
|
|
3775
|
-
import * as
|
|
3776
|
-
import { jsx as
|
|
3958
|
+
import * as React25 from "react";
|
|
3959
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3777
3960
|
var alignClassName = {
|
|
3778
3961
|
start: "items-start",
|
|
3779
3962
|
center: "items-center",
|
|
@@ -3791,8 +3974,8 @@ function getGapStyle(gap) {
|
|
|
3791
3974
|
"--sofya-layout-gap": `var(--sofya-gap-${gap})`
|
|
3792
3975
|
};
|
|
3793
3976
|
}
|
|
3794
|
-
var Stack =
|
|
3795
|
-
({ className, gap = "default", style, ...props }, ref) => /* @__PURE__ */
|
|
3977
|
+
var Stack = React25.forwardRef(
|
|
3978
|
+
({ className, gap = "default", style, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
3796
3979
|
"div",
|
|
3797
3980
|
{
|
|
3798
3981
|
ref,
|
|
@@ -3804,7 +3987,7 @@ var Stack = React23.forwardRef(
|
|
|
3804
3987
|
)
|
|
3805
3988
|
);
|
|
3806
3989
|
Stack.displayName = "Stack";
|
|
3807
|
-
var Cluster =
|
|
3990
|
+
var Cluster = React25.forwardRef(
|
|
3808
3991
|
({
|
|
3809
3992
|
align = "center",
|
|
3810
3993
|
className,
|
|
@@ -3812,7 +3995,7 @@ var Cluster = React23.forwardRef(
|
|
|
3812
3995
|
justify = "start",
|
|
3813
3996
|
style,
|
|
3814
3997
|
...props
|
|
3815
|
-
}, ref) => /* @__PURE__ */
|
|
3998
|
+
}, ref) => /* @__PURE__ */ jsx26(
|
|
3816
3999
|
"div",
|
|
3817
4000
|
{
|
|
3818
4001
|
ref,
|
|
@@ -3829,8 +4012,8 @@ var Cluster = React23.forwardRef(
|
|
|
3829
4012
|
)
|
|
3830
4013
|
);
|
|
3831
4014
|
Cluster.displayName = "Cluster";
|
|
3832
|
-
var Inline =
|
|
3833
|
-
({ align = "center", className, gap = "compact", style, ...props }, ref) => /* @__PURE__ */
|
|
4015
|
+
var Inline = React25.forwardRef(
|
|
4016
|
+
({ align = "center", className, gap = "compact", style, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
3834
4017
|
"div",
|
|
3835
4018
|
{
|
|
3836
4019
|
ref,
|
|
@@ -3846,12 +4029,12 @@ var Inline = React23.forwardRef(
|
|
|
3846
4029
|
)
|
|
3847
4030
|
);
|
|
3848
4031
|
Inline.displayName = "Inline";
|
|
3849
|
-
var Container =
|
|
4032
|
+
var Container = React25.forwardRef(
|
|
3850
4033
|
({ className, measure = "reading", style, ...props }, ref) => {
|
|
3851
4034
|
const measureStyle = measure === "none" ? void 0 : {
|
|
3852
4035
|
"--sofya-layout-measure": `var(--sofya-measure-${measure})`
|
|
3853
4036
|
};
|
|
3854
|
-
return /* @__PURE__ */
|
|
4037
|
+
return /* @__PURE__ */ jsx26(
|
|
3855
4038
|
"div",
|
|
3856
4039
|
{
|
|
3857
4040
|
ref,
|
|
@@ -3870,10 +4053,10 @@ var Container = React23.forwardRef(
|
|
|
3870
4053
|
Container.displayName = "Container";
|
|
3871
4054
|
|
|
3872
4055
|
// src/components/link.tsx
|
|
3873
|
-
import * as
|
|
4056
|
+
import * as React26 from "react";
|
|
3874
4057
|
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
3875
4058
|
import { cva as cva6 } from "class-variance-authority";
|
|
3876
|
-
import { jsx as
|
|
4059
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3877
4060
|
var linkVariants = cva6(
|
|
3878
4061
|
"inline bg-[linear-gradient(currentColor,currentColor)] bg-[position:0_100%] bg-no-repeat pb-0 text-primary no-underline transition-[color,background-size,box-shadow] duration-sofya ease-sofya hover:text-[color:var(--sofya-link-hover)] focus-visible:rounded-[4px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0",
|
|
3879
4062
|
{
|
|
@@ -3888,9 +4071,9 @@ var linkVariants = cva6(
|
|
|
3888
4071
|
}
|
|
3889
4072
|
}
|
|
3890
4073
|
);
|
|
3891
|
-
var Link =
|
|
4074
|
+
var Link = React26.forwardRef(function Link2({ asChild = false, children, className, variant = "default", ...props }, ref) {
|
|
3892
4075
|
const Component = asChild ? Slot3 : "a";
|
|
3893
|
-
return /* @__PURE__ */
|
|
4076
|
+
return /* @__PURE__ */ jsx27(
|
|
3894
4077
|
Component,
|
|
3895
4078
|
{
|
|
3896
4079
|
ref,
|
|
@@ -3908,7 +4091,7 @@ var Link = React24.forwardRef(function Link2({ asChild = false, children, classN
|
|
|
3908
4091
|
Link.displayName = "Link";
|
|
3909
4092
|
|
|
3910
4093
|
// src/components/logo.tsx
|
|
3911
|
-
import * as
|
|
4094
|
+
import * as React27 from "react";
|
|
3912
4095
|
|
|
3913
4096
|
// src/components/logo-data.ts
|
|
3914
4097
|
var logoAssets = {
|
|
@@ -4005,7 +4188,7 @@ var logoAssets = {
|
|
|
4005
4188
|
};
|
|
4006
4189
|
|
|
4007
4190
|
// src/components/logo.tsx
|
|
4008
|
-
import { jsx as
|
|
4191
|
+
import { jsx as jsx28, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4009
4192
|
var logoVariants = ["mono", "default", "text", "full"];
|
|
4010
4193
|
var logoSizeOptions = ["sm", "md", "lg", "xl", "2xl"];
|
|
4011
4194
|
var logoSizeScale = {
|
|
@@ -4041,7 +4224,7 @@ function resolveLogoDimensions(variant, size, width, height) {
|
|
|
4041
4224
|
height: resolvedHeight
|
|
4042
4225
|
};
|
|
4043
4226
|
}
|
|
4044
|
-
var Logo =
|
|
4227
|
+
var Logo = React27.forwardRef(function Logo2({
|
|
4045
4228
|
variant = "full",
|
|
4046
4229
|
size = "lg",
|
|
4047
4230
|
width,
|
|
@@ -4052,7 +4235,7 @@ var Logo = React25.forwardRef(function Logo2({
|
|
|
4052
4235
|
...props
|
|
4053
4236
|
}, ref) {
|
|
4054
4237
|
const asset = logoAssets[variant];
|
|
4055
|
-
const titleId =
|
|
4238
|
+
const titleId = React27.useId();
|
|
4056
4239
|
const dimensions = resolveLogoDimensions(variant, size, width, height);
|
|
4057
4240
|
const monoFill = variant === "mono" ? monoColor ?? "currentColor" : void 0;
|
|
4058
4241
|
return /* @__PURE__ */ jsxs14(
|
|
@@ -4070,8 +4253,8 @@ var Logo = React25.forwardRef(function Logo2({
|
|
|
4070
4253
|
focusable: "false",
|
|
4071
4254
|
...props,
|
|
4072
4255
|
children: [
|
|
4073
|
-
title ? /* @__PURE__ */
|
|
4074
|
-
asset.paths.map((path, index) => /* @__PURE__ */
|
|
4256
|
+
title ? /* @__PURE__ */ jsx28("title", { id: titleId, children: title }) : null,
|
|
4257
|
+
asset.paths.map((path, index) => /* @__PURE__ */ jsx28(
|
|
4075
4258
|
"path",
|
|
4076
4259
|
{
|
|
4077
4260
|
d: path.d,
|
|
@@ -4103,14 +4286,15 @@ var inheritedTypographyStyle = {
|
|
|
4103
4286
|
};
|
|
4104
4287
|
|
|
4105
4288
|
// src/components/pagination.tsx
|
|
4106
|
-
import { jsx as
|
|
4289
|
+
import { jsx as jsx29, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4107
4290
|
var paginationLinkVariants = cva7(
|
|
4108
|
-
"inline-flex h-10 min-w-10 items-center justify-center rounded-full border border-transparent px-4 [font-family:var(--sofya-text-body-font-family)] text-[length:var(--sofya-text-body-font-size)] font-medium leading-[var(--sofya-text-body-line-height)] tracking-[var(--sofya-text-body-letter-spacing)] text-[color:var(--sofya-text-soft)] no-underline transition-[transform,background-color,border-color,color
|
|
4291
|
+
"inline-flex h-10 min-w-10 items-center justify-center rounded-full border border-transparent px-4 [font-family:var(--sofya-text-body-font-family)] text-[length:var(--sofya-text-body-font-size)] font-medium leading-[var(--sofya-text-body-line-height)] tracking-[var(--sofya-text-body-letter-spacing)] text-[color:var(--sofya-text-soft)] no-underline transition-[transform,background-color,border-color,color] duration-sofya ease-sofya motion-safe:active:scale-[0.985] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent",
|
|
4109
4292
|
{
|
|
4110
4293
|
variants: {
|
|
4111
4294
|
isActive: {
|
|
4112
|
-
|
|
4113
|
-
|
|
4295
|
+
// Flat, neutral, clearly current — no shadow, no decorative glow.
|
|
4296
|
+
true: "bg-[color:var(--sofya-surface-selected)] font-semibold text-primary",
|
|
4297
|
+
false: "hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)]"
|
|
4114
4298
|
},
|
|
4115
4299
|
size: {
|
|
4116
4300
|
default: "px-4",
|
|
@@ -4124,7 +4308,7 @@ var paginationLinkVariants = cva7(
|
|
|
4124
4308
|
}
|
|
4125
4309
|
);
|
|
4126
4310
|
function Pagination({ className, ...props }) {
|
|
4127
|
-
return /* @__PURE__ */
|
|
4311
|
+
return /* @__PURE__ */ jsx29(
|
|
4128
4312
|
"nav",
|
|
4129
4313
|
{
|
|
4130
4314
|
"aria-label": "Pagination",
|
|
@@ -4137,7 +4321,7 @@ function PaginationContent({
|
|
|
4137
4321
|
className,
|
|
4138
4322
|
...props
|
|
4139
4323
|
}) {
|
|
4140
|
-
return /* @__PURE__ */
|
|
4324
|
+
return /* @__PURE__ */ jsx29(
|
|
4141
4325
|
"ul",
|
|
4142
4326
|
{
|
|
4143
4327
|
className: cn(
|
|
@@ -4149,7 +4333,7 @@ function PaginationContent({
|
|
|
4149
4333
|
);
|
|
4150
4334
|
}
|
|
4151
4335
|
function PaginationItem({ className, ...props }) {
|
|
4152
|
-
return /* @__PURE__ */
|
|
4336
|
+
return /* @__PURE__ */ jsx29("li", { className: cn("list-none", className), ...props });
|
|
4153
4337
|
}
|
|
4154
4338
|
function PaginationLink({
|
|
4155
4339
|
asChild = false,
|
|
@@ -4159,7 +4343,7 @@ function PaginationLink({
|
|
|
4159
4343
|
...props
|
|
4160
4344
|
}) {
|
|
4161
4345
|
const Component = asChild ? Slot4 : "a";
|
|
4162
|
-
return /* @__PURE__ */
|
|
4346
|
+
return /* @__PURE__ */ jsx29(
|
|
4163
4347
|
Component,
|
|
4164
4348
|
{
|
|
4165
4349
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -4169,10 +4353,10 @@ function PaginationLink({
|
|
|
4169
4353
|
);
|
|
4170
4354
|
}
|
|
4171
4355
|
function PaginationChevronLeft() {
|
|
4172
|
-
return /* @__PURE__ */
|
|
4356
|
+
return /* @__PURE__ */ jsx29(IconChevronLeft2, { "aria-hidden": "true", className: "h-4 w-4", stroke: 1.75 });
|
|
4173
4357
|
}
|
|
4174
4358
|
function PaginationChevronRight() {
|
|
4175
|
-
return /* @__PURE__ */
|
|
4359
|
+
return /* @__PURE__ */ jsx29(IconChevronRight2, { "aria-hidden": "true", className: "h-4 w-4", stroke: 1.75 });
|
|
4176
4360
|
}
|
|
4177
4361
|
function PaginationPrevious({
|
|
4178
4362
|
className,
|
|
@@ -4186,8 +4370,8 @@ function PaginationPrevious({
|
|
|
4186
4370
|
className: cn("gap-2 px-4", className),
|
|
4187
4371
|
...props,
|
|
4188
4372
|
children: [
|
|
4189
|
-
/* @__PURE__ */
|
|
4190
|
-
/* @__PURE__ */
|
|
4373
|
+
/* @__PURE__ */ jsx29(PaginationChevronLeft, {}),
|
|
4374
|
+
/* @__PURE__ */ jsx29("span", { className: "hidden sm:block", children: renderTextContent(text, {
|
|
4191
4375
|
as: "span",
|
|
4192
4376
|
className: "block text-inherit",
|
|
4193
4377
|
size: "body",
|
|
@@ -4209,13 +4393,13 @@ function PaginationNext({
|
|
|
4209
4393
|
className: cn("gap-2 px-4", className),
|
|
4210
4394
|
...props,
|
|
4211
4395
|
children: [
|
|
4212
|
-
/* @__PURE__ */
|
|
4396
|
+
/* @__PURE__ */ jsx29("span", { className: "hidden sm:block", children: renderTextContent(text, {
|
|
4213
4397
|
as: "span",
|
|
4214
4398
|
className: "block text-inherit",
|
|
4215
4399
|
size: "body",
|
|
4216
4400
|
style: inheritedTypographyStyle
|
|
4217
4401
|
}) }),
|
|
4218
|
-
/* @__PURE__ */
|
|
4402
|
+
/* @__PURE__ */ jsx29(PaginationChevronRight, {})
|
|
4219
4403
|
]
|
|
4220
4404
|
}
|
|
4221
4405
|
);
|
|
@@ -4234,23 +4418,23 @@ function PaginationEllipsis({
|
|
|
4234
4418
|
),
|
|
4235
4419
|
...props,
|
|
4236
4420
|
children: [
|
|
4237
|
-
/* @__PURE__ */
|
|
4421
|
+
/* @__PURE__ */ jsx29("span", { children: renderTextContent("...", {
|
|
4238
4422
|
as: "span",
|
|
4239
4423
|
className: "block text-inherit",
|
|
4240
4424
|
size: "h5",
|
|
4241
4425
|
style: inheritedTypographyStyle
|
|
4242
4426
|
}) }),
|
|
4243
|
-
/* @__PURE__ */
|
|
4427
|
+
/* @__PURE__ */ jsx29("span", { className: "sr-only", children: "More pages" })
|
|
4244
4428
|
]
|
|
4245
4429
|
}
|
|
4246
4430
|
);
|
|
4247
4431
|
}
|
|
4248
4432
|
|
|
4249
4433
|
// src/components/prose-dialog.tsx
|
|
4250
|
-
import * as
|
|
4251
|
-
import { jsx as
|
|
4434
|
+
import * as React28 from "react";
|
|
4435
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
4252
4436
|
var proseDialogMaxWidth = "min(var(--sofya-layout-prose-dialog-width), calc(100vw - var(--sofya-space-8)))";
|
|
4253
|
-
var ProseDialogContent =
|
|
4437
|
+
var ProseDialogContent = React28.forwardRef(
|
|
4254
4438
|
({
|
|
4255
4439
|
cardClassName,
|
|
4256
4440
|
cardStyle: incomingCardStyle,
|
|
@@ -4268,7 +4452,7 @@ var ProseDialogContent = React26.forwardRef(
|
|
|
4268
4452
|
...incomingCardStyle,
|
|
4269
4453
|
maxWidth: proseDialogMaxWidth
|
|
4270
4454
|
};
|
|
4271
|
-
return /* @__PURE__ */
|
|
4455
|
+
return /* @__PURE__ */ jsx30(
|
|
4272
4456
|
DialogContent,
|
|
4273
4457
|
{
|
|
4274
4458
|
ref,
|
|
@@ -4289,14 +4473,14 @@ var ProseDialogContent = React26.forwardRef(
|
|
|
4289
4473
|
);
|
|
4290
4474
|
ProseDialogContent.displayName = "ProseDialogContent";
|
|
4291
4475
|
function ProseDialogHeader(props) {
|
|
4292
|
-
return /* @__PURE__ */
|
|
4476
|
+
return /* @__PURE__ */ jsx30(DialogHeader, { "data-slot": "prose-dialog-header", ...props });
|
|
4293
4477
|
}
|
|
4294
4478
|
ProseDialogHeader.displayName = "ProseDialogHeader";
|
|
4295
|
-
var ProseDialogTitle =
|
|
4479
|
+
var ProseDialogTitle = React28.forwardRef((props, ref) => /* @__PURE__ */ jsx30(DialogTitle, { ref, "data-slot": "prose-dialog-title", ...props }));
|
|
4296
4480
|
ProseDialogTitle.displayName = "ProseDialogTitle";
|
|
4297
|
-
var ProseDialogDescription =
|
|
4481
|
+
var ProseDialogDescription = React28.forwardRef((props, ref) => /* @__PURE__ */ jsx30(DialogDescription, { ref, "data-slot": "prose-dialog-description", ...props }));
|
|
4298
4482
|
ProseDialogDescription.displayName = "ProseDialogDescription";
|
|
4299
|
-
var ProseDialogBody =
|
|
4483
|
+
var ProseDialogBody = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
4300
4484
|
"div",
|
|
4301
4485
|
{
|
|
4302
4486
|
ref,
|
|
@@ -4315,9 +4499,9 @@ var ProseDialogBody = React26.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4315
4499
|
ProseDialogBody.displayName = "ProseDialogBody";
|
|
4316
4500
|
|
|
4317
4501
|
// src/components/progress.tsx
|
|
4318
|
-
import * as
|
|
4502
|
+
import * as React29 from "react";
|
|
4319
4503
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
4320
|
-
import { jsx as
|
|
4504
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
4321
4505
|
var progressSizeOptions = ["sm", "default", "lg"];
|
|
4322
4506
|
function clampProgressValue(value, max) {
|
|
4323
4507
|
if (Number.isNaN(value)) {
|
|
@@ -4325,7 +4509,7 @@ function clampProgressValue(value, max) {
|
|
|
4325
4509
|
}
|
|
4326
4510
|
return Math.min(Math.max(value, 0), max);
|
|
4327
4511
|
}
|
|
4328
|
-
var Progress =
|
|
4512
|
+
var Progress = React29.forwardRef(function Progress2({
|
|
4329
4513
|
className,
|
|
4330
4514
|
indicatorClassName,
|
|
4331
4515
|
max = 100,
|
|
@@ -4336,7 +4520,7 @@ var Progress = React27.forwardRef(function Progress2({
|
|
|
4336
4520
|
const safeMax = max > 0 ? max : 100;
|
|
4337
4521
|
const resolvedValue = typeof value === "number" ? clampProgressValue(value, safeMax) : null;
|
|
4338
4522
|
const progressScale = resolvedValue === null ? void 0 : Number((resolvedValue / safeMax).toFixed(4));
|
|
4339
|
-
return /* @__PURE__ */
|
|
4523
|
+
return /* @__PURE__ */ jsx31(
|
|
4340
4524
|
ProgressPrimitive.Root,
|
|
4341
4525
|
{
|
|
4342
4526
|
ref,
|
|
@@ -4349,7 +4533,7 @@ var Progress = React27.forwardRef(function Progress2({
|
|
|
4349
4533
|
className
|
|
4350
4534
|
),
|
|
4351
4535
|
...props,
|
|
4352
|
-
children: /* @__PURE__ */
|
|
4536
|
+
children: /* @__PURE__ */ jsx31(
|
|
4353
4537
|
ProgressPrimitive.Indicator,
|
|
4354
4538
|
{
|
|
4355
4539
|
"data-slot": "progress-indicator",
|
|
@@ -4366,19 +4550,19 @@ var Progress = React27.forwardRef(function Progress2({
|
|
|
4366
4550
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
4367
4551
|
|
|
4368
4552
|
// src/components/radio-group.tsx
|
|
4369
|
-
import * as
|
|
4553
|
+
import * as React30 from "react";
|
|
4370
4554
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4371
|
-
import { jsx as
|
|
4555
|
+
import { jsx as jsx32, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4372
4556
|
var radioGroupOrientationOptions = ["horizontal", "vertical"];
|
|
4373
4557
|
var radioGroupVariantOptions = ["default", "pill", "option"];
|
|
4374
|
-
var RadioGroupContext =
|
|
4558
|
+
var RadioGroupContext = React30.createContext({
|
|
4375
4559
|
variant: "default"
|
|
4376
4560
|
});
|
|
4377
|
-
var RadioGroupOptionContext =
|
|
4561
|
+
var RadioGroupOptionContext = React30.createContext(
|
|
4378
4562
|
{}
|
|
4379
4563
|
);
|
|
4380
|
-
var RadioGroupRoot =
|
|
4381
|
-
return /* @__PURE__ */
|
|
4564
|
+
var RadioGroupRoot = React30.forwardRef(function RadioGroup2({ className, variant = "default", ...props }, ref) {
|
|
4565
|
+
return /* @__PURE__ */ jsx32(RadioGroupContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsx32(
|
|
4382
4566
|
RadioGroupPrimitive.Root,
|
|
4383
4567
|
{
|
|
4384
4568
|
ref,
|
|
@@ -4394,7 +4578,7 @@ var RadioGroupRoot = React28.forwardRef(function RadioGroup2({ className, varian
|
|
|
4394
4578
|
) });
|
|
4395
4579
|
});
|
|
4396
4580
|
RadioGroupRoot.displayName = RadioGroupPrimitive.Root.displayName;
|
|
4397
|
-
var RadioGroupItem =
|
|
4581
|
+
var RadioGroupItem = React30.forwardRef(function RadioGroupItem2({
|
|
4398
4582
|
className,
|
|
4399
4583
|
controlClassName,
|
|
4400
4584
|
description,
|
|
@@ -4406,14 +4590,14 @@ var RadioGroupItem = React28.forwardRef(function RadioGroupItem2({
|
|
|
4406
4590
|
labelClassName,
|
|
4407
4591
|
...props
|
|
4408
4592
|
}, ref) {
|
|
4409
|
-
const { variant } =
|
|
4410
|
-
const generatedId =
|
|
4593
|
+
const { variant } = React30.useContext(RadioGroupContext);
|
|
4594
|
+
const generatedId = React30.useId();
|
|
4411
4595
|
const resolvedId = id ?? generatedId;
|
|
4412
4596
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
4413
4597
|
const descriptionId = description ? `${resolvedId}-description` : void 0;
|
|
4414
4598
|
const alignClassName2 = description ? "items-start" : "items-center";
|
|
4415
4599
|
if (variant === "pill") {
|
|
4416
|
-
return /* @__PURE__ */
|
|
4600
|
+
return /* @__PURE__ */ jsx32(
|
|
4417
4601
|
RadioGroupPrimitive.Item,
|
|
4418
4602
|
{
|
|
4419
4603
|
ref,
|
|
@@ -4429,7 +4613,7 @@ var RadioGroupItem = React28.forwardRef(function RadioGroupItem2({
|
|
|
4429
4613
|
),
|
|
4430
4614
|
...props,
|
|
4431
4615
|
children: label || description ? /* @__PURE__ */ jsxs16("span", { className: "grid justify-items-center gap-1 text-center", children: [
|
|
4432
|
-
label ? /* @__PURE__ */
|
|
4616
|
+
label ? /* @__PURE__ */ jsx32(
|
|
4433
4617
|
"span",
|
|
4434
4618
|
{
|
|
4435
4619
|
id: labelId,
|
|
@@ -4444,7 +4628,7 @@ var RadioGroupItem = React28.forwardRef(function RadioGroupItem2({
|
|
|
4444
4628
|
})
|
|
4445
4629
|
}
|
|
4446
4630
|
) : null,
|
|
4447
|
-
description ? /* @__PURE__ */
|
|
4631
|
+
description ? /* @__PURE__ */ jsx32(
|
|
4448
4632
|
"span",
|
|
4449
4633
|
{
|
|
4450
4634
|
id: descriptionId,
|
|
@@ -4472,7 +4656,7 @@ var RadioGroupItem = React28.forwardRef(function RadioGroupItem2({
|
|
|
4472
4656
|
disabled
|
|
4473
4657
|
}),
|
|
4474
4658
|
children: [
|
|
4475
|
-
/* @__PURE__ */
|
|
4659
|
+
/* @__PURE__ */ jsx32(
|
|
4476
4660
|
RadioGroupPrimitive.Item,
|
|
4477
4661
|
{
|
|
4478
4662
|
ref,
|
|
@@ -4488,7 +4672,7 @@ var RadioGroupItem = React28.forwardRef(function RadioGroupItem2({
|
|
|
4488
4672
|
controlClassName
|
|
4489
4673
|
),
|
|
4490
4674
|
...props,
|
|
4491
|
-
children: /* @__PURE__ */
|
|
4675
|
+
children: /* @__PURE__ */ jsx32(RadioGroupPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ jsx32(
|
|
4492
4676
|
"span",
|
|
4493
4677
|
{
|
|
4494
4678
|
"data-slot": "radio-group-indicator",
|
|
@@ -4501,7 +4685,7 @@ var RadioGroupItem = React28.forwardRef(function RadioGroupItem2({
|
|
|
4501
4685
|
}
|
|
4502
4686
|
),
|
|
4503
4687
|
label || description ? /* @__PURE__ */ jsxs16("span", { className: selectionControlContentBaseClasses, children: [
|
|
4504
|
-
label ? /* @__PURE__ */
|
|
4688
|
+
label ? /* @__PURE__ */ jsx32(
|
|
4505
4689
|
"span",
|
|
4506
4690
|
{
|
|
4507
4691
|
id: labelId,
|
|
@@ -4516,7 +4700,7 @@ var RadioGroupItem = React28.forwardRef(function RadioGroupItem2({
|
|
|
4516
4700
|
})
|
|
4517
4701
|
}
|
|
4518
4702
|
) : null,
|
|
4519
|
-
description ? /* @__PURE__ */
|
|
4703
|
+
description ? /* @__PURE__ */ jsx32(
|
|
4520
4704
|
"span",
|
|
4521
4705
|
{
|
|
4522
4706
|
id: descriptionId,
|
|
@@ -4537,7 +4721,7 @@ var RadioGroupItem = React28.forwardRef(function RadioGroupItem2({
|
|
|
4537
4721
|
);
|
|
4538
4722
|
});
|
|
4539
4723
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
4540
|
-
var RadioGroupOptionAvatar =
|
|
4724
|
+
var RadioGroupOptionAvatar = React30.forwardRef(function RadioGroupOptionAvatar2({
|
|
4541
4725
|
alt,
|
|
4542
4726
|
avatarClassName,
|
|
4543
4727
|
avatarProps,
|
|
@@ -4547,7 +4731,7 @@ var RadioGroupOptionAvatar = React28.forwardRef(function RadioGroupOptionAvatar2
|
|
|
4547
4731
|
src,
|
|
4548
4732
|
...props
|
|
4549
4733
|
}, ref) {
|
|
4550
|
-
return /* @__PURE__ */
|
|
4734
|
+
return /* @__PURE__ */ jsx32(
|
|
4551
4735
|
"span",
|
|
4552
4736
|
{
|
|
4553
4737
|
ref,
|
|
@@ -4557,7 +4741,7 @@ var RadioGroupOptionAvatar = React28.forwardRef(function RadioGroupOptionAvatar2
|
|
|
4557
4741
|
className
|
|
4558
4742
|
),
|
|
4559
4743
|
...props,
|
|
4560
|
-
children: children ?? /* @__PURE__ */
|
|
4744
|
+
children: children ?? /* @__PURE__ */ jsx32(
|
|
4561
4745
|
Avatar,
|
|
4562
4746
|
{
|
|
4563
4747
|
...avatarProps,
|
|
@@ -4574,9 +4758,9 @@ var RadioGroupOptionAvatar = React28.forwardRef(function RadioGroupOptionAvatar2
|
|
|
4574
4758
|
);
|
|
4575
4759
|
});
|
|
4576
4760
|
RadioGroupOptionAvatar.displayName = "RadioGroupOptionAvatar";
|
|
4577
|
-
var RadioGroupOptionLabel =
|
|
4578
|
-
const { labelId } =
|
|
4579
|
-
return /* @__PURE__ */
|
|
4761
|
+
var RadioGroupOptionLabel = React30.forwardRef(function RadioGroupOptionLabel2({ children, className, ...props }, ref) {
|
|
4762
|
+
const { labelId } = React30.useContext(RadioGroupOptionContext);
|
|
4763
|
+
return /* @__PURE__ */ jsx32(
|
|
4580
4764
|
"span",
|
|
4581
4765
|
{
|
|
4582
4766
|
ref,
|
|
@@ -4596,9 +4780,9 @@ var RadioGroupOptionLabel = React28.forwardRef(function RadioGroupOptionLabel2({
|
|
|
4596
4780
|
);
|
|
4597
4781
|
});
|
|
4598
4782
|
RadioGroupOptionLabel.displayName = "RadioGroupOptionLabel";
|
|
4599
|
-
var RadioGroupOptionDescription =
|
|
4600
|
-
const { descriptionId } =
|
|
4601
|
-
return /* @__PURE__ */
|
|
4783
|
+
var RadioGroupOptionDescription = React30.forwardRef(function RadioGroupOptionDescription2({ children, className, ...props }, ref) {
|
|
4784
|
+
const { descriptionId } = React30.useContext(RadioGroupOptionContext);
|
|
4785
|
+
return /* @__PURE__ */ jsx32(
|
|
4602
4786
|
"span",
|
|
4603
4787
|
{
|
|
4604
4788
|
ref,
|
|
@@ -4617,8 +4801,8 @@ var RadioGroupOptionDescription = React28.forwardRef(function RadioGroupOptionDe
|
|
|
4617
4801
|
);
|
|
4618
4802
|
});
|
|
4619
4803
|
RadioGroupOptionDescription.displayName = "RadioGroupOptionDescription";
|
|
4620
|
-
var RadioGroupOptionIndicator =
|
|
4621
|
-
return /* @__PURE__ */
|
|
4804
|
+
var RadioGroupOptionIndicator = React30.forwardRef(function RadioGroupOptionIndicator2({ children, className, ...props }, ref) {
|
|
4805
|
+
return /* @__PURE__ */ jsx32(
|
|
4622
4806
|
"span",
|
|
4623
4807
|
{
|
|
4624
4808
|
ref,
|
|
@@ -4628,7 +4812,7 @@ var RadioGroupOptionIndicator = React28.forwardRef(function RadioGroupOptionIndi
|
|
|
4628
4812
|
className
|
|
4629
4813
|
),
|
|
4630
4814
|
...props,
|
|
4631
|
-
children: children ?? /* @__PURE__ */
|
|
4815
|
+
children: children ?? /* @__PURE__ */ jsx32(
|
|
4632
4816
|
"svg",
|
|
4633
4817
|
{
|
|
4634
4818
|
"aria-hidden": "true",
|
|
@@ -4636,7 +4820,7 @@ var RadioGroupOptionIndicator = React28.forwardRef(function RadioGroupOptionIndi
|
|
|
4636
4820
|
className: "h-6 w-6 opacity-0 transition-opacity duration-sofya ease-sofya group-data-[state=checked]/radio-option:opacity-100",
|
|
4637
4821
|
fill: "none",
|
|
4638
4822
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4639
|
-
children: /* @__PURE__ */
|
|
4823
|
+
children: /* @__PURE__ */ jsx32(
|
|
4640
4824
|
"path",
|
|
4641
4825
|
{
|
|
4642
4826
|
d: "M9.55 17.6537L4.2155 12.3192L5.2845 11.25L9.55 15.5155L18.7155 6.35L19.7845 7.41925L9.55 17.6537Z",
|
|
@@ -4650,14 +4834,14 @@ var RadioGroupOptionIndicator = React28.forwardRef(function RadioGroupOptionIndi
|
|
|
4650
4834
|
});
|
|
4651
4835
|
RadioGroupOptionIndicator.displayName = "RadioGroupOptionIndicator";
|
|
4652
4836
|
function isOptionChild(child, component) {
|
|
4653
|
-
return
|
|
4837
|
+
return React30.isValidElement(child) && child.type === component;
|
|
4654
4838
|
}
|
|
4655
|
-
var RadioGroupOption =
|
|
4656
|
-
const generatedId =
|
|
4839
|
+
var RadioGroupOption = React30.forwardRef(function RadioGroupOption2({ children, className, disabled, id, ...props }, ref) {
|
|
4840
|
+
const generatedId = React30.useId();
|
|
4657
4841
|
const resolvedId = id ?? generatedId;
|
|
4658
4842
|
const labelId = `${resolvedId}-label`;
|
|
4659
4843
|
const descriptionId = `${resolvedId}-description`;
|
|
4660
|
-
const childArray =
|
|
4844
|
+
const childArray = React30.Children.toArray(children);
|
|
4661
4845
|
const leadingChildren = [];
|
|
4662
4846
|
const contentChildren = [];
|
|
4663
4847
|
let indicatorChild = null;
|
|
@@ -4672,7 +4856,7 @@ var RadioGroupOption = React28.forwardRef(function RadioGroupOption2({ children,
|
|
|
4672
4856
|
}
|
|
4673
4857
|
contentChildren.push(child);
|
|
4674
4858
|
}
|
|
4675
|
-
return /* @__PURE__ */
|
|
4859
|
+
return /* @__PURE__ */ jsx32(RadioGroupOptionContext.Provider, { value: { descriptionId, labelId }, children: /* @__PURE__ */ jsxs16(
|
|
4676
4860
|
RadioGroupPrimitive.Item,
|
|
4677
4861
|
{
|
|
4678
4862
|
ref,
|
|
@@ -4692,7 +4876,7 @@ var RadioGroupOption = React28.forwardRef(function RadioGroupOption2({ children,
|
|
|
4692
4876
|
...props,
|
|
4693
4877
|
children: [
|
|
4694
4878
|
leadingChildren,
|
|
4695
|
-
/* @__PURE__ */
|
|
4879
|
+
/* @__PURE__ */ jsx32(
|
|
4696
4880
|
"span",
|
|
4697
4881
|
{
|
|
4698
4882
|
"data-slot": "radio-group-option-content",
|
|
@@ -4700,7 +4884,7 @@ var RadioGroupOption = React28.forwardRef(function RadioGroupOption2({ children,
|
|
|
4700
4884
|
children: contentChildren
|
|
4701
4885
|
}
|
|
4702
4886
|
),
|
|
4703
|
-
indicatorChild ?? /* @__PURE__ */
|
|
4887
|
+
indicatorChild ?? /* @__PURE__ */ jsx32(RadioGroupOptionIndicator, {})
|
|
4704
4888
|
]
|
|
4705
4889
|
}
|
|
4706
4890
|
) });
|
|
@@ -4716,22 +4900,92 @@ var RadioGroup3 = Object.assign(RadioGroupRoot, {
|
|
|
4716
4900
|
OptionLabel: RadioGroupOptionLabel
|
|
4717
4901
|
});
|
|
4718
4902
|
|
|
4903
|
+
// src/components/rich-text-toolbar.tsx
|
|
4904
|
+
import * as React31 from "react";
|
|
4905
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
4906
|
+
var RichTextToolbar = React31.forwardRef(
|
|
4907
|
+
function RichTextToolbar2({ className, editorFocused = false, role = "toolbar", ...props }, ref) {
|
|
4908
|
+
return /* @__PURE__ */ jsx33(
|
|
4909
|
+
"div",
|
|
4910
|
+
{
|
|
4911
|
+
ref,
|
|
4912
|
+
role,
|
|
4913
|
+
"aria-label": props["aria-label"] ?? "Formata\xE7\xE3o de texto",
|
|
4914
|
+
"aria-orientation": "horizontal",
|
|
4915
|
+
"data-slot": "rich-text-toolbar",
|
|
4916
|
+
"data-editor-focused": editorFocused ? "true" : void 0,
|
|
4917
|
+
className: cn(
|
|
4918
|
+
"inline-flex flex-wrap items-center gap-[var(--sofya-gap-tight)] rounded-[var(--sofya-radius-md)] border border-[color:var(--sofya-border-soft)] bg-card p-[var(--sofya-space-1)] transition-[border-color,box-shadow] duration-sofya ease-sofya",
|
|
4919
|
+
"focus-within:border-[color:var(--sofya-border-hover)]",
|
|
4920
|
+
"data-[editor-focused=true]:border-[color:var(--sofya-border-hover)] data-[editor-focused=true]:ring-2 data-[editor-focused=true]:ring-[color:var(--sofya-focus-ring-soft)]",
|
|
4921
|
+
className
|
|
4922
|
+
),
|
|
4923
|
+
...props
|
|
4924
|
+
}
|
|
4925
|
+
);
|
|
4926
|
+
}
|
|
4927
|
+
);
|
|
4928
|
+
RichTextToolbar.displayName = "RichTextToolbar";
|
|
4929
|
+
var RichTextToolbarGroup = React31.forwardRef(function RichTextToolbarGroup2({ className, role = "group", ...props }, ref) {
|
|
4930
|
+
return /* @__PURE__ */ jsx33(
|
|
4931
|
+
"div",
|
|
4932
|
+
{
|
|
4933
|
+
ref,
|
|
4934
|
+
role,
|
|
4935
|
+
"data-slot": "rich-text-toolbar-group",
|
|
4936
|
+
className: cn(
|
|
4937
|
+
"flex items-center gap-[var(--sofya-space-0-5)]",
|
|
4938
|
+
className
|
|
4939
|
+
),
|
|
4940
|
+
...props
|
|
4941
|
+
}
|
|
4942
|
+
);
|
|
4943
|
+
});
|
|
4944
|
+
RichTextToolbarGroup.displayName = "RichTextToolbarGroup";
|
|
4945
|
+
var RichTextToolbarSeparator = React31.forwardRef(function RichTextToolbarSeparator2({ className, ...props }, ref) {
|
|
4946
|
+
return /* @__PURE__ */ jsx33(
|
|
4947
|
+
"span",
|
|
4948
|
+
{
|
|
4949
|
+
ref,
|
|
4950
|
+
"aria-hidden": "true",
|
|
4951
|
+
"data-slot": "rich-text-toolbar-separator",
|
|
4952
|
+
className: cn(
|
|
4953
|
+
"mx-[var(--sofya-space-1)] h-5 w-px shrink-0 bg-[color:var(--sofya-border-soft)]",
|
|
4954
|
+
className
|
|
4955
|
+
),
|
|
4956
|
+
...props
|
|
4957
|
+
}
|
|
4958
|
+
);
|
|
4959
|
+
});
|
|
4960
|
+
RichTextToolbarSeparator.displayName = "RichTextToolbarSeparator";
|
|
4961
|
+
var RichTextToolbarButton = React31.forwardRef(function RichTextToolbarButton2({ active = false, ...props }, ref) {
|
|
4962
|
+
return /* @__PURE__ */ jsx33(
|
|
4963
|
+
IconButton,
|
|
4964
|
+
{
|
|
4965
|
+
ref,
|
|
4966
|
+
"data-slot": "rich-text-toolbar-button",
|
|
4967
|
+
variant: "ghost",
|
|
4968
|
+
selected: active,
|
|
4969
|
+
...props
|
|
4970
|
+
}
|
|
4971
|
+
);
|
|
4972
|
+
});
|
|
4973
|
+
RichTextToolbarButton.displayName = "RichTextToolbarButton";
|
|
4974
|
+
|
|
4719
4975
|
// src/components/right-rail-action.tsx
|
|
4720
|
-
import * as
|
|
4721
|
-
import { jsx as
|
|
4722
|
-
var RightRailAction =
|
|
4723
|
-
({ active = false, className, icon, ...props }, ref) => /* @__PURE__ */
|
|
4724
|
-
|
|
4976
|
+
import * as React32 from "react";
|
|
4977
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4978
|
+
var RightRailAction = React32.forwardRef(
|
|
4979
|
+
({ active = false, className, icon, ...props }, ref) => /* @__PURE__ */ jsx34(
|
|
4980
|
+
IconButton,
|
|
4725
4981
|
{
|
|
4726
4982
|
ref,
|
|
4727
|
-
|
|
4983
|
+
icon,
|
|
4984
|
+
variant: "ghost",
|
|
4985
|
+
selected: active,
|
|
4728
4986
|
"data-slot": "right-rail-action",
|
|
4729
|
-
leftIcon: icon,
|
|
4730
|
-
size: "icon",
|
|
4731
|
-
variant: "icon",
|
|
4732
4987
|
className: cn(
|
|
4733
4988
|
"size-[var(--sofya-icon-button-size-md)] rounded-[var(--sofya-radius-md)] shadow-none",
|
|
4734
|
-
active && "bg-[color:var(--sofya-surface-selected)]",
|
|
4735
4989
|
className
|
|
4736
4990
|
),
|
|
4737
4991
|
...props
|
|
@@ -4741,12 +4995,12 @@ var RightRailAction = React29.forwardRef(
|
|
|
4741
4995
|
RightRailAction.displayName = "RightRailAction";
|
|
4742
4996
|
|
|
4743
4997
|
// src/components/scroll-area.tsx
|
|
4744
|
-
import * as
|
|
4998
|
+
import * as React33 from "react";
|
|
4745
4999
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
4746
|
-
import { jsx as
|
|
5000
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4747
5001
|
var scrollAreaOrientationOptions = ["horizontal", "vertical"];
|
|
4748
|
-
var ScrollArea =
|
|
4749
|
-
return /* @__PURE__ */
|
|
5002
|
+
var ScrollArea = React33.forwardRef(function ScrollArea2({ className, ...props }, ref) {
|
|
5003
|
+
return /* @__PURE__ */ jsx35(
|
|
4750
5004
|
ScrollAreaPrimitive.Root,
|
|
4751
5005
|
{
|
|
4752
5006
|
ref,
|
|
@@ -4757,8 +5011,8 @@ var ScrollArea = React30.forwardRef(function ScrollArea2({ className, ...props }
|
|
|
4757
5011
|
);
|
|
4758
5012
|
});
|
|
4759
5013
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
4760
|
-
var ScrollAreaViewport =
|
|
4761
|
-
return /* @__PURE__ */
|
|
5014
|
+
var ScrollAreaViewport = React33.forwardRef(function ScrollAreaViewport2({ className, ...props }, ref) {
|
|
5015
|
+
return /* @__PURE__ */ jsx35(
|
|
4762
5016
|
ScrollAreaPrimitive.Viewport,
|
|
4763
5017
|
{
|
|
4764
5018
|
ref,
|
|
@@ -4772,8 +5026,8 @@ var ScrollAreaViewport = React30.forwardRef(function ScrollAreaViewport2({ class
|
|
|
4772
5026
|
);
|
|
4773
5027
|
});
|
|
4774
5028
|
ScrollAreaViewport.displayName = ScrollAreaPrimitive.Viewport.displayName;
|
|
4775
|
-
var ScrollAreaScrollbar =
|
|
4776
|
-
return /* @__PURE__ */
|
|
5029
|
+
var ScrollAreaScrollbar = React33.forwardRef(function ScrollAreaScrollbar2({ className, orientation = "vertical", thumbClassName, ...props }, ref) {
|
|
5030
|
+
return /* @__PURE__ */ jsx35(
|
|
4777
5031
|
ScrollAreaPrimitive.Scrollbar,
|
|
4778
5032
|
{
|
|
4779
5033
|
ref,
|
|
@@ -4784,7 +5038,7 @@ var ScrollAreaScrollbar = React30.forwardRef(function ScrollAreaScrollbar2({ cla
|
|
|
4784
5038
|
className
|
|
4785
5039
|
),
|
|
4786
5040
|
...props,
|
|
4787
|
-
children: /* @__PURE__ */
|
|
5041
|
+
children: /* @__PURE__ */ jsx35(
|
|
4788
5042
|
ScrollAreaPrimitive.Thumb,
|
|
4789
5043
|
{
|
|
4790
5044
|
"data-slot": "scroll-area-thumb",
|
|
@@ -4798,8 +5052,8 @@ var ScrollAreaScrollbar = React30.forwardRef(function ScrollAreaScrollbar2({ cla
|
|
|
4798
5052
|
);
|
|
4799
5053
|
});
|
|
4800
5054
|
ScrollAreaScrollbar.displayName = ScrollAreaPrimitive.Scrollbar.displayName;
|
|
4801
|
-
var ScrollAreaCorner =
|
|
4802
|
-
return /* @__PURE__ */
|
|
5055
|
+
var ScrollAreaCorner = React33.forwardRef(function ScrollAreaCorner2({ className, ...props }, ref) {
|
|
5056
|
+
return /* @__PURE__ */ jsx35(
|
|
4803
5057
|
ScrollAreaPrimitive.Corner,
|
|
4804
5058
|
{
|
|
4805
5059
|
ref,
|
|
@@ -4812,19 +5066,19 @@ var ScrollAreaCorner = React30.forwardRef(function ScrollAreaCorner2({ className
|
|
|
4812
5066
|
ScrollAreaCorner.displayName = ScrollAreaPrimitive.Corner.displayName;
|
|
4813
5067
|
|
|
4814
5068
|
// src/components/select.tsx
|
|
4815
|
-
import * as
|
|
5069
|
+
import * as React34 from "react";
|
|
4816
5070
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4817
5071
|
|
|
4818
5072
|
// src/lib/form-control-classes.ts
|
|
4819
5073
|
var formControlBaseClasses = "flex w-full items-center justify-between gap-4 rounded-[10px] border border-[color:var(--sofya-border-strong)] bg-card px-4 text-left [font-family:var(--sofya-text-body-font-family)] text-[length:var(--sofya-text-body-font-size)] [font-weight:var(--sofya-text-body-font-weight)] leading-[var(--sofya-text-body-line-height)] tracking-[var(--sofya-text-body-letter-spacing)] text-[color:var(--sofya-text-default)] shadow-none transition-[border-color,box-shadow,background-color,color] duration-sofya ease-sofya hover:border-[color:var(--sofya-border-hover)] focus:outline-none focus:ring-2 focus:ring-[color:var(--sofya-focus-ring-soft)] focus:ring-offset-0 active:border-transparent active:ring-2 active:ring-[color:var(--sofya-focus-ring-soft)] disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus:ring-destructive/20 data-[placeholder]:text-[color:var(--sofya-text-placeholder)]";
|
|
4820
5074
|
|
|
4821
5075
|
// src/components/select.tsx
|
|
4822
|
-
import { jsx as
|
|
5076
|
+
import { jsx as jsx36, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4823
5077
|
var selectSizeOptions = ["default", "sm"];
|
|
4824
5078
|
var Select = SelectPrimitive.Root;
|
|
4825
5079
|
var SelectGroup = SelectPrimitive.Group;
|
|
4826
|
-
var SelectValue =
|
|
4827
|
-
return /* @__PURE__ */
|
|
5080
|
+
var SelectValue = React34.forwardRef(function SelectValue2({ className, ...props }, ref) {
|
|
5081
|
+
return /* @__PURE__ */ jsx36(
|
|
4828
5082
|
Text,
|
|
4829
5083
|
{
|
|
4830
5084
|
ref,
|
|
@@ -4833,12 +5087,12 @@ var SelectValue = React31.forwardRef(function SelectValue2({ className, ...props
|
|
|
4833
5087
|
className: cn("block truncate text-inherit", className),
|
|
4834
5088
|
size: "tiny",
|
|
4835
5089
|
style: inheritedTypographyStyle,
|
|
4836
|
-
children: /* @__PURE__ */
|
|
5090
|
+
children: /* @__PURE__ */ jsx36(SelectPrimitive.Value, { className: "block truncate", ...props })
|
|
4837
5091
|
}
|
|
4838
5092
|
);
|
|
4839
5093
|
});
|
|
4840
5094
|
SelectValue.displayName = SelectPrimitive.Value.displayName;
|
|
4841
|
-
var SelectTrigger =
|
|
5095
|
+
var SelectTrigger = React34.forwardRef(function SelectTrigger2({ className, children, size = "default", ...props }, ref) {
|
|
4842
5096
|
return /* @__PURE__ */ jsxs17(
|
|
4843
5097
|
SelectPrimitive.Trigger,
|
|
4844
5098
|
{
|
|
@@ -4853,7 +5107,7 @@ var SelectTrigger = React31.forwardRef(function SelectTrigger2({ className, chil
|
|
|
4853
5107
|
...props,
|
|
4854
5108
|
children: [
|
|
4855
5109
|
children,
|
|
4856
|
-
/* @__PURE__ */
|
|
5110
|
+
/* @__PURE__ */ jsx36(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx36(
|
|
4857
5111
|
Icon,
|
|
4858
5112
|
{
|
|
4859
5113
|
name: "caret-down",
|
|
@@ -4866,8 +5120,8 @@ var SelectTrigger = React31.forwardRef(function SelectTrigger2({ className, chil
|
|
|
4866
5120
|
);
|
|
4867
5121
|
});
|
|
4868
5122
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
4869
|
-
var SelectScrollUpButton =
|
|
4870
|
-
return /* @__PURE__ */
|
|
5123
|
+
var SelectScrollUpButton = React34.forwardRef(function SelectScrollUpButton2({ className, ...props }, ref) {
|
|
5124
|
+
return /* @__PURE__ */ jsx36(
|
|
4871
5125
|
SelectPrimitive.ScrollUpButton,
|
|
4872
5126
|
{
|
|
4873
5127
|
ref,
|
|
@@ -4877,13 +5131,13 @@ var SelectScrollUpButton = React31.forwardRef(function SelectScrollUpButton2({ c
|
|
|
4877
5131
|
className
|
|
4878
5132
|
),
|
|
4879
5133
|
...props,
|
|
4880
|
-
children: /* @__PURE__ */
|
|
5134
|
+
children: /* @__PURE__ */ jsx36(Icon, { name: "caret-up", size: 12 })
|
|
4881
5135
|
}
|
|
4882
5136
|
);
|
|
4883
5137
|
});
|
|
4884
5138
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
4885
|
-
var SelectScrollDownButton =
|
|
4886
|
-
return /* @__PURE__ */
|
|
5139
|
+
var SelectScrollDownButton = React34.forwardRef(function SelectScrollDownButton2({ className, ...props }, ref) {
|
|
5140
|
+
return /* @__PURE__ */ jsx36(
|
|
4887
5141
|
SelectPrimitive.ScrollDownButton,
|
|
4888
5142
|
{
|
|
4889
5143
|
ref,
|
|
@@ -4893,13 +5147,13 @@ var SelectScrollDownButton = React31.forwardRef(function SelectScrollDownButton2
|
|
|
4893
5147
|
className
|
|
4894
5148
|
),
|
|
4895
5149
|
...props,
|
|
4896
|
-
children: /* @__PURE__ */
|
|
5150
|
+
children: /* @__PURE__ */ jsx36(Icon, { name: "caret-down", size: 12 })
|
|
4897
5151
|
}
|
|
4898
5152
|
);
|
|
4899
5153
|
});
|
|
4900
5154
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
4901
|
-
var SelectContent =
|
|
4902
|
-
return /* @__PURE__ */
|
|
5155
|
+
var SelectContent = React34.forwardRef(function SelectContent2({ className, children, position = "popper", ...props }, ref) {
|
|
5156
|
+
return /* @__PURE__ */ jsx36(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs17(
|
|
4903
5157
|
SelectPrimitive.Content,
|
|
4904
5158
|
{
|
|
4905
5159
|
ref,
|
|
@@ -4912,8 +5166,8 @@ var SelectContent = React31.forwardRef(function SelectContent2({ className, chil
|
|
|
4912
5166
|
),
|
|
4913
5167
|
...props,
|
|
4914
5168
|
children: [
|
|
4915
|
-
/* @__PURE__ */
|
|
4916
|
-
/* @__PURE__ */
|
|
5169
|
+
/* @__PURE__ */ jsx36(SelectScrollUpButton, {}),
|
|
5170
|
+
/* @__PURE__ */ jsx36(
|
|
4917
5171
|
SelectPrimitive.Viewport,
|
|
4918
5172
|
{
|
|
4919
5173
|
"data-slot": "select-viewport",
|
|
@@ -4921,14 +5175,14 @@ var SelectContent = React31.forwardRef(function SelectContent2({ className, chil
|
|
|
4921
5175
|
children
|
|
4922
5176
|
}
|
|
4923
5177
|
),
|
|
4924
|
-
/* @__PURE__ */
|
|
5178
|
+
/* @__PURE__ */ jsx36(SelectScrollDownButton, {})
|
|
4925
5179
|
]
|
|
4926
5180
|
}
|
|
4927
5181
|
) });
|
|
4928
5182
|
});
|
|
4929
5183
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
4930
|
-
var SelectLabel =
|
|
4931
|
-
return /* @__PURE__ */
|
|
5184
|
+
var SelectLabel = React34.forwardRef(function SelectLabel2({ className, ...props }, ref) {
|
|
5185
|
+
return /* @__PURE__ */ jsx36(
|
|
4932
5186
|
SelectPrimitive.Label,
|
|
4933
5187
|
{
|
|
4934
5188
|
ref,
|
|
@@ -4950,7 +5204,7 @@ var SelectLabel = React31.forwardRef(function SelectLabel2({ className, ...props
|
|
|
4950
5204
|
);
|
|
4951
5205
|
});
|
|
4952
5206
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
4953
|
-
var SelectItem =
|
|
5207
|
+
var SelectItem = React34.forwardRef(function SelectItem2({ className, children, ...props }, ref) {
|
|
4954
5208
|
return /* @__PURE__ */ jsxs17(
|
|
4955
5209
|
SelectPrimitive.Item,
|
|
4956
5210
|
{
|
|
@@ -4962,20 +5216,20 @@ var SelectItem = React31.forwardRef(function SelectItem2({ className, children,
|
|
|
4962
5216
|
),
|
|
4963
5217
|
...props,
|
|
4964
5218
|
children: [
|
|
4965
|
-
/* @__PURE__ */
|
|
5219
|
+
/* @__PURE__ */ jsx36(SelectPrimitive.ItemText, { className: "truncate", children: renderTextContent(children, {
|
|
4966
5220
|
as: "span",
|
|
4967
5221
|
className: "block truncate text-[color:var(--sofya-text-default)]",
|
|
4968
5222
|
size: "tiny",
|
|
4969
5223
|
style: inheritedTypographyStyle
|
|
4970
5224
|
}) }),
|
|
4971
|
-
/* @__PURE__ */
|
|
5225
|
+
/* @__PURE__ */ jsx36(SelectPrimitive.ItemIndicator, { asChild: true, children: /* @__PURE__ */ jsx36("span", { className: "absolute right-4 inline-flex h-4 w-4 items-center justify-center text-primary", children: /* @__PURE__ */ jsx36(Icon, { name: "check", size: 14 }) }) })
|
|
4972
5226
|
]
|
|
4973
5227
|
}
|
|
4974
5228
|
);
|
|
4975
5229
|
});
|
|
4976
5230
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
4977
|
-
var SelectSeparator =
|
|
4978
|
-
return /* @__PURE__ */
|
|
5231
|
+
var SelectSeparator = React34.forwardRef(function SelectSeparator2({ className, ...props }, ref) {
|
|
5232
|
+
return /* @__PURE__ */ jsx36(
|
|
4979
5233
|
SelectPrimitive.Separator,
|
|
4980
5234
|
{
|
|
4981
5235
|
ref,
|
|
@@ -4988,11 +5242,11 @@ var SelectSeparator = React31.forwardRef(function SelectSeparator2({ className,
|
|
|
4988
5242
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
4989
5243
|
|
|
4990
5244
|
// src/components/separator.tsx
|
|
4991
|
-
import * as
|
|
5245
|
+
import * as React35 from "react";
|
|
4992
5246
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4993
|
-
import { jsx as
|
|
4994
|
-
var Separator2 =
|
|
4995
|
-
return /* @__PURE__ */
|
|
5247
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
5248
|
+
var Separator2 = React35.forwardRef(function Separator3({ className, decorative = true, orientation = "horizontal", ...props }, ref) {
|
|
5249
|
+
return /* @__PURE__ */ jsx37(
|
|
4996
5250
|
SeparatorPrimitive.Root,
|
|
4997
5251
|
{
|
|
4998
5252
|
ref,
|
|
@@ -5010,9 +5264,64 @@ var Separator2 = React32.forwardRef(function Separator3({ className, decorative
|
|
|
5010
5264
|
});
|
|
5011
5265
|
Separator2.displayName = SeparatorPrimitive.Root.displayName;
|
|
5012
5266
|
|
|
5267
|
+
// src/components/sidebar-nav-item.tsx
|
|
5268
|
+
import * as React36 from "react";
|
|
5269
|
+
import { jsx as jsx38, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5270
|
+
var SidebarNavItem = React36.forwardRef(
|
|
5271
|
+
function SidebarNavItem2({ as, active = false, disabled = false, icon, className, children, ...props }, ref) {
|
|
5272
|
+
const Comp = as ?? (props.href ? "a" : "button");
|
|
5273
|
+
const isNativeButton = Comp === "button";
|
|
5274
|
+
return /* @__PURE__ */ jsxs18(
|
|
5275
|
+
Comp,
|
|
5276
|
+
{
|
|
5277
|
+
ref,
|
|
5278
|
+
"data-slot": "sidebar-nav-item",
|
|
5279
|
+
"data-active": active ? "true" : void 0,
|
|
5280
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
5281
|
+
"aria-current": active ? "page" : void 0,
|
|
5282
|
+
"aria-disabled": disabled || void 0,
|
|
5283
|
+
...isNativeButton ? { type: "button", disabled } : {},
|
|
5284
|
+
className: cn(
|
|
5285
|
+
"group relative flex w-full items-center gap-[var(--sofya-gap-compact)] rounded-[var(--sofya-radius-md)] py-[var(--sofya-space-2)] pl-[var(--sofya-space-3)] pr-[var(--sofya-space-3)] text-left no-underline outline-none",
|
|
5286
|
+
"[font-family:var(--sofya-text-sidebar-title-font-family)] text-[length:var(--sofya-text-sidebar-title-font-size)] [font-weight:var(--sofya-text-sidebar-title-font-weight)] leading-[var(--sofya-text-sidebar-title-line-height)] tracking-[var(--sofya-text-sidebar-title-letter-spacing)]",
|
|
5287
|
+
"text-[color:var(--sofya-text-soft)] transition-colors duration-sofya ease-sofya",
|
|
5288
|
+
"hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)]",
|
|
5289
|
+
"focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0",
|
|
5290
|
+
"data-[active=true]:bg-[color:var(--sofya-surface-selected)] data-[active=true]:text-[color:var(--sofya-text-default)]",
|
|
5291
|
+
"data-[active=true]:hover:bg-[color:var(--sofya-surface-selected-strong)]",
|
|
5292
|
+
"data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-not-allowed data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:hover:bg-transparent",
|
|
5293
|
+
className
|
|
5294
|
+
),
|
|
5295
|
+
...props,
|
|
5296
|
+
children: [
|
|
5297
|
+
/* @__PURE__ */ jsx38(
|
|
5298
|
+
"span",
|
|
5299
|
+
{
|
|
5300
|
+
"aria-hidden": "true",
|
|
5301
|
+
"data-slot": "sidebar-nav-indicator",
|
|
5302
|
+
className: cn(
|
|
5303
|
+
"pointer-events-none absolute left-0 top-1/2 h-[60%] w-[3px] -translate-y-1/2 rounded-full bg-primary transition-opacity duration-sofya ease-sofya",
|
|
5304
|
+
active ? "opacity-100" : "opacity-0"
|
|
5305
|
+
)
|
|
5306
|
+
}
|
|
5307
|
+
),
|
|
5308
|
+
icon ? /* @__PURE__ */ jsx38("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0", children: icon }) : null,
|
|
5309
|
+
/* @__PURE__ */ jsx38("span", { className: "min-w-0 flex-1 truncate", children: renderTextContent(children, {
|
|
5310
|
+
as: "span",
|
|
5311
|
+
className: "block min-w-0 truncate text-inherit",
|
|
5312
|
+
size: "sidebar-title"
|
|
5313
|
+
}) })
|
|
5314
|
+
]
|
|
5315
|
+
}
|
|
5316
|
+
);
|
|
5317
|
+
}
|
|
5318
|
+
);
|
|
5319
|
+
SidebarNavItem.displayName = "SidebarNavItem";
|
|
5320
|
+
var SettingsNavItem = SidebarNavItem;
|
|
5321
|
+
|
|
5013
5322
|
// src/components/slider.tsx
|
|
5014
|
-
import * as
|
|
5015
|
-
import { jsx as
|
|
5323
|
+
import * as React37 from "react";
|
|
5324
|
+
import { jsx as jsx39, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5016
5325
|
function clampSliderValue(value, min, max) {
|
|
5017
5326
|
if (Number.isNaN(value)) {
|
|
5018
5327
|
return min;
|
|
@@ -5037,7 +5346,7 @@ function resolveSliderMeasurement(value, fallback) {
|
|
|
5037
5346
|
function isTextValue(value) {
|
|
5038
5347
|
return typeof value === "string" || typeof value === "number";
|
|
5039
5348
|
}
|
|
5040
|
-
var Slider =
|
|
5349
|
+
var Slider = React37.forwardRef(function Slider2({
|
|
5041
5350
|
className,
|
|
5042
5351
|
defaultValue,
|
|
5043
5352
|
formatValue,
|
|
@@ -5060,7 +5369,7 @@ var Slider = React33.forwardRef(function Slider2({
|
|
|
5060
5369
|
valueClassName,
|
|
5061
5370
|
...props
|
|
5062
5371
|
}, ref) {
|
|
5063
|
-
const resolvedId =
|
|
5372
|
+
const resolvedId = React37.useId();
|
|
5064
5373
|
const inputId = id ?? resolvedId;
|
|
5065
5374
|
const safeMin = min;
|
|
5066
5375
|
const safeMax = resolveSliderMax(safeMin, max);
|
|
@@ -5069,7 +5378,7 @@ var Slider = React33.forwardRef(function Slider2({
|
|
|
5069
5378
|
onChange: onValueChange,
|
|
5070
5379
|
value
|
|
5071
5380
|
});
|
|
5072
|
-
|
|
5381
|
+
React37.useEffect(() => {
|
|
5073
5382
|
if (value !== void 0) {
|
|
5074
5383
|
return;
|
|
5075
5384
|
}
|
|
@@ -5116,14 +5425,14 @@ var Slider = React33.forwardRef(function Slider2({
|
|
|
5116
5425
|
setControllableValue(nextValue);
|
|
5117
5426
|
onChange?.(event);
|
|
5118
5427
|
};
|
|
5119
|
-
return /* @__PURE__ */
|
|
5428
|
+
return /* @__PURE__ */ jsxs19(
|
|
5120
5429
|
"div",
|
|
5121
5430
|
{
|
|
5122
5431
|
"data-slot": "slider",
|
|
5123
5432
|
className: cn("grid w-full gap-2", className),
|
|
5124
5433
|
children: [
|
|
5125
|
-
label || showValue ? /* @__PURE__ */
|
|
5126
|
-
label ? /* @__PURE__ */
|
|
5434
|
+
label || showValue ? /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between gap-4", children: [
|
|
5435
|
+
label ? /* @__PURE__ */ jsx39(
|
|
5127
5436
|
FieldLabel,
|
|
5128
5437
|
{
|
|
5129
5438
|
htmlFor: inputId,
|
|
@@ -5134,8 +5443,8 @@ var Slider = React33.forwardRef(function Slider2({
|
|
|
5134
5443
|
textClassName: "block min-w-0 text-[color:var(--sofya-text-default)]",
|
|
5135
5444
|
children: label
|
|
5136
5445
|
}
|
|
5137
|
-
) : /* @__PURE__ */
|
|
5138
|
-
showValue ? /* @__PURE__ */
|
|
5446
|
+
) : /* @__PURE__ */ jsx39("span", {}),
|
|
5447
|
+
showValue ? /* @__PURE__ */ jsx39(
|
|
5139
5448
|
"div",
|
|
5140
5449
|
{
|
|
5141
5450
|
className: cn(
|
|
@@ -5153,7 +5462,7 @@ var Slider = React33.forwardRef(function Slider2({
|
|
|
5153
5462
|
}
|
|
5154
5463
|
) : null
|
|
5155
5464
|
] }) : null,
|
|
5156
|
-
/* @__PURE__ */
|
|
5465
|
+
/* @__PURE__ */ jsxs19(
|
|
5157
5466
|
"div",
|
|
5158
5467
|
{
|
|
5159
5468
|
"data-slot": "slider-control",
|
|
@@ -5163,7 +5472,7 @@ var Slider = React33.forwardRef(function Slider2({
|
|
|
5163
5472
|
),
|
|
5164
5473
|
style: controlStyle,
|
|
5165
5474
|
children: [
|
|
5166
|
-
/* @__PURE__ */
|
|
5475
|
+
/* @__PURE__ */ jsx39(
|
|
5167
5476
|
"input",
|
|
5168
5477
|
{
|
|
5169
5478
|
...props,
|
|
@@ -5180,7 +5489,7 @@ var Slider = React33.forwardRef(function Slider2({
|
|
|
5180
5489
|
style: inputBoundsStyle
|
|
5181
5490
|
}
|
|
5182
5491
|
),
|
|
5183
|
-
/* @__PURE__ */
|
|
5492
|
+
/* @__PURE__ */ jsx39(
|
|
5184
5493
|
"div",
|
|
5185
5494
|
{
|
|
5186
5495
|
"data-slot": "slider-track",
|
|
@@ -5191,7 +5500,7 @@ var Slider = React33.forwardRef(function Slider2({
|
|
|
5191
5500
|
style: trackBoundsStyle
|
|
5192
5501
|
}
|
|
5193
5502
|
),
|
|
5194
|
-
/* @__PURE__ */
|
|
5503
|
+
/* @__PURE__ */ jsx39(
|
|
5195
5504
|
"div",
|
|
5196
5505
|
{
|
|
5197
5506
|
"data-slot": "slider-range",
|
|
@@ -5202,7 +5511,7 @@ var Slider = React33.forwardRef(function Slider2({
|
|
|
5202
5511
|
style: rangeStyle
|
|
5203
5512
|
}
|
|
5204
5513
|
),
|
|
5205
|
-
/* @__PURE__ */
|
|
5514
|
+
/* @__PURE__ */ jsx39(
|
|
5206
5515
|
"div",
|
|
5207
5516
|
{
|
|
5208
5517
|
"data-slot": "slider-thumb",
|
|
@@ -5223,10 +5532,10 @@ var Slider = React33.forwardRef(function Slider2({
|
|
|
5223
5532
|
Slider.displayName = "Slider";
|
|
5224
5533
|
|
|
5225
5534
|
// src/components/skeleton.tsx
|
|
5226
|
-
import * as
|
|
5227
|
-
import { jsx as
|
|
5228
|
-
var Skeleton =
|
|
5229
|
-
return /* @__PURE__ */
|
|
5535
|
+
import * as React38 from "react";
|
|
5536
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
5537
|
+
var Skeleton = React38.forwardRef(function Skeleton2({ className, ...props }, ref) {
|
|
5538
|
+
return /* @__PURE__ */ jsx40(
|
|
5230
5539
|
"div",
|
|
5231
5540
|
{
|
|
5232
5541
|
ref,
|
|
@@ -5241,75 +5550,78 @@ var Skeleton = React34.forwardRef(function Skeleton2({ className, ...props }, re
|
|
|
5241
5550
|
Skeleton.displayName = "Skeleton";
|
|
5242
5551
|
|
|
5243
5552
|
// src/components/sonner.tsx
|
|
5244
|
-
import * as
|
|
5553
|
+
import * as React39 from "react";
|
|
5245
5554
|
import {
|
|
5246
5555
|
Toaster as SonnerToaster,
|
|
5247
5556
|
toast
|
|
5248
5557
|
} from "sonner";
|
|
5249
|
-
import { jsx as
|
|
5558
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
5250
5559
|
var notificationVariantOptions = ["default", "success", "error", "warning"];
|
|
5251
5560
|
function ToastStatusIcon({
|
|
5252
5561
|
iconName,
|
|
5253
5562
|
className
|
|
5254
5563
|
}) {
|
|
5255
|
-
return /* @__PURE__ */
|
|
5564
|
+
return /* @__PURE__ */ jsx41(
|
|
5256
5565
|
"span",
|
|
5257
5566
|
{
|
|
5258
5567
|
"aria-hidden": "true",
|
|
5259
5568
|
className: cn(
|
|
5260
|
-
"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border shadow-
|
|
5569
|
+
"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border shadow-none",
|
|
5261
5570
|
className
|
|
5262
5571
|
),
|
|
5263
|
-
children: /* @__PURE__ */
|
|
5572
|
+
children: /* @__PURE__ */ jsx41(Icon, { name: iconName, size: 16 })
|
|
5264
5573
|
}
|
|
5265
5574
|
);
|
|
5266
5575
|
}
|
|
5267
5576
|
var defaultToastClassNames = {
|
|
5268
|
-
|
|
5269
|
-
|
|
5577
|
+
// Flat surface, soft (neutral) elevation, long-text safe content padding so
|
|
5578
|
+
// the message never sits under the single close button.
|
|
5579
|
+
toast: "group pointer-events-auto relative flex w-full items-start gap-4 overflow-hidden rounded-[24px] border px-4 py-4 text-foreground shadow-[var(--sofya-shadow-soft)]",
|
|
5580
|
+
content: "grid min-w-0 gap-2 pr-8",
|
|
5270
5581
|
title: "font-display text-[15px] font-semibold leading-5 tracking-tight text-foreground",
|
|
5271
|
-
description: "text-sm leading-5 text-
|
|
5582
|
+
description: "text-sm leading-5 text-[color:var(--sofya-text-subtle)]",
|
|
5272
5583
|
icon: "mt-0",
|
|
5273
|
-
closeButton: "absolute right-3 top-3 inline-flex h-8 w-8 items-center justify-center rounded-full border border-transparent bg-transparent text-
|
|
5584
|
+
closeButton: "absolute right-3 top-3 inline-flex h-8 w-8 items-center justify-center rounded-full border border-transparent bg-transparent text-[color:var(--sofya-text-soft)] transition-[background-color,border-color,color] duration-sofya ease-sofya hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)]",
|
|
5274
5585
|
actionButton: "inline-flex h-9 shrink-0 items-center justify-center rounded-full bg-primary px-4 text-sm font-medium text-primary-foreground transition-[filter,transform] duration-sofya ease-sofya hover:brightness-[1.04]",
|
|
5275
5586
|
cancelButton: "inline-flex h-9 shrink-0 items-center justify-center rounded-full bg-secondary px-4 text-sm font-medium text-secondary-foreground transition-[background-color,transform] duration-sofya ease-sofya hover:bg-secondary/85",
|
|
5276
5587
|
default: "data-[type=default]:border-border data-[type=default]:bg-card data-[type=default]:text-foreground",
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5588
|
+
// Flat semantic surfaces — no decorative gradients.
|
|
5589
|
+
success: "border-[color:var(--sofya-tone-success-border)] bg-[color:var(--sofya-tone-success-background)] text-foreground",
|
|
5590
|
+
error: "border-[color:var(--sofya-tone-destructive-border)] bg-[color:var(--sofya-tone-destructive-background)] text-foreground",
|
|
5591
|
+
warning: "border-[color:var(--sofya-tone-warning-border)] bg-[color:var(--sofya-tone-warning-background)] text-foreground",
|
|
5592
|
+
info: "border-[color:var(--sofya-tone-info-border)] bg-[color:var(--sofya-tone-info-background)] text-foreground",
|
|
5281
5593
|
loading: "border-border bg-card text-foreground"
|
|
5282
5594
|
};
|
|
5283
5595
|
var defaultToastIcons = {
|
|
5284
|
-
success: /* @__PURE__ */
|
|
5596
|
+
success: /* @__PURE__ */ jsx41(
|
|
5285
5597
|
ToastStatusIcon,
|
|
5286
5598
|
{
|
|
5287
5599
|
iconName: "check",
|
|
5288
5600
|
className: "border-success/15 bg-success/12 text-success"
|
|
5289
5601
|
}
|
|
5290
5602
|
),
|
|
5291
|
-
error: /* @__PURE__ */
|
|
5603
|
+
error: /* @__PURE__ */ jsx41(
|
|
5292
5604
|
ToastStatusIcon,
|
|
5293
5605
|
{
|
|
5294
5606
|
iconName: "x",
|
|
5295
5607
|
className: "border-destructive/15 bg-destructive/12 text-destructive"
|
|
5296
5608
|
}
|
|
5297
5609
|
),
|
|
5298
|
-
warning: /* @__PURE__ */
|
|
5610
|
+
warning: /* @__PURE__ */ jsx41(
|
|
5299
5611
|
ToastStatusIcon,
|
|
5300
5612
|
{
|
|
5301
5613
|
iconName: "question",
|
|
5302
5614
|
className: "border-warning/20 bg-warning/15 text-foreground"
|
|
5303
5615
|
}
|
|
5304
5616
|
),
|
|
5305
|
-
info: /* @__PURE__ */
|
|
5617
|
+
info: /* @__PURE__ */ jsx41(
|
|
5306
5618
|
ToastStatusIcon,
|
|
5307
5619
|
{
|
|
5308
5620
|
iconName: "question",
|
|
5309
5621
|
className: "border-primary/15 bg-primary/10 text-primary"
|
|
5310
5622
|
}
|
|
5311
5623
|
),
|
|
5312
|
-
close: /* @__PURE__ */
|
|
5624
|
+
close: /* @__PURE__ */ jsx41(Icon, { name: "x", size: 12 })
|
|
5313
5625
|
};
|
|
5314
5626
|
function mergeToastClassNames(overrides) {
|
|
5315
5627
|
return {
|
|
@@ -5317,7 +5629,7 @@ function mergeToastClassNames(overrides) {
|
|
|
5317
5629
|
...overrides
|
|
5318
5630
|
};
|
|
5319
5631
|
}
|
|
5320
|
-
var Toaster =
|
|
5632
|
+
var Toaster = React39.forwardRef(
|
|
5321
5633
|
function Toaster2({
|
|
5322
5634
|
className,
|
|
5323
5635
|
closeButton = true,
|
|
@@ -5329,7 +5641,7 @@ var Toaster = React35.forwardRef(
|
|
|
5329
5641
|
visibleToasts = 5,
|
|
5330
5642
|
...props
|
|
5331
5643
|
}, ref) {
|
|
5332
|
-
return /* @__PURE__ */
|
|
5644
|
+
return /* @__PURE__ */ jsx41(
|
|
5333
5645
|
SonnerToaster,
|
|
5334
5646
|
{
|
|
5335
5647
|
ref,
|
|
@@ -5357,11 +5669,257 @@ var Toaster = React35.forwardRef(
|
|
|
5357
5669
|
}
|
|
5358
5670
|
);
|
|
5359
5671
|
Toaster.displayName = "Toaster";
|
|
5672
|
+
function resolveToastId(message, options) {
|
|
5673
|
+
if (options?.id !== void 0) {
|
|
5674
|
+
return options.id;
|
|
5675
|
+
}
|
|
5676
|
+
if (options?.key !== void 0) {
|
|
5677
|
+
return `sofya-toast:${options.key}`;
|
|
5678
|
+
}
|
|
5679
|
+
if (typeof message === "string" || typeof message === "number") {
|
|
5680
|
+
return `sofya-toast:${String(message)}`;
|
|
5681
|
+
}
|
|
5682
|
+
return void 0;
|
|
5683
|
+
}
|
|
5684
|
+
function withDedupId(message, options) {
|
|
5685
|
+
const { key: _key, ...rest } = options ?? {};
|
|
5686
|
+
return { ...rest, id: resolveToastId(message, options) };
|
|
5687
|
+
}
|
|
5688
|
+
var notify = ((message, options) => toast(message, withDedupId(message, options)));
|
|
5689
|
+
notify.success = (message, options) => toast.success(message, withDedupId(message, options));
|
|
5690
|
+
notify.error = (message, options) => toast.error(message, withDedupId(message, options));
|
|
5691
|
+
notify.warning = (message, options) => toast.warning(message, withDedupId(message, options));
|
|
5692
|
+
notify.info = (message, options) => toast.info(message, withDedupId(message, options));
|
|
5693
|
+
notify.message = (message, options) => toast.message(message, withDedupId(message, options));
|
|
5694
|
+
notify.loading = (message, options) => toast.loading(message, withDedupId(message, options));
|
|
5695
|
+
notify.dismiss = toast.dismiss;
|
|
5696
|
+
notify.promise = toast.promise;
|
|
5697
|
+
|
|
5698
|
+
// src/components/status-indicator.tsx
|
|
5699
|
+
import * as React41 from "react";
|
|
5700
|
+
|
|
5701
|
+
// src/components/tooltip.tsx
|
|
5702
|
+
import * as React40 from "react";
|
|
5703
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
5704
|
+
import { Fragment as Fragment4, jsx as jsx42, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5705
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
5706
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
5707
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
5708
|
+
var tooltipToneOptions = [
|
|
5709
|
+
"default",
|
|
5710
|
+
"info",
|
|
5711
|
+
"success",
|
|
5712
|
+
"warning",
|
|
5713
|
+
"destructive"
|
|
5714
|
+
];
|
|
5715
|
+
var tooltipToneClassNames = {
|
|
5716
|
+
default: "border-transparent bg-[color:var(--sofya-tooltip-background)] text-[color:var(--sofya-tooltip-foreground)]",
|
|
5717
|
+
info: "border-[color:var(--sofya-tone-info-border)] bg-[color:var(--sofya-tone-info-background)] text-[color:var(--sofya-tone-info-foreground)]",
|
|
5718
|
+
success: "border-[color:var(--sofya-tone-success-border)] bg-[color:var(--sofya-tone-success-background)] text-[color:var(--sofya-tone-success-foreground)]",
|
|
5719
|
+
warning: "border-[color:var(--sofya-tone-warning-border)] bg-[color:var(--sofya-tone-warning-background)] text-[color:var(--sofya-tone-warning-foreground)]",
|
|
5720
|
+
destructive: "border-[color:var(--sofya-tone-destructive-border)] bg-[color:var(--sofya-tone-destructive-background)] text-[color:var(--sofya-tone-destructive-foreground)]"
|
|
5721
|
+
};
|
|
5722
|
+
var TooltipContent = React40.forwardRef(function TooltipContent2({ className, sideOffset = 8, align = "center", tone = "default", ...props }, ref) {
|
|
5723
|
+
return /* @__PURE__ */ jsx42(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx42(
|
|
5724
|
+
TooltipPrimitive.Content,
|
|
5725
|
+
{
|
|
5726
|
+
ref,
|
|
5727
|
+
sideOffset,
|
|
5728
|
+
align,
|
|
5729
|
+
"data-tone": tone,
|
|
5730
|
+
className: cn(
|
|
5731
|
+
"sofya-tooltip-content z-[60] max-w-[260px] overflow-hidden rounded-[12px] border px-4 py-2 shadow-[var(--sofya-shadow-tooltip)]",
|
|
5732
|
+
tooltipToneClassNames[tone],
|
|
5733
|
+
className
|
|
5734
|
+
),
|
|
5735
|
+
...props,
|
|
5736
|
+
children: renderTextContent(props.children, {
|
|
5737
|
+
as: "span",
|
|
5738
|
+
className: "block",
|
|
5739
|
+
size: "tiny",
|
|
5740
|
+
style: {
|
|
5741
|
+
color: "currentColor",
|
|
5742
|
+
fontWeight: 500
|
|
5743
|
+
}
|
|
5744
|
+
})
|
|
5745
|
+
}
|
|
5746
|
+
) });
|
|
5747
|
+
});
|
|
5748
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
5749
|
+
var StatusTooltip = React40.forwardRef(function StatusTooltip2({
|
|
5750
|
+
children,
|
|
5751
|
+
label,
|
|
5752
|
+
status = "default",
|
|
5753
|
+
side = "right",
|
|
5754
|
+
align = "center",
|
|
5755
|
+
sideOffset = 10,
|
|
5756
|
+
disabled = false,
|
|
5757
|
+
open,
|
|
5758
|
+
defaultOpen,
|
|
5759
|
+
onOpenChange,
|
|
5760
|
+
delayDuration = 120,
|
|
5761
|
+
className
|
|
5762
|
+
}, ref) {
|
|
5763
|
+
if (disabled) {
|
|
5764
|
+
return /* @__PURE__ */ jsx42(Fragment4, { children });
|
|
5765
|
+
}
|
|
5766
|
+
return /* @__PURE__ */ jsx42(TooltipProvider, { delayDuration, children: /* @__PURE__ */ jsxs20(Tooltip, { open, defaultOpen, onOpenChange, children: [
|
|
5767
|
+
/* @__PURE__ */ jsx42(TooltipTrigger, { asChild: true, children }),
|
|
5768
|
+
/* @__PURE__ */ jsx42(
|
|
5769
|
+
TooltipContent,
|
|
5770
|
+
{
|
|
5771
|
+
ref,
|
|
5772
|
+
side,
|
|
5773
|
+
align,
|
|
5774
|
+
sideOffset,
|
|
5775
|
+
tone: status,
|
|
5776
|
+
"data-status": status,
|
|
5777
|
+
className,
|
|
5778
|
+
children: label
|
|
5779
|
+
}
|
|
5780
|
+
)
|
|
5781
|
+
] }) });
|
|
5782
|
+
});
|
|
5783
|
+
StatusTooltip.displayName = "StatusTooltip";
|
|
5784
|
+
|
|
5785
|
+
// src/components/status-indicator.tsx
|
|
5786
|
+
import { jsx as jsx43, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5787
|
+
var workflowStatusOptions = [
|
|
5788
|
+
"draft",
|
|
5789
|
+
"in_progress",
|
|
5790
|
+
"completed",
|
|
5791
|
+
"cancelled",
|
|
5792
|
+
"error",
|
|
5793
|
+
"warning"
|
|
5794
|
+
];
|
|
5795
|
+
var workflowStatusDescriptors = {
|
|
5796
|
+
draft: { tone: "default", label: "Rascunho" },
|
|
5797
|
+
in_progress: { tone: "info", label: "Em curso" },
|
|
5798
|
+
completed: { tone: "success", label: "Finalizada" },
|
|
5799
|
+
cancelled: { tone: "default", label: "Cancelada" },
|
|
5800
|
+
error: { tone: "destructive", label: "Erro" },
|
|
5801
|
+
warning: { tone: "warning", label: "Aten\xE7\xE3o" }
|
|
5802
|
+
};
|
|
5803
|
+
var workflowStatusAliases = {
|
|
5804
|
+
draft: "draft",
|
|
5805
|
+
rascunho: "draft",
|
|
5806
|
+
in_progress: "in_progress",
|
|
5807
|
+
"in-progress": "in_progress",
|
|
5808
|
+
inprogress: "in_progress",
|
|
5809
|
+
em_curso: "in_progress",
|
|
5810
|
+
"em-curso": "in_progress",
|
|
5811
|
+
em_andamento: "in_progress",
|
|
5812
|
+
completed: "completed",
|
|
5813
|
+
complete: "completed",
|
|
5814
|
+
done: "completed",
|
|
5815
|
+
finalizada: "completed",
|
|
5816
|
+
finalizado: "completed",
|
|
5817
|
+
concluida: "completed",
|
|
5818
|
+
cancelled: "cancelled",
|
|
5819
|
+
canceled: "cancelled",
|
|
5820
|
+
cancelada: "cancelled",
|
|
5821
|
+
cancelado: "cancelled",
|
|
5822
|
+
error: "error",
|
|
5823
|
+
errored: "error",
|
|
5824
|
+
failed: "error",
|
|
5825
|
+
erro: "error",
|
|
5826
|
+
falha: "error",
|
|
5827
|
+
warning: "warning",
|
|
5828
|
+
warn: "warning",
|
|
5829
|
+
atencao: "warning",
|
|
5830
|
+
aviso: "warning"
|
|
5831
|
+
};
|
|
5832
|
+
function humanize(value) {
|
|
5833
|
+
const text = value.replace(/[_-]+/g, " ").trim();
|
|
5834
|
+
return text ? text.charAt(0).toUpperCase() + text.slice(1) : value;
|
|
5835
|
+
}
|
|
5836
|
+
function resolveWorkflowStatus(status, options) {
|
|
5837
|
+
const normalized = String(status).trim().toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g, "");
|
|
5838
|
+
const canonical = workflowStatusAliases[normalized];
|
|
5839
|
+
if (canonical) {
|
|
5840
|
+
const descriptor = workflowStatusDescriptors[canonical];
|
|
5841
|
+
return {
|
|
5842
|
+
status: canonical,
|
|
5843
|
+
tone: descriptor.tone,
|
|
5844
|
+
label: options?.label ?? descriptor.label
|
|
5845
|
+
};
|
|
5846
|
+
}
|
|
5847
|
+
return {
|
|
5848
|
+
status: null,
|
|
5849
|
+
tone: "default",
|
|
5850
|
+
label: options?.label ?? humanize(String(status))
|
|
5851
|
+
};
|
|
5852
|
+
}
|
|
5853
|
+
var toneDotClassName = {
|
|
5854
|
+
default: "bg-[color:var(--sofya-text-subtle)]",
|
|
5855
|
+
info: "bg-[color:var(--sofya-tone-info-foreground)]",
|
|
5856
|
+
success: "bg-[color:var(--sofya-tone-success-foreground)]",
|
|
5857
|
+
warning: "bg-[color:var(--sofya-tone-warning-foreground)]",
|
|
5858
|
+
destructive: "bg-[color:var(--sofya-tone-destructive-foreground)]"
|
|
5859
|
+
};
|
|
5860
|
+
var toneTextClassName = {
|
|
5861
|
+
default: "text-[color:var(--sofya-text-soft)]",
|
|
5862
|
+
info: "text-[color:var(--sofya-tone-info-foreground)]",
|
|
5863
|
+
success: "text-[color:var(--sofya-tone-success-foreground)]",
|
|
5864
|
+
warning: "text-[color:var(--sofya-tone-warning-foreground)]",
|
|
5865
|
+
destructive: "text-[color:var(--sofya-tone-destructive-foreground)]"
|
|
5866
|
+
};
|
|
5867
|
+
var StatusIndicator = React41.forwardRef(
|
|
5868
|
+
function StatusIndicator2({
|
|
5869
|
+
className,
|
|
5870
|
+
label,
|
|
5871
|
+
showLabel = false,
|
|
5872
|
+
side = "right",
|
|
5873
|
+
status,
|
|
5874
|
+
tooltip = true,
|
|
5875
|
+
...props
|
|
5876
|
+
}, ref) {
|
|
5877
|
+
const resolved = resolveWorkflowStatus(status, { label });
|
|
5878
|
+
const indicator = /* @__PURE__ */ jsxs21(
|
|
5879
|
+
"span",
|
|
5880
|
+
{
|
|
5881
|
+
ref,
|
|
5882
|
+
role: "img",
|
|
5883
|
+
"aria-label": resolved.label,
|
|
5884
|
+
"data-slot": "status-indicator",
|
|
5885
|
+
"data-status": resolved.status ?? "unknown",
|
|
5886
|
+
"data-tone": resolved.tone,
|
|
5887
|
+
className: cn(
|
|
5888
|
+
"inline-flex items-center gap-[var(--sofya-space-2)]",
|
|
5889
|
+
className
|
|
5890
|
+
),
|
|
5891
|
+
...props,
|
|
5892
|
+
children: [
|
|
5893
|
+
/* @__PURE__ */ jsx43(
|
|
5894
|
+
"span",
|
|
5895
|
+
{
|
|
5896
|
+
"aria-hidden": "true",
|
|
5897
|
+
className: cn(
|
|
5898
|
+
"h-2 w-2 shrink-0 rounded-full",
|
|
5899
|
+
toneDotClassName[resolved.tone]
|
|
5900
|
+
)
|
|
5901
|
+
}
|
|
5902
|
+
),
|
|
5903
|
+
showLabel ? renderTextContent(resolved.label, {
|
|
5904
|
+
as: "span",
|
|
5905
|
+
className: cn("text-inherit", toneTextClassName[resolved.tone]),
|
|
5906
|
+
size: "sidebar-body"
|
|
5907
|
+
}) : null
|
|
5908
|
+
]
|
|
5909
|
+
}
|
|
5910
|
+
);
|
|
5911
|
+
if (!tooltip) {
|
|
5912
|
+
return indicator;
|
|
5913
|
+
}
|
|
5914
|
+
return /* @__PURE__ */ jsx43(StatusTooltip, { status: resolved.tone, label: resolved.label, side, children: indicator });
|
|
5915
|
+
}
|
|
5916
|
+
);
|
|
5917
|
+
StatusIndicator.displayName = "StatusIndicator";
|
|
5360
5918
|
|
|
5361
5919
|
// src/components/switch.tsx
|
|
5362
|
-
import * as
|
|
5920
|
+
import * as React42 from "react";
|
|
5363
5921
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
5364
|
-
import { jsx as
|
|
5922
|
+
import { jsx as jsx44, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5365
5923
|
var switchSizeOptions = ["default", "sm"];
|
|
5366
5924
|
var switchRootSizeClasses = {
|
|
5367
5925
|
default: "h-6 w-11",
|
|
@@ -5371,7 +5929,7 @@ var switchThumbSizeClasses = {
|
|
|
5371
5929
|
default: "h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
5372
5930
|
sm: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
5373
5931
|
};
|
|
5374
|
-
var Switch =
|
|
5932
|
+
var Switch = React42.forwardRef(
|
|
5375
5933
|
({
|
|
5376
5934
|
"aria-describedby": ariaDescribedBy,
|
|
5377
5935
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -5386,7 +5944,7 @@ var Switch = React36.forwardRef(
|
|
|
5386
5944
|
size,
|
|
5387
5945
|
...props
|
|
5388
5946
|
}, ref) => {
|
|
5389
|
-
const generatedId =
|
|
5947
|
+
const generatedId = React42.useId();
|
|
5390
5948
|
const resolvedId = id ?? generatedId;
|
|
5391
5949
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
5392
5950
|
const descriptionId = description ? `${resolvedId}-description` : void 0;
|
|
@@ -5395,7 +5953,7 @@ var Switch = React36.forwardRef(
|
|
|
5395
5953
|
const alignClassName2 = description ? "items-start" : "items-center";
|
|
5396
5954
|
const resolvedAriaDescribedBy = [ariaDescribedBy, descriptionId].filter(Boolean).join(" ") || void 0;
|
|
5397
5955
|
const resolvedAriaLabelledBy = ariaLabelledBy ?? labelId;
|
|
5398
|
-
const switchControl = /* @__PURE__ */
|
|
5956
|
+
const switchControl = /* @__PURE__ */ jsx44(
|
|
5399
5957
|
SwitchPrimitives.Root,
|
|
5400
5958
|
{
|
|
5401
5959
|
id: resolvedId,
|
|
@@ -5410,7 +5968,7 @@ var Switch = React36.forwardRef(
|
|
|
5410
5968
|
"data-size": resolvedSize,
|
|
5411
5969
|
...props,
|
|
5412
5970
|
ref,
|
|
5413
|
-
children: /* @__PURE__ */
|
|
5971
|
+
children: /* @__PURE__ */ jsx44(
|
|
5414
5972
|
SwitchPrimitives.Thumb,
|
|
5415
5973
|
{
|
|
5416
5974
|
className: cn(
|
|
@@ -5424,7 +5982,7 @@ var Switch = React36.forwardRef(
|
|
|
5424
5982
|
if (!hasTextContent) {
|
|
5425
5983
|
return switchControl;
|
|
5426
5984
|
}
|
|
5427
|
-
return /* @__PURE__ */
|
|
5985
|
+
return /* @__PURE__ */ jsxs22(
|
|
5428
5986
|
"div",
|
|
5429
5987
|
{
|
|
5430
5988
|
"data-slot": "switch-container",
|
|
@@ -5435,8 +5993,8 @@ var Switch = React36.forwardRef(
|
|
|
5435
5993
|
}),
|
|
5436
5994
|
children: [
|
|
5437
5995
|
switchControl,
|
|
5438
|
-
/* @__PURE__ */
|
|
5439
|
-
label ? /* @__PURE__ */
|
|
5996
|
+
/* @__PURE__ */ jsxs22("span", { className: selectionControlContentBaseClasses, children: [
|
|
5997
|
+
label ? /* @__PURE__ */ jsx44("label", { htmlFor: resolvedId, className: selectionControlLabelTextBaseClasses, children: /* @__PURE__ */ jsx44(
|
|
5440
5998
|
"span",
|
|
5441
5999
|
{
|
|
5442
6000
|
id: labelId,
|
|
@@ -5451,7 +6009,7 @@ var Switch = React36.forwardRef(
|
|
|
5451
6009
|
})
|
|
5452
6010
|
}
|
|
5453
6011
|
) }) : null,
|
|
5454
|
-
description ? /* @__PURE__ */
|
|
6012
|
+
description ? /* @__PURE__ */ jsx44(
|
|
5455
6013
|
"span",
|
|
5456
6014
|
{
|
|
5457
6015
|
id: descriptionId,
|
|
@@ -5476,8 +6034,8 @@ Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
|
5476
6034
|
|
|
5477
6035
|
// src/components/table.tsx
|
|
5478
6036
|
import { cva as cva8 } from "class-variance-authority";
|
|
5479
|
-
import * as
|
|
5480
|
-
import { jsx as
|
|
6037
|
+
import * as React43 from "react";
|
|
6038
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
5481
6039
|
var tableDensityOptions = ["default", "compact"];
|
|
5482
6040
|
var tableCellVariantOptions = ["default", "primary", "muted"];
|
|
5483
6041
|
var tableStatusToneOptions = [
|
|
@@ -5487,9 +6045,10 @@ var tableStatusToneOptions = [
|
|
|
5487
6045
|
"warning"
|
|
5488
6046
|
];
|
|
5489
6047
|
var tableActionToneOptions = ["primary", "neutral", "danger"];
|
|
5490
|
-
var TableDensityContext =
|
|
6048
|
+
var TableDensityContext = React43.createContext("default");
|
|
6049
|
+
var TableHeaderDensityContext = React43.createContext("default");
|
|
5491
6050
|
function useTableDensity(density) {
|
|
5492
|
-
const inheritedDensity =
|
|
6051
|
+
const inheritedDensity = React43.useContext(TableDensityContext);
|
|
5493
6052
|
return density ?? inheritedDensity;
|
|
5494
6053
|
}
|
|
5495
6054
|
var tableCellVariants = cva8(
|
|
@@ -5545,13 +6104,13 @@ var tableActionButtonVariants = cva8(
|
|
|
5545
6104
|
}
|
|
5546
6105
|
}
|
|
5547
6106
|
);
|
|
5548
|
-
var Table =
|
|
5549
|
-
return /* @__PURE__ */
|
|
6107
|
+
var Table = React43.forwardRef(function Table2({ className, density = "default", ...props }, ref) {
|
|
6108
|
+
return /* @__PURE__ */ jsx45(TableDensityContext.Provider, { value: density, children: /* @__PURE__ */ jsx45(
|
|
5550
6109
|
"div",
|
|
5551
6110
|
{
|
|
5552
6111
|
"data-slot": "table-container",
|
|
5553
6112
|
className: "relative w-full overflow-x-auto",
|
|
5554
|
-
children: /* @__PURE__ */
|
|
6113
|
+
children: /* @__PURE__ */ jsx45(
|
|
5555
6114
|
"table",
|
|
5556
6115
|
{
|
|
5557
6116
|
"data-density": density,
|
|
@@ -5567,22 +6126,25 @@ var Table = React37.forwardRef(function Table2({ className, density = "default",
|
|
|
5567
6126
|
}
|
|
5568
6127
|
) });
|
|
5569
6128
|
});
|
|
5570
|
-
var TableHeader =
|
|
5571
|
-
|
|
6129
|
+
var TableHeader = React43.forwardRef(function TableHeader2({ className, density, ...props }, ref) {
|
|
6130
|
+
const tableDensity = useTableDensity();
|
|
6131
|
+
const headerDensity = density ?? tableDensity;
|
|
6132
|
+
return /* @__PURE__ */ jsx45(TableHeaderDensityContext.Provider, { value: headerDensity, children: /* @__PURE__ */ jsx45(TableDensityContext.Provider, { value: "default", children: /* @__PURE__ */ jsx45(
|
|
5572
6133
|
"thead",
|
|
5573
6134
|
{
|
|
5574
6135
|
"data-slot": "table-header",
|
|
6136
|
+
"data-header-density": headerDensity,
|
|
5575
6137
|
ref,
|
|
5576
6138
|
className: cn(
|
|
5577
|
-
"[&_tr]:border-0 [&_tr:hover]:bg-transparent [&_th]:bg-
|
|
6139
|
+
"[&_tr]:border-0 [&_tr:hover]:bg-transparent [&_th]:bg-background [&_th:first-child]:rounded-tl-[var(--sofya-radius-md)] [&_th:last-child]:rounded-tr-[var(--sofya-radius-md)]",
|
|
5578
6140
|
className
|
|
5579
6141
|
),
|
|
5580
6142
|
...props
|
|
5581
6143
|
}
|
|
5582
|
-
) });
|
|
6144
|
+
) }) });
|
|
5583
6145
|
});
|
|
5584
|
-
var TableBody =
|
|
5585
|
-
return /* @__PURE__ */
|
|
6146
|
+
var TableBody = React43.forwardRef(function TableBody2({ className, ...props }, ref) {
|
|
6147
|
+
return /* @__PURE__ */ jsx45(
|
|
5586
6148
|
"tbody",
|
|
5587
6149
|
{
|
|
5588
6150
|
"data-slot": "table-body",
|
|
@@ -5592,24 +6154,24 @@ var TableBody = React37.forwardRef(function TableBody2({ className, ...props },
|
|
|
5592
6154
|
}
|
|
5593
6155
|
);
|
|
5594
6156
|
});
|
|
5595
|
-
var TableFooter =
|
|
5596
|
-
return /* @__PURE__ */
|
|
6157
|
+
var TableFooter = React43.forwardRef(function TableFooter2({ className, ...props }, ref) {
|
|
6158
|
+
return /* @__PURE__ */ jsx45(
|
|
5597
6159
|
"tfoot",
|
|
5598
6160
|
{
|
|
5599
6161
|
"data-slot": "table-footer",
|
|
5600
6162
|
ref,
|
|
5601
6163
|
className: cn(
|
|
5602
|
-
"border-t border-[color:var(--sofya-border-strong)] bg-
|
|
6164
|
+
"border-t border-[color:var(--sofya-border-strong)] bg-background font-medium [&>tr:last-child]:border-0",
|
|
5603
6165
|
className
|
|
5604
6166
|
),
|
|
5605
6167
|
...props
|
|
5606
6168
|
}
|
|
5607
6169
|
);
|
|
5608
6170
|
});
|
|
5609
|
-
var TableRow =
|
|
6171
|
+
var TableRow = React43.forwardRef(
|
|
5610
6172
|
function TableRow2({ className, density, ...props }, ref) {
|
|
5611
6173
|
const resolvedDensity = useTableDensity(density);
|
|
5612
|
-
return /* @__PURE__ */
|
|
6174
|
+
return /* @__PURE__ */ jsx45(TableDensityContext.Provider, { value: resolvedDensity, children: /* @__PURE__ */ jsx45(
|
|
5613
6175
|
"tr",
|
|
5614
6176
|
{
|
|
5615
6177
|
"data-density": resolvedDensity,
|
|
@@ -5625,14 +6187,17 @@ var TableRow = React37.forwardRef(
|
|
|
5625
6187
|
) });
|
|
5626
6188
|
}
|
|
5627
6189
|
);
|
|
5628
|
-
var TableHead =
|
|
5629
|
-
|
|
6190
|
+
var TableHead = React43.forwardRef(function TableHead2({ className, children, ...props }, ref) {
|
|
6191
|
+
const headerDensity = React43.useContext(TableHeaderDensityContext);
|
|
6192
|
+
return /* @__PURE__ */ jsx45(
|
|
5630
6193
|
"th",
|
|
5631
6194
|
{
|
|
5632
6195
|
"data-slot": "table-head",
|
|
6196
|
+
"data-density": headerDensity,
|
|
5633
6197
|
ref,
|
|
5634
6198
|
className: cn(
|
|
5635
|
-
"whitespace-nowrap px-4
|
|
6199
|
+
"whitespace-nowrap px-4 text-left align-middle [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] font-medium uppercase leading-4 tracking-[0.08em] text-[color:var(--sofya-text-default)] [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
|
|
6200
|
+
headerDensity === "compact" ? "py-2.5" : "py-4",
|
|
5636
6201
|
className
|
|
5637
6202
|
),
|
|
5638
6203
|
...props,
|
|
@@ -5645,10 +6210,10 @@ var TableHead = React37.forwardRef(function TableHead2({ className, children, ..
|
|
|
5645
6210
|
}
|
|
5646
6211
|
);
|
|
5647
6212
|
});
|
|
5648
|
-
var TableCell =
|
|
6213
|
+
var TableCell = React43.forwardRef(
|
|
5649
6214
|
function TableCell2({ className, density, variant, truncate, children, ...props }, ref) {
|
|
5650
6215
|
const resolvedDensity = useTableDensity(density);
|
|
5651
|
-
return /* @__PURE__ */
|
|
6216
|
+
return /* @__PURE__ */ jsx45(
|
|
5652
6217
|
"td",
|
|
5653
6218
|
{
|
|
5654
6219
|
"data-density": resolvedDensity,
|
|
@@ -5673,8 +6238,8 @@ var TableCell = React37.forwardRef(
|
|
|
5673
6238
|
);
|
|
5674
6239
|
}
|
|
5675
6240
|
);
|
|
5676
|
-
var TableCaption =
|
|
5677
|
-
return /* @__PURE__ */
|
|
6241
|
+
var TableCaption = React43.forwardRef(function TableCaption2({ className, children, ...props }, ref) {
|
|
6242
|
+
return /* @__PURE__ */ jsx45(
|
|
5678
6243
|
"caption",
|
|
5679
6244
|
{
|
|
5680
6245
|
"data-slot": "table-caption",
|
|
@@ -5693,12 +6258,12 @@ var TableCaption = React37.forwardRef(function TableCaption2({ className, childr
|
|
|
5693
6258
|
}
|
|
5694
6259
|
);
|
|
5695
6260
|
});
|
|
5696
|
-
var TableCellTitle =
|
|
6261
|
+
var TableCellTitle = React43.forwardRef(
|
|
5697
6262
|
function TableCellTitle2({ className, children, size, ...props }, ref) {
|
|
5698
6263
|
const density = useTableDensity();
|
|
5699
6264
|
const resolvedSize = size ?? (density === "compact" ? "compact" : "default");
|
|
5700
6265
|
const textSize = resolvedSize === "compact" ? "label-md" : "body";
|
|
5701
|
-
return /* @__PURE__ */
|
|
6266
|
+
return /* @__PURE__ */ jsx45(
|
|
5702
6267
|
"span",
|
|
5703
6268
|
{
|
|
5704
6269
|
"data-slot": "table-cell-title",
|
|
@@ -5718,11 +6283,11 @@ var TableCellTitle = React37.forwardRef(
|
|
|
5718
6283
|
);
|
|
5719
6284
|
}
|
|
5720
6285
|
);
|
|
5721
|
-
var TableCellDescription =
|
|
6286
|
+
var TableCellDescription = React43.forwardRef(function TableCellDescription2({ className, children, size, ...props }, ref) {
|
|
5722
6287
|
const density = useTableDensity();
|
|
5723
6288
|
const resolvedSize = size ?? (density === "compact" ? "compact" : "default");
|
|
5724
6289
|
const textSize = resolvedSize === "compact" ? "body-sm" : "tiny";
|
|
5725
|
-
return /* @__PURE__ */
|
|
6290
|
+
return /* @__PURE__ */ jsx45(
|
|
5726
6291
|
"span",
|
|
5727
6292
|
{
|
|
5728
6293
|
"data-slot": "table-cell-description",
|
|
@@ -5750,7 +6315,7 @@ function TableStatusBadge({
|
|
|
5750
6315
|
...props
|
|
5751
6316
|
}) {
|
|
5752
6317
|
const resolvedDensity = useTableDensity(density);
|
|
5753
|
-
return /* @__PURE__ */
|
|
6318
|
+
return /* @__PURE__ */ jsx45(
|
|
5754
6319
|
Badge,
|
|
5755
6320
|
{
|
|
5756
6321
|
"data-density": resolvedDensity,
|
|
@@ -5769,8 +6334,8 @@ function TableStatusBadge({
|
|
|
5769
6334
|
}
|
|
5770
6335
|
);
|
|
5771
6336
|
}
|
|
5772
|
-
var TableActionButton =
|
|
5773
|
-
return /* @__PURE__ */
|
|
6337
|
+
var TableActionButton = React43.forwardRef(function TableActionButton2({ className, tone, type = "button", children, ...props }, ref) {
|
|
6338
|
+
return /* @__PURE__ */ jsx45(
|
|
5774
6339
|
Button,
|
|
5775
6340
|
{
|
|
5776
6341
|
ref,
|
|
@@ -5788,12 +6353,15 @@ var TableActionButton = React37.forwardRef(function TableActionButton2({ classNa
|
|
|
5788
6353
|
}
|
|
5789
6354
|
);
|
|
5790
6355
|
});
|
|
5791
|
-
var TableActions =
|
|
5792
|
-
return /* @__PURE__ */
|
|
6356
|
+
var TableActions = React43.forwardRef(function TableActions2({ className, ...props }, ref) {
|
|
6357
|
+
return /* @__PURE__ */ jsx45(
|
|
5793
6358
|
"div",
|
|
5794
6359
|
{
|
|
5795
6360
|
ref,
|
|
5796
|
-
className: cn(
|
|
6361
|
+
className: cn(
|
|
6362
|
+
"flex shrink-0 items-center justify-end gap-[0.2rem] whitespace-nowrap",
|
|
6363
|
+
className
|
|
6364
|
+
),
|
|
5797
6365
|
...props
|
|
5798
6366
|
}
|
|
5799
6367
|
);
|
|
@@ -5811,11 +6379,293 @@ TableCellDescription.displayName = "TableCellDescription";
|
|
|
5811
6379
|
TableActionButton.displayName = "TableActionButton";
|
|
5812
6380
|
TableActions.displayName = "TableActions";
|
|
5813
6381
|
|
|
6382
|
+
// src/components/tag.tsx
|
|
6383
|
+
import { cva as cva9 } from "class-variance-authority";
|
|
6384
|
+
import * as React44 from "react";
|
|
6385
|
+
import { jsx as jsx46, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6386
|
+
var tagVariantOptions = [
|
|
6387
|
+
"neutral",
|
|
6388
|
+
"organization",
|
|
6389
|
+
"brand",
|
|
6390
|
+
"privacy",
|
|
6391
|
+
"status"
|
|
6392
|
+
];
|
|
6393
|
+
var tagStatusToneOptions = [
|
|
6394
|
+
"info",
|
|
6395
|
+
"success",
|
|
6396
|
+
"warning",
|
|
6397
|
+
"destructive"
|
|
6398
|
+
];
|
|
6399
|
+
var tagVariants = cva9(
|
|
6400
|
+
"inline-flex max-w-full items-center gap-[var(--sofya-space-1)] rounded-full border px-[var(--sofya-space-2-5)] py-[var(--sofya-space-0-5)] [font-family:var(--sofya-text-sidebar-tag-font-family)] text-[length:var(--sofya-text-sidebar-tag-font-size)] [font-weight:var(--sofya-text-sidebar-tag-font-weight)] leading-[var(--sofya-text-sidebar-tag-line-height)] tracking-[var(--sofya-text-sidebar-tag-letter-spacing)] [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
|
|
6401
|
+
{
|
|
6402
|
+
variants: {
|
|
6403
|
+
variant: {
|
|
6404
|
+
neutral: "border-[color:var(--sofya-tone-default-border)] bg-[color:var(--sofya-tone-default-background)] text-[color:var(--sofya-tone-default-foreground)]",
|
|
6405
|
+
organization: "border-[color:var(--sofya-tone-info-border)] bg-[color:var(--sofya-tone-info-background)] text-[color:var(--sofya-tone-info-foreground)]",
|
|
6406
|
+
// Brand/content label: same primary-tinted pill as `organization`, but
|
|
6407
|
+
// semantically named so consumers don't borrow `organization` for
|
|
6408
|
+
// non-org content (e.g. a clinical-domain label).
|
|
6409
|
+
brand: "border-[color:var(--sofya-tone-info-border)] bg-[color:var(--sofya-tone-info-background)] text-[color:var(--sofya-tone-info-foreground)]",
|
|
6410
|
+
privacy: "border-transparent bg-[color:var(--sofya-surface-muted)] text-[color:var(--sofya-text-subtle)]",
|
|
6411
|
+
status: ""
|
|
6412
|
+
}
|
|
6413
|
+
},
|
|
6414
|
+
defaultVariants: {
|
|
6415
|
+
variant: "neutral"
|
|
6416
|
+
}
|
|
6417
|
+
}
|
|
6418
|
+
);
|
|
6419
|
+
var tagStatusToneClasses = {
|
|
6420
|
+
info: "border-[color:var(--sofya-tone-info-border)] bg-[color:var(--sofya-tone-info-background)] text-[color:var(--sofya-tone-info-foreground)]",
|
|
6421
|
+
success: "border-[color:var(--sofya-tone-success-border)] bg-[color:var(--sofya-tone-success-background)] text-[color:var(--sofya-tone-success-foreground)]",
|
|
6422
|
+
warning: "border-[color:var(--sofya-tone-warning-border)] bg-[color:var(--sofya-tone-warning-background)] text-[color:var(--sofya-tone-warning-foreground)]",
|
|
6423
|
+
destructive: "border-[color:var(--sofya-tone-destructive-border)] bg-[color:var(--sofya-tone-destructive-background)] text-[color:var(--sofya-tone-destructive-foreground)]"
|
|
6424
|
+
};
|
|
6425
|
+
var Tag = React44.forwardRef(function Tag2({ children, className, icon, tone = "info", truncate = false, variant, ...props }, ref) {
|
|
6426
|
+
const resolvedVariant = variant ?? "neutral";
|
|
6427
|
+
return /* @__PURE__ */ jsxs23(
|
|
6428
|
+
"span",
|
|
6429
|
+
{
|
|
6430
|
+
ref,
|
|
6431
|
+
"data-slot": "tag",
|
|
6432
|
+
"data-variant": resolvedVariant,
|
|
6433
|
+
className: cn(
|
|
6434
|
+
tagVariants({ variant: resolvedVariant }),
|
|
6435
|
+
resolvedVariant === "status" && tagStatusToneClasses[tone],
|
|
6436
|
+
truncate ? "min-w-0" : "whitespace-nowrap",
|
|
6437
|
+
className
|
|
6438
|
+
),
|
|
6439
|
+
...props,
|
|
6440
|
+
children: [
|
|
6441
|
+
icon ? /* @__PURE__ */ jsx46("span", { className: "inline-flex shrink-0 items-center justify-center", children: icon }) : null,
|
|
6442
|
+
renderTextContent(children, {
|
|
6443
|
+
as: "span",
|
|
6444
|
+
className: cn("text-inherit", truncate && "min-w-0 truncate"),
|
|
6445
|
+
size: "sidebar-tag"
|
|
6446
|
+
})
|
|
6447
|
+
]
|
|
6448
|
+
}
|
|
6449
|
+
);
|
|
6450
|
+
});
|
|
6451
|
+
Tag.displayName = "Tag";
|
|
6452
|
+
var privacyLevelOptions = [
|
|
6453
|
+
"private",
|
|
6454
|
+
"organization",
|
|
6455
|
+
"public"
|
|
6456
|
+
];
|
|
6457
|
+
var privacyDefaultLabels = {
|
|
6458
|
+
private: "Privado",
|
|
6459
|
+
organization: "Minha organiza\xE7\xE3o",
|
|
6460
|
+
public: "P\xFAblico"
|
|
6461
|
+
};
|
|
6462
|
+
var PrivacyLabel = React44.forwardRef(
|
|
6463
|
+
function PrivacyLabel2({ appearance = "text", className, icon, label, privacy, ...props }, ref) {
|
|
6464
|
+
const content = label ?? privacyDefaultLabels[privacy];
|
|
6465
|
+
if (appearance === "tag") {
|
|
6466
|
+
return /* @__PURE__ */ jsx46(
|
|
6467
|
+
Tag,
|
|
6468
|
+
{
|
|
6469
|
+
ref,
|
|
6470
|
+
variant: privacy === "organization" ? "organization" : "privacy",
|
|
6471
|
+
icon,
|
|
6472
|
+
"data-privacy": privacy,
|
|
6473
|
+
className,
|
|
6474
|
+
...props,
|
|
6475
|
+
children: content
|
|
6476
|
+
}
|
|
6477
|
+
);
|
|
6478
|
+
}
|
|
6479
|
+
return /* @__PURE__ */ jsxs23(
|
|
6480
|
+
"span",
|
|
6481
|
+
{
|
|
6482
|
+
ref,
|
|
6483
|
+
"data-slot": "privacy-label",
|
|
6484
|
+
"data-privacy": privacy,
|
|
6485
|
+
className: cn(
|
|
6486
|
+
"inline-flex items-center gap-[var(--sofya-space-1)] text-[color:var(--sofya-text-soft)] [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
|
|
6487
|
+
className
|
|
6488
|
+
),
|
|
6489
|
+
...props,
|
|
6490
|
+
children: [
|
|
6491
|
+
icon ? /* @__PURE__ */ jsx46("span", { className: "inline-flex shrink-0 items-center justify-center", children: icon }) : null,
|
|
6492
|
+
renderTextContent(content, {
|
|
6493
|
+
as: "span",
|
|
6494
|
+
className: "text-inherit",
|
|
6495
|
+
size: "sidebar-body"
|
|
6496
|
+
})
|
|
6497
|
+
]
|
|
6498
|
+
}
|
|
6499
|
+
);
|
|
6500
|
+
}
|
|
6501
|
+
);
|
|
6502
|
+
PrivacyLabel.displayName = "PrivacyLabel";
|
|
6503
|
+
|
|
6504
|
+
// src/components/template-card.tsx
|
|
6505
|
+
import * as React45 from "react";
|
|
6506
|
+
import { Fragment as Fragment5, jsx as jsx47, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6507
|
+
var templateCardLayoutOptions = ["card", "list"];
|
|
6508
|
+
var templateCardFavoriteDisplayOptions = ["action", "inline"];
|
|
6509
|
+
var templateCardMetaPlacementOptions = ["block", "inline"];
|
|
6510
|
+
var TemplateCard = React45.forwardRef(
|
|
6511
|
+
function TemplateCard2({
|
|
6512
|
+
className,
|
|
6513
|
+
description,
|
|
6514
|
+
favoriteDisplay = "action",
|
|
6515
|
+
favoriteLabel = "Favoritar",
|
|
6516
|
+
favorited,
|
|
6517
|
+
layout = "card",
|
|
6518
|
+
meta,
|
|
6519
|
+
metaPlacement = "block",
|
|
6520
|
+
onClick,
|
|
6521
|
+
onKeyDown,
|
|
6522
|
+
onSelectedChange,
|
|
6523
|
+
onToggleFavorite,
|
|
6524
|
+
overflow,
|
|
6525
|
+
selectLabel = "Selecionar",
|
|
6526
|
+
selectable = false,
|
|
6527
|
+
selected = false,
|
|
6528
|
+
title,
|
|
6529
|
+
...props
|
|
6530
|
+
}, ref) {
|
|
6531
|
+
const isList = layout === "list";
|
|
6532
|
+
const descriptionSize = isList ? "caption" : "body-sm";
|
|
6533
|
+
const showInlineStar = favoriteDisplay === "inline" && Boolean(favorited);
|
|
6534
|
+
const showInlineMeta = metaPlacement === "inline" && Boolean(meta);
|
|
6535
|
+
const showBlockMeta = metaPlacement !== "inline" && Boolean(meta);
|
|
6536
|
+
const showFavoriteAction = favoriteDisplay !== "inline" && (onToggleFavorite !== void 0 || favorited !== void 0);
|
|
6537
|
+
const actions = showFavoriteAction || overflow ? /* @__PURE__ */ jsxs24("div", { className: "flex shrink-0 items-center gap-[var(--sofya-gap-tight)]", children: [
|
|
6538
|
+
showFavoriteAction ? /* @__PURE__ */ jsx47(
|
|
6539
|
+
IconButton,
|
|
6540
|
+
{
|
|
6541
|
+
"aria-label": favoriteLabel,
|
|
6542
|
+
selected: Boolean(favorited),
|
|
6543
|
+
onClick: onToggleFavorite,
|
|
6544
|
+
icon: /* @__PURE__ */ jsx47(Icon, { name: "star", size: 18 })
|
|
6545
|
+
}
|
|
6546
|
+
) : null,
|
|
6547
|
+
overflow
|
|
6548
|
+
] }) : null;
|
|
6549
|
+
const titleNode = renderTextContent(title, {
|
|
6550
|
+
as: "span",
|
|
6551
|
+
className: "block min-w-0 truncate font-semibold text-[color:var(--sofya-text-default)]",
|
|
6552
|
+
size: "title-sm"
|
|
6553
|
+
});
|
|
6554
|
+
const hasInlineTitleExtras = showInlineStar || showInlineMeta;
|
|
6555
|
+
const titleRow = hasInlineTitleExtras ? /* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 items-center gap-[var(--sofya-gap-tight)]", children: [
|
|
6556
|
+
showInlineStar ? /* @__PURE__ */ jsx47(Icon, { name: "star-filled", size: 18, color: "primary" }) : null,
|
|
6557
|
+
titleNode,
|
|
6558
|
+
showInlineMeta ? /* @__PURE__ */ jsx47(
|
|
6559
|
+
"span",
|
|
6560
|
+
{
|
|
6561
|
+
"data-slot": "template-card-meta-inline",
|
|
6562
|
+
className: "flex shrink-0 items-center",
|
|
6563
|
+
children: meta
|
|
6564
|
+
}
|
|
6565
|
+
) : null
|
|
6566
|
+
] }) : titleNode;
|
|
6567
|
+
const heading = /* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 flex-col gap-[var(--sofya-space-1)]", children: [
|
|
6568
|
+
titleRow,
|
|
6569
|
+
description ? renderTextContent(description, {
|
|
6570
|
+
as: "span",
|
|
6571
|
+
className: cn(
|
|
6572
|
+
"block min-w-0 text-[color:var(--sofya-text-soft)]",
|
|
6573
|
+
(isList || selectable) && "truncate"
|
|
6574
|
+
),
|
|
6575
|
+
size: descriptionSize
|
|
6576
|
+
}) : null
|
|
6577
|
+
] });
|
|
6578
|
+
const blockMeta = showBlockMeta ? /* @__PURE__ */ jsx47(
|
|
6579
|
+
"div",
|
|
6580
|
+
{
|
|
6581
|
+
"data-slot": "template-card-meta",
|
|
6582
|
+
className: cn(
|
|
6583
|
+
"flex items-center gap-[var(--sofya-gap-compact)] text-[color:var(--sofya-text-subtle)]",
|
|
6584
|
+
isList ? "shrink-0" : "flex-wrap"
|
|
6585
|
+
),
|
|
6586
|
+
children: meta
|
|
6587
|
+
}
|
|
6588
|
+
) : null;
|
|
6589
|
+
const handleClick = (event) => {
|
|
6590
|
+
if (selectable) {
|
|
6591
|
+
onSelectedChange?.(!selected);
|
|
6592
|
+
}
|
|
6593
|
+
onClick?.(event);
|
|
6594
|
+
};
|
|
6595
|
+
const handleKeyDown = (event) => {
|
|
6596
|
+
if (selectable && (event.key === "Enter" || event.key === " ")) {
|
|
6597
|
+
event.preventDefault();
|
|
6598
|
+
onSelectedChange?.(!selected);
|
|
6599
|
+
}
|
|
6600
|
+
onKeyDown?.(event);
|
|
6601
|
+
};
|
|
6602
|
+
return /* @__PURE__ */ jsx47(
|
|
6603
|
+
"div",
|
|
6604
|
+
{
|
|
6605
|
+
ref,
|
|
6606
|
+
"data-slot": "template-card",
|
|
6607
|
+
"data-layout": layout,
|
|
6608
|
+
"data-selectable": selectable ? "true" : void 0,
|
|
6609
|
+
"data-selected": selected ? "true" : void 0,
|
|
6610
|
+
"data-favorited": favorited ? "true" : void 0,
|
|
6611
|
+
role: selectable ? "button" : void 0,
|
|
6612
|
+
tabIndex: selectable ? 0 : void 0,
|
|
6613
|
+
"aria-pressed": selectable ? selected : void 0,
|
|
6614
|
+
onClick: handleClick,
|
|
6615
|
+
onKeyDown: handleKeyDown,
|
|
6616
|
+
className: cn(
|
|
6617
|
+
"group rounded-[var(--sofya-radius-md)] border border-[color:var(--sofya-border-soft)] bg-card transition-colors duration-sofya ease-sofya",
|
|
6618
|
+
"hover:border-[color:var(--sofya-border-strong)] hover:bg-[color:var(--sofya-surface-hover)]",
|
|
6619
|
+
"data-[selected=true]:border-primary data-[selected=true]:bg-[color:var(--sofya-surface-selected)]",
|
|
6620
|
+
selectable ? "flex cursor-pointer items-center gap-[var(--sofya-gap-default)] p-[var(--sofya-space-4)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0" : isList ? "flex items-center gap-[var(--sofya-gap-default)] px-[var(--sofya-space-4)] py-[var(--sofya-space-3)]" : "flex flex-col gap-[var(--sofya-space-3)] p-[var(--sofya-space-4)]",
|
|
6621
|
+
className
|
|
6622
|
+
),
|
|
6623
|
+
...props,
|
|
6624
|
+
children: selectable ? /* @__PURE__ */ jsxs24(Fragment5, { children: [
|
|
6625
|
+
/* @__PURE__ */ jsx47(
|
|
6626
|
+
"span",
|
|
6627
|
+
{
|
|
6628
|
+
className: "shrink-0",
|
|
6629
|
+
onClick: (event) => event.stopPropagation(),
|
|
6630
|
+
children: /* @__PURE__ */ jsx47(
|
|
6631
|
+
Checkbox,
|
|
6632
|
+
{
|
|
6633
|
+
checked: selected,
|
|
6634
|
+
onChange: () => onSelectedChange?.(!selected),
|
|
6635
|
+
"aria-label": selectLabel
|
|
6636
|
+
}
|
|
6637
|
+
)
|
|
6638
|
+
}
|
|
6639
|
+
),
|
|
6640
|
+
/* @__PURE__ */ jsx47("div", { className: "min-w-0 flex-1", children: heading }),
|
|
6641
|
+
blockMeta,
|
|
6642
|
+
actions
|
|
6643
|
+
] }) : isList ? /* @__PURE__ */ jsxs24(Fragment5, { children: [
|
|
6644
|
+
/* @__PURE__ */ jsx47("div", { className: "min-w-0 flex-1", children: heading }),
|
|
6645
|
+
blockMeta,
|
|
6646
|
+
actions
|
|
6647
|
+
] }) : /* @__PURE__ */ jsxs24(Fragment5, { children: [
|
|
6648
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-start justify-between gap-[var(--sofya-gap-compact)]", children: [
|
|
6649
|
+
heading,
|
|
6650
|
+
actions
|
|
6651
|
+
] }),
|
|
6652
|
+
blockMeta
|
|
6653
|
+
] })
|
|
6654
|
+
}
|
|
6655
|
+
);
|
|
6656
|
+
}
|
|
6657
|
+
);
|
|
6658
|
+
TemplateCard.displayName = "TemplateCard";
|
|
6659
|
+
var TemplateListItem = React45.forwardRef(function TemplateListItem2(props, ref) {
|
|
6660
|
+
return /* @__PURE__ */ jsx47(TemplateCard, { ref, layout: "list", ...props });
|
|
6661
|
+
});
|
|
6662
|
+
TemplateListItem.displayName = "TemplateListItem";
|
|
6663
|
+
|
|
5814
6664
|
// src/components/tabs.tsx
|
|
5815
|
-
import * as
|
|
6665
|
+
import * as React46 from "react";
|
|
5816
6666
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5817
6667
|
import { motion as motion3 } from "motion/react";
|
|
5818
|
-
import { jsx as
|
|
6668
|
+
import { jsx as jsx48, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5819
6669
|
function resolveDefaultValue(items, defaultValue) {
|
|
5820
6670
|
if (defaultValue) {
|
|
5821
6671
|
return defaultValue;
|
|
@@ -5839,13 +6689,13 @@ function Tabs({
|
|
|
5839
6689
|
onChange: onValueChange,
|
|
5840
6690
|
value
|
|
5841
6691
|
});
|
|
5842
|
-
const indicatorLayoutId =
|
|
5843
|
-
|
|
6692
|
+
const indicatorLayoutId = React46.useId();
|
|
6693
|
+
React46.useEffect(() => {
|
|
5844
6694
|
if (value === void 0) {
|
|
5845
6695
|
setUncontrolledCurrentValue(resolvedDefaultValue);
|
|
5846
6696
|
}
|
|
5847
6697
|
}, [resolvedDefaultValue, setUncontrolledCurrentValue, value]);
|
|
5848
|
-
return /* @__PURE__ */
|
|
6698
|
+
return /* @__PURE__ */ jsxs25(
|
|
5849
6699
|
TabsPrimitive.Root,
|
|
5850
6700
|
{
|
|
5851
6701
|
className: cn("w-full", className),
|
|
@@ -5853,7 +6703,7 @@ function Tabs({
|
|
|
5853
6703
|
value: currentValue,
|
|
5854
6704
|
...props,
|
|
5855
6705
|
children: [
|
|
5856
|
-
/* @__PURE__ */
|
|
6706
|
+
/* @__PURE__ */ jsx48(
|
|
5857
6707
|
TabsPrimitive.List,
|
|
5858
6708
|
{
|
|
5859
6709
|
"aria-label": "Subtelas navegaveis",
|
|
@@ -5864,7 +6714,7 @@ function Tabs({
|
|
|
5864
6714
|
children: items.map((item) => {
|
|
5865
6715
|
const isUnavailable = item.disabled || item.loading;
|
|
5866
6716
|
const isActive = item.value === currentValue;
|
|
5867
|
-
return /* @__PURE__ */
|
|
6717
|
+
return /* @__PURE__ */ jsxs25(
|
|
5868
6718
|
TabsPrimitive.Trigger,
|
|
5869
6719
|
{
|
|
5870
6720
|
value: item.value,
|
|
@@ -5876,7 +6726,7 @@ function Tabs({
|
|
|
5876
6726
|
item.triggerClassName
|
|
5877
6727
|
),
|
|
5878
6728
|
children: [
|
|
5879
|
-
isActive ? /* @__PURE__ */
|
|
6729
|
+
isActive ? /* @__PURE__ */ jsx48(
|
|
5880
6730
|
motion3.span,
|
|
5881
6731
|
{
|
|
5882
6732
|
"aria-hidden": "true",
|
|
@@ -5886,15 +6736,15 @@ function Tabs({
|
|
|
5886
6736
|
transition: { duration: 0.25, ease: "easeInOut" }
|
|
5887
6737
|
}
|
|
5888
6738
|
) : null,
|
|
5889
|
-
/* @__PURE__ */
|
|
5890
|
-
item.loading ? /* @__PURE__ */
|
|
6739
|
+
/* @__PURE__ */ jsxs25("span", { className: "relative z-10 inline-flex items-center gap-2", children: [
|
|
6740
|
+
item.loading ? /* @__PURE__ */ jsx48(
|
|
5891
6741
|
"span",
|
|
5892
6742
|
{
|
|
5893
6743
|
"aria-hidden": "true",
|
|
5894
6744
|
className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-r-transparent"
|
|
5895
6745
|
}
|
|
5896
6746
|
) : null,
|
|
5897
|
-
/* @__PURE__ */
|
|
6747
|
+
/* @__PURE__ */ jsx48("span", { children: renderTextContent(item.label, {
|
|
5898
6748
|
as: "span",
|
|
5899
6749
|
className: "block text-inherit",
|
|
5900
6750
|
size: "body"
|
|
@@ -5908,7 +6758,7 @@ function Tabs({
|
|
|
5908
6758
|
}
|
|
5909
6759
|
),
|
|
5910
6760
|
items.map(
|
|
5911
|
-
(item) => item.content !== void 0 ? /* @__PURE__ */
|
|
6761
|
+
(item) => item.content !== void 0 ? /* @__PURE__ */ jsx48(
|
|
5912
6762
|
TabsPrimitive.Content,
|
|
5913
6763
|
{
|
|
5914
6764
|
value: item.value,
|
|
@@ -5931,9 +6781,9 @@ function Tabs({
|
|
|
5931
6781
|
Tabs.displayName = "Tabs";
|
|
5932
6782
|
|
|
5933
6783
|
// src/components/textarea.tsx
|
|
5934
|
-
import * as
|
|
5935
|
-
import { jsx as
|
|
5936
|
-
var Textarea =
|
|
6784
|
+
import * as React47 from "react";
|
|
6785
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
6786
|
+
var Textarea = React47.forwardRef(
|
|
5937
6787
|
({
|
|
5938
6788
|
className,
|
|
5939
6789
|
containerClassName,
|
|
@@ -5943,10 +6793,10 @@ var Textarea = React39.forwardRef(
|
|
|
5943
6793
|
rows = 5,
|
|
5944
6794
|
...props
|
|
5945
6795
|
}, ref) => {
|
|
5946
|
-
const generatedId =
|
|
6796
|
+
const generatedId = React47.useId();
|
|
5947
6797
|
const resolvedId = id ?? generatedId;
|
|
5948
6798
|
const ariaLabel = props["aria-label"] ?? (typeof label === "string" ? label : void 0);
|
|
5949
|
-
const control = /* @__PURE__ */
|
|
6799
|
+
const control = /* @__PURE__ */ jsx49(
|
|
5950
6800
|
"textarea",
|
|
5951
6801
|
{
|
|
5952
6802
|
className: cn(
|
|
@@ -5960,7 +6810,7 @@ var Textarea = React39.forwardRef(
|
|
|
5960
6810
|
"aria-label": ariaLabel
|
|
5961
6811
|
}
|
|
5962
6812
|
);
|
|
5963
|
-
return /* @__PURE__ */
|
|
6813
|
+
return /* @__PURE__ */ jsx49(
|
|
5964
6814
|
FieldShell,
|
|
5965
6815
|
{
|
|
5966
6816
|
control,
|
|
@@ -5975,10 +6825,10 @@ var Textarea = React39.forwardRef(
|
|
|
5975
6825
|
Textarea.displayName = "Textarea";
|
|
5976
6826
|
|
|
5977
6827
|
// src/components/toggle.tsx
|
|
5978
|
-
import * as
|
|
6828
|
+
import * as React48 from "react";
|
|
5979
6829
|
import * as SwitchPrimitives2 from "@radix-ui/react-switch";
|
|
5980
|
-
import { jsx as
|
|
5981
|
-
var Toggle =
|
|
6830
|
+
import { jsx as jsx50, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6831
|
+
var Toggle = React48.forwardRef(function Toggle2({
|
|
5982
6832
|
"aria-describedby": ariaDescribedBy,
|
|
5983
6833
|
"aria-labelledby": ariaLabelledBy,
|
|
5984
6834
|
className,
|
|
@@ -5991,7 +6841,7 @@ var Toggle = React40.forwardRef(function Toggle2({
|
|
|
5991
6841
|
labelClassName,
|
|
5992
6842
|
...props
|
|
5993
6843
|
}, ref) {
|
|
5994
|
-
const generatedId =
|
|
6844
|
+
const generatedId = React48.useId();
|
|
5995
6845
|
const resolvedId = id ?? generatedId;
|
|
5996
6846
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
5997
6847
|
const descriptionId = description ? `${resolvedId}-description` : void 0;
|
|
@@ -5999,7 +6849,7 @@ var Toggle = React40.forwardRef(function Toggle2({
|
|
|
5999
6849
|
const alignClassName2 = description ? "items-start" : "items-center";
|
|
6000
6850
|
const resolvedAriaDescribedBy = [ariaDescribedBy, descriptionId].filter(Boolean).join(" ") || void 0;
|
|
6001
6851
|
const resolvedAriaLabelledBy = ariaLabelledBy ?? labelId;
|
|
6002
|
-
const toggleControl = /* @__PURE__ */
|
|
6852
|
+
const toggleControl = /* @__PURE__ */ jsx50(
|
|
6003
6853
|
SwitchPrimitives2.Root,
|
|
6004
6854
|
{
|
|
6005
6855
|
id: resolvedId,
|
|
@@ -6013,7 +6863,7 @@ var Toggle = React40.forwardRef(function Toggle2({
|
|
|
6013
6863
|
className
|
|
6014
6864
|
),
|
|
6015
6865
|
...props,
|
|
6016
|
-
children: /* @__PURE__ */
|
|
6866
|
+
children: /* @__PURE__ */ jsx50(
|
|
6017
6867
|
SwitchPrimitives2.Thumb,
|
|
6018
6868
|
{
|
|
6019
6869
|
"data-slot": "toggle-thumb",
|
|
@@ -6025,7 +6875,7 @@ var Toggle = React40.forwardRef(function Toggle2({
|
|
|
6025
6875
|
if (!hasTextContent) {
|
|
6026
6876
|
return toggleControl;
|
|
6027
6877
|
}
|
|
6028
|
-
return /* @__PURE__ */
|
|
6878
|
+
return /* @__PURE__ */ jsxs26(
|
|
6029
6879
|
"div",
|
|
6030
6880
|
{
|
|
6031
6881
|
"data-slot": "toggle-container",
|
|
@@ -6036,8 +6886,8 @@ var Toggle = React40.forwardRef(function Toggle2({
|
|
|
6036
6886
|
}),
|
|
6037
6887
|
children: [
|
|
6038
6888
|
toggleControl,
|
|
6039
|
-
/* @__PURE__ */
|
|
6040
|
-
label ? /* @__PURE__ */
|
|
6889
|
+
/* @__PURE__ */ jsxs26("span", { className: selectionControlContentBaseClasses, children: [
|
|
6890
|
+
label ? /* @__PURE__ */ jsx50("label", { htmlFor: resolvedId, className: selectionControlLabelTextBaseClasses, children: /* @__PURE__ */ jsx50(
|
|
6041
6891
|
"span",
|
|
6042
6892
|
{
|
|
6043
6893
|
id: labelId,
|
|
@@ -6049,7 +6899,7 @@ var Toggle = React40.forwardRef(function Toggle2({
|
|
|
6049
6899
|
})
|
|
6050
6900
|
}
|
|
6051
6901
|
) }) : null,
|
|
6052
|
-
description ? /* @__PURE__ */
|
|
6902
|
+
description ? /* @__PURE__ */ jsx50(
|
|
6053
6903
|
"span",
|
|
6054
6904
|
{
|
|
6055
6905
|
id: descriptionId,
|
|
@@ -6071,45 +6921,14 @@ var Toggle = React40.forwardRef(function Toggle2({
|
|
|
6071
6921
|
});
|
|
6072
6922
|
Toggle.displayName = "Toggle";
|
|
6073
6923
|
|
|
6074
|
-
// src/components/tooltip.tsx
|
|
6075
|
-
import * as React41 from "react";
|
|
6076
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
6077
|
-
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
6078
|
-
var TooltipProvider = TooltipPrimitive.Provider;
|
|
6079
|
-
var Tooltip = TooltipPrimitive.Root;
|
|
6080
|
-
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
6081
|
-
var TooltipContent = React41.forwardRef(function TooltipContent2({ className, sideOffset = 8, ...props }, ref) {
|
|
6082
|
-
return /* @__PURE__ */ jsx43(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx43(
|
|
6083
|
-
TooltipPrimitive.Content,
|
|
6084
|
-
{
|
|
6085
|
-
ref,
|
|
6086
|
-
sideOffset,
|
|
6087
|
-
className: cn(
|
|
6088
|
-
"sofya-tooltip-content z-50 max-w-[260px] overflow-hidden rounded-[12px] border border-[color:var(--sofya-tone-default-border)] bg-[color:var(--sofya-tooltip-background)] px-4 py-2 text-[color:var(--sofya-tooltip-foreground)] shadow-[var(--sofya-shadow-tooltip)]",
|
|
6089
|
-
className
|
|
6090
|
-
),
|
|
6091
|
-
...props,
|
|
6092
|
-
children: renderTextContent(props.children, {
|
|
6093
|
-
as: "span",
|
|
6094
|
-
className: "block text-[color:var(--sofya-tooltip-foreground)]",
|
|
6095
|
-
size: "tiny",
|
|
6096
|
-
style: {
|
|
6097
|
-
fontWeight: 500
|
|
6098
|
-
}
|
|
6099
|
-
})
|
|
6100
|
-
}
|
|
6101
|
-
) });
|
|
6102
|
-
});
|
|
6103
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
6104
|
-
|
|
6105
6924
|
// src/theme/provider.tsx
|
|
6106
|
-
import * as
|
|
6925
|
+
import * as React49 from "react";
|
|
6107
6926
|
import {
|
|
6108
6927
|
createWhitelabelTheme,
|
|
6109
6928
|
defaultTheme,
|
|
6110
6929
|
themeToCssVariables
|
|
6111
6930
|
} from "@sofya-ds/tokens";
|
|
6112
|
-
import { jsx as
|
|
6931
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
6113
6932
|
var SOFYA_FONT_LINKS = [
|
|
6114
6933
|
{
|
|
6115
6934
|
id: "preconnect-googleapis",
|
|
@@ -6129,7 +6948,7 @@ var SOFYA_FONT_LINKS = [
|
|
|
6129
6948
|
}
|
|
6130
6949
|
];
|
|
6131
6950
|
function useSofyaFontLinks() {
|
|
6132
|
-
|
|
6951
|
+
React49.useEffect(() => {
|
|
6133
6952
|
if (typeof document === "undefined") {
|
|
6134
6953
|
return;
|
|
6135
6954
|
}
|
|
@@ -6162,7 +6981,7 @@ function SofyaProvider({
|
|
|
6162
6981
|
useSofyaFontLinks();
|
|
6163
6982
|
const theme = createWhitelabelTheme(overrides ?? {}, preset);
|
|
6164
6983
|
const cssVariables = themeToCssVariables(theme);
|
|
6165
|
-
return /* @__PURE__ */
|
|
6984
|
+
return /* @__PURE__ */ jsx51(
|
|
6166
6985
|
"div",
|
|
6167
6986
|
{
|
|
6168
6987
|
"data-sofya-theme": theme.name,
|
|
@@ -6216,6 +7035,7 @@ export {
|
|
|
6216
7035
|
CardHeader,
|
|
6217
7036
|
CardTitle,
|
|
6218
7037
|
Checkbox,
|
|
7038
|
+
CloseButton,
|
|
6219
7039
|
Cluster,
|
|
6220
7040
|
Container,
|
|
6221
7041
|
Dialog,
|
|
@@ -6240,6 +7060,7 @@ export {
|
|
|
6240
7060
|
EmptyMedia,
|
|
6241
7061
|
EmptyTitle,
|
|
6242
7062
|
Icon,
|
|
7063
|
+
IconButton,
|
|
6243
7064
|
Inline,
|
|
6244
7065
|
Input,
|
|
6245
7066
|
InputOTP,
|
|
@@ -6259,11 +7080,13 @@ export {
|
|
|
6259
7080
|
Popover,
|
|
6260
7081
|
PopoverAnchor,
|
|
6261
7082
|
PopoverClose,
|
|
7083
|
+
PopoverCloseButton,
|
|
6262
7084
|
PopoverContent,
|
|
6263
7085
|
PopoverDescription,
|
|
6264
7086
|
PopoverPortal,
|
|
6265
7087
|
PopoverTitle,
|
|
6266
7088
|
PopoverTrigger,
|
|
7089
|
+
PrivacyLabel,
|
|
6267
7090
|
Progress,
|
|
6268
7091
|
ProseDialogBody,
|
|
6269
7092
|
ProseDialogContent,
|
|
@@ -6278,6 +7101,10 @@ export {
|
|
|
6278
7101
|
RadioGroupOptionDescription,
|
|
6279
7102
|
RadioGroupOptionIndicator,
|
|
6280
7103
|
RadioGroupOptionLabel,
|
|
7104
|
+
RichTextToolbar,
|
|
7105
|
+
RichTextToolbarButton,
|
|
7106
|
+
RichTextToolbarGroup,
|
|
7107
|
+
RichTextToolbarSeparator,
|
|
6281
7108
|
RightRailAction,
|
|
6282
7109
|
ScrollArea,
|
|
6283
7110
|
ScrollAreaCorner,
|
|
@@ -6294,11 +7121,15 @@ export {
|
|
|
6294
7121
|
SelectTrigger,
|
|
6295
7122
|
SelectValue,
|
|
6296
7123
|
Separator2 as Separator,
|
|
7124
|
+
SettingsNavItem,
|
|
7125
|
+
SidebarNavItem,
|
|
6297
7126
|
Skeleton,
|
|
6298
7127
|
Slider,
|
|
6299
7128
|
SofyaProvider,
|
|
6300
7129
|
Spinner,
|
|
6301
7130
|
Stack,
|
|
7131
|
+
StatusIndicator,
|
|
7132
|
+
StatusTooltip,
|
|
6302
7133
|
Surface,
|
|
6303
7134
|
Switch,
|
|
6304
7135
|
Table,
|
|
@@ -6315,6 +7146,9 @@ export {
|
|
|
6315
7146
|
TableRow,
|
|
6316
7147
|
TableStatusBadge,
|
|
6317
7148
|
Tabs,
|
|
7149
|
+
Tag,
|
|
7150
|
+
TemplateCard,
|
|
7151
|
+
TemplateListItem,
|
|
6318
7152
|
Text,
|
|
6319
7153
|
Textarea,
|
|
6320
7154
|
Toaster,
|
|
@@ -6349,6 +7183,8 @@ export {
|
|
|
6349
7183
|
emptyMediaVariantOptions,
|
|
6350
7184
|
gradientToCss,
|
|
6351
7185
|
hexToHslChannels,
|
|
7186
|
+
iconButtonSizeOptions,
|
|
7187
|
+
iconButtonVariantOptions,
|
|
6352
7188
|
iconColorOptions,
|
|
6353
7189
|
iconNames,
|
|
6354
7190
|
iconSizeMap,
|
|
@@ -6359,7 +7195,9 @@ export {
|
|
|
6359
7195
|
logoVariants,
|
|
6360
7196
|
mergeTheme,
|
|
6361
7197
|
notificationVariantOptions,
|
|
7198
|
+
notify,
|
|
6362
7199
|
paginationLinkVariants,
|
|
7200
|
+
privacyLevelOptions,
|
|
6363
7201
|
progressSizeOptions,
|
|
6364
7202
|
radioGroupOrientationOptions,
|
|
6365
7203
|
radioGroupVariantOptions,
|
|
@@ -6367,6 +7205,7 @@ export {
|
|
|
6367
7205
|
resolveSurfaceToken,
|
|
6368
7206
|
resolveTextStyle,
|
|
6369
7207
|
resolveTheme,
|
|
7208
|
+
resolveWorkflowStatus,
|
|
6370
7209
|
scrollAreaOrientationOptions,
|
|
6371
7210
|
selectSizeOptions,
|
|
6372
7211
|
sofyaBrandPalette,
|
|
@@ -6385,12 +7224,20 @@ export {
|
|
|
6385
7224
|
tableCellVariantOptions,
|
|
6386
7225
|
tableDensityOptions,
|
|
6387
7226
|
tableStatusToneOptions,
|
|
7227
|
+
tagStatusToneOptions,
|
|
7228
|
+
tagVariantOptions,
|
|
7229
|
+
templateCardFavoriteDisplayOptions,
|
|
7230
|
+
templateCardLayoutOptions,
|
|
7231
|
+
templateCardMetaPlacementOptions,
|
|
6388
7232
|
textSizeOptions,
|
|
6389
7233
|
textSplitTypeOptions,
|
|
7234
|
+
textToneOptions,
|
|
6390
7235
|
textVariantOptions,
|
|
6391
7236
|
themePresetNames,
|
|
6392
7237
|
themePresets,
|
|
6393
7238
|
themeToCssVariables2 as themeToCssVariables,
|
|
6394
7239
|
toast,
|
|
6395
|
-
|
|
7240
|
+
tooltipToneOptions,
|
|
7241
|
+
uploadKindOptions,
|
|
7242
|
+
workflowStatusOptions
|
|
6396
7243
|
};
|