@yuhuanowo/yunui 0.2.0 → 0.2.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/styles/yunui.css CHANGED
@@ -9,6 +9,12 @@
9
9
  of your own CSS, before `@import "tailwindcss"`.
10
10
  ===================================================== */
11
11
 
12
+ /* Layered, runtime-switchable design tokens (scheme -> function -> semantic).
13
+ GENERATED by scripts/gen-tokens.mjs. Additive: introduces the --scheme /
14
+ --function / --{role} namespace without touching the legacy flat vars below,
15
+ so the default look is unchanged. See styles/tokens.css. */
16
+ @import "./tokens.css";
17
+
12
18
  @theme {
13
19
  --color-border: var(--border-default);
14
20
  --color-input: var(--border-default);
@@ -37,6 +43,12 @@
37
43
 
38
44
  --color-card: var(--bg-card);
39
45
  --color-card-foreground: var(--text-primary);
46
+
47
+ /* Marquee animations — generate the .animate-marquee / .animate-marquee-vertical
48
+ utilities the <Marquee> component relies on. Duration/gap are overridable
49
+ per-instance via the --duration / --gap CSS vars set on the component. */
50
+ --animate-marquee: marquee var(--duration, 40s) linear infinite;
51
+ --animate-marquee-vertical: marquee-vertical var(--duration, 40s) linear infinite;
40
52
  }
41
53
 
42
54
  @custom-variant dark (&:where(.dark, .dark *, .true-black, .true-black *));
@@ -576,6 +588,19 @@ body {
576
588
  background: rgba(24, 24, 27, 0.08);
577
589
  }
578
590
 
591
+ /* Brand - solid fill driven by the runtime-themeable token system. Re-themes
592
+ live via `data-brand` on <html> (defaults to the brand palette); pairs with
593
+ the bg-brand and text-brand color utilities. See styles/tokens.css. */
594
+ .btn-brand {
595
+ color: var(--brand-on-solid-strong);
596
+ border-color: transparent;
597
+ background: var(--brand-solid-strong);
598
+ }
599
+
600
+ .btn-brand:hover {
601
+ background: var(--brand-solid-medium);
602
+ }
603
+
579
604
  /* Outline - minimal border */
