@starasia/radio 1.0.2 → 1.0.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/radio.es.js +20 -17
- package/dist/radio.umd.js +10 -7
- package/package.json +6 -6
package/dist/radio.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
const
|
|
2
|
+
const e = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
3
3
|
|
|
4
4
|
:root {
|
|
5
5
|
/* font weight */
|
|
@@ -30,8 +30,11 @@ const d = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@30
|
|
|
30
30
|
/* color */
|
|
31
31
|
--starasia-ui-radio-color-primary-blue: var(
|
|
32
32
|
--starasia-ui-brand-primary-default,
|
|
33
|
-
|
|
33
|
+
rgba(74, 106, 148, 1)
|
|
34
34
|
);
|
|
35
|
+
--starasia-ui-radio-color-border-default: rgba(0, 0, 0, 1);
|
|
36
|
+
--starasia-ui-radio-color-disabled: rgba(174, 182, 178, 1);
|
|
37
|
+
--starasia-ui-radio-color-hover-shadow: rgba(201, 206, 204, 0.2);
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
* {
|
|
@@ -66,7 +69,7 @@ const d = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@30
|
|
|
66
69
|
|
|
67
70
|
input.starasia-radio-input[type="radio"] {
|
|
68
71
|
appearance: none;
|
|
69
|
-
border: 1px solid
|
|
72
|
+
border: 1px solid var(--starasia-ui-radio-color-border-default);
|
|
70
73
|
border-radius: 50%;
|
|
71
74
|
outline: none;
|
|
72
75
|
background-color: transparent;
|
|
@@ -91,21 +94,21 @@ input.starasia-radio-input[type="radio"] {
|
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
&:disabled {
|
|
94
|
-
border-color:
|
|
97
|
+
border-color: var(--starasia-ui-radio-color-disabled);
|
|
95
98
|
cursor: not-allowed;
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
&:checked:disabled {
|
|
99
|
-
border-color:
|
|
102
|
+
border-color: var(--starasia-ui-radio-color-disabled);
|
|
100
103
|
cursor: not-allowed;
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
&:checked:disabled::after {
|
|
104
|
-
background-color:
|
|
107
|
+
background-color: var(--starasia-ui-radio-color-disabled);
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
&:hover:not(:disabled) {
|
|
108
|
-
box-shadow: 0px 0px 0px 4px
|
|
111
|
+
box-shadow: 0px 0px 0px 4px var(--starasia-ui-radio-color-hover-shadow);
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
114
|
|
|
@@ -138,15 +141,15 @@ input.starasia-radio-input-lg[type="radio"] {
|
|
|
138
141
|
height: calc(var(--starasia-ui-radio-height-lg) - 7px);
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
|
-
`,
|
|
142
|
-
if (!document.getElementById(
|
|
144
|
+
`, d = "starasia-radio-styles", l = (r) => {
|
|
145
|
+
if (!document.getElementById(d)) {
|
|
143
146
|
const a = document.createElement("style");
|
|
144
|
-
a.id =
|
|
147
|
+
a.id = d, a.textContent = r, document.head.appendChild(a);
|
|
145
148
|
}
|
|
146
149
|
};
|
|
147
|
-
l(
|
|
148
|
-
const
|
|
149
|
-
const { size: a = "md", label:
|
|
150
|
+
l(e);
|
|
151
|
+
const u = (r) => {
|
|
152
|
+
const { size: a = "md", label: n, description: i, ...t } = r;
|
|
150
153
|
return /* @__PURE__ */ s(
|
|
151
154
|
"div",
|
|
152
155
|
{
|
|
@@ -160,11 +163,11 @@ const p = (n) => {
|
|
|
160
163
|
{
|
|
161
164
|
type: "radio",
|
|
162
165
|
className: `starasia-radio-input starasia-radio-input-${a}`,
|
|
163
|
-
...
|
|
166
|
+
...t
|
|
164
167
|
}
|
|
165
168
|
),
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
n || i ? /* @__PURE__ */ s("label", { htmlFor: t.id, style: { lineHeight: 1.07 }, children: [
|
|
170
|
+
n,
|
|
168
171
|
i ? /* @__PURE__ */ o(
|
|
169
172
|
"span",
|
|
170
173
|
{
|
|
@@ -182,5 +185,5 @@ const p = (n) => {
|
|
|
182
185
|
);
|
|
183
186
|
};
|
|
184
187
|
export {
|
|
185
|
-
|
|
188
|
+
u as Radio
|
|
186
189
|
};
|
package/dist/radio.umd.js
CHANGED
|
@@ -29,8 +29,11 @@
|
|
|
29
29
|
/* color */
|
|
30
30
|
--starasia-ui-radio-color-primary-blue: var(
|
|
31
31
|
--starasia-ui-brand-primary-default,
|
|
32
|
-
|
|
32
|
+
rgba(74, 106, 148, 1)
|
|
33
33
|
);
|
|
34
|
+
--starasia-ui-radio-color-border-default: rgba(0, 0, 0, 1);
|
|
35
|
+
--starasia-ui-radio-color-disabled: rgba(174, 182, 178, 1);
|
|
36
|
+
--starasia-ui-radio-color-hover-shadow: rgba(201, 206, 204, 0.2);
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
* {
|
|
@@ -65,7 +68,7 @@
|
|
|
65
68
|
|
|
66
69
|
input.starasia-radio-input[type="radio"] {
|
|
67
70
|
appearance: none;
|
|
68
|
-
border: 1px solid
|
|
71
|
+
border: 1px solid var(--starasia-ui-radio-color-border-default);
|
|
69
72
|
border-radius: 50%;
|
|
70
73
|
outline: none;
|
|
71
74
|
background-color: transparent;
|
|
@@ -90,21 +93,21 @@ input.starasia-radio-input[type="radio"] {
|
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
&:disabled {
|
|
93
|
-
border-color:
|
|
96
|
+
border-color: var(--starasia-ui-radio-color-disabled);
|
|
94
97
|
cursor: not-allowed;
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
&:checked:disabled {
|
|
98
|
-
border-color:
|
|
101
|
+
border-color: var(--starasia-ui-radio-color-disabled);
|
|
99
102
|
cursor: not-allowed;
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
&:checked:disabled::after {
|
|
103
|
-
background-color:
|
|
106
|
+
background-color: var(--starasia-ui-radio-color-disabled);
|
|
104
107
|
}
|
|
105
108
|
|
|
106
109
|
&:hover:not(:disabled) {
|
|
107
|
-
box-shadow: 0px 0px 0px 4px
|
|
110
|
+
box-shadow: 0px 0px 0px 4px var(--starasia-ui-radio-color-hover-shadow);
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
|
|
@@ -137,4 +140,4 @@ input.starasia-radio-input-lg[type="radio"] {
|
|
|
137
140
|
height: calc(var(--starasia-ui-radio-height-lg) - 7px);
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
|
-
`,s="starasia-radio-styles";(
|
|
143
|
+
`,s="starasia-radio-styles";(t=>{if(!document.getElementById(s)){const n=document.createElement("style");n.id=s,n.textContent=t,document.head.appendChild(n)}})(d);const l=t=>{const{size:n="md",label:o,description:r,...e}=t;return a.jsxs("div",{className:"starasia-radio-container",style:{alignItems:r?"start":"center"},children:[a.jsx("input",{type:"radio",className:`starasia-radio-input starasia-radio-input-${n}`,...e}),o||r?a.jsxs("label",{htmlFor:e.id,style:{lineHeight:1.07},children:[o,r?a.jsx("span",{style:{display:"block",color:"#78867F",lineHeight:"initial"},children:r}):null]}):null]})};i.Radio=l,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starasia/radio",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "radio component for starasia UI",
|
|
5
5
|
"author": "Prawito Hudoro",
|
|
6
6
|
"main": "dist/radio.umd.js",
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
"dist/*.map",
|
|
13
13
|
"dist/*.css"
|
|
14
14
|
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "vite --config vite.config.ts --port 3000",
|
|
17
|
+
"build": "vite build --config vite.config.ts"
|
|
18
|
+
},
|
|
15
19
|
"keywords": [],
|
|
16
20
|
"license": "ISC",
|
|
17
21
|
"type": "module",
|
|
@@ -33,9 +37,5 @@
|
|
|
33
37
|
"react-dom": "^18.2.0",
|
|
34
38
|
"@types/react": "^18.2.55",
|
|
35
39
|
"@types/react-dom": "^18.2.19"
|
|
36
|
-
},
|
|
37
|
-
"scripts": {
|
|
38
|
-
"dev": "vite --config vite.config.ts --port 3000",
|
|
39
|
-
"build": "vite build --config vite.config.ts"
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|