@hanzo/ui 4.4.3 → 4.5.2

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 (321) hide show
  1. package/MCP-INSTRUCTIONS.md +73 -0
  2. package/README-MCP.md +175 -0
  3. package/bin/cli.js +100 -0
  4. package/bin/create-registry.js +108 -0
  5. package/bin/mcp.js +403 -0
  6. package/bin/npx-registry-mcp.js +15 -0
  7. package/bin/registry-mcp-wrapper.sh +19 -0
  8. package/bin/registry-mcp.js +100 -0
  9. package/bin/start-mcp-server.sh +22 -0
  10. package/bin/test-mcp.sh +52 -0
  11. package/bin/update-registry.js +196 -0
  12. package/blocks/components/enh-heading-block.tsx +1 -2
  13. package/blocks/components/screenful-block/index.tsx +2 -0
  14. package/blocks/def/card-block.ts +1 -3
  15. package/blocks/def/enh-heading-block.ts +1 -2
  16. package/dist/blocks/components/accordian-block.d.ts +4 -0
  17. package/dist/blocks/components/accordian-block.jsx +25 -0
  18. package/dist/blocks/components/block-component-props.d.ts +7 -0
  19. package/dist/blocks/components/block-component-props.js +1 -0
  20. package/dist/blocks/components/bullet-cards-block.d.ts +4 -0
  21. package/dist/blocks/components/bullet-cards-block.jsx +25 -0
  22. package/dist/blocks/components/card-block/index.d.ts +6 -0
  23. package/dist/blocks/components/card-block/index.jsx +87 -0
  24. package/dist/blocks/components/card-block/link-out-button.d.ts +6 -0
  25. package/dist/blocks/components/card-block/link-out-button.jsx +4 -0
  26. package/dist/blocks/components/card-block/util.d.ts +4 -0
  27. package/dist/blocks/components/card-block/util.js +6 -0
  28. package/dist/blocks/components/carte-blanche-block/index.d.ts +4 -0
  29. package/dist/blocks/components/carte-blanche-block/index.jsx +82 -0
  30. package/dist/blocks/components/carte-blanche-block/variant-content-left.d.ts +10 -0
  31. package/dist/blocks/components/carte-blanche-block/variant-content-left.jsx +23 -0
  32. package/dist/blocks/components/content.d.ts +10 -0
  33. package/dist/blocks/components/content.jsx +47 -0
  34. package/dist/blocks/components/cta-block.d.ts +12 -0
  35. package/dist/blocks/components/cta-block.jsx +69 -0
  36. package/dist/blocks/components/enh-heading-block.d.ts +7 -0
  37. package/dist/blocks/components/enh-heading-block.jsx +142 -0
  38. package/dist/blocks/components/grid-block/grid-block-mutator.d.ts +5 -0
  39. package/dist/blocks/components/grid-block/grid-block-mutator.js +1 -0
  40. package/dist/blocks/components/grid-block/index.d.ts +9 -0
  41. package/dist/blocks/components/grid-block/index.jsx +56 -0
  42. package/dist/blocks/components/grid-block/mutator-registry.d.ts +3 -0
  43. package/dist/blocks/components/grid-block/mutator-registry.js +5 -0
  44. package/dist/blocks/components/grid-block/table-borders.mutator.d.ts +3 -0
  45. package/dist/blocks/components/grid-block/table-borders.mutator.js +36 -0
  46. package/dist/blocks/components/group-block.d.ts +7 -0
  47. package/dist/blocks/components/group-block.jsx +61 -0
  48. package/dist/blocks/components/heading-block.d.ts +4 -0
  49. package/dist/blocks/components/heading-block.jsx +99 -0
  50. package/dist/blocks/components/image-block.d.ts +7 -0
  51. package/dist/blocks/components/image-block.jsx +69 -0
  52. package/dist/blocks/components/index.d.ts +14 -0
  53. package/dist/blocks/components/index.js +13 -0
  54. package/dist/blocks/components/screenful-block/content.d.ts +8 -0
  55. package/dist/blocks/components/screenful-block/content.jsx +71 -0
  56. package/dist/blocks/components/screenful-block/index.d.ts +12 -0
  57. package/dist/blocks/components/screenful-block/index.jsx +57 -0
  58. package/dist/blocks/components/screenful-block/poster-background.d.ts +7 -0
  59. package/dist/blocks/components/screenful-block/poster-background.jsx +14 -0
  60. package/dist/blocks/components/screenful-block/video-background.d.ts +8 -0
  61. package/dist/blocks/components/screenful-block/video-background.jsx +20 -0
  62. package/dist/blocks/components/space-block.d.ts +4 -0
  63. package/dist/blocks/components/space-block.jsx +42 -0
  64. package/dist/blocks/components/video-block.d.ts +9 -0
  65. package/dist/blocks/components/video-block.jsx +83 -0
  66. package/dist/blocks/def/accordian-block.d.ts +10 -0
  67. package/dist/blocks/def/accordian-block.js +2 -0
  68. package/dist/blocks/def/block.d.ts +4 -0
  69. package/dist/blocks/def/block.js +1 -0
  70. package/dist/blocks/def/bullet-cards-block.d.ts +17 -0
  71. package/dist/blocks/def/bullet-cards-block.js +1 -0
  72. package/dist/blocks/def/card-block.d.ts +17 -0
  73. package/dist/blocks/def/card-block.js +2 -0
  74. package/dist/blocks/def/carte-blanche-block.d.ts +12 -0
  75. package/dist/blocks/def/carte-blanche-block.js +1 -0
  76. package/dist/blocks/def/cta-block.d.ts +8 -0
  77. package/dist/blocks/def/cta-block.js +1 -0
  78. package/dist/blocks/def/element-block.d.ts +7 -0
  79. package/dist/blocks/def/element-block.js +2 -0
  80. package/dist/blocks/def/enh-heading-block.d.ts +22 -0
  81. package/dist/blocks/def/enh-heading-block.js +1 -0
  82. package/dist/blocks/def/grid-block.d.ts +12 -0
  83. package/dist/blocks/def/grid-block.js +1 -0
  84. package/dist/blocks/def/group-block.d.ts +7 -0
  85. package/dist/blocks/def/group-block.js +1 -0
  86. package/dist/blocks/def/heading-block.d.ts +11 -0
  87. package/dist/blocks/def/heading-block.js +1 -0
  88. package/dist/blocks/def/image-block.d.ts +26 -0
  89. package/dist/blocks/def/image-block.js +1 -0
  90. package/dist/blocks/def/index.d.ts +17 -0
  91. package/dist/blocks/def/index.js +2 -0
  92. package/dist/blocks/def/screenful-block.d.ts +41 -0
  93. package/dist/blocks/def/screenful-block.js +1 -0
  94. package/dist/blocks/def/space-block.d.ts +47 -0
  95. package/dist/blocks/def/space-block.js +8 -0
  96. package/dist/blocks/def/video-block.d.ts +5 -0
  97. package/dist/blocks/def/video-block.js +1 -0
  98. package/dist/blocks/index.d.ts +2 -0
  99. package/dist/blocks/index.js +2 -0
  100. package/dist/mcp/enhanced-server.d.ts +29 -0
  101. package/dist/mcp/enhanced-server.js +1128 -0
  102. package/dist/mcp/index.d.ts +28 -0
  103. package/dist/mcp/index.js +436 -0
  104. package/dist/primitives/accordion.d.ts +10 -0
  105. package/dist/primitives/accordion.jsx +21 -0
  106. package/dist/primitives/action-button.d.ts +9 -0
  107. package/dist/primitives/action-button.jsx +16 -0
  108. package/dist/primitives/apply-typography.d.ts +7 -0
  109. package/dist/primitives/apply-typography.jsx +38 -0
  110. package/dist/primitives/aspect-ratio.d.ts +3 -0
  111. package/dist/primitives/aspect-ratio.jsx +4 -0
  112. package/dist/primitives/avatar.d.ts +6 -0
  113. package/dist/primitives/avatar.jsx +11 -0
  114. package/dist/primitives/badge.d.ts +9 -0
  115. package/dist/primitives/badge.jsx +18 -0
  116. package/dist/primitives/breadcrumb.d.ts +19 -0
  117. package/dist/primitives/breadcrumb.jsx +27 -0
  118. package/dist/primitives/breakpoint-indicator.d.ts +3 -0
  119. package/dist/primitives/breakpoint-indicator.jsx +14 -0
  120. package/dist/primitives/button.d.ts +12 -0
  121. package/dist/primitives/button.jsx +55 -0
  122. package/dist/primitives/calendar.d.ts +8 -0
  123. package/dist/primitives/calendar.jsx +40 -0
  124. package/dist/primitives/card.d.ts +8 -0
  125. package/dist/primitives/card.jsx +18 -0
  126. package/dist/primitives/carousel.d.ts +18 -0
  127. package/dist/primitives/carousel.jsx +106 -0
  128. package/dist/primitives/checkbox.d.ts +4 -0
  129. package/dist/primitives/checkbox.jsx +15 -0
  130. package/dist/primitives/combobox.d.ts +41 -0
  131. package/dist/primitives/combobox.jsx +77 -0
  132. package/dist/primitives/command.d.ts +17 -0
  133. package/dist/primitives/command.jsx +38 -0
  134. package/dist/primitives/context-menu.d.ts +27 -0
  135. package/dist/primitives/context-menu.jsx +57 -0
  136. package/dist/primitives/dialog-video-controller.d.ts +3 -0
  137. package/dist/primitives/dialog-video-controller.jsx +24 -0
  138. package/dist/primitives/dialog.d.ts +28 -0
  139. package/dist/primitives/dialog.jsx +37 -0
  140. package/dist/primitives/drawer.d.ts +29 -0
  141. package/dist/primitives/drawer.jsx +34 -0
  142. package/dist/primitives/form.d.ts +12 -0
  143. package/dist/primitives/form.jsx +69 -0
  144. package/dist/primitives/icons/github.d.ts +4 -0
  145. package/dist/primitives/icons/github.jsx +6 -0
  146. package/dist/primitives/icons/index.d.ts +4 -0
  147. package/dist/primitives/icons/index.js +4 -0
  148. package/dist/primitives/icons/youtube-logo.d.ts +4 -0
  149. package/dist/primitives/icons/youtube-logo.jsx +39 -0
  150. package/dist/primitives/index-common.d.ts +47 -0
  151. package/dist/primitives/index-common.js +46 -0
  152. package/dist/primitives/index-next.d.ts +2 -0
  153. package/dist/primitives/index-next.js +2 -0
  154. package/dist/primitives/input-otp.d.ts +7 -0
  155. package/dist/primitives/input-otp.jsx +24 -0
  156. package/dist/primitives/input.d.ts +5 -0
  157. package/dist/primitives/input.jsx +11 -0
  158. package/dist/primitives/label.d.ts +5 -0
  159. package/dist/primitives/label.jsx +11 -0
  160. package/dist/primitives/list-adaptor.d.ts +9 -0
  161. package/dist/primitives/list-adaptor.js +1 -0
  162. package/dist/primitives/list-box.d.ts +10 -0
  163. package/dist/primitives/list-box.jsx +14 -0
  164. package/dist/primitives/loading-spinner.d.ts +5 -0
  165. package/dist/primitives/loading-spinner.jsx +8 -0
  166. package/dist/primitives/navigation-menu.d.ts +12 -0
  167. package/dist/primitives/navigation-menu.jsx +38 -0
  168. package/dist/primitives/next/image.d.ts +11 -0
  169. package/dist/primitives/next/image.jsx +42 -0
  170. package/dist/primitives/next/index.d.ts +7 -0
  171. package/dist/primitives/next/index.js +7 -0
  172. package/dist/primitives/next/inline-icon.d.ts +13 -0
  173. package/dist/primitives/next/inline-icon.jsx +15 -0
  174. package/dist/primitives/next/link-element.d.ts +23 -0
  175. package/dist/primitives/next/link-element.jsx +56 -0
  176. package/dist/primitives/next/mdx-link.d.ts +3 -0
  177. package/dist/primitives/next/mdx-link.jsx +12 -0
  178. package/dist/primitives/next/media-stack.d.ts +8 -0
  179. package/dist/primitives/next/media-stack.jsx +28 -0
  180. package/dist/primitives/next/nav-items.d.ts +10 -0
  181. package/dist/primitives/next/nav-items.jsx +24 -0
  182. package/dist/primitives/next/youtube-embed.d.ts +11 -0
  183. package/dist/primitives/next/youtube-embed.jsx +23 -0
  184. package/dist/primitives/popover.d.ts +9 -0
  185. package/dist/primitives/popover.jsx +18 -0
  186. package/dist/primitives/progress.d.ts +4 -0
  187. package/dist/primitives/progress.jsx +9 -0
  188. package/dist/primitives/radio-group.d.ts +7 -0
  189. package/dist/primitives/radio-group.jsx +18 -0
  190. package/dist/primitives/scroll-area.d.ts +5 -0
  191. package/dist/primitives/scroll-area.jsx +19 -0
  192. package/dist/primitives/select.d.ts +13 -0
  193. package/dist/primitives/select.jsx +62 -0
  194. package/dist/primitives/separator.d.ts +4 -0
  195. package/dist/primitives/separator.jsx +7 -0
  196. package/dist/primitives/sheet.d.ts +30 -0
  197. package/dist/primitives/sheet.jsx +56 -0
  198. package/dist/primitives/skeleton.d.ts +4 -0
  199. package/dist/primitives/skeleton.jsx +3 -0
  200. package/dist/primitives/slider.d.ts +9 -0
  201. package/dist/primitives/slider.jsx +30 -0
  202. package/dist/primitives/sonner.d.ts +5 -0
  203. package/dist/primitives/sonner.jsx +16 -0
  204. package/dist/primitives/step-indicator.d.ts +9 -0
  205. package/dist/primitives/step-indicator.jsx +23 -0
  206. package/dist/primitives/switch.d.ts +6 -0
  207. package/dist/primitives/switch.jsx +14 -0
  208. package/dist/primitives/table.d.ts +10 -0
  209. package/dist/primitives/table.jsx +21 -0
  210. package/dist/primitives/tabs.d.ts +7 -0
  211. package/dist/primitives/tabs.jsx +18 -0
  212. package/dist/primitives/text-area.d.ts +5 -0
  213. package/dist/primitives/text-area.jsx +9 -0
  214. package/dist/primitives/toggle-group.d.ts +14 -0
  215. package/dist/primitives/toggle-group.jsx +28 -0
  216. package/dist/primitives/toggle.d.ts +14 -0
  217. package/dist/primitives/toggle.jsx +52 -0
  218. package/dist/primitives/tooltip.d.ts +11 -0
  219. package/dist/primitives/tooltip.jsx +18 -0
  220. package/dist/primitives/video-player.d.ts +6 -0
  221. package/dist/primitives/video-player.jsx +8 -0
  222. package/dist/registry/api.d.ts +37 -0
  223. package/dist/registry/api.js +130 -0
  224. package/dist/registry/index.d.ts +9 -0
  225. package/dist/registry/index.js +45 -0
  226. package/dist/style/theme-provider.d.ts +4 -0
  227. package/dist/style/theme-provider.jsx +11 -0
  228. package/dist/tailwind/fontFamily.tailwind.d.ts +8 -0
  229. package/dist/tailwind/fontFamily.tailwind.js +7 -0
  230. package/dist/tailwind/fontSize.tailwind.d.ts +36 -0
  231. package/dist/tailwind/fontSize.tailwind.js +13 -0
  232. package/dist/tailwind/index.d.ts +3 -0
  233. package/dist/tailwind/index.js +2 -0
  234. package/dist/tailwind/screens.tailwind.d.ts +9 -0
  235. package/dist/tailwind/screens.tailwind.js +8 -0
  236. package/dist/tailwind/tw-font-desc.d.ts +6 -0
  237. package/dist/tailwind/tw-font-desc.js +6 -0
  238. package/dist/types/animation-def.d.ts +2 -0
  239. package/dist/types/animation-def.js +1 -0
  240. package/dist/types/breakpoints.d.ts +4 -0
  241. package/dist/types/breakpoints.js +4 -0
  242. package/dist/types/bullet-item.d.ts +6 -0
  243. package/dist/types/bullet-item.js +2 -0
  244. package/dist/types/button-def.d.ts +29 -0
  245. package/dist/types/button-def.js +2 -0
  246. package/dist/types/dimensions.d.ts +5 -0
  247. package/dist/types/dimensions.js +1 -0
  248. package/dist/types/grid-def.d.ts +36 -0
  249. package/dist/types/grid-def.js +33 -0
  250. package/dist/types/image-def.d.ts +27 -0
  251. package/dist/types/image-def.js +1 -0
  252. package/dist/types/index.d.ts +13 -0
  253. package/dist/types/index.js +2 -0
  254. package/dist/types/link-def.d.ts +44 -0
  255. package/dist/types/link-def.js +1 -0
  256. package/dist/types/media-stack-def.d.ts +25 -0
  257. package/dist/types/media-stack-def.js +1 -0
  258. package/dist/types/t-shirt-size.d.ts +2 -0
  259. package/dist/types/t-shirt-size.js +1 -0
  260. package/dist/types/tshirt-dimensions.d.ts +12 -0
  261. package/dist/types/tshirt-dimensions.js +1 -0
  262. package/dist/types/video-def.d.ts +9 -0
  263. package/dist/types/video-def.js +1 -0
  264. package/dist/util/format-and-abbreviate-as-currency.d.ts +11 -0
  265. package/dist/util/format-and-abbreviate-as-currency.js +91 -0
  266. package/dist/util/format-to-max-char.d.ts +5 -0
  267. package/dist/util/format-to-max-char.js +57 -0
  268. package/dist/util/index-client.d.ts +2 -0
  269. package/dist/util/index-client.js +3 -0
  270. package/dist/util/index.d.ts +17 -0
  271. package/dist/util/index.js +41 -0
  272. package/dist/util/number-abbreviate.d.ts +9 -0
  273. package/dist/util/number-abbreviate.js +30 -0
  274. package/dist/util/specifier.d.ts +7 -0
  275. package/dist/util/specifier.js +31 -0
  276. package/dist/util/spread-to-transform.d.ts +7 -0
  277. package/dist/util/spread-to-transform.js +18 -0
  278. package/dist/util/step-animation.d.ts +5 -0
  279. package/dist/util/step-animation.js +60 -0
  280. package/dist/util/two-way-map.d.ts +8 -0
  281. package/dist/util/two-way-map.js +16 -0
  282. package/mcp/README.md +141 -0
  283. package/mcp/enhanced-server.ts +1208 -0
  284. package/mcp/index.ts +518 -0
  285. package/mcp/package.json +10 -0
  286. package/package.json +24 -4
  287. package/primitives/accordion.tsx +5 -5
  288. package/primitives/button.tsx +6 -3
  289. package/primitives/dialog.tsx +12 -7
  290. package/primitives/next/inline-icon.tsx +2 -3
  291. package/primitives/next/link-element.tsx +2 -2
  292. package/primitives/tabs.tsx +1 -1
  293. package/primitives/tooltip.tsx +1 -1
  294. package/public/r/accordion.json +11 -0
  295. package/public/r/alert.json +11 -0
  296. package/public/r/avatar.json +11 -0
  297. package/public/r/badge.json +11 -0
  298. package/public/r/button.json +11 -0
  299. package/public/r/card.json +11 -0
  300. package/public/r/checkbox.json +11 -0
  301. package/public/r/default.json +6 -0
  302. package/public/r/dialog.json +11 -0
  303. package/public/r/input.json +11 -0
  304. package/public/r/label.json +11 -0
  305. package/public/r/new-york.json +6 -0
  306. package/public/r/popover.json +11 -0
  307. package/public/r/select.json +11 -0
  308. package/public/r/table.json +11 -0
  309. package/public/r/tabs.json +11 -0
  310. package/public/r/toast.json +11 -0
  311. package/registry/api.ts +164 -0
  312. package/registry/index.ts +60 -0
  313. package/registry/package.json +10 -0
  314. package/registry.json +184 -0
  315. package/tailwind/typography-test.mdx +0 -1
  316. package/test/test-registry.js +73 -0
  317. package/tsconfig.json +8 -1
  318. package/types/bullet-item.ts +2 -2
  319. package/types/index.ts +0 -1
  320. package/types/link-def.ts +8 -14
  321. package/types/icon.ts +0 -10
