@number10/jsx-components 5.0.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 (256) hide show
  1. package/LICENSE +667 -0
  2. package/README.md +43 -0
  3. package/dist/Accordion.cjs +1 -0
  4. package/dist/Accordion.d.ts +43 -0
  5. package/dist/Accordion.d.ts.map +1 -0
  6. package/dist/Accordion.js +71 -0
  7. package/dist/Accordion.test.d.ts +2 -0
  8. package/dist/Accordion.test.d.ts.map +1 -0
  9. package/dist/ActivityIndicator.cjs +1 -0
  10. package/dist/ActivityIndicator.d.ts +21 -0
  11. package/dist/ActivityIndicator.d.ts.map +1 -0
  12. package/dist/ActivityIndicator.js +133 -0
  13. package/dist/AlertDialog.cjs +1 -0
  14. package/dist/AlertDialog.d.ts +53 -0
  15. package/dist/AlertDialog.d.ts.map +1 -0
  16. package/dist/AlertDialog.js +76 -0
  17. package/dist/Badge.cjs +1 -0
  18. package/dist/Badge.d.ts +96 -0
  19. package/dist/Badge.d.ts.map +1 -0
  20. package/dist/Badge.js +238 -0
  21. package/dist/Badge.test.d.ts +2 -0
  22. package/dist/Badge.test.d.ts.map +1 -0
  23. package/dist/BottomSheet.cjs +1 -0
  24. package/dist/BottomSheet.d.ts +72 -0
  25. package/dist/BottomSheet.d.ts.map +1 -0
  26. package/dist/BottomSheet.js +132 -0
  27. package/dist/Button.cjs +1 -0
  28. package/dist/Button.d.ts +61 -0
  29. package/dist/Button.d.ts.map +1 -0
  30. package/dist/Button.js +251 -0
  31. package/dist/Checkbox.cjs +1 -0
  32. package/dist/Checkbox.d.ts +40 -0
  33. package/dist/Checkbox.d.ts.map +1 -0
  34. package/dist/Checkbox.js +84 -0
  35. package/dist/Checkbox.test.d.ts +2 -0
  36. package/dist/Checkbox.test.d.ts.map +1 -0
  37. package/dist/ColorPicker.cjs +1 -0
  38. package/dist/ColorPicker.d.ts +48 -0
  39. package/dist/ColorPicker.d.ts.map +1 -0
  40. package/dist/ColorPicker.js +256 -0
  41. package/dist/DebugPanel.cjs +1 -0
  42. package/dist/DebugPanel.d.ts +63 -0
  43. package/dist/DebugPanel.d.ts.map +1 -0
  44. package/dist/DebugPanel.js +116 -0
  45. package/dist/Dialog.cjs +1 -0
  46. package/dist/Dialog.d.ts +59 -0
  47. package/dist/Dialog.d.ts.map +1 -0
  48. package/dist/Dialog.js +142 -0
  49. package/dist/Divider.cjs +1 -0
  50. package/dist/Divider.d.ts +19 -0
  51. package/dist/Divider.d.ts.map +1 -0
  52. package/dist/Divider.js +15 -0
  53. package/dist/Divider.test.d.ts +2 -0
  54. package/dist/Divider.test.d.ts.map +1 -0
  55. package/dist/Dropdown.cjs +1 -0
  56. package/dist/Dropdown.d.ts +35 -0
  57. package/dist/Dropdown.d.ts.map +1 -0
  58. package/dist/Dropdown.js +222 -0
  59. package/dist/Icon.cjs +1 -0
  60. package/dist/Icon.d.ts +71 -0
  61. package/dist/Icon.d.ts.map +1 -0
  62. package/dist/Icon.js +57 -0
  63. package/dist/Icon.test.d.ts +2 -0
  64. package/dist/Icon.test.d.ts.map +1 -0
  65. package/dist/Image.cjs +1 -0
  66. package/dist/Image.d.ts +10 -0
  67. package/dist/Image.d.ts.map +1 -0
  68. package/dist/Image.js +18 -0
  69. package/dist/Joystick.cjs +1 -0
  70. package/dist/Joystick.d.ts +32 -0
  71. package/dist/Joystick.d.ts.map +1 -0
  72. package/dist/Joystick.js +185 -0
  73. package/dist/ListBox.cjs +1 -0
  74. package/dist/ListBox.d.ts +67 -0
  75. package/dist/ListBox.d.ts.map +1 -0
  76. package/dist/ListBox.js +104 -0
  77. package/dist/ListBox.test.d.ts +2 -0
  78. package/dist/ListBox.test.d.ts.map +1 -0
  79. package/dist/MenuButton.cjs +1 -0
  80. package/dist/MenuButton.d.ts +33 -0
  81. package/dist/MenuButton.d.ts.map +1 -0
  82. package/dist/MenuButton.js +63 -0
  83. package/dist/Modal.cjs +1 -0
  84. package/dist/Modal.d.ts +27 -0
  85. package/dist/Modal.d.ts.map +1 -0
  86. package/dist/Modal.js +174 -0
  87. package/dist/Modal.test.d.ts +2 -0
  88. package/dist/Modal.test.d.ts.map +1 -0
  89. package/dist/NineSlice.cjs +1 -0
  90. package/dist/NineSlice.d.ts +40 -0
  91. package/dist/NineSlice.d.ts.map +1 -0
  92. package/dist/NineSlice.js +314 -0
  93. package/dist/NineSlice.props.test.d.ts +2 -0
  94. package/dist/NineSlice.props.test.d.ts.map +1 -0
  95. package/dist/NineSlice.test.d.ts +2 -0
  96. package/dist/NineSlice.test.d.ts.map +1 -0
  97. package/dist/NineSliceButton.cjs +1 -0
  98. package/dist/NineSliceButton.d.ts +94 -0
  99. package/dist/NineSliceButton.d.ts.map +1 -0
  100. package/dist/NineSliceButton.js +61 -0
  101. package/dist/NineSliceButton.test.d.ts +2 -0
  102. package/dist/NineSliceButton.test.d.ts.map +1 -0
  103. package/dist/NumberInput.cjs +1 -0
  104. package/dist/NumberInput.d.ts +90 -0
  105. package/dist/NumberInput.d.ts.map +1 -0
  106. package/dist/NumberInput.js +222 -0
  107. package/dist/NumberInput.test.d.ts +2 -0
  108. package/dist/NumberInput.test.d.ts.map +1 -0
  109. package/dist/PalettePicker.cjs +1 -0
  110. package/dist/PalettePicker.d.ts +49 -0
  111. package/dist/PalettePicker.d.ts.map +1 -0
  112. package/dist/PalettePicker.js +152 -0
  113. package/dist/PalettePicker.test.d.ts +2 -0
  114. package/dist/PalettePicker.test.d.ts.map +1 -0
  115. package/dist/Popover.cjs +1 -0
  116. package/dist/Popover.d.ts +95 -0
  117. package/dist/Popover.d.ts.map +1 -0
  118. package/dist/Popover.js +267 -0
  119. package/dist/Portal.cjs +1 -0
  120. package/dist/Portal.d.ts +30 -0
  121. package/dist/Portal.d.ts.map +1 -0
  122. package/dist/Portal.js +64 -0
  123. package/dist/Portal.test.d.ts +2 -0
  124. package/dist/Portal.test.d.ts.map +1 -0
  125. package/dist/ProgressBar.cjs +1 -0
  126. package/dist/ProgressBar.d.ts +61 -0
  127. package/dist/ProgressBar.d.ts.map +1 -0
  128. package/dist/ProgressBar.js +80 -0
  129. package/dist/ProgressBar.test.d.ts +2 -0
  130. package/dist/ProgressBar.test.d.ts.map +1 -0
  131. package/dist/ProgressView.cjs +1 -0
  132. package/dist/ProgressView.d.ts +37 -0
  133. package/dist/ProgressView.d.ts.map +1 -0
  134. package/dist/ProgressView.js +71 -0
  135. package/dist/RadioButton.cjs +1 -0
  136. package/dist/RadioButton.d.ts +21 -0
  137. package/dist/RadioButton.d.ts.map +1 -0
  138. package/dist/RadioButton.js +53 -0
  139. package/dist/RadioGroup.cjs +1 -0
  140. package/dist/RadioGroup.d.ts +26 -0
  141. package/dist/RadioGroup.d.ts.map +1 -0
  142. package/dist/RadioGroup.js +32 -0
  143. package/dist/RatingBar.cjs +1 -0
  144. package/dist/RatingBar.d.ts +24 -0
  145. package/dist/RatingBar.d.ts.map +1 -0
  146. package/dist/RatingBar.js +84 -0
  147. package/dist/ScrollSlider.cjs +1 -0
  148. package/dist/ScrollSlider.d.ts +48 -0
  149. package/dist/ScrollSlider.d.ts.map +1 -0
  150. package/dist/ScrollSlider.js +93 -0
  151. package/dist/ScrollView.cjs +1 -0
  152. package/dist/ScrollView.d.ts +121 -0
  153. package/dist/ScrollView.d.ts.map +1 -0
  154. package/dist/ScrollView.js +541 -0
  155. package/dist/ScrollView.test.d.ts +2 -0
  156. package/dist/ScrollView.test.d.ts.map +1 -0
  157. package/dist/SegmentedControl.cjs +1 -0
  158. package/dist/SegmentedControl.d.ts +50 -0
  159. package/dist/SegmentedControl.d.ts.map +1 -0
  160. package/dist/SegmentedControl.js +201 -0
  161. package/dist/SegmentedControl.test.d.ts +2 -0
  162. package/dist/SegmentedControl.test.d.ts.map +1 -0
  163. package/dist/Sidebar.cjs +1 -0
  164. package/dist/Sidebar.d.ts +36 -0
  165. package/dist/Sidebar.d.ts.map +1 -0
  166. package/dist/Sidebar.js +122 -0
  167. package/dist/Slider.cjs +1 -0
  168. package/dist/Slider.d.ts +80 -0
  169. package/dist/Slider.d.ts.map +1 -0
  170. package/dist/Slider.js +233 -0
  171. package/dist/Tabs.cjs +1 -0
  172. package/dist/Tabs.d.ts +23 -0
  173. package/dist/Tabs.d.ts.map +1 -0
  174. package/dist/Tabs.js +101 -0
  175. package/dist/TextInput.cjs +17 -0
  176. package/dist/TextInput.d.ts +82 -0
  177. package/dist/TextInput.d.ts.map +1 -0
  178. package/dist/TextInput.js +441 -0
  179. package/dist/Toast.cjs +1 -0
  180. package/dist/Toast.d.ts +66 -0
  181. package/dist/Toast.d.ts.map +1 -0
  182. package/dist/Toast.js +188 -0
  183. package/dist/Toast.test.d.ts +2 -0
  184. package/dist/Toast.test.d.ts.map +1 -0
  185. package/dist/Toggle.cjs +1 -0
  186. package/dist/Toggle.d.ts +14 -0
  187. package/dist/Toggle.d.ts.map +1 -0
  188. package/dist/Toggle.js +135 -0
  189. package/dist/Toolbar.cjs +1 -0
  190. package/dist/Toolbar.d.ts +129 -0
  191. package/dist/Toolbar.d.ts.map +1 -0
  192. package/dist/Toolbar.js +159 -0
  193. package/dist/Toolbar.test.d.ts +2 -0
  194. package/dist/Toolbar.test.d.ts.map +1 -0
  195. package/dist/TransformOriginView.cjs +1 -0
  196. package/dist/TransformOriginView.d.ts +8 -0
  197. package/dist/TransformOriginView.d.ts.map +1 -0
  198. package/dist/TransformOriginView.js +38 -0
  199. package/dist/WheelPicker.cjs +1 -0
  200. package/dist/WheelPicker.d.ts +58 -0
  201. package/dist/WheelPicker.d.ts.map +1 -0
  202. package/dist/WheelPicker.js +167 -0
  203. package/dist/WrapText.cjs +1 -0
  204. package/dist/WrapText.d.ts +83 -0
  205. package/dist/WrapText.d.ts.map +1 -0
  206. package/dist/WrapText.js +93 -0
  207. package/dist/WrapText.test.d.ts +2 -0
  208. package/dist/WrapText.test.d.ts.map +1 -0
  209. package/dist/contrast-slot-map.d.ts +33 -0
  210. package/dist/contrast-slot-map.d.ts.map +1 -0
  211. package/dist/index.cjs +1 -0
  212. package/dist/index.d.ts +64 -0
  213. package/dist/index.d.ts.map +1 -0
  214. package/dist/index.js +54 -0
  215. package/dist/primitives/Image.cjs +1 -0
  216. package/dist/primitives/Image.d.ts +11 -0
  217. package/dist/primitives/Image.d.ts.map +1 -0
  218. package/dist/primitives/Image.js +7 -0
  219. package/dist/primitives/Sprite.cjs +1 -0
  220. package/dist/primitives/Sprite.d.ts +11 -0
  221. package/dist/primitives/Sprite.d.ts.map +1 -0
  222. package/dist/primitives/Sprite.js +7 -0
  223. package/dist/primitives/Text.cjs +1 -0
  224. package/dist/primitives/Text.d.ts +14 -0
  225. package/dist/primitives/Text.d.ts.map +1 -0
  226. package/dist/primitives/Text.js +15 -0
  227. package/dist/primitives/VectorDrawContent.cjs +1 -0
  228. package/dist/primitives/VectorDrawContent.d.ts +3 -0
  229. package/dist/primitives/VectorDrawContent.d.ts.map +1 -0
  230. package/dist/primitives/VectorDrawContent.js +7 -0
  231. package/dist/primitives/View.cjs +1 -0
  232. package/dist/primitives/View.d.ts +13 -0
  233. package/dist/primitives/View.d.ts.map +1 -0
  234. package/dist/primitives/View.js +7 -0
  235. package/dist/primitives/index.d.ts +13 -0
  236. package/dist/primitives/index.d.ts.map +1 -0
  237. package/dist/primitives/primitives.test.d.ts +2 -0
  238. package/dist/primitives/primitives.test.d.ts.map +1 -0
  239. package/dist/primitives.cjs +1 -0
  240. package/dist/primitives.d.ts +2 -0
  241. package/dist/primitives.js +6 -0
  242. package/dist/theme-defaults.cjs +1 -0
  243. package/dist/theme-defaults.d.ts +12 -0
  244. package/dist/theme-defaults.d.ts.map +1 -0
  245. package/dist/theme-defaults.js +1288 -0
  246. package/dist/theme-defaults.test.d.ts +2 -0
  247. package/dist/theme-defaults.test.d.ts.map +1 -0
  248. package/dist/theme-types.cjs +0 -0
  249. package/dist/theme-types.d.ts +708 -0
  250. package/dist/theme-types.d.ts.map +1 -0
  251. package/dist/theme-types.js +0 -0
  252. package/dist/useOverlayPresence.cjs +1 -0
  253. package/dist/useOverlayPresence.d.ts +24 -0
  254. package/dist/useOverlayPresence.d.ts.map +1 -0
  255. package/dist/useOverlayPresence.js +19 -0
  256. package/package.json +83 -0
