@taylorvance/tv-shared-ui 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 ADDED
@@ -0,0 +1,70 @@
1
+ # `@taylorvance/tv-shared-ui`
2
+
3
+ Shared React UI primitives for Taylor Vance portfolio projects.
4
+
5
+ ## Current exports
6
+
7
+ - `BrandBadge`
8
+ - `TvProgramsMark`
9
+ - `TVPROGRAMS_MARK_SVG_URL`
10
+ - `TVPROGRAMS_MARK_PNG_URL`
11
+ - `TVPROGRAMS_URL`
12
+ - `TVPROGRAMS_HOSTNAME`
13
+ - `TVPROGRAMS_DEFAULT_LABEL`
14
+ - `brandBadgeClassNames`
15
+
16
+ ## Design goals
17
+
18
+ - Keep primitives small and stable.
19
+ - Stay CSS-agnostic by default.
20
+ - Work in utility-class and plain-CSS apps.
21
+ - Prefer composition and slot hooks over opinionated app styling.
22
+
23
+ ## `BrandBadge`
24
+
25
+ Quick default usage:
26
+
27
+ ```tsx
28
+ import { BrandBadge } from '@taylorvance/tv-shared-ui';
29
+
30
+ export function Footer() {
31
+ return <BrandBadge />;
32
+ }
33
+ ```
34
+
35
+ Consumer-owned styling:
36
+
37
+ ```tsx
38
+ import { BrandBadge } from '@taylorvance/tv-shared-ui';
39
+
40
+ export function Footer() {
41
+ return (
42
+ <BrandBadge
43
+ className="brand-badge"
44
+ iconClassName="brand-badge-icon"
45
+ labelClassName="brand-badge-label"
46
+ unstyled
47
+ />
48
+ );
49
+ }
50
+ ```
51
+
52
+ ## Logo assets
53
+
54
+ React component:
55
+
56
+ ```tsx
57
+ import { TvProgramsMark } from '@taylorvance/tv-shared-ui';
58
+ ```
59
+
60
+ URL exports:
61
+
62
+ ```tsx
63
+ import { TVPROGRAMS_MARK_SVG_URL } from '@taylorvance/tv-shared-ui';
64
+ ```
65
+
66
+ Raw asset subpaths:
67
+
68
+ ```tsx
69
+ import tvMarkUrl from '@taylorvance/tv-shared-ui/tv.svg';
70
+ ```
package/assets/tv.png ADDED
Binary file
package/assets/tv.svg ADDED
@@ -0,0 +1,11 @@
1
+ <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 998.000000 998.000000" preserveAspectRatio="xMidYMid meet">
2
+ <metadata>Created by potrace 1.11, written by Peter Selinger 2001-2013</metadata>
3
+ <g transform="translate(0.000000,998.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none">
4
+ <path d="M7844 6005 c-472 -1180 -861 -2145 -864 -2145 -3 0 -379 932 -834
5
+ 2070 l-828 2070 -2419 0 -2419 0 0 -500 0 -500 1000 0 1000 0 0 -2500 0 -2500
6
+ 500 0 500 0 0 2500 0 2500 582 -2 582 -3 1165 -2913 c641 -1601 1168 -2912
7
+ 1171 -2912 3 0 595 1473 1315 3273 720 1799 1314 3286 1322 3304 l13 31 -418
8
+ 167 c-229 92 -438 175 -464 186 l-46 18 -858 -2144z"
9
+ />
10
+ </g>
11
+ </svg>
@@ -0,0 +1,15 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ export declare const brandBadgeClassNames: {
3
+ readonly root: "tv-shared-brand-badge";
4
+ readonly icon: "tv-shared-brand-badge__icon";
5
+ readonly label: "tv-shared-brand-badge__label";
6
+ };
7
+ export type BrandBadgeProps = Omit<ComponentPropsWithoutRef<'a'>, 'children'> & {
8
+ icon?: ReactNode;
9
+ iconClassName?: string;
10
+ label?: ReactNode;
11
+ labelClassName?: string;
12
+ unstyled?: boolean;
13
+ };
14
+ export declare function BrandBadge({ className, href, icon, iconClassName, label, labelClassName, rel, style, target, unstyled, ...props }: BrandBadgeProps): import("react/jsx-runtime").JSX.Element;
15
+ //# sourceMappingURL=BrandBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandBadge.d.ts","sourceRoot":"","sources":["../src/BrandBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA+BhF,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,GAAG;IAC9E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,IAAqB,EACrB,IAAI,EACJ,aAAa,EACb,KAAgC,EAChC,cAAc,EACd,GAAkB,EAClB,KAAK,EACL,MAAiB,EACjB,QAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,2CAyBjB"}
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { TVPROGRAMS_DEFAULT_LABEL, TVPROGRAMS_URL, } from './constants.js';
3
+ import { TvProgramsMark } from './TvProgramsMark.js';
4
+ const DEFAULT_ROOT_STYLE = {
5
+ alignItems: 'center',
6
+ backgroundColor: '#ffffff',
7
+ border: '1px solid #d1d5db',
8
+ borderRadius: '999px',
9
+ boxShadow: '0 1px 2px rgba(15, 23, 42, 0.08)',
10
+ color: '#374151',
11
+ display: 'inline-flex',
12
+ fontFamily: 'inherit',
13
+ fontSize: '0.875rem',
14
+ fontWeight: 600,
15
+ gap: '0.5rem',
16
+ lineHeight: 1,
17
+ padding: '0.45rem 0.8rem',
18
+ textDecoration: 'none',
19
+ };
20
+ const DEFAULT_ICON_STYLE = {
21
+ display: 'block',
22
+ flexShrink: 0,
23
+ height: '1rem',
24
+ width: '1rem',
25
+ };
26
+ export const brandBadgeClassNames = {
27
+ root: 'tv-shared-brand-badge',
28
+ icon: 'tv-shared-brand-badge__icon',
29
+ label: 'tv-shared-brand-badge__label',
30
+ };
31
+ export function BrandBadge({ className, href = TVPROGRAMS_URL, icon, iconClassName, label = TVPROGRAMS_DEFAULT_LABEL, labelClassName, rel = 'noreferrer', style, target = '_blank', unstyled = false, ...props }) {
32
+ const rootClassName = [brandBadgeClassNames.root, className].filter(Boolean).join(' ');
33
+ const iconSlotClassName = [brandBadgeClassNames.icon, iconClassName].filter(Boolean).join(' ');
34
+ const labelSlotClassName = [brandBadgeClassNames.label, labelClassName].filter(Boolean).join(' ');
35
+ const mergedStyle = unstyled ? style : { ...DEFAULT_ROOT_STYLE, ...style };
36
+ return (_jsxs("a", { className: rootClassName, href: href, rel: rel, style: mergedStyle, target: target, ...props, children: [_jsx("span", { "aria-hidden": "true", className: iconSlotClassName, style: unstyled ? undefined : DEFAULT_ICON_STYLE, children: icon ?? _jsx(TvProgramsMark, { className: iconSlotClassName, style: unstyled ? undefined : DEFAULT_ICON_STYLE }) }), _jsx("span", { className: labelSlotClassName, children: label })] }));
37
+ }
@@ -0,0 +1,6 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ export type TvProgramsMarkProps = Omit<ComponentPropsWithoutRef<'svg'>, 'children'> & {
3
+ title?: string;
4
+ };
5
+ export declare function TvProgramsMark({ title, ...props }: TvProgramsMarkProps): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=TvProgramsMark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TvProgramsMark.d.ts","sourceRoot":"","sources":["../src/TvProgramsMark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,mBAAmB,2CAiBrB"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function TvProgramsMark({ title, ...props }) {
3
+ const accessibleProps = title
4
+ ? { role: 'img' }
5
+ : { 'aria-hidden': true };
6
+ return (_jsxs("svg", { viewBox: "0 0 998 998", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...accessibleProps, ...props, children: [title ? _jsx("title", { children: title }) : null, _jsx("path", { d: "M7844 6005c-472-1180-861-2145-864-2145-3 0-379 932-834 2070L5318 8000H4809 2390v-500-500h1000 1000V4000 1500h500 500V4000 6500l582-2 582-3 1165-2913c641-1601 1168-2912 1171-2912 3 0 595 1473 1315 3273 720 1799 1314 3286 1322 3304l13 31-418 167c-229 92-438 175-464 186l-46 18-858-2144z" })] }));
7
+ }
@@ -0,0 +1,3 @@
1
+ export declare const TVPROGRAMS_MARK_SVG_URL: string;
2
+ export declare const TVPROGRAMS_MARK_PNG_URL: string;
3
+ //# sourceMappingURL=assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,QAAoD,CAAC;AACzF,eAAO,MAAM,uBAAuB,QAAoD,CAAC"}
package/dist/assets.js ADDED
@@ -0,0 +1,2 @@
1
+ export const TVPROGRAMS_MARK_SVG_URL = new URL('../assets/tv.svg', import.meta.url).href;
2
+ export const TVPROGRAMS_MARK_PNG_URL = new URL('../assets/tv.png', import.meta.url).href;
@@ -0,0 +1,4 @@
1
+ export declare const TVPROGRAMS_URL = "https://tvprograms.tech";
2
+ export declare const TVPROGRAMS_HOSTNAME = "tvprograms.tech";
3
+ export declare const TVPROGRAMS_DEFAULT_LABEL = "tvprograms.tech";
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,4BAA4B,CAAC;AACxD,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,wBAAwB,oBAAsB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const TVPROGRAMS_URL = 'https://tvprograms.tech';
2
+ export const TVPROGRAMS_HOSTNAME = 'tvprograms.tech';
3
+ export const TVPROGRAMS_DEFAULT_LABEL = TVPROGRAMS_HOSTNAME;
@@ -0,0 +1,5 @@
1
+ export { BrandBadge, brandBadgeClassNames, type BrandBadgeProps, } from './BrandBadge.js';
2
+ export { TVPROGRAMS_MARK_PNG_URL, TVPROGRAMS_MARK_SVG_URL, } from './assets.js';
3
+ export { TVPROGRAMS_DEFAULT_LABEL, TVPROGRAMS_HOSTNAME, TVPROGRAMS_URL, } from './constants.js';
4
+ export { TvProgramsMark, type TvProgramsMarkProps, } from './TvProgramsMark.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,KAAK,eAAe,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,qBAAqB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { BrandBadge, brandBadgeClassNames, } from './BrandBadge.js';
2
+ export { TVPROGRAMS_MARK_PNG_URL, TVPROGRAMS_MARK_SVG_URL, } from './assets.js';
3
+ export { TVPROGRAMS_DEFAULT_LABEL, TVPROGRAMS_HOSTNAME, TVPROGRAMS_URL, } from './constants.js';
4
+ export { TvProgramsMark, } from './TvProgramsMark.js';
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@taylorvance/tv-shared-ui",
3
+ "version": "0.1.0",
4
+ "description": "Shared React UI primitives for Taylor Vance portfolio projects.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./tv.svg": "./assets/tv.svg",
15
+ "./tv.png": "./assets/tv.png"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "assets",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "build": "node ../../scripts/build-ui-package.mjs"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "peerDependencies": {
29
+ "react": "^18.3.0 || ^19.0.0"
30
+ }
31
+ }