@f-ewald/components 1.41.0 → 1.43.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 (47) hide show
  1. package/README.md +5 -1
  2. package/custom-elements.json +2102 -332
  3. package/dist/autocomplete-input.d.ts +10 -2
  4. package/dist/autocomplete-input.d.ts.map +1 -1
  5. package/dist/autocomplete-input.js +34 -1
  6. package/dist/autocomplete-input.js.map +1 -1
  7. package/dist/dag-graph.d.ts +161 -0
  8. package/dist/dag-graph.d.ts.map +1 -0
  9. package/dist/dag-graph.js +724 -0
  10. package/dist/dag-graph.js.map +1 -0
  11. package/dist/data-table.d.ts +11 -2
  12. package/dist/data-table.d.ts.map +1 -1
  13. package/dist/data-table.js +31 -3
  14. package/dist/data-table.js.map +1 -1
  15. package/dist/icons.d.ts +16 -0
  16. package/dist/icons.d.ts.map +1 -1
  17. package/dist/icons.js +16 -0
  18. package/dist/icons.js.map +1 -1
  19. package/dist/index.d.ts +4 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +3 -0
  22. package/dist/index.js.map +1 -1
  23. package/dist/kind-icon.d.ts +38 -0
  24. package/dist/kind-icon.d.ts.map +1 -0
  25. package/dist/kind-icon.js +87 -0
  26. package/dist/kind-icon.js.map +1 -0
  27. package/dist/tokens.css +4 -0
  28. package/dist/tokens.d.ts.map +1 -1
  29. package/dist/tokens.js +10 -0
  30. package/dist/tokens.js.map +1 -1
  31. package/dist/ui-tooltip.d.ts +49 -0
  32. package/dist/ui-tooltip.d.ts.map +1 -0
  33. package/dist/ui-tooltip.js +317 -0
  34. package/dist/ui-tooltip.js.map +1 -0
  35. package/dist/utils/dag-layout.d.ts +60 -0
  36. package/dist/utils/dag-layout.d.ts.map +1 -0
  37. package/dist/utils/dag-layout.js +80 -0
  38. package/dist/utils/dag-layout.js.map +1 -0
  39. package/docs/autocomplete-input.md +9 -2
  40. package/docs/dag-graph.md +101 -0
  41. package/docs/data-table.md +18 -0
  42. package/docs/design-language.md +4 -1
  43. package/docs/icons.md +8 -0
  44. package/docs/kind-icon.md +53 -0
  45. package/docs/ui-tooltip.md +70 -0
  46. package/llms.txt +150 -2
  47. package/package.json +2 -1
package/llms.txt CHANGED
@@ -33,6 +33,8 @@ table to pick the icon matching a use case, for consistency across apps:
33
33
  | --- | --- | --- |
34
34
  | `iconAcademicCap` | 18px | Education, learning, or certification-related content. |
35
35
  | `iconArrowDownTray` | 16px | Download or export actions. |
36
+ | `iconArrowLongDown` | 18px | A top-to-bottom flow or layout direction. |
37
+ | `iconArrowLongRight` | 18px | A left-to-right flow or layout direction. |
36
38
  | `iconArrowPath` | 12px | Refresh actions, or an animated busy/loading spinner. |
37
39
  | `iconArrowRight` | 12px | "Continue" or forward-progressing actions, e.g. a compact next-step arrow. |
38
40
  | `iconArrowRightOnRectangle` | 16px | Logout/sign-out actions. |
@@ -41,6 +43,7 @@ table to pick the icon matching a use case, for consistency across apps:
41
43
  | `iconArrowsRightLeft` | 16px | Swap, exchange, or compare actions between two items. |
42
44
  | `iconArrowTopRightOnSquare` | 16px | Links that open in a new tab/window, or navigate to an external site. |
43
45
  | `iconBars3` | 18px | A hamburger menu toggle, e.g. collapsing or opening a sidebar/nav drawer. |
