highsoft-ui 1.0.171 → 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>>;
@@ -0,0 +1,34 @@
1
+ import { ButtonHTMLAttributes, CSSProperties, ReactNode } from 'react';
2
+ export type ToggleSize = 50 | 100 | 200 | 300 | 400 | 500;
3
+ export type ToggleVariant = 'brand' | 'success' | 'attention' | 'danger';
4
+ export interface ToggleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'value' | 'defaultValue' | 'children' | 'role' | 'type' | 'color'> {
5
+ /** Visible label. Clicking it toggles the switch. Omit only with `aria-label`. */
6
+ label?: ReactNode;
7
+ /** Secondary line under the label, wired up as the switch's description. */
8
+ description?: ReactNode;
9
+ /** Controlled on/off state */
10
+ checked?: boolean;
11
+ /** Initial state for uncontrolled use */
12
+ defaultChecked?: boolean;
13
+ /** Called with the next state when the user flips the switch */
14
+ onChange?: (checked: boolean) => void;
15
+ /** Matches the Button size scale; the row is as tall as a Button of the same size */
16
+ size?: ToggleSize;
17
+ /**
18
+ * Colour of the track when on — the Button colour of the same name.
19
+ * `brand` (default) for ordinary settings; a status colour only when the
20
+ * on state itself means something (e.g. `danger` for "Maintenance mode").
21
+ */
22
+ variant?: ToggleVariant;
23
+ /** Which side of the switch the label sits on */
24
+ labelPosition?: 'left' | 'right';
25
+ /** Stretch the row to its container; the label fills it, so the switch sits on the far edge (with `labelPosition="left"`: a settings row) */
26
+ fullWidth?: boolean;
27
+ /** Form field name — a hidden input submits `value` while the switch is on */
28
+ name?: string;
29
+ /** Value submitted with `name` while on (default `'on'`, like a checkbox) */
30
+ value?: string;
31
+ className?: string;
32
+ style?: CSSProperties;
33
+ }
34
+ export declare const Toggle: import('react').ForwardRefExoticComponent<ToggleProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,19 @@
1
+ import { CSSProperties } from 'react';
2
+ import { ToggleProps } from '../Toggle';
3
+ export interface ToggleCardProps extends Omit<ToggleProps, 'fullWidth' | 'className' | 'style'> {
4
+ /**
5
+ * No fill, the transparent Button's hairline — for tinted surfaces or next
6
+ * to transparent Buttons. Default is a background-0 card.
7
+ */
8
+ transparent?: boolean;
9
+ /** Class for the card */
10
+ className?: string;
11
+ /** Style for the card */
12
+ style?: CSSProperties;
13
+ }
14
+ /**
15
+ * A bordered card around a Toggle — a "switch card". A click or tap anywhere
16
+ * on the card flips the switch; hover only previews. The switch inside is
17
+ * still the one and only control, so AT hears a single switch.
18
+ */
19
+ export declare const ToggleCard: import('react').ForwardRefExoticComponent<ToggleCardProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,8 @@
1
+ import { ToggleSize, ToggleVariant } from '../Toggle';
2
+ export interface ToggleListContextValue {
3
+ size?: ToggleSize;
4
+ variant?: ToggleVariant;
5
+ transparent?: boolean;
6
+ }
7
+ export declare const ToggleListContext: import('react').Context<ToggleListContextValue | null>;
8
+ export declare const useToggleList: () => ToggleListContextValue | null;
@@ -0,0 +1,20 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { ToggleSize, ToggleVariant } from '../Toggle';
3
+ export interface ToggleListProps extends HTMLAttributes<HTMLDivElement> {
4
+ /** `ToggleCard` rows */
5
+ children: ReactNode;
6
+ /** Name the group: `aria-label`, or `aria-labelledby` pointing at a visible heading */
7
+ 'aria-label'?: string;
8
+ 'aria-labelledby'?: string;
9
+ /** Default size for every row; a row's own `size` wins */
10
+ size?: ToggleSize;
11
+ /** Default on-colour for every row; a row's own `variant` wins */
12
+ variant?: ToggleVariant;
13
+ /** No fill, the transparent Button's hairline — for tinted surfaces */
14
+ transparent?: boolean;
15
+ }
16
+ /**
17
+ * A settings list: `ToggleCard` rows in one frame with dividers. Each row is
18
+ * a whole-row click target; the list is a named `role="group"`.
19
+ */
20
+ export declare const ToggleList: import('react').ForwardRefExoticComponent<ToggleListProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -54,6 +54,12 @@ export { RadioBox, RadioBoxGroup } from './components/RadioBox';
54
54
  export type { RadioBoxProps, RadioBoxGroupProps } from './components/RadioBox';
55
55
  export { Checkbox, CheckboxGroup } from './components/Checkbox';
56
56
  export type { CheckboxProps, CheckboxGroupProps } from './components/Checkbox';
57
+ export { Toggle } from './components/Toggle';
58
+ export type { ToggleProps, ToggleSize, ToggleVariant } from './components/Toggle';
59
+ export { ToggleCard } from './components/ToggleCard';
60
+ export type { ToggleCardProps } from './components/ToggleCard';
61
+ export { ToggleList } from './components/ToggleList';
62
+ export type { ToggleListProps } from './components/ToggleList';
57
63
  export { Dropdown, DropdownItem, DropdownSeparator } from './components/Dropdown';