580
605
  .btn-outline {
581
606
  color: #09090b;
@@ -2006,19 +2031,33 @@ html {
2006
2031
  width: 100%;
2007
2032
  }
2008
2033
 
2009
- /* Marquee for logos */
2034
+ /* Marquee — seamless infinite scroll for the <Marquee> component.
2035
+ The component repeats its children N times in a flex track; each group
2036
+ translates by exactly one full group (100%) plus the inter-group gap, so the
2037
+ loop is visually continuous. Horizontal + vertical variants. */
2010
2038
  @keyframes marquee {
2011
- 0% {
2039
+ from {
2012
2040
  transform: translateX(0);
2013
2041
  }
2014
2042
 
2015
- 100% {
2016
- transform: translateX(-50%);
2043
+ to {
2044
+ transform: translateX(calc(-100% - var(--gap, 1rem)));
2045
+ }
2046
+ }
2047
+
2048
+ @keyframes marquee-vertical {
2049
+ from {
2050
+ transform: translateY(0);
2051
+ }
2052
+
2053
+ to {
2054
+ transform: translateY(calc(-100% - var(--gap, 1rem)));
2017
2055
  }
2018
2056
  }
2019
2057
 
2058
+ /* Legacy single-element marquee utility (kept for backward compatibility). */
2020
2059
  .marquee {
2021
- animation: marquee 30s linear infinite;
2060
+ animation: marquee var(--duration, 30s) linear infinite;
2022
2061
  }
2023
2062
 
2024
2063
  /* Reveal on scroll */
@@ -1,29 +0,0 @@
1
- "use client";
2
- // src/lib/clipboard.ts
3
- async function copyToClipboard(text) {
4
- try {
5
- if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
6
- await navigator.clipboard.writeText(text);
7
- return true;
8
- }
9
- } catch {
10
- }
11
- try {
12
- const textarea = document.createElement("textarea");
13
- textarea.value = text;
14
- textarea.setAttribute("readonly", "");
15
- textarea.style.position = "fixed";
16
- textarea.style.left = "-9999px";
17
- document.body.appendChild(textarea);
18
- textarea.select();
19
- const ok = document.execCommand("copy");
20
- document.body.removeChild(textarea);
21
- return ok;
22
- } catch {
23
- return false;
24
- }
25
- }
26
-
27
- export { copyToClipboard };
28
- //# sourceMappingURL=chunk-WASCOOVD.js.map
29
- //# sourceMappingURL=chunk-WASCOOVD.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/clipboard.ts"],"names":[],"mappings":";AAUA,eAAsB,gBAAgB,IAAA,EAAgC;AAClE,EAAA,IAAI;AACA,IAAA,IAAI,OAAO,SAAA,KAAc,WAAA,IAAe,SAAA,CAAU,WAAW,SAAA,EAAW;AAGpE,MAAA,MAAM,SAAA,CAAU,SAAA,CAAU,SAAA,CAAU,IAAI,CAAA;AACxC,MAAA,OAAO,IAAA;AAAA,IACX;AAAA,EACJ,CAAA,CAAA,MAAQ;AAAA,EAER;AAEA,EAAA,IAAI;AACA,IAAA,MAAM,QAAA,GAAW,QAAA,CAAS,aAAA,CAAc,UAAU,CAAA;AAClD,IAAA,QAAA,CAAS,KAAA,GAAQ,IAAA;AACjB,IAAA,QAAA,CAAS,YAAA,CAAa,YAAY,EAAE,CAAA;AACpC,IAAA,QAAA,CAAS,MAAM,QAAA,GAAW,OAAA;AAC1B,IAAA,QAAA,CAAS,MAAM,IAAA,GAAO,SAAA;AACtB,IAAA,QAAA,CAAS,IAAA,CAAK,YAAY,QAAQ,CAAA;AAClC,IAAA,QAAA,CAAS,MAAA,EAAO;AAChB,IAAA,MAAM,EAAA,GAAK,QAAA,CAAS,WAAA,CAAY,MAAM,CAAA;AACtC,IAAA,QAAA,CAAS,IAAA,CAAK,YAAY,QAAQ,CAAA;AAClC,IAAA,OAAO,EAAA;AAAA,EACX,CAAA,CAAA,MAAQ;AACJ,IAAA,OAAO,KAAA;AAAA,EACX;AACJ","file":"chunk-WASCOOVD.js","sourcesContent":["/**\n * Copy text to the clipboard and report whether it actually succeeded.\n *\n * The native `navigator.clipboard` API is only available in secure contexts\n * (HTTPS / localhost). On plain-HTTP origins — common when an admin opens the\n * dashboard over a LAN IP — it is `undefined` and `writeText` throws. Callers\n * that fired a \"Copied!\" toast unconditionally would lie to the user. This\n * helper falls back to the legacy `execCommand(\"copy\")` path and returns a\n * boolean so the caller can show an accurate toast.\n */\nexport async function copyToClipboard(text: string): Promise<boolean> {\n try {\n if (typeof navigator !== \"undefined\" && navigator.clipboard?.writeText) {\n // Throws/rejects in non-secure contexts (plain HTTP) — caught below\n // so we fall back to the legacy path rather than failing the copy.\n await navigator.clipboard.writeText(text);\n return true;\n }\n } catch {\n /* fall through to the legacy path below */\n }\n\n try {\n const textarea = document.createElement(\"textarea\");\n textarea.value = text;\n textarea.setAttribute(\"readonly\", \"\");\n textarea.style.position = \"fixed\";\n textarea.style.left = \"-9999px\";\n document.body.appendChild(textarea);\n textarea.select();\n const ok = document.execCommand(\"copy\");\n document.body.removeChild(textarea);\n return ok;\n } catch {\n return false;\n }\n}\n"]}