@mohasinac/appkit 3.5.7 → 3.6.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.
@@ -9,13 +9,17 @@ import { normalizeError } from "../../../errors/normalize";
9
9
  * Optional camera capture (captureSource="both").
10
10
  */
11
11
  import { useState, useRef } from "react";
12
+ import dynamic from "next/dynamic";
12
13
  import { useTranslations } from "next-intl";
13
14
  import { useCamera } from "../../../react";
14
15
  import { Alert, Button, Div, Label, Progress, Row, Spinner, Stack, Text, useToast } from "../../../ui";
15
16
  import { MediaImage } from "../MediaImage";
16
- import { ImageCropModal } from "../modals/ImageCropModal";
17
- import { ImageEditor } from "../modals/ImageEditor";
18
17
  import CameraCapture from "./CameraCapture";
18
+ // Crop/editor modals pull in image-manipulation libraries (react-advanced-cropper
19
+ // and friends) that most upload sessions never open — lazy-load so that weight
20
+ // isn't in the initial bundle for every page that renders an ImageUpload field.
21
+ const ImageCropModal = dynamic(() => import("../modals/ImageCropModal").then((m) => m.ImageCropModal), { ssr: false });
22
+ const ImageEditor = dynamic(() => import("../modals/ImageEditor").then((m) => m.ImageEditor), { ssr: false });
19
23
  const __O = {
20
24
  hidden: "overflow-hidden",
21
25
  };
@@ -12,12 +12,15 @@ import { useCamera } from "../../../react";
12
12
  import { Alert, Anchor, Button, Div, Label, Row, Span, Spinner, Stack, Text } from "../../../ui";
13
13
  import { MediaImage } from "../MediaImage";
14
14
  import { MediaVideo } from "../MediaVideo";
15
- import { VideoTrimModal } from "../modals/VideoTrimModal";
15
+ import dynamic from "next/dynamic";
16
16
  import { VideoThumbnailSelector } from "../modals/VideoThumbnailSelector";
17
17
  import CameraCapture from "./CameraCapture";
18
18
  import { extractVideoPosterFrame, posterBlobAsFile } from "./video-poster";
19
19
  import { inferMediaTypeFromMime } from "../types/index";
20
20
  import { normalizeError } from "../../../errors/normalize";
21
+ // Pulls in video-processing libraries most upload sessions never touch —
22
+ // lazy-load rather than bundle into every page rendering a MediaUploadField.
23
+ const VideoTrimModal = dynamic(() => import("../modals/VideoTrimModal").then((m) => m.VideoTrimModal), { ssr: false });
21
24
  const CLS_PDF_BADGE = "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-error-surface text-error dark:bg-error-surface dark:text-error";
22
25
  const CLS_PDF_NAME = "text-[length:var(--appkit-text-sm)] font-medium text-info underline break-all dark:text-info";
23
26
  const CLS_PDF_LINK = "text-[length:var(--appkit-text-sm)] underline break-all text-info dark:text-info";
package/dist/styles.css CHANGED
@@ -281,7 +281,7 @@
281
281
 
282
282
  --appkit-color-text: #18181b; /* zinc-900 */
283
283
  --appkit-color-text-muted: #71717a; /* zinc-500 */
284
- --appkit-color-text-faint: #a1a1aa; /* zinc-400 */
284
+ --appkit-color-text-faint: #87878f; /* zinc-400 darkened for WCAG AA large-text 3:1 on --appkit-color-bg (audit-a11y) */
285
285
  --appkit-color-text-on-primary: #ffffff;
286
286
  --appkit-color-text-on-dark: #ffffff;
287
287
 
