@14ch/svelte-ui 0.0.26 → 0.0.28
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/Button.svelte +8 -1
- package/dist/components/Button.svelte.d.ts +8 -1
- package/dist/components/Checkbox.svelte +7 -0
- package/dist/components/Checkbox.svelte.d.ts +7 -0
- package/dist/components/CheckboxGroup.svelte +5 -0
- package/dist/components/CheckboxGroup.svelte.d.ts +5 -0
- package/dist/components/ColorPicker.svelte +3 -0
- package/dist/components/ColorPicker.svelte.d.ts +3 -0
- package/dist/components/Combobox.svelte +7 -0
- package/dist/components/Combobox.svelte.d.ts +6 -0
- package/dist/components/ConfirmDialog.svelte +7 -0
- package/dist/components/ConfirmDialog.svelte.d.ts +7 -3
- package/dist/components/Datepicker.svelte +12 -0
- package/dist/components/Datepicker.svelte.d.ts +12 -3
- package/dist/components/Dialog.svelte +12 -0
- package/dist/components/Dialog.svelte.d.ts +12 -4
- package/dist/components/Drawer.svelte +13 -0
- package/dist/components/Drawer.svelte.d.ts +13 -4
- package/dist/components/Fab.svelte +11 -0
- package/dist/components/Fab.svelte.d.ts +11 -0
- package/dist/components/FileUploader.svelte +4 -0
- package/dist/components/FileUploader.svelte.d.ts +4 -0
- package/dist/components/Icon.svelte +8 -0
- package/dist/components/Icon.svelte.d.ts +8 -0
- package/dist/components/IconButton.svelte +13 -0
- package/dist/components/IconButton.svelte.d.ts +13 -0
- package/dist/components/ImageUploader.svelte +6 -0
- package/dist/components/ImageUploader.svelte.d.ts +6 -0
- package/dist/components/Input.svelte +18 -1
- package/dist/components/Input.svelte.d.ts +13 -0
- package/dist/components/LoadingSpinner.svelte +4 -0
- package/dist/components/LoadingSpinner.svelte.d.ts +4 -0
- package/dist/components/Modal.svelte +9 -0
- package/dist/components/Modal.svelte.d.ts +9 -4
- package/dist/components/Nav.svelte +6 -0
- package/dist/components/Nav.svelte.d.ts +6 -0
- package/dist/components/Pagination.svelte +7 -0
- package/dist/components/Pagination.svelte.d.ts +7 -0
- package/dist/components/Popup.svelte +13 -0
- package/dist/components/Popup.svelte.d.ts +13 -4
- package/dist/components/PopupMenu.svelte +8 -0
- package/dist/components/PopupMenu.svelte.d.ts +8 -3
- package/dist/components/PopupMenuButton.svelte +7 -0
- package/dist/components/PopupMenuButton.svelte.d.ts +7 -0
- package/dist/components/Radio.svelte +7 -0
- package/dist/components/Radio.svelte.d.ts +7 -0
- package/dist/components/RadioGroup.svelte +5 -0
- package/dist/components/RadioGroup.svelte.d.ts +5 -0
- package/dist/components/SegmentedControl.svelte +5 -0
- package/dist/components/SegmentedControl.svelte.d.ts +5 -0
- package/dist/components/Select.svelte +5 -0
- package/dist/components/Select.svelte.d.ts +4 -0
- package/dist/components/Slider.svelte +5 -0
- package/dist/components/Slider.svelte.d.ts +5 -0
- package/dist/components/Snackbar.svelte +4 -0
- package/dist/components/Snackbar.svelte.d.ts +4 -0
- package/dist/components/Switch.svelte +3 -0
- package/dist/components/Switch.svelte.d.ts +3 -0
- package/dist/components/Tab.svelte +7 -0
- package/dist/components/Tab.svelte.d.ts +7 -0
- package/dist/components/Textarea.svelte +10 -0
- package/dist/components/Textarea.svelte.d.ts +9 -0
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -24,21 +24,27 @@
|
|
|
24
24
|
children: Snippet;
|
|
25
25
|
|
|
26
26
|
// HTML属性系
|
|
27
|
+
/** @default 'button' */
|
|
27
28
|
type?: HTMLButtonAttributes['type'];
|
|
28
29
|
tabindex?: number | null;
|
|
29
30
|
|
|
30
31
|
// スタイル/レイアウト
|
|
31
32
|
customStyle?: HTMLButtonAttributes['style'];
|
|
33
|
+
/** @default 'ghost' */
|
|
32
34
|
variant?: ButtonVariant;
|
|
35
|
+
/** @default 'medium' */
|
|
33
36
|
size?: ButtonSize;
|
|
37
|
+
/** Custom CSS color value. Overrides the theme color. */
|
|
34
38
|
color?: string;
|
|
35
39
|
fullWidth?: boolean;
|
|
40
|
+
/** Content alignment. Useful with `fullWidth`. @default 'center' */
|
|
36
41
|
align?: 'left' | 'center' | 'right';
|
|
37
|
-
minWidth?: string | number;
|
|
38
42
|
rounded?: boolean;
|
|
43
|
+
/** Adds a chevron-down icon. Use when the button opens a popup/dropdown. @default false */
|
|
39
44
|
popup?: boolean;
|
|
40
45
|
|
|
41
46
|
// アイコン関連
|
|
47
|
+
/** Material Symbols icon name. */
|
|
42
48
|
icon?: string;
|
|
43
49
|
iconFilled?: boolean;
|
|
44
50
|
iconWeight?: IconWeight;
|
|
@@ -48,6 +54,7 @@
|
|
|
48
54
|
|
|
49
55
|
// 状態/動作
|
|
50
56
|
disabled?: boolean;
|
|
57
|
+
/** Shows a loading spinner and disables interaction. @default false */
|
|
51
58
|
loading?: boolean;
|
|
52
59
|
|
|
53
60
|
// ARIA/アクセシビリティ
|
|
@@ -5,17 +5,23 @@ import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, Pointer
|
|
|
5
5
|
import type { ButtonVariant, ButtonSize } from '../types/propOptions';
|
|
6
6
|
export type ButtonProps = {
|
|
7
7
|
children: Snippet;
|
|
8
|
+
/** @default 'button' */
|
|
8
9
|
type?: HTMLButtonAttributes['type'];
|
|
9
10
|
tabindex?: number | null;
|
|
10
11
|
customStyle?: HTMLButtonAttributes['style'];
|
|
12
|
+
/** @default 'ghost' */
|
|
11
13
|
variant?: ButtonVariant;
|
|
14
|
+
/** @default 'medium' */
|
|
12
15
|
size?: ButtonSize;
|
|
16
|
+
/** Custom CSS color value. Overrides the theme color. */
|
|
13
17
|
color?: string;
|
|
14
18
|
fullWidth?: boolean;
|
|
19
|
+
/** Content alignment. Useful with `fullWidth`. @default 'center' */
|
|
15
20
|
align?: 'left' | 'center' | 'right';
|
|
16
|
-
minWidth?: string | number;
|
|
17
21
|
rounded?: boolean;
|
|
22
|
+
/** Adds a chevron-down icon. Use when the button opens a popup/dropdown. @default false */
|
|
18
23
|
popup?: boolean;
|
|
24
|
+
/** Material Symbols icon name. */
|
|
19
25
|
icon?: string;
|
|
20
26
|
iconFilled?: boolean;
|
|
21
27
|
iconWeight?: IconWeight;
|
|
@@ -23,6 +29,7 @@ export type ButtonProps = {
|
|
|
23
29
|
iconOpticalSize?: IconOpticalSize;
|
|
24
30
|
iconVariant?: IconVariant;
|
|
25
31
|
disabled?: boolean;
|
|
32
|
+
/** Shows a loading spinner and disables interaction. @default false */
|
|
26
33
|
loading?: boolean;
|
|
27
34
|
ariaLabel?: string;
|
|
28
35
|
ariaDescribedby?: string;
|
|
@@ -15,23 +15,30 @@
|
|
|
15
15
|
// =========================================================================
|
|
16
16
|
export type CheckboxProps = {
|
|
17
17
|
// Snippet
|
|
18
|
+
/** Label content displayed next to the checkbox. */
|
|
18
19
|
children?: Snippet;
|
|
19
20
|
|
|
20
21
|
// 基本プロパティ
|
|
22
|
+
/** Native `name` attribute. */
|
|
21
23
|
name?: string;
|
|
24
|
+
/** Checked state. Supports `bind:value` for two-way binding. */
|
|
22
25
|
value: boolean;
|
|
26
|
+
/** Shows the indeterminate (partially checked) state. @default false */
|
|
23
27
|
indeterminate?: boolean;
|
|
24
28
|
|
|
25
29
|
// HTML属性系
|
|
26
30
|
id?: string;
|
|
27
31
|
// スタイル/レイアウト
|
|
32
|
+
/** Checkbox size. @default 'medium' */
|
|
28
33
|
size?: 'small' | 'medium' | 'large';
|
|
29
34
|
|
|
30
35
|
// 状態/動作
|
|
36
|
+
/** Disables the checkbox. @default false */
|
|
31
37
|
disabled?: boolean;
|
|
32
38
|
required?: boolean;
|
|
33
39
|
|
|
34
40
|
// ARIA/アクセシビリティ
|
|
41
|
+
/** Disables animations for users who prefer reduced motion. @default false */
|
|
35
42
|
reducedMotion?: boolean;
|
|
36
43
|
|
|
37
44
|
// フォーカスイベント
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
2
|
import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler } from '../types/callbackHandlers';
|
|
3
3
|
export type CheckboxProps = {
|
|
4
|
+
/** Label content displayed next to the checkbox. */
|
|
4
5
|
children?: Snippet;
|
|
6
|
+
/** Native `name` attribute. */
|
|
5
7
|
name?: string;
|
|
8
|
+
/** Checked state. Supports `bind:value` for two-way binding. */
|
|
6
9
|
value: boolean;
|
|
10
|
+
/** Shows the indeterminate (partially checked) state. @default false */
|
|
7
11
|
indeterminate?: boolean;
|
|
8
12
|
id?: string;
|
|
13
|
+
/** Checkbox size. @default 'medium' */
|
|
9
14
|
size?: 'small' | 'medium' | 'large';
|
|
15
|
+
/** Disables the checkbox. @default false */
|
|
10
16
|
disabled?: boolean;
|
|
11
17
|
required?: boolean;
|
|
18
|
+
/** Disables animations for users who prefer reduced motion. @default false */
|
|
12
19
|
reducedMotion?: boolean;
|
|
13
20
|
onfocus?: FocusHandler;
|
|
14
21
|
onblur?: FocusHandler;
|
|
@@ -13,14 +13,18 @@
|
|
|
13
13
|
|
|
14
14
|
export type CheckboxGroupProps = {
|
|
15
15
|
// 基本プロパティ
|
|
16
|
+
/** `{ label, value, disabled? }[]` */
|
|
16
17
|
options: Option[];
|
|
18
|
+
/** Array of currently checked values. Supports `bind:value`. */
|
|
17
19
|
value: OptionValue[];
|
|
18
20
|
|
|
19
21
|
// スタイル/レイアウト
|
|
22
|
+
/** @default 'vertical' */
|
|
20
23
|
direction?: 'vertical' | 'horizontal';
|
|
21
24
|
gap?: string | number;
|
|
22
25
|
wrap?: boolean;
|
|
23
26
|
minOptionWidth?: string | number;
|
|
27
|
+
/** @default 'medium' */
|
|
24
28
|
size?: 'small' | 'medium' | 'large';
|
|
25
29
|
|
|
26
30
|
// 状態/動作
|
|
@@ -28,6 +32,7 @@
|
|
|
28
32
|
required?: boolean;
|
|
29
33
|
|
|
30
34
|
// ARIA/アクセシビリティ
|
|
35
|
+
/** Disables animations for accessibility. @default false */
|
|
31
36
|
reducedMotion?: boolean;
|
|
32
37
|
|
|
33
38
|
// 入力イベント
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import type { Option, OptionValue } from '../types/options';
|
|
2
2
|
import type { BivariantValueHandler } from '../types/callbackHandlers';
|
|
3
3
|
export type CheckboxGroupProps = {
|
|
4
|
+
/** `{ label, value, disabled? }[]` */
|
|
4
5
|
options: Option[];
|
|
6
|
+
/** Array of currently checked values. Supports `bind:value`. */
|
|
5
7
|
value: OptionValue[];
|
|
8
|
+
/** @default 'vertical' */
|
|
6
9
|
direction?: 'vertical' | 'horizontal';
|
|
7
10
|
gap?: string | number;
|
|
8
11
|
wrap?: boolean;
|
|
9
12
|
minOptionWidth?: string | number;
|
|
13
|
+
/** @default 'medium' */
|
|
10
14
|
size?: 'small' | 'medium' | 'large';
|
|
11
15
|
disabled?: boolean;
|
|
12
16
|
required?: boolean;
|
|
17
|
+
/** Disables animations for accessibility. @default false */
|
|
13
18
|
reducedMotion?: boolean;
|
|
14
19
|
onchange?: BivariantValueHandler<OptionValue[]>;
|
|
15
20
|
};
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
// =========================================================================
|
|
19
19
|
export type ColorPickerProps = {
|
|
20
20
|
// 基本プロパティ
|
|
21
|
+
/** Hex color string (e.g. `"#ff0000"`). Supports `bind:value`. */
|
|
21
22
|
value: string | null | undefined;
|
|
22
23
|
|
|
23
24
|
// HTML属性系
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
ariaLabel?: string;
|
|
26
27
|
// スタイル/レイアウト
|
|
27
28
|
customStyle?: string;
|
|
29
|
+
/** @default 'outline' */
|
|
28
30
|
focusStyle?: 'background' | 'outline' | 'none';
|
|
29
31
|
fullWidth?: boolean;
|
|
30
32
|
width?: string | number | null;
|
|
@@ -35,6 +37,7 @@
|
|
|
35
37
|
// 状態/動作
|
|
36
38
|
disabled?: boolean;
|
|
37
39
|
readonly?: boolean;
|
|
40
|
+
/** Shows a clear button when a value is selected. @default false */
|
|
38
41
|
clearable?: boolean;
|
|
39
42
|
clearButtonAriaLabel?: string;
|
|
40
43
|
iconVariant?: IconVariant;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { IconVariant } from '../types/icon';
|
|
2
2
|
import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler } from '../types/callbackHandlers';
|
|
3
3
|
export type ColorPickerProps = {
|
|
4
|
+
/** Hex color string (e.g. `"#ff0000"`). Supports `bind:value`. */
|
|
4
5
|
value: string | null | undefined;
|
|
5
6
|
id?: string;
|
|
6
7
|
ariaLabel?: string;
|
|
7
8
|
customStyle?: string;
|
|
9
|
+
/** @default 'outline' */
|
|
8
10
|
focusStyle?: 'background' | 'outline' | 'none';
|
|
9
11
|
fullWidth?: boolean;
|
|
10
12
|
width?: string | number | null;
|
|
@@ -13,6 +15,7 @@ export type ColorPickerProps = {
|
|
|
13
15
|
rounded?: boolean;
|
|
14
16
|
disabled?: boolean;
|
|
15
17
|
readonly?: boolean;
|
|
18
|
+
/** Shows a clear button when a value is selected. @default false */
|
|
16
19
|
clearable?: boolean;
|
|
17
20
|
clearButtonAriaLabel?: string;
|
|
18
21
|
iconVariant?: IconVariant;
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
export type ComboboxProps = {
|
|
21
21
|
// 基本プロパティ
|
|
22
22
|
name?: string;
|
|
23
|
+
/** Supports `bind:value`. */
|
|
23
24
|
value: string | number | null | undefined;
|
|
25
|
+
/** Dropdown suggestion list. */
|
|
24
26
|
options: string[];
|
|
25
27
|
|
|
26
28
|
// HTML属性系
|
|
@@ -30,7 +32,9 @@
|
|
|
30
32
|
|
|
31
33
|
// スタイル/レイアウト
|
|
32
34
|
customStyle?: string;
|
|
35
|
+
/** Renders inline (no border/background). @default false */
|
|
33
36
|
inline?: boolean;
|
|
37
|
+
/** @default 'outline' */
|
|
34
38
|
focusStyle?: 'background' | 'outline' | 'none';
|
|
35
39
|
placeholder?: string;
|
|
36
40
|
fullWidth?: boolean;
|
|
@@ -43,7 +47,9 @@
|
|
|
43
47
|
disabled?: boolean;
|
|
44
48
|
readonly?: boolean;
|
|
45
49
|
required?: boolean;
|
|
50
|
+
/** Filters options based on typed input. @default false */
|
|
46
51
|
filterable?: boolean;
|
|
52
|
+
/** Shows a clear button when a value is entered. @default false */
|
|
47
53
|
clearable?: boolean;
|
|
48
54
|
|
|
49
55
|
// 入力イベント
|
|
@@ -561,6 +567,7 @@
|
|
|
561
567
|
background-color: transparent;
|
|
562
568
|
text-align: left;
|
|
563
569
|
cursor: pointer;
|
|
570
|
+
font-family: inherit;
|
|
564
571
|
font-size: inherit;
|
|
565
572
|
color: var(--svelte-ui-text-color);
|
|
566
573
|
transition: background-color var(--svelte-ui-transition-duration) ease;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler, BivariantValueHandler } from '../types/callbackHandlers';
|
|
2
2
|
export type ComboboxProps = {
|
|
3
3
|
name?: string;
|
|
4
|
+
/** Supports `bind:value`. */
|
|
4
5
|
value: string | number | null | undefined;
|
|
6
|
+
/** Dropdown suggestion list. */
|
|
5
7
|
options: string[];
|
|
6
8
|
id?: string | null;
|
|
7
9
|
tabindex?: number | null;
|
|
8
10
|
maxlength?: number | null;
|
|
9
11
|
customStyle?: string;
|
|
12
|
+
/** Renders inline (no border/background). @default false */
|
|
10
13
|
inline?: boolean;
|
|
14
|
+
/** @default 'outline' */
|
|
11
15
|
focusStyle?: 'background' | 'outline' | 'none';
|
|
12
16
|
placeholder?: string;
|
|
13
17
|
fullWidth?: boolean;
|
|
@@ -18,7 +22,9 @@ export type ComboboxProps = {
|
|
|
18
22
|
disabled?: boolean;
|
|
19
23
|
readonly?: boolean;
|
|
20
24
|
required?: boolean;
|
|
25
|
+
/** Filters options based on typed input. @default false */
|
|
21
26
|
filterable?: boolean;
|
|
27
|
+
/** Shows a clear button when a value is entered. @default false */
|
|
22
28
|
clearable?: boolean;
|
|
23
29
|
onchange?: BivariantValueHandler<string | number | null | undefined>;
|
|
24
30
|
oninput?: BivariantValueHandler<string | number | null | undefined>;
|
|
@@ -20,12 +20,16 @@
|
|
|
20
20
|
id?: string;
|
|
21
21
|
|
|
22
22
|
// スタイル/レイアウト
|
|
23
|
+
/** Renders the confirm button in a destructive (red) style. @default false */
|
|
23
24
|
danger?: boolean;
|
|
25
|
+
/** @default 400 */
|
|
24
26
|
width?: string | number;
|
|
25
27
|
scrollable?: boolean;
|
|
26
28
|
|
|
27
29
|
// 状態/動作
|
|
30
|
+
/** Use `confirmDialogRef.open()` / `.close()` instead of binding this directly. */
|
|
28
31
|
isOpen?: boolean;
|
|
32
|
+
/** Closes when clicking the backdrop. @default true */
|
|
29
33
|
closeIfClickOutside?: boolean;
|
|
30
34
|
focusFirstOnOpen?: boolean;
|
|
31
35
|
|
|
@@ -74,14 +78,17 @@
|
|
|
74
78
|
close();
|
|
75
79
|
};
|
|
76
80
|
|
|
81
|
+
/** Opens the dialog. */
|
|
77
82
|
export const open = (): void => {
|
|
78
83
|
isOpen = true;
|
|
79
84
|
};
|
|
80
85
|
|
|
86
|
+
/** Closes the dialog. */
|
|
81
87
|
export const close = (): void => {
|
|
82
88
|
isOpen = false;
|
|
83
89
|
};
|
|
84
90
|
|
|
91
|
+
/** Toggles between open and closed. */
|
|
85
92
|
export const toggle = (): void => {
|
|
86
93
|
isOpen = !isOpen;
|
|
87
94
|
};
|
|
@@ -4,19 +4,23 @@ export type ConfirmDialogProps = {
|
|
|
4
4
|
submitLabel?: string;
|
|
5
5
|
cancelLabel?: string;
|
|
6
6
|
id?: string;
|
|
7
|
+
/** Renders the confirm button in a destructive (red) style. @default false */
|
|
7
8
|
danger?: boolean;
|
|
9
|
+
/** @default 400 */
|
|
8
10
|
width?: string | number;
|
|
9
11
|
scrollable?: boolean;
|
|
12
|
+
/** Use `confirmDialogRef.open()` / `.close()` instead of binding this directly. */
|
|
10
13
|
isOpen?: boolean;
|
|
14
|
+
/** Closes when clicking the backdrop. @default true */
|
|
11
15
|
closeIfClickOutside?: boolean;
|
|
12
16
|
focusFirstOnOpen?: boolean;
|
|
13
17
|
onSubmit?: () => void;
|
|
14
18
|
onCancel?: () => void;
|
|
15
19
|
};
|
|
16
20
|
declare const ConfirmDialog: import("svelte").Component<ConfirmDialogProps, {
|
|
17
|
-
open: () => void;
|
|
18
|
-
close: () => void;
|
|
19
|
-
toggle: () => void;
|
|
21
|
+
/** Opens the dialog. */ open: () => void;
|
|
22
|
+
/** Closes the dialog. */ close: () => void;
|
|
23
|
+
/** Toggles between open and closed. */ toggle: () => void;
|
|
20
24
|
}, "isOpen">;
|
|
21
25
|
type ConfirmDialog = ReturnType<typeof ConfirmDialog>;
|
|
22
26
|
export default ConfirmDialog;
|
|
@@ -33,16 +33,21 @@
|
|
|
33
33
|
// =========================================================================
|
|
34
34
|
export type DatepickerProps = {
|
|
35
35
|
// 基本プロパティ
|
|
36
|
+
/** Selected date (single mode) or range (range mode). Supports `bind:value`. */
|
|
36
37
|
value: Date | { start: Date; end: Date } | undefined;
|
|
38
|
+
/** dayjs format string for display (e.g. `"YYYY/MM/DD"`). */
|
|
37
39
|
format?: string;
|
|
38
40
|
placeholder?: string;
|
|
39
41
|
locale?: 'en' | 'ja' | 'fr' | 'de' | 'es' | 'zh-cn';
|
|
42
|
+
/** Separator between start and end dates in range mode. @default ' - ' */
|
|
40
43
|
rangeSeparator?: string;
|
|
41
44
|
|
|
42
45
|
// HTML属性系
|
|
43
46
|
id?: string;
|
|
44
47
|
// スタイル/レイアウト
|
|
48
|
+
/** Renders inline (no border/background). @default false */
|
|
45
49
|
inline?: boolean;
|
|
50
|
+
/** @default 'outline' */
|
|
46
51
|
focusStyle?: FocusStyle;
|
|
47
52
|
fullWidth?: boolean;
|
|
48
53
|
width?: string | number | null;
|
|
@@ -51,6 +56,7 @@
|
|
|
51
56
|
rounded?: boolean;
|
|
52
57
|
|
|
53
58
|
// アイコン関連
|
|
59
|
+
/** Shows a calendar icon. @default false */
|
|
54
60
|
hasIcon?: boolean;
|
|
55
61
|
iconFilled?: boolean;
|
|
56
62
|
iconWeight?: IconWeight;
|
|
@@ -61,8 +67,11 @@
|
|
|
61
67
|
// 状態/動作
|
|
62
68
|
disabled?: boolean;
|
|
63
69
|
readonly?: boolean;
|
|
70
|
+
/** `'single'` for one date, `'range'` for start/end selection. @default 'single' */
|
|
64
71
|
mode?: DatepickerMode;
|
|
72
|
+
/** Allows typing a date directly in the input. @default false */
|
|
65
73
|
enableTextInput?: boolean;
|
|
74
|
+
/** Opens the calendar when the input is clicked. @default true */
|
|
66
75
|
enableClickToOpen?: boolean;
|
|
67
76
|
minDate?: Date;
|
|
68
77
|
maxDate?: Date;
|
|
@@ -570,15 +579,18 @@
|
|
|
570
579
|
return match ? match[0] : trimmed;
|
|
571
580
|
};
|
|
572
581
|
|
|
582
|
+
/** Opens the calendar popup. */
|
|
573
583
|
export const open = () => {
|
|
574
584
|
datapickerCalendarRef?.reset();
|
|
575
585
|
popupRef?.open();
|
|
576
586
|
};
|
|
577
587
|
|
|
588
|
+
/** Closes the calendar popup. */
|
|
578
589
|
export const close = () => {
|
|
579
590
|
popupRef?.close();
|
|
580
591
|
};
|
|
581
592
|
|
|
593
|
+
/** Toggles the calendar popup. */
|
|
582
594
|
export const toggle = () => {
|
|
583
595
|
datapickerCalendarRef?.reset();
|
|
584
596
|
popupRef?.toggle();
|
|
@@ -8,22 +8,28 @@ import type { IconVariant, IconWeight, IconGrade, IconOpticalSize } from '../typ
|
|
|
8
8
|
import type { BivariantValueHandler, FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler } from '../types/callbackHandlers';
|
|
9
9
|
import type { DatepickerMode, FocusStyle } from '../types/propOptions';
|
|
10
10
|
export type DatepickerProps = {
|
|
11
|
+
/** Selected date (single mode) or range (range mode). Supports `bind:value`. */
|
|
11
12
|
value: Date | {
|
|
12
13
|
start: Date;
|
|
13
14
|
end: Date;
|
|
14
15
|
} | undefined;
|
|
16
|
+
/** dayjs format string for display (e.g. `"YYYY/MM/DD"`). */
|
|
15
17
|
format?: string;
|
|
16
18
|
placeholder?: string;
|
|
17
19
|
locale?: 'en' | 'ja' | 'fr' | 'de' | 'es' | 'zh-cn';
|
|
20
|
+
/** Separator between start and end dates in range mode. @default ' - ' */
|
|
18
21
|
rangeSeparator?: string;
|
|
19
22
|
id?: string;
|
|
23
|
+
/** Renders inline (no border/background). @default false */
|
|
20
24
|
inline?: boolean;
|
|
25
|
+
/** @default 'outline' */
|
|
21
26
|
focusStyle?: FocusStyle;
|
|
22
27
|
fullWidth?: boolean;
|
|
23
28
|
width?: string | number | null;
|
|
24
29
|
minWidth?: string | number | null;
|
|
25
30
|
maxWidth?: string | number | null;
|
|
26
31
|
rounded?: boolean;
|
|
32
|
+
/** Shows a calendar icon. @default false */
|
|
27
33
|
hasIcon?: boolean;
|
|
28
34
|
iconFilled?: boolean;
|
|
29
35
|
iconWeight?: IconWeight;
|
|
@@ -32,8 +38,11 @@ export type DatepickerProps = {
|
|
|
32
38
|
iconVariant?: IconVariant;
|
|
33
39
|
disabled?: boolean;
|
|
34
40
|
readonly?: boolean;
|
|
41
|
+
/** `'single'` for one date, `'range'` for start/end selection. @default 'single' */
|
|
35
42
|
mode?: DatepickerMode;
|
|
43
|
+
/** Allows typing a date directly in the input. @default false */
|
|
36
44
|
enableTextInput?: boolean;
|
|
45
|
+
/** Opens the calendar when the input is clicked. @default true */
|
|
37
46
|
enableClickToOpen?: boolean;
|
|
38
47
|
minDate?: Date;
|
|
39
48
|
maxDate?: Date;
|
|
@@ -68,9 +77,9 @@ export type DatepickerProps = {
|
|
|
68
77
|
[key: string]: any;
|
|
69
78
|
};
|
|
70
79
|
declare const Datepicker: import("svelte").Component<DatepickerProps, {
|
|
71
|
-
open: () => void;
|
|
72
|
-
close: () => void;
|
|
73
|
-
toggle: () => void;
|
|
80
|
+
/** Opens the calendar popup. */ open: () => void;
|
|
81
|
+
/** Closes the calendar popup. */ close: () => void;
|
|
82
|
+
/** Toggles the calendar popup. */ toggle: () => void;
|
|
74
83
|
}, "value">;
|
|
75
84
|
type Datepicker = ReturnType<typeof Datepicker>;
|
|
76
85
|
export default Datepicker;
|
|
@@ -34,15 +34,23 @@
|
|
|
34
34
|
id?: string;
|
|
35
35
|
|
|
36
36
|
// スタイル/レイアウト
|
|
37
|
+
/** Dialog width in px (number) or any CSS unit (string). @default 320 */
|
|
37
38
|
width?: string | number;
|
|
39
|
+
/** Inline style applied to the body area. */
|
|
38
40
|
bodyStyle?: string;
|
|
41
|
+
/** Removes default body padding. @default false */
|
|
39
42
|
noPadding?: boolean;
|
|
40
43
|
|
|
41
44
|
// 状態/動作
|
|
45
|
+
/** Use `dialogRef.open()` / `.close()` instead of binding this directly. */
|
|
42
46
|
isOpen?: boolean;
|
|
47
|
+
/** Makes the body area scrollable when content overflows. @default false */
|
|
43
48
|
scrollable?: boolean;
|
|
49
|
+
/** Closes when clicking the backdrop. @default true */
|
|
44
50
|
closeIfClickOutside?: boolean;
|
|
51
|
+
/** Returns focus to the trigger element on close. @default false */
|
|
45
52
|
restoreFocus?: boolean;
|
|
53
|
+
/** Focuses the first focusable element on open. @default false */
|
|
46
54
|
focusFirstOnOpen?: boolean;
|
|
47
55
|
|
|
48
56
|
// ARIA/アクセシビリティ
|
|
@@ -85,18 +93,22 @@
|
|
|
85
93
|
// =========================================================================
|
|
86
94
|
// Methods
|
|
87
95
|
// =========================================================================
|
|
96
|
+
/** Opens the dialog. */
|
|
88
97
|
export const open = (): void => {
|
|
89
98
|
modalRef?.open(title || ariaLabel);
|
|
90
99
|
};
|
|
91
100
|
|
|
101
|
+
/** Closes the dialog. */
|
|
92
102
|
export const close = (): void => {
|
|
93
103
|
modalRef?.close(title || ariaLabel);
|
|
94
104
|
};
|
|
95
105
|
|
|
106
|
+
/** Toggles between open and closed. */
|
|
96
107
|
export const toggle = (): void => {
|
|
97
108
|
modalRef?.toggle(title || ariaLabel);
|
|
98
109
|
};
|
|
99
110
|
|
|
111
|
+
/** @internal Completes the close animation. Called automatically. */
|
|
100
112
|
export const closeEnd = (): void => {
|
|
101
113
|
modalRef?.closeEnd();
|
|
102
114
|
};
|
|
@@ -18,22 +18,30 @@ export type DialogProps = {
|
|
|
18
18
|
title?: string;
|
|
19
19
|
description?: string;
|
|
20
20
|
id?: string;
|
|
21
|
+
/** Dialog width in px (number) or any CSS unit (string). @default 320 */
|
|
21
22
|
width?: string | number;
|
|
23
|
+
/** Inline style applied to the body area. */
|
|
22
24
|
bodyStyle?: string;
|
|
25
|
+
/** Removes default body padding. @default false */
|
|
23
26
|
noPadding?: boolean;
|
|
27
|
+
/** Use `dialogRef.open()` / `.close()` instead of binding this directly. */
|
|
24
28
|
isOpen?: boolean;
|
|
29
|
+
/** Makes the body area scrollable when content overflows. @default false */
|
|
25
30
|
scrollable?: boolean;
|
|
31
|
+
/** Closes when clicking the backdrop. @default true */
|
|
26
32
|
closeIfClickOutside?: boolean;
|
|
33
|
+
/** Returns focus to the trigger element on close. @default false */
|
|
27
34
|
restoreFocus?: boolean;
|
|
35
|
+
/** Focuses the first focusable element on open. @default false */
|
|
28
36
|
focusFirstOnOpen?: boolean;
|
|
29
37
|
ariaLabel?: string;
|
|
30
38
|
ariaDescribedby?: string;
|
|
31
39
|
};
|
|
32
40
|
declare const Dialog: import("svelte").Component<DialogProps, {
|
|
33
|
-
open: () => void;
|
|
34
|
-
close: () => void;
|
|
35
|
-
toggle: () => void;
|
|
36
|
-
closeEnd: () => void;
|
|
41
|
+
/** Opens the dialog. */ open: () => void;
|
|
42
|
+
/** Closes the dialog. */ close: () => void;
|
|
43
|
+
/** Toggles between open and closed. */ toggle: () => void;
|
|
44
|
+
/** @internal Completes the close animation. Called automatically. */ closeEnd: () => void;
|
|
37
45
|
}, "isOpen">;
|
|
38
46
|
type Dialog = ReturnType<typeof Dialog>;
|
|
39
47
|
export default Dialog;
|
|
@@ -34,16 +34,25 @@
|
|
|
34
34
|
id?: string;
|
|
35
35
|
|
|
36
36
|
// スタイル/レイアウト
|
|
37
|
+
/** Drawer width in px (number) or any CSS unit (string). */
|
|
37
38
|
width?: string | number | undefined;
|
|
39
|
+
/** @default 'left' */
|
|
38
40
|
position?: 'left' | 'right';
|
|
41
|
+
/** Inline style applied to the body area. */
|
|
39
42
|
bodyStyle?: string;
|
|
43
|
+
/** Removes default body padding. @default false */
|
|
40
44
|
noPadding?: boolean;
|
|
41
45
|
|
|
42
46
|
// 状態/動作
|
|
47
|
+
/** Use `drawerRef.open()` / `.close()` instead of binding this directly. */
|
|
43
48
|
isOpen?: boolean;
|
|
49
|
+
/** Makes the body area scrollable when content overflows. @default false */
|
|
44
50
|
scrollable?: boolean;
|
|
51
|
+
/** Closes when clicking the backdrop. @default true */
|
|
45
52
|
closeIfClickOutside?: boolean;
|
|
53
|
+
/** Returns focus to the trigger element on close. @default false */
|
|
46
54
|
restoreFocus?: boolean;
|
|
55
|
+
/** Focuses the first focusable element on open. @default false */
|
|
47
56
|
focusFirstOnOpen?: boolean;
|
|
48
57
|
|
|
49
58
|
// ARIA/アクセシビリティ
|
|
@@ -87,18 +96,22 @@
|
|
|
87
96
|
// =========================================================================
|
|
88
97
|
// Methods
|
|
89
98
|
// =========================================================================
|
|
99
|
+
/** Opens the drawer. */
|
|
90
100
|
export const open = (): void => {
|
|
91
101
|
modalRef?.open(title || ariaLabel);
|
|
92
102
|
};
|
|
93
103
|
|
|
104
|
+
/** Closes the drawer. */
|
|
94
105
|
export const close = (): void => {
|
|
95
106
|
modalRef?.close(title || ariaLabel);
|
|
96
107
|
};
|
|
97
108
|
|
|
109
|
+
/** Toggles between open and closed. */
|
|
98
110
|
export const toggle = (): void => {
|
|
99
111
|
modalRef?.toggle(title || ariaLabel);
|
|
100
112
|
};
|
|
101
113
|
|
|
114
|
+
/** @internal Completes the close animation. Called automatically. */
|
|
102
115
|
export const closeEnd = (): void => {
|
|
103
116
|
modalRef?.closeEnd();
|
|
104
117
|
};
|
|
@@ -18,23 +18,32 @@ export type DrawerProps = {
|
|
|
18
18
|
title?: string;
|
|
19
19
|
description?: string;
|
|
20
20
|
id?: string;
|
|
21
|
+
/** Drawer width in px (number) or any CSS unit (string). */
|
|
21
22
|
width?: string | number | undefined;
|
|
23
|
+
/** @default 'left' */
|
|
22
24
|
position?: 'left' | 'right';
|
|
25
|
+
/** Inline style applied to the body area. */
|
|
23
26
|
bodyStyle?: string;
|
|
27
|
+
/** Removes default body padding. @default false */
|
|
24
28
|
noPadding?: boolean;
|
|
29
|
+
/** Use `drawerRef.open()` / `.close()` instead of binding this directly. */
|
|
25
30
|
isOpen?: boolean;
|
|
31
|
+
/** Makes the body area scrollable when content overflows. @default false */
|
|
26
32
|
scrollable?: boolean;
|
|
33
|
+
/** Closes when clicking the backdrop. @default true */
|
|
27
34
|
closeIfClickOutside?: boolean;
|
|
35
|
+
/** Returns focus to the trigger element on close. @default false */
|
|
28
36
|
restoreFocus?: boolean;
|
|
37
|
+
/** Focuses the first focusable element on open. @default false */
|
|
29
38
|
focusFirstOnOpen?: boolean;
|
|
30
39
|
ariaLabel?: string;
|
|
31
40
|
ariaDescribedby?: string;
|
|
32
41
|
};
|
|
33
42
|
declare const Drawer: import("svelte").Component<DrawerProps, {
|
|
34
|
-
open: () => void;
|
|
35
|
-
close: () => void;
|
|
36
|
-
toggle: () => void;
|
|
37
|
-
closeEnd: () => void;
|
|
43
|
+
/** Opens the drawer. */ open: () => void;
|
|
44
|
+
/** Closes the drawer. */ close: () => void;
|
|
45
|
+
/** Toggles between open and closed. */ toggle: () => void;
|
|
46
|
+
/** @internal Completes the close animation. Called automatically. */ closeEnd: () => void;
|
|
38
47
|
}, "isOpen">;
|
|
39
48
|
type Drawer = ReturnType<typeof Drawer>;
|
|
40
49
|
export default Drawer;
|
|
@@ -21,23 +21,34 @@
|
|
|
21
21
|
// =========================================================================
|
|
22
22
|
export type FabProps = {
|
|
23
23
|
children?: Snippet;
|
|
24
|
+
/** @default 'button' */
|
|
24
25
|
type?: HTMLButtonAttributes['type'];
|
|
25
26
|
customStyle?: HTMLButtonAttributes['style'];
|
|
26
27
|
disabled?: boolean;
|
|
28
|
+
/** Shows a loading spinner and disables interaction. @default false */
|
|
27
29
|
loading?: boolean;
|
|
30
|
+
/** Material Symbols icon name. */
|
|
28
31
|
icon?: string;
|
|
29
32
|
iconFilled?: boolean;
|
|
30
33
|
iconWeight?: IconWeight;
|
|
31
34
|
iconGrade?: IconGrade;
|
|
32
35
|
iconOpticalSize?: IconOpticalSize;
|
|
33
36
|
iconVariant?: IconVariant;
|
|
37
|
+
/** Custom CSS color value. Overrides the theme color. */
|
|
34
38
|
color?: string;
|
|
39
|
+
/** @default 'ghost' */
|
|
35
40
|
variant?: ButtonVariant;
|
|
41
|
+
/** Fixed position on screen. When set, the FAB is `position: fixed`. */
|
|
36
42
|
position?: FabPosition;
|
|
43
|
+
/** Distance from the bottom edge when `position` is set. */
|
|
37
44
|
bottomOffset?: string | number;
|
|
45
|
+
/** Distance from the side edge when `position` is set. */
|
|
38
46
|
sideOffset?: string | number;
|
|
47
|
+
/** Adds safe-area inset padding (for notched devices). @default false */
|
|
39
48
|
useSafeArea?: boolean;
|
|
49
|
+
/** @default false */
|
|
40
50
|
shadow?: boolean;
|
|
51
|
+
/** Disables animations for accessibility. @default false */
|
|
41
52
|
reducedMotion?: boolean;
|
|
42
53
|
ariaLabel?: string;
|
|
43
54
|
ariaDescribedby?: string;
|