@wpic/ui 0.8.9 → 0.9.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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 0.9.1
2
+
3
+ - WCard: use text-lg semibold titles in the card header, without changing subtitle, body, or action button typography.
4
+
5
+ ## 0.9.0
6
+
7
+ - Isolate component Tailwind classes with the native `wpic:` prefix; namespace theme variables, implementation variables, and animations. Responsive host classes no longer depend on stylesheet import order.
8
+ - Restrict utility generation to library sources, with build-time rejection of unprefixed utilities, theme variables, and animation names.
9
+ - Move the old generic helper/token API to the explicit `@wpic/ui/legacy.css` entry. Existing apps using these globals must import that entry; components work with `style.css` alone.
10
+ - Preserve component props/events, caller-supplied classes, theme portals, and persisted `WTailwindColorPicker` values.
11
+ - Add development/production isolation tests and consumer checks for Analyze, Perform, and Studio. Consumers should use the compiled package, without source aliases or Tailwind source scanning.
12
+
1
13
  ## 0.8.9
2
14
 
3
15
  - WPopover: add `shiftCrossAxis` so preferred-side panels remain inside narrow viewports. Perpendicular overflow is handled by shifting instead of changing sides.
package/COMPONENTS.md CHANGED
@@ -2,6 +2,52 @@
2
2
  Use this as reference when writing Vue components. Updated for 0.5.0.
3
3
 
4
4
 
5
+ ## CSS integration (0.9)
6
+
7
+ Import the **published** CSS alongside your application CSS:
8
+
9
+ ```ts
10
+ import '@wpic/ui/style.css'
11
+ import './app.css'
12
+ ```
13
+
14
+ Both import orders support the host's responsive utilities. Components ship their own
15
+ `wpic:` Tailwind utilities, `--wpic-*` theme variables, `--wpic-tw-*` implementation
16
+ variables, and namespaced animations. The package does not include Preflight.
17
+ Do not scan `@wpic/ui/src` with `@source`, alias `@wpic/ui` to its source entry, or
18
+ import `node_modules/@wpic/ui/src/style.css`. The compiled package is the integration
19
+ boundary in development and production, including when testing a local tarball.
20
+
21
+ **Migrating existing apps:** if the app uses the old `bg-main`, `text-muted`,
22
+ `border-subtle`, `btn-*`, etc. helpers or global `--bg-*`, `--text-*`, `--border-*`
23
+ aliases, explicitly import their compatibility API:
24
+
25
+ ```ts
26
+ import '@wpic/ui/style.css'
27
+ import '@wpic/ui/legacy.css'
28
+ ```
29
+
30
+ `legacy.css` intentionally defines the old global helper API; it never supplies
31
+ unprefixed Tailwind utilities such as `.hidden` or `.flex`. New apps should use
32
+ `WThemeProvider` and the documented `--wpic-*` tokens instead. Theme providers
33
+ continue supplying the old token aliases within their own subtree for existing
34
+ app content and teleported panels.
35
+
36
+ Customize components with their props, `WThemeProvider.colors`, documented tokens,
37
+ and semantic `wpic-*` classes. Internal `wpic:` utilities and `--wpic-tw-*` variables
38
+ are implementation details. Classes supplied by the app through `class`, `bodyClass`,
39
+ `rowClass`, etc. remain app-owned and are not rewritten; the app must compile those
40
+ classes. The order of competing intentional overrides is still normal CSS cascade
41
+ behavior. CSS isolation does not prevent an app's universal reset or explicit
42
+ component selector from affecting components. `WTailwindColorPicker` continues to
43
+ accept and emit values such as `bg-blue-500`; its rendering uses a private palette.
44
+
45
+ Library checks: `npm run build`, `npm run test:semantic`, and
46
+ `npm run test:production`. `npm run test:consumers` additionally exercises the sibling
47
+ Analyze and Perform production builds and Studio's development frontend with mocked
48
+ API data; set `WPIC_PROJECTS_ROOT` for a different checkout location. Install the
49
+ candidate package in all three apps and build Analyze/Perform first.
50
+
5
51
  ## Theme provider and customization (0.5)
6
52
 
7
53
  The UI5 preset is **opt-in**. Existing consumers without `WThemeProvider` keep their current styling and existing component props/events. Import the packaged stylesheet; no host Tailwind scanning is required.
@@ -164,6 +210,8 @@ click: [e: MouseEvent]
164
210
 
165
211
  ## WCard
166
212
 
213
+ Header titles use `text-lg` (18px) and semibold weight. This styling applies only to the title wrapper (including a heading in the title slot), not action buttons.
214
+
167
215
  **Import:** `import { WCard } from '@wpic/ui'`
168
216
 
169
217
  **Props:**
