@photon-ai/pho-ui 0.7.2 → 1.0.1

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 (121) hide show
  1. package/dist/chunks/avatar-CiAvJNNs.js +99 -0
  2. package/dist/chunks/avatar-CiAvJNNs.js.map +1 -0
  3. package/dist/chunks/close-button-8f-oRJXt.js +420 -0
  4. package/dist/chunks/close-button-8f-oRJXt.js.map +1 -0
  5. package/dist/chunks/{cn-7uGUzCOM.js → cn-DTiB6ek_.js} +4 -2
  6. package/dist/chunks/{cn-7uGUzCOM.js.map → cn-DTiB6ek_.js.map} +1 -1
  7. package/dist/chunks/dialog-Bgb2Z1_v.js +141 -0
  8. package/dist/chunks/dialog-Bgb2Z1_v.js.map +1 -0
  9. package/dist/chunks/{input-DbJpdu6v.js → input-BSJGBUbf.js} +36 -36
  10. package/dist/chunks/input-BSJGBUbf.js.map +1 -0
  11. package/dist/chunks/menu-Dan0oRvL.js +208 -0
  12. package/dist/chunks/menu-Dan0oRvL.js.map +1 -0
  13. package/dist/chunks/{sidebar-CivriTLb.js → sidebar-Buhva5xa.js} +13 -13
  14. package/dist/chunks/sidebar-Buhva5xa.js.map +1 -0
  15. package/dist/chunks/spinner-Cy8bkyJf.js +54 -0
  16. package/dist/chunks/spinner-Cy8bkyJf.js.map +1 -0
  17. package/dist/components/accordion.js +21 -21
  18. package/dist/components/accordion.js.map +1 -1
  19. package/dist/components/alert-dialog.js +26 -26
  20. package/dist/components/alert-dialog.js.map +1 -1
  21. package/dist/components/autocomplete.js +46 -46
  22. package/dist/components/autocomplete.js.map +1 -1
  23. package/dist/components/avatar.js +1 -1
  24. package/dist/components/badge.js +1 -1
  25. package/dist/components/button.js +11 -11
  26. package/dist/components/checkbox.js +3 -3
  27. package/dist/components/checkbox.js.map +1 -1
  28. package/dist/components/collapsible.js +8 -8
  29. package/dist/components/collapsible.js.map +1 -1
  30. package/dist/components/combobox.js +69 -69
  31. package/dist/components/combobox.js.map +1 -1
  32. package/dist/components/context-menu.js +55 -39
  33. package/dist/components/context-menu.js.map +1 -1
  34. package/dist/components/dialog.js +3 -2
  35. package/dist/components/drawer.js +15 -15
  36. package/dist/components/drawer.js.map +1 -1
  37. package/dist/components/field.js +18 -18
  38. package/dist/components/field.js.map +1 -1
  39. package/dist/components/fieldset.js +9 -9
  40. package/dist/components/fieldset.js.map +1 -1
  41. package/dist/components/form.js +1 -1
  42. package/dist/components/input.js +1 -1
  43. package/dist/components/kbd.js +6 -6
  44. package/dist/components/kbd.js.map +1 -1
  45. package/dist/components/menu.js +6 -4
  46. package/dist/components/menubar.js +5 -5
  47. package/dist/components/menubar.js.map +1 -1
  48. package/dist/components/meter.js +20 -20
  49. package/dist/components/meter.js.map +1 -1
  50. package/dist/components/navigation-menu.js +8 -8
  51. package/dist/components/navigation-menu.js.map +1 -1
  52. package/dist/components/notification.js +24 -24
  53. package/dist/components/notification.js.map +1 -1
  54. package/dist/components/number-field.js +32 -32
  55. package/dist/components/number-field.js.map +1 -1
  56. package/dist/components/otp-field.js +5 -5
  57. package/dist/components/otp-field.js.map +1 -1
  58. package/dist/components/popover.js +10 -10
  59. package/dist/components/popover.js.map +1 -1
  60. package/dist/components/preview-card.js +8 -8
  61. package/dist/components/preview-card.js.map +1 -1
  62. package/dist/components/progress.js +25 -25
  63. package/dist/components/progress.js.map +1 -1
  64. package/dist/components/radio-group.js +13 -13
  65. package/dist/components/radio-group.js.map +1 -1
  66. package/dist/components/scroll-area.js +1 -1
  67. package/dist/components/select.js +35 -35
  68. package/dist/components/select.js.map +1 -1
  69. package/dist/components/separator.js +1 -1
  70. package/dist/components/slider.js +17 -17
  71. package/dist/components/slider.js.map +1 -1
  72. package/dist/components/spinner.js +6 -0
  73. package/dist/components/switch.js +10 -10
  74. package/dist/components/switch.js.map +1 -1
  75. package/dist/components/tabs.js +16 -16
  76. package/dist/components/tabs.js.map +1 -1
  77. package/dist/components/theme-toggle.js +203 -0
  78. package/dist/components/theme-toggle.js.map +1 -0
  79. package/dist/components/toast.js +24 -24
  80. package/dist/components/toast.js.map +1 -1
  81. package/dist/components/toggle-group.js +1 -1
  82. package/dist/components/toggle.js +5 -5
  83. package/dist/components/toggle.js.map +1 -1
  84. package/dist/components/toolbar.js +8 -8
  85. package/dist/components/toolbar.js.map +1 -1
  86. package/dist/components/tooltip.js +10 -10
  87. package/dist/components/tooltip.js.map +1 -1
  88. package/dist/index.js +29 -28
  89. package/dist/sections/sidebar.js +1 -1
  90. package/dist/src/components/avatar/avatar.d.ts +24 -2
  91. package/dist/src/components/avatar/index.d.ts +1 -1
  92. package/dist/src/components/button/button.d.ts +58 -44
  93. package/dist/src/components/button/index.d.ts +1 -1
  94. package/dist/src/components/dialog/dialog.d.ts +50 -7
  95. package/dist/src/components/dialog/index.d.ts +1 -1
  96. package/dist/src/components/menu/index.d.ts +1 -1
  97. package/dist/src/components/menu/menu-pending.d.ts +43 -0
  98. package/dist/src/components/spinner/index.d.ts +1 -0
  99. package/dist/src/components/spinner/spinner.d.ts +32 -0
  100. package/dist/src/components/theme-toggle/index.d.ts +1 -0
  101. package/dist/src/components/theme-toggle/theme-toggle.d.ts +81 -0
  102. package/dist/src/sections/sidebar/sidebar.d.ts +5 -6
  103. package/dist/utils.js +1 -1
  104. package/package.json +9 -1
  105. package/src/styles/fonts.css +14 -18
  106. package/src/styles/pho.css +5 -1
  107. package/src/styles/theme.css +183 -147
  108. package/dist/chunks/avatar-Bb4RZQIa.js +0 -53
  109. package/dist/chunks/avatar-Bb4RZQIa.js.map +0 -1
  110. package/dist/chunks/button-CQ4cZvkC.js +0 -365
  111. package/dist/chunks/button-CQ4cZvkC.js.map +0 -1
  112. package/dist/chunks/close-button-CNhn8z0w.js +0 -29
  113. package/dist/chunks/close-button-CNhn8z0w.js.map +0 -1
  114. package/dist/chunks/dialog-7oOe-eaO.js +0 -63
  115. package/dist/chunks/dialog-7oOe-eaO.js.map +0 -1
  116. package/dist/chunks/input-DbJpdu6v.js.map +0 -1
  117. package/dist/chunks/menu-BfaNHnOp.js +0 -101
  118. package/dist/chunks/menu-BfaNHnOp.js.map +0 -1
  119. package/dist/chunks/sidebar-CivriTLb.js.map +0 -1
  120. package/dist/src/components/context-menu/context-menu.d.ts +0 -34
  121. package/dist/src/components/menu/menu.d.ts +0 -47
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { t } from "../chunks/cn-7uGUzCOM.js";
3
- import { t as i } from "../chunks/resolve-variant-CcD8iG5l.js";
2
+ import { t as i } from "../chunks/cn-DTiB6ek_.js";
3
+ import { t as r } from "../chunks/resolve-variant-CcD8iG5l.js";
4
4
  import "react";
