@tiny-design/react 1.0.4 → 1.0.10
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/LICENSE +21 -0
- package/README.md +107 -0
- package/es/alert/style/_index.scss +0 -0
- package/es/alert/style/_mixin.scss +0 -0
- package/es/avatar/style/_index.scss +0 -0
- package/es/back-top/style/_index.scss +0 -0
- package/es/badge/style/_index.scss +0 -0
- package/es/breadcrumb/style/_index.scss +0 -0
- package/es/button/style/_index.scss +0 -0
- package/es/button/style/_mixin.scss +0 -0
- package/es/button/style/index.css +1 -1
- package/es/carousel/style/_index.scss +0 -0
- package/es/checkbox/style/_index.scss +0 -0
- package/es/collapse/style/_index.scss +0 -0
- package/es/date-picker/style/_index.scss +0 -0
- package/es/divider/style/_index.scss +0 -0
- package/es/empty/style/_index.scss +0 -0
- package/es/flip/style/_index.scss +0 -0
- package/es/form/style/_index.scss +0 -0
- package/es/grid/style/_index.scss +0 -0
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/input/style/_index.scss +0 -0
- package/es/input/style/_mixin.scss +0 -0
- package/es/input-number/style/_index.scss +0 -0
- package/es/input-password/style/_index.scss +0 -0
- package/es/layout/sidebar.js +2 -5
- package/es/layout/sidebar.js.map +1 -1
- package/es/layout/style/_index.scss +0 -0
- package/es/list/list.js.map +1 -1
- package/es/loader/style/_index.scss +0 -0
- package/es/loading-bar/style/_index.scss +0 -0
- package/es/message/style/_index.scss +0 -0
- package/es/modal/style/_index.scss +0 -0
- package/es/native-select/style/_index.scss +0 -0
- package/es/notification/style/_index.scss +0 -0
- package/es/overlay/style/_index.scss +0 -0
- package/es/pop-confirm/style/_index.scss +0 -0
- package/es/popover/style/_index.scss +0 -0
- package/es/popup/style/_index.scss +0 -0
- package/es/progress/style/_index.scss +0 -0
- package/es/radio/style/_index.scss +0 -0
- package/es/rate/rate.js +2 -5
- package/es/rate/rate.js.map +1 -1
- package/es/rate/style/_index.scss +0 -0
- package/es/split/style/_index.scss +0 -0
- package/es/style/_component.scss +1 -1
- package/es/style/base.css +12 -3
- package/es/style/index.scss +0 -0
- package/es/switch/style/_index.scss +0 -0
- package/es/switch/style/_mixin.scss +0 -0
- package/es/switch/style/index.css +3 -3
- package/es/table/table.js.map +1 -1
- package/es/tag/style/_index.scss +0 -0
- package/es/textarea/style/_index.scss +0 -0
- package/es/time-picker/style/_index.scss +0 -0
- package/es/timeline/style/_index.scss +0 -0
- package/es/tooltip/style/_index.scss +0 -0
- package/es/typography/heading.d.ts +2 -1
- package/es/typography/heading.js +11 -18
- package/es/typography/heading.js.map +1 -1
- package/es/typography/style/_index.scss +0 -18
- package/es/typography/style/index.css +0 -13
- package/es/typography/text.d.ts +2 -1
- package/es/typography/text.js +4 -2
- package/es/typography/text.js.map +1 -1
- package/es/typography/types.d.ts +1 -1
- package/es/with-spin/index.d.ts +1 -0
- package/es/with-spin/style/_index.scss +5 -0
- package/es/with-spin/style/index.css +3 -0
- package/es/with-spin/with-spin.d.ts +9 -0
- package/es/with-spin/with-spin.js +20 -0
- package/es/with-spin/with-spin.js.map +1 -0
- package/lib/alert/style/_index.scss +0 -0
- package/lib/alert/style/_mixin.scss +0 -0
- package/lib/avatar/style/_index.scss +0 -0
- package/lib/back-top/style/_index.scss +0 -0
- package/lib/badge/style/_index.scss +0 -0
- package/lib/breadcrumb/style/_index.scss +0 -0
- package/lib/button/style/_index.scss +0 -0
- package/lib/button/style/_mixin.scss +0 -0
- package/lib/button/style/index.css +1 -1
- package/lib/carousel/style/_index.scss +0 -0
- package/lib/checkbox/style/_index.scss +0 -0
- package/lib/collapse/style/_index.scss +0 -0
- package/lib/date-picker/style/_index.scss +0 -0
- package/lib/divider/style/_index.scss +0 -0
- package/lib/empty/style/_index.scss +0 -0
- package/lib/flip/style/_index.scss +0 -0
- package/lib/form/style/_index.scss +0 -0
- package/lib/grid/style/_index.scss +0 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +96 -96
- package/lib/input/style/_index.scss +0 -0
- package/lib/input/style/_mixin.scss +0 -0
- package/lib/input-number/style/_index.scss +0 -0
- package/lib/input-password/style/_index.scss +0 -0
- package/lib/layout/sidebar.js +2 -5
- package/lib/layout/sidebar.js.map +1 -1
- package/lib/layout/style/_index.scss +0 -0
- package/lib/list/list.js.map +1 -1
- package/lib/loader/style/_index.scss +0 -0
- package/lib/loading-bar/style/_index.scss +0 -0
- package/lib/message/style/_index.scss +0 -0
- package/lib/modal/style/_index.scss +0 -0
- package/lib/native-select/style/_index.scss +0 -0
- package/lib/notification/style/_index.scss +0 -0
- package/lib/overlay/style/_index.scss +0 -0
- package/lib/pop-confirm/style/_index.scss +0 -0
- package/lib/popover/style/_index.scss +0 -0
- package/lib/popup/style/_index.scss +0 -0
- package/lib/progress/style/_index.scss +0 -0
- package/lib/radio/style/_index.scss +0 -0
- package/lib/rate/rate.js +2 -5
- package/lib/rate/rate.js.map +1 -1
- package/lib/rate/style/_index.scss +0 -0
- package/lib/split/style/_index.scss +0 -0
- package/lib/style/_component.scss +1 -1
- package/lib/style/base.css +12 -3
- package/lib/style/index.scss +0 -0
- package/lib/switch/style/_index.scss +0 -0
- package/lib/switch/style/_mixin.scss +0 -0
- package/lib/switch/style/index.css +3 -3
- package/lib/table/table.js.map +1 -1
- package/lib/tag/style/_index.scss +0 -0
- package/lib/textarea/style/_index.scss +0 -0
- package/lib/time-picker/style/_index.scss +0 -0
- package/lib/timeline/style/_index.scss +0 -0
- package/lib/tooltip/style/_index.scss +0 -0
- package/lib/typography/heading.d.ts +2 -1
- package/lib/typography/heading.js +11 -18
- package/lib/typography/heading.js.map +1 -1
- package/lib/typography/style/_index.scss +0 -18
- package/lib/typography/style/index.css +0 -13
- package/lib/typography/text.d.ts +2 -1
- package/lib/typography/text.js +4 -2
- package/lib/typography/text.js.map +1 -1
- package/lib/typography/types.d.ts +1 -1
- package/lib/with-spin/style/_index.scss +5 -0
- package/lib/with-spin/style/index.css +3 -0
- package/lib/with-spin/with-spin.d.ts +9 -0
- package/lib/with-spin/with-spin.js +22 -0
- package/lib/with-spin/with-spin.js.map +1 -0
- package/package.json +19 -15
- package/es/icon/icon.d.ts +0 -8
- package/es/icon/icon.js +0 -25
- package/es/icon/icon.js.map +0 -1
- package/es/icon/index.d.ts +0 -1
- package/es/icon/index.js +0 -9
- package/es/icon/index.js.map +0 -1
- package/es/icon/style/_index.scss +0 -16
- package/es/icon/style/index.css +0 -987
- package/es/icon/types.d.ts +0 -15
- package/lib/icon/icon.d.ts +0 -8
- package/lib/icon/icon.js +0 -28
- package/lib/icon/icon.js.map +0 -1
- package/lib/icon/index.js +0 -8
- package/lib/icon/index.js.map +0 -1
- package/lib/icon/style/_index.scss +0 -16
- package/lib/icon/style/index.css +0 -987
- package/lib/icon/types.d.ts +0 -15
- /package/es/{icon → with-spin}/style/index.d.ts +0 -0
- /package/es/{icon → with-spin}/style/index.js +0 -0
- /package/lib/{icon → with-spin}/style/index.d.ts +0 -0
- /package/lib/{icon → with-spin}/style/index.js +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Di Wang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# @tiny-design/react
|
|
2
|
+
|
|
3
|
+
A friendly UI component library for React with 80+ components, theming, and i18n support.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @tiny-design/react @tiny-design/tokens
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @tiny-design/react @tiny-design/tokens
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Peer dependencies:** `react >= 18.0.0`, `react-dom >= 18.0.0`
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import '@tiny-design/tokens';
|
|
19
|
+
import { Button, ConfigProvider } from '@tiny-design/react';
|
|
20
|
+
|
|
21
|
+
function App() {
|
|
22
|
+
return (
|
|
23
|
+
<ConfigProvider theme="light">
|
|
24
|
+
<Button btnType="primary">Hello Tiny</Button>
|
|
25
|
+
</ConfigProvider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Components
|
|
31
|
+
|
|
32
|
+
### Layout
|
|
33
|
+
Flex, Layout, Row, Col, Space, Divider, AspectRatio
|
|
34
|
+
|
|
35
|
+
### Navigation
|
|
36
|
+
Anchor, Breadcrumb, Menu, Link, Pagination, Steps, Tabs
|
|
37
|
+
|
|
38
|
+
### Forms & Input
|
|
39
|
+
Input, InputNumber, InputPassword, Textarea, Button, Checkbox, Radio, Select, NativeSelect, AutoComplete, Cascader, DatePicker, TimePicker, ColorPicker, Slider, Switch, Rate, Segmented, Upload, Transfer, Form
|
|
40
|
+
|
|
41
|
+
### Data Display
|
|
42
|
+
Avatar, Badge, Card, Descriptions, Empty, Image, List, Table, Tag, Timeline, Tree, Typography, Progress, Statistic, Skeleton, Carousel
|
|
43
|
+
|
|
44
|
+
### Feedback
|
|
45
|
+
Modal, Drawer, Alert, Tooltip, Popover, PopConfirm, Notification, Message, Result, Loader, LoadingBar
|
|
46
|
+
|
|
47
|
+
### Other
|
|
48
|
+
Dropdown, SplitButton, Overlay, Countdown, CopyToClipboard, Flip, BackTop, Sticky, SpeedDial, Split, ScrollIndicator, StrengthIndicator, Transition
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
Use `ConfigProvider` to set global defaults:
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { ConfigProvider } from '@tiny-design/react';
|
|
56
|
+
|
|
57
|
+
<ConfigProvider
|
|
58
|
+
theme="dark"
|
|
59
|
+
componentSize="lg"
|
|
60
|
+
locale={zh_CN}
|
|
61
|
+
>
|
|
62
|
+
<App />
|
|
63
|
+
</ConfigProvider>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
| Prop | Type | Default | Description |
|
|
67
|
+
| --- | --- | --- | --- |
|
|
68
|
+
| `theme` | `'light' \| 'dark' \| 'system'` | `'light'` | Color theme |
|
|
69
|
+
| `componentSize` | `'sm' \| 'md' \| 'lg'` | `'md'` | Global component size |
|
|
70
|
+
| `locale` | `Locale` | `en_US` | Locale for i18n |
|
|
71
|
+
| `prefixCls` | `string` | `'ty'` | CSS class prefix |
|
|
72
|
+
|
|
73
|
+
## Theming
|
|
74
|
+
|
|
75
|
+
Toggle themes programmatically with the `useTheme` hook:
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { useTheme } from '@tiny-design/react';
|
|
79
|
+
|
|
80
|
+
function ThemeToggle() {
|
|
81
|
+
const { theme, setTheme } = useTheme();
|
|
82
|
+
return (
|
|
83
|
+
<button onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>
|
|
84
|
+
Current: {theme}
|
|
85
|
+
</button>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Theme preference is persisted to `localStorage` and the `system` option follows `prefers-color-scheme`.
|
|
91
|
+
|
|
92
|
+
## Localization
|
|
93
|
+
|
|
94
|
+
Built-in locales: `en_US`, `zh_CN`.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import { ConfigProvider, IntlProvider } from '@tiny-design/react';
|
|
98
|
+
import zh_CN from '@tiny-design/react/es/locale/zh_CN';
|
|
99
|
+
|
|
100
|
+
<ConfigProvider locale={zh_CN}>
|
|
101
|
+
<App />
|
|
102
|
+
</ConfigProvider>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
height: 1em;
|
|
52
52
|
position: relative;
|
|
53
53
|
border-width: 2px;
|
|
54
|
-
border-color:
|
|
54
|
+
border-color: currentcolor currentcolor transparent transparent;
|
|
55
55
|
border-style: solid;
|
|
56
56
|
border-radius: 50%;
|
|
57
57
|
animation: ty-rotate-reverse 600ms infinite linear;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/es/index.d.ts
CHANGED
|
@@ -28,7 +28,6 @@ import { Empty } from "./empty/empty.js";
|
|
|
28
28
|
import { Flex } from "./flex/flex.js";
|
|
29
29
|
import { DefaultFlip } from "./flip/index.js";
|
|
30
30
|
import { DefaultForm } from "./form/index.js";
|
|
31
|
-
import { Icon } from "./icon/icon.js";
|
|
32
31
|
import { Image } from "./image/image.js";
|
|
33
32
|
import { DefaultInput } from "./input/index.js";
|
|
34
33
|
import { InputNumber } from "./input-number/input-number.js";
|
|
@@ -81,8 +80,9 @@ import { Tree } from "./tree/tree.js";
|
|
|
81
80
|
import { DefaultTypo } from "./typography/index.js";
|
|
82
81
|
import { Upload } from "./upload/upload.js";
|
|
83
82
|
import { withLocale } from "./intl-provider/with-locale.js";
|
|
83
|
+
import { withSpin } from "./with-spin/with-spin.js";
|
|
84
84
|
import { en_US } from "./locale/en_US.js";
|
|
85
85
|
import { zh_CN } from "./locale/zh_CN.js";
|
|
86
86
|
import { useLocale } from "./_utils/use-locale.js";
|
|
87
87
|
import { ThemeMode, useTheme } from "./_utils/use-theme.js";
|
|
88
|
-
export { Alert, DefaultAnchor as Anchor, AspectRatio, AutoComplete, DefaultAvatar as Avatar, BackTop, Badge, DefaultBreadcrumb as Breadcrumb, DefaultButton as Button, Calendar, DefaultCard as Card, DefaultCarousel as Carousel, Cascader, DefaultCheckbox as Checkbox, Col, DefaultCollapse as Collapse, ColorPicker, ConfigProvider, CopyToClipboard, Countdown, DatePicker, DefaultDesc as Descriptions, Divider, Drawer, Dropdown, Empty, Flex, DefaultFlip as Flip, DefaultForm as Form,
|
|
88
|
+
export { Alert, DefaultAnchor as Anchor, AspectRatio, AutoComplete, DefaultAvatar as Avatar, BackTop, Badge, DefaultBreadcrumb as Breadcrumb, DefaultButton as Button, Calendar, DefaultCard as Card, DefaultCarousel as Carousel, Cascader, DefaultCheckbox as Checkbox, Col, DefaultCollapse as Collapse, ColorPicker, ConfigProvider, CopyToClipboard, Countdown, DatePicker, DefaultDesc as Descriptions, Divider, Drawer, Dropdown, Empty, Flex, DefaultFlip as Flip, DefaultForm as Form, Image, DefaultInput as Input, InputNumber, InputPassword, IntlProvider, Keyboard, DefaultLayout as Layout, Link, DefaultList as List, Loader, _default as LoadingBar, type Locale, DefaultMenu as Menu, messageContainer as Message, ModalWithContext as Modal, DefaultSelect as NativeSelect, notificationContainer as Notification, Overlay, Pagination, PopConfirm, Popover, Progress, DefaultRadio as Radio, Rate, Result, Row, ScrollIndicator, Segmented, DefaultSelect$1 as Select, Skeleton, Slider, Space, DefaultSpeedDial as SpeedDial, Split, SplitButton, Statistic, DefaultSteps as Steps, Sticky, StrengthIndicator, Switch, Table, DefaultTabs as Tabs, DefaultTag as Tag, Textarea, type ThemeMode, TimePicker, DefaultTimeline as Timeline, Tooltip, Transfer, Transition, Tree, DefaultTypo as Typography, Upload, en_US, useLocale, useTheme, withLocale, withSpin, zh_CN };
|
package/es/index.js
CHANGED
|
@@ -34,7 +34,6 @@ import empty_default from "./empty/index.js";
|
|
|
34
34
|
import flex_default from "./flex/index.js";
|
|
35
35
|
import DefaultFlip from "./flip/index.js";
|
|
36
36
|
import DefaultForm from "./form/index.js";
|
|
37
|
-
import icon_default from "./icon/index.js";
|
|
38
37
|
import image_default from "./image/index.js";
|
|
39
38
|
import DefaultInput from "./input/index.js";
|
|
40
39
|
import input_number_default from "./input-number/index.js";
|
|
@@ -83,6 +82,7 @@ import tree_default from "./tree/index.js";
|
|
|
83
82
|
import DefaultTypo from "./typography/index.js";
|
|
84
83
|
import upload_default from "./upload/index.js";
|
|
85
84
|
import { withLocale } from "./intl-provider/with-locale.js";
|
|
85
|
+
import { withSpin } from "./with-spin/with-spin.js";
|
|
86
86
|
import zh_CN from "./locale/zh_CN.js";
|
|
87
87
|
import { useTheme } from "./_utils/use-theme.js";
|
|
88
|
-
export { alert_default as Alert, DefaultAnchor as Anchor, aspect_ratio_default as AspectRatio, AutoComplete, DefaultAvatar as Avatar, back_top_default as BackTop, badge_default as Badge, DefaultBreadcrumb as Breadcrumb, DefaultButton as Button, calendar_default as Calendar, DefaultCard as Card, DefaultCarousel as Carousel, cascader_default as Cascader, DefaultCheckbox as Checkbox, col_default as Col, DefaultCollapse as Collapse, color_picker_default as ColorPicker, config_provider_default as ConfigProvider, copy_to_clipboard_default as CopyToClipboard, countdown_default as Countdown, date_picker_default as DatePicker, DefaultDesc as Descriptions, divider_default as Divider, drawer_default as Drawer, dropdown_default as Dropdown, empty_default as Empty, flex_default as Flex, DefaultFlip as Flip, DefaultForm as Form,
|
|
88
|
+
export { alert_default as Alert, DefaultAnchor as Anchor, aspect_ratio_default as AspectRatio, AutoComplete, DefaultAvatar as Avatar, back_top_default as BackTop, badge_default as Badge, DefaultBreadcrumb as Breadcrumb, DefaultButton as Button, calendar_default as Calendar, DefaultCard as Card, DefaultCarousel as Carousel, cascader_default as Cascader, DefaultCheckbox as Checkbox, col_default as Col, DefaultCollapse as Collapse, color_picker_default as ColorPicker, config_provider_default as ConfigProvider, copy_to_clipboard_default as CopyToClipboard, countdown_default as Countdown, date_picker_default as DatePicker, DefaultDesc as Descriptions, divider_default as Divider, drawer_default as Drawer, dropdown_default as Dropdown, empty_default as Empty, flex_default as Flex, DefaultFlip as Flip, DefaultForm as Form, image_default as Image, DefaultInput as Input, input_number_default as InputNumber, input_password_default as InputPassword, intl_provider_default as IntlProvider, keyboard_default as Keyboard, DefaultLayout as Layout, link_default as Link, DefaultList as List, loader_default as Loader, loading_bar_default as LoadingBar, DefaultMenu as Menu, message_default as Message, ModalWithContext as Modal, DefaultSelect as NativeSelect, notification_default as Notification, overlay_default as Overlay, pagination_default as Pagination, pop_confirm_default as PopConfirm, popover_default as Popover, Progress, DefaultRadio as Radio, rate_default as Rate, result_default as Result, row_default as Row, scroll_indicator_default as ScrollIndicator, segmented_default as Segmented, DefaultSelect$1 as Select, skeleton_default as Skeleton, slider_default as Slider, space_default as Space, DefaultSpeedDial as SpeedDial, split_default as Split, split_button_default as SplitButton, statistic_default as Statistic, DefaultSteps as Steps, sticky_default as Sticky, strength_indicator_default as StrengthIndicator, switch_default as Switch, table_default as Table, DefaultTabs as Tabs, DefaultTag as Tag, textarea_default as Textarea, time_picker_default as TimePicker, DefaultTimeline as Timeline, tooltip_default as Tooltip, transfer_default as Transfer, transition_default as Transition, tree_default as Tree, DefaultTypo as Typography, upload_default as Upload, en_US, useLocale, useTheme, withLocale, withSpin, zh_CN };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/es/layout/sidebar.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ConfigContext } from "../config-provider/config-context.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/general.js";
|
|
3
|
-
import icon_default from "../icon/index.js";
|
|
4
3
|
import { SidebarContext } from "./sidebar-context.js";
|
|
5
4
|
import React, { useContext, useEffect, useState } from "react";
|
|
6
5
|
import classNames from "classnames";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { IconLeft } from "@tiny-design/icons";
|
|
8
8
|
//#region src/layout/sidebar.tsx
|
|
9
9
|
const Sidebar = React.forwardRef((props, ref) => {
|
|
10
10
|
const { defaultCollapsed = false, width = 200, collapsedWidth = 70, theme = "light", trigger = null, collapsible = false, onCollapse, className, style, children, prefixCls: customisedCls, ...otherProps } = props;
|
|
@@ -32,10 +32,7 @@ const Sidebar = React.forwardRef((props, ref) => {
|
|
|
32
32
|
className: `${prefixCls}__trigger`,
|
|
33
33
|
onClick: _collapseBtnOnClick,
|
|
34
34
|
"aria-label": "Toggle sidebar",
|
|
35
|
-
children: /* @__PURE__ */ jsx(
|
|
36
|
-
name: "left",
|
|
37
|
-
className: `${prefixCls}__trigger-icon`
|
|
38
|
-
})
|
|
35
|
+
children: /* @__PURE__ */ jsx(IconLeft, { className: `${prefixCls}__trigger-icon` })
|
|
39
36
|
});
|
|
40
37
|
};
|
|
41
38
|
useEffect(() => {
|
package/es/layout/sidebar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.js","names":[
|
|
1
|
+
{"version":3,"file":"sidebar.js","names":[],"sources":["../../src/layout/sidebar.tsx"],"sourcesContent":["import React from 'react';\nimport { useState, useContext, useEffect } from 'react';\nimport classNames from 'classnames';\nimport { IconLeft } from '@tiny-design/icons';\nimport { SidebarContext } from './sidebar-context';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { SidebarProps } from './types';\n\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(\n (props: SidebarProps, ref): JSX.Element => {\n const {\n defaultCollapsed = false,\n width = 200,\n collapsedWidth = 70,\n theme = 'light',\n trigger = null,\n collapsible = false,\n onCollapse,\n className,\n style,\n children,\n prefixCls: customisedCls,\n ...otherProps\n } = props;\n\n const [sideCollapsed, setSideCollapsed] = useState(\n 'collapsed' in props ? props.collapsed : defaultCollapsed\n );\n const sidebarContext = useContext(SidebarContext);\n const sidebarWidth = sideCollapsed ? collapsedWidth : width;\n\n const outerStyle = {\n ...style,\n width: sidebarWidth,\n maxWidth: sidebarWidth,\n minWidth: sidebarWidth,\n };\n\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('layout-sidebar', configContext.prefixCls, customisedCls);\n const cls = classNames(prefixCls, className, {\n [`${prefixCls}_light`]: theme === 'light',\n });\n\n const _collapseBtnOnClick = () => {\n const collapsedVal = !sideCollapsed;\n if (!('collapsed' in props)) {\n setSideCollapsed(collapsedVal);\n }\n onCollapse && onCollapse(collapsedVal);\n };\n\n const renderTrigger = () => {\n if (!collapsible) {\n return null;\n }\n\n if (trigger) {\n return trigger;\n }\n\n return (\n <button type=\"button\" className={`${prefixCls}__trigger`} onClick={_collapseBtnOnClick} aria-label=\"Toggle sidebar\">\n <IconLeft className={`${prefixCls}__trigger-icon`} />\n </button>\n );\n };\n\n useEffect(() => {\n 'collapsed' in props && setSideCollapsed(props.collapsed);\n sidebarContext.addSidebar();\n\n return () => {\n sidebarContext.removeSidebar();\n };\n }, [props, sidebarContext]);\n\n return (\n <div {...otherProps} ref={ref} className={cls} style={outerStyle}>\n <div className={`${prefixCls}__children`}>{children}</div>\n {renderTrigger()}\n </div>\n );\n }\n);\n\nSidebar.displayName = 'Sidebar';\n\nexport default Sidebar;\n"],"mappings":";;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ED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","names":["Pagination"],"sources":["../../src/list/list.tsx"],"sourcesContent":["import React, { useContext, useState } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { useVirtualScroll } from '../_utils/use-virtual-scroll';\nimport Pagination from '../pagination';\nimport { ListProps } from './types';\n\nconst ITEM_HEIGHT_MAP = { sm: 41, md: 49, lg: 57 } as const;\n\nconst List = React.forwardRef<HTMLDivElement, ListProps>((props, ref) => {\n const {\n dataSource = [],\n renderItem,\n header,\n footer,\n loading = false,\n bordered = false,\n split = true,\n size,\n grid,\n locale,\n virtual = false,\n height,\n itemHeight: itemHeightProp,\n pagination,\n prefixCls: customisedCls,\n className,\n style,\n children,\n ...otherProps\n } = props;\n\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('list', configContext.prefixCls, customisedCls);\n const listSize = size || configContext.componentSize || 'md';\n\n if (virtual && height == null) {\n console.warn('[tiny-
|
|
1
|
+
{"version":3,"file":"list.js","names":["Pagination"],"sources":["../../src/list/list.tsx"],"sourcesContent":["import React, { useContext, useState } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { useVirtualScroll } from '../_utils/use-virtual-scroll';\nimport Pagination from '../pagination';\nimport { ListProps } from './types';\n\nconst ITEM_HEIGHT_MAP = { sm: 41, md: 49, lg: 57 } as const;\n\nconst List = React.forwardRef<HTMLDivElement, ListProps>((props, ref) => {\n const {\n dataSource = [],\n renderItem,\n header,\n footer,\n loading = false,\n bordered = false,\n split = true,\n size,\n grid,\n locale,\n virtual = false,\n height,\n itemHeight: itemHeightProp,\n pagination,\n prefixCls: customisedCls,\n className,\n style,\n children,\n ...otherProps\n } = props;\n\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('list', configContext.prefixCls, customisedCls);\n const listSize = size || configContext.componentSize || 'md';\n\n if (virtual && height == null) {\n console.warn('[tiny-design: List] `height` is required when `virtual` is enabled.');\n }\n if (virtual && grid) {\n console.warn('[tiny-design: List] `virtual` is not supported with `grid` mode. Falling back to normal rendering.');\n }\n\n const isVirtual = virtual && height != null && !grid;\n\n const [currentPage, setCurrentPage] = useState(1);\n const pageSize = pagination && pagination.pageSize ? pagination.pageSize : 10;\n\n const itemHeight = itemHeightProp ?? ITEM_HEIGHT_MAP[listSize] ?? ITEM_HEIGHT_MAP.md;\n const { visibleRange, totalHeight, offsetY, onScroll } = useVirtualScroll({\n itemCount: dataSource.length,\n itemHeight,\n containerHeight: height ?? 0,\n });\n\n const cls = classNames(prefixCls, className, {\n [`${prefixCls}_${listSize}`]: listSize,\n [`${prefixCls}_bordered`]: bordered,\n [`${prefixCls}_split`]: split,\n [`${prefixCls}_loading`]: loading,\n [`${prefixCls}_grid`]: grid,\n });\n\n const paginatedData = () => {\n if (!pagination) return dataSource;\n const page = pagination.current ?? currentPage;\n const start = (page - 1) * pageSize;\n return dataSource.slice(start, start + pageSize);\n };\n\n const handlePageChange = (page: number) => {\n setCurrentPage(page);\n pagination && pagination.onChange?.(page, pageSize);\n };\n\n const renderItems = () => {\n if (isVirtual) {\n if (dataSource.length === 0) {\n return (\n <div className={`${prefixCls}__empty`}>\n {locale?.emptyText ?? 'No Data'}\n </div>\n );\n }\n if (renderItem) {\n const [start, end] = visibleRange;\n const visibleItems = dataSource.slice(start, end + 1).map((item, i) => renderItem(item, start + i));\n return (\n <div style={{ height: totalHeight, position: 'relative' }}>\n <div style={{ position: 'absolute', top: 0, left: 0, right: 0, transform: `translateY(${offsetY}px)` }}>\n {visibleItems}\n </div>\n </div>\n );\n }\n return children;\n }\n\n const items = paginatedData();\n if (items.length === 0 && !children) {\n return (\n <div className={`${prefixCls}__empty`}>\n {locale?.emptyText ?? 'No Data'}\n </div>\n );\n }\n if (renderItem) {\n const rendered = items.map((item, index) => renderItem(item, index));\n if (grid) {\n return (\n <div\n className={`${prefixCls}__grid`}\n style={{\n display: 'grid',\n gridTemplateColumns: `repeat(${grid.column || 3}, 1fr)`,\n gap: grid.gutter ? `${grid.gutter}px` : undefined,\n }}\n >\n {rendered}\n </div>\n );\n }\n return rendered;\n }\n return children;\n };\n\n const showPagination = pagination && !isVirtual;\n const paginationConfig = pagination && typeof pagination === 'object' ? pagination : undefined;\n const totalItems = paginationConfig?.total ?? dataSource.length;\n const activePage = paginationConfig?.current ?? currentPage;\n\n const bodyCls = classNames(`${prefixCls}__body`, {\n [`${prefixCls}__body_virtual`]: isVirtual,\n });\n\n const bodyStyle: React.CSSProperties | undefined = isVirtual\n ? { height, overflowY: 'auto' }\n : undefined;\n\n return (\n <div {...otherProps} ref={ref} className={cls} style={style}>\n {header && <div className={`${prefixCls}__header`}>{header}</div>}\n <div className={bodyCls} style={bodyStyle} onScroll={isVirtual ? onScroll : undefined}>\n {loading ? (\n <div className={`${prefixCls}__loading`}>Loading...</div>\n ) : (\n renderItems()\n )}\n </div>\n {footer && <div className={`${prefixCls}__footer`}>{footer}</div>}\n {showPagination && (\n <Pagination\n current={activePage}\n total={totalItems}\n pageSize={pageSize}\n align={paginationConfig?.align ?? 'right'}\n size={paginationConfig?.size}\n disabled={paginationConfig?.disabled}\n onChange={(page) => handlePageChange(page)}\n style={{ padding: 16 }}\n />\n )}\n </div>\n );\n});\n\nList.displayName = 'List';\nexport default List;\n"],"mappings":";;;;;;;;AAQA,MAAM,kBAAkB;CAAE,IAAI;CAAI,IAAI;CAAI,IAAI;CAAI;AAElD,MAAM,OAAO,MAAM,YAAuC,OAAO,QAAQ;CACvE,MAAM,EACJ,aAAa,EAAE,EACf,YACA,QACA,QACA,UAAU,OACV,WAAW,OACX,QAAQ,MACR,MACA,MACA,QACA,UAAU,OACV,QACA,YAAY,gBACZ,YACA,WAAW,eACX,WACA,OACA,UACA,GAAG,eACD;CAEJ,MAAM,gBAAgB,WAAW,cAAc;CAC/C,MAAM,YAAY,aAAa,QAAQ,cAAc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AAU;cAAY;IAAa,CAAA;GAChE,kBACC,oBAACA,oBAAD;IACE,SAAS;IACT,OAAO;IACG;IACV,OAAO,kBAAkB,SAAS;IAClC,MAAM,kBAAkB;IACxB,UAAU,kBAAkB;IAC5B,WAAW,SAAS,iBAAiB,KAAK;IAC1C,OAAO,EAAE,SAAS,IAAI;IACtB,CAAA;GAEA;;EAER;AAEF,KAAK,cAAc"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/es/rate/rate.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { ConfigContext } from "../config-provider/config-context.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/general.js";
|
|
3
|
-
import icon_default from "../icon/index.js";
|
|
4
3
|
import RateItem from "./rate-item.js";
|
|
5
4
|
import React, { useContext, useEffect, useState } from "react";
|
|
6
5
|
import classNames from "classnames";
|
|
7
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { IconStarFill } from "@tiny-design/icons";
|
|
8
8
|
//#region src/rate/rate.tsx
|
|
9
9
|
const Rate = React.forwardRef((props, ref) => {
|
|
10
|
-
const { color = "#FADB14", character = /* @__PURE__ */ jsx(
|
|
11
|
-
name: "star-fill",
|
|
12
|
-
size: 20
|
|
13
|
-
}), clearable = true, half = false, count = 5, defaultValue = 0, disabled = false, onChange, className, style, prefixCls: customisedCls, ...otherProps } = props;
|
|
10
|
+
const { color = "#FADB14", character = /* @__PURE__ */ jsx(IconStarFill, { size: 20 }), clearable = true, half = false, count = 5, defaultValue = 0, disabled = false, onChange, className, style, prefixCls: customisedCls, ...otherProps } = props;
|
|
14
11
|
const prefixCls = getPrefixCls("rate", useContext(ConfigContext).prefixCls, customisedCls);
|
|
15
12
|
const cls = classNames(prefixCls, className);
|
|
16
13
|
const [value, setValue] = useState("value" in props ? props.value : defaultValue);
|
package/es/rate/rate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate.js","names":[
|
|
1
|
+
{"version":3,"file":"rate.js","names":[],"sources":["../../src/rate/rate.tsx"],"sourcesContent":["import React, { useState, useEffect, useContext } from 'react';\nimport classNames from 'classnames';\nimport { IconStarFill } from '@tiny-design/icons';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { RateProps } from './types';\nimport RateItem from './rate-item';\n\nconst Rate = React.forwardRef<HTMLUListElement, RateProps>(\n (props: RateProps, ref): JSX.Element => {\n const {\n color = '#FADB14',\n character = <IconStarFill size={20} />,\n clearable = true,\n half = false,\n count = 5,\n defaultValue = 0,\n disabled = false,\n onChange,\n className,\n style,\n prefixCls: customisedCls,\n ...otherProps\n } = props;\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('rate', configContext.prefixCls, customisedCls);\n const cls = classNames(prefixCls, className);\n const [value, setValue] = useState<number>(\n 'value' in props ? (props.value as number) : defaultValue\n );\n // tepValue is for setting the value when the mouse is hovering the bar\n const [tmpValue, setTmpValue] = useState<number>(\n 'value' in props ? (props.value as number) : defaultValue\n );\n\n /**\n * Callback when the mouse enters each star item\n * @param index\n */\n const onMouseEnter = (index: number): void => {\n !disabled && setTmpValue(index);\n };\n\n const onClick = (): void => {\n if (!disabled && clearable) {\n const val = tmpValue === value ? 0 : tmpValue;\n setTmpValue(val);\n !('value' in props) && setValue(val);\n onChange && onChange(val);\n } else {\n !('value' in props) && setValue(tmpValue);\n onChange && onChange(tmpValue);\n }\n };\n\n /**\n * When the mouse leaves the rate component\n */\n const onMouseLeave = (): void => {\n setTmpValue(value);\n };\n\n useEffect(() => {\n 'value' in props && setValue(props.value as number);\n }, [props]);\n\n return (\n <ul\n {...otherProps}\n ref={ref}\n className={cls}\n style={style}\n role=\"radiogroup\"\n aria-label=\"Rating\"\n tabIndex={disabled ? -1 : 0}\n onMouseLeave={onMouseLeave}\n onKeyDown={(e: React.KeyboardEvent) => {\n if (disabled) return;\n if (e.key === 'ArrowRight' || e.key === 'ArrowUp') {\n e.preventDefault();\n const step = half ? 0.5 : 1;\n const newVal = Math.min(tmpValue + step, count);\n setTmpValue(newVal);\n !('value' in props) && setValue(newVal);\n onChange?.(newVal);\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') {\n e.preventDefault();\n const step = half ? 0.5 : 1;\n const newVal = Math.max(tmpValue - step, 0);\n setTmpValue(newVal);\n !('value' in props) && setValue(newVal);\n onChange?.(newVal);\n }\n }}>\n {Array(count)\n .fill(0)\n .map((_, idx) => (\n <RateItem\n key={idx}\n index={idx + 1}\n half={half}\n character={character}\n prefixCls={prefixCls}\n onMouseEnter={onMouseEnter}\n onClick={onClick}\n value={half ? tmpValue : Math.round(tmpValue)}\n color={color}\n />\n ))}\n </ul>\n );\n }\n);\n\nRate.displayName = 'Rate';\n\nexport default Rate;\n"],"mappings":";;;;;;;;AAQA,MAAM,OAAO,MAAM,YAChB,OAAkB,QAAqB;CACtC,MAAM,EACJ,QAAQ,WACR,YAAY,oBAAC,cAAD,EAAc,MAAM,IAAM,CAAA,EACtC,YAAY,MACZ,OAAO,OACP,QAAQ,GACR,eAAe,GACf,WAAW,OACX,UACA,WACA,OACA,WAAW,eACX,GAAG,eACD;CAEJ,MAAM,YAAY,aAAa,QADT,WAAW,cAAc,CACM,WAAW,cAAc;CAC9E,MAAM,MAAM,WAAW,WAAW,UAAU;CAC5C,MAAM,CAAC,OAAO,YAAY,SACxB,WAAW,QAAS,MAAM,QAAmB,aAC9C;CAED,MAAM,CAAC,UAAU,eAAe,SAC9B,WAAW,QAAS,MAAM,QAAmB,aAC9C;;;;;CAMD,MAAM,gBAAgB,UAAwB;AAC5C,GAAC,YAAY,YAAY,MAAM;;CAGjC,MAAM,gBAAsB;AAC1B,MAAI,CAAC,YAAY,WAAW;GAC1B,MAAM,MAAM,aAAa,QAAQ,IAAI;AACrC,eAAY,IAAI;AAChB,KAAE,WAAW,UAAU,SAAS,IAAI;AACpC,eAAY,SAAS,IAAI;SACpB;AACL,KAAE,WAAW,UAAU,SAAS,SAAS;AACzC,eAAY,SAAS,SAAS;;;;;;CAOlC,MAAM,qBAA2B;AAC/B,cAAY,MAAM;;AAGpB,iBAAgB;AACd,aAAW,SAAS,SAAS,MAAM,MAAgB;IAClD,CAAC,MAAM,CAAC;AAEX,QACE,oBAAC,MAAD;EACE,GAAI;EACC;EACL,WAAW;EACJ;EACP,MAAK;EACL,cAAW;EACX,UAAU,WAAW,KAAK;EACZ;EACd,YAAY,MAA2B;AACrC,OAAI,SAAU;AACd,OAAI,EAAE,QAAQ,gBAAgB,EAAE,QAAQ,WAAW;AACjD,MAAE,gBAAgB;IAClB,MAAM,OAAO,OAAO,KAAM;IAC1B,MAAM,SAAS,KAAK,IAAI,WAAW,MAAM,MAAM;AAC/C,gBAAY,OAAO;AACnB,MAAE,WAAW,UAAU,SAAS,OAAO;AACvC,eAAW,OAAO;cACT,EAAE,QAAQ,eAAe,EAAE,QAAQ,aAAa;AACzD,MAAE,gBAAgB;IAClB,MAAM,OAAO,OAAO,KAAM;IAC1B,MAAM,SAAS,KAAK,IAAI,WAAW,MAAM,EAAE;AAC3C,gBAAY,OAAO;AACnB,MAAE,WAAW,UAAU,SAAS,OAAO;AACvC,eAAW,OAAO;;;YAGrB,MAAM,MAAM,CACV,KAAK,EAAE,CACP,KAAK,GAAG,QACP,oBAAC,UAAD;GAEE,OAAO,MAAM;GACP;GACK;GACA;GACG;GACL;GACT,OAAO,OAAO,WAAW,KAAK,MAAM,SAAS;GACtC;GACP,EATK,IASL,CACF;EACD,CAAA;EAGV;AAED,KAAK,cAAc"}
|
|
File without changes
|
|
File without changes
|
package/es/style/_component.scss
CHANGED
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
@use "../flip/style/index" as *;
|
|
26
26
|
@use "../form/style/index" as *;
|
|
27
27
|
@use "../grid/style/index" as *;
|
|
28
|
-
@use "../icon/style/index" as *;
|
|
29
28
|
@use "../image/style/index" as *;
|
|
30
29
|
@use "../input/style/index" as *;
|
|
31
30
|
@use "../input-number/style/index" as *;
|
|
@@ -76,3 +75,4 @@
|
|
|
76
75
|
@use "../tree/style/index" as *;
|
|
77
76
|
@use "../typography/style/index" as *;
|
|
78
77
|
@use "../upload/style/index" as *;
|
|
78
|
+
@use "../with-spin/style/index" as *;
|
package/es/style/base.css
CHANGED
|
@@ -800,6 +800,7 @@ html[data-tiny-theme=dark] {
|
|
|
800
800
|
--ty-calendar-hover: #2a2a2a;
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
|
+
/* stylelint-disable scss/comment-no-empty */
|
|
803
804
|
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
|
804
805
|
/**
|
|
805
806
|
* 1. Correct the line height in all browsers.
|
|
@@ -808,7 +809,9 @@ html[data-tiny-theme=dark] {
|
|
|
808
809
|
html {
|
|
809
810
|
font-size: 14px;
|
|
810
811
|
line-height: 1.15; /* 1 */
|
|
811
|
-
-webkit-text-size-adjust: 100%;
|
|
812
|
+
-webkit-text-size-adjust: 100%;
|
|
813
|
+
-moz-text-size-adjust: 100%;
|
|
814
|
+
text-size-adjust: 100%; /* 2 */
|
|
812
815
|
}
|
|
813
816
|
|
|
814
817
|
/* Sections
|
|
@@ -1000,6 +1003,8 @@ button,
|
|
|
1000
1003
|
[type=reset],
|
|
1001
1004
|
[type=submit] {
|
|
1002
1005
|
-webkit-appearance: button;
|
|
1006
|
+
-moz-appearance: button;
|
|
1007
|
+
appearance: button;
|
|
1003
1008
|
}
|
|
1004
1009
|
|
|
1005
1010
|
/**
|
|
@@ -1082,7 +1087,9 @@ textarea {
|
|
|
1082
1087
|
* 2. Correct the outline style in Safari.
|
|
1083
1088
|
*/
|
|
1084
1089
|
[type=search] {
|
|
1085
|
-
-webkit-appearance: textfield;
|
|
1090
|
+
-webkit-appearance: textfield;
|
|
1091
|
+
-moz-appearance: textfield;
|
|
1092
|
+
appearance: textfield; /* 1 */
|
|
1086
1093
|
outline-offset: -2px; /* 2 */
|
|
1087
1094
|
}
|
|
1088
1095
|
|
|
@@ -1091,6 +1098,7 @@ textarea {
|
|
|
1091
1098
|
*/
|
|
1092
1099
|
[type=search]::-webkit-search-decoration {
|
|
1093
1100
|
-webkit-appearance: none;
|
|
1101
|
+
appearance: none;
|
|
1094
1102
|
}
|
|
1095
1103
|
|
|
1096
1104
|
/**
|
|
@@ -1098,7 +1106,8 @@ textarea {
|
|
|
1098
1106
|
* 2. Change font properties to `inherit` in Safari.
|
|
1099
1107
|
*/
|
|
1100
1108
|
::-webkit-file-upload-button {
|
|
1101
|
-
-webkit-appearance: button;
|
|
1109
|
+
-webkit-appearance: button;
|
|
1110
|
+
appearance: button; /* 1 */
|
|
1102
1111
|
font: inherit; /* 2 */
|
|
1103
1112
|
}
|
|
1104
1113
|
|
package/es/style/index.scss
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
height: 1em;
|
|
113
113
|
position: relative;
|
|
114
114
|
border-width: 2px;
|
|
115
|
-
border-color:
|
|
115
|
+
border-color: currentcolor currentcolor transparent transparent;
|
|
116
116
|
border-style: solid;
|
|
117
117
|
border-radius: 50%;
|
|
118
118
|
animation: ty-rotate-reverse 600ms infinite linear;
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
height: 1em;
|
|
145
145
|
position: relative;
|
|
146
146
|
border-width: 2px;
|
|
147
|
-
border-color:
|
|
147
|
+
border-color: currentcolor currentcolor transparent transparent;
|
|
148
148
|
border-style: solid;
|
|
149
149
|
border-radius: 50%;
|
|
150
150
|
animation: ty-rotate-reverse 600ms infinite linear;
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
height: 1em;
|
|
177
177
|
position: relative;
|
|
178
178
|
border-width: 2px;
|
|
179
|
-
border-color:
|
|
179
|
+
border-color: currentcolor currentcolor transparent transparent;
|
|
180
180
|
border-style: solid;
|
|
181
181
|
border-radius: 50%;
|
|
182
182
|
animation: ty-rotate-reverse 600ms infinite linear;
|