@nanisoft/prism-ui 0.10.1 → 0.13.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 (334) hide show
  1. package/LICENSE +21 -21
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/blocks/app-shell-01/app-shell.js +4 -4
  4. package/dist/blocks/app-shell-01/index.d.ts +2 -2
  5. package/dist/blocks/app-shell-01/index.js +1 -1
  6. package/dist/blocks/auth-form-01/auth-form.d.ts +11 -1
  7. package/dist/blocks/auth-form-01/auth-form.d.ts.map +1 -1
  8. package/dist/blocks/auth-form-01/auth-form.js +11 -8
  9. package/dist/blocks/auth-form-01/index.d.ts +2 -2
  10. package/dist/blocks/auth-form-01/index.js +1 -1
  11. package/dist/blocks/cta-01/cta.d.ts +26 -21
  12. package/dist/blocks/cta-01/cta.d.ts.map +1 -1
  13. package/dist/blocks/cta-01/cta.js +2 -2
  14. package/dist/blocks/cta-01/index.d.ts +2 -2
  15. package/dist/blocks/cta-01/index.js +1 -1
  16. package/dist/blocks/data-table-01/data-table.js +7 -7
  17. package/dist/blocks/data-table-01/index.d.ts +2 -2
  18. package/dist/blocks/data-table-01/index.js +1 -1
  19. package/dist/blocks/empty-state-01/empty-state.d.ts +143 -0
  20. package/dist/blocks/empty-state-01/empty-state.d.ts.map +1 -0
  21. package/dist/blocks/empty-state-01/empty-state.js +104 -0
  22. package/dist/blocks/empty-state-01/index.d.ts +3 -0
  23. package/dist/blocks/empty-state-01/index.d.ts.map +1 -0
  24. package/dist/blocks/empty-state-01/index.js +1 -0
  25. package/dist/blocks/feature-grid-01/feature-grid.d.ts +28 -1
  26. package/dist/blocks/feature-grid-01/feature-grid.d.ts.map +1 -1
  27. package/dist/blocks/feature-grid-01/feature-grid.js +34 -3
  28. package/dist/blocks/feature-grid-01/index.d.ts +2 -2
  29. package/dist/blocks/feature-grid-01/index.js +1 -1
  30. package/dist/blocks/hero-01/hero.d.ts +49 -17
  31. package/dist/blocks/hero-01/hero.d.ts.map +1 -1
  32. package/dist/blocks/hero-01/hero.js +14 -9
  33. package/dist/blocks/hero-01/index.d.ts +2 -1
  34. package/dist/blocks/hero-01/index.d.ts.map +1 -1
  35. package/dist/blocks/hero-01/index.js +1 -1
  36. package/dist/blocks/index.d.ts +20 -20
  37. package/dist/blocks/index.js +19 -19
  38. package/dist/blocks/instrument-panel-01/index.d.ts +2 -2
  39. package/dist/blocks/instrument-panel-01/index.js +1 -1
  40. package/dist/blocks/instrument-panel-01/instrument-panel.js +1 -1
  41. package/dist/blocks/logo-strip-01/index.d.ts +2 -2
  42. package/dist/blocks/logo-strip-01/index.js +1 -1
  43. package/dist/blocks/logo-strip-01/logo-strip.d.ts +1 -1
  44. package/dist/blocks/logo-strip-01/logo-strip.js +2 -2
  45. package/dist/blocks/note-grid-01/index.d.ts +2 -2
  46. package/dist/blocks/note-grid-01/index.js +1 -1
  47. package/dist/blocks/note-grid-01/note-grid.d.ts +1 -1
  48. package/dist/blocks/note-grid-01/note-grid.js +1 -1
  49. package/dist/blocks/page-header-01/index.d.ts +2 -2
  50. package/dist/blocks/page-header-01/index.js +1 -1
  51. package/dist/blocks/page-header-01/page-header.d.ts +1 -1
  52. package/dist/blocks/page-header-01/page-header.js +4 -4
  53. package/dist/blocks/pricing-01/index.d.ts +1 -1
  54. package/dist/blocks/pricing-01/index.js +1 -1
  55. package/dist/blocks/pricing-01/pricing.d.ts +8 -1
  56. package/dist/blocks/pricing-01/pricing.d.ts.map +1 -1
  57. package/dist/blocks/pricing-01/pricing.js +15 -5
  58. package/dist/blocks/process-flow-01/index.d.ts +3 -0
  59. package/dist/blocks/process-flow-01/index.d.ts.map +1 -0
  60. package/dist/blocks/process-flow-01/index.js +1 -0
  61. package/dist/blocks/process-flow-01/process-flow.d.ts +118 -0
  62. package/dist/blocks/process-flow-01/process-flow.d.ts.map +1 -0
  63. package/dist/blocks/process-flow-01/process-flow.js +71 -0
  64. package/dist/blocks/process-rail-01/index.d.ts +2 -2
  65. package/dist/blocks/process-rail-01/index.js +1 -1
  66. package/dist/blocks/process-rail-01/process-rail.d.ts +1 -1
  67. package/dist/blocks/process-rail-01/process-rail.js +2 -2
  68. package/dist/blocks/product-grid-01/index.d.ts +2 -2
  69. package/dist/blocks/product-grid-01/index.js +1 -1
  70. package/dist/blocks/product-grid-01/product-grid.d.ts +37 -5
  71. package/dist/blocks/product-grid-01/product-grid.d.ts.map +1 -1
  72. package/dist/blocks/product-grid-01/product-grid.js +20 -6
  73. package/dist/blocks/run-console-01/index.d.ts +3 -0
  74. package/dist/blocks/run-console-01/index.d.ts.map +1 -0
  75. package/dist/blocks/run-console-01/index.js +1 -0
  76. package/dist/blocks/run-console-01/run-console.d.ts +111 -0
  77. package/dist/blocks/run-console-01/run-console.d.ts.map +1 -0
  78. package/dist/blocks/run-console-01/run-console.js +48 -0
  79. package/dist/blocks/settings-panel-01/index.d.ts +2 -2
  80. package/dist/blocks/settings-panel-01/index.js +1 -1
  81. package/dist/blocks/settings-panel-01/settings-panel.d.ts +11 -1
  82. package/dist/blocks/settings-panel-01/settings-panel.d.ts.map +1 -1
  83. package/dist/blocks/settings-panel-01/settings-panel.js +15 -10
  84. package/dist/blocks/site-footer/index.d.ts +2 -2
  85. package/dist/blocks/site-footer/index.js +1 -1
  86. package/dist/blocks/site-footer/site-footer.d.ts +1 -1
  87. package/dist/blocks/site-footer/site-footer.js +2 -2
  88. package/dist/blocks/site-header/index.d.ts +2 -2
  89. package/dist/blocks/site-header/index.js +1 -1
  90. package/dist/blocks/site-header/site-header.d.ts +2 -2
  91. package/dist/blocks/site-header/site-header.js +3 -3
  92. package/dist/blocks/site-navbar/index.d.ts +3 -0
  93. package/dist/blocks/site-navbar/index.d.ts.map +1 -0
  94. package/dist/blocks/site-navbar/index.js +1 -0
  95. package/dist/blocks/site-navbar/mobile-nav.d.ts +48 -0
  96. package/dist/blocks/site-navbar/mobile-nav.d.ts.map +1 -0
  97. package/dist/blocks/site-navbar/mobile-nav.js +35 -0
  98. package/dist/blocks/site-navbar/mode-toggle.d.ts +39 -0
  99. package/dist/blocks/site-navbar/mode-toggle.d.ts.map +1 -0
  100. package/dist/blocks/site-navbar/mode-toggle.js +39 -0
  101. package/dist/blocks/site-navbar/navbar-controls.d.ts +79 -0
  102. package/dist/blocks/site-navbar/navbar-controls.d.ts.map +1 -0
  103. package/dist/blocks/site-navbar/navbar-controls.js +40 -0
  104. package/dist/blocks/site-navbar/search-entry.d.ts +29 -0
  105. package/dist/blocks/site-navbar/search-entry.d.ts.map +1 -0
  106. package/dist/blocks/site-navbar/search-entry.js +52 -0
  107. package/dist/blocks/site-navbar/site-navbar.d.ts +212 -0
  108. package/dist/blocks/site-navbar/site-navbar.d.ts.map +1 -0
  109. package/dist/blocks/site-navbar/site-navbar.js +61 -0
  110. package/dist/blocks/site-navbar/sites-menu.d.ts +40 -0
  111. package/dist/blocks/site-navbar/sites-menu.d.ts.map +1 -0
  112. package/dist/blocks/site-navbar/sites-menu.js +48 -0
  113. package/dist/blocks/site-navbar/theme-menu.d.ts +47 -0
  114. package/dist/blocks/site-navbar/theme-menu.d.ts.map +1 -0
  115. package/dist/blocks/site-navbar/theme-menu.js +55 -0
  116. package/dist/blocks/stack-grid-01/index.d.ts +2 -2
  117. package/dist/blocks/stack-grid-01/index.js +1 -1
  118. package/dist/blocks/stack-grid-01/stack-grid.d.ts +42 -11
  119. package/dist/blocks/stack-grid-01/stack-grid.d.ts.map +1 -1
  120. package/dist/blocks/stack-grid-01/stack-grid.js +15 -7
  121. package/dist/blocks/stats-01/index.d.ts +9 -1
  122. package/dist/blocks/stats-01/index.d.ts.map +1 -1
  123. package/dist/blocks/stats-01/index.js +8 -1
  124. package/dist/blocks/stats-01/stats.d.ts +1 -1
  125. package/dist/blocks/stats-01/stats.js +2 -2
  126. package/dist/blocks/status-ledger-01/index.d.ts +2 -2
  127. package/dist/blocks/status-ledger-01/index.js +1 -1
  128. package/dist/blocks/status-ledger-01/status-ledger.d.ts +1 -1
  129. package/dist/blocks/status-ledger-01/status-ledger.js +2 -2
  130. package/dist/catalog.d.ts +1 -1
  131. package/dist/catalog.d.ts.map +1 -1
  132. package/dist/catalog.js +473 -1
  133. package/dist/components/index.d.ts +104 -66
  134. package/dist/components/index.d.ts.map +1 -1
  135. package/dist/components/index.js +74 -40
  136. package/dist/components/ui/accordion.js +1 -1
  137. package/dist/components/ui/alert-dialog.d.ts +119 -0
  138. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  139. package/dist/components/ui/alert-dialog.js +82 -0
  140. package/dist/components/ui/alert.js +1 -1
  141. package/dist/components/ui/aspect-ratio.d.ts +60 -0
  142. package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
  143. package/dist/components/ui/aspect-ratio.js +61 -0
  144. package/dist/components/ui/avatar.js +1 -1
  145. package/dist/components/ui/badge.js +1 -1
  146. package/dist/components/ui/breadcrumb.js +1 -1
  147. package/dist/components/ui/button-group.d.ts +68 -0
  148. package/dist/components/ui/button-group.d.ts.map +1 -0
  149. package/dist/components/ui/button-group.js +54 -0
  150. package/dist/components/ui/button.js +1 -1
  151. package/dist/components/ui/calendar.d.ts +158 -0
  152. package/dist/components/ui/calendar.d.ts.map +1 -0
  153. package/dist/components/ui/calendar.js +216 -0
  154. package/dist/components/ui/card.d.ts +18 -6
  155. package/dist/components/ui/card.d.ts.map +1 -1
  156. package/dist/components/ui/card.js +23 -8
  157. package/dist/components/ui/carousel.d.ts +118 -0
  158. package/dist/components/ui/carousel.d.ts.map +1 -0
  159. package/dist/components/ui/carousel.js +152 -0
  160. package/dist/components/ui/chart-frame.d.ts +216 -0
  161. package/dist/components/ui/chart-frame.d.ts.map +1 -0
  162. package/dist/components/ui/chart-frame.js +286 -0
  163. package/dist/components/ui/checkbox.js +1 -1
  164. package/dist/components/ui/collapsible.d.ts +97 -0
  165. package/dist/components/ui/collapsible.d.ts.map +1 -0
  166. package/dist/components/ui/collapsible.js +54 -0
  167. package/dist/components/ui/combobox.d.ts +141 -0
  168. package/dist/components/ui/combobox.d.ts.map +1 -0
  169. package/dist/components/ui/combobox.js +243 -0
  170. package/dist/components/ui/command-palette.d.ts +106 -0
  171. package/dist/components/ui/command-palette.d.ts.map +1 -0
  172. package/dist/components/ui/command-palette.js +176 -0
  173. package/dist/components/ui/command.d.ts +82 -0
  174. package/dist/components/ui/command.d.ts.map +1 -0
  175. package/dist/components/ui/command.js +37 -0
  176. package/dist/components/ui/context-menu.d.ts +151 -0
  177. package/dist/components/ui/context-menu.d.ts.map +1 -0
  178. package/dist/components/ui/context-menu.js +97 -0
  179. package/dist/components/ui/cta-link.js +1 -1
  180. package/dist/components/ui/date-picker.d.ts +111 -0
  181. package/dist/components/ui/date-picker.d.ts.map +1 -0
  182. package/dist/components/ui/date-picker.js +74 -0
  183. package/dist/components/ui/diagram.d.ts +84 -15
  184. package/dist/components/ui/diagram.d.ts.map +1 -1
  185. package/dist/components/ui/diagram.js +77 -7
  186. package/dist/components/ui/dialog.js +1 -1
  187. package/dist/components/ui/diff.d.ts +105 -0
  188. package/dist/components/ui/diff.d.ts.map +1 -0
  189. package/dist/components/ui/diff.js +113 -0
  190. package/dist/components/ui/dropdown-menu.d.ts +18 -0
  191. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  192. package/dist/components/ui/dropdown-menu.js +1 -1
  193. package/dist/components/ui/fact-list.js +1 -1
  194. package/dist/components/ui/field.js +1 -1
  195. package/dist/components/ui/form.d.ts +151 -0
  196. package/dist/components/ui/form.d.ts.map +1 -0
  197. package/dist/components/ui/form.js +73 -0
  198. package/dist/components/ui/hover-card.d.ts +105 -0
  199. package/dist/components/ui/hover-card.d.ts.map +1 -0
  200. package/dist/components/ui/hover-card.js +49 -0
  201. package/dist/components/ui/input-group.d.ts +99 -0
  202. package/dist/components/ui/input-group.d.ts.map +1 -0
  203. package/dist/components/ui/input-group.js +83 -0
  204. package/dist/components/ui/input.js +1 -1
  205. package/dist/components/ui/item.d.ts +113 -0
  206. package/dist/components/ui/item.d.ts.map +1 -0
  207. package/dist/components/ui/item.js +61 -0
  208. package/dist/components/ui/kbd.js +1 -1
  209. package/dist/components/ui/label.d.ts +58 -0
  210. package/dist/components/ui/label.d.ts.map +1 -0
  211. package/dist/components/ui/label.js +29 -0
  212. package/dist/components/ui/live-region.d.ts +9 -0
  213. package/dist/components/ui/live-region.d.ts.map +1 -1
  214. package/dist/components/ui/live-region.js +10 -2
  215. package/dist/components/ui/mark.js +1 -1
  216. package/dist/components/ui/menubar.d.ts +197 -0
  217. package/dist/components/ui/menubar.d.ts.map +1 -0
  218. package/dist/components/ui/menubar.js +109 -0
  219. package/dist/components/ui/meter.d.ts +121 -0
  220. package/dist/components/ui/meter.d.ts.map +1 -0
  221. package/dist/components/ui/meter.js +82 -0
  222. package/dist/components/ui/native-select.d.ts +72 -0
  223. package/dist/components/ui/native-select.d.ts.map +1 -0
  224. package/dist/components/ui/native-select.js +55 -0
  225. package/dist/components/ui/navigation-menu.d.ts +186 -0
  226. package/dist/components/ui/navigation-menu.d.ts.map +1 -0
  227. package/dist/components/ui/navigation-menu.js +94 -0
  228. package/dist/components/ui/number-field.d.ts +111 -0
  229. package/dist/components/ui/number-field.d.ts.map +1 -0
  230. package/dist/components/ui/number-field.js +84 -0
  231. package/dist/components/ui/one-time-code.d.ts +127 -0
  232. package/dist/components/ui/one-time-code.d.ts.map +1 -0
  233. package/dist/components/ui/one-time-code.js +57 -0
  234. package/dist/components/ui/pagination.js +1 -1
  235. package/dist/components/ui/popover.js +1 -1
  236. package/dist/components/ui/product-mark.d.ts +1 -1
  237. package/dist/components/ui/product-mark.js +1 -1
  238. package/dist/components/ui/product-switcher.d.ts +1 -1
  239. package/dist/components/ui/product-switcher.js +2 -2
  240. package/dist/components/ui/progress.js +1 -1
  241. package/dist/components/ui/prose.js +1 -1
  242. package/dist/components/ui/pulse-graph.js +1 -1
  243. package/dist/components/ui/pulse-series.js +1 -1
  244. package/dist/components/ui/radio-group.js +1 -1
  245. package/dist/components/ui/resizable.d.ts +129 -0
  246. package/dist/components/ui/resizable.d.ts.map +1 -0
  247. package/dist/components/ui/resizable.js +205 -0
  248. package/dist/components/ui/scroll-area.d.ts +97 -0
  249. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  250. package/dist/components/ui/scroll-area.js +68 -0
  251. package/dist/components/ui/search-dialog.d.ts +139 -0
  252. package/dist/components/ui/search-dialog.d.ts.map +1 -0
  253. package/dist/components/ui/search-dialog.js +178 -0
  254. package/dist/components/ui/section.d.ts +26 -0
  255. package/dist/components/ui/section.d.ts.map +1 -1
  256. package/dist/components/ui/section.js +32 -1
  257. package/dist/components/ui/select.js +1 -1
  258. package/dist/components/ui/separator.js +1 -1
  259. package/dist/components/ui/sheet.d.ts +103 -0
  260. package/dist/components/ui/sheet.d.ts.map +1 -0
  261. package/dist/components/ui/sheet.js +58 -0
  262. package/dist/components/ui/sidebar.d.ts +228 -0
  263. package/dist/components/ui/sidebar.d.ts.map +1 -0
  264. package/dist/components/ui/sidebar.js +172 -0
  265. package/dist/components/ui/signal-field.js +1 -1
  266. package/dist/components/ui/skeleton.js +1 -1
  267. package/dist/components/ui/slider.js +1 -1
  268. package/dist/components/ui/spinner.d.ts +79 -0
  269. package/dist/components/ui/spinner.d.ts.map +1 -0
  270. package/dist/components/ui/spinner.js +79 -0
  271. package/dist/components/ui/switch.js +1 -1
  272. package/dist/components/ui/table-sort.d.ts +97 -0
  273. package/dist/components/ui/table-sort.d.ts.map +1 -0
  274. package/dist/components/ui/table-sort.js +102 -0
  275. package/dist/components/ui/table.js +1 -1
  276. package/dist/components/ui/tabs.js +1 -1
  277. package/dist/components/ui/textarea.js +1 -1
  278. package/dist/components/ui/timeline.d.ts +106 -0
  279. package/dist/components/ui/timeline.d.ts.map +1 -0
  280. package/dist/components/ui/timeline.js +111 -0
  281. package/dist/components/ui/toast.d.ts +219 -0
  282. package/dist/components/ui/toast.d.ts.map +1 -0
  283. package/dist/components/ui/toast.js +270 -0
  284. package/dist/components/ui/toggle-group.d.ts +118 -0
  285. package/dist/components/ui/toggle-group.d.ts.map +1 -0
  286. package/dist/components/ui/toggle-group.js +194 -0
  287. package/dist/components/ui/toggle.d.ts +73 -0
  288. package/dist/components/ui/toggle.d.ts.map +1 -0
  289. package/dist/components/ui/toggle.js +44 -0
  290. package/dist/components/ui/tooltip.js +1 -1
  291. package/dist/components/ui/tree.js +1 -1
  292. package/dist/components/ui/typography.js +1 -1
  293. package/dist/fonts/Inter-OFL.txt +93 -93
  294. package/dist/index.d.ts +72 -70
  295. package/dist/index.d.ts.map +1 -1
  296. package/dist/index.js +61 -60
  297. package/dist/lib/rank.d.ts +69 -0
  298. package/dist/lib/rank.d.ts.map +1 -0
  299. package/dist/lib/rank.js +77 -0
  300. package/dist/live/index.d.ts +22 -0
  301. package/dist/live/index.d.ts.map +1 -0
  302. package/dist/live/index.js +20 -0
  303. package/dist/live/run-stream-01/index.d.ts +3 -0
  304. package/dist/live/run-stream-01/index.d.ts.map +1 -0
  305. package/dist/live/run-stream-01/index.js +1 -0
  306. package/dist/live/run-stream-01/run-stream.d.ts +125 -0
  307. package/dist/live/run-stream-01/run-stream.d.ts.map +1 -0
  308. package/dist/live/run-stream-01/run-stream.js +111 -0
  309. package/dist/pages/auth-page/index.d.ts +15 -2
  310. package/dist/pages/auth-page/index.d.ts.map +1 -1
  311. package/dist/pages/auth-page/index.js +8 -4
  312. package/dist/pages/blog-post-page/index.js +5 -5
  313. package/dist/pages/dashboard-page/index.d.ts +4 -4
  314. package/dist/pages/dashboard-page/index.js +4 -4
  315. package/dist/pages/docs-shell/docs-shell.d.ts +37 -4
  316. package/dist/pages/docs-shell/docs-shell.d.ts.map +1 -1
  317. package/dist/pages/docs-shell/docs-shell.js +107 -16
  318. package/dist/pages/docs-shell/index.d.ts +2 -2
  319. package/dist/pages/docs-shell/index.js +1 -1
  320. package/dist/pages/index.d.ts +14 -14
  321. package/dist/pages/index.js +7 -7
  322. package/dist/pages/marketing-page/index.d.ts +6 -6
  323. package/dist/pages/marketing-page/index.js +5 -5
  324. package/dist/pages/not-found-page/index.js +4 -4
  325. package/dist/pages/settings-page/index.d.ts +3 -3
  326. package/dist/pages/settings-page/index.js +4 -4
  327. package/dist/provider/index.d.ts +4 -4
  328. package/dist/provider/index.js +2 -2
  329. package/dist/provider/provider.d.ts +1 -1
  330. package/dist/provider/provider.js +1 -1
  331. package/dist/provider/theme-script.d.ts +1 -1
  332. package/dist/provider/theme-script.js +1 -1
  333. package/dist/styles.css +689 -0
  334. package/package.json +9 -1
