@kroo-web/design-system 1.3.0 → 1.5.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.
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { DetailedHTMLProps, InputHTMLAttributes } from 'react';
2
2
  import { FieldValues, Path } from 'react-hook-form';
3
3
  export type TNumberFieldProps<T extends FieldValues> = {
4
4
  helper?: {
@@ -11,3 +11,19 @@ export type TNumberFieldProps<T extends FieldValues> = {
11
11
  width?: number;
12
12
  };
13
13
  export declare const NumberField: <T extends FieldValues>(props: TNumberFieldProps<T>) => React.JSX.Element;
14
+ export type TNativeNumberFieldProps = {
15
+ defaultValue?: number;
16
+ error?: {
17
+ message: string;
18
+ };
19
+ helper?: {
20
+ message: string;
21
+ };
22
+ id: string;
23
+ label: string;
24
+ max?: number | string;
25
+ min?: number | string;
26
+ missing?: boolean;
27
+ width?: number;
28
+ } & Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'max' | 'min' | 'type'>;
29
+ export declare const NativeNumberField: React.ForwardRefExoticComponent<Omit<TNativeNumberFieldProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React, { ChangeEventHandler, DetailedHTMLProps, InputHTMLAttributes, ReactNode } from 'react';
2
2
  import { FieldValues, Path } from 'react-hook-form';
3
3
  export type TPhoneFieldProps<T extends FieldValues> = {
4
4
  className?: string;
@@ -11,3 +11,22 @@ export type TPhoneFieldProps<T extends FieldValues> = {
11
11
  placeholder?: string;
12
12
  };
13
13
  export declare const PhoneField: <T extends FieldValues>(props: TPhoneFieldProps<T>) => React.JSX.Element;
14
+ export type TNativeCountrySelectProps = {
15
+ id: string;
16
+ onChange?: ChangeEventHandler<HTMLSelectElement>;
17
+ } & DetailedHTMLProps<InputHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
18
+ export type TNativeInputProps = {
19
+ className?: string;
20
+ error?: {
21
+ message: string;
22
+ };
23
+ id: string;
24
+ placeholder: string;
25
+ } & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
26
+ export declare const NativePhoneField: {
27
+ CountrySelect: React.ForwardRefExoticComponent<Omit<TNativeCountrySelectProps, "ref"> & React.RefAttributes<HTMLSelectElement>>;
28
+ Input: React.ForwardRefExoticComponent<Omit<TNativeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
29
+ Root: ({ children }: {
30
+ children: ReactNode;
31
+ }) => React.JSX.Element;
32
+ };
@@ -3,7 +3,8 @@ export type TFormFieldProps = {
3
3
  children: ReactNode;
4
4
  error?: string;
5
5
  helper?: ReactNode | string;
6
+ hideLabel?: boolean;
6
7
  id: string;
7
8
  label?: string;
8
9
  };
9
- export declare const FormField: ({ children, error, helper, id, label }: TFormFieldProps) => React.JSX.Element;
10
+ export declare const FormField: ({ children, error, helper, hideLabel, id, label }: TFormFieldProps) => React.JSX.Element;
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
2
- import React$1, { PropsWithChildren, ReactNode, HTMLProps, ElementType, ButtonHTMLAttributes, OptionHTMLAttributes, DetailedHTMLProps, InputHTMLAttributes } from 'react';
2
+ import React$1, { PropsWithChildren, ReactNode, HTMLProps, ElementType, ButtonHTMLAttributes, DetailedHTMLProps, InputHTMLAttributes, ChangeEventHandler, OptionHTMLAttributes } from 'react';
3
3
  import { MaterialSymbolProps } from 'react-material-symbols';
4
4
  import { FieldValues, Path, ControllerRenderProps, UseFormReturn, FieldError } from 'react-hook-form';
5
5
  import * as zustand from 'zustand';
@@ -235,6 +235,22 @@ type TNumberFieldProps<T extends FieldValues> = {
235
235
  width?: number;
236
236
  };
237
237
  declare const NumberField: <T extends FieldValues>(props: TNumberFieldProps<T>) => React$1.JSX.Element;
238
+ type TNativeNumberFieldProps = {
239
+ defaultValue?: number;
240
+ error?: {
241
+ message: string;
242
+ };
243
+ helper?: {
244
+ message: string;
245
+ };
246
+ id: string;
247
+ label: string;
248
+ max?: number | string;
249
+ min?: number | string;
250
+ missing?: boolean;
251
+ width?: number;
252
+ } & Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'max' | 'min' | 'type'>;
253
+ declare const NativeNumberField: React$1.ForwardRefExoticComponent<Omit<TNativeNumberFieldProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
238
254
 
239
255
  type TPhoneFieldProps<T extends FieldValues> = {
240
256
  className?: string;
@@ -247,6 +263,25 @@ type TPhoneFieldProps<T extends FieldValues> = {
247
263
  placeholder?: string;
248
264
  };
249
265
  declare const PhoneField: <T extends FieldValues>(props: TPhoneFieldProps<T>) => React$1.JSX.Element;
266
+ type TNativeCountrySelectProps = {
267
+ id: string;
268
+ onChange?: ChangeEventHandler<HTMLSelectElement>;
269
+ } & DetailedHTMLProps<InputHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
270
+ type TNativeInputProps = {
271
+ className?: string;
272
+ error?: {
273
+ message: string;
274
+ };
275
+ id: string;
276
+ placeholder: string;
277
+ } & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
278
+ declare const NativePhoneField: {
279
+ CountrySelect: React$1.ForwardRefExoticComponent<Omit<TNativeCountrySelectProps, "ref"> & React$1.RefAttributes<HTMLSelectElement>>;
280
+ Input: React$1.ForwardRefExoticComponent<Omit<TNativeInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
281
+ Root: ({ children }: {
282
+ children: ReactNode;
283
+ }) => React$1.JSX.Element;
284
+ };
250
285
 
251
286
  interface TPinInputProps<T extends FieldValues> {
252
287
  isNumeric?: boolean;
@@ -455,4 +490,4 @@ interface WrapperProps extends PropsWithChildren {
455
490
  }
456
491
  declare const Wrapper: ({ as, children, className, variants }: WrapperProps) => React$1.JSX.Element;
457
492
 
458
- export { Accordion, Button, Buttons, Callout, Card, Cards, type CardsVariants, Checkbox, Columns, ComboBox, DatePicker, Disclosure, Field, Form, type ICardOwnProps, type ICardProps, type ICardsProps, Icon, Link, Loading, Modal, NativeTextField, NumberField, OTPInput, PhoneField, PinInput, Popover, ProgressIndicator, RadioGroup, Range, Select, Skeleton, type TAccordionRootProps, type TAccordionTriggerProps, type TButtonProps, type TCalloutRootProps, type TCalloutTextProps, type TCardVariants, type TCheckboxProps, type TColumnsProps, type TComboBoxItem, type TComboBoxProps, type TDatePicker, type TDisclosureProps, type TIconProps, type TItem, type TLegacyMarketingFooter, type TLegacyMarketingHeading, type TLegacyMarketingText, type TLink, type TLoadingProps, type TModalButtonProps, type TModalContentProps, type TModalControlProps, type TModalHeaderProps, type TNativeTextFieldProps, type TNumberFieldProps, type TPhoneFieldProps, type TPinInputProps, type TPopoverContentProps, type TPopoverRootProps, type TPopoverTriggerProps, type TProgressIndicatorProps, type TRadioGroupProps, type TRangeProps, type TSelectProps, type TSkeletonProps, type TTabsContent, type TTabsList, type TTabsRoot, type TTabsTrigger, type TTagProps, type TTextFieldProps, type TToastDescriptionProps, type TToastIconProps, type TToastRootProps, type TToastTitleProps, type TTooltipContentProps, type TTooltipRootProps, type TTooltipTriggerProps, type TTypography, type TTypographyProps, type TTypographyVariants, type TUseModalProps, Table, TableBody, TableData, TableFooter, TableHead, TableHeader, TableRoot, TableRow, Tabs, Tag, TextField, Toast, Tooltip, Typography, Wrapper, type WrapperProps, type WrapperVariants, useModal };
493
+ export { Accordion, Button, Buttons, Callout, Card, Cards, type CardsVariants, Checkbox, Columns, ComboBox, DatePicker, Disclosure, Field, Form, type ICardOwnProps, type ICardProps, type ICardsProps, Icon, Link, Loading, Modal, NativeNumberField, NativePhoneField, NativeTextField, NumberField, OTPInput, PhoneField, PinInput, Popover, ProgressIndicator, RadioGroup, Range, Select, Skeleton, type TAccordionRootProps, type TAccordionTriggerProps, type TButtonProps, type TCalloutRootProps, type TCalloutTextProps, type TCardVariants, type TCheckboxProps, type TColumnsProps, type TComboBoxItem, type TComboBoxProps, type TDatePicker, type TDisclosureProps, type TIconProps, type TItem, type TLegacyMarketingFooter, type TLegacyMarketingHeading, type TLegacyMarketingText, type TLink, type TLoadingProps, type TModalButtonProps, type TModalContentProps, type TModalControlProps, type TModalHeaderProps, type TNativeCountrySelectProps, type TNativeInputProps, type TNativeNumberFieldProps, type TNativeTextFieldProps, type TNumberFieldProps, type TPhoneFieldProps, type TPinInputProps, type TPopoverContentProps, type TPopoverRootProps, type TPopoverTriggerProps, type TProgressIndicatorProps, type TRadioGroupProps, type TRangeProps, type TSelectProps, type TSkeletonProps, type TTabsContent, type TTabsList, type TTabsRoot, type TTabsTrigger, type TTagProps, type TTextFieldProps, type TToastDescriptionProps, type TToastIconProps, type TToastRootProps, type TToastTitleProps, type TTooltipContentProps, type TTooltipRootProps, type TTooltipTriggerProps, type TTypography, type TTypographyProps, type TTypographyVariants, type TUseModalProps, Table, TableBody, TableData, TableFooter, TableHead, TableHeader, TableRoot, TableRow, Tabs, Tag, TextField, Toast, Tooltip, Typography, Wrapper, type WrapperProps, type WrapperVariants, useModal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kroo-web/design-system",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Web design system for Kroo including the components for the marketing site and the product side.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",