@westpac/ui 0.19.0 → 0.20.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/.eslintrc.cjs +7 -2
- package/CHANGELOG.md +6 -0
- package/dist/component-type.json +1 -1
- package/dist/components/accordion/accordion.component.d.ts +3 -2
- package/dist/components/accordion/accordion.types.d.ts +1 -1
- package/dist/components/accordion/components/accordion-item/accordion-item.component.d.ts +1 -1
- package/dist/components/accordion/components/accordion-item/accordion-item.types.d.ts +1 -1
- package/dist/components/autocomplete/autocomplete.component.js +6 -3
- package/dist/components/autocomplete/components/autocomplete-item/autocomplete-item.component.js +0 -1
- package/dist/components/autocomplete/components/autocomplete-item/autocomplete-item.types.d.ts +1 -1
- package/dist/components/autocomplete/components/autocomplete-list-box/autocomplete-list-box.types.d.ts +2 -2
- package/dist/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.component.d.ts +1 -1
- package/dist/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.types.d.ts +1 -1
- package/dist/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-section/autocomplete-list-box-section.component.d.ts +1 -1
- package/dist/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-section/autocomplete-list-box-section.types.d.ts +1 -1
- package/dist/components/badge/badge.component.d.ts +3 -3
- package/dist/components/badge/badge.component.js +1 -3
- package/dist/components/badge/badge.styles.d.ts +1 -1
- package/dist/components/badge/badge.styles.js +3 -3
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.js +3 -1
- package/dist/components/breadcrumb/components/breadcrumb-item/breadcrumb-item.component.d.ts +3 -3
- package/dist/components/button/button.component.d.ts +1 -1
- package/dist/components/button/button.styles.js +1 -1
- package/dist/components/button-dropdown/button-dropdown.component.js +1 -1
- package/dist/components/button-dropdown/components/button-dropdown-panel/button-dropdown-panel.component.js +8 -3
- package/dist/components/button-group/button-group.component.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.component.js +1 -1
- package/dist/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.component.d.ts +1 -1
- package/dist/components/collapsible/collapsible.component.js +1 -1
- package/dist/components/date-picker/date-picker.component.js +9 -1
- package/dist/components/date-picker/date-picker.types.d.ts +8 -8
- package/dist/components/date-picker/date-picker.utils.d.ts +2 -2
- package/dist/components/date-picker/date-picker.utils.js +2 -1
- package/dist/components/error-message/error-message.component.js +2 -1
- package/dist/components/field/field.component.js +2 -1
- package/dist/components/flexi-cell/flexi-cell.component.d.ts +1 -1
- package/dist/components/header/header.component.js +4 -1
- package/dist/components/input-group/components/input-group-add-ons/components/input-group-add-on-default-add-on/input-group-add-on-default-add-on.component.d.ts +1 -1
- package/dist/components/input-group/components/input-group-add-ons/components/input-group-add-on-default-add-on/input-group-add-on-default-add-on.component.js +1 -1
- package/dist/components/input-group/components/input-group-add-ons/input-group-add-ons.styles.js +2 -2
- package/dist/components/input-group/input-group.component.js +7 -2
- package/dist/components/list/components/list-item/list-item.component.d.ts +3 -3
- package/dist/components/pagination/pagination.component.js +6 -4
- package/dist/components/pagination/pagination.hooks.js +4 -2
- package/dist/components/pass-code/pass-code.component.js +6 -4
- package/dist/components/pass-code-view/pass-code-view.types.d.ts +2 -2
- package/dist/components/popover/components/panel/panel.component.js +6 -3
- package/dist/components/popover/popover.component.js +5 -3
- package/dist/components/popover/{popover.hooks.d.ts → popover.utils.d.ts} +1 -1
- package/dist/components/popover/{popover.hooks.js → popover.utils.js} +1 -1
- package/dist/components/progress-rope/components/progress-rope-step/progress-rope-step.component.d.ts +1 -1
- package/dist/components/progress-rope/components/progress-rope-step/progress-rope-step.component.js +3 -1
- package/dist/components/progress-rope/components/progress-rope-step/progress-rope-step.types.d.ts +1 -1
- package/dist/components/progress-rope/progress-rope.component.js +3 -2
- package/dist/components/radio-group/components/radio-group-radio/radio-group-radio.component.d.ts +1 -1
- package/dist/components/radio-group/radio-group.component.js +1 -1
- package/dist/components/select/select.styles.d.ts +1 -1
- package/dist/components/select/select.styles.js +1 -1
- package/dist/components/selector/components/selector-button-group/components/selector-button-group-option/selector-button-group-option.component.js +2 -1
- package/dist/components/selector/components/selector-button-group/selector-button-group.component.js +3 -1
- package/dist/components/selector/components/selector-checkbox-group/selector-checkbox-group.component.js +1 -1
- package/dist/components/selector/components/selector-radio-group/selector-radio-group.component.js +1 -1
- package/dist/components/skip-link/skip-link.component.d.ts +1 -1
- package/dist/components/tabs/components/tabs-tab/tabs-tab.types.d.ts +1 -1
- package/dist/components/tabs/components/tabs-tab-panel/tabs-tab-panel.types.d.ts +1 -1
- package/dist/components/tabs/tabs.types.d.ts +1 -1
- package/dist/css/westpac-ui.css +18 -38
- package/dist/css/westpac-ui.min.css +18 -38
- package/dist/tailwind/tailwind-plugin.js +1 -1
- package/dist/tailwind/utils/create-font-sizes.d.ts +10 -1
- package/dist/tailwind/utils/generate-font-components.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/accordion/accordion.component.tsx +15 -9
- package/src/components/accordion/accordion.types.ts +1 -1
- package/src/components/accordion/components/accordion-item/accordion-item.component.tsx +4 -4
- package/src/components/accordion/components/accordion-item/accordion-item.types.ts +1 -1
- package/src/components/autocomplete/autocomplete.component.tsx +9 -2
- package/src/components/autocomplete/components/autocomplete-item/autocomplete-item.component.tsx +0 -1
- package/src/components/autocomplete/components/autocomplete-item/autocomplete-item.types.ts +1 -1
- package/src/components/autocomplete/components/autocomplete-list-box/autocomplete-list-box.types.ts +2 -2
- package/src/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.component.tsx +3 -3
- package/src/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.types.ts +1 -1
- package/src/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-section/autocomplete-list-box-section.component.tsx +1 -1
- package/src/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-section/autocomplete-list-box-section.types.ts +1 -1
- package/src/components/badge/badge.component.tsx +5 -6
- package/src/components/badge/badge.styles.ts +3 -3
- package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.component.tsx +0 -1
- package/src/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.tsx +2 -3
- package/src/components/breadcrumb/breadcrumb.component.tsx +4 -1
- package/src/components/breadcrumb/components/breadcrumb-item/breadcrumb-item.component.tsx +5 -5
- package/src/components/button/button.component.tsx +2 -2
- package/src/components/button/button.styles.ts +1 -1
- package/src/components/button-dropdown/button-dropdown.component.tsx +2 -2
- package/src/components/button-dropdown/components/button-dropdown-panel/button-dropdown-panel.component.tsx +3 -3
- package/src/components/button-group/button-group.component.tsx +1 -3
- package/src/components/checkbox-group/checkbox-group.component.tsx +2 -4
- package/src/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.component.tsx +5 -2
- package/src/components/collapsible/collapsible.component.tsx +1 -1
- package/src/components/compacta/compacta.component.tsx +1 -1
- package/src/components/date-picker/date-picker.component.tsx +2 -2
- package/src/components/date-picker/date-picker.types.ts +18 -8
- package/src/components/date-picker/date-picker.utils.ts +3 -3
- package/src/components/error-message/error-message.component.tsx +2 -2
- package/src/components/error-message/error-message.types.ts +1 -1
- package/src/components/field/field.component.tsx +1 -1
- package/src/components/flexi-cell/flexi-cell.component.tsx +3 -3
- package/src/components/header/header.component.tsx +1 -1
- package/src/components/input-group/components/input-group-add-ons/components/input-group-add-on-default-add-on/input-group-add-on-default-add-on.component.tsx +1 -6
- package/src/components/input-group/components/input-group-add-ons/input-group-add-ons.styles.ts +2 -2
- package/src/components/input-group/input-group.component.tsx +13 -4
- package/src/components/list/components/list-item/list-item.component.tsx +2 -2
- package/src/components/pagination/components/pagination-item/pagination-item.types.ts +2 -0
- package/src/components/pagination/pagination.component.tsx +2 -2
- package/src/components/pagination/pagination.hooks.ts +2 -2
- package/src/components/pass-code/pass-code.component.tsx +3 -3
- package/src/components/pass-code-view/pass-code-view.types.ts +2 -2
- package/src/components/popover/components/panel/panel.component.tsx +3 -3
- package/src/components/popover/popover.component.tsx +5 -5
- package/src/components/popover/{popover.hooks.tsx → popover.utils.tsx} +2 -2
- package/src/components/progress-rope/components/progress-rope-step/progress-rope-step.component.tsx +2 -3
- package/src/components/progress-rope/components/progress-rope-step/progress-rope-step.types.ts +1 -1
- package/src/components/progress-rope/progress-rope.component.tsx +1 -2
- package/src/components/radio-group/components/radio-group-radio/radio-group-radio.component.tsx +2 -2
- package/src/components/radio-group/radio-group.component.tsx +2 -4
- package/src/components/select/select.styles.ts +1 -1
- package/src/components/selector/components/selector-button-group/components/selector-button-group-option/selector-button-group-option.component.tsx +3 -3
- package/src/components/selector/components/selector-button-group/selector-button-group.component.tsx +2 -2
- package/src/components/selector/components/selector-checkbox-group/components/selector-checkbox-group-option/selector-checkbox-group-option.component.tsx +2 -2
- package/src/components/selector/components/selector-checkbox-group/selector-checkbox-group.component.tsx +1 -3
- package/src/components/selector/components/selector-link-group/components/selector-link-group-option/selector-link-group-option.component.tsx +3 -3
- package/src/components/selector/components/selector-radio-group/components/selector-radio-group-option/selector-radio-group-option.component.tsx +2 -2
- package/src/components/selector/components/selector-radio-group/selector-radio-group.component.tsx +1 -3
- package/src/components/skip-link/skip-link.component.tsx +3 -3
- package/src/components/tabs/components/tabs-tab/tabs-tab.component.tsx +2 -2
- package/src/components/tabs/components/tabs-tab/tabs-tab.types.ts +1 -1
- package/src/components/tabs/components/tabs-tab-panel/tabs-tab-panel.types.ts +1 -1
- package/src/components/tabs/tabs.component.tsx +7 -7
- package/src/components/tabs/tabs.types.ts +1 -1
- package/src/tailwind/tailwind-plugin.ts +1 -1
- package/src/tailwind/utils/create-font-sizes.ts +22 -11
- package/src/tailwind/utils/generate-font-components.ts +16 -19
- package/src/tailwind/utils/generate-form-control.ts +10 -11
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { DOMRef } from '@react-types/shared';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { type ItemProps } from 'react-stately';
|
|
3
4
|
import { type AccordionProps } from './accordion.types.js';
|
|
4
|
-
declare function Accordion<T extends object>({ className, rounded, look, ...props }: AccordionProps<T>, ref:
|
|
5
|
+
declare function Accordion<T extends object>({ className, rounded, look, ...props }: AccordionProps<T>, ref: DOMRef<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
declare const _Accordion: {
|
|
6
7
|
displayName: string;
|
|
7
8
|
} & (<T>(props: import("@react-types/accordion").SpectrumAccordionProps<T> & {
|
|
@@ -14,7 +15,7 @@ declare const _Accordion: {
|
|
|
14
15
|
[x: string]: boolean | undefined;
|
|
15
16
|
} | undefined;
|
|
16
17
|
} & Omit<React.HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
17
|
-
ref?:
|
|
18
|
+
ref?: HTMLElement | undefined;
|
|
18
19
|
}) => ReturnType<typeof Accordion>);
|
|
19
20
|
export { _Accordion as Accordion };
|
|
20
21
|
export declare const AccordionItem: <T>(props: ItemProps<T>) => JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { type VariantProps } from 'tailwind-variants';
|
|
|
4
4
|
import { styles } from './accordion.styles.js';
|
|
5
5
|
import { AccordionItemProps } from './components/index.js';
|
|
6
6
|
type Variants = VariantProps<typeof styles>;
|
|
7
|
-
export type AccordionProps<T =
|
|
7
|
+
export type AccordionProps<T = HTMLElement> = SpectrumAccordionProps<T> & {
|
|
8
8
|
/**
|
|
9
9
|
* <AccordionItem /> as a collection
|
|
10
10
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type AccordionItemProps } from './accordion-item.types.js';
|
|
2
|
-
export declare function AccordionItem<T =
|
|
2
|
+
export declare function AccordionItem<T = HTMLElement>({ className, tag: Tag, look, ...props }: AccordionItemProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { Node, TreeState } from 'react-stately';
|
|
|
3
3
|
import { type VariantProps } from 'tailwind-variants';
|
|
4
4
|
import { styles } from './accordion-item.styles.js';
|
|
5
5
|
type Variants = VariantProps<typeof styles>;
|
|
6
|
-
export type AccordionItemProps<T =
|
|
6
|
+
export type AccordionItemProps<T = HTMLElement> = {
|
|
7
7
|
/**
|
|
8
8
|
* AccordionItem body content
|
|
9
9
|
*/
|
|
@@ -82,9 +82,12 @@ export function Autocomplete({ size ='medium' , invalid =false , isDisabled , fo
|
|
|
82
82
|
const isNoOptionPopOverOpen = useMemo(()=>{
|
|
83
83
|
return noOptionsMessage && (!state.isOpen && state.isFocused && searchProps.value.length > 0 && !state.selectedItem || state.collection.size === 0 && searchProps.value.length > 0);
|
|
84
84
|
}, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
noOptionsMessage,
|
|
86
|
+
state.isOpen,
|
|
87
|
+
state.isFocused,
|
|
88
|
+
state.selectedItem,
|
|
89
|
+
state.collection.size,
|
|
90
|
+
searchProps.value.length
|
|
88
91
|
]);
|
|
89
92
|
const iconSize = useMemo(()=>{
|
|
90
93
|
switch(size){
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { AriaListBoxOptions } from 'react-aria';
|
|
3
3
|
import { ListState } from 'react-stately';
|
|
4
|
-
export type AutocompleteListBoxProps
|
|
4
|
+
export type AutocompleteListBoxProps = AriaListBoxOptions<unknown> & {
|
|
5
5
|
listBoxRef?: React.RefObject<HTMLUListElement>;
|
|
6
|
-
state: ListState<
|
|
6
|
+
state: ListState<unknown>;
|
|
7
7
|
} & HTMLAttributes<Element>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Node } from '@react-types/shared';
|
|
2
2
|
import { type ListState } from 'react-stately';
|
|
3
|
-
export type AutocompleteListBoxOptionProps<T =
|
|
3
|
+
export type AutocompleteListBoxOptionProps<T = HTMLLIElement> = {
|
|
4
4
|
item: Node<T>;
|
|
5
5
|
state: ListState<T>;
|
|
6
6
|
};
|
|
@@ -2,4 +2,4 @@ import { type AutocompleteListBoxSectionProps } from './autocomplete-list-box-se
|
|
|
2
2
|
/**
|
|
3
3
|
* @private
|
|
4
4
|
*/
|
|
5
|
-
export declare function AutocompleteListBoxSection({ section, state }: AutocompleteListBoxSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function AutocompleteListBoxSection({ section, state }: AutocompleteListBoxSectionProps<unknown>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Ref } from 'react';
|
|
2
2
|
import { type BadgeProps } from './badge.types.js';
|
|
3
|
-
export declare function BaseBadge({ className, tag: Tag, color, type, soft, children, ...props }: BadgeProps, ref:
|
|
3
|
+
export declare function BaseBadge({ className, tag: Tag, color, type, soft, children, ...props }: BadgeProps, ref: Ref<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const Badge: React.ForwardRefExoticComponent<{
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
color?: "primary" | "hero" | "faint" | "success" | "info" | "warning" | "danger" | "muted" | "neutral" | "danger-inverted" | "faint-inverted" | "hero-inverted" | "info-inverted" | "neutral-inverted" | "primary-inverted" | "success-inverted" | "warning-inverted" | {
|
|
@@ -13,4 +13,4 @@ export declare const Badge: React.ForwardRefExoticComponent<{
|
|
|
13
13
|
type?: "default" | "pill" | {
|
|
14
14
|
[x: string]: "default" | "pill" | undefined;
|
|
15
15
|
} | undefined;
|
|
16
|
-
} & Omit<React.HTMLAttributes<Element>, "color" | "type"> & React.RefAttributes<
|
|
16
|
+
} & Omit<React.HTMLAttributes<Element>, "color" | "type"> & React.RefAttributes<HTMLElement>>;
|
|
@@ -25,8 +25,6 @@ export function BaseBadge({ className , tag: Tag = 'div' , color ='hero' , type
|
|
|
25
25
|
type,
|
|
26
26
|
soft
|
|
27
27
|
})
|
|
28
|
-
}, props),
|
|
29
|
-
className: "relative bottom-[1px]"
|
|
30
|
-
}, children));
|
|
28
|
+
}, props), children);
|
|
31
29
|
}
|
|
32
30
|
export const Badge = forwardRef(BaseBadge);
|
|
@@ -25,7 +25,7 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
25
25
|
soft: {
|
|
26
26
|
true: string;
|
|
27
27
|
};
|
|
28
|
-
}, undefined, "inline-block whitespace-nowrap border text-center
|
|
28
|
+
}, undefined, "inline-block whitespace-nowrap border text-center", {
|
|
29
29
|
responsiveVariants: string[];
|
|
30
30
|
}, {
|
|
31
31
|
color: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
|
-
base: 'inline-block whitespace-nowrap border text-center
|
|
3
|
+
base: 'inline-block whitespace-nowrap border text-center',
|
|
4
4
|
variants: {
|
|
5
5
|
color: {
|
|
6
6
|
danger: 'border-danger bg-danger text-white',
|
|
@@ -22,8 +22,8 @@ export const styles = tv({
|
|
|
22
22
|
'warning-inverted': 'border-none bg-white text-warning'
|
|
23
23
|
},
|
|
24
24
|
type: {
|
|
25
|
-
pill: 'typography-body-10 rounded-xl px-[0.4375rem] py-[0.25rem] font-medium leading-none',
|
|
26
|
-
default: 'rounded-sm px-1
|
|
25
|
+
pill: 'typography-body-10 h-4 rounded-xl px-[0.4375rem] py-[0.25rem] font-medium leading-none',
|
|
26
|
+
default: 'h-3 rounded-sm px-1 text-[0.75rem] leading-none'
|
|
27
27
|
},
|
|
28
28
|
soft: {
|
|
29
29
|
true: 'bg-white'
|
package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.js
CHANGED
|
@@ -51,6 +51,7 @@ export function BottomSheetModal({ state , height , width , children , portalCon
|
|
|
51
51
|
}
|
|
52
52
|
controls.start('hidden');
|
|
53
53
|
}, [
|
|
54
|
+
controls,
|
|
54
55
|
state.isOpen
|
|
55
56
|
]);
|
|
56
57
|
const onDragEnd = useCallback((_, info)=>{
|
|
@@ -63,7 +64,8 @@ export function BottomSheetModal({ state , height , width , children , portalCon
|
|
|
63
64
|
controls.start('visible');
|
|
64
65
|
state.open();
|
|
65
66
|
}, [
|
|
66
|
-
controls
|
|
67
|
+
controls,
|
|
68
|
+
state
|
|
67
69
|
]);
|
|
68
70
|
if (!isBrowser || !state.isOpen) {
|
|
69
71
|
return null;
|
package/dist/components/breadcrumb/components/breadcrumb-item/breadcrumb-item.component.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Ref } from 'react';
|
|
2
2
|
import { type BreadcrumbItemProps } from './breadcrumb-item.types.js';
|
|
3
|
-
export declare function BaseBreadcrumbItem({ className, isDisabled, isCurrent, href, children, tag: Tag, ...props }: BreadcrumbItemProps, propRef:
|
|
3
|
+
export declare function BaseBreadcrumbItem({ className, isDisabled, isCurrent, href, children, tag: Tag, ...props }: BreadcrumbItemProps, propRef: Ref<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const BreadcrumbItem: React.ForwardRefExoticComponent<{
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
isCurrent?: boolean | undefined;
|
|
7
7
|
isDisabled?: boolean | undefined;
|
|
8
8
|
tag?: keyof JSX.IntrinsicElements | undefined;
|
|
9
|
-
} & React.AnchorHTMLAttributes<Element> & React.RefAttributes<
|
|
9
|
+
} & React.AnchorHTMLAttributes<Element> & React.RefAttributes<HTMLElement>>;
|
|
@@ -22,4 +22,4 @@ export declare const Button: React.ForwardRefExoticComponent<{
|
|
|
22
22
|
[x: string]: boolean | undefined;
|
|
23
23
|
} | undefined;
|
|
24
24
|
tag?: "a" | "button" | "div" | "span" | undefined;
|
|
25
|
-
} & React.ButtonHTMLAttributes<Element> & React.AnchorHTMLAttributes<Element> & React.RefAttributes<
|
|
25
|
+
} & React.ButtonHTMLAttributes<Element> & React.AnchorHTMLAttributes<Element> & React.RefAttributes<HTMLButtonElement & HTMLAnchorElement & HTMLSpanElement & HTMLDivElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base: 'items-center justify-center rounded leading-[1.5] transition-[background] disabled:pointer-events-none disabled:opacity-50 group-
|
|
4
|
+
base: 'items-center justify-center rounded leading-[1.5] transition-[background] disabled:pointer-events-none disabled:opacity-50 group-first/add-on-before:rounded-r-none group-last/add-on-after:rounded-l-none',
|
|
5
5
|
iconBefore: '',
|
|
6
6
|
iconAfter: '',
|
|
7
7
|
dropdown: 'ml-[0.4em]',
|
|
@@ -37,7 +37,7 @@ export function ButtonDropdown({ className , dropdownSize ='medium' , iconBefore
|
|
|
37
37
|
const keyHandler = useCallback((event)=>{
|
|
38
38
|
if (state.isOpen && event.key === 'Escape') state.close();
|
|
39
39
|
}, [
|
|
40
|
-
state
|
|
40
|
+
state
|
|
41
41
|
]);
|
|
42
42
|
useEffect(()=>{
|
|
43
43
|
window.document.addEventListener('keydown', keyHandler);
|
|
@@ -32,12 +32,14 @@ export function ButtonDropdownPanel({ className , children , state , block , id
|
|
|
32
32
|
const focusHandler = useCallback((event)=>{
|
|
33
33
|
if (event.target && popoverRef.current && event.target !== props.triggerRef.current && !popoverRef.current.contains(event.target) && state.isOpen) state.close();
|
|
34
34
|
}, [
|
|
35
|
-
|
|
35
|
+
props.triggerRef,
|
|
36
|
+
state
|
|
36
37
|
]);
|
|
37
38
|
const clickHandler = useCallback((event)=>{
|
|
38
39
|
if (event.target && props.triggerRef.current && !props.triggerRef.current.contains(event.target) && popoverRef.current && !popoverRef.current.contains(event.target) && state.isOpen) state.close();
|
|
39
40
|
}, [
|
|
40
|
-
|
|
41
|
+
props.triggerRef,
|
|
42
|
+
state
|
|
41
43
|
]);
|
|
42
44
|
useEffect(()=>{
|
|
43
45
|
window.document.addEventListener('focusin', focusHandler);
|
|
@@ -46,7 +48,10 @@ export function ButtonDropdownPanel({ className , children , state , block , id
|
|
|
46
48
|
window.document.removeEventListener('focusin', focusHandler);
|
|
47
49
|
window.document.removeEventListener('click', clickHandler);
|
|
48
50
|
};
|
|
49
|
-
}, [
|
|
51
|
+
}, [
|
|
52
|
+
clickHandler,
|
|
53
|
+
focusHandler
|
|
54
|
+
]);
|
|
50
55
|
return React.createElement("div", _extends({}, mergeProps(popoverProps, focusProps), {
|
|
51
56
|
id: id,
|
|
52
57
|
style: {
|
|
@@ -96,7 +96,7 @@ export function ButtonGroup({ className , buttons , label , look ='hero' , size
|
|
|
96
96
|
className: styles.base({
|
|
97
97
|
className
|
|
98
98
|
})
|
|
99
|
-
}, radioGroupProps), React.createElement(Label, _extends({}, labelProps), label), hintMessage && React.createElement(Hint, _extends({}, descriptionProps), hintMessage), errorMessage && state.
|
|
99
|
+
}, radioGroupProps), React.createElement(Label, _extends({}, labelProps), label), hintMessage && React.createElement(Hint, _extends({}, descriptionProps), hintMessage), errorMessage && state.isInvalid && React.createElement(ErrorMessage, _extends({}, errorMessageProps, {
|
|
100
100
|
message: errorMessage
|
|
101
101
|
})), React.createElement("div", {
|
|
102
102
|
className: styles.buttonWrapper()
|
|
@@ -126,7 +126,7 @@ export function CheckboxGroup({ className , checkboxes , label , orientation ='v
|
|
|
126
126
|
className: styles.base({
|
|
127
127
|
className
|
|
128
128
|
})
|
|
129
|
-
}, groupProps), React.createElement(Label, _extends({}, labelProps), label), hintMessage && React.createElement(Hint, _extends({}, descriptionProps), hintMessage), errorMessage && state.
|
|
129
|
+
}, groupProps), React.createElement(Label, _extends({}, labelProps), label), hintMessage && React.createElement(Hint, _extends({}, descriptionProps), hintMessage), errorMessage && state.isInvalid && React.createElement(ErrorMessage, _extends({}, errorMessageProps, {
|
|
130
130
|
message: errorMessage
|
|
131
131
|
})), React.createElement("div", {
|
|
132
132
|
className: styles.itemWrapper(),
|
|
@@ -3,4 +3,4 @@ export declare const CheckboxGroupCheckbox: React.ForwardRefExoticComponent<{
|
|
|
3
3
|
className?: string | undefined;
|
|
4
4
|
hint?: React.ReactNode;
|
|
5
5
|
label: React.ReactNode;
|
|
6
|
-
} & Omit<import("react-aria").AriaCheckboxGroupItemProps, "children" | "isIndeterminate"> & React.RefAttributes<
|
|
6
|
+
} & Omit<import("react-aria").AriaCheckboxGroupItemProps, "children" | "isIndeterminate"> & React.RefAttributes<HTMLLabelElement>>;
|
|
@@ -109,7 +109,15 @@ export function DatePicker({ disableWeekends , disableDaysOfWeek , disableDates
|
|
|
109
109
|
};
|
|
110
110
|
}, [
|
|
111
111
|
ref,
|
|
112
|
-
initialized
|
|
112
|
+
initialized,
|
|
113
|
+
dateAdapter,
|
|
114
|
+
localization,
|
|
115
|
+
value,
|
|
116
|
+
id,
|
|
117
|
+
name,
|
|
118
|
+
disableWeekends,
|
|
119
|
+
disableDaysOfWeek,
|
|
120
|
+
disableDates
|
|
113
121
|
]);
|
|
114
122
|
useLayoutEffect(()=>{
|
|
115
123
|
if (!ref.current) {
|
|
@@ -2,10 +2,10 @@ import { HTMLAttributes } from 'react';
|
|
|
2
2
|
import { VariantProps } from 'tailwind-variants';
|
|
3
3
|
import { styles } from './date-picker.styles.js';
|
|
4
4
|
export type DuetDatePickerElement = Element & {
|
|
5
|
-
dateAdapter:
|
|
6
|
-
identifier
|
|
5
|
+
dateAdapter: object;
|
|
6
|
+
identifier?: string;
|
|
7
7
|
isDateDisabled: (date: Date) => boolean;
|
|
8
|
-
localization:
|
|
8
|
+
localization: object;
|
|
9
9
|
max?: string;
|
|
10
10
|
min?: string;
|
|
11
11
|
name?: string;
|
|
@@ -29,11 +29,11 @@ export type DatePickerProps = {
|
|
|
29
29
|
*/
|
|
30
30
|
min?: string;
|
|
31
31
|
name?: string;
|
|
32
|
-
onBlur?: (...args: any[]) =>
|
|
33
|
-
onChange?: (...args: any[]) =>
|
|
34
|
-
onClose?: (...args: any[]) =>
|
|
35
|
-
onFocus?: (...args: any[]) =>
|
|
36
|
-
onOpen?: (...args: any[]) =>
|
|
32
|
+
onBlur?: (...args: any[]) => void;
|
|
33
|
+
onChange?: (...args: any[]) => void;
|
|
34
|
+
onClose?: (...args: any[]) => void;
|
|
35
|
+
onFocus?: (...args: any[]) => void;
|
|
36
|
+
onOpen?: (...args: any[]) => void;
|
|
37
37
|
placeholder?: string;
|
|
38
38
|
/**
|
|
39
39
|
* Size of datepicker input
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
2
|
import { DuetDatePickerElement } from './date-picker.types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @param date the date to format as a Date
|
|
@@ -10,7 +10,7 @@ export declare function formatDate(date: Date, format: string): string;
|
|
|
10
10
|
* @param eventName Event name for the event listener
|
|
11
11
|
* @param handler Callback for the event
|
|
12
12
|
*/
|
|
13
|
-
export declare function useListener(ref: RefObject<DuetDatePickerElement> | null, eventName: string, handler?:
|
|
13
|
+
export declare function useListener(ref: RefObject<DuetDatePickerElement> | null, eventName: string, handler?: EventListenerOrEventListenerObject): void;
|
|
14
14
|
export declare function createDate(year: string, month: string, day: string): Date | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* @param value date string in ISO format YYYY-MM-DD
|
|
@@ -20,7 +20,8 @@ export function ErrorMessage({ className , tag: Tag = 'div' , icon: Icon , messa
|
|
|
20
20
|
const FinalIcon = Icon !== null && Icon !== void 0 ? Icon : AlertIcon;
|
|
21
21
|
return Array.isArray(message) ? React.createElement("ul", _extends({
|
|
22
22
|
className: styles.list({})
|
|
23
|
-
}, props), message.map((msg)=>React.createElement("li", {
|
|
23
|
+
}, props), message.map((msg, index)=>React.createElement("li", {
|
|
24
|
+
key: index,
|
|
24
25
|
className: styles.base({
|
|
25
26
|
className
|
|
26
27
|
})
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type FlexiCellProps } from './flexi-cell.types.js';
|
|
3
|
-
export declare const FlexiCell: React.ForwardRefExoticComponent<FlexiCellProps & React.RefAttributes<
|
|
3
|
+
export declare const FlexiCell: React.ForwardRefExoticComponent<FlexiCellProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -59,7 +59,10 @@ export function Header({ brand , className , children , fixed =false , leftIcon
|
|
|
59
59
|
return ()=>{
|
|
60
60
|
window.removeEventListener('scroll', handleScroll);
|
|
61
61
|
};
|
|
62
|
-
}, [
|
|
62
|
+
}, [
|
|
63
|
+
fixed,
|
|
64
|
+
handleScroll
|
|
65
|
+
]);
|
|
63
66
|
const logoAlignment = logoCenter ? 'center' : 'left';
|
|
64
67
|
const SmallLogo = logoMap[brand].logo;
|
|
65
68
|
const LargeLogo = logoMap[brand].largeLogo;
|
|
@@ -2,4 +2,4 @@ import { type InputGroupAddOnDefaultAddOnProps } from './input-group-add-on-defa
|
|
|
2
2
|
/**
|
|
3
3
|
* @private
|
|
4
4
|
*/
|
|
5
|
-
export declare const InputGroupAddOnDefaultAddOn: ({
|
|
5
|
+
export declare const InputGroupAddOnDefaultAddOn: ({ className, children, ...props }: InputGroupAddOnDefaultAddOnProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,7 +14,7 @@ function _extends() {
|
|
|
14
14
|
}
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import { styles } from './input-group-add-on-default-add-on.styles.js';
|
|
17
|
-
export const InputGroupAddOnDefaultAddOn = ({
|
|
17
|
+
export const InputGroupAddOnDefaultAddOn = ({ className , children , ...props })=>{
|
|
18
18
|
return React.createElement("div", _extends({
|
|
19
19
|
className: styles({
|
|
20
20
|
className
|
|
@@ -44,9 +44,11 @@ export function InputGroup({ label , hideLabel , size ='medium' , hint , errorMe
|
|
|
44
44
|
];
|
|
45
45
|
return arr.join(' ');
|
|
46
46
|
}, [
|
|
47
|
+
errorMessage,
|
|
47
48
|
id,
|
|
48
49
|
hint,
|
|
49
|
-
|
|
50
|
+
before,
|
|
51
|
+
after,
|
|
50
52
|
supportingText
|
|
51
53
|
]);
|
|
52
54
|
const { element: beforeElement , icon: beforeIcon , inset: beforeInset } = useMemo(()=>{
|
|
@@ -94,7 +96,10 @@ export function InputGroup({ label , hideLabel , size ='medium' , hint , errorMe
|
|
|
94
96
|
});
|
|
95
97
|
}, [
|
|
96
98
|
children,
|
|
97
|
-
|
|
99
|
+
size,
|
|
100
|
+
id,
|
|
101
|
+
ariaDescribedByValue,
|
|
102
|
+
width
|
|
98
103
|
]);
|
|
99
104
|
const isFieldset = useMemo(()=>Tag === 'fieldset', [
|
|
100
105
|
Tag
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Ref } from 'react';
|
|
2
2
|
import { type ListItemProps } from './list-item.types.js';
|
|
3
|
-
export declare function BaseListItem({ className, children, href, target, look, type, spacing, icon, ...props }: ListItemProps, ref:
|
|
3
|
+
export declare function BaseListItem({ className, children, href, target, look, type, spacing, icon, ...props }: ListItemProps, ref: Ref<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const ListItem: React.ForwardRefExoticComponent<{
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
href?: string | undefined;
|
|
@@ -10,4 +10,4 @@ export declare const ListItem: React.ForwardRefExoticComponent<{
|
|
|
10
10
|
spacing?: "medium" | "large" | undefined;
|
|
11
11
|
target?: React.HTMLAttributeAnchorTarget | undefined;
|
|
12
12
|
type?: "link" | "icon" | "ordered" | "bullet" | "tick" | "cross" | "unstyled" | undefined;
|
|
13
|
-
} & React.HTMLAttributes<Element> & React.RefAttributes<
|
|
13
|
+
} & React.HTMLAttributes<Element> & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -55,10 +55,11 @@ export function Pagination({ className , pages , tag: Tag = 'nav' , role ='navig
|
|
|
55
55
|
};
|
|
56
56
|
}, [
|
|
57
57
|
current,
|
|
58
|
+
infinite,
|
|
58
59
|
onChange,
|
|
59
60
|
linkComponent,
|
|
60
61
|
pages,
|
|
61
|
-
|
|
62
|
+
generateHandleOnClickBackwards
|
|
62
63
|
]);
|
|
63
64
|
const generateHandleOnClickForward = useCallback((current, infinite, backwardsOnly, onChange)=>()=>{
|
|
64
65
|
if (infinite && backwardsOnly) {
|
|
@@ -99,10 +100,11 @@ export function Pagination({ className , pages , tag: Tag = 'nav' , role ='navig
|
|
|
99
100
|
};
|
|
100
101
|
}, [
|
|
101
102
|
current,
|
|
102
|
-
onChange,
|
|
103
|
-
linkComponent,
|
|
104
103
|
pages,
|
|
105
|
-
infinite
|
|
104
|
+
infinite,
|
|
105
|
+
linkComponent,
|
|
106
|
+
onChange,
|
|
107
|
+
generateHandleOnClickForward
|
|
106
108
|
]);
|
|
107
109
|
return React.createElement(Tag, _extends({
|
|
108
110
|
className: styles.base({
|
|
@@ -10,7 +10,8 @@ export const usePagination = ({ defaultCurrent =1 , pages , infinite =false })=
|
|
|
10
10
|
return cannotGoForward ? currentPage : currentPage + 1;
|
|
11
11
|
});
|
|
12
12
|
}, [
|
|
13
|
-
|
|
13
|
+
infinite,
|
|
14
|
+
pages.length
|
|
14
15
|
]);
|
|
15
16
|
const previous = useCallback(()=>{
|
|
16
17
|
setCurrentPage((currentPage)=>{
|
|
@@ -21,7 +22,8 @@ export const usePagination = ({ defaultCurrent =1 , pages , infinite =false })=
|
|
|
21
22
|
return cannotGoBackwards ? currentPage : currentPage - 1;
|
|
22
23
|
});
|
|
23
24
|
}, [
|
|
24
|
-
|
|
25
|
+
infinite,
|
|
26
|
+
pages.length
|
|
25
27
|
]);
|
|
26
28
|
const selectedPage = useMemo(()=>{
|
|
27
29
|
return pages[currentPage - 1];
|
|
@@ -38,9 +38,9 @@ export function PassCode({ length , onComplete , className , ...props }) {
|
|
|
38
38
|
onComplete(newPasscode.join(''));
|
|
39
39
|
}
|
|
40
40
|
}, [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
passcode,
|
|
42
|
+
length,
|
|
43
|
+
onComplete
|
|
44
44
|
]);
|
|
45
45
|
const handlePaste = useCallback((index, event)=>{
|
|
46
46
|
event.preventDefault();
|
|
@@ -60,6 +60,8 @@ export function PassCode({ length , onComplete , className , ...props }) {
|
|
|
60
60
|
onComplete(newPasscode.join(''));
|
|
61
61
|
}
|
|
62
62
|
}, [
|
|
63
|
+
length,
|
|
64
|
+
onComplete,
|
|
63
65
|
passcode
|
|
64
66
|
]);
|
|
65
67
|
const handleKeyDown = useCallback((index, event)=>{
|
|
@@ -81,7 +83,7 @@ export function PassCode({ length , onComplete , className , ...props }) {
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
}, [
|
|
84
|
-
|
|
86
|
+
passcode
|
|
85
87
|
]);
|
|
86
88
|
const handleFocus = useCallback((index)=>{
|
|
87
89
|
var _inputRefs_current_index;
|
|
@@ -30,11 +30,11 @@ export type PassCodeViewProps = {
|
|
|
30
30
|
/**
|
|
31
31
|
* on click the resend button
|
|
32
32
|
*/
|
|
33
|
-
onResend?: () =>
|
|
33
|
+
onResend?: () => void;
|
|
34
34
|
/**
|
|
35
35
|
* on click the update button
|
|
36
36
|
*/
|
|
37
|
-
onUpdate?: () =>
|
|
37
|
+
onUpdate?: () => void;
|
|
38
38
|
/**
|
|
39
39
|
* length of the passcode
|
|
40
40
|
*/
|
|
@@ -2,7 +2,7 @@ import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from '
|
|
|
2
2
|
import { FocusScope } from 'react-aria';
|
|
3
3
|
import { Button } from '../../../button/index.js';
|
|
4
4
|
import { CloseIcon } from '../../../icon/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getPopoverPosition } from '../../popover.utils.js';
|
|
6
6
|
import { styles as panelStyles } from './panel.styles.js';
|
|
7
7
|
export function Panel({ state , heading , headingTag: Tag = 'h1' , content , placement , id , triggerRef }) {
|
|
8
8
|
const popoverRef = useRef(null);
|
|
@@ -20,9 +20,12 @@ export function Panel({ state , heading , headingTag: Tag = 'h1' , content , pla
|
|
|
20
20
|
arrowPosition: popoverRef.current ? popoverRef.current.getBoundingClientRect().width / 2 / remSize : 0
|
|
21
21
|
});
|
|
22
22
|
useLayoutEffect(()=>{
|
|
23
|
-
setPosition(
|
|
23
|
+
setPosition(getPopoverPosition(triggerRef, popoverRef, arrowRef, placement));
|
|
24
24
|
}, [
|
|
25
|
-
|
|
25
|
+
placement,
|
|
26
|
+
remSize,
|
|
27
|
+
state.isOpen,
|
|
28
|
+
triggerRef
|
|
26
29
|
]);
|
|
27
30
|
const getPopoverClass = useCallback(()=>{
|
|
28
31
|
return {
|