Skip to content

Commit b99080e

Browse files
committed
Cleans-up components (wip)
1 parent 36d6991 commit b99080e

File tree

9 files changed

+107
-1094
lines changed

9 files changed

+107
-1094
lines changed

assets/bundle.js

Lines changed: 46 additions & 996 deletions
Large diffs are not rendered by default.

assets/bundle.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ <h3 slot="title">GitLens for VS Code</h3>
9595
popular Git extension on the Visual Studio Marketplace with 29+ million installs and 2 million daily
9696
active users.
9797
</p>
98-
<dl>
98+
<dl slot="meta">
9999
<dt>Company</dt>
100100
<dd>GitKraken</dd>
101101

@@ -118,7 +118,7 @@ <h3 slot="title">Chirp Design System</h3>
118118
between design and engineering and to grow our team's skill-set as well as the front-end culture at
119119
Chewy.
120120
</p>
121-
<dl>
121+
<dl slot="meta">
122122
<dt>Company</dt>
123123
<dd>Chewy.com</dd>
124124

@@ -140,7 +140,7 @@ <h3 slot="title">E-Commerce Hybrid <abbr title="Single Page Application">SPA</ab
140140
Embedded with design and engineering teams to onboard the design system, implement experiments and
141141
advise on front-end best practices. Shipped Chewy's first hybrid experience with Cart and Checkout.
142142
</p>
143-
<dl>
143+
<dl slot="meta">
144144
<dt>Company</dt>
145145
<dd>Chewy.com</dd>
146146

@@ -162,7 +162,7 @@ <h3 slot="title">Legacy SaaS Application Redesign</h3>
162162
Redesign of a large scale legacy web application with over 100 screens. Incorporated a new design system
163163
as part of the redesign.
164164
</p>
165-
<dl>
165+
<dl slot="meta">
166166
<dt>Company</dt>
167167
<dd>ScribbleLive (ion interactive)</dd>
168168

@@ -184,7 +184,7 @@ <h3 slot="title">SaaS Design System</h3>
184184
Created a design system for our core applications and advocated for atomic design practices org-wide.
185185
Created a CSS architecture for classification, naming and hierarchy, implemented in four applications.
186186
</p>
187-
<dl>
187+
<dl slot="meta">
188188
<dt>Company</dt>
189189
<dd>ScribbleLive (ion interactive)</dd>
190190

@@ -205,7 +205,7 @@ <h3 slot="title">Quiz and Assessment Builder</h3>
205205
<p>
206206
Developed publishing and participant UIs for collecting and visualizing participant and aggregate data.
207207
</p>
208-
<dl>
208+
<dl slot="meta">
209209
<dt>Company</dt>
210210
<dd>ion interactive</dd>
211211

@@ -233,7 +233,7 @@ <h3 slot="title">Interactive Content Builder</h3>
233233
draggable elements and interactive menus. Created highly customizable web components with app-like
234234
interactivity and mobile-first responsiveness.
235235
</p>
236-
<dl>
236+
<dl slot="meta">
237237
<dt>Company</dt>
238238
<dd>ion interactive</dd>
239239

@@ -256,7 +256,7 @@ <h3 slot="title">Telephony System Dashboard</h3>
256256
popular Git extension on the Visual Studio Marketplace with 29+ million installs and 2 million daily
257257
active users.
258258
</p> -->
259-
<dl>
259+
<dl slot="meta">
260260
<dt>Company</dt>
261261
<dd>Stealth</dd>
262262

@@ -279,7 +279,7 @@ <h3 slot="title">Landing Page Concept</h3>
279279
popular Git extension on the Visual Studio Marketplace with 29+ million installs and 2 million daily
280280
active users.
281281
</p> -->
282-
<dl>
282+
<dl slot="meta">
283283
<dt>Company</dt>
284284
<dd>Landing Page Design</dd>
285285

@@ -302,7 +302,7 @@ <h3 slot="title">Redesign &amp; Vacation Packaging</h3>
302302
restructured the entire website's markup and styles, resulting in a modular, easy to implement, set of
303303
reusable interface patterns and JavaScript modules.
304304
</p>
305-
<dl>
305+
<dl slot="meta">
306306
<dt>Company</dt>
307307
<dd>Spirit Airlines</dd>
308308

