@tamagui/dom 0.0.0-bootstrap.0 → 3.0.0-beta.643.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 (93) hide show
  1. package/dist/cjs/events.cjs +17 -0
  2. package/dist/cjs/events.native.cjs +19 -0
  3. package/dist/cjs/events.native.js +21 -0
  4. package/dist/cjs/events.native.js.map +1 -0
  5. package/dist/cjs/index.cjs +26 -0
  6. package/dist/cjs/index.native.cjs +28 -0
  7. package/dist/cjs/index.native.js +30 -0
  8. package/dist/cjs/index.native.js.map +1 -0
  9. package/dist/cjs/props.cjs +17 -0
  10. package/dist/cjs/props.native.cjs +19 -0
  11. package/dist/cjs/props.native.js +21 -0
  12. package/dist/cjs/props.native.js.map +1 -0
  13. package/dist/cjs/tables/attributes.cjs +850 -0
  14. package/dist/cjs/tables/attributes.native.cjs +862 -0
  15. package/dist/cjs/tables/attributes.native.js +864 -0
  16. package/dist/cjs/tables/attributes.native.js.map +1 -0
  17. package/dist/cjs/tables/compatibility.cjs +338 -0
  18. package/dist/cjs/tables/compatibility.native.cjs +340 -0
  19. package/dist/cjs/tables/compatibility.native.js +342 -0
  20. package/dist/cjs/tables/compatibility.native.js.map +1 -0
  21. package/dist/cjs/tables/events.cjs +169 -0
  22. package/dist/cjs/tables/events.native.cjs +175 -0
  23. package/dist/cjs/tables/events.native.js +177 -0
  24. package/dist/cjs/tables/events.native.js.map +1 -0
  25. package/dist/cjs/tables/nativeBacking.cjs +133 -0
  26. package/dist/cjs/tables/nativeBacking.native.cjs +135 -0
  27. package/dist/cjs/tables/nativeBacking.native.js +137 -0
  28. package/dist/cjs/tables/nativeBacking.native.js.map +1 -0
  29. package/dist/cjs/tables/tags.cjs +576 -0
  30. package/dist/cjs/tables/tags.native.cjs +578 -0
  31. package/dist/cjs/tables/tags.native.js +580 -0
  32. package/dist/cjs/tables/tags.native.js.map +1 -0
  33. package/dist/cjs/tables/types.cjs +17 -0
  34. package/dist/cjs/tables/types.native.cjs +19 -0
  35. package/dist/cjs/tables/types.native.js +21 -0
  36. package/dist/cjs/tables/types.native.js.map +1 -0
  37. package/dist/esm/events.mjs +0 -0
  38. package/dist/esm/events.native.js +0 -0
  39. package/dist/esm/index.mjs +15 -0
  40. package/dist/esm/index.native.js +15 -0
  41. package/dist/esm/props.mjs +0 -0
  42. package/dist/esm/props.native.js +0 -0
  43. package/dist/esm/tables/attributes.mjs +821 -0
  44. package/dist/esm/tables/attributes.mjs.map +1 -0
  45. package/dist/esm/tables/attributes.native.js +831 -0
  46. package/dist/esm/tables/attributes.native.js.map +1 -0
  47. package/dist/esm/tables/compatibility.mjs +314 -0
  48. package/dist/esm/tables/compatibility.mjs.map +1 -0
  49. package/dist/esm/tables/compatibility.native.js +314 -0
  50. package/dist/esm/tables/compatibility.native.js.map +1 -0
  51. package/dist/esm/tables/events.mjs +145 -0
  52. package/dist/esm/tables/events.mjs.map +1 -0
  53. package/dist/esm/tables/events.native.js +149 -0
  54. package/dist/esm/tables/events.native.js.map +1 -0
  55. package/dist/esm/tables/nativeBacking.mjs +106 -0
  56. package/dist/esm/tables/nativeBacking.mjs.map +1 -0
  57. package/dist/esm/tables/nativeBacking.native.js +106 -0
  58. package/dist/esm/tables/nativeBacking.native.js.map +1 -0
  59. package/dist/esm/tables/tags.mjs +550 -0
  60. package/dist/esm/tables/tags.mjs.map +1 -0
  61. package/dist/esm/tables/tags.native.js +550 -0
  62. package/dist/esm/tables/tags.native.js.map +1 -0
  63. package/dist/esm/tables/types.mjs +0 -0
  64. package/dist/esm/tables/types.native.js +0 -0
  65. package/package.json +57 -7
  66. package/src/events.ts +58 -0
  67. package/src/index.ts +19 -0
  68. package/src/props.ts +699 -0
  69. package/src/tables/attributes.ts +863 -0
  70. package/src/tables/compatibility.ts +360 -0
  71. package/src/tables/events.ts +176 -0
  72. package/src/tables/nativeBacking.ts +132 -0
  73. package/src/tables/tags.ts +557 -0
  74. package/src/tables/types.ts +202 -0
  75. package/types/events.d.ts +58 -0
  76. package/types/events.d.ts.map +11 -0
  77. package/types/index.d.ts +20 -0
  78. package/types/index.d.ts.map +11 -0
  79. package/types/props.d.ts +499 -0
  80. package/types/props.d.ts.map +11 -0
  81. package/types/tables/attributes.d.ts +21 -0
  82. package/types/tables/attributes.d.ts.map +11 -0
  83. package/types/tables/compatibility.d.ts +28 -0
  84. package/types/tables/compatibility.d.ts.map +11 -0
  85. package/types/tables/events.d.ts +5 -0
  86. package/types/tables/events.d.ts.map +11 -0
  87. package/types/tables/nativeBacking.d.ts +28 -0
  88. package/types/tables/nativeBacking.d.ts.map +11 -0
  89. package/types/tables/tags.d.ts +36 -0
  90. package/types/tables/tags.d.ts.map +11 -0
  91. package/types/tables/types.d.ts +135 -0
  92. package/types/tables/types.d.ts.map +11 -0
  93. package/README.md +0 -1
