@photon-ai/pho-ui 0.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 (281) hide show
  1. package/README.md +49 -0
  2. package/dist/chunks/button-9pp4g7en.js +334 -0
  3. package/dist/chunks/button-9pp4g7en.js.map +1 -0
  4. package/dist/chunks/close-button-CbQNfpxU.js +30 -0
  5. package/dist/chunks/close-button-CbQNfpxU.js.map +1 -0
  6. package/dist/chunks/cn-D6jQqeRj.js +1762 -0
  7. package/dist/chunks/cn-D6jQqeRj.js.map +1 -0
  8. package/dist/chunks/dialog-BSBF1Wyq.js +63 -0
  9. package/dist/chunks/dialog-BSBF1Wyq.js.map +1 -0
  10. package/dist/chunks/input-aZqjjV_m.js +75 -0
  11. package/dist/chunks/input-aZqjjV_m.js.map +1 -0
  12. package/dist/chunks/link-provider-9TFNyDqO.js +28 -0
  13. package/dist/chunks/link-provider-9TFNyDqO.js.map +1 -0
  14. package/dist/chunks/menu-BkzDbNuX.js +101 -0
  15. package/dist/chunks/menu-BkzDbNuX.js.map +1 -0
  16. package/dist/chunks/resolve-variant-CcD8iG5l.js +9 -0
  17. package/dist/chunks/resolve-variant-CcD8iG5l.js.map +1 -0
  18. package/dist/chunks/rolldown-runtime-wKSmTnsc.js +22 -0
  19. package/dist/components/accordion.js +42 -0
  20. package/dist/components/accordion.js.map +1 -0
  21. package/dist/components/alert-dialog.js +59 -0
  22. package/dist/components/alert-dialog.js.map +1 -0
  23. package/dist/components/autocomplete.js +82 -0
  24. package/dist/components/autocomplete.js.map +1 -0
  25. package/dist/components/avatar.js +49 -0
  26. package/dist/components/avatar.js.map +1 -0
  27. package/dist/components/badge.js +59 -0
  28. package/dist/components/badge.js.map +1 -0
  29. package/dist/components/button.js +17 -0
  30. package/dist/components/checkbox.js +51 -0
  31. package/dist/components/checkbox.js.map +1 -0
  32. package/dist/components/collapsible.js +28 -0
  33. package/dist/components/collapsible.js.map +1 -0
  34. package/dist/components/combobox.js +117 -0
  35. package/dist/components/combobox.js.map +1 -0
  36. package/dist/components/context-menu.js +63 -0
  37. package/dist/components/context-menu.js.map +1 -0
  38. package/dist/components/dialog.js +5 -0
  39. package/dist/components/drawer.js +59 -0
  40. package/dist/components/drawer.js.map +1 -0
  41. package/dist/components/field.js +49 -0
  42. package/dist/components/field.js.map +1 -0
  43. package/dist/components/fieldset.js +26 -0
  44. package/dist/components/fieldset.js.map +1 -0
  45. package/dist/components/form.js +17 -0
  46. package/dist/components/form.js.map +1 -0
  47. package/dist/components/input.js +5 -0
  48. package/dist/components/kbd.js +18 -0
  49. package/dist/components/kbd.js.map +1 -0
  50. package/dist/components/menu.js +7 -0
  51. package/dist/components/menubar.js +17 -0
  52. package/dist/components/menubar.js.map +1 -0
  53. package/dist/components/meter.js +47 -0
  54. package/dist/components/meter.js.map +1 -0
  55. package/dist/components/navigation-menu.js +74 -0
  56. package/dist/components/navigation-menu.js.map +1 -0
  57. package/dist/components/notification.js +91 -0
  58. package/dist/components/notification.js.map +1 -0
  59. package/dist/components/number-field.js +56 -0
  60. package/dist/components/number-field.js.map +1 -0
  61. package/dist/components/otp-field.js +19 -0
  62. package/dist/components/otp-field.js.map +1 -0
  63. package/dist/components/popover.js +46 -0
  64. package/dist/components/popover.js.map +1 -0
  65. package/dist/components/preview-card.js +31 -0
  66. package/dist/components/preview-card.js.map +1 -0
  67. package/dist/components/progress.js +47 -0
  68. package/dist/components/progress.js.map +1 -0
  69. package/dist/components/radio-group.js +34 -0
  70. package/dist/components/radio-group.js.map +1 -0
  71. package/dist/components/scroll-area.js +43 -0
  72. package/dist/components/scroll-area.js.map +1 -0
  73. package/dist/components/select.js +69 -0
  74. package/dist/components/select.js.map +1 -0
  75. package/dist/components/separator.js +17 -0
  76. package/dist/components/separator.js.map +1 -0
  77. package/dist/components/slider.js +61 -0
  78. package/dist/components/slider.js.map +1 -0
  79. package/dist/components/switch.js +28 -0
  80. package/dist/components/switch.js.map +1 -0
  81. package/dist/components/tabs.js +42 -0
  82. package/dist/components/tabs.js.map +1 -0
  83. package/dist/components/toast.js +60 -0
  84. package/dist/components/toast.js.map +1 -0
  85. package/dist/components/toggle-group.js +17 -0
  86. package/dist/components/toggle-group.js.map +1 -0
  87. package/dist/components/toggle.js +33 -0
  88. package/dist/components/toggle.js.map +1 -0
  89. package/dist/components/toolbar.js +55 -0
  90. package/dist/components/toolbar.js.map +1 -0
  91. package/dist/components/tooltip.js +32 -0
  92. package/dist/components/tooltip.js.map +1 -0
  93. package/dist/icons.js +192 -0
  94. package/dist/icons.js.map +1 -0
  95. package/dist/index.js +30 -0
  96. package/dist/primitives/accordion.js +3 -0
  97. package/dist/primitives/alert-dialog.js +3 -0
  98. package/dist/primitives/autocomplete.js +3 -0
  99. package/dist/primitives/avatar.js +3 -0
  100. package/dist/primitives/button.js +3 -0
  101. package/dist/primitives/checkbox-group.js +3 -0
  102. package/dist/primitives/checkbox.js +3 -0
  103. package/dist/primitives/collapsible.js +3 -0
  104. package/dist/primitives/combobox.js +3 -0
  105. package/dist/primitives/context-menu.js +3 -0
  106. package/dist/primitives/csp-provider.js +3 -0
  107. package/dist/primitives/dialog.js +3 -0
  108. package/dist/primitives/direction-provider.js +3 -0
  109. package/dist/primitives/drawer.js +3 -0
  110. package/dist/primitives/field.js +3 -0
  111. package/dist/primitives/fieldset.js +3 -0
  112. package/dist/primitives/form.js +3 -0
  113. package/dist/primitives/input.js +3 -0
  114. package/dist/primitives/menu.js +3 -0
  115. package/dist/primitives/menubar.js +3 -0
  116. package/dist/primitives/meter.js +3 -0
  117. package/dist/primitives/navigation-menu.js +3 -0
  118. package/dist/primitives/number-field.js +3 -0
  119. package/dist/primitives/otp-field.js +3 -0
  120. package/dist/primitives/popover.js +3 -0
  121. package/dist/primitives/preview-card.js +3 -0
  122. package/dist/primitives/progress.js +3 -0
  123. package/dist/primitives/radio-group.js +3 -0
  124. package/dist/primitives/radio.js +3 -0
  125. package/dist/primitives/scroll-area.js +3 -0
  126. package/dist/primitives/select.js +3 -0
  127. package/dist/primitives/separator.js +3 -0
  128. package/dist/primitives/slider.js +3 -0
  129. package/dist/primitives/switch.js +3 -0
  130. package/dist/primitives/tabs.js +3 -0
  131. package/dist/primitives/toast.js +3 -0
  132. package/dist/primitives/toggle-group.js +3 -0
  133. package/dist/primitives/toggle.js +3 -0
  134. package/dist/primitives/toolbar.js +3 -0
  135. package/dist/primitives/tooltip.js +3 -0
  136. package/dist/primitives.js +84 -0
  137. package/dist/primitives.js.map +1 -0
  138. package/dist/src/components/accordion/accordion.d.ts +24 -0
  139. package/dist/src/components/accordion/index.d.ts +1 -0
  140. package/dist/src/components/alert-dialog/alert-dialog.d.ts +41 -0
  141. package/dist/src/components/alert-dialog/index.d.ts +1 -0
  142. package/dist/src/components/autocomplete/autocomplete.d.ts +38 -0
  143. package/dist/src/components/autocomplete/index.d.ts +1 -0
  144. package/dist/src/components/avatar/avatar.d.ts +40 -0
  145. package/dist/src/components/avatar/index.d.ts +1 -0
  146. package/dist/src/components/badge/badge.d.ts +63 -0
  147. package/dist/src/components/badge/index.d.ts +1 -0
  148. package/dist/src/components/button/button.d.ts +196 -0
  149. package/dist/src/components/button/close-button.d.ts +28 -0
  150. package/dist/src/components/button/index.d.ts +2 -0
  151. package/dist/src/components/checkbox/checkbox-group.d.ts +15 -0
  152. package/dist/src/components/checkbox/checkbox.d.ts +20 -0
  153. package/dist/src/components/checkbox/index.d.ts +2 -0
  154. package/dist/src/components/collapsible/collapsible.d.ts +20 -0
  155. package/dist/src/components/collapsible/index.d.ts +1 -0
  156. package/dist/src/components/combobox/combobox.d.ts +49 -0
  157. package/dist/src/components/combobox/index.d.ts +1 -0
  158. package/dist/src/components/context-menu/context-menu.d.ts +34 -0
  159. package/dist/src/components/context-menu/index.d.ts +1 -0
  160. package/dist/src/components/dialog/dialog.d.ts +41 -0
  161. package/dist/src/components/dialog/index.d.ts +1 -0
  162. package/dist/src/components/drawer/drawer.d.ts +32 -0
  163. package/dist/src/components/drawer/index.d.ts +1 -0
  164. package/dist/src/components/field/field.d.ts +27 -0
  165. package/dist/src/components/field/index.d.ts +1 -0
  166. package/dist/src/components/fieldset/fieldset.d.ts +18 -0
  167. package/dist/src/components/fieldset/index.d.ts +1 -0
  168. package/dist/src/components/form/form.d.ts +14 -0
  169. package/dist/src/components/form/index.d.ts +1 -0
  170. package/dist/src/components/input/index.d.ts +1 -0
  171. package/dist/src/components/input/input.d.ts +30 -0
  172. package/dist/src/components/kbd/index.d.ts +1 -0
  173. package/dist/src/components/kbd/kbd.d.ts +18 -0
  174. package/dist/src/components/menu/index.d.ts +1 -0
  175. package/dist/src/components/menu/menu.d.ts +47 -0
  176. package/dist/src/components/menubar/index.d.ts +1 -0
  177. package/dist/src/components/menubar/menubar.d.ts +14 -0
  178. package/dist/src/components/meter/index.d.ts +1 -0
  179. package/dist/src/components/meter/meter.d.ts +24 -0
  180. package/dist/src/components/navigation-menu/index.d.ts +1 -0
  181. package/dist/src/components/navigation-menu/navigation-menu.d.ts +35 -0
  182. package/dist/src/components/notification/index.d.ts +1 -0
  183. package/dist/src/components/notification/notification.d.ts +73 -0
  184. package/dist/src/components/number-field/index.d.ts +1 -0
  185. package/dist/src/components/number-field/number-field.d.ts +28 -0
  186. package/dist/src/components/otp-field/index.d.ts +1 -0
  187. package/dist/src/components/otp-field/otp-field.d.ts +17 -0
  188. package/dist/src/components/popover/index.d.ts +1 -0
  189. package/dist/src/components/popover/popover.d.ts +27 -0
  190. package/dist/src/components/preview-card/index.d.ts +1 -0
  191. package/dist/src/components/preview-card/preview-card.d.ts +22 -0
  192. package/dist/src/components/progress/index.d.ts +1 -0
  193. package/dist/src/components/progress/progress.d.ts +24 -0
  194. package/dist/src/components/radio-group/index.d.ts +1 -0
  195. package/dist/src/components/radio-group/radio-group.d.ts +28 -0
  196. package/dist/src/components/scroll-area/index.d.ts +1 -0
  197. package/dist/src/components/scroll-area/scroll-area.d.ts +25 -0
  198. package/dist/src/components/select/index.d.ts +1 -0
  199. package/dist/src/components/select/select.d.ts +36 -0
  200. package/dist/src/components/separator/index.d.ts +1 -0
  201. package/dist/src/components/separator/separator.d.ts +14 -0
  202. package/dist/src/components/slider/index.d.ts +1 -0
  203. package/dist/src/components/slider/slider.d.ts +30 -0
  204. package/dist/src/components/switch/index.d.ts +1 -0
  205. package/dist/src/components/switch/switch.d.ts +18 -0
  206. package/dist/src/components/tabs/index.d.ts +1 -0
  207. package/dist/src/components/tabs/tabs.d.ts +24 -0
  208. package/dist/src/components/toast/index.d.ts +1 -0
  209. package/dist/src/components/toast/toast.d.ts +34 -0
  210. package/dist/src/components/toggle/index.d.ts +1 -0
  211. package/dist/src/components/toggle/toggle.d.ts +33 -0
  212. package/dist/src/components/toggle-group/index.d.ts +1 -0
  213. package/dist/src/components/toggle-group/toggle-group.d.ts +15 -0
  214. package/dist/src/components/toolbar/index.d.ts +1 -0
  215. package/dist/src/components/toolbar/toolbar.d.ts +28 -0
  216. package/dist/src/components/tooltip/index.d.ts +1 -0
  217. package/dist/src/components/tooltip/tooltip.d.ts +23 -0
  218. package/dist/src/icons/discord.d.ts +3 -0
  219. package/dist/src/icons/github.d.ts +3 -0
  220. package/dist/src/icons/google.d.ts +3 -0
  221. package/dist/src/icons/imessage.d.ts +3 -0
  222. package/dist/src/icons/index.d.ts +18 -0
  223. package/dist/src/icons/photon-mark.d.ts +3 -0
  224. package/dist/src/icons/reddit.d.ts +3 -0
  225. package/dist/src/icons/slack.d.ts +3 -0
  226. package/dist/src/icons/telegram.d.ts +3 -0
  227. package/dist/src/icons/whatsapp.d.ts +3 -0
  228. package/dist/src/icons/x.d.ts +3 -0
  229. package/dist/src/icons/youtube.d.ts +3 -0
  230. package/dist/src/index.d.ts +11 -0
  231. package/dist/src/primitives/accordion.d.ts +5 -0
  232. package/dist/src/primitives/alert-dialog.d.ts +5 -0
  233. package/dist/src/primitives/autocomplete.d.ts +5 -0
  234. package/dist/src/primitives/avatar.d.ts +5 -0
  235. package/dist/src/primitives/button.d.ts +5 -0
  236. package/dist/src/primitives/checkbox-group.d.ts +5 -0
  237. package/dist/src/primitives/checkbox.d.ts +5 -0
  238. package/dist/src/primitives/collapsible.d.ts +5 -0
  239. package/dist/src/primitives/combobox.d.ts +5 -0
  240. package/dist/src/primitives/context-menu.d.ts +5 -0
  241. package/dist/src/primitives/csp-provider.d.ts +5 -0
  242. package/dist/src/primitives/dialog.d.ts +5 -0
  243. package/dist/src/primitives/direction-provider.d.ts +5 -0
  244. package/dist/src/primitives/drawer.d.ts +5 -0
  245. package/dist/src/primitives/field.d.ts +5 -0
  246. package/dist/src/primitives/fieldset.d.ts +5 -0
  247. package/dist/src/primitives/form.d.ts +5 -0
  248. package/dist/src/primitives/index.d.ts +44 -0
  249. package/dist/src/primitives/input.d.ts +5 -0
  250. package/dist/src/primitives/menu.d.ts +5 -0
  251. package/dist/src/primitives/menubar.d.ts +5 -0
  252. package/dist/src/primitives/meter.d.ts +5 -0
  253. package/dist/src/primitives/navigation-menu.d.ts +5 -0
  254. package/dist/src/primitives/number-field.d.ts +5 -0
  255. package/dist/src/primitives/otp-field.d.ts +5 -0
  256. package/dist/src/primitives/popover.d.ts +5 -0
  257. package/dist/src/primitives/preview-card.d.ts +5 -0
  258. package/dist/src/primitives/progress.d.ts +5 -0
  259. package/dist/src/primitives/radio-group.d.ts +5 -0
  260. package/dist/src/primitives/radio.d.ts +5 -0
  261. package/dist/src/primitives/scroll-area.d.ts +5 -0
  262. package/dist/src/primitives/select.d.ts +5 -0
  263. package/dist/src/primitives/separator.d.ts +5 -0
  264. package/dist/src/primitives/slider.d.ts +5 -0
  265. package/dist/src/primitives/switch.d.ts +5 -0
  266. package/dist/src/primitives/tabs.d.ts +5 -0
  267. package/dist/src/primitives/toast.d.ts +5 -0
  268. package/dist/src/primitives/toggle-group.d.ts +5 -0
  269. package/dist/src/primitives/toggle.d.ts +5 -0
  270. package/dist/src/primitives/toolbar.d.ts +5 -0
  271. package/dist/src/primitives/tooltip.d.ts +5 -0
  272. package/dist/src/utils/cn.d.ts +3 -0
  273. package/dist/src/utils/index.d.ts +4 -0
  274. package/dist/src/utils/is-react-component.d.ts +9 -0
  275. package/dist/src/utils/link-provider.d.ts +17 -0
  276. package/dist/src/utils/resolve-variant.d.ts +19 -0
  277. package/dist/utils.js +11 -0
  278. package/package.json +406 -0
  279. package/src/styles/fonts.css +20 -0
  280. package/src/styles/pho.css +50 -0
  281. package/src/styles/theme.css +289 -0
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # @photon-ai/pho-ui
2
+
3
+ Photon's React component library — the Pho Design System. Built on
4
+ [Base UI](https://base-ui.com) and Tailwind v4.
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ pnpm add @photon-ai/pho-ui
10
+ ```
11
+
12
+ Peer dependencies: `react`, `react-dom`, `@phosphor-icons/react`.
13
+
14
+ ## Styles (Tailwind v4)
15
+
16
+ In your app's CSS:
17
+
18
+ ```css
19
+ @import "tailwindcss";
20
+ @import "@photon-ai/pho-ui/styles";
21
+ @import "@photon-ai/pho-ui/styles/fonts"; /* optional: PolySans + Azeret Mono */
22
+ @source "../node_modules/@photon-ai/pho-ui/dist";
23
+ ```
24
+
25
+ Toggle dark mode by setting `data-mode="dark"` (or a `.dark` class) on a wrapper.
26
+
27
+ ## Usage
28
+
29
+ ```tsx
30
+ import { Button } from "@photon-ai/pho-ui/components/button";
31
+ import { Input } from "@photon-ai/pho-ui/components/input";
32
+ import { Dialog } from "@photon-ai/pho-ui/components/dialog";
33
+
34
+ <Button color="primary">Save</Button>;
35
+ ```
36
+
37
+ Prefer the granular entry points (`@photon-ai/pho-ui/components/*`,
38
+ `@photon-ai/pho-ui/primitives/*`, `@photon-ai/pho-ui/utils`) for best tree-shaking; a
39
+ root barrel (`@photon-ai/pho-ui`) is also available.
40
+
41
+ ### Links
42
+
43
+ Pho is router-agnostic. Inject your router's link component once:
44
+
45
+ ```tsx
46
+ import { LinkProvider } from "@photon-ai/pho-ui/utils";
47
+
48
+ <LinkProvider component={MyRouterLink}>{app}</LinkProvider>;
49
+ ```
@@ -0,0 +1,334 @@
1
+ "use client";
2
+ import { t as p } from "./cn-D6jQqeRj.js";
3
+ import { n as T, r as S } from "./link-provider-9TFNyDqO.js";
4
+ import { t as m } from "./resolve-variant-CcD8iG5l.js";
5
+ import { isValidElement as B, useMemo as R } from "react";
6
+ import { Fragment as _, jsx as t, jsxs as g } from "react/jsx-runtime";
7
+ import { motion as y } from "motion/react";
8
+ var q = p("group relative inline-flex h-max cursor-pointer items-center justify-center whitespace-nowrap outline-pho-brand transition duration-100 ease-linear before:absolute focus-visible:outline-2 focus-visible:outline-offset-2", "disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none"), M = {
9
+ sm: {
10
+ classes: "gap-1 px-3 py-2 text-sm font-semibold data-svg-only:p-2",
11
+ description: "Small — compact rows, tables, and toolbars"
12
+ },
13
+ md: {
14
+ classes: "gap-1 px-3.5 py-2.5 text-sm font-semibold data-svg-only:p-2.5",
15
+ description: "Medium — the default"
16
+ },
17
+ lg: {
18
+ classes: "gap-1.5 px-4 py-2.5 text-md font-semibold data-svg-only:p-3",
19
+ description: "Large — prominent and marketing actions"
20
+ }
21
+ }, O = {
22
+ square: {
23
+ classes: "rounded-lg before:rounded-[7px]",
24
+ description: "Default — gently rounded corners"
25
+ },
26
+ circle: {
27
+ classes: "rounded-full before:rounded-full",
28
+ description: "Circular — pair with svgOnly for round icon buttons"
29
+ },
30
+ rounded: {
31
+ classes: "rounded-full before:rounded-full",
32
+ description: "Pill — marketing CTAs, often with shadow"
33
+ }
34
+ }, z = {
35
+ primary: {
36
+ classes: "bg-pho-brand-solid text-white shadow-pho-skeuo-xs ring-1 ring-transparent ring-inset hover:bg-pho-brand-solid-hover data-loading:bg-pho-brand-solid-hover before:absolute before:inset-px before:border before:border-white/12 before:mask-b-from-0% *:data-icon:text-white/60 hover:*:data-icon:text-white/70",
37
+ description: "High-emphasis primary action (default)"
38
+ },
39
+ secondary: {
40
+ classes: "bg-pho-primary text-pho-secondary shadow-pho-skeuo-xs ring-1 ring-pho-primary ring-inset hover:bg-pho-primary-hover hover:text-pho-secondary-hover data-loading:bg-pho-primary-hover *:data-icon:text-fg-pho-quaternary hover:*:data-icon:text-fg-pho-quaternary-hover",
41
+ description: "Neutral, supporting action"
42
+ },
43
+ tertiary: {
44
+ classes: "text-pho-tertiary hover:bg-pho-primary-hover hover:text-pho-tertiary-hover data-loading:bg-pho-primary-hover *:data-icon:text-fg-pho-quaternary hover:*:data-icon:text-fg-pho-quaternary-hover",
45
+ description: "Low-emphasis, borderless action"
46
+ },
47
+ error: {
48
+ classes: "bg-pho-error-solid text-white shadow-pho-skeuo-xs ring-1 ring-transparent outline-pho-error ring-inset hover:bg-pho-error-solid-hover data-loading:bg-pho-error-solid-hover before:absolute before:inset-px before:border before:border-white/12 before:mask-b-from-0% *:data-icon:text-white/60 hover:*:data-icon:text-white/70",
49
+ description: "Destructive confirmation"
50
+ }
51
+ };
52
+ function C(e) {
53
+ const { variant: r = "primary", size: i = "md", shape: n = "square", shadow: a, className: s } = e ?? {};
54
+ return p(q, m(O, n), m(M, i), m(z, r), a && "shadow-pho-md", s);
55
+ }
56
+ var D = "transition-inherit-all pointer-events-none inline-flex shrink-0 items-center [&>svg]:size-5 [&>svg]:shrink-0";
57
+ function b({ position: e, children: r }) {
58
+ return /* @__PURE__ */ t("span", {
59
+ "data-icon": e,
60
+ className: D,
61
+ children: r
62
+ });
63
+ }
64
+ function v() {
65
+ return /* @__PURE__ */ g("svg", {
66
+ fill: "none",
67
+ viewBox: "0 0 20 20",
68
+ "aria-hidden": "true",
69
+ children: [/* @__PURE__ */ t("circle", {
70
+ className: "stroke-current opacity-30",
71
+ cx: "10",
72
+ cy: "10",
73
+ r: "8",
74
+ fill: "none",
75
+ strokeWidth: "2"
76
+ }), /* @__PURE__ */ t("circle", {
77
+ className: "origin-center animate-spin stroke-current",
78
+ cx: "10",
79
+ cy: "10",
80
+ r: "8",
81
+ fill: "none",
82
+ strokeWidth: "2",
83
+ strokeDasharray: "12.5 50",
84
+ strokeLinecap: "round"
85
+ })]
86
+ });
87
+ }
88
+ function w(e, r) {
89
+ return e == null || e === !1 ? null : S(e) ? /* @__PURE__ */ t(b, {
90
+ position: r,
91
+ children: /* @__PURE__ */ t(e, {})
92
+ }) : B(e) ? /* @__PURE__ */ t(b, {
93
+ position: r,
94
+ children: e
95
+ }) : null;
96
+ }
97
+ function F({ svgOnly: e, loading: r, prefix: i, suffix: n, children: a }) {
98
+ return e ? r ? /* @__PURE__ */ t(v, {}) : a : /* @__PURE__ */ g(_, { children: [
99
+ r ? /* @__PURE__ */ t(b, {
100
+ position: "loading",
101
+ children: /* @__PURE__ */ t(v, {})
102
+ }) : w(i, "prefix"),
103
+ a != null && a !== !1 && /* @__PURE__ */ t("span", {
104
+ "data-text": !0,
105
+ className: "transition-inherit-all px-0.5",
106
+ children: a
107
+ }),
108
+ w(n, "suffix")
109
+ ] });
110
+ }
111
+ function x(e, r) {
112
+ e && !r && typeof process < "u" && process.env.NODE_ENV !== "production" && console.warn("Button: `svgOnly` buttons require an `aria-label` that names the action.");
113
+ }
114
+ function H({ variant: e, size: r, shape: i, shadow: n, prefix: a, suffix: s, svgOnly: o, loading: d, children: u, className: c, ref: l, ...h }) {
115
+ return x(o, h["aria-label"]), /* @__PURE__ */ t("button", {
116
+ ref: l,
117
+ type: "button",
118
+ ...h,
119
+ "aria-busy": d || void 0,
120
+ "data-loading": d ? "true" : void 0,
121
+ "data-svg-only": o ? "true" : void 0,
122
+ className: p(C({
123
+ variant: e,
124
+ size: r,
125
+ shape: i,
126
+ shadow: n
127
+ }), d && "pointer-events-none", o && "[&>svg]:size-5 [&>svg]:shrink-0", c),
128
+ children: F({
129
+ svgOnly: o,
130
+ loading: d,
131
+ prefix: a,
132
+ suffix: s,
133
+ children: u
134
+ })
135
+ });
136
+ }
137
+ H.displayName = "Button";
138
+ function U({ variant: e, size: r, shape: i, shadow: n, prefix: a, suffix: s, svgOnly: o, loading: d, disabled: u, href: c, children: l, className: h, ...f }) {
139
+ return x(o, f["aria-label"]), /* @__PURE__ */ t(T(), {
140
+ href: c,
141
+ ...f,
142
+ "aria-disabled": u || d || void 0,
143
+ "aria-busy": d || void 0,
144
+ "data-loading": d ? "true" : void 0,
145
+ "data-svg-only": o ? "true" : void 0,
146
+ className: p(C({
147
+ variant: e,
148
+ size: r,
149
+ shape: i,
150
+ shadow: n
151
+ }), d && "pointer-events-none", o && "[&>svg]:size-5 [&>svg]:shrink-0", h),
152
+ children: F({
153
+ svgOnly: o,
154
+ loading: d,
155
+ prefix: a,
156
+ suffix: s,
157
+ children: l
158
+ })
159
+ });
160
+ }
161
+ U.displayName = "ButtonLink";
162
+ var j = p("squircle relative inline-flex h-max cursor-pointer items-center justify-center overflow-hidden rounded-full border font-medium whitespace-nowrap", "outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-2", "disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50"), A = {
163
+ type: "spring",
164
+ stiffness: 200,
165
+ damping: 30,
166
+ mass: 0.1
167
+ }, P = "inset 0px 0px 5px 2px rgba(255, 255, 255, 0.5)", N = {
168
+ sm: {
169
+ boxShadow: "inset 0px -3px 8px 2px rgba(255, 255, 255, 0.5)",
170
+ gap: 0
171
+ },
172
+ md: {
173
+ boxShadow: "inset 0px -6px 14px 1px rgba(255, 255, 255, 0.5)",
174
+ gap: 4
175
+ }
176
+ }, W = {
177
+ sm: {
178
+ classes: "p-2 text-sm data-svg-only:p-2",
179
+ description: "Small — the compact 'Variant 2' (14px label, 8px padding)"
180
+ },
181
+ md: {
182
+ classes: "px-4 py-3 text-md data-svg-only:p-3",
183
+ description: "Medium — the 'Variant 1' (16px label, 12×16 padding)"
184
+ }
185
+ }, Z = {
186
+ primary: {
187
+ classes: "border-white/15 bg-pho-brand-solid text-white",
188
+ description: "Brand fill with the glossy inset sheen (default)"
189
+ },
190
+ secondary: {
191
+ classes: "border-transparent bg-pho-primary text-pho-secondary shadow-pho-skeuo-xs ring-1 ring-pho-primary ring-inset transition-colors duration-100 ease-linear hover:bg-pho-primary-hover hover:text-pho-secondary-hover data-loading:bg-pho-primary-hover",
192
+ description: "Neutral white-card pill (OAuth / supporting CTA), no sheen"
193
+ }
194
+ };
195
+ function L(e) {
196
+ const { variant: r = "primary", size: i = "md", fullWidth: n, className: a } = e ?? {};
197
+ return p(j, m(W, i), m(Z, r), n && "w-full", a);
198
+ }
199
+ function G(e, r) {
200
+ return r === "secondary" ? {
201
+ rest: { gap: 0 },
202
+ hover: { gap: N[e].gap }
203
+ } : {
204
+ rest: {
205
+ boxShadow: P,
206
+ gap: 0
207
+ },
208
+ hover: N[e]
209
+ };
210
+ }
211
+ var J = {
212
+ rest: {
213
+ opacity: 0,
214
+ width: 1,
215
+ height: 10
216
+ },
217
+ hover: {
218
+ opacity: 1,
219
+ width: 20,
220
+ height: 21
221
+ }
222
+ };
223
+ function E({ position: e, children: r }) {
224
+ return /* @__PURE__ */ t(y.span, {
225
+ "data-icon": e,
226
+ variants: J,
227
+ transition: A,
228
+ style: {
229
+ display: "inline-flex",
230
+ flex: "none",
231
+ alignItems: "center",
232
+ overflow: "hidden"
233
+ },
234
+ className: "pointer-events-none [&>svg]:block [&>svg]:size-full",
235
+ children: r
236
+ });
237
+ }
238
+ function k(e, r) {
239
+ return e == null || e === !1 ? null : S(e) ? /* @__PURE__ */ t(E, {
240
+ position: r,
241
+ children: /* @__PURE__ */ t(e, {})
242
+ }) : B(e) ? /* @__PURE__ */ t(E, {
243
+ position: r,
244
+ children: e
245
+ }) : null;
246
+ }
247
+ function V({ svgOnly: e, loading: r, prefix: i, suffix: n, children: a }) {
248
+ return e ? r ? /* @__PURE__ */ t(v, {}) : a : /* @__PURE__ */ g(_, { children: [
249
+ r ? /* @__PURE__ */ t(b, {
250
+ position: "loading",
251
+ children: /* @__PURE__ */ t(v, {})
252
+ }) : k(i, "prefix"),
253
+ a != null && a !== !1 && /* @__PURE__ */ t("span", {
254
+ "data-text": !0,
255
+ className: "px-0.5",
256
+ children: a
257
+ }),
258
+ k(n, "suffix")
259
+ ] });
260
+ }
261
+ function I(e, r) {
262
+ return {
263
+ initial: !1,
264
+ animate: "rest",
265
+ whileHover: "hover",
266
+ variants: G(e, r),
267
+ transition: A
268
+ };
269
+ }
270
+ function K({ variant: e = "primary", size: r = "md", fullWidth: i, prefix: n, suffix: a, svgOnly: s, loading: o, children: d, className: u, ref: c, ...l }) {
271
+ return x(s, l["aria-label"]), /* @__PURE__ */ t(y.button, {
272
+ ref: c,
273
+ type: "button",
274
+ ...I(r, e),
275
+ ...l,
276
+ "aria-busy": o || void 0,
277
+ "data-loading": o ? "true" : void 0,
278
+ "data-svg-only": s ? "true" : void 0,
279
+ className: p(L({
280
+ variant: e,
281
+ size: r,
282
+ fullWidth: i
283
+ }), o && "pointer-events-none", s && "[&>svg]:size-5 [&>svg]:shrink-0", u),
284
+ children: V({
285
+ svgOnly: s,
286
+ loading: o,
287
+ prefix: n,
288
+ suffix: a,
289
+ children: d
290
+ })
291
+ });
292
+ }
293
+ K.displayName = "EffectButton";
294
+ function Q({ variant: e = "primary", size: r = "md", fullWidth: i, prefix: n, suffix: a, svgOnly: s, loading: o, disabled: d, href: u, children: c, className: l, ...h }) {
295
+ x(s, h["aria-label"]);
296
+ const f = T();
297
+ return /* @__PURE__ */ t(R(() => y.create(f), [f]), {
298
+ href: u,
299
+ ...I(r, e),
300
+ ...h,
301
+ "aria-disabled": d || o || void 0,
302
+ "aria-busy": o || void 0,
303
+ "data-loading": o ? "true" : void 0,
304
+ "data-svg-only": s ? "true" : void 0,
305
+ className: p(L({
306
+ variant: e,
307
+ size: r,
308
+ fullWidth: i
309
+ }), o && "pointer-events-none", s && "[&>svg]:size-5 [&>svg]:shrink-0", l),
310
+ children: V({
311
+ svgOnly: s,
312
+ loading: o,
313
+ prefix: n,
314
+ suffix: a,
315
+ children: c
316
+ })
317
+ });
318
+ }
319
+ Q.displayName = "EffectButtonLink";
320
+ export {
321
+ U as a,
322
+ K as c,
323
+ L as d,
324
+ H as i,
325
+ Q as l,
326
+ M as n,
327
+ W as o,
328
+ z as r,
329
+ Z as s,
330
+ O as t,
331
+ C as u
332
+ };
333
+
334
+ //# sourceMappingURL=button-9pp4g7en.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-9pp4g7en.js","names":[],"sources":["../../src/components/button/button.tsx"],"sourcesContent":["import {\n isValidElement,\n useMemo,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type FC,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { motion, type HTMLMotionProps } from \"motion/react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\nimport { isReactComponent } from \"../../utils/is-react-component\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\n\n/**\n * Design notes (Geist-aligned):\n * - ONE emphasis axis, kept deliberately small. `variant` is a closed,\n * semantic set — a single high-emphasis default plus the supporting and\n * intent variants you actually reach for. There is no `ghost`, no `link`,\n * and no second destructive: navigation belongs to `ButtonLink`, and an\n * inline text link is an anchor, not a button.\n * - THREE sizes (`sm` / `md` / `lg`, default `md`). No `xs` / `xl`.\n * - `prefix` / `suffix` are generic slots (icon, spinner, count…), not\n * icon-only props. `svgOnly` makes an icon button and *requires* an\n * `aria-label`. Boolean flags (`loading`, `shadow`) are declarative.\n */\n\nconst COMMON_ROOT = cn(\n \"group relative inline-flex h-max cursor-pointer items-center justify-center whitespace-nowrap outline-pho-brand transition duration-100 ease-linear before:absolute focus-visible:outline-2 focus-visible:outline-offset-2\",\n // Disabled (native `disabled` on <button>, `aria-disabled` on links).\n \"disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none\",\n);\n\n/** Size axis — padding, text size, and icon-only (svgOnly) padding. */\nexport const BUTTON_SIZES = {\n sm: {\n classes: \"gap-1 px-3 py-2 text-sm font-semibold data-svg-only:p-2\",\n description: \"Small — compact rows, tables, and toolbars\",\n },\n md: {\n classes: \"gap-1 px-3.5 py-2.5 text-sm font-semibold data-svg-only:p-2.5\",\n description: \"Medium — the default\",\n },\n lg: {\n classes: \"gap-1.5 px-4 py-2.5 text-md font-semibold data-svg-only:p-3\",\n description: \"Large — prominent and marketing actions\",\n },\n} satisfies VariantMap;\n\n/** Shape axis — corner treatment. `square` is the default text-button shape. */\nexport const BUTTON_SHAPES = {\n square: {\n classes: \"rounded-lg before:rounded-[7px]\",\n description: \"Default — gently rounded corners\",\n },\n circle: {\n classes: \"rounded-full before:rounded-full\",\n description: \"Circular — pair with svgOnly for round icon buttons\",\n },\n rounded: {\n classes: \"rounded-full before:rounded-full\",\n description: \"Pill — marketing CTAs, often with shadow\",\n },\n} satisfies VariantMap;\n\n/** Emphasis axis — a tight, semantic set. `primary` is the default. */\nexport const BUTTON_VARIANTS = {\n primary: {\n classes:\n \"bg-pho-brand-solid text-white shadow-pho-skeuo-xs ring-1 ring-transparent ring-inset hover:bg-pho-brand-solid-hover data-loading:bg-pho-brand-solid-hover before:absolute before:inset-px before:border before:border-white/12 before:mask-b-from-0% *:data-icon:text-white/60 hover:*:data-icon:text-white/70\",\n description: \"High-emphasis primary action (default)\",\n },\n secondary: {\n classes:\n \"bg-pho-primary text-pho-secondary shadow-pho-skeuo-xs ring-1 ring-pho-primary ring-inset hover:bg-pho-primary-hover hover:text-pho-secondary-hover data-loading:bg-pho-primary-hover *:data-icon:text-fg-pho-quaternary hover:*:data-icon:text-fg-pho-quaternary-hover\",\n description: \"Neutral, supporting action\",\n },\n tertiary: {\n classes:\n \"text-pho-tertiary hover:bg-pho-primary-hover hover:text-pho-tertiary-hover data-loading:bg-pho-primary-hover *:data-icon:text-fg-pho-quaternary hover:*:data-icon:text-fg-pho-quaternary-hover\",\n description: \"Low-emphasis, borderless action\",\n },\n error: {\n classes:\n \"bg-pho-error-solid text-white shadow-pho-skeuo-xs ring-1 ring-transparent outline-pho-error ring-inset hover:bg-pho-error-solid-hover data-loading:bg-pho-error-solid-hover before:absolute before:inset-px before:border before:border-white/12 before:mask-b-from-0% *:data-icon:text-white/60 hover:*:data-icon:text-white/70\",\n description: \"Destructive confirmation\",\n },\n} satisfies VariantMap;\n\nexport type ButtonSize = keyof typeof BUTTON_SIZES;\nexport type ButtonShape = keyof typeof BUTTON_SHAPES;\nexport type ButtonVariant = keyof typeof BUTTON_VARIANTS;\n\n/** Compose the full class string for a button — exported for reuse/testing. */\nexport function buttonVariants(opts?: {\n variant?: ButtonVariant;\n size?: ButtonSize;\n shape?: ButtonShape;\n shadow?: boolean;\n className?: string;\n}): string {\n const {\n variant = \"primary\",\n size = \"md\",\n shape = \"square\",\n shadow,\n className,\n } = opts ?? {};\n return cn(\n COMMON_ROOT,\n resolveVariant(BUTTON_SHAPES, shape),\n resolveVariant(BUTTON_SIZES, size),\n resolveVariant(BUTTON_VARIANTS, variant),\n shadow && \"shadow-pho-md\",\n className,\n );\n}\n\n/** An icon/element slot rendered before or after the label. */\ntype Slottable = ReactNode | FC<{ className?: string }>;\n\ninterface ButtonBaseProps {\n /** Emphasis variant. @default \"primary\" */\n variant?: ButtonVariant;\n /** Size variant. @default \"md\" */\n size?: ButtonSize;\n /** Corner shape. @default \"square\" */\n shape?: ButtonShape;\n /** Add an elevation shadow (marketing / `rounded`). */\n shadow?: boolean;\n /** Slot before the label — a component (`Plus`) or element (`<Plus />`). */\n prefix?: Slottable;\n /** Slot after the label. */\n suffix?: Slottable;\n /** Render as an icon-only button. Requires an `aria-label`. */\n svgOnly?: boolean;\n /** Show a spinner and block interaction while staying readable. */\n loading?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\nexport interface ButtonProps\n extends\n ButtonBaseProps,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonBaseProps> {\n ref?: Ref<HTMLButtonElement>;\n}\n\nexport interface ButtonLinkProps\n extends\n ButtonBaseProps,\n Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof ButtonBaseProps> {\n /** Navigate to this URL (rendered via the host's `LinkProvider`). */\n href: string;\n /** Visually and semantically disable the link. */\n disabled?: boolean;\n}\n\nconst SLOT_CLASS =\n \"transition-inherit-all pointer-events-none inline-flex shrink-0 items-center [&>svg]:size-5 [&>svg]:shrink-0\";\n\nfunction Slot({\n position,\n children,\n}: {\n position: \"prefix\" | \"suffix\" | \"loading\";\n children: ReactNode;\n}) {\n return (\n <span data-icon={position} className={SLOT_CLASS}>\n {children}\n </span>\n );\n}\n\nfunction Spinner() {\n return (\n <svg fill=\"none\" viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <circle\n className=\"stroke-current opacity-30\"\n cx=\"10\"\n cy=\"10\"\n r=\"8\"\n fill=\"none\"\n strokeWidth=\"2\"\n />\n <circle\n className=\"origin-center animate-spin stroke-current\"\n cx=\"10\"\n cy=\"10\"\n r=\"8\"\n fill=\"none\"\n strokeWidth=\"2\"\n strokeDasharray=\"12.5 50\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction renderSlot(icon: Slottable, position: \"prefix\" | \"suffix\") {\n if (icon == null || icon === false) return null;\n if (isReactComponent(icon)) {\n const Icon = icon;\n return (\n <Slot position={position}>\n <Icon />\n </Slot>\n );\n }\n if (isValidElement(icon)) return <Slot position={position}>{icon}</Slot>;\n return null;\n}\n\nfunction buttonInner({\n svgOnly,\n loading,\n prefix,\n suffix,\n children,\n}: Pick<\n ButtonBaseProps,\n \"svgOnly\" | \"loading\" | \"prefix\" | \"suffix\" | \"children\"\n>) {\n if (svgOnly) {\n return loading ? <Spinner /> : children;\n }\n return (\n <>\n {loading ? (\n <Slot position=\"loading\">\n <Spinner />\n </Slot>\n ) : (\n renderSlot(prefix, \"prefix\")\n )}\n {children != null && children !== false && (\n <span data-text className=\"transition-inherit-all px-0.5\">\n {children}\n </span>\n )}\n {renderSlot(suffix, \"suffix\")}\n </>\n );\n}\n\nfunction warnMissingLabel(svgOnly: boolean | undefined, label: unknown) {\n if (\n svgOnly &&\n !label &&\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n ) {\n console.warn(\n \"Button: `svgOnly` buttons require an `aria-label` that names the action.\",\n );\n }\n}\n\n/**\n * Button — triggers an action that mutates state (submit, save, delete).\n * For navigation that changes the URL, use {@link ButtonLink}.\n */\nexport function Button({\n variant,\n size,\n shape,\n shadow,\n prefix,\n suffix,\n svgOnly,\n loading,\n children,\n className,\n ref,\n ...props\n}: ButtonProps) {\n warnMissingLabel(svgOnly, props[\"aria-label\"]);\n return (\n <button\n ref={ref}\n type=\"button\"\n {...props}\n aria-busy={loading || undefined}\n data-loading={loading ? \"true\" : undefined}\n data-svg-only={svgOnly ? \"true\" : undefined}\n className={cn(\n buttonVariants({ variant, size, shape, shadow }),\n loading && \"pointer-events-none\",\n svgOnly && \"[&>svg]:size-5 [&>svg]:shrink-0\",\n className,\n )}\n >\n {buttonInner({ svgOnly, loading, prefix, suffix, children })}\n </button>\n );\n}\n\nButton.displayName = \"Button\";\n\n/**\n * ButtonLink — a link styled as a button, for navigation that changes the URL.\n * Shares every visual prop with {@link Button}; renders the host router's link\n * via `LinkProvider`.\n */\nexport function ButtonLink({\n variant,\n size,\n shape,\n shadow,\n prefix,\n suffix,\n svgOnly,\n loading,\n disabled,\n href,\n children,\n className,\n ...props\n}: ButtonLinkProps) {\n warnMissingLabel(svgOnly, props[\"aria-label\"]);\n const Link = useLinkComponent();\n return (\n <Link\n href={href}\n {...props}\n aria-disabled={disabled || loading || undefined}\n aria-busy={loading || undefined}\n data-loading={loading ? \"true\" : undefined}\n data-svg-only={svgOnly ? \"true\" : undefined}\n className={cn(\n buttonVariants({ variant, size, shape, shadow }),\n loading && \"pointer-events-none\",\n svgOnly && \"[&>svg]:size-5 [&>svg]:shrink-0\",\n className,\n )}\n >\n {buttonInner({ svgOnly, loading, prefix, suffix, children })}\n </Link>\n );\n}\n\nButtonLink.displayName = \"ButtonLink\";\n\n/* ============================= Effect button ============================= */\n\n/**\n * A frame-exact port of Photon's Framer \"Button - Effect\", driven by Motion\n * (the same engine Framer renders with) so every frame matches the source — not\n * a CSS approximation. On hover, three things spring together on the *identical*\n * transition (`spring-physics 200 30 0.1` → stiffness 200 / damping 30 / mass\n * 0.1): a glossy inset white sheen reshapes toward the bottom edge, the gap\n * eases open (md), and any icon grows and fades in from nothing.\n *\n * Because it's a real spring — not a fixed-duration tween — it's also velocity-\n * correct: hovering out mid-animation continues from the current velocity,\n * exactly like Framer.\n *\n * Fill and stroke are STATIC (the source keeps them identical between the base\n * and hover variants); `variant` picks the treatment — `primary` is the source\n * brand pill with the glossy sheen, `secondary` the neutral white-card pill\n * (Button's secondary surface tokens) with the sheen omitted. The gap + icon\n * reveal springs are shared. `size` maps to the two source variants: `md` =\n * \"Variant 1\" (16px label, 12×16 padding), `sm` = \"Variant 2\" (14px label,\n * 8px padding).\n */\nconst EFFECT_ROOT = cn(\n // Every variant keeps the 1px border so the pill geometry never shifts.\n \"squircle relative inline-flex h-max cursor-pointer items-center justify-center overflow-hidden rounded-full border font-medium whitespace-nowrap\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-2\",\n \"disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50\",\n);\n\n/** The exact source transition: `spring-physics 200 30 0.1` (stiffness/damping/mass). */\nconst EFFECT_SPRING = {\n type: \"spring\",\n stiffness: 200,\n damping: 30,\n mass: 0.1,\n} as const;\n\n/** Resting inset sheen — identical across both sizes (source base variants). */\nconst EFFECT_REST_SHADOW = \"inset 0px 0px 5px 2px rgba(255, 255, 255, 0.5)\";\n\n/** Per-size hover targets, sampled 1:1 from the source hover (gesture) variants. */\nconst EFFECT_HOVER = {\n sm: { boxShadow: \"inset 0px -3px 8px 2px rgba(255, 255, 255, 0.5)\", gap: 0 },\n md: { boxShadow: \"inset 0px -6px 14px 1px rgba(255, 255, 255, 0.5)\", gap: 4 },\n} as const;\n\n/** Size axis for {@link EffectButton} — padding + label size per source variant. */\nexport const EFFECT_BUTTON_SIZES = {\n sm: {\n classes: \"p-2 text-sm data-svg-only:p-2\",\n description: \"Small — the compact 'Variant 2' (14px label, 8px padding)\",\n },\n md: {\n classes: \"px-4 py-3 text-md data-svg-only:p-3\",\n description: \"Medium — the 'Variant 1' (16px label, 12×16 padding)\",\n },\n} satisfies VariantMap;\n\n/**\n * Emphasis axis for {@link EffectButton} — the static fill + edge treatment.\n * `secondary` reuses the white-card surface tokens of Button's `secondary`\n * (white card, hairline ring, quiet hover) and skips the glossy sheen — that\n * inset shine is the brand-fill treatment.\n */\nexport const EFFECT_BUTTON_VARIANTS = {\n primary: {\n classes: \"border-white/15 bg-pho-brand-solid text-white\",\n description: \"Brand fill with the glossy inset sheen (default)\",\n },\n secondary: {\n classes:\n \"border-transparent bg-pho-primary text-pho-secondary shadow-pho-skeuo-xs ring-1 ring-pho-primary ring-inset transition-colors duration-100 ease-linear hover:bg-pho-primary-hover hover:text-pho-secondary-hover data-loading:bg-pho-primary-hover\",\n description: \"Neutral white-card pill (OAuth / supporting CTA), no sheen\",\n },\n} satisfies VariantMap;\n\nexport type EffectButtonSize = keyof typeof EFFECT_BUTTON_SIZES;\nexport type EffectButtonVariant = keyof typeof EFFECT_BUTTON_VARIANTS;\n\n/** Compose the static class string for an effect button — exported for reuse. */\nexport function effectButtonVariants(opts?: {\n variant?: EffectButtonVariant;\n size?: EffectButtonSize;\n fullWidth?: boolean;\n className?: string;\n}): string {\n const { variant = \"primary\", size = \"md\", fullWidth, className } = opts ?? {};\n return cn(\n EFFECT_ROOT,\n resolveVariant(EFFECT_BUTTON_SIZES, size),\n resolveVariant(EFFECT_BUTTON_VARIANTS, variant),\n fullWidth && \"w-full\",\n className,\n );\n}\n\n/**\n * Motion variants for the pill root — the sheen (+ gap on md) spring on hover.\n * `secondary` springs only the gap: its box-shadow stays with the CSS classes\n * (ring + skeuomorphic shadow), so Motion must never write an inline one.\n */\nfunction effectRootVariants(\n size: EffectButtonSize,\n variant: EffectButtonVariant,\n) {\n if (variant === \"secondary\") {\n return {\n rest: { gap: 0 },\n hover: { gap: EFFECT_HOVER[size].gap },\n };\n }\n return {\n rest: { boxShadow: EFFECT_REST_SHADOW, gap: 0 },\n hover: EFFECT_HOVER[size],\n };\n}\n\n/**\n * Icon reveal — a 1:1 port of the source \"Arrow Right\" instance: collapsed and\n * invisible at rest (opacity 0, 1×10px), grown to full size on hover (opacity 1,\n * 20×21px). The child inherits the pill's `rest`/`hover` variant label, so it\n * springs in perfect lockstep with the sheen and gap.\n */\nconst EFFECT_ICON_VARIANTS = {\n rest: { opacity: 0, width: 1, height: 10 },\n hover: { opacity: 1, width: 20, height: 21 },\n} as const;\n\nfunction EffectSlot({\n position,\n children,\n}: {\n position: \"prefix\" | \"suffix\";\n children: ReactNode;\n}) {\n return (\n <motion.span\n data-icon={position}\n variants={EFFECT_ICON_VARIANTS}\n transition={EFFECT_SPRING}\n style={{\n display: \"inline-flex\",\n flex: \"none\",\n alignItems: \"center\",\n overflow: \"hidden\",\n }}\n className=\"pointer-events-none [&>svg]:block [&>svg]:size-full\"\n >\n {children}\n </motion.span>\n );\n}\n\nfunction renderEffectSlot(icon: Slottable, position: \"prefix\" | \"suffix\") {\n if (icon == null || icon === false) return null;\n if (isReactComponent(icon)) {\n const Icon = icon;\n return (\n <EffectSlot position={position}>\n <Icon />\n </EffectSlot>\n );\n }\n if (isValidElement(icon))\n return <EffectSlot position={position}>{icon}</EffectSlot>;\n return null;\n}\n\nfunction effectButtonInner({\n svgOnly,\n loading,\n prefix,\n suffix,\n children,\n}: Pick<\n EffectButtonBaseProps,\n \"svgOnly\" | \"loading\" | \"prefix\" | \"suffix\" | \"children\"\n>) {\n // An icon-only button keeps its icon always visible (nothing to reveal).\n if (svgOnly) return loading ? <Spinner /> : children;\n return (\n <>\n {loading ? (\n <Slot position=\"loading\">\n <Spinner />\n </Slot>\n ) : (\n renderEffectSlot(prefix, \"prefix\")\n )}\n {children != null && children !== false && (\n <span data-text className=\"px-0.5\">\n {children}\n </span>\n )}\n {renderEffectSlot(suffix, \"suffix\")}\n </>\n );\n}\n\n/** Motion props (initial/animate/hover/variants/transition) shared by both roots. */\nfunction effectMotionProps(\n size: EffectButtonSize,\n variant: EffectButtonVariant,\n) {\n return {\n initial: false as const,\n animate: \"rest\",\n whileHover: \"hover\",\n variants: effectRootVariants(size, variant),\n transition: EFFECT_SPRING,\n };\n}\n\n// Motion redefines these DOM handlers; drop them from our public props so\n// spreading onto a motion element type-checks cleanly.\ntype MotionConflicts =\n | \"onAnimationStart\"\n | \"onAnimationEnd\"\n | \"onAnimationIteration\"\n | \"onDrag\"\n | \"onDragStart\"\n | \"onDragEnd\"\n | \"onDragEnter\"\n | \"onDragExit\"\n | \"onDragLeave\"\n | \"onDragOver\"\n | \"onDrop\"\n | \"style\";\n\ninterface EffectButtonBaseProps {\n /** Emphasis variant. @default \"primary\" */\n variant?: EffectButtonVariant;\n /** Size variant. @default \"md\" */\n size?: EffectButtonSize;\n /** Stretch to the container's full width (stacked login / OAuth pills). */\n fullWidth?: boolean;\n /** Slot before the label — a component (`Plus`) or element (`<Plus />`). */\n prefix?: Slottable;\n /** Slot after the label. */\n suffix?: Slottable;\n /** Render as an icon-only button. Requires an `aria-label`. */\n svgOnly?: boolean;\n /** Show a spinner and block interaction while staying readable. */\n loading?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\nexport interface EffectButtonProps\n extends\n EffectButtonBaseProps,\n Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n keyof EffectButtonBaseProps | MotionConflicts\n > {\n ref?: Ref<HTMLButtonElement>;\n}\n\nexport interface EffectButtonLinkProps\n extends\n EffectButtonBaseProps,\n Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof EffectButtonBaseProps | MotionConflicts\n > {\n /** Navigate to this URL (rendered via the host's `LinkProvider`). */\n href: string;\n /** Visually and semantically disable the link. */\n disabled?: boolean;\n}\n\n/**\n * EffectButton — the glossy, springy pill ported frame-for-frame from Photon's\n * Framer \"Button - Effect\", driven by Motion. `variant=\"secondary\"` swaps the\n * brand fill for the neutral white-card surface without the sheen (the login /\n * OAuth pill), and `fullWidth` stretches the pill across its container.\n * Triggers an action; for navigation use {@link EffectButtonLink}.\n */\nexport function EffectButton({\n variant = \"primary\",\n size = \"md\",\n fullWidth,\n prefix,\n suffix,\n svgOnly,\n loading,\n children,\n className,\n ref,\n ...props\n}: EffectButtonProps) {\n warnMissingLabel(svgOnly, props[\"aria-label\"]);\n return (\n <motion.button\n ref={ref}\n type=\"button\"\n {...effectMotionProps(size, variant)}\n {...props}\n aria-busy={loading || undefined}\n data-loading={loading ? \"true\" : undefined}\n data-svg-only={svgOnly ? \"true\" : undefined}\n className={cn(\n effectButtonVariants({ variant, size, fullWidth }),\n loading && \"pointer-events-none\",\n svgOnly && \"[&>svg]:size-5 [&>svg]:shrink-0\",\n className,\n )}\n >\n {effectButtonInner({ svgOnly, loading, prefix, suffix, children })}\n </motion.button>\n );\n}\n\nEffectButton.displayName = \"EffectButton\";\n\n/**\n * EffectButtonLink — {@link EffectButton} as a link, for navigation that changes\n * the URL. Renders the host router's link (via `LinkProvider`) wrapped by Motion,\n * so the pill animates identically to the button.\n */\nexport function EffectButtonLink({\n variant = \"primary\",\n size = \"md\",\n fullWidth,\n prefix,\n suffix,\n svgOnly,\n loading,\n disabled,\n href,\n children,\n className,\n ...props\n}: EffectButtonLinkProps) {\n warnMissingLabel(svgOnly, props[\"aria-label\"]);\n const Link = useLinkComponent();\n // Wrap the host link once per link identity so Motion can drive the DOM node.\n const MotionLink = useMemo(() => motion.create(Link), [Link]);\n return (\n <MotionLink\n href={href}\n {...effectMotionProps(size, variant)}\n {...(props as HTMLMotionProps<\"a\">)}\n aria-disabled={disabled || loading || undefined}\n aria-busy={loading || undefined}\n data-loading={loading ? \"true\" : undefined}\n data-svg-only={svgOnly ? \"true\" : undefined}\n className={cn(\n effectButtonVariants({ variant, size, fullWidth }),\n loading && \"pointer-events-none\",\n svgOnly && \"[&>svg]:size-5 [&>svg]:shrink-0\",\n className,\n )}\n >\n {effectButtonInner({ svgOnly, loading, prefix, suffix, children })}\n </MotionLink>\n );\n}\n\nEffectButtonLink.displayName = \"EffectButtonLink\";\n"],"mappings":";;;;;;;AA4BA,IAAM,IAAc,EAClB,8NAEA,6IACF,GAGa,IAAe;AAAA,EAC1B,IAAI;AAAA,IACF,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,IAAI;AAAA,IACF,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,IAAI;AAAA,IACF,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AACF,GAGa,IAAgB;AAAA,EAC3B,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AACF,GAGa,IAAkB;AAAA,EAC7B,SAAS;AAAA,IACP,SACE;AAAA,IACF,aAAa;AAAA,EACf;AAAA,EACA,WAAW;AAAA,IACT,SACE;AAAA,IACF,aAAa;AAAA,EACf;AAAA,EACA,UAAU;AAAA,IACR,SACE;AAAA,IACF,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,IACL,SACE;AAAA,IACF,aAAa;AAAA,EACf;AACF;AAOA,SAAgB,EAAe,GAMpB;AACT,QAAM,EACJ,SAAA,IAAU,WACV,MAAA,IAAO,MACP,OAAA,IAAQ,UACR,QAAA,GACA,WAAA,EAAA,IACE,KAAQ,CAAC;AACb,SAAO,EACL,GACA,EAAe,GAAe,CAAK,GACnC,EAAe,GAAc,CAAI,GACjC,EAAe,GAAiB,CAAO,GACvC,KAAU,iBACV,CACF;AACF;AA2CA,IAAM,IACJ;AAEF,SAAS,EAAK,EACZ,UAA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;AAAA,IAAS,CAAC;AAAA,EACpD,CAAA;AAEnB;AAEA,EAAa,cAAc;AAO3B,SAAgB,EAAiB,EAC/B,SAAA,IAAU,WACV,MAAA,IAAO,MACP,WAAA,GACA,QAAA,GACA,QAAA,GACA,SAAA,GACA,SAAA,GACA,UAAA,GACA,MAAA,GACA,UAAA,GACA,WAAA,GACA,GAAG,EAAA,GACqB;AACxB,EAAA,EAAiB,GAAS,EAAM,YAAA,CAAa;AAC7C,QAAM,IAAO,EAAiB;AAG9B,SACE,gBAAA,EAFiB,EAAA,MAAc,EAAO,OAAO,CAAI,GAAG,CAAC,CAAI,CAExD,GAAD;AAAA,IACQ,MAAA;AAAA,IACN,GAAI,EAAkB,GAAM,CAAO;AAAA,IACnC,GAAK;AAAA,IACL,iBAAe,KAAY,KAAW;AAAA,IACtC,aAAW,KAAW;AAAA,IACtB,gBAAc,IAAU,SAAS;AAAA,IACjC,iBAAe,IAAU,SAAS;AAAA,IAClC,WAAW,EACT,EAAqB;AAAA,MAAE,SAAA;AAAA,MAAS,MAAA;AAAA,MAAM,WAAA;AAAA,IAAU,CAAC,GACjD,KAAW,uBACX,KAAW,mCACX,CACF;AAAA,cAEC,EAAkB;AAAA,MAAE,SAAA;AAAA,MAAS,SAAA;AAAA,MAAS,QAAA;AAAA,MAAQ,QAAA;AAAA,MAAQ,UAAA;AAAA,IAAS,CAAC;AAAA,EACvD,CAAA;AAEhB;AAEA,EAAiB,cAAc"}
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { t as o } from "./cn-D6jQqeRj.js";
3
+ import { t as n } from "./resolve-variant-CcD8iG5l.js";
4
+ import "react";
5
+ import { jsx as e } from "react/jsx-runtime";
6
+ import { X as a } from "@phosphor-icons/react";
7
+ var l = {
8
+ sm: { classes: "size-9 *:size-5" },
9
+ md: { classes: "size-10 *:size-5" },
10
+ lg: { classes: "size-11 *:size-6" }
11
+ };
12
+ function u({ size: s = "sm", label: t, className: i, ...r }) {
13
+ return /* @__PURE__ */ e("button", {
14
+ type: "button",
15
+ "aria-label": t || "Close",
16
+ ...r,
17
+ className: o("squircle text-fg-pho-quaternary outline-pho-brand hover:bg-pho-secondary-hover hover:text-fg-pho-quaternary-hover inline-flex cursor-pointer items-center justify-center rounded-md p-2 transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2", n(l, s), i),
18
+ children: /* @__PURE__ */ e(a, {
19
+ "aria-hidden": "true",
20
+ weight: "bold",
21
+ className: "transition-inherit-all shrink-0"
22
+ })
23
+ });
24
+ }
25
+ u.displayName = "CloseButton";
26
+ export {
27
+ u as t
28
+ };
29
+
30
+ //# sourceMappingURL=close-button-CbQNfpxU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"close-button-CbQNfpxU.js","names":[],"sources":["../../src/components/button/close-button.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes } from \"react\";\nimport { X } from \"@phosphor-icons/react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\nconst CLOSE_SIZES = {\n sm: { classes: \"size-9 *:size-5\" },\n md: { classes: \"size-10 *:size-5\" },\n lg: { classes: \"size-11 *:size-6\" },\n} satisfies VariantMap;\n\nexport interface CloseButtonProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"color\"\n> {\n /** Size variant. @default \"sm\" */\n size?: keyof typeof CLOSE_SIZES;\n /** Accessible label. @default \"Close\" */\n label?: string;\n}\n\n/**\n * Icon-only dismiss control — a squircle chip that fills on hover. Adapts to\n * light/dark automatically via semantic tokens. Used by Dialog and dismissible\n * surfaces.\n */\nexport function CloseButton({\n size = \"sm\",\n label,\n className,\n ...props\n}: CloseButtonProps) {\n return (\n <button\n type=\"button\"\n aria-label={label || \"Close\"}\n {...props}\n className={cn(\n \"squircle text-fg-pho-quaternary outline-pho-brand hover:bg-pho-secondary-hover hover:text-fg-pho-quaternary-hover inline-flex cursor-pointer items-center justify-center rounded-md p-2 transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2\",\n resolveVariant(CLOSE_SIZES, size),\n className,\n )}\n >\n <X\n aria-hidden=\"true\"\n weight=\"bold\"\n className=\"transition-inherit-all shrink-0\"\n />\n </button>\n );\n}\n\nCloseButton.displayName = \"CloseButton\";\n"],"mappings":";;;;;;AAKA,IAAM,IAAc;AAAA,EAClB,IAAI,EAAE,SAAS,kBAAkB;AAAA,EACjC,IAAI,EAAE,SAAS,mBAAmB;AAAA,EAClC,IAAI,EAAE,SAAS,mBAAmB;AACpC;AAiBA,SAAgB,EAAY,EAC1B,MAAA,IAAO,MACP,OAAA,GACA,WAAA,GACA,GAAG,EAAA,GACgB;AACnB,SACE,gBAAA,EAAC,UAAD;AAAA,IACE,MAAK;AAAA,IACL,cAAY,KAAS;AAAA,IACrB,GAAI;AAAA,IACJ,WAAW,EACT,sRACA,EAAe,GAAa,CAAI,GAChC,CACF;AAAA,cAEA,gBAAA,EAAC,GAAD;AAAA,MACE,eAAY;AAAA,MACZ,QAAO;AAAA,MACP,WAAU;AAAA,IACX,CAAA;AAAA,EACK,CAAA;AAEZ;AAEA,EAAY,cAAc"}