@transferwise/components 46.155.1 → 46.157.0
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/build/Calendar/Calendar.constants.js +10 -0
- package/build/Calendar/Calendar.constants.js.map +1 -0
- package/build/Calendar/Calendar.constants.mjs +8 -0
- package/build/Calendar/Calendar.constants.mjs.map +1 -0
- package/build/Calendar/Calendar.js +121 -17
- package/build/Calendar/Calendar.js.map +1 -1
- package/build/Calendar/Calendar.messages.js +12 -0
- package/build/Calendar/Calendar.messages.js.map +1 -1
- package/build/Calendar/Calendar.messages.mjs +12 -0
- package/build/Calendar/Calendar.messages.mjs.map +1 -1
- package/build/Calendar/Calendar.mjs +122 -18
- package/build/Calendar/Calendar.mjs.map +1 -1
- package/build/Calendar/DateHeader/DateHeader.js +5 -1
- package/build/Calendar/DateHeader/DateHeader.js.map +1 -1
- package/build/Calendar/DateHeader/DateHeader.mjs +5 -1
- package/build/Calendar/DateHeader/DateHeader.mjs.map +1 -1
- package/build/Calendar/DayCalendar/DayCalendar.js +20 -2
- package/build/Calendar/DayCalendar/DayCalendar.js.map +1 -1
- package/build/Calendar/DayCalendar/DayCalendar.mjs +20 -2
- package/build/Calendar/DayCalendar/DayCalendar.mjs.map +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.js +60 -19
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.js.map +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs +60 -19
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs.map +1 -1
- package/build/Calendar/MonthCalendar/MonthCalendar.js +6 -0
- package/build/Calendar/MonthCalendar/MonthCalendar.js.map +1 -1
- package/build/Calendar/MonthCalendar/MonthCalendar.mjs +6 -0
- package/build/Calendar/MonthCalendar/MonthCalendar.mjs.map +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js +8 -3
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js.map +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs +8 -3
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs.map +1 -1
- package/build/Calendar/TableLink/TableLink.js +95 -0
- package/build/Calendar/TableLink/TableLink.js.map +1 -0
- package/build/Calendar/TableLink/TableLink.mjs +91 -0
- package/build/Calendar/TableLink/TableLink.mjs.map +1 -0
- package/build/Calendar/YearCalendar/Table/YearCalendarTable.js +8 -3
- package/build/Calendar/YearCalendar/Table/YearCalendarTable.js.map +1 -1
- package/build/Calendar/YearCalendar/Table/YearCalendarTable.mjs +8 -3
- package/build/Calendar/YearCalendar/Table/YearCalendarTable.mjs.map +1 -1
- package/build/Calendar/YearCalendar/YearCalendar.js +7 -0
- package/build/Calendar/YearCalendar/YearCalendar.js.map +1 -1
- package/build/Calendar/YearCalendar/YearCalendar.mjs +7 -0
- package/build/Calendar/YearCalendar/YearCalendar.mjs.map +1 -1
- package/build/Calendar/_helpers/clampToDayViewBoundary/clampToDayViewBoundary.js +24 -0
- package/build/Calendar/_helpers/clampToDayViewBoundary/clampToDayViewBoundary.js.map +1 -0
- package/build/Calendar/_helpers/clampToDayViewBoundary/clampToDayViewBoundary.mjs +22 -0
- package/build/Calendar/_helpers/clampToDayViewBoundary/clampToDayViewBoundary.mjs.map +1 -0
- package/build/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.js +33 -0
- package/build/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.js.map +1 -0
- package/build/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.mjs +31 -0
- package/build/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.mjs.map +1 -0
- package/build/Calendar/_helpers/isDateDisabled/isDateDisabled.js +40 -0
- package/build/Calendar/_helpers/isDateDisabled/isDateDisabled.js.map +1 -0
- package/build/Calendar/_helpers/isDateDisabled/isDateDisabled.mjs +38 -0
- package/build/Calendar/_helpers/isDateDisabled/isDateDisabled.mjs.map +1 -0
- package/build/DateLookup/DateLookup.js +20 -9
- package/build/DateLookup/DateLookup.js.map +1 -1
- package/build/DateLookup/DateLookup.mjs +20 -9
- package/build/DateLookup/DateLookup.mjs.map +1 -1
- package/build/ExpressiveMoneyInput/CurrencySelector/CurrencySelector.js +3 -5
- package/build/ExpressiveMoneyInput/CurrencySelector/CurrencySelector.js.map +1 -1
- package/build/ExpressiveMoneyInput/CurrencySelector/CurrencySelector.mjs +3 -5
- package/build/ExpressiveMoneyInput/CurrencySelector/CurrencySelector.mjs.map +1 -1
- package/build/Inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js.map +1 -1
- package/build/Inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs.map +1 -1
- package/build/Markup/Markup.js +138 -0
- package/build/Markup/Markup.js.map +1 -0
- package/build/Markup/Markup.mjs +133 -0
- package/build/Markup/Markup.mjs.map +1 -0
- package/build/Markup/constants.js +21 -0
- package/build/Markup/constants.js.map +1 -0
- package/build/Markup/constants.mjs +15 -0
- package/build/Markup/constants.mjs.map +1 -0
- package/build/Markup/utils/parseMarkup.js +263 -0
- package/build/Markup/utils/parseMarkup.js.map +1 -0
- package/build/Markup/utils/parseMarkup.mjs +258 -0
- package/build/Markup/utils/parseMarkup.mjs.map +1 -0
- package/build/Markup/utils/sanitise.js +111 -0
- package/build/Markup/utils/sanitise.js.map +1 -0
- package/build/Markup/utils/sanitise.mjs +108 -0
- package/build/Markup/utils/sanitise.mjs.map +1 -0
- package/build/Typeahead/Typeahead.js +53 -27
- package/build/Typeahead/Typeahead.js.map +1 -1
- package/build/Typeahead/Typeahead.messages.js +3 -0
- package/build/Typeahead/Typeahead.messages.js.map +1 -1
- package/build/Typeahead/Typeahead.messages.mjs +3 -0
- package/build/Typeahead/Typeahead.messages.mjs.map +1 -1
- package/build/Typeahead/Typeahead.mjs +53 -27
- package/build/Typeahead/Typeahead.mjs.map +1 -1
- package/build/Typeahead/TypeaheadInput/TypeaheadInput.js +2 -2
- package/build/Typeahead/TypeaheadInput/TypeaheadInput.js.map +1 -1
- package/build/Typeahead/TypeaheadInput/TypeaheadInput.mjs +2 -2
- package/build/Typeahead/TypeaheadInput/TypeaheadInput.mjs.map +1 -1
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.js +3 -1
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.js.map +1 -1
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs +3 -1
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs.map +1 -1
- package/build/i18n/en.json +5 -0
- package/build/i18n/en.json.js +5 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +5 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/i18n/hu.json +1 -1
- package/build/i18n/hu.json.js +1 -1
- package/build/i18n/hu.json.mjs +1 -1
- package/build/index.js +4 -2
- package/build/index.js.map +1 -1
- package/build/index.mjs +2 -1
- package/build/index.mjs.map +1 -1
- package/build/main.css +168 -43
- package/build/styles/Calendar/Calendar.css +112 -37
- package/build/styles/Calendar/TableLink/TableLink.css +115 -0
- package/build/styles/Markup/Markup.css +28 -0
- package/build/styles/Markup/_stories/Vulnerability/Vulnerability.css +69 -0
- package/build/styles/Typeahead/Typeahead.css +4 -0
- package/build/styles/Typeahead/TypeaheadOption/TypeaheadOption.css +5 -0
- package/build/styles/main.css +168 -43
- package/build/types/Calendar/Calendar.constants.d.ts +2 -0
- package/build/types/Calendar/Calendar.constants.d.ts.map +1 -0
- package/build/types/Calendar/Calendar.d.ts +16 -3
- package/build/types/Calendar/Calendar.d.ts.map +1 -1
- package/build/types/Calendar/Calendar.messages.d.ts +20 -0
- package/build/types/Calendar/Calendar.messages.d.ts.map +1 -1
- package/build/types/Calendar/Calendar.types.d.ts +32 -0
- package/build/types/Calendar/Calendar.types.d.ts.map +1 -0
- package/build/types/Calendar/DateHeader/DateHeader.d.ts +2 -0
- package/build/types/Calendar/DateHeader/DateHeader.d.ts.map +1 -1
- package/build/types/Calendar/DayCalendar/DayCalendar.d.ts +7 -1
- package/build/types/Calendar/DayCalendar/DayCalendar.d.ts.map +1 -1
- package/build/types/Calendar/DayCalendar/Table/DayCalendarTable.d.ts +6 -0
- package/build/types/Calendar/DayCalendar/Table/DayCalendarTable.d.ts.map +1 -1
- package/build/types/Calendar/MonthCalendar/MonthCalendar.d.ts +1 -0
- package/build/types/Calendar/MonthCalendar/MonthCalendar.d.ts.map +1 -1
- package/build/types/Calendar/MonthCalendar/Table/MonthCalendarTable.d.ts +2 -1
- package/build/types/Calendar/MonthCalendar/Table/MonthCalendarTable.d.ts.map +1 -1
- package/build/types/Calendar/{tableLink → TableLink}/TableLink.d.ts +5 -1
- package/build/types/Calendar/TableLink/TableLink.d.ts.map +1 -0
- package/build/types/Calendar/TableLink/index.d.ts.map +1 -0
- package/build/types/Calendar/YearCalendar/Table/YearCalendarTable.d.ts +2 -1
- package/build/types/Calendar/YearCalendar/Table/YearCalendarTable.d.ts.map +1 -1
- package/build/types/Calendar/YearCalendar/YearCalendar.d.ts +1 -0
- package/build/types/Calendar/YearCalendar/YearCalendar.d.ts.map +1 -1
- package/build/types/Calendar/_helpers/clampToDayViewBoundary/clampToDayViewBoundary.d.ts +8 -0
- package/build/types/Calendar/_helpers/clampToDayViewBoundary/clampToDayViewBoundary.d.ts.map +1 -0
- package/build/types/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.d.ts +3 -0
- package/build/types/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.d.ts.map +1 -0
- package/build/types/Calendar/_helpers/index.d.ts +4 -0
- package/build/types/Calendar/_helpers/index.d.ts.map +1 -0
- package/build/types/Calendar/_helpers/isDateDisabled/isDateDisabled.d.ts +3 -0
- package/build/types/Calendar/_helpers/isDateDisabled/isDateDisabled.d.ts.map +1 -0
- package/build/types/Calendar/index.d.ts +1 -0
- package/build/types/Calendar/index.d.ts.map +1 -1
- package/build/types/DateLookup/DateLookup.d.ts +24 -5
- package/build/types/DateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/DateLookup/index.d.ts +1 -0
- package/build/types/DateLookup/index.d.ts.map +1 -1
- package/build/types/ExpressiveMoneyInput/CurrencySelector/CurrencySelector.d.ts +6 -4
- package/build/types/ExpressiveMoneyInput/CurrencySelector/CurrencySelector.d.ts.map +1 -1
- package/build/types/Inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts +1 -1
- package/build/types/Inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts.map +1 -1
- package/build/types/Markup/Markup.d.ts +18 -0
- package/build/types/Markup/Markup.d.ts.map +1 -0
- package/build/types/Markup/Markup.types.d.ts +77 -0
- package/build/types/Markup/Markup.types.d.ts.map +1 -0
- package/build/types/Markup/_stories/Vulnerability/Vulnerability.d.ts +12 -0
- package/build/types/Markup/_stories/Vulnerability/Vulnerability.d.ts.map +1 -0
- package/build/types/Markup/constants.d.ts +6 -0
- package/build/types/Markup/constants.d.ts.map +1 -0
- package/build/types/Markup/index.d.ts +3 -0
- package/build/types/Markup/index.d.ts.map +1 -0
- package/build/types/Markup/utils/parseMarkup.d.ts +8 -0
- package/build/types/Markup/utils/parseMarkup.d.ts.map +1 -0
- package/build/types/Markup/utils/sanitise.d.ts +4 -0
- package/build/types/Markup/utils/sanitise.d.ts.map +1 -0
- package/build/types/Typeahead/Typeahead.d.ts.map +1 -1
- package/build/types/Typeahead/Typeahead.messages.d.ts +5 -0
- package/build/types/Typeahead/Typeahead.messages.d.ts.map +1 -1
- package/build/types/Typeahead/TypeaheadInput/TypeaheadInput.d.ts.map +1 -1
- package/build/types/Typeahead/TypeaheadOption/TypeaheadOption.d.ts +1 -0
- package/build/types/Typeahead/TypeaheadOption/TypeaheadOption.d.ts.map +1 -1
- package/build/types/index.d.ts +5 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +10 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Calendar/Calendar.constants.ts +5 -0
- package/src/Calendar/Calendar.css +112 -37
- package/src/Calendar/Calendar.disabledDates.test.tsx +610 -0
- package/src/Calendar/Calendar.less +5 -35
- package/src/Calendar/Calendar.messages.ts +21 -0
- package/src/Calendar/Calendar.test.tsx +342 -32
- package/src/Calendar/Calendar.tsx +169 -19
- package/src/Calendar/Calendar.types.ts +35 -0
- package/src/Calendar/DateHeader/DateHeader.tsx +6 -0
- package/src/Calendar/DayCalendar/DayCalendar.tsx +39 -1
- package/src/Calendar/DayCalendar/Table/DayCalendarTable.tsx +67 -27
- package/src/Calendar/MonthCalendar/MonthCalendar.tsx +8 -0
- package/src/Calendar/MonthCalendar/Table/MonthCalendarTable.tsx +15 -3
- package/src/Calendar/TableLink/TableLink.css +115 -0
- package/src/Calendar/TableLink/TableLink.less +68 -0
- package/src/Calendar/TableLink/TableLink.tsx +117 -0
- package/src/Calendar/YearCalendar/Table/YearCalendarTable.tsx +15 -3
- package/src/Calendar/YearCalendar/YearCalendar.tsx +9 -0
- package/src/Calendar/_helpers/clampToDayViewBoundary/clampToDayViewBoundary.test.ts +90 -0
- package/src/Calendar/_helpers/clampToDayViewBoundary/clampToDayViewBoundary.ts +25 -0
- package/src/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.test.ts +98 -0
- package/src/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.ts +45 -0
- package/src/Calendar/_helpers/index.ts +3 -0
- package/src/Calendar/_helpers/isDateDisabled/isDateDisabled.test.ts +169 -0
- package/src/Calendar/_helpers/isDateDisabled/isDateDisabled.ts +59 -0
- package/src/Calendar/_stories/Calendar.accessibility.docs.mdx +118 -0
- package/src/Calendar/_stories/Calendar.story.tsx +144 -4
- package/src/Calendar/_stories/Calendar.test.story.tsx +114 -0
- package/src/Calendar/index.ts +7 -0
- package/src/DateLookup/DateLookup.disabledDates.test.tsx +312 -0
- package/src/DateLookup/DateLookup.test.tsx +34 -37
- package/src/DateLookup/DateLookup.tsx +37 -13
- package/src/DateLookup/_stories/DateLookup.accessibility.docs.mdx +108 -0
- package/src/DateLookup/_stories/DateLookup.story.tsx +126 -2
- package/src/DateLookup/index.ts +6 -0
- package/src/ExpressiveMoneyInput/CurrencySelector/CurrencySelector.tsx +12 -13
- package/src/Inputs/SelectInput/SelectInput.test.tsx +37 -0
- package/src/Inputs/SelectInput/TriggerButton/SelectInputTriggerButton.tsx +1 -1
- package/src/Markup/Markup.css +28 -0
- package/src/Markup/Markup.injection.test.tsx +163 -0
- package/src/Markup/Markup.less +29 -0
- package/src/Markup/Markup.test.tsx +502 -0
- package/src/Markup/Markup.tsx +175 -0
- package/src/Markup/Markup.types.ts +62 -0
- package/src/Markup/_stories/Markup.docs.mdx +75 -0
- package/src/Markup/_stories/Markup.security.docs.mdx +343 -0
- package/src/Markup/_stories/Markup.story.tsx +266 -0
- package/src/Markup/_stories/Vulnerability/Vulnerability.css +69 -0
- package/src/Markup/_stories/Vulnerability/Vulnerability.tsx +30 -0
- package/src/Markup/constants.ts +23 -0
- package/src/Markup/index.ts +2 -0
- package/src/Markup/utils/parseMarkup.test.ts +706 -0
- package/src/Markup/utils/parseMarkup.ts +265 -0
- package/src/Markup/utils/sanitise.test.ts +499 -0
- package/src/Markup/utils/sanitise.ts +129 -0
- package/src/Typeahead/Typeahead.css +4 -0
- package/src/Typeahead/Typeahead.less +2 -0
- package/src/Typeahead/Typeahead.messages.ts +5 -0
- package/src/Typeahead/Typeahead.test.tsx +80 -3
- package/src/Typeahead/Typeahead.tsx +50 -27
- package/src/Typeahead/TypeaheadInput/TypeaheadInput.tsx +2 -6
- package/src/Typeahead/TypeaheadOption/TypeaheadOption.css +5 -0
- package/src/Typeahead/TypeaheadOption/TypeaheadOption.less +9 -0
- package/src/Typeahead/TypeaheadOption/TypeaheadOption.tsx +4 -2
- package/src/i18n/en.json +4 -0
- package/src/i18n/hu.json +1 -1
- package/src/index.ts +5 -2
- package/src/main.css +168 -43
- package/src/main.less +1 -0
- package/build/Calendar/tableLink/TableLink.js +0 -61
- package/build/Calendar/tableLink/TableLink.js.map +0 -1
- package/build/Calendar/tableLink/TableLink.mjs +0 -57
- package/build/Calendar/tableLink/TableLink.mjs.map +0 -1
- package/build/types/Calendar/tableLink/TableLink.d.ts.map +0 -1
- package/build/types/Calendar/tableLink/index.d.ts.map +0 -1
- package/src/Calendar/tableLink/TableLink.tsx +0 -77
- /package/build/types/Calendar/{tableLink → TableLink}/index.d.ts +0 -0
- /package/src/Calendar/{tableLink → TableLink}/index.ts +0 -0
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import Field from '../Field';
|
|
2
|
-
import { mockMatchMedia, render, screen, fireEvent } from '../test-utils';
|
|
2
|
+
import { mockMatchMedia, render, screen, fireEvent, userEvent } from '../test-utils';
|
|
3
3
|
import { wait } from '../test-utils/wait';
|
|
4
4
|
import Typeahead from './Typeahead';
|
|
5
5
|
|
|
6
6
|
mockMatchMedia();
|
|
7
7
|
|
|
8
|
+
const scrollIntoView = jest.fn();
|
|
9
|
+
|
|
8
10
|
describe('Typeahead', () => {
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
HTMLElement.prototype.scrollIntoView = scrollIntoView;
|
|
13
|
+
scrollIntoView.mockClear();
|
|
14
|
+
});
|
|
15
|
+
|
|
9
16
|
it('supports `Field` for labeling', () => {
|
|
10
17
|
render(
|
|
11
18
|
<Field id="test" label="Tags">
|
|
@@ -22,7 +29,7 @@ describe('Typeahead', () => {
|
|
|
22
29
|
<Typeahead id="test" name="test" options={[]} onChange={() => {}} />
|
|
23
30
|
</Field>,
|
|
24
31
|
);
|
|
25
|
-
expect(screen.queryByRole('
|
|
32
|
+
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
|
26
33
|
});
|
|
27
34
|
it('does render a dropdown when only a footer is provided', () => {
|
|
28
35
|
render(
|
|
@@ -30,7 +37,7 @@ describe('Typeahead', () => {
|
|
|
30
37
|
<Typeahead id="test" name="test" options={[]} footer={<p>hello</p>} onChange={() => {}} />
|
|
31
38
|
</Field>,
|
|
32
39
|
);
|
|
33
|
-
expect(screen.getByRole('
|
|
40
|
+
expect(screen.getByRole('listbox')).toBeInTheDocument();
|
|
34
41
|
});
|
|
35
42
|
});
|
|
36
43
|
|
|
@@ -74,6 +81,76 @@ describe('Typeahead', () => {
|
|
|
74
81
|
expect(onChange).toHaveBeenCalled();
|
|
75
82
|
});
|
|
76
83
|
|
|
84
|
+
it('scrolls options into view when navigating with arrow keys', async () => {
|
|
85
|
+
render(
|
|
86
|
+
<Typeahead
|
|
87
|
+
id="test"
|
|
88
|
+
name="test"
|
|
89
|
+
options={[{ label: 'Option 1' }, { label: 'Option 2' }]}
|
|
90
|
+
minQueryLength={0}
|
|
91
|
+
onChange={() => {}}
|
|
92
|
+
/>,
|
|
93
|
+
);
|
|
94
|
+
const input = screen.getByRole('combobox');
|
|
95
|
+
|
|
96
|
+
await userEvent.click(input);
|
|
97
|
+
await userEvent.keyboard('{ArrowDown}{ArrowDown}');
|
|
98
|
+
|
|
99
|
+
expect(input).toHaveFocus();
|
|
100
|
+
expect(scrollIntoView).toHaveBeenCalledTimes(2);
|
|
101
|
+
expect(scrollIntoView).toHaveBeenNthCalledWith(1, { block: 'nearest' });
|
|
102
|
+
expect(scrollIntoView).toHaveBeenNthCalledWith(2, { block: 'nearest' });
|
|
103
|
+
expect(scrollIntoView.mock.contexts[0]).toBe(screen.getByText('Option 1').closest('li'));
|
|
104
|
+
expect(scrollIntoView.mock.contexts[1]).toBe(screen.getByText('Option 2').closest('li'));
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('uses one Tab stop for the suggestions', async () => {
|
|
108
|
+
render(
|
|
109
|
+
<>
|
|
110
|
+
<Typeahead
|
|
111
|
+
id="test"
|
|
112
|
+
name="test"
|
|
113
|
+
options={[{ label: 'Option 1' }, { label: 'Option 2' }]}
|
|
114
|
+
minQueryLength={0}
|
|
115
|
+
onChange={() => {}}
|
|
116
|
+
/>
|
|
117
|
+
<button type="button">Next control</button>
|
|
118
|
+
</>,
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const input = screen.getByRole('combobox');
|
|
122
|
+
await userEvent.click(input);
|
|
123
|
+
await userEvent.tab();
|
|
124
|
+
|
|
125
|
+
expect(screen.getByRole('listbox')).toHaveFocus();
|
|
126
|
+
await userEvent.keyboard('{ArrowDown}');
|
|
127
|
+
expect(screen.getByRole('option', { name: 'Option 1' })).toHaveClass(
|
|
128
|
+
'tw-dropdown-item--focused',
|
|
129
|
+
);
|
|
130
|
+
expect(screen.getByRole('listbox')).toHaveFocus();
|
|
131
|
+
await userEvent.tab();
|
|
132
|
+
expect(screen.getByRole('button', { name: 'Next control' })).toHaveFocus();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('uses the active option style when hovering a suggestion', async () => {
|
|
136
|
+
render(
|
|
137
|
+
<Typeahead
|
|
138
|
+
id="test"
|
|
139
|
+
name="test"
|
|
140
|
+
options={[{ label: 'Option 1' }, { label: 'Option 2' }]}
|
|
141
|
+
minQueryLength={0}
|
|
142
|
+
onChange={() => {}}
|
|
143
|
+
/>,
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
await userEvent.click(screen.getByRole('combobox'));
|
|
147
|
+
await userEvent.hover(screen.getByRole('option', { name: 'Option 2' }));
|
|
148
|
+
|
|
149
|
+
expect(screen.getByRole('option', { name: 'Option 2' })).toHaveClass(
|
|
150
|
+
'tw-dropdown-item--focused',
|
|
151
|
+
);
|
|
152
|
+
});
|
|
153
|
+
|
|
77
154
|
it('shows clear button when there is a value', () => {
|
|
78
155
|
render(
|
|
79
156
|
<Typeahead
|
|
@@ -216,31 +216,15 @@ class Typeahead<T> extends Component<TypeaheadPropsWithInputAttributes<T>, Typea
|
|
|
216
216
|
};
|
|
217
217
|
|
|
218
218
|
handleOnKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {
|
|
219
|
-
const { showSuggestions, allowNew, multiple, chipSeparators
|
|
220
|
-
const {
|
|
219
|
+
const { showSuggestions, allowNew, multiple, chipSeparators } = this.props;
|
|
220
|
+
const { query, selected } = this.state;
|
|
221
221
|
const chipsMode = !showSuggestions && allowNew && multiple;
|
|
222
222
|
|
|
223
223
|
if (chipsMode && ['Enter', 'Tab', ...chipSeparators].includes(event.key) && query.trim()) {
|
|
224
224
|
event.preventDefault();
|
|
225
225
|
this.selectItem({ label: query });
|
|
226
|
-
} else {
|
|
226
|
+
} else if (!this.handleOptionNavigation(event)) {
|
|
227
227
|
switch (event.key) {
|
|
228
|
-
case 'ArrowDown':
|
|
229
|
-
event.preventDefault();
|
|
230
|
-
this.moveFocusedOption(1);
|
|
231
|
-
break;
|
|
232
|
-
case 'ArrowUp':
|
|
233
|
-
event.preventDefault();
|
|
234
|
-
this.moveFocusedOption(-1);
|
|
235
|
-
break;
|
|
236
|
-
case 'Enter':
|
|
237
|
-
event.preventDefault();
|
|
238
|
-
if (keyboardFocusedOptionIndex != null && options[keyboardFocusedOptionIndex]) {
|
|
239
|
-
this.selectItem(options[keyboardFocusedOptionIndex]);
|
|
240
|
-
} else if (allowNew && query.trim()) {
|
|
241
|
-
this.selectItem({ label: query });
|
|
242
|
-
}
|
|
243
|
-
break;
|
|
244
228
|
case 'Backspace':
|
|
245
229
|
if (multiple && !query && selected.length > 0) {
|
|
246
230
|
this.updateSelectedValue(selected.slice(0, -1));
|
|
@@ -251,6 +235,36 @@ class Typeahead<T> extends Component<TypeaheadPropsWithInputAttributes<T>, Typea
|
|
|
251
235
|
}
|
|
252
236
|
}
|
|
253
237
|
};
|
|
238
|
+
|
|
239
|
+
handleOptionListKeyDown: React.KeyboardEventHandler<HTMLUListElement> = (event) => {
|
|
240
|
+
this.handleOptionNavigation(event);
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
handleOptionNavigation(event: React.KeyboardEvent<HTMLElement>) {
|
|
244
|
+
const { allowNew, options } = this.props;
|
|
245
|
+
const { keyboardFocusedOptionIndex, query } = this.state;
|
|
246
|
+
|
|
247
|
+
switch (event.key) {
|
|
248
|
+
case 'ArrowDown':
|
|
249
|
+
event.preventDefault();
|
|
250
|
+
this.moveFocusedOption(1);
|
|
251
|
+
return true;
|
|
252
|
+
case 'ArrowUp':
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
this.moveFocusedOption(-1);
|
|
255
|
+
return true;
|
|
256
|
+
case 'Enter':
|
|
257
|
+
event.preventDefault();
|
|
258
|
+
if (keyboardFocusedOptionIndex != null && options[keyboardFocusedOptionIndex]) {
|
|
259
|
+
this.selectItem(options[keyboardFocusedOptionIndex]);
|
|
260
|
+
} else if (allowNew && query.trim()) {
|
|
261
|
+
this.selectItem({ label: query });
|
|
262
|
+
}
|
|
263
|
+
return true;
|
|
264
|
+
default:
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
254
268
|
moveFocusedOption(offset: number) {
|
|
255
269
|
this.setState((previousState) => {
|
|
256
270
|
const { keyboardFocusedOptionIndex } = previousState;
|
|
@@ -261,7 +275,7 @@ class Typeahead<T> extends Component<TypeaheadPropsWithInputAttributes<T>, Typea
|
|
|
261
275
|
}
|
|
262
276
|
const optionRef = this.optionRefs[index];
|
|
263
277
|
if (optionRef?.current) {
|
|
264
|
-
optionRef.current.
|
|
278
|
+
optionRef.current.scrollIntoView({ block: 'nearest' });
|
|
265
279
|
}
|
|
266
280
|
return {
|
|
267
281
|
keyboardFocusedOptionIndex: index,
|
|
@@ -269,6 +283,10 @@ class Typeahead<T> extends Component<TypeaheadPropsWithInputAttributes<T>, Typea
|
|
|
269
283
|
});
|
|
270
284
|
}
|
|
271
285
|
|
|
286
|
+
setFocusedOption = (index: number) => {
|
|
287
|
+
this.setState({ keyboardFocusedOptionIndex: index });
|
|
288
|
+
};
|
|
289
|
+
|
|
272
290
|
selectItem = (item: TypeaheadOption<T>) => {
|
|
273
291
|
const { multiple } = this.props;
|
|
274
292
|
let selected = [...this.state.selected];
|
|
@@ -423,12 +441,16 @@ class Typeahead<T> extends Component<TypeaheadPropsWithInputAttributes<T>, Typea
|
|
|
423
441
|
});
|
|
424
442
|
}
|
|
425
443
|
return (
|
|
426
|
-
<div
|
|
427
|
-
className={clsx('dropdown btn-group btn-block', { open: dropdownOpen })}
|
|
428
|
-
id={`menu-${id}`}
|
|
429
|
-
>
|
|
444
|
+
<div className={clsx('dropdown btn-group btn-block', { open: dropdownOpen })}>
|
|
430
445
|
{(!!optionsToRender.length || footer) && (
|
|
431
|
-
<ul
|
|
446
|
+
<ul
|
|
447
|
+
className="dropdown-menu"
|
|
448
|
+
id={`menu-${id}`}
|
|
449
|
+
role="listbox"
|
|
450
|
+
aria-label={this.props?.intl?.formatMessage(messages.suggestionsLabel)}
|
|
451
|
+
tabIndex={0}
|
|
452
|
+
onKeyDown={this.handleOptionListKeyDown}
|
|
453
|
+
>
|
|
432
454
|
{optionsToRender.map((option, idx) => {
|
|
433
455
|
const ref = React.createRef<HTMLLIElement>();
|
|
434
456
|
this.optionRefs[idx] = ref;
|
|
@@ -439,7 +461,8 @@ class Typeahead<T> extends Component<TypeaheadPropsWithInputAttributes<T>, Typea
|
|
|
439
461
|
query={query}
|
|
440
462
|
option={option}
|
|
441
463
|
selected={keyboardFocusedOptionIndex === idx}
|
|
442
|
-
id={
|
|
464
|
+
id={`${id}-${idx}`}
|
|
465
|
+
onMouseEnter={() => this.setFocusedOption(idx)}
|
|
443
466
|
onClick={(event) => {
|
|
444
467
|
this.onOptionSelected(event, option);
|
|
445
468
|
}}
|
|
@@ -554,7 +577,7 @@ class Typeahead<T> extends Component<TypeaheadPropsWithInputAttributes<T>, Typea
|
|
|
554
577
|
autoComplete={inputAutoComplete}
|
|
555
578
|
ariaActivedescendant={
|
|
556
579
|
keyboardFocusedOptionIndex !== null && options[keyboardFocusedOptionIndex]
|
|
557
|
-
? `option-${
|
|
580
|
+
? `option-${id}-${keyboardFocusedOptionIndex}`
|
|
558
581
|
: undefined
|
|
559
582
|
}
|
|
560
583
|
onChange={this.handleOnChange}
|
|
@@ -82,7 +82,7 @@ export default class TypeaheadInput<T> extends Component<
|
|
|
82
82
|
onFocus,
|
|
83
83
|
onPaste,
|
|
84
84
|
autoComplete,
|
|
85
|
-
ariaActivedescendant,
|
|
85
|
+
ariaActivedescendant,
|
|
86
86
|
} = this.props;
|
|
87
87
|
const { inputWidth } = this.state;
|
|
88
88
|
|
|
@@ -93,11 +93,7 @@ export default class TypeaheadInput<T> extends Component<
|
|
|
93
93
|
className={clsx(multiple && 'typeahead__input')}
|
|
94
94
|
name={name}
|
|
95
95
|
id={`input-${typeaheadId}`}
|
|
96
|
-
aria-activedescendant={
|
|
97
|
-
ariaActivedescendant
|
|
98
|
-
? `menu-${typeaheadId} ${ariaActivedescendant}`
|
|
99
|
-
: `menu-${typeaheadId}`
|
|
100
|
-
}
|
|
96
|
+
aria-activedescendant={ariaActivedescendant}
|
|
101
97
|
autoFocus={autoFocus}
|
|
102
98
|
placeholder={hasPlaceholder ? placeholder : ''}
|
|
103
99
|
aria-autocomplete="list"
|
|
@@ -7,3 +7,8 @@
|
|
|
7
7
|
border-radius: 10px;
|
|
8
8
|
border-radius: var(--radius-small);
|
|
9
9
|
}
|
|
10
|
+
.dropdown-menu > li.typeahead__option:not(.active):not(.selected) > .dropdown-item:not([disabled]):not(.disabled):hover,
|
|
11
|
+
.dropdown-menu > li.typeahead__option:not(.active):not(.selected) > .dropdown-item:not([disabled]):not(.disabled):focus,
|
|
12
|
+
.dropdown-menu > li.typeahead__option:not(.active):not(.selected) > .dropdown-item:not([disabled]):not(.disabled):active {
|
|
13
|
+
box-shadow: none;
|
|
14
|
+
}
|
|
@@ -8,12 +8,13 @@ export type TypeaheadOptionProps<T> = {
|
|
|
8
8
|
option: TypeaheadOption<T>;
|
|
9
9
|
selected?: boolean;
|
|
10
10
|
onClick?: React.MouseEventHandler;
|
|
11
|
+
onMouseEnter?: React.MouseEventHandler;
|
|
11
12
|
query?: string;
|
|
12
13
|
id?: string;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
const Option = forwardRef<HTMLLIElement, TypeaheadOptionProps<any>>((props, ref) => {
|
|
16
|
-
const { option, selected = false, onClick = () => {}, query = '', id } = props;
|
|
17
|
+
const { option, selected = false, onClick = () => {}, onMouseEnter, query = '', id } = props;
|
|
17
18
|
const { label, note, secondary } = option;
|
|
18
19
|
|
|
19
20
|
return (
|
|
@@ -25,8 +26,9 @@ const Option = forwardRef<HTMLLIElement, TypeaheadOptionProps<any>>((props, ref)
|
|
|
25
26
|
className={clsx('typeahead__option tw-dropdown-item clickable', {
|
|
26
27
|
'tw-dropdown-item--focused': selected,
|
|
27
28
|
})}
|
|
29
|
+
onMouseEnter={onMouseEnter}
|
|
28
30
|
>
|
|
29
|
-
<a className="dropdown-item" href="#" tabIndex={
|
|
31
|
+
<a className="dropdown-item" href="#" tabIndex={-1} onClick={onClick}>
|
|
30
32
|
<Highlight value={label} query={query} />
|
|
31
33
|
{note && <span className="np-text-body-default m-l-1">{note}</span>}
|
|
32
34
|
{secondary && (
|
package/src/i18n/en.json
CHANGED
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
"neptune.DateLookup.goTo20YearView": "Go to 20 year view",
|
|
13
13
|
"neptune.DateLookup.month": "month",
|
|
14
14
|
"neptune.DateLookup.next": "next",
|
|
15
|
+
"neptune.DateLookup.notAvailable": "not available",
|
|
16
|
+
"neptune.DateLookup.outOfRangeAfter": "Please enter {min} or a later date.",
|
|
17
|
+
"neptune.DateLookup.outOfRangeBefore": "Please enter {max} or an earlier date.",
|
|
18
|
+
"neptune.DateLookup.outOfRangeBetween": "Please select a date between {min} and {max}.",
|
|
15
19
|
"neptune.DateLookup.previous": "previous",
|
|
16
20
|
"neptune.DateLookup.selected": "selected",
|
|
17
21
|
"neptune.DateLookup.twentyYears": "20 years",
|
package/src/i18n/hu.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"neptune.Field.characterCount": "Felhasználva {current}/{max} karakter",
|
|
24
24
|
"neptune.FlowNavigation.back": "vissza az előző lépéshez",
|
|
25
25
|
"neptune.Info.ariaLabel": "További információ",
|
|
26
|
-
"neptune.Label.optional": "(
|
|
26
|
+
"neptune.Label.optional": "(Választható)",
|
|
27
27
|
"neptune.Link.opensInNewTab": "(új lapon nyílik meg)",
|
|
28
28
|
"neptune.MoneyInput.Select.placeholder": "Válassz ki egy lehetőséget...",
|
|
29
29
|
"neptune.MoneyInput.Select.searchPlaceholder": "Írj be egy pénznemet vagy országot",
|
package/src/index.ts
CHANGED
|
@@ -26,6 +26,8 @@ export type {
|
|
|
26
26
|
AnchorElementProps,
|
|
27
27
|
} from './Button';
|
|
28
28
|
export type { BodyProps } from './Body';
|
|
29
|
+
export type { CalendarProps } from './Calendar';
|
|
30
|
+
export type { DisabledRules, WeekDayType, DisabledDateRange } from './Calendar';
|
|
29
31
|
export type { CardProps } from './_deprecated/Card';
|
|
30
32
|
export type {
|
|
31
33
|
CarouselProps,
|
|
@@ -56,7 +58,6 @@ export type {
|
|
|
56
58
|
export type { BottomSheetProps } from './common/BottomSheet';
|
|
57
59
|
export type { DateInputProps } from './DateInput';
|
|
58
60
|
export type { DateLookupProps } from './DateLookup';
|
|
59
|
-
export type { CalendarProps } from './Calendar';
|
|
60
61
|
export type { DecisionProps } from './Decision';
|
|
61
62
|
export type {
|
|
62
63
|
DefinitionListProps,
|
|
@@ -94,6 +95,7 @@ export type { LegacyListItemProps } from './_deprecated/LegacyListItem';
|
|
|
94
95
|
export type { LinkProps } from './Link';
|
|
95
96
|
export type { LoaderProps } from './Loader';
|
|
96
97
|
export type { MarkdownProps } from './Markdown';
|
|
98
|
+
export type { MarkupActionHandler, MarkupActions, MarkupNode, MarkupProps } from './Markup';
|
|
97
99
|
export type { ModalProps } from './Modal';
|
|
98
100
|
export type { MoneyProps } from './Money';
|
|
99
101
|
export type {
|
|
@@ -205,6 +207,7 @@ export { default as Badge, BadgeAssets } from './_deprecated/Badge';
|
|
|
205
207
|
export { default as Body } from './Body';
|
|
206
208
|
export { default as Button } from './Button';
|
|
207
209
|
export { default as IconButton } from './IconButton';
|
|
210
|
+
export { default as Calendar } from './Calendar';
|
|
208
211
|
export { default as Carousel } from './Carousel';
|
|
209
212
|
export { default as Card } from './_deprecated/Card';
|
|
210
213
|
export { default as Checkbox } from './Checkbox';
|
|
@@ -220,7 +223,6 @@ export { default as BaseCard } from './common/BaseCard';
|
|
|
220
223
|
export { default as CriticalCommsBanner } from './_deprecated/CriticalBanner';
|
|
221
224
|
export { default as DateInput } from './DateInput';
|
|
222
225
|
export { default as DateLookup } from './DateLookup';
|
|
223
|
-
export { default as Calendar } from './Calendar';
|
|
224
226
|
export { default as Decision } from './Decision';
|
|
225
227
|
export { default as DefinitionList } from './DefinitionList';
|
|
226
228
|
export { default as Dimmer } from './Dimmer';
|
|
@@ -253,6 +255,7 @@ export { default as LegacyListItem } from './_deprecated/LegacyListItem';
|
|
|
253
255
|
export { default as Loader } from './Loader';
|
|
254
256
|
export { default as Logo } from './Logo';
|
|
255
257
|
export { default as Markdown } from './Markdown';
|
|
258
|
+
export { default as Markup } from './Markup';
|
|
256
259
|
export { default as Modal } from './Modal';
|
|
257
260
|
export { default as Money } from './Money';
|
|
258
261
|
export { default as MoneyInput } from './MoneyInput';
|
package/src/main.css
CHANGED
|
@@ -27269,46 +27269,12 @@ a[data-toggle="tooltip"] {
|
|
|
27269
27269
|
pointer-events: auto;
|
|
27270
27270
|
}
|
|
27271
27271
|
|
|
27272
|
-
.
|
|
27273
|
-
|
|
27274
|
-
|
|
27275
|
-
table-layout: fixed;
|
|
27276
|
-
border: none;
|
|
27277
|
-
background-color: inherit;
|
|
27278
|
-
}
|
|
27279
|
-
|
|
27280
|
-
.tw-date-lookup-calendar thead {
|
|
27281
|
-
background-color: transparent;
|
|
27282
|
-
background-color: initial;
|
|
27283
|
-
}
|
|
27284
|
-
|
|
27285
|
-
.tw-date-lookup-calendar > tbody > tr > td.weekend button {
|
|
27286
|
-
color: #5d7079;
|
|
27287
|
-
color: var(--color-content-secondary);
|
|
27288
|
-
}
|
|
27289
|
-
|
|
27290
|
-
.tw-date-lookup-calendar > tbody > tr > td {
|
|
27291
|
-
border: none;
|
|
27292
|
-
padding: 4px;
|
|
27293
|
-
padding: var(--size-4);
|
|
27294
|
-
}
|
|
27295
|
-
|
|
27296
|
-
@media (max-width: 320px) {
|
|
27297
|
-
.tw-date-lookup-calendar > tbody > tr > td {
|
|
27298
|
-
padding: 0;
|
|
27299
|
-
}
|
|
27300
|
-
}
|
|
27301
|
-
|
|
27302
|
-
.tw-date-lookup-calendar > tbody > tr > td:has(.tw-date-lookup-day-option) {
|
|
27303
|
-
padding: 1px;
|
|
27304
|
-
}
|
|
27305
|
-
|
|
27306
|
-
.tw-date-lookup-calendar > tbody > tr > td button {
|
|
27272
|
+
.wds-Calendar__option--day,
|
|
27273
|
+
.wds-Calendar__option--month,
|
|
27274
|
+
.wds-Calendar__option--year {
|
|
27307
27275
|
width: 100%;
|
|
27308
27276
|
padding: 4px 0;
|
|
27309
27277
|
padding: var(--size-4) 0;
|
|
27310
|
-
color: #0097c7;
|
|
27311
|
-
color: var(--color-content-accent);
|
|
27312
27278
|
border: transparent;
|
|
27313
27279
|
border-radius: 10px;
|
|
27314
27280
|
border-radius: var(--radius-small);
|
|
@@ -27320,12 +27286,92 @@ a[data-toggle="tooltip"] {
|
|
|
27320
27286
|
}
|
|
27321
27287
|
|
|
27322
27288
|
@media (max-width: 320px) {
|
|
27323
|
-
.
|
|
27289
|
+
.wds-Calendar__option--day,
|
|
27290
|
+
.wds-Calendar__option--month,
|
|
27291
|
+
.wds-Calendar__option--year {
|
|
27324
27292
|
padding: 0;
|
|
27325
27293
|
}
|
|
27326
27294
|
}
|
|
27327
27295
|
|
|
27328
|
-
.
|
|
27296
|
+
.wds-Calendar__option--day:focus,
|
|
27297
|
+
.wds-Calendar__option--month:focus,
|
|
27298
|
+
.wds-Calendar__option--year:focus {
|
|
27299
|
+
background-color: var(--color-background-screen-hover);
|
|
27300
|
+
}
|
|
27301
|
+
|
|
27302
|
+
.wds-Calendar__option--day.disabled,
|
|
27303
|
+
.wds-Calendar__option--month.disabled,
|
|
27304
|
+
.wds-Calendar__option--year.disabled,
|
|
27305
|
+
.wds-Calendar__option--day[aria-disabled="true"],
|
|
27306
|
+
.wds-Calendar__option--month[aria-disabled="true"],
|
|
27307
|
+
.wds-Calendar__option--year[aria-disabled="true"] {
|
|
27308
|
+
--ring-outline-color: var(--color-sentiment-content-primary);
|
|
27309
|
+
color: #768e9c;
|
|
27310
|
+
color: var(--color-content-tertiary);
|
|
27311
|
+
cursor: not-allowed;
|
|
27312
|
+
}
|
|
27313
|
+
|
|
27314
|
+
.wds-Calendar__option--day.disabled:hover,
|
|
27315
|
+
.wds-Calendar__option--month.disabled:hover,
|
|
27316
|
+
.wds-Calendar__option--year.disabled:hover,
|
|
27317
|
+
.wds-Calendar__option--day[aria-disabled="true"]:hover,
|
|
27318
|
+
.wds-Calendar__option--month[aria-disabled="true"]:hover,
|
|
27319
|
+
.wds-Calendar__option--year[aria-disabled="true"]:hover,
|
|
27320
|
+
.wds-Calendar__option--day.disabled:focus,
|
|
27321
|
+
.wds-Calendar__option--month.disabled:focus,
|
|
27322
|
+
.wds-Calendar__option--year.disabled:focus,
|
|
27323
|
+
.wds-Calendar__option--day[aria-disabled="true"]:focus,
|
|
27324
|
+
.wds-Calendar__option--month[aria-disabled="true"]:focus,
|
|
27325
|
+
.wds-Calendar__option--year[aria-disabled="true"]:focus {
|
|
27326
|
+
filter: initial;
|
|
27327
|
+
opacity: 1;
|
|
27328
|
+
opacity: initial;
|
|
27329
|
+
background-color: var(--color-sentiment-background-surface);
|
|
27330
|
+
color: var(--color-sentiment-content-primary);
|
|
27331
|
+
}
|
|
27332
|
+
|
|
27333
|
+
.wds-Calendar__option--day.disabled.active,
|
|
27334
|
+
.wds-Calendar__option--month.disabled.active,
|
|
27335
|
+
.wds-Calendar__option--year.disabled.active,
|
|
27336
|
+
.wds-Calendar__option--day[aria-disabled="true"].active,
|
|
27337
|
+
.wds-Calendar__option--month[aria-disabled="true"].active,
|
|
27338
|
+
.wds-Calendar__option--year[aria-disabled="true"].active,
|
|
27339
|
+
.wds-Calendar__option--day.disabled.active:hover,
|
|
27340
|
+
.wds-Calendar__option--month.disabled.active:hover,
|
|
27341
|
+
.wds-Calendar__option--year.disabled.active:hover,
|
|
27342
|
+
.wds-Calendar__option--day[aria-disabled="true"].active:hover,
|
|
27343
|
+
.wds-Calendar__option--month[aria-disabled="true"].active:hover,
|
|
27344
|
+
.wds-Calendar__option--year[aria-disabled="true"].active:hover,
|
|
27345
|
+
.wds-Calendar__option--day.disabled.active:active,
|
|
27346
|
+
.wds-Calendar__option--month.disabled.active:active,
|
|
27347
|
+
.wds-Calendar__option--year.disabled.active:active,
|
|
27348
|
+
.wds-Calendar__option--day[aria-disabled="true"].active:active,
|
|
27349
|
+
.wds-Calendar__option--month[aria-disabled="true"].active:active,
|
|
27350
|
+
.wds-Calendar__option--year[aria-disabled="true"].active:active,
|
|
27351
|
+
.wds-Calendar__option--day.disabled.active:focus,
|
|
27352
|
+
.wds-Calendar__option--month.disabled.active:focus,
|
|
27353
|
+
.wds-Calendar__option--year.disabled.active:focus,
|
|
27354
|
+
.wds-Calendar__option--day[aria-disabled="true"].active:focus,
|
|
27355
|
+
.wds-Calendar__option--month[aria-disabled="true"].active:focus,
|
|
27356
|
+
.wds-Calendar__option--year[aria-disabled="true"].active:focus {
|
|
27357
|
+
filter: initial;
|
|
27358
|
+
opacity: 1;
|
|
27359
|
+
opacity: initial;
|
|
27360
|
+
background-color: var(--color-sentiment-interactive-primary);
|
|
27361
|
+
color: var(--color-sentiment-interactive-secondary);
|
|
27362
|
+
}
|
|
27363
|
+
|
|
27364
|
+
.wds-Calendar__option--day.disabled.today,
|
|
27365
|
+
.wds-Calendar__option--month.disabled.today,
|
|
27366
|
+
.wds-Calendar__option--year.disabled.today,
|
|
27367
|
+
.wds-Calendar__option--day[aria-disabled="true"].today,
|
|
27368
|
+
.wds-Calendar__option--month[aria-disabled="true"].today,
|
|
27369
|
+
.wds-Calendar__option--year[aria-disabled="true"].today {
|
|
27370
|
+
text-decoration-color: #768e9c;
|
|
27371
|
+
text-decoration-color: var(--color-content-tertiary);
|
|
27372
|
+
}
|
|
27373
|
+
|
|
27374
|
+
.wds-Calendar__option--day {
|
|
27329
27375
|
height: 40px;
|
|
27330
27376
|
height: var(--size-40);
|
|
27331
27377
|
border-radius: 9999px;
|
|
@@ -27340,19 +27386,53 @@ a[data-toggle="tooltip"] {
|
|
|
27340
27386
|
justify-content: center;
|
|
27341
27387
|
}
|
|
27342
27388
|
|
|
27343
|
-
.
|
|
27389
|
+
.wds-Calendar__option--day.today {
|
|
27344
27390
|
-webkit-text-decoration: underline;
|
|
27345
27391
|
text-decoration: underline;
|
|
27346
27392
|
text-decoration-thickness: 2px;
|
|
27347
27393
|
text-underline-offset: 4px;
|
|
27348
27394
|
}
|
|
27349
27395
|
|
|
27350
|
-
.tw-date-lookup-calendar
|
|
27351
|
-
|
|
27396
|
+
.tw-date-lookup-calendar {
|
|
27397
|
+
min-width: 300px;
|
|
27398
|
+
text-align: center;
|
|
27399
|
+
table-layout: fixed;
|
|
27400
|
+
border: none;
|
|
27401
|
+
background-color: inherit;
|
|
27402
|
+
}
|
|
27403
|
+
|
|
27404
|
+
.tw-date-lookup-calendar thead {
|
|
27405
|
+
background-color: transparent;
|
|
27406
|
+
background-color: initial;
|
|
27407
|
+
}
|
|
27408
|
+
|
|
27409
|
+
.tw-date-lookup-calendar > tbody > tr > td.weekend button {
|
|
27410
|
+
color: #5d7079;
|
|
27411
|
+
color: var(--color-content-secondary);
|
|
27412
|
+
}
|
|
27413
|
+
|
|
27414
|
+
.tw-date-lookup-calendar > tbody > tr > td {
|
|
27415
|
+
border: none;
|
|
27416
|
+
padding: 4px;
|
|
27417
|
+
padding: var(--size-4);
|
|
27418
|
+
}
|
|
27419
|
+
|
|
27420
|
+
@media (max-width: 320px) {
|
|
27421
|
+
.tw-date-lookup-calendar > tbody > tr > td {
|
|
27422
|
+
padding: 0;
|
|
27423
|
+
}
|
|
27424
|
+
}
|
|
27425
|
+
|
|
27426
|
+
.tw-date-lookup-calendar > tbody > tr > td:has(.wds-Calendar__option--day) {
|
|
27427
|
+
padding: 1px;
|
|
27428
|
+
}
|
|
27429
|
+
|
|
27430
|
+
.tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.show-focus:not(.disabled):not([aria-disabled="true"]),
|
|
27431
|
+
.tw-date-lookup-calendar > tbody > tr > td:hover button:not(.disabled):not(:disabled):not([aria-disabled="true"]) {
|
|
27352
27432
|
background-color: var(--color-background-screen-hover);
|
|
27353
27433
|
}
|
|
27354
27434
|
|
|
27355
|
-
.tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.active {
|
|
27435
|
+
.tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.active:not([aria-disabled="true"]) {
|
|
27356
27436
|
background-color: var(--color-interactive-primary);
|
|
27357
27437
|
color: var(--color-interactive-contrast);
|
|
27358
27438
|
}
|
|
@@ -30917,6 +30997,41 @@ button.np-link {
|
|
|
30917
30997
|
height: var(--wds-logo-height);
|
|
30918
30998
|
}
|
|
30919
30999
|
|
|
31000
|
+
.wds-markup-emphasis {
|
|
31001
|
+
font-weight: 600;
|
|
31002
|
+
font-weight: var(--font-weight-semi-bold);
|
|
31003
|
+
font-style: normal;
|
|
31004
|
+
}
|
|
31005
|
+
|
|
31006
|
+
.wds-markup-emphasis--important {
|
|
31007
|
+
color: #37517e;
|
|
31008
|
+
color: var(--color-content-primary);
|
|
31009
|
+
}
|
|
31010
|
+
|
|
31011
|
+
.wds-markup-emphasis--positive {
|
|
31012
|
+
color: #008026;
|
|
31013
|
+
color: var(--color-content-positive);
|
|
31014
|
+
}
|
|
31015
|
+
|
|
31016
|
+
.wds-markup-emphasis--negative {
|
|
31017
|
+
color: #cf2929;
|
|
31018
|
+
color: var(--color-content-negative);
|
|
31019
|
+
}
|
|
31020
|
+
|
|
31021
|
+
.wds-markup-strong {
|
|
31022
|
+
font-weight: 600;
|
|
31023
|
+
font-weight: var(--font-weight-semi-bold);
|
|
31024
|
+
}
|
|
31025
|
+
|
|
31026
|
+
.wds-markup-strikethrough {
|
|
31027
|
+
-webkit-text-decoration: line-through;
|
|
31028
|
+
text-decoration: line-through;
|
|
31029
|
+
}
|
|
31030
|
+
|
|
31031
|
+
.wds-markup-paragraph {
|
|
31032
|
+
margin: 0;
|
|
31033
|
+
}
|
|
31034
|
+
|
|
30920
31035
|
.tw-modal--scrollable {
|
|
30921
31036
|
max-height: 100%;
|
|
30922
31037
|
/* mobile viewport bug fix */
|
|
@@ -34087,6 +34202,10 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
34087
34202
|
.typeahead .dropdown-menu {
|
|
34088
34203
|
max-width: 100%;
|
|
34089
34204
|
width: 100%;
|
|
34205
|
+
scroll-padding-top: 8px;
|
|
34206
|
+
scroll-padding-top: var(--size-8);
|
|
34207
|
+
scroll-padding-bottom: 8px;
|
|
34208
|
+
scroll-padding-bottom: var(--size-8);
|
|
34090
34209
|
}
|
|
34091
34210
|
|
|
34092
34211
|
.np-theme-personal--forest-green .typeahead .dropdown-menu,
|
|
@@ -34313,6 +34432,12 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
34313
34432
|
border-radius: var(--radius-small);
|
|
34314
34433
|
}
|
|
34315
34434
|
|
|
34435
|
+
.dropdown-menu > li.typeahead__option:not(.active):not(.selected) > .dropdown-item:not([disabled]):not(.disabled):hover,
|
|
34436
|
+
.dropdown-menu > li.typeahead__option:not(.active):not(.selected) > .dropdown-item:not([disabled]):not(.disabled):focus,
|
|
34437
|
+
.dropdown-menu > li.typeahead__option:not(.active):not(.selected) > .dropdown-item:not([disabled]):not(.disabled):active {
|
|
34438
|
+
box-shadow: none;
|
|
34439
|
+
}
|
|
34440
|
+
|
|
34316
34441
|
.tw-droppable-lg {
|
|
34317
34442
|
min-height: 346px;
|
|
34318
34443
|
}
|
package/src/main.less
CHANGED
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
@import "./Link/Link.less";
|
|
57
57
|
@import "./Loader/Loader.less";
|
|
58
58
|
@import "./Logo/Logo.less";
|
|
59
|
+
@import "./Markup/Markup.less";
|
|
59
60
|
@import "./Modal/Modal.less";
|
|
60
61
|
@import "./MoneyInput/MoneyInput.less";
|
|
61
62
|
@import "./ExpressiveMoneyInput/ExpressiveMoneyInput.less";
|