milk-lib 0.0.53 → 0.0.55

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.
@@ -0,0 +1,62 @@
1
+ <script lang="ts">
2
+ import type { IButtonOverlayProps } from "./ButtonOverlay.types";
3
+
4
+ let buttonEl: HTMLButtonElement;
5
+
6
+ export const focus = () => buttonEl?.focus();
7
+
8
+ let {
9
+ onClick,
10
+ onMouseEnter,
11
+ onMouseLeave,
12
+ classNames,
13
+ disabled = false,
14
+ type = "button",
15
+ name,
16
+ id,
17
+ style,
18
+ children,
19
+ ...rest
20
+ }: IButtonOverlayProps = $props();
21
+ </script>
22
+
23
+ <button
24
+ bind:this={buttonEl}
25
+ onclick={onClick}
26
+ onmouseenter={onMouseEnter}
27
+ onmouseleave={onMouseLeave}
28
+ disabled={disabled}
29
+ {type}
30
+ {name}
31
+ {id}
32
+ {style}
33
+ class={`ButtonOverlay ${classNames ? classNames : ""}`}
34
+ {...rest}
35
+ >
36
+ {@render children?.()}
37
+ </button>
38
+
39
+ <style>.ButtonOverlay {
40
+ appearance: none;
41
+ background: transparent;
42
+ border: 0;
43
+ padding: 0;
44
+ margin: 0;
45
+ color: inherit;
46
+ font: inherit;
47
+ line-height: inherit;
48
+ text-align: inherit;
49
+ cursor: pointer;
50
+ display: inline-flex;
51
+ align-items: inherit;
52
+ justify-content: inherit;
53
+ }
54
+
55
+ .ButtonOverlay:disabled {
56
+ cursor: not-allowed;
57
+ }
58
+
59
+ .ButtonOverlay:focus,
60
+ .ButtonOverlay:focus-visible {
61
+ outline: none;
62
+ }</style>
@@ -0,0 +1,6 @@
1
+ import type { IButtonOverlayProps } from "./ButtonOverlay.types";
2
+ declare const ButtonOverlay: import("svelte").Component<IButtonOverlayProps, {
3
+ focus: () => void;
4
+ }, "">;
5
+ type ButtonOverlay = ReturnType<typeof ButtonOverlay>;
6
+ export default ButtonOverlay;
@@ -0,0 +1,3 @@
1
+ import type { IButtonProps } from "../Button/Button.types";
2
+ export interface IButtonOverlayProps extends IButtonProps {
3
+ }
@@ -0,0 +1,2 @@
1
+ export { default as ButtonOverlay } from "./ButtonOverlay.svelte";
2
+ export * from "./ButtonOverlay.types";
@@ -0,0 +1,2 @@
1
+ export { default as ButtonOverlay } from "./ButtonOverlay.svelte";
2
+ export * from "./ButtonOverlay.types";
@@ -17,6 +17,7 @@
17
17
  fullWidth,
18
18
  minWidth = 320,
19
19
  animate = false,
20
+ onTransitionEnd,
20
21
  id,
21
22
  children
22
23
  }: IMenuProps = $props();
@@ -85,6 +86,7 @@
85
86
  tabindex={isVisible ? 0 : -1}
86
87
  aria-hidden={!isVisible}
87
88
  onmouseleave={mouseLeaveHandler}
89
+ ontransitionend={onTransitionEnd}
88
90
  bind:this={menuElement}
89
91
  class={`Menu ${isVisible ? "Menu-open" : "Menu-closed"} ${animate ? "Menu-animate" : ""}`}
90
92
  style={`
@@ -11,6 +11,7 @@ export interface IMenuProps {
11
11
  minWidth?: number;
12
12
  fullWidth?: boolean;
13
13
  animate?: boolean;
14
+ onTransitionEnd?: (e: TransitionEvent) => void;
14
15
  id?: string;
15
16
  children: Snippet;
16
17
  }
@@ -5,6 +5,7 @@ export * from './Sidebar';
5
5
  export * from './ThemeProvider';
6
6
  export * from './Button';
7
7
  export * from './ButtonMilk';
8
+ export * from './ButtonOverlay';
8
9
  export * from './Badge';
9
10
  export * from './Label';
10
11
  export * from './TextInput';
@@ -5,6 +5,7 @@ export * from './Sidebar';
5
5
  export * from './ThemeProvider';
6
6
  export * from './Button';
7
7
  export * from './ButtonMilk';
8
+ export * from './ButtonOverlay';
8
9
  export * from './Badge';
9
10
  export * from './Label';
10
11
  export * from './TextInput';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "milk-lib",
3
3
  "license": "MIT",
4
- "version": "0.0.53",
4
+ "version": "0.0.55",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run prepack",