highsoft-ui 1.0.172 → 1.0.173

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,67 @@
1
+ import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
2
+ /** One row of the list — a heading on the page. */
3
+ export interface TableOfContentsItem {
4
+ /** The heading element's `id`: the link target (`#id`) and what the scroll spy watches. */
5
+ id: string;
6
+ /** The heading text. */
7
+ title: ReactNode;
8
+ /** Nesting depth. `1` (default) is a top-level row; `2` and `3` indent 12px per step. */
9
+ level?: 1 | 2 | 3;
10
+ /** Link target. Defaults to `#${id}`. */
11
+ href?: string;
12
+ }
13
+ export interface TableOfContentsProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
14
+ /** The page's headings, in document order. Renders nothing when empty. */
15
+ items: TableOfContentsItem[];
16
+ /**
17
+ * Heading above the list — the `<nav>`'s accessible name. Default
18
+ * `'On this page'`. Pass `null` to hide it; the nav then falls back to
19
+ * `aria-label` (or the default text).
20
+ */
21
+ title?: ReactNode;
22
+ /**
23
+ * The current heading's `id`. Controlled: when given, the built-in scroll
24
+ * spy is off and the highlight follows this prop. `null` highlights nothing.
25
+ */
26
+ activeId?: string | null;
27
+ /**
28
+ * The row that starts current in uncontrolled mode. The scroll spy takes
29
+ * over once it finds the headings; until then (or with `spy={false}`) this
30
+ * row stays current and clicks move the highlight.
31
+ */
32
+ defaultActiveId?: string | null;
33
+ /**
34
+ * Called when the current heading changes — by the scroll spy or by a click
35
+ * on a row. In controlled mode, use it to update `activeId`.
36
+ */
37
+ onActiveChange?: (id: string | null) => void;
38
+ /**
39
+ * Built-in scroll spy (default `true`): the current heading is the last one
40
+ * whose top has scrolled past `spyOffset`. Ignored when `activeId` is given.
41
+ */
42
+ spy?: boolean;
43
+ /**
44
+ * The fold line in px from the top of the viewport that a heading has to
45
+ * cross to become current. Set it to the height of a sticky header (plus
46
+ * any `scroll-margin-top` on the headings). Default `0`.
47
+ */
48
+ spyOffset?: number;
49
+ /**
50
+ * Called when a row is clicked, before the browser navigates to the hash.
51
+ * Call `event.preventDefault()` to take the navigation over (e.g. for an
52
+ * eased scroll with a header offset).
53
+ */
54
+ onItemClick?: (item: TableOfContentsItem, event: MouseEvent<HTMLAnchorElement>) => void;
55
+ }
56
+ /**
57
+ * "On this page" navigation — a rule down the left, a semibold title and one
58
+ * link per heading. Rows are tertiary text; hovering lifts one to primary and
59
+ * grows a 2px bar over the rule, which the current row keeps in a stronger
60
+ * colour — the bar animates in and out on the bounce token.
61
+ *
62
+ * Uncontrolled by default: a scroll spy marks the last heading that has
63
+ * crossed `spyOffset`, and a clicked row stays current while its heading is on
64
+ * screen (so a jump to a short last section doesn't snap back to the section
65
+ * above it). Pass `activeId` to drive the highlight yourself.
66
+ */
67
+ export declare const TableOfContents: import('react').ForwardRefExoticComponent<TableOfContentsProps & import('react').RefAttributes<HTMLElement>>;
@@ -76,6 +76,8 @@ export type { SidebarLayoutProps, SidebarProps, SidebarSectionProps, SidebarSwit
76
76
  export { PrefPanel } from './components/PrefPanel';
77
77
  export { PrevNextNav } from './components/PrevNextNav';
78
78
  export type { PrevNextNavProps, PrevNextNavItem, PrevNextNavBack } from './components/PrevNextNav';
79
+ export { TableOfContents } from './components/TableOfContents';
80
+ export type { TableOfContentsProps, TableOfContentsItem } from './components/TableOfContents';
79
81
  export { VideoPlayer } from './components/VideoPlayer';
80
82
  export type { VideoPlayerProps, VideoPlayerSource, VideoPlayerTrack } from './components/VideoPlayer';
81
83
  export { VideoPlayerModal } from './components/VideoPlayer/VideoPlayerModal';
package/dist/main.js CHANGED
@@ -51,5 +51,6 @@ import { NavGroup as ge } from "./components/Sidebar/NavGroup.js";
51
51
  import { NavDisclosure as _e } from "./components/Sidebar/NavDisclosure.js";
52
52
  import "./components/Sidebar/index.js";
53
53
  import { t as ve } from "./PrevNextNav-XaxS2FTm.js";
54
- import { ThemeLoader as ye, themeLoaderScript as be } from "./components/ThemeLoader/index.js";
55
- export { a as Box, s as BrowserFrame, o as Button, _ as ButtonGroup, Q as Checkbox, Z as CheckboxGroup, f as ClientLogo, u as CodeBlock, w as Container, c as CopyCode, T as DiscordInvite, I as Dropdown, P as DropdownItem, F as DropdownSeparator, j as FeatureItem, A as Features, U as Footer, C as FormGroup, x as FormRow, l as FrameworkIcon, W as GPTInput, q as Header, E as Heading, m as Icon, S as InputGrouped, v as InputSolo, z as Label, h as Link, k as List, O as ListItem, M as Logo, p as LogoCarousel, ne as Modal, ie as ModalContactFooter, _e as NavDisclosure, ge as NavGroup, he as NavItem, R as NewTag, N as NewsletterSignup, G as Notification, L as PrefPanel, ve as PrevNextNav, g as ProductIcon, X as RadioBox, Y as RadioBoxGroup, re as RoadmapDetails, y as SearchDropdown, b as SelectGrouped, ue as Sidebar, de as SidebarBody, fe as SidebarHeader, se as SidebarLayout, ce as SidebarMain, le as SidebarResizer, pe as SidebarSection, me as SidebarSwitcher, K as SubHeader, J as Tabs, ye as ThemeLoader, i as ThemeProvider, $ as Toggle, ee as ToggleCard, te as ToggleList, D as Typography, B as VideoCover, V as VideoPlayer, H as VideoPlayerModal, d as clientLogoLabels, be as themeLoaderScript, n as useClipboard, t as useNextTheme, ae as useOptionalSidebarLayout, oe as useSidebarLayout, r as useSuccessFlash, e as useTheme };
54
+ import { t as ye } from "./TableOfContents-d26S7KYx.js";
55
+ import { ThemeLoader as be, themeLoaderScript as xe } from "./components/ThemeLoader/index.js";
56
+ export { a as Box, s as BrowserFrame, o as Button, _ as ButtonGroup, Q as Checkbox, Z as CheckboxGroup, f as ClientLogo, u as CodeBlock, w as Container, c as CopyCode, T as DiscordInvite, I as Dropdown, P as DropdownItem, F as DropdownSeparator, j as FeatureItem, A as Features, U as Footer, C as FormGroup, x as FormRow, l as FrameworkIcon, W as GPTInput, q as Header, E as Heading, m as Icon, S as InputGrouped, v as InputSolo, z as Label, h as Link, k as List, O as ListItem, M as Logo, p as LogoCarousel, ne as Modal, ie as ModalContactFooter, _e as NavDisclosure, ge as NavGroup, he as NavItem, R as NewTag, N as NewsletterSignup, G as Notification, L as PrefPanel, ve as PrevNextNav, g as ProductIcon, X as RadioBox, Y as RadioBoxGroup, re as RoadmapDetails, y as SearchDropdown, b as SelectGrouped, ue as Sidebar, de as SidebarBody, fe as SidebarHeader, se as SidebarLayout, ce as SidebarMain, le as SidebarResizer, pe as SidebarSection, me as SidebarSwitcher, K as SubHeader, ye as TableOfContents, J as Tabs, be as ThemeLoader, i as ThemeProvider, $ as Toggle, ee as ToggleCard, te as ToggleList, D as Typography, B as VideoCover, V as VideoPlayer, H as VideoPlayerModal, d as clientLogoLabels, xe as themeLoaderScript, n as useClipboard, t as useNextTheme, ae as useOptionalSidebarLayout, oe as useSidebarLayout, r as useSuccessFlash, e as useTheme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "highsoft-ui",
3
- "version": "1.0.172",
3
+ "version": "1.0.173",
4
4
  "description": "Highsoft UI",
5
5
  "type": "module",
6
6
  "repository": {
@@ -36,7 +36,7 @@
36
36
  ],
37
37
  "scripts": {
38
38
  "generate:api": "node scripts/extract-component-api.mjs",
39
- "predev": "node scripts/extract-component-api.mjs",
39
+ "predev": "node scripts/extract-component-api.mjs && npm run studio:assets",
40
40
  "dev": "astro dev",
41
41
  "build": "tsc -p ./tsconfig.build.json && vite build",
42
42
  "build:app": "astro build",
@@ -49,12 +49,17 @@
49
49
  "build-storybook": "storybook build",
50
50
  "prettier": "npx prettier . --write",
51
51
  "prettier-ci": "npx prettier . --check",
52
- "prebuild:app": "node scripts/extract-component-api.mjs",
52
+ "prebuild:app": "node scripts/extract-component-api.mjs && npm run studio:assets",
53
53
  "icons": "node scripts/convert-product-icons.cjs",
54
54
  "icons:frameworks": "node scripts/convert-framework-icons.cjs",
55
55
  "icons:clients": "node scripts/convert-client-logos.cjs",
56
56
  "stylelint": "npx stylelint '**/*.css'",
57
- "prepare": "husky && husky install"
57
+ "prepare": "husky && husky install",
58
+ "studio:assets": "node tools/icon-studio/scripts/prepare-assets.mjs",
59
+ "studio:serve": "python3 tools/icon-studio/viewer/serve.py",
60
+ "test:studio": "node --test tools/icon-studio/viewer/test-*.mjs && python3 -m unittest discover -s tools/icon-studio/viewer -p 'test_*.py'",
61
+ "studio:test-browser": "node tools/icon-studio/scripts/prepare-assets.mjs --test-browser",
62
+ "studio:verify-addon": "python3 tools/icon-studio/scripts/verify-addon.py"
58
63
  },
59
64
  "lint-staged": {
60
65
  "*.{js,jsx,ts,tsx}": [
@@ -104,6 +109,7 @@
104
109
  "eslint-plugin-react": "^7.34.1",
105
110
  "eslint-plugin-react-hooks": "^7.0.1",
106
111
  "eslint-plugin-react-refresh": "^0.5.0",
112
+ "fflate": "^0.8.2",
107
113
  "glob": "^13.0.0",
108
114
  "globals": "^17.0.0",
109
115
  "husky": "^9.0.11",
@@ -118,6 +124,7 @@
118
124
  "stylelint": "^17.0.0",
119
125
  "stylelint-config-standard": "^40.0.0",
120
126
  "stylelint-config-standard-scss": "^17.0.0",
127
+ "three": "^0.186.0",
121
128
  "typescript": "^6.0.2",
122
129
  "typescript-eslint": "^8.31.1",
123
130
  "vite": "^8.0.0",