46
+ | `iconBookOpen` | 20px | A library, documentation, or reading content, e.g. a library node in dag-graph. |
44
47
  | `iconCalendar` | 16px | Dates, due dates, or calendar-related metadata. |
45
48
  | `iconChatBubbleLeftRight` | 18px | Messaging, comments, or conversation-related content. |
46
49
  | `iconCheckCircle` | 16px | Success states, confirmations, or a selected-item checkmark. |
@@ -55,6 +58,7 @@ table to pick the icon matching a use case, for consistency across apps:
55
58
  | `iconCog` | 20px | Settings, preferences, or configuration entry points. |
56
59
  | `iconComputerDesktop` | 16px | A "system/auto" theme option, or to represent a desktop device. |
57
60
  | `iconCpuChip` | 18px | System, hardware, or technical/processing content. |
61
+ | `iconCube` | 20px | A package or self-contained artifact, e.g. an external package node in dag-graph. |
58
62
  | `iconCurrencyDollar` | 16px | Monetary values, pricing, or billing-related content. |
59
63
  | `iconDocument` | 18px | A generic file/document icon, e.g. tile-grid's default file icon. |
60
64
  | `iconEllipsisHorizontal` | 16px | Collapsed items in an inline sequence, e.g. breadcrumb-nav's truncated middle. |
@@ -73,6 +77,8 @@ table to pick the icon matching a use case, for consistency across apps:
73
77
  | `iconLink` | 16px | Hyperlink-related actions or a linked/associated-item indicator. |
74
78
  | `iconListBullet` | 18px | A list-view toggle, or to represent list-type content. |
75
79
  | `iconMagnifyingGlass` | 16px | Search inputs or search-triggering actions. |
80
+ | `iconMagnifyingGlassMinus` | 18px | Zoom out, e.g. dag-graph's toolbar. |
81
+ | `iconMagnifyingGlassPlus` | 18px | Zoom in, e.g. dag-graph's toolbar. |
76
82
  | `iconMap` | 16px | A map-view toggle, or to represent map/geographic content. |
77
83
  | `iconMapPin` | 16px | A location, address, or map marker. |
78
84
  | `iconMoon` | 16px | A dark-theme toggle, or to represent night/dark mode. |
@@ -83,6 +89,7 @@ table to pick the icon matching a use case, for consistency across apps:
83
89
  | `iconPuzzlePiece` | 18px | Plugins, integrations, or extensible/add-on features. |
84
90
  | `iconQuestionMarkCircle` | 20px | Help, tooltips, or "learn more" affordances. |
85
91
  | `iconQueueList` | 16px | Queues, backlogs, or ordered work-item lists. |
92
+ | `iconServer` | 20px | A running service or deployable, e.g. a service node in dag-graph. |
86
93
  | `iconShieldCheck` | 16px | Verified, secure, or trusted states. |
87
94
  | `iconShieldExclamation` | 16px | Security warnings, or at-risk/compromised states. |
88
95
  | `iconSignal` | 16px | Live/real-time data, connectivity strength, or a traffic-conditions toggle. |
@@ -95,6 +102,7 @@ table to pick the icon matching a use case, for consistency across apps:
95
102
  | `iconTrash` | 16px | Delete/remove actions, typically paired with a destructive/danger style. |
96
103
  | `iconUserCircle` | 20px | A generic user/person fallback, e.g. user-avatar's icon fallback. |
97
104
  | `iconUsers` | 18px | Teams, groups, or multi-user/collaboration content. |
105
+ | `iconViewfinderCircle` | 18px | Center or focus the view on the current selection, e.g. dag-graph's toolbar. |
98
106
  | `iconWrenchScrewdriver` | 18px | Tools, maintenance, or build/configuration actions. |
99
107
  | `iconX` | 18px | Close, dismiss, or clear (e.g. a modal, toast, or clearable input). |
100
108
 
@@ -361,6 +369,10 @@ Supports two suggestion sources:
361
369
  request. Useful for small/fixed lists, offline use, or tests. Takes
