@proyecto-viviana/ui 0.2.1 → 0.2.3
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 +6 -6
package/dist/index.js
CHANGED
|
@@ -1147,370 +1147,7 @@ import { spread as _$spread2 } from "solid-js/web";
|
|
|
1147
1147
|
import { mergeProps as _$mergeProps8 } from "solid-js/web";
|
|
1148
1148
|
import { splitProps as splitProps8, mergeProps as solidMergeProps4, Show as Show9 } from "solid-js";
|
|
1149
1149
|
import { createTextField, createFocusRing } from "@proyecto-viviana/solidaria";
|
|
1150
|
-
|
|
1151
|
-
// ../solid-stately/src/utils/reactivity.ts
|
|
1152
|
-
function access(value) {
|
|
1153
|
-
return typeof value === "function" ? value() : value;
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
// ../solid-stately/src/textfield/createTextFieldState.ts
|
|
1157
|
-
import { createSignal as createSignal3 } from "solid-js";
|
|
1158
|
-
function createTextFieldState(props = {}) {
|
|
1159
|
-
const getProps = () => access(props);
|
|
1160
|
-
const initialProps = getProps();
|
|
1161
|
-
const initialValue = initialProps.value ?? initialProps.defaultValue ?? "";
|
|
1162
|
-
const [internalValue, setInternalValue] = createSignal3(initialValue);
|
|
1163
|
-
const isControlled = () => getProps().value !== void 0;
|
|
1164
|
-
const value = () => {
|
|
1165
|
-
const p = getProps();
|
|
1166
|
-
return isControlled() ? p.value ?? "" : internalValue();
|
|
1167
|
-
};
|
|
1168
|
-
function setValue(newValue) {
|
|
1169
|
-
const p = getProps();
|
|
1170
|
-
if (!isControlled()) {
|
|
1171
|
-
setInternalValue(newValue);
|
|
1172
|
-
}
|
|
1173
|
-
p.onChange?.(newValue);
|
|
1174
|
-
}
|
|
1175
|
-
return {
|
|
1176
|
-
value,
|
|
1177
|
-
setValue
|
|
1178
|
-
};
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
// ../solid-stately/src/numberfield/createNumberFieldState.ts
|
|
1182
|
-
import { createSignal as createSignal4, createMemo } from "solid-js";
|
|
1183
|
-
function handleDecimalOperation(operator, value1, value2) {
|
|
1184
|
-
const getDecimals = (n) => {
|
|
1185
|
-
const str = String(n);
|
|
1186
|
-
const idx = str.indexOf(".");
|
|
1187
|
-
return idx === -1 ? 0 : str.length - idx - 1;
|
|
1188
|
-
};
|
|
1189
|
-
const decimals = Math.max(getDecimals(value1), getDecimals(value2));
|
|
1190
|
-
const multiplier = Math.pow(10, decimals);
|
|
1191
|
-
const int1 = Math.round(value1 * multiplier);
|
|
1192
|
-
const int2 = Math.round(value2 * multiplier);
|
|
1193
|
-
const result = operator === "+" ? int1 + int2 : int1 - int2;
|
|
1194
|
-
return result / multiplier;
|
|
1195
|
-
}
|
|
1196
|
-
function clamp(value, min, max) {
|
|
1197
|
-
let result = value;
|
|
1198
|
-
if (min != null && result < min) result = min;
|
|
1199
|
-
if (max != null && result > max) result = max;
|
|
1200
|
-
return result;
|
|
1201
|
-
}
|
|
1202
|
-
function snapToStep(value, step, min) {
|
|
1203
|
-
const base = min ?? 0;
|
|
1204
|
-
const diff = value - base;
|
|
1205
|
-
const steps = Math.round(diff / step);
|
|
1206
|
-
return handleDecimalOperation("+", base, steps * step);
|
|
1207
|
-
}
|
|
1208
|
-
function createNumberFieldState(props) {
|
|
1209
|
-
const getProps = () => access(props);
|
|
1210
|
-
const locale = () => getProps().locale ?? "en-US";
|
|
1211
|
-
const formatOptions = () => getProps().formatOptions ?? {};
|
|
1212
|
-
const formatter = createMemo(() => {
|
|
1213
|
-
return new Intl.NumberFormat(locale(), formatOptions());
|
|
1214
|
-
});
|
|
1215
|
-
const parseNumber = (value) => {
|
|
1216
|
-
if (!value || value === "" || value === "-") return NaN;
|
|
1217
|
-
const opts = formatOptions();
|
|
1218
|
-
const testNumber = formatter().format(1.1);
|
|
1219
|
-
const decimalSeparator = testNumber.charAt(1);
|
|
1220
|
-
let normalized = value;
|
|
1221
|
-
if (decimalSeparator !== ".") {
|
|
1222
|
-
normalized = normalized.replace(decimalSeparator, ".");
|
|
1223
|
-
}
|
|
1224
|
-
normalized = normalized.replace(/[^\d.\-]/g, "");
|
|
1225
|
-
const parsed = parseFloat(normalized);
|
|
1226
|
-
return parsed;
|
|
1227
|
-
};
|
|
1228
|
-
const formatNumber = (value) => {
|
|
1229
|
-
if (isNaN(value)) return "";
|
|
1230
|
-
return formatter().format(value);
|
|
1231
|
-
};
|
|
1232
|
-
const step = createMemo(() => {
|
|
1233
|
-
const p = getProps();
|
|
1234
|
-
if (p.step != null) return p.step;
|
|
1235
|
-
if (p.formatOptions?.style === "percent") return 0.01;
|
|
1236
|
-
return 1;
|
|
1237
|
-
});
|
|
1238
|
-
const [inputValue, setInputValueInternal] = createSignal4("");
|
|
1239
|
-
const [numberValue, setNumberValue] = createSignal4(NaN);
|
|
1240
|
-
const initValue = () => {
|
|
1241
|
-
const p = getProps();
|
|
1242
|
-
const initial = p.value ?? p.defaultValue;
|
|
1243
|
-
if (initial != null) {
|
|
1244
|
-
setNumberValue(initial);
|
|
1245
|
-
setInputValueInternal(formatNumber(initial));
|
|
1246
|
-
}
|
|
1247
|
-
};
|
|
1248
|
-
let initialized = false;
|
|
1249
|
-
const ensureInitialized = () => {
|
|
1250
|
-
if (!initialized) {
|
|
1251
|
-
initialized = true;
|
|
1252
|
-
initValue();
|
|
1253
|
-
}
|
|
1254
|
-
};
|
|
1255
|
-
const actualNumberValue = createMemo(() => {
|
|
1256
|
-
ensureInitialized();
|
|
1257
|
-
const p = getProps();
|
|
1258
|
-
if (p.value !== void 0) {
|
|
1259
|
-
return p.value;
|
|
1260
|
-
}
|
|
1261
|
-
return numberValue();
|
|
1262
|
-
});
|
|
1263
|
-
const validate = (value) => {
|
|
1264
|
-
if (value === "" || value === "-") return true;
|
|
1265
|
-
const opts = formatOptions();
|
|
1266
|
-
const testNumber = formatter().format(1.1);
|
|
1267
|
-
const decimalSeparator = testNumber.charAt(1);
|
|
1268
|
-
const pattern = new RegExp(
|
|
1269
|
-
`^-?\\d*${decimalSeparator === "." ? "\\." : decimalSeparator}?\\d*$`
|
|
1270
|
-
);
|
|
1271
|
-
return pattern.test(value);
|
|
1272
|
-
};
|
|
1273
|
-
const setInputValue = (value) => {
|
|
1274
|
-
ensureInitialized();
|
|
1275
|
-
setInputValueInternal(value);
|
|
1276
|
-
};
|
|
1277
|
-
const commit = () => {
|
|
1278
|
-
ensureInitialized();
|
|
1279
|
-
const p = getProps();
|
|
1280
|
-
const input = inputValue();
|
|
1281
|
-
if (input === "" || input === "-") {
|
|
1282
|
-
setNumberValue(NaN);
|
|
1283
|
-
setInputValueInternal("");
|
|
1284
|
-
return;
|
|
1285
|
-
}
|
|
1286
|
-
let parsed = parseNumber(input);
|
|
1287
|
-
if (isNaN(parsed)) {
|
|
1288
|
-
setInputValueInternal(formatNumber(actualNumberValue()));
|
|
1289
|
-
return;
|
|
1290
|
-
}
|
|
1291
|
-
parsed = clamp(parsed, p.minValue, p.maxValue);
|
|
1292
|
-
parsed = snapToStep(parsed, step(), p.minValue);
|
|
1293
|
-
setNumberValue(parsed);
|
|
1294
|
-
setInputValueInternal(formatNumber(parsed));
|
|
1295
|
-
if (p.value === void 0) {
|
|
1296
|
-
p.onChange?.(parsed);
|
|
1297
|
-
} else {
|
|
1298
|
-
p.onChange?.(parsed);
|
|
1299
|
-
}
|
|
1300
|
-
};
|
|
1301
|
-
const canIncrement = createMemo(() => {
|
|
1302
|
-
ensureInitialized();
|
|
1303
|
-
const p = getProps();
|
|
1304
|
-
if (p.isDisabled || p.isReadOnly) return false;
|
|
1305
|
-
const current = actualNumberValue();
|
|
1306
|
-
if (isNaN(current)) return true;
|
|
1307
|
-
if (p.maxValue == null) return true;
|
|
1308
|
-
return handleDecimalOperation("+", current, step()) <= p.maxValue;
|
|
1309
|
-
});
|
|
1310
|
-
const canDecrement = createMemo(() => {
|
|
1311
|
-
ensureInitialized();
|
|
1312
|
-
const p = getProps();
|
|
1313
|
-
if (p.isDisabled || p.isReadOnly) return false;
|
|
1314
|
-
const current = actualNumberValue();
|
|
1315
|
-
if (isNaN(current)) return true;
|
|
1316
|
-
if (p.minValue == null) return true;
|
|
1317
|
-
return handleDecimalOperation("-", current, step()) >= p.minValue;
|
|
1318
|
-
});
|
|
1319
|
-
const increment = () => {
|
|
1320
|
-
ensureInitialized();
|
|
1321
|
-
const p = getProps();
|
|
1322
|
-
if (p.isDisabled || p.isReadOnly) return;
|
|
1323
|
-
let current = actualNumberValue();
|
|
1324
|
-
if (isNaN(current)) {
|
|
1325
|
-
current = p.minValue ?? 0;
|
|
1326
|
-
} else {
|
|
1327
|
-
current = snapToStep(current, step(), p.minValue);
|
|
1328
|
-
current = handleDecimalOperation("+", current, step());
|
|
1329
|
-
}
|
|
1330
|
-
current = clamp(current, p.minValue, p.maxValue);
|
|
1331
|
-
setNumberValue(current);
|
|
1332
|
-
setInputValueInternal(formatNumber(current));
|
|
1333
|
-
p.onChange?.(current);
|
|
1334
|
-
};
|
|
1335
|
-
const decrement = () => {
|
|
1336
|
-
ensureInitialized();
|
|
1337
|
-
const p = getProps();
|
|
1338
|
-
if (p.isDisabled || p.isReadOnly) return;
|
|
1339
|
-
let current = actualNumberValue();
|
|
1340
|
-
if (isNaN(current)) {
|
|
1341
|
-
current = p.maxValue ?? 0;
|
|
1342
|
-
} else {
|
|
1343
|
-
current = snapToStep(current, step(), p.minValue);
|
|
1344
|
-
current = handleDecimalOperation("-", current, step());
|
|
1345
|
-
}
|
|
1346
|
-
current = clamp(current, p.minValue, p.maxValue);
|
|
1347
|
-
setNumberValue(current);
|
|
1348
|
-
setInputValueInternal(formatNumber(current));
|
|
1349
|
-
p.onChange?.(current);
|
|
1350
|
-
};
|
|
1351
|
-
const incrementToMax = () => {
|
|
1352
|
-
ensureInitialized();
|
|
1353
|
-
const p = getProps();
|
|
1354
|
-
if (p.isDisabled || p.isReadOnly) return;
|
|
1355
|
-
if (p.maxValue == null) return;
|
|
1356
|
-
const snapped = snapToStep(p.maxValue, step(), p.minValue);
|
|
1357
|
-
setNumberValue(snapped);
|
|
1358
|
-
setInputValueInternal(formatNumber(snapped));
|
|
1359
|
-
p.onChange?.(snapped);
|
|
1360
|
-
};
|
|
1361
|
-
const decrementToMin = () => {
|
|
1362
|
-
ensureInitialized();
|
|
1363
|
-
const p = getProps();
|
|
1364
|
-
if (p.isDisabled || p.isReadOnly) return;
|
|
1365
|
-
if (p.minValue == null) return;
|
|
1366
|
-
setNumberValue(p.minValue);
|
|
1367
|
-
setInputValueInternal(formatNumber(p.minValue));
|
|
1368
|
-
p.onChange?.(p.minValue);
|
|
1369
|
-
};
|
|
1370
|
-
return {
|
|
1371
|
-
get inputValue() {
|
|
1372
|
-
ensureInitialized();
|
|
1373
|
-
return inputValue;
|
|
1374
|
-
},
|
|
1375
|
-
get numberValue() {
|
|
1376
|
-
return actualNumberValue;
|
|
1377
|
-
},
|
|
1378
|
-
canIncrement,
|
|
1379
|
-
canDecrement,
|
|
1380
|
-
isDisabled: () => getProps().isDisabled ?? false,
|
|
1381
|
-
isReadOnly: () => getProps().isReadOnly ?? false,
|
|
1382
|
-
minValue: () => getProps().minValue,
|
|
1383
|
-
maxValue: () => getProps().maxValue,
|
|
1384
|
-
setInputValue,
|
|
1385
|
-
validate,
|
|
1386
|
-
commit,
|
|
1387
|
-
increment,
|
|
1388
|
-
decrement,
|
|
1389
|
-
incrementToMax,
|
|
1390
|
-
decrementToMin
|
|
1391
|
-
};
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
|
-
// ../solid-stately/src/searchfield/createSearchFieldState.ts
|
|
1395
|
-
import { createSignal as createSignal5, createMemo as createMemo2 } from "solid-js";
|
|
1396
|
-
function createSearchFieldState(props) {
|
|
1397
|
-
const getProps = () => access(props);
|
|
1398
|
-
const isControlled = () => getProps().value !== void 0;
|
|
1399
|
-
const [internalValue, setInternalValue] = createSignal5(
|
|
1400
|
-
getProps().defaultValue ?? ""
|
|
1401
|
-
);
|
|
1402
|
-
const value = createMemo2(() => {
|
|
1403
|
-
const p = getProps();
|
|
1404
|
-
return isControlled() ? p.value ?? "" : internalValue();
|
|
1405
|
-
});
|
|
1406
|
-
const setValue = (newValue) => {
|
|
1407
|
-
const p = getProps();
|
|
1408
|
-
if (!isControlled()) {
|
|
1409
|
-
setInternalValue(newValue);
|
|
1410
|
-
}
|
|
1411
|
-
p.onChange?.(newValue);
|
|
1412
|
-
};
|
|
1413
|
-
return {
|
|
1414
|
-
value,
|
|
1415
|
-
setValue
|
|
1416
|
-
};
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
// ../solid-stately/src/slider/createSliderState.ts
|
|
1420
|
-
import { createSignal as createSignal6, createMemo as createMemo3 } from "solid-js";
|
|
1421
|
-
var DEFAULT_MIN = 0;
|
|
1422
|
-
var DEFAULT_MAX = 100;
|
|
1423
|
-
var DEFAULT_STEP = 1;
|
|
1424
|
-
function clamp2(value, min, max) {
|
|
1425
|
-
return Math.min(Math.max(value, min), max);
|
|
1426
|
-
}
|
|
1427
|
-
function snapToStep2(value, min, max, step) {
|
|
1428
|
-
const snapped = Math.round((value - min) / step) * step + min;
|
|
1429
|
-
const decimalPlaces = (step.toString().split(".")[1] || "").length;
|
|
1430
|
-
const rounded = parseFloat(snapped.toFixed(decimalPlaces));
|
|
1431
|
-
return clamp2(rounded, min, max);
|
|
1432
|
-
}
|
|
1433
|
-
function createSliderState(props) {
|
|
1434
|
-
const getProps = () => access(props);
|
|
1435
|
-
const minValue = getProps().minValue ?? DEFAULT_MIN;
|
|
1436
|
-
const maxValue = getProps().maxValue ?? DEFAULT_MAX;
|
|
1437
|
-
const step = getProps().step ?? DEFAULT_STEP;
|
|
1438
|
-
const orientation = getProps().orientation ?? "horizontal";
|
|
1439
|
-
const isDisabled = getProps().isDisabled ?? false;
|
|
1440
|
-
const pageStep = Math.max(step, snapToStep2((maxValue - minValue) / 10, 0, maxValue - minValue, step));
|
|
1441
|
-
const isControlled = () => getProps().value !== void 0;
|
|
1442
|
-
const [internalValue, setInternalValue] = createSignal6(
|
|
1443
|
-
snapToStep2(getProps().defaultValue ?? minValue, minValue, maxValue, step)
|
|
1444
|
-
);
|
|
1445
|
-
const [isDragging, setIsDragging] = createSignal6(false);
|
|
1446
|
-
const [isFocused, setIsFocused] = createSignal6(false);
|
|
1447
|
-
const value = createMemo3(() => {
|
|
1448
|
-
const p = getProps();
|
|
1449
|
-
const rawValue = isControlled() ? p.value ?? minValue : internalValue();
|
|
1450
|
-
return snapToStep2(rawValue, minValue, maxValue, step);
|
|
1451
|
-
});
|
|
1452
|
-
const getValuePercent = createMemo3(() => {
|
|
1453
|
-
return (value() - minValue) / (maxValue - minValue);
|
|
1454
|
-
});
|
|
1455
|
-
const getFormattedValue = createMemo3(() => {
|
|
1456
|
-
const p = getProps();
|
|
1457
|
-
const formatter = new Intl.NumberFormat(p.locale, p.formatOptions);
|
|
1458
|
-
return formatter.format(value());
|
|
1459
|
-
});
|
|
1460
|
-
const setValue = (newValue) => {
|
|
1461
|
-
if (isDisabled) return;
|
|
1462
|
-
const p = getProps();
|
|
1463
|
-
const snappedValue = snapToStep2(newValue, minValue, maxValue, step);
|
|
1464
|
-
if (!isControlled()) {
|
|
1465
|
-
setInternalValue(snappedValue);
|
|
1466
|
-
}
|
|
1467
|
-
p.onChange?.(snappedValue);
|
|
1468
|
-
};
|
|
1469
|
-
const setValuePercent = (percent) => {
|
|
1470
|
-
const clampedPercent = clamp2(percent, 0, 1);
|
|
1471
|
-
const newValue = clampedPercent * (maxValue - minValue) + minValue;
|
|
1472
|
-
setValue(newValue);
|
|
1473
|
-
};
|
|
1474
|
-
const setDragging = (dragging) => {
|
|
1475
|
-
const wasDragging = isDragging();
|
|
1476
|
-
setIsDragging(dragging);
|
|
1477
|
-
if (wasDragging && !dragging) {
|
|
1478
|
-
getProps().onChangeEnd?.(value());
|
|
1479
|
-
}
|
|
1480
|
-
};
|
|
1481
|
-
const increment = (stepMultiplier = 1) => {
|
|
1482
|
-
if (isDisabled) return;
|
|
1483
|
-
setValue(value() + step * stepMultiplier);
|
|
1484
|
-
};
|
|
1485
|
-
const decrement = (stepMultiplier = 1) => {
|
|
1486
|
-
if (isDisabled) return;
|
|
1487
|
-
setValue(value() - step * stepMultiplier);
|
|
1488
|
-
};
|
|
1489
|
-
const setFocused = (focused) => {
|
|
1490
|
-
setIsFocused(focused);
|
|
1491
|
-
};
|
|
1492
|
-
return {
|
|
1493
|
-
value,
|
|
1494
|
-
setValue,
|
|
1495
|
-
setValuePercent,
|
|
1496
|
-
getValuePercent,
|
|
1497
|
-
getFormattedValue,
|
|
1498
|
-
isDragging,
|
|
1499
|
-
setDragging,
|
|
1500
|
-
isFocused,
|
|
1501
|
-
setFocused,
|
|
1502
|
-
increment,
|
|
1503
|
-
decrement,
|
|
1504
|
-
minValue,
|
|
1505
|
-
maxValue,
|
|
1506
|
-
step,
|
|
1507
|
-
pageStep,
|
|
1508
|
-
orientation,
|
|
1509
|
-
isDisabled
|
|
1510
|
-
};
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
// src/textfield/index.tsx
|
|
1150
|
+
import { createTextFieldState } from "@proyecto-viviana/solid-stately";
|
|
1514
1151
|
var _tmpl$15 = /* @__PURE__ */ _$template13(`<span class="text-danger-400 ml-0.5">*`);
|
|
1515
1152
|
var _tmpl$211 = /* @__PURE__ */ _$template13(`<label><!$><!/><!$><!/>`);
|
|
1516
1153
|
var _tmpl$38 = /* @__PURE__ */ _$template13(`<p>`);
|
|
@@ -1768,7 +1405,7 @@ import { insert as _$insert13 } from "solid-js/web";
|
|
|
1768
1405
|
import { memo as _$memo10 } from "solid-js/web";
|
|
1769
1406
|
import { spread as _$spread3 } from "solid-js/web";
|
|
1770
1407
|
import { mergeProps as _$mergeProps10 } from "solid-js/web";
|
|
1771
|
-
import { splitProps as splitProps10, Show as Show10, createMemo
|
|
1408
|
+
import { splitProps as splitProps10, Show as Show10, createMemo } from "solid-js";
|
|
1772
1409
|
import { createProgressBar } from "@proyecto-viviana/solidaria";
|
|
1773
1410
|
var _tmpl$16 = /* @__PURE__ */ _$template14(`<span class="text-primary-200 font-medium">`);
|
|
1774
1411
|
var _tmpl$212 = /* @__PURE__ */ _$template14(`<span class=text-primary-300>`);
|
|
@@ -1795,7 +1432,7 @@ var variantStyles5 = {
|
|
|
1795
1432
|
warning: "bg-yellow-500",
|
|
1796
1433
|
danger: "bg-red-500"
|
|
1797
1434
|
};
|
|
1798
|
-
function
|
|
1435
|
+
function clamp(value, min, max) {
|
|
1799
1436
|
return Math.min(Math.max(value, min), max);
|
|
1800
1437
|
}
|
|
1801
1438
|
function ProgressBar(props) {
|
|
@@ -1827,14 +1464,14 @@ function ProgressBar(props) {
|
|
|
1827
1464
|
return ariaProps["aria-label"];
|
|
1828
1465
|
}
|
|
1829
1466
|
});
|
|
1830
|
-
const percentage =
|
|
1467
|
+
const percentage = createMemo(() => {
|
|
1831
1468
|
if (isIndeterminate()) {
|
|
1832
1469
|
return void 0;
|
|
1833
1470
|
}
|
|
1834
1471
|
const value = ariaProps.value ?? 0;
|
|
1835
1472
|
const minValue = ariaProps.minValue ?? 0;
|
|
1836
1473
|
const maxValue = ariaProps.maxValue ?? 100;
|
|
1837
|
-
const clampedValue =
|
|
1474
|
+
const clampedValue = clamp(value, minValue, maxValue);
|
|
1838
1475
|
return (clampedValue - minValue) / (maxValue - minValue) * 100;
|
|
1839
1476
|
});
|
|
1840
1477
|
const valueText = () => progressAria.progressBarProps["aria-valuetext"];
|
|
@@ -1899,7 +1536,7 @@ import { getNextElement as _$getNextElement15 } from "solid-js/web";
|
|
|
1899
1536
|
import { runHydrationEvents as _$runHydrationEvents7 } from "solid-js/web";
|
|
1900
1537
|
import { spread as _$spread4 } from "solid-js/web";
|
|
1901
1538
|
import { mergeProps as _$mergeProps11 } from "solid-js/web";
|
|
1902
|
-
import { splitProps as splitProps11, createMemo as
|
|
1539
|
+
import { splitProps as splitProps11, createMemo as createMemo2, Show as Show11 } from "solid-js";
|
|
1903
1540
|
import { createSeparator } from "@proyecto-viviana/solidaria";
|
|
1904
1541
|
var _tmpl$17 = /* @__PURE__ */ _$template15(`<div>`);
|
|
1905
1542
|
var _tmpl$213 = /* @__PURE__ */ _$template15(`<hr>`);
|
|
@@ -1923,7 +1560,7 @@ function Separator(props) {
|
|
|
1923
1560
|
const orientation = () => local.orientation ?? "horizontal";
|
|
1924
1561
|
const variant = () => local.variant ?? "default";
|
|
1925
1562
|
const size = () => local.size ?? "md";
|
|
1926
|
-
const elementType =
|
|
1563
|
+
const elementType = createMemo2(() => {
|
|
1927
1564
|
if (orientation() === "vertical") {
|
|
1928
1565
|
return "div";
|
|
1929
1566
|
}
|
|
@@ -1940,7 +1577,7 @@ function Separator(props) {
|
|
|
1940
1577
|
return ariaProps["aria-label"];
|
|
1941
1578
|
}
|
|
1942
1579
|
});
|
|
1943
|
-
const className =
|
|
1580
|
+
const className = createMemo2(() => {
|
|
1944
1581
|
const isVertical = orientation() === "vertical";
|
|
1945
1582
|
const sizeStyles33 = isVertical ? verticalSizeStyles : horizontalSizeStyles;
|
|
1946
1583
|
const base = [
|
|
@@ -2040,7 +1677,7 @@ import { addEventListener as _$addEventListener3 } from "solid-js/web";
|
|
|
2040
1677
|
import { setProperty as _$setProperty } from "solid-js/web";
|
|
2041
1678
|
import { effect as _$effect14 } from "solid-js/web";
|
|
2042
1679
|
import { use as _$use2 } from "solid-js/web";
|
|
2043
|
-
import { splitProps as splitProps13, createMemo as
|
|
1680
|
+
import { splitProps as splitProps13, createMemo as createMemo3, Show as Show12, For } from "solid-js";
|
|
2044
1681
|
import { Autocomplete, useAutocompleteInput, useAutocompleteCollection, useAutocompleteState } from "@proyecto-viviana/solidaria-components";
|
|
2045
1682
|
var _tmpl$18 = /* @__PURE__ */ _$template16(`<input type=text>`);
|
|
2046
1683
|
var _tmpl$214 = /* @__PURE__ */ _$template16(`<ul role=listbox>`);
|
|
@@ -2118,7 +1755,7 @@ function AutocompleteList(props) {
|
|
|
2118
1755
|
const state = useAutocompleteState();
|
|
2119
1756
|
if (!ctx) return null;
|
|
2120
1757
|
const styles = () => sizeStyles11[props.size];
|
|
2121
|
-
const filteredItems =
|
|
1758
|
+
const filteredItems = createMemo3(() => {
|
|
2122
1759
|
if (!ctx.filter) return props.items;
|
|
2123
1760
|
return props.items.filter((item) => {
|
|
2124
1761
|
const textValue = String(item[props.textKey] ?? item.name ?? "");
|
|
@@ -3090,6 +2727,7 @@ import { effect as _$effect19 } from "solid-js/web";
|
|
|
3090
2727
|
import { getNextElement as _$getNextElement21 } from "solid-js/web";
|
|
3091
2728
|
import { splitProps as splitProps19, mergeProps as solidMergeProps5, Show as Show15 } from "solid-js";
|
|
3092
2729
|
import { createNumberField, createFocusRing as createFocusRing2, createPress, createHover } from "@proyecto-viviana/solidaria";
|
|
2730
|
+
import { createNumberFieldState } from "@proyecto-viviana/solid-stately";
|
|
3093
2731
|
var _tmpl$31 = /* @__PURE__ */ _$template21(`<svg viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=2><path d="M8 3v10M3 8h10">`);
|
|
3094
2732
|
var _tmpl$218 = /* @__PURE__ */ _$template21(`<svg viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=2><path d="M3 8h10">`);
|
|
3095
2733
|
var _tmpl$314 = /* @__PURE__ */ _$template21(`<span class="text-danger-500 ml-1">*`);
|
|
@@ -3546,6 +3184,7 @@ import { effect as _$effect20 } from "solid-js/web";
|
|
|
3546
3184
|
import { getNextElement as _$getNextElement22 } from "solid-js/web";
|
|
3547
3185
|
import { splitProps as splitProps20, mergeProps as solidMergeProps6, Show as Show16 } from "solid-js";
|
|
3548
3186
|
import { createSearchField, createFocusRing as createFocusRing3, createPress as createPress2, createHover as createHover2 } from "@proyecto-viviana/solidaria";
|
|
3187
|
+
import { createSearchFieldState } from "@proyecto-viviana/solid-stately";
|
|
3549
3188
|
var _tmpl$40 = /* @__PURE__ */ _$template22(`<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>`);
|
|
3550
3189
|
var _tmpl$219 = /* @__PURE__ */ _$template22(`<svg viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=2><path d="M4 4L12 12M12 4L4 12"stroke-linecap=round>`);
|
|
3551
3190
|
var _tmpl$315 = /* @__PURE__ */ _$template22(`<span class="text-danger-500 ml-1">*`);
|
|
@@ -3975,6 +3614,7 @@ import { mergeProps as _$mergeProps21 } from "solid-js/web";
|
|
|
3975
3614
|
import { memo as _$memo18 } from "solid-js/web";
|
|
3976
3615
|
import { splitProps as splitProps21, mergeProps as solidMergeProps7, Show as Show17 } from "solid-js";
|
|
3977
3616
|
import { createSlider, createFocusRing as createFocusRing4, createHover as createHover3 } from "@proyecto-viviana/solidaria";
|
|
3617
|
+
import { createSliderState } from "@proyecto-viviana/solid-stately";
|
|
3978
3618
|
var _tmpl$41 = /* @__PURE__ */ _$template23(`<span>`);
|
|
3979
3619
|
var _tmpl$220 = /* @__PURE__ */ _$template23(`<output>`);
|
|
3980
3620
|
var _tmpl$316 = /* @__PURE__ */ _$template23(`<div><!$><!/><!$><!/>`);
|
|
@@ -4938,7 +4578,7 @@ import { insert as _$insert23 } from "solid-js/web";
|
|
|
4938
4578
|
import { memo as _$memo22 } from "solid-js/web";
|
|
4939
4579
|
import { spread as _$spread8 } from "solid-js/web";
|
|
4940
4580
|
import { mergeProps as _$mergeProps25 } from "solid-js/web";
|
|
4941
|
-
import { splitProps as splitProps25, Show as Show21, createMemo as
|
|
4581
|
+
import { splitProps as splitProps25, Show as Show21, createMemo as createMemo4 } from "solid-js";
|
|
4942
4582
|
import { createMeter } from "@proyecto-viviana/solidaria";
|
|
4943
4583
|
var _tmpl$61 = /* @__PURE__ */ _$template27(`<span class="text-primary-200 font-medium">`);
|
|
4944
4584
|
var _tmpl$223 = /* @__PURE__ */ _$template27(`<span class=text-primary-300>`);
|
|
@@ -4966,7 +4606,7 @@ var variantStyles12 = {
|
|
|
4966
4606
|
danger: "bg-red-500",
|
|
4967
4607
|
info: "bg-blue-500"
|
|
4968
4608
|
};
|
|
4969
|
-
function
|
|
4609
|
+
function clamp2(value, min, max) {
|
|
4970
4610
|
return Math.min(Math.max(value, min), max);
|
|
4971
4611
|
}
|
|
4972
4612
|
function Meter(props) {
|
|
@@ -4994,11 +4634,11 @@ function Meter(props) {
|
|
|
4994
4634
|
return ariaProps["aria-label"];
|
|
4995
4635
|
}
|
|
4996
4636
|
});
|
|
4997
|
-
const percentage =
|
|
4637
|
+
const percentage = createMemo4(() => {
|
|
4998
4638
|
const value = ariaProps.value ?? 0;
|
|
4999
4639
|
const minValue = ariaProps.minValue ?? 0;
|
|
5000
4640
|
const maxValue = ariaProps.maxValue ?? 100;
|
|
5001
|
-
const clampedValue =
|
|
4641
|
+
const clampedValue = clamp2(value, minValue, maxValue);
|
|
5002
4642
|
return (clampedValue - minValue) / (maxValue - minValue) * 100;
|
|
5003
4643
|
});
|
|
5004
4644
|
const valueText = () => meterAria.meterProps["aria-valuetext"];
|
|
@@ -8579,4 +8219,4 @@ export {
|
|
|
8579
8219
|
useLandmarkController,
|
|
8580
8220
|
useToastContext
|
|
8581
8221
|
};
|
|
8582
|
-
//# sourceMappingURL=index.js.map
|
|
8222
|
+
//# sourceMappingURL=index.js.map
|