cclkit4svelte 1.2.6 → 2.0.0

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.
@@ -0,0 +1,37 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ /**
5
+ * フォーム要素のラベルテキスト
6
+ * @default ''
7
+ * @type string
8
+ */ label?: string;
9
+ /**
10
+ * ユーザーへの補足説明やヒント
11
+ * @default ''
12
+ * @type string
13
+ */ helpText?: string;
14
+ /**
15
+ * バリデーションエラーが発生した場合に表示するメッセージ
16
+ * @default ''
17
+ * @type string
18
+ */ errorMessage?: string;
19
+ /**
20
+ * ラベルと入力要素を関連付けるためのID
21
+ * @default ''
22
+ * @type string
23
+ */ forId?: string;
24
+ };
25
+ events: {
26
+ [evt: string]: CustomEvent<any>;
27
+ };
28
+ slots: {
29
+ default: {};
30
+ };
31
+ };
32
+ export type FormGroupProps = typeof __propDef.props;
33
+ export type FormGroupEvents = typeof __propDef.events;
34
+ export type FormGroupSlots = typeof __propDef.slots;
35
+ export default class FormGroup extends SvelteComponentTyped<FormGroupProps, FormGroupEvents, FormGroupSlots> {
36
+ }
37
+ export {};
@@ -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,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 {};
package/dist/Table.svelte CHANGED
@@ -22,8 +22,7 @@ function getBodyColor(tableColor2) {
22
22
  return CCLPastelColor.PEACH_PINK;
23
23
  }
24
24
  }
25
- $:
26
- bodyColor = getBodyColor(tableColor);
25
+ $: bodyColor = getBodyColor(tableColor);
27
26
  </script>
28
27
 
29
28
  <!--汎用テーブル-->
@@ -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 {};
@@ -0,0 +1,76 @@
1
+ <script>import "./const/variables.css";
2
+ import { CCLVividColor } from "./const/config";
3
+ export let checked = false;
4
+ export let color = CCLVividColor.SODA_BLUE;
5
+ export let disabled = false;
6
+ export let onChange = () => {
7
+ };
8
+ function handleChange(event) {
9
+ if (disabled) {
10
+ return;
11
+ }
12
+ const target = event.target;
13
+ checked = target.checked;
14
+ onChange();
15
+ }
16
+ </script>
17
+
18
+ <label class="switchWrapper" class:disabled={disabled}>
19
+ <input type="checkbox" {checked} on:change={handleChange} {disabled} />
20
+ <span class="slider" style="--bg-color: var({color});" />
21
+ </label>
22
+
23
+ <style>
24
+ .switchWrapper {
25
+ position: relative;
26
+ display: inline-block;
27
+ width: 50px;
28
+ height: 28px;
29
+ cursor: pointer;
30
+ }
31
+ .switchWrapper.disabled {
32
+ cursor: not-allowed;
33
+ opacity: 0.6;
34
+ }
35
+
36
+ .switchWrapper input {
37
+ opacity: 0;
38
+ width: 0;
39
+ height: 0;
40
+ }
41
+
42
+ .slider {
43
+ position: absolute;
44
+ top: 0;
45
+ left: 0;
46
+ right: 0;
47
+ bottom: 0;
48
+ background-color: #ccc;
49
+ transition: 0.4s;
50
+ border-radius: 28px;
51
+ }
52
+
53
+ .slider:before {
54
+ position: absolute;
55
+ content: '';
56
+ height: 20px;
57
+ width: 20px;
58
+ left: 4px;
59
+ bottom: 4px;
60
+ background-color: white;
61
+ transition: 0.4s;
62
+ border-radius: 50%;
63
+ }
64
+
65
+ input:checked + .slider {
66
+ background-color: var(--bg-color);
67
+ }
68
+
69
+ input:focus + .slider {
70
+ box-shadow: 0 0 1px var(--bg-color);
71
+ }
72
+
73
+ input:checked + .slider:before {
74
+ transform: translateX(22px);
75
+ }
76
+ </style>
@@ -0,0 +1,35 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import './const/variables.css';
3
+ declare const __propDef: {
4
+ props: {
5
+ /**
6
+ * トグルスイッチの状態
7
+ * @default false
8
+ * @type boolean
9
+ */ checked?: boolean;
10
+ /**
11
+ * トグルスイッチの色
12
+ * @default CCLVividColor.SODA_BLUE
13
+ * @type string
14
+ */ color?: string;
15
+ /**
16
+ * 非活性状態
17
+ * @default false
18
+ * @type boolean
19
+ */ disabled?: boolean;
20
+ /**
21
+ * 状態が変更されたときのイベントハンドラ
22
+ * @type {() => void}
23
+ */ onChange?: () => void;
24
+ };
25
+ events: {
26
+ [evt: string]: CustomEvent<any>;
27
+ };
28
+ slots: {};
29
+ };
30
+ export type ToggleProps = typeof __propDef.props;
31
+ export type ToggleEvents = typeof __propDef.events;
32
+ export type ToggleSlots = typeof __propDef.slots;
33
+ export default class Toggle extends SvelteComponentTyped<ToggleProps, ToggleEvents, ToggleSlots> {
34
+ }
35
+ export {};
@@ -1,4 +1,4 @@
1
- const CCLVividColor = {
1
+ var CCLVividColor = {
2
2
  STRAWBERRY_PINK: '--strawberry-pink',
3
3
  PINEAPPLE_YELLOW: '--pineapple-yellow',
4
4
  SODA_BLUE: '--soda-blue',
@@ -6,7 +6,7 @@ const CCLVividColor = {
6
6
  GRAPE_PURPLE: '--grape-purple',
7
7
  WRAP_GREY: '--wrap-grey'
8
8
  };
9
- const CCLPastelColor = {
9
+ var CCLPastelColor = {
10
10
  PEACH_PINK: '--peach-pink',
11
11
  LEMON_YELLOW: '--lemon-yellow',
12
12
  SUGAR_BLUE: '--sugar-blue',
@@ -14,7 +14,7 @@ const CCLPastelColor = {
14
14
  AKEBI_PURPLE: '--akebi-purple',
15
15
  CLOUD_GREY: '--cloud-grey'
16
16
  };
17
- const HeaderHeight = {
17
+ var HeaderHeight = {
18
18
  WIDE: '--hd-wide',
19
19
  NORMAL: '--hd-normal',
20
20
  NALLOW: '--hd-nallow'