@photon-ai/pho-ui 2.6.0 → 2.7.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 (78) hide show
  1. package/dist/chunks/IconChevronDown-CZilB71T.js +11 -0
  2. package/dist/chunks/IconChevronDown-CZilB71T.js.map +1 -0
  3. package/dist/chunks/IconSearch-BKAHkLyX.js +14 -0
  4. package/dist/chunks/IconSearch-BKAHkLyX.js.map +1 -0
  5. package/dist/chunks/animated-height-CCO-Ocoz.js +48 -0
  6. package/dist/chunks/animated-height-CCO-Ocoz.js.map +1 -0
  7. package/dist/chunks/basic-page-BF4jnCa1.js +1373 -0
  8. package/dist/chunks/basic-page-BF4jnCa1.js.map +1 -0
  9. package/dist/chunks/{button-DNNs5RsT.js → button-CdqS_t5a.js} +62 -65
  10. package/dist/chunks/button-CdqS_t5a.js.map +1 -0
  11. package/dist/chunks/checkbox-Cdm08HWG.js +129 -0
  12. package/dist/chunks/checkbox-Cdm08HWG.js.map +1 -0
  13. package/dist/chunks/{choice-card-CunOnY9l.js → choice-card-BVNP1NB6.js} +2 -2
  14. package/dist/chunks/{choice-card-CunOnY9l.js.map → choice-card-BVNP1NB6.js.map} +1 -1
  15. package/dist/chunks/data-table--f6am1O3.js +279 -0
  16. package/dist/chunks/data-table--f6am1O3.js.map +1 -0
  17. package/dist/chunks/{dialog-8SRNi_rv.js → dialog-BxKACOj5.js} +4 -4
  18. package/dist/chunks/{dialog-8SRNi_rv.js.map → dialog-BxKACOj5.js.map} +1 -1
  19. package/dist/chunks/{error-Crs-wqMC.js → error-D0yoFxCv.js} +2 -2
  20. package/dist/chunks/{error-Crs-wqMC.js.map → error-D0yoFxCv.js.map} +1 -1
  21. package/dist/chunks/is-react-component-DSnjtBmo.js +10 -0
  22. package/dist/chunks/is-react-component-DSnjtBmo.js.map +1 -0
  23. package/dist/chunks/link-provider-DXzDQ08N.js +24 -0
  24. package/dist/chunks/link-provider-DXzDQ08N.js.map +1 -0
  25. package/dist/chunks/{scroll-area-Bu7egArU.js → scroll-area-BO-9PMM7.js} +27 -26
  26. package/dist/chunks/scroll-area-BO-9PMM7.js.map +1 -0
  27. package/dist/chunks/sidebar-DVzZsCts.js +223 -0
  28. package/dist/chunks/sidebar-DVzZsCts.js.map +1 -0
  29. package/dist/chunks/skeleton-DwjSl4vC.js +18 -0
  30. package/dist/chunks/skeleton-DwjSl4vC.js.map +1 -0
  31. package/dist/chunks/{toast-DoXaRPIZ.js → toast-iSf6NuAS.js} +43 -45
  32. package/dist/chunks/toast-iSf6NuAS.js.map +1 -0
  33. package/dist/chunks/use-press-pulse-IbNstUT0.js +58 -0
  34. package/dist/chunks/use-press-pulse-IbNstUT0.js.map +1 -0
  35. package/dist/components/button.js +1 -1
  36. package/dist/components/checkbox.js +4 -126
  37. package/dist/components/command.js +54 -57
  38. package/dist/components/command.js.map +1 -1
  39. package/dist/components/data-table.js +11 -0
  40. package/dist/components/dialog.js +1 -1
  41. package/dist/components/error.js +1 -1
  42. package/dist/components/phone-input.js +608 -615
  43. package/dist/components/phone-input.js.map +1 -1
  44. package/dist/components/radio-group.js +2 -2
  45. package/dist/components/scroll-area.js +1 -1
  46. package/dist/components/select.js +35 -39
  47. package/dist/components/select.js.map +1 -1
  48. package/dist/components/skeleton.js +2 -15
  49. package/dist/components/toast.js +1 -1
  50. package/dist/index.js +94 -73
  51. package/dist/motion.js +89 -0
  52. package/dist/motion.js.map +1 -0
  53. package/dist/primitives.js +2 -2
  54. package/dist/sections/basic-page.js +16 -14
  55. package/dist/sections/sidebar.js +1 -1
  56. package/dist/src/components/data-table/data-table.d.ts +227 -0
  57. package/dist/src/components/data-table/index.d.ts +2 -0
  58. package/dist/src/index.d.ts +1 -0
  59. package/dist/src/motion/index.d.ts +149 -0
  60. package/dist/src/sections/basic-page/basic-page.d.ts +47 -7
  61. package/dist/src/sections/basic-page/index.d.ts +1 -0
  62. package/dist/utils.js +13 -12
  63. package/package.json +10 -1
  64. package/dist/chunks/animated-height-C2eQstGy.js +0 -51
  65. package/dist/chunks/animated-height-C2eQstGy.js.map +0 -1
  66. package/dist/chunks/basic-page-DsI1xo6p.js +0 -1295
  67. package/dist/chunks/basic-page-DsI1xo6p.js.map +0 -1
  68. package/dist/chunks/button-DNNs5RsT.js.map +0 -1
  69. package/dist/chunks/link-provider-9TFNyDqO.js +0 -28
  70. package/dist/chunks/link-provider-9TFNyDqO.js.map +0 -1
  71. package/dist/chunks/scroll-area-Bu7egArU.js.map +0 -1
  72. package/dist/chunks/sidebar-DvB-G0BP.js +0 -231
  73. package/dist/chunks/sidebar-DvB-G0BP.js.map +0 -1
  74. package/dist/chunks/toast-DoXaRPIZ.js.map +0 -1
  75. package/dist/chunks/use-press-pulse-8iorQPsh.js +0 -62
  76. package/dist/chunks/use-press-pulse-8iorQPsh.js.map +0 -1
  77. package/dist/components/checkbox.js.map +0 -1
  78. package/dist/components/skeleton.js.map +0 -1
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { t } from "./cn-ChIgwEl3.js";
3
+ import { forwardRef as a } from "react";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ var i = a(function({ className: e, ...o }, r) {
6
+ return /* @__PURE__ */ n("div", {
7
+ ref: r,
8
+ "aria-hidden": !0,
9
+ className: t("bg-pho-secondary animate-pho-skeleton rounded-sm", e),
10
+ ...o
11
+ });
12
+ });
13
+ i.displayName = "Skeleton";
14
+ export {
15
+ i as t
16
+ };
17
+
18
+ //# sourceMappingURL=skeleton-DwjSl4vC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton-DwjSl4vC.js","names":[],"sources":["../../src/components/skeleton/skeleton.tsx"],"sourcesContent":["import { forwardRef, type ComponentProps } from \"react\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface SkeletonProps extends ComponentProps<\"div\"> {}\n\n/**\n * A pulsing placeholder bone for loading surfaces. Size and shape come from\n * `className` (`h-*`, `w-*`, `rounded-full`, …) — the component only supplies\n * the wash and motion. Decorative by default (`aria-hidden`); mark the\n * surrounding region with `aria-busy` / `aria-label` instead of labeling each\n * bone. Prefer `Spinner` when a single control is pending.\n */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(\n function Skeleton({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n aria-hidden\n className={cn(\n \"bg-pho-secondary animate-pho-skeleton rounded-sm\",\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nSkeleton.displayName = \"Skeleton\";\n"],"mappings":";;;;AAYA,IAAa,IAAW,EACtB,SAAkB,EAAE,WAAA,GAAW,GAAG,EAAA,GAAS,GAAK;AAC9C,SACE,gBAAA,EAAC,OAAD;AAAA,IACO,KAAA;AAAA,IACL,eAAA;AAAA,IACA,WAAW,EACT,oDACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL,CACF;AAEA,EAAS,cAAc"}
@@ -1,35 +1,33 @@
1
1
  "use client";
