@livo-tv/blocks 1.37.2-pr.8.fc59619 → 1.38.0-rc.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/README.md +8 -35
- package/package.json +10 -19
- package/src/theme.css +190 -0
package/README.md
CHANGED
|
@@ -25,7 +25,14 @@ Scan the built package so utilities are not purged:
|
|
|
25
25
|
@source "../../node_modules/@livo-tv/blocks/dist/*.{js,cjs,mjs}";
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Import the shared light and dark palette. Do not paste `:root` / `.dark` color tokens into the app:
|
|
29
|
+
|
|
30
|
+
```css
|
|
31
|
+
@import "tailwindcss";
|
|
32
|
+
@import "@livo-tv/blocks/theme.css";
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`theme.css` is CSS only. It does not pull the client barrel or `framer-motion`.
|
|
29
36
|
|
|
30
37
|
## Video
|
|
31
38
|
|
|
@@ -86,37 +93,3 @@ import { AvatarEditorDialog } from "@livo-tv/blocks";
|
|
|
86
93
|
## i18n
|
|
87
94
|
|
|
88
95
|
Defaults are English. Pass `labels` (and AvatarEditor `labels`) from next-intl. `LanguageSwitcher` defaults to `en` / `es` / `pt`.
|
|
89
|
-
|
|
90
|
-
## Storybook
|
|
91
|
-
|
|
92
|
-
Stories live next to the components they cover (`src/**/*.stories.tsx`). They are not part of the published package and they are not part of `pnpm run ci:check`.
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
pnpm storybook
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
That starts Storybook on port 6006. `pnpm build-storybook` writes a static site to `storybook-static/`.
|
|
99
|
-
|
|
100
|
-
Preview CSS copies the app token set and loads Inter. The toolbar **Theme** control switches light and dark: it sets `html.dark` before paint, including menus and dialogs that portal to `document.body`. Chromatic snapshots both modes. Import the component file directly. Do not re-export video symbols from the main barrel just to story them.
|
|
101
|
-
|
|
102
|
-
`CookieConsentBanner` is not storied: the canvas is an iframe, and the banner hides in an iframe the same way `variant="embed"` does. `VideoPlayer` and shader curtains are not storied either — HLS and WebGL snapshots flake.
|
|
103
|
-
|
|
104
|
-
### Chromatic
|
|
105
|
-
|
|
106
|
-
Visual review is advisory. Chromatic posts a check and a comment; it does not block merge.
|
|
107
|
-
|
|
108
|
-
1. Create a Chromatic project and link it to `livo-tv/blocks`. Install the Chromatic GitHub App if Chromatic offers it. There is no project base-branch setting. A pull request compares against the merge-base of its GitHub base (`dev`). Keep GitHub's default branch as `main`. The first build shows every story as new until `dev` has an accepted build.
|
|
109
|
-
2. Add the designer as a project collaborator and the default reviewer. A GitHub write role is not required.
|
|
110
|
-
3. Put the project token in the GitHub Actions secret `CHROMATIC_PROJECT_TOKEN`.
|
|
111
|
-
4. Do not mark Chromatic **UI Tests** or **UI Review** as required status checks.
|
|
112
|
-
|
|
113
|
-
CI publishes with [`chromaui/action`](https://github.com/marketplace/actions/publish-to-chromatic) (`onlyChanged`, `exitZeroOnChanges`). That action forwards the pull request branch and SHA. A raw `chromatic` CLI step in Actions cannot see the head branch on a merge checkout.
|
|
114
|
-
|
|
115
|
-
Locally:
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
export CHROMATIC_PROJECT_TOKEN=chpt_...
|
|
119
|
-
pnpm chromatic
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
`pnpm chromatic` runs `chromatic --only-changed --exit-zero-on-changes`. Without the token it prints these steps and exits 1. The workflow skips (exit 0) when the secret is empty, including on fork pull requests. Do not set `autoAcceptChanges` or pass `--auto-accept-changes`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livo-tv/blocks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0-rc.1",
|
|
4
4
|
"description": "Shared UI components for Livo applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -46,17 +46,21 @@
|
|
|
46
46
|
"types": "./dist/video.d.cts",
|
|
47
47
|
"default": "./dist/video.cjs"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
},
|
|
50
|
+
"./theme.css": "./src/theme.css"
|
|
50
51
|
},
|
|
51
52
|
"files": [
|
|
52
53
|
"dist",
|
|
53
|
-
"README.md"
|
|
54
|
+
"README.md",
|
|
55
|
+
"src/theme.css"
|
|
56
|
+
],
|
|
57
|
+
"sideEffects": [
|
|
58
|
+
"**/*.css"
|
|
54
59
|
],
|
|
55
|
-
"sideEffects": false,
|
|
56
60
|
"scripts": {
|
|
57
61
|
"build": "tsup && node scripts/prepend-use-client.mjs",
|
|
58
62
|
"dev": "tsup --watch",
|
|
59
|
-
"typecheck": "tsc --noEmit
|
|
63
|
+
"typecheck": "tsc --noEmit",
|
|
60
64
|
"lint": "eslint . --max-warnings=0",
|
|
61
65
|
"lint:fix": "eslint . --fix",
|
|
62
66
|
"format": "prettier --write .",
|
|
@@ -66,10 +70,7 @@
|
|
|
66
70
|
"prepare": "husky",
|
|
67
71
|
"prepublishOnly": "pnpm build",
|
|
68
72
|
"release": "semantic-release",
|
|
69
|
-
"ci:check": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run test && pnpm run build"
|
|
70
|
-
"storybook": "storybook dev -p 6006",
|
|
71
|
-
"build-storybook": "storybook build",
|
|
72
|
-
"chromatic": "node scripts/chromatic.mjs"
|
|
73
|
+
"ci:check": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run test && pnpm run build"
|
|
73
74
|
},
|
|
74
75
|
"repository": {
|
|
75
76
|
"type": "git",
|
|
@@ -143,29 +144,21 @@
|
|
|
143
144
|
"vaul": "^1.1.2"
|
|
144
145
|
},
|
|
145
146
|
"devDependencies": {
|
|
146
|
-
"@chromatic-com/storybook": "^5.3.1",
|
|
147
147
|
"@commitlint/cli": "^19.8.1",
|
|
148
148
|
"@commitlint/config-conventional": "^19.8.1",
|
|
149
149
|
"@eslint/js": "^9.26.0",
|
|
150
|
-
"@fontsource/inter": "^5.3.0",
|
|
151
150
|
"@semantic-release/changelog": "^6.0.3",
|
|
152
151
|
"@semantic-release/git": "^10.0.1",
|
|
153
152
|
"@semantic-release/github": "^11.0.1",
|
|
154
153
|
"@semantic-release/npm": "^13.1.3",
|
|
155
|
-
"@storybook/addon-a11y": "^10.6.0",
|
|
156
|
-
"@storybook/addon-docs": "^10.6.0",
|
|
157
|
-
"@storybook/react-vite": "^10.6.0",
|
|
158
|
-
"@tailwindcss/postcss": "4.1.17",
|
|
159
154
|
"@testing-library/jest-dom": "6.9.1",
|
|
160
155
|
"@testing-library/react": "^16.3.0",
|
|
161
156
|
"@testing-library/user-event": "^14.6.1",
|
|
162
157
|
"@types/react": "^19.1.3",
|
|
163
158
|
"@types/react-dom": "^19.1.3",
|
|
164
159
|
"@vitest/coverage-istanbul": "^4.0.0",
|
|
165
|
-
"chromatic": "^18.9.5",
|
|
166
160
|
"eslint": "^9.26.0",
|
|
167
161
|
"eslint-config-prettier": "^10.1.3",
|
|
168
|
-
"eslint-plugin-storybook": "^10.6.0",
|
|
169
162
|
"framer-motion": "^12.26.2",
|
|
170
163
|
"hls.js": "^1.6.16",
|
|
171
164
|
"husky": "^9.1.7",
|
|
@@ -177,8 +170,6 @@
|
|
|
177
170
|
"react": "^19.1.0",
|
|
178
171
|
"react-dom": "^19.1.0",
|
|
179
172
|
"semantic-release": "^25.0.2",
|
|
180
|
-
"storybook": "^10.6.0",
|
|
181
|
-
"tailwindcss": "4.1.17",
|
|
182
173
|
"tsup": "^8.5.0",
|
|
183
174
|
"typescript": "^5.9.3",
|
|
184
175
|
"typescript-eslint": "^8.32.1",
|
package/src/theme.css
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/* Shared light and dark theme for every Livo web UI.
|
|
2
|
+
Import this after `tailwindcss`. Do not copy these values into an app.
|
|
3
|
+
CSS only: no JavaScript and no client boundary. */
|
|
4
|
+
|
|
5
|
+
@custom-variant dark (&:is(.dark *));
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--background: oklch(1 0 0);
|
|
9
|
+
--foreground: oklch(0.3211 0 0);
|
|
10
|
+
--card: oklch(1 0 0);
|
|
11
|
+
--card-foreground: oklch(0.3211 0 0);
|
|
12
|
+
--popover: oklch(1 0 0);
|
|
13
|
+
--popover-foreground: oklch(0.3211 0 0);
|
|
14
|
+
--primary: oklch(0.5296 0.1506 255.1121);
|
|
15
|
+
--primary-foreground: oklch(1 0 0);
|
|
16
|
+
--secondary: oklch(0.9612 0 0);
|
|
17
|
+
--secondary-foreground: oklch(0.3211 0 0);
|
|
18
|
+
--muted: oklch(0.9612 0 0);
|
|
19
|
+
--muted-foreground: oklch(0.5486 0 0);
|
|
20
|
+
--skeleton: oklch(0.9 0 0);
|
|
21
|
+
--accent: oklch(0.9197 0.0197 260.1694);
|
|
22
|
+
--accent-foreground: oklch(0.3211 0 0);
|
|
23
|
+
--destructive: oklch(0.5297 0.1995 25.054);
|
|
24
|
+
--destructive-foreground: oklch(0.9805 0.0197 159.7663);
|
|
25
|
+
--border: oklch(0.9097 0 0);
|
|
26
|
+
--input: oklch(0.8514 0 0);
|
|
27
|
+
--ring: oklch(0.5296 0.1506 255.1121);
|
|
28
|
+
--chart-1: oklch(0.458 0.2925 264.2078);
|
|
29
|
+
--chart-2: oklch(0.4989 0.1497 140.0411);
|
|
30
|
+
--chart-3: oklch(0.4502 0.0797 80.6995);
|
|
31
|
+
--chart-4: oklch(0.4107 0.1678 27.8668);
|
|
32
|
+
--chart-5: oklch(0.4682 0.2257 319.1337);
|
|
33
|
+
--sidebar: oklch(1 0 0);
|
|
34
|
+
--sidebar-foreground: oklch(0.3211 0 0);
|
|
35
|
+
--sidebar-primary: oklch(0.5296 0.1506 255.1121);
|
|
36
|
+
--sidebar-primary-foreground: oklch(1 0 0);
|
|
37
|
+
--sidebar-accent: oklch(0.9197 0.0197 260.1694);
|
|
38
|
+
--sidebar-accent-foreground: oklch(0.3211 0 0);
|
|
39
|
+
--sidebar-border: oklch(0.9097 0 0);
|
|
40
|
+
--sidebar-ring: oklch(0.5296 0.1506 255.1121);
|
|
41
|
+
--font-sans: Inter, ui-sans-serif, sans-serif, system-ui;
|
|
42
|
+
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
|
|
43
|
+
--font-mono:
|
|
44
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
45
|
+
"Courier New", monospace;
|
|
46
|
+
--radius: 0.625rem;
|
|
47
|
+
--shadow-x: 0;
|
|
48
|
+
--shadow-y: 1px;
|
|
49
|
+
--shadow-blur: 3px;
|
|
50
|
+
--shadow-spread: 0px;
|
|
51
|
+
--shadow-opacity: 0.1;
|
|
52
|
+
--shadow-color: #000000;
|
|
53
|
+
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
|
54
|
+
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
|
55
|
+
--shadow-sm:
|
|
56
|
+
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
|
57
|
+
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
|
58
|
+
--shadow-md:
|
|
59
|
+
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
|
60
|
+
--shadow-lg:
|
|
61
|
+
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
|
62
|
+
--shadow-xl:
|
|
63
|
+
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
|
64
|
+
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
|
65
|
+
--tracking-normal: 0em;
|
|
66
|
+
--spacing: 0.25rem;
|
|
67
|
+
color-scheme: light;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.dark {
|
|
71
|
+
--background: oklch(0.2221 0 0);
|
|
72
|
+
--foreground: oklch(0.8514 0 0);
|
|
73
|
+
--card: oklch(0.2393 0 0);
|
|
74
|
+
--card-foreground: oklch(0.8514 0 0);
|
|
75
|
+
--popover: oklch(0.2393 0 0);
|
|
76
|
+
--popover-foreground: oklch(0.8514 0 0);
|
|
77
|
+
--primary: oklch(0.5296 0.1506 255.1121);
|
|
78
|
+
--primary-foreground: oklch(1 0 0);
|
|
79
|
+
--secondary: oklch(0.3012 0 0);
|
|
80
|
+
--secondary-foreground: oklch(0.8514 0 0);
|
|
81
|
+
--muted: oklch(0.2686 0 0);
|
|
82
|
+
--muted-foreground: oklch(0.5999 0 0);
|
|
83
|
+
--skeleton: oklch(0.32 0 0);
|
|
84
|
+
--accent: oklch(0.2704 0.0094 248.1761);
|
|
85
|
+
--accent-foreground: oklch(1 0 0);
|
|
86
|
+
--destructive: oklch(0.6208 0.19 25.2225);
|
|
87
|
+
--destructive-foreground: oklch(0.9842 0.0034 247.8575);
|
|
88
|
+
--border: oklch(0.3407 0 0);
|
|
89
|
+
--input: oklch(0.3407 0 0);
|
|
90
|
+
--ring: oklch(0.5296 0.1506 255.1121);
|
|
91
|
+
--chart-1: oklch(0.6703 0.1201 249.7234);
|
|
92
|
+
--chart-2: oklch(0.7393 0.1199 174.8272);
|
|
93
|
+
--chart-3: oklch(0.8501 0.0698 105.0723);
|
|
94
|
+
--chart-4: oklch(0.701 0.0999 49.9996);
|
|
95
|
+
--chart-5: oklch(0.6505 0.1394 319.7049);
|
|
96
|
+
--sidebar: oklch(0.2393 0 0);
|
|
97
|
+
--sidebar-foreground: oklch(0.8514 0 0);
|
|
98
|
+
--sidebar-primary: oklch(0.5296 0.1506 255.1121);
|
|
99
|
+
--sidebar-primary-foreground: oklch(1 0 0);
|
|
100
|
+
--sidebar-accent: oklch(0.2704 0.0094 248.1761);
|
|
101
|
+
--sidebar-accent-foreground: oklch(1 0 0);
|
|
102
|
+
--sidebar-border: oklch(0.2603 0 0);
|
|
103
|
+
--sidebar-ring: oklch(0.5296 0.1506 255.1121);
|
|
104
|
+
--font-sans: Inter, ui-sans-serif, sans-serif, system-ui;
|
|
105
|
+
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
|
|
106
|
+
--font-mono:
|
|
107
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
108
|
+
"Courier New", monospace;
|
|
109
|
+
--radius: 0.625rem;
|
|
110
|
+
--shadow-x: 0;
|
|
111
|
+
--shadow-y: 1px;
|
|
112
|
+
--shadow-blur: 3px;
|
|
113
|
+
--shadow-spread: 0px;
|
|
114
|
+
--shadow-opacity: 0.1;
|
|
115
|
+
--shadow-color: #000000;
|
|
116
|
+
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
|
117
|
+
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
|
118
|
+
--shadow-sm:
|
|
119
|
+
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
|
120
|
+
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
|
121
|
+
--shadow-md:
|
|
122
|
+
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
|
123
|
+
--shadow-lg:
|
|
124
|
+
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
|
125
|
+
--shadow-xl:
|
|
126
|
+
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
|
127
|
+
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
|
128
|
+
color-scheme: dark;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@theme inline {
|
|
132
|
+
--color-background: var(--background);
|
|
133
|
+
--color-foreground: var(--foreground);
|
|
134
|
+
--color-card: var(--card);
|
|
135
|
+
--color-card-foreground: var(--card-foreground);
|
|
136
|
+
--color-popover: var(--popover);
|
|
137
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
138
|
+
--color-primary: var(--primary);
|
|
139
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
140
|
+
--color-secondary: var(--secondary);
|
|
141
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
142
|
+
--color-muted: var(--muted);
|
|
143
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
144
|
+
--color-skeleton: var(--skeleton);
|
|
145
|
+
--color-accent: var(--accent);
|
|
146
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
147
|
+
--color-destructive: var(--destructive);
|
|
148
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
149
|
+
--color-border: var(--border);
|
|
150
|
+
--color-input: var(--input);
|
|
151
|
+
--color-ring: var(--ring);
|
|
152
|
+
--color-chart-1: var(--chart-1);
|
|
153
|
+
--color-chart-2: var(--chart-2);
|
|
154
|
+
--color-chart-3: var(--chart-3);
|
|
155
|
+
--color-chart-4: var(--chart-4);
|
|
156
|
+
--color-chart-5: var(--chart-5);
|
|
157
|
+
--color-sidebar: var(--sidebar);
|
|
158
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
159
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
160
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
161
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
162
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
163
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
164
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
165
|
+
|
|
166
|
+
--font-sans: var(--font-sans);
|
|
167
|
+
--font-mono: var(--font-mono);
|
|
168
|
+
--font-serif: var(--font-serif);
|
|
169
|
+
|
|
170
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
171
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
172
|
+
--radius-lg: var(--radius);
|
|
173
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
174
|
+
|
|
175
|
+
--shadow-2xs: var(--shadow-2xs);
|
|
176
|
+
--shadow-xs: var(--shadow-xs);
|
|
177
|
+
--shadow-sm: var(--shadow-sm);
|
|
178
|
+
--shadow: var(--shadow);
|
|
179
|
+
--shadow-md: var(--shadow-md);
|
|
180
|
+
--shadow-lg: var(--shadow-lg);
|
|
181
|
+
--shadow-xl: var(--shadow-xl);
|
|
182
|
+
--shadow-2xl: var(--shadow-2xl);
|
|
183
|
+
|
|
184
|
+
--tracking-tighter: calc(var(--tracking-normal) - 0.05em);
|
|
185
|
+
--tracking-tight: calc(var(--tracking-normal) - 0.025em);
|
|
186
|
+
--tracking-normal: var(--tracking-normal);
|
|
187
|
+
--tracking-wide: calc(var(--tracking-normal) + 0.025em);
|
|
188
|
+
--tracking-wider: calc(var(--tracking-normal) + 0.05em);
|
|
189
|
+
--tracking-widest: calc(var(--tracking-normal) + 0.1em);
|
|
190
|
+
}
|