wensity 0.1.9 → 0.1.11

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -5
  3. package/dist/index.js +244 -222
  4. package/package.json +26 -10
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wensity Private Limited
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -6,11 +6,16 @@ Install open-code components and UI primitives from the Wensity registry into yo
6
6
  # Initialise (defaults: Tabler icons, medium radius)
7
7
  npx wensity@latest init
8
8
 
9
- # Or apply a shareable preset from https://ui.wensity.com/docs/primitives/setup
10
- # Preset template support requires wensity 0.1.9 or later
9
+ # Or apply a shareable preset from https://ui.wensity.com/create-preset
11
10
  npx wensity@latest init --preset <wsty1-code>
12
11
  npx wensity@latest init --preset <wsty1-code> --template next
13
12
 
13
+ # Existing project — style + CSS only
14
+ npx wensity@latest apply --preset <wsty1-code>
15
+
16
+ # Inspect a code before applying
17
+ npx wensity@latest preset inspect <wsty1-code>
18
+
14
19
  # Install a primitive or component
15
20
  npx wensity@latest add button
16
21
  npx wensity@latest add liquid-multimodal-input
@@ -18,7 +23,7 @@ npx wensity@latest add liquid-multimodal-input
18
23
 
19
24
  ## Presets (primitives)
20
25
 
