@phila/phila-ui-radio 0.1.1-beta.2 → 0.1.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/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +12 -12
- package/package.json +2 -2
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.philaRadio[data-v-90692348]{display:flex;width:fit-content;align-items:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;gap:var(--spacing-s, .75rem)}.philaRadio input[data-v-90692348]{opacity:0;cursor:pointer;height:0;width:0}.radio-svg[data-v-90692348]{flex-shrink:0;overflow:visible}.radio-bg[data-v-90692348]{fill:var(--Schemes-Surface-Bright, #fafafa);stroke:var(--Schemes-Border, #cfcfcf);stroke-width:1}.radio-dot[data-v-90692348]{fill:none}.philaRadio:has(input:checked) .radio-svg .radio-bg[data-v-90692348]{fill:var(--Schemes-Primary, #0f33f5);stroke:var(--Schemes-Primary, #0f33f5)}.philaRadio:has(input:checked) .radio-svg .radio-dot[data-v-90692348]{fill:var(--Schemes-Surface-Bright, #fafafa)}.philaRadio[data-v-90692348]:focus-within{outline:2px solid var(--Schemes-Primary, #0f33f5);outline-offset:2px}.philaRadio-error .radio-svg .radio-bg[data-v-90692348]{stroke:var(--Schemes-Error, #cc0406);stroke-width:2}.philaRadio-enabled:hover .radio-svg .radio-bg[data-v-90692348]{stroke:var(--Schemes-Primary, #0f33f5);stroke-width:2}.philaRadio-disabled[data-v-90692348]{cursor:not-allowed;color:var(--Schemes-Surface-Variant, #a2a2a2)}.philaRadio-disabled .radio-svg .radio-bg[data-v-90692348]{stroke:var(--Schemes-Surface-Dim, #cfcfcf);stroke-width:1}.group-container[data-v-
|
|
1
|
+
.philaRadio[data-v-90692348]{display:flex;width:fit-content;align-items:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;gap:var(--spacing-s, .75rem)}.philaRadio input[data-v-90692348]{opacity:0;cursor:pointer;height:0;width:0}.radio-svg[data-v-90692348]{flex-shrink:0;overflow:visible}.radio-bg[data-v-90692348]{fill:var(--Schemes-Surface-Bright, #fafafa);stroke:var(--Schemes-Border, #cfcfcf);stroke-width:1}.radio-dot[data-v-90692348]{fill:none}.philaRadio:has(input:checked) .radio-svg .radio-bg[data-v-90692348]{fill:var(--Schemes-Primary, #0f33f5);stroke:var(--Schemes-Primary, #0f33f5)}.philaRadio:has(input:checked) .radio-svg .radio-dot[data-v-90692348]{fill:var(--Schemes-Surface-Bright, #fafafa)}.philaRadio[data-v-90692348]:focus-within{outline:2px solid var(--Schemes-Primary, #0f33f5);outline-offset:2px}.philaRadio-error .radio-svg .radio-bg[data-v-90692348]{stroke:var(--Schemes-Error, #cc0406);stroke-width:2}.philaRadio-enabled:hover .radio-svg .radio-bg[data-v-90692348]{stroke:var(--Schemes-Primary, #0f33f5);stroke-width:2}.philaRadio-disabled[data-v-90692348]{cursor:not-allowed;color:var(--Schemes-Surface-Variant, #a2a2a2)}.philaRadio-disabled .radio-svg .radio-bg[data-v-90692348]{stroke:var(--Schemes-Surface-Dim, #cfcfcf);stroke-width:1}.group-container[data-v-e831bcab]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-xs, .5rem)}.labels-container[data-v-e831bcab]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-2xs, .25rem);align-self:stretch}span[data-v-e831bcab]{display:block}.radio-container[data-v-e831bcab]{display:flex;padding:var(--spacing-m, 1rem);flex-direction:column;align-items:flex-start;gap:var(--spacing-m, 1rem);align-self:stretch}.radio-container-error[data-v-e831bcab]{border-radius:var(--border-radius-m, .75rem)}.error-message[data-v-e831bcab]{display:flex;align-items:center;gap:var(--spacing-s, .75rem);align-self:stretch;font-weight:600}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ export interface RadioGroupProps extends BaseProps {
|
|
|
18
18
|
errorMessage?: string;
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
}
|
|
21
|
-
type RadioChoice = {
|
|
21
|
+
export type RadioChoice = {
|
|
22
22
|
text: string;
|
|
23
23
|
value: string;
|
|
24
|
+
disabled?: boolean;
|
|
24
25
|
};
|
|
25
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),r=require("@phila/phila-ui-core"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),r=require("@phila/phila-ui-core"),g=["for"],f=["id","name","value","checked","disabled"],b=e.defineComponent({__name:"Radio",props:{name:{},value:{},text:{},modelValue:{},disabled:{type:Boolean},error:{type:Boolean},className:{}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,l=n,o=r.generateRandomId(),d=e.computed(()=>a.modelValue!==void 0?a.modelValue===a.value:void 0);function c(){l("update:modelValue",a.value)}const i=e.computed(()=>r.cn("philaRadio","has-text-body-default",a.className,!a.disabled&&"philaRadio-enabled",a.disabled&&"philaRadio-disabled",a.error&&"philaRadio-error"));return(m,s)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(i.value),for:e.unref(o)},[s[0]||(s[0]=e.createElementVNode("svg",{class:"radio-svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("circle",{class:"radio-bg",cx:"10",cy:"10",r:"9.5"}),e.createElementVNode("circle",{class:"radio-dot",cx:"10",cy:"10",r:"4"})],-1)),e.createTextVNode(" "+e.toDisplayString(a.text)+" ",1),e.createElementVNode("input",{id:e.unref(o),type:"radio",name:a.name,value:a.value,checked:d.value,disabled:a.disabled,onChange:c},null,40,f)],10,g))}}),p=(t,n)=>{const a=t.__vccOpts||t;for(const[l,o]of n)a[l]=o;return a},v=p(b,[["__scopeId","data-v-90692348"]]);var x={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]};const V={class:"labels-container"},_={class:"has-text-body-default"},y={key:0,class:"error-message has-text-error content"},N=e.defineComponent({__name:"RadioGroup",props:{groupLabel:{},description:{},choices:{},modelValue:{},error:{type:Boolean},errorMessage:{},disabled:{type:Boolean},className:{}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,l=n,o=r.generateRandomId(),d=e.computed(()=>r.cn("group-container",a.className)),c=e.computed(()=>r.cn("radio-container",a.error&&"radio-container-error has-background-error")),i=e.computed(()=>r.cn("has-text-label-default",a.error&&"has-text-error"));function m(s){l("update:modelValue",s)}return(s,B)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(d.value)},[e.createElementVNode("div",V,[e.createElementVNode("span",{class:e.normalizeClass(i.value)},e.toDisplayString(t.groupLabel),3),e.createElementVNode("span",_,e.toDisplayString(t.description),1)]),e.createElementVNode("div",{class:e.normalizeClass(c.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.choices,(u,h)=>(e.openBlock(),e.createBlock(v,{key:e.unref(o)+h,name:e.unref(o),value:u.value,text:u.text,"model-value":a.modelValue,disabled:a.disabled||u.disabled,error:a.error,"onUpdate:modelValue":m},null,8,["name","value","text","model-value","disabled","error"]))),128)),a.error?(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(e.unref(r.Icon),{style:{height:"fit-content",width:"fit-content",padding:"0"},size:"large",inline:"","aria-hidden":"true","icon-definition":e.unref(x)},null,8,["icon-definition"]),e.createTextVNode(" "+e.toDisplayString(t.errorMessage),1)])):e.createCommentVNode("",!0)],2)],2))}}),k=p(N,[["__scopeId","data-v-e831bcab"]]);exports.Radio=v;exports.RadioGroup=k;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as x, computed as i, createElementBlock as c, openBlock as d, unref as r, normalizeClass as u, createElementVNode as o, createTextVNode as _, toDisplayString as m, createCommentVNode as C, Fragment as N, renderList as R, createBlock as B, createVNode as w } from "vue";
|
|
2
2
|
import { generateRandomId as y, cn as p, Icon as z } from "@phila/phila-ui-core";
|
|
3
|
-
import './index.css';const I = ["for"], E = ["id", "name", "value", "checked", "disabled"], L = /* @__PURE__ */
|
|
3
|
+
import './index.css';const I = ["for"], E = ["id", "name", "value", "checked", "disabled"], L = /* @__PURE__ */ x({
|
|
4
4
|
__name: "Radio",
|
|
5
5
|
props: {
|
|
6
6
|
name: {},
|
|
@@ -17,7 +17,7 @@ import './index.css';const I = ["for"], E = ["id", "name", "value", "checked", "
|
|
|
17
17
|
function v() {
|
|
18
18
|
n("update:modelValue", e.value);
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const b = i(() => p(
|
|
21
21
|
"philaRadio",
|
|
22
22
|
"has-text-body-default",
|
|
23
23
|
e.className,
|
|
@@ -26,7 +26,7 @@ import './index.css';const I = ["for"], E = ["id", "name", "value", "checked", "
|
|
|
26
26
|
e.error && "philaRadio-error"
|
|
27
27
|
));
|
|
28
28
|
return (g, s) => (d(), c("label", {
|
|
29
|
-
class: u(
|
|
29
|
+
class: u(b.value),
|
|
30
30
|
for: r(t)
|
|
31
31
|
}, [
|
|
32
32
|
s[0] || (s[0] = o("svg", {
|
|
@@ -77,7 +77,7 @@ var $ = {
|
|
|
77
77
|
const G = { class: "labels-container" }, U = { class: "has-text-body-default" }, D = {
|
|
78
78
|
key: 0,
|
|
79
79
|
class: "error-message has-text-error content"
|
|
80
|
-
}, F = /* @__PURE__ */
|
|
80
|
+
}, F = /* @__PURE__ */ x({
|
|
81
81
|
__name: "RadioGroup",
|
|
82
82
|
props: {
|
|
83
83
|
groupLabel: {},
|
|
@@ -91,7 +91,7 @@ const G = { class: "labels-container" }, U = { class: "has-text-body-default" },
|
|
|
91
91
|
},
|
|
92
92
|
emits: ["update:modelValue"],
|
|
93
93
|
setup(a, { emit: l }) {
|
|
94
|
-
const e = a, n = l, t = y(), h = i(() => p("group-container", e.className)), v = i(() => p("radio-container", e.error && "radio-container-error has-background-error")),
|
|
94
|
+
const e = a, n = l, t = y(), h = i(() => p("group-container", e.className)), v = i(() => p("radio-container", e.error && "radio-container-error has-background-error")), b = i(() => p("has-text-label-default", e.error && "has-text-error"));
|
|
95
95
|
function g(s) {
|
|
96
96
|
n("update:modelValue", s);
|
|
97
97
|
}
|
|
@@ -100,20 +100,20 @@ const G = { class: "labels-container" }, U = { class: "has-text-body-default" },
|
|
|
100
100
|
}, [
|
|
101
101
|
o("div", G, [
|
|
102
102
|
o("span", {
|
|
103
|
-
class: u(
|
|
103
|
+
class: u(b.value)
|
|
104
104
|
}, m(a.groupLabel), 3),
|
|
105
105
|
o("span", U, m(a.description), 1)
|
|
106
106
|
]),
|
|
107
107
|
o("div", {
|
|
108
108
|
class: u(v.value)
|
|
109
109
|
}, [
|
|
110
|
-
(d(!0), c(N, null, R(e.choices, (
|
|
110
|
+
(d(!0), c(N, null, R(e.choices, (f, k) => (d(), B(M, {
|
|
111
111
|
key: r(t) + k,
|
|
112
112
|
name: r(t),
|
|
113
|
-
value:
|
|
114
|
-
text:
|
|
113
|
+
value: f.value,
|
|
114
|
+
text: f.text,
|
|
115
115
|
"model-value": e.modelValue,
|
|
116
|
-
disabled: e.disabled,
|
|
116
|
+
disabled: e.disabled || f.disabled,
|
|
117
117
|
error: e.error,
|
|
118
118
|
"onUpdate:modelValue": g
|
|
119
119
|
}, null, 8, ["name", "value", "text", "model-value", "disabled", "error"]))), 128)),
|
|
@@ -130,7 +130,7 @@ const G = { class: "labels-container" }, U = { class: "has-text-body-default" },
|
|
|
130
130
|
], 2)
|
|
131
131
|
], 2));
|
|
132
132
|
}
|
|
133
|
-
}), j = /* @__PURE__ */ V(F, [["__scopeId", "data-v-
|
|
133
|
+
}), j = /* @__PURE__ */ V(F, [["__scopeId", "data-v-e831bcab"]]);
|
|
134
134
|
export {
|
|
135
135
|
M as Radio,
|
|
136
136
|
j as RadioGroup
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phila/phila-ui-radio",
|
|
3
|
-
"version": "0.1.1
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A radio input component for Phila UI.",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"vue": "^3.0.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@phila/phila-ui-core": "2.4.0
|
|
31
|
+
"@phila/phila-ui-core": "2.4.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^24.0.0",
|