@ratio-ui/core 0.1.0 → 0.2.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 (141) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -1
  3. package/dist/catalogue.json +1719 -43
  4. package/dist/components/app-shell/AppShell.d.ts +22 -0
  5. package/dist/components/app-shell/AppShell.js +39 -0
  6. package/dist/components/app-shell/context.js +5 -0
  7. package/dist/components/app-shell/index.d.ts +2 -0
  8. package/dist/components/app-shell/index.js +1 -0
  9. package/dist/components/avatar/Avatar.d.ts +22 -0
  10. package/dist/components/avatar/Avatar.js +38 -0
  11. package/dist/components/avatar/index.d.ts +2 -0
  12. package/dist/components/avatar/index.js +1 -0
  13. package/dist/components/button/Button.d.ts +37 -0
  14. package/dist/components/button/Button.js +41 -0
  15. package/dist/components/button/index.d.ts +2 -0
  16. package/dist/components/button/index.js +1 -0
  17. package/dist/components/card/Card.d.ts +33 -0
  18. package/dist/components/card/Card.js +53 -0
  19. package/dist/components/card/index.d.ts +2 -0
  20. package/dist/components/card/index.js +1 -0
  21. package/dist/components/checkbox/Checkbox.d.ts +10 -0
  22. package/dist/components/checkbox/Checkbox.js +28 -0
  23. package/dist/components/checkbox/index.d.ts +2 -0
  24. package/dist/components/checkbox/index.js +1 -0
  25. package/dist/components/data-table/DataTable.d.ts +65 -0
  26. package/dist/components/data-table/DataTable.js +141 -0
  27. package/dist/components/data-table/index.d.ts +2 -0
  28. package/dist/components/data-table/index.js +1 -0
  29. package/dist/components/definition/Definition.d.ts +14 -0
  30. package/dist/components/definition/Definition.js +29 -0
  31. package/dist/components/definition/index.d.ts +2 -0
  32. package/dist/components/definition/index.js +1 -0
  33. package/dist/components/dialog/Dialog.d.ts +44 -0
  34. package/dist/components/dialog/Dialog.js +79 -0
  35. package/dist/components/dialog/index.d.ts +2 -0
  36. package/dist/components/dialog/index.js +1 -0
  37. package/dist/components/dropdown-menu/DropdownMenu.d.ts +73 -0
  38. package/dist/components/dropdown-menu/DropdownMenu.js +116 -0
  39. package/dist/components/dropdown-menu/index.d.ts +2 -0
  40. package/dist/components/dropdown-menu/index.js +1 -0
  41. package/dist/components/empty-state/EmptyState.d.ts +15 -0
  42. package/dist/components/empty-state/EmptyState.js +30 -0
  43. package/dist/components/empty-state/index.d.ts +2 -0
  44. package/dist/components/empty-state/index.js +1 -0
  45. package/dist/components/filter-tabs/FilterTabs.d.ts +28 -0
  46. package/dist/components/filter-tabs/FilterTabs.js +37 -0
  47. package/dist/components/filter-tabs/index.d.ts +2 -0
  48. package/dist/components/filter-tabs/index.js +1 -0
  49. package/dist/components/global-search/GlobalSearch.d.ts +51 -0
  50. package/dist/components/global-search/GlobalSearch.js +144 -0
  51. package/dist/components/global-search/index.d.ts +2 -0
  52. package/dist/components/global-search/index.js +1 -0
  53. package/dist/components/icon/registry.d.ts +3 -2
  54. package/dist/components/icon/registry.js +53 -1
  55. package/dist/components/input/Input.d.ts +19 -0
  56. package/dist/components/input/Input.js +26 -0
  57. package/dist/components/input/index.d.ts +2 -0
  58. package/dist/components/input/index.js +1 -0
  59. package/dist/components/input-group/InputGroup.d.ts +42 -0
  60. package/dist/components/input-group/InputGroup.js +83 -0
  61. package/dist/components/input-group/index.d.ts +2 -0
  62. package/dist/components/input-group/index.js +1 -0
  63. package/dist/components/kbd/Kbd.d.ts +17 -0
  64. package/dist/components/kbd/Kbd.js +21 -0
  65. package/dist/components/kbd/index.d.ts +2 -0
  66. package/dist/components/kbd/index.js +1 -0
  67. package/dist/components/link-provider/LinkProvider.d.ts +29 -0
  68. package/dist/components/link-provider/LinkProvider.js +15 -0
  69. package/dist/components/link-provider/RatioLink.js +18 -0
  70. package/dist/components/link-provider/context.js +4 -0
  71. package/dist/components/link-provider/index.d.ts +2 -0
  72. package/dist/components/link-provider/index.js +1 -0
  73. package/dist/components/metric-strip/MetricStrip.d.ts +23 -0
  74. package/dist/components/metric-strip/MetricStrip.js +39 -0
  75. package/dist/components/metric-strip/index.d.ts +2 -0
  76. package/dist/components/metric-strip/index.js +1 -0
  77. package/dist/components/page-header/PageHeader.d.ts +37 -0
  78. package/dist/components/page-header/PageHeader.js +62 -0
  79. package/dist/components/page-header/index.d.ts +2 -0
  80. package/dist/components/page-header/index.js +1 -0
  81. package/dist/components/pagination/Pagination.d.ts +18 -0
  82. package/dist/components/pagination/Pagination.js +59 -0
  83. package/dist/components/pagination/index.d.ts +2 -0
  84. package/dist/components/pagination/index.js +1 -0
  85. package/dist/components/popover/Popover.d.ts +27 -0
  86. package/dist/components/popover/Popover.js +47 -0
  87. package/dist/components/popover/index.d.ts +2 -0
  88. package/dist/components/popover/index.js +1 -0
  89. package/dist/components/search-field/SearchField.d.ts +23 -0
  90. package/dist/components/search-field/SearchField.js +66 -0
  91. package/dist/components/search-field/index.d.ts +2 -0
  92. package/dist/components/search-field/index.js +1 -0
  93. package/dist/components/side-nav/SideNav.d.ts +64 -0
  94. package/dist/components/side-nav/SideNav.js +194 -0
  95. package/dist/components/side-nav/index.d.ts +2 -0
  96. package/dist/components/side-nav/index.js +1 -0
  97. package/dist/components/skeleton/Skeleton.d.ts +13 -0
  98. package/dist/components/skeleton/Skeleton.js +21 -0
  99. package/dist/components/skeleton/index.d.ts +2 -0
  100. package/dist/components/skeleton/index.js +1 -0
  101. package/dist/components/spinner/Spinner.d.ts +11 -0
  102. package/dist/components/spinner/Spinner.js +16 -0
  103. package/dist/components/spinner/index.d.ts +2 -0
  104. package/dist/components/spinner/index.js +1 -0
  105. package/dist/components/status-pill/StatusPill.d.ts +14 -0
  106. package/dist/components/status-pill/StatusPill.js +19 -0
  107. package/dist/components/status-pill/index.d.ts +2 -0
  108. package/dist/components/status-pill/index.js +1 -0
  109. package/dist/components/table/Table.d.ts +46 -0
  110. package/dist/components/table/Table.js +87 -0
  111. package/dist/components/table/index.d.ts +2 -0
  112. package/dist/components/table/index.js +1 -0
  113. package/dist/components/table-loader/TableLoader.d.ts +31 -0
  114. package/dist/components/table-loader/TableLoader.js +35 -0
  115. package/dist/components/table-loader/index.d.ts +2 -0
  116. package/dist/components/table-loader/index.js +1 -0
  117. package/dist/components/tabs/Tabs.d.ts +23 -0
  118. package/dist/components/tabs/Tabs.js +41 -0
  119. package/dist/components/tabs/index.d.ts +2 -0
  120. package/dist/components/tabs/index.js +1 -0
  121. package/dist/components/toaster/Toaster.d.ts +32 -0
  122. package/dist/components/toaster/Toaster.js +89 -0
  123. package/dist/components/toaster/index.d.ts +2 -0
  124. package/dist/components/toaster/index.js +1 -0
  125. package/dist/components/tooltip/Tooltip.d.ts +18 -0
  126. package/dist/components/tooltip/Tooltip.js +35 -0
  127. package/dist/components/tooltip/index.d.ts +2 -0
  128. package/dist/components/tooltip/index.js +1 -0
  129. package/dist/components/top-bar/StoreSwitcher.d.ts +26 -0
  130. package/dist/components/top-bar/StoreSwitcher.js +48 -0
  131. package/dist/components/top-bar/TopBar.d.ts +24 -0
  132. package/dist/components/top-bar/TopBar.js +53 -0
  133. package/dist/components/top-bar/index.d.ts +3 -0
  134. package/dist/components/top-bar/index.js +3 -0
  135. package/dist/index.d.ts +65 -1
  136. package/dist/index.js +35 -2
  137. package/dist/lib/cn.js +32 -27
  138. package/dist/lib/format.d.ts +31 -0
  139. package/dist/lib/format.js +65 -0
  140. package/dist/styles.css +1 -1
  141. package/package.json +129 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The @ratio-ui/core authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -32,6 +32,7 @@ export function Heading() {
32
32
  - `@ratio-ui/core/base.css` is optional: Tailwind's preflight, then the typeface, text colour and white background of the page. Import it next to `styles.css` in an app that wants Ratio's look on the whole page.
33
33
  - Each component has an entry of its own (`@ratio-ui/core/icon`, `/inline`, `/stack` and `/text`) as well as the main one.
34
34
  - `@ratio-ui/core/catalogue.json` lists every component with its props, when to use it and an example.
35
+ - Money, counts, dates and times in your own markup, such as a DataTable cell, go through `formatMoney`, `formatCount`, `formatDate` and `formatTime` from the package root (with `FORMAT` and the `DateInput` type), so they read the way Ratio's components write them and follow design question 6 when it is answered.
35
36
 
36
37
  ## Components take no className
37
38
 
@@ -50,6 +51,7 @@ The stylesheet is built to sit inside an app without either side changing the ot
50
51
  - Every class carries an `rt:` prefix and every custom property an `--rt-` prefix, so an app's own Tailwind classes, its own copy of shadcn and its own `--primary` or `--radius` cannot collide with Ratio's.
51
52
  - Every size is in px, so an app that sets `html { font-size: 62.5% }` does not resize Ratio.
52
53
  - The stylesheet ships unlayered, and its reset applies only to elements that carry an `rt:` class, at the specificity of one class. That beats an app's bare element rules (`button { padding: 10px }`) and Tailwind's preflight. It is not `!important`, because Base UI places popups with inline styles that an `!important` rule would override. Utilities come after the reset and win over it.
54
+ - The reset also removes what a browser draws on a bare button, link, list or field (a grey fill, 13.33px type, a blue underline, bullets, native chrome), so Ratio looks the same whether or not the app loads a preflight. An antd app, which cannot load Tailwind's preflight, gets the same side navigation, tabs and table as a Tailwind app.
53
55
 
54
56
  A browser test holds the guarantee: it loads Tailwind's preflight and a host sheet (element rules, a 62.5% root size and its own variables) before Ratio's stylesheet, and compares the computed styles of Ratio's elements with those on a clean page (`test/browser/isolation.browser.test.tsx`).
55
57
 
@@ -115,4 +117,4 @@ The Ratio design system is the source of truth for every value, and it wins wher
115
117
 
116
118
  ## Licence
117
119
 
118
- UNLICENSED: all rights reserved. The Inter typeface bundled in `dist/fonts` is under the SIL Open Font License, whose text is `dist/fonts/OFL.txt` in the package. The owners may choose an open licence later.
120
+ MIT, from 0.1.1 on (see `LICENSE`). Version 0.1.0 was published UNLICENSED; use 0.1.1 or later. The Inter typeface bundled in `dist/fonts` keeps its own licence, the SIL Open Font License, whose text is `dist/fonts/OFL.txt` in the package. The built stylesheets carry Tailwind CSS's MIT notice at the top.