@vkzstudio/muza-ui 1.0.11 → 1.0.13
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/components/Accordion/Accordion.d.ts +57 -4
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +1 -4
- package/dist/components/Accordion/Accordion.stories.d.ts.map +1 -1
- package/dist/components/Alert/Alert.d.ts +13 -2
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +4 -4
- package/dist/components/Alert/Alert.stories.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +12 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +23 -8
- package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +3 -12
- package/dist/components/Button/Button.d.ts +30 -0
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +39 -3
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +1 -1
- package/dist/components/Calendar/utils/formatDate.d.ts +4 -0
- package/dist/components/Calendar/utils/formatDate.d.ts.map +1 -1
- package/dist/components/Calendar/utils/formatDateRange.d.ts +5 -0
- package/dist/components/Calendar/utils/formatDateRange.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +25 -3
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/Chip/Chip.d.ts +3 -6
- package/dist/components/Chip/Chip.d.ts.map +1 -1
- package/dist/components/Chip/Chip.js +6 -6
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +40 -1
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +1 -1
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -1
- package/dist/components/DataTable/index.d.ts +1 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +59 -4
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +7 -7
- package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/utils/getDateRange.d.ts +9 -0
- package/dist/components/DatePicker/utils/getDateRange.d.ts.map +1 -1
- package/dist/components/DatePicker/utils/getDateRange.js +28 -15
- package/dist/components/Dialog/Dialog.d.ts +39 -2
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +176 -60
- package/dist/components/Dialog/Dialog.stories.d.ts +2 -0
- package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +73 -11
- package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +2 -8
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +10 -26
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.d.ts +18 -0
- package/dist/components/EdgeButton/EdgeButton.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.js +4 -4
- package/dist/components/EdgeButton/EdgeButton.stories.d.ts.map +1 -1
- package/dist/components/EdgeButton/index.d.ts +1 -1
- package/dist/components/EdgeButton/index.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +10 -0
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.js +6 -6
- package/dist/components/EmptyState/EmptyState.stories.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.d.ts +54 -0
- package/dist/components/ExpandableTable/ExpandableTable.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.js +2 -2
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts +0 -3
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts.map +1 -1
- package/dist/components/ExpandableTable/Table.js +1 -1
- package/dist/components/ExpandableTable/index.d.ts +1 -1
- package/dist/components/ExpandableTable/index.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.js +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +51 -0
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
- package/dist/components/FileUpload/index.d.ts +1 -1
- package/dist/components/FileUpload/index.d.ts.map +1 -1
- package/dist/components/Flex/Flex.d.ts +49 -1
- package/dist/components/Flex/Flex.d.ts.map +1 -1
- package/dist/components/Flex/Flex.stories.d.ts.map +1 -1
- package/dist/components/Flex/index.d.ts +1 -1
- package/dist/components/Flex/index.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.d.ts +166 -1
- package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.js +110 -97
- package/dist/components/InfoCard/InfoCard.d.ts +17 -0
- package/dist/components/InfoCard/InfoCard.d.ts.map +1 -0
- package/dist/components/InfoCard/index.d.ts +2 -0
- package/dist/components/InfoCard/index.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +26 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts +16 -0
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts.map +1 -1
- package/dist/components/Lightbox/Lightbox.d.ts +15 -2
- package/dist/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/components/Lightbox/Lightbox.js +22 -20
- package/dist/components/Loader/Loader.d.ts +3 -0
- package/dist/components/Loader/Loader.d.ts.map +1 -1
- package/dist/components/Loader/Loader.stories.d.ts.map +1 -1
- package/dist/components/LoginScreen/LoginScreen.d.ts +18 -0
- package/dist/components/LoginScreen/LoginScreen.d.ts.map +1 -1
- package/dist/components/LoginScreen/LoginScreen.stories.d.ts.map +1 -1
- package/dist/components/LoginScreen/LoginScreenItem.d.ts +5 -0
- package/dist/components/LoginScreen/LoginScreenItem.d.ts.map +1 -1
- package/dist/components/LoginScreen/index.d.ts +2 -2
- package/dist/components/LoginScreen/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +25 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +8 -8
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts.map +1 -1
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts +26 -1
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +5 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.stories.d.ts.map +1 -1
- package/dist/components/PinIndicator/PinIndicator.d.ts +15 -0
- package/dist/components/PinIndicator/PinIndicator.d.ts.map +1 -1
- package/dist/components/PinIndicator/PinIndicator.stories.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +36 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +28 -3
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js +2 -5
- package/dist/components/Radio/Radio.stories.d.ts.map +1 -1
- package/dist/components/Reorderable/Reorderable.d.ts +79 -30
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -1
- package/dist/components/Reorderable/Reorderable.js +162 -143
- package/dist/components/Reorderable/Reorderable.stories.d.ts +1 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -1
- package/dist/components/Reorderable/index.d.ts +1 -1
- package/dist/components/Reorderable/index.d.ts.map +1 -1
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +47 -13
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -1
- package/dist/components/ReorderableTable/ReorderableTable.js +44 -43
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -1
- package/dist/components/ReorderableTable/index.d.ts +1 -1
- package/dist/components/ReorderableTable/index.d.ts.map +1 -1
- package/dist/components/Searchbar/Searchbar.d.ts +11 -0
- package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
- package/dist/components/Searchbar/Searchbar.stories.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +35 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.stories.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts +1 -1
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/SegmentedIconControl/SegmentedIconControl.d.ts +38 -1
- package/dist/components/SegmentedIconControl/SegmentedIconControl.d.ts.map +1 -1
- package/dist/components/SegmentedIconControl/SegmentedIconControl.stories.d.ts.map +1 -1
- package/dist/components/SegmentedIconControl/index.d.ts +1 -1
- package/dist/components/SegmentedIconControl/index.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +25 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +9 -6
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.stories.d.ts.map +1 -1
- package/dist/components/SliderIndicators/SliderIndicators.d.ts +9 -0
- package/dist/components/SliderIndicators/SliderIndicators.d.ts.map +1 -1
- package/dist/components/SliderIndicators/SliderIndicators.stories.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.d.ts +38 -0
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.js +5 -5
- package/dist/components/Stepper/Stepper.stories.d.ts.map +1 -1
- package/dist/components/Stepper/index.d.ts +1 -1
- package/dist/components/Stepper/index.d.ts.map +1 -1
- package/dist/components/SwipeButton/SwipeButton.d.ts +39 -0
- package/dist/components/SwipeButton/SwipeButton.d.ts.map +1 -1
- package/dist/components/SwipeButton/SwipeButton.js +1 -1
- package/dist/components/SwipeButton/SwipeButton.stories.d.ts +0 -43
- package/dist/components/SwipeButton/SwipeButton.stories.d.ts.map +1 -1
- package/dist/components/SwipeButton/index.d.ts +1 -1
- package/dist/components/SwipeButton/index.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts +19 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.stories.d.ts.map +1 -1
- package/dist/components/Tag/Tag.d.ts +17 -1
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/Tag/Tag.js +4 -4
- package/dist/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/components/TextEditor/EditorToolbar.js +1 -1
- package/dist/components/TextEditor/LinkBubbleMenu.d.ts +4 -1
- package/dist/components/TextEditor/LinkBubbleMenu.d.ts.map +1 -1
- package/dist/components/TextEditor/LinkBubbleMenu.js +116 -92
- package/dist/components/TextEditor/TextEditor.d.ts +5 -2
- package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.js +129 -121
- package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +9 -2
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts +23 -1
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.js +1 -4
- package/dist/components/TimePicker/TimePicker.stories.d.ts.map +1 -1
- package/dist/components/Toast/Toast.d.ts +21 -1
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +7 -7
- package/dist/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/components/Toast/ToastContainer.d.ts +12 -1
- package/dist/components/Toast/ToastContainer.d.ts.map +1 -1
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Toast/index.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts +17 -1
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.js +6 -6
- package/dist/components/Toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/Toggle/index.d.ts +1 -1
- package/dist/components/Toggle/index.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +52 -4
- package/dist/components/ToggleGroup/ToggleGroup.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/components/ToggleGroup/index.d.ts +1 -1
- package/dist/components/ToggleGroup/index.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +38 -3
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +5 -7
- package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/Typography/Typography.d.ts +18 -1
- package/dist/components/Typography/Typography.d.ts.map +1 -1
- package/dist/components/Typography/Typography.stories.d.ts.map +1 -1
- package/dist/components/Typography/index.d.ts +1 -1
- package/dist/components/Typography/index.d.ts.map +1 -1
- package/dist/index.js +191 -184
- package/dist/muza-ui.css +1 -1
- package/dist/styles/token-sizes.css +4 -0
- package/llms-full.md +581 -0
- package/llms.txt +36 -0
- package/package.json +4 -3
- package/CLAUDE_CONSUMER.md +0 -238
|
@@ -2,9 +2,9 @@ import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
import { cva as m } from "class-variance-authority";
|
|
4
4
|
import { EmptyCircle as f } from "../Icons/CustomIcons.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { cn as p } from "../../utils/cn.js";
|
|
6
|
+
import { CheckCircleBold as x } from "@solar-icons/react-perf";
|
|
7
|
+
import { Typography as b } from "../Typography/Typography.js";
|
|
8
8
|
const v = m(
|
|
9
9
|
[
|
|
10
10
|
"inline-flex items-center gap-xs rounded-full px-md py-sm",
|
|
@@ -69,13 +69,13 @@ const v = m(
|
|
|
69
69
|
"aria-disabled": e,
|
|
70
70
|
disabled: e,
|
|
71
71
|
"data-state": r ? "checked" : "unchecked",
|
|
72
|
-
className:
|
|
72
|
+
className: p(v({ checked: r, disabled: e, className: a })),
|
|
73
73
|
onClick: d,
|
|
74
74
|
...s,
|
|
75
75
|
children: [
|
|
76
|
-
r ? /* @__PURE__ */ t(
|
|
76
|
+
r ? /* @__PURE__ */ t(x, {}) : /* @__PURE__ */ t(f, {}),
|
|
77
77
|
/* @__PURE__ */ t(
|
|
78
|
-
|
|
78
|
+
b,
|
|
79
79
|
{
|
|
80
80
|
component: "span",
|
|
81
81
|
variant: "body",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"Chip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAqC3B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAiBrB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KA+BvB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAmDvB,CAAA"}
|
|
@@ -4,18 +4,57 @@ declare const dataTableCellVariants: (props?: ({
|
|
|
4
4
|
variant?: "default" | "white" | null | undefined;
|
|
5
5
|
position?: "first" | "last" | "middle" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Column definition for the DataTable component.
|
|
9
|
+
* @typeParam T - The type of data objects in each row
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const columns: DataTableColumn<User>[] = [
|
|
13
|
+
* { dataKey: 'name', title: 'Name' },
|
|
14
|
+
* { dataKey: 'bio', title: 'Bio', lineClamp: 2 },
|
|
15
|
+
* { dataKey: 'name', title: '', render: (value, row, i) => <Button onClick={() => edit(i)} /> },
|
|
16
|
+
* ]
|
|
17
|
+
*/
|
|
7
18
|
export interface DataTableColumn<T> {
|
|
19
|
+
/** Property key from the data object to display in this column. */
|
|
8
20
|
dataKey: keyof T;
|
|
21
|
+
/** Header label for the column. */
|
|
9
22
|
title: ReactNode;
|
|
23
|
+
/** Additional CSS class applied to both the header and body cells. */
|
|
10
24
|
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Truncates cell text to the specified number of lines.
|
|
27
|
+
* `true` or `1` clamps to one line, `2` clamps to two lines.
|
|
28
|
+
*/
|
|
11
29
|
lineClamp?: boolean | 1 | 2;
|
|
30
|
+
/**
|
|
31
|
+
* Custom render function for cell content. When omitted, the raw value
|
|
32
|
+
* is displayed inside a Typography component.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* render: (value, rowData, rowIndex, disabled) => (
|
|
36
|
+
* <Button disabled={disabled} onClick={() => edit(rowIndex)}>{value}</Button>
|
|
37
|
+
* )
|
|
38
|
+
*/
|
|
12
39
|
render?: (value: T[keyof T], rowData: T, rowIndex: number, disabled?: boolean) => ReactNode;
|
|
13
40
|
}
|
|
14
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Props for the DataTable component.
|
|
43
|
+
* Extends standard table attributes except `children` (content is driven by `data` and `columns`).
|
|
44
|
+
* @typeParam T - The type of data objects in each row
|
|
45
|
+
*/
|
|
46
|
+
export interface DataTableProps<T> extends Omit<React.HTMLAttributes<HTMLTableElement>, 'children'>, Omit<VariantProps<typeof dataTableCellVariants>, 'variant' | 'position'> {
|
|
47
|
+
/** Array of data objects to display as table rows. */
|
|
15
48
|
data: T[];
|
|
49
|
+
/** Column definitions describing headers and cell rendering. @see DataTableColumn */
|
|
16
50
|
columns: DataTableColumn<T>[];
|
|
51
|
+
/** Controls visibility of the table header row. @default true */
|
|
17
52
|
showHeader?: boolean;
|
|
53
|
+
/** Additional CSS class applied to the table element. */
|
|
18
54
|
className?: string;
|
|
55
|
+
/** Visual style variant for row background. @default 'default' */
|
|
56
|
+
variant?: 'default' | 'white';
|
|
57
|
+
/** Prevents interaction and applies muted text colors. @default false */
|
|
19
58
|
disabled?: boolean;
|
|
20
59
|
}
|
|
21
60
|
declare const DataTable: <T>({ data, columns, showHeader, className, variant, disabled, ...props }: DataTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,qBAAqB;;;8EAmB1B,CAAA;AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAA;IAC3B,MAAM,CAAC,EAAE,CACP,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EACjB,OAAO,EAAE,CAAC,EACV,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,OAAO,KACf,SAAS,CAAA;CACf;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,CAC/B,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,EAC9D,YAAY,CAAC,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,qBAAqB;;;8EAmB1B,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,m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
|
-
import { typographyVariants as h, Typography as y } from "../Typography/Typography.js";
|
|
5
4
|
import { cn as i } from "../../utils/cn.js";
|
|
5
|
+
import { typographyVariants as h, Typography as y } from "../Typography/Typography.js";
|
|
6
6
|
const u = b(
|
|
7
7
|
"h-comp-table-h border-y border-stroke-base-secondary px-2xl transition-colors",
|
|
8
8
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAQ3D,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"DataTable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAQ3D,QAAA,MAAM,IAAI,EAAE,IA2CX,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAA;AAqFrB,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAA;AAaD,eAAO,MAAM,WAAW,EAAE,KAazB,CAAA;AA0CD,eAAO,MAAM,iBAAiB,EAAE,KAa/B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAc1B,CAAA;AASD,eAAO,MAAM,kBAAkB,EAAE,KAoIhC,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAc1B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAYtB,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAYlC,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAqEzB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './DataTable';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -2,45 +2,100 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { DateRange } from 'react-day-picker';
|
|
3
3
|
import { CalendarBaseProps } from '../Calendar';
|
|
4
4
|
import { Presets } from './utils/getDateRange';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the DatePicker component.
|
|
7
|
+
*
|
|
8
|
+
* Uses a discriminated union on `mode` to type `value`, `defaultValue`,
|
|
9
|
+
* `onChange`, and `dateFormatter` for either single date or date range selection.
|
|
10
|
+
*/
|
|
5
11
|
export type DatePickerProps = {
|
|
12
|
+
/** Controls horizontal alignment of the calendar popover relative to the trigger. */
|
|
6
13
|
alignCalendar?: 'center' | 'end' | 'start';
|
|
14
|
+
/**
|
|
15
|
+
* Defines preset date range options shown in the left panel (range mode only).
|
|
16
|
+
* Each preset has a display `name` and a `type` matching a built-in range calculation.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* allowedPresets={[
|
|
21
|
+
* { name: 'Today', type: 'Today' },
|
|
22
|
+
* { name: 'Last 7 days', type: 'Last 7 days' },
|
|
23
|
+
* ]}
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @see Presets
|
|
27
|
+
*/
|
|
7
28
|
allowedPresets?: {
|
|
8
29
|
name: string;
|
|
9
30
|
type: (typeof Presets)[number];
|
|
10
31
|
}[];
|
|
32
|
+
/** Controls the open state of the calendar popover when used as a controlled component. */
|
|
11
33
|
open?: boolean;
|
|
34
|
+
/** Fires when the popover open state changes. */
|
|
12
35
|
onOpenChange?: (open: boolean) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Custom class names for internal elements.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* classNames={{ popoverTrigger: 'w-full', input: 'rounded-lg' }}
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
13
44
|
classNames?: Partial<{
|
|
14
45
|
popoverTrigger: string;
|
|
15
46
|
popoverContent: string;
|
|
16
47
|
input: string;
|
|
17
48
|
leftPanelButton: string;
|
|
18
49
|
}>;
|
|
50
|
+
/** Prevents interaction and applies disabled styling. */
|
|
19
51
|
disabled?: boolean;
|
|
52
|
+
/** Applies error styling with red border to the input. */
|
|
20
53
|
error?: boolean;
|
|
54
|
+
/** Displays label text above the input. */
|
|
21
55
|
label?: string;
|
|
56
|
+
/** Displays helper text below the input. */
|
|
22
57
|
hint?: string;
|
|
58
|
+
/** Placeholder text shown when no date is selected. */
|
|
23
59
|
placeholder?: string;
|
|
60
|
+
/** Controls which side of the trigger the calendar popover opens on. @default 'bottom' */
|
|
24
61
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
62
|
+
/** Prevents the popover from overflowing viewport boundaries. @default true */
|
|
25
63
|
avoidCollisions?: boolean;
|
|
64
|
+
/** Replaces the default Input trigger with a custom rendered element. */
|
|
26
65
|
renderCustomTrigger?: () => ReactNode;
|
|
66
|
+
/**
|
|
67
|
+
* Controls reset button behavior. When true, reset restores `defaultValue`.
|
|
68
|
+
* When false or omitted, reset reverts to the last confirmed value.
|
|
69
|
+
*/
|
|
27
70
|
shouldResetToDefaultValue?: boolean;
|
|
71
|
+
/** Marks the field as required, displaying an asterisk on the label. */
|
|
28
72
|
required?: boolean;
|
|
29
|
-
} & Omit<CalendarBaseProps, 'numberOfMonths' | 'onConfirm' | 'onReset' | 'isExpanded' | 'leftPanelChildren' | 'bottomTextDefault' | 'dateFormatter' | 'dateRangeFormatter'> & (
|
|
30
|
-
|
|
73
|
+
} & Omit<CalendarBaseProps, 'numberOfMonths' | 'onConfirm' | 'onReset' | 'isExpanded' | 'leftPanelChildren' | 'bottomTextDefault' | 'dateFormatter' | 'dateRangeFormatter'> & (DatePickerRangeProps | DatePickerSingleProps);
|
|
74
|
+
/** Props for date range selection mode. */
|
|
75
|
+
export type DatePickerRangeProps = {
|
|
76
|
+
/** Enables date range selection with start and end dates. */
|
|
31
77
|
mode: 'range';
|
|
78
|
+
/** Currently selected date range (controlled). */
|
|
32
79
|
value?: DateRange | undefined;
|
|
80
|
+
/** Initial date range for uncontrolled usage. */
|
|
33
81
|
defaultValue?: DateRange | undefined;
|
|
82
|
+
/** Fires when a date range selection is confirmed. */
|
|
34
83
|
onChange?: (date: DateRange) => void;
|
|
84
|
+
/** Custom function to format the displayed date range string. */
|
|
35
85
|
dateFormatter?: (date: DateRange) => string;
|
|
36
86
|
};
|
|
37
|
-
|
|
87
|
+
/** Props for single date selection mode. */
|
|
88
|
+
export type DatePickerSingleProps = {
|
|
89
|
+
/** Enables single date selection. */
|
|
38
90
|
mode: 'single';
|
|
91
|
+
/** Currently selected date (controlled). */
|
|
39
92
|
value?: Date | undefined;
|
|
93
|
+
/** Initial date for uncontrolled usage. */
|
|
40
94
|
defaultValue?: Date | undefined;
|
|
95
|
+
/** Fires when a single date selection is confirmed. */
|
|
41
96
|
onChange?: (date: Date) => void;
|
|
97
|
+
/** Custom function to format the displayed date string. */
|
|
42
98
|
dateFormatter?: (date: Date) => string;
|
|
43
99
|
};
|
|
44
100
|
export declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
45
|
-
export {};
|
|
46
101
|
//# sourceMappingURL=DatePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAmC,MAAM,OAAO,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAIjD,OAAO,EAEL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 @@ import { useIsDesktop as Z } from "../../hooks/use-is-desktop.js";
|
|
|
4
4
|
import { useIsMobile as _ } from "../../hooks/use-is-mobile.js";
|
|
5
5
|
import { Popover as $, PopoverTrigger as w, PopoverContent as T } from "../Popover/Popover.js";
|
|
6
6
|
import { getDateRange as a } from "./utils/getDateRange.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { formatDateRange as h } from "../Calendar/utils/formatDateRange.js";
|
|
7
|
+
import { Input as s } from "../Input/Input.js";
|
|
8
|
+
import { formatDate as V } from "../Calendar/utils/formatDate.js";
|
|
9
|
+
import { formatDateRange as O } from "../Calendar/utils/formatDateRange.js";
|
|
11
10
|
import { Calendar as R } from "../Calendar/Calendar.js";
|
|
12
11
|
import { cn as b } from "../../utils/cn.js";
|
|
12
|
+
import { typographyVariants as h } from "../Typography/Typography.js";
|
|
13
13
|
import { CalendarBold as C } from "@solar-icons/react-perf";
|
|
14
14
|
const N = W(
|
|
15
15
|
({
|
|
@@ -45,7 +45,7 @@ const N = W(
|
|
|
45
45
|
"button",
|
|
46
46
|
{
|
|
47
47
|
className: b(
|
|
48
|
-
|
|
48
|
+
h({
|
|
49
49
|
variant: "cta",
|
|
50
50
|
weight: "medium",
|
|
51
51
|
size: "sm",
|
|
@@ -64,7 +64,7 @@ const N = W(
|
|
|
64
64
|
children: i.name
|
|
65
65
|
},
|
|
66
66
|
i.type
|
|
67
|
-
)), D = z ?? (v === "single" ?
|
|
67
|
+
)), D = z ?? (v === "single" ? V : O);
|
|
68
68
|
return /* @__PURE__ */ U(
|
|
69
69
|
$,
|
|
70
70
|
{
|
|
@@ -82,7 +82,7 @@ const N = W(
|
|
|
82
82
|
),
|
|
83
83
|
disabled: S,
|
|
84
84
|
children: I ? I() : /* @__PURE__ */ e(
|
|
85
|
-
|
|
85
|
+
s,
|
|
86
86
|
{
|
|
87
87
|
ref: G,
|
|
88
88
|
value: u ? D(u) : "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.stories.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAI3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,
|
|
1
|
+
{"version":3,"file":"DatePicker.stories.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAI3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAgJjC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA;AAExC,eAAO,MAAM,iBAAiB,EAAE,KAoC/B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAsB9B,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,KAuBxC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KA0B7B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAwBtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAwBnB,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,KAyBxC,CAAA;AAED,eAAO,MAAM,2BAA2B,EAAE,KAmCzC,CAAA;AAED,eAAO,MAAM,qCAAqC,EAAE,KA8CnD,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAyB1C,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAyB1C,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA0BtB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { DateRange } from 'react-day-picker';
|
|
2
|
+
/** Available preset date range types for the DatePicker left panel. */
|
|
2
3
|
export declare const Presets: readonly ["Today", "Yesterday", "This week", "Last week", "Last 7 days", "Last 14 days", "Last 30 days", "Last 90 days", "This year", "Last year", undefined];
|
|
4
|
+
/**
|
|
5
|
+
* Calculates a DateRange from a preset type string.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* getDateRange('Last 7 days') // { from: 7 days ago, to: today }
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
3
12
|
export declare const getDateRange: (preset: (typeof Presets)[number]) => DateRange;
|
|
4
13
|
//# sourceMappingURL=getDateRange.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDateRange.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/utils/getDateRange.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,eAAO,MAAM,OAAO,+JAYV,CAAA;AAEV,eAAO,MAAM,YAAY,GAAI,QAAQ,CAAC,OAAO,OAAO,EAAE,MAAM,CAAC,KAAG,SAoC/D,CAAA"}
|
|
1
|
+
{"version":3,"file":"getDateRange.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/utils/getDateRange.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,uEAAuE;AACvE,eAAO,MAAM,OAAO,+JAYV,CAAA;AAEV;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,CAAC,OAAO,OAAO,EAAE,MAAM,CAAC,KAAG,SAoC/D,CAAA"}
|
|
@@ -1,40 +1,53 @@
|
|
|
1
|
-
import { subYears as
|
|
2
|
-
const
|
|
1
|
+
import { subYears as f, endOfYear as a, startOfYear as r, subDays as s, startOfWeek as o, subWeeks as n, endOfWeek as y } from "date-fns";
|
|
2
|
+
const k = [
|
|
3
|
+
"Today",
|
|
4
|
+
"Yesterday",
|
|
5
|
+
"This week",
|
|
6
|
+
"Last week",
|
|
7
|
+
"Last 7 days",
|
|
8
|
+
"Last 14 days",
|
|
9
|
+
"Last 30 days",
|
|
10
|
+
"Last 90 days",
|
|
11
|
+
"This year",
|
|
12
|
+
"Last year",
|
|
13
|
+
void 0
|
|
14
|
+
], m = (d) => {
|
|
3
15
|
const e = /* @__PURE__ */ new Date();
|
|
4
|
-
switch (
|
|
16
|
+
switch (d) {
|
|
5
17
|
case "Today":
|
|
6
18
|
return { from: e, to: e };
|
|
7
19
|
case "Yesterday": {
|
|
8
|
-
const t =
|
|
20
|
+
const t = s(e, 1);
|
|
9
21
|
return { from: t, to: t };
|
|
10
22
|
}
|
|
11
23
|
case "This week":
|
|
12
24
|
return {
|
|
13
25
|
from: o(e, { weekStartsOn: 0 }),
|
|
14
|
-
to:
|
|
26
|
+
to: y(e, { weekStartsOn: 0 })
|
|
15
27
|
};
|
|
16
28
|
case "Last week": {
|
|
17
|
-
const t = o(n(e, 1), { weekStartsOn: 0 }),
|
|
18
|
-
return { from: t, to:
|
|
29
|
+
const t = o(n(e, 1), { weekStartsOn: 0 }), c = y(n(e, 1), { weekStartsOn: 0 });
|
|
30
|
+
return { from: t, to: c };
|
|
19
31
|
}
|
|
20
32
|
case "Last 7 days":
|
|
21
|
-
return { from:
|
|
33
|
+
return { from: s(e, 6), to: e };
|
|
22
34
|
case "Last 14 days":
|
|
23
|
-
return { from:
|
|
35
|
+
return { from: s(e, 13), to: e };
|
|
24
36
|
case "Last 30 days":
|
|
25
|
-
return { from:
|
|
37
|
+
return { from: s(e, 29), to: e };
|
|
26
38
|
case "Last 90 days":
|
|
27
|
-
return { from:
|
|
39
|
+
return { from: s(e, 89), to: e };
|
|
28
40
|
case "This year":
|
|
29
|
-
return { from:
|
|
41
|
+
return { from: r(e), to: a(e) };
|
|
30
42
|
case "Last year": {
|
|
31
|
-
const t =
|
|
32
|
-
return { from:
|
|
43
|
+
const t = f(e, 1);
|
|
44
|
+
return { from: r(t), to: a(t) };
|
|
33
45
|
}
|
|
34
46
|
default:
|
|
35
47
|
return { from: e, to: e };
|
|
36
48
|
}
|
|
37
49
|
};
|
|
38
50
|
export {
|
|
39
|
-
|
|
51
|
+
k as Presets,
|
|
52
|
+
m as getDateRange
|
|
40
53
|
};
|
|
@@ -1,7 +1,44 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
1
2
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
-
|
|
3
|
+
/** Props for the Dialog root component. Controls open state and modality. */
|
|
4
|
+
export interface DialogProps extends React.ComponentProps<typeof DialogPrimitive.Root> {
|
|
5
|
+
/** Controlled open state of the dialog. */
|
|
6
|
+
open?: boolean;
|
|
7
|
+
/** Initial open state for uncontrolled usage. @default false */
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
/** Fires when open state changes. */
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
/** Controls whether dialog blocks interaction with page content behind it. @default true */
|
|
12
|
+
modal?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Props for the DialogContent component. Renders modal container with backdrop, close button, and animations. */
|
|
15
|
+
export interface DialogContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
16
|
+
/** Controls maximum width of the dialog content. @default 'medium' */
|
|
17
|
+
size?: 'small' | 'medium' | 'large';
|
|
18
|
+
/** Accessible label for the close button. Defaults to translation value. */
|
|
19
|
+
closeAriaLabel?: string;
|
|
20
|
+
}
|
|
21
|
+
declare const Dialog: React.FC<DialogProps>;
|
|
3
22
|
declare const DialogTitle: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
4
23
|
declare const DialogDescription: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
24
|
+
/** Props for the DialogHeader component. Renders a styled header with optional icon, title, and close button. */
|
|
25
|
+
export interface DialogHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {
|
|
26
|
+
/** Optional icon element displayed before the title. */
|
|
27
|
+
icon?: ReactNode;
|
|
28
|
+
/** Hides the close button in the header. @default false */
|
|
29
|
+
hideCloseButton?: boolean;
|
|
30
|
+
/** Accessible label for the close button. Defaults to translation value. */
|
|
31
|
+
closeAriaLabel?: string;
|
|
32
|
+
/** Dialog title content. Falls back to `children` if not provided. */
|
|
33
|
+
title?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
declare const DialogHeader: import('react').ForwardRefExoticComponent<DialogHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
36
|
+
/** Props for the DialogFooter component. Renders a fixed footer area for action buttons with a conditional top border. */
|
|
37
|
+
export interface DialogFooterProps extends ComponentPropsWithoutRef<'div'> {
|
|
38
|
+
/** @internal Used by DialogContent to control border visibility based on scroll state. */
|
|
39
|
+
_showBorder?: boolean;
|
|
40
|
+
}
|
|
41
|
+
declare const DialogFooter: import('react').ForwardRefExoticComponent<DialogFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
42
|
declare const DialogTrigger: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
6
43
|
declare const DialogPortal: import('react').FC<DialogPrimitive.DialogPortalProps>;
|
|
7
44
|
declare const DialogClose: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -10,5 +47,5 @@ declare const DialogContent: import('react').ForwardRefExoticComponent<Omit<Dial
|
|
|
10
47
|
size?: "small" | "medium" | "large";
|
|
11
48
|
closeAriaLabel?: string;
|
|
12
49
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
|
-
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogTitle, DialogDescription, };
|
|
50
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
14
51
|
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAE7B,KAAK,SAAS,EAOf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAMzD,6EAA6E;AAC7E,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IACzD,2CAA2C;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,qCAAqC;IACrC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,4FAA4F;IAC5F,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,kHAAkH;AAClH,MAAM,WAAW,kBACf,SAAQ,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC;IAChE,sEAAsE;IACtE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,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