slexkit 0.3.0 → 0.3.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/CHANGELOG.md +30 -0
- package/README.md +4 -3
- package/README.zh-CN.md +4 -3
- package/dist/ai/llms-components.txt +2 -1
- package/dist/ai/llms-full.txt +85 -42
- package/dist/ai/llms-runtime.txt +11 -12
- package/dist/ai/llms.txt +1 -1
- package/dist/ai/slexkit-ai-manifest.json +77 -73
- package/dist/base.css +0 -46
- package/dist/components/checkbox.js +1 -0
- package/dist/components/choice.css +2 -2
- package/dist/components/display.css +1 -1
- package/dist/components/index.js +56 -153
- package/dist/components/input.css +53 -119
- package/dist/components/input.js +33 -143
- package/dist/components/radio-group.js +1 -0
- package/dist/components/select.css +0 -6
- package/dist/components/slider.css +27 -18
- package/dist/components/specs.js +2 -1
- package/dist/components/switch.css +3 -3
- package/dist/components/switch.js +1 -0
- package/dist/components/text-input.css +21 -90
- package/dist/components/text.js +12 -0
- package/dist/components/tooling.css +0 -1
- package/dist/runtime.cjs +67 -28
- package/dist/runtime.js +67 -28
- package/dist/slexkit.cjs +123 -181
- package/dist/slexkit.css +54 -167
- package/dist/slexkit.js +123 -181
- package/dist/types/engine/types.d.ts +1 -1
- package/dist/types/version.d.ts +2 -2
- package/dist/umd/slexkit.tooling.umd.js +122 -181
- package/dist/umd/slexkit.umd.js +123 -181
- package/package.json +3 -2
- package/skills/slexkit-host-integration/SKILL.md +1 -1
- package/src/components/svelte/display/Text.svelte +14 -1
- package/src/components/svelte/input/Checkbox.svelte +1 -1
- package/src/components/svelte/input/Input.svelte +0 -110
- package/src/components/svelte/input/RadioGroup.svelte +1 -1
- package/src/components/svelte/input/Switch.svelte +1 -1
- package/src/styles/components/choice.css +2 -2
- package/src/styles/components/select.css +0 -6
- package/src/styles/components/slider.css +27 -18
- package/src/styles/components/switch.css +3 -3
- package/src/styles/components/text-input.css +21 -90
- package/src/styles/display.css +1 -1
- package/src/styles/layout.css +0 -46
- package/src/styles/tooling.css +0 -1
package/dist/slexkit.cjs
CHANGED
|
@@ -490,19 +490,31 @@ function configureComponentScope(options) {
|
|
|
490
490
|
function createComponentAccessor(read) {
|
|
491
491
|
const subscribers = new Set;
|
|
492
492
|
let current = read();
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
493
|
+
let stopEffect;
|
|
494
|
+
const start = () => {
|
|
495
|
+
if (stopEffect)
|
|
496
|
+
return;
|
|
497
|
+
stopEffect = createEffect(() => {
|
|
498
498
|
current = read();
|
|
499
|
-
for (const subscriber of subscribers)
|
|
499
|
+
for (const subscriber of Array.from(subscribers))
|
|
500
500
|
subscriber(current);
|
|
501
501
|
flushDom?.();
|
|
502
502
|
});
|
|
503
|
+
};
|
|
504
|
+
const accessor = () => current;
|
|
505
|
+
accessor.subscribe = (run) => {
|
|
506
|
+
const wasIdle = subscribers.size === 0;
|
|
507
|
+
subscribers.add(run);
|
|
508
|
+
if (wasIdle)
|
|
509
|
+
start();
|
|
510
|
+
else
|
|
511
|
+
run(current);
|
|
503
512
|
return () => {
|
|
504
513
|
subscribers.delete(run);
|
|
505
|
-
|
|
514
|
+
if (subscribers.size === 0) {
|
|
515
|
+
stopEffect?.();
|
|
516
|
+
stopEffect = undefined;
|
|
517
|
+
}
|
|
506
518
|
};
|
|
507
519
|
};
|
|
508
520
|
return accessor;
|
|
@@ -783,6 +795,9 @@ function isWritableComponent(type) {
|
|
|
783
795
|
const mode = getComponentStateMode(type);
|
|
784
796
|
return mode === "value" || mode === "checked" || mode === "enabled";
|
|
785
797
|
}
|
|
798
|
+
function isReadableComponent(type) {
|
|
799
|
+
return getComponentStateMode(type) === "readable";
|
|
800
|
+
}
|
|
786
801
|
function isStatefulComponent(type) {
|
|
787
802
|
return getComponentStateMode(type) !== "none";
|
|
788
803
|
}
|
|
@@ -899,7 +914,10 @@ function createGProxy(g, components, componentTypes) {
|
|
|
899
914
|
function ensureComponentState(name, type, components, componentTypes) {
|
|
900
915
|
if (!components[name])
|
|
901
916
|
components[name] = {};
|
|
902
|
-
componentTypes[name]
|
|
917
|
+
const previousType = componentTypes[name] ?? "";
|
|
918
|
+
if (!(isWritableComponent(previousType) && isReadableComponent(type))) {
|
|
919
|
+
componentTypes[name] = type;
|
|
920
|
+
}
|
|
903
921
|
return components[name];
|
|
904
922
|
}
|
|
905
923
|
function syncReadableComponentProp(type, state, propName, value) {
|
|
@@ -927,6 +945,9 @@ function syncReadableComponentProp(type, state, propName, value) {
|
|
|
927
945
|
function syncComponentProps(type, name, props, components, componentTypes) {
|
|
928
946
|
if (!name || !isStatefulComponent(type))
|
|
929
947
|
return;
|
|
948
|
+
const previousType = componentTypes[name] ?? "";
|
|
949
|
+
if (isWritableComponent(previousType) && isReadableComponent(type))
|
|
950
|
+
return;
|
|
930
951
|
const state = ensureComponentState(name, type, components, componentTypes);
|
|
931
952
|
if (type === "input" && typeof props.type === "string") {
|
|
932
953
|
assignInputType(state, props.type);
|
|
@@ -991,7 +1012,7 @@ function seedStaticComponentState(type, state, props) {
|
|
|
991
1012
|
function warnDuplicateState(ns, name, currentType, currentPath, previous) {
|
|
992
1013
|
console.warn(`[SlexKit][${ns}] Component state '${name}' is declared more than once at ${previous.path} and ${currentPath}; state is shared by namespace and component name.`);
|
|
993
1014
|
if (previous.type !== currentType) {
|
|
994
|
-
console.warn(`[SlexKit][${ns}] Component state '${name}' is used by multiple component types (${previous.type}, ${currentType});
|
|
1015
|
+
console.warn(`[SlexKit][${ns}] Component state '${name}' is used by multiple component types (${previous.type}, ${currentType}); use distinct names when components should not share state.`);
|
|
995
1016
|
}
|
|
996
1017
|
}
|
|
997
1018
|
function dynamicStateBinding(type, props) {
|
|
@@ -1003,6 +1024,9 @@ function isMirroredValueControlPair(previousType, currentType) {
|
|
|
1003
1024
|
return previousType === "input" && currentType === "slider" || previousType === "slider" && currentType === "input";
|
|
1004
1025
|
}
|
|
1005
1026
|
function shouldWarnDuplicateState(currentType, currentBinding, previous) {
|
|
1027
|
+
if (isReadableComponent(previous.type) && isReadableComponent(currentType)) {
|
|
1028
|
+
return false;
|
|
1029
|
+
}
|
|
1006
1030
|
if (currentBinding && previous.stateBinding === currentBinding && isMirroredValueControlPair(previous.type, currentType)) {
|
|
1007
1031
|
return false;
|
|
1008
1032
|
}
|
|
@@ -1341,9 +1365,10 @@ function renderForNode(fullKey, props, container, g, components, componentTypes,
|
|
|
1341
1365
|
const renderer = getRenderer(type);
|
|
1342
1366
|
if (!renderer)
|
|
1343
1367
|
return;
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1346
|
-
|
|
1368
|
+
const doc = container.ownerDocument || document;
|
|
1369
|
+
const startAnchor = doc.createComment(`slexkit-for:${fullKey}:start`);
|
|
1370
|
+
const endAnchor = doc.createComment(`slexkit-for:${fullKey}:end`);
|
|
1371
|
+
container.append(startAnchor, endAnchor);
|
|
1347
1372
|
const evalCtx = buildComponentEvalContext(g, components, componentTypes, api, forCtx);
|
|
1348
1373
|
const items = createMemo(() => trackForCollection(evalRead(props.$for, evalCtx, ns, `${fullKey}:$for`)));
|
|
1349
1374
|
const $keyProp = props.$key;
|
|
@@ -1356,8 +1381,10 @@ function renderForNode(fullKey, props, container, g, components, componentTypes,
|
|
|
1356
1381
|
disposedSlots.add(slot);
|
|
1357
1382
|
leavingSlots.delete(slot);
|
|
1358
1383
|
callHook(g, name, "onUnmount");
|
|
1359
|
-
|
|
1360
|
-
|
|
1384
|
+
if (slot.el) {
|
|
1385
|
+
disposeComponent(slot.el);
|
|
1386
|
+
slot.el.remove();
|
|
1387
|
+
}
|
|
1361
1388
|
if (slot.dispose)
|
|
1362
1389
|
slot.dispose();
|
|
1363
1390
|
};
|
|
@@ -1382,12 +1409,16 @@ function renderForNode(fullKey, props, container, g, components, componentTypes,
|
|
|
1382
1409
|
}
|
|
1383
1410
|
}
|
|
1384
1411
|
for (const slot of deletedSlots) {
|
|
1385
|
-
container.appendChild(slot.el);
|
|
1386
1412
|
leavingSlots.add(slot);
|
|
1413
|
+
if (!slot.el) {
|
|
1414
|
+
disposeSlot(slot);
|
|
1415
|
+
continue;
|
|
1416
|
+
}
|
|
1387
1417
|
applyLeaveAnimation(slot.el, slot.props, () => {
|
|
1388
1418
|
disposeSlot(slot);
|
|
1389
1419
|
});
|
|
1390
1420
|
}
|
|
1421
|
+
let cursor = startAnchor;
|
|
1391
1422
|
arr.forEach((item, index) => {
|
|
1392
1423
|
item = asReactiveValue(item, g);
|
|
1393
1424
|
const keyVal = newKeys[index];
|
|
@@ -1415,20 +1446,22 @@ function renderForNode(fullKey, props, container, g, components, componentTypes,
|
|
|
1415
1446
|
const indexSignal = createSignal(index);
|
|
1416
1447
|
const revisionSignal = createSignal(0);
|
|
1417
1448
|
slot = renderAndMountSlot(item, index, keyVal, indexSignal, revisionSignal, renderer, type, name, props, container, g, components, componentTypes, api, forCtx, ns, fullKey, options);
|
|
1418
|
-
if (slot.el) {
|
|
1419
|
-
|
|
1420
|
-
|
|
1449
|
+
if (!slot.el) {
|
|
1450
|
+
disposeSlot(slot);
|
|
1451
|
+
return;
|
|
1421
1452
|
}
|
|
1453
|
+
applyEnterAnimation(slot.el, slot.props);
|
|
1454
|
+
callHook(g, name, "onMount");
|
|
1422
1455
|
slotMap.set(keyVal, slot);
|
|
1423
1456
|
}
|
|
1424
|
-
const
|
|
1425
|
-
if (slot.el &&
|
|
1426
|
-
|
|
1457
|
+
const nextChild = cursor.nextSibling;
|
|
1458
|
+
if (slot.el && nextChild !== slot.el) {
|
|
1459
|
+
container.insertBefore(slot.el, nextChild ?? endAnchor);
|
|
1460
|
+
}
|
|
1461
|
+
if (slot.el) {
|
|
1462
|
+
cursor = slot.el;
|
|
1427
1463
|
}
|
|
1428
1464
|
});
|
|
1429
|
-
while (forWrapper.children.length > arr.length) {
|
|
1430
|
-
forWrapper.lastChild.remove();
|
|
1431
|
-
}
|
|
1432
1465
|
});
|
|
1433
1466
|
onCleanup(() => {
|
|
1434
1467
|
for (const slot of Array.from(slotMap.values()))
|
|
@@ -1436,7 +1469,8 @@ function renderForNode(fullKey, props, container, g, components, componentTypes,
|
|
|
1436
1469
|
slotMap.clear();
|
|
1437
1470
|
for (const slot of Array.from(leavingSlots))
|
|
1438
1471
|
disposeSlot(slot);
|
|
1439
|
-
|
|
1472
|
+
startAnchor.remove();
|
|
1473
|
+
endAnchor.remove();
|
|
1440
1474
|
});
|
|
1441
1475
|
}
|
|
1442
1476
|
function renderNormalNode(fullKey, props, container, g, components, componentTypes, api, forCtx, ns, options) {
|
|
@@ -1813,7 +1847,7 @@ ${parseSource}
|
|
|
1813
1847
|
var parseSlexKitDsl = parseSlexSource;
|
|
1814
1848
|
|
|
1815
1849
|
// src/version.ts
|
|
1816
|
-
var SLEXKIT_VERSION = "0.3.
|
|
1850
|
+
var SLEXKIT_VERSION = "0.3.2";
|
|
1817
1851
|
var SLEX_PROTOCOL_VERSION = "0.1";
|
|
1818
1852
|
var SLEXKIT_COMPONENTS_VERSION = SLEXKIT_VERSION;
|
|
1819
1853
|
function getSlexKitInfo() {
|
|
@@ -2941,7 +2975,6 @@ var inputSpec = component({
|
|
|
2941
2975
|
min: { type: "string | number", dynamic: true, description: "Minimum value used by numeric input controls." },
|
|
2942
2976
|
max: { type: "string | number", dynamic: true, description: "Maximum value used by numeric input controls." },
|
|
2943
2977
|
step: { type: "string | number", dynamic: true, description: "Step size used by numeric input controls." },
|
|
2944
|
-
controls: { type: "boolean", default: true, dynamic: true, description: "Show decrement and increment buttons for numeric inputs." },
|
|
2945
2978
|
onchange: { type: "write-expression", description: "Write expression invoked when the value changes." }
|
|
2946
2979
|
},
|
|
2947
2980
|
children: noChildren,
|
|
@@ -3449,6 +3482,8 @@ var textSpec = component({
|
|
|
3449
3482
|
content: { type: "string", dynamic: true, description: "Alias for text." },
|
|
3450
3483
|
label: { type: "string", dynamic: true, description: "Alias for text." },
|
|
3451
3484
|
variant: { type: "string", values: ["default", "muted"], default: "default", description: "Text visual variant." },
|
|
3485
|
+
color: { type: "string", dynamic: true, description: "Optional CSS color for controlled previews." },
|
|
3486
|
+
size: { type: "string | number", dynamic: true, description: "Optional font size. Numbers are treated as px." },
|
|
3452
3487
|
class: { type: "string", description: "Additional host-controlled CSS class." }
|
|
3453
3488
|
},
|
|
3454
3489
|
children: noChildren,
|
|
@@ -3819,7 +3854,11 @@ function isRenderableSource(value) {
|
|
|
3819
3854
|
return Object.keys(value).some((key) => key.includes(":"));
|
|
3820
3855
|
}
|
|
3821
3856
|
function bareLayoutFromSource(value) {
|
|
3822
|
-
const
|
|
3857
|
+
const layout = { ...value };
|
|
3858
|
+
delete layout.slex;
|
|
3859
|
+
delete layout.namespace;
|
|
3860
|
+
delete layout.g;
|
|
3861
|
+
delete layout.layout;
|
|
3823
3862
|
return layout;
|
|
3824
3863
|
}
|
|
3825
3864
|
function isStateOnlySource(value) {
|
|
@@ -12590,6 +12629,7 @@ function Checkbox($$anchor, $$props) {
|
|
|
12590
12629
|
reset(label2);
|
|
12591
12630
|
reset(span);
|
|
12592
12631
|
template_effect(($0, $1) => {
|
|
12632
|
+
set_attribute2(label2, "data-disabled", get2(p).disabled ? "true" : undefined);
|
|
12593
12633
|
input.disabled = !!get2(p).disabled;
|
|
12594
12634
|
set_attribute2(input, "data-state", get2(checked) ? "checked" : "unchecked");
|
|
12595
12635
|
set_attribute2(input, "aria-label", $0);
|
|
@@ -12665,6 +12705,7 @@ function Switch($$anchor, $$props) {
|
|
|
12665
12705
|
reset(span);
|
|
12666
12706
|
template_effect(($0, $1) => {
|
|
12667
12707
|
set_attribute2(label2, "data-state", get2(enabled) ? "on" : "off");
|
|
12708
|
+
set_attribute2(label2, "data-disabled", get2(p).disabled ? "true" : undefined);
|
|
12668
12709
|
input.disabled = !!get2(p).disabled;
|
|
12669
12710
|
set_attribute2(input, "aria-label", $0);
|
|
12670
12711
|
set_text(text_1, $1);
|
|
@@ -12685,26 +12726,11 @@ delegate(["pointerdown", "click", "change"]);
|
|
|
12685
12726
|
var nextInputId = 0;
|
|
12686
12727
|
var root_14 = from_html(`<label class="slex-input-label"> </label>`);
|
|
12687
12728
|
var root_2 = from_html(`<span class="slex-input-unit" aria-hidden="true"> </span>`);
|
|
12688
|
-
var root_33 = from_html(`<
|
|
12689
|
-
var root_4 = from_html(`<div class="slex-input-
|
|
12690
|
-
var
|
|
12691
|
-
var root8 = from_html(`<div class="slex-input-field"><!> <div class="slex-input-control"><input class="slex-input"/> <!> <!></div> <!> <!></div>`);
|
|
12729
|
+
var root_33 = from_html(`<div class="slex-input-description"> </div>`);
|
|
12730
|
+
var root_4 = from_html(`<div class="slex-input-error" role="alert"> </div>`);
|
|
12731
|
+
var root8 = from_html(`<div class="slex-input-field"><!> <div class="slex-input-control"><input class="slex-input"/> <!></div> <!> <!></div>`);
|
|
12692
12732
|
function Input($$anchor, $$props) {
|
|
12693
12733
|
push($$props, true);
|
|
12694
|
-
const engineeringPrefixFactors = {
|
|
12695
|
-
p: 0.000000000001,
|
|
12696
|
-
n: 0.000000001,
|
|
12697
|
-
u: 0.000001,
|
|
12698
|
-
"µ": 0.000001,
|
|
12699
|
-
"碌": 0.000001,
|
|
12700
|
-
m: 0.001,
|
|
12701
|
-
k: 1000,
|
|
12702
|
-
K: 1000,
|
|
12703
|
-
M: 1e6,
|
|
12704
|
-
meg: 1e6,
|
|
12705
|
-
G: 1e9,
|
|
12706
|
-
T: 1000000000000
|
|
12707
|
-
};
|
|
12708
12734
|
let p = state(proxy({}));
|
|
12709
12735
|
let value = state("");
|
|
12710
12736
|
const fallbackId = `slex-input-${++nextInputId}`;
|
|
@@ -12716,8 +12742,6 @@ function Input($$anchor, $$props) {
|
|
|
12716
12742
|
const readonly = user_derived(() => bool(get2(p).readonly) || bool(get2(p).readOnly));
|
|
12717
12743
|
const required = user_derived(() => bool(get2(p).required));
|
|
12718
12744
|
const invalid2 = user_derived(() => bool(get2(p).invalid) || !!get2(errorText));
|
|
12719
|
-
const steppable = user_derived(isSteppableInput);
|
|
12720
|
-
const controls = user_derived(() => get2(steppable) && get2(p).controls !== false && get2(p).controls !== "false");
|
|
12721
12745
|
const componentId = user_derived(() => safeId($$props.componentName));
|
|
12722
12746
|
const inputId = user_derived(() => text2(get2(p).id) || (get2(componentId) ? `slex-input-${get2(componentId)}` : fallbackId));
|
|
12723
12747
|
const descriptionId = user_derived(() => `${get2(inputId)}-description`);
|
|
@@ -12728,10 +12752,6 @@ function Input($$anchor, $$props) {
|
|
|
12728
12752
|
get2(descriptionText) ? get2(descriptionId) : "",
|
|
12729
12753
|
get2(errorText) ? get2(errorId) : ""
|
|
12730
12754
|
].filter(Boolean).join(" "));
|
|
12731
|
-
const numericValue = user_derived(readNumericValue);
|
|
12732
|
-
const controlLabel = user_derived(() => get2(labelText) || text2(get2(p).placeholder) || $$props.componentName || "input");
|
|
12733
|
-
const decrementDisabled = user_derived(() => !canStep(-1));
|
|
12734
|
-
const incrementDisabled = user_derived(() => !canStep(1));
|
|
12735
12755
|
user_effect(() => bindPropStore($$props.props, (next2) => {
|
|
12736
12756
|
set(p, next2, true);
|
|
12737
12757
|
set(value, text2(next2.value), true);
|
|
@@ -12742,72 +12762,6 @@ function Input($$anchor, $$props) {
|
|
|
12742
12762
|
function inputType() {
|
|
12743
12763
|
return text2(get2(p).type, "text") === "engineering" ? "text" : text2(get2(p).type, "text");
|
|
12744
12764
|
}
|
|
12745
|
-
function isSteppableInput() {
|
|
12746
|
-
const kind = text2(get2(p).type, "text");
|
|
12747
|
-
return kind === "number" || kind === "engineering" || get2(p).min !== undefined || get2(p).max !== undefined || get2(p).step !== undefined;
|
|
12748
|
-
}
|
|
12749
|
-
function numericProp(input) {
|
|
12750
|
-
if (input === undefined || input === null || input === "")
|
|
12751
|
-
return;
|
|
12752
|
-
const next2 = Number(input);
|
|
12753
|
-
return Number.isFinite(next2) ? next2 : undefined;
|
|
12754
|
-
}
|
|
12755
|
-
function stepSize() {
|
|
12756
|
-
const next2 = numericProp(get2(p).step);
|
|
12757
|
-
if (next2 !== undefined && next2 > 0)
|
|
12758
|
-
return next2;
|
|
12759
|
-
if (text2(get2(p).type, "text") !== "engineering")
|
|
12760
|
-
return 1;
|
|
12761
|
-
const parsed = parseEngineeringNumber(get2(value));
|
|
12762
|
-
if (!parsed.valid || !parsed.prefix)
|
|
12763
|
-
return 1;
|
|
12764
|
-
return engineeringPrefixFactors[parsed.prefix] ?? 1;
|
|
12765
|
-
}
|
|
12766
|
-
function readNumericValue() {
|
|
12767
|
-
if (text2(get2(p).type, "text") === "engineering") {
|
|
12768
|
-
const parsed = parseEngineeringNumber(get2(value));
|
|
12769
|
-
return parsed.valid && parsed.number !== null ? parsed.number : null;
|
|
12770
|
-
}
|
|
12771
|
-
const next2 = Number(get2(value));
|
|
12772
|
-
return Number.isFinite(next2) ? next2 : null;
|
|
12773
|
-
}
|
|
12774
|
-
function clamp(next2) {
|
|
12775
|
-
const min = numericProp(get2(p).min);
|
|
12776
|
-
const max = numericProp(get2(p).max);
|
|
12777
|
-
let clamped = next2;
|
|
12778
|
-
if (min !== undefined)
|
|
12779
|
-
clamped = Math.max(min, clamped);
|
|
12780
|
-
if (max !== undefined)
|
|
12781
|
-
clamped = Math.min(max, clamped);
|
|
12782
|
-
return clamped;
|
|
12783
|
-
}
|
|
12784
|
-
function canStep(direction) {
|
|
12785
|
-
if (!get2(controls) || get2(disabled) || get2(readonly) || get2(numericValue) === null)
|
|
12786
|
-
return false;
|
|
12787
|
-
return clamp(get2(numericValue) + direction * stepSize()) !== get2(numericValue);
|
|
12788
|
-
}
|
|
12789
|
-
function formatSteppedValue(next2) {
|
|
12790
|
-
if (text2(get2(p).type, "text") !== "engineering")
|
|
12791
|
-
return text2(next2);
|
|
12792
|
-
const parsed = parseEngineeringNumber(get2(value));
|
|
12793
|
-
if (!parsed.valid)
|
|
12794
|
-
return text2(next2);
|
|
12795
|
-
const factor = parsed.prefix ? engineeringPrefixFactors[parsed.prefix] : undefined;
|
|
12796
|
-
const visibleNumber = factor ? next2 / factor : next2;
|
|
12797
|
-
return `${formatNumber2(visibleNumber)}${parsed.prefix}${parsed.unit}`;
|
|
12798
|
-
}
|
|
12799
|
-
function formatNumber2(next2) {
|
|
12800
|
-
return text2(Number(next2.toPrecision(12)));
|
|
12801
|
-
}
|
|
12802
|
-
function emitValue(nextValue) {
|
|
12803
|
-
set(value, nextValue, true);
|
|
12804
|
-
emit($$props.ctx, "change", text2(get2(p).type, "text") === "engineering" ? parseEngineeringNumber(get2(value)) : get2(value));
|
|
12805
|
-
}
|
|
12806
|
-
function stepBy(direction) {
|
|
12807
|
-
if (!canStep(direction) || get2(numericValue) === null)
|
|
12808
|
-
return;
|
|
12809
|
-
emitValue(formatSteppedValue(clamp(get2(numericValue) + direction * stepSize())));
|
|
12810
|
-
}
|
|
12811
12765
|
function update2(event2) {
|
|
12812
12766
|
if (get2(disabled) || get2(readonly))
|
|
12813
12767
|
return;
|
|
@@ -12833,9 +12787,9 @@ function Input($$anchor, $$props) {
|
|
|
12833
12787
|
});
|
|
12834
12788
|
}
|
|
12835
12789
|
var div_1 = sibling(node, 2);
|
|
12836
|
-
var
|
|
12837
|
-
remove_input_defaults(
|
|
12838
|
-
var node_1 = sibling(
|
|
12790
|
+
var input = child(div_1);
|
|
12791
|
+
remove_input_defaults(input);
|
|
12792
|
+
var node_1 = sibling(input, 2);
|
|
12839
12793
|
{
|
|
12840
12794
|
var consequent_1 = ($$anchor2) => {
|
|
12841
12795
|
var span = root_2();
|
|
@@ -12849,33 +12803,11 @@ function Input($$anchor, $$props) {
|
|
|
12849
12803
|
$$render(consequent_1);
|
|
12850
12804
|
});
|
|
12851
12805
|
}
|
|
12852
|
-
var node_2 = sibling(node_1, 2);
|
|
12853
|
-
{
|
|
12854
|
-
var consequent_2 = ($$anchor2) => {
|
|
12855
|
-
var span_1 = root_33();
|
|
12856
|
-
var button = child(span_1);
|
|
12857
|
-
var button_1 = sibling(button, 2);
|
|
12858
|
-
reset(span_1);
|
|
12859
|
-
template_effect(() => {
|
|
12860
|
-
set_attribute2(button, "aria-label", `Increase ${get2(controlLabel)}`);
|
|
12861
|
-
button.disabled = get2(incrementDisabled);
|
|
12862
|
-
set_attribute2(button_1, "aria-label", `Decrease ${get2(controlLabel)}`);
|
|
12863
|
-
button_1.disabled = get2(decrementDisabled);
|
|
12864
|
-
});
|
|
12865
|
-
delegated("click", button, () => stepBy(1));
|
|
12866
|
-
delegated("click", button_1, () => stepBy(-1));
|
|
12867
|
-
append($$anchor2, span_1);
|
|
12868
|
-
};
|
|
12869
|
-
if_block(node_2, ($$render) => {
|
|
12870
|
-
if (get2(controls))
|
|
12871
|
-
$$render(consequent_2);
|
|
12872
|
-
});
|
|
12873
|
-
}
|
|
12874
12806
|
reset(div_1);
|
|
12875
|
-
var
|
|
12807
|
+
var node_2 = sibling(div_1, 2);
|
|
12876
12808
|
{
|
|
12877
|
-
var
|
|
12878
|
-
var div_2 =
|
|
12809
|
+
var consequent_2 = ($$anchor2) => {
|
|
12810
|
+
var div_2 = root_33();
|
|
12879
12811
|
var text_3 = child(div_2, true);
|
|
12880
12812
|
reset(div_2);
|
|
12881
12813
|
template_effect(() => {
|
|
@@ -12884,15 +12816,15 @@ function Input($$anchor, $$props) {
|
|
|
12884
12816
|
});
|
|
12885
12817
|
append($$anchor2, div_2);
|
|
12886
12818
|
};
|
|
12887
|
-
if_block(
|
|
12819
|
+
if_block(node_2, ($$render) => {
|
|
12888
12820
|
if (get2(descriptionText))
|
|
12889
|
-
$$render(
|
|
12821
|
+
$$render(consequent_2);
|
|
12890
12822
|
});
|
|
12891
12823
|
}
|
|
12892
|
-
var
|
|
12824
|
+
var node_3 = sibling(node_2, 2);
|
|
12893
12825
|
{
|
|
12894
|
-
var
|
|
12895
|
-
var div_3 =
|
|
12826
|
+
var consequent_3 = ($$anchor2) => {
|
|
12827
|
+
var div_3 = root_4();
|
|
12896
12828
|
var text_4 = child(div_3, true);
|
|
12897
12829
|
reset(div_3);
|
|
12898
12830
|
template_effect(() => {
|
|
@@ -12901,9 +12833,9 @@ function Input($$anchor, $$props) {
|
|
|
12901
12833
|
});
|
|
12902
12834
|
append($$anchor2, div_3);
|
|
12903
12835
|
};
|
|
12904
|
-
if_block(
|
|
12836
|
+
if_block(node_3, ($$render) => {
|
|
12905
12837
|
if (get2(errorText))
|
|
12906
|
-
$$render(
|
|
12838
|
+
$$render(consequent_3);
|
|
12907
12839
|
});
|
|
12908
12840
|
}
|
|
12909
12841
|
reset(div);
|
|
@@ -12912,21 +12844,20 @@ function Input($$anchor, $$props) {
|
|
|
12912
12844
|
set_attribute2(div, "data-required", get2(required) ? "true" : undefined);
|
|
12913
12845
|
set_attribute2(div, "data-readonly", get2(readonly) ? "true" : undefined);
|
|
12914
12846
|
set_attribute2(div_1, "data-has-unit", get2(unitText) ? "true" : undefined);
|
|
12915
|
-
set_attribute2(
|
|
12916
|
-
set_attribute2(
|
|
12917
|
-
set_attribute2(
|
|
12918
|
-
set_attribute2(
|
|
12919
|
-
set_attribute2(
|
|
12920
|
-
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
set_attribute2(
|
|
12925
|
-
set_attribute2(
|
|
12926
|
-
set_attribute2(
|
|
12927
|
-
set_attribute2(
|
|
12928
|
-
set_attribute2(
|
|
12929
|
-
set_attribute2(input_1, "aria-invalid", get2(invalid2) ? "true" : undefined);
|
|
12847
|
+
set_attribute2(input, "id", get2(inputId));
|
|
12848
|
+
set_attribute2(input, "type", $0);
|
|
12849
|
+
set_attribute2(input, "inputmode", $1);
|
|
12850
|
+
set_attribute2(input, "name", $2);
|
|
12851
|
+
set_attribute2(input, "placeholder", $3);
|
|
12852
|
+
input.disabled = get2(disabled);
|
|
12853
|
+
input.readOnly = get2(readonly);
|
|
12854
|
+
input.required = get2(required);
|
|
12855
|
+
set_attribute2(input, "min", $4);
|
|
12856
|
+
set_attribute2(input, "max", $5);
|
|
12857
|
+
set_attribute2(input, "step", $6);
|
|
12858
|
+
set_attribute2(input, "aria-label", get2(computedAriaLabel) || undefined);
|
|
12859
|
+
set_attribute2(input, "aria-describedby", get2(describedBy) || undefined);
|
|
12860
|
+
set_attribute2(input, "aria-invalid", get2(invalid2) ? "true" : undefined);
|
|
12930
12861
|
}, [
|
|
12931
12862
|
() => inputType(),
|
|
12932
12863
|
() => text2(get2(p).type, "text") === "engineering" ? "decimal" : undefined,
|
|
@@ -12936,12 +12867,12 @@ function Input($$anchor, $$props) {
|
|
|
12936
12867
|
() => get2(p).max === undefined ? undefined : text2(get2(p).max),
|
|
12937
12868
|
() => get2(p).step === undefined ? undefined : text2(get2(p).step)
|
|
12938
12869
|
]);
|
|
12939
|
-
delegated("input",
|
|
12940
|
-
bind_value(
|
|
12870
|
+
delegated("input", input, update2);
|
|
12871
|
+
bind_value(input, () => get2(value), ($$value) => set(value, $$value));
|
|
12941
12872
|
append($$anchor, div);
|
|
12942
12873
|
pop();
|
|
12943
12874
|
}
|
|
12944
|
-
delegate(["input"
|
|
12875
|
+
delegate(["input"]);
|
|
12945
12876
|
|
|
12946
12877
|
// src/components/svelte/input/RadioGroup.svelte
|
|
12947
12878
|
var root_34 = from_html(`<span> </span>`);
|
|
@@ -13057,6 +12988,7 @@ function RadioGroup($$anchor, $$props) {
|
|
|
13057
12988
|
reset(label2);
|
|
13058
12989
|
reset(span_1);
|
|
13059
12990
|
template_effect(($0, $1, $2) => {
|
|
12991
|
+
set_attribute2(label2, "data-disabled", get2(disabled) ? "true" : undefined);
|
|
13060
12992
|
set_attribute2(input, "name", $0);
|
|
13061
12993
|
set_value(input, $1);
|
|
13062
12994
|
set_checked(input, get2(itemValue) === get2(value));
|
|
@@ -13092,7 +13024,7 @@ var root_35 = from_html(`<span> </span>`);
|
|
|
13092
13024
|
var root_16 = from_html(`<label class="slex-select-label"><!> <!></label>`);
|
|
13093
13025
|
var root_8 = from_html(`<span class="slex-select-check" aria-hidden="true"></span>`);
|
|
13094
13026
|
var root_6 = from_html(`<li role="option"><span class="slex-select-option-label"><!> <span> </span></span> <!></li>`);
|
|
13095
|
-
var
|
|
13027
|
+
var root_52 = from_html(`<ul class="slex-select-menu" role="listbox"></ul>`);
|
|
13096
13028
|
var root_9 = from_html(`<option> </option>`);
|
|
13097
13029
|
var root10 = from_html(`<div class="slex-select"><!> <button type="button" class="slex-select-trigger" aria-haspopup="listbox"><span class="slex-select-value"><!> <span> </span></span> <span class="slex-select-icon" aria-hidden="true"></span></button> <!> <select class="slex-select-native" tabindex="-1" aria-hidden="true"><option> </option><!></select></div>`);
|
|
13098
13030
|
function Select($$anchor, $$props) {
|
|
@@ -13296,7 +13228,7 @@ function Select($$anchor, $$props) {
|
|
|
13296
13228
|
var node_4 = sibling(button, 2);
|
|
13297
13229
|
{
|
|
13298
13230
|
var consequent_6 = ($$anchor2) => {
|
|
13299
|
-
var ul =
|
|
13231
|
+
var ul = root_52();
|
|
13300
13232
|
each(ul, 21, () => get2(options), index, ($$anchor3, item, index2) => {
|
|
13301
13233
|
const isSelected = user_derived(() => get2(item).value === text2(get2(value)));
|
|
13302
13234
|
const isActive = user_derived(() => index2 === get2(activeIndex));
|
|
@@ -16147,7 +16079,7 @@ function TabItem($$anchor, $$props) {
|
|
|
16147
16079
|
delegate(["click"]);
|
|
16148
16080
|
|
|
16149
16081
|
// src/components/svelte/input/Tabs.svelte
|
|
16150
|
-
var
|
|
16082
|
+
var root_53 = from_html(`<span class="slex-sr-only"> </span>`);
|
|
16151
16083
|
var root_36 = from_html(`<!> <!>`, 1);
|
|
16152
16084
|
var root_82 = from_html(`<div></div>`);
|
|
16153
16085
|
var root_18 = from_html(`<!> <span class="slex-tabs-selected-indicator" aria-hidden="true"></span>`, 1);
|
|
@@ -16325,7 +16257,7 @@ function Tabs2($$anchor, $$props) {
|
|
|
16325
16257
|
var node_4 = sibling(node_3, 2);
|
|
16326
16258
|
{
|
|
16327
16259
|
var consequent_1 = ($$anchor5) => {
|
|
16328
|
-
var span =
|
|
16260
|
+
var span = root_53();
|
|
16329
16261
|
var text_1 = child(span, true);
|
|
16330
16262
|
reset(span);
|
|
16331
16263
|
template_effect(() => set_text(text_1, get2(label2)));
|
|
@@ -16765,7 +16697,7 @@ var root_43 = from_svg(`<svg fill="currentColor" viewBox="0 0 20 20" xmlns="http
|
|
|
16765
16697
|
var root_111 = from_html(`<button><!> <!></button>`);
|
|
16766
16698
|
var root_62 = from_html(`<span class="sr-only"> </span>`);
|
|
16767
16699
|
var root_83 = from_svg(`<svg fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>`);
|
|
16768
|
-
var
|
|
16700
|
+
var root_54 = from_html(`<a><!> <!></a>`);
|
|
16769
16701
|
function CloseButton($$anchor, $$props) {
|
|
16770
16702
|
push($$props, true);
|
|
16771
16703
|
let color = prop($$props, "color", 3, "gray"), name = prop($$props, "name", 3, "Close"), size = prop($$props, "size", 3, "md"), restProps = rest_props($$props, [
|
|
@@ -16839,7 +16771,7 @@ function CloseButton($$anchor, $$props) {
|
|
|
16839
16771
|
append($$anchor2, button);
|
|
16840
16772
|
};
|
|
16841
16773
|
var alternate_2 = ($$anchor2) => {
|
|
16842
|
-
var a =
|
|
16774
|
+
var a = root_54();
|
|
16843
16775
|
attribute_effect(a, ($0) => ({
|
|
16844
16776
|
...restProps,
|
|
16845
16777
|
onclick,
|
|
@@ -17472,11 +17404,21 @@ function Text2($$anchor, $$props) {
|
|
|
17472
17404
|
push($$props, true);
|
|
17473
17405
|
let p = state(proxy({}));
|
|
17474
17406
|
user_effect(() => bindPropStore($$props.props, (next2) => set(p, next2, true)));
|
|
17407
|
+
const color = user_derived(() => get2(p).color == null || get2(p).color === "" ? undefined : text2(get2(p).color));
|
|
17408
|
+
const size = user_derived(() => cssLength(get2(p).size));
|
|
17409
|
+
function cssLength(value) {
|
|
17410
|
+
if (value == null || value === "")
|
|
17411
|
+
return;
|
|
17412
|
+
const rendered = text2(value);
|
|
17413
|
+
return /^-?\d+(\.\d+)?$/.test(rendered) ? `${rendered}px` : rendered;
|
|
17414
|
+
}
|
|
17475
17415
|
var div = root20();
|
|
17416
|
+
let styles;
|
|
17476
17417
|
var text_1 = child(div, true);
|
|
17477
17418
|
reset(div);
|
|
17478
17419
|
template_effect(($0, $1) => {
|
|
17479
17420
|
set_class(div, 1, $0);
|
|
17421
|
+
styles = set_style(div, "", styles, { color: get2(color), "font-size": get2(size) });
|
|
17480
17422
|
set_text(text_1, $1);
|
|
17481
17423
|
}, [
|
|
17482
17424
|
() => `slex-text${get2(p).variant ? ` slex-text--${text2(get2(p).variant)}` : ""}${get2(p).class ? ` ${text2(get2(p).class)}` : ""}`,
|
|
@@ -17648,7 +17590,7 @@ var root_311 = from_html(`<span> </span>`);
|
|
|
17648
17590
|
var root_45 = from_html(`<span class="slex-code-block-language"> </span>`);
|
|
17649
17591
|
var root_114 = from_html(`<figcaption class="slex-code-block-header"><span class="slex-code-block-title"><!> <!></span> <!></figcaption>`);
|
|
17650
17592
|
var root_72 = from_html(`<span> </span>`);
|
|
17651
|
-
var
|
|
17593
|
+
var root_55 = from_html(`<span class="slex-code-line"><span class="slex-code-line-content"></span></span>`);
|
|
17652
17594
|
var root22 = from_html(`<figure class="slex-code-block"><!> <pre class="slex-code-block-pre"><code></code></pre></figure>`);
|
|
17653
17595
|
function CodeBlock($$anchor, $$props) {
|
|
17654
17596
|
push($$props, true);
|
|
@@ -17817,7 +17759,7 @@ function CodeBlock($$anchor, $$props) {
|
|
|
17817
17759
|
var pre = sibling(node, 2);
|
|
17818
17760
|
var code_1 = child(pre);
|
|
17819
17761
|
each(code_1, 21, () => get2(lines), index, ($$anchor2, line) => {
|
|
17820
|
-
var span_3 =
|
|
17762
|
+
var span_3 = root_55();
|
|
17821
17763
|
var span_4 = child(span_3);
|
|
17822
17764
|
each(span_4, 21, () => get2(line), index, ($$anchor3, token) => {
|
|
17823
17765
|
var fragment_1 = comment();
|
|
@@ -31957,7 +31899,7 @@ function Table($$anchor, $$props) {
|
|
|
31957
31899
|
|
|
31958
31900
|
// src/components/svelte/content/Section.svelte
|
|
31959
31901
|
var root_28 = from_html(`<div class="slex-section-eyebrow"> </div>`);
|
|
31960
|
-
var
|
|
31902
|
+
var root_56 = from_html(`<span> </span>`);
|
|
31961
31903
|
var root_313 = from_html(`<h2 class="slex-section-title"><!><!></h2>`);
|
|
31962
31904
|
var root_65 = from_html(`<p class="slex-section-subtitle"> </p>`);
|
|
31963
31905
|
var root_73 = from_html(`<a class="slex-section-action"> </a>`);
|
|
@@ -32008,7 +31950,7 @@ function Section($$anchor, $$props) {
|
|
|
32008
31950
|
var node_4 = sibling(node_3);
|
|
32009
31951
|
{
|
|
32010
31952
|
var consequent_2 = ($$anchor4) => {
|
|
32011
|
-
var span =
|
|
31953
|
+
var span = root_56();
|
|
32012
31954
|
var text_2 = child(span, true);
|
|
32013
31955
|
reset(span);
|
|
32014
31956
|
template_effect(($0) => set_text(text_2, $0), [() => text2(get2(p).title)]);
|