@charpente-ui/vue 1.0.0-beta.2
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/README.md +35 -0
- package/dist/charpente.js +97 -0
- package/dist/charpente.umd.cjs +1 -0
- package/dist/components/BaseButton.d.ts +22 -0
- package/dist/components/BaseCheckbox.d.ts +12 -0
- package/dist/components/BaseInput.d.ts +9 -0
- package/dist/components/BaseLabel.d.ts +17 -0
- package/dist/components/BaseTextarea.d.ts +9 -0
- package/dist/index.d.ts +5 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Charpente UI
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@charpente-ui/vue)
|
|
4
|
+
[](https://www.npmjs.com/package/@charpente-ui/vue)
|
|
5
|
+
[](https://www.npmjs.com/package/@charpente-ui/vue)
|
|
6
|
+
|
|
7
|
+
## Introduction
|
|
8
|
+
|
|
9
|
+
Charpente UI is a headless CSS Vue component library.
|
|
10
|
+
|
|
11
|
+
## Installing
|
|
12
|
+
|
|
13
|
+
```shell
|
|
14
|
+
npm install @charpente-ui/vue
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
import { CButton } from '@charpente-ui/vue';
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<CButton>Click me</CButton>
|
|
24
|
+
</template>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Components
|
|
28
|
+
|
|
29
|
+
| Name | Tag | Status |
|
|
30
|
+
|----------|-------------|--------|
|
|
31
|
+
| Button | `CButton` | Ready |
|
|
32
|
+
| Input | `CInput` | Ready |
|
|
33
|
+
| Label | `CLabel` | Ready |
|
|
34
|
+
| Textarea | `CTextarea` | Ready |
|
|
35
|
+
| Checkbox | `CCheckbox` | Ready |
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { defineComponent as n, openBlock as u, createBlock as A, resolveDynamicComponent as B, normalizeProps as b, guardReactiveProps as y, withCtx as g, renderSlot as v, useAttrs as i, useId as c, computed as I, createElementBlock as m, mergeProps as p, unref as _, useModel as $, withDirectives as C, vModelDynamic as M, vModelText as w } from "vue";
|
|
2
|
+
const z = /* @__PURE__ */ n({
|
|
3
|
+
inheritAttrs: !1,
|
|
4
|
+
__name: "BaseButton",
|
|
5
|
+
props: {
|
|
6
|
+
as: { default: "button" }
|
|
7
|
+
},
|
|
8
|
+
setup(a) {
|
|
9
|
+
return (t, e) => (u(), A(B(a.as), b(y(t.$attrs)), {
|
|
10
|
+
default: g(() => [
|
|
11
|
+
v(t.$slots, "default")
|
|
12
|
+
]),
|
|
13
|
+
_: 3
|
|
14
|
+
}, 16));
|
|
15
|
+
}
|
|
16
|
+
}), D = ["id", "checked"], E = /* @__PURE__ */ n({
|
|
17
|
+
inheritAttrs: !1,
|
|
18
|
+
__name: "BaseCheckbox",
|
|
19
|
+
props: {
|
|
20
|
+
modelValue: { type: [Boolean, Array], default: !1 },
|
|
21
|
+
value: {}
|
|
22
|
+
},
|
|
23
|
+
emits: ["update:modelValue"],
|
|
24
|
+
setup(a, { emit: t }) {
|
|
25
|
+
const e = a, l = i().id || c(), o = I(() => Array.isArray(e.modelValue) ? e.modelValue.includes(e.value) : e.modelValue), r = t, k = (f) => {
|
|
26
|
+
const h = f.target.checked;
|
|
27
|
+
if (Array.isArray(e.modelValue)) {
|
|
28
|
+
const d = [...e.modelValue];
|
|
29
|
+
if (h)
|
|
30
|
+
d.push(e.value);
|
|
31
|
+
else {
|
|
32
|
+
const V = d.indexOf(e.value);
|
|
33
|
+
V > -1 && d.splice(V, 1);
|
|
34
|
+
}
|
|
35
|
+
r("update:modelValue", d);
|
|
36
|
+
} else
|
|
37
|
+
r("update:modelValue", h);
|
|
38
|
+
};
|
|
39
|
+
return (f, x) => (u(), m("input", p({
|
|
40
|
+
id: _(l),
|
|
41
|
+
type: "checkbox"
|
|
42
|
+
}, f.$attrs, {
|
|
43
|
+
checked: o.value,
|
|
44
|
+
onChange: k
|
|
45
|
+
}), null, 16, D));
|
|
46
|
+
}
|
|
47
|
+
}), P = ["id"], O = /* @__PURE__ */ n({
|
|
48
|
+
inheritAttrs: !1,
|
|
49
|
+
__name: "BaseInput",
|
|
50
|
+
props: {
|
|
51
|
+
modelValue: {},
|
|
52
|
+
modelModifiers: {}
|
|
53
|
+
},
|
|
54
|
+
emits: ["update:modelValue"],
|
|
55
|
+
setup(a) {
|
|
56
|
+
const t = $(a, "modelValue"), s = i().id || c();
|
|
57
|
+
return (l, o) => C((u(), m("input", p({
|
|
58
|
+
id: _(s),
|
|
59
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r)
|
|
60
|
+
}, l.$attrs), null, 16, P)), [
|
|
61
|
+
[M, t.value]
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
}), T = ["id"], R = /* @__PURE__ */ n({
|
|
65
|
+
inheritAttrs: !1,
|
|
66
|
+
__name: "BaseLabel",
|
|
67
|
+
setup(a) {
|
|
68
|
+
const e = i().id || c();
|
|
69
|
+
return (s, l) => (u(), m("label", p({ id: _(e) }, s.$attrs), [
|
|
70
|
+
v(s.$slots, "default")
|
|
71
|
+
], 16, T));
|
|
72
|
+
}
|
|
73
|
+
}), L = ["id"], S = /* @__PURE__ */ n({
|
|
74
|
+
inheritAttrs: !1,
|
|
75
|
+
__name: "BaseTextarea",
|
|
76
|
+
props: {
|
|
77
|
+
modelValue: {},
|
|
78
|
+
modelModifiers: {}
|
|
79
|
+
},
|
|
80
|
+
emits: ["update:modelValue"],
|
|
81
|
+
setup(a) {
|
|
82
|
+
const t = $(a, "modelValue"), s = i().id || c();
|
|
83
|
+
return (l, o) => C((u(), m("textarea", p({
|
|
84
|
+
id: _(s),
|
|
85
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r)
|
|
86
|
+
}, l.$attrs), null, 16, L)), [
|
|
87
|
+
[w, t.value]
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
export {
|
|
92
|
+
z as CButton,
|
|
93
|
+
E as CCheckbox,
|
|
94
|
+
O as CInput,
|
|
95
|
+
R as CLabel,
|
|
96
|
+
S as CTextarea
|
|
97
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.Charpente={},n.Vue))})(this,(function(n,e){"use strict";const u=e.defineComponent({inheritAttrs:!1,__name:"BaseButton",props:{as:{default:"button"}},setup(s){return(o,t)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.as),e.normalizeProps(e.guardReactiveProps(o.$attrs)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),f=["id","checked"],h=e.defineComponent({inheritAttrs:!1,__name:"BaseCheckbox",props:{modelValue:{type:[Boolean,Array],default:!1},value:{}},emits:["update:modelValue"],setup(s,{emit:o}){const t=s,l=e.useAttrs().id||e.useId(),r=e.computed(()=>Array.isArray(t.modelValue)?t.modelValue.includes(t.value):t.modelValue),d=o,$=c=>{const m=c.target.checked;if(Array.isArray(t.modelValue)){const i=[...t.modelValue];if(m)i.push(t.value);else{const p=i.indexOf(t.value);p>-1&&i.splice(p,1)}d("update:modelValue",i)}else d("update:modelValue",m)};return(c,y)=>(e.openBlock(),e.createElementBlock("input",e.mergeProps({id:e.unref(l),type:"checkbox"},c.$attrs,{checked:r.value,onChange:$}),null,16,f))}}),_=["id"],k=e.defineComponent({inheritAttrs:!1,__name:"BaseInput",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(s){const o=e.useModel(s,"modelValue"),a=e.useAttrs().id||e.useId();return(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({id:e.unref(a),"onUpdate:modelValue":r[0]||(r[0]=d=>o.value=d)},l.$attrs),null,16,_)),[[e.vModelDynamic,o.value]])}}),V=["id"],B=e.defineComponent({inheritAttrs:!1,__name:"BaseLabel",setup(s){const t=e.useAttrs().id||e.useId();return(a,l)=>(e.openBlock(),e.createElementBlock("label",e.mergeProps({id:e.unref(t)},a.$attrs),[e.renderSlot(a.$slots,"default")],16,V))}}),C=["id"],A=e.defineComponent({inheritAttrs:!1,__name:"BaseTextarea",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(s){const o=e.useModel(s,"modelValue"),a=e.useAttrs().id||e.useId();return(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",e.mergeProps({id:e.unref(a),"onUpdate:modelValue":r[0]||(r[0]=d=>o.value=d)},l.$attrs),null,16,C)),[[e.vModelText,o.value]])}});n.CButton=u,n.CCheckbox=h,n.CInput=k,n.CLabel=B,n.CTextarea=A,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
as?: string | object;
|
|
3
|
+
};
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
attrs: Partial<{}>;
|
|
6
|
+
slots: {
|
|
7
|
+
default?(_: {}): any;
|
|
8
|
+
};
|
|
9
|
+
refs: {};
|
|
10
|
+
rootEl: any;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
14
|
+
as: string | object;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: boolean | any[];
|
|
3
|
+
value?: any;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
6
|
+
"update:modelValue": (value: boolean | any[]) => any;
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
+
"onUpdate:modelValue"?: ((value: boolean | any[]) => any) | undefined;
|
|
9
|
+
}>, {
|
|
10
|
+
modelValue: boolean | any[];
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_PublicProps = {
|
|
2
|
+
modelValue?: string | number;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
+
"update:modelValue": (value: string | number) => any;
|
|
6
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
7
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: any;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_PublicProps = {
|
|
2
|
+
modelValue?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
+
"update:modelValue": (value: string) => any;
|
|
6
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
7
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as CButton } from './components/BaseButton';
|
|
2
|
+
export { default as CCheckbox } from './components/BaseCheckbox';
|
|
3
|
+
export { default as CInput } from './components/BaseInput';
|
|
4
|
+
export { default as CLabel } from './components/BaseLabel';
|
|
5
|
+
export { default as CTextarea } from './components/BaseTextarea';
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@charpente-ui/vue",
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
|
+
"description": "Charpente UI is a headless CSS Vue component library.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"prepare": "husky && npm run build",
|
|
9
|
+
"release": "semantic-release"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=24"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/charpente.umd.cjs",
|
|
15
|
+
"module": "./dist/charpente.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/charpente.js",
|
|
21
|
+
"require": "./dist/charpente.umd.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@commitlint/cli": "^20.4.2",
|
|
26
|
+
"@commitlint/config-conventional": "^20.4.2",
|
|
27
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
28
|
+
"@semantic-release/git": "^10.0.1",
|
|
29
|
+
"@semantic-release/github": "^12.0.6",
|
|
30
|
+
"@vitejs/plugin-vue": "^6.0.4",
|
|
31
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
32
|
+
"husky": "^9.1.7",
|
|
33
|
+
"semantic-release": "^25.0.3",
|
|
34
|
+
"vite": "^7.3.1",
|
|
35
|
+
"vite-plugin-dts": "^4.5.4",
|
|
36
|
+
"vue": "^3.5.29"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
}
|
|
44
|
+
}
|