@axzydev/axzy_ui_system 1.2.7 → 1.2.8

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 (184) hide show
  1. package/dist/index.cjs +576 -398
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +1 -1
  4. package/dist/index.css.map +1 -1
  5. package/dist/index.d.cts +1463 -86
  6. package/dist/index.d.ts +1463 -86
  7. package/dist/index.js +597 -417
  8. package/dist/index.js.map +1 -1
  9. package/package.json +1 -1
  10. package/src/App.tsx +19 -54
  11. package/src/components/alert/alert.doc.mdx +48 -0
  12. package/src/components/alert/alert.props.ts +7 -0
  13. package/src/components/alert/alert.tsx +8 -0
  14. package/src/components/avatar/avatar.doc.mdx +48 -0
  15. package/src/components/avatar/avatar.props.ts +8 -0
  16. package/src/components/avatar/avatar.tsx +25 -5
  17. package/src/components/badget/badget.doc.mdx +46 -0
  18. package/src/components/badget/badget.props.ts +6 -0
  19. package/src/components/badget/badget.tsx +11 -0
  20. package/src/components/breadcrumbs/breadcrumbs.doc.mdx +57 -0
  21. package/src/components/breadcrumbs/breadcrumbs.props.ts +6 -0
  22. package/src/components/breadcrumbs/breadcrumbs.tsx +12 -0
  23. package/src/components/button/button.doc.mdx +59 -0
  24. package/src/components/button/button.props.ts +12 -0
  25. package/src/components/button/button.tsx +11 -0
  26. package/src/components/calendar/calendar.doc.mdx +75 -0
  27. package/src/components/calendar/calendar.props.ts +27 -7
  28. package/src/components/calendar/calendar.tsx +13 -0
  29. package/src/components/card/card.doc.mdx +54 -0
  30. package/src/components/card/card.props.ts +11 -0
  31. package/src/components/card/card.tsx +13 -0
  32. package/src/components/checkbox/checkbox.doc.mdx +54 -0
  33. package/src/components/checkbox/checkbox.props.ts +7 -0
  34. package/src/components/checkbox/checkbox.tsx +9 -0
  35. package/src/components/confirm-dialog/confirm-dialog.doc.mdx +60 -0
  36. package/src/components/confirm-dialog/confirm-dialog.props.ts +9 -0
  37. package/src/components/confirm-dialog/confirm-dialog.tsx +19 -0
  38. package/src/components/data-table/ITDataTable.doc.mdx +59 -0
  39. package/src/components/data-table/dataTable.props.ts +15 -0
  40. package/src/components/data-table/dataTable.tsx +178 -73
  41. package/src/components/date-picker/date-picker.doc.mdx +65 -0
  42. package/src/components/date-picker/date-picker.props.ts +17 -0
  43. package/src/components/date-picker/datePicker.tsx +31 -1
  44. package/src/components/dialog/dialog.doc.mdx +54 -0
  45. package/src/components/dialog/dialog.props.ts +7 -0
  46. package/src/components/dialog/dialog.tsx +26 -0
  47. package/src/components/divider/divider.doc.mdx +42 -0
  48. package/src/components/divider/divider.props.ts +5 -0
  49. package/src/components/divider/divider.tsx +16 -0
  50. package/src/components/drawer/drawer.doc.mdx +59 -0
  51. package/src/components/drawer/drawer.props.ts +9 -0
  52. package/src/components/drawer/drawer.tsx +20 -0
  53. package/src/components/dropfile/dropfile.doc.mdx +59 -0
  54. package/src/components/dropfile/dropfile.props.ts +41 -0
  55. package/src/components/dropfile/dropfile.tsx +21 -33
  56. package/src/components/empty-state/empty-state.doc.mdx +50 -0
  57. package/src/components/empty-state/empty-state.props.ts +5 -0
  58. package/src/components/empty-state/empty-state.tsx +16 -0
  59. package/src/components/flex/flex.doc.mdx +59 -0
  60. package/src/components/flex/flex.props.ts +13 -0
  61. package/src/components/flex/flex.tsx +15 -0
  62. package/src/components/form-builder/fieldRenderer.tsx +52 -2
  63. package/src/components/form-builder/formBuilder.doc.mdx +124 -0
  64. package/src/components/form-builder/formBuilder.props.ts +12 -2
  65. package/src/components/form-builder/formBuilder.tsx +31 -0
  66. package/src/components/form-header/form-header.doc.mdx +38 -0
  67. package/src/components/form-header/form-header.props.ts +3 -0
  68. package/src/components/form-header/form-header.stories.tsx +53 -0
  69. package/src/components/form-header/form-header.tsx +11 -0
  70. package/src/components/grid/grid.doc.mdx +54 -0
  71. package/src/components/grid/grid.props.ts +13 -0
  72. package/src/components/grid/grid.tsx +19 -0
  73. package/src/components/image/image.doc.mdx +44 -0
  74. package/src/components/image/image.props.ts +5 -0
  75. package/src/components/image/image.stories.tsx +49 -0
  76. package/src/components/image/image.tsx +19 -0
  77. package/src/components/input/input.doc.mdx +70 -0
  78. package/src/components/input/input.props.ts +34 -2
  79. package/src/components/input/input.tsx +29 -0
  80. package/src/components/layout/layout.doc.mdx +51 -0
  81. package/src/components/layout/layout.props.ts +5 -0
  82. package/src/components/layout/layout.tsx +29 -2
  83. package/src/components/loader/loader.doc.mdx +43 -0
  84. package/src/components/loader/loader.props.ts +4 -0
  85. package/src/components/loader/loader.tsx +17 -0
  86. package/src/components/navbar/navbar.doc.mdx +77 -0
  87. package/src/components/navbar/navbar.props.ts +37 -1
  88. package/src/components/navbar/navbar.stories.tsx +84 -0
  89. package/src/components/navbar/navbar.tsx +27 -0
  90. package/src/components/page/page.doc.mdx +80 -0
  91. package/src/components/page/page.props.ts +21 -0
  92. package/src/components/page/page.tsx +18 -0
  93. package/src/components/page-header/page-header.doc.mdx +54 -0
  94. package/src/components/page-header/page-header.props.ts +9 -0
  95. package/src/components/page-header/page-header.tsx +15 -0
  96. package/src/components/pagination/pagination.doc.mdx +62 -0
  97. package/src/components/pagination/pagination.props.ts +11 -32
  98. package/src/components/pagination/pagination.tsx +17 -0
  99. package/src/components/popover/popover.doc.mdx +53 -0
  100. package/src/components/popover/popover.props.ts +8 -0
  101. package/src/components/popover/popover.tsx +13 -0
  102. package/src/components/progress/progress.doc.mdx +48 -0
  103. package/src/components/progress/progress.props.ts +8 -0
  104. package/src/components/progress/progress.tsx +9 -0
  105. package/src/components/radio/radio.doc.mdx +62 -0
  106. package/src/components/radio/radio.props.ts +11 -0
  107. package/src/components/radio/radio.tsx +18 -0
  108. package/src/components/search-select/search-select.doc.mdx +72 -0
  109. package/src/components/search-select/search-select.props.ts +23 -18
  110. package/src/components/search-select/search-select.tsx +27 -2
  111. package/src/components/searchTable/searchTable.doc.mdx +79 -0
  112. package/src/components/searchTable/searchTable.props.ts +42 -3
  113. package/src/components/searchTable/searchTable.stories.tsx +74 -0
  114. package/src/components/searchTable/searchTable.tsx +23 -0
  115. package/src/components/segmented-control/segmented-control.doc.mdx +60 -0
  116. package/src/components/segmented-control/segmented-control.props.ts +12 -0
  117. package/src/components/segmented-control/segmented-control.tsx +15 -0
  118. package/src/components/select/select.doc.mdx +75 -0
  119. package/src/components/select/select.props.ts +22 -0
  120. package/src/components/select/select.tsx +2 -5
  121. package/src/components/sidebar/sidebar.doc.mdx +86 -0
  122. package/src/components/sidebar/sidebar.props.ts +22 -0
  123. package/src/components/sidebar/sidebar.tsx +22 -0
  124. package/src/components/skeleton/skeleton.doc.mdx +43 -0
  125. package/src/components/skeleton/skeleton.props.ts +8 -0
  126. package/src/components/skeleton/skeleton.tsx +10 -0
  127. package/src/components/slide/slide.doc.mdx +46 -0
  128. package/src/components/slide/slide.props.ts +11 -24
  129. package/src/components/slide/slide.tsx +10 -1
  130. package/src/components/slider/slider.doc.mdx +49 -0
  131. package/src/components/slider/slider.props.ts +9 -0
  132. package/src/components/slider/slider.tsx +15 -0
  133. package/src/components/stack/stack.doc.mdx +126 -0
  134. package/src/components/stack/stack.props.ts +18 -0
  135. package/src/components/stack/stack.stories.tsx +221 -16
  136. package/src/components/stack/stack.tsx +21 -0
  137. package/src/components/stat-card/stat-card.doc.mdx +48 -0
  138. package/src/components/stat-card/stat-card.props.ts +9 -0
  139. package/src/components/stat-card/stat-card.tsx +10 -0
  140. package/src/components/stepper/stepper.doc.mdx +54 -0
  141. package/src/components/stepper/stepper.props.ts +11 -1
  142. package/src/components/stepper/stepper.tsx +15 -0
  143. package/src/components/table/table.doc.mdx +58 -0
  144. package/src/components/table/table.props.ts +17 -0
  145. package/src/components/table/table.tsx +199 -84
  146. package/src/components/tabs/tabs.doc.mdx +52 -0
  147. package/src/components/tabs/tabs.props.ts +11 -0
  148. package/src/components/tabs/tabs.tsx +14 -0
  149. package/src/components/text/text.doc.mdx +41 -0
  150. package/src/components/text/text.props.ts +5 -0
  151. package/src/components/text/text.stories.tsx +67 -0
  152. package/src/components/text/text.tsx +10 -0
  153. package/src/components/textarea/textarea.doc.mdx +64 -0
  154. package/src/components/textarea/textarea.props.ts +11 -0
  155. package/src/components/textarea/textarea.tsx +16 -0
  156. package/src/components/theme-provider/themeProvider.doc.mdx +75 -0
  157. package/src/components/theme-provider/themeProvider.props.ts +3 -0
  158. package/src/components/theme-provider/themeProvider.stories.tsx +59 -0
  159. package/src/components/theme-provider/themeProvider.tsx +14 -0
  160. package/src/components/time-picker/timePicker.doc.mdx +68 -0
  161. package/src/components/time-picker/timePicker.props.ts +14 -0
  162. package/src/components/time-picker/timePicker.tsx +22 -1
  163. package/src/components/toast/toast.doc.mdx +50 -0
  164. package/src/components/toast/toast.props.ts +5 -0
  165. package/src/components/toast/toast.tsx +21 -0
  166. package/src/components/tooltip/tooltip.doc.mdx +47 -0
  167. package/src/components/tooltip/tooltip.props.ts +6 -0
  168. package/src/components/tooltip/tooltip.tsx +19 -0
  169. package/src/components/topbar/topbar.doc.mdx +69 -0
  170. package/src/components/topbar/topbar.props.ts +15 -0
  171. package/src/components/topbar/topbar.tsx +38 -0
  172. package/src/components/triple-filter/tripleFilter.doc.mdx +62 -0
  173. package/src/components/triple-filter/tripleFilter.props.ts +7 -0
  174. package/src/components/triple-filter/tripleFilter.tsx +32 -0
  175. package/src/index.css +2 -0
  176. package/src/showcases/DataShowcases.tsx +529 -45
  177. package/src/showcases/FormShowcases.tsx +399 -29
  178. package/src/showcases/HomeShowcase.tsx +252 -272
  179. package/src/showcases/LayoutPrimitivesShowcases.tsx +1224 -248
  180. package/src/showcases/PageShowcases.tsx +688 -391
  181. package/src/showcases/ShowcaseLayout.tsx +237 -73
  182. package/src/showcases/StructureShowcases.tsx +846 -73
  183. package/src/types/table.types.ts +1 -1
  184. package/src/utils/styles.ts +2 -1