58
64
  export type { DropdownProps, DropdownItemProps, DropdownOption, DropdownAlign, DropdownSide } from './components/Dropdown';
59
65
  export { NewsletterSignup } from './components/NewsletterSignup';
@@ -70,6 +76,8 @@ export type { SidebarLayoutProps, SidebarProps, SidebarSectionProps, SidebarSwit
70
76
  export { PrefPanel } from './components/PrefPanel';
71
77
  export { PrevNextNav } from './components/PrevNextNav';
72
78
  export type { PrevNextNavProps, PrevNextNavItem, PrevNextNavBack } from './components/PrevNextNav';
79
+ export { TableOfContents } from './components/TableOfContents';
80
+ export type { TableOfContentsProps, TableOfContentsItem } from './components/TableOfContents';
73
81
  export { VideoPlayer } from './components/VideoPlayer';
74
82
  export type { VideoPlayerProps, VideoPlayerSource, VideoPlayerTrack } from './components/VideoPlayer';
75
83
  export { VideoPlayerModal } from './components/VideoPlayer/VideoPlayerModal';
package/dist/main.js CHANGED
@@ -35,18 +35,22 @@ import { n as K, t as q } from "./Header-CQKgp8xy.js";
35
35
  import { t as J } from "./Tabs-TRXBM5Zr.js";
36
36
  import { n as Y, t as X } from "./RadioBox-C7bDjItJ.js";
37
37
  import { n as Z, t as Q } from "./Checkbox-DU_KGp-P.js";
38
- import { Modal as $ } from "./components/Modal/index.js";
39
- import { t as ee } from "./RoadmapDetails-CLQzIxv7.js";
40
- import { ModalContactFooter as te } from "./components/Modal/ModalContactFooter.js";
41
- import { useOptionalSidebarLayout as ne, useSidebarLayout as re } from "./components/Sidebar/context.js";
42
- import { SidebarLayout as ie, SidebarMain as ae } from "./components/Sidebar/SidebarLayout.js";
43
- import { SidebarResizer as oe } from "./components/Sidebar/SidebarResizer.js";
44
- import { Sidebar as se, SidebarBody as ce, SidebarHeader as le, SidebarSection as ue } from "./components/Sidebar/Sidebar.js";
45
- import { SidebarSwitcher as de } from "./components/Sidebar/SidebarSwitcher.js";
46
- import { NavItem as fe } from "./components/Sidebar/NavItem.js";
47
- import { NavGroup as pe } from "./components/Sidebar/NavGroup.js";
48
- import { NavDisclosure as me } from "./components/Sidebar/NavDisclosure.js";
38
+ import { t as $ } from "./Toggle-BHjptO7-.js";
39
+ import { t as ee } from "./ToggleCard-kMpxzTnh.js";
40
+ import { t as te } from "./ToggleList-Dh7wb2-W.js";
41
+ import { Modal as ne } from "./components/Modal/index.js";
42
+ import { t as re } from "./RoadmapDetails-CLQzIxv7.js";
43
+ import { ModalContactFooter as ie } from "./components/Modal/ModalContactFooter.js";
44
+ import { useOptionalSidebarLayout as ae, useSidebarLayout as oe } from "./components/Sidebar/context.js";
45
+ import { SidebarLayout as se, SidebarMain as ce } from "./components/Sidebar/SidebarLayout.js";
46
+ import { SidebarResizer as le } from "./components/Sidebar/SidebarResizer.js";
47
+ import { Sidebar as ue, SidebarBody as de, SidebarHeader as fe, SidebarSection as pe } from "./components/Sidebar/Sidebar.js";
48
+ import { SidebarSwitcher as me } from "./components/Sidebar/SidebarSwitcher.js";
49
+ import { NavItem as he } from "./components/Sidebar/NavItem.js";
50
+ import { NavGroup as ge } from "./components/Sidebar/NavGroup.js";
51
+ import { NavDisclosure as _e } from "./components/Sidebar/NavDisclosure.js";
49
52
  import "./components/Sidebar/index.js";
50
- import { t as he } from "./PrevNextNav-XaxS2FTm.js";
51
- import { ThemeLoader as ge, themeLoaderScript as _e } from "./components/ThemeLoader/index.js";
52
- 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, $ as Modal, te as ModalContactFooter, me as NavDisclosure, pe as NavGroup, fe as NavItem, R as NewTag, N as NewsletterSignup, G as Notification, L as PrefPanel, he as PrevNextNav, g as ProductIcon, X as RadioBox, Y as RadioBoxGroup, ee as RoadmapDetails, y as SearchDropdown, b as SelectGrouped, se as Sidebar, ce as SidebarBody, le as SidebarHeader, ie as SidebarLayout, ae as SidebarMain, oe as SidebarResizer, ue as SidebarSection, de as SidebarSwitcher, K as SubHeader, J as Tabs, ge as ThemeLoader, i as ThemeProvider, D as Typography, B as VideoCover, V as VideoPlayer, H as VideoPlayerModal, d as clientLogoLabels, _e as themeLoaderScript, n as useClipboard, t as useNextTheme, ne as useOptionalSidebarLayout, re as useSidebarLayout, r as useSuccessFlash, e as useTheme };
53
+ import { t as ve } from "./PrevNextNav-XaxS2FTm.js";
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.171",
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",