@octane-xplat/ui 0.3.0 → 0.4.0

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.
Files changed (123) hide show
  1. package/README.md +46 -0
  2. package/dist/native/octane-client-build.json +1 -1
  3. package/dist/native/ui.js +52 -40
  4. package/dist/native/ui10.js +20 -11
  5. package/dist/native/ui11.js +42 -109
  6. package/dist/native/ui12.js +17 -84
  7. package/dist/native/ui13.js +11 -41
  8. package/dist/native/ui14.js +118 -76
  9. package/dist/native/ui15.js +43 -92
  10. package/dist/native/ui16.js +106 -45
  11. package/dist/native/ui17.js +29 -42
  12. package/dist/native/ui18.js +34 -53
  13. package/dist/native/ui19.js +246 -32
  14. package/dist/native/ui20.js +27 -16
  15. package/dist/native/ui21.js +376 -86
  16. package/dist/native/ui22.js +26 -114
  17. package/dist/native/ui23.js +49 -97
  18. package/dist/native/ui24.js +78 -53
  19. package/dist/native/ui25.js +138 -16
  20. package/dist/native/ui26.js +8 -23
  21. package/dist/native/ui27.js +60 -34
  22. package/dist/native/ui28.js +36 -142
  23. package/dist/native/ui29.js +101 -21
  24. package/dist/native/ui30.js +14 -31
  25. package/dist/native/ui31.js +55 -36
  26. package/dist/native/ui32.js +49 -61
  27. package/dist/native/ui33.js +36 -28
  28. package/dist/native/ui34.js +51 -8
  29. package/dist/native/ui35.js +98 -20
  30. package/dist/native/ui36.js +9 -33
  31. package/dist/native/ui37.js +42 -15
  32. package/dist/native/ui38.js +186 -57
  33. package/dist/native/ui39.js +96 -24
  34. package/dist/native/ui4.js +22 -20
  35. package/dist/native/ui40.js +57 -13
  36. package/dist/native/ui41.js +15 -100
  37. package/dist/native/ui42.js +6 -146
  38. package/dist/native/ui43.js +37 -21
  39. package/dist/native/ui44.js +265 -6
  40. package/dist/native/ui45.js +28 -0
  41. package/dist/native/ui46.js +35 -0
  42. package/dist/native/ui47.js +41 -0
  43. package/dist/native/ui48.js +72 -0
  44. package/dist/native/ui49.js +66 -0
  45. package/dist/native/ui5.js +37 -77
  46. package/dist/native/ui50.js +27 -0
  47. package/dist/native/ui51.js +13 -0
  48. package/dist/native/ui52.js +92 -0
  49. package/dist/native/ui53.js +34 -0
  50. package/dist/native/ui54.js +17 -0
  51. package/dist/native/ui55.js +156 -0
  52. package/dist/native/ui56.js +33 -0
  53. package/dist/native/ui57.js +14 -0
  54. package/dist/native/ui58.js +22 -0
  55. package/dist/native/ui59.js +8 -0
  56. package/dist/native/ui6.js +52 -9
  57. package/dist/native/ui60.js +108 -0
  58. package/dist/native/ui61.js +76 -0
  59. package/dist/native/ui7.js +42 -26
  60. package/dist/native/ui8.js +22 -12
  61. package/dist/native/ui9.js +18 -9
  62. package/dist/web/octane-client-build.json +1 -1
  63. package/dist/web/ui.js +51 -40
  64. package/dist/web/ui10.js +33 -186
  65. package/dist/web/ui11.js +28 -409
  66. package/dist/web/ui12.js +21 -68
  67. package/dist/web/ui13.js +201 -97
  68. package/dist/web/ui14.js +85 -95
  69. package/dist/web/ui15.js +368 -25
  70. package/dist/web/ui16.js +13 -101
  71. package/dist/web/ui17.js +246 -42
  72. package/dist/web/ui18.js +237 -28
  73. package/dist/web/ui19.js +36 -10
  74. package/dist/web/ui20.js +73 -102
  75. package/dist/web/ui21.js +102 -73
  76. package/dist/web/ui22.js +95 -55
  77. package/dist/web/ui23.js +94 -55
  78. package/dist/web/ui24.js +31 -15
  79. package/dist/web/ui25.js +105 -19
  80. package/dist/web/ui26.js +29 -23
  81. package/dist/web/ui27.js +12 -123
  82. package/dist/web/ui28.js +9 -110
  83. package/dist/web/ui29.js +52 -102
  84. package/dist/web/ui3.js +29 -18
  85. package/dist/web/ui30.js +32 -41
  86. package/dist/web/ui31.js +120 -39
  87. package/dist/web/ui32.js +41 -74
  88. package/dist/web/ui33.js +148 -32
  89. package/dist/web/ui34.js +54 -51
  90. package/dist/web/ui35.js +55 -7
  91. package/dist/web/ui36.js +18 -41
  92. package/dist/web/ui37.js +6 -46
  93. package/dist/web/ui38.js +37 -16
  94. package/dist/web/ui39.js +135 -81
  95. package/dist/web/ui4.js +46 -152
  96. package/dist/web/ui40.js +39 -37
  97. package/dist/web/ui41.js +41 -16
  98. package/dist/web/ui42.js +74 -7
  99. package/dist/web/ui43.js +40 -20
  100. package/dist/web/ui44.js +60 -6
  101. package/dist/web/ui45.js +9 -0
  102. package/dist/web/ui46.js +45 -0
  103. package/dist/web/ui47.js +13 -0
  104. package/dist/web/ui48.js +63 -0
  105. package/dist/web/ui49.js +47 -0
  106. package/dist/web/ui5.js +131 -27
  107. package/dist/web/ui50.js +17 -0
  108. package/dist/web/ui51.js +149 -0
  109. package/dist/web/ui52.js +42 -0
  110. package/dist/web/ui53.js +17 -0
  111. package/dist/web/ui54.js +9 -0
  112. package/dist/web/ui55.js +22 -0
  113. package/dist/web/ui56.js +8 -0
  114. package/dist/web/ui57.js +44 -0
  115. package/dist/web/ui58.js +46 -0
  116. package/dist/web/ui6.js +81 -45
  117. package/dist/web/ui7.js +43 -21
  118. package/dist/web/ui8.js +27 -21
  119. package/dist/web/ui9.js +29 -18
  120. package/package.json +13 -4
  121. package/src/theme/tokens.css +369 -138
  122. package/types/index.d.ts +102 -58
  123. package/types/props.d.ts +233 -13
