agroptima-design-system 0.28.5-beta.3 → 0.28.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agroptima-design-system",
3
- "version": "0.28.5-beta.3",
3
+ "version": "0.28.5",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -24,7 +24,6 @@ export interface ModalProps {
24
24
  id: string
25
25
  title: string
26
26
  variant?: Variant
27
- closeButton?: boolean
28
27
  scrollable?: boolean
29
28
  className?: string
30
29
  onClose?: () => void
@@ -46,22 +45,23 @@ export function Modal({
46
45
  buttons,
47
46
  onClose,
48
47
  children,
49
- closeButton = false,
50
48
  variant = 'details',
51
49
  ...props
52
50
  }: ModalProps) {
51
+ const isDetails = variant === 'details'
52
+ const showCloseButton = onClose && isDetails
53
53
  return (
54
54
  <ModalDialog
55
55
  aria-labelledby={`${id}-title`}
56
56
  aria-describedby={`${id}-body`}
57
57
  onClose={onClose}
58
- details={variant === 'details'}
58
+ details={isDetails}
59
59
  {...props}
60
60
  >
61
61
  <ModalHeader>
62
62
  {ICONS[variant]}
63
63
  <ModalTitle id={`${id}-title`}>{title}</ModalTitle>
64
- {closeButton && <ModalCloseButton onClick={onClose} />}
64
+ {showCloseButton && <ModalCloseButton onClick={onClose} />}
65
65
  </ModalHeader>
66
66
  <ModalBody id={`${id}-body`}>{children}</ModalBody>
67
67
  <ModalFooter>
@@ -4,6 +4,11 @@ import { Meta } from "@storybook/blocks";
4
4
 
5
5
  # Changelog
6
6
 
7
+ ## 0.28.5
8
+
9
+ * Remove closeButton property to Modal component.
10
+
11
+
7
12
  ## 0.28.4
8
13
 
9
14
  * Update Modal component to adapt to the content height.
@@ -46,9 +46,6 @@ const meta = {
46
46
  onClose: {
47
47
  description: 'Function to be called when the modal is closed',
48
48
  },
49
- closeButton: {
50
- description: 'If the modal should have a close button',
51
- },
52
49
  },
53
50
  parameters: figmaPrimaryDesign,
54
51
  }
@@ -158,7 +155,6 @@ export const DeleteOrDiscard = {
158
155
  export const LargeModal = () => (
159
156
  <Modal
160
157
  title="Large Modal"
161
- closeButton
162
158
  onClose={() => alert('Close')}
163
159
  buttons={[
164
160
  { label: 'Close', variant: 'neutral', onClick: () => alert('Close') },
@@ -273,7 +269,6 @@ export const FormModal = () => (
273
269
  >
274
270
  <Modal
275
271
  title="Form Modal"
276
- closeButton
277
272
  onClose={() => alert('Close')}
278
273
  buttons={[
279
274
  {