Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,19 @@ s2-docs:
DOCS_ENV=stage PUBLIC_URL=/$(BRANCH_TYPE)/$(HASH) $(MAKE) build-s2-docs
cp packages/dev/docs/pages/disallow-robots.txt dist/s2-docs/react-aria/$(BRANCH_TYPE)/$(HASH)/robots.txt
cp packages/dev/docs/pages/disallow-robots.txt dist/s2-docs/s2/$(BRANCH_TYPE)/$(HASH)/robots.txt
yarn check:s2-docs-build dist/s2-docs

s2-docs-stage:
DOCS_ENV=stage PUBLIC_URL=/ $(MAKE) build-s2-docs
cp packages/dev/docs/pages/disallow-robots.txt dist/s2-docs/react-aria/robots.txt
cp packages/dev/docs/pages/disallow-robots.txt dist/s2-docs/s2/robots.txt
yarn check:s2-docs-build dist/s2-docs

s2-docs-production:
DOCS_ENV=prod PUBLIC_URL=/ $(MAKE) build-s2-docs
cp packages/dev/docs/pages/robots.txt dist/s2-docs/react-aria/robots.txt
cp packages/dev/docs/pages/robots.txt dist/s2-docs/s2/robots.txt
yarn check:s2-docs-build dist/s2-docs
cd starters/docs && yarn install --no-immutable && yarn up react-aria-components
cd starters/tailwind && yarn install --no-immutable && yarn up react-aria-components tailwindcss-react-aria-components
$(MAKE) build-starters
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"build:docs": "DOCS_ENV=staging parcel build 'packages/@react-{spectrum,aria,stately}/*/docs/*.mdx' 'packages/dev/docs/pages/{react-spectrum,releases}/**/*.mdx'",
"start:s2-docs": "yarn workspace @react-spectrum/s2-docs start",
"build:s2-docs": "yarn workspace @react-spectrum/s2-docs build",
"check:s2-docs-build": "node packages/dev/s2-docs/scripts/validateS2DocsBuild.mjs",
"build:mcp": "yarn workspace @react-spectrum/mcp build && yarn workspace @react-aria/mcp build",
"start:mcp": "yarn workspace @react-spectrum/s2-docs generate:md && yarn build:mcp && node packages/dev/mcp/s2/dist/index.js && node packages/dev/mcp/react-aria/dist/index.js",
"test:mcp": "yarn build:s2-docs && yarn build:mcp && node packages/dev/mcp/scripts/smoke-list-pages.mjs",
Expand Down
10 changes: 9 additions & 1 deletion packages/@react-spectrum/s2/chromatic/TreeView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function TreeExample(props: TreeViewProps<any>): ReactElement {
disabledKeys={['projects-1']}
aria-label="test static tree"
expandedKeys={['projects']}>

<TreeViewItem id="Photos" textValue="Photos">
<TreeViewItemContent>
<Text>Photos</Text>
Expand Down Expand Up @@ -152,6 +151,15 @@ export const TreeSelection: StoryObj<typeof TreeExample> = {
}
};

export const TreeDisableSelection: StoryObj<typeof TreeExample> = {
...TreeStatic,
args: {
selectionMode: 'multiple',
defaultSelectedKeys: ['projects-2', 'projects-3'],
disabledBehavior: 'selection'
}
};

interface TreeViewItemType {
id: string,
name: string,
Expand Down
12 changes: 8 additions & 4 deletions packages/@react-spectrum/s2/src/TreeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ const treeCheckbox = style({
gridArea: 'checkbox',
marginStart: 12,
marginEnd: 0,
paddingEnd: 0
paddingEnd: 0,
visibility: {
default: 'visible',
isDisabled: 'hidden'
}
});

const treeIcon = style({
Expand Down Expand Up @@ -302,7 +306,7 @@ export const TreeViewItemContent = (props: TreeViewItemContentProps): ReactNode
<div className={treeCellGrid({isDisabled, isNextSelected, isSelected, isFirst, isNextFocused})}>
{selectionMode !== 'none' && selectionBehavior === 'toggle' && (
// TODO: add transition?
<div className={treeCheckbox}>
<div className={treeCheckbox({isDisabled: isDisabled || !state.selectionManager.canSelectItem(id) || state.disabledKeys.has(id)})}>
<Checkbox slot="selection" />
</div>
)}
Expand All @@ -319,8 +323,8 @@ export const TreeViewItemContent = (props: TreeViewItemContentProps): ReactNode
render: centerBaseline({slot: 'icon', styles: treeIcon}),
styles: style({size: fontRelative(20), flexShrink: 0})
}],
[ActionButtonGroupContext, {styles: treeActions}],
[ActionMenuContext, {styles: treeActionMenu, isQuiet: true}]
[ActionButtonGroupContext, {styles: treeActions, isDisabled}],
[ActionMenuContext, {styles: treeActionMenu, isQuiet: true, isDisabled}]
]}>
{typeof children === 'string' ? <Text>{children}</Text> : children}
</Provider>
Expand Down
242 changes: 0 additions & 242 deletions packages/@react-spectrum/s2/test/Tree.test.tsx

This file was deleted.

Loading
Loading