Skip to content

Commit bbd4bdd

Browse files
authored
Merge pull request #377 from US-CBP/bugfix/Clean-up-Comments
Code clean up from storybook review
2 parents 3cd4901 + a887b7f commit bbd4bdd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+48
-265
lines changed

packages/web-components/src/components/cbp-action-bar/cbp-action-bar.specs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ The Action Bar acts as a container for form controls (buttons) or other tools to
1414
* The descriptive text in the named slot is aligned left.
1515
* The controls are aligned to the right.
1616
* The Action Bar has two variants - inline and floating.
17-
* The inline variant is teh default and renders in the flow of the document.
17+
* The inline variant is the default and renders in the flow of the document.
1818
* The floating variant is rendered at bottom of viewport, primarily tools that affect the content of the whole page.
1919

2020
### Responsiveness
2121

2222
* The Action Bar will fill 100% of the screen (floating) or parent (inline).
2323
* The Action Bar will wrap as needed at smaller screen sizes, but...
2424
* It is up to the developer to make sure its contents are fully responsive.
25-
* The sticky variant uses the responsive padding token to adjust outer padding at the same ratio as other template elements.
25+
* The floating variant uses the responsive padding token to adjust outer padding at the same ratio as other template elements.
2626

2727
### Accessibility
2828

packages/web-components/src/components/cbp-app-header/cbp-app-header.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ cbp-app-header {
7878
outline-offset: calc(-2 * var(--cbp-border-size-md));
7979
}
8080

81-
// > form{
82-
// display: inline-flex;
8381

8482
input {
8583
flex-grow: 1;
@@ -102,6 +100,5 @@ cbp-app-header {
102100
gap: var(--cbp-space-4x);
103101
align-items: center;
104102
}
105-
106103
}
107104
}

