uikit-react-public 0.44.5 → 0.45.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.
Files changed (33) hide show
  1. package/dist/components/CookiesNotice/CookieSettings.d.ts +16 -0
  2. package/dist/components/CookiesNotice/CookiesNotice.d.ts +26 -0
  3. package/dist/components/CookiesNotice/CookiesNotice.stories.d.ts +13 -0
  4. package/dist/components/CookiesNotice/__tests__/CookiesNotice.test.d.ts +1 -0
  5. package/dist/components/CookiesNotice/defaults.d.ts +6 -0
  6. package/dist/components/CookiesNotice/index.d.ts +3 -0
  7. package/dist/components/CookiesNotice/types.d.ts +12 -0
  8. package/dist/components/Paragraph/Paragraph.d.ts +1 -1
  9. package/dist/components/Text/Text.d.ts +1 -1
  10. package/dist/components/Text/__tests__/Text.test.d.ts +1 -0
  11. package/dist/components/index.d.ts +3 -0
  12. package/dist/index.js +6528 -5923
  13. package/lib/components/Button/Button.tsx +1 -1
  14. package/lib/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +8 -8
  15. package/lib/components/CookiesNotice/CookieSettings.tsx +304 -0
  16. package/lib/components/CookiesNotice/CookiesNotice.stories.tsx +60 -0
  17. package/lib/components/CookiesNotice/CookiesNotice.tsx +379 -0
  18. package/lib/components/CookiesNotice/__tests__/CookiesNotice.test.tsx +180 -0
  19. package/lib/components/CookiesNotice/defaults.ts +40 -0
  20. package/lib/components/CookiesNotice/index.ts +6 -0
  21. package/lib/components/CookiesNotice/types.ts +14 -0
  22. package/lib/components/Input/Input.tsx +1 -0
  23. package/lib/components/Input/__tests__/__snapshots__/Input.test.tsx.snap +4 -4
  24. package/lib/components/Paragraph/Paragraph.tsx +13 -1
  25. package/lib/components/Paragraph/__tests__/Paragraph.test.tsx +24 -0
  26. package/lib/components/Search/__tests__/__snapshots__/Search.test.tsx.snap +2 -2
  27. package/lib/components/Text/Text.tsx +13 -0
  28. package/lib/components/Text/__tests__/Text.test.tsx +41 -0
  29. package/lib/components/Textarea/Textarea.tsx +2 -3
  30. package/lib/components/Textarea/__tests__/__snapshots__/Textarea.test.tsx.snap +4 -4
  31. package/lib/components/index.ts +9 -0
  32. package/lib/theme/common/themeCommon.ts +305 -327
  33. package/package.json +1 -1
@@ -73,4 +73,28 @@ describe('Paragraph', () => {
73
73
  const paragraph = screen.getByTestId('custom-test-id');
74
74
  expect(paragraph).toBeDefined();
75
75
  });
76
+
77
+ test('md-numeric uses mono font family', () => {
78
+ render(
79
+ <ThemeContextProvider>
80
+ <Paragraph level='md-numeric'>0123456789</Paragraph>
81
+ </ThemeContextProvider>
82
+ );
83
+
84
+ expect(document.head.textContent).toContain(
85
+ 'font-family:DM Mono;font-size:16px;font-weight:400;line-height:150%;'
86
+ );
87
+ });
88
+
89
+ test('md-medium-numeric uses mono font family', () => {
90
+ render(
91
+ <ThemeContextProvider>
92
+ <Paragraph level='md-medium-numeric'>0123456789</Paragraph>
93
+ </ThemeContextProvider>
94
+ );
95
+
96
+ expect(document.head.textContent).toContain(
97
+ 'font-family:DM Mono;font-size:16px;font-weight:450;line-height:150%;'
98
+ );
99
+ });
76
100
  });
@@ -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-r12x3w"
11
+ class="ucl-uikit-input__input css-q3oxlx"
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-r12x3w"
90
+ class="ucl-uikit-input__input css-q3oxlx"
91
91
  data-testid="test123"
92
92
  id=""
93
93
  placeholder=""
@@ -12,6 +12,7 @@ export type TextLevel =
12
12
  | 'md'
13
13
  | 'md-medium'
14
14
  | 'md-semibold'
15
+ | 'md-numeric'
15
16
  | 'md-medium-numeric'
16
17
  | 'sm'
17
18
  | 'sm-medium'
