hamzus-ui 0.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.
Files changed (73) hide show
  1. package/README.md +38 -0
  2. package/index.js +6 -0
  3. package/package.json +48 -0
  4. package/src/components/hamzus-ui/AdvancedTooltip/Content.svelte +22 -0
  5. package/src/components/hamzus-ui/AdvancedTooltip/Label.svelte +1 -0
  6. package/src/components/hamzus-ui/AdvancedTooltip/Root.svelte +336 -0
  7. package/src/components/hamzus-ui/AdvancedTooltip/Separator.svelte +12 -0
  8. package/src/components/hamzus-ui/AdvancedTooltip/Trigger.svelte +5 -0
  9. package/src/components/hamzus-ui/AdvancedTooltip/index.js +5 -0
  10. package/src/components/hamzus-ui/AlertCard/AlertCard.svelte +32 -0
  11. package/src/components/hamzus-ui/Avatar/Avatar.svelte +32 -0
  12. package/src/components/hamzus-ui/Button/Button.svelte +79 -0
  13. package/src/components/hamzus-ui/Button/Button_default.svelte +142 -0
  14. package/src/components/hamzus-ui/Button/Button_link.svelte +138 -0
  15. package/src/components/hamzus-ui/Checkboxes/Checkbox/Checkbox.svelte +41 -0
  16. package/src/components/hamzus-ui/Checkboxes/Checkbox/index.css +68 -0
  17. package/src/components/hamzus-ui/Checkboxes/CheckboxCard/CheckboxCard.svelte +27 -0
  18. package/src/components/hamzus-ui/Checkboxes/CheckboxCard/index.css +54 -0
  19. package/src/components/hamzus-ui/Code/Code.svelte +192 -0
  20. package/src/components/hamzus-ui/CopyCode/CopyCode.svelte +55 -0
  21. package/src/components/hamzus-ui/CopyLabel/CopyLabel.svelte +43 -0
  22. package/src/components/hamzus-ui/DataList/DataList.svelte +82 -0
  23. package/src/components/hamzus-ui/DatePicker/DatePicker.svelte +326 -0
  24. package/src/components/hamzus-ui/Dialog/Dialog.svelte +61 -0
  25. package/src/components/hamzus-ui/DropdownMenu/Button.svelte +46 -0
  26. package/src/components/hamzus-ui/DropdownMenu/Content.svelte +22 -0
  27. package/src/components/hamzus-ui/DropdownMenu/Label.svelte +1 -0
  28. package/src/components/hamzus-ui/DropdownMenu/Root.svelte +340 -0
  29. package/src/components/hamzus-ui/DropdownMenu/Separator.svelte +12 -0
  30. package/src/components/hamzus-ui/DropdownMenu/Trigger.svelte +1 -0
  31. package/src/components/hamzus-ui/DropdownMenu/index.js +6 -0
  32. package/src/components/hamzus-ui/IconButton/IconButton.svelte +80 -0
  33. package/src/components/hamzus-ui/IconButton/IconButton_default.svelte +140 -0
  34. package/src/components/hamzus-ui/IconButton/IconButton_link.svelte +141 -0
  35. package/src/components/hamzus-ui/InfoCard/InfoCard.svelte +32 -0
  36. package/src/components/hamzus-ui/Input/Input.svelte +304 -0
  37. package/src/components/hamzus-ui/KBD/KBD.svelte +24 -0
  38. package/src/components/hamzus-ui/Link/Link.svelte +36 -0
  39. package/src/components/hamzus-ui/List/List.svelte +30 -0
  40. package/src/components/hamzus-ui/LoaderCircle/Loader.svelte +25 -0
  41. package/src/components/hamzus-ui/LoaderCircle/index.js +1 -0
  42. package/src/components/hamzus-ui/Popover/Button.svelte +46 -0
  43. package/src/components/hamzus-ui/Popover/Content.svelte +21 -0
  44. package/src/components/hamzus-ui/Popover/Label.svelte +1 -0
  45. package/src/components/hamzus-ui/Popover/Root.svelte +374 -0
  46. package/src/components/hamzus-ui/Popover/Separator.svelte +12 -0
  47. package/src/components/hamzus-ui/Popover/Trigger.svelte +1 -0
  48. package/src/components/hamzus-ui/Popover/index.js +6 -0
  49. package/src/components/hamzus-ui/Portal/Portal.svelte +46 -0
  50. package/src/components/hamzus-ui/Portal/Wormhole.svelte +7 -0
  51. package/src/components/hamzus-ui/Radios/Radio/Radio.svelte +43 -0
  52. package/src/components/hamzus-ui/Radios/Radio/index.css +68 -0
  53. package/src/components/hamzus-ui/Radios/RadioCard/RadioCard.svelte +32 -0
  54. package/src/components/hamzus-ui/Radios/RadioCard/index.css +50 -0
  55. package/src/components/hamzus-ui/Radios/RadioGroup/RadioGroup.svelte +46 -0
  56. package/src/components/hamzus-ui/Radios/RadioGroup/index.css +8 -0
  57. package/src/components/hamzus-ui/ScrollArea/ScrollArea.svelte +360 -0
  58. package/src/components/hamzus-ui/Swicth/Swicth.svelte +84 -0
  59. package/src/components/hamzus-ui/Swicth/index.css +120 -0
  60. package/src/components/hamzus-ui/Table/ActionsBar.svelte +174 -0
  61. package/src/components/hamzus-ui/Table/Content.svelte +68 -0
  62. package/src/components/hamzus-ui/Table/Header.svelte +268 -0
  63. package/src/components/hamzus-ui/Table/NavigationBar.svelte +10 -0
  64. package/src/components/hamzus-ui/Table/Root.svelte +128 -0
  65. package/src/components/hamzus-ui/Table/index.js +5 -0
  66. package/src/components/hamzus-ui/Table/table.js +48 -0
  67. package/src/components/hamzus-ui/Tabs/Tabs.svelte +87 -0
  68. package/src/components/hamzus-ui/TabsLink/Tabs.svelte +80 -0
  69. package/src/components/hamzus-ui/Tag/Tag.svelte +43 -0
  70. package/src/components/hamzus-ui/TinyScrollArea/TinyScrollArea.svelte +350 -0
  71. package/src/styles/font.css +71 -0
  72. package/src/styles/global.css +37 -0
  73. package/src/styles/variables.css +81 -0
