Skip to content

Commit

Permalink
Closes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
melohagan committed Aug 17, 2023
1 parent 87f24dd commit 9b8a42a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "budibase-number-counter",
"version": "1.2.1",
"version": "1.3.0",
"description": "A simple count-up component, adapted from svelte-counter",
"license": "MIT",
"svelte": "index.js",
Expand Down
21 changes: 18 additions & 3 deletions src/Component.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { getContext, onDestroy } from "svelte"
import { NumberInput, SvelteUIProvider } from '@svelteuidev/core';
import { NumberInput, css } from '@svelteuidev/core';
import Label from "./Label.svelte";
export let field
Expand Down Expand Up @@ -48,10 +48,25 @@
}
return 1
}
const styles = css({
[`.svelteui-Input-input`]: {
backgroundColor: "var(--spectrum-textfield-m-background-color, var(--spectrum-global-color-gray-50))",
borderColor: "var(--spectrum-textfield-m-border-color, var(--spectrum-alias-border-color))",
color: "var(--spectrum-textfield-m-text-color, var(--spectrum-alias-text-color))"
},
[`.svelteui-NumberInput-control`]: {
borderColor: "var(--spectrum-textfield-m-border-color, var(--spectrum-alias-border-color))"
},
[`.svelteui-NumberInput-control:hover`]: {
backgroundColor: "var(--spectrum-button-primary-m-background-color-hover, var(--spectrum-global-color-gray-800)) !important",
borderColor: "var(--spectrum-button-primary-m-text-color-hover, var(--spectrum-global-color-gray-50)) !important"
}
})
</script>
<div class="spectrum-Form-item" use:styleable={$component.styles}>
<SvelteUIProvider themeObserver={"light"}>
<div class={styles()}>
<Label>{label}</Label>
<NumberInput
defaultValue={parse(defaultValue)}
Expand All @@ -65,5 +80,5 @@
stepHoldInterval={50}
on:change={handleChange}
/>
</SvelteUIProvider>
</div>
</div>

0 comments on commit 9b8a42a

Please sign in to comment.