@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.
Files changed (99) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/era-ui.css +1 -1
  3. package/dist/eslint/index.d.ts +55 -0
  4. package/dist/eslint/index.js +77 -0
  5. package/dist/eslint/rules-core.d.ts +14 -0
  6. package/dist/eslint/rules-core.js +111 -0
  7. package/dist/index.d.ts +1 -1
  8. package/dist/os/desktop.svelte +42 -11
  9. package/dist/os/desktop.svelte.d.ts +16 -0
  10. package/dist/ui/accordion/accordion-trigger.svelte +2 -2
  11. package/dist/ui/accordion/accordion-trigger.svelte.d.ts +2 -2
  12. package/dist/ui/alert-dialog/alert-dialog-content.svelte +6 -2
  13. package/dist/ui/alert-dialog/alert-dialog-content.svelte.d.ts +2 -2
  14. package/dist/ui/alert-dialog/alert-dialog-root.svelte +33 -0
  15. package/dist/ui/alert-dialog/alert-dialog-root.svelte.d.ts +8 -0
  16. package/dist/ui/alert-dialog/alert-dialog-trigger.svelte +8 -0
  17. package/dist/ui/alert-dialog/index.d.ts +1 -1
  18. package/dist/ui/alert-dialog/index.js +1 -1
  19. package/dist/ui/combobox/combobox-trigger.svelte +2 -2
  20. package/dist/ui/combobox/combobox-trigger.svelte.d.ts +2 -2
  21. package/dist/ui/context-menu/context-menu-content.svelte +6 -2
  22. package/dist/ui/context-menu/context-menu-content.svelte.d.ts +2 -2
  23. package/dist/ui/context-menu/context-menu-root.svelte +33 -0
  24. package/dist/ui/context-menu/context-menu-root.svelte.d.ts +8 -0
  25. package/dist/ui/context-menu/context-menu-sub-content.svelte +6 -2
  26. package/dist/ui/context-menu/context-menu-sub-content.svelte.d.ts +2 -2
  27. package/dist/ui/context-menu/context-menu-sub-trigger.svelte +2 -2
  28. package/dist/ui/context-menu/context-menu-sub-trigger.svelte.d.ts +2 -2
  29. package/dist/ui/context-menu/context-menu-trigger.svelte +8 -0
  30. package/dist/ui/context-menu/index.d.ts +1 -1
  31. package/dist/ui/context-menu/index.js +1 -1
  32. package/dist/ui/date-picker/date-picker-trigger.svelte +2 -2
  33. package/dist/ui/date-picker/date-picker-trigger.svelte.d.ts +2 -2
  34. package/dist/ui/date-range-picker/date-range-picker-trigger.svelte +2 -2
  35. package/dist/ui/date-range-picker/date-range-picker-trigger.svelte.d.ts +2 -2
  36. package/dist/ui/dialog/dialog-content.svelte +16 -2
  37. package/dist/ui/dialog/dialog-content.svelte.d.ts +2 -2
  38. package/dist/ui/dialog/dialog-root.svelte +43 -0
  39. package/dist/ui/dialog/dialog-root.svelte.d.ts +8 -0
  40. package/dist/ui/dialog/dialog-trigger.svelte +10 -0
  41. package/dist/ui/dialog/index.d.ts +1 -1
  42. package/dist/ui/dialog/index.js +1 -1
  43. package/dist/ui/dropdown-menu/dropdown-menu-content.svelte +6 -2
  44. package/dist/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +2 -2
  45. package/dist/ui/dropdown-menu/dropdown-menu-root.svelte +33 -0
  46. package/dist/ui/dropdown-menu/dropdown-menu-root.svelte.d.ts +8 -0
  47. package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte +6 -2
  48. package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +2 -2
  49. package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +2 -2
  50. package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +2 -2
  51. package/dist/ui/dropdown-menu/dropdown-menu-trigger.svelte +10 -2
  52. package/dist/ui/dropdown-menu/dropdown-menu-trigger.svelte.d.ts +2 -2
  53. package/dist/ui/dropdown-menu/index.d.ts +1 -1
  54. package/dist/ui/dropdown-menu/index.js +1 -1
  55. package/dist/ui/index.d.ts +1 -0
  56. package/dist/ui/index.js +1 -0
  57. package/dist/ui/link-preview/index.d.ts +1 -1
  58. package/dist/ui/link-preview/index.js +1 -1
  59. package/dist/ui/link-preview/link-preview-content.svelte +6 -2
  60. package/dist/ui/link-preview/link-preview-content.svelte.d.ts +2 -2
  61. package/dist/ui/link-preview/link-preview-root.svelte +33 -0
  62. package/dist/ui/link-preview/link-preview-root.svelte.d.ts +8 -0
  63. package/dist/ui/link-preview/link-preview-trigger.svelte +8 -0
  64. package/dist/ui/menubar/menubar-content.svelte +6 -2
  65. package/dist/ui/menubar/menubar-content.svelte.d.ts +2 -2
  66. package/dist/ui/menubar/menubar-root.svelte +26 -1
  67. package/dist/ui/menubar/menubar-root.svelte.d.ts +1 -1
  68. package/dist/ui/menubar/menubar-sub-content.svelte +6 -2
  69. package/dist/ui/menubar/menubar-sub-content.svelte.d.ts +2 -2
  70. package/dist/ui/menubar/menubar-sub-trigger.svelte +2 -2
  71. package/dist/ui/menubar/menubar-sub-trigger.svelte.d.ts +2 -2
  72. package/dist/ui/nav/index.d.ts +2 -0
  73. package/dist/ui/nav/index.js +2 -0
  74. package/dist/ui/nav/nav-bar.svelte +51 -0
  75. package/dist/ui/nav/nav-bar.svelte.d.ts +21 -0
  76. package/dist/ui/nav/nav-item.svelte +79 -0
  77. package/dist/ui/nav/nav-item.svelte.d.ts +29 -0
  78. package/dist/ui/provider/axes.d.ts +14 -1
  79. package/dist/ui/provider/axis-relay.svelte.d.ts +34 -0
  80. package/dist/ui/provider/axis-relay.svelte.js +109 -0
  81. package/dist/ui/select/select-content.svelte +2 -2
  82. package/dist/ui/select/select-content.svelte.d.ts +2 -2
  83. package/dist/ui/select/select-trigger.svelte +2 -2
  84. package/dist/ui/select/select-trigger.svelte.d.ts +2 -2
  85. package/dist/ui/sheet/sheet-content.svelte +8 -2
  86. package/dist/ui/sheet/sheet-content.svelte.d.ts +2 -2
  87. package/dist/ui/step/step-content.svelte +2 -2
  88. package/dist/ui/step/step-content.svelte.d.ts +2 -2
  89. package/dist/ui/step/step-summary.svelte +2 -2
  90. package/dist/ui/step/step-summary.svelte.d.ts +2 -2
  91. package/dist/ui/tooltip/index.d.ts +1 -1
  92. package/dist/ui/tooltip/index.js +1 -1
  93. package/dist/ui/tooltip/tooltip-content.svelte +6 -2
  94. package/dist/ui/tooltip/tooltip-content.svelte.d.ts +2 -2
  95. package/dist/ui/tooltip/tooltip-root.svelte +33 -0
  96. package/dist/ui/tooltip/tooltip-root.svelte.d.ts +8 -0
  97. package/dist/ui/tooltip/tooltip-trigger.svelte +8 -0
  98. package/dist/utils/index.d.ts +36 -3
  99. 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 PartProps } from '../../utils/index.js';
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
- }: PartProps<Tooltip.ContentProps> = $props();
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 PartProps } from '../../utils/index.js';
3
- declare const TooltipContent: import("svelte").Component<PartProps<Tooltip.ContentProps>, {}, "ref">;
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} />
@@ -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
- /** Props for a bits-ui part wrapper that renders its own `children`. */
13
- export type PartProps<T> = WithoutChildrenOrChild<T> & {
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": "22.0.0",
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",