uikit-react-public 0.43.1 → 0.43.4

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.
Files changed (64) hide show
  1. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +23 -6
  2. package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -4
  3. package/dist/components/Breadcrumbs/index.d.ts +3 -0
  4. package/dist/components/Paragraph/Paragraph.d.ts +1 -1
  5. package/dist/components/index.d.ts +3 -0
  6. package/dist/index.js +5459 -5222
  7. package/lib/components/Accordion/Accordion.Heading.tsx +0 -2
  8. package/lib/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap +2 -2
  9. package/lib/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap +4 -4
  10. package/lib/components/Avatar/Avatar.tsx +7 -1
  11. package/lib/components/Avatar/__tests__/__snapshots__/Avatar.test.tsx.snap +12 -12
  12. package/lib/components/Badge/Badge.tsx +6 -11
  13. package/lib/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap +9 -9
  14. package/lib/components/Breadcrumbs/Breadcrumbs.tsx +166 -7
  15. package/lib/components/Breadcrumbs/index.ts +3 -0
  16. package/lib/components/Button/Button.tsx +11 -7
  17. package/lib/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +9 -9
  18. package/lib/components/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +18 -18
  19. package/lib/components/Calendar/subcomponents/AcademicWeek.tsx +7 -5
  20. package/lib/components/Calendar/subcomponents/ColumnHeading.tsx +12 -7
  21. package/lib/components/Calendar/subcomponents/ControlsSelect.tsx +11 -6
  22. package/lib/components/Checkbox/__tests__/__snapshots__/Checkbox.test.tsx.snap +2 -2
  23. package/lib/components/Datepicker/__tests__/__snapshots__/Datepicker.test.tsx.snap +2 -2
  24. package/lib/components/DrawerMenu/DrawerMenu.tsx +4 -3
  25. package/lib/components/DropdownMenu/DropdownMenu.tsx +4 -3
  26. package/lib/components/DropdownUserMenu/DropdownUserMenu.tsx +8 -5
  27. package/lib/components/Field/CharacterCount.tsx +7 -6
  28. package/lib/components/Field/ErrorText.tsx +7 -6
  29. package/lib/components/FileInput/FileInput.tsx +11 -3
  30. package/lib/components/FileInput/__tests__/__snapshots__/FileInput.test.tsx.snap +4 -4
  31. package/lib/components/Footer/Footer.tsx +16 -3
  32. package/lib/components/Footer/FooterColumn.tsx +9 -4
  33. package/lib/components/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +13 -11
  34. package/lib/components/FooterNew/BackToTop.tsx +12 -4
  35. package/lib/components/FooterNew/FooterColumn.tsx +4 -0
  36. package/lib/components/FooterNew/FooterNavLink.tsx +12 -6
  37. package/lib/components/FooterNew/LegalAndCopyright.tsx +11 -6
  38. package/lib/components/FooterNew/LogoAddressAndSocial.tsx +27 -15
  39. package/lib/components/FooterNew/__tests__/__snapshots__/Footer.test.tsx.snap +32 -26
  40. package/lib/components/HeaderDraft/HeaderBottomBreadcrumbs.tsx +6 -1
  41. package/lib/components/HeaderDraft/HeaderBottomHeadingAndAvatar.tsx +19 -8
  42. package/lib/components/HeaderDraft/HeaderBreadcrumb.tsx +11 -2
  43. package/lib/components/HeaderDraft/HeaderDraft.tsx +16 -5
  44. package/lib/components/HeaderDraft/__tests__/__snapshots__/Header.test.tsx.snap +7 -7
  45. package/lib/components/HeaderNew/HeaderItem.tsx +6 -0
  46. package/lib/components/Input/__tests__/__snapshots__/Input.test.tsx.snap +4 -4
  47. package/lib/components/Menu/MenuContent.tsx +9 -1
  48. package/lib/components/NativeDatepicker/NativeDatepicker.tsx +6 -2
  49. package/lib/components/Pagination/PaginationInfo.tsx +8 -6
  50. package/lib/components/Pagination/subcomponents/PaginationCompactControls.tsx +8 -2
  51. package/lib/components/Pagination/subcomponents/PaginationStandardControls.tsx +2 -1
  52. package/lib/components/Paragraph/Paragraph.tsx +6 -4
  53. package/lib/components/Paragraph/__tests__/Paragraph.test.tsx +1 -1
  54. package/lib/components/Paragraph/__tests__/__snapshots__/Paragraph.test.tsx.snap +9 -9
  55. package/lib/components/Radio/__tests__/__snapshots__/Radio.test.tsx.snap +2 -2
  56. package/lib/components/Search/__tests__/__snapshots__/Search.test.tsx.snap +2 -2
  57. package/lib/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +1 -1
  58. package/lib/components/Table/subcomponents/Cell/__tests__/__snapshots__/Cell.test.tsx.snap +2 -2
  59. package/lib/components/Table/subcomponents/HeadCell/__tests__/__snapshots__/HeadCell.test.tsx.snap +1 -1
  60. package/lib/components/Textarea/__tests__/__snapshots__/Textarea.test.tsx.snap +4 -4
  61. package/lib/components/Tooltip/Tooltip.tsx +5 -8
  62. package/lib/components/Tooltip/__tests__/__snapshots__/tooltip.test.tsx.snap +2 -2
  63. package/lib/components/index.ts +4 -0
  64. package/package.json +2 -2
