kaleido-ui 0.1.123 → 0.1.129

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 CHANGED
@@ -15,13 +15,19 @@ npm install kaleido-ui
15
15
  | `kaleido-ui` | Web components (Tailwind CSS + Radix UI) |
16
16
  | `kaleido-ui/tokens` | Platform-agnostic design tokens (zero deps) |
17
17
  | `kaleido-ui/native` | React Native components (WDK + custom) |
18
- | `kaleido-ui/css` | Tailwind v4 `@theme` tokens, CSS variables, keyframes, utilities, Material Symbols |
18
+ | `kaleido-ui/css` | CSS variables (light + dark), keyframes, utilities, and the Tailwind v4 `@theme` tokens |
19
19
  | `kaleido-ui/css/brand` | Opt-in brand theme: AA-safe light primary, lifted dark danger/info, coloured page wash (import after `kaleido-ui/css`) |
20
+ | `kaleido-ui/tailwind` | Tailwind **v3** preset built from the tokens |
20
21
  | `kaleido-ui/brand/*.svg` | Logo files: `kaleidoswap-pictogram.svg`, `kaleidoswap-fullogo-{horizontal,vertical}.svg` (white wordmark) and `-on-light.svg` variants |
21
22
 
22
- > **Tailwind v4 only.** `kaleido-ui/css` ships the full theme as Tailwind v4
23
- > `@theme` blocks, so there is no separate Tailwind preset to configure —
24
- > importing the CSS registers every token and generates the utilities.
23
+ > **Tailwind v4 and v3 are both supported.** The library is built with v4.
24
+ > On v4, `kaleido-ui/css` carries the whole theme as `@theme` blocks — no
25
+ > preset. On v3, which ignores `@theme` and only generates the opacity steps in
26
+ > its own scale, use the `kaleido-ui/tailwind` preset *and* import
27
+ > `kaleido-ui/css` for the variables it points at. Either way, scan the
28
+ > package's `dist` so the components' classes are generated.
29
+ > `tests/tailwind-v3-preset.test.tsx` compiles the components with both and
30
+ > fails if v3 misses a class v4 generates.
25
31
 
26
32
  ## Quick Start — Web (Tailwind v4)
27
33
 
@@ -30,12 +36,36 @@ npm install kaleido-ui
30
36
  ```css
31
37
  /* styles.css */
32
38
  @import "tailwindcss";
39
+ @import "tw-animate-css"; /* Dialog/Select/Toast enter-exit classes */
33
40
  @import "kaleido-ui/css";
34
41
 
35
- /* Tell Tailwind which files to scan for classes */
42
+ /* Tell Tailwind which files to scan for classes: yours and the components' */
36
43
  @source "./src/**/*.{ts,tsx}";
44
+ @source "../node_modules/kaleido-ui/dist/web";
37
45
  ```
38
46
 
