@14ch/svelte-ui 0.0.20 → 0.0.22
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/variables.scss +2 -2
- package/dist/components/Button.svelte +6 -8
- package/dist/components/Button.svelte.d.ts +0 -1
- package/dist/components/Checkbox.svelte +6 -11
- package/dist/components/Checkbox.svelte.d.ts +1 -3
- package/dist/components/CheckboxGroup.svelte +14 -9
- package/dist/components/ColorPicker.svelte +0 -6
- package/dist/components/ColorPicker.svelte.d.ts +0 -2
- package/dist/components/Combobox.svelte +0 -4
- package/dist/components/Combobox.svelte.d.ts +0 -2
- package/dist/components/Datepicker.svelte +0 -5
- package/dist/components/Datepicker.svelte.d.ts +0 -2
- package/dist/components/Fab.svelte +9 -11
- package/dist/components/Fab.svelte.d.ts +0 -1
- package/dist/components/FileUploader.svelte +11 -6
- package/dist/components/Icon.svelte +11 -9
- package/dist/components/IconButton.svelte +0 -3
- package/dist/components/IconButton.svelte.d.ts +0 -1
- package/dist/components/ImageUploader.svelte +10 -6
- package/dist/components/Input.svelte +8 -14
- package/dist/components/Input.svelte.d.ts +0 -2
- package/dist/components/LoadingSpinner.svelte +23 -20
- package/dist/components/Radio.svelte +6 -11
- package/dist/components/Radio.svelte.d.ts +1 -3
- package/dist/components/RadioGroup.svelte +14 -9
- package/dist/components/SegmentedControl.svelte +2 -2
- package/dist/components/Select.svelte +1 -5
- package/dist/components/Select.svelte.d.ts +0 -2
- package/dist/components/Slider.svelte +80 -38
- package/dist/components/Slider.svelte.d.ts +0 -2
- package/dist/components/SnackbarItem.svelte +53 -42
- package/dist/components/Switch.svelte +1 -6
- package/dist/components/Switch.svelte.d.ts +0 -2
- package/dist/components/TabItem.svelte +15 -17
- package/dist/components/Textarea.svelte +10 -8
- package/dist/components/Textarea.svelte.d.ts +0 -1
- package/package.json +1 -1
|
@@ -635,8 +635,8 @@
|
|
|
635
635
|
--svelte-ui-drawer-description-color: var(--svelte-ui-text-subtle-color);
|
|
636
636
|
|
|
637
637
|
/* LoadingSpinner */
|
|
638
|
-
--svelte-ui-
|
|
639
|
-
--svelte-ui-
|
|
638
|
+
--svelte-ui-loading-spinner-color: var(--svelte-ui-primary-color);
|
|
639
|
+
--svelte-ui-loading-spinner-size: 32px;
|
|
640
640
|
|
|
641
641
|
/* Snackbar */
|
|
642
642
|
--svelte-ui-snackbar-min-width: 300px;
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
children: Snippet;
|
|
25
25
|
|
|
26
26
|
// HTML属性系
|
|
27
|
-
buttonAttributes?: HTMLButtonAttributes | undefined;
|
|
28
27
|
type?: HTMLButtonAttributes['type'];
|
|
29
28
|
tabindex?: number | null;
|
|
30
29
|
|
|
@@ -99,7 +98,6 @@
|
|
|
99
98
|
children,
|
|
100
99
|
|
|
101
100
|
// HTML属性系
|
|
102
|
-
buttonAttributes,
|
|
103
101
|
type = 'button',
|
|
104
102
|
tabindex = null,
|
|
105
103
|
|
|
@@ -141,7 +139,7 @@
|
|
|
141
139
|
onkeyup = () => {}, // No params for type inference
|
|
142
140
|
|
|
143
141
|
// マウスイベント
|
|
144
|
-
onclick,
|
|
142
|
+
onclick = () => {}, // No params for type inference
|
|
145
143
|
onmousedown = () => {}, // No params for type inference
|
|
146
144
|
onmouseup = () => {}, // No params for type inference
|
|
147
145
|
onmouseenter = () => {}, // No params for type inference
|
|
@@ -328,9 +326,10 @@
|
|
|
328
326
|
{type}
|
|
329
327
|
disabled={isDisabled}
|
|
330
328
|
class={buttonClasses}
|
|
331
|
-
style=
|
|
332
|
-
|
|
333
|
-
|
|
329
|
+
style:color={textColors[variant]}
|
|
330
|
+
style:background-color={backgroundColors[variant]}
|
|
331
|
+
style:min-width={minWidthStyle}
|
|
332
|
+
style={customStyle}
|
|
334
333
|
onclick={handleClick}
|
|
335
334
|
onauxclick={handleAuxClick}
|
|
336
335
|
onfocus={handleFocus}
|
|
@@ -360,7 +359,6 @@
|
|
|
360
359
|
aria-expanded={ariaExpanded}
|
|
361
360
|
aria-busy={loading ? 'true' : undefined}
|
|
362
361
|
data-testid="button"
|
|
363
|
-
{...buttonAttributes}
|
|
364
362
|
{...restProps}
|
|
365
363
|
>
|
|
366
364
|
{#if loading}
|
|
@@ -392,7 +390,7 @@
|
|
|
392
390
|
|
|
393
391
|
<style>
|
|
394
392
|
.button {
|
|
395
|
-
display: flex;
|
|
393
|
+
display: inline-flex;
|
|
396
394
|
justify-content: center;
|
|
397
395
|
align-items: center;
|
|
398
396
|
gap: 4px;
|
|
@@ -5,7 +5,6 @@ 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
|
-
buttonAttributes?: HTMLButtonAttributes | undefined;
|
|
9
8
|
type?: HTMLButtonAttributes['type'];
|
|
10
9
|
tabindex?: number | null;
|
|
11
10
|
customStyle?: HTMLButtonAttributes['style'];
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
4
|
import { type Snippet } from 'svelte';
|
|
5
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
6
5
|
import type {
|
|
7
6
|
FocusHandler,
|
|
8
7
|
KeyboardHandler,
|
|
@@ -25,8 +24,6 @@
|
|
|
25
24
|
|
|
26
25
|
// HTML属性系
|
|
27
26
|
id?: string;
|
|
28
|
-
inputAttributes?: HTMLInputAttributes | undefined;
|
|
29
|
-
|
|
30
27
|
// スタイル/レイアウト
|
|
31
28
|
size?: 'small' | 'medium' | 'large';
|
|
32
29
|
|
|
@@ -37,9 +34,6 @@
|
|
|
37
34
|
// ARIA/アクセシビリティ
|
|
38
35
|
reducedMotion?: boolean;
|
|
39
36
|
|
|
40
|
-
// 入力イベント
|
|
41
|
-
onchange?: (value: boolean) => void;
|
|
42
|
-
|
|
43
37
|
// フォーカスイベント
|
|
44
38
|
onfocus?: FocusHandler;
|
|
45
39
|
onblur?: FocusHandler;
|
|
@@ -73,6 +67,9 @@
|
|
|
73
67
|
onpointermove?: PointerHandler;
|
|
74
68
|
onpointercancel?: PointerHandler;
|
|
75
69
|
|
|
70
|
+
// 入力イベント
|
|
71
|
+
onchange?: (value: boolean) => void;
|
|
72
|
+
|
|
76
73
|
// その他
|
|
77
74
|
[key: string]: any;
|
|
78
75
|
};
|
|
@@ -88,7 +85,6 @@
|
|
|
88
85
|
|
|
89
86
|
// HTML属性系
|
|
90
87
|
id = `checkbox-${Math.random().toString(36).substring(2, 15)}`,
|
|
91
|
-
inputAttributes,
|
|
92
88
|
|
|
93
89
|
// スタイル/レイアウト
|
|
94
90
|
size = 'medium',
|
|
@@ -100,9 +96,6 @@
|
|
|
100
96
|
// ARIA/アクセシビリティ
|
|
101
97
|
reducedMotion = false,
|
|
102
98
|
|
|
103
|
-
// 入力イベント
|
|
104
|
-
onchange = () => {}, // No params for type inference
|
|
105
|
-
|
|
106
99
|
// フォーカスイベント
|
|
107
100
|
onfocus = () => {}, // No params for type inference
|
|
108
101
|
onblur = () => {}, // No params for type inference
|
|
@@ -136,6 +129,9 @@
|
|
|
136
129
|
onpointermove = () => {}, // No params for type inference
|
|
137
130
|
onpointercancel = () => {}, // No params for type inference
|
|
138
131
|
|
|
132
|
+
// 入力イベント
|
|
133
|
+
onchange = () => {}, // No params for type inference
|
|
134
|
+
|
|
139
135
|
// その他
|
|
140
136
|
...restProps
|
|
141
137
|
}: CheckboxProps = $props();
|
|
@@ -321,7 +317,6 @@
|
|
|
321
317
|
onpointermove={handlePointerMove}
|
|
322
318
|
onpointercancel={handlePointerCancel}
|
|
323
319
|
onchange={handleChange}
|
|
324
|
-
{...inputAttributes}
|
|
325
320
|
{...restProps}
|
|
326
321
|
/>
|
|
327
322
|
<label for={id} class="checkbox__icon"></label>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
2
|
import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler } from '../types/callbackHandlers';
|
|
4
3
|
export type CheckboxProps = {
|
|
5
4
|
children?: Snippet;
|
|
@@ -7,12 +6,10 @@ export type CheckboxProps = {
|
|
|
7
6
|
value: boolean;
|
|
8
7
|
indeterminate?: boolean;
|
|
9
8
|
id?: string;
|
|
10
|
-
inputAttributes?: HTMLInputAttributes | undefined;
|
|
11
9
|
size?: 'small' | 'medium' | 'large';
|
|
12
10
|
disabled?: boolean;
|
|
13
11
|
required?: boolean;
|
|
14
12
|
reducedMotion?: boolean;
|
|
15
|
-
onchange?: (value: boolean) => void;
|
|
16
13
|
onfocus?: FocusHandler;
|
|
17
14
|
onblur?: FocusHandler;
|
|
18
15
|
onkeydown?: KeyboardHandler;
|
|
@@ -36,6 +33,7 @@ export type CheckboxProps = {
|
|
|
36
33
|
onpointerleave?: PointerHandler;
|
|
37
34
|
onpointermove?: PointerHandler;
|
|
38
35
|
onpointercancel?: PointerHandler;
|
|
36
|
+
onchange?: (value: boolean) => void;
|
|
39
37
|
[key: string]: any;
|
|
40
38
|
};
|
|
41
39
|
declare const Checkbox: import("svelte").Component<CheckboxProps, {}, "value" | "indeterminate">;
|
|
@@ -87,11 +87,10 @@
|
|
|
87
87
|
|
|
88
88
|
<ul
|
|
89
89
|
class="checkbox-group"
|
|
90
|
-
style
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
90
|
+
style:--internal-checkbox-group-flex-direction={direction === 'vertical' ? 'column' : 'row'}
|
|
91
|
+
style:--internal-checkbox-group-gap={gapStyle}
|
|
92
|
+
style:--internal-checkbox-group-wrap={wrap ? 'wrap' : 'none'}
|
|
93
|
+
style:--internal-checkbox-group-min-option-width={minOptionWidthStyle}
|
|
95
94
|
>
|
|
96
95
|
{#each options as option (option.value)}
|
|
97
96
|
{#if localValues[String(option.value)] !== undefined}
|
|
@@ -114,12 +113,18 @@
|
|
|
114
113
|
<style>
|
|
115
114
|
.checkbox-group {
|
|
116
115
|
display: flex;
|
|
117
|
-
flex-direction: var(
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
flex-direction: var(
|
|
117
|
+
--internal-checkbox-group-flex-direction,
|
|
118
|
+
var(--svelte-ui-checkbox-group-flex-direction)
|
|
119
|
+
);
|
|
120
|
+
gap: var(--internal-checkbox-group-gap, var(--svelte-ui-checkbox-group-gap));
|
|
121
|
+
flex-wrap: var(--internal-checkbox-group-wrap, var(--svelte-ui-checkbox-group-wrap));
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
.checkbox-group__option {
|
|
123
|
-
min-width: var(
|
|
125
|
+
min-width: var(
|
|
126
|
+
--internal-checkbox-group-min-option-width,
|
|
127
|
+
var(--svelte-ui-checkbox-group-min-option-width)
|
|
128
|
+
);
|
|
124
129
|
}
|
|
125
130
|
</style>
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { untrack } from 'svelte';
|
|
5
5
|
import Input from './Input.svelte';
|
|
6
6
|
import { t } from '../i18n';
|
|
7
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
8
7
|
import type { IconVariant } from '../types/icon';
|
|
9
8
|
import type {
|
|
10
9
|
FocusHandler,
|
|
@@ -24,8 +23,6 @@
|
|
|
24
23
|
// HTML属性系
|
|
25
24
|
id?: string;
|
|
26
25
|
ariaLabel?: string;
|
|
27
|
-
inputAttributes?: HTMLInputAttributes | undefined;
|
|
28
|
-
|
|
29
26
|
// スタイル/レイアウト
|
|
30
27
|
customStyle?: string;
|
|
31
28
|
focusStyle?: 'background' | 'outline' | 'none';
|
|
@@ -90,7 +87,6 @@
|
|
|
90
87
|
// HTML属性系
|
|
91
88
|
id = `colorpicker-${Math.random().toString(36).substring(2, 15)}`,
|
|
92
89
|
ariaLabel,
|
|
93
|
-
inputAttributes,
|
|
94
90
|
|
|
95
91
|
// スタイル/レイアウト
|
|
96
92
|
customStyle = '',
|
|
@@ -367,7 +363,6 @@
|
|
|
367
363
|
{maxWidth}
|
|
368
364
|
{rounded}
|
|
369
365
|
customStyle={`padding-left: var(--svelte-ui-colorpicker-text-padding-left); ${customStyle}`}
|
|
370
|
-
{inputAttributes}
|
|
371
366
|
onchange={handleChange}
|
|
372
367
|
oninput={handleInput}
|
|
373
368
|
onfocus={handleFocus}
|
|
@@ -408,7 +403,6 @@
|
|
|
408
403
|
onkeydown={handleKeydown}
|
|
409
404
|
{disabled}
|
|
410
405
|
class="color-picker__trigger-input"
|
|
411
|
-
{...inputAttributes}
|
|
412
406
|
{...restProps}
|
|
413
407
|
/>
|
|
414
408
|
<div
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
1
|
import type { IconVariant } from '../types/icon';
|
|
3
2
|
import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler } from '../types/callbackHandlers';
|
|
4
3
|
export type ColorPickerProps = {
|
|
5
4
|
value: string | null | undefined;
|
|
6
5
|
id?: string;
|
|
7
6
|
ariaLabel?: string;
|
|
8
|
-
inputAttributes?: HTMLInputAttributes | undefined;
|
|
9
7
|
customStyle?: string;
|
|
10
8
|
focusStyle?: 'background' | 'outline' | 'none';
|
|
11
9
|
fullWidth?: boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<!-- Combobox.svelte -->
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
5
4
|
import Input from './Input.svelte';
|
|
6
5
|
import Popup from './Popup.svelte';
|
|
7
6
|
import { announceSelection } from '../utils/accessibility';
|
|
@@ -25,7 +24,6 @@
|
|
|
25
24
|
options: string[];
|
|
26
25
|
|
|
27
26
|
// HTML属性系
|
|
28
|
-
inputAttributes?: HTMLInputAttributes | undefined;
|
|
29
27
|
id?: string | null;
|
|
30
28
|
tabindex?: number | null;
|
|
31
29
|
maxlength?: number | null;
|
|
@@ -96,7 +94,6 @@
|
|
|
96
94
|
options = [] as string[],
|
|
97
95
|
|
|
98
96
|
// HTML属性系
|
|
99
|
-
inputAttributes,
|
|
100
97
|
id = `combobox-${Math.random().toString(36).substring(2, 15)}`,
|
|
101
98
|
tabindex = null,
|
|
102
99
|
maxlength = null,
|
|
@@ -473,7 +470,6 @@
|
|
|
473
470
|
onpointerleave={handlePointerLeave}
|
|
474
471
|
onpointermove={handlePointerMove}
|
|
475
472
|
onpointercancel={handlePointerCancel}
|
|
476
|
-
{inputAttributes}
|
|
477
473
|
{...restProps}
|
|
478
474
|
role="textbox"
|
|
479
475
|
aria-autocomplete="list"
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
1
|
import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler, BivariantValueHandler } from '../types/callbackHandlers';
|
|
3
2
|
export type ComboboxProps = {
|
|
4
3
|
name?: string;
|
|
5
4
|
value: string | number | null | undefined;
|
|
6
5
|
options: string[];
|
|
7
|
-
inputAttributes?: HTMLInputAttributes | undefined;
|
|
8
6
|
id?: string | null;
|
|
9
7
|
tabindex?: number | null;
|
|
10
8
|
maxlength?: number | null;
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
import DatepickerCalendar from './DatepickerCalendar.svelte';
|
|
16
16
|
import { announceToScreenReader } from '../utils/accessibility';
|
|
17
17
|
import { getLocale } from '../config';
|
|
18
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
19
18
|
import type { IconVariant, IconWeight, IconGrade, IconOpticalSize } from '../types/icon';
|
|
20
19
|
import type {
|
|
21
20
|
BivariantValueHandler,
|
|
@@ -42,8 +41,6 @@
|
|
|
42
41
|
|
|
43
42
|
// HTML属性系
|
|
44
43
|
id?: string;
|
|
45
|
-
inputAttributes?: HTMLInputAttributes | undefined;
|
|
46
|
-
|
|
47
44
|
// スタイル/レイアウト
|
|
48
45
|
inline?: boolean;
|
|
49
46
|
focusStyle?: FocusStyle;
|
|
@@ -113,7 +110,6 @@
|
|
|
113
110
|
|
|
114
111
|
// HTML属性系
|
|
115
112
|
id = `datepicker-${Math.random().toString(36).substring(2, 15)}`,
|
|
116
|
-
inputAttributes,
|
|
117
113
|
|
|
118
114
|
// スタイル/レイアウト
|
|
119
115
|
inline = false,
|
|
@@ -655,7 +651,6 @@
|
|
|
655
651
|
onpointermove={handlePointerMove}
|
|
656
652
|
onpointercancel={handlePointerCancel}
|
|
657
653
|
{id}
|
|
658
|
-
{inputAttributes}
|
|
659
654
|
{...restProps}
|
|
660
655
|
/>
|
|
661
656
|
{#if !enableTextInput && !disabled && enableClickToOpen}
|
|
@@ -4,7 +4,6 @@ import 'dayjs/locale/fr';
|
|
|
4
4
|
import 'dayjs/locale/de';
|
|
5
5
|
import 'dayjs/locale/es';
|
|
6
6
|
import 'dayjs/locale/zh-cn';
|
|
7
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
8
7
|
import type { IconVariant, IconWeight, IconGrade, IconOpticalSize } from '../types/icon';
|
|
9
8
|
import type { BivariantValueHandler, FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler } from '../types/callbackHandlers';
|
|
10
9
|
import type { DatepickerMode, FocusStyle } from '../types/propOptions';
|
|
@@ -18,7 +17,6 @@ export type DatepickerProps = {
|
|
|
18
17
|
locale?: 'en' | 'ja' | 'fr' | 'de' | 'es' | 'zh-cn';
|
|
19
18
|
rangeSeparator?: string;
|
|
20
19
|
id?: string;
|
|
21
|
-
inputAttributes?: HTMLInputAttributes | undefined;
|
|
22
20
|
inline?: boolean;
|
|
23
21
|
focusStyle?: FocusStyle;
|
|
24
22
|
fullWidth?: boolean;
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
// =========================================================================
|
|
22
22
|
export type FabProps = {
|
|
23
23
|
children?: Snippet;
|
|
24
|
-
buttonAttributes?: HTMLButtonAttributes | undefined;
|
|
25
24
|
type?: HTMLButtonAttributes['type'];
|
|
26
25
|
customStyle?: HTMLButtonAttributes['style'];
|
|
27
26
|
disabled?: boolean;
|
|
@@ -83,7 +82,6 @@
|
|
|
83
82
|
|
|
84
83
|
// HTML属性系
|
|
85
84
|
type = 'button',
|
|
86
|
-
buttonAttributes,
|
|
87
85
|
|
|
88
86
|
// スタイル/レイアウト
|
|
89
87
|
customStyle,
|
|
@@ -293,7 +291,6 @@
|
|
|
293
291
|
<button
|
|
294
292
|
{type}
|
|
295
293
|
disabled={disabled || loading}
|
|
296
|
-
{...buttonAttributes}
|
|
297
294
|
{...restProps}
|
|
298
295
|
class="fab"
|
|
299
296
|
class:fab--outlined={variant === 'outlined'}
|
|
@@ -307,10 +304,11 @@
|
|
|
307
304
|
class:fab--shadow={shadow}
|
|
308
305
|
class:fab--loading={loading}
|
|
309
306
|
class:fab--no-motion={reducedMotion}
|
|
310
|
-
style=
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
307
|
+
style:color={textColors[variant]}
|
|
308
|
+
style:background-color={backgroundColors[variant]}
|
|
309
|
+
style:--internal-fab-bottom={bottomOffsetStyle}
|
|
310
|
+
style:--internal-fab-side={sideOffsetStyle}
|
|
311
|
+
style={customStyle}
|
|
314
312
|
onclick={handleClick}
|
|
315
313
|
onfocus={handleFocus}
|
|
316
314
|
onblur={handleBlur}
|
|
@@ -368,7 +366,7 @@
|
|
|
368
366
|
justify-content: center;
|
|
369
367
|
align-items: center;
|
|
370
368
|
position: fixed;
|
|
371
|
-
bottom: var(--fab-bottom, 24px);
|
|
369
|
+
bottom: var(--internal-fab-bottom, 24px);
|
|
372
370
|
height: 56px;
|
|
373
371
|
padding: 0 20px;
|
|
374
372
|
background-color: transparent;
|
|
@@ -385,17 +383,17 @@
|
|
|
385
383
|
transition-duration: var(--svelte-ui-transition-duration);
|
|
386
384
|
}
|
|
387
385
|
.fab.fab--left {
|
|
388
|
-
left: var(--fab-side, 24px);
|
|
386
|
+
left: var(--internal-fab-side, 24px);
|
|
389
387
|
}
|
|
390
388
|
.fab.fab--center {
|
|
391
389
|
left: 50%;
|
|
392
390
|
transform: translateX(-50%);
|
|
393
391
|
}
|
|
394
392
|
.fab.fab--right {
|
|
395
|
-
right: var(--fab-side, 24px);
|
|
393
|
+
right: var(--internal-fab-side, 24px);
|
|
396
394
|
}
|
|
397
395
|
.fab.fab--safe-area {
|
|
398
|
-
bottom: calc(var(--fab-bottom, 24px) + env(safe-area-inset-bottom, 0px));
|
|
396
|
+
bottom: calc(var(--internal-fab-bottom, 24px) + env(safe-area-inset-bottom, 0px));
|
|
399
397
|
}
|
|
400
398
|
.fab > * {
|
|
401
399
|
z-index: 1;
|
|
@@ -5,7 +5,6 @@ import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, Pointer
|
|
|
5
5
|
import type { ButtonVariant, FabPosition } from '../types/propOptions';
|
|
6
6
|
export type FabProps = {
|
|
7
7
|
children?: Snippet;
|
|
8
|
-
buttonAttributes?: HTMLButtonAttributes | undefined;
|
|
9
8
|
type?: HTMLButtonAttributes['type'];
|
|
10
9
|
customStyle?: HTMLButtonAttributes['style'];
|
|
11
10
|
disabled?: boolean;
|
|
@@ -259,6 +259,7 @@
|
|
|
259
259
|
// $derived
|
|
260
260
|
// =========================================================================
|
|
261
261
|
const widthStyle = $derived(getStyleFromNumber(width) || '100%');
|
|
262
|
+
const heightStyle = $derived(getStyleFromNumber(height));
|
|
262
263
|
</script>
|
|
263
264
|
|
|
264
265
|
<button
|
|
@@ -266,10 +267,8 @@
|
|
|
266
267
|
class="file-uploader"
|
|
267
268
|
class:file-uploader--hover={isHover}
|
|
268
269
|
class:rounded
|
|
269
|
-
style=
|
|
270
|
-
|
|
271
|
-
--svelte-ui-file-uploader-height: {height}px
|
|
272
|
-
"
|
|
270
|
+
style:--internal-file-uploader-width={widthStyle}
|
|
271
|
+
style:--internal-file-uploader-height={heightStyle}
|
|
273
272
|
data-testid="file-uploader"
|
|
274
273
|
onclick={handleClick}
|
|
275
274
|
onfocus={handleFocus}
|
|
@@ -380,8 +379,14 @@
|
|
|
380
379
|
align-items: center;
|
|
381
380
|
gap: 16px;
|
|
382
381
|
position: relative;
|
|
383
|
-
width: var(
|
|
384
|
-
|
|
382
|
+
width: var(
|
|
383
|
+
--internal-file-uploader-width,
|
|
384
|
+
var(--svelte-ui-file-uploader-width, 100%)
|
|
385
|
+
);
|
|
386
|
+
height: var(
|
|
387
|
+
--internal-file-uploader-height,
|
|
388
|
+
var(--svelte-ui-file-uploader-height, auto)
|
|
389
|
+
);
|
|
385
390
|
min-height: 100px;
|
|
386
391
|
padding: 16px;
|
|
387
392
|
background-color: var(--svelte-ui-file-uploader-bg);
|
|
@@ -76,24 +76,24 @@
|
|
|
76
76
|
`'FILL' ${filled ? 1 : 0}, 'wght' ${weight}, 'GRAD' ${grade}, 'opsz' ${opticalSize}`
|
|
77
77
|
);
|
|
78
78
|
|
|
79
|
+
const sizeStyle = $derived(getStyleFromNumber(size));
|
|
80
|
+
const colorStyle = $derived(color || undefined);
|
|
81
|
+
|
|
79
82
|
const ariaAttributes = $derived({
|
|
80
83
|
'aria-hidden': decorative && !ariaLabel ? true : undefined,
|
|
81
84
|
'aria-label': ariaLabel || undefined,
|
|
82
85
|
role: !decorative && ariaLabel ? 'img' : undefined
|
|
83
86
|
});
|
|
84
|
-
|
|
85
|
-
const iconStyle = $derived.by(() => {
|
|
86
|
-
const sizeStyle = getStyleFromNumber(size);
|
|
87
|
-
return `width: ${sizeStyle}; height: ${sizeStyle}; font-size: ${sizeStyle};
|
|
88
|
-
color: ${color};
|
|
89
|
-
font-variation-settings: ${fontVariationSettings};
|
|
90
|
-
${customStyle}`;
|
|
91
|
-
});
|
|
92
87
|
</script>
|
|
93
88
|
|
|
94
89
|
<i
|
|
95
90
|
class={iconClasses}
|
|
96
|
-
style={
|
|
91
|
+
style:width={sizeStyle}
|
|
92
|
+
style:height={sizeStyle}
|
|
93
|
+
style:font-size={sizeStyle}
|
|
94
|
+
style:color={colorStyle}
|
|
95
|
+
style:font-variation-settings={fontVariationSettings}
|
|
96
|
+
style={customStyle}
|
|
97
97
|
{title}
|
|
98
98
|
{...ariaAttributes}
|
|
99
99
|
{...restProps}
|
|
@@ -106,6 +106,8 @@
|
|
|
106
106
|
<!-- Unicode文字での代替表示 -->
|
|
107
107
|
<span
|
|
108
108
|
class="icon-fallback-text"
|
|
109
|
+
style:font-size={sizeStyle}
|
|
110
|
+
style:color={colorStyle}
|
|
109
111
|
style={customStyle}
|
|
110
112
|
{...ariaAttributes}
|
|
111
113
|
{...restProps}
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
children: Snippet;
|
|
25
25
|
|
|
26
26
|
// HTML属性系
|
|
27
|
-
buttonAttributes?: HTMLButtonAttributes | undefined;
|
|
28
27
|
type?: 'button' | 'submit' | 'reset' | null | undefined;
|
|
29
28
|
tabindex?: number | null;
|
|
30
29
|
|
|
@@ -104,7 +103,6 @@
|
|
|
104
103
|
children,
|
|
105
104
|
|
|
106
105
|
// HTML属性系
|
|
107
|
-
buttonAttributes,
|
|
108
106
|
type = 'button',
|
|
109
107
|
tabindex = null,
|
|
110
108
|
|
|
@@ -373,7 +371,6 @@
|
|
|
373
371
|
aria-pressed={ariaPressed !== undefined ? ariaPressed : pressed ? 'true' : undefined}
|
|
374
372
|
aria-busy={loading ? 'true' : undefined}
|
|
375
373
|
data-testid="icon-button"
|
|
376
|
-
{...buttonAttributes}
|
|
377
374
|
{...restProps}
|
|
378
375
|
>
|
|
379
376
|
{#if loading}
|
|
@@ -5,7 +5,6 @@ import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, Pointer
|
|
|
5
5
|
import type { ButtonVariant, BadgeVariant } from '../types/propOptions';
|
|
6
6
|
export type IconButtonProps = {
|
|
7
7
|
children: Snippet;
|
|
8
|
-
buttonAttributes?: HTMLButtonAttributes | undefined;
|
|
9
8
|
type?: 'button' | 'submit' | 'reset' | null | undefined;
|
|
10
9
|
tabindex?: number | null;
|
|
11
10
|
customStyle?: HTMLButtonAttributes['style'];
|
|
@@ -337,10 +337,8 @@
|
|
|
337
337
|
class:image-uploader--multiple={multiple}
|
|
338
338
|
class:image-uploader--rounded={rounded}
|
|
339
339
|
class:image-uploader--adaptive={previewAdaptive}
|
|
340
|
-
style=
|
|
341
|
-
|
|
342
|
-
--svelte-ui-image-uploader-button-height: {previewHeightStyle};
|
|
343
|
-
"
|
|
340
|
+
style:--internal-image-uploader-button-width={previewWidthStyle}
|
|
341
|
+
style:--internal-image-uploader-button-height={previewHeightStyle}
|
|
344
342
|
data-testid="image-uploader"
|
|
345
343
|
>
|
|
346
344
|
{#if multiple}
|
|
@@ -446,8 +444,14 @@
|
|
|
446
444
|
align-items: center;
|
|
447
445
|
position: relative;
|
|
448
446
|
max-width: 100%;
|
|
449
|
-
min-width: var(
|
|
450
|
-
|
|
447
|
+
min-width: var(
|
|
448
|
+
--internal-image-uploader-button-width,
|
|
449
|
+
var(--svelte-ui-image-uploader-button-width)
|
|
450
|
+
);
|
|
451
|
+
min-height: var(
|
|
452
|
+
--internal-image-uploader-button-height,
|
|
453
|
+
var(--svelte-ui-image-uploader-button-height)
|
|
454
|
+
);
|
|
451
455
|
padding: 16px;
|
|
452
456
|
background-color: var(--svelte-ui-form-bg);
|
|
453
457
|
border-radius: var(--svelte-ui-border-radius);
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import IconButton from './IconButton.svelte';
|
|
5
5
|
import Icon from './Icon.svelte';
|
|
6
6
|
import { getStyleFromNumber } from '../utils/style';
|
|
7
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
8
7
|
import type { IconVariant, IconWeight, IconGrade, IconOpticalSize } from '../types/icon';
|
|
9
8
|
import { t } from '../i18n';
|
|
10
9
|
import { convertToHtml, convertToHtmlWithLink } from '../utils/formatText';
|
|
@@ -39,8 +38,6 @@
|
|
|
39
38
|
enableThousandsSeparator?: boolean;
|
|
40
39
|
autocomplete?: HTMLInputElement['autocomplete'] | null;
|
|
41
40
|
spellcheck?: boolean | null;
|
|
42
|
-
inputAttributes?: HTMLInputAttributes | undefined;
|
|
43
|
-
|
|
44
41
|
// スタイル/レイアウト
|
|
45
42
|
inline?: boolean;
|
|
46
43
|
focusStyle?: FocusStyle;
|
|
@@ -149,7 +146,6 @@
|
|
|
149
146
|
enableThousandsSeparator = false,
|
|
150
147
|
autocomplete = null,
|
|
151
148
|
spellcheck = null,
|
|
152
|
-
inputAttributes,
|
|
153
149
|
|
|
154
150
|
// スタイル/レイアウト
|
|
155
151
|
inline = false,
|
|
@@ -672,7 +668,9 @@
|
|
|
672
668
|
class:input--readonly={readonly}
|
|
673
669
|
class:input--focused={isFocused}
|
|
674
670
|
data-testid="input"
|
|
675
|
-
style=
|
|
671
|
+
style:width={widthStyle}
|
|
672
|
+
style:max-width={maxWidthStyle}
|
|
673
|
+
style:min-width={minWidthStyle}
|
|
676
674
|
>
|
|
677
675
|
<!-- 表示用テキスト -->
|
|
678
676
|
<div class="input__display-text" style={customStyle}>
|
|
@@ -736,7 +734,6 @@
|
|
|
736
734
|
onpointercancel={handlePointerCancel}
|
|
737
735
|
oncompositionstart={handleCompositionStart}
|
|
738
736
|
oncompositionend={handleCompositionEnd}
|
|
739
|
-
{...inputAttributes}
|
|
740
737
|
{...restProps}
|
|
741
738
|
/>
|
|
742
739
|
</div>
|
|
@@ -887,7 +884,6 @@
|
|
|
887
884
|
text-align: inherit;
|
|
888
885
|
|
|
889
886
|
&[type='number'] {
|
|
890
|
-
text-align: right;
|
|
891
887
|
&::-webkit-outer-spin-button,
|
|
892
888
|
&::-webkit-inner-spin-button {
|
|
893
889
|
-webkit-appearance: none;
|
|
@@ -916,10 +912,15 @@
|
|
|
916
912
|
transition: none;
|
|
917
913
|
}
|
|
918
914
|
|
|
915
|
+
.input__display-text-content {
|
|
916
|
+
width: 100%;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
919
|
.input__link-text {
|
|
920
920
|
position: absolute;
|
|
921
921
|
top: 0;
|
|
922
922
|
left: 0;
|
|
923
|
+
width: 100%;
|
|
923
924
|
height: 100%;
|
|
924
925
|
pointer-events: none;
|
|
925
926
|
z-index: 1;
|
|
@@ -1127,13 +1128,6 @@
|
|
|
1127
1128
|
/* =============================================
|
|
1128
1129
|
* タイプ別スタイル
|
|
1129
1130
|
* ============================================= */
|
|
1130
|
-
/* type-number */
|
|
1131
|
-
.input--type-number {
|
|
1132
|
-
.input__display-text {
|
|
1133
|
-
justify-content: flex-end;
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
1131
|
/* type-password: セキュリティのため常にinputを表示(display-textは非表示) */
|
|
1138
1132
|
.input--type-password {
|
|
1139
1133
|
/* inputを常に表示(表示制御の非フォーカス時の不可視化を上書き) */
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
1
|
import type { IconVariant, IconWeight, IconGrade, IconOpticalSize } from '../types/icon';
|
|
3
2
|
import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler, BivariantValueHandler } from '../types/callbackHandlers';
|
|
4
3
|
import type { FocusStyle } from '../types/propOptions';
|
|
@@ -17,7 +16,6 @@ export type InputProps = {
|
|
|
17
16
|
enableThousandsSeparator?: boolean;
|
|
18
17
|
autocomplete?: HTMLInputElement['autocomplete'] | null;
|
|
19
18
|
spellcheck?: boolean | null;
|
|
20
|
-
inputAttributes?: HTMLInputAttributes | undefined;
|
|
21
19
|
inline?: boolean;
|
|
22
20
|
focusStyle?: FocusStyle;
|
|
23
21
|
placeholder?: string;
|