hamzus-ui 0.0.106 → 0.0.108

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.d.ts CHANGED
@@ -33,6 +33,7 @@ export * as Tabs from "./src/components/hamzus-ui/Tabs"
33
33
 
34
34
  // data
35
35
  export * as Table from "./src/components/hamzus-ui/Table"
36
+ export * as DataList from "./src/components/hamzus-ui/DataList"
36
37
  export { default as Skeleton } from "./src/components/hamzus-ui/Skeleton/Skeleton.svelte"
37
38
  export { default as LineLoader } from "./src/components/hamzus-ui/LineLoader/LineLoader.svelte"
38
39
  export { default as ProgressCircle } from "./src/components/hamzus-ui/ProgressCircle/ProgressCircle.svelte"
package/index.js CHANGED
@@ -30,6 +30,7 @@ export * as Tabs from "./src/components/hamzus-ui/Tabs"
30
30
 
31
31
  // data
32
32
  export * as Table from "./src/components/hamzus-ui/Table"
33
+ export * as DataList from "./src/components/hamzus-ui/DataList"
33
34
  export { default as Skeleton } from "./src/components/hamzus-ui/Skeleton/Skeleton.svelte"
34
35
  export { default as LineLoader } from "./src/components/hamzus-ui/LineLoader/LineLoader.svelte"
35
36
  export { default as ProgressCircle } from "./src/components/hamzus-ui/ProgressCircle/ProgressCircle.svelte"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hamzus-ui",
3
- "version": "0.0.106",
3
+ "version": "0.0.108",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "svelte": "index.js",
@@ -0,0 +1,33 @@
1
+
2
+ <script>
3
+ import IconButton from "../IconButton/IconButton.svelte";
4
+
5
+ export let isOpen
6
+ </script>
7
+
8
+ <div class="accordion-btn {$isOpen ? "open" : ""}">
9
+ <slot/>
10
+ <IconButton variant="ghost">
11
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
12
+ <path d="M11.9995 16.8001C11.2995 16.8001 10.5995 16.5301 10.0695 16.0001L3.54953 9.48014C3.25953 9.19014 3.25953 8.71014 3.54953 8.42014C3.83953 8.13014 4.31953 8.13014 4.60953 8.42014L11.1295 14.9401C11.6095 15.4201 12.3895 15.4201 12.8695 14.9401L19.3895 8.42014C19.6795 8.13014 20.1595 8.13014 20.4495 8.42014C20.7395 8.71014 20.7395 9.19014 20.4495 9.48014L13.9295 16.0001C13.3995 16.5301 12.6995 16.8001 11.9995 16.8001Z" fill="#292D32"/>
13
+ </svg>
14
+ </IconButton>
15
+ </div>
16
+
17
+ <style>
18
+ .accordion-btn{
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: space-between;
22
+ width: 100%;
23
+ padding: var(--pad-m) 0;
24
+ cursor: pointer;
25
+ }
26
+ .accordion-btn svg {
27
+ transition: transform .1s ease-in-out;
28
+ transform: rotate(90deg);
29
+ }
30
+ .accordion-btn.open svg {
31
+ transform: rotate(0deg);
32
+ }
33
+ </style>
@@ -0,0 +1,23 @@
1
+
2
+ <script>
3
+ import { onMount } from "svelte";
4
+
5
+ export let isOpen
6
+
7
+ let element
8
+ </script>
9
+
10
+ <div bind:this={element} style="--height:{element?.scrollHeight ?? "0"}px;" class="content {$isOpen ? "open" : ""}">
11
+ <slot/>
12
+ </div>
13
+
14
+ <style>
15
+ .content {
16
+ max-height: 0px;
17
+ overflow: hidden;
18
+ transition: max-height .2s ease-in;
19
+ }
20
+ .content.open {
21
+ max-height: var(--height);
22
+ }
23
+ </style>
@@ -0,0 +1,21 @@
1
+ <script>
2
+ import Trigger from "./Trigger.svelte";
3
+ import { writable } from "svelte/store";
4
+
5
+ export let isOpen = false
6
+
7
+ const isOpenStore = writable(isOpen)
8
+ </script>
9
+
10
+ <div class="root">
11
+ <slot isOpen={isOpenStore}></slot>
12
+ </div>
13
+
14
+
15
+ <style>
16
+ .root {
17
+ display: flex;
18
+ flex-direction: column;
19
+ width: 100%;
20
+ }
21
+ </style>
@@ -0,0 +1,19 @@
1
+ <script>
2
+ import { getContext } from "svelte";
3
+
4
+ export let isOpen // store
5
+
6
+ function handleClick() {
7
+ isOpen.update((value)=>!value)
8
+ }
9
+ </script>
10
+
11
+ <div class="trigger" onclick={handleClick}>
12
+ <slot/>
13
+ </div>
14
+
15
+ <style>
16
+ .trigger {
17
+ display: inline-block;
18
+ }
19
+ </style>
@@ -0,0 +1,4 @@
1
+ export { default as Root } from './Root.svelte';
2
+ export { default as Trigger } from './Trigger.svelte';
3
+ export { default as Content } from './Content.svelte';
4
+ export { default as Button } from './Button.svelte';
@@ -1,6 +1,8 @@
1
+ <script>
2
+ export let style = ""
3
+ </script>
1
4
 
2
-
3
- <div class="button-group">
5
+ <div class="button-group" {style} {...$$restProps}>
4
6
  <slot></slot>
5
7
  </div>
6
8
 
@@ -0,0 +1,11 @@
1
+ <div class="line" {...$$restProps}>
2
+ <slot/>
3
+ </div>
4
+
5
+ <style>
6
+ .line {
7
+ display: flex;
8
+ justify-content: space-between;
9
+ width: 100%;
10
+ }
11
+ </style>
@@ -0,0 +1,12 @@
1
+ <div class="list" {...$$restProps}>
2
+ <slot/>
3
+ </div>
4
+
5
+ <style>
6
+ .list {
7
+ display: flex;
8
+ flex-direction: column;
9
+ row-gap: var(--pad-m);
10
+ width: 100%;
11
+ }
12
+ </style>
@@ -0,0 +1,9 @@
1
+ <div class="separator" {...$$restProps}></div>
2
+
3
+ <style>
4
+ .separator {
5
+ width: 100%;
6
+ height: 1px;
7
+ background-color: var(--stroke);
8
+ }
9
+ </style>
@@ -0,0 +1,3 @@
1
+ export { default as Root } from './Root.svelte';
2
+ export { default as Line } from './Line.svelte';
3
+ export { default as Separator } from './Separator.svelte';
@@ -2,7 +2,7 @@
2
2
  <script>
3
3
  import Slider from "@hamzus-ui/Slider/Slider.svelte";
4
4
  import Exemple from "../../../../components/docComponent/Exemple/Exemple.svelte";
5
- import DataList from "@hamzus-ui/DataList/DataList.svelte";
5
+ import DataList from "@hamzus-ui/DataList/Root.svelte";
6
6
  import CopyCode from "@hamzus-ui/CopyCode/CopyCode.svelte";
7
7
  </script>
8
8
 
@@ -1,82 +0,0 @@
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-1);
78
- }
79
- .value{
80
- text-align: right;
81
- }
82
- </style>