@bspk/ui 1.3.4 → 1.3.5
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/Avatar/Avatar.d.ts +3 -3
- package/dist/components/Avatar/Avatar.js +8 -8
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/AvatarExample.js +1 -1
- package/dist/components/Avatar/AvatarExample.js.map +1 -1
- package/dist/components/Avatar/avatar.css +5 -1
- package/dist/components/Avatar/avatar.css.js +5 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +11 -6
- package/dist/components/AvatarGroup/AvatarGroup.js +5 -6
- package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroupExample.js +36 -9
- package/dist/components/AvatarGroup/AvatarGroupExample.js.map +1 -1
- package/dist/components/AvatarGroup/Overflow.d.ts +11 -0
- package/dist/components/AvatarGroup/Overflow.js +37 -0
- package/dist/components/AvatarGroup/Overflow.js.map +1 -0
- package/dist/components/AvatarGroup/avatar-group.css +27 -13
- package/dist/components/AvatarGroup/avatar-group.css.js +27 -13
- package/dist/components/Badge/BadgeExample.js +1 -1
- package/dist/components/Badge/BadgeExample.js.map +1 -1
- package/dist/components/BadgeDot/BadgeDotExample.js +1 -1
- package/dist/components/BadgeDot/BadgeDotExample.js.map +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Card/Card.d.ts +2 -1
- package/dist/components/Card/Card.js +2 -2
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +4 -4
- package/dist/components/CheckboxGroup/CheckboxGroup.js +4 -4
- package/dist/components/CheckboxGroupField/CheckboxGroupField.d.ts +1 -1
- package/dist/components/CheckboxGroupField/CheckboxGroupField.js +2 -2
- package/dist/components/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
- package/dist/components/CheckboxOption/CheckboxOption.d.ts +3 -2
- package/dist/components/CheckboxOption/CheckboxOption.js +2 -2
- package/dist/components/CheckboxOption/CheckboxOption.js.map +1 -1
- package/dist/components/DatePickerField/DatePickerField.d.ts +1 -1
- package/dist/components/DatePickerField/DatePickerField.js +2 -2
- package/dist/components/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Fab/Fab.d.ts +2 -2
- package/dist/components/Fab/Fab.js.map +1 -1
- package/dist/components/FormField/FormField.d.ts +3 -2
- package/dist/components/FormField/FormField.js +2 -2
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/InputField/InputField.d.ts +1 -1
- package/dist/components/InputField/InputField.js +2 -2
- package/dist/components/InputField/InputField.js.map +1 -1
- package/dist/components/InputNumberField/InputNumberField.d.ts +1 -1
- package/dist/components/InputNumberField/InputNumberField.js +2 -2
- package/dist/components/InputNumberField/InputNumberField.js.map +1 -1
- package/dist/components/InputPhoneField/InputPhoneField.d.ts +1 -1
- package/dist/components/InputPhoneField/InputPhoneField.js +2 -2
- package/dist/components/InputPhoneField/InputPhoneField.js.map +1 -1
- package/dist/components/Layout/Layout.d.ts +2 -2
- package/dist/components/Layout/Layout.js.map +1 -1
- package/dist/components/ListItem/ListItem.d.ts +1 -1
- package/dist/components/Menu/Menu.d.ts +8 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/MenuExample.js +1 -1
- package/dist/components/Menu/MenuExample.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.d.ts +1 -1
- package/dist/components/PasswordField/PasswordField.js +2 -2
- package/dist/components/PasswordField/PasswordField.js.map +1 -1
- package/dist/components/ProgressCircle/progress-circle.css +2 -0
- package/dist/components/ProgressCircle/progress-circle.css.js +2 -0
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/RadioGroupField/RadioGroupField.d.ts +1 -1
- package/dist/components/RadioGroupField/RadioGroupField.js +2 -2
- package/dist/components/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/SearchBar/SearchBar.d.ts +2 -2
- package/dist/components/SearchBar/SearchBar.js +2 -2
- package/dist/components/SearchBar/SearchBar.js.map +1 -1
- package/dist/components/Select/Select.d.ts +9 -2
- package/dist/components/Select/Select.js +4 -3
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectExample.js +36 -1
- package/dist/components/Select/SelectExample.js.map +1 -1
- package/dist/components/SelectField/SelectField.d.ts +1 -1
- package/dist/components/SelectField/SelectField.js +2 -2
- package/dist/components/SelectField/SelectField.js.map +1 -1
- package/dist/components/SkeletonText/SkeletonText.js +1 -1
- package/dist/components/SkeletonText/SkeletonText.js.map +1 -1
- package/dist/components/Slider/slider.css +1 -0
- package/dist/components/Slider/slider.css.js +1 -0
- package/dist/components/Textarea/Textarea.d.ts +3 -9
- package/dist/components/Textarea/Textarea.js +2 -2
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/TextareaField/TextareaField.d.ts +1 -1
- package/dist/components/TextareaField/TextareaField.js +2 -2
- package/dist/components/TextareaField/TextareaField.js.map +1 -1
- package/dist/components/TimePicker/TimePicker.js +10 -4
- package/dist/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/components/TimePickerField/TimePickerField.d.ts +1 -1
- package/dist/components/TimePickerField/TimePickerField.js +2 -2
- package/dist/components/TimePickerField/TimePickerField.js.map +1 -1
- package/dist/components/ToggleOption/ToggleOption.d.ts +3 -3
- package/dist/components/ToggleOption/ToggleOption.js +2 -2
- package/dist/components/ToggleOption/ToggleOption.js.map +1 -1
- package/dist/components/Truncated/Truncated.d.ts +2 -2
- package/dist/components/Truncated/Truncated.js.map +1 -1
- package/dist/components/Txt/Txt.d.ts +2 -2
- package/dist/components/Txt/Txt.js.map +1 -1
- package/dist/hooks/useArrowNavigation.d.ts +0 -2
- package/dist/hooks/useArrowNavigation.js +0 -2
- package/dist/hooks/useArrowNavigation.js.map +1 -1
- package/dist/hooks/useCheckboxGroupState.d.ts +7 -10
- package/dist/hooks/useCheckboxGroupState.js +7 -10
- package/dist/hooks/useCheckboxGroupState.js.map +1 -1
- package/dist/hooks/useFloating.js +8 -7
- package/dist/hooks/useFloating.js.map +1 -1
- package/dist/styles/base.css +4 -0
- package/dist/styles/base.css.js +4 -0
- package/dist/types/common.d.ts +12 -1
- package/dist/types/common.js.map +1 -1
- package/meta.ts +4 -4
- package/package.json +1 -3
- package/src/components/Avatar/Avatar.tsx +10 -11
- package/src/components/Avatar/AvatarExample.tsx +1 -1
- package/src/components/Avatar/avatar.scss +6 -1
- package/src/components/AvatarGroup/AvatarGroup.tsx +20 -24
- package/src/components/AvatarGroup/AvatarGroupExample.tsx +35 -9
- package/src/components/AvatarGroup/Overflow.tsx +91 -0
- package/src/components/AvatarGroup/avatar-group.scss +34 -14
- package/src/components/Badge/BadgeExample.tsx +1 -1
- package/src/components/BadgeDot/BadgeDotExample.tsx +1 -1
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Card/Card.tsx +3 -2
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +4 -4
- package/src/components/CheckboxGroupField/CheckboxGroupField.tsx +3 -2
- package/src/components/CheckboxOption/CheckboxOption.tsx +4 -1
- package/src/components/DatePickerField/DatePickerField.tsx +8 -1
- package/src/components/Fab/Fab.tsx +2 -2
- package/src/components/FormField/FormField.tsx +13 -3
- package/src/components/InputField/InputField.tsx +15 -2
- package/src/components/InputNumberField/InputNumberField.tsx +8 -1
- package/src/components/InputPhoneField/InputPhoneField.tsx +8 -1
- package/src/components/Layout/Layout.tsx +2 -2
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/Menu/Menu.tsx +9 -1
- package/src/components/Menu/MenuExample.tsx +1 -1
- package/src/components/PasswordField/PasswordField.tsx +15 -2
- package/src/components/ProgressCircle/progress-circle.scss +2 -0
- package/src/components/RadioGroup/RadioGroup.tsx +18 -20
- package/src/components/RadioGroupField/RadioGroupField.tsx +2 -1
- package/src/components/SearchBar/SearchBar.tsx +3 -1
- package/src/components/Select/Select.tsx +12 -3
- package/src/components/Select/SelectExample.tsx +36 -1
- package/src/components/SelectField/SelectField.tsx +15 -2
- package/src/components/SkeletonText/SkeletonText.tsx +1 -1
- package/src/components/Slider/slider.scss +1 -0
- package/src/components/Textarea/Textarea.tsx +34 -39
- package/src/components/TextareaField/TextareaField.tsx +15 -2
- package/src/components/TimePicker/TimePicker.tsx +13 -3
- package/src/components/TimePickerField/TimePickerField.tsx +8 -1
- package/src/components/ToggleOption/ToggleOption.tsx +20 -19
- package/src/components/Truncated/Truncated.tsx +2 -2
- package/src/components/Txt/Txt.tsx +2 -2
- package/src/hooks/useArrowNavigation.ts +0 -2
- package/src/hooks/useCheckboxGroupState.ts +7 -10
- package/src/hooks/useFloating.ts +8 -7
- package/src/styles/base.scss +4 -0
- package/src/types/common.ts +11 -0
- package/dist/components/MenuButton/MenuButton.d.ts +0 -19
- package/dist/components/MenuButton/MenuButton.js +0 -20
- package/dist/components/MenuButton/MenuButton.js.map +0 -1
- package/dist/components/MenuButton/index.d.ts +0 -1
- package/dist/components/MenuButton/index.js +0 -2
- package/dist/components/MenuButton/index.js.map +0 -1
- package/dist/components/MenuButton/menu-button.css +0 -16
- package/dist/components/MenuButton/menu-button.css.js +0 -21
- package/src/components/MenuButton/MenuButton.rtl.test.tsx +0 -15
- package/src/components/MenuButton/MenuButton.tsx +0 -29
- package/src/components/MenuButton/index.tsx +0 -1
- package/src/components/MenuButton/menu-button.scss +0 -16
|
@@ -99,7 +99,7 @@ export function TimePicker({
|
|
|
99
99
|
|
|
100
100
|
const { floatingStyles, elements } = useFloating({
|
|
101
101
|
strategy: 'fixed',
|
|
102
|
-
refWidth:
|
|
102
|
+
refWidth: false,
|
|
103
103
|
offsetOptions: 4,
|
|
104
104
|
hide: !open,
|
|
105
105
|
});
|
|
@@ -230,7 +230,7 @@ export function TimePicker({
|
|
|
230
230
|
variant="tertiary"
|
|
231
231
|
/>
|
|
232
232
|
</div>
|
|
233
|
-
{
|
|
233
|
+
{open && (
|
|
234
234
|
<Portal>
|
|
235
235
|
<Menu
|
|
236
236
|
id={menuId}
|
|
@@ -241,6 +241,7 @@ export function TimePicker({
|
|
|
241
241
|
label="Select time"
|
|
242
242
|
owner="time-picker"
|
|
243
243
|
style={floatingStyles}
|
|
244
|
+
width="fit-content"
|
|
244
245
|
>
|
|
245
246
|
<FocusTrap
|
|
246
247
|
focusTrapOptions={{
|
|
@@ -256,7 +257,16 @@ export function TimePicker({
|
|
|
256
257
|
minutes: node?.querySelector('[data-scroll-column="minutes"]') as HTMLElement,
|
|
257
258
|
meridiem: node?.querySelector('[data-scroll-column="meridiem"]') as HTMLElement,
|
|
258
259
|
};
|
|
259
|
-
|
|
260
|
+
const activeHour =
|
|
261
|
+
listBoxRefs.current.hours?.querySelector<HTMLElement>('[data-active]');
|
|
262
|
+
const activeMinute =
|
|
263
|
+
listBoxRefs.current.minutes?.querySelector<HTMLElement>('[data-active]');
|
|
264
|
+
const activeMeridiem =
|
|
265
|
+
listBoxRefs.current.meridiem?.querySelector<HTMLElement>('[data-active]');
|
|
266
|
+
activeHour?.scrollIntoView({ block: 'nearest' });
|
|
267
|
+
activeMinute?.scrollIntoView({ block: 'nearest' });
|
|
268
|
+
activeMeridiem?.scrollIntoView({ block: 'nearest' });
|
|
269
|
+
activeHour?.focus();
|
|
260
270
|
}}
|
|
261
271
|
>
|
|
262
272
|
<TimePickerListbox
|
|
@@ -18,10 +18,17 @@ export function TimePickerField({
|
|
|
18
18
|
helperText,
|
|
19
19
|
labelTrailing,
|
|
20
20
|
errorMessage,
|
|
21
|
+
style,
|
|
21
22
|
...controlProps
|
|
22
23
|
}: TimePickerFieldProps) {
|
|
23
24
|
return (
|
|
24
|
-
<FormField
|
|
25
|
+
<FormField
|
|
26
|
+
errorMessage={errorMessage}
|
|
27
|
+
helperText={helperText}
|
|
28
|
+
label={label}
|
|
29
|
+
labelTrailing={labelTrailing}
|
|
30
|
+
style={style}
|
|
31
|
+
>
|
|
25
32
|
<TimePicker {...controlProps} />
|
|
26
33
|
</FormField>
|
|
27
34
|
);
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import './toggle-option.scss';
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
|
-
import { ListItem } from '-/components/ListItem';
|
|
3
|
+
import { ListItem, ListItemProps } from '-/components/ListItem';
|
|
4
4
|
import { CommonProps } from '-/types/common';
|
|
5
5
|
|
|
6
6
|
export type ToggleOptionControlProps<T extends { 'aria-label'?: string }> = Omit<T, 'aria-label'> &
|
|
7
7
|
Pick<ToggleOptionProps, 'description' | 'label'>;
|
|
8
8
|
|
|
9
|
-
export type ToggleOptionProps = CommonProps<'disabled' | 'readOnly'> &
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
9
|
+
export type ToggleOptionProps = CommonProps<'disabled' | 'readOnly'> &
|
|
10
|
+
Omit<ListItemProps, 'as' | 'label' | 'leading' | 'subtext' | 'trailing'> & {
|
|
11
|
+
/**
|
|
12
|
+
* The label of the option. Also used as the aria-label of the control.
|
|
13
|
+
*
|
|
14
|
+
* @required
|
|
15
|
+
*/
|
|
16
|
+
label: string;
|
|
17
|
+
/**
|
|
18
|
+
* The description of the option.
|
|
19
|
+
*
|
|
20
|
+
* @type multiline
|
|
21
|
+
*/
|
|
22
|
+
description?: string;
|
|
23
|
+
/** The control element to use. */
|
|
24
|
+
children?: ReactElement;
|
|
25
|
+
};
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* A utility component that wraps a checkbox, radio, and switch.
|
|
@@ -30,9 +30,10 @@ export type ToggleOptionProps = CommonProps<'disabled' | 'readOnly'> & {
|
|
|
30
30
|
* @name ToggleOption
|
|
31
31
|
* @phase Utility
|
|
32
32
|
*/
|
|
33
|
-
export function ToggleOption({ label, description, children, disabled, readOnly }: ToggleOptionProps) {
|
|
33
|
+
export function ToggleOption({ label, description, children, disabled, readOnly, ...props }: ToggleOptionProps) {
|
|
34
34
|
return (
|
|
35
35
|
<ListItem
|
|
36
|
+
{...props}
|
|
36
37
|
as="label"
|
|
37
38
|
data-disabled={disabled}
|
|
38
39
|
data-readonly={readOnly}
|
|
@@ -4,7 +4,7 @@ import { Tooltip, TooltipTriggerProps } from '-/components/Tooltip';
|
|
|
4
4
|
import { useTruncatedText } from '-/hooks/useTruncatedText';
|
|
5
5
|
import { ElementConstructorProps } from '-/types/common';
|
|
6
6
|
|
|
7
|
-
export type TruncatedProps<As extends ElementType =
|
|
7
|
+
export type TruncatedProps<As extends ElementType = ElementType> = {
|
|
8
8
|
/**
|
|
9
9
|
* The element type to render as.
|
|
10
10
|
*
|
|
@@ -35,7 +35,7 @@ export type TruncatedProps<As extends ElementType = 'span'> = {
|
|
|
35
35
|
* @name Truncated
|
|
36
36
|
* @phase Utility
|
|
37
37
|
*/
|
|
38
|
-
export function Truncated<As extends ElementType =
|
|
38
|
+
export function Truncated<As extends ElementType = ElementType>({
|
|
39
39
|
children,
|
|
40
40
|
label,
|
|
41
41
|
...props
|
|
@@ -4,7 +4,7 @@ import { SkeletonText } from '-/components/SkeletonText';
|
|
|
4
4
|
import { ElementProps } from '-/types/common';
|
|
5
5
|
import { TxtVariant } from '-/utils/txtVariants';
|
|
6
6
|
|
|
7
|
-
export type TxtProps<As extends ElementType =
|
|
7
|
+
export type TxtProps<As extends ElementType = ElementType> = {
|
|
8
8
|
/**
|
|
9
9
|
* The element type to render as.
|
|
10
10
|
*
|
|
@@ -56,7 +56,7 @@ export type TxtProps<As extends ElementType = 'span'> = {
|
|
|
56
56
|
* @name Txt
|
|
57
57
|
* @phase UXReview
|
|
58
58
|
*/
|
|
59
|
-
export function Txt<As extends ElementType =
|
|
59
|
+
export function Txt<As extends ElementType = ElementType>({
|
|
60
60
|
children,
|
|
61
61
|
as,
|
|
62
62
|
variant = 'body-base',
|
|
@@ -39,9 +39,7 @@ type UseArrowNavigationProps = {
|
|
|
39
39
|
* A hook to manage arrow key navigation for a list of elements.
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
|
-
* ```tsx
|
|
43
42
|
* const { activeElementId, setActiveElementId, arrowKeyCallbacks } = useArrowNavigation(['id1', 'id2', 'id3']);
|
|
44
|
-
* ```;
|
|
45
43
|
*
|
|
46
44
|
* @returns An object containing:
|
|
47
45
|
*
|
|
@@ -6,22 +6,19 @@ import { CheckboxProps } from '-/components/Checkbox';
|
|
|
6
6
|
* A hook to manage the state of a group of checkboxes. Used alongside the CheckboxGroup component.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* import { Checkbox } from
|
|
10
|
-
* import { useCheckboxGroupState } from
|
|
9
|
+
* import { Checkbox } from '@bspk/ui/Checkbox';
|
|
10
|
+
* import { useCheckboxGroupState } from '@bspk/ui/hooks/useCheckboxGroupState';
|
|
11
11
|
*
|
|
12
12
|
* function Example() {
|
|
13
|
-
* const allValues = [
|
|
14
|
-
*
|
|
15
|
-
* const { allCheckboxProps, checkboxProps, values } = useCheckboxGroupState(allValues, "fruits");
|
|
16
|
-
*
|
|
13
|
+
* const allValues = ['Red', 'Orange', 'Yellow', 'Green'];
|
|
14
|
+
* const { allCheckboxProps, checkboxProps, values } = useCheckboxGroupState(allValues, 'fruits');
|
|
17
15
|
* return (
|
|
18
|
-
*
|
|
19
|
-
* <pre>Selected Values: {values.join(
|
|
20
|
-
* <Checkbox aria-label="All" {...allCheckboxProps} />
|
|
16
|
+
* <div>
|
|
17
|
+
* <pre>Selected Values: {values.join(', ')}</pre> <Checkbox aria-label="All" {...allCheckboxProps} />{' '}
|
|
21
18
|
* {allValues.map((value) => (
|
|
22
19
|
* <Checkbox key={value} aria-label={value} {...checkboxProps(value)} />
|
|
23
20
|
* ))}
|
|
24
|
-
*
|
|
21
|
+
* </div>
|
|
25
22
|
* );
|
|
26
23
|
* }
|
|
27
24
|
*
|
package/src/hooks/useFloating.ts
CHANGED
|
@@ -158,13 +158,14 @@ export function useFloating({
|
|
|
158
158
|
arrowRef?.current && arrow({ element: arrowRef.current, padding: 8 }),
|
|
159
159
|
offset(offsetOptions),
|
|
160
160
|
flip(),
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
refWidth &&
|
|
162
|
+
size({
|
|
163
|
+
apply({ rects, elements }: MiddlewareState) {
|
|
164
|
+
Object.assign(elements.floating.style, {
|
|
165
|
+
width: `${rects.reference.width}px`,
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
}),
|
|
168
169
|
],
|
|
169
170
|
}).then((value: ComputePositionReturn) => {
|
|
170
171
|
setFloatingStyles(() => ({
|
package/src/styles/base.scss
CHANGED
package/src/types/common.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
AriaRole,
|
|
14
14
|
ChangeEvent,
|
|
15
15
|
KeyboardEvent,
|
|
16
|
+
CSSProperties,
|
|
16
17
|
} from 'react';
|
|
17
18
|
|
|
18
19
|
export type AlertVariant = 'error' | 'informational' | 'success' | 'warning';
|
|
@@ -31,6 +32,10 @@ export type ElementConstructorProps<
|
|
|
31
32
|
O extends string = '',
|
|
32
33
|
> = Omit<ComponentPropsWithoutRef<E>, O>;
|
|
33
34
|
|
|
35
|
+
type CSSVariables = `--${string}`;
|
|
36
|
+
|
|
37
|
+
export type CSSWithVariables = CSSProperties | (CSSProperties & { [key in CSSVariables]: unknown });
|
|
38
|
+
|
|
34
39
|
export type DataProps = Record<`data-${string}`, string>;
|
|
35
40
|
|
|
36
41
|
export type ButtonSize = 'large' | 'medium' | 'small' | 'x-small';
|
|
@@ -129,6 +134,12 @@ export type CommonPropsLibrary = {
|
|
|
129
134
|
* @type string
|
|
130
135
|
*/
|
|
131
136
|
role?: AriaRole;
|
|
137
|
+
/**
|
|
138
|
+
* Inline styles to apply to the element.
|
|
139
|
+
*
|
|
140
|
+
* Allows for CSS variables to be passed in as well.
|
|
141
|
+
*/
|
|
142
|
+
style?: CSSWithVariables;
|
|
132
143
|
};
|
|
133
144
|
|
|
134
145
|
export type CommonProps<K extends keyof CommonPropsLibrary> = Pick<CommonPropsLibrary, K>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import './menu-button.scss';
|
|
2
|
-
import { ButtonProps } from '-/components/Button';
|
|
3
|
-
import { ElementProps } from '-/types/common';
|
|
4
|
-
export type MenuButtonProps = Pick<ButtonProps, 'as' | 'onClick'>;
|
|
5
|
-
/**
|
|
6
|
-
* Utility component used within top navigation.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* import { MenuButton } from '@bspk/ui/MenuButton';
|
|
10
|
-
*
|
|
11
|
-
* function Example() {
|
|
12
|
-
* return <MenuButton />;
|
|
13
|
-
* }
|
|
14
|
-
*
|
|
15
|
-
* @name MenuButton
|
|
16
|
-
* @phase Utility
|
|
17
|
-
*/
|
|
18
|
-
export declare function MenuButton(props: ElementProps<MenuButtonProps, 'button'>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import './menu-button.css.js';
|
|
3
|
-
import { SvgMenu } from '@bspk/icons/Menu';
|
|
4
|
-
/**
|
|
5
|
-
* Utility component used within top navigation.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* import { MenuButton } from '@bspk/ui/MenuButton';
|
|
9
|
-
*
|
|
10
|
-
* function Example() {
|
|
11
|
-
* return <MenuButton />;
|
|
12
|
-
* }
|
|
13
|
-
*
|
|
14
|
-
* @name MenuButton
|
|
15
|
-
* @phase Utility
|
|
16
|
-
*/
|
|
17
|
-
export function MenuButton(props) {
|
|
18
|
-
return (_jsx("button", { "data-bspk": "menu-button", ...props, children: _jsx(SvgMenu, {}) }));
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=MenuButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.js","sourceRoot":"","sources":["../../../src/components/MenuButton/MenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAM3C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,UAAU,CAAC,KAA8C;IACrE,OAAO,CACH,8BAAkB,aAAa,KAAK,KAAK,YACrC,KAAC,OAAO,KAAG,GACN,CACZ,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './MenuButton';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuButton/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
[data-bspk=menu-button] {
|
|
2
|
-
background: none;
|
|
3
|
-
border: none;
|
|
4
|
-
cursor: pointer;
|
|
5
|
-
padding: 0;
|
|
6
|
-
height: 48px;
|
|
7
|
-
width: auto;
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: row;
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
padding-top: var(--spacing-sizing-01);
|
|
13
|
-
color: var(--foreground-neutral-on-surface-variant-01);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** * This file is generated by the build script.
|
|
2
|
-
* Do not edit this file directly. */
|
|
3
|
-
const style = document.createElement('style');
|
|
4
|
-
style.appendChild(document.createTextNode(`[data-bspk=menu-button] {
|
|
5
|
-
background: none;
|
|
6
|
-
border: none;
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
padding: 0;
|
|
9
|
-
height: 48px;
|
|
10
|
-
width: auto;
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: row;
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
padding-top: var(--spacing-sizing-01);
|
|
16
|
-
color: var(--foreground-neutral-on-surface-variant-01);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
20
|
-
`));
|
|
21
|
-
document.head.appendChild(style);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MenuButton } from './MenuButton';
|
|
2
|
-
import { hasNoBasicA11yIssues } from '-/rtl/hasNoBasicA11yIssues';
|
|
3
|
-
import { render } from '-/rtl/util';
|
|
4
|
-
|
|
5
|
-
const TestBed = () => <MenuButton aria-label="Example label" />;
|
|
6
|
-
|
|
7
|
-
describe('MenuButton (RTL)', () => {
|
|
8
|
-
it('has no basic a11y issues', hasNoBasicA11yIssues(<TestBed />));
|
|
9
|
-
|
|
10
|
-
it('renders', () => {
|
|
11
|
-
const { getByLabelText } = render(<TestBed />);
|
|
12
|
-
|
|
13
|
-
expect(getByLabelText('Example label')).toBeInTheDocument();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import './menu-button.scss';
|
|
2
|
-
import { SvgMenu } from '@bspk/icons/Menu';
|
|
3
|
-
import { ButtonProps } from '-/components/Button';
|
|
4
|
-
import { ElementProps } from '-/types/common';
|
|
5
|
-
|
|
6
|
-
export type MenuButtonProps = Pick<ButtonProps, 'as' | 'onClick'>;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Utility component used within top navigation.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* import { MenuButton } from '@bspk/ui/MenuButton';
|
|
13
|
-
*
|
|
14
|
-
* function Example() {
|
|
15
|
-
* return <MenuButton />;
|
|
16
|
-
* }
|
|
17
|
-
*
|
|
18
|
-
* @name MenuButton
|
|
19
|
-
* @phase Utility
|
|
20
|
-
*/
|
|
21
|
-
export function MenuButton(props: ElementProps<MenuButtonProps, 'button'>) {
|
|
22
|
-
return (
|
|
23
|
-
<button data-bspk="menu-button" {...props}>
|
|
24
|
-
<SvgMenu />
|
|
25
|
-
</button>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './MenuButton';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
[data-bspk='menu-button'] {
|
|
2
|
-
background: none;
|
|
3
|
-
border: none;
|
|
4
|
-
cursor: pointer;
|
|
5
|
-
padding: 0;
|
|
6
|
-
height: 48px;
|
|
7
|
-
width: auto;
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: row;
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
padding-top: var(--spacing-sizing-01);
|
|
13
|
-
color: var(--foreground-neutral-on-surface-variant-01);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|