-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
16 changed files
with
183 additions
and
241 deletions.
There are no files selected for viewing
File renamed without changes.
13 changes: 9 additions & 4 deletions
13
...ories/Design Systems/Shoelace.stories._ts → ...tories/Design Systems/Shoelace.stories.ts
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
File renamed without changes.
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,46 @@ | ||
import { SingleEditorComponent } from '@hydrofoil/shaperone-wc' | ||
import type { TextFieldEditor } from '@hydrofoil/shaperone-core/components.js' | ||
import { dash } from '@tpluscode/rdf-ns-builders' | ||
import { css, html } from 'lit' | ||
import { state } from 'lit/decorators.js' | ||
import type SlInput from '@shoelace-style/shoelace/dist/components/input/input.component.js' | ||
|
||
export class TextField extends SingleEditorComponent implements TextFieldEditor { | ||
static editor = dash.TextFieldEditor | ||
|
||
static get styles() { | ||
return css` | ||
sl-skeleton { | ||
width: 100px; | ||
} | ||
` | ||
} | ||
|
||
@state() | ||
private ready = false | ||
|
||
get type(): SlInput['type'] { | ||
return 'text' | ||
} | ||
|
||
connectedCallback() { | ||
import('@shoelace-style/shoelace/dist/components/input/input.js').then(() => { | ||
this.ready = true | ||
}) | ||
|
||
super.connectedCallback() | ||
} | ||
|
||
protected render(): unknown { | ||
if (!this.ready) { | ||
return html` | ||
<sl-skeleton effect="sheen"></sl-skeleton>` | ||
} | ||
|
||
return html` | ||
<sl-input .value="${this.value?.object?.value || ''}" | ||
type="${this.type}" | ||
.readonly="${this.property.shape.readOnly || false}" | ||
@sl-change="${(e: any) => this.setValue(e.target.value)}"></sl-input>` | ||
} | ||
} |
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,20 @@ | ||
import '@shoelace-style/shoelace/dist/components/icon-button/icon-button.js' | ||
import { html, LitElement } from 'lit' | ||
|
||
export class Button extends LitElement { | ||
render() { | ||
let name = 'plus-square' | ||
if (this.slot === 'remove-object') { | ||
name = 'x-square' | ||
} | ||
|
||
return html`<sl-icon-button style="font-size: 1.75em" | ||
name="${name}" | ||
label="${this.label}" | ||
></sl-icon-button>` | ||
} | ||
|
||
get label() { | ||
return this.slot === 'remove-object' ? 'Remove value' : 'Add value' | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.