21
- Generate a preset on [`/docs/primitives/setup`](https://ui.wensity.com/docs/primitives/setup), then run the copied `init --preset` command once. Settings land in `wensity.json` (`style.iconLibrary`, radius, fonts, control-solid colors) and a delimited `--primitive-*` CSS block in your Tailwind CSS file.
26
+ Generate a preset in the [Create preset studio](https://ui.wensity.com/create-preset) (guide: [`/docs/create-preset`](https://ui.wensity.com/docs/create-preset)). Then run `init --preset` (new project) or `apply --preset` (existing). Settings land in `wensity.json` (`style.iconLibrary`, radius, fonts, control-solid colors) and a delimited `--primitive-*` CSS block in your Tailwind CSS file.
22
27
 
23
28
  Later `wensity add <primitive>` / `wensity update <primitive>` reads that style automatically:
24
29
 
@@ -26,13 +31,15 @@ Later `wensity add <primitive>` / `wensity update <primitive>` reads that style
26
31
  - Tabler ↔ Lucide icon imports transform at install time for **UI primitives only**
27
32
  - Mandatory dependency swap installs exactly one icon package when icons are used
28
33
 
29
- Plain `init` (no `--preset`) refuses to overwrite an existing `wensity.json` unless you pass `--force`. `init --preset` merges `style` (+ CSS) into an existing config without rewriting installed component source.
34
+ Plain `init` (no `--preset`) refuses to overwrite an existing `wensity.json` unless you pass `--force`. Prefer `apply --preset` for style-only updates; `init --preset` also merges `style` (+ CSS) without rewriting installed component source.
30
35
 
31
36
  ## Commands
32
37
 
33
38
  | Command | Purpose |
34
39
  |---|---|
35
40
  | `wensity init [--preset <code>] [--template next\|vite\|astro\|react-router]` | Create / merge project config |
41
+ | `wensity apply --preset <code>` | Apply style + CSS to an existing project |
42
+ | `wensity preset inspect <code>` | Decode a preset code |
36
43
  | `wensity login` | Save a dashboard API token for Pro |
37
44
  | `wensity logout` | Clear credentials |
38
45
  | `wensity whoami` | Show current user / plan |
@@ -53,4 +60,4 @@ Premium components and blocks require an API token from the Wensity dashboard. T
53
60
  | `@wensity/ui` runtime | Never | Never |
54
61
  | Premium `/components` | Token + license | Not exported |
55
62
 
56
- Docs: [CLI reference](https://ui.wensity.com/docs/cli) · [Primitive setup](https://ui.wensity.com/docs/primitives/setup) · [Primitives](https://ui.wensity.com/docs/primitives)
63
+ Docs: [CLI reference](https://ui.wensity.com/docs/cli) · [Create preset](https://ui.wensity.com/docs/create-preset) · [Primitives](https://ui.wensity.com/docs/primitives)
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { dirname as dirname7, join as join7 } from "path";
6
6
 
7
7
  // src/constants.ts
8
8
  var CLI_NAME = "wensity";
9
- var CLI_VERSION = "0.1.9";
9
+ var CLI_VERSION = "0.1.11";
10
10
  var CONFIG_FILE_NAME = "wensity.json";
11
11
  var DEFAULT_API_ORIGIN = "https://ui.wensity.com";
12
12
  var DEFAULT_REGISTRY_PATH = "/api/registry";
@@ -57,7 +57,7 @@ Options:
57
57
  --version Print the CLI version
58
58
 
59
59
  Preset notes:
60
- Generate codes at ${DEFAULT_API_ORIGIN}/docs/primitives/setup
60
+ Generate codes at ${DEFAULT_API_ORIGIN}/create-preset (guide: ${DEFAULT_API_ORIGIN}/docs/create-preset)
61
61
  preset inspect decodes the token, font packages, and resolved primitive tokens
62
62
  apply --preset updates existing style + primitive CSS without scaffolding helper files
63
63
  Plain init refuses an existing wensity.json unless --force
@@ -153,7 +153,8 @@ var BASE_COLOR_IDS = [
153
153
  "taupe",
154
154
  "mauve",
155
155
  "olive",
156
- "mist"
156
+ "mist",
157
+ "black"
157
158
  ];
158
159
  var THEME_COLOR_IDS = [
159
160
  "ink",
@@ -669,7 +670,7 @@ function validateStyleConfigCanonicalPartial(value) {
669
670
  if ("baseColor" in value) {
670
671
  if (typeof value.baseColor !== "string" || !isBaseColorId(value.baseColor)) {
671
672
  throw new PresetValidationError(
672
- "Invalid style.baseColor. Expected inherit | neutral | zinc | gray | slate | cool-gray | stone | taupe.",
673
+ "Invalid style.baseColor. Expected a supported base color id.",
673
674
  "style.baseColor"
674
675
  );
675
676
  }
@@ -1312,7 +1313,7 @@ function validateCodecPayloadCanonical(value) {
1312
1313
  }
1313
1314
  if (typeof value.baseColor !== "string" || !isBaseColorId(value.baseColor)) {
1314
1315
  throw new PresetValidationError(
1315
- "Invalid preset.baseColor. Expected inherit | neutral | zinc | slate | stone | taupe.",
1316
+ "Invalid preset.baseColor. Expected a supported base color id.",
1316
1317
  "preset.baseColor"
1317
1318
  );
1318
1319
  }
@@ -1536,162 +1537,225 @@ var LUCIDE_TO_TABLER = Object.fromEntries(
1536
1537
  var BASE_COLOR_PALETTE = {
1537
1538
  zinc: {
1538
1539
  light: {
1539
- surfaceElevated: "#fafafa",
1540
- surfaceOverlay: "#f4f4f5",
1541
- foreground: "#09090b",
1542
- border: "rgba(9, 9, 11, 0.08)",
1543
- mutedForeground: "#71717a"
1540
+ surfaceElevated: "oklch(1 0 0)",
1541
+ surfaceOverlay: "oklch(1 0 0)",
1542
+ surfaceHover: "oklch(0.967 0.001 286.375)",
1543
+ surfaceActive: "color-mix(in oklab, oklch(0.967 0.001 286.375) 92%, oklch(0.141 0.005 285.823) 8%)",
1544
+ borderSubtle: "oklch(0.92 0.004 286.32)",
1545
+ textSecondary: "oklch(0.552 0.016 285.938)",
1546
+ textPlaceholder: "color-mix(in oklab, oklch(0.552 0.016 285.938) 78%, transparent)"
1544
1547
  },
1545
1548
  dark: {
1546
- surfaceElevated: "#18181b",
1547
- surfaceOverlay: "#27272a",
1548
- foreground: "#fafafa",
1549
- border: "rgba(250, 250, 250, 0.10)",
1550
- mutedForeground: "#a1a1aa"
1549
+ surfaceElevated: "oklch(0.21 0.006 285.885)",
1550
+ surfaceOverlay: "oklch(0.21 0.006 285.885)",
1551
+ surfaceHover: "oklch(0.274 0.006 286.033)",
1552
+ surfaceActive: "color-mix(in oklab, oklch(0.274 0.006 286.033) 88%, oklch(0.985 0 0) 12%)",
1553
+ borderSubtle: "oklch(1 0 0 / 10%)",
1554
+ textSecondary: "oklch(0.705 0.015 286.067)",
1555
+ textPlaceholder: "color-mix(in oklab, oklch(0.705 0.015 286.067) 78%, transparent)"
1551
1556
  }
1552
1557
  },
1553
1558
  neutral: {
1554
1559
  light: {
1555
- surfaceElevated: "#fafafa",
1556
- surfaceOverlay: "#f5f5f5",
1557
- foreground: "#171717",
1558
- border: "rgba(23, 23, 23, 0.08)",
1559
- mutedForeground: "#737373"
1560
+ surfaceElevated: "oklch(1 0 0)",
1561
+ surfaceOverlay: "oklch(1 0 0)",
1562
+ surfaceHover: "oklch(0.97 0 0)",
1563
+ surfaceActive: "color-mix(in oklab, oklch(0.97 0 0) 92%, oklch(0.145 0 0) 8%)",
1564
+ borderSubtle: "oklch(0.922 0 0)",
1565
+ textSecondary: "oklch(0.556 0 0)",
1566
+ textPlaceholder: "color-mix(in oklab, oklch(0.556 0 0) 78%, transparent)"
1560
1567
  },
1561
1568
  dark: {
1562
- surfaceElevated: "#171717",
1563
- surfaceOverlay: "#262626",
1564
- foreground: "#fafafa",
1565
- border: "rgba(250, 250, 250, 0.10)",
1566
- mutedForeground: "#a3a3a3"
1569
+ surfaceElevated: "oklch(0.205 0 0)",
1570
+ surfaceOverlay: "oklch(0.205 0 0)",
1571
+ surfaceHover: "oklch(0.269 0 0)",
1572
+ surfaceActive: "color-mix(in oklab, oklch(0.269 0 0) 88%, oklch(0.985 0 0) 12%)",
1573
+ borderSubtle: "oklch(1 0 0 / 10%)",
1574
+ textSecondary: "oklch(0.708 0 0)",
1575
+ textPlaceholder: "color-mix(in oklab, oklch(0.708 0 0) 78%, transparent)"
1567
1576
  }
1568
1577
  },
1569
1578
  gray: {
1570
1579
  light: {
1571
- surfaceElevated: "#f9fafb",
1572
- surfaceOverlay: "#f3f4f6",
1573
- foreground: "#111827",
1574
- border: "rgba(17, 24, 39, 0.08)",
1575
- mutedForeground: "#6b7280"
1580
+ surfaceElevated: "oklch(1 0 0)",
1581
+ surfaceOverlay: "oklch(1 0 0)",
1582
+ surfaceHover: "oklch(0.967 0.003 264.542)",
1583
+ surfaceActive: "color-mix(in oklab, oklch(0.967 0.003 264.542) 92%, oklch(0.13 0.028 261.692) 8%)",
1584
+ borderSubtle: "oklch(0.928 0.006 264.531)",
1585
+ textSecondary: "oklch(0.551 0.027 264.364)",
1586
+ textPlaceholder: "color-mix(in oklab, oklch(0.551 0.027 264.364) 78%, transparent)"
1576
1587
  },
1577
1588
  dark: {
1578
- surfaceElevated: "#1a1f2b",
1579
- surfaceOverlay: "#262c3a",
1580
- foreground: "#f9fafb",
1581
- border: "rgba(249, 250, 251, 0.10)",
1582
- mutedForeground: "#9ca3af"
1589
+ surfaceElevated: "oklch(0.21 0.034 264.665)",
1590
+ surfaceOverlay: "oklch(0.21 0.034 264.665)",
1591
+ surfaceHover: "oklch(0.278 0.033 256.848)",
1592
+ surfaceActive: "color-mix(in oklab, oklch(0.278 0.033 256.848) 88%, oklch(0.985 0.002 247.839) 12%)",
1593
+ borderSubtle: "oklch(1 0 0 / 10%)",
1594
+ textSecondary: "oklch(0.707 0.022 261.325)",
1595
+ textPlaceholder: "color-mix(in oklab, oklch(0.707 0.022 261.325) 78%, transparent)"
1583
1596
  }
1584
1597
  },
1585
1598
  slate: {
1586
1599
  light: {
1587
- surfaceElevated: "#f8fafc",
1588
- surfaceOverlay: "#f1f5f9",
1589
- foreground: "#0f172a",
1590
- border: "rgba(15, 23, 42, 0.08)",
1591
- mutedForeground: "#64748b"
1600
+ surfaceElevated: "oklch(1 0 0)",
1601
+ surfaceOverlay: "oklch(1 0 0)",
1602
+ surfaceHover: "oklch(0.968 0.007 247.896)",
1603
+ surfaceActive: "color-mix(in oklab, oklch(0.968 0.007 247.896) 92%, oklch(0.129 0.042 264.695) 8%)",
1604
+ borderSubtle: "oklch(0.929 0.013 255.508)",
1605
+ textSecondary: "oklch(0.554 0.046 257.417)",
1606
+ textPlaceholder: "color-mix(in oklab, oklch(0.554 0.046 257.417) 78%, transparent)"
1592
1607
  },
1593
1608
  dark: {
1594
- surfaceElevated: "#0f172a",
1595
- surfaceOverlay: "#1e293b",
1596
- foreground: "#f8fafc",
1597
- border: "rgba(248, 250, 252, 0.10)",
1598
- mutedForeground: "#94a3b8"
1609
+ surfaceElevated: "oklch(0.208 0.042 265.755)",
1610
+ surfaceOverlay: "oklch(0.208 0.042 265.755)",
1611
+ surfaceHover: "oklch(0.279 0.041 260.031)",
1612
+ surfaceActive: "color-mix(in oklab, oklch(0.279 0.041 260.031) 88%, oklch(0.984 0.003 247.858) 12%)",
1613
+ borderSubtle: "oklch(1 0 0 / 10%)",
1614
+ textSecondary: "oklch(0.704 0.04 256.788)",
1615
+ textPlaceholder: "color-mix(in oklab, oklch(0.704 0.04 256.788) 78%, transparent)"
1599
1616
  }
1600
1617
  },
1601
1618
  "cool-gray": {
1602
1619
  light: {
1603
- surfaceElevated: "#f6fafb",
1604
- surfaceOverlay: "#eaf3f4",
1605
- foreground: "#13343b",
1606
- border: "rgba(19, 52, 59, 0.08)",
1607
- mutedForeground: "#5f7d84"
1620
+ surfaceElevated: "oklch(1 0 0)",
1621
+ surfaceOverlay: "oklch(1 0 0)",
1622
+ surfaceHover: "oklch(0.963 0.002 197.1)",
1623
+ surfaceActive: "color-mix(in oklab, oklch(0.963 0.002 197.1) 92%, oklch(0.148 0.004 228.8) 8%)",
1624
+ borderSubtle: "oklch(0.925 0.005 214.3)",
1625
+ textSecondary: "oklch(0.56 0.021 213.5)",
1626
+ textPlaceholder: "color-mix(in oklab, oklch(0.56 0.021 213.5) 78%, transparent)"
1608
1627
  },
1609
1628
  dark: {
1610
- surfaceElevated: "#101c1f",
1611
- surfaceOverlay: "#1b2d31",
1612
- foreground: "#eef6f7",
1613
- border: "rgba(238, 246, 247, 0.10)",
1614
- mutedForeground: "#9db3b8"
1629
+ surfaceElevated: "oklch(0.218 0.008 223.9)",
1630
+ surfaceOverlay: "oklch(0.218 0.008 223.9)",
1631
+ surfaceHover: "oklch(0.275 0.011 216.9)",
1632
+ surfaceActive: "color-mix(in oklab, oklch(0.275 0.011 216.9) 88%, oklch(0.987 0.002 197.1) 12%)",
1633
+ borderSubtle: "oklch(1 0 0 / 10%)",
1634
+ textSecondary: "oklch(0.723 0.014 214.4)",
1635
+ textPlaceholder: "color-mix(in oklab, oklch(0.723 0.014 214.4) 78%, transparent)"
1615
1636
  }
1616
1637
  },
1617
1638
  stone: {
1618
1639
  light: {
1619
- surfaceElevated: "#fafaf9",
1620
- surfaceOverlay: "#f5f5f4",
1621
- foreground: "#1c1917",
1622
- border: "rgba(28, 25, 23, 0.08)",
1623
- mutedForeground: "#78716c"
1640
+ surfaceElevated: "oklch(1 0 0)",
1641
+ surfaceOverlay: "oklch(1 0 0)",
1642
+ surfaceHover: "oklch(0.97 0.001 106.424)",
1643
+ surfaceActive: "color-mix(in oklab, oklch(0.97 0.001 106.424) 92%, oklch(0.147 0.004 49.25) 8%)",
1644
+ borderSubtle: "oklch(0.923 0.003 48.717)",
1645
+ textSecondary: "oklch(0.553 0.013 58.071)",
1646
+ textPlaceholder: "color-mix(in oklab, oklch(0.553 0.013 58.071) 78%, transparent)"
1624
1647
  },
1625
1648
  dark: {
1626
- surfaceElevated: "#1c1917",
1627
- surfaceOverlay: "#292524",
1628
- foreground: "#fafaf9",
1629
- border: "rgba(250, 250, 249, 0.10)",
1630
- mutedForeground: "#a8a29e"
1649
+ surfaceElevated: "oklch(0.216 0.006 56.043)",
1650
+ surfaceOverlay: "oklch(0.216 0.006 56.043)",
1651
+ surfaceHover: "oklch(0.268 0.007 34.298)",
1652
+ surfaceActive: "color-mix(in oklab, oklch(0.268 0.007 34.298) 88%, oklch(0.985 0.001 106.423) 12%)",
1653
+ borderSubtle: "oklch(1 0 0 / 10%)",
1654
+ textSecondary: "oklch(0.709 0.01 56.259)",
1655
+ textPlaceholder: "color-mix(in oklab, oklch(0.709 0.01 56.259) 78%, transparent)"
1631
1656
  }
1632
1657
  },
1633
1658
  taupe: {
1634
1659
  light: {
1635
- surfaceElevated: "#faf8f5",
1636
- surfaceOverlay: "#f3ede6",
1637
- foreground: "#3b342e",
1638
- border: "rgba(59, 52, 46, 0.10)",
1639
- mutedForeground: "#8a7f74"
1660
+ surfaceElevated: "oklch(1 0 0)",
1661
+ surfaceOverlay: "oklch(1 0 0)",
1662
+ surfaceHover: "oklch(0.96 0.002 17.2)",
1663
+ surfaceActive: "color-mix(in oklab, oklch(0.96 0.002 17.2) 92%, oklch(0.147 0.004 49.3) 8%)",
1664
+ borderSubtle: "oklch(0.922 0.005 34.3)",
1665
+ textSecondary: "oklch(0.547 0.021 43.1)",
1666
+ textPlaceholder: "color-mix(in oklab, oklch(0.547 0.021 43.1) 78%, transparent)"
1640
1667
  },
1641
1668
  dark: {
1642
- surfaceElevated: "#1c1916",
1643
- surfaceOverlay: "#2a2521",
1644
- foreground: "#f5f0ea",
1645
- border: "rgba(245, 240, 234, 0.10)",
1646
- mutedForeground: "#a89f94"
1669
+ surfaceElevated: "oklch(0.214 0.009 43.1)",
1670
+ surfaceOverlay: "oklch(0.214 0.009 43.1)",
1671
+ surfaceHover: "oklch(0.268 0.011 36.5)",
1672
+ surfaceActive: "color-mix(in oklab, oklch(0.268 0.011 36.5) 88%, oklch(0.986 0.002 67.8) 12%)",
1673
+ borderSubtle: "oklch(1 0 0 / 10%)",
1674
+ textSecondary: "oklch(0.714 0.014 41.2)",
1675
+ textPlaceholder: "color-mix(in oklab, oklch(0.714 0.014 41.2) 78%, transparent)"
1647
1676
  }
1648
1677
  },
1649
1678
  mauve: {
1650
1679
  light: {
1651
- surfaceElevated: "#fbf8fb",
1652
- surfaceOverlay: "#f4eef5",
1653
- foreground: "#34283a",
1654
- border: "rgba(52, 40, 58, 0.10)",
1655
- mutedForeground: "#837388"
1680
+ surfaceElevated: "oklch(1 0 0)",
1681
+ surfaceOverlay: "oklch(1 0 0)",
1682
+ surfaceHover: "oklch(0.96 0.003 325.6)",
1683
+ surfaceActive: "color-mix(in oklab, oklch(0.96 0.003 325.6) 92%, oklch(0.145 0.008 326) 8%)",
1684
+ borderSubtle: "oklch(0.922 0.005 325.62)",
1685
+ textSecondary: "oklch(0.542 0.034 322.5)",
1686
+ textPlaceholder: "color-mix(in oklab, oklch(0.542 0.034 322.5) 78%, transparent)"
1656
1687
  },
1657
1688
  dark: {
1658
- surfaceElevated: "#1b151f",
1659
- surfaceOverlay: "#2a2130",
1660
- foreground: "#f5eef7",
1661
- border: "rgba(245, 238, 247, 0.10)",
1662
- mutedForeground: "#b3a5b8"
1689
+ surfaceElevated: "oklch(0.212 0.019 322.12)",
1690
+ surfaceOverlay: "oklch(0.212 0.019 322.12)",
1691
+ surfaceHover: "oklch(0.263 0.024 320.12)",
1692
+ surfaceActive: "color-mix(in oklab, oklch(0.263 0.024 320.12) 88%, oklch(0.985 0 0) 12%)",
1693
+ borderSubtle: "oklch(1 0 0 / 10%)",
1694
+ textSecondary: "oklch(0.711 0.019 323.02)",
1695
+ textPlaceholder: "color-mix(in oklab, oklch(0.711 0.019 323.02) 78%, transparent)"
1663
1696
  }
1664
1697
  },
1665
1698
  olive: {
1666
1699
  light: {
1667
- surfaceElevated: "#fafbf4",
1668
- surfaceOverlay: "#f0f3e4",
1669
- foreground: "#2d331f",
1670
- border: "rgba(45, 51, 31, 0.10)",
1671
- mutedForeground: "#747b61"
1700
+ surfaceElevated: "oklch(1 0 0)",
1701
+ surfaceOverlay: "oklch(1 0 0)",
1702
+ surfaceHover: "oklch(0.966 0.005 106.5)",
1703
+ surfaceActive: "color-mix(in oklab, oklch(0.966 0.005 106.5) 92%, oklch(0.153 0.006 107.1) 8%)",
1704
+ borderSubtle: "oklch(0.93 0.007 106.5)",
1705
+ textSecondary: "oklch(0.58 0.031 107.3)",
1706
+ textPlaceholder: "color-mix(in oklab, oklch(0.58 0.031 107.3) 78%, transparent)"
1672
1707
  },
1673
1708
  dark: {
1674
- surfaceElevated: "#171a12",
1675
- surfaceOverlay: "#24291b",
1676
- foreground: "#f2f5e8",
1677
- border: "rgba(242, 245, 232, 0.10)",
1678
- mutedForeground: "#abb196"
1709
+ surfaceElevated: "oklch(0.228 0.013 107.4)",
1710
+ surfaceOverlay: "oklch(0.228 0.013 107.4)",
1711
+ surfaceHover: "oklch(0.286 0.016 107.4)",
1712
+ surfaceActive: "color-mix(in oklab, oklch(0.286 0.016 107.4) 88%, oklch(0.988 0.003 106.5) 12%)",
1713
+ borderSubtle: "oklch(1 0 0 / 10%)",
1714
+ textSecondary: "oklch(0.737 0.021 106.9)",
1715
+ textPlaceholder: "color-mix(in oklab, oklch(0.737 0.021 106.9) 78%, transparent)"
1679
1716
  }
1680
1717
  },
1681
1718
  mist: {
1682
1719
  light: {
1683
- surfaceElevated: "#f7fbfb",
1684
- surfaceOverlay: "#edf5f5",
1685
- foreground: "#253638",
1686
- border: "rgba(37, 54, 56, 0.10)",
1687
- mutedForeground: "#697d80"
1720
+ surfaceElevated: "oklch(1 0 0)",
1721
+ surfaceOverlay: "oklch(1 0 0)",
1722
+ surfaceHover: "oklch(0.963 0.002 197.1)",
1723
+ surfaceActive: "color-mix(in oklab, oklch(0.963 0.002 197.1) 92%, oklch(0.148 0.004 228.8) 8%)",
1724
+ borderSubtle: "oklch(0.925 0.005 214.3)",
1725
+ textSecondary: "oklch(0.56 0.021 213.5)",
1726
+ textPlaceholder: "color-mix(in oklab, oklch(0.56 0.021 213.5) 78%, transparent)"
1688
1727
  },
1689
1728
  dark: {
1690
- surfaceElevated: "#111b1d",
1691
- surfaceOverlay: "#1d2b2e",
1692
- foreground: "#edf7f8",
1693
- border: "rgba(237, 247, 248, 0.10)",
1694
- mutedForeground: "#9fb5b8"
1729
+ surfaceElevated: "oklch(0.218 0.008 223.9)",
1730
+ surfaceOverlay: "oklch(0.218 0.008 223.9)",
1731
+ surfaceHover: "oklch(0.275 0.011 216.9)",
1732
+ surfaceActive: "color-mix(in oklab, oklch(0.275 0.011 216.9) 88%, oklch(0.987 0.002 197.1) 12%)",
1733
+ borderSubtle: "oklch(1 0 0 / 10%)",
1734
+ textSecondary: "oklch(0.723 0.014 214.4)",
1735
+ textPlaceholder: "color-mix(in oklab, oklch(0.723 0.014 214.4) 78%, transparent)"
1736
+ }
1737
+ },
1738
+ black: {
1739
+ light: {
1740
+ // Light stays light: white cards + soft grey chrome (same structure as
1741
+ // `neutral`), not a washed dark theme. Character lives in slightly
1742
+ // firmer secondary text / borders than neutral, not in tinted surfaces.
1743
+ surfaceElevated: "oklch(1 0 0)",
1744
+ surfaceOverlay: "oklch(1 0 0)",
1745
+ surfaceHover: "oklch(0.97 0 0)",
1746
+ surfaceActive: "color-mix(in oklab, oklch(0.97 0 0) 92%, oklch(0.145 0 0) 8%)",
1747
+ borderSubtle: "oklch(0.922 0 0)",
1748
+ textSecondary: "oklch(0.52 0 0)",
1749
+ textPlaceholder: "color-mix(in oklab, oklch(0.52 0 0) 78%, transparent)"
1750
+ },
1751
+ dark: {
1752
+ surfaceElevated: "oklch(0.145 0 0)",
1753
+ surfaceOverlay: "oklch(0.165 0 0)",
1754
+ surfaceHover: "oklch(0.22 0 0)",
1755
+ surfaceActive: "color-mix(in oklab, oklch(0.22 0 0) 86%, oklch(0.985 0 0) 14%)",
1756
+ borderSubtle: "oklch(1 0 0 / 12%)",
1757
+ textSecondary: "oklch(0.68 0 0)",
1758
+ textPlaceholder: "color-mix(in oklab, oklch(0.68 0 0) 78%, transparent)"
1695
1759
  }
1696
1760
  }
1697
1761
  };
@@ -2156,109 +2220,43 @@ var CHART_PALETTES = {
2156
2220
  };
2157
2221
 
2158
2222
  // ../wensity-preset/src/curated-fonts.ts
2223
+ var CURATED_FONT_UI_WEIGHTS = [400, 500, 600, 700];
2224
+ function curatedFontCssImportSpecifiers(pkg) {
2225
+ return pkg.weights.map((weight) => `${pkg.packageName}/${weight}.css`);
2226
+ }
2227
+ function fontPackage(packageName, familyName, weights = CURATED_FONT_UI_WEIGHTS) {
2228
+ return { packageName, familyName, weights };
2229
+ }
2159
2230
  var HEADING_FONT_PACKAGES = {
2160
- playfair: {
2161
- packageName: "@fontsource/playfair-display",
2162
- importSpecifier: "@fontsource/playfair-display",
2163
- familyName: "Playfair Display"
2164
- },
2165
- "instrument-serif": {
2166
- packageName: "@fontsource/instrument-serif",
2167
- importSpecifier: "@fontsource/instrument-serif",
2168
- familyName: "Instrument Serif"
2169
- },
2170
- fraunces: {
2171
- packageName: "@fontsource/fraunces",
2172
- importSpecifier: "@fontsource/fraunces",
2173
- familyName: "Fraunces"
2174
- },
2175
- "space-grotesk": {
2176
- packageName: "@fontsource/space-grotesk",
2177
- importSpecifier: "@fontsource/space-grotesk",
2178
- familyName: "Space Grotesk"
2179
- },
2180
- "noto-serif": {
2181
- packageName: "@fontsource/noto-serif",
2182
- importSpecifier: "@fontsource/noto-serif",
2183
- familyName: "Noto Serif"
2184
- },
2185
- "eb-garamond": {
2186
- packageName: "@fontsource/eb-garamond",
2187
- importSpecifier: "@fontsource/eb-garamond",
2188
- familyName: "EB Garamond"
2189
- },
2190
- lora: {
2191
- packageName: "@fontsource/lora",
2192
- importSpecifier: "@fontsource/lora",
2193
- familyName: "Lora"
2194
- },
2195
- montserrat: {
2196
- packageName: "@fontsource/montserrat",
2197
- importSpecifier: "@fontsource/montserrat",
2198
- familyName: "Montserrat"
2199
- },
2200
- manrope: {
2201
- packageName: "@fontsource/manrope",
2202
- importSpecifier: "@fontsource/manrope",
2203
- familyName: "Manrope"
2204
- },
2205
- inter: {
2206
- packageName: "@fontsource/inter",
2207
- importSpecifier: "@fontsource/inter",
2208
- familyName: "Inter"
2209
- }
2231
+ playfair: fontPackage("@fontsource/playfair-display", "Playfair Display"),
2232
+ "instrument-serif": fontPackage(
2233
+ "@fontsource/instrument-serif",
2234
+ "Instrument Serif",
2235
+ [400]
2236
+ ),
2237
+ fraunces: fontPackage("@fontsource/fraunces", "Fraunces"),
2238
+ "space-grotesk": fontPackage("@fontsource/space-grotesk", "Space Grotesk"),
2239
+ "noto-serif": fontPackage("@fontsource/noto-serif", "Noto Serif"),
2240
+ "eb-garamond": fontPackage("@fontsource/eb-garamond", "EB Garamond"),
2241
+ lora: fontPackage("@fontsource/lora", "Lora"),
2242
+ montserrat: fontPackage("@fontsource/montserrat", "Montserrat"),
2243
+ manrope: fontPackage("@fontsource/manrope", "Manrope"),
2244
+ inter: fontPackage("@fontsource/inter", "Inter")
2210
2245
  };
2211
2246
  var BODY_FONT_PACKAGES = {
2212
- inter: {
2213
- packageName: "@fontsource/inter",
2214
- importSpecifier: "@fontsource/inter",
2215
- familyName: "Inter"
2216
- },
2217
- geist: {
2218
- packageName: "@fontsource/geist",
2219
- importSpecifier: "@fontsource/geist",
2220
- familyName: "Geist"
2221
- },
2222
- "dm-sans": {
2223
- packageName: "@fontsource/dm-sans",
2224
- importSpecifier: "@fontsource/dm-sans",
2225
- familyName: "DM Sans"
2226
- },
2227
- "plus-jakarta-sans": {
2228
- packageName: "@fontsource/plus-jakarta-sans",
2229
- importSpecifier: "@fontsource/plus-jakarta-sans",
2230
- familyName: "Plus Jakarta Sans"
2231
- },
2232
- figtree: {
2233
- packageName: "@fontsource/figtree",
2234
- importSpecifier: "@fontsource/figtree",
2235
- familyName: "Figtree"
2236
- },
2237
- "noto-sans": {
2238
- packageName: "@fontsource/noto-sans",
2239
- importSpecifier: "@fontsource/noto-sans",
2240
- familyName: "Noto Sans"
2241
- },
2242
- "public-sans": {
2243
- packageName: "@fontsource/public-sans",
2244
- importSpecifier: "@fontsource/public-sans",
2245
- familyName: "Public Sans"
2246
- },
2247
- outfit: {
2248
- packageName: "@fontsource/outfit",
2249
- importSpecifier: "@fontsource/outfit",
2250
- familyName: "Outfit"
2251
- },
2252
- manrope: {
2253
- packageName: "@fontsource/manrope",
2254
- importSpecifier: "@fontsource/manrope",
2255
- familyName: "Manrope"
2256
- },
2257
- "ibm-plex-sans": {
2258
- packageName: "@fontsource/ibm-plex-sans",
2259
- importSpecifier: "@fontsource/ibm-plex-sans",
2260
- familyName: "IBM Plex Sans"
2261
- }
2247
+ inter: fontPackage("@fontsource/inter", "Inter"),
2248
+ geist: fontPackage("@fontsource/geist", "Geist"),
2249
+ "dm-sans": fontPackage("@fontsource/dm-sans", "DM Sans"),
2250
+ "plus-jakarta-sans": fontPackage(
2251
+ "@fontsource/plus-jakarta-sans",
2252
+ "Plus Jakarta Sans"
2253
+ ),
2254
+ figtree: fontPackage("@fontsource/figtree", "Figtree"),
2255
+ "noto-sans": fontPackage("@fontsource/noto-sans", "Noto Sans"),
2256
+ "public-sans": fontPackage("@fontsource/public-sans", "Public Sans"),
2257
+ outfit: fontPackage("@fontsource/outfit", "Outfit"),
2258
+ manrope: fontPackage("@fontsource/manrope", "Manrope"),
2259
+ "ibm-plex-sans": fontPackage("@fontsource/ibm-plex-sans", "IBM Plex Sans")
2262
2260
  };
2263
2261
  var HEADING_FONT_CSS = {
2264
2262
  system: "var(--font-display)",
@@ -2382,16 +2380,15 @@ function baseFromInherit(mode) {
2382
2380
  return { ...INHERIT_BASE_EXPRESSIONS[mode] };
2383
2381
  }
2384
2382
  function baseFromSeeds(seeds, mode) {
2385
- const hoverPercent = mode === "light" ? 4 : 5;
2386
- const activePercent = mode === "light" ? 7 : 10;
2383
+ void mode;
2387
2384
  return {
2388
2385
  surfaceElevated: seeds.surfaceElevated,
2389
2386
  surfaceOverlay: seeds.surfaceOverlay,
2390
- surfaceHover: colorMix(seeds.foreground, hoverPercent),
2391
- surfaceActive: colorMix(seeds.foreground, activePercent),
2392
- borderSubtle: colorMix(seeds.border, 60),
2393
- textSecondary: colorMix(seeds.foreground, 72),
2394
- textPlaceholder: colorMix(seeds.mutedForeground, 85)
2387
+ surfaceHover: seeds.surfaceHover,
2388
+ surfaceActive: seeds.surfaceActive,
2389
+ borderSubtle: seeds.borderSubtle,
2390
+ textSecondary: seeds.textSecondary,
2391
+ textPlaceholder: seeds.textPlaceholder
2395
2392
  };
2396
2393
  }
2397
2394
  function ringAndSelectedForInk(mode) {
@@ -2400,10 +2397,10 @@ function ringAndSelectedForInk(mode) {
2400
2397
  surfaceSelected: FIXED_SURFACE_SELECTED[mode]
2401
2398
  };
2402
2399
  }
2403
- function ringAndSelectedFromAccent(accent, mode) {
2400
+ function ringFromAccentWithNeutralSelected(accent, mode) {
2404
2401
  return {
2405
2402
  ring: colorMix(accent, 45),
2406
- surfaceSelected: colorMix(accent, mode === "light" ? 6 : 8)
2403
+ surfaceSelected: FIXED_SURFACE_SELECTED[mode]
2407
2404
  };
2408
2405
  }
2409
2406
  function buildModeTokens(args) {
@@ -2448,17 +2445,40 @@ function resolveStyleConfig(style) {
2448
2445
  }
2449
2446
  function resolveChartStops(chartPalette, themeColor, mode) {
2450
2447
  if (chartPalette === "theme") {
2451
- return CHART_PALETTES.theme[themeColor][mode];
2448
+ const themeStops = CHART_PALETTES.theme[themeColor];
2449
+ if (!themeStops) {
2450
+ throw new Error(
2451
+ `Missing CHART_PALETTES.theme entry for themeColor "${themeColor}".`
2452
+ );
2453
+ }
2454
+ return themeStops[mode];
2452
2455
  }
2453
- return CHART_PALETTES[chartPalette][mode];
2456
+ const stops = CHART_PALETTES[chartPalette];
2457
+ if (!stops) {
2458
+ throw new Error(
2459
+ `Missing CHART_PALETTES entry for chartPalette "${chartPalette}".`
2460
+ );
2461
+ }
2462
+ return stops[mode];
2454
2463
  }
2455
2464
  function resolveStyleConfigCanonical(style) {
2456
2465
  const theme = THEME_COLOR_PALETTE[style.themeColor];
2466
+ if (!theme) {
2467
+ throw new Error(
2468
+ `Missing THEME_COLOR_PALETTE entry for themeColor "${style.themeColor}".`
2469
+ );
2470
+ }
2471
+ const namedBase = style.baseColor === "inherit" ? null : BASE_COLOR_PALETTE[style.baseColor];
2472
+ if (style.baseColor !== "inherit" && !namedBase) {
2473
+ throw new Error(
2474
+ `Missing BASE_COLOR_PALETTE entry for baseColor "${style.baseColor}".`
2475
+ );
2476
+ }
2457
2477
  const useAccentRing = COLORED_THEME_IDS.has(style.themeColor);
2458
2478
  const resolveMode = (mode) => {
2459
- const base = style.baseColor === "inherit" ? baseFromInherit(mode) : baseFromSeeds(BASE_COLOR_PALETTE[style.baseColor][mode], mode);
2479
+ const base = namedBase ? baseFromSeeds(namedBase[mode], mode) : baseFromInherit(mode);
2460
2480
  const control = theme[mode];
2461
- const ringSelected = useAccentRing ? ringAndSelectedFromAccent(control.controlSolid, mode) : ringAndSelectedForInk(mode);
2481
+ const ringSelected = useAccentRing ? ringFromAccentWithNeutralSelected(control.controlSolid, mode) : ringAndSelectedForInk(mode);
2462
2482
  const charts = resolveChartStops(style.chartPalette, style.themeColor, mode);
2463
2483
  return buildModeTokens({ base, control, ringSelected, charts });
2464
2484
  };
@@ -2876,10 +2896,12 @@ function planFontInstall(headingFont, bodyFont) {
2876
2896
  seenPackages.add(meta.packageName);
2877
2897
  packages.push(meta.packageName);
2878
2898
  }
2879
- const line = `@import "${meta.importSpecifier}";`;
2880
- if (!seenImports.has(line)) {
2881
- seenImports.add(line);
2882
- importLines.push(line);
2899
+ for (const specifier of curatedFontCssImportSpecifiers(meta)) {
2900
+ const line = `@import "${specifier}";`;
2901
+ if (!seenImports.has(line)) {
2902
+ seenImports.add(line);
2903
+ importLines.push(line);
2904
+ }
2883
2905
  }
2884
2906
  };
2885
2907
  if (headingFont !== "system") {
package/package.json CHANGED
@@ -1,7 +1,23 @@
1
1
  {
2
2
  "name": "wensity",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Wensity component registry CLI",
5
+ "license": "MIT",
6
+ "author": "Wensity <hey@wensity.com> (https://wensity.com)",
7
+ "homepage": "https://ui.wensity.com",
8
+ "bugs": {
9
+ "email": "hey@wensity.com"
10
+ },
11
+ "keywords": [
12
+ "wensity",
13
+ "react",
14
+ "nextjs",
15
+ "tailwindcss",
16
+ "components",
17
+ "ui",
18
+ "design-system",
19
+ "shadcn"
20
+ ],
5
21
  "type": "module",
6
22
  "bin": {
7
23
  "wensity": "dist/index.js"
@@ -13,22 +29,16 @@
13
29
  "dist",
14
30
  "README.md"
15
31
  ],
16
- "scripts": {
17
- "build": "tsup --config tsup.config.ts",
18
- "typecheck": "tsc --noEmit",
19
- "test": "vitest run --config vitest.config.ts",
20
- "lint": "echo 'no lint'"
21
- },
22
32
  "engines": {
23
33
  "node": ">=20.0.0"
24
34
  },
25
35
  "devDependencies": {
26
36
  "@types/node": "^22.10.2",
27
- "@wensity/preset": "workspace:*",
28
37
  "lucide-react": "^1.24.0",
29
38
  "tsup": "^8.3.5",
30
39
  "typescript": "^5.7.2",
31
- "vitest": "^4.1.5"
40
+ "vitest": "^4.1.5",
41
+ "@wensity/preset": "0.1.0"
32
42
  },
33
43
  "publishConfig": {
34
44
  "access": "public"
@@ -38,5 +48,11 @@
38
48
  "cli-table3": "^0.6.5",
39
49
  "ora": "^9.4.0",
40
50
  "picocolors": "^1.1.1"
51
+ },
52
+ "scripts": {
53
+ "build": "tsup --config tsup.config.ts",
54
+ "typecheck": "tsc --noEmit",
55
+ "test": "vitest run --config vitest.config.ts",
56
+ "lint": "echo 'no lint'"
41
57
  }
42
- }
58
+ }