@luxfi/ui 6.1.3 → 7.1.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 (241) hide show
  1. package/dist/accordion.cjs +213 -0
  2. package/dist/accordion.d.cts +74 -0
  3. package/dist/accordion.d.ts +74 -0
  4. package/dist/accordion.js +186 -0
  5. package/dist/alert.cjs +430 -0
  6. package/dist/alert.d.cts +30 -0
  7. package/dist/alert.d.ts +30 -0
  8. package/dist/alert.js +408 -0
  9. package/dist/avatar.cjs +149 -0
  10. package/dist/avatar.d.cts +25 -0
  11. package/dist/avatar.d.ts +25 -0
  12. package/dist/avatar.js +125 -0
  13. package/dist/badge.cjs +452 -0
  14. package/dist/badge.d.cts +19 -0
  15. package/dist/badge.d.ts +19 -0
  16. package/dist/badge.js +431 -0
  17. package/dist/bank.cjs +272 -0
  18. package/dist/bank.d.cts +76 -0
  19. package/dist/bank.d.ts +76 -0
  20. package/dist/bank.js +258 -0
  21. package/dist/button.cjs +578 -0
  22. package/dist/button.d.cts +55 -0
  23. package/dist/button.d.ts +55 -0
  24. package/dist/button.js +553 -0
  25. package/dist/checkbox.cjs +265 -0
  26. package/dist/checkbox.d.cts +31 -0
  27. package/dist/checkbox.d.ts +31 -0
  28. package/dist/checkbox.js +241 -0
  29. package/dist/close-button.cjs +92 -0
  30. package/dist/close-button.d.cts +9 -0
  31. package/dist/close-button.d.ts +9 -0
  32. package/dist/close-button.js +70 -0
  33. package/dist/collapsible.cjs +555 -0
  34. package/dist/collapsible.d.cts +23 -0
  35. package/dist/collapsible.d.ts +23 -0
  36. package/dist/collapsible.js +532 -0
  37. package/dist/color-mode.cjs +96 -0
  38. package/dist/color-mode.d.cts +25 -0
  39. package/dist/color-mode.d.ts +25 -0
  40. package/dist/color-mode.js +72 -0
  41. package/dist/dialog.cjs +295 -0
  42. package/dist/dialog.d.cts +65 -0
  43. package/dist/dialog.d.ts +65 -0
  44. package/dist/dialog.js +263 -0
  45. package/dist/drawer.cjs +231 -0
  46. package/dist/drawer.d.cts +36 -0
  47. package/dist/drawer.d.ts +36 -0
  48. package/dist/drawer.js +199 -0
  49. package/dist/empty-state.cjs +93 -0
  50. package/dist/empty-state.d.cts +13 -0
  51. package/dist/empty-state.d.ts +13 -0
  52. package/dist/empty-state.js +71 -0
  53. package/dist/expiration-selector.cjs +138 -0
  54. package/dist/expiration-selector.d.cts +16 -0
  55. package/dist/expiration-selector.d.ts +16 -0
  56. package/dist/expiration-selector.js +116 -0
  57. package/dist/field.cjs +183 -0
  58. package/dist/field.d.cts +24 -0
  59. package/dist/field.d.ts +24 -0
  60. package/dist/field.js +160 -0
  61. package/dist/greeks-display.cjs +114 -0
  62. package/dist/greeks-display.d.cts +14 -0
  63. package/dist/greeks-display.d.ts +14 -0
  64. package/dist/greeks-display.js +92 -0
  65. package/dist/heading.cjs +41 -0
  66. package/dist/heading.d.cts +10 -0
  67. package/dist/heading.d.ts +10 -0
  68. package/dist/heading.js +35 -0
  69. package/dist/icon-button.cjs +367 -0
  70. package/dist/icon-button.d.cts +33 -0
  71. package/dist/icon-button.d.ts +33 -0
  72. package/dist/icon-button.js +345 -0
  73. package/dist/image.cjs +425 -0
  74. package/dist/image.d.cts +57 -0
  75. package/dist/image.d.ts +57 -0
  76. package/dist/image.js +404 -0
  77. package/dist/index.cjs +7220 -0
  78. package/dist/index.d.cts +55 -0
  79. package/dist/index.d.ts +55 -0
  80. package/dist/index.js +7043 -0
  81. package/dist/input-group.cjs +155 -0
  82. package/dist/input-group.d.cts +17 -0
  83. package/dist/input-group.d.ts +17 -0
  84. package/dist/input-group.js +133 -0
  85. package/dist/input.cjs +65 -0
  86. package/dist/input.d.cts +11 -0
  87. package/dist/input.d.ts +11 -0
  88. package/dist/input.js +59 -0
  89. package/dist/link.cjs +483 -0
  90. package/dist/link.d.cts +37 -0
  91. package/dist/link.d.ts +37 -0
  92. package/dist/link.js +459 -0
  93. package/dist/menu.cjs +305 -0
  94. package/dist/menu.d.cts +84 -0
  95. package/dist/menu.d.ts +84 -0
  96. package/dist/menu.js +269 -0
  97. package/dist/option-chain.cjs +221 -0
  98. package/dist/option-chain.d.cts +37 -0
  99. package/dist/option-chain.d.ts +37 -0
  100. package/dist/option-chain.js +199 -0
  101. package/dist/option-position.cjs +164 -0
  102. package/dist/option-position.d.cts +29 -0
  103. package/dist/option-position.d.ts +29 -0
  104. package/dist/option-position.js +142 -0
  105. package/dist/pin-input.cjs +182 -0
  106. package/dist/pin-input.d.cts +25 -0
  107. package/dist/pin-input.d.ts +25 -0
  108. package/dist/pin-input.js +160 -0
  109. package/dist/pnl-diagram.cjs +453 -0
  110. package/dist/pnl-diagram.d.cts +11 -0
  111. package/dist/pnl-diagram.d.ts +11 -0
  112. package/dist/pnl-diagram.js +431 -0
  113. package/dist/popover.cjs +342 -0
  114. package/dist/popover.d.cts +73 -0
  115. package/dist/popover.d.ts +73 -0
  116. package/dist/popover.js +310 -0
  117. package/dist/progress-circle.cjs +152 -0
  118. package/dist/progress-circle.d.cts +47 -0
  119. package/dist/progress-circle.d.ts +47 -0
  120. package/dist/progress-circle.js +128 -0
  121. package/dist/progress.cjs +117 -0
  122. package/dist/progress.d.cts +28 -0
  123. package/dist/progress.d.ts +28 -0
  124. package/dist/progress.js +94 -0
  125. package/dist/provider.cjs +62 -0
  126. package/dist/provider.d.cts +7 -0
  127. package/dist/provider.d.ts +7 -0
  128. package/dist/provider.js +40 -0
  129. package/dist/radio.cjs +177 -0
  130. package/dist/radio.d.cts +53 -0
  131. package/dist/radio.d.ts +53 -0
  132. package/dist/radio.js +153 -0
  133. package/dist/rating.cjs +80 -0
  134. package/dist/rating.d.cts +14 -0
  135. package/dist/rating.d.ts +14 -0
  136. package/dist/rating.js +58 -0
  137. package/dist/select.cjs +644 -0
  138. package/dist/select.d.cts +130 -0
  139. package/dist/select.d.ts +130 -0
  140. package/dist/select.js +610 -0
  141. package/dist/separator.cjs +57 -0
  142. package/dist/separator.d.cts +13 -0
  143. package/dist/separator.d.ts +13 -0
  144. package/dist/separator.js +51 -0
  145. package/dist/skeleton.cjs +223 -0
  146. package/dist/skeleton.d.cts +60 -0
  147. package/dist/skeleton.d.ts +60 -0
  148. package/dist/skeleton.js +199 -0
  149. package/dist/slider.cjs +138 -0
  150. package/dist/slider.d.cts +24 -0
  151. package/dist/slider.d.ts +24 -0
  152. package/dist/slider.js +115 -0
  153. package/dist/strategy-builder.cjs +373 -0
  154. package/dist/strategy-builder.d.cts +26 -0
  155. package/dist/strategy-builder.d.ts +26 -0
  156. package/dist/strategy-builder.js +351 -0
  157. package/dist/switch.cjs +163 -0
  158. package/dist/switch.d.cts +27 -0
  159. package/dist/switch.d.ts +27 -0
  160. package/dist/switch.js +140 -0
  161. package/dist/table.cjs +897 -0
  162. package/dist/table.d.cts +107 -0
  163. package/dist/table.d.ts +107 -0
  164. package/dist/table.js +866 -0
  165. package/dist/tabs.cjs +240 -0
  166. package/dist/tabs.d.cts +78 -0
  167. package/dist/tabs.d.ts +78 -0
  168. package/dist/tabs.js +213 -0
  169. package/dist/tag.cjs +529 -0
  170. package/dist/tag.d.cts +21 -0
  171. package/dist/tag.d.ts +21 -0
  172. package/dist/tag.js +507 -0
  173. package/dist/textarea.cjs +65 -0
  174. package/dist/textarea.d.cts +11 -0
  175. package/dist/textarea.d.ts +11 -0
  176. package/dist/textarea.js +59 -0
  177. package/dist/toaster.cjs +99 -0
  178. package/dist/toaster.d.cts +29 -0
  179. package/dist/toaster.d.ts +29 -0
  180. package/dist/toaster.js +96 -0
  181. package/dist/tooltip.cjs +172 -0
  182. package/dist/tooltip.d.cts +38 -0
  183. package/dist/tooltip.d.ts +38 -0
  184. package/dist/tooltip.js +150 -0
  185. package/dist/utils.cjs +11 -0
  186. package/dist/utils.d.cts +5 -0
  187. package/dist/utils.d.ts +5 -0
  188. package/dist/utils.js +9 -0
  189. package/package.json +284 -89
  190. package/src/accordion.tsx +285 -0
  191. package/src/alert.tsx +221 -0
  192. package/src/avatar.tsx +174 -0
  193. package/src/badge.tsx +147 -0
  194. package/src/bank.tsx +325 -0
  195. package/src/button.tsx +477 -0
  196. package/src/checkbox.tsx +307 -0
  197. package/src/close-button.tsx +77 -0
  198. package/src/collapsible.tsx +126 -0
  199. package/src/color-mode.tsx +125 -0
  200. package/src/dialog.tsx +346 -0
  201. package/src/drawer.tsx +186 -0
  202. package/src/empty-state.tsx +97 -0
  203. package/src/expiration-selector.tsx +163 -0
  204. package/src/field.tsx +202 -0
  205. package/src/greeks-display.tsx +138 -0
  206. package/src/heading.tsx +44 -0
  207. package/src/icon-button.tsx +217 -0
  208. package/src/image.tsx +280 -0
  209. package/src/index.ts +267 -138
  210. package/src/input-group.tsx +159 -0
  211. package/src/input.tsx +60 -0
  212. package/src/link.tsx +326 -0
  213. package/src/menu.tsx +471 -0
  214. package/src/option-chain.tsx +261 -0
  215. package/src/option-position.tsx +200 -0
  216. package/src/pin-input.tsx +187 -0
  217. package/src/pnl-diagram.tsx +458 -0
  218. package/src/popover.tsx +386 -0
  219. package/src/progress-circle.tsx +180 -0
  220. package/src/progress.tsx +109 -0
  221. package/src/provider.tsx +12 -0
  222. package/src/radio.tsx +175 -0
  223. package/src/rating.tsx +79 -0
  224. package/src/select.tsx +696 -0
  225. package/src/separator.tsx +59 -0
  226. package/src/skeleton.tsx +254 -0
  227. package/src/slider.tsx +152 -0
  228. package/src/strategy-builder.tsx +466 -0
  229. package/src/switch.tsx +158 -0
  230. package/src/table.tsx +621 -0
  231. package/src/tabs.tsx +354 -0
  232. package/src/tag.tsx +159 -0
  233. package/src/textarea.tsx +60 -0
  234. package/src/toaster.tsx +117 -0
  235. package/src/tokens.css +438 -0
  236. package/src/tooltip.tsx +191 -0
  237. package/src/utils/cn.ts +7 -0
  238. package/src/utils.ts +6 -0
  239. package/tokens.css +438 -0
  240. package/LICENSE +0 -122
  241. package/README.md +0 -109
