@kubit-ui-web/react-components 2.0.0-beta.21 → 2.0.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/breadcrumbs/components/crumbStandAlone/crumbStandAlone.js +1 -1
- package/dist/cjs/components/inputDecoration/inputDecorationStandAlone.js +1 -1
- package/dist/cjs/components/modal/fragments/modalHeader.js +1 -1
- package/dist/cjs/components/modal/modalUnControlled.js +1 -1
- package/dist/cjs/components/option/optionStandAlone.js +1 -1
- package/dist/cjs/components/radioButton/radioButtonStandAlone.js +1 -1
- package/dist/cjs/components/select/index.js +4 -0
- package/dist/cjs/components/select/selectControlled.js +1 -0
- package/dist/cjs/components/select/selectStandAlone.js +1 -0
- package/dist/cjs/components/select/selectUncontrolled.js +1 -0
- package/dist/cjs/components/selectorBoxFile/components/selectorBoxFileContainerBox.js +1 -1
- package/dist/cjs/components/virtualKeyboard/virtualKeyboardStandAlone.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/lib/designSystem/kubit/css/kubit.css +1 -1
- package/dist/cjs/lib/designSystem/kubit/css/kubit.min.css +1 -1
- package/dist/cjs/lib/provider/cssProvider/stats/stats.js +1 -1
- package/dist/cjs/react-components.css +1 -1
- package/dist/esm/components/breadcrumbs/components/crumbStandAlone/crumbStandAlone.js +3 -3
- package/dist/esm/components/inputDecoration/inputDecorationStandAlone.js +2 -2
- package/dist/esm/components/modal/fragments/modalHeader.js +3 -3
- package/dist/esm/components/modal/modalUnControlled.js +2 -2
- package/dist/esm/components/option/optionStandAlone.js +9 -9
- package/dist/esm/components/radioButton/radioButtonStandAlone.js +4 -4
- package/dist/esm/components/select/index.js +2 -0
- package/dist/esm/components/select/selectControlled.js +1 -0
- package/dist/esm/components/select/selectStandAlone.js +5 -0
- package/dist/esm/components/select/selectUncontrolled.js +2 -0
- package/dist/esm/components/selectorBoxFile/components/selectorBoxFileContainerBox.js +8 -8
- package/dist/esm/components/virtualKeyboard/virtualKeyboardStandAlone.js +4 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/designSystem/kubit/css/kubit.css +1 -1
- package/dist/esm/lib/designSystem/kubit/css/kubit.min.css +1 -1
- package/dist/esm/lib/provider/cssProvider/stats/stats.js +1 -1
- package/dist/esm/react-components.css +1 -1
- package/dist/styles/kubit/css/kubit.css +68 -68
- package/dist/styles/kubit/css/kubit.min.css +1 -1
- package/dist/types/index.d.ts +202 -202
- package/package.json +2 -2
- package/dist/cjs/components/dropdownSelected/dropdownSelectedControlled.js +0 -1
- package/dist/cjs/components/dropdownSelected/dropdownSelectedStandAlone.js +0 -1
- package/dist/cjs/components/dropdownSelected/dropdownSelectedUncontrolled.js +0 -1
- package/dist/cjs/components/dropdownSelected/index.js +0 -4
- package/dist/esm/components/dropdownSelected/dropdownSelectedControlled.js +0 -1
- package/dist/esm/components/dropdownSelected/dropdownSelectedStandAlone.js +0 -5
- package/dist/esm/components/dropdownSelected/dropdownSelectedUncontrolled.js +0 -2
- package/dist/esm/components/dropdownSelected/index.js +0 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -454,7 +454,7 @@ export declare interface BreadcrumbsStandAloneProps extends BreadcrumbAriaAttrib
|
|
|
454
454
|
id?: string;
|
|
455
455
|
crumbs: BreadcrumbProps[];
|
|
456
456
|
minCharLimit?: number;
|
|
457
|
-
dividerIcon?:
|
|
457
|
+
dividerIcon?: CommonIconProps;
|
|
458
458
|
lastOneCrumbComponent?: TextComponentType;
|
|
459
459
|
cssClasses?: BreadcrumbsCssClasses;
|
|
460
460
|
}
|
|
@@ -478,7 +478,7 @@ export declare interface BreadcrumbStandAloneProps extends DataAttributes {
|
|
|
478
478
|
crumb: BreadcrumbProps;
|
|
479
479
|
lastCrumb?: boolean;
|
|
480
480
|
lastOneCrumbComponent?: TextComponentType;
|
|
481
|
-
dividerIcon?:
|
|
481
|
+
dividerIcon?: CommonIconProps;
|
|
482
482
|
}
|
|
483
483
|
|
|
484
484
|
export declare type BreadcrumbsVariantStyles<Variant extends string> = BreadcrumbsStyleProps & {
|
|
@@ -556,7 +556,7 @@ export declare interface ButtonProps<Variant = undefined extends string | unknow
|
|
|
556
556
|
export declare interface ButtonStandAloneProps extends PropsWithChildren<ButtonStylesProps>, ButtonAriaProps, DataAttributes {
|
|
557
557
|
type?: HTMLButtonElement['type'];
|
|
558
558
|
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
559
|
-
icon?:
|
|
559
|
+
icon?: CommonIconProps;
|
|
560
560
|
form?: string;
|
|
561
561
|
role?: AriaRole;
|
|
562
562
|
title?: string;
|
|
@@ -1128,7 +1128,7 @@ declare type ComponentSelected<T> = Pick<T, NonVariablesKeys<T>>;
|
|
|
1128
1128
|
|
|
1129
1129
|
declare type ComponentSelected_2<T> = Pick<T, NonVariablesKeys_2<T>>;
|
|
1130
1130
|
|
|
1131
|
-
declare type ComponentsTypesAvailableComponents = 'ACCORDION' | 'ALERT' | 'AVATAR' | 'BADGE' | 'BREADCRUMBS' | 'BUTTON' | 'CALENDAR' | 'CARD_IMAGE' | 'CAROUSEL' | 'CHECKBOX' | 'CHECKBOX_BASE' | 'CHIP' | 'CONTAINER' | 'DATA_TABLE' | 'DOT' | '
|
|
1131
|
+
declare type ComponentsTypesAvailableComponents = 'ACCORDION' | 'ALERT' | 'AVATAR' | 'BADGE' | 'BREADCRUMBS' | 'BUTTON' | 'CALENDAR' | 'CARD_IMAGE' | 'CAROUSEL' | 'CHECKBOX' | 'CHECKBOX_BASE' | 'CHIP' | 'CONTAINER' | 'DATA_TABLE' | 'DOT' | 'ERROR_MESSAGE' | 'ICON' | 'INPUT' | 'INPUT_BASE' | 'INPUT_DECORATION' | 'INPUT_SIGNATURE' | 'ITEM_ROVE' | 'LINK' | 'LINK_AS_BUTTON' | 'LIST_OPTIONS' | 'MODAL' | 'OPTION' | 'OVERLAY' | 'PAGE_CONTROL' | 'PAGINATION' | 'POPOVER' | 'PROGRESS_BAR' | 'RADIO_BUTTON' | 'SELECT' | 'SELECTOR_BOX_FILE' | 'SKELETON' | 'SLIDER' | 'SNACKBAR' | 'STEPPER_NUMBER' | 'TABLE' | 'TABLE_BODY' | 'TABLE_CAPTION' | 'TABLE_CELL' | 'TABLE_DIVIDER' | 'TABLE_FOOT' | 'TABLE_HEAD' | 'TABLE_ROW' | 'TABS' | 'TAG' | 'TEXT' | 'TEXT_AREA' | 'TEXT_COUNT' | 'TOGGLE' | 'TOOLTIP' | 'VIRTUAL_KEYBOARD';
|
|
1132
1132
|
|
|
1133
1133
|
declare type ComponentsTypesComponents = {
|
|
1134
1134
|
ACCORDION: {
|
|
@@ -1244,26 +1244,26 @@ declare type ComponentsTypesComponents = {
|
|
|
1244
1244
|
button: string;
|
|
1245
1245
|
icon: string;
|
|
1246
1246
|
};
|
|
1247
|
-
$
|
|
1247
|
+
$_alternative: {
|
|
1248
1248
|
button: string;
|
|
1249
1249
|
};
|
|
1250
|
-
$
|
|
1250
|
+
$_ghost_alt: {
|
|
1251
1251
|
button: string;
|
|
1252
1252
|
};
|
|
1253
|
-
$
|
|
1253
|
+
$_ghost_primary: {
|
|
1254
1254
|
button: string;
|
|
1255
1255
|
};
|
|
1256
|
-
$
|
|
1256
|
+
$_ghost_secondary: {
|
|
1257
1257
|
button: string;
|
|
1258
1258
|
};
|
|
1259
|
-
$
|
|
1259
|
+
$_primary: {
|
|
1260
1260
|
button: string;
|
|
1261
1261
|
};
|
|
1262
|
-
$
|
|
1262
|
+
$_secondary: {
|
|
1263
1263
|
button: string;
|
|
1264
1264
|
};
|
|
1265
1265
|
dynamic_values: (styles: {
|
|
1266
|
-
$alignText: string;
|
|
1266
|
+
'$alignText': string;
|
|
1267
1267
|
}) => {
|
|
1268
1268
|
string: string;
|
|
1269
1269
|
object: object;
|
|
@@ -1486,51 +1486,6 @@ declare type ComponentsTypesComponents = {
|
|
|
1486
1486
|
dot: string;
|
|
1487
1487
|
};
|
|
1488
1488
|
};
|
|
1489
|
-
DROPDOWN_SELECTED: {
|
|
1490
|
-
dropdown_selected: string;
|
|
1491
|
-
buttonorlinkcontainer: string;
|
|
1492
|
-
iconclosed: string;
|
|
1493
|
-
iconopened: string;
|
|
1494
|
-
labelclosed: string;
|
|
1495
|
-
labelopened: string;
|
|
1496
|
-
listoptionscontainer: string;
|
|
1497
|
-
$_default: {
|
|
1498
|
-
dropdown_selected: string;
|
|
1499
|
-
buttonorlinkcontainer: string;
|
|
1500
|
-
iconclosed: string;
|
|
1501
|
-
iconopened: string;
|
|
1502
|
-
labelclosed: string;
|
|
1503
|
-
labelopened: string;
|
|
1504
|
-
listoptionscontainer: string;
|
|
1505
|
-
};
|
|
1506
|
-
$_side_menu: {
|
|
1507
|
-
dropdown_selected: string;
|
|
1508
|
-
buttonorlinkcontainer: string;
|
|
1509
|
-
iconclosed: string;
|
|
1510
|
-
iconopened: string;
|
|
1511
|
-
labelclosed: string;
|
|
1512
|
-
labelopened: string;
|
|
1513
|
-
listoptionscontainer: string;
|
|
1514
|
-
};
|
|
1515
|
-
$_topbar: {
|
|
1516
|
-
dropdown_selected: string;
|
|
1517
|
-
buttonorlinkcontainer: string;
|
|
1518
|
-
iconclosed: string;
|
|
1519
|
-
iconopened: string;
|
|
1520
|
-
labelclosed: string;
|
|
1521
|
-
labelopened: string;
|
|
1522
|
-
listoptionscontainer: string;
|
|
1523
|
-
};
|
|
1524
|
-
$_topbar_tab: {
|
|
1525
|
-
dropdown_selected: string;
|
|
1526
|
-
buttonorlinkcontainer: string;
|
|
1527
|
-
iconclosed: string;
|
|
1528
|
-
iconopened: string;
|
|
1529
|
-
labelclosed: string;
|
|
1530
|
-
labelopened: string;
|
|
1531
|
-
listoptionscontainer: string;
|
|
1532
|
-
};
|
|
1533
|
-
};
|
|
1534
1489
|
ERROR_MESSAGE: {
|
|
1535
1490
|
error_message: string;
|
|
1536
1491
|
icon: string;
|
|
@@ -1544,11 +1499,11 @@ declare type ComponentsTypesComponents = {
|
|
|
1544
1499
|
complex: string;
|
|
1545
1500
|
svg: string;
|
|
1546
1501
|
dynamic_values: (styles: {
|
|
1547
|
-
$color: string;
|
|
1548
|
-
$moveAround: string;
|
|
1549
|
-
$transitionDuration: string;
|
|
1550
|
-
$height: string;
|
|
1551
|
-
$width: string;
|
|
1502
|
+
'$color': string;
|
|
1503
|
+
'$moveAround': string;
|
|
1504
|
+
'$transitionDuration': string;
|
|
1505
|
+
'$height': string;
|
|
1506
|
+
'$width': string;
|
|
1552
1507
|
}) => {
|
|
1553
1508
|
string: string;
|
|
1554
1509
|
object: object;
|
|
@@ -1852,6 +1807,51 @@ declare type ComponentsTypesComponents = {
|
|
|
1852
1807
|
tooltipasmodal: string;
|
|
1853
1808
|
};
|
|
1854
1809
|
};
|
|
1810
|
+
SELECT: {
|
|
1811
|
+
select: string;
|
|
1812
|
+
buttonorlinkcontainer: string;
|
|
1813
|
+
iconclosed: string;
|
|
1814
|
+
iconopened: string;
|
|
1815
|
+
labelclosed: string;
|
|
1816
|
+
labelopened: string;
|
|
1817
|
+
listoptionscontainer: string;
|
|
1818
|
+
$_default: {
|
|
1819
|
+
select: string;
|
|
1820
|
+
buttonorlinkcontainer: string;
|
|
1821
|
+
iconclosed: string;
|
|
1822
|
+
iconopened: string;
|
|
1823
|
+
labelclosed: string;
|
|
1824
|
+
labelopened: string;
|
|
1825
|
+
listoptionscontainer: string;
|
|
1826
|
+
};
|
|
1827
|
+
$_side_menu: {
|
|
1828
|
+
select: string;
|
|
1829
|
+
buttonorlinkcontainer: string;
|
|
1830
|
+
iconclosed: string;
|
|
1831
|
+
iconopened: string;
|
|
1832
|
+
labelclosed: string;
|
|
1833
|
+
labelopened: string;
|
|
1834
|
+
listoptionscontainer: string;
|
|
1835
|
+
};
|
|
1836
|
+
$_topbar: {
|
|
1837
|
+
select: string;
|
|
1838
|
+
buttonorlinkcontainer: string;
|
|
1839
|
+
iconclosed: string;
|
|
1840
|
+
iconopened: string;
|
|
1841
|
+
labelclosed: string;
|
|
1842
|
+
labelopened: string;
|
|
1843
|
+
listoptionscontainer: string;
|
|
1844
|
+
};
|
|
1845
|
+
$_topbar_tab: {
|
|
1846
|
+
select: string;
|
|
1847
|
+
buttonorlinkcontainer: string;
|
|
1848
|
+
iconclosed: string;
|
|
1849
|
+
iconopened: string;
|
|
1850
|
+
labelclosed: string;
|
|
1851
|
+
labelopened: string;
|
|
1852
|
+
listoptionscontainer: string;
|
|
1853
|
+
};
|
|
1854
|
+
};
|
|
1855
1855
|
SELECTOR_BOX_FILE: {
|
|
1856
1856
|
selector_box_file: string;
|
|
1857
1857
|
actionicon: string;
|
|
@@ -2031,18 +2031,18 @@ declare type ComponentsTypesComponents = {
|
|
|
2031
2031
|
table_cell: string;
|
|
2032
2032
|
};
|
|
2033
2033
|
dynamic_values: (styles: {
|
|
2034
|
-
$tdWidth: string;
|
|
2035
|
-
$tdHeight: string;
|
|
2036
|
-
$tdMinWidth: string;
|
|
2037
|
-
$tdMaxWidth: string;
|
|
2038
|
-
$tdTextAlign: string;
|
|
2039
|
-
$tdVerticalAlign: string;
|
|
2040
|
-
$tdAlignItems: string;
|
|
2041
|
-
$tdJustifyContent: string;
|
|
2042
|
-
$tdTop: string;
|
|
2043
|
-
$tdLeft: string;
|
|
2044
|
-
$tdRight: string;
|
|
2045
|
-
$tdBottom: string;
|
|
2034
|
+
'$tdWidth': string;
|
|
2035
|
+
'$tdHeight': string;
|
|
2036
|
+
'$tdMinWidth': string;
|
|
2037
|
+
'$tdMaxWidth': string;
|
|
2038
|
+
'$tdTextAlign': string;
|
|
2039
|
+
'$tdVerticalAlign': string;
|
|
2040
|
+
'$tdAlignItems': string;
|
|
2041
|
+
'$tdJustifyContent': string;
|
|
2042
|
+
'$tdTop': string;
|
|
2043
|
+
'$tdLeft': string;
|
|
2044
|
+
'$tdRight': string;
|
|
2045
|
+
'$tdBottom': string;
|
|
2046
2046
|
}) => {
|
|
2047
2047
|
string: string;
|
|
2048
2048
|
object: object;
|
|
@@ -3304,124 +3304,6 @@ export declare type DotThemeStyles<variant extends string, size extends string>
|
|
|
3304
3304
|
[s in size]: CssLibPropsType;
|
|
3305
3305
|
};
|
|
3306
3306
|
|
|
3307
|
-
/**
|
|
3308
|
-
* Uncontrolled dropdown component for displaying selectable options.
|
|
3309
|
-
*
|
|
3310
|
-
* This component manages its own open/close state and selected option internally, so you do not need
|
|
3311
|
-
* to control the dropdown state from the parent. It is useful when you want a simple dropdown that handles
|
|
3312
|
-
* its own toggle and selection logic. You can optionally receive state changes via callbacks.
|
|
3313
|
-
*
|
|
3314
|
-
* Internally, it wraps {@link DropdownSelectedControlled} and passes the necessary props.
|
|
3315
|
-
*
|
|
3316
|
-
* @example
|
|
3317
|
-
* ```tsx
|
|
3318
|
-
* <DropdownSelectedUnControlled defaultOpen />
|
|
3319
|
-
* ```
|
|
3320
|
-
*/
|
|
3321
|
-
export declare const DropdownSelected: ForwardRefExoticComponent<DropdownSelectedUnControlledProps & RefAttributes<HTMLDivElement>>;
|
|
3322
|
-
|
|
3323
|
-
/**
|
|
3324
|
-
* Controlled dropdown component for displaying selectable options.
|
|
3325
|
-
*
|
|
3326
|
-
* This component renders a dropdown that is fully controlled by its parent, allowing for custom open/close logic,
|
|
3327
|
-
* keyboard navigation, and flexible theming. It is useful when you need to manage the dropdown state and behavior externally.
|
|
3328
|
-
*
|
|
3329
|
-
* Internally, it wraps {@link DropdownSelectedStandAlone} and handles keyboard focus and scroll-based closing.
|
|
3330
|
-
* Accepts a generic type parameter `<Variant extends string>` to allow for custom variant values, enabling flexible styling.
|
|
3331
|
-
*
|
|
3332
|
-
* @example
|
|
3333
|
-
* ```tsx
|
|
3334
|
-
* <DropdownSelectedControlled open listOptions={options} />
|
|
3335
|
-
*
|
|
3336
|
-
* // With a custom variant type:
|
|
3337
|
-
* type MyVariant = "primary" | "secondary";
|
|
3338
|
-
* <DropdownSelectedControlled<MyVariant> variant="primary" open listOptions={options} />
|
|
3339
|
-
* ```
|
|
3340
|
-
*/
|
|
3341
|
-
export declare const DropdownSelectedControlled: ForwardRefExoticComponent<DropdownSelectedControlledProps<string> & RefAttributes<HTMLDivElement>>;
|
|
3342
|
-
|
|
3343
|
-
/**
|
|
3344
|
-
* Interface for the controlled DropdownSelected component.
|
|
3345
|
-
* Extends the DropdownSelectedStandAloneProps interface and adds a variant and additional CSS classes.
|
|
3346
|
-
*
|
|
3347
|
-
* @template Variant - The type of the variant for the DropdownSelected.
|
|
3348
|
-
*/
|
|
3349
|
-
export declare interface DropdownSelectedControlledProps<Variant = undefined extends string ? unknown : string> extends Omit<DropdownSelectedStandAloneProps, 'listOptionsRef' | 'onButtonKeyDown' | 'component'> {
|
|
3350
|
-
variant?: Variant;
|
|
3351
|
-
additionalClasses?: Partial<DropdownSelectedCssClasses>;
|
|
3352
|
-
}
|
|
3353
|
-
|
|
3354
|
-
declare type DropdownSelectedCssClasses = ComponentSelected<ComponentsTypesComponents['DROPDOWN_SELECTED']>;
|
|
3355
|
-
|
|
3356
|
-
/**
|
|
3357
|
-
* Represents the type for the list options in the DropdownSelected component.
|
|
3358
|
-
*/
|
|
3359
|
-
export declare type DropdownSelectedListOptionsProps = Omit<ListOptionsProps, 'selectedValue' | 'onOptionClick'>;
|
|
3360
|
-
|
|
3361
|
-
declare type DropdownSelectedOmittedProps = 'buttonOrLinkRef' | 'open' | 'onButtonClick' | 'optionSelected' | 'onOptionClick' | 'onClosePopover' | 'onMouseEnter' | 'onMouseLeave' | 'onBlur' | 'onFocus' | 'onKeyDown';
|
|
3362
|
-
|
|
3363
|
-
/**
|
|
3364
|
-
* Represents the type for the popover in the DropdownSelected component.
|
|
3365
|
-
*/
|
|
3366
|
-
export declare type DropdownSelectedPopoverProps = Omit<IPopover, 'children' | 'open'>;
|
|
3367
|
-
|
|
3368
|
-
/**
|
|
3369
|
-
* Interface for the standalone DropdownSelected component.
|
|
3370
|
-
* Includes properties for state, event handlers, and CSS classes.
|
|
3371
|
-
*/
|
|
3372
|
-
export declare interface DropdownSelectedStandAloneProps extends DataAttributes {
|
|
3373
|
-
open: boolean;
|
|
3374
|
-
popover?: DropdownSelectedPopoverProps;
|
|
3375
|
-
onButtonClick: MouseEventHandler<HTMLButtonElement | HTMLLinkElement>;
|
|
3376
|
-
onButtonKeyDown: KeyboardEventHandler<HTMLButtonElement | HTMLLinkElement>;
|
|
3377
|
-
onClosePopover: () => void;
|
|
3378
|
-
label: CommonTextProps;
|
|
3379
|
-
icon: ElementOrIconProps;
|
|
3380
|
-
listOptions: DropdownSelectedListOptionsProps;
|
|
3381
|
-
optionSelected?: string;
|
|
3382
|
-
onOptionClick: (value: string) => void;
|
|
3383
|
-
listOptionsRef: RefObject<HTMLDivElement>;
|
|
3384
|
-
closePopoverOnScroll?: boolean;
|
|
3385
|
-
openAndCloseOnHover?: boolean;
|
|
3386
|
-
url?: string;
|
|
3387
|
-
urlTarget?: HTMLAttributeAnchorTarget;
|
|
3388
|
-
component: 'button' | GenericLinkType;
|
|
3389
|
-
buttonOrLinkRef?: RefObject<HTMLButtonElement>;
|
|
3390
|
-
onFocus?: FocusEventHandler<HTMLDivElement>;
|
|
3391
|
-
onBlur?: FocusEventHandler<HTMLDivElement>;
|
|
3392
|
-
onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
|
|
3393
|
-
cssClasses?: DropdownSelectedCssClasses;
|
|
3394
|
-
}
|
|
3395
|
-
|
|
3396
|
-
export declare interface DropdownSelectedStyleProps extends CssLibPropsType {
|
|
3397
|
-
_buttonOrLinkContainer?: CssLibPropsType;
|
|
3398
|
-
_labelOpened?: CssLibPropsType;
|
|
3399
|
-
_labelClosed?: CssLibPropsType;
|
|
3400
|
-
_iconOpened?: CssLibPropsType;
|
|
3401
|
-
_iconClosed?: CssLibPropsType;
|
|
3402
|
-
_listOptionsContainer?: CssLibPropsType;
|
|
3403
|
-
}
|
|
3404
|
-
|
|
3405
|
-
/**
|
|
3406
|
-
* Interface for the uncontrolled DropdownSelected component.
|
|
3407
|
-
* Extends the DropdownSelectedProps interface and adds default properties.
|
|
3408
|
-
*/
|
|
3409
|
-
export declare interface DropdownSelectedUnControlledProps extends Omit<DropdownSelectedControlledProps, DropdownSelectedOmittedProps> {
|
|
3410
|
-
defaultOpen?: boolean;
|
|
3411
|
-
defaultOptionSelected?: string;
|
|
3412
|
-
onOptionClick?: (value: string) => void;
|
|
3413
|
-
onButtonClick?: (open: boolean) => void;
|
|
3414
|
-
onClosePopover?: (open: boolean) => void;
|
|
3415
|
-
onMouseEnter?: (open: boolean) => void;
|
|
3416
|
-
onMouseLeave?: (open: boolean) => void;
|
|
3417
|
-
onFocus?: (open: boolean) => void;
|
|
3418
|
-
onBlur?: (open: boolean) => void;
|
|
3419
|
-
}
|
|
3420
|
-
|
|
3421
|
-
export declare type DropdownSelectedVariantStyles<Variant extends string> = DropdownSelectedStyleProps & {
|
|
3422
|
-
[key in Variant]: DropdownSelectedStyleProps;
|
|
3423
|
-
};
|
|
3424
|
-
|
|
3425
3307
|
/**
|
|
3426
3308
|
* @name ElementOrIconProps
|
|
3427
3309
|
* @description
|
|
@@ -3908,7 +3790,7 @@ export declare interface InputDecorationProps<Variant = undefined extends string
|
|
|
3908
3790
|
*/
|
|
3909
3791
|
export declare interface InputDecorationStandAloneProps extends DataAttributes {
|
|
3910
3792
|
disabled?: boolean;
|
|
3911
|
-
decoration?:
|
|
3793
|
+
decoration?: CommonIconProps;
|
|
3912
3794
|
cssClasses?: InputDecorationCssClasses;
|
|
3913
3795
|
component?: React.ElementType;
|
|
3914
3796
|
}
|
|
@@ -4446,7 +4328,7 @@ export declare interface ListOptionsStandAloneProps extends DataAttributes {
|
|
|
4446
4328
|
content?: React.ReactNode;
|
|
4447
4329
|
onOptionClick?: (value: string, event: React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLDivElement>) => void;
|
|
4448
4330
|
multiSelect?: boolean;
|
|
4449
|
-
checkedIcon?:
|
|
4331
|
+
checkedIcon?: CommonIconProps;
|
|
4450
4332
|
id?: string;
|
|
4451
4333
|
roveFocus?: UseRoveFocusProps;
|
|
4452
4334
|
index?: number;
|
|
@@ -4589,7 +4471,7 @@ export declare interface ModalStandAloneProps extends DataAttributes {
|
|
|
4589
4471
|
title?: CommonTextProps & {
|
|
4590
4472
|
visible?: boolean;
|
|
4591
4473
|
};
|
|
4592
|
-
closeIcon?:
|
|
4474
|
+
closeIcon?: CommonIconProps;
|
|
4593
4475
|
closeButton?: ModalButtonProps;
|
|
4594
4476
|
contentContainer?: ModalContentContainerProps;
|
|
4595
4477
|
content?: ReactNode;
|
|
@@ -4600,7 +4482,7 @@ export declare interface ModalStandAloneProps extends DataAttributes {
|
|
|
4600
4482
|
onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
|
|
4601
4483
|
onPopoverCloseInternally?: () => void;
|
|
4602
4484
|
cssClasses?: ModalCssClasses;
|
|
4603
|
-
dragIcon?:
|
|
4485
|
+
dragIcon?: CommonIconProps;
|
|
4604
4486
|
}
|
|
4605
4487
|
|
|
4606
4488
|
/**
|
|
@@ -4693,11 +4575,11 @@ export declare interface OptionProps<Variant = undefined extends string ? unknow
|
|
|
4693
4575
|
* Includes ARIA attributes, labels, icons, event handlers, and CSS classes.
|
|
4694
4576
|
*/
|
|
4695
4577
|
export declare interface OptionStandAloneProps extends OptionAriaProps, DataAttributes {
|
|
4696
|
-
icon?:
|
|
4578
|
+
icon?: CommonIconProps;
|
|
4697
4579
|
sublabel?: CommonTextProps;
|
|
4698
4580
|
label: ReactNode;
|
|
4699
4581
|
labelCharsHighlighted?: string;
|
|
4700
|
-
checkedIcon?:
|
|
4582
|
+
checkedIcon?: CommonIconProps;
|
|
4701
4583
|
multiSelect?: boolean;
|
|
4702
4584
|
disabled?: boolean;
|
|
4703
4585
|
selected?: boolean;
|
|
@@ -5081,7 +4963,7 @@ export declare interface RadioButtonStandAloneProps extends RadioButtonAriaProps
|
|
|
5081
4963
|
name?: string;
|
|
5082
4964
|
label?: RadioButtonLabelProps;
|
|
5083
4965
|
errorMessage?: string;
|
|
5084
|
-
errorIcon?:
|
|
4966
|
+
errorIcon?: CommonIconProps;
|
|
5085
4967
|
errorAriaLiveType?: AriaAttributes['aria-live'];
|
|
5086
4968
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
5087
4969
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
@@ -5132,6 +5014,62 @@ declare interface ScreenReaderOnlyProps extends DataAttributes {
|
|
|
5132
5014
|
role?: React.AriaRole;
|
|
5133
5015
|
}
|
|
5134
5016
|
|
|
5017
|
+
/**
|
|
5018
|
+
* Uncontrolled select component for displaying selectable options.
|
|
5019
|
+
*
|
|
5020
|
+
* This component manages its own open/close state and selected option internally, so you do not need
|
|
5021
|
+
* to control the select state from the parent. It is useful when you want a simple select that handles
|
|
5022
|
+
* its own toggle and selection logic. You can optionally receive state changes via callbacks.
|
|
5023
|
+
*
|
|
5024
|
+
* Internally, it wraps {@link SelectControlled} and passes the necessary props.
|
|
5025
|
+
*
|
|
5026
|
+
* @example
|
|
5027
|
+
* ```tsx
|
|
5028
|
+
* <SelectUnControlled defaultOpen />
|
|
5029
|
+
* ```
|
|
5030
|
+
*/
|
|
5031
|
+
export declare const Select: ForwardRefExoticComponent<SelectUnControlledProps & RefAttributes<HTMLDivElement>>;
|
|
5032
|
+
|
|
5033
|
+
/**
|
|
5034
|
+
* Controlled select component for displaying selectable options.
|
|
5035
|
+
*
|
|
5036
|
+
* This component renders a select that is fully controlled by its parent, allowing for custom open/close logic,
|
|
5037
|
+
* keyboard navigation, and flexible theming. It is useful when you need to manage the select state and behavior externally.
|
|
5038
|
+
*
|
|
5039
|
+
* Internally, it wraps {@link SelectStandAlone} and handles keyboard focus and scroll-based closing.
|
|
5040
|
+
* Accepts a generic type parameter `<Variant extends string>` to allow for custom variant values, enabling flexible styling.
|
|
5041
|
+
*
|
|
5042
|
+
* @example
|
|
5043
|
+
* ```tsx
|
|
5044
|
+
* <SelectControlled open listOptions={options} />
|
|
5045
|
+
*
|
|
5046
|
+
* // With a custom variant type:
|
|
5047
|
+
* type MyVariant = "primary" | "secondary";
|
|
5048
|
+
* <SelectControlled<MyVariant> variant="primary" open listOptions={options} />
|
|
5049
|
+
* ```
|
|
5050
|
+
*/
|
|
5051
|
+
export declare const SelectControlled: ForwardRefExoticComponent<SelectControlledProps<string> & RefAttributes<HTMLDivElement>>;
|
|
5052
|
+
|
|
5053
|
+
/**
|
|
5054
|
+
* Interface for the controlled Select component.
|
|
5055
|
+
* Extends the SelectStandAloneProps interface and adds a variant and additional CSS classes.
|
|
5056
|
+
*
|
|
5057
|
+
* @template Variant - The type of the variant for the Select.
|
|
5058
|
+
*/
|
|
5059
|
+
export declare interface SelectControlledProps<Variant = undefined extends string ? unknown : string> extends Omit<SelectStandAloneProps, 'listOptionsRef' | 'onButtonKeyDown' | 'component'> {
|
|
5060
|
+
variant?: Variant;
|
|
5061
|
+
additionalClasses?: Partial<SelectCssClasses>;
|
|
5062
|
+
}
|
|
5063
|
+
|
|
5064
|
+
declare type SelectCssClasses = ComponentSelected<ComponentsTypesComponents['SELECT']>;
|
|
5065
|
+
|
|
5066
|
+
/**
|
|
5067
|
+
* Represents the type for the list options in the Select component.
|
|
5068
|
+
*/
|
|
5069
|
+
export declare type SelectListOptionsProps = Omit<ListOptionsProps, 'selectedValue' | 'onOptionClick'>;
|
|
5070
|
+
|
|
5071
|
+
declare type SelectOmittedProps = 'buttonOrLinkRef' | 'open' | 'onButtonClick' | 'optionSelected' | 'onOptionClick' | 'onClosePopover' | 'onMouseEnter' | 'onMouseLeave' | 'onBlur' | 'onFocus' | 'onKeyDown';
|
|
5072
|
+
|
|
5135
5073
|
/**
|
|
5136
5074
|
* SelectorBoxFile component for file upload with drag-and-drop support.
|
|
5137
5075
|
*
|
|
@@ -5156,10 +5094,10 @@ export declare const SelectorBoxFile: ForwardRefExoticComponent<SelectorBoxFileP
|
|
|
5156
5094
|
*/
|
|
5157
5095
|
export declare type SelectorBoxFileContainerBoxStateContentProps = {
|
|
5158
5096
|
[key in SelectorBoxFileStateType]: {
|
|
5159
|
-
icon?:
|
|
5160
|
-
iconRight?:
|
|
5097
|
+
icon?: CommonIconProps;
|
|
5098
|
+
iconRight?: CommonIconProps;
|
|
5161
5099
|
actionText?: CommonTextProps;
|
|
5162
|
-
actionIcon?:
|
|
5100
|
+
actionIcon?: CommonIconProps;
|
|
5163
5101
|
description?: CommonTextProps;
|
|
5164
5102
|
};
|
|
5165
5103
|
};
|
|
@@ -5237,6 +5175,68 @@ export declare type SelectorBoxFileVariantStyles<Variant extends string> = Selec
|
|
|
5237
5175
|
[key in Variant]?: SelectorBoxFileStyleProps;
|
|
5238
5176
|
};
|
|
5239
5177
|
|
|
5178
|
+
/**
|
|
5179
|
+
* Represents the type for the popover in the Select component.
|
|
5180
|
+
*/
|
|
5181
|
+
export declare type SelectPopoverProps = Omit<IPopover, 'children' | 'open'>;
|
|
5182
|
+
|
|
5183
|
+
/**
|
|
5184
|
+
* Interface for the standalone Select component.
|
|
5185
|
+
* Includes properties for state, event handlers, and CSS classes.
|
|
5186
|
+
*/
|
|
5187
|
+
export declare interface SelectStandAloneProps extends DataAttributes {
|
|
5188
|
+
open: boolean;
|
|
5189
|
+
popover?: SelectPopoverProps;
|
|
5190
|
+
onButtonClick: MouseEventHandler<HTMLButtonElement | HTMLLinkElement>;
|
|
5191
|
+
onButtonKeyDown: KeyboardEventHandler<HTMLButtonElement | HTMLLinkElement>;
|
|
5192
|
+
onClosePopover: () => void;
|
|
5193
|
+
label: CommonTextProps;
|
|
5194
|
+
icon: CommonIconProps;
|
|
5195
|
+
listOptions: SelectListOptionsProps;
|
|
5196
|
+
optionSelected?: string;
|
|
5197
|
+
onOptionClick: (value: string) => void;
|
|
5198
|
+
listOptionsRef: RefObject<HTMLDivElement>;
|
|
5199
|
+
closePopoverOnScroll?: boolean;
|
|
5200
|
+
openAndCloseOnHover?: boolean;
|
|
5201
|
+
url?: string;
|
|
5202
|
+
urlTarget?: HTMLAttributeAnchorTarget;
|
|
5203
|
+
component: 'button' | GenericLinkType;
|
|
5204
|
+
buttonOrLinkRef?: RefObject<HTMLButtonElement>;
|
|
5205
|
+
onFocus?: FocusEventHandler<HTMLDivElement>;
|
|
5206
|
+
onBlur?: FocusEventHandler<HTMLDivElement>;
|
|
5207
|
+
onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
|
|
5208
|
+
cssClasses?: SelectCssClasses;
|
|
5209
|
+
}
|
|
5210
|
+
|
|
5211
|
+
export declare interface SelectStyleProps extends CssLibPropsType {
|
|
5212
|
+
_buttonOrLinkContainer?: CssLibPropsType;
|
|
5213
|
+
_labelOpened?: CssLibPropsType;
|
|
5214
|
+
_labelClosed?: CssLibPropsType;
|
|
5215
|
+
_iconOpened?: CssLibPropsType;
|
|
5216
|
+
_iconClosed?: CssLibPropsType;
|
|
5217
|
+
_listOptionsContainer?: CssLibPropsType;
|
|
5218
|
+
}
|
|
5219
|
+
|
|
5220
|
+
/**
|
|
5221
|
+
* Interface for the uncontrolled Select component.
|
|
5222
|
+
* Extends the SelectProps interface and adds default properties.
|
|
5223
|
+
*/
|
|
5224
|
+
export declare interface SelectUnControlledProps extends Omit<SelectControlledProps, SelectOmittedProps> {
|
|
5225
|
+
defaultOpen?: boolean;
|
|
5226
|
+
defaultOptionSelected?: string;
|
|
5227
|
+
onOptionClick?: (value: string) => void;
|
|
5228
|
+
onButtonClick?: (open: boolean) => void;
|
|
5229
|
+
onClosePopover?: (open: boolean) => void;
|
|
5230
|
+
onMouseEnter?: (open: boolean) => void;
|
|
5231
|
+
onMouseLeave?: (open: boolean) => void;
|
|
5232
|
+
onFocus?: (open: boolean) => void;
|
|
5233
|
+
onBlur?: (open: boolean) => void;
|
|
5234
|
+
}
|
|
5235
|
+
|
|
5236
|
+
export declare type SelectVariantStyles<Variant extends string> = SelectStyleProps & {
|
|
5237
|
+
[key in Variant]: SelectStyleProps;
|
|
5238
|
+
};
|
|
5239
|
+
|
|
5240
5240
|
/**
|
|
5241
5241
|
* Skeleton component for displaying loading placeholders.
|
|
5242
5242
|
*
|
|
@@ -6881,7 +6881,7 @@ export declare interface VirtualKeyboardStandAloneProps extends DataAttributes {
|
|
|
6881
6881
|
onVirtualKeyboardBlur: React.FocusEventHandler<HTMLDivElement>;
|
|
6882
6882
|
onDigitButtonClick: (digit: string, event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
6883
6883
|
onRemoveButtonClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
6884
|
-
icon:
|
|
6884
|
+
icon: CommonIconProps;
|
|
6885
6885
|
cssClasses?: VirtualKeyboardCssClasses;
|
|
6886
6886
|
}
|
|
6887
6887
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubit-ui-web/react-components",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.22",
|
|
4
4
|
"description": "Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Kubit",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"engines": {
|
|
25
|
-
"node": "
|
|
25
|
+
"node": "24"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
28
|
"react",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../_virtual/jsx-runtime.js"),s=require("react"),r=require("../../lib/constants/keyboardKeys/keyboardKeys.js"),o=require("../../lib/hooks/useClassName/useClassName.js"),n=require("../../lib/provider/genericComponentsProvider/genericComponentsProvider.js"),t=require("../../lib/utils/keyboard/keyboard.js"),i=require("../../lib/utils/focusHandlers/focusHandlers.js"),l=require("./dropdownSelectedStandAlone.js"),u=s.forwardRef(({additionalClasses:u,closePopoverOnScroll:a,listOptions:d,onClosePopover:c,open:p,url:f,variant:m,...v},y)=>{const{LINK:C}=n.useGenericComponents(),b=o.useClassName({additionalClassNames:u,component:"DROPDOWN_SELECTED",variant:m}),j=s.useRef(null);return s.useEffect(()=>{if(a)return window.addEventListener("scroll",c),()=>{window.removeEventListener("scroll",c)}},[a,c]),e.jsxRuntimeExports.jsx(l.DropdownSelectedStandAlone,{ref:y,component:f?C:"button",cssClasses:b,listOptions:d,listOptionsRef:j,open:p,onButtonKeyDown:e=>{p&&t.isKeyPressed(e.key,r.TAB.key)&&!e.shiftKey&&j.current&&("selection"===d.type?j.current.firstElementChild?.focus():i.focusFirstDescendant({element:j.current}),e.preventDefault())},onClosePopover:c,...v})});exports.DropdownSelectedControlled=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../_virtual/jsx-runtime.js"),o=require("react"),t=require("../text/text.js"),s=require("../../lib/components/elementOrIcon/elementOrIcon.js"),n=require("../../lib/utils/pickCustomAttributes/pickCustomAttributes.js"),i=require("../../lib/utils/process/processCommonProp.js"),r=require("../../lib/components/customComponent/customComponent.js"),l=require("../listOptions/listOptions.js"),a=require("../listOptions/utils/listOptions.utils.js"),p=require("../popover/popover.js"),c=o.forwardRef(({buttonOrLinkRef:c,component:u,cssClasses:d,icon:m,label:x,listOptions:v,listOptionsRef:b,onBlur:j,onButtonClick:C,onButtonKeyDown:k,onClosePopover:y,onFocus:O,onKeyDown:h,onOptionClick:f,open:M,optionSelected:g,popover:w,url:D,urlTarget:E,...R},q)=>{const F=`dropdownselected-${o.useId().replace(/:/g,"")}`,A=M?`${F}-list`:void 0,S=R["data-testid"]||"dropdown-selected",T=n.pickCustomAttributes(R),I=o.useMemo(()=>{return{currentFocusSelected:-1,keyDownMove:a.keyDownMove(v.options),keyLeftMove:0,keyRightMove:0,keyTabMove:(e=v.options,(o,t)=>{if(t?.shiftKey){const e=Math.max(o,0)-1;return e>=0&&t?.preventDefault(),Math.max(e,0)}const s=Math.max(o,0)+1;return s<=e.length-1&&t?.preventDefault(),Math.min(s,e.length-1)}),keyUpMove:a.keyUpMove,size:v.options.length};var e},[v.options]);return e.jsxRuntimeExports.jsxs("div",{ref:q,className:d?.dropdown_selected,"data-testid":S,role:"combobox",onBlur:j,onFocus:O,onKeyDown:h,...T,"aria-controls":"dropdown-selected-list","aria-expanded":M,tabIndex:0,children:[e.jsxRuntimeExports.jsxs(r.CustomComponent,{ref:c,"aria-controls":A,"aria-expanded":M,"aria-haspopup":"listbox",className:d?.buttonorlinkcontainer,component:u,target:D?E:void 0,type:D?void 0:"button",url:D,onClick:C,onKeyDown:k,children:[e.jsxRuntimeExports.jsx(t.Text,{additionalClasses:{text:M?d?.labelopened:d?.labelclosed},component:"span",...i.processTextProp(x)}),e.jsxRuntimeExports.jsx(s.ElementOrIcon,{className:M?d?.iconopened:d?.iconclosed,rotate:M?"180deg":"0deg",transitionDuration:"0.2s",...m})]}),!!w&&e.jsxRuntimeExports.jsx(p.Popover,{anchorElement:c?.current,component:"div",disableAutoFocusFirstDescendant:!0,disableAutoFocusFirstDescendantAfterClose:!0,disableClickOverlayClose:!1,disableEscapeClose:!1,disableTrapFocus:!0,id:A,open:M,placement:"bottom",preventCloseOnClickElements:[c?.current],strategy:"absolute",...w,onClose:()=>{y(),w?.onClose?.()},children:e.jsxRuntimeExports.jsx("div",{className:d?.listoptionscontainer,"data-testid":`${S}-list`,children:!!v.variant&&!!v.optionVariant&&e.jsxRuntimeExports.jsx(l.ListOptions,{ref:b,roveFocus:"selection"===v.type?I:void 0,selectedValue:g,...v,onOptionClick:e=>{f(e),y()}})})})]})});exports.DropdownSelectedStandAlone=c;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../_virtual/jsx-runtime.js"),o=require("react"),t=require("../../lib/constants/keyboardKeys/keyboardKeys.js"),n=require("./dropdownSelectedControlled.js"),r=o.forwardRef(({defaultOpen:r=!1,defaultOptionSelected:s,onBlur:l,onButtonClick:i,onClosePopover:u,onFocus:d,onOptionClick:c,openAndCloseOnHover:a=!1,...p},f)=>{const[y,C]=o.useState(r),[S,v]=o.useState(s),k=o.useRef(null);o.useEffect(()=>{const e=()=>{document.hidden&&C(!1)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]);return e.jsxRuntimeExports.jsx(n.DropdownSelectedControlled,{...p,ref:f,buttonOrLinkRef:k,open:y,optionSelected:S,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(C(!1),l?.(!1)),a&&(C(!1),l?.(!1))},onButtonClick:()=>{i?.(!y),C(!y)},onClosePopover:()=>{C(!1),u?.(!1)},onFocus:()=>{a&&(C(!0),d?.(!0))},onKeyDown:e=>{t.ESCAPE.key.includes(e.key)&&y&&(k.current?.focus(),C(!1))},onOptionClick:e=>{v(e),c?.(e)}})});exports.DropdownSelected=r,exports.DropdownSelectedUnControlled=r;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const { DropdownSelectedControlled } = require('./dropdownSelectedControlled.js');
|
|
2
|
-
module.exports = { ...module.exports, DropdownSelectedControlled };
|
|
3
|
-
const { DropdownSelected } = require('./dropdownSelectedUncontrolled.js');
|
|
4
|
-
module.exports = { ...module.exports, DropdownSelected };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"../../_virtual/jsx-runtime.js";import{forwardRef as e,useRef as r,useEffect as s}from"react";import{TAB as t}from"../../lib/constants/keyboardKeys/keyboardKeys.js";import{useClassName as n}from"../../lib/hooks/useClassName/useClassName.js";import{useGenericComponents as i}from"../../lib/provider/genericComponentsProvider/genericComponentsProvider.js";import{isKeyPressed as l}from"../../lib/utils/keyboard/keyboard.js";import{focusFirstDescendant as a}from"../../lib/utils/focusHandlers/focusHandlers.js";import{DropdownSelectedStandAlone as m}from"./dropdownSelectedStandAlone.js";const p=e(({additionalClasses:e,closePopoverOnScroll:p,listOptions:d,onClosePopover:c,open:u,url:f,variant:v,...y},C)=>{const{LINK:b}=i(),j=n({additionalClassNames:e,component:"DROPDOWN_SELECTED",variant:v}),k=r(null);return s(()=>{if(p)return window.addEventListener("scroll",c),()=>{window.removeEventListener("scroll",c)}},[p,c]),/* @__PURE__ */o.jsx(m,{ref:C,component:f?b:"button",cssClasses:j,listOptions:d,listOptionsRef:k,open:u,onButtonKeyDown:o=>{u&&l(o.key,t.key)&&!o.shiftKey&&k.current&&("selection"===d.type?k.current.firstElementChild?.focus():a({element:k.current}),o.preventDefault())},onClosePopover:c,...y})});export{p as DropdownSelectedControlled};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as o}from"../../_virtual/jsx-runtime.js";import{forwardRef as e,useId as t,useMemo as s}from"react";import{Text as n}from"../text/text.js";import{ElementOrIcon as i}from"../../lib/components/elementOrIcon/elementOrIcon.js";import{pickCustomAttributes as r}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{processTextProp as l}from"../../lib/utils/process/processCommonProp.js";import{CustomComponent as a}from"../../lib/components/customComponent/customComponent.js";import{ListOptions as p}from"../listOptions/listOptions.js";import{keyUpMove as c,keyDownMove as d}from"../listOptions/utils/listOptions.utils.js";import{Popover as m}from"../popover/popover.js";const u=e(({buttonOrLinkRef:e,component:u,cssClasses:b,icon:v,label:f,listOptions:x,listOptionsRef:C,onBlur:j,onButtonClick:h,onButtonKeyDown:k,onClosePopover:y,onFocus:O,onKeyDown:g,onOptionClick:D,open:w,optionSelected:F,popover:M,url:A,urlTarget:K,...B},N)=>{const E=`dropdownselected-${t().replace(/:/g,"")}`,I=w?`${E}-list`:void 0,R=B["data-testid"]||"dropdown-selected",T=r(B),$=s(()=>{return{currentFocusSelected:-1,keyDownMove:d(x.options),keyLeftMove:0,keyRightMove:0,keyTabMove:(o=x.options,(e,t)=>{if(t?.shiftKey){const o=Math.max(e,0)-1;return o>=0&&t?.preventDefault(),Math.max(o,0)}const s=Math.max(e,0)+1;return s<=o.length-1&&t?.preventDefault(),Math.min(s,o.length-1)}),keyUpMove:c,size:x.options.length};var o},[x.options]);/* @__PURE__ */
|
|
2
|
-
return o.jsxs("div",{ref:N,className:b?.dropdown_selected,"data-testid":R,role:"combobox",onBlur:j,onFocus:O,onKeyDown:g,...T,"aria-controls":"dropdown-selected-list","aria-expanded":w,tabIndex:0,children:[
|
|
3
|
-
/* @__PURE__ */o.jsxs(a,{ref:e,"aria-controls":I,"aria-expanded":w,"aria-haspopup":"listbox",className:b?.buttonorlinkcontainer,component:u,target:A?K:void 0,type:A?void 0:"button",url:A,onClick:h,onKeyDown:k,children:[
|
|
4
|
-
/* @__PURE__ */o.jsx(n,{additionalClasses:{text:w?b?.labelopened:b?.labelclosed},component:"span",...l(f)}),
|
|
5
|
-
/* @__PURE__ */o.jsx(i,{className:w?b?.iconopened:b?.iconclosed,rotate:w?"180deg":"0deg",transitionDuration:"0.2s",...v})]}),!!M&&/* @__PURE__ */o.jsx(m,{anchorElement:e?.current,component:"div",disableAutoFocusFirstDescendant:!0,disableAutoFocusFirstDescendantAfterClose:!0,disableClickOverlayClose:!1,disableEscapeClose:!1,disableTrapFocus:!0,id:I,open:w,placement:"bottom",preventCloseOnClickElements:[e?.current],strategy:"absolute",...M,onClose:()=>{y(),M?.onClose?.()},children:/* @__PURE__ */o.jsx("div",{className:b?.listoptionscontainer,"data-testid":`${R}-list`,children:!!x.variant&&!!x.optionVariant&&/* @__PURE__ */o.jsx(p,{ref:C,roveFocus:"selection"===x.type?$:void 0,selectedValue:F,...x,onOptionClick:o=>{D(o),y()}})})})]})});export{u as DropdownSelectedStandAlone};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e}from"../../_virtual/jsx-runtime.js";import{forwardRef as o,useState as n,useRef as t,useEffect as r}from"react";import{ESCAPE as i}from"../../lib/constants/keyboardKeys/keyboardKeys.js";import{DropdownSelectedControlled as s}from"./dropdownSelectedControlled.js";const c=o(({defaultOpen:o=!1,defaultOptionSelected:c,onBlur:l,onButtonClick:d,onClosePopover:u,onFocus:a,onOptionClick:p,openAndCloseOnHover:m=!1,...f},k)=>{const[v,y]=n(o),[C,b]=n(c),j=t(null);r(()=>{const e=()=>{document.hidden&&y(!1)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]);/* @__PURE__ */
|
|
2
|
-
return e.jsx(s,{...f,ref:k,buttonOrLinkRef:j,open:v,optionSelected:C,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(y(!1),l?.(!1)),m&&(y(!1),l?.(!1))},onButtonClick:()=>{d?.(!v),y(!v)},onClosePopover:()=>{y(!1),u?.(!1)},onFocus:()=>{m&&(y(!0),a?.(!0))},onKeyDown:e=>{i.key.includes(e.key)&&v&&(j.current?.focus(),y(!1))},onOptionClick:e=>{b(e),p?.(e)}})});export{c as DropdownSelected,c as DropdownSelectedUnControlled};
|