@@ -0,0 +1,256 @@
1
+ import { Text as e } from "./primitives/Text.js";
2
+ import { VectorDrawContent as t } from "./primitives/VectorDrawContent.js";
3
+ import { View as n } from "./primitives/View.js";
4
+ import "./primitives.js";
5
+ import { RadioGroup as r } from "./RadioGroup.js";
6
+ import { Slider as i } from "./Slider.js";
7
+ import { KNOWN_COMPONENTS as a, darken as o, getGlobalThemeDefaults as ee, hslToNumber as s, lighten as c, mergeThemes as l, numberToHex as te, numberToHsl as u, numberToRgb as ne, resolveComponentTheme as re, useEffect as d, useRef as ie, useState as f, useTheme as ae } from "@number10/jsx-core";
8
+ import { jsx as p, jsxs as m } from "@number10/jsx-core/jsx-runtime";
9
+ //#region src/ColorPicker.tsx
10
+ var oe = {
11
+ title: "Color Picker",
12
+ tone: "Tone",
13
+ vivid: "Vivid",
14
+ muted: "Muted",
15
+ hue: "Hue",
16
+ saturation: "Saturation",
17
+ lightness: "Lightness",
18
+ close: "X"
19
+ };
20
+ function h(e, t, n) {
21
+ return Math.max(t, Math.min(n, e));
22
+ }
23
+ function g(e, t, n) {
24
+ return s(h(e, 0, 360) / 360, h(t, 0, 100) / 100, h(n, 0, 100) / 100);
25
+ }
26
+ function _(e) {
27
+ let t = u(e);
28
+ return {
29
+ hue: Math.round(t.h * 360),
30
+ saturation: Math.round(t.s * 100),
31
+ lightness: Math.round(t.l * 100)
32
+ };
33
+ }
34
+ function v(s) {
35
+ let { value: u, defaultValue: v = 3113197, onChange: se, tone: y, defaultTone: ce = "vivid", onToneChange: le, onClose: b, showCloseButton: ue, showTone: de = !0, showSwatches: fe = !0, showRgbLabel: pe = !0, labels: me, trackLength: he, previewSize: ge, gradientSteps: _e, theme: x } = s, S = ae(), ve = x ? l(S ?? {}, x) : S, { props: C, nestedTheme: w } = re({
36
+ componentName: "ColorPicker",
37
+ globalTheme: ee(),
38
+ localTheme: ve,
39
+ knownComponents: a
40
+ }), T = _(u ?? v), [E, D] = f(T.hue), [O, k] = f(T.saturation), [A, j] = f(T.lightness), [M, N] = f(y ?? ce), P = ie(void 0), F = y ?? M, I = g(E, O, A), L = ne(I), R = te(I).toUpperCase(), z = {
41
+ ...oe,
42
+ ...C.labels ?? {},
43
+ ...me ?? {}
44
+ }, B = C.labelStyle ?? {
45
+ color: "#ffffff",
46
+ fontSize: "12px"
47
+ }, ye = C.valueStyle ?? B, be = C.titleStyle ?? {
48
+ color: "#ffffff",
49
+ fontSize: "16px",
50
+ fontStyle: "bold"
51
+ }, V = he ?? C.trackLength ?? 280, H = C.trackHeight ?? 14, U = ge ?? C.previewSize ?? 116, W = _e ?? C.gradientSteps ?? 32, G = C.borderColor ?? 3489874, xe = C.backgroundColor ?? 1515566, Se = C.controlBackgroundColor ?? 2240583, K = C.thumbBorderColor ?? 16777215, q = C.swatchSize ?? 18, Ce = ue ?? b !== void 0;
52
+ d(() => {
53
+ if (u === void 0 || u === P.current) return;
54
+ let e = _(u);
55
+ D(e.hue), k(e.saturation), j(e.lightness);
56
+ }, [u]), d(() => {
57
+ y !== void 0 && y !== M && N(y);
58
+ }, [y, M]);
59
+ let we = (e, t, n, r = F) => {
60
+ let i = g(e, t, n);
61
+ P.current = i, se?.(i, {
62
+ hue: e,
63
+ saturation: t,
64
+ lightness: n,
65
+ tone: r
66
+ });
67
+ }, J = (e, t, n, r = F) => {
68
+ let i = Math.round(h(e, 0, 360)), a = Math.round(h(t, 0, 100)), o = Math.round(h(n, 0, 100));
69
+ D(i), k(a), j(o), we(i, a, o, r);
70
+ }, Te = (e) => {
71
+ let t = _(e);
72
+ J(t.hue, t.saturation, t.lightness);
73
+ }, Ee = (e) => {
74
+ let t = Math.round(e === "muted" ? O * .6 : h(O / .6, Math.max(O, 70), 100));
75
+ y === void 0 && N(e), le?.(e), J(E, t, A, e);
76
+ }, De = [
77
+ o(I, .35),
78
+ o(I, .15),
79
+ I,
80
+ c(I, .2),
81
+ c(I, .4)
82
+ ], Y = C.thumbSize ?? 18, X = Y / 2, Oe = Math.max(1, Math.round(X * .22)), ke = l(w, { Slider: {
83
+ trackHeight: H,
84
+ trackBorderRadius: H / 2,
85
+ thumbSize: Y,
86
+ thumbBorderWidth: 2,
87
+ thumbBorderColor: K
88
+ } }), Z = (e) => () => /* @__PURE__ */ p(n, {
89
+ width: V,
90
+ height: H,
91
+ children: /* @__PURE__ */ p(t, { onDraw: (t) => {
92
+ let n = V / W;
93
+ for (let r = 0; r < W; r += 1) {
94
+ let i = W === 1 ? 1 : r / (W - 1);
95
+ t.fillStyle(e(i), 1), t.fillRect(r * n, 0, n + 1, H);
96
+ }
97
+ } })
98
+ }), Q = (e) => (n, r) => /* @__PURE__ */ p(t, {
99
+ scale: r ? 1.2 : 1,
100
+ onDraw: (t) => {
101
+ t.fillStyle(0, .32).fillCircle(0, Oe, X), t.fillStyle(e, 1).fillCircle(0, 0, X), t.lineStyle(2, K, 1).strokeCircle(0, 0, X), r && t.lineStyle(2, e, .7).strokeCircle(0, 0, X + 4);
102
+ }
103
+ }), $ = (t, r) => /* @__PURE__ */ m(n, {
104
+ direction: "row",
105
+ width: V,
106
+ justifyContent: "space-between",
107
+ children: [/* @__PURE__ */ p(e, {
108
+ text: t,
109
+ style: B
110
+ }), /* @__PURE__ */ p(e, {
111
+ text: r,
112
+ style: ye
113
+ })]
114
+ });
115
+ return /* @__PURE__ */ m(n, {
116
+ direction: "row",
117
+ gap: C.gap ?? 18,
118
+ padding: C.padding ?? 14,
119
+ backgroundColor: xe,
120
+ borderColor: G,
121
+ borderWidth: C.borderWidth ?? 1,
122
+ cornerRadius: C.cornerRadius ?? 8,
123
+ alignItems: "center",
124
+ theme: w,
125
+ children: [/* @__PURE__ */ m(n, {
126
+ gap: C.previewGap ?? 10,
127
+ width: Math.max(U, 132),
128
+ children: [
129
+ /* @__PURE__ */ p(n, {
130
+ width: U,
131
+ height: U,
132
+ backgroundColor: I,
133
+ borderColor: G,
134
+ borderWidth: C.previewBorderWidth ?? 2,
135
+ cornerRadius: C.previewCornerRadius ?? 8,
136
+ alignItems: "center",
137
+ justifyContent: "center",
138
+ children: /* @__PURE__ */ p(e, {
139
+ text: R,
140
+ style: C.hexStyle
141
+ })
142
+ }),
143
+ pe ? /* @__PURE__ */ p(e, {
144
+ text: z.formatRgb ? z.formatRgb(L) : `rgb ${L.r}, ${L.g}, ${L.b}`,
145
+ style: B
146
+ }) : null,
147
+ fe ? /* @__PURE__ */ p(n, {
148
+ direction: "row",
149
+ gap: C.swatchGap ?? 6,
150
+ children: De.map((e, t) => /* @__PURE__ */ p(n, {
151
+ width: q,
152
+ height: q,
153
+ backgroundColor: e,
154
+ borderColor: G,
155
+ borderWidth: 1,
156
+ cornerRadius: C.swatchCornerRadius ?? 4,
157
+ enableGestures: !0,
158
+ onTouch: () => Te(e)
159
+ }, `swatch-${t}`))
160
+ }) : null
161
+ ]
162
+ }), /* @__PURE__ */ m(n, {
163
+ gap: C.controlGap ?? 12,
164
+ theme: ke,
165
+ children: [
166
+ /* @__PURE__ */ m(n, {
167
+ direction: "row",
168
+ justifyContent: "space-between",
169
+ alignItems: "center",
170
+ width: V,
171
+ children: [/* @__PURE__ */ p(e, {
172
+ text: z.title,
173
+ style: be
174
+ }), Ce ? /* @__PURE__ */ p(n, {
175
+ width: C.closeButtonSize ?? 24,
176
+ height: C.closeButtonSize ?? 24,
177
+ alignItems: "center",
178
+ justifyContent: "center",
179
+ backgroundColor: Se,
180
+ backgroundAlpha: C.controlBackgroundAlpha ?? .65,
181
+ borderColor: G,
182
+ borderWidth: 1,
183
+ cornerRadius: C.closeButtonCornerRadius ?? 5,
184
+ enableGestures: !0,
185
+ onTouch: () => b?.(),
186
+ children: /* @__PURE__ */ p(e, {
187
+ text: z.close,
188
+ style: B
189
+ })
190
+ }) : null]
191
+ }),
192
+ de ? /* @__PURE__ */ m(n, {
193
+ direction: "row",
194
+ gap: 12,
195
+ alignItems: "center",
196
+ children: [/* @__PURE__ */ p(e, {
197
+ text: z.tone,
198
+ style: B
199
+ }), /* @__PURE__ */ p(r, {
200
+ direction: "row",
201
+ options: [{
202
+ value: "vivid",
203
+ label: z.vivid
204
+ }, {
205
+ value: "muted",
206
+ label: z.muted
207
+ }],
208
+ value: F,
209
+ onChange: (e) => Ee(e)
210
+ })]
211
+ }) : null,
212
+ /* @__PURE__ */ m(n, {
213
+ gap: 6,
214
+ children: [$(z.hue, z.formatHue?.(E) ?? `${Math.round(E)}deg`), /* @__PURE__ */ p(i, {
215
+ value: E,
216
+ onChange: (e) => J(e, O, A),
217
+ min: 0,
218
+ max: 360,
219
+ step: 1,
220
+ trackLength: V,
221
+ renderTrack: Z((e) => g(e * 360, 100, 50)),
222
+ renderThumb: Q(g(E, 100, 50))
223
+ })]
224
+ }),
225
+ /* @__PURE__ */ m(n, {
226
+ gap: 6,
227
+ children: [$(z.saturation, z.formatSaturation?.(O) ?? `${Math.round(O)}%`), /* @__PURE__ */ p(i, {
228
+ value: O,
229
+ onChange: (e) => J(E, e, A),
230
+ min: 0,
231
+ max: 100,
232
+ step: 1,
233
+ trackLength: V,
234
+ renderTrack: Z((e) => g(E, e * 100, A)),
235
+ renderThumb: Q(I)
236
+ })]
237
+ }),
238
+ /* @__PURE__ */ m(n, {
239
+ gap: 6,
240
+ children: [$(z.lightness, z.formatLightness?.(A) ?? `${Math.round(A)}%`), /* @__PURE__ */ p(i, {
241
+ value: A,
242
+ onChange: (e) => J(E, O, e),
243
+ min: 0,
244
+ max: 100,
245
+ step: 1,
246
+ trackLength: V,
247
+ renderTrack: Z((e) => g(E, O, e * 100)),
248
+ renderThumb: Q(I)
249
+ })]
250
+ })
251
+ ]
252
+ })]
253
+ });
254
+ }
255
+ //#endregion
256
+ export { v as ColorPicker };
@@ -0,0 +1 @@
1
+ const e=require(`./primitives/Text.cjs`),t=require(`./primitives/View.cjs`);require(`./primitives.cjs`);let n=require(`@number10/jsx-core`),r=require(`@number10/jsx-core/jsx-runtime`);var i={fps:[`fps`,`frameMs`],perf:[`fps`,`frameMs`,`renderer`,`viewport`],vdom:[`mountsTotal`,`mountsByType`,`mountsByParent`,`mountsByKey`],textures:[`textureCount`],full:[`fps`,`frameMs`,`phaserVersion`,`renderer`,`viewport`,`textureCount`,`mountsTotal`,`mountsByType`,`mountsByParent`,`mountsByKey`,`debugFlags`]},a={fps:`FPS`,frameMs:`Frame ms`,phaserVersion:`Phaser`,renderer:`Renderer`,viewport:`Viewport`,textureCount:`Textures`,mountsTotal:`Mounts`,mountsByType:`Mounts/type`,mountsByParent:`Mounts/parent`,mountsByKey:`Mounts/key`,debugFlags:`Debug flags`};function o(e){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(e===null)return`null`;if(e===void 0)return`undefined`;if(typeof e==`object`){let t=e;if(typeof t.name==`string`&&t.name.length>0)return t.name;if(typeof t.type==`string`)return t.type;if(typeof t.label==`string`)return t.label;let n=t.constructor;if(n?.name&&n.name!==`Object`)return n.name}return String(e)}function s(e,t=3){return Array.from(e.entries()).sort((e,t)=>t[1]-e[1]).slice(0,t).map(([e,t])=>`${o(e)}:${t}`).join(` | `)||`-`}function c(e){return typeof e==`number`?String(e):e}function l(o){let s=(0,n.useTheme)(),{props:l}=(0,n.resolveComponentTheme)({componentName:`DebugPanel`,localTheme:o.theme??s,knownComponents:n.KNOWN_COMPONENTS}),u=(0,n.useThemeTokens)(),{snapshot:d,preset:f=`fps`,metrics:p,compact:m=!1,maxRows:h,labels:g,formatters:_,innerProps:v,theme:y,...b}=o,x=(()=>{let e=p&&p.length>0?p:i[f];return Array.from(new Set(e))})(),S=l.rowTextStyle??u?.textStyles.small,C=l.valueTextStyle??u?.textStyles.small,w=x.map(e=>{let t=d[e],n=g?.[e]??a[e],r=_?.[e];return{metric:e,label:n,value:r?r(t):c(t)}}),T=typeof h==`number`?w.slice(0,Math.max(1,h)):w;if(m){let n=T.map(e=>`${e.label} ${e.value}`).join(` | `);return(0,r.jsx)(t.View,{...b,...l,children:(0,r.jsx)(e.Text,{text:n,style:C})})}return(0,r.jsx)(t.View,{direction:`column`,gap:l.rowGap??4,...b,...l,children:T.map(n=>(0,r.jsxs)(t.View,{direction:`row`,gap:8,...v,children:[(0,r.jsx)(e.Text,{text:`${n.label}:`,style:S}),(0,r.jsx)(e.Text,{text:n.value,style:C})]},`debug-${n.metric}`))})}exports.DEFAULT_LABELS=a,exports.DebugPanel=l,exports.PRESET_METRICS=i,exports.formatDefault=c,exports.summarizeMap=s;
@@ -0,0 +1,63 @@
1
+ import { VNodeLike, ViewPrimitivePropsComplete } from '@number10/jsx-core';
2
+ import { PortableComponentPartialTheme } from './theme-types';
3
+ export type DebugPanelPreset = 'fps' | 'perf' | 'vdom' | 'textures' | 'full';
4
+ export type DebugMetricKey = 'fps' | 'frameMs' | 'phaserVersion' | 'renderer' | 'viewport' | 'textureCount' | 'mountsTotal' | 'mountsByType' | 'mountsByParent' | 'mountsByKey' | 'debugFlags';
5
+ export type DebugValue = string | number;
6
+ /**
7
+ * Debug data snapshot — partial because not all renderers support all metrics.
8
+ * Each renderer adapter fills in what it can.
9
+ */
10
+ export type DebugSnapshot = Partial<Record<DebugMetricKey, DebugValue>>;
11
+ export interface DebugPanelProps extends Omit<ViewPrimitivePropsComplete, 'children'> {
12
+ /** Current debug data snapshot (provided by renderer adapter). */
13
+ snapshot: DebugSnapshot;
14
+ /** Optional ready-made metric set. Ignored when `metrics` is set. */
15
+ preset?: DebugPanelPreset;
16
+ /** Explicit metric selection (takes precedence over `preset`). */
17
+ metrics?: DebugMetricKey[];
18
+ /** Render all metrics in one line (instead of key/value rows). */
19
+ compact?: boolean;
20
+ /** Maximum rows to render in non-compact mode. */
21
+ maxRows?: number;
22
+ /** Optional metric label overrides. */
23
+ labels?: Partial<Record<DebugMetricKey, string>>;
24
+ /** Optional formatter overrides per metric. */
25
+ formatters?: Partial<Record<DebugMetricKey, (value: DebugValue) => string>>;
26
+ /** Optional props forwarded to each inner row View (column mode only). */
27
+ innerProps?: Omit<ViewPrimitivePropsComplete, 'children'>;
28
+ /** Theme overrides. */
29
+ theme?: PortableComponentPartialTheme<'DebugPanel'>;
30
+ }
31
+ export declare const PRESET_METRICS: Record<DebugPanelPreset, DebugMetricKey[]>;
32
+ export declare const DEFAULT_LABELS: Record<DebugMetricKey, string>;
33
+ /**
34
+ * Summarize a Map of counts into a compact string.
35
+ * Uses {@link describeKey} to produce readable key names for non-string keys.
36
+ *
37
+ * @param map - Map of keys to counts
38
+ * @param maxEntries - Maximum entries to include (default 3)
39
+ * @returns Compact summary string or "-" if empty
40
+ */
41
+ export declare function summarizeMap(map: Map<unknown, number>, maxEntries?: number): string;
42
+ /**
43
+ * Default value formatter — numbers as strings, strings pass through.
44
+ */
45
+ export declare function formatDefault(value: DebugValue): string;
46
+ /**
47
+ * DebugPanel — renders a snapshot of debug metrics as labelled rows.
48
+ *
49
+ * Pure presentational component. Does NOT collect data or manage intervals.
50
+ * The renderer adapter provides `snapshot` and handles refresh.
51
+ *
52
+ * @example
53
+ * ```tsx
54
+ * <DebugPanel
55
+ * snapshot={{ fps: 60, frameMs: 16.67 }}
56
+ * preset="fps"
57
+ * compact
58
+ * backgroundColor={0x1a1a2e}
59
+ * />
60
+ * ```
61
+ */
62
+ export declare function DebugPanel(props: DebugPanelProps): VNodeLike;
63
+ //# sourceMappingURL=DebugPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DebugPanel.d.ts","sourceRoot":"","sources":["../src/DebugPanel.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAqB,SAAS,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAA;AAQlG,OAAO,KAAK,EAAmB,6BAA6B,EAAE,MAAM,eAAe,CAAA;AAMnF,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAA;AAE5E,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,SAAS,GACT,eAAe,GACf,UAAU,GACV,UAAU,GACV,cAAc,GACd,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,aAAa,GACb,YAAY,CAAA;AAEhB,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAA;AAExC;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAA;AAEvE,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,0BAA0B,EAAE,UAAU,CAAC;IACnF,kEAAkE;IAClE,QAAQ,EAAE,aAAa,CAAA;IACvB,qEAAqE;IACrE,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,kEAAkE;IAClE,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;IAC1B,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uCAAuC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAA;IAChD,+CAA+C;IAC/C,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAA;IAC3E,0EAA0E;IAC1E,UAAU,CAAC,EAAE,IAAI,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAA;IACzD,uBAAuB;IACvB,KAAK,CAAC,EAAE,6BAA6B,CAAC,YAAY,CAAC,CAAA;CACpD;AAMD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,gBAAgB,EAAE,cAAc,EAAE,CAkBrE,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAYzD,CAAA;AA8BD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,UAAU,SAAI,GAAG,MAAM,CAQ9E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEvD;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,CAmE5D"}
@@ -0,0 +1,116 @@
1
+ import { Text as e } from "./primitives/Text.js";
2
+ import { View as t } from "./primitives/View.js";
3
+ import "./primitives.js";
4
+ import { KNOWN_COMPONENTS as n, resolveComponentTheme as r, useTheme as i, useThemeTokens as a } from "@number10/jsx-core";
5
+ import { jsx as o, jsxs as s } from "@number10/jsx-core/jsx-runtime";
6
+ //#region src/DebugPanel.tsx
7
+ var c = {
8
+ fps: ["fps", "frameMs"],
9
+ perf: [
10
+ "fps",
11
+ "frameMs",
12
+ "renderer",
13
+ "viewport"
14
+ ],
15
+ vdom: [
16
+ "mountsTotal",
17
+ "mountsByType",
18
+ "mountsByParent",
19
+ "mountsByKey"
20
+ ],
21
+ textures: ["textureCount"],
22
+ full: [
23
+ "fps",
24
+ "frameMs",
25
+ "phaserVersion",
26
+ "renderer",
27
+ "viewport",
28
+ "textureCount",
29
+ "mountsTotal",
30
+ "mountsByType",
31
+ "mountsByParent",
32
+ "mountsByKey",
33
+ "debugFlags"
34
+ ]
35
+ }, l = {
36
+ fps: "FPS",
37
+ frameMs: "Frame ms",
38
+ phaserVersion: "Phaser",
39
+ renderer: "Renderer",
40
+ viewport: "Viewport",
41
+ textureCount: "Textures",
42
+ mountsTotal: "Mounts",
43
+ mountsByType: "Mounts/type",
44
+ mountsByParent: "Mounts/parent",
45
+ mountsByKey: "Mounts/key",
46
+ debugFlags: "Debug flags"
47
+ };
48
+ function u(e) {
49
+ if (typeof e == "string") return e;
50
+ if (typeof e == "number" || typeof e == "boolean") return String(e);
51
+ if (e === null) return "null";
52
+ if (e === void 0) return "undefined";
53
+ if (typeof e == "object") {
54
+ let t = e;
55
+ if (typeof t.name == "string" && t.name.length > 0) return t.name;
56
+ if (typeof t.type == "string") return t.type;
57
+ if (typeof t.label == "string") return t.label;
58
+ let n = t.constructor;
59
+ if (n?.name && n.name !== "Object") return n.name;
60
+ }
61
+ return String(e);
62
+ }
63
+ function d(e, t = 3) {
64
+ return Array.from(e.entries()).sort((e, t) => t[1] - e[1]).slice(0, t).map(([e, t]) => `${u(e)}:${t}`).join(" | ") || "-";
65
+ }
66
+ function f(e) {
67
+ return typeof e == "number" ? String(e) : e;
68
+ }
69
+ function p(u) {
70
+ let d = i(), { props: p } = r({
71
+ componentName: "DebugPanel",
72
+ localTheme: u.theme ?? d,
73
+ knownComponents: n
74
+ }), m = a(), { snapshot: h, preset: g = "fps", metrics: _, compact: v = !1, maxRows: y, labels: b, formatters: x, innerProps: S, theme: C, ...w } = u, T = (() => {
75
+ let e = _ && _.length > 0 ? _ : c[g];
76
+ return Array.from(new Set(e));
77
+ })(), E = p.rowTextStyle ?? m?.textStyles.small, D = p.valueTextStyle ?? m?.textStyles.small, O = T.map((e) => {
78
+ let t = h[e], n = b?.[e] ?? l[e], r = x?.[e];
79
+ return {
80
+ metric: e,
81
+ label: n,
82
+ value: r ? r(t) : f(t)
83
+ };
84
+ }), k = typeof y == "number" ? O.slice(0, Math.max(1, y)) : O;
85
+ if (v) {
86
+ let n = k.map((e) => `${e.label} ${e.value}`).join(" | ");
87
+ return /* @__PURE__ */ o(t, {
88
+ ...w,
89
+ ...p,
90
+ children: /* @__PURE__ */ o(e, {
91
+ text: n,
92
+ style: D
93
+ })
94
+ });
95
+ }
96
+ return /* @__PURE__ */ o(t, {
97
+ direction: "column",
98
+ gap: p.rowGap ?? 4,
99
+ ...w,
100
+ ...p,
101
+ children: k.map((n) => /* @__PURE__ */ s(t, {
102
+ direction: "row",
103
+ gap: 8,
104
+ ...S,
105
+ children: [/* @__PURE__ */ o(e, {
106
+ text: `${n.label}:`,
107
+ style: E
108
+ }), /* @__PURE__ */ o(e, {
109
+ text: n.value,
110
+ style: D
111
+ })]
112
+ }, `debug-${n.metric}`))
113
+ });
114
+ }
115
+ //#endregion
116
+ export { l as DEFAULT_LABELS, p as DebugPanel, c as PRESET_METRICS, f as formatDefault, d as summarizeMap };
@@ -0,0 +1 @@
1
+ const e=require(`./primitives/Text.cjs`),t=require(`./primitives/View.cjs`);require(`./primitives.cjs`);const n=require(`./Modal.cjs`);let r=require(`@number10/jsx-core`),i=require(`@number10/jsx-core/jsx-runtime`);(0,r.registerComponentDefaultsIfMissing)(`Dialog`,{backgroundColor:16777215,cornerRadius:8,maxWidth:600,showClose:!0,Header:{padding:{left:24,right:24,top:20,bottom:16},gap:12,borderColor:14737632,closeButton:{size:32,cornerRadius:4}},Content:{padding:{left:24,right:24,top:16,bottom:16},gap:12},Actions:{padding:{left:24,right:24,top:16,bottom:20},gap:12,justifyContent:`end`,borderColor:14737632}});function a(a){let o=(0,r.useTheme)(),{props:s,nestedTheme:c}=(0,r.resolveComponentTheme)({componentName:`Dialog`,globalTheme:(0,r.getGlobalThemeDefaults)(),localTheme:o,knownComponents:r.KNOWN_COMPONENTS}),l=(0,r.useRef)(null),u=a.showClose??s.showClose??!0,d=a.maxWidth??s.maxWidth??600,f=a.prefix??s.prefix,p=s.backgroundColor??16777215,m=s.cornerRadius??8,h=s.Header,g=h?.gap??12,_=h?.padding??16,v=h?.borderColor??14737632,y=h?.textStyle,b=h?.closeButton,x=b?.size??32,S=b?.cornerRadius??4,C=b?.backgroundColor,w=b?.borderColor,T=b?.borderWidth,E=s.closeIcon,D=s.Content,O=D?.padding??16,k=D?.gap??12,A=s.Actions,j=A?.borderColor??14737632,M=A?.justifyContent??`end`,N=A?.gap??8,P=A?.padding??16,F=e=>{l.current=e,a.forwardRef?.(e)};return(0,i.jsx)(n.Modal,{...a.key&&{key:a.key},show:a.isOpen,onClosed:a.onClose,closeOnBackdrop:a.closeOnBackdrop,closeOnEscape:a.closeOnEscape,depth:a.depth,children:(0,i.jsxs)(t.View,{ref:F,width:d,maxWidth:d,backgroundColor:p,cornerRadius:m,padding:0,direction:`column`,theme:c,children:[(0,i.jsxs)(t.View,{direction:`column`,gap:0,width:`fill`,children:[(0,i.jsxs)(t.View,{direction:`row`,width:`fill`,alignItems:`center`,gap:g,padding:_,children:[f&&f,(0,i.jsx)(t.View,{flex:1,children:(0,i.jsx)(e.Text,{text:a.title,style:y})}),u&&a.onClose&&(0,i.jsx)(t.View,{width:x,height:x,justifyContent:`center`,alignItems:`center`,cornerRadius:S,backgroundColor:C,borderColor:w,borderWidth:T,onTouch:e=>{e.stopPropagation(),a.onClose?.()},children:E??(0,i.jsx)(e.Text,{text:`X`})})]}),(0,i.jsx)(t.View,{height:1,width:`fill`,backgroundColor:v})]}),(0,i.jsx)(t.View,{width:`fill`,padding:O,direction:`column`,gap:k,children:a.children}),a.actions&&(0,i.jsxs)(t.View,{direction:`column`,gap:0,width:`fill`,children:[(0,i.jsx)(t.View,{height:1,width:`fill`,backgroundColor:j}),(0,i.jsx)(t.View,{direction:`row`,justifyContent:M,gap:N,padding:P,children:a.actions})]})]})})}exports.Dialog=a;
@@ -0,0 +1,59 @@
1
+ import { ChildrenType, SizeValue, VNodeLike } from '@number10/jsx-core';
2
+ /**
3
+ * Dialog component props
4
+ */
5
+ export interface DialogProps {
6
+ /** Unique key for VDOM identification */
7
+ key?: string;
8
+ /** Ref to the container */
9
+ forwardRef?: ((ref: unknown) => void) | undefined;
10
+ /** Whether dialog is visible */
11
+ isOpen: boolean;
12
+ /** Callback when dialog should close */
13
+ onClose?: (() => void) | undefined;
14
+ /** Close on backdrop click (default: true) */
15
+ closeOnBackdrop?: boolean | undefined;
16
+ /** Close on Escape key (default: true) */
17
+ closeOnEscape?: boolean | undefined;
18
+ /** Portal depth (default: 1000) */
19
+ depth?: number | undefined;
20
+ /** Dialog title */
21
+ title: string;
22
+ /** Optional prefix content (e.g., Icon) */
23
+ prefix?: ChildrenType;
24
+ /** Show close button in header (default: true) */
25
+ showClose?: boolean;
26
+ /** Maximum width of dialog (default: 600) */
27
+ maxWidth?: SizeValue;
28
+ /** Dialog content */
29
+ children: ChildrenType;
30
+ /** Optional action buttons in footer */
31
+ actions?: ChildrenType;
32
+ }
33
+ /**
34
+ * Dialog component with structured layout
35
+ * Provides header with title/icon, content area, and action footer
36
+ *
37
+ * @param props - Dialog props
38
+ * @returns Dialog component
39
+ *
40
+ * @example
41
+ * ```tsx
42
+ * <Dialog
43
+ * isOpen={isOpen}
44
+ * onClose={onClose}
45
+ * title="Settings"
46
+ * prefix={<Icon type="gear" />}
47
+ * actions={
48
+ * <>
49
+ * <Button onClick={onCancel}>Cancel</Button>
50
+ * <Button onClick={onSave}>Save</Button>
51
+ * </>
52
+ * }
53
+ * >
54
+ * <Text>Dialog content...</Text>
55
+ * </Dialog>
56
+ * ```
57
+ */
58
+ export declare function Dialog(props: DialogProps): VNodeLike;
59
+ //# sourceMappingURL=Dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../src/Dialog.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C;;;;;GAKG;AACH,OAAO,KAAK,EACV,YAAY,EAGZ,SAAS,EACT,SAAS,EACV,MAAM,oBAAoB,CAAA;AAa3B;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,2BAA2B;IAC3B,UAAU,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;IACjD,gCAAgC;IAChC,MAAM,EAAE,OAAO,CAAA;IACf,wCAAwC;IACxC,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAClC,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACrC,0CAA0C;IAC1C,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAE1B,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,2CAA2C;IAC3C,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,SAAS,CAAA;IAEpB,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAA;IACtB,wCAAwC;IACxC,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB;AA4BD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAuIpD"}
package/dist/Dialog.js ADDED
@@ -0,0 +1,142 @@
1
+ import { Text as e } from "./primitives/Text.js";
2
+ import { View as t } from "./primitives/View.js";
3
+ import "./primitives.js";
4
+ import { Modal as n } from "./Modal.js";
5
+ import { KNOWN_COMPONENTS as r, getGlobalThemeDefaults as i, registerComponentDefaultsIfMissing as a, resolveComponentTheme as o, useRef as s, useTheme as c } from "@number10/jsx-core";
6
+ import { jsx as l, jsxs as u } from "@number10/jsx-core/jsx-runtime";
7
+ //#region src/Dialog.tsx
8
+ a("Dialog", {
9
+ backgroundColor: 16777215,
10
+ cornerRadius: 8,
11
+ maxWidth: 600,
12
+ showClose: !0,
13
+ Header: {
14
+ padding: {
15
+ left: 24,
16
+ right: 24,
17
+ top: 20,
18
+ bottom: 16
19
+ },
20
+ gap: 12,
21
+ borderColor: 14737632,
22
+ closeButton: {
23
+ size: 32,
24
+ cornerRadius: 4
25
+ }
26
+ },
27
+ Content: {
28
+ padding: {
29
+ left: 24,
30
+ right: 24,
31
+ top: 16,
32
+ bottom: 16
33
+ },
34
+ gap: 12
35
+ },
36
+ Actions: {
37
+ padding: {
38
+ left: 24,
39
+ right: 24,
40
+ top: 16,
41
+ bottom: 20
42
+ },
43
+ gap: 12,
44
+ justifyContent: "end",
45
+ borderColor: 14737632
46
+ }
47
+ });
48
+ function d(a) {
49
+ let d = c(), { props: f, nestedTheme: p } = o({
50
+ componentName: "Dialog",
51
+ globalTheme: i(),
52
+ localTheme: d,
53
+ knownComponents: r
54
+ }), m = s(null), h = a.showClose ?? f.showClose ?? !0, g = a.maxWidth ?? f.maxWidth ?? 600, _ = a.prefix ?? f.prefix, v = f.backgroundColor ?? 16777215, y = f.cornerRadius ?? 8, b = f.Header, x = b?.gap ?? 12, S = b?.padding ?? 16, C = b?.borderColor ?? 14737632, w = b?.textStyle, T = b?.closeButton, E = T?.size ?? 32, D = T?.cornerRadius ?? 4, O = T?.backgroundColor, k = T?.borderColor, A = T?.borderWidth, j = f.closeIcon, M = f.Content, N = M?.padding ?? 16, P = M?.gap ?? 12, F = f.Actions, I = F?.borderColor ?? 14737632, L = F?.justifyContent ?? "end", R = F?.gap ?? 8, z = F?.padding ?? 16, B = (e) => {
55
+ m.current = e, a.forwardRef?.(e);
56
+ };
57
+ return /* @__PURE__ */ l(n, {
58
+ ...a.key && { key: a.key },
59
+ show: a.isOpen,
60
+ onClosed: a.onClose,
61
+ closeOnBackdrop: a.closeOnBackdrop,
62
+ closeOnEscape: a.closeOnEscape,
63
+ depth: a.depth,
64
+ children: /* @__PURE__ */ u(t, {
65
+ ref: B,
66
+ width: g,
67
+ maxWidth: g,
68
+ backgroundColor: v,
69
+ cornerRadius: y,
70
+ padding: 0,
71
+ direction: "column",
72
+ theme: p,
73
+ children: [
74
+ /* @__PURE__ */ u(t, {
75
+ direction: "column",
76
+ gap: 0,
77
+ width: "fill",
78
+ children: [/* @__PURE__ */ u(t, {
79
+ direction: "row",
80
+ width: "fill",
81
+ alignItems: "center",
82
+ gap: x,
83
+ padding: S,
84
+ children: [
85
+ _ && _,
86
+ /* @__PURE__ */ l(t, {
87
+ flex: 1,
88
+ children: /* @__PURE__ */ l(e, {
89
+ text: a.title,
90
+ style: w
91
+ })
92
+ }),
93
+ h && a.onClose && /* @__PURE__ */ l(t, {
94
+ width: E,
95
+ height: E,
96
+ justifyContent: "center",
97
+ alignItems: "center",
98
+ cornerRadius: D,
99
+ backgroundColor: O,
100
+ borderColor: k,
101
+ borderWidth: A,
102
+ onTouch: (e) => {
103
+ e.stopPropagation(), a.onClose?.();
104
+ },
105
+ children: j ?? /* @__PURE__ */ l(e, { text: "X" })
106
+ })
107
+ ]
108
+ }), /* @__PURE__ */ l(t, {
109
+ height: 1,
110
+ width: "fill",
111
+ backgroundColor: C
112
+ })]
113
+ }),
114
+ /* @__PURE__ */ l(t, {
115
+ width: "fill",
116
+ padding: N,
117
+ direction: "column",
118
+ gap: P,
119
+ children: a.children
120
+ }),
121
+ a.actions && /* @__PURE__ */ u(t, {
122
+ direction: "column",
123
+ gap: 0,
124
+ width: "fill",
125
+ children: [/* @__PURE__ */ l(t, {
126
+ height: 1,
127
+ width: "fill",
128
+ backgroundColor: I
129
+ }), /* @__PURE__ */ l(t, {
130
+ direction: "row",
131
+ justifyContent: L,
132
+ gap: R,
133
+ padding: z,
134
+ children: a.actions
135
+ })]
136
+ })
137
+ ]
138
+ })
139
+ });
140
+ }
141
+ //#endregion
142
+ export { d as Dialog };
@@ -0,0 +1 @@
1
+ const e=require(`./primitives/View.cjs`);require(`./primitives.cjs`),require(`@number10/jsx-core`);let t=require(`@number10/jsx-core/jsx-runtime`);function n(n){let{orientation:r=`horizontal`,thickness:i=1,color:a=13421772,length:o}=n,s=r===`horizontal`;return(0,t.jsx)(e.View,{width:s?o??`100%`:i,height:s?i:o??`100%`,backgroundColor:a})}exports.Divider=n;
@@ -0,0 +1,19 @@
1
+ import { SizeValue, VNodeLike } from '@number10/jsx-core';
2
+ /**
3
+ * Props for Divider component.
4
+ */
5
+ export interface DividerProps {
6
+ /** Orientation of the divider */
7
+ orientation?: 'horizontal' | 'vertical';
8
+ /** Thickness of the divider line */
9
+ thickness?: SizeValue | undefined;
10
+ /** Color of the divider */
11
+ color?: number;
12
+ /** Length of the divider (defaults to 100%) */
13
+ length?: SizeValue | undefined;
14
+ }
15
+ /**
16
+ * Divider component — renders a simple line separator.
17
+ */
18
+ export declare function Divider(props: DividerProps): VNodeLike;
19
+ //# sourceMappingURL=Divider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../src/Divider.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C;;;;;;;;GAQG;AACH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAGnE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACvC,oCAAoC;IACpC,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+CAA+C;IAC/C,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CAC/B;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAYtD"}