362
370
  priority over `endpoint` whenever it's non-null.
363
371
 
372
+ Each option may also carry a pre-rendered `icon` (shown before the value)
373
+ and a `description` (a smaller, muted line under the value); options
374
+ without them render as a plain value.
375
+
364
376
  Set `clearable` to show an in-field clear action whenever a value is
365
377
  present.
366
378
 
@@ -376,9 +388,12 @@ Example:
376
388
  <autocomplete-input clearable name="language" placeholder="Start typing a language…"></autocomplete-input>
377
389
  </form>
378
390
  <script type="module">
379
- // Local mode: filters client-side, no network request.
391
+ import { iconGlobeAlt } from "@f-ewald/components/icons.js";
392
+
393
+ // Local mode: filters client-side, no network request. `icon` and
394
+ // `description` are optional.
380
395
  document.querySelector("autocomplete-input").options = [
381
- { key: "ts", value: "TypeScript" },
396
+ { key: "ts", value: "TypeScript", icon: iconGlobeAlt(14), description: "Typed superset of JavaScript" },
382
397
  { key: "py", value: "Python" },
383
398
  ];
384
399
 
@@ -946,6 +961,55 @@ Example:
946
961
  </script>
947
962
  ```
948
963
 
964
+ ## <dag-graph>
965
+
966
+ Interactive layered drawing of a directed graph — dependencies, pipelines, or any node-link data.
967
+
968
+ Nodes are placed in layers (via dagre) so edges flow left to right (or top to bottom with
969
+ `direction="TB"`); cycles are allowed, and the edges closing them are drawn dashed and point backward.
970
+ Each node is a compact card sized to its label, with an optional icon, color, and border style from
971
+ `kinds`. The whole graph is shown when it fits at a readable zoom; otherwise the selected node is centered at
972
+ 100%. Drag to pan; pinch or Ctrl/⌘ + wheel to zoom (a plain wheel scrolls the page). With keyboard
973
+ focus on the graph, arrow keys pan, `+`/`-` zoom, and `0` fits the graph. Clicking a node, or pressing
974
+ Enter/Space on it, selects it. A toolbar in the top-right corner offers the `controls` you enable.
975
+
976
+ Set `static` to present a fixed picture: the graph is always fitted into view, panning and zooming
977
+ are off, and the toolbar is hidden; nodes can still be selected.
978
+
979
+ Colors can be changed with these custom properties: `--dag-node-background`, `--dag-node-text`,
980
+ `--dag-edge-color`, `--dag-selected-color`, and `--dag-highlight-color`; `--dag-graph-height` sets the
981
+ height (default `24rem`).
982
+
983
+ Import: `import "@f-ewald/components/dag-graph.js";`
984
+
985
+ Properties: `nodes` (attribute `nodes`) : DagNode[], default []; `edges` (attribute `edges`) : DagEdge[], default []; `kinds` (JS property only) : Record<string, DagNodeKind>, default {}; `selected` (attribute `selected`) : string | null, default null; `direction` (attribute `direction`) : DagDirection, default "LR"; `label` (attribute `label`) : string, default "Directed graph"; `legend` (attribute `legend`) : boolean, default false; `controls` (attribute `controls`) : string, default "zoom fit center"; `isStatic` (attribute `static`) : boolean, default false
986
+ Events: `direction-change`, `node-select`
987
+ CSS custom properties: `--ui-border`, `--ui-border-width`, `--ui-button-highlight`, `--ui-button-secondary-background`, `--ui-button-secondary-border`, `--ui-button-secondary-gloss-end`, `--ui-button-secondary-gloss-start`, `--ui-danger`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size`, `--ui-font-size-sm`, `--ui-font-size-xs`, `--ui-primary`, `--ui-radius`, `--ui-radius-sm`, `--ui-shadow`, `--ui-surface`, `--ui-surface-muted`, `--ui-text`, `--ui-text-muted`, `--ui-warning`
988
+
989
+ Example:
990
+ ```html
991
+ <dag-graph legend selected="web"></dag-graph>
992
+ <script type="module">
993
+ import { iconBookOpen, iconCube, iconServer } from "@f-ewald/components/icons.js";
994
+ const graph = document.querySelector("dag-graph");
995
+ graph.kinds = {
996
+ service: { label: "Service", icon: iconServer, color: "#4269d0" },
997
+ library: { label: "Library", icon: iconBookOpen, color: "#3ca951" },
998
+ package: { label: "External package", icon: iconCube, color: "#9498a0", dashed: true },
999
+ };
1000
+ graph.nodes = [
1001
+ { id: "web", label: "web", kind: "service" },
1002
+ { id: "auth", label: "auth-lib", kind: "library" },
1003
+ { id: "requests", label: "requests", kind: "package" },
1004
+ ];
1005
+ graph.edges = [
1006
+ { source: "web", target: "auth" },
1007
+ { source: "auth", target: "requests" },
1008
+ ];
1009
+ graph.addEventListener("node-select", (e) => console.log(e.detail.id));
1010
+ </script>
1011
+ ```
1012
+
949
1013
  ## <data-table>