@@ -320,7 +320,7 @@ <h3 slot="title">Cruise Microsite</h3>
320320
popular Git extension on the Visual Studio Marketplace with 29+ million installs and 2 million daily
321321
active users.
322322
</p> -->
323-
<dl>
323+
<dl slot="meta">
324324
<dt>Company</dt>
325325
<dd>Bahama Cruise Vacations</dd>
326326

src/components/base/base-element.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { LitElement } from 'lit';
22

33
export class KdBaseElement extends LitElement {
4-
protected fireEvent(name: string, detail?: unknown) {
5-
this.dispatchEvent(new CustomEvent(name, { detail }));
4+
protected fireEvent<T = unknown>(name: string, detail?: T): boolean {
5+
let event: CustomEvent<T>;
6+
if (detail === undefined) {
7+
event = new CustomEvent(name);
8+
} else {
9+
event = new CustomEvent(name, { detail });
10+
}
11+
return this.dispatchEvent(event);
612
}
713
}

src/components/base/interactive-element.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ export abstract class KdInteractiveElement extends KdBaseElement {
77
delegatesFocus: true,
88
};
99

10-
abstract control: HTMLElement;
10+
protected abstract _control: HTMLElement;
1111

1212
override focus(options?: FocusOptions) {
13-
this.control.focus(options);
13+
this._control.focus(options);
1414
}
1515

1616
override blur() {
17-
this.control.blur();
17+
this._control.blur();
1818
}
1919

2020
override click() {
21-
this.control.click();
21+
this._control.click();
2222
}
2323
}