@@ -48,8 +48,6 @@ const AccordionHeading: React.FC<AccordionHeadingProps> = ({
48
48
  text-decoration: none;
49
49
  box-sizing: border-box;
50
50
  width: 100%;
51
- font-size: inherit;
52
- line-height: inherit;
53
51
 
54
52
  &:hover {
55
53
  background-color: ${theme.colour.surface.brandHover};
@@ -8,7 +8,7 @@ exports[`Accordion > snapshot: no props 1`] = `
8
8
  >
9
9
  <h6
10
10
  aria-expanded="false"
11
- class="ucl-uikit-heading ucl-uikit-accordion__heading css-db8j7j"
11
+ class="ucl-uikit-heading ucl-uikit-accordion__heading css-spdtpe"
12
12
  data-testid="ucl-uikit-accordion__heading"
13
13
  role="button"
14
14
  tabindex="0"
@@ -44,7 +44,7 @@ exports[`Accordion > snapshot: testId prop 1`] = `
44
44
  >
45
45
  <h6
46
46
  aria-expanded="false"
47
- class="ucl-uikit-heading ucl-uikit-accordion__heading css-db8j7j"
47
+ class="ucl-uikit-heading ucl-uikit-accordion__heading css-spdtpe"
48
48
  data-testid="ucl-uikit-accordion__heading"
49
49
  role="button"
50
50
  tabindex="0"
@@ -43,7 +43,7 @@ exports[`Alert > snapshot: type=error 1`] = `
43
43
  </span>
44
44
  </h3>
45
45
  <p
46
- class="ucl-uikit-paragrah ucl-uikit-alert__message css-1dosm7d"
46
+ class="ucl-uikit-paragraph ucl-uikit-alert__message css-1dosm7d"
47
47
  data-testid="ucl-uikit-alert__message"
48
48
  >
49
49
  The operation failed.
@@ -84,7 +84,7 @@ exports[`Alert > snapshot: type=info, no title 1`] = `
84
84
  </svg>
85
85
  <div>
86
86
  <p
87
- class="ucl-uikit-paragrah ucl-uikit-alert__message css-1dosm7d"
87
+ class="ucl-uikit-paragraph ucl-uikit-alert__message css-1dosm7d"
88
88
  data-testid="ucl-uikit-alert__message"
89
89
  >
90
90
  This is an informational alert.
@@ -134,7 +134,7 @@ exports[`Alert > snapshot: type=success 1`] = `
134
134
  </span>
135
135
  </h3>
136
136
  <p
137
- class="ucl-uikit-paragrah ucl-uikit-alert__message css-1dosm7d"
137
+ class="ucl-uikit-paragraph ucl-uikit-alert__message css-1dosm7d"
138
138
  data-testid="ucl-uikit-alert__message"
139
139
  >
140
140
  Your operation completed successfully.
@@ -181,7 +181,7 @@ exports[`Alert > snapshot: type=warning 1`] = `
181
181
  </span>
182
182
  </h3>
183
183
  <p
184
- class="ucl-uikit-paragrah ucl-uikit-alert__message css-1dosm7d"
184
+ class="ucl-uikit-paragraph ucl-uikit-alert__message css-1dosm7d"
185
185
  data-testid="ucl-uikit-alert__message"
186
186
  >
187
187
  This operation may have unintended consequences.
@@ -60,6 +60,9 @@ const Avatar = forwardRef<Ref, AvatarProps>(
60
60
  console.error('Avatar image failed to load', event);
61
61
  setImageError(true);
62
62
  };
63
+ const { smMedium, mdMedium, lgMedium } = theme.typography.body;
64
+ const initialsTypography =
65
+ size <= 32 ? smMedium : size <= 48 ? mdMedium : lgMedium;
63
66
 
64
67
  const baseStyle = css`
65
68
  display: flex;
@@ -74,8 +77,11 @@ const Avatar = forwardRef<Ref, AvatarProps>(
74
77
  height: ${size}px;
75
78
  color: ${theme.colour.text.brandPrimary};
76
79
  background-color: ${theme.colour.fill.brandSubtle};
77
- font-family: ${theme.font.family.primary};
80
+ font-family: ${initialsTypography.fontFamily};
81
+ font-feature-settings: ${initialsTypography.fontSettings};
78
82
  font-size: ${fontSize}px;
83
+ font-weight: ${initialsTypography.fontWeight};
84
+ line-height: ${initialsTypography.lineHeight}%;
79
85
  cursor: pointer;
80
86
  `;
81
87
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`Avatar > Snapshot: Default 1`] = `
4
4
  <button
5
- class="ucl-uikit-avatar css-8z8m41"
5
+ class="ucl-uikit-avatar css-16zcktc"
6
6
  data-testid="ucl-uikit-avatar"
7
7
  >
8
8
  <svg
@@ -31,7 +31,7 @@ exports[`Avatar > Snapshot: Default 1`] = `
31
31
 
32
32
  exports[`Avatar > Snapshot: Default with disabled prop 1`] = `
33
33
  <button
34
- class="ucl-uikit-avatar css-ucbqvu"
34
+ class="ucl-uikit-avatar css-evms17"
35
35
  data-testid="ucl-uikit-avatar"
36
36
  disabled=""
37
37
  >
@@ -61,7 +61,7 @@ exports[`Avatar > Snapshot: Default with disabled prop 1`] = `
61
61
 
62
62
  exports[`Avatar > Snapshot: icon variant with disabled prop 1`] = `
63
63
  <button
64
- class="ucl-uikit-avatar css-ucbqvu"
64
+ class="ucl-uikit-avatar css-evms17"
65
65
  data-testid="ucl-uikit-avatar"
66
66
  disabled=""
67
67
  >
@@ -91,7 +91,7 @@ exports[`Avatar > Snapshot: icon variant with disabled prop 1`] = `
91
91
 
92
92
  exports[`Avatar > Snapshot: icon variant with no props 1`] = `
93
93
  <button
94
- class="ucl-uikit-avatar css-8z8m41"
94
+ class="ucl-uikit-avatar css-16zcktc"
95
95
  data-testid="ucl-uikit-avatar"
96
96
  >
97
97
  <svg
@@ -120,7 +120,7 @@ exports[`Avatar > Snapshot: icon variant with no props 1`] = `
120
120
 
121
121
  exports[`Avatar > Snapshot: image variant with imageUrl and name props 1`] = `
122
122
  <button
123
- class="ucl-uikit-avatar css-8z8m41"
123
+ class="ucl-uikit-avatar css-16zcktc"
124
124
  data-testid="ucl-uikit-avatar"
125
125
  >
126
126
  <img
@@ -134,7 +134,7 @@ exports[`Avatar > Snapshot: image variant with imageUrl and name props 1`] = `
134
134
 
135
135
  exports[`Avatar > Snapshot: image variant with imageUrl prop only 1`] = `
136
136
  <button
137
- class="ucl-uikit-avatar css-8z8m41"
137
+ class="ucl-uikit-avatar css-16zcktc"
138
138
  data-testid="ucl-uikit-avatar"
139
139
  >
140
140
  <img
@@ -148,7 +148,7 @@ exports[`Avatar > Snapshot: image variant with imageUrl prop only 1`] = `
148
148
 
149
149
  exports[`Avatar > Snapshot: image variant with imageUrl, name and disabled props 1`] = `
150
150
  <button
151
- class="ucl-uikit-avatar css-ucbqvu"
151
+ class="ucl-uikit-avatar css-evms17"
152
152
  data-testid="ucl-uikit-avatar"
153
153
  disabled=""
154
154
  >
@@ -163,7 +163,7 @@ exports[`Avatar > Snapshot: image variant with imageUrl, name and disabled props
163
163
 
164
164
  exports[`Avatar > Snapshot: image variant with name prop only 1`] = `
165
165
  <button
166
- class="ucl-uikit-avatar css-8z8m41"
166
+ class="ucl-uikit-avatar css-16zcktc"
167
167
  data-testid="ucl-uikit-avatar"
168
168
  >
169
169
  <span
@@ -176,7 +176,7 @@ exports[`Avatar > Snapshot: image variant with name prop only 1`] = `
176
176
 
177
177
  exports[`Avatar > Snapshot: image variant with no props 1`] = `
178
178
  <button
179
- class="ucl-uikit-avatar css-8z8m41"
179
+ class="ucl-uikit-avatar css-16zcktc"
180
180
  data-testid="ucl-uikit-avatar"
181
181
  >
182
182
  <svg
@@ -205,7 +205,7 @@ exports[`Avatar > Snapshot: image variant with no props 1`] = `
205
205
 
206
206
  exports[`Avatar > Snapshot: initials variant with name prop 1`] = `
207
207
  <button
208
- class="ucl-uikit-avatar css-8z8m41"
208
+ class="ucl-uikit-avatar css-16zcktc"
209
209
  data-testid="ucl-uikit-avatar"
210
210
  >
211
211
  <span
@@ -218,7 +218,7 @@ exports[`Avatar > Snapshot: initials variant with name prop 1`] = `
218
218
 
219
219
  exports[`Avatar > Snapshot: initials variant with name prop and disabled prop 1`] = `
220
220
  <button
221
- class="ucl-uikit-avatar css-ucbqvu"
221
+ class="ucl-uikit-avatar css-evms17"
222
222
  data-testid="ucl-uikit-avatar"
223
223
  disabled=""
224
224
  >
@@ -232,7 +232,7 @@ exports[`Avatar > Snapshot: initials variant with name prop and disabled prop 1`
232
232
 
233
233
  exports[`Avatar > Snapshot: initials variant with no props 1`] = `
234
234
  <button
235
- class="ucl-uikit-avatar css-8z8m41"
235
+ class="ucl-uikit-avatar css-16zcktc"
236
236
  data-testid="ucl-uikit-avatar"
237
237
  >
238
238
  <svg
@@ -2,6 +2,7 @@ import { css, cx } from '@emotion/css';
2
2
  import { useTheme } from '../../theme';
3
3
 
4
4
  import { Icon } from '../';
5
+ import Text from '../Text';
5
6
  import type { SpecificIconProps } from '../Icon/Icon';
6
7
  import type { ThemeType } from '../../theme';
7
8
 
@@ -127,8 +128,7 @@ const Badge = ({
127
128
  }: BadgeProps) => {
128
129
  const [theme] = useTheme();
129
130
 
130
- const badgeTypography =
131
- size === 'large' ? theme.typography.body.sm : theme.typography.body.xs;
131
+ const textLevel = size === 'large' ? 'sm' : 'xs';
132
132
 
133
133
  const iconSize = size === 'large' ? 16 : 14;
134
134
 
@@ -148,12 +148,6 @@ const Badge = ({
148
148
  background-color: ${backgroundColor};
149
149
  border: ${border ?? 'none'};
150
150
 
151
- font-family: ${badgeTypography.fontFamily};
152
- font-feature-settings: ${badgeTypography.fontSettings};
153
- font-size: ${badgeTypography.fontSize}px;
154
- font-weight: ${badgeTypography.fontWeight};
155
- line-height: ${badgeTypography.lineHeight}%;
156
-
157
151
  border-radius: 100px;
158
152
  white-space: nowrap;
159
153
  gap: 4px;
@@ -193,8 +187,9 @@ const Badge = ({
193
187
  const VariantIcon = VARIANT_ICON_MAP[variant];
194
188
 
195
189
  return (
196
- <span
197
- data-testid={testId}
190
+ <Text
191
+ level={textLevel}
192
+ testId={testId}
198
193
  className={style}
199
194
  {...props}
200
195
  >
@@ -212,7 +207,7 @@ const Badge = ({
212
207
  />
213
208
  )}
214
209
  {children}
215
- </span>
210
+ </Text>
216
211
  );
217
212
  };
218
213
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`Badge > snapshot: default 1`] = `
4
4
  <span
5
- class="ucl-uikit-badge css-b76pju"
5
+ class="ucl-uikit-text ucl-uikit-badge css-1qd9y8u"
6
6
  data-testid="ucl-uikit-badge"
7
7
  >
8
8
  Default
@@ -11,7 +11,7 @@ exports[`Badge > snapshot: default 1`] = `
11
11
 
12
12
  exports[`Badge > snapshot: size=large 1`] = `
13
13
  <span
14
- class="ucl-uikit-badge css-6n39yj"
14
+ class="ucl-uikit-text ucl-uikit-badge css-1j13tem"
15
15
  data-testid="ucl-uikit-badge"
16
16
  >
17
17
  Large
@@ -20,7 +20,7 @@ exports[`Badge > snapshot: size=large 1`] = `
20
20
 
21
21
  exports[`Badge > snapshot: statusIndicator 1`] = `
22
22
  <span
23
- class="ucl-uikit-badge css-b76pju"
23
+ class="ucl-uikit-text ucl-uikit-badge css-1qd9y8u"
24
24
  data-testid="ucl-uikit-badge"
25
25
  >
26
26
  <span
@@ -33,7 +33,7 @@ exports[`Badge > snapshot: statusIndicator 1`] = `
33
33
 
34
34
  exports[`Badge > snapshot: variant=critical with icon 1`] = `
35
35
  <span
36
- class="ucl-uikit-badge css-1oxz1ke"
36
+ class="ucl-uikit-text ucl-uikit-badge css-rkw7bu"
37
37
  data-testid="ucl-uikit-badge"
38
38
  >
39
39
  <svg
@@ -66,7 +66,7 @@ exports[`Badge > snapshot: variant=critical with icon 1`] = `
66
66
 
67
67
  exports[`Badge > snapshot: variant=disabled 1`] = `
68
68
  <span
69
- class="ucl-uikit-badge css-psg0dk"
69
+ class="ucl-uikit-text ucl-uikit-badge css-a4ty56"
70
70
  data-testid="ucl-uikit-badge"
71
71
  >
72
72
  Disabled
@@ -75,7 +75,7 @@ exports[`Badge > snapshot: variant=disabled 1`] = `
75
75
 
76
76
  exports[`Badge > snapshot: variant=info with icon 1`] = `
77
77
  <span
78
- class="ucl-uikit-badge css-37ncyr"
78
+ class="ucl-uikit-text ucl-uikit-badge css-9ddki6"
79
79
  data-testid="ucl-uikit-badge"
80
80
  >
81
81
  <svg
@@ -108,7 +108,7 @@ exports[`Badge > snapshot: variant=info with icon 1`] = `
108
108
 
109
109
  exports[`Badge > snapshot: variant=info-subtle 1`] = `
110
110
  <span
111
- class="ucl-uikit-badge css-1x6sfca"
111
+ class="ucl-uikit-text ucl-uikit-badge css-1mmhjpi"
112
112
  data-testid="ucl-uikit-badge"
113
113
  >
114
114
  Info subtle
@@ -117,7 +117,7 @@ exports[`Badge > snapshot: variant=info-subtle 1`] = `
117
117
 
118
118
  exports[`Badge > snapshot: variant=success with icon 1`] = `
119
119
  <span
120
- class="ucl-uikit-badge css-16a4ap6"
120
+ class="ucl-uikit-text ucl-uikit-badge css-1k9d7cn"
121
121
  data-testid="ucl-uikit-badge"
122
122
  >
123
123
  <svg
@@ -148,7 +148,7 @@ exports[`Badge > snapshot: variant=success with icon 1`] = `
148
148
 
149
149
  exports[`Badge > snapshot: variant=warning with icon 1`] = `
150
150
  <span
151
- class="ucl-uikit-badge css-1o21lbi"
151
+ class="ucl-uikit-text ucl-uikit-badge css-1vsenfu"
152
152
  data-testid="ucl-uikit-badge"
153
153
  >
154
154
  <svg
@@ -1,20 +1,39 @@
1
- import React, { HTMLAttributes } from 'react';
1
+ import React, { HTMLAttributes, NamedExoticComponent, memo } from 'react';
2
2
  import { css, cx } from '@emotion/css';
3
- import { Icon } from '../';
3
+ import { themes, useTheme } from '../../theme';
4
+ import Icon from '../Icon';
5
+ import BreadcrumbsNew, {
6
+ BaseBreadcrumbsItemProps,
7
+ BreadcrumbsCurrentProps,
8
+ BreadcrumbsLinkProps,
9
+ BreadcrumbsProps as BreadcrumbsNewProps,
10
+ BreadcrumbsSize,
11
+ } from '../BreadcrumbsNew';
4
12
  import Breadcrumb from './Breadcrumb';
13
+ import { BreadcrumbProps } from './Breadcrumb';
5
14
 
6
15
  const NAME = 'ucl-uikit-breadcrumbs';
7
16
 
8
- export interface BreadcrumbsProps extends HTMLAttributes<HTMLElement> {
17
+ export interface LegacyBreadcrumbsProps extends HTMLAttributes<HTMLElement> {
9
18
  testId?: string;
10
19
  }
11
20
 
12
- const Breadcrumbs = ({
21
+ export type BreadcrumbsProps = Omit<BreadcrumbsNewProps, 'children'> &
22
+ LegacyBreadcrumbsProps;
23
+
24
+ export type {
25
+ BaseBreadcrumbsItemProps,
26
+ BreadcrumbsCurrentProps,
27
+ BreadcrumbsLinkProps,
28
+ BreadcrumbsSize,
29
+ };
30
+
31
+ const LegacyBreadcrumbsRoot = ({
13
32
  testId = NAME,
14
33
  className,
15
34
  children,
16
35
  ...props
17
- }: BreadcrumbsProps) => {
36
+ }: LegacyBreadcrumbsProps) => {
18
37
  const separatorStyle = css`
19
38
  display: inline-flex;
20
39
  align-items: center;
@@ -55,6 +74,146 @@ const Breadcrumbs = ({
55
74
  );
56
75
  };
57
76
 
58
- Breadcrumbs.Breadcrumb = Breadcrumb;
77
+ export interface LegacyBreadcrumbsComponent extends NamedExoticComponent<LegacyBreadcrumbsProps> {
78
+ Breadcrumb: typeof Breadcrumb;
79
+ }
80
+
81
+ export const LegacyBreadcrumbs = Object.assign(memo(LegacyBreadcrumbsRoot), {
82
+ Breadcrumb,
83
+ }) as LegacyBreadcrumbsComponent;
84
+
85
+ const Breadcrumbs = ({
86
+ size,
87
+ testId = NAME,
88
+ className,
89
+ children,
90
+ ...props
91
+ }: BreadcrumbsProps) => {
92
+ const [theme] = useTheme();
93
+
94
+ if (theme === themes.default) {
95
+ return (
96
+ <LegacyBreadcrumbs
97
+ testId={testId}
98
+ className={className}
99
+ {...props}
100
+ >
101
+ {children}
102
+ </LegacyBreadcrumbs>
103
+ );
104
+ }
105
+
106
+ return (
107
+ <BreadcrumbsNew
108
+ size={size}
109
+ testId={testId}
110
+ className={className}
111
+ {...props}
112
+ >
113
+ {children}
114
+ </BreadcrumbsNew>
115
+ );
116
+ };
117
+
118
+ type BreadcrumbBridgeProps = BreadcrumbProps & {
119
+ separator?: boolean;
120
+ back?: boolean;
121
+ size?: BreadcrumbsSize;
122
+ };
123
+
124
+ const BreadcrumbBridge = ({
125
+ uri,
126
+ isActive,
127
+ component,
128
+ separator,
129
+ back,
130
+ size,
131
+ testId,
132
+ className,
133
+ children,
134
+ ...props
135
+ }: BreadcrumbBridgeProps) => {
136
+ const [theme] = useTheme();
137
+
138
+ if (theme === themes.default) {
139
+ return (
140
+ <Breadcrumb
141
+ uri={uri}
142
+ isActive={isActive}
143
+ component={component}
144
+ testId={testId}
145
+ className={className}
146
+ {...props}
147
+ >
148
+ {children}
149
+ </Breadcrumb>
150
+ );
151
+ }
152
+
153
+ const activeBreadcrumb =
154
+ isActive ??
155
+ (typeof window !== 'undefined' && window.location.pathname === uri);
156
+
157
+ if (activeBreadcrumb) {
158
+ return (
159
+ <BreadcrumbsNew.Current
160
+ separator={separator}
161
+ size={size}
162
+ testId={testId}
163
+ className={className}
164
+ {...props}
165
+ >
166
+ {children}
167
+ </BreadcrumbsNew.Current>
168
+ );
169
+ }
170
+
171
+ if (component) {
172
+ return (
173
+ <BreadcrumbsNew.Link
174
+ separator={separator}
175
+ back={back}
176
+ size={size}
177
+ testId={testId}
178
+ className={className}
179
+ component={component}
180
+ to={uri}
181
+ {...props}
182
+ >
183
+ {children}
184
+ </BreadcrumbsNew.Link>
185
+ );
186
+ }
187
+
188
+ return (
189
+ <BreadcrumbsNew.Link
190
+ separator={separator}
191
+ back={back}
192
+ size={size}
193
+ testId={testId}
194
+ className={className}
195
+ href={uri}
196
+ {...props}
197
+ >
198
+ {children}
199
+ </BreadcrumbsNew.Link>
200
+ );
201
+ };
202
+
203
+ export interface BreadcrumbsComponent extends NamedExoticComponent<BreadcrumbsProps> {
204
+ Breadcrumb: typeof BreadcrumbBridge;
205
+ BaseItem: typeof BreadcrumbsNew.BaseItem;
206
+ Link: typeof BreadcrumbsNew.Link;
207
+ Current: typeof BreadcrumbsNew.Current;
208
+ }
209
+
210
+ const MemoBreadcrumbs = memo(Breadcrumbs);
211
+
212
+ const BreadcrumbsWithSubComponents = Object.assign(MemoBreadcrumbs, {
213
+ Breadcrumb: BreadcrumbBridge,
214
+ BaseItem: BreadcrumbsNew.BaseItem,
215
+ Link: BreadcrumbsNew.Link,
216
+ Current: BreadcrumbsNew.Current,
217
+ }) as BreadcrumbsComponent;
59
218
 
60
- export default Breadcrumbs;
219
+ export default BreadcrumbsWithSubComponents;
@@ -1,2 +1,5 @@
1
1
  export { default } from './Breadcrumbs';
2
+ export { LegacyBreadcrumbs } from './Breadcrumbs';
2
3
  export type { BreadcrumbsProps } from './Breadcrumbs';
4
+ /** @deprecated Use BreadcrumbsProps instead. LegacyBreadcrumbsProps only supports the default theme. */
5
+ export type { LegacyBreadcrumbsProps } from './Breadcrumbs';
@@ -127,6 +127,12 @@ const Button = <C extends ElementType = 'button'>({
127
127
 
128
128
  const resolvedVariant = normalizeVariantProp(variant, destructive);
129
129
  const resolvedSize = normalizeSizeprop(size);
130
+ const buttonTypography = {
131
+ xsmall: theme.typography.body.smMedium,
132
+ small: theme.typography.body.mdMedium,
133
+ medium: theme.typography.body.mdMedium,
134
+ large: theme.typography.body.lgMedium,
135
+ }[resolvedSize];
130
136
 
131
137
  const baseStyle = css`
132
138
  all: unset;
@@ -138,9 +144,11 @@ const Button = <C extends ElementType = 'button'>({
138
144
  position: relative;
139
145
  box-sizing: border-box;
140
146
  border-radius: ${theme.radius.r4};
141
- font-family: ${theme.typography.body.md.fontFamily};
142
- font-feature-settings: ${theme.typography.body.md.fontSettings};
143
- font-weight: 500;
147
+ font-family: ${buttonTypography.fontFamily};
148
+ font-feature-settings: ${buttonTypography.fontSettings};
149
+ font-size: ${buttonTypography.fontSize}px;
150
+ font-weight: ${buttonTypography.fontWeight};
151
+ line-height: ${buttonTypography.lineHeight}%;
144
152
  -webkit-font-smoothing: antialiased;
145
153
  -moz-osx-font-smoothing: grayscale;
146
154
  outline: none;
@@ -164,25 +172,21 @@ const Button = <C extends ElementType = 'button'>({
164
172
  const sizeExtraSmallStyle = css`
165
173
  height: 32px;
166
174
  padding: 0 ${paddingPx}px;
167
- font-size: 14px;
168
175
  `;
169
176
 
170
177
  const sizeSmallStyle = css`
171
178
  height: 40px;
172
179
  padding: 0 ${paddingPx}px;
173
- font-size: 16px;
174
180
  `;
175
181
 
176
182
  const sizeMediumStyle = css`
177
183
  height: 48px;
178
184
  padding: 0 ${paddingPx}px;
179
- font-size: 16px;
180
185
  `;
181
186
 
182
187
  const sizeLargeStyle = css`
183
188
  height: 56px;
184
189
  padding: 0 ${paddingPx}px;
185
- font-size: 18px;
186
190
  `;
187
191
 
188
192
  const fullWidthStyle = css`
@@ -3,7 +3,7 @@
3
3
  exports[`Button > maps legacy destructive prop to destructive variants 1`] = `
4
4
  <button
5
5
  aria-disabled="false"
6
- class="ucl-uikit-button css-rl1hmu"
6
+ class="ucl-uikit-button css-thupyi"
7
7
  data-testid="ucl-uikit-button"
8
8
  >
9
9
  Delete
@@ -13,7 +13,7 @@ exports[`Button > maps legacy destructive prop to destructive variants 1`] = `
13
13
  exports[`Button > maps legacy size default to medium 1`] = `
14
14
  <button
15
15
  aria-disabled="false"
16
- class="ucl-uikit-button css-19pu3x7"
16
+ class="ucl-uikit-button css-5txlzw"
17
17
  data-testid="ucl-uikit-button"
18
18
  >
19
19
  Legacy default size
@@ -23,7 +23,7 @@ exports[`Button > maps legacy size default to medium 1`] = `
23
23
  exports[`Button > snapshot: 'as' prop with 'a' 1`] = `
24
24
  <a
25
25
  aria-disabled="false"
26
- class="ucl-uikit-button css-19pu3x7"
26
+ class="ucl-uikit-button css-5txlzw"
27
27
  data-testid="ucl-uikit-button"
28
28
  href="https://ucl.ac.uk"
29
29
  >
@@ -34,7 +34,7 @@ exports[`Button > snapshot: 'as' prop with 'a' 1`] = `
34
34
  exports[`Button > snapshot: loading 1`] = `
35
35
  <button
36
36
  aria-disabled="false"
37
- class="ucl-uikit-button css-16925p4"
37
+ class="ucl-uikit-button css-736ss2"
38
38
  data-testid="ucl-uikit-button"
39
39
  disabled=""
40
40
  >
@@ -67,7 +67,7 @@ exports[`Button > snapshot: loading 1`] = `
67
67
  exports[`Button > snapshot: no props 1`] = `
68
68
  <button
69
69
  aria-disabled="false"
70
- class="ucl-uikit-button css-12mlzyd"
70
+ class="ucl-uikit-button css-5vh71f"
71
71
  data-testid="ucl-uikit-button"
72
72
  />
73
73
  `;
@@ -75,7 +75,7 @@ exports[`Button > snapshot: no props 1`] = `
75
75
  exports[`Button > snapshot: testId prop 1`] = `
76
76
  <button
77
77
  aria-disabled="false"
78
- class="ucl-uikit-button css-12mlzyd"
78
+ class="ucl-uikit-button css-5vh71f"
79
79
  data-testid="test123"
80
80
  />
81
81
  `;
@@ -83,7 +83,7 @@ exports[`Button > snapshot: testId prop 1`] = `
83
83
  exports[`Button > snapshot: variant prop 1`] = `
84
84
  <button
85
85
  aria-disabled="false"
86
- class="ucl-uikit-button css-ub9awk"
86
+ class="ucl-uikit-button css-25bhrl"
87
87
  data-testid="ucl-uikit-button"
88
88
  />
89
89
  `;
@@ -91,7 +91,7 @@ exports[`Button > snapshot: variant prop 1`] = `
91
91
  exports[`Button > snapshot: with icon 1`] = `
92
92
  <button
93
93
  aria-disabled="false"
94
- class="ucl-uikit-button css-19pu3x7"
94
+ class="ucl-uikit-button css-5txlzw"
95
95
  data-testid="ucl-uikit-button"
96
96
  >
97
97
  <svg
@@ -119,7 +119,7 @@ exports[`Button > snapshot: with icon 1`] = `
119
119
  exports[`Button > snapshot: with icon and iconPosition right 1`] = `
120
120
  <button
121
121
  aria-disabled="false"
122
- class="ucl-uikit-button css-19pu3x7"
122
+ class="ucl-uikit-button css-5txlzw"
123
123
  data-testid="ucl-uikit-button"
124
124
  >
125
125
  Download