47
+ ### Tailwind v3
48
+
49
+ ```js
50
+ // tailwind.config.js
51
+ module.exports = {
52
+ presets: [require('kaleido-ui/tailwind')],
53
+ content: ['./src/**/*.{ts,tsx}', './node_modules/kaleido-ui/dist/web/*.js'],
54
+ plugins: [require('tailwindcss-animate')],
55
+ }
56
+ ```
57
+
58
+ ```css
59
+ /* index.css — kaleido-ui/css first: the preset's colours are its variables */
60
+ @import 'kaleido-ui/css';
61
+ @tailwind base;
62
+ @tailwind components;
63
+ @tailwind utilities;
64
+ ```
65
+
66
+ The preset's colours are the theme's custom properties (opacity modifiers work
67
+ through `color-mix`), so light and dark switch at runtime exactly as on v4.
68
+
39
69
  ```ts
40
70
  // main.tsx
41
71
  import './styles.css'
@@ -3,7 +3,11 @@
3
3
  * Regenerate: npm run generate:css
4
4
  */
5
5
 
6
- /* ── Material Symbols ──────────────────────────────────────────────────── */
6
+ /* ── Material Symbols (opt-in) ────────────────────────────────────────────
7
+ No kaleido-ui component renders this class: every glyph is an inline SVG
8
+ (the Icon primitive), and tests/no-font-ligatures.test.tsx keeps it so.
9
+ These rules serve a consumer that self-hosts the Material Symbols font and
10
+ writes its own ligature spans. */
7
11
  .material-symbols-outlined {
8
12
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
9
13
  /*
@@ -49,6 +53,13 @@
49
53
  --chart-3: #F7931A;
50
54
  --chart-4: #7C3AED;
51
55
  --chart-5: #DD352E;
56
+ /* Chart series, in slot order — from src/tokens/chart.ts */
57
+ --series-1: #0b764d;
58
+ --series-2: #4e40a0;
59
+ --series-3: #0f9cd0;
60
+ --series-4: #dea805;
61
+ --series-5: #c34189;
62
+ --series-6: #fe904d;
52
63
  }
53
64
 
54
65
  /* ── Semantic colors (dark mode) — from src/tokens/colors.ts ───────────── */
@@ -76,6 +87,13 @@
76
87
  --chart-3: #F7931A;
77
88
  --chart-4: #7C3AED;
78
89
  --chart-5: #DD352E;
90
+ /* Chart series, in slot order — from src/tokens/chart.ts */
91
+ --series-1: #098356;
92
+ --series-2: #7061db;
93
+ --series-3: #179fd4;
94
+ --series-4: #b3880f;
95
+ --series-5: #db589e;
96
+ --series-6: #de6907;
79
97
  }
80
98
 
81
99
  /* ── App semantic colors (slate identity) — from src/tokens/app-semantic.ts ─
@@ -216,6 +234,12 @@
216
234
  --color-chart-3: var(--chart-3);
217
235
  --color-chart-4: var(--chart-4);
218
236
  --color-chart-5: var(--chart-5);
237
+ --color-series-1: var(--series-1);
238
+ --color-series-2: var(--series-2);
239
+ --color-series-3: var(--series-3);
240
+ --color-series-4: var(--series-4);
241
+ --color-series-5: var(--series-5);
242
+ --color-series-6: var(--series-6);
219
243
 
220
244
  /* App semantic colors (slate identity) — channel-backed via the --app-* vars.
221
245
  These intentionally override the shadcn-style --color-primary / --color-secondary
@@ -444,6 +468,9 @@
444
468
  --animate-accordion-down: accordion-down 0.2s ease-out;
445
469
  --animate-accordion-up: accordion-up 0.2s ease-out;
446
470
  --animate-fade-in: fade-in 0.3s ease-out;
471
+ --animate-fade-out: fade-out 0.2s ease-in;
472
+ --animate-drawer-in-left: drawer-in-left 0.3s ease-in-out;
473
+ --animate-drawer-out-left: drawer-out-left 0.2s ease-in;
447
474
  --animate-slide-up: slide-up 0.3s ease-out;
448
475
  --animate-slide-in-from-bottom: slide-in-from-bottom 0.4s ease-out;
449
476
  --animate-stagger-up: stagger-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
@@ -479,6 +506,33 @@
479
506
  }
480
507
  }
481
508
 
509
+ @keyframes fade-out {
510
+ from {
511
+ opacity: 1;
512
+ }
513
+ to {
514
+ opacity: 0;
515
+ }
516
+ }
517
+
518
+ @keyframes drawer-in-left {
519
+ from {
520
+ transform: translateX(-100%);
521
+ }
522
+ to {
523
+ transform: translateX(0);
524
+ }
525
+ }
526
+
527
+ @keyframes drawer-out-left {
528
+ from {
529
+ transform: translateX(0);
530
+ }
531
+ to {
532
+ transform: translateX(-100%);
533
+ }
534
+ }
535
+
482
536
  @keyframes slide-up {
483
537
  from {
484
538
  opacity: 0;
@@ -733,6 +733,10 @@ function KText({
733
733
  // src/native/components/k-screen.tsx
734
734
  var import_react_native7 = require("react-native");
735
735
  var import_jsx_runtime9 = require("react/jsx-runtime");
736
+ var legacyAndroidStatusBar = {
737
+ backgroundColor: "transparent",
738
+ translucent: true
739
+ };
736
740
  function KScreen({ elevated = false, style, children, ...rest }) {
737
741
  const { theme, mode } = useKaleidoTheme();
738
742
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
@@ -745,8 +749,7 @@ function KScreen({ elevated = false, style, children, ...rest }) {
745
749
  import_react_native7.StatusBar,
746
750
  {
747
751
  barStyle: mode === "dark" ? "light-content" : "dark-content",
748
- backgroundColor: "transparent",
749
- translucent: true
752
+ ...legacyAndroidStatusBar
750
753
  }
751
754
  ),
752
755
  children
@@ -1421,6 +1424,14 @@ var transition = {
1421
1424
  default: "200ms ease-out",
1422
1425
  slow: "300ms ease-out"
1423
1426
  };
1427
+
1428
+ // src/tokens/chart.ts
1429
+ var chartSeries = {
1430
+ /** green, violet, azzurro, then yellow, magenta, orange */
1431
+ dark: ["#098356", "#7061db", "#179fd4", "#b3880f", "#db589e", "#de6907"],
1432
+ light: ["#0b764d", "#4e40a0", "#0f9cd0", "#dea805", "#c34189", "#fe904d"]
1433
+ };
1434
+ var chartSeriesLimit = chartSeries.dark.length;
1424
1435
  // Annotate the CommonJS export names for ESM import in node:
1425
1436
  0 && (module.exports = {
1426
1437
  ActionButton,
@@ -667,6 +667,10 @@ function KText({
667
667
  // src/native/components/k-screen.tsx
668
668
  import { StatusBar, View as View5 } from "react-native";
669
669
  import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
670
+ var legacyAndroidStatusBar = {
671
+ backgroundColor: "transparent",
672
+ translucent: true
673
+ };
670
674
  function KScreen({ elevated = false, style, children, ...rest }) {
671
675
  const { theme, mode } = useKaleidoTheme();
672
676
  return /* @__PURE__ */ jsxs2(
@@ -679,8 +683,7 @@ function KScreen({ elevated = false, style, children, ...rest }) {
679
683
  StatusBar,
680
684
  {
681
685
  barStyle: mode === "dark" ? "light-content" : "dark-content",
682
- backgroundColor: "transparent",
683
- translucent: true
686
+ ...legacyAndroidStatusBar
684
687
  }
685
688
  ),
686
689
  children
@@ -1359,6 +1362,14 @@ var transition = {
1359
1362
  default: "200ms ease-out",
1360
1363
  slow: "300ms ease-out"
1361
1364
  };
1365
+
1366
+ // src/tokens/chart.ts
1367
+ var chartSeries = {
1368
+ /** green, violet, azzurro, then yellow, magenta, orange */
1369
+ dark: ["#098356", "#7061db", "#179fd4", "#b3880f", "#db589e", "#de6907"],
1370
+ light: ["#0b764d", "#4e40a0", "#0f9cd0", "#dea805", "#c34189", "#fe904d"]
1371
+ };
1372
+ var chartSeriesLimit = chartSeries.dark.length;
1362
1373
  export {
1363
1374
  ActionButton,
1364
1375
  AlertBanner,