@@ -0,0 +1,154 @@
1
+ /* Opt-in compatibility API for the pre-0.9 global helpers and tokens.
2
+ * New apps should use WThemeProvider and --wpic-* tokens. Import after style.css. */
3
+
4
+
5
+ .dark { --bg-main: var(--wpic-legacy-bg-main); --bg-card: var(--wpic-legacy-bg-card); --bg-input: var(--wpic-legacy-bg-input); --border-subtle: var(--wpic-legacy-border-subtle); --border-strong: var(--wpic-legacy-border-strong); --border-hover: var(--wpic-legacy-border-hover); --text-main: var(--wpic-legacy-text-main); --text-muted: var(--wpic-legacy-text-muted); --text-dim: var(--wpic-legacy-text-dim);
6
+ }
7
+ :root { --bg-main: var(--wpic-legacy-bg-main); --bg-card: var(--wpic-legacy-bg-card); --bg-input: var(--wpic-legacy-bg-input); --border-subtle: var(--wpic-legacy-border-subtle); --border-strong: var(--wpic-legacy-border-strong); --border-hover: var(--wpic-legacy-border-hover); --text-main: var(--wpic-legacy-text-main); --text-muted: var(--wpic-legacy-text-muted); --text-dim: var(--wpic-legacy-text-dim); --color-indigo-neon: var(--wpic-legacy-color-indigo-neon); --color-rose-neon: var(--wpic-legacy-color-rose-neon); --color-teal-neon: var(--wpic-legacy-color-teal-neon); --color-wpic-green: var(--wpic-legacy-color-wpic-green);
8
+ }
9
+ .bg-main { background-color: var(--bg-main); }
10
+ .bg-card { background-color: var(--bg-card); }
11
+ .bg-input { background-color: var(--bg-input); }
12
+ .border-subtle { border-color: var(--border-subtle); }
13
+ .border-strong { border-color: var(--border-strong); }
14
+ .border-hover { border-color: var(--border-hover); }
15
+ .text-main { color: var(--text-main); }
16
+ .text-muted { color: var(--text-muted); }
17
+ .text-dim { color: var(--text-dim); }
18
+ .label-xs {
19
+ font-size: 11px;
20
+ font-weight: 500;
21
+ letter-spacing: 0.01em;
22
+ color: var(--text-dim);
23
+ }
24
+ .heading-sm {
25
+ font-size: 0.875rem;
26
+ font-weight: 600;
27
+ letter-spacing: -0.025em;
28
+ color: var(--text-main);
29
+ }
30
+ .status-ok { color: rgb(52 211 153); background-color: rgb(52 211 153 / 0.05); border: 1px solid rgb(52 211 153 / 0.1); }
31
+ .status-low { color: rgb(251 191 36); background-color: rgb(251 191 36 / 0.05); border: 1px solid rgb(251 191 36 / 0.1); }
32
+ .status-error { color: rgb(251 113 133); background-color: rgb(251 113 133 / 0.05); border: 1px solid rgb(251 113 133 / 0.1); }
33
+ .glass {
34
+ backdrop-filter: blur(12px);
35
+ -webkit-backdrop-filter: blur(12px);
36
+ background-color: rgba(255, 255, 255, 0.05);
37
+ }
38
+ .th {
39
+ font-size: 11px;
40
+ font-weight: 600;
41
+ letter-spacing: 0.01em;
42
+ color: var(--text-dim);
43
+ padding: 0.75rem 1rem;
44
+ border-bottom: 1px solid var(--border-subtle);
45
+ text-align: left;
46
+ }
47
+ .btn-primary {
48
+ display: inline-flex; align-items: center; justify-content: center;
49
+ height: 2rem; padding: 0 0.75rem;
50
+ border-radius: 0.5rem;
51
+ background-color: #e4e4e7;
52
+ color: #18181b;
53
+ font-size: 0.875rem; font-weight: 600;
54
+ transition: background-color 0.15s;
55
+ cursor: pointer;
56
+ }
57
+ .btn-primary:hover { background-color: #ffffff; }
58
+ .dark .btn-primary { background-color: #27272a; color: #f4f4f5; }
59
+ .dark .btn-primary:hover { background-color: #3f3f46; }
60
+
61
+ .btn-secondary {
62
+ display: inline-flex; align-items: center; justify-content: center;
63
+ height: 2rem; padding: 0 0.75rem;
64
+ border-radius: 0.5rem;
65
+ border: 1px solid var(--border-subtle);
66
+ color: var(--text-muted);
67
+ font-size: 0.875rem; font-weight: 500;
68
+ transition: all 0.15s;
69
+ cursor: pointer;
70
+ }
71
+ .btn-secondary:hover { color: var(--text-main); background-color: rgba(255,255,255,0.05); }
72
+
73
+ .btn-indigo {
74
+ display: inline-flex; align-items: center; justify-content: center;
75
+ height: 2rem; padding: 0 0.75rem;
76
+ border-radius: 0.5rem;
77
+ background-color: #4f46e5;
78
+ color: #ffffff;
79
+ font-size: 0.875rem; font-weight: 600;
80
+ box-shadow: 0 0 15px rgba(99,102,241,0.2);
81
+ transition: background-color 0.15s;
82
+ cursor: pointer;
83
+ }
84
+ .btn-indigo:hover { background-color: #6366f1; }
85
+
86
+ .btn-destructive {
87
+ display: inline-flex; align-items: center; justify-content: center;
88
+ background-color: #dc2626; color: #ffffff;
89
+ font-size: 0.875rem; font-weight: 600;
90
+ border-radius: 0.5rem;
91
+ cursor: pointer;
92
+ }
93
+ .btn-destructive:hover { background-color: #ef4444; }
94
+ .btn-destructive:active { background-color: #b91c1c; box-shadow: inset 0 2px 4px rgba(0,0,0,0.25); }
95
+
96
+ .spinner {
97
+ width: 1.25rem; height: 1.25rem;
98
+ border-radius: 9999px;
99
+ border: 2px solid var(--border-strong);
100
+ border-top-color: transparent;
101
+ animation: wpic-spin 0.7s linear infinite;
102
+ }
103
+ input[type="range"].slider-themed {
104
+ -webkit-appearance: none; appearance: none;
105
+ height: 4px; border-radius: 2px;
106
+ background: var(--border-strong); outline: none;
107
+ }
108
+ input[type="range"].slider-themed::-webkit-slider-thumb {
109
+ -webkit-appearance: none;
110
+ width: 14px; height: 14px;
111
+ border-radius: 50%; background: #85C531; cursor: pointer;
112
+ }
113
+
114
+ /* Existing WPIC helper aliases keep consuming the public legacy tokens. */
115
+ .bg-wpic-black { background-color: var(--bg-main); }
116
+ .bg-wpic-dark { background-color: var(--bg-main); }
117
+ .bg-wpic-card { background-color: var(--bg-card); }
118
+ .bg-wpic-input { background-color: var(--bg-input); }
119
+ .bg-wpic-nav-active { background-color: var(--bg-input); }
120
+ .bg-wpic-border { background-color: var(--border-strong); }
121
+ .bg-wpic-card-30 { background-color: color-mix(in srgb, var(--bg-card) 30%, transparent); }
122
+ .bg-wpic-card-50 { background-color: color-mix(in srgb, var(--bg-card) 50%, transparent); }
123
+ .bg-wpic-card-80 { background-color: color-mix(in srgb, var(--bg-card) 80%, transparent); }
124
+ .bg-wpic-dark-50 { background-color: color-mix(in srgb, var(--bg-main) 50%, transparent); }
125
+ .bg-wpic-input-50 { background-color: color-mix(in srgb, var(--bg-input) 50%, transparent); }
126
+ .bg-wpic-border-30 { background-color: color-mix(in srgb, var(--border-strong) 30%, transparent); }
127
+ .bg-wpic-border-40 { background-color: color-mix(in srgb, var(--border-strong) 40%, transparent); }
128
+ .bg-wpic-border-50 { background-color: color-mix(in srgb, var(--border-strong) 50%, transparent); }
129
+ .border-wpic-border { border-color: var(--border-strong); }
130
+ .border-wpic-border-30 { border-color: color-mix(in srgb, var(--border-strong) 30%, transparent); }
131
+ .border-wpic-border-40 { border-color: color-mix(in srgb, var(--border-strong) 40%, transparent); }
132
+ .border-wpic-border-50 { border-color: color-mix(in srgb, var(--border-strong) 50%, transparent); }
133
+ .border-wpic-border-60 { border-color: color-mix(in srgb, var(--border-strong) 60%, transparent); }
134
+ .border-wpic-border-80 { border-color: color-mix(in srgb, var(--border-strong) 80%, transparent); }
135
+ .border-wpic-border-hover { border-color: var(--border-hover); }
136
+ .divide-wpic-border-40 > * + * { border-color: color-mix(in srgb, var(--border-strong) 40%, transparent); }
137
+ .text-wpic-text { color: var(--text-main); }
138
+ .text-wpic-muted { color: var(--text-muted); }
139
+ .text-wpic-dim { color: var(--text-dim); }
140
+ .text-wpic-dim-20 { color: color-mix(in srgb, var(--text-dim) 20%, transparent); }
141
+ .text-wpic-dim-30 { color: color-mix(in srgb, var(--text-dim) 30%, transparent); }
142
+ .text-wpic-dim-40 { color: color-mix(in srgb, var(--text-dim) 40%, transparent); }
143
+ .text-wpic-dim-50 { color: color-mix(in srgb, var(--text-dim) 50%, transparent); }
144
+ .text-wpic-dim-60 { color: color-mix(in srgb, var(--text-dim) 60%, transparent); }
145
+ .text-wpic-green { color: #85C531; }
146
+ .bg-wpic-green { background-color: #85C531; }
147
+ .bg-wpic-green\/10 { background-color: rgba(133, 197, 49, 0.1); }
148
+ .bg-wpic-green\/15 { background-color: rgba(133, 197, 49, 0.15); }
149
+ .bg-wpic-green\/20 { background-color: rgba(133, 197, 49, 0.2); }
150
+ .border-wpic-green { border-color: #85C531; }
151
+ .ring-wpic-green { --tw-ring-color: #85C531; }
152
+ .accent-wpic-green { accent-color: #85C531; }
153
+ .focus\:border-wpic-green:focus { border-color: #85C531; }
154
+ .hover\:border-wpic-green\/50:hover { border-color: rgba(133, 197, 49, 0.5); }