@julianelda/domos 2.0.1 → 2.1.1
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/button/button.svelte +12 -3
- package/dist/card/card.svelte +11 -2
- package/dist/card/card.svelte.d.ts +2 -3
- package/dist/card/card.types.d.ts +5 -0
- package/dist/card/card.types.js +1 -0
- package/dist/checkbox/checkbox.svelte +13 -2
- package/dist/input/input.svelte +10 -2
- package/dist/input-button/input-button.svelte +4 -1
- package/dist/input-field/input-field.svelte +7 -2
- package/dist/input-label/input-label.svelte +11 -1
- package/dist/input-label/input-label.types.d.ts +2 -1
- package/dist/input-select/input-select.svelte +8 -2
- package/dist/input-select/input-select.types.d.ts +1 -0
- package/dist/select/select.svelte +10 -2
- package/dist/select-field/select-field.svelte +7 -2
- package/package.json +5 -3
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
|
|
2
5
|
import type { ButtonProps } from "./button.types.js";
|
|
3
6
|
|
|
4
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
children,
|
|
9
|
+
class: className,
|
|
10
|
+
variant = "primary",
|
|
11
|
+
...rest
|
|
12
|
+
}: ButtonProps = $props();
|
|
5
13
|
</script>
|
|
6
14
|
|
|
7
15
|
<button
|
|
8
16
|
{...rest}
|
|
9
|
-
class={
|
|
17
|
+
class={twMerge(
|
|
10
18
|
"cursor-pointer appearance-none rounded-lg p-2 text-lg shadow-sm hover:border-primary-500 hover:bg-primary-500 focus:ring-primary-300 focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-primary-300 active:bg-primary-700 dark:hover:bg-primary-500",
|
|
11
19
|
variant === "primary"
|
|
12
20
|
? "border-primary-700 bg-primary-700 text-ink-white"
|
|
13
21
|
: "border border-ink-500 bg-card-background-light text-ink-black hover:text-white dark:bg-slate dark:text-ink-white",
|
|
14
|
-
|
|
22
|
+
clsx(className),
|
|
23
|
+
)}>
|
|
15
24
|
{@render children?.()}
|
|
16
25
|
</button>
|
package/dist/card/card.svelte
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
|
|
5
|
+
import type { CardProps } from "./card.types.js";
|
|
6
|
+
|
|
7
|
+
const { children, class: className, ...rest }: CardProps = $props();
|
|
3
8
|
</script>
|
|
4
9
|
|
|
5
10
|
<div
|
|
6
|
-
|
|
11
|
+
{...rest}
|
|
12
|
+
class={twMerge(
|
|
13
|
+
"rounded-md bg-card-background-light p-1 shadow-sm sm:p-4 dark:bg-card-background-dark",
|
|
14
|
+
clsx(className),
|
|
15
|
+
)}>
|
|
7
16
|
{@render children?.()}
|
|
8
17
|
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import InputLabel from "../input-label/input-label.svelte";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
3
5
|
|
|
4
6
|
import type { CheckboxProps } from "./checkbox.types.js";
|
|
5
7
|
|
|
6
|
-
const {
|
|
8
|
+
const {
|
|
9
|
+
class: className,
|
|
10
|
+
hideLabel,
|
|
11
|
+
id,
|
|
12
|
+
label,
|
|
13
|
+
...rest
|
|
14
|
+
}: CheckboxProps = $props();
|
|
7
15
|
</script>
|
|
8
16
|
|
|
9
17
|
<div class="relative flex items-start gap-1">
|
|
@@ -11,7 +19,10 @@
|
|
|
11
19
|
<input
|
|
12
20
|
{...rest}
|
|
13
21
|
{id}
|
|
14
|
-
class=
|
|
22
|
+
class={twMerge(
|
|
23
|
+
"form-checkbox inline-block size-4 rounded-md border-0 bg-white p-1 text-primary-500 accent-primary-500 ring-1 ring-ink-500 ring-inset focus:border-primary-300 focus:ring-1 focus:ring-primary-300 focus:ring-inset dark:bg-ink-500",
|
|
24
|
+
clsx(className),
|
|
25
|
+
)}
|
|
15
26
|
type="checkbox" />
|
|
16
27
|
</div>
|
|
17
28
|
<div class="leading-6">
|
package/dist/input/input.svelte
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
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
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { twMerge } from "tailwind-merge";
|
|
4
6
|
|
|
5
7
|
import type { InputProps } from "./input.types.js";
|
|
6
8
|
|
|
7
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
class: className,
|
|
11
|
+
hideLabel,
|
|
12
|
+
id,
|
|
13
|
+
label,
|
|
14
|
+
...rest
|
|
15
|
+
}: InputProps = $props();
|
|
8
16
|
</script>
|
|
9
17
|
|
|
10
|
-
<div class="flex flex-1 flex-col gap-1">
|
|
18
|
+
<div class={twMerge("flex flex-1 flex-col gap-1", clsx(className))}>
|
|
11
19
|
<InputLabel
|
|
12
20
|
{hideLabel}
|
|
13
21
|
{id}
|
|
@@ -1,11 +1,14 @@
|
|
|
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
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { twMerge } from "tailwind-merge";
|
|
4
6
|
|
|
5
7
|
import type { InputButtonProps } from "./input-button.types.js";
|
|
6
8
|
|
|
7
9
|
const {
|
|
8
10
|
buttonAriaLabel,
|
|
11
|
+
class: className,
|
|
9
12
|
hideLabel,
|
|
10
13
|
icon,
|
|
11
14
|
id,
|
|
@@ -15,7 +18,7 @@
|
|
|
15
18
|
}: InputButtonProps = $props();
|
|
16
19
|
</script>
|
|
17
20
|
|
|
18
|
-
<div class="flex flex-1 flex-col gap-1">
|
|
21
|
+
<div class={twMerge("flex flex-1 flex-col gap-1", clsx(className))}>
|
|
19
22
|
<InputLabel
|
|
20
23
|
hideLabel={Boolean(hideLabel)}
|
|
21
24
|
{id}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
|
|
2
5
|
import type { InputFieldProps } from "./input-field.types.js";
|
|
3
6
|
|
|
4
7
|
const {
|
|
5
8
|
borderless = false,
|
|
9
|
+
class: className,
|
|
6
10
|
withIconLeft = false,
|
|
7
11
|
...rest
|
|
8
12
|
}: InputFieldProps = $props();
|
|
@@ -10,13 +14,14 @@
|
|
|
10
14
|
|
|
11
15
|
<input
|
|
12
16
|
{...rest}
|
|
13
|
-
class={
|
|
17
|
+
class={twMerge(
|
|
14
18
|
"form-input block w-full appearance-none border text-ink-black dark:text-app-text-dark",
|
|
15
19
|
borderless === true
|
|
16
20
|
? "border-0 bg-transparent p-0 ring-0 outline-none focus:ring-0 focus:outline-none"
|
|
17
21
|
: "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",
|
|
18
22
|
withIconLeft === true ? "rounded-l-md" : "rounded-md",
|
|
19
|
-
|
|
23
|
+
clsx(className),
|
|
24
|
+
)} />
|
|
20
25
|
|
|
21
26
|
<style>
|
|
22
27
|
input[type="number"]::-webkit-inner-spin-button,
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
|
|
2
5
|
import type { InputLabelProps } from "./input-label.types.js";
|
|
3
6
|
|
|
4
7
|
const {
|
|
8
|
+
class: className,
|
|
5
9
|
hideLabel = false,
|
|
6
10
|
id,
|
|
7
11
|
label,
|
|
8
12
|
value = "",
|
|
13
|
+
...rest
|
|
9
14
|
}: InputLabelProps = $props();
|
|
10
15
|
</script>
|
|
11
16
|
|
|
12
17
|
<label
|
|
13
|
-
|
|
18
|
+
{...rest}
|
|
19
|
+
class={twMerge(
|
|
20
|
+
"font-heading mr-auto font-bold",
|
|
21
|
+
hideLabel && "sr-only",
|
|
22
|
+
clsx(className),
|
|
23
|
+
)}
|
|
14
24
|
for={id}>
|
|
15
25
|
{label}
|
|
16
26
|
{#if value !== ""}
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
import InputField from "../input-field/input-field.svelte";
|
|
3
3
|
import InputLabel from "../input-label/input-label.svelte";
|
|
4
4
|
import SelectField from "../select-field/select-field.svelte";
|
|
5
|
+
import { twMerge } from "tailwind-merge";
|
|
5
6
|
|
|
6
7
|
import type { InputSelectProps } from "./input-select.types.js";
|
|
7
8
|
|
|
8
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
class: className,
|
|
11
|
+
hideLabel,
|
|
12
|
+
inputProps,
|
|
13
|
+
selectProps,
|
|
14
|
+
}: InputSelectProps = $props();
|
|
9
15
|
|
|
10
16
|
const inputFieldProps = $derived.by(() => {
|
|
11
17
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -20,7 +26,7 @@
|
|
|
20
26
|
});
|
|
21
27
|
</script>
|
|
22
28
|
|
|
23
|
-
<div class="flex flex-1 flex-col gap-1">
|
|
29
|
+
<div class={twMerge("flex flex-1 flex-col gap-1", className)}>
|
|
24
30
|
<InputLabel
|
|
25
31
|
{hideLabel}
|
|
26
32
|
id={inputProps.id}
|
|
@@ -1,13 +1,21 @@
|
|
|
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
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { twMerge } from "tailwind-merge";
|
|
4
6
|
|
|
5
7
|
import type { SelectProps } from "./select.types.js";
|
|
6
8
|
|
|
7
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
class: className,
|
|
11
|
+
hideLabel,
|
|
12
|
+
id,
|
|
13
|
+
label,
|
|
14
|
+
...rest
|
|
15
|
+
}: SelectProps = $props();
|
|
8
16
|
</script>
|
|
9
17
|
|
|
10
|
-
<div class="flex flex-1 flex-col gap-1">
|
|
18
|
+
<div class={twMerge("flex flex-1 flex-col gap-1", clsx(className))}>
|
|
11
19
|
<InputLabel
|
|
12
20
|
{hideLabel}
|
|
13
21
|
{id}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
|
|
2
5
|
import type { SelectFieldProps } from "./select-field.types.js";
|
|
3
6
|
|
|
4
7
|
const {
|
|
5
8
|
borderless = false,
|
|
9
|
+
class: className,
|
|
6
10
|
inInputField = false,
|
|
7
11
|
options,
|
|
8
12
|
...rest
|
|
@@ -11,7 +15,7 @@
|
|
|
11
15
|
|
|
12
16
|
<select
|
|
13
17
|
{...rest}
|
|
14
|
-
class={
|
|
18
|
+
class={twMerge(
|
|
15
19
|
"form-select w-full appearance-none rounded-md text-ink-black dark:bg-slate dark:text-ink-white",
|
|
16
20
|
borderless === true
|
|
17
21
|
? "border-0 bg-transparent p-0 ring-0 outline-none focus:ring-0 focus:outline-none"
|
|
@@ -19,7 +23,8 @@
|
|
|
19
23
|
inInputField === true
|
|
20
24
|
? "h-full rounded-l-none bg-transparent"
|
|
21
25
|
: "block pl-3",
|
|
22
|
-
|
|
26
|
+
clsx(className),
|
|
27
|
+
)}>
|
|
23
28
|
{#each options as option (option.value)}
|
|
24
29
|
<option value={option.value}>
|
|
25
30
|
{option.label}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@julianelda/domos",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"svelte"
|
|
6
6
|
],
|
|
@@ -49,7 +49,9 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@julianelda/chroma": "^1.0.0",
|
|
52
|
-
"@julianelda/stilo": "^1.0.2"
|
|
52
|
+
"@julianelda/stilo": "^1.0.2",
|
|
53
|
+
"clsx": "^2.1.1",
|
|
54
|
+
"tailwind-merge": "^3.6.0"
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
55
57
|
"@eslint/js": "^10.0.1",
|
|
@@ -63,7 +65,7 @@
|
|
|
63
65
|
"@tailwindcss/forms": "^0.5.11",
|
|
64
66
|
"@tailwindcss/typography": "^0.5.20",
|
|
65
67
|
"eslint": "^10.5.0",
|
|
66
|
-
"eslint-plugin-oxlint": "^1.
|
|
68
|
+
"eslint-plugin-oxlint": "^1.76.0",
|
|
67
69
|
"eslint-plugin-svelte": "^3.19.0",
|
|
68
70
|
"publint": "^0.3.17",
|
|
69
71
|
"svelte": "^5.56.4",
|