@hanzogui/demos 4.4.0 → 8.0.1

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 (137) hide show
  1. package/dist/cjs/AccordionDemo.native.js.map +1 -1
  2. package/dist/cjs/AddThemeDemo.native.js.map +1 -1
  3. package/dist/cjs/AlertDialogDemo.native.js.map +1 -1
  4. package/dist/cjs/AnimationsDelayDemo.native.js.map +1 -1
  5. package/dist/cjs/AnimationsDemo.native.js.map +1 -1
  6. package/dist/cjs/AnimationsEnterDemo.native.js.map +1 -1
  7. package/dist/cjs/AnimationsHoverDemo.native.js.map +1 -1
  8. package/dist/cjs/AnimationsPresenceDemo.native.js.map +1 -1
  9. package/dist/cjs/AnimationsTimingDemo.native.js.map +1 -1
  10. package/dist/cjs/AvatarDemo.native.js.map +1 -1
  11. package/dist/cjs/BoxShadowTokenDemo.native.js.map +1 -1
  12. package/dist/cjs/BuildAButtonDemo.native.js.map +1 -1
  13. package/dist/cjs/ButtonDemo.native.js.map +1 -1
  14. package/dist/cjs/CardDemo.native.js.map +1 -1
  15. package/dist/cjs/CheckboxDemo.native.js.map +1 -1
  16. package/dist/cjs/CheckboxHeadlessDemo.native.js.map +1 -1
  17. package/dist/cjs/CheckboxUnstyledDemo.native.js.map +1 -1
  18. package/dist/cjs/ColorsDemo.native.js.map +1 -1
  19. package/dist/cjs/ContextMenuDemo.native.js.map +1 -1
  20. package/dist/cjs/DialogDemo.native.js.map +1 -1
  21. package/dist/cjs/FormsDemo.native.js.map +1 -1
  22. package/dist/cjs/Grid.native.js.map +1 -1
  23. package/dist/cjs/GroupDemo.native.js.map +1 -1
  24. package/dist/cjs/HeadingsDemo.native.js.map +1 -1
  25. package/dist/cjs/ImageDemo.native.js.map +1 -1
  26. package/dist/cjs/InputsDemo.native.js.map +1 -1
  27. package/dist/cjs/LabelDemo.native.js.map +1 -1
  28. package/dist/cjs/LinearGradientDemo.native.js.map +1 -1
  29. package/dist/cjs/ListItemDemo.cjs +8 -0
  30. package/dist/cjs/ListItemDemo.native.js +8 -0
  31. package/dist/cjs/ListItemDemo.native.js.map +1 -1
  32. package/dist/cjs/LucideIconsDemo.native.js.map +1 -1
  33. package/dist/cjs/MenuDemo.native.js.map +1 -1
  34. package/dist/cjs/NewInputsDemo.native.js.map +1 -1
  35. package/dist/cjs/PopoverDemo.native.js.map +1 -1
  36. package/dist/cjs/ProgressDemo.native.js.map +1 -1
  37. package/dist/cjs/RadioGroupDemo.native.js.map +1 -1
  38. package/dist/cjs/RadioGroupHeadlessDemo.native.js.map +1 -1
  39. package/dist/cjs/RadioGroupUnstyledDemo.native.js.map +1 -1
  40. package/dist/cjs/ReplaceThemeDemo.native.js.map +1 -1
  41. package/dist/cjs/ScrollViewDemo.native.js.map +1 -1
  42. package/dist/cjs/SelectDemo.cjs +1 -1
  43. package/dist/cjs/SelectDemo.native.js +1 -1
  44. package/dist/cjs/SelectDemo.native.js.map +1 -1
  45. package/dist/cjs/SeparatorDemo.native.js.map +1 -1
  46. package/dist/cjs/ShapesDemo.native.js.map +1 -1
  47. package/dist/cjs/SheetDemo.native.js.map +1 -1
  48. package/dist/cjs/SliderDemo.native.js.map +1 -1
  49. package/dist/cjs/SpinnerDemo.native.js.map +1 -1
  50. package/dist/cjs/StacksDemo.native.js.map +1 -1
  51. package/dist/cjs/SwitchDemo.native.js.map +1 -1
  52. package/dist/cjs/SwitchHeadlessDemo.native.js.map +1 -1
  53. package/dist/cjs/SwitchUnstyledDemo.native.js.map +1 -1
  54. package/dist/cjs/TabsAdvancedDemo.cjs +8 -8
  55. package/dist/cjs/TabsAdvancedDemo.native.js +8 -8
  56. package/dist/cjs/TabsAdvancedDemo.native.js.map +1 -1
  57. package/dist/cjs/TabsDemo.native.js.map +1 -1
  58. package/dist/cjs/TabsHeadlessDemo.native.js.map +1 -1
  59. package/dist/cjs/TextDemo.native.js.map +1 -1
  60. package/dist/cjs/ThemeBuilderDemo.native.js.map +1 -1
  61. package/dist/cjs/ThemeInverseDemo.native.js.map +1 -1
  62. package/dist/cjs/ToastDemo.cjs +190 -113
  63. package/dist/cjs/ToastDemo.native.js +201 -117
  64. package/dist/cjs/ToastDemo.native.js.map +1 -1
  65. package/dist/cjs/ToastDuplicateDemo.cjs +30 -43
  66. package/dist/cjs/ToastDuplicateDemo.native.js +31 -48
  67. package/dist/cjs/ToastDuplicateDemo.native.js.map +1 -1
  68. package/dist/cjs/ToastV1Demo.cjs +155 -0
  69. package/dist/cjs/ToastV1Demo.native.js +166 -0
  70. package/dist/cjs/ToastV1Demo.native.js.map +1 -0
  71. package/dist/cjs/ToggleGroupDemo.native.js.map +1 -1
  72. package/dist/cjs/TokensDemo.native.js.map +1 -1
  73. package/dist/cjs/TooltipDemo.native.js.map +1 -1
  74. package/dist/cjs/UpdateThemeDemo.native.js.map +1 -1
  75. package/dist/cjs/WebNativeImageDemo.native.js.map +1 -1
  76. package/dist/cjs/{gui.config.cjs → hanzogui.config.cjs} +5 -5
  77. package/dist/cjs/{gui.config.native.js → hanzogui.config.native.js} +6 -6
  78. package/dist/cjs/hanzogui.config.native.js.map +1 -0
  79. package/dist/cjs/index.cjs +1 -0
  80. package/dist/cjs/index.native.js +1 -0
  81. package/dist/cjs/index.native.js.map +1 -1
  82. package/dist/cjs/useOnIntersecting.native.js.map +1 -1
  83. package/dist/esm/AnimationsPresenceDemo.mjs.map +1 -1
  84. package/dist/esm/AnimationsPresenceDemo.native.js.map +1 -1
  85. package/dist/esm/ListItemDemo.mjs +8 -0
  86. package/dist/esm/ListItemDemo.mjs.map +1 -1
  87. package/dist/esm/ListItemDemo.native.js +8 -0
  88. package/dist/esm/ListItemDemo.native.js.map +1 -1
  89. package/dist/esm/SelectDemo.mjs +1 -1
  90. package/dist/esm/SelectDemo.mjs.map +1 -1
  91. package/dist/esm/SelectDemo.native.js +1 -1
  92. package/dist/esm/SelectDemo.native.js.map +1 -1
  93. package/dist/esm/TabsAdvancedDemo.mjs +8 -8
  94. package/dist/esm/TabsAdvancedDemo.mjs.map +1 -1
  95. package/dist/esm/TabsAdvancedDemo.native.js +8 -8
  96. package/dist/esm/TabsAdvancedDemo.native.js.map +1 -1
  97. package/dist/esm/ToastDemo.mjs +190 -102
  98. package/dist/esm/ToastDemo.mjs.map +1 -1
  99. package/dist/esm/ToastDemo.native.js +202 -107
  100. package/dist/esm/ToastDemo.native.js.map +1 -1
  101. package/dist/esm/ToastDuplicateDemo.mjs +30 -32
  102. package/dist/esm/ToastDuplicateDemo.mjs.map +1 -1
  103. package/dist/esm/ToastDuplicateDemo.native.js +31 -37
  104. package/dist/esm/ToastDuplicateDemo.native.js.map +1 -1
  105. package/dist/esm/ToastV1Demo.mjs +119 -0
  106. package/dist/esm/ToastV1Demo.mjs.map +1 -0
  107. package/dist/esm/ToastV1Demo.native.js +127 -0
  108. package/dist/esm/ToastV1Demo.native.js.map +1 -0
  109. package/dist/esm/TooltipDemo.mjs.map +1 -1
  110. package/dist/esm/TooltipDemo.native.js.map +1 -1
  111. package/dist/esm/hanzogui.config.mjs +6 -0
  112. package/dist/esm/hanzogui.config.mjs.map +1 -0
  113. package/dist/esm/hanzogui.config.native.js +6 -0
  114. package/dist/esm/hanzogui.config.native.js.map +1 -0
  115. package/dist/esm/index.js +1 -0
  116. package/dist/esm/index.js.map +1 -1
  117. package/dist/esm/index.mjs +1 -0
  118. package/dist/esm/index.mjs.map +1 -1
  119. package/dist/esm/index.native.js +1 -0
  120. package/dist/esm/index.native.js.map +1 -1
  121. package/package.json +40 -17
  122. package/src/ListItemDemo.tsx +26 -5
  123. package/src/MenuDemo.tsx +1 -1
  124. package/src/SelectDemo.tsx +2 -11
  125. package/src/TabsAdvancedDemo.tsx +13 -11
  126. package/src/ToastDemo.tsx +208 -93
  127. package/src/ToastDuplicateDemo.tsx +38 -28
  128. package/src/ToastV1Demo.tsx +121 -0
  129. package/src/TooltipDemo.tsx +1 -9
  130. package/src/{gui.config.ts → hanzogui.config.ts} +1 -1
  131. package/src/index.tsx +3 -2
  132. package/LICENSE +0 -21
  133. package/dist/cjs/gui.config.native.js.map +0 -1
  134. package/dist/esm/gui.config.mjs +0 -6
  135. package/dist/esm/gui.config.mjs.map +0 -1
  136. package/dist/esm/gui.config.native.js +0 -6
  137. package/dist/esm/gui.config.native.js.map +0 -1
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all) __defProp(target, name, {
@@ -19,15 +17,6 @@ var __copyProps = (to, from, except, desc) => {
19
17
  }
20
18
  return to;
21
19
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
30
- }) : target, mod));
31
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
21
  value: true
