@transferwise/components 46.122.1 → 46.123.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/inputs/SelectInput.js +32 -1
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +32 -1
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/main.css +97 -77
- package/build/prompt/InlinePrompt/InlinePrompt.js +8 -10
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +9 -11
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +45 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +43 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -0
- package/build/styles/main.css +97 -77
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +2 -23
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +41 -0
- package/build/types/inputs/SelectInput.d.ts +2 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts +1 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -1
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +30 -0
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -0
- package/build/types/prompt/PrimitivePrompt/index.d.ts +3 -0
- package/build/types/prompt/PrimitivePrompt/index.d.ts.map +1 -0
- package/package.json +8 -8
- package/src/alert/Alert.tests.story.tsx +1 -0
- package/src/button/_stories/Button.brightGreen.tests.story.tsx +1 -1
- package/src/button/_stories/Button.dark.tests.story.tsx +1 -1
- package/src/button/_stories/Button.default.tests.story.tsx +1 -1
- package/src/button/_stories/Button.forestGreen.tests.story.tsx +1 -1
- package/src/button/_stories/Button.tests.story.tsx +1 -1
- package/src/circularButton/CircularButton.tests.story.tsx +1 -0
- package/src/dateInput/DateInput.tests.story.tsx +1 -0
- package/src/dateLookup/DateLookup.tests.story.tsx +1 -0
- package/src/header/Header.tests.story.tsx +1 -1
- package/src/inputs/SelectInput.spec.tsx +54 -0
- package/src/inputs/SelectInput.story.tsx +68 -0
- package/src/inputs/SelectInput.tsx +57 -6
- package/src/legacylistItem/LegacyListItem.tests.story.tsx +1 -1
- package/src/listItem/ListItem.spec.tsx +6 -8
- package/src/listItem/_stories/ListItem.focus.test.story.tsx +1 -1
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.brightGreen.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.dark.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.forestGreen.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.medium.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.neutral.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.personal.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.rtl.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.small.test.story.tsx +1 -1
- package/src/main.css +97 -77
- package/src/main.less +2 -1
- package/src/prompt/InlinePrompt/InlinePrompt.css +2 -23
- package/src/prompt/InlinePrompt/InlinePrompt.less +3 -18
- package/src/prompt/InlinePrompt/InlinePrompt.spec.tsx +6 -6
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +6 -7
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +41 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +37 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +70 -0
- package/src/prompt/PrimitivePrompt/index.ts +2 -0
- package/src/radioGroup/RadioGroup.test.story.tsx +1 -1
- package/src/sentimentSurface/SentimentSurface.tests.story.tsx +1 -1
- package/src/snackbar/Snackbar.tests.story.tsx +1 -1
- package/src/stepper/Stepper.tests.story.tsx +1 -0
- package/src/summary/Summary.tests.story.tsx +1 -0
- package/src/title/Title.test.story.tsx +1 -0
- package/src/upload/Upload.tests.story.tsx +1 -0
- package/src/uploadInput/UploadInput.tests.story.tsx +1 -0
- package/src/withId/withId.story.tsx +1 -1
|
@@ -386,6 +386,60 @@ describe('SelectInput', () => {
|
|
|
386
386
|
expect(within(listbox).getByText('Item Two')).toBeInTheDocument();
|
|
387
387
|
});
|
|
388
388
|
|
|
389
|
+
it('sorts filtered options using sortFilteredOptions prop', async () => {
|
|
390
|
+
interface Country {
|
|
391
|
+
code: string;
|
|
392
|
+
name: string;
|
|
393
|
+
keywords: string[];
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
const countries: Country[] = [
|
|
397
|
+
{ code: 'AD', name: 'Andorra', keywords: ['united states dollar'] },
|
|
398
|
+
{ code: 'DE', name: 'Germany', keywords: ['EUR'] },
|
|
399
|
+
{ code: 'US', name: 'United States', keywords: ['United States dollar', 'USD'] },
|
|
400
|
+
{ code: 'ZM', name: 'Zambia', keywords: ['USD', 'united states dollar'] },
|
|
401
|
+
];
|
|
402
|
+
|
|
403
|
+
render(
|
|
404
|
+
<SelectInput<Country>
|
|
405
|
+
items={countries.map((country) => ({
|
|
406
|
+
type: 'option',
|
|
407
|
+
value: country,
|
|
408
|
+
filterMatchers: country.keywords,
|
|
409
|
+
}))}
|
|
410
|
+
renderValue={(country) => country.name}
|
|
411
|
+
filterable
|
|
412
|
+
sortFilteredOptions={(a, b, searchQuery) => {
|
|
413
|
+
const query = searchQuery.toLowerCase();
|
|
414
|
+
const nameA = a.value.name.toLowerCase();
|
|
415
|
+
const nameB = b.value.name.toLowerCase();
|
|
416
|
+
|
|
417
|
+
const aMatch = nameA.includes(query);
|
|
418
|
+
const bMatch = nameB.includes(query);
|
|
419
|
+
|
|
420
|
+
if (aMatch && !bMatch) return -1;
|
|
421
|
+
if (!aMatch && bMatch) return 1;
|
|
422
|
+
|
|
423
|
+
return nameA.localeCompare(nameB);
|
|
424
|
+
}}
|
|
425
|
+
/>,
|
|
426
|
+
);
|
|
427
|
+
|
|
428
|
+
const trigger = screen.getByRole('combobox');
|
|
429
|
+
await userEvent.click(trigger);
|
|
430
|
+
|
|
431
|
+
const searchInput = screen.getByRole('combobox', { expanded: true });
|
|
432
|
+
await userEvent.type(searchInput, 'united');
|
|
433
|
+
|
|
434
|
+
const listbox = screen.getByRole('listbox');
|
|
435
|
+
const options = within(listbox).getAllByRole('option');
|
|
436
|
+
|
|
437
|
+
expect(options).toHaveLength(3);
|
|
438
|
+
expect(options[0]).toHaveTextContent('United States');
|
|
439
|
+
expect(options[1]).toHaveTextContent('Andorra');
|
|
440
|
+
expect(options[2]).toHaveTextContent('Zambia');
|
|
441
|
+
});
|
|
442
|
+
|
|
389
443
|
describe('listbox label', () => {
|
|
390
444
|
const fieldLabel = 'Fruits';
|
|
391
445
|
const triggerLabel = 'Select fruit';
|
|
@@ -616,3 +616,71 @@ export const WithAutocomplete: Story<string> = {
|
|
|
616
616
|
);
|
|
617
617
|
},
|
|
618
618
|
};
|
|
619
|
+
|
|
620
|
+
interface CountryWithCurrency extends Country {
|
|
621
|
+
keywords: string[];
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
const countriesWithCurrency: CountryWithCurrency[] = [
|
|
625
|
+
{ code: 'AD', name: 'Andorra', keywords: ['united states dollar'] },
|
|
626
|
+
{ code: 'DE', name: 'Germany', keywords: ['EUR'] },
|
|
627
|
+
{ code: 'US', name: 'United States', keywords: ['USD'] },
|
|
628
|
+
{ code: 'ZM', name: 'Zambia', keywords: ['USD', 'united states dollar'] },
|
|
629
|
+
];
|
|
630
|
+
|
|
631
|
+
function countryWithCurrencyOption(country: CountryWithCurrency) {
|
|
632
|
+
return {
|
|
633
|
+
type: 'option',
|
|
634
|
+
value: country,
|
|
635
|
+
filterMatchers: [country.name, country.code, ...country.keywords],
|
|
636
|
+
} satisfies SelectInputItem<CountryWithCurrency>;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
export const WithCustomSearchResultSorting: Story<CountryWithCurrency> = {
|
|
640
|
+
args: {
|
|
641
|
+
items: countriesWithCurrency.map(countryWithCurrencyOption),
|
|
642
|
+
compareValues: 'code',
|
|
643
|
+
renderValue: (country) => (
|
|
644
|
+
<SelectInputOptionContent
|
|
645
|
+
title={country.name}
|
|
646
|
+
icon={<Flag code={country.code} intrinsicSize={24} />}
|
|
647
|
+
/>
|
|
648
|
+
),
|
|
649
|
+
value: countriesWithCurrency[0],
|
|
650
|
+
filterable: true,
|
|
651
|
+
filterPlaceholder: 'Type a currency / country',
|
|
652
|
+
sortFilteredOptions: (a, b, searchQuery) => {
|
|
653
|
+
const normalizedQuery = searchQuery.toLowerCase();
|
|
654
|
+
const nameA = a.value.name.toLowerCase();
|
|
655
|
+
const nameB = b.value.name.toLowerCase();
|
|
656
|
+
|
|
657
|
+
// Prioritize countries where name contains the search query
|
|
658
|
+
const aNameMatch = nameA.includes(normalizedQuery);
|
|
659
|
+
const bNameMatch = nameB.includes(normalizedQuery);
|
|
660
|
+
|
|
661
|
+
if (aNameMatch && !bNameMatch) return -1;
|
|
662
|
+
if (!aNameMatch && bNameMatch) return 1;
|
|
663
|
+
|
|
664
|
+
// Then sort alphabetically
|
|
665
|
+
return nameA.localeCompare(nameB);
|
|
666
|
+
},
|
|
667
|
+
size: 'lg',
|
|
668
|
+
} satisfies Story<CountryWithCurrency>['args'],
|
|
669
|
+
decorators: [
|
|
670
|
+
(Story) => (
|
|
671
|
+
<div>
|
|
672
|
+
<p className="m-b-3 np-text-body-default" style={{ maxWidth: '600px' }}>
|
|
673
|
+
This example demonstrates custom sorting with the <code>sortFilteredOptions</code> prop.
|
|
674
|
+
<br />
|
|
675
|
+
<br />
|
|
676
|
+
Try searching for "united" - Without the custom sorter, it would just be the
|
|
677
|
+
provided options order.
|
|
678
|
+
<br />
|
|
679
|
+
With a customer sorter function in this story, the countries with "United" in
|
|
680
|
+
their name appear first, followed by countries that only match via keywords.
|
|
681
|
+
</p>
|
|
682
|
+
<Story />
|
|
683
|
+
</div>
|
|
684
|
+
),
|
|
685
|
+
],
|
|
686
|
+
};
|
|
@@ -160,6 +160,38 @@ function filterSelectInputItems<T>(
|
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Flattens and sorts filtered options using the provided comparator.
|
|
165
|
+
* Extracts all options from groups, filters out undefined values (deduplicated items),
|
|
166
|
+
* sorts them, and returns as a flat list of option items.
|
|
167
|
+
*/
|
|
168
|
+
function sortSelectInputItems<T>(
|
|
169
|
+
items: readonly SelectInputItem<T | undefined>[],
|
|
170
|
+
compareFn: (
|
|
171
|
+
a: SelectInputOptionItem<NonNullable<T>>,
|
|
172
|
+
b: SelectInputOptionItem<NonNullable<T>>,
|
|
173
|
+
searchQuery: string,
|
|
174
|
+
) => number,
|
|
175
|
+
searchQuery: string,
|
|
176
|
+
): SelectInputItem<NonNullable<T>>[] {
|
|
177
|
+
const flattenedOption = items.flatMap((item) => {
|
|
178
|
+
if (item.type === 'option') {
|
|
179
|
+
return item.value !== undefined ? [item as SelectInputOptionItem<NonNullable<T>>] : [];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (item.type === 'group') {
|
|
183
|
+
return item.options.filter(
|
|
184
|
+
(option): option is SelectInputOptionItem<NonNullable<T>> => option.value !== undefined,
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return [];
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// eslint-disable-next-line functional/immutable-data
|
|
192
|
+
return flattenedOption.sort((a, b) => compareFn(a, b, searchQuery));
|
|
193
|
+
}
|
|
194
|
+
|
|
163
195
|
export interface SelectInputProps<T = string, M extends boolean = false> {
|
|
164
196
|
id?: string;
|
|
165
197
|
/**
|
|
@@ -210,6 +242,11 @@ export interface SelectInputProps<T = string, M extends boolean = false> {
|
|
|
210
242
|
}) => React.ReactNode;
|
|
211
243
|
filterable?: boolean;
|
|
212
244
|
filterPlaceholder?: string;
|
|
245
|
+
sortFilteredOptions?: (
|
|
246
|
+
a: SelectInputOptionItem<NonNullable<T>>,
|
|
247
|
+
b: SelectInputOptionItem<NonNullable<T>>,
|
|
248
|
+
searchQuery: string,
|
|
249
|
+
) => number;
|
|
213
250
|
disabled?: boolean;
|
|
214
251
|
size?: 'sm' | 'md' | 'lg';
|
|
215
252
|
className?: string;
|
|
@@ -304,6 +341,7 @@ export function SelectInput<T = string, M extends boolean = false>({
|
|
|
304
341
|
renderTrigger = defaultRenderTrigger,
|
|
305
342
|
filterable,
|
|
306
343
|
filterPlaceholder,
|
|
344
|
+
sortFilteredOptions,
|
|
307
345
|
disabled,
|
|
308
346
|
size = 'md',
|
|
309
347
|
className,
|
|
@@ -493,6 +531,7 @@ export function SelectInput<T = string, M extends boolean = false>({
|
|
|
493
531
|
renderFooter={renderFooter}
|
|
494
532
|
filterable={filterable}
|
|
495
533
|
filterPlaceholder={filterPlaceholder}
|
|
534
|
+
sortFilteredOptions={sortFilteredOptions}
|
|
496
535
|
searchInputRef={searchInputRef}
|
|
497
536
|
listboxRef={listboxRef}
|
|
498
537
|
filterQuery={deferredFilterQuery}
|
|
@@ -605,6 +644,7 @@ interface SelectInputOptionsProps<T = string> extends Pick<
|
|
|
605
644
|
| 'id'
|
|
606
645
|
| 'parentId'
|
|
607
646
|
| 'compareValues'
|
|
647
|
+
| 'sortFilteredOptions'
|
|
608
648
|
> {
|
|
609
649
|
searchInputRef: React.MutableRefObject<HTMLInputElement | null>;
|
|
610
650
|
listboxRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
@@ -626,6 +666,7 @@ function SelectInputOptions<T = string>({
|
|
|
626
666
|
renderFooter,
|
|
627
667
|
filterable = false,
|
|
628
668
|
filterPlaceholder,
|
|
669
|
+
sortFilteredOptions,
|
|
629
670
|
searchInputRef,
|
|
630
671
|
listboxRef,
|
|
631
672
|
filterQuery,
|
|
@@ -685,12 +726,22 @@ function SelectInputOptions<T = string>({
|
|
|
685
726
|
};
|
|
686
727
|
}, [compareValuesProp]);
|
|
687
728
|
|
|
688
|
-
const filteredItems: readonly SelectInputItem<NonNullable<T> | undefined>[] =
|
|
689
|
-
needle
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
729
|
+
const filteredItems: readonly SelectInputItem<NonNullable<T> | undefined>[] = useMemo(() => {
|
|
730
|
+
if (needle == null) {
|
|
731
|
+
return items;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
const filtered = filterSelectInputItems(dedupeSelectInputItems(items, compareValues), (item) =>
|
|
735
|
+
selectInputOptionItemIncludesNeedle(item, needle),
|
|
736
|
+
);
|
|
737
|
+
|
|
738
|
+
if (sortFilteredOptions) {
|
|
739
|
+
return sortSelectInputItems(filtered, sortFilteredOptions, filterQuery);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
return filtered;
|
|
743
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
744
|
+
}, [needle, items, compareValues]);
|
|
694
745
|
const resultsEmpty = needle != null && filteredItems.length === 0;
|
|
695
746
|
|
|
696
747
|
const virtualized = filteredItems.length > MAX_ITEMS_WITHOUT_VIRTUALIZATION;
|
|
@@ -1526,10 +1526,9 @@ describe('ListItem', () => {
|
|
|
1526
1526
|
);
|
|
1527
1527
|
expect(screen.queryByText(prompt)).not.toBeInTheDocument();
|
|
1528
1528
|
expect(screen.getByText(disabledPromptMessage)).toBeInTheDocument();
|
|
1529
|
-
expect(
|
|
1530
|
-
'
|
|
1531
|
-
|
|
1532
|
-
);
|
|
1529
|
+
expect(
|
|
1530
|
+
screen.getByTestId('InlinePrompt_Muted').parentNode?.parentNode?.parentNode,
|
|
1531
|
+
).toHaveAttribute('id', expect.stringMatching(/_prompt$/));
|
|
1533
1532
|
});
|
|
1534
1533
|
|
|
1535
1534
|
it('should render muted prompt if disabled and disabledPromptMessage are set', () => {
|
|
@@ -1537,10 +1536,9 @@ describe('ListItem', () => {
|
|
|
1537
1536
|
<ListItem title="Test Title" disabled disabledPromptMessage={disabledPromptMessage} />,
|
|
1538
1537
|
);
|
|
1539
1538
|
expect(screen.getByText(disabledPromptMessage)).toBeInTheDocument();
|
|
1540
|
-
expect(
|
|
1541
|
-
'
|
|
1542
|
-
|
|
1543
|
-
);
|
|
1539
|
+
expect(
|
|
1540
|
+
screen.getByTestId('InlinePrompt_Muted').parentNode?.parentNode?.parentNode,
|
|
1541
|
+
).toHaveAttribute('id', expect.stringMatching(/_prompt$/));
|
|
1544
1542
|
});
|
|
1545
1543
|
});
|
|
1546
1544
|
});
|
|
@@ -21,7 +21,7 @@ const waitForListItem = async (canvas: ReturnType<typeof within>, timeout = 3000
|
|
|
21
21
|
export default {
|
|
22
22
|
component: ListItem,
|
|
23
23
|
title: 'Content/ListItem/tests/focus',
|
|
24
|
-
tags: ['!autodocs'],
|
|
24
|
+
tags: ['!autodocs', '!manifest'],
|
|
25
25
|
parameters: {
|
|
26
26
|
controls: { disable: true },
|
|
27
27
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { allModes } from '../../../../.storybook/modes';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/theme: bright-green',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { allModes } from '../../../../.storybook/modes';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/theme: dark',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { allModes } from '../../../../.storybook/modes';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/theme: forest-green',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { withSizedContainer } from '../helpers';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/cq: medium',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
|
@@ -11,7 +11,7 @@ import { VariantStory } from './helpers';
|
|
|
11
11
|
export default {
|
|
12
12
|
component: ListItem,
|
|
13
13
|
title: 'Content/ListItem/tests/variants/theme: personal',
|
|
14
|
-
tags: ['!autodocs'],
|
|
14
|
+
tags: ['!autodocs', '!manifest'],
|
|
15
15
|
parameters: {
|
|
16
16
|
controls: { disable: true },
|
|
17
17
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { allModes } from '../../../../.storybook/modes';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/rtl',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { withSizedContainer } from '../helpers';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/cq: small',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
package/src/main.css
CHANGED
|
@@ -920,83 +920,6 @@
|
|
|
920
920
|
.np-theme-personal .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
|
|
921
921
|
border-color: var(--color-interactive-primary-hover);
|
|
922
922
|
}
|
|
923
|
-
.wds-inline-prompt {
|
|
924
|
-
display: inline-flex;
|
|
925
|
-
text-align: left;
|
|
926
|
-
padding-top: calc(8px / 2);
|
|
927
|
-
padding-top: calc(var(--padding-x-small) / 2);
|
|
928
|
-
padding-bottom: calc(8px / 2);
|
|
929
|
-
padding-bottom: calc(var(--padding-x-small) / 2);
|
|
930
|
-
padding-left: calc(8px - 1px);
|
|
931
|
-
padding-left: calc(var(--padding-x-small) - 1px);
|
|
932
|
-
padding-right: 8px;
|
|
933
|
-
padding-right: var(--padding-x-small);
|
|
934
|
-
border-radius: 10px;
|
|
935
|
-
border-radius: var(--radius-small);
|
|
936
|
-
word-break: break-word;
|
|
937
|
-
word-wrap: break-word;
|
|
938
|
-
}
|
|
939
|
-
.wds-inline-prompt:has(a),
|
|
940
|
-
.wds-inline-prompt:has(button) {
|
|
941
|
-
position: relative;
|
|
942
|
-
z-index: 1;
|
|
943
|
-
}
|
|
944
|
-
.wds-inline-prompt:has(a):hover,
|
|
945
|
-
.wds-inline-prompt:has(button):hover {
|
|
946
|
-
background-color: var(--color-sentiment-background-surface-hover);
|
|
947
|
-
}
|
|
948
|
-
.wds-inline-prompt:has(a):active,
|
|
949
|
-
.wds-inline-prompt:has(button):active {
|
|
950
|
-
background-color: var(--color-sentiment-background-surface-active);
|
|
951
|
-
}
|
|
952
|
-
.wds-inline-prompt--full-width {
|
|
953
|
-
width: 100%;
|
|
954
|
-
}
|
|
955
|
-
.wds-inline-prompt--muted {
|
|
956
|
-
opacity: 0.93;
|
|
957
|
-
filter: grayscale(1);
|
|
958
|
-
}
|
|
959
|
-
.wds-inline-prompt a,
|
|
960
|
-
.wds-inline-prompt button {
|
|
961
|
-
color: var(--color-sentiment-content-primary);
|
|
962
|
-
text-underline-offset: calc(4px / 2);
|
|
963
|
-
text-underline-offset: calc(var(--size-4) / 2);
|
|
964
|
-
}
|
|
965
|
-
.wds-inline-prompt a:hover,
|
|
966
|
-
.wds-inline-prompt button:hover {
|
|
967
|
-
color: var(--color-sentiment-content-primary-hover);
|
|
968
|
-
}
|
|
969
|
-
.wds-inline-prompt a:active,
|
|
970
|
-
.wds-inline-prompt button:active {
|
|
971
|
-
color: var(--color-sentiment-content-primary-active);
|
|
972
|
-
}
|
|
973
|
-
.wds-inline-prompt a:first-of-type:before,
|
|
974
|
-
.wds-inline-prompt button:first-of-type:before {
|
|
975
|
-
content: "";
|
|
976
|
-
position: absolute;
|
|
977
|
-
inset: 0;
|
|
978
|
-
}
|
|
979
|
-
.wds-inline-prompt__media-wrapper {
|
|
980
|
-
padding-right: calc(12px / 2);
|
|
981
|
-
padding-right: calc(var(--size-12) / 2);
|
|
982
|
-
padding-top: calc(4px - 1px);
|
|
983
|
-
padding-top: calc(var(--size-4) - 1px);
|
|
984
|
-
padding-bottom: calc(4px - 1px);
|
|
985
|
-
padding-bottom: calc(var(--size-4) - 1px);
|
|
986
|
-
}
|
|
987
|
-
.wds-inline-prompt__media-wrapper .tw-icon-tags,
|
|
988
|
-
.wds-inline-prompt__media-wrapper .tw-icon-confetti {
|
|
989
|
-
color: var(--color-sentiment-content-primary);
|
|
990
|
-
}
|
|
991
|
-
.wds-inline-prompt .wds-inline-prompt-process-indicator {
|
|
992
|
-
width: 16px;
|
|
993
|
-
width: var(--size-16);
|
|
994
|
-
height: 16px;
|
|
995
|
-
height: var(--size-16);
|
|
996
|
-
}
|
|
997
|
-
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
998
|
-
stroke: currentColor;
|
|
999
|
-
}
|
|
1000
923
|
.np-dot {
|
|
1001
924
|
--np-dot-size: 14px;
|
|
1002
925
|
position: relative;
|
|
@@ -5412,6 +5335,103 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5412
5335
|
.np-CardGroup .np-Card.np-Card--promoCard {
|
|
5413
5336
|
max-width: 100%;
|
|
5414
5337
|
}
|
|
5338
|
+
.wds-prompt {
|
|
5339
|
+
border-radius: 10px;
|
|
5340
|
+
border-radius: var(--radius-small);
|
|
5341
|
+
display: flex;
|
|
5342
|
+
word-wrap: break-word;
|
|
5343
|
+
padding: 8px;
|
|
5344
|
+
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
5345
|
+
text-align: left;
|
|
5346
|
+
word-break: break-word;
|
|
5347
|
+
}
|
|
5348
|
+
.wds-prompt__content-wrapper {
|
|
5349
|
+
display: grid;
|
|
5350
|
+
grid-gap: 16px;
|
|
5351
|
+
grid-gap: var(--Prompt-gap, var(--size-16));
|
|
5352
|
+
gap: 16px;
|
|
5353
|
+
gap: var(--Prompt-gap, var(--size-16));
|
|
5354
|
+
grid-template-columns: auto 1fr;
|
|
5355
|
+
width: 100%;
|
|
5356
|
+
}
|
|
5357
|
+
.wds-prompt__media-wrapper {
|
|
5358
|
+
align-self: flex-start;
|
|
5359
|
+
padding-top: calc(4px - 1px);
|
|
5360
|
+
padding-top: calc(var(--size-4) - 1px);
|
|
5361
|
+
}
|
|
5362
|
+
.wds-prompt__media-wrapper .tw-icon-tags,
|
|
5363
|
+
.wds-prompt__media-wrapper .tw-icon-confetti {
|
|
5364
|
+
color: var(--color-sentiment-content-primary);
|
|
5365
|
+
}
|
|
5366
|
+
.wds-prompt__actions-wrapper {
|
|
5367
|
+
display: flex;
|
|
5368
|
+
flex-wrap: wrap;
|
|
5369
|
+
gap: 8px;
|
|
5370
|
+
gap: var(--Prompt-actions-gap, var(--size-8));
|
|
5371
|
+
grid-column-start: 2;
|
|
5372
|
+
}
|
|
5373
|
+
@media (max-width: 991px) {
|
|
5374
|
+
.wds-prompt__actions-wrapper {
|
|
5375
|
+
grid-column: span 2;
|
|
5376
|
+
width: 100%;
|
|
5377
|
+
}
|
|
5378
|
+
}
|
|
5379
|
+
.wds-inline-prompt {
|
|
5380
|
+
--Prompt-gap: calc(var(--size-12) / 2);
|
|
5381
|
+
--Prompt-padding: calc(var(--padding-x-small) / 2) var(--padding-x-small);
|
|
5382
|
+
display: inline-flex;
|
|
5383
|
+
border-radius: 10px;
|
|
5384
|
+
border-radius: var(--radius-small);
|
|
5385
|
+
}
|
|
5386
|
+
.wds-inline-prompt:has(a),
|
|
5387
|
+
.wds-inline-prompt:has(button) {
|
|
5388
|
+
position: relative;
|
|
5389
|
+
z-index: 1;
|
|
5390
|
+
}
|
|
5391
|
+
.wds-inline-prompt:has(a):hover,
|
|
5392
|
+
.wds-inline-prompt:has(button):hover {
|
|
5393
|
+
background-color: var(--color-sentiment-background-surface-hover);
|
|
5394
|
+
}
|
|
5395
|
+
.wds-inline-prompt:has(a):active,
|
|
5396
|
+
.wds-inline-prompt:has(button):active {
|
|
5397
|
+
background-color: var(--color-sentiment-background-surface-active);
|
|
5398
|
+
}
|
|
5399
|
+
.wds-inline-prompt--full-width {
|
|
5400
|
+
width: 100%;
|
|
5401
|
+
}
|
|
5402
|
+
.wds-inline-prompt--muted {
|
|
5403
|
+
opacity: 0.93;
|
|
5404
|
+
filter: grayscale(1);
|
|
5405
|
+
}
|
|
5406
|
+
.wds-inline-prompt a,
|
|
5407
|
+
.wds-inline-prompt button {
|
|
5408
|
+
color: var(--color-sentiment-content-primary);
|
|
5409
|
+
text-underline-offset: calc(4px / 2);
|
|
5410
|
+
text-underline-offset: calc(var(--size-4) / 2);
|
|
5411
|
+
}
|
|
5412
|
+
.wds-inline-prompt a:hover,
|
|
5413
|
+
.wds-inline-prompt button:hover {
|
|
5414
|
+
color: var(--color-sentiment-content-primary-hover);
|
|
5415
|
+
}
|
|
5416
|
+
.wds-inline-prompt a:active,
|
|
5417
|
+
.wds-inline-prompt button:active {
|
|
5418
|
+
color: var(--color-sentiment-content-primary-active);
|
|
5419
|
+
}
|
|
5420
|
+
.wds-inline-prompt a:first-of-type:before,
|
|
5421
|
+
.wds-inline-prompt button:first-of-type:before {
|
|
5422
|
+
content: "";
|
|
5423
|
+
position: absolute;
|
|
5424
|
+
inset: 0;
|
|
5425
|
+
}
|
|
5426
|
+
.wds-inline-prompt .wds-inline-prompt-process-indicator {
|
|
5427
|
+
width: 16px;
|
|
5428
|
+
width: var(--size-16);
|
|
5429
|
+
height: 16px;
|
|
5430
|
+
height: var(--size-16);
|
|
5431
|
+
}
|
|
5432
|
+
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
5433
|
+
stroke: currentColor;
|
|
5434
|
+
}
|
|
5415
5435
|
.wds-radio-group .np-radio:last-child label {
|
|
5416
5436
|
margin-bottom: 0;
|
|
5417
5437
|
}
|
package/src/main.less
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
@import "./actionOption/ActionOption.less";
|
|
7
7
|
@import "./alert/Alert.less";
|
|
8
8
|
@import "./avatar/Avatar.less";
|
|
9
|
-
@import "./prompt/InlinePrompt/InlinePrompt.less";
|
|
10
9
|
@import "./avatarView/AvatarView.less";
|
|
11
10
|
@import "./avatarLayout/AvatarLayout.less";
|
|
12
11
|
@import "./iconButton/IconButton.less";
|
|
@@ -61,6 +60,8 @@
|
|
|
61
60
|
@import "./phoneNumberInput/PhoneNumberInput.less";
|
|
62
61
|
@import "./popover/Popover.less";
|
|
63
62
|
@import "./promoCard/PromoCard.less";
|
|
63
|
+
@import "./prompt/PrimitivePrompt/PrimitivePrompt.less";
|
|
64
|
+
@import "./prompt/InlinePrompt/InlinePrompt.less";
|
|
64
65
|
@import "./radioGroup/RadioGroup.less";
|
|
65
66
|
@import "./section/Section.less";
|
|
66
67
|
@import "./slidingPanel/SlidingPanel.less";
|