@hive-ui/radio-checkbox-primitive 0.2.4

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/dist/index.mjs ADDED
@@ -0,0 +1,132 @@
1
+ import { SiblingBox } from "@hive-ui/sibling-box";
2
+ import { forwardRef } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { Box } from "@hive-ui/box";
5
+ import { Label } from "@hive-ui/label";
6
+ import { Text } from "@hive-ui/text";
7
+ import { HelpText } from "@hive-ui/help-text";
8
+ //#region src/RadioCheckboxControl.tsx
9
+ const RadioCheckboxControl = forwardRef(({ element = "RADIO_CHECKBOX_CONTROL", children, disabled, applyHoverStyles = false, ...props }, ref) => {
10
+ return /* @__PURE__ */ jsx(SiblingBox, {
11
+ as: "span",
12
+ ref,
13
+ display: "flex",
14
+ element,
15
+ backgroundColor: "colorBackgroundBody",
16
+ borderColor: applyHoverStyles ? "colorBorderPrimaryStronger" : "colorBorder",
17
+ borderStyle: "solid",
18
+ borderWidth: "borderWidth10",
19
+ height: "1rem",
20
+ marginRight: "space20",
21
+ marginY: "space10",
22
+ width: "1rem",
23
+ color: "colorTextWeakest",
24
+ _hoverSibling: {
25
+ borderColor: "colorBorderPrimaryStronger",
26
+ color: "colorTextWeakest"
27
+ },
28
+ _focusSibling: {
29
+ borderColor: "colorBorder",
30
+ boxShadow: "shadowFocus",
31
+ color: "colorTextInverse"
32
+ },
33
+ _activeSibling: !disabled ? {
34
+ borderColor: "colorBorderPrimaryStronger",
35
+ backgroundColor: "colorBackgroundPrimaryStronger",
36
+ color: "colorTextWeakest"
37
+ } : void 0,
38
+ _checkedSibling: {
39
+ borderColor: "colorBorderPrimary",
40
+ backgroundColor: "colorBackgroundPrimary",
41
+ color: "colorTextInverse"
42
+ },
43
+ _disabledSibling: {
44
+ borderColor: "colorBorderWeak",
45
+ backgroundColor: "colorBackground"
46
+ },
47
+ _invalidSibling: { borderColor: "colorBorderError" },
48
+ _invalidAndHoverSibling: { borderColor: "colorBorderErrorStronger" },
49
+ _invalidAndDisabledSibling: { borderColor: "colorBorderWeak" },
50
+ _checkedAndHoverSibling: {
51
+ borderColor: "colorBorderPrimaryStronger",
52
+ backgroundColor: "colorBackgroundPrimaryStronger",
53
+ color: "colorTextWeakest"
54
+ },
55
+ _checkedAndFocusSibling: {
56
+ borderColor: "colorBorderPrimary",
57
+ backgroundColor: "colorBackgroundPrimary",
58
+ color: "colorTextInverse"
59
+ },
60
+ _checkedAndActiveSibling: !disabled ? {
61
+ borderColor: "colorBorderPrimaryStronger",
62
+ backgroundColor: "colorBackgroundPrimaryStronger"
63
+ } : void 0,
64
+ _checkedAndDisabledSibling: {
65
+ borderColor: "colorBorderWeak",
66
+ backgroundColor: "colorBackground",
67
+ color: "colorTextWeaker"
68
+ },
69
+ _checkedAndInvalidSibling: {
70
+ borderColor: "colorBorderError",
71
+ backgroundColor: "colorBackgroundError",
72
+ color: "colorTextInverse"
73
+ },
74
+ _checkedAndInvalidAndHoverSibling: {
75
+ borderColor: "colorBorderErrorStronger",
76
+ backgroundColor: "colorBackgroundErrorStronger"
77
+ },
78
+ _checkedAndInvalidAndDisabledSibling: {
79
+ borderColor: "colorBorderWeak",
80
+ backgroundColor: "colorBackground",
81
+ color: "colorTextWeaker"
82
+ },
83
+ ...props,
84
+ children
85
+ });
86
+ });
87
+ //#endregion
88
+ //#region src/RadioCheckboxLabel.tsx
89
+ const RadioCheckboxLabel = forwardRef(({ element = "RADIO_CHECKBOX_LABEL", children, ...props }, ref) => {
90
+ return /* @__PURE__ */ jsx(Label, {
91
+ ...props,
92
+ element,
93
+ marginBottom: "space0",
94
+ ref,
95
+ children: /* @__PURE__ */ jsx(Box, {
96
+ as: "span",
97
+ display: "flex",
98
+ children
99
+ })
100
+ });
101
+ });
102
+ //#endregion
103
+ //#region src/RadioCheckboxLabelText.tsx
104
+ const RadioCheckboxLabelText = forwardRef(({ element = "RADIO_CHECKBOX_LABEL_TEXT", children, ...props }, ref) => {
105
+ return /* @__PURE__ */ jsx(Text, {
106
+ as: "span",
107
+ color: "currentColor",
108
+ marginLeft: "space20",
109
+ element,
110
+ ref,
111
+ ...props,
112
+ children
113
+ });
114
+ });
115
+ //#endregion
116
+ //#region src/RadioCheckboxHelpText.tsx
117
+ const RadioCheckboxHelpText = forwardRef(({ element = "BASE_RADIO_CHECKBOX_HELP_TEXT_WRAPPER", children, helpTextId, ...props }, ref) => {
118
+ return /* @__PURE__ */ jsx(Box, {
119
+ as: "span",
120
+ display: "block",
121
+ element,
122
+ marginLeft: "space70",
123
+ ref,
124
+ children: /* @__PURE__ */ jsx(HelpText, {
125
+ id: helpTextId,
126
+ marginTop: "space0",
127
+ children
128
+ })
129
+ });
130
+ });
131
+ //#endregion
132
+ export { RadioCheckboxControl, RadioCheckboxHelpText, RadioCheckboxLabel, RadioCheckboxLabelText };
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@hive-ui/radio-checkbox-primitive",
3
+ "version": "0.2.4",
4
+ "description": "Hive UI Radio Checkbox Primitive",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "exports": {
10
+ ".": "./dist/index.mjs",
11
+ "./package.json": "./package.json"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "scripts": {
17
+ "build": "vp pack",
18
+ "dev": "vp pack --watch",
19
+ "test": "vp test",
20
+ "check": "vp check",
21
+ "prepublishOnly": "vp run build"
22
+ },
23
+ "dependencies": {
24
+ "@hive-ui/box": "^0.2.4",
25
+ "@hive-ui/sibling-box": "^0.2.4",
26
+ "@hive-ui/help-text": "^0.2.4",
27
+ "@hive-ui/label": "^0.2.4",
28
+ "@hive-ui/text": "^0.2.4",
29
+ "@hive-ui/style-props": "^0.2.4"
30
+ },
31
+ "devDependencies": {
32
+ "@types/node": "^25.6.2",
33
+ "@typescript/native-preview": "7.0.0-dev.20260509.2",
34
+ "bumpp": "^11.1.0",
35
+ "typescript": "^6.0.3",
36
+ "vite-plus": "^0.1.20",
37
+ "vitest": "npm:@voidzero-dev/vite-plus-test@^0.1.20"
38
+ },
39
+ "peerDependencies": {
40
+ "react": "19.2.6"
41
+ }
42
+ }