@bitrise/bitkit 10.12.0-alpha-table.1 → 10.12.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/package.json +1 -1
- package/src/Components/Dropdown/Dropdown.stories.tsx +9 -0
- package/src/Components/Dropdown/Dropdown.theme.ts +2 -0
- package/src/Components/Dropdown/Dropdown.tsx +2 -1
- package/src/Components/Dropdown/DropdownButton.tsx +5 -3
- package/src/index.ts +0 -24
- package/src/old.ts +14 -14
- package/src/theme.ts +1 -3
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Components/Table/Table.stories.tsx +0 -154
- package/src/Components/Table/Table.theme.ts +0 -84
- package/src/Components/Table/Table.tsx +0 -22
- package/src/Components/Table/TableCaption.tsx +0 -27
- package/src/Components/Table/TableContainer.tsx +0 -9
- package/src/Components/Table/Tbody.tsx +0 -9
- package/src/Components/Table/Td.tsx +0 -22
- package/src/Components/Table/Th.tsx +0 -50
- package/src/Components/Table/Thead.tsx +0 -9
- package/src/Components/Table/Tr.tsx +0 -61
package/package.json
CHANGED
|
@@ -124,3 +124,12 @@ export const InsideDialog = () => {
|
|
|
124
124
|
</Provider>
|
|
125
125
|
);
|
|
126
126
|
};
|
|
127
|
+
export const WithIcon = () => {
|
|
128
|
+
return (
|
|
129
|
+
<Dropdown iconName="Calendar" defaultValue="daily">
|
|
130
|
+
<DropdownOption value="daily">Daily</DropdownOption>
|
|
131
|
+
<DropdownOption value="weekly">Weekly</DropdownOption>
|
|
132
|
+
<DropdownOption value="monthly">Monthly</DropdownOption>
|
|
133
|
+
</Dropdown>
|
|
134
|
+
);
|
|
135
|
+
};
|
|
@@ -86,6 +86,7 @@ const DropdownTheme = {
|
|
|
86
86
|
height: '32',
|
|
87
87
|
paddingLeft: '12',
|
|
88
88
|
paddingRight: '12',
|
|
89
|
+
gap: '0.375rem',
|
|
89
90
|
},
|
|
90
91
|
},
|
|
91
92
|
medium: {
|
|
@@ -94,6 +95,7 @@ const DropdownTheme = {
|
|
|
94
95
|
height: '48',
|
|
95
96
|
paddingLeft: '16',
|
|
96
97
|
paddingRight: '16',
|
|
98
|
+
gap: '0.625rem',
|
|
97
99
|
},
|
|
98
100
|
},
|
|
99
101
|
},
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
useMultiStyleConfig,
|
|
20
20
|
} from '@chakra-ui/react';
|
|
21
21
|
import { FloatingFocusManager } from '@floating-ui/react-dom-interactions';
|
|
22
|
-
import Icon from '../Icon/Icon';
|
|
22
|
+
import Icon, { TypeIconName } from '../Icon/Icon';
|
|
23
23
|
import { DropdownEventArgs, DropdownProvider, useDropdownContext, useDropdownStyles } from './Dropdown.context';
|
|
24
24
|
import { DropdownOption, DropdownGroup, DropdownDetailedOption, DropdownOptionProps } from './DropdownOption';
|
|
25
25
|
import DropdownButton from './DropdownButton';
|
|
@@ -101,6 +101,7 @@ export interface DropdownProps<T> extends ChakraProps {
|
|
|
101
101
|
'aria-label'?: string;
|
|
102
102
|
search?: ReactNode;
|
|
103
103
|
children?: ReactNode;
|
|
104
|
+
iconName?: TypeIconName;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
function useOptionListWithIndexes({ children }: { children: ReactNode }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef, ReactNode } from 'react';
|
|
2
2
|
import { chakra, ChakraProps } from '@chakra-ui/react';
|
|
3
|
-
import Icon from '../Icon/Icon';
|
|
3
|
+
import Icon, { TypeIconName } from '../Icon/Icon';
|
|
4
4
|
import { useDropdownStyles } from './Dropdown.context';
|
|
5
5
|
|
|
6
6
|
interface DropdownButtonProps extends ChakraProps {
|
|
@@ -10,17 +10,19 @@ interface DropdownButtonProps extends ChakraProps {
|
|
|
10
10
|
formLabel?: ReactNode;
|
|
11
11
|
size: 'medium' | 'small';
|
|
12
12
|
children?: ReactNode;
|
|
13
|
+
iconName?: TypeIconName;
|
|
13
14
|
}
|
|
14
15
|
const DropdownButton = forwardRef<HTMLButtonElement, DropdownButtonProps>(
|
|
15
|
-
({ size, blurHandler, formLabel, readOnly, placeholder, children, ...rest }, ref) => {
|
|
16
|
+
({ size, blurHandler, formLabel, readOnly, placeholder, children, iconName, ...rest }, ref) => {
|
|
16
17
|
const { field, icon } = useDropdownStyles();
|
|
17
18
|
const iconSize = size === 'medium' ? '24' : '16';
|
|
18
19
|
return (
|
|
19
20
|
<chakra.button aria-readonly={readOnly} type="button" ref={ref} onBlur={blurHandler} __css={field} {...rest}>
|
|
21
|
+
{iconName && <Icon aria-hidden="true" __css={icon} name={iconName} size={iconSize} />}
|
|
20
22
|
<chakra.span overflow="hidden" textOverflow="ellipsis" whiteSpace="nowrap" flexGrow={1}>
|
|
21
23
|
{formLabel || placeholder}
|
|
22
24
|
</chakra.span>
|
|
23
|
-
<Icon aria-hidden="true" __css={icon} name="DropdownArrows"
|
|
25
|
+
<Icon aria-hidden="true" __css={icon} name="DropdownArrows" size={iconSize} />
|
|
24
26
|
</chakra.button>
|
|
25
27
|
);
|
|
26
28
|
},
|
package/src/index.ts
CHANGED
|
@@ -159,27 +159,3 @@ export { default as Accordion } from './Components/Accordion/Accordion';
|
|
|
159
159
|
|
|
160
160
|
export type { AccordionItemProps } from './Components/Accordion/AccordionItem';
|
|
161
161
|
export { default as AccordionItem } from './Components/Accordion/AccordionItem';
|
|
162
|
-
|
|
163
|
-
export type { TableProps } from './Components/Table/Table';
|
|
164
|
-
export { default as Table } from './Components/Table/Table';
|
|
165
|
-
|
|
166
|
-
export type { TableCaptionProps } from './Components/Table/TableCaption';
|
|
167
|
-
export { default as TableCaption } from './Components/Table/TableCaption';
|
|
168
|
-
|
|
169
|
-
export type { TableContainerProps } from './Components/Table/TableContainer';
|
|
170
|
-
export { default as TableContainer } from './Components/Table/TableContainer';
|
|
171
|
-
|
|
172
|
-
export type { TableBodyProps } from './Components/Table/Tbody';
|
|
173
|
-
export { default as Tbody } from './Components/Table/Tbody';
|
|
174
|
-
|
|
175
|
-
export type { TableCellProps } from './Components/Table/Td';
|
|
176
|
-
export { default as Td } from './Components/Table/Td';
|
|
177
|
-
|
|
178
|
-
export type { TableColumnHeaderProps } from './Components/Table/Th';
|
|
179
|
-
export { default as Th } from './Components/Table/Th';
|
|
180
|
-
|
|
181
|
-
export type { TableHeadProps } from './Components/Table/Thead';
|
|
182
|
-
export { default as Thead } from './Components/Table/Thead';
|
|
183
|
-
|
|
184
|
-
export type { TableRowProps } from './Components/Table/Tr';
|
|
185
|
-
export { default as Tr } from './Components/Table/Tr';
|
package/src/old.ts
CHANGED
|
@@ -72,27 +72,27 @@ export { default as SkeletonBox } from './Old/Skeleton/SkeletonBox';
|
|
|
72
72
|
export type { Props as Status500Props } from './Old/Status/Status500';
|
|
73
73
|
export { default as Status500 } from './Old/Status/Status500';
|
|
74
74
|
|
|
75
|
-
export type { Props as
|
|
76
|
-
export { default as
|
|
75
|
+
export type { Props as TableProps } from './Old/Table/Table';
|
|
76
|
+
export { default as Table } from './Old/Table/Table';
|
|
77
77
|
|
|
78
|
-
export type { Props as
|
|
79
|
-
export { default as
|
|
78
|
+
export type { Props as TableBodyProps } from './Old/Table/TableBody';
|
|
79
|
+
export { default as TableBody } from './Old/Table/TableBody';
|
|
80
80
|
|
|
81
|
-
export type { Props as
|
|
82
|
-
export { default as
|
|
81
|
+
export type { Props as TableCellProps } from './Old/Table/TableCell';
|
|
82
|
+
export { default as TableCell } from './Old/Table/TableCell';
|
|
83
83
|
|
|
84
|
-
export type { Props as
|
|
85
|
-
export { default as
|
|
84
|
+
export type { Props as TableHeaderProps } from './Old/Table/TableHeader';
|
|
85
|
+
export { default as TableHeader } from './Old/Table/TableHeader';
|
|
86
86
|
|
|
87
|
-
export type { Props as
|
|
87
|
+
export type { Props as TableHeaderCellProps } from './Old/Table/TableHeaderCell';
|
|
88
88
|
export type { TypeTableSort } from './Old/Table/TableHeaderCell';
|
|
89
|
-
export { default as
|
|
89
|
+
export { default as TableHeaderCell } from './Old/Table/TableHeaderCell';
|
|
90
90
|
|
|
91
|
-
export type { Props as
|
|
92
|
-
export { default as
|
|
91
|
+
export type { Props as TableHeaderRowProps } from './Old/Table/TableHeaderRow';
|
|
92
|
+
export { default as TableHeaderRow } from './Old/Table/TableHeaderRow';
|
|
93
93
|
|
|
94
|
-
export type { Props as
|
|
95
|
-
export { default as
|
|
94
|
+
export type { Props as TableRowProps } from './Old/Table/TableRow';
|
|
95
|
+
export { default as TableRow } from './Old/Table/TableRow';
|
|
96
96
|
|
|
97
97
|
export type { Props as TextareaProps } from './Old/Textarea/Textarea';
|
|
98
98
|
export { default as Textarea } from './Old/Textarea/Textarea';
|
package/src/theme.ts
CHANGED
|
@@ -18,7 +18,6 @@ import Input from './Components/Input/Input.theme';
|
|
|
18
18
|
import Dropdown from './Components/Dropdown/Dropdown.theme';
|
|
19
19
|
import Tabs from './Components/Tabs/Tabs.theme';
|
|
20
20
|
import Text from './Components/Text/Text.theme';
|
|
21
|
-
import Table from './Components/Table/Table.theme';
|
|
22
21
|
import Alert from './Foundations/Themes/Alert.theme';
|
|
23
22
|
import Tooltip from './Components/Tooltip/Tooltip.theme';
|
|
24
23
|
import CloseButton from './Components/CloseButton/CloseButton.theme';
|
|
@@ -77,7 +76,6 @@ const theme = {
|
|
|
77
76
|
Checkbox,
|
|
78
77
|
ColorButton,
|
|
79
78
|
Divider,
|
|
80
|
-
Dropdown,
|
|
81
79
|
EmptyState,
|
|
82
80
|
Link,
|
|
83
81
|
List,
|
|
@@ -85,7 +83,7 @@ const theme = {
|
|
|
85
83
|
Modal: Dialog,
|
|
86
84
|
Radio,
|
|
87
85
|
Select,
|
|
88
|
-
|
|
86
|
+
Dropdown,
|
|
89
87
|
Tabs,
|
|
90
88
|
Text,
|
|
91
89
|
Tooltip,
|