-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* scaffolding * more style progress * add box shadow border styles * add disabled styles and behavior * get rid of psudo element in favor of real element in prep for macros conversion * get macro styles to work for tree * remove old version in favor of macros * add dynamic support * add icons support, types, ref support and misc cleanup * fix lint and rename Tree file * add resizing story and fix text truncation/border cut off/addition prop considerations * fix wiggle * add more stories, fix chevron grid sizing, add empty state centering * progress in fixing build issue * fix bugs from testing default pointer styling, focus styling when focus is withing the row, clicking on the chevron should move focus into tree, checkbox now appears when single selection * fix pointer conditions to macros must have "is" as a prefix? * tentative announcement for grid list rows with links/actions * updating HCM, RTL and increasing row width for action button focus ring * weirdness with styles bleeding into the action menu, may need fix from rainbow for macros * brainstorming some way to fix tree icon styles from making it to action menu icon * adding temp test setup and babel config update for macros, tests dont run still * Tentative approach to get rid of ActionButton icon styles from being erronously overwritten icon slot propogated styles from TreeView row were making it to the ActionMenu button. Preventing this from happening by making ActionButton clearSlots and only accept text slot props. To preserve ActionGroup classname for icon, moved it to ActionButton directly * chevron rotate animation * bump babel so tests with macros can run * update treeview tests to match spectrum implementation * wrap up tests and clean up package json * test skipping the tree tests to see if the 16 and 17 tests pass * unskip tree tests, doesnt look like those are the problem * update types and fixes for removal of "all" support for expandable key set * bring back docs transformer for fork point * increasing timeout time to see if it helps the test failures * try running in band * Fix fork point Until we move to babel 8, we need to use assert instead of with, see https://babeljs.io/docs/v8-migration#babelplugin-syntax-import-assertions * revert to "with" and pin parser * fix build? * revert runInBand * adding increased timeout back * try skipping TreeView test * lower timeout for RTL async utils so they finish before jest kills workers * set disabled/HCM color on grid cell and have children inherit this this allows us make the icon the proper greyText color and avoid some UNSAFE styles * make it so talkback cant focus the chevron if the row is completely disabled * fix lint * add chromatic and add timeout back in * test limiting jest workers * get rid of things added to pass the build now that we are using SWC * still need importAttributes for docs transformer? * Address review comments * typo * fix import
- Loading branch information
Showing
28 changed files
with
2,353 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"hasActionAnnouncement": "row has action", | ||
"hasLinkAnnouncement": "row has link: {link}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"hasActionAnnouncement": "row has action", | ||
"hasLinkAnnouncement": "row has link: {link}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
packages/@react-spectrum/tree/chromatic/TreeView.chromatic-fc.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/* | ||
* Copyright 2024 Adobe. All rights reserved. | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
* OF ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
|
||
import {ActionGroup, Item} from '@react-spectrum/actiongroup'; | ||
import {ActionMenu} from '@react-spectrum/menu'; | ||
import Add from '@spectrum-icons/workflow/Add'; | ||
import Delete from '@spectrum-icons/workflow/Delete'; | ||
import Edit from '@spectrum-icons/workflow/Edit'; | ||
import FileTxt from '@spectrum-icons/workflow/FileTxt'; | ||
import Folder from '@spectrum-icons/workflow/Folder'; | ||
import React from 'react'; | ||
import {Text} from '@react-spectrum/text'; | ||
import {TreeView, TreeViewItem} from '../src'; | ||
|
||
export default { | ||
title: 'TreeView' | ||
}; | ||
|
||
function TestTree(props) { | ||
return ( | ||
<div style={{width: '300px', height: '800px'}}> | ||
<TreeView {...props} disabledKeys={['projects-1']} defaultExpandedKeys={['Photos', 'projects', 'projects-1']} aria-label="test static tree"> | ||
<TreeViewItem href="https://adobe.com/" id="Photos" textValue="Photos"> | ||
<Text>Photos</Text> | ||
<Folder /> | ||
<ActionGroup> | ||
<Item key="edit"> | ||
<Edit /> | ||
<Text>Edit</Text> | ||
</Item> | ||
<Item key="delete"> | ||
<Delete /> | ||
<Text>Delete</Text> | ||
</Item> | ||
</ActionGroup> | ||
</TreeViewItem> | ||
<TreeViewItem id="projects" textValue="Projects"> | ||
<Text>Projects</Text> | ||
<Folder /> | ||
<ActionMenu> | ||
<Item key="add"> | ||
<Add /> | ||
<Text>Add</Text> | ||
</Item> | ||
<Item key="delete"> | ||
<Delete /> | ||
<Text>Delete</Text> | ||
</Item> | ||
</ActionMenu> | ||
<TreeViewItem id="projects-1" textValue="Projects-1"> | ||
<Text>Projects-1</Text> | ||
<Folder /> | ||
<ActionGroup> | ||
<Item key="edit"> | ||
<Edit /> | ||
<Text>Edit</Text> | ||
</Item> | ||
<Item key="delete"> | ||
<Delete /> | ||
<Text>Delete</Text> | ||
</Item> | ||
</ActionGroup> | ||
<TreeViewItem id="projects-1A" textValue="Projects-1A"> | ||
<Text>Projects-1A</Text> | ||
<FileTxt /> | ||
<ActionMenu> | ||
<Item key="add"> | ||
<Add /> | ||
<Text>Add</Text> | ||
</Item> | ||
<Item key="delete"> | ||
<Delete /> | ||
<Text>Delete</Text> | ||
</Item> | ||
</ActionMenu> | ||
</TreeViewItem> | ||
</TreeViewItem> | ||
<TreeViewItem id="projects-2" textValue="Projects-2"> | ||
<Text>Projects-2</Text> | ||
<FileTxt /> | ||
<ActionGroup> | ||
<Item key="edit"> | ||
<Edit /> | ||
<Text>Edit</Text> | ||
</Item> | ||
<Item key="delete"> | ||
<Delete /> | ||
<Text>Delete</Text> | ||
</Item> | ||
</ActionGroup> | ||
</TreeViewItem> | ||
<TreeViewItem id="projects-3" textValue="Projects-3"> | ||
<Text>Projects-3</Text> | ||
<FileTxt /> | ||
</TreeViewItem> | ||
</TreeViewItem> | ||
</TreeView> | ||
</div> | ||
); | ||
} | ||
|
||
export const Default = () => ( | ||
<TestTree /> | ||
); | ||
|
||
export const SelectionMode = () => ( | ||
<TestTree selectionMode="multiple" /> | ||
); | ||
|
||
export const DisabledBehaviorAll = () => ( | ||
<TestTree disabledBehavior="all" selectionMode="multiple" /> | ||
); | ||
|
||
export const HiglightSelectionWithDisabledBehaviorAll = () => ( | ||
<TestTree selectionStyle="highlight" selectionMode="multiple" disabledBehavior="all" /> | ||
); |
Oops, something went wrong.
f3cbe03
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verdaccio builds:
CRA Test App
NextJS Test App
RAC Tailwind Example
RAC Spectrum + Tailwind Example
CRA Test App Size
NextJS App Size
Publish stats
Size diff since last release
Docs
Storybook