@octane-xplat/ui 0.2.1 → 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 (126) 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 -19
  4. package/dist/native/ui10.js +25 -45
  5. package/dist/native/ui11.js +52 -57
  6. package/dist/native/ui12.js +47 -16
  7. package/dist/native/ui13.js +24 -18
  8. package/dist/native/ui14.js +117 -12
  9. package/dist/native/ui15.js +78 -17
  10. package/dist/native/ui16.js +88 -115
  11. package/dist/native/ui17.js +29 -19
  12. package/dist/native/ui18.js +34 -12
  13. package/dist/native/ui19.js +244 -8
  14. package/dist/native/ui2.js +10 -48
  15. package/dist/native/ui20.js +28 -0
  16. package/dist/native/ui21.js +383 -0
  17. package/dist/native/ui22.js +36 -0
  18. package/dist/native/ui23.js +55 -0
  19. package/dist/native/ui24.js +83 -0
  20. package/dist/native/ui25.js +141 -0
  21. package/dist/native/ui26.js +12 -0
  22. package/dist/native/ui27.js +61 -0
  23. package/dist/native/ui28.js +40 -0
  24. package/dist/native/ui29.js +108 -0
  25. package/dist/native/ui3.js +17 -20
  26. package/dist/native/ui30.js +18 -0
  27. package/dist/native/ui31.js +58 -0
  28. package/dist/native/ui32.js +58 -0
  29. package/dist/native/ui33.js +38 -0
  30. package/dist/native/ui34.js +53 -0
  31. package/dist/native/ui35.js +105 -0
  32. package/dist/native/ui36.js +10 -0
  33. package/dist/native/ui37.js +44 -0
  34. package/dist/native/ui38.js +197 -0
  35. package/dist/native/ui39.js +105 -0
  36. package/dist/native/ui4.js +23 -48
  37. package/dist/native/ui40.js +58 -0
  38. package/dist/native/ui41.js +19 -0
  39. package/dist/native/ui42.js +8 -0
  40. package/dist/native/ui43.js +38 -0
  41. package/dist/native/ui44.js +267 -0
  42. package/dist/native/ui45.js +28 -0
  43. package/dist/native/ui46.js +35 -0
  44. package/dist/native/ui47.js +41 -0
  45. package/dist/native/ui48.js +72 -0
  46. package/dist/native/ui49.js +66 -0
  47. package/dist/native/ui5.js +37 -34
  48. package/dist/native/ui50.js +27 -0
  49. package/dist/native/ui51.js +13 -0
  50. package/dist/native/ui52.js +92 -0
  51. package/dist/native/ui53.js +34 -0
  52. package/dist/native/ui54.js +17 -0
  53. package/dist/native/ui55.js +156 -0
  54. package/dist/native/ui56.js +33 -0
  55. package/dist/native/ui57.js +14 -0
  56. package/dist/native/ui58.js +22 -0
  57. package/dist/native/ui59.js +8 -0
  58. package/dist/native/ui6.js +79 -20
  59. package/dist/native/ui60.js +108 -0
  60. package/dist/native/ui61.js +76 -0
  61. package/dist/native/ui7.js +44 -65
  62. package/dist/native/ui8.js +25 -17
  63. package/dist/native/ui9.js +24 -12
  64. package/dist/web/octane-client-build.json +1 -1
  65. package/dist/web/ui.js +51 -19
  66. package/dist/web/ui10.js +33 -30
  67. package/dist/web/ui11.js +40 -55
  68. package/dist/web/ui12.js +36 -15
  69. package/dist/web/ui13.js +212 -20
  70. package/dist/web/ui14.js +84 -14
  71. package/dist/web/ui15.js +425 -46
  72. package/dist/web/ui16.js +12 -93
  73. package/dist/web/ui17.js +246 -28
  74. package/dist/web/ui18.js +238 -15
  75. package/dist/web/ui19.js +36 -8
  76. package/dist/web/ui2.js +15 -103
  77. package/dist/web/ui20.js +85 -0
  78. package/dist/web/ui21.js +111 -0
  79. package/dist/web/ui22.js +108 -0
  80. package/dist/web/ui23.js +96 -0
  81. package/dist/web/ui24.js +32 -0
  82. package/dist/web/ui25.js +108 -0
  83. package/dist/web/ui26.js +45 -0
  84. package/dist/web/ui27.js +16 -0
  85. package/dist/web/ui28.js +11 -0
  86. package/dist/web/ui29.js +58 -0
  87. package/dist/web/ui3.js +30 -27
  88. package/dist/web/ui30.js +34 -0
  89. package/dist/web/ui31.js +123 -0
  90. package/dist/web/ui32.js +44 -0
  91. package/dist/web/ui33.js +159 -0
  92. package/dist/web/ui34.js +70 -0
  93. package/dist/web/ui35.js +57 -0
  94. package/dist/web/ui36.js +22 -0
  95. package/dist/web/ui37.js +7 -0
  96. package/dist/web/ui38.js +38 -0
  97. package/dist/web/ui39.js +154 -0
  98. package/dist/web/ui4.js +46 -24
  99. package/dist/web/ui40.js +43 -0
  100. package/dist/web/ui41.js +42 -0
  101. package/dist/web/ui42.js +76 -0
  102. package/dist/web/ui43.js +42 -0
  103. package/dist/web/ui44.js +62 -0
  104. package/dist/web/ui45.js +9 -0
  105. package/dist/web/ui46.js +45 -0
  106. package/dist/web/ui47.js +13 -0
  107. package/dist/web/ui48.js +63 -0
  108. package/dist/web/ui49.js +47 -0
  109. package/dist/web/ui5.js +158 -52
  110. package/dist/web/ui50.js +17 -0
  111. package/dist/web/ui51.js +149 -0
  112. package/dist/web/ui52.js +42 -0
  113. package/dist/web/ui53.js +17 -0
  114. package/dist/web/ui54.js +9 -0
  115. package/dist/web/ui55.js +22 -0
  116. package/dist/web/ui56.js +8 -0
  117. package/dist/web/ui57.js +44 -0
  118. package/dist/web/ui58.js +46 -0
  119. package/dist/web/ui6.js +85 -22
  120. package/dist/web/ui7.js +46 -41
  121. package/dist/web/ui8.js +28 -11
  122. package/dist/web/ui9.js +32 -13
  123. package/package.json +18 -6
  124. package/src/theme/tokens.css +444 -47
  125. package/types/index.d.ts +180 -29
  126. package/types/props.d.ts +553 -8
