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.
- package/README.md +38 -0
- package/index.js +6 -0
- package/package.json +48 -0
- package/src/components/hamzus-ui/AdvancedTooltip/Content.svelte +22 -0
- package/src/components/hamzus-ui/AdvancedTooltip/Label.svelte +1 -0
- package/src/components/hamzus-ui/AdvancedTooltip/Root.svelte +336 -0
- package/src/components/hamzus-ui/AdvancedTooltip/Separator.svelte +12 -0
- package/src/components/hamzus-ui/AdvancedTooltip/Trigger.svelte +5 -0
- package/src/components/hamzus-ui/AdvancedTooltip/index.js +5 -0
- package/src/components/hamzus-ui/AlertCard/AlertCard.svelte +32 -0
- package/src/components/hamzus-ui/Avatar/Avatar.svelte +32 -0
- package/src/components/hamzus-ui/Button/Button.svelte +79 -0
- package/src/components/hamzus-ui/Button/Button_default.svelte +142 -0
- package/src/components/hamzus-ui/Button/Button_link.svelte +138 -0
- package/src/components/hamzus-ui/Checkboxes/Checkbox/Checkbox.svelte +41 -0
- package/src/components/hamzus-ui/Checkboxes/Checkbox/index.css +68 -0
- package/src/components/hamzus-ui/Checkboxes/CheckboxCard/CheckboxCard.svelte +27 -0
- package/src/components/hamzus-ui/Checkboxes/CheckboxCard/index.css +54 -0
- package/src/components/hamzus-ui/Code/Code.svelte +192 -0
- package/src/components/hamzus-ui/CopyCode/CopyCode.svelte +55 -0
- package/src/components/hamzus-ui/CopyLabel/CopyLabel.svelte +43 -0
- package/src/components/hamzus-ui/DataList/DataList.svelte +82 -0
- package/src/components/hamzus-ui/DatePicker/DatePicker.svelte +326 -0
- package/src/components/hamzus-ui/Dialog/Dialog.svelte +61 -0
- package/src/components/hamzus-ui/DropdownMenu/Button.svelte +46 -0
- package/src/components/hamzus-ui/DropdownMenu/Content.svelte +22 -0
- package/src/components/hamzus-ui/DropdownMenu/Label.svelte +1 -0
- package/src/components/hamzus-ui/DropdownMenu/Root.svelte +340 -0
- package/src/components/hamzus-ui/DropdownMenu/Separator.svelte +12 -0
- package/src/components/hamzus-ui/DropdownMenu/Trigger.svelte +1 -0
- package/src/components/hamzus-ui/DropdownMenu/index.js +6 -0
- package/src/components/hamzus-ui/IconButton/IconButton.svelte +80 -0
- package/src/components/hamzus-ui/IconButton/IconButton_default.svelte +140 -0
- package/src/components/hamzus-ui/IconButton/IconButton_link.svelte +141 -0
- package/src/components/hamzus-ui/InfoCard/InfoCard.svelte +32 -0
- package/src/components/hamzus-ui/Input/Input.svelte +304 -0
- package/src/components/hamzus-ui/KBD/KBD.svelte +24 -0
- package/src/components/hamzus-ui/Link/Link.svelte +36 -0
- package/src/components/hamzus-ui/List/List.svelte +30 -0
- package/src/components/hamzus-ui/LoaderCircle/Loader.svelte +25 -0
- package/src/components/hamzus-ui/LoaderCircle/index.js +1 -0
- package/src/components/hamzus-ui/Popover/Button.svelte +46 -0
- package/src/components/hamzus-ui/Popover/Content.svelte +21 -0
- package/src/components/hamzus-ui/Popover/Label.svelte +1 -0
- package/src/components/hamzus-ui/Popover/Root.svelte +374 -0
- package/src/components/hamzus-ui/Popover/Separator.svelte +12 -0
- package/src/components/hamzus-ui/Popover/Trigger.svelte +1 -0
- package/src/components/hamzus-ui/Popover/index.js +6 -0
- package/src/components/hamzus-ui/Portal/Portal.svelte +46 -0
- package/src/components/hamzus-ui/Portal/Wormhole.svelte +7 -0
- package/src/components/hamzus-ui/Radios/Radio/Radio.svelte +43 -0
- package/src/components/hamzus-ui/Radios/Radio/index.css +68 -0
- package/src/components/hamzus-ui/Radios/RadioCard/RadioCard.svelte +32 -0
- package/src/components/hamzus-ui/Radios/RadioCard/index.css +50 -0
- package/src/components/hamzus-ui/Radios/RadioGroup/RadioGroup.svelte +46 -0
- package/src/components/hamzus-ui/Radios/RadioGroup/index.css +8 -0
- package/src/components/hamzus-ui/ScrollArea/ScrollArea.svelte +360 -0
- package/src/components/hamzus-ui/Swicth/Swicth.svelte +84 -0
- package/src/components/hamzus-ui/Swicth/index.css +120 -0
- package/src/components/hamzus-ui/Table/ActionsBar.svelte +174 -0
- package/src/components/hamzus-ui/Table/Content.svelte +68 -0
- package/src/components/hamzus-ui/Table/Header.svelte +268 -0
- package/src/components/hamzus-ui/Table/NavigationBar.svelte +10 -0
- package/src/components/hamzus-ui/Table/Root.svelte +128 -0
- package/src/components/hamzus-ui/Table/index.js +5 -0
- package/src/components/hamzus-ui/Table/table.js +48 -0
- package/src/components/hamzus-ui/Tabs/Tabs.svelte +87 -0
- package/src/components/hamzus-ui/TabsLink/Tabs.svelte +80 -0
- package/src/components/hamzus-ui/Tag/Tag.svelte +43 -0
- package/src/components/hamzus-ui/TinyScrollArea/TinyScrollArea.svelte +350 -0
- package/src/styles/font.css +71 -0
- package/src/styles/global.css +37 -0
- package/src/styles/variables.css +81 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
// import
|
|
3
|
+
import Loader from '@hamzus-ui/LoaderCircle/Loader.svelte';
|
|
4
|
+
// props
|
|
5
|
+
export let loading = false
|
|
6
|
+
export let desabled = false
|
|
7
|
+
export let href = ""
|
|
8
|
+
export let onClick = undefined
|
|
9
|
+
export let avoidRipple = false;
|
|
10
|
+
// local var
|
|
11
|
+
let button
|
|
12
|
+
// functions
|
|
13
|
+
function handleClick(event) {
|
|
14
|
+
if (!desabled && !loading) {
|
|
15
|
+
createRipple(event)
|
|
16
|
+
if (onClick && typeof onClick === "function") {
|
|
17
|
+
onClick()
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function createRipple(event) {
|
|
22
|
+
if (avoidRipple) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const ripple = document.createElement('span');
|
|
27
|
+
|
|
28
|
+
const rect = button.getBoundingClientRect();
|
|
29
|
+
const x = event.clientX - rect.left;
|
|
30
|
+
const y = event.clientY - rect.top;
|
|
31
|
+
|
|
32
|
+
ripple.style.left = `${x}px`;
|
|
33
|
+
ripple.style.top = `${y}px`;
|
|
34
|
+
ripple.classList.add('ripple');
|
|
35
|
+
|
|
36
|
+
button.appendChild(ripple);
|
|
37
|
+
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
ripple.remove();
|
|
40
|
+
}, 1000);
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<a on:click={handleClick} bind:this={button} class="button h4" class:desabled class:loading {href} {...$$restProps}>
|
|
45
|
+
<slot/>
|
|
46
|
+
{#if loading}
|
|
47
|
+
<div class="loader">
|
|
48
|
+
<Loader size="16px" color="var(--button-default-color)"></Loader>
|
|
49
|
+
</div>
|
|
50
|
+
{/if}
|
|
51
|
+
</a>
|
|
52
|
+
<style>
|
|
53
|
+
.button{
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
padding:var(--pad-s);
|
|
58
|
+
border-radius: var(--radius-m);
|
|
59
|
+
background-color: var(--button-default-bg);
|
|
60
|
+
color: var(--button-default-color);
|
|
61
|
+
transition-property: background-color, transform, color;
|
|
62
|
+
transition-duration: .2s;
|
|
63
|
+
transition-timing-function: ease-out;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
border: 1px solid var(--button-default-border);
|
|
66
|
+
width: max-content;
|
|
67
|
+
white-space: nowrap;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
width: 30px;
|
|
71
|
+
height: 30px;
|
|
72
|
+
flex-shrink: 0;
|
|
73
|
+
position: relative;
|
|
74
|
+
}
|
|
75
|
+
.button :global(*) {
|
|
76
|
+
color: var(--button-default-color);
|
|
77
|
+
}
|
|
78
|
+
.button :global(svg){
|
|
79
|
+
height: 100%;
|
|
80
|
+
width: 100%;
|
|
81
|
+
flex-shrink: 0;
|
|
82
|
+
}
|
|
83
|
+
.button :global(svg > path) {
|
|
84
|
+
fill: var(--button-default-color);
|
|
85
|
+
}
|
|
86
|
+
/* states */
|
|
87
|
+
.button:not(.desabled):not(.loading):hover{
|
|
88
|
+
background-color: var(--button-hover-bg);
|
|
89
|
+
border: 1px solid var(--button-hover-border);
|
|
90
|
+
color: var(--button-hover-color);
|
|
91
|
+
}
|
|
92
|
+
.button:not(.desabled):not(.loading):hover :global(*) {
|
|
93
|
+
color: var(--button-hover-color);
|
|
94
|
+
}
|
|
95
|
+
.button:not(.desabled):not(.loading):hover :global(svg > path) {
|
|
96
|
+
fill: var(--button-hover-color);
|
|
97
|
+
}
|
|
98
|
+
.button:active{
|
|
99
|
+
transform: scale(.95);
|
|
100
|
+
}
|
|
101
|
+
.button.loading {
|
|
102
|
+
cursor: not-allowed;
|
|
103
|
+
}
|
|
104
|
+
.button.desabled {
|
|
105
|
+
opacity: .8;
|
|
106
|
+
cursor: not-allowed;
|
|
107
|
+
transform: scale(.9);
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
.button.loading :global(> *:not(.loader)){
|
|
111
|
+
opacity: 0;
|
|
112
|
+
user-select: none;
|
|
113
|
+
pointer-events: none;
|
|
114
|
+
}
|
|
115
|
+
.loader{
|
|
116
|
+
position: absolute;
|
|
117
|
+
top: 50%;
|
|
118
|
+
left: 50%;
|
|
119
|
+
transform: translate(-50%, -50%);
|
|
120
|
+
}
|
|
121
|
+
/* ripple */
|
|
122
|
+
.button :global(.ripple) {
|
|
123
|
+
width: 0px;
|
|
124
|
+
aspect-ratio: 1/1;
|
|
125
|
+
background: var(--ripple-gradient);
|
|
126
|
+
position: absolute;
|
|
127
|
+
transform: translate(-50%, -50%);
|
|
128
|
+
border-radius: 100%;
|
|
129
|
+
animation: grow 1s ease-out;
|
|
130
|
+
}
|
|
131
|
+
@keyframes grow {
|
|
132
|
+
from {
|
|
133
|
+
width: 0px;
|
|
134
|
+
opacity: 1;
|
|
135
|
+
}
|
|
136
|
+
to {
|
|
137
|
+
width: 500%;
|
|
138
|
+
opacity: 0;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
<div class="info-card">
|
|
3
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<path d="M12 1.25C17.93 1.25 22.75 6.07 22.75 12C22.75 17.93 17.93 22.75 12 22.75C6.07 22.75 1.25 17.93 1.25 12C1.25 6.07 6.07 1.25 12 1.25ZM12 21.25C17.1 21.25 21.25 17.1 21.25 12C21.25 6.9 17.1 2.75 12 2.75C6.9 2.75 2.75 6.9 2.75 12C2.75 17.1 6.9 21.25 12 21.25Z" fill="#292D32"/>
|
|
5
|
+
<path d="M12 10.25C12.41 10.25 12.75 10.59 12.75 11L12.75 16C12.75 16.41 12.41 16.75 12 16.75C11.59 16.75 11.25 16.41 11.25 16L11.25 11C11.25 10.59 11.59 10.25 12 10.25Z" fill="#292D32"/>
|
|
6
|
+
<path d="M12 7.00012C12.13 7.00012 12.26 7.03012 12.38 7.08012C12.5 7.13012 12.61 7.20012 12.71 7.29012C12.8 7.39012 12.87 7.49012 12.92 7.62012C12.97 7.74012 13 7.87012 13 8.00012C13 8.13012 12.97 8.26012 12.92 8.38012C12.87 8.50012 12.8 8.61012 12.71 8.71012C12.61 8.80012 12.5 8.87012 12.38 8.92012C12.14 9.02012 11.86 9.02012 11.62 8.92012C11.5 8.87012 11.39 8.80012 11.29 8.71012C11.2 8.61012 11.13 8.50012 11.08 8.38012C11.03 8.26012 11 8.13012 11 8.00012C11 7.87012 11.03 7.74012 11.08 7.62012C11.13 7.49012 11.2 7.39012 11.29 7.29012C11.39 7.20012 11.5 7.13012 11.62 7.08012C11.74 7.03012 11.87 7.00012 12 7.00012Z" fill="#292D32"/>
|
|
7
|
+
</svg>
|
|
8
|
+
|
|
9
|
+
<p class="info"><slot/></p>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
.info-card{
|
|
15
|
+
display: flex;
|
|
16
|
+
column-gap: var(--pad-m);
|
|
17
|
+
padding: var(--pad-m);
|
|
18
|
+
padding-bottom: var(--pad-l);
|
|
19
|
+
background-color: var(--bg-2);
|
|
20
|
+
border-radius: var(--radius-m);
|
|
21
|
+
}
|
|
22
|
+
.info{
|
|
23
|
+
margin-top: 1.5px;
|
|
24
|
+
text-align: left;
|
|
25
|
+
}
|
|
26
|
+
.info-card > svg{
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
}
|
|
29
|
+
.info-card > svg > path {
|
|
30
|
+
fill: var(--font-d);
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
// import
|
|
3
|
+
|
|
4
|
+
import IconButton from '@hamzus-ui/IconButton/IconButton.svelte';
|
|
5
|
+
import Loader from '@hamzus-ui/LoaderCircle/Loader.svelte';
|
|
6
|
+
// props
|
|
7
|
+
export let variant = 'default';
|
|
8
|
+
export let className = '';
|
|
9
|
+
export let iconSize = '24px';
|
|
10
|
+
export let label = '';
|
|
11
|
+
export let labelType = 'h5';
|
|
12
|
+
export let onChange = () => {};
|
|
13
|
+
export let name = '';
|
|
14
|
+
export let value = '';
|
|
15
|
+
export let initialValue = value;
|
|
16
|
+
export let hasChanged = false;
|
|
17
|
+
export let disabled = false;
|
|
18
|
+
export let required = false;
|
|
19
|
+
export let type = '';
|
|
20
|
+
export let style = '';
|
|
21
|
+
export let placeholder = '';
|
|
22
|
+
export let errorMessage = '';
|
|
23
|
+
export let isLoading = false;
|
|
24
|
+
export let isVisible = false;
|
|
25
|
+
export let padding = '3px 10px';
|
|
26
|
+
export let borderRadius = '12px';
|
|
27
|
+
export let defaultBg = '--bg-2';
|
|
28
|
+
export let formatPattern = [];
|
|
29
|
+
import { onMount } from 'svelte';
|
|
30
|
+
|
|
31
|
+
// local var
|
|
32
|
+
|
|
33
|
+
$: value = formatInput(value);
|
|
34
|
+
|
|
35
|
+
// fnctions
|
|
36
|
+
function formatInput(inputValue) {
|
|
37
|
+
if (formatPattern.length == 0) {
|
|
38
|
+
return inputValue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
inputValue = inputValue.replace(/\s+/g, '')
|
|
42
|
+
|
|
43
|
+
let formattedValue = '';
|
|
44
|
+
let currentIndex = 0;
|
|
45
|
+
|
|
46
|
+
for (let i = 0; i < formatPattern.length; i++) {
|
|
47
|
+
let segmentLength = formatPattern[i];
|
|
48
|
+
formattedValue += inputValue.slice(currentIndex, currentIndex + segmentLength);
|
|
49
|
+
|
|
50
|
+
currentIndex += segmentLength;
|
|
51
|
+
if (currentIndex >= inputValue.length) break;
|
|
52
|
+
|
|
53
|
+
// Ajouter un espace si ce n'est pas la dernière section
|
|
54
|
+
if (i < formatPattern.length - 1 || currentIndex < inputValue.length) {
|
|
55
|
+
formattedValue += ' ';
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Ajouter les caractères restants sans espacement
|
|
60
|
+
if (currentIndex < inputValue.length) {
|
|
61
|
+
formattedValue += inputValue.slice(currentIndex);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return formattedValue;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
onMount(() => {
|
|
68
|
+
value = formatInput(value);
|
|
69
|
+
if (formatPattern.length !== 0) {
|
|
70
|
+
initialValue = value
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
function handleDisplay() {
|
|
76
|
+
isVisible = !isVisible;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function handleChange(event) {
|
|
80
|
+
value = formatInput(event.target.value);
|
|
81
|
+
hasChanged = value != initialValue;
|
|
82
|
+
|
|
83
|
+
if (onChange) {
|
|
84
|
+
onChange(value);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<div
|
|
90
|
+
class="input-container {variant == 'default' ? variant : ''} {className}"
|
|
91
|
+
{style}
|
|
92
|
+
{...$$restProps}
|
|
93
|
+
>
|
|
94
|
+
<label
|
|
95
|
+
class="input {errorMessage ? ' error' : ''}"
|
|
96
|
+
style="{variant == 'collapse' ? `padding:${padding};` : ''}--radius:{borderRadius};--default-bg:var({defaultBg});"
|
|
97
|
+
>
|
|
98
|
+
<div class="top-line">
|
|
99
|
+
{#if label}
|
|
100
|
+
<h5 class={labelType}>
|
|
101
|
+
{label}
|
|
102
|
+
{#if required}
|
|
103
|
+
<span class="required">*</span>
|
|
104
|
+
{/if}
|
|
105
|
+
</h5>
|
|
106
|
+
{/if}
|
|
107
|
+
{#if isLoading}
|
|
108
|
+
<Loader isLoading className="input-loader" color="--accent" size="16px" />
|
|
109
|
+
{/if}
|
|
110
|
+
</div>
|
|
111
|
+
<div
|
|
112
|
+
class="input-line"
|
|
113
|
+
style="{variant == 'default' ? `padding:${padding};` : ''}--icon-size:{iconSize};"
|
|
114
|
+
>
|
|
115
|
+
<slot name="startContent" />
|
|
116
|
+
<input
|
|
117
|
+
on:input={handleChange}
|
|
118
|
+
class="h4"
|
|
119
|
+
{placeholder}
|
|
120
|
+
type={isVisible && type == 'password' ? 'text' : type}
|
|
121
|
+
{name}
|
|
122
|
+
{value}
|
|
123
|
+
{required}
|
|
124
|
+
disabled={isLoading ? true : disabled}
|
|
125
|
+
|
|
126
|
+
/>
|
|
127
|
+
{#if type == 'password'}
|
|
128
|
+
<IconButton variant="ghost" onClick={handleDisplay}>
|
|
129
|
+
{#if isVisible}
|
|
130
|
+
<svg
|
|
131
|
+
width="24"
|
|
132
|
+
height="24"
|
|
133
|
+
viewBox="0 0 24 24"
|
|
134
|
+
fill="none"
|
|
135
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
136
|
+
>
|
|
137
|
+
<path
|
|
138
|
+
opacity="0.4"
|
|
139
|
+
d="M21.2496 9.15004C20.7596 8.37004 20.1996 7.67004 19.6196 7.04004L15.8496 10.81C15.9696 11.18 16.0396 11.58 16.0396 12C16.0396 14.24 14.2296 16.04 11.9996 16.04C11.5796 16.04 11.1796 15.97 10.8096 15.85L7.34961 19.31C8.80961 20.13 10.3896 20.56 11.9996 20.56C13.7796 20.56 15.5096 20.04 17.0896 19.07C18.6696 18.09 20.0896 16.66 21.2496 14.84C22.2496 13.28 22.2496 10.72 21.2496 9.15004Z"
|
|
140
|
+
fill="#292D32"
|
|
141
|
+
/>
|
|
142
|
+
<path
|
|
143
|
+
d="M14.0206 9.97989L9.98062 14.0199C9.47062 13.4999 9.14062 12.7799 9.14062 11.9999C9.14062 10.4299 10.4206 9.13989 12.0006 9.13989C12.7806 9.13989 13.5006 9.46989 14.0206 9.97989Z"
|
|
144
|
+
fill="#292D32"
|
|
145
|
+
/>
|
|
146
|
+
<path
|
|
147
|
+
opacity="0.4"
|
|
148
|
+
d="M18.25 5.74993L14.86 9.13993C14.13 8.39993 13.12 7.95993 12 7.95993C9.76 7.95993 7.96 9.76993 7.96 11.9999C7.96 13.1199 8.41 14.1299 9.14 14.8599L5.76 18.2499H5.75C4.64 17.3499 3.62 16.1999 2.75 14.8399C1.75 13.2699 1.75 10.7199 2.75 9.14993C3.91 7.32993 5.33 5.89993 6.91 4.91993C8.49 3.95993 10.22 3.42993 12 3.42993C14.23 3.42993 16.39 4.24993 18.25 5.74993Z"
|
|
149
|
+
fill="#292D32"
|
|
150
|
+
/>
|
|
151
|
+
<path
|
|
152
|
+
d="M14.8601 12.0001C14.8601 13.5701 13.5801 14.8601 12.0001 14.8601C11.9401 14.8601 11.8901 14.8601 11.8301 14.8401L14.8401 11.8301C14.8601 11.8901 14.8601 11.9401 14.8601 12.0001Z"
|
|
153
|
+
fill="#292D32"
|
|
154
|
+
/>
|
|
155
|
+
<path
|
|
156
|
+
d="M21.7709 2.22988C21.4709 1.92988 20.9809 1.92988 20.6809 2.22988L2.23086 20.6899C1.93086 20.9899 1.93086 21.4799 2.23086 21.7799C2.38086 21.9199 2.57086 21.9999 2.77086 21.9999C2.97086 21.9999 3.16086 21.9199 3.31086 21.7699L21.7709 3.30988C22.0809 3.00988 22.0809 2.52988 21.7709 2.22988Z"
|
|
157
|
+
fill="#292D32"
|
|
158
|
+
/>
|
|
159
|
+
</svg>
|
|
160
|
+
{:else}
|
|
161
|
+
<svg
|
|
162
|
+
width="24"
|
|
163
|
+
height="24"
|
|
164
|
+
viewBox="0 0 24 24"
|
|
165
|
+
fill="none"
|
|
166
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
167
|
+
>
|
|
168
|
+
<path
|
|
169
|
+
opacity="0.4"
|
|
170
|
+
d="M21.25 9.14993C18.94 5.51993 15.56 3.42993 12 3.42993C10.22 3.42993 8.49 3.94993 6.91 4.91993C5.33 5.89993 3.91 7.32993 2.75 9.14993C1.75 10.7199 1.75 13.2699 2.75 14.8399C5.06 18.4799 8.44 20.5599 12 20.5599C13.78 20.5599 15.51 20.0399 17.09 19.0699C18.67 18.0899 20.09 16.6599 21.25 14.8399C22.25 13.2799 22.25 10.7199 21.25 9.14993ZM12 16.0399C9.76 16.0399 7.96 14.2299 7.96 11.9999C7.96 9.76993 9.76 7.95993 12 7.95993C14.24 7.95993 16.04 9.76993 16.04 11.9999C16.04 14.2299 14.24 16.0399 12 16.0399Z"
|
|
171
|
+
fill="#292D32"
|
|
172
|
+
/>
|
|
173
|
+
<path
|
|
174
|
+
d="M12.0004 9.13989C10.4304 9.13989 9.15039 10.4199 9.15039 11.9999C9.15039 13.5699 10.4304 14.8499 12.0004 14.8499C13.5704 14.8499 14.8604 13.5699 14.8604 11.9999C14.8604 10.4299 13.5704 9.13989 12.0004 9.13989Z"
|
|
175
|
+
fill="#292D32"
|
|
176
|
+
/>
|
|
177
|
+
</svg>
|
|
178
|
+
{/if}
|
|
179
|
+
</IconButton>
|
|
180
|
+
{:else}
|
|
181
|
+
<slot name="endContent" />
|
|
182
|
+
{/if}
|
|
183
|
+
</div>
|
|
184
|
+
</label>
|
|
185
|
+
{#if errorMessage}
|
|
186
|
+
<h5 class="error-message">{errorMessage}</h5>
|
|
187
|
+
{/if}
|
|
188
|
+
</div>
|
|
189
|
+
<style>
|
|
190
|
+
|
|
191
|
+
.input-container{
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
transition-property: transform opacity;
|
|
195
|
+
transition-duration: .2s;
|
|
196
|
+
transition-timing-function: ease-out;
|
|
197
|
+
user-select: none;
|
|
198
|
+
cursor: text;
|
|
199
|
+
}
|
|
200
|
+
.input-container :global(svg){
|
|
201
|
+
padding: 2px;
|
|
202
|
+
}
|
|
203
|
+
.input-container :global(svg path){
|
|
204
|
+
fill: var(--font-d);
|
|
205
|
+
}
|
|
206
|
+
.input-container input {
|
|
207
|
+
text-align: left;
|
|
208
|
+
}
|
|
209
|
+
.input-container.default .input{
|
|
210
|
+
display: flex;
|
|
211
|
+
flex-direction: column;
|
|
212
|
+
row-gap: 0px;
|
|
213
|
+
}
|
|
214
|
+
.input-container:not(.default) .input {
|
|
215
|
+
display: flex;
|
|
216
|
+
flex-direction: column;
|
|
217
|
+
border-radius: var(--radius);
|
|
218
|
+
background-color: var(--default-bg);
|
|
219
|
+
border: 2px solid var(--default-bg);
|
|
220
|
+
transition-property: background, border;
|
|
221
|
+
transition-duration: .2s;
|
|
222
|
+
transition-timing-function: ease-out;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.input-container:not(.default):has(input:user-invalid) .input {
|
|
226
|
+
border: 2px solid var(--red);
|
|
227
|
+
}
|
|
228
|
+
.input-container:not(.default) .input:hover{
|
|
229
|
+
background-color: var(--bg-3);
|
|
230
|
+
}
|
|
231
|
+
.input-container:not(.default) .input:has(input:focus){
|
|
232
|
+
background-color: var(--bg-1);
|
|
233
|
+
/* border: 2px solid var(--accent); */
|
|
234
|
+
}
|
|
235
|
+
.input svg path {
|
|
236
|
+
fill: var(--font-d);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.input h6{
|
|
240
|
+
color: var(--font-d);
|
|
241
|
+
}
|
|
242
|
+
.input .required{
|
|
243
|
+
color: var(--red);
|
|
244
|
+
}
|
|
245
|
+
.input .top-line {
|
|
246
|
+
display: flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
justify-content: space-between;
|
|
249
|
+
column-gap: var(--pad-m);
|
|
250
|
+
}
|
|
251
|
+
.input .top-line .input-loader{
|
|
252
|
+
position: static;
|
|
253
|
+
}
|
|
254
|
+
.input-container.default .input .input-line{
|
|
255
|
+
border-radius: var(--radius);
|
|
256
|
+
background-color: var(--default-bg);
|
|
257
|
+
border: 2px solid var(--default-bg);
|
|
258
|
+
transition-property: background, border;
|
|
259
|
+
transition-duration: .2s;
|
|
260
|
+
transition-timing-function: ease-out;
|
|
261
|
+
}
|
|
262
|
+
.input-container.default .input:hover .input-line{
|
|
263
|
+
background-color: var(--bg-3);
|
|
264
|
+
}
|
|
265
|
+
.input-container.default .input:has(input:focus) .input-line{
|
|
266
|
+
background-color: var(--bg-1);
|
|
267
|
+
/* border: 2px solid var(--accent); */
|
|
268
|
+
}
|
|
269
|
+
.input-container.default:has(input:user-invalid) .input-line {
|
|
270
|
+
border: 2px solid var(--red);
|
|
271
|
+
}
|
|
272
|
+
.input .input-line{
|
|
273
|
+
display: flex;
|
|
274
|
+
align-items: center;
|
|
275
|
+
column-gap: var(--pad-s);
|
|
276
|
+
}
|
|
277
|
+
.input input {
|
|
278
|
+
color: var(--font-u);
|
|
279
|
+
width: 100%;
|
|
280
|
+
flex: 1;
|
|
281
|
+
font-weight: 300;
|
|
282
|
+
}
|
|
283
|
+
.input input::placeholder{
|
|
284
|
+
color: var(--font-t);
|
|
285
|
+
}
|
|
286
|
+
.input .input-line svg {
|
|
287
|
+
height: var(--icon-size);
|
|
288
|
+
width: auto;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.input.error{
|
|
292
|
+
border: 2px solid var(--red) !important;
|
|
293
|
+
border-radius: var(--radius);
|
|
294
|
+
}
|
|
295
|
+
.input-container .error-message {
|
|
296
|
+
color: var(--red);
|
|
297
|
+
margin-left: 4px;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.input-container:has(input:disabled) .input {
|
|
301
|
+
opacity: 0.6;
|
|
302
|
+
cursor: not-allowed;
|
|
303
|
+
}
|
|
304
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let letter= "";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<kbd class="kbd h6" {...$$restProps}>
|
|
6
|
+
{#if letter}
|
|
7
|
+
{letter}
|
|
8
|
+
{:else}
|
|
9
|
+
<slot/>
|
|
10
|
+
{/if}
|
|
11
|
+
</kbd>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
.kbd{
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
padding: var(--pad-xs) var(--pad-s);
|
|
17
|
+
background-color: var(--bg-3);
|
|
18
|
+
border: 1px solid var(--stroke);
|
|
19
|
+
color: var(--font-d);
|
|
20
|
+
border-radius: var(--radius-m);
|
|
21
|
+
font-weight: 300;
|
|
22
|
+
color: var(--font-u);
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let href = '';
|
|
3
|
+
export let style = '';
|
|
4
|
+
export let className = '';
|
|
5
|
+
export let label = '';
|
|
6
|
+
export let target = '';
|
|
7
|
+
export let onClick = null;
|
|
8
|
+
|
|
9
|
+
function handleClick() {
|
|
10
|
+
if (onClick) {
|
|
11
|
+
onClick()
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<a on:click={handleClick} {href} {style} {target} class="link h4 {className}" {...$$restProps}>
|
|
17
|
+
{#if label}
|
|
18
|
+
{label}
|
|
19
|
+
{:else}
|
|
20
|
+
<slot />
|
|
21
|
+
{/if}
|
|
22
|
+
</a>
|
|
23
|
+
|
|
24
|
+
<style>
|
|
25
|
+
.link {
|
|
26
|
+
color: var(--accent);
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
transition: opacity 0.2s ease-out;
|
|
29
|
+
text-decoration: none;
|
|
30
|
+
font-weight: 300;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.link:hover {
|
|
34
|
+
opacity: 0.7;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<ul class="list">
|
|
4
|
+
<slot/>
|
|
5
|
+
</ul>
|
|
6
|
+
|
|
7
|
+
<style>
|
|
8
|
+
.list{
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
padding: var(--pad-xxl);
|
|
12
|
+
row-gap: var(--pad-xl);
|
|
13
|
+
}
|
|
14
|
+
.list :global(li) {
|
|
15
|
+
margin-left: 7px;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--pad-xs);
|
|
19
|
+
}
|
|
20
|
+
.list :global(li > *:not(p)){
|
|
21
|
+
transform: translateX(-7px);
|
|
22
|
+
}
|
|
23
|
+
.list :global(li > *:not(p))::before{
|
|
24
|
+
content: '• ';
|
|
25
|
+
}
|
|
26
|
+
.list :global(li > *) {
|
|
27
|
+
margin-top: 7px;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let size = "50px"; // Taille par défaut en pixels
|
|
3
|
+
export let width = "3px"; // Taille par défaut en pixels
|
|
4
|
+
export let color = "var(--font-d)"; // Taille par défaut en pixels
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class="loader" style="--loader-color:{color};width: {size}; height: {size}; border-width: {width};"></div>
|
|
8
|
+
|
|
9
|
+
<style>
|
|
10
|
+
.loader {
|
|
11
|
+
border: 4px solid rgba(124, 124, 124, 0.1); /* Couleur du contour de base */
|
|
12
|
+
border-left-color: var(--loader-color); /* Couleur principale */
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
animation: spin 1s linear infinite;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@keyframes spin {
|
|
18
|
+
0% {
|
|
19
|
+
transform: rotate(0deg);
|
|
20
|
+
}
|
|
21
|
+
100% {
|
|
22
|
+
transform: rotate(360deg);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Loader } from './Loader.svelte';
|
|
@@ -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}>
|
|
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,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let width = "max-content"
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="content-container" style="--width:{width};">
|
|
6
|
+
<slot/>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<style>
|
|
10
|
+
.content-container{
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
row-gap: var(--pad-m);
|
|
14
|
+
padding: var(--pad-m) var(--pad-l);
|
|
15
|
+
background-color: var(--bg-2);
|
|
16
|
+
border-radius: var(--radius-l);
|
|
17
|
+
border: 1px solid var(--bg-3);
|
|
18
|
+
width: min(100vw, var(--width));
|
|
19
|
+
max-height: 100vh;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h4><slot/></h4>
|