package/dist/web/ui42.js CHANGED
@@ -1,9 +1,76 @@
1
- //#region src/stacks.web.ts
2
- /** Web twin — one linear URL stack; named stacks don't apply. */
3
- function registerStack(_name, _frame) {}
4
- function getStack(_name) {}
5
- function stackEntries() {
6
- return [].values();
1
+ import { useSafeAreaInsets } from "./ui41.js";
2
+ import { __s, bag12, clone, hookSlots, queueRefAttach, queueRefDetach, setStyle, setStyleProperty, template, withSlot } from "octane";
3
+ import { bindSignalAttribute, bindSignalChild, canSplitStyleProperties, enableSignalBindings, replaceRef, setPlainAttribute, styleObjectPrototype, updateFreshClassName } from "octane/internal/client";
4
+ //#region src/SafeArea.web.tsrx
5
+ enableSignalBindings(1, true);
6
+ var _t$0 = /* @__PURE__ */ template("<div></div>");
7
+ var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
8
+ var _rm$1 = [
9
+ "r",
10
+ "c",
11
+ "b"
12
+ ];
13
+ function applyWebProps(node, bag) {
14
+ if (!node || !bag) return;
15
+ for (const [key, value] of Object.entries(bag)) if (key.includes("-")) node.setAttribute(key, String(value));
16
+ else node[key] = value;
7
17
  }
18
+ var SafeArea = /* @__PURE__ */ __s(function SafeArea(props, __s, __extra) {
19
+ const insets = withSlot(_h$0, useSafeAreaInsets);
20
+ if (__s.block.pending && !__s.block.crossRenderUpdate) return;
21
+ let _b = __s.slots[0];
22
+ if (_b === void 0) {
23
+ let _m1, _m2;
24
+ const _root = clone(_t$0);
25
+ _m1 = _root;
26
+ queueRefAttach(__s, _m2 = (node) => applyWebProps(node, props.web), _m1);
27
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.c, _b.b));
28
+ _b = bag12(__s, _root, void 0, _m1, _m2, void 0, __s, void 0, void 0, void 0, void 0, void 0, null, void 0);
29
+ __s.refFields = _rm$1;
30
+ } else {
31
+ const _r = (node) => applyWebProps(node, props.web);
32
+ if (_r !== _b.c) _b.c = replaceRef(__s, _b.c, _r, _b.b);
33
+ }
34
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:65ed48f3", setPlainAttribute);
35
+ _b.d = updateFreshClassName(["vx-safe-area", props.className], _b.d, _b.b);
36
+ {
37
+ const __styleSpread = { ...props.style };
38
+ const __styleValue = insets.top;
39
+ const __styleValue$ = insets.right;
40
+ const __styleValue$2 = insets.bottom;
41
+ const __styleValue$3 = insets.left;
42
+ const __styleFull = "paddingTop" in __styleSpread || "paddingRight" in __styleSpread || "paddingBottom" in __styleSpread || "paddingLeft" in __styleSpread || !canSplitStyleProperties();
43
+ if (_b.e === __s || __styleFull || _b.f) {
44
+ const __styleObject = __styleFull && !("paddingTop" in styleObjectPrototype || "paddingRight" in styleObjectPrototype || "paddingBottom" in styleObjectPrototype || "paddingLeft" in styleObjectPrototype) ? (__styleSpread["paddingTop"] = __styleValue, __styleSpread["paddingRight"] = __styleValue$, __styleSpread["paddingBottom"] = __styleValue$2, __styleSpread["paddingLeft"] = __styleValue$3, __styleSpread) : {
45
+ ...__styleSpread,
46
+ "paddingTop": __styleValue,
47
+ "paddingRight": __styleValue$,
48
+ "paddingBottom": __styleValue$2,
49
+ "paddingLeft": __styleValue$3
50
+ };
51
+ setStyle(_b.b, __styleObject, _b.e === __s ? void 0 : _b.f ? _b.e : {
52
+ ..._b.e,
53
+ "paddingTop": _b.g,
54
+ "paddingRight": _b.h,
55
+ "paddingBottom": _b.i,
56
+ "paddingLeft": _b.j
57
+ });
58
+ _b.e = __styleFull ? __styleObject : __styleSpread;
59
+ } else {
60
+ setStyle(_b.b, __styleSpread, _b.e);
61
+ if (_b.g !== __styleValue) setStyleProperty(_b.b, "paddingTop", __styleValue, "", _b.g);
62
+ if (_b.h !== __styleValue$) setStyleProperty(_b.b, "paddingRight", __styleValue$, "", _b.h);
63
+ if (_b.i !== __styleValue$2) setStyleProperty(_b.b, "paddingBottom", __styleValue$2, "", _b.i);
64
+ if (_b.j !== __styleValue$3) setStyleProperty(_b.b, "paddingLeft", __styleValue$3, "", _b.j);
65
+ _b.e = __styleSpread;
66
+ }
67
+ _b.f = __styleFull;
68
+ _b.g = __styleValue;
69
+ _b.h = __styleValue$;
70
+ _b.i = __styleValue$2;
71
+ _b.j = __styleValue$3;
72
+ }
73
+ _b.m = bindSignalChild(__s, _b.m, 1, _b.b, props.children, "b:30587aa9", null, void 0, void 0, void 0, true);
74
+ });
8
75
  //#endregion
