@3birds/midori-ui 0.0.7 → 0.0.8
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/components/Btn.svelte +2 -2
- package/dist/components/Btn.svelte.d.ts +1 -1
- package/dist/components/Input.svelte +27 -15
- package/dist/components/Input.svelte.d.ts +3 -2
- package/dist/components/Modal.svelte +24 -0
- package/dist/components/Modal.svelte.d.ts +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { InputType } from '../types';
|
|
3
3
|
|
|
4
4
|
let {
|
|
5
5
|
type,
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
label,
|
|
14
14
|
icon,
|
|
15
15
|
placeholder,
|
|
16
|
-
option
|
|
16
|
+
option,
|
|
17
|
+
value = $bindable()
|
|
17
18
|
}: {
|
|
18
19
|
type: InputType;
|
|
19
20
|
required?: boolean;
|
|
@@ -27,23 +28,34 @@
|
|
|
27
28
|
icon?: string;
|
|
28
29
|
placeholder?: string;
|
|
29
30
|
option?: string;
|
|
31
|
+
value: any;
|
|
30
32
|
} = $props();
|
|
31
33
|
</script>
|
|
32
34
|
|
|
33
35
|
<div class="w-lg">
|
|
34
|
-
<fieldset class="fieldset w-full">
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
<fieldset class="fieldset w-full">
|
|
37
|
+
{#if label}
|
|
38
|
+
<legend class="fieldset-legend">{label}</legend>
|
|
39
|
+
{/if}
|
|
40
|
+
<label class="input w-full rounded-full {icon ? '' : 'px-5'}">
|
|
41
|
+
{#if icon}
|
|
42
|
+
<img src={icon} class="size-4" alt="アイコン" />
|
|
43
|
+
{/if}
|
|
44
|
+
<input
|
|
45
|
+
{type}
|
|
46
|
+
{required}
|
|
47
|
+
{readonly}
|
|
48
|
+
{pattern}
|
|
49
|
+
{disabled}
|
|
50
|
+
{maxlength}
|
|
51
|
+
{min}
|
|
52
|
+
{max}
|
|
53
|
+
{placeholder}
|
|
54
|
+
{value}
|
|
55
|
+
/>
|
|
56
|
+
</label>
|
|
39
57
|
{#if icon}
|
|
40
|
-
<
|
|
58
|
+
<p class="label">{option}</p>
|
|
41
59
|
{/if}
|
|
42
|
-
|
|
43
|
-
</label>
|
|
44
|
-
{#if icon}
|
|
45
|
-
<p class="label">{option}</p>
|
|
46
|
-
{/if}
|
|
47
|
-
</fieldset>
|
|
60
|
+
</fieldset>
|
|
48
61
|
</div>
|
|
49
|
-
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { InputType } from '../types';
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
type: InputType;
|
|
4
4
|
required?: boolean;
|
|
@@ -12,7 +12,8 @@ type $$ComponentProps = {
|
|
|
12
12
|
icon?: string;
|
|
13
13
|
placeholder?: string;
|
|
14
14
|
option?: string;
|
|
15
|
+
value: any;
|
|
15
16
|
};
|
|
16
|
-
declare const Input: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
17
|
+
declare const Input: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
17
18
|
type Input = ReturnType<typeof Input>;
|
|
18
19
|
export default Input;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Btn, closeSvg } from '..';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
value = $bindable(),
|
|
6
|
+
children
|
|
7
|
+
}: { value?: HTMLDialogElement; children: import('svelte').Snippet } = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<dialog bind:this={value} class="modal modal-bottom sm:modal-middle">
|
|
11
|
+
<div class="modal-box">
|
|
12
|
+
{@render children()}
|
|
13
|
+
<div class="modal-action">
|
|
14
|
+
<form method="dialog">
|
|
15
|
+
<Btn class="absolute top-2 right-2 btn-circle btn-ghost btn-sm" type="submit">
|
|
16
|
+
<img src={closeSvg} alt="閉じる" class="size-6" />
|
|
17
|
+
</Btn>
|
|
18
|
+
</form>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<form method="dialog" class="modal-backdrop">
|
|
22
|
+
<button>close</button>
|
|
23
|
+
</form>
|
|
24
|
+
</dialog>
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
export { default as Loading } from './components/Loading.svelte';
|
|
1
2
|
export { default as Btn } from './components/Btn.svelte';
|
|
2
3
|
export { default as Fab } from './components/Fab.svelte';
|
|
3
4
|
export { default as Input } from './components/Input.svelte';
|
|
5
|
+
export { default as Modal } from './components/Modal.svelte';
|
|
4
6
|
export { default as accountSvg } from './assets/account.svg';
|
|
5
7
|
export { default as alertSvg } from './assets/alert.svg';
|
|
6
8
|
export { default as calendarMonthSvg } from './assets/calendar-month.svg';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// place files you want to export through the `$lib` alias in this folder.
|
|
2
|
+
export { default as Loading } from './components/Loading.svelte';
|
|
2
3
|
export { default as Btn } from './components/Btn.svelte';
|
|
3
4
|
export { default as Fab } from './components/Fab.svelte';
|
|
4
5
|
export { default as Input } from './components/Input.svelte';
|
|
6
|
+
export { default as Modal } from './components/Modal.svelte';
|
|
5
7
|
export { default as accountSvg } from './assets/account.svg';
|
|
6
8
|
export { default as alertSvg } from './assets/alert.svg';
|
|
7
9
|
export { default as calendarMonthSvg } from './assets/calendar-month.svg';
|