@@ -1,73 +1,52 @@
1
- import { defineUniversalComponent, memo, universalComponent, universalIf, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
2
- //#region src/List.native.tsrx
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { glassClassOf, glassConfigOf } from "./ui4.js";
4
+ import { layoutChildProps } from "./ui5.js";
5
+ import { defineUniversalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
6
+ //#region src/Row.native.tsrx
3
7
  var __octaneUniversalPlan0 = universalPlan("nativescript", {
4
8
  "kind": "host",
5
- "type": "listview",
6
- "bindings": [
7
- ["id", 0],
8
- ["className", 1],
9
- ["style", 2],
10
- ["items", 3],
11
- ["renderItem", 4]
12
- ]
13
- });
14
- var __octaneUniversalPlan1 = universalPlan("nativescript", {
15
- "kind": "slot",
16
- "slot": 0
17
- });
18
- var __octaneUniversalPlan2 = universalPlan("nativescript", {
19
- "kind": "range",
9
+ "type": "flexboxlayout",
10
+ "propsSlot": 0,
20
11
  "children": [{
21
12
  "kind": "slot",
22
- "slot": 0
13
+ "slot": 1
23
14
  }]
24
15
  });
25
- var __octaneUniversalPlan3 = universalPlan("nativescript", {
26
- "kind": "slot",
27
- "slot": 0
28
- });
29
- var ListInner = defineUniversalComponent("nativescript", function ListInner(props) {
30
- return universalValue(__octaneUniversalPlan0, [
31
- props.id,
32
- props.className,
33
- props.style,
34
- props.items,
35
- props.renderItem
36
- ]);
37
- }, { "module": "@nativescript-community/octane" });
38
- var MemoListView = memo(ListInner, (a, b) => a.items === b.items);
39
- var List = defineUniversalComponent("nativescript", function List(props) {
40
- return universalValue(__octaneUniversalPlan3, [universalIf(props.items.length > 0, () => {
41
- return universalValue(__octaneUniversalPlan1, [universalComponent("nativescript", MemoListView, universalProps([
42
- [
43
- "set",
44
- "id",
45
- props.id
46
- ],
47
- [
48
- "set",
49
- "items",
50
- props.items
51
- ],
52
- [
53
- "set",
54
- "className",
55
- props.className
56
- ],
57
- [
58
- "set",
59
- "style",
60
- props.style
61
- ],
62
- [
63
- "set",
64
- "renderItem",
65
- props.renderItem
66
- ]
67
- ]))]);
68
- }, () => {
69
- return universalValue(__octaneUniversalPlan2, [props.renderEmpty?.()]);
70
- })]);
16
+ var Row = defineUniversalComponent("nativescript", function Row(props) {
17
+ return universalValue(__octaneUniversalPlan0, [universalProps([
18
+ [
19
+ "set",
20
+ "id",
21
+ props.id
22
+ ],
23
+ [
24
+ "set",
25
+ "ref",
26
+ (v) => applyEscapeProps(v, props)
27
+ ],
28
+ [
29
+ "set",
30
+ "flexDirection",
31
+ "row"
32
+ ],
33
+ [
34
+ "set",
35
+ "iosGlassEffect",
36
+ glassConfigOf(props.glass)
37
+ ],
38
+ [
39
+ "set",
40
+ "className",
41
+ cx(glassClassOf(props.glass), props.className)
42
+ ],
43
+ [
44
+ "set",
45
+ "style",
46
+ props.style
47
+ ],
48
+ ["spread", layoutChildProps(props)]
49
+ ]), props.children]);
71
50
  }, { "module": "@nativescript-community/octane" });
72
51
  //#endregion
73
- export { List };
52
+ export { Row };
@@ -1,33 +1,41 @@
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { glassClassOf, glassConfigOf } from "./ui4.js";
1
4
  import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
2
- //#region src/ScrollView.native.tsrx
5
+ //#region src/Grid.native.tsrx
3
6
  var __octaneUniversalPlan0 = universalPlan("nativescript", {
4
7
  "kind": "host",
5
- "type": "scrollview",
8
+ "type": "gridlayout",
6
9
  "bindings": [
7
10
  ["id", 0],
8
- ["className", 1],
9
- ["style", 2],
10
- ["orientation", 3]
11
+ ["ref", 1],
12
+ ["rows", 2],
13
+ ["columns", 3],
14
+ ["className", 4],
15
+ ["style", 5],
16
+ ["iosGlassEffect", 6]
11
17
  ],
12
18
  "children": [{
13
- "kind": "host",
14
- "type": "flexboxlayout",
15
- "bindings": [["flexDirection", 4]],
16
- "children": [{
17
- "kind": "slot",
18
- "slot": 5
19
- }]
19
+ "kind": "slot",
20
+ "slot": 7
20
21
  }]
21
22
  });
22
- var ScrollView = defineUniversalComponent("nativescript", function ScrollView(props) {
23
+ var warnedAboutGap = false;
24
+ var Grid = defineUniversalComponent("nativescript", function Grid(props) {
25
+ if (props.gap != null && !warnedAboutGap) {
26
+ warnedAboutGap = true;
27
+ console.warn("[Grid] gap is not supported; use child margins instead.");
28
+ }
23
29
  return universalValue(__octaneUniversalPlan0, [
24
30
  props.id,
25
- props.className,
31
+ (view) => applyEscapeProps(view, props),
32
+ props.rows,
33
+ props.columns,
34
+ cx("vx-grid", glassClassOf(props.glass), props.className),
26
35
  props.style,
27
- props.horizontal ? "horizontal" : "vertical",
28
- props.horizontal ? "row" : "column",
36
+ glassConfigOf(props.glass),
29
37
  props.children
30
38
  ]);
31
39
  }, { "module": "@nativescript-community/octane" });
32
40
  //#endregion
33
- export { ScrollView };
41
+ export { Grid };
@@ -1,24 +1,36 @@
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { glassClassOf, glassConfigOf } from "./ui4.js";
1
4
  import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
2
- //#region src/Image.native.tsrx
5
+ //#region src/Stack.native.tsrx
3
6
  var __octaneUniversalPlan0 = universalPlan("nativescript", {
4
7
  "kind": "host",
5
- "type": "image",
8
+ "type": "gridlayout",
9
+ "props": {
10
+ "rows": "*",
11
+ "columns": "*"
12
+ },
6
13
  "bindings": [
7
14
  ["id", 0],
8
- ["className", 1],
9
- ["style", 2],
10
- ["src", 3],
11
- ["accessibilityLabel", 4]
12
- ]
15
+ ["ref", 1],
16
+ ["iosGlassEffect", 2],
17
+ ["className", 3],
18
+ ["style", 4]
19
+ ],
20
+ "children": [{
21
+ "kind": "slot",
22
+ "slot": 5
23
+ }]
13
24
  });
14
- var Image = defineUniversalComponent("nativescript", function Image(props) {
25
+ var Stack = defineUniversalComponent("nativescript", function Stack(props) {
15
26
  return universalValue(__octaneUniversalPlan0, [
16
27
  props.id,
17
- props.className,
28
+ (view) => applyEscapeProps(view, props),
29
+ glassConfigOf(props.glass),
30
+ cx("vx-stack", glassClassOf(props.glass), props.className),
18
31
  props.style,
19
- props.src,
20
- props.alt
32
+ props.children
21
33
  ]);
22
34
  }, { "module": "@nativescript-community/octane" });
23
35
  //#endregion
24
- export { Image };
36
+ export { Stack };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "buildId": "cf079eb9-42ee-4226-83ff-a7f9254bf392",
3
+ "buildId": "09d40cb6-77c8-4f47-9fd0-53989e8bea06",
4
4
  "mode": "production",
5
5
  "capabilities": {
6
6
  "independentHydration": false
package/dist/web/ui.js CHANGED
@@ -1,19 +1,51 @@
1
- import { View } from "./ui2.js";
2
- import { Row } from "./ui3.js";
3
- import { Text } from "./ui4.js";
4
- import { Pressable } from "./ui5.js";
5
- import { TextInput } from "./ui6.js";
6
- import { List } from "./ui7.js";
7
- import { ScrollView } from "./ui8.js";
8
- import { Image } from "./ui9.js";
9
- import { Modal } from "./ui10.js";
10
- import { useAnimation } from "./ui11.js";
11
- import { getColorScheme, useColorScheme } from "./ui12.js";
12
- import { styled } from "./ui13.js";
13
- import { Screen } from "./ui14.js";
14
- import { currentRoute, pushRoute, routeFor, useRoute } from "./ui15.js";
15
- import { Tabs } from "./ui16.js";
16
- import { Switch } from "./ui17.js";
17
- import { PlatformBadge } from "./ui18.js";
18
- import { getStack, registerStack, stackEntries } from "./ui19.js";
19
- export { View as Column, Image, List, Modal, PlatformBadge, Pressable, Row, Screen, ScrollView, Switch, Tabs, Text, TextInput, View, currentRoute, getColorScheme, getStack, pushRoute, registerStack, routeFor, stackEntries, styled, useAnimation, useColorScheme, useRoute };
1
+ import { View } from "./ui5.js";
2
+ import { Row } from "./ui6.js";
3
+ import { Grid } from "./ui7.js";
4
+ import { Stack } from "./ui8.js";
5
+ import { Absolute } from "./ui9.js";
6
+ import { LiquidGlass } from "./ui10.js";
7
+ import { LiquidGlassContainer } from "./ui11.js";
8
+ import { Spacer } from "./ui12.js";
9
+ import { Text } from "./ui13.js";
10
+ import { RichText, RichTextSpan } from "./ui14.js";
11
+ import { Pressable } from "./ui15.js";
12
+ import { Link } from "./ui16.js";
13
+ import { deriveRouteManifest } from "./ui17.js";
14
+ import { canGoBack, currentModalRoute, currentRoute, hrefFor, popRoute, pushDeepLink, pushRoute, redirect, registerRoutes, registerScreens, routeFor, routeStacks, screenFor, useCanGoBack, useModalRoute, useRoute } from "./ui18.js";
15
+ import { NavLink } from "./ui19.js";
16
+ import { TextInput } from "./ui20.js";
17
+ import { TextArea } from "./ui21.js";
18
+ import { List } from "./ui22.js";
19
+ import { ScrollView } from "./ui23.js";
20
+ import { ScrollBox } from "./ui24.js";
21
+ import { Image } from "./ui25.js";
22
+ import { Modal } from "./ui26.js";
23
+ import { getColorScheme, useColorScheme } from "./ui27.js";
24
+ import { applyThemeClasses, getThemePreference, getThemeScheme, onThemeSchemeChange, setThemePreference, themeSchemeClasses, useThemeScheme } from "./ui29.js";
25
+ import { openModal } from "./ui30.js";
26
+ import { Overlay } from "./ui31.js";
27
+ import { Popover } from "./ui33.js";
28
+ import { showToast } from "./ui34.js";
29
+ import { useAnimation } from "./ui35.js";
30
+ import { styled } from "./ui36.js";
31
+ import { openWindow } from "./ui37.js";
32
+ import { Screen } from "./ui38.js";
33
+ import { Tabs } from "./ui39.js";
34
+ import { Switch } from "./ui40.js";
35
+ import { useSafeAreaInsets } from "./ui41.js";
36
+ import { SafeArea } from "./ui42.js";
37
+ import { KeyboardAvoiding } from "./ui43.js";
38
+ import { Drawer } from "./ui44.js";
39
+ import { ActivityIndicator } from "./ui46.js";
40
+ import { Meter } from "./ui48.js";
41
+ import { Slider } from "./ui49.js";
42
+ import { registerIcon, registerIcons } from "./ui50.js";
43
+ import { Icon } from "./ui51.js";
44
+ import { Heading } from "./ui52.js";
45
+ import { PlatformBadge } from "./ui53.js";
46
+ import { getStack, registerStack, stackEntries } from "./ui54.js";
47
+ import { createStore } from "./ui55.js";
48
+ import { useStore } from "./ui56.js";
49
+ import { Sheet } from "./ui57.js";
50
+ import { closeSheet, openSheet } from "./ui58.js";
51
+ export { Absolute, ActivityIndicator, View as Column, Drawer, Grid, Heading, Icon, Image, KeyboardAvoiding, Link, LiquidGlass, LiquidGlassContainer, List, Meter, Modal, NavLink, Overlay, PlatformBadge, Popover, Pressable, RichText, RichTextSpan, Row, SafeArea, Screen, ScrollBox, ScrollView, Sheet, Slider, Spacer, Stack, Switch, Tabs, Text, TextArea, TextInput, View, applyThemeClasses, canGoBack, closeSheet, createStore, currentModalRoute, currentRoute, deriveRouteManifest, getColorScheme, getStack, getThemePreference, getThemeScheme, hrefFor, onThemeSchemeChange, openModal, openSheet, openWindow, popRoute, pushDeepLink, pushRoute, redirect, registerIcon, registerIcons, registerRoutes, registerScreens, registerStack, routeFor, routeStacks, screenFor, setThemePreference, showToast, stackEntries, styled, themeSchemeClasses, useAnimation, useCanGoBack, useColorScheme, useModalRoute, useRoute, useSafeAreaInsets, useStore, useThemeScheme };
package/dist/web/ui10.js CHANGED
@@ -1,43 +1,46 @@
1
- import { __s, bag4, clone, delegateEvents, hookSlots, queueRefAttach, queueRefDetach, setEventHandler, template, useEffect, useRef } from "octane";
2
- import { childTextHoleUpdate, replaceRef } from "octane/internal/client";
3
- //#region src/Modal.web.tsrx
4
- delegateEvents(["close"]);
5
- var _t$0 = /* @__PURE__ */ template("<dialog class=\"vx-modal\"></dialog>");
6
- var _hs$ = /* @__PURE__ */ hookSlots(2);
1
+ import { applyEscapeProps } from "./ui2.js";
2
+ import { glassClassOf, glassStyleOf } from "./ui3.js";
3
+ import { __s, bag7, clone, queueRefAttach, queueRefDetach, setStyle, template } from "octane";
4
+ import { bindSignalAttribute, bindSignalChild, enableSignalBindings, replaceRef, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
5
+ //#region src/LiquidGlass.web.tsrx
6
+ enableSignalBindings(1, true);
7
+ var _t$0 = /* @__PURE__ */ template("<div></div>");
7
8
  var _rm$1 = [
8
9
  "r",
9
- "b",
10
- "a"
10
+ "e",
11
+ "b"
11
12
  ];
12
- var Modal = /* @__PURE__ */ __s(function Modal(props, __s, __extra) {
13
- const el = useRef(null, _hs$ + 0);
14
- useEffect(() => {
15
- const d = el.current;
16
- if (!d) return;
17
- if (props.open && !d.open) d.showModal();
18
- else if (!props.open && d.open) d.close();
19
- }, [props.open], _hs$ + 1);
13
+ var LiquidGlass = /* @__PURE__ */ __s(function LiquidGlass(props, __s, __extra) {
20
14
  let _b = __s.slots[0];
21
15
  if (_b === void 0) {
22
- let _m0, _m1;
16
+ let _m1, _m4;
23
17
  const _root = clone(_t$0);
24
- queueRefAttach(__s, _m1 = el, _m0 = _root);
25
- (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.b, _b.a));
26
- setEventHandler(_root, "$$close", props.onClose);
27
- _b = bag4(__s, _root, _m0, _m1, null, void 0);
18
+ _m1 = _root;
19
+ queueRefAttach(__s, _m4 = (el) => applyEscapeProps(el, props), _m1);
20
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.e, _b.b));
21
+ _b = bag7(__s, _root, void 0, _m1, void 0, void 0, _m4, null, void 0);
28
22
  __s.refFields = _rm$1;
29
23
  } else {
30
- {
31
- const _r = el;
32
- if (_r !== _b.b) _b.b = replaceRef(__s, _b.b, _r, _b.a);
33
- }
34
- setEventHandler(_b.a, "$$close", props.onClose);
24
+ const _r = (el) => applyEscapeProps(el, props);
25
+ if (_r !== _b.e) _b.e = replaceRef(__s, _b.e, _r, _b.b);
35
26
  }
27
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:3b4a2648", setPlainAttribute);
28
+ _b.c = updateFreshClassName([
29
+ "vx-stack",
30
+ glassClassOf({ variant: props.variant ?? "regular" }),
31
+ props.className
32
+ ], _b.c, _b.b);
36
33
  {
37
- const _v = props.children;
38
- _b.c = childTextHoleUpdate(__s, 1, _b.a, _v, _b.c, _b.d);
39
- _b.d = _v;
34
+ const _v = {
35
+ ...glassStyleOf({ tint: props.tint }),
36
+ ...props.style
37
+ };
38
+ if (_b.d !== _v) {
39
+ setStyle(_b.b, _v, _b.d);
40
+ _b.d = _v;
41
+ }
40
42
  }
43
+ _b.h = bindSignalChild(__s, _b.h, 1, _b.b, props.children, "b:9211318a", null, void 0, void 0, void 0, true);
41
44
  });
42
45
  //#endregion
43
- export { Modal };
46
+ export { LiquidGlass };
package/dist/web/ui11.js CHANGED
@@ -1,57 +1,42 @@
1
- import { hookSlots, useRef } from "octane";
2
- //#region src/anim.web.tsrx
3
- var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
4
- function createAnimated(initial, prop) {
5
- let el = null;
6
- let current = initial;
7
- let raf = 0;
8
- const apply = (v) => {
9
- current = v;
10
- if (el) el.style.transform = `translateX(${v}px)`;
11
- };
12
- const run = (step) => {
13
- cancelAnimationFrame(raf);
14
- const start = Date.now();
15
- const tick = () => {
16
- const v = step(Date.now() - start);
17
- if (v === null) return;
18
- apply(v);
19
- raf = requestAnimationFrame(tick);
20
- };
21
- raf = requestAnimationFrame(tick);
22
- };
23
- return {
24
- get value() {
25
- return current;
26
- },
27
- bind(e) {
28
- el = e;
29
- if (el) el.style.transform = `translateX(${current}px)`;
30
- },
31
- to(target, opts) {
32
- const dur = opts?.duration ?? 300;
33
- const from = current;
34
- run((t) => t >= dur ? (apply(target), null) : from + (target - from) * (t / dur));
35
- },
36
- spring(target, opts) {
37
- const damping = opts?.damping ?? 14, stiffness = opts?.stiffness ?? 120;
38
- let v = 0, x = current;
39
- run(() => {
40
- const dt = 1 / 60;
41
- v += (-stiffness * (x - target) - damping * v) * dt;
42
- x += v * dt;
43
- return Math.abs(v) < .5 && Math.abs(x - target) < .5 ? (apply(target), null) : x;
44
- });
45
- },
46
- stop() {
47
- cancelAnimationFrame(raf);
1
+ import { applyEscapeProps } from "./ui2.js";
2
+ import { __s, bag7, clone, queueRefAttach, queueRefDetach, setStyle, template } from "octane";
3
+ import { bindSignalAttribute, bindSignalChild, enableSignalBindings, replaceRef, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
4
+ //#region src/LiquidGlassContainer.web.tsrx
5
+ enableSignalBindings(1, true);
6
+ var _t$0 = /* @__PURE__ */ template("<div></div>");
7
+ var _rm$1 = [
8
+ "r",
9
+ "e",
10
+ "b"
11
+ ];
12
+ var LiquidGlassContainer = /* @__PURE__ */ __s(function LiquidGlassContainer(props, __s, __extra) {
13
+ let _b = __s.slots[0];
14
+ if (_b === void 0) {
15
+ let _m1, _m4;
16
+ const _root = clone(_t$0);
17
+ _m1 = _root;
18
+ queueRefAttach(__s, _m4 = (el) => applyEscapeProps(el, props), _m1);
19
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.e, _b.b));
20
+ _b = bag7(__s, _root, void 0, _m1, void 0, void 0, _m4, null, void 0);
21
+ __s.refFields = _rm$1;
22
+ } else {
23
+ const _r = (el) => applyEscapeProps(el, props);
24
+ if (_r !== _b.e) _b.e = replaceRef(__s, _b.e, _r, _b.b);
25
+ }
26
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:46ee8524", setPlainAttribute);
27
+ _b.c = updateFreshClassName([
28
+ "vx-absolute",
29
+ "vx-glass-container",
30
+ props.className
31
+ ], _b.c, _b.b);
32
+ {
33
+ const _v = props.style;
34
+ if (_b.d !== _v) {
35
+ setStyle(_b.b, _v, _b.d);
36
+ _b.d = _v;
48
37
  }
49
- };
50
- }
51
- function useAnimation(initial = 0, prop = "translateX") {
52
- const c = useRef(null, _h$0);
53
- if (!c.current) c.current = createAnimated(initial, prop);
54
- return c.current;
55
- }
38
+ }
39
+ _b.h = bindSignalChild(__s, _b.h, 1, _b.b, props.children, "b:295618e2", null, void 0, void 0, void 0, true);
40
+ });
56
41
  //#endregion
57
- export { useAnimation };
42
+ export { LiquidGlassContainer };
package/dist/web/ui12.js CHANGED
@@ -1,16 +1,37 @@
1
- import { hookSlots, useSyncExternalStore } from "octane";
2
- //#region src/theme/colorScheme.web.tsrx
3
- var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
4
- function getColorScheme() {
5
- return typeof matchMedia === "function" && matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
6
- }
7
- function subscribe(cb) {
8
- const mq = matchMedia("(prefers-color-scheme: dark)");
9
- mq.addEventListener("change", cb);
10
- return () => mq.removeEventListener("change", cb);
11
- }
12
- function useColorScheme() {
13
- return useSyncExternalStore(subscribe, getColorScheme, _h$0);
14
- }
1
+ import { applyEscapeProps } from "./ui2.js";
2
+ import { __s, bag5, clone, queueRefAttach, queueRefDetach, setStyle, template } from "octane";
3
+ import { bindSignalAttribute, enableSignalBindings, replaceRef, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
4
+ //#region src/Spacer.web.tsrx
5
+ enableSignalBindings(1, true);
6
+ var _t$0 = /* @__PURE__ */ template("<div></div>");
7
+ var _rm$0 = [
8
+ "r",
9
+ "e",
10
+ "b"
11
+ ];
12
+ var Spacer = /* @__PURE__ */ __s(function Spacer(props, __s, __extra) {
13
+ let _b = __s.slots[0];
14
+ if (_b === void 0) {
15
+ let _m1, _m4;
16
+ const _root = clone(_t$0);
17
+ _m1 = _root;
18
+ queueRefAttach(__s, _m4 = (el) => applyEscapeProps(el, props), _m1);
19
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.e, _b.b));
20
+ _b = bag5(__s, _root, void 0, _m1, void 0, void 0, _m4);
21
+ __s.refFields = _rm$0;
22
+ } else {
23
+ const _r = (el) => applyEscapeProps(el, props);
24
+ if (_r !== _b.e) _b.e = replaceRef(__s, _b.e, _r, _b.b);
25
+ }
26
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:91b4d3c0", setPlainAttribute);
27
+ _b.c = updateFreshClassName(["vx-spacer", props.className], _b.c, _b.b);
28
+ {
29
+ const _v = props.style;
30
+ if (_b.d !== _v) {
31
+ setStyle(_b.b, _v, _b.d);
32
+ _b.d = _v;
33
+ }
34
+ }
35
+ });
15
36
  //#endregion
16
- export { getColorScheme, useColorScheme };
37
+ export { Spacer };