@bspk/ui 1.3.6 → 1.3.8
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/components/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/dist/components/AvatarGroup/Overflow.d.ts +1 -2
- package/dist/components/BadgeDot/BadgeDot.d.ts +1 -2
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Breadcrumb/{BreadcumbDropdown.d.ts → BreadcrumbDropdown.d.ts} +1 -2
- package/dist/components/Breadcrumb/{BreadcumbDropdown.js → BreadcrumbDropdown.js} +1 -1
- package/dist/components/Breadcrumb/BreadcrumbDropdown.js.map +1 -0
- package/dist/components/Breadcrumb/index.d.ts +1 -0
- package/dist/components/Breadcrumb/index.js +1 -0
- package/dist/components/Breadcrumb/index.js.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +32 -0
- package/dist/components/Checkbox/CheckboxExample.d.ts +3 -0
- package/dist/components/Checkbox/CheckboxExample.js +8 -0
- package/dist/components/Checkbox/CheckboxExample.js.map +1 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +3 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.js +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js +12 -0
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js.map +1 -1
- package/dist/components/CheckboxGroupField/CheckboxGroupFieldExample.d.ts +4 -0
- package/dist/components/CheckboxGroupField/CheckboxGroupFieldExample.js +15 -0
- package/dist/components/CheckboxGroupField/CheckboxGroupFieldExample.js.map +1 -0
- package/dist/components/Chip/Chip.d.ts +1 -1
- package/dist/components/Field/field.css +2 -0
- package/dist/components/Field/field.css.js +2 -0
- package/dist/components/FormField/FormFieldExample.d.ts +1 -2
- package/dist/components/Input/InputElement.d.ts +1 -2
- package/dist/components/Input/InputExample.d.ts +1 -2
- package/dist/components/Input/InputExample.js +1 -0
- package/dist/components/Input/InputExample.js.map +1 -1
- package/dist/components/InputNumber/InputNumberExample.js +3 -0
- package/dist/components/InputNumber/InputNumberExample.js.map +1 -1
- package/dist/components/InputPhone/InputPhoneExample.js +3 -0
- package/dist/components/InputPhone/InputPhoneExample.js.map +1 -1
- package/dist/components/Modal/Modal.d.ts +0 -2
- package/dist/components/Modal/Modal.js +0 -2
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/PageControl/PageControl.d.ts +3 -2
- package/dist/components/Pagination/PageInput.d.ts +1 -2
- package/dist/components/Password/PasswordExample.d.ts +3 -0
- package/dist/components/Password/PasswordExample.js +6 -0
- package/dist/components/Password/PasswordExample.js.map +1 -0
- package/dist/components/Portal/Portal.d.ts +1 -5
- package/dist/components/Portal/Portal.js.map +1 -1
- package/dist/components/Radio/RadioExample.js +3 -0
- package/dist/components/Radio/RadioExample.js.map +1 -1
- package/dist/components/Radio/radio.css +2 -1
- package/dist/components/Radio/radio.css.js +2 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/RadioGroup/RadioGroup.js +2 -0
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroupExample.d.ts +2 -2
- package/dist/components/RadioGroup/RadioGroupExample.js +72 -4
- package/dist/components/RadioGroup/RadioGroupExample.js.map +1 -1
- package/dist/components/RadioGroupField/RadioGroupFieldExample.d.ts +4 -0
- package/dist/components/RadioGroupField/RadioGroupFieldExample.js +15 -0
- package/dist/components/RadioGroupField/RadioGroupFieldExample.js.map +1 -0
- package/dist/components/SearchBar/SearchBar.d.ts +2 -2
- package/dist/components/SearchBar/SearchBar.js +10 -12
- package/dist/components/SearchBar/SearchBar.js.map +1 -1
- package/dist/components/SearchBar/SearchBarExample.js +3 -0
- package/dist/components/SearchBar/SearchBarExample.js.map +1 -1
- package/dist/components/Select/SelectExample.js +1 -0
- package/dist/components/Select/SelectExample.js.map +1 -1
- package/dist/components/Slider/SliderIntervalDots.d.ts +1 -2
- package/dist/components/Switch/SwitchExample.d.ts +3 -0
- package/dist/components/Switch/SwitchExample.js +8 -0
- package/dist/components/Switch/SwitchExample.js.map +1 -0
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Table/index.js +1 -0
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Textarea/TextareaExample.js +3 -0
- package/dist/components/Textarea/TextareaExample.js.map +1 -1
- package/dist/components/TimePicker/Listbox.d.ts +2 -3
- package/dist/components/TimePicker/Segment.d.ts +1 -2
- package/dist/components/TimePicker/TimePickerExample.js +3 -0
- package/dist/components/TimePicker/TimePickerExample.js.map +1 -1
- package/dist/components/ToggleOption/ToggleOption.d.ts +2 -2
- package/dist/components/ToggleOption/ToggleOption.js +2 -2
- package/dist/components/ToggleOption/ToggleOption.js.map +1 -1
- package/dist/hooks/useArrowNavigation.d.ts +2 -3
- package/dist/hooks/useDebounceCallback.d.ts +1 -2
- package/dist/hooks/useDebounceState.d.ts +0 -1
- package/dist/hooks/useDebounceState.js +0 -1
- package/dist/hooks/useDebounceState.js.map +1 -1
- package/dist/hooks/useOutsideClick.d.ts +4 -5
- package/dist/hooks/useOutsideClick.js +5 -5
- package/dist/hooks/useOutsideClick.js.map +1 -1
- package/dist/hooks/useTimeout.d.ts +1 -2
- package/dist/types/common.d.ts +5 -8
- package/dist/types/common.js.map +1 -1
- package/dist/utils/countryCodes.d.ts +1 -2
- package/dist/utils/createExampleChildElement.d.ts +1 -2
- package/dist/utils/demo.d.ts +1 -2
- package/package.json +1 -1
- package/src/components/AvatarGroup/AvatarGroup.tsx +2 -2
- package/src/components/AvatarGroup/Overflow.tsx +1 -1
- package/src/components/BadgeDot/BadgeDot.tsx +1 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
- package/src/components/Breadcrumb/{BreadcumbDropdown.tsx → BreadcrumbDropdown.tsx} +1 -1
- package/src/components/Breadcrumb/index.tsx +1 -0
- package/src/components/Calendar/Calendar.tsx +3 -3
- package/src/components/Checkbox/CheckboxExample.tsx +9 -0
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +3 -1
- package/src/components/CheckboxGroup/CheckboxGroupExample.tsx +12 -0
- package/src/components/CheckboxGroupField/CheckboxGroupFieldExample.tsx +18 -0
- package/src/components/Chip/Chip.tsx +1 -1
- package/src/components/Field/field.scss +2 -0
- package/src/components/FormField/FormFieldExample.tsx +1 -1
- package/src/components/Input/InputElement.tsx +1 -1
- package/src/components/Input/InputExample.tsx +2 -1
- package/src/components/InputNumber/InputNumberExample.tsx +3 -0
- package/src/components/InputPhone/InputPhoneExample.tsx +3 -0
- package/src/components/Modal/Modal.tsx +0 -2
- package/src/components/PageControl/PageControl.tsx +3 -3
- package/src/components/Pagination/PageInput.tsx +1 -1
- package/src/components/Password/PasswordExample.tsx +8 -0
- package/src/components/Portal/Portal.tsx +1 -5
- package/src/components/Radio/RadioExample.tsx +3 -0
- package/src/components/Radio/radio.scss +2 -1
- package/src/components/RadioGroup/RadioGroup.tsx +3 -1
- package/src/components/RadioGroup/RadioGroupExample.tsx +72 -5
- package/src/components/RadioGroupField/RadioGroupFieldExample.tsx +18 -0
- package/src/components/SearchBar/SearchBar.tsx +14 -12
- package/src/components/SearchBar/SearchBarExample.tsx +3 -0
- package/src/components/Select/SelectExample.tsx +1 -0
- package/src/components/Slider/SliderIntervalDots.tsx +1 -1
- package/src/components/Switch/SwitchExample.tsx +9 -0
- package/src/components/Table/index.tsx +1 -0
- package/src/components/Textarea/TextareaExample.tsx +3 -0
- package/src/components/TimePicker/Listbox.tsx +2 -2
- package/src/components/TimePicker/Segment.tsx +1 -1
- package/src/components/TimePicker/TimePickerExample.tsx +3 -1
- package/src/components/ToggleOption/ToggleOption.tsx +3 -4
- package/src/hooks/useArrowNavigation.ts +2 -2
- package/src/hooks/useDebounceCallback.ts +1 -1
- package/src/hooks/useDebounceState.ts +0 -1
- package/src/hooks/useOutsideClick.ts +4 -8
- package/src/hooks/useTimeout.ts +1 -1
- package/src/types/common.ts +5 -7
- package/src/utils/countryCodes.ts +1 -1
- package/src/utils/createExampleChildElement.tsx +1 -1
- package/src/utils/demo.ts +1 -1
- package/dist/components/Breadcrumb/BreadcumbDropdown.js.map +0 -1
- package/dist/hooks/useModalState.d.ts +0 -22
- package/dist/hooks/useModalState.js +0 -34
- package/dist/hooks/useModalState.js.map +0 -1
- package/src/hooks/useModalState.ts +0 -37
|
@@ -1,8 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export const presets =
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { randomString } from '../../utils/random';
|
|
3
|
+
export const presets = [
|
|
4
|
+
{
|
|
5
|
+
label: 'With Descriptions',
|
|
6
|
+
propState: {
|
|
7
|
+
value: 'option2',
|
|
8
|
+
disabled: false,
|
|
9
|
+
options: [
|
|
10
|
+
{ label: 'Option 1', value: 'option1', description: 'Description for option 1' },
|
|
11
|
+
{
|
|
12
|
+
label: 'Option 2',
|
|
13
|
+
value: 'option2',
|
|
14
|
+
description: 'Description for option 2 (disabled)',
|
|
15
|
+
disabled: true,
|
|
16
|
+
},
|
|
17
|
+
{ label: 'Option 3', value: 'option3', description: 'Description for option 3' },
|
|
18
|
+
],
|
|
19
|
+
['aria-label']: 'Radio group',
|
|
20
|
+
name: 'Radio group',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: 'Group disabled',
|
|
25
|
+
propState: {
|
|
26
|
+
value: 'option2',
|
|
27
|
+
disabled: true,
|
|
28
|
+
options: [
|
|
29
|
+
{ label: 'Option 1', value: 'option1', description: 'Description for option 1' },
|
|
30
|
+
{
|
|
31
|
+
label: 'Option 2',
|
|
32
|
+
value: 'option2',
|
|
33
|
+
description: 'Description for option 2 (disabled)',
|
|
34
|
+
},
|
|
35
|
+
{ label: 'Option 3', value: 'option3', description: 'Description for option 3' },
|
|
36
|
+
],
|
|
37
|
+
['aria-label']: 'Radio group',
|
|
38
|
+
name: 'Radio group',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: 'Long labels',
|
|
43
|
+
propState: {
|
|
44
|
+
value: 'option2',
|
|
45
|
+
disabled: false,
|
|
46
|
+
options: [
|
|
47
|
+
{ label: 'This is a very long label for option 1 that never seems to end', value: 'option1' },
|
|
48
|
+
{ label: 'This is a very long label for option 2 that never seems to end', value: 'option2' },
|
|
49
|
+
{ label: 'This is a very long label for option 3', value: 'option3' },
|
|
50
|
+
],
|
|
51
|
+
['aria-label']: 'Radio group',
|
|
52
|
+
name: 'Radio group',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
];
|
|
4
56
|
export const RadioGroupExample = {
|
|
5
|
-
render: RadioExample.render,
|
|
6
57
|
presets,
|
|
58
|
+
render: ({ props, Component }) => {
|
|
59
|
+
const id = randomString();
|
|
60
|
+
return _jsx(Component, { ...props, id: id, name: props.name + id });
|
|
61
|
+
},
|
|
62
|
+
defaultState: {
|
|
63
|
+
value: 'option3',
|
|
64
|
+
options: [
|
|
65
|
+
{ label: 'Option 1', value: 'option1', description: 'Description for option 1' },
|
|
66
|
+
{
|
|
67
|
+
label: 'Option 2',
|
|
68
|
+
value: 'option2',
|
|
69
|
+
description: 'Description for option 2 (disabled)',
|
|
70
|
+
disabled: true,
|
|
71
|
+
},
|
|
72
|
+
{ label: 'Option 3', value: 'option3', description: 'Description for option 3' },
|
|
73
|
+
],
|
|
74
|
+
},
|
|
7
75
|
};
|
|
8
76
|
//# sourceMappingURL=RadioGroupExample.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupExample.js","sourceRoot":"","sources":["../../../src/components/RadioGroup/RadioGroupExample.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioGroupExample.js","sourceRoot":"","sources":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K,EAAE,SAAS,EAAE;gBAC7F,EAAE,KAAK,EAAE,gEAAgE,EAAE,KAAK,EAAE,SAAS,EAAE;gBAC7F,EAAE,KAAK,EAAE,wCAAwC,EAAE,KAAK,EAAE,SAAS,EAAE;aACxE;YACD,CAAC,YAAY,CAAC,EAAE,aAAa;YAC7B,IAAI,EAAE,aAAa;SACtB;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAsC;IAChE,OAAO;IACP,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;QAC7B,MAAM,EAAE,GAAG,YAAY,EAAE,CAAC;QAC1B,OAAO,KAAC,SAAS,OAAK,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,EAAE,GAAI,CAAC;IACnE,CAAC;IACD,YAAY,EAAE;QACV,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,0BAA0B,EAAE;YAChF;gBACI,KAAK,EAAE,UAAU;gBACjB,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,qCAAqC;gBAClD,QAAQ,EAAE,IAAI;aACjB;YACD,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,0BAA0B,EAAE;SACnF;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RadioGroupExample as radioGroupExample } from '../RadioGroup/RadioGroupExample';
|
|
2
|
+
export const presets = radioGroupExample.presets.map((preset) => ({
|
|
3
|
+
...preset,
|
|
4
|
+
propState: {
|
|
5
|
+
label: 'Radio Group Field',
|
|
6
|
+
...preset.propState,
|
|
7
|
+
},
|
|
8
|
+
}));
|
|
9
|
+
export const RadioGroupFieldExample = {
|
|
10
|
+
presets,
|
|
11
|
+
defaultState: {
|
|
12
|
+
...radioGroupExample.defaultState,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=RadioGroupFieldExample.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroupFieldExample.js","sourceRoot":"","sources":["../../../src/components/RadioGroupField/RadioGroupFieldExample.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,IAAI,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAGnG,MAAM,CAAC,MAAM,OAAO,GAAmC,iBAAiB,CAAC,OAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC/F,GAAG,MAAM;IACT,SAAS,EAAE;QACP,KAAK,EAAE,mBAAmB;QAC1B,GAAG,MAAM,CAAC,SAAS;KACtB;CACJ,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,sBAAsB,GAA2C;IAC1E,OAAO;IACP,YAAY,EAAE;QACV,GAAG,iBAAiB,CAAC,YAAY;KACpC;CACJ,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { ScrollListItemsStyleProps } from '-/utils/scrollListItemsStyle';
|
|
|
9
9
|
* Essentially the props for a ListItem.
|
|
10
10
|
*/
|
|
11
11
|
export type SearchBarOption = Pick<ListItemProps, 'label' | 'leading' | 'trailing'>;
|
|
12
|
-
export type SearchBarProps<O extends SearchBarOption = SearchBarOption> = FieldControlProps<string, O> & Pick<InputProps, 'inputRef' | 'size' | 'trailing'> & ScrollListItemsStyleProps & {
|
|
12
|
+
export type SearchBarProps<O extends SearchBarOption = SearchBarOption> = Omit<FieldControlProps<string, O>, 'invalid' | 'readOnly' | 'required'> & Pick<InputProps, 'inputRef' | 'size' | 'trailing'> & ScrollListItemsStyleProps & {
|
|
13
13
|
/**
|
|
14
14
|
* The placeholder of the field.
|
|
15
15
|
*
|
|
@@ -81,5 +81,5 @@ export type SearchBarProps<O extends SearchBarOption = SearchBarOption> = FieldC
|
|
|
81
81
|
* @name SearchBar
|
|
82
82
|
* @phase UXReview
|
|
83
83
|
*/
|
|
84
|
-
export declare function SearchBar<O extends SearchBarOption>({ items: itemsProp, noResultsMessage, placeholder, id: idProp, inputRef, name, size, value, onChange, disabled, scrollLimit, trailing, }: SearchBarProps<O>): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
export declare function SearchBar<O extends SearchBarOption>({ items: itemsProp, noResultsMessage, placeholder, id: idProp, inputRef, name, size, value, onChange, disabled, scrollLimit, trailing, 'aria-label': ariaLabel, }: SearchBarProps<O>): import("react/jsx-runtime").JSX.Element;
|
|
85
85
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -51,9 +51,10 @@ import { useIds } from '../../utils/useIds';
|
|
|
51
51
|
* @name SearchBar
|
|
52
52
|
* @phase UXReview
|
|
53
53
|
*/
|
|
54
|
-
export function SearchBar({ items: itemsProp, noResultsMessage, placeholder = 'Search', id: idProp, inputRef, name, size = 'medium', value, onChange, disabled = false, scrollLimit, trailing, }) {
|
|
54
|
+
export function SearchBar({ items: itemsProp, noResultsMessage, placeholder = 'Search', id: idProp, inputRef, name, size = 'medium', value, onChange, disabled = false, scrollLimit, trailing, 'aria-label': ariaLabel, }) {
|
|
55
55
|
const id = useId(idProp);
|
|
56
56
|
const menuId = `${id}-menu`;
|
|
57
|
+
const noResultsId = `${id}-no-results`;
|
|
57
58
|
const items = useIds(`search-bar-${id}`, itemsProp || []);
|
|
58
59
|
const [hasFocus, setHasFocus] = useState(false);
|
|
59
60
|
const filteredItems = useMemo(() => {
|
|
@@ -93,18 +94,15 @@ export function SearchBar({ items: itemsProp, noResultsMessage, placeholder = 'S
|
|
|
93
94
|
getElementById(activeElementId)?.click();
|
|
94
95
|
};
|
|
95
96
|
useEffect(() => {
|
|
96
|
-
if (!hasFocus)
|
|
97
|
-
setActiveElementId(null);
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
if (!hasFocus)
|
|
98
|
+
return setActiveElementId(null);
|
|
99
|
+
if (!filteredItems.length)
|
|
100
|
+
return setActiveElementId(noResultsId);
|
|
100
101
|
if (activeElementId)
|
|
101
102
|
return;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
}, [hasFocus, filteredItems, activeElementId, setActiveElementId, value]);
|
|
107
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { "data-bspk": "search-bar", children: _jsx(Input, { autoComplete: "off", containerRef: elements.setReference, disabled: disabled, id: id, inputProps: {
|
|
103
|
+
setActiveElementId(value?.trim().length ? filteredItems[0].id : null);
|
|
104
|
+
}, [hasFocus, filteredItems, activeElementId, setActiveElementId, value, noResultsId]);
|
|
105
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { "data-bspk": "search-bar", children: _jsx(Input, { "aria-label": ariaLabel, autoComplete: "off", containerRef: elements.setReference, disabled: disabled, id: id, inputProps: {
|
|
108
106
|
'aria-controls': open ? menuId : undefined,
|
|
109
107
|
'aria-expanded': open,
|
|
110
108
|
'aria-haspopup': 'listbox',
|
|
@@ -135,7 +133,7 @@ export function SearchBar({ items: itemsProp, noResultsMessage, placeholder = 'S
|
|
|
135
133
|
}, owner: "select", role: "listbox", style: {
|
|
136
134
|
...(open ? scrollListItemsStyle(scrollLimit, items.length) : {}),
|
|
137
135
|
...floatingStyles,
|
|
138
|
-
}, tabIndex: -1, children: [
|
|
136
|
+
}, tabIndex: -1, children: [activeElementId === noResultsId && (_jsxs("div", { "data-bspk": "no-items-found", id: noResultsId, children: [_jsx(Txt, { as: "div", variant: "heading-h5", children: "No results found" }), noResultsMessage && (_jsx(Txt, { as: "div", variant: "body-base", children: noResultsMessage }))] })), filteredItems.map((item) => {
|
|
139
137
|
const isActive = activeElementId === item.id;
|
|
140
138
|
const isSelected = value == item.label;
|
|
141
139
|
return (_jsx(ListItem, { ...item, active: isActive || undefined, "aria-label": undefined, "aria-selected": isSelected, as: "li", onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../src/components/SearchBar/SearchBar.tsx"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAc,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAiB,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAA6B,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../src/components/SearchBar/SearchBar.tsx"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAc,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAiB,MAAM,uBAAuB,CA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";
|
|
2
2
|
import { randomString } from '../../utils/random';
|
|
3
3
|
export const SearchBarExample = {
|
|
4
|
+
defaultState: {
|
|
5
|
+
'aria-label': 'search bar aria-label',
|
|
6
|
+
},
|
|
4
7
|
render: ({ props, Component }) => {
|
|
5
8
|
return _jsx(Component, { ...props, id: `search-bar-${randomString(8)}` });
|
|
6
9
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBarExample.js","sourceRoot":"","sources":["../../../src/components/SearchBar/SearchBarExample.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAqC;IAC9D,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;QAC7B,OAAO,KAAC,SAAS,OAAK,KAAK,EAAE,EAAE,EAAE,cAAc,YAAY,CAAC,CAAC,CAAC,EAAE,GAAI,CAAC;IACzE,CAAC;CACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"SearchBarExample.js","sourceRoot":"","sources":["../../../src/components/SearchBar/SearchBarExample.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAqC;IAC9D,YAAY,EAAE;QACV,YAAY,EAAE,uBAAuB;KACxC;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;QAC7B,OAAO,KAAC,SAAS,OAAK,KAAK,EAAE,EAAE,EAAE,cAAc,YAAY,CAAC,CAAC,CAAC,EAAE,GAAI,CAAC;IACzE,CAAC;CACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectExample.js","sourceRoot":"","sources":["../../../src/components/Select/SelectExample.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAA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O,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,OAAO,GAAG;iBACnD;gBACD;oBACI,KAAK,EAAE,QAAQ;oBACf,KAAK,EAAE,WAAW;oBAClB,OAAO,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,WAAW,EAAC,IAAI,EAAC,OAAO,GAAG;iBACpD;gBACD;oBACI,KAAK,EAAE,MAAM;oBACb,KAAK,EAAE,SAAS;oBAChB,OAAO,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,GAAG;iBAClD;aACJ;YACD,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,EAAE;SAChB;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAkC;IACxD,YAAY,EAAE;QACV,OAAO,EAAE,eAAe;QACxB,WAAW,EAAE,CAAC;QACd,KAAK,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"SelectExample.js","sourceRoot":"","sources":["../../../src/components/Select/SelectExample.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAGvC,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAqB,EAAE,EAAE,CAAC,CACpD,KAAC,GAAG,cAAE,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;QACpC,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,KAAK;KAClB,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,EAAE,GAAO,CAClC,CAAC;AACF,MAAM,eAAe,GAAG;IACpB,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE;IACjC,EAAE,KAAK,EAAE,GAAG,EAAE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C;AAEF,MAAM,CAAC,MAAM,aAAa,GAAkC;IACxD,YAAY,EAAE;QACV,OAAO,EAAE,eAAe;QACxB,WAAW,EAAE,CAAC;QACd,KAAK,EAAE,EAAE;QACT,YAAY,EAAE,mBAAmB;KACpC;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAC,SAAS,OAAyB,KAAK,IAAxB,MAAM,EAAE,KAAK,CAAe;IACtF,OAAO;CACV,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SliderProps, SliderValue } from './Slider';
|
|
2
|
-
type IntervalDotProps = Pick<SliderProps<SliderValue>, 'max' | 'min' | 'value'> & {
|
|
2
|
+
export type IntervalDotProps = Pick<SliderProps<SliderValue>, 'max' | 'min' | 'value'> & {
|
|
3
3
|
step: number;
|
|
4
4
|
};
|
|
5
5
|
export declare function SliderIntervalDots({ step, max, min, value }: IntervalDotProps): import("react/jsx-runtime").JSX.Element[] | null;
|
|
6
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchExample.js","sourceRoot":"","sources":["../../../src/components/Switch/SwitchExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,aAAa,GAAkC;IACxD,YAAY,EAAE;QACV,YAAY,EAAE,mBAAmB;KACpC;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,GAAI;CAC7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Table/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Table/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextareaExample.js","sourceRoot":"","sources":["../../../src/components/Textarea/TextareaExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,eAAe,GAAoC;IAC5D,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,GAAI;CAC7D,CAAC"}
|
|
1
|
+
{"version":3,"file":"TextareaExample.js","sourceRoot":"","sources":["../../../src/components/Textarea/TextareaExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,eAAe,GAAoC;IAC5D,YAAY,EAAE;QACV,YAAY,EAAE,qBAAqB;KACtC;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,GAAI;CAC7D,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TimePickerType } from './Segment';
|
|
2
|
-
type Option = {
|
|
2
|
+
export type Option = {
|
|
3
3
|
id: string;
|
|
4
4
|
value: string;
|
|
5
5
|
label: string;
|
|
6
6
|
};
|
|
7
|
-
type TimePickerListboxProps = {
|
|
7
|
+
export type TimePickerListboxProps = {
|
|
8
8
|
options: Option[];
|
|
9
9
|
selectedValue?: string;
|
|
10
10
|
type: TimePickerType;
|
|
@@ -12,4 +12,3 @@ type TimePickerListboxProps = {
|
|
|
12
12
|
onTab?: (e: React.KeyboardEvent) => void;
|
|
13
13
|
};
|
|
14
14
|
export declare function TimePickerListbox({ options, selectedValue, type: kind, onSelect, onTab }: TimePickerListboxProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -8,7 +8,7 @@ export declare const HOUR_BOUNDS: {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const NUMBER_PLACEHOLDER: "--";
|
|
10
10
|
export type TimePickerType = 'hours' | 'meridiem' | 'minutes';
|
|
11
|
-
type TimePickerSegmentProps<T extends string> = {
|
|
11
|
+
export type TimePickerSegmentProps<T extends string> = {
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
name: string;
|
|
14
14
|
readOnly?: boolean;
|
|
@@ -18,4 +18,3 @@ type TimePickerSegmentProps<T extends string> = {
|
|
|
18
18
|
setRef?: (element: HTMLElement | null) => void;
|
|
19
19
|
};
|
|
20
20
|
export declare function TimePickerSegment<T extends string>({ disabled, name, readOnly, value: valueProp, type: kind, onChange, setRef, }: TimePickerSegmentProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export const TimePickerExample = {
|
|
3
3
|
variants: false,
|
|
4
|
+
defaultState: {
|
|
5
|
+
'aria-label': 'time picker aria-label',
|
|
6
|
+
},
|
|
4
7
|
render: ({ props, Component }) => _jsx(Component, { ...props }),
|
|
5
8
|
};
|
|
6
9
|
//# sourceMappingURL=TimePickerExample.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimePickerExample.js","sourceRoot":"","sources":["../../../src/components/TimePicker/TimePickerExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,iBAAiB,GAAsC;IAChE,QAAQ,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"TimePickerExample.js","sourceRoot":"","sources":["../../../src/components/TimePicker/TimePickerExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,iBAAiB,GAAsC;IAChE,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE;QACV,YAAY,EAAE,wBAAwB;KACzC;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,GAAI;CAC7D,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { CommonProps } from '-/types/common';
|
|
|
5
5
|
export type ToggleOptionControlProps<T extends {
|
|
6
6
|
'aria-label'?: string;
|
|
7
7
|
}> = Omit<T, 'aria-label'> & Pick<ToggleOptionProps, 'description' | 'label'>;
|
|
8
|
-
export type ToggleOptionProps = CommonProps<'disabled'
|
|
8
|
+
export type ToggleOptionProps = CommonProps<'disabled'> & Omit<ListItemProps, 'as' | 'label' | 'leading' | 'subtext' | 'trailing'> & {
|
|
9
9
|
/**
|
|
10
10
|
* The label of the option. Also used as the aria-label of the control.
|
|
11
11
|
*
|
|
@@ -27,5 +27,5 @@ export type ToggleOptionProps = CommonProps<'disabled' | 'readOnly'> & Omit<List
|
|
|
27
27
|
* @name ToggleOption
|
|
28
28
|
* @phase Utility
|
|
29
29
|
*/
|
|
30
|
-
export declare function ToggleOption({ label, description, children, disabled,
|
|
30
|
+
export declare function ToggleOption({ label, description, children, disabled, ...props }: ToggleOptionProps): import("react/jsx-runtime").JSX.Element;
|
|
31
31
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -7,7 +7,7 @@ import { ListItem } from '../ListItem';
|
|
|
7
7
|
* @name ToggleOption
|
|
8
8
|
* @phase Utility
|
|
9
9
|
*/
|
|
10
|
-
export function ToggleOption({ label, description, children, disabled,
|
|
11
|
-
return (_jsx(ListItem, { ...props,
|
|
10
|
+
export function ToggleOption({ label, description, children, disabled, ...props }) {
|
|
11
|
+
return (_jsx(ListItem, { ...props, "aria-disabled": disabled || undefined, as: "label", label: label, leading: children, subText: description, width: "hug" }));
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=ToggleOption.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleOption.js","sourceRoot":"","sources":["../../../src/components/ToggleOption/ToggleOption.tsx"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAiB,MAAM,uBAAuB,CAAC;AAwBhE;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"ToggleOption.js","sourceRoot":"","sources":["../../../src/components/ToggleOption/ToggleOption.tsx"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAiB,MAAM,uBAAuB,CAAC;AAwBhE;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAqB;IAChG,OAAO,CACH,KAAC,QAAQ,OACD,KAAK,mBACM,QAAQ,IAAI,SAAS,EACpC,EAAE,EAAC,OAAO,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,WAAW,EACpB,KAAK,EAAC,KAAK,GACb,CACL,CAAC;AACN,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { KeyboardEvent } from 'react';
|
|
2
2
|
import { KeysCallback } from '-/utils/handleKeyDown';
|
|
3
3
|
import { KeyboardEventCode } from '-/utils/keyboard';
|
|
4
|
-
type ArrowKeyNames = Extract<KeyboardEventCode, `Arrow${string}`>;
|
|
4
|
+
export type ArrowKeyNames = Extract<KeyboardEventCode, `Arrow${string}`>;
|
|
5
5
|
export type ArrowKeyNavigationCallbackParams = {
|
|
6
6
|
key: ArrowKeyNames;
|
|
7
7
|
event: KeyboardEvent;
|
|
8
8
|
activeElementId: string | null;
|
|
9
9
|
increment: number;
|
|
10
10
|
};
|
|
11
|
-
type UseArrowNavigationProps = {
|
|
11
|
+
export type UseArrowNavigationProps = {
|
|
12
12
|
/**
|
|
13
13
|
* An array of string IDs representing the navigable elements. These IDs should correspond to the `id` attributes of
|
|
14
14
|
* the elements in the DOM. Ensure the elements are not disabled.
|
|
@@ -45,4 +45,3 @@ export declare function useArrowNavigation({ ids, callback, increments, defaultA
|
|
|
45
45
|
setActiveElementId: (id: string | null) => void;
|
|
46
46
|
arrowKeyCallbacks: KeysCallback;
|
|
47
47
|
};
|
|
48
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Fn = (...args: unknown[]) => void;
|
|
1
|
+
export type Fn = (...args: unknown[]) => void;
|
|
2
2
|
/**
|
|
3
3
|
* A hook that debounces a function call, ensuring that the function is not called again until a specified delay
|
|
4
4
|
*
|
|
@@ -8,4 +8,3 @@ type Fn = (...args: unknown[]) => void;
|
|
|
8
8
|
* (delay) ms
|
|
9
9
|
*/
|
|
10
10
|
export declare function useDebounceCallback(fn: Fn, delay?: number): Fn;
|
|
11
|
-
export {};
|
|
@@ -2,7 +2,6 @@ import { SetStateAction } from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* A hook that debounces a state update, ensuring that the function is not called again until a specified delay
|
|
4
4
|
*
|
|
5
|
-
* @param defaultValue The initial value of the state
|
|
6
5
|
* @param delay [1000] The delay (in ms) for the state to update
|
|
7
6
|
* @returns A tuple containing the current state and a debounced setter function that updates the state after the
|
|
8
7
|
* specified delay
|
|
@@ -3,7 +3,6 @@ import { useTimeout } from './useTimeout';
|
|
|
3
3
|
/**
|
|
4
4
|
* A hook that debounces a state update, ensuring that the function is not called again until a specified delay
|
|
5
5
|
*
|
|
6
|
-
* @param defaultValue The initial value of the state
|
|
7
6
|
* @param delay [1000] The delay (in ms) for the state to update
|
|
8
7
|
* @returns A tuple containing the current state and a debounced setter function that updates the state after the
|
|
9
8
|
* specified delay
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebounceState.js","sourceRoot":"","sources":["../../src/hooks/useDebounceState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"useDebounceState.js","sourceRoot":"","sources":["../../src/hooks/useDebounceState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAI,YAA2B,EAAE,KAAK,GAAG,IAAI;IACzE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAI,YAAY,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,OAAO,CAAC,KAAK,EAAE,CAAC,SAA4B,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,CAAU,CAAC;AAC7G,CAAC"}
|
|
@@ -22,12 +22,11 @@
|
|
|
22
22
|
* </>
|
|
23
23
|
* );
|
|
24
24
|
* }
|
|
25
|
-
*
|
|
26
|
-
* @param elements - The elements to check if the click occurred outside of.
|
|
27
|
-
* @param callback - The callback to call when a click occurs outside of the ref.
|
|
28
|
-
* @param disabled - Whether the hook should be disabled. Defaults to false.
|
|
29
25
|
*/
|
|
30
|
-
export declare function useOutsideClick({ elements,
|
|
26
|
+
export declare function useOutsideClick({ elements, // The elements to check if the click occurred outside of.
|
|
27
|
+
callback, // The callback to call when a click occurs outside of the ref.
|
|
28
|
+
disabled, // Whether the hook should be disabled. Defaults to false.
|
|
29
|
+
handleTabs, }: {
|
|
31
30
|
elements: (HTMLElement | null)[] | null;
|
|
32
31
|
callback: (event?: KeyboardEvent | MouseEvent) => void;
|
|
33
32
|
disabled: boolean;
|
|
@@ -23,12 +23,12 @@ import { useEffect } from 'react';
|
|
|
23
23
|
* </>
|
|
24
24
|
* );
|
|
25
25
|
* }
|
|
26
|
-
*
|
|
27
|
-
* @param elements - The elements to check if the click occurred outside of.
|
|
28
|
-
* @param callback - The callback to call when a click occurs outside of the ref.
|
|
29
|
-
* @param disabled - Whether the hook should be disabled. Defaults to false.
|
|
30
26
|
*/
|
|
31
|
-
export function useOutsideClick({ elements,
|
|
27
|
+
export function useOutsideClick({ elements, // The elements to check if the click occurred outside of.
|
|
28
|
+
callback, // The callback to call when a click occurs outside of the ref.
|
|
29
|
+
disabled, // Whether the hook should be disabled. Defaults to false.
|
|
30
|
+
handleTabs = false, // Whether to handle tab key presses as outside clicks.
|
|
31
|
+
}) {
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
if (!elements?.length || disabled)
|
|
34
34
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOutsideClick.js","sourceRoot":"","sources":["../../src/hooks/useOutsideClick.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC
|
|
1
|
+
{"version":3,"file":"useOutsideClick.js","sourceRoot":"","sources":["../../src/hooks/useOutsideClick.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,eAAe,CAAC,EAC5B,QAAQ,EAAE,0DAA0D;AACpE,QAAQ,EAAE,+DAA+D;AACzE,QAAQ,EAAE,0DAA0D;AACpE,UAAU,GAAG,KAAK,EAAE,uDAAuD;EAM9E;IACG,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,QAAQ,EAAE,MAAM,IAAI,QAAQ;YAAE,OAAO;QAE1C,MAAM,kBAAkB,GAAG,CAAC,KAAiB,EAAE,EAAE;YAC7C,IAAI,QAAQ,IAAI,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,MAAc,CAAC,CAAC;gBAAE,OAAO;YACjG,QAAQ,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,CAAC;QAEF,MAAM,gBAAgB,GAAG,CAAC,KAAoB,EAAE,EAAE;YAC9C,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,IAAI,QAAQ;gBAAE,OAAO;YAE3D,UAAU,CAAC,GAAG,EAAE;gBACZ,IAAI,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;oBAAE,OAAO;gBACvF,QAAQ,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC,EAAE,CAAC,CAAC,CAAC;QACV,CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAC3D,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QACvD,OAAO,GAAG,EAAE;YACR,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;YAC9D,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAC9D,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,sDAAsD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type TimeoutHook = {
|
|
1
|
+
export type TimeoutHook = {
|
|
2
2
|
clear: () => void;
|
|
3
3
|
set: (callback: () => void, ms?: number) => void;
|
|
4
4
|
ref: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;
|
|
@@ -24,5 +24,4 @@ type TimeoutHook = {
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function useTimeout(): TimeoutHook;
|
|
26
26
|
export declare function useTimeout(initialCallback: () => void, durationMs: number): TimeoutHook;
|
|
27
|
-
export {};
|
|
28
27
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
package/dist/types/common.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type AlertVariant = 'error' | 'informational' | 'success' | 'warning';
|
|
|
11
11
|
export type SetRef<T> = (instance: T | null) => void;
|
|
12
12
|
export type ElementProps<P extends Record<string, unknown>, E extends JSXElementConstructor<unknown> | keyof JSX.IntrinsicElements, O extends string = ''> = Omit<ComponentPropsWithoutRef<E>, O | keyof P> & P;
|
|
13
13
|
export type ElementConstructorProps<E extends JSXElementConstructor<unknown> | keyof JSX.IntrinsicElements, O extends string = ''> = Omit<ComponentPropsWithoutRef<E>, O>;
|
|
14
|
-
type CSSVariables = `--${string}`;
|
|
14
|
+
export type CSSVariables = `--${string}`;
|
|
15
15
|
export type CSSWithVariables = CSSProperties | (CSSProperties & {
|
|
16
16
|
[key in CSSVariables]: unknown;
|
|
17
17
|
});
|
|
@@ -95,14 +95,12 @@ export type CommonPropsLibrary = {
|
|
|
95
95
|
/**
|
|
96
96
|
* The aria-label for the element.
|
|
97
97
|
*
|
|
98
|
-
*
|
|
99
|
-
*/
|
|
100
|
-
'aria-label'?: string;
|
|
101
|
-
/**
|
|
102
|
-
* Identifies the parent component. Helps with styling, debugging, and/or testing purposes.
|
|
98
|
+
* This is used to provide an accessible name for the element when a visible label is not present.
|
|
103
99
|
*
|
|
104
|
-
*
|
|
100
|
+
* Ensure this is provided when using the element in isolation to maintain accessibility.
|
|
105
101
|
*/
|
|
102
|
+
'aria-label'?: string;
|
|
103
|
+
/** Identifies the parent component. Helps with styling, debugging, and/or testing purposes. */
|
|
106
104
|
owner?: string;
|
|
107
105
|
/**
|
|
108
106
|
* The ARIA role of the element.
|
|
@@ -134,5 +132,4 @@ export type FieldControlProps<ValueType = string, ChangeContext = ChangeEvent<HT
|
|
|
134
132
|
onChange: (next: ValueType | undefined, event?: ChangeContext) => void;
|
|
135
133
|
};
|
|
136
134
|
export type Brand = 'anywhere' | 'better-homes-gardens' | 'cartus' | 'century-21' | 'coldwell-banker' | 'corcoran' | 'denali-boss' | 'era' | 'sothebys';
|
|
137
|
-
export {};
|
|
138
135
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
package/dist/types/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAyKH,sDAAsD"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { IconName } from '@bspk/icons/meta';
|
|
2
2
|
import { CountryCode } from 'libphonenumber-js';
|
|
3
3
|
export type SupportedCountryCode = keyof CountryCodeData;
|
|
4
|
-
type CountryCodeData = Omit<Record<CountryCode, {
|
|
4
|
+
export type CountryCodeData = Omit<Record<CountryCode, {
|
|
5
5
|
name: string;
|
|
6
6
|
flagIconName: IconName;
|
|
7
7
|
}>, 'AC' | 'CI' | 'CV' | 'FM' | 'GP' | 'KN' | 'LC' | 'MF' | 'NC' | 'RE' | 'SH' | 'SJ' | 'TA' | 'VA' | 'VC' | 'WF' | 'XK' | 'YT'>;
|
|
8
8
|
export declare const countryCodeData: CountryCodeData;
|
|
9
9
|
export declare const countryCodes: SupportedCountryCode[];
|
|
10
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DemoAction, DemoSetState } from './demo';
|
|
2
|
-
type ExampleChildElementProps = {
|
|
2
|
+
export type ExampleChildElementProps = {
|
|
3
3
|
exampleState: Record<string, any>;
|
|
4
4
|
name: string;
|
|
5
5
|
setState: DemoSetState;
|
|
@@ -14,4 +14,3 @@ export declare function createExampleChildElement({ exampleState, name, setState
|
|
|
14
14
|
element: JSX.Element | null;
|
|
15
15
|
componentName?: string;
|
|
16
16
|
};
|
|
17
|
-
export {};
|
package/dist/utils/demo.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export type ComponentExampleRenderProps<Props = Record<string, unknown>> = {
|
|
|
40
40
|
id: string;
|
|
41
41
|
};
|
|
42
42
|
export type ComponentExampleRender<Props = Record<string, unknown>> = (params: ComponentExampleRenderProps<Props>) => React.ReactNode;
|
|
43
|
-
type ComponentVariantOverride<Props> = {
|
|
43
|
+
export type ComponentVariantOverride<Props> = {
|
|
44
44
|
[K in keyof Props]?: Props[K] | {
|
|
45
45
|
options: Props[K][];
|
|
46
46
|
};
|
|
@@ -135,4 +135,3 @@ export type DemoPreset<P = Record<string, unknown>> = Preset<P> & {
|
|
|
135
135
|
value: string;
|
|
136
136
|
};
|
|
137
137
|
export declare function createUid(prefix?: string): string;
|
|
138
|
-
export {};
|