package/package.json CHANGED
@@ -1,100 +1,295 @@
1
1
  {
2
2
  "name": "@luxfi/ui",
3
- "version": "6.1.3",
4
- "dependencies": {
5
- "@gorhom/bottom-sheet": "4.6.4",
6
- "@react-native-masked-view/masked-view": "0.3.2",
7
- "@shopify/flash-list": "1.7.6",
8
- "@shopify/react-native-skia": "2.2.20",
9
- "@storybook/react": "8.5.2",
10
- "@hanzogui/adapt": "3.0.2",
11
- "@hanzogui/animations-css": "3.0.2",
12
- "@hanzogui/animations-react-native": "3.0.2",
13
- "@hanzogui/font-geist-sans": "3.0.2",
14
- "@hanzogui/helpers-icon": "3.0.2",
15
- "@hanzogui/portal": "3.0.2",
16
- "@hanzogui/react-native-media-driver": "3.0.2",
17
- "@hanzogui/remove-scroll": "3.0.2",
18
- "@hanzogui/theme-base": "3.0.2",
19
- "@tanstack/react-query": "5.90.20",
20
- "@testing-library/react": "16.3.0",
21
- "ethers": "5.7.2",
22
- "expo-blur": "14.1.5",
23
- "expo-image": "2.4.1",
24
- "expo-linear-gradient": "14.1.5",
25
- "i18next": "23.10.0",
26
- "qrcode": "1.5.1",
27
- "react": "19.0.3",
28
- "react-i18next": "14.1.0",
29
- "react-native": "0.79.5",
30
- "react-native-gesture-handler": "2.24.0",
31
- "react-native-image-colors": "1.5.2",
32
- "react-native-keyboard-controller": "1.17.5",
33
- "react-native-reanimated": "3.19.3",
34
- "react-native-safe-area-context": "5.4.0",
35
- "react-native-svg": "15.13.0",
36
- "react-native-webview": "13.13.5",
37
- "react-remove-scroll": "2.7.2",
38
- "uuid": "9.0.0",
39
- "wcag-contrast": "3.0.0",
40
- "@hanzogui/dialog": "3.0.2",
41
- "@hanzogui/sheet": "3.0.2",
42
- "@hanzogui/visually-hidden": "3.0.2",
43
- "@hanzo/gui": "2.0.6",
44
- "@hanzogui/stacks": "3.0.2",
45
- "@hanzogui/web": "3.0.2",
46
- "@hanzogui/spacer": "3.0.2",
47
- "@luxfi/utilities": "^1.0.6"
3
+ "version": "7.1.0",
4
+ "description": "Radix + Tailwind UI primitives for Lux apps. Drop-in replacements for Chakra compound components.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": {
8
+ "name": "Lux Partners",
9
+ "url": "https://lux.network"
48
10
  },
49
- "devDependencies": {
50
- "@storybook/test": "8.5.2",
51
- "@hanzogui/animations-moti": "3.0.2",
52
- "@hanzogui/core": "3.0.2",
53
- "@types/chrome": "0.0.304",
54
- "@types/fs-extra": "11.0.2",
55
- "@types/node": "22.13.1",
56
- "@types/qrcode": "1.5.5",
57
- "@typescript/native-preview": "7.0.0-dev.20260311.1",
58
- "@vitejs/plugin-react": "4.7.0",
59
- "camelcase": "6.3.0",
60
- "cheerio": "1.0.0-rc.12",
61
- "esbuild-register": "3.6.0",
62
- "eslint": "8.57.1",
63
- "fs-extra": "11.2.0",
64
- "jsdom": "20.0.3",
65
- "typescript": "5.8.3",
66
- "uppercamelcase": "3.0.0",
67
- "vitest": "3.2.1",
68
- "@luxfi/eslint-config": "^1.0.6",
69
- "vitest-presets": "^0.0.0"
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/luxfi/ui.git",
14
+ "directory": "packages/ui"
70
15
  },
71
- "files": [
72
- "types",
73
- "dist"
74
- ],
75
- "main": "./src/index.ts",
76
- "module:jsx": "src",
77
- "private": false,
78
- "nx": {
79
- "includedScripts": []
16
+ "publishConfig": {
17
+ "registry": "https://registry.npmjs.org/",
18
+ "access": "public"
80
19
  },
81
20
  "sideEffects": [
82
21
  "*.css"
83
22
  ],
84
- "types": "./types/index",
23
+ "main": "./dist/index.cjs",
24
+ "module": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "files": [
27
+ "dist",
28
+ "src",
29
+ "tokens.css"
30
+ ],
31
+ "exports": {
32
+ "./package.json": "./package.json",
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js",
36
+ "require": "./dist/index.cjs"
37
+ },
38
+ "./tokens.css": "./tokens.css",
39
+ "./accordion": {
40
+ "types": "./dist/accordion.d.ts",
41
+ "import": "./dist/accordion.js",
42
+ "require": "./dist/accordion.cjs"
43
+ },
44
+ "./alert": {
45
+ "types": "./dist/alert.d.ts",
46
+ "import": "./dist/alert.js",
47
+ "require": "./dist/alert.cjs"
48
+ },
49
+ "./avatar": {
50
+ "types": "./dist/avatar.d.ts",
51
+ "import": "./dist/avatar.js",
52
+ "require": "./dist/avatar.cjs"
53
+ },
54
+ "./badge": {
55
+ "types": "./dist/badge.d.ts",
56
+ "import": "./dist/badge.js",
57
+ "require": "./dist/badge.cjs"
58
+ },
59
+ "./button": {
60
+ "types": "./dist/button.d.ts",
61
+ "import": "./dist/button.js",
62
+ "require": "./dist/button.cjs"
63
+ },
64
+ "./checkbox": {
65
+ "types": "./dist/checkbox.d.ts",
66
+ "import": "./dist/checkbox.js",
67
+ "require": "./dist/checkbox.cjs"
68
+ },
69
+ "./close-button": {
70
+ "types": "./dist/close-button.d.ts",
71
+ "import": "./dist/close-button.js",
72
+ "require": "./dist/close-button.cjs"
73
+ },
74
+ "./collapsible": {
75
+ "types": "./dist/collapsible.d.ts",
76
+ "import": "./dist/collapsible.js",
77
+ "require": "./dist/collapsible.cjs"
78
+ },
79
+ "./color-mode": {
80
+ "types": "./dist/color-mode.d.ts",
81
+ "import": "./dist/color-mode.js",
82
+ "require": "./dist/color-mode.cjs"
83
+ },
84
+ "./dialog": {
85
+ "types": "./dist/dialog.d.ts",
86
+ "import": "./dist/dialog.js",
87
+ "require": "./dist/dialog.cjs"
88
+ },
89
+ "./drawer": {
90
+ "types": "./dist/drawer.d.ts",
91
+ "import": "./dist/drawer.js",
92
+ "require": "./dist/drawer.cjs"
93
+ },
94
+ "./empty-state": {
95
+ "types": "./dist/empty-state.d.ts",
96
+ "import": "./dist/empty-state.js",
97
+ "require": "./dist/empty-state.cjs"
98
+ },
99
+ "./field": {
100
+ "types": "./dist/field.d.ts",
101
+ "import": "./dist/field.js",
102
+ "require": "./dist/field.cjs"
103
+ },
104
+ "./heading": {
105
+ "types": "./dist/heading.d.ts",
106
+ "import": "./dist/heading.js",
107
+ "require": "./dist/heading.cjs"
108
+ },
109
+ "./icon-button": {
110
+ "types": "./dist/icon-button.d.ts",
111
+ "import": "./dist/icon-button.js",
112
+ "require": "./dist/icon-button.cjs"
113
+ },
114
+ "./image": {
115
+ "types": "./dist/image.d.ts",
116
+ "import": "./dist/image.js",
117
+ "require": "./dist/image.cjs"
118
+ },
119
+ "./input": {
120
+ "types": "./dist/input.d.ts",
121
+ "import": "./dist/input.js",
122
+ "require": "./dist/input.cjs"
123
+ },
124
+ "./input-group": {
125
+ "types": "./dist/input-group.d.ts",
126
+ "import": "./dist/input-group.js",
127
+ "require": "./dist/input-group.cjs"
128
+ },
129
+ "./link": {
130
+ "types": "./dist/link.d.ts",
131
+ "import": "./dist/link.js",
132
+ "require": "./dist/link.cjs"
133
+ },
134
+ "./menu": {
135
+ "types": "./dist/menu.d.ts",
136
+ "import": "./dist/menu.js",
137
+ "require": "./dist/menu.cjs"
138
+ },
139
+ "./pin-input": {
140
+ "types": "./dist/pin-input.d.ts",
141
+ "import": "./dist/pin-input.js",
142
+ "require": "./dist/pin-input.cjs"
143
+ },
144
+ "./popover": {
145
+ "types": "./dist/popover.d.ts",
146
+ "import": "./dist/popover.js",
147
+ "require": "./dist/popover.cjs"
148
+ },
149
+ "./progress": {
150
+ "types": "./dist/progress.d.ts",
151
+ "import": "./dist/progress.js",
152
+ "require": "./dist/progress.cjs"
153
+ },
154
+ "./progress-circle": {
155
+ "types": "./dist/progress-circle.d.ts",
156
+ "import": "./dist/progress-circle.js",
157
+ "require": "./dist/progress-circle.cjs"
158
+ },
159
+ "./radio": {
160
+ "types": "./dist/radio.d.ts",
161
+ "import": "./dist/radio.js",
162
+ "require": "./dist/radio.cjs"
163
+ },
164
+ "./rating": {
165
+ "types": "./dist/rating.d.ts",
166
+ "import": "./dist/rating.js",
167
+ "require": "./dist/rating.cjs"
168
+ },
169
+ "./select": {
170
+ "types": "./dist/select.d.ts",
171
+ "import": "./dist/select.js",
172
+ "require": "./dist/select.cjs"
173
+ },
174
+ "./separator": {
175
+ "types": "./dist/separator.d.ts",
176
+ "import": "./dist/separator.js",
177
+ "require": "./dist/separator.cjs"
178
+ },
179
+ "./skeleton": {
180
+ "types": "./dist/skeleton.d.ts",
181
+ "import": "./dist/skeleton.js",
182
+ "require": "./dist/skeleton.cjs"
183
+ },
184
+ "./slider": {
185
+ "types": "./dist/slider.d.ts",
186
+ "import": "./dist/slider.js",
187
+ "require": "./dist/slider.cjs"
188
+ },
189
+ "./switch": {
190
+ "types": "./dist/switch.d.ts",
191
+ "import": "./dist/switch.js",
192
+ "require": "./dist/switch.cjs"
193
+ },
194
+ "./table": {
195
+ "types": "./dist/table.d.ts",
196
+ "import": "./dist/table.js",
197
+ "require": "./dist/table.cjs"
198
+ },
199
+ "./tabs": {
200
+ "types": "./dist/tabs.d.ts",
201
+ "import": "./dist/tabs.js",
202
+ "require": "./dist/tabs.cjs"
203
+ },
204
+ "./tag": {
205
+ "types": "./dist/tag.d.ts",
206
+ "import": "./dist/tag.js",
207
+ "require": "./dist/tag.cjs"
208
+ },
209
+ "./textarea": {
210
+ "types": "./dist/textarea.d.ts",
211
+ "import": "./dist/textarea.js",
212
+ "require": "./dist/textarea.cjs"
213
+ },
214
+ "./toaster": {
215
+ "types": "./dist/toaster.d.ts",
216
+ "import": "./dist/toaster.js",
217
+ "require": "./dist/toaster.cjs"
218
+ },
219
+ "./tooltip": {
220
+ "types": "./dist/tooltip.d.ts",
221
+ "import": "./dist/tooltip.js",
222
+ "require": "./dist/tooltip.cjs"
223
+ },
224
+ "./provider": {
225
+ "types": "./dist/provider.d.ts",
226
+ "import": "./dist/provider.js",
227
+ "require": "./dist/provider.cjs"
228
+ },
229
+ "./utils": {
230
+ "types": "./dist/utils.d.ts",
231
+ "import": "./dist/utils.js",
232
+ "require": "./dist/utils.cjs"
233
+ },
234
+ "./bank": {
235
+ "types": "./dist/bank.d.ts",
236
+ "import": "./dist/bank.js",
237
+ "require": "./dist/bank.cjs"
238
+ },
239
+ "./explore": {
240
+ "import": "./dist/index.js",
241
+ "require": "./dist/index.cjs",
242
+ "types": "./dist/index.d.ts"
243
+ },
244
+ "./explore/*": {
245
+ "import": "./dist/*.js",
246
+ "require": "./dist/*.cjs",
247
+ "types": "./dist/*.d.ts"
248
+ }
249
+ },
85
250
  "scripts": {
86
- "build:icons": "nx build:icons ui",
87
- "build:icons:missing": "nx build:icons:missing ui",
88
- "check:deps:usage": "nx check:deps:usage ui",
89
- "lint": "nx lint ui",
90
- "lint:fix": "nx lint:fix ui",
91
- "lint:biome": "nx lint:biome ui",
92
- "lint:biome:fix": "nx lint:biome:fix ui",
93
- "lint:eslint": "nx lint:eslint ui",
94
- "lint:eslint:fix": "nx lint:eslint:fix ui",
95
- "test": "nx test ui",
96
- "typecheck": "nx typecheck ui",
97
- "typecheck:tsgo": "nx typecheck:tsgo ui",
98
- "watch": "nx watch ui"
251
+ "build": "tsup",
252
+ "build:check": "tsc --noEmit",
253
+ "clean": "rm -rf dist",
254
+ "dev": "tsup --watch"
255
+ },
256
+ "dependencies": {
257
+ "@hanzogui/core": "^3.0.6",
258
+ "@hanzogui/dialog": "^3.0.2",
259
+ "@hanzogui/popover": "^3.0.2",
260
+ "@hanzogui/text": "^3.0.2",
261
+ "@hanzogui/tooltip": "^3.0.2",
262
+ "@radix-ui/react-accordion": "^1.2.12",
263
+ "@radix-ui/react-avatar": "^1.1.10",
264
+ "@radix-ui/react-checkbox": "^1.3.3",
265
+ "@radix-ui/react-collapsible": "^1.1.12",
266
+ "@radix-ui/react-dialog": "^1.1.15",
267
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
268
+ "@radix-ui/react-label": "^2.1.7",
269
+ "@radix-ui/react-progress": "^1.1.7",
270
+ "@radix-ui/react-radio-group": "^1.3.8",
271
+ "@radix-ui/react-select": "^2.2.6",
272
+ "@radix-ui/react-slider": "^1.3.6",
273
+ "@radix-ui/react-switch": "^1.2.6",
274
+ "@radix-ui/react-tabs": "^1.1.13",
275
+ "@uidotdev/usehooks": "^2.4.1",
276
+ "class-variance-authority": "^0.7.1",
277
+ "clsx": "^2.1.1",
278
+ "es-toolkit": "^1.31.0",
279
+ "react-icons": "^5.4.0",
280
+ "sonner": "^2.0.0",
281
+ "tailwind-merge": "^3.0.0"
282
+ },
283
+ "peerDependencies": {
284
+ "@hanzogui/core": "^3.0.6",
285
+ "react": "^18.0.0 || ^19.0.0",
286
+ "react-dom": "^18.0.0 || ^19.0.0"
287
+ },
288
+ "devDependencies": {
289
+ "@hanzogui/core": "^3.0.6",
290
+ "@types/react": "^19.0.0",
291
+ "@types/react-dom": "^19.0.0",
292
+ "tsup": "^8.5.0",
293
+ "typescript": "^5.9.3"
99
294
  }
100
295
  }
@@ -0,0 +1,285 @@
1
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
2
+ import * as React from 'react';
3
+
4
+ import { cn } from './utils';
5
+
6
+ // Inline chevron icon (east-mini arrow)
7
+ const IndicatorIcon = ({ className }: { readonly className?: string }) => (
8
+ <svg className={ className } viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
9
+ <path d="M7.5 15L12.5 10L7.5 5" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
10
+ </svg>
11
+ );
12
+
13
+ // ---------------------------------------------------------------------------
14
+ // AccordionRoot
15
+ // ---------------------------------------------------------------------------
16
+
17
+ interface AccordionRootProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'dir'> {
18
+
19
+ /** Open multiple items simultaneously. Defaults to true. */
20
+ readonly multiple?: boolean;
21
+
22
+ /** Controlled open items (array of `value` strings). */
23
+ readonly value?: Array<string>;
24
+
25
+ /** Uncontrolled initial open items. */
26
+ readonly defaultValue?: Array<string>;
27
+
28
+ /**
29
+ * Called when open items change.
30
+ * Wraps the value in `{ value }` to stay compatible with the Chakra callback shape
31
+ * that consumers already rely on.
32
+ */
33
+ readonly onValueChange?: (details: { value: Array<string> }) => void;
34
+ readonly variant?: 'outline' | 'faq';
35
+ readonly size?: 'sm' | 'md';
36
+
37
+ /** Accepted for compatibility; not applied visually. */
38
+ readonly noAnimation?: boolean;
39
+
40
+ /** Accepted for compatibility; Radix defers rendering internally. */
41
+ readonly lazyMount?: boolean;
42
+ readonly children?: React.ReactNode;
43
+ // Legacy Chakra style-prop shims
44
+ readonly position?: string;
45
+ readonly w?: string;
46
+ readonly bgColor?: string | Record<string, string>;
47
+ readonly borderRadius?: string;
48
+ }
49
+
50
+ export const AccordionRoot = React.forwardRef<HTMLDivElement, AccordionRootProps>(
51
+ function AccordionRoot(props, ref) {
52
+ const {
53
+ multiple: _multiple,
54
+ value,
55
+ defaultValue,
56
+ onValueChange,
57
+ variant,
58
+ size,
59
+ noAnimation: _noAnimation,
60
+ lazyMount: _lazyMount,
61
+ className,
62
+ children,
63
+ position: _position,
64
+ w: _w,
65
+ bgColor: _bgColor,
66
+ borderRadius: _borderRadius,
67
+ ...rest
68
+ } = props;
69
+
70
+ // Radix requires `type` discriminant. We default to "multiple" to match
71
+ // the original Chakra wrapper behavior.
72
+ const handleValueChange = React.useCallback(
73
+ (next: Array<string>) => {
74
+ onValueChange?.({ value: next });
75
+ },
76
+ [ onValueChange ],
77
+ );
78
+
79
+ return (
80
+ <AccordionPrimitive.Root
81
+ ref={ ref }
82
+ type="multiple"
83
+ value={ value }
84
+ defaultValue={ defaultValue }
85
+ onValueChange={ handleValueChange }
86
+ className={ cn(
87
+ 'w-full',
88
+ variant === 'faq' && 'accordion-faq',
89
+ size === 'sm' && 'accordion-sm',
90
+ className,
91
+ ) }
92
+ data-variant={ variant }
93
+ data-size={ size }
94
+ { ...rest }
95
+ >
96
+ { children }
97
+ </AccordionPrimitive.Root>
98
+ );
99
+ },
100
+ );
101
+
102
+ // ---------------------------------------------------------------------------
103
+ // AccordionItem
104
+ // ---------------------------------------------------------------------------
105
+
106
+ interface AccordionItemProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {
107
+ // Legacy Chakra style-prop shims
108
+ as?: string;
109
+ _first?: Record<string, unknown>;
110
+ _last?: Record<string, unknown>;
111
+ display?: string;
112
+ }
113
+
114
+ export const AccordionItem = React.forwardRef<HTMLDivElement, AccordionItemProps>(
115
+ function AccordionItem(props, ref) {
116
+ const { className, as: _as, _first, _last, display: _display, ...rest } = props;
117
+ return (
118
+ <AccordionPrimitive.Item
119
+ ref={ ref }
120
+ className={ cn(
121
+ 'border-b border-[var(--color-border-divider)]',
122
+ className,
123
+ ) }
124
+ { ...rest }
125
+ />
126
+ );
127
+ },
128
+ );
129
+
130
+ // ---------------------------------------------------------------------------
131
+ // AccordionItemTrigger
132
+ // ---------------------------------------------------------------------------
133
+
134
+ interface AccordionItemTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>, 'dir'> {
135
+ readonly indicatorPlacement?: 'start' | 'end';
136
+ readonly noIndicator?: boolean;
137
+ readonly variant?: 'outline' | 'faq';
138
+ // Legacy Chakra style-prop shims
139
+ px?: number | string;
140
+ py?: number | string;
141
+ _hover?: Record<string, string>;
142
+ wordBreak?: string;
143
+ textAlign?: string;
144
+ cursor?: string;
145
+ display?: string;
146
+ alignItems?: string;
147
+ columnGap?: number | string;
148
+ }
149
+
150
+ export const AccordionItemTrigger = React.forwardRef<
151
+ HTMLButtonElement,
152
+ AccordionItemTriggerProps
153
+ >(function AccordionItemTrigger(props, ref) {
154
+ const {
155
+ children, indicatorPlacement: indicatorPlacementProp, variant, noIndicator, className,
156
+ // Strip Chakra style props
157
+ px: _px, py: _py, _hover, wordBreak: _wordBreak, textAlign: _textAlign,
158
+ cursor: _cursor, display: _display, alignItems: _alignItems, columnGap: _columnGap,
159
+ ...rest
160
+ } = props;
161
+
162
+ const indicatorPlacement = variant === 'faq' ? 'start' : (indicatorPlacementProp ?? 'end');
163
+
164
+ const indicator = variant === 'faq' ? (
165
+ <span
166
+ className={ cn(
167
+ 'relative inline-block h-3 w-3 shrink-0',
168
+ // horizontal bar (always visible)
169
+ 'before:absolute before:left-0 before:top-1/2 before:block before:h-[2px] before:w-full before:-translate-y-1/2 before:rounded-[2px] before:bg-current',
170
+ // vertical bar (rotates to 0 when open)
171
+ 'after:absolute after:left-1/2 after:top-0 after:block after:h-full after:w-[2px]',
172
+ 'after:-translate-x-1/2 after:rounded-[2px] after:bg-current',
173
+ 'after:transition-transform after:duration-200 after:ease-in-out',
174
+ // When parent trigger has data-state="open", rotate vertical bar
175
+ 'group-data-[state=open]/trigger:after:rotate-90',
176
+ ) }
177
+ />
178
+ ) : (
179
+ <span
180
+ className={ cn(
181
+ 'inline-flex shrink-0 transition-transform duration-200',
182
+ 'rotate-180',
183
+ 'group-data-[state=open]/trigger:rotate-[270deg]',
184
+ ) }
185
+ >
186
+ <IndicatorIcon className="h-5 w-5"/>
187
+ </span>
188
+ );
189
+
190
+ return (
191
+ <AccordionPrimitive.Header asChild>
192
+ <div>
193
+ <AccordionPrimitive.Trigger
194
+ ref={ ref }
195
+ className={ cn(
196
+ 'group/trigger flex w-full cursor-pointer items-center gap-2 py-3 text-left text-[var(--color-text-primary)]',
197
+ 'hover:text-[var(--color-hover)]',
198
+ 'focus-visible:outline-none',
199
+ className,
200
+ ) }
201
+ { ...rest }
202
+ >
203
+ { indicatorPlacement === 'start' && !noIndicator && indicator }
204
+ { children }
205
+ { indicatorPlacement === 'end' && !noIndicator && indicator }
206
+ </AccordionPrimitive.Trigger>
207
+ </div>
208
+ </AccordionPrimitive.Header>
209
+ );
210
+ });
211
+
212
+ // ---------------------------------------------------------------------------
213
+ // AccordionItemContent
214
+ // ---------------------------------------------------------------------------
215
+
216
+ export interface AccordionItemContentProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> {
217
+ // Legacy Chakra style-prop shims
218
+ pb?: number | string;
219
+ pr?: number | string;
220
+ pl?: string;
221
+ w?: string;
222
+ display?: string;
223
+ flexDir?: string;
224
+ rowGap?: number | string;
225
+ }
226
+
227
+ export const AccordionItemContent = React.forwardRef<
228
+ HTMLDivElement,
229
+ AccordionItemContentProps
230
+ >(function AccordionItemContent(props, ref) {
231
+ const { className, children, pb: _pb, pr: _pr, pl: _pl, w: _w, display: _display, flexDir: _flexDir, rowGap: _rowGap, ...rest } = props;
232
+ return (
233
+ <AccordionPrimitive.Content
234
+ ref={ ref }
235
+ className={ cn(
236
+ 'overflow-hidden text-[var(--color-text-primary)]',
237
+ 'data-[state=open]:animate-accordion-down',
238
+ 'data-[state=closed]:animate-accordion-up',
239
+ className,
240
+ ) }
241
+ { ...rest }
242
+ >
243
+ <div className="pb-3">
244
+ { children }
245
+ </div>
246
+ </AccordionPrimitive.Content>
247
+ );
248
+ });
249
+
250
+ // ---------------------------------------------------------------------------
251
+ // useAccordion
252
+ // ---------------------------------------------------------------------------
253
+
254
+ export function useAccordion(items: Array<{ id: string }>) {
255
+ const [ value, setValue ] = React.useState<Array<string>>([]);
256
+
257
+ const onValueChange = React.useCallback(({ value }: { value: Array<string> }) => {
258
+ setValue(value);
259
+ }, []);
260
+
261
+ const scrollToItemFromUrl = React.useCallback(() => {
262
+ const hash = window.location.hash.replace('#', '');
263
+
264
+ if (!hash) {
265
+ return;
266
+ }
267
+
268
+ const itemToScroll = items.find((item) => item.id === hash);
269
+ if (itemToScroll) {
270
+ const el = document.getElementById(itemToScroll.id);
271
+ if (el) {
272
+ el.scrollIntoView({ behavior: 'smooth', block: 'start' });
273
+ }
274
+ setValue([ itemToScroll.id ]);
275
+ }
276
+ }, [ items ]);
277
+
278
+ return React.useMemo(() => {
279
+ return {
280
+ value,
281
+ onValueChange,
282
+ scrollToItemFromUrl,
283
+ };
284
+ }, [ value, onValueChange, scrollToItemFromUrl ]);
285
+ }