react-native-kanban 0.0.0-stage → 0.1.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.
Files changed (70) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +242 -2
  3. package/lib/module/components/Board.js +113 -0
  4. package/lib/module/components/Board.js.map +1 -0
  5. package/lib/module/components/Card.js +68 -0
  6. package/lib/module/components/Card.js.map +1 -0
  7. package/lib/module/components/Column.js +78 -0
  8. package/lib/module/components/Column.js.map +1 -0
  9. package/lib/module/components/createBaseStyles.js +107 -0
  10. package/lib/module/components/createBaseStyles.js.map +1 -0
  11. package/lib/module/components/types.js +4 -0
  12. package/lib/module/components/types.js.map +1 -0
  13. package/lib/module/helpers.js +205 -0
  14. package/lib/module/helpers.js.map +1 -0
  15. package/lib/module/index.js +12 -0
  16. package/lib/module/index.js.map +1 -0
  17. package/lib/module/package.json +1 -0
  18. package/lib/module/theme/ThemeContext.js +32 -0
  19. package/lib/module/theme/ThemeContext.js.map +1 -0
  20. package/lib/module/theme/createKanbanTheme.js +47 -0
  21. package/lib/module/theme/createKanbanTheme.js.map +1 -0
  22. package/lib/module/theme/index.js +6 -0
  23. package/lib/module/theme/index.js.map +1 -0
  24. package/lib/module/theme/presets.js +133 -0
  25. package/lib/module/theme/presets.js.map +1 -0
  26. package/lib/module/theme/types.js +4 -0
  27. package/lib/module/theme/types.js.map +1 -0
  28. package/lib/module/types.js +2 -0
  29. package/lib/module/types.js.map +1 -0
  30. package/lib/typescript/package.json +1 -0
  31. package/lib/typescript/src/components/Board.d.ts +14 -0
  32. package/lib/typescript/src/components/Board.d.ts.map +1 -0
  33. package/lib/typescript/src/components/Card.d.ts +25 -0
  34. package/lib/typescript/src/components/Card.d.ts.map +1 -0
  35. package/lib/typescript/src/components/Column.d.ts +26 -0
  36. package/lib/typescript/src/components/Column.d.ts.map +1 -0
  37. package/lib/typescript/src/components/createBaseStyles.d.ts +26 -0
  38. package/lib/typescript/src/components/createBaseStyles.d.ts.map +1 -0
  39. package/lib/typescript/src/components/types.d.ts +84 -0
  40. package/lib/typescript/src/components/types.d.ts.map +1 -0
  41. package/lib/typescript/src/helpers.d.ts +50 -0
  42. package/lib/typescript/src/helpers.d.ts.map +1 -0
  43. package/lib/typescript/src/index.d.ts +9 -0
  44. package/lib/typescript/src/index.d.ts.map +1 -0
  45. package/lib/typescript/src/theme/ThemeContext.d.ts +10 -0
  46. package/lib/typescript/src/theme/ThemeContext.d.ts.map +1 -0
  47. package/lib/typescript/src/theme/createKanbanTheme.d.ts +15 -0
  48. package/lib/typescript/src/theme/createKanbanTheme.d.ts.map +1 -0
  49. package/lib/typescript/src/theme/index.d.ts +6 -0
  50. package/lib/typescript/src/theme/index.d.ts.map +1 -0
  51. package/lib/typescript/src/theme/presets.d.ts +6 -0
  52. package/lib/typescript/src/theme/presets.d.ts.map +1 -0
  53. package/lib/typescript/src/theme/types.d.ts +89 -0
  54. package/lib/typescript/src/theme/types.d.ts.map +1 -0
  55. package/lib/typescript/src/types.d.ts +47 -0
  56. package/lib/typescript/src/types.d.ts.map +1 -0
  57. package/package.json +172 -4
  58. package/src/components/Board.tsx +135 -0
  59. package/src/components/Card.tsx +89 -0
  60. package/src/components/Column.tsx +133 -0
  61. package/src/components/createBaseStyles.ts +123 -0
  62. package/src/components/types.ts +99 -0
  63. package/src/helpers.ts +288 -0
  64. package/src/index.tsx +61 -0
  65. package/src/theme/ThemeContext.tsx +35 -0
  66. package/src/theme/createKanbanTheme.ts +59 -0
  67. package/src/theme/index.ts +9 -0
  68. package/src/theme/presets.ts +100 -0
  69. package/src/theme/types.ts +112 -0
  70. package/src/types.ts +57 -0