@@ -0,0 +1,194 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Children, createContext, useContext, useMemo, useRef, useState, } from 'react';
4
+ import { cn } from '../../lib/utils.js';
5
+ const ToggleGroupContext = createContext(null);
6
+ /** The keys that move a member, read from the group's own orientation. */
7
+ const FORWARD = {
8
+ horizontal: ['ArrowRight'],
9
+ vertical: ['ArrowDown'],
10
+ };
11
+ const BACKWARD = {
12
+ horizontal: ['ArrowLeft'],
13
+ vertical: ['ArrowUp'],
14
+ };
15
+ /**
16
+ * A set of toggles that behave as one control.
17
+ *
18
+ * **The single or multiple decision is the caller's, and it changes what the
19
+ * group is rather than how it looks.** This is the decision worth stating because
20
+ * getting it wrong is the usual failure, and it is invisible in a screenshot: two
21
+ * groups of three buttons, one where at most one is pressed and one where any
22
+ * number are, look identical until you read the roles.
23
+ *
24
+ * In `single` mode the group is a **radiogroup** and its members are **radios**
25
+ * carrying `aria-checked`. That is not a stylistic preference, it is the only
26
+ * description of the constraint that is true. The choices are mutually exclusive,
27
+ * there is exactly one answer, and the whole set is one question rather than three
28
+ * independent facts. Three buttons carrying `aria-pressed` say three independent
29
+ * things can be on at once, which is a lie, and a reader of the accessibility tree
30
+ * is left to infer the constraint from nothing.
31
+ *
32
+ * In `multiple` mode the group is a **toolbar** and its members are **pressed
33
+ * buttons** carrying `aria-pressed`, and the arrow keys move focus without
34
+ * choosing. That is the right behaviour for a toolbar of independent toggles,
35
+ * where arrowing past a member must not silently turn it on, and Space is what
36
+ * presses. So the two modes differ in the role of the group, the role of the
37
+ * member, the state attribute, and what an arrow key does, and none of the four is
38
+ * reachable from the other by passing a prop.
39
+ *
40
+ * **The group is one Tab stop, and it is the current answer.** Tab enters on the
41
+ * member that is pressed, or on the first member when nothing is pressed, and Tab
42
+ * leaves the group in one step. That is the composite pattern, and it is why a
43
+ * consumer cannot assemble this from a row of Toggles: composing them gives the
44
+ * Tab order of the document, which is every member of the group and none of the
45
+ * arrows. A radiogroup whose Tab lands on the first option when a different one is
46
+ * checked is a group that reports the wrong current value through the tab order
47
+ * alone, and with seven members in a row the reader pays for it.
48
+ *
49
+ * **The tab stop follows the reader once they move.** It is a piece of state
50
+ * rather than a derivation, because a reader who arrows across a group of seven
51
+ * and Tabs away expects to arrive back where they were, and a stop recomputed
52
+ * from the pressed value on every render is a stop that follows the pressed value
53
+ * instead of the reader.
54
+ *
55
+ * **The keyboard model lives here rather than in each member,** for the reason
56
+ * `Tree` keeps its own: three members each handling an arrow key is three
57
+ * implementations of one rule, and the third is the one that is wrong. The order
58
+ * the arrows walk is the group's own children rather than the node list, so it is
59
+ * the order the reader sees and the order a reordering caller declared, with no
60
+ * second list to fall behind the first.
61
+ *
62
+ * It is a client Component: it holds the pressed set and the roving tab stop, and
63
+ * both are the control rather than a decoration of it.
64
+ */
65
+ function ToggleGroup({ children, className, selectionMode = 'single', value, defaultValue, onValueChange, disabled = false, orientation = 'horizontal', ...props }) {
66
+ const [uncontrolled, setUncontrolled] = useState(defaultValue ?? []);
67
+ const controlled = value !== undefined;
68
+ const pressed = controlled ? value : uncontrolled;
69
+ // The tab stop is state because it has to move; see the JSDoc. `null` is the
70
+ // "the reader has not been here yet" case, and resolving it to the pressed
71
+ // member is what makes an uncontrolled group with a default answer enter on that
72
+ // answer.
73
+ const [stop, setStop] = useState(null);
74
+ const root = useRef(null);
75
+ /**
76
+ * The declared order of the members, read from the children.
77
+ *
78
+ * Read from the children rather than from the DOM on purpose. The tab stop has
79
+ * to be known during the first render, and a query of `root.current` returns
80
+ * nothing on that render because the ref is not attached yet, so a group whose
81
+ * tab stop comes from the DOM has no tab stop on its first paint. A child with
82
+ * no `value` is skipped, which is the same thing the DOM read would have done by
83
+ * leaving it out of the list.
84
+ */
85
+ const declared = useMemo(() => Children.toArray(children)
86
+ .map((child) => typeof child === 'object' && child !== null && 'props' in child
87
+ ? child.props?.value
88
+ : undefined)
89
+ .filter((item) => typeof item === 'string'), [children]);
90
+ const members = () => [
91
+ ...(root.current?.querySelectorAll('[data-slot="toggle-group-item"]') ?? []),
92
+ ];
93
+ const context = useMemo(() => ({
94
+ selectionMode,
95
+ value: pressed,
96
+ disabled,
97
+ isPressed: (item) => pressed.includes(item),
98
+ isTabStop: (item) => {
99
+ if (stop !== null)
100
+ return stop === item;
101
+ const current = pressed[0];
102
+ return current === undefined ? item === declared[0] : item === current;
103
+ },
104
+ toggle: (item) => {
105
+ // The whole set comes back rather than a difference, so a caller
106
+ // restoring state does not have to know which member it was holding. In
107
+ // single mode pressing the pressed member clears it rather than doing
108
+ // nothing, which is the one place the two modes genuinely differ in
109
+ // consequence: a radio group with no answer is a real state, and it is
110
+ // reachable by pressing the answer again.
111
+ const next = selectionMode === 'multiple'
112
+ ? pressed.includes(item)
113
+ ? pressed.filter((held) => held !== item)
114
+ : [...pressed, item]
115
+ : pressed.includes(item)
116
+ ? []
117
+ : [item];
118
+ if (!controlled)
119
+ setUncontrolled(next);
120
+ onValueChange?.(next);
121
+ },
122
+ focus: (item) => setStop(item),
123
+ members,
124
+ orientation,
125
+ }), [controlled, declared, disabled, onValueChange, orientation, pressed, selectionMode, stop]);
126
+ return (_jsx("div", { ref: root, "data-slot": "toggle-group", "data-selection-mode": selectionMode,
127
+ // The role is the whole difference between the two modes, and it is set here
128
+ // rather than inherited from whatever the underlying primitive defaults to.
129
+ // A `group` with `aria-orientation` is itself an error, which is one of the
130
+ // reasons the multiple mode is a toolbar: a toolbar is the role that says
131
+ // "a set of controls operated with the arrow keys", and it is the role that
132
+ // carries an orientation.
133
+ role: selectionMode === 'multiple' ? 'toolbar' : 'radiogroup', "aria-orientation": orientation, onKeyDown: (event) => {
134
+ const back = BACKWARD[orientation].includes(event.key);
135
+ if (!back && !FORWARD[orientation].includes(event.key))
136
+ return;
137
+ const all = members();
138
+ if (all.length === 0)
139
+ return;
140
+ const at = all.indexOf(document.activeElement);
141
+ if (at === -1)
142
+ return;
143
+ // A member that ignores interaction is skipped rather than focused and
144
+ // doing nothing, which is the same rule `Tree` follows for a label that
145
+ // is not a destination.
146
+ const forward = back ? -1 : 1;
147
+ for (let step = 1; step <= all.length; step += 1) {
148
+ const target = all[(at + forward * step + all.length * step) % all.length];
149
+ if (target === undefined || target.disabled)
150
+ continue;
151
+ event.preventDefault();
152
+ target.focus();
153
+ return;
154
+ }
155
+ }, className: cn('inline-flex items-center gap-1', orientation === 'vertical' ? 'flex-col' : 'flex-row', className), ...props, children: _jsx(ToggleGroupContext.Provider, { value: context, children: children }) }));
156
+ }
157
+ /**
158
+ * One member of a ToggleGroup.
159
+ *
160
+ * A native `<button>` in both modes, because it is focusable, it submits nothing
161
+ * it was not asked to, and it is the element the browser's own activation already
162
+ * handles. What changes between the modes is the role and the state attribute, and
163
+ * both are read from the group: a radio carrying `aria-checked` in single mode, a
164
+ * pressed button in multiple mode. Render a Prism `Toggle` outside a group when a
165
+ * member stands alone; render this inside one, where the group owns the keyboard
166
+ * model and the pressed set.
167
+ */
168
+ function ToggleGroupItem({ className, value, disabled, children, ...props }) {
169
+ const group = useContext(ToggleGroupContext);
170
+ // A member outside a group still has to be a usable button rather than a broken
171
+ // one, so the defaults here are the standalone behaviour and the group overrides
172
+ // them. A member with no group is a caller's mistake, and the honest response to
173
+ // it is a working control rather than a crash.
174
+ const standalone = group === null;
175
+ const multiple = group?.selectionMode === 'multiple';
176
+ const pressed = group?.isPressed(value) ?? false;
177
+ const inert = group?.disabled === true || disabled === true;
178
+ return (_jsx("button", { type: "button", "data-slot": "toggle-group-item", "data-value": value, "data-pressed": pressed ? 'true' : undefined,
179
+ // The single-selection member is a radio, and `aria-checked` is the only
180
+ // attribute that says "one of these is the answer". `aria-pressed` on a
181
+ // button inside a set of mutually exclusive choices says each choice is
182
+ // independent, which is the claim single mode is denying.
183
+ role: standalone || multiple ? undefined : 'radio', "aria-checked": standalone || multiple ? undefined : pressed, "aria-pressed": standalone || multiple ? pressed : undefined,
184
+ // The roving tab stop. A group where every member is out of the tab order is
185
+ // a group a keyboard cannot enter at all, which is the failure a roving
186
+ // tabindex has when nobody owns the pointer position, so the first member is
187
+ // the stop whenever nothing is pressed.
188
+ tabIndex: group === null || group.isTabStop(value) ? 0 : -1, disabled: inert, onFocus: () => group?.focus(value), onClick: () => group?.toggle(value), className: cn('text-muted-foreground inline-flex h-8 min-w-8 items-center justify-center gap-1.5 rounded-sm px-2.5 text-sm font-medium whitespace-nowrap outline-none', 'transition-[color,box-shadow,background-color] duration-fast ease-out', 'hover:text-foreground', 'focus-visible:ring-ring focus-visible:ring-[3px]',
189
+ // Both state surfaces set their own ink, for the reason `Toggle` states: an
190
+ // inherited ink is the same control on the page ground and a different one
191
+ // inside a Block.
192
+ 'data-[pressed]:bg-accent data-[pressed]:text-accent-foreground', inert ? 'cursor-not-allowed opacity-50' : '', className), ...props, children: children }));
193
+ }
194
+ export { ToggleGroup, ToggleGroupItem };
@@ -0,0 +1,73 @@
1
+ import type { ComponentProps } from 'react';
2
+ /** How large a Toggle is drawn. */
3
+ export type ToggleSize = 'sm' | 'default';
4
+ /**
5
+ * The props the Toggle forwards to its Base UI root.
6
+ *
7
+ * Declared here rather than re-exported from Base UI so no upstream type crosses
8
+ * the package seam (ticket 07 section 6).
9
+ */
10
+ /**
11
+ * The props the Toggle accepts.
12
+ *
13
+ * `value` is omitted from what it forwards, because the native button attribute
14
+ * and the toggle's own `value` are different things. The native one is the value
15
+ * submitted with a form, and the toggle's is the identifier a `ToggleGroup` uses to
16
+ * hold the pressed set; a single prop cannot be both. A standalone Toggle submits
17
+ * nothing, so the attribute is not the one a caller is reaching for here, and a
18
+ * caller who wants it wraps the Toggle in a form control of its own.
19
+ */
20
+ export interface ToggleProps extends Omit<ComponentProps<'button'>, 'onChange' | 'value'> {
21
+ /** The pressed state, when the control is controlled. */
22
+ pressed?: boolean;
23
+ /** The pressed state to start in, for an uncontrolled toggle. */
24
+ defaultPressed?: boolean;
25
+ /** Called when the pressed state changes. */
26
+ onPressedChange?: (pressed: boolean) => void;
27
+ /** Whether the control ignores user interaction. */
28
+ disabled?: boolean;
29
+ /**
30
+ * The control's accessible name.
31
+ *
32
+ * Optional rather than required only because a Toggle whose visible label is its
33
+ * own text takes its name from that text. Pass it for the icon-only case, which
34
+ * is common: a bold, an italic and an underline row are three glyphs, and a
35
+ * screen reader that says "button, button, button" for them is three controls
36
+ * nobody can tell apart.
37
+ */
38
+ 'aria-label'?: string;
39
+ /** The control's height. @defaultValue 'default' */
40
+ size?: ToggleSize;
41
+ /** Layout only. */
42
+ className?: string;
43
+ }
44
+ /**
45
+ * A two-state button: it is pressed or it is not.
46
+ *
47
+ * **A Toggle is not a Switch, and the difference is the whole of it.** A Switch
48
+ * takes effect the moment it is flipped: notifications are on, a panel is showing,
49
+ * a feature is enabled, and there is no save step. A Toggle is *pressed*, which is
50
+ * a state the caller holds and decides what to do with, usually on submit. Turning
51
+ * on a feature the moment a reader presses a word is a change made without a save
52
+ * and without a confirmation, and a reader who pressed the wrong one has to know
53
+ * what was undone. So: flipping a Switch changes the application, pressing a
54
+ * Toggle changes a value.
55
+ *
56
+ * Between the two, use a Switch when the change applies at once and a Toggle when
57
+ * it is part of a larger form. A Checkbox is the third answer and the one most
58
+ * often confused with both: a Checkbox is an independent yes-or-no that submits
59
+ * with the form and has no pressed styling to suggest it is currently on.
60
+ *
61
+ * **The pressed state is an attribute and not only a surface.** Base UI renders a
62
+ * native `<button>` with `aria-pressed`, which is what makes it a toggle rather
63
+ * than a button that happens to change colour, and the surface follows it with
64
+ * `data-[pressed]:`. The order is the same everywhere in this package: the
65
+ * attribute is the fact and the colour is the reminder, so a reader who cannot
66
+ * separate the two inks still knows which way the control is.
67
+ *
68
+ * It is a client Component, because a toggle that cannot be pressed is a label and
69
+ * because the pressed state is what the whole control is.
70
+ */
71
+ declare function Toggle({ className, size, pressed, defaultPressed, onPressedChange, disabled, ...props }: ToggleProps): import("react").JSX.Element;
72
+ export { Toggle };
73
+ //# sourceMappingURL=toggle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/components/ui/toggle.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C,mCAAmC;AACnC,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,SAAS,CAAA;AAEzC;;;;;GAKG;AACH;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IACvF,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iEAAiE;IACjE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IAC5C,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oDAAoD;IACpD,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,mBAAmB;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAgB,EAChB,OAAO,EACP,cAAc,EACd,eAAe,EACf,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,+BA4Bb;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,44 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Toggle as TogglePrimitive } from '@base-ui/react/toggle';
4
+ import { cn } from '../../lib/utils.js';
5
+ /**
6
+ * A two-state button: it is pressed or it is not.
7
+ *
8
+ * **A Toggle is not a Switch, and the difference is the whole of it.** A Switch
9
+ * takes effect the moment it is flipped: notifications are on, a panel is showing,
10
+ * a feature is enabled, and there is no save step. A Toggle is *pressed*, which is
11
+ * a state the caller holds and decides what to do with, usually on submit. Turning
12
+ * on a feature the moment a reader presses a word is a change made without a save
13
+ * and without a confirmation, and a reader who pressed the wrong one has to know
14
+ * what was undone. So: flipping a Switch changes the application, pressing a
15
+ * Toggle changes a value.
16
+ *
17
+ * Between the two, use a Switch when the change applies at once and a Toggle when
18
+ * it is part of a larger form. A Checkbox is the third answer and the one most
19
+ * often confused with both: a Checkbox is an independent yes-or-no that submits
20
+ * with the form and has no pressed styling to suggest it is currently on.
21
+ *
22
+ * **The pressed state is an attribute and not only a surface.** Base UI renders a
23
+ * native `<button>` with `aria-pressed`, which is what makes it a toggle rather
24
+ * than a button that happens to change colour, and the surface follows it with
25
+ * `data-[pressed]:`. The order is the same everywhere in this package: the
26
+ * attribute is the fact and the colour is the reminder, so a reader who cannot
27
+ * separate the two inks still knows which way the control is.
28
+ *
29
+ * It is a client Component, because a toggle that cannot be pressed is a label and
30
+ * because the pressed state is what the whole control is.
31
+ */
32
+ function Toggle({ className, size = 'default', pressed, defaultPressed, onPressedChange, disabled, ...props }) {
33
+ return (_jsx(TogglePrimitive, { "data-slot": "toggle",
34
+ // The focus ring is `ring-ring` at full strength, for the reason `Button`
35
+ // states: half alpha of this ring clears 3:1 against no surface in any pack.
36
+ className: cn('inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap outline-none', 'transition-[color,box-shadow,background-color] duration-fast ease-out', 'focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-[3px]', 'disabled:pointer-events-none disabled:opacity-50',
37
+ // Both state surfaces set their own ink, which is the rule a variant that
38
+ // sets a fill must follow. A pressed surface with an inherited ink is the
39
+ // same control on the page ground and a different one inside a Block.
40
+ 'hover:bg-accent hover:text-accent-foreground', 'data-[pressed]:bg-accent data-[pressed]:text-accent-foreground', size === 'sm' ? 'h-8 min-w-8 px-2.5' : 'h-9 min-w-9 px-3', className), ...(pressed === undefined ? null : { pressed }), ...(defaultPressed === undefined ? null : { defaultPressed }), ...(onPressedChange === undefined
41
+ ? null
42
+ : { onPressedChange: (next) => onPressedChange(next) }), ...(disabled === undefined ? null : { disabled }), ...props }));
43
+ }
44
+ export { Toggle };
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
4
- import { cn } from '../../lib/utils';
4
+ import { cn } from '../../lib/utils.js';
5
5
  /**
6
6
  * A short label shown on hover or focus.
7
7
  *
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useRef } from 'react';
4
- import { cn } from '../../lib/utils';
4
+ import { cn } from '../../lib/utils.js';
5
5
  /** Whether a group's subtree contains the current address, at any depth. */
