@multiplatform.one/forms 7.35.0 → 7.37.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 (92) hide show
  1. package/dist/cjs/Wheel/{WheelEdgeFade.cjs → NativeWheel.cjs} +5 -5
  2. package/dist/cjs/Wheel/NativeWheel.native.js +408 -0
  3. package/dist/cjs/Wheel/NativeWheel.native.js.map +1 -0
  4. package/dist/cjs/Wheel/haptic.cjs +3 -4
  5. package/dist/cjs/Wheel/haptic.native.js +4 -5
  6. package/dist/cjs/Wheel/haptic.native.js.map +1 -1
  7. package/dist/cjs/Wheel/index.cjs +62 -218
  8. package/dist/cjs/Wheel/index.native.js +54 -228
  9. package/dist/cjs/Wheel/index.native.js.map +1 -1
  10. package/dist/cjs/Wheel/wheelShared.cjs +156 -0
  11. package/dist/cjs/Wheel/wheelShared.native.js +169 -0
  12. package/dist/cjs/Wheel/wheelShared.native.js.map +1 -0
  13. package/dist/cjs/shared/TimeColumn.cjs +0 -9
  14. package/dist/cjs/shared/TimeColumn.native.js +0 -9
  15. package/dist/cjs/shared/TimeColumn.native.js.map +1 -1
  16. package/dist/esm/Wheel/NativeWheel.mjs +5 -0
  17. package/dist/esm/Wheel/NativeWheel.mjs.map +1 -0
  18. package/dist/esm/Wheel/NativeWheel.native.js +380 -0
  19. package/dist/esm/Wheel/NativeWheel.native.js.map +1 -0
  20. package/dist/esm/Wheel/haptic.mjs +3 -4
  21. package/dist/esm/Wheel/haptic.mjs.map +1 -1
  22. package/dist/esm/Wheel/haptic.native.js +4 -5
  23. package/dist/esm/Wheel/haptic.native.js.map +1 -1
  24. package/dist/esm/Wheel/index.mjs +49 -205
  25. package/dist/esm/Wheel/index.mjs.map +1 -1
  26. package/dist/esm/Wheel/index.native.js +41 -215
  27. package/dist/esm/Wheel/index.native.js.map +1 -1
  28. package/dist/esm/Wheel/wheelShared.mjs +119 -0
  29. package/dist/esm/Wheel/wheelShared.mjs.map +1 -0
  30. package/dist/esm/Wheel/wheelShared.native.js +129 -0
  31. package/dist/esm/Wheel/wheelShared.native.js.map +1 -0
  32. package/dist/esm/shared/TimeColumn.mjs +0 -9
  33. package/dist/esm/shared/TimeColumn.mjs.map +1 -1
  34. package/dist/esm/shared/TimeColumn.native.js +0 -9
  35. package/dist/esm/shared/TimeColumn.native.js.map +1 -1
  36. package/dist/jsx/Wheel/NativeWheel.mjs +5 -0
  37. package/dist/jsx/Wheel/NativeWheel.mjs.map +1 -0
  38. package/dist/jsx/Wheel/NativeWheel.native.js +408 -0
  39. package/dist/jsx/Wheel/NativeWheel.native.js.map +1 -0
  40. package/dist/jsx/Wheel/haptic.mjs +3 -4
  41. package/dist/jsx/Wheel/haptic.mjs.map +1 -1
  42. package/dist/jsx/Wheel/haptic.native.js +4 -5
  43. package/dist/jsx/Wheel/haptic.native.js.map +1 -1
  44. package/dist/jsx/Wheel/index.mjs +49 -205
  45. package/dist/jsx/Wheel/index.mjs.map +1 -1
  46. package/dist/jsx/Wheel/index.native.js +54 -228
  47. package/dist/jsx/Wheel/index.native.js.map +1 -1
  48. package/dist/jsx/Wheel/wheelShared.mjs +119 -0
  49. package/dist/jsx/Wheel/wheelShared.mjs.map +1 -0
  50. package/dist/jsx/Wheel/wheelShared.native.js +169 -0
  51. package/dist/jsx/Wheel/wheelShared.native.js.map +1 -0
  52. package/dist/jsx/shared/TimeColumn.mjs +0 -9
  53. package/dist/jsx/shared/TimeColumn.mjs.map +1 -1
  54. package/dist/jsx/shared/TimeColumn.native.js +0 -9
  55. package/dist/jsx/shared/TimeColumn.native.js.map +1 -1
  56. package/package.json +8 -8
  57. package/src/Wheel/NativeWheel.native.spec.tsx +181 -0
  58. package/src/Wheel/NativeWheel.native.tsx +430 -0
  59. package/src/Wheel/NativeWheel.tsx +6 -0
  60. package/src/Wheel/haptic.ts +9 -8
  61. package/src/Wheel/index.tsx +121 -363
  62. package/src/Wheel/wheelShared.spec.ts +53 -0
  63. package/src/Wheel/wheelShared.ts +222 -0
  64. package/src/shared/TimeColumn.tsx +0 -7
  65. package/types/Wheel/NativeWheel.d.ts +4 -0
  66. package/types/Wheel/NativeWheel.d.ts.map +1 -0
  67. package/types/Wheel/NativeWheel.native.d.ts +9 -0
  68. package/types/Wheel/NativeWheel.native.d.ts.map +1 -0
  69. package/types/Wheel/haptic.d.ts +4 -2
  70. package/types/Wheel/haptic.d.ts.map +1 -1
  71. package/types/Wheel/index.d.ts +4 -49
  72. package/types/Wheel/index.d.ts.map +1 -1
  73. package/types/Wheel/wheelShared.d.ts +87 -0
  74. package/types/Wheel/wheelShared.d.ts.map +1 -0
  75. package/types/shared/TimeColumn.d.ts.map +1 -1
  76. package/dist/cjs/Wheel/WheelEdgeFade.native.js +0 -116
  77. package/dist/cjs/Wheel/WheelEdgeFade.native.js.map +0 -1
  78. package/dist/esm/Wheel/WheelEdgeFade.mjs +0 -5
  79. package/dist/esm/Wheel/WheelEdgeFade.mjs.map +0 -1
  80. package/dist/esm/Wheel/WheelEdgeFade.native.js +0 -88
  81. package/dist/esm/Wheel/WheelEdgeFade.native.js.map +0 -1
  82. package/dist/jsx/Wheel/WheelEdgeFade.mjs +0 -5
  83. package/dist/jsx/Wheel/WheelEdgeFade.mjs.map +0 -1
  84. package/dist/jsx/Wheel/WheelEdgeFade.native.js +0 -116
  85. package/dist/jsx/Wheel/WheelEdgeFade.native.js.map +0 -1
  86. package/src/Wheel/WheelEdgeFade.native.tsx +0 -67
  87. package/src/Wheel/WheelEdgeFade.spec.tsx +0 -141
  88. package/src/Wheel/WheelEdgeFade.tsx +0 -7
  89. package/types/Wheel/WheelEdgeFade.d.ts +0 -8
  90. package/types/Wheel/WheelEdgeFade.d.ts.map +0 -1
  91. package/types/Wheel/WheelEdgeFade.native.d.ts +0 -8
  92. package/types/Wheel/WheelEdgeFade.native.d.ts.map +0 -1
