@octavius2929-personal/design-system 0.5.1 → 0.7.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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { SVGProps, ReactElement, ButtonHTMLAttributes, HTMLAttributes, ReactNode, InputHTMLAttributes, TableHTMLAttributes } from 'react';
2
+ import { ElementType, ComponentPropsWithoutRef, SVGProps, ReactElement, ButtonHTMLAttributes, HTMLAttributes, ReactNode, InputHTMLAttributes, TableHTMLAttributes } from 'react';
3
3
 
4
4
  declare const tintaSchema: {
5
5
  light: {
@@ -758,6 +758,19 @@ declare function usePrevious<T>(value: T, initial?: T): T | undefined;
758
758
 
759
759
  declare function useToggle(initial?: boolean): readonly [boolean, () => void, (value: boolean) => void];
760
760
 
761
+ type TypographyVariant = "display" | "h1" | "h2" | "h3" | "h4" | "body" | "lead" | "small" | "caption" | "eyebrow" | "code" | "blackletter";
762
+ type TypographyColor = "fg1" | "fg2" | "fg3" | "accent" | "danger" | "ok" | "warn" | "info";
763
+ type TypographyAlign = "left" | "center" | "right";
764
+ type TypographyOwnProps<E extends ElementType> = {
765
+ variant: TypographyVariant;
766
+ as?: E;
767
+ color?: TypographyColor;
768
+ align?: TypographyAlign;
769
+ };
770
+ type TypographyProps<E extends ElementType = "span"> = TypographyOwnProps<E> & Omit<ComponentPropsWithoutRef<E>, "className" | "style" | "color" | keyof TypographyOwnProps<E>>;
771
+
772
+ declare function Typography<E extends ElementType = "span">({ variant, as, color, align, ...rest }: TypographyProps<E>): react.JSX.Element;
773
+
761
774
  interface IconProps extends SVGProps<SVGSVGElement> {
762
775
  /** Lado del cuadro en px. Por defecto 20. */
763
776
  size?: number;
@@ -861,7 +874,34 @@ interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "on
861
874
  onChange?: (value: string) => void;
862
875
  }
863
876
 
864
- declare function TextField({ label, help, error, startIcon: StartIcon, multiline, rows, type, onChange, className, id, ...rest }: TextFieldProps): react.JSX.Element;
877
+ declare function TextField({ label, help, error, startIcon, multiline, rows, type, onChange, className, id, ...rest }: TextFieldProps): react.JSX.Element;
878
+
879
+ interface PasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
880
+ label?: ReactNode;
881
+ help?: ReactNode;
882
+ error?: boolean;
883
+ startIcon?: Icon;
884
+ onChange?: (value: string) => void;
885
+ }
886
+
887
+ declare function PasswordField({ label, help, error, startIcon, onChange, id, className, ...rest }: PasswordFieldProps): react.JSX.Element;
888
+
889
+ interface MoneyFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "defaultValue" | "type"> {
890
+ /** Valor numérico controlado. `null`/omitido representa "sin valor". */
891
+ value?: number | null;
892
+ /** Callback con el valor parseado al hacer blur. */
893
+ onChange?: (value: number | null) => void;
894
+ /** Código ISO de moneda para Intl.NumberFormat (default "USD"). */
895
+ currency?: string;
896
+ /** Locale para Intl.NumberFormat (default "en-US"). */
897
+ locale?: string;
898
+ label?: ReactNode;
899
+ help?: ReactNode;
900
+ error?: boolean;
901
+ startIcon?: Icon;
902
+ }
903
+
904
+ declare function MoneyField({ value, onChange, currency, locale, label, help, error, startIcon, id, className, onFocus, onBlur, ...rest }: MoneyFieldProps): react.JSX.Element;
865
905
 
866
906
  type IconButtonTone = "ink" | "accent";
867
907
  interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className"> {
@@ -1120,4 +1160,4 @@ interface ThemeProviderProps {
1120
1160
  declare function ThemeProvider({ children, defaultSchema, defaultMode, storageKey, persist, }: ThemeProviderProps): react.JSX.Element;
1121
1161
  declare function useTheme(): ThemeContextValue;
1122
1162
 
1123
- export { Accordion, type AccordionItem, type AccordionProps, Alert, type AlertProps, type AlertSeverity, AppBar, type AppBarProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeTone, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTone, type ButtonVariant, Card, type CardProps, type CardSectionProps, CheckIcon, Checkbox, type CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, type ChipProps, type ChipTone, CircleCheckIcon, CircleXIcon, type ColorTokens, type Crumb, Dialog, type DialogProps, Divider, type DividerProps, EyeIcon, EyeOffIcon, type Icon, IconButton, type IconButtonProps, type IconButtonTone, type IconProps, InfoIcon, ListItem, type ListItemProps, Menu, type MenuItemDef, type MenuProps, MinusIcon, type Mode, type ModePreference, MoreHorizontalIcon, Pagination, type PaginationProps, PlusIcon, Progress, type ProgressProps, type ProgressVariant, Radio, type RadioProps, type SchemaName, SearchIcon, Select, type SelectOption, type SelectProps, Slider, type SliderProps, Snackbar, type SnackbarProps, type Step, Stepper, type StepperProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, TextField, type TextFieldProps, ThemeProvider, type ThemeProviderProps, Tooltip, type TooltipPlacement, type TooltipProps, TriangleAlertIcon, XIcon, colorVars, modeNames, schemaNames, text, vars as theme, themes, usePrevious, useTheme, useToggle };
1163
+ export { Accordion, type AccordionItem, type AccordionProps, Alert, type AlertProps, type AlertSeverity, AppBar, type AppBarProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeTone, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTone, type ButtonVariant, Card, type CardProps, type CardSectionProps, CheckIcon, Checkbox, type CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, type ChipProps, type ChipTone, CircleCheckIcon, CircleXIcon, type ColorTokens, type Crumb, Dialog, type DialogProps, Divider, type DividerProps, EyeIcon, EyeOffIcon, type Icon, IconButton, type IconButtonProps, type IconButtonTone, type IconProps, InfoIcon, ListItem, type ListItemProps, Menu, type MenuItemDef, type MenuProps, MinusIcon, type Mode, type ModePreference, MoneyField, type MoneyFieldProps, MoreHorizontalIcon, Pagination, type PaginationProps, PasswordField, type PasswordFieldProps, PlusIcon, Progress, type ProgressProps, type ProgressVariant, Radio, type RadioProps, type SchemaName, SearchIcon, Select, type SelectOption, type SelectProps, Slider, type SliderProps, Snackbar, type SnackbarProps, type Step, Stepper, type StepperProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, TextField, type TextFieldProps, ThemeProvider, type ThemeProviderProps, Tooltip, type TooltipPlacement, type TooltipProps, TriangleAlertIcon, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, XIcon, colorVars, modeNames, schemaNames, text, vars as theme, themes, usePrevious, useTheme, useToggle };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { SVGProps, ReactElement, ButtonHTMLAttributes, HTMLAttributes, ReactNode, InputHTMLAttributes, TableHTMLAttributes } from 'react';
2
+ import { ElementType, ComponentPropsWithoutRef, SVGProps, ReactElement, ButtonHTMLAttributes, HTMLAttributes, ReactNode, InputHTMLAttributes, TableHTMLAttributes } from 'react';
3
3
 
4
4
  declare const tintaSchema: {
5
5
  light: {
@@ -758,6 +758,19 @@ declare function usePrevious<T>(value: T, initial?: T): T | undefined;
758
758
 
759
759
  declare function useToggle(initial?: boolean): readonly [boolean, () => void, (value: boolean) => void];
760
760
 
761
+ type TypographyVariant = "display" | "h1" | "h2" | "h3" | "h4" | "body" | "lead" | "small" | "caption" | "eyebrow" | "code" | "blackletter";
762
+ type TypographyColor = "fg1" | "fg2" | "fg3" | "accent" | "danger" | "ok" | "warn" | "info";
763
+ type TypographyAlign = "left" | "center" | "right";
764
+ type TypographyOwnProps<E extends ElementType> = {
765
+ variant: TypographyVariant;
766
+ as?: E;
767
+ color?: TypographyColor;
768
+ align?: TypographyAlign;
769
+ };
770
+ type TypographyProps<E extends ElementType = "span"> = TypographyOwnProps<E> & Omit<ComponentPropsWithoutRef<E>, "className" | "style" | "color" | keyof TypographyOwnProps<E>>;
771
+
772
+ declare function Typography<E extends ElementType = "span">({ variant, as, color, align, ...rest }: TypographyProps<E>): react.JSX.Element;
773
+
761
774
  interface IconProps extends SVGProps<SVGSVGElement> {
762
775
  /** Lado del cuadro en px. Por defecto 20. */
763
776
  size?: number;
@@ -861,7 +874,34 @@ interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "on
861
874
  onChange?: (value: string) => void;
862
875
  }
863
876
 
864
- declare function TextField({ label, help, error, startIcon: StartIcon, multiline, rows, type, onChange, className, id, ...rest }: TextFieldProps): react.JSX.Element;
877
+ declare function TextField({ label, help, error, startIcon, multiline, rows, type, onChange, className, id, ...rest }: TextFieldProps): react.JSX.Element;
878
+
879
+ interface PasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
880
+ label?: ReactNode;
881
+ help?: ReactNode;
882
+ error?: boolean;
883
+ startIcon?: Icon;
884
+ onChange?: (value: string) => void;
885
+ }
886
+
887
+ declare function PasswordField({ label, help, error, startIcon, onChange, id, className, ...rest }: PasswordFieldProps): react.JSX.Element;
888
+
889
+ interface MoneyFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "defaultValue" | "type"> {
890
+ /** Valor numérico controlado. `null`/omitido representa "sin valor". */
891
+ value?: number | null;
892
+ /** Callback con el valor parseado al hacer blur. */
893
+ onChange?: (value: number | null) => void;
894
+ /** Código ISO de moneda para Intl.NumberFormat (default "USD"). */
895
+ currency?: string;
896
+ /** Locale para Intl.NumberFormat (default "en-US"). */
897
+ locale?: string;
898
+ label?: ReactNode;
899
+ help?: ReactNode;
900
+ error?: boolean;
901
+ startIcon?: Icon;
902
+ }
903
+
904
+ declare function MoneyField({ value, onChange, currency, locale, label, help, error, startIcon, id, className, onFocus, onBlur, ...rest }: MoneyFieldProps): react.JSX.Element;
865
905
 
866
906
  type IconButtonTone = "ink" | "accent";
867
907
  interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className"> {
@@ -1120,4 +1160,4 @@ interface ThemeProviderProps {
1120
1160
  declare function ThemeProvider({ children, defaultSchema, defaultMode, storageKey, persist, }: ThemeProviderProps): react.JSX.Element;
1121
1161
  declare function useTheme(): ThemeContextValue;
1122
1162
 
1123
- export { Accordion, type AccordionItem, type AccordionProps, Alert, type AlertProps, type AlertSeverity, AppBar, type AppBarProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeTone, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTone, type ButtonVariant, Card, type CardProps, type CardSectionProps, CheckIcon, Checkbox, type CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, type ChipProps, type ChipTone, CircleCheckIcon, CircleXIcon, type ColorTokens, type Crumb, Dialog, type DialogProps, Divider, type DividerProps, EyeIcon, EyeOffIcon, type Icon, IconButton, type IconButtonProps, type IconButtonTone, type IconProps, InfoIcon, ListItem, type ListItemProps, Menu, type MenuItemDef, type MenuProps, MinusIcon, type Mode, type ModePreference, MoreHorizontalIcon, Pagination, type PaginationProps, PlusIcon, Progress, type ProgressProps, type ProgressVariant, Radio, type RadioProps, type SchemaName, SearchIcon, Select, type SelectOption, type SelectProps, Slider, type SliderProps, Snackbar, type SnackbarProps, type Step, Stepper, type StepperProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, TextField, type TextFieldProps, ThemeProvider, type ThemeProviderProps, Tooltip, type TooltipPlacement, type TooltipProps, TriangleAlertIcon, XIcon, colorVars, modeNames, schemaNames, text, vars as theme, themes, usePrevious, useTheme, useToggle };
1163
+ export { Accordion, type AccordionItem, type AccordionProps, Alert, type AlertProps, type AlertSeverity, AppBar, type AppBarProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeTone, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonTone, type ButtonVariant, Card, type CardProps, type CardSectionProps, CheckIcon, Checkbox, type CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, type ChipProps, type ChipTone, CircleCheckIcon, CircleXIcon, type ColorTokens, type Crumb, Dialog, type DialogProps, Divider, type DividerProps, EyeIcon, EyeOffIcon, type Icon, IconButton, type IconButtonProps, type IconButtonTone, type IconProps, InfoIcon, ListItem, type ListItemProps, Menu, type MenuItemDef, type MenuProps, MinusIcon, type Mode, type ModePreference, MoneyField, type MoneyFieldProps, MoreHorizontalIcon, Pagination, type PaginationProps, PasswordField, type PasswordFieldProps, PlusIcon, Progress, type ProgressProps, type ProgressVariant, Radio, type RadioProps, type SchemaName, SearchIcon, Select, type SelectOption, type SelectProps, Slider, type SliderProps, Snackbar, type SnackbarProps, type Step, Stepper, type StepperProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, TextField, type TextFieldProps, ThemeProvider, type ThemeProviderProps, Tooltip, type TooltipPlacement, type TooltipProps, TriangleAlertIcon, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, XIcon, colorVars, modeNames, schemaNames, text, vars as theme, themes, usePrevious, useTheme, useToggle };