@devfellowship/components 1.1.0 → 1.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/dist/index.cjs CHANGED
@@ -3214,7 +3214,7 @@ var Sidebar = React28.forwardRef(({ side = "left", variant = "sidebar", collapsi
3214
3214
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3215
3215
  "div",
3216
3216
  {
3217
- className: cn("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground", className),
3217
+ className: cn("flex h-full w-[var(--sidebar-width)] flex-col bg-sidebar text-sidebar-foreground", className),
3218
3218
  ref,
3219
3219
  ...props,
3220
3220
  children
@@ -3227,7 +3227,7 @@ var Sidebar = React28.forwardRef(({ side = "left", variant = "sidebar", collapsi
3227
3227
  {
3228
3228
  "data-sidebar": "sidebar",
3229
3229
  "data-mobile": "true",
3230
- className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
3230
+ className: "w-[var(--sidebar-width)] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
3231
3231
  style: {
3232
3232
  "--sidebar-width": SIDEBAR_WIDTH_MOBILE
3233
3233
  },
@@ -3250,10 +3250,10 @@ var Sidebar = React28.forwardRef(({ side = "left", variant = "sidebar", collapsi
3250
3250
  "div",
3251
3251
  {
3252
3252
  className: cn(
3253
- "relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear",
3253
+ "relative h-svh w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear",
3254
3254
  "group-data-[collapsible=offcanvas]:w-0",
3255
3255
  "group-data-[side=right]:rotate-180",
3256
- variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon]"
3256
+ variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]"
3257
3257
  )
3258
3258
  }
3259
3259
  ),
@@ -3261,10 +3261,10 @@ var Sidebar = React28.forwardRef(({ side = "left", variant = "sidebar", collapsi
3261
3261
  "div",
3262
3262
  {
3263
3263
  className: cn(
3264
- "fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",
3264
+ "fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex",
3265
3265
  side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
3266
3266
  // Adjust the padding for floating and inset variants.
3267
- variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",
3267
+ variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : "group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",
3268
3268
  className
3269
3269
  ),
3270
3270
  ...props,
@@ -3571,7 +3571,7 @@ var SidebarMenuSkeleton = React28.forwardRef(({ className, showIcon = false, ...
3571
3571
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3572
3572
  Skeleton,
3573
3573
  {
3574
- className: "h-4 max-w-[--skeleton-width] flex-1",
3574
+ className: "h-4 max-w-[var(--skeleton-width)] flex-1",
3575
3575
  "data-sidebar": "menu-skeleton-text",
3576
3576
  style: {
3577
3577
  "--skeleton-width": width
@@ -4954,7 +4954,7 @@ function AppSidebar({
4954
4954
  return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SidebarProvider, { defaultOpen, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex min-h-screen w-full", children: [
4955
4955
  /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SidebarInner, { ...props }),
4956
4956
  /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col flex-1 min-w-0", children: [
4957
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SidebarTrigger, {}) }),
4957
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "sticky top-0 z-20 flex h-12 shrink-0 items-center gap-2 border-b border-sidebar-border bg-background/80 px-2 backdrop-blur", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SidebarTrigger, {}) }),
4958
4958
  children
4959
4959
  ] })
4960
4960
  ] }) });
package/dist/index.js CHANGED
@@ -2892,7 +2892,7 @@ var Sidebar = React28.forwardRef(({ side = "left", variant = "sidebar", collapsi
2892
2892
  return /* @__PURE__ */ jsx40(
2893
2893
  "div",
2894
2894
  {
2895
- className: cn("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground", className),
2895
+ className: cn("flex h-full w-[var(--sidebar-width)] flex-col bg-sidebar text-sidebar-foreground", className),
2896
2896
  ref,
2897
2897
  ...props,
2898
2898
  children
@@ -2905,7 +2905,7 @@ var Sidebar = React28.forwardRef(({ side = "left", variant = "sidebar", collapsi
2905
2905
  {
2906
2906
  "data-sidebar": "sidebar",
2907
2907
  "data-mobile": "true",
2908
- className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
2908
+ className: "w-[var(--sidebar-width)] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
2909
2909
  style: {
2910
2910
  "--sidebar-width": SIDEBAR_WIDTH_MOBILE
2911
2911
  },
@@ -2928,10 +2928,10 @@ var Sidebar = React28.forwardRef(({ side = "left", variant = "sidebar", collapsi
2928
2928
  "div",
2929
2929
  {
2930
2930
  className: cn(
2931
- "relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear",
2931
+ "relative h-svh w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear",
2932
2932
  "group-data-[collapsible=offcanvas]:w-0",
2933
2933
  "group-data-[side=right]:rotate-180",
2934
- variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon]"
2934
+ variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]"
2935
2935
  )
2936
2936
  }
2937
2937
  ),
@@ -2939,10 +2939,10 @@ var Sidebar = React28.forwardRef(({ side = "left", variant = "sidebar", collapsi
2939
2939
  "div",
2940
2940
  {
2941
2941
  className: cn(
2942
- "fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",
2942
+ "fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex",
2943
2943
  side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
2944
2944
  // Adjust the padding for floating and inset variants.
2945
- variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",
2945
+ variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : "group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",
2946
2946
  className
2947
2947
  ),
2948
2948
  ...props,
@@ -3249,7 +3249,7 @@ var SidebarMenuSkeleton = React28.forwardRef(({ className, showIcon = false, ...
3249
3249
  /* @__PURE__ */ jsx40(
3250
3250
  Skeleton,
3251
3251
  {
3252
- className: "h-4 max-w-[--skeleton-width] flex-1",
3252
+ className: "h-4 max-w-[var(--skeleton-width)] flex-1",
3253
3253
  "data-sidebar": "menu-skeleton-text",
3254
3254
  style: {
3255
3255
  "--skeleton-width": width
@@ -4640,7 +4640,7 @@ function AppSidebar({
4640
4640
  return /* @__PURE__ */ jsx61(SidebarProvider, { defaultOpen, children: /* @__PURE__ */ jsxs29("div", { className: "flex min-h-screen w-full", children: [
4641
4641
  /* @__PURE__ */ jsx61(SidebarInner, { ...props }),
4642
4642
  /* @__PURE__ */ jsxs29("div", { className: "flex flex-col flex-1 min-w-0", children: [
4643
- /* @__PURE__ */ jsx61("div", { className: "p-2", children: /* @__PURE__ */ jsx61(SidebarTrigger, {}) }),
4643
+ /* @__PURE__ */ jsx61("div", { className: "sticky top-0 z-20 flex h-12 shrink-0 items-center gap-2 border-b border-sidebar-border bg-background/80 px-2 backdrop-blur", children: /* @__PURE__ */ jsx61(SidebarTrigger, {}) }),
4644
4644
  children
4645
4645
  ] })
4646
4646
  ] }) });
@@ -0,0 +1,84 @@
1
+ /*
2
+ * @devfellowship/components — shadcn HSL-channel bridge (DS v0, dark-only)
3
+ *
4
+ * WHY THIS FILE EXISTS
5
+ * --------------------
6
+ * The DS ships its semantic vars (`--background`, `--primary`, …) as **hex**
7
+ * values in tokens.css (see the "Compatibility aliases" block). That's what the
8
+ * DS's own Tailwind v4 preset (`@dfl/components/tailwind`) consumes via
9
+ * `@theme inline { --color-background: var(--background); … }` — utilities like
10
+ * `bg-background` resolve correctly because Tailwind reads a raw color.
11
+ *
12
+ * But most fleet apps are **shadcn-slate**: their Tailwind theme wraps the same
13
+ * var names as `hsl(var(--background))`, `hsl(var(--primary))`, … — the standard
14
+ * shadcn convention where each var holds bare **HSL CHANNELS** (e.g.
15
+ * `--background: 222 47% 11%`, NO `hsl()` wrapper). If such an app imports the
16
+ * DS hex layer wholesale, hex lands inside `hsl()` → `hsl(#0a0908)` → invalid
17
+ * CSS → broken render.
18
+ *
19
+ * This bridge re-declares the STANDARD shadcn semantic vars as HSL CHANNELS
20
+ * mapped to the DS v0 dark palette, so a shadcn-slate app's existing
21
+ * `hsl(var(--background))` resolves to DS dark on import — zero hand-mirroring.
22
+ *
23
+ * IMPORTANT — this is ADDITIVE and OPT-IN. It is a SEPARATE export. It does NOT
24
+ * change the hex layer (`@dfl/components/styles` / `tokens.css`), so existing
25
+ * v1.1.0 hex-var consumers keep working untouched. The channels below are
26
+ * dark-only (DS v0 is a dark design system); scope under `.dark` is provided so
27
+ * apps that gate on `<html class="dark">` (shadcn default) also resolve.
28
+ *
29
+ * WHICH IMPORT DO I USE?
30
+ * ----------------------
31
+ * • DS-native app (uses `bg-background` via @dfl/components/tailwind, or reads
32
+ * the hex `--*` vars directly):
33
+ * @import '@devfellowship/components/styles';
34
+ *
35
+ * • shadcn-slate app (Tailwind theme uses `hsl(var(--background))` etc.):
36
+ * @import '@devfellowship/components/shadcn';
37
+ * then set dark mode (e.g. <html class="dark"> or default).
38
+ * No need to hand-mirror the DS palette anymore.
39
+ *
40
+ * Channels were converted from the canonical DS v0 hex palette (tokens.css):
41
+ * sand-950 #0A0908 → 30 11% 4% sand-900 #141210 → 30 11% 7%
42
+ * sand-850 #1A1714 → 30 13% 9% sand-800 #1F1C18 → 34 13% 11%
43
+ * sand-700 #2A2622 → 30 11% 15% sand-400 #7D7568 → 37 9% 45%
44
+ * sand-200 #C9C0B4 → 34 16% 75% sand-50 #F6F1E7 → 40 45% 94%
45
+ * amber-500 #E07A4A → 19 71% 58% red-500 #E07A7A → 0 62% 68%
46
+ *
47
+ * Override any channel in your own CSS to retheme.
48
+ */
49
+
50
+ :root,
51
+ .dark {
52
+ /* Surfaces / ink */
53
+ --background: 30 11% 4%; /* surface-page — sand-950 #0A0908 */
54
+ --foreground: 40 45% 94%; /* ink-primary — sand-50 #F6F1E7 */
55
+
56
+ --card: 30 11% 7%; /* surface-panel — sand-900 #141210 */
57
+ --card-foreground: 40 45% 94%;
58
+
59
+ --popover: 30 13% 9%; /* surface-raised — sand-850 #1A1714 */
60
+ --popover-foreground: 40 45% 94%;
61
+
62
+ /* Brand */
63
+ --primary: 19 71% 58%; /* brand — amber-500 #E07A4A */
64
+ --primary-foreground: 30 11% 4%; /* ink-inverse — sand-950 #0A0908 */
65
+
66
+ --secondary: 30 11% 7%; /* surface-panel — sand-900 #141210 */
67
+ --secondary-foreground: 34 16% 75%; /* ink-secondary — sand-200 #C9C0B4 */
68
+
69
+ --muted: 30 13% 9%; /* surface-raised — sand-850 #1A1714 */
70
+ --muted-foreground: 37 9% 45%; /* ink-muted — sand-400 #7D7568 */
71
+
72
+ --accent: 34 13% 11%; /* surface-elevated — sand-800 #1F1C18 */
73
+ --accent-foreground: 40 45% 94%; /* ink-primary — sand-50 #F6F1E7 */
74
+
75
+ --destructive: 0 62% 68%; /* danger — red-500 #E07A7A */
76
+ --destructive-foreground: 40 45% 94%;
77
+
78
+ /* Lines */
79
+ --border: 30 11% 15%; /* border-subtle — sand-700 #2A2622 */
80
+ --input: 30 11% 15%; /* border-subtle — sand-700 #2A2622 */
81
+ --ring: 19 71% 58%; /* brand — amber-500 #E07A4A */
82
+
83
+ --radius: 0.375rem; /* 6px — matches DS --p-radius-md */
84
+ }
@@ -11,140 +11,11 @@
11
11
  * Or combined if you only need utilities:
12
12
  * @import 'tailwindcss';
13
13
  * @import '@dfl/components/tailwind';
14
+ *
15
+ * NOTE: The token→utility `@theme inline` mappings now live in
16
+ * theme-mappings.css (single source of truth, also imported by theme.css so
17
+ * `/styles` consumers get the utilities wired without importing `/tailwind`).
14
18
  */
15
19
 
16
20
  @import 'tailwindcss';
17
-
18
- @theme inline {
19
- /* ─── Colours ──────────────────────────────────────────────────────────── */
20
- --color-background: var(--background);
21
- --color-foreground: var(--foreground);
22
-
23
- --color-card: var(--card);
24
- --color-card-foreground: var(--card-foreground);
25
-
26
- --color-popover: var(--popover);
27
- --color-popover-foreground: var(--popover-foreground);
28
-
29
- --color-primary: var(--primary);
30
- --color-primary-foreground: var(--primary-foreground);
31
-
32
- --color-secondary: var(--secondary);
33
- --color-secondary-foreground: var(--secondary-foreground);
34
-
35
- --color-muted: var(--muted);
36
- --color-muted-foreground: var(--muted-foreground);
37
-
38
- --color-accent: var(--accent);
39
- --color-accent-foreground: var(--accent-foreground);
40
-
41
- --color-destructive: var(--destructive);
42
- --color-destructive-foreground: var(--destructive-foreground);
43
-
44
- --color-border: var(--border);
45
- --color-input: var(--input);
46
- --color-ring: var(--ring);
47
-
48
- /* Brand shortcuts */
49
- --color-brand: var(--brand-orange);
50
- --color-brand-accent: var(--brand-accent);
51
- --color-brand-dark: var(--brand-dark);
52
-
53
- /* Sidebar */
54
- --color-sidebar: var(--sidebar-background);
55
- --color-sidebar-foreground: var(--sidebar-foreground);
56
- --color-sidebar-primary: var(--sidebar-primary);
57
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
58
- --color-sidebar-accent: var(--sidebar-accent);
59
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
60
- --color-sidebar-border: var(--sidebar-border);
61
- --color-sidebar-ring: var(--sidebar-ring);
62
-
63
- /* Charts */
64
- --color-chart-1: var(--chart-1);
65
- --color-chart-2: var(--chart-2);
66
- --color-chart-3: var(--chart-3);
67
- --color-chart-4: var(--chart-4);
68
- --color-chart-5: var(--chart-5);
69
-
70
- /* ─── Border radius ────────────────────────────────────────────────────── */
71
- --radius-sm: var(--radius-sm);
72
- --radius-md: var(--radius-md);
73
- --radius-lg: var(--radius-lg);
74
- --radius-xl: var(--radius-xl);
75
- --radius-full: var(--radius-full);
76
-
77
- /* ─── Fonts ────────────────────────────────────────────────────────────── */
78
- --font-sans: var(--font-sans);
79
- --font-condensed: var(--font-condensed);
80
- --font-mono: var(--font-mono);
81
- --font-editorial: var(--font-editorial);
82
-
83
- /* ─── Editorial / paper (light, NOT default — see tokens.css §5.8) ─────── */
84
- --color-paper: var(--paper);
85
- --color-paper-2: var(--paper-2);
86
- --color-ink-on-paper: var(--ink-on-paper);
87
- --color-brand-on-light: var(--brand-on-light);
88
-
89
- /* ─── Motion — DS-spec named easings → `ease-*` utilities ─────────────── */
90
- --ease-standard: var(--p-ease-standard);
91
- --ease-snap: var(--p-ease-snap);
92
- --ease-out-std: var(--p-ease-out-std);
93
- --ease-in-std: var(--p-ease-in-std);
94
-
95
- /* ─── Z-index scale → `z-*` utilities (z-sticky, z-modal, z-toast, …) ─── */
96
- --z-base: var(--p-z-base);
97
- --z-sticky: var(--p-z-sticky);
98
- --z-dropdown: var(--p-z-dropdown);
99
- --z-tooltip: var(--p-z-tooltip);
100
- --z-modal-scrim: var(--p-z-modal-scrim);
101
- --z-modal: var(--p-z-modal);
102
- --z-toast: var(--p-z-toast);
103
-
104
- /* ─── DS v0 component tokens (--c-*) exposed as Tailwind utilities ────── */
105
- /* Atoms cluster (Phase 1.1) — Button + Input + Card knobs */
106
- --color-c-button-primary-bg: var(--c-button-primary-bg);
107
- --color-c-button-primary-fg: var(--c-button-primary-fg);
108
- --color-c-button-primary-bg-hover: var(--c-button-primary-bg-hover);
109
- --color-c-button-primary-bg-active: var(--c-button-primary-bg-active);
110
- --color-c-button-secondary-bg: var(--c-button-secondary-bg);
111
- --color-c-button-secondary-fg: var(--c-button-secondary-fg);
112
- --color-c-button-secondary-border: var(--c-button-secondary-border);
113
- --color-c-button-secondary-bg-hover: var(--c-button-secondary-bg-hover);
114
- --color-c-button-secondary-border-hover: var(--c-button-secondary-border-hover);
115
- --color-c-button-ghost-fg: var(--c-button-ghost-fg);
116
- --color-c-button-ghost-bg-hover: var(--c-button-ghost-bg-hover);
117
- --color-c-button-destructive-fg: var(--c-button-destructive-fg);
118
- --color-c-button-destructive-border: var(--c-button-destructive-border);
119
- --color-c-button-destructive-bg-hover: var(--c-button-destructive-bg-hover);
120
- --color-c-button-success-bg: var(--c-button-success-bg);
121
- --color-c-button-success-fg: var(--c-button-success-fg);
122
- --color-c-input-bg: var(--c-input-bg);
123
- --color-c-input-fg: var(--c-input-fg);
124
- --color-c-input-placeholder: var(--c-input-placeholder);
125
- --color-c-input-border: var(--c-input-border);
126
- --color-c-input-border-hover: var(--c-input-border-hover);
127
- --color-c-input-border-focus: var(--c-input-border-focus);
128
- --color-c-input-ring-focus: var(--c-input-ring-focus);
129
- --color-c-input-border-error: var(--c-input-border-error);
130
-
131
- /* Semantic ink as utilities */
132
- --color-s-ink-primary: var(--s-ink-primary);
133
- --color-s-ink-secondary: var(--s-ink-secondary);
134
- --color-s-ink-muted: var(--s-ink-muted);
135
- --color-s-ink-disabled: var(--s-ink-disabled);
136
- --color-s-surface-page: var(--s-surface-page);
137
- --color-s-surface-panel: var(--s-surface-panel);
138
- --color-s-surface-raised: var(--s-surface-raised);
139
- --color-s-surface-elevated: var(--s-surface-elevated);
140
- --color-s-border-subtle: var(--s-border-subtle);
141
- --color-s-border-strong: var(--s-border-strong);
142
- --color-s-border-focus: var(--s-border-focus);
143
- --color-s-brand-solid: var(--s-brand-solid);
144
- --color-s-brand-hover: var(--s-brand-hover);
145
- --color-s-brand-subtle: var(--s-brand-subtle);
146
- --color-s-brand-ring: var(--s-brand-ring);
147
- }
148
-
149
- /* Dark mode variant — class-based */
150
- @variant dark (&:is(.dark *));
21
+ @import './theme-mappings.css';
@@ -0,0 +1,153 @@
1
+ /*
2
+ * @dfl/components — Tailwind v4 token→utility mappings (DS v0)
3
+ *
4
+ * Single source of truth for the `@theme inline` color/font/radius mappings
5
+ * that turn the DS tokens (--popover, --sidebar-background, …) into Tailwind v4
6
+ * utility classes (bg-popover, bg-sidebar, …).
7
+ *
8
+ * Imported by BOTH:
9
+ * • theme.css (the `@devfellowship/components/styles` export) — so apps
10
+ * that import `/styles` + `tailwindcss` directly get the utilities wired
11
+ * WITHOUT also having to import `/tailwind`. This fixes the "transparent
12
+ * popover / dead bg-* utility" class of bugs where bg-popover / bg-sidebar
13
+ * resolved to nothing because --color-popover / --color-sidebar were never
14
+ * registered. (regression from the DS dark-chrome refactor; fixed v1.2.1)
15
+ * • tailwind.css (the `@devfellowship/components/tailwind` preset export).
16
+ *
17
+ * `@theme inline` is additive and idempotent — importing it from both a /styles
18
+ * consumer and a /tailwind consumer in the same app is a harmless no-op.
19
+ */
20
+
21
+ @theme inline {
22
+ /* ─── Colours ──────────────────────────────────────────────────────────── */
23
+ --color-background: var(--background);
24
+ --color-foreground: var(--foreground);
25
+
26
+ --color-card: var(--card);
27
+ --color-card-foreground: var(--card-foreground);
28
+
29
+ --color-popover: var(--popover);
30
+ --color-popover-foreground: var(--popover-foreground);
31
+
32
+ --color-primary: var(--primary);
33
+ --color-primary-foreground: var(--primary-foreground);
34
+
35
+ --color-secondary: var(--secondary);
36
+ --color-secondary-foreground: var(--secondary-foreground);
37
+
38
+ --color-muted: var(--muted);
39
+ --color-muted-foreground: var(--muted-foreground);
40
+
41
+ --color-accent: var(--accent);
42
+ --color-accent-foreground: var(--accent-foreground);
43
+
44
+ --color-destructive: var(--destructive);
45
+ --color-destructive-foreground: var(--destructive-foreground);
46
+
47
+ --color-border: var(--border);
48
+ --color-input: var(--input);
49
+ --color-ring: var(--ring);
50
+
51
+ /* Brand shortcuts */
52
+ --color-brand: var(--brand-orange);
53
+ --color-brand-accent: var(--brand-accent);
54
+ --color-brand-dark: var(--brand-dark);
55
+
56
+ /* Sidebar */
57
+ --color-sidebar: var(--sidebar-background);
58
+ --color-sidebar-foreground: var(--sidebar-foreground);
59
+ --color-sidebar-primary: var(--sidebar-primary);
60
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
61
+ --color-sidebar-accent: var(--sidebar-accent);
62
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
63
+ --color-sidebar-border: var(--sidebar-border);
64
+ --color-sidebar-ring: var(--sidebar-ring);
65
+
66
+ /* Charts */
67
+ --color-chart-1: var(--chart-1);
68
+ --color-chart-2: var(--chart-2);
69
+ --color-chart-3: var(--chart-3);
70
+ --color-chart-4: var(--chart-4);
71
+ --color-chart-5: var(--chart-5);
72
+
73
+ /* ─── Border radius ────────────────────────────────────────────────────── */
74
+ --radius-sm: var(--radius-sm);
75
+ --radius-md: var(--radius-md);
76
+ --radius-lg: var(--radius-lg);
77
+ --radius-xl: var(--radius-xl);
78
+ --radius-full: var(--radius-full);
79
+
80
+ /* ─── Fonts ────────────────────────────────────────────────────────────── */
81
+ --font-sans: var(--font-sans);
82
+ --font-condensed: var(--font-condensed);
83
+ --font-mono: var(--font-mono);
84
+ --font-editorial: var(--font-editorial);
85
+
86
+ /* ─── Editorial / paper (light, NOT default — see tokens.css §5.8) ─────── */
87
+ --color-paper: var(--paper);
88
+ --color-paper-2: var(--paper-2);
89
+ --color-ink-on-paper: var(--ink-on-paper);
90
+ --color-brand-on-light: var(--brand-on-light);
91
+
92
+ /* ─── Motion — DS-spec named easings → `ease-*` utilities ─────────────── */
93
+ --ease-standard: var(--p-ease-standard);
94
+ --ease-snap: var(--p-ease-snap);
95
+ --ease-out-std: var(--p-ease-out-std);
96
+ --ease-in-std: var(--p-ease-in-std);
97
+
98
+ /* ─── Z-index scale → `z-*` utilities (z-sticky, z-modal, z-toast, …) ─── */
99
+ --z-base: var(--p-z-base);
100
+ --z-sticky: var(--p-z-sticky);
101
+ --z-dropdown: var(--p-z-dropdown);
102
+ --z-tooltip: var(--p-z-tooltip);
103
+ --z-modal-scrim: var(--p-z-modal-scrim);
104
+ --z-modal: var(--p-z-modal);
105
+ --z-toast: var(--p-z-toast);
106
+
107
+ /* ─── DS v0 component tokens (--c-*) exposed as Tailwind utilities ────── */
108
+ /* Atoms cluster (Phase 1.1) — Button + Input + Card knobs */
109
+ --color-c-button-primary-bg: var(--c-button-primary-bg);
110
+ --color-c-button-primary-fg: var(--c-button-primary-fg);
111
+ --color-c-button-primary-bg-hover: var(--c-button-primary-bg-hover);
112
+ --color-c-button-primary-bg-active: var(--c-button-primary-bg-active);
113
+ --color-c-button-secondary-bg: var(--c-button-secondary-bg);
114
+ --color-c-button-secondary-fg: var(--c-button-secondary-fg);
115
+ --color-c-button-secondary-border: var(--c-button-secondary-border);
116
+ --color-c-button-secondary-bg-hover: var(--c-button-secondary-bg-hover);
117
+ --color-c-button-secondary-border-hover: var(--c-button-secondary-border-hover);
118
+ --color-c-button-ghost-fg: var(--c-button-ghost-fg);
119
+ --color-c-button-ghost-bg-hover: var(--c-button-ghost-bg-hover);
120
+ --color-c-button-destructive-fg: var(--c-button-destructive-fg);
121
+ --color-c-button-destructive-border: var(--c-button-destructive-border);
122
+ --color-c-button-destructive-bg-hover: var(--c-button-destructive-bg-hover);
123
+ --color-c-button-success-bg: var(--c-button-success-bg);
124
+ --color-c-button-success-fg: var(--c-button-success-fg);
125
+ --color-c-input-bg: var(--c-input-bg);
126
+ --color-c-input-fg: var(--c-input-fg);
127
+ --color-c-input-placeholder: var(--c-input-placeholder);
128
+ --color-c-input-border: var(--c-input-border);
129
+ --color-c-input-border-hover: var(--c-input-border-hover);
130
+ --color-c-input-border-focus: var(--c-input-border-focus);
131
+ --color-c-input-ring-focus: var(--c-input-ring-focus);
132
+ --color-c-input-border-error: var(--c-input-border-error);
133
+
134
+ /* Semantic ink as utilities */
135
+ --color-s-ink-primary: var(--s-ink-primary);
136
+ --color-s-ink-secondary: var(--s-ink-secondary);
137
+ --color-s-ink-muted: var(--s-ink-muted);
138
+ --color-s-ink-disabled: var(--s-ink-disabled);
139
+ --color-s-surface-page: var(--s-surface-page);
140
+ --color-s-surface-panel: var(--s-surface-panel);
141
+ --color-s-surface-raised: var(--s-surface-raised);
142
+ --color-s-surface-elevated: var(--s-surface-elevated);
143
+ --color-s-border-subtle: var(--s-border-subtle);
144
+ --color-s-border-strong: var(--s-border-strong);
145
+ --color-s-border-focus: var(--s-border-focus);
146
+ --color-s-brand-solid: var(--s-brand-solid);
147
+ --color-s-brand-hover: var(--s-brand-hover);
148
+ --color-s-brand-subtle: var(--s-brand-subtle);
149
+ --color-s-brand-ring: var(--s-brand-ring);
150
+ }
151
+
152
+ /* Dark mode variant — class-based */
153
+ @variant dark (&:is(.dark *));
@@ -26,6 +26,13 @@
26
26
  /* All design tokens live in tokens.css. */
27
27
  @import './tokens.css';
28
28
 
29
+ /* Tailwind v4 token→utility mappings (--color-popover: var(--popover), etc.).
30
+ * Importing this here means apps that do `@import 'tailwindcss'` +
31
+ * `@import '@devfellowship/components/styles'` get the bg-popover / bg-sidebar /
32
+ * border-sidebar-border / … utilities wired WITHOUT also importing `/tailwind`.
33
+ * Fixes the transparent-popover / dead-utility regression (v1.2.1). */
34
+ @import './theme-mappings.css';
35
+
29
36
  /* ─── Base resets ────────────────────────────────────────────────────────── */
30
37
  *, *::before, *::after {
31
38
  border-color: var(--s-border-subtle);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devfellowship/components",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "DFL Design System — UI components, hooks, utils and providers",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -28,6 +28,7 @@
28
28
  "require": "./dist/providers.cjs"
29
29
  },
30
30
  "./styles": "./dist/styles/theme.css",
31
+ "./shadcn": "./dist/styles/shadcn.css",
31
32
  "./tokens": "./dist/styles/tokens.css",
32
33
  "./tailwind": "./dist/styles/tailwind.css"
33
34
  },