@@ -1,88 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { LinearGradient } from "expo-linear-gradient";
3
- import { StyleSheet, View as RNView } from "react-native";
4
- import { useTheme } from "tamagui";
5
- function toTransparent(color) {
6
- var fnMatch = color.match(/^(rgb|hsl)a?\(([^)]+)\)$/i);
7
- if (fnMatch) {
8
- var parts = fnMatch[2].split(",").map(function (part) {
9
- return part.trim();
10
- });
11
- var [a, b, c] = parts;
12
- return `${fnMatch[1].toLowerCase()}a(${a}, ${b}, ${c}, 0)`;
13
- }
14
- var hexMatch = color.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
15
- if (hexMatch) {
16
- var hex = hexMatch[1];
17
- if (hex.length === 3) {
18
- hex = hex.split("").map(function (char) {
19
- return char + char;
20
- }).join("");
21
- }
22
- var r = Number.parseInt(hex.slice(0, 2), 16);
23
- var g = Number.parseInt(hex.slice(2, 4), 16);
24
- var b1 = Number.parseInt(hex.slice(4, 6), 16);
25
- return `rgba(${r}, ${g}, ${b1}, 0)`;
26
- }
27
- return "transparent";
28
- }
29
- function WheelEdgeFade(param) {
30
- var {
31
- height
32
- } = param;
33
- var _ref;
34
- var _theme_background;
35
- var theme = useTheme();
36
- var background = (_ref = (_theme_background = theme.background) === null || _theme_background === void 0 ? void 0 : _theme_background.val) !== null && _ref !== void 0 ? _ref : "#ffffff";
37
- var transparent = toTransparent(background);
38
- if (height <= 0) return null;
39
- return /* @__PURE__ */_jsxs(_Fragment, {
40
- children: [/* @__PURE__ */_jsx(RNView, {
41
- pointerEvents: "none",
42
- style: [styles.band, {
43
- top: 0,
44
- height
45
- }],
46
- children: /* @__PURE__ */_jsx(LinearGradient, {
47
- colors: [background, transparent],
48
- start: {
49
- x: 0.5,
50
- y: 0
51
- },
52
- end: {
53
- x: 0.5,
54
- y: 1
55
- },
56
- style: StyleSheet.absoluteFill
57
- })
58
- }), /* @__PURE__ */_jsx(RNView, {
59
- pointerEvents: "none",
60
- style: [styles.band, {
61
- bottom: 0,
62
- height
63
- }],
64
- children: /* @__PURE__ */_jsx(LinearGradient, {
65
- colors: [transparent, background],
66
- start: {
67
- x: 0.5,
68
- y: 0
69
- },
70
- end: {
71
- x: 0.5,
72
- y: 1
73
- },
74
- style: StyleSheet.absoluteFill
75
- })
76
- })]
77
- });
78
- }
79
- var styles = StyleSheet.create({
80
- band: {
81
- position: "absolute",
82
- left: 0,
83
- right: 0,
84
- zIndex: 2
85
- }
86
- });
87
- export { WheelEdgeFade };
88
- //# sourceMappingURL=WheelEdgeFade.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","LinearGradient","StyleSheet","View","RNView","useTheme","toTransparent","color","fnMatch","match","parts","split","map","part","trim","a","b","c","toLowerCase","hexMatch","hex","length","char","join","r","Number","parseInt","slice","g","b1","WheelEdgeFade","param","height","_ref","_theme_background","theme","background","val","transparent","children","pointerEvents","style","styles","band","top","colors","start","x","y","end","absoluteFill","bottom","create","position","left","right","zIndex"],"sources":["../../../src/Wheel/WheelEdgeFade.native.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAA,IAAOC,IAAA,EAAMC,IAAA,IAAQC,KAAA,EAAOC,QAAA,IAAYC,SAAA,QAAiB;AAClE,SAASC,cAAA,QAAsB;AAC/B,SAASC,UAAA,EAAYC,IAAA,IAAQC,MAAA,QAAc;AAC3C,SAASC,QAAA,QAAgB;AACzB,SAASC,cAAcC,KAAA,EAAO;EAC1B,IAAIC,OAAA,GAAUD,KAAA,CAAME,KAAA,CAAM,2BAA2B;EACrD,IAAID,OAAA,EAAS;IACT,IAAIE,KAAA,GAAQF,OAAA,CAAQ,CAAC,EAAEG,KAAA,CAAM,GAAG,EAAEC,GAAA,CAAI,UAASC,IAAA,EAAM;MACjD,OAAOA,IAAA,CAAKC,IAAA,CAAK;IACrB,CAAC;IACD,IAAI,CAACC,CAAA,EAAGC,CAAA,EAAGC,CAAC,IAAIP,KAAA;IAChB,OAAO,GAAGF,OAAA,CAAQ,CAAC,EAAEU,WAAA,CAAY,CAAC,KAAKH,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A,EAAU,CACQ,eAAA3C,IAAA,CAAKQ,MAAA,EAAQ;MACvBoC,aAAA,EAAe;MACfC,KAAA,EAAO,CACHC,MAAA,CAAOC,IAAA,EACP;QACIC,GAAA,EAAK;QACLZ;MACJ,EACJ;MACAO,QAAA,EAAwB,eAAA3C,IAAA,CAAKK,cAAA,EAAgB;QACzC4C,MAAA,EAAQ,CACJT,UAAA,EACAE,WAAA,CACJ;QACAQ,KAAA,EAAO;UACHC,CAAA,EAAG;UACHC,CAAA,EAAG;QACP;QACAC,GAAA,EAAK;UACDF,CAAA,EAAG;UACHC,CAAA,EAAG;QACP;QACAP,KAAA,EAAOvC,UAAA,CAAWgD;MACtB,CAAC;IACL,CAAC,GACa,eAAAtD,IAAA,CAAKQ,MAAA,EAAQ;MACvBoC,aAAA,EAAe;MACfC,KAAA,EAAO,CACHC,MAAA,CAAOC,IAAA,EACP;QACIQ,MAAA,EAAQ;QACRnB;MACJ,EACJ;MACAO,QAAA,EAAwB,eAAA3C,IAAA,CAAKK,cAAA,EAAgB;QACzC4C,MAAA,EAAQ,CACJP,WAAA,EACAF,UAAA,CACJ;QACAU,KAAA,EAAO;UACHC,CAAA,EAAG;UACHC,CAAA,EAAG;QACP;QACAC,GAAA,EAAK;UACDF,CAAA,EAAG;UACHC,CAAA,EAAG;QACP;QACAP,KAAA,EAAOvC,UAAA,CAAWgD;MACtB,CAAC;IACL,CAAC;EAET,CAAC;AACL;AACA,IAAIR,MAAA,GAASxC,UAAA,CAAWkD,MAAA,CAAO;EAC3BT,IAAA,EAAM;IACFU,QAAA,EAAU;IACVC,IAAA,EAAM;IACNC,KAAA,EAAO;IACPC,MAAA,EAAQ;EACZ;AACJ,CAAC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- function WheelEdgeFade(_props) {
2
- return null;
3
- }
4
- export { WheelEdgeFade };
5
- //# sourceMappingURL=WheelEdgeFade.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WheelEdgeFade","_props"],"sources":["../../../src/Wheel/WheelEdgeFade.tsx"],"sourcesContent":[null],"mappings":"AAIO,SAASA,cAAcC,MAAA,EAA4B;EACxD,OAAO;AACT","ignoreList":[]}
@@ -1,116 +0,0 @@
1
- "use strict";
2
-
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
21
- };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
25
- var WheelEdgeFade_native_exports = {};
26
- __export(WheelEdgeFade_native_exports, {
27
- WheelEdgeFade: () => WheelEdgeFade
28
- });
29
- module.exports = __toCommonJS(WheelEdgeFade_native_exports);
30
- var import_jsx_runtime = require("react/jsx-runtime");
31
- var import_expo_linear_gradient = require("expo-linear-gradient");
32
- var import_react_native = require("react-native");
33
- var import_tamagui = require("tamagui");
34
- function toTransparent(color) {
35
- var fnMatch = color.match(/^(rgb|hsl)a?\(([^)]+)\)$/i);
36
- if (fnMatch) {
37
- var parts = fnMatch[2].split(",").map(function (part) {
38
- return part.trim();
39
- });
40
- var [a, b, c] = parts;
41
- return `${fnMatch[1].toLowerCase()}a(${a}, ${b}, ${c}, 0)`;
42
- }
43
- var hexMatch = color.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
44
- if (hexMatch) {
45
- var hex = hexMatch[1];
46
- if (hex.length === 3) {
47
- hex = hex.split("").map(function (char) {
48
- return char + char;
49
- }).join("");
50
- }
51
- var r = Number.parseInt(hex.slice(0, 2), 16);
52
- var g = Number.parseInt(hex.slice(2, 4), 16);
53
- var b1 = Number.parseInt(hex.slice(4, 6), 16);
54
- return `rgba(${r}, ${g}, ${b1}, 0)`;
55
- }
56
- return "transparent";
57
- }
58
- function WheelEdgeFade(param) {
59
- var {
60
- height
61
- } = param;
62
- var _ref;
63
- var _theme_background;
64
- var theme = (0, import_tamagui.useTheme)();
65
- var background = (_ref = (_theme_background = theme.background) === null || _theme_background === void 0 ? void 0 : _theme_background.val) !== null && _ref !== void 0 ? _ref : "#ffffff";
66
- var transparent = toTransparent(background);
67
- if (height <= 0) return null;
68
- return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
69
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.View, {
70
- pointerEvents: "none",
71
- style: [styles.band, {
72
- top: 0,
73
- height
74
- }],
75
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_expo_linear_gradient.LinearGradient, {
76
- colors: [background, transparent],
77
- start: {
78
- x: 0.5,
79
- y: 0
80
- },
81
- end: {
82
- x: 0.5,
83
- y: 1
84
- },
85
- style: import_react_native.StyleSheet.absoluteFill
86
- })
87
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.View, {
88
- pointerEvents: "none",
89
- style: [styles.band, {
90
- bottom: 0,
91
- height
92
- }],
93
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_expo_linear_gradient.LinearGradient, {
94
- colors: [transparent, background],
95
- start: {
96
- x: 0.5,
97
- y: 0
98
- },
99
- end: {
100
- x: 0.5,
101
- y: 1
102
- },
103
- style: import_react_native.StyleSheet.absoluteFill
104
- })
105
- })]
106
- });
107
- }
108
- var styles = import_react_native.StyleSheet.create({
109
- band: {
110
- position: "absolute",
111
- left: 0,
112
- right: 0,
113
- zIndex: 2
114
- }
115
- });
116
- //# sourceMappingURL=WheelEdgeFade.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WheelEdgeFade_native_exports","__export","WheelEdgeFade","module","exports","__toCommonJS","import_jsx_runtime","require","import_expo_linear_gradient","import_react_native","import_tamagui","toTransparent","color","fnMatch","match","parts","split","map","part","trim","a","b","c","toLowerCase","hexMatch","hex","length","char","join","r","Number","parseInt","slice","g","b1","param","height","_ref","_theme_background","theme","useTheme","background","val","transparent","jsxs","Fragment","children","jsx","View","pointerEvents","style","styles","band","top","LinearGradient","colors","start","x","y","end","StyleSheet","absoluteFill","bottom","create","position","left","right","zIndex"],"sources":["../../../src/Wheel/WheelEdgeFade.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,4BAAA;AAAAC,QAAA,CAAAD,4BAAA;EAAAE,aAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,4BAAA;AAAA,IAAAM,kBAAA,GAAkEC,OAAA;AAClE,IAAAC,2BAAA,GAA+BD,OAAA;AAC/B,IAAAE,mBAAA,GAA2CF,OAAA;AAC3C,IAAAG,cAAA,GAAyBH,OAAA;AACzB,SAASI,cAAcC,KAAA,EAAO;EAC1B,IAAIC,OAAA,GAAUD,KAAA,CAAME,KAAA,CAAM,2BAA2B;EACrD,IAAID,OAAA,EAAS;IACT,IAAIE,KAAA,GAAQF,OAAA,CAAQ,CAAC,EAAEG,KAAA,CAAM,GAAG,EAAEC,GAAA,CAAI,UAASC,IAAA,EAAM;MACjD,OAAOA,IAAA,CAAKC,IAAA,CAAK;IACrB,CAAC;IACD,IAAI,CAACC,CAAA,EAAGC,CAAA,EAAGC,CAAC,IAAIP,KAAA;IAChB,OAAO,GAAGF,OAAA,CAAQ,CAAC,EAAEU,WAAA,CAAY,CAAC,KAAKH,CAAC,KAAKC,CAAC,KAAKC,CAAC;EACxD;EACA,IAAIE,QAAA,GAAWZ,KAAA,CAAME,KAAA,CAAM,+BAA+B;EAC1D,IAAIU,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uC,IAAA,EAAQ;MACvBC,aAAA,EAAe;MACfC,KAAA,EAAO,CACHC,MAAA,CAAOC,IAAA,EACP;QACIC,GAAA,EAAK;QACLjB;MACJ,EACJ;MACAU,QAAA,EAAwB,mBAAAxC,kBAAA,CAAAyC,GAAA,EAAKvC,2BAAA,CAAA8C,cAAA,EAAgB;QACzCC,MAAA,EAAQ,CACJd,UAAA,EACAE,WAAA,CACJ;QACAa,KAAA,EAAO;UACHC,CAAA,EAAG;UACHC,CAAA,EAAG;QACP;QACAC,GAAA,EAAK;UACDF,CAAA,EAAG;UACHC,CAAA,EAAG;QACP;QACAR,KAAA,EAAOzC,mBAAA,CAAAmD,UAAA,CAAWC;MACtB,CAAC;IACL,CAAC,GACa,mBAAAvD,kBAAA,CAAAyC,GAAA,EAAKtC,mBAAA,CAAAuC,IAAA,EAAQ;MACvBC,aAAA,EAAe;MACfC,KAAA,EAAO,CACHC,MAAA,CAAOC,IAAA,EACP;QACIU,MAAA,EAAQ;QACR1B;MACJ,EACJ;MACAU,QAAA,EAAwB,mBAAAxC,kBAAA,CAAAyC,GAAA,EAAKvC,2BAAA,CAAA8C,cAAA,EAAgB;QACzCC,MAAA,EAAQ,CACJZ,WAAA,EACAF,UAAA,CACJ;QACAe,KAAA,EAAO;UACHC,CAAA,EAAG;UACHC,CAAA,EAAG;QACP;QACAC,GAAA,EAAK;UACDF,CAAA,EAAG;UACHC,CAAA,EAAG;QACP;QACAR,KAAA,EAAOzC,mBAAA,CAAAmD,UAAA,CAAWC;MACtB,CAAC;IACL,CAAC;EAET,CAAC;AACL;AACA,IAAIV,MAAA,GAAS1C,mBAAA,CAAAmD,UAAA,CAAWG,MAAA,CAAO;EAC3BX,IAAA,EAAM;IACFY,QAAA,EAAU;IACVC,IAAA,EAAM;IACNC,KAAA,EAAO;IACPC,MAAA,EAAQ;EACZ;AACJ,CAAC","ignoreList":[]}
@@ -1,67 +0,0 @@
1
- import { LinearGradient } from "expo-linear-gradient";
2
- import { StyleSheet, View as RNView } from "react-native";
3
- import { useTheme } from "tamagui";
4
-
5
- function toTransparent(color: string): string {
6
- const fnMatch = color.match(/^(rgb|hsl)a?\(([^)]+)\)$/i);
7
- if (fnMatch) {
8
- const parts = fnMatch[2].split(",").map((part) => part.trim());
9
- const [a, b, c] = parts;
10
- return `${fnMatch[1].toLowerCase()}a(${a}, ${b}, ${c}, 0)`;
11
- }
12
- const hexMatch = color.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
13
- if (hexMatch) {
14
- let hex = hexMatch[1];
15
- if (hex.length === 3) {
16
- hex = hex
17
- .split("")
18
- .map((char) => char + char)
19
- .join("");
20
- }
21
- const r = Number.parseInt(hex.slice(0, 2), 16);
22
- const g = Number.parseInt(hex.slice(2, 4), 16);
23
- const b = Number.parseInt(hex.slice(4, 6), 16);
24
- return `rgba(${r}, ${g}, ${b}, 0)`;
25
- }
26
- return "transparent";
27
- }
28
-
29
- /**
30
- * Cylinder fade toward the edges. Overlay (not row opacity) so inactive
31
- * numerals stay on the $color11 ramp (LC-25 / Wheel contrast contract).
32
- */
33
- export function WheelEdgeFade({ height }: { height: number }) {
34
- const theme = useTheme();
35
- const background = theme.background?.val ?? "#ffffff";
36
- const transparent = toTransparent(background);
37
- if (height <= 0) return null;
38
- return (
39
- <>
40
- <RNView pointerEvents="none" style={[styles.band, { top: 0, height }]}>
41
- <LinearGradient
42
- colors={[background, transparent]}
43
- start={{ x: 0.5, y: 0 }}
44
- end={{ x: 0.5, y: 1 }}
45
- style={StyleSheet.absoluteFill}
46
- />
47
- </RNView>
48
- <RNView pointerEvents="none" style={[styles.band, { bottom: 0, height }]}>
49
- <LinearGradient
50
- colors={[transparent, background]}
51
- start={{ x: 0.5, y: 0 }}
52
- end={{ x: 0.5, y: 1 }}
53
- style={StyleSheet.absoluteFill}
54
- />
55
- </RNView>
56
- </>
57
- );
58
- }
59
-
60
- const styles = StyleSheet.create({
61
- band: {
62
- position: "absolute",
63
- left: 0,
64
- right: 0,
65
- zIndex: 2,
66
- },
67
- });
@@ -1,141 +0,0 @@
1
- /**
2
- * WheelEdgeFade — LC-25's two halves (MPO-143).
3
- *
4
- * The contract is a platform split with a contrast reason behind it. On web the
5
- * wheel viewport carries a CSS mask, so this component must render NOTHING; on
6
- * native it paints two absolutely-positioned gradient bands as an OVERLAY. The
7
- * overlay is the whole point: fading the rows themselves would drop their
8
- * opacity below 1 and take the inactive `$color11` numerals under the AA floor,
9
- * which is the regression Wheel.spec.tsx guards from the other side.
10
- *
11
- * Both halves are exercised. A spec that covered only the file the web build
12
- * resolves would be asserting `null` and calling it a test.
13
- *
14
- * `expo-linear-gradient` ships untranspiled JSX in its published build, which
15
- * the web transform cannot parse, so it is mocked into a probe element. The
16
- * mock is the gradient, not the component under test: colours, start and end
17
- * come straight from WheelEdgeFade.
18
- */
19
- import { cleanup } from "@testing-library/react";
20
- import { renderWithProviders } from "@multiplatform.one/test-utils";
21
- import { afterEach, describe, expect, it, vi } from "vitest";
22
- import { WheelEdgeFade } from "./WheelEdgeFade";
23
- import { WheelEdgeFade as NativeWheelEdgeFade } from "./WheelEdgeFade.native";
24
-
25
- vi.mock("expo-linear-gradient", () => ({
26
- LinearGradient: (props: { colors?: string[]; start?: unknown; end?: unknown }) => (
27
- <div
28
- data-gradient="true"
29
- data-colors={(props.colors ?? []).join("|")}
30
- data-start={JSON.stringify(props.start)}
31
- data-end={JSON.stringify(props.end)}
32
- />
33
- ),
34
- }));
35
-
36
- afterEach(cleanup);
37
-
38
- function bands(container: HTMLElement): HTMLElement[] {
39
- return Array.from(container.querySelectorAll("[style*='height']")) as HTMLElement[];
40
- }
41
-
42
- function gradients(container: HTMLElement): HTMLElement[] {
43
- return Array.from(container.querySelectorAll("[data-gradient]")) as HTMLElement[];
44
- }
45
-
46
- function colorsOf(node: HTMLElement): string[] {
47
- return String(node.getAttribute("data-colors") ?? "").split("|");
48
- }
49
-
50
- describe("WheelEdgeFade — web", () => {
51
- it("renders nothing, because the viewport's CSS mask already does the fade", () => {
52
- const { container } = renderWithProviders(<WheelEdgeFade height={24} />);
53
- expect(container.querySelector("[data-gradient]")).toBeNull();
54
- expect(container.textContent).toBe("");
55
- });
56
-
57
- it("renders nothing at every height, so it can never dim a row", () => {
58
- for (const height of [0, 1, 24, 400]) {
59
- const { container } = renderWithProviders(<WheelEdgeFade height={height} />);
60
- expect(container.querySelector("[data-gradient]"), String(height)).toBeNull();
61
- cleanup();
62
- }
63
- });
64
- });
65
-
66
- describe("WheelEdgeFade — native", () => {
67
- it("paints one band per edge, never a single one", () => {
68
- const { container } = renderWithProviders(<NativeWheelEdgeFade height={24} />);
69
- expect(gradients(container)).toHaveLength(2);
70
- });
71
-
72
- it("draws nothing at all when the band height is zero or negative", () => {
73
- const zero = renderWithProviders(<NativeWheelEdgeFade height={0} />);
74
- expect(gradients(zero.container)).toHaveLength(0);
75
- cleanup();
76
- const negative = renderWithProviders(<NativeWheelEdgeFade height={-8} />);
77
- expect(gradients(negative.container)).toHaveLength(0);
78
- });
79
-
80
- it("pins one band to the top and one to the bottom", () => {
81
- const { container } = renderWithProviders(<NativeWheelEdgeFade height={30} />);
82
- const edges = bands(container).map((node) => node.getAttribute("style") ?? "");
83
- expect(edges.some((style) => /top:\s*0px/.test(style))).toBe(true);
84
- expect(edges.some((style) => /bottom:\s*0px/.test(style))).toBe(true);
85
- });
86
-
87
- it("gives each band the height it was handed, so the caller sets the fade depth", () => {
88
- const { container } = renderWithProviders(<NativeWheelEdgeFade height={30} />);
89
- const heights = bands(container).map(
90
- (node) => /height:\s*(\d+)px/.exec(node.getAttribute("style") ?? "")?.[1],
91
- );
92
- expect(heights.filter(Boolean)).toEqual(["30", "30"]);
93
- cleanup();
94
- const taller = renderWithProviders(<NativeWheelEdgeFade height={64} />);
95
- expect(
96
- bands(taller.container).map(
97
- (node) => /height:\s*(\d+)px/.exec(node.getAttribute("style") ?? "")?.[1],
98
- ),
99
- ).toEqual(["64", "64"]);
100
- });
101
-
102
- it("keeps the bands out of the way of a drag, so the wheel still scrolls", () => {
103
- const { container } = renderWithProviders(<NativeWheelEdgeFade height={24} />);
104
- for (const band of bands(container)) {
105
- expect(band.className).toContain("r-pointerEvents");
106
- expect(band.className).toContain("r-position");
107
- }
108
- });
109
-
110
- it("runs the top band opaque-to-clear and the bottom band clear-to-opaque", () => {
111
- const { container } = renderWithProviders(<NativeWheelEdgeFade height={24} />);
112
- const [top, bottom] = gradients(container).map(colorsOf);
113
- expect(top).toHaveLength(2);
114
- expect(bottom).toHaveLength(2);
115
- // The two bands are mirror images: the top starts on the page background
116
- // and ends transparent, the bottom does the reverse.
117
- expect(top[0]).toBe(bottom[1]);
118
- expect(top[1]).toBe(bottom[0]);
119
- expect(top[1]).toMatch(/,\s*0\)$/);
120
- expect(top[0]).not.toMatch(/,\s*0\)$/);
121
- });
122
-
123
- it("derives the fade colour from the theme background rather than a hardcoded white", () => {
124
- const { container } = renderWithProviders(<NativeWheelEdgeFade height={24} />);
125
- const [opaque, clear] = colorsOf(gradients(container)[0]);
126
- expect(opaque).toBeTruthy();
127
- expect(opaque).not.toBe("transparent");
128
- // The clear stop is the SAME colour at zero alpha, so the band never
129
- // shifts hue across its length.
130
- const channels = /rgba\(([^)]+),\s*0\)$/.exec(clear)?.[1];
131
- expect(channels, `clear stop ${clear} must be the opaque stop at alpha 0`).toBeTruthy();
132
- });
133
-
134
- it("runs both gradients vertically down the centre line", () => {
135
- const { container } = renderWithProviders(<NativeWheelEdgeFade height={24} />);
136
- for (const gradient of gradients(container)) {
137
- expect(gradient.getAttribute("data-start")).toBe(JSON.stringify({ x: 0.5, y: 0 }));
138
- expect(gradient.getAttribute("data-end")).toBe(JSON.stringify({ x: 0.5, y: 1 }));
139
- }
140
- });
141
- });
@@ -1,7 +0,0 @@
1
- /**
2
- * Web uses the CSS mask on the wheel viewport (LC-25: row opacity stays 1 so
3
- * $color11 clears AA). Native paints a background fade overlay instead.
4
- */
5
- export function WheelEdgeFade(_props: { height: number }) {
6
- return null;
7
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * Web uses the CSS mask on the wheel viewport (LC-25: row opacity stays 1 so
3
- * $color11 clears AA). Native paints a background fade overlay instead.
4
- */
5
- export declare function WheelEdgeFade(_props: {
6
- height: number;
7
- }): null;
8
- //# sourceMappingURL=WheelEdgeFade.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WheelEdgeFade.d.ts","sourceRoot":"","sources":["../../src/Wheel/WheelEdgeFade.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,QAEvD"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Cylinder fade toward the edges. Overlay (not row opacity) so inactive
3
- * numerals stay on the $color11 ramp (LC-25 / Wheel contrast contract).
4
- */
5
- export declare function WheelEdgeFade({ height }: {
6
- height: number;
7
- }): import("react/jsx-runtime").JSX.Element | null;
8
- //# sourceMappingURL=WheelEdgeFade.native.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WheelEdgeFade.native.d.ts","sourceRoot":"","sources":["../../src/Wheel/WheelEdgeFade.native.tsx"],"names":[],"mappings":"AA4BA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,kDAyB3D"}