@beaubrain/web-design-system 0.1.15 → 0.1.16

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.
@@ -1,24 +1,72 @@
1
+ import { Scope } from '../../core/react';
1
2
  import { CheckboxPropDefs } from '../Checkbox/checkbox.defs';
3
+ import { Content as SelectBoxContent } from '../SelectBox';
2
4
  import { Base } from '../__internal';
3
5
  import { CheckableSelectBoxRootPropDefs } from './checkableSelectBox.defs';
4
6
  import * as React from 'react';
5
7
  declare const DEFAULT_WEIGHT = "regular";
8
+ type CheckableSelectBoxItemChildren = React.ReactNode | ((state: CheckableSelectBoxItemRenderState) => React.ReactNode);
6
9
  export interface CheckableSelectItem {
7
10
  value: string;
8
11
  label: string;
9
12
  disabled?: boolean;
10
13
  }
11
- interface CheckableSelectBoxItemProps extends Omit<React.ComponentPropsWithoutRef<typeof Base.div>, 'onSelect'> {
12
- value: string;
13
- label: string;
14
+ type ScopedProps<P> = P & {
15
+ __scopeCheckableSelectBox?: Scope;
16
+ };
17
+ export type CheckableSelectBoxValueLabelMap = Map<string, string> | Record<string, string>;
18
+ export interface CheckableSelectBoxRootProps {
19
+ value?: string[];
20
+ defaultValue?: string[];
21
+ onValueChange?: (value: string[]) => void;
22
+ valueLabelMap?: CheckableSelectBoxValueLabelMap;
23
+ open?: boolean;
24
+ defaultOpen?: boolean;
25
+ onOpenChange?: (open: boolean) => void;
26
+ children: React.ReactNode;
27
+ size?: (typeof CheckableSelectBoxRootPropDefs.size.values)[number];
28
+ weight?: (typeof CheckableSelectBoxRootPropDefs.weight.values)[number];
29
+ variant?: (typeof CheckableSelectBoxRootPropDefs.variant.values)[number];
30
+ checkboxSize?: (typeof CheckboxPropDefs.size.values)[number];
31
+ checkboxVariant?: (typeof CheckboxPropDefs.variant.values)[number];
32
+ disabled?: boolean;
33
+ displayValueSeparator?: string;
34
+ }
35
+ declare const CheckableSelectBoxRoot: React.FC<ScopedProps<CheckableSelectBoxRootProps>>;
36
+ export interface CheckableSelectBoxTriggerProps extends React.ComponentPropsWithoutRef<typeof Base.button> {
37
+ size?: (typeof CheckableSelectBoxRootPropDefs.size.values)[number];
38
+ variant?: (typeof CheckableSelectBoxRootPropDefs.variant.values)[number];
39
+ }
40
+ declare const CheckableSelectBoxTrigger: React.ForwardRefExoticComponent<CheckableSelectBoxTriggerProps & React.RefAttributes<HTMLButtonElement>>;
41
+ export type CheckableSelectBoxContentProps = React.ComponentPropsWithoutRef<typeof SelectBoxContent>;
42
+ declare const CheckableSelectBoxContent: React.ForwardRefExoticComponent<Omit<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
43
+ asChild?: boolean;
44
+ }, "ref"> & {
45
+ __scopeSelect?: Scope;
46
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
47
+ export type CheckableSelectBoxItemRenderState = {
14
48
  selected: boolean;
49
+ disabled: boolean;
50
+ };
51
+ export interface CheckableSelectBoxItemProps extends Omit<React.ComponentPropsWithoutRef<typeof Base.div>, 'children' | 'onSelect'> {
52
+ value: string;
53
+ label?: string;
15
54
  disabled?: boolean;
16
55
  size?: (typeof CheckableSelectBoxRootPropDefs.size.values)[number];
17
56
  weight?: (typeof CheckableSelectBoxRootPropDefs.weight.values)[number];
18
57
  variant?: (typeof CheckableSelectBoxRootPropDefs.variant.values)[number];
19
58
  checkboxSize?: (typeof CheckboxPropDefs.size.values)[number];
20
59
  checkboxVariant?: (typeof CheckboxPropDefs.variant.values)[number];
21
- onItemSelect: (value: string) => void;
60
+ children?: CheckableSelectBoxItemChildren;
22
61
  }
23
62
  declare const CheckableSelectBoxItem: React.ForwardRefExoticComponent<CheckableSelectBoxItemProps & React.RefAttributes<HTMLDivElement>>;
24
- export { CheckableSelectBoxItem, DEFAULT_WEIGHT };
63
+ export interface CheckableSelectBoxValueProps extends React.ComponentPropsWithoutRef<typeof Base.span> {
64
+ placeholder?: string;
65
+ }
66
+ declare const CheckableSelectBoxValue: React.ForwardRefExoticComponent<CheckableSelectBoxValueProps & React.RefAttributes<HTMLSpanElement>>;
67
+ export interface CheckableSelectBoxSlotProps extends React.ComponentPropsWithoutRef<typeof Base.div> {
68
+ side?: 'left' | 'right';
69
+ 'data-chevron'?: boolean;
70
+ }
71
+ declare const CheckableSelectBoxSlot: React.ForwardRefExoticComponent<CheckableSelectBoxSlotProps & React.RefAttributes<HTMLDivElement>>;
72
+ export { CheckableSelectBoxRoot, CheckableSelectBoxTrigger, CheckableSelectBoxContent, CheckableSelectBoxItem, CheckableSelectBoxValue, CheckableSelectBoxSlot, DEFAULT_WEIGHT, };
@@ -1,25 +1,25 @@
1
- import { CheckboxPropDefs } from '../Checkbox/checkbox.defs';
2
- import { CheckableSelectBoxRootPropDefs } from './checkableSelectBox.defs';
3
- import { CheckableSelectItem } from './checkableSelectBox.base';
4
- export interface CheckableSelectBoxProps {
1
+ import { CheckableSelectBoxContentProps, CheckableSelectBoxItemProps, CheckableSelectBoxItemRenderState, CheckableSelectBoxRootProps, CheckableSelectBoxSlotProps, CheckableSelectBoxTriggerProps, CheckableSelectBoxValueProps, CheckableSelectBoxValueLabelMap, CheckableSelectItem } from './checkableSelectBox.base';
2
+ import * as React from 'react';
3
+ export interface CheckableSelectBoxProps extends Omit<CheckableSelectBoxRootProps, 'children' | 'valueLabelMap' | 'displayValueSeparator'> {
5
4
  items: CheckableSelectItem[];
6
- value?: string[];
7
- defaultValue?: string[];
8
- onValueChange?: (value: string[]) => void;
9
- open?: boolean;
10
- defaultOpen?: boolean;
11
- onOpenChange?: (open: boolean) => void;
12
5
  placeholder?: string;
13
- size?: (typeof CheckableSelectBoxRootPropDefs.size.values)[number];
14
- weight?: (typeof CheckableSelectBoxRootPropDefs.weight.values)[number];
15
- variant?: (typeof CheckableSelectBoxRootPropDefs.variant.values)[number];
16
- checkboxSize?: (typeof CheckboxPropDefs.size.values)[number];
17
- checkboxVariant?: (typeof CheckboxPropDefs.variant.values)[number];
18
- disabled?: boolean;
19
6
  className?: string;
20
7
  maxHeight?: string | number;
21
8
  onScrollBottom?: () => void;
22
9
  }
23
- export declare const CheckableSelectBox: ({ items, value: valueProp, defaultValue, onValueChange, open, defaultOpen, onOpenChange, placeholder, size, weight, variant, checkboxSize, checkboxVariant, disabled, className, maxHeight, onScrollBottom, }: CheckableSelectBoxProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const CheckableSelectBox: (({ items, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, placeholder, size, weight, variant, checkboxSize, checkboxVariant, disabled, className, maxHeight, onScrollBottom, }: CheckableSelectBoxProps) => import("react/jsx-runtime").JSX.Element) & {
11
+ Root: React.FC<CheckableSelectBoxRootProps & {
12
+ __scopeCheckableSelectBox?: import('../../core/react').Scope;
13
+ }>;
14
+ Trigger: React.ForwardRefExoticComponent<CheckableSelectBoxTriggerProps & React.RefAttributes<HTMLButtonElement>>;
15
+ Content: React.ForwardRefExoticComponent<Omit<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
16
+ asChild?: boolean;
17
+ }, "ref"> & {
18
+ __scopeSelect?: import('../../core/react').Scope;
19
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
20
+ Item: React.ForwardRefExoticComponent<CheckableSelectBoxItemProps & React.RefAttributes<HTMLDivElement>>;
21
+ Value: React.ForwardRefExoticComponent<CheckableSelectBoxValueProps & React.RefAttributes<HTMLSpanElement>>;
22
+ Slot: React.ForwardRefExoticComponent<CheckableSelectBoxSlotProps & React.RefAttributes<HTMLDivElement>>;
23
+ };
24
24
  export default CheckableSelectBox;
25
- export type { CheckableSelectItem };
25
+ export type { CheckableSelectBoxRootProps, CheckableSelectBoxTriggerProps, CheckableSelectBoxContentProps, CheckableSelectBoxItemProps, CheckableSelectBoxItemRenderState, CheckableSelectBoxValueProps, CheckableSelectBoxSlotProps, CheckableSelectBoxValueLabelMap, CheckableSelectItem, };
@@ -4,7 +4,7 @@ export { default as Button, type ButtonProps } from './Button/index.js';
4
4
  export { default as Spinner, type SpinnerProps } from './Spinner/index.js';
5
5
  export { default as Checkbox, type CheckboxProps } from './Checkbox/index.js';
6
6
  export { default as ConfirmDialog, type ConfirmDialogProps } from './ConfirmDialog/index.js';
7
- export { default as CheckableSelectBox, type CheckableSelectBoxProps, type CheckableSelectItem, } from './CheckableSelectBox/index.js';
7
+ export { default as CheckableSelectBox, type CheckableSelectBoxProps, type CheckableSelectBoxRootProps, type CheckableSelectBoxTriggerProps, type CheckableSelectBoxContentProps, type CheckableSelectBoxItemProps, type CheckableSelectBoxItemRenderState, type CheckableSelectBoxValueProps, type CheckableSelectBoxSlotProps, type CheckableSelectBoxValueLabelMap, type CheckableSelectItem, } from './CheckableSelectBox/index.js';
8
8
  export { default as Popup, type PopupRootProps, type PopupPortalProps, type PopupOverlayProps, type PopupContentProps, type PopupHeaderProps, type PopupTitleProps, type PopupIconProps, type PopupMessageProps, type PopupBodyProps, type PopupFooterProps, } from './Popup/index.js';
9
9
  export { default as CheckboxGroup, type CheckboxGroupRootProps, type CheckboxGroupItemProps, } from './CheckboxGroup';
10
10
  export { default as Radio, type RadioProps } from './Radio/index.js';