@lumx/react 3.19.1-alpha.1 → 3.19.1-alpha.3

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
@@ -6,8 +6,8 @@
6
6
  "url": "https://github.com/lumapps/design-system/issues"
7
7
  },
8
8
  "dependencies": {
9
- "@lumx/core": "^3.19.1-alpha.1",
10
- "@lumx/icons": "^3.19.1-alpha.1",
9
+ "@lumx/core": "^3.19.1-alpha.3",
10
+ "@lumx/icons": "^3.19.1-alpha.3",
11
11
  "@popperjs/core": "^2.5.4",
12
12
  "body-scroll-lock": "^3.1.5",
13
13
  "classnames": "^2.3.2",
@@ -105,5 +105,5 @@
105
105
  "build:storybook": "storybook build"
106
106
  },
107
107
  "sideEffects": false,
108
- "version": "3.19.1-alpha.1"
108
+ "version": "3.19.1-alpha.3"
109
109
  }
@@ -64,7 +64,7 @@ describe(`<${Thumbnail.displayName}>`, () => {
64
64
  it('should render clickable link', async () => {
65
65
  const onClick = jest.fn((evt) => evt.preventDefault());
66
66
  const { thumbnail } = setup({ linkProps: { href: '#' }, onClick, alt: 'Name' });
67
- const link = screen.getByRole('link', { name: 'Name' });
67
+ const link = screen.getByRole('link');
68
68
  expect(link).toBe(thumbnail);
69
69
  expect(link).toHaveAttribute('href', '#');
70
70
 
@@ -160,8 +160,9 @@ export const Thumbnail = forwardRef<ThumbnailProps>((props, ref) => {
160
160
  Object.assign(wrapperProps, { as: linkAs || (linkProps?.href ? 'a' : 'button') }, disabledStateProps);
161
161
  if (isLink) {
162
162
  Object.assign(wrapperProps, linkProps);
163
+ } else {
164
+ wrapperProps['aria-label'] = forwardedProps['aria-label'] || alt;
163
165
  }
164
- wrapperProps['aria-label'] = forwardedProps['aria-label'] || alt;
165
166
  }
166
167
 
167
168
  // If we have a loading placeholder image that is really loaded (complete)
@@ -126,7 +126,7 @@ describe(`<RawClickable>`, () => {
126
126
 
127
127
  describe('prop forwarding', () => {
128
128
  it('should forward className', () => {
129
- const { element } = setup({ as:'button', className: 'foo bar' });
129
+ const { element } = setup({ as: 'button', className: 'foo bar' });
130
130
  expect(element).toHaveClass('foo bar');
131
131
  });
132
132
 
@@ -46,7 +46,7 @@ export const RawClickable = forwardRefPolymorphic(
46
46
  return (
47
47
  <Component
48
48
  ref={ref}
49
- aria-disabled={isAnyDisabled}
49
+ aria-disabled={isAnyDisabled || undefined}
50
50
  {...forwardedProps}
51
51
  {...clickableProps}
52
52
  onClick={(event: any) => {