@hyvor/design 0.0.44 → 0.0.47
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/dist/components/ActionList/ActionListItem.svelte +11 -0
- package/dist/components/Button/Button.svelte +0 -1
- package/dist/components/Checkbox/Checkbox.svelte +19 -0
- package/dist/components/Checkbox/Checkbox.svelte.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.svelte +1 -1
- package/dist/components/Modal/Modal.svelte +1 -1
- package/dist/components/Tooltip/Tooltip.svelte +4 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/index.css +7 -0
- package/dist/marketing/Docs/Content/DocsImage.svelte +78 -0
- package/dist/marketing/Docs/Content/DocsImage.svelte.d.ts +19 -0
- package/dist/marketing/index.d.ts +1 -0
- package/dist/marketing/index.js +1 -0
- package/package.json +1 -1
- /package/dist/{directives → components/directives}/clickOutside.d.ts +0 -0
- /package/dist/{directives → components/directives}/clickOutside.js +0 -0
|
@@ -120,4 +120,15 @@ function handleClick() {
|
|
|
120
120
|
color: var(--text-light);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
div.action-list-item.disabled {
|
|
124
|
+
opacity: 0.5;
|
|
125
|
+
cursor: not-allowed;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
div.action-list-item.disabled:hover {
|
|
130
|
+
background-color: transparent;
|
|
131
|
+
pointer-events: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
123
134
|
</style>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script>export let checked = void 0;
|
|
2
2
|
export let group = [];
|
|
3
3
|
export let value = "on";
|
|
4
|
+
export let disabled = false;
|
|
4
5
|
export let input = {};
|
|
5
6
|
function handleChange() {
|
|
7
|
+
if (disabled)
|
|
8
|
+
return;
|
|
6
9
|
const index = group.indexOf(value);
|
|
7
10
|
if (checked === void 0)
|
|
8
11
|
checked = index >= 0;
|
|
@@ -28,6 +31,7 @@ function handleChange() {
|
|
|
28
31
|
type="checkbox"
|
|
29
32
|
bind:checked
|
|
30
33
|
bind:this={input}
|
|
34
|
+
disabled={disabled}
|
|
31
35
|
|
|
32
36
|
on:keyup
|
|
33
37
|
on:keydown
|
|
@@ -127,4 +131,19 @@ function handleChange() {
|
|
|
127
131
|
input:checked ~ span.placeholder:after {
|
|
128
132
|
display:block;
|
|
129
133
|
}
|
|
134
|
+
|
|
135
|
+
/* disabled styles */
|
|
136
|
+
input:disabled ~ span.placeholder {
|
|
137
|
+
background-color: var(--accent-light);
|
|
138
|
+
border: none !important;
|
|
139
|
+
opacity: 0.2;
|
|
140
|
+
cursor: not-allowed;
|
|
141
|
+
box-shadow: none !important;
|
|
142
|
+
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
input:disabled:checked ~ span.placeholder:after {
|
|
146
|
+
display: none;
|
|
147
|
+
pointer-events: none;
|
|
148
|
+
}
|
|
130
149
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import ModalFooter from "./ModalFooter.svelte";
|
|
2
|
-
import { clickOutside } from "
|
|
2
|
+
import { clickOutside } from "../directives/clickOutside.js";
|
|
3
3
|
import { IconX } from "@hyvor/icons";
|
|
4
4
|
import IconButton from "./../IconButton/IconButton.svelte";
|
|
5
5
|
import { fade, scale } from "svelte/transition";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>import { tick, onMount, onDestroy } from "svelte";
|
|
2
|
+
import { fade } from "svelte/transition";
|
|
2
3
|
export let text = "";
|
|
3
4
|
export let position = "top";
|
|
4
5
|
export let color = "black";
|
|
@@ -69,6 +70,7 @@ onMount(() => {
|
|
|
69
70
|
class="tooltip {position}"
|
|
70
71
|
style:max-width={maxWidth + 'px'}
|
|
71
72
|
bind:this={tooltip}
|
|
73
|
+
transition:fade={{duration: 100}}
|
|
72
74
|
>
|
|
73
75
|
{#if $$slots.tooltip}
|
|
74
76
|
<slot name="tooltip" />
|
|
@@ -81,7 +83,8 @@ onMount(() => {
|
|
|
81
83
|
|
|
82
84
|
<style>
|
|
83
85
|
.tooltip-wrap {
|
|
84
|
-
display: inline;
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
85
88
|
position: relative;
|
|
86
89
|
|
|
87
90
|
--local-bg: #24292f;
|
|
@@ -40,3 +40,4 @@ export { default as TextInput } from './TextInput/TextInput.svelte';
|
|
|
40
40
|
export { default as toast } from './Toast/toast.js';
|
|
41
41
|
export { default as Tooltip } from './Tooltip/Tooltip.svelte';
|
|
42
42
|
export { default as IconMessage } from './IconMessage/IconMessage.svelte';
|
|
43
|
+
export { clickOutside } from './directives/clickOutside.js';
|
package/dist/components/index.js
CHANGED
|
@@ -40,3 +40,5 @@ export { default as TextInput } from './TextInput/TextInput.svelte';
|
|
|
40
40
|
export { default as toast } from './Toast/toast.js';
|
|
41
41
|
export { default as Tooltip } from './Tooltip/Tooltip.svelte';
|
|
42
42
|
export { default as IconMessage } from './IconMessage/IconMessage.svelte';
|
|
43
|
+
// directives
|
|
44
|
+
export { clickOutside } from './directives/clickOutside.js';
|
package/dist/index.css
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script>import { scale } from "svelte/transition";
|
|
2
|
+
import { clickOutside } from "../../../components/index.js";
|
|
3
|
+
export let src;
|
|
4
|
+
export let alt;
|
|
5
|
+
export let width = void 0;
|
|
6
|
+
let open = false;
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div class="wrap">
|
|
10
|
+
<img
|
|
11
|
+
{src}
|
|
12
|
+
{alt}
|
|
13
|
+
{...$$restProps}
|
|
14
|
+
{width}
|
|
15
|
+
on:click={() => open = true}
|
|
16
|
+
class="preview"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
{#if open}
|
|
21
|
+
<div
|
|
22
|
+
class="modal"
|
|
23
|
+
>
|
|
24
|
+
<img
|
|
25
|
+
{src}
|
|
26
|
+
{alt}
|
|
27
|
+
{...$$restProps}
|
|
28
|
+
{width}
|
|
29
|
+
use:clickOutside={{
|
|
30
|
+
callback: () => open = false
|
|
31
|
+
}}
|
|
32
|
+
transition:scale={{ duration: 100, opacity: 0.5, start: 0.95 }}
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
{/if}
|
|
36
|
+
|
|
37
|
+
<style>
|
|
38
|
+
img.preview {
|
|
39
|
+
display: block;
|
|
40
|
+
max-width: 100%;
|
|
41
|
+
max-height: 100%;
|
|
42
|
+
margin: 0 auto;
|
|
43
|
+
border-radius: 5px;
|
|
44
|
+
box-shadow: 0 0 10px rgba(0,0,0,0.2);
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
transition: .1s box-shadow;
|
|
47
|
+
}
|
|
48
|
+
img.preview:hover {
|
|
49
|
+
box-shadow: 0 0 15px rgba(0,0,0,0.3);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.modal {
|
|
53
|
+
position: fixed;
|
|
54
|
+
z-index: 1000000;
|
|
55
|
+
left: 0;
|
|
56
|
+
top: 0;
|
|
57
|
+
width: 100%;
|
|
58
|
+
height: 100%;
|
|
59
|
+
background-color: rgba(0,0,0,0.5);
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
padding: 40px;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
}
|
|
66
|
+
.modal-content {
|
|
67
|
+
min-height: 0;
|
|
68
|
+
}
|
|
69
|
+
.modal img {
|
|
70
|
+
max-width: 100%;
|
|
71
|
+
max-height: 100%;
|
|
72
|
+
border-radius: 5px;
|
|
73
|
+
}
|
|
74
|
+
.wrap {
|
|
75
|
+
padding: 25px 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
src: string;
|
|
6
|
+
alt: string;
|
|
7
|
+
width?: undefined | number;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export type DocsImageProps = typeof __propDef.props;
|
|
15
|
+
export type DocsImageEvents = typeof __propDef.events;
|
|
16
|
+
export type DocsImageSlots = typeof __propDef.slots;
|
|
17
|
+
export default class DocsImage extends SvelteComponent<DocsImageProps, DocsImageEvents, DocsImageSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -5,5 +5,6 @@ export { default as DocsNav } from './Docs/Nav/Nav.svelte';
|
|
|
5
5
|
export { default as DocsNavItem } from './Docs/Nav/NavItem.svelte';
|
|
6
6
|
export { default as DocsNavCategory } from './Docs/Nav/NavCategory.svelte';
|
|
7
7
|
export { default as DocsContent } from './Docs/Content/Content.svelte';
|
|
8
|
+
export { default as DocsImage } from './Docs/Content/DocsImage.svelte';
|
|
8
9
|
export { default as Footer } from './Footer/Footer.svelte';
|
|
9
10
|
export { default as FooterLinkList } from './Footer/FooterLinkList.svelte';
|
package/dist/marketing/index.js
CHANGED
|
@@ -5,5 +5,6 @@ export { default as DocsNav } from './Docs/Nav/Nav.svelte';
|
|
|
5
5
|
export { default as DocsNavItem } from './Docs/Nav/NavItem.svelte';
|
|
6
6
|
export { default as DocsNavCategory } from './Docs/Nav/NavCategory.svelte';
|
|
7
7
|
export { default as DocsContent } from './Docs/Content/Content.svelte';
|
|
8
|
+
export { default as DocsImage } from './Docs/Content/DocsImage.svelte';
|
|
8
9
|
export { default as Footer } from './Footer/Footer.svelte';
|
|
9
10
|
export { default as FooterLinkList } from './Footer/FooterLinkList.svelte';
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|