highsoft-ui 1.0.171 → 1.0.172

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,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';
package/dist/main.js CHANGED
@@ -35,18 +35,21 @@ 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 { 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "highsoft-ui",
3
- "version": "1.0.171",
3
+ "version": "1.0.172",
4
4
  "description": "Highsoft UI",
5
5
  "type": "module",
6
6
  "repository": {