-
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 DataBadge component documentation * feat: change location of data-badge * feat: add calendar-header icon-card and form/full-name-fields * feat: add texts for calendar-header * fix: fix dead links --------- Co-authored-by: pereag <[email protected]>
- Loading branch information
Showing
10 changed files
with
187 additions
and
5 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
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,51 @@ | ||
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', | ||
}} | ||
storybookInfo="3-custom-components-calendarheader--docs" | ||
> | ||
Display a controlled calendar header with 3 levels of precision: Year, Day, | ||
and Decade. The component is based on a component | ||
[CalendarHeader](https://github.com/mantinedev/mantine/blob/master/packages/%40mantine/dates/src/components/CalendarHeader/CalendarHeader.tsx) | ||
he is not shown in the documentation but visible in the library's code. | ||
</Description> | ||
|
||
## Storybook Docs | ||
|
||
<StorybookEmbed | ||
storyId="3-custom-components-calendarheader--docs" | ||
height="1780" | ||
/> | ||
|
||
## Props | ||
|
||
| Name | Type | Default | Description | | ||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| date <Required/> | `Date` | - | Value given to define the date displayed on the calendarHeader | | ||
| level <Required/> | [`ICalendarHeaderClickType`](#icalendarheaderclicktype) | - | Defines the date level to display in the header modal | | ||
| onDateClick | `((event: MouseEvent<HTMLButtonElement, MouseEvent>, date: Date, level: `[`ICalendarHeaderClickType`](#icalendarheaderclicktype)` ) => void)` | - | Returns a callback function that provides the value of the date that has just been clicked and the current level | | ||
| monthProps | `Omit<MonthProps, "month">` | - | Allows configuring the props of the Month component from Mantine. | | ||
| monthListProps | `Omit<MonthsListProps, "year">` | - | Allows configuring the props of the MonthList component from Mantine. | | ||
| yearsListProps | `Omit<YearsListProps, "decade">` | - | Allows configuring the props of the YearsList component from Mantine. | | ||
| ... | - | - | extends [`CalendarHeader props`](https://github.com/mantinedev/mantine/blob/master/packages/%40mantine/dates/src/components/CalendarHeader/CalendarHeader.tsx) | | ||
|
||
## ICalendarHeaderClickType | ||
|
||
| Type | Description | | ||
| ------------------------------- | ---------------------------------------------------- | | ||
| `"month" \| "year" \| "decade"` | Value of the click location's level of localization. | |
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 @@ | ||
# Data Badge | ||
|
||
<Description | ||
extendsInfo={[ | ||
{ | ||
label: 'Badge', | ||
link: 'https://mantine.dev/core/badge/', | ||
}, | ||
]} | ||
importExample="import { DataBadge } 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/DataBadge/DataBadge.tsx', | ||
}} | ||
storybookInfo="3-custom-components-databadge--docs" | ||
> | ||
Display a badge that spans the entire width of the parent component with a | ||
number field and text. There are two types of displays: large and medium. | ||
</Description> | ||
|
||
## Storybook Docs | ||
|
||
<StorybookEmbed storyId="3-custom-components-databadge--docs" height="1180" /> | ||
|
||
## Props | ||
|
||
| Name | Type | Default | Description | | ||
| -------- | --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| children | `string` | - | The text is displayed to the right of the number. | | ||
| color | `DefaultMantineColor` | - | The color applied to the badge, and the contrast is automatically managed by the `autoContrast` prop of the `Badge` component. If the prop is not specified, the text color will be black, and there will be no `backgroundColor`. | | ||
| number | `number` | - | The number value is displayed to the left of the text. The `fit-content` property and a `margin-right` are applied to the number tag. | | ||
| size | `"lg" \| "md"` | `"md"` | Controls the appearance of the component. Allows switching between two templates: `"md"` and `"lg"`. | | ||
| ratio | `number ` | - | Manages the default width size of the number tag. | | ||
| ... | - | - | extends [`Badge props`](https://mantine.dev/core/badge/) | |
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
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
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,38 @@ | ||
# 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', | ||
}} | ||
storybookInfo="3-custom-components-iconcard--docs" | ||
> | ||
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
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
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,46 @@ | ||
# 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-form-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 | |