@gyramais/gyra-design 0.2.38 → 0.2.40

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.
@@ -8,6 +8,9 @@ type RuleSearchItem = {
8
8
  icon?: React.ReactNode;
9
9
  /** Tag opcional à direita (ex.: "custom"). */
10
10
  tag?: string | React.ReactNode;
11
+ /** Texto completo do item, revelado em tooltip no hover/focus. Útil quando
12
+ `label`/`sublabel` truncam. */
13
+ tooltip?: string;
11
14
  disabled?: boolean;
12
15
  };
13
16
  type RuleSearchSection = {
@@ -12,14 +12,23 @@ type SegmentedToggleOption<T extends string> = {
12
12
  type SegmentedToggleProps<T extends string> = {
13
13
  id?: string;
14
14
  className?: string;
15
- value: T;
15
+ /** Opcional: quando nao casa nenhuma opcao (ou undefined), nenhum segmento
16
+ fica ativo — o estado "nenhum selecionado" (usado com allowDeselect). */
17
+ value?: T;
16
18
  options: Array<SegmentedToggleOption<T>>;
17
19
  onChange?: (value: T) => void;
20
+ /** GYR-1446 — quando true, clicar no segmento JA ativo o desmarca e dispara
21
+ onDeselect() (estado "nenhum selecionado"). Default false: comportamento
22
+ atual preservado (clicar o ativo e' no-op). */
23
+ allowDeselect?: boolean;
24
+ /** Chamado quando allowDeselect=true e o usuario clica no segmento ativo,
25
+ colapsando a selecao. So dispara nesse caminho. */
26
+ onDeselect?: () => void;
18
27
  /** Tamanho do toggle. Default "md". */
19
28
  size?: "sm" | "md";
20
29
  /** Label invisível pra screen readers (a11y). */
21
30
  ariaLabel?: string;
22
31
  };
23
- declare function SegmentedToggle<T extends string>({ id, className, value, options, onChange, size, ariaLabel, }: SegmentedToggleProps<T>): React.JSX.Element;
32
+ declare function SegmentedToggle<T extends string>({ id, className, value, options, onChange, allowDeselect, onDeselect, size, ariaLabel, }: SegmentedToggleProps<T>): React.JSX.Element;
24
33
  export { SegmentedToggle };
25
34
  export type { SegmentedToggleOption, SegmentedToggleProps };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import "./index.css";
3
- type TooltipProps = {
3
+ declare const Tooltip: React.ForwardRefExoticComponent<{
4
4
  id?: string;
5
5
  className?: string;
6
6
  align?: "start" | "center" | "end";
@@ -11,6 +11,5 @@ type TooltipProps = {
11
11
  width?: string | number;
12
12
  delayDuration?: number;
13
13
  children?: React.ReactNode;
14
- };
15
- declare const Tooltip: ({ id, className, align, side, sideOffset, visible, content, width, delayDuration, children, }: TooltipProps) => React.JSX.Element;
14
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "id" | "content"> & React.RefAttributes<HTMLButtonElement>>;
16
15
  export { Tooltip };
@@ -8,6 +8,9 @@ type RuleSearchItem = {
8
8
  icon?: React.ReactNode;
9
9
  /** Tag opcional à direita (ex.: "custom"). */
10
10
  tag?: string | React.ReactNode;
11
+ /** Texto completo do item, revelado em tooltip no hover/focus. Útil quando
12
+ `label`/`sublabel` truncam. */
13
+ tooltip?: string;
11
14
  disabled?: boolean;
12
15
  };
13
16
  type RuleSearchSection = {
@@ -12,14 +12,23 @@ type SegmentedToggleOption<T extends string> = {
12
12
  type SegmentedToggleProps<T extends string> = {
13
13
  id?: string;
14
14
  className?: string;
15
- value: T;
15
+ /** Opcional: quando nao casa nenhuma opcao (ou undefined), nenhum segmento
16
+ fica ativo — o estado "nenhum selecionado" (usado com allowDeselect). */
17
+ value?: T;
16
18
  options: Array<SegmentedToggleOption<T>>;
17
19
  onChange?: (value: T) => void;
20
+ /** GYR-1446 — quando true, clicar no segmento JA ativo o desmarca e dispara
21
+ onDeselect() (estado "nenhum selecionado"). Default false: comportamento
22
+ atual preservado (clicar o ativo e' no-op). */
23
+ allowDeselect?: boolean;
24
+ /** Chamado quando allowDeselect=true e o usuario clica no segmento ativo,
25
+ colapsando a selecao. So dispara nesse caminho. */
26
+ onDeselect?: () => void;
18
27
  /** Tamanho do toggle. Default "md". */
19
28
  size?: "sm" | "md";
20
29
  /** Label invisível pra screen readers (a11y). */
21
30
  ariaLabel?: string;
22
31
  };
23
- declare function SegmentedToggle<T extends string>({ id, className, value, options, onChange, size, ariaLabel, }: SegmentedToggleProps<T>): React.JSX.Element;
32
+ declare function SegmentedToggle<T extends string>({ id, className, value, options, onChange, allowDeselect, onDeselect, size, ariaLabel, }: SegmentedToggleProps<T>): React.JSX.Element;
24
33
  export { SegmentedToggle };
25
34
  export type { SegmentedToggleOption, SegmentedToggleProps };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import "./index.css";
3
- type TooltipProps = {
3
+ declare const Tooltip: React.ForwardRefExoticComponent<{
4
4
  id?: string;
5
5
  className?: string;
6
6
  align?: "start" | "center" | "end";
@@ -11,6 +11,5 @@ type TooltipProps = {
11
11
  width?: string | number;
12
12
  delayDuration?: number;
13
13
  children?: React.ReactNode;
14
- };
15
- declare const Tooltip: ({ id, className, align, side, sideOffset, visible, content, width, delayDuration, children, }: TooltipProps) => React.JSX.Element;
14
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "id" | "content"> & React.RefAttributes<HTMLButtonElement>>;
16
15
  export { Tooltip };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gyramais/gyra-design",
3
- "version": "0.2.38",
3
+ "version": "0.2.40",
4
4
  "description": "Gyramais Design System",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",