Skip to content

Commit

Permalink
fix: fix several props errors (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
vapersmile authored Mar 15, 2024
1 parent e19d10e commit 82ae83c
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 55 deletions.
23 changes: 12 additions & 11 deletions docs/react-front-kit/components/action-row-overflow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@

ActionBar takes a `<Data>` generic type that extends `Record<string, unknown>`.

| Name | Type | Default | Description |
| ---------------------------- | -------------------------------------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| actionButtonProps | [`ButtonProps`](https://v6.mantine.dev/core/button/?t=props) | - | Extra props for the visible action buttons in default mode |
| actionTooltipProps | [`TooltipProps`](https://v6.mantine.dev/core/tooltip/?t=props) | - | Extra props for the action tooltips, on the menu icon and on the action icons in compact mode |
| actions | [`IAction`](./thumbnail#ithumbnailaction) `<Data \| Data[]>[]` | - | Array of [`IAction`](../../shared-types/actions#iactiont) for the rendered action buttons or actions inside the menu |
| isCompactStyle | `boolean` | `false` | Boolean value that determines the display style, either default (`false`) or compact (`true`) |
| modalProps | [`IThumbnailAction[]`](./thumbnail#ithumbnailaction) | - | Extra props passed to the internal [Mantine Modal](https://v6.mantine.dev/core/modal/) component, used for actions with confirmation enabled |
| overflowMenuLabel | `string` | `Other actions` | String used as both the `aria-label` and the Tooltip label of the menu button/icon |
| rowActionNumber | `number` | `1` | Index value used to determine which actions will be displayed directly in the action column (before this index) or in the action menu (starting at this index) |
| selectedElements <Required/> | `Data[]` | - | Array of currently selected elements, necessary for the `actions` to be able to pass those elements along |
| ... | - | - | extends [Group props](https://v6.mantine.dev/core/group/?t=props) |
| Name | Type | Default | Description |
| ---------------------------------------------------------------------------------- | -------------------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| actionButtonProps | [`ButtonProps`](https://v6.mantine.dev/core/button/?t=props) | - | Extra props for the visible action buttons in default mode |
| actionTooltipProps | [`TooltipProps`](https://v6.mantine.dev/core/tooltip/?t=props) | - | Extra props for the action tooltips, on the menu icon and on the action icons in compact mode |
| actions | [`IAction`](./thumbnail#ithumbnailaction) `<Data \| Data[]>[]` | - | Array of [`IAction`](../../shared-types/actions#iactiont) for the rendered action buttons or actions inside the menu |
| isCompactStyle | `boolean` | `false` | Boolean value that determines the display style, either default (`false`) or compact (`true`) |
| modalProps | [`IThumbnailAction[]`](./thumbnail#ithumbnailaction) | - | Extra props passed to the internal [Mantine Modal](https://v6.mantine.dev/core/modal/) component, used for actions with confirmation enabled |
| overflowMenuLabel | `string` | `"Other actions"` |
| String used as both the `aria-label` and the Tooltip label of the menu button/icon |
| rowActionNumber | `number` | `1` | Index value used to determine which actions will be displayed directly in the action column (before this index) or in the action menu (starting at this index) |
| selectedElements <Required/> | `Data[]` | - | Array of currently selected elements, necessary for the `actions` to be able to pass those elements along |
| ... | - | - | extends [Group props](https://v6.mantine.dev/core/group/?t=props) |
14 changes: 7 additions & 7 deletions docs/react-front-kit/components/card-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import { GitHubLogo } from '../../../src/icons/GitHubLogo';

## Props

| Name | Type | Default | Description |
| -------------------- | ------------------- | ------- | ----------------------------------------------------------------------------------------- |
| children <Required/> | `ReactNode[]` | - | Table of items to be displayed in the component's list. |
| separator | `boolean` | `true` | Enable or disable the display of the separator between items. |
| gap | `MantineNumberSize` | `"xl"` | Space between items. |
| stackProps | `stackProps` | - | Allows access to the props of the sub-component Stack. |
| ... | | - | Extends [ScrollArea props](https://v6.mantine.dev/core/scroll-area/?t=props) from Mantine |
| Name | Type | Default | Description |
| -------------------- | ---------------- | ------- | ----------------------------------------------------------------------------------------- |
| children <Required/> | `ReactNode[]` | - | Table of items to be displayed in the component's list. |
| separator | `boolean` | `true` | Enable or disable the display of the separator between items. |
| gap | `MantineSpacing` | `"xl"` | Space between items. |
| stackProps | `stackProps` | - | Allows access to the props of the sub-component Stack. |
| ... | | - | Extends [ScrollArea props](https://v6.mantine.dev/core/scroll-area/?t=props) from Mantine |
2 changes: 1 addition & 1 deletion docs/react-front-kit/components/collapse-button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const [opened, setOpened] = useState(true);
| isOpenOnSelect | `boolean` | `true` | When `true`, clicking/selecting anywhere on the button will also open the`Collapse`. When `false`, only clicking the collapse icon will open the `Collapse` |
| label | `ReactNode` | - | `Button` label |
| level | `number` | `0` | Used in nested menus such as [SidebarMenu](./sidebar-menu), levels `0`, `1` and `2` have slightly different styles |
| line | `"simple" \| "line"` | `"simple"` | Used in nested menus such as [SidebarMenu](./sidebar-menu), when `"line"` will display a vertical line to the left of the button. When `"simple"` same thing without line |
| indentation | `"simple" \| "line"` | `"simple"` | Used in nested menus such as [SidebarMenu](./sidebar-menu), when `"line"` will display a vertical line to the left of the button. When `"simple"` same thing without line |
| onSelect | `(id?: number \| string) => void` | - | Called when button is selected (does not include the collapse icon) |
| selected | `boolean` | - | Controlled value determining if the button is selected, affects the button style |
| ... | - | - | extends [Button props](https://v6.mantine.dev/core/button/?t=props) |
Expand Down
2 changes: 1 addition & 1 deletion docs/react-front-kit/components/confirm-modal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

| Name | Type | Default | Description |
| ------------ | -------------- | ----------- | ---------------------------------------------------------------------------- |
| cancelColor | `MantineColor` | `gray` | [MantineColor](https://v6.mantine.dev/theming/colors/) of the cancel button |
| cancelColor | `MantineColor` | `"gray"` | [MantineColor](https://v6.mantine.dev/theming/colors/) of the cancel button |
| cancelLabel | `string` | `"Cancel"` | Label of the cancel button |
| confirmColor | `MantineColor` | `"primary"` | [MantineColor](https://v6.mantine.dev/theming/colors/) of the confirm button |
| confirmLabel | `string` | `"Confirm"` | Label of the confirm button |
Expand Down
20 changes: 11 additions & 9 deletions docs/react-front-kit/components/document-box.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@

## Props

| Name | Type | Default | Description |
| -------- | ---------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------- |
| author | `ReactNode` | - | Content displayed as the author of the document, after the `date` |
| children | `ReactNode` | - | Content displayed below the document title and metadata |
| date | `ReactNode` | - | Content displayed as the document's date, below the document title and before the `author` |
| iconType | [`IconMap`](../../shared-types/icon-map) | empty file icon | Icon indicating the filetype of the document, one of the [`IconMap`](../../shared-types/icon-map) values |
| image | `string` | default fallback image | Path to the image or thumbnail of the document, displayed on the left |
| path | `ReactNode` | - | Content displayed as the document's path, after the document title |
| title | `ReactNode` | - | Content displayed as the document's title, at the top |
| Name | Type | Default | Description |
| ---------------------- | ---------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------- |
| author | `ReactNode` | - | Content displayed as the author of the document, after the `date` |
| children | `ReactNode` | - | Content displayed below the document title and metadata |
| date | `ReactNode` | - | Content displayed as the document's date, below the document title and before the `author` |
| iconType | [`IconMap`](../../shared-types/icon-map) | empty file icon | Icon indicating the filetype of the document, one of the [`IconMap`](../../shared-types/icon-map) values |
| image | `string` | default fallback image | Path to the image or thumbnail of the document, displayed on the left |
| mobileImageButtonLabel | `string` | `"'Display preview"` | Label for mobile collapse button |
| path | `ReactNode` | - | Content displayed as the document's path, after the document title |
| title | `ReactNode` | - | Content displayed as the document's title, at the top |
| onCardClick | `(() => void)` | - | Callback function called when the user clicks on the card. |
25 changes: 15 additions & 10 deletions docs/react-front-kit/components/header-mobile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@

## Props

| Name | Type | Default | Description |
| -------------- | ---------------------------- | ------- | ---------------------------------------------------------------------------------------------------- |
| children | `ReactNode` | - | Main content of header |
| height | `number` | `90` | Height of Header |
| left | `ReactNode` | - | Left section |
| right | `ReactNode` | - | Right section |
| searchValue | `string` | - | Controlled value of search bar input |
| onSearchSubmit | `(event: FormEvent) => void` | - | Called when search bar input is submitted |
| WithBorder | `boolean` | `false` | Display or not a border on the Header |
| ... | - | - | extends [Mantine's HeaderProps](https://v6.mantine.dev/core/app-shell/?t=props#headercomponentprops) |
| Name | Type | Default | Description |
| ---------------- | --------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------- |
| children | `ReactNode` | - | Main content of header |
| height | `number` | `90` | Height of Header |
| left | `ReactNode` | - | Left section |
| right | `ReactNode` | - | Right section |
| searchValue | `string` | - | Controlled value of search bar input |
| onSearchChange | `(value: string) => void` | - | Callback function that returns the value of the field as soon as it changes |
| onSearchSubmit | `(event: FormEvent) => void` | - | Called when search bar input is submitted |
| searchInputProps | `Omit<TextInputProps, 'onChange' \| 'value'>` | - | Allows configuring the props of the child component TextInput |
| WithBorder | `boolean` | `false` | Display or not a border on the Header |
| hasSearch | `boolean` | `true` | Control the display of the search bar |
| burgerProps | `Omit<BurgerProps, "onClick" \| "opened">` | - | Allows configuring the props of the child component Burger |
| collapseProps | `Omit<CollapseProps, "in">` | - | Allows configuring the props of the child component Collapse |
| ... | - | - | extends [Mantine's HeaderProps](https://v6.mantine.dev/core/app-shell/?t=props#headercomponentprops) |
Loading

0 comments on commit 82ae83c

Please sign in to comment.