react-marketing-ui 0.0.3 → 0.0.4
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/dist/accordion.js +1 -1
- package/dist/accordion.js.map +1 -1
- package/dist/accordion.mjs +222 -2
- package/dist/accordion.mjs.map +1 -1
- package/dist/action-swap.js +1 -0
- package/dist/action-swap.mjs +77 -3
- package/dist/action-swap.mjs.map +1 -1
- package/dist/animated-beam.js +1 -0
- package/dist/animated-beam.mjs +127 -2
- package/dist/animated-beam.mjs.map +1 -1
- package/dist/button.js +1 -1
- package/dist/button.js.map +1 -1
- package/dist/button.mjs +115 -2
- package/dist/button.mjs.map +1 -1
- package/dist/card.js +1 -2
- package/dist/card.js.map +1 -1
- package/dist/card.mjs +135 -3
- package/dist/card.mjs.map +1 -1
- package/dist/dia-text-reveal.js +1 -0
- package/dist/dia-text-reveal.mjs +331 -2
- package/dist/dia-text-reveal.mjs.map +1 -1
- package/dist/elevated-input.js +1 -1
- package/dist/elevated-input.js.map +1 -1
- package/dist/elevated-input.mjs +48 -2
- package/dist/elevated-input.mjs.map +1 -1
- package/dist/fade-in.js +1 -0
- package/dist/fade-in.mjs +84 -2
- package/dist/fade-in.mjs.map +1 -1
- package/dist/feature-card.js +1 -1
- package/dist/feature-card.js.map +1 -1
- package/dist/feature-card.mjs +34 -2
- package/dist/feature-card.mjs.map +1 -1
- package/dist/flowchart-parts.js +1 -1
- package/dist/flowchart-parts.js.map +1 -1
- package/dist/flowchart-parts.mjs +91 -2
- package/dist/flowchart-parts.mjs.map +1 -1
- package/dist/glossy-button.js +1 -1
- package/dist/glossy-button.js.map +1 -1
- package/dist/glossy-button.mjs +82 -2
- package/dist/glossy-button.mjs.map +1 -1
- package/dist/grainient.js +1 -0
- package/dist/grainient.mjs +327 -2
- package/dist/grainient.mjs.map +1 -1
- package/dist/highlighter.js +1 -0
- package/dist/highlighter.mjs +122 -3
- package/dist/highlighter.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2642 -32
- package/dist/index.mjs.map +1 -1
- package/dist/input.js +1 -0
- package/dist/input.mjs +107 -2
- package/dist/input.mjs.map +1 -1
- package/dist/lib/breakpoints.js +1 -1
- package/dist/lib/breakpoints.js.map +1 -1
- package/dist/lib/breakpoints.mjs +34 -1
- package/dist/lib/breakpoints.mjs.map +1 -1
- package/dist/lib/cn.js +1 -1
- package/dist/lib/cn.js.map +1 -1
- package/dist/lib/cn.mjs +17 -1
- package/dist/lib/cn.mjs.map +1 -1
- package/dist/lib/ease.js +1 -0
- package/dist/lib/ease.mjs +9 -1
- package/dist/lib/ease.mjs.map +1 -1
- package/dist/lib/surface.js +1 -0
- package/dist/lib/surface.mjs +37 -1
- package/dist/lib/surface.mjs.map +1 -1
- package/dist/lib/use-media-query.js +1 -0
- package/dist/lib/use-media-query.mjs +16 -1
- package/dist/lib/use-media-query.mjs.map +1 -1
- package/dist/liquid-metal.js +1 -0
- package/dist/liquid-metal.mjs +40 -2
- package/dist/liquid-metal.mjs.map +1 -1
- package/dist/navigation-menu-icons.js +1 -1
- package/dist/navigation-menu-icons.js.map +1 -1
- package/dist/navigation-menu-icons.mjs +36 -1
- package/dist/navigation-menu-icons.mjs.map +1 -1
- package/dist/navigation-menu-styles.js +1 -1
- package/dist/navigation-menu-styles.js.map +1 -1
- package/dist/navigation-menu-styles.mjs +11 -1
- package/dist/navigation-menu-styles.mjs.map +1 -1
- package/dist/navigation-menu.js +1 -2
- package/dist/navigation-menu.js.map +1 -1
- package/dist/navigation-menu.mjs +350 -5
- package/dist/navigation-menu.mjs.map +1 -1
- package/dist/password-input.js +1 -0
- package/dist/password-input.mjs +171 -3
- package/dist/password-input.mjs.map +1 -1
- package/dist/rainbow-button.js +1 -0
- package/dist/rainbow-button.mjs +45 -2
- package/dist/rainbow-button.mjs.map +1 -1
- package/dist/range-slider.js +1 -0
- package/dist/range-slider.mjs +82 -1
- package/dist/range-slider.mjs.map +1 -1
- package/dist/rolling-badge.js +1 -0
- package/dist/rolling-badge.mjs +68 -2
- package/dist/rolling-badge.mjs.map +1 -1
- package/dist/savings-badge.js +1 -1
- package/dist/savings-badge.js.map +1 -1
- package/dist/savings-badge.mjs +22 -2
- package/dist/savings-badge.mjs.map +1 -1
- package/dist/shine-border.js +1 -0
- package/dist/shine-border.mjs +44 -2
- package/dist/shine-border.mjs.map +1 -1
- package/dist/sparkles-text.js +1 -0
- package/dist/sparkles-text.mjs +84 -3
- package/dist/sparkles-text.mjs.map +1 -1
- package/dist/tabs.js +1 -0
- package/dist/tabs.mjs +118 -2
- package/dist/tabs.mjs.map +1 -1
- package/dist/theme-toggle.js +1 -0
- package/dist/theme-toggle.mjs +248 -5
- package/dist/theme-toggle.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-3SB6HUBA.mjs +0 -31
- package/dist/chunk-3SB6HUBA.mjs.map +0 -1
- package/dist/chunk-4PBVBXGY.mjs +0 -84
- package/dist/chunk-4PBVBXGY.mjs.map +0 -1
- package/dist/chunk-4VCFWVSJ.mjs +0 -42
- package/dist/chunk-4VCFWVSJ.mjs.map +0 -1
- package/dist/chunk-5QQAPGR2.mjs +0 -109
- package/dist/chunk-5QQAPGR2.mjs.map +0 -1
- package/dist/chunk-6MB4UKRX.mjs +0 -19
- package/dist/chunk-6MB4UKRX.mjs.map +0 -1
- package/dist/chunk-6T5LR34O.mjs +0 -45
- package/dist/chunk-6T5LR34O.mjs.map +0 -1
- package/dist/chunk-AYLCYDUM.mjs +0 -275
- package/dist/chunk-AYLCYDUM.mjs.map +0 -1
- package/dist/chunk-AYY7D2RJ.mjs +0 -112
- package/dist/chunk-AYY7D2RJ.mjs.map +0 -1
- package/dist/chunk-CTZEI2YS.mjs +0 -324
- package/dist/chunk-CTZEI2YS.mjs.map +0 -1
- package/dist/chunk-DA3I3Y5O.mjs +0 -71
- package/dist/chunk-DA3I3Y5O.mjs.map +0 -1
- package/dist/chunk-EYHT2EWJ.mjs +0 -18
- package/dist/chunk-EYHT2EWJ.mjs.map +0 -1
- package/dist/chunk-IHLGCS63.mjs +0 -36
- package/dist/chunk-IHLGCS63.mjs.map +0 -1
- package/dist/chunk-JVXJ6SFX.mjs +0 -38
- package/dist/chunk-JVXJ6SFX.mjs.map +0 -1
- package/dist/chunk-KBHYXLRG.mjs +0 -13
- package/dist/chunk-KBHYXLRG.mjs.map +0 -1
- package/dist/chunk-KMXUQYR3.mjs +0 -74
- package/dist/chunk-KMXUQYR3.mjs.map +0 -1
- package/dist/chunk-KNPOZ34H.mjs +0 -88
- package/dist/chunk-KNPOZ34H.mjs.map +0 -1
- package/dist/chunk-KRNWCJ4D.mjs +0 -219
- package/dist/chunk-KRNWCJ4D.mjs.map +0 -1
- package/dist/chunk-M5MESV26.mjs +0 -124
- package/dist/chunk-M5MESV26.mjs.map +0 -1
- package/dist/chunk-MJYBPJBA.mjs +0 -115
- package/dist/chunk-MJYBPJBA.mjs.map +0 -1
- package/dist/chunk-NNHPQ67J.mjs +0 -10
- package/dist/chunk-NNHPQ67J.mjs.map +0 -1
- package/dist/chunk-OCZFHVVD.mjs +0 -71
- package/dist/chunk-OCZFHVVD.mjs.map +0 -1
- package/dist/chunk-QAWSH567.mjs +0 -19
- package/dist/chunk-QAWSH567.mjs.map +0 -1
- package/dist/chunk-R2E2J42H.mjs +0 -38
- package/dist/chunk-R2E2J42H.mjs.map +0 -1
- package/dist/chunk-TPGLLSYV.mjs +0 -65
- package/dist/chunk-TPGLLSYV.mjs.map +0 -1
- package/dist/chunk-VJENJHXJ.mjs +0 -72
- package/dist/chunk-VJENJHXJ.mjs.map +0 -1
- package/dist/chunk-W22G7XHR.mjs +0 -104
- package/dist/chunk-W22G7XHR.mjs.map +0 -1
- package/dist/chunk-WDR5VPZJ.mjs +0 -79
- package/dist/chunk-WDR5VPZJ.mjs.map +0 -1
- package/dist/chunk-WLUGKBH7.mjs +0 -37
- package/dist/chunk-WLUGKBH7.mjs.map +0 -1
- package/dist/chunk-WYJYLDUA.mjs +0 -84
- package/dist/chunk-WYJYLDUA.mjs.map +0 -1
- package/dist/chunk-XZEDZVXT.mjs +0 -38
- package/dist/chunk-XZEDZVXT.mjs.map +0 -1
- package/dist/chunk-YKGP5JIL.mjs +0 -328
- package/dist/chunk-YKGP5JIL.mjs.map +0 -1
- package/dist/chunk-YM3U2OBE.mjs +0 -99
- package/dist/chunk-YM3U2OBE.mjs.map +0 -1
package/dist/input.js
CHANGED
package/dist/input.mjs
CHANGED
|
@@ -1,4 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
1
|
+
"use client";
|
|
2
|
+
import { useId, useState } from 'react';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
var FIELD_BORDER = {
|
|
11
|
+
idle: "border-(--color-border)",
|
|
12
|
+
focused: "border-(--color-foreground)/40",
|
|
13
|
+
error: "border-(--color-destructive)"
|
|
14
|
+
};
|
|
15
|
+
var FIELD_HEIGHT = {
|
|
16
|
+
sm: "h-8",
|
|
17
|
+
md: "h-9",
|
|
18
|
+
lg: "h-11"
|
|
19
|
+
};
|
|
20
|
+
var FIELD_SHAPE = {
|
|
21
|
+
rounded: "rounded-lg",
|
|
22
|
+
pill: "rounded-full"
|
|
23
|
+
};
|
|
24
|
+
var INPUT_SIZE = {
|
|
25
|
+
sm: "text-xs",
|
|
26
|
+
md: "text-sm",
|
|
27
|
+
lg: "text-base"
|
|
28
|
+
};
|
|
29
|
+
var INPUT_PAD = {
|
|
30
|
+
sm: "px-2.5",
|
|
31
|
+
md: "px-3",
|
|
32
|
+
lg: "px-3.5"
|
|
33
|
+
};
|
|
34
|
+
function Input({
|
|
35
|
+
label,
|
|
36
|
+
error,
|
|
37
|
+
hint,
|
|
38
|
+
leftAdornment,
|
|
39
|
+
rightAdornment,
|
|
40
|
+
size = "md",
|
|
41
|
+
shape = "rounded",
|
|
42
|
+
className,
|
|
43
|
+
inputClassName,
|
|
44
|
+
inputType = "text",
|
|
45
|
+
id: idProp,
|
|
46
|
+
onFocus,
|
|
47
|
+
onBlur,
|
|
48
|
+
disabled,
|
|
49
|
+
autoFocus,
|
|
50
|
+
...inputProps
|
|
51
|
+
}) {
|
|
52
|
+
const autoId = useId();
|
|
53
|
+
const id = idProp ?? autoId;
|
|
54
|
+
const [focused, setFocused] = useState(false);
|
|
55
|
+
const hasError = Boolean(error);
|
|
56
|
+
const errorMessage = typeof error === "string" ? error : null;
|
|
57
|
+
const state = hasError ? "error" : focused ? "focused" : "idle";
|
|
58
|
+
const hasLeft = Boolean(leftAdornment);
|
|
59
|
+
const hasRight = Boolean(rightAdornment);
|
|
60
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1.5", className), children: [
|
|
61
|
+
label ? /* @__PURE__ */ jsx("label", { htmlFor: id, className: "px-1 font-medium text-(--color-foreground) text-sm", children: label }) : null,
|
|
62
|
+
/* @__PURE__ */ jsxs(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: cn(
|
|
66
|
+
"relative flex flex-row items-center overflow-hidden border",
|
|
67
|
+
FIELD_BORDER[state],
|
|
68
|
+
FIELD_HEIGHT[size],
|
|
69
|
+
FIELD_SHAPE[shape],
|
|
70
|
+
disabled && "opacity-60"
|
|
71
|
+
),
|
|
72
|
+
children: [
|
|
73
|
+
hasLeft ? /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute top-0 bottom-0 left-3 z-10 flex items-center justify-center", children: leftAdornment }) : null,
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
"input",
|
|
76
|
+
{
|
|
77
|
+
id,
|
|
78
|
+
type: inputType,
|
|
79
|
+
disabled,
|
|
80
|
+
autoFocus,
|
|
81
|
+
onFocus: (event_) => {
|
|
82
|
+
setFocused(true);
|
|
83
|
+
onFocus?.(event_);
|
|
84
|
+
},
|
|
85
|
+
onBlur: (event_) => {
|
|
86
|
+
setFocused(false);
|
|
87
|
+
onBlur?.(event_);
|
|
88
|
+
},
|
|
89
|
+
className: cn(
|
|
90
|
+
"h-full min-w-0 flex-1 bg-transparent text-(--color-foreground) outline-none",
|
|
91
|
+
INPUT_SIZE[size],
|
|
92
|
+
hasLeft ? "pl-10" : INPUT_PAD[size],
|
|
93
|
+
hasRight ? "pr-10" : INPUT_PAD[size],
|
|
94
|
+
inputClassName
|
|
95
|
+
),
|
|
96
|
+
...inputProps
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
hasRight ? /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute top-0 right-3 bottom-0 z-10 flex items-center justify-center", children: rightAdornment }) : null
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
errorMessage ? /* @__PURE__ */ jsx("p", { role: "alert", className: "px-1 text-(--color-destructive) text-xs", children: errorMessage }) : hint ? /* @__PURE__ */ jsx("p", { className: "px-1 text-(--color-muted-foreground) text-xs", children: hint }) : null
|
|
104
|
+
] });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { Input };
|
|
3
108
|
//# sourceMappingURL=input.mjs.map
|
|
4
109
|
//# sourceMappingURL=input.mjs.map
|
package/dist/input.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"input.mjs"}
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/input.tsx"],"names":[],"mappings":";;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,IAAM,YAAA,GAAuC;AAAA,EAC3C,IAAA,EAAM,yBAAA;AAAA,EACN,OAAA,EAAS,gCAAA;AAAA,EACT,KAAA,EAAO;AACT,CAAA;AAEA,IAAM,YAAA,GAAuC;AAAA,EAC3C,EAAA,EAAI,KAAA;AAAA,EACJ,EAAA,EAAI,KAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAEA,IAAM,WAAA,GAAsC;AAAA,EAC1C,OAAA,EAAS,YAAA;AAAA,EACT,IAAA,EAAM;AACR,CAAA;AAEA,IAAM,UAAA,GAAqC;AAAA,EACzC,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAEA,IAAM,SAAA,GAAoC;AAAA,EACxC,EAAA,EAAI,QAAA;AAAA,EACJ,EAAA,EAAI,MAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAeO,SAAS,KAAA,CAAM;AAAA,EACpB,KAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,IAAA,GAAO,IAAA;AAAA,EACP,KAAA,GAAQ,SAAA;AAAA,EACR,SAAA;AAAA,EACA,cAAA;AAAA,EACA,SAAA,GAAY,MAAA;AAAA,EACZ,EAAA,EAAI,MAAA;AAAA,EACJ,OAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAe;AACb,EAAA,MAAM,SAAS,KAAA,EAAM;AACrB,EAAA,MAAM,KAAK,MAAA,IAAU,MAAA;AACrB,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAC5C,EAAA,MAAM,QAAA,GAAW,QAAQ,KAAK,CAAA;AAC9B,EAAA,MAAM,YAAA,GAAe,OAAO,KAAA,KAAU,QAAA,GAAW,KAAA,GAAQ,IAAA;AACzD,EAAA,MAAM,KAAA,GAAQ,QAAA,GAAW,OAAA,GAAU,OAAA,GAAU,SAAA,GAAY,MAAA;AACzD,EAAA,MAAM,OAAA,GAAU,QAAQ,aAAa,CAAA;AACrC,EAAA,MAAM,QAAA,GAAW,QAAQ,cAAc,CAAA;AAEvC,EAAA,4BACG,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,uBAAA,EAAyB,SAAS,CAAA,EAClD,QAAA,EAAA;AAAA,IAAA,KAAA,uBACE,OAAA,EAAA,EAAM,OAAA,EAAS,IAAI,SAAA,EAAU,oDAAA,EAC3B,iBACH,CAAA,GACE,IAAA;AAAA,oBAEJ,IAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,EAAA;AAAA,UACT,4DAAA;AAAA,UACA,aAAa,KAAK,CAAA;AAAA,UAClB,aAAa,IAAI,CAAA;AAAA,UACjB,YAAY,KAAK,CAAA;AAAA,UACjB,QAAA,IAAY;AAAA,SACd;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,OAAA,mBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,0FAAA,EACZ,yBACH,CAAA,GACE,IAAA;AAAA,0BAEJ,GAAA;AAAA,YAAC,OAAA;AAAA,YAAA;AAAA,cACC,EAAA;AAAA,cACA,IAAA,EAAM,SAAA;AAAA,cACN,QAAA;AAAA,cAEA,SAAA;AAAA,cACA,OAAA,EAAS,CAAC,MAAA,KAAW;AACnB,gBAAA,UAAA,CAAW,IAAI,CAAA;AACf,gBAAA,OAAA,GAAU,MAAM,CAAA;AAAA,cAClB,CAAA;AAAA,cACA,MAAA,EAAQ,CAAC,MAAA,KAAW;AAClB,gBAAA,UAAA,CAAW,KAAK,CAAA;AAChB,gBAAA,MAAA,GAAS,MAAM,CAAA;AAAA,cACjB,CAAA;AAAA,cACA,SAAA,EAAW,EAAA;AAAA,gBACT,6EAAA;AAAA,gBACA,WAAW,IAAI,CAAA;AAAA,gBACf,OAAA,GAAU,OAAA,GAAU,SAAA,CAAU,IAAI,CAAA;AAAA,gBAClC,QAAA,GAAW,OAAA,GAAU,SAAA,CAAU,IAAI,CAAA;AAAA,gBACnC;AAAA,eACF;AAAA,cACC,GAAG;AAAA;AAAA,WACN;AAAA,UAEC,2BACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,2FAAA,EACZ,0BACH,CAAA,GACE;AAAA;AAAA;AAAA,KACN;AAAA,IAEC,YAAA,mBACC,GAAA,CAAC,GAAA,EAAA,EAAE,IAAA,EAAK,SAAQ,SAAA,EAAU,yCAAA,EACvB,QAAA,EAAA,YAAA,EACH,CAAA,GACE,uBACF,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,8CAAA,EAAgD,gBAAK,CAAA,GAChE;AAAA,GAAA,EACN,CAAA;AAEJ","file":"input.mjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport type { CSSProperties } from 'react';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * A style object that may carry CSS custom properties (CSS variables)\n * such as `--duration`. React's `CSSProperties` intentionally drops\n * its index signature, so custom properties are not accepted without help.\n */\nexport type CSSPropertiesWithVars = CSSProperties & Record<`--${string}`, string | number>;\n\n/**\n * Builds a {@link CSSProperties} value that also allows CSS custom properties,\n * so `style` props can be written without an `as React.CSSProperties` cast while\n * still type-checking both the known style keys and the custom-property values.\n *\n * @example\n * <div style={validCssVars({ '--duration': '0.35s', color: 'red' })} />\n */\nexport function validCssVars(style: CSSPropertiesWithVars): CSSProperties {\n return style;\n}\n\n/**\n * Narrows a union to the member(s) that declare `key` — a type-guard\n * replacement for the `in` operator's discriminated-union narrowing.\n */\nexport function hasKey<K extends PropertyKey>(key: K, obj: unknown): obj is Record<K, unknown> {\n return obj !== null && typeof obj === 'object' && Object.hasOwn(obj, key);\n}\n\nexport function noop(): void {\n // intentional no-op\n}\n","'use client';\n\nimport { type InputHTMLAttributes, type ReactNode, useId, useState } from 'react';\nimport { cn } from '../lib/utils.js';\n\nconst FIELD_BORDER: Record<string, string> = {\n idle: 'border-(--color-border)',\n focused: 'border-(--color-foreground)/40',\n error: 'border-(--color-destructive)',\n};\n\nconst FIELD_HEIGHT: Record<string, string> = {\n sm: 'h-8',\n md: 'h-9',\n lg: 'h-11',\n};\n\nconst FIELD_SHAPE: Record<string, string> = {\n rounded: 'rounded-lg',\n pill: 'rounded-full',\n};\n\nconst INPUT_SIZE: Record<string, string> = {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-base',\n};\n\nconst INPUT_PAD: Record<string, string> = {\n sm: 'px-2.5',\n md: 'px-3',\n lg: 'px-3.5',\n};\n\nexport type InputProps = {\n label?: string;\n error?: string | boolean;\n hint?: string;\n leftAdornment?: ReactNode;\n rightAdornment?: ReactNode;\n size?: 'sm' | 'md' | 'lg';\n shape?: 'rounded' | 'pill';\n className?: string;\n inputClassName?: string;\n inputType?: InputHTMLAttributes<HTMLInputElement>['type'];\n} & Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'>;\n\nexport function Input({\n label,\n error,\n hint,\n leftAdornment,\n rightAdornment,\n size = 'md',\n shape = 'rounded',\n className,\n inputClassName,\n inputType = 'text',\n id: idProp,\n onFocus,\n onBlur,\n disabled,\n autoFocus,\n ...inputProps\n}: InputProps) {\n const autoId = useId();\n const id = idProp ?? autoId;\n const [focused, setFocused] = useState(false);\n const hasError = Boolean(error);\n const errorMessage = typeof error === 'string' ? error : null;\n const state = hasError ? 'error' : focused ? 'focused' : 'idle';\n const hasLeft = Boolean(leftAdornment);\n const hasRight = Boolean(rightAdornment);\n\n return (\n <div className={cn('flex flex-col gap-1.5', className)}>\n {label ? (\n <label htmlFor={id} className=\"px-1 font-medium text-(--color-foreground) text-sm\">\n {label}\n </label>\n ) : null}\n\n <div\n className={cn(\n 'relative flex flex-row items-center overflow-hidden border',\n FIELD_BORDER[state],\n FIELD_HEIGHT[size],\n FIELD_SHAPE[shape],\n disabled && 'opacity-60',\n )}\n >\n {hasLeft ? (\n <div className=\"pointer-events-none absolute top-0 bottom-0 left-3 z-10 flex items-center justify-center\">\n {leftAdornment}\n </div>\n ) : null}\n\n <input\n id={id}\n type={inputType}\n disabled={disabled}\n // biome-ignore lint/a11y/noAutofocus: forwarded HTML attribute — callers decide whether to autofocus\n autoFocus={autoFocus}\n onFocus={(event_) => {\n setFocused(true);\n onFocus?.(event_);\n }}\n onBlur={(event_) => {\n setFocused(false);\n onBlur?.(event_);\n }}\n className={cn(\n 'h-full min-w-0 flex-1 bg-transparent text-(--color-foreground) outline-none',\n INPUT_SIZE[size],\n hasLeft ? 'pl-10' : INPUT_PAD[size],\n hasRight ? 'pr-10' : INPUT_PAD[size],\n inputClassName,\n )}\n {...inputProps}\n />\n\n {hasRight ? (\n <div className=\"pointer-events-none absolute top-0 right-3 bottom-0 z-10 flex items-center justify-center\">\n {rightAdornment}\n </div>\n ) : null}\n </div>\n\n {errorMessage ? (\n <p role=\"alert\" className=\"px-1 text-(--color-destructive) text-xs\">\n {errorMessage}\n </p>\n ) : hint ? (\n <p className=\"px-1 text-(--color-muted-foreground) text-xs\">{hint}</p>\n ) : null}\n </div>\n );\n}\n"]}
|
package/dist/lib/breakpoints.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/breakpoints.ts"],"names":["useCallback","useSyncExternalStore"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/lib/breakpoints.ts"],"names":["useCallback","useSyncExternalStore"],"mappings":";;;;AAGO,IAAM,WAAA,GAAc;AAAA,EACzB,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,OAAO,EAAE;AACZ;AAWO,SAAS,aAAA,GAA4B;AAC1C,EAAA,IAAI,OAAA,GAAsB,MAAA;AAC1B,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,GAAG,CAAA,IAAK,WAAA,EAAa;AACrC,IAAA,IAAI,WAAW,UAAA,CAAW,CAAA,YAAA,EAAe,GAAG,CAAA,IAAA,CAAM,CAAA,CAAE,SAAS,OAAA,GAAU,IAAA;AAAA,EACzE;AACA,EAAA,OAAO,OAAA;AACT;AAcO,SAAS,mBAAmB,QAAA,EAAkC;AACnE,EAAA,MAAM,OAAA,GAAU,WAAA,CAAY,GAAA,CAAI,CAAC,GAAG,GAAG,CAAA,KAAM,UAAA,CAAW,UAAA,CAAW,CAAA,YAAA,EAAe,GAAG,MAAM,CAAC,CAAA;AAC5F,EAAA,KAAA,MAAW,KAAA,IAAS,OAAA,EAAS,KAAA,CAAM,gBAAA,CAAiB,UAAU,QAAQ,CAAA;AACtE,EAAA,OAAO,MAAM;AACX,IAAA,KAAA,MAAW,KAAA,IAAS,OAAA,EAAS,KAAA,CAAM,mBAAA,CAAoB,UAAU,QAAQ,CAAA;AAAA,EAC3E,CAAA;AACF;AAEA,SAAS,mBAAA,GAAkC;AACzC,EAAA,OAAO,MAAA;AACT;AAYO,SAAS,aAAA,GAA4B;AAC1C,EAAA,MAAM,SAAA,GAAYA,iBAAA,CAAY,kBAAA,EAAoB,EAAE,CAAA;AACpD,EAAA,OAAOC,0BAAA,CAAqB,SAAA,EAAW,aAAA,EAAe,mBAAmB,CAAA;AAC3E","file":"breakpoints.js","sourcesContent":["import { useCallback, useSyncExternalStore } from 'react';\n\n/** Site breakpoints — `md` is 50rem here, not Tailwind's default 48rem. */\nexport const BREAKPOINTS = [\n ['xs', 30],\n ['sm', 40],\n ['md', 50],\n ['lg', 64],\n ['xl', 80],\n ['2xl', 96],\n] as const;\n\n/** `'base'` is the implicit below-`xs` band — the widths no `min-width` query claims. */\nexport type Breakpoint = 'base' | (typeof BREAKPOINTS)[number][0];\n\n/**\n * The current breakpoint, read straight from `matchMedia`. Use this over\n * `useBreakpoint` inside effects that need the *live* band: through the\n * hydration pass the rendered value is still the server's `'base'`, which is a\n * change away from the truth and will read as one.\n */\nexport function getBreakpoint(): Breakpoint {\n let current: Breakpoint = 'base';\n for (const [name, rem] of BREAKPOINTS) {\n if (globalThis.matchMedia(`(min-width: ${rem}rem)`).matches) current = name;\n }\n return current;\n}\n\n/**\n * Call `listener` whenever the viewport crosses a breakpoint. Returns the\n * unsubscribe.\n *\n * The imperative counterpart to `useBreakpoint`, for work that has to land in\n * the *same frame* as the layout change. Media-query change events fire during\n * the rendering steps, before `requestAnimationFrame` and before paint, so a\n * listener that writes to the DOM here is painted with the new layout rather\n * than one frame behind it. Going through React state instead costs a render\n * round-trip — the scheduler runs the update in a later task, and the layout\n * effect lands after the browser has already painted.\n */\nexport function onBreakpointChange(listener: () => void): () => void {\n const queries = BREAKPOINTS.map(([, rem]) => globalThis.matchMedia(`(min-width: ${rem}rem)`));\n for (const query of queries) query.addEventListener('change', listener);\n return () => {\n for (const query of queries) query.removeEventListener('change', listener);\n };\n}\n\nfunction getBreakpointServer(): Breakpoint {\n return 'base';\n}\n\n/**\n * The widest breakpoint the viewport currently satisfies, re-rendering only when\n * it crosses from one band into another — not on every pixel of a resize.\n *\n * This is for work that has to be *redone* when the layout changes shape, like\n * re-measuring something positioned against text that the gutters just moved. It\n * is not for choosing what to render: the exported HTML has to be correct at\n * every width before JS runs, so layout belongs in CSS breakpoints, and this\n * returns `'base'` during SSR and the first client paint regardless of viewport.\n */\nexport function useBreakpoint(): Breakpoint {\n const subscribe = useCallback(onBreakpointChange, []);\n return useSyncExternalStore(subscribe, getBreakpoint, getBreakpointServer);\n}\n"]}
|
package/dist/lib/breakpoints.mjs
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useSyncExternalStore } from 'react';
|
|
3
|
+
|
|
4
|
+
var BREAKPOINTS = [
|
|
5
|
+
["xs", 30],
|
|
6
|
+
["sm", 40],
|
|
7
|
+
["md", 50],
|
|
8
|
+
["lg", 64],
|
|
9
|
+
["xl", 80],
|
|
10
|
+
["2xl", 96]
|
|
11
|
+
];
|
|
12
|
+
function getBreakpoint() {
|
|
13
|
+
let current = "base";
|
|
14
|
+
for (const [name, rem] of BREAKPOINTS) {
|
|
15
|
+
if (globalThis.matchMedia(`(min-width: ${rem}rem)`).matches) current = name;
|
|
16
|
+
}
|
|
17
|
+
return current;
|
|
18
|
+
}
|
|
19
|
+
function onBreakpointChange(listener) {
|
|
20
|
+
const queries = BREAKPOINTS.map(([, rem]) => globalThis.matchMedia(`(min-width: ${rem}rem)`));
|
|
21
|
+
for (const query of queries) query.addEventListener("change", listener);
|
|
22
|
+
return () => {
|
|
23
|
+
for (const query of queries) query.removeEventListener("change", listener);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function getBreakpointServer() {
|
|
27
|
+
return "base";
|
|
28
|
+
}
|
|
29
|
+
function useBreakpoint() {
|
|
30
|
+
const subscribe = useCallback(onBreakpointChange, []);
|
|
31
|
+
return useSyncExternalStore(subscribe, getBreakpoint, getBreakpointServer);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { BREAKPOINTS, getBreakpoint, onBreakpointChange, useBreakpoint };
|
|
2
35
|
//# sourceMappingURL=breakpoints.mjs.map
|
|
3
36
|
//# sourceMappingURL=breakpoints.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"breakpoints.mjs"}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/breakpoints.ts"],"names":[],"mappings":";;AAGO,IAAM,WAAA,GAAc;AAAA,EACzB,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,OAAO,EAAE;AACZ;AAWO,SAAS,aAAA,GAA4B;AAC1C,EAAA,IAAI,OAAA,GAAsB,MAAA;AAC1B,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,GAAG,CAAA,IAAK,WAAA,EAAa;AACrC,IAAA,IAAI,WAAW,UAAA,CAAW,CAAA,YAAA,EAAe,GAAG,CAAA,IAAA,CAAM,CAAA,CAAE,SAAS,OAAA,GAAU,IAAA;AAAA,EACzE;AACA,EAAA,OAAO,OAAA;AACT;AAcO,SAAS,mBAAmB,QAAA,EAAkC;AACnE,EAAA,MAAM,OAAA,GAAU,WAAA,CAAY,GAAA,CAAI,CAAC,GAAG,GAAG,CAAA,KAAM,UAAA,CAAW,UAAA,CAAW,CAAA,YAAA,EAAe,GAAG,MAAM,CAAC,CAAA;AAC5F,EAAA,KAAA,MAAW,KAAA,IAAS,OAAA,EAAS,KAAA,CAAM,gBAAA,CAAiB,UAAU,QAAQ,CAAA;AACtE,EAAA,OAAO,MAAM;AACX,IAAA,KAAA,MAAW,KAAA,IAAS,OAAA,EAAS,KAAA,CAAM,mBAAA,CAAoB,UAAU,QAAQ,CAAA;AAAA,EAC3E,CAAA;AACF;AAEA,SAAS,mBAAA,GAAkC;AACzC,EAAA,OAAO,MAAA;AACT;AAYO,SAAS,aAAA,GAA4B;AAC1C,EAAA,MAAM,SAAA,GAAY,WAAA,CAAY,kBAAA,EAAoB,EAAE,CAAA;AACpD,EAAA,OAAO,oBAAA,CAAqB,SAAA,EAAW,aAAA,EAAe,mBAAmB,CAAA;AAC3E","file":"breakpoints.mjs","sourcesContent":["import { useCallback, useSyncExternalStore } from 'react';\n\n/** Site breakpoints — `md` is 50rem here, not Tailwind's default 48rem. */\nexport const BREAKPOINTS = [\n ['xs', 30],\n ['sm', 40],\n ['md', 50],\n ['lg', 64],\n ['xl', 80],\n ['2xl', 96],\n] as const;\n\n/** `'base'` is the implicit below-`xs` band — the widths no `min-width` query claims. */\nexport type Breakpoint = 'base' | (typeof BREAKPOINTS)[number][0];\n\n/**\n * The current breakpoint, read straight from `matchMedia`. Use this over\n * `useBreakpoint` inside effects that need the *live* band: through the\n * hydration pass the rendered value is still the server's `'base'`, which is a\n * change away from the truth and will read as one.\n */\nexport function getBreakpoint(): Breakpoint {\n let current: Breakpoint = 'base';\n for (const [name, rem] of BREAKPOINTS) {\n if (globalThis.matchMedia(`(min-width: ${rem}rem)`).matches) current = name;\n }\n return current;\n}\n\n/**\n * Call `listener` whenever the viewport crosses a breakpoint. Returns the\n * unsubscribe.\n *\n * The imperative counterpart to `useBreakpoint`, for work that has to land in\n * the *same frame* as the layout change. Media-query change events fire during\n * the rendering steps, before `requestAnimationFrame` and before paint, so a\n * listener that writes to the DOM here is painted with the new layout rather\n * than one frame behind it. Going through React state instead costs a render\n * round-trip — the scheduler runs the update in a later task, and the layout\n * effect lands after the browser has already painted.\n */\nexport function onBreakpointChange(listener: () => void): () => void {\n const queries = BREAKPOINTS.map(([, rem]) => globalThis.matchMedia(`(min-width: ${rem}rem)`));\n for (const query of queries) query.addEventListener('change', listener);\n return () => {\n for (const query of queries) query.removeEventListener('change', listener);\n };\n}\n\nfunction getBreakpointServer(): Breakpoint {\n return 'base';\n}\n\n/**\n * The widest breakpoint the viewport currently satisfies, re-rendering only when\n * it crosses from one band into another — not on every pixel of a resize.\n *\n * This is for work that has to be *redone* when the layout changes shape, like\n * re-measuring something positioned against text that the gutters just moved. It\n * is not for choosing what to render: the exported HTML has to be correct at\n * every width before JS runs, so layout belongs in CSS breakpoints, and this\n * returns `'base'` during SSR and the first client paint regardless of viewport.\n */\nexport function useBreakpoint(): Breakpoint {\n const subscribe = useCallback(onBreakpointChange, []);\n return useSyncExternalStore(subscribe, getBreakpoint, getBreakpointServer);\n}\n"]}
|
package/dist/lib/cn.js
CHANGED
package/dist/lib/cn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts"],"names":["twMerge","clsx"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts"],"names":["twMerge","clsx"],"mappings":";;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;AAiBO,SAAS,aAAa,KAAA,EAA6C;AACxE,EAAA,OAAO,KAAA;AACT;AAMO,SAAS,MAAA,CAA8B,KAAQ,GAAA,EAAyC;AAC7F,EAAA,OAAO,GAAA,KAAQ,QAAQ,OAAO,GAAA,KAAQ,YAAY,MAAA,CAAO,MAAA,CAAO,KAAK,GAAG,CAAA;AAC1E;AAEO,SAAS,IAAA,GAAa;AAE7B","file":"cn.js","sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport type { CSSProperties } from 'react';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * A style object that may carry CSS custom properties (CSS variables)\n * such as `--duration`. React's `CSSProperties` intentionally drops\n * its index signature, so custom properties are not accepted without help.\n */\nexport type CSSPropertiesWithVars = CSSProperties & Record<`--${string}`, string | number>;\n\n/**\n * Builds a {@link CSSProperties} value that also allows CSS custom properties,\n * so `style` props can be written without an `as React.CSSProperties` cast while\n * still type-checking both the known style keys and the custom-property values.\n *\n * @example\n * <div style={validCssVars({ '--duration': '0.35s', color: 'red' })} />\n */\nexport function validCssVars(style: CSSPropertiesWithVars): CSSProperties {\n return style;\n}\n\n/**\n * Narrows a union to the member(s) that declare `key` — a type-guard\n * replacement for the `in` operator's discriminated-union narrowing.\n */\nexport function hasKey<K extends PropertyKey>(key: K, obj: unknown): obj is Record<K, unknown> {\n return obj !== null && typeof obj === 'object' && Object.hasOwn(obj, key);\n}\n\nexport function noop(): void {\n // intentional no-op\n}\n"]}
|
package/dist/lib/cn.mjs
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
|
|
5
|
+
function cn(...inputs) {
|
|
6
|
+
return twMerge(clsx(inputs));
|
|
7
|
+
}
|
|
8
|
+
function validCssVars(style) {
|
|
9
|
+
return style;
|
|
10
|
+
}
|
|
11
|
+
function hasKey(key, obj) {
|
|
12
|
+
return obj !== null && typeof obj === "object" && Object.hasOwn(obj, key);
|
|
13
|
+
}
|
|
14
|
+
function noop() {
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { cn, hasKey, noop, validCssVars };
|
|
2
18
|
//# sourceMappingURL=cn.mjs.map
|
|
3
19
|
//# sourceMappingURL=cn.mjs.map
|
package/dist/lib/cn.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"cn.mjs"}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts"],"names":[],"mappings":";;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;AAiBO,SAAS,aAAa,KAAA,EAA6C;AACxE,EAAA,OAAO,KAAA;AACT;AAMO,SAAS,MAAA,CAA8B,KAAQ,GAAA,EAAyC;AAC7F,EAAA,OAAO,GAAA,KAAQ,QAAQ,OAAO,GAAA,KAAQ,YAAY,MAAA,CAAO,MAAA,CAAO,KAAK,GAAG,CAAA;AAC1E;AAEO,SAAS,IAAA,GAAa;AAE7B","file":"cn.mjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport type { CSSProperties } from 'react';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * A style object that may carry CSS custom properties (CSS variables)\n * such as `--duration`. React's `CSSProperties` intentionally drops\n * its index signature, so custom properties are not accepted without help.\n */\nexport type CSSPropertiesWithVars = CSSProperties & Record<`--${string}`, string | number>;\n\n/**\n * Builds a {@link CSSProperties} value that also allows CSS custom properties,\n * so `style` props can be written without an `as React.CSSProperties` cast while\n * still type-checking both the known style keys and the custom-property values.\n *\n * @example\n * <div style={validCssVars({ '--duration': '0.35s', color: 'red' })} />\n */\nexport function validCssVars(style: CSSPropertiesWithVars): CSSProperties {\n return style;\n}\n\n/**\n * Narrows a union to the member(s) that declare `key` — a type-guard\n * replacement for the `in` operator's discriminated-union narrowing.\n */\nexport function hasKey<K extends PropertyKey>(key: K, obj: unknown): obj is Record<K, unknown> {\n return obj !== null && typeof obj === 'object' && Object.hasOwn(obj, key);\n}\n\nexport function noop(): void {\n // intentional no-op\n}\n"]}
|
package/dist/lib/ease.js
CHANGED
package/dist/lib/ease.mjs
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
// src/lib/ease.ts
|
|
3
|
+
var easeOut = [0.22, 1, 0.36, 1];
|
|
4
|
+
var easeOutBack = [0.34, 1.56, 0.64, 1];
|
|
5
|
+
var EASE_OUT = [0.16, 1, 0.3, 1];
|
|
6
|
+
var EASE_OUT_CSS = "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
7
|
+
var SPRING_SWAP = { type: "spring", stiffness: 460, damping: 30, mass: 0.55 };
|
|
8
|
+
|
|
9
|
+
export { EASE_OUT, EASE_OUT_CSS, SPRING_SWAP, easeOut, easeOutBack };
|
|
2
10
|
//# sourceMappingURL=ease.mjs.map
|
|
3
11
|
//# sourceMappingURL=ease.mjs.map
|
package/dist/lib/ease.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"ease.mjs"}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/ease.ts"],"names":[],"mappings":";AAKO,IAAM,OAAA,GAAU,CAAC,IAAA,EAAM,CAAA,EAAG,MAAM,CAAC;AAGjC,IAAM,WAAA,GAAc,CAAC,IAAA,EAAM,IAAA,EAAM,MAAM,CAAC;AAOxC,IAAM,QAAA,GAAW,CAAC,IAAA,EAAM,CAAA,EAAG,KAAK,CAAC;AAGjC,IAAM,YAAA,GAAe;AAGrB,IAAM,WAAA,GAAc,EAAE,IAAA,EAAM,QAAA,EAAU,WAAW,GAAA,EAAK,OAAA,EAAS,EAAA,EAAI,IAAA,EAAM,IAAA","file":"ease.mjs","sourcesContent":["/**\n * Easing curves shared across landing-ui components.\n */\n\n/** Smooth deceleration — matches the former CSS `ease-out-expo`. */\nexport const easeOut = [0.22, 1, 0.36, 1] as const;\n\n/** Gentle overshoot — bounce-like settle for spring alternatives. */\nexport const easeOutBack = [0.34, 1.56, 0.64, 1] as const;\n\n// ── Content-swap tokens (action-swap) ─────────────────────────────────────\n// Values mirror beui.dev's `lib/ease.ts` so vendored action-swap primitives\n// keep their upstream timing.\n\n/** Strong ease-out — the default `ease-out` reads weak at these durations. */\nexport const EASE_OUT = [0.16, 1, 0.3, 1] as const;\n\n/** CSS string form of {@link EASE_OUT} for inline style transitions. */\nexport const EASE_OUT_CSS = 'cubic-bezier(0.16, 1, 0.3, 1)';\n\n/** Content swaps — label/icon slots trading places inside a control. */\nexport const SPRING_SWAP = { type: 'spring', stiffness: 460, damping: 30, mass: 0.55 } as const;\n"]}
|
package/dist/lib/surface.js
CHANGED
package/dist/lib/surface.mjs
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
// src/lib/surface.ts
|
|
3
|
+
var SURFACE_BG = {
|
|
4
|
+
1: "bg-surface-1",
|
|
5
|
+
2: "bg-surface-2",
|
|
6
|
+
3: "bg-surface-3",
|
|
7
|
+
4: "bg-surface-4",
|
|
8
|
+
5: "bg-surface-5",
|
|
9
|
+
6: "bg-surface-6",
|
|
10
|
+
7: "bg-surface-7",
|
|
11
|
+
8: "bg-surface-8"
|
|
12
|
+
};
|
|
13
|
+
var SURFACE_VAR = {
|
|
14
|
+
1: "[--popup-surface:var(--surface-1)]",
|
|
15
|
+
2: "[--popup-surface:var(--surface-2)]",
|
|
16
|
+
3: "[--popup-surface:var(--surface-3)]",
|
|
17
|
+
4: "[--popup-surface:var(--surface-4)]",
|
|
18
|
+
5: "[--popup-surface:var(--surface-5)]",
|
|
19
|
+
6: "[--popup-surface:var(--surface-6)]",
|
|
20
|
+
7: "[--popup-surface:var(--surface-7)]",
|
|
21
|
+
8: "[--popup-surface:var(--surface-8)]"
|
|
22
|
+
};
|
|
23
|
+
var SURFACE_SHADOW_COMBINED = {
|
|
24
|
+
1: "shadow-elevated-1",
|
|
25
|
+
2: "shadow-elevated-2",
|
|
26
|
+
3: "shadow-elevated-3",
|
|
27
|
+
4: "shadow-elevated-4",
|
|
28
|
+
5: "shadow-elevated-5",
|
|
29
|
+
6: "shadow-elevated-6",
|
|
30
|
+
7: "shadow-elevated-7",
|
|
31
|
+
8: "shadow-elevated-8"
|
|
32
|
+
};
|
|
33
|
+
function solidSurface(level, shadowLevel = level) {
|
|
34
|
+
return `${SURFACE_BG[level]} ${SURFACE_SHADOW_COMBINED[shadowLevel]} ${SURFACE_VAR[level]}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { solidSurface };
|
|
2
38
|
//# sourceMappingURL=surface.mjs.map
|
|
3
39
|
//# sourceMappingURL=surface.mjs.map
|
package/dist/lib/surface.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"surface.mjs"}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/surface.ts"],"names":[],"mappings":";AAEA,IAAM,UAAA,GAA2C;AAAA,EAC/C,CAAA,EAAG,cAAA;AAAA,EACH,CAAA,EAAG,cAAA;AAAA,EACH,CAAA,EAAG,cAAA;AAAA,EACH,CAAA,EAAG,cAAA;AAAA,EACH,CAAA,EAAG,cAAA;AAAA,EACH,CAAA,EAAG,cAAA;AAAA,EACH,CAAA,EAAG,cAAA;AAAA,EACH,CAAA,EAAG;AACL,CAAA;AAEA,IAAM,WAAA,GAA4C;AAAA,EAChD,CAAA,EAAG,oCAAA;AAAA,EACH,CAAA,EAAG,oCAAA;AAAA,EACH,CAAA,EAAG,oCAAA;AAAA,EACH,CAAA,EAAG,oCAAA;AAAA,EACH,CAAA,EAAG,oCAAA;AAAA,EACH,CAAA,EAAG,oCAAA;AAAA,EACH,CAAA,EAAG,oCAAA;AAAA,EACH,CAAA,EAAG;AACL,CAAA;AAMA,IAAM,uBAAA,GAAwD;AAAA,EAC5D,CAAA,EAAG,mBAAA;AAAA,EACH,CAAA,EAAG,mBAAA;AAAA,EACH,CAAA,EAAG,mBAAA;AAAA,EACH,CAAA,EAAG,mBAAA;AAAA,EACH,CAAA,EAAG,mBAAA;AAAA,EACH,CAAA,EAAG,mBAAA;AAAA,EACH,CAAA,EAAG,mBAAA;AAAA,EACH,CAAA,EAAG;AACL,CAAA;AAaO,SAAS,YAAA,CAAa,KAAA,EAAqB,WAAA,GAA4B,KAAA,EAAe;AAC3F,EAAA,OAAO,CAAA,EAAG,UAAA,CAAW,KAAK,CAAC,CAAA,CAAA,EAAI,uBAAA,CAAwB,WAAW,CAAC,CAAA,CAAA,EAAI,WAAA,CAAY,KAAK,CAAC,CAAA,CAAA;AAC3F","file":"surface.mjs","sourcesContent":["export type SurfaceLevel = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;\n\nconst SURFACE_BG: Record<SurfaceLevel, string> = {\n 1: 'bg-surface-1',\n 2: 'bg-surface-2',\n 3: 'bg-surface-3',\n 4: 'bg-surface-4',\n 5: 'bg-surface-5',\n 6: 'bg-surface-6',\n 7: 'bg-surface-7',\n 8: 'bg-surface-8',\n};\n\nconst SURFACE_VAR: Record<SurfaceLevel, string> = {\n 1: '[--popup-surface:var(--surface-1)]',\n 2: '[--popup-surface:var(--surface-2)]',\n 3: '[--popup-surface:var(--surface-3)]',\n 4: '[--popup-surface:var(--surface-4)]',\n 5: '[--popup-surface:var(--surface-5)]',\n 6: '[--popup-surface:var(--surface-6)]',\n 7: '[--popup-surface:var(--surface-7)]',\n 8: '[--popup-surface:var(--surface-8)]',\n};\n\n/**\n * Drops + rim insets in a single `box-shadow` (no `::after`). Used by `solidSurface()`.\n * Literal Tailwind classes so the scanner picks them up.\n */\nconst SURFACE_SHADOW_COMBINED: Record<SurfaceLevel, string> = {\n 1: 'shadow-elevated-1',\n 2: 'shadow-elevated-2',\n 3: 'shadow-elevated-3',\n 4: 'shadow-elevated-4',\n 5: 'shadow-elevated-5',\n 6: 'shadow-elevated-6',\n 7: 'shadow-elevated-7',\n 8: 'shadow-elevated-8',\n};\n\n/**\n * Elevation for a free-floating surface: background, elevation variable, and the drop shadow with\n * its rim inset painted in the same `box-shadow` — which leaves `::after` free for other purposes.\n *\n * Suits containers with no opaque children near their edges. A child painted over the rim (a sticky\n * label, a pinned input, a dialog header) covers it, since nothing re-paints the rim above the\n * children.\n *\n * When `level !== shadowLevel` the rim color tracks `shadowLevel` — the two cannot be controlled\n * independently.\n */\nexport function solidSurface(level: SurfaceLevel, shadowLevel: SurfaceLevel = level): string {\n return `${SURFACE_BG[level]} ${SURFACE_SHADOW_COMBINED[shadowLevel]} ${SURFACE_VAR[level]}`;\n}\n"]}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
function useMediaQuery(query, defaultState = false) {
|
|
5
|
+
const [matches, setMatches] = useState(defaultState);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const mql = globalThis.matchMedia(query);
|
|
8
|
+
setMatches(mql.matches);
|
|
9
|
+
const onChange = (e) => setMatches(e.matches);
|
|
10
|
+
mql.addEventListener("change", onChange);
|
|
11
|
+
return () => mql.removeEventListener("change", onChange);
|
|
12
|
+
}, [query]);
|
|
13
|
+
return matches;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { useMediaQuery };
|
|
2
17
|
//# sourceMappingURL=use-media-query.mjs.map
|
|
3
18
|
//# sourceMappingURL=use-media-query.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-media-query.mjs"}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/use-media-query.ts"],"names":[],"mappings":";;AAWO,SAAS,aAAA,CAAc,KAAA,EAAe,YAAA,GAAe,KAAA,EAAgB;AAC1E,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,YAAY,CAAA;AAGnD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,GAAA,GAAM,UAAA,CAAW,UAAA,CAAW,KAAK,CAAA;AACvC,IAAA,UAAA,CAAW,IAAI,OAAO,CAAA;AAEtB,IAAA,MAAM,QAAA,GAAW,CAAC,CAAA,KAA2B,UAAA,CAAW,EAAE,OAAO,CAAA;AACjE,IAAA,GAAA,CAAI,gBAAA,CAAiB,UAAU,QAAQ,CAAA;AACvC,IAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AAAA,EACzD,CAAA,EAAG,CAAC,KAAK,CAAC,CAAA;AAEV,EAAA,OAAO,OAAA;AACT","file":"use-media-query.mjs","sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\n/**\n * Tracks a CSS media query, returning `true` when it matches.\n *\n * The default return before hydration is `false`; pass `defaultState`\n * to set a different initial value (e.g. `true` for dark-mode queries\n * whose SSR default is dark).\n */\nexport function useMediaQuery(query: string, defaultState = false): boolean {\n const [matches, setMatches] = useState(defaultState);\n\n // biome-ignore lint/plugin: subscribes to a matchMedia listener — an imperative side effect with no derived-state equivalent.\n useEffect(() => {\n const mql = globalThis.matchMedia(query);\n setMatches(mql.matches);\n\n const onChange = (e: MediaQueryListEvent) => setMatches(e.matches);\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }, [query]);\n\n return matches;\n}\n"]}
|
package/dist/liquid-metal.js
CHANGED
package/dist/liquid-metal.mjs
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
1
|
+
"use client";
|
|
2
|
+
import { LiquidMetal as LiquidMetal$1 } from '@paper-design/shaders-react';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
function LiquidMetal({
|
|
11
|
+
colorBack = "#aaaaac",
|
|
12
|
+
colorTint = "#ffffff",
|
|
13
|
+
speed = 0.5,
|
|
14
|
+
repetition = 4,
|
|
15
|
+
distortion = 0.1,
|
|
16
|
+
scale = 1,
|
|
17
|
+
className,
|
|
18
|
+
style
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: cn("pointer-events-none absolute inset-0 z-0 overflow-hidden", className), style, children: /* @__PURE__ */ jsx(
|
|
21
|
+
LiquidMetal$1,
|
|
22
|
+
{
|
|
23
|
+
colorBack,
|
|
24
|
+
colorTint,
|
|
25
|
+
speed,
|
|
26
|
+
repetition,
|
|
27
|
+
distortion,
|
|
28
|
+
softness: 0,
|
|
29
|
+
shiftRed: 0.3,
|
|
30
|
+
shiftBlue: -0.3,
|
|
31
|
+
angle: 45,
|
|
32
|
+
shape: "none",
|
|
33
|
+
scale,
|
|
34
|
+
fit: "cover",
|
|
35
|
+
style: { width: "100%", height: "100%" }
|
|
36
|
+
}
|
|
37
|
+
) });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { LiquidMetal };
|
|
3
41
|
//# sourceMappingURL=liquid-metal.mjs.map
|
|
4
42
|
//# sourceMappingURL=liquid-metal.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"liquid-metal.mjs"}
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/liquid-metal.tsx"],"names":["LiquidMetalShader"],"mappings":";;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACwBO,SAAS,WAAA,CAAY;AAAA,EAC1B,SAAA,GAAY,SAAA;AAAA,EACZ,SAAA,GAAY,SAAA;AAAA,EACZ,KAAA,GAAQ,GAAA;AAAA,EACR,UAAA,GAAa,CAAA;AAAA,EACb,UAAA,GAAa,GAAA;AAAA,EACb,KAAA,GAAQ,CAAA;AAAA,EACR,SAAA;AAAA,EACA;AACF,CAAA,EAAqB;AACnB,EAAA,uBACE,GAAA,CAAC,SAAI,aAAA,EAAa,IAAA,EAAM,WAAW,EAAA,CAAG,0DAAA,EAA4D,SAAS,CAAA,EAAG,KAAA,EAC5G,QAAA,kBAAA,GAAA;AAAA,IAACA,aAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACA,SAAA;AAAA,MACA,KAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAA;AAAA,MACA,QAAA,EAAU,CAAA;AAAA,MACV,QAAA,EAAU,GAAA;AAAA,MACV,SAAA,EAAW,IAAA;AAAA,MACX,KAAA,EAAO,EAAA;AAAA,MACP,KAAA,EAAM,MAAA;AAAA,MACN,KAAA;AAAA,MACA,GAAA,EAAI,OAAA;AAAA,MACJ,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA,EAAQ,QAAQ,MAAA;AAAO;AAAA,GACzC,EACF,CAAA;AAEJ","file":"liquid-metal.mjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport type { CSSProperties } from 'react';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * A style object that may carry CSS custom properties (CSS variables)\n * such as `--duration`. React's `CSSProperties` intentionally drops\n * its index signature, so custom properties are not accepted without help.\n */\nexport type CSSPropertiesWithVars = CSSProperties & Record<`--${string}`, string | number>;\n\n/**\n * Builds a {@link CSSProperties} value that also allows CSS custom properties,\n * so `style` props can be written without an `as React.CSSProperties` cast while\n * still type-checking both the known style keys and the custom-property values.\n *\n * @example\n * <div style={validCssVars({ '--duration': '0.35s', color: 'red' })} />\n */\nexport function validCssVars(style: CSSPropertiesWithVars): CSSProperties {\n return style;\n}\n\n/**\n * Narrows a union to the member(s) that declare `key` — a type-guard\n * replacement for the `in` operator's discriminated-union narrowing.\n */\nexport function hasKey<K extends PropertyKey>(key: K, obj: unknown): obj is Record<K, unknown> {\n return obj !== null && typeof obj === 'object' && Object.hasOwn(obj, key);\n}\n\nexport function noop(): void {\n // intentional no-op\n}\n","'use client';\n\nimport { LiquidMetal as LiquidMetalShader } from '@paper-design/shaders-react';\nimport type { CSSProperties, ReactNode } from 'react';\nimport { cn } from '../lib/utils.js';\n\n/* ── Shader wrapper ────────────────────────────────────── */\n\nexport type LiquidMetalProps = {\n /** Base background color of the liquid metal. */\n colorBack?: string;\n /** Tint / highlight color for the chrome effect. */\n colorTint?: string;\n /** Animation speed (0.1–2.0 recommended). */\n speed?: number;\n /** Pattern stripe density (1–10). */\n repetition?: number;\n /** Wave distortion amount (0–1). */\n distortion?: number;\n /** Texture zoom (0.01–4). */\n scale?: number;\n className?: string;\n style?: CSSProperties;\n};\n\n/**\n * Full-bleed animated liquid-metal shader. Absolutely positioned to fill its\n * nearest positioned ancestor; the WebGL canvas is decorative, so it is hidden\n * from assistive tech and never intercepts pointer events.\n */\nexport function LiquidMetal({\n colorBack = '#aaaaac',\n colorTint = '#ffffff',\n speed = 0.5,\n repetition = 4,\n distortion = 0.1,\n scale = 1,\n className,\n style,\n}: LiquidMetalProps) {\n return (\n <div aria-hidden={true} className={cn('pointer-events-none absolute inset-0 z-0 overflow-hidden', className)} style={style}>\n <LiquidMetalShader\n colorBack={colorBack}\n colorTint={colorTint}\n speed={speed}\n repetition={repetition}\n distortion={distortion}\n softness={0}\n shiftRed={0.3}\n shiftBlue={-0.3}\n angle={45}\n shape=\"none\"\n scale={scale}\n fit=\"cover\"\n style={{ width: '100%', height: '100%' }}\n />\n </div>\n );\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
|
|
5
|
-
// src/components/navigation-menu-icons.tsx
|
|
6
6
|
function ChevronDownIcon(props) {
|
|
7
7
|
return /* @__PURE__ */ jsxRuntime.jsx("svg", { "aria-hidden": "true", width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 3.5L5 7.5L9 3.5", stroke: "currentColor", strokeWidth: "1.5" }) });
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/navigation-menu-icons.tsx"],"names":["jsx","jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/navigation-menu-icons.tsx"],"names":["jsx","jsxs"],"mappings":";;;;AAEO,SAAS,gBAAgB,KAAA,EAAoC;AAClE,EAAA,uBACEA,cAAA,CAAC,SAAI,aAAA,EAAY,MAAA,EAAO,OAAM,IAAA,EAAK,MAAA,EAAO,IAAA,EAAK,OAAA,EAAQ,WAAA,EAAY,IAAA,EAAK,QAAQ,GAAG,KAAA,EACjF,yCAAC,MAAA,EAAA,EAAK,CAAA,EAAE,sBAAqB,MAAA,EAAO,cAAA,EAAe,WAAA,EAAY,KAAA,EAAM,CAAA,EACvE,CAAA;AAEJ;AAEO,SAAS,iBAAiB,KAAA,EAAoC;AACnE,EAAA,uBACEA,cAAA,CAAC,SAAI,aAAA,EAAY,MAAA,EAAO,OAAM,IAAA,EAAK,MAAA,EAAO,IAAA,EAAK,OAAA,EAAQ,WAAA,EAAY,IAAA,EAAK,QAAQ,GAAG,KAAA,EACjF,yCAAC,MAAA,EAAA,EAAK,CAAA,EAAE,sBAAqB,MAAA,EAAO,cAAA,EAAe,WAAA,EAAY,KAAA,EAAM,CAAA,EACvE,CAAA;AAEJ;AAEO,SAAS,SAAS,KAAA,EAAoC;AAC3D,EAAA,uBACEC,eAAA,CAAC,KAAA,EAAA,EAAI,aAAA,EAAY,MAAA,EAAO,KAAA,EAAM,IAAA,EAAK,MAAA,EAAO,IAAA,EAAK,OAAA,EAAQ,WAAA,EAAY,IAAA,EAAK,MAAA,EAAQ,GAAG,KAAA,EACjF,QAAA,EAAA;AAAA,oBAAAD,cAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,CAAA,EAAE,iMAAA;AAAA,QACF,SAAA,EAAU;AAAA;AAAA,KACZ;AAAA,oBACAA,cAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,CAAA,EAAE,kSAAA;AAAA,QACF,SAAA,EAAU;AAAA;AAAA,KACZ;AAAA,oBACAA,cAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,CAAA,EAAE,sTAAA;AAAA,QACF,SAAA,EAAU;AAAA;AAAA;AACZ,GAAA,EACF,CAAA;AAEJ","file":"navigation-menu-icons.js","sourcesContent":["import type * as React from 'react';\n\nexport function ChevronDownIcon(props: React.ComponentProps<'svg'>) {\n return (\n <svg aria-hidden=\"true\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" {...props}>\n <path d=\"M1 3.5L5 7.5L9 3.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n );\n}\n\nexport function ChevronRightIcon(props: React.ComponentProps<'svg'>) {\n return (\n <svg aria-hidden=\"true\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" {...props}>\n <path d=\"M3.5 1L7.5 5L3.5 9\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n );\n}\n\nexport function ArrowSvg(props: React.ComponentProps<'svg'>) {\n return (\n <svg aria-hidden=\"true\" width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\" {...props}>\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-(--popup-surface,var(--surface-3))\"\n />\n <path\n d=\"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z\"\n className=\"fill-border\"\n />\n <path\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n className=\"fill-border\"\n />\n </svg>\n );\n}\n"]}
|
|
@@ -1,3 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
function ChevronDownIcon(props) {
|
|
5
|
+
return /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", ...props, children: /* @__PURE__ */ jsx("path", { d: "M1 3.5L5 7.5L9 3.5", stroke: "currentColor", strokeWidth: "1.5" }) });
|
|
6
|
+
}
|
|
7
|
+
function ChevronRightIcon(props) {
|
|
8
|
+
return /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", ...props, children: /* @__PURE__ */ jsx("path", { d: "M3.5 1L7.5 5L3.5 9", stroke: "currentColor", strokeWidth: "1.5" }) });
|
|
9
|
+
}
|
|
10
|
+
function ArrowSvg(props) {
|
|
11
|
+
return /* @__PURE__ */ jsxs("svg", { "aria-hidden": "true", width: "20", height: "10", viewBox: "0 0 20 10", fill: "none", ...props, children: [
|
|
12
|
+
/* @__PURE__ */ jsx(
|
|
13
|
+
"path",
|
|
14
|
+
{
|
|
15
|
+
d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",
|
|
16
|
+
className: "fill-(--popup-surface,var(--surface-3))"
|
|
17
|
+
}
|
|
18
|
+
),
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"path",
|
|
21
|
+
{
|
|
22
|
+
d: "M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z",
|
|
23
|
+
className: "fill-border"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
"path",
|
|
28
|
+
{
|
|
29
|
+
d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z",
|
|
30
|
+
className: "fill-border"
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { ArrowSvg, ChevronDownIcon, ChevronRightIcon };
|
|
2
37
|
//# sourceMappingURL=navigation-menu-icons.mjs.map
|
|
3
38
|
//# sourceMappingURL=navigation-menu-icons.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"navigation-menu-icons.mjs"}
|
|
1
|
+
{"version":3,"sources":["../src/components/navigation-menu-icons.tsx"],"names":[],"mappings":";;AAEO,SAAS,gBAAgB,KAAA,EAAoC;AAClE,EAAA,uBACE,GAAA,CAAC,SAAI,aAAA,EAAY,MAAA,EAAO,OAAM,IAAA,EAAK,MAAA,EAAO,IAAA,EAAK,OAAA,EAAQ,WAAA,EAAY,IAAA,EAAK,QAAQ,GAAG,KAAA,EACjF,8BAAC,MAAA,EAAA,EAAK,CAAA,EAAE,sBAAqB,MAAA,EAAO,cAAA,EAAe,WAAA,EAAY,KAAA,EAAM,CAAA,EACvE,CAAA;AAEJ;AAEO,SAAS,iBAAiB,KAAA,EAAoC;AACnE,EAAA,uBACE,GAAA,CAAC,SAAI,aAAA,EAAY,MAAA,EAAO,OAAM,IAAA,EAAK,MAAA,EAAO,IAAA,EAAK,OAAA,EAAQ,WAAA,EAAY,IAAA,EAAK,QAAQ,GAAG,KAAA,EACjF,8BAAC,MAAA,EAAA,EAAK,CAAA,EAAE,sBAAqB,MAAA,EAAO,cAAA,EAAe,WAAA,EAAY,KAAA,EAAM,CAAA,EACvE,CAAA;AAEJ;AAEO,SAAS,SAAS,KAAA,EAAoC;AAC3D,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,aAAA,EAAY,MAAA,EAAO,KAAA,EAAM,IAAA,EAAK,MAAA,EAAO,IAAA,EAAK,OAAA,EAAQ,WAAA,EAAY,IAAA,EAAK,MAAA,EAAQ,GAAG,KAAA,EACjF,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,CAAA,EAAE,iMAAA;AAAA,QACF,SAAA,EAAU;AAAA;AAAA,KACZ;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,CAAA,EAAE,kSAAA;AAAA,QACF,SAAA,EAAU;AAAA;AAAA,KACZ;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,CAAA,EAAE,sTAAA;AAAA,QACF,SAAA,EAAU;AAAA;AAAA;AACZ,GAAA,EACF,CAAA;AAEJ","file":"navigation-menu-icons.mjs","sourcesContent":["import type * as React from 'react';\n\nexport function ChevronDownIcon(props: React.ComponentProps<'svg'>) {\n return (\n <svg aria-hidden=\"true\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" {...props}>\n <path d=\"M1 3.5L5 7.5L9 3.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n );\n}\n\nexport function ChevronRightIcon(props: React.ComponentProps<'svg'>) {\n return (\n <svg aria-hidden=\"true\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" {...props}>\n <path d=\"M3.5 1L7.5 5L3.5 9\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n );\n}\n\nexport function ArrowSvg(props: React.ComponentProps<'svg'>) {\n return (\n <svg aria-hidden=\"true\" width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\" {...props}>\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-(--popup-surface,var(--surface-3))\"\n />\n <path\n d=\"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z\"\n className=\"fill-border\"\n />\n <path\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n className=\"fill-border\"\n />\n </svg>\n );\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var classVarianceAuthority = require('class-variance-authority');
|
|
4
5
|
|
|
5
|
-
// src/components/navigation-menu-styles.ts
|
|
6
6
|
var navigationMenuTriggerStyle = classVarianceAuthority.cva(
|
|
7
7
|
"box-border flex items-center justify-center gap-1.5 h-10 px-2.5 xs:px-3 m-0 rounded-md text-foreground font-medium !text-[15px] leading-6 select-none no-underline hover:text-foreground data-[popup-open]:bg-black/[0.07] dark:data-[popup-open]:bg-white/[0.07] data-[popup-open]:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-ring focus-visible:relative"
|
|
8
8
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/navigation-menu-styles.ts"],"names":["cva"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/navigation-menu-styles.ts"],"names":["cva"],"mappings":";;;;AAOO,IAAM,0BAAA,GAA6BA,0BAAA;AAAA,EACxC;AACF;AAEO,IAAM,6BAAA,GAAgCA,0BAAA;AAAA,EAC3C;AACF","file":"navigation-menu-styles.js","sourcesContent":["import type { NavigationMenu as NavigationMenuPrimitive } from '@base-ui/react/navigation-menu';\nimport { cva } from 'class-variance-authority';\nimport type * as React from 'react';\nimport type { SurfaceLevel } from '../lib/surface.js';\n\ntype PositionerProps = React.ComponentProps<typeof NavigationMenuPrimitive.Positioner>;\n\nexport const navigationMenuTriggerStyle = cva(\n 'box-border flex items-center justify-center gap-1.5 h-10 px-2.5 xs:px-3 m-0 rounded-md text-foreground font-medium !text-[15px] leading-6 select-none no-underline hover:text-foreground data-[popup-open]:bg-black/[0.07] dark:data-[popup-open]:bg-white/[0.07] data-[popup-open]:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-ring focus-visible:relative',\n);\n\nexport const navigationMenuSubTriggerStyle = cva(\n 'w-full text-left relative block rounded-md p-2.5 xs:p-3 no-underline text-inherit hover:bg-black/[0.07] dark:hover:bg-white/[0.07] hover:text-foreground active:bg-black/[0.11] dark:active:bg-white/[0.11] focus-visible:relative focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-ring data-[popup-open]:bg-black/[0.07] dark:data-[popup-open]:bg-white/[0.07] data-[popup-open]:text-foreground',\n);\n\nexport interface NavigationMenuProps extends React.ComponentProps<typeof NavigationMenuPrimitive.Root> {\n side?: PositionerProps['side'];\n sideOffset?: PositionerProps['sideOffset'];\n align?: PositionerProps['align'];\n alignOffset?: PositionerProps['alignOffset'];\n collisionPadding?: PositionerProps['collisionPadding'];\n collisionBoundary?: PositionerProps['collisionBoundary'];\n positionMethod?: PositionerProps['positionMethod'];\n arrow?: boolean;\n /** Surface elevation level (1-8) for the bar. Defaults to 2 — subtle toolbar above the page. */\n level?: SurfaceLevel;\n /** Shadow weight (1-8) for the bar. Defaults to 2. */\n shadowLevel?: SurfaceLevel;\n}\n\nexport interface NavigationMenuLinkProps extends React.ComponentProps<typeof NavigationMenuPrimitive.Link> {\n /**\n * When true, applies trigger button styling for top-level navigation links\n */\n standalone?: boolean;\n}\n\nexport interface NavigationMenuViewportProps extends React.ComponentProps<typeof NavigationMenuPrimitive.Viewport> {\n side?: PositionerProps['side'];\n sideOffset?: PositionerProps['sideOffset'];\n align?: PositionerProps['align'];\n alignOffset?: PositionerProps['alignOffset'];\n collisionPadding?: PositionerProps['collisionPadding'];\n collisionBoundary?: PositionerProps['collisionBoundary'];\n positionMethod?: PositionerProps['positionMethod'];\n arrow?: boolean;\n}\n\nexport interface NavigationMenuSubProps extends React.ComponentProps<typeof NavigationMenuPrimitive.Root> {\n side?: PositionerProps['side'];\n sideOffset?: PositionerProps['sideOffset'];\n align?: PositionerProps['align'];\n alignOffset?: PositionerProps['alignOffset'];\n arrow?: boolean;\n}\n"]}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
var navigationMenuTriggerStyle = cva(
|
|
5
|
+
"box-border flex items-center justify-center gap-1.5 h-10 px-2.5 xs:px-3 m-0 rounded-md text-foreground font-medium !text-[15px] leading-6 select-none no-underline hover:text-foreground data-[popup-open]:bg-black/[0.07] dark:data-[popup-open]:bg-white/[0.07] data-[popup-open]:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-ring focus-visible:relative"
|
|
6
|
+
);
|
|
7
|
+
var navigationMenuSubTriggerStyle = cva(
|
|
8
|
+
"w-full text-left relative block rounded-md p-2.5 xs:p-3 no-underline text-inherit hover:bg-black/[0.07] dark:hover:bg-white/[0.07] hover:text-foreground active:bg-black/[0.11] dark:active:bg-white/[0.11] focus-visible:relative focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-ring data-[popup-open]:bg-black/[0.07] dark:data-[popup-open]:bg-white/[0.07] data-[popup-open]:text-foreground"
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export { navigationMenuSubTriggerStyle, navigationMenuTriggerStyle };
|
|
2
12
|
//# sourceMappingURL=navigation-menu-styles.mjs.map
|
|
3
13
|
//# sourceMappingURL=navigation-menu-styles.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"navigation-menu-styles.mjs"}
|
|
1
|
+
{"version":3,"sources":["../src/components/navigation-menu-styles.ts"],"names":[],"mappings":";;AAOO,IAAM,0BAAA,GAA6B,GAAA;AAAA,EACxC;AACF;AAEO,IAAM,6BAAA,GAAgC,GAAA;AAAA,EAC3C;AACF","file":"navigation-menu-styles.mjs","sourcesContent":["import type { NavigationMenu as NavigationMenuPrimitive } from '@base-ui/react/navigation-menu';\nimport { cva } from 'class-variance-authority';\nimport type * as React from 'react';\nimport type { SurfaceLevel } from '../lib/surface.js';\n\ntype PositionerProps = React.ComponentProps<typeof NavigationMenuPrimitive.Positioner>;\n\nexport const navigationMenuTriggerStyle = cva(\n 'box-border flex items-center justify-center gap-1.5 h-10 px-2.5 xs:px-3 m-0 rounded-md text-foreground font-medium !text-[15px] leading-6 select-none no-underline hover:text-foreground data-[popup-open]:bg-black/[0.07] dark:data-[popup-open]:bg-white/[0.07] data-[popup-open]:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-ring focus-visible:relative',\n);\n\nexport const navigationMenuSubTriggerStyle = cva(\n 'w-full text-left relative block rounded-md p-2.5 xs:p-3 no-underline text-inherit hover:bg-black/[0.07] dark:hover:bg-white/[0.07] hover:text-foreground active:bg-black/[0.11] dark:active:bg-white/[0.11] focus-visible:relative focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-ring data-[popup-open]:bg-black/[0.07] dark:data-[popup-open]:bg-white/[0.07] data-[popup-open]:text-foreground',\n);\n\nexport interface NavigationMenuProps extends React.ComponentProps<typeof NavigationMenuPrimitive.Root> {\n side?: PositionerProps['side'];\n sideOffset?: PositionerProps['sideOffset'];\n align?: PositionerProps['align'];\n alignOffset?: PositionerProps['alignOffset'];\n collisionPadding?: PositionerProps['collisionPadding'];\n collisionBoundary?: PositionerProps['collisionBoundary'];\n positionMethod?: PositionerProps['positionMethod'];\n arrow?: boolean;\n /** Surface elevation level (1-8) for the bar. Defaults to 2 — subtle toolbar above the page. */\n level?: SurfaceLevel;\n /** Shadow weight (1-8) for the bar. Defaults to 2. */\n shadowLevel?: SurfaceLevel;\n}\n\nexport interface NavigationMenuLinkProps extends React.ComponentProps<typeof NavigationMenuPrimitive.Link> {\n /**\n * When true, applies trigger button styling for top-level navigation links\n */\n standalone?: boolean;\n}\n\nexport interface NavigationMenuViewportProps extends React.ComponentProps<typeof NavigationMenuPrimitive.Viewport> {\n side?: PositionerProps['side'];\n sideOffset?: PositionerProps['sideOffset'];\n align?: PositionerProps['align'];\n alignOffset?: PositionerProps['alignOffset'];\n collisionPadding?: PositionerProps['collisionPadding'];\n collisionBoundary?: PositionerProps['collisionBoundary'];\n positionMethod?: PositionerProps['positionMethod'];\n arrow?: boolean;\n}\n\nexport interface NavigationMenuSubProps extends React.ComponentProps<typeof NavigationMenuPrimitive.Root> {\n side?: PositionerProps['side'];\n sideOffset?: PositionerProps['sideOffset'];\n align?: PositionerProps['align'];\n alignOffset?: PositionerProps['alignOffset'];\n arrow?: boolean;\n}\n"]}
|
package/dist/navigation-menu.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var navigationMenu = require('@base-ui/react/navigation-menu');
|
|
@@ -6,8 +7,6 @@ var tailwindMerge = require('tailwind-merge');
|
|
|
6
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
8
|
var classVarianceAuthority = require('class-variance-authority');
|
|
8
9
|
|
|
9
|
-
// src/components/navigation-menu.tsx
|
|
10
|
-
|
|
11
10
|
// src/lib/surface.ts
|
|
12
11
|
var SURFACE_BG = {
|
|
13
12
|
1: "bg-surface-1",
|