@trama-ui/react-native 0.0.0-stage → 0.7.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 (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +198 -2
  3. package/dist/accordion.d.ts +29 -0
  4. package/dist/accordion.js +137 -0
  5. package/dist/alert.d.ts +30 -0
  6. package/dist/alert.js +95 -0
  7. package/dist/avatar.d.ts +36 -0
  8. package/dist/avatar.js +91 -0
  9. package/dist/bars.d.ts +44 -0
  10. package/dist/bars.js +74 -0
  11. package/dist/button.d.ts +30 -0
  12. package/dist/button.js +90 -0
  13. package/dist/calendar.d.ts +71 -0
  14. package/dist/calendar.js +276 -0
  15. package/dist/card.d.ts +41 -0
  16. package/dist/card.js +139 -0
  17. package/dist/choices.d.ts +87 -0
  18. package/dist/choices.js +228 -0
  19. package/dist/collections.d.ts +131 -0
  20. package/dist/collections.js +230 -0
  21. package/dist/color-code.d.ts +37 -0
  22. package/dist/color-code.js +158 -0
  23. package/dist/compositions.d.ts +110 -0
  24. package/dist/compositions.js +190 -0
  25. package/dist/controls.d.ts +85 -0
  26. package/dist/controls.js +221 -0
  27. package/dist/drag-drop.d.ts +65 -0
  28. package/dist/drag-drop.js +482 -0
  29. package/dist/feedback.d.ts +30 -0
  30. package/dist/feedback.js +81 -0
  31. package/dist/file-upload.d.ts +67 -0
  32. package/dist/file-upload.js +251 -0
  33. package/dist/generated/icons.d.ts +1037 -0
  34. package/dist/generated/icons.js +3 -0
  35. package/dist/generated/tokens.d.ts +64 -0
  36. package/dist/generated/tokens.js +65 -0
  37. package/dist/icon.d.ts +31 -0
  38. package/dist/icon.js +28 -0
  39. package/dist/index.d.ts +43 -0
  40. package/dist/index.js +43 -0
  41. package/dist/input.d.ts +43 -0
  42. package/dist/input.js +115 -0
  43. package/dist/interactive-layout.d.ts +26 -0
  44. package/dist/interactive-layout.js +117 -0
  45. package/dist/internal/content.d.ts +17 -0
  46. package/dist/internal/content.js +24 -0
  47. package/dist/internal/drag-geometry.d.ts +16 -0
  48. package/dist/internal/drag-geometry.js +25 -0
  49. package/dist/internal/keyboard.d.ts +20 -0
  50. package/dist/internal/keyboard.js +101 -0
  51. package/dist/internal/motion.d.ts +1 -0
  52. package/dist/internal/motion.js +24 -0
  53. package/dist/internal/number-format.d.ts +4 -0
  54. package/dist/internal/number-format.js +25 -0
  55. package/dist/internal/pointer-capture.d.ts +1 -0
  56. package/dist/internal/pointer-capture.js +16 -0
  57. package/dist/internal/state.d.ts +6 -0
  58. package/dist/internal/state.js +28 -0
  59. package/dist/internal/system-drag.d.ts +48 -0
  60. package/dist/internal/system-drag.js +93 -0
  61. package/dist/internal/table-drag.d.ts +56 -0
  62. package/dist/internal/table-drag.js +237 -0
  63. package/dist/internal/table-editing.d.ts +49 -0
  64. package/dist/internal/table-editing.js +278 -0
  65. package/dist/internal/table-editor.d.ts +11 -0
  66. package/dist/internal/table-editor.js +31 -0
  67. package/dist/internal/table-grid.d.ts +44 -0
  68. package/dist/internal/table-grid.js +153 -0
  69. package/dist/internal/table-model.d.ts +132 -0
  70. package/dist/internal/table-model.js +231 -0
  71. package/dist/internal/table-source.d.ts +9 -0
  72. package/dist/internal/table-source.js +80 -0
  73. package/dist/internal/tour-target.d.ts +23 -0
  74. package/dist/internal/tour-target.js +81 -0
  75. package/dist/keyboard.d.ts +14 -0
  76. package/dist/keyboard.js +27 -0
  77. package/dist/layout.d.ts +35 -0
  78. package/dist/layout.js +77 -0
  79. package/dist/loader.d.ts +18 -0
  80. package/dist/loader.js +79 -0
  81. package/dist/localization.d.ts +106 -0
  82. package/dist/localization.js +310 -0
  83. package/dist/media.d.ts +35 -0
  84. package/dist/media.js +96 -0
  85. package/dist/menus.d.ts +103 -0
  86. package/dist/menus.js +422 -0
  87. package/dist/navigation.d.ts +111 -0
  88. package/dist/navigation.js +255 -0
  89. package/dist/overlays.d.ts +97 -0
  90. package/dist/overlays.js +364 -0
  91. package/dist/pill.d.ts +33 -0
  92. package/dist/pill.js +90 -0
  93. package/dist/progress.d.ts +27 -0
  94. package/dist/progress.js +154 -0
  95. package/dist/responsive.d.ts +15 -0
  96. package/dist/responsive.js +27 -0
  97. package/dist/select.d.ts +74 -0
  98. package/dist/select.js +181 -0
  99. package/dist/separator.d.ts +13 -0
  100. package/dist/separator.js +34 -0
  101. package/dist/switch.d.ts +26 -0
  102. package/dist/switch.js +69 -0
  103. package/dist/table.d.ts +122 -0
  104. package/dist/table.js +928 -0
  105. package/dist/text-fields.d.ts +39 -0
  106. package/dist/text-fields.js +134 -0
  107. package/dist/theme.d.ts +47 -0
  108. package/dist/theme.js +71 -0
  109. package/dist/transient.d.ts +80 -0
  110. package/dist/transient.js +273 -0
  111. package/package.json +50 -4
@@ -0,0 +1,3 @@
1
+ // Generated from the Trama icon catalog.
2
+ export const icons = { "plus": { "nodes": [["path", { "d": "M12 5v14M5 12h14" }]], "mirrorsInRtl": false }, "minus": { "nodes": [["path", { "d": "M5 12h14" }]], "mirrorsInRtl": false }, "check": { "nodes": [["path", { "d": "m5 12 4.5 4.5L19 7" }]], "mirrorsInRtl": false }, "close": { "nodes": [["path", { "d": "m6 6 12 12M18 6 6 18" }]], "mirrorsInRtl": false }, "search": { "nodes": [["circle", { "cx": 10.5, "cy": 10.5, "r": 6.5 }], ["path", { "d": "m16 16 4.5 4.5" }]], "mirrorsInRtl": false }, "edit": { "nodes": [["path", { "d": "m14.5 5.5 4 4M4 20l4.5-1L20 7.5a1.4 1.4 0 0 0 0-2l-1.5-1.5a1.4 1.4 0 0 0-2 0L5 15.5 4 20Z" }]], "mirrorsInRtl": false }, "trash": { "nodes": [["path", { "d": "M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13M10 11v5m4-5v5" }]], "mirrorsInRtl": false }, "download": { "nodes": [["path", { "d": "M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4" }]], "mirrorsInRtl": false }, "upload": { "nodes": [["path", { "d": "M12 15V3m-5 5 5-5 5 5M4 16v4h16v-4" }]], "mirrorsInRtl": false }, "copy": { "nodes": [["rect", { "x": 8, "y": 8, "width": 12, "height": 12, "rx": 2 }], ["path", { "d": "M15 8V4H4v11h4" }]], "mirrorsInRtl": false }, "filter": { "nodes": [["path", { "d": "M4 5h16l-6.2 7.1V19l-3.6 2v-8.9L4 5Z" }]], "mirrorsInRtl": false }, "refresh": { "nodes": [["path", { "d": "M20 7v5h-5M4 17v-5h5" }], ["path", { "d": "M18.3 9A7 7 0 0 0 6 6.8L4 9m2 6a7 7 0 0 0 12 2.2L20 15" }]], "mirrorsInRtl": false }, "undo": { "nodes": [["path", { "d": "m9 7-5 5 5 5M5 12h8a6 6 0 0 1 6 6" }]], "mirrorsInRtl": false }, "redo": { "nodes": [["path", { "d": "m15 7 5 5-5 5M19 12h-8a6 6 0 0 0-6 6" }]], "mirrorsInRtl": false }, "save": { "nodes": [["path", { "d": "M5 4h12l3 3v13H4V5a1 1 0 0 1 1-1Z" }], ["path", { "d": "M8 4v6h8V4M8 20v-6h8v6" }]], "mirrorsInRtl": false }, "share": { "nodes": [["circle", { "cx": 18, "cy": 5, "r": 2.5 }], ["circle", { "cx": 6, "cy": 12, "r": 2.5 }], ["circle", { "cx": 18, "cy": 19, "r": 2.5 }], ["path", { "d": "m8.2 10.8 7.6-4.4m-7.6 6.8 7.6 4.4" }]], "mirrorsInRtl": false }, "external-link": { "nodes": [["path", { "d": "M13 5H5v14h14v-8M14 4h6v6M20 4l-9 9" }]], "mirrorsInRtl": false }, "more": { "nodes": [["circle", { "cx": 5, "cy": 12, "r": 1 }], ["circle", { "cx": 12, "cy": 12, "r": 1 }], ["circle", { "cx": 19, "cy": 12, "r": 1 }]], "mirrorsInRtl": false }, "arrow-left": { "nodes": [["path", { "d": "M20 12H4m6-6-6 6 6 6" }]], "mirrorsInRtl": false }, "arrow-right": { "nodes": [["path", { "d": "M4 12h16m-6-6 6 6-6 6" }]], "mirrorsInRtl": false }, "arrow-up": { "nodes": [["path", { "d": "M12 20V4m-6 6 6-6 6 6" }]], "mirrorsInRtl": false }, "arrow-down": { "nodes": [["path", { "d": "M12 4v16m-6-6 6 6 6-6" }]], "mirrorsInRtl": false }, "arrow-start": { "nodes": [["path", { "d": "M20 12H4m6-6-6 6 6 6" }]], "mirrorsInRtl": true }, "arrow-end": { "nodes": [["path", { "d": "M4 12h16m-6-6 6 6-6 6" }]], "mirrorsInRtl": true }, "chevron-left": { "nodes": [["path", { "d": "m15 5-7 7 7 7" }]], "mirrorsInRtl": false }, "chevron-right": { "nodes": [["path", { "d": "m9 5 7 7-7 7" }]], "mirrorsInRtl": false }, "chevron-up": { "nodes": [["path", { "d": "m6 15 6-6 6 6" }]], "mirrorsInRtl": false }, "chevron-down": { "nodes": [["path", { "d": "m6 9 6 6 6-6" }]], "mirrorsInRtl": false }, "chevron-start": { "nodes": [["path", { "d": "m15 5-7 7 7 7" }]], "mirrorsInRtl": true }, "chevron-end": { "nodes": [["path", { "d": "m9 5 7 7-7 7" }]], "mirrorsInRtl": true }, "menu": { "nodes": [["path", { "d": "M4 6h16M4 12h16M4 18h16" }]], "mirrorsInRtl": false }, "home": { "nodes": [["path", { "d": "m3 11 9-8 9 8M5 10v10h14V10M9 20v-6h6v6" }]], "mirrorsInRtl": false }, "compass": { "nodes": [["circle", { "cx": 12, "cy": 12, "r": 9 }], ["path", { "d": "m15.5 8.5-2.1 4.9-4.9 2.1 2.1-4.9 4.9-2.1Z" }]], "mirrorsInRtl": false }, "map-pin": { "nodes": [["path", { "d": "M20 10c0 5-8 11-8 11S4 15 4 10a8 8 0 1 1 16 0Z" }], ["circle", { "cx": 12, "cy": 10, "r": 2.5 }]], "mirrorsInRtl": false }, "info": { "nodes": [["circle", { "cx": 12, "cy": 12, "r": 9 }], ["path", { "d": "M12 11v6" }], ["circle", { "cx": 12, "cy": 7.5, "r": 0.7, "fill": "currentColor", "stroke": "none" }]], "mirrorsInRtl": false }, "check-circle": { "nodes": [["circle", { "cx": 12, "cy": 12, "r": 9 }], ["path", { "d": "m8 12 2.6 2.7L16.5 9" }]], "mirrorsInRtl": false }, "warning": { "nodes": [["path", { "d": "M10.4 4.5 2.8 18a2 2 0 0 0 1.7 3h15a2 2 0 0 0 1.7-3L13.6 4.5a1.8 1.8 0 0 0-3.2 0Z" }], ["path", { "d": "M12 9v4" }], ["circle", { "cx": 12, "cy": 17, "r": 0.7, "fill": "currentColor", "stroke": "none" }]], "mirrorsInRtl": false }, "error": { "nodes": [["circle", { "cx": 12, "cy": 12, "r": 9 }], ["path", { "d": "M12 7v6" }], ["circle", { "cx": 12, "cy": 17, "r": 0.7, "fill": "currentColor", "stroke": "none" }]], "mirrorsInRtl": false }, "help": { "nodes": [["circle", { "cx": 12, "cy": 12, "r": 9 }], ["path", { "d": "M9.5 9a2.7 2.7 0 1 1 4.2 2.3c-1.1.7-1.7 1.2-1.7 2.7" }], ["circle", { "cx": 12, "cy": 17, "r": 0.7, "fill": "currentColor", "stroke": "none" }]], "mirrorsInRtl": false }, "bell": { "nodes": [["path", { "d": "M18 9a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4" }]], "mirrorsInRtl": false }, "bell-off": { "nodes": [["path", { "d": "M9.7 4.5A6 6 0 0 1 18 10c0 2.8.5 4.4 1.3 5.4M6 6.4A6 6 0 0 0 6 10c0 7-3 7-3 9h16M10 22h4M3 3l18 18" }]], "mirrorsInRtl": false }, "eye": { "nodes": [["path", { "d": "M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z" }], ["circle", { "cx": 12, "cy": 12, "r": 2.7 }]], "mirrorsInRtl": false }, "eye-off": { "nodes": [["path", { "d": "M9.8 6.3A9.8 9.8 0 0 1 12 6c6 0 9.5 6 9.5 6a15 15 0 0 1-2.1 2.8M6.3 7.1A15 15 0 0 0 2.5 12s3.5 6 9.5 6a9.8 9.8 0 0 0 3-.5M3 3l18 18" }]], "mirrorsInRtl": false }, "lock": { "nodes": [["rect", { "x": 5, "y": 10, "width": 14, "height": 11, "rx": 2 }], ["path", { "d": "M8 10V7a4 4 0 0 1 8 0v3M12 14v3" }]], "mirrorsInRtl": false }, "unlock": { "nodes": [["rect", { "x": 5, "y": 10, "width": 14, "height": 11, "rx": 2 }], ["path", { "d": "M8 10V7a4 4 0 0 1 7.7-1.5M12 14v3" }]], "mirrorsInRtl": false }, "shield": { "nodes": [["path", { "d": "M12 3 20 6v5c0 5-3.2 8.2-8 10-4.8-1.8-8-5-8-10V6l8-3Z" }]], "mirrorsInRtl": false }, "shield-check": { "nodes": [["path", { "d": "M12 3 20 6v5c0 5-3.2 8.2-8 10-4.8-1.8-8-5-8-10V6l8-3Z" }], ["path", { "d": "m8.5 12 2.2 2.2 4.8-5" }]], "mirrorsInRtl": false }, "star": { "nodes": [["path", { "d": "m12 3 2.8 5.9 6.4.9-4.6 4.5 1.1 6.4-5.7-3-5.7 3 1.1-6.4L2.8 9.8l6.4-.9L12 3Z" }]], "mirrorsInRtl": false }, "star-filled": { "nodes": [["path", { "d": "m12 3 2.8 5.9 6.4.9-4.6 4.5 1.1 6.4-5.7-3-5.7 3 1.1-6.4L2.8 9.8l6.4-.9L12 3Z", "fill": "currentColor", "stroke": "none" }]], "mirrorsInRtl": false }, "heart": { "nodes": [["path", { "d": "M12 20.5 3.8 12.6a5.4 5.4 0 0 1 7.6-7.7l.6.6.6-.6a5.4 5.4 0 0 1 7.6 7.7L12 20.5Z" }]], "mirrorsInRtl": false }, "heart-filled": { "nodes": [["path", { "d": "M12 20.5 3.8 12.6a5.4 5.4 0 0 1 7.6-7.7l.6.6.6-.6a5.4 5.4 0 0 1 7.6 7.7L12 20.5Z", "fill": "currentColor", "stroke": "none" }]], "mirrorsInRtl": false }, "user": { "nodes": [["circle", { "cx": 12, "cy": 8, "r": 4 }], ["path", { "d": "M4.5 21a7.5 7.5 0 0 1 15 0" }]], "mirrorsInRtl": false }, "user-circle": { "nodes": [["circle", { "cx": 12, "cy": 12, "r": 9 }], ["circle", { "cx": 12, "cy": 9, "r": 3 }], ["path", { "d": "M6.8 19a5.7 5.7 0 0 1 10.4 0" }]], "mirrorsInRtl": false }, "users": { "nodes": [["circle", { "cx": 9, "cy": 8, "r": 3.5 }], ["path", { "d": "M2.5 20a6.5 6.5 0 0 1 13 0M15 5.5a3.5 3.5 0 0 1 0 6.8M17 15a5 5 0 0 1 4.5 5" }]], "mirrorsInRtl": false }, "user-plus": { "nodes": [["circle", { "cx": 9, "cy": 8, "r": 3.5 }], ["path", { "d": "M2.5 20a6.5 6.5 0 0 1 13 0M18 8v6m-3-3h6" }]], "mirrorsInRtl": false }, "user-minus": { "nodes": [["circle", { "cx": 9, "cy": 8, "r": 3.5 }], ["path", { "d": "M2.5 20a6.5 6.5 0 0 1 13 0M15 11h6" }]], "mirrorsInRtl": false }, "building": { "nodes": [["path", { "d": "M4 21V4h11v17M15 9h5v12M8 8h3m-3 4h3m-3 4h3m10 5H2" }]], "mirrorsInRtl": false }, "briefcase": { "nodes": [["rect", { "x": 3, "y": 7, "width": 18, "height": 13, "rx": 2 }], ["path", { "d": "M8 7V4h8v3M3 12h18M10 12v2h4v-2" }]], "mirrorsInRtl": false }, "id-card": { "nodes": [["rect", { "x": 3, "y": 5, "width": 18, "height": 14, "rx": 2 }], ["circle", { "cx": 8, "cy": 11, "r": 2.2 }], ["path", { "d": "M5 16a3 3 0 0 1 6 0m3-6h4m-4 4h4" }]], "mirrorsInRtl": false }, "file": { "nodes": [["path", { "d": "M6 3h8l4 4v14H6V3Z" }], ["path", { "d": "M14 3v5h4" }]], "mirrorsInRtl": false }, "file-text": { "nodes": [["path", { "d": "M6 3h8l4 4v14H6V3Z" }], ["path", { "d": "M14 3v5h4M9 12h6m-6 4h6" }]], "mirrorsInRtl": false }, "file-plus": { "nodes": [["path", { "d": "M6 3h8l4 4v14H6V3Z" }], ["path", { "d": "M14 3v5h4M12 12v6m-3-3h6" }]], "mirrorsInRtl": false }, "folder": { "nodes": [["path", { "d": "M3 6h7l2 2h9v11H3V6Z" }]], "mirrorsInRtl": false }, "folder-open": { "nodes": [["path", { "d": "M3 18V6h7l2 2h8v3" }], ["path", { "d": "M5 11h17l-3 8H3l2-8Z" }]], "mirrorsInRtl": false }, "image": { "nodes": [["rect", { "x": 3, "y": 4, "width": 18, "height": 16, "rx": 2 }], ["circle", { "cx": 8.5, "cy": 9, "r": 2 }], ["path", { "d": "m4 17 5-5 3.5 3.5L15 13l5 5" }]], "mirrorsInRtl": false }, "paperclip": { "nodes": [["path", { "d": "m8.5 12.5 6.8-6.8a3.5 3.5 0 0 1 5 5l-9.2 9.2A5 5 0 0 1 4 12.8l8.5-8.5" }]], "mirrorsInRtl": false }, "link": { "nodes": [["path", { "d": "M9.5 14.5 14.5 9M7.2 17H6a4 4 0 0 1 0-8h4m6-2h2a4 4 0 0 1 0 8h-4" }]], "mirrorsInRtl": false }, "bookmark": { "nodes": [["path", { "d": "M6 4h12v17l-6-4-6 4V4Z" }]], "mirrorsInRtl": false }, "bookmark-filled": { "nodes": [["path", { "d": "M6 4h12v17l-6-4-6 4V4Z", "fill": "currentColor", "stroke": "none" }]], "mirrorsInRtl": false }, "tag": { "nodes": [["path", { "d": "M3 12V5a2 2 0 0 1 2-2h7l9 9-9 9-9-9Z" }], ["circle", { "cx": 8, "cy": 8, "r": 1 }]], "mirrorsInRtl": false }, "archive": { "nodes": [["path", { "d": "M4 8v12h16V8M3 4h18v4H3V4ZM9 12h6" }]], "mirrorsInRtl": false }, "library": { "nodes": [["rect", { "x": 3, "y": 5, "width": 4, "height": 15, "rx": 0.75 }], ["rect", { "x": 9, "y": 5, "width": 4, "height": 15, "rx": 0.75 }], ["path", { "d": "m15 5 3.5-1L22 19l-3.5 1L15 5Z" }]], "mirrorsInRtl": false }, "clipboard": { "nodes": [["rect", { "x": 5, "y": 5, "width": 14, "height": 16, "rx": 2 }], ["path", { "d": "M9 5V3h6v2M9 10h6m-6 4h6" }]], "mirrorsInRtl": false }, "list": { "nodes": [["path", { "d": "M9 6h11M9 12h11M9 18h11" }], ["circle", { "cx": 4.5, "cy": 6, "r": 0.8, "fill": "currentColor", "stroke": "none" }], ["circle", { "cx": 4.5, "cy": 12, "r": 0.8, "fill": "currentColor", "stroke": "none" }], ["circle", { "cx": 4.5, "cy": 18, "r": 0.8, "fill": "currentColor", "stroke": "none" }]], "mirrorsInRtl": false }, "grid": { "nodes": [["rect", { "x": 3, "y": 3, "width": 7, "height": 7, "rx": 1 }], ["rect", { "x": 14, "y": 3, "width": 7, "height": 7, "rx": 1 }], ["rect", { "x": 3, "y": 14, "width": 7, "height": 7, "rx": 1 }], ["rect", { "x": 14, "y": 14, "width": 7, "height": 7, "rx": 1 }]], "mirrorsInRtl": false }, "inbox": { "nodes": [["path", { "d": "M4 4h16v16H4V4ZM4 14h4l2 3h4l2-3h4" }]], "mirrorsInRtl": false }, "mail": { "nodes": [["rect", { "x": 3, "y": 5, "width": 18, "height": 14, "rx": 2 }], ["path", { "d": "m4 7 8 6 8-6" }]], "mirrorsInRtl": false }, "message": { "nodes": [["path", { "d": "M4 4h16v13H9l-5 4V4Z" }], ["path", { "d": "M8 9h8m-8 4h5" }]], "mirrorsInRtl": false }, "messages": { "nodes": [["path", { "d": "M4 4h13v10H8l-4 3V4Z" }], ["path", { "d": "M10 18h6l4 3V8h-3" }]], "mirrorsInRtl": false }, "send": { "nodes": [["path", { "d": "m3 11 18-8-7 18-3-7-8-3ZM11 14 21 3" }]], "mirrorsInRtl": false }, "phone": { "nodes": [["path", { "d": "M7 3 4 5c0 8 7 15 15 15l2-3-4-3-2 2c-3.5-1.2-5.8-3.5-7-7l2-2-3-4Z" }]], "mirrorsInRtl": false }, "megaphone": { "nodes": [["path", { "d": "M4 10v5h4l9 4V6l-9 4H4ZM8 15l1 5h3l-1.2-3.7M20 9v7" }]], "mirrorsInRtl": false }, "calendar": { "nodes": [["rect", { "x": 3, "y": 5, "width": 18, "height": 16, "rx": 2 }], ["path", { "d": "M7 3v4m10-4v4M3 11h18M7 15h2m4 0h2m-8 3h2" }]], "mirrorsInRtl": false }, "clock": { "nodes": [["circle", { "cx": 12, "cy": 12, "r": 9 }], ["path", { "d": "M12 7v5l3.5 2" }]], "mirrorsInRtl": false }, "database": { "nodes": [["ellipse", { "cx": 12, "cy": 5.5, "rx": 8, "ry": 3 }], ["path", { "d": "M4 5.5v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6M4 11.5v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6" }]], "mirrorsInRtl": false }, "table": { "nodes": [["rect", { "x": 3, "y": 4, "width": 18, "height": 16, "rx": 1 }], ["path", { "d": "M3 10h18M9 4v16m6-10v10" }]], "mirrorsInRtl": false }, "chart-bar": { "nodes": [["path", { "d": "M4 20V4M4 20h17" }], ["rect", { "x": 7, "y": 12, "width": 3, "height": 5 }], ["rect", { "x": 12, "y": 8, "width": 3, "height": 9 }], ["rect", { "x": 17, "y": 5, "width": 3, "height": 12 }]], "mirrorsInRtl": false }, "chart-line": { "nodes": [["path", { "d": "M4 20V4M4 20h17M7 15l4-4 3 2 5-6" }]], "mirrorsInRtl": false }, "chart-pie": { "nodes": [["path", { "d": "M11 3a9 9 0 1 0 10 10H11V3ZM15 3.8V9h5.2A8 8 0 0 0 15 3.8Z" }]], "mirrorsInRtl": false }, "credit-card": { "nodes": [["rect", { "x": 3, "y": 5, "width": 18, "height": 14, "rx": 2 }], ["path", { "d": "M3 10h18M7 15h3" }]], "mirrorsInRtl": false }, "cart": { "nodes": [["path", { "d": "M3 4h2l2 11h10l3-7H6" }], ["circle", { "cx": 9, "cy": 19, "r": 1.5 }], ["circle", { "cx": 17, "cy": 19, "r": 1.5 }]], "mirrorsInRtl": false }, "play": { "nodes": [["path", { "d": "m8 5 11 7-11 7V5Z" }]], "mirrorsInRtl": false }, "pause": { "nodes": [["path", { "d": "M8 5v14M16 5v14" }]], "mirrorsInRtl": false }, "camera": { "nodes": [["path", { "d": "M3 8h4l2-3h6l2 3h4v12H3V8Z" }], ["circle", { "cx": 12, "cy": 14, "r": 4 }]], "mirrorsInRtl": false }, "film": { "nodes": [["rect", { "x": 3, "y": 4, "width": 18, "height": 16, "rx": 1.5 }], ["path", { "d": "M7 4v16M17 4v16M3 9h4m-4 6h4M17 9h4m-4 6h4" }]], "mirrorsInRtl": false }, "clapperboard": { "nodes": [["path", { "d": "M4 9h16v11H4V9Zm0 0L3 4l16-2 1 5L4 9ZM8 3.4l3 4.7m3-5.5 3 4.7" }]], "mirrorsInRtl": false }, "tv": { "nodes": [["rect", { "x": 3, "y": 4, "width": 18, "height": 14, "rx": 2 }], ["path", { "d": "M12 18v3m-4 0h8" }]], "mirrorsInRtl": false }, "series": { "nodes": [["path", { "d": "M6 3h14a2 2 0 0 1 2 2v8" }], ["path", { "d": "M4 7h14a2 2 0 0 1 2 2v8" }], ["rect", { "x": 2, "y": 11, "width": 16, "height": 10, "rx": 2 }], ["path", { "d": "m8 14 4 2-4 2Z" }]], "mirrorsInRtl": false }, "animation": { "nodes": [["rect", { "x": 6, "y": 6, "width": 15, "height": 15, "rx": 2 }], ["path", { "d": "M17 6V3H3v14h3m7.5-8 1.2 3.3 3.3 1.2-3.3 1.2-1.2 3.3-1.2-3.3L9 13.5l3.3-1.2L13.5 9Z" }]], "mirrorsInRtl": false }, "anime": { "nodes": [["path", { "d": "M4 5.5h16c-1 3-3 5.3-5.5 6.7M11.5 9.5c0 5-1.4 8.5-5.5 11" }]], "mirrorsInRtl": false }, "shuffle": { "nodes": [["path", { "d": "M3 6h3l12 12h3m-4-4 4 4-4 4M3 18h3l4-4m4-4 4-4h3m-4-4 4 4-4 4" }]], "mirrorsInRtl": false }, "dice-5": { "nodes": [["rect", { "x": 3, "y": 3, "width": 18, "height": 18, "rx": 3 }], ["circle", { "cx": 7.5, "cy": 7.5, "r": 0.9, "fill": "currentColor", "stroke": "none" }], ["circle", { "cx": 16.5, "cy": 7.5, "r": 0.9, "fill": "currentColor", "stroke": "none" }], ["circle", { "cx": 12, "cy": 12, "r": 0.9, "fill": "currentColor", "stroke": "none" }], ["circle", { "cx": 7.5, "cy": 16.5, "r": 0.9, "fill": "currentColor", "stroke": "none" }], ["circle", { "cx": 16.5, "cy": 16.5, "r": 0.9, "fill": "currentColor", "stroke": "none" }]], "mirrorsInRtl": false }, "sun": { "nodes": [["circle", { "cx": 12, "cy": 12, "r": 4 }], ["path", { "d": "M12 2v3m0 14v3M2 12h3m14 0h3M5 5l2 2m10 10 2 2M19 5l-2 2M7 17l-2 2" }]], "mirrorsInRtl": false }, "moon": { "nodes": [["path", { "d": "M20 15.5A8.5 8.5 0 0 1 8.5 4 8.5 8.5 0 1 0 20 15.5Z" }]], "mirrorsInRtl": false }, "settings": { "nodes": [["path", { "d": "M5 4v16M12 4v16M19 4v16" }], ["path", { "d": "M2.5 8h5M9.5 16h5M16.5 9h5", "strokeWidth": 3.5 }]], "mirrorsInRtl": false }, "code": { "nodes": [["path", { "d": "m9 7-5 5 5 5m6-10 5 5-5 5M13 4l-2 16" }]], "mirrorsInRtl": false }, "terminal": { "nodes": [["rect", { "x": 3, "y": 4, "width": 18, "height": 16, "rx": 2 }], ["path", { "d": "m7 9 3 3-3 3m6 0h4" }]], "mirrorsInRtl": false }, "sparkles": { "nodes": [["path", { "d": "m12 2 1.5 5.5L19 9l-5.5 1.5L12 16l-1.5-5.5L5 9l5.5-1.5L12 2Zm7 13 .7 2.3L22 18l-2.3.7L19 21l-.7-2.3L16 18l2.3-.7L19 15Z" }]], "mirrorsInRtl": false }, "weave": { "nodes": [["path", { "d": "M7 3v7m0 4v7M17 3v7m0 4v7M3 7h7m4 0h7M3 17h7m4 0h7" }], ["path", { "d": "M7 10v4M17 10v4M10 7h4M10 17h4", "strokeWidth": 3 }]], "mirrorsInRtl": false } };
3
+ export const fallbackIcon = [["rect", { "x": 4, "y": 4, "width": 16, "height": 16, "rx": 3 }], ["path", { "d": "m8 16 8-8" }]];
@@ -0,0 +1,64 @@
1
+ export declare const tokens: {
2
+ readonly space: 4;
3
+ readonly controlHeight: 44;
4
+ readonly radius: 10;
5
+ readonly fontSize: 14;
6
+ readonly lineHeight: 1.5;
7
+ readonly breakpoints: {
8
+ readonly sm: 640;
9
+ readonly md: 768;
10
+ readonly lg: 1024;
11
+ readonly xl: 1280;
12
+ readonly "2xl": 1536;
13
+ };
14
+ readonly palettes: {
15
+ readonly light: {
16
+ readonly accent: "#176b52";
17
+ readonly accentHover: "#10543f";
18
+ readonly onAccent: "#ffffff";
19
+ readonly surface: "#ffffff";
20
+ readonly subtle: "#f5f6f3";
21
+ readonly text: "#202922";
22
+ readonly muted: "#616b64";
23
+ readonly border: "#d9dfd9";
24
+ readonly danger: "#b42332";
25
+ readonly successBg: "#e5f3eb";
26
+ readonly successText: "#185d3b";
27
+ readonly warningBg: "#fff2d2";
28
+ readonly warningText: "#765100";
29
+ readonly dangerBg: "#fce9e9";
30
+ readonly neutralSolid: "#46534b";
31
+ readonly onNeutral: "#ffffff";
32
+ readonly successSolid: "#237a4b";
33
+ readonly onSuccess: "#ffffff";
34
+ readonly warningSolid: "#f4c15d";
35
+ readonly onWarning: "#3b2905";
36
+ readonly dangerSolid: "#c63645";
37
+ readonly onDanger: "#ffffff";
38
+ };
39
+ readonly dark: {
40
+ readonly accent: "#98d4b6";
41
+ readonly accentHover: "#b5e2ca";
42
+ readonly onAccent: "#133429";
43
+ readonly surface: "#1d2923";
44
+ readonly subtle: "#26342c";
45
+ readonly text: "#eff5f0";
46
+ readonly muted: "#acbbb0";
47
+ readonly border: "#405247";
48
+ readonly danger: "#ffabb1";
49
+ readonly successBg: "#233f31";
50
+ readonly successText: "#a6e4ba";
51
+ readonly warningBg: "#433921";
52
+ readonly warningText: "#f3d78b";
53
+ readonly dangerBg: "#42282c";
54
+ readonly neutralSolid: "#b5c4b9";
55
+ readonly onNeutral: "#16251c";
56
+ readonly successSolid: "#68bc87";
57
+ readonly onSuccess: "#102c1a";
58
+ readonly warningSolid: "#e9b64f";
59
+ readonly onWarning: "#352503";
60
+ readonly dangerSolid: "#ed8290";
61
+ readonly onDanger: "#3b111a";
62
+ };
63
+ };
64
+ };
@@ -0,0 +1,65 @@
1
+ // Generated from Trama's web design tokens.
2
+ export const tokens = {
3
+ "space": 4,
4
+ "controlHeight": 44,
5
+ "radius": 10,
6
+ "fontSize": 14,
7
+ "lineHeight": 1.5,
8
+ "breakpoints": {
9
+ "sm": 640,
10
+ "md": 768,
11
+ "lg": 1024,
12
+ "xl": 1280,
13
+ "2xl": 1536
14
+ },
15
+ "palettes": {
16
+ "light": {
17
+ "accent": "#176b52",
18
+ "accentHover": "#10543f",
19
+ "onAccent": "#ffffff",
20
+ "surface": "#ffffff",
21
+ "subtle": "#f5f6f3",
22
+ "text": "#202922",
23
+ "muted": "#616b64",
24
+ "border": "#d9dfd9",
25
+ "danger": "#b42332",
26
+ "successBg": "#e5f3eb",
27
+ "successText": "#185d3b",
28
+ "warningBg": "#fff2d2",
29
+ "warningText": "#765100",
30
+ "dangerBg": "#fce9e9",
31
+ "neutralSolid": "#46534b",
32
+ "onNeutral": "#ffffff",
33
+ "successSolid": "#237a4b",
34
+ "onSuccess": "#ffffff",
35
+ "warningSolid": "#f4c15d",
36
+ "onWarning": "#3b2905",
37
+ "dangerSolid": "#c63645",
38
+ "onDanger": "#ffffff"
39
+ },
40
+ "dark": {
41
+ "accent": "#98d4b6",
42
+ "accentHover": "#b5e2ca",
43
+ "onAccent": "#133429",
44
+ "surface": "#1d2923",
45
+ "subtle": "#26342c",
46
+ "text": "#eff5f0",
47
+ "muted": "#acbbb0",
48
+ "border": "#405247",
49
+ "danger": "#ffabb1",
50
+ "successBg": "#233f31",
51
+ "successText": "#a6e4ba",
52
+ "warningBg": "#433921",
53
+ "warningText": "#f3d78b",
54
+ "dangerBg": "#42282c",
55
+ "neutralSolid": "#b5c4b9",
56
+ "onNeutral": "#16251c",
57
+ "successSolid": "#68bc87",
58
+ "onSuccess": "#102c1a",
59
+ "warningSolid": "#e9b64f",
60
+ "onWarning": "#352503",
61
+ "dangerSolid": "#ed8290",
62
+ "onDanger": "#3b111a"
63
+ }
64
+ }
65
+ };
package/dist/icon.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type ViewProps } from 'react-native';
3
+ import { icons } from './generated/icons.js';
4
+ import type { TramaResponsive } from './responsive.js';
5
+ export type TramaIconName = keyof typeof icons;
6
+ export type IconSize = keyof typeof iconSizes | number;
7
+ export type IconWeight = keyof typeof weights;
8
+ export declare const tramaIconNames: readonly ("search" | "link" | "filter" | "code" | "menu" | "table" | "image" | "message" | "list" | "grid" | "messages" | "info" | "warning" | "error" | "send" | "close" | "calendar" | "plus" | "more" | "file" | "copy" | "animation" | "minus" | "check" | "edit" | "trash" | "download" | "upload" | "refresh" | "undo" | "redo" | "save" | "share" | "external-link" | "arrow-left" | "arrow-right" | "arrow-up" | "arrow-down" | "arrow-start" | "arrow-end" | "chevron-left" | "chevron-right" | "chevron-up" | "chevron-down" | "chevron-start" | "chevron-end" | "home" | "compass" | "map-pin" | "check-circle" | "help" | "bell" | "bell-off" | "eye" | "eye-off" | "lock" | "unlock" | "shield" | "shield-check" | "star" | "star-filled" | "heart" | "heart-filled" | "user" | "user-circle" | "users" | "user-plus" | "user-minus" | "building" | "briefcase" | "id-card" | "file-text" | "file-plus" | "folder" | "folder-open" | "paperclip" | "bookmark" | "bookmark-filled" | "tag" | "archive" | "library" | "clipboard" | "inbox" | "mail" | "phone" | "megaphone" | "clock" | "database" | "chart-bar" | "chart-line" | "chart-pie" | "credit-card" | "cart" | "play" | "pause" | "camera" | "film" | "clapperboard" | "tv" | "series" | "anime" | "shuffle" | "dice-5" | "sun" | "moon" | "settings" | "terminal" | "sparkles" | "weave")[];
9
+ declare const weights: {
10
+ light: number;
11
+ regular: number;
12
+ bold: number;
13
+ };
14
+ declare const iconSizes: {
15
+ xs: number;
16
+ sm: number;
17
+ md: number;
18
+ lg: number;
19
+ xl: number;
20
+ };
21
+ export interface IconProps extends Omit<ViewProps, 'children'> {
22
+ name?: TramaResponsive<TramaIconName>;
23
+ label?: string;
24
+ size?: TramaResponsive<IconSize>;
25
+ weight?: TramaResponsive<IconWeight>;
26
+ color?: string;
27
+ mirrored?: TramaResponsive<boolean>;
28
+ children?: ReactNode;
29
+ }
30
+ export declare function Icon({ name, label, size, weight, color, mirrored, children, accessibilityLabel, style, ...props }: IconProps): import("react").JSX.Element;
31
+ export {};
package/dist/icon.js ADDED
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ import Svg, { Circle, Ellipse, Path, Rect } from 'react-native-svg';
4
+ import { fallbackIcon, icons } from './generated/icons.js';
5
+ import { useTramaAppearance } from './theme.js';
6
+ export const tramaIconNames = Object.freeze(Object.keys(icons));
7
+ const weights = { light: 1.25, regular: 1.75, bold: 2.25 };
8
+ const iconSizes = { xs: 12, sm: 16, md: 20, lg: 24, xl: 32 };
9
+ const elements = { path: Path, rect: Rect, circle: Circle, ellipse: Ellipse };
10
+ export function Icon({ name, label, size, weight, color, mirrored, children, accessibilityLabel, style, ...props }) {
11
+ const { theme, direction, resolve } = useTramaAppearance();
12
+ const nameValue = resolve(name, 'weave');
13
+ const glyph = Object.hasOwn(icons, nameValue) ? icons[nameValue] : undefined;
14
+ const ink = color ?? theme.colors.text;
15
+ const resolvedSize = resolve(size, 'md');
16
+ const extent = typeof resolvedSize === 'number'
17
+ ? Number.isFinite(resolvedSize) && resolvedSize >= 8 && resolvedSize <= 256
18
+ ? resolvedSize
19
+ : iconSizes.md
20
+ : iconSizes[resolvedSize];
21
+ const rtl = !children && direction === 'rtl' && Boolean(glyph?.mirrorsInRtl);
22
+ const flip = rtl !== resolve(mirrored, false);
23
+ const nameForAccessibility = accessibilityLabel ?? label;
24
+ return (_jsx(View, { ...props, accessible: Boolean(nameForAccessibility), importantForAccessibility: nameForAccessibility ? 'yes' : 'no-hide-descendants', accessibilityElementsHidden: !nameForAccessibility, accessibilityRole: nameForAccessibility ? 'image' : undefined, accessibilityLabel: nameForAccessibility, style: [{ width: extent, height: extent, transform: [{ scaleX: flip ? -1 : 1 }] }, style], children: children ?? (_jsx(Svg, { width: extent, height: extent, viewBox: "0 0 24 24", fill: "none", color: ink, stroke: ink, strokeWidth: weights[resolve(weight, 'regular')], strokeLinecap: "round", strokeLinejoin: "round", children: (glyph?.nodes ?? fallbackIcon).map(([element, attributes], index) => {
25
+ const Shape = elements[element];
26
+ return _jsx(Shape, { ...attributes }, index);
27
+ }) })) }));
28
+ }
@@ -0,0 +1,43 @@
1
+ export { Stack, Cluster, Grid, Container, type StackProps, type ClusterProps, type GridProps, type ContainerProps, } from './layout.js';
2
+ export { Toolbar, ToolbarGroup, ToolbarSeparator, ActionBar, ActionBarContent, ActionBarActions, EmptyState, type ToolbarProps, type ActionBarProps, type EmptyStateProps, } from './bars.js';
3
+ export { Image, ImageCaption, Badge, BadgeContent, type ImageProps, type BadgeProps } from './media.js';
4
+ export { Skeleton, Meter, type SkeletonProps, type MeterProps } from './feedback.js';
5
+ export { Checkbox, CheckboxIcon, CheckboxGroup, RadioGroup, RadioGroupItem, RadioGroupItemAddon, RadioGroupItemMedia, Toggle, ToggleGroup, type CheckboxProps, type CheckboxGroupProps, type RadioGroupProps, type RadioGroupItemProps, type ToggleProps, type ToggleGroupProps, } from './choices.js';
6
+ export { Dialog, DialogTrigger, DialogClose, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, Drawer, DrawerTrigger, DrawerClose, DrawerHeader, DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter, DrawerHandle, Popover, PopoverTrigger, PopoverClose, PopoverHeader, PopoverTitle, PopoverDescription, PopoverBody, PopoverFooter, PopoverArrow, FloatingPanel, FloatingPanelHeader, FloatingPanelBody, FloatingPanelFooter, FloatingPanelClose, type DialogProps, type DrawerProps, type PopoverProps, type FloatingPanelProps, type OverlayHandle, type OverlayReason, type OverlayStateProps, } from './overlays.js';
7
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuItem, DropdownMenuGroup, DropdownMenuSubmenu, DropdownMenuSeparator, DropdownMenuItemMedia, DropdownMenuArrow, ContextMenu, ContextMenuTarget, ContextMenuItem, ContextMenuGroup, ContextMenuSubmenu, ContextMenuSeparator, ContextMenuItemMedia, ContextMenuArrow, Menubar, MenubarMenu, MenubarItem, MenubarGroup, MenubarSubmenu, MenubarSeparator, MenubarItemMedia, CommandMenu, CommandItem, CommandPage, CommandGroup, CommandSeparator, type MenuItemProps, type MenuGroupProps, type MenuSubmenuProps, type DropdownMenuProps, type ContextMenuProps, type MenubarProps, type MenubarMenuProps, type CommandMenuProps, type CommandMenuHandle, type CommandItemProps, type CommandPageProps, } from './menus.js';
8
+ export { InputActions, InputDescription, InputEnd, InputHint, InputLabel, InputStart } from './input.js';
9
+ export { Textarea, TextareaDescription, TextareaHint, TextareaLabel, NumberField, NumberFieldDescription, NumberFieldEnd, NumberFieldHint, NumberFieldLabel, NumberFieldStart, PinInput, TimeField, type TextareaProps, type NumberFieldProps, type PinInputProps, type TimeFieldProps, } from './text-fields.js';
10
+ export { Link, LinkStart, LinkEnd, LinkIndicator, Kbd, KbdGroup, IconButton, Breadcrumbs, Pagination, Tabs, TabPanel, Stepper, StepperItem, StepperPanel, type LinkProps, type KbdProps, type IconButtonProps, type BreadcrumbsProps, type BreadcrumbItem, type PaginationProps, type TabsProps, type TabPanelProps, type StepperProps, type StepperItemProps, type StepperPanelProps, } from './navigation.js';
11
+ export { List, ListItem, ListItemMedia, ListItemActions, DescriptionList, DescriptionListItem, DescriptionListActions, Timeline, TimelineItem, TimelineItemMedia, TimelineItemActions, ActivityFeed, TransferList, TransferItem, TransferItemMedia, TreeView, TreeItem, TreeItemMedia, TreeItemBadge, TreeItemLabel, TreeItemDescription, ErrorSummary, ErrorSummaryItem, type ListProps, type ListItemProps, type ListItemData, type DescriptionListProps, type DescriptionListItemProps, type TimelineProps, type TimelineItemProps, type ActivityFeedProps, type ActivityEntry, type TransferListProps, type TransferItemProps, type TransferItemData, type TreeViewProps, type TreeItemProps, type TreeNode, type ErrorSummaryProps, type ErrorSummaryItemProps, } from './collections.js';
12
+ export { Select, SelectOption, SelectGroup, SelectValue, SelectStart, Combobox, MultiSelect, MentionField, MentionOption, type SelectProps, type SelectSelection, type SelectOptionData, type SelectOptionProps, type SelectGroupProps, type SelectValueProps, type MentionFieldProps, type MentionOptionProps, } from './select.js';
13
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent, CollapsibleIndicator, InlineEdit, InlineEditActions, FilterBar, Rating, Slider, type CollapsibleProps, type CollapsibleTriggerProps, type InlineEditProps, type FilterBarProps, type RatingProps, type SliderProps, type SliderValue, } from './controls.js';
14
+ export { PageHeader, PageHeaderActions, PageHeaderBreadcrumbs, PageHeaderMeta, PageHeaderNavigation, AppShell, DashboardSections, MetricsCard, ProfileHeader, SettingsLayout, SignInForm, NavigationMenu, NavigationMenuContent, NavigationMenuSubmenu, NavigationMenuGroup, NavigationMenuItem, NavigationMenuItemMedia, NavigationMenuIndicator, Sidebar, HeaderNavigation, AnchorNavigation, AnchorItem, } from './compositions.js';
15
+ export { AvatarGroup, AvatarGroupOverflow, type AvatarGroupProps, type AvatarGroupOverflowProps } from './avatar.js';
16
+ export { ButtonLoading } from './button.js';
17
+ export { PillStart, PillEnd, PillActions, PillCloseIcon } from './pill.js';
18
+ export { SwitchIndicator } from './switch.js';
19
+ export { Loader as Spinner } from './loader.js';
20
+ export { ToastProvider, useToast } from './transient.js';
21
+ export { DragDropProvider, DragScrollArea, type DragScrollAreaProps } from './drag-drop.js';
22
+ export { Calendar, CalendarDay, CalendarDayDetail, DatePicker, DatePickerActions, DatePickerCancel, DatePickerConfirm, DatePreset, type CalendarProps, type CalendarValue, type DateRange, type DatePickerProps, type DatePresetProps, } from './calendar.js';
23
+ export { Table, TableCell, TableColumn, TableHeader, TableRowActions, TableRowDetail, TableSelectionActions, TableSummary, TableToolbar, DataGrid, type TableProps, type TableColumnProps, type TableColumnDefinition, type TableSort, type TableRowId, type TableValue, type TableCellAddress, type TableCellRange, type TableCellChange, type TableCellEditor, type TableRowsChange, type TableClipboard, type TableExportOptions, type TableDataSource, type TableQuery, type TableHandle, type TableKeyboardCellProps, type TableKeyboardEvent, } from './table.js';
24
+ export { createTableKeyboardCell, nativeKeyboardEvent, type KeyboardCommandEvent, type NativeKeyboardPayload, } from './keyboard.js';
25
+ export { DragHandle, DragPreview, DropIndicator, DropZone, MoveMenu, MoveOption, type DragHandleProps, type DragPreviewProps, type DropIndicatorProps, type DropZoneProps, type MoveMenuProps, type MoveOptionProps, type DragDropProviderProps, type DragItem, type DropDetail, type SystemDragContent, type SystemDragFile, type SystemDragSurfaceProps, type SystemDropDetail, type SystemDropError, type SystemDropItem, type SystemDropKind, } from './drag-drop.js';
26
+ export { FileUpload, FileUploadActions, FileUploadDropzone, FileUploadItemMedia, FileUploadTrigger, type FileUploadProps, type FileUploadHandle, type FilePickerOptions, type UploadFile, type FileRejection, type FileUploadDropzoneProps, } from './file-upload.js';
27
+ export { Carousel, CarouselItem, Splitter, SplitterPane, type CarouselProps, type SplitterProps, } from './interactive-layout.js';
28
+ export { ColorPicker, ColorPickerSwatch, CodeBlock, type ColorPickerProps, type ColorPickerSwatchProps, type CodeBlockProps, } from './color-code.js';
29
+ export { HoverCard, HoverCardArrow, HoverCardContent, HoverCardTrigger, Tooltip, Toast, ToastAction, ToastIcon, Tour, TourStep, type HoverCardProps, type TooltipProps, type ToastProps, type ToastActionProps, type ToastDismissReason, type ToastProviderProps, type ToastOptions, type TourProps, type TourStepProps, type TourTarget, type TourPlacement, type TourBackdrop, } from './transient.js';
30
+ export { Accordion, AccordionActions, AccordionIcon, AccordionItem, AccordionPanel, AccordionSummary, type AccordionChangeDetail, type AccordionItemProps, type AccordionPanelPersistence, type AccordionProps, type AccordionVariant, } from './accordion.js';
31
+ export { Alert, AlertActions, type AlertAnnouncement, type AlertAppearance, type AlertDismissDetail, type AlertProps, type AlertSeverity, type AlertVariant, } from './alert.js';
32
+ export { Avatar, type AvatarProps, type AvatarShape, type AvatarSize } from './avatar.js';
33
+ export { Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonVariant } from './button.js';
34
+ export { Card, CardActions, CardFooter, CardHeader, CardHeaderActions, CardMedia, type CardOrientation, type CardProps, type CardSize, type CardSpacing, type CardVariant, } from './card.js';
35
+ export { Input, type FieldHandle, type InputHandle, type InputProps, type InputVariant } from './input.js';
36
+ export { Loader, type LoaderProps, type LoaderVariant } from './loader.js';
37
+ export { Pill, PillAction, type PillActionProps, type PillProps, type PillVariant } from './pill.js';
38
+ export { Progress, type ProgressFormat, type ProgressGeometry, type ProgressProps, type ProgressVariant, } from './progress.js';
39
+ export { Separator, type SeparatorProps } from './separator.js';
40
+ export { Switch, type SwitchProps, type SwitchVariant } from './switch.js';
41
+ export { LocalizationProvider, tramaNativeLocales, useTramaLocale, useTramaMessages, type LocalizationProviderProps, type TramaNativeMessages, } from './localization.js';
42
+ export { defaultTramaBreakpoints, type TramaBreakpoint, type TramaBreakpoints, type TramaResponsive, type TramaResponsiveMap, } from './responsive.js';
43
+ export { ThemeProvider, tramaNativeThemes, useTramaTheme, type ThemeProviderProps, type TramaColor, type TramaDirection, type TramaShape, type TramaSize, type TramaTheme, type TramaThemeOverrides, type TramaThemeMode, } from './theme.js';
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ export { Stack, Cluster, Grid, Container, } from './layout.js';
2
+ export { Toolbar, ToolbarGroup, ToolbarSeparator, ActionBar, ActionBarContent, ActionBarActions, EmptyState, } from './bars.js';
3
+ export { Image, ImageCaption, Badge, BadgeContent } from './media.js';
4
+ export { Skeleton, Meter } from './feedback.js';
5
+ export { Checkbox, CheckboxIcon, CheckboxGroup, RadioGroup, RadioGroupItem, RadioGroupItemAddon, RadioGroupItemMedia, Toggle, ToggleGroup, } from './choices.js';
6
+ export { Dialog, DialogTrigger, DialogClose, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, Drawer, DrawerTrigger, DrawerClose, DrawerHeader, DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter, DrawerHandle, Popover, PopoverTrigger, PopoverClose, PopoverHeader, PopoverTitle, PopoverDescription, PopoverBody, PopoverFooter, PopoverArrow, FloatingPanel, FloatingPanelHeader, FloatingPanelBody, FloatingPanelFooter, FloatingPanelClose, } from './overlays.js';
7
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuItem, DropdownMenuGroup, DropdownMenuSubmenu, DropdownMenuSeparator, DropdownMenuItemMedia, DropdownMenuArrow, ContextMenu, ContextMenuTarget, ContextMenuItem, ContextMenuGroup, ContextMenuSubmenu, ContextMenuSeparator, ContextMenuItemMedia, ContextMenuArrow, Menubar, MenubarMenu, MenubarItem, MenubarGroup, MenubarSubmenu, MenubarSeparator, MenubarItemMedia, CommandMenu, CommandItem, CommandPage, CommandGroup, CommandSeparator, } from './menus.js';
8
+ export { InputActions, InputDescription, InputEnd, InputHint, InputLabel, InputStart } from './input.js';
9
+ export { Textarea, TextareaDescription, TextareaHint, TextareaLabel, NumberField, NumberFieldDescription, NumberFieldEnd, NumberFieldHint, NumberFieldLabel, NumberFieldStart, PinInput, TimeField, } from './text-fields.js';
10
+ export { Link, LinkStart, LinkEnd, LinkIndicator, Kbd, KbdGroup, IconButton, Breadcrumbs, Pagination, Tabs, TabPanel, Stepper, StepperItem, StepperPanel, } from './navigation.js';
11
+ export { List, ListItem, ListItemMedia, ListItemActions, DescriptionList, DescriptionListItem, DescriptionListActions, Timeline, TimelineItem, TimelineItemMedia, TimelineItemActions, ActivityFeed, TransferList, TransferItem, TransferItemMedia, TreeView, TreeItem, TreeItemMedia, TreeItemBadge, TreeItemLabel, TreeItemDescription, ErrorSummary, ErrorSummaryItem, } from './collections.js';
12
+ export { Select, SelectOption, SelectGroup, SelectValue, SelectStart, Combobox, MultiSelect, MentionField, MentionOption, } from './select.js';
13
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent, CollapsibleIndicator, InlineEdit, InlineEditActions, FilterBar, Rating, Slider, } from './controls.js';
14
+ export { PageHeader, PageHeaderActions, PageHeaderBreadcrumbs, PageHeaderMeta, PageHeaderNavigation, AppShell, DashboardSections, MetricsCard, ProfileHeader, SettingsLayout, SignInForm, NavigationMenu, NavigationMenuContent, NavigationMenuSubmenu, NavigationMenuGroup, NavigationMenuItem, NavigationMenuItemMedia, NavigationMenuIndicator, Sidebar, HeaderNavigation, AnchorNavigation, AnchorItem, } from './compositions.js';
15
+ export { AvatarGroup, AvatarGroupOverflow } from './avatar.js';
16
+ export { ButtonLoading } from './button.js';
17
+ export { PillStart, PillEnd, PillActions, PillCloseIcon } from './pill.js';
18
+ export { SwitchIndicator } from './switch.js';
19
+ export { Loader as Spinner } from './loader.js';
20
+ export { ToastProvider, useToast } from './transient.js';
21
+ export { DragDropProvider, DragScrollArea } from './drag-drop.js';
22
+ export { Calendar, CalendarDay, CalendarDayDetail, DatePicker, DatePickerActions, DatePickerCancel, DatePickerConfirm, DatePreset, } from './calendar.js';
23
+ export { Table, TableCell, TableColumn, TableHeader, TableRowActions, TableRowDetail, TableSelectionActions, TableSummary, TableToolbar, DataGrid, } from './table.js';
24
+ export { createTableKeyboardCell, nativeKeyboardEvent, } from './keyboard.js';
25
+ export { DragHandle, DragPreview, DropIndicator, DropZone, MoveMenu, MoveOption, } from './drag-drop.js';
26
+ export { FileUpload, FileUploadActions, FileUploadDropzone, FileUploadItemMedia, FileUploadTrigger, } from './file-upload.js';
27
+ export { Carousel, CarouselItem, Splitter, SplitterPane, } from './interactive-layout.js';
28
+ export { ColorPicker, ColorPickerSwatch, CodeBlock, } from './color-code.js';
29
+ export { HoverCard, HoverCardArrow, HoverCardContent, HoverCardTrigger, Tooltip, Toast, ToastAction, ToastIcon, Tour, TourStep, } from './transient.js';
30
+ export { Accordion, AccordionActions, AccordionIcon, AccordionItem, AccordionPanel, AccordionSummary, } from './accordion.js';
31
+ export { Alert, AlertActions, } from './alert.js';
32
+ export { Avatar } from './avatar.js';
33
+ export { Button, ButtonGroup } from './button.js';
34
+ export { Card, CardActions, CardFooter, CardHeader, CardHeaderActions, CardMedia, } from './card.js';
35
+ export { Input } from './input.js';
36
+ export { Loader } from './loader.js';
37
+ export { Pill, PillAction } from './pill.js';
38
+ export { Progress, } from './progress.js';
39
+ export { Separator } from './separator.js';
40
+ export { Switch } from './switch.js';
41
+ export { LocalizationProvider, tramaNativeLocales, useTramaLocale, useTramaMessages, } from './localization.js';
42
+ export { defaultTramaBreakpoints, } from './responsive.js';
43
+ export { ThemeProvider, tramaNativeThemes, useTramaTheme, } from './theme.js';
@@ -0,0 +1,43 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type TextInputProps, type ViewProps } from 'react-native';
3
+ import type { TramaResponsive } from './responsive.js';
4
+ import { type TramaShape, type TramaSize } from './theme.js';
5
+ export interface FieldHandle {
6
+ checkValidity(): boolean;
7
+ reportValidity(): boolean;
8
+ }
9
+ export interface InputHandle extends FieldHandle {
10
+ focus(): void;
11
+ blur(): void;
12
+ isFocused(): boolean;
13
+ }
14
+ export type InputVariant = 'outlined' | 'filled' | 'flushed';
15
+ export interface InputProps extends Omit<TextInputProps, 'editable' | 'readOnly' | 'multiline'> {
16
+ children?: ReactNode;
17
+ label?: string;
18
+ description?: string;
19
+ hint?: string;
20
+ error?: string;
21
+ invalid?: boolean;
22
+ required?: boolean;
23
+ disabled?: boolean;
24
+ readOnly?: boolean;
25
+ minLength?: number;
26
+ size?: TramaResponsive<TramaSize>;
27
+ shape?: TramaResponsive<TramaShape>;
28
+ variant?: TramaResponsive<InputVariant>;
29
+ containerStyle?: ViewProps['style'];
30
+ }
31
+ interface TextEntryProps extends InputProps {
32
+ multiline?: boolean;
33
+ validateValue?: (value: string) => string;
34
+ }
35
+ export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<InputHandle>>;
36
+ export declare const TextEntry: import("react").ForwardRefExoticComponent<TextEntryProps & import("react").RefAttributes<InputHandle>>;
37
+ export declare function InputLabel({ children, ...props }: ViewProps): import("react").JSX.Element;
38
+ export declare function InputDescription({ children, ...props }: ViewProps): import("react").JSX.Element;
39
+ export declare function InputHint(props: ViewProps): import("react").JSX.Element;
40
+ export declare function InputStart(props: ViewProps): import("react").JSX.Element;
41
+ export declare function InputEnd(props: ViewProps): import("react").JSX.Element;
42
+ export declare function InputActions({ style, ...props }: ViewProps): import("react").JSX.Element;
43
+ export {};
package/dist/input.js ADDED
@@ -0,0 +1,115 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useId, useImperativeHandle, useRef, useState } from 'react';
3
+ import { Platform, Text, TextInput, View } from 'react-native';
4
+ import { FieldMessage, splitContent, TextContent } from './internal/content.js';
5
+ import { useControllableValue, useFieldValidation } from './internal/state.js';
6
+ import { useTramaMessages } from './localization.js';
7
+ import { shapeRadius, sizeStep, useTramaAppearance, useTramaTheme } from './theme.js';
8
+ export const Input = forwardRef(function Input(props, ref) {
9
+ return _jsx(TextEntry, { ...props, ref: ref });
10
+ });
11
+ export const TextEntry = forwardRef(function TextEntry({ label, description, hint, error, invalid, required, disabled, readOnly, minLength, maxLength, value, defaultValue, size, shape, variant, containerStyle, style, accessibilityLabel, accessibilityHint, accessibilityState, onChangeText, onFocus, onBlur, children, multiline, validateValue, ...props }, ref) {
12
+ const { theme, direction, resolve } = useTramaAppearance();
13
+ const messages = useTramaMessages();
14
+ const { named } = splitContent(children, {
15
+ label: InputLabel,
16
+ description: InputDescription,
17
+ hint: InputHint,
18
+ start: InputStart,
19
+ end: InputEnd,
20
+ actions: InputActions,
21
+ });
22
+ const [current, request] = useControllableValue(value, defaultValue ?? '', onChangeText);
23
+ const [focused, setFocused] = useState(false);
24
+ const control = useRef(null);
25
+ let constraint = '';
26
+ if (!current && required)
27
+ constraint = messages.enterValue;
28
+ else if (current && minLength !== undefined && current.length < minLength)
29
+ constraint = messages.minLength(minLength);
30
+ else if (maxLength !== undefined && current.length > maxLength)
31
+ constraint = messages.maxLength(maxLength);
32
+ else
33
+ constraint = validateValue?.(current) ?? '';
34
+ const explicit = error?.trim() || (invalid ? messages.reviewField : '');
35
+ const validation = useFieldValidation(explicit, constraint, Boolean(disabled || readOnly));
36
+ const shownMessage = validation.message || hint;
37
+ const messageID = useId();
38
+ const nativeDescription = 'aria-describedby' in props && typeof props['aria-describedby'] === 'string' ? props['aria-describedby'] : '';
39
+ const messageProps = Platform.OS === 'web'
40
+ ? {
41
+ ...(validation.message ? { 'aria-invalid': true } : {}),
42
+ ...(shownMessage && (validation.message || !named.hint)
43
+ ? { 'aria-describedby': [nativeDescription, messageID].filter(Boolean).join(' ') }
44
+ : {}),
45
+ }
46
+ : {};
47
+ const appearance = resolve(variant, 'outlined');
48
+ const step = sizeStep[resolve(size, 'md')];
49
+ const font = { fontFamily: theme.fontFamily, fontSize: theme.fontSize + step };
50
+ const outline = validation.message ? theme.colors.danger : focused ? theme.colors.accent : theme.colors.border;
51
+ useImperativeHandle(ref, () => ({
52
+ focus: () => control.current?.focus(),
53
+ blur: () => control.current?.blur(),
54
+ isFocused: () => control.current?.isFocused() ?? false,
55
+ checkValidity: validation.checkValidity,
56
+ reportValidity: validation.reportValidity,
57
+ }));
58
+ return (_jsxs(View, { style: [{ direction, gap: theme.space }, containerStyle], children: [named.label ??
59
+ (label && (_jsxs(Text, { accessible: false, style: { ...font, color: theme.colors.text, fontWeight: '600' }, children: [label, required && _jsx(Text, { style: { color: theme.colors.danger }, children: " *" })] }))), named.description ??
60
+ (description && (_jsx(Text, { accessible: false, style: { ...font, color: theme.colors.muted }, children: description }))), _jsxs(View, { style: {
61
+ flexDirection: 'row',
62
+ alignItems: multiline ? 'flex-start' : 'center',
63
+ gap: named.start || named.end || named.actions ? theme.space * 2 : 0,
64
+ }, children: [named.start, _jsx(TextInput, { ...props, ...messageProps, ref: control, value: current, editable: !disabled && !readOnly, maxLength: maxLength, multiline: multiline, onChangeText: (text) => {
65
+ if (!disabled && !readOnly)
66
+ request(text);
67
+ }, onFocus: (event) => {
68
+ setFocused(true);
69
+ onFocus?.(event);
70
+ }, onBlur: (event) => {
71
+ setFocused(false);
72
+ onBlur?.(event);
73
+ }, accessibilityLabel: accessibilityLabel ?? label, "aria-disabled": Boolean(disabled), accessibilityHint: [required && messages.requiredLabel, description, shownMessage, accessibilityHint]
74
+ .filter(Boolean)
75
+ .join('. ') || undefined, accessibilityState: { ...accessibilityState, disabled: Boolean(disabled) }, placeholderTextColor: props.placeholderTextColor ?? theme.colors.muted, style: [
76
+ {
77
+ ...font,
78
+ flex: 1,
79
+ minHeight: Math.max(44, theme.controlHeight + Math.max(0, step) * theme.space * 2),
80
+ color: theme.colors.text,
81
+ textAlign: direction === 'rtl' ? 'right' : 'left',
82
+ borderColor: outline,
83
+ borderWidth: appearance === 'flushed' ? 0 : 1,
84
+ borderBottomWidth: focused || validation.message ? 2 : 1,
85
+ borderRadius: appearance === 'flushed' ? 0 : shapeRadius(theme, resolve(shape, 'rounded')),
86
+ backgroundColor: appearance === 'filled' ? theme.colors.subtle : theme.colors.surface,
87
+ paddingHorizontal: appearance === 'flushed' ? 0 : theme.space * (3 + step),
88
+ paddingVertical: theme.space * 2,
89
+ textAlignVertical: multiline ? 'top' : 'center',
90
+ opacity: disabled ? 0.55 : 1,
91
+ },
92
+ style,
93
+ ] }), named.end, named.actions] }), validation.message || !named.hint ? (_jsx(FieldMessage, { message: shownMessage ?? '', invalid: Boolean(validation.message), theme: theme, nativeID: messageID })) : (named.hint)] }));
94
+ });
95
+ export function InputLabel({ children, ...props }) {
96
+ const theme = useTramaTheme();
97
+ return (_jsx(View, { ...props, children: _jsx(TextContent, { style: { fontFamily: theme.fontFamily, fontSize: theme.fontSize, fontWeight: '600', color: theme.colors.text }, children: children }) }));
98
+ }
99
+ export function InputDescription({ children, ...props }) {
100
+ const theme = useTramaTheme();
101
+ return (_jsx(View, { ...props, children: _jsx(TextContent, { style: { fontFamily: theme.fontFamily, fontSize: theme.fontSize, color: theme.colors.muted }, children: children }) }));
102
+ }
103
+ export function InputHint(props) {
104
+ return _jsx(InputDescription, { ...props });
105
+ }
106
+ export function InputStart(props) {
107
+ return _jsx(View, { ...props });
108
+ }
109
+ export function InputEnd(props) {
110
+ return _jsx(View, { ...props });
111
+ }
112
+ export function InputActions({ style, ...props }) {
113
+ const theme = useTramaTheme();
114
+ return _jsx(View, { ...props, style: [{ gap: theme.space, flexDirection: 'row', alignItems: 'center' }, style] });
115
+ }
@@ -0,0 +1,26 @@
1
+ import { type ViewProps } from 'react-native';
2
+ import type { TramaResponsive } from './responsive.js';
3
+ export interface CarouselProps extends ViewProps {
4
+ index?: number;
5
+ defaultIndex?: number;
6
+ onIndexChange?: (index: number) => void | false;
7
+ loop?: boolean;
8
+ navigation?: TramaResponsive<'buttons' | 'dots' | 'both' | 'none'>;
9
+ disabled?: boolean;
10
+ }
11
+ export declare function Carousel({ index, defaultIndex, onIndexChange, loop, navigation, disabled, children, style, onLayout, ...props }: CarouselProps): import("react").JSX.Element;
12
+ export declare function CarouselItem(props: ViewProps): import("react").JSX.Element;
13
+ export interface SplitterProps extends ViewProps {
14
+ orientation?: TramaResponsive<'horizontal' | 'vertical'>;
15
+ value?: number;
16
+ defaultValue?: number;
17
+ min?: number;
18
+ max?: number;
19
+ step?: number;
20
+ onValueChange?: (value: number) => void | false;
21
+ onValueCommit?: (value: number) => void;
22
+ disabled?: boolean;
23
+ handleLabel?: string;
24
+ }
25
+ export declare function Splitter({ orientation, value, defaultValue, min, max, step, onValueChange, onValueCommit, disabled, handleLabel, children, style, onLayout, ...props }: SplitterProps): import("react").JSX.Element;
26
+ export declare function SplitterPane({ style, ...props }: ViewProps): import("react").JSX.Element;