@salutejs/plasma-new-hope 0.76.3-canary.1180.8720362393.0 → 0.77.0-canary.1185.8719560164.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Avatar/Avatar.js +1 -35
- package/cjs/components/Avatar/Avatar.js.map +1 -1
- package/cjs/components/Combobox/Combobox.css +2 -2
- package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +2 -2
- package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +1 -1
- package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +2 -2
- package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +1 -1
- package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +2 -2
- package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +1 -1
- package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +2 -2
- package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +1 -1
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +2 -2
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +1 -1
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +1 -1
- package/cjs/components/Dropdown/Dropdown.css +2 -2
- package/cjs/components/Dropdown/Dropdown.js +27 -4
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles.js +1 -1
- package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
- package/cjs/components/Dropdown/{Dropdown.styles_1daxhqh.css → Dropdown.styles_13400l5.css} +1 -1
- package/cjs/components/Dropdown/Dropdown.tokens.js +1 -0
- package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +81 -0
- package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +5 -3
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/utils/index.js +43 -0
- package/cjs/components/Dropdown/utils/index.js.map +1 -1
- package/cjs/components/Pagination/Pagination.css +2 -2
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -2
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/cjs/components/Select/Select.css +2 -2
- package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +2 -2
- package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +1 -1
- package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +2 -2
- package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +1 -1
- package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +2 -2
- package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +1 -1
- package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +2 -2
- package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +1 -1
- package/cjs/components/Select/ui/SelectItem/SelectItem.css +2 -2
- package/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
- package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
- package/cjs/index.css +2 -2
- package/cjs/index.js +2 -0
- package/cjs/index.js.map +1 -1
- package/es/components/Avatar/Avatar.js +2 -36
- package/es/components/Avatar/Avatar.js.map +1 -1
- package/es/components/Combobox/Combobox.css +2 -2
- package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +2 -2
- package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +1 -1
- package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +2 -2
- package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +1 -1
- package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +2 -2
- package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +1 -1
- package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +2 -2
- package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +1 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +2 -2
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +1 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +1 -1
- package/es/components/Dropdown/Dropdown.css +2 -2
- package/es/components/Dropdown/Dropdown.js +29 -6
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles.js +1 -1
- package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
- package/es/components/Dropdown/{Dropdown.styles_1daxhqh.css → Dropdown.styles_13400l5.css} +1 -1
- package/es/components/Dropdown/Dropdown.tokens.js +1 -0
- package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/es/components/Dropdown/hooks/useKeyboardNavigation.js +76 -0
- package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +5 -3
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/utils/index.js +45 -3
- package/es/components/Dropdown/utils/index.js.map +1 -1
- package/es/components/Pagination/Pagination.css +2 -2
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -2
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/es/components/Select/Select.css +2 -2
- package/es/components/Select/ui/SelectDivider/SelectDivider.css +2 -2
- package/es/components/Select/ui/SelectDivider/SelectDivider.js +1 -1
- package/es/components/Select/ui/SelectFooter/SelectFooter.css +2 -2
- package/es/components/Select/ui/SelectFooter/SelectFooter.js +1 -1
- package/es/components/Select/ui/SelectGroup/SelectGroup.css +2 -2
- package/es/components/Select/ui/SelectGroup/SelectGroup.js +1 -1
- package/es/components/Select/ui/SelectHeader/SelectHeader.css +2 -2
- package/es/components/Select/ui/SelectHeader/SelectHeader.js +1 -1
- package/es/components/Select/ui/SelectItem/SelectItem.css +2 -2
- package/es/components/Select/ui/SelectItem/SelectItem.js +1 -1
- package/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
- package/es/index.css +2 -2
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Avatar/Avatar.js +1 -40
- package/styled-components/cjs/components/Avatar/Avatar.template-doc.mdx +2 -52
- package/styled-components/cjs/components/Dropdown/Dropdown.js +28 -6
- package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +1 -1
- package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +1 -0
- package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +83 -0
- package/styled-components/cjs/components/Dropdown/index.js +9 -1
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +5 -3
- package/styled-components/cjs/components/Dropdown/utils/index.js +48 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +1 -26
- package/styled-components/cjs/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +18 -36
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +27 -7
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +30 -11
- package/styled-components/cjs/examples/plasma_web/components/Avatar/Avatar.stories.tsx +1 -26
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +28 -9
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +31 -12
- package/styled-components/cjs/examples/sds_engineer/components/Avatar/Avatar.stories.tsx +1 -27
- package/styled-components/es/components/Avatar/Avatar.js +1 -41
- package/styled-components/es/components/Avatar/Avatar.template-doc.mdx +2 -52
- package/styled-components/es/components/Dropdown/Dropdown.js +29 -6
- package/styled-components/es/components/Dropdown/Dropdown.styles.js +1 -1
- package/styled-components/es/components/Dropdown/Dropdown.tokens.js +1 -0
- package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +77 -0
- package/styled-components/es/components/Dropdown/index.js +1 -0
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +5 -3
- package/styled-components/es/components/Dropdown/utils/index.js +48 -1
- package/styled-components/es/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +1 -26
- package/styled-components/es/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +18 -36
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +27 -7
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +30 -11
- package/styled-components/es/examples/plasma_web/components/Avatar/Avatar.stories.tsx +1 -26
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +28 -9
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +31 -12
- package/styled-components/es/examples/sds_engineer/components/Avatar/Avatar.stories.tsx +1 -27
- package/types/components/Avatar/Avatar.d.ts +1 -3
- package/types/components/Avatar/Avatar.d.ts.map +1 -1
- package/types/components/Avatar/Avatar.types.d.ts +0 -7
- package/types/components/Avatar/Avatar.types.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.tokens.d.ts +1 -0
- package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +7 -2
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +13 -0
- package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +1 -0
- package/types/components/Dropdown/index.d.ts +1 -0
- package/types/components/Dropdown/index.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/utils/index.d.ts +5 -2
- package/types/components/Dropdown/utils/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Avatar/Avatar.d.ts +0 -2
- package/types/examples/plasma_b2c/components/Avatar/Avatar.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Avatar/Avatar.d.ts +0 -2
- package/types/examples/plasma_web/components/Avatar/Avatar.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Avatar/Avatar.d.ts +0 -1
- package/types/examples/sds_engineer/components/Avatar/Avatar.d.ts.map +1 -1
package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx
CHANGED
@@ -92,7 +92,7 @@ const DisclosureRightIcon = (props) => (
|
|
92
92
|
</StyledDisclosureRightIcon>
|
93
93
|
);
|
94
94
|
|
95
|
-
const
|
95
|
+
const StoryNormal = (args: StoryDropdownProps) => {
|
96
96
|
const [selected, setSelected] = useState('');
|
97
97
|
const [isOpen, setIsOpen] = useState(false);
|
98
98
|
const [isOpenDropdown2, setIsOpenDropdown2] = useState(false);
|
@@ -112,10 +112,10 @@ const StoryTight = (args: StoryDropdownProps) => {
|
|
112
112
|
}
|
113
113
|
};
|
114
114
|
|
115
|
-
const handleSelect = (value: string, text: string) => {
|
115
|
+
const handleSelect = (value: string, text: string, toggleIsOpen: React.Dispatch<React.SetStateAction<boolean>>) => {
|
116
116
|
setSelected(value);
|
117
117
|
onSelect(value, text);
|
118
|
-
|
118
|
+
toggleIsOpen(false);
|
119
119
|
};
|
120
120
|
|
121
121
|
return (
|
@@ -127,35 +127,51 @@ const StoryTight = (args: StoryDropdownProps) => {
|
|
127
127
|
onToggle={onMainToggle}
|
128
128
|
offset={[Number(skidding), Number(distance)]}
|
129
129
|
placement={placement}
|
130
|
+
role="listbox"
|
130
131
|
{...rest}
|
131
132
|
>
|
132
133
|
{getDropdownItems('item', 6).map((item) => (
|
133
134
|
<DropdownItem
|
134
135
|
key={item.value}
|
135
136
|
isSelected={Boolean(item.value === selected)}
|
136
|
-
onSelect={() => handleSelect(item.value, item.child)}
|
137
|
+
onSelect={() => handleSelect(item.value, item.child, setIsOpen)}
|
137
138
|
onClick={onClick}
|
138
139
|
value={item.value}
|
140
|
+
role="option"
|
139
141
|
>
|
140
142
|
{item.child}
|
141
143
|
</DropdownItem>
|
142
144
|
))}
|
143
145
|
<Dropdown
|
144
|
-
target={
|
146
|
+
target={
|
147
|
+
<DropdownItem
|
148
|
+
contentRight={DisclosureRightIcon}
|
149
|
+
role="option"
|
150
|
+
name="test"
|
151
|
+
text="Nested dropdown"
|
152
|
+
/>
|
153
|
+
}
|
145
154
|
onToggle={(is) => setIsOpenDropdown2(is)}
|
146
155
|
isOpen={isOpenDropdown2}
|
156
|
+
role="listbox"
|
147
157
|
offset={[0, 0]}
|
148
|
-
isNested
|
149
158
|
{...rest}
|
150
159
|
>
|
151
|
-
<DropdownItem
|
160
|
+
<DropdownItem
|
161
|
+
contentRight={StyledCheckbox}
|
162
|
+
role="option"
|
163
|
+
value="checked"
|
164
|
+
onChange={onChange}
|
165
|
+
text="Checkbox"
|
166
|
+
/>
|
152
167
|
{getDropdownItems('nested', 4).map((item) => (
|
153
168
|
<DropdownItem
|
154
169
|
key={item.value}
|
155
170
|
isSelected={Boolean(item.value === selected)}
|
156
|
-
onSelect={() => handleSelect(item.value, item.child)}
|
171
|
+
onSelect={() => handleSelect(item.value, item.child, setIsOpenDropdown2)}
|
157
172
|
onClick={onClick}
|
158
173
|
value={item.value}
|
174
|
+
role="option"
|
159
175
|
>
|
160
176
|
{item.child}
|
161
177
|
</DropdownItem>
|
@@ -166,6 +182,7 @@ const StoryTight = (args: StoryDropdownProps) => {
|
|
166
182
|
value="1"
|
167
183
|
onChange={onChange}
|
168
184
|
text="Radiobox 1"
|
185
|
+
role="option"
|
169
186
|
/>
|
170
187
|
<DropdownItem
|
171
188
|
contentLeft={StyledRadiobox}
|
@@ -173,14 +190,16 @@ const StoryTight = (args: StoryDropdownProps) => {
|
|
173
190
|
value="2"
|
174
191
|
onChange={onChange}
|
175
192
|
text="Radiobox 2"
|
193
|
+
role="option"
|
176
194
|
/>
|
177
195
|
</Dropdown>
|
178
196
|
|
179
197
|
<DropdownItem
|
180
198
|
isSelected={selected === 'disabled'}
|
181
|
-
onSelect={() => handleSelect('disabled', 'disabled')}
|
199
|
+
onSelect={() => handleSelect('disabled', 'disabled', setIsOpen)}
|
182
200
|
onClick={onClick}
|
183
201
|
value="disabled"
|
202
|
+
role="option"
|
184
203
|
disabled
|
185
204
|
>
|
186
205
|
disabled
|
@@ -190,6 +209,6 @@ const StoryTight = (args: StoryDropdownProps) => {
|
|
190
209
|
);
|
191
210
|
};
|
192
211
|
|
193
|
-
export const
|
194
|
-
render: (args) => <
|
212
|
+
export const Normal: StoryObj<StoryDropdownProps> = {
|
213
|
+
render: (args) => <StoryNormal {...args} />,
|
195
214
|
};
|
@@ -34,38 +34,13 @@ export const Default: Story = {
|
|
34
34
|
};
|
35
35
|
|
36
36
|
export const Accessibility: Story = {
|
37
|
-
args: {
|
38
|
-
role: 'button',
|
39
|
-
name: 'Геннадий Силуянович',
|
40
|
-
tabIndex: 0,
|
41
|
-
view: 'default',
|
42
|
-
size: 'xxl',
|
43
|
-
status: 'active',
|
44
|
-
focused: true,
|
45
|
-
},
|
46
|
-
};
|
47
|
-
|
48
|
-
export const AccessibilityWithURL: Story = {
|
49
37
|
args: {
|
50
38
|
role: 'button',
|
51
39
|
tabIndex: 0,
|
52
40
|
view: 'default',
|
53
41
|
size: 'xxl',
|
42
|
+
name: 'Иван Фадеев',
|
54
43
|
status: 'active',
|
55
44
|
focused: true,
|
56
|
-
name: 'Микула Селянинович',
|
57
|
-
url: 'https://avatars.githubusercontent.com/u/1813468?v=4',
|
58
|
-
},
|
59
|
-
};
|
60
|
-
|
61
|
-
export const AccessibilityWithCustomText: Story = {
|
62
|
-
args: {
|
63
|
-
role: 'button',
|
64
|
-
tabIndex: 0,
|
65
|
-
view: 'default',
|
66
|
-
size: 'xxl',
|
67
|
-
status: 'inactive',
|
68
|
-
focused: true,
|
69
|
-
customText: 'ФИО',
|
70
45
|
},
|
71
46
|
};
|
package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js
CHANGED
@@ -15,7 +15,7 @@ export var config = {
|
|
15
15
|
l: /*#__PURE__*/css(["", ";", ";", ":1.0625rem;", ":1rem;", ":1.0625rem;", ":1rem;", ":0.75rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], dropdownSizeCommon, dropdownItemSizeCommon, dropdownTokens.itemPaddingTop, dropdownTokens.itemPaddingRight, dropdownTokens.itemPaddingBottom, dropdownTokens.itemPaddingLeft, dropdownTokens.itemBorderRadius, dropdownTokens.itemFontFamily, dropdownTokens.itemFontSize, dropdownTokens.itemFontStyle, dropdownTokens.itemFontWeightBold, dropdownTokens.itemFontLetterSpacing, dropdownTokens.itemFontLineHeight)
|
16
16
|
},
|
17
17
|
view: {
|
18
|
-
"default": /*#__PURE__*/css(["", ":0.4;", ":var(--surface-solid-card);", ":var(--shadow-down-soft-s);", ":var(--plasma-colors-transparent);", ":var(--surface-transparent-secondary);", ":inherit;", ":inherit;", ":inherit;", ":inherit;", ":var(--text-primary);"], dropdownTokens.disabledOpacity, dropdownTokens.background, dropdownTokens.boxShadow, dropdownTokens.itemBackground, dropdownTokens.itemBackgroundHover, dropdownTokens.itemBackgroundSelected, dropdownTokens.itemColorSelected, dropdownTokens.itemBackgroundSelectedHover, dropdownTokens.itemColorSelectedHover, dropdownTokens.itemColor)
|
18
|
+
"default": /*#__PURE__*/css(["", ":0.4;", ":var(--surface-accent);", ":var(--surface-solid-card);", ":var(--shadow-down-soft-s);", ":var(--plasma-colors-transparent);", ":var(--surface-transparent-secondary);", ":inherit;", ":inherit;", ":inherit;", ":inherit;", ":var(--text-primary);"], dropdownTokens.disabledOpacity, dropdownTokens.focusColor, dropdownTokens.background, dropdownTokens.boxShadow, dropdownTokens.itemBackground, dropdownTokens.itemBackgroundHover, dropdownTokens.itemBackgroundSelected, dropdownTokens.itemColorSelected, dropdownTokens.itemBackgroundSelectedHover, dropdownTokens.itemColorSelectedHover, dropdownTokens.itemColor)
|
19
19
|
}
|
20
20
|
}
|
21
21
|
};
|
package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx
CHANGED
@@ -26,7 +26,7 @@ type StoryDropdownPropsCustom = {
|
|
26
26
|
type StoryDropdownProps = ComponentProps<typeof Dropdown> & StoryDropdownPropsCustom;
|
27
27
|
|
28
28
|
const meta: Meta<StoryDropdownProps> = {
|
29
|
-
title: '
|
29
|
+
title: 'plasma_b2c/Dropdown',
|
30
30
|
decorators: [WithTheme],
|
31
31
|
component: Dropdown,
|
32
32
|
argTypes: {
|
@@ -112,10 +112,10 @@ const StoryNormal = (args: StoryDropdownProps) => {
|
|
112
112
|
}
|
113
113
|
};
|
114
114
|
|
115
|
-
const handleSelect = (value: string, text: string) => {
|
115
|
+
const handleSelect = (value: string, text: string, toggleIsOpen: React.Dispatch<React.SetStateAction<boolean>>) => {
|
116
116
|
setSelected(value);
|
117
117
|
onSelect(value, text);
|
118
|
-
|
118
|
+
toggleIsOpen(false);
|
119
119
|
};
|
120
120
|
|
121
121
|
return (
|
@@ -127,35 +127,51 @@ const StoryNormal = (args: StoryDropdownProps) => {
|
|
127
127
|
onToggle={onMainToggle}
|
128
128
|
offset={[Number(skidding), Number(distance)]}
|
129
129
|
placement={placement}
|
130
|
+
role="listbox"
|
130
131
|
{...rest}
|
131
132
|
>
|
132
133
|
{getDropdownItems('item', 6).map((item) => (
|
133
134
|
<DropdownItem
|
134
135
|
key={item.value}
|
135
136
|
isSelected={Boolean(item.value === selected)}
|
136
|
-
onSelect={() => handleSelect(item.value, item.child)}
|
137
|
+
onSelect={() => handleSelect(item.value, item.child, setIsOpen)}
|
137
138
|
onClick={onClick}
|
138
139
|
value={item.value}
|
140
|
+
role="option"
|
139
141
|
>
|
140
142
|
{item.child}
|
141
143
|
</DropdownItem>
|
142
144
|
))}
|
143
145
|
<Dropdown
|
144
|
-
target={
|
146
|
+
target={
|
147
|
+
<DropdownItem
|
148
|
+
contentRight={DisclosureRightIcon}
|
149
|
+
role="option"
|
150
|
+
name="test"
|
151
|
+
text="Nested dropdown"
|
152
|
+
/>
|
153
|
+
}
|
145
154
|
onToggle={(is) => setIsOpenDropdown2(is)}
|
146
155
|
isOpen={isOpenDropdown2}
|
156
|
+
role="listbox"
|
147
157
|
offset={[0, 0]}
|
148
|
-
isNested
|
149
158
|
{...rest}
|
150
159
|
>
|
151
|
-
<DropdownItem
|
160
|
+
<DropdownItem
|
161
|
+
contentRight={StyledCheckbox}
|
162
|
+
role="option"
|
163
|
+
value="checked"
|
164
|
+
onChange={onChange}
|
165
|
+
text="Checkbox"
|
166
|
+
/>
|
152
167
|
{getDropdownItems('nested', 4).map((item) => (
|
153
168
|
<DropdownItem
|
154
169
|
key={item.value}
|
155
170
|
isSelected={Boolean(item.value === selected)}
|
156
|
-
onSelect={() => handleSelect(item.value, item.child)}
|
171
|
+
onSelect={() => handleSelect(item.value, item.child, setIsOpenDropdown2)}
|
157
172
|
onClick={onClick}
|
158
173
|
value={item.value}
|
174
|
+
role="option"
|
159
175
|
>
|
160
176
|
{item.child}
|
161
177
|
</DropdownItem>
|
@@ -166,6 +182,7 @@ const StoryNormal = (args: StoryDropdownProps) => {
|
|
166
182
|
value="1"
|
167
183
|
onChange={onChange}
|
168
184
|
text="Radiobox 1"
|
185
|
+
role="option"
|
169
186
|
/>
|
170
187
|
<DropdownItem
|
171
188
|
contentLeft={StyledRadiobox}
|
@@ -173,14 +190,16 @@ const StoryNormal = (args: StoryDropdownProps) => {
|
|
173
190
|
value="2"
|
174
191
|
onChange={onChange}
|
175
192
|
text="Radiobox 2"
|
193
|
+
role="option"
|
176
194
|
/>
|
177
195
|
</Dropdown>
|
178
196
|
|
179
197
|
<DropdownItem
|
180
198
|
isSelected={selected === 'disabled'}
|
181
|
-
onSelect={() => handleSelect('disabled', 'disabled')}
|
199
|
+
onSelect={() => handleSelect('disabled', 'disabled', setIsOpen)}
|
182
200
|
onClick={onClick}
|
183
201
|
value="disabled"
|
202
|
+
role="option"
|
184
203
|
disabled
|
185
204
|
>
|
186
205
|
disabled
|
package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js
CHANGED
@@ -15,7 +15,7 @@ export var config = {
|
|
15
15
|
l: /*#__PURE__*/css(["", ";", ";", ":0.8125rem;", ":1rem;", ":0.8125rem;", ":1rem;", ":0.75rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], dropdownSizeCommon, dropdownItemSizeCommon, dropdownTokens.itemPaddingTop, dropdownTokens.itemPaddingRight, dropdownTokens.itemPaddingBottom, dropdownTokens.itemPaddingLeft, dropdownTokens.itemBorderRadius, dropdownTokens.itemFontFamily, dropdownTokens.itemFontSize, dropdownTokens.itemFontStyle, dropdownTokens.itemFontWeightBold, dropdownTokens.itemFontLetterSpacing, dropdownTokens.itemFontLineHeight)
|
16
16
|
},
|
17
17
|
view: {
|
18
|
-
"default": /*#__PURE__*/css(["", ":0.4;", ":var(--surface-solid-card);", ":var(--shadow-down-soft-s);", ":var(--plasma-colors-transparent);", ":var(--surface-transparent-secondary);", ":inherit;", ":inherit;", ":inherit;", ":inherit;", ":var(--text-primary);"], dropdownTokens.disabledOpacity, dropdownTokens.background, dropdownTokens.boxShadow, dropdownTokens.itemBackground, dropdownTokens.itemBackgroundHover, dropdownTokens.itemBackgroundSelected, dropdownTokens.itemColorSelected, dropdownTokens.itemBackgroundSelectedHover, dropdownTokens.itemColorSelectedHover, dropdownTokens.itemColor)
|
18
|
+
"default": /*#__PURE__*/css(["", ":0.4;", ":var(--surface-accent);", ":var(--surface-solid-card);", ":var(--shadow-down-soft-s);", ":var(--plasma-colors-transparent);", ":var(--surface-transparent-secondary);", ":inherit;", ":inherit;", ":inherit;", ":inherit;", ":var(--text-primary);"], dropdownTokens.disabledOpacity, dropdownTokens.focusColor, dropdownTokens.background, dropdownTokens.boxShadow, dropdownTokens.itemBackground, dropdownTokens.itemBackgroundHover, dropdownTokens.itemBackgroundSelected, dropdownTokens.itemColorSelected, dropdownTokens.itemBackgroundSelectedHover, dropdownTokens.itemColorSelectedHover, dropdownTokens.itemColor)
|
19
19
|
}
|
20
20
|
}
|
21
21
|
};
|
package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx
CHANGED
@@ -26,7 +26,7 @@ type StoryDropdownPropsCustom = {
|
|
26
26
|
type StoryDropdownProps = ComponentProps<typeof Dropdown> & StoryDropdownPropsCustom;
|
27
27
|
|
28
28
|
const meta: Meta<StoryDropdownProps> = {
|
29
|
-
title: '
|
29
|
+
title: 'plasma_b2c/Dropdown',
|
30
30
|
decorators: [WithTheme],
|
31
31
|
component: Dropdown,
|
32
32
|
argTypes: {
|
@@ -92,7 +92,7 @@ const DisclosureRightIcon = (props) => (
|
|
92
92
|
</StyledDisclosureRightIcon>
|
93
93
|
);
|
94
94
|
|
95
|
-
const
|
95
|
+
const StoryNormal = (args: StoryDropdownProps) => {
|
96
96
|
const [selected, setSelected] = useState('');
|
97
97
|
const [isOpen, setIsOpen] = useState(false);
|
98
98
|
const [isOpenDropdown2, setIsOpenDropdown2] = useState(false);
|
@@ -112,10 +112,10 @@ const StoryTight = (args: StoryDropdownProps) => {
|
|
112
112
|
}
|
113
113
|
};
|
114
114
|
|
115
|
-
const handleSelect = (value: string, text: string) => {
|
115
|
+
const handleSelect = (value: string, text: string, toggleIsOpen: React.Dispatch<React.SetStateAction<boolean>>) => {
|
116
116
|
setSelected(value);
|
117
117
|
onSelect(value, text);
|
118
|
-
|
118
|
+
toggleIsOpen(false);
|
119
119
|
};
|
120
120
|
|
121
121
|
return (
|
@@ -127,35 +127,51 @@ const StoryTight = (args: StoryDropdownProps) => {
|
|
127
127
|
onToggle={onMainToggle}
|
128
128
|
offset={[Number(skidding), Number(distance)]}
|
129
129
|
placement={placement}
|
130
|
+
role="listbox"
|
130
131
|
{...rest}
|
131
132
|
>
|
132
133
|
{getDropdownItems('item', 6).map((item) => (
|
133
134
|
<DropdownItem
|
134
135
|
key={item.value}
|
135
136
|
isSelected={Boolean(item.value === selected)}
|
136
|
-
onSelect={() => handleSelect(item.value, item.child)}
|
137
|
+
onSelect={() => handleSelect(item.value, item.child, setIsOpen)}
|
137
138
|
onClick={onClick}
|
138
139
|
value={item.value}
|
140
|
+
role="option"
|
139
141
|
>
|
140
142
|
{item.child}
|
141
143
|
</DropdownItem>
|
142
144
|
))}
|
143
145
|
<Dropdown
|
144
|
-
target={
|
146
|
+
target={
|
147
|
+
<DropdownItem
|
148
|
+
contentRight={DisclosureRightIcon}
|
149
|
+
role="option"
|
150
|
+
name="test"
|
151
|
+
text="Nested dropdown"
|
152
|
+
/>
|
153
|
+
}
|
145
154
|
onToggle={(is) => setIsOpenDropdown2(is)}
|
146
155
|
isOpen={isOpenDropdown2}
|
156
|
+
role="listbox"
|
147
157
|
offset={[0, 0]}
|
148
|
-
isNested
|
149
158
|
{...rest}
|
150
159
|
>
|
151
|
-
<DropdownItem
|
160
|
+
<DropdownItem
|
161
|
+
contentRight={StyledCheckbox}
|
162
|
+
role="option"
|
163
|
+
value="checked"
|
164
|
+
onChange={onChange}
|
165
|
+
text="Checkbox"
|
166
|
+
/>
|
152
167
|
{getDropdownItems('nested', 4).map((item) => (
|
153
168
|
<DropdownItem
|
154
169
|
key={item.value}
|
155
170
|
isSelected={Boolean(item.value === selected)}
|
156
|
-
onSelect={() => handleSelect(item.value, item.child)}
|
171
|
+
onSelect={() => handleSelect(item.value, item.child, setIsOpenDropdown2)}
|
157
172
|
onClick={onClick}
|
158
173
|
value={item.value}
|
174
|
+
role="option"
|
159
175
|
>
|
160
176
|
{item.child}
|
161
177
|
</DropdownItem>
|
@@ -166,6 +182,7 @@ const StoryTight = (args: StoryDropdownProps) => {
|
|
166
182
|
value="1"
|
167
183
|
onChange={onChange}
|
168
184
|
text="Radiobox 1"
|
185
|
+
role="option"
|
169
186
|
/>
|
170
187
|
<DropdownItem
|
171
188
|
contentLeft={StyledRadiobox}
|
@@ -173,14 +190,16 @@ const StoryTight = (args: StoryDropdownProps) => {
|
|
173
190
|
value="2"
|
174
191
|
onChange={onChange}
|
175
192
|
text="Radiobox 2"
|
193
|
+
role="option"
|
176
194
|
/>
|
177
195
|
</Dropdown>
|
178
196
|
|
179
197
|
<DropdownItem
|
180
198
|
isSelected={selected === 'disabled'}
|
181
|
-
onSelect={() => handleSelect('disabled', 'disabled')}
|
199
|
+
onSelect={() => handleSelect('disabled', 'disabled', setIsOpen)}
|
182
200
|
onClick={onClick}
|
183
201
|
value="disabled"
|
202
|
+
role="option"
|
184
203
|
disabled
|
185
204
|
>
|
186
205
|
disabled
|
@@ -190,6 +209,6 @@ const StoryTight = (args: StoryDropdownProps) => {
|
|
190
209
|
);
|
191
210
|
};
|
192
211
|
|
193
|
-
export const
|
194
|
-
render: (args) => <
|
212
|
+
export const Normal: StoryObj<StoryDropdownProps> = {
|
213
|
+
render: (args) => <StoryNormal {...args} />,
|
195
214
|
};
|
@@ -30,36 +30,10 @@ export const Default: Story = {
|
|
30
30
|
export const Accessibility: Story = {
|
31
31
|
args: {
|
32
32
|
role: 'button',
|
33
|
-
name: 'Геннадий Силуянович',
|
34
33
|
tabIndex: 0,
|
35
34
|
view: 'default',
|
36
35
|
size: 'xxl',
|
37
|
-
|
38
|
-
focused: true,
|
39
|
-
},
|
40
|
-
};
|
41
|
-
|
42
|
-
export const AccessibilityWithURL: Story = {
|
43
|
-
args: {
|
44
|
-
role: 'button',
|
45
|
-
tabIndex: 0,
|
46
|
-
view: 'default',
|
47
|
-
size: 'xxl',
|
48
|
-
status: 'active',
|
49
|
-
focused: true,
|
50
|
-
name: 'Микула Селянинович',
|
51
|
-
url: 'https://avatars.githubusercontent.com/u/1813468?v=4',
|
52
|
-
},
|
53
|
-
};
|
54
|
-
|
55
|
-
export const AccessibilityWithCustomText: Story = {
|
56
|
-
args: {
|
57
|
-
role: 'button',
|
58
|
-
tabIndex: 0,
|
59
|
-
view: 'default',
|
60
|
-
size: 'xxl',
|
61
|
-
status: 'inactive',
|
36
|
+
name: 'Иван Фадеев',
|
62
37
|
focused: true,
|
63
|
-
customText: 'ФИО',
|
64
38
|
},
|
65
39
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { RootProps } from '../../engines';
|
3
|
-
import
|
3
|
+
import { AvatarProps } from './Avatar.types';
|
4
4
|
export declare const avatarRoot: (Root: RootProps<HTMLDivElement, AvatarProps>) => React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
5
5
|
size: "m" | "s" | "l" | "xxl" | "fit";
|
6
6
|
name?: string | undefined;
|
@@ -9,7 +9,6 @@ export declare const avatarRoot: (Root: RootProps<HTMLDivElement, AvatarProps>)
|
|
9
9
|
status?: "active" | "inactive" | undefined;
|
10
10
|
isScalable?: boolean | undefined;
|
11
11
|
focused?: boolean | undefined;
|
12
|
-
statusDict?: StatusDict | undefined;
|
13
12
|
} & React.RefAttributes<HTMLDivElement>>;
|
14
13
|
export declare const avatarConfig: {
|
15
14
|
name: string;
|
@@ -22,7 +21,6 @@ export declare const avatarConfig: {
|
|
22
21
|
status?: "active" | "inactive" | undefined;
|
23
22
|
isScalable?: boolean | undefined;
|
24
23
|
focused?: boolean | undefined;
|
25
|
-
statusDict?: StatusDict | undefined;
|
26
24
|
} & React.RefAttributes<HTMLDivElement>>;
|
27
25
|
base: import("@linaria/core").LinariaClassName;
|
28
26
|
variations: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAGjE,OAAO,EAAE,SAAS,EAA0B,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAGjE,OAAO,EAAE,SAAS,EAA0B,MAAM,eAAe,CAAC;AAMlE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAiC7C,eAAO,MAAM,UAAU,SAAU,UAAU,cAAc,EAAE,WAAW,CAAC;;;;;;;;wCA4BtE,CAAC;AAEF,eAAO,MAAM,YAAY;;;mBA9BQ,UAAU,cAAc,EAAE,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;CA8CtE,CAAC"}
|
@@ -7,14 +7,7 @@ declare type CustomAvatarProps = {
|
|
7
7
|
status?: 'active' | 'inactive';
|
8
8
|
isScalable?: boolean;
|
9
9
|
focused?: boolean;
|
10
|
-
/**
|
11
|
-
* Словарь для озвучивания значений свойства status [a11y]
|
12
|
-
* @default
|
13
|
-
* { active: 'Активен', inactive: 'Неактивен' }
|
14
|
-
*/
|
15
|
-
statusDict?: StatusDict;
|
16
10
|
};
|
17
|
-
export declare type StatusDict = Record<'active' | 'inactive', string>;
|
18
11
|
export declare type AvatarProps = HTMLAttributes<HTMLDivElement> & CustomAvatarProps;
|
19
12
|
export {};
|
20
13
|
//# sourceMappingURL=Avatar.types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Avatar.types.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,aAAK,iBAAiB,GAAG;IAErB,IAAI,EAAE,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC;IAEtC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAE/B,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,OAAO,CAAC,EAAE,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"Avatar.types.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,aAAK,iBAAiB,GAAG;IAErB,IAAI,EAAE,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC;IAEtC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAE/B,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,oBAAY,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG,iBAAiB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAO1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD;;GAEG;AACH,eAAO,MAAM,YAAY,SAAU,UAAU,cAAc,EAAE,aAAa,CAAC,iKAmFtE,CAAC;AAEN,eAAO,MAAM,cAAc;;;mBArFQ,UAAU,cAAc,EAAE,aAAa,CAAC;;;;;;;;;;;;;;CAsG1E,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO
|
1
|
+
{"version":3,"file":"Dropdown.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiHlB,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { HTMLAttributes, ReactNode, SyntheticEvent } from 'react';
|
1
|
+
import type { HTMLAttributes, MutableRefObject, ReactNode, RefObject, SyntheticEvent } from 'react';
|
2
2
|
export declare type DropdownPlacementBasic = 'top' | 'bottom' | 'right' | 'left';
|
3
3
|
export declare type DropdownPlacement = DropdownPlacementBasic | 'auto';
|
4
4
|
export declare type DropdownTrigger = 'hover' | 'click';
|
@@ -68,9 +68,14 @@ export declare type CustomDropdownProps = {
|
|
68
68
|
/**
|
69
69
|
* В каком контейнере позиционируется(по умолчанию document), можно также указать id элемента или ref для него.
|
70
70
|
*/
|
71
|
-
frame?: 'document' | string |
|
71
|
+
frame?: 'document' | string | RefObject<HTMLElement>;
|
72
72
|
size?: string;
|
73
73
|
view?: string;
|
74
74
|
};
|
75
75
|
export declare type DropdownProps = HTMLAttributes<HTMLDivElement> & CustomDropdownProps;
|
76
|
+
export interface UseKeyNavigationProps {
|
77
|
+
itemsRefs: MutableRefObject<Array<HTMLDivElement>>;
|
78
|
+
opened: boolean;
|
79
|
+
updateOpened?: (isOpen: boolean, event: Event | SyntheticEvent<Element, Event>) => void;
|
80
|
+
}
|
76
81
|
//# sourceMappingURL=Dropdown.types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"Dropdown.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEpG,oBAAY,sBAAsB,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AACzE,oBAAY,iBAAiB,GAAG,sBAAsB,GAAG,MAAM,CAAC;AAEhE,oBAAY,eAAe,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhD,oBAAY,mBAAmB,GAAG;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,iBAAiB,GAAG,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC9D;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,GAAG,KAAK,KAAK,IAAI,CAAC;IACpE;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,aAAa,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG,mBAAmB,CAAC;AAEjF,MAAM,WAAW,qBAAqB;IAClC,SAAS,EAAE,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;IACnD,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC;CAC3F"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
2
|
+
import type { UseKeyNavigationProps } from '../Dropdown.types';
|
3
|
+
export declare const Keys: {
|
4
|
+
Tab: string;
|
5
|
+
Enter: string;
|
6
|
+
Escape: string;
|
7
|
+
ArrowUp: string;
|
8
|
+
ArrowDown: string;
|
9
|
+
};
|
10
|
+
export declare const useKeyNavigation: ({ itemsRefs, opened, updateOpened }: UseKeyNavigationProps) => {
|
11
|
+
readonly onKeyDownTarget: (event: KeyboardEvent<HTMLDivElement>) => void;
|
12
|
+
};
|
13
|
+
//# sourceMappingURL=useKeyboardNavigation.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/hooks/useKeyboardNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAoC,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,eAAO,MAAM,IAAI;;;;;;CAMhB,CAAC;AAEF,eAAO,MAAM,gBAAgB,wCAAyC,qBAAqB;sCAc3E,cAAc,cAAc,CAAC;CAsD5C,CAAC"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
export { dropdownRoot, dropdownConfig } from './Dropdown';
|
2
2
|
export { classes as dropdownClasses, tokens as dropdownTokens } from './Dropdown.tokens';
|
3
|
+
export { useKeyNavigation as useDropdownKeyNavigation } from './hooks/useKeyboardNavigation';
|
3
4
|
export * from './ui';
|
4
5
|
export type { DropdownProps, DropdownPlacementBasic, DropdownPlacement, DropdownTrigger } from './Dropdown.types';
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACzF,cAAc,MAAM,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,cAAc,MAAM,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DropdownItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/ui/DropdownItem/DropdownItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAGhE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAQhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB,SAAU,UAAU,cAAc,EAAE,iBAAiB,CAAC;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"DropdownItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/ui/DropdownItem/DropdownItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAGhE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAQhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB,SAAU,UAAU,cAAc,EAAE,iBAAiB,CAAC;;;;;;;;;;;;;;;;wCA4G9E,CAAC;AAEN,eAAO,MAAM,kBAAkB;;;mBA9GQ,UAAU,cAAc,EAAE,iBAAiB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+HlF,CAAC"}
|
@@ -1,6 +1,9 @@
|
|
1
|
-
import React
|
2
|
-
import type {
|
1
|
+
import React from 'react';
|
2
|
+
import type { ElementType, ReactElement, ReactNode } from 'react';
|
3
|
+
import type { DropdownPlacement, DropdownPlacementBasic, DropdownProps } from '../Dropdown.types';
|
4
|
+
import { DropdownItemProps } from '../ui/DropdownItem/DropdownItem.type';
|
3
5
|
export declare const getPlacement: (placement: DropdownPlacement) => import("@popperjs/core").ComputedPlacement;
|
4
6
|
export declare const getPlacements: (placements?: DropdownPlacement | DropdownPlacementBasic[] | undefined) => import("@popperjs/core").ComputedPlacement | import("@popperjs/core").ComputedPlacement[] | undefined;
|
5
7
|
export declare const getValidComponent: (element: ElementType | ReactNode, props: object) => string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
8
|
+
export declare const getChildren: (children: ReactElement<DropdownProps | DropdownItemProps>[], externalProps: Record<string, any>) => React.ReactElement<DropdownProps | DropdownItemProps, string | React.JSXElementConstructor<any>>[];
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,eAAO,MAAM,YAAY,cAAe,iBAAiB,+CAExD,CAAC;AAEF,eAAO,MAAM,aAAa,kLAUzB,CAAC;AAMF,eAAO,MAAM,iBAAiB,YAAa,WAAW,GAAG,SAAS,SAAS,MAAM,qFAYhF,CAAC;AAEF,eAAO,MAAM,WAAW,aACV,aAAa,aAAa,GAAG,iBAAiB,CAAC,EAAE,iBAC5C,OAAO,MAAM,EAAE,GAAG,CAAC,uGAoDrC,CAAC"}
|
@@ -35,7 +35,6 @@ export declare const mergedConfig: import("../../../../engines").ComponentConfig
|
|
35
35
|
status?: "active" | "inactive" | undefined;
|
36
36
|
isScalable?: boolean | undefined;
|
37
37
|
focused?: boolean | undefined;
|
38
|
-
statusDict?: import("../../../../components/Avatar/Avatar.types").StatusDict | undefined;
|
39
38
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
40
39
|
export declare const Avatar: import("react").FunctionComponent<import("../../../../engines/types").PropsType<{
|
41
40
|
view: {
|
@@ -59,6 +58,5 @@ export declare const Avatar: import("react").FunctionComponent<import("../../../
|
|
59
58
|
status?: "active" | "inactive" | undefined;
|
60
59
|
isScalable?: boolean | undefined;
|
61
60
|
focused?: boolean | undefined;
|
62
|
-
statusDict?: import("../../../../components/Avatar/Avatar.types").StatusDict | undefined;
|
63
61
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
64
62
|
//# sourceMappingURL=Avatar.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_b2c/components/Avatar/Avatar.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,YAAY
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_b2c/components/Avatar/Avatar.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAAoC,CAAC;AAE9D,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;kDAA0B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.config.d.ts","sourceRoot":"","sources":["../../../../../../src/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"Dropdown.config.d.ts","sourceRoot":"","sources":["../../../../../../src/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;CA6FlB,CAAC"}
|