@antscorp/antsomi-ui 1.3.5-beta.928 → 1.3.5-beta.929
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/es/components/atoms/Icon/index.d.ts +0 -1
- package/es/components/atoms/Switch/Switch.d.ts +13 -3
- package/es/components/atoms/Switch/Switch.js +8 -3
- package/es/components/atoms/Switch/index.d.ts +1 -2
- package/es/components/atoms/Switch/styled.d.ts +2 -0
- package/es/components/atoms/Switch/styled.js +60 -0
- package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +1 -0
- package/es/components/organism/LeftMenu/types/index.d.ts +0 -1
- package/es/components/template/TemplateListing/Loadable.d.ts +1 -0
- package/es/providers/ConfigProvider/GlobalStyle.js +0 -40
- package/es/types/richMenu.d.ts +0 -1
- package/package.json +1 -1
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SwitchProps as AntdSwitchProps } from 'antd';
|
|
3
|
+
import { DataType } from 'csstype';
|
|
4
|
+
declare module 'react' {
|
|
5
|
+
interface CSSProperties {
|
|
6
|
+
'--switch-color'?: DataType.Color;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
type SwitchProps = AntdSwitchProps & {
|
|
10
|
+
color?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const Switch: React.FC<SwitchProps>;
|
|
13
|
+
export { Switch, type SwitchProps };
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
3
|
+
import { StyledSwitch } from './styled';
|
|
4
|
+
const Switch = props => {
|
|
5
|
+
const { color = THEME.token?.colorPrimary || '#005eb8', ...rest } = props;
|
|
6
|
+
return _jsx(StyledSwitch, { style: { '--switch-color': color }, ...rest });
|
|
7
|
+
};
|
|
8
|
+
export { Switch };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { Switch } from './Switch';
|
|
2
|
-
export type { SwitchProps } from 'antd';
|
|
1
|
+
export { Switch, type SwitchProps } from './Switch';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
2
|
+
import { Switch } from 'antd';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
export const StyledSwitch = styled(Switch) `
|
|
5
|
+
&.antsomi-switch {
|
|
6
|
+
border: 2px solid var(--switch-color);
|
|
7
|
+
|
|
8
|
+
&.antsomi-switch-checked {
|
|
9
|
+
background: var(--switch-color);
|
|
10
|
+
|
|
11
|
+
> .antsomi-switch-handle {
|
|
12
|
+
&::before {
|
|
13
|
+
background-color: ${THEME.token?.bw0};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.antsomi-switch-inner {
|
|
18
|
+
padding-inline-start: 4px;
|
|
19
|
+
padding-inline-end: 18px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:hover:not(.antsomi-switch-disabled) {
|
|
23
|
+
background-color: var(--switch-color);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.antsomi-switch-disabled {
|
|
28
|
+
background: ${THEME.token?.bw0};
|
|
29
|
+
border-color: ${THEME.token?.colorTextPlaceholder};
|
|
30
|
+
|
|
31
|
+
> .antsomi-switch-handle {
|
|
32
|
+
&::before {
|
|
33
|
+
background-color: ${THEME.token?.colorTextPlaceholder};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.antsomi-switch-checked {
|
|
38
|
+
background: ${THEME.token?.colorTextPlaceholder};
|
|
39
|
+
border-color: ${THEME.token?.colorTextPlaceholder};
|
|
40
|
+
|
|
41
|
+
> .antsomi-switch-handle {
|
|
42
|
+
&::before {
|
|
43
|
+
background-color: ${THEME.token?.bw0};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.antsomi-switch-handle {
|
|
50
|
+
&::before {
|
|
51
|
+
background-color: var(--switch-color);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.antsomi-switch-inner {
|
|
56
|
+
padding-inline-start: 4px;
|
|
57
|
+
padding-inline-end: 18px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
@@ -999,46 +999,6 @@ export const GlobalStyle = () => (_jsx(Global, { styles: css `
|
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
|
-
/* Switch */
|
|
1003
|
-
.antsomi-switch {
|
|
1004
|
-
border: 2px solid ${THEME.token?.colorPrimary} !important;
|
|
1005
|
-
|
|
1006
|
-
&.antsomi-switch-checked {
|
|
1007
|
-
> .antsomi-switch-handle {
|
|
1008
|
-
&::before {
|
|
1009
|
-
background-color: ${THEME.token?.bw0} !important;
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
&.antsomi-switch-disabled[aria-checked='true'] {
|
|
1015
|
-
background-color: ${THEME.token?.colorTextPlaceholder} !important;
|
|
1016
|
-
border: 2px solid ${THEME.token?.colorTextPlaceholder} !important;
|
|
1017
|
-
|
|
1018
|
-
> .antsomi-switch-handle {
|
|
1019
|
-
&::before {
|
|
1020
|
-
background-color: ${THEME.token?.bw0} !important;
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
&.antsomi-switch-disabled[aria-checked='false'] {
|
|
1026
|
-
background-color: ${THEME.token?.bw0} !important;
|
|
1027
|
-
border: 2px solid ${THEME.token?.colorTextPlaceholder} !important;
|
|
1028
|
-
|
|
1029
|
-
> .antsomi-switch-handle {
|
|
1030
|
-
&::before {
|
|
1031
|
-
background-color: ${THEME.token?.colorTextPlaceholder} !important;
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
.antsomi-switch-inner {
|
|
1037
|
-
padding-inline-start: 4px !important;
|
|
1038
|
-
padding-inline-end: 18px !important;
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
1002
|
/* Tabs */
|
|
1043
1003
|
.antsomi-tabs {
|
|
1044
1004
|
.antsomi-tabs-tab {
|
package/es/types/richMenu.d.ts
CHANGED