@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.
@@ -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>
@@ -324,7 +324,6 @@ export let button = {};
324
324
  .button.invisible.accent:hover {
325
325
  background-color: var(--accent-light);
326
326
  box-shadow: none !important;
327
- color: var(--text-light);
328
327
  }
329
328
  .button.invisible.gray:hover {
330
329
  background-color: var(--gray-light);
@@ -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>
@@ -5,6 +5,7 @@ declare const __propDef: {
5
5
  checked?: boolean | undefined;
6
6
  group?: (string | number)[] | undefined;
7
7
  value?: string | number | undefined;
8
+ disabled?: boolean | undefined;
8
9
  input?: HTMLInputElement | undefined;
9
10
  };
10
11
  events: {
@@ -1,4 +1,4 @@
1
- <script>import { clickOutside } from "../../directives/clickOutside.js";
1
+ <script>import { clickOutside } from "../directives/clickOutside.js";
2
2
  import Box from "./../Box/Box.svelte";
3
3
  export let show = false;
4
4
  export let width = 225;
@@ -1,5 +1,5 @@
1
1
  <script>import ModalFooter from "./ModalFooter.svelte";
2
- import { clickOutside } from "../../directives/clickOutside.js";
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';
@@ -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
@@ -43,4 +43,11 @@ button, a {
43
43
  box-shadow: var(--box-shadow);
44
44
  border-radius: var(--box-radius);
45
45
  background-color: var(--box-background);
46
+ }
47
+
48
+ .hds-container {
49
+ width: 1000px;
50
+ max-width: 100%;
51
+ padding: 0 15px;
52
+ margin: auto;
46
53
  }
@@ -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';
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyvor/design",
3
- "version": "0.0.44",
3
+ "version": "0.0.47",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "scripts": {