@12-apps/storage 2.2.0 → 2.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@12-apps/storage",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "description": "Image uploads that land at YOUR OWN ORIGIN, never at the bucket (12-20). Isomorphic core (format allowlist, upload ceiling, object-key grammar, rendition set, refusal taxonomy, wire schemas), host-mounted backend surface (./server: createApiStorage, the local-disk driver, the image-pipeline port, the orphan reclaim), Hono adapter (./hono), the S3-compatible driver behind its own subpath (./s3) and the bound picker + upload hook (./react). Standardized adoption contract in ADOPTING.md.",
6
6
  "exports": {
@@ -43,7 +43,7 @@
43
43
  }
44
44
  },
45
45
  "dependencies": {
46
- "@12-apps/ui": "^6.3.1",
46
+ "@12-apps/ui": "^6.4.0",
47
47
  "zod": "^4.3.5"
48
48
  },
49
49
  "devDependencies": {
@@ -85,6 +85,7 @@ export function createWebStorage(config: WebStorageConfig): WebStorage {
85
85
  value={imageKey}
86
86
  onChange={setImageKey}
87
87
  label={messages.fieldLabel}
88
+ removeLabel={messages.fieldRemove}
88
89
  helperText={messages.fieldHelper}
89
90
  />
90
91
  </Stack>
@@ -100,13 +100,15 @@ export interface WebStorageMessages {
100
100
  /**
101
101
  * The standalone upload page's own chrome — heading, the one-line
102
102
  * instruction (which carries the ceiling, same rule as the refusals), the
103
- * field label and its helper. These rendered as literals inside
104
- * `createWebStorage` until copy became required config.
103
+ * field label, its helper, and the button that clears a chosen image.
104
+ * These rendered as literals inside `createWebStorage` until copy became
105
+ * required config.
105
106
  */
106
107
  pageTitle: string;
107
108
  pageIntro: string;
108
109
  fieldLabel: string;
109
110
  fieldHelper: string;
111
+ fieldRemove: string;
110
112
  }
111
113
 
112
114
  /** Copy that only makes sense with the configured ceiling in it. */
@@ -34,7 +34,10 @@ export interface ImageFieldProps {
34
34
  previewUrl?: string | null;
35
35
  /** Called with the new key, or `null` when the image is removed. */
36
36
  onChange: (imageKey: string | null) => void;
37
- label?: string;
37
+ /** The dropzone's own label. REQUIRED — this package ships no default copy. */
38
+ label: string;
39
+ /** The button that clears a chosen image. REQUIRED, for the same reason. */
40
+ removeLabel: string;
38
41
  helperText?: string;
39
42
  /** Passed through per upload — `{ optimize: false }` for a rendered canvas. */
40
43
  uploadOptions?: UploadOptions;
@@ -89,7 +92,7 @@ export function ImageField(props: BoundImageFieldProps): JSX.Element {
89
92
  ) : null}
90
93
  <UploadButton
91
94
  variant="dropzone"
92
- label={props.label ?? 'Enviar imagem'}
95
+ label={props.label}
93
96
  accept={ACCEPT}
94
97
  disabled={props.disabled || uploader.uploading}
95
98
  uploading={uploader.uploading}
@@ -100,7 +103,7 @@ export function ImageField(props: BoundImageFieldProps): JSX.Element {
100
103
  {preview ? (
101
104
  <Box>
102
105
  <Button variant="text" onClick={handleRemove} dataTestId={`${testId}-remove`}>
103
- Remover imagem
106
+ {props.removeLabel}
104
107
  </Button>
105
108
  </Box>
106
109
  ) : null}
@@ -34,5 +34,6 @@ export function PT_BR_WEB_STORAGE_MESSAGES(
34
34
  pageIntro: `Envie um PNG, JPG, WebP ou GIF de até ${context.limit}.`,
35
35
  fieldLabel: 'Foto do produto',
36
36
  fieldHelper: 'A imagem é reduzida no navegador antes do envio.',
37
+ fieldRemove: 'Remover imagem',
37
38
  };
38
39
  }