950
1014
 
951
1015
  A generic, presentational table shell: renders a `<thead>` from `columns`
@@ -953,6 +1017,9 @@ and one `<tr>` per entry in `rows`, with each cell's content produced by
953
1017
  `renderCell` (default: plain property lookup on the row object). Knows
954
1018
  nothing about what a "row" means — callers own the data shape entirely.
955
1019
 
1020
+ Each column may add a decorative header `icon` and an `align` for its
1021
+ header and cells (`end` right-aligns numbers, with tabular figures).
1022
+
956
1023
  Optional `rowHref` makes whole rows clickable (navigating via `location.hash`),
957
1024
  without hijacking clicks on nested interactive elements (links/buttons) a
958
1025
  cell's rendered content might contain.
@@ -978,6 +1045,21 @@ Example:
978
1045
  ];
979
1046
  table.rowHref = (row) => `#/tasks/${row.id}`;
980
1047
  </script>
1048
+ <data-table id="packages"></data-table>
1049
+ <script type="module">
1050
+ import { iconArrowLongRight } from "@f-ewald/components/icons.js";
1051
+
1052
+ // Header icons and alignment, e.g. right-aligned numbers.
1053
+ const packages = document.getElementById("packages");
1054
+ packages.columns = [
1055
+ { key: "name", label: "Package" },
1056
+ { key: "dependents", label: "Dependents", icon: iconArrowLongRight(14), align: "end" },
1057
+ ];
1058
+ packages.rows = [
1059
+ { name: "requests", dependents: 1204 },
1060
+ { name: "attrs", dependents: 87 },
1061
+ ];
1062
+ </script>
981
1063
  ```
982
1064
 
983
1065
  ## <distance-value>
@@ -1472,6 +1554,36 @@ Example:
1472
1554
  <kbd-hint keys="Mod+Shift+Enter" platform="mac"></kbd-hint>
1473
1555
  ```
1474
1556
 
1557
+ ## <kind-icon>
1558
+
1559
+ Inline icon for a named kind (e.g. a service, a library, an external
1560
+ package), looked up in a shared `kinds` map so tables, lists, and search
1561
+ results show the same icon and color as a `dag-graph` legend. With
1562
+ `show-label` the kind's label follows the icon as text; otherwise the
1563
+ icon alone is exposed as an image named by the label. Renders nothing for
1564
+ a kind missing from `kinds`.
1565
+
1566
+ Import: `import "@f-ewald/components/kind-icon.js";`
1567
+
1568
+ Properties: `kind` (attribute `kind`) : string, default ""; `kinds` (JS property only) : Record<string, KindIconStyle>, default {}; `size` (attribute `size`) : 14 | 18, default 14; `showLabel` (attribute `show-label`) : boolean, default false
1569
+ Events: none
1570
+ CSS custom properties: `--ui-primary`
1571
+
1572
+ Example:
1573
+ ```html
1574
+ <kind-icon kind="service" show-label></kind-icon>
1575
+ <kind-icon kind="package" size="18"></kind-icon>
1576
+ <script type="module">
1577
+ import { iconCube, iconServer } from "@f-ewald/components/icons.js";
1578
+
1579
+ const kinds = {
1580
+ service: { label: "Service", icon: iconServer, color: "#4269d0" },
1581
+ package: { label: "External package", icon: iconCube, color: "#9498a0" },
1582
+ };
1583
+ for (const el of document.querySelectorAll("kind-icon")) el.kinds = kinds;
1584
+ </script>
1585
+ ```
1586
+
1475
1587
  ## <link-card>
