@axzydev/axzy_ui_system 1.2.6 → 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 (185) hide show
  1. package/dist/index.cjs +777 -535
  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 +1470 -87
  6. package/dist/index.d.ts +1470 -87
  7. package/dist/index.js +799 -555
  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 +26 -2
  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 +41 -17
  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 +78 -46
  90. package/src/components/page/page.doc.mdx +80 -0
  91. package/src/components/page/page.props.ts +25 -0
  92. package/src/components/page/page.tsx +35 -7
  93. package/src/components/page-header/page-header.doc.mdx +54 -0
  94. package/src/components/page-header/page-header.props.ts +11 -0
  95. package/src/components/page-header/page-header.stories.tsx +14 -0
  96. package/src/components/page-header/page-header.tsx +50 -15
  97. package/src/components/pagination/pagination.doc.mdx +62 -0
  98. package/src/components/pagination/pagination.props.ts +11 -32
  99. package/src/components/pagination/pagination.tsx +17 -0
  100. package/src/components/popover/popover.doc.mdx +53 -0
  101. package/src/components/popover/popover.props.ts +8 -0
  102. package/src/components/popover/popover.tsx +13 -0
  103. package/src/components/progress/progress.doc.mdx +48 -0
  104. package/src/components/progress/progress.props.ts +8 -0
  105. package/src/components/progress/progress.tsx +9 -0
  106. package/src/components/radio/radio.doc.mdx +62 -0
  107. package/src/components/radio/radio.props.ts +11 -0
  108. package/src/components/radio/radio.tsx +18 -0
  109. package/src/components/search-select/search-select.doc.mdx +72 -0
  110. package/src/components/search-select/search-select.props.ts +23 -18
  111. package/src/components/search-select/search-select.tsx +27 -2
  112. package/src/components/searchTable/searchTable.doc.mdx +79 -0
  113. package/src/components/searchTable/searchTable.props.ts +42 -3
  114. package/src/components/searchTable/searchTable.stories.tsx +74 -0
  115. package/src/components/searchTable/searchTable.tsx +23 -0
  116. package/src/components/segmented-control/segmented-control.doc.mdx +60 -0
  117. package/src/components/segmented-control/segmented-control.props.ts +12 -0
  118. package/src/components/segmented-control/segmented-control.tsx +15 -0
  119. package/src/components/select/select.doc.mdx +75 -0
  120. package/src/components/select/select.props.ts +22 -0
  121. package/src/components/select/select.tsx +2 -5
  122. package/src/components/sidebar/sidebar.doc.mdx +86 -0
  123. package/src/components/sidebar/sidebar.props.ts +22 -0
  124. package/src/components/sidebar/sidebar.tsx +22 -0
  125. package/src/components/skeleton/skeleton.doc.mdx +43 -0
  126. package/src/components/skeleton/skeleton.props.ts +8 -0
  127. package/src/components/skeleton/skeleton.tsx +10 -0
  128. package/src/components/slide/slide.doc.mdx +46 -0
  129. package/src/components/slide/slide.props.ts +11 -24
  130. package/src/components/slide/slide.tsx +10 -1
  131. package/src/components/slider/slider.doc.mdx +49 -0
  132. package/src/components/slider/slider.props.ts +9 -0
  133. package/src/components/slider/slider.tsx +15 -0
  134. package/src/components/stack/stack.doc.mdx +126 -0
  135. package/src/components/stack/stack.props.ts +18 -0
  136. package/src/components/stack/stack.stories.tsx +221 -16
  137. package/src/components/stack/stack.tsx +21 -0
  138. package/src/components/stat-card/stat-card.doc.mdx +48 -0
  139. package/src/components/stat-card/stat-card.props.ts +9 -0
  140. package/src/components/stat-card/stat-card.tsx +10 -0
  141. package/src/components/stepper/stepper.doc.mdx +54 -0
  142. package/src/components/stepper/stepper.props.ts +11 -1
  143. package/src/components/stepper/stepper.tsx +15 -0
  144. package/src/components/table/table.doc.mdx +58 -0
  145. package/src/components/table/table.props.ts +17 -0
  146. package/src/components/table/table.tsx +199 -84
  147. package/src/components/tabs/tabs.doc.mdx +52 -0
  148. package/src/components/tabs/tabs.props.ts +11 -0
  149. package/src/components/tabs/tabs.tsx +14 -0
  150. package/src/components/text/text.doc.mdx +41 -0
  151. package/src/components/text/text.props.ts +5 -0
  152. package/src/components/text/text.stories.tsx +67 -0
  153. package/src/components/text/text.tsx +10 -0
  154. package/src/components/textarea/textarea.doc.mdx +64 -0
  155. package/src/components/textarea/textarea.props.ts +11 -0
  156. package/src/components/textarea/textarea.tsx +16 -0
  157. package/src/components/theme-provider/themeProvider.doc.mdx +75 -0
  158. package/src/components/theme-provider/themeProvider.props.ts +3 -0
  159. package/src/components/theme-provider/themeProvider.stories.tsx +59 -0
  160. package/src/components/theme-provider/themeProvider.tsx +14 -0
  161. package/src/components/time-picker/timePicker.doc.mdx +68 -0
  162. package/src/components/time-picker/timePicker.props.ts +14 -0
  163. package/src/components/time-picker/timePicker.tsx +22 -1
  164. package/src/components/toast/toast.doc.mdx +50 -0
  165. package/src/components/toast/toast.props.ts +5 -0
  166. package/src/components/toast/toast.tsx +21 -0
  167. package/src/components/tooltip/tooltip.doc.mdx +47 -0
  168. package/src/components/tooltip/tooltip.props.ts +6 -0
  169. package/src/components/tooltip/tooltip.tsx +19 -0
  170. package/src/components/topbar/topbar.doc.mdx +69 -0
  171. package/src/components/topbar/topbar.props.ts +15 -0
  172. package/src/components/topbar/topbar.tsx +38 -0
  173. package/src/components/triple-filter/tripleFilter.doc.mdx +62 -0
  174. package/src/components/triple-filter/tripleFilter.props.ts +7 -0
  175. package/src/components/triple-filter/tripleFilter.tsx +32 -0
  176. package/src/index.css +17 -0
  177. package/src/showcases/DataShowcases.tsx +529 -45
  178. package/src/showcases/FormShowcases.tsx +399 -29
  179. package/src/showcases/HomeShowcase.tsx +252 -272
  180. package/src/showcases/LayoutPrimitivesShowcases.tsx +1224 -248
  181. package/src/showcases/PageShowcases.tsx +868 -151
  182. package/src/showcases/ShowcaseLayout.tsx +237 -73
  183. package/src/showcases/StructureShowcases.tsx +1039 -97
  184. package/src/types/table.types.ts +1 -1
  185. package/src/utils/styles.ts +2 -1