2
2
  import { t as n } from "./cn-ChIgwEl3.js";
3
+ import { FADE_SWAP as _ } from "../motion.js";
3
4
  import { n as y } from "./spinner-BzLUo4Xk.js";
4
- import { a as _ } from "./button-DNNs5RsT.js";
5
+ import { a as b } from "./button-CdqS_t5a.js";
5
6
  import { t as i } from "./createReactComponent-BqCmnqfX.js";
6
- import { t as b } from "./IconX-pZ9vrtSr.js";
7
- import "./scroll-area-Bu7egArU.js";
7
+ import { t as w } from "./IconX-pZ9vrtSr.js";
8
+ import { n as k } from "./scroll-area-BO-9PMM7.js";
8
9
  import "react";
9
10
  import { jsx as t, jsxs as l } from "react/jsx-runtime";
10
- import { AnimatePresence as w, motion as k, useReducedMotion as z } from "motion/react";
11
+ import { AnimatePresence as z, motion as T, useReducedMotion as N } from "motion/react";
11
12
  import { Toast as o } from "@base-ui/react/toast";
12
- var T = [["path", {
13
+ var A = [["path", {
13
14
  d: "M14.897 1a4 4 0 0 1 2.664 1.016l.165 .156l4.1 4.1a4 4 0 0 1 1.168 2.605l.006 .227v5.794a4 4 0 0 1 -1.016 2.664l-.156 .165l-4.1 4.1a4 4 0 0 1 -2.603 1.168l-.227 .006h-5.795a3.999 3.999 0 0 1 -2.664 -1.017l-.165 -.156l-4.1 -4.1a4 4 0 0 1 -1.168 -2.604l-.006 -.227v-5.794a4 4 0 0 1 1.016 -2.664l.156 -.165l4.1 -4.1a4 4 0 0 1 2.605 -1.168l.227 -.006h5.793zm-2.887 14l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z",
14
15
  key: "svg-0"
15
- }]], N = i("filled", "alert-octagon-filled", "AlertOctagonFilled", T), C = [["path", {
16
+ }]], C = i("filled", "alert-octagon-filled", "AlertOctagonFilled", A), M = [["path", {
16
17
  d: "M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z",
17
18
  key: "svg-0"
18
- }]], A = i("filled", "alert-triangle-filled", "AlertTriangleFilled", C), M = [["path", {
19
+ }]], P = i("filled", "alert-triangle-filled", "AlertTriangleFilled", M), F = [["path", {
19
20
  d: "M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z",
20
21
  key: "svg-0"
21
- }]], P = i("filled", "circle-check-filled", "CircleCheckFilled", M), F = [["path", {
22
+ }]], I = i("filled", "circle-check-filled", "CircleCheckFilled", F), S = [["path", {
22
23
  d: "M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z",
23
24
  key: "svg-0"
24
- }]], I = i("filled", "info-circle-filled", "InfoCircleFilled", F), Y = {
25
- duration: 0.2,
26
- ease: "easeOut"
27
- }, c = o.Provider, d = o.Portal, p = o.Action, S = o.useToastManager, X = o.createToastManager, $ = {
28
- success: P,
29
- error: N,
30
- warning: A,
31
- info: I
32
- }, O = {
25
+ }]], Y = i("filled", "info-circle-filled", "InfoCircleFilled", S), X = _, c = o.Provider, d = o.Portal, p = o.Action, $ = o.useToastManager, O = o.createToastManager, R = {
26
+ success: I,
27
+ error: C,
28
+ warning: P,
29
+ info: Y
30
+ }, D = {
33
31
  success: "bg-[color-mix(in_oklab,var(--text-color-pho-success)_7%,transparent)]",
34
32
  error: "bg-[color-mix(in_oklab,var(--text-color-pho-error)_7%,transparent)]",
35
33
  warning: "bg-[color-mix(in_oklab,var(--text-color-pho-warning)_7%,transparent)]",
@@ -53,52 +51,52 @@ function v({ className: a, ...e }) {
53
51
  ...e
54
52
  });
55
53
  }
