@campxdev/react-blueprint 3.0.0-alpha.1 → 3.0.0-alpha.2

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.
Files changed (29) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/types/src/components/Input/DatePicker/DatePicker.d.ts +2 -2
  3. package/dist/cjs/types/src/components/Input/DateTimePicker/DateTimePicker.d.ts +2 -2
  4. package/dist/cjs/types/src/components/Input/TextField/TextField.d.ts +2 -1
  5. package/dist/cjs/types/src/components/Input/Textarea/Textarea.d.ts +12 -0
  6. package/dist/cjs/types/src/components/Input/export.d.ts +1 -0
  7. package/dist/cjs/types/src/components/Layout/AppLayout/index.d.ts +1 -0
  8. package/dist/cjs/types/src/shadcn-components/Input/Textarea/Textarea.d.ts +3 -0
  9. package/dist/esm/index.js +2 -2
  10. package/dist/esm/types/src/components/Input/DatePicker/DatePicker.d.ts +2 -2
  11. package/dist/esm/types/src/components/Input/DateTimePicker/DateTimePicker.d.ts +2 -2
  12. package/dist/esm/types/src/components/Input/TextField/TextField.d.ts +2 -1
  13. package/dist/esm/types/src/components/Input/Textarea/Textarea.d.ts +12 -0
  14. package/dist/esm/types/src/components/Input/export.d.ts +1 -0
  15. package/dist/esm/types/src/components/Layout/AppLayout/index.d.ts +1 -0
  16. package/dist/esm/types/src/shadcn-components/Input/Textarea/Textarea.d.ts +3 -0
  17. package/dist/index.d.ts +75 -14
  18. package/dist/styles.css +7 -1
  19. package/package.json +1 -1
  20. package/src/components/DataDisplay/DataTable/components/TableHeaders/TableActionHeader.tsx +1 -1
  21. package/src/components/Input/DatePicker/DatePicker.tsx +38 -21
  22. package/src/components/Input/DateTimePicker/DateTimePicker.tsx +44 -27
  23. package/src/components/Input/MultiSelect/components/MultiSelectInput.tsx +1 -1
  24. package/src/components/Input/SingleSelect/components/SingleInput.tsx +1 -1
  25. package/src/components/Input/TextField/TextField.tsx +7 -0
  26. package/src/components/Input/Textarea/Textarea.tsx +67 -0
  27. package/src/components/Input/export.ts +1 -0
  28. package/src/components/Layout/AppLayout/index.ts +3 -0
  29. package/src/shadcn-components/Input/Textarea/Textarea.tsx +18 -0
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  type DateFormat = 'yyyy' | 'MMMM yyyy' | 'dd MMMM yyyy' | 'dd/MM/yyyy';
3
2
  export type DatePickerProps = {
4
3
  label?: React.ReactNode | string;
@@ -28,7 +27,8 @@ export type DatePickerProps = {
28
27
  onOpen?: () => void;
29
28
  onClose?: () => void;
30
29
  onBlur?: React.FocusEventHandler;
30
+ fullWidth?: boolean;
31
31
  [key: string]: any;
32
32
  };
33
- export declare const DatePicker: ({ label, name, value, onChange, required, format, helperText, placeholder, shortcutsItems, openPickerIcon: Icon, containerProps, error, disabled, minDate, maxDate, disablePast, disableFuture, shouldDisableDate, shouldDisableMonth, shouldDisableYear, className, onOpen, onClose, ...rest }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
33
+ export declare const DatePicker: ({ label, name, value, onChange, required, format, helperText, placeholder, shortcutsItems, openPickerIcon: Icon, containerProps, error, disabled, minDate, maxDate, disablePast, disableFuture, shouldDisableDate, shouldDisableMonth, shouldDisableYear, className, onOpen, onClose, fullWidth, ...rest }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
34
34
  export {};
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  type DateTimePickerViews = 'year' | 'month' | 'day' | 'hours' | 'minutes' | 'seconds';
3
2
  type DateTimeFormat = 'yyyy' | 'MMMM yyyy' | 'MMM yyyy' | 'dd MMMM yyyy' | 'dd/MM/yyyy' | 'MM/dd/yyyy' | 'yyyy-MM-dd' | 'yyyy-MM-dd hh:mm a' | 'dd MMM yyyy hh:mm a' | 'dd/MM/yyyy hh:mm a' | 'yyyy-MM-dd hh:mm:ss a' | 'dd MMM yyyy hh:mm:ss a' | 'dd/MM/yyyy hh:mm:ss a' | 'hh:mm a' | 'hh:mm:ss a' | 'MMM dd, yyyy hh:mm a' | 'MMM dd, yyyy hh:mm:ss a' | 'EEE, MMM dd yyyy' | 'EEEE, MMMM dd, yyyy';
4
3
  export type DateTimePickerProps = {
@@ -30,7 +29,8 @@ export type DateTimePickerProps = {
30
29
  onOpen?: () => void;
31
30
  onClose?: () => void;
32
31
  onBlur?: React.FocusEventHandler;
32
+ fullWidth?: boolean;
33
33
  [key: string]: any;
34
34
  };
35
- export declare const DateTimePicker: ({ label, name, value, onChange, required, format, views, helperText, placeholder, shortcutsItems, openPickerIcon: Icon, containerProps, error, disabled, minDate, maxDate, disablePast, disableFuture, shouldDisableDate, shouldDisableMonth, shouldDisableYear, className, onOpen, onClose, ...rest }: DateTimePickerProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const DateTimePicker: ({ label, name, value, onChange, required, format, views, helperText, placeholder, shortcutsItems, openPickerIcon: Icon, containerProps, error, disabled, minDate, maxDate, disablePast, disableFuture, shouldDisableDate, shouldDisableMonth, shouldDisableYear, className, onOpen, onClose, fullWidth, ...rest }: DateTimePickerProps) => import("react/jsx-runtime").JSX.Element;
36
36
  export {};
@@ -7,5 +7,6 @@ export type TextFieldProps = {
7
7
  required?: boolean;
8
8
  fullWidth?: boolean;
9
9
  error?: boolean;
10
+ helperText?: React.ReactNode;
10
11
  } & React.ComponentProps<typeof Input>;
11
- export declare const TextField: ({ name, label, value, onChange, required, containerProps, description, fullWidth, className, error, ...rest }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const TextField: ({ name, label, value, onChange, required, containerProps, description, fullWidth, className, error, helperText, ...rest }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { Textarea as ShadcnTextarea } from '@/shadcn-components/Input/Textarea/Textarea';
2
+ import * as React from 'react';
3
+ export type TextareaProps = {
4
+ containerProps?: React.HTMLAttributes<HTMLDivElement>;
5
+ description?: string;
6
+ label?: React.ReactNode | string;
7
+ required?: boolean;
8
+ fullWidth?: boolean;
9
+ error?: boolean;
10
+ helperText?: React.ReactNode;
11
+ } & React.ComponentProps<typeof ShadcnTextarea>;
12
+ export declare const Textarea: ({ name, label, value, onChange, required, containerProps, description, fullWidth, className, error, helperText, ...rest }: TextareaProps) => import("react/jsx-runtime").JSX.Element;
@@ -17,4 +17,5 @@ export * from './Select/Select';
17
17
  export * from './SingleCheckBox/SingleCheckBox';
18
18
  export * from './SingleSelect/SingleSelect';
19
19
  export * from './Switch/Switch';
20
+ export * from './Textarea/Textarea';
20
21
  export * from './TextField/TextField';
@@ -3,3 +3,4 @@ export type { AppLayoutProps, HelpDocsAction, HelpDocsConfig } from './types';
3
3
  export { SidebarProvider, useSidebar } from './context/SidebarContext';
4
4
  export { MenuToggleButton } from './components/MenuToggleButton';
5
5
  export { UserProfilePopup } from './components/UserProfilePopup';
6
+ export * from './components/Sidebar/interfaces';
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare function Textarea({ className, ...props }: React.ComponentProps<'textarea'>): import("react/jsx-runtime").JSX.Element;
3
+ export { Textarea };
package/dist/index.d.ts CHANGED
@@ -510,7 +510,7 @@ type DataTableProps<TData = any> = {
510
510
  declare const DataTable: <TData extends Record<string, any> = any>(props: DataTableProps<TData>) => react_jsx_runtime.JSX.Element;
511
511
 
512
512
  declare const typographyVariants: (props?: ({
513
- variant?: "blockquote" | "h1" | "h2" | "h3" | "h4" | "p" | "small" | "list" | "muted" | "inlineCode" | "lead" | "large" | null | undefined;
513
+ variant?: "blockquote" | "h1" | "h2" | "h3" | "h4" | "p" | "small" | "list" | "inlineCode" | "lead" | "large" | "muted" | null | undefined;
514
514
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
515
515
  interface TypographyProps extends React$1.HTMLAttributes<HTMLElement>, VariantProps<typeof typographyVariants> {
516
516
  as?: React$1.ElementType;
@@ -627,7 +627,7 @@ declare const Button: ({ loading, disabled, children, startIcon, endIcon, fullWi
627
627
 
628
628
  type DateFormat = 'yyyy' | 'MMMM yyyy' | 'dd MMMM yyyy' | 'dd/MM/yyyy';
629
629
  type DatePickerProps = {
630
- label?: React$1.ReactNode | string;
630
+ label?: React.ReactNode | string;
631
631
  name?: string;
632
632
  value?: Date;
633
633
  onChange?: (date: Date | undefined) => void;
@@ -639,8 +639,8 @@ type DatePickerProps = {
639
639
  getValue: () => Date;
640
640
  }[];
641
641
  required?: boolean;
642
- containerProps?: React$1.HTMLAttributes<HTMLDivElement>;
643
- openPickerIcon?: React$1.ReactNode;
642
+ containerProps?: React.HTMLAttributes<HTMLDivElement>;
643
+ openPickerIcon?: React.ReactNode;
644
644
  error?: any;
645
645
  disabled?: boolean;
646
646
  minDate?: Date;
@@ -653,15 +653,16 @@ type DatePickerProps = {
653
653
  className?: string;
654
654
  onOpen?: () => void;
655
655
  onClose?: () => void;
656
- onBlur?: React$1.FocusEventHandler;
656
+ onBlur?: React.FocusEventHandler;
657
+ fullWidth?: boolean;
657
658
  [key: string]: any;
658
659
  };
659
- declare const DatePicker: ({ label, name, value, onChange, required, format, helperText, placeholder, shortcutsItems, openPickerIcon: Icon, containerProps, error, disabled, minDate, maxDate, disablePast, disableFuture, shouldDisableDate, shouldDisableMonth, shouldDisableYear, className, onOpen, onClose, ...rest }: DatePickerProps) => react_jsx_runtime.JSX.Element;
660
+ declare const DatePicker: ({ label, name, value, onChange, required, format, helperText, placeholder, shortcutsItems, openPickerIcon: Icon, containerProps, error, disabled, minDate, maxDate, disablePast, disableFuture, shouldDisableDate, shouldDisableMonth, shouldDisableYear, className, onOpen, onClose, fullWidth, ...rest }: DatePickerProps) => react_jsx_runtime.JSX.Element;
660
661
 
661
662
  type DateTimePickerViews = 'year' | 'month' | 'day' | 'hours' | 'minutes' | 'seconds';
662
663
  type DateTimeFormat = 'yyyy' | 'MMMM yyyy' | 'MMM yyyy' | 'dd MMMM yyyy' | 'dd/MM/yyyy' | 'MM/dd/yyyy' | 'yyyy-MM-dd' | 'yyyy-MM-dd hh:mm a' | 'dd MMM yyyy hh:mm a' | 'dd/MM/yyyy hh:mm a' | 'yyyy-MM-dd hh:mm:ss a' | 'dd MMM yyyy hh:mm:ss a' | 'dd/MM/yyyy hh:mm:ss a' | 'hh:mm a' | 'hh:mm:ss a' | 'MMM dd, yyyy hh:mm a' | 'MMM dd, yyyy hh:mm:ss a' | 'EEE, MMM dd yyyy' | 'EEEE, MMMM dd, yyyy';
663
664
  type DateTimePickerProps = {
664
- label?: React$1.ReactNode | string;
665
+ label?: React.ReactNode | string;
665
666
  name?: string;
666
667
  value?: Date;
667
668
  onChange?: (date: Date | undefined) => void;
@@ -674,8 +675,8 @@ type DateTimePickerProps = {
674
675
  getValue: () => Date;
675
676
  }[];
676
677
  required?: boolean;
677
- containerProps?: React$1.HTMLAttributes<HTMLDivElement>;
678
- openPickerIcon?: React$1.ReactNode;
678
+ containerProps?: React.HTMLAttributes<HTMLDivElement>;
679
+ openPickerIcon?: React.ReactNode;
679
680
  error?: any;
680
681
  disabled?: boolean;
681
682
  minDate?: Date;
@@ -688,10 +689,11 @@ type DateTimePickerProps = {
688
689
  className?: string;
689
690
  onOpen?: () => void;
690
691
  onClose?: () => void;
691
- onBlur?: React$1.FocusEventHandler;
692
+ onBlur?: React.FocusEventHandler;
693
+ fullWidth?: boolean;
692
694
  [key: string]: any;
693
695
  };
694
- declare const DateTimePicker: ({ label, name, value, onChange, required, format, views, helperText, placeholder, shortcutsItems, openPickerIcon: Icon, containerProps, error, disabled, minDate, maxDate, disablePast, disableFuture, shouldDisableDate, shouldDisableMonth, shouldDisableYear, className, onOpen, onClose, ...rest }: DateTimePickerProps) => react_jsx_runtime.JSX.Element;
696
+ declare const DateTimePicker: ({ label, name, value, onChange, required, format, views, helperText, placeholder, shortcutsItems, openPickerIcon: Icon, containerProps, error, disabled, minDate, maxDate, disablePast, disableFuture, shouldDisableDate, shouldDisableMonth, shouldDisableYear, className, onOpen, onClose, fullWidth, ...rest }: DateTimePickerProps) => react_jsx_runtime.JSX.Element;
695
697
 
696
698
  type FileUploadProps = {
697
699
  label: string;
@@ -957,6 +959,19 @@ interface SwitchProps extends React$1.ComponentPropsWithoutRef<typeof Switch$1>
957
959
  }
958
960
  declare const Switch: React$1.ForwardRefExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
959
961
 
962
+ declare function Textarea$1({ className, ...props }: React$1.ComponentProps<'textarea'>): react_jsx_runtime.JSX.Element;
963
+
964
+ type TextareaProps = {
965
+ containerProps?: React$1.HTMLAttributes<HTMLDivElement>;
966
+ description?: string;
967
+ label?: React$1.ReactNode | string;
968
+ required?: boolean;
969
+ fullWidth?: boolean;
970
+ error?: boolean;
971
+ helperText?: React$1.ReactNode;
972
+ } & React$1.ComponentProps<typeof Textarea$1>;
973
+ declare const Textarea: ({ name, label, value, onChange, required, containerProps, description, fullWidth, className, error, helperText, ...rest }: TextareaProps) => react_jsx_runtime.JSX.Element;
974
+
960
975
  declare function Input({ className, type, ...props }: React$1.ComponentProps<"input">): react_jsx_runtime.JSX.Element;
961
976
 
962
977
  type TextFieldProps = {
@@ -966,8 +981,9 @@ type TextFieldProps = {
966
981
  required?: boolean;
967
982
  fullWidth?: boolean;
968
983
  error?: boolean;
984
+ helperText?: React$1.ReactNode;
969
985
  } & React$1.ComponentProps<typeof Input>;
970
- declare const TextField: ({ name, label, value, onChange, required, containerProps, description, fullWidth, className, error, ...rest }: TextFieldProps) => react_jsx_runtime.JSX.Element;
986
+ declare const TextField: ({ name, label, value, onChange, required, containerProps, description, fullWidth, className, error, helperText, ...rest }: TextFieldProps) => react_jsx_runtime.JSX.Element;
971
987
 
972
988
  interface SideMenuItemProps {
973
989
  name: string;
@@ -982,6 +998,51 @@ interface SubMenuData {
982
998
  path: string;
983
999
  permissionKey?: string;
984
1000
  }
1001
+ interface MenuState {
1002
+ menu: SideMenuItemProps[];
1003
+ title: string | null;
1004
+ path: string | null;
1005
+ }
1006
+ interface GetActiveMenuProps {
1007
+ menu: SideMenuItemProps[];
1008
+ pathArray: string[];
1009
+ previousMenuState: any;
1010
+ }
1011
+ interface InternalMenuClickHandlerProps {
1012
+ menuTitle: string;
1013
+ menuPath: string;
1014
+ internalMenu: SideMenuItemProps[];
1015
+ }
1016
+ interface SidebarNavigationHook {
1017
+ menuPosition: number;
1018
+ currentMenuState: MenuState;
1019
+ history: MenuState[];
1020
+ internalMenuClickHandler: (params: InternalMenuClickHandlerProps) => void;
1021
+ previousMenuClickHandler: () => void;
1022
+ }
1023
+ interface MenuItemProps {
1024
+ index: number;
1025
+ menuItem: SideMenuItemProps;
1026
+ currentMenuPath: string | null;
1027
+ internalMenuClickHandler: (params: InternalMenuClickHandlerProps) => void;
1028
+ onClose?: () => void;
1029
+ collapsed?: boolean;
1030
+ setCollapsed?: any;
1031
+ }
1032
+ interface SubMenuItemProps {
1033
+ index: number;
1034
+ subMenuItem: SubMenuData;
1035
+ subMenuButtonPath: string;
1036
+ }
1037
+ interface MenuBarProps {
1038
+ currentMenuState: MenuState;
1039
+ menuPosition: number;
1040
+ internalMenuClickHandler: (params: InternalMenuClickHandlerProps) => void;
1041
+ previousMenuClickHandler: () => void;
1042
+ onClose?: () => void;
1043
+ collapsed?: boolean;
1044
+ setCollapsed?: any;
1045
+ }
985
1046
 
986
1047
  interface UserProfilePopupProps {
987
1048
  /** User's full name */
@@ -1497,5 +1558,5 @@ declare const splitBreadcrumbIdSlug: (param: string) => {
1497
1558
  declare const isLocal: boolean;
1498
1559
  declare const isDevelopment: boolean;
1499
1560
 
1500
- export { Accordion, ActivityLogView, Alert, AnimatedGIFs, AppLayout, Breadcrumbs, Button, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, Card$1 as CardRoot, CardTitle, Chip, Chips, CircularAvatar, ComingSoon, ConfirmDialog, DataTable, DatePicker, DateTimePicker, Dialog, DialogButton, DropDownButton, DropDownIcon, DropdownMenu, DropdownMenuItem, EmptyIllustration, FileUpload, FormActions, FormControlWrapper, FormWrapper, HorizontalBarChart, HorizontalStepper, IconButtons, Icons, InternalServerError, LabelWrapper, LineChart, MenuToggleButton, MultiCheckBox, MultiSelect, NoInterneConnection, NoItemFound, OtpInput, PageContent, PageHeader, PageNotFound, PasswordField, PieChart, PreviewFiles, RadioGroup, ReactJoyRide, ResourceNotFound, SearchBar, Select, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarProvider, SingleCheckBox, SingleSelect, Skeleton, Snackbar, Spinner, StatusCard, Stepper, Svgs, Switch, TablePagination, TabsContainer, TextField, Timeline, Tooltip, Typography, UnAuthorized, UploadDialog, UserProfilePopup, VerticalBarChart, VerticalStepper, buttonVariants, calculateEventStats, cn, createBreadcrumbIdSlug, exportEventsToCSV, filterEventsByDateRange, generateBusinessEvents, generateRecurringEvents, getBreadcrumbsCharacter, groupEventsByDate, isDevelopment, isLocal, reactBlueprintReducers, splitBreadcrumbIdSlug, typographyVariants, useMediaQuery, usePageHeader, useParams, useSidebar, useUrlParams, validateEvent };
1501
- export type { AccordionItemProps, Activity, ActivityAction, AlertProps, AppLayoutProps, BarChartData, BarChartProps, BarChartVariant, BreadcrumbsProps, ButtonConfig, ButtonProps, CalendarDateClickInfo, CalendarDateSelectInfo, CalendarEvent, CalendarEventClickInfo, CalendarEventDropInfo, CalendarEventResizeInfo, CalendarHeaderToolbar, CalendarProps, CalendarView, CardProps, ChartConfig, CheckboxProps, ChipProps, CircularAvatarProps, ConfirmDialogProps, ConfirmDialogType, DataTableProps, DatePickerProps, DateTimePickerProps, DialogButtonProps, DialogProps, DropdownMenuItemProps, DropdownMenuProps, EventStats, FileUploadProps, FormActionsProps, HelpDocsAction, HelpDocsConfig, HorizontalBarChartProps, IconComponent, IconProps, IconsType, LabelWrapperProps, LineChartProps, MaxWidthSize$1 as MaxWidthSize, MultiCheckboxProps, MultiSelectProps, OtpInputProps, PageHeaderProps, PaginationProps, PasswordFieldProps, PieChartProps, PreviewFilesProps, RadioGroupProps, RecurringEventConfig, SearchBarProps, SelectProps, Severity, SingleSelectProps, SnackbarPosition, SnackbarProps, StatusCardProps, StepItem, StepperProps, StepperVariantProps, SwitchProps, TabsContainerProps, TextFieldProps, TimelineItems, TimelineProps, TooltipProps, TreeMapProps, TypographyProps, UploadDialogProps, VerticalBarChartProps };
1561
+ export { Accordion, ActivityLogView, Alert, AnimatedGIFs, AppLayout, Breadcrumbs, Button, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, Card$1 as CardRoot, CardTitle, Chip, Chips, CircularAvatar, ComingSoon, ConfirmDialog, DataTable, DatePicker, DateTimePicker, Dialog, DialogButton, DropDownButton, DropDownIcon, DropdownMenu, DropdownMenuItem, EmptyIllustration, FileUpload, FormActions, FormControlWrapper, FormWrapper, HorizontalBarChart, HorizontalStepper, IconButtons, Icons, InternalServerError, LabelWrapper, LineChart, MenuToggleButton, MultiCheckBox, MultiSelect, NoInterneConnection, NoItemFound, OtpInput, PageContent, PageHeader, PageNotFound, PasswordField, PieChart, PreviewFiles, RadioGroup, ReactJoyRide, ResourceNotFound, SearchBar, Select, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarProvider, SingleCheckBox, SingleSelect, Skeleton, Snackbar, Spinner, StatusCard, Stepper, Svgs, Switch, TablePagination, TabsContainer, TextField, Textarea, Timeline, Tooltip, Typography, UnAuthorized, UploadDialog, UserProfilePopup, VerticalBarChart, VerticalStepper, buttonVariants, calculateEventStats, cn, createBreadcrumbIdSlug, exportEventsToCSV, filterEventsByDateRange, generateBusinessEvents, generateRecurringEvents, getBreadcrumbsCharacter, groupEventsByDate, isDevelopment, isLocal, reactBlueprintReducers, splitBreadcrumbIdSlug, typographyVariants, useMediaQuery, usePageHeader, useParams, useSidebar, useUrlParams, validateEvent };
1562
+ export type { AccordionItemProps, Activity, ActivityAction, AlertProps, AppLayoutProps, BarChartData, BarChartProps, BarChartVariant, BreadcrumbsProps, ButtonConfig, ButtonProps, CalendarDateClickInfo, CalendarDateSelectInfo, CalendarEvent, CalendarEventClickInfo, CalendarEventDropInfo, CalendarEventResizeInfo, CalendarHeaderToolbar, CalendarProps, CalendarView, CardProps, ChartConfig, CheckboxProps, ChipProps, CircularAvatarProps, ConfirmDialogProps, ConfirmDialogType, DataTableProps, DatePickerProps, DateTimePickerProps, DialogButtonProps, DialogProps, DropdownMenuItemProps, DropdownMenuProps, EventStats, FileUploadProps, FormActionsProps, GetActiveMenuProps, HelpDocsAction, HelpDocsConfig, HorizontalBarChartProps, IconComponent, IconProps, IconsType, InternalMenuClickHandlerProps, LabelWrapperProps, LineChartProps, MaxWidthSize$1 as MaxWidthSize, MenuBarProps, MenuItemProps, MenuState, MultiCheckboxProps, MultiSelectProps, OtpInputProps, PageHeaderProps, PaginationProps, PasswordFieldProps, PieChartProps, PreviewFilesProps, RadioGroupProps, RecurringEventConfig, SearchBarProps, SelectProps, Severity, SideMenuItemProps, SidebarNavigationHook, SingleSelectProps, SnackbarPosition, SnackbarProps, StatusCardProps, StepItem, StepperProps, StepperVariantProps, SubMenuData, SubMenuItemProps, SwitchProps, TabsContainerProps, TextFieldProps, TextareaProps, TimelineItems, TimelineProps, TooltipProps, TreeMapProps, TypographyProps, UploadDialogProps, VerticalBarChartProps };
package/dist/styles.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
2
2
  @import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');
3
3
  @layer properties;
4
4
  @layer theme, base, components, utilities;
@@ -603,6 +603,9 @@
603
603
  .table-row {
604
604
  display: table-row;
605
605
  }
606
+ .field-sizing-content {
607
+ field-sizing: content;
608
+ }
606
609
  .aspect-square {
607
610
  aspect-ratio: 1 / 1;
608
611
  }
@@ -790,6 +793,9 @@
790
793
  .min-h-4 {
791
794
  min-height: calc(var(--spacing) * 4);
792
795
  }
796
+ .min-h-16 {
797
+ min-height: calc(var(--spacing) * 16);
798
+ }
793
799
  .min-h-\[2rem\] {
794
800
  min-height: 2rem;
795
801
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/react-blueprint",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.2",
4
4
  "description": "React UI component library for CampX applications",
5
5
  "author": "CampX",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@ const TableActionHeader = ({
33
33
  viewsProps.type,
34
34
  async (): Promise<View[]> => {
35
35
  return viewsProps.axios
36
- .get(`admin/views/user-views/${viewsProps.type}`)
36
+ .get(`/admin/views/user-views/${viewsProps.type}`)
37
37
  .then((data) => data.data);
38
38
  },
39
39
  );
@@ -7,7 +7,7 @@ import {
7
7
  } from '@/shadcn-components/Input/Popover/Popover';
8
8
  import { format as DateFnsFormat } from 'date-fns';
9
9
  import { CalendarDays } from 'lucide-react';
10
- import * as React from 'react';
10
+ import { cloneElement, useEffect, useRef, useState } from 'react';
11
11
  import { Typography } from '../../DataDisplay/Typography/Typography';
12
12
  import { Button } from '../Button/Button';
13
13
  import { LabelWrapper } from '../LabelWrapper/LabelWrapper';
@@ -39,6 +39,7 @@ export type DatePickerProps = {
39
39
  onOpen?: () => void;
40
40
  onClose?: () => void;
41
41
  onBlur?: React.FocusEventHandler;
42
+ fullWidth?: boolean;
42
43
  [key: string]: any;
43
44
  };
44
45
 
@@ -66,10 +67,12 @@ export const DatePicker = ({
66
67
  className,
67
68
  onOpen,
68
69
  onClose,
70
+ fullWidth,
69
71
  ...rest
70
72
  }: DatePickerProps) => {
71
- const [open, setOpen] = React.useState(false);
72
- const [date, setDate] = React.useState<Date | undefined>(value);
73
+ const [open, setOpen] = useState(false);
74
+ const [date, setDate] = useState<Date | undefined>(value);
75
+ const wrapperRef = useRef<HTMLSpanElement>(null);
73
76
 
74
77
  const formatDateString = (date: Date | undefined) => {
75
78
  if (!date) return '';
@@ -90,32 +93,46 @@ export const DatePicker = ({
90
93
  }
91
94
  };
92
95
 
96
+ const [, forceUpdate] = useState({});
97
+ useEffect(() => {
98
+ forceUpdate({});
99
+ }, []);
100
+
93
101
  return (
94
102
  <LabelWrapper
95
103
  label={label}
96
104
  required={required}
97
105
  name={name}
98
- containerProps={containerProps}
106
+ containerProps={{
107
+ ...(fullWidth && { style: { width: '100%' } }),
108
+ ...containerProps,
109
+ }}
99
110
  >
100
111
  <Popover open={open} onOpenChange={handleOpenChange}>
101
112
  <PopoverTrigger asChild>
102
- <Button
103
- variant="input"
104
- className={cn(
105
- 'w-full justify-between text-left font-normal',
106
- // !date && 'text-muted-foreground',
107
- error && 'border-destructive',
108
- className,
109
- )}
110
- disabled={disabled}
111
- {...rest}
113
+ <span
114
+ ref={wrapperRef}
115
+ style={{ display: fullWidth ? 'block' : 'inline-block' }}
112
116
  >
113
- <span>{date ? formatDateString(date) : placeholder}</span>
114
- {Icon &&
115
- React.cloneElement(Icon as React.ReactElement, {
116
- className: 'ml-2 h-4 w-4',
117
- })}
118
- </Button>
117
+ <Button
118
+ variant="input"
119
+ className={cn(
120
+ 'justify-between text-left font-normal',
121
+ !date && 'text-muted-foreground',
122
+ error && 'border-destructive',
123
+ fullWidth ? 'w-full' : 'w-auto',
124
+ className,
125
+ )}
126
+ disabled={disabled}
127
+ {...rest}
128
+ >
129
+ <span>{date ? formatDateString(date) : placeholder}</span>
130
+ {Icon &&
131
+ cloneElement(Icon as React.ReactElement, {
132
+ className: 'ml-2 h-4 w-4',
133
+ })}
134
+ </Button>
135
+ </span>
119
136
  </PopoverTrigger>
120
137
  <PopoverContent className="w-auto p-0" align="start">
121
138
  <div className="flex flex-col">
@@ -199,7 +216,7 @@ export const DatePicker = ({
199
216
  variant="small"
200
217
  className={cn('ml-1 mt-1', error && 'text-destructive')}
201
218
  >
202
- {error || helperText}
219
+ {typeof error === 'string' ? error : error?.message || helperText}
203
220
  </Typography>
204
221
  )}
205
222
  </LabelWrapper>
@@ -8,7 +8,7 @@ import {
8
8
  } from '@/shadcn-components/Input/Popover/Popover';
9
9
  import { format as DateFnsFormat } from 'date-fns';
10
10
  import { CalendarDays } from 'lucide-react';
11
- import * as React from 'react';
11
+ import { cloneElement, useEffect, useMemo, useRef, useState } from 'react';
12
12
  import { Typography } from '../../DataDisplay/Typography/Typography';
13
13
  import { Button } from '../Button/Button';
14
14
  import { LabelWrapper } from '../LabelWrapper/LabelWrapper';
@@ -68,6 +68,7 @@ export type DateTimePickerProps = {
68
68
  onOpen?: () => void;
69
69
  onClose?: () => void;
70
70
  onBlur?: React.FocusEventHandler;
71
+ fullWidth?: boolean;
71
72
  [key: string]: any;
72
73
  };
73
74
 
@@ -96,14 +97,16 @@ export const DateTimePicker = ({
96
97
  className,
97
98
  onOpen,
98
99
  onClose,
100
+ fullWidth,
99
101
  ...rest
100
102
  }: DateTimePickerProps) => {
101
- const [open, setOpen] = React.useState(false);
102
- const [dateTime, setDateTime] = React.useState<Date | undefined>(value);
103
- const [timeValue, setTimeValue] = React.useState<string>('');
103
+ const [open, setOpen] = useState(false);
104
+ const [dateTime, setDateTime] = useState<Date | undefined>(value);
105
+ const [timeValue, setTimeValue] = useState<string>('');
106
+ const wrapperRef = useRef<HTMLSpanElement>(null);
104
107
 
105
108
  // Determine view configurations based on views prop
106
- const viewConfig = React.useMemo(() => {
109
+ const viewConfig = useMemo(() => {
107
110
  const hasTime =
108
111
  views.includes('hours') ||
109
112
  views.includes('minutes') ||
@@ -120,7 +123,7 @@ export const DateTimePicker = ({
120
123
  }, [views]);
121
124
 
122
125
  // Update time value when dateTime changes
123
- React.useEffect(() => {
126
+ useEffect(() => {
124
127
  if (dateTime && viewConfig.showTime) {
125
128
  const hours = dateTime.getHours(),
126
129
  minutes = dateTime.getMinutes(),
@@ -184,6 +187,11 @@ export const DateTimePicker = ({
184
187
  }
185
188
  };
186
189
 
190
+ const [, forceUpdate] = useState({});
191
+ useEffect(() => {
192
+ forceUpdate({});
193
+ }, []);
194
+
187
195
  // If only time selection (no date), render native time input directly
188
196
  if (viewConfig.showTime && !viewConfig.showDate) {
189
197
  return (
@@ -214,7 +222,7 @@ export const DateTimePicker = ({
214
222
  variant="small"
215
223
  className={cn('ml-1 mt-1', error && 'text-destructive')}
216
224
  >
217
- {error || helperText}
225
+ {typeof error === 'string' ? error : error?.message || helperText}
218
226
  </Typography>
219
227
  )}
220
228
  </LabelWrapper>
@@ -226,29 +234,38 @@ export const DateTimePicker = ({
226
234
  label={label}
227
235
  required={required}
228
236
  name={name}
229
- containerProps={containerProps}
237
+ containerProps={{
238
+ ...(fullWidth && { style: { width: '100%' } }),
239
+ ...containerProps,
240
+ }}
230
241
  >
231
242
  <Popover open={open} onOpenChange={handleOpenChange}>
232
243
  <PopoverTrigger asChild>
233
- <Button
234
- variant="input"
235
- className={cn(
236
- 'w-full justify-between text-left font-normal',
237
- !dateTime && 'text-muted-foreground',
238
- error && 'border-destructive',
239
- className,
240
- )}
241
- disabled={disabled}
242
- {...rest}
244
+ <span
245
+ ref={wrapperRef}
246
+ style={{ display: fullWidth ? 'block' : 'inline-block' }}
243
247
  >
244
- <span>
245
- {dateTime ? formatDateTimeString(dateTime) : placeholder}
246
- </span>
247
- {Icon &&
248
- React.cloneElement(Icon as React.ReactElement, {
249
- className: 'ml-2 h-4 w-4 ',
250
- })}
251
- </Button>
248
+ <Button
249
+ variant="input"
250
+ className={cn(
251
+ 'w-full justify-between text-left font-normal',
252
+ !dateTime && 'text-muted-foreground',
253
+ error && 'border-destructive',
254
+ fullWidth ? 'w-full' : 'w-auto',
255
+ className,
256
+ )}
257
+ disabled={disabled}
258
+ {...rest}
259
+ >
260
+ <span>
261
+ {dateTime ? formatDateTimeString(dateTime) : placeholder}
262
+ </span>
263
+ {Icon &&
264
+ cloneElement(Icon as React.ReactElement, {
265
+ className: 'ml-2 h-4 w-4 ',
266
+ })}
267
+ </Button>
268
+ </span>
252
269
  </PopoverTrigger>
253
270
  <PopoverContent className="w-auto p-0" align="start">
254
271
  <div className="flex flex-col">
@@ -334,7 +351,7 @@ export const DateTimePicker = ({
334
351
  variant="small"
335
352
  className={cn('ml-1 mt-1', error && 'text-destructive')}
336
353
  >
337
- {error || helperText}
354
+ {typeof error === 'string' ? error : error?.message || helperText}
338
355
  </Typography>
339
356
  )}
340
357
  </LabelWrapper>
@@ -232,7 +232,7 @@ export const MultiSelectInput = ({
232
232
  variant="muted"
233
233
  className={cn('text-xs', error && 'text-destructive')}
234
234
  >
235
- {error || helperText}
235
+ {typeof error === 'string' ? error : error?.message || helperText}
236
236
  </Typography>
237
237
  )}
238
238
  </LabelWrapper>
@@ -198,7 +198,7 @@ export const SingleInput = ({
198
198
  variant="muted"
199
199
  className={cn('text-xs', error && 'text-destructive')}
200
200
  >
201
- {error || helperText}
201
+ {typeof error === 'string' ? error : error?.message || helperText}
202
202
  </Typography>
203
203
  )}
204
204
  </LabelWrapper>
@@ -11,6 +11,7 @@ export type TextFieldProps = {
11
11
  required?: boolean;
12
12
  fullWidth?: boolean;
13
13
  error?: boolean;
14
+ helperText?: React.ReactNode;
14
15
  } & React.ComponentProps<typeof Input>;
15
16
 
16
17
  export const TextField = ({
@@ -24,6 +25,7 @@ export const TextField = ({
24
25
  fullWidth,
25
26
  className,
26
27
  error = false,
28
+ helperText,
27
29
  ...rest
28
30
  }: TextFieldProps) => {
29
31
  return (
@@ -50,6 +52,11 @@ export const TextField = ({
50
52
  aria-invalid={error}
51
53
  {...rest}
52
54
  />
55
+ {helperText && (
56
+ <Typography variant="muted" className={cn(error && 'text-destructive')}>
57
+ {helperText}
58
+ </Typography>
59
+ )}
53
60
  {description && (
54
61
  <Typography variant="muted" className={cn(error && 'text-destructive')}>
55
62
  {description}
@@ -0,0 +1,67 @@
1
+ import { cn } from '@/lib/utils';
2
+ import { Typography } from '@/shadcn-components/DataDisplay/Typography/Typography';
3
+ import { Textarea as ShadcnTextarea } from '@/shadcn-components/Input/Textarea/Textarea';
4
+ import * as React from 'react';
5
+ import { LabelWrapper } from '../LabelWrapper/LabelWrapper';
6
+
7
+ export type TextareaProps = {
8
+ containerProps?: React.HTMLAttributes<HTMLDivElement>;
9
+ description?: string;
10
+ label?: React.ReactNode | string;
11
+ required?: boolean;
12
+ fullWidth?: boolean;
13
+ error?: boolean;
14
+ helperText?: React.ReactNode;
15
+ } & React.ComponentProps<typeof ShadcnTextarea>;
16
+
17
+ export const Textarea = ({
18
+ name,
19
+ label,
20
+ value,
21
+ onChange,
22
+ required = false,
23
+ containerProps,
24
+ description,
25
+ fullWidth,
26
+ className,
27
+ error = false,
28
+ helperText,
29
+ ...rest
30
+ }: TextareaProps) => {
31
+ return (
32
+ <LabelWrapper
33
+ label={label}
34
+ required={required}
35
+ name={name}
36
+ containerProps={{
37
+ ...(fullWidth && { style: { width: '100%' } }),
38
+ ...containerProps,
39
+ }}
40
+ >
41
+ <ShadcnTextarea
42
+ id={name}
43
+ value={value}
44
+ name={name}
45
+ onChange={onChange}
46
+ className={cn(
47
+ fullWidth && 'w-full',
48
+ 'bg-input-background border-none placeholder:text-muted-foreground',
49
+ className,
50
+ )}
51
+ required={required}
52
+ aria-invalid={error}
53
+ {...rest}
54
+ />
55
+ {helperText && (
56
+ <Typography variant="muted" className={cn(error && 'text-destructive')}>
57
+ {helperText}
58
+ </Typography>
59
+ )}
60
+ {description && (
61
+ <Typography variant="muted" className={cn(error && 'text-destructive')}>
62
+ {description}
63
+ </Typography>
64
+ )}
65
+ </LabelWrapper>
66
+ );
67
+ };
@@ -17,4 +17,5 @@ export * from './Select/Select';
17
17
  export * from './SingleCheckBox/SingleCheckBox';
18
18
  export * from './SingleSelect/SingleSelect';
19
19
  export * from './Switch/Switch';
20
+ export * from './Textarea/Textarea';
20
21
  export * from './TextField/TextField';