@@ -0,0 +1,70 @@
1
+ import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
+ import * as Stories from './input.stories';
3
+
4
+ <Meta of={Stories} />
5
+
6
+ # ITInput
7
+
8
+ A versatile form input component supporting text, password, email, number, textarea, checkbox, and radio types. Features labels, validation errors, left/right icons, helper text with character count, currency formatting, and configurable sizes.
9
+
10
+ ## Props
11
+
12
+ | Prop | Type | Default | Description |
13
+ |------|------|---------|-------------|
14
+ | `name` | `string` | required | Field name used for form identification. |
15
+ | `type` | `'text' \| 'password' \| 'number' \| 'email' \| 'checkbox' \| 'radio' \| 'textarea'` | `'text'` | Input type. |
16
+ | `label` | `string` | `undefined` | Label displayed above the input. |
17
+ | `placeholder` | `string` | `undefined` | Placeholder text. |
18
+ | `value` | `any` | `undefined` | Current input value. |
19
+ | `onChange` | `(event: any) => void` | required | Change event handler. |
20
+ | `onBlur` | `(event) => void` | `undefined` | Blur event handler. |
21
+ | `onKeyDown` | `(event) => void` | `undefined` | Keydown event handler. |
22
+ | `error` | `string \| boolean` | `undefined` | Validation error message. Pass `true` for generic error styling. |
23
+ | `touched` | `boolean` | `undefined` | Whether the field has been touched by the user. |
24
+ | `required` | `boolean` | `false` | Mark the field as required (adds asterisk to label). |
25
+ | `disabled` | `boolean` | `false` | Disable the input. |
26
+ | `size` | `SizesTypes` | `'md'` | Size preset: `xs`, `sm`, `md`, `lg`, `xl`. |
27
+ | `variant` | `ColorsTypes` | `undefined` | Color variant from the theme palette. |
28
+ | `iconLeft` | `ReactNode` | `undefined` | Icon element rendered on the left side. |
29
+ | `iconRight` | `ReactNode` | `undefined` | Icon element rendered on the right side. |
30
+ | `maxLength` | `number` | `undefined` | Maximum allowed character length. |
31
+ | `minLength` | `number` | `undefined` | Minimum allowed character length. |
32
+ | `showHintLength` | `boolean` | `false` | Show character count hint below the input. |
33
+ | `currencyFormat` | `boolean` | `false` | Enable currency formatting for number inputs (MX locale). |
34
+ | `formatNumber` | `boolean` | `false` | Enable number formatting on blur. |
35
+ | `autoFocus` | `boolean` | `false` | Auto-focus the input on mount. |
36
+ | `focusContent` | `boolean` | `false` | Select all content on click/focus. |
37
+ | `readOnly` | `boolean` | `false` | Render the input in read-only mode. |
38
+ | `min` | `number` | `undefined` | Minimum numeric value for number inputs. |
39
+ | `max` | `number` | `undefined` | Maximum numeric value for number inputs. |
40
+ | `rows` | `number` | `undefined` | Number of visible rows for textarea. |
41
+ | `checked` | `boolean` | `undefined` | Checked state for checkbox and radio types. |
42
+ | `containerClassName` | `string` | `undefined` | Additional CSS classes for the outer container. |
43
+ | `labelClassName` | `string` | `undefined` | Additional CSS classes for the label. |
44
+ | `className` | `string` | `undefined` | Additional CSS classes for the input element. |
45
+ | `onClick` | `() => void` | `undefined` | Click handler for the input. |
46
+
47
+ ## Usage
48
+
49
+ ```tsx
50
+ import { ITInput } from '@axzydev/axzy_ui_system';
51
+
52
+ <ITInput name="email" label="Email" type="email" placeholder="example@mail.com" />
53
+ <ITInput name="password" label="Password" type="password" iconLeft={<FaLock />} />
54
+ <ITInput name="bio" label="Bio" type="textarea" rows={4} />
55
+ <ITInput name="qty" label="Quantity" type="number" min={0} max={100} />
56
+ ```
57
+
58
+ ## Notes
59
+
60
+ - Error message only displays when both `error` and `touched` are truthy.
61
+ - `showHintLength` with `maxLength` displays a counter (e.g. "45/200").
62
+ - Currency formatting uses MX locale by default when `currencyFormat` is true.
63
+ - Icons rendered via `iconLeft`/`iconRight` can be clickable React nodes (e.g. a toggle visibility button).
64
+ - Checkbox and radio types render inline labels instead of stacked layout.
65
+
66
+ ## Stories
67
+
68
+ <Primary />
69
+ <Controls />
70
+ <Stories />
@@ -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
  }