9
- export { getStack, registerStack, stackEntries };
76
+ export { SafeArea };
package/dist/web/ui43.js CHANGED
@@ -1,22 +1,42 @@
1
- //#region src/store.ts
2
- function createStore(initial) {
3
- let value = initial;
4
- const listeners = /* @__PURE__ */ new Set();
5
- return {
6
- get: () => value,
7
- set(next) {
8
- const v = typeof next === "function" ? next(value) : next;
9
- if (Object.is(v, value)) return;
10
- value = v;
11
- for (const l of [...listeners]) l();
12
- },
13
- subscribe(notify) {
14
- listeners.add(notify);
15
- return () => {
16
- listeners.delete(notify);
17
- };
18
- }
19
- };
1
+ import { __s, bag7, clone, queueRefAttach, queueRefDetach, setStyle, template } from "octane";
2
+ import { bindSignalAttribute, bindSignalChild, enableSignalBindings, replaceRef, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
3
+ //#region src/KeyboardAvoiding.web.tsrx
4
+ enableSignalBindings(1, true);
5
+ var _t$0 = /* @__PURE__ */ template("<div></div>");
6
+ var _rm$1 = [
7
+ "r",
8
+ "c",
9
+ "b"
10
+ ];
11
+ function applyWebProps(node, bag) {
12
+ if (!node || !bag) return;
13
+ for (const [key, value] of Object.entries(bag)) if (key.includes("-")) node.setAttribute(key, String(value));
14
+ else node[key] = value;
20
15
  }
16
+ var KeyboardAvoiding = /* @__PURE__ */ __s(function KeyboardAvoiding(props, __s, __extra) {
17
+ let _b = __s.slots[0];
18
+ if (_b === void 0) {
19
+ let _m1, _m2;
20
+ const _root = clone(_t$0);
21
+ _m1 = _root;
22
+ queueRefAttach(__s, _m2 = (node) => applyWebProps(node, props.web), _m1);
23
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.c, _b.b));
24
+ _b = bag7(__s, _root, void 0, _m1, _m2, void 0, void 0, null, void 0);
25
+ __s.refFields = _rm$1;
26
+ } else {
27
+ const _r = (node) => applyWebProps(node, props.web);
28
+ if (_r !== _b.c) _b.c = replaceRef(__s, _b.c, _r, _b.b);
29
+ }
30
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:a2dd5fb0", setPlainAttribute);
31
+ _b.d = updateFreshClassName(["vx-keyboard-avoiding", props.className], _b.d, _b.b);
32
+ {
33
+ const _v = props.style;
34
+ if (_b.e !== _v) {
35
+ setStyle(_b.b, _v, _b.e);
36
+ _b.e = _v;
37
+ }
38
+ }
39
+ _b.h = bindSignalChild(__s, _b.h, 1, _b.b, props.children, "b:327d2ddc", null, void 0, void 0, void 0, true);
40
+ });
21
41
  //#endregion
