uikit-react-public 0.37.2 → 0.38.1
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/dist/components/Alert/Alert.d.ts +1 -1
- package/dist/components/Alert/Alert.stories.d.ts +1 -1
- package/dist/components/Alert/AlertTitle.d.ts +1 -1
- package/dist/components/Datepicker/subcomponents/Panel.d.ts +1 -2
- package/dist/components/Overlay/Overlay.d.ts +2 -1
- package/dist/components/Overlay/Overlay.stories.d.ts +1 -0
- package/dist/components/Toggle/ToggleHandle.d.ts +1 -1
- package/dist/components/UclLogoNew/UclLogo.d.ts +2 -1
- package/dist/components/UclLogoNew/__tests__/UclLogo.test.d.ts +1 -0
- package/dist/components/WeekPicker/__tests__/WeekPicker.test.d.ts +1 -0
- package/dist/index.js +3479 -3396
- package/dist/theme/dark/darkColour.d.ts +1 -0
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/light/lightColour.d.ts +1 -0
- package/dist/theme/original/defaultTheme.d.ts +7 -0
- package/dist/theme/original/originalColourNewStructure.d.ts +1 -0
- package/dist/theme/useTheme.d.ts +12 -0
- package/lib/components/Alert/AlertMessage.tsx +5 -4
- package/lib/components/Alert/AlertTitle.tsx +6 -8
- package/lib/components/AppHeader/AppHeader.stories.tsx +3 -3
- package/lib/components/AppHeader/AppHeader.tsx +2 -2
- package/lib/components/AppHeader/AppHeaderBottom.tsx +2 -3
- package/lib/components/AppHeader/AppHeaderTop.tsx +1 -1
- package/lib/components/AppHeader/__tests__/__snapshots__/AppHeader.test.tsx.snap +1 -1
- package/lib/components/AppMenu/AppMenuContent.tsx +4 -5
- package/lib/components/AppMenu/AppMenuDivider.tsx +5 -6
- package/lib/components/AppMenu/AppMenuItem.tsx +6 -6
- package/lib/components/AppMenu/__tests__/__snapshots__/AppMenu.test.tsx.snap +1 -1
- package/lib/components/Avatar/Avatar.tsx +7 -5
- package/lib/components/Avatar/__tests__/__snapshots__/Avatar.test.tsx.snap +18 -18
- package/lib/components/Badge/Badge.tsx +12 -12
- package/lib/components/Badge/__tests__/Badge.test.tsx +84 -1
- package/lib/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap +2 -2
- package/lib/components/Blanket/Blanket.tsx +1 -1
- package/lib/components/Blanket/__tests__/__snapshots__/Blanket.test.tsx.snap +1 -1
- package/lib/components/Button/__tests__/Button.test.tsx +46 -1
- package/lib/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +2 -2
- package/lib/components/Button/style/buttonAccentStyle.ts +1 -1
- package/lib/components/Button/style/buttonPrimaryDestructiveStyle.ts +1 -1
- package/lib/components/Button/style/buttonPrimaryWarningStyle.ts +1 -1
- package/lib/components/Button/style/buttonSecondarySubtleStyle.ts +1 -1
- package/lib/components/Calendar/Calendar.tsx +1 -0
- package/lib/components/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +17 -17
- package/lib/components/Calendar/subcomponents/AcademicWeek.tsx +0 -1
- package/lib/components/Calendar/subcomponents/Day.tsx +2 -2
- package/lib/components/Chip/Chip.tsx +7 -8
- package/lib/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap +5 -5
- package/lib/components/CookieNotice/CookieNotice.tsx +3 -3
- package/lib/components/Datepicker/__tests__/Datepicker.test.tsx +58 -1
- package/lib/components/Datepicker/__tests__/__snapshots__/Datepicker.test.tsx.snap +6 -6
- package/lib/components/Datepicker/subcomponents/CustomDatepicker.tsx +32 -11
- package/lib/components/Datepicker/subcomponents/DatepickerInput.tsx +7 -6
- package/lib/components/Datepicker/subcomponents/Panel.tsx +3 -21
- package/lib/components/Datepicker/subcomponents/VisibleField.tsx +6 -8
- package/lib/components/Dialog/BaseDialog.tsx +3 -3
- package/lib/components/Divider/Divider.tsx +5 -3
- package/lib/components/FileInput/FileInput.tsx +1 -1
- package/lib/components/FileInput/__tests__/__snapshots__/FileInput.test.tsx.snap +2 -2
- package/lib/components/Footer/Footer.tsx +17 -17
- package/lib/components/Footer/FooterNavLink.tsx +3 -3
- package/lib/components/Footer/SocialLink.tsx +3 -3
- package/lib/components/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +55 -55
- package/lib/components/FooterNew/BackToTop.tsx +1 -1
- package/lib/components/FooterNew/FooterColumn.tsx +1 -2
- package/lib/components/FooterNew/FooterNavLink.tsx +6 -5
- package/lib/components/FooterNew/LegalAndCopyright.tsx +15 -15
- package/lib/components/FooterNew/LogoAddressAndSocial.tsx +8 -6
- package/lib/components/FooterNew/SocialLink.tsx +4 -4
- package/lib/components/FooterNew/__tests__/__snapshots__/Footer.test.tsx.snap +44 -44
- package/lib/components/Header/Header.tsx +3 -3
- package/lib/components/Header/__tests__/__snapshots__/Header.test.tsx.snap +2 -2
- package/lib/components/HeaderDraft/HeaderBottomBreadcrumbs.tsx +3 -4
- package/lib/components/HeaderDraft/HeaderBottomHeadingAndAvatar.tsx +7 -7
- package/lib/components/HeaderDraft/HeaderBreadcrumb.tsx +4 -4
- package/lib/components/HeaderDraft/HeaderDraft.tsx +7 -7
- package/lib/components/HeaderDraft/__tests__/__snapshots__/Header.test.tsx.snap +5 -5
- package/lib/components/HeaderNew/Header.tsx +2 -2
- package/lib/components/HeaderNew/__tests__/__snapshots__/Header.test.tsx.snap +2 -2
- package/lib/components/Input/Input.tsx +6 -6
- package/lib/components/Input/__tests__/__snapshots__/Input.test.tsx.snap +4 -4
- package/lib/components/Label/Label.tsx +2 -2
- package/lib/components/Label/__tests__/__snapshots__/Label.test.tsx.snap +1 -1
- package/lib/components/Layout/Layout.stories.tsx +12 -12
- package/lib/components/Link/Link.tsx +4 -4
- package/lib/components/Menu/MenuContent.tsx +3 -3
- package/lib/components/Menu/MenuItem.tsx +10 -8
- package/lib/components/Menu/MenuSection.tsx +1 -1
- package/lib/components/Modal/Modal.tsx +5 -15
- package/lib/components/Modal/__tests__/__snapshots__/Modal.test.tsx.snap +2 -2
- package/lib/components/NativeDatepicker/NativeDatepicker.tsx +9 -7
- package/lib/components/Overlay/Overlay.tsx +17 -5
- package/lib/components/Radio/Radio.tsx +13 -4
- package/lib/components/Radio/__tests__/__snapshots__/Radio.test.tsx.snap +3 -3
- package/lib/components/Search/Search.tsx +2 -2
- package/lib/components/Search/__tests__/__snapshots__/Search.test.tsx.snap +2 -2
- package/lib/components/Select/subcomponents/CustomSelect.tsx +4 -4
- package/lib/components/Spinner/Spinner.stories.tsx +3 -3
- package/lib/components/Spinner/Spinner.tsx +1 -1
- package/lib/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +3 -3
- package/lib/components/Table/subcomponents/Head.tsx +2 -2
- package/lib/components/Table/subcomponents/Row.tsx +1 -1
- package/lib/components/Textarea/Textarea.tsx +7 -8
- package/lib/components/Textarea/__tests__/__snapshots__/Textarea.test.tsx.snap +4 -4
- package/lib/components/Timepicker/Timepicker.tsx +6 -4
- package/lib/components/Toggle/Toggle.tsx +4 -2
- package/lib/components/Toggle/ToggleHandle.tsx +4 -2
- package/lib/components/Tooltip/Tooltip.tsx +8 -5
- package/lib/components/Tooltip/__tests__/__snapshots__/tooltip.test.tsx.snap +2 -2
- package/lib/components/UclLogo/UclLogoNegativeSpace.tsx +7 -3
- package/lib/components/UclLogoNew/UclLogo.tsx +8 -9
- package/lib/components/UclLogoNew/__tests__/UclLogo.test.tsx +41 -0
- package/lib/components/WeekPicker/__tests__/WeekPicker.test.tsx +36 -0
- package/lib/components/WeekPicker/subcomponents/CustomDatepicker.tsx +27 -11
- package/lib/components/WeekPicker/subcomponents/DatepickerInput.tsx +6 -6
- package/lib/components/WeekPicker/subcomponents/VisibleField.tsx +9 -9
- package/lib/theme/dark/darkColour.ts +2 -1
- package/lib/theme/dark/darkTheme.ts +8 -1
- package/lib/theme/index.ts +1 -0
- package/lib/theme/light/lightColour.ts +2 -1
- package/lib/theme/light/lightTheme.ts +7 -0
- package/lib/theme/original/defaultTheme.ts +10 -0
- package/lib/theme/original/originalColourNewStructure.ts +2 -1
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ exports[`Input > snapshot: no props 1`] = `
|
|
|
5
5
|
class="ucl-uikit-input css-1bpb1dw"
|
|
6
6
|
>
|
|
7
7
|
<input
|
|
8
|
-
class="ucl-uikit-input__input css-
|
|
8
|
+
class="ucl-uikit-input__input css-1i2w3yn"
|
|
9
9
|
data-testid="ucl-uikit-input"
|
|
10
10
|
id=""
|
|
11
11
|
/>
|
|
@@ -17,7 +17,7 @@ exports[`Input > snapshot: placeholder prop 1`] = `
|
|
|
17
17
|
class="ucl-uikit-input css-1bpb1dw"
|
|
18
18
|
>
|
|
19
19
|
<input
|
|
20
|
-
class="ucl-uikit-input__input css-
|
|
20
|
+
class="ucl-uikit-input__input css-1i2w3yn"
|
|
21
21
|
data-testid="ucl-uikit-input"
|
|
22
22
|
id=""
|
|
23
23
|
placeholder="Type your value..."
|
|
@@ -30,7 +30,7 @@ exports[`Input > snapshot: testId prop 1`] = `
|
|
|
30
30
|
class="ucl-uikit-input css-1bpb1dw"
|
|
31
31
|
>
|
|
32
32
|
<input
|
|
33
|
-
class="ucl-uikit-input__input css-
|
|
33
|
+
class="ucl-uikit-input__input css-1i2w3yn"
|
|
34
34
|
data-testid="test123"
|
|
35
35
|
id=""
|
|
36
36
|
/>
|
|
@@ -42,7 +42,7 @@ exports[`Input > snapshot: value prop 1`] = `
|
|
|
42
42
|
class="ucl-uikit-input css-1bpb1dw"
|
|
43
43
|
>
|
|
44
44
|
<input
|
|
45
|
-
class="ucl-uikit-input__input css-
|
|
45
|
+
class="ucl-uikit-input__input css-1i2w3yn"
|
|
46
46
|
data-testid="ucl-uikit-input"
|
|
47
47
|
id=""
|
|
48
48
|
value="abc"
|
|
@@ -43,7 +43,7 @@ const Label = forwardRef<Ref, LabelProps>(
|
|
|
43
43
|
|
|
44
44
|
const baseStyle = css`
|
|
45
45
|
width: 100%;
|
|
46
|
-
color: ${theme.
|
|
46
|
+
color: ${theme.colour.text.default};
|
|
47
47
|
font-family: ${theme.font.family.primary};
|
|
48
48
|
font-size: ${theme.font.size.f16};
|
|
49
49
|
`;
|
|
@@ -61,7 +61,7 @@ const Label = forwardRef<Ref, LabelProps>(
|
|
|
61
61
|
`;
|
|
62
62
|
|
|
63
63
|
const disabledStyle = css`
|
|
64
|
-
color: ${theme.
|
|
64
|
+
color: ${theme.colour.text.disabled};
|
|
65
65
|
`;
|
|
66
66
|
|
|
67
67
|
const style = cx(
|
|
@@ -26,7 +26,7 @@ export const ThreeColumns: Story = {
|
|
|
26
26
|
const sectionStyle = css`
|
|
27
27
|
grid-column: span 4;
|
|
28
28
|
height: 100%;
|
|
29
|
-
background-color: ${theme.
|
|
29
|
+
background-color: ${theme.primitiveColour.blue['06'].$value.hex};
|
|
30
30
|
`;
|
|
31
31
|
|
|
32
32
|
const numberMarkerStyle = css`
|
|
@@ -36,7 +36,7 @@ export const ThreeColumns: Story = {
|
|
|
36
36
|
height: 8rem;
|
|
37
37
|
font-size: ${theme.font.size.f20};
|
|
38
38
|
font-weight: ${theme.font.weight.semiBold};
|
|
39
|
-
color: ${theme.
|
|
39
|
+
color: ${theme.colour.text.default};
|
|
40
40
|
font-family: ${theme.font.family.fixed};
|
|
41
41
|
font-size: ${theme.font.size.f20};
|
|
42
42
|
`;
|
|
@@ -65,7 +65,7 @@ export const FourColumns: Story = {
|
|
|
65
65
|
const sectionStyle = css`
|
|
66
66
|
grid-column: span 4;
|
|
67
67
|
height: 100%;
|
|
68
|
-
background-color: ${theme.
|
|
68
|
+
background-color: ${theme.primitiveColour.red['03'].$value.hex};
|
|
69
69
|
|
|
70
70
|
${theme.mq.mobile} {
|
|
71
71
|
grid-column: span 2;
|
|
@@ -83,7 +83,7 @@ export const FourColumns: Story = {
|
|
|
83
83
|
height: 8rem;
|
|
84
84
|
font-size: ${theme.font.size.f20};
|
|
85
85
|
font-weight: ${theme.font.weight.semiBold};
|
|
86
|
-
color: ${theme.
|
|
86
|
+
color: ${theme.colour.text.default};
|
|
87
87
|
font-family: ${theme.font.family.fixed};
|
|
88
88
|
font-size: ${theme.font.size.f20};
|
|
89
89
|
`;
|
|
@@ -155,7 +155,7 @@ export const GenericScreen: Story = {
|
|
|
155
155
|
`;
|
|
156
156
|
|
|
157
157
|
const colourBlockStyle = css`
|
|
158
|
-
background-color: ${theme.
|
|
158
|
+
background-color: ${theme.primitiveColour.yellow['08'].$value.hex};
|
|
159
159
|
height: 250px;
|
|
160
160
|
`;
|
|
161
161
|
|
|
@@ -236,7 +236,7 @@ export const CreativeGrid: Story = {
|
|
|
236
236
|
|
|
237
237
|
const block1Style = css`
|
|
238
238
|
${gridItemBaseStyle}
|
|
239
|
-
background-color: ${theme.
|
|
239
|
+
background-color: ${theme.primitiveColour.brandPurple['10'].$value.hex};
|
|
240
240
|
|
|
241
241
|
${theme.mq.mobile} {
|
|
242
242
|
grid-column: 1 / 8;
|
|
@@ -264,7 +264,7 @@ export const CreativeGrid: Story = {
|
|
|
264
264
|
|
|
265
265
|
const block2Style = css`
|
|
266
266
|
${gridItemBaseStyle}
|
|
267
|
-
background-color: ${theme.
|
|
267
|
+
background-color: ${theme.primitiveColour.blue['09'].$value.hex};
|
|
268
268
|
|
|
269
269
|
${theme.mq.mobile} {
|
|
270
270
|
grid-column: 8 / 13;
|
|
@@ -291,7 +291,7 @@ export const CreativeGrid: Story = {
|
|
|
291
291
|
|
|
292
292
|
const block3Style = css`
|
|
293
293
|
${gridItemBaseStyle}
|
|
294
|
-
background-color: ${theme.
|
|
294
|
+
background-color: ${theme.primitiveColour.green['07'].$value.hex};
|
|
295
295
|
|
|
296
296
|
${theme.mq.mobile} {
|
|
297
297
|
grid-column: 8 / 13;
|
|
@@ -319,7 +319,7 @@ export const CreativeGrid: Story = {
|
|
|
319
319
|
|
|
320
320
|
const block4Style = css`
|
|
321
321
|
${gridItemBaseStyle}
|
|
322
|
-
background-color: ${theme.
|
|
322
|
+
background-color: ${theme.primitiveColour.blue['06'].$value.hex};
|
|
323
323
|
|
|
324
324
|
${theme.mq.mobile} {
|
|
325
325
|
grid-column: 1 / 8;
|
|
@@ -346,7 +346,7 @@ export const CreativeGrid: Story = {
|
|
|
346
346
|
|
|
347
347
|
const block5Style = css`
|
|
348
348
|
${gridItemBaseStyle}
|
|
349
|
-
background-color: ${theme.
|
|
349
|
+
background-color: ${theme.primitiveColour.yellow['08'].$value.hex};
|
|
350
350
|
|
|
351
351
|
${theme.mq.mobile} {
|
|
352
352
|
grid-column: 1 / 8;
|
|
@@ -373,7 +373,7 @@ export const CreativeGrid: Story = {
|
|
|
373
373
|
|
|
374
374
|
const block6Style = css`
|
|
375
375
|
${gridItemBaseStyle}
|
|
376
|
-
background-color: ${theme.
|
|
376
|
+
background-color: ${theme.primitiveColour.red['11'].$value.hex};
|
|
377
377
|
|
|
378
378
|
${theme.mq.mobile} {
|
|
379
379
|
grid-column: 8 / 13;
|
|
@@ -400,7 +400,7 @@ export const CreativeGrid: Story = {
|
|
|
400
400
|
|
|
401
401
|
const block7Style = css`
|
|
402
402
|
${gridItemBaseStyle}
|
|
403
|
-
background-color: ${theme.
|
|
403
|
+
background-color: ${theme.primitiveColour.blue['09'].$value.hex};
|
|
404
404
|
|
|
405
405
|
${theme.mq.mobile} {
|
|
406
406
|
grid-column: 1 / 13;
|
|
@@ -51,10 +51,10 @@ const Link = forwardRef(function LinkInner(
|
|
|
51
51
|
|
|
52
52
|
// todo: deprecate secondary
|
|
53
53
|
const secondaryStyle = css`
|
|
54
|
-
color: ${theme.
|
|
54
|
+
color: ${theme.colour.link.default};
|
|
55
55
|
|
|
56
56
|
&:active {
|
|
57
|
-
color: ${theme.
|
|
57
|
+
color: ${theme.colour.link.brandHover};
|
|
58
58
|
}
|
|
59
59
|
`;
|
|
60
60
|
|
|
@@ -72,7 +72,7 @@ const Link = forwardRef(function LinkInner(
|
|
|
72
72
|
|
|
73
73
|
const secondaryNoVisitedStyle = css`
|
|
74
74
|
&:visited {
|
|
75
|
-
color: ${theme.
|
|
75
|
+
color: ${theme.colour.link.default};
|
|
76
76
|
}
|
|
77
77
|
`;
|
|
78
78
|
|
|
@@ -84,7 +84,7 @@ const Link = forwardRef(function LinkInner(
|
|
|
84
84
|
|
|
85
85
|
const secondaryHoverStyle = css`
|
|
86
86
|
&:hover {
|
|
87
|
-
color: ${theme.
|
|
87
|
+
color: ${theme.colour.link.brandHover};
|
|
88
88
|
}
|
|
89
89
|
`;
|
|
90
90
|
|
|
@@ -38,8 +38,8 @@ const MenuContent: React.FC<MenuContentProps> = ({
|
|
|
38
38
|
z-index: 100;
|
|
39
39
|
${position === 'left' ? 'left: 0;' : 'right: 0;'}
|
|
40
40
|
white-space: nowrap;
|
|
41
|
-
background-color: ${theme.
|
|
42
|
-
color: ${theme.
|
|
41
|
+
background-color: ${theme.colour.surface.default};
|
|
42
|
+
color: ${theme.colour.text.default};
|
|
43
43
|
|
|
44
44
|
position: fixed;
|
|
45
45
|
height: 100vh;
|
|
@@ -58,7 +58,7 @@ const MenuContent: React.FC<MenuContentProps> = ({
|
|
|
58
58
|
position: absolute;
|
|
59
59
|
height: auto;
|
|
60
60
|
min-width: 600px;
|
|
61
|
-
border: ${theme.border.b1} solid ${theme.
|
|
61
|
+
border: ${theme.border.b1} solid ${theme.colour.border.default};
|
|
62
62
|
box-shadow: ${theme.boxShadow.y1};
|
|
63
63
|
}
|
|
64
64
|
`;
|
|
@@ -32,19 +32,21 @@ const MenuItem: React.FC<MenuItemProps> = ({
|
|
|
32
32
|
align-items: center;
|
|
33
33
|
font-family: ${theme.font.family.primary};
|
|
34
34
|
font-size: ${theme.font.size.f16};
|
|
35
|
-
font-weight: ${
|
|
36
|
-
? `${theme.font.weight.medium}`
|
|
37
|
-
|
|
38
|
-
color: ${theme.
|
|
35
|
+
font-weight: ${
|
|
36
|
+
secondary ? `${theme.font.weight.medium}` : `${theme.font.weight.bold}`
|
|
37
|
+
};
|
|
38
|
+
color: ${theme.colour.text.secondary};
|
|
39
39
|
`;
|
|
40
40
|
|
|
41
41
|
const clickableMenuItemStyle = css`
|
|
42
|
-
color: ${
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
color: ${
|
|
43
|
+
secondary
|
|
44
|
+
? `${theme.colour.text.secondary}`
|
|
45
|
+
: `${theme.colour.text.default}`
|
|
46
|
+
};
|
|
45
47
|
cursor: pointer;
|
|
46
48
|
&:hover {
|
|
47
|
-
background-color: ${theme.
|
|
49
|
+
background-color: ${theme.colour.fill.brandSubtleHover};
|
|
48
50
|
}
|
|
49
51
|
&:focus-visible {
|
|
50
52
|
outline: none;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HTMLAttributes,
|
|
3
|
-
forwardRef,
|
|
4
|
-
memo,
|
|
5
|
-
useCallback,
|
|
6
|
-
} from 'react';
|
|
1
|
+
import { HTMLAttributes, forwardRef, memo, useCallback } from 'react';
|
|
7
2
|
import { css, cx } from '@emotion/css';
|
|
8
3
|
import useTheme from '../../theme/useTheme';
|
|
9
4
|
import Blanket from '../Blanket';
|
|
10
5
|
|
|
11
6
|
export const NAME = 'ucl-modal';
|
|
12
7
|
|
|
13
|
-
export interface ModalProps
|
|
14
|
-
extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
export interface ModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
9
|
centered?: boolean;
|
|
16
10
|
closeOnClickOutside?: boolean;
|
|
17
11
|
onClose?: () => void;
|
|
@@ -40,7 +34,7 @@ const Modal = forwardRef<Ref, ModalProps>(
|
|
|
40
34
|
max-width: 600px;
|
|
41
35
|
font-family: ${theme.font.family.primary};
|
|
42
36
|
font-size: ${theme.font.size.f16};
|
|
43
|
-
color: ${theme.
|
|
37
|
+
color: ${theme.colour.text.default};
|
|
44
38
|
pointer-events: none;
|
|
45
39
|
`;
|
|
46
40
|
|
|
@@ -61,7 +55,7 @@ const Modal = forwardRef<Ref, ModalProps>(
|
|
|
61
55
|
const dialogStyle = css`
|
|
62
56
|
position: relative;
|
|
63
57
|
background-clip: padding-box;
|
|
64
|
-
background-color: ${theme.
|
|
58
|
+
background-color: ${theme.colour.surface.default};
|
|
65
59
|
box-shadow: ${theme.boxShadow.x2y4};
|
|
66
60
|
outline: 0;
|
|
67
61
|
pointer-events: auto;
|
|
@@ -79,11 +73,7 @@ const Modal = forwardRef<Ref, ModalProps>(
|
|
|
79
73
|
return (
|
|
80
74
|
<Blanket
|
|
81
75
|
className={className}
|
|
82
|
-
onClick={
|
|
83
|
-
closeOnClickOutside
|
|
84
|
-
? handleOutsideDialogClick
|
|
85
|
-
: undefined
|
|
86
|
-
}
|
|
76
|
+
onClick={closeOnClickOutside ? handleOutsideDialogClick : undefined}
|
|
87
77
|
>
|
|
88
78
|
<div
|
|
89
79
|
className={positioningStyle}
|
|
@@ -4,7 +4,7 @@ exports[`Modal > snapshot: default 1`] = `
|
|
|
4
4
|
<div
|
|
5
5
|
aria-hidden="true"
|
|
6
6
|
aria-label="Backdrop overlay, click to close modal"
|
|
7
|
-
class="ucl-blanket css-
|
|
7
|
+
class="ucl-blanket css-1kp3xax"
|
|
8
8
|
data-testid="ucl-blanket"
|
|
9
9
|
>
|
|
10
10
|
<div
|
|
@@ -12,7 +12,7 @@ exports[`Modal > snapshot: default 1`] = `
|
|
|
12
12
|
>
|
|
13
13
|
<div
|
|
14
14
|
aira-modal="true"
|
|
15
|
-
class="css-
|
|
15
|
+
class="css-1py9lz2"
|
|
16
16
|
data-testid="ucl-modal"
|
|
17
17
|
role="dialog"
|
|
18
18
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css, cx } from '@emotion/css';
|
|
2
|
-
import {
|
|
2
|
+
import { useTheme } from '../../theme';
|
|
3
3
|
import { dateToLocaleISOString } from './utils';
|
|
4
4
|
import type { NativeDatepickerProps } from './NativeDatepicker.types';
|
|
5
5
|
|
|
@@ -16,13 +16,15 @@ const NativeDatepicker = ({
|
|
|
16
16
|
ref,
|
|
17
17
|
...props
|
|
18
18
|
}: NativeDatepickerProps) => {
|
|
19
|
+
const [theme] = useTheme();
|
|
20
|
+
|
|
19
21
|
const baseStyle = css`
|
|
20
22
|
width: 196px;
|
|
21
23
|
height: 48px;
|
|
22
24
|
box-sizing: border-box;
|
|
23
25
|
padding: 0 16px;
|
|
24
|
-
border: 1px solid ${theme.
|
|
25
|
-
color:
|
|
26
|
+
border: 1px solid ${theme.colour.speciality.inputDefault};
|
|
27
|
+
color: ${theme.colour.text.default};
|
|
26
28
|
font-size: 16px;
|
|
27
29
|
font-family: sans-serif;
|
|
28
30
|
text-transform: uppercase;
|
|
@@ -34,14 +36,14 @@ const NativeDatepicker = ({
|
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
&::placeholder {
|
|
37
|
-
color:
|
|
39
|
+
color: ${theme.colour.text.tertiary};
|
|
38
40
|
}
|
|
39
41
|
`;
|
|
40
42
|
|
|
41
43
|
const disabledStyle = css`
|
|
42
|
-
color: ${theme.
|
|
43
|
-
background-color: ${theme.
|
|
44
|
-
border-color: ${theme.
|
|
44
|
+
color: ${theme.colour.text.disabled};
|
|
45
|
+
background-color: ${theme.colour.fill.inverse};
|
|
46
|
+
border-color: ${theme.colour.border.disabled};
|
|
45
47
|
cursor: not-allowed;
|
|
46
48
|
`;
|
|
47
49
|
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
Placement,
|
|
22
22
|
type FlipOptions,
|
|
23
23
|
type ShiftOptions,
|
|
24
|
-
|
|
24
|
+
type Strategy,
|
|
25
25
|
} from '@floating-ui/react-dom';
|
|
26
26
|
|
|
27
27
|
import { css, cx } from '@emotion/css';
|
|
@@ -44,6 +44,7 @@ export type OverlaySize = {
|
|
|
44
44
|
export interface OverlayProps extends HTMLAttributes<HTMLDivElement> {
|
|
45
45
|
reference: RefObject<HTMLElement | null>;
|
|
46
46
|
placement?: Placement;
|
|
47
|
+
strategy?: Strategy;
|
|
47
48
|
blanket?: boolean;
|
|
48
49
|
flip?: boolean | FlipOptions;
|
|
49
50
|
shift?: boolean | ShiftOptions;
|
|
@@ -62,6 +63,7 @@ const Overlay = forwardRef<Ref, OverlayProps>(
|
|
|
62
63
|
{
|
|
63
64
|
reference,
|
|
64
65
|
placement = 'bottom',
|
|
66
|
+
strategy = 'absolute',
|
|
65
67
|
blanket = false,
|
|
66
68
|
flip = true,
|
|
67
69
|
shift = true,
|
|
@@ -84,10 +86,21 @@ const Overlay = forwardRef<Ref, OverlayProps>(
|
|
|
84
86
|
useImperativeHandle<Ref, Ref>(forwardedRef, () => ref.current);
|
|
85
87
|
|
|
86
88
|
const fuiMiddleware = [];
|
|
87
|
-
if (
|
|
89
|
+
if (offset) fuiMiddleware.push(fuiOffset(offset));
|
|
90
|
+
if (flip)
|
|
91
|
+
fuiMiddleware.push(
|
|
92
|
+
fuiFlip({
|
|
93
|
+
// When escaping a containing element (e.g. a small Dialog) via
|
|
94
|
+
// `fixed` positioning, fall back to the originally-requested side
|
|
95
|
+
// rather than floating-ui's default "best fit" placement - bestFit
|
|
96
|
+
// can pick a placement that overlaps the reference entirely when
|
|
97
|
+
// nothing fits within the (still dialog-sized) boundary.
|
|
98
|
+
...(strategy === 'fixed' && { fallbackStrategy: 'initialPlacement' }),
|
|
99
|
+
...(typeof flip === 'object' ? flip : {}),
|
|
100
|
+
})
|
|
101
|
+
);
|
|
88
102
|
if (shift)
|
|
89
103
|
fuiMiddleware.push(fuiShift(typeof shift === 'object' ? shift : {}));
|
|
90
|
-
if (offset) fuiMiddleware.push(fuiOffset(offset));
|
|
91
104
|
if (size) {
|
|
92
105
|
const sizeOptions = typeof size === 'object' ? size : {};
|
|
93
106
|
const { padding = 0, matchReferenceWidth = false } = sizeOptions;
|
|
@@ -116,13 +129,12 @@ const Overlay = forwardRef<Ref, OverlayProps>(
|
|
|
116
129
|
x,
|
|
117
130
|
y,
|
|
118
131
|
refs,
|
|
119
|
-
strategy,
|
|
120
132
|
placement: currentPlacement,
|
|
121
133
|
} = useFloating({
|
|
122
134
|
open: true,
|
|
123
135
|
middleware: fuiMiddleware,
|
|
124
136
|
placement,
|
|
125
|
-
|
|
137
|
+
strategy,
|
|
126
138
|
whileElementsMounted: autoUpdate,
|
|
127
139
|
});
|
|
128
140
|
|
|
@@ -50,7 +50,7 @@ const Radio = forwardRef<Ref, RadioProps>(
|
|
|
50
50
|
border-style: solid;
|
|
51
51
|
outline: none;
|
|
52
52
|
box-sizing: border-box;
|
|
53
|
-
color: ${theme.
|
|
53
|
+
color: ${theme.colour.icon.inverse};
|
|
54
54
|
transition:
|
|
55
55
|
background-color 0.15s ease-out,
|
|
56
56
|
border-color 0.15s ease-out;
|
|
@@ -74,7 +74,13 @@ const Radio = forwardRef<Ref, RadioProps>(
|
|
|
74
74
|
border-color: ${theme.colour.speciality.inputDefault};
|
|
75
75
|
`;
|
|
76
76
|
|
|
77
|
-
const
|
|
77
|
+
const disabledUncheckedStyle = css`
|
|
78
|
+
background-color: ${theme.colour.icon.inverse};
|
|
79
|
+
border-color: ${theme.colour.border.disabled};
|
|
80
|
+
cursor: not-allowed;
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
const disabledCheckedStyle = css`
|
|
78
84
|
background-color: ${theme.colour.icon.disabled};
|
|
79
85
|
border-color: ${theme.colour.icon.disabled};
|
|
80
86
|
cursor: not-allowed;
|
|
@@ -87,7 +93,8 @@ const Radio = forwardRef<Ref, RadioProps>(
|
|
|
87
93
|
!disabled && focusStyle,
|
|
88
94
|
isChecked && checkedStyle,
|
|
89
95
|
!isChecked && uncheckedStyle,
|
|
90
|
-
disabled &&
|
|
96
|
+
disabled && !isChecked && disabledUncheckedStyle,
|
|
97
|
+
disabled && isChecked && disabledCheckedStyle,
|
|
91
98
|
className
|
|
92
99
|
);
|
|
93
100
|
|
|
@@ -112,7 +119,9 @@ const Radio = forwardRef<Ref, RadioProps>(
|
|
|
112
119
|
width: 12px;
|
|
113
120
|
height: 12px;
|
|
114
121
|
border-radius: 50%;
|
|
115
|
-
background-color: ${
|
|
122
|
+
background-color: ${
|
|
123
|
+
disabled ? theme.colour.icon.brandInverse : theme.colour.icon.inverse
|
|
124
|
+
};
|
|
116
125
|
user-select: none;
|
|
117
126
|
pointer-events: none;
|
|
118
127
|
`;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Radio > snapshot: checked prop 1`] = `
|
|
4
4
|
<span
|
|
5
|
-
class="ucl-uikit-radio css-
|
|
5
|
+
class="ucl-uikit-radio css-1elh2am"
|
|
6
6
|
>
|
|
7
7
|
<input
|
|
8
8
|
checked=""
|
|
@@ -18,7 +18,7 @@ exports[`Radio > snapshot: checked prop 1`] = `
|
|
|
18
18
|
|
|
19
19
|
exports[`Radio > snapshot: no props 1`] = `
|
|
20
20
|
<span
|
|
21
|
-
class="ucl-uikit-radio css-
|
|
21
|
+
class="ucl-uikit-radio css-auet16"
|
|
22
22
|
>
|
|
23
23
|
<input
|
|
24
24
|
class="css-19qtec1"
|
|
@@ -30,7 +30,7 @@ exports[`Radio > snapshot: no props 1`] = `
|
|
|
30
30
|
|
|
31
31
|
exports[`Radio > snapshot: testId prop 1`] = `
|
|
32
32
|
<span
|
|
33
|
-
class="ucl-uikit-radio css-
|
|
33
|
+
class="ucl-uikit-radio css-auet16"
|
|
34
34
|
>
|
|
35
35
|
<input
|
|
36
36
|
class="css-19qtec1"
|
|
@@ -119,7 +119,7 @@ const Search = ({
|
|
|
119
119
|
`;
|
|
120
120
|
|
|
121
121
|
const cancelIconButtonInactiveStyle = css`
|
|
122
|
-
color: ${theme.
|
|
122
|
+
color: ${theme.colour.icon.disabled};
|
|
123
123
|
`;
|
|
124
124
|
|
|
125
125
|
const cancelButtonStyle = cx(
|
|
@@ -130,7 +130,7 @@ const Search = ({
|
|
|
130
130
|
const dividerStyle = css`
|
|
131
131
|
width: 1px;
|
|
132
132
|
height: 38px;
|
|
133
|
-
background-color: ${theme.
|
|
133
|
+
background-color: ${theme.colour.border.disabled};
|
|
134
134
|
`;
|
|
135
135
|
|
|
136
136
|
const submitButtonStyle = css`
|
|
@@ -8,7 +8,7 @@ exports[`Search > snapshot: no props 1`] = `
|
|
|
8
8
|
class="ucl-uikit-input css-1bpb1dw"
|
|
9
9
|
>
|
|
10
10
|
<input
|
|
11
|
-
class="ucl-uikit-input__input css-
|
|
11
|
+
class="ucl-uikit-input__input css-1g04erc"
|
|
12
12
|
data-testid="ucl-uikit-search"
|
|
13
13
|
id=""
|
|
14
14
|
placeholder=""
|
|
@@ -87,7 +87,7 @@ exports[`Search > snapshot: testId prop 1`] = `
|
|
|
87
87
|
class="ucl-uikit-input css-1bpb1dw"
|
|
88
88
|
>
|
|
89
89
|
<input
|
|
90
|
-
class="ucl-uikit-input__input css-
|
|
90
|
+
class="ucl-uikit-input__input css-1g04erc"
|
|
91
91
|
data-testid="test123"
|
|
92
92
|
id=""
|
|
93
93
|
placeholder=""
|
|
@@ -588,18 +588,18 @@ const CustomSelect = <T extends string | number>({
|
|
|
588
588
|
`;
|
|
589
589
|
|
|
590
590
|
const disabledStyle = css`
|
|
591
|
-
color: ${theme.
|
|
592
|
-
border: ${theme.border.b1} solid ${theme.
|
|
591
|
+
color: ${theme.colour.text.disabled};
|
|
592
|
+
border: ${theme.border.b1} solid ${theme.colour.border.disabled};
|
|
593
593
|
cursor: not-allowed;
|
|
594
594
|
|
|
595
595
|
&:hover {
|
|
596
|
-
background-color: ${theme.
|
|
596
|
+
background-color: ${theme.colour.fill.inverse};
|
|
597
597
|
}
|
|
598
598
|
`;
|
|
599
599
|
|
|
600
600
|
const noOptionsStyle = css`
|
|
601
601
|
padding: ${theme.padding.p8} ${theme.padding.p16};
|
|
602
|
-
color: ${theme.
|
|
602
|
+
color: ${theme.colour.text.secondary};
|
|
603
603
|
`;
|
|
604
604
|
|
|
605
605
|
// Visually hidden but available to assistive technology
|
|
@@ -25,7 +25,7 @@ export const White: Story = {
|
|
|
25
25
|
},
|
|
26
26
|
args: {
|
|
27
27
|
className: css`
|
|
28
|
-
color: ${theme.
|
|
28
|
+
color: ${theme.colour.fill.inverse};
|
|
29
29
|
`,
|
|
30
30
|
},
|
|
31
31
|
};
|
|
@@ -33,7 +33,7 @@ export const White: Story = {
|
|
|
33
33
|
export const Blue: Story = {
|
|
34
34
|
args: {
|
|
35
35
|
className: css`
|
|
36
|
-
color: ${theme.
|
|
36
|
+
color: ${theme.colour.fill.brand};
|
|
37
37
|
`,
|
|
38
38
|
},
|
|
39
39
|
};
|
|
@@ -41,7 +41,7 @@ export const Blue: Story = {
|
|
|
41
41
|
export const Red: Story = {
|
|
42
42
|
args: {
|
|
43
43
|
className: css`
|
|
44
|
-
color: ${theme.
|
|
44
|
+
color: ${theme.colour.fill.critical};
|
|
45
45
|
`,
|
|
46
46
|
},
|
|
47
47
|
};
|
|
@@ -6,11 +6,11 @@ exports[`Table > Snapshot: basic table 1`] = `
|
|
|
6
6
|
data-testid="ucl-uikit-table"
|
|
7
7
|
>
|
|
8
8
|
<thead
|
|
9
|
-
class="css-
|
|
9
|
+
class="css-b9vb4h ucl-uikit-table__head"
|
|
10
10
|
data-testid="ucl-uikit-table__head"
|
|
11
11
|
>
|
|
12
12
|
<tr
|
|
13
|
-
class="css-
|
|
13
|
+
class="css-7kbd2r"
|
|
14
14
|
>
|
|
15
15
|
<th
|
|
16
16
|
class="css-x1n4gt ucl-uikit-table__head-cell"
|
|
@@ -173,7 +173,7 @@ exports[`Table > Snapshot: basic table 1`] = `
|
|
|
173
173
|
>
|
|
174
174
|
<tr
|
|
175
175
|
aria-selected="false"
|
|
176
|
-
class="css-
|
|
176
|
+
class="css-h7fw6w ucl-uikit-table__row"
|
|
177
177
|
data-mobile-expanded="true"
|
|
178
178
|
data-testid="ucl-uikit-table__row"
|
|
179
179
|
>
|
|
@@ -10,7 +10,7 @@ const Head = ({ className, children, ...props }: TableHeadProps) => {
|
|
|
10
10
|
|
|
11
11
|
const baseStyle = css`
|
|
12
12
|
height: 40px;
|
|
13
|
-
background-color:
|
|
13
|
+
background-color: ${theme.colour.surface.secondary};
|
|
14
14
|
|
|
15
15
|
@media screen and (max-width: ${theme.breakpoints.tablet - 1}px) {
|
|
16
16
|
position: absolute;
|
|
@@ -26,7 +26,7 @@ const Head = ({ className, children, ...props }: TableHeadProps) => {
|
|
|
26
26
|
`;
|
|
27
27
|
|
|
28
28
|
const rowStyle = css`
|
|
29
|
-
border-bottom: 1px solid ${theme.colour.border.
|
|
29
|
+
border-bottom: 1px solid ${theme.colour.border.disabled};
|
|
30
30
|
`;
|
|
31
31
|
|
|
32
32
|
const style = cx(baseStyle, className, NAME);
|