@monolith-forensics/monolith-ui 1.8.1-dev.3 → 1.8.1
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/Button/Button.js +58 -9
- package/dist/Calendar/Calendar.d.ts +2 -7
- package/dist/Calendar/Calendar.js +49 -226
- package/dist/Calendar/CalendarStyles.d.ts +2 -6
- package/dist/Calendar/CalendarStyles.js +33 -153
- package/dist/Calendar/calendarHelpers.d.ts +2 -6
- package/dist/Calendar/calendarHelpers.js +5 -13
- package/dist/Charts/BarChart/BarChart.js +28 -14
- package/dist/Charts/BarChart/BarChart.styled.d.ts +7 -2
- package/dist/Charts/BarChart/BarChart.styled.js +5 -1
- package/dist/Charts/BarChart/BarChart.types.d.ts +13 -5
- package/dist/Charts/ChartUtils/chartSizing.d.ts +20 -0
- package/dist/Charts/ChartUtils/chartSizing.js +83 -0
- package/dist/Charts/ChartUtils/index.d.ts +1 -0
- package/dist/Charts/ChartUtils/index.js +1 -0
- package/dist/Charts/HeatMap/HeatMap.js +28 -7
- package/dist/Charts/HeatMap/HeatMap.styled.d.ts +6 -2
- package/dist/Charts/HeatMap/HeatMap.styled.js +3 -0
- package/dist/Charts/HeatMap/HeatMap.types.d.ts +7 -1
- package/dist/Charts/LineChart/LineChart.js +34 -15
- package/dist/Charts/LineChart/LineChart.styled.d.ts +7 -2
- package/dist/Charts/LineChart/LineChart.styled.js +5 -1
- package/dist/Charts/LineChart/LineChart.types.d.ts +13 -5
- package/dist/Charts/PieChart/PieChart.js +48 -33
- package/dist/Charts/PieChart/PieChart.styled.d.ts +7 -2
- package/dist/Charts/PieChart/PieChart.styled.js +6 -1
- package/dist/Charts/PieChart/PieChart.types.d.ts +7 -3
- package/dist/CheckBox/CheckBox.js +19 -36
- package/dist/DateInput/DateInput.js +143 -198
- package/dist/DropDownMenu/DropDownMenu.js +15 -25
- package/dist/DropDownMenu/components/MenuComponent.js +2 -8
- package/dist/DropDownMenu/components/MenuItem.d.ts +0 -2
- package/dist/DropDownMenu/components/MenuItem.js +21 -25
- package/dist/DropDownMenu/components/MenuItemList.d.ts +0 -3
- package/dist/DropDownMenu/components/MenuItemList.js +86 -192
- package/dist/DropDownMenu/components/StyledContent.js +2 -1
- package/dist/DropDownMenu/components/StyledFloatContainer.js +1 -1
- package/dist/DropDownMenu/types.d.ts +0 -3
- package/dist/FieldLabel/FieldLabel.js +12 -4
- package/dist/FileInputField/FileInputField.js +23 -4
- package/dist/FileViewer/viewers/ImageViewer.js +18 -75
- package/dist/FormSection/FormSection.js +25 -5
- package/dist/IconButton/IconButton.js +16 -2
- package/dist/Input/Input.js +56 -7
- package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +4 -1
- package/dist/Pill/Pill.js +79 -8
- package/dist/Popover/Popover.context.d.ts +1 -2
- package/dist/Popover/Popover.js +2 -5
- package/dist/Popover/Popover.styles.d.ts +6 -1
- package/dist/Popover/Popover.styles.js +28 -11
- package/dist/Popover/Popover.transitions.d.ts +2 -4
- package/dist/Popover/Popover.transitions.js +49 -23
- package/dist/Popover/PopoverDropdown.js +8 -6
- package/dist/Popover/PopoverTarget.js +3 -6
- package/dist/QueryFilter/DefaultOperators.d.ts +76 -1
- package/dist/QueryFilter/DefaultOperators.js +21 -1
- package/dist/QueryFilter/QueryFilter.d.ts +1 -1
- package/dist/QueryFilter/QueryFilter.js +303 -3
- package/dist/QueryFilter/index.d.ts +2 -3
- package/dist/QueryFilter/index.js +2 -3
- package/dist/QueryFilter/types.d.ts +52 -1
- package/dist/QueryFilter/types.js +1 -1
- package/dist/QueryFilter/useQueryFilter.d.ts +1 -1
- package/dist/QueryFilter/useQueryFilter.js +19 -23
- package/dist/RichTextEditor/Components/CodeBlockBaseButton.d.ts +18 -0
- package/dist/RichTextEditor/Components/CodeBlockBaseButton.js +6 -0
- package/dist/RichTextEditor/Components/CodeBlockCopyButton.d.ts +9 -0
- package/dist/RichTextEditor/Components/CodeBlockCopyButton.js +42 -0
- package/dist/RichTextEditor/Components/CodeBlockFormatButton.d.ts +10 -0
- package/dist/RichTextEditor/Components/CodeBlockFormatButton.js +60 -0
- package/dist/RichTextEditor/Components/CodeBlockLanguageSelect.d.ts +9 -0
- package/dist/RichTextEditor/Components/CodeBlockLanguageSelect.js +30 -0
- package/dist/RichTextEditor/Components/CodeBlockNodeView.d.ts +3 -0
- package/dist/RichTextEditor/Components/CodeBlockNodeView.js +28 -0
- package/dist/RichTextEditor/Components/CodeBlockWrapButton.d.ts +10 -0
- package/dist/RichTextEditor/Components/CodeBlockWrapButton.js +17 -0
- package/dist/RichTextEditor/Components/LinkEditor.d.ts +8 -0
- package/dist/RichTextEditor/Components/LinkEditor.js +94 -0
- package/dist/RichTextEditor/Components/TableTools/TableCornerMenu.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableCornerMenu.js +19 -0
- package/dist/RichTextEditor/Components/TableTools/TableInsertControls.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableInsertControls.js +24 -0
- package/dist/RichTextEditor/Components/TableTools/TableRails.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableRails.js +180 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolMenu.d.ts +5 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolMenu.js +6 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.actions.d.ts +5 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.actions.js +183 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.commands.d.ts +16 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.commands.js +217 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.constants.d.ts +8 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.constants.js +11 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.d.ts +3 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.geometry.d.ts +23 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.geometry.js +75 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.js +3 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.selectors.d.ts +16 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.selectors.js +53 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.styled.d.ts +40 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.styled.js +167 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.types.d.ts +76 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.types.js +1 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.utils.d.ts +4 -0
- package/dist/RichTextEditor/Components/TableTools/TableTools.utils.js +4 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolsPopover.d.ts +2 -0
- package/dist/RichTextEditor/Components/TableTools/TableToolsPopover.js +12 -0
- package/dist/RichTextEditor/Components/TableTools/index.d.ts +3 -0
- package/dist/RichTextEditor/Components/TableTools/index.js +2 -0
- package/dist/RichTextEditor/Enums/HighlightColors.d.ts +9 -0
- package/dist/RichTextEditor/Enums/HighlightColors.js +10 -0
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +15 -5
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.js +4 -7
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.d.ts +0 -15
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.js +51 -115
- package/dist/RichTextEditor/Plugins/index.d.ts +0 -1
- package/dist/RichTextEditor/Plugins/index.js +0 -1
- package/dist/RichTextEditor/RichTextEditor.d.ts +2 -3
- package/dist/RichTextEditor/RichTextEditor.js +35 -302
- package/dist/RichTextEditor/Utils/codeBlockUtils.d.ts +20 -0
- package/dist/RichTextEditor/Utils/codeBlockUtils.js +137 -0
- package/dist/RichTextEditor/Utils/codeUtils.d.ts +3 -0
- package/dist/RichTextEditor/Utils/codeUtils.js +12 -0
- package/dist/RichTextEditor/Utils/linkUtils.d.ts +19 -0
- package/dist/RichTextEditor/Utils/linkUtils.js +57 -0
- package/dist/RichTextEditor/Utils/tableUtils.d.ts +1 -0
- package/dist/RichTextEditor/Utils/tableUtils.js +1 -0
- package/dist/SegmentedControl/SegmentedControl.utils.d.ts +2 -2
- package/dist/SegmentedControl/SegmentedControl.utils.js +30 -3
- package/dist/SelectBox/SelectBox.js +5 -5
- package/dist/SelectBox/select-box.styled-components.d.ts +1 -4
- package/dist/SelectBox/select-box.styled-components.js +48 -11
- package/dist/SelectBox/types.d.ts +0 -1
- package/dist/Switch/Switch.d.ts +2 -2
- package/dist/Switch/Switch.js +83 -18
- package/dist/Table/ColumnResizer.d.ts +9 -6
- package/dist/Table/ColumnResizer.js +10 -30
- package/dist/Table/StateStorage.d.ts +0 -4
- package/dist/Table/StateStorage.js +0 -13
- package/dist/Table/Table.js +12 -160
- package/dist/Table/TableComponents.d.ts +0 -10
- package/dist/Table/TableComponents.js +10 -71
- package/dist/Table/TableDefaults.d.ts +0 -7
- package/dist/Table/TableDefaults.js +0 -7
- package/dist/Table/TableHeader.js +16 -31
- package/dist/Table/TableMenu/TableMenu.js +1 -1
- package/dist/Table/TableProvider.js +75 -354
- package/dist/Table/TableRow.js +16 -28
- package/dist/Table/Utils/index.d.ts +1 -0
- package/dist/Table/Utils/index.js +1 -0
- package/dist/Table/types.d.ts +19 -70
- package/dist/TagBox/TagBox.d.ts +1 -1
- package/dist/TagBox/TagBox.js +80 -22
- package/dist/TagBox/types.d.ts +0 -1
- package/dist/TextArea/TextArea.js +23 -9
- package/dist/TextInput/TextInput.js +6 -12
- package/dist/Utilities/parseTimestamp.js +6 -11
- package/dist/core/ArrowButton.d.ts +0 -2
- package/dist/core/ArrowButton.js +3 -7
- package/dist/core/ClearButton.d.ts +0 -2
- package/dist/core/ClearButton.js +3 -7
- package/dist/core/controlSizes.js +9 -9
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -2
- package/dist/theme/variants.js +8 -2
- package/package.json +18 -26
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +0 -41
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +0 -363
- package/dist/DateTimeRangePicker/index.d.ts +0 -2
- package/dist/DateTimeRangePicker/index.js +0 -2
package/dist/Table/types.d.ts
CHANGED
|
@@ -10,42 +10,6 @@ export type StateStorage = {
|
|
|
10
10
|
type: "localStorage";
|
|
11
11
|
key: string;
|
|
12
12
|
};
|
|
13
|
-
export type TreeMode = "nested" | "flat";
|
|
14
|
-
export type TreeOptions = {
|
|
15
|
-
/** Enable tree-row behavior. Default: false */
|
|
16
|
-
enabled?: boolean;
|
|
17
|
-
/** Input shape. Default: "nested" */
|
|
18
|
-
mode?: TreeMode;
|
|
19
|
-
/** For mode="nested": field name that holds child array. Default: "children" */
|
|
20
|
-
childrenField?: string;
|
|
21
|
-
/** For mode="flat": field name that holds parent id. Default: "parentId" */
|
|
22
|
-
parentIdField?: string;
|
|
23
|
-
/** For mode="flat": field name that holds the row's stable id. Falls back to keyField. */
|
|
24
|
-
idField?: string;
|
|
25
|
-
/** Pixel width of one indentation level. Default: 16 */
|
|
26
|
-
indentPx?: number;
|
|
27
|
-
/** If a descendant matches search/filter, auto-expand its ancestors for the effective view. Default: true */
|
|
28
|
-
autoExpandOnMatch?: boolean;
|
|
29
|
-
};
|
|
30
|
-
export type ResolvedTreeOptions = {
|
|
31
|
-
enabled: boolean;
|
|
32
|
-
mode: TreeMode;
|
|
33
|
-
childrenField: string;
|
|
34
|
-
parentIdField: string;
|
|
35
|
-
idField?: string;
|
|
36
|
-
indentPx: number;
|
|
37
|
-
autoExpandOnMatch: boolean;
|
|
38
|
-
};
|
|
39
|
-
export type ExpandedKeysState = string[];
|
|
40
|
-
export type OnExpandedChangeFn = (keys: string[]) => void;
|
|
41
|
-
export type TreeMeta = {
|
|
42
|
-
/** Map of row key -> parent row key (undefined for roots) */
|
|
43
|
-
parentKeyMap: Map<string, string | undefined>;
|
|
44
|
-
/** Map of parent key -> ordered list of direct child keys */
|
|
45
|
-
childrenKeyMap: Map<string | undefined, string[]>;
|
|
46
|
-
/** All row keys that have children (eligible for expansion) */
|
|
47
|
-
expandableKeys: string[];
|
|
48
|
-
};
|
|
49
13
|
export type RenderOptions = {
|
|
50
14
|
rowData: any;
|
|
51
15
|
onRowUpdated?: (context: {
|
|
@@ -91,9 +55,27 @@ export type TableState = {
|
|
|
91
55
|
sortState?: SortState;
|
|
92
56
|
filterState?: Query;
|
|
93
57
|
searchState?: string;
|
|
94
|
-
expandedKeys?: ExpandedKeysState;
|
|
95
58
|
};
|
|
59
|
+
export interface onResizeFinishedProps {
|
|
60
|
+
column: ColumnState;
|
|
61
|
+
columnId?: string;
|
|
62
|
+
targetColumn: Element | null;
|
|
63
|
+
newWidth: string | null;
|
|
64
|
+
}
|
|
65
|
+
export interface onResizeProps {
|
|
66
|
+
columns: {
|
|
67
|
+
dataField: string;
|
|
68
|
+
width: number;
|
|
69
|
+
}[];
|
|
70
|
+
}
|
|
96
71
|
export type ColumnStateUpdate = ColumnState[] | ((prevColumnState: ColumnState[]) => ColumnState[]);
|
|
72
|
+
export interface ResizeHandlerProps {
|
|
73
|
+
event: React.MouseEvent<HTMLDivElement>;
|
|
74
|
+
columnId?: string;
|
|
75
|
+
columnProps: ColumnState;
|
|
76
|
+
onResize: (e: onResizeProps) => void;
|
|
77
|
+
onResizeFinished?: (e: onResizeFinishedProps) => void;
|
|
78
|
+
}
|
|
97
79
|
export interface TableHeaderProps {
|
|
98
80
|
headerRowHeight?: number;
|
|
99
81
|
enableColumnResize?: boolean;
|
|
@@ -112,32 +94,15 @@ export type TableDimensions = {
|
|
|
112
94
|
width: number;
|
|
113
95
|
height: number;
|
|
114
96
|
};
|
|
115
|
-
export type TableLayout = {
|
|
116
|
-
contentWidth: number;
|
|
117
|
-
columnWidths: Record<string, number>;
|
|
118
|
-
};
|
|
119
97
|
export type TableContextType = {
|
|
120
98
|
columnState: ColumnState[];
|
|
121
99
|
setColumnState: (columnStateUpdate: ColumnStateUpdate) => void;
|
|
122
|
-
tableLayout: TableLayout;
|
|
123
|
-
setResizeColumnWidths: (widths: Record<string, number> | null) => void;
|
|
124
100
|
sortState?: SortState | null;
|
|
125
101
|
filterState?: Query | null;
|
|
126
102
|
searchState?: string | null;
|
|
127
103
|
data: any[];
|
|
128
104
|
totalRecords?: number;
|
|
129
105
|
keyField?: string;
|
|
130
|
-
treeOptions: ResolvedTreeOptions;
|
|
131
|
-
firstVisibleDataField?: string;
|
|
132
|
-
expandedKeys: string[];
|
|
133
|
-
effectiveExpandedKeys: Set<string>;
|
|
134
|
-
isRowExpanded: (row: any) => boolean;
|
|
135
|
-
toggleRowExpanded: (row: any) => void;
|
|
136
|
-
expandRow: (row: any) => void;
|
|
137
|
-
collapseRow: (row: any) => void;
|
|
138
|
-
expandAllRows: () => void;
|
|
139
|
-
collapseAllRows: () => void;
|
|
140
|
-
onExpandedChange?: OnExpandedChangeFn;
|
|
141
106
|
tableHeight?: number;
|
|
142
107
|
tableMaxHeight?: number;
|
|
143
108
|
tableMinHeight?: number;
|
|
@@ -249,11 +214,6 @@ export interface TableProviderProps {
|
|
|
249
214
|
defaultFilterState?: Query;
|
|
250
215
|
filterState?: Query;
|
|
251
216
|
onFilterChange?: (e: Query) => void;
|
|
252
|
-
treeOptions?: ResolvedTreeOptions;
|
|
253
|
-
defaultExpandedKeys?: ExpandedKeysState;
|
|
254
|
-
expandedKeys?: ExpandedKeysState;
|
|
255
|
-
onExpandedChange?: OnExpandedChangeFn;
|
|
256
|
-
treeMeta?: TreeMeta;
|
|
257
217
|
}
|
|
258
218
|
export interface TableRowProps {
|
|
259
219
|
rowData: {
|
|
@@ -375,10 +335,6 @@ export interface TableProps {
|
|
|
375
335
|
defaultFilterState?: Query;
|
|
376
336
|
filterState?: Query;
|
|
377
337
|
onFilterChange?: (e: Query) => void;
|
|
378
|
-
treeOptions?: TreeOptions;
|
|
379
|
-
defaultExpandedKeys?: ExpandedKeysState;
|
|
380
|
-
expandedKeys?: ExpandedKeysState;
|
|
381
|
-
onExpandedChange?: OnExpandedChangeFn;
|
|
382
338
|
}
|
|
383
339
|
export type TableInstance = {
|
|
384
340
|
columnState: ColumnState[];
|
|
@@ -399,11 +355,4 @@ export type TableInstance = {
|
|
|
399
355
|
clearSearch: () => void;
|
|
400
356
|
clearSelections: () => void;
|
|
401
357
|
getTableState: () => TableState;
|
|
402
|
-
expandRow: (row: any) => void;
|
|
403
|
-
collapseRow: (row: any) => void;
|
|
404
|
-
toggleRowExpanded: (row: any) => void;
|
|
405
|
-
isRowExpanded: (row: any) => boolean;
|
|
406
|
-
expandAllRows: () => void;
|
|
407
|
-
collapseAllRows: () => void;
|
|
408
|
-
getExpandedRowKeys: () => string[];
|
|
409
358
|
};
|
package/dist/TagBox/TagBox.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TagBoxProps } from "./types";
|
|
2
|
-
declare const TagBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<TagBoxProps, never>> & string & Omit<({ className, data, placeholder, arrow, defaultValue, value, grouped, searchFn, onChange, onScroll, onSearch, onItemAdded, size, variant, width, allowCustomValue, searchable, clearable, openOnFocus, label, description, required, error, loading, sort, disabled,
|
|
2
|
+
declare const TagBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<TagBoxProps, never>> & string & Omit<({ className, data, placeholder, arrow, defaultValue, value, grouped, searchFn, onChange, onScroll, onSearch, onItemAdded, size, variant, width, allowCustomValue, searchable, clearable, openOnFocus, label, description, required, error, loading, sort, disabled, renderOption, renderTag, OptionTooltip, DropDownProps, }: TagBoxProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
3
3
|
export default TagBox;
|
package/dist/TagBox/TagBox.js
CHANGED
|
@@ -14,7 +14,7 @@ import styled from "styled-components";
|
|
|
14
14
|
import { useFloating, flip, offset, autoUpdate, FloatingPortal, } from "@floating-ui/react";
|
|
15
15
|
import { useCallback, useEffect, useRef, useState, } from "react";
|
|
16
16
|
import { Input, Tooltip, FieldLabel, Pill, Loader } from "..";
|
|
17
|
-
import { ArrowButton, ClearButton, StyledFloatContainer, StyledContent,
|
|
17
|
+
import { ArrowButton, ClearButton, StyledFloatContainer, StyledContent, } from "../core";
|
|
18
18
|
const StyledInputContainer = styled.div `
|
|
19
19
|
position: relative;
|
|
20
20
|
cursor: pointer;
|
|
@@ -29,7 +29,17 @@ const StyledInputContainer = styled.div `
|
|
|
29
29
|
pointer-events: all;
|
|
30
30
|
outline: none;
|
|
31
31
|
|
|
32
|
-
padding: ${({ size }) =>
|
|
32
|
+
padding: ${({ size }) => size === "xs"
|
|
33
|
+
? "2px 8px"
|
|
34
|
+
: size === "sm"
|
|
35
|
+
? "4px 10px"
|
|
36
|
+
: size === "md"
|
|
37
|
+
? "6px 12px"
|
|
38
|
+
: size === "lg"
|
|
39
|
+
? "7px 14px"
|
|
40
|
+
: size === "xl"
|
|
41
|
+
? "8px 16px"
|
|
42
|
+
: "4px 10px"};
|
|
33
43
|
|
|
34
44
|
border-radius: 5px;
|
|
35
45
|
transition: border 0.1s ease-in-out;
|
|
@@ -48,13 +58,33 @@ const StyledInputContainer = styled.div `
|
|
|
48
58
|
}};
|
|
49
59
|
font-weight: 500;
|
|
50
60
|
color: ${(props) => props.theme.palette.text.primary};
|
|
51
|
-
font-size: ${({ size }) =>
|
|
61
|
+
font-size: ${({ size }) => size === "xs"
|
|
62
|
+
? "12px"
|
|
63
|
+
: size === "sm"
|
|
64
|
+
? "14px"
|
|
65
|
+
: size === "md"
|
|
66
|
+
? "16px"
|
|
67
|
+
: size === "lg"
|
|
68
|
+
? "18px"
|
|
69
|
+
: size === "xl"
|
|
70
|
+
? "20px"
|
|
71
|
+
: "12px"};
|
|
52
72
|
|
|
53
73
|
width: 100%;
|
|
54
|
-
min-height: ${({ size }) =>
|
|
74
|
+
min-height: ${({ size }) => size === "xs"
|
|
75
|
+
? "26px"
|
|
76
|
+
: size === "sm"
|
|
77
|
+
? "30px"
|
|
78
|
+
: size === "md"
|
|
79
|
+
? "36px"
|
|
80
|
+
: size === "lg"
|
|
81
|
+
? "42px"
|
|
82
|
+
: size === "xl"
|
|
83
|
+
? "50px"
|
|
84
|
+
: "26px"};
|
|
55
85
|
|
|
56
86
|
&[data-button-right="true"] {
|
|
57
|
-
padding-right:
|
|
87
|
+
padding-right: 36px;
|
|
58
88
|
}
|
|
59
89
|
|
|
60
90
|
background-color: ${({ theme, variant }) => {
|
|
@@ -169,8 +199,17 @@ const GroupTitle = styled((_a) => {
|
|
|
169
199
|
|
|
170
200
|
color: ${(props) => props.theme.palette.text.secondary};
|
|
171
201
|
|
|
172
|
-
|
|
173
|
-
|
|
202
|
+
padding: ${({ size }) => size === "xs"
|
|
203
|
+
? "2px 8px"
|
|
204
|
+
: size === "sm"
|
|
205
|
+
? "4px 10px"
|
|
206
|
+
: size === "md"
|
|
207
|
+
? "4px 12px"
|
|
208
|
+
: size === "lg"
|
|
209
|
+
? "5px 14px"
|
|
210
|
+
: size === "xl"
|
|
211
|
+
? "6px 16px"
|
|
212
|
+
: "2px 8px"};
|
|
174
213
|
|
|
175
214
|
.group-label {
|
|
176
215
|
white-space: nowrap;
|
|
@@ -181,7 +220,17 @@ const GroupTitle = styled((_a) => {
|
|
|
181
220
|
|
|
182
221
|
font-weight: 500;
|
|
183
222
|
|
|
184
|
-
font-size: ${({ size }) =>
|
|
223
|
+
font-size: ${({ size }) => size === "xs"
|
|
224
|
+
? "11px"
|
|
225
|
+
: size === "sm"
|
|
226
|
+
? "13px"
|
|
227
|
+
: size === "md"
|
|
228
|
+
? "15px"
|
|
229
|
+
: size === "lg"
|
|
230
|
+
? "17px"
|
|
231
|
+
: size === "xl"
|
|
232
|
+
? "19px"
|
|
233
|
+
: "11px"};
|
|
185
234
|
}
|
|
186
235
|
|
|
187
236
|
.group-line {
|
|
@@ -192,7 +241,7 @@ const GroupTitle = styled((_a) => {
|
|
|
192
241
|
const PillContainer = styled.div `
|
|
193
242
|
display: flex;
|
|
194
243
|
align-items: center;
|
|
195
|
-
gap:
|
|
244
|
+
gap: 5px;
|
|
196
245
|
flex-wrap: wrap;
|
|
197
246
|
flex-grow: 1;
|
|
198
247
|
|
|
@@ -206,27 +255,35 @@ const StyledInnerContainer = styled.div `
|
|
|
206
255
|
width: 100%;
|
|
207
256
|
|
|
208
257
|
&[data-button-right="true"] {
|
|
209
|
-
padding-right:
|
|
258
|
+
padding-right: 30px;
|
|
210
259
|
}
|
|
211
260
|
`;
|
|
212
261
|
const StyledItem = styled.div `
|
|
213
262
|
line-height: 1;
|
|
214
263
|
color: ${(props) => props.theme.palette.text.primary};
|
|
215
264
|
border-radius: 3px;
|
|
216
|
-
box-sizing: border-box;
|
|
217
265
|
display: flex;
|
|
218
266
|
align-items: center;
|
|
219
|
-
min-height:
|
|
220
|
-
|
|
267
|
+
min-height: 25px;
|
|
268
|
+
padding: 7px 10px;
|
|
221
269
|
position: relative;
|
|
222
270
|
user-select: none;
|
|
223
271
|
outline: none;
|
|
224
272
|
|
|
225
273
|
cursor: pointer;
|
|
226
274
|
|
|
227
|
-
font-family:
|
|
228
|
-
font-size: ${({ size }) =>
|
|
229
|
-
|
|
275
|
+
font-family: "Arial", sans-serif;
|
|
276
|
+
font-size: ${({ size }) => size === "xs"
|
|
277
|
+
? "11px"
|
|
278
|
+
: size === "sm"
|
|
279
|
+
? "13px"
|
|
280
|
+
: size === "md"
|
|
281
|
+
? "15px"
|
|
282
|
+
: size === "lg"
|
|
283
|
+
? "17px"
|
|
284
|
+
: size === "xl"
|
|
285
|
+
? "19px"
|
|
286
|
+
: "11px"};
|
|
230
287
|
|
|
231
288
|
&:hover {
|
|
232
289
|
background-color: ${(props) => props.theme.palette.action.hover};
|
|
@@ -284,7 +341,7 @@ const resolveValues = (value, data) => {
|
|
|
284
341
|
}
|
|
285
342
|
return resolvedValues;
|
|
286
343
|
};
|
|
287
|
-
const TagBox = styled(({ className, data = [], placeholder = "Select tags", arrow = true, defaultValue, value, grouped, searchFn, onChange, onScroll, onSearch, onItemAdded, size = "sm", variant = "outlined", width = "100%", allowCustomValue = false, searchable = false, clearable = false, openOnFocus = true, label, description, required = false, error, loading = false, sort = false, disabled = false,
|
|
344
|
+
const TagBox = styled(({ className, data = [], placeholder = "Select tags", arrow = true, defaultValue, value, grouped, searchFn, onChange, onScroll, onSearch, onItemAdded, size = "sm", variant = "outlined", width = "100%", allowCustomValue = false, searchable = false, clearable = false, openOnFocus = true, label, description, required = false, error, loading = false, sort = false, disabled = false, renderOption, renderTag, OptionTooltip, DropDownProps = {}, }) => {
|
|
288
345
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
289
346
|
const isObjectArray = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.hasOwnProperty("label");
|
|
290
347
|
const isControlled = value !== undefined;
|
|
@@ -585,7 +642,7 @@ const TagBox = styled(({ className, data = [], placeholder = "Select tags", arro
|
|
|
585
642
|
return (_jsxs("div", { className: className + " mfTagBox", children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInputContainer, { className: "styledInputContainer", ref: refs.setReference, onMouseDown: () => {
|
|
586
643
|
setIsOpen(true);
|
|
587
644
|
handleFocus();
|
|
588
|
-
}, onFocus: handleFocus, size: size, variant: variant, onKeyDown: handleKeyDown, "data-open": isOpen, "data-disabled": disabled, tabIndex: 0, children: [_jsx(StyledInnerContainer, { size: size, "data-button-right": arrow || clearable, children: _jsxs(PillContainer, { size: size, children: [_value === null || _value === void 0 ? void 0 : _value.map((item, index) => (_jsx(Pill, { size:
|
|
645
|
+
}, onFocus: handleFocus, size: size, variant: variant, onKeyDown: handleKeyDown, "data-open": isOpen, "data-disabled": disabled, tabIndex: 0, children: [_jsx(StyledInnerContainer, { size: size, "data-button-right": arrow || clearable, children: _jsxs(PillContainer, { size: size, children: [_value === null || _value === void 0 ? void 0 : _value.map((item, index) => (_jsx(Pill, { size: "xs", onRemove: () => handleRemoveItem(item), children: (renderTag === null || renderTag === void 0 ? void 0 : renderTag(item)) || _jsx(_Fragment, { children: item === null || item === void 0 ? void 0 : item.label }) }, index))), (searchable || allowCustomValue || (_value === null || _value === void 0 ? void 0 : _value.length) === 0) && (_jsx(StyledInput, { inputRef: inputRef, onChange: (e) => {
|
|
589
646
|
if (searchFn !== undefined) {
|
|
590
647
|
searchFn === null || searchFn === void 0 ? void 0 : searchFn(e.target.value);
|
|
591
648
|
}
|
|
@@ -594,10 +651,10 @@ const TagBox = styled(({ className, data = [], placeholder = "Select tags", arro
|
|
|
594
651
|
}
|
|
595
652
|
update();
|
|
596
653
|
}, placeholder: placeholder, size: size, readOnly: !(searchable || allowCustomValue), "data-disabled": disabled }))] }) }), clearable &&
|
|
597
|
-
(((_f = _value === null || _value === void 0 ? void 0 : _value.length) !== null && _f !== void 0 ? _f : 0) > 0 || !!((_g = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _g === void 0 ? void 0 : _g.value)) ? (_jsx(ClearButton, {
|
|
654
|
+
(((_f = _value === null || _value === void 0 ? void 0 : _value.length) !== null && _f !== void 0 ? _f : 0) > 0 || !!((_g = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _g === void 0 ? void 0 : _g.value)) ? (_jsx(ClearButton, { onClick: handleClear, onMouseDown: (e) => {
|
|
598
655
|
e.preventDefault();
|
|
599
656
|
e.stopPropagation();
|
|
600
|
-
} })) : arrow ? (_jsx(ArrowButton, {
|
|
657
|
+
} })) : arrow ? (_jsx(ArrowButton, { onClick: (e) => {
|
|
601
658
|
e.preventDefault();
|
|
602
659
|
}, onMouseDown: (e) => {
|
|
603
660
|
e.preventDefault();
|
|
@@ -618,16 +675,17 @@ const TagBox = styled(({ className, data = [], placeholder = "Select tags", arro
|
|
|
618
675
|
e.preventDefault();
|
|
619
676
|
e.stopPropagation();
|
|
620
677
|
handleItemClick(item);
|
|
621
|
-
}, "data-highlighted": (preSelected === null || preSelected === void 0 ? void 0 : preSelected.value) === item.value, "data-disabled": item.disabled,
|
|
678
|
+
}, "data-highlighted": (preSelected === null || preSelected === void 0 ? void 0 : preSelected.value) === item.value, "data-disabled": item.disabled, size: size, children: (renderOption === null || renderOption === void 0 ? void 0 : renderOption(item)) || (_jsx(_Fragment, { children: typeof item === "string"
|
|
622
679
|
? item
|
|
623
680
|
: item === null || item === void 0 ? void 0 : item.label })) }, index) }, index));
|
|
624
681
|
})] }, group.label)))
|
|
625
682
|
: filteredItems.map((item, index) => {
|
|
626
683
|
return (_jsx(Tooltip, { content: OptionTooltip ? (_jsx(OptionTooltip, { data: item.data })) : null, side: "left", children: _jsx(StyledItem, { className: "mfFloatingItem", onClick: (e) => {
|
|
684
|
+
console.log("clicked");
|
|
627
685
|
e.preventDefault();
|
|
628
686
|
e.stopPropagation();
|
|
629
687
|
handleItemClick(item);
|
|
630
|
-
}, "data-highlighted": (preSelected === null || preSelected === void 0 ? void 0 : preSelected.value) === item.value, "data-disabled": item.disabled,
|
|
688
|
+
}, "data-highlighted": (preSelected === null || preSelected === void 0 ? void 0 : preSelected.value) === item.value, "data-disabled": item.disabled, size: size, children: (renderOption === null || renderOption === void 0 ? void 0 : renderOption(item)) || _jsx(_Fragment, { children: item === null || item === void 0 ? void 0 : item.label }) }, index) }, index));
|
|
631
689
|
}) }))] })) }) }))] }));
|
|
632
690
|
}) `
|
|
633
691
|
position: relative;
|
package/dist/TagBox/types.d.ts
CHANGED
|
@@ -32,7 +32,6 @@ export interface TagBoxProps {
|
|
|
32
32
|
debounceTime?: number;
|
|
33
33
|
sort?: boolean;
|
|
34
34
|
disabled?: boolean;
|
|
35
|
-
dynamicOptionHeight?: boolean;
|
|
36
35
|
renderOption?: (item: Option | string) => React.ReactNode;
|
|
37
36
|
renderTag?: (item: Option | string) => React.ReactNode;
|
|
38
37
|
OptionTooltip?: (props: {
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import TextareaAutosize from "react-textarea-autosize";
|
|
3
|
-
import { getControlSizeTokens } from "../core";
|
|
4
3
|
const TextArea = styled(TextareaAutosize) `
|
|
5
4
|
outline: none;
|
|
6
5
|
resize: none;
|
|
7
|
-
padding:
|
|
6
|
+
padding: 10px;
|
|
8
7
|
width: 100%;
|
|
9
8
|
height: 100%;
|
|
10
9
|
box-sizing: border-box;
|
|
11
10
|
|
|
12
11
|
font-family: ${({ theme }) => theme.typography.fontFamily};
|
|
13
12
|
color: ${(props) => props.theme.palette.text.primary};
|
|
14
|
-
font-size: ${({ size }) =>
|
|
13
|
+
font-size: ${({ size }) => size === "xs"
|
|
14
|
+
? "11px"
|
|
15
|
+
: size === "sm"
|
|
16
|
+
? "13px"
|
|
17
|
+
: size === "md"
|
|
18
|
+
? "15px"
|
|
19
|
+
: size === "lg"
|
|
20
|
+
? "17px"
|
|
21
|
+
: size === "xl"
|
|
22
|
+
? "19px"
|
|
23
|
+
: "13px"};
|
|
15
24
|
|
|
16
25
|
background-color: ${({ theme, variant }) => {
|
|
17
26
|
switch (variant) {
|
|
@@ -50,13 +59,18 @@ const TextArea = styled(TextareaAutosize) `
|
|
|
50
59
|
border: 1px solid ${(props) => props.theme.palette.primary.main};
|
|
51
60
|
}
|
|
52
61
|
|
|
53
|
-
&[disabled] {
|
|
54
|
-
cursor: not-allowed;
|
|
55
|
-
opacity: 0.5;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
62
|
::placeholder {
|
|
59
|
-
font-size: ${({ size }) =>
|
|
63
|
+
font-size: ${({ size }) => size === "xs"
|
|
64
|
+
? "10px"
|
|
65
|
+
: size === "sm"
|
|
66
|
+
? "12px"
|
|
67
|
+
: size === "md"
|
|
68
|
+
? "14px"
|
|
69
|
+
: size === "lg"
|
|
70
|
+
? "16px"
|
|
71
|
+
: size === "xl"
|
|
72
|
+
? "18px"
|
|
73
|
+
: "12px"};
|
|
60
74
|
}
|
|
61
75
|
`;
|
|
62
76
|
export default TextArea;
|
|
@@ -13,7 +13,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import styled from "styled-components";
|
|
14
14
|
import { FieldLabel } from "..";
|
|
15
15
|
import Input from "../Input/Input";
|
|
16
|
-
import { getControlSizeTokens } from "../core";
|
|
17
16
|
import { forwardRef, useState } from "react";
|
|
18
17
|
import { Eye, EyeOff, X } from "lucide-react";
|
|
19
18
|
const StyledContainer = styled.div `
|
|
@@ -36,9 +35,7 @@ const InputContainer = styled.div `
|
|
|
36
35
|
`;
|
|
37
36
|
const InputButton = styled.button `
|
|
38
37
|
position: absolute;
|
|
39
|
-
right:
|
|
40
|
-
width: ${({ size }) => `${getControlSizeTokens(size).adornmentWidth}px`};
|
|
41
|
-
height: 100%;
|
|
38
|
+
right: 8px;
|
|
42
39
|
background: none;
|
|
43
40
|
border: none;
|
|
44
41
|
cursor: pointer;
|
|
@@ -61,8 +58,8 @@ const InputButton = styled.button `
|
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
svg {
|
|
64
|
-
width:
|
|
65
|
-
height:
|
|
61
|
+
width: 16px;
|
|
62
|
+
height: 16px;
|
|
66
63
|
}
|
|
67
64
|
`;
|
|
68
65
|
export const TextInput = forwardRef((_a, ref) => {
|
|
@@ -80,14 +77,11 @@ export const TextInput = forwardRef((_a, ref) => {
|
|
|
80
77
|
};
|
|
81
78
|
// Enhanced features: password or clearable functionality
|
|
82
79
|
const inputType = password && !passwordVisible ? "password" : type || "text";
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
? { paddingRight: `${adornmentWidth}px` }
|
|
86
|
-
: {}));
|
|
87
|
-
return (_jsxs(StyledContainer, { className: className, colSpan: colSpan, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(InputContainer, { children: [_jsx(Input, Object.assign({ ref: ref, value: value, size: size, type: inputType, style: inputStyle }, inputProps, rest)), password ? (_jsx(InputButton, { size: size, onClick: handlePasswordToggle, onMouseDown: (e) => {
|
|
80
|
+
const inputStyle = Object.assign(Object.assign({}, style), (password || (clearable && value) ? { paddingRight: "36px" } : {}));
|
|
81
|
+
return (_jsxs(StyledContainer, { className: className, colSpan: colSpan, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(InputContainer, { children: [_jsx(Input, Object.assign({ ref: ref, value: value, size: size, type: inputType, style: inputStyle }, inputProps, rest)), password ? (_jsx(InputButton, { onClick: handlePasswordToggle, onMouseDown: (e) => {
|
|
88
82
|
e.preventDefault();
|
|
89
83
|
e.stopPropagation();
|
|
90
|
-
}, tabIndex: -1, type: "button", children: passwordVisible ? _jsx(Eye, {}) : _jsx(EyeOff, {}) })) : clearable && value ? (_jsx(InputButton, {
|
|
84
|
+
}, tabIndex: -1, type: "button", children: passwordVisible ? _jsx(Eye, {}) : _jsx(EyeOff, {}) })) : clearable && value ? (_jsx(InputButton, { onClick: handleClear, onMouseDown: (e) => {
|
|
91
85
|
e.preventDefault();
|
|
92
86
|
e.stopPropagation();
|
|
93
87
|
}, tabIndex: -1, type: "button", children: _jsx(X, {}) })) : null] })] }));
|
|
@@ -7,7 +7,6 @@ import moment from "moment";
|
|
|
7
7
|
// When `timestamp` is empty, segment values fall back to placeholders so the
|
|
8
8
|
// DateInput can still render an editable structure.
|
|
9
9
|
export default function parseTimestamp(timestamp, format, utc = false) {
|
|
10
|
-
var _a;
|
|
11
10
|
// Supported format tokens and how each token maps to a segment type.
|
|
12
11
|
// `momentType` is used by consumers that need to know which unit the
|
|
13
12
|
// segment represents in Moment's terminology.
|
|
@@ -41,7 +40,7 @@ export default function parseTimestamp(timestamp, format, utc = false) {
|
|
|
41
40
|
// Break the format into ordered parts while keeping separators.
|
|
42
41
|
// Example: "MM/DD/YYYY HH:mm" => ["MM", "/", "DD", "/", "YYYY", " ", "HH", ":", "mm"]
|
|
43
42
|
function splitFormat(format) {
|
|
44
|
-
return format.split(/(YYYY|MM|DD|HH|h|mm|ss|SSS|
|
|
43
|
+
return format.split(/(YYYY|MM|DD|HH|h|mm|ss|SSS|Z)/).filter((s) => s);
|
|
45
44
|
}
|
|
46
45
|
// Convert each format part into a known token descriptor.
|
|
47
46
|
// Unknown parts are treated as literal separators.
|
|
@@ -58,19 +57,15 @@ export default function parseTimestamp(timestamp, format, utc = false) {
|
|
|
58
57
|
index: -1,
|
|
59
58
|
};
|
|
60
59
|
}
|
|
61
|
-
const parsedTimestamp = timestamp
|
|
62
|
-
? utc === true
|
|
63
|
-
? moment.utc(timestamp)
|
|
64
|
-
: moment(timestamp)
|
|
65
|
-
: null;
|
|
66
|
-
const hasValidTimestamp = (_a = parsedTimestamp === null || parsedTimestamp === void 0 ? void 0 : parsedTimestamp.isValid()) !== null && _a !== void 0 ? _a : false;
|
|
67
60
|
// Build the final Segment[] in format order.
|
|
68
61
|
// For date/time tokens, format the timestamp using local or UTC mode.
|
|
69
|
-
// For separators (or empty
|
|
62
|
+
// For separators (or empty timestamp), use the placeholder as the value.
|
|
70
63
|
const segments = splitFormat(format).map((segment, i) => {
|
|
71
64
|
const { pattern, placeholder, type, momentType } = matchSegment(segment);
|
|
72
|
-
const value =
|
|
73
|
-
?
|
|
65
|
+
const value = timestamp
|
|
66
|
+
? utc === true
|
|
67
|
+
? moment.utc(timestamp).format(pattern)
|
|
68
|
+
: moment(timestamp).format(pattern)
|
|
74
69
|
: placeholder;
|
|
75
70
|
return {
|
|
76
71
|
value,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import Size from "./Types/Size";
|
|
2
1
|
interface ArrowButtonProps {
|
|
3
2
|
className?: string;
|
|
4
|
-
size?: Size;
|
|
5
3
|
[key: string]: React.ButtonHTMLAttributes<HTMLButtonElement> | any;
|
|
6
4
|
}
|
|
7
5
|
declare const ArrowButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ArrowButtonProps, never>> & string & Omit<({ className, ...props }: ArrowButtonProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
package/dist/core/ArrowButton.js
CHANGED
|
@@ -12,10 +12,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { ChevronDownIcon } from "lucide-react";
|
|
14
14
|
import styled from "styled-components";
|
|
15
|
-
import { DEFAULT_CONTROL_SIZE, getControlSizeTokens } from "./controlSizes";
|
|
16
15
|
const ArrowIcon = styled((_a) => {
|
|
17
16
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
-
return (_jsx("div", Object.assign({ className: className }, props, { children: _jsx(ChevronDownIcon, { size:
|
|
17
|
+
return (_jsx("div", Object.assign({ className: className }, props, { children: _jsx(ChevronDownIcon, { size: 16 }) })));
|
|
19
18
|
}) `
|
|
20
19
|
color: ${(props) => props.theme.palette.text.secondary};
|
|
21
20
|
transition: transform 0.2s ease-in-out;
|
|
@@ -29,19 +28,16 @@ const ArrowIcon = styled((_a) => {
|
|
|
29
28
|
`;
|
|
30
29
|
const ArrowButton = styled((_a) => {
|
|
31
30
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
32
|
-
return (_jsx("button", Object.assign({ className: className }, props, { tabIndex: -1, "data-default-btn": true, children: _jsx(ArrowIcon, {
|
|
31
|
+
return (_jsx("button", Object.assign({ className: className }, props, { tabIndex: -1, "data-default-btn": true, children: _jsx(ArrowIcon, {}) })));
|
|
33
32
|
}) `
|
|
34
33
|
position: absolute;
|
|
35
34
|
right: 0;
|
|
36
35
|
height: 100%;
|
|
37
|
-
|
|
36
|
+
padding-inline: 10px;
|
|
38
37
|
background: none;
|
|
39
38
|
border: none;
|
|
40
39
|
cursor: pointer;
|
|
41
40
|
margin: 0;
|
|
42
41
|
outline: none;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
justify-content: center;
|
|
46
42
|
`;
|
|
47
43
|
export default ArrowButton;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import Size from "./Types/Size";
|
|
2
1
|
interface ClearButtonProps {
|
|
3
2
|
className?: string;
|
|
4
|
-
size?: Size;
|
|
5
3
|
[key: string]: React.ButtonHTMLAttributes<HTMLButtonElement> | any;
|
|
6
4
|
}
|
|
7
5
|
declare const ClearButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ClearButtonProps, never>> & string & Omit<({ className, ...props }: ClearButtonProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
package/dist/core/ClearButton.js
CHANGED
|
@@ -12,10 +12,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { X } from "lucide-react";
|
|
14
14
|
import styled from "styled-components";
|
|
15
|
-
import { DEFAULT_CONTROL_SIZE, getControlSizeTokens } from "./controlSizes";
|
|
16
15
|
const ClearIcon = styled((_a) => {
|
|
17
16
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
-
return (_jsx("div", Object.assign({ className: className }, props, { children: _jsx(X, { size:
|
|
17
|
+
return (_jsx("div", Object.assign({ className: className }, props, { children: _jsx(X, { size: 16 }) })));
|
|
19
18
|
}) `
|
|
20
19
|
color: ${(props) => props.theme.palette.text.secondary};
|
|
21
20
|
transition: transform 0.2s ease-in-out;
|
|
@@ -29,19 +28,16 @@ const ClearIcon = styled((_a) => {
|
|
|
29
28
|
`;
|
|
30
29
|
const ClearButton = styled((_a) => {
|
|
31
30
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
32
|
-
return (_jsx("button", Object.assign({ className: className }, props, { tabIndex: -1, "data-default-btn": true, children: _jsx(ClearIcon, {
|
|
31
|
+
return (_jsx("button", Object.assign({ className: className }, props, { tabIndex: -1, "data-default-btn": true, children: _jsx(ClearIcon, {}) })));
|
|
33
32
|
}) `
|
|
34
33
|
position: absolute;
|
|
35
34
|
right: 0;
|
|
36
35
|
height: 100%;
|
|
37
|
-
|
|
36
|
+
padding-inline: 10px;
|
|
38
37
|
background: none;
|
|
39
38
|
border: none;
|
|
40
39
|
cursor: pointer;
|
|
41
40
|
margin: 0;
|
|
42
41
|
outline: none;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
justify-content: center;
|
|
46
42
|
`;
|
|
47
43
|
export default ClearButton;
|
|
@@ -26,7 +26,7 @@ const CONTROL_SIZE_TOKENS = {
|
|
|
26
26
|
pillPaddingX: 6,
|
|
27
27
|
pillIconSize: 10,
|
|
28
28
|
pillGap: 4,
|
|
29
|
-
segmentedHeight:
|
|
29
|
+
segmentedHeight: 24,
|
|
30
30
|
segmentedFontSize: 11,
|
|
31
31
|
sectionTitleFontSize: 12,
|
|
32
32
|
sectionIconSize: 12,
|
|
@@ -57,7 +57,7 @@ const CONTROL_SIZE_TOKENS = {
|
|
|
57
57
|
pillPaddingX: 8,
|
|
58
58
|
pillIconSize: 12,
|
|
59
59
|
pillGap: 5,
|
|
60
|
-
segmentedHeight:
|
|
60
|
+
segmentedHeight: 28,
|
|
61
61
|
segmentedFontSize: 12,
|
|
62
62
|
sectionTitleFontSize: 13,
|
|
63
63
|
sectionIconSize: 12,
|
|
@@ -89,7 +89,7 @@ const CONTROL_SIZE_TOKENS = {
|
|
|
89
89
|
pillIconSize: 14,
|
|
90
90
|
pillGap: 5,
|
|
91
91
|
segmentedHeight: 32,
|
|
92
|
-
segmentedFontSize:
|
|
92
|
+
segmentedFontSize: 13,
|
|
93
93
|
sectionTitleFontSize: 14,
|
|
94
94
|
sectionIconSize: 14,
|
|
95
95
|
},
|
|
@@ -119,8 +119,8 @@ const CONTROL_SIZE_TOKENS = {
|
|
|
119
119
|
pillPaddingX: 12,
|
|
120
120
|
pillIconSize: 16,
|
|
121
121
|
pillGap: 5,
|
|
122
|
-
segmentedHeight:
|
|
123
|
-
segmentedFontSize:
|
|
122
|
+
segmentedHeight: 36,
|
|
123
|
+
segmentedFontSize: 14,
|
|
124
124
|
sectionTitleFontSize: 16,
|
|
125
125
|
sectionIconSize: 18,
|
|
126
126
|
},
|
|
@@ -150,8 +150,8 @@ const CONTROL_SIZE_TOKENS = {
|
|
|
150
150
|
pillPaddingX: 14,
|
|
151
151
|
pillIconSize: 18,
|
|
152
152
|
pillGap: 5,
|
|
153
|
-
segmentedHeight:
|
|
154
|
-
segmentedFontSize:
|
|
153
|
+
segmentedHeight: 44,
|
|
154
|
+
segmentedFontSize: 15,
|
|
155
155
|
sectionTitleFontSize: 18,
|
|
156
156
|
sectionIconSize: 24,
|
|
157
157
|
},
|
|
@@ -181,8 +181,8 @@ const CONTROL_SIZE_TOKENS = {
|
|
|
181
181
|
pillPaddingX: 16,
|
|
182
182
|
pillIconSize: 20,
|
|
183
183
|
pillGap: 5,
|
|
184
|
-
segmentedHeight:
|
|
185
|
-
segmentedFontSize:
|
|
184
|
+
segmentedHeight: 52,
|
|
185
|
+
segmentedFontSize: 16,
|
|
186
186
|
sectionTitleFontSize: 20,
|
|
187
187
|
sectionIconSize: 28,
|
|
188
188
|
},
|