@starasia/radio 2.0.0 → 3.0.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/dist/radio.es.js +25 -25
- package/dist/radio.umd.js +10 -10
- package/package.json +6 -6
package/dist/radio.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as t, jsx as
|
|
2
|
-
const
|
|
1
|
+
import { jsxs as t, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
const s = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
3
3
|
|
|
4
4
|
:root {
|
|
5
5
|
--sa-radio-font-weight-normal: var(--sa-font-weight-normal, 300);
|
|
@@ -25,7 +25,7 @@ const e = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@30
|
|
|
25
25
|
padding: 0;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.
|
|
28
|
+
.sa-radio-container {
|
|
29
29
|
width: max-content;
|
|
30
30
|
display: flex;
|
|
31
31
|
& label {
|
|
@@ -36,20 +36,20 @@ const e = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@30
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.
|
|
39
|
+
.sa-radio-container:has(.sa-radio-input-sm) {
|
|
40
40
|
gap: 12px;
|
|
41
41
|
font-size: var(--sa-radio-font-size-sm);
|
|
42
42
|
}
|
|
43
|
-
.
|
|
43
|
+
.sa-radio-container:has(.sa-radio-input-md) {
|
|
44
44
|
gap: 12px;
|
|
45
45
|
font-size: var(--sa-radio-font-size-md);
|
|
46
46
|
}
|
|
47
|
-
.
|
|
47
|
+
.sa-radio-container:has(.sa-radio-input-lg) {
|
|
48
48
|
gap: 16px;
|
|
49
49
|
font-size: var(--sa-radio-font-size-lg);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
input.
|
|
52
|
+
input.sa-radio-input[type="radio"] {
|
|
53
53
|
appearance: none;
|
|
54
54
|
border: 1px solid var(--sa-radio-color-border-default);
|
|
55
55
|
border-radius: 50%;
|
|
@@ -94,7 +94,7 @@ input.starasia-radio-input[type="radio"] {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
input.
|
|
97
|
+
input.sa-radio-input-sm[type="radio"] {
|
|
98
98
|
width: var(--sa-radio-width-sm);
|
|
99
99
|
height: var(--sa-radio-height-sm);
|
|
100
100
|
|
|
@@ -104,7 +104,7 @@ input.starasia-radio-input-sm[type="radio"] {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
input.
|
|
107
|
+
input.sa-radio-input-md[type="radio"] {
|
|
108
108
|
width: var(--sa-radio-width-md);
|
|
109
109
|
height: var(--sa-radio-height-md);
|
|
110
110
|
|
|
@@ -114,7 +114,7 @@ input.starasia-radio-input-md[type="radio"] {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
input.
|
|
117
|
+
input.sa-radio-input-lg[type="radio"] {
|
|
118
118
|
width: var(--sa-radio-width-lg);
|
|
119
119
|
height: var(--sa-radio-height-lg);
|
|
120
120
|
|
|
@@ -123,39 +123,39 @@ input.starasia-radio-input-lg[type="radio"] {
|
|
|
123
123
|
height: calc(var(--sa-radio-height-lg) - 7px);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
`,
|
|
127
|
-
if (!document.getElementById(
|
|
126
|
+
`, e = "sa-radio-styles", l = (o) => {
|
|
127
|
+
if (!document.getElementById(e)) {
|
|
128
128
|
const a = document.createElement("style");
|
|
129
|
-
a.id =
|
|
129
|
+
a.id = e, a.textContent = o, document.head.appendChild(a);
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
l(
|
|
133
|
-
const
|
|
134
|
-
const { size: a = "md", label:
|
|
132
|
+
l(s);
|
|
133
|
+
const h = (o) => {
|
|
134
|
+
const { size: a = "md", label: r, description: n, ...i } = o;
|
|
135
135
|
return /* @__PURE__ */ t(
|
|
136
136
|
"div",
|
|
137
137
|
{
|
|
138
|
-
className: "
|
|
138
|
+
className: "sa-radio-container",
|
|
139
139
|
style: {
|
|
140
140
|
alignItems: n ? "start" : "center"
|
|
141
141
|
},
|
|
142
142
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ d(
|
|
144
144
|
"input",
|
|
145
145
|
{
|
|
146
146
|
type: "radio",
|
|
147
|
-
className: `
|
|
148
|
-
...
|
|
147
|
+
className: `sa-radio-input sa-radio-input-${a}`,
|
|
148
|
+
...i
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
n ? /* @__PURE__ */
|
|
151
|
+
r || n ? /* @__PURE__ */ t("label", { htmlFor: i.id, style: { lineHeight: 1.07 }, children: [
|
|
152
|
+
r,
|
|
153
|
+
n ? /* @__PURE__ */ d(
|
|
154
154
|
"span",
|
|
155
155
|
{
|
|
156
156
|
style: {
|
|
157
157
|
display: "block",
|
|
158
|
-
color: "#
|
|
158
|
+
color: "var(--sa-text-subtle, #8c8f97)",
|
|
159
159
|
lineHeight: "initial"
|
|
160
160
|
},
|
|
161
161
|
children: n
|
|
@@ -167,5 +167,5 @@ const c = (r) => {
|
|
|
167
167
|
);
|
|
168
168
|
};
|
|
169
169
|
export {
|
|
170
|
-
|
|
170
|
+
h as Radio
|
|
171
171
|
};
|
package/dist/radio.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(n
|
|
1
|
+
(function(a,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],n):(a=typeof globalThis<"u"?globalThis:a||self,n(a.Radio={},a.jsxRuntime))})(this,function(a,n){"use strict";const s=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
4
|
--sa-radio-font-weight-normal: var(--sa-font-weight-normal, 300);
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
padding: 0;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.
|
|
27
|
+
.sa-radio-container {
|
|
28
28
|
width: max-content;
|
|
29
29
|
display: flex;
|
|
30
30
|
& label {
|
|
@@ -35,20 +35,20 @@
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.
|
|
38
|
+
.sa-radio-container:has(.sa-radio-input-sm) {
|
|
39
39
|
gap: 12px;
|
|
40
40
|
font-size: var(--sa-radio-font-size-sm);
|
|
41
41
|
}
|
|
42
|
-
.
|
|
42
|
+
.sa-radio-container:has(.sa-radio-input-md) {
|
|
43
43
|
gap: 12px;
|
|
44
44
|
font-size: var(--sa-radio-font-size-md);
|
|
45
45
|
}
|
|
46
|
-
.
|
|
46
|
+
.sa-radio-container:has(.sa-radio-input-lg) {
|
|
47
47
|
gap: 16px;
|
|
48
48
|
font-size: var(--sa-radio-font-size-lg);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
input.
|
|
51
|
+
input.sa-radio-input[type="radio"] {
|
|
52
52
|
appearance: none;
|
|
53
53
|
border: 1px solid var(--sa-radio-color-border-default);
|
|
54
54
|
border-radius: 50%;
|
|
@@ -93,7 +93,7 @@ input.starasia-radio-input[type="radio"] {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
input.
|
|
96
|
+
input.sa-radio-input-sm[type="radio"] {
|
|
97
97
|
width: var(--sa-radio-width-sm);
|
|
98
98
|
height: var(--sa-radio-height-sm);
|
|
99
99
|
|
|
@@ -103,7 +103,7 @@ input.starasia-radio-input-sm[type="radio"] {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
input.
|
|
106
|
+
input.sa-radio-input-md[type="radio"] {
|
|
107
107
|
width: var(--sa-radio-width-md);
|
|
108
108
|
height: var(--sa-radio-height-md);
|
|
109
109
|
|
|
@@ -113,7 +113,7 @@ input.starasia-radio-input-md[type="radio"] {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
input.
|
|
116
|
+
input.sa-radio-input-lg[type="radio"] {
|
|
117
117
|
width: var(--sa-radio-width-lg);
|
|
118
118
|
height: var(--sa-radio-height-lg);
|
|
119
119
|
|
|
@@ -122,4 +122,4 @@ input.starasia-radio-input-lg[type="radio"] {
|
|
|
122
122
|
height: calc(var(--sa-radio-height-lg) - 7px);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
`,
|
|
125
|
+
`,e="sa-radio-styles";(r=>{if(!document.getElementById(e)){const o=document.createElement("style");o.id=e,o.textContent=r,document.head.appendChild(o)}})(s);const l=r=>{const{size:o="md",label:t,description:i,...d}=r;return n.jsxs("div",{className:"sa-radio-container",style:{alignItems:i?"start":"center"},children:[n.jsx("input",{type:"radio",className:`sa-radio-input sa-radio-input-${o}`,...d}),t||i?n.jsxs("label",{htmlFor:d.id,style:{lineHeight:1.07},children:[t,i?n.jsx("span",{style:{display:"block",color:"var(--sa-text-subtle, #8c8f97)",lineHeight:"initial"},children:i}):null]}):null]})};a.Radio=l,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starasia/radio",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "radio component for starasia UI",
|
|
5
5
|
"author": "Prawito Hudoro",
|
|
6
6
|
"main": "dist/radio.umd.js",
|
|
@@ -12,10 +12,6 @@
|
|
|
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
|
-
},
|
|
19
15
|
"keywords": [],
|
|
20
16
|
"license": "ISC",
|
|
21
17
|
"type": "module",
|
|
@@ -37,5 +33,9 @@
|
|
|
37
33
|
"react-dom": "^18.2.0",
|
|
38
34
|
"@types/react": "^18.2.55",
|
|
39
35
|
"@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
|
+
}
|