@ctrl-ui/react 0.8.16 → 0.8.18

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.
@@ -462,10 +462,17 @@
462
462
  --radius-lg: var(--radius-lg);
463
463
  --radius-xl: var(--radius-xl);
464
464
  --radius-2xl: var(--radius-2xl);
465
+ --radius-control: var(--radius-control);
465
466
  --radius-field: var(--radius-field);
466
467
  --radius-panel: var(--radius-panel);
467
468
  --radius-scene: var(--radius-scene);
468
469
 
470
+ --spacing-control: var(--control-h);
471
+ --spacing-control-xs: var(--control-h-xs);
472
+ --spacing-control-sm: var(--control-h-sm);
473
+ --spacing-control-md: var(--control-h-md);
474
+ --spacing-control-lg: var(--control-h-lg);
475
+
469
476
  --text-micro: var(--text-micro);
470
477
  --text-caption: var(--text-caption);
471
478
  --text-label: var(--text-label);
@@ -594,6 +601,31 @@
594
601
  --default-transition-timing-function: var(--ease-standard);
595
602
  }
596
603
 
604
+ @utility text-display {
605
+ font-family: var(--font-display);
606
+ text-wrap: balance;
607
+ }
608
+
609
+ @utility text-heading-1 {
610
+ font-family: var(--font-display);
611
+ text-wrap: balance;
612
+ }
613
+
614
+ @utility text-heading-2 {
615
+ font-family: var(--font-display);
616
+ text-wrap: balance;
617
+ }
618
+
619
+ @utility text-heading-3 {
620
+ font-family: var(--font-display);
621
+ text-wrap: balance;
622
+ }
623
+
624
+ @utility text-heading-4 {
625
+ font-family: var(--font-display);
626
+ text-wrap: balance;
627
+ }
628
+
597
629
  @layer base {
598
630
  *,
599
631
  ::after,
@@ -33,13 +33,39 @@
33
33
  --text-display--letter-spacing: -0.02em;
34
34
 
35
35
  /* Font ROLES: body+display default to --font-sans; brand re-values ONE token for headings(font-display)/body(font-body)
36
- own face. Headings apply `font-display` utility on element (font-family isn't a paired --text-* prop). */
36
+ own face. */
37
37
  --font-body: var(--font-sans);
38
38
  --font-display: var(--font-sans);
39
39
  }
40
40
 
41
+ /*
42
+ * Heading rungs also carry the display face and balanced wrapping (Tailwind merges this into the same `text-heading-N` class),
43
+ * so a heading is ONE class: `text-heading-2`, never `text-heading-2 font-display text-balance font-semibold`.
44
+ */
45
+ @utility text-display {
46
+ font-family: var(--font-display);
47
+ text-wrap: balance;
48
+ }
49
+ @utility text-heading-1 {
50
+ font-family: var(--font-display);
51
+ text-wrap: balance;
52
+ }
53
+ @utility text-heading-2 {
54
+ font-family: var(--font-display);
55
+ text-wrap: balance;
56
+ }
57
+ @utility text-heading-3 {
58
+ font-family: var(--font-display);
59
+ text-wrap: balance;
60
+ }
61
+ @utility text-heading-4 {
62
+ font-family: var(--font-display);
63
+ text-wrap: balance;
64
+ }
65
+
41
66
  /*
42
67
  * History: fixed 3 competing type systems (Tailwind defaults + named rungs + raw text-[Npx]) into one rung/role; 14px = body.
43
- * Usage: apply utility directly to element (no <Text> component), e.g. text-heading-1 on <h1>, text-body on <p>.
68
+ * Usage: apply the rung directly to the semantic element (no <Text> component), e.g. text-heading-1 on <h1>, text-body on <p>.
69
+ * Heading LEVEL is the document outline; the RUNG is the look. They are decoupled on purpose: an <h3> may wear text-heading-2.
44
70
  * Control chrome text is sized by its recipe (`--cui-button-font-size`, `--cui-field-font-size`), not by these utilities.
45
71
  */
