@grasp-labs/ds-react-components 0.13.0
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/LICENSE +201 -0
- package/README.md +52 -0
- package/dist/assets/fonts/Inter-VariableFont_opsz,wght.ttf +0 -0
- package/dist/components/advancedFilter/AdvancedFilter.d.ts +8 -0
- package/dist/components/advancedFilter/AdvancedFilterRow.d.ts +7 -0
- package/dist/components/advancedFilter/index.d.ts +4 -0
- package/dist/components/advancedFilter/types.d.ts +43 -0
- package/dist/components/advancedFilter/utils.d.ts +3 -0
- package/dist/components/alert/Alert.d.ts +19 -0
- package/dist/components/alert/index.d.ts +1 -0
- package/dist/components/animatedList/AnimatedList.d.ts +19 -0
- package/dist/components/animatedList/hooks/useLayoutAnimation.d.ts +9 -0
- package/dist/components/animatedList/index.d.ts +2 -0
- package/dist/components/animatedList/types.d.ts +19 -0
- package/dist/components/baseButton/BaseButton.d.ts +13 -0
- package/dist/components/baseButton/index.d.ts +1 -0
- package/dist/components/baseTextBox/BaseTextBox.d.ts +40 -0
- package/dist/components/baseTextBox/index.d.ts +1 -0
- package/dist/components/baseTextBox/useInputValidation.d.ts +3 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +29 -0
- package/dist/components/breadcrumb/index.d.ts +1 -0
- package/dist/components/button/Button.d.ts +15 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/card/Card.d.ts +27 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +17 -0
- package/dist/components/checkbox/CheckboxIcon.d.ts +14 -0
- package/dist/components/checkbox/index.d.ts +4 -0
- package/dist/components/dialog/ConfirmationDialog.d.ts +36 -0
- package/dist/components/dialog/Dialog.d.ts +31 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dynamicIcon/DynamicIcon.d.ts +8 -0
- package/dist/components/dynamicIcon/index.d.ts +2 -0
- package/dist/components/field/Field.d.ts +82 -0
- package/dist/components/field/index.d.ts +16 -0
- package/dist/components/flow/FlowTile.d.ts +3 -0
- package/dist/components/flow/MetadataList.d.ts +6 -0
- package/dist/components/flow/StatusIcon.d.ts +5 -0
- package/dist/components/flow/TileHeader.d.ts +8 -0
- package/dist/components/flow/index.d.ts +2 -0
- package/dist/components/flow/types.d.ts +15 -0
- package/dist/components/iconButton/IconButton.d.ts +15 -0
- package/dist/components/iconButton/index.d.ts +1 -0
- package/dist/components/jsonEditor/JsonEditor.d.ts +7 -0
- package/dist/components/jsonEditor/index.d.ts +1 -0
- package/dist/components/list/List.d.ts +28 -0
- package/dist/components/list/ListItem.d.ts +20 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/logo/Logo.d.ts +5 -0
- package/dist/components/logo/index.d.ts +2 -0
- package/dist/components/menu/Menu.d.ts +51 -0
- package/dist/components/menu/MenuEntry.d.ts +73 -0
- package/dist/components/menu/MenuFooter.d.ts +23 -0
- package/dist/components/menu/index.d.ts +11 -0
- package/dist/components/multiSelect/MultiSelect.d.ts +28 -0
- package/dist/components/multiSelect/index.d.ts +2 -0
- package/dist/components/popover/Popover.d.ts +60 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/radioButton/RadioButton.d.ts +29 -0
- package/dist/components/radioButton/index.d.ts +2 -0
- package/dist/components/select/Select.d.ts +30 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/tabPanel/Tab.d.ts +22 -0
- package/dist/components/tabPanel/TabPanel.d.ts +20 -0
- package/dist/components/tabPanel/index.d.ts +2 -0
- package/dist/components/tabPanel/useTabKeyboard.d.ts +16 -0
- package/dist/components/table/Table.d.ts +33 -0
- package/dist/components/table/TableCell.d.ts +17 -0
- package/dist/components/table/TableHeaderCell.d.ts +17 -0
- package/dist/components/table/components/Pagination.d.ts +21 -0
- package/dist/components/table/components/index.d.ts +1 -0
- package/dist/components/table/index.d.ts +6 -0
- package/dist/components/tag/Tag.d.ts +18 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/tagList/TagList.d.ts +20 -0
- package/dist/components/tagList/index.d.ts +2 -0
- package/dist/components/tagList/utils.d.ts +2 -0
- package/dist/components/textBox/TextBox.d.ts +8 -0
- package/dist/components/textBox/index.d.ts +1 -0
- package/dist/components/toast/Toast.d.ts +2 -0
- package/dist/components/toast/Toaster.d.ts +10 -0
- package/dist/components/toast/index.d.ts +3 -0
- package/dist/components/toast/types.d.ts +22 -0
- package/dist/components/typography/Typography.d.ts +27 -0
- package/dist/components/typography/index.d.ts +2 -0
- package/dist/components/unstyledButton/UnstyledButton.d.ts +12 -0
- package/dist/components/unstyledButton/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useArrowNavigation.d.ts +30 -0
- package/dist/hooks/useResizeObserver.d.ts +1 -0
- package/dist/hooks/useViewportCollision.d.ts +7 -0
- package/dist/icons/icons.d.ts +256 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/index-CQ7w5dl6.js +8258 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.esm-DgyjJxy1.js +786 -0
- package/dist/index.js +92 -0
- package/dist/tailwind-styles.css +229 -0
- package/dist/test/setup.d.ts +0 -0
- package/dist/types/BaseOption.d.ts +5 -0
- package/dist/types/IconComponent.d.ts +6 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +94 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets \"[]\"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same \"printed page\" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [2025] [Aider AS]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the \"License\");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an \"AS IS\" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @grasp-labs/ds-react-components
|
|
2
|
+
|
|
3
|
+
A modern React component library built with TypeScript, Vite, and Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
To use this package, run
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @grasp-labs/ds-react-components
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
To use the components in your project, first install and configure Tailwind CSS with our custom configuration:
|
|
16
|
+
|
|
17
|
+
1. Install required dependencies:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -D tailwindcss @tailwindcss/vite
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. Import our pre-configured styles directly into your CSS file:
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
@import "@grasp-labs/ds-react-components/tailwind-styles.css";
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. Use components in your application:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { Button } from "@grasp-labs/ds-react-components";
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Development
|
|
36
|
+
|
|
37
|
+
To run Storybook locally for development and testing:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install
|
|
41
|
+
npm run storybook
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This launches Storybook at `http://localhost:6006`, where you can browse and interact with all components.
|
|
45
|
+
|
|
46
|
+
## Testing
|
|
47
|
+
|
|
48
|
+
Tests run using Storybook's vitest integration, either using the GUI Storybook or from the CLI:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm run test
|
|
52
|
+
```
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { BaseOption } from '../../types/BaseOption';
|
|
3
|
+
import { AdvancedFilterProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* A complex filtering component that allows users to build advanced filter criteria
|
|
6
|
+
* with multiple rows of attribute-condition-value combinations.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AdvancedFilter: <Attribute extends BaseOption = BaseOption, Condition extends BaseOption = BaseOption>({ filters, attributes, conditions, onFiltersChange, addFilterText, removeFilterText, attributePlaceholder, conditionPlaceholder, valuePlaceholder, attributeLabel, conditionLabel, valueLabel, className, maxFilters, }: AdvancedFilterProps<Attribute, Condition>) => ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseOption } from '../../types/BaseOption';
|
|
2
|
+
import { FilterRowProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A single filter row component that contains attribute, condition, and value inputs.
|
|
5
|
+
* Used within the AdvancedFilter component to build complex filtering interfaces.
|
|
6
|
+
*/
|
|
7
|
+
export declare const AdvancedFilterRow: <Attribute extends BaseOption = BaseOption, Condition extends BaseOption = BaseOption>({ id, filter, attributes, conditions, onFilterChange, onRemove, enableRemoval, attributePlaceholder, conditionPlaceholder, valuePlaceholder, attributeLabel, conditionLabel, valueLabel, removeFilterText, }: FilterRowProps<Attribute, Condition>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BaseOption } from '../../types/BaseOption';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a single filter criteria with attribute-condition-value structure.
|
|
4
|
+
* Used to build complex filtering logic where users can specify multiple conditions.
|
|
5
|
+
*/
|
|
6
|
+
export type FilterRow<Attribute extends BaseOption = BaseOption, Condition extends BaseOption = BaseOption> = {
|
|
7
|
+
id: string;
|
|
8
|
+
attribute: NoInfer<Attribute> | null;
|
|
9
|
+
condition: NoInfer<Condition> | null;
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
export type AdvancedFilterProps<Attribute extends BaseOption = BaseOption, Condition extends BaseOption = BaseOption> = {
|
|
13
|
+
filters: FilterRow<Attribute, Condition>[];
|
|
14
|
+
attributes: Attribute[];
|
|
15
|
+
conditions: Condition[];
|
|
16
|
+
onFiltersChange: (filters: FilterRow<Attribute, Condition>[]) => void;
|
|
17
|
+
addFilterText?: string;
|
|
18
|
+
removeFilterText?: string;
|
|
19
|
+
attributePlaceholder?: string;
|
|
20
|
+
conditionPlaceholder?: string;
|
|
21
|
+
valuePlaceholder?: string;
|
|
22
|
+
attributeLabel?: string;
|
|
23
|
+
conditionLabel?: string;
|
|
24
|
+
valueLabel?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
maxFilters?: number;
|
|
27
|
+
};
|
|
28
|
+
export type FilterRowProps<Attribute extends BaseOption = BaseOption, Condition extends BaseOption = BaseOption> = {
|
|
29
|
+
id: string;
|
|
30
|
+
filter: FilterRow<Attribute, Condition>;
|
|
31
|
+
attributes: Attribute[];
|
|
32
|
+
conditions: Condition[];
|
|
33
|
+
onFilterChange: (filter: FilterRow<Attribute, Condition>) => void;
|
|
34
|
+
onRemove: () => void;
|
|
35
|
+
attributePlaceholder?: string;
|
|
36
|
+
conditionPlaceholder?: string;
|
|
37
|
+
valuePlaceholder?: string;
|
|
38
|
+
attributeLabel?: string;
|
|
39
|
+
conditionLabel?: string;
|
|
40
|
+
valueLabel?: string;
|
|
41
|
+
removeFilterText?: string;
|
|
42
|
+
enableRemoval?: boolean;
|
|
43
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type AlertProps = {
|
|
3
|
+
/** The variant/severity of the alert */
|
|
4
|
+
variant?: "info" | "error" | "success" | "warning";
|
|
5
|
+
/** The main text content of the alert */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Optional content to display in the right slot area */
|
|
8
|
+
slot?: ReactNode;
|
|
9
|
+
/** Optional additional class names for styling */
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* An alert component for displaying informational messages with different severity levels.
|
|
14
|
+
* Supports four variants: info, error, success, and warning, each with its own styling and icon.
|
|
15
|
+
*
|
|
16
|
+
* @param props - The props for the Alert component
|
|
17
|
+
* @returns The rendered alert with icon, message, and optional slot content
|
|
18
|
+
*/
|
|
19
|
+
export declare const Alert: ({ variant, children, slot, className, }: AlertProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Alert, type AlertProps } from './Alert';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AnimatedListProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* AnimatedList component that provides smooth layout animations when list items
|
|
4
|
+
* change position, are added, or removed.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <AnimatedList
|
|
9
|
+
* items={toasts}
|
|
10
|
+
* getKey={(toast) => toast.id}
|
|
11
|
+
* renderItem={(toast, index) => (
|
|
12
|
+
* <Toast {...toast} index={index} />
|
|
13
|
+
* )}
|
|
14
|
+
* animation={{ duration: 300, easing: "ease-out" }}
|
|
15
|
+
* className="flex flex-col gap-2"
|
|
16
|
+
* />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function AnimatedList<T>({ items, getKey, renderItem, animation, className, }: AnimatedListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LayoutAnimationConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Internal hook for smooth layout animations when elements change position.
|
|
4
|
+
* Uses the FLIP technique (First, Last, Invert, Play).
|
|
5
|
+
*
|
|
6
|
+
* @param options - Animation options
|
|
7
|
+
* @param dependencies - Dependencies that trigger position changes (e.g., items array)
|
|
8
|
+
*/
|
|
9
|
+
export declare function useLayoutAnimation<T extends HTMLElement>(options: LayoutAnimationConfig, dependencies: React.DependencyList): import('react').RefObject<T | null>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type LayoutAnimationConfig = {
|
|
2
|
+
/**
|
|
3
|
+
* Animation duration in milliseconds
|
|
4
|
+
* @default 300
|
|
5
|
+
*/
|
|
6
|
+
duration?: number;
|
|
7
|
+
/**
|
|
8
|
+
* CSS easing function
|
|
9
|
+
* @default "ease-out"
|
|
10
|
+
*/
|
|
11
|
+
easing?: string;
|
|
12
|
+
};
|
|
13
|
+
export type AnimatedListProps<T> = {
|
|
14
|
+
items: T[];
|
|
15
|
+
getKey: (item: T) => string | number;
|
|
16
|
+
renderItem: (item: T, index: number) => React.ReactNode;
|
|
17
|
+
animation?: LayoutAnimationConfig;
|
|
18
|
+
className?: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export type BaseButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
|
+
variant?: "contained" | "outlined" | "text";
|
|
4
|
+
color?: "primary" | "secondary" | "danger";
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A foundational button component with configurable variants and color schemes.
|
|
8
|
+
* Provides consistent styling and behavior for all button-based components.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The props for the BaseButton component.
|
|
11
|
+
* @returns The rendered button element.
|
|
12
|
+
*/
|
|
13
|
+
export declare const BaseButton: ({ variant, color, className, children, ...props }: BaseButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BaseButton';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { InputHTMLAttributes, JSX, ReactNode } from 'react';
|
|
2
|
+
export type AcceptOnlyPattern = "number" | "integer" | "alphanumeric" | "alpha" | "decimal";
|
|
3
|
+
export type BaseTextBoxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "children"> & {
|
|
4
|
+
/** Optional prefix element (e.g. icon, button) */
|
|
5
|
+
prefixContent?: ReactNode;
|
|
6
|
+
/** Optional suffix element (e.g. icon, button) */
|
|
7
|
+
suffixContent?: ReactNode;
|
|
8
|
+
/** Whether the textbox is in an error state */
|
|
9
|
+
error?: boolean;
|
|
10
|
+
/** Whether the textbox is disabled */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Optional id (auto-generated if not provided) */
|
|
13
|
+
id?: string;
|
|
14
|
+
/** Name of the textbox */
|
|
15
|
+
name?: string;
|
|
16
|
+
/** Additional class names for the container */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Additional class names for the root element */
|
|
19
|
+
rootClassName?: string;
|
|
20
|
+
/** Placeholder text */
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
/** Ref for the input element */
|
|
23
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
24
|
+
/**
|
|
25
|
+
* Restricts input to only accept specified values.
|
|
26
|
+
* Can be a predefined pattern ("number", "integer", "alphanumeric", "alpha", "decimal")
|
|
27
|
+
* or a custom filter function that returns the filtered/corrected string.
|
|
28
|
+
*/
|
|
29
|
+
acceptOnly?: AcceptOnlyPattern | ((value: string) => string);
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* BaseTextBox is a customizable text input component that supports optional prefix and suffix elements,
|
|
33
|
+
* error state styling, and additional container class names. It wraps a standard HTML input element and
|
|
34
|
+
* provides enhanced UI features such as icons or buttons before or after the input.
|
|
35
|
+
*
|
|
36
|
+
* @param props - Props for input customization and prefix/suffix rendering.
|
|
37
|
+
* @param ref - Ref forwarded to the native input element.
|
|
38
|
+
* @returns {JSX.Element} The rendered BaseTextBox component.
|
|
39
|
+
*/
|
|
40
|
+
export declare const BaseTextBox: ({ className, prefixContent, suffixContent, error, onChange, disabled, ref, id, name, rootClassName, type, acceptOnly, ...rest }: BaseTextBoxProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BaseTextBox';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AcceptOnlyPattern } from './BaseTextBox';
|
|
2
|
+
export declare const filterValue: (value: string, acceptOnly?: AcceptOnlyPattern | ((value: string) => string)) => string;
|
|
3
|
+
export declare const useInputValidation: (acceptOnly?: AcceptOnlyPattern | ((value: string) => string), disabled?: boolean, onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void) => (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for a single breadcrumb item.
|
|
3
|
+
*
|
|
4
|
+
* @property label - The display text for the breadcrumb item.
|
|
5
|
+
* @property onClick - Optional click handler for the breadcrumb item.
|
|
6
|
+
* @property disabled - Whether the breadcrumb item is disabled.
|
|
7
|
+
*/
|
|
8
|
+
export type BreadcrumbItem = {
|
|
9
|
+
label: string;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Props for the Breadcrumb component.
|
|
15
|
+
*
|
|
16
|
+
* @property items - Array of breadcrumb items to display.
|
|
17
|
+
* @property className - Optional additional class names for the breadcrumb container.
|
|
18
|
+
*/
|
|
19
|
+
export type BreadcrumbProps = {
|
|
20
|
+
items: BreadcrumbItem[];
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Renders a breadcrumb navigation component.
|
|
25
|
+
*
|
|
26
|
+
* @param props - {@link BreadcrumbProps}
|
|
27
|
+
* @returns The breadcrumb navigation element.
|
|
28
|
+
*/
|
|
29
|
+
export declare const Breadcrumb: ({ items, className }: BreadcrumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Breadcrumb';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseButtonProps } from '../baseButton';
|
|
3
|
+
export type ButtonProps = BaseButtonProps & {
|
|
4
|
+
size?: "small" | "medium" | "large";
|
|
5
|
+
prefixContent?: ReactNode;
|
|
6
|
+
suffixContent?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A button component with size variants and optional prefix/suffix content.
|
|
10
|
+
* Extends BaseButton with additional size and content functionality.
|
|
11
|
+
*
|
|
12
|
+
* @param props - The props for the Button component.
|
|
13
|
+
* @returns The rendered button with optional prefix/suffix content.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Button: ({ size, className, children, prefixContent, suffixContent, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type CardProps = {
|
|
3
|
+
/** Optional title text displayed in the header section */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** React elements to display in the header actions area (top-right) */
|
|
6
|
+
headerActions?: ReactNode;
|
|
7
|
+
/** React elements to display in the footer actions area (bottom) */
|
|
8
|
+
footerActions?: ReactNode;
|
|
9
|
+
/** Main content to display in the card body */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/** Additional CSS classes for the card container */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Additional CSS classes for the header section */
|
|
14
|
+
headerClassName?: string;
|
|
15
|
+
/** Additional CSS classes for the body section */
|
|
16
|
+
bodyClassName?: string;
|
|
17
|
+
/** Additional CSS classes for the footer section */
|
|
18
|
+
footerClassName?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A flexible card component with optional header, body, and footer sections.
|
|
22
|
+
* Supports custom styling for each section and follows the Figma design specifications.
|
|
23
|
+
*
|
|
24
|
+
* @param props - The props for the Card component
|
|
25
|
+
* @returns The rendered card with optional header, body, and footer sections
|
|
26
|
+
*/
|
|
27
|
+
export declare const Card: ({ title, headerActions, footerActions, children, className, headerClassName, bodyClassName, footerClassName, }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Card';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
|
+
export type CheckboxProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
3
|
+
/** The visible label text for the checkbox */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Whether the checkbox is currently partially selected */
|
|
6
|
+
intermediate?: boolean;
|
|
7
|
+
/** Whether the checkbox is in an error state */
|
|
8
|
+
error?: boolean;
|
|
9
|
+
/** Optional extra content (e.g. tooltip, icon) */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/** Ref for the input element */
|
|
12
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A custom checkbox component with native input styling.
|
|
16
|
+
*/
|
|
17
|
+
export declare const Checkbox: ({ value, label, error, checked, intermediate, disabled, onChange, className, children, ref, id, name, ...rest }: CheckboxProps) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CheckboxIconProps = {
|
|
2
|
+
checked?: boolean;
|
|
3
|
+
intermediate?: boolean;
|
|
4
|
+
error?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A visual icon component for checkbox states supporting checked, intermediate, error, and disabled states.
|
|
10
|
+
*
|
|
11
|
+
* @param props - The props for the CheckboxIcon component.
|
|
12
|
+
* @returns The rendered checkbox icon.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CheckboxIcon: ({ error, checked, intermediate, disabled, className, }: CheckboxIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DialogProps } from './Dialog';
|
|
2
|
+
import { ButtonProps } from '../button/Button';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the ConfirmationDialog component.
|
|
5
|
+
*
|
|
6
|
+
* Extends all Dialog props except `footerActions`, which is automatically
|
|
7
|
+
* generated with confirm and cancel buttons.
|
|
8
|
+
*/
|
|
9
|
+
export type ConfirmationDialogProps = Omit<DialogProps, "footerActions"> & {
|
|
10
|
+
/** Callback function called when the confirm button is clicked */
|
|
11
|
+
onConfirm: () => void;
|
|
12
|
+
/** Label for the confirm button @default "Confirm" */
|
|
13
|
+
confirmLabel?: string;
|
|
14
|
+
/** Label for the cancel button @default "Cancel" */
|
|
15
|
+
cancelLabel?: string;
|
|
16
|
+
/** Props for the confirm button @default { variant: "contained", color: "primary" } */
|
|
17
|
+
confirmButtonProps?: Omit<ButtonProps, "onClick" | "children">;
|
|
18
|
+
/** Props for the cancel button @default { variant: "outlined", color: "secondary" } */
|
|
19
|
+
cancelButtonProps?: Omit<ButtonProps, "onClick" | "children">;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A specialized dialog component for confirmation scenarios with built-in confirm and cancel buttons.
|
|
23
|
+
*
|
|
24
|
+
* This component extends the base Dialog with predefined footer actions, making it ideal for
|
|
25
|
+
* confirmation prompts, delete confirmations, and other binary choice scenarios.
|
|
26
|
+
*
|
|
27
|
+
* Features:
|
|
28
|
+
* - Pre-configured confirm and cancel buttons
|
|
29
|
+
* - Customizable button labels and styling
|
|
30
|
+
* - Inherits all Dialog functionality (backdrop click, escape key, etc.)
|
|
31
|
+
* - Consistent button layout and spacing
|
|
32
|
+
*
|
|
33
|
+
* @param props - The props for the ConfirmationDialog component
|
|
34
|
+
* @returns A rendered confirmation dialog with confirm/cancel buttons
|
|
35
|
+
*/
|
|
36
|
+
export declare const ConfirmationDialog: ({ onConfirm, onClose, confirmLabel, cancelLabel, confirmButtonProps, cancelButtonProps, ...dialogProps }: ConfirmationDialogProps) => import("react/jsx-runtime").JSX.Element;
|