@@ -44,6 +45,7 @@ const Text = ({
44
45
  md,
45
46
  mdMedium,
46
47
  mdSemibold,
48
+ mdNumeric,
47
49
  mdMediumNumeric,
48
50
  sm,
49
51
  smMedium,
@@ -103,7 +105,17 @@ const Text = ({
103
105
  line-height: ${mdSemibold.lineHeight}%;
104
106
  `;
105
107
 
108
+ const mdNumericStyle = css`
109
+ font-family: ${mdNumeric.fontFamily};
110
+ font-feature-settings: ${mdNumeric.fontSettings};
111
+ font-size: ${mdNumeric.fontSize}px;
112
+ font-weight: ${mdNumeric.fontWeight};
113
+ line-height: ${mdNumeric.lineHeight}%;
114
+ `;
115
+
106
116
  const mdMediumNumericStyle = css`
117
+ font-family: ${mdMediumNumeric.fontFamily};
118
+ font-feature-settings: ${mdMediumNumeric.fontSettings};
107
119
  font-size: ${mdMediumNumeric.fontSize}px;
108
120
  font-weight: ${mdMediumNumeric.fontWeight};
109
121
  line-height: ${mdMediumNumeric.lineHeight}%;
@@ -149,6 +161,7 @@ const Text = ({
149
161
  level === 'md' && mdStyle,
150
162
  level === 'md-medium' && mdMediumStyle,
151
163
  level === 'md-semibold' && mdSemiboldStyle,
164
+ level === 'md-numeric' && mdNumericStyle,
152
165
  level === 'md-medium-numeric' && mdMediumNumericStyle,
153
166
  level === 'sm' && smStyle,
154
167
  level === 'sm-medium' && smMediumStyle,
@@ -0,0 +1,41 @@
1
+ import { describe, expect, test } from 'vitest';
2
+ import { render, screen } from '@testing-library/react';
3
+ import Text from '../Text';
4
+ import { ThemeContextProvider } from '../../../theme/useTheme';
5
+
6
+ describe('Text', () => {
7
+ test('Test ID: Default', () => {
8
+ render(
9
+ <ThemeContextProvider>
10
+ <Text>This is a test</Text>
11
+ </ThemeContextProvider>
12
+ );
13
+
14
+ const text = screen.getByTestId('ucl-uikit-text');
15
+ expect(text).toBeDefined();
16
+ });
17
+
18
+ test('md-numeric uses mono font family', () => {
19
+ render(
20
+ <ThemeContextProvider>
21
+ <Text level='md-numeric'>0123456789</Text>
22
+ </ThemeContextProvider>
23
+ );
24
+
25
+ expect(document.head.textContent).toContain(
26
+ 'font-family:DM Mono;font-size:16px;font-weight:400;line-height:150%;'
27
+ );
28
+ });
29
+
30
+ test('md-medium-numeric uses mono font family', () => {
31
+ render(
32
+ <ThemeContextProvider>
33
+ <Text level='md-medium-numeric'>0123456789</Text>
34
+ </ThemeContextProvider>
35
+ );
36
+
37
+ expect(document.head.textContent).toContain(
38
+ 'font-family:DM Mono;font-size:16px;font-weight:450;line-height:150%;'
39
+ );
40
+ });
41
+ });
@@ -41,21 +41,20 @@ const Textarea = forwardRef<Ref, TextareaProps>(
41
41
  }, [value, setCharCount]);
42
42
 
43
43
  const baseStyle = css`
44
- line-height: 150%;
45
44
  box-sizing: border-box;
46
45
  padding: ${theme.padding.p16};
47
46
  font-family: ${md.fontFamily};
48
47
  font-feature-settings: ${md.fontSettings};
49
48
  font-size: ${md.fontSize}px;
50
49
  font-weight: ${md.fontWeight};
50
+ line-height: ${md.lineHeight}%;
51
51
  color: ${theme.colour.text.default};
52
52
  background-color: ${theme.colour.fill.inverse};
53
53
  border: ${theme.border.b1} solid ${theme.colour.speciality.inputDefault};
54
+ border-radius: ${theme.radius.r4};
54
55
  outline: none;
55
56
  box-sizing: border-box;
56
57
  width: 100%;
57
- min-width: 50px;
58
- max-width: 660px;
59
58
  height: 106px;
60
59
  min-height: 64px;
61
60
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`Textarea > snapshot: Disabled 1`] = `
4
4
  <textarea
5
- class="ucl-uikit-textarea css-yfw4f5"
5
+ class="ucl-uikit-textarea css-dbajsl"
6
6
  data-testid="ucl-uikit-textarea"
7
7
  disabled=""
8
8
  id=""
@@ -11,7 +11,7 @@ exports[`Textarea > snapshot: Disabled 1`] = `
11
11
 
12
12
  exports[`Textarea > snapshot: Placeholder 1`] = `
13
13
  <textarea
14
- class="ucl-uikit-textarea css-1eai1zv"
14
+ class="ucl-uikit-textarea css-elmoey"
15
15
  data-testid="ucl-uikit-textarea"
16
16
  id=""
17
17
  placeholder="test"
@@ -20,7 +20,7 @@ exports[`Textarea > snapshot: Placeholder 1`] = `
20
20
 
21
21
  exports[`Textarea > snapshot: custom test id 1`] = `
22
22
  <textarea
23
- class="ucl-uikit-textarea css-1eai1zv"
23
+ class="ucl-uikit-textarea css-elmoey"
24
24
  data-testid="custom-test-id"
25
25
  id=""
26
26
  />
@@ -28,7 +28,7 @@ exports[`Textarea > snapshot: custom test id 1`] = `
28
28
 
29
29
  exports[`Textarea > snapshot: minimal props 1`] = `
30
30
  <textarea
31
- class="ucl-uikit-textarea css-1eai1zv"
31
+ class="ucl-uikit-textarea css-elmoey"
32
32
  data-testid="ucl-uikit-textarea"
33
33
  id=""
34
34
  />
@@ -221,9 +221,18 @@ export type { FileInputProps } from './FileInput';
221
221
  export { default as Timepicker } from './Timepicker';
222
222
  export type { TimepickerProps } from './Timepicker';
223
223
 
224
+ /** @deprecated Use CookiesNotice instead. */
224
225
  export { default as CookieNotice } from './CookieNotice';
225
226
  export type { CookieNoticeProps } from './CookieNotice';
226
227
 
228
+ export { default as CookiesNotice } from './CookiesNotice';
229
+ export type {
230
+ CookieCategory,
231
+ CookiePreferences,
232
+ CookiesNoticeBaseProps,
233
+ CookiesNoticeProps,
234
+ } from './CookiesNotice';
235
+
227
236
  export { default as Search } from './Search';
228
237
  export type { SearchProps } from './Search';
229
238