@proyecto-viviana/ui 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +18 -378
- package/dist/index.js.map +7 -1
- package/dist/index.ssr.js +18 -378
- package/dist/index.ssr.js.map +7 -1
- package/package.json +5 -6
package/dist/index.ssr.js
CHANGED
|
@@ -864,370 +864,7 @@ import { ssrAttribute as _$ssrAttribute8 } from "solid-js/web";
|
|
|
864
864
|
import { escape as _$escape13 } from "solid-js/web";
|
|
865
865
|
import { splitProps as splitProps8, mergeProps as solidMergeProps4, Show as Show9 } from "solid-js";
|
|
866
866
|
import { createTextField, createFocusRing } from "@proyecto-viviana/solidaria";
|
|
867
|
-
|
|
868
|
-
// ../solid-stately/src/utils/reactivity.ts
|
|
869
|
-
function access(value) {
|
|
870
|
-
return typeof value === "function" ? value() : value;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
// ../solid-stately/src/textfield/createTextFieldState.ts
|
|
874
|
-
import { createSignal as createSignal3 } from "solid-js";
|
|
875
|
-
function createTextFieldState(props = {}) {
|
|
876
|
-
const getProps = () => access(props);
|
|
877
|
-
const initialProps = getProps();
|
|
878
|
-
const initialValue = initialProps.value ?? initialProps.defaultValue ?? "";
|
|
879
|
-
const [internalValue, setInternalValue] = createSignal3(initialValue);
|
|
880
|
-
const isControlled = () => getProps().value !== void 0;
|
|
881
|
-
const value = () => {
|
|
882
|
-
const p = getProps();
|
|
883
|
-
return isControlled() ? p.value ?? "" : internalValue();
|
|
884
|
-
};
|
|
885
|
-
function setValue(newValue) {
|
|
886
|
-
const p = getProps();
|
|
887
|
-
if (!isControlled()) {
|
|
888
|
-
setInternalValue(newValue);
|
|
889
|
-
}
|
|
890
|
-
p.onChange?.(newValue);
|
|
891
|
-
}
|
|
892
|
-
return {
|
|
893
|
-
value,
|
|
894
|
-
setValue
|
|
895
|
-
};
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
// ../solid-stately/src/numberfield/createNumberFieldState.ts
|
|
899
|
-
import { createSignal as createSignal4, createMemo } from "solid-js";
|
|
900
|
-
function handleDecimalOperation(operator, value1, value2) {
|
|
901
|
-
const getDecimals = (n) => {
|
|
902
|
-
const str = String(n);
|
|
903
|
-
const idx = str.indexOf(".");
|
|
904
|
-
return idx === -1 ? 0 : str.length - idx - 1;
|
|
905
|
-
};
|
|
906
|
-
const decimals = Math.max(getDecimals(value1), getDecimals(value2));
|
|
907
|
-
const multiplier = Math.pow(10, decimals);
|
|
908
|
-
const int1 = Math.round(value1 * multiplier);
|
|
909
|
-
const int2 = Math.round(value2 * multiplier);
|
|
910
|
-
const result = operator === "+" ? int1 + int2 : int1 - int2;
|
|
911
|
-
return result / multiplier;
|
|
912
|
-
}
|
|
913
|
-
function clamp(value, min, max) {
|
|
914
|
-
let result = value;
|
|
915
|
-
if (min != null && result < min) result = min;
|
|
916
|
-
if (max != null && result > max) result = max;
|
|
917
|
-
return result;
|
|
918
|
-
}
|
|
919
|
-
function snapToStep(value, step, min) {
|
|
920
|
-
const base = min ?? 0;
|
|
921
|
-
const diff = value - base;
|
|
922
|
-
const steps = Math.round(diff / step);
|
|
923
|
-
return handleDecimalOperation("+", base, steps * step);
|
|
924
|
-
}
|
|
925
|
-
function createNumberFieldState(props) {
|
|
926
|
-
const getProps = () => access(props);
|
|
927
|
-
const locale = () => getProps().locale ?? "en-US";
|
|
928
|
-
const formatOptions = () => getProps().formatOptions ?? {};
|
|
929
|
-
const formatter = createMemo(() => {
|
|
930
|
-
return new Intl.NumberFormat(locale(), formatOptions());
|
|
931
|
-
});
|
|
932
|
-
const parseNumber = (value) => {
|
|
933
|
-
if (!value || value === "" || value === "-") return NaN;
|
|
934
|
-
const opts = formatOptions();
|
|
935
|
-
const testNumber = formatter().format(1.1);
|
|
936
|
-
const decimalSeparator = testNumber.charAt(1);
|
|
937
|
-
let normalized = value;
|
|
938
|
-
if (decimalSeparator !== ".") {
|
|
939
|
-
normalized = normalized.replace(decimalSeparator, ".");
|
|
940
|
-
}
|
|
941
|
-
normalized = normalized.replace(/[^\d.\-]/g, "");
|
|
942
|
-
const parsed = parseFloat(normalized);
|
|
943
|
-
return parsed;
|
|
944
|
-
};
|
|
945
|
-
const formatNumber = (value) => {
|
|
946
|
-
if (isNaN(value)) return "";
|
|
947
|
-
return formatter().format(value);
|
|
948
|
-
};
|
|
949
|
-
const step = createMemo(() => {
|
|
950
|
-
const p = getProps();
|
|
951
|
-
if (p.step != null) return p.step;
|
|
952
|
-
if (p.formatOptions?.style === "percent") return 0.01;
|
|
953
|
-
return 1;
|
|
954
|
-
});
|
|
955
|
-
const [inputValue, setInputValueInternal] = createSignal4("");
|
|
956
|
-
const [numberValue, setNumberValue] = createSignal4(NaN);
|
|
957
|
-
const initValue = () => {
|
|
958
|
-
const p = getProps();
|
|
959
|
-
const initial = p.value ?? p.defaultValue;
|
|
960
|
-
if (initial != null) {
|
|
961
|
-
setNumberValue(initial);
|
|
962
|
-
setInputValueInternal(formatNumber(initial));
|
|
963
|
-
}
|
|
964
|
-
};
|
|
965
|
-
let initialized = false;
|
|
966
|
-
const ensureInitialized = () => {
|
|
967
|
-
if (!initialized) {
|
|
968
|
-
initialized = true;
|
|
969
|
-
initValue();
|
|
970
|
-
}
|
|
971
|
-
};
|
|
972
|
-
const actualNumberValue = createMemo(() => {
|
|
973
|
-
ensureInitialized();
|
|
974
|
-
const p = getProps();
|
|
975
|
-
if (p.value !== void 0) {
|
|
976
|
-
return p.value;
|
|
977
|
-
}
|
|
978
|
-
return numberValue();
|
|
979
|
-
});
|
|
980
|
-
const validate = (value) => {
|
|
981
|
-
if (value === "" || value === "-") return true;
|
|
982
|
-
const opts = formatOptions();
|
|
983
|
-
const testNumber = formatter().format(1.1);
|
|
984
|
-
const decimalSeparator = testNumber.charAt(1);
|
|
985
|
-
const pattern = new RegExp(
|
|
986
|
-
`^-?\\d*${decimalSeparator === "." ? "\\." : decimalSeparator}?\\d*$`
|
|
987
|
-
);
|
|
988
|
-
return pattern.test(value);
|
|
989
|
-
};
|
|
990
|
-
const setInputValue = (value) => {
|
|
991
|
-
ensureInitialized();
|
|
992
|
-
setInputValueInternal(value);
|
|
993
|
-
};
|
|
994
|
-
const commit = () => {
|
|
995
|
-
ensureInitialized();
|
|
996
|
-
const p = getProps();
|
|
997
|
-
const input = inputValue();
|
|
998
|
-
if (input === "" || input === "-") {
|
|
999
|
-
setNumberValue(NaN);
|
|
1000
|
-
setInputValueInternal("");
|
|
1001
|
-
return;
|
|
1002
|
-
}
|
|
1003
|
-
let parsed = parseNumber(input);
|
|
1004
|
-
if (isNaN(parsed)) {
|
|
1005
|
-
setInputValueInternal(formatNumber(actualNumberValue()));
|
|
1006
|
-
return;
|
|
1007
|
-
}
|
|
1008
|
-
parsed = clamp(parsed, p.minValue, p.maxValue);
|
|
1009
|
-
parsed = snapToStep(parsed, step(), p.minValue);
|
|
1010
|
-
setNumberValue(parsed);
|
|
1011
|
-
setInputValueInternal(formatNumber(parsed));
|
|
1012
|
-
if (p.value === void 0) {
|
|
1013
|
-
p.onChange?.(parsed);
|
|
1014
|
-
} else {
|
|
1015
|
-
p.onChange?.(parsed);
|
|
1016
|
-
}
|
|
1017
|
-
};
|
|
1018
|
-
const canIncrement = createMemo(() => {
|
|
1019
|
-
ensureInitialized();
|
|
1020
|
-
const p = getProps();
|
|
1021
|
-
if (p.isDisabled || p.isReadOnly) return false;
|
|
1022
|
-
const current = actualNumberValue();
|
|
1023
|
-
if (isNaN(current)) return true;
|
|
1024
|
-
if (p.maxValue == null) return true;
|
|
1025
|
-
return handleDecimalOperation("+", current, step()) <= p.maxValue;
|
|
1026
|
-
});
|
|
1027
|
-
const canDecrement = createMemo(() => {
|
|
1028
|
-
ensureInitialized();
|
|
1029
|
-
const p = getProps();
|
|
1030
|
-
if (p.isDisabled || p.isReadOnly) return false;
|
|
1031
|
-
const current = actualNumberValue();
|
|
1032
|
-
if (isNaN(current)) return true;
|
|
1033
|
-
if (p.minValue == null) return true;
|
|
1034
|
-
return handleDecimalOperation("-", current, step()) >= p.minValue;
|
|
1035
|
-
});
|
|
1036
|
-
const increment = () => {
|
|
1037
|
-
ensureInitialized();
|
|
1038
|
-
const p = getProps();
|
|
1039
|
-
if (p.isDisabled || p.isReadOnly) return;
|
|
1040
|
-
let current = actualNumberValue();
|
|
1041
|
-
if (isNaN(current)) {
|
|
1042
|
-
current = p.minValue ?? 0;
|
|
1043
|
-
} else {
|
|
1044
|
-
current = snapToStep(current, step(), p.minValue);
|
|
1045
|
-
current = handleDecimalOperation("+", current, step());
|
|
1046
|
-
}
|
|
1047
|
-
current = clamp(current, p.minValue, p.maxValue);
|
|
1048
|
-
setNumberValue(current);
|
|
1049
|
-
setInputValueInternal(formatNumber(current));
|
|
1050
|
-
p.onChange?.(current);
|
|
1051
|
-
};
|
|
1052
|
-
const decrement = () => {
|
|
1053
|
-
ensureInitialized();
|
|
1054
|
-
const p = getProps();
|
|
1055
|
-
if (p.isDisabled || p.isReadOnly) return;
|
|
1056
|
-
let current = actualNumberValue();
|
|
1057
|
-
if (isNaN(current)) {
|
|
1058
|
-
current = p.maxValue ?? 0;
|
|
1059
|
-
} else {
|
|
1060
|
-
current = snapToStep(current, step(), p.minValue);
|
|
1061
|
-
current = handleDecimalOperation("-", current, step());
|
|
1062
|
-
}
|
|
1063
|
-
current = clamp(current, p.minValue, p.maxValue);
|
|
1064
|
-
setNumberValue(current);
|
|
1065
|
-
setInputValueInternal(formatNumber(current));
|
|
1066
|
-
p.onChange?.(current);
|
|
1067
|
-
};
|
|
1068
|
-
const incrementToMax = () => {
|
|
1069
|
-
ensureInitialized();
|
|
1070
|
-
const p = getProps();
|
|
1071
|
-
if (p.isDisabled || p.isReadOnly) return;
|
|
1072
|
-
if (p.maxValue == null) return;
|
|
1073
|
-
const snapped = snapToStep(p.maxValue, step(), p.minValue);
|
|
1074
|
-
setNumberValue(snapped);
|
|
1075
|
-
setInputValueInternal(formatNumber(snapped));
|
|
1076
|
-
p.onChange?.(snapped);
|
|
1077
|
-
};
|
|
1078
|
-
const decrementToMin = () => {
|
|
1079
|
-
ensureInitialized();
|
|
1080
|
-
const p = getProps();
|
|
1081
|
-
if (p.isDisabled || p.isReadOnly) return;
|
|
1082
|
-
if (p.minValue == null) return;
|
|
1083
|
-
setNumberValue(p.minValue);
|
|
1084
|
-
setInputValueInternal(formatNumber(p.minValue));
|
|
1085
|
-
p.onChange?.(p.minValue);
|
|
1086
|
-
};
|
|
1087
|
-
return {
|
|
1088
|
-
get inputValue() {
|
|
1089
|
-
ensureInitialized();
|
|
1090
|
-
return inputValue;
|
|
1091
|
-
},
|
|
1092
|
-
get numberValue() {
|
|
1093
|
-
return actualNumberValue;
|
|
1094
|
-
},
|
|
1095
|
-
canIncrement,
|
|
1096
|
-
canDecrement,
|
|
1097
|
-
isDisabled: () => getProps().isDisabled ?? false,
|
|
1098
|
-
isReadOnly: () => getProps().isReadOnly ?? false,
|
|
1099
|
-
minValue: () => getProps().minValue,
|
|
1100
|
-
maxValue: () => getProps().maxValue,
|
|
1101
|
-
setInputValue,
|
|
1102
|
-
validate,
|
|
1103
|
-
commit,
|
|
1104
|
-
increment,
|
|
1105
|
-
decrement,
|
|
1106
|
-
incrementToMax,
|
|
1107
|
-
decrementToMin
|
|
1108
|
-
};
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
// ../solid-stately/src/searchfield/createSearchFieldState.ts
|
|
1112
|
-
import { createSignal as createSignal5, createMemo as createMemo2 } from "solid-js";
|
|
1113
|
-
function createSearchFieldState(props) {
|
|
1114
|
-
const getProps = () => access(props);
|
|
1115
|
-
const isControlled = () => getProps().value !== void 0;
|
|
1116
|
-
const [internalValue, setInternalValue] = createSignal5(
|
|
1117
|
-
getProps().defaultValue ?? ""
|
|
1118
|
-
);
|
|
1119
|
-
const value = createMemo2(() => {
|
|
1120
|
-
const p = getProps();
|
|
1121
|
-
return isControlled() ? p.value ?? "" : internalValue();
|
|
1122
|
-
});
|
|
1123
|
-
const setValue = (newValue) => {
|
|
1124
|
-
const p = getProps();
|
|
1125
|
-
if (!isControlled()) {
|
|
1126
|
-
setInternalValue(newValue);
|
|
1127
|
-
}
|
|
1128
|
-
p.onChange?.(newValue);
|
|
1129
|
-
};
|
|
1130
|
-
return {
|
|
1131
|
-
value,
|
|
1132
|
-
setValue
|
|
1133
|
-
};
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
// ../solid-stately/src/slider/createSliderState.ts
|
|
1137
|
-
import { createSignal as createSignal6, createMemo as createMemo3 } from "solid-js";
|
|
1138
|
-
var DEFAULT_MIN = 0;
|
|
1139
|
-
var DEFAULT_MAX = 100;
|
|
1140
|
-
var DEFAULT_STEP = 1;
|
|
1141
|
-
function clamp2(value, min, max) {
|
|
1142
|
-
return Math.min(Math.max(value, min), max);
|
|
1143
|
-
}
|
|
1144
|
-
function snapToStep2(value, min, max, step) {
|
|
1145
|
-
const snapped = Math.round((value - min) / step) * step + min;
|
|
1146
|
-
const decimalPlaces = (step.toString().split(".")[1] || "").length;
|
|
1147
|
-
const rounded = parseFloat(snapped.toFixed(decimalPlaces));
|
|
1148
|
-
return clamp2(rounded, min, max);
|
|
1149
|
-
}
|
|
1150
|
-
function createSliderState(props) {
|
|
1151
|
-
const getProps = () => access(props);
|
|
1152
|
-
const minValue = getProps().minValue ?? DEFAULT_MIN;
|
|
1153
|
-
const maxValue = getProps().maxValue ?? DEFAULT_MAX;
|
|
1154
|
-
const step = getProps().step ?? DEFAULT_STEP;
|
|
1155
|
-
const orientation = getProps().orientation ?? "horizontal";
|
|
1156
|
-
const isDisabled = getProps().isDisabled ?? false;
|
|
1157
|
-
const pageStep = Math.max(step, snapToStep2((maxValue - minValue) / 10, 0, maxValue - minValue, step));
|
|
1158
|
-
const isControlled = () => getProps().value !== void 0;
|
|
1159
|
-
const [internalValue, setInternalValue] = createSignal6(
|
|
1160
|
-
snapToStep2(getProps().defaultValue ?? minValue, minValue, maxValue, step)
|
|
1161
|
-
);
|
|
1162
|
-
const [isDragging, setIsDragging] = createSignal6(false);
|
|
1163
|
-
const [isFocused, setIsFocused] = createSignal6(false);
|
|
1164
|
-
const value = createMemo3(() => {
|
|
1165
|
-
const p = getProps();
|
|
1166
|
-
const rawValue = isControlled() ? p.value ?? minValue : internalValue();
|
|
1167
|
-
return snapToStep2(rawValue, minValue, maxValue, step);
|
|
1168
|
-
});
|
|
1169
|
-
const getValuePercent = createMemo3(() => {
|
|
1170
|
-
return (value() - minValue) / (maxValue - minValue);
|
|
1171
|
-
});
|
|
1172
|
-
const getFormattedValue = createMemo3(() => {
|
|
1173
|
-
const p = getProps();
|
|
1174
|
-
const formatter = new Intl.NumberFormat(p.locale, p.formatOptions);
|
|
1175
|
-
return formatter.format(value());
|
|
1176
|
-
});
|
|
1177
|
-
const setValue = (newValue) => {
|
|
1178
|
-
if (isDisabled) return;
|
|
1179
|
-
const p = getProps();
|
|
1180
|
-
const snappedValue = snapToStep2(newValue, minValue, maxValue, step);
|
|
1181
|
-
if (!isControlled()) {
|
|
1182
|
-
setInternalValue(snappedValue);
|
|
1183
|
-
}
|
|
1184
|
-
p.onChange?.(snappedValue);
|
|
1185
|
-
};
|
|
1186
|
-
const setValuePercent = (percent) => {
|
|
1187
|
-
const clampedPercent = clamp2(percent, 0, 1);
|
|
1188
|
-
const newValue = clampedPercent * (maxValue - minValue) + minValue;
|
|
1189
|
-
setValue(newValue);
|
|
1190
|
-
};
|
|
1191
|
-
const setDragging = (dragging) => {
|
|
1192
|
-
const wasDragging = isDragging();
|
|
1193
|
-
setIsDragging(dragging);
|
|
1194
|
-
if (wasDragging && !dragging) {
|
|
1195
|
-
getProps().onChangeEnd?.(value());
|
|
1196
|
-
}
|
|
1197
|
-
};
|
|
1198
|
-
const increment = (stepMultiplier = 1) => {
|
|
1199
|
-
if (isDisabled) return;
|
|
1200
|
-
setValue(value() + step * stepMultiplier);
|
|
1201
|
-
};
|
|
1202
|
-
const decrement = (stepMultiplier = 1) => {
|
|
1203
|
-
if (isDisabled) return;
|
|
1204
|
-
setValue(value() - step * stepMultiplier);
|
|
1205
|
-
};
|
|
1206
|
-
const setFocused = (focused) => {
|
|
1207
|
-
setIsFocused(focused);
|
|
1208
|
-
};
|
|
1209
|
-
return {
|
|
1210
|
-
value,
|
|
1211
|
-
setValue,
|
|
1212
|
-
setValuePercent,
|
|
1213
|
-
getValuePercent,
|
|
1214
|
-
getFormattedValue,
|
|
1215
|
-
isDragging,
|
|
1216
|
-
setDragging,
|
|
1217
|
-
isFocused,
|
|
1218
|
-
setFocused,
|
|
1219
|
-
increment,
|
|
1220
|
-
decrement,
|
|
1221
|
-
minValue,
|
|
1222
|
-
maxValue,
|
|
1223
|
-
step,
|
|
1224
|
-
pageStep,
|
|
1225
|
-
orientation,
|
|
1226
|
-
isDisabled
|
|
1227
|
-
};
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
// src/textfield/index.tsx
|
|
867
|
+
import { createTextFieldState } from "@proyecto-viviana/solid-stately";
|
|
1231
868
|
var _tmpl$15 = '<span class="text-danger-400 ml-0.5">*</span>';
|
|
1232
869
|
var _tmpl$211 = ["<div", ">", "", "", "", "</div>"];
|
|
1233
870
|
var sizeStyles8 = {
|
|
@@ -1437,7 +1074,7 @@ import { ssrStyleProperty as _$ssrStyleProperty } from "solid-js/web";
|
|
|
1437
1074
|
import { createComponent as _$createComponent14 } from "solid-js/web";
|
|
1438
1075
|
import { ssr as _$ssr14 } from "solid-js/web";
|
|
1439
1076
|
import { escape as _$escape14 } from "solid-js/web";
|
|
1440
|
-
import { splitProps as splitProps10, Show as Show10, createMemo
|
|
1077
|
+
import { splitProps as splitProps10, Show as Show10, createMemo } from "solid-js";
|
|
1441
1078
|
import { createProgressBar } from "@proyecto-viviana/solidaria";
|
|
1442
1079
|
var _tmpl$16 = ['<span class="text-primary-200 font-medium">', "</span>"];
|
|
1443
1080
|
var _tmpl$212 = ['<span class="text-primary-300">', "</span>"];
|
|
@@ -1464,7 +1101,7 @@ var variantStyles5 = {
|
|
|
1464
1101
|
warning: "bg-yellow-500",
|
|
1465
1102
|
danger: "bg-red-500"
|
|
1466
1103
|
};
|
|
1467
|
-
function
|
|
1104
|
+
function clamp(value, min, max) {
|
|
1468
1105
|
return Math.min(Math.max(value, min), max);
|
|
1469
1106
|
}
|
|
1470
1107
|
function ProgressBar(props) {
|
|
@@ -1496,14 +1133,14 @@ function ProgressBar(props) {
|
|
|
1496
1133
|
return ariaProps["aria-label"];
|
|
1497
1134
|
}
|
|
1498
1135
|
});
|
|
1499
|
-
const percentage =
|
|
1136
|
+
const percentage = createMemo(() => {
|
|
1500
1137
|
if (isIndeterminate()) {
|
|
1501
1138
|
return void 0;
|
|
1502
1139
|
}
|
|
1503
1140
|
const value = ariaProps.value ?? 0;
|
|
1504
1141
|
const minValue = ariaProps.minValue ?? 0;
|
|
1505
1142
|
const maxValue = ariaProps.maxValue ?? 100;
|
|
1506
|
-
const clampedValue =
|
|
1143
|
+
const clampedValue = clamp(value, minValue, maxValue);
|
|
1507
1144
|
return (clampedValue - minValue) / (maxValue - minValue) * 100;
|
|
1508
1145
|
});
|
|
1509
1146
|
const valueText = () => progressAria.progressBarProps["aria-valuetext"];
|
|
@@ -1540,7 +1177,7 @@ function ProgressBar(props) {
|
|
|
1540
1177
|
import { createComponent as _$createComponent15 } from "solid-js/web";
|
|
1541
1178
|
import { ssrElement as _$ssrElement4 } from "solid-js/web";
|
|
1542
1179
|
import { mergeProps as _$mergeProps11 } from "solid-js/web";
|
|
1543
|
-
import { splitProps as splitProps11, createMemo as
|
|
1180
|
+
import { splitProps as splitProps11, createMemo as createMemo2, Show as Show11 } from "solid-js";
|
|
1544
1181
|
import { createSeparator } from "@proyecto-viviana/solidaria";
|
|
1545
1182
|
var variantStyles6 = {
|
|
1546
1183
|
default: "bg-bg-100",
|
|
@@ -1562,7 +1199,7 @@ function Separator(props) {
|
|
|
1562
1199
|
const orientation = () => local.orientation ?? "horizontal";
|
|
1563
1200
|
const variant = () => local.variant ?? "default";
|
|
1564
1201
|
const size = () => local.size ?? "md";
|
|
1565
|
-
const elementType =
|
|
1202
|
+
const elementType = createMemo2(() => {
|
|
1566
1203
|
if (orientation() === "vertical") {
|
|
1567
1204
|
return "div";
|
|
1568
1205
|
}
|
|
@@ -1579,7 +1216,7 @@ function Separator(props) {
|
|
|
1579
1216
|
return ariaProps["aria-label"];
|
|
1580
1217
|
}
|
|
1581
1218
|
});
|
|
1582
|
-
const className =
|
|
1219
|
+
const className = createMemo2(() => {
|
|
1583
1220
|
const isVertical = orientation() === "vertical";
|
|
1584
1221
|
const sizeStyles33 = isVertical ? verticalSizeStyles : horizontalSizeStyles;
|
|
1585
1222
|
const base = [
|
|
@@ -1661,7 +1298,7 @@ import { createComponent as _$createComponent17 } from "solid-js/web";
|
|
|
1661
1298
|
import { ssr as _$ssr15 } from "solid-js/web";
|
|
1662
1299
|
import { ssrAttribute as _$ssrAttribute9 } from "solid-js/web";
|
|
1663
1300
|
import { escape as _$escape15 } from "solid-js/web";
|
|
1664
|
-
import { splitProps as splitProps13, createMemo as
|
|
1301
|
+
import { splitProps as splitProps13, createMemo as createMemo3, Show as Show12, For } from "solid-js";
|
|
1665
1302
|
import { Autocomplete, useAutocompleteInput, useAutocompleteCollection, useAutocompleteState } from "@proyecto-viviana/solidaria-components";
|
|
1666
1303
|
var _tmpl$17 = ['<input type="text"', "", ">"];
|
|
1667
1304
|
var _tmpl$213 = ["<ul", ' role="listbox"', ">", "</ul>"];
|
|
@@ -1703,7 +1340,7 @@ function AutocompleteList(props) {
|
|
|
1703
1340
|
const state = useAutocompleteState();
|
|
1704
1341
|
if (!ctx) return null;
|
|
1705
1342
|
const styles = () => sizeStyles11[props.size];
|
|
1706
|
-
const filteredItems =
|
|
1343
|
+
const filteredItems = createMemo3(() => {
|
|
1707
1344
|
if (!ctx.filter) return props.items;
|
|
1708
1345
|
return props.items.filter((item) => {
|
|
1709
1346
|
const textValue = String(item[props.textKey] ?? item.name ?? "");
|
|
@@ -2521,6 +2158,7 @@ import { ssrAttribute as _$ssrAttribute14 } from "solid-js/web";
|
|
|
2521
2158
|
import { escape as _$escape20 } from "solid-js/web";
|
|
2522
2159
|
import { splitProps as splitProps19, mergeProps as solidMergeProps5, Show as Show15 } from "solid-js";
|
|
2523
2160
|
import { createNumberField, createFocusRing as createFocusRing2, createPress, createHover } from "@proyecto-viviana/solidaria";
|
|
2161
|
+
import { createNumberFieldState } from "@proyecto-viviana/solid-stately";
|
|
2524
2162
|
var _tmpl$30 = ["<svg", ' viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 3v10M3 8h10"></path></svg>'];
|
|
2525
2163
|
var _tmpl$217 = ["<svg", ' viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 8h10"></path></svg>'];
|
|
2526
2164
|
var _tmpl$313 = '<span class="text-danger-500 ml-1">*</span>';
|
|
@@ -2924,6 +2562,7 @@ import { ssrAttribute as _$ssrAttribute15 } from "solid-js/web";
|
|
|
2924
2562
|
import { escape as _$escape21 } from "solid-js/web";
|
|
2925
2563
|
import { splitProps as splitProps20, mergeProps as solidMergeProps6, Show as Show16 } from "solid-js";
|
|
2926
2564
|
import { createSearchField, createFocusRing as createFocusRing3, createPress as createPress2, createHover as createHover2 } from "@proyecto-viviana/solidaria";
|
|
2565
|
+
import { createSearchFieldState } from "@proyecto-viviana/solid-stately";
|
|
2927
2566
|
var _tmpl$31 = ["<svg", ' viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2"><circle cx="8" cy="8" r="5"></circle><path d="M12 12L17 17" stroke-linecap="round"></path></svg>'];
|
|
2928
2567
|
var _tmpl$218 = ["<svg", ' viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4L12 12M12 4L4 12" stroke-linecap="round"></path></svg>'];
|
|
2929
2568
|
var _tmpl$314 = '<span class="text-danger-500 ml-1">*</span>';
|
|
@@ -3290,6 +2929,7 @@ import { ssrAttribute as _$ssrAttribute16 } from "solid-js/web";
|
|
|
3290
2929
|
import { escape as _$escape22 } from "solid-js/web";
|
|
3291
2930
|
import { splitProps as splitProps21, mergeProps as solidMergeProps7, Show as Show17 } from "solid-js";
|
|
3292
2931
|
import { createSlider, createFocusRing as createFocusRing4, createHover as createHover3 } from "@proyecto-viviana/solidaria";
|
|
2932
|
+
import { createSliderState } from "@proyecto-viviana/solid-stately";
|
|
3293
2933
|
var _tmpl$40 = ["<div", ">", "", "</div>"];
|
|
3294
2934
|
var _tmpl$219 = ["<div", ' style="', '"></div>'];
|
|
3295
2935
|
var _tmpl$315 = ['<div class="flex justify-between mt-1"><span', ">", "</span><span", ">", "</span></div>"];
|
|
@@ -4139,7 +3779,7 @@ import { ssrStyleProperty as _$ssrStyleProperty4 } from "solid-js/web";
|
|
|
4139
3779
|
import { createComponent as _$createComponent29 } from "solid-js/web";
|
|
4140
3780
|
import { ssr as _$ssr26 } from "solid-js/web";
|
|
4141
3781
|
import { escape as _$escape26 } from "solid-js/web";
|
|
4142
|
-
import { splitProps as splitProps25, Show as Show21, createMemo as
|
|
3782
|
+
import { splitProps as splitProps25, Show as Show21, createMemo as createMemo4 } from "solid-js";
|
|
4143
3783
|
import { createMeter } from "@proyecto-viviana/solidaria";
|
|
4144
3784
|
var _tmpl$60 = ['<span class="text-primary-200 font-medium">', "</span>"];
|
|
4145
3785
|
var _tmpl$222 = ['<span class="text-primary-300">', "</span>"];
|
|
@@ -4167,7 +3807,7 @@ var variantStyles12 = {
|
|
|
4167
3807
|
danger: "bg-red-500",
|
|
4168
3808
|
info: "bg-blue-500"
|
|
4169
3809
|
};
|
|
4170
|
-
function
|
|
3810
|
+
function clamp2(value, min, max) {
|
|
4171
3811
|
return Math.min(Math.max(value, min), max);
|
|
4172
3812
|
}
|
|
4173
3813
|
function Meter(props) {
|
|
@@ -4195,11 +3835,11 @@ function Meter(props) {
|
|
|
4195
3835
|
return ariaProps["aria-label"];
|
|
4196
3836
|
}
|
|
4197
3837
|
});
|
|
4198
|
-
const percentage =
|
|
3838
|
+
const percentage = createMemo4(() => {
|
|
4199
3839
|
const value = ariaProps.value ?? 0;
|
|
4200
3840
|
const minValue = ariaProps.minValue ?? 0;
|
|
4201
3841
|
const maxValue = ariaProps.maxValue ?? 100;
|
|
4202
|
-
const clampedValue =
|
|
3842
|
+
const clampedValue = clamp2(value, minValue, maxValue);
|
|
4203
3843
|
return (clampedValue - minValue) / (maxValue - minValue) * 100;
|
|
4204
3844
|
});
|
|
4205
3845
|
const valueText = () => meterAria.meterProps["aria-valuetext"];
|
|
@@ -6988,4 +6628,4 @@ export {
|
|
|
6988
6628
|
useLandmarkController,
|
|
6989
6629
|
useToastContext
|
|
6990
6630
|
};
|
|
6991
|
-
//# sourceMappingURL=index.ssr.js.map
|
|
6631
|
+
//# sourceMappingURL=index.ssr.js.map
|