-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add calendar-header icon-card and form/full-name-fields
- Loading branch information
Showing
4 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { GitHubLogo } from '../../../src/icons/GitHubLogo'; | ||
|
||
# Calendar Header | ||
|
||
<Description | ||
extendsInfo={[ | ||
{ | ||
label: 'CalendarHeader', | ||
link: 'https://github.com/mantinedev/mantine/blob/master/packages/%40mantine/dates/src/components/CalendarHeader/CalendarHeader.tsx', | ||
}, | ||
]} | ||
importExample="import { CalendarHeader } from '@smile/react-front-kit';" | ||
packageInfo={{ | ||
label: '@smile/react-front-kit', | ||
link: 'https://www.npmjs.com/package/@smile/react-front-kit', | ||
}} | ||
sourceInfo={{ | ||
link: 'https://github.com/Smile-SA/react-front-kit/blob/main/packages/react-front-kit/src/Components/CalendarHeader/CalendarHeader.tsx', | ||
}} | ||
> | ||
Renders a horizontal bar displaying the number of selected elements and an | ||
array of [`IAction`s](../../shared-types/actions#iactiont) as | ||
[ActionIcons](https://v6.mantine.dev/core/action-icon/) | ||
</Description> | ||
|
||
## Storybook Docs | ||
|
||
<StorybookEmbed | ||
storyId="3-custom-components-calendarheader--docs" | ||
height="1780" | ||
/> | ||
|
||
## Props | ||
|
||
CalendarHeader takes a `<Data>` generic type that extends `Record<string, unknown>`, to be used by [ActionRowOverflow](./action-row-overflow). | ||
|
||
| Name | Type | Default | Description | | ||
| ----------------- | ----------------------------------------------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| date <Required/> | `Date` | - | | | ||
| label | `ReactNode` | - | | | ||
| level <Required/> | `"month" \| "year" \| "decade"` | - | | | ||
| onDateClick | `((event: MouseEvent<HTMLButtonElement, MouseEvent>, date: Date, level: ICalendarHeaderClickType) => void)` | - | | | ||
| onNext | | - | | | ||
| onPrevious | | - | | | ||
| monthProps | `Omit<MonthProps, "month">` | - | | | ||
| yearsListProps | `Omit<YearsListProps, "decade">` | - | | | ||
| ... | - | - | extends [`CalendarHeader props`](https://github.com/mantinedev/mantine/blob/master/packages/%40mantine/dates/src/components/CalendarHeader/CalendarHeader.tsx) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Icon card | ||
|
||
<Description | ||
extendsInfo={[ | ||
{ | ||
label: 'Card', | ||
link: 'https://mantine.dev/core/card/', | ||
}, | ||
]} | ||
importExample="import { IconCard } from '@smile/react-front-kit';" | ||
packageInfo={{ | ||
label: '@smile/react-front-kit', | ||
link: 'https://www.npmjs.com/package/@smile/react-front-kit', | ||
}} | ||
sourceInfo={{ | ||
link: 'https://github.com/Smile-SA/react-front-kit/blob/main/packages/react-front-kit/src/Components/IconCard/IconCard.tsx', | ||
}} | ||
> | ||
Renders a horizontal bar displaying the number of selected elements and an | ||
array of [`IAction`s](../../shared-types/actions#iactiont) as | ||
[ActionIcons](https://v6.mantine.dev/core/action-icon/) | ||
</Description> | ||
|
||
## Storybook Docs | ||
|
||
<StorybookEmbed storyId="3-custom-components-iconcard--docs" height="2020" /> | ||
|
||
## Props | ||
|
||
| Name | Type | Default | Description | | ||
| -------- | ----------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| children | `ReactNode` | - | Free area in the lower zone of the map | | ||
| icon | `ReactNode` | - | Area in the top of the map primarily used for displaying icons but can show anything that corresponds to the ReactNode type | | ||
| subTitle | `ReactNode` | - | SubTitle area | | ||
| title | `ReactNode` | - | TItle area | | ||
| color | `string` | - | Define the background color of the card. By default, the primary color is applied. Auto-contrast is used to automatically change the text color | | ||
| ... | - | - | extends [`card props`](https://mantine.dev/core/card/?t=props). | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"label": "Form", | ||
"position": 3, | ||
"link": { | ||
"type": "generated-index" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Full Name Fields | ||
|
||
<Description | ||
extendsInfo={[ | ||
{ | ||
label: 'Flex', | ||
link: 'https://mantine.dev/core/flex/', | ||
}, | ||
{ | ||
label: 'TextInput', | ||
link: 'https://mantine.dev/core/text-input/', | ||
}, | ||
]} | ||
importExample="import { FullNameFields } from '@smile/react-front-kit';" | ||
packageInfo={{ | ||
label: '@smile/react-front-kit', | ||
link: 'https://www.npmjs.com/package/@smile/react-front-kit', | ||
}} | ||
sourceInfo={{ | ||
link: 'https://github.com/Smile-SA/react-front-kit/blob/main/packages/react-front-kit/src/Components/FullNameFields/FullNameFields.tsx', | ||
}} | ||
> | ||
Displaying a grouped input with first name and last name, usable in a | ||
controlled manner. | ||
</Description> | ||
|
||
## Storybook Docs | ||
|
||
<StorybookEmbed | ||
storyId="3-custom-components-fullnamefields--docs" | ||
height="820" | ||
/> | ||
|
||
## Props | ||
|
||
| Name | Type | Default | Description | | ||
| -------------- | ---------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- | | ||
| firstNameProps | [`TextInputProps`](https://mantine.dev/core/text-input/?t=props) | - | extends [`text input props`](https://mantine.dev/core/text-input/) If configured, the changes will apply to the firstName input | | ||
| lastNameProps | [`TextInputProps`](https://mantine.dev/core/text-input/?t=props) | - | extends [`text input props`](https://mantine.dev/core/text-input/) If configured, the changes will apply to the lastName input | | ||
| onChange | `((value: IFullNameFieldsValues) => void)` | - | Callback function returning the value of the input that has just been changed | | ||
| value | `IFullNameFieldsValues` | - | Allows setting the values of the two text input fields | | ||
| ... | - | - | extends [`flex props`](https://mantine.dev/core/flex/?t=props) | | ||
|
||
## IFullNameFieldsValues | ||
|
||
| Name | Type | Default | Description | | ||
| --------- | -------- | ------- | -------------------------- | | ||
| firstName | `string` | - | Value of `firstName` field | | ||
| lastName | `string` | - | Value of `lastName` field | |