@lynx-js/lynx-ui-switch 3.130.0 → 3.131.1
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/CHANGELOG.md +6 -0
- package/dist/types/index.docs.d.ts +24 -18
- package/dist/types/index.docs.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/types/index.docs.ts +27 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from '@lynx-js/react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* className
|
|
6
|
-
* @zh 类名
|
|
7
|
-
* @Android
|
|
8
|
-
* @iOS
|
|
9
|
-
*/
|
|
10
|
-
className?: string;
|
|
11
|
-
/**
|
|
12
|
-
* style
|
|
13
|
-
* @zh 样式
|
|
14
|
-
* @Android
|
|
15
|
-
* @iOS
|
|
16
|
-
*/
|
|
17
|
-
style?: CSSProperties;
|
|
18
|
-
}
|
|
2
|
+
import type { ComponentBasicProps } from '@lynx-js/lynx-ui-common';
|
|
3
|
+
import type { ViewProps } from '@lynx-js/types';
|
|
19
4
|
/** Props for the Switch component.
|
|
20
5
|
* @zh Switch 组件的属性
|
|
21
6
|
*/
|
|
@@ -95,6 +80,28 @@ export interface SwitchRenderProps {
|
|
|
95
80
|
*/
|
|
96
81
|
disabled: boolean;
|
|
97
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* UI variants applied by Switch based on render state.
|
|
85
|
+
* Use them as CSS selectors to style different states.
|
|
86
|
+
* @zh Switch 根据状态注入的 ui-variants,可用于 CSS selector 按状态定制样式。
|
|
87
|
+
*/
|
|
88
|
+
export interface SwitchUiVariants {
|
|
89
|
+
/**
|
|
90
|
+
* Applied when `status.active` is true.
|
|
91
|
+
* @zh 当 status.active 为 true 时生效,可用于 `.ui-active { ... }`。
|
|
92
|
+
*/
|
|
93
|
+
'ui-active'?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Applied when `status.checked` is true.
|
|
96
|
+
* @zh 当 status.checked 为 true 时生效,可用于 `.ui-checked { ... }`。
|
|
97
|
+
*/
|
|
98
|
+
'ui-checked'?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Applied when `status.disabled` is true.
|
|
101
|
+
* @zh 当 status.disabled 为 true 时生效,可用于 `.ui-disabled { ... }`。
|
|
102
|
+
*/
|
|
103
|
+
'ui-disabled'?: boolean;
|
|
104
|
+
}
|
|
98
105
|
/**
|
|
99
106
|
* The thumb of the Switch.
|
|
100
107
|
* The draggable/clickable handle that toggles the state.
|
|
@@ -127,5 +134,4 @@ export interface SwitchTrackProps extends ComponentBasicProps {
|
|
|
127
134
|
*/
|
|
128
135
|
children?: ReactNode;
|
|
129
136
|
}
|
|
130
|
-
export {};
|
|
131
137
|
//# sourceMappingURL=index.docs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.docs.d.ts","sourceRoot":"","sources":["../../src/types/index.docs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.docs.d.ts","sourceRoot":"","sources":["../../src/types/index.docs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,mBAAmB;IACtD;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IAExB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IAErC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,CAAA;IAEvB;;;;;;OAMG;IACH,QAAQ,CAAC,EACL,SAAS,GACT,CAAC,CACD,MAAM,EAAE,iBAAiB,KACtB,SAAS,CAAC,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAA;IAEhB;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAA;IAEf;;;;;OAKG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/lynx-ui-switch",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.131.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/lynx-family/lynx-ui.git",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"dist/**"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"clsx": "^2.1.1"
|
|
28
|
+
"clsx": "^2.1.1",
|
|
29
|
+
"@lynx-js/lynx-ui-common": "3.131.0"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@lynx-js/react": "0.113.0",
|
package/src/types/index.docs.ts
CHANGED
|
@@ -4,24 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import type { ReactNode } from '@lynx-js/react'
|
|
6
6
|
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
interface ComponentBasicProps {
|
|
10
|
-
/**
|
|
11
|
-
* className
|
|
12
|
-
* @zh 类名
|
|
13
|
-
* @Android
|
|
14
|
-
* @iOS
|
|
15
|
-
*/
|
|
16
|
-
className?: string
|
|
17
|
-
/**
|
|
18
|
-
* style
|
|
19
|
-
* @zh 样式
|
|
20
|
-
* @Android
|
|
21
|
-
* @iOS
|
|
22
|
-
*/
|
|
23
|
-
style?: CSSProperties
|
|
24
|
-
}
|
|
7
|
+
import type { ComponentBasicProps } from '@lynx-js/lynx-ui-common'
|
|
8
|
+
import type { ViewProps } from '@lynx-js/types'
|
|
25
9
|
|
|
26
10
|
/** Props for the Switch component.
|
|
27
11
|
* @zh Switch 组件的属性
|
|
@@ -114,6 +98,31 @@ export interface SwitchRenderProps {
|
|
|
114
98
|
disabled: boolean
|
|
115
99
|
}
|
|
116
100
|
|
|
101
|
+
/**
|
|
102
|
+
* UI variants applied by Switch based on render state.
|
|
103
|
+
* Use them as CSS selectors to style different states.
|
|
104
|
+
* @zh Switch 根据状态注入的 ui-variants,可用于 CSS selector 按状态定制样式。
|
|
105
|
+
*/
|
|
106
|
+
export interface SwitchUiVariants {
|
|
107
|
+
/**
|
|
108
|
+
* Applied when `status.active` is true.
|
|
109
|
+
* @zh 当 status.active 为 true 时生效,可用于 `.ui-active { ... }`。
|
|
110
|
+
*/
|
|
111
|
+
'ui-active'?: boolean
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Applied when `status.checked` is true.
|
|
115
|
+
* @zh 当 status.checked 为 true 时生效,可用于 `.ui-checked { ... }`。
|
|
116
|
+
*/
|
|
117
|
+
'ui-checked'?: boolean
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Applied when `status.disabled` is true.
|
|
121
|
+
* @zh 当 status.disabled 为 true 时生效,可用于 `.ui-disabled { ... }`。
|
|
122
|
+
*/
|
|
123
|
+
'ui-disabled'?: boolean
|
|
124
|
+
}
|
|
125
|
+
|
|
117
126
|
/**
|
|
118
127
|
* The thumb of the Switch.
|
|
119
128
|
* The draggable/clickable handle that toggles the state.
|