aboutsummaryrefslogtreecommitdiffstats
path: root/ui/src/lib/utils.ts
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2024-07-30 16:54:10 +0100
committerGitHub <noreply@github.com>2024-07-30 16:54:10 +0100
commit808138de633e410c1d3867d4fb7cb74967647605 (patch)
treef180b7066b91d8d8d8006219a118439be1621d74 /ui/src/lib/utils.ts
parentchore(deps): bump debian (#2320) (diff)
downloadatuin-808138de633e410c1d3867d4fb7cb74967647605.zip
chore: remove ui directory (#2329)
This is still in development, but rather than clutter the commit history and issues with an unreleased project I've split the UI into its own repo. Once ready for release, I'll either merge the ui code back in, or just make the repo public.
Diffstat (limited to 'ui/src/lib/utils.ts')
-rw-r--r--ui/src/lib/utils.ts48
1 files changed, 0 insertions, 48 deletions
diff --git a/ui/src/lib/utils.ts b/ui/src/lib/utils.ts
deleted file mode 100644
index db66b3be..00000000
--- a/ui/src/lib/utils.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import type { ClassValue } from "clsx";
-
-import clsx from "clsx";
-import { extendTailwindMerge } from "tailwind-merge";
-
-const COMMON_UNITS = ["small", "medium", "large"];
-
-/**
- * We need to extend the tailwind merge to include NextUI's custom classes.
- *
- * So we can use classes like `text-small` or `text-default-500` and override them.
- */
-const twMerge = extendTailwindMerge({
- extend: {
- theme: {
- opacity: ["disabled"],
- spacing: ["divider"],
- borderWidth: COMMON_UNITS,
- borderRadius: COMMON_UNITS,
- },
- classGroups: {
- shadow: [{ shadow: COMMON_UNITS }],
- "font-size": [{ text: ["tiny", ...COMMON_UNITS] }],
- "bg-image": ["bg-stripe-gradient"],
- },
- },
-});
-
-export function cn(...inputs: ClassValue[]) {
- return twMerge(clsx(inputs));
-}
-
-// edge still uses the old one
-export function getWeekInfo() {
- let locale = new Intl.Locale(navigator.language);
-
- // @ts-ignore
- if (locale.getWeekInfo) {
- // @ts-ignore
- return locale.getWeekInfo();
- // @ts-ignore
- } else if (locale.weekInfo) {
- // @ts-ignore
- return locale.weekInfo;
- }
-
- throw new Error("Could not fetch week info via new or old api");
-}