@r_masseater/masseater-utils 0.6.1 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -22
- package/dist/browser-test/vite.d.mts +6 -0
- package/dist/browser-test/vite.mjs +29 -0
- package/dist/browser-test/vite.mjs.map +1 -0
- package/dist/button-variants-BLMlMm-s.mjs +31 -0
- package/dist/button-variants-BLMlMm-s.mjs.map +1 -0
- package/dist/button-variants-Bupz7GI3.d.mts +6 -0
- package/dist/cn-DtxpfSUK.mjs +7 -0
- package/dist/cn-DtxpfSUK.mjs.map +1 -0
- package/dist/effect2cs.d.mts +27 -0
- package/dist/effect2cs.mjs +75 -0
- package/dist/effect2cs.mjs.map +1 -0
- package/dist/effect2rs.d.mts +52 -0
- package/dist/effect2rs.mjs +870 -0
- package/dist/effect2rs.mjs.map +1 -0
- package/dist/github-workflow.d.mts +3 -33
- package/dist/github-workflow.mjs +2 -46
- package/dist/github-workflow.mjs.map +1 -1
- package/dist/headers-BK-aW9Kw.d.mts +81 -0
- package/dist/headers-Cr6gAurg.mjs +115 -0
- package/dist/headers-Cr6gAurg.mjs.map +1 -0
- package/dist/heading-class-CDq0WZpR.d.mts +10 -0
- package/dist/heading-class-H4Z13Bpn.mjs +14 -0
- package/dist/heading-class-H4Z13Bpn.mjs.map +1 -0
- package/dist/index-BkZOsFv4.d.mts +139 -0
- package/dist/index-CLb1-l_c.d.mts +28 -0
- package/dist/index-ChbPLmqu.d.mts +33 -0
- package/dist/lapse/sdk.d.mts +4 -0
- package/dist/lapse/sdk.mjs +11 -0
- package/dist/lapse/sdk.mjs.map +1 -0
- package/dist/lapse.d.mts +8 -0
- package/dist/lapse.mjs +43 -0
- package/dist/lapse.mjs.map +1 -0
- package/dist/local-server/node.d.mts +21 -0
- package/dist/local-server/node.mjs +81 -0
- package/dist/local-server/node.mjs.map +1 -0
- package/dist/local-server/serve.d.mts +9 -0
- package/dist/local-server/serve.mjs +13 -0
- package/dist/local-server/serve.mjs.map +1 -0
- package/dist/local-server.d.mts +19 -0
- package/dist/local-server.mjs +36 -0
- package/dist/local-server.mjs.map +1 -0
- package/dist/portfolio-BQJtJtfK.mjs +45 -0
- package/dist/portfolio-BQJtJtfK.mjs.map +1 -0
- package/dist/process-_W_7DeKe.d.mts +34 -0
- package/dist/process-lKS6nYWh.mjs +49 -0
- package/dist/process-lKS6nYWh.mjs.map +1 -0
- package/dist/process.d.mts +2 -0
- package/dist/process.mjs +1 -0
- package/dist/security-headers/http.d.mts +10 -0
- package/dist/security-headers/http.mjs +25 -0
- package/dist/security-headers/http.mjs.map +1 -0
- package/dist/security-headers/request.d.mts +3 -0
- package/dist/security-headers/request.mjs +15 -0
- package/dist/security-headers/request.mjs.map +1 -0
- package/dist/security-headers/response.d.mts +2 -0
- package/dist/security-headers/response.mjs +17 -0
- package/dist/security-headers/response.mjs.map +1 -0
- package/dist/security-headers/static.d.mts +2 -0
- package/dist/security-headers/static.mjs +1 -0
- package/dist/security-headers/vite.d.mts +2 -0
- package/dist/security-headers/vite.mjs +1 -0
- package/dist/security-headers.d.mts +3 -0
- package/dist/security-headers.mjs +3 -0
- package/dist/socket-port-CTg-qfiP.mjs +20 -0
- package/dist/socket-port-CTg-qfiP.mjs.map +1 -0
- package/dist/static-page-headers-_B0WGkew.mjs +133 -0
- package/dist/static-page-headers-_B0WGkew.mjs.map +1 -0
- package/dist/sync-BkyZGGDA.mjs +121 -0
- package/dist/sync-BkyZGGDA.mjs.map +1 -0
- package/dist/table-class-BeiCXlFj.d.mts +14 -0
- package/dist/table-class-RQvT6MYy.mjs +21 -0
- package/dist/table-class-RQvT6MYy.mjs.map +1 -0
- package/dist/ui/backdrop-palette.d.mts +10 -0
- package/dist/ui/backdrop-palette.mjs +13 -0
- package/dist/ui/backdrop-palette.mjs.map +1 -0
- package/dist/ui/badge.d.mts +12 -0
- package/dist/ui/badge.mjs +18 -0
- package/dist/ui/badge.mjs.map +1 -0
- package/dist/ui/browser-runtime.d.mts +3 -0
- package/dist/ui/browser-runtime.mjs +18 -0
- package/dist/ui/browser-runtime.mjs.map +1 -0
- package/dist/ui/button-variants.d.mts +2 -0
- package/dist/ui/button-variants.mjs +1 -0
- package/dist/ui/button.d.mts +7 -0
- package/dist/ui/button.mjs +30 -0
- package/dist/ui/button.mjs.map +1 -0
- package/dist/ui/cn.d.mts +3 -0
- package/dist/ui/cn.mjs +1 -0
- package/dist/ui/color-scheme.d.mts +2 -0
- package/dist/ui/color-scheme.mjs +13 -0
- package/dist/ui/color-scheme.mjs.map +1 -0
- package/dist/ui/heading-class.d.mts +2 -0
- package/dist/ui/heading-class.mjs +1 -0
- package/dist/ui/heading.d.mts +8 -0
- package/dist/ui/heading.mjs +34 -0
- package/dist/ui/heading.mjs.map +1 -0
- package/dist/ui/input-class.d.mts +2 -0
- package/dist/ui/input-class.mjs +5 -0
- package/dist/ui/input-class.mjs.map +1 -0
- package/dist/ui/native-select-class.d.mts +2 -0
- package/dist/ui/native-select-class.mjs +5 -0
- package/dist/ui/native-select-class.mjs.map +1 -0
- package/dist/ui/next-page-trigger.d.mts +5 -0
- package/dist/ui/next-page-trigger.mjs +29 -0
- package/dist/ui/next-page-trigger.mjs.map +1 -0
- package/dist/ui/page-footer.d.mts +10 -0
- package/dist/ui/page-footer.mjs +24 -0
- package/dist/ui/page-footer.mjs.map +1 -0
- package/dist/ui/page-header.d.mts +11 -0
- package/dist/ui/page-header.mjs +22 -0
- package/dist/ui/page-header.mjs.map +1 -0
- package/dist/ui/pointer.d.mts +14 -0
- package/dist/ui/pointer.mjs +51 -0
- package/dist/ui/pointer.mjs.map +1 -0
- package/dist/ui/portfolio.d.mts +31 -0
- package/dist/ui/portfolio.mjs +1 -0
- package/dist/ui/table-class.d.mts +2 -0
- package/dist/ui/table-class.mjs +1 -0
- package/dist/ui/table.d.mts +30 -0
- package/dist/ui/table.mjs +64 -0
- package/dist/ui/table.mjs.map +1 -0
- package/dist/ui/to-wavy-letters.d.mts +12 -0
- package/dist/ui/to-wavy-letters.mjs +9 -0
- package/dist/ui/to-wavy-letters.mjs.map +1 -0
- package/dist/ui/web-analytics.d.mts +18 -0
- package/dist/ui/web-analytics.mjs +19 -0
- package/dist/ui/web-analytics.mjs.map +1 -0
- package/dist/web-analytics-BM9LdncT.d.mts +4 -0
- package/dist/web-analytics-Bz6nyJmQ.mjs +6 -0
- package/dist/web-analytics-Bz6nyJmQ.mjs.map +1 -0
- package/dist/yohaku-protocol/sync.d.mts +2 -0
- package/dist/yohaku-protocol/sync.mjs +1 -0
- package/dist/yohaku-protocol.d.mts +2 -0
- package/dist/yohaku-protocol.mjs +1 -0
- package/package.json +131 -4
- package/skills/share-types-with-rust/SKILL.md +90 -0
- package/src/app/browser-test-fonts.conf +28 -0
- package/src/app/ui-styles.css +185 -0
- package/src/app/ui-theme.css +81 -0
- package/src/app/ui-view-transition.css +5 -0
- package/src/shared/lib/button-variants.ts +33 -0
- package/src/shared/lib/input-class.ts +2 -0
- package/src/shared/lib/native-select-class.ts +2 -0
- package/src/shared/lib/table-class.ts +35 -0
- package/src/shared/ui/badge.tsx +29 -0
- package/src/shared/ui/button.tsx +39 -0
- package/src/shared/ui/heading.tsx +38 -0
- package/src/shared/ui/next-page-trigger.tsx +34 -0
- package/src/shared/ui/page-footer.tsx +34 -0
- package/src/shared/ui/page-header.tsx +29 -0
- package/src/shared/ui/table/column-headings.tsx +30 -0
- package/src/shared/ui/table/index.ts +10 -0
- package/src/shared/ui/table/table-body.tsx +8 -0
- package/src/shared/ui/table/table-caption.tsx +8 -0
- package/src/shared/ui/table/table-cell.tsx +8 -0
- package/src/shared/ui/table/table-head.tsx +13 -0
- package/src/shared/ui/table/table-header.tsx +8 -0
- package/src/shared/ui/table/table-row.tsx +8 -0
- package/src/shared/ui/table/table.tsx +31 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
|
+
type BadgeStyle<Variant extends string> = Readonly<{
|
|
3
|
+
base: string;
|
|
4
|
+
variants: Readonly<Record<Variant, string>>;
|
|
5
|
+
fallback: NoInfer<Variant>;
|
|
6
|
+
}>;
|
|
7
|
+
type BadgeProps<Variant extends string> = ComponentProps<"span"> & Readonly<{
|
|
8
|
+
variant?: Variant | null | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const badgeOf: <Variant extends string>(style: BadgeStyle<Variant>) => ((props: BadgeProps<Variant>) => ReactNode);
|
|
11
|
+
export type { BadgeProps, BadgeStyle };
|
|
12
|
+
//# sourceMappingURL=badge.d.mts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { t as cn } from "../cn-DtxpfSUK.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/shared/ui/badge.tsx
|
|
4
|
+
const badgeOf = (style) => {
|
|
5
|
+
const Badge = ({ className, variant, ...props }) => {
|
|
6
|
+
const kind = variant ?? style.fallback;
|
|
7
|
+
return /* @__PURE__ */ jsx("span", {
|
|
8
|
+
"data-slot": "badge",
|
|
9
|
+
"data-variant": kind,
|
|
10
|
+
className: cn(style.base, style.variants[kind], className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
return Badge;
|
|
15
|
+
};
|
|
16
|
+
export { badgeOf };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=badge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.mjs","names":[],"sources":["../../src/shared/ui/badge.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from \"react\";\n\nimport { cn } from \"#/shared/lib/cn.ts\";\n\nexport type BadgeStyle<Variant extends string> = Readonly<{\n base: string;\n variants: Readonly<Record<Variant, string>>;\n fallback: NoInfer<Variant>;\n}>;\n\nexport type BadgeProps<Variant extends string> = ComponentProps<\"span\"> &\n Readonly<{ variant?: Variant | null | undefined }>;\n\nexport const badgeOf = <Variant extends string>(\n style: BadgeStyle<Variant>,\n): ((props: BadgeProps<Variant>) => ReactNode) => {\n const Badge = ({ className, variant, ...props }: BadgeProps<Variant>): ReactNode => {\n const kind = variant ?? style.fallback;\n return (\n <span\n data-slot=\"badge\"\n data-variant={kind}\n className={cn(style.base, style.variants[kind], className)}\n {...props}\n />\n );\n };\n return Badge;\n};\n"],"mappings":";;;AAaA,MAAa,WACX,UACgD;CAChD,MAAM,SAAS,EAAE,WAAW,SAAS,GAAG,YAA4C;EAClF,MAAM,OAAO,WAAW,MAAM;EAC9B,OACE,oBAAC,QAAD;GACE,aAAU;GACV,gBAAc;GACd,WAAW,GAAG,MAAM,MAAM,MAAM,SAAS,OAAO,SAAS;GACzD,GAAI;EACL,CAAA;CAEL;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { r as tracesUrl, t as portfolio } from "../portfolio-BQJtJtfK.mjs";
|
|
2
|
+
import { Duration, Effect, Layer, ManagedRuntime } from "effect";
|
|
3
|
+
import { FetchHttpClient } from "effect/http";
|
|
4
|
+
import { OtlpSerialization, OtlpTracer } from "effect/observability";
|
|
5
|
+
// src/shared/lib/browser-runtime.ts
|
|
6
|
+
const EXPORT_INTERVAL = Duration.fromInputUnsafe("2 seconds");
|
|
7
|
+
const MAX_BATCH = 64;
|
|
8
|
+
const keepAlive = Layer.succeed(FetchHttpClient.RequestInit, { keepalive: true });
|
|
9
|
+
const browserTelemetry = Layer.unwrap(Effect.sync(() => OtlpTracer.layer({
|
|
10
|
+
url: tracesUrl(globalThis.location.href),
|
|
11
|
+
resource: { serviceName: portfolio.traces.service },
|
|
12
|
+
exportInterval: EXPORT_INTERVAL,
|
|
13
|
+
maxBatchSize: MAX_BATCH
|
|
14
|
+
}))).pipe(Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer), Layer.provide(keepAlive));
|
|
15
|
+
const browserRuntime = ManagedRuntime.make(browserTelemetry);
|
|
16
|
+
export { browserRuntime };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=browser-runtime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-runtime.mjs","names":[],"sources":["../../src/shared/lib/browser-runtime.ts"],"sourcesContent":["import { Duration, Effect, Layer, ManagedRuntime } from \"effect\";\nimport { FetchHttpClient } from \"effect/http\";\nimport { OtlpSerialization, OtlpTracer } from \"effect/observability\";\n\nimport { portfolio, tracesUrl } from \"#/shared/lib/portfolio.ts\";\n\nconst EXPORT_INTERVAL = Duration.fromInputUnsafe(\"2 seconds\");\nconst MAX_BATCH = 64;\n\nconst keepAlive = Layer.succeed(FetchHttpClient.RequestInit, { keepalive: true });\n\nconst tracer = Layer.unwrap(\n Effect.sync(() =>\n OtlpTracer.layer({\n url: tracesUrl(globalThis.location.href),\n resource: { serviceName: portfolio.traces.service },\n exportInterval: EXPORT_INTERVAL,\n maxBatchSize: MAX_BATCH,\n }),\n ),\n);\n\nconst browserTelemetry = tracer.pipe(\n Layer.provide(OtlpSerialization.layerJson),\n Layer.provide(FetchHttpClient.layer),\n Layer.provide(keepAlive),\n);\n\nexport const browserRuntime = ManagedRuntime.make(browserTelemetry);\n"],"mappings":";;;;;AAMA,MAAM,kBAAkB,SAAS,gBAAgB,WAAW;AAC5D,MAAM,YAAY;AAElB,MAAM,YAAY,MAAM,QAAQ,gBAAgB,aAAa,EAAE,WAAW,KAAK,CAAC;AAahF,MAAM,mBAXS,MAAM,OACnB,OAAO,WACL,WAAW,MAAM;CACf,KAAK,UAAU,WAAW,SAAS,IAAI;CACvC,UAAU,EAAE,aAAa,UAAU,OAAO,QAAQ;CAClD,gBAAgB;CAChB,cAAc;AAChB,CAAC,CACH,CAG4B,CAAC,CAAC,KAC9B,MAAM,QAAQ,kBAAkB,SAAS,GACzC,MAAM,QAAQ,gBAAgB,KAAK,GACnC,MAAM,QAAQ,SAAS,CACzB;AAEA,MAAa,iBAAiB,eAAe,KAAK,gBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as buttonVariants } from "../button-variants-BLMlMm-s.mjs";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { t as buttonVariants } from "../button-variants-Bupz7GI3.mjs";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
|
+
export declare const Button: ({ className, variant, size, asChild, ...props }: ComponentProps<"button"> & Readonly<VariantProps<typeof buttonVariants>> & Readonly<{
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
}>) => ReactNode;
|
|
7
|
+
//# sourceMappingURL=button.d.mts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { t as buttonVariants } from "../button-variants-BLMlMm-s.mjs";
|
|
2
|
+
import { t as cn } from "../cn-DtxpfSUK.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Slot } from "radix-ui";
|
|
5
|
+
// src/shared/ui/button.tsx
|
|
6
|
+
const Button = ({ className, variant = "default", size = "default", asChild = false, ...props }) => {
|
|
7
|
+
const classes = cn(buttonVariants({
|
|
8
|
+
variant,
|
|
9
|
+
size,
|
|
10
|
+
className
|
|
11
|
+
}));
|
|
12
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot.Root, {
|
|
13
|
+
"data-slot": "button",
|
|
14
|
+
"data-variant": variant,
|
|
15
|
+
"data-size": size,
|
|
16
|
+
className: classes,
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ jsx("button", {
|
|
20
|
+
type: "button",
|
|
21
|
+
"data-slot": "button",
|
|
22
|
+
"data-variant": variant,
|
|
23
|
+
"data-size": size,
|
|
24
|
+
className: classes,
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export { Button };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.mjs","names":[],"sources":["../../src/shared/ui/button.tsx"],"sourcesContent":["import type { VariantProps } from \"class-variance-authority\";\nimport { Slot } from \"radix-ui\";\nimport type { ComponentProps, ReactNode } from \"react\";\n\nimport { buttonVariants } from \"#/shared/lib/button-variants.ts\";\nimport { cn } from \"#/shared/lib/cn.ts\";\n\nexport const Button = ({\n className,\n variant = \"default\",\n size = \"default\",\n asChild = false,\n ...props\n}: ComponentProps<\"button\"> &\n Readonly<VariantProps<typeof buttonVariants>> &\n Readonly<{ asChild?: boolean }>): ReactNode => {\n const classes = cn(buttonVariants({ variant, size, className }));\n if (asChild) {\n return (\n <Slot.Root\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={classes}\n {...props}\n />\n );\n }\n return (\n <button\n type=\"button\"\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={classes}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;AAOA,MAAa,UAAU,EACrB,WACA,UAAU,WACV,OAAO,WACP,UAAU,OACV,GAAG,YAG4C;CAC/C,MAAM,UAAU,GAAG,eAAe;EAAE;EAAS;EAAM;CAAU,CAAC,CAAC;CAC/D,IAAI,SACF,OACE,oBAAC,KAAK,MAAN;EACE,aAAU;EACV,gBAAc;EACd,aAAW;EACX,WAAW;EACX,GAAI;CACL,CAAA;CAGL,OACE,oBAAC,UAAD;EACE,MAAK;EACL,aAAU;EACV,gBAAc;EACd,aAAW;EACX,WAAW;EACX,GAAI;CACL,CAAA;AAEL"}
|
package/dist/ui/cn.d.mts
ADDED
package/dist/ui/cn.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as cn } from "../cn-DtxpfSUK.mjs";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/shared/lib/color-scheme.ts
|
|
2
|
+
const DARK = "(prefers-color-scheme: dark)";
|
|
3
|
+
const followColorScheme = () => {
|
|
4
|
+
const query = globalThis.matchMedia(DARK);
|
|
5
|
+
const apply = () => {
|
|
6
|
+
document.documentElement.classList.toggle("dark", query.matches);
|
|
7
|
+
};
|
|
8
|
+
apply();
|
|
9
|
+
query.addEventListener("change", apply);
|
|
10
|
+
};
|
|
11
|
+
export { followColorScheme };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=color-scheme.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-scheme.mjs","names":[],"sources":["../../src/shared/lib/color-scheme.ts"],"sourcesContent":["const DARK = \"(prefers-color-scheme: dark)\";\n\nexport const followColorScheme = (): void => {\n const query = globalThis.matchMedia(DARK);\n const apply = (): void => {\n document.documentElement.classList.toggle(\"dark\", query.matches);\n };\n apply();\n query.addEventListener(\"change\", apply);\n};\n"],"mappings":";AAAA,MAAM,OAAO;AAEb,MAAa,0BAAgC;CAC3C,MAAM,QAAQ,WAAW,WAAW,IAAI;CACxC,MAAM,cAAoB;EACxB,SAAS,gBAAgB,UAAU,OAAO,QAAQ,MAAM,OAAO;CACjE;CACA,MAAM;CACN,MAAM,iBAAiB,UAAU,KAAK;AACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as HEADING_MARK_CLASS, n as headingCountVariants, r as headingVariants } from "../heading-class-H4Z13Bpn.mjs";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { n as HeadingVariant } from "../heading-class-CDq0WZpR.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export declare const Heading: ({ variant, count, children }: Readonly<{
|
|
4
|
+
variant: HeadingVariant;
|
|
5
|
+
count?: number | string | undefined;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}>) => ReactNode;
|
|
8
|
+
//# sourceMappingURL=heading.d.mts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { n as headingCountVariants, r as headingVariants, t as HEADING_MARK_CLASS } from "../heading-class-H4Z13Bpn.mjs";
|
|
2
|
+
import { Option } from "effect";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/shared/ui/heading.tsx
|
|
5
|
+
const Count = ({ variant, value }) => Option.match(Option.fromUndefinedOr(value), {
|
|
6
|
+
onNone: () => false,
|
|
7
|
+
onSome: (shown) => /* @__PURE__ */ jsx("span", {
|
|
8
|
+
className: headingCountVariants({ variant }),
|
|
9
|
+
children: shown
|
|
10
|
+
})
|
|
11
|
+
});
|
|
12
|
+
const MARKS = {
|
|
13
|
+
marked: /* @__PURE__ */ jsx("span", {
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
className: HEADING_MARK_CLASS,
|
|
16
|
+
"data-slot": "heading-mark"
|
|
17
|
+
}),
|
|
18
|
+
ruled: false
|
|
19
|
+
};
|
|
20
|
+
const Heading = ({ variant, count, children }) => /* @__PURE__ */ jsxs("h2", {
|
|
21
|
+
className: headingVariants({ variant }),
|
|
22
|
+
"data-slot": "heading",
|
|
23
|
+
children: [
|
|
24
|
+
MARKS[variant],
|
|
25
|
+
children,
|
|
26
|
+
/* @__PURE__ */ jsx(Count, {
|
|
27
|
+
variant,
|
|
28
|
+
value: count
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
export { Heading };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=heading.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.mjs","names":[],"sources":["../../src/shared/ui/heading.tsx"],"sourcesContent":["import { Option } from \"effect\";\nimport type { ReactNode } from \"react\";\n\nimport {\n HEADING_MARK_CLASS,\n headingCountVariants,\n headingVariants,\n} from \"#/shared/lib/heading-class.ts\";\nimport type { HeadingVariant } from \"#/shared/lib/heading-class.ts\";\n\nconst Count = ({\n variant,\n value,\n}: Readonly<{ variant: HeadingVariant; value: number | string | undefined }>): ReactNode =>\n Option.match(Option.fromUndefinedOr(value), {\n onNone: () => false,\n onSome: (shown) => <span className={headingCountVariants({ variant })}>{shown}</span>,\n });\n\nconst MARK = <span aria-hidden=\"true\" className={HEADING_MARK_CLASS} data-slot=\"heading-mark\" />;\n\nconst MARKS = { marked: MARK, ruled: false } as const satisfies Record<HeadingVariant, ReactNode>;\n\nexport const Heading = ({\n variant,\n count,\n children,\n}: Readonly<{\n variant: HeadingVariant;\n count?: number | string | undefined;\n children: ReactNode;\n}>): ReactNode => (\n <h2 className={headingVariants({ variant })} data-slot=\"heading\">\n {MARKS[variant]}\n {children}\n <Count variant={variant} value={count} />\n </h2>\n);\n"],"mappings":";;;;AAUA,MAAM,SAAS,EACb,SACA,YAEA,OAAO,MAAM,OAAO,gBAAgB,KAAK,GAAG;CAC1C,cAAc;CACd,SAAS,UAAU,oBAAC,QAAD;EAAM,WAAW,qBAAqB,EAAE,QAAQ,CAAC;EAAI,UAAA;CAAY,CAAA;AACtF,CAAC;AAIH,MAAM,QAAQ;CAAE,QAAQ,oBAFV,QAAD;EAAM,eAAY;EAAO,WAAW;EAAoB,aAAU;CAAgB,CAEpE;CAAG,OAAO;AAAM;AAE3C,MAAa,WAAW,EACtB,SACA,OACA,eAMA,qBAAC,MAAD;CAAI,WAAW,gBAAgB,EAAE,QAAQ,CAAC;CAAG,aAAU;CAAvD,UAAA;EACG,MAAM;EACN;EACD,oBAAC,OAAD;GAAgB;GAAS,OAAO;EAAQ,CAAA;CACtC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const INPUT_CLASS = "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40";
|
|
2
|
+
//# sourceMappingURL=input-class.d.mts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// src/shared/lib/input-class.ts
|
|
2
|
+
const INPUT_CLASS = "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40";
|
|
3
|
+
export { INPUT_CLASS };
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=input-class.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-class.mjs","names":[],"sources":["../../src/shared/lib/input-class.ts"],"sourcesContent":["export const INPUT_CLASS =\n \"h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40\";\n"],"mappings":";AAAA,MAAa,cACX"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// src/shared/lib/native-select-class.ts
|
|
2
|
+
const NATIVE_SELECT_CLASS = "border-input focus-visible:border-ring focus-visible:ring-ring/50 dark:bg-input/30 h-9 rounded-md border bg-transparent px-2 text-sm shadow-xs outline-none focus-visible:ring-3";
|
|
3
|
+
export { NATIVE_SELECT_CLASS };
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=native-select-class.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-select-class.mjs","names":[],"sources":["../../src/shared/lib/native-select-class.ts"],"sourcesContent":["export const NATIVE_SELECT_CLASS =\n \"border-input focus-visible:border-ring focus-visible:ring-ring/50 dark:bg-input/30 h-9 rounded-md border bg-transparent px-2 text-sm shadow-xs outline-none focus-visible:ring-3\";\n"],"mappings":";AAAA,MAAa,sBACX"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Array, Option, pipe } from "effect";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { constVoid } from "effect/Function";
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
// src/shared/ui/next-page-trigger.tsx
|
|
6
|
+
const AHEAD = { rootMargin: "0px 0px 100% 0px" };
|
|
7
|
+
const NextPageTrigger = ({ onVisible }) => {
|
|
8
|
+
const watch = useCallback((element) => {
|
|
9
|
+
const observer = new IntersectionObserver((entries) => {
|
|
10
|
+
if (pipe(entries, Array.some(({ isIntersecting }) => isIntersecting))) onVisible();
|
|
11
|
+
}, AHEAD);
|
|
12
|
+
return Option.match(Option.fromNullOr(element), {
|
|
13
|
+
onNone: () => constVoid,
|
|
14
|
+
onSome: (target) => {
|
|
15
|
+
observer.observe(target);
|
|
16
|
+
return () => {
|
|
17
|
+
observer.disconnect();
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}, [onVisible]);
|
|
22
|
+
return /* @__PURE__ */ jsx("div", {
|
|
23
|
+
ref: watch,
|
|
24
|
+
className: "h-px shrink-0"
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
export { NextPageTrigger };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=next-page-trigger.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-page-trigger.mjs","names":[],"sources":["../../src/shared/ui/next-page-trigger.tsx"],"sourcesContent":["import { Array, Option, pipe } from \"effect\";\nimport { constVoid } from \"effect/Function\";\nimport { useCallback } from \"react\";\nimport type { ReactNode, RefCallback } from \"react\";\n\nconst AHEAD = { rootMargin: \"0px 0px 100% 0px\" } as const;\n\nexport const NextPageTrigger = ({ onVisible }: Readonly<{ onVisible: () => void }>): ReactNode => {\n const watch: RefCallback<HTMLDivElement> = useCallback(\n (element) => {\n const observer = new IntersectionObserver((entries) => {\n if (\n pipe(\n entries,\n Array.some(({ isIntersecting }) => isIntersecting),\n )\n ) {\n onVisible();\n }\n }, AHEAD);\n return Option.match(Option.fromNullOr(element), {\n onNone: () => constVoid,\n onSome: (target) => {\n observer.observe(target);\n return () => {\n observer.disconnect();\n };\n },\n });\n },\n [onVisible],\n );\n return <div ref={watch} className=\"h-px shrink-0\" />;\n};\n"],"mappings":";;;;;AAKA,MAAM,QAAQ,EAAE,YAAY,mBAAmB;AAE/C,MAAa,mBAAmB,EAAE,gBAAgE;CAChG,MAAM,QAAqC,aACxC,YAAY;EACX,MAAM,WAAW,IAAI,sBAAsB,YAAY;GACrD,IACE,KACE,SACA,MAAM,MAAM,EAAE,qBAAqB,cAAc,CACnD,GAEA,UAAU;EAEd,GAAG,KAAK;EACR,OAAO,OAAO,MAAM,OAAO,WAAW,OAAO,GAAG;GAC9C,cAAc;GACd,SAAS,WAAW;IAClB,SAAS,QAAQ,MAAM;IACvB,aAAa;KACX,SAAS,WAAW;IACtB;GACF;EACF,CAAC;CACH,GACA,CAAC,SAAS,CACZ;CACA,OAAO,oBAAC,OAAD;EAAK,KAAK;EAAO,WAAU;CAAiB,CAAA;AACrD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
declare const footerVariants: (props?: ({
|
|
4
|
+
variant?: "credit" | "links" | "rule" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export declare const PageFooter: ({ variant, children }: Readonly<Required<VariantProps<typeof footerVariants>> & {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}>) => ReactNode;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=page-footer.d.mts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
// src/shared/ui/page-footer.tsx
|
|
4
|
+
const footerVariants = cva("", { variants: { variant: {
|
|
5
|
+
rule: "mt-16 border-t",
|
|
6
|
+
links: "font-display flex items-center justify-center gap-4 px-4 pb-8",
|
|
7
|
+
credit: "text-muted-foreground px-6 pb-4 text-right text-xs"
|
|
8
|
+
} } });
|
|
9
|
+
const innerVariants = cva("", { variants: { variant: {
|
|
10
|
+
rule: "text-muted-foreground mx-auto max-w-6xl px-4 py-8 text-sm",
|
|
11
|
+
links: "contents",
|
|
12
|
+
credit: "contents"
|
|
13
|
+
} } });
|
|
14
|
+
const PageFooter = ({ variant, children }) => /* @__PURE__ */ jsx("footer", {
|
|
15
|
+
className: footerVariants({ variant }),
|
|
16
|
+
"data-slot": "page-footer",
|
|
17
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: innerVariants({ variant }),
|
|
19
|
+
children
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
export { PageFooter };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=page-footer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-footer.mjs","names":[],"sources":["../../src/shared/ui/page-footer.tsx"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport type { ReactNode } from \"react\";\n\nconst footerVariants = cva(\"\", {\n variants: {\n variant: {\n rule: \"mt-16 border-t\",\n links: \"font-display flex items-center justify-center gap-4 px-4 pb-8\",\n credit: \"text-muted-foreground px-6 pb-4 text-right text-xs\",\n },\n },\n});\n\nconst innerVariants = cva(\"\", {\n variants: {\n variant: {\n rule: \"text-muted-foreground mx-auto max-w-6xl px-4 py-8 text-sm\",\n links: \"contents\",\n credit: \"contents\",\n },\n },\n});\n\nexport const PageFooter = ({\n variant,\n children,\n}: Readonly<\n Required<VariantProps<typeof footerVariants>> & { children: ReactNode }\n>): ReactNode => (\n <footer className={footerVariants({ variant })} data-slot=\"page-footer\">\n <div className={innerVariants({ variant })}>{children}</div>\n </footer>\n);\n"],"mappings":";;;AAIA,MAAM,iBAAiB,IAAI,IAAI,EAC7B,UAAU,EACR,SAAS;CACP,MAAM;CACN,OAAO;CACP,QAAQ;AACV,EACF,EACF,CAAC;AAED,MAAM,gBAAgB,IAAI,IAAI,EAC5B,UAAU,EACR,SAAS;CACP,MAAM;CACN,OAAO;CACP,QAAQ;AACV,EACF,EACF,CAAC;AAED,MAAa,cAAc,EACzB,SACA,eAIA,oBAAC,UAAD;CAAQ,WAAW,eAAe,EAAE,QAAQ,CAAC;CAAG,aAAU;CACxD,UAAA,oBAAC,OAAD;EAAK,WAAW,cAAc,EAAE,QAAQ,CAAC;EAAI;CAAc,CAAA;AACrD,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
declare const headerVariants: (props?: ({
|
|
4
|
+
layout?: "bar" | "stacked" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export declare const PageHeader: ({ layout, title, children }: Readonly<Required<VariantProps<typeof headerVariants>> & {
|
|
7
|
+
title: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}>) => ReactNode;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=page-header.d.mts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
// src/shared/ui/page-header.tsx
|
|
4
|
+
const headerVariants = cva("flex", { variants: { layout: {
|
|
5
|
+
stacked: "flex-col gap-5",
|
|
6
|
+
bar: "items-center gap-3"
|
|
7
|
+
} } });
|
|
8
|
+
const titleVariants = cva("", { variants: { layout: {
|
|
9
|
+
stacked: "text-3xl leading-tight font-bold md:text-4xl",
|
|
10
|
+
bar: "flex-1 text-xl font-semibold"
|
|
11
|
+
} } });
|
|
12
|
+
const PageHeader = ({ layout, title, children }) => /* @__PURE__ */ jsxs("header", {
|
|
13
|
+
className: headerVariants({ layout }),
|
|
14
|
+
"data-slot": "page-header",
|
|
15
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
16
|
+
className: titleVariants({ layout }),
|
|
17
|
+
children: title
|
|
18
|
+
}), children]
|
|
19
|
+
});
|
|
20
|
+
export { PageHeader };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=page-header.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.mjs","names":[],"sources":["../../src/shared/ui/page-header.tsx"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport type { ReactNode } from \"react\";\n\nconst headerVariants = cva(\"flex\", {\n variants: { layout: { stacked: \"flex-col gap-5\", bar: \"items-center gap-3\" } },\n});\n\nconst titleVariants = cva(\"\", {\n variants: {\n layout: {\n stacked: \"text-3xl leading-tight font-bold md:text-4xl\",\n bar: \"flex-1 text-xl font-semibold\",\n },\n },\n});\n\nexport const PageHeader = ({\n layout,\n title,\n children,\n}: Readonly<\n Required<VariantProps<typeof headerVariants>> & { title: string; children: ReactNode }\n>): ReactNode => (\n <header className={headerVariants({ layout })} data-slot=\"page-header\">\n <h1 className={titleVariants({ layout })}>{title}</h1>\n {children}\n </header>\n);\n"],"mappings":";;;AAIA,MAAM,iBAAiB,IAAI,QAAQ,EACjC,UAAU,EAAE,QAAQ;CAAE,SAAS;CAAkB,KAAK;AAAqB,EAAE,EAC/E,CAAC;AAED,MAAM,gBAAgB,IAAI,IAAI,EAC5B,UAAU,EACR,QAAQ;CACN,SAAS;CACT,KAAK;AACP,EACF,EACF,CAAC;AAED,MAAa,cAAc,EACzB,QACA,OACA,eAIA,qBAAC,UAAD;CAAQ,WAAW,eAAe,EAAE,OAAO,CAAC;CAAG,aAAU;CAAzD,UAAA,CACE,oBAAC,MAAD;EAAI,WAAW,cAAc,EAAE,OAAO,CAAC;EAAI,UAAA;CAAU,CAAA,GACpD,QACK"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type PointerSource = Readonly<{
|
|
2
|
+
currentTarget: HTMLElement;
|
|
3
|
+
clientX: number;
|
|
4
|
+
clientY: number;
|
|
5
|
+
}>;
|
|
6
|
+
type PointerStage = Readonly<{
|
|
7
|
+
currentTarget: HTMLElement;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const followPointer: (event: PointerSource) => void;
|
|
10
|
+
export declare const followViewportPointer: (event: PointerSource) => void;
|
|
11
|
+
export declare const releasePointer: ({ currentTarget }: PointerStage) => void;
|
|
12
|
+
export declare const releaseStageLayers: ({ currentTarget }: PointerStage) => void;
|
|
13
|
+
export type { PointerSource, PointerStage };
|
|
14
|
+
//# sourceMappingURL=pointer.d.mts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// src/shared/lib/pointer.ts
|
|
2
|
+
const CENTER = "0.5";
|
|
3
|
+
const POINTER_ATTRIBUTE = "data-pointer";
|
|
4
|
+
const STAGE_LAYER = "[data-stage-layer]";
|
|
5
|
+
const self = (stage) => [stage];
|
|
6
|
+
const stageLayers = (stage) => [...stage.querySelectorAll(STAGE_LAYER)];
|
|
7
|
+
const place = (targets, pointer) => {
|
|
8
|
+
for (const target of targets) {
|
|
9
|
+
target.toggleAttribute(POINTER_ATTRIBUTE, pointer.active);
|
|
10
|
+
target.style.setProperty("--mx", pointer.ratioX);
|
|
11
|
+
target.style.setProperty("--my", pointer.ratioY);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const pointerFollower = (locate, targets) => (event) => {
|
|
15
|
+
const { left, top, width, height } = event.currentTarget.getBoundingClientRect();
|
|
16
|
+
const { ratioX, ratioY } = locate({
|
|
17
|
+
clientX: event.clientX,
|
|
18
|
+
clientY: event.clientY,
|
|
19
|
+
rect: {
|
|
20
|
+
left,
|
|
21
|
+
top,
|
|
22
|
+
width,
|
|
23
|
+
height
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
place(targets(event.currentTarget), {
|
|
27
|
+
active: true,
|
|
28
|
+
ratioX: String(ratioX),
|
|
29
|
+
ratioY: String(ratioY)
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const pointerReleaser = (targets) => ({ currentTarget }) => {
|
|
33
|
+
place(targets(currentTarget), {
|
|
34
|
+
active: false,
|
|
35
|
+
ratioX: CENTER,
|
|
36
|
+
ratioY: CENTER
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
const followPointer = pointerFollower(({ clientX, clientY, rect }) => ({
|
|
40
|
+
ratioX: (clientX - rect.left) / rect.width,
|
|
41
|
+
ratioY: (clientY - rect.top) / rect.height
|
|
42
|
+
}), self);
|
|
43
|
+
const followViewportPointer = pointerFollower(({ clientX, clientY }) => ({
|
|
44
|
+
ratioX: clientX / globalThis.innerWidth,
|
|
45
|
+
ratioY: clientY / globalThis.innerHeight
|
|
46
|
+
}), stageLayers);
|
|
47
|
+
const releasePointer = pointerReleaser(self);
|
|
48
|
+
const releaseStageLayers = pointerReleaser(stageLayers);
|
|
49
|
+
export { followPointer, followViewportPointer, releasePointer, releaseStageLayers };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=pointer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointer.mjs","names":[],"sources":["../../src/shared/lib/pointer.ts"],"sourcesContent":["const CENTER = \"0.5\";\nconst POINTER_ATTRIBUTE = \"data-pointer\";\nconst STAGE_LAYER = \"[data-stage-layer]\";\n\ntype RectSide = \"left\" | \"top\" | \"width\" | \"height\";\n\nexport type PointerSource = Readonly<{\n currentTarget: HTMLElement;\n clientX: number;\n clientY: number;\n}>;\n\nexport type PointerStage = Readonly<{ currentTarget: HTMLElement }>;\n\ntype Locate = (\n pointer: Readonly<{ clientX: number; clientY: number; rect: Readonly<Record<RectSide, number>> }>,\n) => Readonly<{ ratioX: number; ratioY: number }>;\n\ntype Targets = (stage: HTMLElement) => readonly HTMLElement[];\n\nconst self: Targets = (stage) => [stage];\n\nconst stageLayers: Targets = (stage) => [...stage.querySelectorAll<HTMLElement>(STAGE_LAYER)];\n\nconst place = (\n targets: readonly HTMLElement[],\n pointer: Readonly<{ active: boolean; ratioX: string; ratioY: string }>,\n): void => {\n for (const target of targets) {\n target.toggleAttribute(POINTER_ATTRIBUTE, pointer.active);\n target.style.setProperty(\"--mx\", pointer.ratioX);\n target.style.setProperty(\"--my\", pointer.ratioY);\n }\n};\n\nconst pointerFollower =\n (locate: Locate, targets: Targets) =>\n (event: PointerSource): void => {\n const { left, top, width, height } = event.currentTarget.getBoundingClientRect();\n const { ratioX, ratioY } = locate({\n clientX: event.clientX,\n clientY: event.clientY,\n rect: { left, top, width, height },\n });\n place(targets(event.currentTarget), {\n active: true,\n ratioX: String(ratioX),\n ratioY: String(ratioY),\n });\n };\n\nconst pointerReleaser =\n (targets: Targets) =>\n ({ currentTarget }: PointerStage): void => {\n place(targets(currentTarget), { active: false, ratioX: CENTER, ratioY: CENTER });\n };\n\nexport const followPointer = pointerFollower(\n ({ clientX, clientY, rect }) => ({\n ratioX: (clientX - rect.left) / rect.width,\n ratioY: (clientY - rect.top) / rect.height,\n }),\n self,\n);\n\nexport const followViewportPointer = pointerFollower(\n ({ clientX, clientY }) => ({\n ratioX: clientX / globalThis.innerWidth,\n ratioY: clientY / globalThis.innerHeight,\n }),\n stageLayers,\n);\n\nexport const releasePointer = pointerReleaser(self);\n\nexport const releaseStageLayers = pointerReleaser(stageLayers);\n"],"mappings":";AAAA,MAAM,SAAS;AACf,MAAM,oBAAoB;AAC1B,MAAM,cAAc;AAkBpB,MAAM,QAAiB,UAAU,CAAC,KAAK;AAEvC,MAAM,eAAwB,UAAU,CAAC,GAAG,MAAM,iBAA8B,WAAW,CAAC;AAE5F,MAAM,SACJ,SACA,YACS;CACT,KAAK,MAAM,UAAU,SAAS;EAC5B,OAAO,gBAAgB,mBAAmB,QAAQ,MAAM;EACxD,OAAO,MAAM,YAAY,QAAQ,QAAQ,MAAM;EAC/C,OAAO,MAAM,YAAY,QAAQ,QAAQ,MAAM;CACjD;AACF;AAEA,MAAM,mBACH,QAAgB,aAChB,UAA+B;CAC9B,MAAM,EAAE,MAAM,KAAK,OAAO,WAAW,MAAM,cAAc,sBAAsB;CAC/E,MAAM,EAAE,QAAQ,WAAW,OAAO;EAChC,SAAS,MAAM;EACf,SAAS,MAAM;EACf,MAAM;GAAE;GAAM;GAAK;GAAO;EAAO;CACnC,CAAC;CACD,MAAM,QAAQ,MAAM,aAAa,GAAG;EAClC,QAAQ;EACR,QAAQ,OAAO,MAAM;EACrB,QAAQ,OAAO,MAAM;CACvB,CAAC;AACH;AAEF,MAAM,mBACH,aACA,EAAE,oBAAwC;CACzC,MAAM,QAAQ,aAAa,GAAG;EAAE,QAAQ;EAAO,QAAQ;EAAQ,QAAQ;CAAO,CAAC;AACjF;AAEF,MAAa,gBAAgB,iBAC1B,EAAE,SAAS,SAAS,YAAY;CAC/B,SAAS,UAAU,KAAK,QAAQ,KAAK;CACrC,SAAS,UAAU,KAAK,OAAO,KAAK;AACtC,IACA,IACF;AAEA,MAAa,wBAAwB,iBAClC,EAAE,SAAS,eAAe;CACzB,QAAQ,UAAU,WAAW;CAC7B,QAAQ,UAAU,WAAW;AAC/B,IACA,WACF;AAEA,MAAa,iBAAiB,gBAAgB,IAAI;AAElD,MAAa,qBAAqB,gBAAgB,WAAW"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const portfolio: {
|
|
2
|
+
readonly url: "https://masseater.dev";
|
|
3
|
+
readonly name: "masseater";
|
|
4
|
+
readonly xUser: "r_masseater";
|
|
5
|
+
readonly links: readonly [{
|
|
6
|
+
readonly label: "GitHub";
|
|
7
|
+
readonly href: "https://github.com/masseater";
|
|
8
|
+
}, {
|
|
9
|
+
readonly label: "X";
|
|
10
|
+
readonly href: "https://x.com/r_masseater";
|
|
11
|
+
}, {
|
|
12
|
+
readonly label: "Zenn";
|
|
13
|
+
readonly href: "https://zenn.dev/masseater";
|
|
14
|
+
}];
|
|
15
|
+
readonly sections: {
|
|
16
|
+
readonly projects: "Projects";
|
|
17
|
+
readonly blogs: "Blogs";
|
|
18
|
+
readonly slog: "Slog";
|
|
19
|
+
readonly sloppedia: "Sloppedia";
|
|
20
|
+
readonly nikogori: "Nikogori";
|
|
21
|
+
readonly "ai-produced": "AI Produced";
|
|
22
|
+
};
|
|
23
|
+
readonly externalSections: Readonly<Record<string, string>>;
|
|
24
|
+
readonly traces: {
|
|
25
|
+
readonly path: "/otlp/v1/traces";
|
|
26
|
+
readonly service: "masseater-dev-web";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare const tracesUrl: (page: string) => string;
|
|
30
|
+
export declare const sectionUrl: (category: string) => string;
|
|
31
|
+
//# sourceMappingURL=portfolio.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as portfolio, n as sectionUrl, r as tracesUrl } from "../portfolio-BQJtJtfK.mjs";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as TABLE_CONTAINER_CLASS, c as TableHeadVariant, i as TABLE_CLASS, l as tableHeadVariants, n as TABLE_CAPTION_CLASS, o as TABLE_HEADER_CLASS, r as TABLE_CELL_CLASS, s as TABLE_ROW_CLASS, t as TABLE_BODY_CLASS } from "../table-class-BeiCXlFj.mjs";
|
|
2
|
+
export { TABLE_BODY_CLASS, TABLE_CAPTION_CLASS, TABLE_CELL_CLASS, TABLE_CLASS, TABLE_CONTAINER_CLASS, TABLE_HEADER_CLASS, TABLE_ROW_CLASS, type TableHeadVariant, tableHeadVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as TABLE_BODY_CLASS, n as TABLE_CAPTION_CLASS, r as TABLE_CELL_CLASS, i as TABLE_CLASS, a as TABLE_CONTAINER_CLASS, o as TABLE_HEADER_CLASS, s as TABLE_ROW_CLASS, c as tableHeadVariants } from "../table-class-RQvT6MYy.mjs";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { c as TableHeadVariant, l as tableHeadVariants } from "../table-class-BeiCXlFj.mjs";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
|
+
type ColumnHeading = Readonly<{
|
|
5
|
+
key?: string;
|
|
6
|
+
label: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const ColumnHeadings: ({ columns, variant }: Readonly<{
|
|
10
|
+
columns: readonly ColumnHeading[];
|
|
11
|
+
variant?: TableHeadVariant;
|
|
12
|
+
}>) => ReactNode;
|
|
13
|
+
type TableProps = ComponentProps<"table"> & Readonly<{
|
|
14
|
+
containerClassName?: string;
|
|
15
|
+
}> & (Readonly<{
|
|
16
|
+
label: string;
|
|
17
|
+
labelledBy?: never;
|
|
18
|
+
}> | Readonly<{
|
|
19
|
+
labelledBy: string;
|
|
20
|
+
label?: never;
|
|
21
|
+
}>);
|
|
22
|
+
export declare const Table: ({ className, containerClassName, label, labelledBy, ...props }: TableProps) => ReactNode;
|
|
23
|
+
export declare const TableBody: ({ className, ...props }: ComponentProps<"tbody">) => ReactNode;
|
|
24
|
+
export declare const TableCaption: ({ className, ...props }: ComponentProps<"caption">) => ReactNode;
|
|
25
|
+
export declare const TableCell: ({ className, ...props }: ComponentProps<"td">) => ReactNode;
|
|
26
|
+
export declare const TableHead: ({ className, variant, ...props }: ComponentProps<"th"> & Readonly<VariantProps<typeof tableHeadVariants>>) => ReactNode;
|
|
27
|
+
export declare const TableHeader: ({ className, ...props }: ComponentProps<"thead">) => ReactNode;
|
|
28
|
+
export declare const TableRow: ({ className, ...props }: ComponentProps<"tr">) => ReactNode;
|
|
29
|
+
export type { ColumnHeading, TableHeadVariant };
|
|
30
|
+
//# sourceMappingURL=table.d.mts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { t as cn } from "../cn-DtxpfSUK.mjs";
|
|
2
|
+
import { a as TABLE_CONTAINER_CLASS, c as tableHeadVariants, i as TABLE_CLASS, n as TABLE_CAPTION_CLASS, o as TABLE_HEADER_CLASS, r as TABLE_CELL_CLASS, s as TABLE_ROW_CLASS, t as TABLE_BODY_CLASS } from "../table-class-RQvT6MYy.mjs";
|
|
3
|
+
import { Array, pipe } from "effect";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/shared/ui/table/table-head.tsx
|
|
6
|
+
const TableHead = ({ className, variant, ...props }) => /* @__PURE__ */ jsx("th", {
|
|
7
|
+
"data-slot": "table-head",
|
|
8
|
+
className: cn(tableHeadVariants({ variant }), className),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
// src/shared/ui/table/table-header.tsx
|
|
12
|
+
const TableHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("thead", {
|
|
13
|
+
"data-slot": "table-header",
|
|
14
|
+
className: cn(TABLE_HEADER_CLASS, className),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
// src/shared/ui/table/table-row.tsx
|
|
18
|
+
const TableRow = ({ className, ...props }) => /* @__PURE__ */ jsx("tr", {
|
|
19
|
+
"data-slot": "table-row",
|
|
20
|
+
className: cn(TABLE_ROW_CLASS, className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
// src/shared/ui/table/column-headings.tsx
|
|
24
|
+
const ColumnHeadings = ({ columns, variant }) => /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsx(TableRow, { children: pipe(columns, Array.map(({ key, label, className }) => /* @__PURE__ */ jsx(TableHead, {
|
|
25
|
+
scope: "col",
|
|
26
|
+
variant,
|
|
27
|
+
className,
|
|
28
|
+
children: label
|
|
29
|
+
}, key ?? label))) }) });
|
|
30
|
+
// src/shared/ui/table/table.tsx
|
|
31
|
+
const FOCUSABLE = 0;
|
|
32
|
+
const Table = ({ className, containerClassName, label, labelledBy, ...props }) => /* @__PURE__ */ jsx("section", {
|
|
33
|
+
"data-slot": "table-container",
|
|
34
|
+
"aria-label": label,
|
|
35
|
+
"aria-labelledby": labelledBy,
|
|
36
|
+
className: cn(TABLE_CONTAINER_CLASS, containerClassName),
|
|
37
|
+
tabIndex: FOCUSABLE,
|
|
38
|
+
children: /* @__PURE__ */ jsx("table", {
|
|
39
|
+
"data-slot": "table",
|
|
40
|
+
className: cn(TABLE_CLASS, className),
|
|
41
|
+
...props
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
// src/shared/ui/table/table-body.tsx
|
|
45
|
+
const TableBody = ({ className, ...props }) => /* @__PURE__ */ jsx("tbody", {
|
|
46
|
+
"data-slot": "table-body",
|
|
47
|
+
className: cn(TABLE_BODY_CLASS, className),
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
// src/shared/ui/table/table-caption.tsx
|
|
51
|
+
const TableCaption = ({ className, ...props }) => /* @__PURE__ */ jsx("caption", {
|
|
52
|
+
"data-slot": "table-caption",
|
|
53
|
+
className: cn(TABLE_CAPTION_CLASS, className),
|
|
54
|
+
...props
|
|
55
|
+
});
|
|
56
|
+
// src/shared/ui/table/table-cell.tsx
|
|
57
|
+
const TableCell = ({ className, ...props }) => /* @__PURE__ */ jsx("td", {
|
|
58
|
+
"data-slot": "table-cell",
|
|
59
|
+
className: cn(TABLE_CELL_CLASS, className),
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
export { ColumnHeadings, Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=table.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.mjs","names":["Arr"],"sources":["../../src/shared/ui/table/table-head.tsx","../../src/shared/ui/table/table-header.tsx","../../src/shared/ui/table/table-row.tsx","../../src/shared/ui/table/column-headings.tsx","../../src/shared/ui/table/table.tsx","../../src/shared/ui/table/table-body.tsx","../../src/shared/ui/table/table-caption.tsx","../../src/shared/ui/table/table-cell.tsx"],"sourcesContent":["import type { VariantProps } from \"class-variance-authority\";\nimport type { ComponentProps, ReactNode } from \"react\";\n\nimport { cn } from \"#/shared/lib/cn.ts\";\nimport { tableHeadVariants } from \"#/shared/lib/table-class.ts\";\n\nexport const TableHead = ({\n className,\n variant,\n ...props\n}: ComponentProps<\"th\"> & Readonly<VariantProps<typeof tableHeadVariants>>): ReactNode => (\n <th data-slot=\"table-head\" className={cn(tableHeadVariants({ variant }), className)} {...props} />\n);\n","import type { ComponentProps, ReactNode } from \"react\";\n\nimport { cn } from \"#/shared/lib/cn.ts\";\nimport { TABLE_HEADER_CLASS } from \"#/shared/lib/table-class.ts\";\n\nexport const TableHeader = ({ className, ...props }: ComponentProps<\"thead\">): ReactNode => (\n <thead data-slot=\"table-header\" className={cn(TABLE_HEADER_CLASS, className)} {...props} />\n);\n","import type { ComponentProps, ReactNode } from \"react\";\n\nimport { cn } from \"#/shared/lib/cn.ts\";\nimport { TABLE_ROW_CLASS } from \"#/shared/lib/table-class.ts\";\n\nexport const TableRow = ({ className, ...props }: ComponentProps<\"tr\">): ReactNode => (\n <tr data-slot=\"table-row\" className={cn(TABLE_ROW_CLASS, className)} {...props} />\n);\n","import { Array as Arr, pipe } from \"effect\";\nimport type { ReactNode } from \"react\";\n\nimport type { TableHeadVariant } from \"#/shared/lib/table-class.ts\";\nimport { TableHead } from \"#/shared/ui/table/table-head.tsx\";\nimport { TableHeader } from \"#/shared/ui/table/table-header.tsx\";\nimport { TableRow } from \"#/shared/ui/table/table-row.tsx\";\n\nexport type ColumnHeading = Readonly<{ key?: string; label: string; className?: string }>;\n\nexport const ColumnHeadings = ({\n columns,\n variant,\n}: Readonly<{\n columns: readonly ColumnHeading[];\n variant?: TableHeadVariant;\n}>): ReactNode => (\n <TableHeader>\n <TableRow>\n {pipe(\n columns,\n Arr.map(({ key, label, className }) => (\n <TableHead key={key ?? label} scope=\"col\" variant={variant} className={className}>\n {label}\n </TableHead>\n )),\n )}\n </TableRow>\n </TableHeader>\n);\n","import type { ComponentProps, ReactNode } from \"react\";\n\nimport { cn } from \"#/shared/lib/cn.ts\";\nimport { TABLE_CLASS, TABLE_CONTAINER_CLASS } from \"#/shared/lib/table-class.ts\";\n\nconst FOCUSABLE = 0;\n\nexport type TableProps = ComponentProps<\"table\"> &\n Readonly<{ containerClassName?: string }> &\n (\n | Readonly<{ label: string; labelledBy?: never }>\n | Readonly<{ labelledBy: string; label?: never }>\n );\n\nexport const Table = ({\n className,\n containerClassName,\n label,\n labelledBy,\n ...props\n}: TableProps): ReactNode => (\n <section\n data-slot=\"table-container\"\n aria-label={label}\n aria-labelledby={labelledBy}\n className={cn(TABLE_CONTAINER_CLASS, containerClassName)}\n tabIndex={FOCUSABLE}\n >\n <table data-slot=\"table\" className={cn(TABLE_CLASS, className)} {...props} />\n </section>\n);\n","import type { ComponentProps, ReactNode } from \"react\";\n\nimport { cn } from \"#/shared/lib/cn.ts\";\nimport { TABLE_BODY_CLASS } from \"#/shared/lib/table-class.ts\";\n\nexport const TableBody = ({ className, ...props }: ComponentProps<\"tbody\">): ReactNode => (\n <tbody data-slot=\"table-body\" className={cn(TABLE_BODY_CLASS, className)} {...props} />\n);\n","import type { ComponentProps, ReactNode } from \"react\";\n\nimport { cn } from \"#/shared/lib/cn.ts\";\nimport { TABLE_CAPTION_CLASS } from \"#/shared/lib/table-class.ts\";\n\nexport const TableCaption = ({ className, ...props }: ComponentProps<\"caption\">): ReactNode => (\n <caption data-slot=\"table-caption\" className={cn(TABLE_CAPTION_CLASS, className)} {...props} />\n);\n","import type { ComponentProps, ReactNode } from \"react\";\n\nimport { cn } from \"#/shared/lib/cn.ts\";\nimport { TABLE_CELL_CLASS } from \"#/shared/lib/table-class.ts\";\n\nexport const TableCell = ({ className, ...props }: ComponentProps<\"td\">): ReactNode => (\n <td data-slot=\"table-cell\" className={cn(TABLE_CELL_CLASS, className)} {...props} />\n);\n"],"mappings":";;;;;AAMA,MAAa,aAAa,EACxB,WACA,SACA,GAAG,YAEH,oBAAC,MAAD;CAAI,aAAU;CAAa,WAAW,GAAG,kBAAkB,EAAE,QAAQ,CAAC,GAAG,SAAS;CAAG,GAAI;AAAQ,CAAA;;ACNnG,MAAa,eAAe,EAAE,WAAW,GAAG,YAC1C,oBAAC,SAAD;CAAO,aAAU;CAAe,WAAW,GAAG,oBAAoB,SAAS;CAAG,GAAI;AAAQ,CAAA;;ACD5F,MAAa,YAAY,EAAE,WAAW,GAAG,YACvC,oBAAC,MAAD;CAAI,aAAU;CAAY,WAAW,GAAG,iBAAiB,SAAS;CAAG,GAAI;AAAQ,CAAA;;ACInF,MAAa,kBAAkB,EAC7B,SACA,cAKA,oBAAC,aAAD,EAAA,UACE,oBAAC,UAAD,EAAA,UACG,KACC,SACAA,MAAI,KAAK,EAAE,KAAK,OAAO,gBACrB,oBAAC,WAAD;CAA8B,OAAM;CAAe;CAAoB;CACpE,UAAA;AACQ,GAFK,OAAO,KAEZ,CACZ,CACH,EACQ,CAAA,EACC,CAAA;;ACvBf,MAAM,YAAY;AASlB,MAAa,SAAS,EACpB,WACA,oBACA,OACA,YACA,GAAG,YAEH,oBAAC,WAAD;CACE,aAAU;CACV,cAAY;CACZ,mBAAiB;CACjB,WAAW,GAAG,uBAAuB,kBAAkB;CACvD,UAAU;CAEV,UAAA,oBAAC,SAAD;EAAO,aAAU;EAAQ,WAAW,GAAG,aAAa,SAAS;EAAG,GAAI;CAAQ,CAAA;AACrE,CAAA;;ACxBX,MAAa,aAAa,EAAE,WAAW,GAAG,YACxC,oBAAC,SAAD;CAAO,aAAU;CAAa,WAAW,GAAG,kBAAkB,SAAS;CAAG,GAAI;AAAQ,CAAA;;ACDxF,MAAa,gBAAgB,EAAE,WAAW,GAAG,YAC3C,oBAAC,WAAD;CAAS,aAAU;CAAgB,WAAW,GAAG,qBAAqB,SAAS;CAAG,GAAI;AAAQ,CAAA;;ACDhG,MAAa,aAAa,EAAE,WAAW,GAAG,YACxC,oBAAC,MAAD;CAAI,aAAU;CAAa,WAAW,GAAG,kBAAkB,SAAS;CAAG,GAAI;AAAQ,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type CssVariables = Readonly<Record<`--${string}`, number | string>>;
|
|
2
|
+
declare module "react" {
|
|
3
|
+
interface CSSProperties extends Partial<CssVariables> {}
|
|
4
|
+
}
|
|
5
|
+
type WavyLetter = Readonly<{
|
|
6
|
+
key: string;
|
|
7
|
+
letter: string;
|
|
8
|
+
style: CssVariables;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const toWavyLetters: (text: string) => readonly WavyLetter[];
|
|
11
|
+
export type { WavyLetter };
|
|
12
|
+
//# sourceMappingURL=to-wavy-letters.d.mts.map
|