src/components/button/form-button.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,11 @@ export class KdFormButton extends KdFormElement {
99
static override styles = [buttonBase];
1010

1111
@query('.button', true)
12-
private _buttonEl!: HTMLButtonElement;
12+
protected _control!: HTMLButtonElement;
1313

1414
@property({ reflect: true })
1515
override type: HTMLButtonElement['type'] = 'button';
1616

17-
override focus(options?: FocusOptions) {
18-
this._buttonEl.focus(options);
19-
}
20-
21-
override blur() {
22-
this._buttonEl.blur();
23-
}
24-
25-
override click() {
26-
this._buttonEl.click();
27-
}
28-
2917
private handleClick() {
3018
switch (this.type) {
3119
case 'submit':
@@ -37,11 +25,11 @@ export class KdFormButton extends KdFormElement {
3725
}
3826
}
3927
private handleFocus() {
40-
this.emit('kd-focus');
28+
this.fireEvent('kd-focus');
4129
}
4230

4331
private handleBlur() {
44-
this.emit('kd-blur');
32+
this.fireEvent('kd-blur');
4533
}
4634

4735
override render() {

src/components/button/link-button.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,20 @@
11
import { customElement, property, query } from 'lit/decorators.js';
2-
import { LitElement, html } from 'lit';
2+
import { html } from 'lit';
33
import { ifDefined } from 'lit/directives/if-defined.js';
4-
import { KdBaseElement } from '../base/base-element';
4+
import { KdInteractiveElement } from '../base/interactive-element';
55
import { buttonBase } from './button.css';
66

77
@customElement('kd-link-button')
8-
export class KdLinkButton extends KdBaseElement {
9-
static override shadowRootOptions: ShadowRootInit = {
10-
...LitElement.shadowRootOptions,
11-
delegatesFocus: true,
12-
};
8+
export class KdLinkButton extends KdInteractiveElement {
139
static override styles = [buttonBase];
1410

1511
@query('.button', true)
16-
private _buttonEl!: HTMLButtonElement;
12+
protected _control!: HTMLButtonElement;
1713

1814
@property() href?: HTMLAnchorElement['href'];
1915
@property() target?: HTMLAnchorElement['target'];
2016
@property() rel?: HTMLAnchorElement['rel'];
2117

22-
override focus(options?: FocusOptions) {
23-
this._buttonEl.focus(options);
24-
}
25-
26-
override blur() {
27-
this._buttonEl.blur();
28-
}
29-
30-
override click() {
31-
this._buttonEl.click();
32-
}
33-
3418
override render() {
3519
return html`<a
3620
class="button"

src/components/life-events/life-event.ts

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class KdLifeEvent extends KdBaseElement {
1212
contain: content;
1313
display: flex;
1414
flex-direction: row;
15+
gap: var(--spacing-xl);
1516
}
1617
1718
*,
@@ -24,43 +25,6 @@ export class KdLifeEvent extends KdBaseElement {
2425
flex: 0 0 var(--size-5);
2526
}
2627
27-
.year {
28-
position: relative;
29-
display: inline-block;
30-
font-size: var(--size--1);
31-
line-height: 1;
32-
font-weight: bold;
33-
transform: translateX(-50%);
34-
padding-inline: var(--spacing-lg) var(--spacing-xs);
35-
padding-block: var(--spacing-xs);
36-
margin-inline-start: var(--size-2);
37-
background: var(--color-primary-background);
38-
border: 2px solid var(--color-primary-foreground);
39-
}
40-
41-
/* make an arrow before .year */
42-
.year::before,
43-
.year::after {
44-
position: absolute;
45-
inset-block: 50%;
46-
inset-inline-start: var(--spacing-xs);
47-
transform: translateY(-50%);
48-
display: inline-block;
49-
content: '';
50-
block-size: var(--type-small-size);
51-
aspect-ratio: 2/3;
52-
clip-path: polygon(100% 50%, 0 0, 0 100%);
53-
/* vertical-align: text-bottom; */
54-
}
55-
56-
.year::before {
57-
background: var(--color-raw-blue-50);
58-
}
59-
.year::after {
60-
background: var(--color-raw-red-40);
61-
transform: translateX(50%) translateY(-50%);
62-
}
63-
6428
.year2 {
6529
position: relative;
6630
display: flex;
@@ -72,11 +36,13 @@ export class KdLifeEvent extends KdBaseElement {
7236
width: max-content;
7337
padding-inline: var(--spacing-md);
7438
aspect-ratio: 1;
75-
margin-inline-start: var(--size-3);
39+
margin-inline: auto;
40+
/* margin-inline-start: var(--size-3); */
7641
margin-block-start: var(--size-1);
77-
transform: translateX(-50%) rotateZ(-45deg);
42+
/* transform: translateX(-50%) rotateZ(-45deg); */
43+
transform: rotateZ(-45deg);
7844
color: var(--color-primary-background);
79-
background-color: var(--color-primary-background);
45+
/* background-color: var(--color-primary-background); */
8046
}
8147
8248
.year2::after {
@@ -112,9 +78,14 @@ export class KdLifeEvent extends KdBaseElement {
11278
}
11379
11480
.event {
81+
flex: 1;
82+
display: flex;
83+
flex-direction: column;
84+
gap: var(--spacing-lg);
11585
}
11686
11787
.date-range {
88+
line-height: 1;
11889
}
11990
12091
.media {
@@ -127,11 +98,24 @@ export class KdLifeEvent extends KdBaseElement {
12798
12899
.title {
129100
display: block;
101+
line-height: 1;
130102
}
131103
132104
.content {
133105
display: block;
134106
}
107+
108+
.meta {
109+
display: block;
110+
}
111+
112+
::slotted(*) {
113+
margin-block-start: 0;
114+
}
115+
116+
::slotted(*:last-child) {
117+
margin-block-end: 0;
118+
}
135119
`,
136120
];
137121

@@ -190,7 +174,7 @@ export class KdLifeEvent extends KdBaseElement {
190174
<slot name="title" class="title"></slot>
191175
<slot class="content"></slot>
192176
</div>
193-
<div class="meta"></div>
177+
<slot name="meta" class="meta"></slot>
194178
</article>
195179
`;
196180
}

src/components/life-events/life-events.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export class KdLifeEvents extends KdBaseElement {
2020
inline-size: 2px;
2121
background-color: var(--color-raw-blue-30);
2222
inset-block-start: 0;
23-
inset-inline-start: var(--size-3);
23+
inset-inline-start: calc(var(--size-5) / 2);
24+
transform: translateX(-50%);
2425
}
2526
2627
.events {

0 commit comments

Comments
 (0)