22
- export { createStore };
42
+ export { KeyboardAvoiding };
package/dist/web/ui44.js CHANGED
@@ -1,8 +1,62 @@
1
- import { hookSlots, useSyncExternalStore } from "octane";
2
- //#region src/use-store.web.tsrx
3
- var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
4
- function useStore(store, select) {
5
- return useSyncExternalStore(store.subscribe, select === void 0 ? store.get : () => select(store.get()), _h$0);
1
+ import { __s, bag3, bag9, child, clone, drainFrag, ifBlock, queueRefAttach, queueRefDetach, setStyle, sibling, template } from "octane";
2
+ import { bindSignalAttribute, bindSignalChild, enableSignalBindings, replaceRef, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
3
+ //#region src/Drawer.web.tsrx
4
+ enableSignalBindings(1, true);
5
+ var _t$0 = /* @__PURE__ */ template("<div class=\"vx-drawer-backdrop\" aria-hidden=\"true\"></div><div class=\"vx-drawer-panel\"></div>", 0, 1);
6
+ var _t$1 = /* @__PURE__ */ template("<div><div class=\"vx-drawer-main\"></div><!></div>");
7
+ function __then$1(__props, __s, __extra) {
8
+ const __block = __s.block;
9
+ const props = __extra[0];
10
+ let _b = __s.slots[0];
11
+ if (_b === void 0) {
12
+ let _m0;
13
+ const _root = clone(_t$0);
14
+ _m0 = sibling(child(_root), 1);
15
+ drainFrag(_root, __block.parentNode, __block.endMarker);
16
+ _b = bag3(__s, null, _m0, null, void 0);
17
+ }
18
+ _b.d = bindSignalChild(__s, _b.d, 1, _b.a, props.drawer, "b:7c4fb4de", null, void 0, void 0, void 0, true);
6
19
  }
20
+ var _rm$4 = [
21
+ "r",
22
+ "c",
23
+ "b"
24
+ ];
25
+ function applyWebProps(node, bag) {
26
+ if (!node || !bag) return;
27
+ for (const [key, value] of Object.entries(bag)) if (key.includes("-")) node.setAttribute(key, String(value));
28
+ else node[key] = value;
29
+ }
30
+ var Drawer = /* @__PURE__ */ __s(function Drawer(props, __s, __extra) {
31
+ let _b = __s.slots[0];
32
+ if (_b === void 0) {
33
+ let _m1, _m2, _m5, _m6;
34
+ const _root = clone(_t$1);
35
+ _m1 = _root;
36
+ queueRefAttach(__s, _m2 = (node) => applyWebProps(node, props.web), _m1);
37
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.c, _b.b));
38
+ _m5 = sibling(child(_root), 1);
39
+ _m6 = child(_root);
40
+ _b = bag9(__s, _root, void 0, _m1, _m2, void 0, void 0, _m5, _m6, null, void 0);
41
+ __s.refFields = _rm$4;
42
+ } else {
43
+ const _r = (node) => applyWebProps(node, props.web);
44
+ if (_r !== _b.c) _b.c = replaceRef(__s, _b.c, _r, _b.b);
45
+ }
46
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:8ba6f567", setPlainAttribute);
47
+ _b.d = updateFreshClassName(["vx-drawer", props.className], _b.d, _b.b);
48
+ {
49
+ const _v = props.style;
50
+ if (_b.e !== _v) {
51
+ setStyle(_b.b, _v, _b.e);
52
+ _b.e = _v;
53
+ }
54
+ }
55
+ _b.j = bindSignalChild(__s, _b.j, 1, _b.g, props.main, "b:8d49146e", null, void 0, void 0, void 0, true);
56
+ {
57
+ const __ifCondition = props.open;
58
+ ifBlock(__s, 2, _b.b, __ifCondition, __then$1, null, _b.f, __ifCondition ? [props] : void 0);
59
+ }
60
+ });
7
61
  //#endregion