6
6
  function containsHref(nodes, currentHref) {
7
7
  if (currentHref === undefined)
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cva } from 'class-variance-authority';
3
- import { cn } from '../../lib/utils';
3
+ import { cn } from '../../lib/utils.js';
4
4
  const headingVariants = cva('font-semibold tracking-tight text-balance', {
5
5
  variants: {
6
6
  size: {
@@ -1,93 +1,93 @@
1
- Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
2
-
3
- This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
- This license is copied below, and is also available with a FAQ at:
5
- http://scripts.sil.org/OFL
6
-
7
-
8
- -----------------------------------------------------------
9
- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
- -----------------------------------------------------------
11
-
12
- PREAMBLE
13
- The goals of the Open Font License (OFL) are to stimulate worldwide
14
- development of collaborative font projects, to support the font creation
15
- efforts of academic and linguistic communities, and to provide a free and
16
- open framework in which fonts may be shared and improved in partnership
17
- with others.
18
-
19
- The OFL allows the licensed fonts to be used, studied, modified and
20
- redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
22
- redistributed and/or sold with any software provided that any reserved
23
- names are not used by derivative works. The fonts and derivatives,
24
- however, cannot be released under any other type of license. The
25
- requirement for fonts to remain under this license does not apply
26
- to any document created using the fonts or their derivatives.
27
-
28
- DEFINITIONS
29
- "Font Software" refers to the set of files released by the Copyright
30
- Holder(s) under this license and clearly marked as such. This may
31
- include source files, build scripts and documentation.
32
-
33
- "Reserved Font Name" refers to any names specified as such after the
34
- copyright statement(s).
35
-
36
- "Original Version" refers to the collection of Font Software components as
37
- distributed by the Copyright Holder(s).
38
-
39
- "Modified Version" refers to any derivative made by adding to, deleting,
40
- or substituting -- in part or in whole -- any of the components of the
41
- Original Version, by changing formats or by porting the Font Software to a
42
- new environment.
43
-
44
- "Author" refers to any designer, engineer, programmer, technical
45
- writer or other person who contributed to the Font Software.
46
-
47
- PERMISSION & CONDITIONS
48
- Permission is hereby granted, free of charge, to any person obtaining
49
- a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
- redistribute, and sell modified and unmodified copies of the Font
51
- Software, subject to the following conditions:
52
-
53
- 1) Neither the Font Software nor any of its individual components,
54
- in Original or Modified Versions, may be sold by itself.
55
-
56
- 2) Original or Modified Versions of the Font Software may be bundled,
57
- redistributed and/or sold with any software, provided that each copy
58
- contains the above copyright notice and this license. These can be
59
- included either as stand-alone text files, human-readable headers or
60
- in the appropriate machine-readable metadata fields within text or
61
- binary files as long as those fields can be easily viewed by the user.
62
-
63
- 3) No Modified Version of the Font Software may use the Reserved Font
64
- Name(s) unless explicit written permission is granted by the corresponding
65
- Copyright Holder. This restriction only applies to the primary font name as
66
- presented to the users.
67
-
68
- 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
- Software shall not be used to promote, endorse or advertise any
70
- Modified Version, except to acknowledge the contribution(s) of the
71
- Copyright Holder(s) and the Author(s) or with their explicit written
72
- permission.
73
-
74
- 5) The Font Software, modified or unmodified, in part or in whole,
75
- must be distributed entirely under this license, and must not be
76
- distributed under any other license. The requirement for fonts to
77
- remain under this license does not apply to any document created
78
- using the Font Software.
79
-
80
- TERMINATION
81
- This license becomes null and void if any of the above conditions are
82
- not met.
83
-
84
- DISCLAIMER
85
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
- COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
- INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
- DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
- FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
- OTHER DEALINGS IN THE FONT SOFTWARE.
1
+ Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.