@kroo-web/design-system 1.2.6 → 1.4.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, { 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
+ };
@@ -18,3 +18,20 @@ export type TTextFieldProps<T extends FieldValues> = {
18
18
  type?: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>['type'];
19
19
  } & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
20
20
  export declare const TextField: React.ForwardRefExoticComponent<Omit<TTextFieldProps<FieldValues>, "ref"> & React.RefAttributes<HTMLInputElement>>;
21
+ export type TNativeTextFieldProps = {
22
+ className?: string;
23
+ error?: {
24
+ message: string;
25
+ };
26
+ helper?: {
27
+ message: ReactNode | string;
28
+ };
29
+ id: string;
30
+ label: string;
31
+ leftContent?: ReactNode | string;
32
+ missing?: boolean;
33
+ prefix?: ReactNode | string;
34
+ rightContent?: ReactNode | string;
35
+ suffix?: ReactNode | string;
36
+ } & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
37
+ export declare const NativeTextField: React.ForwardRefExoticComponent<Omit<TNativeTextFieldProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -2,8 +2,8 @@ import React, { ReactNode } from 'react';
2
2
  export type TFormFieldProps = {
3
3
  children: ReactNode;
4
4
  error?: string;
5
- helper?: string;
5
+ helper?: ReactNode | string;
6
6
  id: string;
7
- label: string;
7
+ label?: string;
8
8
  };
9
9
  export declare const FormField: ({ children, error, helper, 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, ChangeEventHandler, DetailedHTMLProps, InputHTMLAttributes, 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';
@@ -247,6 +247,25 @@ type TPhoneFieldProps<T extends FieldValues> = {
247
247
  placeholder?: string;
248
248
  };
249
249
  declare const PhoneField: <T extends FieldValues>(props: TPhoneFieldProps<T>) => React$1.JSX.Element;
250
+ type TNativeCountrySelectProps = {
251
+ id: string;
252
+ onChange?: ChangeEventHandler<HTMLSelectElement>;
253
+ } & DetailedHTMLProps<InputHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
254
+ type TNativeInputProps = {
255
+ className?: string;
256
+ error?: {
257
+ message: string;
258
+ };
259
+ id: string;
260
+ placeholder: string;
261
+ } & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
262
+ declare const NativePhoneField: {
263
+ CountrySelect: React$1.ForwardRefExoticComponent<Omit<TNativeCountrySelectProps, "ref"> & React$1.RefAttributes<HTMLSelectElement>>;
264
+ Input: React$1.ForwardRefExoticComponent<Omit<TNativeInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
265
+ Root: ({ children }: {
266
+ children: ReactNode;
267
+ }) => React$1.JSX.Element;
268
+ };
250
269
 
251
270
  interface TPinInputProps<T extends FieldValues> {
252
271
  isNumeric?: boolean;
@@ -394,6 +413,23 @@ type TTextFieldProps<T extends FieldValues> = {
394
413
  type?: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>['type'];
395
414
  } & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
396
415
  declare const TextField: React$1.ForwardRefExoticComponent<Omit<TTextFieldProps<FieldValues>, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
416
+ type TNativeTextFieldProps = {
417
+ className?: string;
418
+ error?: {
419
+ message: string;
420
+ };
421
+ helper?: {
422
+ message: ReactNode | string;
423
+ };
424
+ id: string;
425
+ label: string;
426
+ leftContent?: ReactNode | string;
427
+ missing?: boolean;
428
+ prefix?: ReactNode | string;
429
+ rightContent?: ReactNode | string;
430
+ suffix?: ReactNode | string;
431
+ } & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
432
+ declare const NativeTextField: React$1.ForwardRefExoticComponent<Omit<TNativeTextFieldProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
397
433
 
398
434
  type TToastRootProps = {
399
435
  children: React$1.ReactNode;
@@ -438,4 +474,4 @@ interface WrapperProps extends PropsWithChildren {
438
474
  }
439
475
  declare const Wrapper: ({ as, children, className, variants }: WrapperProps) => React$1.JSX.Element;
440
476
 
441
- 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, 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 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 };
477
+ 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, 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 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.2.6",
3
+ "version": "1.4.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",