@net-advantage/nabs-ui-toolbar 0.35.0 → 0.36.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.
@@ -0,0 +1,2 @@
1
+ import { ToolbarProps } from './Toolbar.types';
2
+ export declare const Toolbar: import('react').ForwardRefExoticComponent<ToolbarProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,25 @@
1
+ import { ComponentPropsWithoutRef, ComponentType, MouseEvent, ReactNode, SVGProps } from 'react';
2
+ export type ToolbarLabelPosition = "left" | "right" | "top" | "bottom";
3
+ export type ToolbarIconComponent = ComponentType<SVGProps<SVGSVGElement>>;
4
+ export interface ToolbarItem {
5
+ id: string;
6
+ icon?: ToolbarIconComponent;
7
+ label?: ReactNode;
8
+ labelPosition?: ToolbarLabelPosition;
9
+ disabled?: boolean;
10
+ title?: string;
11
+ pressed?: boolean;
12
+ }
13
+ export interface ToolbarItemSelectDetails {
14
+ itemId: string;
15
+ item: ToolbarItem;
16
+ event: MouseEvent<HTMLButtonElement>;
17
+ }
18
+ export interface ToolbarProps extends Omit<ComponentPropsWithoutRef<"div">, "children" | "role"> {
19
+ items: ToolbarItem[];
20
+ activeItemId?: string;
21
+ onItemSelect?: (details: ToolbarItemSelectDetails) => void;
22
+ buttonClassName?: string;
23
+ iconClassName?: string;
24
+ labelClassName?: string;
25
+ }
@@ -0,0 +1,2 @@
1
+ export { Toolbar } from './Toolbar';
2
+ export type { ToolbarIconComponent, ToolbarItem, ToolbarItemSelectDetails, ToolbarLabelPosition, ToolbarProps, } from './Toolbar.types';
@@ -0,0 +1,3 @@
1
+ import { ToolbarLabelPosition } from './Toolbar.types';
2
+ export declare const labelPositionClasses: Record<ToolbarLabelPosition, string>;
3
+ export declare function normalizeLabelPosition(position: ToolbarLabelPosition | undefined): ToolbarLabelPosition;
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@net-advantage/nabs-ui-toolbar",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "Reusable toolbar control for the Nabs UI library.",
5
5
  "type": "module",
6
6
  "main": "./dist/nabs-ui-toolbar.cjs",
7
7
  "module": "./dist/nabs-ui-toolbar.js",
8
+ "types": "./dist/index.d.ts",
8
9
  "exports": {
9
10
  ".": {
10
11
  "import": "./dist/nabs-ui-toolbar.js",