Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jabbett committed Dec 15, 2023
2 parents 58de772 + 04feaff commit 2e66bc7
Show file tree
Hide file tree
Showing 34 changed files with 1,111 additions and 153 deletions.
20 changes: 20 additions & 0 deletions .storybook/preview.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,24 @@

.row + .row {
margin-top: 1em;
}

[id^="story--utilities-flex"] .d-flex, [id^="story--utilities-flex"] .d-inline-flex {
background-color: var(--color-ivory);
border: 1px dotted var(--color-pine);
margin-bottom: var(--spacing-md);
}

[id^="story--utilities-flex"] .d-flex > div, [id^="story--utilities-flex"] .d-inline-flex > div {
background-color: var(--color-mint);
border: 1px solid var(--color-pine);
padding: var(--spacing-sm);
}

[id^="story--utilities-flex"] [class^="d-flex align-items"] {
height: 6rem;
}

[id^="story--utilities-flex"] [class^="d-flex align-content"] {
height: 10rem;
}
Binary file added assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/progress_dial_elevated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/progress_dial_high.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/progress_dial_low.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/progress_dial_unknown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@sharpen-com/kezuri",
"description": "The Sharpen Design System",
"license": "MIT",
"version": "0.3.0",
"version": "0.4.0",
"main": "dist/index.cjs.js",
"module": "dist/index.js",
"es2015": "dist/esm/index.mjs",
Expand Down
Binary file added resources/progress_dial.psd
Binary file not shown.
40 changes: 40 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export namespace Components {
*/
"type": LabelType;
}
interface SharpenLoading {
}
interface SharpenMenu {
"attachment": string;
"targetAttachment": string;
Expand Down Expand Up @@ -115,6 +117,15 @@ export namespace Components {
"showDescription": boolean;
"statusLabel": string;
}
interface SharpenProgressDial {
"elevatedThreshold": number;
"highThreshold": number;
"lowThreshold": number;
"progressVal": number;
"showDescription": boolean;
"showValue": boolean;
"statusLabel": string;
}
}
declare global {
interface HTMLSharpenAlertElement extends Components.SharpenAlert, HTMLStencilElement {
Expand Down Expand Up @@ -177,6 +188,12 @@ declare global {
prototype: HTMLSharpenLabelElement;
new (): HTMLSharpenLabelElement;
};
interface HTMLSharpenLoadingElement extends Components.SharpenLoading, HTMLStencilElement {
}
var HTMLSharpenLoadingElement: {
prototype: HTMLSharpenLoadingElement;
new (): HTMLSharpenLoadingElement;
};
interface HTMLSharpenMenuElement extends Components.SharpenMenu, HTMLStencilElement {
}
var HTMLSharpenMenuElement: {
Expand Down Expand Up @@ -213,6 +230,12 @@ declare global {
prototype: HTMLSharpenProgressBarElement;
new (): HTMLSharpenProgressBarElement;
};
interface HTMLSharpenProgressDialElement extends Components.SharpenProgressDial, HTMLStencilElement {
}
var HTMLSharpenProgressDialElement: {
prototype: HTMLSharpenProgressDialElement;
new (): HTMLSharpenProgressDialElement;
};
interface HTMLElementTagNameMap {
"sharpen-alert": HTMLSharpenAlertElement;
"sharpen-assessment-header": HTMLSharpenAssessmentHeaderElement;
Expand All @@ -224,12 +247,14 @@ declare global {
"sharpen-empty": HTMLSharpenEmptyElement;
"sharpen-footer": HTMLSharpenFooterElement;
"sharpen-label": HTMLSharpenLabelElement;
"sharpen-loading": HTMLSharpenLoadingElement;
"sharpen-menu": HTMLSharpenMenuElement;
"sharpen-nav-link": HTMLSharpenNavLinkElement;
"sharpen-page-navigation": HTMLSharpenPageNavigationElement;
"sharpen-primary-navigation": HTMLSharpenPrimaryNavigationElement;
"sharpen-profile-card": HTMLSharpenProfileCardElement;
"sharpen-progress-bar": HTMLSharpenProgressBarElement;
"sharpen-progress-dial": HTMLSharpenProgressDialElement;
}
}
declare namespace LocalJSX {
Expand Down Expand Up @@ -300,6 +325,8 @@ declare namespace LocalJSX {
*/
"type": LabelType;
}
interface SharpenLoading {
}
interface SharpenMenu {
"attachment"?: string;
"targetAttachment"?: string;
Expand Down Expand Up @@ -334,6 +361,15 @@ declare namespace LocalJSX {
"showDescription"?: boolean;
"statusLabel"?: string;
}
interface SharpenProgressDial {
"elevatedThreshold"?: number;
"highThreshold"?: number;
"lowThreshold"?: number;
"progressVal"?: number;
"showDescription"?: boolean;
"showValue"?: boolean;
"statusLabel"?: string;
}
interface IntrinsicElements {
"sharpen-alert": SharpenAlert;
"sharpen-assessment-header": SharpenAssessmentHeader;
Expand All @@ -345,12 +381,14 @@ declare namespace LocalJSX {
"sharpen-empty": SharpenEmpty;
"sharpen-footer": SharpenFooter;
"sharpen-label": SharpenLabel;
"sharpen-loading": SharpenLoading;
"sharpen-menu": SharpenMenu;
"sharpen-nav-link": SharpenNavLink;
"sharpen-page-navigation": SharpenPageNavigation;
"sharpen-primary-navigation": SharpenPrimaryNavigation;
"sharpen-profile-card": SharpenProfileCard;
"sharpen-progress-bar": SharpenProgressBar;
"sharpen-progress-dial": SharpenProgressDial;
}
}
export { LocalJSX as JSX };
Expand All @@ -367,12 +405,14 @@ declare module "@stencil/core" {
"sharpen-empty": LocalJSX.SharpenEmpty & JSXBase.HTMLAttributes<HTMLSharpenEmptyElement>;
"sharpen-footer": LocalJSX.SharpenFooter & JSXBase.HTMLAttributes<HTMLSharpenFooterElement>;
"sharpen-label": LocalJSX.SharpenLabel & JSXBase.HTMLAttributes<HTMLSharpenLabelElement>;
"sharpen-loading": LocalJSX.SharpenLoading & JSXBase.HTMLAttributes<HTMLSharpenLoadingElement>;
"sharpen-menu": LocalJSX.SharpenMenu & JSXBase.HTMLAttributes<HTMLSharpenMenuElement>;
"sharpen-nav-link": LocalJSX.SharpenNavLink & JSXBase.HTMLAttributes<HTMLSharpenNavLinkElement>;
"sharpen-page-navigation": LocalJSX.SharpenPageNavigation & JSXBase.HTMLAttributes<HTMLSharpenPageNavigationElement>;
"sharpen-primary-navigation": LocalJSX.SharpenPrimaryNavigation & JSXBase.HTMLAttributes<HTMLSharpenPrimaryNavigationElement>;
"sharpen-profile-card": LocalJSX.SharpenProfileCard & JSXBase.HTMLAttributes<HTMLSharpenProfileCardElement>;
"sharpen-progress-bar": LocalJSX.SharpenProgressBar & JSXBase.HTMLAttributes<HTMLSharpenProgressBarElement>;
"sharpen-progress-dial": LocalJSX.SharpenProgressDial & JSXBase.HTMLAttributes<HTMLSharpenProgressDialElement>;
}
}
}
2 changes: 2 additions & 0 deletions src/components/sharpen-card/sharpen-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ sharpen-card {
&[padding="small"] { padding: var(--spacing-sm); }
&[padding="medium"] { padding: var(--spacing-md); }
&[padding="large"] { padding: var(--spacing-lg); }
&[padding="xl"] { padding: var(--spacing-xl); }
}

sharpen-card-header {
Expand All @@ -35,4 +36,5 @@ sharpen-card-content {
&[padding="small"] { padding: var(--spacing-sm); }
&[padding="medium"] { padding: var(--spacing-md); }
&[padding="large"] { padding: var(--spacing-lg); }
&[padding="xl"] { padding: var(--spacing-xl); }
}
2 changes: 1 addition & 1 deletion src/components/sharpen-card/sharpen-card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Prop, Host, h } from '@stencil/core';

export type CardPadding = 'none' | 'small' | 'medium' | 'large';
export type CardPadding = 'none' | 'small' | 'medium' | 'large' | 'xl' ;
export type CardBorder = 'none' | 'gray' | 'green' | 'thin';

@Component({
Expand Down
33 changes: 33 additions & 0 deletions src/components/sharpen-loading/sharpen-loading.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
sharpen-loading {
display: flex;
justify-content: center;
align-items: center;
align-content: center;
gap: 15px;
width: 159px;
height: 159px;
margin-left: auto;
margin-right: auto;

.dot {
width: 18px;
height: 18px;
border-radius: 50%;
animation: wave 1.3s linear infinite;
background-color: var(--color-mint);

&:nth-child(2) { animation-delay: -1.1s; background-color: #0f3e88; }
&:nth-child(3) { animation-delay: -0.9s; background-color: #3F3148; }
}
}

@keyframes wave {
0%,
60%,
100% {
transform: initial;
}
30% {
transform: translateY(-15px);
}
}
11 changes: 11 additions & 0 deletions src/components/sharpen-loading/sharpen-loading.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* A loading indicator consisting of 3 bouncing dots.
*/
export default {
title: 'Atoms/Loading',
tags: ['autodocs'],
render: () => `<sharpen-loading></sharpen-loading>`
};

export const Example = {
};
19 changes: 19 additions & 0 deletions src/components/sharpen-loading/sharpen-loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Component, Host, h } from '@stencil/core';

@Component({
tag: 'sharpen-loading',
styleUrl: 'sharpen-loading.scss',
})
export class SharpenLoading {

render() {
return (
<Host>
<span class="dot dot1"></span>
<span class="dot dot2"></span>
<span class="dot dot3"></span>
</Host>
);
}

}
42 changes: 23 additions & 19 deletions src/components/sharpen-progress-dial/sharpen-progress-dial.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
// sharpen-progress-dial {
// display: block;
sharpen-progress-dial {
display: block;

// .progress-description {
// font-family: var(--font-family-sans);
// font-size: var(--font-size-xl);
// margin-top: var(--spacing-md);
// font-weight: 700;
// text-align: center;
// }
img { max-width: 100%; }

// &[status="low"] {
// .progress-description { color: var(--color-pine); }
// }
.progress-container { text-align: center; }

// &[status="elevated"] {
// .progress-description { color: var(--color-orange); }
// }
.progress-description {
font-family: var(--font-family-sans);
font-size: var(--font-size-xl);
margin-top: var(--spacing-md);
font-weight: 700;
text-align: center;
}

// &[status="high"] {
// .progress-description { color: var(--color-red); }
// }
&[status="low"] {
.progress-description { color: var(--color-pine); }
}

// }
&[status="elevated"] {
.progress-description { color: var(--color-orange); }
}

&[status="high"] {
.progress-description { color: var(--color-red); }
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { optional } from '../../utils/utils';

/**
* A dial-style visual progress indicator, with semantic coloring depending on
* the progress value.
*
* Note: Dials are static images, so the size of the color band is based on the
* threshold, not on the exact progress value.
*/
export default {
title: 'Molecules/Progress Dial',
tags: ['autodocs'],
argTypes: {
highThreshold: {
description: 'The maximum possible value of the progress dial',
table: { defaultValue: { summary: 100 } }
},
lowThreshold: {
description: 'The value under which the progress bar will display "low" styling. Default is computed to be 33% of the highThreshold.',
},
elevatedThreshold: {
description: 'The value under which the progress bar will display "elevated" styling. Default is computed to be 66% of the highThreshold.',
},
progressVal: {
description: 'The current progress value',
table: { defaultValue: { summary: 0 } }
},
showDescription: {
description: 'Whether or not to display the status description'
},
statusLabel: {
description: 'An optional label to append after the computed threshold name'
}
},
render: (args) => `
<sharpen-progress-dial progress-val="${args.progressVal}"${optional('show-description', args.showDescription)}${optional('status-label', args.statusLabel)}${optional('high-threshold', args.highThreshold)}${optional('low-threshold', args.lowThreshold)}${optional('elevated-threshold', args.elevatedThreshold)}></sharpen-progress-bar>`
};

/** Including custom thresholds. */
export const AllOptions = {
args: {
progressVal: 170,
showDescription: true,
statusLabel: 'Risk',
highThreshold: 200,
lowThreshold: 75,
elevatedThreshold: 180
},
};

export const ThresholdColors = {
render: () => `
<div class="row">
<div class="col-sm"><sharpen-progress-dial progress-val="0" show-description="true"></sharpen-progress-dial></div>
<div class="col-sm"><sharpen-progress-dial progress-val="10" show-description="true"></sharpen-progress-dial></div>
<div class="col-sm"><sharpen-progress-dial progress-val="50" show-description="true"></sharpen-progress-dial></div>
<div class="col-sm"><sharpen-progress-dial progress-val="90" show-description="true"></sharpen-progress-dial></div>
</div>
`
};

export const WithDescriptionAndLabel = {
args: {
showDescription: true,
statusLabel: 'Risk',
progressVal: 50
}
};

export const WithDescription = {
args: {
showDescription: true,
progressVal: 50
}
};

export const OnlyDial = {
args: {
progressVal: 50
}
};
Loading

0 comments on commit 2e66bc7

Please sign in to comment.