Skip to content

Commit e225008

Browse files
committed
Allow to configure Table header hint icon
1 parent 0df3c28 commit e225008

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

packages/bento-design-system/src/Table/Config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type CellPaddingConfig = {
2323

2424
export type TableConfig = {
2525
headerInfoIcon: (props: IconProps) => JSX.Element;
26+
headerHintIcon: (props: IconProps) => JSX.Element;
2627
emptyIcon: (props: IconProps) => JSX.Element;
2728
headerBackgroundColor: BentoSprinkles["background"];
2829
headerForegroundColor: BentoSprinkles["color"];

packages/bento-design-system/src/Table/Table.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import {
5252
Row as RowType,
5353
} from "./types";
5454
import { useLayoutEffect, useMemo, useState, CSSProperties, useEffect, useRef } from "react";
55-
import { IconQuestionSolid, IconInfo } from "../Icons";
5655
import { match, __ } from "ts-pattern";
5756
import { useBentoConfig } from "../BentoConfigContext";
5857
import { assignInlineVars } from "@vanilla-extract/dynamic";
@@ -561,7 +560,7 @@ function ColumnHeader<D extends Record<string, unknown>>({
561560
const hint = column.hint ? (
562561
typeof column.hint === "object" ? (
563562
<IconButton
564-
icon={IconQuestionSolid}
563+
icon={config.headerHintIcon}
565564
onPress={column.hint.onPress}
566565
kind="transparent"
567566
hierarchy="primary"
@@ -572,7 +571,7 @@ function ColumnHeader<D extends Record<string, unknown>>({
572571
<Tooltip
573572
trigger={(ref, props) => (
574573
<Box as="div" display="inline-block" ref={ref} {...props}>
575-
<IconInfo size={12} color="currentColor" />
574+
<config.headerInfoIcon size={12} color="currentColor" />
576575
</Box>
577576
)}
578577
content={column.hint}

packages/bento-design-system/src/util/defaultConfigs.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
IconPositiveCircle,
2424
IconQuestionCircle,
2525
IconNegative,
26+
IconQuestionSolid,
2627
} from "../Icons";
2728
import type { ButtonConfig } from "../Button/Config";
2829
import type { CardConfig } from "../Card/Config";
@@ -504,6 +505,7 @@ export const dropdown: DropdownConfig = {
504505

505506
export const table: TableConfig = {
506507
headerInfoIcon: IconInfo,
508+
headerHintIcon: IconQuestionSolid,
507509
emptyIcon: IconSearch,
508510
headerBackgroundColor: "backgroundPrimary",
509511
headerForegroundColor: "foregroundPrimary",

0 commit comments

Comments
 (0)