@okaapp/oka-ui-sv 0.2.1 → 0.4.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.
- package/README.md +3 -0
- package/dist/components/aaengine-set/auto-buton/AutoButton.svelte +47 -0
- package/dist/components/aaengine-set/auto-buton/AutoButton.svelte.d.ts +10 -0
- package/dist/components/aaengine-set/auto-buton/auto-button.css +82 -0
- package/dist/components/aaengine-set/engine-orb/EngineOrb.svelte +97 -0
- package/dist/components/aaengine-set/engine-orb/EngineOrb.svelte.d.ts +19 -0
- package/dist/components/aaengine-set/engine-orb/engine-orb.css +52 -0
- package/dist/components/core/dialog/Dialog.svelte +12 -1
- package/dist/components/core/dialog/Dialog.svelte.d.ts +1 -0
- package/dist/components/core/dialog/dialog.css +22 -2
- package/dist/components/core/input/Input.svelte +5 -1
- package/dist/components/core/input/Input.svelte.d.ts +4 -1
- package/dist/components/core/input/input.css +0 -1
- package/dist/components/core/pin-input/PinInput.svelte +38 -0
- package/dist/components/core/pin-input/PinInput.svelte.d.ts +5 -0
- package/dist/components/core/pin-input/pin-input.css +103 -0
- package/dist/components/core/tooltips/Tooltips.svelte +28 -0
- package/dist/components/core/tooltips/Tooltips.svelte.d.ts +9 -25
- package/dist/components/core/tooltips/tooltips.css +37 -0
- package/dist/components/illustrations/SVG31.svelte +4 -4
- package/dist/components/styling/oka-style-provider/OKAStyleProvider.svelte +4 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,12 +76,15 @@ OKA UI comes with several built-in themes:
|
|
|
76
76
|
- Badge
|
|
77
77
|
- Button
|
|
78
78
|
- Checkbox
|
|
79
|
+
- Dialog
|
|
79
80
|
- Input
|
|
80
81
|
- Loading
|
|
81
82
|
- Pagination
|
|
83
|
+
- PinInput
|
|
82
84
|
- Select (Single & Multi)
|
|
83
85
|
- Separator
|
|
84
86
|
- Sidebar
|
|
87
|
+
- Tooltips
|
|
85
88
|
|
|
86
89
|
### Usage Example
|
|
87
90
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import "./auto-button.css";
|
|
3
|
+
import EngineOrb from "../engine-orb/EngineOrb.svelte";
|
|
4
|
+
|
|
5
|
+
type props = {
|
|
6
|
+
label: string;
|
|
7
|
+
onclick?: any;
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
label,
|
|
14
|
+
onclick,
|
|
15
|
+
isLoading = false,
|
|
16
|
+
disabled = false,
|
|
17
|
+
...restProps
|
|
18
|
+
}: props = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<button
|
|
22
|
+
class={`auto-button ${isLoading && "auto-button__loading"} ${disabled && "auto-button__disabled"}`}
|
|
23
|
+
{onclick}
|
|
24
|
+
disabled={disabled || onclick}
|
|
25
|
+
{...restProps}
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
class={`auto-button-inner ${isLoading && "auto-button-inner__loading"}`}
|
|
29
|
+
>
|
|
30
|
+
<EngineOrb />
|
|
31
|
+
<div class="auto-button__content">
|
|
32
|
+
<span
|
|
33
|
+
class={`auto-button__title ${isLoading && "auto-button__title__loading"} ${disabled && "auto-button__title__disabled"}`}
|
|
34
|
+
>
|
|
35
|
+
{#if isLoading}
|
|
36
|
+
Chờ chút nha...
|
|
37
|
+
{:else}
|
|
38
|
+
{label}
|
|
39
|
+
{/if}
|
|
40
|
+
</span>
|
|
41
|
+
<span
|
|
42
|
+
class={`auto-button__subtitle ${isLoading && "auto-button__subtitle__loading"} ${disabled && "auto-button__subtitle__disabled"}`}
|
|
43
|
+
>Powered by AA.Engine</span
|
|
44
|
+
>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</button>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./auto-button.css";
|
|
2
|
+
type props = {
|
|
3
|
+
label: string;
|
|
4
|
+
onclick?: any;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const AutoButton: import("svelte").Component<props, {}, "">;
|
|
9
|
+
type AutoButton = ReturnType<typeof AutoButton>;
|
|
10
|
+
export default AutoButton;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
.auto-button {
|
|
2
|
+
border-radius: 80px;
|
|
3
|
+
background-color: var(--surface-primary);
|
|
4
|
+
border: 1px solid var(--accent-primary);
|
|
5
|
+
padding: 8px 20px 8px 8px;
|
|
6
|
+
width: fit-content;
|
|
7
|
+
transition: all;
|
|
8
|
+
transition-duration: 200ms;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.auto-button:hover {
|
|
13
|
+
border: 1px solid var(--accent-secondary);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.auto-button:active {
|
|
17
|
+
scale: 0.98;
|
|
18
|
+
background-color: var(--surface-secondary-surface);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.auto-button__loading {
|
|
22
|
+
animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
23
|
+
border: 1px solid var(--stroke-light);
|
|
24
|
+
cursor: wait;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.auto-button__loading:hover {
|
|
28
|
+
border: 1px solid var(--stroke-light);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.auto-button__disabled {
|
|
32
|
+
border: 1px solid var(--stroke-light);
|
|
33
|
+
cursor: not-allowed;
|
|
34
|
+
filter: grayscale(100%)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.auto-button__disabled:hover {
|
|
38
|
+
border: 1px solid var(--stroke-light);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.auto-button-inner {
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: flex-start;
|
|
44
|
+
align-items: center;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
gap: 8px;
|
|
47
|
+
width: fit-content;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.auto-button__content {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
align-items: flex-start;
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
position: relative;
|
|
57
|
+
width: fit-content;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.auto-button__title {
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
font-size: 16px;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
text-align: left;
|
|
65
|
+
color: var(--content-secondary);
|
|
66
|
+
line-height: 1.5;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.auto-button__subtitle {
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
font-size: 12px;
|
|
72
|
+
font-weight: 300;
|
|
73
|
+
text-align: left;
|
|
74
|
+
color: var(--stroke-bold);
|
|
75
|
+
line-height: 1.5;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@keyframes pulse {
|
|
79
|
+
50% {
|
|
80
|
+
opacity: 0.5;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import "./engine-orb.css";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="spinning-container">
|
|
6
|
+
<svg
|
|
7
|
+
width="48"
|
|
8
|
+
height="48"
|
|
9
|
+
viewBox="0 0 48 48"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
class="w-12 h-12 relative"
|
|
13
|
+
preserveAspectRatio="xMidYMid meet"
|
|
14
|
+
>
|
|
15
|
+
<g clip-path="url(#clip0_761_1252)">
|
|
16
|
+
<ellipse
|
|
17
|
+
class="liquid-0"
|
|
18
|
+
cx="24"
|
|
19
|
+
cy="38.5"
|
|
20
|
+
rx="16"
|
|
21
|
+
ry="9.5"
|
|
22
|
+
fill="url(#paint0_radial_761_1252)"
|
|
23
|
+
style="animation: liquid1 8s linear infinite; filter: blur(4px);"
|
|
24
|
+
></ellipse>
|
|
25
|
+
<ellipse
|
|
26
|
+
class="liquid-1"
|
|
27
|
+
cx="24"
|
|
28
|
+
cy="13.5"
|
|
29
|
+
rx="22"
|
|
30
|
+
ry="13.5"
|
|
31
|
+
fill="url(#paint1_radial_761_1252)"
|
|
32
|
+
style="animation: liquid2 8s linear infinite; filter: blur(4px);"
|
|
33
|
+
></ellipse>
|
|
34
|
+
<foreignObject x="-8" y="-8" width="63.9297" height="64"
|
|
35
|
+
><div
|
|
36
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
|
37
|
+
style="backdrop-filter:blur(4px);clip-path:url(#bgblur_1_761_1252_clip_path);height:100%;width:100%"
|
|
38
|
+
></div></foreignObject
|
|
39
|
+
>
|
|
40
|
+
<ellipse
|
|
41
|
+
data-figma-bg-blur-radius="8"
|
|
42
|
+
cx="23.9646"
|
|
43
|
+
cy="24"
|
|
44
|
+
rx="23.9646"
|
|
45
|
+
ry="24"
|
|
46
|
+
fill="var(--surface-primary, #fff)"
|
|
47
|
+
fill-opacity="0.16"
|
|
48
|
+
></ellipse>
|
|
49
|
+
</g>
|
|
50
|
+
<defs>
|
|
51
|
+
<clipPath
|
|
52
|
+
id="bgblur_1_761_1252_clip_path"
|
|
53
|
+
transform="translate(8 8)"
|
|
54
|
+
>
|
|
55
|
+
<ellipse cx="23.9646" cy="24" rx="23.9646" ry="24"></ellipse>
|
|
56
|
+
</clipPath>
|
|
57
|
+
<radialGradient
|
|
58
|
+
id="paint0_radial_761_1252"
|
|
59
|
+
cx="0"
|
|
60
|
+
cy="0"
|
|
61
|
+
r="1"
|
|
62
|
+
gradientUnits="userSpaceOnUse"
|
|
63
|
+
gradientTransform="translate(24 38.5) rotate(90) scale(15.4375 26)"
|
|
64
|
+
>
|
|
65
|
+
<stop stop-color="var(--accent-secondary, #4750FF)"></stop>
|
|
66
|
+
<stop
|
|
67
|
+
offset="1"
|
|
68
|
+
stop-color="var(--accent-secondary, #4750FF)"
|
|
69
|
+
stop-opacity="0"
|
|
70
|
+
></stop>
|
|
71
|
+
</radialGradient>
|
|
72
|
+
<radialGradient
|
|
73
|
+
id="paint1_radial_761_1252"
|
|
74
|
+
cx="0"
|
|
75
|
+
cy="0"
|
|
76
|
+
r="1"
|
|
77
|
+
gradientUnits="userSpaceOnUse"
|
|
78
|
+
gradientTransform="translate(24 13.5) rotate(90) scale(20.25 33)"
|
|
79
|
+
>
|
|
80
|
+
<stop stop-color="var(--accent-primary, #58C4F5)"></stop>
|
|
81
|
+
<stop
|
|
82
|
+
offset="1"
|
|
83
|
+
stop-color="var(--accent-primary, #58C4F5)"
|
|
84
|
+
stop-opacity="0"
|
|
85
|
+
></stop>
|
|
86
|
+
</radialGradient>
|
|
87
|
+
<clipPath id="clip0_761_1252">
|
|
88
|
+
<rect
|
|
89
|
+
width="48"
|
|
90
|
+
height="48"
|
|
91
|
+
rx="24"
|
|
92
|
+
fill="var(--surface-primary, #fff)"
|
|
93
|
+
></rect>
|
|
94
|
+
</clipPath>
|
|
95
|
+
</defs>
|
|
96
|
+
</svg>
|
|
97
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "./engine-orb.css";
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const EngineOrb: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type EngineOrb = InstanceType<typeof EngineOrb>;
|
|
19
|
+
export default EngineOrb;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@keyframes spin {
|
|
2
|
+
from {
|
|
3
|
+
transform: rotate(0deg);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
to {
|
|
7
|
+
transform: rotate(360deg);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@keyframes liquid1 {
|
|
12
|
+
|
|
13
|
+
0%,
|
|
14
|
+
100% {
|
|
15
|
+
transform: scale(0.8) translateX(0) translateY(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
50% {
|
|
19
|
+
transform: scale(1.4) translateX(4px) translateY(-2px);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes liquid2 {
|
|
24
|
+
|
|
25
|
+
0%,
|
|
26
|
+
100% {
|
|
27
|
+
transform: scale(1.4) translateX(0) translateY(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
50% {
|
|
31
|
+
transform: scale(0.7) translateX(-2px) translateY(1px);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.liquid-0 {
|
|
36
|
+
transform-origin: 24px 38.5px;
|
|
37
|
+
animation: liquid1 8s ease-in-out infinite;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.liquid-1 {
|
|
41
|
+
transform-origin: 24px 13.5px;
|
|
42
|
+
animation: liquid2 8s ease-in-out infinite;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.spinning-container {
|
|
46
|
+
width: 48px;
|
|
47
|
+
height: 48px;
|
|
48
|
+
border-radius: 9999px !important;
|
|
49
|
+
overflow: clip;
|
|
50
|
+
animation: spin 8s linear infinite;
|
|
51
|
+
transform-origin: 24px 24px;
|
|
52
|
+
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
description?: Snippet;
|
|
13
13
|
contentProps?: WithoutChild<Dialog.ContentProps>;
|
|
14
14
|
actionButtons?: Snippet;
|
|
15
|
+
size?: "sm" | "md" | "lg";
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
let {
|
|
@@ -23,8 +24,15 @@
|
|
|
23
24
|
subtitle,
|
|
24
25
|
description,
|
|
25
26
|
actionButtons,
|
|
27
|
+
size = "md",
|
|
26
28
|
...restProps
|
|
27
29
|
}: Props = $props();
|
|
30
|
+
|
|
31
|
+
const sizeClass = {
|
|
32
|
+
sm: "dialog-content--sm",
|
|
33
|
+
md: "dialog-content--md",
|
|
34
|
+
lg: "dialog-content--lg",
|
|
35
|
+
};
|
|
28
36
|
</script>
|
|
29
37
|
|
|
30
38
|
<Dialog.Root bind:open {...restProps}>
|
|
@@ -33,7 +41,10 @@
|
|
|
33
41
|
</Dialog.Trigger>
|
|
34
42
|
<Dialog.Portal>
|
|
35
43
|
<Dialog.Overlay class="dialog-overlay" />
|
|
36
|
-
<Dialog.Content
|
|
44
|
+
<Dialog.Content
|
|
45
|
+
{...contentProps}
|
|
46
|
+
class={`dialog-content ${sizeClass[size]}`}
|
|
47
|
+
>
|
|
37
48
|
<div class="dialog-topbar">
|
|
38
49
|
<div class="dialog-topbar-content">
|
|
39
50
|
<Dialog.Title class="dialog-title">
|
|
@@ -8,6 +8,7 @@ type Props = Dialog.RootProps & {
|
|
|
8
8
|
description?: Snippet;
|
|
9
9
|
contentProps?: WithoutChild<Dialog.ContentProps>;
|
|
10
10
|
actionButtons?: Snippet;
|
|
11
|
+
size?: "sm" | "md" | "lg";
|
|
11
12
|
};
|
|
12
13
|
declare const Dialog: import("svelte").Component<Props, {}, "open">;
|
|
13
14
|
type Dialog = ReturnType<typeof Dialog>;
|
|
@@ -21,11 +21,32 @@
|
|
|
21
21
|
width: fit-content;
|
|
22
22
|
max-width: 800px;
|
|
23
23
|
min-width: 480px;
|
|
24
|
+
max-height: calc(100vh - 48px);
|
|
24
25
|
border-radius: 12px;
|
|
25
26
|
background-color: var(--surface-primary);
|
|
26
27
|
transform: translate(-50%, -50%);
|
|
27
28
|
outline: none;
|
|
28
29
|
overflow: clip;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.dialog-content--sm {
|
|
35
|
+
width: 480px;
|
|
36
|
+
min-width: 480px;
|
|
37
|
+
max-width: 480px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.dialog-content--md {
|
|
41
|
+
width: 600px;
|
|
42
|
+
min-width: 600px;
|
|
43
|
+
max-width: 600px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.dialog-content--lg {
|
|
47
|
+
width: 800px;
|
|
48
|
+
min-width: 800px;
|
|
49
|
+
max-width: 800px;
|
|
29
50
|
}
|
|
30
51
|
|
|
31
52
|
.dialog-content[data-state="open"] {
|
|
@@ -83,9 +104,8 @@
|
|
|
83
104
|
.dialog-body {
|
|
84
105
|
display: flex;
|
|
85
106
|
flex-direction: column;
|
|
86
|
-
width:
|
|
107
|
+
width: 100%;
|
|
87
108
|
min-width: 480px;
|
|
88
|
-
max-width: 480px;
|
|
89
109
|
padding: 16px;
|
|
90
110
|
gap: 16px;
|
|
91
111
|
}
|
|
@@ -17,9 +17,12 @@
|
|
|
17
17
|
placeholder = "Nhập vào đây",
|
|
18
18
|
ref = $bindable(null),
|
|
19
19
|
value = $bindable(),
|
|
20
|
+
invalid = $bindable(false),
|
|
20
21
|
class: className,
|
|
21
22
|
...restProps
|
|
22
|
-
}: Props
|
|
23
|
+
}: Props & {
|
|
24
|
+
invalid?: boolean;
|
|
25
|
+
} = $props();
|
|
23
26
|
</script>
|
|
24
27
|
|
|
25
28
|
<input
|
|
@@ -27,6 +30,7 @@
|
|
|
27
30
|
bind:this={ref}
|
|
28
31
|
data-slot="input"
|
|
29
32
|
class="input focus-override"
|
|
33
|
+
class:input--invalid={invalid}
|
|
30
34
|
style="font: inherit;"
|
|
31
35
|
bind:value
|
|
32
36
|
{...restProps}
|
|
@@ -9,6 +9,9 @@ type Props = WithElementRef<Omit<HTMLInputAttributes, "type"> & ({
|
|
|
9
9
|
type?: InputType;
|
|
10
10
|
files?: undefined;
|
|
11
11
|
})>;
|
|
12
|
-
|
|
12
|
+
type $$ComponentProps = Props & {
|
|
13
|
+
invalid?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const Input: import("svelte").Component<$$ComponentProps, {}, "ref" | "value" | "invalid">;
|
|
13
16
|
type Input = ReturnType<typeof Input>;
|
|
14
17
|
export default Input;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import "./pin-input.css";
|
|
3
|
+
import { PinInput, type WithoutChildrenOrChild } from "bits-ui";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
value = $bindable(""),
|
|
8
|
+
maxlength = 6,
|
|
9
|
+
disabled = false,
|
|
10
|
+
...props
|
|
11
|
+
}: WithoutChildrenOrChild<PinInput.RootProps> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<PinInput.Root
|
|
15
|
+
{maxlength}
|
|
16
|
+
bind:value
|
|
17
|
+
bind:ref
|
|
18
|
+
{disabled}
|
|
19
|
+
class={`pin-input-root ${disabled ? "pin-input--disabled" : ""}`}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
{#snippet children({ cells })}
|
|
23
|
+
<div class="pin-input">
|
|
24
|
+
{#each cells as cell, i (i)}
|
|
25
|
+
<PinInput.Cell {cell} class="pin-input__cell">
|
|
26
|
+
{#if cell.char !== null}
|
|
27
|
+
<div class="pin-input__char">
|
|
28
|
+
{cell.char}
|
|
29
|
+
</div>
|
|
30
|
+
{/if}
|
|
31
|
+
{#if cell.hasFakeCaret}
|
|
32
|
+
<div class="pin-input__caret"></div>
|
|
33
|
+
{/if}
|
|
34
|
+
</PinInput.Cell>
|
|
35
|
+
{/each}
|
|
36
|
+
</div>
|
|
37
|
+
{/snippet}
|
|
38
|
+
</PinInput.Root>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
.pin-input {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 8px;
|
|
4
|
+
align-items: center;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.pin-input--disabled {
|
|
8
|
+
opacity: 0.5;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pin-input__cell {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
width: 48px;
|
|
17
|
+
height: 48px;
|
|
18
|
+
font-size: 20px;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
border: 2px solid var(--stroke-light);
|
|
21
|
+
background-color: var(--surface-primary);
|
|
22
|
+
color: var(--content-primary);
|
|
23
|
+
border-radius: 12px;
|
|
24
|
+
transition: all 300ms ease;
|
|
25
|
+
outline: none;
|
|
26
|
+
cursor: text;
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.pin-input .pin-input__cell:hover {
|
|
31
|
+
border-color: var(--stroke-medium) !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.pin-input__cell:hover {
|
|
35
|
+
border-color: var(--stroke-medium) !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.pin-input__cell[data-active] {
|
|
39
|
+
border-color: var(--accent-primary);
|
|
40
|
+
background-color: var(--surface-secondary);
|
|
41
|
+
box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.pin-input__cell[data-inactive] {
|
|
45
|
+
border-color: var(--stroke-light);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Caret animation for the active cell */
|
|
49
|
+
.pin-input__caret {
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 2px;
|
|
52
|
+
height: 24px;
|
|
53
|
+
background-color: var(--accent-primary);
|
|
54
|
+
animation: caret-blink 1s ease-in-out infinite;
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@keyframes caret-blink {
|
|
59
|
+
|
|
60
|
+
0%,
|
|
61
|
+
49% {
|
|
62
|
+
opacity: 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
50%,
|
|
66
|
+
100% {
|
|
67
|
+
opacity: 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Root container adjustments */
|
|
72
|
+
.pin-input-root {
|
|
73
|
+
display: flex;
|
|
74
|
+
gap: 8px;
|
|
75
|
+
position: relative;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.pin-input-root[disabled] .pin-input__cell {
|
|
79
|
+
background-color: var(--surface-tertiary);
|
|
80
|
+
border-color: var(--stroke-muted);
|
|
81
|
+
color: var(--content-tertiary);
|
|
82
|
+
cursor: not-allowed;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.pin-input-root[disabled] .pin-input__cell:hover {
|
|
86
|
+
border-color: var(--stroke-muted);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Text character styling */
|
|
90
|
+
.pin-input__char {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
font-variant: tabular-nums;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Focus visible state */
|
|
100
|
+
.pin-input__cell:focus-visible {
|
|
101
|
+
outline: 2px solid var(--accent-primary);
|
|
102
|
+
outline-offset: 2px;
|
|
103
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import "./tooltips.css";
|
|
3
|
+
import { Tooltip } from "bits-ui";
|
|
4
|
+
import type { Snippet } from "svelte";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
trigger,
|
|
9
|
+
delayDuration = 200,
|
|
10
|
+
...props
|
|
11
|
+
}: Tooltip.RootProps & {
|
|
12
|
+
trigger: Snippet;
|
|
13
|
+
children: Snippet;
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<Tooltip.Provider delayDuration={200}>
|
|
18
|
+
<Tooltip.Root {delayDuration} {...props}>
|
|
19
|
+
<Tooltip.Trigger class="tooltip-trigger">
|
|
20
|
+
{@render trigger()}
|
|
21
|
+
</Tooltip.Trigger>
|
|
22
|
+
<Tooltip.Portal>
|
|
23
|
+
<Tooltip.Content class="tooltip-content" sideOffset={8}>
|
|
24
|
+
{@render children()}
|
|
25
|
+
</Tooltip.Content>
|
|
26
|
+
</Tooltip.Portal>
|
|
27
|
+
</Tooltip.Root>
|
|
28
|
+
</Tooltip.Provider>
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
$$bindings?: string | undefined;
|
|
1
|
+
import "./tooltips.css";
|
|
2
|
+
import { Tooltip } from "bits-ui";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
type $$ComponentProps = Tooltip.RootProps & {
|
|
5
|
+
trigger: Snippet;
|
|
6
|
+
children: Snippet;
|
|
8
7
|
};
|
|
9
|
-
declare const Tooltips:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
8
|
+
declare const Tooltips: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type Tooltips = ReturnType<typeof Tooltips>;
|
|
10
|
+
export default Tooltips;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.tooltip-trigger {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
cursor: help;
|
|
6
|
+
outline: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.tooltip-content {
|
|
10
|
+
background-color: var(--content-primary);
|
|
11
|
+
color: var(--content-inversed);
|
|
12
|
+
padding: 12px 12px;
|
|
13
|
+
border-radius: 12px;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
max-width: 200px;
|
|
17
|
+
word-wrap: break-word;
|
|
18
|
+
/* box-shadow: 0 0 12px rgba(0, 0, 0, 0.12); */
|
|
19
|
+
animation: tooltip-in 200ms ease-out;
|
|
20
|
+
z-index: 1000;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes tooltip-in {
|
|
24
|
+
from {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
transform: scale(0.95);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
to {
|
|
30
|
+
opacity: 1;
|
|
31
|
+
transform: scale(1);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tooltip-provider {
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
><g style="fill:#000" class="frame-children"
|
|
22
22
|
><path
|
|
23
23
|
d="M81.902 130.6c28.001 0 50.702-22.7 50.702-50.8S109.904 29 81.902 29c-28 0-50.7 22.7-50.7 50.8s22.7 50.8 50.7 50.8"
|
|
24
|
-
style="fill: var(--
|
|
24
|
+
style="fill: var(--stroke-muted, #f3f3f4);fill-opacity:1"
|
|
25
25
|
class="fills"
|
|
26
26
|
/><path
|
|
27
27
|
d="M111.346 36.635c1.508 0 2.784 1.155 2.784 2.77v81.727c0 1.501-1.16 2.771-2.784 2.771H50.908c-1.508 0-2.784-1.155-2.784-2.77V39.405c0-1.5 1.16-2.77 2.784-2.77z"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
class="fills"
|
|
38
38
|
/><path
|
|
39
39
|
d="M111.114 42.984a.913.913 0 0 0-.928-.923H52.185c-.465 0-.93.346-.93.923.697 29.897.93 63.719-2.32 72.492l55.567-.808c3.364-15.237 5.916-42.595 6.612-71.684"
|
|
40
|
-
style="fill: var(--
|
|
40
|
+
style="fill: var(--stroke-muted, #f3f3f4);fill-opacity:1"
|
|
41
41
|
class="fills"
|
|
42
42
|
/><g filter="url(#a)" style="fill:#000"
|
|
43
43
|
><defs
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
/></g
|
|
82
82
|
><path
|
|
83
83
|
d="M109.374 75.883c-1.624 28.165-26.797 34.053-29.812 34.399-1.393.115-4.061.346-8.817.346 12.528-5.772 19.257-16.16 19.14-24.24 6.033.46 16.473 0 19.489-10.505"
|
|
84
|
-
style="fill: var(--
|
|
84
|
+
style="fill: var(--stroke-muted, #f3f3f4);fill-opacity:1"
|
|
85
85
|
class="fills"
|
|
86
86
|
/><defs
|
|
87
87
|
><linearGradient
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
class="fills"
|
|
104
104
|
/><path
|
|
105
105
|
d="M81.07 36.982c.927 0 1.623-.693 1.623-1.616s-.696-1.616-1.624-1.616c-.927 0-1.624.692-1.624 1.616 0 .923.812 1.616 1.624 1.616"
|
|
106
|
-
style="fill: var(--
|
|
106
|
+
style="fill: var(--stroke-muted, #f3f3f4);fill-opacity:1"
|
|
107
107
|
class="fills"
|
|
108
108
|
/><path
|
|
109
109
|
d="M94.758 40.445c-.348 1.962-1.973 3.578-4.06 3.578H71.44c-2.088 0-3.712-1.616-4.06-3.578z"
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import "./oka-style.css";
|
|
3
|
+
import { Tooltip } from "bits-ui";
|
|
3
4
|
let { children, ...props } = $props();
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
<div id="oka-style-container" {...props}>
|
|
7
|
-
|
|
8
|
+
<Tooltip.Provider>
|
|
9
|
+
{@render children()}
|
|
10
|
+
</Tooltip.Provider>
|
|
8
11
|
</div>
|
package/dist/index.d.ts
CHANGED
|
@@ -6,12 +6,16 @@ export { default as Dialog } from './components/core/dialog/Dialog.svelte';
|
|
|
6
6
|
export { default as Input } from './components/core/input/Input.svelte';
|
|
7
7
|
export { default as Loading } from './components/core/loading/Loading.svelte';
|
|
8
8
|
export { default as Pagination } from './components/core/pagination/Pagination.svelte';
|
|
9
|
+
export { default as PinInput } from './components/core/pin-input/PinInput.svelte';
|
|
9
10
|
export { default as SingleSelect } from './components/core/select/SingleSelect.svelte';
|
|
10
11
|
export { default as MultiSelect } from './components/core/select/MultiSelect.svelte';
|
|
11
12
|
export { default as Separator } from './components/core/separator/Separator.svelte';
|
|
12
13
|
export { default as Sidebar } from './components/core/sidebar/Sidebar.svelte';
|
|
14
|
+
export { default as Tooltips } from './components/core/tooltips/Tooltips.svelte';
|
|
13
15
|
export { default as OKAStyleProvider } from './components/styling/oka-style-provider/OKAStyleProvider.svelte';
|
|
14
16
|
export { default as ThemeSwitcher } from './components/styling/theme-switcher/ThemeSwitcher.svelte';
|
|
17
|
+
export { default as AutoButton } from './components/aaengine-set/auto-buton/AutoButton.svelte';
|
|
18
|
+
export { default as EngineOrb } from './components/aaengine-set/engine-orb/EngineOrb.svelte';
|
|
15
19
|
export { default as SVG31 } from './components/illustrations/SVG31.svelte';
|
|
16
20
|
export type * from './components/core/select/Types.js';
|
|
17
21
|
export type * from './components/core/sidebar/Types.js';
|
package/dist/index.js
CHANGED
|
@@ -7,12 +7,17 @@ export { default as Dialog } from './components/core/dialog/Dialog.svelte';
|
|
|
7
7
|
export { default as Input } from './components/core/input/Input.svelte';
|
|
8
8
|
export { default as Loading } from './components/core/loading/Loading.svelte';
|
|
9
9
|
export { default as Pagination } from './components/core/pagination/Pagination.svelte';
|
|
10
|
+
export { default as PinInput } from './components/core/pin-input/PinInput.svelte';
|
|
10
11
|
export { default as SingleSelect } from './components/core/select/SingleSelect.svelte';
|
|
11
12
|
export { default as MultiSelect } from './components/core/select/MultiSelect.svelte';
|
|
12
13
|
export { default as Separator } from './components/core/separator/Separator.svelte';
|
|
13
14
|
export { default as Sidebar } from './components/core/sidebar/Sidebar.svelte';
|
|
15
|
+
export { default as Tooltips } from './components/core/tooltips/Tooltips.svelte';
|
|
14
16
|
// Styling & theming
|
|
15
17
|
export { default as OKAStyleProvider } from './components/styling/oka-style-provider/OKAStyleProvider.svelte';
|
|
16
18
|
export { default as ThemeSwitcher } from './components/styling/theme-switcher/ThemeSwitcher.svelte';
|
|
19
|
+
// AA Engine components
|
|
20
|
+
export { default as AutoButton } from './components/aaengine-set/auto-buton/AutoButton.svelte';
|
|
21
|
+
export { default as EngineOrb } from './components/aaengine-set/engine-orb/EngineOrb.svelte';
|
|
17
22
|
// Misc
|
|
18
23
|
export { default as SVG31 } from './components/illustrations/SVG31.svelte';
|