mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 02:57:59 +00:00
* move script to scripts folder * add docfy to router and scripts * add docfy to router and scripts * fix jsdoc syntax * add component markdown files to gitignore * improve error handling for scripts * tidy up remaining jsdoc syntax * add sample jsdoc components * add known issue info * make not using multi-line components clearer * make generating docs clearer * update copy * final how to docfy cleanup * fix ts file @module syntax * fix read more syntax * make docfy typescript compatible
40 lines
1020 B
JavaScript
40 lines
1020 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Component from '@glimmer/component';
|
|
import { assert } from '@ember/debug';
|
|
|
|
const DIRECTIONS = ['right', 'left', 'up', 'down'];
|
|
|
|
/**
|
|
* @deprecated
|
|
* @module Chevron
|
|
* * Use HDS icons instead
|
|
* Chevron components render Icon with one of the "chevron-" glyphs.
|
|
*
|
|
* @example
|
|
* <Chevron @direction="up" />
|
|
*
|
|
* @param {string} [direction="right"] - the direction the chevron icon points. Accepted values are "right", "down", "left", "up".
|
|
* @param {string} [isButton=false] - if true, adjusts the CSS classes to push the icon closer to the right of a button.
|
|
*
|
|
*/
|
|
|
|
export default class Chevron extends Component {
|
|
get direction() {
|
|
return this.args.direction || 'right';
|
|
}
|
|
|
|
get glyph() {
|
|
const { direction } = this;
|
|
|
|
assert(
|
|
`The direction property of Chevron must be one of the following: ${DIRECTIONS.join(', ')}`,
|
|
DIRECTIONS.includes(direction)
|
|
);
|
|
return `chevron-${direction}`;
|
|
}
|
|
}
|