@npm-questionpro/wick-ui-lib 2.0.0-next.9 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/dist/base/ui/table.d.ts +1 -1
- package/dist/components/button/WuButton.d.ts +35 -9
- package/dist/components/calendar/WuCalendar.d.ts +48 -0
- package/dist/components/calendar/index.d.ts +1 -5
- package/dist/components/calendar/internal/Dropdown.d.ts +6 -0
- package/dist/components/calendar/internal/RangeWrapper.d.ts +10 -0
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/menu/WuMenu.d.ts +0 -4
- package/dist/components/menu/index.d.ts +1 -1
- package/dist/components/menu/ui/WuMenuItemGroup.d.ts +1 -4
- package/dist/components/menu/ui/WuMenuRadioItem.d.ts +1 -4
- package/dist/components/menu/ui/WuSubMenu.d.ts +1 -4
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/monthPicker/WuMonthPicker.d.ts +2 -4
- package/dist/components/pickers/_shared/PickerShell.d.ts +48 -0
- package/dist/components/pickers/datePicker/WuDatePicker.d.ts +23 -0
- package/dist/components/pickers/datePicker/index.d.ts +1 -0
- package/dist/components/pickers/dateRangePicker/WuDateRangePicker.d.ts +35 -0
- package/dist/components/pickers/dateRangePicker/index.d.ts +1 -0
- package/dist/components/pickers/dateRangePicker/internal/RangeFooter.d.ts +7 -0
- package/dist/components/pickers/dateRangePicker/internal/RangeHeader.d.ts +16 -0
- package/dist/components/pickers/index.d.ts +2 -0
- package/dist/components/radio/WuRadioGroup.d.ts +14 -0
- package/dist/components/segmentedSelector/WuSegmentedSelector.d.ts +13 -0
- package/dist/components/segmentedSelector/hooks/useSegmentedIndicator.d.ts +2 -0
- package/dist/components/segmentedSelector/index.d.ts +4 -0
- package/dist/components/segmentedSelector/subComponents/WuSegmentedSelectorItem.d.ts +6 -0
- package/dist/components/stackedCard/index.d.ts +1 -1
- package/dist/components/stackedCard/utils/helper.d.ts +1 -1
- package/dist/components/surveySelect/index.d.ts +1 -1
- package/dist/components/table/components/dataTable/WuDataTable.d.ts +2 -1
- package/dist/components/table/components/table/WuTable.d.ts +2 -1
- package/dist/components/table/hooks/useRowSelection.d.ts +1 -1
- package/dist/components/tooltip/WuTooltip.d.ts +15 -0
- package/dist/components/typography/WuTypography.d.ts +70 -10
- package/dist/components/typography/iconTypes.d.ts +1 -1
- package/dist/components/virtualScroll/WuVirtualScroll.d.ts +10 -1
- package/dist/index.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/wick-ui-lib/es/index.js +2882 -2839
- package/package.json +17 -32
- package/dist/components/calendar/WuCalender.d.ts +0 -3
- package/dist/components/calendar/components/datePicker/WuDatePicker.d.ts +0 -24
- package/dist/components/calendar/components/dateRangePicker/WuDateRangePicker.d.ts +0 -31
- package/dist/components/calendar/shadcn/calendar.d.ts +0 -7
- package/dist/components/calendar/ui/_footer.d.ts +0 -8
- package/dist/components/calendar/ui/_nativeSidebar.d.ts +0 -17
- package/dist/components/calendar/ui/_sidebar.d.ts +0 -12
- package/dist/components/calendar/ui/_trigger.d.ts +0 -9
- package/dist/components/calendar/utils/index.d.ts +0 -7
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Getting Started
|
|
2
2
|
|
|
3
|
-
Welcome! Whether you're a designer or a developer, this guide will help you get
|
|
4
|
-
|
|
3
|
+
Welcome! Whether you're a designer or a developer, this guide will help you get started and connect you to the essential
|
|
4
|
+
resources you need.
|
|
5
5
|
|
|
6
6
|
#### Table of Contents
|
|
7
7
|
|
|
@@ -15,8 +15,7 @@ started and connect you to the essential resources you need.
|
|
|
15
15
|
npm install @npm-questionpro/wick-ui-lib@latest`
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
- Import the CSS files required for the library. Ideally in your `main.tsx/jsx`
|
|
19
|
-
or `index.tsx/jsx` file.
|
|
18
|
+
- Import the CSS files required for the library. Ideally in your `main.tsx/jsx` or `index.tsx/jsx` file.
|
|
20
19
|
|
|
21
20
|
```tsx
|
|
22
21
|
import '@npm-questionpro/wick-ui-lib/dist/style.css'
|
package/dist/base/ui/table.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTM
|
|
|
7
7
|
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
8
8
|
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
9
|
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
10
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow
|
|
10
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -1,13 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from '@base-ui/react/button';
|
|
3
|
+
export type IWuButtonProps = Button.Props & {
|
|
4
|
+
ref?: React.Ref<HTMLButtonElement | null>;
|
|
5
|
+
/** Icon node rendered alongside the label. Position controlled by `iconPosition`. */
|
|
5
6
|
Icon?: React.ReactNode;
|
|
7
|
+
/** Custom spinner shown while `loading=true`. Defaults to `<WuLoader color="white" size="sm" />`. */
|
|
8
|
+
Loader?: React.ReactNode;
|
|
9
|
+
/** Which side the icon appears on. @default 'left' */
|
|
6
10
|
iconPosition?: 'left' | 'right';
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
/** Visual structure of the button. @default 'primary' */
|
|
12
|
+
variant?: 'primary' | 'secondary' | 'outlined'
|
|
13
|
+
/** @deprecated use variant="outlined" instead */
|
|
14
|
+
| 'outline' | 'link'
|
|
15
|
+
/** @deprecated use size="icon" and variant="secondary" instead */
|
|
16
|
+
| 'iconOnly'
|
|
17
|
+
/** @deprecated use shape="rounded" instead */
|
|
18
|
+
| 'rounded';
|
|
19
|
+
/** Touch target and density. @default 'md' */
|
|
20
|
+
size?: 'sm' | 'md' | 'mobile';
|
|
21
|
+
/** Icon-only button. @default 'false' */
|
|
22
|
+
iconOnly?: boolean;
|
|
23
|
+
/** Semantic color palette. @default 'primary' */
|
|
24
|
+
color?: 'primary' | 'error' | 'upgrade' | 'neutral' | 'deep';
|
|
25
|
+
/** Border-radius style. */
|
|
26
|
+
shape?: 'rounded' | 'sharp' | 'default';
|
|
27
|
+
/** Shows spinner and blocks interaction. Sets `aria-busy`. */
|
|
9
28
|
loading?: boolean;
|
|
29
|
+
/** Adds elevation shadow. Use for FAB-style buttons. */
|
|
30
|
+
floating?: boolean;
|
|
31
|
+
/** Toggled/active state. Sets `aria-pressed`. */
|
|
10
32
|
selected?: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Primary action trigger for user interactions.
|
|
36
|
+
*
|
|
37
|
+
* @summary action trigger — use variant + color to set visual weight and semantic intent
|
|
38
|
+
*/
|
|
39
|
+
export declare const WuButton: React.FC<IWuButtonProps>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DateRange, Matcher, PropsMulti, PropsRange, PropsSingle } from 'react-day-picker';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type ISharedProps = {
|
|
4
|
+
/** Earliest selectable and navigable date. Months before this are unreachable. */
|
|
5
|
+
min?: Date;
|
|
6
|
+
/** Latest selectable and navigable date. Months after this are unreachable. */
|
|
7
|
+
max?: Date;
|
|
8
|
+
/** Dates to disable. Accepts any react-day-picker Matcher — e.g. `{before: new Date()}` or `{dayOfWeek: [0, 6]}`. */
|
|
9
|
+
disabled?: Matcher | Matcher[];
|
|
10
|
+
};
|
|
11
|
+
type ISingleProps = ISharedProps & {
|
|
12
|
+
/** @default 'single' */
|
|
13
|
+
mode?: 'single';
|
|
14
|
+
/** Controlled selected date. */
|
|
15
|
+
selected?: Date;
|
|
16
|
+
/** Called when the user selects or deselects a date. */
|
|
17
|
+
onSelect?: PropsSingle['onSelect'];
|
|
18
|
+
/** Prevents deselecting the current date when clicked again. */
|
|
19
|
+
required?: boolean;
|
|
20
|
+
/** Initial month to display on mount. Falls back to the current month. */
|
|
21
|
+
defaultMonth?: Date;
|
|
22
|
+
};
|
|
23
|
+
type IMultipleProps = ISharedProps & {
|
|
24
|
+
mode: 'multiple';
|
|
25
|
+
/** Controlled array of selected dates. */
|
|
26
|
+
selected?: Date[];
|
|
27
|
+
/** Called when the selection changes. */
|
|
28
|
+
onSelect?: PropsMulti['onSelect'];
|
|
29
|
+
};
|
|
30
|
+
type IRangeProps = ISharedProps & {
|
|
31
|
+
mode: 'range';
|
|
32
|
+
/** Controlled selected range with `from` and `to`. */
|
|
33
|
+
selected?: DateRange;
|
|
34
|
+
/** Called when the range changes. */
|
|
35
|
+
onSelect?: PropsRange['onSelect'];
|
|
36
|
+
/** Which panel shows the current month — the other panel shows the adjacent month. @default 'end' */
|
|
37
|
+
currentMonthPosition?: 'start' | 'end';
|
|
38
|
+
/** Initial month to display on mount. Overrides the `currentMonthPosition` default. */
|
|
39
|
+
defaultMonth?: Date;
|
|
40
|
+
};
|
|
41
|
+
export type IWuCalendarProps = ISingleProps | IMultipleProps | IRangeProps;
|
|
42
|
+
/**
|
|
43
|
+
* Date picker built on react-day-picker with WuDesign styling.
|
|
44
|
+
*
|
|
45
|
+
* @summary Calendar for selecting single dates, multiple dates, or date ranges.
|
|
46
|
+
*/
|
|
47
|
+
export declare function WuCalendar(props: IWuCalendarProps): React.JSX.Element;
|
|
48
|
+
export {};
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { IWuDatePickerProps } from './components/datePicker/WuDatePicker';
|
|
3
|
-
export { WuDateRangePicker } from './components/dateRangePicker/WuDateRangePicker';
|
|
4
|
-
export type { IWuDateRangePickerProps } from './components/dateRangePicker/WuDateRangePicker';
|
|
5
|
-
export { WuCalender } from './WuCalender';
|
|
1
|
+
export { WuCalendar, type IWuCalendarProps } from './WuCalendar';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DropdownOption } from 'react-day-picker';
|
|
2
|
+
import { SelectHTMLAttributes } from 'react';
|
|
3
|
+
export type IWuCalendarDropdownProps = {
|
|
4
|
+
options?: DropdownOption[];
|
|
5
|
+
} & Omit<SelectHTMLAttributes<HTMLSelectElement>, 'children'>;
|
|
6
|
+
export declare function WuCalendarDropdown({ options, value, onChange }: IWuCalendarDropdownProps): React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateRange, PropsBase, PropsRange } from 'react-day-picker';
|
|
3
|
+
type IRangeCalendarProps = Partial<PropsBase> & {
|
|
4
|
+
selected?: DateRange;
|
|
5
|
+
onSelect?: PropsRange['onSelect'];
|
|
6
|
+
currentMonthPosition?: 'start' | 'end';
|
|
7
|
+
defaultMonth?: Date;
|
|
8
|
+
};
|
|
9
|
+
export declare function RangeCalendar({ disabled, selected, onSelect, currentMonthPosition, defaultMonth, ...dayPickerProps }: IRangeCalendarProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { IWuComboboxDivider, IWuComboboxGroup, IWuComboboxItem, IWuComboboxOption
|
|
1
|
+
export type { IWuComboboxDivider, IWuComboboxGroup, IWuComboboxItem, IWuComboboxOption } from './types/IWuComboboxOptions';
|
|
2
2
|
export { WuCombobox } from './WuCombobox';
|
|
3
3
|
export type { IWuComboboxProps } from './WuCombobox';
|
|
@@ -2,10 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { DropdownMenu } from '@/base/ui/dropdownMenu';
|
|
3
3
|
export interface IWuMenuProps extends Omit<React.ComponentProps<typeof DropdownMenu>, 'open' | 'onOpenChange'> {
|
|
4
4
|
name?: string;
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated This property is no longer recommended. Use `MenuTitle` instead.
|
|
7
|
-
*/
|
|
8
|
-
menuTitle?: string;
|
|
9
5
|
MenuTitle?: React.ReactNode;
|
|
10
6
|
Trigger?: React.ReactElement<HTMLBaseElement>;
|
|
11
7
|
variant?: 'flat' | 'outlined';
|
|
@@ -3,7 +3,7 @@ export type { IWuMenuCheckboxItemProps } from './ui/WuMenuCheckboxItem';
|
|
|
3
3
|
export { WuMenuItem } from './ui/WuMenuItem';
|
|
4
4
|
export { WuMenuItemGroup } from './ui/WuMenuItemGroup';
|
|
5
5
|
export { WuMenuRadioItem } from './ui/WuMenuRadioItem';
|
|
6
|
-
export type { IWuMenuRadioItemOption, IWuMenuRadioItemProps
|
|
6
|
+
export type { IWuMenuRadioItemOption, IWuMenuRadioItemProps } from './ui/WuMenuRadioItem';
|
|
7
7
|
export { WuMenuSeparatorItem } from './ui/WuMenuSeparatorItem';
|
|
8
8
|
export { WuSubMenu } from './ui/WuSubMenu';
|
|
9
9
|
export { WuMenu } from './WuMenu';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { DropdownMenuGroup } from '@/base/ui/dropdownMenu';
|
|
2
3
|
export declare const WuMenuItemGroup: React.FC<React.ComponentProps<typeof DropdownMenuGroup> & {
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated This property is no longer recommended. Use `Label` instead.
|
|
5
|
-
*/
|
|
6
|
-
label?: string;
|
|
7
4
|
Label: React.ReactNode;
|
|
8
5
|
}>;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { DropdownMenuSub } from '@/base/ui/dropdownMenu';
|
|
2
3
|
export interface IWuSubMenuProps extends Omit<React.ComponentProps<typeof DropdownMenuSub>, 'onOpenChange'> {
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated This property is no longer recommended. Use `Label` instead.
|
|
5
|
-
*/
|
|
6
|
-
label?: string;
|
|
7
4
|
Label: React.ReactNode;
|
|
8
5
|
open?: boolean;
|
|
9
6
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { WuModal, WuModalClose, WuModalContent, WuModalFooter, WuModalHeader
|
|
1
|
+
export { WuModal, WuModalClose, WuModalContent, WuModalFooter, WuModalHeader } from './WuModal';
|
|
2
2
|
export type { IWuModalProps } from './WuModal';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export type IWuMonthPickerProps = Omit<
|
|
2
|
+
import { IPickerShellProps } from '../pickers/_shared/PickerShell';
|
|
3
|
+
export type IWuMonthPickerProps = Omit<IPickerShellProps, 'Label'> & {
|
|
4
4
|
value?: Date | string;
|
|
5
5
|
onChange?: (value: Date) => void;
|
|
6
6
|
min?: Date | string;
|
|
@@ -8,8 +8,6 @@ export type IWuMonthPickerProps = Omit<React.ComponentProps<typeof WuDatePickerT
|
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
Label?: React.ReactNode;
|
|
10
10
|
labelPosition?: 'top' | 'left' | 'right';
|
|
11
|
-
id?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
11
|
readonly?: boolean;
|
|
14
12
|
disabledMonths?: (`${number}-${number}-${number}` | Date)[];
|
|
15
13
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IPickerShellProps extends Omit<React.ComponentProps<'button'>, 'value' | 'onChange'> {
|
|
3
|
+
/** Label rendered above (or beside) the trigger. */
|
|
4
|
+
Label?: React.ReactNode;
|
|
5
|
+
/** Position of the label relative to the trigger. @default 'top' */
|
|
6
|
+
labelPosition?: 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
+
/** Controlled open state of the popover. */
|
|
8
|
+
open?: boolean;
|
|
9
|
+
/** Called when the popover opens or closes. */
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
/** Placeholder shown when no value is selected. @default 'Select date' */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** Called when the user clicks Reset. */
|
|
14
|
+
onReset?: () => void;
|
|
15
|
+
/** @deprecated Will not be supported in future versions */
|
|
16
|
+
formatString?: string;
|
|
17
|
+
/** Popover placement relative to the trigger. */
|
|
18
|
+
position?: {
|
|
19
|
+
align: 'start' | 'end';
|
|
20
|
+
alignOffset?: number;
|
|
21
|
+
side: 'bottom' | 'top';
|
|
22
|
+
sideOffset?: number;
|
|
23
|
+
};
|
|
24
|
+
/** @deprecated Use position.align instead */
|
|
25
|
+
align?: 'start' | 'end';
|
|
26
|
+
/** @deprecated Use position.alignOffset instead */
|
|
27
|
+
alignOffset?: number;
|
|
28
|
+
/** @deprecated Use position.side instead */
|
|
29
|
+
side?: 'bottom' | 'top';
|
|
30
|
+
/** @deprecated Use position.sideOffset instead */
|
|
31
|
+
sideOffset?: number;
|
|
32
|
+
/** Replaces the default trigger. Receives the formatted value string. */
|
|
33
|
+
CustomTrigger?: (formattedText?: string) => React.ReactElement;
|
|
34
|
+
/** Visual style of the trigger button. @default 'outlined' */
|
|
35
|
+
variant?: 'primary' | 'outlined';
|
|
36
|
+
/** Marks the trigger as invalid — applies error border styling. */
|
|
37
|
+
invalid?: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface IPickerShellInternalProps extends IPickerShellProps {
|
|
40
|
+
formattedText?: string;
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
Footer?: React.ReactNode;
|
|
43
|
+
Header?: React.ReactNode;
|
|
44
|
+
onApply?: () => void;
|
|
45
|
+
disableApply?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare function PickerShell({ children, className, Label, labelPosition, open, onOpenChange, placeholder, formattedText, Header, Footer, onApply, onReset, invalid, disableApply, position, CustomTrigger, variant, ...props }: IPickerShellInternalProps): React.JSX.Element;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IWuCalendarProps } from '../../calendar';
|
|
3
|
+
import { IPickerShellProps } from '../_shared/PickerShell';
|
|
4
|
+
export interface IWuDatePickerProps extends IPickerShellProps {
|
|
5
|
+
/** Controlled selected date. Accepts a `Date` object or an ISO date string. */
|
|
6
|
+
value?: Date | string;
|
|
7
|
+
/** Called when the user confirms a selection via Apply. */
|
|
8
|
+
onChange?: (date?: Date) => void;
|
|
9
|
+
/** Earliest selectable and navigable date. */
|
|
10
|
+
minDate?: Date;
|
|
11
|
+
/** Latest selectable and navigable date. */
|
|
12
|
+
maxDate?: Date;
|
|
13
|
+
/** Dates to disable. Accepts any react-day-picker Matcher — e.g. `{before: new Date()}`. */
|
|
14
|
+
disabledDate?: IWuCalendarProps['disabled'];
|
|
15
|
+
/** Prevents Apply until a date is selected. */
|
|
16
|
+
required?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Popover-based single date picker with a calendar, label, and Apply / Reset actions.
|
|
20
|
+
*
|
|
21
|
+
* @summary Pick a single date from a popover calendar; supports controlled value, bounds, and disabled dates.
|
|
22
|
+
*/
|
|
23
|
+
export declare function WuDatePicker({ value, onChange, minDate, maxDate, disabledDate, required, Label, onReset, formatString, ...props }: IWuDatePickerProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WuDatePicker';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IWuCalendarProps } from '../../calendar';
|
|
3
|
+
import { IPickerShellProps } from '../_shared/PickerShell';
|
|
4
|
+
import { DateRange } from 'react-day-picker';
|
|
5
|
+
import { IRangeHeaderProps } from './internal/RangeHeader';
|
|
6
|
+
export interface IWuDateRangePickerProps extends Omit<IPickerShellProps, 'onChange' | 'children' | 'value'> {
|
|
7
|
+
/** Controlled selected date range with `from` and `to`. */
|
|
8
|
+
value?: DateRange;
|
|
9
|
+
/** Called when the user confirms a range via Apply. */
|
|
10
|
+
onChange?: (range?: DateRange) => void;
|
|
11
|
+
/** Called when the user clicks Reset. */
|
|
12
|
+
onReset?: () => void;
|
|
13
|
+
/** Earliest selectable and navigable date. */
|
|
14
|
+
minDate?: Date;
|
|
15
|
+
/** Latest selectable and navigable date. */
|
|
16
|
+
maxDate?: Date;
|
|
17
|
+
/** Dates to disable. Accepts any react-day-picker Matcher. */
|
|
18
|
+
disabledDate?: IWuCalendarProps['disabled'];
|
|
19
|
+
/** Additional preset items appended to the header dropdown. Each item needs a unique `value` number. */
|
|
20
|
+
presetRanges?: IRangeHeaderProps['presetRanges'];
|
|
21
|
+
/** Whether to include the built-in presets (Last week, Last month…). @default true */
|
|
22
|
+
append?: IRangeHeaderProps['append'];
|
|
23
|
+
/** Whether rolling presets (e.g. Last week) include today as the end date. @default false */
|
|
24
|
+
includeToday?: IRangeHeaderProps['includeToday'];
|
|
25
|
+
/** Which panel shows the current month when no selection is present. @default 'end' */
|
|
26
|
+
currentMonthPosition?: 'start' | 'end';
|
|
27
|
+
/** Prevents Apply until both `from` and `to` are selected. */
|
|
28
|
+
required?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Popover-based date range picker with preset shortcuts, inline text inputs, and Apply / Reset actions.
|
|
32
|
+
*
|
|
33
|
+
* @summary Pick a date range from a popover calendar; supports preset shortcuts, bounds, and controlled value.
|
|
34
|
+
*/
|
|
35
|
+
export declare function WuDateRangePicker({ value, onChange, onReset, minDate, maxDate, disabledDate, Label, presetRanges, append, includeToday, currentMonthPosition, required, formatString, onOpenChange, ...props }: IWuDateRangePickerProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WuDateRangePicker';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateRange } from 'react-day-picker';
|
|
3
|
+
export interface IRangeFooterProps {
|
|
4
|
+
selected?: DateRange;
|
|
5
|
+
onSelect?: (range: DateRange) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function RangeFooter({ selected, onSelect }: IRangeFooterProps): React.JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateRange } from 'react-day-picker';
|
|
3
|
+
export type IPresetItem = {
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
/** Hardcoded date range — when present, used as-is instead of computing from `value` */
|
|
7
|
+
range?: DateRange;
|
|
8
|
+
};
|
|
9
|
+
export interface IRangeHeaderProps {
|
|
10
|
+
presetRanges?: IPresetItem[];
|
|
11
|
+
append?: boolean;
|
|
12
|
+
includeToday?: boolean;
|
|
13
|
+
selected?: DateRange;
|
|
14
|
+
onSelect?: (d: DateRange) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function RangeHeader({ presetRanges, append, includeToday, selected, onSelect, }: IRangeHeaderProps): React.JSX.Element;
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IWuRadioOption } from './types/IWuRadioOption';
|
|
3
3
|
export interface IWuRadioGroupProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
4
|
+
/** Radio options to render. Each requires `label` and `value`; optionally `disabled` or `required`. */
|
|
4
5
|
options: IWuRadioOption[];
|
|
6
|
+
/** Initially selected value for uncontrolled usage. */
|
|
5
7
|
defaultValue?: string;
|
|
8
|
+
/** Disables every option in the group. */
|
|
6
9
|
disabled?: boolean;
|
|
10
|
+
/** Called with the new value when the selection changes. */
|
|
7
11
|
onChange?: (e: string) => void;
|
|
12
|
+
/** Label for the whole group. */
|
|
8
13
|
label?: string;
|
|
14
|
+
/** ID forwarded to the underlying RadioGroup root. */
|
|
9
15
|
id?: string;
|
|
16
|
+
/** Text direction. */
|
|
10
17
|
dir?: 'ltr' | 'rtl';
|
|
18
|
+
/** Layout orientation of the options. @default 'vertical' */
|
|
19
|
+
orientation?: 'horizontal' | 'vertical';
|
|
11
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Group of radio buttons for single-choice selection.
|
|
23
|
+
*
|
|
24
|
+
* @summary Single-choice selector; supports vertical/horizontal orientation, disabled states, and RTL.
|
|
25
|
+
*/
|
|
12
26
|
export declare const WuRadioGroup: React.FC<IWuRadioGroupProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ToggleGroup } from '@base-ui/react/toggle-group';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface IWuSegmentedSelectorProps extends Omit<ToggleGroup.Props, 'value' | 'defaultValue' | 'onValueChange' | 'onChange' | 'multiple' | 'orientation'> {
|
|
4
|
+
value?: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
iconOnly?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const WuSegmentedSelector: {
|
|
11
|
+
({ value, defaultValue, onChange, size, iconOnly, disabled, className, children, ...props }: IWuSegmentedSelectorProps): React.JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { WuSegmentedSelector } from './WuSegmentedSelector';
|
|
2
|
+
export type { IWuSegmentedSelectorProps } from './WuSegmentedSelector';
|
|
3
|
+
export { WuSegmentedSelectorItem } from './subComponents/WuSegmentedSelectorItem';
|
|
4
|
+
export type { IWuSegmentedSelectorItemProps } from './subComponents/WuSegmentedSelectorItem';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Toggle } from '@base-ui/react/toggle';
|
|
2
|
+
export interface IWuSegmentedSelectorItemProps extends Omit<Toggle.Props, 'className'> {
|
|
3
|
+
value: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const WuSegmentedSelectorItem: import("react").ForwardRefExoticComponent<Omit<IWuSegmentedSelectorItemProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { IWuStackedCardProps, IWuStackedCardOverlayProps
|
|
1
|
+
export type { IWuStackedCardProps, IWuStackedCardOverlayProps } from './WuStackedCard';
|
|
2
2
|
export { WuStackedCardOverlay, WuStackedCard } from './WuStackedCard';
|
|
3
3
|
export { calculatePosition } from './utils/helper';
|
|
@@ -12,5 +12,5 @@ interface ICalcPosResult {
|
|
|
12
12
|
position: number;
|
|
13
13
|
styles: CSSProperties;
|
|
14
14
|
}
|
|
15
|
-
export declare const calculatePosition: ({ index, viewIndex, length, itemHeight
|
|
15
|
+
export declare const calculatePosition: ({ index, viewIndex, length, itemHeight }: ICalcPosProps) => ICalcPosResult;
|
|
16
16
|
export {};
|
|
@@ -3,4 +3,4 @@ export { WuSurveyItem } from './subComponents/WuSurveyItem';
|
|
|
3
3
|
export { WuSurveyList } from './subComponents/WuSurveyList';
|
|
4
4
|
export { WuSurveySource } from './subComponents/WuSurveySource';
|
|
5
5
|
export { WuSurveySelect, type IWuSurveySelectProps } from './WuSurveySelect';
|
|
6
|
-
export type { IWuSharedSurveyProps, IWuSurveyItemProps, IWuSurveyListProps, IWuSurveySourceProps
|
|
6
|
+
export type { IWuSharedSurveyProps, IWuSurveyItemProps, IWuSurveyListProps, IWuSurveySourceProps } from './types';
|
|
@@ -19,6 +19,7 @@ export interface IWuDataTableProps<T> extends React.TableHTMLAttributes<HTMLTabl
|
|
|
19
19
|
HeaderAction?: React.ReactNode;
|
|
20
20
|
NoDataContent?: React.ReactNode;
|
|
21
21
|
stickyHeader?: boolean;
|
|
22
|
+
maxHeight?: number | string;
|
|
22
23
|
isRowExpandable?: boolean;
|
|
23
24
|
hideHeader?: boolean;
|
|
24
25
|
virtualization?: {
|
|
@@ -28,4 +29,4 @@ export interface IWuDataTableProps<T> extends React.TableHTMLAttributes<HTMLTabl
|
|
|
28
29
|
};
|
|
29
30
|
tableLayout?: 'fixed' | 'auto';
|
|
30
31
|
}
|
|
31
|
-
export declare const WuDataTable: <T>({ data, columns, isLoading, variant, sort, size, rowSelection, HeaderAction, NoDataContent, stickyHeader, CustomLoader, caption, virtualization, isRowExpandable, hideHeader, tableLayout, style, className, ...props }: IWuDataTableProps<T>) => React.JSX.Element;
|
|
32
|
+
export declare const WuDataTable: <T>({ data, columns, isLoading, variant, sort, size, rowSelection, HeaderAction, NoDataContent, stickyHeader, maxHeight, CustomLoader, caption, virtualization, isRowExpandable, hideHeader, tableLayout, style, className, ...props }: IWuDataTableProps<T>) => React.JSX.Element;
|
|
@@ -19,6 +19,7 @@ export interface IWuTableProps<T> extends React.TableHTMLAttributes<HTMLTableEle
|
|
|
19
19
|
pageSize: number;
|
|
20
20
|
};
|
|
21
21
|
stickyHeader?: boolean;
|
|
22
|
+
maxHeight?: number | string;
|
|
22
23
|
HeaderAction?: React.ReactNode;
|
|
23
24
|
CustomLoader?: React.ReactNode;
|
|
24
25
|
NoDataContent?: React.ReactNode;
|
|
@@ -32,4 +33,4 @@ export interface IWuTableProps<T> extends React.TableHTMLAttributes<HTMLTableEle
|
|
|
32
33
|
};
|
|
33
34
|
tableLayout?: 'fixed' | 'auto';
|
|
34
35
|
}
|
|
35
|
-
export declare const WuTable: <T>({ data, columns, variant, size, sort, filterText, pagination, stickyHeader, HeaderAction, CustomLoader, NoDataContent, isLoading, caption, rowSelection, isRowExpandable, hideHeader, virtualization, tableLayout, style, className, ...rest }: IWuTableProps<T>) => React.JSX.Element;
|
|
36
|
+
export declare const WuTable: <T>({ data, columns, variant, size, sort, filterText, pagination, stickyHeader, maxHeight, HeaderAction, CustomLoader, NoDataContent, isLoading, caption, rowSelection, isRowExpandable, hideHeader, virtualization, tableLayout, style, className, ...rest }: IWuTableProps<T>) => React.JSX.Element;
|
|
@@ -7,5 +7,5 @@ interface IUseRowSelectionProps<T> {
|
|
|
7
7
|
interface IUseRowSelectionResult<T> {
|
|
8
8
|
finalColumns: IWuTableColumnDef<T>[];
|
|
9
9
|
}
|
|
10
|
-
export declare const useRowSelection: <T>({ columns, rowSelection
|
|
10
|
+
export declare const useRowSelection: <T>({ columns, rowSelection }: IUseRowSelectionProps<T>) => IUseRowSelectionResult<T>;
|
|
11
11
|
export {};
|
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TooltipTrigger } from '@/base/ui/tooltip';
|
|
3
3
|
export interface IWuTooltipProps extends Omit<React.ComponentProps<typeof TooltipTrigger>, 'content'> {
|
|
4
|
+
/** Content shown inside the tooltip — text or any ReactNode. Omit or pass empty string to suppress. */
|
|
4
5
|
content?: string | React.ReactNode;
|
|
6
|
+
/** Delay before the tooltip appears in milliseconds. @default 200 */
|
|
5
7
|
duration?: number;
|
|
8
|
+
/** Preferred side to show the tooltip; auto-flips when there is insufficient viewport space. @default 'top' */
|
|
6
9
|
position?: 'top' | 'right' | 'bottom' | 'left';
|
|
10
|
+
/** Gap between tooltip and trigger in pixels. @default 0 */
|
|
7
11
|
positionOffset?: number;
|
|
12
|
+
/** Element that triggers the tooltip on hover or focus. */
|
|
8
13
|
children: React.ReactNode;
|
|
14
|
+
/** Text direction set on the trigger wrapper span. */
|
|
9
15
|
dir?: 'rtl' | 'ltr';
|
|
16
|
+
/** Renders an arrow pointing toward the trigger. @default false */
|
|
10
17
|
showArrow?: boolean;
|
|
18
|
+
/** Controlled open state; pair with onOpenChange. */
|
|
11
19
|
open?: boolean;
|
|
20
|
+
/** Called when the open state changes. */
|
|
12
21
|
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
/** Inline styles for the tooltip content container. */
|
|
13
23
|
style?: React.CSSProperties;
|
|
14
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Floating label that appears on hover or focus to explain a UI element.
|
|
27
|
+
*
|
|
28
|
+
* @summary Use to surface extra context for icon buttons, abbreviated labels, or dense UI without cluttering the layout.
|
|
29
|
+
*/
|
|
15
30
|
export declare const WuTooltip: React.ForwardRefExoticComponent<Omit<IWuTooltipProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,20 +1,80 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { IWuIcons } from './iconTypes';
|
|
3
|
-
export
|
|
3
|
+
export interface IWuTextProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
4
|
+
/** Body text scale. @default 'lg' */
|
|
4
5
|
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
/** Underlying HTML element. @default 'div' */
|
|
5
7
|
as?: 'p' | 'div' | 'span';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Body text for paragraphs and general content.
|
|
11
|
+
*
|
|
12
|
+
* @summary default text primitive — reach for it for any non-heading copy
|
|
13
|
+
*/
|
|
14
|
+
export declare const WuText: React.FC<IWuTextProps>;
|
|
15
|
+
export interface IWuHeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
16
|
+
/** Heading scale; also picks the semantic tag (xl→h1 … sm→h4). @default 'xl' */
|
|
8
17
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
-
}
|
|
10
|
-
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Section and page headings with matching semantic levels.
|
|
21
|
+
*
|
|
22
|
+
* @summary heading primitive — size drives both visual scale and h1–h4 tag
|
|
23
|
+
*/
|
|
24
|
+
export declare const WuHeading: React.FC<IWuHeadingProps>;
|
|
25
|
+
export interface IWuSubtextProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
26
|
+
/** Subtitle scale. @default 'lg' */
|
|
11
27
|
size?: 'sm' | 'md' | 'lg';
|
|
28
|
+
/** Underlying HTML element. @default 'div' */
|
|
12
29
|
as?: 'p' | 'div' | 'span';
|
|
13
|
-
}
|
|
14
|
-
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Secondary text for captions, labels, and metadata.
|
|
33
|
+
*
|
|
34
|
+
* @summary muted supporting text — use beneath or beside primary content
|
|
35
|
+
*/
|
|
36
|
+
export declare const WuSubtext: React.FC<IWuSubtextProps>;
|
|
37
|
+
export interface IWuDisplayProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
38
|
+
/** Display scale. @default 'lg' */
|
|
15
39
|
size?: 'md' | 'lg';
|
|
40
|
+
/** Underlying HTML element. @default 'h1' */
|
|
16
41
|
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'div';
|
|
17
|
-
}
|
|
18
|
-
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Oversized text for hero sections and page intros.
|
|
45
|
+
*
|
|
46
|
+
* @summary largest type ramp — sparing, attention-grabbing display copy
|
|
47
|
+
*/
|
|
48
|
+
export declare const WuDisplay: React.FC<IWuDisplayProps>;
|
|
49
|
+
export interface IWuIconProps extends React.BaseHTMLAttributes<HTMLBaseElement> {
|
|
50
|
+
/** Icon-font identifier to render. */
|
|
19
51
|
icon: IWuIcons;
|
|
20
|
-
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Renders an icon-font glyph as a decorative, accessible span.
|
|
55
|
+
*
|
|
56
|
+
* @summary icon-font primitive — size/color via text utilities
|
|
57
|
+
*/
|
|
58
|
+
export declare const WuIcon: React.FC<IWuIconProps>;
|
|
59
|
+
/** Typography components WuNumber can render its value into via the `as` prop. */
|
|
60
|
+
declare const numberTagMap: {
|
|
61
|
+
readonly WuText: React.FC<IWuTextProps>;
|
|
62
|
+
readonly WuHeading: React.FC<IWuHeadingProps>;
|
|
63
|
+
readonly WuSubtext: React.FC<IWuSubtextProps>;
|
|
64
|
+
readonly WuDisplay: React.FC<IWuDisplayProps>;
|
|
65
|
+
};
|
|
66
|
+
export interface IWuNumberProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
67
|
+
/** Intl.NumberFormat options — style, currency, notation, fraction digits, etc. */
|
|
68
|
+
format?: Intl.NumberFormatOptions;
|
|
69
|
+
/** BCP-47 locale tag. @default browser locale */
|
|
70
|
+
locale?: string;
|
|
71
|
+
/** Render the value inside a typography component instead of a bare span. @default 'span' */
|
|
72
|
+
as?: keyof typeof numberTagMap;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Formats a numeric value with `Intl.NumberFormat` and renders it in a styled span.
|
|
76
|
+
*
|
|
77
|
+
* @summary locale-aware number/currency/percent formatter — Intl options in, formatted text out
|
|
78
|
+
*/
|
|
79
|
+
export declare function WuNumber({ children, className, format, locale, as, ...rest }: IWuNumberProps): React.JSX.Element;
|
|
80
|
+
export {};
|