@usefui/components 1.6.0 → 1.7.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/CHANGELOG.md +6 -0
- package/dist/index.d.mts +380 -52
- package/dist/index.d.ts +380 -52
- package/dist/index.js +2534 -511
- package/dist/index.mjs +2520 -508
- package/package.json +3 -3
- package/src/__tests__/Avatar.test.tsx +55 -55
- package/src/accordion/Accordion.stories.tsx +6 -4
- package/src/accordion/index.tsx +1 -2
- package/src/avatar/Avatar.stories.tsx +37 -7
- package/src/avatar/index.tsx +90 -19
- package/src/avatar/styles/index.ts +58 -12
- package/src/badge/Badge.stories.tsx +27 -5
- package/src/badge/index.tsx +21 -13
- package/src/badge/styles/index.ts +69 -40
- package/src/button/Button.stories.tsx +40 -27
- package/src/button/index.tsx +13 -9
- package/src/button/styles/index.ts +308 -47
- package/src/card/index.tsx +2 -4
- package/src/checkbox/Checkbox.stories.tsx +72 -33
- package/src/checkbox/index.tsx +8 -6
- package/src/checkbox/styles/index.ts +239 -19
- package/src/collapsible/Collapsible.stories.tsx +6 -4
- package/src/dialog/Dialog.stories.tsx +173 -31
- package/src/dialog/styles/index.ts +15 -8
- package/src/dropdown/Dropdown.stories.tsx +61 -23
- package/src/dropdown/index.tsx +42 -31
- package/src/dropdown/styles/index.ts +30 -19
- package/src/field/Field.stories.tsx +183 -24
- package/src/field/index.tsx +930 -13
- package/src/field/styles/index.ts +246 -14
- package/src/field/types/index.ts +31 -0
- package/src/field/utils/index.ts +201 -0
- package/src/index.ts +2 -1
- package/src/message-bubble/MessageBubble.stories.tsx +59 -12
- package/src/message-bubble/index.tsx +22 -4
- package/src/message-bubble/styles/index.ts +4 -7
- package/src/otp-field/OTPField.stories.tsx +22 -24
- package/src/otp-field/index.tsx +9 -0
- package/src/otp-field/styles/index.ts +114 -16
- package/src/otp-field/types/index.ts +9 -1
- package/src/overlay/styles/index.ts +1 -0
- package/src/ruler/Ruler.stories.tsx +43 -0
- package/src/ruler/constants/index.ts +3 -0
- package/src/ruler/hooks/index.tsx +53 -0
- package/src/ruler/index.tsx +239 -0
- package/src/ruler/styles/index.tsx +154 -0
- package/src/ruler/types/index.ts +17 -0
- package/src/select/Select.stories.tsx +91 -0
- package/src/select/hooks/index.tsx +71 -0
- package/src/select/index.tsx +331 -0
- package/src/select/styles/index.tsx +156 -0
- package/src/shimmer/Shimmer.stories.tsx +6 -4
- package/src/skeleton/index.tsx +7 -6
- package/src/spinner/Spinner.stories.tsx +29 -4
- package/src/spinner/index.tsx +16 -6
- package/src/spinner/styles/index.ts +41 -22
- package/src/switch/Switch.stories.tsx +46 -17
- package/src/switch/index.tsx +5 -8
- package/src/switch/styles/index.ts +45 -45
- package/src/tabs/Tabs.stories.tsx +43 -15
- package/src/text-area/Textarea.stories.tsx +45 -8
- package/src/text-area/index.tsx +9 -6
- package/src/text-area/styles/index.ts +1 -1
- package/src/toggle/Toggle.stories.tsx +6 -4
- package/src/tree/Tree.stories.tsx +6 -4
- package/src/privacy-field/PrivacyField.stories.tsx +0 -29
- package/src/privacy-field/index.tsx +0 -56
- package/src/privacy-field/styles/index.ts +0 -17
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ type TComponentSize = "small" | "medium" | "large";
|
|
|
11
11
|
type TComponentSide = "top" | "right" | "bottom" | "left";
|
|
12
12
|
type TComponentShape = "square" | "smooth" | "round";
|
|
13
13
|
type TComponentVariant = "primary" | "secondary" | "tertiary" | "mono" | "border" | "ghost";
|
|
14
|
+
type TComponentVariantExtended = "danger" | "warning" | "meta" | "success" | "hint";
|
|
14
15
|
type TKeyBinding = "ctrlKey" | "metaKey" | "altKey" | "shiftKey";
|
|
15
16
|
interface IComponentAPI {
|
|
16
17
|
id: string;
|
|
@@ -23,6 +24,9 @@ interface IComponentStyling {
|
|
|
23
24
|
interface IComponentSize {
|
|
24
25
|
sizing?: TComponentSize;
|
|
25
26
|
}
|
|
27
|
+
interface IComponentShape {
|
|
28
|
+
shape?: TComponentShape;
|
|
29
|
+
}
|
|
26
30
|
interface IComponentVariant {
|
|
27
31
|
variant?: TComponentVariant;
|
|
28
32
|
}
|
|
@@ -35,10 +39,9 @@ interface IComponentSpacing {
|
|
|
35
39
|
spacing?: TComponentSize;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
interface IButtonProperties extends IComponentStyling, IComponentSize, React$1.ComponentPropsWithRef<"button"> {
|
|
42
|
+
interface IButtonProperties extends IComponentStyling, IComponentShape, IComponentSize, React$1.ComponentPropsWithRef<"button"> {
|
|
39
43
|
rawicon?: boolean;
|
|
40
|
-
variant?: TComponentVariant | "
|
|
41
|
-
shape?: TComponentShape;
|
|
44
|
+
variant?: TComponentVariant | TComponentVariantExtended | "link" | "accent";
|
|
42
45
|
animation?: "reflective";
|
|
43
46
|
}
|
|
44
47
|
/**
|
|
@@ -152,10 +155,19 @@ declare enum AvataStatusEnum {
|
|
|
152
155
|
Busy = "busy",
|
|
153
156
|
Offline = "offline"
|
|
154
157
|
}
|
|
155
|
-
|
|
158
|
+
type AvatarStatusType = "online" | "away" | "busy" | "offline";
|
|
159
|
+
interface IAvatarProperties extends IComponentStyling, IComponentSize, IComponentShape, React$1.HTMLAttributes<HTMLDivElement> {
|
|
156
160
|
src?: string;
|
|
157
161
|
alt?: string;
|
|
158
|
-
status?:
|
|
162
|
+
status?: AvatarStatusType;
|
|
163
|
+
}
|
|
164
|
+
interface IAvatarBadgeProperties extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
165
|
+
src?: string;
|
|
166
|
+
alt?: string;
|
|
167
|
+
}
|
|
168
|
+
interface IAvatarComposition {
|
|
169
|
+
Status: typeof AvatarStatus;
|
|
170
|
+
Badge: typeof AvatarBadge;
|
|
159
171
|
}
|
|
160
172
|
/**
|
|
161
173
|
* Avatar are used to represents a user or an entity on an interface.
|
|
@@ -178,11 +190,53 @@ interface IAvatarProperties extends IComponentStyling, IComponentSize, React$1.H
|
|
|
178
190
|
declare const Avatar: {
|
|
179
191
|
(props: IAvatarProperties): React$1.JSX.Element;
|
|
180
192
|
displayName: string;
|
|
193
|
+
Status: {
|
|
194
|
+
(props: {
|
|
195
|
+
status?: AvatarStatusType;
|
|
196
|
+
}): React$1.ReactElement;
|
|
197
|
+
displayName: string;
|
|
198
|
+
};
|
|
199
|
+
Badge: {
|
|
200
|
+
(props: IAvatarBadgeProperties): React$1.ReactElement;
|
|
201
|
+
displayName: string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Avatar Statuses are used to represents a user activity status on an interface.
|
|
206
|
+
*
|
|
207
|
+
* **Best practices:**
|
|
208
|
+
*
|
|
209
|
+
* - Use the appropriate status to match the context and the importance of the information.
|
|
210
|
+
*
|
|
211
|
+
* @param {string} props.status - The status of the user represented by the avatar.
|
|
212
|
+
* @returns {ReactElement} The Avatar Status component.
|
|
213
|
+
*/
|
|
214
|
+
declare const AvatarStatus: {
|
|
215
|
+
(props: {
|
|
216
|
+
status?: AvatarStatusType;
|
|
217
|
+
}): React$1.ReactElement;
|
|
218
|
+
displayName: string;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Avatar Badges are used to represents an entity or an information related to the primary subject of the avatar.
|
|
222
|
+
*
|
|
223
|
+
* **Best practices:**
|
|
224
|
+
*
|
|
225
|
+
* - Use the appropriate imgage to display the context and the importance of the information.
|
|
226
|
+
* - Always provide an `alt` attribute for accessibility when using an image.
|
|
227
|
+
*
|
|
228
|
+
* @param {IAvatarBadgeProperties} props - The props for the Avatar Badge component.
|
|
229
|
+
* @param {string} props.src - The source URL of the image to be displayed in the avatar badge.
|
|
230
|
+
* @param {string} props.alt - The alternative text for the image in the avatar badge.
|
|
231
|
+
* @returns {ReactElement} The Avatar Badge component.
|
|
232
|
+
*/
|
|
233
|
+
declare const AvatarBadge: {
|
|
234
|
+
(props: IAvatarBadgeProperties): React$1.ReactElement;
|
|
235
|
+
displayName: string;
|
|
181
236
|
};
|
|
182
237
|
|
|
183
|
-
interface IBadgeProperties extends IComponentStyling, React$1.ComponentProps<"div"> {
|
|
184
|
-
variant?:
|
|
185
|
-
shape?: TComponentShape;
|
|
238
|
+
interface IBadgeProperties extends IComponentStyling, IComponentShape, IComponentSize, React$1.ComponentProps<"div"> {
|
|
239
|
+
variant?: TComponentVariant | TComponentVariantExtended;
|
|
186
240
|
}
|
|
187
241
|
/**
|
|
188
242
|
* Badges are used to convey data or states to the users.
|
|
@@ -195,6 +249,7 @@ interface IBadgeProperties extends IComponentStyling, React$1.ComponentProps<"di
|
|
|
195
249
|
* @param {IBadgeProperties} props - The props for the Badge component.
|
|
196
250
|
* @param {boolean} props.raw - Define whether the component is styled or not.
|
|
197
251
|
* @param {TComponentShape} props.shape - The shape of the component. Defaults to `smooth`.
|
|
252
|
+
* @param {ComponentSizeEnum} props.sizing - The size of the component. Defaults to "small".
|
|
198
253
|
* @param {string} props.variant - The style definition used by the component.
|
|
199
254
|
* @param {ReactNode} props.children - The content to be rendered inside the Badge.
|
|
200
255
|
* @returns {ReactElement} The Badge component.
|
|
@@ -266,8 +321,7 @@ interface CardComposition {
|
|
|
266
321
|
}
|
|
267
322
|
interface CardGridProps extends React$1.ComponentProps<"div">, IComponentSize {
|
|
268
323
|
}
|
|
269
|
-
interface CardProps extends React$1.ComponentProps<"div"> {
|
|
270
|
-
shape?: TComponentShape;
|
|
324
|
+
interface CardProps extends IComponentShape, React$1.ComponentProps<"div"> {
|
|
271
325
|
}
|
|
272
326
|
declare const CardGrid: {
|
|
273
327
|
(props: CardGridProps): React$1.JSX.Element;
|
|
@@ -302,7 +356,8 @@ interface ICheckboxComposition {
|
|
|
302
356
|
Root: typeof CheckboxRoot;
|
|
303
357
|
Indicator: typeof CheckboxIndicator;
|
|
304
358
|
}
|
|
305
|
-
interface ICheckboxProperties extends IComponentStyling, IComponentSize,
|
|
359
|
+
interface ICheckboxProperties extends IComponentStyling, IComponentSize, React$1.ComponentProps<"input"> {
|
|
360
|
+
variant?: TComponentVariant | TComponentVariantExtended | "accent";
|
|
306
361
|
}
|
|
307
362
|
/**
|
|
308
363
|
* Checkbox are used to select one or more options from a set.
|
|
@@ -636,8 +691,7 @@ declare enum MetaVariantEnum {
|
|
|
636
691
|
Error = "error"
|
|
637
692
|
}
|
|
638
693
|
type TMetaVariant = "default" | "hint" | "emphasis" | "error";
|
|
639
|
-
interface IField extends React$1.ComponentProps<"input">, IComponentSize, IComponentVariant, IComponentStyling {
|
|
640
|
-
shape?: TComponentShape;
|
|
694
|
+
interface IField extends React$1.ComponentProps<"input">, IComponentSize, IComponentVariant, IComponentShape, IComponentStyling {
|
|
641
695
|
hint?: string;
|
|
642
696
|
error?: string;
|
|
643
697
|
}
|
|
@@ -647,11 +701,47 @@ interface IFieldLabel extends React$1.ComponentProps<"label">, IComponentStyling
|
|
|
647
701
|
interface IFieldMeta extends React$1.ComponentProps<"small">, IComponentStyling {
|
|
648
702
|
variant?: TMetaVariant;
|
|
649
703
|
}
|
|
704
|
+
interface IFieldNumber extends Omit<IField, "type"> {
|
|
705
|
+
}
|
|
706
|
+
interface IFieldDate extends IComponentSize, IComponentVariant, IComponentShape, IComponentStyling {
|
|
707
|
+
value?: Date;
|
|
708
|
+
defaultValue?: Date;
|
|
709
|
+
onChange?: (date: Date) => void;
|
|
710
|
+
hint?: string;
|
|
711
|
+
error?: string;
|
|
712
|
+
locale?: string;
|
|
713
|
+
withTime?: boolean;
|
|
714
|
+
disabled?: boolean;
|
|
715
|
+
id?: string;
|
|
716
|
+
}
|
|
717
|
+
interface IFieldFile extends Omit<IField, "type" | "children"> {
|
|
718
|
+
trigger?: React$1.ReactNode;
|
|
719
|
+
onFileChange?: (files: FileList | null) => void;
|
|
720
|
+
}
|
|
721
|
+
type PrivacyType = "password" | "text";
|
|
722
|
+
interface IFieldPassword extends IField {
|
|
723
|
+
defaultType?: PrivacyType;
|
|
724
|
+
}
|
|
725
|
+
interface IFieldTag extends IComponentSize, IComponentVariant, IComponentShape, IComponentStyling {
|
|
726
|
+
value?: string[];
|
|
727
|
+
defaultValue?: string[];
|
|
728
|
+
allowed?: string[];
|
|
729
|
+
onChange?: (tags: string[]) => void;
|
|
730
|
+
error?: string;
|
|
731
|
+
disabled?: boolean;
|
|
732
|
+
placeholder?: string;
|
|
733
|
+
id?: string;
|
|
734
|
+
}
|
|
650
735
|
interface IFieldComposition {
|
|
651
736
|
Root: typeof FieldRoot;
|
|
652
737
|
Wrapper: typeof FieldWrapper;
|
|
653
738
|
Label: typeof FieldLabel;
|
|
654
739
|
Meta: typeof FieldMeta;
|
|
740
|
+
Number: typeof FieldNumber;
|
|
741
|
+
Date: typeof FieldDate;
|
|
742
|
+
File: typeof FieldFile;
|
|
743
|
+
Password: typeof FieldPassword;
|
|
744
|
+
Tag: typeof FieldTag;
|
|
655
745
|
}
|
|
656
746
|
/**
|
|
657
747
|
* Fields are input element that provides additional functionality such as error and hint messages.
|
|
@@ -689,6 +779,26 @@ declare const Field: {
|
|
|
689
779
|
(props: IFieldMeta): React$1.JSX.Element;
|
|
690
780
|
displayName: string;
|
|
691
781
|
};
|
|
782
|
+
Number: {
|
|
783
|
+
(props: IFieldNumber): React$1.JSX.Element;
|
|
784
|
+
displayName: string;
|
|
785
|
+
};
|
|
786
|
+
Date: {
|
|
787
|
+
(props: IFieldDate): React$1.JSX.Element;
|
|
788
|
+
displayName: string;
|
|
789
|
+
};
|
|
790
|
+
File: {
|
|
791
|
+
(props: IFieldFile): React$1.JSX.Element;
|
|
792
|
+
displayName: string;
|
|
793
|
+
};
|
|
794
|
+
Password: {
|
|
795
|
+
(props: IFieldPassword): React$1.JSX.Element;
|
|
796
|
+
displayName: string;
|
|
797
|
+
};
|
|
798
|
+
Tag: {
|
|
799
|
+
(props: IFieldTag): React$1.JSX.Element;
|
|
800
|
+
displayName: string;
|
|
801
|
+
};
|
|
692
802
|
};
|
|
693
803
|
declare const FieldRoot: {
|
|
694
804
|
({ children }: IReactChildren): React$1.JSX.Element;
|
|
@@ -729,6 +839,122 @@ declare const FieldMeta: {
|
|
|
729
839
|
(props: IFieldMeta): React$1.JSX.Element;
|
|
730
840
|
displayName: string;
|
|
731
841
|
};
|
|
842
|
+
/**
|
|
843
|
+
* Field.Number is a numeric input field with increment/decrement controls.
|
|
844
|
+
*
|
|
845
|
+
* **Best practices:**
|
|
846
|
+
*
|
|
847
|
+
* - Provide clear and descriptive labels for all numeric inputs.
|
|
848
|
+
* - Use `min`, `max`, and `step` props to constrain valid values.
|
|
849
|
+
*
|
|
850
|
+
* @param {IFieldNumber} props - The props for the Field.Number component.
|
|
851
|
+
* @param {boolean} props.raw - Define whether the component is styled or not.
|
|
852
|
+
* @param {ComponentSizeEnum} props.sizing - The size of the component. Defaults to `medium`.
|
|
853
|
+
* @param {string} props.variant - The style definition used by the component.
|
|
854
|
+
* @param {TComponentShape} props.shape - The shape of the component. Defaults to `smooth`.
|
|
855
|
+
* @returns {ReactElement} The Field.Number component.
|
|
856
|
+
*/
|
|
857
|
+
declare const FieldNumber: {
|
|
858
|
+
(props: IFieldNumber): React$1.JSX.Element;
|
|
859
|
+
displayName: string;
|
|
860
|
+
};
|
|
861
|
+
/**
|
|
862
|
+
* Field.Date is a segmented date (and optionally time) input driven by `Intl.DateTimeFormat`.
|
|
863
|
+
*
|
|
864
|
+
* **Best practices:**
|
|
865
|
+
*
|
|
866
|
+
* - Pair with `Field.Label` so screen readers announce the field correctly.
|
|
867
|
+
* - Pass `locale` to match the user's regional date format.
|
|
868
|
+
* - Use `withTime` when you need both date and time selection.
|
|
869
|
+
*
|
|
870
|
+
* @param {IFieldDate} props
|
|
871
|
+
* @param {ComponentSizeEnum} props.sizing - The size of the component. Defaults to `medium`.
|
|
872
|
+
* @param {string} props.variant - The style definition used by the component.
|
|
873
|
+
* @param {TComponentShape} props.shape - The size of the component. Defaults to `smooth`.
|
|
874
|
+
* @param {Date} props.value - Controlled date value.
|
|
875
|
+
* @param {Date} props.defaultValue - Uncontrolled initial value.
|
|
876
|
+
* @param {(date: Date) => void} props.onChange - Called on every segment change.
|
|
877
|
+
* @param {string} props.locale - BCP 47 locale tag. Defaults to browser locale.
|
|
878
|
+
* @param {boolean} props.withTime - Show hour/minute segments. Defaults to false.
|
|
879
|
+
*/
|
|
880
|
+
declare const FieldDate: {
|
|
881
|
+
(props: IFieldDate): React$1.JSX.Element;
|
|
882
|
+
displayName: string;
|
|
883
|
+
};
|
|
884
|
+
/**
|
|
885
|
+
* Field.File is a file upload field composed of a read-only text input that
|
|
886
|
+
* displays the selected filename and a trigger button that opens the native
|
|
887
|
+
* file picker.
|
|
888
|
+
*
|
|
889
|
+
* **Best practices:**
|
|
890
|
+
*
|
|
891
|
+
* - Pair with `Field.Label` so screen readers announce the field correctly.
|
|
892
|
+
* - Use `accept` to constrain the file types shown in the picker.
|
|
893
|
+
* - Reflect allowed formats and size limits in a `Field.Meta` hint.
|
|
894
|
+
*
|
|
895
|
+
* @param {IFieldFile} props
|
|
896
|
+
* @param {ComponentSizeEnum} props.sizing - The size of the component. Defaults to `medium`.
|
|
897
|
+
* @param {string} props.variant - The style definition used by the component.
|
|
898
|
+
* @param {TComponentShape} props.shape - The size of the component. Defaults to `smooth`.
|
|
899
|
+
* @param {React.ReactNode} props.trigger - Content for the upload button.
|
|
900
|
+
* @param {(files: FileList | null) => void} props.onFileChange - Called with the selected `FileList` after the user picks files.
|
|
901
|
+
*/
|
|
902
|
+
declare const FieldFile: {
|
|
903
|
+
(props: IFieldFile): React$1.JSX.Element;
|
|
904
|
+
displayName: string;
|
|
905
|
+
};
|
|
906
|
+
/**
|
|
907
|
+
* Field.Password is a text input that toggles the visibility of its value
|
|
908
|
+
* between plain text and masked characters.
|
|
909
|
+
*
|
|
910
|
+
* **Best practices:**
|
|
911
|
+
*
|
|
912
|
+
* - Pair with `Field.Label` so screen readers announce the field correctly.
|
|
913
|
+
* - Avoid setting `autoComplete` to a value that would expose sensitive data.
|
|
914
|
+
* - Use `defaultType` to control the initial visibility state of the field.
|
|
915
|
+
*
|
|
916
|
+
* @param {IFieldPassword} props - The props for the Field.Password component.
|
|
917
|
+
* @param {boolean} props.raw - Define whether the component is styled or not.
|
|
918
|
+
* @param {ComponentSizeEnum} props.sizing - The size of the component. Defaults to `medium`.
|
|
919
|
+
* @param {string} props.variant - The style definition used by the component.
|
|
920
|
+
* @param {TComponentShape} props.shape - The shape of the component. Defaults to `smooth`.
|
|
921
|
+
* @param {string} props.error - The error message to display.
|
|
922
|
+
* @param {boolean} props.disabled - Whether the input is disabled.
|
|
923
|
+
* @param {PrivacyType} props.defaultType - The initial input type. Defaults to `password`.
|
|
924
|
+
* @returns {ReactElement} The Field.Password component.
|
|
925
|
+
*/
|
|
926
|
+
declare const FieldPassword: {
|
|
927
|
+
(props: IFieldPassword): React$1.JSX.Element;
|
|
928
|
+
displayName: string;
|
|
929
|
+
};
|
|
930
|
+
/**
|
|
931
|
+
* Field.Tag is a tag/chip input that lets users build a list of unique
|
|
932
|
+
* string tokens by typing and pressing Enter.
|
|
933
|
+
*
|
|
934
|
+
* **Best practices:**
|
|
935
|
+
*
|
|
936
|
+
* - Pair with `Field.Label` so screen readers announce the field correctly.
|
|
937
|
+
* - Provide a `placeholder` to hint at expected input.
|
|
938
|
+
* - Use `defaultValue` for uncontrolled usage or `value` + `onChange` for controlled.
|
|
939
|
+
* - Use `allowed` to restrict input to a predefined set of values.
|
|
940
|
+
*
|
|
941
|
+
* @param {IFieldTag} props
|
|
942
|
+
* @param {boolean} props.raw - Define whether the component is styled or not.
|
|
943
|
+
* @param {ComponentSizeEnum} props.sizing - The size of the component. Defaults to `medium`.
|
|
944
|
+
* @param {string} props.variant - The style definition used by the component.
|
|
945
|
+
* @param {TComponentShape} props.shape - The shape of the component. Defaults to `smooth`.
|
|
946
|
+
* @param {string[]} props.value - Controlled tag list.
|
|
947
|
+
* @param {string[]} props.defaultValue - Uncontrolled initial tag list.
|
|
948
|
+
* @param {string[]} props.allowed - Optional allowlist; when provided only matching values can be added.
|
|
949
|
+
* @param {(tags: string[]) => void} props.onChange - Called whenever the tag list changes.
|
|
950
|
+
* @param {string} props.error - The error message to display.
|
|
951
|
+
* @param {boolean} props.disabled - Whether the input is disabled.
|
|
952
|
+
* @param {string} props.placeholder - Placeholder shown when the input is empty.
|
|
953
|
+
*/
|
|
954
|
+
declare const FieldTag: {
|
|
955
|
+
(props: IFieldTag): React$1.JSX.Element;
|
|
956
|
+
displayName: string;
|
|
957
|
+
};
|
|
732
958
|
|
|
733
959
|
type MessageBubbleSide = "left" | "right";
|
|
734
960
|
interface IMessageBubbleContext {
|
|
@@ -737,7 +963,8 @@ interface IMessageBubbleContext {
|
|
|
737
963
|
interface IMessageBubbleProperties extends IComponentStyling, React$1.HTMLAttributes<HTMLDivElement> {
|
|
738
964
|
side: MessageBubbleSide;
|
|
739
965
|
}
|
|
740
|
-
interface IMessageBubbleContentProperties extends IComponentStyling, React$1.HTMLAttributes<HTMLDivElement> {
|
|
966
|
+
interface IMessageBubbleContentProperties extends IComponentStyling, IComponentShape, IComponentSize, React$1.HTMLAttributes<HTMLDivElement> {
|
|
967
|
+
variant?: TComponentVariant | TComponentVariantExtended;
|
|
741
968
|
children: string;
|
|
742
969
|
}
|
|
743
970
|
interface IMessageBubbleMetaProperties extends IComponentStyling, React$1.HTMLAttributes<HTMLDivElement> {
|
|
@@ -821,7 +1048,7 @@ interface OTPFieldProps {
|
|
|
821
1048
|
length?: number;
|
|
822
1049
|
onComplete?: (value: string) => void;
|
|
823
1050
|
}
|
|
824
|
-
interface OTPFieldSlotProps {
|
|
1051
|
+
interface OTPFieldSlotProps extends IComponentVariant, IComponentStyling, IComponentShape {
|
|
825
1052
|
index: number;
|
|
826
1053
|
}
|
|
827
1054
|
|
|
@@ -843,7 +1070,7 @@ declare const OTPField: {
|
|
|
843
1070
|
displayName: string;
|
|
844
1071
|
Group: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLSpanElement> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
845
1072
|
Slot: {
|
|
846
|
-
({ index, ...props }: OTPFieldSlotProps & React$1.InputHTMLAttributes<HTMLInputElement>): React$1.JSX.Element | null;
|
|
1073
|
+
({ index, shape, raw, ...props }: OTPFieldSlotProps & React$1.InputHTMLAttributes<HTMLInputElement>): React$1.JSX.Element | null;
|
|
847
1074
|
displayName: string;
|
|
848
1075
|
};
|
|
849
1076
|
};
|
|
@@ -855,7 +1082,7 @@ declare const OTPField: {
|
|
|
855
1082
|
* @returns {ReactElement} The OTPField.Slot component.
|
|
856
1083
|
*/
|
|
857
1084
|
declare const OTPFieldSlot: {
|
|
858
|
-
({ index, ...props }: OTPFieldSlotProps & React$1.InputHTMLAttributes<HTMLInputElement>): React$1.JSX.Element | null;
|
|
1085
|
+
({ index, shape, raw, ...props }: OTPFieldSlotProps & React$1.InputHTMLAttributes<HTMLInputElement>): React$1.JSX.Element | null;
|
|
859
1086
|
displayName: string;
|
|
860
1087
|
};
|
|
861
1088
|
|
|
@@ -1026,31 +1253,6 @@ declare const Portal: {
|
|
|
1026
1253
|
displayName: string;
|
|
1027
1254
|
};
|
|
1028
1255
|
|
|
1029
|
-
type PrivacyType = "password" | "text";
|
|
1030
|
-
interface PrivacyFieldProps extends IField {
|
|
1031
|
-
defaultType?: PrivacyType;
|
|
1032
|
-
textIcon: React$1.ReactNode;
|
|
1033
|
-
passwordIcon: React$1.ReactNode;
|
|
1034
|
-
}
|
|
1035
|
-
/**
|
|
1036
|
-
* PrivacyFields are used to hide sensitive values typed by users.
|
|
1037
|
-
*
|
|
1038
|
-
* @param {PrivacyFieldProps} props - The props for the PrivacyField component.
|
|
1039
|
-
* @param {boolean} props.raw - Define whether the component is styled or not.
|
|
1040
|
-
* @param {ComponentSizeEnum} props.sizing - The size of the component. Defaults to `medium`.
|
|
1041
|
-
* @param {string} props.variant - The style definition used by the component.
|
|
1042
|
-
* @param {string} props.error - The error message to display.
|
|
1043
|
-
* @param {string} props.hint - The hint message to display.
|
|
1044
|
-
* @param {string} props.defaultType - The type of the PrivacyField when rendered.
|
|
1045
|
-
* @param {ReactElement} props.textIcon - The Icon used to convey the text type information.
|
|
1046
|
-
* @param {ReactElement} props.passwordIcon - The Icon used to convey the password type information.
|
|
1047
|
-
* @returns {ReactElement} The PrivacyField component.
|
|
1048
|
-
*/
|
|
1049
|
-
declare const PrivacyField: {
|
|
1050
|
-
({ defaultType, textIcon, passwordIcon, ...restProps }: PrivacyFieldProps): React$1.JSX.Element;
|
|
1051
|
-
displayName: string;
|
|
1052
|
-
};
|
|
1053
|
-
|
|
1054
1256
|
type ResizableEditorProperties = {
|
|
1055
1257
|
defaultWidth?: number;
|
|
1056
1258
|
left: React$1.ReactNode;
|
|
@@ -1176,19 +1378,21 @@ interface IScrollAreaProperties extends React$1.ComponentProps<any> {
|
|
|
1176
1378
|
*/
|
|
1177
1379
|
declare const ScrollArea: ({ scrollbar, children, ...restProps }: IScrollAreaProperties) => React$1.JSX.Element;
|
|
1178
1380
|
|
|
1381
|
+
type SpinnerVariant = "circle" | "circle-filled";
|
|
1179
1382
|
interface SpinnerProperties extends IComponentSize {
|
|
1383
|
+
variant?: SpinnerVariant;
|
|
1180
1384
|
}
|
|
1181
1385
|
/**
|
|
1182
|
-
* Spinners are used to
|
|
1386
|
+
* Spinners are used to convey a loading state information.
|
|
1183
1387
|
*
|
|
1184
|
-
* @param {
|
|
1185
|
-
* @param {
|
|
1388
|
+
* @param {SpinnerProperties} props - The props for the Spinner component.
|
|
1389
|
+
* @param {string} props.sizing - The size of the component. Defaults to `medium`.
|
|
1390
|
+
* @param {SpinnerVariant} props.variant - The spinner animation variant. Defaults to `circle`.
|
|
1186
1391
|
* @returns {ReactElement} The Spinner component.
|
|
1187
1392
|
*/
|
|
1188
1393
|
declare const Spinner: (props: SpinnerProperties) => React$1.JSX.Element;
|
|
1189
1394
|
|
|
1190
|
-
interface SkeletonProperties extends IComponentSize, React$1.ComponentPropsWithRef<"span"> {
|
|
1191
|
-
shape?: TComponentShape;
|
|
1395
|
+
interface SkeletonProperties extends IComponentSize, IComponentShape, React$1.ComponentPropsWithRef<"span"> {
|
|
1192
1396
|
}
|
|
1193
1397
|
/**
|
|
1194
1398
|
* Skeletons are used to convoy a loading state information.
|
|
@@ -1207,8 +1411,10 @@ interface ISwitchComposition {
|
|
|
1207
1411
|
Root: typeof SwitchRoot;
|
|
1208
1412
|
Thumb: typeof SwitchThumb;
|
|
1209
1413
|
}
|
|
1210
|
-
|
|
1414
|
+
type SwitchVariants = "primary" | "accent";
|
|
1415
|
+
interface ISwitchProperties extends React$1.ComponentProps<"button">, IComponentSize, IComponentStyling {
|
|
1211
1416
|
defaultChecked?: boolean;
|
|
1417
|
+
variant?: SwitchVariants;
|
|
1212
1418
|
}
|
|
1213
1419
|
interface ISwitchThumbProperties extends React$1.ComponentProps<"span">, IComponentSize, IComponentStyling {
|
|
1214
1420
|
}
|
|
@@ -1223,7 +1429,7 @@ interface ISwitchThumbProperties extends React$1.ComponentProps<"span">, ICompon
|
|
|
1223
1429
|
* @param {ISwitchProperties} props - The props for the Switch component.
|
|
1224
1430
|
* @param {boolean} props.raw - Whether the switch should be rendered without any styles.
|
|
1225
1431
|
* @param {ComponentSizeEnum} props.sizing - The size of the switch.
|
|
1226
|
-
* @param {
|
|
1432
|
+
* @param {SwitchVariants} props.variant - The variant of the switch.
|
|
1227
1433
|
* @param {boolean} props.defaultChecked - The initial state of the switch.
|
|
1228
1434
|
* @param {ReactNode} props.children - The content to be rendered inside the switch.
|
|
1229
1435
|
* @returns {ReactElement} The Switch component.
|
|
@@ -1430,9 +1636,8 @@ type ScrollContainerProps = {
|
|
|
1430
1636
|
$trackColor?: string;
|
|
1431
1637
|
$thumbHoverColor?: string;
|
|
1432
1638
|
};
|
|
1433
|
-
interface TextareaProps extends React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, IComponentStyling, IComponentSize, IComponentVariant {
|
|
1639
|
+
interface TextareaProps extends React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, IComponentStyling, IComponentSize, IComponentShape, IComponentVariant {
|
|
1434
1640
|
resizable?: boolean;
|
|
1435
|
-
shape?: "square" | "smooth";
|
|
1436
1641
|
}
|
|
1437
1642
|
/**
|
|
1438
1643
|
* Textarea are used to allow users to write large chunks of text.
|
|
@@ -1728,6 +1933,127 @@ declare const TreeContent: {
|
|
|
1728
1933
|
displayName: string;
|
|
1729
1934
|
};
|
|
1730
1935
|
|
|
1936
|
+
interface ISelectTriggerProperties extends IButtonProperties {
|
|
1937
|
+
error?: boolean;
|
|
1938
|
+
children?: React$1.ReactNode;
|
|
1939
|
+
}
|
|
1940
|
+
interface ISelectContentProperties extends IComponentStyling, React$1.ComponentPropsWithRef<"ul"> {
|
|
1941
|
+
defaultOpen?: boolean;
|
|
1942
|
+
}
|
|
1943
|
+
interface ISelectItemProperties extends IComponentStyling, Omit<React$1.ComponentProps<"li">, "onClick"> {
|
|
1944
|
+
value?: string;
|
|
1945
|
+
disabled?: boolean;
|
|
1946
|
+
onClick?: (event: React$1.MouseEvent<HTMLLIElement> | React$1.KeyboardEvent<HTMLLIElement>) => void;
|
|
1947
|
+
}
|
|
1948
|
+
declare const SelectRoot: {
|
|
1949
|
+
({ children }: {
|
|
1950
|
+
children: React$1.ReactElement;
|
|
1951
|
+
}): React$1.JSX.Element;
|
|
1952
|
+
displayName: string;
|
|
1953
|
+
};
|
|
1954
|
+
/**
|
|
1955
|
+
* Select is used to allow users to choose a single value from a list of options.
|
|
1956
|
+
*
|
|
1957
|
+
* **Best practices:**
|
|
1958
|
+
*
|
|
1959
|
+
* - Use a clear and descriptive label for the trigger that accurately conveys he purpose of the select.
|
|
1960
|
+
* - Ensure that the select can be opened and closed using the keyboard.
|
|
1961
|
+
* - Ensure that the select is dismissed when the user clicks outside of it or presses the Esc key.
|
|
1962
|
+
* - Wrap this component with `Select.Root` to provide the necessary context.
|
|
1963
|
+
*
|
|
1964
|
+
* @param {React.ComponentProps<"div">} props - The props for the Select component.
|
|
1965
|
+
* @param {ReactNode} props.children - The content to be rendered inside the select.
|
|
1966
|
+
* @returns {ReactElement} The Select component.
|
|
1967
|
+
*/
|
|
1968
|
+
declare const Select: {
|
|
1969
|
+
({ children }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
1970
|
+
displayName: string;
|
|
1971
|
+
Root: {
|
|
1972
|
+
({ children }: {
|
|
1973
|
+
children: React$1.ReactElement;
|
|
1974
|
+
}): React$1.JSX.Element;
|
|
1975
|
+
displayName: string;
|
|
1976
|
+
};
|
|
1977
|
+
Trigger: {
|
|
1978
|
+
(props: ISelectTriggerProperties): React$1.JSX.Element;
|
|
1979
|
+
displayName: string;
|
|
1980
|
+
};
|
|
1981
|
+
Content: {
|
|
1982
|
+
(props: ISelectContentProperties): React$1.JSX.Element | null;
|
|
1983
|
+
displayName: string;
|
|
1984
|
+
};
|
|
1985
|
+
Item: {
|
|
1986
|
+
(props: ISelectItemProperties): React$1.JSX.Element;
|
|
1987
|
+
displayName: string;
|
|
1988
|
+
};
|
|
1989
|
+
};
|
|
1990
|
+
/**
|
|
1991
|
+
* Select.Trigger is used to control the expansion and collapse of the associated Select.Content component.
|
|
1992
|
+
*
|
|
1993
|
+
* **Best practices:**
|
|
1994
|
+
*
|
|
1995
|
+
* - Use a clear and descriptive label that accurately conveys the purpose of the select field.
|
|
1996
|
+
* - Ensure that the trigger can be operated using only the keyboard.
|
|
1997
|
+
* - Ensure that the focus is properly managed when the trigger is activated.
|
|
1998
|
+
* - Use the `error` prop to indicate a validation error state.
|
|
1999
|
+
*
|
|
2000
|
+
* @param {ISelectTriggerProperties} props - The props for the Select.Trigger component.
|
|
2001
|
+
* @param {ComponentVariantEnum} props.variant - The visual variant of the trigger. Defaults to "secondary".
|
|
2002
|
+
* @param {ComponentShapeEnum} props.shape - The shape of the trigger. Defaults to "smooth".
|
|
2003
|
+
* @param {ComponentSizeEnum} props.sizing - The size of the trigger. Defaults to "medium".
|
|
2004
|
+
* @param {boolean} props.error - Whether the trigger should display an error state. Defaults to false.
|
|
2005
|
+
* @param {boolean} props.disabled - Whether the trigger is disabled.
|
|
2006
|
+
* @param {boolean} props.raw - Define whether the component is styled or not.
|
|
2007
|
+
* @param {ReactNode} props.children - The content to be rendered inside the trigger.
|
|
2008
|
+
* @returns {ReactElement} The Select.Trigger component.
|
|
2009
|
+
*/
|
|
2010
|
+
declare const SelectTrigger: {
|
|
2011
|
+
(props: ISelectTriggerProperties): React$1.JSX.Element;
|
|
2012
|
+
displayName: string;
|
|
2013
|
+
};
|
|
2014
|
+
/**
|
|
2015
|
+
* Select.Content contains the list of options associated with the Select.Trigger component.
|
|
2016
|
+
*
|
|
2017
|
+
* **Best practices:**
|
|
2018
|
+
*
|
|
2019
|
+
* - Ensure that the content is hidden when the select is collapsed.
|
|
2020
|
+
* - Ensure that the content is properly positioned relative to the trigger,
|
|
2021
|
+
* accounting for available viewport space.
|
|
2022
|
+
* - Ensure that the content can be dismissed using the Esc key.
|
|
2023
|
+
*
|
|
2024
|
+
* @param {ISelectContentProperties} props - The props for the Select.Content component.
|
|
2025
|
+
* @param {boolean} props.raw - Define whether the component is styled or not.
|
|
2026
|
+
* @param {boolean} props.defaultOpen - The initial open state of the select. Defaults to false.
|
|
2027
|
+
* @param {ReactNode} props.children - The list of Select.Item components to render.
|
|
2028
|
+
* @returns {ReactElement} The Select.Content component.
|
|
2029
|
+
*/
|
|
2030
|
+
declare const SelectContent: {
|
|
2031
|
+
(props: ISelectContentProperties): React$1.JSX.Element | null;
|
|
2032
|
+
displayName: string;
|
|
2033
|
+
};
|
|
2034
|
+
/**
|
|
2035
|
+
* Select.Item represents a single option within Select.Content.
|
|
2036
|
+
*
|
|
2037
|
+
* **Best practices:**
|
|
2038
|
+
*
|
|
2039
|
+
* - Use a clear and concise label that accurately describes the option.
|
|
2040
|
+
* - Ensure that the item can be selected using only the keyboard (Space or Enter).
|
|
2041
|
+
* - Use the `disabled` prop to prevent selection of unavailable options.
|
|
2042
|
+
* - Provide a meaningful `value` prop that will be stored in the select state upon selection.
|
|
2043
|
+
*
|
|
2044
|
+
* @param {ISelectItemProperties} props - The props for the Select.Item component.
|
|
2045
|
+
* @param {string} props.value - The value associated with this option, stored in the select state on selection.
|
|
2046
|
+
* @param {boolean} props.disabled - Whether the item is disabled and cannot be selected. Defaults to false.
|
|
2047
|
+
* @param {boolean} props.raw - Define whether the component is styled or not.
|
|
2048
|
+
* @param {Function} props.onClick - Optional callback fired when the item is selected via click or keyboard.
|
|
2049
|
+
* @param {ReactNode} props.children - The content to be rendered inside the item.
|
|
2050
|
+
* @returns {ReactElement} The Select.Item component.
|
|
2051
|
+
*/
|
|
2052
|
+
declare const SelectItem: {
|
|
2053
|
+
(props: ISelectItemProperties): React$1.JSX.Element;
|
|
2054
|
+
displayName: string;
|
|
2055
|
+
};
|
|
2056
|
+
|
|
1731
2057
|
declare const useAccordion: () => IComponentAPI;
|
|
1732
2058
|
|
|
1733
2059
|
declare const useCheckbox: () => IComponentAPI;
|
|
@@ -1760,4 +2086,6 @@ declare const useTree: () => IComponentAPI;
|
|
|
1760
2086
|
|
|
1761
2087
|
declare const useTreeNode: () => IComponentAPI;
|
|
1762
2088
|
|
|
1763
|
-
|
|
2089
|
+
declare const useSelect: () => IComponentAPI;
|
|
2090
|
+
|
|
2091
|
+
export { Accordion, AccordionContent, AccordionRoot, AccordionTrigger, AvataStatusEnum, Avatar, AvatarStatus, type AvatarStatusType, Badge, Breadcrumb, type BreadcrumbComposition, BreadcrumbItem, BreadcrumbSeparator, Button, Card, CardBody, type CardComposition, CardGrid, CardMeta, Checkbox, CheckboxIndicator, CheckboxRoot, Collapsible, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, CopyButton, Dialog, DialogControl, DialogMenu, DialogOverlay, DialogRoot, DialogTrigger, Divider, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuRoot, DropdownMenuTrigger, Field, FieldDate, FieldFile, FieldLabel, FieldMeta, FieldNumber, FieldPassword, FieldRoot, FieldTag, FieldWrapper, type IAccordionComposition, type IAccordionContentProperties, type IAccordionProperties, type IAccordionTriggerProperties, type IAvatarBadgeProperties, type IAvatarComposition, type IAvatarProperties, type IBadgeProperties, type IButtonProperties, type ICheckboxComposition, type ICheckboxProperties, type ICollapsibleComposition, type ICollapsibleProperties, type IDialogItemProperties, type IDropdownComposition, type IDropdownContentProperties, type IDropdownItemProperties, type IField, type IFieldComposition, type IFieldDate, type IFieldFile, type IFieldLabel, type IFieldMeta, type IFieldNumber, type IFieldTag, type IMessageBubbleContentProperties, type IMessageBubbleContext, type IMessageBubbleMetaProperties, type IMessageBubbleProperties, type IOTPFieldComposition, type IOverlayProperties, type IPageToolsProperties, type IPageWrapperProperties, type IPortalProperties, type IScrollAreaProperties, type ISelectContentProperties, type ISelectItemProperties, type ISelectTriggerProperties, type ISheetComposition, type ISheetProperties, type ISwitchComposition, type ISwitchProperties, type ISwitchThumbProperties, type ITabsComposition, type ITabsProperties, type ITextShimmerProperties, type IToggleProperties, type IToolbarBodyProperties, type IToolbarComposition, type IToolbarItemProperties, type IToolbarSectionProperties, type ITreeComposition, type ITreeContentProperties, type ITreeNodeProperties, type ITreeProperties, type ITreeRootProperties, type ITreeTriggerProperties, MessageBubble, MessageBubbleContent, MessageBubbleMeta, MessageBubbleRoot, type MessageBubbleSide, MetaVariantEnum, OTPField, OTPFieldSlot, Overlay, Page, PageContent, PageMenu, PageNavigation, PagePanel, PageTools, PageWrapper, Portal, Resizable, ScrollArea, type ScrollContainerProps, Select, SelectContent, SelectItem, SelectRoot, SelectTrigger, Sheet, SheetRoot, SheetTrigger, Shimmer, Skeleton, type SkeletonProperties, Spinner, Switch, SwitchRoot, SwitchThumb, type TMetaVariant, Table, TableBody, TableCell, TableFooter, TableHead, TableHeadCell, TableRow, Tabs, TabsContent, TabsRoot, TabsTrigger, Textarea, type TextareaProps, Toggle, Toolbar, ToolbarItem, ToolbarRoot, ToolbarSection, ToolbarTrigger, Tooltip, Tree, TreeContent, TreeNode, TreeRoot, TreeTrigger, useAccordion, useCheckbox, useCollapsible, useDialog, useDropdownMenu, useField, useMessageBubble, useSelect, useSheet, useSwitch, useTabs, useToolbar, useTree, useTreeNode };
|