@lynx-js/lynx-ui-checkbox 3.135.3 → 3.136.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/CHANGELOG.md +18 -0
- package/dist/Checkbox.jsx.map +1 -1
- package/dist/CheckboxContext.jsx.map +1 -1
- package/dist/CheckboxIndicator.jsx.map +1 -1
- package/dist/index.jsx +2 -3
- package/dist/types/index.docs.jsx +1 -0
- package/dist/types/index.jsx +1 -0
- package/package.json +7 -7
- package/tsconfig.json +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @lynx-js/lynx-ui-checkbox
|
|
2
2
|
|
|
3
|
+
## 3.136.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`0257f8b`](https://github.com/lynx-family/lynx-ui/commit/0257f8bc9fbe6b8a51df00663c7860827ce468b2)]:
|
|
8
|
+
- @lynx-js/lynx-ui-common@3.136.0
|
|
9
|
+
- @lynx-js/lynx-ui-button@3.136.0
|
|
10
|
+
|
|
11
|
+
## 3.135.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Upgrade the Lynx and Rsbuild toolchain dependencies used to build lynx-ui packages. ([#233](https://github.com/lynx-family/lynx-ui/pull/233))
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`753556b`](https://github.com/lynx-family/lynx-ui/commit/753556bc1acb77e05567aba3b8b5ab057b9f670b)]:
|
|
18
|
+
- @lynx-js/lynx-ui-button@3.135.4
|
|
19
|
+
- @lynx-js/lynx-ui-common@3.135.4
|
|
20
|
+
|
|
3
21
|
## 3.135.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/Checkbox.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.jsx","sources":["
|
|
1
|
+
{"version":3,"file":"Checkbox.jsx","sources":["../src/Checkbox.tsx"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nimport { useMemo, useState } from '@lynx-js/react'\nimport type { ReactNode } from '@lynx-js/react'\n\nimport { Button } from '@lynx-js/lynx-ui-button'\nimport {\n renderContentWithExtraProps,\n useMemoizedFn,\n} from '@lynx-js/lynx-ui-common'\nimport { clsx } from 'clsx'\n\nimport { CheckboxContext } from './CheckboxContext'\nimport type { CheckboxProps } from './types'\n\nexport type { CheckboxProps, CheckboxIndicatorProps } from './types'\nexport const Checkbox = (props: CheckboxProps): ReactNode => {\n const {\n style,\n className,\n children,\n onChange,\n checked,\n defaultChecked = false,\n disabled = false,\n indeterminate = false,\n checkboxProps,\n } = props\n const isControlled = checked !== undefined\n const [uncontrolledChecked, setUncontrolledChecked] = useState<boolean>(\n defaultChecked,\n )\n const actualChecked = isControlled ? checked : uncontrolledChecked\n\n const handleValueChange = useMemoizedFn((newChecked: boolean) => {\n if (!isControlled) {\n setUncontrolledChecked(newChecked)\n }\n onChange?.(newChecked)\n })\n\n const handleClick = useMemoizedFn(() => {\n if (indeterminate) {\n handleValueChange(true)\n return\n }\n handleValueChange(!actualChecked)\n })\n\n const checkboxContextValue = useMemo(() => ({\n checked: actualChecked,\n indeterminate,\n }), [actualChecked, indeterminate])\n\n return (\n <CheckboxContext.Provider value={checkboxContextValue}>\n <Button\n disabled={disabled}\n onClick={handleClick}\n style={style}\n className={clsx(className, {\n 'ui-indeterminate': indeterminate,\n 'ui-checked': checked,\n })}\n buttonProps={checkboxProps}\n >\n {renderContentWithExtraProps(\n { checked: actualChecked, indeterminate },\n children,\n )}\n </Button>\n </CheckboxContext.Provider>\n )\n}\n"],"names":["Checkbox","props","style","className","children","onChange","checked","defaultChecked","disabled","indeterminate","checkboxProps","isControlled","undefined","uncontrolledChecked","setUncontrolledChecked","useState","actualChecked","handleValueChange","useMemoizedFn","newChecked","handleClick","checkboxContextValue","useMemo","CheckboxContext","Button","clsx","renderContentWithExtraProps"],"mappings":";;;;;AAkBO,MAAMA,WAAW,CAACC;IACvB,MAAM,EACJC,KAAK,EACLC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,OAAO,EACPC,iBAAiB,KAAK,EACtBC,WAAW,KAAK,EAChBC,gBAAgB,KAAK,EACrBC,aAAa,EACd,GAAGT;IACJ,MAAMU,eAAeL,AAAYM,WAAZN;IACrB,MAAM,CAACO,qBAAqBC,uBAAuB,GAAGC,SACpDR;IAEF,MAAMS,gBAAgBL,eAAeL,UAAUO;IAE/C,MAAMI,oBAAoBC,cAAc,CAACC;QACvC,IAAI,CAACR,cACHG,uBAAuBK;QAEzBd,WAAWc;IACb;IAEA,MAAMC,cAAcF,cAAc;QAChC,IAAIT,eAAe,YACjBQ,kBAAkB;QAGpBA,kBAAkB,CAACD;IACrB;IAEA,MAAMK,uBAAuBC,QAAQ,IAAO;YAC1C,SAASN;YACTP;QACF,IAAI;QAACO;QAAeP;KAAc;IAElC,QACGc,gBAAgB,SAAS,OAAOF,sBAAsB;MACrD,CAACG,OACC,UAAUhB,UACV,SAASY,aACT,OAAOlB,OACP,WAAWuB,KAAKtB,WAAW;QACzB,oBAAoBM;QACpB,cAAcH;IAChB,IACA,aAAaI,eACd;QACC,CAACgB,4BACC;QAAE,SAASV;QAAeP;IAAc,GACxCL,UACA;MACJ,EAAEoB,OAAO;IACX,EAAED,gBAAgB;AAEtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxContext.jsx","sources":["
|
|
1
|
+
{"version":3,"file":"CheckboxContext.jsx","sources":["../src/CheckboxContext.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nimport { createContext } from '@lynx-js/react'\n\nexport type { CheckboxProps, CheckboxIndicatorProps } from './types'\n\nexport const CheckboxContext = createContext<{\n checked: boolean\n indeterminate: boolean\n}>({\n checked: false,\n indeterminate: false,\n})\n"],"names":["CheckboxContext","createContext"],"mappings":";AAQO,MAAMA,kBAAkBC,cAG5B;IACD,SAAS;IACT,eAAe;AACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxIndicator.jsx","sources":["
|
|
1
|
+
{"version":3,"file":"CheckboxIndicator.jsx","sources":["../src/CheckboxIndicator.tsx"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nimport { useContext } from '@lynx-js/react'\nimport type { ReactNode } from '@lynx-js/react'\n\nimport { ButtonContext } from '@lynx-js/lynx-ui-button'\nimport { clsx } from 'clsx'\n\nimport { CheckboxContext } from './CheckboxContext'\nimport type { CheckboxIndicatorProps } from './types'\n\nexport type { CheckboxProps, CheckboxIndicatorProps } from './types'\n\nexport const CheckboxIndicator = (props: CheckboxIndicatorProps): ReactNode => {\n const { children, className, style, forceMount = false } = props\n const { checked, indeterminate } = useContext(\n CheckboxContext,\n )\n const { active, disabled } = useContext(ButtonContext)\n\n return (\n <view\n style={style}\n className={clsx(className, {\n 'ui-indeterminate': indeterminate,\n 'ui-checked': checked,\n 'ui-active': active,\n 'ui-disabled': disabled,\n })}\n >\n {(forceMount || checked || indeterminate)\n && children}\n </view>\n )\n}\n"],"names":["CheckboxIndicator","props","children","className","style","forceMount","checked","indeterminate","useContext","CheckboxContext","active","disabled","ButtonContext","view","clsx"],"mappings":";;;;AAeO,MAAMA,oBAAoB,CAACC;IAChC,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,KAAK,EAAEC,aAAa,KAAK,EAAE,GAAGJ;IAC3D,MAAM,EAAEK,OAAO,EAAEC,aAAa,EAAE,GAAGC,WACjCC;IAEF,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EAAE,GAAGH,WAAWI;IAExC,QACGC,KACC,OAAOT,OACP,WAAWU,KAAKX,WAAW;QACzB,oBAAoBI;QACpB,cAAcD;QACd,aAAaI;QACb,eAAeC;IACjB,IACD;MACC,CAAEN,AAAAA,CAAAA,cAAcC,WAAWC,aAAY,KAClCL,SAAS;IAChB,EAAEW;AAEN"}
|
package/dist/index.jsx
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { Checkbox, CheckboxIndicator };
|
|
1
|
+
export { Checkbox } from "./Checkbox.jsx";
|
|
2
|
+
export { CheckboxIndicator } from "./CheckboxIndicator.jsx";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/types/index.jsx
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/lynx-ui-checkbox",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.136.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/lynx-family/lynx-ui.git",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"clsx": "^2.1.1",
|
|
29
|
-
"@lynx-js/lynx-ui-button": "3.
|
|
30
|
-
"@lynx-js/lynx-ui-common": "3.
|
|
29
|
+
"@lynx-js/lynx-ui-button": "3.136.0",
|
|
30
|
+
"@lynx-js/lynx-ui-common": "3.136.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@lynx-js/react": "0.
|
|
34
|
-
"@lynx-js/types": "
|
|
35
|
-
"@rslib/core": "
|
|
33
|
+
"@lynx-js/react": "0.123.1",
|
|
34
|
+
"@lynx-js/types": "4.1.0",
|
|
35
|
+
"@rslib/core": "0.23.2",
|
|
36
36
|
"@types/react": "^18.3.8",
|
|
37
|
-
"typescript": "^5.
|
|
37
|
+
"typescript": "^5.8.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@lynx-js/react": ">=0.100.0",
|