@axinom/mosaic-ui 0.63.0-rc.7 → 0.63.0-rc.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": "@axinom/mosaic-ui",
3
- "version": "0.63.0-rc.7",
3
+ "version": "0.63.0-rc.9",
4
4
  "description": "UI components for building Axinom Mosaic applications",
5
5
  "author": "Axinom",
6
6
  "license": "PROPRIETARY",
@@ -112,5 +112,5 @@
112
112
  "publishConfig": {
113
113
  "access": "public"
114
114
  },
115
- "gitHead": "1f22bcb689ffc91a420d7c34d4b829a0f79ea9d2"
115
+ "gitHead": "d34c0f906f1242b164d1d25b1a3f1547eda53996"
116
116
  }
@@ -75,6 +75,7 @@ export const useBulkEdit = <T extends Data>({
75
75
  ? {
76
76
  label: bulkEditRegistration.label ?? 'Bulk Edit',
77
77
  icon: bulkEditRegistration.icon ?? IconName.BulkEdit,
78
+ tag: 'BETA',
78
79
  onClick: () => setIsBulkEditMode((prev) => !prev),
79
80
  }
80
81
  : undefined,
@@ -63,6 +63,7 @@ export const useActions = <T extends Data>({
63
63
  }: UseActionsProps<T>): UseActionsReturnType => {
64
64
  const bulkActionItems: PageHeaderJsActionProps[] = useMemo(
65
65
  () => [
66
+ ...(bulkEditAction ? [bulkEditAction] : []),
66
67
  ...(bulkActions ?? []).map((action) => ({
67
68
  ...action,
68
69
  onClick: async () => {
@@ -101,7 +102,6 @@ export const useActions = <T extends Data>({
101
102
  }
102
103
  },
103
104
  })),
104
- ...(bulkEditAction ? [bulkEditAction] : []),
105
105
  ],
106
106
  [
107
107
  bulkActions,
@@ -25,6 +25,13 @@ const headerActions: PageHeaderActionItemProps[] = [
25
25
  ];
26
26
 
27
27
  const bulkHeaderActions: PageHeaderActionProps[] = [
28
+ {
29
+ label: 'Bulk Edit',
30
+ actionType: PageHeaderActionType.Context,
31
+ icon: IconName.BulkEdit,
32
+ tag: 'BETA',
33
+ onClick: action('onActionSelected'),
34
+ },
28
35
  {
29
36
  label: 'Bulk Delete',
30
37
  actionType: PageHeaderActionType.Context,
@@ -67,6 +74,7 @@ const bulkHeaderActions: PageHeaderActionProps[] = [
67
74
  label: 'Bulk Action 4',
68
75
  confirmationMode: 'Simple',
69
76
  onClick: action('onActionSelected'),
77
+ tag: 'BETA',
70
78
  },
71
79
  ];
72
80
 
@@ -48,4 +48,6 @@ interface BaseActionOptions {
48
48
  disabled?: boolean;
49
49
  /** Optional class */
50
50
  className?: string;
51
+ /** Optional tag to display in the action */
52
+ tag?: string;
51
53
  }
@@ -163,4 +163,32 @@
163
163
 
164
164
  color: var(--actions-disabled-fg-color, $actions-disabled-fg-color);
165
165
  }
166
+
167
+ .tag {
168
+ position: absolute;
169
+ transform: rotate(45deg) translateX(53px) translateY(-40px);
170
+ transform-origin: center;
171
+ top: 0;
172
+ left: 0;
173
+ display: grid;
174
+ background-color: var(
175
+ --page-header-action-tag-background-color,
176
+ $page-header-action-tag-background-color
177
+ );
178
+ font-size: var(
179
+ --page-header-action-tag-font-size,
180
+ $page-header-action-tag-font-size
181
+ );
182
+ font-weight: bold;
183
+ width: 75px;
184
+ height: 14px;
185
+ align-items: center;
186
+ text-align: center;
187
+ z-index: 0;
188
+ }
189
+
190
+ &:has(.tag) {
191
+ position: relative;
192
+ overflow: hidden;
193
+ }
166
194
  }
@@ -645,16 +645,6 @@ describe('PageHeaderAction', () => {
645
645
  const link = wrapper.find('Link');
646
646
  expect(link.prop('target')).toBeUndefined();
647
647
  });
648
-
649
- it('renders with disabled class if disabled prop is true', () => {
650
- const wrapper = mount(
651
- <Router>
652
- <PageHeaderAction {...defaultProps} path="/test" disabled />
653
- </Router>,
654
- );
655
- const container = wrapper.find('.container').hostNodes();
656
- expect(container.hasClass('disabled')).toBe(true);
657
- });
658
648
  });
659
649
  });
660
650
 
@@ -69,6 +69,7 @@ const PageHeaderJSAction: React.FC<PageHeaderJsActionProps> = ({
69
69
  disabled,
70
70
  className,
71
71
  onClick = noop,
72
+ tag,
72
73
  }) => {
73
74
  const [confirmation, setConfirmation] = useState<boolean>(false);
74
75
  const [referenceElement, setReferenceElement] = useState<HTMLElement>();
@@ -156,10 +157,10 @@ const PageHeaderJSAction: React.FC<PageHeaderJsActionProps> = ({
156
157
  <span data-test-id="label">{label}</span>
157
158
  )}
158
159
  </div>
160
+ {tag && <div className={classes.tag}>{tag}</div>}
159
161
  </button>
160
162
  {confirmation && confirmationMode === 'Advanced' && (
161
163
  <ConfirmDialog
162
- className={classes.confirmDialog}
163
164
  referenceElement={referenceElement}
164
165
  title={title}
165
166
  cancelButtonText={cancelButtonText}
@@ -185,12 +186,12 @@ const PageHeaderJSAction: React.FC<PageHeaderJsActionProps> = ({
185
186
  */
186
187
  const PageHeaderNavigationAction: React.FC<PageHeaderNavigationActionProps> = ({
187
188
  className,
188
- disabled,
189
189
  icon,
190
190
  imgAlt,
191
191
  label,
192
192
  openInNewTab = false,
193
193
  path,
194
+ tag,
194
195
  }) => {
195
196
  const headerIcon = icon ? icon : openInNewTab ? IconName.External : undefined;
196
197
 
@@ -199,7 +200,6 @@ const PageHeaderNavigationAction: React.FC<PageHeaderNavigationActionProps> = ({
199
200
  className={clsx(
200
201
  classes.container,
201
202
  'page-header-action-container',
202
- { [classes.disabled]: disabled },
203
203
  className,
204
204
  )}
205
205
  data-test-id="action"
@@ -216,6 +216,7 @@ const PageHeaderNavigationAction: React.FC<PageHeaderNavigationActionProps> = ({
216
216
  <div className={classes.label}>
217
217
  <span data-test-id="label">{label}</span>
218
218
  </div>
219
+ {tag && <div className={classes.tag}>{tag}</div>}
219
220
  </Link>
220
221
  );
221
222
  };
@@ -145,7 +145,7 @@ export const PageHeaderActionsGroup: React.FC<PageHeaderActionsGroupProps> = ({
145
145
  }
146
146
  await onActionsGroupToggled(!isExpanded);
147
147
  toggleExpanded();
148
- } catch (e) {
148
+ } catch (_) {
149
149
  // Abort the action if an error occurs
150
150
  return;
151
151
  }
@@ -202,6 +202,10 @@ export const PageHeaderActionsGroup: React.FC<PageHeaderActionsGroupProps> = ({
202
202
  <PageHeaderAction
203
203
  key={idx}
204
204
  {...action}
205
+ tag={undefined}
206
+ label={
207
+ action.tag ? `${action.label} (${action.tag})` : action.label
208
+ }
205
209
  disabled={groupActionsDisabled}
206
210
  onClick={() => {
207
211
  action.onClick();
@@ -119,6 +119,8 @@ $page-header-height: 100px;
119
119
  /* PageHeaderAction */
120
120
  $page-header-action-color: #ffffff;
121
121
  $page-header-action-background-color: $light-blue;
122
+ $page-header-action-tag-background-color: $light-gray;
123
+ $page-header-action-tag-font-size: 10px;
122
124
 
123
125
  $page-header-action-confirmation-background-color: $yellow;
124
126
  $page-header-action-pressed-color: $page-header-action-background-color;