@@ -5868,6 +5868,15 @@
5868
5868
  .appkit-tabs-list {
5869
5869
  display: flex;
5870
5870
  border-bottom: 1px solid var(--appkit-color-border);
5871
+ /* Consumers with many tabs (e.g. AdminSiteSettingsView's 17 groups) would
5872
+ otherwise overflow past the container with no way to reach the later
5873
+ triggers — found via Playwright driving a real browser at 1440px wide,
5874
+ where tabs 16-17 were positioned off-screen and unreachable even after
5875
+ scrollIntoViewIfNeeded(). Horizontal scroll keeps every tab reachable
5876
+ regardless of trigger count or viewport width. */
5877
+ overflow-x: auto;
5878
+ overflow-y: hidden;
5879
+ scrollbar-width: thin;
5871
5880
  }
5872
5881
 
5873
5882
  .appkit-tabs-trigger {
@@ -5877,6 +5886,8 @@
5877
5886
  font-size: 0.875rem;
5878
5887
  font-weight: 500;
5879
5888
  transition: color 0.15s;
5889
+ white-space: nowrap;
5890
+ flex-shrink: 0;
5880
5891
  }
5881
5892
  .appkit-tabs-trigger[aria-selected="true"] {
5882
5893
  border-color: var(--color-primary, #65a30d);
@@ -46,7 +46,7 @@ export const DEFAULT_LIGHT_THEME = {
46
46
  "appkit-color-border-subtle": "#f4f4f5",
47
47
  "appkit-color-text": "#18181b",
48
48
  "appkit-color-text-muted": "#71717a",
49
- "appkit-color-text-faint": "#a1a1aa",
49
+ "appkit-color-text-faint": "#87878f",
50
50
  "appkit-color-text-on-primary": "#ffffff",
51
51
  "appkit-color-success": "#059669",
52
52
  "appkit-color-success-surface": "#ecfdf5",
@@ -263,7 +263,7 @@
263
263
 
264
264
  --appkit-color-text: #18181b; /* zinc-900 */
265
265
  --appkit-color-text-muted: #71717a; /* zinc-500 */
266
- --appkit-color-text-faint: #a1a1aa; /* zinc-400 */
266
+ --appkit-color-text-faint: #87878f; /* zinc-400 darkened for WCAG AA large-text 3:1 on --appkit-color-bg (audit-a11y) */
267
267
  --appkit-color-text-on-primary: #ffffff;
268
268
  --appkit-color-text-on-dark: #ffffff;
269
269
 
@@ -3,6 +3,15 @@
3
3
  .appkit-tabs-list {
4
4
  display: flex;
5
5
  border-bottom: 1px solid var(--appkit-color-border);
6
+ /* Consumers with many tabs (e.g. AdminSiteSettingsView's 17 groups) would
7
+ otherwise overflow past the container with no way to reach the later
8
+ triggers — found via Playwright driving a real browser at 1440px wide,
9
+ where tabs 16-17 were positioned off-screen and unreachable even after
10
+ scrollIntoViewIfNeeded(). Horizontal scroll keeps every tab reachable
11
+ regardless of trigger count or viewport width. */
12
+ overflow-x: auto;
13
+ overflow-y: hidden;
14
+ scrollbar-width: thin;
6
15
  }
7
16
 
8
17
  .appkit-tabs-trigger {
@@ -12,6 +21,8 @@
12
21
  font-size: 0.875rem;
13
22
  font-weight: 500;
14
23
  transition: color 0.15s;
24
+ white-space: nowrap;
25
+ flex-shrink: 0;
15
26
  }
16
27
  .appkit-tabs-trigger[aria-selected="true"] {
17
28
  border-color: var(--color-primary, #65a30d);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "3.5.7",
3
+ "version": "3.6.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -5,6 +5,11 @@
5
5
  "lib": ["dom", "dom.iterable", "esnext"],
6
6
  "skipLibCheck": true,
7
7
  "strict": true,
8
+ "noUncheckedIndexedAccess": true,
9
+ "exactOptionalPropertyTypes": true,
10
+ "noImplicitOverride": true,
11
+ "noPropertyAccessFromIndexSignature": true,
12
+ "noFallthroughCasesInSwitch": true,
8
13
  "esModuleInterop": true,
9
14
  "module": "esnext",
10
15
  "moduleResolution": "bundler",