@@ -19,7 +19,7 @@ function InputOTPSlot({ index, length, className, ...props }) {
19
19
  "data-control": "true",
20
20
  "aria-label": slotAriaLabel(index, length),
21
21
  "aria-labelledby": index === 0 ? labelId : void 0,
22
- className: cn("relative flex size-[var(--control-h-md)] items-center justify-center", className),
22
+ className: cn("relative flex size-control-md items-center justify-center", className),
23
23
  ...props
24
24
  });
25
25
  }
@@ -91,7 +91,7 @@ function NavigationMenuLink({ variant = "default", className, active, children,
91
91
  "data-popup-part": "navigation-link",
92
92
  "data-variant": variant,
93
93
  active,
94
- className: cn("block select-none", variant === "compact" && "inline-flex h-[var(--control-h-sm)] items-center px-[calc(var(--padding-x)*0.75)]", className),
94
+ className: cn("block select-none", variant === "compact" && "inline-flex h-control-sm items-center px-[calc(var(--padding-x)*0.75)]", className),
95
95
  ...props,
96
96
  children
97
97
  });
@@ -30,7 +30,7 @@ function PaginationItem({ className, ...props }) {
30
30
  ...props
31
31
  });
32
32
  }
33
- const paginationLinkChrome = "inline-flex h-[var(--control-h-sm)] min-w-[var(--control-h-sm)] cursor-pointer select-none items-center justify-center whitespace-nowrap aria-disabled:pointer-events-none [&>svg]:size-4 [&>svg]:shrink-0";
33
+ const paginationLinkChrome = "inline-flex h-control-sm min-w-control-sm cursor-pointer select-none items-center justify-center whitespace-nowrap aria-disabled:pointer-events-none [&>svg]:size-4 [&>svg]:shrink-0";
34
34
  function PaginationLink({ isActive = false, disabled = false, href, className, ...props }) {
35
35
  return /* @__PURE__ */ jsx("a", {
36
36
  "aria-current": isActive ? "page" : void 0,
@@ -71,7 +71,7 @@ function PaginationEllipsis({ label = "More pages", className, ...props }) {
71
71
  "data-control-ui": "pagination",
72
72
  "data-control-family": "pagination",
73
73
  "data-slot": "ellipsis",
74
- className: cn("flex h-[var(--control-h-sm)] min-w-[var(--control-h-sm)] items-center justify-center [&>svg]:size-4", className),
74
+ className: cn("flex h-control-sm min-w-control-sm items-center justify-center [&>svg]:size-4", className),
75
75
  ...props,
76
76
  children: [/* @__PURE__ */ jsx(MoreHorizontal, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", {
77
77
  className: "sr-only",
@@ -57,7 +57,7 @@ function SidebarGroupLabel({ className, render, children, ...props }) {
57
57
  "data-control-ui": "sidebar",
58
58
  "data-control-family": "sidebar",
59
59
  "data-slot": "group-label",
60
- className: cn("flex h-[var(--control-h-sm)] shrink-0 items-center [&>svg]:size-4 [&>svg]:shrink-0", "group-data-[collapsible=icon]:invisible group-data-[collapsible=icon]:-mt-[var(--control-h-sm)] group-data-[collapsible=icon]:opacity-0", className),
60
+ className: cn("flex h-control-sm shrink-0 items-center [&>svg]:size-4 [&>svg]:shrink-0", "group-data-[collapsible=icon]:invisible group-data-[collapsible=icon]:-mt-control-sm group-data-[collapsible=icon]:opacity-0", className),
61
61
  children
62
62
  }
63
63
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctrl-ui/react",
3
- "version": "0.8.16",
3
+ "version": "0.8.18",
4
4
  "description": "Control UI components, blocks, and primitives with neutral defaults and consumer-owned themes.",
5
5
  "license": "MIT",
6
6
  "repository": {