5
- import { jsx as r } from "react/jsx-runtime";
5
+ import { jsx as t } from "react/jsx-runtime";
6
6
  import { Toggle as a } from "@base-ui/react/toggle";
7
7
  var l = {
8
8
  sm: {
@@ -19,8 +19,8 @@ var l = {
19
19
  }
20
20
  };
21
21
  function n({ className: e, size: s = "md", ...o }) {
22
- return /* @__PURE__ */ r(a, {
23
- className: t("squircle outline-pho-brand text-pho-tertiary inline-flex cursor-pointer items-center justify-center rounded-lg transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2", "hover:bg-pho-ghost-hover hover:text-pho-tertiary-hover", "data-[pressed]:bg-pho-inverse data-[pressed]:text-pho-inverse", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", i(l, s), e),
22
+ return /* @__PURE__ */ t(a, {
23
+ className: i("squircle outline-pho-brand text-pho-secondary rounded-base inline-flex cursor-pointer items-center justify-center transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2", "hover:bg-pho-ghost-hover hover:text-pho-secondary-hover", "data-[pressed]:bg-pho-inverse data-[pressed]:text-pho-inverse", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", r(l, s), e),
24
24
  ...o
25
25
  });
26
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"toggle.js","names":[],"sources":["../../src/components/toggle/toggle.tsx"],"sourcesContent":["import { type ComponentProps } from \"react\";\nimport { Toggle as BaseToggle } from \"@base-ui/react/toggle\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n/** Size axis — three square icon sizes. `md` is default. */\nexport const TOGGLE_SIZES = {\n sm: {\n classes: \"size-8 [&>svg]:size-4\",\n description: \"Small — dense toolbars\",\n },\n md: { classes: \"size-9 [&>svg]:size-5\", description: \"Medium — the default\" },\n lg: { classes: \"size-10 [&>svg]:size-5\", description: \"Large\" },\n} satisfies VariantMap;\n\nexport type ToggleSize = keyof typeof TOGGLE_SIZES;\n\nexport interface ToggleProps extends Omit<\n ComponentProps<typeof BaseToggle>,\n \"className\"\n> {\n className?: string;\n /** Size variant. @default \"md\" */\n size?: ToggleSize;\n}\n\n/**\n * A two-state button (pressed / not pressed) built on Base UI `Toggle` — the\n * canonical Bold/Italic toolbar control. Controlled via `pressed` /\n * `onPressedChange` or uncontrolled via `defaultPressed`. For a set of related\n * toggles, use `ToggleGroup`.\n */\nexport function Toggle({ className, size = \"md\", ...props }: ToggleProps) {\n return (\n <BaseToggle\n className={cn(\n \"squircle outline-pho-brand text-pho-tertiary inline-flex cursor-pointer items-center justify-center rounded-lg transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2\",\n // Ghost control at rest — hover is the alpha wash (Button `tertiary`\n // idiom), not the card-surface hover token.\n \"hover:bg-pho-ghost-hover hover:text-pho-tertiary-hover\",\n // Pressed = the site's inverted chip (Tab active): dark chip in light\n // mode, light chip in dark mode — visible on any surface.\n \"data-[pressed]:bg-pho-inverse data-[pressed]:text-pho-inverse\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n resolveVariant(TOGGLE_SIZES, size),\n className,\n )}\n {...props}\n />\n );\n}\n\nToggle.displayName = \"Toggle\";\n"],"mappings":";;;;;;AAMA,IAAa,IAAe;AAAA,EAC1B,IAAI;AAAA,IACF,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,IAAI;AAAA,IAAE,SAAS;AAAA,IAAyB,aAAa;AAAA,EAAuB;AAAA,EAC5E,IAAI;AAAA,IAAE,SAAS;AAAA,IAA0B,aAAa;AAAA,EAAQ;AAChE;AAmBA,SAAgB,EAAO,EAAE,WAAA,GAAW,MAAA,IAAO,MAAM,GAAG,EAAA,GAAsB;AACxE,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,WAAW,EACT,6MAGA,0DAGA,iEACA,iEACA,EAAe,GAAc,CAAI,GACjC,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,EAAO,cAAc"}
1
+ {"version":3,"file":"toggle.js","names":[],"sources":["../../src/components/toggle/toggle.tsx"],"sourcesContent":["import { type ComponentProps } from \"react\";\nimport { Toggle as BaseToggle } from \"@base-ui/react/toggle\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n/** Size axis — three square icon sizes. `md` is default. */\nexport const TOGGLE_SIZES = {\n sm: {\n classes: \"size-8 [&>svg]:size-4\",\n description: \"Small — dense toolbars\",\n },\n md: { classes: \"size-9 [&>svg]:size-5\", description: \"Medium — the default\" },\n lg: { classes: \"size-10 [&>svg]:size-5\", description: \"Large\" },\n} satisfies VariantMap;\n\nexport type ToggleSize = keyof typeof TOGGLE_SIZES;\n\nexport interface ToggleProps extends Omit<\n ComponentProps<typeof BaseToggle>,\n \"className\"\n> {\n className?: string;\n /** Size variant. @default \"md\" */\n size?: ToggleSize;\n}\n\n/**\n * A two-state button (pressed / not pressed) built on Base UI `Toggle` — the\n * canonical Bold/Italic toolbar control. Controlled via `pressed` /\n * `onPressedChange` or uncontrolled via `defaultPressed`. For a set of related\n * toggles, use `ToggleGroup`.\n */\nexport function Toggle({ className, size = \"md\", ...props }: ToggleProps) {\n return (\n <BaseToggle\n className={cn(\n \"squircle outline-pho-brand text-pho-secondary rounded-base inline-flex cursor-pointer items-center justify-center transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2\",\n // Ghost control at rest — hover is the alpha wash (Button `tertiary`\n // idiom), not the card-surface hover token.\n \"hover:bg-pho-ghost-hover hover:text-pho-secondary-hover\",\n // Pressed = the site's inverted chip (Tab active): dark chip in light\n // mode, light chip in dark mode — visible on any surface.\n \"data-[pressed]:bg-pho-inverse data-[pressed]:text-pho-inverse\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n resolveVariant(TOGGLE_SIZES, size),\n className,\n )}\n {...props}\n />\n );\n}\n\nToggle.displayName = \"Toggle\";\n"],"mappings":";;;;;;AAMA,IAAa,IAAe;AAAA,EAC1B,IAAI;AAAA,IACF,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,IAAI;AAAA,IAAE,SAAS;AAAA,IAAyB,aAAa;AAAA,EAAuB;AAAA,EAC5E,IAAI;AAAA,IAAE,SAAS;AAAA,IAA0B,aAAa;AAAA,EAAQ;AAChE;AAmBA,SAAgB,EAAO,EAAE,WAAA,GAAW,MAAA,IAAO,MAAM,GAAG,EAAA,GAAsB;AACxE,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,WAAW,EACT,gNAGA,2DAGA,iEACA,iEACA,EAAe,GAAc,CAAI,GACjC,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,EAAO,cAAc"}
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- import { t as o } from "../chunks/cn-7uGUzCOM.js";
2
+ import { t as o } from "../chunks/cn-DTiB6ek_.js";
3
3
  import "react";
4
4
  import { jsx as t } from "react/jsx-runtime";
5
5
  import { Toolbar as n } from "@base-ui/react/toolbar";
6
6
  function i({ className: e, ...r }) {
7
7
  return /* @__PURE__ */ t(n.Root, {
8
- className: o("squircle border-pho-secondary bg-pho-primary flex items-center gap-1 rounded-lg border p-1", e),
8
+ className: o("border-pho-secondary bg-pho-primary rounded-base flex items-center gap-1 border p-1", e),
9
9
  ...r
10
10
  });
11
11
  }
12
- var a = "inline-flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-sm font-medium text-pho-tertiary outline-pho-brand transition duration-100 ease-linear hover:bg-pho-ghost-hover hover:text-pho-primary focus-visible:outline-2 focus-visible:-outline-offset-1 data-[pressed]:bg-pho-tertiary data-[pressed]:text-pho-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4";
12
+ var a = "inline-flex items-center justify-center gap-1.5 rounded-sm px-2 py-1.5 text-base font-medium text-pho-secondary outline-pho-brand transition duration-100 ease-linear hover:bg-pho-ghost-hover hover:text-pho-primary focus-visible:outline-2 focus-visible:-outline-offset-1 data-[pressed]:bg-pho-secondary data-[pressed]:text-pho-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4";
13
13
  function s({ className: e, ...r }) {
14
14
  return /* @__PURE__ */ t(n.Button, {
15
15
  className: o(a, e),
@@ -28,9 +28,9 @@ function u({ className: e, ...r }) {
28
28
  ...r
29
29
  });
30
30
  }
31
- function l({ className: e, ...r }) {
31
+ function d({ className: e, ...r }) {
32
32
  return /* @__PURE__ */ t(n.Input, {
33
- className: o("bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder focus-visible:ring-pho-brand rounded-md px-2 py-1 text-sm ring-1 outline-none ring-inset focus-visible:ring-2", e),
33
+ className: o("bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder focus-visible:ring-pho-brand text-md rounded-sm px-2 py-1 ring-1 outline-none ring-inset focus-visible:ring-2 md:text-base", e),
34
34
  ...r
35
35
  });
36
36
  }
@@ -40,16 +40,16 @@ function c({ className: e, ...r }) {
40
40
  ...r
41
41
  });
42
42
  }
43
- var b = {
43
+ var f = {
44
44
  Root: i,
45
45
  Button: s,
46
46
  Link: p,
47
47
  Group: u,
48
- Input: l,
48
+ Input: d,
49
49
  Separator: c
50
50
  };
51
51
  export {
52
- b as Toolbar
52
+ f as Toolbar
53
53
  };
54
54
 
55
55
  //# sourceMappingURL=toolbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.js","names":[],"sources":["../../src/components/toolbar/toolbar.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Toolbar as BaseToolbar } from \"@base-ui/react/toolbar\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nfunction Root({ className, ...props }: StyledProps<typeof BaseToolbar.Root>) {\n return (\n <BaseToolbar.Root\n className={cn(\n // Flat card treatment — the hairline border carries the edge; shadows\n // are reserved for floating layers (menus/popovers/dialogs).\n \"squircle border-pho-secondary bg-pho-primary flex items-center gap-1 rounded-lg border p-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\n// Ghost-button idiom: quiet Font/5% hover wash; pressed steps up to the\n// tertiary surface so it stays distinct from hover in both modes.\nconst TOOLBAR_BUTTON =\n \"inline-flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-sm font-medium text-pho-tertiary outline-pho-brand transition duration-100 ease-linear hover:bg-pho-ghost-hover hover:text-pho-primary focus-visible:outline-2 focus-visible:-outline-offset-1 data-[pressed]:bg-pho-tertiary data-[pressed]:text-pho-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4\";\n\nfunction Button({\n className,\n ...props\n}: StyledProps<typeof BaseToolbar.Button>) {\n return (\n <BaseToolbar.Button className={cn(TOOLBAR_BUTTON, className)} {...props} />\n );\n}\n\nfunction Link({ className, ...props }: StyledProps<typeof BaseToolbar.Link>) {\n return (\n <BaseToolbar.Link className={cn(TOOLBAR_BUTTON, className)} {...props} />\n );\n}\n\nfunction Group({ className, ...props }: StyledProps<typeof BaseToolbar.Group>) {\n return (\n <BaseToolbar.Group\n className={cn(\"flex items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction Input({ className, ...props }: StyledProps<typeof BaseToolbar.Input>) {\n return (\n <BaseToolbar.Input\n className={cn(\n \"bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder focus-visible:ring-pho-brand rounded-md px-2 py-1 text-sm ring-1 outline-none ring-inset focus-visible:ring-2\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Separator({\n className,\n ...props\n}: StyledProps<typeof BaseToolbar.Separator>) {\n return (\n <BaseToolbar.Separator\n className={cn(\n \"mx-1 h-5 w-px bg-[var(--border-color-pho-secondary)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Toolbar built on Base UI `Toolbar` — a single tab stop grouping related\n * controls with arrow-key navigation between them (formatting bars, editor\n * controls). Holds `Toolbar.Button`, `Link`, `Input`, and `Separator`; for\n * pressable formatting buttons, wrap `Toggle` / `ToggleGroup` with\n * `Toolbar.Button render={…}`.\n */\nexport const Toolbar = { Root, Button, Link, Group, Input, Separator };\n"],"mappings":";;;;;AAYA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAA+C;AAC3E,SACE,gBAAA,EAAC,EAAY,MAAb;AAAA,IACE,WAAW,EAGT,8FACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAIA,IAAM,IACJ;AAEF,SAAS,EAAO,EACd,WAAA,GACA,GAAG,EAAA,GACsC;AACzC,SACE,gBAAA,EAAC,EAAY,QAAb;AAAA,IAAoB,WAAW,EAAG,GAAgB,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE9E;AAEA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAA+C;AAC3E,SACE,gBAAA,EAAC,EAAY,MAAb;AAAA,IAAkB,WAAW,EAAG,GAAgB,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE5E;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAAgD;AAC7E,SACE,gBAAA,EAAC,EAAY,OAAb;AAAA,IACE,WAAW,EAAG,2BAA2B,CAAS;AAAA,IAClD,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAAgD;AAC7E,SACE,gBAAA,EAAC,EAAY,OAAb;AAAA,IACE,WAAW,EACT,mMACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAU,EACjB,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAY,WAAb;AAAA,IACE,WAAW,EACT,wDACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AASA,IAAa,IAAU;AAAA,EAAE,MAAA;AAAA,EAAM,QAAA;AAAA,EAAQ,MAAA;AAAA,EAAM,OAAA;AAAA,EAAO,OAAA;AAAA,EAAO,WAAA;AAAU"}
1
+ {"version":3,"file":"toolbar.js","names":[],"sources":["../../src/components/toolbar/toolbar.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Toolbar as BaseToolbar } from \"@base-ui/react/toolbar\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nfunction Root({ className, ...props }: StyledProps<typeof BaseToolbar.Root>) {\n return (\n <BaseToolbar.Root\n className={cn(\n // Flat card treatment — the hairline border carries the edge; shadows\n // are reserved for floating layers (menus/popovers/dialogs).\n \"border-pho-secondary bg-pho-primary rounded-base flex items-center gap-1 border p-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\n// Ghost-button idiom: quiet Font/5% hover wash; pressed steps up to the\n// tertiary surface so it stays distinct from hover in both modes.\nconst TOOLBAR_BUTTON =\n \"inline-flex items-center justify-center gap-1.5 rounded-sm px-2 py-1.5 text-base font-medium text-pho-secondary outline-pho-brand transition duration-100 ease-linear hover:bg-pho-ghost-hover hover:text-pho-primary focus-visible:outline-2 focus-visible:-outline-offset-1 data-[pressed]:bg-pho-secondary data-[pressed]:text-pho-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4\";\n\nfunction Button({\n className,\n ...props\n}: StyledProps<typeof BaseToolbar.Button>) {\n return (\n <BaseToolbar.Button className={cn(TOOLBAR_BUTTON, className)} {...props} />\n );\n}\n\nfunction Link({ className, ...props }: StyledProps<typeof BaseToolbar.Link>) {\n return (\n <BaseToolbar.Link className={cn(TOOLBAR_BUTTON, className)} {...props} />\n );\n}\n\nfunction Group({ className, ...props }: StyledProps<typeof BaseToolbar.Group>) {\n return (\n <BaseToolbar.Group\n className={cn(\"flex items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction Input({ className, ...props }: StyledProps<typeof BaseToolbar.Input>) {\n return (\n <BaseToolbar.Input\n className={cn(\n // text-md on small viewports — iOS zooms into fields under 16px.\n \"bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder focus-visible:ring-pho-brand text-md rounded-sm px-2 py-1 ring-1 outline-none ring-inset focus-visible:ring-2 md:text-base\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Separator({\n className,\n ...props\n}: StyledProps<typeof BaseToolbar.Separator>) {\n return (\n <BaseToolbar.Separator\n className={cn(\n \"mx-1 h-5 w-px bg-[var(--border-color-pho-secondary)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Toolbar built on Base UI `Toolbar` — a single tab stop grouping related\n * controls with arrow-key navigation between them (formatting bars, editor\n * controls). Holds `Toolbar.Button`, `Link`, `Input`, and `Separator`; for\n * pressable formatting buttons, wrap `Toggle` / `ToggleGroup` with\n * `Toolbar.Button render={…}`.\n */\nexport const Toolbar = { Root, Button, Link, Group, Input, Separator };\n"],"mappings":";;;;;AAYA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAA+C;AAC3E,SACE,gBAAA,EAAC,EAAY,MAAb;AAAA,IACE,WAAW,EAGT,uFACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAIA,IAAM,IACJ;AAEF,SAAS,EAAO,EACd,WAAA,GACA,GAAG,EAAA,GACsC;AACzC,SACE,gBAAA,EAAC,EAAY,QAAb;AAAA,IAAoB,WAAW,EAAG,GAAgB,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE9E;AAEA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAA+C;AAC3E,SACE,gBAAA,EAAC,EAAY,MAAb;AAAA,IAAkB,WAAW,EAAG,GAAgB,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE5E;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAAgD;AAC7E,SACE,gBAAA,EAAC,EAAY,OAAb;AAAA,IACE,WAAW,EAAG,2BAA2B,CAAS;AAAA,IAClD,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAAgD;AAC7E,SACE,gBAAA,EAAC,EAAY,OAAb;AAAA,IACE,WAAW,EAET,gNACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAU,EACjB,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAY,WAAb;AAAA,IACE,WAAW,EACT,wDACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AASA,IAAa,IAAU;AAAA,EAAE,MAAA;AAAA,EAAM,QAAA;AAAA,EAAQ,MAAA;AAAA,EAAM,OAAA;AAAA,EAAO,OAAA;AAAA,EAAO,WAAA;AAAU"}
@@ -1,19 +1,19 @@
1
1
  "use client";
2
- import { t as i } from "../chunks/cn-7uGUzCOM.js";
2
+ import { t as a } from "../chunks/cn-DTiB6ek_.js";
3
3
  import "react";
4
- import { jsx as a } from "react/jsx-runtime";
4
+ import { jsx as i } from "react/jsx-runtime";
5
5
  import { Tooltip as o } from "@base-ui/react/tooltip";
6
- var n = o.Provider, s = o.Root, p = o.Trigger, l = o.Portal;
6
+ var n = o.Provider, s = o.Root, p = o.Trigger, d = o.Portal;
7
7
  function g({ className: r, sideOffset: t = 6, ...e }) {
8
- return /* @__PURE__ */ a(o.Positioner, {
8
+ return /* @__PURE__ */ i(o.Positioner, {
9
9
  sideOffset: t,
10
- className: i("z-50", r),
10
+ className: a("z-50", r),
11
11
  ...e
12
12
  });
13
13
  }
14
- function d({ className: r, ...t }) {
15
- return /* @__PURE__ */ a(o.Popup, {
16
- className: i("squircle bg-pho-primary text-pho-secondary shadow-pho-lg ring-pho-secondary origin-[var(--transform-origin)] rounded-lg px-2.5 py-1.5 text-xs font-medium ring-1 transition-[transform,opacity] duration-150 ease-out ring-inset", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", r),
14
+ function l({ className: r, ...t }) {
15
+ return /* @__PURE__ */ i(o.Popup, {
16
+ className: a("bg-pho-primary text-pho-secondary shadow-pho-lg ring-pho-secondary rounded-base origin-[var(--transform-origin)] px-2.5 py-1.5 text-xs font-medium ring-1 transition-[transform,opacity] duration-150 ease-out ring-inset", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", r),
17
17
  ...t
18
18
  });
19
19
  }
@@ -21,9 +21,9 @@ var f = {
21
21
  Provider: n,
22
22
  Root: s,
23
23
  Trigger: p,
24
- Portal: l,
24
+ Portal: d,
25
25
  Positioner: g,
26
- Popup: d
26
+ Popup: l
27
27
  };
28
28
  export {
29
29
  f as Tooltip
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","names":[],"sources":["../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Provider = BaseTooltip.Provider;\nconst Root = BaseTooltip.Root;\nconst Trigger = BaseTooltip.Trigger;\nconst Portal = BaseTooltip.Portal;\n\nfunction Positioner({\n className,\n sideOffset = 6,\n ...props\n}: StyledProps<typeof BaseTooltip.Positioner>) {\n return (\n <BaseTooltip.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseTooltip.Popup>) {\n return (\n <BaseTooltip.Popup\n className={cn(\n // Floating layer: bg-pho-primary surface, pho-secondary hairline ring, keeps shadow elevation.\n \"squircle bg-pho-primary text-pho-secondary shadow-pho-lg ring-pho-secondary origin-[var(--transform-origin)] rounded-lg px-2.5 py-1.5 text-xs font-medium ring-1 transition-[transform,opacity] duration-150 ease-out ring-inset\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Tooltip built on Base UI `Tooltip` — a brief, hover/focus-triggered label for\n * an icon or control. Wrap your app (or a subtree) in `Tooltip.Provider` to\n * share open/close timing. The trigger must be a focusable element. Never put\n * essential or interactive content in a tooltip; use `Popover` for that.\n */\nexport const Tooltip = { Provider, Root, Trigger, Portal, Positioner, Popup };\n"],"mappings":";;;;;AAYA,IAAM,IAAW,EAAY,UACvB,IAAO,EAAY,MACnB,IAAU,EAAY,SACtB,IAAS,EAAY;AAE3B,SAAS,EAAW,EAClB,WAAA,GACA,YAAA,IAAa,GACb,GAAG,EAAA,GAC0C;AAC7C,SACE,gBAAA,EAAC,EAAY,YAAb;AAAA,IACc,YAAA;AAAA,IACZ,WAAW,EAAG,QAAQ,CAAS;AAAA,IAC/B,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAAgD;AAC7E,SACE,gBAAA,EAAC,EAAY,OAAb;AAAA,IACE,WAAW,EAET,oOACA,kEACA,8DACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAQA,IAAa,IAAU;AAAA,EAAE,UAAA;AAAA,EAAU,MAAA;AAAA,EAAM,SAAA;AAAA,EAAS,QAAA;AAAA,EAAQ,YAAA;AAAA,EAAY,OAAA;AAAM"}
1
+ {"version":3,"file":"tooltip.js","names":[],"sources":["../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Provider = BaseTooltip.Provider;\nconst Root = BaseTooltip.Root;\nconst Trigger = BaseTooltip.Trigger;\nconst Portal = BaseTooltip.Portal;\n\nfunction Positioner({\n className,\n sideOffset = 6,\n ...props\n}: StyledProps<typeof BaseTooltip.Positioner>) {\n return (\n <BaseTooltip.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseTooltip.Popup>) {\n return (\n <BaseTooltip.Popup\n className={cn(\n // Floating layer: bg-pho-primary surface, pho-secondary hairline ring, keeps shadow elevation.\n \"bg-pho-primary text-pho-secondary shadow-pho-lg ring-pho-secondary rounded-base origin-[var(--transform-origin)] px-2.5 py-1.5 text-xs font-medium ring-1 transition-[transform,opacity] duration-150 ease-out ring-inset\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Tooltip built on Base UI `Tooltip` — a brief, hover/focus-triggered label for\n * an icon or control. Wrap your app (or a subtree) in `Tooltip.Provider` to\n * share open/close timing. The trigger must be a focusable element. Never put\n * essential or interactive content in a tooltip; use `Popover` for that.\n */\nexport const Tooltip = { Provider, Root, Trigger, Portal, Positioner, Popup };\n"],"mappings":";;;;;AAYA,IAAM,IAAW,EAAY,UACvB,IAAO,EAAY,MACnB,IAAU,EAAY,SACtB,IAAS,EAAY;AAE3B,SAAS,EAAW,EAClB,WAAA,GACA,YAAA,IAAa,GACb,GAAG,EAAA,GAC0C;AAC7C,SACE,gBAAA,EAAC,EAAY,YAAb;AAAA,IACc,YAAA;AAAA,IACZ,WAAW,EAAG,QAAQ,CAAS;AAAA,IAC/B,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAAgD;AAC7E,SACE,gBAAA,EAAC,EAAY,OAAb;AAAA,IACE,WAAW,EAET,6NACA,kEACA,8DACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAQA,IAAa,IAAU;AAAA,EAAE,UAAA;AAAA,EAAU,MAAA;AAAA,EAAM,SAAA;AAAA,EAAS,QAAA;AAAA,EAAQ,YAAA;AAAA,EAAY,OAAA;AAAM"}
package/dist/index.js CHANGED
@@ -1,35 +1,36 @@
1
1
  "use client";
2
- import { t as a } from "./chunks/cn-7uGUzCOM.js";
3
- import { n as s, r, t as n } from "./chunks/link-provider-9TFNyDqO.js";
4
- import { t as m } from "./chunks/resolve-variant-CcD8iG5l.js";
2
+ import { t as a } from "./chunks/cn-DTiB6ek_.js";
3
+ import { n as o, r as n, t as r } from "./chunks/link-provider-9TFNyDqO.js";
4
+ import { t as e } from "./chunks/resolve-variant-CcD8iG5l.js";
5
5
  import "./utils.js";
6
- import { a as T, c as f, i as B, l as I, n as p, o as S, r as u, s as _, t as A, u as c } from "./chunks/button-CQ4cZvkC.js";
7
- import { a as C, i as N, n as O, r as V, t as l } from "./chunks/sidebar-CivriTLb.js";
8
- import { t as k } from "./chunks/input-DbJpdu6v.js";
9
- import { t as U } from "./chunks/close-button-CNhn8z0w.js";
10
- import { t as b } from "./chunks/dialog-7oOe-eaO.js";
6
+ import { a as E, c as B, d as f, f as I, i as S, l as p, n as u, o as _, r as A, s as O, t as R, u as c } from "./chunks/close-button-8f-oRJXt.js";
7
+ import { a as N, i as l, n as D, r as V, t as L } from "./chunks/sidebar-Buhva5xa.js";
8
+ import { t as d } from "./chunks/input-BSJGBUbf.js";
9
+ import { n as g, t as M } from "./chunks/dialog-Bgb2Z1_v.js";
11
10
  export {
11
+ u as BUTTON_COLORS,
12
12
  A as BUTTON_SHAPES,
13
- p as BUTTON_SIZES,
14
- u as BUTTON_VARIANTS,
15
- B as Button,
16
- T as ButtonLink,
17
- U as CloseButton,
18
- b as Dialog,
19
- S as EFFECT_BUTTON_SIZES,
20
- _ as EffectButton,
21
- f as EffectButtonLink,
22
- k as Input,
23
- n as LinkProvider,
24
- l as SIDEBAR_ITEM,
25
- O as SIDEBAR_ITEM_ACTIVE,
13
+ S as BUTTON_SIZES,
14
+ E as BUTTON_VARIANTS,
15
+ _ as Button,
16
+ O as ButtonLink,
17
+ R as CloseButton,
18
+ M as Dialog,
19
+ B as EFFECT_BUTTON_SIZES,
20
+ p as EffectButton,
21
+ c as EffectButtonLink,
22
+ d as Input,
23
+ r as LinkProvider,
24
+ L as SIDEBAR_ITEM,
25
+ D as SIDEBAR_ITEM_ACTIVE,
26
26
  V as SIDEBAR_ITEM_INACTIVE,
27
- N as SIDEBAR_ROOT,
28
- C as Sidebar,
29
- I as buttonVariants,
27
+ l as SIDEBAR_ROOT,
28
+ N as Sidebar,
29
+ f as buttonVariants,
30
30
  a as cn,
31
- c as effectButtonVariants,
32
- r as isReactComponent,
33
- m as resolveVariant,
34
- s as useLinkComponent
31
+ I as effectButtonVariants,
32
+ n as isReactComponent,
33
+ e as resolveVariant,
34
+ g as useDialogPending,
35
+ o as useLinkComponent
35
36
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { a as E, i as a, n as s, r as A, t as T } from "../chunks/sidebar-CivriTLb.js";
2
+ import { a as E, i as a, n as s, r as A, t as T } from "../chunks/sidebar-Buhva5xa.js";
3
3
  export {
4
4
  T as SIDEBAR_ITEM,
5
5
  s as SIDEBAR_ITEM_ACTIVE,
@@ -1,4 +1,4 @@
1
- import { ComponentProps, ElementType } from 'react';
1
+ import { ButtonHTMLAttributes, ComponentProps, ElementType, MouseEvent as ReactMouseEvent, ReactNode } from 'react';
2
2
  import { Avatar as BaseAvatar } from '@base-ui/react/avatar';
3
3
  /** Override Base UI's `string | (state) => string` className with plain string. */
4
4
  type StyledProps<T extends ElementType> = Omit<ComponentProps<T>, "className"> & {
@@ -31,14 +31,36 @@ interface RootProps extends StyledProps<typeof BaseAvatar.Root> {
31
31
  declare function Root({ className, size, ...props }: RootProps): import("react").JSX.Element;
32
32
  declare function Image({ className, ...props }: StyledProps<typeof BaseAvatar.Image>): import("react").JSX.Element;
33
33
  declare function Fallback({ className, ...props }: StyledProps<typeof BaseAvatar.Fallback>): import("react").JSX.Element;
34
+ export interface EditProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "color" | "onClick"> {
35
+ /** Accessible label. @default "Edit" */
36
+ label?: string;
37
+ /**
38
+ * Replace the default pencil icon. Pass `IconDots` when this button is a
39
+ * `Menu.Trigger` (change + remove). Custom icons are sized automatically.
40
+ */
41
+ children?: ReactNode;
42
+ /**
43
+ * Declarative loading state (same visual as an in-flight promise).
44
+ * @default false
45
+ */
46
+ loading?: boolean;
47
+ /**
48
+ * Action handler. Return a promise to keep the overlay visible with a
49
+ * spinner until it settles. On rejection the control stays interactive —
50
+ * surface errors inside the handler.
51
+ */
52
+ onClick?: (event: ReactMouseEvent<HTMLButtonElement>) => void | Promise<unknown>;
53
+ }
34
54
  /**
35
55
  * Avatar built on Base UI `Avatar`. Compose `Avatar.Image` with an
36
56
  * `Avatar.Fallback` (initials or icon) that shows while the image loads or if
37
- * it fails. Set `size` on `Avatar.Root`.
57
+ * it fails. Set `size` on `Avatar.Root`. Add `Avatar.Edit` when the avatar
58
+ * itself should open a change-photo action.
38
59
  */
39
60
  export declare const Avatar: {
40
61
  Root: typeof Root;
41
62
  Image: typeof Image;
42
63
  Fallback: typeof Fallback;
64
+ Edit: import('react').ForwardRefExoticComponent<EditProps & import('react').RefAttributes<HTMLButtonElement>>;
43
65
  };
44
66
  export {};
@@ -1 +1 @@
1
- export { Avatar, AVATAR_SIZES, type AvatarSize } from './avatar';
1
+ export { Avatar, AVATAR_SIZES, type AvatarSize, type EditProps as AvatarEditProps, } from './avatar';
@@ -39,21 +39,32 @@ export declare const BUTTON_SHAPES: {
39
39
  description: string;
40
40
  };
41
41
  };
42
- /** Emphasis axis — a tight, semantic set. `primary` is the default. */
42
+ /** Surface axis — how the control is drawn. `effect` is the default. */
43
43
  export declare const BUTTON_VARIANTS: {
44
- primary: {
44
+ effect: {
45
45
  classes: string;
46
46
  description: string;
47
47
  };
48
- secondary: {
48
+ filled: {
49
49
  classes: string;
50
50
  description: string;
51
51
  };
52
- tertiary: {
52
+ outlined: {
53
53
  classes: string;
54
54
  description: string;
55
55
  };
56
- error: {
56
+ ghost: {
57
+ classes: string;
58
+ description: string;
59
+ };
60
+ };
61
+ /** Color axis — semantic ink. `default` is the default. */
62
+ export declare const BUTTON_COLORS: {
63
+ default: {
64
+ classes: string;
65
+ description: string;
66
+ };
67
+ destructive: {
57
68
  classes: string;
58
69
  description: string;
59
70
  };
@@ -61,9 +72,11 @@ export declare const BUTTON_VARIANTS: {
61
72
  export type ButtonSize = keyof typeof BUTTON_SIZES;
62
73
  export type ButtonShape = keyof typeof BUTTON_SHAPES;
63
74
  export type ButtonVariant = keyof typeof BUTTON_VARIANTS;
75
+ export type ButtonColor = keyof typeof BUTTON_COLORS;
64
76
  /** Compose the full class string for a button — exported for reuse/testing. */
65
77
  export declare function buttonVariants(opts?: {
66
78
  variant?: ButtonVariant;
79
+ color?: ButtonColor;
67
80
  size?: ButtonSize;
68
81
  shape?: ButtonShape;
69
82
  className?: string;
@@ -73,8 +86,10 @@ type Slottable = ReactNode | FC<{
73
86
  className?: string;
74
87
  }>;
75
88
  interface ButtonBaseProps {
76
- /** Emphasis variant. @default "primary" */
89
+ /** Surface variant. @default "effect" */
77
90
  variant?: ButtonVariant;
91
+ /** Semantic color. @default "default" */
92
+ color?: ButtonColor;
78
93
  /** Size variant. @default "md" */
79
94
  size?: ButtonSize;
80
95
  /** Corner shape. @default "rounded" */
@@ -83,6 +98,12 @@ interface ButtonBaseProps {
83
98
  prefix?: Slottable;
84
99
  /** Slot after the label. */
85
100
  suffix?: Slottable;
101
+ /**
102
+ * Reveal prefix/suffix icons on hover — collapsed and invisible at rest,
103
+ * spring in on hover. Independent of `variant` (including `effect`).
104
+ * Ignored when `svgOnly`. @default false
105
+ */
106
+ iconReveal?: boolean;
86
107
  /** Render as an icon-only button. Requires an `aria-label`. */
87
108
  svgOnly?: boolean;
88
109
  /** Show a spinner and block interaction while staying readable. */
@@ -90,10 +111,17 @@ interface ButtonBaseProps {
90
111
  children?: ReactNode;
91
112
  className?: string;
92
113
  }
93
- export interface ButtonProps extends ButtonBaseProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonBaseProps> {
114
+ /**
115
+ * DOM event handlers whose React signatures clash with Motion's gesture
116
+ * props of the same name (Motion re-types these on `motion.*` elements).
117
+ * Excluded from the public API — Button renders through Motion when the
118
+ * sheen or icon reveal is active, so these handlers would be intercepted.
119
+ */
120
+ type MotionHandlerConflicts = "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragExit" | "onDragLeave" | "onDragOver" | "onDrop";
121
+ export interface ButtonProps extends ButtonBaseProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonBaseProps | MotionHandlerConflicts> {
94
122
  ref?: Ref<HTMLButtonElement>;
95
123
  }
96
- export interface ButtonLinkProps extends ButtonBaseProps, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof ButtonBaseProps> {
124
+ export interface ButtonLinkProps extends ButtonBaseProps, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof ButtonBaseProps | MotionHandlerConflicts> {
97
125
  /** Navigate to this URL (rendered via the host's `LinkProvider`). */
98
126
  href: string;
99
127
  /** Visually and semantically disable the link. */
@@ -102,8 +130,12 @@ export interface ButtonLinkProps extends ButtonBaseProps, Omit<AnchorHTMLAttribu
102
130
  /**
103
131
  * Button — triggers an action that mutates state (submit, save, delete).
104
132
  * For navigation that changes the URL, use {@link ButtonLink}.
133
+ *
134
+ * Default surface is `effect` (same-hue 1.5px outer rim + inset sheen). Use
135
+ * `filled` for a solid fill without those layers. `iconReveal` springs
136
+ * prefix/suffix icons in on hover — independent of variant.
105
137
  */
106
- export declare function Button({ variant, size, shape, prefix, suffix, svgOnly, loading, children, className, ref, ...props }: ButtonProps): import("react").JSX.Element;
138
+ export declare function Button({ variant, color, size, shape, prefix, suffix, iconReveal, svgOnly, loading, children, className, ref, ...props }: ButtonProps): import("react").JSX.Element;
107
139
  export declare namespace Button {
108
140
  var displayName: string;
109
141
  }
@@ -112,15 +144,10 @@ export declare namespace Button {
112
144
  * Shares every visual prop with {@link Button}; renders the host router's link
113
145
  * via `LinkProvider`.
114
146
  */
115
- export declare function ButtonLink({ variant, size, shape, prefix, suffix, svgOnly, loading, disabled, href, children, className, ...props }: ButtonLinkProps): import("react").JSX.Element;
147
+ export declare function ButtonLink({ variant, color, size, shape, prefix, suffix, iconReveal, svgOnly, loading, disabled, href, children, className, ...props }: ButtonLinkProps): import("react").JSX.Element;
116
148
  export declare namespace ButtonLink {
117
149
  var displayName: string;
118
150
  }
119
- /**
120
- * EffectButton shares Button's size axis verbatim — same padding, text size,
121
- * and svgOnly geometry, so effect pills line up with plain Buttons.
122
- * Kept as a named export for API compatibility.
123
- */
124
151
  export declare const EFFECT_BUTTON_SIZES: {
125
152
  sm: {
126
153
  classes: string;
@@ -136,34 +163,33 @@ export declare const EFFECT_BUTTON_SIZES: {
136
163
  };
137
164
  };
138
165
  export type EffectButtonSize = ButtonSize;
139
- /** Compose the full class string for an effect button — exported for reuse. */
166
+ /** Compose classes for an effect pill — `Button` with `variant="effect"`. */
140
167
  export declare function effectButtonVariants(opts?: {
141
168
  size?: EffectButtonSize;
142
169
  fullWidth?: boolean;
143
170
  className?: string;
144
171
  }): string;
145
- type MotionConflicts = "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragExit" | "onDragLeave" | "onDragOver" | "onDrop" | "style";
172
+ /**
173
+ * Legacy EffectButton also reserved `style` (sheen variables lived there) and
174
+ * never exposed the HTML `color` attribute — Button's semantic `color` prop
175
+ * now occupies that name.
176
+ */
177
+ type MotionConflicts = MotionHandlerConflicts | "style" | "color";
146
178
  interface EffectButtonBaseProps {
147
179
  /** Size variant — Button's scale (32 / 36 / 44px). @default "md" */
148
180
  size?: EffectButtonSize;
149
181
  /** Stretch to the container's full width (stacked login / OAuth pills). */
150
182
  fullWidth?: boolean;
151
183
  /**
152
- * Play the Motion treatment. When `true` (the default), hovering springs the
153
- * sheen, gap, and icon reveal — at rest the pill reads as a normal button
154
- * with the icon hidden. When `false` there is no animation at all: the pill
155
- * is a plain static `Button` with the effect styling, and a passed icon is
156
- * simply displayed from the start.
157
- * @default true
184
+ * @deprecated Use `iconReveal` on `Button` instead. Mapped to `iconReveal`
185
+ * when set.
158
186
  */
159
187
  animated?: boolean;
160
- /** Slot before the label — a component (`Plus`) or element (`<Plus />`). */
188
+ /** @see ButtonBaseProps.iconReveal */
189
+ iconReveal?: boolean;
161
190
  prefix?: Slottable;
162
- /** Slot after the label. */
163
191
  suffix?: Slottable;
164
- /** Render as an icon-only button. Requires an `aria-label`. */
165
192
  svgOnly?: boolean;
166
- /** Show a spinner and block interaction while staying readable. */
167
193
  loading?: boolean;
168
194
  children?: ReactNode;
169
195
  className?: string;
@@ -172,33 +198,21 @@ export interface EffectButtonProps extends EffectButtonBaseProps, Omit<ButtonHTM
172
198
  ref?: Ref<HTMLButtonElement>;
173
199
  }
174
200
  export interface EffectButtonLinkProps extends EffectButtonBaseProps, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof EffectButtonBaseProps | MotionConflicts> {
175
- /** Navigate to this URL (rendered via the host's `LinkProvider`). */
176
201
  href: string;
177
- /** Visually and semantically disable the link. */
178
202
  disabled?: boolean;
179
203
  }
180
204
  /**
181
- * EffectButton — {@link Button} wearing the glossy, springy effect treatment
182
- * ported frame-for-frame from Photon's Framer "Button - Effect". Shares
183
- * Button's size scale (`sm`/`md`/`lg` at 32/36/44px) so it pairs with plain
184
- * Buttons at equal heights. `animated` (default `true`) gates the Motion
185
- * treatment: off, it's a static effect-styled Button whose icon is always
186
- * visible. `fullWidth` stretches the pill across its container. There is no
187
- * variant axis — for a supporting/OAuth pill without the sheen, use
188
- * `<Button variant="secondary">`. Triggers an action; for navigation use
189
- * {@link EffectButtonLink}.
205
+ * @deprecated Prefer `<Button variant="effect">`. Thin alias that forwards to
206
+ * Button with the sheen surface (no icon reveal).
190
207
  */
191
- export declare function EffectButton({ size, fullWidth, animated, prefix, suffix, svgOnly, loading, children, className, ref, ...props }: EffectButtonProps): import("react").JSX.Element;
208
+ export declare function EffectButton({ size, fullWidth, animated, iconReveal, className, ...props }: EffectButtonProps): import("react").JSX.Element;
192
209
  export declare namespace EffectButton {
193
210
  var displayName: string;
194
211
  }
195
212
  /**
196
- * EffectButtonLink — {@link EffectButton} as a link, for navigation that
197
- * changes the URL. Composes {@link ButtonLink} (Motion-wrapped when animated),
198
- * which renders the host router's link via `LinkProvider`, so the pill
199
- * animates identically to the button.
213
+ * @deprecated Prefer `<ButtonLink variant="effect">`.
200
214
  */
201
- export declare function EffectButtonLink({ size, fullWidth, animated, prefix, suffix, svgOnly, loading, disabled, href, children, className, ...props }: EffectButtonLinkProps): import("react").JSX.Element;
215
+ export declare function EffectButtonLink({ size, fullWidth, animated, iconReveal, className, ...props }: EffectButtonLinkProps): import("react").JSX.Element;
202
216
  export declare namespace EffectButtonLink {
203
217
  var displayName: string;
204
218
  }
@@ -1,2 +1,2 @@
1
- export { Button, ButtonLink, buttonVariants, BUTTON_SIZES, BUTTON_SHAPES, BUTTON_VARIANTS, EffectButton, EffectButtonLink, effectButtonVariants, EFFECT_BUTTON_SIZES, type ButtonProps, type ButtonLinkProps, type ButtonSize, type ButtonShape, type ButtonVariant, type EffectButtonProps, type EffectButtonLinkProps, type EffectButtonSize, } from './button';
1
+ export { Button, ButtonLink, buttonVariants, BUTTON_SIZES, BUTTON_SHAPES, BUTTON_VARIANTS, BUTTON_COLORS, EffectButton, EffectButtonLink, effectButtonVariants, EFFECT_BUTTON_SIZES, type ButtonProps, type ButtonLinkProps, type ButtonSize, type ButtonShape, type ButtonVariant, type ButtonColor, type EffectButtonProps, type EffectButtonLinkProps, type EffectButtonSize, } from './button';
2
2
  export { CloseButton, type CloseButtonProps } from './close-button';
@@ -1,9 +1,40 @@
1
- import { ComponentProps, ElementType, ReactNode } from 'react';
1
+ import { ComponentProps, ElementType, MouseEvent as ReactMouseEvent, ReactNode } from 'react';
2
2
  import { Dialog as BaseDialog } from '@base-ui/react/dialog';
3
+ import { ButtonProps } from '../button/button';
3
4
  /** Override Base UI's `string | (state) => string` className with plain string. */
4
5
  type StyledProps<T extends ElementType> = Omit<ComponentProps<T>, "className"> & {
5
6
  className?: string;
6
7
  };
8
+ /**
9
+ * Whether the surrounding dialog has a `Dialog.Action` promise in flight —
10
+ * use it to disable secondary actions (Cancel etc.) while work is pending.
11
+ * Returns `false` outside a `Dialog.Root`.
12
+ */
13
+ export declare function useDialogPending(): boolean;
14
+ type RootProps = ComponentProps<typeof BaseDialog.Root>;
15
+ /**
16
+ * `Dialog.Root` with async awareness: while a `Dialog.Action` promise is
17
+ * pending, every close request (outside press, Escape, `Dialog.Close`) is
18
+ * cancelled so the dialog stays open until the work settles. Props pass
19
+ * through to Base UI's `Dialog.Root` unchanged.
20
+ */
21
+ declare function Root({ onOpenChange, actionsRef, ...props }: RootProps): import("react").JSX.Element;
22
+ export interface DialogActionProps extends Omit<ButtonProps, "onClick"> {
23
+ /**
24
+ * Confirm handler. Return a promise to keep the dialog open while it runs:
25
+ * the button shows `loading`, all dismissal is locked, and the dialog
26
+ * closes when the promise resolves. On rejection the dialog stays open —
27
+ * surface errors inside the handler. A non-promise return closes
28
+ * immediately, like `Dialog.Close`.
29
+ */
30
+ onClick?: (event: ReactMouseEvent<HTMLButtonElement>) => void | Promise<unknown>;
31
+ }
32
+ /**
33
+ * The confirm button of an action row, with native promise support — a
34
+ * `Button` that runs its (possibly async) `onClick` and closes the dialog
35
+ * when the work settles successfully.
36
+ */
37
+ declare function Action({ onClick, loading, disabled, ...props }: DialogActionProps): import("react").JSX.Element;
7
38
  declare function Backdrop({ className, ...props }: StyledProps<typeof BaseDialog.Backdrop>): import("react").JSX.Element;
8
39
  declare function Popup({ className, ...props }: StyledProps<typeof BaseDialog.Popup>): import("react").JSX.Element;
9
40
  declare function Title({ className, ...props }: StyledProps<typeof BaseDialog.Title>): import("react").JSX.Element;
@@ -13,22 +44,33 @@ interface ContentProps extends Omit<StyledProps<typeof BaseDialog.Popup>, "title
13
44
  title?: ReactNode;
14
45
  /** Supporting text under the title. */
15
46
  description?: ReactNode;
16
- /** Show the top-right close button. @default true */
47
+ /**
48
+ * Footer action row (Cancel / Confirm, etc.). Iron rule: when `actions` is
49
+ * set, the header close button is never shown — dismiss via the actions.
50
+ */
51
+ actions?: ReactNode;
52
+ /**
53
+ * Header close control. Only applies when `actions` is absent.
54
+ * @default true
55
+ */
17
56
  showClose?: boolean;
18
57
  children?: ReactNode;
19
58
  }
20
59
  /**
21
60
  * Convenience panel: renders the portal, backdrop, and styled popup with an
22
- * optional header (title/description + close). For full control, compose the
23
- * parts directly (`Dialog.Portal` / `Dialog.Backdrop` / `Dialog.Popup`).
61
+ * optional header (title/description + close) and optional action row. For
62
+ * full control, compose the parts directly (`Dialog.Portal` /
63
+ * `Dialog.Backdrop` / `Dialog.Popup`).
24
64
  */
25
- declare function Content({ title, description, showClose, children, className, ...props }: ContentProps): import("react").JSX.Element;
65
+ declare function Content({ title, description, actions, showClose, children, className, ...props }: ContentProps): import("react").JSX.Element;
26
66
  /**
27
67
  * Modal dialog built on Base UI `Dialog`. Controlled or uncontrolled via
28
- * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`).
68
+ * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`). `Dialog.Action`
69
+ * adds native promise support: an async confirm keeps the dialog open and
70
+ * undismissable until the work resolves.
29
71
  */
30
72
  export declare const Dialog: {
31
- Root: typeof BaseDialog.Root;
73
+ Root: typeof Root;
32
74
  Trigger: BaseDialog.Trigger;
33
75
  Portal: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogPortalProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
34
76
  Backdrop: typeof Backdrop;
@@ -36,6 +78,7 @@ export declare const Dialog: {
36
78
  Title: typeof Title;
37
79
  Description: typeof Description;
38
80
  Close: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AlertDialogCloseProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
81
+ Action: typeof Action;
39
82
  Content: typeof Content;
40
83
  };
41
84
  export {};
@@ -1 +1 @@
1
- export { Dialog } from './dialog';
1
+ export { Dialog, useDialogPending, type DialogActionProps } from './dialog';
@@ -1 +1 @@
1
- export { Menu, MENU_POPUP, MENU_ITEM } from './menu';
1
+ export { Menu, useMenuPending, MENU_POPUP, MENU_ITEM, MENU_ITEM_COLORS, type MenuItemColor, type MenuItemProps, } from './menu';