@@ -0,0 +1,55 @@
1
+ <script>
2
+ export let label = "label"
3
+ import IconButton from "@hamzus-ui/IconButton/IconButton.svelte";
4
+ import TinyScrollArea from "@hamzus-ui/TinyScrollArea/TinyScrollArea.svelte";
5
+
6
+ let isCoppied = false
7
+
8
+ let displayedText = label
9
+
10
+ async function handleCopy() {
11
+ await navigator.clipboard.writeText(label)
12
+ displayedText = "copié !"
13
+ isCoppied = true
14
+
15
+ setTimeout(()=>{
16
+ displayedText = label
17
+ isCoppied = false
18
+ }, 800)
19
+ }
20
+ </script>
21
+
22
+ <div class="copy-label" {...$$restProps}>
23
+ <IconButton onClick={handleCopy} variant="ghost">
24
+ {#if isCoppied}
25
+ <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
26
+ <path d="M10.1178 18.3979C9.78728 18.3979 9.47333 18.2658 9.242 18.0344L4.56581 13.3582C4.08662 12.8791 4.08662 12.0859 4.56581 11.6067C5.045 11.1275 5.83813 11.1275 6.31732 11.6067L10.1178 15.4072L18.6109 6.91402C19.0901 6.43483 19.8832 6.43483 20.3624 6.91402C20.8416 7.3932 20.8416 8.18634 20.3624 8.66552L10.9935 18.0344C10.7622 18.2658 10.4482 18.3979 10.1178 18.3979Z" fill="black"/>
27
+ </svg>
28
+ {:else}
29
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
30
+ <path d="M11.1 22.75H6.9C2.99 22.75 1.25 21.01 1.25 17.1V12.9C1.25 8.99 2.99 7.25 6.9 7.25H11.1C15.01 7.25 16.75 8.99 16.75 12.9V17.1C16.75 21.01 15.01 22.75 11.1 22.75ZM6.9 8.75C3.8 8.75 2.75 9.8 2.75 12.9V17.1C2.75 20.2 3.8 21.25 6.9 21.25H11.1C14.2 21.25 15.25 20.2 15.25 17.1V12.9C15.25 9.8 14.2 8.75 11.1 8.75H6.9Z" fill="#292D32"/>
31
+ <path d="M17.1 16.75H16C15.59 16.75 15.25 16.41 15.25 16V12.9C15.25 9.8 14.2 8.75 11.1 8.75H8C7.59 8.75 7.25 8.41 7.25 8V6.9C7.25 2.99 8.99 1.25 12.9 1.25H17.1C21.01 1.25 22.75 2.99 22.75 6.9V11.1C22.75 15.01 21.01 16.75 17.1 16.75ZM16.75 15.25H17.1C20.2 15.25 21.25 14.2 21.25 11.1V6.9C21.25 3.8 20.2 2.75 17.1 2.75H12.9C9.8 2.75 8.75 3.8 8.75 6.9V7.25H11.1C15.01 7.25 16.75 8.99 16.75 12.9V15.25Z" fill="#292D32"/>
32
+ </svg>
33
+ {/if}
34
+ </IconButton>
35
+ <TinyScrollArea>
36
+ <h4 class="code" style="text-align: left;">{displayedText}</h4>
37
+ </TinyScrollArea>
38
+ </div>
39
+
40
+ <style>
41
+ .copy-label{
42
+ width: 100%;
43
+ display: flex;
44
+ align-items: center;
45
+ column-gap: var(--pad-m);
46
+ padding: var(--pad-m);
47
+ background-color: var(--bg-2);
48
+ border-radius: var(--radius-m);
49
+ border: 1px solid var(--stroke);
50
+ }
51
+ .code{
52
+ white-space: nowrap;
53
+ user-select: text;
54
+ }
55
+ </style>
@@ -0,0 +1,43 @@
1
+ <script>
2
+ export let label = "label"
3
+ import IconButton from "@hamzus-ui/IconButton/IconButton.svelte";
4
+
5
+ let isCoppied = false
6
+
7
+ let displayedText = label
8
+
9
+ async function handleCopy() {
10
+ await navigator.clipboard.writeText(label)
11
+ displayedText = "copié !"
12
+ isCoppied = true
13
+
14
+ setTimeout(()=>{
15
+ displayedText = label
16
+ isCoppied = false
17
+ }, 800)
18
+ }
19
+ </script>
20
+
21
+ <button on:click={handleCopy} class="copy-label" {...$$restProps}>
22
+ <IconButton variant="ghost">
23
+ {#if isCoppied}
24
+ <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
25
+ <path d="M10.1178 18.3979C9.78728 18.3979 9.47333 18.2658 9.242 18.0344L4.56581 13.3582C4.08662 12.8791 4.08662 12.0859 4.56581 11.6067C5.045 11.1275 5.83813 11.1275 6.31732 11.6067L10.1178 15.4072L18.6109 6.91402C19.0901 6.43483 19.8832 6.43483 20.3624 6.91402C20.8416 7.3932 20.8416 8.18634 20.3624 8.66552L10.9935 18.0344C10.7622 18.2658 10.4482 18.3979 10.1178 18.3979Z" fill="black"/>
26
+ </svg>
27
+ {:else}
28
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
29
+ <path d="M11.1 22.75H6.9C2.99 22.75 1.25 21.01 1.25 17.1V12.9C1.25 8.99 2.99 7.25 6.9 7.25H11.1C15.01 7.25 16.75 8.99 16.75 12.9V17.1C16.75 21.01 15.01 22.75 11.1 22.75ZM6.9 8.75C3.8 8.75 2.75 9.8 2.75 12.9V17.1C2.75 20.2 3.8 21.25 6.9 21.25H11.1C14.2 21.25 15.25 20.2 15.25 17.1V12.9C15.25 9.8 14.2 8.75 11.1 8.75H6.9Z" fill="#292D32"/>
30
+ <path d="M17.1 16.75H16C15.59 16.75 15.25 16.41 15.25 16V12.9C15.25 9.8 14.2 8.75 11.1 8.75H8C7.59 8.75 7.25 8.41 7.25 8V6.9C7.25 2.99 8.99 1.25 12.9 1.25H17.1C21.01 1.25 22.75 2.99 22.75 6.9V11.1C22.75 15.01 21.01 16.75 17.1 16.75ZM16.75 15.25H17.1C20.2 15.25 21.25 14.2 21.25 11.1V6.9C21.25 3.8 20.2 2.75 17.1 2.75H12.9C9.8 2.75 8.75 3.8 8.75 6.9V7.25H11.1C15.01 7.25 16.75 8.99 16.75 12.9V15.25Z" fill="#292D32"/>
31
+ </svg>
32
+ {/if}
33
+ </IconButton>
34
+ <h4>{displayedText}</h4>
35
+ </button>
36
+
37
+ <style>
38
+ .copy-label{
39
+ display: flex;
40
+ align-items: center;
41
+ column-gap: var(--pad-m);
42
+ }
43
+ </style>
@@ -0,0 +1,82 @@
1
+ <script>
2
+ export let data = {}
3
+ export let titles = []
4
+ </script>
5
+
6
+ <div class="data-list-container">
7
+ {#if titles.length != 0}
8
+ <div class="title">
9
+ {#each titles as title}
10
+ <h5>{title}</h5>
11
+ {/each}
12
+ </div>
13
+ {/if}
14
+ <div class="data-list" {...$$restProps}>
15
+ {#each Object.entries(data) as [key , value]}
16
+ <div class="row">
17
+ <h4 class="key">{key}</h4>
18
+ {#if typeof value != 'object'}
19
+ <h5 class="value">{value}</h5>
20
+ {:else}
21
+ {#if value.text}
22
+ <h5 class="value" style={value.style ? value.style : ""}>{value.text}</h5>
23
+ {:else}
24
+ <svelte:component this={value.component} {...value.props}></svelte:component>
25
+ {/if}
26
+ {/if}
27
+ </div>
28
+ {/each}
29
+ </div>
30
+ </div>
31
+
32
+ <style>
33
+ .data-list-container{
34
+ border: 1px solid var(--stroke);
35
+ padding: var(--pad-m);
36
+ border-radius: var(--radius-m);
37
+ margin-bottom: 32px;
38
+ }
39
+ .data-list {
40
+ width: 100%;
41
+ display: flex;
42
+ flex-direction: column;
43
+ row-gap: var(--pad-m);
44
+ }
45
+ .row{
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: space-between;
49
+ padding: var(--pad-xs) var(--pad-m);
50
+ border-radius: var(--radius-m);
51
+ cursor: pointer;
52
+ position: relative;
53
+ margin-bottom: var(--pad-m);
54
+ }
55
+ .title{
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: space-between;
59
+ padding: var(--pad-xs) var(--pad-m);
60
+ }
61
+ .row:not(:last-child):after{
62
+ content: '';
63
+ position: absolute;
64
+ bottom: calc( 0px - var(--pad-m));
65
+ left: 0;
66
+ width: 100%;
67
+ height: 1px;
68
+ background-color: var(--stroke);
69
+ }
70
+ .row:nth-child(odd){
71
+ background-color: var(--bg-2);
72
+ }
73
+ .row:hover{
74
+ background-color: var(--bg-3);
75
+ }
76
+ .key{
77
+ color: var(--font-u);
78
+ }
79
+ .value{
80
+ text-align: right;
81
+ }
82
+ </style>
@@ -0,0 +1,326 @@
1
+ <script>
2
+ import * as DropdownMenu from '@hamzus-ui/DropdownMenu';
3
+ import Button from '@hamzus-ui/Button/Button.svelte';
4
+ import IconButton from '@hamzus-ui/IconButton/IconButton.svelte';
5
+ import { onMount } from 'svelte';
6
+
7
+ export let value = ""
8
+ export let name = ""
9
+
10
+ const monthList = {
11
+ 1: 'janvier',
12
+ 2: 'février',
13
+ 3: 'mars',
14
+ 4: 'avril',
15
+ 5: 'mai',
16
+ 6: 'juin',
17
+ 7: 'juillet',
18
+ 8: 'août',
19
+ 9: 'septembre',
20
+ 10: 'octobre',
21
+ 11: 'novembre',
22
+ 12: 'décembre'
23
+ };
24
+ const yearList = getYearList();
25
+
26
+ let monthInput;
27
+
28
+ let currentDay = null
29
+ let currentYear = new Date().getFullYear();
30
+ let currentMonth = new Date().getMonth() + 1;
31
+
32
+ let weeks = generateCalendarMatrix(currentYear, currentMonth - 1);
33
+
34
+ let mode = "day"
35
+
36
+ function getYearList(startYear = 1997) {
37
+ const currentYear = new Date().getFullYear();
38
+
39
+ return Array.from({ length: currentYear - startYear + 1 }, (_, i) => currentYear + 100 - i);
40
+ }
41
+
42
+ onMount(() => {});
43
+
44
+ function generateCalendarMatrix(year, month) {
45
+ const firstDay = new Date(year, month, 1);
46
+ const startWeekday = (firstDay.getDay() + 6) % 7; // 0 = lundi, ..., 6 = dimanche
47
+
48
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
49
+ const daysInPrevMonth = new Date(year, month, 0).getDate();
50
+
51
+ const days = [];
52
+
53
+ // Début : jours du mois précédent
54
+ for (let i = startWeekday - 1; i >= 0; i--) {
55
+ days.push({
56
+ day: daysInPrevMonth - i,
57
+ currentMonth: false
58
+ });
59
+ }
60
+
61
+ // Jours du mois courant
62
+ for (let i = 1; i <= daysInMonth; i++) {
63
+ days.push({
64
+ day: i,
65
+ currentMonth: true
66
+ });
67
+ }
68
+
69
+ // Fin : jours du mois suivant
70
+ const remaining = 7 - (days.length % 7);
71
+ if (remaining < 7) {
72
+ for (let i = 1; i <= remaining; i++) {
73
+ days.push({
74
+ day: i,
75
+ currentMonth: false
76
+ });
77
+ }
78
+ }
79
+
80
+ // Regrouper en semaines de 7 jours
81
+ const weeks = [];
82
+ for (let i = 0; i < days.length; i += 7) {
83
+ weeks.push(days.slice(i, i + 7));
84
+ }
85
+
86
+ return weeks;
87
+ }
88
+
89
+ function gotoNextMonth() {
90
+
91
+ if (currentMonth === 12) {
92
+ currentYear ++
93
+ }
94
+ currentMonth = currentMonth === 12 ? 1 : currentMonth + 1
95
+
96
+ weeks = generateCalendarMatrix(currentYear, currentMonth - 1);
97
+
98
+ }
99
+ function gotoPreviousMonth() {
100
+
101
+ if (currentMonth === 1) {
102
+ currentYear --
103
+ }
104
+ currentMonth = currentMonth === 1 ? 12 : currentMonth - 1
105
+
106
+ weeks = generateCalendarMatrix(currentYear, currentMonth - 1);
107
+
108
+ }
109
+
110
+ function handleUpdateValue(day) {
111
+ const formatNumber = (num) => num.toString().padStart(2, '0');
112
+
113
+ currentDay = day
114
+
115
+ value = `${currentYear}-${formatNumber(currentMonth)}-${formatNumber(day)}`
116
+ }
117
+
118
+ function handleChangeDayInput(event) {
119
+ const onlyNumbers = event.target.value.replace(/\D/g, '');
120
+
121
+ if (onlyNumbers.length === 0) {
122
+ currentDay = null
123
+ return
124
+ }
125
+
126
+ if (onlyNumbers === "0") {
127
+ currentDay = null
128
+ return
129
+ }
130
+
131
+ if (onlyNumbers.length === 1) {
132
+ currentDay = "0" + onlyNumbers
133
+ return
134
+ }
135
+
136
+ if (onlyNumbers.length === 3 && onlyNumbers.charAt(0) === "0") {
137
+ // prendre les deux dernier chiffre
138
+ currentDay = onlyNumbers.charAt(1) + onlyNumbers.charAt(onlyNumbers.length - 1)
139
+ monthInput.focus()
140
+ return
141
+ }
142
+
143
+
144
+ if (onlyNumbers.length === 3) {
145
+ // prendre le dernier chiffre et mettre un zero
146
+ currentDay = "0" + onlyNumbers.charAt(onlyNumbers.length - 1)
147
+ return
148
+ }
149
+ currentDay = onlyNumbers
150
+
151
+ console.log(currentDay);
152
+
153
+ }
154
+
155
+ function handleChangeMonthInput(event) {
156
+
157
+ }
158
+ </script>
159
+
160
+ <input type="hidden" {name} {value}>
161
+ <h4>{value}</h4>
162
+
163
+ <div class="group">
164
+
165
+ <input type="text" bind:value={currentDay} placeholder="dd" on:input={handleChangeDayInput} class="cell p">
166
+ <p>/</p>
167
+ <input type="text" placeholder="mm" on:input={handleChangeMonthInput} bind:this={monthInput} class="cell p">
168
+
169
+ </div>
170
+
171
+
172
+ <DropdownMenu.Root>
173
+ <DropdownMenu.Trigger slot="trigger">
174
+ <IconButton variant="ghost">
175
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
176
+ <path d="M8 5.75C7.59 5.75 7.25 5.41 7.25 5V2C7.25 1.59 7.59 1.25 8 1.25C8.41 1.25 8.75 1.59 8.75 2V5C8.75 5.41 8.41 5.75 8 5.75Z" fill="white" />
177
+ <path d="M16 5.75C15.59 5.75 15.25 5.41 15.25 5V2C15.25 1.59 15.59 1.25 16 1.25C16.41 1.25 16.75 1.59 16.75 2V5C16.75 5.41 16.41 5.75 16 5.75Z" fill="white" />
178
+ <path d="M8.5 14.5003C8.37 14.5003 8.24 14.4703 8.12 14.4203C7.99 14.3703 7.89 14.3003 7.79 14.2103C7.61 14.0203 7.5 13.7703 7.5 13.5003C7.5 13.3703 7.53 13.2403 7.58 13.1203C7.63 13.0003 7.7 12.8903 7.79 12.7903C7.89 12.7003 7.99 12.6303 8.12 12.5803C8.48 12.4303 8.93 12.5103 9.21 12.7903C9.39 12.9803 9.5 13.2403 9.5 13.5003C9.5 13.5603 9.49 13.6303 9.48 13.7003C9.47 13.7603 9.45 13.8203 9.42 13.8803C9.4 13.9403 9.37 14.0003 9.33 14.0603C9.3 14.1103 9.25 14.1603 9.21 14.2103C9.02 14.3903 8.76 14.5003 8.5 14.5003Z" fill="white" />
179
+ <path d="M12 14.5008C11.87 14.5008 11.74 14.4709 11.62 14.4209C11.49 14.3709 11.39 14.3008 11.29 14.2108C11.11 14.0208 11 13.7708 11 13.5008C11 13.3708 11.03 13.2408 11.08 13.1208C11.13 13.0008 11.2 12.8909 11.29 12.7909C11.39 12.7009 11.49 12.6308 11.62 12.5808C11.98 12.4208 12.43 12.5109 12.71 12.7909C12.89 12.9809 13 13.2408 13 13.5008C13 13.5608 12.99 13.6309 12.98 13.7009C12.97 13.7609 12.95 13.8209 12.92 13.8809C12.9 13.9409 12.87 14.0008 12.83 14.0608C12.8 14.1108 12.75 14.1608 12.71 14.2108C12.52 14.3908 12.26 14.5008 12 14.5008Z" fill="white" />
180
+ <path d="M15.5 14.5008C15.37 14.5008 15.24 14.4709 15.12 14.4209C14.99 14.3709 14.89 14.3008 14.79 14.2108C14.75 14.1608 14.71 14.1108 14.67 14.0608C14.63 14.0008 14.6 13.9409 14.58 13.8809C14.55 13.8209 14.53 13.7609 14.52 13.7009C14.51 13.6309 14.5 13.5608 14.5 13.5008C14.5 13.2408 14.61 12.9809 14.79 12.7909C14.89 12.7009 14.99 12.6308 15.12 12.5808C15.49 12.4208 15.93 12.5109 16.21 12.7909C16.39 12.9809 16.5 13.2408 16.5 13.5008C16.5 13.5608 16.49 13.6309 16.48 13.7009C16.47 13.7609 16.45 13.8209 16.42 13.8809C16.4 13.9409 16.37 14.0008 16.33 14.0608C16.3 14.1108 16.25 14.1608 16.21 14.2108C16.02 14.3908 15.76 14.5008 15.5 14.5008Z" fill="white" />
181
+ <path d="M8.5 17.9992C8.37 17.9992 8.24 17.9692 8.12 17.9192C8 17.8692 7.89 17.7992 7.79 17.7092C7.61 17.5192 7.5 17.2592 7.5 16.9992C7.5 16.8692 7.53 16.7392 7.58 16.6192C7.63 16.4892 7.7 16.3792 7.79 16.2892C8.16 15.9192 8.84 15.9192 9.21 16.2892C9.39 16.4792 9.5 16.7392 9.5 16.9992C9.5 17.2592 9.39 17.5192 9.21 17.7092C9.02 17.8892 8.76 17.9992 8.5 17.9992Z" fill="white" />
182
+ <path d="M12 17.9992C11.74 17.9992 11.48 17.8892 11.29 17.7092C11.11 17.5192 11 17.2592 11 16.9992C11 16.8692 11.03 16.7392 11.08 16.6192C11.13 16.4892 11.2 16.3792 11.29 16.2892C11.66 15.9192 12.34 15.9192 12.71 16.2892C12.8 16.3792 12.87 16.4892 12.92 16.6192C12.97 16.7392 13 16.8692 13 16.9992C13 17.2592 12.89 17.5192 12.71 17.7092C12.52 17.8892 12.26 17.9992 12 17.9992Z" fill="white" />
183
+ <path d="M15.5 18.0009C15.24 18.0009 14.98 17.8909 14.79 17.7109C14.7 17.6209 14.63 17.5109 14.58 17.3809C14.53 17.2609 14.5 17.1309 14.5 17.0009C14.5 16.8709 14.53 16.7409 14.58 16.6209C14.63 16.4909 14.7 16.3809 14.79 16.2909C15.02 16.0609 15.37 15.9509 15.69 16.0209C15.76 16.0309 15.82 16.0509 15.88 16.0809C15.94 16.1009 16 16.1309 16.06 16.1709C16.11 16.2009 16.16 16.2509 16.21 16.2909C16.39 16.4809 16.5 16.7409 16.5 17.0009C16.5 17.2609 16.39 17.5209 16.21 17.7109C16.02 17.8909 15.76 18.0009 15.5 18.0009Z" fill="white" />
184
+ <path d="M20.5 9.83984H3.5C3.09 9.83984 2.75 9.49984 2.75 9.08984C2.75 8.67984 3.09 8.33984 3.5 8.33984H20.5C20.91 8.33984 21.25 8.67984 21.25 9.08984C21.25 9.49984 20.91 9.83984 20.5 9.83984Z" fill="white" />
185
+ <path d="M16 22.75H8C4.35 22.75 2.25 20.65 2.25 17V8.5C2.25 4.85 4.35 2.75 8 2.75H16C19.65 2.75 21.75 4.85 21.75 8.5V17C21.75 20.65 19.65 22.75 16 22.75ZM8 4.25C5.14 4.25 3.75 5.64 3.75 8.5V17C3.75 19.86 5.14 21.25 8 21.25H16C18.86 21.25 20.25 19.86 20.25 17V8.5C20.25 5.64 18.86 4.25 16 4.25H8Z" fill="white" />
186
+ </svg>
187
+ </IconButton>
188
+ </DropdownMenu.Trigger>
189
+ <DropdownMenu.Content
190
+ slot="content"
191
+ width="260px"
192
+ style="background-color:var(--bg-1);padding:0px;row-gap:0px;"
193
+ >
194
+ <div class="month-selector">
195
+ <IconButton onClick={gotoPreviousMonth} variant="ghost">
196
+ <svg
197
+ width="24"
198
+ height="24"
199
+ viewBox="0 0 24 24"
200
+ fill="none"
201
+ xmlns="http://www.w3.org/2000/svg"
202
+ >
203
+ <path
204
+ d="M15 20.6695C14.81 20.6695 14.62 20.5995 14.47 20.4495L7.95003 13.9295C6.89003 12.8695 6.89003 11.1295 7.95003 10.0695L14.47 3.54953C14.76 3.25953 15.24 3.25953 15.53 3.54953C15.82 3.83953 15.82 4.31953 15.53 4.60953L9.01003 11.1295C8.53003 11.6095 8.53003 12.3895 9.01003 12.8695L15.53 19.3895C15.82 19.6795 15.82 20.1595 15.53 20.4495C15.38 20.5895 15.19 20.6695 15 20.6695Z"
205
+ fill="white"
206
+ />
207
+ </svg>
208
+ </IconButton>
209
+ <h4>{monthList[currentMonth]} {currentYear}</h4>
210
+ <IconButton onClick={gotoNextMonth} variant="ghost">
211
+ <svg
212
+ width="24"
213
+ height="24"
214
+ viewBox="0 0 24 24"
215
+ fill="none"
216
+ xmlns="http://www.w3.org/2000/svg"
217
+ >
218
+ <path
219
+ d="M8.9101 20.6695C8.7201 20.6695 8.5301 20.5995 8.3801 20.4495C8.0901 20.1595 8.0901 19.6795 8.3801 19.3895L14.9001 12.8695C15.3801 12.3895 15.3801 11.6095 14.9001 11.1295L8.3801 4.60953C8.0901 4.31953 8.0901 3.83953 8.3801 3.54953C8.6701 3.25953 9.1501 3.25953 9.4401 3.54953L15.9601 10.0695C16.4701 10.5795 16.7601 11.2695 16.7601 11.9995C16.7601 12.7295 16.4801 13.4195 15.9601 13.9295L9.4401 20.4495C9.2901 20.5895 9.1001 20.6695 8.9101 20.6695Z"
220
+ fill="white"
221
+ />
222
+ </svg>
223
+ </IconButton>
224
+ </div>
225
+ {#if mode === "day"}
226
+ <table class="calendar">
227
+ <thead>
228
+ <tr>
229
+ <th><h5>L</h5></th>
230
+ <th><h5>Ma</h5></th>
231
+ <th><h5>Me</h5></th>
232
+ <th><h5>J</h5></th>
233
+ <th><h5>V</h5></th>
234
+ <th><h5>S</h5></th>
235
+ <th><h5>D</h5></th>
236
+ </tr>
237
+ </thead>
238
+ <tbody>
239
+ {#each weeks as week}
240
+ <tr>
241
+ {#each week as day}
242
+ <td>
243
+ <div>
244
+ <IconButton onClick={!day.currentMonth ? undefined : ()=>{handleUpdateValue(day.day)}} desabled={!day.currentMonth} variant="ghost">{day.day}</IconButton>
245
+ </div>
246
+ </td>
247
+ {/each}
248
+ </tr>
249
+ {/each}
250
+ </tbody>
251
+ </table>
252
+ {/if}
253
+ <div class="bottom-content"></div>
254
+ </DropdownMenu.Content>
255
+ </DropdownMenu.Root>
256
+
257
+ <style>
258
+
259
+ .group {
260
+ display: flex;
261
+ align-items: center;
262
+ column-gap: var(--pad-s);
263
+ }
264
+
265
+ .cell {
266
+ padding: var(--pad-xs);
267
+ border-radius: var(--radius-s);
268
+ width: 30px;
269
+ }
270
+ .cell:hover {
271
+ background-color: var(--bg-3);
272
+ }
273
+ .cell:focus{
274
+ background-color: var(--bg-1);
275
+ }
276
+
277
+ .month-selector {
278
+ display: flex;
279
+ align-items: center;
280
+ justify-content: space-between;
281
+ padding: var(--pad-xxl) var(--pad-xxl) var(--pad-m) var(--pad-xxl);
282
+ }
283
+
284
+ .calendar {
285
+ border-collapse: collapse;
286
+ }
287
+
288
+ .calendar tbody td {
289
+ background-color: var(--bg-2);
290
+ }
291
+
292
+ .calendar th > div,
293
+ .calendar td > div {
294
+ display: flex;
295
+ align-items: center;
296
+ justify-content: center;
297
+ }
298
+
299
+ .calendar tr > th{
300
+ padding-bottom: var(--pad-m);
301
+ }
302
+ .calendar tr:first-child > td{
303
+ padding-top: var(--pad-m);
304
+ }
305
+
306
+
307
+ .calendar tr > td:last-child,
308
+ .calendar tr > th:last-child {
309
+ padding-right: var(--pad-xxl);
310
+ }
311
+ .calendar tr > td:first-child,
312
+ .calendar tr > th:first-child {
313
+ padding-left: var(--pad-xxl);
314
+ }
315
+
316
+ .calendar tr:last-child > td {
317
+ padding-bottom: var(--pad-m);
318
+ }
319
+
320
+ .bottom-content{
321
+ min-height: var(--radius-l);
322
+ background-color: var(--bg-2);
323
+ border-bottom-left-radius: var(--radius-l);
324
+ border-bottom-right-radius: var(--radius-l);
325
+ }
326
+ </style>
@@ -0,0 +1,61 @@
1
+ <script>
2
+ import IconButton from '@hamzus-ui/IconButton/IconButton.svelte';
3
+ import Portal from '@hamzus-ui/Portal/Portal.svelte';
4
+
5
+ export let isOpen = true;
6
+
7
+ function handleClose() {
8
+ isOpen = false;
9
+ }
10
+ </script>
11
+
12
+ {#if isOpen}
13
+ <Portal target="body">
14
+ <div class="dialog">
15
+ <div class="dialog-container">
16
+ <IconButton style="position:absolute;top:var(--pad-m);right:var(--pad-m);" label="ghost" variant="ghost" onClick={handleClose}>
17
+ <svg
18
+ width="25"
19
+ height="25"
20
+ viewBox="0 0 25 25"
21
+ fill="none"
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ ><path
24
+ d="M8.02188 18.1153C7.72277 18.1153 7.42365 18.0051 7.1875 17.7689C6.73096 17.3124 6.73096 16.5567 7.1875 16.1002L16.0981 7.18964C16.5546 6.73309 17.3103 6.73309 17.7668 7.18964C18.2234 7.64619 18.2234 8.40185 17.7668 8.8584L8.85626 17.7689C8.63586 18.0051 8.321 18.1153 8.02188 18.1153Z"
25
+ fill="black"
26
+ ></path><path
27
+ d="M16.9324 18.1153C16.6333 18.1153 16.3342 18.0051 16.0981 17.7689L7.1875 8.8584C6.73096 8.40185 6.73096 7.64619 7.1875 7.18964C7.64405 6.73309 8.39972 6.73309 8.85626 7.18964L17.7668 16.1002C18.2234 16.5567 18.2234 17.3124 17.7668 17.7689C17.5307 18.0051 17.2315 18.1153 16.9324 18.1153Z"
28
+ fill="black"
29
+ ></path></svg
30
+ >
31
+ </IconButton>
32
+ <slot/>
33
+ </div>
34
+ </div>
35
+ </Portal>
36
+ {/if}
37
+
38
+ <style>
39
+ .dialog {
40
+ position: fixed;
41
+ z-index: 1000;
42
+ top: 0;
43
+ left: 0;
44
+ width: 100%;
45
+ height: 100%;
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ background-color: var(--bg-blur);
50
+ backdrop-filter: blur(20px);
51
+ -webkit-backdrop-filter: blur(20px);
52
+ }
53
+ .dialog-container {
54
+ width: min(100%, 350px);
55
+ min-height: 45px;
56
+ padding: var(--pad-xxl);
57
+ border-radius: var(--radius-m);
58
+ background-color: var(--bg-1);
59
+ position: relative;
60
+ }
61
+ </style>
@@ -0,0 +1,46 @@
1
+ <script>
2
+ export let onClick = undefined
3
+ export let label = ""
4
+ function handleClick() {
5
+ if (onClick && typeof onClick === 'function') {
6
+ onClick()
7
+ }
8
+ }
9
+ </script>
10
+
11
+ <button class="button" on:click={handleClick} {...$$restProps}>
12
+ {#if label}
13
+ <h4>{label}</h4>
14
+ {:else}
15
+ <slot/>
16
+ {/if}
17
+ </button>
18
+
19
+ <style>
20
+ .button{
21
+ width: 100%;
22
+ display: flex;
23
+ align-items: center;
24
+ column-gap: var(--pad-m);
25
+ padding: var(--pad-s) var(--pad-m);
26
+ border-radius: var(--radius-m);
27
+ color: var(--font-d);
28
+ cursor: pointer;
29
+ transition: transform .2s ease-out;
30
+ }
31
+ .button:active {
32
+ transform: scale(.98);
33
+ }
34
+ .button :global(> *) {
35
+ color: var(--font-d);
36
+ fill: var(--font-d);
37
+ }
38
+ .button:hover{
39
+ background-color: var(--bg-3);
40
+ color: var(--font-u);
41
+ }
42
+ .button:hover :global(> *) {
43
+ color: var(--font-u);
44
+ fill: var(--font-d);
45
+ }
46
+ </style>
@@ -0,0 +1,22 @@
1
+ <script>
2
+ export let width = "max-content"
3
+ export let style;
4
+ </script>
5
+
6
+ <div class="content" style="--width:{width};{style}" {...$$restProps}>
7
+ <slot/>
8
+ </div>
9
+
10
+ <style>
11
+ .content{
12
+ display: flex;
13
+ flex-direction: column;
14
+ row-gap: var(--pad-m);
15
+ padding: var(--pad-m) var(--pad-l);
16
+ background-color: var(--bg-2);
17
+ border-radius: var(--radius-l);
18
+ border: 1px solid var(--bg-3);
19
+ width: min(100vw, var(--width));
20
+ max-height: 100vh;
21
+ }
22
+ </style>
@@ -0,0 +1 @@
1
+ <h5><slot/></h5>