8
- export { useStore };
62
+ export { Drawer };
@@ -0,0 +1,9 @@
1
+ //#region src/platformProps.web.ts
2
+ /** Apply a web escape-hatch bag after the primitive's standard props. */
3
+ function applyWebProps(el, props) {
4
+ if (!el || !props) return;
5
+ for (const [name, value] of Object.entries(props)) if (name.includes("-")) el.setAttribute(name, String(value));
6
+ else el[name] = value;
7
+ }
8
+ //#endregion
9
+ export { applyWebProps };
@@ -0,0 +1,45 @@
1
+ import { applyWebProps } from "./ui45.js";
2
+ import { bag5, clone, ifBlock, queueRefAttach, queueRefDetach, setStyle, template } from "octane";
3
+ import { bindSignalAttribute, enableSignalBindings, replaceRef, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
4
+ //#region src/ActivityIndicator.web.tsrx
5
+ enableSignalBindings(1, true);
6
+ var _t$0 = /* @__PURE__ */ template("<div role=\"progressbar\"></div>");
7
+ var _rm$1 = [
8
+ "r",
9
+ "e",
10
+ "b"
11
+ ];
12
+ function __then$0(__props, __s, __extra) {
13
+ const props = __extra[0];
14
+ let _b = __s.slots[0];
15
+ if (_b === void 0) {
16
+ let _m1, _m4;
17
+ const _root = clone(_t$0);
18
+ _m1 = _root;
19
+ queueRefAttach(__s, _m4 = (el) => applyWebProps(el, props.web), _m1);
20
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.e, _b.b));
21
+ _b = bag5(__s, _root, void 0, _m1, void 0, void 0, _m4);
22
+ __s.refFields = _rm$1;
23
+ } else {
24
+ const _r = (el) => applyWebProps(el, props.web);
25
+ if (_r !== _b.e) _b.e = replaceRef(__s, _b.e, _r, _b.b);
26
+ }
27
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:da5807de", setPlainAttribute);
28
+ _b.c = updateFreshClassName(["vx-spinner", props.className], _b.c, _b.b);
29
+ {
30
+ const _v = props.style;
31
+ if (_b.d !== _v) {
32
+ setStyle(_b.b, _v, _b.d);
33
+ _b.d = _v;
34
+ }
35
+ }
36
+ }
37
+ var ActivityIndicator = function ActivityIndicator(props, __s, __extra) {
38
+ const __block = __s.block;
39
+ {
40
+ const __ifCondition = !(props.busy === false);
41
+ ifBlock(__s, 0, __block.parentNode, __ifCondition, __then$0, null, __block.endMarker, __ifCondition ? [props] : void 0);
42
+ }
43
+ };
44
+ //#endregion
45
+ export { ActivityIndicator };
@@ -0,0 +1,13 @@
1
+ //#region src/meter-math.ts
2
+ /** Clamp a progress value to its declared range for drawing and accessibility. */
3
+ function meterRange(value, max) {
4
+ const safeMax = Number.isFinite(max) && max > 0 ? max : 100;
5
+ const safeValue = Number.isFinite(value) ? Math.min(safeMax, Math.max(0, value)) : 0;
6
+ return {
7
+ max: safeMax,
8
+ value: safeValue,
9
+ ratio: safeValue / safeMax
10
+ };
11
+ }
12
+ //#endregion
13
+ export { meterRange };
@@ -0,0 +1,63 @@
1
+ import { meterRange } from "./ui47.js";
2
+ import { __s, bag12, child, clone, setAriaAttribute, setStyle, sibling, template } from "octane";
3
+ import { bindSignalAttribute, bindSignalChild, enableSignalBindings, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
4
+ //#region src/Meter.web.tsrx
5
+ enableSignalBindings(1, true);
6
+ var _t$0 = /* @__PURE__ */ template("<div role=\"progressbar\" aria-valuemin=\"0\"><div aria-hidden=\"true\"></div><div style=\"position: relative;\"></div></div>");
7
+ var Meter = /* @__PURE__ */ __s(function Meter(props, __s, __extra) {
8
+ const max = props.max ?? 100;
9
+ const { max: rangeMax, value, ratio } = meterRange(props.value, max);
10
+ const size = props.size ?? 24;
11
+ const strokeWidth = Math.max(0, Math.min(props.strokeWidth ?? 3, size));
12
+ const color = props.color ?? "#3376cc";
13
+ const trackColor = props.trackColor ?? "#e1ecf7";
14
+ const sweep = ratio * 360;
15
+ const ringStyle = {
16
+ position: "absolute",
17
+ inset: 0,
18
+ borderRadius: "50%",
19
+ backgroundImage: `conic-gradient(${color} 0deg ${sweep}deg, ${trackColor} ${sweep}deg 360deg)`,
20
+ mask: `radial-gradient(circle, transparent calc(50% - ${strokeWidth}px), #000 calc(50% - ${strokeWidth}px + 0.5px))`,
21
+ WebkitMask: `radial-gradient(circle, transparent calc(50% - ${strokeWidth}px), #000 calc(50% - ${strokeWidth}px + 0.5px))`
22
+ };
23
+ if (__s.block.pending && !__s.block.crossRenderUpdate) return;
24
+ let _b = __s.slots[0];
25
+ if (_b === void 0) {
26
+ let _m1, _m8, _m9;
27
+ const _root = clone(_t$0);
28
+ _m1 = _root;
29
+ const _el0 = child(_root);
30
+ _m8 = _el0;
31
+ _m9 = sibling(_el0, 1);
32
+ _b = bag12(__s, _root, void 0, _m1, void 0, void 0, void 0, void 0, void 0, void 0, _m8, _m9, null, void 0);
33
+ }
34
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:fe732458", setPlainAttribute);
35
+ _b.c = updateFreshClassName(["vx-meter", props.className], _b.c, _b.b);
36
+ {
37
+ const _v = {
38
+ display: "grid",
39
+ placeItems: "center",
40
+ position: "relative",
41
+ width: size,
42
+ height: size,
43
+ ...props.style
44
+ };
45
+ if (_b.d !== _v) {
46
+ setStyle(_b.b, _v, _b.d);
47
+ _b.d = _v;
48
+ }
49
+ }
50
+ _b.e = bindSignalAttribute(__s, _b.e, _b.b, "aria-label", props.accessibilityLabel, "b:8b03ec71", setAriaAttribute);
51
+ _b.f = bindSignalAttribute(__s, _b.f, _b.b, "aria-valuemax", rangeMax, "b:b0ee791c", setAriaAttribute);
52
+ _b.g = bindSignalAttribute(__s, _b.g, _b.b, "aria-valuenow", value, "b:4be1f493", setAriaAttribute);
53
+ {
54
+ const _v = ringStyle;
55
+ if (_b.h !== _v) {
56
+ setStyle(_b.i, _v, _b.h);
57
+ _b.h = _v;
58
+ }
59
+ }
60
+ _b.m = bindSignalChild(__s, _b.m, 1, _b.j, props.children, "b:c7af99f3", null, void 0, void 0, void 0, true);
61
+ });
62
+ //#endregion
63
+ export { Meter };
@@ -0,0 +1,47 @@
1
+ import { applyWebProps } from "./ui45.js";
2
+ import { __s, bag9, clone, delegateEvents, queueRefAttach, queueRefDetach, setBooleanAttribute, setEventHandler, setStyle, template } from "octane";
3
+ import { bindSignalAttribute, bindSignalValue, enableSignalBindings, replaceRef, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
4
+ //#region src/Slider.web.tsrx
5
+ enableSignalBindings(1, true);
6
+ delegateEvents(["input"]);
7
+ var _t$0 = /* @__PURE__ */ template("<input type=\"range\" data-octane-input=\"i:c0018a58\"/>");
8
+ var _rm$0 = [
9
+ "r",
10
+ "i",
11
+ "b"
12
+ ];
13
+ var Slider = /* @__PURE__ */ __s(function Slider(props, __s, __extra) {
14
+ let _b = __s.slots[0];
15
+ if (_b === void 0) {
16
+ let _m1, _m4, _m8;
17
+ const _root = clone(_t$0);
18
+ _m1 = _root;
19
+ _m4 = bindSignalValue(__s, void 0, _root, props.value, "i:c0018a58");
20
+ setEventHandler(_root, "$$input", (e) => props.onValueChange?.(Number(e.target.value)));
21
+ queueRefAttach(__s, _m8 = (el) => applyWebProps(el, props.web), _m1);
22
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.i, _b.b));
23
+ _b = bag9(__s, _root, void 0, _m1, void 0, void 0, _m4, void 0, void 0, void 0, _m8);
24
+ __s.refFields = _rm$0;
25
+ } else {
26
+ _b.e = bindSignalValue(__s, _b.e, _b.b, props.value, "i:c0018a58");
27
+ setEventHandler(_b.b, "$$input", (e) => props.onValueChange?.(Number(e.target.value)));
28
+ {
29
+ const _r = (el) => applyWebProps(el, props.web);
30
+ if (_r !== _b.i) _b.i = replaceRef(__s, _b.i, _r, _b.b);
31
+ }
32
+ }
33
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:97ef4e10", setPlainAttribute);
34
+ _b.c = updateFreshClassName(["vx-slider", props.className], _b.c, _b.b);
35
+ {
36
+ const _v = props.style;
37
+ if (_b.d !== _v) {
38
+ setStyle(_b.b, _v, _b.d);
39
+ _b.d = _v;
40
+ }
41
+ }
42
+ _b.f = bindSignalAttribute(__s, _b.f, _b.b, "min", props.minValue ?? 0, "b:7991c980", setPlainAttribute);
43
+ _b.g = bindSignalAttribute(__s, _b.g, _b.b, "max", props.maxValue ?? 100, "b:ff7f1a7c", setPlainAttribute);
44
+ _b.h = bindSignalAttribute(__s, _b.h, _b.b, "disabled", props.disabled, "b:91d4cdb7", setBooleanAttribute);
45
+ });
46
+ //#endregion
47
+ export { Slider };
package/dist/web/ui5.js CHANGED
@@ -1,64 +1,168 @@
1
1
  import { applyEscapeProps } from "./ui2.js";
