@particle-academy/react-fancy 2.6.0 → 2.7.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/dist/index.cjs +23 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -6
- package/dist/index.d.ts +38 -6
- package/dist/index.js +23 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2910,6 +2910,7 @@ function AccordionPanelSection({
|
|
|
2910
2910
|
className,
|
|
2911
2911
|
openClassName,
|
|
2912
2912
|
closedClassName,
|
|
2913
|
+
unstyled,
|
|
2913
2914
|
children
|
|
2914
2915
|
}) {
|
|
2915
2916
|
const panel = useAccordionPanel();
|
|
@@ -2934,7 +2935,8 @@ function AccordionPanelSection({
|
|
|
2934
2935
|
"data-pinned": pinned ? "" : void 0,
|
|
2935
2936
|
"data-orientation": orientation,
|
|
2936
2937
|
className: cn(
|
|
2937
|
-
"flex shrink-0
|
|
2938
|
+
"flex shrink-0",
|
|
2939
|
+
!unstyled && "items-center gap-1",
|
|
2938
2940
|
orientation === "horizontal" ? "flex-row" : "flex-col",
|
|
2939
2941
|
className,
|
|
2940
2942
|
open ? openClassName : closedClassName
|
|
@@ -2980,10 +2982,12 @@ function AccordionPanelTrigger({
|
|
|
2980
2982
|
"group relative flex shrink-0 items-center justify-center cursor-pointer",
|
|
2981
2983
|
"text-zinc-500 dark:text-zinc-500",
|
|
2982
2984
|
"hover:text-zinc-900 dark:hover:text-zinc-100",
|
|
2983
|
-
|
|
2984
|
-
"
|
|
2985
|
-
|
|
2986
|
-
"transition-
|
|
2985
|
+
// Wide hitbox + thin visible line (drawn via ::before).
|
|
2986
|
+
orientation === "horizontal" ? "w-3 self-stretch" : "h-3 self-stretch",
|
|
2987
|
+
"before:absolute before:bg-zinc-200 dark:before:bg-zinc-700",
|
|
2988
|
+
"before:transition-colors group-hover:before:bg-zinc-400 dark:group-hover:before:bg-zinc-500",
|
|
2989
|
+
orientation === "horizontal" ? "before:top-0 before:bottom-0 before:w-px before:left-1/2 before:-translate-x-1/2" : "before:left-0 before:right-0 before:h-px before:top-1/2 before:-translate-y-1/2",
|
|
2990
|
+
"transition-colors",
|
|
2987
2991
|
className
|
|
2988
2992
|
),
|
|
2989
2993
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3046,7 +3050,8 @@ function ChevronIcon({
|
|
|
3046
3050
|
}
|
|
3047
3051
|
function AccordionPanelContent({
|
|
3048
3052
|
children,
|
|
3049
|
-
className
|
|
3053
|
+
className,
|
|
3054
|
+
unstyled
|
|
3050
3055
|
}) {
|
|
3051
3056
|
const { open, orientation } = useAccordionSection();
|
|
3052
3057
|
if (!open) return null;
|
|
@@ -3056,8 +3061,8 @@ function AccordionPanelContent({
|
|
|
3056
3061
|
"data-react-fancy-accordion-content": "",
|
|
3057
3062
|
"data-orientation": orientation,
|
|
3058
3063
|
className: cn(
|
|
3059
|
-
"flex items-center gap-1",
|
|
3060
|
-
orientation === "horizontal" ? "flex-row" : "flex-col",
|
|
3064
|
+
!unstyled && "flex items-center gap-1",
|
|
3065
|
+
!unstyled && (orientation === "horizontal" ? "flex-row" : "flex-col"),
|
|
3061
3066
|
className
|
|
3062
3067
|
),
|
|
3063
3068
|
children
|
|
@@ -11418,11 +11423,13 @@ var KanbanColumnContext = react.createContext("");
|
|
|
11418
11423
|
function useKanbanColumn() {
|
|
11419
11424
|
return react.useContext(KanbanColumnContext);
|
|
11420
11425
|
}
|
|
11426
|
+
var DEFAULT_COLUMN_CLASSES = "min-h-[200px] w-72 rounded-xl bg-zinc-50 p-3 dark:bg-zinc-800/50";
|
|
11421
11427
|
function KanbanColumn({
|
|
11422
11428
|
children,
|
|
11423
11429
|
id,
|
|
11424
11430
|
title,
|
|
11425
|
-
className
|
|
11431
|
+
className,
|
|
11432
|
+
unstyled
|
|
11426
11433
|
}) {
|
|
11427
11434
|
const { onCardMove, draggedCard, dragSource } = useKanban();
|
|
11428
11435
|
const [dragOver, setDragOver] = react.useState(false);
|
|
@@ -11449,7 +11456,8 @@ function KanbanColumn({
|
|
|
11449
11456
|
onDragOver: handleDragOver,
|
|
11450
11457
|
onDragLeave: handleDragLeave,
|
|
11451
11458
|
className: cn(
|
|
11452
|
-
"flex
|
|
11459
|
+
"flex flex-col",
|
|
11460
|
+
!unstyled && DEFAULT_COLUMN_CLASSES,
|
|
11453
11461
|
dragOver && "ring-2 ring-blue-400 ring-inset",
|
|
11454
11462
|
className
|
|
11455
11463
|
),
|
|
@@ -11461,7 +11469,8 @@ function KanbanColumn({
|
|
|
11461
11469
|
) });
|
|
11462
11470
|
}
|
|
11463
11471
|
KanbanColumn.displayName = "KanbanColumn";
|
|
11464
|
-
|
|
11472
|
+
var DEFAULT_CARD_CLASSES = "rounded-lg border border-zinc-200 bg-white p-3 shadow-sm transition-shadow hover:shadow-md dark:border-zinc-700 dark:bg-zinc-900";
|
|
11473
|
+
function KanbanCard({ children, id, className, unstyled }) {
|
|
11465
11474
|
const { setDraggedCard, setDragSource } = useKanban();
|
|
11466
11475
|
const columnId = useKanbanColumn();
|
|
11467
11476
|
const handleDragStart = react.useCallback(() => {
|
|
@@ -11480,7 +11489,9 @@ function KanbanCard({ children, id, className }) {
|
|
|
11480
11489
|
onDragStart: handleDragStart,
|
|
11481
11490
|
onDragEnd: handleDragEnd,
|
|
11482
11491
|
className: cn(
|
|
11483
|
-
|
|
11492
|
+
// Drag affordance — kept even when unstyled so users still see grab cursors.
|
|
11493
|
+
"cursor-grab active:cursor-grabbing",
|
|
11494
|
+
!unstyled && DEFAULT_CARD_CLASSES,
|
|
11484
11495
|
className
|
|
11485
11496
|
),
|
|
11486
11497
|
children
|