@nar-bus/ui-kit 1.3.0 → 1.4.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/dist/atoms/Progress.d.ts +23 -0
- package/dist/atoms/Progress.d.ts.map +1 -0
- package/dist/atoms/index.d.ts +1 -0
- package/dist/atoms/index.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1932 -1685
- package/dist/molecules/Dropzone.d.ts +55 -0
- package/dist/molecules/Dropzone.d.ts.map +1 -0
- package/dist/molecules/KpiCard.d.ts +13 -1
- package/dist/molecules/KpiCard.d.ts.map +1 -1
- package/dist/molecules/index.d.ts +1 -0
- package/dist/molecules/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface FileRejection {
|
|
3
|
+
file: File;
|
|
4
|
+
reason: "type" | "size";
|
|
5
|
+
}
|
|
6
|
+
export interface DropzoneProps {
|
|
7
|
+
/** Fires with the accepted files whenever a selection is made (click or drop). */
|
|
8
|
+
onFilesSelected: (files: File[]) => void;
|
|
9
|
+
/** Native `accept` string, also used to filter dropped files (extensions and/or mime, incl. `image/*`). */
|
|
10
|
+
accept?: string;
|
|
11
|
+
/** Allow selecting more than one file. Default `false`. */
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
/** Max size in bytes; larger files are rejected via {@link onReject}. */
|
|
14
|
+
maxSize?: number;
|
|
15
|
+
/** Fires with files rejected by `accept` / `maxSize`. */
|
|
16
|
+
onReject?: (rejections: FileRejection[]) => void;
|
|
17
|
+
/** Inert + dimmed; click / drop / keyboard are disabled. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Controlled selected file(s) — renders a preview card when `showPreview`. */
|
|
20
|
+
value?: File | File[] | null;
|
|
21
|
+
/** Show the built-in preview card(s). Defaults to `true` when `value` is provided. */
|
|
22
|
+
showPreview?: boolean;
|
|
23
|
+
/** Preview remove handler. Falls back to `onFilesSelected([])` when omitted. */
|
|
24
|
+
onRemove?: (file: File) => void;
|
|
25
|
+
/** Custom preview renderer — replaces the built-in card(s) (e.g. spreadsheet icon + extension badge). Receives the files and a `remove` callback. */
|
|
26
|
+
renderPreview?: (files: File[], remove: (file: File) => void) => ReactNode;
|
|
27
|
+
/** aria-label for the built-in preview's remove button. Default `"Kaldır"`. */
|
|
28
|
+
removeLabel?: string;
|
|
29
|
+
/** Leading icon in the empty zone. Default `<Upload />`. */
|
|
30
|
+
icon?: ReactNode;
|
|
31
|
+
/** Primary text in the empty zone. */
|
|
32
|
+
title?: ReactNode;
|
|
33
|
+
/** Secondary muted text (e.g. accepted types / max size). */
|
|
34
|
+
hint?: ReactNode;
|
|
35
|
+
/** Error message rendered under the zone. */
|
|
36
|
+
error?: ReactNode;
|
|
37
|
+
/** Custom empty-zone body (replaces icon/title/hint). */
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
className?: string;
|
|
40
|
+
id?: string;
|
|
41
|
+
"aria-label"?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Dropzone — unified file drop area for both consumers.
|
|
45
|
+
*
|
|
46
|
+
* Drop-in for HES `FileDropZone` / `FirmwareFormPanel` and MDM
|
|
47
|
+
* `CoefficientUploadPanel`: dashed click/drag zone with keyboard activation,
|
|
48
|
+
* a drag-over state, optional `accept` / `maxSize` validation (rejects surface
|
|
49
|
+
* via `onReject`, so the i18n message stays consumer-owned), a controlled
|
|
50
|
+
* selected-file preview card with a remove button, and an `error` slot. The
|
|
51
|
+
* button-triggered upload flavour (MDM `FileUploadButton`) stays a trivial
|
|
52
|
+
* `Button` + `Progress` composition and is intentionally out of scope here.
|
|
53
|
+
*/
|
|
54
|
+
export declare const Dropzone: import('react').ForwardRefExoticComponent<DropzoneProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
55
|
+
//# sourceMappingURL=Dropzone.d.ts.map
|
|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jB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA0BD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,4GAyLpB,CAAC"}
|
|
@@ -13,6 +13,18 @@ export interface KpiCardProps {
|
|
|
13
13
|
accentColor?: string;
|
|
14
14
|
size?: "default" | "compact";
|
|
15
15
|
className?: string;
|
|
16
|
+
/** Interactive card — role=button, Enter/Space, focus halo, hover elevation, cursor-pointer. */
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
/** Renders a Skeleton in place of the value (and suppresses the trend delta). */
|
|
19
|
+
isLoading?: boolean;
|
|
20
|
+
/** Inert + dimmed; disables click / tab when combined with `onClick`. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Accessible name for the card — primarily labels the role=button when `onClick` is set (richer than the visible label+value). */
|
|
23
|
+
"aria-label"?: string;
|
|
24
|
+
/** Error state — value shows "—", an alert icon, and `errorMessage`. Takes precedence over `isLoading`; makes the card non-interactive. */
|
|
25
|
+
isError?: boolean;
|
|
26
|
+
/** Consumer-supplied error text shown under the value in the error state (message stays consumer-owned; the package owns only the chrome). */
|
|
27
|
+
errorMessage?: ReactNode;
|
|
16
28
|
}
|
|
17
|
-
export declare function KpiCard({ value, unit, label, trend, icon: IconComponent, accentColor, size, className, }: KpiCardProps): import("react").JSX.Element;
|
|
29
|
+
export declare function KpiCard({ value, unit, label, trend, icon: IconComponent, accentColor, size, className, onClick, isLoading, disabled, "aria-label": ariaLabel, isError, errorMessage, }: KpiCardProps): import("react").JSX.Element;
|
|
18
30
|
//# sourceMappingURL=KpiCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KpiCard.d.ts","sourceRoot":"","sources":["../../src/molecules/KpiCard.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"KpiCard.d.ts","sourceRoot":"","sources":["../../src/molecules/KpiCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,EAA+C,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAsC5F,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,wGAAwG;IACxG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;IACpD,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,iFAAiF;IACjF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mIAAmI;IACnI,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2IAA2I;IAC3I,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8IAA8I;IAC9I,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAqCD,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EAAE,aAAa,EACnB,WAAW,EACX,IAAgB,EAChB,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,OAAO,EACP,YAAY,GACb,EAAE,YAAY,+BA2Hd"}
|
|
@@ -14,4 +14,5 @@ export { DateRangePicker, type DateRangePickerProps, type DateRange } from './Da
|
|
|
14
14
|
export { Combobox, type ComboboxProps, type ComboboxOption } from './Combobox';
|
|
15
15
|
export { MetricTile, type MetricTileProps, type MetricTileTone, type MetricTileStatus, type MetricTileTrend } from './MetricTile';
|
|
16
16
|
export { SectionCard, type SectionCardProps } from './SectionCard';
|
|
17
|
+
export { Dropzone, type DropzoneProps, type FileRejection } from './Dropzone';
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/molecules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACjI,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB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