Skip to content

Commit

Permalink
chore(splitview): working on adding focus story
Browse files Browse the repository at this point in the history
  • Loading branch information
mlogsdon18 committed Aug 28, 2023
1 parent 7776d96 commit ae07ee9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 0 additions & 1 deletion components/splitview/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ governing permissions and limitations under the License.
border-color: var(--highcontrast-splitview-handle-background-color-focus, var(--mod-splitview-handle-background-color-focus, var(--spectrum-splitview-handle-background-color-focus)));
box-shadow: 0 0 0 1px var(--highcontrast-splitview-handle-background-color-focus, var(--mod-splitview-handle-background-color-focus, var(--spectrum-splitview-handle-background-color-focus)));
}

.spectrum-SplitView-gripper::before {
background-color: var(--highcontrast-splitview-handle-background-color-focus, var(--mod-splitview-handle-background-color-focus, var(--spectrum-splitview-handle-background-color-focus)));
}
Expand Down
20 changes: 20 additions & 0 deletions components/splitview/stories/splitview.stories.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { within, userEvent } from '@storybook/testing-library';
import { expect } from '@storybook/jest';

// Import the component markup template
import { Template } from "./template";

Expand Down Expand Up @@ -99,6 +102,23 @@ HorizontallyResizable.args = {
panelStyles: ["width: 304px;", "flex: 1;"],
};

export const HorizontallyFocused = Template.bind({});
HorizontallyFocused.play = async ({ canvasElement }) => {
const canvas = within(canvasElement);

const splitter = canvas.getByTestId('splitter');

splitter.focus();

};
HorizontallyFocused.args = {
orientation: "horizontal",
isResizable: true,
isCollapsible: false,
panelLabels: ["Left", "Right"],
panelStyles: ["width: 304px;", "flex: 1;"],
};

export const HorizontalCollapsedLeft = Template.bind({});
HorizontalCollapsedLeft.args = {
orientation: "horizontal",
Expand Down
2 changes: 2 additions & 0 deletions components/splitview/stories/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export const Template = ({
["is-draggable"]: isResizable,
[`is-collapsed-${collapsibleClassName}`]: isCollapsible,
})}
tabindex="0"
data-testid="splitter"
>
${when(
isResizable,
Expand Down

0 comments on commit ae07ee9

Please sign in to comment.