Skip to content

Commit

Permalink
fix(tools): SVG generator in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanp-fxl committed Nov 8, 2022
1 parent 2944bcd commit daf7294
Show file tree
Hide file tree
Showing 15 changed files with 690 additions and 219 deletions.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Primary.args = {
};

/**
* Primary
* Placeholder
*/
export const Placeholder = Template.bind({});

Expand Down
38 changes: 27 additions & 11 deletions design-system/components/src/components/os-input/os-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
Element,
Event,
EventEmitter,
getAssetPath,
h,
Host,
Listen,
Expand All @@ -11,6 +12,7 @@ import {
State,
Watch,
} from "@stencil/core";
import { ReactComponent as Icon } from "assets/alert-info.svg";
import clsx from "clsx";

/**
Expand Down Expand Up @@ -265,7 +267,7 @@ export class OsInput {
: "border-l-input-label";
}

getFillColor() {
getInputFillColor() {
return this.disabled ? "bg-disabled" : "bg-input-fill";
}

Expand All @@ -288,6 +290,16 @@ export class OsInput {
);
}

getSvgFillStyle() {
return this.error
? "fill-error"
: this.warning
? "fill-warning"
: this.info
? "fill-info"
: null;
}

getInputMessage() {
return this.error
? this.error
Expand All @@ -313,14 +325,17 @@ export class OsInput {
{ "pl-5": !this.isBorderDisplayed() },
"gap-xxs flex h-fit w-full flex-col self-start"
)}>
<label
class={clsx(
this.getTextStyle(),
"font-label-1 text-label-1 leading-label-1 flex antialiased"
)}
htmlFor={this.name}>
{this.label}
</label>
<div class="flex flex-row">
<label
class={clsx(
this.getTextStyle(),
"font-label-1 text-label-1 leading-label-1 flex flex-1 grow antialiased"
)}
htmlFor={this.name}>
{this.label}
</label>
<Icon class={clsx(this.getSvgFillStyle, "animate-ping")} />
</div>
<input
id={this.name}
name={this.name}
Expand All @@ -329,13 +344,14 @@ export class OsInput {
}
class={clsx(
this.getStrokeStyle(),
this.getFillColor(),
this.getInputFillColor(),
{
"focus:shadow-active-glow ring-1 ring-active ring-offset-0 transition-shadow duration-[3500] ease-in-out":
this.focused,
},
"font-label-1 text-label-1 leading-label-1 border-1 flex rounded-xl transition-colors focus:ring-0 focus:ring-active focus:ring-offset-0",
this.getInputTextStyle()
this.getInputTextStyle(),
"hover:shadow-active-glow transition-shadow duration-[3500] ease-in-out"
)}
type={this.type}
placeholder={this.placeholder}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit daf7294

Please sign in to comment.