-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
186 additions
and
44 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
4 changes: 1 addition & 3 deletions
4
...omponents/src/components/ContextMenu/components/ContextMenuTrigger/ContextMenuTrigger.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
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
9 changes: 9 additions & 0 deletions
9
packages/components/src/components/List/components/ListSummary/ListSummary.module.scss
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,9 @@ | ||
.listSummary { | ||
border-width: var(--list-item--border-width); | ||
border-bottom-width: 0; | ||
border-style: var(--list-item--border-style); | ||
border-color: var(--list-item--border-color); | ||
padding: var(--list-item--padding); | ||
border-top-left-radius: var(--list-item--corner-radius); | ||
border-top-right-radius: var(--list-item--corner-radius); | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/components/src/components/List/components/ListSummary/ListSummary.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,21 @@ | ||
import type { PropsWithChildren } from "react"; | ||
import React from "react"; | ||
import styles from "./ListSummary.module.scss"; | ||
import type { FlowComponentProps } from "@/lib/componentFactory/flowComponent"; | ||
import { flowComponent } from "@/lib/componentFactory/flowComponent"; | ||
|
||
export interface ListSummaryProps | ||
extends FlowComponentProps, | ||
PropsWithChildren {} | ||
|
||
export const ListSummary = flowComponent("ListSummary", (props) => { | ||
const { children } = props; | ||
|
||
return ( | ||
<header className={styles.listSummary} {...props}> | ||
{children} | ||
</header> | ||
); | ||
}); | ||
|
||
export default ListSummary; |
4 changes: 4 additions & 0 deletions
4
packages/components/src/components/List/components/ListSummary/index.ts
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,4 @@ | ||
import { ListSummary } from "./ListSummary"; | ||
|
||
export { ListSummary } from "./ListSummary"; | ||
export default ListSummary; |
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
31 changes: 12 additions & 19 deletions
31
packages/components/src/components/Popover/components/PopoverTrigger/PopoverTrigger.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 |
---|---|---|
@@ -1,24 +1,17 @@ | ||
import * as Aria from "react-aria-components"; | ||
import type { FC } from "react"; | ||
import React from "react"; | ||
import type { OverlayTriggerProps } from "@/components/OverlayTrigger"; | ||
import { OverlayTrigger } from "@/components/OverlayTrigger"; | ||
import { flowComponent } from "@/lib/componentFactory/flowComponent"; | ||
|
||
type Props = Omit<OverlayTriggerProps, "overlayType">; | ||
|
||
export const PopoverTrigger: FC<Props> = flowComponent( | ||
"PopoverTrigger", | ||
(props) => { | ||
const { children, ...triggerProps } = props; | ||
return ( | ||
<OverlayTrigger | ||
overlayType="Popover" | ||
{...triggerProps} | ||
component={Aria.DialogTrigger} | ||
> | ||
{children} | ||
</OverlayTrigger> | ||
); | ||
}, | ||
); | ||
export const PopoverTrigger = flowComponent("PopoverTrigger", (props) => { | ||
const { children, ...triggerProps } = props; | ||
return ( | ||
<OverlayTrigger | ||
overlayType="Popover" | ||
{...triggerProps} | ||
component={Aria.DialogTrigger} | ||
> | ||
{children} | ||
</OverlayTrigger> | ||
); | ||
}); |
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
57 changes: 57 additions & 0 deletions
57
packages/docs/src/content/03-components/structure/list/examples/summary.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,57 @@ | ||
import { | ||
ListItemView, | ||
ListSummary, | ||
typedList, | ||
} from "@mittwald/flow-react-components/List"; | ||
import Heading from "@mittwald/flow-react-components/Heading"; | ||
import Text from "@mittwald/flow-react-components/Text"; | ||
|
||
export default () => { | ||
const InvoiceList = typedList<{ | ||
id: string; | ||
date: string; | ||
amount: string; | ||
}>(); | ||
|
||
return ( | ||
<InvoiceList.List batchSize={5} aria-label="Invoices"> | ||
<ListSummary> | ||
<Text | ||
style={{ display: "block", textAlign: "right" }} | ||
> | ||
<b>Gesamt: 41,00 €</b> | ||
</Text> | ||
</ListSummary> | ||
<InvoiceList.StaticData | ||
data={[ | ||
{ | ||
id: "RG100000", | ||
date: "1.9.2024", | ||
amount: "25,00 €", | ||
}, | ||
{ | ||
id: "RG100001", | ||
date: "12.9.2024", | ||
amount: "12,00 €", | ||
}, | ||
{ | ||
id: "RG100002", | ||
date: "3.10.2024", | ||
amount: "4,00 €", | ||
}, | ||
]} | ||
/> | ||
|
||
<InvoiceList.Item> | ||
{(invoice) => ( | ||
<ListItemView> | ||
<Heading>{invoice.id}</Heading> | ||
<Text> | ||
{invoice.date} - {invoice.amount} | ||
</Text> | ||
</ListItemView> | ||
)} | ||
</InvoiceList.Item> | ||
</InvoiceList.List> | ||
); | ||
}; |
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