@scality/core-ui 0.116.0 → 0.117.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.js +32 -18
- package/README.md +1 -1
- package/dist/components/buttonv2/Buttonv2.component.d.ts +1 -0
- package/dist/components/buttonv2/Buttonv2.component.d.ts.map +1 -1
- package/dist/components/buttonv2/Buttonv2.component.js +9 -8
- package/dist/components/card/Card.component.d.ts.map +1 -1
- package/dist/components/card/Card.component.js +11 -11
- package/dist/components/checkbox/Checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox/Checkbox.component.js +2 -2
- package/dist/components/dropdown/Dropdown.component.d.ts.map +1 -1
- package/dist/components/dropdown/Dropdown.component.js +41 -57
- package/dist/components/inlineinput/InlineInput.d.ts +17 -0
- package/dist/components/inlineinput/InlineInput.d.ts.map +1 -0
- package/dist/components/inlineinput/InlineInput.js +85 -0
- package/dist/components/inputv2/inputv2.d.ts +8 -0
- package/dist/components/inputv2/inputv2.d.ts.map +1 -1
- package/dist/components/modal/Modal.component.d.ts.map +1 -1
- package/dist/components/modal/Modal.component.js +18 -1
- package/dist/components/navbar/Navbar.component.d.ts +1 -0
- package/dist/components/navbar/Navbar.component.d.ts.map +1 -1
- package/dist/components/navbar/Navbar.component.js +23 -6
- package/dist/components/sidebar/Sidebar.component.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.component.js +18 -1
- package/dist/components/tablev2/MultiSelectableContent.d.ts.map +1 -1
- package/dist/components/tablev2/MultiSelectableContent.js +10 -1
- package/dist/components/tablev2/SingleSelectableContent.d.ts.map +1 -1
- package/dist/components/tablev2/SingleSelectableContent.js +20 -1
- package/dist/components/tablev2/Tablestyle.d.ts +1 -0
- package/dist/components/tablev2/Tablestyle.d.ts.map +1 -1
- package/dist/components/tablev2/Tablestyle.js +10 -1
- package/dist/components/text/Text.component.d.ts.map +1 -1
- package/dist/components/text/Text.component.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/spacing.js +1 -1
- package/package.json +5 -5
- package/src/lib/components/buttonv2/Buttonv2.component.tsx +11 -8
- package/src/lib/components/card/Card.component.tsx +11 -11
- package/src/lib/components/checkbox/Checkbox.component.tsx +2 -2
- package/src/lib/components/dropdown/Dropdown.component.tsx +65 -81
- package/src/lib/components/inlineinput/InlineInput.test.tsx +211 -0
- package/src/lib/components/inlineinput/InlineInput.tsx +179 -0
- package/src/lib/components/inputv2/inputv2.tsx +2 -2
- package/src/lib/components/modal/Modal.component.tsx +19 -1
- package/src/lib/components/navbar/Navbar.component.tsx +27 -19
- package/src/lib/components/sidebar/Sidebar.component.tsx +21 -0
- package/src/lib/components/tablev2/MultiSelectableContent.tsx +17 -1
- package/src/lib/components/tablev2/SingleSelectableContent.tsx +29 -1
- package/src/lib/components/tablev2/Tablestyle.tsx +15 -2
- package/src/lib/components/text/Text.component.tsx +2 -2
- package/src/lib/index.ts +1 -0
- package/src/lib/spacing.tsx +1 -1
- package/stories/InlineInput/InlineInput.stories.tsx +46 -0
- package/stories/navbar.stories.tsx +18 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { Fragment } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { Logo } from '../../icons/branding';
|
|
5
5
|
import { spacing } from '../../spacing';
|
|
6
6
|
import { fontSize, navbarHeight, navbarItemWidth } from '../../style/theme';
|
|
7
7
|
import { getThemePropSelector } from '../../utils';
|
|
8
|
-
import { Button } from '../button/Button.component';
|
|
9
8
|
import { Dropdown } from '../dropdown/Dropdown.component';
|
|
10
9
|
import { Icon } from '../icon/Icon.component';
|
|
10
|
+
import { Button, FocusVisibleStyle } from '../buttonv2/Buttonv2.component';
|
|
11
11
|
const NavbarContainer = styled.div `
|
|
12
12
|
height: ${navbarHeight};
|
|
13
13
|
display: flex;
|
|
@@ -19,8 +19,7 @@ const NavbarContainer = styled.div `
|
|
|
19
19
|
.sc-trigger-text {
|
|
20
20
|
color: ${getThemePropSelector('textPrimary')};
|
|
21
21
|
}
|
|
22
|
-
border-bottom: ${
|
|
23
|
-
${getThemePropSelector('backgroundLevel1')};
|
|
22
|
+
border-bottom: 0.5px solid ${(props) => props.theme.backgroundLevel3};
|
|
24
23
|
`};
|
|
25
24
|
`;
|
|
26
25
|
const NavbarMenu = styled.div `
|
|
@@ -56,6 +55,11 @@ const NavbarTabs = styled.div `
|
|
|
56
55
|
font-weight: bold;
|
|
57
56
|
border-bottom-color: ${selectedActive};
|
|
58
57
|
}
|
|
58
|
+
// :focus-visible is the keyboard-only version of :focus
|
|
59
|
+
&:focus-visible {
|
|
60
|
+
${FocusVisibleStyle}
|
|
61
|
+
color: ${props.theme.textPrimary};
|
|
62
|
+
}
|
|
59
63
|
`;
|
|
60
64
|
}};
|
|
61
65
|
}
|
|
@@ -76,6 +80,11 @@ const TabItem = styled.div `
|
|
|
76
80
|
border-top: ${spacing.r2} solid;
|
|
77
81
|
cursor: pointer;
|
|
78
82
|
}
|
|
83
|
+
// :focus-visible is the keyboard-only version of :focus
|
|
84
|
+
&:focus-visible {
|
|
85
|
+
${FocusVisibleStyle}
|
|
86
|
+
color: ${props.theme.textPrimary};
|
|
87
|
+
}
|
|
79
88
|
`;
|
|
80
89
|
}};
|
|
81
90
|
${(props) => props.selected &&
|
|
@@ -111,6 +120,11 @@ const NavbarMenuItem = styled.div `
|
|
|
111
120
|
&:hover {
|
|
112
121
|
background-color: ${getThemePropSelector('highlight')};
|
|
113
122
|
}
|
|
123
|
+
// :focus-visible is the keyboard-only version of :focus
|
|
124
|
+
&:focus-visible {
|
|
125
|
+
${FocusVisibleStyle}
|
|
126
|
+
color: ${(props) => props.theme.textPrimary};
|
|
127
|
+
}
|
|
114
128
|
width: ${navbarItemWidth};
|
|
115
129
|
}
|
|
116
130
|
`;
|
|
@@ -129,7 +143,7 @@ const getActionRenderer = ({ type, items = null, ...rest }, index) => {
|
|
|
129
143
|
return items ? (_jsx(Dropdown, { size: "larger", variant: "backgroundLevel1", items: items, caret: false, ...rest }, `navbar_right_action_${index}`)) : null;
|
|
130
144
|
}
|
|
131
145
|
else if (type === 'button') {
|
|
132
|
-
return
|
|
146
|
+
return _jsx(Button, { ...rest }, `navbar_right_action_${index}`);
|
|
133
147
|
}
|
|
134
148
|
else if (type === 'custom') {
|
|
135
149
|
return _jsx(rest.render, {}, `navbar_right_action_${index}`);
|
|
@@ -137,7 +151,10 @@ const getActionRenderer = ({ type, items = null, ...rest }, index) => {
|
|
|
137
151
|
return null;
|
|
138
152
|
};
|
|
139
153
|
function NavBar({ onToggleClick, logo, tabs = [], rightActions = [], ...rest }) {
|
|
140
|
-
return (_jsxs(NavbarContainer, { className: "sc-navbar", ...rest, children: [_jsxs(NavbarMenu, { children: [onToggleClick && (_jsx(NavbarMenuItem, { onClick: onToggleClick, children: _jsx(Button, {
|
|
154
|
+
return (_jsxs(NavbarContainer, { className: "sc-navbar", ...rest, children: [_jsxs(NavbarMenu, { children: [onToggleClick && (_jsx(NavbarMenuItem, { onClick: onToggleClick, children: _jsx(Button, { icon: _jsx(Icon, { name: "Lat-menu" }), title: "Main Menu" }) })), _jsx(NavbarMenuItem, { children: _jsx(LogoContainer, { className: "sc-logo", children: logo ? logo : _jsx(Logo, {}) }) })] }), tabs.length ? (_jsx(NavbarTabs, { children: tabs.map(({ link, title, selected, onClick, render }, index) => {
|
|
155
|
+
if (render) {
|
|
156
|
+
return (_jsx(Fragment, { children: render }, `navbar_tab_item_${index}`));
|
|
157
|
+
}
|
|
141
158
|
return link ? (React.cloneElement(link, {
|
|
142
159
|
className: selected ? 'selected' : '',
|
|
143
160
|
'aria-selected': selected,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/sidebar/Sidebar.component.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Sidebar.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/sidebar/Sidebar.component.tsx"],"names":[],"mappings":";AAcA,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACpB,CAAC;AACF,KAAK,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAsIF,iBAAS,OAAO,CAAC,EACf,QAAQ,EACR,OAAO,EACP,aAAa,EACb,SAAS,EACT,GAAG,IAAI,EACR,EAAE,KAAK,eAgEP;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { getThemePropSelector } from '../../utils';
|
|
|
6
6
|
import { Button } from '../button/Button.component';
|
|
7
7
|
import { Icon } from '../icon/Icon.component';
|
|
8
8
|
import { spacing } from '../../spacing';
|
|
9
|
+
import { FocusVisibleStyle } from '../buttonv2/Buttonv2.component';
|
|
9
10
|
const Wrapper = styled.div `
|
|
10
11
|
flex-shrink: 0;
|
|
11
12
|
${(props) => {
|
|
@@ -71,6 +72,9 @@ const SidebarContainer = styled.div `
|
|
|
71
72
|
&:hover {
|
|
72
73
|
background-color: ${getThemePropSelector('highlight')};
|
|
73
74
|
}
|
|
75
|
+
&:focus-visible {
|
|
76
|
+
${FocusVisibleStyle}
|
|
77
|
+
}
|
|
74
78
|
height: ${sidebarItemHeight};
|
|
75
79
|
width: ${sidebarWidth};
|
|
76
80
|
padding: 0px;
|
|
@@ -93,12 +97,18 @@ const SidebarItem = styled.div `
|
|
|
93
97
|
background-color: ${highlight};
|
|
94
98
|
color: ${textPrimary};
|
|
95
99
|
cursor: default;
|
|
100
|
+
&:focus-visible {
|
|
101
|
+
${FocusVisibleStyle}
|
|
102
|
+
}
|
|
96
103
|
`
|
|
97
104
|
: css `
|
|
98
105
|
&:hover {
|
|
99
106
|
background-color: ${highlight};
|
|
100
107
|
color: ${textPrimary};
|
|
101
108
|
}
|
|
109
|
+
&:focus-visible {
|
|
110
|
+
${FocusVisibleStyle}
|
|
111
|
+
}
|
|
102
112
|
&:active {
|
|
103
113
|
background-color: ${highlight};
|
|
104
114
|
color: ${textPrimary};
|
|
@@ -130,7 +140,14 @@ function Sidebar({ expanded, actions, onToggleClick, hoverable, ...rest }) {
|
|
|
130
140
|
setHovered(false);
|
|
131
141
|
onToggleClick();
|
|
132
142
|
} }) })), actions.map(({ active, label, onClick, icon = null, ...actionRest }, index) => {
|
|
133
|
-
return (_jsxs(SidebarItem, { className: "sc-sidebar-item", active: active, title: label, onClick: onClick,
|
|
143
|
+
return (_jsxs(SidebarItem, { className: "sc-sidebar-item", active: active, title: label, onClick: onClick, onKeyDown: (event) => {
|
|
144
|
+
if (event.key === ' ' ||
|
|
145
|
+
event.key === 'Enter' ||
|
|
146
|
+
event.key === 'Spacebar') {
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
onClick(event);
|
|
149
|
+
}
|
|
150
|
+
}, tabIndex: 0, ...actionRest, children: [!!icon && _jsx(MenuItemIcon, { children: icon }), (expanded || (hoverable && hovered)) && (_jsx(MenuItemText, { children: label })), active && _jsx(MenuItemSelected, {})] }, index));
|
|
134
151
|
})] }) }));
|
|
135
152
|
}
|
|
136
153
|
export { Sidebar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelectableContent.d.ts","sourceRoot":"","sources":["../../../src/lib/components/tablev2/MultiSelectableContent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAWlC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAqBtB,KAAK,2BAA2B,CAC9B,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAChE;IACF,uBAAuB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;IAC1D,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IACnD,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,qBAAqB,CAAC,EAAE,gBAAgB,CAAC;IACzC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACrC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;IAC1D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC;CAC/C,CAAC;AAEF;;GAEG;AAcH,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"MultiSelectableContent.d.ts","sourceRoot":"","sources":["../../../src/lib/components/tablev2/MultiSelectableContent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAWlC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAqBtB,KAAK,2BAA2B,CAC9B,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAChE;IACF,uBAAuB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;IAC1D,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IACnD,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,qBAAqB,CAAC,EAAE,gBAAgB,CAAC;IACzC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACrC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;IAC1D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC;CAC/C,CAAC;AAEF;;GAEG;AAcH,eAAO,MAAM,sBAAsB,sSAwQlC,CAAC"}
|
|
@@ -111,7 +111,16 @@ export const MultiSelectableContent = ({ onMultiSelectionChanged, onSingleRowSel
|
|
|
111
111
|
const headerStyleProps = column.getHeaderProps(Object.assign(column.getSortByToggleProps(), {
|
|
112
112
|
style: { ...column === null || column === void 0 ? void 0 : column.cellStyle, position: 'relative' },
|
|
113
113
|
}));
|
|
114
|
-
return (_jsx(TableHeader, { ...headerStyleProps, role: "columnheader",
|
|
114
|
+
return (_jsx(TableHeader, { ...headerStyleProps, role: "columnheader", tabIndex: !column.disableSortBy ? 0 : undefined, onKeyDown: (event) => {
|
|
115
|
+
if (!column.disableSortBy &&
|
|
116
|
+
(event.key === ' ' ||
|
|
117
|
+
event.key === 'Enter' ||
|
|
118
|
+
event.key === 'Spacebar')) {
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
// @ts-expect-error - getSortByToggleProps is joined to getHeaderProps
|
|
121
|
+
headerStyleProps.onClick(event);
|
|
122
|
+
}
|
|
123
|
+
}, children: _jsxs("div", { children: [column.id === 'selection' ? (_jsx("div", { onClick: (event) => {
|
|
115
124
|
const eventTarget = event.target;
|
|
116
125
|
if (onToggleAll) {
|
|
117
126
|
onToggleAll(eventTarget.checked);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleSelectableContent.d.ts","sourceRoot":"","sources":["../../../src/lib/components/tablev2/SingleSelectableContent.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAUlC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAOtB,MAAM,MAAM,4BAA4B,CACtC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAChE;IACF,SAAS,EAAE,kBAAkB,CAAC;IAC9B,qBAAqB,EAAE,gBAAgB,CAAC;IACxC,iBAAiB,EAAE,gBAAgB,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;IAC1D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC;CAC/C,CAAC;AAgBF,wBAAgB,uBAAuB,CACrC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,EACA,SAAiB,EACjB,qBAA0C,EAC1C,iBAAsC,EACtC,MAAa,EACb,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,QAAQ,GACT,EAAE,4BAA4B,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"SingleSelectableContent.d.ts","sourceRoot":"","sources":["../../../src/lib/components/tablev2/SingleSelectableContent.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAUlC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAOtB,MAAM,MAAM,4BAA4B,CACtC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAChE;IACF,SAAS,EAAE,kBAAkB,CAAC;IAC9B,qBAAqB,EAAE,gBAAgB,CAAC;IACxC,iBAAiB,EAAE,gBAAgB,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;IAC1D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC;CAC/C,CAAC;AAgBF,wBAAgB,uBAAuB,CACrC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,EACA,SAAiB,EACjB,qBAA0C,EAC1C,iBAAsC,EACtC,MAAa,EACb,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,QAAQ,GACT,EAAE,4BAA4B,CAAC,QAAQ,CAAC,eAyLxC"}
|
|
@@ -43,6 +43,16 @@ export function SingleSelectableContent({ rowHeight = 'h40', separationLineVaria
|
|
|
43
43
|
if (onRowSelected)
|
|
44
44
|
return onRowSelected(row);
|
|
45
45
|
},
|
|
46
|
+
tabIndex: onRowSelected ? 0 : undefined,
|
|
47
|
+
onKeyDown: (event) => {
|
|
48
|
+
if (onRowSelected &&
|
|
49
|
+
(event.key === ' ' ||
|
|
50
|
+
event.key === 'Enter' ||
|
|
51
|
+
event.key === 'Spacebar')) {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
onRowSelected(row);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
46
56
|
},
|
|
47
57
|
};
|
|
48
58
|
return (_jsx(TableRow, { ...rowProps, isSelected: selectedId === row.id, "aria-selected": selectedId === row.id ? 'true' : 'false', separationLineVariant: separationLineVariant, backgroundVariant: backgroundVariant, selectedId: selectedId, className: "tr", children: row.cells.map((cell) => {
|
|
@@ -70,6 +80,15 @@ export function SingleSelectableContent({ rowHeight = 'h40', separationLineVaria
|
|
|
70
80
|
const headerStyleProps = column.getHeaderProps(Object.assign(column.getSortByToggleProps(), {
|
|
71
81
|
style: { ...column.cellStyle, position: 'relative' },
|
|
72
82
|
}));
|
|
73
|
-
return (_jsx(TableHeader, { ...headerStyleProps, role: "columnheader",
|
|
83
|
+
return (_jsx(TableHeader, { ...headerStyleProps, role: "columnheader", tabIndex: !column.disableSortBy ? 0 : undefined, onKeyDown: (event) => {
|
|
84
|
+
if (!column.disableSortBy &&
|
|
85
|
+
(event.key === ' ' ||
|
|
86
|
+
event.key === 'Enter' ||
|
|
87
|
+
event.key === 'Spacebar')) {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
// @ts-expect-error - getSortByToggleProps is joined to getHeaderProps
|
|
90
|
+
headerStyleProps.onClick(event);
|
|
91
|
+
}
|
|
92
|
+
}, children: _jsxs("div", { children: [column.render('Header'), _jsx(SortCaret, { column: column })] }) }));
|
|
74
93
|
}) }))) }), _jsx(TableBody, { role: "rowgroup", className: "tbody", ref: handleScrollbarWidth, children: typeof children === 'function' ? (children(_jsx(VirtualizedRows, { rows: rows, listRef: bodyRef, itemKey: itemKey, rowHeight: rowHeight, setHasScrollbar: setHasScrollbar, onBottom: onBottom, onBottomOffset: onBottomOffset, RenderRow: RenderRow }))) : rows.length ? (_jsx(VirtualizedRows, { rows: rows, listRef: bodyRef, itemKey: itemKey, rowHeight: rowHeight, setHasScrollbar: setHasScrollbar, onBottom: onBottom, onBottomOffset: onBottomOffset, RenderRow: RenderRow })) : (_jsx(NoResult, { children: translations[locale].noResult })) }), isLoadingMoreItems && (_jsx(Box, { display: "flex", justifyContent: "center", marginTop: spacing.r16, marginBottom: spacing.r16, children: _jsx(Loader, { size: "large" }) }))] }));
|
|
75
94
|
}
|
|
@@ -5,6 +5,7 @@ export declare const SortIncentive: import("styled-components").StyledComponent<
|
|
|
5
5
|
export declare const SortCaretWrapper: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
6
6
|
export declare const TableHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
7
7
|
headerHeight?: string | number | undefined;
|
|
8
|
+
tabIndex: number | undefined;
|
|
8
9
|
}, never>;
|
|
9
10
|
type HeadRowType = {
|
|
10
11
|
hasScrollBar: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tablestyle.d.ts","sourceRoot":"","sources":["../../../src/lib/components/tablev2/Tablestyle.tsx"],"names":[],"mappings":";AAGA,OAAO,EACL,kBAAkB,EAElB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Tablestyle.d.ts","sourceRoot":"","sources":["../../../src/lib/components/tablev2/Tablestyle.tsx"],"names":[],"mappings":";AAGA,OAAO,EACL,kBAAkB,EAElB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,eAAO,MAAM,aAAa,0GAGzB,CAAC;AACF,eAAO,MAAM,gBAAgB,0GAG5B,CAAC;AACF,eAAO,MAAM,WAAW;;cAEZ,MAAM,GAAG,SAAS;SAkB7B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,OAAO,kHAanB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,gBAAgB,CAAC;IACxC,iBAAiB,EAAE,gBAAgB,CAAC;CACrC,CAAC;AACF,eAAO,MAAM,QAAQ,mHAwCpB,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,qBAAqB,EAAE,gBAAgB,CAAC;IACxC,iBAAiB,EAAE,gBAAgB,CAAC;CACrC,CAAC;AACF,eAAO,MAAM,uBAAuB,kIA8BnC,CAAC;AAEF,eAAO,MAAM,SAAS,yGAIrB,CAAC;AACF,eAAO,MAAM,YAAY,yGAKxB,CAAC;AACF,eAAO,MAAM,cAAc,yGAI1B,CAAC;AAEF,eAAO,MAAM,QAAQ,yGAMpB,CAAC;AAEF,eAAO,MAAM,SAAS;;wBAsBrB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
import { spacing } from '../../style/theme';
|
|
4
4
|
import { tableRowHeight, } from './TableUtils';
|
|
5
5
|
import { Icon } from '../icon/Icon.component';
|
|
6
|
+
import { FocusVisibleStyle } from '../buttonv2/Buttonv2.component';
|
|
6
7
|
const borderSize = '4px';
|
|
7
8
|
export const SortIncentive = styled.span `
|
|
8
9
|
position: absolute;
|
|
@@ -17,11 +18,17 @@ export const TableHeader = styled.div `
|
|
|
17
18
|
flex-direction: column;
|
|
18
19
|
justify-content: center;
|
|
19
20
|
height: ${(props) => props.headerHeight};
|
|
21
|
+
cursor: ${(props) => props.tabIndex !== undefined && props.tabIndex >= 0
|
|
22
|
+
? 'pointer'
|
|
23
|
+
: 'default'};
|
|
20
24
|
&:hover {
|
|
21
25
|
${SortIncentive} {
|
|
22
26
|
display: block;
|
|
23
27
|
}
|
|
24
28
|
}
|
|
29
|
+
&:focus-visible {
|
|
30
|
+
${FocusVisibleStyle}
|
|
31
|
+
}
|
|
25
32
|
`;
|
|
26
33
|
export const HeadRow = styled.div `
|
|
27
34
|
display: flex;
|
|
@@ -32,7 +39,6 @@ export const HeadRow = styled.div `
|
|
|
32
39
|
: `calc(100% - ${borderSize} ) !important;`}
|
|
33
40
|
height: ${(props) => tableRowHeight[props.rowHeight]}rem;
|
|
34
41
|
table-layout: fixed;
|
|
35
|
-
cursor: pointer;
|
|
36
42
|
color: ${(props) => props.theme.textPrimary};
|
|
37
43
|
font-weight: bold;
|
|
38
44
|
overflow: hidden;
|
|
@@ -57,6 +63,9 @@ export const TableRow = styled.div `
|
|
|
57
63
|
outline: none;
|
|
58
64
|
cursor: pointer;
|
|
59
65
|
}
|
|
66
|
+
&:focus-visible {
|
|
67
|
+
${FocusVisibleStyle}
|
|
68
|
+
}
|
|
60
69
|
`;
|
|
61
70
|
}
|
|
62
71
|
}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/text/Text.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Text.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/text/Text.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,KAAK,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAC7D,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAsDF,eAAO,MAAM,uBAAuB;iBACrB,MAAM;SAIpB,CAAC;AAIF,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAErD;AACD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAEzD;AACD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAEtD;AACD,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAEvD;AACD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAO9D;AACD,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAErD;AACD,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAEvD;AACD,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAIhE;AACD,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAOtE;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAE1D;AACD,eAAO,MAAM,0BAA0B;;SAWtC,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;SA+ChB,CAAC;AAEF,eAAO,MAAM,IAAI,uGAchB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { spacing } from '../../spacing';
|
|
4
|
+
import { FocusVisibleStyle } from '../buttonv2/Buttonv2.component';
|
|
4
5
|
const BasicTextStyle = styled.span `
|
|
5
6
|
color: ${(props) => props.theme.textPrimary};
|
|
6
7
|
font-size: 1rem;
|
|
@@ -148,7 +149,6 @@ export const Link = styled.a `
|
|
|
148
149
|
}
|
|
149
150
|
// :focus-visible is the keyboard-only version of :focus
|
|
150
151
|
&:focus-visible {
|
|
151
|
-
|
|
152
|
-
outline-offset: ${spacing.r2};
|
|
152
|
+
${FocusVisibleStyle}
|
|
153
153
|
}
|
|
154
154
|
`;
|
package/dist/index.d.ts
CHANGED
|
@@ -62,4 +62,5 @@ export { useMutationsHandler } from './components/toast/useMutationsHandler';
|
|
|
62
62
|
export { Stepper } from './components/steppers/Stepper.component';
|
|
63
63
|
export { InfoMessage } from './components/infomessage/InfoMessage.component';
|
|
64
64
|
export { InputList } from './components/inputlist/InputList.component';
|
|
65
|
+
export { InlineInput } from './components/inlineinput/InlineInput';
|
|
65
66
|
//# sourceMappingURL=index.d.ts.map
|
package/d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IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -62,3 +62,4 @@ export { useMutationsHandler } from './components/toast/useMutationsHandler';
|
|
|
62
62
|
export { Stepper } from './components/steppers/Stepper.component';
|
|
63
63
|
export { InfoMessage } from './components/infomessage/InfoMessage.component';
|
|
64
64
|
export { InputList } from './components/inputlist/InputList.component';
|
|
65
|
+
export { InlineInput } from './components/inlineinput/InlineInput';
|
package/dist/spacing.js
CHANGED
|
@@ -35,7 +35,7 @@ export const spacing = {
|
|
|
35
35
|
const HSeparator = styled.div `
|
|
36
36
|
min-height: ${spacing.r40};
|
|
37
37
|
min-width: ${spacing.r2};
|
|
38
|
-
background: ${(props) => props.theme.
|
|
38
|
+
background: ${(props) => props.theme.border};
|
|
39
39
|
`;
|
|
40
40
|
const VSeparator = styled.div `
|
|
41
41
|
height: 1px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scality/core-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.0",
|
|
4
4
|
"description": "Scality common React component library",
|
|
5
5
|
"author": "Scality Engineering",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@testing-library/jest-dom": "^5.14.1",
|
|
49
49
|
"@testing-library/react": "^11.2.7",
|
|
50
50
|
"@testing-library/react-hooks": "^8.0.1",
|
|
51
|
-
"@testing-library/user-event": "^13.
|
|
51
|
+
"@testing-library/user-event": "^13.5.0",
|
|
52
52
|
"@types/jest": "^27.5.0",
|
|
53
53
|
"@types/react": "^17.0.39",
|
|
54
54
|
"@types/react-dom": "^17.0.11",
|
|
@@ -95,21 +95,21 @@
|
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"@floating-ui/dom": "^0.1.10",
|
|
98
|
-
"@storybook/preview-api": "^7.6.6",
|
|
99
|
-
"framer-motion": "^4.1.17",
|
|
100
|
-
"react-hook-form": "^7.49.2",
|
|
101
98
|
"@fortawesome/fontawesome-free": "^5.10.2",
|
|
102
99
|
"@fortawesome/fontawesome-svg-core": "^1.2.35",
|
|
103
100
|
"@fortawesome/free-regular-svg-icons": "^5.15.3",
|
|
104
101
|
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
|
105
102
|
"@fortawesome/react-fontawesome": "^0.1.14",
|
|
106
103
|
"@js-temporal/polyfill": "^0.4.4",
|
|
104
|
+
"@storybook/preview-api": "^7.6.6",
|
|
105
|
+
"framer-motion": "^4.1.17",
|
|
107
106
|
"polished": "3.4.1",
|
|
108
107
|
"pretty-bytes": "^5.6.0",
|
|
109
108
|
"react": "^17.0.2",
|
|
110
109
|
"react-debounce-input": "3.2.2",
|
|
111
110
|
"react-dom": "^17.0.2",
|
|
112
111
|
"react-dropzone": "^14.2.3",
|
|
112
|
+
"react-hook-form": "^7.49.2",
|
|
113
113
|
"react-query": "^3.34.0",
|
|
114
114
|
"react-router": "^5.2.0",
|
|
115
115
|
"react-router-dom": "^5.2.0",
|
|
@@ -4,6 +4,13 @@ import { spacing } from '../../spacing';
|
|
|
4
4
|
import { fontSize, fontWeight } from '../../style/theme';
|
|
5
5
|
import { Loader } from '../loader/Loader.component';
|
|
6
6
|
import { Tooltip, Props as TooltipProps } from '../tooltip/Tooltip.component';
|
|
7
|
+
|
|
8
|
+
export const FocusVisibleStyle = css`
|
|
9
|
+
outline: dashed ${spacing.r2} ${(props) => props.theme.selectedActive};
|
|
10
|
+
outline-offset: ${spacing.r2};
|
|
11
|
+
z-index: 1000;
|
|
12
|
+
`;
|
|
13
|
+
|
|
7
14
|
export type Props = Omit<
|
|
8
15
|
ButtonHTMLAttributes<HTMLButtonElement>,
|
|
9
16
|
'size' | 'label'
|
|
@@ -54,8 +61,7 @@ export const ButtonStyled = styled.button<Props>`
|
|
|
54
61
|
}
|
|
55
62
|
// :focus-visible is the keyboard-only version of :focus
|
|
56
63
|
&:focus-visible:enabled {
|
|
57
|
-
|
|
58
|
-
outline-offset: ${spacing.r2};
|
|
64
|
+
${FocusVisibleStyle}
|
|
59
65
|
color: ${brand.textPrimary};
|
|
60
66
|
}
|
|
61
67
|
&:active:enabled {
|
|
@@ -76,8 +82,7 @@ export const ButtonStyled = styled.button<Props>`
|
|
|
76
82
|
color: ${brand.textPrimary};
|
|
77
83
|
}
|
|
78
84
|
&:focus-visible:enabled {
|
|
79
|
-
|
|
80
|
-
outline-offset: ${spacing.r2};
|
|
85
|
+
${FocusVisibleStyle}
|
|
81
86
|
color: ${brand.textPrimary};
|
|
82
87
|
}
|
|
83
88
|
&:active:enabled {
|
|
@@ -97,8 +102,7 @@ export const ButtonStyled = styled.button<Props>`
|
|
|
97
102
|
border: ${spacing.r1} solid ${brand.infoPrimary};
|
|
98
103
|
}
|
|
99
104
|
&:focus-visible:enabled {
|
|
100
|
-
|
|
101
|
-
outline-offset: ${spacing.r2};
|
|
105
|
+
${FocusVisibleStyle}
|
|
102
106
|
}
|
|
103
107
|
&:active:enabled {
|
|
104
108
|
cursor: pointer;
|
|
@@ -117,8 +121,7 @@ export const ButtonStyled = styled.button<Props>`
|
|
|
117
121
|
color: ${brand.textPrimary};
|
|
118
122
|
}
|
|
119
123
|
&:focus-visible:enabled {
|
|
120
|
-
|
|
121
|
-
outline-offset: ${spacing.r2};
|
|
124
|
+
${FocusVisibleStyle}
|
|
122
125
|
border-color: ${brand.buttonSecondary};
|
|
123
126
|
}
|
|
124
127
|
&:active:enabled {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { HTMLProps } from 'react';
|
|
3
3
|
import { createContext } from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
4
|
+
import styled, { css } from 'styled-components';
|
|
5
5
|
import { hex2RGB } from '../../utils';
|
|
6
|
+
import { FocusVisibleStyle } from '../buttonv2/Buttonv2.component';
|
|
6
7
|
const CardContext = createContext(null);
|
|
7
8
|
type CardElementProps = {
|
|
8
9
|
children: React.ReactNode;
|
|
@@ -101,18 +102,17 @@ const StyledCard = styled.div<{
|
|
|
101
102
|
|
|
102
103
|
${(props) =>
|
|
103
104
|
props.onClick && !props.disabled
|
|
104
|
-
? `
|
|
105
|
-
|
|
105
|
+
? css`
|
|
106
|
+
cursor: pointer;
|
|
106
107
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
&:hover {
|
|
109
|
+
box-shadow: 0 0 0 2px ${props.theme.highlight};
|
|
110
|
+
}
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
`
|
|
112
|
+
&:focus {
|
|
113
|
+
${FocusVisibleStyle}
|
|
114
|
+
}
|
|
115
|
+
`
|
|
116
116
|
: ''};
|
|
117
117
|
|
|
118
118
|
&.active {
|
|
@@ -3,6 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
import { spacing, Stack } from '../../spacing';
|
|
4
4
|
|
|
5
5
|
import { Text } from '../text/Text.component';
|
|
6
|
+
import { FocusVisibleStyle } from '../buttonv2/Buttonv2.component';
|
|
6
7
|
|
|
7
8
|
type Props = {
|
|
8
9
|
label?: string;
|
|
@@ -113,8 +114,7 @@ const StyledCheckbox = styled.label<{
|
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
[type='checkbox']:focus-visible:enabled {
|
|
116
|
-
|
|
117
|
-
outline-offset: ${spacing.r2};
|
|
117
|
+
${FocusVisibleStyle}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
/* Disabled */
|