design-system-silkhaus 4.0.0 → 4.0.2

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,6 +1,7 @@
1
1
  import { default as default_2 } from 'react';
2
2
  import { FC } from 'react';
3
3
  import { HTMLAttributes } from 'react';
4
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
4
5
  import { Placement } from '@floating-ui/react';
5
6
  import { PropsWithChildren } from 'react';
6
7
  import { ReactNode } from 'react';
@@ -78,6 +79,24 @@ export declare type DropdownOption = {
78
79
  disabled?: boolean;
79
80
  };
80
81
 
82
+ export declare const DropdownOption: ({ onClick, option, isSelected, showCheckbox, }: {
83
+ onClick: () => void;
84
+ option: DropdownOption;
85
+ isSelected: boolean;
86
+ showCheckbox?: boolean;
87
+ }) => JSX_2.Element;
88
+
89
+ export declare const DropdownOptions: ({ options, isMultiSelect, value, setValue, setIsOpen, onChange, selectAllOptionLabel, disableSelectAll, }: {
90
+ options: DropdownOption[];
91
+ isMultiSelect?: boolean;
92
+ value: DropdownProps["value"];
93
+ setValue: (value: DropdownProps["value"]) => void;
94
+ setIsOpen: (isOpen: boolean) => void;
95
+ onChange?: DropdownProps["onChange"];
96
+ selectAllOptionLabel?: string;
97
+ disableSelectAll?: boolean;
98
+ }) => JSX_2.Element;
99
+
81
100
  export declare interface DropdownProps {
82
101
  /**
83
102
  * The options of the dropdown
@@ -94,7 +113,7 @@ export declare interface DropdownProps {
94
113
  /**
95
114
  * Callback when dropdown value is changed
96
115
  */
97
- onChange?: (selectedOption: DropdownOption | DropdownOption[]) => void;
116
+ onChange?: (selectedOption: DropdownOption | DropdownOption[], isSelectAll?: boolean) => void;
98
117
  /**
99
118
  * Pass this callback function if you want to override the default selected value display text.
100
119
  * By default the dropdown will display the label from the selected option
@@ -142,10 +161,23 @@ export declare interface DropdownProps {
142
161
  * @default 'Close'
143
162
  */
144
163
  closeButtonLabel?: string;
164
+ /**
165
+ * Pass true to disable the select all option in multi-select dropdown
166
+ * @default false
167
+ */
168
+ disableSelectAll?: boolean;
169
+ /**
170
+ * The label for Select all option
171
+ * @default 'Select all'
172
+ */
173
+ selectAllOptionLabel?: string;
174
+ /**
175
+ * The selected value label to show when 'Select All' option is checked
176
+ * @default 'All'
177
+ */
178
+ allSelectedLabel?: string;
145
179
  }
146
180
 
147
- export declare const findOptionByValue: (value: string | string[] | undefined, options: DropdownOption[]) => DropdownOption | DropdownOption[] | undefined;
148
-
149
181
  export declare const MobileDropdown: FC<PropsWithChildren<DropdownProps>>;
150
182
 
151
183
  declare type OptionType = {
package/dist/app/index.js CHANGED
@@ -1,9 +1,10 @@
1
- import { B as s, a as t, b as n, D as p, M as r, f as e } from "../index-CS40ZeSb.js";
1
+ import { B as s, a as n, b as r, D as t, d as a, c as D, M as d } from "../index-ldyQyPdu.js";
2
2
  export {
3
3
  s as Button,
4
- t as ButtonsGroupSelector,
5
- n as DesktopDropdown,
6
- p as Dropdown,
7
- r as MobileDropdown,
8
- e as findOptionByValue
4
+ n as ButtonsGroupSelector,
5
+ r as DesktopDropdown,
6
+ t as Dropdown,
7
+ a as DropdownOption,
8
+ D as DropdownOptions,
9
+ d as MobileDropdown
9
10
  };