1476
1588
 
1477
1589
  A single linked-resource tile — logo (or an initial-letter fallback),
@@ -3034,6 +3146,42 @@ Example:
3034
3146
  <ui-checkbox label="Show list view"></ui-checkbox>
3035
3147
  ```
3036
3148
 
3149
+ ## <ui-tooltip>
3150
+
3151
+ Hover and focus tooltip for its default-slot trigger. The `content` slot
3152
+ holds the tooltip body — plain text or rich markup such as a list. It
3153
+ appears after `show-delay` on hover and at once on keyboard focus, stays
3154
+ open while the pointer is over the tooltip itself, and closes on Escape,
3155
+ blur, or when the pointer leaves. It renders in the top layer, so
3156
+ scrolling or `overflow: hidden` ancestors never clip it.
3157
+
3158
+ The trigger is described by the content (`aria-describedby`). A trigger
3159
+ with nothing focusable inside (e.g. plain text) makes the tooltip host
3160
+ focusable so keyboard users can reach the description too. ARIA references
3161
+ can't cross shadow roots, so when the trigger is a custom element whose
3162
+ focusable control lives in its own shadow root, screen readers won't
3163
+ announce the description on focus; prefer a native trigger such as
3164
+ `<button>` when that matters.
3165
+
3166
+ Import: `import "@f-ewald/components/ui-tooltip.js";`
3167
+
3168
+ Properties: `placement` (attribute `placement`) : UiTooltipPlacement, default "top"; `showDelay` (attribute `show-delay`) : number, default 300; `disabled` (attribute `disabled`) : boolean, default false; `open` (JS property only) : boolean, default —
3169
+ Events: none
3170
+ CSS custom properties: `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-font-weight-regular`, `--ui-line-height-tight`, `--ui-radius-sm`, `--ui-shadow`, `--ui-tooltip`, `--ui-tooltip-text`
3171
+
3172
+ Example:
3173
+ ```html
3174
+ <ui-tooltip>
3175
+ <button type="button">Copy link</button>
3176
+ <span slot="content">Copies a shareable link to this view</span>
3177
+ </ui-tooltip>
3178
+ <!-- Plain-text trigger: the tooltip becomes focusable; rich content is fine -->
3179
+ <ui-tooltip placement="bottom" show-delay="0">
3180
+ <span>Partial snapshot</span>
3181
+ <div slot="content">3 work items pending: <ul><li>mp:lap-service</li></ul></div>
3182
+ </ui-tooltip>
3183
+ ```
3184
+
3037
3185
  ## <user-avatar>
3038
3186
 
3039
3187
  Circular avatar. Shows `src` when it loads successfully; falls back to the
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@f-ewald/components",
3
3
  "private": false,
4
- "version": "1.41.0",
4
+ "version": "1.43.0",
5
5
  "description": "A collection of universally usable web components for various tasks.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
@@ -59,6 +59,7 @@
59
59
  "url": "git+https://github.com/f-ewald/components.git"
60
60
  },
61
61
  "dependencies": {
62
+ "@dagrejs/dagre": "^3.1.3",
62
63
  "@modelcontextprotocol/sdk": "^1.29.0",
63
64
  "d3-array": "^3.2.4",
64
65
  "d3-scale": "^4.0.2",