baseui 11.0.3 → 11.1.2
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/a11y/index.d.ts +1 -1
- package/accordion/index.d.ts +25 -28
- package/app-nav-bar/app-nav-bar.js +33 -40
- package/app-nav-bar/app-nav-bar.js.flow +46 -62
- package/app-nav-bar/index.d.ts +9 -8
- package/app-nav-bar/styled-components.js +83 -29
- package/app-nav-bar/styled-components.js.flow +59 -9
- package/app-nav-bar/types.js.flow +2 -0
- package/aspect-ratio-box/index.d.ts +2 -4
- package/avatar/index.d.ts +6 -12
- package/badge/badge.js +109 -0
- package/badge/badge.js.flow +91 -0
- package/badge/constants.js +54 -0
- package/badge/constants.js.flow +52 -0
- package/badge/hint-dot.js +96 -0
- package/badge/hint-dot.js.flow +68 -0
- package/badge/index.d.ts +97 -0
- package/badge/index.js +80 -0
- package/badge/index.js.flow +20 -0
- package/badge/notification-circle.js +103 -0
- package/badge/notification-circle.js.flow +81 -0
- package/badge/package.json +4 -0
- package/badge/styled-components.js +242 -0
- package/badge/styled-components.js.flow +325 -0
- package/badge/types.js +11 -0
- package/badge/types.js.flow +59 -0
- package/badge/utils.js +33 -0
- package/badge/utils.js.flow +23 -0
- package/banner/banner.js +283 -0
- package/banner/banner.js.flow +253 -0
- package/banner/constants.js +35 -0
- package/banner/constants.js.flow +33 -0
- package/banner/index.d.ts +75 -0
- package/banner/index.js +44 -0
- package/banner/index.js.flow +16 -0
- package/banner/package.json +4 -0
- package/banner/styled-components.js +131 -0
- package/banner/styled-components.js.flow +119 -0
- package/banner/types.js +11 -0
- package/banner/types.js.flow +66 -0
- package/block/index.d.ts +4 -4
- package/breadcrumbs/breadcrumbs.js +5 -1
- package/breadcrumbs/breadcrumbs.js.flow +2 -2
- package/breadcrumbs/index.d.ts +5 -5
- package/button/button.js +2 -1
- package/button/button.js.flow +1 -0
- package/button/index.d.ts +19 -29
- package/button-group/index.d.ts +18 -24
- package/card/index.d.ts +16 -14
- package/checkbox/index.d.ts +17 -21
- package/combobox/index.d.ts +7 -11
- package/data-table/index.d.ts +7 -10
- package/datepicker/index.d.ts +42 -63
- package/datepicker/utils/date-helpers.js +1 -1
- package/datepicker/utils/date-helpers.js.flow +1 -1
- package/dnd-list/index.d.ts +22 -35
- package/drawer/index.d.ts +22 -27
- package/es/app-nav-bar/app-nav-bar.js +9 -19
- package/es/app-nav-bar/styled-components.js +64 -13
- package/es/badge/badge.js +70 -0
- package/es/badge/constants.js +42 -0
- package/es/badge/hint-dot.js +55 -0
- package/es/badge/index.js +11 -0
- package/es/badge/notification-circle.js +65 -0
- package/es/badge/styled-components.js +296 -0
- package/es/badge/types.js +8 -0
- package/es/badge/utils.js +17 -0
- package/es/banner/banner.js +213 -0
- package/es/banner/constants.js +24 -0
- package/es/banner/index.js +9 -0
- package/es/banner/styled-components.js +122 -0
- package/es/banner/types.js +8 -0
- package/es/breadcrumbs/breadcrumbs.js +5 -1
- package/es/button/button.js +1 -0
- package/es/datepicker/utils/date-helpers.js +1 -1
- package/es/file-uploader/file-uploader.js +8 -5
- package/es/helper/helper-steps.js +3 -1
- package/es/input/base-input.js +18 -11
- package/es/input/input.js +15 -10
- package/es/input/masked-input.js +5 -2
- package/es/input/utils.js +4 -2
- package/es/locale/tr_TR.js +115 -0
- package/es/notification/notification.js +16 -1
- package/es/payment-card/custom-cards.config.js +22 -0
- package/es/payment-card/icons/uatp.js +52 -0
- package/es/payment-card/payment-card.js +8 -3
- package/es/popover/popover.js +2 -1
- package/es/popover/stateful-container.js +2 -0
- package/es/popover/styled-components.js +2 -1
- package/es/progress-steps/numbered-step.js +2 -2
- package/es/select/select-component.js +38 -21
- package/es/table-semantic/styled-components.js +14 -0
- package/es/table-semantic/table-builder.js +12 -5
- package/es/textarea/textarea.js +15 -9
- package/es/themes/dark-theme/color-component-tokens.js +8 -0
- package/es/themes/light-theme/color-component-tokens.js +8 -0
- package/es/tree-view/tree-label.js +9 -1
- package/esm/app-nav-bar/app-nav-bar.js +32 -38
- package/esm/app-nav-bar/styled-components.js +79 -28
- package/esm/badge/badge.js +97 -0
- package/esm/badge/constants.js +42 -0
- package/esm/badge/hint-dot.js +83 -0
- package/esm/badge/index.js +11 -0
- package/esm/badge/notification-circle.js +91 -0
- package/esm/badge/styled-components.js +235 -0
- package/esm/badge/types.js +8 -0
- package/esm/badge/utils.js +17 -0
- package/esm/banner/banner.js +271 -0
- package/esm/banner/constants.js +24 -0
- package/esm/banner/index.js +9 -0
- package/esm/banner/styled-components.js +113 -0
- package/esm/banner/types.js +8 -0
- package/esm/breadcrumbs/breadcrumbs.js +5 -1
- package/esm/button/button.js +2 -1
- package/esm/datepicker/utils/date-helpers.js +1 -1
- package/esm/file-uploader/file-uploader.js +23 -8
- package/esm/helper/helper-steps.js +3 -1
- package/esm/input/base-input.js +18 -11
- package/esm/input/input.js +15 -10
- package/esm/input/masked-input.js +6 -3
- package/esm/input/utils.js +4 -2
- package/esm/locale/tr_TR.js +115 -0
- package/esm/notification/notification.js +17 -1
- package/esm/payment-card/custom-cards.config.js +22 -0
- package/esm/payment-card/icons/uatp.js +53 -0
- package/esm/payment-card/payment-card.js +9 -7
- package/esm/popover/popover.js +2 -1
- package/esm/popover/stateful-container.js +2 -0
- package/esm/popover/styled-components.js +3 -2
- package/esm/progress-steps/numbered-step.js +2 -2
- package/esm/select/select-component.js +75 -57
- package/esm/table-semantic/styled-components.js +31 -18
- package/esm/table-semantic/table-builder.js +34 -23
- package/esm/textarea/textarea.js +15 -9
- package/esm/themes/dark-theme/color-component-tokens.js +8 -0
- package/esm/themes/light-theme/color-component-tokens.js +8 -0
- package/esm/tree-view/tree-label.js +10 -2
- package/file-uploader/file-uploader.js +23 -8
- package/file-uploader/file-uploader.js.flow +18 -5
- package/file-uploader/index.d.ts +11 -11
- package/file-uploader/types.js.flow +3 -0
- package/flex-grid/index.d.ts +3 -3
- package/form-control/index.d.ts +7 -19
- package/header-navigation/index.d.ts +8 -9
- package/heading/index.d.ts +3 -4
- package/helper/helper-steps.js +19 -13
- package/helper/helper-steps.js.flow +3 -1
- package/helper/index.d.ts +7 -7
- package/helpers/base-provider.d.ts +16 -0
- package/helpers/overrides.d.ts +23 -0
- package/icon/index.d.ts +32 -32
- package/index.d.ts +34 -99
- package/input/base-input.js +18 -11
- package/input/base-input.js.flow +18 -6
- package/input/index.d.ts +29 -32
- package/input/input.js +15 -10
- package/input/input.js.flow +10 -5
- package/input/masked-input.js +6 -3
- package/input/masked-input.js.flow +3 -0
- package/input/types.js.flow +4 -0
- package/input/utils.js +4 -2
- package/input/utils.js.flow +2 -1
- package/layer/index.d.ts +6 -11
- package/layout-grid/index.d.ts +25 -7
- package/link/index.d.ts +2 -2
- package/list/index.d.ts +26 -31
- package/{locale.ts → locale/index.d.ts} +8 -0
- package/locale/tr_TR.js +123 -0
- package/locale/tr_TR.js.flow +124 -0
- package/map-marker/index.d.ts +41 -47
- package/menu/index.d.ts +27 -37
- package/modal/index.d.ts +28 -38
- package/notification/index.d.ts +2 -3
- package/notification/notification.js +18 -1
- package/notification/notification.js.flow +15 -1
- package/overrides.ts +2 -22
- package/package.json +26 -17
- package/pagination/index.d.ts +22 -26
- package/payment-card/custom-cards.config.js +30 -0
- package/payment-card/custom-cards.config.js.flow +29 -0
- package/payment-card/icons/uatp.js +67 -0
- package/payment-card/icons/uatp.js.flow +62 -0
- package/payment-card/index.d.ts +8 -8
- package/payment-card/payment-card.js +12 -7
- package/payment-card/payment-card.js.flow +12 -0
- package/phone-input/index.d.ts +261 -269
- package/pin-code/index.d.ts +11 -18
- package/popover/index.d.ts +39 -55
- package/popover/popover.js +2 -1
- package/popover/popover.js.flow +2 -1
- package/popover/stateful-container.js +2 -0
- package/popover/stateful-container.js.flow +2 -0
- package/popover/styled-components.js +3 -2
- package/popover/styled-components.js.flow +2 -1
- package/popover/types.js.flow +1 -0
- package/progress-bar/index.d.ts +11 -12
- package/progress-steps/index.d.ts +16 -16
- package/progress-steps/numbered-step.js.flow +2 -2
- package/radio/index.d.ts +12 -15
- package/rating/index.d.ts +9 -12
- package/select/index.d.ts +33 -36
- package/select/select-component.js +72 -54
- package/select/select-component.js.flow +35 -30
- package/side-navigation/index.d.ts +11 -13
- package/skeleton/index.d.ts +1 -1
- package/slider/index.d.ts +17 -26
- package/snackbar/index.d.ts +8 -8
- package/spinner/index.d.ts +2 -2
- package/styles/index.d.ts +82 -2
- package/table/index.d.ts +16 -16
- package/table-grid/index.d.ts +6 -8
- package/table-semantic/index.d.ts +26 -32
- package/table-semantic/styled-components.js +33 -19
- package/table-semantic/styled-components.js.flow +12 -0
- package/table-semantic/table-builder.js +38 -22
- package/table-semantic/table-builder.js.flow +32 -17
- package/table-semantic/types.js.flow +1 -0
- package/tabs/index.d.ts +20 -23
- package/tabs-motion/index.d.ts +23 -23
- package/tag/index.d.ts +14 -18
- package/textarea/index.d.ts +11 -14
- package/textarea/textarea.js +15 -9
- package/textarea/textarea.js.flow +11 -5
- package/textarea/types.js.flow +1 -0
- package/theme.ts +36 -777
- package/themes/dark-theme/color-component-tokens.js +8 -0
- package/themes/dark-theme/color-component-tokens.js.flow +9 -0
- package/themes/index.d.ts +765 -0
- package/themes/light-theme/color-component-tokens.js +8 -0
- package/themes/light-theme/color-component-tokens.js.flow +9 -0
- package/themes/types.js.flow +9 -0
- package/timepicker/index.d.ts +5 -8
- package/timezonepicker/index.d.ts +5 -8
- package/toast/index.d.ts +26 -40
- package/tokens/index.d.ts +1 -1
- package/tooltip/index.d.ts +7 -9
- package/tree-view/index.d.ts +15 -19
- package/tree-view/tree-label.js +10 -2
- package/tree-view/tree-label.js.flow +4 -4
- package/typography/index.d.ts +37 -37
package/tabs/index.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {StyletronComponent} from 'styletron-react';
|
|
3
|
-
import {Override} from '../overrides';
|
|
2
|
+
import { StyletronComponent } from 'styletron-react';
|
|
3
|
+
import { Override } from '../overrides';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export declare const ORIENTATION: {
|
|
6
6
|
horizontal: 'horizontal';
|
|
7
7
|
vertical: 'vertical';
|
|
8
|
-
}
|
|
9
|
-
export
|
|
8
|
+
};
|
|
9
|
+
export declare const STATE_CHANGE_TYPE: {
|
|
10
10
|
change: 'change';
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
|
|
13
13
|
export interface State {
|
|
14
14
|
activeKey: React.Key;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export type StateReducer = (
|
|
18
|
-
stateChangeType: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
|
|
18
|
+
stateChangeType: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
|
|
19
19
|
nextState: State,
|
|
20
|
-
currentState: State
|
|
20
|
+
currentState: State
|
|
21
21
|
) => State;
|
|
22
22
|
|
|
23
23
|
export interface TabsOverrides<T> {
|
|
@@ -32,12 +32,12 @@ export interface TabsProps {
|
|
|
32
32
|
activeKey?: React.Key;
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
renderAll?: boolean;
|
|
35
|
-
onChange?: (args: {activeKey: React.Key}) => any;
|
|
36
|
-
orientation?: ORIENTATION[keyof ORIENTATION];
|
|
37
|
-
overrides?: TabsOverrides<SharedProps & {$active?: boolean}>;
|
|
35
|
+
onChange?: (args: { activeKey: React.Key }) => any;
|
|
36
|
+
orientation?: typeof ORIENTATION[keyof typeof ORIENTATION];
|
|
37
|
+
overrides?: TabsOverrides<SharedProps & { $active?: boolean }>;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export const Tabs: React.FC<TabsProps>;
|
|
40
|
+
export declare const Tabs: React.FC<TabsProps>;
|
|
41
41
|
|
|
42
42
|
export type StatefulTabsProps = TabsProps & {
|
|
43
43
|
activeKey?: never;
|
|
@@ -49,8 +49,8 @@ export type StatefulTabsProps = TabsProps & {
|
|
|
49
49
|
export class StatefulTabs extends React.Component<StatefulTabsProps, State> {
|
|
50
50
|
onTabChange(newState: State): void;
|
|
51
51
|
internalSetState(
|
|
52
|
-
type: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
|
|
53
|
-
changes: State
|
|
52
|
+
type: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
|
|
53
|
+
changes: State
|
|
54
54
|
): void;
|
|
55
55
|
getInitialKey(): any;
|
|
56
56
|
}
|
|
@@ -62,7 +62,7 @@ export interface TabOverrides<T> {
|
|
|
62
62
|
export interface SharedProps {
|
|
63
63
|
$disabled?: boolean;
|
|
64
64
|
$active?: boolean;
|
|
65
|
-
$orientation?: ORIENTATION[keyof ORIENTATION];
|
|
65
|
+
$orientation?: typeof ORIENTATION[keyof typeof ORIENTATION];
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export interface TabProps {
|
|
@@ -76,7 +76,7 @@ export interface TabProps {
|
|
|
76
76
|
overrides?: TabOverrides<SharedProps>;
|
|
77
77
|
title?: React.ReactNode;
|
|
78
78
|
id?: string;
|
|
79
|
-
$orientation?: ORIENTATION[keyof ORIENTATION];
|
|
79
|
+
$orientation?: typeof ORIENTATION[keyof typeof ORIENTATION];
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
export class Tab extends React.Component<TabProps> {
|
|
@@ -85,10 +85,7 @@ export class Tab extends React.Component<TabProps> {
|
|
|
85
85
|
getSharedProps(): SharedProps;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
export const StyledRoot: StyletronComponent<any>;
|
|
89
|
-
export const StyledTab: StyletronComponent<any>;
|
|
90
|
-
export const StyledTabBar: StyletronComponent<any>;
|
|
91
|
-
export const StyledTabContent: StyletronComponent<any>;
|
|
92
|
-
|
|
93
|
-
export const ORIENTATION: ORIENTATION;
|
|
94
|
-
export const STATE_CHANGE_TYPE: STATE_CHANGE_TYPE;
|
|
88
|
+
export declare const StyledRoot: StyletronComponent<any>;
|
|
89
|
+
export declare const StyledTab: StyletronComponent<any>;
|
|
90
|
+
export declare const StyledTabBar: StyletronComponent<any>;
|
|
91
|
+
export declare const StyledTabContent: StyletronComponent<any>;
|
package/tabs-motion/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {StyletronComponent} from 'styletron-react';
|
|
3
|
-
import {Override} from '../overrides';
|
|
2
|
+
import { StyletronComponent } from 'styletron-react';
|
|
3
|
+
import { Override } from '../overrides';
|
|
4
4
|
|
|
5
5
|
// constants
|
|
6
6
|
|
|
@@ -20,23 +20,23 @@ export enum STATE_CHANGE_TYPE {
|
|
|
20
20
|
|
|
21
21
|
// utils
|
|
22
22
|
|
|
23
|
-
export const getTabId: (uid: string, key: React.Key) => string;
|
|
24
|
-
export const getTabPanelId: (uid: string, key: React.Key) => string;
|
|
25
|
-
export const isHorizontal: (orientation: ORIENTATION) => boolean;
|
|
26
|
-
export const isVertical: (orientation: ORIENTATION) => boolean;
|
|
27
|
-
export const isIntrinsic: (fill: FILL) => boolean;
|
|
28
|
-
export const isFixed: (fill: FILL) => boolean;
|
|
29
|
-
export const isRTL: (direction: string) => boolean;
|
|
23
|
+
export declare const getTabId: (uid: string, key: React.Key) => string;
|
|
24
|
+
export declare const getTabPanelId: (uid: string, key: React.Key) => string;
|
|
25
|
+
export declare const isHorizontal: (orientation: ORIENTATION) => boolean;
|
|
26
|
+
export declare const isVertical: (orientation: ORIENTATION) => boolean;
|
|
27
|
+
export declare const isIntrinsic: (fill: FILL) => boolean;
|
|
28
|
+
export declare const isFixed: (fill: FILL) => boolean;
|
|
29
|
+
export declare const isRTL: (direction: string) => boolean;
|
|
30
30
|
|
|
31
31
|
// styled-components
|
|
32
32
|
|
|
33
|
-
export const StyledRoot: StyletronComponent<any>;
|
|
34
|
-
export const StyledTabList: StyletronComponent<any>;
|
|
35
|
-
export const StyledTab: StyletronComponent<any>;
|
|
36
|
-
export const StyledArtworkContainer: StyletronComponent<any>;
|
|
37
|
-
export const StyledTabBorder: StyletronComponent<any>;
|
|
38
|
-
export const StyledTabHighlight: StyletronComponent<any>;
|
|
39
|
-
export const StyledTabPanel: StyletronComponent<any>;
|
|
33
|
+
export declare const StyledRoot: StyletronComponent<any>;
|
|
34
|
+
export declare const StyledTabList: StyletronComponent<any>;
|
|
35
|
+
export declare const StyledTab: StyletronComponent<any>;
|
|
36
|
+
export declare const StyledArtworkContainer: StyletronComponent<any>;
|
|
37
|
+
export declare const StyledTabBorder: StyletronComponent<any>;
|
|
38
|
+
export declare const StyledTabHighlight: StyletronComponent<any>;
|
|
39
|
+
export declare const StyledTabPanel: StyletronComponent<any>;
|
|
40
40
|
|
|
41
41
|
// tabs
|
|
42
42
|
|
|
@@ -63,16 +63,16 @@ interface TabsProps {
|
|
|
63
63
|
children: React.ReactNode;
|
|
64
64
|
activeKey?: React.Key;
|
|
65
65
|
disabled?: boolean;
|
|
66
|
-
fill?: FILL[keyof FILL];
|
|
67
|
-
orientation?: ORIENTATION[keyof ORIENTATION];
|
|
66
|
+
fill?: typeof FILL[keyof typeof FILL];
|
|
67
|
+
orientation?: typeof ORIENTATION[keyof typeof ORIENTATION];
|
|
68
68
|
activateOnFocus?: boolean;
|
|
69
69
|
renderAll?: boolean;
|
|
70
|
-
onChange?: (params: {activeKey: React.Key}) => void;
|
|
70
|
+
onChange?: (params: { activeKey: React.Key }) => void;
|
|
71
71
|
overrides?: TabsOverrides;
|
|
72
72
|
uid?: string;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
export const Tabs: React.FC<TabsProps>;
|
|
75
|
+
export declare const Tabs: React.FC<TabsProps>;
|
|
76
76
|
|
|
77
77
|
// tab
|
|
78
78
|
|
|
@@ -101,7 +101,7 @@ interface TabProps {
|
|
|
101
101
|
tabRef?: React.MutableRefObject<HTMLButtonElement | undefined>;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
export const Tab: React.FC<TabProps>;
|
|
104
|
+
export declare const Tab: React.FC<TabProps>;
|
|
105
105
|
|
|
106
106
|
// stateful-tabs
|
|
107
107
|
|
|
@@ -110,7 +110,7 @@ interface State {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
interface Action {
|
|
113
|
-
type: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE];
|
|
113
|
+
type: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE];
|
|
114
114
|
payload: React.Key;
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -121,4 +121,4 @@ type StatefulTabsProps = TabsProps & {
|
|
|
121
121
|
stateReducer?: StateReducer;
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
export const StatefulTabs: React.FC<StatefulTabsProps>;
|
|
124
|
+
export declare const StatefulTabs: React.FC<StatefulTabsProps>;
|
package/tag/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {StyletronComponent} from 'styletron-react';
|
|
3
|
-
import {Override} from '../overrides';
|
|
2
|
+
import { StyletronComponent } from 'styletron-react';
|
|
3
|
+
import { Override } from '../overrides';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export declare const KIND: {
|
|
6
6
|
custom: 'custom';
|
|
7
7
|
neutral: 'neutral';
|
|
8
8
|
primary: 'primary';
|
|
@@ -19,19 +19,19 @@ export interface KIND {
|
|
|
19
19
|
green: 'green';
|
|
20
20
|
purple: 'purple';
|
|
21
21
|
brown: 'brown';
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
|
|
24
|
-
export
|
|
24
|
+
export declare const VARIANT: {
|
|
25
25
|
solid: 'solid';
|
|
26
26
|
light: 'light';
|
|
27
27
|
outlined: 'outlined';
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
|
|
30
|
-
export
|
|
30
|
+
export declare const SIZE: {
|
|
31
31
|
small: 'small';
|
|
32
32
|
medium: 'medium';
|
|
33
33
|
large: 'large';
|
|
34
|
-
}
|
|
34
|
+
};
|
|
35
35
|
|
|
36
36
|
export interface TagOverrides {
|
|
37
37
|
Root?: Override<any>;
|
|
@@ -47,12 +47,12 @@ export interface TagProps {
|
|
|
47
47
|
disabled?: boolean;
|
|
48
48
|
isFocused?: boolean;
|
|
49
49
|
isHovered?: boolean;
|
|
50
|
-
kind?: KIND[keyof KIND];
|
|
51
|
-
variant?: VARIANT[keyof VARIANT];
|
|
50
|
+
kind?: typeof KIND[keyof typeof KIND];
|
|
51
|
+
variant?: typeof VARIANT[keyof typeof VARIANT];
|
|
52
52
|
children?: React.ReactNode;
|
|
53
53
|
title?: string;
|
|
54
54
|
color?: string;
|
|
55
|
-
size?: SIZE[keyof SIZE];
|
|
55
|
+
size?: typeof SIZE[keyof typeof SIZE];
|
|
56
56
|
onActionClick?: (e: Event, children?: React.ReactNode) => any;
|
|
57
57
|
onActionKeyDown?: (e: Event, children?: React.ReactNode) => any;
|
|
58
58
|
onClick?: (event: Event) => any;
|
|
@@ -65,10 +65,6 @@ export class Tag extends React.Component<TagProps> {
|
|
|
65
65
|
handleActionKeyDown(event: KeyboardEvent): void;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
export const StyledRoot: StyletronComponent<any>;
|
|
69
|
-
export const StyledAction: StyletronComponent<any>;
|
|
70
|
-
export const StyledText: StyletronComponent<any>;
|
|
71
|
-
|
|
72
|
-
export const KIND: KIND;
|
|
73
|
-
export const VARIANT: VARIANT;
|
|
74
|
-
export const SIZE: SIZE;
|
|
68
|
+
export declare const StyledRoot: StyletronComponent<any>;
|
|
69
|
+
export declare const StyledAction: StyletronComponent<any>;
|
|
70
|
+
export declare const StyledText: StyletronComponent<any>;
|
package/textarea/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {StyletronComponent} from 'styletron-react';
|
|
2
|
+
import { StyletronComponent } from 'styletron-react';
|
|
3
3
|
import {
|
|
4
4
|
BaseInputProps,
|
|
5
5
|
StatefulContainer,
|
|
@@ -13,30 +13,27 @@ export interface TextareaProps extends BaseInputProps<HTMLTextAreaElement> {
|
|
|
13
13
|
maxLength?: number;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export
|
|
16
|
+
export declare const ADJOINED: {
|
|
17
17
|
none: 'none';
|
|
18
18
|
left: 'left';
|
|
19
19
|
right: 'right';
|
|
20
20
|
both: 'both';
|
|
21
|
-
}
|
|
22
|
-
export
|
|
21
|
+
};
|
|
22
|
+
export declare const SIZE: {
|
|
23
23
|
default: 'default';
|
|
24
24
|
compact: 'compact';
|
|
25
25
|
large: 'large';
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
|
|
28
28
|
export class Textarea extends React.Component<TextareaProps> {}
|
|
29
29
|
|
|
30
|
-
export type StatefulTextareaProps = TextareaProps &
|
|
31
|
-
StatefulContainerProps & {children?: never};
|
|
30
|
+
export type StatefulTextareaProps = TextareaProps & StatefulContainerProps & { children?: never };
|
|
32
31
|
|
|
33
|
-
export const StatefulTextarea: React.FC<StatefulTextareaProps>;
|
|
32
|
+
export declare const StatefulTextarea: React.FC<StatefulTextareaProps>;
|
|
34
33
|
|
|
35
|
-
export {StatefulContainer};
|
|
34
|
+
export { StatefulContainer };
|
|
36
35
|
|
|
37
|
-
export const StyledTextareaContainer: StyletronComponent<any>;
|
|
38
|
-
export const StyledTextarea: StyletronComponent<any>;
|
|
36
|
+
export declare const StyledTextareaContainer: StyletronComponent<any>;
|
|
37
|
+
export declare const StyledTextarea: StyletronComponent<any>;
|
|
39
38
|
|
|
40
|
-
export
|
|
41
|
-
export const SIZE: SIZE;
|
|
42
|
-
export {STATE_CHANGE_TYPE};
|
|
39
|
+
export { STATE_CHANGE_TYPE };
|
package/textarea/textarea.js
CHANGED
|
@@ -72,23 +72,27 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
|
|
|
72
72
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
73
73
|
|
|
74
74
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
75
|
-
isFocused: _this.props.autoFocus || false
|
|
75
|
+
isFocused: _this.props.autoFocus && !_this.props.readOnly || false
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
_defineProperty(_assertThisInitialized(_this), "onFocus", function (e) {
|
|
79
|
-
_this.
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
if (!_this.props.readOnly) {
|
|
80
|
+
_this.setState({
|
|
81
|
+
isFocused: true
|
|
82
|
+
});
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
_this.props.onFocus(e);
|
|
85
|
+
}
|
|
84
86
|
});
|
|
85
87
|
|
|
86
88
|
_defineProperty(_assertThisInitialized(_this), "onBlur", function (e) {
|
|
87
|
-
_this.
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
if (!_this.props.readOnly) {
|
|
90
|
+
_this.setState({
|
|
91
|
+
isFocused: false
|
|
92
|
+
});
|
|
90
93
|
|
|
91
|
-
|
|
94
|
+
_this.props.onBlur(e);
|
|
95
|
+
}
|
|
92
96
|
});
|
|
93
97
|
|
|
94
98
|
return _this;
|
|
@@ -116,6 +120,7 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
|
|
|
116
120
|
return /*#__PURE__*/React.createElement(Root, _extends({
|
|
117
121
|
"data-baseweb": "textarea",
|
|
118
122
|
$isFocused: this.state.isFocused,
|
|
123
|
+
$isReadOnly: this.props.readOnly,
|
|
119
124
|
$disabled: this.props.disabled,
|
|
120
125
|
$error: this.props.error,
|
|
121
126
|
$positive: this.props.positive,
|
|
@@ -136,6 +141,7 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
|
|
|
136
141
|
_defineProperty(Textarea, "defaultProps", {
|
|
137
142
|
autoFocus: false,
|
|
138
143
|
disabled: false,
|
|
144
|
+
readOnly: false,
|
|
139
145
|
error: false,
|
|
140
146
|
name: '',
|
|
141
147
|
onBlur: function onBlur() {},
|
|
@@ -19,6 +19,7 @@ class Textarea extends React.Component<TextareaPropsT, { isFocused: boolean }> {
|
|
|
19
19
|
static defaultProps = {
|
|
20
20
|
autoFocus: false,
|
|
21
21
|
disabled: false,
|
|
22
|
+
readOnly: false,
|
|
22
23
|
error: false,
|
|
23
24
|
name: '',
|
|
24
25
|
onBlur: () => {},
|
|
@@ -35,17 +36,21 @@ class Textarea extends React.Component<TextareaPropsT, { isFocused: boolean }> {
|
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
state = {
|
|
38
|
-
isFocused: this.props.autoFocus || false,
|
|
39
|
+
isFocused: (this.props.autoFocus && !this.props.readOnly) || false,
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
onFocus = (e: SyntheticFocusEvent<HTMLTextAreaElement>) => {
|
|
42
|
-
this.
|
|
43
|
-
|
|
43
|
+
if (!this.props.readOnly) {
|
|
44
|
+
this.setState({ isFocused: true });
|
|
45
|
+
this.props.onFocus(e);
|
|
46
|
+
}
|
|
44
47
|
};
|
|
45
48
|
|
|
46
49
|
onBlur = (e: SyntheticFocusEvent<HTMLTextAreaElement>) => {
|
|
47
|
-
this.
|
|
48
|
-
|
|
50
|
+
if (!this.props.readOnly) {
|
|
51
|
+
this.setState({ isFocused: false });
|
|
52
|
+
this.props.onBlur(e);
|
|
53
|
+
}
|
|
49
54
|
};
|
|
50
55
|
|
|
51
56
|
render() {
|
|
@@ -63,6 +68,7 @@ class Textarea extends React.Component<TextareaPropsT, { isFocused: boolean }> {
|
|
|
63
68
|
<Root
|
|
64
69
|
data-baseweb="textarea"
|
|
65
70
|
$isFocused={this.state.isFocused}
|
|
71
|
+
$isReadOnly={this.props.readOnly}
|
|
66
72
|
$disabled={this.props.disabled}
|
|
67
73
|
$error={this.props.error}
|
|
68
74
|
$positive={this.props.positive}
|