@alexgorbatchev/shadcn 0.0.188 → 0.0.190

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.
@@ -89,8 +89,23 @@ function createSlots() {
89
89
  function subscribeToHydration() {
90
90
  return () => {};
91
91
  }
92
+ var focusBeforeMove = new WeakMap;
92
93
  function SlotHost({ slot }) {
93
- const attach = useCallback((host) => host?.append(slot), [slot]);
94
+ const attach = useCallback((host) => {
95
+ if (!host)
96
+ return;
97
+ host.append(slot);
98
+ const focused = focusBeforeMove.get(slot);
99
+ focusBeforeMove.delete(slot);
100
+ const active = slot.ownerDocument.activeElement;
101
+ if (focused?.isConnected && slot.contains(focused) && (active === null || active === slot.ownerDocument.body))
102
+ focused.focus({ preventScroll: true });
103
+ return () => {
104
+ const current = slot.ownerDocument.activeElement;
105
+ if (current instanceof HTMLElement && slot.contains(current))
106
+ focusBeforeMove.set(slot, current);
107
+ };
108
+ }, [slot]);
94
109
  return /* @__PURE__ */ jsx("div", {
95
110
  className: "contents",
96
111
  ref: attach
package/dist/prototype.js CHANGED
@@ -2051,7 +2051,7 @@ var program = new Command;
2051
2051
  // package.json
2052
2052
  var package_default = {
2053
2053
  name: "@alexgorbatchev/shadcn",
2054
- version: "0.0.188",
2054
+ version: "0.0.190",
2055
2055
  description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
package/dist/theme.css CHANGED
@@ -220,6 +220,50 @@
220
220
  --ag-shadow: 0 6px 22px rgb(0 0 0 / 0.3);
221
221
  }
222
222
 
223
+ /* Before a script sets data-theme, the page follows the system: a light-mode visitor's first frame is light, not the
224
+ dark :root default (no dark flash while the bundle loads). data-theme overrides it either way. */
225
+ @media (prefers-color-scheme: light) {
226
+ :root:not([data-theme]) {
227
+ color-scheme: light;
228
+ --background: #fcfcfd;
229
+ --foreground: #0c0e11;
230
+ --card: #fcfcfd;
231
+ --card-foreground: #0c0e11;
232
+ --popover: #fcfcfd;
233
+ --popover-foreground: #0c0e11;
234
+ --primary: #b8168c;
235
+ --primary-foreground: #ffffff;
236
+ --secondary: #eef0f3;
237
+ --secondary-foreground: #0c0e11;
238
+ --muted: #e0e4ea;
239
+ --muted-foreground: #4b535e;
240
+ --faint-foreground: #5b6470;
241
+ --accent: #e0e4ea;
242
+ --accent-foreground: #0c0e11;
243
+ --destructive: #cc1f1f;
244
+ --destructive-foreground: #ffffff;
245
+ --destructive-soft: rgb(204 31 31 / 0.1);
246
+ --success: #0a7d40;
247
+ --success-foreground: #ffffff;
248
+ --warning: #a35400;
249
+ --warning-foreground: #ffffff;
250
+ --chart-1: #2a78d6;
251
+ --chart-2: #eb6834;
252
+ --chart-3: #1baf7a;
253
+ --chart-4: #eda100;
254
+ --chart-5: #e87ba4;
255
+ --border: #c7ccd4;
256
+ --input: #747c88;
257
+ --ring: #b8168c;
258
+ --frame-edge: rgb(0 0 0 / 0.42);
259
+ --media-edge: var(--input);
260
+ --frame-halo: rgb(255 255 255 / 0.95);
261
+ --backdrop: rgb(10 12 16 / 0.55);
262
+ --terminal-background: #ffffff;
263
+ --ag-shadow: 0 6px 22px rgb(0 0 0 / 0.3);
264
+ }
265
+ }
266
+
223
267
  [data-theme-preset="shadcn"] {
224
268
  --ag-font:
225
269
  ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
@@ -726,6 +770,6 @@
726
770
  @media (forced-colors: active) {
727
771
  :focus-visible {
728
772
  outline: 2px solid Highlight;
729
- outline-offset: -2px;
773
+ outline-offset: 1px;
730
774
  }
731
775
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.188",
3
+ "version": "0.0.190",
4
4
  "description": "Sharp, monospace React components with compact, comfortable, and touch densities.",
5
5
  "license": "MIT",
6
6
  "repository": {