33
22
  }), mod);
@@ -36,120 +25,208 @@ __export(ToastDemo_exports, {
36
25
  ToastDemo: () => ToastDemo
37
26
  });
38
27
  module.exports = __toCommonJS(ToastDemo_exports);
39
- var import_toast = require("@hanzogui/toast");
40
- var import_react = __toESM(require("react"), 1);
41
28
  var import_gui = require("@hanzo/gui");
29
+ var import_v2 = require("@hanzogui/toast/v2");
30
+ var import_lucide_icons_2 = require("@hanzogui/lucide-icons-2");
31
+ var import_react = require("react");
32
+ var import_gui2 = require("@hanzo/gui");
42
33
  var import_jsx_runtime = require("react/jsx-runtime");
43
34
  const ToastDemo = () => {
44
- const [native, setNative] = import_react.default.useState(false);
45
- return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui.YStack, {
46
- gap: "$4",
47
- items: "center",
48
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(ToastControl, {
49
- native
50
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(CurrentToast, {}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(NativeOptions, {
51
- native,
52
- setNative
35
+ const [position, setPosition] = (0, import_react.useState)("bottom-right");
36
+ const [gap, setGap] = (0, import_react.useState)(14);
37
+ const [visibleToasts, setVisibleToasts] = (0, import_react.useState)(4);
38
+ const [duration, setDuration] = (0, import_react.useState)(4e3);
39
+ const count = (0, import_react.useRef)(0);
40
+ const showToast = newPosition => {
41
+ setPosition(newPosition);
42
+ count.current++;
43
+ (0, import_v2.toast)(`Toast #${count.current}`, {
44
+ description: "Swipe to dismiss or wait for auto-close."
45
+ });
46
+ };
47
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_v2.Toast, {
48
+ position,
49
+ gap: Math.round(gap),
50
+ visibleToasts,
51
+ duration,
52
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_v2.Toast.Viewport, {
53
+ offset: 16,
54
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_v2.Toast.List, {
55
+ renderItem: ({
56
+ toast: t,
57
+ index
58
+ }) => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_v2.Toast.Item, {
59
+ toast: t,
60
+ index,
61
+ testID: "toast-item",
62
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(ToastContent, {
63
+ toast: t
64
+ })
65
+ }, t.id)
66
+ })
67
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui2.YStack, {
68
+ gap: "$3",
69
+ self: "center",
70
+ width: 280,
71
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui2.YStack, {
72
+ gap: "$2",
73
+ self: "center",
74
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui2.XStack, {
75
+ gap: "$2",
76
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(PositionButton, {
77
+ position: "top-left",
78
+ current: position,
79
+ onPress: showToast,
80
+ Icon: import_lucide_icons_2.ArrowUpLeft
81
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(PositionButton, {
82
+ position: "top-center",
83
+ current: position,
84
+ onPress: showToast,
85
+ Icon: import_lucide_icons_2.ArrowUp
86
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(PositionButton, {
87
+ position: "top-right",
88
+ current: position,
89
+ onPress: showToast,
90
+ Icon: import_lucide_icons_2.ArrowUpRight,
91
+ testID: "toast-top-right-button"
92
+ })]
93
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui2.XStack, {
94
+ gap: "$2",
95
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(PositionButton, {
96
+ position: "bottom-left",
97
+ current: position,
98
+ onPress: showToast,
99
+ Icon: import_lucide_icons_2.ArrowDownLeft
100
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(PositionButton, {
101
+ position: "bottom-center",
102
+ current: position,
103
+ onPress: showToast,
104
+ Icon: import_lucide_icons_2.ArrowDown
105
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(PositionButton, {
106
+ position: "bottom-right",
107
+ current: position,
108
+ onPress: showToast,
109
+ Icon: import_lucide_icons_2.ArrowDownRight,
110
+ testID: "toast-show-button"
111
+ })]
112
+ })]
113
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui2.YStack, {
114
+ gap: "$1",
115
+ paddingTop: "$1",
116
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(DemoSlider, {
117
+ label: "Gap",
118
+ value: gap,
119
+ min: 0,
120
+ max: 30,
121
+ step: 0.1,
122
+ onChange: setGap
123
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(DemoSlider, {
124
+ label: "Visible",
125
+ value: visibleToasts,
126
+ min: 1,
127
+ max: 8,
128
+ step: 1,
129
+ onChange: setVisibleToasts
130
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(DemoSlider, {
131
+ label: "Duration",
132
+ value: duration,
133
+ min: 1e3,
134
+ max: 1e4,
135
+ step: 100,
136
+ onChange: setDuration,
137
+ format: v => `${(v / 1e3).toFixed(1)}s`
138
+ })]
139
+ })]
53
140
  })]
54
141
  });
55
142
  };
56
- const CurrentToast = () => {
57
- const currentToast = (0, import_toast.useToastState)();
58
- if (!currentToast || currentToast.isHandledNatively) return null;
59
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_toast.Toast, {
60
- duration: currentToast.duration,
61
- viewportName: currentToast.viewportName,
62
- enterStyle: {
63
- opacity: 0,
64
- scale: 0.95,
65
- y: -80
66
- },
67
- exitStyle: {
68
- opacity: 0,
69
- scale: 0.95,
70
- y: -80
71
- },
72
- opacity: 1,
73
- scale: 1,
74
- y: -50,
75
- transition: "quicker",
76
- bg: "$color2",
77
- boxShadow: "0px 2px 4px rgba(0,0,0,0.12), 0px 8px 24px rgba(0,0,0,0.08)",
78
- children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui.XStack, {
79
- gap: "$5",
80
- items: "center",
81
- justify: "space-between",
82
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui.YStack, {
83
- gap: "$0.5",
143
+ function ToastContent({
144
+ toast: t
145
+ }) {
146
+ const {
147
+ handleClose
148
+ } = (0, import_v2.useToastItem)();
149
+ const title = typeof t.title === "function" ? t.title() : t.title;
150
+ const description = typeof t.description === "function" ? t.description() : t.description;
151
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
152
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui2.XStack, {
153
+ gap: "$3",
154
+ alignItems: "flex-start",
155
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_v2.Toast.Icon, {}), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui2.YStack, {
84
156
  flex: 1,
85
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_toast.Toast.Title, {
86
- children: currentToast.title
87
- }), !!currentToast.message && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_toast.Toast.Description, {
88
- children: currentToast.message
89
- })]
90
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_toast.Toast.Action, {
91
- asChild: true,
92
- altText: "Dismiss toast",
93
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui.Button, {
157
+ gap: "$0.5",
158
+ children: [title && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_v2.Toast.Title, {
159
+ fontWeight: "600",
160
+ size: "$3",
161
+ children: title
162
+ }), description && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_v2.Toast.Description, {
163
+ color: "$color9",
94
164
  size: "$2",
95
- children: "Dismiss"
96
- })
165
+ children: description
166
+ })]
97
167
  })]
98
- })
99
- }, currentToast.id);
100
- };
101
- const ToastControl = ({
102
- native
103
- }) => {
104
- const toast = (0, import_toast.useToastController)();
105
- return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui.XStack, {
106
- gap: "$2",
107
- justify: "center",
108
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui.Button, {
109
- onPress: () => {
110
- toast.show("Successfully saved!", {
111
- message: "Don't worry, we've got your data.",
112
- native,
113
- demo: true
114
- });
115
- },
116
- children: "Show"
117
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui.Button, {
118
- onPress: () => {
119
- toast.hide();
120
- },
121
- children: "Hide"
168
+ }), import_gui.isWeb && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_v2.Toast.Close, {
169
+ testID: "toast-close-button",
170
+ position: "absolute",
171
+ top: -6,
172
+ left: -6,
173
+ zIndex: 1
122
174
  })]
123
175
  });
