agroptima-design-system 1.2.7 → 1.2.9

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": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -18,7 +18,7 @@
18
18
  .notification-center {
19
19
  display: flex;
20
20
  flex-direction: column;
21
- width: 350px;
21
+ width: 450px;
22
22
  box-shadow:
23
23
  0 3px 6px -4px rgba(0, 0, 0, 0.12),
24
24
  0px 6px 16px 0px rgba(0, 0, 0, 0.08),
@@ -42,18 +42,31 @@
42
42
  .notification-header-content {
43
43
  display: flex;
44
44
  flex-direction: row;
45
- justify-content: space-between;
46
45
  align-items: center;
47
46
  padding: config.$space-2x config.$space-3x;
48
47
  gap: config.$space-2x;
48
+ flex-wrap: wrap;
49
49
  background: var(--neutral-white);
50
50
 
51
- > .button:last-child {
52
- @include typography.footnote-primary;
53
- color: var(--primary-color-600);
54
- border: 0;
55
- background-color: transparent;
56
- padding: 0;
51
+ > .checkable-tag-group {
52
+ flex-grow: 1;
53
+ min-width: 0;
54
+ }
55
+
56
+ > .notification-header-actions {
57
+ flex-basis: 100%;
58
+ text-align: right;
59
+ flex-shrink: 1;
60
+ min-width: 0;
61
+
62
+ > .button {
63
+ @include typography.footnote-primary;
64
+ color: var(--primary-color-600);
65
+ border: 0;
66
+ background-color: transparent;
67
+ padding: 0;
68
+ white-space: normal;
69
+ }
57
70
  }
58
71
  }
59
72
  }
@@ -2,25 +2,29 @@
2
2
  import './NotificationCenter.scss'
3
3
  import React from 'react'
4
4
  import { classNames } from '../../utils/classNames'
5
- import { IconButton } from '../Button'
6
- import type { Variant } from '../Button/IconButton'
7
- import { Popover, type Position } from '../Popover'
8
5
 
9
6
  export interface NotificationHeaderProps {
10
7
  title: string
11
8
  className?: string
12
9
  children: React.ReactNode
10
+ actions?: React.ReactNode
13
11
  }
14
12
 
15
13
  function NotificationHeader({
16
14
  title,
17
15
  className,
18
16
  children,
17
+ actions,
19
18
  }: NotificationHeaderProps) {
20
19
  return (
21
20
  <div className={classNames('notification-header', className)}>
22
21
  <div className="notification-header-title">{title}</div>
23
- <div className="notification-header-content">{children}</div>
22
+ <div className="notification-header-content">
23
+ {children}
24
+ {actions && (
25
+ <div className="notification-header-actions">{actions}</div>
26
+ )}
27
+ </div>
24
28
  </div>
25
29
  )
26
30
  }
@@ -4,6 +4,14 @@ import { Meta } from "@storybook/addon-docs/blocks";
4
4
 
5
5
  # Changelog
6
6
 
7
+ ## 1.2.9
8
+
9
+ * The header actions, separated into another container
10
+
11
+ ## 1.2.8
12
+
13
+ * Increase notification width
14
+
7
15
  ## 1.2.7
8
16
 
9
17
  * Fix bug on InfiniteSelect component search
@@ -18,7 +26,7 @@ import { Meta } from "@storybook/addon-docs/blocks";
18
26
 
19
27
  ## 1.2.4
20
28
 
21
- * Add new prop decorative to Icon component to distinguish between decorative and informative icons
29
+ * Add new prop decorative to Icon component to distinguish between decorative and informative icons
22
30
  * Add more required accessibilityLabels
23
31
  * Add optional accessibilityLabels with fallbacks
24
32
  * Fix accessibilityLabels in Input type password and PaginationNumber
@@ -63,7 +71,6 @@ import { Meta } from "@storybook/addon-docs/blocks";
63
71
 
64
72
  * CardMenuOption can be a button or a link
65
73
 
66
-
67
74
  ## 1.0.7
68
75
 
69
76
  * Add link styles to Alert component
@@ -97,7 +104,8 @@ import { Meta } from "@storybook/addon-docs/blocks";
97
104
 
98
105
  ⚠️ **BREAKING CHANGES**: If the project which consumes the Design System is reading any of the color variables in SASS, please, use a version below 1.0.0 or update them to CSS variables.
99
106
 
100
- ### Add themes management:
107
+ ### Add themes management
108
+
101
109
  * Update colors.css, color_alias.css and create themes.css
102
110
  * Change SASS theme related variables to CSS variables
103
111
  * Refactor File Input component icon to fit themes
@@ -49,7 +49,15 @@ export const NotificationCenterWithNotifications: Story = {
49
49
 
50
50
  <div style={{ display: 'flex', gap: '10px' }}>
51
51
  <NotificationCenter hasNewNotifications={true}>
52
- <NotificationHeader title="Notifications">
52
+ <NotificationHeader
53
+ title="Notifications"
54
+ actions={
55
+ <Button
56
+ onClick={() => alert('mark all as read')}
57
+ label="Mark all as read"
58
+ />
59
+ }
60
+ >
53
61
  <CheckableTagGroup>
54
62
  <CheckableTag
55
63
  variant="primary"
@@ -73,10 +81,6 @@ export const NotificationCenterWithNotifications: Story = {
73
81
  isChecked={false}
74
82
  />
75
83
  </CheckableTagGroup>
76
- <Button
77
- onClick={() => alert('mark all as read')}
78
- label="Mark all as read"
79
- />
80
84
  </NotificationHeader>
81
85
  <NotificationList>
82
86
  <NotificationLine
@@ -134,7 +138,15 @@ export const NotificationCenterEmptyState: Story = {
134
138
 
135
139
  <div style={{ display: 'flex', gap: '10px' }}>
136
140
  <NotificationCenter {...props}>
137
- <NotificationHeader title="Notifications">
141
+ <NotificationHeader
142
+ title="Notifications"
143
+ actions={
144
+ <Button
145
+ onClick={() => alert('mark all as read')}
146
+ label="Mark all as read"
147
+ />
148
+ }
149
+ >
138
150
  <CheckableTagGroup>
139
151
  <CheckableTag
140
152
  variant="primary"
@@ -158,10 +170,6 @@ export const NotificationCenterEmptyState: Story = {
158
170
  isChecked={false}
159
171
  />
160
172
  </CheckableTagGroup>
161
- <Button
162
- onClick={() => alert('mark all as read')}
163
- label="Mark all as read"
164
- />
165
173
  </NotificationHeader>
166
174
  <NotificationEmptyState
167
175
  title="No new notifications"
@@ -13,7 +13,15 @@ describe('NotificationCenter', () => {
13
13
  it('renders with expected content and buttons', () => {
14
14
  const { getByText } = render(
15
15
  <NotificationCenter>
16
- <NotificationHeader title="Notifications">
16
+ <NotificationHeader
17
+ title="Notifications"
18
+ actions={
19
+ <Button
20
+ onClick={() => alert('mark all as read')}
21
+ label="Mark all as read"
22
+ />
23
+ }
24
+ >
17
25
  <CheckableTagGroup>
18
26
  <CheckableTag
19
27
  variant="primary"
@@ -37,10 +45,6 @@ describe('NotificationCenter', () => {
37
45
  isChecked={false}
38
46
  />
39
47
  </CheckableTagGroup>
40
- <Button
41
- onClick={() => alert('mark all as read')}
42
- label="Mark all as read"
43
- />
44
48
  </NotificationHeader>
45
49
  <NotificationList>
46
50
  <NotificationLine