@@ -0,0 +1,135 @@
1
+ import { useCallback, useMemo, useState } from 'react';
2
+ import {
3
+ ScrollView,
4
+ View,
5
+ useWindowDimensions,
6
+ type LayoutChangeEvent,
7
+ } from 'react-native';
8
+ import {
9
+ KanbanThemeProvider,
10
+ useResolvedKanbanTheme,
11
+ } from '../theme/ThemeContext';
12
+ import type { KanbanCard, KanbanColumn } from '../types';
13
+ import { Column } from './Column';
14
+ import { createBaseStyles } from './createBaseStyles';
15
+ import type { BoardProps, KanbanLabels } from './types';
16
+
17
+ const DEFAULT_COLUMN_WIDTH = { comfortable: 280, compact: 240 } as const;
18
+
19
+ const DEFAULT_LABELS: KanbanLabels = {
20
+ emptyColumn: 'No cards',
21
+ };
22
+
23
+ /**
24
+ * A horizontally scrolling Kanban board.
25
+ *
26
+ * @example
27
+ * <Board
28
+ * board={board}
29
+ * theme="auto"
30
+ * onCardPress={(card) => openCard(card.id)}
31
+ * />
32
+ */
33
+ export function Board<
34
+ TCard extends KanbanCard = KanbanCard,
35
+ TColumn extends KanbanColumn<TCard> = KanbanColumn<TCard>,
36
+ >({
37
+ board,
38
+ theme: themeProp,
39
+ density,
40
+ columnWidth,
41
+ columnHeight = 'content',
42
+ snapToColumns,
43
+ showCardCount = true,
44
+ styles,
45
+ labels: labelsProp,
46
+ renderCard,
47
+ renderColumnHeader,
48
+ renderColumnFooter,
49
+ renderEmptyColumn,
50
+ onCardPress,
51
+ style,
52
+ testID = 'kanban-board',
53
+ }: BoardProps<TCard, TColumn>) {
54
+ const theme = useResolvedKanbanTheme(themeProp, density);
55
+ const base = useMemo(() => createBaseStyles(theme), [theme]);
56
+
57
+ const emptyColumnLabel = labelsProp?.emptyColumn;
58
+ const labels = useMemo<KanbanLabels>(
59
+ () => ({
60
+ ...DEFAULT_LABELS,
61
+ ...(emptyColumnLabel !== undefined && { emptyColumn: emptyColumnLabel }),
62
+ }),
63
+ [emptyColumnLabel]
64
+ );
65
+
66
+ // Measure the board so 'fullScreen' columns fit its width exactly (even when
67
+ // it doesn't span the whole window: tablets, split view, modals) and
68
+ // 'content'-height columns stop growing at its bottom edge.
69
+ const { width: windowWidth } = useWindowDimensions();
70
+ const [boardSize, setBoardSize] = useState<{
71
+ width: number;
72
+ height: number;
73
+ } | null>(null);
74
+ const handleLayout = useCallback((event: LayoutChangeEvent) => {
75
+ const { width, height } = event.nativeEvent.layout;
76
+ setBoardSize((previous) =>
77
+ previous?.width === width && previous.height === height
78
+ ? previous
79
+ : { width, height }
80
+ );
81
+ }, []);
82
+
83
+ const isFullScreen = columnWidth === 'fullScreen';
84
+ const resolvedColumnWidth = isFullScreen
85
+ ? Math.max(
86
+ 0,
87
+ (boardSize?.width ?? windowWidth) - theme.spacing.boardPadding * 2
88
+ )
89
+ : (columnWidth ?? DEFAULT_COLUMN_WIDTH[theme.density]);
90
+
91
+ const columnMaxHeight = boardSize
92
+ ? Math.max(0, boardSize.height - theme.spacing.boardPadding * 2)
93
+ : undefined;
94
+
95
+ const shouldSnap = snapToColumns ?? isFullScreen;
96
+ const snapInterval = resolvedColumnWidth + theme.spacing.columnGap;
97
+
98
+ return (
99
+ <KanbanThemeProvider value={theme}>
100
+ <View testID={testID} style={[base.board, style]} onLayout={handleLayout}>
101
+ <ScrollView
102
+ horizontal
103
+ style={base.boardScroll}
104
+ contentContainerStyle={[base.boardContent, styles?.boardContent]}
105
+ showsHorizontalScrollIndicator={false}
106
+ snapToInterval={shouldSnap ? snapInterval : undefined}
107
+ snapToAlignment="start"
108
+ decelerationRate={shouldSnap ? 'fast' : 'normal'}
109
+ disableIntervalMomentum={shouldSnap}
110
+ >
111
+ {board.columns.map((column, index) => (
112
+ <Column
113
+ key={column.id}
114
+ column={column}
115
+ index={index}
116
+ width={resolvedColumnWidth}
117
+ maxHeight={columnMaxHeight}
118
+ fill={columnHeight === 'fill'}
119
+ theme={theme}
120
+ base={base}
121
+ styles={styles}
122
+ labels={labels}
123
+ showCardCount={showCardCount}
124
+ renderCard={renderCard}
125
+ renderColumnHeader={renderColumnHeader}
126
+ renderColumnFooter={renderColumnFooter}
127
+ renderEmptyColumn={renderEmptyColumn}
128
+ onCardPress={onCardPress}
129
+ />
130
+ ))}
131
+ </ScrollView>
132
+ </View>
133
+ </KanbanThemeProvider>
134
+ );
135
+ }
@@ -0,0 +1,89 @@
1
+ import { memo, useCallback } from 'react';
2
+ import { Pressable, Text, View } from 'react-native';
3
+ import type { KanbanTheme } from '../theme/types';
4
+ import type { KanbanCard, KanbanColumn } from '../types';
5
+ import type { KanbanBaseStyles } from './createBaseStyles';
6
+ import type { BoardProps, CardRenderInfo, KanbanStyles } from './types';
7
+
8
+ interface DefaultCardProps {
9
+ card: KanbanCard;
10
+ base: KanbanBaseStyles;
11
+ styles: KanbanStyles | undefined;
12
+ }
13
+
14
+ /** The built-in card: title plus optional description. */
15
+ export function DefaultCard({ card, base, styles }: DefaultCardProps) {
16
+ return (
17
+ <View style={[base.card, styles?.card]}>
18
+ <Text style={[base.cardTitle, styles?.cardTitle]} numberOfLines={3}>
19
+ {card.title ?? String(card.id)}
20
+ </Text>
21
+ {card.description ? (
22
+ <Text
23
+ style={[base.cardDescription, styles?.cardDescription]}
24
+ numberOfLines={4}
25
+ >
26
+ {card.description}
27
+ </Text>
28
+ ) : null}
29
+ </View>
30
+ );
31
+ }
32
+
33
+ interface CardItemProps<
34
+ TCard extends KanbanCard,
35
+ TColumn extends KanbanColumn<TCard>,
36
+ > {
37
+ card: TCard;
38
+ column: TColumn;
39
+ index: number;
40
+ theme: KanbanTheme;
41
+ base: KanbanBaseStyles;
42
+ styles: KanbanStyles | undefined;
43
+ renderCard: BoardProps<TCard, TColumn>['renderCard'];
44
+ onCardPress: BoardProps<TCard, TColumn>['onCardPress'];
45
+ }
46
+
47
+ function CardItemImpl<
48
+ TCard extends KanbanCard,
49
+ TColumn extends KanbanColumn<TCard>,
50
+ >({
51
+ card,
52
+ column,
53
+ index,
54
+ theme,
55
+ base,
56
+ styles,
57
+ renderCard,
58
+ onCardPress,
59
+ }: CardItemProps<TCard, TColumn>) {
60
+ const info: CardRenderInfo<TColumn> = { column, index, theme };
61
+ const content = renderCard ? (
62
+ renderCard(card, info)
63
+ ) : (
64
+ <DefaultCard card={card} base={base} styles={styles} />
65
+ );
66
+
67
+ const handlePress = useCallback(
68
+ () => onCardPress?.(card, { column, index, theme }),
69
+ [onCardPress, card, column, index, theme]
70
+ );
71
+
72
+ if (!onCardPress) {
73
+ return <View testID={`kanban-card-${card.id}`}>{content}</View>;
74
+ }
75
+
76
+ return (
77
+ <Pressable
78
+ testID={`kanban-card-${card.id}`}
79
+ accessibilityRole="button"
80
+ accessibilityLabel={card.title ?? String(card.id)}
81
+ onPress={handlePress}
82
+ style={({ pressed }) => (pressed ? base.pressed : undefined)}
83
+ >
84
+ {content}
85
+ </Pressable>
86
+ );
87
+ }
88
+
89
+ export const CardItem = memo(CardItemImpl) as typeof CardItemImpl;
@@ -0,0 +1,133 @@
1
+ import { memo } from 'react';
2
+ import { ScrollView, Text, View } from 'react-native';
3
+ import type { KanbanTheme } from '../theme/types';
4
+ import type { KanbanCard, KanbanColumn } from '../types';
5
+ import { CardItem } from './Card';
6
+ import type { KanbanBaseStyles } from './createBaseStyles';
7
+ import type {
8
+ BoardProps,
9
+ ColumnRenderInfo,
10
+ KanbanLabels,
11
+ KanbanStyles,
12
+ } from './types';
13
+
14
+ interface ColumnProps<
15
+ TCard extends KanbanCard,
16
+ TColumn extends KanbanColumn<TCard>,
17
+ > {
18
+ column: TColumn;
19
+ index: number;
20
+ width: number;
21
+ /** Tallest the column can be in 'content' mode (board height minus padding). */
22
+ maxHeight: number | undefined;
23
+ fill: boolean;
24
+ theme: KanbanTheme;
25
+ base: KanbanBaseStyles;
26
+ styles: KanbanStyles | undefined;
27
+ labels: KanbanLabels;
28
+ showCardCount: boolean;
29
+ renderCard: BoardProps<TCard, TColumn>['renderCard'];
30
+ renderColumnHeader: BoardProps<TCard, TColumn>['renderColumnHeader'];
31
+ renderColumnFooter: BoardProps<TCard, TColumn>['renderColumnFooter'];
32
+ renderEmptyColumn: BoardProps<TCard, TColumn>['renderEmptyColumn'];
33
+ onCardPress: BoardProps<TCard, TColumn>['onCardPress'];
34
+ }
35
+
36
+ function ColumnImpl<
37
+ TCard extends KanbanCard,
38
+ TColumn extends KanbanColumn<TCard>,
39
+ >({
40
+ column,
41
+ index,
42
+ width,
43
+ maxHeight,
44
+ fill,
45
+ theme,
46
+ base,
47
+ styles,
48
+ labels,
49
+ showCardCount,
50
+ renderCard,
51
+ renderColumnHeader,
52
+ renderColumnFooter,
53
+ renderEmptyColumn,
54
+ onCardPress,
55
+ }: ColumnProps<TCard, TColumn>) {
56
+ const info: ColumnRenderInfo = {
57
+ index,
58
+ cardCount: column.cards.length,
59
+ theme,
60
+ };
61
+
62
+ return (
63
+ <View
64
+ testID={`kanban-column-${column.id}`}
65
+ style={[
66
+ base.column,
67
+ fill ? null : [base.columnContentHeight, { maxHeight }],
68
+ { width },
69
+ styles?.column,
70
+ ]}
71
+ >
72
+ {renderColumnHeader ? (
73
+ renderColumnHeader(column, info)
74
+ ) : (
75
+ <View style={[base.columnHeader, styles?.columnHeader]}>
76
+ <Text
77
+ style={[base.columnTitle, styles?.columnTitle]}
78
+ numberOfLines={1}
79
+ accessibilityRole="header"
80
+ >
81
+ {column.title ?? String(column.id)}
82
+ </Text>
83
+ {showCardCount ? (
84
+ <View style={[base.countBadge, styles?.countBadge]}>
85
+ <Text
86
+ style={[base.countBadgeText, styles?.countBadgeText]}
87
+ testID={`kanban-column-count-${column.id}`}
88
+ >
89
+ {column.cards.length}
90
+ </Text>
91
+ </View>
92
+ ) : null}
93
+ </View>
94
+ )}
95
+
96
+ <ScrollView
97
+ style={fill ? base.columnScrollFill : base.columnScroll}
98
+ contentContainerStyle={[base.columnContent, styles?.columnContent]}
99
+ showsVerticalScrollIndicator={false}
100
+ >
101
+ {column.cards.length === 0
102
+ ? (renderEmptyColumn?.(column, info) ?? (
103
+ <View style={[base.emptyColumn, styles?.emptyColumn]}>
104
+ <Text style={[base.emptyColumnText, styles?.emptyColumnText]}>
105
+ {labels.emptyColumn}
106
+ </Text>
107
+ </View>
108
+ ))
109
+ : column.cards.map((card, cardIndex) => (
110
+ <CardItem
111
+ key={card.id}
112
+ card={card}
113
+ column={column}
114
+ index={cardIndex}
115
+ theme={theme}
116
+ base={base}
117
+ styles={styles}
118
+ renderCard={renderCard}
119
+ onCardPress={onCardPress}
120
+ />
121
+ ))}
122
+ </ScrollView>
123
+
124
+ {renderColumnFooter ? (
125
+ <View style={[base.columnFooter, styles?.columnFooter]}>
126
+ {renderColumnFooter(column, info)}
127
+ </View>
128
+ ) : null}
129
+ </View>
130
+ );
131
+ }
132
+
133
+ export const Column = memo(ColumnImpl) as typeof ColumnImpl;
@@ -0,0 +1,123 @@
1
+ import { StyleSheet, type TextStyle, type ViewStyle } from 'react-native';
2
+ import type { KanbanTheme } from '../theme/types';
3
+
4
+ export type KanbanBaseStyles = {
5
+ board: ViewStyle;
6
+ boardScroll: ViewStyle;
7
+ boardContent: ViewStyle;
8
+ column: ViewStyle;
9
+ columnHeader: ViewStyle;
10
+ columnTitle: TextStyle;
11
+ countBadge: ViewStyle;
12
+ countBadgeText: TextStyle;
13
+ columnContentHeight: ViewStyle;
14
+ columnScroll: ViewStyle;
15
+ columnScrollFill: ViewStyle;
16
+ columnContent: ViewStyle;
17
+ columnFooter: ViewStyle;
18
+ card: ViewStyle;
19
+ cardTitle: TextStyle;
20
+ cardDescription: TextStyle;
21
+ emptyColumn: ViewStyle;
22
+ emptyColumnText: TextStyle;
23
+ pressed: ViewStyle;
24
+ };
25
+
26
+ /** Default styles for every part of the board, derived from the theme. */
27
+ export function createBaseStyles(theme: KanbanTheme): KanbanBaseStyles {
28
+ const { colors, spacing, radius, typography, shadows } = theme;
29
+
30
+ return StyleSheet.create<KanbanBaseStyles>({
31
+ board: {
32
+ flex: 1,
33
+ backgroundColor: colors.background,
34
+ },
35
+ boardScroll: {
36
+ flex: 1,
37
+ },
38
+ boardContent: {
39
+ padding: spacing.boardPadding,
40
+ gap: spacing.columnGap,
41
+ },
42
+ column: {
43
+ backgroundColor: colors.column,
44
+ borderRadius: radius.column,
45
+ paddingVertical: spacing.columnPadding,
46
+ gap: spacing.columnPadding,
47
+ },
48
+ columnHeader: {
49
+ flexDirection: 'row',
50
+ alignItems: 'center',
51
+ gap: 8,
52
+ paddingHorizontal: spacing.columnPadding,
53
+ },
54
+ columnTitle: {
55
+ ...typography.columnTitle,
56
+ color: colors.columnTitle,
57
+ flexShrink: 1,
58
+ },
59
+ countBadge: {
60
+ minWidth: 24,
61
+ paddingHorizontal: 8,
62
+ paddingVertical: 2,
63
+ alignItems: 'center',
64
+ borderRadius: radius.badge,
65
+ backgroundColor: colors.countBadge,
66
+ },
67
+ countBadgeText: {
68
+ ...typography.countBadge,
69
+ color: colors.countBadgeText,
70
+ },
71
+ columnContentHeight: {
72
+ alignSelf: 'flex-start',
73
+ },
74
+ columnScroll: {
75
+ flexGrow: 0,
76
+ flexShrink: 1,
77
+ },
78
+ columnScrollFill: {
79
+ flex: 1,
80
+ },
81
+ columnContent: {
82
+ gap: spacing.cardGap,
83
+ // Horizontal padding lives here (not on the column) so card shadows
84
+ // aren't clipped by the scroll view's edges.
85
+ paddingHorizontal: spacing.columnPadding,
86
+ paddingBottom: 2,
87
+ },
88
+ columnFooter: {
89
+ paddingHorizontal: spacing.columnPadding,
90
+ },
91
+ card: {
92
+ gap: 4,
93
+ padding: spacing.cardPadding,
94
+ borderRadius: radius.card,
95
+ backgroundColor: colors.card,
96
+ ...shadows.card,
97
+ },
98
+ cardTitle: {
99
+ ...typography.cardTitle,
100
+ color: colors.cardTitle,
101
+ },
102
+ cardDescription: {
103
+ ...typography.cardDescription,
104
+ color: colors.cardDescription,
105
+ },
106
+ emptyColumn: {
107
+ alignItems: 'center',
108
+ paddingVertical: spacing.cardPadding * 2,
109
+ paddingHorizontal: spacing.cardPadding,
110
+ borderWidth: 1,
111
+ borderStyle: 'dashed',
112
+ borderColor: colors.border,
113
+ borderRadius: radius.card,
114
+ },
115
+ emptyColumnText: {
116
+ ...typography.emptyColumn,
117
+ color: colors.emptyColumnText,
118
+ },
119
+ pressed: {
120
+ opacity: 0.85,
121
+ },
122
+ });
123
+ }
@@ -0,0 +1,99 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
3
+ import type {
4
+ KanbanDensity,
5
+ KanbanTheme,
6
+ KanbanThemeProp,
7
+ } from '../theme/types';
8
+ import type { KanbanBoard, KanbanCard, KanbanColumn } from '../types';
9
+
10
+ /** Style overrides for each part of the board. Applied on top of the theme. */
11
+ export interface KanbanStyles {
12
+ /** Horizontal scroll content that holds the columns. */
13
+ boardContent?: StyleProp<ViewStyle>;
14
+ column?: StyleProp<ViewStyle>;
15
+ columnHeader?: StyleProp<ViewStyle>;
16
+ columnTitle?: StyleProp<TextStyle>;
17
+ countBadge?: StyleProp<ViewStyle>;
18
+ countBadgeText?: StyleProp<TextStyle>;
19
+ /** Vertical scroll content that holds a column's cards. */
20
+ columnContent?: StyleProp<ViewStyle>;
21
+ columnFooter?: StyleProp<ViewStyle>;
22
+ card?: StyleProp<ViewStyle>;
23
+ cardTitle?: StyleProp<TextStyle>;
24
+ cardDescription?: StyleProp<TextStyle>;
25
+ emptyColumn?: StyleProp<ViewStyle>;
26
+ emptyColumnText?: StyleProp<TextStyle>;
27
+ }
28
+
29
+ /** User-facing strings, for translation. */
30
+ export interface KanbanLabels {
31
+ /** Shown in a column with no cards. */
32
+ emptyColumn: string;
33
+ }
34
+
35
+ export interface CardRenderInfo<TColumn> {
36
+ /** The column the card is in. */
37
+ column: TColumn;
38
+ /** The card's index within its column. */
39
+ index: number;
40
+ theme: KanbanTheme;
41
+ }
42
+
43
+ export interface ColumnRenderInfo {
44
+ /** The column's index on the board. */
45
+ index: number;
46
+ cardCount: number;
47
+ theme: KanbanTheme;
48
+ }
49
+
50
+ export interface BoardProps<
51
+ TCard extends KanbanCard = KanbanCard,
52
+ TColumn extends KanbanColumn<TCard> = KanbanColumn<TCard>,
53
+ > {
54
+ /** The board to display. */
55
+ board: KanbanBoard<TCard, TColumn>;
56
+
57
+ /**
58
+ * `'light'` (default), `'dark'`, `'auto'` (follows the device), or a custom
59
+ * theme object. See `KanbanThemeInput`.
60
+ */
61
+ theme?: KanbanThemeProp;
62
+ /** `'comfortable'` (default) or `'compact'`. */
63
+ density?: KanbanDensity;
64
+ /**
65
+ * Column width in points, or `'fullScreen'` to show one column per screen
66
+ * (great on phones). Defaults to 280 (240 when compact).
67
+ */
68
+ columnWidth?: number | 'fullScreen';
69
+ /**
70
+ * `'content'` (default): columns are as tall as their cards and scroll once
71
+ * they reach the bottom of the board, keeping the footer under the last card.
72
+ * `'fill'`: every column stretches to the full board height.
73
+ */
74
+ columnHeight?: 'content' | 'fill';
75
+ /** Snap scrolling to columns. Defaults to `true` for `'fullScreen'`. */
76
+ snapToColumns?: boolean;
77
+ /** Show the card count next to each column title. Defaults to `true`. */
78
+ showCardCount?: boolean;
79
+ /** Style overrides for each part of the board. */
80
+ styles?: KanbanStyles;
81
+ /** Override user-facing strings. */
82
+ labels?: Partial<KanbanLabels>;
83
+
84
+ /** Replace the default card. Wrap in `useCallback` to keep cards memoized. */
85
+ renderCard?: (card: TCard, info: CardRenderInfo<TColumn>) => ReactNode;
86
+ /** Replace the default column header (title + count). */
87
+ renderColumnHeader?: (column: TColumn, info: ColumnRenderInfo) => ReactNode;
88
+ /** Render something under a column's cards, e.g. an "Add card" button. */
89
+ renderColumnFooter?: (column: TColumn, info: ColumnRenderInfo) => ReactNode;
90
+ /** Replace the default "No cards" placeholder. */
91
+ renderEmptyColumn?: (column: TColumn, info: ColumnRenderInfo) => ReactNode;
92
+
93
+ /** Called when a card is tapped. Makes cards pressable buttons. */
94
+ onCardPress?: (card: TCard, info: CardRenderInfo<TColumn>) => void;
95
+
96
+ /** Style for the outer container. The board fills its parent by default. */
97
+ style?: StyleProp<ViewStyle>;
98
+ testID?: string;
99
+ }