124
- };
125
- const NativeOptions = ({
126
- native,
127
- setNative
128
- }) => {
129
- return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui.XStack, {
130
- gap: "$3",
131
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui.Label, {
132
- size: "$1",
133
- onPress: () => setNative(false),
134
- children: "Custom"
135
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui.Switch, {
136
- theme: "surface2",
137
- id: "native-toggle",
138
- size: "$1",
139
- checked: !!native,
140
- onCheckedChange: val => setNative(val),
141
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui.Switch.Thumb, {
176
+ }
177
+ function DemoSlider({
178
+ label,
179
+ value,
180
+ min,
181
+ max,
182
+ step,
183
+ onChange,
184
+ format
185
+ }) {
186
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui2.XStack, {
187
+ gap: "$2",
188
+ alignItems: "center",
189
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui2.Label, {
190
+ size: "$2",
191
+ width: 55,
192
+ children: label
193
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_gui2.Slider, {
194
+ flex: 1,
195
+ value: [value],
196
+ min,
197
+ max,
198
+ step,
199
+ onValueChange: ([v]) => onChange(v),
200
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui2.Slider.Track, {
201
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui2.Slider.TrackActive, {})
202
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui2.Slider.Thumb, {
142
203
  theme: "accent",
143
- transition: ["quickest", {
144
- transform: {
145
- overshootClamping: true
146
- }
147
- }]
148
- })
149
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui.Label, {
150
- size: "$1",
151
- onPress: () => setNative(true),
152
- children: "Native"
204
+ size: 16,
205
+ borderRadius: 100,
206
+ index: 0
207
+ })]
208
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui2.SizableText, {
209
+ userSelect: "none",
210
+ size: "$2",
211
+ width: 35,
212
+ textAlign: "right",
213
+ children: format ? format(value) : Math.round(value)
153
214
  })]
154
215
  });
216
+ }
217
+ const PositionButton = ({
218
+ position,
219
+ current,
220
+ onPress,
221
+ Icon,
222
+ testID
223
+ }) => {
224
+ const isActive = position === current;
225
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui2.Button, {
226
+ icon: Icon,
227
+ circular: true,
228
+ theme: isActive ? "accent" : void 0,
229
+ onPress: () => onPress(position),
230
+ testID
231
+ });
155
232
  };