@@ -0,0 +1,45 @@
1
+ import { z } from "zod";
2
+ // Define the file schema to match shadcn/ui's format
3
+ export const fileSchema = z.object({
4
+ path: z.string(),
5
+ content: z.string().optional(),
6
+ type: z.string(),
7
+ target: z.string().optional(),
8
+ });
9
+ // Registry item schema aligned with shadcn/ui format
10
+ export const registryItemSchema = z.object({
11
+ name: z.string(),
12
+ type: z.string(),
13
+ description: z.string().optional(),
14
+ author: z.string().optional(),
15
+ dependencies: z.array(z.string()).optional(),
16
+ devDependencies: z.array(z.string()).optional(),
17
+ registryDependencies: z.array(z.string()).optional(),
18
+ files: z.array(fileSchema).optional(),
19
+ meta: z.record(z.any()).optional(),
20
+ title: z.string().optional(),
21
+ cssVars: z.record(z.any()).optional(),
22
+ tailwind: z.record(z.any()).optional(),
23
+ category: z.string().optional(),
24
+ subcategory: z.string().optional(),
25
+ });
26
+ // Registry schema aligned with shadcn/ui format
27
+ export const registrySchema = z.object({
28
+ $schema: z.string().optional(),
29
+ name: z.string(),
30
+ homepage: z.string().optional(),
31
+ style: z.string().optional(),
32
+ items: z.array(registryItemSchema),
33
+ });
34
+ // Schema for a registry with full content
35
+ export const registryWithContentSchema = registrySchema.extend({
36
+ items: z.array(registryItemSchema.extend({
37
+ files: z.array(fileSchema.extend({
38
+ content: z.string(),
39
+ })),
40
+ })),
41
+ });
42
+ // Support CommonJS
43
+ if (typeof module !== 'undefined') {
44
+ module.exports = { fileSchema, registryItemSchema, registrySchema, registryWithContentSchema };
45
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { type ThemeProviderProps } from "next-themes/dist/types";
3
+ declare const ThemeProvider: React.FC<ThemeProviderProps>;
4
+ export default ThemeProvider;
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import React from "react";
3
+ import { ThemeProvider as NextThemesProvider } from "next-themes";
4
+ import {} from "next-themes/dist/types";
5
+ const ThemeProvider = ({ children, ...props }) => (<NextThemesProvider attribute="class" {...props} value={{
6
+ light: 'hanzo-ui-light-theme',
7
+ dark: 'hanzo-ui-dark-theme'
8
+ }}>
9
+ {children}
10
+ </NextThemesProvider>);
11
+ export default ThemeProvider;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ sans: string[];
3
+ heading: string[];
4
+ nav: string[];
5
+ serif: string[];
6
+ mono: string[];
7
+ };
8
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export default {
2
+ sans: ['sans-serif'],
3
+ heading: ['serif'],
4
+ nav: ['serif'],
5
+ serif: ['serif'],
6
+ mono: ['monospace']
7
+ };
@@ -0,0 +1,36 @@
1
+ declare const _default: {
2
+ xxs: (string | {
3
+ lineHeight: string;
4
+ })[];
5
+ xs: (string | {
6
+ lineHeight: string;
7
+ })[];
8
+ sm: (string | {
9
+ lineHeight: string;
10
+ })[];
11
+ base: (string | {
12
+ lineHeight: number;
13
+ })[];
14
+ lg: (string | {
15
+ lineHeight: string;
16
+ })[];
17
+ xl: (string | {
18
+ lineHeight: string;
19
+ })[];
20
+ '2xl': (string | {
21
+ lineHeight: string;
22
+ })[];
23
+ '3xl': (string | {
24
+ lineHeight: string;
25
+ })[];
26
+ '4xl': (string | {
27
+ lineHeight: string;
28
+ })[];
29
+ '5xl': (string | {
30
+ lineHeight: string;
31
+ })[];
32
+ '6xl': (string | {
33
+ lineHeight: string;
34
+ })[];
35
+ };
36
+ export default _default;
@@ -0,0 +1,13 @@
1
+ export default {
2
+ xxs: ['0.65rem', { lineHeight: '0.8rem' }], // very fine print
3
+ xs: ['0.8rem', { lineHeight: '1rem' }], // fine print
4
+ sm: ['0.9rem', { lineHeight: '1.2rem' }], // 'standard' some news article cards (set manually when using typography-sm)
5
+ base: ['1rem', { lineHeight: 1.4 }],
6
+ lg: ['1.125rem', { lineHeight: '1.75rem' }],
7
+ xl: ['1.25rem', { lineHeight: '1.75rem' }],
8
+ '2xl': ['1.5rem', { lineHeight: '2rem' }],
9
+ '3xl': ['1.875rem', { lineHeight: '2.25rem' }],
10
+ '4xl': ['2.25rem', { lineHeight: '2.5rem' }],
11
+ '5xl': ['3rem', { lineHeight: '1' }],
12
+ '6xl': ['3.75rem', { lineHeight: '1' }],
13
+ };
@@ -0,0 +1,3 @@
1
+ import preset from './tailwind.config.hanzo-preset';
2
+ import type TwFontDesc from './tw-font-desc';
3
+ export { preset, type TwFontDesc };
@@ -0,0 +1,2 @@
1
+ import preset from './tailwind.config.hanzo-preset';
2
+ export { preset };
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ xs: string;
3
+ sm: string;
4
+ md: string;
5
+ lg: string;
6
+ xl: string;
7
+ '2xl': string;
8
+ };
9
+ export default _default;
@@ -0,0 +1,8 @@
1
+ export default {
2
+ xs: '0px', // <-- phone
3
+ sm: '480px', // phone --><-- sm tablets / narrow
4
+ md: '768px', // sm tablets / narrow -->
5
+ lg: '1024px',
6
+ xl: '1280px',
7
+ '2xl': '1500px',
8
+ };
@@ -0,0 +1,6 @@
1
+ interface TwFontDesc {
2
+ twName: string;
3
+ cssVar?: string;
4
+ fontFamily: string[];
5
+ }
6
+ export { type TwFontDesc as default };
@@ -0,0 +1,6 @@
1
+ /*
2
+ NextFontDesc and TwFontDesc have to be seperate because they are needed
3
+ at different times during the next compile / build. Otherwise a nasty
4
+ race condition happens! That's why they are in different files.
5
+ */
6
+ export {};
@@ -0,0 +1,2 @@
1
+ type AnimationDef = string;
2
+ export { type AnimationDef as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import bps from '../tailwind/screens.tailwind';
2
+ type Breakpoint = keyof typeof bps;
3
+ declare const Breakpoints: string[];
4
+ export { Breakpoints, type Breakpoint };
@@ -0,0 +1,4 @@
1
+ // @ts-nocheck
2
+ import bps from '../tailwind/screens.tailwind';
3
+ const Breakpoints = Object.keys(bps);
4
+ export { Breakpoints };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface BulletItem {
3
+ text: string;
4
+ icon?: React.ReactNode;
5
+ }
6
+ export { type BulletItem as default };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export {};
@@ -0,0 +1,29 @@
1
+ import { type ButtonProps } from '../primitives/button';
2
+ type SubmitServerAction = (data: any, enclosure?: any) => Promise<any>;
3
+ interface ButtonModalProps {
4
+ open: boolean;
5
+ onOpenChange: (b: boolean) => void;
6
+ buttonText: string;
7
+ buttonProps: ButtonProps;
8
+ title: string;
9
+ byline?: string;
10
+ action: SubmitServerAction;
11
+ actionEnclosure?: any;
12
+ }
13
+ interface ButtonModalDef {
14
+ Comp: React.ComponentType<ButtonModalProps>;
15
+ title: string;
16
+ props?: any;
17
+ byline?: string;
18
+ action?: SubmitServerAction;
19
+ actionEnclosure?: any;
20
+ }
21
+ interface ButtonDef {
22
+ text: string;
23
+ props: ButtonProps;
24
+ action: {
25
+ type: 'modal';
26
+ def: ButtonModalDef;
27
+ };
28
+ }
29
+ export { type ButtonDef, type SubmitServerAction, type ButtonModalProps, type ButtonModalDef, };
@@ -0,0 +1,2 @@
1
+ import {} from '../primitives/button';
2
+ export {};
@@ -0,0 +1,5 @@
1
+ interface Dimensions {
2
+ w: number;
3
+ h: number;
4
+ }
5
+ export { type Dimensions as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ import type { Breakpoint } from './breakpoints';
2
+ type GridColumnSpec = number | {
3
+ columns: number;
4
+ gap: number;
5
+ };
6
+ interface GridDef {
7
+ /** Must define in ACCENDING order. */
8
+ at: {
9
+ [key in (Breakpoint)]?: GridColumnSpec;
10
+ };
11
+ mobile?: GridColumnSpec;
12
+ }
13
+ declare const COMMON_GRID_1_COL: {
14
+ at: {
15
+ xs: {
16
+ columns: number;
17
+ gap: number;
18
+ };
19
+ md: {
20
+ columns: number;
21
+ gap: number;
22
+ };
23
+ lg: {
24
+ columns: number;
25
+ gap: number;
26
+ };
27
+ };
28
+ mobile: {
29
+ columns: number;
30
+ gap: number;
31
+ };
32
+ };
33
+ declare const COMMON_GRID_2_COL: GridDef;
34
+ declare const COMMON_GRID_3_COL: GridDef;
35
+ declare const COMMON_GRID_4_COL: GridDef;
36
+ export { type GridDef as default, type GridColumnSpec, COMMON_GRID_1_COL, COMMON_GRID_2_COL, COMMON_GRID_3_COL, COMMON_GRID_4_COL };
@@ -0,0 +1,33 @@
1
+ const COMMON_GRID_1_COL = {
2
+ at: {
3
+ xs: { columns: 1, gap: 2 },
4
+ md: { columns: 1, gap: 3 },
5
+ lg: { columns: 1, gap: 6 }
6
+ },
7
+ mobile: { columns: 1, gap: 2 }
8
+ };
9
+ const COMMON_GRID_2_COL = {
10
+ at: {
11
+ xs: { columns: 1, gap: 2 },
12
+ md: { columns: 2, gap: 3 },
13
+ lg: { columns: 2, gap: 6 }
14
+ },
15
+ mobile: { columns: 1, gap: 2 }
16
+ };
17
+ const COMMON_GRID_3_COL = {
18
+ at: {
19
+ xs: { columns: 1, gap: 2 },
20
+ md: { columns: 3, gap: 3 },
21
+ lg: { columns: 3, gap: 6 }
22
+ },
23
+ mobile: { columns: 1, gap: 2 }
24
+ };
25
+ const COMMON_GRID_4_COL = {
26
+ at: {
27
+ xs: { columns: 1, gap: 2 },
28
+ md: { columns: 2, gap: 3 },
29
+ lg: { columns: 4, gap: 6 }
30
+ },
31
+ mobile: { columns: 1, gap: 2 }
32
+ };
33
+ export { COMMON_GRID_1_COL, COMMON_GRID_2_COL, COMMON_GRID_3_COL, COMMON_GRID_4_COL };
@@ -0,0 +1,27 @@
1
+ import type Dimensions from './dimensions';
2
+ /**
3
+ * Defines a in image to render.
4
+ * ImageDef is part of {@link LinkDef}
5
+ */
6
+ interface ImageDef {
7
+ /** image url */
8
+ src: string;
9
+ /** defaults to short filename */
10
+ alt?: string;
11
+ /** See next js docs */
12
+ sizes?: string;
13
+ /**
14
+ * Tailwind class for svg files (usually a text-<color>).
15
+ * All affect 'fill' props in the svg file
16
+ * must be set to 'currentColor'.
17
+ */
18
+ svgFillClass?: string;
19
+ /** rendered dim, unless style prop overrides
20
+ * in which case the file resolution should
21
+ * be supplied so that both Next and the browser
22
+ * can determine the aspect ratio
23
+ */
24
+ dim: Dimensions;
25
+ rounded?: string;
26
+ }
27
+ export { type ImageDef as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export type { default as AnimationDef } from './animation-def';
2
+ export { type Breakpoint, Breakpoints } from './breakpoints';
3
+ export type { default as BulletItem } from './bullet-item';
4
+ export type { ButtonDef, SubmitServerAction, ButtonModalProps, ButtonModalDef, } from './button-def';
5
+ export type { default as Dimensions } from './dimensions';
6
+ export type { default as GridDef, GridColumnSpec } from './grid-def';
7
+ export { COMMON_GRID_1_COL, COMMON_GRID_2_COL, COMMON_GRID_3_COL, COMMON_GRID_4_COL } from './grid-def';
8
+ export type { default as ImageDef } from './image-def';
9
+ export type { default as LinkDef } from './link-def';
10
+ export type { default as TShirtDimensions } from './tshirt-dimensions';
11
+ export type { default as TShirtSize } from './t-shirt-size';
12
+ export type { default as VideoDef } from './video-def';
13
+ export type { MediaStackDef, MediaTransform } from './media-stack-def';
@@ -0,0 +1,2 @@
1
+ export { Breakpoints } from './breakpoints';
2
+ export { COMMON_GRID_1_COL, COMMON_GRID_2_COL, COMMON_GRID_3_COL, COMMON_GRID_4_COL } from './grid-def';
@@ -0,0 +1,44 @@
1
+ import type { VariantProps } from 'class-variance-authority';
2
+ import type { buttonVariants } from '../primitives/button';
3
+ /**
4
+ * A Conf object for the LinkElement primitive.
5
+ */
6
+ interface LinkDef extends VariantProps<typeof buttonVariants> {
7
+ /**
8
+ * If the LinkElement is rendered directly and has children,
9
+ * the title, icon, iconAfter fields in the supplied LinkDef
10
+ * will be ignored.
11
+ */
12
+ title?: string;
13
+ /**
14
+ * If the LinkElement is rendered directly and has children,
15
+ * the title, icon, iconAfter fields in the supplied LinkDef
16
+ * will be ignored.
17
+ */
18
+ icon?: React.ReactNode;
19
+ /**
20
+ * If the LinkElement is rendered directly and has children,
21
+ * the title, icon, iconAfter fields in the supplied LinkDef
22
+ * will be ignored.
23
+ */
24
+ iconAfter?: boolean;
25
+ href: string;
26
+ /**
27
+ * External links will open in a new tab (via target='_blank') by default,
28
+ * while internal ones will open in the same tab.
29
+ * @field newTab overrides these defaults in both cases.
30
+ * ('external' means the url starts with 'http')
31
+ */
32
+ newTab?: boolean;
33
+ /**
34
+ * rendered as a disabled link, shows default cursor, and eats pointer events.
35
+ */
36
+ disabled?: boolean;
37
+ /**
38
+ *contents for description link.
39
+ */
40
+ contents?: string;
41
+ childMenu?: LinkDef[];
42
+ groupName?: string;
43
+ }
44
+ export { type LinkDef as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import type AnimationDef from './animation-def';
2
+ import type ImageDef from './image-def';
3
+ import type VideoDef from './video-def';
4
+ /**
5
+ * This will be implemented via css transforms,
6
+ * so will be a subset of those capabilities.
7
+ * Individual transforms will be added as they
8
+ * are needed.
9
+ */
10
+ interface MediaTransform {
11
+ /** (X and Y) or [X, Y] */
12
+ scale?: number | number[];
13
+ }
14
+ interface MediaStackDef {
15
+ img?: ImageDef;
16
+ video?: VideoDef;
17
+ animation?: AnimationDef;
18
+ mediaTransform?: MediaTransform;
19
+ /** prefered order of precedence.
20
+ * If an type is missing, it will not be used.
21
+ * default (inMediaStack component): ['a', 'v', 'i']
22
+ * */
23
+ order?: ('a' | 'v' | 'i')[];
24
+ }
25
+ export type { MediaStackDef, MediaTransform };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ type TShirtSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
2
+ export { type TShirtSize as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ type ConcreteDimensions = {
2
+ w: number;
3
+ h: number;
4
+ };
5
+ type TShirtDimensions = {
6
+ xs?: ConcreteDimensions;
7
+ sm?: ConcreteDimensions;
8
+ md: ConcreteDimensions;
9
+ lg?: ConcreteDimensions;
10
+ xl?: ConcreteDimensions;
11
+ };
12
+ export { type TShirtDimensions as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import type TShirtDimensions from './tshirt-dimensions';
2
+ interface VideoDef {
3
+ videoProps?: any;
4
+ poster?: string;
5
+ sources?: string[];
6
+ dim: TShirtDimensions;
7
+ sizing?: any;
8
+ }
9
+ export { type VideoDef as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { type QuantityAbbrSymbol } from './number-abbreviate';
2
+ interface FormatThreshold {
3
+ from: number;
4
+ use: QuantityAbbrSymbol;
5
+ }
6
+ declare const formatAndAbbreviateAsCurrency: (n: number | null, thresholds?: FormatThreshold[], roundingAdds?: number, maxDecimal?: number) => {
7
+ full: string;
8
+ result: string;
9
+ change: "rounded" | "none" | "abbr" | "empty";
10
+ };
11
+ export { formatAndAbbreviateAsCurrency as default, type FormatThreshold, type QuantityAbbrSymbol };
@@ -0,0 +1,91 @@
1
+ import Abbr, { ABBR_SYMBOLS_ARRAY } from './number-abbreviate';
2
+ const usdFormatter = Intl.NumberFormat('en-US', {
3
+ style: 'currency',
4
+ currency: 'USD',
5
+ minimumFractionDigits: 2,
6
+ });
7
+ const formatAsUSCurrency = (n) => {
8
+ let result = usdFormatter.format(n);
9
+ return result.endsWith('.00') ? result.slice(0, -3) : result;
10
+ };
11
+ const formatAndAbbreviateAsCurrency = (n, thresholds = [{
12
+ from: 1000000000,
13
+ use: 'M'
14
+ }],
15
+ /**
16
+ * Chars that will be added by ui if the number is rounded.
17
+ * For example, if the desired output for 10.15 is "~10.1",
18
+ * the tilda counts as 1 char.
19
+ */
20
+ roundingAdds = 1, maxDecimal = 2) => {
21
+ if (n === null) {
22
+ return {
23
+ full: '',
24
+ result: '',
25
+ change: 'empty'
26
+ };
27
+ }
28
+ const formatted = formatAsUSCurrency(n);
29
+ if (n < thresholds[0].from) {
30
+ return {
31
+ full: formatted,
32
+ result: formatted,
33
+ change: 'none'
34
+ };
35
+ }
36
+ // Get operative FormatThreshold pair...
37
+ let threshold;
38
+ for (let i = 0; i < thresholds.length && n >= thresholds[i].from; threshold = thresholds[i], i++) { }
39
+ // Build up units array to all units
40
+ // up to threshold.use
41
+ const units = [];
42
+ for (let i = 0; i < ABBR_SYMBOLS_ARRAY.length; i++) {
43
+ const current = ABBR_SYMBOLS_ARRAY[i];
44
+ units.push(current);
45
+ if (current === threshold.use) {
46
+ break;
47
+ }
48
+ }
49
+ const abbreviator = new Abbr(units);
50
+ // Use threshold.from as a guide to how many chars are available:
51
+ // first digit + comma = 2
52
+ // Possible trailing cents: '.xx'.length = 3
53
+ // 3 - 2 = 1
54
+ const charsAvail = formatAsUSCurrency(threshold.from).length + 1;
55
+ const abbr = abbreviator.abbreviate(n, charsAvail); // arbitrary, but good approx
56
+ const numStr = abbr.slice(0, -1);
57
+ const abbreviation = abbr.slice(-1);
58
+ const numerical = parseFloat(numStr);
59
+ const integral = Math.floor(numerical);
60
+ const integralString = formatAsUSCurrency(integral);
61
+ const commas = integralString.split(',').length - 1;
62
+ // minus abbr, dec point, dollar sign, and roundingAdds / tilda,
63
+ // (1 + 1 + 1 + roundingAdds)
64
+ // ("precision" does NOT include the decimal point itself,
65
+ // so we have to explicitly factor it in.)
66
+ const roundedString = numerical.toPrecision(charsAvail - commas - (3 + roundingAdds));
67
+ // remove trailing zeros, if any
68
+ const roundedNumerical = parseFloat(roundedString);
69
+ const roundedIntegral = Math.trunc(roundedNumerical);
70
+ const roundedIntegralString = formatAsUSCurrency(roundedIntegral);
71
+ let decimalPortion = roundedNumerical - roundedIntegral;
72
+ let result;
73
+ if (decimalPortion !== 0) {
74
+ // remove trailing zeros if any
75
+ decimalPortion = parseFloat(decimalPortion.toFixed(maxDecimal));
76
+ const decimalPortionString = decimalPortion.toString();
77
+ const afterDecimalString = decimalPortionString.slice(decimalPortionString.indexOf('.') + 1);
78
+ result = roundedIntegralString + '.' + afterDecimalString + abbreviation;
79
+ }
80
+ else {
81
+ result = roundedIntegralString + abbreviation;
82
+ }
83
+ // Did we lose any precision?
84
+ const rounded = (roundedIntegral + decimalPortion !== n);
85
+ return {
86
+ full: formatted,
87
+ result,
88
+ change: rounded ? 'rounded' : 'abbr'
89
+ };
90
+ };
91
+ export { formatAndAbbreviateAsCurrency as default };
@@ -0,0 +1,5 @@
1
+ declare const formatToMaxChar: (n: number | null, maxChars: number, roundingAdds?: number) => {
2
+ result: string;
3
+ change: "rounded" | "none" | "abbr" | "empty";
4
+ };
5
+ export default formatToMaxChar;
@@ -0,0 +1,57 @@
1
+ import Abbr from './number-abbreviate';
2
+ const abbr = new Abbr(['K', 'M', 'B', 'T']);
3
+ const formatToMaxChar = (n, maxChars,
4
+ /**
5
+ * Chars that will be added by ui if the number is rounded.
6
+ * For example, if the desired output for 10.15 is "~10.1",
7
+ * the tilda counts as 1 char.
8
+ */
9
+ roundingAdds = 1) => {
10
+ if (n === null) {
11
+ return {
12
+ result: '',
13
+ change: 'empty'
14
+ };
15
+ }
16
+ const s = n.toString();
17
+ if (s.length > maxChars) {
18
+ // Highest number that can be rounded down to an
19
+ // acceptable string.
20
+ // Decimal point, plus one decimal place = 2 chars
21
+ const cuttoff = Math.pow(10, maxChars - 2 - roundingAdds) - 0.05;
22
+ if (n < cuttoff) {
23
+ const intPortion = Math.floor(n);
24
+ const len = intPortion.toString().length;
25
+ // 1 is for dec point itself
26
+ const availDecimals = maxChars - len - 1 - roundingAdds;
27
+ // removes trailing zeros, if any
28
+ const roundedNumerical = parseFloat(n.toFixed(availDecimals));
29
+ return {
30
+ result: roundedNumerical.toString(),
31
+ change: 'rounded'
32
+ };
33
+ }
34
+ else {
35
+ const str = abbr.abbreviate(n, maxChars);
36
+ const numStr = str.slice(0, -1);
37
+ const abbreviation = str.slice(-1);
38
+ const numerical = parseFloat(numStr);
39
+ // minus abbr, dec point, and roundingAdds / tilda,
40
+ // (1 + 1 + roundingAdds)
41
+ // ("precision" does NOT include the decimal point itself,
42
+ // so we have to explicitly factor it in.)
43
+ const roundedString = numerical.toPrecision(maxChars - (2 + roundingAdds));
44
+ // remove trailing zeros, if any
45
+ const roundedNumerical = parseFloat(roundedString);
46
+ return {
47
+ result: roundedNumerical.toString() + abbreviation,
48
+ change: roundedNumerical === numerical ? 'abbr' : 'rounded'
49
+ };
50
+ }
51
+ }
52
+ return {
53
+ result: s,
54
+ change: 'none'
55
+ };
56
+ };
57
+ export default formatToMaxChar;