@node-core/ui-components 1.5.5 → 1.5.6

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,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ import styles from './index.module.css';
4
+ const depthClasses = {
5
+ 3: styles.depthThree,
6
+ 4: styles.depthFour,
7
+ };
8
+ const TableOfContents = ({ headings, summaryTitle, minDepth = 2, className, maxDepth = 4, as: Component = 'a', ...props }) => {
9
+ const filteredHeadings = headings.filter(({ depth }) => depth >= minDepth && depth <= maxDepth);
10
+ return (_jsxs("details", { className: classNames(styles.details, className), ...props, children: [_jsx("summary", { className: styles.summary, children: summaryTitle }), _jsx("ul", { className: styles.list, children: filteredHeadings.map((head, index) => (_jsx("li", { children: _jsx(Component, { href: head.data?.id && `#${head.data.id}`, className: classNames(styles.link, depthClasses[head.depth]), children: head.value }) }, head.data?.id ?? index))) })] }));
11
+ };
12
+ export default TableOfContents;
@@ -0,0 +1,2 @@
1
+ /*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
2
+ .details{margin-block:calc(var(--spacing,.25rem)*2);border-radius:var(--radius-md,.375rem);background-color:var(--color-neutral-200,#e9edf0);display:block}@media (min-width:64rem){.details{display:none}}.details:where([data-theme=dark],[data-theme=dark] *){background-color:var(--color-neutral-900,#2c3437)}.details .summary{padding-inline:calc(var(--spacing,.25rem)*4);padding-block:calc(var(--spacing,.25rem)*2)}:where(.details .list>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing,.25rem)*1*var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing,.25rem)*1*(1 - var(--tw-space-y-reverse)))}.details .list{padding-inline:calc(var(--spacing,.25rem)*4);padding-bottom:calc(var(--spacing,.25rem)*2)}.details .link{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,1.42857));--tw-font-weight:var(--font-weight-semibold,600);font-weight:var(--font-weight-semibold,600);color:var(--color-neutral-900,#2c3437);text-decoration-line:underline}@media (hover:hover){.details .link:hover{color:var(--color-neutral-700,#6e7b83)}}.details .link:where([data-theme=dark],[data-theme=dark] *){color:var(--color-white,#fff)}@media (hover:hover){.details .link:where([data-theme=dark],[data-theme=dark] *):hover{color:var(--color-neutral-500,#b1bcc2)}}.details .depthThree{padding-left:calc(var(--spacing,.25rem)*2)}.details .depthFour{padding-left:calc(var(--spacing,.25rem)*4)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-font-weight{syntax:"*";inherits:false}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-core/ui-components",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",