@@ -3,7 +3,9 @@ import { SizesTypes } from "@app/types/sizes.types";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  export interface ITInputProps {
6
+ /** Field name used for form identification */
6
7
  name: string;
8
+ /** Input type: "text" | "password" | "number" | "email" | "checkbox" | "radio" | "textarea" */
7
9
  type?:
8
10
  | "text"
9
11
  | "password"
@@ -12,38 +14,68 @@ export interface ITInputProps {
12
14
  | "checkbox"
13
15
  | "radio"
14
16
  | "textarea";
17
+ /** Label displayed above the input */
15
18
  label?: string;
19
+ /** Enable currency formatting for number inputs (MX locale) */
16
20
  currencyFormat?: boolean;
21
+ /** Placeholder text */
17
22
  placeholder?: string;
23
+ /** Current input value */
18
24
  value?: any;
25
+ /** Change event handler */
19
26
  onChange: (event: any) => void;
27
+ /** Blur event handler */
20
28
  onBlur?: (
21
29
  event:
22
30
  | React.FocusEvent<HTMLInputElement>
23
31
  | React.FocusEvent<HTMLTextAreaElement, Element>
24
32
  ) => void;
33
+ /** Keydown event handler */
25
34
  onKeyDown?: (event: React.KeyboardEvent) => void;
35
+ /** Show character count hint below the input */
26
36
  showHintLength?: boolean;
37
+ /** Maximum allowed character length */
27
38
  maxLength?: number;
39
+ /** Minimum allowed character length */
28
40
  minLength?: number;
41
+ /** Color variant from the theme palette */
29
42
  variant?: ColorsTypes;
43
+ /** Size preset: "xs" | "sm" | "md" | "lg" | "xl" */
30
44
  size?: SizesTypes;
45
+ /** Disable the input */
31
46
  disabled?: boolean;
47
+ /** Additional CSS classes for the outer container */
32
48
  containerClassName?: string;
49
+ /** Additional CSS classes for the label */
33
50
  labelClassName?: string;
51
+ /** Additional CSS classes for the input element */
34
52
  className?: string;
53
+ /** Whether the field has been touched by the user */
35
54
  touched?: boolean;
55
+ /** Validation error message. Pass `true` for a generic error, or a string for a custom message */
36
56
  error?: string | boolean;
57
+ /** Mark the field as required */
37
58
  required?: boolean;
38
- formatNumber?:boolean;
59
+ /** Enable number formatting on blur */
60
+ formatNumber?: boolean;
61
+ /** Auto-focus the input on mount */
39
62
  autoFocus?: boolean;
40
- focusContent?:boolean;
63
+ /** Select all content on click */
64
+ focusContent?: boolean;
65
+ /** Click handler for the input */
41
66
  onClick?: () => void;
67
+ /** Icon element rendered on the left side of the input */
42
68
  iconLeft?: ReactNode;
69
+ /** Icon element rendered on the right side of the input */
43
70
  iconRight?: ReactNode;
71
+ /** Checked state for checkbox and radio types */
44
72
  checked?: boolean;
73
+ /** Number of visible rows for textarea type */
45
74
  rows?: number;
75
+ /** Minimum numeric value for number inputs */
46
76
  min?: number;
77
+ /** Maximum numeric value for number inputs */
47
78
  max?: number;
79
+ /** Render the input in read-only mode */
48
80
  readOnly?: boolean;
49
81
  }
@@ -6,6 +6,35 @@ import { theme } from "@/theme/theme";
6
6
  import { disabledOverlay, iconAbsoluteLeft, iconAbsoluteRight, inputError, inputLabel } from "@/utils/styles";
7
7
  import ITText from "@/components/text/text";
8
8
 
9
+ /**
10
+ * Text input component with label, validation error display, icon slots,
11
+ * and helper text. Supports text, password, email, number (with currency
12
+ * and thousand formatting), checkbox, radio, and textarea types.
13
+ *
14
+ * @example
15
+ * <ITInput
16
+ * name="email"
17
+ * label="Email Address"
18
+ * type="email"
19
+ * placeholder="you@example.com"
20
+ * value={email}
21
+ * onChange={handleChange}
22
+ * error={errors.email}
23
+ * required
24
+ * />
25
+ *
26
+ * @example
27
+ * <ITInput
28
+ * name="amount"
29
+ * label="Amount"
30
+ * type="number"
31
+ * currencyFormat
32
+ * iconLeft={<FaDollarSign />}
33
+ * value={amount}
34
+ * onChange={handleChange}
35
+ * maxLength={10}
36
+ * />
37
+ */
9
38
  export default function ITInput({
10
39
  name,
11
40
  type = "text",
@@ -0,0 +1,51 @@
1
+ import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
+ import * as Stories from './layout.stories';
3
+
4
+ <Meta of={Stories} />
5
+
6
+ # ITLayout
7
+
8
+ The application shell layout component that combines a topbar, sidebar, and main content area into a full-page interface. The sidebar supports collapse/expand via hover, and all visual styles are driven by ITThemeProvider CSS variables.
9
+
10
+ ## Props
11
+
12
+ | Prop | Type | Default | Description |
13
+ |------|------|---------|-------------|
14
+ | `topBar` | `ITTopBarProps` | required | Top bar configuration including logo, nav items, and user menu. |
15
+ | `sidebar` | `ITSidebarProps` | required | Sidebar configuration including navigation items. |
16
+ | `children` | `ReactNode` | required | Main content rendered in the center area. |
17
+ | `className` | `string` | `undefined` | Additional CSS classes for the outermost wrapper. |
18
+ | `contentClassName` | `string` | `undefined` | Additional CSS classes for the content container. |
19
+
20
+ ## Usage
21
+
22
+ ```tsx
23
+ import { ITLayout } from '@axzydev/axzy_ui_system';
24
+
25
+ <ITLayout
26
+ topBar={{
27
+ logoText: 'AXZY',
28
+ userMenu: { userName: 'Jane', userEmail: 'jane@axzy.io', menuItems: [...] },
29
+ navItems: [...]
30
+ }}
31
+ sidebar={{
32
+ navigationItems: [...]
33
+ }}
34
+ >
35
+ <div>Your page content here</div>
36
+ </ITLayout>
37
+ ```
38
+
39
+ ## Notes
40
+
41
+ - The topbar spans the full viewport width at the top of the page.
42
+ - The sidebar sits under the topbar on the left and floats over content when expanded via hover.
43
+ - Sidebar in collapsed state shows only icons; expanding reveals labels.
44
+ - Themed entirely through CSS custom properties from ITThemeProvider.
45
+ - Includes mobile responsive behavior with a hamburger-style toggle.
46
+
47
+ ## Stories
48
+
49
+ <Primary />
50
+ <Controls />
51
+ <Stories />
@@ -2,9 +2,14 @@ import { ITTopBarProps } from "../topbar/topbar.props";
2
2
  import { ITSidebarProps } from "../sidebar/sidebar.props";
3
3
 
4
4
  export interface ITLayoutProps {
5
+ /** Top bar configuration and props */
5
6
  topBar: ITTopBarProps;
7
+ /** Sidebar configuration and props */
6
8
  sidebar: ITSidebarProps;
9
+ /** Main content rendered in the center area */
7
10
  children: React.ReactNode;
11
+ /** Additional CSS classes for the outermost wrapper */
8
12
  className?: string;
13
+ /** Additional CSS classes for the content container */
9
14
  contentClassName?: string;
10
15
  }
@@ -5,6 +5,29 @@ import ITSidebar from "../sidebar/sidebar";
5
5
  import { ITLayoutProps } from "./layout.props";
6
6
  import { theme } from "@/theme/theme";
7
7
 
8
+ /**
9
+ * Main application shell with sidebar, topbar, and content area.
10
+ * Provides a responsive layout with a collapsible desktop sidebar,
11
+ * a sliding mobile sidebar overlay, and a scrollable main content region.
12
+ *
13
+ * @example
14
+ * <ITLayout
15
+ * topBar={{ title: "Dashboard", userMenu: [...] }}
16
+ * sidebar={{ items: [...], activeKey: "overview" }}
17
+ * >
18
+ * <p>Page content goes here</p>
19
+ * </ITLayout>
20
+ *
21
+ * @example
22
+ * <ITLayout
23
+ * topBar={{ title: "Settings" }}
24
+ * sidebar={{ items: navItems }}
25
+ * className="min-h-screen"
26
+ * contentClassName="max-w-5xl"
27
+ * >
28
+ * <SettingsPage />
29
+ * </ITLayout>
30
+ */
8
31
  export default function ITLayout({
9
32
  topBar,
10
33
  sidebar,
@@ -12,9 +35,13 @@ export default function ITLayout({
12
35
  className = "",
13
36
  contentClassName = "",
14
37
  }: ITLayoutProps) {
15
- const [desktopCollapsed, setDesktopCollapsed] = useState(true);
38
+ const [internalCollapsed, setInternalCollapsed] = useState(true);
16
39
  const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false);
17
40
 
41
+ const isControlled = sidebar.isCollapsed !== undefined;
42
+ const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
43
+ const handleToggleCollapse = isControlled ? (sidebar.onToggleCollapse ?? (() => {})) : () => setInternalCollapsed(v => !v);
44
+
18
45
  const layoutTokens = theme.layout;
19
46
 
20
47
  return (
@@ -36,7 +63,7 @@ export default function ITLayout({
36
63
  <ITSidebar
37
64
  {...sidebar}
38
65
  isCollapsed={desktopCollapsed}
39
- onToggleCollapse={() => setDesktopCollapsed(v => !v)}
66
+ onToggleCollapse={handleToggleCollapse}
40
67
  visibleOnMobile={false}
41
68
  className="h-full drop-shadow-2xl transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0"
42
69
  />
@@ -0,0 +1,43 @@
1
+ import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
+ import * as Stories from './loader.stories';
3
+
4
+ <Meta of={Stories} />
5
+
6
+ # ITLoader
7
+
8
+ A loading indicator with four animation variants and customizable sizing and color. Useful for async operations, data fetching states, and any in-progress feedback.
9
+
10
+ ## Props
11
+
12
+ | Prop | Type | Default | Description |
13
+ |------|------|---------|-------------|
14
+ | `variant` | `'spinner' \| 'dots' \| 'bar' \| 'pulse'` | `'spinner'` | Animation style. |
15
+ | `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Size preset. |
16
+ | `color` | `string` | `'primary'` | Color value. Accepts theme semantic keys (`primary`, `secondary`, `success`, `danger`, `warning`, `info`, `purple`), hex, rgb, or CSS class. |
17
+ | `className` | `string` | `undefined` | Additional CSS classes. |
18
+
19
+ ## Usage
20
+
21
+ ```tsx
22
+ import { ITLoader } from '@axzydev/axzy_ui_system';
23
+
24
+ <ITLoader />
25
+ <ITLoader variant="dots" color="secondary" size="lg" />
26
+ <ITLoader variant="bar" color="success" />
27
+ <ITLoader variant="pulse" color="danger" size="xl" />
28
+ ```
29
+
30
+ ## Notes
31
+
32
+ - `spinner` — rotating circular indicator.
33
+ - `dots` — bouncing dots sequence.
34
+ - `pulse` — pulsing circle with scaling animation.
35
+ - `bar` — horizontal indeterminate progress bar (intended for use in a container with explicit width).
36
+ - Color mapping is handled through the theme system; semantic keys resolve to CSS custom properties.
37
+ - All animations use CSS keyframes with GPU-accelerated transforms where possible.
38
+
39
+ ## Stories
40
+
41
+ <Primary />
42
+ <Controls />
43
+ <Stories />
@@ -1,8 +1,12 @@
1
1
  import { LoaderSize, LoaderVariant } from "@/types/loader.types";
2
2
 
3
3
  export interface LoaderProps {
4
+ /** Loader size: "sm" | "md" | "lg" | "xl" */
4
5
  size?: LoaderSize;
6
+ /** Animation variant: "spinner" | "dots" | "bar" | "pulse" */
5
7
  variant?: LoaderVariant;
8
+ /** Color value. Can be a theme semantic color key, hex string, rgb string, or CSS class */
6
9
  color?: string;
10
+ /** Additional CSS classes */
7
11
  className?: string;
8
12
  }
@@ -3,6 +3,23 @@ import { LoaderSize, sizeClasses } from "@/types/loader.types";
3
3
  import { LoaderProps } from "./loader.props";
4
4
  import ITText from "@/components/text/text";
5
5
 
6
+ /**
7
+ * Loading indicators with multiple animation types: spinner, dots, pulse,
8
+ * and bar. Supports configurable size, color (theme semantic or custom),
9
+ * and inline/padded rendering.
10
+ *
11
+ * @example
12
+ * <ITLoader variant="spinner" size="lg" color="primary" />
13
+ *
14
+ * @example
15
+ * <ITLoader variant="dots" size="md" color="#06b6d4" />
16
+ *
17
+ * @example
18
+ * <ITLoader variant="bar" size="sm" color="secondary" className="w-48" />
19
+ *
20
+ * @example
21
+ * <ITLoader variant="pulse" size="xl" color="red-500" />
22
+ */
6
23
  export default function ITLoader({
7
24
  size = "md",
8
25
  variant = "spinner",
@@ -0,0 +1,77 @@
1
+ import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
+ import * as Stories from './navbar.stories';
3
+
4
+ <Meta of={Stories} />
5
+
6
+ # ITNavbar
7
+
8
+ A full sidebar navigation shell for application layouts. Provides collapsible submenus with expand/collapse animation, active state highlighting via `isActive`, and an optional user menu dropdown with avatar, name, and email.
9
+
10
+ ## Props
11
+
12
+ | Prop | Type | Default | Description |
13
+ |------|------|---------|-------------|
14
+ | `navigationItems` | `ITNavigationItem[]` | `undefined` | Navigation items with labels, icons, subitems, and active states. |
15
+ | `logo` | `ReactNode` | `undefined` | Logo element rendered in the sidebar header. |
16
+ | `logoText` | `string` | `undefined` | Text displayed next to the logo. |
17
+ | `userMenu` | `{ userImage?, userName, userEmail, menuItems }` | `undefined` | User dropdown configuration. |
18
+ | `children` | `ReactNode` | `undefined` | Main content rendered next to the sidebar. |
19
+ | `navItems` | `ReactNode` | `undefined` | **Deprecated.** Use `navigationItems` instead. |
20
+ | `showSidebar` | `boolean` | `undefined` | **Deprecated.** Legacy flag. |
21
+ | `showSidebarOnMobile` | `boolean` | `undefined` | **Deprecated.** Legacy flag. |
22
+ | `sidebarItems` | `ReactNode` | `undefined` | **Deprecated.** Use `navigationItems` instead. |
23
+
24
+ ### ITNavigationItem
25
+
26
+ | Prop | Type | Default | Description |
27
+ |------|------|---------|-------------|
28
+ | `id` | `string` | required | Unique identifier. |
29
+ | `label` | `string` | required | Display label. |
30
+ | `icon` | `ReactNode` | `undefined` | Icon rendered next to the label. |
31
+ | `action` | `() => void` | `undefined` | Callback on click. |
32
+ | `isActive` | `boolean` | `false` | Whether the item is currently highlighted as active. |
33
+ | `subitems` | `ITNavigationSubItem[]` | `undefined` | Nested items shown on expand. |
34
+
35
+ ### ITNavigationSubItem
36
+
37
+ | Prop | Type | Default | Description |
38
+ |------|------|---------|-------------|
39
+ | `id` | `string` | required | Unique identifier. |
40
+ | `label` | `string` | required | Display label. |
41
+ | `action` | `() => void` | required | Callback on click. |
42
+ | `isActive` | `boolean` | `false` | Whether the sub-item is highlighted. |
43
+
44
+ ## Usage
45
+
46
+ ```tsx
47
+ import { ITNavbar } from '@axzydev/axzy_ui_system';
48
+ import { FaHome, FaChartBar } from 'react-icons/fa';
49
+
50
+ <ITNavbar
51
+ logoText="AXZY"
52
+ navigationItems={[
53
+ { id: 'home', label: 'Dashboard', icon: <FaHome />, isActive: true },
54
+ { id: 'analytics', label: 'Analytics', icon: <FaChartBar />,
55
+ subitems: [{ id: 'reports', label: 'Reports', action: () => {} }]
56
+ }
57
+ ]}
58
+ userMenu={{ userName: 'John', userEmail: 'john@axzy.dev', menuItems: [...] }}
59
+ >
60
+ <div>Content area</div>
61
+ </ITNavbar>
62
+ ```
63
+
64
+ ## Notes
65
+
66
+ - Sidebar has a collapsed state where only icons are visible; expanding shows labels.
67
+ - Submenus animate open/closed with a height transition.
68
+ - Items with `isActive` are visually highlighted.
69
+ - `userMenu` renders a dropdown at the bottom of the sidebar with user info and action items.
70
+ - Legacy props (`navItems`, `showSidebar`, etc.) are maintained for backward compatibility but should be migrated to `navigationItems`.
71
+ - Supports dark mode via CSS variables from the theme provider.
72
+
73
+ ## Stories
74
+
75
+ <Primary />
76
+ <Controls />
77
+ <Stories />
@@ -1,37 +1,73 @@
1
1
  // navbar.props.ts
2
+
3
+ /** Represents a navigation item in the sidebar. */
2
4
  export interface ITNavigationItem {
5
+ /** Unique identifier for the navigation item. */
3
6
  id: string;
7
+ /** Display label for the navigation item. */
4
8
  label: string;
9
+ /** Optional icon rendered next to the label. */
5
10
  icon?: React.ReactNode;
11
+ /** Callback fired when the item is clicked. */
6
12
  action?: () => void;
13
+ /** Whether the item is currently active and highlighted. */
7
14
  isActive?: boolean;
15
+ /** Optional nested sub-navigation items. */
8
16
  subitems?: ITNavigationSubItem[];
9
17
  }
10
18
 
19
+ /** Represents a sub-navigation item within a parent navigation item. */
11
20
  export interface ITNavigationSubItem {
21
+ /** Unique identifier for the sub-item. */
12
22
  id: string;
23
+ /** Display label for the sub-item. */
13
24
  label: string;
25
+ /** Callback fired when the sub-item is clicked. */
14
26
  action: () => void;
27
+ /** Whether the sub-item is currently active and highlighted. */
15
28
  isActive?: boolean;
16
29
  }
17
30
 
31
+ /** Props for the ITNavbar component. */
18
32
  export interface ITNavbarProps {
33
+ /** Logo element rendered in the sidebar header. */
19
34
  logo?: React.ReactNode;
35
+ /** Text displayed next to the logo. */
20
36
  logoText?: string;
37
+ /** Array of navigation items for the main sidebar menu. */
21
38
  navigationItems?: ITNavigationItem[];
39
+ /** User menu configuration including avatar, name, email, and dropdown items. */
22
40
  userMenu?: {
41
+ /** URL for the user's profile image. */
23
42
  userImage?: string;
43
+ /** Display name of the user. */
24
44
  userName: string;
45
+ /** Email address of the user. */
25
46
  userEmail: string;
47
+ /** Dropdown menu items for the user menu. */
26
48
  menuItems: Array<{
49
+ /** Display label for the menu item. */
27
50
  label: string;
51
+ /** Callback fired when the menu item is clicked. */
28
52
  onClick: () => void;
29
53
  }>;
30
54
  };
55
+ /** Content rendered in the main area next to the sidebar. */
31
56
  children?: React.ReactNode;
32
- // Legacy props for backward compatibility
57
+ /** Legacy navigation items. Use `navigationItems` instead.
58
+ * @deprecated
59
+ */
33
60
  navItems?: React.ReactNode;
61
+ /** Legacy flag to show the sidebar.
62
+ * @deprecated
63
+ */
34
64
  showSidebar?: boolean;
65
+ /** Legacy flag to show the sidebar on mobile devices.
66
+ * @deprecated
67
+ */
35
68
  showSidebarOnMobile?: boolean;
69
+ /** Legacy sidebar items. Use `navigationItems` instead.
70
+ * @deprecated
71
+ */
36
72
  sidebarItems?: React.ReactNode;
37
73
  }
@@ -0,0 +1,84 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import ITNavbar from './navbar';
3
+ import { FaHome, FaChartBar, FaCog, FaUsers } from 'react-icons/fa';
4
+
5
+ const meta = {
6
+ title: 'Components/Layout & Navigation/ITNavbar',
7
+ component: ITNavbar,
8
+ parameters: { layout: 'fullscreen' },
9
+ tags: ['autodocs'],
10
+ argTypes: {
11
+ logoText: { control: 'text', description: 'Text displayed next to the logo' },
12
+ navigationItems: { control: false, description: 'Navigation items with optional sub-items' },
13
+ userMenu: { control: false, description: 'User menu configuration' },
14
+ children: { control: false, description: 'Main content area' },
15
+ },
16
+ } satisfies Meta<typeof ITNavbar>;
17
+
18
+ export default meta;
19
+ type Story = StoryObj<typeof meta>;
20
+
21
+ const sampleNavigationItems = [
22
+ {
23
+ id: 'home',
24
+ label: 'Dashboard',
25
+ icon: <FaHome />,
26
+ action: () => {},
27
+ isActive: true,
28
+ },
29
+ {
30
+ id: 'analytics',
31
+ label: 'Analytics',
32
+ icon: <FaChartBar />,
33
+ action: () => {},
34
+ subitems: [
35
+ { id: 'reports', label: 'Reports', action: () => {} },
36
+ { id: 'metrics', label: 'Metrics', action: () => {} },
37
+ ],
38
+ },
39
+ {
40
+ id: 'users',
41
+ label: 'Users',
42
+ icon: <FaUsers />,
43
+ action: () => {},
44
+ },
45
+ {
46
+ id: 'settings',
47
+ label: 'Settings',
48
+ icon: <FaCog />,
49
+ action: () => {},
50
+ },
51
+ ];
52
+
53
+ export const Default: Story = {
54
+ args: {
55
+ logoText: 'AXZY',
56
+ navigationItems: sampleNavigationItems,
57
+ userMenu: {
58
+ userName: 'John Doe',
59
+ userEmail: 'john@axzy.dev',
60
+ menuItems: [
61
+ { label: 'Profile', onClick: () => alert('Profile') },
62
+ { label: 'Logout', onClick: () => alert('Logout') },
63
+ ],
64
+ },
65
+ children: (
66
+ <div className="p-8">
67
+ <h1 className="text-2xl font-bold text-slate-800 dark:text-white">Welcome to AXZY</h1>
68
+ <p className="text-slate-500 dark:text-slate-400 mt-2">Main content area goes here.</p>
69
+ </div>
70
+ ),
71
+ },
72
+ };
73
+
74
+ export const NoUserMenu: Story = {
75
+ args: {
76
+ logoText: 'AXZY',
77
+ navigationItems: sampleNavigationItems,
78
+ children: (
79
+ <div className="p-8">
80
+ <h1 className="text-2xl font-bold text-slate-800 dark:text-white">Public View</h1>
81
+ </div>
82
+ ),
83
+ },
84
+ };
@@ -5,6 +5,33 @@ import { ITNavbarProps, ITNavigationItem } from "./navbar.props";
5
5
  import ITText from "@/components/text/text";
6
6
  import { theme } from "@/theme/theme";
7
7
 
8
+ /**
9
+ * Full sidebar navigation shell with collapsible submenus, user menu dropdown, and themed styling.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <ITNavbar
14
+ * logo={<LogoIcon />}
15
+ * logoText="My App"
16
+ * navigationItems={[
17
+ * { id: 'home', label: 'Home', icon: <FaHome />, isActive: true },
18
+ * {
19
+ * id: 'settings',
20
+ * label: 'Settings',
21
+ * icon: <FaCog />,
22
+ * subitems: [{ id: 'profile', label: 'Profile', action: () => {} }],
23
+ * },
24
+ * ]}
25
+ * userMenu={{
26
+ * userName: 'John Doe',
27
+ * userEmail: 'john@example.com',
28
+ * menuItems: [{ label: 'Logout', onClick: () => {} }],
29
+ * }}
30
+ * >
31
+ * <ITPage title="Dashboard">...</ITPage>
32
+ * </ITNavbar>
33
+ * ```
34
+ */
8
35
  export default function ITNavbar({
9
36
  logo,
10
37
  logoText,
@@ -0,0 +1,80 @@
1
+ import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
+ import * as Stories from './page.stories';
3
+
4
+ <Meta of={Stories} />
5
+
6
+ # ITPage
7
+
8
+ A page template component that wraps an ITPageHeader with content area and built-in state handling for loading, error, and empty states. Provides automatic skeleton placeholders during loading, an error boundary with retry action, and a customizable empty state with action.
9
+
10
+ ## Props
11
+
12
+ | Prop | Type | Default | Description |
13
+ |------|------|---------|-------------|
14
+ | `title` | `string` | `undefined` | Page title passed to the header. |
15
+ | `description` | `string` | `undefined` | Description text shown below the title. |
16
+ | `breadcrumbs` | `ITBreadcrumbItem[]` | `undefined` | Breadcrumb navigation items. |
17
+ | `actions` | `ReactNode` | `undefined` | Action buttons rendered in the header. |
18
+ | `backAction` | `() => void` | `undefined` | Callback for the back button. |
19
+ | `icon` | `ReactNode` | `undefined` | Icon displayed next to the title. |
20
+ | `iconColor` | `string` | `undefined` | Custom color for the icon. |
21
+ | `loading` | `boolean` | `false` | When true, shows skeleton placeholders instead of content. |
22
+ | `error` | `string \| null` | `null` | Error message. When provided, shows an error state with retry button. |
23
+ | `errorTitle` | `string` | `'Error'` | Custom title for the error state. |
24
+ | `errorActionLabel` | `string` | `'Reintentar'` | Label for the retry button in the error state. |
25
+ | `onRetry` | `() => void` | `undefined` | Callback when the retry button is clicked. |
26
+ | `empty` | `boolean` | `false` | When true, shows an empty state placeholder. |
27
+ | `emptyTitle` | `string` | `'Sin datos'` | Custom title for the empty state. |
28
+ | `emptyDescription` | `string` | `undefined` | Custom description for the empty state. |
29
+ | `emptyAction` | `ReactNode` | `undefined` | Custom action element for the empty state. |
30
+ | `children` | `ReactNode` | required | Content rendered when no special state (loading/error/empty) is active. |
31
+ | `maxWidth` | `'2xl' \| '3xl' \| '4xl' \| '5xl' \| '6xl' \| '7xl'` | `'7xl'` | Maximum width of the page content container. |
32
+ | `noPadding` | `boolean` | `false` | When true, removes default padding from the page wrapper. |
33
+ | `className` | `string` | `undefined` | Additional CSS classes for the page wrapper. |
34
+
35
+ ## Usage
36
+
37
+ ```tsx
38
+ import { ITPage } from '@axzydev/axzy_ui_system';
39
+
40
+ <ITPage title="Users" description="Manage system users" actions={<ITButton label="Add" />}>
41
+ <p>Your page content</p>
42
+ </ITPage>
43
+
44
+ <ITPage title="Dashboard" loading>
45
+ <p>Content not shown while loading</p>
46
+ </ITPage>
47
+
48
+ <ITPage
49
+ title="Orders"
50
+ error="Failed to load orders"
51
+ onRetry={() => refetch()}
52
+ >
53
+ <p>Content not shown while error</p>
54
+ </ITPage>
55
+
56
+ <ITPage
57
+ title="Notifications"
58
+ empty
59
+ emptyTitle="No notifications"
60
+ emptyAction={<ITButton label="Refresh" />}
61
+ >
62
+ <p>Content not shown while empty</p>
63
+ </ITPage>
64
+ ```
65
+
66
+ ## Notes
67
+
68
+ - State priority: `error` > `loading` > `empty` > `children`.
69
+ - The loading state renders animated skeleton blocks matching common page patterns.
70
+ - The error state renders a centered error icon, message, and a retry button.
71
+ - The empty state renders a centered placeholder with optional title, description, and action.
72
+ - All header props (`title`, `description`, `breadcrumbs`, `actions`, `backAction`, `icon`) are forwarded to ITPageHeader.
73
+ - Content maximum width is controlled by Tailwind max-width classes via `maxWidth`.
74
+ - `noPadding` is useful for full-bleed layouts like dashboards.
75
+
76
+ ## Stories
77
+
78
+ <Primary />
79
+ <Controls />
80
+ <Stories />