@axzydev/axzy_ui_system 1.2.13 → 1.2.14
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/README.md +43 -0
- package/dist/index.cjs +6490 -6388
- 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 +169 -110
- package/dist/index.d.ts +169 -110
- package/dist/index.js +6516 -6414
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/src/App.tsx +86 -81
- package/src/components/{avatar → atoms/avatar}/avatar.doc.mdx +2 -2
- package/src/components/{avatar → atoms/avatar}/avatar.stories.tsx +1 -2
- package/src/components/{avatar → atoms/avatar}/avatar.tsx +1 -1
- package/src/components/{badget → atoms/badget}/badget.doc.mdx +4 -4
- package/src/components/{badget → atoms/badget}/badget.props.ts +1 -1
- package/src/components/{badget → atoms/badget}/badget.stories.tsx +1 -2
- package/src/components/{badget → atoms/badget}/badget.tsx +3 -3
- package/src/components/{button → atoms/button}/button.doc.mdx +3 -3
- package/src/components/{button → atoms/button}/button.props.ts +3 -3
- package/src/components/{button → atoms/button}/button.stories.tsx +1 -2
- package/src/components/{button → atoms/button}/button.tsx +7 -7
- package/src/components/{checkbox → atoms/checkbox}/checkbox.doc.mdx +2 -2
- package/src/components/{checkbox → atoms/checkbox}/checkbox.stories.tsx +2 -3
- package/src/components/{checkbox → atoms/checkbox}/checkbox.tsx +1 -1
- package/src/components/{divider → atoms/divider}/divider.doc.mdx +2 -2
- package/src/components/{divider → atoms/divider}/divider.stories.tsx +3 -4
- package/src/components/{flex → atoms/flex}/flex.doc.mdx +2 -2
- package/src/components/{flex → atoms/flex}/flex.stories.tsx +1 -2
- package/src/components/{grid → atoms/grid}/grid.doc.mdx +2 -2
- package/src/components/{grid → atoms/grid}/grid.stories.tsx +1 -2
- package/src/components/{image → atoms/image}/image.doc.mdx +2 -2
- package/src/components/{image → atoms/image}/image.stories.tsx +1 -2
- package/src/components/{input → atoms/input}/input.doc.mdx +3 -3
- package/src/components/{input → atoms/input}/input.props.ts +3 -3
- package/src/components/{input → atoms/input}/input.stories.tsx +2 -4
- package/src/components/{input → atoms/input}/input.tsx +5 -14
- package/src/components/{loader → atoms/loader}/loader.doc.mdx +2 -2
- package/src/components/{loader → atoms/loader}/loader.stories.tsx +2 -3
- package/src/components/{loader → atoms/loader}/loader.tsx +1 -1
- package/src/components/{popover → atoms/popover}/popover.doc.mdx +2 -2
- package/src/components/{popover → atoms/popover}/popover.stories.tsx +3 -4
- package/src/components/{progress → atoms/progress}/progress.doc.mdx +2 -2
- package/src/components/{progress → atoms/progress}/progress.stories.tsx +2 -3
- package/src/components/{radio → atoms/radio}/radio.doc.mdx +2 -2
- package/src/components/{radio → atoms/radio}/radio.stories.tsx +1 -3
- package/src/components/{radio → atoms/radio}/radio.tsx +1 -1
- package/src/components/{segmented-control → atoms/segmented-control}/segmented-control.doc.mdx +2 -2
- package/src/components/{segmented-control → atoms/segmented-control}/segmented-control.stories.tsx +1 -2
- package/src/components/{segmented-control → atoms/segmented-control}/segmented-control.tsx +1 -1
- package/src/components/{skeleton → atoms/skeleton}/skeleton.doc.mdx +2 -2
- package/src/components/{skeleton → atoms/skeleton}/skeleton.stories.tsx +2 -3
- package/src/components/{slide → atoms/slide}/slide.doc.mdx +2 -2
- package/src/components/{slide → atoms/slide}/slide.stories.tsx +1 -2
- package/src/components/{slider → atoms/slider}/slider.doc.mdx +2 -2
- package/src/components/{slider → atoms/slider}/slider.stories.tsx +1 -2
- package/src/components/{slider → atoms/slider}/slider.tsx +1 -1
- package/src/components/{stack → atoms/stack}/stack.doc.mdx +2 -2
- package/src/components/{stack → atoms/stack}/stack.stories.tsx +2 -3
- package/src/components/{text → atoms/text}/text.doc.mdx +2 -2
- package/src/components/{text → atoms/text}/text.stories.tsx +1 -2
- package/src/components/{textarea → atoms/textarea}/textarea.doc.mdx +2 -2
- package/src/components/{textarea → atoms/textarea}/textarea.props.ts +0 -2
- package/src/components/{textarea → atoms/textarea}/textarea.stories.tsx +1 -2
- package/src/components/{textarea → atoms/textarea}/textarea.tsx +1 -1
- package/src/components/{tooltip → atoms/tooltip}/tooltip.doc.mdx +2 -2
- package/src/components/{tooltip → atoms/tooltip}/tooltip.stories.tsx +2 -3
- package/src/components/{tooltip → atoms/tooltip}/tooltip.tsx +1 -1
- package/src/components/isolation/isolation.stories.tsx +202 -0
- package/src/components/{alert → molecules/alert}/alert.doc.mdx +2 -2
- package/src/components/{alert → molecules/alert}/alert.stories.tsx +1 -2
- package/src/components/{alert → molecules/alert}/alert.tsx +1 -2
- package/src/components/{breadcrumbs → molecules/breadcrumbs}/breadcrumbs.doc.mdx +2 -2
- package/src/components/{breadcrumbs → molecules/breadcrumbs}/breadcrumbs.stories.tsx +1 -2
- package/src/components/{breadcrumbs → molecules/breadcrumbs}/breadcrumbs.tsx +1 -1
- package/src/components/{calendar → molecules/calendar}/calendar.doc.mdx +2 -2
- package/src/components/{calendar → molecules/calendar}/calendar.stories.tsx +1 -2
- package/src/components/{calendar → molecules/calendar}/calendar.tsx +42 -42
- package/src/components/molecules/calendar/index.ts +2 -0
- package/src/components/{card → molecules/card}/card.doc.mdx +2 -2
- package/src/components/{card → molecules/card}/card.stories.tsx +2 -3
- package/src/components/{card → molecules/card}/card.tsx +4 -4
- package/src/components/{date-picker → molecules/date-picker}/date-picker.doc.mdx +3 -3
- package/src/components/{date-picker → molecules/date-picker}/date-picker.props.ts +1 -1
- package/src/components/{date-picker → molecules/date-picker}/date-picker.stories.tsx +1 -3
- package/src/components/{date-picker → molecules/date-picker}/datePicker.tsx +3 -3
- package/src/components/{empty-state → molecules/empty-state}/empty-state.doc.mdx +3 -3
- package/src/components/{empty-state → molecules/empty-state}/empty-state.stories.tsx +3 -4
- package/src/components/{empty-state → molecules/empty-state}/empty-state.tsx +1 -1
- package/src/components/{form-header → molecules/form-header}/form-header.doc.mdx +2 -2
- package/src/components/{form-header → molecules/form-header}/form-header.stories.tsx +1 -2
- package/src/components/{form-header → molecules/form-header}/form-header.tsx +2 -2
- package/src/components/{pagination → molecules/pagination}/pagination.doc.mdx +2 -2
- package/src/components/{pagination → molecules/pagination}/pagination.stories.tsx +1 -2
- package/src/components/{pagination → molecules/pagination}/pagination.tsx +8 -8
- package/src/components/{search-select → molecules/search-select}/index.ts +1 -1
- package/src/components/{search-select → molecules/search-select}/search-select.doc.mdx +2 -2
- package/src/components/{search-select → molecules/search-select}/search-select.props.ts +3 -0
- package/src/components/{search-select → molecules/search-select}/search-select.stories.tsx +1 -2
- package/src/components/{search-select → molecules/search-select}/search-select.tsx +8 -6
- package/src/components/{select → molecules/select}/select.doc.mdx +2 -2
- package/src/components/{select → molecules/select}/select.stories.tsx +1 -2
- package/src/components/{select → molecules/select}/select.tsx +8 -16
- package/src/components/{stat-card → molecules/stat-card}/stat-card.doc.mdx +2 -2
- package/src/components/{stat-card → molecules/stat-card}/stat-card.stories.tsx +2 -3
- package/src/components/{stat-card → molecules/stat-card}/stat-card.tsx +1 -1
- package/src/components/{stepper → molecules/stepper}/stepper.doc.mdx +2 -2
- package/src/components/{stepper → molecules/stepper}/stepper.stories.tsx +1 -2
- package/src/components/{stepper → molecules/stepper}/stepper.tsx +9 -10
- package/src/components/{table → molecules/table}/table.doc.mdx +2 -2
- package/src/components/{table → molecules/table}/table.stories.tsx +5 -22
- package/src/components/{table → molecules/table}/table.tsx +5 -15
- package/src/components/{tabs → molecules/tabs}/tabs.doc.mdx +2 -2
- package/src/components/{tabs → molecules/tabs}/tabs.stories.tsx +1 -2
- package/src/components/{tabs → molecules/tabs}/tabs.tsx +1 -1
- package/src/components/{time-picker → molecules/time-picker}/timePicker.doc.mdx +3 -3
- package/src/components/{time-picker → molecules/time-picker}/timePicker.props.ts +4 -2
- package/src/components/{time-picker → molecules/time-picker}/timePicker.stories.tsx +3 -4
- package/src/components/{time-picker → molecules/time-picker}/timePicker.tsx +5 -5
- package/src/components/{confirm-dialog → organisms/confirm-dialog}/confirm-dialog.doc.mdx +2 -2
- package/src/components/{confirm-dialog → organisms/confirm-dialog}/confirm-dialog.stories.tsx +2 -3
- package/src/components/{confirm-dialog → organisms/confirm-dialog}/confirm-dialog.tsx +4 -4
- package/src/components/{data-table → organisms/data-table}/ITDataTable.doc.mdx +2 -2
- package/src/components/{data-table → organisms/data-table}/ITDataTable.stories.tsx +3 -4
- package/src/components/{data-table → organisms/data-table}/dataTable.props.ts +1 -1
- package/src/components/{data-table → organisms/data-table}/dataTable.tsx +7 -8
- package/src/components/{dialog → organisms/dialog}/dialog.doc.mdx +2 -2
- package/src/components/{dialog → organisms/dialog}/dialog.stories.tsx +3 -5
- package/src/components/{dialog → organisms/dialog}/dialog.tsx +2 -2
- package/src/components/{drawer → organisms/drawer}/drawer.doc.mdx +2 -2
- package/src/components/{drawer → organisms/drawer}/drawer.stories.tsx +2 -3
- package/src/components/{drawer → organisms/drawer}/drawer.tsx +1 -1
- package/src/components/{dropfile → organisms/dropfile}/dropfile.doc.mdx +3 -3
- package/src/components/{dropfile → organisms/dropfile}/dropfile.props.ts +8 -4
- package/src/components/{dropfile → organisms/dropfile}/dropfile.stories.tsx +2 -5
- package/src/components/{dropfile → organisms/dropfile}/dropfile.tsx +25 -12
- package/src/components/{form-builder → organisms/form-builder}/fieldRenderer.tsx +30 -20
- package/src/components/{form-builder → organisms/form-builder}/formBuilder.context.tsx +3 -2
- package/src/components/{form-builder → organisms/form-builder}/formBuilder.doc.mdx +2 -2
- package/src/components/{form-builder → organisms/form-builder}/formBuilder.stories.tsx +0 -1
- package/src/components/{form-builder → organisms/form-builder}/formBuilder.tsx +4 -5
- package/src/components/{form-builder → organisms/form-builder}/useFormBuilder.ts +4 -4
- package/src/components/{navbar → organisms/navbar}/navbar.doc.mdx +2 -2
- package/src/components/{navbar → organisms/navbar}/navbar.stories.tsx +1 -2
- package/src/components/{navbar → organisms/navbar}/navbar.tsx +1 -1
- package/src/components/{page-header → organisms/page-header}/page-header.doc.mdx +2 -2
- package/src/components/{page-header → organisms/page-header}/page-header.props.ts +1 -1
- package/src/components/{page-header → organisms/page-header}/page-header.stories.tsx +5 -6
- package/src/components/{page-header → organisms/page-header}/page-header.tsx +2 -2
- package/src/components/{searchTable → organisms/searchTable}/components/EditableCell.tsx +4 -5
- package/src/components/{searchTable → organisms/searchTable}/components/PaginationControls.tsx +6 -6
- package/src/components/{searchTable → organisms/searchTable}/components/PaginationInfo.tsx +1 -1
- package/src/components/{searchTable → organisms/searchTable}/components/SearchAndSortBar.tsx +3 -3
- package/src/components/{searchTable → organisms/searchTable}/components/SearchInput.tsx +1 -1
- package/src/components/{searchTable → organisms/searchTable}/components/SortButton.tsx +1 -1
- package/src/components/{searchTable → organisms/searchTable}/components/TableEmptyState.tsx +1 -1
- package/src/components/{searchTable → organisms/searchTable}/components/TableHeaderCell.tsx +1 -1
- package/src/components/{searchTable → organisms/searchTable}/searchTable.doc.mdx +2 -2
- package/src/components/{searchTable → organisms/searchTable}/searchTable.stories.tsx +1 -2
- package/src/components/{searchTable → organisms/searchTable}/searchTable.tsx +1 -2
- package/src/components/{sidebar → organisms/sidebar}/sidebar.doc.mdx +2 -2
- package/src/components/{sidebar → organisms/sidebar}/sidebar.stories.tsx +1 -2
- package/src/components/{sidebar → organisms/sidebar}/sidebar.tsx +45 -43
- package/src/components/{toast → organisms/toast}/toast.doc.mdx +2 -2
- package/src/components/{toast → organisms/toast}/toast.stories.tsx +2 -3
- package/src/components/{toast → organisms/toast}/toast.tsx +1 -2
- package/src/components/{topbar → organisms/topbar}/topbar.doc.mdx +2 -2
- package/src/components/{topbar → organisms/topbar}/topbar.stories.tsx +1 -2
- package/src/components/{topbar → organisms/topbar}/topbar.tsx +25 -25
- package/src/components/{triple-filter → organisms/triple-filter}/tripleFilter.doc.mdx +2 -2
- package/src/components/{triple-filter → organisms/triple-filter}/tripleFilter.props.ts +0 -1
- package/src/components/{triple-filter → organisms/triple-filter}/tripleFilter.stories.tsx +0 -1
- package/src/components/{triple-filter → organisms/triple-filter}/tripleFilter.tsx +1 -1
- package/src/components/{layout → templates/layout}/layout.doc.mdx +2 -2
- package/src/components/{layout → templates/layout}/layout.props.ts +2 -2
- package/src/components/{layout → templates/layout}/layout.stories.tsx +1 -2
- package/src/components/{layout → templates/layout}/layout.tsx +2 -2
- package/src/components/{page → templates/page}/page.doc.mdx +2 -2
- package/src/components/{page → templates/page}/page.props.ts +1 -1
- package/src/components/{page → templates/page}/page.stories.tsx +6 -7
- package/src/components/{page → templates/page}/page.tsx +6 -6
- package/src/components/theme-provider/themePresets.ts +154 -0
- package/src/components/theme-provider/themeProvider.doc.mdx +10 -2
- package/src/components/theme-provider/themeProvider.props.ts +6 -0
- package/src/components/theme-provider/themeProvider.stories.tsx +3 -4
- package/src/components/theme-provider/themeProvider.tsx +210 -268
- package/src/hooks/useEditableRow.ts +1 -1
- package/src/index.css +36 -86
- package/src/index.ts +97 -97
- package/src/showcases/DataShowcases.tsx +4 -8
- package/src/showcases/FeedbackShowcases.tsx +6 -6
- package/src/showcases/FormShowcases.tsx +7 -7
- package/src/showcases/GettingStartedShowcase.tsx +8 -9
- package/src/showcases/HomeShowcase.tsx +12 -12
- package/src/showcases/LayoutPrimitivesShowcases.tsx +36 -57
- package/src/showcases/PageShowcases.tsx +41 -53
- package/src/showcases/ShowcaseLayout.tsx +1 -2
- package/src/showcases/SizesShowcase.tsx +85 -0
- package/src/showcases/StructureShowcases.tsx +31 -33
- package/src/theme/theme-context.ts +37 -0
- package/src/theme/theme.ts +71 -64
- package/src/theme/theme.types.ts +41 -0
- package/src/types/badget.types.ts +3 -3
- package/src/types/button.types.ts +3 -3
- package/src/types/sizes.types.ts +2 -1
- package/src/utils/styles.ts +37 -0
- package/src/components/calendar/index.ts +0 -3
- package/src/components/stepper/stepper.css +0 -26
- package/src/components/toast/toast.css +0 -32
- package/src/types/input.types.ts +0 -14
- /package/src/components/{avatar → atoms/avatar}/avatar.props.ts +0 -0
- /package/src/components/{checkbox → atoms/checkbox}/checkbox.props.ts +0 -0
- /package/src/components/{divider → atoms/divider}/divider.props.ts +0 -0
- /package/src/components/{divider → atoms/divider}/divider.tsx +0 -0
- /package/src/components/{flex → atoms/flex}/flex.props.ts +0 -0
- /package/src/components/{flex → atoms/flex}/flex.tsx +0 -0
- /package/src/components/{grid → atoms/grid}/grid.props.ts +0 -0
- /package/src/components/{grid → atoms/grid}/grid.tsx +0 -0
- /package/src/components/{image → atoms/image}/image.props.ts +0 -0
- /package/src/components/{image → atoms/image}/image.tsx +0 -0
- /package/src/components/{loader → atoms/loader}/loader.props.ts +0 -0
- /package/src/components/{popover → atoms/popover}/popover.props.ts +0 -0
- /package/src/components/{popover → atoms/popover}/popover.tsx +0 -0
- /package/src/components/{progress → atoms/progress}/progress.props.ts +0 -0
- /package/src/components/{progress → atoms/progress}/progress.tsx +0 -0
- /package/src/components/{radio → atoms/radio}/radio.props.ts +0 -0
- /package/src/components/{segmented-control → atoms/segmented-control}/segmented-control.props.ts +0 -0
- /package/src/components/{skeleton → atoms/skeleton}/skeleton.props.ts +0 -0
- /package/src/components/{skeleton → atoms/skeleton}/skeleton.tsx +0 -0
- /package/src/components/{slide → atoms/slide}/slide.props.ts +0 -0
- /package/src/components/{slide → atoms/slide}/slide.tsx +0 -0
- /package/src/components/{slider → atoms/slider}/slider.props.ts +0 -0
- /package/src/components/{stack → atoms/stack}/stack.props.ts +0 -0
- /package/src/components/{stack → atoms/stack}/stack.tsx +0 -0
- /package/src/components/{text → atoms/text}/text.props.ts +0 -0
- /package/src/components/{text → atoms/text}/text.tsx +0 -0
- /package/src/components/{tooltip → atoms/tooltip}/tooltip.props.ts +0 -0
- /package/src/components/{alert → molecules/alert}/alert.props.ts +0 -0
- /package/src/components/{breadcrumbs → molecules/breadcrumbs}/breadcrumbs.props.ts +0 -0
- /package/src/components/{calendar → molecules/calendar}/calendar.props.ts +0 -0
- /package/src/components/{card → molecules/card}/card.props.ts +0 -0
- /package/src/components/{empty-state → molecules/empty-state}/empty-state.props.ts +0 -0
- /package/src/components/{form-header → molecules/form-header}/form-header.props.ts +0 -0
- /package/src/components/{pagination → molecules/pagination}/pagination.props.ts +0 -0
- /package/src/components/{select → molecules/select}/select.props.ts +0 -0
- /package/src/components/{stat-card → molecules/stat-card}/stat-card.props.ts +0 -0
- /package/src/components/{stepper → molecules/stepper}/stepper.props.ts +0 -0
- /package/src/components/{table → molecules/table}/table.props.ts +0 -0
- /package/src/components/{tabs → molecules/tabs}/tabs.props.ts +0 -0
- /package/src/components/{confirm-dialog → organisms/confirm-dialog}/confirm-dialog.props.ts +0 -0
- /package/src/components/{dialog → organisms/dialog}/dialog.props.ts +0 -0
- /package/src/components/{drawer → organisms/drawer}/drawer.props.ts +0 -0
- /package/src/components/{form-builder → organisms/form-builder}/formBuilder.props.ts +0 -0
- /package/src/components/{navbar → organisms/navbar}/navbar.props.ts +0 -0
- /package/src/components/{searchTable → organisms/searchTable}/components/TableHeader.tsx +0 -0
- /package/src/components/{searchTable → organisms/searchTable}/components/TableRow.tsx +0 -0
- /package/src/components/{searchTable → organisms/searchTable}/searchTable.props.ts +0 -0
- /package/src/components/{sidebar → organisms/sidebar}/sidebar.props.ts +0 -0
- /package/src/components/{toast → organisms/toast}/toast.props.ts +0 -0
- /package/src/components/{topbar → organisms/topbar}/topbar.props.ts +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as ITSearchSelect } from "./search-select";
|
|
2
|
-
export * from "./search-select.props";
|
|
2
|
+
export * from "./search-select.props";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as
|
|
2
|
+
import * as StoriesData from './search-select.stories';
|
|
3
3
|
|
|
4
|
-
<Meta of={
|
|
4
|
+
<Meta of={StoriesData} />
|
|
5
5
|
|
|
6
6
|
# ITSearchSelect
|
|
7
7
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FocusEvent } from "react";
|
|
2
|
+
import { SizesTypes } from "@/types/sizes.types";
|
|
2
3
|
|
|
3
4
|
/** Represents an option in the search-select dropdown. */
|
|
4
5
|
export interface ITSearchSelectOption {
|
|
@@ -42,6 +43,8 @@ export interface ITSearchSelectProps {
|
|
|
42
43
|
error?: string | boolean;
|
|
43
44
|
/** Whether the field is read-only. */
|
|
44
45
|
readOnly?: boolean;
|
|
46
|
+
/** Size preset: "sm" | "md" | "lg". @default "md" */
|
|
47
|
+
size?: SizesTypes;
|
|
45
48
|
/** Callback for server-side search (Mode 2: API connection). Receives the search query string. */
|
|
46
49
|
onSearch?: (query: string) => void;
|
|
47
50
|
/** Whether options are being loaded from an external API. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import ITSearchSelect from "
|
|
2
|
+
import ITSearchSelect from "@/components/molecules/search-select/search-select";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { ITSearchSelectOption } from "./search-select.props";
|
|
5
5
|
|
|
@@ -9,7 +9,6 @@ const meta: Meta<typeof ITSearchSelect> = {
|
|
|
9
9
|
parameters: {
|
|
10
10
|
layout: "centered",
|
|
11
11
|
},
|
|
12
|
-
tags: ["autodocs"],
|
|
13
12
|
argTypes: {
|
|
14
13
|
disabled: { control: "boolean" },
|
|
15
14
|
required: { control: "boolean" },
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, useMemo } from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import {
|
|
3
|
+
import { FaSearch } from "react-icons/fa";
|
|
4
4
|
import { ITSearchSelectProps, ITSearchSelectOption } from "./search-select.props";
|
|
5
|
-
import { theme } from "@/theme/theme";
|
|
6
|
-
import ITText from "@/components/text/text";
|
|
5
|
+
import { theme, inputSizeTokens } from "@/theme/theme";
|
|
6
|
+
import ITText from "@/components/atoms/text/text";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Searchable dropdown select with local client-side filtering and server-side search via API.
|
|
@@ -53,6 +53,7 @@ export default function ITSearchSelect({
|
|
|
53
53
|
onSearch,
|
|
54
54
|
isLoading = false,
|
|
55
55
|
noResultsMessage = "No se encontraron resultados",
|
|
56
|
+
size = "md",
|
|
56
57
|
}: ITSearchSelectProps) {
|
|
57
58
|
const [isOpen, setIsOpen] = useState(false);
|
|
58
59
|
const [searchTerm, setSearchTerm] = useState("");
|
|
@@ -146,16 +147,17 @@ export default function ITSearchSelect({
|
|
|
146
147
|
const errorMessage = typeof effectiveError === "string" ? effectiveError : "Este campo es requerido";
|
|
147
148
|
|
|
148
149
|
const getInputStyle = () => {
|
|
150
|
+
const sizeConfig = inputSizeTokens[size] ?? inputSizeTokens.md;
|
|
149
151
|
const style: React.CSSProperties = {
|
|
150
152
|
backgroundColor: inputTheme.backgroundColor || "#ffffff",
|
|
151
153
|
borderColor: inputTheme.borderColor || "var(--color-secondary-300)",
|
|
152
154
|
borderRadius: inputTheme.borderRadius || "0.5rem",
|
|
153
|
-
padding:
|
|
154
|
-
fontSize:
|
|
155
|
+
padding: sizeConfig.padding,
|
|
156
|
+
fontSize: sizeConfig.fontSize,
|
|
155
157
|
borderWidth: '1px',
|
|
156
158
|
borderStyle: 'solid',
|
|
157
159
|
transition: 'all 0.2s',
|
|
158
|
-
color: 'var(--input-text-color, var(--color-secondary-900))',
|
|
160
|
+
color: 'var(--it-input-text-color, var(--color-secondary-900))',
|
|
159
161
|
width: '100%',
|
|
160
162
|
};
|
|
161
163
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import ITSelect from "
|
|
2
|
+
import ITSelect from "@/components/molecules/select/select";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof ITSelect> = {
|
|
@@ -8,7 +8,6 @@ const meta: Meta<typeof ITSelect> = {
|
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: "centered",
|
|
10
10
|
},
|
|
11
|
-
tags: ["autodocs"],
|
|
12
11
|
argTypes: {
|
|
13
12
|
disabled: { control: "boolean" },
|
|
14
13
|
required: { control: "boolean" },
|
|
@@ -3,8 +3,8 @@ import clsx from "clsx";
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { FaAngleDown } from "react-icons/fa";
|
|
5
5
|
import { ITSelectProps } from "./select.props";
|
|
6
|
-
import ITText from "@/components/text/text";
|
|
7
|
-
import { inputError, inputLabel } from "@/utils/styles";
|
|
6
|
+
import ITText from "@/components/atoms/text/text";
|
|
7
|
+
import { inputError, inputLabel, inputFieldStyle } from "@/utils/styles";
|
|
8
8
|
|
|
9
9
|
export default function ITSelect({
|
|
10
10
|
name,
|
|
@@ -22,6 +22,7 @@ export default function ITSelect({
|
|
|
22
22
|
required,
|
|
23
23
|
error,
|
|
24
24
|
readOnly = false,
|
|
25
|
+
size = "md",
|
|
25
26
|
}: ITSelectProps) {
|
|
26
27
|
const [isFocused, setIsFocused] = useState(false);
|
|
27
28
|
const [localTouched, setLocalTouched] = useState(false);
|
|
@@ -40,19 +41,10 @@ export default function ITSelect({
|
|
|
40
41
|
const errorMessage = typeof effectiveError === "string" ? effectiveError : "Este campo es requerido";
|
|
41
42
|
|
|
42
43
|
const getStyle = () => {
|
|
43
|
-
const style
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
padding: inputTheme.padding,
|
|
48
|
-
fontSize: inputTheme.fontSize,
|
|
49
|
-
borderWidth: '1px',
|
|
50
|
-
borderStyle: 'solid',
|
|
51
|
-
transition: 'all 0.2s',
|
|
52
|
-
color: 'var(--input-text-color, var(--color-secondary-900))',
|
|
53
|
-
appearance: 'none',
|
|
54
|
-
colorScheme: 'light dark',
|
|
55
|
-
};
|
|
44
|
+
const style = inputFieldStyle(inputTheme, size, {
|
|
45
|
+
appearance: "none",
|
|
46
|
+
colorScheme: "light dark",
|
|
47
|
+
});
|
|
56
48
|
|
|
57
49
|
if (disabled) {
|
|
58
50
|
style.backgroundColor = inputTheme.disabled?.backgroundColor || style.backgroundColor;
|
|
@@ -97,7 +89,7 @@ export default function ITSelect({
|
|
|
97
89
|
onBlur={(e) => {
|
|
98
90
|
setIsFocused(false);
|
|
99
91
|
setLocalTouched(true);
|
|
100
|
-
readOnly
|
|
92
|
+
if (!readOnly) onBlur?.(e);
|
|
101
93
|
}}
|
|
102
94
|
onFocus={() => setIsFocused(true)}
|
|
103
95
|
disabled={disabled}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as
|
|
2
|
+
import * as StoriesData from './stat-card.stories';
|
|
3
3
|
|
|
4
|
-
<Meta of={
|
|
4
|
+
<Meta of={StoriesData} />
|
|
5
5
|
|
|
6
6
|
# ITStatCard
|
|
7
7
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import ITStatCard from "
|
|
3
|
-
import { FaArrowUp
|
|
2
|
+
import ITStatCard from "@/components/molecules/stat-card/stat-card";
|
|
3
|
+
import { FaArrowUp } from "react-icons/fa";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof ITStatCard> = {
|
|
6
6
|
title: "Components/Data Display/ITStatCard",
|
|
7
7
|
component: ITStatCard,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
export default meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
2
|
import { ITStatCardProps } from "./stat-card.props";
|
|
3
|
-
import ITText from "@/components/text/text";
|
|
3
|
+
import ITText from "@/components/atoms/text/text";
|
|
4
4
|
|
|
5
5
|
const trendColors = {
|
|
6
6
|
up: "text-emerald-600 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950/30",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import ITStepper from "
|
|
2
|
+
import ITStepper from "@/components/molecules/stepper/stepper";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { FaUser, FaIdCard, FaCheckCircle } from "react-icons/fa";
|
|
5
5
|
|
|
@@ -9,7 +9,6 @@ const meta: Meta<typeof ITStepper> = {
|
|
|
9
9
|
parameters: {
|
|
10
10
|
layout: "padded", // Gives the stepper breathing room
|
|
11
11
|
},
|
|
12
|
-
tags: ["autodocs"],
|
|
13
12
|
argTypes: {
|
|
14
13
|
color: {
|
|
15
14
|
control: "select",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
2
|
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
-
import { ITStepperProps
|
|
3
|
+
import { ITStepperProps } from "./stepper.props";
|
|
4
4
|
import { theme } from "@/theme/theme";
|
|
5
|
-
import ITButton from "
|
|
5
|
+
import ITButton from "@/components/atoms/button/button";
|
|
6
6
|
import { FaChevronLeft, FaChevronRight, FaCheck } from "react-icons/fa";
|
|
7
|
-
import ITText from "@/components/text/text";
|
|
7
|
+
import ITText from "@/components/atoms/text/text";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A step-by-step wizard / progress indicator with animated content transitions,
|
|
@@ -61,14 +61,14 @@ export default function ITStepper({
|
|
|
61
61
|
|
|
62
62
|
if (contentRef.current) {
|
|
63
63
|
contentRef.current.classList.remove(
|
|
64
|
-
"
|
|
65
|
-
"
|
|
64
|
+
"it-stepper-slide-in-left",
|
|
65
|
+
"it-stepper-slide-in-right"
|
|
66
66
|
);
|
|
67
67
|
requestAnimationFrame(() => {
|
|
68
68
|
contentRef.current?.classList.add(
|
|
69
69
|
direction === "next"
|
|
70
|
-
? "
|
|
71
|
-
: "
|
|
70
|
+
? "it-stepper-slide-in-right"
|
|
71
|
+
: "it-stepper-slide-in-left"
|
|
72
72
|
);
|
|
73
73
|
});
|
|
74
74
|
}
|
|
@@ -104,8 +104,7 @@ export default function ITStepper({
|
|
|
104
104
|
|
|
105
105
|
const renderStepContent = (
|
|
106
106
|
index: number,
|
|
107
|
-
isCompleted: boolean
|
|
108
|
-
isActive: boolean
|
|
107
|
+
isCompleted: boolean
|
|
109
108
|
) => {
|
|
110
109
|
const step = steps[index];
|
|
111
110
|
|
|
@@ -165,7 +164,7 @@ export default function ITStepper({
|
|
|
165
164
|
)}
|
|
166
165
|
style={isActive ? { backgroundColor: resolvedColor, borderColor: resolvedColor } : undefined}
|
|
167
166
|
>
|
|
168
|
-
{renderStepContent(idx, isCompleted
|
|
167
|
+
{renderStepContent(idx, isCompleted)}
|
|
169
168
|
</div>
|
|
170
169
|
|
|
171
170
|
<ITText
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import ITTable from "
|
|
2
|
+
import ITTable from "@/components/molecules/table/table";
|
|
3
3
|
import { Column } from "./table.props";
|
|
4
|
-
import ITBadget from "
|
|
5
|
-
import ITButton from "
|
|
6
|
-
import {
|
|
4
|
+
import ITBadget from "@/components/atoms/badget/badget";
|
|
5
|
+
import ITButton from "@/components/atoms/button/button";
|
|
6
|
+
import { FaTrash } from "react-icons/fa";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
|
|
9
9
|
const meta: Meta<typeof ITTable> = {
|
|
@@ -12,7 +12,6 @@ const meta: Meta<typeof ITTable> = {
|
|
|
12
12
|
parameters: {
|
|
13
13
|
layout: "padded", // Tables need more space
|
|
14
14
|
},
|
|
15
|
-
tags: ["autodocs"],
|
|
16
15
|
argTypes: {
|
|
17
16
|
variant: {
|
|
18
17
|
control: "select",
|
|
@@ -100,22 +99,6 @@ const advancedColumns: Column<User>[] = [
|
|
|
100
99
|
},
|
|
101
100
|
];
|
|
102
101
|
|
|
103
|
-
const actionsColumn: Column<User> = {
|
|
104
|
-
key: "actions",
|
|
105
|
-
label: "Actions",
|
|
106
|
-
type: "actions",
|
|
107
|
-
actions: (row) => (
|
|
108
|
-
<>
|
|
109
|
-
<ITButton size="small" variant="text" color="info" ariaLabel="Edit" onClick={() => alert(`Edit ${row.name}`)}>
|
|
110
|
-
<FaEdit />
|
|
111
|
-
</ITButton>
|
|
112
|
-
<ITButton size="small" variant="text" color="danger" ariaLabel="Delete" onClick={() => alert(`Delete ${row.name}`)}>
|
|
113
|
-
<FaTrash />
|
|
114
|
-
</ITButton>
|
|
115
|
-
</>
|
|
116
|
-
),
|
|
117
|
-
};
|
|
118
|
-
|
|
119
102
|
|
|
120
103
|
// --- STORIES ---
|
|
121
104
|
|
|
@@ -163,7 +146,7 @@ const ActionsTableWrapper = (args: any) => {
|
|
|
163
146
|
type: "actions",
|
|
164
147
|
actions: (row) => (
|
|
165
148
|
<>
|
|
166
|
-
<ITButton size="
|
|
149
|
+
<ITButton size="sm" variant="text" color="danger" ariaLabel="Delete" onClick={() => setData(d => d.filter(item => item.id !== row.id))}>
|
|
167
150
|
<FaTrash />
|
|
168
151
|
</ITButton>
|
|
169
152
|
</>
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
FaThLarge
|
|
11
11
|
} from "react-icons/fa";
|
|
12
12
|
import { MdOutlineSwapVert } from "react-icons/md";
|
|
13
|
-
import ITInput from "
|
|
14
|
-
import ITPagination from "
|
|
15
|
-
import ITSelect from "
|
|
13
|
+
import ITInput from "@/components/atoms/input/input";
|
|
14
|
+
import ITPagination from "@/components/molecules/pagination/pagination";
|
|
15
|
+
import ITSelect from "@/components/molecules/select/select";
|
|
16
16
|
import { Column, ITTableProps } from "./table.props";
|
|
17
|
-
import ITText from "@/components/text/text";
|
|
17
|
+
import ITText from "@/components/atoms/text/text";
|
|
18
18
|
import {
|
|
19
19
|
tableActionsCell,
|
|
20
20
|
tableBody,
|
|
@@ -26,16 +26,7 @@ import {
|
|
|
26
26
|
tableHeaderRow,
|
|
27
27
|
tableRow,
|
|
28
28
|
} from "@/utils/styles";
|
|
29
|
-
|
|
30
|
-
const getNestedValue = (obj: unknown, path: string) => {
|
|
31
|
-
return path.split(".").reduce((acc, part) => acc && acc[part], obj);
|
|
32
|
-
};
|
|
33
|
-
export const formatCurrencyMX = (value: number) => {
|
|
34
|
-
return value.toLocaleString("es-MX", {
|
|
35
|
-
style: "currency",
|
|
36
|
-
currency: "MXN",
|
|
37
|
-
});
|
|
38
|
-
};
|
|
29
|
+
import { formatCurrencyMX, getNestedValue } from "@/utils/table.utils";
|
|
39
30
|
|
|
40
31
|
/**
|
|
41
32
|
* A feature-rich data table with per-column filtering, sortable columns,
|
|
@@ -57,7 +48,6 @@ export default function ITTable<T extends Record<string, unknown>>({
|
|
|
57
48
|
columns,
|
|
58
49
|
data = [],
|
|
59
50
|
containerClassName,
|
|
60
|
-
className,
|
|
61
51
|
variant = "default",
|
|
62
52
|
size = "md",
|
|
63
53
|
itemsPerPageOptions = [5, 10, 20],
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import ITTabs from '
|
|
2
|
+
import ITTabs from '@/components/molecules/tabs/tabs';
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof ITTabs> = {
|
|
5
5
|
title: 'Components/ITTabs',
|
|
6
6
|
component: ITTabs,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
7
|
};
|
|
9
8
|
|
|
10
9
|
export default meta;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { ITTabsProps } from './tabs.props';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
|
-
import ITText from "@/components/text/text";
|
|
4
|
+
import ITText from "@/components/atoms/text/text";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Tabbed navigation component with "line" and "pill" visual variants.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as
|
|
2
|
+
import * as StoriesData from './timePicker.stories';
|
|
3
3
|
|
|
4
|
-
<Meta of={
|
|
4
|
+
<Meta of={StoriesData} />
|
|
5
5
|
|
|
6
6
|
# ITTimePicker
|
|
7
7
|
|
|
@@ -22,7 +22,7 @@ Time selection input with a dual-column dropdown (hours / minutes). Supports man
|
|
|
22
22
|
| `error` | `string \| boolean` | — | Validation error message or boolean to show error state. |
|
|
23
23
|
| `disabled` | `boolean` | `false` | Disables the time picker when true. |
|
|
24
24
|
| `className` | `string` | — | Additional CSS classes for the wrapper. |
|
|
25
|
-
| `size` | `
|
|
25
|
+
| `size` | `SizesTypes` | `"md"` | Size preset: `"sm"`, `"md"`, `"lg"`. |
|
|
26
26
|
| `variant` | `"primary" \| "secondary" \| "danger" \| "success" \| "warning" \| "info" \| "purple"` | `"primary"` | Style variant for the input. |
|
|
27
27
|
| `color` | `"primary" \| "secondary" \| "danger" \| "success" \| "warning" \| "info" \| "purple" \| string` | `"primary"` | Theme color used for the dropdown highlight and confirm button. Accepts semantic keys or raw hex. |
|
|
28
28
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { SizesTypes } from "@/types/sizes.types";
|
|
2
|
+
|
|
1
3
|
export interface ITTimePickerProps {
|
|
2
4
|
/** Form field name attribute and key for the change event. */
|
|
3
5
|
name: string;
|
|
@@ -21,8 +23,8 @@ export interface ITTimePickerProps {
|
|
|
21
23
|
disabled?: boolean;
|
|
22
24
|
/** Additional CSS classes for the wrapper. */
|
|
23
25
|
className?: string;
|
|
24
|
-
/** Size preset: "
|
|
25
|
-
size?:
|
|
26
|
+
/** Size preset: "sm" | "md" | "lg". @default "md" */
|
|
27
|
+
size?: SizesTypes;
|
|
26
28
|
/** Style variant for the input: "primary" | "secondary" | "danger" | "success" | "warning" | "info" | "purple". */
|
|
27
29
|
variant?: "primary" | "secondary" | "danger" | "success" | "warning" | "info" | "purple";
|
|
28
30
|
/** Theme color used for the dropdown highlight and confirm button. Accepts semantic keys or raw hex. */
|
|
@@ -8,7 +8,6 @@ const meta: Meta<typeof ITTimePicker> = {
|
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: "centered",
|
|
10
10
|
},
|
|
11
|
-
tags: ["autodocs"],
|
|
12
11
|
argTypes: {
|
|
13
12
|
color: {
|
|
14
13
|
control: "select",
|
|
@@ -110,9 +109,9 @@ export const Validation: Story = {
|
|
|
110
109
|
export const Sizes: Story = {
|
|
111
110
|
render: (args) => (
|
|
112
111
|
<div className="flex flex-col gap-6">
|
|
113
|
-
<TimePickerWrapper {...args} size="
|
|
114
|
-
<TimePickerWrapper {...args} size="
|
|
115
|
-
<TimePickerWrapper {...args} size="
|
|
112
|
+
<TimePickerWrapper {...args} size="sm" label="Small TimePicker" name="sm" />
|
|
113
|
+
<TimePickerWrapper {...args} size="md" label="Medium TimePicker" name="md" />
|
|
114
|
+
<TimePickerWrapper {...args} size="lg" label="Large TimePicker" name="lg" />
|
|
116
115
|
</div>
|
|
117
116
|
),
|
|
118
117
|
args: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
2
|
import React, { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { FaClock } from "react-icons/fa";
|
|
4
|
-
import ITInput from "
|
|
5
|
-
import ITButton from "
|
|
4
|
+
import ITInput from "@/components/atoms/input/input";
|
|
5
|
+
import ITButton from "@/components/atoms/button/button";
|
|
6
6
|
import useClickOutside from "@/hooks/useClickOutside";
|
|
7
7
|
import { theme } from "@/theme/theme";
|
|
8
8
|
import { ITTimePickerProps } from "./timePicker.props";
|
|
9
|
-
import ITText from "@/components/text/text";
|
|
9
|
+
import ITText from "@/components/atoms/text/text";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Time selection input with a dual-column dropdown (hours / minutes).
|
|
@@ -41,7 +41,7 @@ export default function ITTimePicker({
|
|
|
41
41
|
error,
|
|
42
42
|
disabled,
|
|
43
43
|
className,
|
|
44
|
-
size = "
|
|
44
|
+
size = "md",
|
|
45
45
|
variant = "primary",
|
|
46
46
|
color = "primary",
|
|
47
47
|
}: ITTimePickerProps) {
|
|
@@ -325,7 +325,7 @@ export default function ITTimePicker({
|
|
|
325
325
|
<ITButton
|
|
326
326
|
variant="solid"
|
|
327
327
|
color={color as any}
|
|
328
|
-
size="
|
|
328
|
+
size="sm"
|
|
329
329
|
onClick={handleConfirm}
|
|
330
330
|
>
|
|
331
331
|
<ITText as="span">Aceptar</ITText>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as
|
|
2
|
+
import * as StoriesData from './confirm-dialog.stories';
|
|
3
3
|
|
|
4
|
-
<Meta of={
|
|
4
|
+
<Meta of={StoriesData} />
|
|
5
5
|
|
|
6
6
|
# ITConfirmDialog
|
|
7
7
|
|
package/src/components/{confirm-dialog → organisms/confirm-dialog}/confirm-dialog.stories.tsx
RENAMED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import ITConfirmDialog from "
|
|
4
|
-
import ITButton from "
|
|
3
|
+
import ITConfirmDialog from "@/components/organisms/confirm-dialog/confirm-dialog";
|
|
4
|
+
import ITButton from "@/components/atoms/button/button";
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof ITConfirmDialog> = {
|
|
7
7
|
title: "Components/Overlay/ITConfirmDialog",
|
|
8
8
|
component: ITConfirmDialog,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
9
|
};
|
|
11
10
|
|
|
12
11
|
export default meta;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
2
|
import { ITConfirmDialogProps } from "./confirm-dialog.props";
|
|
3
|
-
import ITButton from "
|
|
3
|
+
import ITButton from "@/components/atoms/button/button";
|
|
4
4
|
import { FaExclamationTriangle } from "react-icons/fa";
|
|
5
|
-
import ITText from "@/components/text/text";
|
|
5
|
+
import ITText from "@/components/atoms/text/text";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Confirmation modal dialog for destructive or critical actions.
|
|
@@ -55,8 +55,8 @@ export default function ITConfirmDialog({
|
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
57
57
|
<div className="flex justify-end gap-3 mt-6">
|
|
58
|
-
<ITButton label={cancelLabel} variant="outlined" size="
|
|
59
|
-
<ITButton label={confirmLabel} color={variant} size="
|
|
58
|
+
<ITButton label={cancelLabel} variant="outlined" size="sm" onClick={onClose} disabled={loading} />
|
|
59
|
+
<ITButton label={confirmLabel} color={variant} size="sm" onClick={onConfirm} disabled={loading} />
|
|
60
60
|
</div>
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as
|
|
2
|
+
import * as StoriesData from './ITDataTable.stories';
|
|
3
3
|
|
|
4
|
-
<Meta of={
|
|
4
|
+
<Meta of={StoriesData} />
|
|
5
5
|
|
|
6
6
|
# ITDataTable
|
|
7
7
|
|
|
@@ -2,14 +2,13 @@ import React, { useState, useCallback, useMemo } from 'react';
|
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import ITDataTable from './dataTable';
|
|
4
4
|
import { ITDataTableFetchParams, ITDataTableResponse } from './dataTable.props';
|
|
5
|
-
import ITCard from '
|
|
6
|
-
import ITBadget from '
|
|
7
|
-
import ITDatePicker from '
|
|
5
|
+
import ITCard from '@/components/molecules/card/card';
|
|
6
|
+
import ITBadget from '@/components/atoms/badget/badget';
|
|
7
|
+
import ITDatePicker from '@/components/molecules/date-picker/datePicker';
|
|
8
8
|
|
|
9
9
|
const meta: Meta<typeof ITDataTable> = {
|
|
10
10
|
title: 'Data Display/ITDataTable',
|
|
11
11
|
component: ITDataTable,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
12
|
decorators: [
|
|
14
13
|
(Story) => (
|
|
15
14
|
<div className="p-8 bg-gray-50 min-h-screen">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import { Column } from "
|
|
2
|
+
import { Column } from "@/components/molecules/table/table.props";
|
|
3
3
|
|
|
4
4
|
/** Parameters passed to `fetchData` every time pagination, filters, or sorting change. */
|
|
5
5
|
export interface ITDataTableFetchParams {
|
|
@@ -4,13 +4,13 @@ import clsx from "clsx";
|
|
|
4
4
|
import React, { useState, useEffect, useCallback, useRef } from "react";
|
|
5
5
|
import { FaCheck, FaSpinner, FaTimes, FaTable, FaThLarge } from "react-icons/fa";
|
|
6
6
|
import { MdOutlineSwapVert } from "react-icons/md";
|
|
7
|
-
import ITInput from "
|
|
8
|
-
import ITPagination from "
|
|
9
|
-
import ITSelect from "
|
|
10
|
-
import { Column } from "
|
|
11
|
-
import { formatCurrencyMX } from "
|
|
7
|
+
import ITInput from "@/components/atoms/input/input";
|
|
8
|
+
import ITPagination from "@/components/molecules/pagination/pagination";
|
|
9
|
+
import ITSelect from "@/components/molecules/select/select";
|
|
10
|
+
import { Column } from "@/components/molecules/table/table.props";
|
|
11
|
+
import { formatCurrencyMX } from "@/utils/table.utils";
|
|
12
12
|
import { ITDataTableProps } from "./dataTable.props";
|
|
13
|
-
import ITText from "@/components/text/text";
|
|
13
|
+
import ITText from "@/components/atoms/text/text";
|
|
14
14
|
import {
|
|
15
15
|
tableActionsCell,
|
|
16
16
|
tableBody,
|
|
@@ -80,7 +80,6 @@ export default function ITDataTable<T extends Record<string, unknown>>({
|
|
|
80
80
|
itemsPerPage,
|
|
81
81
|
filters,
|
|
82
82
|
sortConfig,
|
|
83
|
-
totalPages,
|
|
84
83
|
goToPage,
|
|
85
84
|
handleFilterChange,
|
|
86
85
|
handleSort,
|
|
@@ -123,7 +122,7 @@ export default function ITDataTable<T extends Record<string, unknown>>({
|
|
|
123
122
|
return () => {
|
|
124
123
|
if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current);
|
|
125
124
|
};
|
|
126
|
-
}, [currentPage, itemsPerPage, sortConfig, filters, externalFilters, reloadTrigger, fetchOnMount, performFetch]);
|
|
125
|
+
}, [currentPage, itemsPerPage, sortConfig, filters, externalFilters, reloadTrigger, fetchOnMount, performFetch, data.length, isLoading, debounceMs]);
|
|
127
126
|
|
|
128
127
|
const renderFilterInput = (col: Column<T>) => {
|
|
129
128
|
if (!col.filter) return null;
|