@marco.colia/react-fast-scheduler 2.2.1 → 3.0.0

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
@@ -29,6 +29,10 @@ Import the packaged styles once in your app:
29
29
  import "@marco.colia/react-fast-scheduler/styles.css";
30
30
  ```
31
31
 
32
+ The packaged stylesheet is scoped to the scheduler wrapper, so it does not write theme tokens to your app `:root` or reuse unprefixed Tailwind utility names.
33
+
34
+ When you pass your own class strings through props like `resourceAppointmentClassMap`, `appointmentColorTokenClassMap`, or a custom `renderAppointment`, those classes belong to your app and can use your own Tailwind setup.
35
+
32
36
  ## Quick Start
33
37
 
34
38
  The scheduler is a controlled component:
@@ -274,10 +278,10 @@ The package ships precompiled CSS:
274
278
  import "@marco.colia/react-fast-scheduler/styles.css";
275
279
  ```
276
280
 
277
- You can override the exposed CSS variables in your app:
281
+ You can override the exposed CSS variables on the scheduler wrapper:
278
282
 
279
283
  ```css
280
- :root {
284
+ .rfs-root {
281
285
  --rfs-bg: #f8fafc;
282
286
  --rfs-surface: #ffffff;
283
287
  --rfs-border: #e2e8f0;
@@ -286,6 +290,8 @@ You can override the exposed CSS variables in your app:
286
290
  }
287
291
  ```
288
292
 
293
+ If you want a dark override, target `.dark .rfs-root`.
294
+
289
295
  ### Resource-based colors
290
296
 
291
297
  The simplest option is `resourceAppointmentClassMap`:
@@ -300,6 +306,8 @@ The simplest option is `resourceAppointmentClassMap`:
300
306
  />
301
307
  ```
302
308
 
309
+ Those class names are consumer-provided and are expected to come from your app stylesheet or Tailwind build.
310
+
303
311
  If you want semantic mapping, use `getResourceAppointmentColorToken` plus `appointmentColorTokenClassMap`:
304
312
 
305
313
  ```tsx
@@ -345,18 +353,16 @@ The renderer also receives:
345
353
  }) => (
346
354
  <div
347
355
  onPointerDown={onPointerDown}
348
- className={`relative h-full overflow-hidden rounded-md border p-2 pb-5 ${
356
+ className={`relative h-full overflow-hidden rounded-md p-2 pb-5 ${
349
357
  appointment.visualState === "ghost"
350
- ? "cursor-grab border-dashed opacity-55"
358
+ ? "cursor-grab opacity-55"
351
359
  : appointment.visualState === "dragging"
352
- ? "cursor-grabbing opacity-55"
360
+ ? "cursor-grabbing opacity-55 shadow-sm"
353
361
  : "cursor-grab"
354
362
  } ${
355
363
  isDropInvalid
356
- ? "border-red-500 bg-red-100/80 text-red-950 ring-1 ring-red-500/60"
357
- : `border-slate-300 ${
358
- appointmentAppearance?.className ?? appointmentBackgroundColor ?? "bg-slate-100"
359
- }`
364
+ ? "bg-red-100/80 text-red-950"
365
+ : appointmentAppearance?.className ?? appointmentBackgroundColor ?? "bg-slate-100"
360
366
  }`}
361
367
  >
362
368
  <div className="text-xs font-semibold">{appointment.title}</div>