56
- function u({ className: a, ...e }) {
54
+ function f({ className: a, ...e }) {
57
55
  return /* @__PURE__ */ t(o.Title, {
58
56
  "data-toast-title": !0,
59
57
  className: n("text-pho-primary text-md font-medium", a),
60
58
  ...e
61
59
  });
62
60
  }
63
- function f({ className: a, ...e }) {
61
+ function x({ className: a, ...e }) {
64
62
  return /* @__PURE__ */ t(o.Description, {
65
63
  className: n("text-pho-description text-md", a),
66
64
  ...e
67
65
  });
68
66
  }
69
- function x({ className: a, ...e }) {
67
+ function u({ className: a, ...e }) {
70
68
  return /* @__PURE__ */ t(o.Close, {
71
69
  "data-toast-close": !0,
72
70
  className: n("text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4", a),
73
71
  ...e
74
72
  });
75
73
  }
76
- function R({ type: a }) {
74
+ function j({ type: a }) {
77
75
  if (a === "loading") return /* @__PURE__ */ t(y, {
78
76
  "aria-hidden": !0,
79
77
  className: "mb-2 size-6 shrink-0"
80
78
  });
81
- const e = a != null ? $[a] : void 0;
79
+ const e = a != null ? R[a] : void 0;
82
80
  return e == null ? null : /* @__PURE__ */ t(e, {
83
81
  "aria-hidden": !0,
84
82
  "data-toast-icon": !0,
85
83
  className: "mb-2 size-6 shrink-0"
86
84
  });
87
85
  }
88
- function j() {
89
- const { toasts: a, close: e } = o.useToastManager(), s = z() ? "blur(0px)" : "blur(1px)";
86
+ function W() {
87
+ const { toasts: a, close: e } = o.useToastManager(), s = N() ? "blur(0px)" : `blur(${k}px)`;
90
88
  return a.map((r) => /* @__PURE__ */ l(h, {
91
89
  toast: r,
92
90
  children: [
93
91
  /* @__PURE__ */ t("div", {
94
92
  "aria-hidden": !0,
95
- className: n("pointer-events-none absolute inset-0 rounded-[inherit] transition-colors duration-200 ease-out", r.type != null ? O[r.type] : void 0)
93
+ className: n("pointer-events-none absolute inset-0 rounded-[inherit] transition-colors duration-200 ease-out", r.type != null ? D[r.type] : void 0)
96
94
  }),
97
95
  /* @__PURE__ */ t(v, { children: /* @__PURE__ */ t("span", {
98
96
  className: "grid",
99
- children: /* @__PURE__ */ t(w, {
97
+ children: /* @__PURE__ */ t(z, {
100
98
  initial: !1,
101
- children: /* @__PURE__ */ l(k.div, {
99
+ children: /* @__PURE__ */ l(T.div, {
102
100
  className: "flex min-w-0 flex-col [grid-area:1/1]",
103
101
  initial: {
104
102
  opacity: 0,
@@ -112,14 +110,14 @@ function j() {
112
110
  opacity: 0,
113
111
  filter: s
114
112
  },
115
- transition: Y,
113
+ transition: X,
116
114
  children: [
117
- /* @__PURE__ */ t(R, { type: r.type }),
118
- /* @__PURE__ */ t(u, { children: r.title }),
119
- /* @__PURE__ */ t(f, { children: r.description }),
115
+ /* @__PURE__ */ t(j, { type: r.type }),
116
+ /* @__PURE__ */ t(f, { children: r.title }),
117
+ /* @__PURE__ */ t(x, { children: r.description }),
120
118
  r.actionProps != null ? /* @__PURE__ */ t(p, {
121
119
  "data-toast-action": !0,
122
- render: /* @__PURE__ */ t(_, {
120
+ render: /* @__PURE__ */ t(b, {
123
121
  variant: "outlined",
124
122
  size: "sm"
125
123
  }),
@@ -133,35 +131,35 @@ function j() {
133
131
  }, `${r.type ?? ""}|${String(r.title ?? "")}`)
134
132
  })
135
133
  }) }),
136
- /* @__PURE__ */ t(x, {
134
+ /* @__PURE__ */ t(u, {
137
135
  "aria-label": "Dismiss",
138
- children: /* @__PURE__ */ t(b, {})
136
+ children: /* @__PURE__ */ t(w, {})
139
137
  })
140
138
  ]
141
139
  }, r.id));
142
140
  }
143
- function K({ children: a, toastManager: e }) {
141
+ function Z({ children: a, toastManager: e }) {
144
142
  return /* @__PURE__ */ l(c, {
145
143
  toastManager: e,
146
- children: [a, /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(j, {}) }) })]
144
+ children: [a, /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(W, {}) }) })]
147
145
  });
148
146
  }
149
- var Q = {
147
+ var tt = {
150
148
  Provider: c,
151
149
  Portal: d,
152
150
  Viewport: m,
153
151
  Root: h,
154
152
  Content: v,
155
- Title: u,
156
- Description: f,
157
- Close: x,
153
+ Title: f,
154
+ Description: x,
155
+ Close: u,
158
156
  Action: p,
159
- useToastManager: S,
160
- createToastManager: X
157
+ useToastManager: $,
158
+ createToastManager: O
161
159
  };
162
160
  export {
163
- K as n,
164
- Q as t
161
+ Z as n,
162
+ tt as t
165
163
  };
166
164
 
167
- //# sourceMappingURL=toast-DoXaRPIZ.js.map
165
+ //# sourceMappingURL=toast-iSf6NuAS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast-iSf6NuAS.js","names":["__iconNode","__iconNode","__iconNode"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertOctagonFilled.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangleFilled.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheckFilled.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircleFilled.mjs","../../src/components/toast/toast.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M14.897 1a4 4 0 0 1 2.664 1.016l.165 .156l4.1 4.1a4 4 0 0 1 1.168 2.605l.006 .227v5.794a4 4 0 0 1 -1.016 2.664l-.156 .165l-4.1 4.1a4 4 0 0 1 -2.603 1.168l-.227 .006h-5.795a3.999 3.999 0 0 1 -2.664 -1.017l-.165 -.156l-4.1 -4.1a4 4 0 0 1 -1.168 -2.604l-.006 -.227v-5.794a4 4 0 0 1 1.016 -2.664l.156 -.165l4.1 -4.1a4 4 0 0 1 2.605 -1.168l.227 -.006h5.793zm-2.887 14l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z\", \"key\": \"svg-0\" }]];\nconst IconAlertOctagonFilled = createReactComponent(\"filled\", \"alert-octagon-filled\", \"AlertOctagonFilled\", __iconNode);\n\nexport { __iconNode, IconAlertOctagonFilled as default };\n//# sourceMappingURL=IconAlertOctagonFilled.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z\", \"key\": \"svg-0\" }]];\nconst IconAlertTriangleFilled = createReactComponent(\"filled\", \"alert-triangle-filled\", \"AlertTriangleFilled\", __iconNode);\n\nexport { __iconNode, IconAlertTriangleFilled as default };\n//# sourceMappingURL=IconAlertTriangleFilled.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z\", \"key\": \"svg-0\" }]];\nconst IconCircleCheckFilled = createReactComponent(\"filled\", \"circle-check-filled\", \"CircleCheckFilled\", __iconNode);\n\nexport { __iconNode, IconCircleCheckFilled as default };\n//# sourceMappingURL=IconCircleCheckFilled.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z\", \"key\": \"svg-0\" }]];\nconst IconInfoCircleFilled = createReactComponent(\"filled\", \"info-circle-filled\", \"InfoCircleFilled\", __iconNode);\n\nexport { __iconNode, IconInfoCircleFilled as default };\n//# sourceMappingURL=IconInfoCircleFilled.mjs.map\n","import { type ComponentProps, type ElementType, type ReactNode } from \"react\";\nimport { FADE_SWAP } from \"../../motion\";\nimport { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport {\n IconAlertOctagonFilled,\n IconAlertTriangleFilled,\n IconCircleCheckFilled,\n IconInfoCircleFilled,\n IconX,\n type Icon,\n} from \"@tabler/icons-react\";\nimport { BLUR_MAX_PX } from \"../scroll-area\";\nimport { Button } from \"../button\";\nimport { Spinner } from \"../spinner\";\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\n/** The system's swap: fade through the 1px soft focus, ease-out. */\nconst FACE_SWAP = FADE_SWAP;\n\nconst Provider = BaseToast.Provider;\nconst Portal = BaseToast.Portal;\nconst Action = BaseToast.Action;\n\n/** Imperative toast API: `const toast = useToastManager(); toast.add({ title })`. */\nconst useToastManager = BaseToast.useToastManager;\nconst createToastManager = BaseToast.createToastManager;\n\n/**\n * Status glyphs per toast `type` (Kumo's set in Tabler's hand): the glyph\n * and the title take the status ink, the hairline tints with it, and a\n * translucent wash of the same ink sits over the surface. `info` speaks\n * in the brand ink — Pho has no separate info hue. `loading` is what\n * `manager.promise` shows while the work runs.\n */\nconst TOAST_ICONS: Record<string, Icon> = {\n success: IconCircleCheckFilled,\n error: IconAlertOctagonFilled,\n warning: IconAlertTriangleFilled,\n info: IconInfoCircleFilled,\n};\n\nconst TOAST_WASH: Record<string, string> = {\n success:\n \"bg-[color-mix(in_oklab,var(--text-color-pho-success)_7%,transparent)]\",\n error: \"bg-[color-mix(in_oklab,var(--text-color-pho-error)_7%,transparent)]\",\n warning:\n \"bg-[color-mix(in_oklab,var(--text-color-pho-warning)_7%,transparent)]\",\n info: \"bg-[color-mix(in_oklab,var(--text-color-pho-brand)_7%,transparent)]\",\n};\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Viewport>) {\n return (\n <BaseToast.Viewport\n // The stack's anchor box; the cards position themselves absolutely\n // against its bottom edge, and hovering any card expands the stack.\n className={cn(\n \"fixed right-4 bottom-4 z-50 flex w-[calc(100%-2rem)] outline-none sm:w-[22rem]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Root({ className, ...props }: StyledProps<typeof BaseToast.Root>) {\n return (\n <BaseToast.Root\n className={cn(\n // Floating layer: keeps its elevation shadow, sits on the card surface\n // with the site hairline (ring-pho-secondary).\n \"bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary rounded-base absolute right-0 bottom-0 w-full origin-bottom ring-1 select-none ring-inset\",\n // Kumo's stack math on Base UI's variables: a 12px gap folded into\n // the expanded offsets, a 12px peek and −10% scale per depth at\n // rest, the newest card on top.\n \"[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]\",\n \"[--offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--gap)*-1+var(--toast-swipe-movement-y,0px))]\",\n \"[z-index:calc(1000-var(--toast-index))] h-[var(--height)]\",\n \"[transform:translateX(var(--toast-swipe-movement-x,0px))_translateY(calc(var(--toast-swipe-movement-y,0px)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))]\",\n \"[transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.5s,height_0.15s,box-shadow_0.2s_ease-out]\",\n // Invisible bridge below each card so the hover survives the gaps.\n \"after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']\",\n // Hovering (or focusing) the stack expands it into a true list.\n \"data-[expanded]:h-[var(--toast-height)] data-[expanded]:[transform:translateX(var(--toast-swipe-movement-x,0px))_translateY(var(--offset-y))]\",\n // Beyond the provider's limit a card parks invisibly until room frees.\n \"data-[limited]:opacity-0\",\n // In from below; out along the swipe, or back down when timed out.\n \"data-[starting-style]:[transform:translateY(150%)]\",\n \"data-[ending-style]:opacity-0\",\n \"[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]\",\n \"data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y,0px)+150%))]\",\n \"data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y,0px)-150%))]\",\n \"data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x,0px)-150%))_translateY(var(--offset-y))]\",\n \"data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x,0px)+150%))_translateY(var(--offset-y))]\",\n \"data-[swiping]:[transition:none]\",\n // Status inks: hairline, glyph, and title tint together per type.\n \"data-[type=success]:[&_[data-toast-icon]]:text-pho-success data-[type=success]:[&_[data-toast-title]]:text-pho-success data-[type=success]:[&_[data-toast-action]]:text-pho-success data-[type=success]:[&_[data-toast-close]]:text-pho-success data-[type=success]:ring-[color-mix(in_oklab,var(--text-color-pho-success)_45%,transparent)] data-[type=success]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-success)_45%,transparent)]\",\n \"data-[type=error]:[&_[data-toast-icon]]:text-pho-error data-[type=error]:[&_[data-toast-title]]:text-pho-error data-[type=error]:[&_[data-toast-action]]:text-pho-error data-[type=error]:[&_[data-toast-close]]:text-pho-error data-[type=error]:ring-[color-mix(in_oklab,var(--text-color-pho-error)_45%,transparent)] data-[type=error]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-error)_45%,transparent)]\",\n \"data-[type=warning]:[&_[data-toast-icon]]:text-pho-warning data-[type=warning]:[&_[data-toast-title]]:text-pho-warning data-[type=warning]:[&_[data-toast-action]]:text-pho-warning data-[type=warning]:[&_[data-toast-close]]:text-pho-warning data-[type=warning]:ring-[color-mix(in_oklab,var(--text-color-pho-warning)_45%,transparent)] data-[type=warning]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-warning)_45%,transparent)]\",\n \"data-[type=info]:[&_[data-toast-icon]]:text-pho-brand data-[type=info]:[&_[data-toast-title]]:text-pho-brand data-[type=info]:[&_[data-toast-action]]:text-pho-brand data-[type=info]:[&_[data-toast-close]]:text-pho-brand data-[type=info]:ring-[color-mix(in_oklab,var(--text-color-pho-brand)_45%,transparent)] data-[type=info]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-brand)_45%,transparent)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Content>) {\n return (\n <BaseToast.Content\n // Cards behind the front one show only their peeking edge — the\n // words appear when the stack expands.\n className={cn(\n \"isolate flex flex-col p-4 pr-10 transition-opacity [transition-duration:250ms]\",\n \"data-[behind]:pointer-events-none data-[behind]:opacity-0 data-[expanded]:pointer-events-auto data-[expanded]:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseToast.Title>) {\n return (\n <BaseToast.Title\n data-toast-title\n className={cn(\"text-pho-primary text-md font-medium\", className)}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Description>) {\n return (\n <BaseToast.Description\n className={cn(\"text-pho-description text-md\", className)}\n {...props}\n />\n );\n}\n\nfunction Close({ className, ...props }: StyledProps<typeof BaseToast.Close>) {\n return (\n <BaseToast.Close\n data-toast-close\n className={cn(\n \"text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * The status glyph for a typed toast — its own row above the title, the\n * Dialog header's arrangement at card scale, an 8px breath before the\n * title. `loading` shows the spinner.\n */\nfunction TypeIcon({ type }: { type?: string }) {\n if (type === \"loading\") {\n return <Spinner aria-hidden className=\"mb-2 size-6 shrink-0\" />;\n }\n const Glyph = type != null ? TOAST_ICONS[type] : undefined;\n if (Glyph == null) return null;\n return <Glyph aria-hidden data-toast-icon className=\"mb-2 size-6 shrink-0\" />;\n}\n\nfunction ToastyList() {\n const { toasts, close } = BaseToast.useToastManager();\n const reduceMotion = useReducedMotion();\n const blurAway = reduceMotion ? \"blur(0px)\" : `blur(${BLUR_MAX_PX}px)`;\n return toasts.map((toast) => (\n <Root key={toast.id} toast={toast}>\n {/* The status wash: a breath of the status ink over the surface. */}\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-0 rounded-[inherit] transition-colors duration-200 ease-out\",\n toast.type != null ? TOAST_WASH[toast.type] : undefined,\n )}\n />\n <Content>\n {/* One grid cell, faces stacked: when a promise walks the card\n from loading to its outcome, the old face fades out through\n the system's soft focus exactly where the new one fades in —\n the values ride each face, so the goer keeps its words. */}\n <span className=\"grid\">\n <AnimatePresence initial={false}>\n <motion.div\n key={`${toast.type ?? \"\"}|${String(toast.title ?? \"\")}`}\n className=\"flex min-w-0 flex-col [grid-area:1/1]\"\n initial={{ opacity: 0, filter: blurAway }}\n animate={{ opacity: 1, filter: \"blur(0px)\" }}\n exit={{ opacity: 0, filter: blurAway }}\n transition={FACE_SWAP}\n >\n <TypeIcon type={toast.type} />\n <Title>{toast.title}</Title>\n <Description>{toast.description}</Description>\n {toast.actionProps != null ? (\n <Action\n data-toast-action\n render={<Button variant=\"outlined\" size=\"sm\" />}\n className=\"mt-2 self-start\"\n onClick={(event) => {\n toast.actionProps?.onClick?.(event);\n close(toast.id);\n }}\n >\n {toast.actionProps.children}\n </Action>\n ) : null}\n </motion.div>\n </AnimatePresence>\n </span>\n </Content>\n <Close aria-label=\"Dismiss\">\n <IconX />\n </Close>\n </Root>\n ));\n}\n\n/**\n * Toasty — the whole toast system in one wrapper, Kumo-shaped: provider,\n * portal, viewport, and the stacked card list with status variants. Wrap\n * the app once and call `Toast.useToastManager().add({ title, type })`\n * from any child; pass a `toastManager` from `createToastManager()` so\n * code outside the tree (a form's auto-save, a query cache) can speak\n * through the same lane. `manager.promise` shows loading → success/error\n * with the matching glyphs.\n */\nexport function Toasty({\n children,\n toastManager,\n}: {\n children?: ReactNode;\n toastManager?: ComponentProps<typeof BaseToast.Provider>[\"toastManager\"];\n}) {\n return (\n <Provider toastManager={toastManager}>\n {children}\n <Portal>\n <Viewport>\n <ToastyList />\n </Viewport>\n </Portal>\n </Provider>\n );\n}\n\n/**\n * Toast built on Base UI `Toast` — transient, non-blocking notifications\n * in a sonner-style stack, styled after Cloudflare's Kumo: at rest the\n * cards collapse into a peek (12px rise and −10% scale per depth, words\n * hidden behind the front card), expand into a true list with a 12px gap\n * on hover or focus, swipe to dismiss, three visible at most. `type`\n * (`success` / `error` / `warning` / `info` / `loading`) tints hairline,\n * glyph, and title together. Reach for `Toasty` unless you need to\n * compose the parts yourself.\n */\nexport const Toast = {\n Provider,\n Portal,\n Viewport,\n Root,\n Content,\n Title,\n Description,\n Close,\n Action,\n useToastManager,\n createToastManager,\n};\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;;;;;;;AASA,IAAMA,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAujB,KAAO;AAAQ,CAAC,CAAC,GACtmB,IAAyB,EAAqB,UAAU,wBAAwB,sBAAsBA,CAAU,GCDhHC,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAA0Z,KAAO;AAAQ,CAAC,CAAC,GACzc,IAA0B,EAAqB,UAAU,yBAAyB,uBAAuBA,CAAU,GCDnHC,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAgS,KAAO;AAAQ,CAAC,CAAC,GAC/U,IAAwB,EAAqB,UAAU,uBAAuB,qBAAqBA,CAAU,GC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BAAA,EAAC,GAAD,EAAA,UACE,gBAAA,EAAC,GAAD,EAAA,UACE,gBAAA,EAAC,GAAD,CAAa,CAAA,EACL,CAAA,EACJ,CAAA,CACA;AAAA;AAEd;AAYA,IAAa,KAAQ;AAAA,EACnB,UAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,iBAAA;AAAA,EACA,oBAAA;AACF"}
@@ -0,0 +1,58 @@
1
+ "use client";
2
+ import { PRESS_SCALE as S, SPRING_PRESS_QUICK as E } from "../motion.js";
3
+ import { useCallback as a, useEffect as P, useRef as f } from "react";
4
+ import { useAnimationControls as w } from "motion/react";
5
+ var L = E, R = S;
6
+ function I(l) {
7
+ const p = l?.scale ?? R, t = l?.disabled ?? !1, s = l?.transition ?? L, r = w(), o = f(!1), d = f(null), n = f(null);
8
+ P(() => () => n.current?.(), []);
9
+ const i = a(() => {
10
+ t || (o.current = !0, d.current = r.start({
11
+ scale: p,
12
+ transition: s
13
+ }));
14
+ }, [
15
+ r,
16
+ t,
17
+ p,
18
+ s
19
+ ]), c = a(async () => {
20
+ if (!o.current) return;
21
+ o.current = !1;
22
+ const e = d.current;
23
+ await e, !(o.current || d.current !== e) && r.start({
24
+ scale: 1,
25
+ transition: s
26
+ });
27
+ }, [r, s]);
28
+ return {
29
+ pulse: a(() => {
30
+ i(), c();
31
+ }, [i, c]),
32
+ motionProps: {
33
+ initial: !1,
34
+ animate: r,
35
+ onPointerDown: a((e) => {
36
+ if (t || e.button !== 0 || !e.isPrimary) return;
37
+ i(), n.current?.();
38
+ const u = (m) => {
39
+ m.pointerId === e.pointerId && (n.current?.(), c());
40
+ };
41
+ window.addEventListener("pointerup", u), window.addEventListener("pointercancel", u), n.current = () => {
42
+ window.removeEventListener("pointerup", u), window.removeEventListener("pointercancel", u), n.current = null;
43
+ };
44
+ }, [
45
+ t,
46
+ i,
47
+ c
48
+ ])
49
+ }
50
+ };
51
+ }
52
+ export {
53
+ L as n,
54
+ I as r,
55
+ R as t
56
+ };
57
+
58
+ //# sourceMappingURL=use-press-pulse-IbNstUT0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-press-pulse-IbNstUT0.js","names":[],"sources":["../../src/utils/use-press-pulse.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from \"react\";\nimport { PRESS_SCALE, SPRING_PRESS_QUICK } from \"../motion\";\nimport { useAnimationControls, type Transition } from \"motion/react\";\n\n/**\n * Press feedback for selection controls (Select trigger, Checkbox…) — the same\n * spring family as Button's effect press, and the same pointer-following\n * behavior: press in on pointer-down, stay compressed while held, spring back\n * on release. One deliberate refinement over a bare `whileTap`: a fast tap\n * never truncates the press-in leg — it always reaches full depth before\n * springing back, so even the quickest click reads as a complete tick.\n */\nexport const CONTROL_PRESS_SPRING = SPRING_PRESS_QUICK;\n\n/** Default press depth — shallow; each control can tune its own. */\nexport const CONTROL_PRESS_SCALE = PRESS_SCALE;\n\n/**\n * Pointer-following press driven by Motion controls. Spread `motionProps` onto\n * a `motion.*` element (via Base UI `render`): pointer-down (primary button)\n * compresses and holds; release springs back once the press-in leg has\n * finished. Release is tracked on `window`, so dragging off the control before\n * letting go still restores it.\n */\nexport function usePressPulse(opts?: {\n scale?: number;\n disabled?: boolean;\n /** Spring override for both legs of the press. @default CONTROL_PRESS_SPRING */\n transition?: Transition;\n}) {\n const scale = opts?.scale ?? CONTROL_PRESS_SCALE;\n const disabled = opts?.disabled ?? false;\n const transition = opts?.transition ?? CONTROL_PRESS_SPRING;\n const controls = useAnimationControls();\n const pressed = useRef(false);\n const pressIn = useRef<Promise<unknown> | null>(null);\n const removeListeners = useRef<(() => void) | null>(null);\n\n useEffect(() => () => removeListeners.current?.(), []);\n\n const press = useCallback(() => {\n if (disabled) return;\n pressed.current = true;\n pressIn.current = controls.start({ scale, transition });\n }, [controls, disabled, scale, transition]);\n\n const release = useCallback(async () => {\n if (!pressed.current) return;\n pressed.current = false;\n const leg = pressIn.current;\n // Let the press-in leg play out in full before springing back, so a tap\n // shorter than the spring still shows the whole press.\n await leg;\n // A re-press started while we waited — its own release will restore.\n if (pressed.current || pressIn.current !== leg) return;\n void controls.start({ scale: 1, transition });\n }, [controls, transition]);\n\n /** Programmatic one-shot pulse (press in, then spring back). */\n const pulse = useCallback(() => {\n press();\n void release();\n }, [press, release]);\n\n const onPointerDown = useCallback(\n (event: { button: number; pointerId: number; isPrimary: boolean }) => {\n if (disabled || event.button !== 0 || !event.isPrimary) return;\n press();\n // The pointer may be released anywhere (including off the control after\n // dragging away), so listen on window rather than the element — but only\n // for the pointer that started this press, so another finger lifting\n // elsewhere doesn't spring the control back early.\n removeListeners.current?.();\n const end = (e: PointerEvent) => {\n if (e.pointerId !== event.pointerId) return;\n removeListeners.current?.();\n void release();\n };\n window.addEventListener(\"pointerup\", end);\n window.addEventListener(\"pointercancel\", end);\n removeListeners.current = () => {\n window.removeEventListener(\"pointerup\", end);\n window.removeEventListener(\"pointercancel\", end);\n removeListeners.current = null;\n };\n },\n [disabled, press, release],\n );\n\n return {\n pulse,\n motionProps: { initial: false as const, animate: controls, onPointerDown },\n };\n}\n"],"mappings":";;;;AAYA,IAAa,IAAuB,GAGvB,IAAsB;AASnC,SAAgB,EAAc,GAK3B;AACD,QAAM,IAAQ,GAAM,SAAS,GACvB,IAAW,GAAM,YAAY,IAC7B,IAAa,GAAM,cAAc,GACjC,IAAW,EAAqB,GAChC,IAAU,EAAO,EAAK,GACtB,IAAU,EAAgC,IAAI,GAC9C,IAAkB,EAA4B,IAAI;AAExD,EAAA,EAAA,MAAA,MAAsB,EAAgB,UAAU,GAAG,CAAC,CAAC;AAErD,QAAM,IAAQ,EAAA,MAAkB;AAC9B,IAAI,MACJ,EAAQ,UAAU,IAClB,EAAQ,UAAU,EAAS,MAAM;AAAA,MAAE,OAAA;AAAA,MAAO,YAAA;AAAA,IAAW,CAAC;AAAA,EACxD,GAAG;AAAA,IAAC;AAAA,IAAU;AAAA,IAAU;AAAA,IAAO;AAAA,EAAU,CAAC,GAEpC,IAAU,EAAY,YAAY;AACtC,QAAI,CAAC,EAAQ,QAAS;AACtB,IAAA,EAAQ,UAAU;AAClB,UAAM,IAAM,EAAQ;AAKpB,IAFA,MAAM,GAEF,EAAA,EAAQ,WAAW,EAAQ,YAAY,MAC3C,EAAc,MAAM;AAAA,MAAE,OAAO;AAAA,MAAG,YAAA;AAAA,IAAW,CAAC;AAAA,EAC9C,GAAG,CAAC,GAAU,CAAU,CAAC;AAiCzB,SAAO;AAAA,IACL,OA/BY,EAAA,MAAkB;AAC9B,MAAA,EAAM,GACN,EAAa;AAAA,IACf,GAAG,CAAC,GAAO,CAAO,CA4BhB;AAAA,IACA,aAAa;AAAA,MAAE,SAAS;AAAA,MAAgB,SAAS;AAAA,MAAU,eA3BvC,EAAA,CACnB,MAAqE;AACpE,YAAI,KAAY,EAAM,WAAW,KAAK,CAAC,EAAM,UAAW;AACxD,QAAA,EAAM,GAKN,EAAgB,UAAU;AAC1B,cAAM,IAAA,CAAO,MAAoB;AAC/B,UAAI,EAAE,cAAc,EAAM,cAC1B,EAAgB,UAAU,GAC1B,EAAa;AAAA,QACf;AACA,eAAO,iBAAiB,aAAa,CAAG,GACxC,OAAO,iBAAiB,iBAAiB,CAAG,GAC5C,EAAgB,UAAA,MAAgB;AAC9B,iBAAO,oBAAoB,aAAa,CAAG,GAC3C,OAAO,oBAAoB,iBAAiB,CAAG,GAC/C,EAAgB,UAAU;AAAA,QAC5B;AAAA,MACF,GACA;AAAA,QAAC;AAAA,QAAU;AAAA,QAAO;AAAA,MAAO,CAKkC;AAAA,IAAc;AAAA,EAC3E;AACF"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { a, c as s, d as o, i as n, l as T, n as B, o as u, r as e, s as f, t as i, u as r } from "../chunks/button-DNNs5RsT.js";
2
+ import { a, c as s, d as o, i as n, l as T, n as B, o as u, r as e, s as f, t as i, u as r } from "../chunks/button-CdqS_t5a.js";
3
3
  import { t as E } from "../chunks/close-button-GvqWbLl0.js";
4
4
  export {
5
5
  i as BUTTON_COLORS,
@@ -1,129 +1,7 @@
1
1
  "use client";
2
- import { t } from "../chunks/cn-ChIgwEl3.js";
3
- import { r as b } from "../chunks/use-press-pulse-8iorQPsh.js";
4
- import { n as x, r as k, t as v } from "../chunks/choice-card-CunOnY9l.js";
5
- import "react";
6
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
7
- import { motion as u } from "motion/react";
8
- import { Checkbox as h } from "@base-ui/react/checkbox";
9
- import { CheckboxGroup as C } from "@base-ui/react/checkbox-group";
10
- var f = "M5 12l5 5l10 -10", y = "M5 12l14 0", N = {
11
- duration: 0.22,
12
- ease: "easeOut"
13
- };
14
- function g({ indeterminate: r, className: o }) {
15
- return /* @__PURE__ */ e("svg", {
16
- viewBox: "0 0 24 24",
17
- fill: "none",
18
- stroke: "currentColor",
19
- strokeWidth: 2,
20
- strokeLinecap: "round",
21
- strokeLinejoin: "round",
22
- className: o,
23
- "aria-hidden": "true",
24
- children: /* @__PURE__ */ e(u.path, {
25
- d: r ? y : f,
26
- initial: { pathLength: 0 },
27
- animate: { pathLength: 1 },
28
- transition: N
29
- }, r ? "minus" : "check")
30
- });
31
- }
32
- var I = {
33
- sm: "size-4",
34
- md: "size-5"
35
- }, _ = {
36
- sm: "size-3",
37
- md: "size-3.5"
38
- };
39
- function A({ className: r, label: o, size: s = "md", disabled: i, indeterminate: a, ...d }) {
40
- const { motionProps: l } = b({
41
- scale: 0.94,
42
- disabled: !!i
43
- }), { onPointerDown: c, ...n } = l, m = /* @__PURE__ */ e(h.Root, {
44
- disabled: i,
45
- indeterminate: a,
46
- render: /* @__PURE__ */ e(u.span, {
47
- ...n,
48
- onPointerDown: o ? void 0 : c
49
- }),
50
- className: t("group/cb outline-pho-brand bg-pho-primary ring-pho-primary text-pho-on-brand flex shrink-0 cursor-pointer items-center justify-center rounded-sm ring-1 ring-inset focus-visible:outline-2 focus-visible:outline-offset-2", "transition-[background-color,box-shadow,color,outline-color] duration-150 ease-out", "hover:bg-pho-primary-hover hover:ring-pho-ink group-hover:bg-pho-primary-hover group-hover:ring-pho-ink", "data-[checked]:bg-pho-brand-solid data-[checked]:ring-transparent", "data-[indeterminate]:bg-pho-brand-solid data-[indeterminate]:ring-transparent", "data-[checked]:hover:bg-pho-brand-solid-hover data-[checked]:group-hover:bg-pho-brand-solid-hover", "data-[indeterminate]:hover:bg-pho-brand-solid-hover data-[indeterminate]:group-hover:bg-pho-brand-solid-hover", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", I[s], r),
51
- ...d,
52
- children: /* @__PURE__ */ e(h.Indicator, {
53
- className: t("flex items-center justify-center transition-opacity duration-100 ease-out", "data-[ending-style]:opacity-0"),
54
- children: /* @__PURE__ */ e(g, {
55
- indeterminate: a,
56
- className: _[s]
57
- })
58
- })
59
- });
60
- return o ? /* @__PURE__ */ p("label", {
61
- className: "group flex cursor-pointer items-center gap-2 select-none",
62
- onPointerDown: c,
63
- children: [m, /* @__PURE__ */ e("span", {
64
- className: "text-pho-secondary text-base",
65
- children: o
66
- })]
67
- }) : m;
68
- }
69
- A.displayName = "Checkbox";
70
- function P({ className: r, ...o }) {
71
- return /* @__PURE__ */ e(C, {
72
- className: t("flex flex-col gap-3", r),
73
- ...o
74
- });
75
- }
76
- P.displayName = "CheckboxGroup";
77
- function R({ title: r, description: o }) {
78
- return /* @__PURE__ */ p("span", { children: [/* @__PURE__ */ e("span", {
79
- className: "text-pho-primary block",
80
- children: r
81
- }), o ? /* @__PURE__ */ e("span", {
82
- className: "text-pho-description block",
83
- children: o
84
- }) : null] });
85
- }
86
- function O({ className: r, title: o, description: s, icon: i, disabled: a, indeterminate: d, ...l }) {
87
- const { motionProps: c } = b({
88
- scale: x,
89
- disabled: !!a,
90
- transition: k
91
- }), n = i != null;
92
- return /* @__PURE__ */ p(u.label, {
93
- ...c,
94
- className: t(v, n && "flex-col gap-1.5", r),
95
- "data-disabled": a ? "" : void 0,
96
- children: [
97
- /* @__PURE__ */ e(h.Root, {
98
- disabled: a,
99
- indeterminate: d,
100
- className: n ? "sr-only" : t("bg-pho-primary ring-pho-primary text-pho-on-brand mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-sm ring-1 ring-inset", "group-hover:bg-pho-primary-hover group-hover:ring-pho-ink transition-[background-color,box-shadow,color] duration-150 ease-out", "data-[checked]:bg-pho-brand-solid data-[checked]:group-hover:bg-pho-brand-solid-hover data-[checked]:ring-transparent", "data-[indeterminate]:bg-pho-brand-solid data-[indeterminate]:group-hover:bg-pho-brand-solid-hover data-[indeterminate]:ring-transparent"),
101
- ...l,
102
- children: n ? null : /* @__PURE__ */ e(h.Indicator, {
103
- className: t("flex items-center justify-center transition-opacity duration-100 ease-out", "data-[ending-style]:opacity-0"),
104
- children: /* @__PURE__ */ e(g, {
105
- indeterminate: d,
106
- className: "size-2.5"
107
- })
108
- })
109
- }),
110
- n ? /* @__PURE__ */ e("span", {
111
- "aria-hidden": !0,
112
- className: "text-pho-secondary flex size-6 shrink-0 items-center justify-center [&>svg]:size-6",
113
- children: i
114
- }) : null,
115
- /* @__PURE__ */ e(R, {
116
- title: o,
117
- description: s
118
- })
119
- ]
120
- });
121
- }
122
- O.displayName = "CheckboxCard";
2
+ import { n as e, r, t as a } from "../chunks/checkbox-Cdm08HWG.js";
123
3
  export {
124
- A as Checkbox,
125
- O as CheckboxCard,
126
- P as CheckboxGroup
4
+ r as Checkbox,
5
+ a as CheckboxCard,
6
+ e as CheckboxGroup
127
7
  };
128
-
129
- //# sourceMappingURL=checkbox.js.map