tuhfa-design-system 0.1.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/README.md +41 -0
- package/dist/src/components/StripePlaceholder.vue.d.ts +13 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/tokens.css +98 -0
- package/dist/tuhfa-design-system.js +25 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# tuhfa-design-system
|
|
2
|
+
|
|
3
|
+
Shared design tokens and presentational Vue components for Tuhfa.
|
|
4
|
+
|
|
5
|
+
## What's here
|
|
6
|
+
|
|
7
|
+
- `tokens.css` — Tailwind v4 `@theme` block (fonts, type scale, colors).
|
|
8
|
+
Import it from your own `style.css` alongside `@import 'tailwindcss'`;
|
|
9
|
+
your project's own Tailwind build generates the utilities
|
|
10
|
+
(`font-sans`, `text-section-title`, `bg-bg-page`, etc.) from it.
|
|
11
|
+
- Vue components with no app-specific dependencies (no store/router/API
|
|
12
|
+
imports) — currently just `StripePlaceholder`.
|
|
13
|
+
|
|
14
|
+
Components that depend on app state, routing, or domain models (nav bars,
|
|
15
|
+
dashboards, banners tied to auth) stay in the consuming app; this package
|
|
16
|
+
only holds framework-agnostic, purely presentational pieces.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npm install tuhfa-design-system
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
/* style.css */
|
|
26
|
+
@import 'tailwindcss';
|
|
27
|
+
@import 'tuhfa-design-system/tokens.css';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```vue
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import { StripePlaceholder } from 'tuhfa-design-system';
|
|
33
|
+
</script>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Development
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
npm install
|
|
40
|
+
npm run build
|
|
41
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
colorA: string;
|
|
3
|
+
colorB: string;
|
|
4
|
+
angle?: number;
|
|
5
|
+
stripeWidth?: number;
|
|
6
|
+
rounded?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
|
+
angle: number;
|
|
10
|
+
stripeWidth: number;
|
|
11
|
+
rounded: boolean;
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as StripePlaceholder } from './components/StripePlaceholder.vue';
|
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Tuhfa design tokens: fonts, type scale, and colors.
|
|
3
|
+
* Tailwind v4 CSS-first `@theme` block, consumed by any project's own
|
|
4
|
+
* Tailwind build (import this file, then Tailwind's utility generation
|
|
5
|
+
* picks up the tokens, e.g. `font-sans`, `text-section-title`, `bg-bg-page`).
|
|
6
|
+
* This package does not depend on Tailwind itself; the consuming app's
|
|
7
|
+
* Tailwind installation does the actual utility generation.
|
|
8
|
+
*/
|
|
9
|
+
@theme {
|
|
10
|
+
/* Fonts. Cairo (--font-sans) is used for BOTH headers and body/UI copy
|
|
11
|
+
* (one family, supports Arabic + Latin natively at matching weights).
|
|
12
|
+
* Rakkas (--font-logo) is logo-only, reserved for the Arabic "تحفة"
|
|
13
|
+
* wordmark, never for headers, body, or repeated UI. */
|
|
14
|
+
--font-sans: 'Cairo', system-ui, sans-serif;
|
|
15
|
+
--font-logo: 'Rakkas', serif;
|
|
16
|
+
|
|
17
|
+
/* Type scale. Weight is carried by Tailwind's stock font-* utilities,
|
|
18
|
+
* which map 1:1 to Cairo's brand weight scale (font-normal=400
|
|
19
|
+
* body/descriptions, font-medium=500 labels/captions/prices/tags,
|
|
20
|
+
* font-bold=700 card titles/buttons/subheads, font-black=900
|
|
21
|
+
* hero/section headlines) -- no separate weight tokens needed. Only
|
|
22
|
+
* sizes without a good Tailwind default get a token here; 14-16px body
|
|
23
|
+
* copy stays on the stock text-sm/text-base. */
|
|
24
|
+
--text-hero: 2.75rem; /* 44px, H1 hero headline */
|
|
25
|
+
--text-hero--line-height: 1.08;
|
|
26
|
+
--text-section-title: 1.75rem; /* 28px, H2 section/page title */
|
|
27
|
+
--text-section-title--line-height: 1.15;
|
|
28
|
+
--text-card-title: 1.125rem; /* 18px, H3 card/item title */
|
|
29
|
+
--text-card-title--line-height: 1.3;
|
|
30
|
+
--text-caption: 0.75rem; /* 12px, caption/label/price/tag */
|
|
31
|
+
--text-caption--line-height: 1.4;
|
|
32
|
+
--text-button: 0.875rem; /* 14px, button/CTA */
|
|
33
|
+
--text-button--line-height: 1;
|
|
34
|
+
|
|
35
|
+
--color-ink: oklch(19% 0.012 55);
|
|
36
|
+
--color-muted-nav-link: oklch(45% 0.01 60);
|
|
37
|
+
--color-muted-nav-cta: oklch(60% 0.01 60);
|
|
38
|
+
--color-muted-card-artist: oklch(55% 0.01 60);
|
|
39
|
+
--color-muted-strip-label: oklch(45% 0.01 60);
|
|
40
|
+
--color-muted-strip-name: oklch(30% 0.012 55);
|
|
41
|
+
--color-muted-footer-link: oklch(55% 0.01 60);
|
|
42
|
+
--color-muted-footer-copyright: oklch(60% 0.01 60);
|
|
43
|
+
--color-muted-404: oklch(88% 0.01 60);
|
|
44
|
+
|
|
45
|
+
--color-accent: oklch(56% 0.13 45);
|
|
46
|
+
|
|
47
|
+
--color-border: oklch(88% 0.008 75);
|
|
48
|
+
|
|
49
|
+
--color-bg-page: oklch(98% 0.004 90);
|
|
50
|
+
--color-bg-strip: oklch(95.5% 0.006 85);
|
|
51
|
+
|
|
52
|
+
/* Stripe-placeholder swatches, feeding StripePlaceholder.vue. "swatch-N"
|
|
53
|
+
* (6 pairs) is the general artwork-card palette; "swatch-avatar-N" (4
|
|
54
|
+
* pairs) is the featured-artist avatar palette; "swatch-hero" is a
|
|
55
|
+
* one-off banner placeholder. */
|
|
56
|
+
--color-swatch-1a: oklch(92% 0.012 90);
|
|
57
|
+
--color-swatch-1b: oklch(88% 0.016 85);
|
|
58
|
+
--color-swatch-2a: oklch(90% 0.014 55);
|
|
59
|
+
--color-swatch-2b: oklch(86% 0.018 50);
|
|
60
|
+
--color-swatch-3a: oklch(91% 0.01 75);
|
|
61
|
+
--color-swatch-3b: oklch(87% 0.014 70);
|
|
62
|
+
--color-swatch-4a: oklch(90% 0.004 90);
|
|
63
|
+
--color-swatch-4b: oklch(85% 0.005 90);
|
|
64
|
+
--color-swatch-5a: oklch(88% 0.02 45);
|
|
65
|
+
--color-swatch-5b: oklch(83% 0.026 40);
|
|
66
|
+
--color-swatch-6a: oklch(86% 0.022 35);
|
|
67
|
+
--color-swatch-6b: oklch(81% 0.028 30);
|
|
68
|
+
|
|
69
|
+
--color-swatch-avatar-1a: oklch(91% 0.012 40);
|
|
70
|
+
--color-swatch-avatar-1b: oklch(87% 0.016 35);
|
|
71
|
+
--color-swatch-avatar-2a: oklch(89% 0.014 90);
|
|
72
|
+
--color-swatch-avatar-2b: oklch(85% 0.018 85);
|
|
73
|
+
--color-swatch-avatar-3a: oklch(90% 0.01 20);
|
|
74
|
+
--color-swatch-avatar-3b: oklch(86% 0.014 15);
|
|
75
|
+
--color-swatch-avatar-4a: oklch(88% 0.01 220);
|
|
76
|
+
--color-swatch-avatar-4b: oklch(84% 0.014 215);
|
|
77
|
+
|
|
78
|
+
--color-swatch-hero-a: oklch(90% 0.01 70);
|
|
79
|
+
--color-swatch-hero-b: oklch(86% 0.015 65);
|
|
80
|
+
|
|
81
|
+
/* Hero overlay scrim: an RGB triplet (not oklch) so it can be composed
|
|
82
|
+
* with `rgb(var(--color-scrim) / <alpha>)` at each gradient stop. */
|
|
83
|
+
--color-scrim: 20 15 10;
|
|
84
|
+
|
|
85
|
+
/* Status pill tokens. Three semantic pairs reused across every
|
|
86
|
+
* status/payout pill: "positive" (Live listing, Paid-out payout),
|
|
87
|
+
* "pending" (Awaiting-delivery payout), "neutral" (Draft/Sold listing). */
|
|
88
|
+
--color-status-positive-bg: oklch(92% 0.05 145);
|
|
89
|
+
--color-status-positive-text: oklch(38% 0.09 145);
|
|
90
|
+
--color-status-pending-bg: oklch(93% 0.06 60);
|
|
91
|
+
--color-status-pending-text: oklch(45% 0.1 60);
|
|
92
|
+
--color-status-neutral-bg: oklch(93% 0.01 70);
|
|
93
|
+
--color-status-neutral-text: oklch(45% 0.01 60);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
body {
|
|
97
|
+
font-family: var(--font-sans);
|
|
98
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createElementBlock as e, defineComponent as t, normalizeClass as n, normalizeStyle as r, openBlock as i } from "vue";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region src/components/StripePlaceholder.vue
|
|
4
|
+
var a = /* @__PURE__ */ t({
|
|
5
|
+
__name: "StripePlaceholder",
|
|
6
|
+
props: {
|
|
7
|
+
colorA: {},
|
|
8
|
+
colorB: {},
|
|
9
|
+
angle: { default: 120 },
|
|
10
|
+
stripeWidth: { default: 16 },
|
|
11
|
+
rounded: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
}
|
|
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 })
|
|
21
|
+
}, null, 6));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { a as StripePlaceholder };
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tuhfa-design-system",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Tuhfa's shared design tokens and presentational Vue components.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"main": "./dist/tuhfa-design-system.js",
|
|
11
|
+
"module": "./dist/tuhfa-design-system.js",
|
|
12
|
+
"types": "./dist/src/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/src/index.d.ts",
|
|
16
|
+
"import": "./dist/tuhfa-design-system.js"
|
|
17
|
+
},
|
|
18
|
+
"./tokens.css": "./dist/tokens.css",
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "vue-tsc --noEmit && vite build && cp src/tokens.css dist/tokens.css",
|
|
23
|
+
"dev": "vite build --watch"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"vue": "^3.5.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
30
|
+
"@vue/tsconfig": "^0.9.1",
|
|
31
|
+
"typescript": "~6.0.2",
|
|
32
|
+
"vite": "^8.1.1",
|
|
33
|
+
"vite-plugin-dts": "^4.5.4",
|
|
34
|
+
"vue": "^3.5.39",
|
|
35
|
+
"vue-tsc": "^3.3.5"
|
|
36
|
+
}
|
|
37
|
+
}
|