iconograph-ui 1.7.13 → 1.7.15

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/index.js CHANGED
@@ -26,6 +26,7 @@ import ActionButton from "./lib/form/ActionButton.svelte";
26
26
  import MultiSelect from "./lib/form/MultiSelect.svelte";
27
27
  import PasswordInput from "./lib/inputs/PasswordInput.svelte";
28
28
  import SearchSelect from "./lib/inputs/SearchSelect.svelte"
29
+ import Checkbox from "./lib/form/Checkbox.svelte"
29
30
 
30
31
  export {
31
32
  Button,
@@ -33,6 +34,7 @@ export {
33
34
  Form,
34
35
  FlexForm,
35
36
  Input,
37
+ Checkbox,
36
38
  SegmentedSwitchInput,
37
39
  SexeChoiceInput,
38
40
  BodySection,
@@ -52,4 +52,33 @@
52
52
 
53
53
  </script>
54
54
 
55
- {formatDate(date, format)}
55
+ {#if style == 2}
56
+ <div class="indicator-wrapper">
57
+ <span>{formatDate(date, format)}</span>
58
+ </div>
59
+ {:else}
60
+ {formatDate(date, format)}
61
+ {/if}
62
+
63
+ <style>
64
+
65
+ .indicator-wrapper {
66
+ max-width: calc(100% - 16px);
67
+ display: flex;
68
+ justify-content: center;
69
+ align-items: center;
70
+ cursor: pointer;
71
+ height: 16px;
72
+ z-index: 12;
73
+ }
74
+ .indicator-wrapper > span{
75
+ font-weight: 600;
76
+ text-wrap: nowrap;
77
+ white-space: nowrap;
78
+ overflow: hidden;
79
+ text-overflow: ellipsis;
80
+ color: #555;
81
+ font-weight: 600;
82
+ font-size: 11px;
83
+ }
84
+ </style>
@@ -0,0 +1,106 @@
1
+ <script>
2
+ export let name;
3
+ export let type = "checkbox";
4
+ export let value = false;
5
+ export let options = [];
6
+ export let required = false;
7
+
8
+ // label from options[0] or fallback
9
+ $: label = options?.[0] ?? "Checkbox";
10
+
11
+ function toggle() {
12
+ value = !value;
13
+ }
14
+ </script>
15
+
16
+ <!-- Hidden real input for forms -->
17
+ <input
18
+ class="hidden-input"
19
+ {name}
20
+ {type}
21
+ bind:checked={value}
22
+ {required}
23
+ />
24
+
25
+ <!-- Styled wrapper -->
26
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
27
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
28
+ <div
29
+ class="checkbox-container {value ? 'checked' : ''}"
30
+ on:click={toggle}
31
+ >
32
+ <div class="box">
33
+ {#if value}
34
+
35
+ {/if}
36
+ </div>
37
+
38
+ <div class="checkbox-label">
39
+ {label}
40
+ </div>
41
+ </div>
42
+
43
+ <style>
44
+ .hidden-input {
45
+ display: none;
46
+ }
47
+
48
+ .checkbox-container {
49
+ display: inline-flex;
50
+ align-items: center;
51
+ gap: 10px;
52
+
53
+ background-color: var(--theme-input-bg-color, #ebebed);
54
+ height: var(--theme-input-height, 40px);
55
+
56
+ border: var(--theme-input-border, none);
57
+ border-radius: 50px;
58
+
59
+ padding: 0px 16px;
60
+ cursor: pointer;
61
+
62
+ transition: all 0.2s;
63
+ font-family: var(--theme-text-font);
64
+ }
65
+
66
+ /* Checkbox square */
67
+ .box {
68
+ width: 18px;
69
+ height: 18px;
70
+
71
+ border-radius: 6px;
72
+ border: 2px solid var(--theme-main-color);
73
+
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+
78
+ font-size: 13px;
79
+ font-weight: 700;
80
+
81
+ transition: all 0.2s;
82
+ color: white;
83
+ }
84
+
85
+ /* Label text */
86
+ .checkbox-label {
87
+ font-size: 14px;
88
+ line-height: 16px;
89
+ font-weight: 500;
90
+ color: var(--theme-input-text-font);
91
+ }
92
+
93
+ /* Checked state */
94
+ .checkbox-container.checked {
95
+ background: var(--theme-main-color);
96
+ }
97
+
98
+ .checkbox-container.checked .checkbox-label {
99
+ color: white;
100
+ }
101
+
102
+ .checkbox-container.checked .box {
103
+ background: white;
104
+ color: var(--theme-main-color);
105
+ }
106
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iconograph-ui",
3
- "version": "1.7.13",
3
+ "version": "1.7.15",
4
4
  "description": "A Svelte Kit components library",
5
5
  "main": "./index.js",
6
6
  "svelte": "./index.js",