@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.
- package/dist/index.cjs +777 -535
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +1470 -87
- package/dist/index.d.ts +1470 -87
- package/dist/index.js +799 -555
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/App.tsx +19 -54
- package/src/components/alert/alert.doc.mdx +48 -0
- package/src/components/alert/alert.props.ts +7 -0
- package/src/components/alert/alert.tsx +8 -0
- package/src/components/avatar/avatar.doc.mdx +48 -0
- package/src/components/avatar/avatar.props.ts +8 -0
- package/src/components/avatar/avatar.tsx +25 -5
- package/src/components/badget/badget.doc.mdx +46 -0
- package/src/components/badget/badget.props.ts +6 -0
- package/src/components/badget/badget.tsx +11 -0
- package/src/components/breadcrumbs/breadcrumbs.doc.mdx +57 -0
- package/src/components/breadcrumbs/breadcrumbs.props.ts +6 -0
- package/src/components/breadcrumbs/breadcrumbs.tsx +12 -0
- package/src/components/button/button.doc.mdx +59 -0
- package/src/components/button/button.props.ts +12 -0
- package/src/components/button/button.tsx +11 -0
- package/src/components/calendar/calendar.doc.mdx +75 -0
- package/src/components/calendar/calendar.props.ts +27 -7
- package/src/components/calendar/calendar.tsx +13 -0
- package/src/components/card/card.doc.mdx +54 -0
- package/src/components/card/card.props.ts +11 -0
- package/src/components/card/card.tsx +13 -0
- package/src/components/checkbox/checkbox.doc.mdx +54 -0
- package/src/components/checkbox/checkbox.props.ts +7 -0
- package/src/components/checkbox/checkbox.tsx +9 -0
- package/src/components/confirm-dialog/confirm-dialog.doc.mdx +60 -0
- package/src/components/confirm-dialog/confirm-dialog.props.ts +9 -0
- package/src/components/confirm-dialog/confirm-dialog.tsx +19 -0
- package/src/components/data-table/ITDataTable.doc.mdx +59 -0
- package/src/components/data-table/dataTable.props.ts +15 -0
- package/src/components/data-table/dataTable.tsx +178 -73
- package/src/components/date-picker/date-picker.doc.mdx +65 -0
- package/src/components/date-picker/date-picker.props.ts +17 -0
- package/src/components/date-picker/datePicker.tsx +31 -1
- package/src/components/dialog/dialog.doc.mdx +54 -0
- package/src/components/dialog/dialog.props.ts +7 -0
- package/src/components/dialog/dialog.tsx +26 -0
- package/src/components/divider/divider.doc.mdx +42 -0
- package/src/components/divider/divider.props.ts +5 -0
- package/src/components/divider/divider.tsx +16 -0
- package/src/components/drawer/drawer.doc.mdx +59 -0
- package/src/components/drawer/drawer.props.ts +9 -0
- package/src/components/drawer/drawer.tsx +20 -0
- package/src/components/dropfile/dropfile.doc.mdx +59 -0
- package/src/components/dropfile/dropfile.props.ts +41 -0
- package/src/components/dropfile/dropfile.tsx +21 -33
- package/src/components/empty-state/empty-state.doc.mdx +50 -0
- package/src/components/empty-state/empty-state.props.ts +5 -0
- package/src/components/empty-state/empty-state.tsx +16 -0
- package/src/components/flex/flex.doc.mdx +59 -0
- package/src/components/flex/flex.props.ts +13 -0
- package/src/components/flex/flex.tsx +15 -0
- package/src/components/form-builder/fieldRenderer.tsx +52 -2
- package/src/components/form-builder/formBuilder.doc.mdx +124 -0
- package/src/components/form-builder/formBuilder.props.ts +12 -2
- package/src/components/form-builder/formBuilder.tsx +31 -0
- package/src/components/form-header/form-header.doc.mdx +38 -0
- package/src/components/form-header/form-header.props.ts +3 -0
- package/src/components/form-header/form-header.stories.tsx +53 -0
- package/src/components/form-header/form-header.tsx +11 -0
- package/src/components/grid/grid.doc.mdx +54 -0
- package/src/components/grid/grid.props.ts +13 -0
- package/src/components/grid/grid.tsx +26 -2
- package/src/components/image/image.doc.mdx +44 -0
- package/src/components/image/image.props.ts +5 -0
- package/src/components/image/image.stories.tsx +49 -0
- package/src/components/image/image.tsx +19 -0
- package/src/components/input/input.doc.mdx +70 -0
- package/src/components/input/input.props.ts +34 -2
- package/src/components/input/input.tsx +29 -0
- package/src/components/layout/layout.doc.mdx +51 -0
- package/src/components/layout/layout.props.ts +5 -0
- package/src/components/layout/layout.tsx +41 -17
- package/src/components/loader/loader.doc.mdx +43 -0
- package/src/components/loader/loader.props.ts +4 -0
- package/src/components/loader/loader.tsx +17 -0
- package/src/components/navbar/navbar.doc.mdx +77 -0
- package/src/components/navbar/navbar.props.ts +37 -1
- package/src/components/navbar/navbar.stories.tsx +84 -0
- package/src/components/navbar/navbar.tsx +78 -46
- package/src/components/page/page.doc.mdx +80 -0
- package/src/components/page/page.props.ts +25 -0
- package/src/components/page/page.tsx +35 -7
- package/src/components/page-header/page-header.doc.mdx +54 -0
- package/src/components/page-header/page-header.props.ts +11 -0
- package/src/components/page-header/page-header.stories.tsx +14 -0
- package/src/components/page-header/page-header.tsx +50 -15
- package/src/components/pagination/pagination.doc.mdx +62 -0
- package/src/components/pagination/pagination.props.ts +11 -32
- package/src/components/pagination/pagination.tsx +17 -0
- package/src/components/popover/popover.doc.mdx +53 -0
- package/src/components/popover/popover.props.ts +8 -0
- package/src/components/popover/popover.tsx +13 -0
- package/src/components/progress/progress.doc.mdx +48 -0
- package/src/components/progress/progress.props.ts +8 -0
- package/src/components/progress/progress.tsx +9 -0
- package/src/components/radio/radio.doc.mdx +62 -0
- package/src/components/radio/radio.props.ts +11 -0
- package/src/components/radio/radio.tsx +18 -0
- package/src/components/search-select/search-select.doc.mdx +72 -0
- package/src/components/search-select/search-select.props.ts +23 -18
- package/src/components/search-select/search-select.tsx +27 -2
- package/src/components/searchTable/searchTable.doc.mdx +79 -0
- package/src/components/searchTable/searchTable.props.ts +42 -3
- package/src/components/searchTable/searchTable.stories.tsx +74 -0
- package/src/components/searchTable/searchTable.tsx +23 -0
- package/src/components/segmented-control/segmented-control.doc.mdx +60 -0
- package/src/components/segmented-control/segmented-control.props.ts +12 -0
- package/src/components/segmented-control/segmented-control.tsx +15 -0
- package/src/components/select/select.doc.mdx +75 -0
- package/src/components/select/select.props.ts +22 -0
- package/src/components/select/select.tsx +2 -5
- package/src/components/sidebar/sidebar.doc.mdx +86 -0
- package/src/components/sidebar/sidebar.props.ts +22 -0
- package/src/components/sidebar/sidebar.tsx +22 -0
- package/src/components/skeleton/skeleton.doc.mdx +43 -0
- package/src/components/skeleton/skeleton.props.ts +8 -0
- package/src/components/skeleton/skeleton.tsx +10 -0
- package/src/components/slide/slide.doc.mdx +46 -0
- package/src/components/slide/slide.props.ts +11 -24
- package/src/components/slide/slide.tsx +10 -1
- package/src/components/slider/slider.doc.mdx +49 -0
- package/src/components/slider/slider.props.ts +9 -0
- package/src/components/slider/slider.tsx +15 -0
- package/src/components/stack/stack.doc.mdx +126 -0
- package/src/components/stack/stack.props.ts +18 -0
- package/src/components/stack/stack.stories.tsx +221 -16
- package/src/components/stack/stack.tsx +21 -0
- package/src/components/stat-card/stat-card.doc.mdx +48 -0
- package/src/components/stat-card/stat-card.props.ts +9 -0
- package/src/components/stat-card/stat-card.tsx +10 -0
- package/src/components/stepper/stepper.doc.mdx +54 -0
- package/src/components/stepper/stepper.props.ts +11 -1
- package/src/components/stepper/stepper.tsx +15 -0
- package/src/components/table/table.doc.mdx +58 -0
- package/src/components/table/table.props.ts +17 -0
- package/src/components/table/table.tsx +199 -84
- package/src/components/tabs/tabs.doc.mdx +52 -0
- package/src/components/tabs/tabs.props.ts +11 -0
- package/src/components/tabs/tabs.tsx +14 -0
- package/src/components/text/text.doc.mdx +41 -0
- package/src/components/text/text.props.ts +5 -0
- package/src/components/text/text.stories.tsx +67 -0
- package/src/components/text/text.tsx +10 -0
- package/src/components/textarea/textarea.doc.mdx +64 -0
- package/src/components/textarea/textarea.props.ts +11 -0
- package/src/components/textarea/textarea.tsx +16 -0
- package/src/components/theme-provider/themeProvider.doc.mdx +75 -0
- package/src/components/theme-provider/themeProvider.props.ts +3 -0
- package/src/components/theme-provider/themeProvider.stories.tsx +59 -0
- package/src/components/theme-provider/themeProvider.tsx +14 -0
- package/src/components/time-picker/timePicker.doc.mdx +68 -0
- package/src/components/time-picker/timePicker.props.ts +14 -0
- package/src/components/time-picker/timePicker.tsx +22 -1
- package/src/components/toast/toast.doc.mdx +50 -0
- package/src/components/toast/toast.props.ts +5 -0
- package/src/components/toast/toast.tsx +21 -0
- package/src/components/tooltip/tooltip.doc.mdx +47 -0
- package/src/components/tooltip/tooltip.props.ts +6 -0
- package/src/components/tooltip/tooltip.tsx +19 -0
- package/src/components/topbar/topbar.doc.mdx +69 -0
- package/src/components/topbar/topbar.props.ts +15 -0
- package/src/components/topbar/topbar.tsx +38 -0
- package/src/components/triple-filter/tripleFilter.doc.mdx +62 -0
- package/src/components/triple-filter/tripleFilter.props.ts +7 -0
- package/src/components/triple-filter/tripleFilter.tsx +32 -0
- package/src/index.css +17 -0
- package/src/showcases/DataShowcases.tsx +529 -45
- package/src/showcases/FormShowcases.tsx +399 -29
- package/src/showcases/HomeShowcase.tsx +252 -272
- package/src/showcases/LayoutPrimitivesShowcases.tsx +1224 -248
- package/src/showcases/PageShowcases.tsx +868 -151
- package/src/showcases/ShowcaseLayout.tsx +237 -73
- package/src/showcases/StructureShowcases.tsx +1039 -97
- package/src/types/table.types.ts +1 -1
- package/src/utils/styles.ts +2 -1
|
@@ -4,6 +4,44 @@ import { useRef, useState } from "react";
|
|
|
4
4
|
import { ITTopBarProps } from "./topbar.props";
|
|
5
5
|
import ITText from "@/components/text/text";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* ITTopBar — sticky top navigation bar with logo, nav items, and user avatar dropdown.
|
|
9
|
+
*
|
|
10
|
+
* Renders a horizontal header bar that includes an optional logo and brand text,
|
|
11
|
+
* desktop navigation links, a mobile hamburger toggle, and a user-menu dropdown
|
|
12
|
+
* with avatar, name, email, and action items. Destructive actions (labels containing
|
|
13
|
+
* "salir", "cerrar", or "logout") are automatically highlighted in red.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Basic topbar with user menu
|
|
17
|
+
* <ITTopBar
|
|
18
|
+
* logo={<LogoIcon />}
|
|
19
|
+
* logoText="Dashboard"
|
|
20
|
+
* userMenu={{
|
|
21
|
+
* userName: "Jane Doe",
|
|
22
|
+
* userEmail: "jane@example.com",
|
|
23
|
+
* userImage: "https://i.pravatar.cc/48",
|
|
24
|
+
* menuItems: [
|
|
25
|
+
* { label: "Settings", onClick: () => {} },
|
|
26
|
+
* { label: "Logout", onClick: () => {} },
|
|
27
|
+
* ],
|
|
28
|
+
* }}
|
|
29
|
+
* />
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Topbar with navigation items and mobile toggle
|
|
33
|
+
* <ITTopBar
|
|
34
|
+
* logo={<BrandLogo />}
|
|
35
|
+
* logoText="Admin"
|
|
36
|
+
* navItems={[
|
|
37
|
+
* { id: "home", label: "Home", action: () => {} },
|
|
38
|
+
* { id: "reports", label: "Reports", action: () => {} },
|
|
39
|
+
* ]}
|
|
40
|
+
* onNavItemClick={(id) => navigate(id)}
|
|
41
|
+
* showMobileMenuButton
|
|
42
|
+
* onToggleMobileMenu={() => setSidebarOpen((v) => !v)}
|
|
43
|
+
* />
|
|
44
|
+
*/
|
|
7
45
|
export default function ITTopBar({
|
|
8
46
|
logo,
|
|
9
47
|
logoText,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './tripleFilter.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITTripleFilter
|
|
7
|
+
|
|
8
|
+
Generic segmented toggle filter bar for quick data filtering. Renders a row of pill-shaped buttons where exactly one is active at a time. Supports any string or boolean value type, configurable color theming, and full-width mode. Commonly used for "All / Active / Inactive" or similar tri-state filters in tables, lists, and dashboards.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `value` | `T extends string \| boolean` | — | Currently selected value. Must match one of the option values. |
|
|
15
|
+
| `onChange` | `(value: T) => void` | — | Called when the user selects a different option. Receives the new value. |
|
|
16
|
+
| `options` | `ITTripleFilterOption<T>[]` | — | Array of filter options to render (typically 2–4 items). Each has `label: string` and `value: T`. |
|
|
17
|
+
| `color` | `ColorsTypes` | `"primary"` | Color theme for the active indicator. One of `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `purple`, `error`, `gray`. |
|
|
18
|
+
| `className` | `string` | — | Additional CSS classes applied to the outermost container. |
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { ITTripleFilter } from '@axzydev/axzy_ui_system';
|
|
24
|
+
|
|
25
|
+
<ITTripleFilter<string>
|
|
26
|
+
value={status}
|
|
27
|
+
onChange={setStatus}
|
|
28
|
+
options={[
|
|
29
|
+
{ label: 'All', value: 'all' },
|
|
30
|
+
{ label: 'Active', value: 'active' },
|
|
31
|
+
{ label: 'Inactive', value: 'inactive' },
|
|
32
|
+
]}
|
|
33
|
+
color="success"
|
|
34
|
+
/>
|
|
35
|
+
|
|
36
|
+
<ITTripleFilter<boolean>
|
|
37
|
+
value={showActive}
|
|
38
|
+
onChange={setShowActive}
|
|
39
|
+
options={[
|
|
40
|
+
{ label: 'All', value: false },
|
|
41
|
+
{ label: 'Active', value: true },
|
|
42
|
+
]}
|
|
43
|
+
color="danger"
|
|
44
|
+
/>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Notes
|
|
48
|
+
|
|
49
|
+
- Generic component — works with `string` or `boolean` value types.
|
|
50
|
+
- Active option receives a full background fill matching the `color` prop, while inactive options use a subtle outlined style.
|
|
51
|
+
- Exactly **one** option is always active; selecting the already-active option is a no-op.
|
|
52
|
+
- **color** accepts all semantic color tokens: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `purple`, `error`, `gray`.
|
|
53
|
+
- Both `error` and `danger` map to the same danger color.
|
|
54
|
+
- Use `className` to control width — for full-width mode, apply `w-full`.
|
|
55
|
+
- The filter bar is rendered as a horizontal inline-flex row; options wrap naturally on narrow containers.
|
|
56
|
+
- Ideal for filter bars above data tables, alongside search inputs and date pickers.
|
|
57
|
+
|
|
58
|
+
## Stories
|
|
59
|
+
|
|
60
|
+
<Primary />
|
|
61
|
+
<Controls />
|
|
62
|
+
<Stories />
|
|
@@ -2,14 +2,21 @@ import React from 'react';
|
|
|
2
2
|
import { ColorsTypes } from "@/types/colors.types";
|
|
3
3
|
|
|
4
4
|
export interface ITTripleFilterOption<T> {
|
|
5
|
+
/** Display label for the filter button. */
|
|
5
6
|
label: string;
|
|
7
|
+
/** The value associated with this option (string or boolean). */
|
|
6
8
|
value: T;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export interface ITTripleFilterProps<T> {
|
|
12
|
+
/** Currently selected value. Must match one of the option values. */
|
|
10
13
|
value: T;
|
|
14
|
+
/** Called when the user selects a different option. Receives the new value. */
|
|
11
15
|
onChange: (value: T) => void;
|
|
16
|
+
/** Array of filter options to render (typically 2-4 items, e.g. All / Active / Inactive). */
|
|
12
17
|
options: ITTripleFilterOption<T>[];
|
|
18
|
+
/** Color theme for the active indicator. One of "primary", "secondary", "success", "danger", "warning", "info", "purple", "error", "gray". @default "primary" */
|
|
13
19
|
color?: ColorsTypes;
|
|
20
|
+
/** Additional CSS classes applied to the outermost container. */
|
|
14
21
|
className?: string;
|
|
15
22
|
}
|
|
@@ -15,6 +15,38 @@ const colorMap: Record<ColorsTypes, string> = {
|
|
|
15
15
|
gray: "text-secondary-600",
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* ITTripleFilter — generic segmented toggle filter bar for quick data filtering.
|
|
20
|
+
*
|
|
21
|
+
* Renders a row of pill-shaped buttons where exactly one is active at a time.
|
|
22
|
+
* Supports any string or boolean value type and configurable color theming.
|
|
23
|
+
* Commonly used for "All / Active / Inactive" or similar tri-state filters.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Boolean triple filter
|
|
27
|
+
* <ITTripleFilter<boolean>
|
|
28
|
+
* value={showActive}
|
|
29
|
+
* onChange={setShowActive}
|
|
30
|
+
* options={[
|
|
31
|
+
* { label: "All", value: false },
|
|
32
|
+
* { label: "Active", value: true },
|
|
33
|
+
* ]}
|
|
34
|
+
* />
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // String triple filter with danger color
|
|
38
|
+
* <ITTripleFilter<string>
|
|
39
|
+
* value={status}
|
|
40
|
+
* onChange={setStatus}
|
|
41
|
+
* options={[
|
|
42
|
+
* { label: "Pending", value: "pending" },
|
|
43
|
+
* { label: "Approved", value: "approved" },
|
|
44
|
+
* { label: "Rejected", value: "rejected" },
|
|
45
|
+
* ]}
|
|
46
|
+
* color="danger"
|
|
47
|
+
* className="my-4"
|
|
48
|
+
* />
|
|
49
|
+
*/
|
|
18
50
|
/**
|
|
19
51
|
* @description Generic triple/segmented filter component with color support.
|
|
20
52
|
*/
|
package/src/index.css
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
--color-secondary-400: #94a3b8;
|
|
29
29
|
--color-secondary-500: #64748b;
|
|
30
30
|
--color-secondary-600: #475569;
|
|
31
|
+
|
|
32
|
+
--color-text-muted: #475569;
|
|
31
33
|
--color-secondary-700: #334155;
|
|
32
34
|
--color-secondary-800: #1e293b;
|
|
33
35
|
--color-secondary-900: #0f172a;
|
|
@@ -99,6 +101,21 @@
|
|
|
99
101
|
to { opacity: 1; transform: translateY(0); }
|
|
100
102
|
}
|
|
101
103
|
|
|
104
|
+
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
|
|
105
|
+
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
106
|
+
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
107
|
+
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
108
|
+
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
|
|
109
|
+
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
|
|
110
|
+
.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
|
|
111
|
+
.grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
|
|
112
|
+
.grid-cols-9 { grid-template-columns: repeat(9, minmax(0, 1fr)); }
|
|
113
|
+
.grid-cols-10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
|
|
114
|
+
.grid-cols-11 { grid-template-columns: repeat(11, minmax(0, 1fr)); }
|
|
115
|
+
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
|
|
116
|
+
|
|
117
|
+
.col-span-full { grid-column: 1 / -1; }
|
|
118
|
+
|
|
102
119
|
.col-span-1 { grid-column: span 1 / span 1; }
|
|
103
120
|
.col-span-2 { grid-column: span 2 / span 2; }
|
|
104
121
|
.col-span-3 { grid-column: span 3 / span 3; }
|