2
- import { layoutChildProps } from "./ui3.js";
3
- import { __s, bag7, clone, snapshotSpread, template } from "octane";
2
+ import { glassClassOf, glassStyleOf } from "./ui3.js";
3
+ import { layoutChildProps } from "./ui4.js";
4
+ import { __s, bag8, clone, hookSlots, snapshotSpread, template, useEffect, useRef } from "octane";
4
5
  import { bindSignalChild, bindSignalHostPropSources, enableSignalBindings } from "octane/internal/client";
5
- //#region src/Row.web.tsrx
6
+ //#region src/View.web.tsrx
6
7
  enableSignalBindings(1, true);
7
8
  var _t$0 = /* @__PURE__ */ template("<div></div>");
9
+ var _hs$ = /* @__PURE__ */ hookSlots(2);
8
10
  var _rm$1 = [
9
11
  "s",
10
- "e",
11
- "d"
12
+ "f",
13
+ "e"
12
14
  ];
13
- var Row = /* @__PURE__ */ __s(function Row(props, __s, __extra) {
15
+ var View = /* @__PURE__ */ __s(function View(props, __s, __extra) {
16
+ const el = useRef(null, _hs$ + 0);
17
+ useEffect(() => {
18
+ const node = el.current;
19
+ const cb = props.onPan;
20
+ if (!node || !cb) return;
21
+ let sx = 0, sy = 0, active = false, last = 0, lx = 0, t0 = 0;
22
+ const emit = (e, state) => {
23
+ const now = performance.now();
24
+ const dt = Math.max(now - t0, 1) / 1e3;
25
+ const vx = (e.clientX - lx) / dt;
26
+ const vy = (e.clientY - last) / dt;
27
+ lx = e.clientX;
28
+ last = e.clientY;
29
+ t0 = now;
30
+ cb({
31
+ x: e.clientX - sx,
32
+ y: e.clientY - sy,
33
+ dx: e.clientX - sx,
34
+ dy: e.clientY - sy,
35
+ vx,
36
+ vy,
37
+ state,
38
+ target: node
39
+ });
40
+ };
41
+ const down = (e) => {
42
+ active = true;
43
+ sx = e.clientX;
44
+ sy = e.clientY;
45
+ t0 = performance.now();
46
+ lx = sx;
47
+ last = sy;
48
+ node.setPointerCapture?.(e.pointerId);
49
+ emit(e, "began");
50
+ };
51
+ const move = (e) => {
52
+ if (active) emit(e, "moved");
53
+ };
54
+ const up = (e) => {
55
+ if (active) {
56
+ active = false;
57
+ emit(e, "ended");
58
+ }
59
+ };
60
+ const cancel = (e) => {
61
+ if (active) {
62
+ active = false;
63
+ emit(e, "cancelled");
64
+ }
65
+ };
66
+ node.addEventListener("pointerdown", down);
67
+ node.addEventListener("pointermove", move);
68
+ node.addEventListener("pointerup", up);
69
+ node.addEventListener("pointercancel", cancel);
70
+ return () => {
71
+ node.removeEventListener("pointerdown", down);
72
+ node.removeEventListener("pointermove", move);
73
+ node.removeEventListener("pointerup", up);
74
+ node.removeEventListener("pointercancel", cancel);
75
+ };
76
+ }, [props.onPan], _hs$ + 1);
14
77
  let _b = __s.slots[0];
15
78
  if (_b === void 0) {
16
- let _m0, _m1, _m2, _m3, _m4;
79
+ let _m0, _m1, _m2, _m3, _m4, _m5;
17
80
  const _root = clone(_t$0);
18
- _m0 = (e) => applyEscapeProps(e, props);
19
- _m1 = ["vx-row", props.className];
20
- _m2 = snapshotSpread(layoutChildProps(props));
21
- _m3 = _root;
22
- _m4 = bindSignalHostPropSources(__s, void 0, _root, [
81
+ _m0 = props.id;
82
+ _m1 = (e) => {
83
+ el.current = e;
84
+ if (e) {
85
+ applyEscapeProps(e, props);
86
+ props.bind?.(e);
87
+ }
88
+ };
89
+ _m2 = [
90
+ "vx-view",
91
+ glassClassOf(props.glass),
92
+ props.className
93
+ ];
94
+ _m3 = snapshotSpread(layoutChildProps(props, {
95
+ ...glassStyleOf(props.glass),
96
+ ...props.style
97
+ }));
98
+ _m4 = _root;
99
+ _m5 = bindSignalHostPropSources(__s, void 0, _root, [
23
100
  [
24
101
  false,
25
- "ref",
102
+ "id",
26
103
  _m0
27
104
  ],
28
105
  [
29
106
  false,
30
- "className",
107
+ "ref",
31
108
  _m1
32
109
  ],
33
- [true, _m2]
34
- ], "b:be019871", true);
35
- _b = bag7(__s, _root, _m0, _m1, _m2, _m3, _m4, null, void 0);
110
+ [
111
+ false,
112
+ "className",
113
+ _m2
114
+ ],
115
+ [true, _m3]
116
+ ], "b:e20c8de1", true);
117
+ _b = bag8(__s, _root, _m0, _m1, _m2, _m3, _m4, _m5, null, void 0);
36
118
  __s.refFields = _rm$1;
37
119
  } else {
38
120
  {
39
- const _v = (e) => applyEscapeProps(e, props);
121
+ const _v = props.id;
40
122
  if (_b.a !== _v) _b.a = _v;
41
123
  }
42
124
  {
43
- const _v = ["vx-row", props.className];
125
+ const _v = (e) => {
126
+ el.current = e;
127
+ if (e) {
128
+ applyEscapeProps(e, props);
129
+ props.bind?.(e);
130
+ }
131
+ };
44
132
  if (_b.b !== _v) _b.b = _v;
45
133
  }
46
- _b.c = snapshotSpread(layoutChildProps(props));
47
- _b.e = bindSignalHostPropSources(__s, _b.e, _b.d, [
134
+ {
135
+ const _v = [
136
+ "vx-view",
137
+ glassClassOf(props.glass),
138
+ props.className
139
+ ];
140
+ if (_b.c !== _v) _b.c = _v;
141
+ }
142
+ _b.d = snapshotSpread(layoutChildProps(props, {
143
+ ...glassStyleOf(props.glass),
144
+ ...props.style
145
+ }));
146
+ _b.f = bindSignalHostPropSources(__s, _b.f, _b.e, [
48
147
  [
49
148
  false,
50
- "ref",
149
+ "id",
51
150
  _b.a
52
151
  ],
53
152
  [
54
153
  false,
55
- "className",
154
+ "ref",
56
155
  _b.b
57
156
  ],
58
- [true, _b.c]
59
- ], "b:be019871", true);
157
+ [
158
+ false,
159
+ "className",
160
+ _b.c
161
+ ],
162
+ [true, _b.d]
163
+ ], "b:e20c8de1", true);
60
164
  }
61
- _b.h = bindSignalChild(__s, _b.h, 1, _b.d, props.children, "b:95d1a265", null, void 0, void 0, void 0, true);
165
+ _b.i = bindSignalChild(__s, _b.i, 1, _b.e, props.children, "b:13e02afa", null, void 0, void 0, void 0, true);
62
166
  });
63
167
  //#endregion
64
- export { Row };
168
+ export { View };
@@ -0,0 +1,17 @@
1
+ //#region src/icons.ts
2
+ /**
3
+ * App-owned icon registry. `svg` is SVG path `d` data (not a full SVG
4
+ * markup string). Native `font` glyphs render only when the app ships that font.
5
+ */
6
+ var icons = /* @__PURE__ */ new Map();
7
+ function registerIcon(name, glyph) {
8
+ icons.set(name, glyph);
9
+ }
10
+ function registerIcons(record) {
11
+ for (const [name, glyph] of Object.entries(record)) icons.set(name, glyph);
12
+ }
13
+ function getIcon(name) {
14
+ return icons.get(name);
15
+ }
16
+ //#endregion
17
+ export { getIcon, registerIcon, registerIcons };