tuhfa-design-system 0.1.0 → 0.2.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.
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ size?: number;
3
+ colorA: string;
4
+ colorB: string;
5
+ }
6
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
7
+ size: number;
8
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
9
+ export default _default;
@@ -0,0 +1,34 @@
1
+ interface Props {
2
+ variant?: 'primary' | 'outline';
3
+ size?: 'sm' | 'md';
4
+ fullWidth?: boolean;
5
+ disabled?: boolean;
6
+ type?: 'button' | 'submit';
7
+ }
8
+ declare function __VLS_template(): {
9
+ attrs: Partial<{}>;
10
+ slots: {
11
+ default?(_: {}): any;
12
+ };
13
+ refs: {};
14
+ rootEl: HTMLButtonElement;
15
+ };
16
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
+ click: (event: MouseEvent) => any;
19
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
20
+ onClick?: ((event: MouseEvent) => any) | undefined;
21
+ }>, {
22
+ type: "button" | "submit";
23
+ size: "sm" | "md";
24
+ variant: "primary" | "outline";
25
+ fullWidth: boolean;
26
+ disabled: boolean;
27
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
28
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
29
+ export default _default;
30
+ type __VLS_WithTemplateSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,14 @@
1
+ interface Props {
2
+ label?: string;
3
+ disabled?: boolean;
4
+ }
5
+ type __VLS_Props = Props;
6
+ type __VLS_PublicProps = {
7
+ modelValue?: boolean;
8
+ } & __VLS_Props;
9
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ "update:modelValue": (value: boolean) => any;
11
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLabelElement>;
14
+ export default _default;
@@ -0,0 +1,20 @@
1
+ interface Props {
2
+ label?: string;
3
+ type?: string;
4
+ placeholder?: string;
5
+ error?: string;
6
+ disabled?: boolean;
7
+ autocomplete?: string;
8
+ }
9
+ type __VLS_Props = Props;
10
+ type __VLS_PublicProps = {
11
+ modelValue?: string;
12
+ } & __VLS_Props;
13
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ "update:modelValue": (value: string) => any;
15
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
16
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
17
+ }>, {
18
+ type: string;
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLabelElement>;
20
+ export default _default;
@@ -0,0 +1,10 @@
1
+ interface Props {
2
+ label: string;
3
+ active?: boolean;
4
+ }
5
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
6
+ click: () => any;
7
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
8
+ onClick?: (() => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
10
+ export default _default;
@@ -0,0 +1,20 @@
1
+ interface Props {
2
+ status: 'positive' | 'pending' | 'neutral';
3
+ }
4
+ declare function __VLS_template(): {
5
+ attrs: Partial<{}>;
6
+ slots: {
7
+ default?(_: {}): any;
8
+ };
9
+ refs: {};
10
+ rootEl: HTMLSpanElement;
11
+ };
12
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
14
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
15
+ export default _default;
16
+ type __VLS_WithTemplateSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,18 @@
1
+ interface Props {
2
+ label?: string;
3
+ rows?: number;
4
+ placeholder?: string;
5
+ disabled?: boolean;
6
+ }
7
+ type __VLS_Props = Props;
8
+ type __VLS_PublicProps = {
9
+ modelValue?: string;
10
+ } & __VLS_Props;
11
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
+ "update:modelValue": (value: string) => any;
13
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
15
+ }>, {
16
+ rows: number;
17
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLabelElement>;
18
+ export default _default;
@@ -1 +1,8 @@
1
+ export { default as Avatar } from './components/Avatar.vue';
2
+ export { default as Button } from './components/Button.vue';
3
+ export { default as Checkbox } from './components/Checkbox.vue';
4
+ export { default as Input } from './components/Input.vue';
5
+ export { default as NavTab } from './components/NavTab.vue';
6
+ export { default as StatusPill } from './components/StatusPill.vue';
1
7
  export { default as StripePlaceholder } from './components/StripePlaceholder.vue';
8
+ export { default as Textarea } from './components/Textarea.vue';
package/dist/tokens.css CHANGED
@@ -46,6 +46,10 @@
46
46
 
47
47
  --color-border: oklch(88% 0.008 75);
48
48
 
49
+ /* Radius + card shadow, backing the Button/Input/Textarea/Avatar/etc. components below. */
50
+ --radius-sm: 3px;
51
+ --shadow-card: 0 1px 2px rgb(0 0 0 / 0.05);
52
+
49
53
  --color-bg-page: oklch(98% 0.004 90);
50
54
  --color-bg-strip: oklch(95.5% 0.006 85);
51
55
 
@@ -1,7 +1,7 @@
1
- import { createElementBlock as e, defineComponent as t, normalizeClass as n, normalizeStyle as r, openBlock as i } from "vue";
1
+ import { createCommentVNode as e, createElementBlock as t, createElementVNode as n, createVNode as r, defineComponent as i, mergeModels as a, normalizeClass as o, normalizeStyle as s, openBlock as c, renderSlot as l, toDisplayString as u, useModel as d, vModelCheckbox as f, vModelDynamic as p, vModelText as m, withDirectives as h } from "vue";
2
2
  //#endregion
3
3
  //#region src/components/StripePlaceholder.vue
4
- var a = /* @__PURE__ */ t({
4
+ var g = /* @__PURE__ */ i({
5
5
  __name: "StripePlaceholder",
6
6
  props: {
7
7
  colorA: {},
@@ -13,13 +13,189 @@ var a = /* @__PURE__ */ t({
13
13
  default: !1
14
14
  }
15
15
  },
16
- setup(t) {
17
- let a = t, o = `repeating-linear-gradient(${a.angle}deg, ${a.colorA}, ${a.colorA} ${a.stripeWidth}px, ${a.colorB} ${a.stripeWidth}px, ${a.colorB} ${a.stripeWidth * 2}px)`;
18
- return (a, s) => (i(), e("div", {
19
- class: n(["h-full w-full", t.rounded ? "rounded-full" : ""]),
20
- style: r({ backgroundImage: o })
16
+ setup(e) {
17
+ let n = e, r = `repeating-linear-gradient(${n.angle}deg, ${n.colorA}, ${n.colorA} ${n.stripeWidth}px, ${n.colorB} ${n.stripeWidth}px, ${n.colorB} ${n.stripeWidth * 2}px)`;
18
+ return (n, i) => (c(), t("div", {
19
+ class: o(["h-full w-full", e.rounded ? "rounded-full" : ""]),
20
+ style: s({ backgroundImage: r })
21
21
  }, null, 6));
22
22
  }
23
+ }), _ = /* @__PURE__ */ i({
24
+ __name: "Avatar",
25
+ props: {
26
+ size: { default: 32 },
27
+ colorA: {},
28
+ colorB: {}
29
+ },
30
+ setup(e) {
31
+ let n = e;
32
+ return (i, a) => (c(), t("div", {
33
+ class: "overflow-hidden rounded-full",
34
+ style: s({
35
+ width: `${n.size}px`,
36
+ height: `${n.size}px`,
37
+ boxShadow: "0 0 0 1.5px var(--color-border)"
38
+ })
39
+ }, [r(g, {
40
+ "color-a": e.colorA,
41
+ "color-b": e.colorB,
42
+ angle: 135,
43
+ "stripe-width": n.size / 4,
44
+ rounded: ""
45
+ }, null, 8, [
46
+ "color-a",
47
+ "color-b",
48
+ "stripe-width"
49
+ ])], 4));
50
+ }
51
+ }), v = ["type", "disabled"], y = /* @__PURE__ */ i({
52
+ __name: "Button",
53
+ props: {
54
+ variant: { default: "primary" },
55
+ size: { default: "md" },
56
+ fullWidth: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ disabled: {
61
+ type: Boolean,
62
+ default: !1
63
+ },
64
+ type: { default: "button" }
65
+ },
66
+ emits: ["click"],
67
+ setup(e, { emit: n }) {
68
+ let r = e, i = n;
69
+ function a(e) {
70
+ r.disabled || i("click", e);
71
+ }
72
+ return (n, r) => (c(), t("button", {
73
+ type: e.type,
74
+ disabled: e.disabled,
75
+ class: o(["inline-flex items-center justify-center rounded-sm text-button font-bold transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60", [
76
+ e.variant === "primary" ? "bg-accent text-white" : "border border-border bg-transparent text-ink",
77
+ e.size === "sm" ? "px-4 py-2" : "px-5 py-3",
78
+ e.fullWidth ? "w-full" : "w-auto"
79
+ ]]),
80
+ onClick: a
81
+ }, [l(n.$slots, "default")], 10, v));
82
+ }
83
+ }), b = ["disabled"], x = {
84
+ key: 0,
85
+ class: "text-sm text-ink"
86
+ }, S = /* @__PURE__ */ i({
87
+ __name: "Checkbox",
88
+ props: /*@__PURE__*/ a({
89
+ label: {},
90
+ disabled: { type: Boolean }
91
+ }, {
92
+ modelValue: { type: Boolean },
93
+ modelModifiers: {}
94
+ }),
95
+ emits: ["update:modelValue"],
96
+ setup(r) {
97
+ let i = d(r, "modelValue");
98
+ return (a, s) => (c(), t("label", { class: o(["inline-flex items-center gap-2", r.disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"]) }, [h(n("input", {
99
+ "onUpdate:modelValue": s[0] ||= (e) => i.value = e,
100
+ type: "checkbox",
101
+ disabled: r.disabled,
102
+ class: "h-4 w-4 rounded-sm border-border accent-accent"
103
+ }, null, 8, b), [[f, i.value]]), r.label ? (c(), t("span", x, u(r.label), 1)) : e("", !0)], 2));
104
+ }
105
+ }), C = { class: "block" }, w = {
106
+ key: 0,
107
+ class: "mb-1.5 block text-xs text-muted-nav-link"
108
+ }, T = [
109
+ "type",
110
+ "placeholder",
111
+ "disabled",
112
+ "autocomplete"
113
+ ], E = {
114
+ key: 1,
115
+ class: "mt-1.5 text-caption text-accent"
116
+ }, D = /* @__PURE__ */ i({
117
+ __name: "Input",
118
+ props: /*@__PURE__*/ a({
119
+ label: {},
120
+ type: { default: "text" },
121
+ placeholder: {},
122
+ error: {},
123
+ disabled: { type: Boolean },
124
+ autocomplete: {}
125
+ }, {
126
+ modelValue: {},
127
+ modelModifiers: {}
128
+ }),
129
+ emits: ["update:modelValue"],
130
+ setup(r) {
131
+ let i = d(r, "modelValue");
132
+ return (a, s) => (c(), t("label", C, [
133
+ r.label ? (c(), t("span", w, u(r.label), 1)) : e("", !0),
134
+ h(n("input", {
135
+ "onUpdate:modelValue": s[0] ||= (e) => i.value = e,
136
+ type: r.type,
137
+ placeholder: r.placeholder,
138
+ disabled: r.disabled,
139
+ autocomplete: r.autocomplete,
140
+ class: o(["w-full rounded-sm border px-3.5 py-3 text-sm text-ink outline-none focus:border-accent disabled:cursor-not-allowed disabled:opacity-60", r.error ? "border-accent" : "border-border"])
141
+ }, null, 10, T), [[p, i.value]]),
142
+ r.error ? (c(), t("p", E, u(r.error), 1)) : e("", !0)
143
+ ]));
144
+ }
145
+ }), O = /* @__PURE__ */ i({
146
+ __name: "NavTab",
147
+ props: {
148
+ label: {},
149
+ active: { type: Boolean }
150
+ },
151
+ emits: ["click"],
152
+ setup(e, { emit: n }) {
153
+ let r = n;
154
+ return (n, i) => (c(), t("button", {
155
+ type: "button",
156
+ class: o(["flex h-10 w-full cursor-pointer items-center rounded-sm px-3 text-left text-sm transition-colors", e.active ? "bg-bg-strip font-bold text-ink" : "text-muted-nav-link hover:bg-bg-strip hover:text-ink"]),
157
+ onClick: i[0] ||= (e) => r("click")
158
+ }, u(e.label), 3));
159
+ }
160
+ }), k = /* @__PURE__ */ i({
161
+ __name: "StatusPill",
162
+ props: { status: {} },
163
+ setup(e) {
164
+ return (n, r) => (c(), t("span", { class: o(["inline-flex items-center rounded-full px-2.5 py-1 text-caption font-medium", {
165
+ "bg-status-positive-bg text-status-positive-text": e.status === "positive",
166
+ "bg-status-pending-bg text-status-pending-text": e.status === "pending",
167
+ "bg-status-neutral-bg text-status-neutral-text": e.status === "neutral"
168
+ }]) }, [l(n.$slots, "default")], 2));
169
+ }
170
+ }), A = { class: "block" }, j = {
171
+ key: 0,
172
+ class: "mb-1.5 block text-xs text-muted-nav-link"
173
+ }, M = [
174
+ "rows",
175
+ "placeholder",
176
+ "disabled"
177
+ ], N = /* @__PURE__ */ i({
178
+ __name: "Textarea",
179
+ props: /*@__PURE__*/ a({
180
+ label: {},
181
+ rows: { default: 3 },
182
+ placeholder: {},
183
+ disabled: { type: Boolean }
184
+ }, {
185
+ modelValue: {},
186
+ modelModifiers: {}
187
+ }),
188
+ emits: ["update:modelValue"],
189
+ setup(r) {
190
+ let i = d(r, "modelValue");
191
+ return (a, o) => (c(), t("label", A, [r.label ? (c(), t("span", j, u(r.label), 1)) : e("", !0), h(n("textarea", {
192
+ "onUpdate:modelValue": o[0] ||= (e) => i.value = e,
193
+ rows: r.rows,
194
+ placeholder: r.placeholder,
195
+ disabled: r.disabled,
196
+ class: "w-full rounded-sm border border-border px-3.5 py-3 text-sm text-ink outline-none focus:border-accent disabled:cursor-not-allowed disabled:opacity-60"
197
+ }, null, 8, M), [[m, i.value]])]));
198
+ }
23
199
  });
24
200
  //#endregion
25
- export { a as StripePlaceholder };
201
+ export { _ as Avatar, y as Button, S as Checkbox, D as Input, O as NavTab, k as StatusPill, g as StripePlaceholder, N as Textarea };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuhfa-design-system",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Tuhfa's shared design tokens and presentational Vue components.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",