@sofya-ds/react 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +257 -78
- package/dist/index.css +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +257 -79
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3860,11 +3860,188 @@ var Separator2 = React22.forwardRef(function Separator3({ className, decorative
|
|
|
3860
3860
|
});
|
|
3861
3861
|
Separator2.displayName = SeparatorPrimitive.Root.displayName;
|
|
3862
3862
|
|
|
3863
|
-
// src/components/
|
|
3863
|
+
// src/components/slider.tsx
|
|
3864
3864
|
import * as React23 from "react";
|
|
3865
|
-
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3866
|
-
|
|
3867
|
-
|
|
3865
|
+
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3866
|
+
function clampSliderValue(value, min, max) {
|
|
3867
|
+
if (Number.isNaN(value)) {
|
|
3868
|
+
return min;
|
|
3869
|
+
}
|
|
3870
|
+
return Math.min(Math.max(value, min), max);
|
|
3871
|
+
}
|
|
3872
|
+
function resolveSliderMax(min, max) {
|
|
3873
|
+
if (typeof max === "number" && max > min) {
|
|
3874
|
+
return max;
|
|
3875
|
+
}
|
|
3876
|
+
return min + 100;
|
|
3877
|
+
}
|
|
3878
|
+
function isTextValue(value) {
|
|
3879
|
+
return typeof value === "string" || typeof value === "number";
|
|
3880
|
+
}
|
|
3881
|
+
var Slider = React23.forwardRef(function Slider2({
|
|
3882
|
+
className,
|
|
3883
|
+
defaultValue,
|
|
3884
|
+
formatValue,
|
|
3885
|
+
id,
|
|
3886
|
+
label,
|
|
3887
|
+
labelClassName,
|
|
3888
|
+
max,
|
|
3889
|
+
min = 0,
|
|
3890
|
+
onChange,
|
|
3891
|
+
onValueChange,
|
|
3892
|
+
rangeClassName,
|
|
3893
|
+
sliderClassName,
|
|
3894
|
+
showValue = true,
|
|
3895
|
+
step = 1,
|
|
3896
|
+
thumbClassName,
|
|
3897
|
+
trackClassName,
|
|
3898
|
+
value,
|
|
3899
|
+
valueClassName,
|
|
3900
|
+
...props
|
|
3901
|
+
}, ref) {
|
|
3902
|
+
const resolvedId = React23.useId();
|
|
3903
|
+
const inputId = id ?? resolvedId;
|
|
3904
|
+
const safeMin = min;
|
|
3905
|
+
const safeMax = resolveSliderMax(safeMin, max);
|
|
3906
|
+
const isControlled = value !== void 0;
|
|
3907
|
+
const [internalValue, setInternalValue] = React23.useState(
|
|
3908
|
+
() => clampSliderValue(defaultValue ?? safeMin, safeMin, safeMax)
|
|
3909
|
+
);
|
|
3910
|
+
React23.useEffect(() => {
|
|
3911
|
+
if (isControlled) {
|
|
3912
|
+
return;
|
|
3913
|
+
}
|
|
3914
|
+
setInternalValue(
|
|
3915
|
+
(currentValue2) => clampSliderValue(currentValue2, safeMin, safeMax)
|
|
3916
|
+
);
|
|
3917
|
+
}, [isControlled, safeMax, safeMin]);
|
|
3918
|
+
const currentValue = isControlled ? clampSliderValue(value ?? safeMin, safeMin, safeMax) : internalValue;
|
|
3919
|
+
const valuePercentage = safeMax === safeMin ? 0 : (currentValue - safeMin) / (safeMax - safeMin) * 100;
|
|
3920
|
+
const formattedValue = formatValue?.(currentValue) ?? currentValue.toString();
|
|
3921
|
+
const formattedValueText = isTextValue(formattedValue) ? String(formattedValue) : void 0;
|
|
3922
|
+
const handleChange = (event) => {
|
|
3923
|
+
const nextValue = clampSliderValue(
|
|
3924
|
+
Number(event.currentTarget.value),
|
|
3925
|
+
safeMin,
|
|
3926
|
+
safeMax
|
|
3927
|
+
);
|
|
3928
|
+
if (!isControlled) {
|
|
3929
|
+
setInternalValue(nextValue);
|
|
3930
|
+
}
|
|
3931
|
+
onChange?.(event);
|
|
3932
|
+
onValueChange?.(nextValue);
|
|
3933
|
+
};
|
|
3934
|
+
return /* @__PURE__ */ jsxs15(
|
|
3935
|
+
"div",
|
|
3936
|
+
{
|
|
3937
|
+
"data-slot": "slider",
|
|
3938
|
+
className: cn("grid w-full gap-2", className),
|
|
3939
|
+
children: [
|
|
3940
|
+
label || showValue ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between gap-4", children: [
|
|
3941
|
+
label ? /* @__PURE__ */ jsx26(
|
|
3942
|
+
"label",
|
|
3943
|
+
{
|
|
3944
|
+
htmlFor: inputId,
|
|
3945
|
+
className: cn(
|
|
3946
|
+
"min-w-0 text-[color:var(--sofya-text-default)]",
|
|
3947
|
+
labelClassName
|
|
3948
|
+
),
|
|
3949
|
+
children: renderTextContent(label, {
|
|
3950
|
+
as: "span",
|
|
3951
|
+
className: "block text-[color:var(--sofya-text-default)]",
|
|
3952
|
+
size: "body",
|
|
3953
|
+
style: {
|
|
3954
|
+
fontWeight: 500
|
|
3955
|
+
}
|
|
3956
|
+
})
|
|
3957
|
+
}
|
|
3958
|
+
) : /* @__PURE__ */ jsx26("span", {}),
|
|
3959
|
+
showValue ? /* @__PURE__ */ jsx26(
|
|
3960
|
+
"div",
|
|
3961
|
+
{
|
|
3962
|
+
className: cn(
|
|
3963
|
+
"shrink-0 text-[color:var(--sofya-text-subtle)]",
|
|
3964
|
+
valueClassName
|
|
3965
|
+
),
|
|
3966
|
+
children: renderTextContent(formattedValue, {
|
|
3967
|
+
as: "span",
|
|
3968
|
+
className: "block text-[color:var(--sofya-text-subtle)]",
|
|
3969
|
+
size: "body",
|
|
3970
|
+
style: {
|
|
3971
|
+
fontWeight: 500
|
|
3972
|
+
}
|
|
3973
|
+
})
|
|
3974
|
+
}
|
|
3975
|
+
) : null
|
|
3976
|
+
] }) : null,
|
|
3977
|
+
/* @__PURE__ */ jsxs15(
|
|
3978
|
+
"div",
|
|
3979
|
+
{
|
|
3980
|
+
"data-slot": "slider-control",
|
|
3981
|
+
className: cn("relative h-8 w-full", sliderClassName),
|
|
3982
|
+
children: [
|
|
3983
|
+
/* @__PURE__ */ jsx26(
|
|
3984
|
+
"input",
|
|
3985
|
+
{
|
|
3986
|
+
...props,
|
|
3987
|
+
ref,
|
|
3988
|
+
id: inputId,
|
|
3989
|
+
type: "range",
|
|
3990
|
+
min: safeMin,
|
|
3991
|
+
max: safeMax,
|
|
3992
|
+
step,
|
|
3993
|
+
value: currentValue,
|
|
3994
|
+
"aria-valuetext": props["aria-valuetext"] ?? formattedValueText,
|
|
3995
|
+
className: "peer absolute inset-0 z-20 m-0 h-full w-full cursor-pointer appearance-none bg-transparent opacity-0 disabled:cursor-not-allowed",
|
|
3996
|
+
onChange: handleChange
|
|
3997
|
+
}
|
|
3998
|
+
),
|
|
3999
|
+
/* @__PURE__ */ jsx26(
|
|
4000
|
+
"div",
|
|
4001
|
+
{
|
|
4002
|
+
"data-slot": "slider-track",
|
|
4003
|
+
className: cn(
|
|
4004
|
+
"pointer-events-none absolute left-0 top-1/2 h-2 w-full -translate-y-1/2 rounded-full bg-[color:var(--sofya-surface-muted-strong)] transition-colors duration-sofya ease-sofya peer-disabled:opacity-60",
|
|
4005
|
+
trackClassName
|
|
4006
|
+
)
|
|
4007
|
+
}
|
|
4008
|
+
),
|
|
4009
|
+
/* @__PURE__ */ jsx26(
|
|
4010
|
+
"div",
|
|
4011
|
+
{
|
|
4012
|
+
"data-slot": "slider-range",
|
|
4013
|
+
className: cn(
|
|
4014
|
+
"pointer-events-none absolute left-0 top-1/2 h-2 -translate-y-1/2 rounded-full bg-primary transition-[width,background-color] duration-sofya ease-sofya peer-disabled:opacity-60",
|
|
4015
|
+
rangeClassName
|
|
4016
|
+
),
|
|
4017
|
+
style: { width: `${valuePercentage}%` }
|
|
4018
|
+
}
|
|
4019
|
+
),
|
|
4020
|
+
/* @__PURE__ */ jsx26(
|
|
4021
|
+
"div",
|
|
4022
|
+
{
|
|
4023
|
+
"data-slot": "slider-thumb",
|
|
4024
|
+
className: cn(
|
|
4025
|
+
"pointer-events-none absolute top-1/2 z-10 h-5 w-5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-primary bg-background shadow-[var(--sofya-shadow-soft)] transition-[left,transform,background-color,border-color,box-shadow] duration-sofya ease-sofya peer-focus-visible:ring-4 peer-focus-visible:ring-[color:var(--sofya-focus-ring-soft)] peer-disabled:opacity-60",
|
|
4026
|
+
thumbClassName
|
|
4027
|
+
),
|
|
4028
|
+
style: { left: `${valuePercentage}%` }
|
|
4029
|
+
}
|
|
4030
|
+
)
|
|
4031
|
+
]
|
|
4032
|
+
}
|
|
4033
|
+
)
|
|
4034
|
+
]
|
|
4035
|
+
}
|
|
4036
|
+
);
|
|
4037
|
+
});
|
|
4038
|
+
Slider.displayName = "Slider";
|
|
4039
|
+
|
|
4040
|
+
// src/components/skeleton.tsx
|
|
4041
|
+
import * as React24 from "react";
|
|
4042
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
4043
|
+
var Skeleton = React24.forwardRef(function Skeleton2({ className, ...props }, ref) {
|
|
4044
|
+
return /* @__PURE__ */ jsx27(
|
|
3868
4045
|
"div",
|
|
3869
4046
|
{
|
|
3870
4047
|
ref,
|
|
@@ -3879,18 +4056,18 @@ var Skeleton = React23.forwardRef(function Skeleton2({ className, ...props }, re
|
|
|
3879
4056
|
Skeleton.displayName = "Skeleton";
|
|
3880
4057
|
|
|
3881
4058
|
// src/components/sonner.tsx
|
|
3882
|
-
import * as
|
|
4059
|
+
import * as React25 from "react";
|
|
3883
4060
|
import {
|
|
3884
4061
|
Toaster as SonnerToaster,
|
|
3885
4062
|
toast
|
|
3886
4063
|
} from "sonner";
|
|
3887
|
-
import { jsx as
|
|
4064
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
3888
4065
|
var notificationVariantOptions = ["default", "success", "error", "warning"];
|
|
3889
4066
|
function ToastStatusIcon({
|
|
3890
4067
|
iconName,
|
|
3891
4068
|
className
|
|
3892
4069
|
}) {
|
|
3893
|
-
return /* @__PURE__ */
|
|
4070
|
+
return /* @__PURE__ */ jsx28(
|
|
3894
4071
|
"span",
|
|
3895
4072
|
{
|
|
3896
4073
|
"aria-hidden": "true",
|
|
@@ -3898,7 +4075,7 @@ function ToastStatusIcon({
|
|
|
3898
4075
|
"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border shadow-sofya-sm",
|
|
3899
4076
|
className
|
|
3900
4077
|
),
|
|
3901
|
-
children: /* @__PURE__ */
|
|
4078
|
+
children: /* @__PURE__ */ jsx28(Icon, { name: iconName, size: 16 })
|
|
3902
4079
|
}
|
|
3903
4080
|
);
|
|
3904
4081
|
}
|
|
@@ -3919,35 +4096,35 @@ var defaultToastClassNames = {
|
|
|
3919
4096
|
loading: "border-border bg-card text-foreground"
|
|
3920
4097
|
};
|
|
3921
4098
|
var defaultToastIcons = {
|
|
3922
|
-
success: /* @__PURE__ */
|
|
4099
|
+
success: /* @__PURE__ */ jsx28(
|
|
3923
4100
|
ToastStatusIcon,
|
|
3924
4101
|
{
|
|
3925
4102
|
iconName: "check",
|
|
3926
4103
|
className: "border-success/15 bg-success/12 text-success"
|
|
3927
4104
|
}
|
|
3928
4105
|
),
|
|
3929
|
-
error: /* @__PURE__ */
|
|
4106
|
+
error: /* @__PURE__ */ jsx28(
|
|
3930
4107
|
ToastStatusIcon,
|
|
3931
4108
|
{
|
|
3932
4109
|
iconName: "x",
|
|
3933
4110
|
className: "border-destructive/15 bg-destructive/12 text-destructive"
|
|
3934
4111
|
}
|
|
3935
4112
|
),
|
|
3936
|
-
warning: /* @__PURE__ */
|
|
4113
|
+
warning: /* @__PURE__ */ jsx28(
|
|
3937
4114
|
ToastStatusIcon,
|
|
3938
4115
|
{
|
|
3939
4116
|
iconName: "question",
|
|
3940
4117
|
className: "border-warning/20 bg-warning/15 text-foreground"
|
|
3941
4118
|
}
|
|
3942
4119
|
),
|
|
3943
|
-
info: /* @__PURE__ */
|
|
4120
|
+
info: /* @__PURE__ */ jsx28(
|
|
3944
4121
|
ToastStatusIcon,
|
|
3945
4122
|
{
|
|
3946
4123
|
iconName: "question",
|
|
3947
4124
|
className: "border-primary/15 bg-primary/10 text-primary"
|
|
3948
4125
|
}
|
|
3949
4126
|
),
|
|
3950
|
-
close: /* @__PURE__ */
|
|
4127
|
+
close: /* @__PURE__ */ jsx28(Icon, { name: "x", size: 12 })
|
|
3951
4128
|
};
|
|
3952
4129
|
function mergeToastClassNames(overrides) {
|
|
3953
4130
|
return {
|
|
@@ -3955,7 +4132,7 @@ function mergeToastClassNames(overrides) {
|
|
|
3955
4132
|
...overrides
|
|
3956
4133
|
};
|
|
3957
4134
|
}
|
|
3958
|
-
var Toaster =
|
|
4135
|
+
var Toaster = React25.forwardRef(
|
|
3959
4136
|
function Toaster2({
|
|
3960
4137
|
className,
|
|
3961
4138
|
closeButton = true,
|
|
@@ -3967,7 +4144,7 @@ var Toaster = React24.forwardRef(
|
|
|
3967
4144
|
visibleToasts = 5,
|
|
3968
4145
|
...props
|
|
3969
4146
|
}, ref) {
|
|
3970
|
-
return /* @__PURE__ */
|
|
4147
|
+
return /* @__PURE__ */ jsx28(
|
|
3971
4148
|
SonnerToaster,
|
|
3972
4149
|
{
|
|
3973
4150
|
ref,
|
|
@@ -3997,10 +4174,10 @@ var Toaster = React24.forwardRef(
|
|
|
3997
4174
|
Toaster.displayName = "Toaster";
|
|
3998
4175
|
|
|
3999
4176
|
// src/components/spinner.tsx
|
|
4000
|
-
import * as
|
|
4001
|
-
import { jsx as
|
|
4177
|
+
import * as React26 from "react";
|
|
4178
|
+
import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4002
4179
|
var spinnerSizeOptions = ["sm", "default", "lg"];
|
|
4003
|
-
var Spinner =
|
|
4180
|
+
var Spinner = React26.forwardRef(function Spinner2({
|
|
4004
4181
|
"aria-label": ariaLabelProp,
|
|
4005
4182
|
"aria-labelledby": ariaLabelledby,
|
|
4006
4183
|
className,
|
|
@@ -4009,7 +4186,7 @@ var Spinner = React25.forwardRef(function Spinner2({
|
|
|
4009
4186
|
...props
|
|
4010
4187
|
}, ref) {
|
|
4011
4188
|
const ariaLabel = ariaLabelProp ?? (ariaLabelledby ? void 0 : "Loading");
|
|
4012
|
-
return /* @__PURE__ */
|
|
4189
|
+
return /* @__PURE__ */ jsxs16(
|
|
4013
4190
|
"svg",
|
|
4014
4191
|
{
|
|
4015
4192
|
ref,
|
|
@@ -4027,8 +4204,8 @@ var Spinner = React25.forwardRef(function Spinner2({
|
|
|
4027
4204
|
),
|
|
4028
4205
|
...props,
|
|
4029
4206
|
children: [
|
|
4030
|
-
/* @__PURE__ */
|
|
4031
|
-
/* @__PURE__ */
|
|
4207
|
+
/* @__PURE__ */ jsx29("circle", { cx: "12", cy: "12", r: "9", className: "opacity-20", stroke: "currentColor", strokeWidth: "3" }),
|
|
4208
|
+
/* @__PURE__ */ jsx29(
|
|
4032
4209
|
"path",
|
|
4033
4210
|
{
|
|
4034
4211
|
d: "M21 12A9 9 0 0 0 12 3",
|
|
@@ -4044,11 +4221,11 @@ var Spinner = React25.forwardRef(function Spinner2({
|
|
|
4044
4221
|
Spinner.displayName = "Spinner";
|
|
4045
4222
|
|
|
4046
4223
|
// src/components/switch.tsx
|
|
4047
|
-
import * as
|
|
4224
|
+
import * as React27 from "react";
|
|
4048
4225
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
4049
|
-
import { jsx as
|
|
4050
|
-
var Switch =
|
|
4051
|
-
return /* @__PURE__ */
|
|
4226
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
4227
|
+
var Switch = React27.forwardRef(({ className, ...props }, ref) => {
|
|
4228
|
+
return /* @__PURE__ */ jsx30(
|
|
4052
4229
|
SwitchPrimitives.Root,
|
|
4053
4230
|
{
|
|
4054
4231
|
className: cn(
|
|
@@ -4057,7 +4234,7 @@ var Switch = React26.forwardRef(({ className, ...props }, ref) => {
|
|
|
4057
4234
|
),
|
|
4058
4235
|
...props,
|
|
4059
4236
|
ref,
|
|
4060
|
-
children: /* @__PURE__ */
|
|
4237
|
+
children: /* @__PURE__ */ jsx30(
|
|
4061
4238
|
SwitchPrimitives.Thumb,
|
|
4062
4239
|
{
|
|
4063
4240
|
className: "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-sm ring-0 transition-transform duration-sofya ease-sofya data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
@@ -4070,8 +4247,8 @@ Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
|
4070
4247
|
|
|
4071
4248
|
// src/components/table.tsx
|
|
4072
4249
|
import { cva as cva8 } from "class-variance-authority";
|
|
4073
|
-
import * as
|
|
4074
|
-
import { jsx as
|
|
4250
|
+
import * as React28 from "react";
|
|
4251
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
4075
4252
|
var tableCellVariantOptions = ["default", "primary", "muted"];
|
|
4076
4253
|
var tableStatusToneOptions = [
|
|
4077
4254
|
"active",
|
|
@@ -4129,13 +4306,13 @@ var inheritedTextStyle = {
|
|
|
4129
4306
|
letterSpacing: "inherit",
|
|
4130
4307
|
color: "inherit"
|
|
4131
4308
|
};
|
|
4132
|
-
var Table =
|
|
4133
|
-
return /* @__PURE__ */
|
|
4309
|
+
var Table = React28.forwardRef(function Table2({ className, ...props }, ref) {
|
|
4310
|
+
return /* @__PURE__ */ jsx31(
|
|
4134
4311
|
"div",
|
|
4135
4312
|
{
|
|
4136
4313
|
"data-slot": "table-container",
|
|
4137
4314
|
className: "relative w-full overflow-x-auto",
|
|
4138
|
-
children: /* @__PURE__ */
|
|
4315
|
+
children: /* @__PURE__ */ jsx31(
|
|
4139
4316
|
"table",
|
|
4140
4317
|
{
|
|
4141
4318
|
"data-slot": "table",
|
|
@@ -4150,8 +4327,8 @@ var Table = React27.forwardRef(function Table2({ className, ...props }, ref) {
|
|
|
4150
4327
|
}
|
|
4151
4328
|
);
|
|
4152
4329
|
});
|
|
4153
|
-
var TableHeader =
|
|
4154
|
-
return /* @__PURE__ */
|
|
4330
|
+
var TableHeader = React28.forwardRef(function TableHeader2({ className, ...props }, ref) {
|
|
4331
|
+
return /* @__PURE__ */ jsx31(
|
|
4155
4332
|
"thead",
|
|
4156
4333
|
{
|
|
4157
4334
|
"data-slot": "table-header",
|
|
@@ -4164,8 +4341,8 @@ var TableHeader = React27.forwardRef(function TableHeader2({ className, ...props
|
|
|
4164
4341
|
}
|
|
4165
4342
|
);
|
|
4166
4343
|
});
|
|
4167
|
-
var TableBody =
|
|
4168
|
-
return /* @__PURE__ */
|
|
4344
|
+
var TableBody = React28.forwardRef(function TableBody2({ className, ...props }, ref) {
|
|
4345
|
+
return /* @__PURE__ */ jsx31(
|
|
4169
4346
|
"tbody",
|
|
4170
4347
|
{
|
|
4171
4348
|
"data-slot": "table-body",
|
|
@@ -4175,8 +4352,8 @@ var TableBody = React27.forwardRef(function TableBody2({ className, ...props },
|
|
|
4175
4352
|
}
|
|
4176
4353
|
);
|
|
4177
4354
|
});
|
|
4178
|
-
var TableFooter =
|
|
4179
|
-
return /* @__PURE__ */
|
|
4355
|
+
var TableFooter = React28.forwardRef(function TableFooter2({ className, ...props }, ref) {
|
|
4356
|
+
return /* @__PURE__ */ jsx31(
|
|
4180
4357
|
"tfoot",
|
|
4181
4358
|
{
|
|
4182
4359
|
"data-slot": "table-footer",
|
|
@@ -4189,8 +4366,8 @@ var TableFooter = React27.forwardRef(function TableFooter2({ className, ...props
|
|
|
4189
4366
|
}
|
|
4190
4367
|
);
|
|
4191
4368
|
});
|
|
4192
|
-
var TableRow =
|
|
4193
|
-
return /* @__PURE__ */
|
|
4369
|
+
var TableRow = React28.forwardRef(function TableRow2({ className, ...props }, ref) {
|
|
4370
|
+
return /* @__PURE__ */ jsx31(
|
|
4194
4371
|
"tr",
|
|
4195
4372
|
{
|
|
4196
4373
|
"data-slot": "table-row",
|
|
@@ -4203,8 +4380,8 @@ var TableRow = React27.forwardRef(function TableRow2({ className, ...props }, re
|
|
|
4203
4380
|
}
|
|
4204
4381
|
);
|
|
4205
4382
|
});
|
|
4206
|
-
var TableHead =
|
|
4207
|
-
return /* @__PURE__ */
|
|
4383
|
+
var TableHead = React28.forwardRef(function TableHead2({ className, children, ...props }, ref) {
|
|
4384
|
+
return /* @__PURE__ */ jsx31(
|
|
4208
4385
|
"th",
|
|
4209
4386
|
{
|
|
4210
4387
|
"data-slot": "table-head",
|
|
@@ -4223,9 +4400,9 @@ var TableHead = React27.forwardRef(function TableHead2({ className, children, ..
|
|
|
4223
4400
|
}
|
|
4224
4401
|
);
|
|
4225
4402
|
});
|
|
4226
|
-
var TableCell =
|
|
4403
|
+
var TableCell = React28.forwardRef(
|
|
4227
4404
|
function TableCell2({ className, variant, children, ...props }, ref) {
|
|
4228
|
-
return /* @__PURE__ */
|
|
4405
|
+
return /* @__PURE__ */ jsx31(
|
|
4229
4406
|
"td",
|
|
4230
4407
|
{
|
|
4231
4408
|
"data-slot": "table-cell",
|
|
@@ -4242,8 +4419,8 @@ var TableCell = React27.forwardRef(
|
|
|
4242
4419
|
);
|
|
4243
4420
|
}
|
|
4244
4421
|
);
|
|
4245
|
-
var TableCaption =
|
|
4246
|
-
return /* @__PURE__ */
|
|
4422
|
+
var TableCaption = React28.forwardRef(function TableCaption2({ className, children, ...props }, ref) {
|
|
4423
|
+
return /* @__PURE__ */ jsx31(
|
|
4247
4424
|
"caption",
|
|
4248
4425
|
{
|
|
4249
4426
|
"data-slot": "table-caption",
|
|
@@ -4268,7 +4445,7 @@ function TableStatusBadge({
|
|
|
4268
4445
|
children,
|
|
4269
4446
|
...props
|
|
4270
4447
|
}) {
|
|
4271
|
-
return /* @__PURE__ */
|
|
4448
|
+
return /* @__PURE__ */ jsx31(
|
|
4272
4449
|
Badge,
|
|
4273
4450
|
{
|
|
4274
4451
|
variant: "pill",
|
|
@@ -4283,8 +4460,8 @@ function TableStatusBadge({
|
|
|
4283
4460
|
}
|
|
4284
4461
|
);
|
|
4285
4462
|
}
|
|
4286
|
-
var TableActionButton =
|
|
4287
|
-
return /* @__PURE__ */
|
|
4463
|
+
var TableActionButton = React28.forwardRef(function TableActionButton2({ className, tone, type = "button", children, ...props }, ref) {
|
|
4464
|
+
return /* @__PURE__ */ jsx31(
|
|
4288
4465
|
Button,
|
|
4289
4466
|
{
|
|
4290
4467
|
ref,
|
|
@@ -4302,8 +4479,8 @@ var TableActionButton = React27.forwardRef(function TableActionButton2({ classNa
|
|
|
4302
4479
|
}
|
|
4303
4480
|
);
|
|
4304
4481
|
});
|
|
4305
|
-
var TableActions =
|
|
4306
|
-
return /* @__PURE__ */
|
|
4482
|
+
var TableActions = React28.forwardRef(function TableActions2({ className, ...props }, ref) {
|
|
4483
|
+
return /* @__PURE__ */ jsx31(
|
|
4307
4484
|
"div",
|
|
4308
4485
|
{
|
|
4309
4486
|
ref,
|
|
@@ -4324,10 +4501,10 @@ TableActionButton.displayName = "TableActionButton";
|
|
|
4324
4501
|
TableActions.displayName = "TableActions";
|
|
4325
4502
|
|
|
4326
4503
|
// src/components/tabs.tsx
|
|
4327
|
-
import * as
|
|
4504
|
+
import * as React29 from "react";
|
|
4328
4505
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
4329
4506
|
import { motion as motion3 } from "motion/react";
|
|
4330
|
-
import { jsx as
|
|
4507
|
+
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4331
4508
|
function resolveDefaultValue(items, defaultValue) {
|
|
4332
4509
|
if (defaultValue) {
|
|
4333
4510
|
return defaultValue;
|
|
@@ -4347,15 +4524,15 @@ function Tabs({
|
|
|
4347
4524
|
}) {
|
|
4348
4525
|
const resolvedDefaultValue = resolveDefaultValue(items, defaultValue);
|
|
4349
4526
|
const isControlled = value !== void 0;
|
|
4350
|
-
const [selectedValue, setSelectedValue] =
|
|
4351
|
-
const indicatorLayoutId =
|
|
4527
|
+
const [selectedValue, setSelectedValue] = React29.useState(resolvedDefaultValue);
|
|
4528
|
+
const indicatorLayoutId = React29.useId();
|
|
4352
4529
|
const currentValue = isControlled ? value : selectedValue;
|
|
4353
|
-
|
|
4530
|
+
React29.useEffect(() => {
|
|
4354
4531
|
if (!isControlled) {
|
|
4355
4532
|
setSelectedValue(resolvedDefaultValue);
|
|
4356
4533
|
}
|
|
4357
4534
|
}, [isControlled, resolvedDefaultValue]);
|
|
4358
|
-
const handleValueChange =
|
|
4535
|
+
const handleValueChange = React29.useCallback(
|
|
4359
4536
|
(nextValue) => {
|
|
4360
4537
|
if (!isControlled) {
|
|
4361
4538
|
setSelectedValue(nextValue);
|
|
@@ -4364,7 +4541,7 @@ function Tabs({
|
|
|
4364
4541
|
},
|
|
4365
4542
|
[isControlled, onValueChange]
|
|
4366
4543
|
);
|
|
4367
|
-
return /* @__PURE__ */
|
|
4544
|
+
return /* @__PURE__ */ jsxs17(
|
|
4368
4545
|
TabsPrimitive.Root,
|
|
4369
4546
|
{
|
|
4370
4547
|
className: cn("w-full", className),
|
|
@@ -4372,7 +4549,7 @@ function Tabs({
|
|
|
4372
4549
|
value: currentValue,
|
|
4373
4550
|
...props,
|
|
4374
4551
|
children: [
|
|
4375
|
-
/* @__PURE__ */
|
|
4552
|
+
/* @__PURE__ */ jsx32(
|
|
4376
4553
|
TabsPrimitive.List,
|
|
4377
4554
|
{
|
|
4378
4555
|
"aria-label": "Subtelas navegaveis",
|
|
@@ -4383,7 +4560,7 @@ function Tabs({
|
|
|
4383
4560
|
children: items.map((item) => {
|
|
4384
4561
|
const isUnavailable = item.disabled || item.loading;
|
|
4385
4562
|
const isActive = item.value === currentValue;
|
|
4386
|
-
return /* @__PURE__ */
|
|
4563
|
+
return /* @__PURE__ */ jsxs17(
|
|
4387
4564
|
TabsPrimitive.Trigger,
|
|
4388
4565
|
{
|
|
4389
4566
|
value: item.value,
|
|
@@ -4395,7 +4572,7 @@ function Tabs({
|
|
|
4395
4572
|
item.triggerClassName
|
|
4396
4573
|
),
|
|
4397
4574
|
children: [
|
|
4398
|
-
isActive ? /* @__PURE__ */
|
|
4575
|
+
isActive ? /* @__PURE__ */ jsx32(
|
|
4399
4576
|
motion3.span,
|
|
4400
4577
|
{
|
|
4401
4578
|
"aria-hidden": "true",
|
|
@@ -4405,15 +4582,15 @@ function Tabs({
|
|
|
4405
4582
|
transition: { duration: 0.25, ease: "easeInOut" }
|
|
4406
4583
|
}
|
|
4407
4584
|
) : null,
|
|
4408
|
-
/* @__PURE__ */
|
|
4409
|
-
item.loading ? /* @__PURE__ */
|
|
4585
|
+
/* @__PURE__ */ jsxs17("span", { className: "relative z-10 inline-flex items-center gap-2", children: [
|
|
4586
|
+
item.loading ? /* @__PURE__ */ jsx32(
|
|
4410
4587
|
"span",
|
|
4411
4588
|
{
|
|
4412
4589
|
"aria-hidden": "true",
|
|
4413
4590
|
className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-r-transparent"
|
|
4414
4591
|
}
|
|
4415
4592
|
) : null,
|
|
4416
|
-
/* @__PURE__ */
|
|
4593
|
+
/* @__PURE__ */ jsx32("span", { children: renderTextContent(item.label, {
|
|
4417
4594
|
as: "span",
|
|
4418
4595
|
className: "block text-inherit",
|
|
4419
4596
|
size: "h5"
|
|
@@ -4427,7 +4604,7 @@ function Tabs({
|
|
|
4427
4604
|
}
|
|
4428
4605
|
),
|
|
4429
4606
|
items.map(
|
|
4430
|
-
(item) => item.content !== void 0 ? /* @__PURE__ */
|
|
4607
|
+
(item) => item.content !== void 0 ? /* @__PURE__ */ jsx32(
|
|
4431
4608
|
TabsPrimitive.Content,
|
|
4432
4609
|
{
|
|
4433
4610
|
value: item.value,
|
|
@@ -4450,9 +4627,9 @@ function Tabs({
|
|
|
4450
4627
|
Tabs.displayName = "Tabs";
|
|
4451
4628
|
|
|
4452
4629
|
// src/components/textarea.tsx
|
|
4453
|
-
import * as
|
|
4454
|
-
import { jsx as
|
|
4455
|
-
var Textarea =
|
|
4630
|
+
import * as React30 from "react";
|
|
4631
|
+
import { jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4632
|
+
var Textarea = React30.forwardRef(
|
|
4456
4633
|
({
|
|
4457
4634
|
className,
|
|
4458
4635
|
containerClassName,
|
|
@@ -4462,10 +4639,10 @@ var Textarea = React29.forwardRef(
|
|
|
4462
4639
|
rows = 5,
|
|
4463
4640
|
...props
|
|
4464
4641
|
}, ref) => {
|
|
4465
|
-
const generatedId =
|
|
4642
|
+
const generatedId = React30.useId();
|
|
4466
4643
|
const resolvedId = id ?? generatedId;
|
|
4467
4644
|
const ariaLabel = props["aria-label"] ?? (typeof label === "string" ? label : void 0);
|
|
4468
|
-
const control = /* @__PURE__ */
|
|
4645
|
+
const control = /* @__PURE__ */ jsx33(
|
|
4469
4646
|
"textarea",
|
|
4470
4647
|
{
|
|
4471
4648
|
className: cn(
|
|
@@ -4482,8 +4659,8 @@ var Textarea = React29.forwardRef(
|
|
|
4482
4659
|
if (!label && !containerClassName) {
|
|
4483
4660
|
return control;
|
|
4484
4661
|
}
|
|
4485
|
-
return /* @__PURE__ */
|
|
4486
|
-
label ? /* @__PURE__ */
|
|
4662
|
+
return /* @__PURE__ */ jsxs18("div", { className: cn("grid w-full gap-2", containerClassName), children: [
|
|
4663
|
+
label ? /* @__PURE__ */ jsx33(
|
|
4487
4664
|
"label",
|
|
4488
4665
|
{
|
|
4489
4666
|
className: cn(
|
|
@@ -4508,14 +4685,14 @@ var Textarea = React29.forwardRef(
|
|
|
4508
4685
|
Textarea.displayName = "Textarea";
|
|
4509
4686
|
|
|
4510
4687
|
// src/components/tooltip.tsx
|
|
4511
|
-
import * as
|
|
4688
|
+
import * as React31 from "react";
|
|
4512
4689
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4513
|
-
import { jsx as
|
|
4690
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4514
4691
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
4515
4692
|
var Tooltip = TooltipPrimitive.Root;
|
|
4516
4693
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
4517
|
-
var TooltipContent =
|
|
4518
|
-
return /* @__PURE__ */
|
|
4694
|
+
var TooltipContent = React31.forwardRef(function TooltipContent2({ className, sideOffset = 8, ...props }, ref) {
|
|
4695
|
+
return /* @__PURE__ */ jsx34(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx34(
|
|
4519
4696
|
TooltipPrimitive.Content,
|
|
4520
4697
|
{
|
|
4521
4698
|
ref,
|
|
@@ -4539,13 +4716,13 @@ var TooltipContent = React30.forwardRef(function TooltipContent2({ className, si
|
|
|
4539
4716
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
4540
4717
|
|
|
4541
4718
|
// src/theme/provider.tsx
|
|
4542
|
-
import * as
|
|
4719
|
+
import * as React32 from "react";
|
|
4543
4720
|
import {
|
|
4544
4721
|
createWhitelabelTheme,
|
|
4545
4722
|
defaultTheme,
|
|
4546
4723
|
themeToCssVariables
|
|
4547
4724
|
} from "@sofya-ds/tokens";
|
|
4548
|
-
import { jsx as
|
|
4725
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4549
4726
|
var SOFYA_FONT_LINKS = [
|
|
4550
4727
|
{
|
|
4551
4728
|
id: "preconnect-googleapis",
|
|
@@ -4565,7 +4742,7 @@ var SOFYA_FONT_LINKS = [
|
|
|
4565
4742
|
}
|
|
4566
4743
|
];
|
|
4567
4744
|
function useSofyaFontLinks() {
|
|
4568
|
-
|
|
4745
|
+
React32.useEffect(() => {
|
|
4569
4746
|
if (typeof document === "undefined") {
|
|
4570
4747
|
return;
|
|
4571
4748
|
}
|
|
@@ -4598,7 +4775,7 @@ function SofyaProvider({
|
|
|
4598
4775
|
useSofyaFontLinks();
|
|
4599
4776
|
const theme = createWhitelabelTheme(overrides ?? {}, preset);
|
|
4600
4777
|
const cssVariables = themeToCssVariables(theme);
|
|
4601
|
-
return /* @__PURE__ */
|
|
4778
|
+
return /* @__PURE__ */ jsx35(
|
|
4602
4779
|
"div",
|
|
4603
4780
|
{
|
|
4604
4781
|
"data-sofya-theme": theme.name,
|
|
@@ -4710,6 +4887,7 @@ export {
|
|
|
4710
4887
|
SelectValue,
|
|
4711
4888
|
Separator2 as Separator,
|
|
4712
4889
|
Skeleton,
|
|
4890
|
+
Slider,
|
|
4713
4891
|
SofyaProvider,
|
|
4714
4892
|
Spinner,
|
|
4715
4893
|
Surface,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sofya-ds/react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Sofya React design system with official brand tokens, provider and UI components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"motion": "^12.38.0",
|
|
59
59
|
"sonner": "^2.0.7",
|
|
60
60
|
"tailwind-merge": "^3.5.0",
|
|
61
|
-
"@sofya-ds/tokens": "1.1.
|
|
61
|
+
"@sofya-ds/tokens": "1.1.8"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@testing-library/jest-dom": "^6.9.1",
|