@@ -3,6 +3,31 @@ import clsx from "clsx";
3
3
  import ITTopBar from "../topbar/topbar";
4
4
  import ITSidebar from "../sidebar/sidebar";
5
5
  import { ITLayoutProps } from "./layout.props";
6
+ import { theme } from "@/theme/theme";
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
+ */
6
31
  export default function ITLayout({
7
32
  topBar,
8
33
  sidebar,
@@ -10,37 +35,37 @@ export default function ITLayout({
10
35
  className = "",
11
36
  contentClassName = "",
12
37
  }: ITLayoutProps) {
38
+ const [internalCollapsed, setInternalCollapsed] = useState(true);
39
+ const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false);
13
40
 
14
- // Desktop states
15
- const [desktopCollapsed, setDesktopCollapsed] = useState(true); // Default to collapsed
41
+ const isControlled = sidebar.isCollapsed !== undefined;
42
+ const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
43
+ const handleToggleCollapse = isControlled ? (sidebar.onToggleCollapse ?? (() => {})) : () => setInternalCollapsed(v => !v);
16
44
 
17
- // Mobile drawer state
18
- const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false);
45
+ const layoutTokens = theme.layout;
19
46
 
20
47
  return (
21
48
  <div className={`flex flex-col h-screen overflow-hidden w-full ${className}`}>
22
-
23
- {/* TOPBAR - Full Width at Top */}
24
49
  <ITTopBar
25
50
  {...topBar}
26
51
  showMobileMenuButton
27
52
  onToggleMobileMenu={() => setMobileSidebarOpen(v => !v)}
28
53
  />
29
54
 
30
- <div className="flex flex-1 overflow-hidden relative" style={{ backgroundColor: "var(--layout-bg, #f8fafc)" }}>
31
-
32
- {/* DESKTOP SIDEBAR - Floating over content when expanded */}
55
+ <div
56
+ className="flex flex-1 overflow-hidden relative"
57
+ style={{ backgroundColor: layoutTokens.backgroundColor }}
58
+ >
59
+ {/* DESKTOP SIDEBAR */}
33
60
  <div className="hidden lg:block relative z-40 h-full">
34
- {/* Spacer to keep main content from shifting. Width matches collapsed sidebar. */}
35
61
  <div className="w-[88px] h-full flex-shrink-0" />
36
-
37
62
  <div className="absolute top-0 left-0 h-full">
38
63
  <ITSidebar
39
64
  {...sidebar}
40
65
  isCollapsed={desktopCollapsed}
41
- onToggleCollapse={() => setDesktopCollapsed(v => !v)}
66
+ onToggleCollapse={handleToggleCollapse}
42
67
  visibleOnMobile={false}
43
- className={`h-full drop-shadow-2xl transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0`}
68
+ className="h-full drop-shadow-2xl transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0"
44
69
  />
45
70
  </div>
46
71
  </div>
@@ -51,11 +76,11 @@ export default function ITLayout({
51
76
  className="lg:hidden fixed inset-0 z-50 transition-opacity duration-300 backdrop-blur-sm bg-black/40"
52
77
  onClick={() => setMobileSidebarOpen(false)}
53
78
  >
54
- <div
79
+ <div
55
80
  className="h-full w-fit flex transform transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]"
56
- onClick={(e) => e.stopPropagation()}
81
+ onClick={(e) => e.stopPropagation()}
57
82
  >
58
- <ITSidebar
83
+ <ITSidebar
59
84
  {...sidebar}
60
85
  isCollapsed={false}
61
86
  visibleOnMobile={true}
@@ -74,7 +99,6 @@ export default function ITLayout({
74
99
  {children}
75
100
  </div>
76
101
  </main>
77
-
78
102
  </div>
79
103
  </div>
80
104
  );
@@ -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
+ };