Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Rename KuiGalleryButton to KuiGalleryItem (elastic#14118)
Browse files Browse the repository at this point in the history
  • Loading branch information
timroes authored and Tim Roes committed Oct 2, 2017
1 parent 308c77c commit 6c057a2
Show file tree
Hide file tree
Showing 24 changed files with 131 additions and 131 deletions.
8 changes: 4 additions & 4 deletions src/core_plugins/kibana/public/visualize/wizard/step_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ <h2 class="kuiSubTitle kuiVerticalRhythm">
<!-- Gallery of buttons for each vis type -->
<div class="kuiGallery kuiVerticalRhythm">
<a
class="kuiGalleryButton"
class="kuiGalleryItem"
ng-repeat="type in category.list"
ng-href="{{ getVisTypeUrl(type) }}"
tooltip="{{ getVisTypeTooltip(type) }}"
tooltip-placement="{{ getVisTypeTooltipPosition($parent.$index) }}"
aria-describedby="visDescription_{{ ::getVisTypeId(type) }}"
>
<div class="kuiGalleryButton__image">
<div class="kuiGalleryItem__image">
<img
ng-if="type.image"
aria-hidden="true"
Expand All @@ -67,14 +67,14 @@ <h2 class="kuiSubTitle kuiVerticalRhythm">
</div>

<div
class="kuiGalleryButton__label"
class="kuiGalleryItem__label"
data-test-subj="visualizeWizardChartTypeTitle"
>
{{ type.title }}
</div>

<div
class="kuiGalleryButton__icon kuiIcon fa-flask"
class="kuiGalleryItem__icon kuiIcon fa-flask"
ng-if="type.isExperimental"
></div>

Expand Down
10 changes: 5 additions & 5 deletions ui_framework/dist/ui_framework.css
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ main {
-ms-flex-wrap: wrap;
flex-wrap: wrap; }

.kuiGalleryButton {
.kuiGalleryItem {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand Down Expand Up @@ -1395,11 +1395,11 @@ main {
border: 1px solid #CED5DA;
border-radius: 4px;
text-decoration: none; }
.kuiGalleryButton:hover {
.kuiGalleryItem:hover {
background-color: #FFFFFF;
border-color: #00A6FF; }

.kuiGalleryButton__image {
.kuiGalleryItem__image {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -1419,7 +1419,7 @@ main {
/**
* 1. Truncate overflowing text.
*/
.kuiGalleryButton__label {
.kuiGalleryItem__label {
font-size: 14px;
color: #191E23;
text-align: center;
Expand All @@ -1432,7 +1432,7 @@ main {
text-overflow: ellipsis;
/* 1 */ }

.kuiGalleryButton__icon {
.kuiGalleryItem__icon {
position: absolute;
top: 5px;
right: 5px;
Expand Down
80 changes: 40 additions & 40 deletions ui_framework/doc_site/src/views/gallery/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';

import {
KuiGallery,
KuiGalleryButton,
KuiGalleryButtonIcon,
KuiGalleryButtonImage,
KuiGalleryButtonLabel
KuiGalleryItem,
KuiGalleryItemIcon,
KuiGalleryItemImage,
KuiGalleryItemLabel
} from '../../../../components';

export default () => {
Expand All @@ -25,47 +25,47 @@ export default () => {
</h2>

<KuiGallery className="kuiVerticalRhythmSmall">
<KuiGalleryButton href="#">
<KuiGalleryButtonImage style={imageStyle}/>
<KuiGalleryItem href="#">
<KuiGalleryItemImage style={imageStyle}/>

<KuiGalleryButtonLabel>
<KuiGalleryItemLabel>
Item A
</KuiGalleryButtonLabel>
</KuiGalleryItemLabel>

<KuiGalleryButtonIcon className="fa-flask"/>
</KuiGalleryButton>
<KuiGalleryItemIcon className="fa-flask"/>
</KuiGalleryItem>

<KuiGalleryButton href="#">
<KuiGalleryButtonImage style={imageStyle}/>
<KuiGalleryItem href="#">
<KuiGalleryItemImage style={imageStyle}/>

<KuiGalleryButtonLabel>
<KuiGalleryItemLabel>
Item B
</KuiGalleryButtonLabel>
</KuiGalleryButton>
</KuiGalleryItemLabel>
</KuiGalleryItem>

<KuiGalleryButton>
<KuiGalleryButtonImage style={imageStyle}/>
<KuiGalleryItem>
<KuiGalleryItemImage style={imageStyle}/>

<KuiGalleryButtonLabel>
<KuiGalleryItemLabel>
Item C
</KuiGalleryButtonLabel>
</KuiGalleryButton>
</KuiGalleryItemLabel>
</KuiGalleryItem>

<KuiGalleryButton>
<KuiGalleryButtonImage style={imageStyle}/>
<KuiGalleryItem>
<KuiGalleryItemImage style={imageStyle}/>

<KuiGalleryButtonLabel>
<KuiGalleryItemLabel>
Item D
</KuiGalleryButtonLabel>
</KuiGalleryButton>
</KuiGalleryItemLabel>
</KuiGalleryItem>

<KuiGalleryButton>
<KuiGalleryButtonImage style={imageStyle}/>
<KuiGalleryItem>
<KuiGalleryItemImage style={imageStyle}/>

<KuiGalleryButtonLabel>
<KuiGalleryItemLabel>
Item E
</KuiGalleryButtonLabel>
</KuiGalleryButton>
</KuiGalleryItemLabel>
</KuiGalleryItem>
</KuiGallery>
</div>

Expand All @@ -75,21 +75,21 @@ export default () => {
</div>

<KuiGallery className="kuiVerticalRhythmSmall">
<KuiGalleryButton href="#">
<KuiGalleryButtonImage style={imageStyle}/>
<KuiGalleryItem href="#">
<KuiGalleryItemImage style={imageStyle}/>

<KuiGalleryButtonLabel>
<KuiGalleryItemLabel>
Item F
</KuiGalleryButtonLabel>
</KuiGalleryButton>
</KuiGalleryItemLabel>
</KuiGalleryItem>

<KuiGalleryButton href="#">
<KuiGalleryButtonImage style={imageStyle}/>
<KuiGalleryItem href="#">
<KuiGalleryItemImage style={imageStyle}/>

<KuiGalleryButtonLabel>
<KuiGalleryItemLabel>
Item G with a long label with ellipsis
</KuiGalleryButtonLabel>
</KuiGalleryButton>
</KuiGalleryItemLabel>
</KuiGalleryItem>
</KuiGallery>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion ui_framework/doc_site/src/views/gallery/gallery_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default props => (
}]}
>
<GuideText>
Use GalleryButton to show a gallery item.
Use GalleryItem to show a gallery item.
It&rsquo;s an anchor and accepts all anchor properties.
</GuideText>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.kuiGalleryButton {
.kuiGalleryItem {
display: flex;
flex-direction: column;
align-items: center;
Expand All @@ -20,7 +20,7 @@
}
}

.kuiGalleryButton__image {
.kuiGalleryItem__image {
display: flex;
align-items: center;
justify-content: center;
Expand All @@ -32,7 +32,7 @@
/**
* 1. Truncate overflowing text.
*/
.kuiGalleryButton__label {
.kuiGalleryItem__label {
font-size: $kuiFontSize;
color: $kuiFontColor;
text-align: center;
Expand All @@ -42,7 +42,7 @@
text-overflow: ellipsis; /* 1 */
}

.kuiGalleryButton__icon {
.kuiGalleryItem__icon {
position: absolute;
top: 5px;
right: 5px;
Expand Down
2 changes: 1 addition & 1 deletion ui_framework/src/components/gallery/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ $galleryButtonRhythm: 20px;
$galleryButtonIconSize: 50px;

@import "gallery";
@import "gallery_button";
@import "gallery_item";

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders KuiGalleryButton href 1`] = `
exports[`renders KuiGalleryItem href 1`] = `
<a
aria-label="aria-label"
class="kuiGalleryButton testClass1 testClass2"
class="kuiGalleryItem testClass1 testClass2"
data-test-subj="test subject string"
href="#"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders KuiGalleryButtonIcon 1`] = `
exports[`renders KuiGalleryItemIcon 1`] = `
<div
aria-label="aria-label"
class="kuiGalleryButton__icon kuiIcon testClass1 testClass2"
class="kuiGalleryItem__icon kuiIcon testClass1 testClass2"
data-test-subj="test subject string"
>
children
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders KuiGalleryButtonLabel 1`] = `
exports[`renders KuiGalleryItemImage 1`] = `
<div
aria-label="aria-label"
class="kuiGalleryButton__label testClass1 testClass2"
class="kuiGalleryItem__image testClass1 testClass2"
data-test-subj="test subject string"
>
children
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders KuiGalleryButtonImage 1`] = `
exports[`renders KuiGalleryItemLabel 1`] = `
<div
aria-label="aria-label"
class="kuiGalleryButton__image testClass1 testClass2"
class="kuiGalleryItem__label testClass1 testClass2"
data-test-subj="test subject string"
>
children
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

export const KuiGalleryButton = ({ children, className, ...rest }) => {
const classes = classNames('kuiGalleryButton', className);
export const KuiGalleryItem = ({ children, className, ...rest }) => {
const classes = classNames('kuiGalleryItem', className);
return (
<a
className={classes}
Expand All @@ -13,7 +13,7 @@ export const KuiGalleryButton = ({ children, className, ...rest }) => {
</a>
);
};
KuiGalleryButton.propTypes = {
KuiGalleryItem.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import { render } from 'enzyme';
import { requiredProps } from '../../../test/required_props';

import {
KuiGalleryItem,
} from './gallery_item';

test('renders KuiGalleryItem href', () => {
const component = <KuiGalleryItem href="#" {...requiredProps}>children</KuiGalleryItem>;
expect(render(component)).toMatchSnapshot();
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

export const KuiGalleryButtonIcon = ({ children, className, ...rest }) => {
const classes = classNames('kuiGalleryButton__icon','kuiIcon', className);
export const KuiGalleryItemIcon = ({ children, className, ...rest }) => {
const classes = classNames('kuiGalleryItem__icon','kuiIcon', className);
return (
<div
className={classes}
Expand All @@ -13,7 +13,7 @@ export const KuiGalleryButtonIcon = ({ children, className, ...rest }) => {
</div>
);
};
KuiGalleryButtonIcon.propTypes = {
KuiGalleryItemIcon.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
};
Loading

0 comments on commit 6c057a2

Please sign in to comment.