@bspk/ui 1.1.16 → 1.1.18
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/Avatar.d.ts +44 -10
- package/dist/Avatar.js +32 -13
- package/dist/Avatar.js.map +1 -1
- package/dist/AvatarGroup.d.ts +49 -0
- package/dist/AvatarGroup.js +18 -0
- package/dist/AvatarGroup.js.map +1 -0
- package/dist/Badge.js +1 -1
- package/dist/Button.d.ts +14 -4
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Checkbox.d.ts +15 -2
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxGroup.d.ts +6 -3
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/CheckboxOption.d.ts +8 -1
- package/dist/CheckboxOption.js.map +1 -1
- package/dist/Chip.d.ts +3 -1
- package/dist/Chip.js.map +1 -1
- package/dist/Dialog.d.ts +3 -3
- package/dist/Dialog.js.map +1 -1
- package/dist/Divider.js +1 -1
- package/dist/Dropdown.d.ts +26 -6
- package/dist/Dropdown.js +2 -2
- package/dist/Dropdown.js.map +1 -1
- package/dist/ListItem.js +1 -1
- package/dist/Menu.d.ts +27 -15
- package/dist/Menu.js +1 -1
- package/dist/Menu.js.map +1 -1
- package/dist/NumberInput.d.ts +5 -1
- package/dist/NumberInput.js +7 -5
- package/dist/NumberInput.js.map +1 -1
- package/dist/Portal.d.ts +5 -1
- package/dist/Portal.js.map +1 -1
- package/dist/ProgressBar.d.ts +4 -0
- package/dist/ProgressBar.js.map +1 -1
- package/dist/ProgressionStepper.d.ts +9 -2
- package/dist/ProgressionStepper.js +1 -1
- package/dist/ProgressionStepper.js.map +1 -1
- package/dist/ProgressionStepperBar.d.ts +6 -0
- package/dist/ProgressionStepperBar.js.map +1 -1
- package/dist/Radio.d.ts +16 -2
- package/dist/Radio.js +2 -2
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.d.ts +26 -3
- package/dist/RadioGroup.js +3 -3
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioOption.d.ts +9 -1
- package/dist/RadioOption.js.map +1 -1
- package/dist/SegmentedControl.d.ts +21 -2
- package/dist/SegmentedControl.js +1 -1
- package/dist/SegmentedControl.js.map +1 -1
- package/dist/Switch.d.ts +1 -1
- package/dist/SwitchGroup.d.ts +13 -6
- package/dist/SwitchGroup.js +1 -1
- package/dist/SwitchGroup.js.map +1 -1
- package/dist/TabGroup.d.ts +23 -5
- package/dist/TabGroup.js +1 -1
- package/dist/TabGroup.js.map +1 -1
- package/dist/Tag.d.ts +5 -2
- package/dist/Tag.js +1 -1
- package/dist/Tag.js.map +1 -1
- package/dist/TextInput.d.ts +15 -6
- package/dist/TextInput.js +11 -5
- package/dist/TextInput.js.map +1 -1
- package/dist/Textarea.d.ts +3 -3
- package/dist/avatar-group.css +1 -0
- package/dist/avatar.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/button.css +1 -1
- package/dist/demo/ExampleModalRender.d.ts +7 -0
- package/dist/demo/ExampleModalRender.js +16 -0
- package/dist/demo/ExampleModalRender.js.map +1 -0
- package/dist/demo/ExamplePlaceholder.d.ts +7 -0
- package/dist/demo/ExamplePlaceholder.js +13 -0
- package/dist/demo/ExamplePlaceholder.js.map +1 -0
- package/dist/demo/examples.d.ts +101 -0
- package/dist/demo/examples.js +472 -0
- package/dist/demo/examples.js.map +1 -0
- package/dist/divider.css +1 -1
- package/dist/hooks/useOptionIconsInvalid.d.ts +10 -1
- package/dist/hooks/useOptionIconsInvalid.js.map +1 -1
- package/dist/index.d.ts +4 -26
- package/dist/index.js.map +1 -1
- package/dist/list-item.css +1 -1
- package/dist/menu.css +1 -1
- package/dist/segmented-control.css +1 -1
- package/dist/tab-group.css +1 -1
- package/dist/tag.css +1 -1
- package/dist/text-input.css +1 -1
- package/dist/utils/children.js.map +1 -1
- package/meta-types.ts +2 -0
- package/meta.ts +76 -42
- package/package.json +1 -1
- package/src/Avatar.tsx +80 -27
- package/src/AvatarGroup.tsx +71 -0
- package/src/Button.tsx +14 -4
- package/src/Checkbox.tsx +25 -11
- package/src/CheckboxGroup.tsx +6 -3
- package/src/CheckboxOption.tsx +9 -2
- package/src/Chip.tsx +3 -1
- package/src/Dialog.tsx +3 -3
- package/src/Dropdown.tsx +30 -10
- package/src/Menu.tsx +30 -18
- package/src/NumberInput.tsx +15 -6
- package/src/Portal.tsx +5 -1
- package/src/ProgressBar.tsx +4 -0
- package/src/ProgressionStepper.tsx +9 -2
- package/src/ProgressionStepperBar.tsx +6 -0
- package/src/Radio.tsx +21 -4
- package/src/RadioGroup.tsx +34 -6
- package/src/RadioOption.tsx +11 -2
- package/src/SegmentedControl.tsx +21 -2
- package/src/Switch.tsx +1 -1
- package/src/SwitchGroup.tsx +19 -7
- package/src/TabGroup.tsx +23 -5
- package/src/Tag.tsx +5 -2
- package/src/TextInput.tsx +25 -15
- package/src/Textarea.tsx +3 -3
- package/src/avatar-group.scss +17 -0
- package/src/avatar.scss +5 -2
- package/src/badge.scss +1 -0
- package/src/button.scss +1 -0
- package/src/demo/ExampleModalRender.tsx +37 -0
- package/src/demo/ExamplePlaceholder.tsx +40 -0
- package/src/demo/examples.tsx +683 -0
- package/src/divider.scss +2 -0
- package/src/dropdown.scss +1 -0
- package/src/hooks/useOptionIconsInvalid.ts +10 -1
- package/src/index.ts +5 -32
- package/src/list-item.scss +5 -1
- package/src/menu.scss +1 -1
- package/src/segmented-control.scss +1 -0
- package/src/tab-group.scss +1 -0
- package/src/tag.scss +1 -0
- package/src/text-input.scss +13 -18
- package/src/utils/children.ts +1 -1
|
@@ -41,8 +41,17 @@ export type NavOption = {
|
|
|
41
41
|
disabled?: boolean;
|
|
42
42
|
/** The value of the option. If not provided, the label will be used as the value. */
|
|
43
43
|
value?: string;
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* The the icon to display before the label.
|
|
46
|
+
*
|
|
47
|
+
* @type BspkIcon
|
|
48
|
+
*/
|
|
45
49
|
icon?: React.ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* The icon to display before the label when the option is active.
|
|
52
|
+
*
|
|
53
|
+
* @type BspkIcon
|
|
54
|
+
*/
|
|
46
55
|
iconActive?: React.ReactNode;
|
|
47
56
|
};
|
|
48
57
|
|
package/src/index.ts
CHANGED
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* Components should be imported directly like "import { Txt } from @bspk/ui/Txt".
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { ComponentProps, JSXElementConstructor, ReactNode } from 'react';
|
|
8
8
|
|
|
9
9
|
export type AlertVariant = 'error' | 'informational' | 'success' | 'warning';
|
|
10
10
|
|
|
11
|
+
export type SetRef<T> = (instance: T | null) => void;
|
|
12
|
+
|
|
11
13
|
export type ElementProps<
|
|
12
14
|
P extends Record<string, unknown>,
|
|
13
15
|
E extends JSXElementConstructor<unknown> | keyof JSX.IntrinsicElements,
|
|
@@ -26,7 +28,6 @@ export type CallToActionButton = {
|
|
|
26
28
|
/**
|
|
27
29
|
* The callback function for the call to action button.
|
|
28
30
|
*
|
|
29
|
-
* @type () => void
|
|
30
31
|
* @required
|
|
31
32
|
*/
|
|
32
33
|
onClick: () => void;
|
|
@@ -34,28 +35,7 @@ export type CallToActionButton = {
|
|
|
34
35
|
size?: ButtonSize;
|
|
35
36
|
};
|
|
36
37
|
|
|
37
|
-
export type
|
|
38
|
-
InvalidPropsLibrary &
|
|
39
|
-
Required<CommonProps<'value'>> & {
|
|
40
|
-
/**
|
|
41
|
-
* Marks the control as checked.
|
|
42
|
-
*
|
|
43
|
-
* @default false
|
|
44
|
-
*/
|
|
45
|
-
checked?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* The function to call when the control is checked or unchecked.
|
|
48
|
-
*
|
|
49
|
-
* @type (checked, Event) => void
|
|
50
|
-
* @required
|
|
51
|
-
*/
|
|
52
|
-
onChange: (checked: boolean, event: ChangeEvent<T>) => void;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export type CommonProps<K extends keyof CommonPropsLibrary, T extends HTMLElement = HTMLElement> = Pick<
|
|
56
|
-
CommonPropsLibrary<T>,
|
|
57
|
-
K
|
|
58
|
-
>;
|
|
38
|
+
export type CommonProps<K extends keyof CommonPropsLibrary> = Pick<CommonPropsLibrary, K>;
|
|
59
39
|
|
|
60
40
|
/**
|
|
61
41
|
* The props that are common to input elements.
|
|
@@ -79,7 +59,7 @@ export type InvalidPropsLibrary = {
|
|
|
79
59
|
errorMessage?: string;
|
|
80
60
|
};
|
|
81
61
|
|
|
82
|
-
export type CommonPropsLibrary
|
|
62
|
+
export type CommonPropsLibrary = {
|
|
83
63
|
/** The id of the element. If not provided one will be generated. */
|
|
84
64
|
id?: string;
|
|
85
65
|
/**
|
|
@@ -136,13 +116,6 @@ export type CommonPropsLibrary<T extends HTMLElement = HTMLElement> = {
|
|
|
136
116
|
* @required
|
|
137
117
|
*/
|
|
138
118
|
'aria-label': string;
|
|
139
|
-
/**
|
|
140
|
-
* The function to call when the element is clicked.
|
|
141
|
-
*
|
|
142
|
-
* @param event - The mouse event.
|
|
143
|
-
* @returns Void
|
|
144
|
-
*/
|
|
145
|
-
onClick?: (event: ReactMouseEvent<T, MouseEvent>) => void;
|
|
146
119
|
};
|
|
147
120
|
|
|
148
121
|
export type Brand =
|
package/src/list-item.scss
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
/* &:has(+ [data-list-item]) {
|
|
47
|
+
/* &:has(+ [data-bspk="list-item"]) {
|
|
48
48
|
[data-inner] {
|
|
49
49
|
border-bottom: 1px solid var(--stroke-neutral-low);
|
|
50
50
|
}
|
|
@@ -74,6 +74,10 @@
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
[data-trailing]:has(input) {
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
77
81
|
[data-component='Img'] > img {
|
|
78
82
|
height: 36px;
|
|
79
83
|
width: 36px;
|
package/src/menu.scss
CHANGED
package/src/tab-group.scss
CHANGED
package/src/tag.scss
CHANGED
package/src/text-input.scss
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
border: solid 1px var(--border-color);
|
|
8
8
|
height: var(--field-height);
|
|
9
9
|
border-radius: var(--radius-small);
|
|
10
|
-
padding: 0 var(--field-padding);
|
|
10
|
+
padding: 0 0 0 var(--field-padding);
|
|
11
11
|
gap: var(--spacing-sizing-01);
|
|
12
12
|
width: 100%;
|
|
13
13
|
|
|
@@ -22,17 +22,13 @@
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
&:hover:not(:focus-within) {
|
|
25
|
-
background:
|
|
26
|
-
// multiple colors
|
|
27
|
-
|
|
25
|
+
background:
|
|
28
26
|
linear-gradient(var(--interactions-hover-opacity), var(--interactions-hover-opacity)),
|
|
29
27
|
linear-gradient(var(--surface-neutral-t1-base), var(--surface-neutral-t1-base));
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
&:active:not(:focus-within) {
|
|
33
|
-
background:
|
|
34
|
-
// multiple colors
|
|
35
|
-
|
|
31
|
+
background:
|
|
36
32
|
linear-gradient(var(--interactions-press-opacity), var(--interactions-press-opacity)),
|
|
37
33
|
linear-gradient(var(--surface-neutral-t1-base), var(--surface-neutral-t1-base));
|
|
38
34
|
}
|
|
@@ -40,9 +36,7 @@
|
|
|
40
36
|
&[data-readonly] {
|
|
41
37
|
--border-color: var(--stroke-neutral-disabled-light);
|
|
42
38
|
|
|
43
|
-
background:
|
|
44
|
-
// multiple colors
|
|
45
|
-
|
|
39
|
+
background:
|
|
46
40
|
linear-gradient(var(--interactions-disabled-opacity), var(--interactions-disabled-opacity)),
|
|
47
41
|
linear-gradient(var(--surface-neutral-t1-base), var(--surface-neutral-t1-base));
|
|
48
42
|
}
|
|
@@ -51,8 +45,6 @@
|
|
|
51
45
|
--border-color: var(--stroke-neutral-disabled-light);
|
|
52
46
|
|
|
53
47
|
background:
|
|
54
|
-
// multiple colors
|
|
55
|
-
|
|
56
48
|
linear-gradient(var(--interactions-disabled-opacity), var(--interactions-disabled-opacity)),
|
|
57
49
|
linear-gradient(var(--surface-neutral-t1-base), var(--surface-neutral-t1-base));
|
|
58
50
|
|
|
@@ -117,7 +109,7 @@
|
|
|
117
109
|
}
|
|
118
110
|
|
|
119
111
|
button[data-clear] {
|
|
120
|
-
display:
|
|
112
|
+
display: flex;
|
|
121
113
|
border: none;
|
|
122
114
|
background: none;
|
|
123
115
|
padding: 0;
|
|
@@ -132,16 +124,19 @@
|
|
|
132
124
|
}
|
|
133
125
|
}
|
|
134
126
|
|
|
135
|
-
&:focus-within
|
|
136
|
-
|
|
127
|
+
&:not(:focus-within),
|
|
128
|
+
&[data-empty],
|
|
129
|
+
&[data-readonly],
|
|
130
|
+
&[data-disabled] {
|
|
131
|
+
padding-right: var(--field-padding);
|
|
137
132
|
|
|
138
133
|
button[data-clear] {
|
|
139
|
-
display:
|
|
134
|
+
display: none;
|
|
140
135
|
}
|
|
141
136
|
}
|
|
142
137
|
|
|
143
|
-
&:
|
|
144
|
-
|
|
138
|
+
&:focus-within {
|
|
139
|
+
--border-color: var(--stroke-brand-primary);
|
|
145
140
|
}
|
|
146
141
|
}
|
|
147
142
|
|
package/src/utils/children.ts
CHANGED