-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dda30de
commit 075d7d2
Showing
251 changed files
with
3,425 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
backgrounds: { | ||
default: "flow-dark", | ||
values: [ | ||
{ | ||
name: "flow-dark", | ||
value: "#202A36", | ||
}, | ||
], | ||
}, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
f-counter { | ||
display: inline-flex; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { html, unsafeCSS } from "lit"; | ||
import { customElement, property } from "lit/decorators.js"; | ||
import eleStyle from "./f-counter.scss"; | ||
import { FElement } from "./../../shared/f-element"; | ||
|
||
@customElement("f-counter") | ||
export class FCounter extends FElement { | ||
/** | ||
* css loaded from scss file | ||
*/ | ||
static styles = [unsafeCSS(eleStyle)]; | ||
/** | ||
* @attribute A counter label denotes the numeric count of the entity associated with it | ||
*/ | ||
@property({ type: String }) | ||
label!: string; | ||
|
||
/** | ||
* @attribute The medium size is the default. | ||
*/ | ||
@property({ reflect: true, type: String }) | ||
size?: "large" | "medium" | "small" = "medium"; | ||
|
||
/** | ||
* @attribute The state of a counter helps in indicating the degree of emphasis of the parent component. The counter component inherits the state from the parent component. By default it is subtle. | ||
*/ | ||
@property({ reflect: true, type: String }) | ||
state?: "primary" | "subtle" | "success" | "warning" | "danger" | "neutral" = | ||
"subtle"; | ||
|
||
/** | ||
* @attribute Loader icon replaces the content of the counter . | ||
*/ | ||
@property({ reflect: true, type: Boolean }) | ||
loading?: boolean = false; | ||
|
||
/** | ||
* @attribute The disabled attribute can be set to keep a user from clicking on the counter. | ||
*/ | ||
@property({ reflect: true, type: Boolean }) | ||
disabled?: boolean = false; | ||
|
||
render() { | ||
return html`${this.label}`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
f-icon { | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
svg { | ||
fill: var(--color-icon-default); | ||
stroke: none; | ||
*[fill^="white"] { | ||
fill: var(--color-icon-default); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { html, unsafeCSS } from "lit"; | ||
import { customElement, property } from "lit/decorators.js"; | ||
import eleStyle from "./f-icon.scss"; | ||
import { FElement } from "./../../shared/f-element"; | ||
import { unsafeSVG } from "lit-html/directives/unsafe-svg.js"; | ||
import iconPack from "./../../../../flow-icon-free/dist/types"; | ||
|
||
@customElement("f-icon") | ||
export class FIcon extends FElement { | ||
/** | ||
* css loaded from scss file | ||
*/ | ||
static styles = [unsafeCSS(eleStyle)]; | ||
|
||
private _source!: string; | ||
|
||
/** | ||
* @attribute Source property defines what will be displayed on the icon. For icon variant It can take the icon name from a library , any inline SVG or any URL for the image. For emoji, it takes emoji as inline text. | ||
*/ | ||
@property({ | ||
type: String, | ||
}) | ||
get source() { | ||
return this._source; | ||
} | ||
set source(value) { | ||
this._source = iconPack[value]; | ||
} | ||
|
||
render() { | ||
return html`${unsafeSVG(this.source)}`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Subject } from "rxjs"; | ||
import { getThemeStyle } from "./../../utils"; | ||
|
||
/** | ||
* TODO :include font-family, icons | ||
*/ | ||
export type FlowCoreConfig = { | ||
theme: "f-dark" | "f-light"; | ||
iconPack: string; | ||
}; | ||
|
||
let config: FlowCoreConfig = { | ||
theme: "f-dark", | ||
iconPack: "@cldcvr/flow-icon-free", | ||
}; | ||
|
||
export const CONFIG_SUBJECT = new Subject<FlowCoreConfig>(); | ||
|
||
export const ConfigUtil = { | ||
getConfig() { | ||
return config; | ||
}, | ||
setConfig(cfg: Partial<FlowCoreConfig>) { | ||
config = { ...config, ...cfg }; | ||
CONFIG_SUBJECT.next(config); | ||
}, | ||
getThemeStyles() { | ||
return getThemeStyle(`[flow-element][theme="${config.theme}"]`); | ||
}, | ||
}; |
Oops, something went wrong.