@brett_lamy/ui 4.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/animated-height.d.ts +3 -1
- package/dist/components/animated-height.d.ts.map +1 -1
- package/dist/components/animated-height.js +11 -11
- package/dist/components/artifact-chat-container.d.ts.map +1 -1
- package/dist/components/artifact-chat-container.js +81 -82
- package/dist/components/button.d.ts +4 -3
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +22 -9
- package/dist/components/calendar.d.ts +26 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +97 -0
- package/dist/components/canvas.d.ts +91 -0
- package/dist/components/canvas.d.ts.map +1 -0
- package/dist/components/canvas.js +296 -0
- package/dist/components/color-field.d.ts +22 -0
- package/dist/components/color-field.d.ts.map +1 -0
- package/dist/components/color-field.js +60 -0
- package/dist/components/color-picker.d.ts +49 -0
- package/dist/components/color-picker.d.ts.map +1 -0
- package/dist/components/color-picker.js +121 -0
- package/dist/components/composer/composer-cards.d.ts +55 -0
- package/dist/components/composer/composer-cards.d.ts.map +1 -0
- package/dist/components/composer/composer-cards.js +351 -0
- package/dist/components/composer/composer.d.ts +9 -1
- package/dist/components/composer/composer.d.ts.map +1 -1
- package/dist/components/composer/composer.js +179 -154
- package/dist/components/context-menu.d.ts +25 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +127 -0
- package/dist/components/credenza.d.ts.map +1 -1
- package/dist/components/credenza.js +52 -92
- package/dist/components/cron-editor.d.ts +47 -0
- package/dist/components/cron-editor.d.ts.map +1 -0
- package/dist/components/cron-editor.js +297 -0
- package/dist/components/date-field.d.ts +19 -0
- package/dist/components/date-field.d.ts.map +1 -0
- package/dist/components/date-field.js +79 -0
- package/dist/components/date-picker.d.ts +38 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +110 -0
- package/dist/components/dropdown-menu.d.ts +3 -1
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +5 -5
- package/dist/components/edge-drawer.d.ts.map +1 -1
- package/dist/components/edge-drawer.js +1 -0
- package/dist/components/file-upload.d.ts +121 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +405 -0
- package/dist/components/filter-input.d.ts +22 -0
- package/dist/components/filter-input.d.ts.map +1 -0
- package/dist/components/filter-input.js +126 -0
- package/dist/components/filter.d.ts +154 -0
- package/dist/components/filter.d.ts.map +1 -0
- package/dist/components/filter.js +815 -0
- package/dist/components/floating-chat.d.ts.map +1 -1
- package/dist/components/floating-chat.js +71 -88
- package/dist/components/floating-sheet.d.ts.map +1 -1
- package/dist/components/floating-sheet.js +93 -104
- package/dist/components/markdown-editor.d.ts +2 -0
- package/dist/components/markdown-editor.d.ts.map +1 -1
- package/dist/components/markdown-editor.js +46 -45
- package/dist/components/markdown-view.d.ts +6 -1
- package/dist/components/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view.js +13 -11
- package/dist/components/navigation-stack.d.ts +3 -5
- package/dist/components/navigation-stack.d.ts.map +1 -1
- package/dist/components/navigation-stack.js +212 -382
- package/dist/components/passkey-enroll-dialog.d.ts +36 -0
- package/dist/components/passkey-enroll-dialog.d.ts.map +1 -0
- package/dist/components/passkey-enroll-dialog.js +234 -0
- package/dist/components/result-table.d.ts +38 -0
- package/dist/components/result-table.d.ts.map +1 -0
- package/dist/components/result-table.js +161 -0
- package/dist/components/schema-tree.d.ts +19 -0
- package/dist/components/schema-tree.d.ts.map +1 -0
- package/dist/components/schema-tree.js +172 -0
- package/dist/components/side-drawer.d.ts.map +1 -1
- package/dist/components/side-drawer.js +117 -143
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +4 -1
- package/dist/components/spinner-shapes.d.ts +299 -0
- package/dist/components/spinner-shapes.d.ts.map +1 -0
- package/dist/components/spinner-shapes.js +876 -0
- package/dist/components/spinner.d.ts +133 -3
- package/dist/components/spinner.d.ts.map +1 -1
- package/dist/components/spinner.js +445 -29
- package/dist/components/sql-console.d.ts +28 -0
- package/dist/components/sql-console.d.ts.map +1 -0
- package/dist/components/sql-console.js +348 -0
- package/dist/components/sql-editor.d.ts +47 -0
- package/dist/components/sql-editor.d.ts.map +1 -0
- package/dist/components/sql-editor.js +170 -0
- package/dist/components/tab-view.d.ts +2 -2
- package/dist/components/tab-view.d.ts.map +1 -1
- package/dist/components/tab-view.js +63 -49
- package/dist/components/tailscale-login-button.d.ts +53 -0
- package/dist/components/tailscale-login-button.d.ts.map +1 -0
- package/dist/components/tailscale-login-button.js +197 -0
- package/dist/components/time-input.d.ts +46 -0
- package/dist/components/time-input.d.ts.map +1 -0
- package/dist/components/time-input.js +258 -0
- package/dist/components/toast.d.ts +5 -2
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +249 -125
- package/dist/components/vault-gate.d.ts +60 -0
- package/dist/components/vault-gate.d.ts.map +1 -0
- package/dist/components/vault-gate.js +382 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +90 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +134 -83
- package/dist/lib/back-history.d.ts +5 -0
- package/dist/lib/back-history.d.ts.map +1 -0
- package/dist/lib/back-history.js +44 -0
- package/dist/lib/canvas-math.d.ts +82 -0
- package/dist/lib/canvas-math.d.ts.map +1 -0
- package/dist/lib/canvas-math.js +226 -0
- package/dist/lib/controllable-state.d.ts +4 -0
- package/dist/lib/controllable-state.d.ts.map +1 -0
- package/dist/lib/controllable-state.js +11 -0
- package/dist/lib/cron.d.ts +55 -0
- package/dist/lib/cron.d.ts.map +1 -0
- package/dist/lib/cron.js +269 -0
- package/dist/lib/edge-swipe.d.ts +36 -0
- package/dist/lib/edge-swipe.d.ts.map +1 -0
- package/dist/lib/edge-swipe.js +73 -0
- package/dist/lib/file-upload.d.ts +187 -0
- package/dist/lib/file-upload.d.ts.map +1 -0
- package/dist/lib/file-upload.js +349 -0
- package/dist/lib/filter-query.d.ts +90 -0
- package/dist/lib/filter-query.d.ts.map +1 -0
- package/dist/lib/filter-query.js +459 -0
- package/dist/lib/filter.d.ts +120 -0
- package/dist/lib/filter.d.ts.map +1 -0
- package/dist/lib/filter.js +399 -0
- package/dist/lib/format-bytes.d.ts +3 -0
- package/dist/lib/format-bytes.d.ts.map +1 -0
- package/dist/lib/format-bytes.js +16 -0
- package/dist/lib/gpu-cron.d.ts +51 -0
- package/dist/lib/gpu-cron.d.ts.map +1 -0
- package/dist/lib/gpu-cron.js +81 -0
- package/dist/lib/gpu-query/featurize.d.ts +19 -0
- package/dist/lib/gpu-query/featurize.d.ts.map +1 -0
- package/dist/lib/gpu-query/featurize.js +88 -0
- package/dist/lib/gpu-query/index.d.ts +73 -0
- package/dist/lib/gpu-query/index.d.ts.map +1 -0
- package/dist/lib/gpu-query/index.js +117 -0
- package/dist/lib/gpu-query/kernel.wgsl.d.ts +30 -0
- package/dist/lib/gpu-query/kernel.wgsl.d.ts.map +1 -0
- package/dist/lib/gpu-query/model.d.ts +8 -0
- package/dist/lib/gpu-query/model.d.ts.map +1 -0
- package/dist/lib/gpu-query/model.js +91 -0
- package/dist/lib/gpu-query/schema.d.ts +40 -0
- package/dist/lib/gpu-query/schema.d.ts.map +1 -0
- package/dist/lib/gpu-query/schema.js +0 -0
- package/dist/lib/gpu-query/webgpu.d.ts +12 -0
- package/dist/lib/gpu-query/webgpu.d.ts.map +1 -0
- package/dist/lib/gpu-query/weights.d.ts +17 -0
- package/dist/lib/gpu-query/weights.d.ts.map +1 -0
- package/dist/lib/gpu-query/weights.js +40 -0
- package/dist/lib/gpu-query/weights.json.d.ts +3 -0
- package/dist/lib/gpu-query/weights2.js +25 -0
- package/dist/lib/gpu-time.d.ts +77 -0
- package/dist/lib/gpu-time.d.ts.map +1 -0
- package/dist/lib/gpu-time.js +260 -0
- package/dist/lib/morph-path.d.ts +22 -0
- package/dist/lib/morph-path.d.ts.map +1 -0
- package/dist/lib/morph-path.js +42 -0
- package/dist/lib/passkey.d.ts +120 -0
- package/dist/lib/passkey.d.ts.map +1 -0
- package/dist/lib/passkey.js +186 -0
- package/dist/lib/persistent-state.d.ts +9 -0
- package/dist/lib/persistent-state.d.ts.map +1 -0
- package/dist/lib/persistent-state.js +37 -0
- package/dist/lib/pglite-core.d.ts +219 -0
- package/dist/lib/pglite-core.d.ts.map +1 -0
- package/dist/lib/pglite-core.js +273 -0
- package/dist/lib/pglite-files.d.ts +7 -0
- package/dist/lib/pglite-files.d.ts.map +1 -0
- package/dist/lib/pglite-files.js +17 -0
- package/dist/lib/pglite-schema.d.ts +58 -0
- package/dist/lib/pglite-schema.d.ts.map +1 -0
- package/dist/lib/pglite-schema.js +105 -0
- package/dist/lib/pglite-storage.d.ts +33 -0
- package/dist/lib/pglite-storage.d.ts.map +1 -0
- package/dist/lib/pglite-storage.js +55 -0
- package/dist/lib/pglite-transfer.d.ts +53 -0
- package/dist/lib/pglite-transfer.d.ts.map +1 -0
- package/dist/lib/pglite-transfer.js +126 -0
- package/dist/lib/pglite.d.ts +106 -0
- package/dist/lib/pglite.d.ts.map +1 -0
- package/dist/lib/pglite.js +298 -0
- package/dist/lib/pull-to-refresh.d.ts +24 -0
- package/dist/lib/pull-to-refresh.d.ts.map +1 -0
- package/dist/lib/pull-to-refresh.js +74 -0
- package/dist/lib/scroll-hidden.d.ts +6 -0
- package/dist/lib/scroll-hidden.d.ts.map +1 -0
- package/dist/lib/scroll-hidden.js +21 -0
- package/dist/lib/sql-format.d.ts +62 -0
- package/dist/lib/sql-format.d.ts.map +1 -0
- package/dist/lib/sql-format.js +175 -0
- package/dist/lib/sql-lex.d.ts +25 -0
- package/dist/lib/sql-lex.d.ts.map +1 -0
- package/dist/lib/sql-lex.js +135 -0
- package/dist/lib/tab-lock.d.ts +28 -0
- package/dist/lib/tab-lock.d.ts.map +1 -0
- package/dist/lib/tab-lock.js +80 -0
- package/dist/lib/tailscale-connect.d.ts +56 -0
- package/dist/lib/tailscale-connect.d.ts.map +1 -0
- package/dist/lib/tailscale-connect.js +99 -0
- package/dist/lib/tailscale-fake.d.ts +33 -0
- package/dist/lib/tailscale-fake.d.ts.map +1 -0
- package/dist/lib/tailscale-fake.js +80 -0
- package/dist/lib/tailscale-policy.d.ts +71 -0
- package/dist/lib/tailscale-policy.d.ts.map +1 -0
- package/dist/lib/tailscale-policy.js +244 -0
- package/dist/lib/tailscale-react.d.ts +20 -0
- package/dist/lib/tailscale-react.d.ts.map +1 -0
- package/dist/lib/tailscale-react.js +37 -0
- package/dist/lib/tailscale-router/bridge.d.ts +60 -0
- package/dist/lib/tailscale-router/bridge.d.ts.map +1 -0
- package/dist/lib/tailscale-router/bridge.js +198 -0
- package/dist/lib/tailscale-router/react.d.ts +19 -0
- package/dist/lib/tailscale-router/react.d.ts.map +1 -0
- package/dist/lib/tailscale-router/react.js +52 -0
- package/dist/lib/tailscale.d.ts +204 -0
- package/dist/lib/tailscale.d.ts.map +1 -0
- package/dist/lib/tailscale.js +443 -0
- package/dist/lib/title-flight.d.ts +34 -0
- package/dist/lib/title-flight.d.ts.map +1 -0
- package/dist/lib/title-flight.js +123 -0
- package/dist/lib/vault-react.d.ts +49 -0
- package/dist/lib/vault-react.d.ts.map +1 -0
- package/dist/lib/vault-react.js +196 -0
- package/dist/lib/vault-storage.d.ts +30 -0
- package/dist/lib/vault-storage.d.ts.map +1 -0
- package/dist/lib/vault-storage.js +105 -0
- package/dist/lib/vault.d.ts +200 -0
- package/dist/lib/vault.d.ts.map +1 -0
- package/dist/lib/vault.js +641 -0
- package/dist/tailscale-sw.js +332 -0
- package/package.json +35 -4
- package/dist/components/icon-button.d.ts +0 -19
- package/dist/components/icon-button.d.ts.map +0 -1
- package/dist/components/icon-button.js +0 -31
- package/dist/components/measure-h.d.ts +0 -7
- package/dist/components/measure-h.d.ts.map +0 -1
- package/dist/components/measure-h.js +0 -20
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ export function App() {
|
|
|
34
34
|
|
|
35
35
|
The package is ESM with one output module per source module (`sideEffects` is limited to CSS), so bundlers drop what you don't import; component modules start with `'use client'` for Next.js.
|
|
36
36
|
|
|
37
|
-
React
|
|
37
|
+
React 19 is required (the components use `use(Context)`, `<Context value>` and `ref` as a prop).
|
|
38
38
|
|
|
39
39
|
## IndexBar
|
|
40
40
|
|
|
@@ -15,9 +15,11 @@ export interface ContentSwapProps {
|
|
|
15
15
|
direction?: -1 | 0 | 1;
|
|
16
16
|
/** Travel distance in px for a directional swap. */
|
|
17
17
|
distance?: number;
|
|
18
|
+
/** Blur in px at the middle of the swap. */
|
|
19
|
+
blur?: number;
|
|
18
20
|
children?: ReactNode;
|
|
19
21
|
className?: string;
|
|
20
22
|
style?: CSSProperties;
|
|
21
23
|
}
|
|
22
|
-
export declare function ContentSwap({ id, direction, distance, children, className, style }: ContentSwapProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function ContentSwap({ id, direction, distance, blur, children, className, style }: ContentSwapProps): import("react/jsx-runtime").JSX.Element;
|
|
23
25
|
//# sourceMappingURL=animated-height.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animated-height.d.ts","sourceRoot":"","sources":["../../src/components/animated-height.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqC,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAS/D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qDAAqD;IACrD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAe,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAoBlG;AAED,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,0GAA0G;IAC1G,SAAS,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE,SAAa,EAAE,QAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"animated-height.d.ts","sourceRoot":"","sources":["../../src/components/animated-height.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqC,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAS/D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qDAAqD;IACrD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAe,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAoBlG;AAED,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,0GAA0G;IAC1G,SAAS,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE,SAAa,EAAE,QAAa,EAAE,IAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,gBAAgB,2CA0BvH"}
|
|
@@ -28,20 +28,20 @@ function u({ children: t, spring: r = "tray", className: u, style: d }) {
|
|
|
28
28
|
})
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
function d({ id: o, direction: s = 0, distance: c = 36,
|
|
32
|
-
let
|
|
31
|
+
function d({ id: o, direction: s = 0, distance: c = 36, blur: u = 4, children: d, className: f, style: p }) {
|
|
32
|
+
let m = a(), h = (e, t) => m ? { opacity: 0 } : e ? {
|
|
33
33
|
opacity: 0,
|
|
34
34
|
x: t * e * c,
|
|
35
|
-
filter:
|
|
35
|
+
filter: `blur(${u}px)`
|
|
36
36
|
} : {
|
|
37
37
|
opacity: 0,
|
|
38
38
|
scale: .96,
|
|
39
|
-
filter:
|
|
39
|
+
filter: `blur(${u}px)`
|
|
40
40
|
};
|
|
41
41
|
return /* @__PURE__ */ l("div", {
|
|
42
42
|
"data-slot": "content-swap",
|
|
43
|
-
className: e("relative",
|
|
44
|
-
style:
|
|
43
|
+
className: e("relative", f),
|
|
44
|
+
style: p,
|
|
45
45
|
children: /* @__PURE__ */ l(r, {
|
|
46
46
|
initial: !1,
|
|
47
47
|
mode: "popLayout",
|
|
@@ -49,7 +49,7 @@ function d({ id: o, direction: s = 0, distance: c = 36, children: u, className:
|
|
|
49
49
|
children: /* @__PURE__ */ l(i.div, {
|
|
50
50
|
custom: s,
|
|
51
51
|
variants: {
|
|
52
|
-
enter: (e) =>
|
|
52
|
+
enter: (e) => h(e, 1),
|
|
53
53
|
center: {
|
|
54
54
|
opacity: 1,
|
|
55
55
|
x: 0,
|
|
@@ -57,8 +57,8 @@ function d({ id: o, direction: s = 0, distance: c = 36, children: u, className:
|
|
|
57
57
|
filter: "blur(0px)"
|
|
58
58
|
},
|
|
59
59
|
exit: (e) => ({
|
|
60
|
-
...
|
|
61
|
-
transition:
|
|
60
|
+
...h(e, -1),
|
|
61
|
+
transition: m ? { duration: .1 } : {
|
|
62
62
|
...t.out,
|
|
63
63
|
x: n.smooth
|
|
64
64
|
}
|
|
@@ -67,13 +67,13 @@ function d({ id: o, direction: s = 0, distance: c = 36, children: u, className:
|
|
|
67
67
|
initial: "enter",
|
|
68
68
|
animate: "center",
|
|
69
69
|
exit: "exit",
|
|
70
|
-
transition:
|
|
70
|
+
transition: m ? { duration: .12 } : {
|
|
71
71
|
x: n.smooth,
|
|
72
72
|
scale: n.smooth,
|
|
73
73
|
default: t.in
|
|
74
74
|
},
|
|
75
75
|
className: "w-full",
|
|
76
|
-
children:
|
|
76
|
+
children: d
|
|
77
77
|
}, o)
|
|
78
78
|
})
|
|
79
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-chat-container.d.ts","sourceRoot":"","sources":["../../src/components/artifact-chat-container.tsx"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"artifact-chat-container.d.ts","sourceRoot":"","sources":["../../src/components/artifact-chat-container.tsx"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,EAAiC,KAAK,uBAAuB,EAAE,KAAK,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAKpI,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,UAAU,CAAC;AAEtD,MAAM,WAAW,iCAAiC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,MAAM,EAAE,kBAAkB,CAAC;IAC3B,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAID,wBAAgB,wBAAwB,IAAI,iCAAiC,CAM5E;AAED,MAAM,MAAM,iCAAiC,GAAG,SAAS,CAAC;AAK1D;kDACkD;AAClD,eAAO,MAAM,6BAA6B;;;8EAgBzC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAE9D,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;IACrC,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,gHAAgH;IAChH,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,4GAA4G;IAC5G,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,iGAAiG;IACjG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,UAAU,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC7C;;;OAGG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAID,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EAAE,eAAwB,EAChC,UAAgB,EAChB,SAAe,EACf,QAAiB,EACjB,QAAQ,EAAE,kBAAkB,EAC5B,eAAuB,EACvB,gBAAgB,EAChB,OAAe,EACf,YAAyB,EACzB,KAAK,EACL,YAAmB,EACnB,WAA6B,EAC7B,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,IAAQ,EACR,UAAU,EACV,IAAI,EAAE,QAAQ,EACd,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,0BAA0B,2CAsL5B;yBA5Me,qBAAqB"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../lib/utils.js";
|
|
3
3
|
import { springs as t } from "../lib/motion.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
4
|
+
import { collectSlots as n, defineSlot as r, useContainerWidth as i } from "../lib/container.js";
|
|
5
|
+
import { useAppearance as a } from "../lib/theme.js";
|
|
6
|
+
import { useControllableState as ee } from "../lib/controllable-state.js";
|
|
7
|
+
import { sheetToneProps as te } from "./floating-sheet.js";
|
|
8
|
+
import { ChatHostContext as ne, ComposerPortal as re, createOutletStore as ie, useAttachHost as o, usePersistentHost as s } from "../lib/persistent-host.js";
|
|
9
|
+
import { FloatingChat as ae, glassScopeProps as oe } from "./floating-chat.js";
|
|
10
|
+
import { ChatColumn as se, ChatColumnComposer as c, ChatColumnTranscript as ce } from "./chat-column.js";
|
|
11
|
+
import { AnimatePresence as le, animate as l, motion as ue } from "framer-motion";
|
|
12
|
+
import { createContext as u, useContext as d, useEffect as f, useLayoutEffect as de, useMemo as p, useRef as m, useState as h } from "react";
|
|
13
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
+
import { cva as v } from "class-variance-authority";
|
|
15
|
+
import { createPortal as fe } from "react-dom";
|
|
15
16
|
//#region src/components/artifact-chat-container.tsx
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
let e =
|
|
17
|
+
var y = u(null);
|
|
18
|
+
function b() {
|
|
19
|
+
let e = d(y);
|
|
19
20
|
if (!e) throw Error("useArtifactChatContainer must be used within <ArtifactChatContainer>");
|
|
20
21
|
return e;
|
|
21
22
|
}
|
|
22
|
-
var
|
|
23
|
+
var pe = "ck-artifact-chat__content min-h-0 min-w-0 overflow-auto bg-background", x = v("ck-artifact-chat relative isolate h-full w-full min-h-0 min-w-0 overflow-hidden bg-background text-foreground [font-family:var(--bl-font,-apple-system,BlinkMacSystemFont,\"SF_Pro_Text\",sans-serif)]", {
|
|
23
24
|
variants: {
|
|
24
25
|
layout: {
|
|
25
26
|
split: "grid",
|
|
@@ -44,38 +45,36 @@ var de = "ck-artifact-chat__content min-h-0 min-w-0 overflow-auto bg-background"
|
|
|
44
45
|
chatSide: "left"
|
|
45
46
|
}
|
|
46
47
|
});
|
|
47
|
-
function
|
|
48
|
-
let [k, A] =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, [w]);
|
|
54
|
-
let W = r(E), G = s("artifact-chat-composer"), K = s("artifact-chat-transcript"), q = m(re, []), [J, Y] = g(null), [we, X] = g(null), Te = m(() => ({
|
|
48
|
+
function S({ layout: r = "auto", breakpoint: u = 760, chatWidth: d = 400, chatSide: v = "left", chatOpen: b, defaultChatOpen: S = !1, onChatOpenChange: me, working: C = !1, workingLabel: he = "Working…", onAdd: ge, hideOnScroll: _e = !0, fabPosition: ve = "bottom-center", minimized: ye, defaultMinimized: be, onMinimizedChange: xe, peek: Se = 0, appearance: w, tone: T, children: E, className: D, style: O }) {
|
|
49
|
+
let [k, A] = i(), j = a(), M = T ?? j ?? "auto", N = te(M), P = oe(M), F = m(null), [I, L] = ee(b, S, me), [R, z] = h(!C), B = r === "auto" ? A < u ? "floating" : "split" : r, V = B === "floating", H = v === "right", U = H ? 1 : -1;
|
|
50
|
+
f(() => {
|
|
51
|
+
z(!C);
|
|
52
|
+
}, [C]);
|
|
53
|
+
let W = n(E), G = s("artifact-chat-composer"), K = s("artifact-chat-transcript"), q = p(ie, []), [J, Y] = h(null), [Ce, X] = h(null), we = p(() => ({
|
|
55
54
|
outlet: q,
|
|
56
55
|
composerDock: Y,
|
|
57
56
|
chatDock: X
|
|
58
57
|
}), [q]);
|
|
59
|
-
o(G, J), o(K,
|
|
60
|
-
let Z =
|
|
61
|
-
if ($.current !==
|
|
58
|
+
o(G, J), o(K, Ce);
|
|
59
|
+
let Z = m(null), Q = m(null), $ = m(V), [Te, Ee] = h(!1);
|
|
60
|
+
if ($.current !== V && !Q.current && typeof window < "u") {
|
|
62
61
|
let e = G?.querySelector("[data-slot=\"composer\"]");
|
|
63
62
|
Q.current = {
|
|
64
|
-
layout:
|
|
63
|
+
layout: V,
|
|
65
64
|
composer: e?.isConnected ? e.getBoundingClientRect() : null,
|
|
66
65
|
content: Z.current?.getBoundingClientRect() ?? null
|
|
67
66
|
};
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
$.current !==
|
|
68
|
+
de(() => {
|
|
69
|
+
$.current !== V && Ee(!0), $.current = V;
|
|
71
70
|
let e = Q.current;
|
|
72
|
-
if (!e || e.layout !==
|
|
71
|
+
if (!e || e.layout !== V || !J?.isConnected || G?.parentNode !== J || (Q.current = null, typeof matchMedia < "u" && matchMedia("(prefers-reduced-motion: reduce)").matches)) return;
|
|
73
72
|
let n = G?.querySelector("[data-slot=\"composer\"]");
|
|
74
73
|
if (e.composer && n) {
|
|
75
74
|
let r = n.getBoundingClientRect(), i = e.composer;
|
|
76
75
|
n.style.width = `${i.width}px`;
|
|
77
76
|
let a = n.getBoundingClientRect();
|
|
78
|
-
|
|
77
|
+
l(n, {
|
|
79
78
|
x: [i.left - a.left, 0],
|
|
80
79
|
y: [i.top - a.top, 0],
|
|
81
80
|
width: [i.width, r.width]
|
|
@@ -89,47 +88,47 @@ function C({ layout: i = "auto", breakpoint: d = 760, chatWidth: f = 400, chatSi
|
|
|
89
88
|
let r = Z.current;
|
|
90
89
|
if (e.content && r) {
|
|
91
90
|
let n = r.getBoundingClientRect(), i = e.content, a = `inset(${Math.max(0, i.top - n.top)}px ${Math.max(0, n.right - i.right)}px ${Math.max(0, n.bottom - i.bottom)}px ${Math.max(0, i.left - n.left)}px)`;
|
|
92
|
-
a !== "inset(0px 0px 0px 0px)" &&
|
|
91
|
+
a !== "inset(0px 0px 0px 0px)" && l(r, { clipPath: [a, "inset(0px 0px 0px 0px)"] }, {
|
|
93
92
|
...t.smooth,
|
|
94
93
|
onComplete: () => r.style.clipPath = ""
|
|
95
94
|
});
|
|
96
95
|
}
|
|
97
|
-
}, [
|
|
98
|
-
let
|
|
96
|
+
}, [V, J]);
|
|
97
|
+
let De = {
|
|
99
98
|
width: A,
|
|
100
|
-
layout:
|
|
101
|
-
compact:
|
|
102
|
-
chatOpen:
|
|
103
|
-
setChatOpen:
|
|
104
|
-
composing:
|
|
105
|
-
setComposing:
|
|
99
|
+
layout: B,
|
|
100
|
+
compact: V,
|
|
101
|
+
chatOpen: I,
|
|
102
|
+
setChatOpen: L,
|
|
103
|
+
composing: R,
|
|
104
|
+
setComposing: z
|
|
106
105
|
};
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
value:
|
|
109
|
-
children: /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ g(y.Provider, {
|
|
107
|
+
value: De,
|
|
108
|
+
children: /* @__PURE__ */ _("div", {
|
|
110
109
|
ref: k,
|
|
111
110
|
"data-slot": "artifact-chat-container",
|
|
112
|
-
"data-layout":
|
|
111
|
+
"data-layout": V ? "compact" : "split",
|
|
113
112
|
"data-tone": M === "auto" ? void 0 : M,
|
|
114
113
|
"data-theme-scope": N["data-theme-scope"],
|
|
115
|
-
"data-chat-side":
|
|
116
|
-
className: e(
|
|
117
|
-
layout:
|
|
118
|
-
chatSide:
|
|
114
|
+
"data-chat-side": v,
|
|
115
|
+
className: e(x({
|
|
116
|
+
layout: B,
|
|
117
|
+
chatSide: v
|
|
119
118
|
}), N.className, D),
|
|
120
119
|
style: {
|
|
121
|
-
"--ck-artifact-chat-width": typeof
|
|
120
|
+
"--ck-artifact-chat-width": typeof d == "number" ? `${d}px` : d,
|
|
122
121
|
...O
|
|
123
122
|
},
|
|
124
123
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ g(le, {
|
|
126
125
|
mode: "popLayout",
|
|
127
126
|
initial: !1,
|
|
128
|
-
children:
|
|
127
|
+
children: V ? null : /* @__PURE__ */ g(ue.div, {
|
|
129
128
|
"data-slot": "artifact-chat-column",
|
|
130
|
-
className: e("z-2 flex min-h-0 min-w-0",
|
|
131
|
-
initial:
|
|
132
|
-
x: 32 *
|
|
129
|
+
className: e("z-2 flex min-h-0 min-w-0", H && "col-start-2 row-start-1"),
|
|
130
|
+
initial: Te ? {
|
|
131
|
+
x: 32 * U,
|
|
133
132
|
opacity: 0
|
|
134
133
|
} : !1,
|
|
135
134
|
animate: {
|
|
@@ -137,17 +136,17 @@ function C({ layout: i = "auto", breakpoint: d = 760, chatWidth: f = 400, chatSi
|
|
|
137
136
|
opacity: 1
|
|
138
137
|
},
|
|
139
138
|
exit: {
|
|
140
|
-
x: 48 *
|
|
139
|
+
x: 48 * U,
|
|
141
140
|
opacity: 0
|
|
142
141
|
},
|
|
143
142
|
transition: t.smooth,
|
|
144
|
-
children: /* @__PURE__ */
|
|
145
|
-
className: e("flex-1",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ _(se, {
|
|
144
|
+
className: e("flex-1", H && "border-r-0 border-l"),
|
|
145
|
+
children: [/* @__PURE__ */ g(ce, { children: /* @__PURE__ */ g("div", {
|
|
147
146
|
ref: X,
|
|
148
147
|
"data-slot": "artifact-chat-transcript-dock",
|
|
149
148
|
className: "flex h-full min-h-0 min-w-0 flex-col"
|
|
150
|
-
}) }), /* @__PURE__ */
|
|
149
|
+
}) }), /* @__PURE__ */ g(c, { children: /* @__PURE__ */ g("div", {
|
|
151
150
|
ref: Y,
|
|
152
151
|
"data-slot": "artifact-chat-composer-dock",
|
|
153
152
|
"data-theme-scope": P["data-theme-scope"],
|
|
@@ -156,45 +155,45 @@ function C({ layout: i = "auto", breakpoint: d = 760, chatWidth: f = 400, chatSi
|
|
|
156
155
|
})
|
|
157
156
|
}, "column")
|
|
158
157
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ g("main", {
|
|
160
159
|
ref: (e) => {
|
|
161
160
|
F.current = e, Z.current = e;
|
|
162
161
|
},
|
|
163
162
|
"data-slot": "artifact-chat-content",
|
|
164
|
-
className: e(
|
|
163
|
+
className: e(pe, V ? "absolute inset-0 pb-0" : e("relative", H && "col-start-1 row-start-1")),
|
|
165
164
|
children: W.content
|
|
166
165
|
}),
|
|
167
|
-
|
|
168
|
-
value:
|
|
169
|
-
children: /* @__PURE__ */
|
|
170
|
-
open:
|
|
171
|
-
onOpenChange:
|
|
172
|
-
working:
|
|
173
|
-
workingLabel:
|
|
174
|
-
onAdd:
|
|
175
|
-
composing:
|
|
176
|
-
onComposingChange:
|
|
177
|
-
hideOnScroll:
|
|
166
|
+
V ? /* @__PURE__ */ g(ne.Provider, {
|
|
167
|
+
value: we,
|
|
168
|
+
children: /* @__PURE__ */ g(ae, {
|
|
169
|
+
open: I,
|
|
170
|
+
onOpenChange: L,
|
|
171
|
+
working: C,
|
|
172
|
+
workingLabel: he,
|
|
173
|
+
onAdd: ge,
|
|
174
|
+
composing: R,
|
|
175
|
+
onComposingChange: z,
|
|
176
|
+
hideOnScroll: _e,
|
|
178
177
|
scrollRef: F,
|
|
179
|
-
fabPosition:
|
|
180
|
-
minimized:
|
|
181
|
-
defaultMinimized:
|
|
182
|
-
onMinimizedChange:
|
|
183
|
-
peek:
|
|
184
|
-
appearance:
|
|
178
|
+
fabPosition: ve,
|
|
179
|
+
minimized: ye,
|
|
180
|
+
defaultMinimized: be,
|
|
181
|
+
onMinimizedChange: xe,
|
|
182
|
+
peek: Se,
|
|
183
|
+
appearance: w,
|
|
185
184
|
tone: M
|
|
186
185
|
})
|
|
187
186
|
}) : null,
|
|
188
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ g(re, {
|
|
189
188
|
store: q,
|
|
190
189
|
host: G,
|
|
191
190
|
children: W.composer
|
|
192
191
|
}),
|
|
193
|
-
K ?
|
|
192
|
+
K ? fe(W.chat, K) : null
|
|
194
193
|
]
|
|
195
194
|
})
|
|
196
195
|
});
|
|
197
196
|
}
|
|
198
|
-
|
|
197
|
+
S.Chat = r("chat"), S.Composer = r("composer"), S.Content = r("content"), S.Context = y, S.useContainer = b;
|
|
199
198
|
//#endregion
|
|
200
|
-
export {
|
|
199
|
+
export { S as ArtifactChatContainer, x as artifactChatContainerVariants, b as useArtifactChatContainer };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
export declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "secondary" | "destructive" | "link" | "default" | "ghost" | null | undefined;
|
|
5
|
-
size?: "default" | "icon" | "sm" | "lg" | "pill" | null | undefined;
|
|
4
|
+
variant?: "secondary" | "destructive" | "link" | "default" | "ghost" | "quiet" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "sm" | "lg" | "pill" | "icon-sm" | null | undefined;
|
|
6
|
+
active?: boolean | null | undefined;
|
|
6
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
8
|
export interface ButtonProps extends Omit<AriaButtonProps, 'render'>, VariantProps<typeof buttonVariants> {
|
|
8
9
|
/** Tooltip — react-aria's Button drops `title`, so it is rendered onto the <button> here. */
|
|
9
10
|
title?: string;
|
|
10
11
|
}
|
|
11
|
-
export declare function Button({ className, variant, size, title, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function Button({ className, variant, size, active, title, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAwB,KAAK,WAAW,IAAI,eAAe,EAAsB,MAAM,uBAAuB,CAAC;AACtH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAUlE,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAwB,KAAK,WAAW,IAAI,eAAe,EAAsB,MAAM,uBAAuB,CAAC;AACtH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAUlE,eAAO,MAAM,cAAc;;;;8EA6B1B,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC;IACvG,6FAA6F;IAC7F,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAUlG"}
|
|
@@ -12,33 +12,46 @@ var o = a("bl-btn box-border inline-flex cursor-pointer items-center justify-cen
|
|
|
12
12
|
secondary: "bg-secondary text-secondary-foreground",
|
|
13
13
|
ghost: "bg-transparent text-foreground data-hovered:bg-accent",
|
|
14
14
|
destructive: "bg-destructive text-white",
|
|
15
|
-
link: "bg-transparent p-0 text-primary"
|
|
15
|
+
link: "bg-transparent p-0 text-primary",
|
|
16
|
+
quiet: "bg-transparent text-muted-foreground data-hovered:bg-secondary"
|
|
16
17
|
},
|
|
17
18
|
size: {
|
|
18
19
|
default: "h-9 rounded-ctl px-4 text-subhead font-semibold",
|
|
19
20
|
sm: "h-8 rounded-lg px-3 text-footnote font-semibold",
|
|
20
21
|
lg: "h-11 rounded-xl px-5 text-callout font-semibold",
|
|
21
22
|
pill: "w-full rounded-card px-3 py-[13px] text-callout font-semibold",
|
|
22
|
-
icon: "size-9 rounded-full p-0"
|
|
23
|
+
icon: "size-9 rounded-full p-0",
|
|
24
|
+
"icon-sm": "grid place-items-center rounded-[7px] p-[5px]"
|
|
25
|
+
},
|
|
26
|
+
active: {
|
|
27
|
+
true: "",
|
|
28
|
+
false: ""
|
|
23
29
|
}
|
|
24
30
|
},
|
|
31
|
+
compoundVariants: [{
|
|
32
|
+
variant: "quiet",
|
|
33
|
+
active: !0,
|
|
34
|
+
class: "bg-secondary text-foreground"
|
|
35
|
+
}],
|
|
25
36
|
defaultVariants: {
|
|
26
37
|
variant: "default",
|
|
27
|
-
size: "default"
|
|
38
|
+
size: "default",
|
|
39
|
+
active: !1
|
|
28
40
|
}
|
|
29
41
|
});
|
|
30
|
-
function s({ className: a, variant: s, size: c,
|
|
42
|
+
function s({ className: a, variant: s, size: c, active: l, title: u, children: d, ...f }) {
|
|
31
43
|
return /* @__PURE__ */ n(r, {
|
|
32
44
|
"data-slot": "button",
|
|
33
45
|
className: i(a, (t) => e(o({
|
|
34
46
|
variant: s,
|
|
35
|
-
size: c
|
|
47
|
+
size: c,
|
|
48
|
+
active: l
|
|
36
49
|
}), t)),
|
|
37
|
-
...
|
|
38
|
-
children: typeof
|
|
39
|
-
...
|
|
50
|
+
...f,
|
|
51
|
+
children: typeof d == "string" ? /* @__PURE__ */ n(t, { children: d }) : d,
|
|
52
|
+
...u ? { render: (e) => /* @__PURE__ */ n("button", {
|
|
40
53
|
...e,
|
|
41
|
-
title:
|
|
54
|
+
title: u
|
|
42
55
|
}) } : {}
|
|
43
56
|
});
|
|
44
57
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { CalendarProps as AriaCalendarProps, CalendarCellProps as AriaCalendarCellProps, CalendarGridProps as AriaCalendarGridProps, RangeCalendarProps as AriaRangeCalendarProps, DateValue } from 'react-aria-components';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
export declare const calendarVariants: (props?: ({
|
|
5
|
+
variant?: "card" | "plain" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
/** Previous / next buttons around the month and year. Must sit inside a Calendar or RangeCalendar. */
|
|
8
|
+
export declare function CalendarHeader({ className, ...props }: ComponentProps<'header'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export interface CalendarCellProps extends Omit<AriaCalendarCellProps, 'children'> {
|
|
10
|
+
}
|
|
11
|
+
/** One day. In a RangeCalendar the days between the ends are joined by a band; today is tinted. */
|
|
12
|
+
export declare function CalendarCell({ className, date, ...props }: CalendarCellProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
/** A month: the weekday row and its days. `offset` shifts it forward by months (for a multi-month calendar). */
|
|
14
|
+
export declare function CalendarGrid({ className, ...props }: Omit<AriaCalendarGridProps, 'children'>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
interface CalendarExtras extends VariantProps<typeof calendarVariants> {
|
|
16
|
+
/** How many months to show side by side. Default: 1. */
|
|
17
|
+
visibleMonths?: 1 | 2 | 3;
|
|
18
|
+
}
|
|
19
|
+
export interface CalendarProps<T extends DateValue> extends AriaCalendarProps<T>, CalendarExtras {
|
|
20
|
+
}
|
|
21
|
+
export declare function Calendar<T extends DateValue>({ className, variant, visibleMonths, children, ...props }: CalendarProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export interface RangeCalendarProps<T extends DateValue> extends AriaRangeCalendarProps<T>, CalendarExtras {
|
|
23
|
+
}
|
|
24
|
+
export declare function RangeCalendar<T extends DateValue>({ className, variant, visibleMonths, children, ...props }: RangeCalendarProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/components/calendar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EACqB,KAAK,aAAa,IAAI,iBAAiB,EAC/B,KAAK,iBAAiB,IAAI,qBAAqB,EAC/C,KAAK,iBAAiB,IAAI,qBAAqB,EAE7C,KAAK,kBAAkB,IAAI,sBAAsB,EAIrF,KAAK,SAAS,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAYlE,eAAO,MAAM,gBAAgB;;8EAS3B,CAAC;AAEH,sGAAsG;AACtG,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAY/E;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC;CAAG;AAErF,mGAAmG;AACnG,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CAkC5E;AAED,gHAAgH;AAChH,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,2CAS5F;AAUD,UAAU,cAAe,SAAQ,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACpE,wDAAwD;IACxD,aAAa,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,SAAS,CAAE,SAAQ,iBAAiB,CAAC,CAAC,CAAC,EAAE,cAAc;CAAG;AAEnG,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,aAAiB,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,2CAgB5H;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,SAAS,CAAE,SAAQ,sBAAsB,CAAC,CAAC,CAAC,EAAE,cAAc;CAAG;AAE7G,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,aAAiB,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC,2CAgBtI"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { Icon as t } from "../lib/icon.js";
|
|
4
|
+
import { Button as n } from "./button.js";
|
|
5
|
+
import { useContext as r } from "react";
|
|
6
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { Calendar as s, CalendarCell as c, CalendarGrid as l, CalendarGridBody as u, CalendarGridHeader as d, CalendarHeaderCell as f, Heading as p, RangeCalendar as m, RangeCalendarStateContext as h, composeRenderProps as g } from "react-aria-components";
|
|
8
|
+
import { cva as _ } from "class-variance-authority";
|
|
9
|
+
import { getLocalTimeZone as v, isToday as y } from "@internationalized/date";
|
|
10
|
+
//#region src/components/calendar.tsx
|
|
11
|
+
var b = _("flex w-fit max-w-full flex-col text-foreground data-disabled:opacity-50", {
|
|
12
|
+
variants: { variant: {
|
|
13
|
+
plain: "",
|
|
14
|
+
card: "rounded-panel bg-secondary p-3"
|
|
15
|
+
} },
|
|
16
|
+
defaultVariants: { variant: "plain" }
|
|
17
|
+
});
|
|
18
|
+
function x({ className: r, ...i }) {
|
|
19
|
+
return /* @__PURE__ */ o("header", {
|
|
20
|
+
"data-slot": "calendar-header",
|
|
21
|
+
className: e("flex items-center gap-1 pb-2", r),
|
|
22
|
+
...i,
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ a(n, {
|
|
25
|
+
slot: "previous",
|
|
26
|
+
variant: "quiet",
|
|
27
|
+
size: "icon",
|
|
28
|
+
className: "size-8",
|
|
29
|
+
children: /* @__PURE__ */ a(t, {
|
|
30
|
+
name: "chevron-left",
|
|
31
|
+
size: 16
|
|
32
|
+
})
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ a(p, { className: "min-w-0 flex-1 truncate text-center text-subhead font-semibold" }),
|
|
35
|
+
/* @__PURE__ */ a(n, {
|
|
36
|
+
slot: "next",
|
|
37
|
+
variant: "quiet",
|
|
38
|
+
size: "icon",
|
|
39
|
+
className: "size-8",
|
|
40
|
+
children: /* @__PURE__ */ a(t, {
|
|
41
|
+
name: "chevron-right",
|
|
42
|
+
size: 16
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function S({ className: t, date: n, ...i }) {
|
|
49
|
+
let o = r(h) != null, s = y(n, v());
|
|
50
|
+
return /* @__PURE__ */ a(c, {
|
|
51
|
+
"data-slot": "calendar-cell",
|
|
52
|
+
date: n,
|
|
53
|
+
className: g(t, (t) => e("group/cell relative flex size-9 cursor-default items-center justify-center text-subhead outline-none data-outside-month:invisible data-disabled:opacity-30", o && "before:absolute before:inset-y-0 before:inset-x-0 before:hidden before:bg-primary/15 data-selected:before:block data-selection-start:before:left-1/2 data-selection-end:before:right-1/2", t)),
|
|
54
|
+
...i,
|
|
55
|
+
children: ({ formattedDate: t }) => /* @__PURE__ */ a("span", {
|
|
56
|
+
className: e("relative z-1 grid size-9 place-items-center rounded-full tabular-nums transition-colors duration-spring-snappy ease-spring-snappy", "cursor-pointer not-group-data-selected/cell:group-data-hovered/cell:bg-secondary-strong group-data-focus-visible/cell:ring-2 group-data-focus-visible/cell:ring-ring", "group-data-unavailable/cell:text-destructive group-data-unavailable/cell:line-through group-data-disabled/cell:cursor-default", s && "font-semibold text-primary", o ? "group-data-selection-start/cell:bg-primary group-data-selection-start/cell:text-primary-foreground group-data-selection-end/cell:bg-primary group-data-selection-end/cell:text-primary-foreground" : "group-data-selected/cell:bg-primary group-data-selected/cell:text-primary-foreground"),
|
|
57
|
+
children: t
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function C({ className: t, ...n }) {
|
|
62
|
+
return /* @__PURE__ */ o(l, {
|
|
63
|
+
"data-slot": "calendar-grid",
|
|
64
|
+
className: e("border-separate border-spacing-0", t),
|
|
65
|
+
...n,
|
|
66
|
+
children: [/* @__PURE__ */ a(d, { children: (e) => /* @__PURE__ */ a(f, {
|
|
67
|
+
className: "h-8 text-center text-caption font-medium text-muted-foreground",
|
|
68
|
+
children: e
|
|
69
|
+
}) }), /* @__PURE__ */ a(u, { children: (e) => /* @__PURE__ */ a(S, { date: e }) })]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function w({ count: e }) {
|
|
73
|
+
return /* @__PURE__ */ a("div", {
|
|
74
|
+
className: "flex gap-6",
|
|
75
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ a(C, { offset: { months: t } }, t))
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function T({ className: t, variant: n, visibleMonths: r = 1, children: c, ...l }) {
|
|
79
|
+
return /* @__PURE__ */ a(s, {
|
|
80
|
+
"data-slot": "calendar",
|
|
81
|
+
visibleDuration: { months: r },
|
|
82
|
+
className: g(t, (t) => e(b({ variant: n }), t)),
|
|
83
|
+
...l,
|
|
84
|
+
children: c ?? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(x, {}), /* @__PURE__ */ a(w, { count: r })] })
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function E({ className: t, variant: n, visibleMonths: r = 1, children: s, ...c }) {
|
|
88
|
+
return /* @__PURE__ */ a(m, {
|
|
89
|
+
"data-slot": "range-calendar",
|
|
90
|
+
visibleDuration: { months: r },
|
|
91
|
+
className: g(t, (t) => e(b({ variant: n }), t)),
|
|
92
|
+
...c,
|
|
93
|
+
children: s ?? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(x, {}), /* @__PURE__ */ a(w, { count: r })] })
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { T as Calendar, S as CalendarCell, C as CalendarGrid, x as CalendarHeader, E as RangeCalendar, b as calendarVariants };
|