Skip to content

Commit 7b8ba2c

Browse files
Merge branch 'main' into copilot/add-webkit-test-support
2 parents b8fe032 + baf87bc commit 7b8ba2c

File tree

12 files changed

+545
-217
lines changed

12 files changed

+545
-217
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,9 @@ jobs:
398398
cypress-atomic-test:
399399
name: "Run Cypress tests on Atomic"
400400
needs: affected
401-
if: contains(needs.affected.outputs.projects, '@coveo/atomic')
401+
if: contains(needs.affected.outputs.projects, '@coveo/atomic') && github.event_name != 'merge_group'
402402
runs-on: ubuntu-latest
403403
strategy:
404-
fail-fast: ${{ github.event_name == 'merge_group' }}
405404
matrix:
406405
containers:
407406
[
@@ -758,7 +757,6 @@ jobs:
758757
- "playwright-atomic-theming"
759758
- "playwright-atomic-hosted-page-test"
760759
- "playwright-headless-ssr-commerce-nextjs-test"
761-
- "cypress-atomic-test"
762760
- "e2e-quantic"
763761
- "cypress-atomic-screenshots"
764762
- "playwright-atomic-search-commerce-react-test"

packages/atomic-react/src/components/commerce/components.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
AtomicCommerceText as LitAtomicCommerceText,
2828
AtomicCommerceTimeframeFacet as LitAtomicCommerceTimeframeFacet,
2929
AtomicComponentError as LitAtomicComponentError,
30+
AtomicFocusTrap as LitAtomicFocusTrap,
3031
AtomicIcon as LitAtomicIcon,
3132
AtomicInsightGenerateAnswerButton as LitAtomicInsightGenerateAnswerButton,
3233
AtomicInsightInterface as LitAtomicInsightInterface,
@@ -225,6 +226,12 @@ export const AtomicComponentError = createComponent({
225226
elementClass: LitAtomicComponentError,
226227
});
227228

229+
export const AtomicFocusTrap = createComponent({
230+
tagName: 'atomic-focus-trap',
231+
react: React,
232+
elementClass: LitAtomicFocusTrap,
233+
});
234+
228235
export const AtomicIcon = createComponent({
229236
tagName: 'atomic-icon',
230237
react: React,

packages/atomic-react/src/components/search/components.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
AtomicComponentError as LitAtomicComponentError,
44
AtomicExternal as LitAtomicExternal,
55
AtomicFacet as LitAtomicFacet,
6+
AtomicFocusTrap as LitAtomicFocusTrap,
67
AtomicHtml as LitAtomicHtml,
78
AtomicIcon as LitAtomicIcon,
89
AtomicInsightGenerateAnswerButton as LitAtomicInsightGenerateAnswerButton,
@@ -63,6 +64,12 @@ export const AtomicFacet = createComponent({
6364
elementClass: LitAtomicFacet,
6465
});
6566

67+
export const AtomicFocusTrap = createComponent({
68+
tagName: 'atomic-focus-trap',
69+
react: React,
70+
elementClass: LitAtomicFocusTrap,
71+
});
72+
6673
export const AtomicHtml = createComponent({
6774
tagName: 'atomic-html',
6875
react: React,

packages/atomic/cypress/e2e/refine-toggle.cypress.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {colorFacetField} from './facets/color-facet/color-facet-actions';
77
import {colorFacetComponent} from './facets/color-facet/color-facet-selectors';
88
import {field as facetField} from './facets/facet/facet-actions';
99
import {facetComponent} from './facets/facet/facet-selectors';
10-
import {facetManagerComponent} from './facets/manager/facet-manager-actions';
1110
import {numericFacetField} from './facets/numeric-facet/numeric-facet-actions';
1211
import {numericFacetComponent} from './facets/numeric-facet/numeric-facet-selectors';
1312
import {ratingFacetField} from './facets/rating-facet/rating-facet-actions';
@@ -168,11 +167,6 @@ describe('Refine Toggle Test Suites', () => {
168167
RefineModalSelectors.facets().should('not.exist');
169168
});
170169

171-
it('should have a focus trap', () => {
172-
RefineModalSelectors.focusTrap().should('exist');
173-
cy.get(`${facetManagerComponent}[aria-hidden="true"]`).should('exist');
174-
});
175-
176170
it('should respect the collapseFacetsAfter prop', () => {
177171
RefineModalSelectors.facets()
178172
.children()

packages/atomic/src/components.d.ts

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -311,25 +311,6 @@ export namespace Components {
311311
*/
312312
"mustNotMatch": Record<string, string[]>;
313313
}
314-
interface AtomicFocusTrap {
315-
"active": boolean;
316-
/**
317-
* The container to hide from the tabindex and accessibility DOM when the focus trap is inactive.
318-
*/
319-
"container"?: HTMLElement;
320-
/**
321-
* The common ancestor of the focus trap and of all the elements that should be inaccessible when inside the focus trap.
322-
*/
323-
"scope": HTMLElement;
324-
/**
325-
* Whether the element should be hidden from screen readers & not interactive with the tab, when not active.
326-
*/
327-
"shouldHideSelf": boolean;
328-
/**
329-
* The source to focus when the focus trap becomes inactive.
330-
*/
331-
"source"?: HTMLElement;
332-
}
333314
/**
334315
* The `atomic-folded-result-list` component is responsible for displaying folded query results, by applying one or more result templates for up to three layers (that is, to the result, child, and grandchild).
335316
*/
@@ -2372,12 +2353,6 @@ declare global {
23722353
prototype: HTMLAtomicFieldConditionElement;
23732354
new (): HTMLAtomicFieldConditionElement;
23742355
};
2375-
interface HTMLAtomicFocusTrapElement extends Components.AtomicFocusTrap, HTMLStencilElement {
2376-
}
2377-
var HTMLAtomicFocusTrapElement: {
2378-
prototype: HTMLAtomicFocusTrapElement;
2379-
new (): HTMLAtomicFocusTrapElement;
2380-
};
23812356
/**
23822357
* The `atomic-folded-result-list` component is responsible for displaying folded query results, by applying one or more result templates for up to three layers (that is, to the result, child, and grandchild).
23832358
*/
@@ -3443,7 +3418,6 @@ declare global {
34433418
"atomic-facet-manager": HTMLAtomicFacetManagerElement;
34443419
"atomic-facet-number-input": HTMLAtomicFacetNumberInputElement;
34453420
"atomic-field-condition": HTMLAtomicFieldConditionElement;
3446-
"atomic-focus-trap": HTMLAtomicFocusTrapElement;
34473421
"atomic-folded-result-list": HTMLAtomicFoldedResultListElement;
34483422
"atomic-format-currency": HTMLAtomicFormatCurrencyElement;
34493423
"atomic-format-number": HTMLAtomicFormatNumberElement;
@@ -3826,25 +3800,6 @@ declare namespace LocalJSX {
38263800
*/
38273801
"mustNotMatch"?: Record<string, string[]>;
38283802
}
3829-
interface AtomicFocusTrap {
3830-
"active"?: boolean;
3831-
/**
3832-
* The container to hide from the tabindex and accessibility DOM when the focus trap is inactive.
3833-
*/
3834-
"container"?: HTMLElement;
3835-
/**
3836-
* The common ancestor of the focus trap and of all the elements that should be inaccessible when inside the focus trap.
3837-
*/
3838-
"scope"?: HTMLElement;
3839-
/**
3840-
* Whether the element should be hidden from screen readers & not interactive with the tab, when not active.
3841-
*/
3842-
"shouldHideSelf"?: boolean;
3843-
/**
3844-
* The source to focus when the focus trap becomes inactive.
3845-
*/
3846-
"source"?: HTMLElement;
3847-
}
38483803
/**
38493804
* The `atomic-folded-result-list` component is responsible for displaying folded query results, by applying one or more result templates for up to three layers (that is, to the result, child, and grandchild).
38503805
*/
@@ -5679,7 +5634,6 @@ declare namespace LocalJSX {
56795634
"atomic-facet-manager": AtomicFacetManager;
56805635
"atomic-facet-number-input": AtomicFacetNumberInput;
56815636
"atomic-field-condition": AtomicFieldCondition;
5682-
"atomic-focus-trap": AtomicFocusTrap;
56835637
"atomic-folded-result-list": AtomicFoldedResultList;
56845638
"atomic-format-currency": AtomicFormatCurrency;
56855639
"atomic-format-number": AtomicFormatNumber;
@@ -5846,7 +5800,6 @@ declare module "@stencil/core" {
58465800
* @MapProp name: mustNotMatch;attr: must-not-match;docs: The field and values that define which result items the condition must not be applied to. For example, a template with the following attribute only applies to result items whose `filetype` is not `lithiummessage`: `must-not-match-filetype="lithiummessage";type: Record<string, string[]> ;default: {}
58475801
*/
58485802
"atomic-field-condition": LocalJSX.AtomicFieldCondition & JSXBase.HTMLAttributes<HTMLAtomicFieldConditionElement>;
5849-
"atomic-focus-trap": LocalJSX.AtomicFocusTrap & JSXBase.HTMLAttributes<HTMLAtomicFocusTrapElement>;
58505803
/**
58515804
* The `atomic-folded-result-list` component is responsible for displaying folded query results, by applying one or more result templates for up to three layers (that is, to the result, child, and grandchild).
58525805
*/

packages/atomic/src/components/common/atomic-focus-trap.tsx

Lines changed: 0 additions & 160 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import type {Meta, StoryObj as Story} from '@storybook/web-components-vite';
2+
import {getStorybookHelpers} from '@wc-toolkit/storybook-helpers';
3+
import {parameters} from '@/storybook-utils/common/common-meta-parameters';
4+
5+
const {events, args, argTypes, template} = getStorybookHelpers(
6+
'atomic-focus-trap',
7+
{excludeCategories: ['methods']}
8+
);
9+
10+
const meta: Meta = {
11+
component: 'atomic-focus-trap',
12+
title: 'Common/Focus Trap',
13+
id: 'atomic-focus-trap',
14+
render: (args) => template(args),
15+
parameters: {
16+
...parameters,
17+
actions: {
18+
handles: events,
19+
},
20+
},
21+
args,
22+
argTypes,
23+
};
24+
25+
export default meta;
26+
27+
export const Default: Story = {
28+
tags: ['!dev'],
29+
};

0 commit comments

Comments
 (0)