@proyecto-viviana/ui 0.2.2 → 0.2.5

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.ssr.js CHANGED
@@ -864,7 +864,370 @@ 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
- import { createTextFieldState } from "@proyecto-viviana/solid-stately";
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
868
1231
  var _tmpl$15 = '<span class="text-danger-400 ml-0.5">*</span>';
869
1232
  var _tmpl$211 = ["<div", ">", "", "", "", "</div>"];
870
1233
  var sizeStyles8 = {
@@ -1074,7 +1437,7 @@ import { ssrStyleProperty as _$ssrStyleProperty } from "solid-js/web";
1074
1437
  import { createComponent as _$createComponent14 } from "solid-js/web";
1075
1438
  import { ssr as _$ssr14 } from "solid-js/web";
1076
1439
  import { escape as _$escape14 } from "solid-js/web";
1077
- import { splitProps as splitProps10, Show as Show10, createMemo } from "solid-js";
1440
+ import { splitProps as splitProps10, Show as Show10, createMemo as createMemo4 } from "solid-js";
1078
1441
  import { createProgressBar } from "@proyecto-viviana/solidaria";
1079
1442
  var _tmpl$16 = ['<span class="text-primary-200 font-medium">', "</span>"];
1080
1443
  var _tmpl$212 = ['<span class="text-primary-300">', "</span>"];
@@ -1101,7 +1464,7 @@ var variantStyles5 = {
1101
1464
  warning: "bg-yellow-500",
1102
1465
  danger: "bg-red-500"
1103
1466
  };
1104
- function clamp(value, min, max) {
1467
+ function clamp3(value, min, max) {
1105
1468
  return Math.min(Math.max(value, min), max);
1106
1469
  }
1107
1470
  function ProgressBar(props) {
@@ -1133,14 +1496,14 @@ function ProgressBar(props) {
1133
1496
  return ariaProps["aria-label"];
1134
1497
  }
1135
1498
  });
1136
- const percentage = createMemo(() => {
1499
+ const percentage = createMemo4(() => {
1137
1500
  if (isIndeterminate()) {
1138
1501
  return void 0;
1139
1502
  }
1140
1503
  const value = ariaProps.value ?? 0;
1141
1504
  const minValue = ariaProps.minValue ?? 0;
1142
1505
  const maxValue = ariaProps.maxValue ?? 100;
1143
- const clampedValue = clamp(value, minValue, maxValue);
1506
+ const clampedValue = clamp3(value, minValue, maxValue);
1144
1507
  return (clampedValue - minValue) / (maxValue - minValue) * 100;
1145
1508
  });
1146
1509
  const valueText = () => progressAria.progressBarProps["aria-valuetext"];
@@ -1177,7 +1540,7 @@ function ProgressBar(props) {
1177
1540
  import { createComponent as _$createComponent15 } from "solid-js/web";
1178
1541
  import { ssrElement as _$ssrElement4 } from "solid-js/web";
1179
1542
  import { mergeProps as _$mergeProps11 } from "solid-js/web";
1180
- import { splitProps as splitProps11, createMemo as createMemo2, Show as Show11 } from "solid-js";
1543
+ import { splitProps as splitProps11, createMemo as createMemo5, Show as Show11 } from "solid-js";
1181
1544
  import { createSeparator } from "@proyecto-viviana/solidaria";
1182
1545
  var variantStyles6 = {
1183
1546
  default: "bg-bg-100",
@@ -1199,7 +1562,7 @@ function Separator(props) {
1199
1562
  const orientation = () => local.orientation ?? "horizontal";
1200
1563
  const variant = () => local.variant ?? "default";
1201
1564
  const size = () => local.size ?? "md";
1202
- const elementType = createMemo2(() => {
1565
+ const elementType = createMemo5(() => {
1203
1566
  if (orientation() === "vertical") {
1204
1567
  return "div";
1205
1568
  }
@@ -1216,7 +1579,7 @@ function Separator(props) {
1216
1579
  return ariaProps["aria-label"];
1217
1580
  }
1218
1581
  });
1219
- const className = createMemo2(() => {
1582
+ const className = createMemo5(() => {
1220
1583
  const isVertical = orientation() === "vertical";
1221
1584
  const sizeStyles33 = isVertical ? verticalSizeStyles : horizontalSizeStyles;
1222
1585
  const base = [
@@ -1298,7 +1661,7 @@ import { createComponent as _$createComponent17 } from "solid-js/web";
1298
1661
  import { ssr as _$ssr15 } from "solid-js/web";
1299
1662
  import { ssrAttribute as _$ssrAttribute9 } from "solid-js/web";
1300
1663
  import { escape as _$escape15 } from "solid-js/web";
1301
- import { splitProps as splitProps13, createMemo as createMemo3, Show as Show12, For } from "solid-js";
1664
+ import { splitProps as splitProps13, createMemo as createMemo6, Show as Show12, For } from "solid-js";
1302
1665
  import { Autocomplete, useAutocompleteInput, useAutocompleteCollection, useAutocompleteState } from "@proyecto-viviana/solidaria-components";
1303
1666
  var _tmpl$17 = ['<input type="text"', "", ">"];
1304
1667
  var _tmpl$213 = ["<ul", ' role="listbox"', ">", "</ul>"];
@@ -1340,7 +1703,7 @@ function AutocompleteList(props) {
1340
1703
  const state = useAutocompleteState();
1341
1704
  if (!ctx) return null;
1342
1705
  const styles = () => sizeStyles11[props.size];
1343
- const filteredItems = createMemo3(() => {
1706
+ const filteredItems = createMemo6(() => {
1344
1707
  if (!ctx.filter) return props.items;
1345
1708
  return props.items.filter((item) => {
1346
1709
  const textValue = String(item[props.textKey] ?? item.name ?? "");
@@ -2158,7 +2521,6 @@ import { ssrAttribute as _$ssrAttribute14 } from "solid-js/web";
2158
2521
  import { escape as _$escape20 } from "solid-js/web";
2159
2522
  import { splitProps as splitProps19, mergeProps as solidMergeProps5, Show as Show15 } from "solid-js";
2160
2523
  import { createNumberField, createFocusRing as createFocusRing2, createPress, createHover } from "@proyecto-viviana/solidaria";
2161
- import { createNumberFieldState } from "@proyecto-viviana/solid-stately";
2162
2524
  var _tmpl$30 = ["<svg", ' viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 3v10M3 8h10"></path></svg>'];
2163
2525
  var _tmpl$217 = ["<svg", ' viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 8h10"></path></svg>'];
2164
2526
  var _tmpl$313 = '<span class="text-danger-500 ml-1">*</span>';
@@ -2562,7 +2924,6 @@ import { ssrAttribute as _$ssrAttribute15 } from "solid-js/web";
2562
2924
  import { escape as _$escape21 } from "solid-js/web";
2563
2925
  import { splitProps as splitProps20, mergeProps as solidMergeProps6, Show as Show16 } from "solid-js";
2564
2926
  import { createSearchField, createFocusRing as createFocusRing3, createPress as createPress2, createHover as createHover2 } from "@proyecto-viviana/solidaria";
2565
- import { createSearchFieldState } from "@proyecto-viviana/solid-stately";
2566
2927
  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>'];
2567
2928
  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>'];
2568
2929
  var _tmpl$314 = '<span class="text-danger-500 ml-1">*</span>';
@@ -2929,7 +3290,6 @@ import { ssrAttribute as _$ssrAttribute16 } from "solid-js/web";
2929
3290
  import { escape as _$escape22 } from "solid-js/web";
2930
3291
  import { splitProps as splitProps21, mergeProps as solidMergeProps7, Show as Show17 } from "solid-js";
2931
3292
  import { createSlider, createFocusRing as createFocusRing4, createHover as createHover3 } from "@proyecto-viviana/solidaria";
2932
- import { createSliderState } from "@proyecto-viviana/solid-stately";
2933
3293
  var _tmpl$40 = ["<div", ">", "", "</div>"];
2934
3294
  var _tmpl$219 = ["<div", ' style="', '"></div>'];
2935
3295
  var _tmpl$315 = ['<div class="flex justify-between mt-1"><span', ">", "</span><span", ">", "</span></div>"];
@@ -3779,7 +4139,7 @@ import { ssrStyleProperty as _$ssrStyleProperty4 } from "solid-js/web";
3779
4139
  import { createComponent as _$createComponent29 } from "solid-js/web";
3780
4140
  import { ssr as _$ssr26 } from "solid-js/web";
3781
4141
  import { escape as _$escape26 } from "solid-js/web";
3782
- import { splitProps as splitProps25, Show as Show21, createMemo as createMemo4 } from "solid-js";
4142
+ import { splitProps as splitProps25, Show as Show21, createMemo as createMemo7 } from "solid-js";
3783
4143
  import { createMeter } from "@proyecto-viviana/solidaria";
3784
4144
  var _tmpl$60 = ['<span class="text-primary-200 font-medium">', "</span>"];
3785
4145
  var _tmpl$222 = ['<span class="text-primary-300">', "</span>"];
@@ -3807,7 +4167,7 @@ var variantStyles12 = {
3807
4167
  danger: "bg-red-500",
3808
4168
  info: "bg-blue-500"
3809
4169
  };
3810
- function clamp2(value, min, max) {
4170
+ function clamp4(value, min, max) {
3811
4171
  return Math.min(Math.max(value, min), max);
3812
4172
  }
3813
4173
  function Meter(props) {
@@ -3835,11 +4195,11 @@ function Meter(props) {
3835
4195
  return ariaProps["aria-label"];
3836
4196
  }
3837
4197
  });
3838
- const percentage = createMemo4(() => {
4198
+ const percentage = createMemo7(() => {
3839
4199
  const value = ariaProps.value ?? 0;
3840
4200
  const minValue = ariaProps.minValue ?? 0;
3841
4201
  const maxValue = ariaProps.maxValue ?? 100;
3842
- const clampedValue = clamp2(value, minValue, maxValue);
4202
+ const clampedValue = clamp4(value, minValue, maxValue);
3843
4203
  return (clampedValue - minValue) / (maxValue - minValue) * 100;
3844
4204
  });
3845
4205
  const valueText = () => meterAria.meterProps["aria-valuetext"];
@@ -6628,4 +6988,4 @@ export {
6628
6988
  useLandmarkController,
6629
6989
  useToastContext
6630
6990
  };
6631
- //# sourceMappingURL=index.ssr.js.map
6991
+ //# sourceMappingURL=index.ssr.js.map