@heliosgraphics/ui 2.0.0-alpha.68 → 2.0.0-alpha.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,10 @@ export const meta: HeliosAttributeMeta<ConfirmProps> = {
18
18
  cancelText: {
19
19
  type: "string",
20
20
  },
21
+ confirmOrder: {
22
+ type: "'left' | 'right'",
23
+ isOptional: true,
24
+ },
21
25
  confirmText: {
22
26
  type: "string",
23
27
  },
@@ -1,10 +1,11 @@
1
1
  import { Button, ButtonGroup, Dialog, Flex, Text } from "../.."
2
2
  import type { ConfirmProps } from "./Confirm.types"
3
- import type { FC } from "react"
3
+ import type { FC, ReactNode } from "react"
4
4
 
5
5
  export const Confirm: FC<ConfirmProps> = ({
6
- buttonGroupAlign,
6
+ buttonGroupAlign = "right",
7
7
  cancelText,
8
+ confirmOrder = "right",
8
9
  confirmText,
9
10
  description,
10
11
  icon,
@@ -14,13 +15,18 @@ export const Confirm: FC<ConfirmProps> = ({
14
15
  onConfirm,
15
16
  title,
16
17
  }) => {
18
+ const confirmButton: ReactNode = (
19
+ <Button intent={intent} value={confirmText} onClick={onConfirm} {...(icon && { icon })} />
20
+ )
21
+
17
22
  return (
18
23
  <Dialog title={title} onClose={onCancel} isOpen={isOpen} isCentered={true}>
19
24
  <Flex gap={12} isColumn={true}>
20
25
  {!!description && <Text type="paragraph">{description}</Text>}
21
26
  <ButtonGroup align={buttonGroupAlign}>
22
- <Button intent={intent} value={confirmText} onClick={onConfirm} {...(icon && { icon })} />
27
+ {confirmOrder === "left" && confirmButton}
23
28
  <Button intent="neutral" value={cancelText} onClick={onCancel} />
29
+ {confirmOrder === "right" && confirmButton}
24
30
  </ButtonGroup>
25
31
  </Flex>
26
32
  </Dialog>
@@ -3,6 +3,7 @@ import type { ButtonGroupProps, HeliosIconType, HeliosIntentionType } from "../.
3
3
  export interface ConfirmProps {
4
4
  cancelText: string
5
5
  confirmText: string
6
+ confirmOrder?: "left" | "right"
6
7
  buttonGroupAlign?: ButtonGroupProps["align"]
7
8
  description?: string
8
9
  icon?: HeliosIconType
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heliosgraphics/ui",
3
- "version": "2.0.0-alpha.68",
3
+ "version": "2.0.0-alpha.69",
4
4
  "type": "module",
5
5
  "author": "Chris Puska <chris@puska.org>",
6
6
  "private": false,