Skip to content

Commit 092cdf7

Browse files
authored
Merge pull request #440 from AnnMarieW/add-missing-props-428
add missing props from issue 428
2 parents c6cb8b4 + 270a605 commit 092cdf7

File tree

6 files changed

+23
-9
lines changed

6 files changed

+23
-9
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
### Added
55

66
- Added `disabled` prop to `Radio` #425 by @namakshenas
7+
- Added various props: `acceptValueOnBlur` to `TagsInput`, `gradient` to `LineChart`, `hideWithOnePage` to `Pagination`, `name` to `Avatar`, and `disabled` to `NumberInput`. #440 by @AnnMarieW
78
- Added `SemiCircleProgress` component #434 by @AnnMarieW
89

910
### Fixed

src/ts/components/charts/LineChart.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { LineChart as MantineLineChart } from "@mantine/charts";
22
import {
33
LineChartCurveType,
44
LineChartSeries,
5+
LineChartGradientStop,
6+
LineChartType,
57
} from "@mantine/charts/lib/LineChart/LineChart";
68
import { BoxProps } from "props/box";
79
import { GridChartBaseProps } from "props/charts";
@@ -52,10 +54,13 @@ interface Props
5254
highlightHover?: boolean
5355
/** Determines whether each point should have associated label, False by default */
5456
withPointLabels?: boolean;
55-
57+
/** Data used to generate gradient stops, [{ offset: 0, color: 'red' }, { offset: 100, color: 'blue' }] by default */
58+
gradientStops?: LineChartGradientStop[];
59+
/** Controls styles of the line 'default' | 'gradient'. 'default' by default */
60+
type?: LineChartType;
5661
}
5762

58-
/** LineChart */
63+
/** Mantine-themed line chart built on top of the Recharts library, */
5964
const LineChart = (props: Props) => {
6065
const { setProps, loading_state, clickData, hoverData, clickSeriesName, hoverSeriesName, series, highlightHover, lineChartProps, activeDotProps, lineProps, ...others } = props;
6166

src/ts/components/core/Pagination.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ interface Props
3838
radius?: MantineRadius;
3939
/** Determines whether active item text color should depend on `background-color` of the indicator. If luminosity of the `color` prop is less than `theme.luminosityThreshold`, then `theme.white` will be used for text color, otherwise `theme.black`. Overrides `theme.autoContrast`. */
4040
autoContrast?: boolean;
41+
/** Determines whether the pagination should be hidden when only one page is available (total=1), False by default */
42+
hideWithOnePage?: boolean;
4143
}
4244

43-
/** Pagination */
45+
/** Use the Pagination component to display active page and navigate between multiple pages */
4446
const Pagination = (props: Props) => {
4547
const {
4648
setProps,

src/ts/components/core/avatar/Avatar.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ interface Props extends BoxProps, StylesApiProps, DashBaseProps {
1515
size?: MantineSize | (string & {}) | number;
1616
/** Key of `theme.radius` or any valid CSS value to set border-radius, `'100%'` by default */
1717
radius?: MantineRadius;
18-
/** Key of `theme.colors` or any valid CSS color, default value is `theme.primaryColor` */
19-
color?: MantineColor;
18+
/** Key of `theme.colors` or any valid CSS color, default value is `theme.primaryColor`. Set to "initials" to auto generate color based on `name` */
19+
color?: MantineColor | "initials";
2020
/** Gradient configuration used when `variant="gradient"`, default value is `theme.defaultGradient` */
2121
gradient?: MantineGradient;
2222
/** Image url, if the image cannot be loaded or `src={null}`, then placeholder is displayed instead */
@@ -29,9 +29,11 @@ interface Props extends BoxProps, StylesApiProps, DashBaseProps {
2929
children?: React.ReactNode;
3030
/** Determines whether text color with filled variant should depend on `background-color`. If luminosity of the `color` prop is less than `theme.luminosityThreshold`, then `theme.white` will be used for text color, otherwise `theme.black`. Overrides `theme.autoContrast`. */
3131
autoContrast?: boolean;
32+
/** Name of the user. When src is not set, used to display initials and to generate color when color="initials" is set. */
33+
name?: string;
3234
}
3335

34-
/** Avatar */
36+
/** Use the Avatar component to display user profile image, initials or fallback icon */
3537
const Avatar = (props: Props) => {
3638
const { children, setProps, loading_state, ...others } = props;
3739

src/ts/components/core/combobox/TagsInput.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ interface Props
4242
hiddenInputValuesDivider?: string;
4343
/** Props passed down to the underlying `ScrollArea` component in the dropdown */
4444
scrollAreaProps?: ScrollAreaProps;
45+
/** Determines whether the value typed in by the user but not submitted should be accepted when the input is blurred, true by default */
46+
acceptValueOnBlur?: boolean;
4547
}
4648

47-
/** TagsInput */
49+
/** TagsInput captures a list of values from user with free input and suggestions */
4850
const TagsInput = (props: Props) => {
4951
const { setProps, loading_state, data, searchValue, value, ...others } =
5052
props;
@@ -80,7 +82,6 @@ const TagsInput = (props: Props) => {
8082
data-dash-is-loading={
8183
(loading_state && loading_state.is_loading) || undefined
8284
}
83-
wrapperProps={{ autoComplete: "off" }}
8485
data={options}
8586
onChange={setSelected}
8687
value={selected}

src/ts/components/core/input/NumberInput.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ interface Props
5959
stepHoldDelay?: number;
6060
/** (string; default "off") Enables the browser to attempt autocompletion based on user history. For more information, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete */
6161
autoComplete?: string;
62+
/** Sets disabled attribute on the input element */
63+
disabled?: boolean;
64+
6265
}
6366

64-
/** NumberInput */
67+
/** The NumberInput component allows users to input numeric values */
6568
const NumberInput = (props: Props) => {
6669
const {
6770
setProps,

0 commit comments

Comments
 (0)