torch-glare 2.1.5 → 2.1.7

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.
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { Fragment, useMemo, useState } from "react";
3
+ import { useMemo, useState } from "react";
4
4
  import {
5
5
  X,
6
6
  Settings as SettingsIcon,
@@ -114,6 +114,12 @@ const DrawerContent = React.forwardRef<
114
114
  )}
115
115
  >
116
116
  <div
117
+ // The content surface is always light (#F0F0F0) regardless of the
118
+ // page theme, so pin a light theme here. This makes theme-aware
119
+ // content tokens (DrawerTitle/Description and any consumer content)
120
+ // resolve to their dark-on-light values instead of following a dark
121
+ // page theme (which would render white-on-light = invisible).
122
+ data-theme="light"
117
123
  className={cn(
118
124
  "flex flex-1 flex-col gap-2 rounded-t-[16px] p-1.5 bg-[#F0F0F0] min-h-0",
119
125
  framed && "border border-[#D4D4D4] shadow-[inset_0_-4px_16px_rgba(0,0,0,0.1)]",
@@ -148,14 +154,18 @@ const DrawerHeader = ({
148
154
  DrawerHeader.displayName = "DrawerHeader";
149
155
 
150
156
  const drawerHeaderPane = cva(
151
- "flex items-center gap-2 rounded-[14px] border p-2 bg-[#131415] border-[#2C2D2E] shadow-[0_0_32px_2px_rgba(0,0,0,0.05)]",
157
+ // Dark pill. Force any DrawerTitle/Description inside it back to light text
158
+ // (their defaults are dark for the light content surface).
159
+ "flex items-center gap-2 rounded-[14px] border p-2 bg-[#131415] border-[#2C2D2E] shadow-[0_0_32px_2px_rgba(0,0,0,0.05)] [&_[data-slot=drawer-title]]:text-white [&_[data-slot=drawer-description]]:text-[#9FA0A1]",
152
160
  );
153
161
 
154
162
  const DrawerHeaderTitle = ({
155
163
  className,
156
164
  ...props
157
165
  }: React.HTMLAttributes<HTMLDivElement>) => (
158
- <div className={cn(drawerHeaderPane(), className)} {...props} />
166
+ // Dark surface pin a dark theme so any buttons/content inside resolve their
167
+ // theme tokens for dark (the surrounding content surface is data-theme=light).
168
+ <div data-theme="dark" className={cn(drawerHeaderPane(), className)} {...props} />
159
169
  );
160
170
  DrawerHeaderTitle.displayName = "DrawerHeaderTitle";
161
171
 
@@ -164,6 +174,7 @@ const DrawerHeaderActions = ({
164
174
  ...props
165
175
  }: React.HTMLAttributes<HTMLDivElement>) => (
166
176
  <div
177
+ data-theme="dark"
167
178
  className={cn(drawerHeaderPane(), "justify-end", className)}
168
179
  {...props}
169
180
  />
@@ -358,8 +369,12 @@ const DrawerTitle = React.forwardRef<
358
369
  >(({ className, ...props }, ref) => (
359
370
  <DrawerPrimitive.Title
360
371
  ref={ref}
372
+ data-slot="drawer-title"
373
+ // Dark text by default — the title usually sits on the light content
374
+ // surface. Inside the dark DrawerHeaderTitle pill it is flipped back to
375
+ // white via a descendant selector on `drawerHeaderPane`.
361
376
  className={cn(
362
- "typography-display-medium-medium uppercase text-white leading-none",
377
+ "typography-display-medium-medium uppercase text-content-presentation-global-primary leading-none",
363
378
  className,
364
379
  )}
365
380
  {...props}
@@ -373,7 +388,11 @@ const DrawerDescription = React.forwardRef<
373
388
  >(({ className, ...props }, ref) => (
374
389
  <DrawerPrimitive.Description
375
390
  ref={ref}
376
- className={cn("typography-body-small-regular text-[#9FA0A1]", className)}
391
+ data-slot="drawer-description"
392
+ className={cn(
393
+ "typography-body-small-regular text-content-presentation-action-light-secondary",
394
+ className,
395
+ )}
377
396
  {...props}
378
397
  />
379
398
  ));
package/dist/bin/index.js CHANGED
@@ -20,7 +20,8 @@ program
20
20
  program
21
21
  .command("add [component]")
22
22
  .description("Add a component interactively or install a specified one")
23
- .action((component) => add(component));
23
+ .option("-f, --force", "Overwrite the component if it already exists")
24
+ .action((component, options) => add(component, !!options.force));
24
25
  program
25
26
  .command("hook [hook]")
26
27
  .description("Add a hook interactively or install a specified one")
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../cli/bin/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAA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QAAQ,IAAI,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC;AAEhE,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,6BAA6B,CAAC;KAC1C,MAAM,CAAC,GAAG,EAAE,CAAC,yBAAyB,EAAE,CAAC,CAAC;AAE7C,OAAO;KACJ,OAAO,CAAC,KAAK,CAAC;KACd,WAAW,CAAC,kDAAkD,CAAC;KAC/D,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;AAE5B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -11,7 +11,22 @@ keywords: [data-views, layout, table, kanban, inbox, tree, multi-view, filter, s
11
11
 
12
12
  ## Installation
13
13
 
14
- The component is part of `torch-glare`. It depends on `@radix-ui/react-slider`, `react-day-picker`, `lucide-react`, and `vaul` (all already vendored by the library). No extra install needed.
14
+ ```bash
15
+ npx torch-glare@latest add DataViews
16
+ ```
17
+
18
+ The CLI transitively installs everything DataViews imports — the sibling views,
19
+ the `DataViewCard` layout, the `useDataViewsState` hook, the `dataViews` utils,
20
+ and the `TreeFolder` component — plus the 3rd-party deps it uses
21
+ (`@radix-ui/react-slider`, `react-day-picker`, `lucide-react`, `vaul`).
22
+
23
+ > **Badge version:** DataViews uses the current Badge API
24
+ > (`color` / `badgeStyle` / `showIcon`). If your project vendored an older
25
+ > `Badge.tsx` (with `variant` / `isSelected`), refresh it with
26
+ > `npx torch-glare@latest add Badge --force` and migrate call sites
27
+ > (`variant=` → `color=`, `isSelected`+`onUnselect` → `isClosable`+`onClose`).
28
+ > The Badge also needs `mapping-color-system-v4` tokens
29
+ > (`--background-presentation-badge-{color}-{subtle|solid}`) in your CSS.
15
30
 
16
31
  ## Import
17
32