bits-ui 0.13.1 → 0.13.2

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.
@@ -1,5 +1,5 @@
1
1
  <script>import { getCtx } from "../ctx.js";
2
- import { srOnlyStyles } from "../../../internal/style.js";
2
+ import { getSrOnlyStyles } from "../../../internal/style.js";
3
3
  export let el = void 0;
4
4
  const {
5
5
  states: { value },
@@ -14,7 +14,7 @@ function getValue(value2) {
14
14
  }
15
15
  const attrs = {
16
16
  ...getAttrs("input"),
17
- style: srOnlyStyles
17
+ style: getSrOnlyStyles()
18
18
  };
19
19
  $:
20
20
  inputValue = getValue($value);
@@ -1,4 +1,4 @@
1
- export declare const kbd: {
1
+ export declare function getKbd(): {
2
2
  ALT: string;
3
3
  ARROW_DOWN: string;
4
4
  ARROW_LEFT: string;
@@ -1,35 +1,37 @@
1
- export const kbd = {
2
- ALT: "Alt",
3
- ARROW_DOWN: "ArrowDown",
4
- ARROW_LEFT: "ArrowLeft",
5
- ARROW_RIGHT: "ArrowRight",
6
- ARROW_UP: "ArrowUp",
7
- BACKSPACE: "Backspace",
8
- CAPS_LOCK: "CapsLock",
9
- CONTROL: "Control",
10
- DELETE: "Delete",
11
- END: "End",
12
- ENTER: "Enter",
13
- ESCAPE: "Escape",
14
- F1: "F1",
15
- F10: "F10",
16
- F11: "F11",
17
- F12: "F12",
18
- F2: "F2",
19
- F3: "F3",
20
- F4: "F4",
21
- F5: "F5",
22
- F6: "F6",
23
- F7: "F7",
24
- F8: "F8",
25
- F9: "F9",
26
- HOME: "Home",
27
- META: "Meta",
28
- PAGE_DOWN: "PageDown",
29
- PAGE_UP: "PageUp",
30
- SHIFT: "Shift",
31
- SPACE: " ",
32
- TAB: "Tab",
33
- CTRL: "Control",
34
- ASTERISK: "*"
35
- };
1
+ export function getKbd() {
2
+ return {
3
+ ALT: "Alt",
4
+ ARROW_DOWN: "ArrowDown",
5
+ ARROW_LEFT: "ArrowLeft",
6
+ ARROW_RIGHT: "ArrowRight",
7
+ ARROW_UP: "ArrowUp",
8
+ BACKSPACE: "Backspace",
9
+ CAPS_LOCK: "CapsLock",
10
+ CONTROL: "Control",
11
+ DELETE: "Delete",
12
+ END: "End",
13
+ ENTER: "Enter",
14
+ ESCAPE: "Escape",
15
+ F1: "F1",
16
+ F10: "F10",
17
+ F11: "F11",
18
+ F12: "F12",
19
+ F2: "F2",
20
+ F3: "F3",
21
+ F4: "F4",
22
+ F5: "F5",
23
+ F6: "F6",
24
+ F7: "F7",
25
+ F8: "F8",
26
+ F9: "F9",
27
+ HOME: "Home",
28
+ META: "Meta",
29
+ PAGE_DOWN: "PageDown",
30
+ PAGE_UP: "PageUp",
31
+ SHIFT: "Shift",
32
+ SPACE: " ",
33
+ TAB: "Tab",
34
+ CTRL: "Control",
35
+ ASTERISK: "*"
36
+ };
37
+ }
@@ -1,3 +1,2 @@
1
1
  export declare function styleToString(style: Record<string, number | string | undefined>): string;
2
- export declare const srOnlyStyles: string;
3
- export declare const hiddenInputStyles: string;
2
+ export declare function getSrOnlyStyles(): string;
@@ -5,23 +5,16 @@ export function styleToString(style) {
5
5
  return str + `${key}:${style[key]};`;
6
6
  }, "");
7
7
  }
8
- export const srOnlyStyles = styleToString({
9
- position: "absolute",
10
- width: "1px",
11
- height: "1px",
12
- padding: "0",
13
- margin: "-1px",
14
- overflow: "hidden",
15
- clip: "rect(0, 0, 0, 0)",
16
- whiteSpace: "nowrap",
17
- borderWidth: "0"
18
- });
19
- export const hiddenInputStyles = styleToString({
20
- position: "absolute",
21
- width: "25px",
22
- height: "25px",
23
- opacity: "0",
24
- margin: "0px",
25
- pointerEvents: "none",
26
- transform: "translateX(-100%)"
27
- });
8
+ export function getSrOnlyStyles() {
9
+ return styleToString({
10
+ position: "absolute",
11
+ width: "1px",
12
+ height: "1px",
13
+ padding: "0",
14
+ margin: "-1px",
15
+ overflow: "hidden",
16
+ clip: "rect(0, 0, 0, 0)",
17
+ whiteSpace: "nowrap",
18
+ borderWidth: "0"
19
+ });
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bits-ui",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "license": "MIT",
5
5
  "repository": "github:huntabyte/bits-ui",
6
6
  "exports": {
@@ -1,10 +0,0 @@
1
- <script>import { styleToString } from ".";
2
- </script>
3
-
4
- <div
5
- style={styleToString({
6
- position: "fixed",
7
- inset: 0,
8
- "z-index": 50
9
- })}
10
- />
@@ -1,14 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: Record<string, never>;
4
- events: {
5
- [evt: string]: CustomEvent<any>;
6
- };
7
- slots: {};
8
- };
9
- export type OverlayProps = typeof __propDef.props;
10
- export type OverlayEvents = typeof __propDef.events;
11
- export type OverlaySlots = typeof __propDef.slots;
12
- export default class Overlay extends SvelteComponent<OverlayProps, OverlayEvents, OverlaySlots> {
13
- }
14
- export {};