@nayhoo/ui 0.16.0 → 0.17.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.
@@ -0,0 +1,91 @@
1
+ import {
2
+ sprinkles
3
+ } from "../chunk-Z6RQ453R.mjs";
4
+ import "../chunk-O62XWWJU.mjs";
5
+ import "../chunk-KH7OG63I.mjs";
6
+ import "../chunk-C4NLMHMQ.mjs";
7
+ import "../chunk-DXKT5AFF.mjs";
8
+ import "../chunk-Y6BNWBLR.mjs";
9
+ import "../chunk-NOIOHUNH.mjs";
10
+ import "../chunk-JGZLOTH3.mjs";
11
+ import "../chunk-P3OUEGR4.mjs";
12
+ import "../chunk-5WJ4KGIE.mjs";
13
+ import "../chunk-WUVNL3DI.mjs";
14
+ import "../chunk-S6KKPOPH.mjs";
15
+ import "../chunk-AXOHCT5Q.mjs";
16
+ import "../chunk-KE7EIF6L.mjs";
17
+ import "../chunk-JZBPCPSP.mjs";
18
+ import "../chunk-HNVVD3WS.mjs";
19
+ import "../chunk-DOHVBMXO.mjs";
20
+ import "../chunk-P2VEMZGS.mjs";
21
+ import "../chunk-EXKRRQYL.mjs";
22
+ import {
23
+ theme
24
+ } from "../chunk-N535ABFC.mjs";
25
+ import "../chunk-GHCXVMQR.mjs";
26
+ import {
27
+ Box
28
+ } from "../chunk-LSB5JVS2.mjs";
29
+ import "../chunk-OI24WXH6.mjs";
30
+ import "../chunk-4A7WL3BM.mjs";
31
+ import "../chunk-47YGQSLM.mjs";
32
+ import "../chunk-6RSPMV3B.mjs";
33
+ import "../chunk-IFN22XIN.mjs";
34
+ import "../chunk-5ZOT2LOO.mjs";
35
+ import {
36
+ Container
37
+ } from "../chunk-IKDQWTMS.mjs";
38
+ import "../chunk-PUW3KNR3.mjs";
39
+ import "../chunk-UPZYS6TE.mjs";
40
+ import "../chunk-7EGQM3ZL.mjs";
41
+
42
+ // src/patterns/nav.tsx
43
+ import { useScrollPosition } from "@nayhoo/hooks";
44
+ import { jsx } from "react/jsx-runtime";
45
+ var Nav = ({
46
+ children,
47
+ variant = "fixed",
48
+ fullWidth = false,
49
+ compact = false
50
+ }) => {
51
+ const scrollPosition = useScrollPosition();
52
+ const isScrolled = scrollPosition > 24;
53
+ return /* @__PURE__ */ jsx(
54
+ Box,
55
+ {
56
+ asChild: true,
57
+ className: sprinkles({
58
+ paddingY: {
59
+ initial: void 0,
60
+ xs: isScrolled || compact ? void 0 : 2
61
+ }
62
+ }),
63
+ style: {
64
+ borderBottom: "1px solid",
65
+ borderColor: isScrolled || compact ? theme.semanticColors.line : "transparent",
66
+ position: variant,
67
+ top: 0,
68
+ transition: "border-color 0.4s, padding 0.4s",
69
+ width: "100%",
70
+ zIndex: theme.zIndices[1],
71
+ backgroundColor: `color-mix(in srgb, ${theme.semanticColors.background}, transparent 40%)`,
72
+ backdropFilter: "blur(10px)"
73
+ },
74
+ children: /* @__PURE__ */ jsx("nav", { children: /* @__PURE__ */ jsx(
75
+ Container,
76
+ {
77
+ size: fullWidth ? "4" : "3",
78
+ style: {
79
+ padding: theme.space[2],
80
+ width: "100%"
81
+ },
82
+ children
83
+ }
84
+ ) })
85
+ }
86
+ );
87
+ };
88
+ export {
89
+ Nav
90
+ };
91
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/patterns/nav.tsx"],"sourcesContent":["import { Box } from \"@/components/box\";\nimport { Container } from \"@/components/container\";\nimport { sprinkles, theme } from \"@/theme\";\nimport { useScrollPosition } from \"@nayhoo/hooks\";\n\n/** Common Nav component for Nayhoo apps */\nexport const Nav = ({\n children,\n variant = \"fixed\",\n fullWidth = false,\n compact = false,\n}: {\n children: React.ReactNode;\n variant?: \"fixed\" | \"sticky\";\n fullWidth?: boolean;\n compact?: boolean;\n}) => {\n const scrollPosition = useScrollPosition();\n\n const isScrolled = scrollPosition > 24;\n\n return (\n <Box\n asChild\n className={sprinkles({\n paddingY: {\n initial: undefined,\n xs: isScrolled || compact ? undefined : 2,\n },\n })}\n style={{\n borderBottom: \"1px solid\",\n borderColor:\n isScrolled || compact ? theme.semanticColors.line : \"transparent\",\n position: variant,\n top: 0,\n transition: \"border-color 0.4s, padding 0.4s\",\n width: \"100%\",\n zIndex: theme.zIndices[1],\n backgroundColor: `color-mix(in srgb, ${theme.semanticColors.background}, transparent 40%)`,\n backdropFilter: \"blur(10px)\",\n }}\n >\n <nav>\n <Container\n size={fullWidth ? \"4\" : \"3\"}\n style={{\n padding: theme.space[2],\n width: \"100%\",\n }}\n >\n {children}\n </Container>\n </nav>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAAS,yBAAyB;AAyC1B;AAtCD,IAAM,MAAM,CAAC;AAAA,EAClB;AAAA,EACA,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,UAAU;AACZ,MAKM;AACJ,QAAM,iBAAiB,kBAAkB;AAEzC,QAAM,aAAa,iBAAiB;AAEpC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAO;AAAA,MACP,WAAW,UAAU;AAAA,QACnB,UAAU;AAAA,UACR,SAAS;AAAA,UACT,IAAI,cAAc,UAAU,SAAY;AAAA,QAC1C;AAAA,MACF,CAAC;AAAA,MACD,OAAO;AAAA,QACL,cAAc;AAAA,QACd,aACE,cAAc,UAAU,MAAM,eAAe,OAAO;AAAA,QACtD,UAAU;AAAA,QACV,KAAK;AAAA,QACL,YAAY;AAAA,QACZ,OAAO;AAAA,QACP,QAAQ,MAAM,SAAS,CAAC;AAAA,QACxB,iBAAiB,sBAAsB,MAAM,eAAe,UAAU;AAAA,QACtE,gBAAgB;AAAA,MAClB;AAAA,MAEA,8BAAC,SACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,YAAY,MAAM;AAAA,UACxB,OAAO;AAAA,YACL,SAAS,MAAM,MAAM,CAAC;AAAA,YACtB,OAAO;AAAA,UACT;AAAA,UAEC;AAAA;AAAA,MACH,GACF;AAAA;AAAA,EACF;AAEJ;","names":[]}