@3birds/midori-ui 0.0.7 → 0.0.9

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.
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
- import Loading from './Loading.svelte';
3
- import { type BtnType } from '../types';
2
+ import { Loading } from '..';
3
+ import type { BtnType } from '../types';
4
4
 
5
5
  let {
6
6
  type = 'button',
@@ -1,4 +1,4 @@
1
- import { type BtnType } from '../types';
1
+ import type { BtnType } from '../types';
2
2
  type $$ComponentProps = {
3
3
  type?: BtnType;
4
4
  class?: string;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { type InputType } from '../types';
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
- <div class="w-lg">
34
- <fieldset class="fieldset w-full">
35
- {#if label}
36
- <legend class="fieldset-legend">{label}</legend>
37
- {/if}
38
- <label class="input rounded-full w-full {icon ? '' : 'px-5'}">
39
- {#if icon}
40
- <img src={icon} class="size-4" alt="アイコン" />
35
+ <div>
36
+ <fieldset class="fieldset w-full">
37
+ {#if label}
38
+ <legend class="fieldset-legend">{label}</legend>
41
39
  {/if}
42
- <input {type} {required} {readonly} {pattern} {disabled} {maxlength} {min} {max} {placeholder} />
43
- </label>
44
- {#if icon}
45
- <p class="label">{option}</p>
46
- {/if}
47
- </fieldset>
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>
57
+ {#if option}
58
+ <p class="label ml-auto">{option}</p>
59
+ {/if}
60
+ </fieldset>
48
61
  </div>
49
-
@@ -1,4 +1,4 @@
1
- import { type InputType } from '../types';
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 rounded-t-3xl sm:rounded-3xl">
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>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ value?: HTMLDialogElement;
3
+ children: import('svelte').Snippet;
4
+ };
5
+ declare const Modal: import("svelte").Component<$$ComponentProps, {}, "value">;
6
+ type Modal = ReturnType<typeof Modal>;
7
+ export default Modal;
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';
@@ -1,2 +1,2 @@
1
1
  export type BtnType = 'button' | 'submit';
2
- export type InputType = 'text' | 'email' | 'search' | 'tel' | 'url' | 'none' | 'numeric' | 'decimal';
2
+ export type InputType = 'text' | 'email' | 'search' | 'tel' | 'url' | 'none' | 'numeric' | 'decimal' | 'password';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3birds/midori-ui",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",