@true-tech-team/react-components 1.1.1 → 1.2.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,49 @@
1
+ import { default as React } from 'react';
2
+ import { BaseComponentProps, ComponentVariant } from '../../../types';
3
+ export interface ButtonGroupProps extends BaseComponentProps {
4
+ /**
5
+ * Orientation of the button group
6
+ * @default 'horizontal'
7
+ */
8
+ orientation?: 'horizontal' | 'vertical';
9
+ /**
10
+ * Whether buttons should take full width (distribute equally)
11
+ * @default false
12
+ */
13
+ fullWidth?: boolean;
14
+ /**
15
+ * Default variant applied to every button in the group, so they share the same
16
+ * text/icon and background color. A button can override this by specifying its
17
+ * own `variant` prop directly.
18
+ * @default 'primary'
19
+ */
20
+ variant?: ComponentVariant;
21
+ /**
22
+ * Button-like children (e.g. Button, IconButton)
23
+ */
24
+ children: React.ReactNode;
25
+ }
26
+ /**
27
+ * ButtonGroup component - visually groups buttons that each have their own action
28
+ *
29
+ * Unlike ButtonToggleGroup, there is no shared selection state: each child button
30
+ * keeps its own onClick handler and is rendered as passed. Use this to group
31
+ * related but distinct actions, such as a primary text button paired with an
32
+ * icon button.
33
+ *
34
+ * Buttons share the group's `variant` (same text/icon and background color) by
35
+ * default, and are separated by a divider colored to match that text color.
36
+ * Pass `variant` directly on a child to opt it out and give it a different look.
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * <ButtonGroup>
41
+ * <Button onClick={handleSave}>Save</Button>
42
+ * <IconButton icon="chevron-down" aria-label="More options" onClick={handleMore} />
43
+ * </ButtonGroup>
44
+ * ```
45
+ */
46
+ export declare const ButtonGroup: ({ ref, orientation, fullWidth, variant, children, className, "data-testid": testId, "aria-label": ariaLabel, style, ...restProps }: ButtonGroupProps & {
47
+ ref?: React.Ref<HTMLDivElement>;
48
+ }) => React.JSX.Element;
49
+ export default ButtonGroup;
@@ -0,0 +1,3 @@
1
+ export { ButtonGroup } from './ButtonGroup';
2
+ export type { ButtonGroupProps } from './ButtonGroup';
3
+ export { default } from './ButtonGroup';
@@ -4,6 +4,8 @@ export { IconButton } from './buttons/IconButton';
4
4
  export type { IconButtonProps } from './buttons/IconButton';
5
5
  export { ToggleButton } from './buttons/ToggleButton';
6
6
  export type { ToggleButtonProps } from './buttons/ToggleButton';
7
+ export { ButtonGroup } from './buttons/ButtonGroup';
8
+ export type { ButtonGroupProps } from './buttons/ButtonGroup';
7
9
  export { ButtonToggleGroup, ButtonToggleGroupItem, ButtonToggleGroupContext, useButtonToggleGroup, } from './buttons/ButtonToggleGroup';
8
10
  export type { ButtonToggleGroupProps, ButtonToggleGroupItemProps, ButtonToggleGroupContextValue, } from './buttons/ButtonToggleGroup';
9
11
  export { Icon } from './display/Icon';
@@ -99,5 +99,9 @@ export interface ToastProps extends BaseComponentProps {
99
99
  * Toast component
100
100
  * Single toast notification with auto-dismiss and actions
101
101
  */
102
- export declare const Toast: React.FC<ToastProps>;
102
+ export declare const Toast: ({ id, variant, title, message, icon, hideIcon, duration, dismissible, action, onDismiss, showProgress, pauseOnHover, render, animationState, animationDuration, position, className, "data-testid": testId, style, createdAt: _createdAt, pausedAt: _pausedAt, remainingDuration: _remainingDuration, ...restProps }: ToastProps & {
103
+ createdAt?: number;
104
+ pausedAt?: number;
105
+ remainingDuration?: number;
106
+ }) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
103
107
  export default Toast;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@true-tech-team/react-components",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "React TypeScript component library",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",