cclkit4svelte 1.2.7 → 2.0.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/README.md +9 -9
- package/dist/Alert.svelte +96 -0
- package/dist/Alert.svelte.d.ts +37 -0
- package/dist/Button.svelte +8 -1
- package/dist/Button.svelte.d.ts +10 -0
- package/dist/Card.svelte +1 -2
- package/dist/Carousel.svelte +2 -4
- package/dist/Checkbox.svelte +88 -0
- package/dist/Checkbox.svelte.d.ts +40 -0
- package/dist/DatePicker.svelte +162 -0
- package/dist/DatePicker.svelte.d.ts +44 -0
- package/dist/FormGroup.svelte +53 -0
- package/dist/FormGroup.svelte.d.ts +37 -0
- package/dist/Input.svelte +107 -0
- package/dist/Input.svelte.d.ts +61 -0
- package/dist/ProgressBar.svelte +52 -0
- package/dist/ProgressBar.svelte.d.ts +24 -0
- package/dist/RadioButton.svelte +70 -0
- package/dist/RadioButton.svelte.d.ts +39 -0
- package/dist/Select.svelte +65 -0
- package/dist/Select.svelte.d.ts +48 -0
- package/dist/Spinner.svelte +31 -0
- package/dist/Spinner.svelte.d.ts +18 -0
- package/dist/Table.svelte +1 -2
- package/dist/Textarea.svelte +60 -0
- package/dist/Textarea.svelte.d.ts +56 -0
- package/dist/Toggle.svelte +76 -0
- package/dist/Toggle.svelte.d.ts +35 -0
- package/dist/Tooltip.svelte +130 -0
- package/dist/Tooltip.svelte.d.ts +21 -0
- package/dist/const/config.d.ts +11 -6
- package/dist/const/config.js +21 -3
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/scripts/date.js +1 -1
- package/package.json +8 -7
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<script>import "./const/variables.css";
|
|
2
|
+
import { CCLVividColor } from "./const/config";
|
|
3
|
+
export let type = "text";
|
|
4
|
+
export let label = "";
|
|
5
|
+
export let value = "";
|
|
6
|
+
export let placeholder = "";
|
|
7
|
+
export let borderColor = CCLVividColor.STRAWBERRY_PINK;
|
|
8
|
+
export let disabled = false;
|
|
9
|
+
export let id = "ccl-input";
|
|
10
|
+
export let validationMessage = "";
|
|
11
|
+
export let isValid = true;
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div class="input-wrapper">
|
|
15
|
+
{#if label}
|
|
16
|
+
<label for={id} class="input-label">{label}</label>
|
|
17
|
+
{/if}
|
|
18
|
+
{#if type === 'text'}
|
|
19
|
+
<input
|
|
20
|
+
{id}
|
|
21
|
+
type="text"
|
|
22
|
+
bind:value
|
|
23
|
+
{placeholder}
|
|
24
|
+
{disabled}
|
|
25
|
+
class="input-field"
|
|
26
|
+
class:invalid={!isValid}
|
|
27
|
+
style="--border-color: var({borderColor})"
|
|
28
|
+
/>
|
|
29
|
+
{:else if type === 'password'}
|
|
30
|
+
<input
|
|
31
|
+
{id}
|
|
32
|
+
type="password"
|
|
33
|
+
bind:value
|
|
34
|
+
{placeholder}
|
|
35
|
+
{disabled}
|
|
36
|
+
class="input-field"
|
|
37
|
+
class:invalid={!isValid}
|
|
38
|
+
style="--border-color: var({borderColor})"
|
|
39
|
+
/>
|
|
40
|
+
{:else if type === 'email'}
|
|
41
|
+
<input
|
|
42
|
+
{id}
|
|
43
|
+
type="email"
|
|
44
|
+
bind:value
|
|
45
|
+
{placeholder}
|
|
46
|
+
{disabled}
|
|
47
|
+
class="input-field"
|
|
48
|
+
class:invalid={!isValid}
|
|
49
|
+
style="--border-color: var({borderColor})"
|
|
50
|
+
/>
|
|
51
|
+
{:else if type === 'number'}
|
|
52
|
+
<input
|
|
53
|
+
{id}
|
|
54
|
+
type="number"
|
|
55
|
+
bind:value
|
|
56
|
+
{placeholder}
|
|
57
|
+
{disabled}
|
|
58
|
+
class="input-field"
|
|
59
|
+
class:invalid={!isValid}
|
|
60
|
+
style="--border-color: var({borderColor})"
|
|
61
|
+
/>
|
|
62
|
+
{/if}
|
|
63
|
+
{#if !isValid && validationMessage}
|
|
64
|
+
<span class="validation-message">{validationMessage}</span>
|
|
65
|
+
{/if}
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<style>
|
|
69
|
+
.input-wrapper {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
gap: 8px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.input-label {
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
color: var(--wrap-grey);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.input-field {
|
|
81
|
+
padding: 10px 15px;
|
|
82
|
+
border-radius: 8px;
|
|
83
|
+
border: 2px solid var(--border-color);
|
|
84
|
+
font-size: 16px;
|
|
85
|
+
outline: none;
|
|
86
|
+
transition: border-color 0.2s;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.input-field:focus {
|
|
90
|
+
border-color: var(--ccl-focus-color, var(--soda-blue)); /* フォーカス時の色を定義 */
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.input-field:disabled {
|
|
94
|
+
background-color: var(--cloud-grey);
|
|
95
|
+
cursor: not-allowed;
|
|
96
|
+
border-color: var(--cloud-grey);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.input-field.invalid {
|
|
100
|
+
border-color: var(--ccl-error-color, var(--strawberry-pink));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.validation-message {
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
color: var(--ccl-error-color, var(--strawberry-pink));
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import './const/variables.css';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
/**
|
|
6
|
+
* 入力フィールドのタイプ
|
|
7
|
+
* @default 'text'
|
|
8
|
+
* @type {'text' | 'password' | 'email' | 'number'}
|
|
9
|
+
*/ type?: "text" | "password" | "email" | "number";
|
|
10
|
+
/**
|
|
11
|
+
* ラベルのテキスト
|
|
12
|
+
* @default ''
|
|
13
|
+
* @type string
|
|
14
|
+
*/ label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 入力値
|
|
17
|
+
* @default ''
|
|
18
|
+
* @type string
|
|
19
|
+
*/ value?: string;
|
|
20
|
+
/**
|
|
21
|
+
* プレースホルダーのテキスト
|
|
22
|
+
* @default ''
|
|
23
|
+
* @type string
|
|
24
|
+
*/ placeholder?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 枠線の色
|
|
27
|
+
* @default --strawberry-pink
|
|
28
|
+
* @type string
|
|
29
|
+
*/ borderColor?: string;
|
|
30
|
+
/**
|
|
31
|
+
* 非活性状態にするか
|
|
32
|
+
* @default false
|
|
33
|
+
* @type boolean
|
|
34
|
+
*/ disabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* コンポーネントのID
|
|
37
|
+
* @default 'ccl-input'
|
|
38
|
+
* @type string
|
|
39
|
+
*/ id?: string;
|
|
40
|
+
/**
|
|
41
|
+
* バリデーションメッセージ
|
|
42
|
+
* @default ''
|
|
43
|
+
* @type string
|
|
44
|
+
*/ validationMessage?: string;
|
|
45
|
+
/**
|
|
46
|
+
* バリデーションの状態
|
|
47
|
+
* @default true
|
|
48
|
+
* @type boolean
|
|
49
|
+
*/ isValid?: boolean;
|
|
50
|
+
};
|
|
51
|
+
events: {
|
|
52
|
+
[evt: string]: CustomEvent<any>;
|
|
53
|
+
};
|
|
54
|
+
slots: {};
|
|
55
|
+
};
|
|
56
|
+
export type InputProps = typeof __propDef.props;
|
|
57
|
+
export type InputEvents = typeof __propDef.events;
|
|
58
|
+
export type InputSlots = typeof __propDef.slots;
|
|
59
|
+
export default class Input extends SvelteComponentTyped<InputProps, InputEvents, InputSlots> {
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script>import { CCLVividColor, ProgressBarHeight } from "./const/config";
|
|
2
|
+
export let value = 0;
|
|
3
|
+
export let maxValue = 100;
|
|
4
|
+
export let barColor = CCLVividColor.SODA_BLUE;
|
|
5
|
+
export let backgroundColor = "#e0e0e0";
|
|
6
|
+
export let height = ProgressBarHeight.DEFAULT;
|
|
7
|
+
export let containerWidth = "100%";
|
|
8
|
+
export let isSticky = false;
|
|
9
|
+
export let isRounded = true;
|
|
10
|
+
$: progress = value / maxValue * 100;
|
|
11
|
+
$: finalBarColor = barColor.startsWith("--") ? `var(${barColor})` : barColor;
|
|
12
|
+
$: finalBackgroundColor = backgroundColor.startsWith("--") ? `var(${backgroundColor})` : backgroundColor;
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div
|
|
16
|
+
class="progress-bar-container"
|
|
17
|
+
class:sticky={isSticky}
|
|
18
|
+
class:rounded={isRounded}
|
|
19
|
+
style="background-color: {finalBackgroundColor}; width: {containerWidth}; height: {height};"
|
|
20
|
+
role="progressbar"
|
|
21
|
+
aria-valuenow={value}
|
|
22
|
+
aria-valuemin="0"
|
|
23
|
+
aria-valuemax={maxValue}
|
|
24
|
+
>
|
|
25
|
+
<div class="progress-bar" style="width: {progress}%; background-color: {finalBarColor};"></div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.progress-bar-container {
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.progress-bar-container.sticky {
|
|
35
|
+
position: fixed;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
z-index: 9999;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.progress-bar-container.rounded {
|
|
42
|
+
border-radius: 10px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.progress-bar {
|
|
46
|
+
height: 100%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.progress-bar-container.rounded .progress-bar {
|
|
50
|
+
border-radius: 10px;
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { ProgressBarHeight } from './const/config';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
value?: number;
|
|
6
|
+
maxValue?: number;
|
|
7
|
+
barColor?: string;
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
height?: ProgressBarHeight;
|
|
10
|
+
containerWidth?: string;
|
|
11
|
+
isSticky?: boolean;
|
|
12
|
+
isRounded?: boolean;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {};
|
|
18
|
+
};
|
|
19
|
+
export type ProgressBarProps = typeof __propDef.props;
|
|
20
|
+
export type ProgressBarEvents = typeof __propDef.events;
|
|
21
|
+
export type ProgressBarSlots = typeof __propDef.slots;
|
|
22
|
+
export default class ProgressBar extends SvelteComponentTyped<ProgressBarProps, ProgressBarEvents, ProgressBarSlots> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script>import "./const/variables.css";
|
|
2
|
+
import { CCLVividColor } from "./const/config";
|
|
3
|
+
export let value;
|
|
4
|
+
export let group;
|
|
5
|
+
export let label = "";
|
|
6
|
+
export let color = CCLVividColor.SODA_BLUE;
|
|
7
|
+
export let disabled = false;
|
|
8
|
+
let circleColor = "white";
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<label class="radioWrapper" class:disabled={disabled}>
|
|
12
|
+
<input type="radio" bind:group {value} {disabled} aria-label={label} />
|
|
13
|
+
<span class="customRadio" style="--bg-color: var({color});">
|
|
14
|
+
{#if group === value}
|
|
15
|
+
<span class="innerCircle" style="--circle-color: {circleColor};" />
|
|
16
|
+
{/if}
|
|
17
|
+
</span>
|
|
18
|
+
{#if label}
|
|
19
|
+
<span class="label">{label}</span>
|
|
20
|
+
{/if}
|
|
21
|
+
</label>
|
|
22
|
+
|
|
23
|
+
<style>
|
|
24
|
+
.radioWrapper {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
margin-bottom: 8px;
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
.radioWrapper.disabled {
|
|
32
|
+
cursor: not-allowed;
|
|
33
|
+
opacity: 0.6;
|
|
34
|
+
}
|
|
35
|
+
.radioWrapper input[type='radio'] {
|
|
36
|
+
border: 0;
|
|
37
|
+
clip: rect(0 0 0 0);
|
|
38
|
+
clip-path: inset(50%);
|
|
39
|
+
height: 1px;
|
|
40
|
+
margin: -1px;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
padding: 0;
|
|
43
|
+
position: absolute;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
width: 1px;
|
|
46
|
+
}
|
|
47
|
+
.customRadio {
|
|
48
|
+
width: 20px;
|
|
49
|
+
height: 20px;
|
|
50
|
+
border: 2px solid var(--bg-color);
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
align-items: center;
|
|
55
|
+
transition: background-color 0.2s;
|
|
56
|
+
}
|
|
57
|
+
.radioWrapper input[type='radio']:checked + .customRadio {
|
|
58
|
+
background-color: var(--bg-color);
|
|
59
|
+
}
|
|
60
|
+
.innerCircle {
|
|
61
|
+
width: 10px;
|
|
62
|
+
height: 10px;
|
|
63
|
+
background-color: var(--circle-color);
|
|
64
|
+
border-radius: 50%;
|
|
65
|
+
}
|
|
66
|
+
.label {
|
|
67
|
+
margin-left: 8px;
|
|
68
|
+
font-size: 16px;
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import './const/variables.css';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
/**
|
|
6
|
+
* ラジオボタンの選択値
|
|
7
|
+
* @type {any}
|
|
8
|
+
*/ value: any;
|
|
9
|
+
/**
|
|
10
|
+
* どのラジオボタンが選択されているかを保持する変数
|
|
11
|
+
* @type {any}
|
|
12
|
+
*/ group: any;
|
|
13
|
+
/**
|
|
14
|
+
* ラジオボタンのラベル
|
|
15
|
+
* @default ''
|
|
16
|
+
* @type string
|
|
17
|
+
*/ label?: string;
|
|
18
|
+
/**
|
|
19
|
+
* ラジオボタンの色
|
|
20
|
+
* @default CCLVividColor.SODA_BLUE
|
|
21
|
+
* @type string
|
|
22
|
+
*/ color?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 非活性状態
|
|
25
|
+
* @default false
|
|
26
|
+
* @type boolean
|
|
27
|
+
*/ disabled?: boolean;
|
|
28
|
+
};
|
|
29
|
+
events: {
|
|
30
|
+
[evt: string]: CustomEvent<any>;
|
|
31
|
+
};
|
|
32
|
+
slots: {};
|
|
33
|
+
};
|
|
34
|
+
export type RadioButtonProps = typeof __propDef.props;
|
|
35
|
+
export type RadioButtonEvents = typeof __propDef.events;
|
|
36
|
+
export type RadioButtonSlots = typeof __propDef.slots;
|
|
37
|
+
export default class RadioButton extends SvelteComponentTyped<RadioButtonProps, RadioButtonEvents, RadioButtonSlots> {
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script>import "./const/variables.css";
|
|
2
|
+
import { CCLVividColor } from "./const/config";
|
|
3
|
+
export let label = "";
|
|
4
|
+
export let options = [];
|
|
5
|
+
export let value = "";
|
|
6
|
+
export let borderColor = CCLVividColor.STRAWBERRY_PINK;
|
|
7
|
+
export let disabled = false;
|
|
8
|
+
export let id = "ccl-select";
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="select-wrapper">
|
|
12
|
+
{#if label}
|
|
13
|
+
<label for={id} class="select-label">{label}</label>
|
|
14
|
+
{/if}
|
|
15
|
+
<select
|
|
16
|
+
{id}
|
|
17
|
+
bind:value
|
|
18
|
+
{disabled}
|
|
19
|
+
class="select-field"
|
|
20
|
+
style="--border-color: var({borderColor})"
|
|
21
|
+
>
|
|
22
|
+
{#each options as option}
|
|
23
|
+
<option value={option.value}>{option.label}</option>
|
|
24
|
+
{/each}
|
|
25
|
+
</select>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.select-wrapper {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: 8px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.select-label {
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
color: var(--wrap-grey);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.select-field {
|
|
41
|
+
padding: 10px 15px;
|
|
42
|
+
border-radius: 8px;
|
|
43
|
+
border: 2px solid var(--border-color);
|
|
44
|
+
font-size: 16px;
|
|
45
|
+
outline: none;
|
|
46
|
+
transition: border-color 0.2s;
|
|
47
|
+
background-color: white; /* 背景色を白に設定 */
|
|
48
|
+
appearance: none; /* デフォルトの矢印を非表示 */
|
|
49
|
+
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M287%2069.4L146.2%20208.6%205.4%2069.4h281.6z%22%2F%3E%3C%2Fsvg%3E'); /* カスタム矢印 */
|
|
50
|
+
background-repeat: no-repeat;
|
|
51
|
+
background-position: right 10px center;
|
|
52
|
+
background-size: 12px;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.select-field:focus {
|
|
57
|
+
border-color: var(--ccl-focus-color, var(--soda-blue)); /* フォーカス時の色を定義 */
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.select-field:disabled {
|
|
61
|
+
background-color: var(--cloud-grey);
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
border-color: var(--cloud-grey);
|
|
64
|
+
}
|
|
65
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import './const/variables.css';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
/**
|
|
6
|
+
* ラベルのテキスト
|
|
7
|
+
* @default ''
|
|
8
|
+
* @type string
|
|
9
|
+
*/ label?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 選択肢のリスト
|
|
12
|
+
* @type SelectOption[]
|
|
13
|
+
*/ options?: {
|
|
14
|
+
value: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}[];
|
|
17
|
+
/**
|
|
18
|
+
* 選択された値
|
|
19
|
+
* @default ''
|
|
20
|
+
* @type string
|
|
21
|
+
*/ value?: string;
|
|
22
|
+
/**
|
|
23
|
+
* 枠線の色
|
|
24
|
+
* @default --strawberry-pink
|
|
25
|
+
* @type string
|
|
26
|
+
*/ borderColor?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 非活性状態にするか
|
|
29
|
+
* @default false
|
|
30
|
+
* @type boolean
|
|
31
|
+
*/ disabled?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* コンポーネントのID
|
|
34
|
+
* @default 'ccl-select'
|
|
35
|
+
* @type string
|
|
36
|
+
*/ id?: string;
|
|
37
|
+
};
|
|
38
|
+
events: {
|
|
39
|
+
[evt: string]: CustomEvent<any>;
|
|
40
|
+
};
|
|
41
|
+
slots: {};
|
|
42
|
+
};
|
|
43
|
+
export type SelectProps = typeof __propDef.props;
|
|
44
|
+
export type SelectEvents = typeof __propDef.events;
|
|
45
|
+
export type SelectSlots = typeof __propDef.slots;
|
|
46
|
+
export default class Select extends SvelteComponentTyped<SelectProps, SelectEvents, SelectSlots> {
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script>import { CCLVividColor } from "./const/config";
|
|
2
|
+
export let size = "40px";
|
|
3
|
+
export let color = CCLVividColor.STRAWBERRY_PINK;
|
|
4
|
+
export let borderWidth = "4px";
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div
|
|
8
|
+
class="spinner"
|
|
9
|
+
style="width: {size}; height: {size}; border-width: {borderWidth}; --spinner-color: var({color});"
|
|
10
|
+
role="status"
|
|
11
|
+
></div>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
.spinner {
|
|
15
|
+
display: inline-block;
|
|
16
|
+
border-radius: 50%;
|
|
17
|
+
border-style: solid;
|
|
18
|
+
border-color: #f3f3f3;
|
|
19
|
+
border-top-color: var(--spinner-color);
|
|
20
|
+
animation: spin 1s linear infinite;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes spin {
|
|
24
|
+
0% {
|
|
25
|
+
transform: rotate(0deg);
|
|
26
|
+
}
|
|
27
|
+
100% {
|
|
28
|
+
transform: rotate(360deg);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
size?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
borderWidth?: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export type SpinnerProps = typeof __propDef.props;
|
|
14
|
+
export type SpinnerEvents = typeof __propDef.events;
|
|
15
|
+
export type SpinnerSlots = typeof __propDef.slots;
|
|
16
|
+
export default class Spinner extends SvelteComponentTyped<SpinnerProps, SpinnerEvents, SpinnerSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
package/dist/Table.svelte
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script>import "./const/variables.css";
|
|
2
|
+
import { CCLVividColor } from "./const/config";
|
|
3
|
+
export let label = "";
|
|
4
|
+
export let value = "";
|
|
5
|
+
export let placeholder = "";
|
|
6
|
+
export let borderColor = CCLVividColor.STRAWBERRY_PINK;
|
|
7
|
+
export let disabled = false;
|
|
8
|
+
export let id = "ccl-textarea";
|
|
9
|
+
export let rows = 5;
|
|
10
|
+
export let cols = 20;
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div class="textarea-wrapper">
|
|
14
|
+
{#if label}
|
|
15
|
+
<label for={id} class="textarea-label">{label}</label>
|
|
16
|
+
{/if}
|
|
17
|
+
<textarea
|
|
18
|
+
{id}
|
|
19
|
+
bind:value
|
|
20
|
+
{placeholder}
|
|
21
|
+
{disabled}
|
|
22
|
+
{rows}
|
|
23
|
+
{cols}
|
|
24
|
+
class="textarea-field"
|
|
25
|
+
style="--border-color: var({borderColor})"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<style>
|
|
30
|
+
.textarea-wrapper {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
gap: 8px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.textarea-label {
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
color: var(--wrap-grey);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.textarea-field {
|
|
42
|
+
padding: 10px 15px;
|
|
43
|
+
border-radius: 8px;
|
|
44
|
+
border: 2px solid var(--border-color);
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
outline: none;
|
|
47
|
+
transition: border-color 0.2s;
|
|
48
|
+
resize: vertical; /* 垂直方向のみリサイズ可能 */
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.textarea-field:focus {
|
|
52
|
+
border-color: var(--ccl-focus-color, var(--soda-blue)); /* フォーカス時の色を定義 */
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.textarea-field:disabled {
|
|
56
|
+
background-color: var(--cloud-grey);
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
border-color: var(--cloud-grey);
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import './const/variables.css';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
/**
|
|
6
|
+
* ラベルのテキスト
|
|
7
|
+
* @default ''
|
|
8
|
+
* @type string
|
|
9
|
+
*/ label?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 入力値
|
|
12
|
+
* @default ''
|
|
13
|
+
* @type string
|
|
14
|
+
*/ value?: string;
|
|
15
|
+
/**
|
|
16
|
+
* プレースホルダーのテキスト
|
|
17
|
+
* @default ''
|
|
18
|
+
* @type string
|
|
19
|
+
*/ placeholder?: string;
|
|
20
|
+
/**
|
|
21
|
+
* 枠線の色
|
|
22
|
+
* @default --strawberry-pink
|
|
23
|
+
* @type string
|
|
24
|
+
*/ borderColor?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 非活性状態にするか
|
|
27
|
+
* @default false
|
|
28
|
+
* @type boolean
|
|
29
|
+
*/ disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* コンポーネントのID
|
|
32
|
+
* @default 'ccl-textarea'
|
|
33
|
+
* @type string
|
|
34
|
+
*/ id?: string;
|
|
35
|
+
/**
|
|
36
|
+
* 行数
|
|
37
|
+
* @default 5
|
|
38
|
+
* @type number
|
|
39
|
+
*/ rows?: number;
|
|
40
|
+
/**
|
|
41
|
+
* 列数
|
|
42
|
+
* @default 20
|
|
43
|
+
* @type number
|
|
44
|
+
*/ cols?: number;
|
|
45
|
+
};
|
|
46
|
+
events: {
|
|
47
|
+
[evt: string]: CustomEvent<any>;
|
|
48
|
+
};
|
|
49
|
+
slots: {};
|
|
50
|
+
};
|
|
51
|
+
export type TextareaProps = typeof __propDef.props;
|
|
52
|
+
export type TextareaEvents = typeof __propDef.events;
|
|
53
|
+
export type TextareaSlots = typeof __propDef.slots;
|
|
54
|
+
export default class Textarea extends SvelteComponentTyped<TextareaProps, TextareaEvents, TextareaSlots> {
|
|
55
|
+
}
|
|
56
|
+
export {};
|