packages/web-components/src/components/cbp-app-header/cbp-app-header.stories.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ const Template = ({ drawerid, store, search, searchMethod, searchAction, items,
152152
// Cancel form submit event on search to prevent full page reload
153153
const AppHeader = document.querySelector('cbp-app-header');
154154
AppHeader?.addEventListener('searchSubmit', function(e) {
155-
//console.log('searchSubmit event: ', e);
156155
e.detail.nativeEvent.preventDefault();
157-
//AppHeader.closeSearch();
158156
});
159157

160158
// Cancel events on anchors to prevent navigating away from the story
@@ -232,9 +230,7 @@ const AppHeaderWithSubnavTemplate = ({ drawerid, store, search, searchMethod, se
232230
// Cancel form submit event on search to prevent full page reload
233231
const AppHeader = document.querySelector('cbp-app-header');
234232
AppHeader?.addEventListener('searchSubmit', function(e) {
235-
//console.log('searchSubmit event: ', e);
236233
e.detail.nativeEvent.preventDefault();
237-
//AppHeader.closeSearch();
238234
});
239235

240236
// Cancel events on anchors to prevent navigating away from the story

packages/web-components/src/components/cbp-button/cbp-button.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, Prop, Element, Event, EventEmitter, Host, h } from '@stencil/core';
22
import { setCSSProps, getElementAttrs, createNamespaceKey } from '../../utils/utils';
3-
//import state from './store';
43

54
/**
65
* The Button component represents a UI control visually styled like a button, regardless of whether
@@ -74,10 +73,7 @@ export class CbpButton {
7473
* rendered on the button with the specified value.
7574
*/
7675
@Prop() controls: string;
77-
78-
/* ??? */
79-
//@Prop() controlProp: "pressed" | "expanded";
80-
76+
8177
/** The property on the target element being toggled by the button/control (e.g., "open"). */
8278
@Prop() targetProp: string;
8379

@@ -105,7 +101,6 @@ export class CbpButton {
105101

106102

107103
handleClick(e): void {
108-
// If this is a control for something, manage state through stencil store
109104
if (this.controls) {
110105
// If the controlled element wasn't found, try to find it again
111106
if (!this.controlTarget) this.controlTarget = document.querySelector(`#${this.controls}`);

packages/web-components/src/components/cbp-card/cbp-card.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,6 @@ cbp-card {
518518

519519
&[disabled]{
520520

521-
// a{
522-
// pointer-events: none;
523-
// cursor: not-allowed;
524-
// }
525-
526521
--cbp-card-color-background: var(--cbp-color-interactive-disabled-light);
527522
--cbp-card-color-border: var(--cbp-color-interactive-disabled-dark);
528523
--cbp-card-color-title: var(--cbp-color-interactive-disabled-dark);

packages/web-components/src/components/cbp-card/cbp-card.stories.tsx

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ export default {
1212
description: 'Set the body text of the card',
1313
control: 'text',
1414
},
15-
// color: {
16-
// control: 'select',
17-
// options: ['default', 'info', 'success', 'warning', 'danger'],
18-
// },
1915
stretch: {
2016
control: 'boolean',
2117
},
@@ -110,10 +106,6 @@ const DecisionTemplate = ({ title, color, bodyText, actionsLayout, actionsFill,
110106
${renderActions(actionsLayout, actionsFill, color,context, withIcon, actionsConfig)}
111107
</cbp-card>
112108
`;
113-
// <h4 slot="cbp-card-title" id="card-heading-1">
114-
// ${withIcon ? `<cbp-icon name="triangle-exclamation" size="1.25rem"></cbp-icon>` : ''}
115-
// ${title}
116-
// </h4>
117109
};
118110

119111
const BannerTemplate = ({ title, color, bodyText, withIcon, context, sx }) => {
@@ -215,97 +207,7 @@ const InteractiveTemplate = ({ title, color, disabled, bodyText, withIcon, inter
215207
`;
216208
};
217209

218-
// For testing only:
219-
/*
220-
const CardsGridTemplate = ({ title, color, stretch, bodyText, actionsLayout, actionsConfig, sx }) => {
221-
return `
222-
<cbp-flex
223-
wrap="wrap"
224-
gap="1rem"
225-
align-items="stretch"
226-
>
227-
<cbp-flex-item flex-basis="15rem">
228-
<cbp-card
229-
variant="decision"
230-
${stretch ? 'stretch' : ''}
231-
${color ? `color=${color}` : ''}
232-
${sx ? `sx='${JSON.stringify(sx)}'` : ''}
233-
>
234-
<h4 slot="cbp-card-title">${title}</h4>
235-
<p>${bodyText}</p>
236-
${renderActions(actionsLayout, actionsConfig)}
237-
</cbp-card>
238-
</cbp-flex-item>
239-
240-
<cbp-flex-item flex-basis="15rem">
241-
<cbp-card
242-
variant="decision"
243-
${stretch ? 'stretch' : ''}
244-
${color ? `color=${color}` : ''}
245-
${sx ? `sx='${JSON.stringify(sx)}'` : ''}
246-
>
247-
<h4 slot="cbp-card-title">${title}</h4>
248-
<p>
249-
${bodyText}
250-
${bodyText}
251-
${bodyText}
252-
</p>
253-
${renderActions(actionsLayout, actionsConfig)}
254-
</cbp-card>
255-
</cbp-flex-item>
256210

257-
<cbp-flex-item flex-basis="15rem">
258-
<cbp-card
259-
variant="decision"
260-
${stretch ? 'stretch' : ''}
261-
${color ? `color=${color}` : ''}
262-
${sx ? `sx='${JSON.stringify(sx)}'` : ''}
263-
>
264-
<h4 slot="cbp-card-title">${title}</h4>
265-
<p>${bodyText}</p>
266-
${renderActions(actionsLayout, actionsConfig)}
267-
</cbp-card>
268-
</cbp-flex-item>
269-
</cbp-flex>
270-
`;
271-
};
272-
export const CardsGrid = CardsGridTemplate.bind({});
273-
CardsGrid.argTypes = {
274-
actionsLayout: {
275-
name: 'Actions Layout',
276-
description: 'Choose actions layout of the card component',
277-
control: 'radio',
278-
options: ['single', 'double', 'triple'],
279-
},
280-
actionsConfig: {
281-
name: 'Decision Card Actions',
282-
description: 'Configure card button labels and colors. Available button colors: `primary`, `secondary`, `tertiary` and `danger`',
283-
control: 'object',
284-
},
285-
};
286-
CardsGrid.args = {
287-
title: 'Banner Card Title',
288-
bodyText: 'Here is an example of some supplementary text for this purely informational card.',
289-
actionsLayout: 'single',
290-
actionsConfig: {
291-
btn1: {
292-
label: 'Action 1',
293-
tag: 'button',
294-
color: 'primary',
295-
},
296-
btn2: {
297-
label: 'Action 2',
298-
tag: 'button',
299-
color: 'secondary',
300-
},
301-
btn3: {
302-
label: 'Action 3',
303-
tag: 'button',
304-
color: 'tertiary',
305-
},
306-
},
307-
};
308-
*/
309211

310212
export const GeneralCard = GeneralTemplate.bind({});
311213
GeneralCard.args = {

packages/web-components/src/components/cbp-carousel-item/cbp-carousel-item.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cbp-carousel-item {
22
display: inline-block;
3-
height: var(--cbp-carousel-item-height); //TODO: do these need values in this file if being set via prop?
3+
height: var(--cbp-carousel-item-height);
44
width: var(--cbp-carousel-item-width);
55
flex-shrink: 0;
66

packages/web-components/src/components/cbp-carousel/cbp-carousel.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export class CbpCarousel {
5757

5858
scrollToItem() {
5959
let carouselOffset = 0;
60-
//let carouselOffsetStart = getComputedStyle(this.control).getPropertyValue('--cbp-carousel-offset');
6160

6261
for (let x = 0; x < this.current; x++) {
6362
carouselOffset -= this.items[x].offsetWidth;

packages/web-components/src/components/cbp-checkbox/cbp-checklist.stories.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,6 @@ const ChecklistHorizontalTemplate = ({ checkboxes, label, description, fieldId,
126126
`;
127127
};
128128

129-
/*
130-
<cbp-resize-observer>
131-
<cbp-flex gap="var(--cbp-space-5x)" breakpoint="31rem" sx='{"width":"max-content"}'>
132-
${generateCheckboxes(context, checkboxes)}
133-
</cbp-flex>
134-
</cbp-resize-observer>
135-
</cbp-form-field>
136-
*/
137-
138129
export const ChecklistHorizontal = ChecklistHorizontalTemplate.bind({});
139130
ChecklistHorizontal.args = {
140131
gap: 'var(--cbp-space-1x) var(--cbp-space-5x)',

packages/web-components/src/components/cbp-container/cbp-container.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export class CbpContainer {
2424
/** Specifies the width of the inner container area. */
2525
@Prop() width: string;
2626

27-
//@Prop() padding: string;
28-
2927
/** Supports adding inline styles as an object */
3028
@Prop() sx: any = {};
3129

@@ -37,7 +35,6 @@ export class CbpContainer {
3735
"--cbp-container-color-text": this.textColor,
3836
"--cbp-container-color-background": this.background,
3937
"--cbp-container-inner-width": this.width,
40-
//"--cbp-container-content-padding": this.padding,
4138
...this.sx,
4239
});
4340
}

0 commit comments

Comments
 (0)