package/src/events.ts ADDED
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Event payloads for the Tamagui DOM contract.
3
+ *
4
+ * Only the cross-platform subset is typed. Where an event's shape genuinely
5
+ * differs between a browser event and a react native synthetic event, the
6
+ * handler takes `unknown` rather than promising a shape one platform cannot
7
+ * deliver — `payload: 'unknown'` in the event table. These are the payloads a
8
+ * native primitive can construct in full, so a handler written against them
9
+ * behaves the same on both platforms.
10
+ *
11
+ * Extra platform fields are not excluded: a handler receives a value, and
12
+ * TypeScript only seals object literals, so reading a web-only field off the
13
+ * event still needs a cast and still says so at the call site.
14
+ */
15
+
16
+ export type DOMClickEvent = {
17
+ readonly altKey: boolean
18
+ readonly button: number
19
+ readonly ctrlKey: boolean
20
+ readonly defaultPrevented: boolean
21
+ readonly getModifierState: (key: string) => boolean
22
+ readonly metaKey: boolean
23
+ readonly pageX: number
24
+ readonly pageY: number
25
+ /** @platform web — native has nothing to cancel, so this is a no-op there */
26
+ readonly preventDefault: () => void
27
+ readonly shiftKey: boolean
28
+ /** @platform web — native has nothing to cancel, so this is a no-op there */
29
+ readonly stopPropagation: () => void
30
+ readonly type: 'click'
31
+ }
32
+
33
+ export type DOMKeyEvent = {
34
+ readonly key: string
35
+ readonly type?: string
36
+ }
37
+
38
+ export type DOMChangeEvent = {
39
+ readonly target: { readonly value: string }
40
+ readonly type: 'change'
41
+ }
42
+
43
+ export type DOMInputEvent = {
44
+ readonly target: { readonly value: string }
45
+ readonly type: 'input'
46
+ }
47
+
48
+ export type DOMImageLoadEvent = {
49
+ readonly target: {
50
+ readonly naturalHeight?: number
51
+ readonly naturalWidth?: number
52
+ }
53
+ readonly type: 'load'
54
+ }
55
+
56
+ export type DOMImageErrorEvent = {
57
+ readonly type: 'error'
58
+ }
package/src/index.ts ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * `@tamagui/dom` — the Tamagui DOM contract.
3
+ *
4
+ * The tables here are the single source of truth for DOM mode: the compiler
5
+ * reads them to classify tags, validate props and nesting and inject native
6
+ * primitives, the runtime reads them for element defaults and native prop
7
+ * mapping, and the prop-interface generator reads them to emit the strict
8
+ * types. React Strict DOM is the semantic reference and conformance oracle
9
+ * (see `compatibility.ts`), never a dependency.
10
+ */
11
+
12
+ export * from './events'
13
+ export * from './props'
14
+ export * from './tables/attributes'
15
+ export * from './tables/compatibility'
16
+ export * from './tables/events'
17
+ export * from './tables/nativeBacking'
18
+ export * from './tables/tags'
19
+ export * from './tables/types'