@julianelda/domos 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{styles.css → background.css} +0 -11
- package/dist/button/button.mocks.d.ts +3 -0
- package/dist/button/button.mocks.js +18 -0
- package/dist/button/button.stories.svelte +9 -17
- package/dist/button/button.svelte +2 -8
- package/dist/button/button.svelte.d.ts +2 -8
- package/dist/button/button.types.d.ts +7 -0
- package/dist/button/button.types.js +1 -0
- package/dist/card/card.stories.svelte +2 -1
- package/dist/checkbox/checkbox.mocks.d.ts +2 -0
- package/dist/checkbox/checkbox.mocks.js +8 -0
- package/dist/checkbox/checkbox.stories.svelte +11 -13
- package/dist/checkbox/checkbox.svelte +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/input/input.mocks.d.ts +5 -0
- package/dist/input/input.mocks.js +18 -0
- package/dist/input/input.stories.svelte +42 -0
- package/dist/input/input.stories.svelte.d.ts +27 -0
- package/dist/input/input.svelte +12 -11
- package/dist/input-button/input-button.svelte +1 -0
- package/dist/input-field/input-field.mocks.d.ts +6 -0
- package/dist/input-field/input-field.mocks.js +25 -0
- package/dist/input-field/input-field.svelte +18 -1
- package/dist/input-field/input-field.types.d.ts +3 -1
- package/dist/input-label/input-label.types.d.ts +1 -1
- package/dist/input-select/input-select.mocks.d.ts +3 -0
- package/dist/input-select/input-select.mocks.js +21 -0
- package/dist/input-select/input-select.svelte +1 -0
- package/dist/input-select/input-select.types.d.ts +4 -5
- package/dist/select/select.mocks.d.ts +3 -0
- package/dist/select/select.mocks.js +11 -0
- package/dist/select/select.svelte +1 -0
- package/dist/select-field/select-field.mocks.d.ts +5 -0
- package/dist/select-field/select-field.mocks.js +50 -0
- package/dist/select-field/select-field.svelte +1 -1
- package/dist/select-field/select-field.types.d.ts +5 -4
- package/dist/tailwind.css +0 -5
- package/package.json +51 -46
|
@@ -23,14 +23,3 @@ body {
|
|
|
23
23
|
transparent 1px
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
input[type="number"]::-webkit-inner-spin-button,
|
|
28
|
-
input[type="number"]::-webkit-outer-spin-button {
|
|
29
|
-
-webkit-appearance: none;
|
|
30
|
-
margin: 0;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
input[type="number"] {
|
|
34
|
-
-moz-appearance: textfield;
|
|
35
|
-
appearance: textfield;
|
|
36
|
-
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const buttonPropsPrimary = {
|
|
2
|
+
id: "primary-button",
|
|
3
|
+
onClick: () => {
|
|
4
|
+
console.log("");
|
|
5
|
+
},
|
|
6
|
+
style: "primary",
|
|
7
|
+
text: "Primary button",
|
|
8
|
+
type: "button",
|
|
9
|
+
};
|
|
10
|
+
export const buttonPropsSecondary = {
|
|
11
|
+
id: "secondary-button",
|
|
12
|
+
onClick: () => {
|
|
13
|
+
console.log("");
|
|
14
|
+
},
|
|
15
|
+
style: "secondary",
|
|
16
|
+
text: "Secondary button",
|
|
17
|
+
type: "button",
|
|
18
|
+
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
3
|
import { fn } from "storybook/test";
|
|
4
|
+
|
|
5
|
+
import { buttonPropsPrimary, buttonPropsSecondary } from "./button.mocks.js";
|
|
4
6
|
import Button from "./button.svelte";
|
|
5
7
|
|
|
6
8
|
const { Story } = defineMeta({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
args: {
|
|
10
|
+
onclick: fn(),
|
|
11
|
+
},
|
|
9
12
|
argTypes: {
|
|
10
13
|
id: { control: "text" },
|
|
11
14
|
style: {
|
|
@@ -18,26 +21,15 @@
|
|
|
18
21
|
options: ["button", "submit"],
|
|
19
22
|
},
|
|
20
23
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
+
component: Button,
|
|
25
|
+
title: "Button",
|
|
24
26
|
});
|
|
25
27
|
</script>
|
|
26
28
|
|
|
27
29
|
<Story
|
|
28
30
|
name="Primary"
|
|
29
|
-
args={
|
|
30
|
-
id: "button",
|
|
31
|
-
style: "primary",
|
|
32
|
-
text: "Button primary",
|
|
33
|
-
type: "button",
|
|
34
|
-
}} />
|
|
31
|
+
args={buttonPropsPrimary} />
|
|
35
32
|
|
|
36
33
|
<Story
|
|
37
34
|
name="Secondary"
|
|
38
|
-
args={
|
|
39
|
-
id: "button",
|
|
40
|
-
style: "secondary",
|
|
41
|
-
text: "Button secondary",
|
|
42
|
-
type: "button",
|
|
43
|
-
}} />
|
|
35
|
+
args={buttonPropsSecondary} />
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
onClick: () => void;
|
|
5
|
-
style: "primary" | "secondary";
|
|
6
|
-
text: string;
|
|
7
|
-
type: "button" | "submit";
|
|
8
|
-
}
|
|
2
|
+
import type { ButtonProps } from "./button.types.js";
|
|
9
3
|
|
|
10
4
|
const {
|
|
11
5
|
id,
|
|
@@ -13,7 +7,7 @@
|
|
|
13
7
|
style = "primary",
|
|
14
8
|
text,
|
|
15
9
|
type = "button",
|
|
16
|
-
}:
|
|
10
|
+
}: ButtonProps = $props();
|
|
17
11
|
</script>
|
|
18
12
|
|
|
19
13
|
<button
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
onClick: () => void;
|
|
4
|
-
style: "primary" | "secondary";
|
|
5
|
-
text: string;
|
|
6
|
-
type: "button" | "submit";
|
|
7
|
-
}
|
|
8
|
-
declare const Button: import("svelte").Component<Props, {}, "">;
|
|
1
|
+
import type { ButtonProps } from "./button.types.ts";
|
|
2
|
+
declare const Button: import("svelte").Component<ButtonProps, {}, "">;
|
|
9
3
|
type Button = ReturnType<typeof Button>;
|
|
10
4
|
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,44 +1,42 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
3
|
import { fn } from "storybook/test";
|
|
4
|
+
|
|
5
|
+
import { checkboxProps } from "./checkbox.mocks.js";
|
|
4
6
|
import Checkbox from "./checkbox.svelte";
|
|
5
7
|
|
|
6
8
|
const { Story } = defineMeta({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
args: {
|
|
10
|
+
onChange: fn(),
|
|
11
|
+
},
|
|
9
12
|
argTypes: {
|
|
13
|
+
hideLabel: { control: "boolean" },
|
|
10
14
|
id: { control: "text" },
|
|
11
15
|
label: { control: "text" },
|
|
12
16
|
value: { control: "boolean" },
|
|
13
|
-
hideLabel: { control: "boolean" },
|
|
14
|
-
},
|
|
15
|
-
args: {
|
|
16
|
-
onChange: fn(),
|
|
17
17
|
},
|
|
18
|
+
component: Checkbox,
|
|
19
|
+
title: "Checkbox",
|
|
18
20
|
});
|
|
19
21
|
</script>
|
|
20
22
|
|
|
21
23
|
<Story
|
|
22
24
|
name="Checked"
|
|
23
25
|
args={{
|
|
24
|
-
|
|
25
|
-
label: "Checked Checkbox",
|
|
26
|
+
...checkboxProps,
|
|
26
27
|
value: true,
|
|
27
28
|
}} />
|
|
28
29
|
|
|
29
30
|
<Story
|
|
30
31
|
name="Unchecked"
|
|
31
32
|
args={{
|
|
32
|
-
|
|
33
|
-
label: "Unchecked Checkbox",
|
|
33
|
+
...checkboxProps,
|
|
34
34
|
value: false,
|
|
35
35
|
}} />
|
|
36
36
|
|
|
37
37
|
<Story
|
|
38
38
|
name="Hidden Label"
|
|
39
39
|
args={{
|
|
40
|
-
|
|
41
|
-
label: "Hidden Label Checkbox",
|
|
42
|
-
value: false,
|
|
40
|
+
...checkboxProps,
|
|
43
41
|
hideLabel: true,
|
|
44
42
|
}} />
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import "./assets/style/styles.css";
|
|
1
2
|
export { default as Button } from "./button/button.svelte";
|
|
2
3
|
export { default as Card } from "./card/card.svelte";
|
|
4
|
+
export { default as Checkbox } from "./checkbox/checkbox.svelte";
|
|
5
|
+
export { default as InputButton } from "./input-button/input-button.svelte";
|
|
6
|
+
export { default as InputField } from "./input-field/input-field.svelte";
|
|
7
|
+
export { default as InputLabel } from "./input-label/input-label.svelte";
|
|
8
|
+
export { default as InputSelect } from "./input-select/input-select.svelte";
|
|
3
9
|
export { default as Input } from "./input/input.svelte";
|
|
10
|
+
export { default as SelectField } from "./select-field/select-field.svelte";
|
|
4
11
|
export { default as Select } from "./select/select.svelte";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import "./assets/style/styles.css";
|
|
1
2
|
export { default as Button } from "./button/button.svelte";
|
|
2
3
|
export { default as Card } from "./card/card.svelte";
|
|
4
|
+
export { default as Checkbox } from "./checkbox/checkbox.svelte";
|
|
5
|
+
export { default as InputButton } from "./input-button/input-button.svelte";
|
|
6
|
+
export { default as InputField } from "./input-field/input-field.svelte";
|
|
7
|
+
export { default as InputLabel } from "./input-label/input-label.svelte";
|
|
8
|
+
export { default as InputSelect } from "./input-select/input-select.svelte";
|
|
3
9
|
export { default as Input } from "./input/input.svelte";
|
|
10
|
+
export { default as SelectField } from "./select-field/select-field.svelte";
|
|
4
11
|
export { default as Select } from "./select/select.svelte";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { inputFieldProps1, inputFieldProps2, inputFieldProps3, inputFieldProps4, } from "./../input-field/input-field.mocks.js";
|
|
2
|
+
export const inputProps1 = {
|
|
3
|
+
...inputFieldProps1,
|
|
4
|
+
label: "Input text",
|
|
5
|
+
placeholder: "Placeholder",
|
|
6
|
+
};
|
|
7
|
+
export const inputProps2 = {
|
|
8
|
+
...inputFieldProps2,
|
|
9
|
+
label: "Input number",
|
|
10
|
+
};
|
|
11
|
+
export const inputProps3 = {
|
|
12
|
+
...inputFieldProps3,
|
|
13
|
+
label: "Input search",
|
|
14
|
+
};
|
|
15
|
+
export const inputProps4 = {
|
|
16
|
+
...inputFieldProps4,
|
|
17
|
+
label: "Input number with limit",
|
|
18
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
|
+
import { fn } from "storybook/test";
|
|
4
|
+
|
|
5
|
+
import Input from "./input.svelte";
|
|
6
|
+
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
args: {
|
|
9
|
+
onChange: fn(),
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
hideLabel: { control: "boolean" },
|
|
13
|
+
id: { control: "text" },
|
|
14
|
+
label: { control: "text" },
|
|
15
|
+
value: { control: "boolean" },
|
|
16
|
+
},
|
|
17
|
+
component: Input,
|
|
18
|
+
title: "Input",
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Story
|
|
23
|
+
name="Default"
|
|
24
|
+
args={{
|
|
25
|
+
id: "input-id-1",
|
|
26
|
+
type: "text",
|
|
27
|
+
label: "Input Label",
|
|
28
|
+
value: "Input Value",
|
|
29
|
+
placeholder: "Placeholder Text",
|
|
30
|
+
}} />
|
|
31
|
+
|
|
32
|
+
<Story
|
|
33
|
+
name="Borderless"
|
|
34
|
+
args={{
|
|
35
|
+
id: "input-id-1",
|
|
36
|
+
type: "text",
|
|
37
|
+
label: "Input Label",
|
|
38
|
+
value: "Input Value",
|
|
39
|
+
placeholder: "Placeholder Text",
|
|
40
|
+
borderless: true,
|
|
41
|
+
hideLabel: true,
|
|
42
|
+
}} />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default Input;
|
|
2
|
+
type Input = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const Input: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
import Input from "./input.svelte";
|
|
15
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
+
$$bindings?: Bindings;
|
|
18
|
+
} & Exports;
|
|
19
|
+
(internal: unknown, props: {
|
|
20
|
+
$$events?: Events;
|
|
21
|
+
$$slots?: Slots;
|
|
22
|
+
}): Exports & {
|
|
23
|
+
$set?: any;
|
|
24
|
+
$on?: any;
|
|
25
|
+
};
|
|
26
|
+
z_$$bindings?: Bindings;
|
|
27
|
+
}
|
package/dist/input/input.svelte
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import InputField from "../input-field/input-field.svelte";
|
|
3
3
|
import InputLabel from "../input-label/input-label.svelte";
|
|
4
|
+
|
|
4
5
|
import type { InputProps } from "./input.types.js";
|
|
5
6
|
|
|
6
7
|
const {
|
|
8
|
+
borderless,
|
|
7
9
|
disabled,
|
|
8
10
|
hideLabel,
|
|
9
11
|
id,
|
|
@@ -16,19 +18,18 @@
|
|
|
16
18
|
}: InputProps = $props();
|
|
17
19
|
</script>
|
|
18
20
|
|
|
19
|
-
<div class="flex-1">
|
|
21
|
+
<div class="flex flex-1 flex-col gap-1">
|
|
20
22
|
<InputLabel
|
|
21
23
|
{hideLabel}
|
|
22
24
|
{id}
|
|
23
25
|
{label} />
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
</div>
|
|
26
|
+
<InputField
|
|
27
|
+
{borderless}
|
|
28
|
+
{disabled}
|
|
29
|
+
{id}
|
|
30
|
+
{onChange}
|
|
31
|
+
{onKeyDown}
|
|
32
|
+
{placeholder}
|
|
33
|
+
{type}
|
|
34
|
+
{value} />
|
|
34
35
|
</div>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { InputFieldProps } from "./input-field.types.ts";
|
|
2
|
+
export declare const inputFieldProps1: InputFieldProps;
|
|
3
|
+
export declare const inputFieldProps2: InputFieldProps;
|
|
4
|
+
export declare const inputFieldProps3: InputFieldProps;
|
|
5
|
+
export declare const inputFieldProps4: InputFieldProps;
|
|
6
|
+
export declare const inputFieldProps5: InputFieldProps;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const inputFieldProps1 = {
|
|
2
|
+
id: "input-id-1",
|
|
3
|
+
type: "text",
|
|
4
|
+
value: "Input value",
|
|
5
|
+
};
|
|
6
|
+
export const inputFieldProps2 = {
|
|
7
|
+
id: "input-id-2",
|
|
8
|
+
type: "number",
|
|
9
|
+
value: 100,
|
|
10
|
+
};
|
|
11
|
+
export const inputFieldProps3 = {
|
|
12
|
+
id: "input-id-3",
|
|
13
|
+
type: "search",
|
|
14
|
+
value: "Search query",
|
|
15
|
+
};
|
|
16
|
+
export const inputFieldProps4 = {
|
|
17
|
+
id: "input-id-4",
|
|
18
|
+
type: "number",
|
|
19
|
+
value: 100,
|
|
20
|
+
};
|
|
21
|
+
export const inputFieldProps5 = {
|
|
22
|
+
id: "input-id-5",
|
|
23
|
+
type: "range",
|
|
24
|
+
value: 10,
|
|
25
|
+
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { InputFieldProps } from "./input-field.types.js";
|
|
3
3
|
|
|
4
4
|
const {
|
|
5
|
+
borderless = false,
|
|
5
6
|
disabled = false,
|
|
6
7
|
id,
|
|
7
8
|
onChange,
|
|
@@ -23,6 +24,22 @@
|
|
|
23
24
|
{type}
|
|
24
25
|
{value}
|
|
25
26
|
class={[
|
|
26
|
-
"form-input block w-full appearance-none border
|
|
27
|
+
"form-input block w-full appearance-none border text-ink-black dark:text-app-text-dark",
|
|
28
|
+
borderless === true
|
|
29
|
+
? "border-0 bg-transparent p-0 ring-0 outline-none focus:ring-0 focus:outline-none"
|
|
30
|
+
: "border-ink-gray bg-white p-2 px-3 ring-inset focus:border-primary-300 focus:ring-1 focus:ring-primary-300 focus:ring-inset dark:bg-slate",
|
|
27
31
|
withIconLeft === true ? "rounded-l-md" : "rounded-md",
|
|
28
32
|
]} />
|
|
33
|
+
|
|
34
|
+
<style>
|
|
35
|
+
input[type="number"]::-webkit-inner-spin-button,
|
|
36
|
+
input[type="number"]::-webkit-outer-spin-button {
|
|
37
|
+
-webkit-appearance: none;
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
input[type="number"] {
|
|
42
|
+
-moz-appearance: textfield;
|
|
43
|
+
appearance: textfield;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export interface InputFieldProps {
|
|
2
|
+
borderless?: boolean;
|
|
2
3
|
disabled?: boolean;
|
|
3
4
|
id: string;
|
|
4
5
|
onChange?: (value: number | string) => void;
|
|
5
6
|
onKeyDown?: (value: number | string) => void;
|
|
6
7
|
placeholder?: string;
|
|
7
|
-
type:
|
|
8
|
+
type: InputFieldTypes;
|
|
8
9
|
value: number | string;
|
|
9
10
|
withIconLeft?: boolean;
|
|
10
11
|
}
|
|
12
|
+
export type InputFieldTypes = "number" | "range" | "search" | "text";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { selectFieldOptions1, selectFieldOptions2, } from "./../select-field/select-field.mocks.js";
|
|
2
|
+
export const inputSelectProps1 = {
|
|
3
|
+
inputId: "input-id-1",
|
|
4
|
+
inputLabel: "Currency amount",
|
|
5
|
+
inputValue: "100",
|
|
6
|
+
options: [...selectFieldOptions1],
|
|
7
|
+
selectId: "select-id-1",
|
|
8
|
+
selectLabel: "Currency select",
|
|
9
|
+
selectValue: selectFieldOptions1[0].value,
|
|
10
|
+
type: "text",
|
|
11
|
+
};
|
|
12
|
+
export const inputSelectProps2 = {
|
|
13
|
+
inputId: "input-id-2",
|
|
14
|
+
inputLabel: "Currency amount",
|
|
15
|
+
inputValue: "100",
|
|
16
|
+
options: [...selectFieldOptions2],
|
|
17
|
+
selectId: "select-id-2",
|
|
18
|
+
selectLabel: "Currency select",
|
|
19
|
+
selectValue: selectFieldOptions2[2].value,
|
|
20
|
+
type: "text",
|
|
21
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { InputFieldTypes } from "./../input-field/input-field.types.ts";
|
|
2
|
+
import type { SelectFieldOption } from "./../select-field/select-field.types.ts";
|
|
1
3
|
export interface InputSelectProps {
|
|
2
4
|
hideLabel?: boolean;
|
|
3
5
|
inputDisabled?: boolean;
|
|
@@ -8,12 +10,9 @@ export interface InputSelectProps {
|
|
|
8
10
|
onInputChange?: (value: number | string) => void;
|
|
9
11
|
onInputKeydown?: (key: number | string) => void;
|
|
10
12
|
onSelectChange?: (value: string) => void;
|
|
11
|
-
options:
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}[];
|
|
13
|
+
options: SelectFieldOption[];
|
|
15
14
|
selectId: string;
|
|
16
15
|
selectLabel: string;
|
|
17
16
|
selectValue: string;
|
|
18
|
-
type:
|
|
17
|
+
type: InputFieldTypes;
|
|
19
18
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { selectFieldProps1, selectFieldProps2, } from "./../select-field/select-field.mocks.js";
|
|
2
|
+
export const selectProps1 = {
|
|
3
|
+
...selectFieldProps1,
|
|
4
|
+
label: "Select currency",
|
|
5
|
+
value: selectFieldProps1.options[0].value,
|
|
6
|
+
};
|
|
7
|
+
export const selectProps2 = {
|
|
8
|
+
...selectFieldProps2,
|
|
9
|
+
label: "Select currency",
|
|
10
|
+
value: selectFieldProps2.options[2].value,
|
|
11
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import InputLabel from "../input-label/input-label.svelte";
|
|
3
3
|
import SelectField from "../select-field/select-field.svelte";
|
|
4
|
+
|
|
4
5
|
import type { SelectProps } from "./select.types.js";
|
|
5
6
|
|
|
6
7
|
const { hideLabel, id, label, onChange, options, value }: SelectProps =
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SelectFieldOption, SelectFieldProps } from "./select-field.types.ts";
|
|
2
|
+
export declare const selectFieldOptions1: SelectFieldOption[];
|
|
3
|
+
export declare const selectFieldOptions2: SelectFieldOption[];
|
|
4
|
+
export declare const selectFieldProps1: SelectFieldProps;
|
|
5
|
+
export declare const selectFieldProps2: SelectFieldProps;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const selectFieldOptions1 = [
|
|
2
|
+
{
|
|
3
|
+
label: "Euro",
|
|
4
|
+
value: "EUR",
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
label: "British Pound",
|
|
8
|
+
value: "GBP",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
label: "Japanese Yen",
|
|
12
|
+
value: "JPY",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: "United States Dollar",
|
|
16
|
+
value: "USD",
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
export const selectFieldOptions2 = [
|
|
20
|
+
{
|
|
21
|
+
label: "EUR",
|
|
22
|
+
value: "EUR",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "GBP",
|
|
26
|
+
value: "GBP",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: "JPY",
|
|
30
|
+
value: "JPY",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "USD",
|
|
34
|
+
value: "USD",
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
export const selectFieldProps1 = {
|
|
38
|
+
id: "select-id-1",
|
|
39
|
+
inInputField: false,
|
|
40
|
+
onChange: () => { },
|
|
41
|
+
options: [...selectFieldOptions1],
|
|
42
|
+
value: selectFieldOptions1[0].value,
|
|
43
|
+
};
|
|
44
|
+
export const selectFieldProps2 = {
|
|
45
|
+
id: "select-id-2",
|
|
46
|
+
inInputField: false,
|
|
47
|
+
onChange: () => { },
|
|
48
|
+
options: [...selectFieldOptions2],
|
|
49
|
+
value: selectFieldOptions2[2].value,
|
|
50
|
+
};
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
<select
|
|
14
14
|
class={[
|
|
15
|
-
"w-full
|
|
15
|
+
"form-select w-full appearance-none rounded-md border border-ink-gray py-2 pr-8 pl-2 text-ink-black focus:ring-1 focus:ring-primary-300 focus:ring-inset dark:bg-slate dark:text-ink-white",
|
|
16
16
|
inInputField && "h-full rounded-l-none bg-transparent",
|
|
17
17
|
!inInputField && "block pl-3",
|
|
18
18
|
]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export interface SelectFieldOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
1
5
|
export interface SelectFieldProps {
|
|
2
6
|
id: string;
|
|
3
7
|
inInputField?: boolean;
|
|
4
8
|
onChange: (value: string) => void;
|
|
5
|
-
options:
|
|
6
|
-
label: string;
|
|
7
|
-
value: string;
|
|
8
|
-
}[];
|
|
9
|
+
options: SelectFieldOption[];
|
|
9
10
|
value: string;
|
|
10
11
|
}
|
package/dist/tailwind.css
CHANGED
package/package.json
CHANGED
|
@@ -1,47 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@julianelda/domos",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"preview": "vite preview",
|
|
8
|
-
"prepare": "svelte-kit sync || echo ''",
|
|
9
|
-
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
10
|
-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
11
|
-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
12
|
-
"lint": "prettier --check . && eslint .",
|
|
13
|
-
"format": "prettier --write .",
|
|
14
|
-
"test": "vitest --project=client",
|
|
15
|
-
"test:e2e": "playwright test",
|
|
16
|
-
"storybook": "storybook dev -p 6006",
|
|
17
|
-
"build-storybook": "storybook build"
|
|
18
|
-
},
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"svelte"
|
|
6
|
+
],
|
|
19
7
|
"files": [
|
|
20
8
|
"dist",
|
|
21
9
|
"!dist/**/*.test.*",
|
|
22
10
|
"!dist/**/*.spec.*"
|
|
23
11
|
],
|
|
24
|
-
"
|
|
25
|
-
"module": "./dist/index.js",
|
|
12
|
+
"type": "module",
|
|
26
13
|
"sideEffects": [
|
|
27
14
|
"**/*.css"
|
|
28
15
|
],
|
|
29
|
-
"
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"module": "./dist/index.js",
|
|
30
18
|
"types": "./dist/index.d.ts",
|
|
31
|
-
"
|
|
19
|
+
"svelte": "./dist/index.js",
|
|
32
20
|
"exports": {
|
|
33
21
|
".": {
|
|
34
22
|
"types": "./dist/index.d.ts",
|
|
35
23
|
"svelte": "./dist/index.js"
|
|
36
|
-
}
|
|
24
|
+
},
|
|
25
|
+
"./tailwind": "./dist/tailwind.css",
|
|
26
|
+
"./background": "./dist/assets/background.css"
|
|
37
27
|
},
|
|
38
|
-
"
|
|
39
|
-
"
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "vite build && bun run prepack",
|
|
30
|
+
"build-storybook": "storybook build",
|
|
31
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
32
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
33
|
+
"dev": "vite dev",
|
|
34
|
+
"format": "oxfmt",
|
|
35
|
+
"lint": "oxlint && prettier --check **/*.svelte && eslint .",
|
|
36
|
+
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
37
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
38
|
+
"prettier": "prettier --check **/*.svelte",
|
|
39
|
+
"preview": "vite preview",
|
|
40
|
+
"storybook": "storybook dev -p 6006 --no-open",
|
|
41
|
+
"test": "vitest"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@julianelda/chroma": "^1.0.0",
|
|
45
|
+
"@julianelda/stilo": "^1.0.2"
|
|
40
46
|
},
|
|
41
47
|
"devDependencies": {
|
|
42
|
-
"@eslint/
|
|
43
|
-
"@
|
|
44
|
-
"@lucide/svelte": "^
|
|
48
|
+
"@eslint/js": "^10.0.1",
|
|
49
|
+
"@julianelda/lexis": "^2.6.0",
|
|
50
|
+
"@lucide/svelte": "^1.16.0",
|
|
45
51
|
"@playwright/test": "^1.58.1",
|
|
46
52
|
"@prettier/plugin-oxc": "^0.1.3",
|
|
47
53
|
"@storybook/addon-a11y": "^10.2.7",
|
|
@@ -50,37 +56,36 @@
|
|
|
50
56
|
"@storybook/sveltekit": "^10.2.7",
|
|
51
57
|
"@sveltejs/kit": "^2.50.2",
|
|
52
58
|
"@sveltejs/package": "^2.5.7",
|
|
53
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
59
|
+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
54
60
|
"@tailwindcss/forms": "^0.5.11",
|
|
55
61
|
"@tailwindcss/typography": "^0.5.19",
|
|
56
62
|
"@tailwindcss/vite": "^4.1.18",
|
|
57
63
|
"@types/node": "^24",
|
|
58
|
-
"@
|
|
59
|
-
"
|
|
60
|
-
"eslint
|
|
61
|
-
"eslint-plugin-
|
|
64
|
+
"@typescript/native-preview": "^7.0.0-dev.20260521.1",
|
|
65
|
+
"@vitest/browser-playwright": "^4.1.7",
|
|
66
|
+
"eslint": "^10.4.0",
|
|
67
|
+
"eslint-plugin-oxlint": "^1.66.0",
|
|
68
|
+
"eslint-plugin-perfectionist": "^5.9.0",
|
|
62
69
|
"eslint-plugin-svelte": "^3.14.0",
|
|
63
70
|
"globals": "^17.3.0",
|
|
71
|
+
"oxfmt": "^0.51.0",
|
|
72
|
+
"oxlint": "^1.66.0",
|
|
73
|
+
"oxlint-tsgolint": "^0.23.0",
|
|
64
74
|
"playwright": "^1.58.1",
|
|
65
|
-
"prettier": "^3.8.
|
|
66
|
-
"prettier-plugin-svelte": "
|
|
67
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
75
|
+
"prettier": "^3.8.3",
|
|
76
|
+
"prettier-plugin-svelte": "3",
|
|
77
|
+
"prettier-plugin-tailwindcss": "^0.8.0",
|
|
68
78
|
"publint": "^0.3.17",
|
|
69
79
|
"storybook": "^10.2.7",
|
|
70
|
-
"svelte": "^5.
|
|
80
|
+
"svelte": "^5.55.9",
|
|
71
81
|
"svelte-check": "^4.3.6",
|
|
72
|
-
"tailwindcss": "^4.
|
|
73
|
-
"typescript": "^5.9.3",
|
|
82
|
+
"tailwindcss": "^4.3.0",
|
|
74
83
|
"typescript-eslint": "^8.54.0",
|
|
75
|
-
"vite": "^
|
|
76
|
-
"vitest": "^4.
|
|
77
|
-
"vitest-browser-svelte": "^2.
|
|
84
|
+
"vite": "^8.0.14",
|
|
85
|
+
"vitest": "^4.1.7",
|
|
86
|
+
"vitest-browser-svelte": "^2.1.1"
|
|
78
87
|
},
|
|
79
|
-
"
|
|
80
|
-
"svelte"
|
|
81
|
-
],
|
|
82
|
-
"dependencies": {
|
|
83
|
-
"@julianelda/chroma": "^1.0.0",
|
|
84
|
-
"@julianelda/stilo": "^1.0.2"
|
|
88
|
+
"peerDependencies": {
|
|
89
|
+
"svelte": "^5.0.0"
|
|
85
90
|
}
|
|
86
91
|
}
|