@nswds/app 4.0.1 → 4.0.3

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/dist/index.d.cts CHANGED
@@ -50,7 +50,7 @@ import { ThemeProviderProps } from 'next-themes';
50
50
  import * as TogglePrimitive from '@radix-ui/react-toggle';
51
51
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
52
52
  import { LucideIcon } from 'lucide-react';
53
- import { UIMessage, LanguageModelUsage, Experimental_GeneratedImage, FileUIPart, ChatStatus, ToolUIPart } from 'ai';
53
+ import { UIMessage, LanguageModelUsage, GeneratedFile, FileUIPart, ChatStatus, ToolUIPart } from 'ai';
54
54
  import { ModelId } from 'tokenlens';
55
55
  import { StickToBottom } from 'use-stick-to-bottom';
56
56
  import { Streamdown } from 'streamdown';
@@ -1141,6 +1141,32 @@ interface DynamicFaviconProps {
1141
1141
  lightModeFavicon: string;
1142
1142
  darkModeFavicon: string;
1143
1143
  }
1144
+ /**
1145
+ * @deprecated Use Next's `app/` icon file conventions instead, and let the SVG
1146
+ * invert itself.
1147
+ *
1148
+ * Put `favicon.ico`, `icon.svg` and `apple-icon.png` in `app/`, and give the
1149
+ * SVG an inline `@media (prefers-color-scheme: dark)` rule. The browser then
1150
+ * swaps the icon natively — no JavaScript, no second asset, and it works before
1151
+ * hydration.
1152
+ *
1153
+ * Three reasons this component is worse than that:
1154
+ *
1155
+ * 1. **It needs two extra raster files** that the `app/` conventions do not, and
1156
+ * every repo in the fleet has now deleted them. A mount left pointing at
1157
+ * `/icon-light.ico` after that deletion silently requests a URL that no
1158
+ * longer exists.
1159
+ * 2. **Under streaming metadata it appends rather than replaces.** The real icon
1160
+ * tags are still in `<body>` when this effect runs, so
1161
+ * `document.querySelector("link[rel='icon']")` finds nothing and the `else`
1162
+ * branch creates a *new* link — which then becomes the browser's first icon
1163
+ * candidate, ahead of the correct hashed one.
1164
+ * 3. **It only reacts to the OS colour scheme**, not to an in-app theme toggle,
1165
+ * so it was never consistent with a `data-theme`-driven design system anyway.
1166
+ *
1167
+ * Still exported so existing consumers keep building. It will be removed in the
1168
+ * next major.
1169
+ */
1144
1170
  declare function DynamicFavicon({ lightModeFavicon, darkModeFavicon }: DynamicFaviconProps): null;
1145
1171
 
1146
1172
  type ExpandableSearchButtonProps = Omit<react.ComponentPropsWithoutRef<'button'>, 'type'> & {
@@ -1230,7 +1256,7 @@ declare const useFormField: () => {
1230
1256
  isDirty: boolean;
1231
1257
  isTouched: boolean;
1232
1258
  isValidating: boolean;
1233
- error?: react_hook_form.FieldError;
1259
+ error?: react_hook_form.FieldError | undefined;
1234
1260
  id: string;
1235
1261
  name: string;
1236
1262
  formItemId: string;
@@ -6300,7 +6326,7 @@ declare const ConversationEmptyState: ({ className, title, description, icon, ch
6300
6326
  type ConversationScrollButtonProps = ComponentProps<typeof Button>;
6301
6327
  declare const ConversationScrollButton: ({ className, ...props }: ConversationScrollButtonProps) => false | react.JSX.Element;
6302
6328
 
6303
- type ImageProps = Experimental_GeneratedImage & {
6329
+ type ImageProps = GeneratedFile & {
6304
6330
  className?: string;
6305
6331
  alt?: string;
6306
6332
  };
package/dist/index.d.ts CHANGED
@@ -50,7 +50,7 @@ import { ThemeProviderProps } from 'next-themes';
50
50
  import * as TogglePrimitive from '@radix-ui/react-toggle';
51
51
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
52
52
  import { LucideIcon } from 'lucide-react';
53
- import { UIMessage, LanguageModelUsage, Experimental_GeneratedImage, FileUIPart, ChatStatus, ToolUIPart } from 'ai';
53
+ import { UIMessage, LanguageModelUsage, GeneratedFile, FileUIPart, ChatStatus, ToolUIPart } from 'ai';
54
54
  import { ModelId } from 'tokenlens';
55
55
  import { StickToBottom } from 'use-stick-to-bottom';
56
56
  import { Streamdown } from 'streamdown';
@@ -1141,6 +1141,32 @@ interface DynamicFaviconProps {
1141
1141
  lightModeFavicon: string;
1142
1142
  darkModeFavicon: string;
1143
1143
  }
1144
+ /**
1145
+ * @deprecated Use Next's `app/` icon file conventions instead, and let the SVG
1146
+ * invert itself.
1147
+ *
1148
+ * Put `favicon.ico`, `icon.svg` and `apple-icon.png` in `app/`, and give the
1149
+ * SVG an inline `@media (prefers-color-scheme: dark)` rule. The browser then
1150
+ * swaps the icon natively — no JavaScript, no second asset, and it works before
1151
+ * hydration.
1152
+ *
1153
+ * Three reasons this component is worse than that:
1154
+ *
1155
+ * 1. **It needs two extra raster files** that the `app/` conventions do not, and
1156
+ * every repo in the fleet has now deleted them. A mount left pointing at
1157
+ * `/icon-light.ico` after that deletion silently requests a URL that no
1158
+ * longer exists.
1159
+ * 2. **Under streaming metadata it appends rather than replaces.** The real icon
1160
+ * tags are still in `<body>` when this effect runs, so
1161
+ * `document.querySelector("link[rel='icon']")` finds nothing and the `else`
1162
+ * branch creates a *new* link — which then becomes the browser's first icon
1163
+ * candidate, ahead of the correct hashed one.
1164
+ * 3. **It only reacts to the OS colour scheme**, not to an in-app theme toggle,
1165
+ * so it was never consistent with a `data-theme`-driven design system anyway.
1166
+ *
1167
+ * Still exported so existing consumers keep building. It will be removed in the
1168
+ * next major.
1169
+ */
1144
1170
  declare function DynamicFavicon({ lightModeFavicon, darkModeFavicon }: DynamicFaviconProps): null;
1145
1171
 
1146
1172
  type ExpandableSearchButtonProps = Omit<react.ComponentPropsWithoutRef<'button'>, 'type'> & {
@@ -1230,7 +1256,7 @@ declare const useFormField: () => {
1230
1256
  isDirty: boolean;
1231
1257
  isTouched: boolean;
1232
1258
  isValidating: boolean;
1233
- error?: react_hook_form.FieldError;
1259
+ error?: react_hook_form.FieldError | undefined;
1234
1260
  id: string;
1235
1261
  name: string;
1236
1262
  formItemId: string;
@@ -6300,7 +6326,7 @@ declare const ConversationEmptyState: ({ className, title, description, icon, ch
6300
6326
  type ConversationScrollButtonProps = ComponentProps<typeof Button>;
6301
6327
  declare const ConversationScrollButton: ({ className, ...props }: ConversationScrollButtonProps) => false | react.JSX.Element;
6302
6328
 
6303
- type ImageProps = Experimental_GeneratedImage & {
6329
+ type ImageProps = GeneratedFile & {
6304
6330
  className?: string;
6305
6331
  alt?: string;
6306
6332
  };