@signal9/era-ui 22.0.0 → 23.1.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/CHANGELOG.md +32 -0
- package/dist/era-ui.css +1 -1
- package/dist/eslint/index.d.ts +55 -0
- package/dist/eslint/index.js +77 -0
- package/dist/eslint/rules-core.d.ts +14 -0
- package/dist/eslint/rules-core.js +111 -0
- package/dist/index.d.ts +1 -1
- package/dist/os/desktop.svelte +42 -11
- package/dist/os/desktop.svelte.d.ts +16 -0
- package/dist/ui/accordion/accordion-trigger.svelte +2 -2
- package/dist/ui/accordion/accordion-trigger.svelte.d.ts +2 -2
- package/dist/ui/alert-dialog/alert-dialog-content.svelte +6 -2
- package/dist/ui/alert-dialog/alert-dialog-content.svelte.d.ts +2 -2
- package/dist/ui/alert-dialog/alert-dialog-root.svelte +33 -0
- package/dist/ui/alert-dialog/alert-dialog-root.svelte.d.ts +8 -0
- package/dist/ui/alert-dialog/alert-dialog-trigger.svelte +8 -0
- package/dist/ui/alert-dialog/index.d.ts +1 -1
- package/dist/ui/alert-dialog/index.js +1 -1
- package/dist/ui/combobox/combobox-trigger.svelte +2 -2
- package/dist/ui/combobox/combobox-trigger.svelte.d.ts +2 -2
- package/dist/ui/context-menu/context-menu-content.svelte +6 -2
- package/dist/ui/context-menu/context-menu-content.svelte.d.ts +2 -2
- package/dist/ui/context-menu/context-menu-root.svelte +33 -0
- package/dist/ui/context-menu/context-menu-root.svelte.d.ts +8 -0
- package/dist/ui/context-menu/context-menu-sub-content.svelte +6 -2
- package/dist/ui/context-menu/context-menu-sub-content.svelte.d.ts +2 -2
- package/dist/ui/context-menu/context-menu-sub-trigger.svelte +2 -2
- package/dist/ui/context-menu/context-menu-sub-trigger.svelte.d.ts +2 -2
- package/dist/ui/context-menu/context-menu-trigger.svelte +8 -0
- package/dist/ui/context-menu/index.d.ts +1 -1
- package/dist/ui/context-menu/index.js +1 -1
- package/dist/ui/date-picker/date-picker-trigger.svelte +2 -2
- package/dist/ui/date-picker/date-picker-trigger.svelte.d.ts +2 -2
- package/dist/ui/date-range-picker/date-range-picker-trigger.svelte +2 -2
- package/dist/ui/date-range-picker/date-range-picker-trigger.svelte.d.ts +2 -2
- package/dist/ui/dialog/dialog-content.svelte +16 -2
- package/dist/ui/dialog/dialog-content.svelte.d.ts +2 -2
- package/dist/ui/dialog/dialog-root.svelte +43 -0
- package/dist/ui/dialog/dialog-root.svelte.d.ts +8 -0
- package/dist/ui/dialog/dialog-trigger.svelte +10 -0
- package/dist/ui/dialog/index.d.ts +1 -1
- package/dist/ui/dialog/index.js +1 -1
- package/dist/ui/dropdown-menu/dropdown-menu-content.svelte +6 -2
- package/dist/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +2 -2
- package/dist/ui/dropdown-menu/dropdown-menu-root.svelte +33 -0
- package/dist/ui/dropdown-menu/dropdown-menu-root.svelte.d.ts +8 -0
- package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte +6 -2
- package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +2 -2
- package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +2 -2
- package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +2 -2
- package/dist/ui/dropdown-menu/dropdown-menu-trigger.svelte +10 -2
- package/dist/ui/dropdown-menu/dropdown-menu-trigger.svelte.d.ts +2 -2
- package/dist/ui/dropdown-menu/index.d.ts +1 -1
- package/dist/ui/dropdown-menu/index.js +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +1 -0
- package/dist/ui/link-preview/index.d.ts +1 -1
- package/dist/ui/link-preview/index.js +1 -1
- package/dist/ui/link-preview/link-preview-content.svelte +6 -2
- package/dist/ui/link-preview/link-preview-content.svelte.d.ts +2 -2
- package/dist/ui/link-preview/link-preview-root.svelte +33 -0
- package/dist/ui/link-preview/link-preview-root.svelte.d.ts +8 -0
- package/dist/ui/link-preview/link-preview-trigger.svelte +8 -0
- package/dist/ui/menubar/menubar-content.svelte +6 -2
- package/dist/ui/menubar/menubar-content.svelte.d.ts +2 -2
- package/dist/ui/menubar/menubar-root.svelte +26 -1
- package/dist/ui/menubar/menubar-root.svelte.d.ts +1 -1
- package/dist/ui/menubar/menubar-sub-content.svelte +6 -2
- package/dist/ui/menubar/menubar-sub-content.svelte.d.ts +2 -2
- package/dist/ui/menubar/menubar-sub-trigger.svelte +2 -2
- package/dist/ui/menubar/menubar-sub-trigger.svelte.d.ts +2 -2
- package/dist/ui/nav/index.d.ts +2 -0
- package/dist/ui/nav/index.js +2 -0
- package/dist/ui/nav/nav-bar.svelte +51 -0
- package/dist/ui/nav/nav-bar.svelte.d.ts +21 -0
- package/dist/ui/nav/nav-item.svelte +79 -0
- package/dist/ui/nav/nav-item.svelte.d.ts +29 -0
- package/dist/ui/provider/axes.d.ts +14 -1
- package/dist/ui/provider/axis-relay.svelte.d.ts +34 -0
- package/dist/ui/provider/axis-relay.svelte.js +109 -0
- package/dist/ui/select/select-content.svelte +2 -2
- package/dist/ui/select/select-content.svelte.d.ts +2 -2
- package/dist/ui/select/select-trigger.svelte +2 -2
- package/dist/ui/select/select-trigger.svelte.d.ts +2 -2
- package/dist/ui/sheet/sheet-content.svelte +8 -2
- package/dist/ui/sheet/sheet-content.svelte.d.ts +2 -2
- package/dist/ui/step/step-content.svelte +2 -2
- package/dist/ui/step/step-content.svelte.d.ts +2 -2
- package/dist/ui/step/step-summary.svelte +2 -2
- package/dist/ui/step/step-summary.svelte.d.ts +2 -2
- package/dist/ui/tooltip/index.d.ts +1 -1
- package/dist/ui/tooltip/index.js +1 -1
- package/dist/ui/tooltip/tooltip-content.svelte +6 -2
- package/dist/ui/tooltip/tooltip-content.svelte.d.ts +2 -2
- package/dist/ui/tooltip/tooltip-root.svelte +33 -0
- package/dist/ui/tooltip/tooltip-root.svelte.d.ts +8 -0
- package/dist/ui/tooltip/tooltip-trigger.svelte +8 -0
- package/dist/utils/index.d.ts +36 -3
- package/package.json +10 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { getAxisRelay } from '../provider/axis-relay.svelte.js';
|
|
2
3
|
import { Tooltip } from 'bits-ui';
|
|
3
|
-
import { cn, type
|
|
4
|
+
import { cn, type OwnedPartProps } from '../../utils/index.js';
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
ref = $bindable(null),
|
|
@@ -8,12 +9,15 @@
|
|
|
8
9
|
class: className,
|
|
9
10
|
sideOffset = 4,
|
|
10
11
|
...restProps
|
|
11
|
-
}:
|
|
12
|
+
}: OwnedPartProps<Tooltip.ContentProps> = $props();
|
|
13
|
+
|
|
14
|
+
const relay = getAxisRelay();
|
|
12
15
|
</script>
|
|
13
16
|
|
|
14
17
|
<Tooltip.Portal>
|
|
15
18
|
<Tooltip.Content
|
|
16
19
|
bind:ref
|
|
20
|
+
{...relay?.attrs}
|
|
17
21
|
class={cn(
|
|
18
22
|
'z-overlay inline-flex h-pill items-center gap-gutter rounded-pill bg-elevated px-inset-pill text-body leading-none whitespace-nowrap text-fg shadow-lg glass-blur has-[svg]:gap-inset-pill',
|
|
19
23
|
className
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tooltip } from 'bits-ui';
|
|
2
|
-
import { type
|
|
3
|
-
declare const TooltipContent: import("svelte").Component<
|
|
2
|
+
import { type OwnedPartProps } from '../../utils/index.js';
|
|
3
|
+
declare const TooltipContent: import("svelte").Component<OwnedPartProps<Tooltip.ContentProps>, {}, "ref">;
|
|
4
4
|
type TooltipContent = ReturnType<typeof TooltipContent>;
|
|
5
5
|
export default TooltipContent;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { Tooltip } from 'bits-ui';
|
|
4
|
+
import { setAxisRelay } from '../provider/axis-relay.svelte.js';
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* era owns Root ONLY to open the axis channel — it renders no DOM, adds no
|
|
8
|
+
* behaviour and forwards everything. There has to BE a component here: a
|
|
9
|
+
* re-export (`export const Root = Tooltip.Root`) has nowhere to put a context,
|
|
10
|
+
* which is exactly why the axes could not cross the portal before.
|
|
11
|
+
*
|
|
12
|
+
* `open` is re-declared bindable because a spread cannot carry a two-way
|
|
13
|
+
* binding, so wrapping a primitive breaks `bind:open` at every call site
|
|
14
|
+
* unless the wrapper states it.
|
|
15
|
+
*/
|
|
16
|
+
let {
|
|
17
|
+
open = $bindable(false),
|
|
18
|
+
children,
|
|
19
|
+
...restProps
|
|
20
|
+
}: Tooltip.RootProps & { children?: Snippet } = $props();
|
|
21
|
+
|
|
22
|
+
const relay = setAxisRelay();
|
|
23
|
+
|
|
24
|
+
// Capture on OPEN, not on mount: bits-ui mounts content eagerly and toggles
|
|
25
|
+
// it, so a mount-time read runs once at page load and never again.
|
|
26
|
+
$effect(() => {
|
|
27
|
+
if (open) relay.refresh();
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<Tooltip.Root bind:open {...restProps}>
|
|
32
|
+
{@render children?.()}
|
|
33
|
+
</Tooltip.Root>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import { Tooltip } from 'bits-ui';
|
|
3
|
+
type $$ComponentProps = Tooltip.RootProps & {
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const TooltipRoot: import("svelte").Component<$$ComponentProps, {}, "open">;
|
|
7
|
+
type TooltipRoot = ReturnType<typeof TooltipRoot>;
|
|
8
|
+
export default TooltipRoot;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { getAxisRelay } from '../provider/axis-relay.svelte.js';
|
|
2
3
|
import { Tooltip } from 'bits-ui';
|
|
3
4
|
|
|
4
5
|
let { ref = $bindable(null), class: className, ...restProps }: Tooltip.TriggerProps = $props();
|
|
6
|
+
|
|
7
|
+
// The trigger is the last node still inside the subtree, so it is the
|
|
8
|
+
// anchor the axes are read FROM when the content opens.
|
|
9
|
+
const relay = getAxisRelay();
|
|
10
|
+
$effect(() => {
|
|
11
|
+
relay?.register(ref);
|
|
12
|
+
});
|
|
5
13
|
</script>
|
|
6
14
|
|
|
7
15
|
<Tooltip.Trigger bind:ref class={className} {...restProps} />
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ClassValue } from 'clsx';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { WithoutChildrenOrChild } from 'bits-ui';
|
|
3
|
+
import type { WithoutChildren, WithoutChildrenOrChild } from 'bits-ui';
|
|
4
4
|
/**
|
|
5
5
|
* Merges class lists with Tailwind conflict resolution (last wins).
|
|
6
6
|
* Accepts Svelte's full `ClassValue` shape (strings, arrays, objects).
|
|
@@ -9,8 +9,41 @@ export declare function cn(...inputs: ClassValue[]): string;
|
|
|
9
9
|
/** `tv` preconfigured with this library's tailwind-merge settings. */
|
|
10
10
|
export declare const tv: import("tailwind-variants").TV;
|
|
11
11
|
export type { VariantProps } from 'tailwind-variants';
|
|
12
|
-
/**
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Props for a bits-ui part that era only RESTYLES — it forwards `children` and
|
|
14
|
+
* adds classes, and renders no markup of its own.
|
|
15
|
+
*
|
|
16
|
+
* `child` is kept. It is bits-ui's escape hatch: the snippet receives the props
|
|
17
|
+
* the part would have rendered, and the caller renders their own element with
|
|
18
|
+
* them — a Trigger as an `<a>`, a Content as a custom component. era used to
|
|
19
|
+
* strip it from every part, which made the whole library strictly less capable
|
|
20
|
+
* than the primitives it wraps, for no reason on these 18: era contributes a
|
|
21
|
+
* class string, and bits-ui hands that class straight to the `child` snippet's
|
|
22
|
+
* props, so the escape hatch keeps era's styling on the way out. It already
|
|
23
|
+
* worked at runtime — `child` rode in on restProps and bits-ui checks it before
|
|
24
|
+
* `children` — so the only thing stopping anyone was this type.
|
|
25
|
+
*
|
|
26
|
+
* A part where era renders chrome of its own takes {@link OwnedPartProps}.
|
|
27
|
+
*/
|
|
28
|
+
export type PartProps<T> = WithoutChildren<T> & {
|
|
29
|
+
children?: Snippet;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Props for a bits-ui part whose markup era OWNS — a trigger that renders its
|
|
33
|
+
* own chevron, a content that renders its own overlay, a summary with a status
|
|
34
|
+
* spinner.
|
|
35
|
+
*
|
|
36
|
+
* `child` is withheld here, and the reason is that it cannot be honoured. The
|
|
37
|
+
* snippet replaces the element era was going to render, and era's extra markup
|
|
38
|
+
* lives INSIDE that element, so taking over rendering drops the chevron, the
|
|
39
|
+
* overlay or the indicator with no error and no visual clue — era's signature
|
|
40
|
+
* failure mode. Better to refuse it in the type than to accept it and quietly
|
|
41
|
+
* render something else.
|
|
42
|
+
*
|
|
43
|
+
* If you need the underlying element, reach for the primitive directly:
|
|
44
|
+
* `import { Select } from 'bits-ui'`. era wraps, it does not replace.
|
|
45
|
+
*/
|
|
46
|
+
export type OwnedPartProps<T> = WithoutChildrenOrChild<T> & {
|
|
14
47
|
children?: Snippet;
|
|
15
48
|
};
|
|
16
49
|
export { hotkeys, keys, parseKeybinding, matchKeyBindingPress, createKeybindingsHandler, formatKeybinding, isApplePlatform, modKey, type KeyBindingMap, type KeyBindingPress, type KeyBindingOptions } from './hotkeys.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signal9/era-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.1.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev --host",
|
|
6
6
|
"build": "vite build && npm run prepack",
|
|
@@ -25,12 +25,13 @@
|
|
|
25
25
|
"check:classes": "node --experimental-strip-types scripts/check-classes.ts",
|
|
26
26
|
"check:twmerge": "node --experimental-strip-types scripts/check-twmerge.ts",
|
|
27
27
|
"build:llm-docs": "node --experimental-strip-types scripts/build-llm-docs.ts",
|
|
28
|
-
"prebuild": "npm run check:surfaces && npm run check:tokens && npm run check:routes && npm run check:canonical && npm run check:layers && npm run check:themes && npm run check:classes && npm run check:twmerge && npm run check:doc-tokens && npm run check:audit-controls && npm run check:specimen-coverage && npm run build:llm-docs",
|
|
29
|
-
"validate": "npm run check && npm run lint && npm run format:check && npm run check:surfaces && npm run check:tokens && npm run check:routes && npm run check:canonical && npm run check:layers && npm run check:themes && npm run check:classes && npm run check:twmerge && npm run check:doc-tokens && npm run check:audit-controls && npm run check:specimen-coverage",
|
|
28
|
+
"prebuild": "npm run check:surfaces && npm run check:tokens && npm run check:routes && npm run check:canonical && npm run check:layers && npm run check:themes && npm run check:classes && npm run check:twmerge && npm run check:doc-tokens && npm run check:audit-controls && npm run check:specimen-coverage && npm run check:eslint-rules && npm run build:llm-docs",
|
|
29
|
+
"validate": "npm run check && npm run lint && npm run format:check && npm run check:surfaces && npm run check:tokens && npm run check:routes && npm run check:canonical && npm run check:layers && npm run check:themes && npm run check:classes && npm run check:twmerge && npm run check:doc-tokens && npm run check:audit-controls && npm run check:specimen-coverage && npm run check:eslint-rules",
|
|
30
30
|
"test": "npm run test:visual",
|
|
31
31
|
"check:doc-tokens": "node --experimental-strip-types scripts/check-doc-tokens.ts",
|
|
32
32
|
"check:audit-controls": "node --experimental-strip-types scripts/check-audit-controls.ts",
|
|
33
|
-
"check:specimen-coverage": "node --experimental-strip-types scripts/check-specimen-coverage.ts"
|
|
33
|
+
"check:specimen-coverage": "node --experimental-strip-types scripts/check-specimen-coverage.ts",
|
|
34
|
+
"check:eslint-rules": "node --experimental-strip-types scripts/check-eslint-rules.ts"
|
|
34
35
|
},
|
|
35
36
|
"files": [
|
|
36
37
|
"dist",
|
|
@@ -87,7 +88,11 @@
|
|
|
87
88
|
"./styles/themes": "./dist/styles/themes.css",
|
|
88
89
|
"./css": "./dist/era-ui.css",
|
|
89
90
|
"./utilities.json": "./dist/generated-docs/utilities.json",
|
|
90
|
-
"./package.json": "./package.json"
|
|
91
|
+
"./package.json": "./package.json",
|
|
92
|
+
"./eslint": {
|
|
93
|
+
"types": "./dist/eslint/index.d.ts",
|
|
94
|
+
"default": "./dist/eslint/index.js"
|
|
95
|
+
}
|
|
91
96
|
},
|
|
92
97
|
"peerDependencies": {
|
|
93
98
|
"@neodrag/svelte": "3.0.0-next.10",
|