UNPKG

@awsui/components-react

Version:

On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en

30 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 const dom_1 = require("@awsui/test-utils-core/dom"); const token_1 = require("./token"); const styles_selectors_js_1 = require("../../../internal/components/token-list/styles.selectors.js"); const styles_selectors_js_2 = require("../../../token-group/styles.selectors.js"); class TokenGroupWrapper extends dom_1.ComponentWrapper { findTokens() { return this.findAllByClassName(styles_selectors_js_2.default.token).map(tokenElement => new token_1.TokenGroupItemWrapper(tokenElement.getElement())); } /** * Returns a token from the group for a given index. * * @param tokenIndex 1-based index of the token to return. */ findToken(tokenIndex) { return this.findComponent(`.${styles_selectors_js_1.default['list-item']}:nth-child(${tokenIndex}) > .${styles_selectors_js_2.default.token}`, token_1.TokenGroupItemWrapper); } /** * Returns the token toggle button. */ findTokenToggle() { return this.findByClassName(styles_selectors_js_1.default.toggle); } } TokenGroupWrapper.rootSelector = styles_selectors_js_2.default.root; exports.default = TokenGroupWrapper; //# sourceMappingURL=index.js.map