@db-ux/react-core-components 1.0.0-test-13b991d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -0
- package/dist/components/accordion/accordion.d.ts +3 -0
- package/dist/components/accordion/accordion.js +92 -0
- package/dist/components/accordion/index.d.ts +1 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/accordion/model.d.ts +41 -0
- package/dist/components/accordion/model.js +2 -0
- package/dist/components/accordion-item/accordion-item.d.ts +8 -0
- package/dist/components/accordion-item/accordion-item.js +34 -0
- package/dist/components/accordion-item/index.d.ts +1 -0
- package/dist/components/accordion-item/index.js +1 -0
- package/dist/components/accordion-item/model.d.ts +24 -0
- package/dist/components/accordion-item/model.js +1 -0
- package/dist/components/badge/badge.d.ts +3 -0
- package/dist/components/badge/badge.js +32 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/badge/model.d.ts +16 -0
- package/dist/components/badge/model.js +1 -0
- package/dist/components/brand/brand.d.ts +3 -0
- package/dist/components/brand/brand.js +13 -0
- package/dist/components/brand/index.d.ts +1 -0
- package/dist/components/brand/index.js +1 -0
- package/dist/components/brand/model.d.ts +10 -0
- package/dist/components/brand/model.js +1 -0
- package/dist/components/button/button.d.ts +3 -0
- package/dist/components/button/button.js +16 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button/model.d.ts +52 -0
- package/dist/components/button/model.js +3 -0
- package/dist/components/card/card.d.ts +3 -0
- package/dist/components/card/card.js +16 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/card/model.d.ts +18 -0
- package/dist/components/card/model.js +2 -0
- package/dist/components/checkbox/checkbox.d.ts +3 -0
- package/dist/components/checkbox/checkbox.js +112 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/checkbox/model.d.ts +10 -0
- package/dist/components/checkbox/model.js +1 -0
- package/dist/components/divider/divider.d.ts +3 -0
- package/dist/components/divider/divider.js +11 -0
- package/dist/components/divider/index.d.ts +1 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/divider/model.d.ts +18 -0
- package/dist/components/divider/model.js +2 -0
- package/dist/components/drawer/drawer.d.ts +3 -0
- package/dist/components/drawer/drawer.js +70 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/drawer/model.d.ts +41 -0
- package/dist/components/drawer/model.js +3 -0
- package/dist/components/header/header.d.ts +3 -0
- package/dist/components/header/header.js +68 -0
- package/dist/components/header/index.d.ts +1 -0
- package/dist/components/header/index.js +1 -0
- package/dist/components/header/model.d.ts +44 -0
- package/dist/components/header/model.js +1 -0
- package/dist/components/icon/icon.d.ts +3 -0
- package/dist/components/icon/icon.js +11 -0
- package/dist/components/icon/index.d.ts +1 -0
- package/dist/components/icon/index.js +1 -0
- package/dist/components/icon/model.d.ts +12 -0
- package/dist/components/icon/model.js +2 -0
- package/dist/components/infotext/index.d.ts +1 -0
- package/dist/components/infotext/index.js +1 -0
- package/dist/components/infotext/infotext.d.ts +3 -0
- package/dist/components/infotext/infotext.js +12 -0
- package/dist/components/infotext/model.d.ts +5 -0
- package/dist/components/infotext/model.js +1 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input/input.d.ts +3 -0
- package/dist/components/input/input.js +119 -0
- package/dist/components/input/model.d.ts +39 -0
- package/dist/components/input/model.js +5 -0
- package/dist/components/link/index.d.ts +1 -0
- package/dist/components/link/index.js +1 -0
- package/dist/components/link/link.d.ts +3 -0
- package/dist/components/link/link.js +17 -0
- package/dist/components/link/model.d.ts +24 -0
- package/dist/components/link/model.js +3 -0
- package/dist/components/navigation/index.d.ts +1 -0
- package/dist/components/navigation/index.js +1 -0
- package/dist/components/navigation/model.d.ts +5 -0
- package/dist/components/navigation/model.js +1 -0
- package/dist/components/navigation/navigation.d.ts +3 -0
- package/dist/components/navigation/navigation.js +17 -0
- package/dist/components/navigation-item/index.d.ts +1 -0
- package/dist/components/navigation-item/index.js +1 -0
- package/dist/components/navigation-item/model.d.ts +34 -0
- package/dist/components/navigation-item/model.js +1 -0
- package/dist/components/navigation-item/navigation-item.d.ts +3 -0
- package/dist/components/navigation-item/navigation-item.js +68 -0
- package/dist/components/notification/index.d.ts +1 -0
- package/dist/components/notification/index.js +1 -0
- package/dist/components/notification/model.d.ts +57 -0
- package/dist/components/notification/model.js +3 -0
- package/dist/components/notification/notification.d.ts +3 -0
- package/dist/components/notification/notification.js +25 -0
- package/dist/components/page/index.d.ts +1 -0
- package/dist/components/page/index.js +1 -0
- package/dist/components/page/model.d.ts +32 -0
- package/dist/components/page/model.js +2 -0
- package/dist/components/page/page.d.ts +3 -0
- package/dist/components/page/page.js +47 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/model.d.ts +18 -0
- package/dist/components/popover/model.js +1 -0
- package/dist/components/popover/popover.d.ts +3 -0
- package/dist/components/popover/popover.js +74 -0
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/index.js +1 -0
- package/dist/components/radio/model.d.ts +7 -0
- package/dist/components/radio/model.js +1 -0
- package/dist/components/radio/radio.d.ts +3 -0
- package/dist/components/radio/radio.js +54 -0
- package/dist/components/section/index.d.ts +1 -0
- package/dist/components/section/index.js +1 -0
- package/dist/components/section/model.d.ts +5 -0
- package/dist/components/section/model.js +1 -0
- package/dist/components/section/section.d.ts +3 -0
- package/dist/components/section/section.js +16 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/model.d.ts +43 -0
- package/dist/components/select/model.js +1 -0
- package/dist/components/select/select.d.ts +3 -0
- package/dist/components/select/select.js +132 -0
- package/dist/components/stack/index.d.ts +1 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/stack/model.d.ts +34 -0
- package/dist/components/stack/model.js +4 -0
- package/dist/components/stack/stack.d.ts +3 -0
- package/dist/components/stack/stack.js +11 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/switch/model.d.ts +12 -0
- package/dist/components/switch/model.js +1 -0
- package/dist/components/switch/switch.d.ts +3 -0
- package/dist/components/switch/switch.js +47 -0
- package/dist/components/tab-item/index.d.ts +1 -0
- package/dist/components/tab-item/index.js +1 -0
- package/dist/components/tab-item/model.d.ts +24 -0
- package/dist/components/tab-item/model.js +1 -0
- package/dist/components/tab-item/tab-item.d.ts +3 -0
- package/dist/components/tab-item/tab-item.js +37 -0
- package/dist/components/tab-list/index.d.ts +1 -0
- package/dist/components/tab-list/index.js +1 -0
- package/dist/components/tab-list/model.d.ts +5 -0
- package/dist/components/tab-list/model.js +1 -0
- package/dist/components/tab-list/tab-list.d.ts +3 -0
- package/dist/components/tab-list/tab-list.js +17 -0
- package/dist/components/tab-panel/index.d.ts +1 -0
- package/dist/components/tab-panel/index.js +1 -0
- package/dist/components/tab-panel/model.d.ts +10 -0
- package/dist/components/tab-panel/model.js +1 -0
- package/dist/components/tab-panel/tab-panel.d.ts +3 -0
- package/dist/components/tab-panel/tab-panel.js +14 -0
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/tabs/model.d.ts +47 -0
- package/dist/components/tabs/model.js +2 -0
- package/dist/components/tabs/tabs.d.ts +3 -0
- package/dist/components/tabs/tabs.js +138 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/tag/index.js +1 -0
- package/dist/components/tag/model.d.ts +45 -0
- package/dist/components/tag/model.js +1 -0
- package/dist/components/tag/tag.d.ts +3 -0
- package/dist/components/tag/tag.js +46 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/textarea/model.d.ts +30 -0
- package/dist/components/textarea/model.js +2 -0
- package/dist/components/textarea/textarea.d.ts +3 -0
- package/dist/components/textarea/textarea.js +105 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/model.d.ts +7 -0
- package/dist/components/tooltip/model.js +1 -0
- package/dist/components/tooltip/tooltip.d.ts +3 -0
- package/dist/components/tooltip/tooltip.js +43 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +36 -0
- package/dist/shared/constants.d.ts +83 -0
- package/dist/shared/constants.js +87 -0
- package/dist/shared/model.d.ts +446 -0
- package/dist/shared/model.js +20 -0
- package/dist/utils/form-components.d.ts +2 -0
- package/dist/utils/form-components.js +10 -0
- package/dist/utils/index.d.ts +61 -0
- package/dist/utils/index.js +166 -0
- package/dist/utils/navigation.d.ts +32 -0
- package/dist/utils/navigation.js +136 -0
- package/package.json +43 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { IconTypes } from '@db-ux/core-foundations';
|
|
3
|
+
export type GlobalProps = {
|
|
4
|
+
/**
|
|
5
|
+
* default slot
|
|
6
|
+
*/
|
|
7
|
+
children?: any;
|
|
8
|
+
/**
|
|
9
|
+
* React specific for adding className to the component.
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Workaround for TypeScript using class for all components.
|
|
14
|
+
*/
|
|
15
|
+
class?: string | any;
|
|
16
|
+
/**
|
|
17
|
+
* [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) is used to link to the elements that describe the element with the set attribute.
|
|
18
|
+
*/
|
|
19
|
+
describedbyid?: string;
|
|
20
|
+
/**
|
|
21
|
+
* [ID](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) of the component, generated automatically for some components as a fallback if unset.
|
|
22
|
+
*/
|
|
23
|
+
id?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Before using please check for the [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_concerns)
|
|
26
|
+
*/
|
|
27
|
+
autofocus?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type GlobalState = {
|
|
30
|
+
_id?: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const SemanticList: readonly ["adaptive", "neutral", "critical", "informational", "warning", "successful"];
|
|
33
|
+
export type SemanticType = (typeof SemanticList)[number];
|
|
34
|
+
export type SemanticProps = {
|
|
35
|
+
/**
|
|
36
|
+
* The semantic defines the default variants for most components.
|
|
37
|
+
*/
|
|
38
|
+
semantic?: SemanticType;
|
|
39
|
+
};
|
|
40
|
+
export type IconProps = {
|
|
41
|
+
/**
|
|
42
|
+
* Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://db-ux-design-system.github.io/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.
|
|
43
|
+
*/
|
|
44
|
+
icon?: IconTypes;
|
|
45
|
+
};
|
|
46
|
+
export type ShowIconProps = {
|
|
47
|
+
/**
|
|
48
|
+
* Enables or disables the visibility of the icon. The default value depends on the component.
|
|
49
|
+
* For many components this property is optional to reflect Figma properties.
|
|
50
|
+
*/
|
|
51
|
+
showIcon?: boolean;
|
|
52
|
+
};
|
|
53
|
+
export type IconAfterProps = {
|
|
54
|
+
/**
|
|
55
|
+
* Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://db-ux-design-system.github.io/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.
|
|
56
|
+
*/
|
|
57
|
+
iconAfter?: IconTypes;
|
|
58
|
+
};
|
|
59
|
+
export declare const SpacingList: readonly ["medium", "small", "large", "none"];
|
|
60
|
+
export type SpacingType = (typeof SpacingList)[number];
|
|
61
|
+
export type SpacingProps = {
|
|
62
|
+
/**
|
|
63
|
+
* The spacing attribute changes the padding of the component.
|
|
64
|
+
*/
|
|
65
|
+
spacing?: SpacingType;
|
|
66
|
+
};
|
|
67
|
+
export declare const MarginList: readonly ["medium", "small", "large", "none"];
|
|
68
|
+
export type MarginType = (typeof MarginList)[number];
|
|
69
|
+
export type MarginProps = {
|
|
70
|
+
/**
|
|
71
|
+
* The margin attribute changes the margin of the component.
|
|
72
|
+
*/
|
|
73
|
+
margin?: MarginType;
|
|
74
|
+
};
|
|
75
|
+
export declare const PlacementList: readonly ["left", "right", "top", "bottom", "left-start", "left-end", "right-start", "right-end", "top-start", "top-end", "bottom-start", "bottom-end"];
|
|
76
|
+
export type PlacementType = (typeof PlacementList)[number];
|
|
77
|
+
export type PlacementProps = {
|
|
78
|
+
/**
|
|
79
|
+
* The `placement` attributes values change the position to absolute and adds a transform based on the placement.
|
|
80
|
+
*/
|
|
81
|
+
placement?: PlacementType;
|
|
82
|
+
};
|
|
83
|
+
export type NavigationBehaviorState = {
|
|
84
|
+
handleNavigationItemClick: (event: unknown) => void;
|
|
85
|
+
};
|
|
86
|
+
export type GapProps = {
|
|
87
|
+
/**
|
|
88
|
+
* If the absolute element should have a gap between the parent element.
|
|
89
|
+
*/
|
|
90
|
+
gap?: boolean;
|
|
91
|
+
};
|
|
92
|
+
export declare const GapSpacingList: readonly ["none", "3x-large", "2x-large", "x-large", "large", "medium", "small", "x-small", "2x-small", "3x-small"];
|
|
93
|
+
export type GapSpacingType = (typeof GapSpacingList)[number];
|
|
94
|
+
export type GapSpacingProps = {
|
|
95
|
+
/**
|
|
96
|
+
* Set the gap/spacing between elements
|
|
97
|
+
*/
|
|
98
|
+
gap?: GapSpacingType;
|
|
99
|
+
};
|
|
100
|
+
export type OverflowProps = {
|
|
101
|
+
/**
|
|
102
|
+
* The overflow attribute sets a max-width and longer text will be dotted.
|
|
103
|
+
*/
|
|
104
|
+
overflow?: boolean;
|
|
105
|
+
};
|
|
106
|
+
export declare const OrientationList: readonly ["horizontal", "vertical"];
|
|
107
|
+
export type OrientationType = (typeof OrientationList)[number];
|
|
108
|
+
export type OrientationProps = {
|
|
109
|
+
/**
|
|
110
|
+
* Change the orientation. Defaults to horizontal.
|
|
111
|
+
*/
|
|
112
|
+
orientation?: OrientationType;
|
|
113
|
+
};
|
|
114
|
+
export declare const WidthList: readonly ["full", "auto"];
|
|
115
|
+
export type WidthType = (typeof WidthList)[number];
|
|
116
|
+
export type WidthProps = {
|
|
117
|
+
/**
|
|
118
|
+
* Width of the component. Auto width based on children size, full width based on parent elements width.
|
|
119
|
+
*/
|
|
120
|
+
width?: WidthType;
|
|
121
|
+
};
|
|
122
|
+
export declare const MaxWidthList: readonly ["full", "medium", "large", "small"];
|
|
123
|
+
export type MaxWidthType = (typeof MaxWidthList)[number];
|
|
124
|
+
export type ContainerWidthProps = {
|
|
125
|
+
/**
|
|
126
|
+
* Set max width for the component
|
|
127
|
+
*/
|
|
128
|
+
width?: MaxWidthType;
|
|
129
|
+
};
|
|
130
|
+
export declare const PopoverDelayList: readonly ["none", "slow", "fast"];
|
|
131
|
+
export type PopoverDelayType = (typeof PopoverDelayList)[number];
|
|
132
|
+
export declare const PopoverWidthList: readonly ["auto", "fixed"];
|
|
133
|
+
export type PopoverWidthType = (typeof PopoverWidthList)[number];
|
|
134
|
+
export type PopoverProps = {
|
|
135
|
+
/**
|
|
136
|
+
* Add a delay before showing the tooltip
|
|
137
|
+
*/
|
|
138
|
+
delay?: PopoverDelayType;
|
|
139
|
+
/**
|
|
140
|
+
* Disable animation
|
|
141
|
+
*/
|
|
142
|
+
animation?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Use fixed with for default max-width
|
|
145
|
+
*/
|
|
146
|
+
width?: PopoverWidthType;
|
|
147
|
+
};
|
|
148
|
+
export type PopoverState = {
|
|
149
|
+
handleAutoPlacement: () => void;
|
|
150
|
+
};
|
|
151
|
+
export type ContentSlotProps = {
|
|
152
|
+
/**
|
|
153
|
+
* Default slot which is used to pass in additional content.
|
|
154
|
+
*/
|
|
155
|
+
content?: any;
|
|
156
|
+
};
|
|
157
|
+
export declare const SizeList: readonly ["small", "medium"];
|
|
158
|
+
export type SizeType = (typeof SizeList)[number];
|
|
159
|
+
export type SizeProps = {
|
|
160
|
+
/**
|
|
161
|
+
* The size attribute changes the font-size and other related sizes of the component.
|
|
162
|
+
*/
|
|
163
|
+
size?: SizeType;
|
|
164
|
+
};
|
|
165
|
+
export declare const EmphasisList: readonly ["weak", "strong"];
|
|
166
|
+
export type EmphasisType = (typeof EmphasisList)[number];
|
|
167
|
+
export type EmphasisProps = {
|
|
168
|
+
/**
|
|
169
|
+
* The emphasis attribute divides in between a weak or strong importance.
|
|
170
|
+
*/
|
|
171
|
+
emphasis?: EmphasisType;
|
|
172
|
+
};
|
|
173
|
+
export declare const TagEmphasisList: readonly ["weak", "strong", "origin"];
|
|
174
|
+
export type TagEmphasisType = (typeof TagEmphasisList)[number];
|
|
175
|
+
export type TagEmphasisProps = {
|
|
176
|
+
/**
|
|
177
|
+
* The emphasis attribute divides in between a weak, strong or origin appearance.
|
|
178
|
+
*/
|
|
179
|
+
emphasis?: TagEmphasisType;
|
|
180
|
+
};
|
|
181
|
+
export declare const ValidationList: readonly ["invalid", "valid", "no-validation"];
|
|
182
|
+
export type ValidationType = (typeof ValidationList)[number];
|
|
183
|
+
export type FormProps = {
|
|
184
|
+
/**
|
|
185
|
+
* Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.
|
|
186
|
+
*/
|
|
187
|
+
validation?: ValidationType;
|
|
188
|
+
/**
|
|
189
|
+
* The disabled attribute can be set to keep a user from clicking on the form element.
|
|
190
|
+
*/
|
|
191
|
+
disabled?: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Associates the control with a form element
|
|
194
|
+
*/
|
|
195
|
+
form?: string;
|
|
196
|
+
/**
|
|
197
|
+
* The label attribute specifies the caption of the form element.
|
|
198
|
+
*/
|
|
199
|
+
label?: string;
|
|
200
|
+
/**
|
|
201
|
+
* The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.
|
|
202
|
+
*/
|
|
203
|
+
name?: string;
|
|
204
|
+
/**
|
|
205
|
+
* When the required attribute specified, the user will be required to fill the form element before submitting the form.
|
|
206
|
+
*/
|
|
207
|
+
required?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Enables/disables the visibility of the label
|
|
210
|
+
*/
|
|
211
|
+
showLabel?: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* The value property is to receive results from the native form element.
|
|
214
|
+
*/
|
|
215
|
+
value?: any;
|
|
216
|
+
};
|
|
217
|
+
export type FormTextProps = {
|
|
218
|
+
/**
|
|
219
|
+
* Maximum length (number of characters) of value
|
|
220
|
+
*/
|
|
221
|
+
maxLength?: number;
|
|
222
|
+
/**
|
|
223
|
+
* Minimum length (number of characters) of value
|
|
224
|
+
*/
|
|
225
|
+
minLength?: number;
|
|
226
|
+
/**
|
|
227
|
+
* The disabled attribute can be set to keep a user from edit on the form element
|
|
228
|
+
*/
|
|
229
|
+
readOnly?: boolean;
|
|
230
|
+
};
|
|
231
|
+
export type FormCheckProps = {
|
|
232
|
+
/**
|
|
233
|
+
* Define the radio or checkbox elements checked state
|
|
234
|
+
*/
|
|
235
|
+
checked?: boolean;
|
|
236
|
+
};
|
|
237
|
+
export declare const LabelVariantList: readonly ["above", "floating"];
|
|
238
|
+
export type LabelVariantType = (typeof LabelVariantList)[number];
|
|
239
|
+
export declare const AutoCompleteList: readonly ["off", "on", "name", "honorific-prefix", "given-name", "additional-name", "family-name", "honorific-suffix", "nickname", "email", "username", "new-password", "current-password", "one-time-code", "organization-title", "organization", "street-address", "shipping", "billing", "address-line1", "address-line2", "address-line3", "address-level4", "address-level3", "address-level2", "address-level1", "country", "country-name", "postal-code", "cc-name", "cc-given-name", "cc-additional-name", "cc-family-name", "cc-number", "cc-exp", "cc-exp-month", "cc-exp-year", "cc-csc", "cc-type", "transaction-currency", "transaction-amount", "language", "bday", "bday-day", "bday-month", "bday-year", "sex", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-extension", "impp", "url", "photo", "webauthn"];
|
|
240
|
+
export type AutoCompleteType = (typeof AutoCompleteList)[number];
|
|
241
|
+
export type FormMessageProps = {
|
|
242
|
+
/**
|
|
243
|
+
* Change the variant of the label to float or hidden
|
|
244
|
+
*/
|
|
245
|
+
variant?: LabelVariantType;
|
|
246
|
+
/**
|
|
247
|
+
* Text that appears in the form control when it has no value set
|
|
248
|
+
*/
|
|
249
|
+
placeholder?: string;
|
|
250
|
+
/**
|
|
251
|
+
* Optional helper message for form components
|
|
252
|
+
*/
|
|
253
|
+
message?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Helper message for valid form components
|
|
256
|
+
*/
|
|
257
|
+
validMessage?: string;
|
|
258
|
+
/**
|
|
259
|
+
* Helper message for invalid form components
|
|
260
|
+
*/
|
|
261
|
+
invalidMessage?: string;
|
|
262
|
+
/**
|
|
263
|
+
* Set/overwrite icon for helper message for form components
|
|
264
|
+
*/
|
|
265
|
+
messageIcon?: IconTypes;
|
|
266
|
+
/**
|
|
267
|
+
* See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
268
|
+
*/
|
|
269
|
+
autocomplete?: string | AutoCompleteType;
|
|
270
|
+
/**
|
|
271
|
+
* Enables or disables the visibility of the message.
|
|
272
|
+
*/
|
|
273
|
+
showMessage?: boolean;
|
|
274
|
+
};
|
|
275
|
+
export type FormState = {
|
|
276
|
+
_messageId?: string;
|
|
277
|
+
_validMessageId?: string;
|
|
278
|
+
_invalidMessageId?: string;
|
|
279
|
+
_descByIds?: string;
|
|
280
|
+
_value?: string;
|
|
281
|
+
/**
|
|
282
|
+
* https://www.davidmacd.com/blog/test-aria-describedby-errormessage-aria-live.html
|
|
283
|
+
* Currently VoiceOver isn't supporting changes from aria-describedby.
|
|
284
|
+
* This is an internal Fallback
|
|
285
|
+
*/
|
|
286
|
+
_voiceOverFallback?: string;
|
|
287
|
+
};
|
|
288
|
+
export type InitializedState = {
|
|
289
|
+
initialized: boolean;
|
|
290
|
+
};
|
|
291
|
+
export declare const LinkCurrentList: readonly ["time", "true", "false", "date", "page", "step", "location"];
|
|
292
|
+
export type LinkCurrentType = (typeof LinkCurrentList)[number];
|
|
293
|
+
export declare const LinkTargetList: readonly ["_self", "_blank", "_parent", "_top"];
|
|
294
|
+
export type LinkTargetType = (typeof LinkTargetList)[number];
|
|
295
|
+
export declare const LinkReferrerPolicyList: readonly ["no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "same-origin", "strict-origin", "strict-origin-when-cross-origin", "unsafe-url"];
|
|
296
|
+
export type LinkReferrerPolicyType = (typeof LinkReferrerPolicyList)[number];
|
|
297
|
+
export type LinkProps = {
|
|
298
|
+
/**
|
|
299
|
+
* Sets aria attribute based on [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current).
|
|
300
|
+
*/
|
|
301
|
+
current?: boolean | LinkCurrentType;
|
|
302
|
+
/**
|
|
303
|
+
* Disables the link.
|
|
304
|
+
*/
|
|
305
|
+
disabled?: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* The [URL that the hyperlink points to](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).
|
|
308
|
+
*/
|
|
309
|
+
href?: string;
|
|
310
|
+
/**
|
|
311
|
+
* Hints for the human [language of the linked page or document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).
|
|
312
|
+
*/
|
|
313
|
+
hreflang?: string;
|
|
314
|
+
/**
|
|
315
|
+
* Sets aria attribute based on [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label).
|
|
316
|
+
*/
|
|
317
|
+
label?: string;
|
|
318
|
+
/**
|
|
319
|
+
* Where to open the linked URL, as the name for a [browsing context](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).
|
|
320
|
+
*/
|
|
321
|
+
target?: LinkTargetType;
|
|
322
|
+
/**
|
|
323
|
+
* The relationship of the linked URL as space-separated link types.
|
|
324
|
+
*/
|
|
325
|
+
rel?: string;
|
|
326
|
+
/**
|
|
327
|
+
* Sets aria role based on [`aria-role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles).
|
|
328
|
+
*/
|
|
329
|
+
role?: string;
|
|
330
|
+
/**
|
|
331
|
+
* How much of the referrer to send when following the link.
|
|
332
|
+
*/
|
|
333
|
+
referrerpolicy?: LinkReferrerPolicyType;
|
|
334
|
+
/**
|
|
335
|
+
* Sets aria role based on [`aria-selected`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected).
|
|
336
|
+
*/
|
|
337
|
+
selected?: boolean;
|
|
338
|
+
};
|
|
339
|
+
export type TextProps = {
|
|
340
|
+
/**
|
|
341
|
+
* Alternative for default slot/children.
|
|
342
|
+
*/
|
|
343
|
+
text?: string;
|
|
344
|
+
};
|
|
345
|
+
export type ClickEvent<T> = React.MouseEvent<T, MouseEvent>;
|
|
346
|
+
export type ClickEventProps<T> = {
|
|
347
|
+
/**
|
|
348
|
+
* React specific onClick to pass to forward ref.
|
|
349
|
+
*/
|
|
350
|
+
onClick?: (event: ClickEvent<T>) => void;
|
|
351
|
+
};
|
|
352
|
+
export type ClickEventState<T> = {
|
|
353
|
+
handleClick: (event: ClickEvent<T>) => void;
|
|
354
|
+
};
|
|
355
|
+
export type ToggleEventProps = {
|
|
356
|
+
onToggle?: (open: boolean) => void;
|
|
357
|
+
};
|
|
358
|
+
export type ToggleEventState<T> = {
|
|
359
|
+
toggle: (event?: ClickEvent<T>) => void;
|
|
360
|
+
};
|
|
361
|
+
export type CloseEventProps = {
|
|
362
|
+
/**
|
|
363
|
+
* Function to handle button click (close).
|
|
364
|
+
*/
|
|
365
|
+
onClose?: (event?: any) => void;
|
|
366
|
+
};
|
|
367
|
+
export type CloseEventState = {
|
|
368
|
+
handleClose: (event: any) => void;
|
|
369
|
+
};
|
|
370
|
+
export declare const AlignmentList: readonly ["start", "center"];
|
|
371
|
+
export type AlignmentType = (typeof AlignmentList)[number];
|
|
372
|
+
export type AlignmentProps = {
|
|
373
|
+
/**
|
|
374
|
+
* Define the content alignment in full width
|
|
375
|
+
*/
|
|
376
|
+
alignment?: AlignmentType;
|
|
377
|
+
};
|
|
378
|
+
export type ActiveProps = {
|
|
379
|
+
/**
|
|
380
|
+
* If the tab is checked/active.
|
|
381
|
+
*/
|
|
382
|
+
active?: boolean;
|
|
383
|
+
};
|
|
384
|
+
export type InputEvent<T> = React.FormEvent<T>;
|
|
385
|
+
export type InputEventProps<T> = {
|
|
386
|
+
input?: (event: InputEvent<T>) => void;
|
|
387
|
+
onInput?: (event: InputEvent<T>) => void;
|
|
388
|
+
};
|
|
389
|
+
export type InputEventState<T> = {
|
|
390
|
+
handleInput: (event: InputEvent<T>) => void;
|
|
391
|
+
};
|
|
392
|
+
export type ChangeEvent<T> = React.ChangeEvent<T>;
|
|
393
|
+
export type ChangeEventProps<T> = {
|
|
394
|
+
change?: (event: ChangeEvent<T>) => void;
|
|
395
|
+
onChange?: (event: ChangeEvent<T>) => void;
|
|
396
|
+
};
|
|
397
|
+
export type ChangeEventState<T> = {
|
|
398
|
+
handleChange: (event: ChangeEvent<T>) => void;
|
|
399
|
+
};
|
|
400
|
+
export type InteractionEvent<T> = React.FocusEvent<T>;
|
|
401
|
+
export type FocusEventProps<T> = {
|
|
402
|
+
blur?: (event: InteractionEvent<T>) => void;
|
|
403
|
+
onBlur?: (event: InteractionEvent<T>) => void;
|
|
404
|
+
focus?: (event: InteractionEvent<T>) => void;
|
|
405
|
+
onFocus?: (event: InteractionEvent<T>) => void;
|
|
406
|
+
};
|
|
407
|
+
export type FocusEventState<T> = {
|
|
408
|
+
handleBlur: (event: InteractionEvent<T>) => void;
|
|
409
|
+
handleFocus: (event: InteractionEvent<T>) => void;
|
|
410
|
+
};
|
|
411
|
+
export type InnerCloseButtonProps = {
|
|
412
|
+
/**
|
|
413
|
+
* The closeButtonId attribute changes the id inside the close button.
|
|
414
|
+
*/
|
|
415
|
+
closeButtonId?: string;
|
|
416
|
+
/**
|
|
417
|
+
* The closeButtonText attribute changes the text inside the close button.
|
|
418
|
+
*/
|
|
419
|
+
closeButtonText?: string;
|
|
420
|
+
};
|
|
421
|
+
export type NavigationBackButtonProps = {
|
|
422
|
+
/**
|
|
423
|
+
* The backButtonId attribute changes the id inside the back button.
|
|
424
|
+
*/
|
|
425
|
+
backButtonId?: string;
|
|
426
|
+
/**
|
|
427
|
+
* The backButtonText attribute changes the text inside the back button.
|
|
428
|
+
*/
|
|
429
|
+
backButtonText?: string;
|
|
430
|
+
};
|
|
431
|
+
export type AriaLabelledByProps = {
|
|
432
|
+
/**
|
|
433
|
+
* Pass aria-labelledby to inner element
|
|
434
|
+
*/
|
|
435
|
+
labelledBy?: string;
|
|
436
|
+
};
|
|
437
|
+
export type AriaControlsProps = {
|
|
438
|
+
/**
|
|
439
|
+
* Pass aria-controls to inner element
|
|
440
|
+
*/
|
|
441
|
+
controls?: string;
|
|
442
|
+
};
|
|
443
|
+
export type ValueLabelType = {
|
|
444
|
+
value: string;
|
|
445
|
+
label?: string;
|
|
446
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const SemanticList = ['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'];
|
|
2
|
+
export const SpacingList = ['medium', 'small', 'large', 'none'];
|
|
3
|
+
export const MarginList = ['medium', 'small', 'large', 'none'];
|
|
4
|
+
export const PlacementList = ['left', 'right', 'top', 'bottom', 'left-start', 'left-end', 'right-start', 'right-end', 'top-start', 'top-end', 'bottom-start', 'bottom-end'];
|
|
5
|
+
export const GapSpacingList = ['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'];
|
|
6
|
+
export const OrientationList = ['horizontal', 'vertical'];
|
|
7
|
+
export const WidthList = ['full', 'auto'];
|
|
8
|
+
export const MaxWidthList = ['full', 'medium', 'large', 'small'];
|
|
9
|
+
export const PopoverDelayList = ['none', 'slow', 'fast'];
|
|
10
|
+
export const PopoverWidthList = ['auto', 'fixed'];
|
|
11
|
+
export const SizeList = ['small', 'medium'];
|
|
12
|
+
export const EmphasisList = ['weak', 'strong'];
|
|
13
|
+
export const TagEmphasisList = [...EmphasisList, 'origin'];
|
|
14
|
+
export const ValidationList = ['invalid', 'valid', 'no-validation'];
|
|
15
|
+
export const LabelVariantList = ['above', 'floating'];
|
|
16
|
+
export const AutoCompleteList = ['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'];
|
|
17
|
+
export const LinkCurrentList = ['time', 'true', 'false', 'date', 'page', 'step', 'location'];
|
|
18
|
+
export const LinkTargetList = ['_self', '_blank', '_parent', '_top'];
|
|
19
|
+
export const LinkReferrerPolicyList = ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'];
|
|
20
|
+
export const AlignmentList = ['start', 'center'];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
export const handleFrameworkEventAngular = (component, event, modelValue = 'value') => {
|
|
3
|
+
// Change event to work with reactive and template driven forms
|
|
4
|
+
component.propagateChange(event.target[modelValue]);
|
|
5
|
+
component.writeValue(event.target[modelValue]);
|
|
6
|
+
};
|
|
7
|
+
export const handleFrameworkEventVue = (emit, event, modelValue = 'value') => {
|
|
8
|
+
// TODO: Replace this with the solution out of https://github.com/BuilderIO/mitosis/issues/833 after this has been "solved"
|
|
9
|
+
emit(`update:${modelValue}`, event.target[modelValue]);
|
|
10
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare const uuid: () => string;
|
|
2
|
+
export declare const addAttributeToChildren: (element: Element, attribute: {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}) => void;
|
|
6
|
+
export type ClassNameArg = string | {
|
|
7
|
+
[key: string]: boolean | undefined;
|
|
8
|
+
} | undefined;
|
|
9
|
+
export declare const cls: (...args: ClassNameArg[]) => string;
|
|
10
|
+
export declare const filterPassingProps: (props: Record<string, unknown>, propsPassingFilter: string[]) => Record<string, unknown>;
|
|
11
|
+
export declare const getRootProps: (props: Record<string, unknown>, rooProps: string[]) => Record<string, unknown>;
|
|
12
|
+
export declare const visibleInVX: (el: Element) => boolean;
|
|
13
|
+
export declare const visibleInVY: (el: Element) => boolean;
|
|
14
|
+
export declare const isInView: (el: Element) => {
|
|
15
|
+
outTop: boolean;
|
|
16
|
+
outBottom: boolean;
|
|
17
|
+
outLeft: boolean;
|
|
18
|
+
outRight: boolean;
|
|
19
|
+
};
|
|
20
|
+
export interface DBDataOutsidePair {
|
|
21
|
+
vx?: 'left' | 'right';
|
|
22
|
+
vy?: 'top' | 'bottom';
|
|
23
|
+
}
|
|
24
|
+
export declare const handleDataOutside: (el: Element) => DBDataOutsidePair;
|
|
25
|
+
export declare const isArrayOfStrings: (value: unknown) => value is string[];
|
|
26
|
+
export declare const hasVoiceOver: () => boolean;
|
|
27
|
+
export declare const delay: (fn: () => void, ms: number) => Promise<unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Some frameworks like stencil would not add "true" as value for a prop
|
|
30
|
+
* if it is used in a framework like angular e.g.: [disabled]="myDisabledProp"
|
|
31
|
+
* @param originBool Some boolean to convert to string
|
|
32
|
+
*/
|
|
33
|
+
export declare const getBooleanAsString: (originBool?: boolean) => any;
|
|
34
|
+
export declare const getHideProp: (show?: boolean) => any;
|
|
35
|
+
export declare const stringPropVisible: (givenString?: string, showString?: boolean) => string | boolean;
|
|
36
|
+
declare const _default: {
|
|
37
|
+
getRootProps: (props: Record<string, unknown>, rooProps: string[]) => Record<string, unknown>;
|
|
38
|
+
filterPassingProps: (props: Record<string, unknown>, propsPassingFilter: string[]) => Record<string, unknown>;
|
|
39
|
+
cls: (...args: ClassNameArg[]) => string;
|
|
40
|
+
addAttributeToChildren: (element: Element, attribute: {
|
|
41
|
+
key: string;
|
|
42
|
+
value: string;
|
|
43
|
+
}) => void;
|
|
44
|
+
uuid: () => string;
|
|
45
|
+
visibleInVX: (el: Element) => boolean;
|
|
46
|
+
visibleInVY: (el: Element) => boolean;
|
|
47
|
+
isInView: (el: Element) => {
|
|
48
|
+
outTop: boolean;
|
|
49
|
+
outBottom: boolean;
|
|
50
|
+
outLeft: boolean;
|
|
51
|
+
outRight: boolean;
|
|
52
|
+
};
|
|
53
|
+
handleDataOutside: (el: Element) => DBDataOutsidePair;
|
|
54
|
+
isArrayOfStrings: (value: unknown) => value is string[];
|
|
55
|
+
hasVoiceOver: () => boolean;
|
|
56
|
+
delay: (fn: () => void, ms: number) => Promise<unknown>;
|
|
57
|
+
getBooleanAsString: (originBool?: boolean) => any;
|
|
58
|
+
getHideProp: (show?: boolean) => any;
|
|
59
|
+
stringPropVisible: (givenString?: string, showString?: boolean) => string | boolean;
|
|
60
|
+
};
|
|
61
|
+
export default _default;
|