diff --git a/.stylelintrc b/.stylelintrc index 7b73b511d6..a0819dac1a 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -41,7 +41,6 @@ ] } ], - "@cloudscape-design/no-motion-outside-of-mixin": [true], "@cloudscape-design/z-index-value-constraint": [true], "plugin/no-unsupported-browser-features": [ true, @@ -58,7 +57,8 @@ ], "rules": { "property-disallowed-list": ["border", "border-radius", "border-style", "margin", "padding"], - "csstools/use-logical": "always" + "csstools/use-logical": "always", + "@cloudscape-design/no-motion-outside-of-mixin": [true] } } ], diff --git a/build-tools/utils/pluralize.js b/build-tools/utils/pluralize.js index c23250be8a..b5308c2a3a 100644 --- a/build-tools/utils/pluralize.js +++ b/build-tools/utils/pluralize.js @@ -79,6 +79,7 @@ const pluralizationMap = { ToggleButton: 'ToggleButtons', TokenGroup: 'TokenGroups', TopNavigation: 'TopNavigations', + TreeView: 'TreeViews', TutorialPanel: 'TutorialPanels', Wizard: 'Wizards', }; diff --git a/pages/tree-view/basic.page.tsx b/pages/tree-view/basic.page.tsx new file mode 100644 index 0000000000..93042d884b --- /dev/null +++ b/pages/tree-view/basic.page.tsx @@ -0,0 +1,109 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import React, { useState } from 'react'; +import clsx from 'clsx'; + +import Box from '~components/box'; +import Container from '~components/container'; +import FormField from '~components/form-field'; +import Grid from '~components/grid'; +import Icon from '~components/icon'; +import Select, { SelectProps } from '~components/select'; +import TreeView, { TreeViewProps } from '~components/tree-view'; + +import ScreenshotArea from '../utils/screenshot-area'; +import { Actions } from './common'; +import { items } from './items/basic-page-items'; + +import styles from './styles.scss'; + +export default function BasicTreeView() { + const [expandedItems, setExpandedItems] = useState>(['1', '4.1']); + const [toggleIconType, setToggleIconType] = useState({ + label: 'Default', + value: 'default', + }); + + const renderItemToggleIcon = ({ expanded }: TreeViewProps.ItemToggleRenderIconData) => { + if (toggleIconType.value === 'custom') { + return ; + } + + if (toggleIconType.value === 'custom-with-slow-animation') { + return ( + + ); + } + }; + + return ( + +

Basic tree view

+ + +
+ +