@viasat/beam-shared 2.0.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/README.md +108 -0
- package/chunks/SegmentedControl.B9dLCFSF.js +9 -0
- package/chunks/SegmentedControl.D0l_8a7O.js +1 -0
- package/chunks/accordion.C1LkPYXv.js +1 -0
- package/chunks/accordion.CCM7ddD5.js +11 -0
- package/chunks/actionList.LFHBSlrg.js +1 -0
- package/chunks/actionList.X99uHmXK.js +26 -0
- package/chunks/alert.B4q5-o6H.js +1 -0
- package/chunks/alert.BZ4L-6bC.js +32 -0
- package/chunks/avatar.BbM_sNXk.js +63 -0
- package/chunks/avatar.VNzxbOMa.js +1 -0
- package/chunks/badge.B_k2GBe6.js +1 -0
- package/chunks/badge.DZN0yrZh.js +44 -0
- package/chunks/badgeDot.ClhZtqzd.js +25 -0
- package/chunks/badgeDot.Dkqfk3zg.js +1 -0
- package/chunks/box.CsO__7hu.js +1 -0
- package/chunks/box._mFtvgTp.js +82 -0
- package/chunks/button.Bbz_mfWv.js +1 -0
- package/chunks/button.Dz8Zhr7J.js +51 -0
- package/chunks/card.CG-SDcm1.js +27 -0
- package/chunks/card.CLwQAceo.js +1 -0
- package/chunks/chips.DKEagIsp.js +1 -0
- package/chunks/chips.GU9UVEOU.js +13 -0
- package/chunks/closeButton.C1A3p88y.js +1 -0
- package/chunks/closeButton.g8_iRoUg.js +15 -0
- package/chunks/dialog.BTq-pLBf.js +28 -0
- package/chunks/dialog.DnkeApRr.js +1 -0
- package/chunks/divider.BYMLu6Wp.js +1 -0
- package/chunks/divider.DgP7kpLb.js +35 -0
- package/chunks/fileUpload.BbSIsjJv.js +240 -0
- package/chunks/fileUpload.C-l2YXzO.js +1 -0
- package/chunks/form.BRWIo59c.js +154 -0
- package/chunks/form.CIzlawbr.js +1 -0
- package/chunks/helperText.C-apoW8Z.js +1 -0
- package/chunks/helperText.CS5sun4r.js +16 -0
- package/chunks/icon.SiHuIfL8.js +1 -0
- package/chunks/icon.tCAxaKQh.js +28 -0
- package/chunks/inputChoiceGroup.BSousduj.js +1 -0
- package/chunks/inputChoiceGroup.DkDdA57f.js +10 -0
- package/chunks/link.DxTb3yhm.js +16 -0
- package/chunks/link.VyBRMFxS.js +1 -0
- package/chunks/list.CCq0lIzm.js +29 -0
- package/chunks/list.D6NIx1OS.js +1 -0
- package/chunks/logo.CLQZSaVN.js +1 -0
- package/chunks/logo.Cl29Chxj.js +11 -0
- package/chunks/nativeSelect.D9HZm9uJ.js +28 -0
- package/chunks/nativeSelect.Lz45VyQX.js +1 -0
- package/chunks/pageHeader.CbDGb6ot.js +1 -0
- package/chunks/pageHeader.fsTiHDRc.js +12 -0
- package/chunks/pagination.Br7vTt5b.js +1 -0
- package/chunks/pagination.DinViL55.js +38 -0
- package/chunks/progressBar.84w2qF8R.js +42 -0
- package/chunks/progressBar.DcG-X-RY.js +1 -0
- package/chunks/spinner.B6R6yphw.js +1 -0
- package/chunks/spinner.oNNLX64f.js +105 -0
- package/chunks/stepper.ByKqsxhz.js +1 -0
- package/chunks/stepper.FT6nDHjL.js +18 -0
- package/chunks/switch.Dalf8ccu.js +1 -0
- package/chunks/switch.hUukrKTd.js +11 -0
- package/chunks/tabs.C7SBQq_R.js +1 -0
- package/chunks/tabs.CIfcdjPn.js +13 -0
- package/chunks/text.CW-ftgoP.js +1 -0
- package/chunks/text.DpbJhMDB.js +152 -0
- package/chunks/textArea.CmtmGm_y.js +22 -0
- package/chunks/textArea.DF76BVU5.js +1 -0
- package/chunks/toast.Bs1t4Urq.js +36 -0
- package/chunks/toast.C-h1RUq_.js +1 -0
- package/chunks/tooltip.D1fCHa9d.js +16 -0
- package/chunks/tooltip.DZTJP5dS.js +1 -0
- package/index.cjs.js +1 -0
- package/index.d.ts +3 -0
- package/index.es.js +164 -0
- package/lib/components/SegmentedControl.cjs.js +1 -0
- package/lib/components/SegmentedControl.d.ts +2 -0
- package/lib/components/SegmentedControl.es.js +5 -0
- package/lib/components/accordion.cjs.js +1 -0
- package/lib/components/accordion.d.ts +3 -0
- package/lib/components/accordion.es.js +6 -0
- package/lib/components/actionList.cjs.js +1 -0
- package/lib/components/actionList.d.ts +15 -0
- package/lib/components/actionList.es.js +13 -0
- package/lib/components/alert.cjs.js +1 -0
- package/lib/components/alert.d.ts +17 -0
- package/lib/components/alert.es.js +11 -0
- package/lib/components/aspectRatio.cjs.js +1 -0
- package/lib/components/aspectRatio.d.ts +16 -0
- package/lib/components/aspectRatio.es.js +14 -0
- package/lib/components/avatar.cjs.js +1 -0
- package/lib/components/avatar.d.ts +17 -0
- package/lib/components/avatar.es.js +23 -0
- package/lib/components/badge.cjs.js +1 -0
- package/lib/components/badge.d.ts +17 -0
- package/lib/components/badge.es.js +15 -0
- package/lib/components/badgeDot.cjs.js +1 -0
- package/lib/components/badgeDot.d.ts +6 -0
- package/lib/components/badgeDot.es.js +7 -0
- package/lib/components/box.cjs.js +1 -0
- package/lib/components/box.d.ts +82 -0
- package/lib/components/box.es.js +8 -0
- package/lib/components/button.cjs.js +1 -0
- package/lib/components/button.d.ts +36 -0
- package/lib/components/button.es.js +16 -0
- package/lib/components/card.cjs.js +1 -0
- package/lib/components/card.d.ts +22 -0
- package/lib/components/card.es.js +7 -0
- package/lib/components/chips.cjs.js +1 -0
- package/lib/components/chips.d.ts +5 -0
- package/lib/components/chips.es.js +7 -0
- package/lib/components/closeButton.cjs.js +1 -0
- package/lib/components/closeButton.d.ts +2 -0
- package/lib/components/closeButton.es.js +5 -0
- package/lib/components/dialog.cjs.js +1 -0
- package/lib/components/dialog.d.ts +5 -0
- package/lib/components/dialog.es.js +7 -0
- package/lib/components/divider.cjs.js +1 -0
- package/lib/components/divider.d.ts +30 -0
- package/lib/components/divider.es.js +9 -0
- package/lib/components/fileUpload.cjs.js +1 -0
- package/lib/components/fileUpload.d.ts +90 -0
- package/lib/components/fileUpload.es.js +22 -0
- package/lib/components/floatingui.cjs.js +1 -0
- package/lib/components/floatingui.d.ts +71 -0
- package/lib/components/floatingui.es.js +608 -0
- package/lib/components/form.cjs.js +1 -0
- package/lib/components/form.d.ts +69 -0
- package/lib/components/form.es.js +9 -0
- package/lib/components/helperText.cjs.js +1 -0
- package/lib/components/helperText.d.ts +4 -0
- package/lib/components/helperText.es.js +6 -0
- package/lib/components/icon.cjs.js +1 -0
- package/lib/components/icon.d.ts +6 -0
- package/lib/components/icon.es.js +7 -0
- package/lib/components/index.cjs.js +1 -0
- package/lib/components/index.d.ts +34 -0
- package/lib/components/index.es.js +70 -0
- package/lib/components/inputChoiceGroup.cjs.js +1 -0
- package/lib/components/inputChoiceGroup.d.ts +10 -0
- package/lib/components/inputChoiceGroup.es.js +5 -0
- package/lib/components/link.cjs.js +1 -0
- package/lib/components/link.d.ts +4 -0
- package/lib/components/link.es.js +6 -0
- package/lib/components/list.cjs.js +1 -0
- package/lib/components/list.d.ts +14 -0
- package/lib/components/list.es.js +10 -0
- package/lib/components/logo.cjs.js +1 -0
- package/lib/components/logo.d.ts +5 -0
- package/lib/components/logo.es.js +6 -0
- package/lib/components/nativeSelect.cjs.js +1 -0
- package/lib/components/nativeSelect.d.ts +5 -0
- package/lib/components/nativeSelect.es.js +7 -0
- package/lib/components/pageHeader.cjs.js +1 -0
- package/lib/components/pageHeader.d.ts +5 -0
- package/lib/components/pageHeader.es.js +5 -0
- package/lib/components/pagination.cjs.js +1 -0
- package/lib/components/pagination.d.ts +69 -0
- package/lib/components/pagination.es.js +13 -0
- package/lib/components/progressBar.cjs.js +1 -0
- package/lib/components/progressBar.d.ts +14 -0
- package/lib/components/progressBar.es.js +11 -0
- package/lib/components/spinner.cjs.js +1 -0
- package/lib/components/spinner.d.ts +82 -0
- package/lib/components/spinner.es.js +19 -0
- package/lib/components/stepper.cjs.js +1 -0
- package/lib/components/stepper.d.ts +12 -0
- package/lib/components/stepper.es.js +5 -0
- package/lib/components/switch.cjs.js +1 -0
- package/lib/components/switch.d.ts +3 -0
- package/lib/components/switch.es.js +6 -0
- package/lib/components/tabs.cjs.js +1 -0
- package/lib/components/tabs.d.ts +6 -0
- package/lib/components/tabs.es.js +7 -0
- package/lib/components/text.cjs.js +1 -0
- package/lib/components/text.d.ts +15 -0
- package/lib/components/text.es.js +13 -0
- package/lib/components/textArea.cjs.js +1 -0
- package/lib/components/textArea.d.ts +2 -0
- package/lib/components/textArea.es.js +4 -0
- package/lib/components/toast.cjs.js +1 -0
- package/lib/components/toast.d.ts +14 -0
- package/lib/components/toast.es.js +9 -0
- package/lib/components/tooltip.cjs.js +1 -0
- package/lib/components/tooltip.d.ts +2 -0
- package/lib/components/tooltip.es.js +5 -0
- package/lib/shared.cjs.js +1 -0
- package/lib/shared.d.ts +4 -0
- package/lib/shared.es.js +6 -0
- package/lib/utils/CSSLookup.cjs.js +1 -0
- package/lib/utils/CSSLookup.d.ts +84 -0
- package/lib/utils/CSSLookup.es.js +110 -0
- package/lib/utils/classNames.cjs.js +1 -0
- package/lib/utils/classNames.d.ts +9 -0
- package/lib/utils/classNames.es.js +18 -0
- package/lib/utils/constants.cjs.js +1 -0
- package/lib/utils/constants.d.ts +174 -0
- package/lib/utils/constants.es.js +151 -0
- package/lib/utils/dom.cjs.js +1 -0
- package/lib/utils/dom.d.ts +18 -0
- package/lib/utils/dom.es.js +34 -0
- package/lib/utils/helpers.cjs.js +1 -0
- package/lib/utils/helpers.d.ts +66 -0
- package/lib/utils/helpers.es.js +154 -0
- package/lib/utils/index.cjs.js +1 -0
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.es.js +94 -0
- package/lib/utils/overflow.cjs.js +1 -0
- package/lib/utils/overflow.d.ts +34 -0
- package/lib/utils/overflow.es.js +34 -0
- package/lib/utils/raf.cjs.js +1 -0
- package/lib/utils/raf.d.ts +8 -0
- package/lib/utils/raf.es.js +14 -0
- package/lib/utils/styles.cjs.js +1 -0
- package/lib/utils/styles.d.ts +1 -0
- package/lib/utils/styles.es.js +5 -0
- package/lib/utils/types.cjs.js +1 -0
- package/lib/utils/types.d.ts +6 -0
- package/lib/utils/types.es.js +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/constants.cjs.js");const e=require("../../chunks/accordion.C1LkPYXv.js");exports.DEFAULT_ACCORDION_SIZE=e.DEFAULT_ACCORDION_SIZE;exports.sizes=e.sizes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../chunks/actionList.LFHBSlrg.js");exports.action=i.action;exports.actionListItemKinds=i.actionListItemKinds;exports.checkbox=i.checkbox;exports.destructive=i.destructive;exports.flyout=i.flyout;exports.isChoiceKind=i.isChoiceKind;exports.multiCheckMark=i.multiCheckMark;exports.radio=i.radio;exports.singleCheckMark=i.singleCheckMark;exports.singleSwitch=i.singleSwitch;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ActionListHeaderKind = 'header' | 'groupHeader';
|
|
2
|
+
export declare const action = "action";
|
|
3
|
+
export declare const destructive = "destructive";
|
|
4
|
+
export declare const flyout = "flyout";
|
|
5
|
+
export declare const singleCheckMark = "singleCheckMark";
|
|
6
|
+
export declare const multiCheckMark = "multiCheckMark";
|
|
7
|
+
export declare const checkbox = "checkbox";
|
|
8
|
+
export declare const radio = "radio";
|
|
9
|
+
export declare const singleSwitch = "switch";
|
|
10
|
+
declare const choiceItemKinds: readonly ["singleCheckMark", "multiCheckMark", "checkbox", "radio", "switch"];
|
|
11
|
+
export declare const actionListItemKinds: readonly ["action", "destructive", "flyout", "singleCheckMark", "multiCheckMark", "checkbox", "radio", "switch"];
|
|
12
|
+
export type ActionListItemKind = typeof actionListItemKinds[number];
|
|
13
|
+
type ActionListItemChoiceKind = typeof choiceItemKinds[number];
|
|
14
|
+
export declare const isChoiceKind: (kind: ActionListItemKind) => kind is ActionListItemChoiceKind;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { b as i, g as e, c, d as t, f as o, i as r, m as n, r as d, s as h, e as k } from "../../chunks/actionList.X99uHmXK.js";
|
|
2
|
+
export {
|
|
3
|
+
i as action,
|
|
4
|
+
e as actionListItemKinds,
|
|
5
|
+
c as checkbox,
|
|
6
|
+
t as destructive,
|
|
7
|
+
o as flyout,
|
|
8
|
+
r as isChoiceKind,
|
|
9
|
+
n as multiCheckMark,
|
|
10
|
+
d as radio,
|
|
11
|
+
h as singleCheckMark,
|
|
12
|
+
k as singleSwitch
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/constants.cjs.js");require("../utils/CSSLookup.cjs.js");const e=require("../../chunks/alert.B4q5-o6H.js");exports.appearances=e.appearances;exports.closeButtonAriaLabel=e.closeButtonAriaLabel;exports.getContentDefaultHeight=e.getContentDefaultHeight;exports.iconAriaLabels=e.iconAriaLabels;exports.roles=e.roles;exports.sizes=e.sizes;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const sizes: readonly ["sm", "md"];
|
|
2
|
+
export type AlertSizes = typeof sizes[number];
|
|
3
|
+
export declare const appearances: readonly ["infoPrimary", "infoSecondary", "positive", "warning", "negative"];
|
|
4
|
+
export type AlertAppearances = typeof appearances[number];
|
|
5
|
+
/**
|
|
6
|
+
* Alert roles we remove 'log' and 'status'
|
|
7
|
+
* due to this issue:
|
|
8
|
+
* https://github.com/nvaccess/nvda/issues/14591
|
|
9
|
+
*/
|
|
10
|
+
export declare const roles: {
|
|
11
|
+
readonly alert: "alert";
|
|
12
|
+
readonly alertDialog: "alertdialog";
|
|
13
|
+
};
|
|
14
|
+
export type AlertRoles = typeof roles[keyof typeof roles] | undefined;
|
|
15
|
+
export declare const getContentDefaultHeight: (size: AlertSizes) => number;
|
|
16
|
+
export declare const iconAriaLabels: Record<AlertAppearances, string>;
|
|
17
|
+
export declare const closeButtonAriaLabel = "Dismiss Alert";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../utils/constants.es.js";
|
|
2
|
+
import "../utils/CSSLookup.es.js";
|
|
3
|
+
import { b as o, c as r, g as i, i as l, r as n, s as p } from "../../chunks/alert.BZ4L-6bC.js";
|
|
4
|
+
export {
|
|
5
|
+
o as appearances,
|
|
6
|
+
r as closeButtonAriaLabel,
|
|
7
|
+
i as getContentDefaultHeight,
|
|
8
|
+
l as iconAriaLabels,
|
|
9
|
+
n as roles,
|
|
10
|
+
p as sizes
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={"16:9":"16/9","9:16":"9/16","2:1":"2/1","1:2":"1/2","4:3":"4/3","3:4":"3/4","3:2":"3/2","2:3":"2/3","1:1":"1/1"};exports.aspectRatioToCssValue=e;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps aspect ratio from colon notation (e.g., "16:9") to slash notation (e.g., "16/9")
|
|
3
|
+
* for use in CSS aspect-ratio property
|
|
4
|
+
*/
|
|
5
|
+
export declare const aspectRatioToCssValue: {
|
|
6
|
+
readonly '16:9': "16/9";
|
|
7
|
+
readonly '9:16': "9/16";
|
|
8
|
+
readonly '2:1': "2/1";
|
|
9
|
+
readonly '1:2': "1/2";
|
|
10
|
+
readonly '4:3': "4/3";
|
|
11
|
+
readonly '3:4': "3/4";
|
|
12
|
+
readonly '3:2': "3/2";
|
|
13
|
+
readonly '2:3': "2/3";
|
|
14
|
+
readonly '1:1': "1/1";
|
|
15
|
+
};
|
|
16
|
+
export type AspectRatioValue = keyof typeof aspectRatioToCssValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/classNames.cjs.js");require("../utils/constants.cjs.js");require("../utils/CSSLookup.cjs.js");const e=require("../../chunks/avatar.VNzxbOMa.js");exports.MARGIN_SIZE_LG=e.MARGIN_SIZE_LG;exports.MARGIN_SIZE_SM=e.MARGIN_SIZE_SM;exports.avatarAppearances=e.avatarAppearances;exports.avatarGroupLayouts=e.avatarGroupLayouts;exports.avatarShapes=e.avatarShapes;exports.avatarSizeRem=e.avatarSizeRem;exports.avatarSizes=e.avatarSizes;exports.baseClassNamePrefix=e.baseClassNamePrefix;exports.classModifierPrefix=e.classModifierPrefix;exports.defaultBadgeAppearance=e.defaultBadgeAppearance;exports.getAvatarText=e.getAvatarText;exports.getMarginSizePx=e.getMarginSizePx;exports.getMarginSizeRem=e.getMarginSizeRem;exports.groupBaseClassNamePrefix=e.groupBaseClassNamePrefix;exports.groupClassModifierPrefix=e.groupClassModifierPrefix;exports.groupSubElementClassPrefix=e.groupSubElementClassPrefix;exports.subElementClassPrefix=e.subElementClassPrefix;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const baseClassNamePrefix: "bm-avatar", subElementClassPrefix: "bm-avatar__", classModifierPrefix: "bm-avatar--";
|
|
2
|
+
export declare const avatarShapes: readonly ["circle", "square"];
|
|
3
|
+
export declare const avatarAppearances: readonly ["neutral", "accent"];
|
|
4
|
+
export declare const defaultBadgeAppearance = "neutral";
|
|
5
|
+
export declare const avatarSizes: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
6
|
+
export declare const avatarSizeRem: Record<AvatarSize, number>;
|
|
7
|
+
export declare const getAvatarText: (name: string, size: AvatarSize) => string;
|
|
8
|
+
export declare const MARGIN_SIZE_SM = 0.25;
|
|
9
|
+
export declare const MARGIN_SIZE_LG = 0.5;
|
|
10
|
+
export declare const getMarginSizeRem: (size: AvatarSize, layout: AvatarGroupLayout) => number;
|
|
11
|
+
export declare const getMarginSizePx: (size: AvatarSize, layout: AvatarGroupLayout) => number;
|
|
12
|
+
export type AvatarShape = typeof avatarShapes[number];
|
|
13
|
+
export type AvatarAppearance = typeof avatarAppearances[number];
|
|
14
|
+
export type AvatarSize = typeof avatarSizes[number];
|
|
15
|
+
export declare const avatarGroupLayouts: readonly ["stacked", "spaced"];
|
|
16
|
+
export type AvatarGroupLayout = typeof avatarGroupLayouts[number];
|
|
17
|
+
export declare const groupBaseClassNamePrefix: "bm-avatar-group", groupSubElementClassPrefix: "bm-avatar-group__", groupClassModifierPrefix: "bm-avatar-group--";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "../utils/classNames.es.js";
|
|
2
|
+
import "../utils/constants.es.js";
|
|
3
|
+
import "../utils/CSSLookup.es.js";
|
|
4
|
+
import { j as t, M as p, e as o, m as f, d as m, h as g, g as l, b as x, c as S, f as u, i as M, l as n, k as P, n as v, p as d, o as A, s as C } from "../../chunks/avatar.BbM_sNXk.js";
|
|
5
|
+
export {
|
|
6
|
+
t as MARGIN_SIZE_LG,
|
|
7
|
+
p as MARGIN_SIZE_SM,
|
|
8
|
+
o as avatarAppearances,
|
|
9
|
+
f as avatarGroupLayouts,
|
|
10
|
+
m as avatarShapes,
|
|
11
|
+
g as avatarSizeRem,
|
|
12
|
+
l as avatarSizes,
|
|
13
|
+
x as baseClassNamePrefix,
|
|
14
|
+
S as classModifierPrefix,
|
|
15
|
+
u as defaultBadgeAppearance,
|
|
16
|
+
M as getAvatarText,
|
|
17
|
+
n as getMarginSizePx,
|
|
18
|
+
P as getMarginSizeRem,
|
|
19
|
+
v as groupBaseClassNamePrefix,
|
|
20
|
+
d as groupClassModifierPrefix,
|
|
21
|
+
A as groupSubElementClassPrefix,
|
|
22
|
+
C as subElementClassPrefix
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/classNames.cjs.js");require("../utils/constants.cjs.js");const e=require("../../chunks/badge.B_k2GBe6.js");exports.badgeAppearances=e.badgeAppearances;exports.badgeEmphases=e.badgeEmphases;exports.badgeSizes=e.badgeSizes;exports.baseClassNamePrefix=e.baseClassNamePrefix;exports.classModifierPrefix=e.classModifierPrefix;exports.classNameBase=e.classNameBase;exports.defaultBadgeAppearance=e.defaultBadgeAppearance;exports.defaultBadgeEmphasis=e.defaultBadgeEmphasis;exports.defaultIconsAriaLabels=e.defaultIconsAriaLabels;exports.subElementClassPrefix=e.subElementClassPrefix;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const badgeAppearances: readonly ["infoPrimary", "infoSecondary", "positive", "warning", "negative"];
|
|
2
|
+
export declare const classNameBase = "badge";
|
|
3
|
+
export declare const baseClassNamePrefix: "bm-badge", subElementClassPrefix: "bm-badge__", classModifierPrefix: "bm-badge--";
|
|
4
|
+
export declare const badgeSizes: readonly ["sm", "md"];
|
|
5
|
+
export declare const badgeEmphases: readonly ["strong", "medium", "subtle"];
|
|
6
|
+
export declare const defaultBadgeAppearance: "infoPrimary";
|
|
7
|
+
export declare const defaultBadgeEmphasis: "strong";
|
|
8
|
+
export type BadgeAppearance = typeof badgeAppearances[number];
|
|
9
|
+
export type BadgeSize = typeof badgeSizes[number];
|
|
10
|
+
export type BadgeEmphasis = typeof badgeEmphases[number];
|
|
11
|
+
export declare const defaultIconsAriaLabels: {
|
|
12
|
+
readonly positive: "Success";
|
|
13
|
+
readonly warning: "Warning";
|
|
14
|
+
readonly negative: "Error";
|
|
15
|
+
readonly infoPrimary: "Information";
|
|
16
|
+
readonly infoSecondary: "Information";
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "../utils/classNames.es.js";
|
|
2
|
+
import "../utils/constants.es.js";
|
|
3
|
+
import { a as r, g as d, f, d as l, e as p, c as m, h as t, i as b, j as c, s as g } from "../../chunks/badge.DZN0yrZh.js";
|
|
4
|
+
export {
|
|
5
|
+
r as badgeAppearances,
|
|
6
|
+
d as badgeEmphases,
|
|
7
|
+
f as badgeSizes,
|
|
8
|
+
l as baseClassNamePrefix,
|
|
9
|
+
p as classModifierPrefix,
|
|
10
|
+
m as classNameBase,
|
|
11
|
+
t as defaultBadgeAppearance,
|
|
12
|
+
b as defaultBadgeEmphasis,
|
|
13
|
+
c as defaultIconsAriaLabels,
|
|
14
|
+
g as subElementClassPrefix
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/constants.cjs.js");const e=require("../../chunks/badgeDot.Dkqfk3zg.js");exports.appearanceToAriaLabel=e.appearanceToAriaLabel;exports.badgeDotAppearance=e.badgeDotAppearance;exports.badgeDotEmphasis=e.badgeDotEmphasis;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const badgeDotAppearance: readonly ["infoPrimary", "infoSecondary", "positive", "warning", "negative"];
|
|
2
|
+
export type BadgeDotAppearance = typeof badgeDotAppearance[number];
|
|
3
|
+
export type BadgeDotAppearanceTo<T> = Record<BadgeDotAppearance, T>;
|
|
4
|
+
export declare const badgeDotEmphasis: readonly ["strong", "subtle"];
|
|
5
|
+
export type BadgeDotEmphasis = typeof badgeDotEmphasis[number];
|
|
6
|
+
export declare const appearanceToAriaLabel: Record<BadgeDotAppearance, string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../../chunks/box.CsO__7hu.js");exports.BACKGROUND_COLORS_CLASS_NAMES=S.BACKGROUND_COLORS_CLASS_NAMES;exports.BORDER_COLORS_CLASS_NAMES=S.BORDER_COLORS_CLASS_NAMES;exports.BORDER_RADIUS_CLASS_NAMES=S.BORDER_RADIUS_CLASS_NAMES;exports.BORDER_WIDTH_CLASS_NAMES=S.BORDER_WIDTH_CLASS_NAMES;exports.SHADOWS_CLASS_NAMES=S.SHADOWS_CLASS_NAMES;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare const BORDER_WIDTH_CLASS_NAMES: {
|
|
2
|
+
readonly NONE: "none";
|
|
3
|
+
readonly MD: "md";
|
|
4
|
+
readonly LG: "lg";
|
|
5
|
+
readonly XL: "xl";
|
|
6
|
+
readonly DIVIDER: "divider";
|
|
7
|
+
};
|
|
8
|
+
type BorderWidthKeys = keyof typeof BORDER_WIDTH_CLASS_NAMES;
|
|
9
|
+
export type BoxBorderWidth = typeof BORDER_WIDTH_CLASS_NAMES[BorderWidthKeys];
|
|
10
|
+
export declare const BACKGROUND_COLORS_CLASS_NAMES: {
|
|
11
|
+
readonly '00': "00";
|
|
12
|
+
readonly '00_ALT': "00-alt";
|
|
13
|
+
readonly '01': "01";
|
|
14
|
+
readonly '02': "02";
|
|
15
|
+
readonly '03': "03";
|
|
16
|
+
readonly POSITIVE: "positive";
|
|
17
|
+
readonly WARNING: "warning";
|
|
18
|
+
readonly NEGATIVE: "negative";
|
|
19
|
+
readonly INFO_PRIMARY: "info-primary";
|
|
20
|
+
readonly INFO_SECONDARY: "info-secondary";
|
|
21
|
+
readonly POSITIVE_STRONG: "positive-strong";
|
|
22
|
+
readonly WARNING_STRONG: "warning-strong";
|
|
23
|
+
readonly NEGATIVE_STRONG: "negative-strong";
|
|
24
|
+
readonly INFO_PRIMARY_STRONG: "info-primary-strong";
|
|
25
|
+
readonly INFO_SECONDARY_STRONG: "info-secondary-strong";
|
|
26
|
+
readonly SELECTED: "selected";
|
|
27
|
+
readonly SELECTED_SUBTLE: "selected-subtle";
|
|
28
|
+
readonly HIGHLIGHT: "highlight";
|
|
29
|
+
readonly TRANSPARENT: "transparent";
|
|
30
|
+
readonly INVERSE: "inverse";
|
|
31
|
+
readonly EXPRESSIVE: "expressive";
|
|
32
|
+
readonly EXPRESSIVE_STRONG: "expressive-stronger";
|
|
33
|
+
readonly EXPRESSIVE_INVERSE: "expressive-inverse";
|
|
34
|
+
};
|
|
35
|
+
type BackgroundColorKeys = keyof typeof BACKGROUND_COLORS_CLASS_NAMES;
|
|
36
|
+
export type BoxBackgroundColor = typeof BACKGROUND_COLORS_CLASS_NAMES[BackgroundColorKeys];
|
|
37
|
+
export declare const BORDER_COLORS_CLASS_NAMES: {
|
|
38
|
+
readonly '00': "00";
|
|
39
|
+
readonly '00_ALT': "00-alt";
|
|
40
|
+
readonly '01': "01";
|
|
41
|
+
readonly '02': "02";
|
|
42
|
+
readonly '03': "03";
|
|
43
|
+
readonly STRONG: "strong";
|
|
44
|
+
readonly POSITIVE: "positive";
|
|
45
|
+
readonly WARNING: "warning";
|
|
46
|
+
readonly NEGATIVE: "negative";
|
|
47
|
+
readonly INFO_PRIMARY: "info-primary";
|
|
48
|
+
readonly INFO_SECONDARY: "info-secondary";
|
|
49
|
+
readonly POSITIVE_STRONG: "positive-strong";
|
|
50
|
+
readonly WARNING_STRONG: "warning-strong";
|
|
51
|
+
readonly NEGATIVE_STRONG: "negative-strong";
|
|
52
|
+
readonly INFO_PRIMARY_STRONG: "info-primary-strong";
|
|
53
|
+
readonly INFO_SECONDARY_STRONG: "info-secondary-strong";
|
|
54
|
+
readonly SELECTED: "selected";
|
|
55
|
+
readonly FOCUS: "focus";
|
|
56
|
+
readonly INVERSE: "inverse";
|
|
57
|
+
readonly EXPRESSIVE: "expressive";
|
|
58
|
+
readonly EXPRESSIVE_STRONGER: "expressive-stronger";
|
|
59
|
+
readonly TRANSPARENT: "transparent";
|
|
60
|
+
};
|
|
61
|
+
type BorderColorKeys = keyof typeof BORDER_COLORS_CLASS_NAMES;
|
|
62
|
+
export type BoxBorderColor = typeof BORDER_COLORS_CLASS_NAMES[BorderColorKeys];
|
|
63
|
+
export declare const BORDER_RADIUS_CLASS_NAMES: {
|
|
64
|
+
readonly NONE: "none";
|
|
65
|
+
readonly XS: "xs";
|
|
66
|
+
readonly SM: "sm";
|
|
67
|
+
readonly MD: "md";
|
|
68
|
+
readonly LG: "lg";
|
|
69
|
+
readonly ROUND: "round";
|
|
70
|
+
};
|
|
71
|
+
type BorderRadiusKeys = keyof typeof BORDER_RADIUS_CLASS_NAMES;
|
|
72
|
+
export type BoxBorderRadius = typeof BORDER_RADIUS_CLASS_NAMES[BorderRadiusKeys];
|
|
73
|
+
export declare const SHADOWS_CLASS_NAMES: {
|
|
74
|
+
readonly NONE: "none";
|
|
75
|
+
readonly SM: "sm";
|
|
76
|
+
readonly MD: "md";
|
|
77
|
+
readonly LG: "lg";
|
|
78
|
+
readonly OVERLAY: "overlay";
|
|
79
|
+
};
|
|
80
|
+
type ShadowKeys = keyof typeof SHADOWS_CLASS_NAMES;
|
|
81
|
+
export type BoxShadow = typeof SHADOWS_CLASS_NAMES[ShadowKeys];
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { a as A, c as R, d as O, B as C, S as E } from "../../chunks/box._mFtvgTp.js";
|
|
2
|
+
export {
|
|
3
|
+
A as BACKGROUND_COLORS_CLASS_NAMES,
|
|
4
|
+
R as BORDER_COLORS_CLASS_NAMES,
|
|
5
|
+
O as BORDER_RADIUS_CLASS_NAMES,
|
|
6
|
+
C as BORDER_WIDTH_CLASS_NAMES,
|
|
7
|
+
E as SHADOWS_CLASS_NAMES
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/classNames.cjs.js");require("../utils/constants.cjs.js");const e=require("../../chunks/button.Bbz_mfWv.js");exports.BUTTON_APPEARANCES=e.BUTTON_APPEARANCES;exports.BUTTON_KINDS=e.BUTTON_KINDS;exports.BUTTON_SIZES=e.BUTTON_SIZES;exports.baseClassNamePrefix=e.baseClassNamePrefix;exports.classModifierPrefix=e.classModifierPrefix;exports.defaultButtonAppearance=e.defaultButtonAppearance;exports.defaultButtonKind=e.defaultButtonKind;exports.defaultButtonSize=e.defaultButtonSize;exports.getKindAppearanceClassName=e.getKindAppearanceClassName;exports.staticButtonClassNames=e.staticButtonClassNames;exports.subElementClassPrefix=e.subElementClassPrefix;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @todo Should we import these from constants.ts?
|
|
3
|
+
*/
|
|
4
|
+
export declare const BUTTON_APPEARANCES: {
|
|
5
|
+
readonly ACCENT: "accent";
|
|
6
|
+
readonly NEUTRAL: "neutral";
|
|
7
|
+
readonly NEUTRAL_SUBTLE: "neutral-subtle";
|
|
8
|
+
readonly DESTRUCTIVE: "destructive";
|
|
9
|
+
};
|
|
10
|
+
export declare const defaultButtonAppearance: "accent";
|
|
11
|
+
export type ButtonAppearance = typeof BUTTON_APPEARANCES[keyof typeof BUTTON_APPEARANCES];
|
|
12
|
+
export declare const BUTTON_KINDS: {
|
|
13
|
+
readonly FILLED: "filled";
|
|
14
|
+
readonly OUTLINE: "outline";
|
|
15
|
+
readonly GHOST: "ghost";
|
|
16
|
+
readonly BARE: "bare";
|
|
17
|
+
};
|
|
18
|
+
export declare const defaultButtonKind: "filled";
|
|
19
|
+
export type ButtonKind = typeof BUTTON_KINDS[keyof typeof BUTTON_KINDS];
|
|
20
|
+
export declare const BUTTON_SIZES: {
|
|
21
|
+
readonly sm: "sm";
|
|
22
|
+
readonly md: "md";
|
|
23
|
+
readonly lg: "lg";
|
|
24
|
+
};
|
|
25
|
+
export type ButtonSize = typeof BUTTON_SIZES[keyof typeof BUTTON_SIZES];
|
|
26
|
+
export declare const defaultButtonSize: "md";
|
|
27
|
+
export declare const baseClassNamePrefix: "bm-button", classModifierPrefix: "bm-button--", subElementClassPrefix: "bm-button__";
|
|
28
|
+
export declare const staticButtonClassNames: {
|
|
29
|
+
readonly label: "bm-button__label";
|
|
30
|
+
readonly iconWrap: "bm-button__icon-wrap";
|
|
31
|
+
readonly loading: "bm-button--loading";
|
|
32
|
+
readonly fluid: "bm-button--fluid";
|
|
33
|
+
readonly iconOnly: "bm-button--icon-only";
|
|
34
|
+
readonly loadingSpinner: "bm-button__loading-spinner";
|
|
35
|
+
};
|
|
36
|
+
export declare const getKindAppearanceClassName: <K extends ButtonKind, A extends ButtonAppearance>(kind: K, appearance: A) => `bm-button--${A}-${K}`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "../utils/classNames.es.js";
|
|
2
|
+
import "../utils/constants.es.js";
|
|
3
|
+
import { B as i, a as r, e as f, g as l, h as n, d as o, c as u, f as B, j as N, i as d, s as m } from "../../chunks/button.Dz8Zhr7J.js";
|
|
4
|
+
export {
|
|
5
|
+
i as BUTTON_APPEARANCES,
|
|
6
|
+
r as BUTTON_KINDS,
|
|
7
|
+
f as BUTTON_SIZES,
|
|
8
|
+
l as baseClassNamePrefix,
|
|
9
|
+
n as classModifierPrefix,
|
|
10
|
+
o as defaultButtonAppearance,
|
|
11
|
+
u as defaultButtonKind,
|
|
12
|
+
B as defaultButtonSize,
|
|
13
|
+
N as getKindAppearanceClassName,
|
|
14
|
+
d as staticButtonClassNames,
|
|
15
|
+
m as subElementClassPrefix
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/constants.cjs.js");const e=require("../../chunks/card.CLwQAceo.js");exports.CARD_BACKDROP_VALUES=e.CARD_BACKDROP_VALUES;exports.FOOTER_ACTION_ALIGNMENT=e.FOOTER_ACTION_ALIGNMENT;exports.cardDensity=e.cardDensity;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const cardDensity: readonly ["sm", "md", "lg"];
|
|
2
|
+
export type CardDensity = typeof cardDensity[number];
|
|
3
|
+
export declare const FOOTER_ACTION_ALIGNMENT: {
|
|
4
|
+
readonly start: "start";
|
|
5
|
+
readonly end: "end";
|
|
6
|
+
readonly spaceBetween: "spaceBetween";
|
|
7
|
+
readonly stacked: "stacked";
|
|
8
|
+
};
|
|
9
|
+
export type FooterActionLayout = typeof FOOTER_ACTION_ALIGNMENT[keyof typeof FOOTER_ACTION_ALIGNMENT];
|
|
10
|
+
export declare const CARD_BACKDROP_VALUES: {
|
|
11
|
+
readonly BLACK_10: "black-10";
|
|
12
|
+
readonly BLACK_20: "black-20";
|
|
13
|
+
readonly BLACK_30: "black-30";
|
|
14
|
+
readonly BLACK_40: "black-40";
|
|
15
|
+
readonly WHITE_10: "white-10";
|
|
16
|
+
readonly WHITE_20: "white-20";
|
|
17
|
+
readonly WHITE_30: "white-30";
|
|
18
|
+
readonly WHITE_40: "white-40";
|
|
19
|
+
};
|
|
20
|
+
type CardBackdropKeys = keyof typeof CARD_BACKDROP_VALUES;
|
|
21
|
+
export type CardBackdrop = typeof CARD_BACKDROP_VALUES[CardBackdropKeys];
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/constants.cjs.js");const e=require("../../chunks/chips.DKEagIsp.js");exports.closeButtonSize=e.closeButtonSize;exports.shapes=e.shapes;exports.sizes=e.sizes;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const sizes: readonly ["sm", "md", "lg"];
|
|
2
|
+
export type ChipSize = typeof sizes[number];
|
|
3
|
+
export declare const shapes: ("enterprise" | "consumer")[];
|
|
4
|
+
export type ChipShape = typeof shapes[number];
|
|
5
|
+
export declare const closeButtonSize: (size: ChipSize) => "xs" | "sm" | "md";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/constants.cjs.js");const e=require("../../chunks/closeButton.C1A3p88y.js");exports.sizes=e.sizes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/constants.cjs.js");const e=require("../../chunks/dialog.DnkeApRr.js");exports.DialogAppearances=e.DialogAppearances;exports.DialogSizes=e.DialogSizes;exports.dialogIconAriaLabels=e.dialogIconAriaLabels;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const DialogAppearances: readonly ["information", "positive", "negative", "warning"];
|
|
2
|
+
export type DialogAppearance = typeof DialogAppearances[number];
|
|
3
|
+
export declare const dialogIconAriaLabels: Record<DialogAppearance, string>;
|
|
4
|
+
export declare const DialogSizes: readonly ["sm", "md", "lg", "xl"];
|
|
5
|
+
export type DialogSize = typeof DialogSizes[number];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/constants.cjs.js");const S=require("../../chunks/divider.BYMLu6Wp.js");exports.ALIGN_CONTENT=S.ALIGN_CONTENT;exports.BORDER_COLORS_CLASS_NAMES=S.BORDER_COLORS_CLASS_NAMES;exports.BORDER_STYLES=S.BORDER_STYLES;exports.BORDER_WIDTHS=S.BORDER_WIDTHS;exports.ORIENTATIONS=S.ORIENTATIONS;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const BORDER_COLORS_CLASS_NAMES: {
|
|
2
|
+
readonly '00': "00";
|
|
3
|
+
readonly '00_ALT': "00-alt";
|
|
4
|
+
readonly '01': "01";
|
|
5
|
+
readonly '02': "02";
|
|
6
|
+
readonly '03': "03";
|
|
7
|
+
readonly STRONG: "strong";
|
|
8
|
+
readonly POSITIVE: "positive";
|
|
9
|
+
readonly WARNING: "warning";
|
|
10
|
+
readonly NEGATIVE: "negative";
|
|
11
|
+
readonly INFO_PRIMARY: "info-primary";
|
|
12
|
+
readonly INFO_SECONDARY: "info-secondary";
|
|
13
|
+
readonly POSITIVE_STRONG: "positive-strong";
|
|
14
|
+
readonly WARNING_STRONG: "warning-strong";
|
|
15
|
+
readonly NEGATIVE_STRONG: "negative-strong";
|
|
16
|
+
readonly INFO_PRIMARY_STRONG: "info-primary-strong";
|
|
17
|
+
readonly INFO_SECONDARY_STRONG: "info-secondary-strong";
|
|
18
|
+
readonly INVERSE: "inverse";
|
|
19
|
+
};
|
|
20
|
+
type BorderColorKeys = keyof typeof BORDER_COLORS_CLASS_NAMES;
|
|
21
|
+
export type DividerBorderColor = typeof BORDER_COLORS_CLASS_NAMES[BorderColorKeys];
|
|
22
|
+
export declare const BORDER_WIDTHS: readonly ["md", "lg", "xl"];
|
|
23
|
+
export type DividerBorderWidth = (typeof BORDER_WIDTHS)[number];
|
|
24
|
+
export declare const BORDER_STYLES: readonly ["solid", "dashed", "dotted"];
|
|
25
|
+
export type DividerBorderStyle = (typeof BORDER_STYLES)[number];
|
|
26
|
+
export declare const ALIGN_CONTENT: readonly ["start", "end", "center"];
|
|
27
|
+
export type DividerAlignContent = (typeof ALIGN_CONTENT)[number];
|
|
28
|
+
export declare const ORIENTATIONS: readonly ["horizontal", "vertical"];
|
|
29
|
+
export type DividerOrientation = (typeof ORIENTATIONS)[number];
|
|
30
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../utils/constants.cjs.js");const e=require("../../chunks/fileUpload.C-l2YXzO.js");exports.action=e.action;exports.addFiles=e.addFiles;exports.convertBytesToFriendly=e.convertBytesToFriendly;exports.createFileItem=e.createFileItem;exports.dismissFile=e.dismissFile;exports.dropzone=e.dropzone;exports.error=e.error;exports.filesReducer=e.filesReducer;exports.generateThumbnail=e.generateThumbnail;exports.getFormData=e.getFormData;exports.initialState=e.initialState;exports.kinds=e.kinds;exports.listItemStates=e.listItemStates;exports.listSizes=e.listSizes;exports.success=e.success;exports.uploaded=e.uploaded;exports.uploading=e.uploading;exports.validateFile=e.validateFile;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export declare const dropzone: "dropzone";
|
|
2
|
+
export declare const action: "action";
|
|
3
|
+
export declare const kinds: readonly ["dropzone", "action"];
|
|
4
|
+
export type FileUploadKind = typeof kinds[number];
|
|
5
|
+
export declare const listSizes: readonly ["md", "lg"];
|
|
6
|
+
export type FileUploadListSize = typeof listSizes[number];
|
|
7
|
+
export declare const uploading: "uploading";
|
|
8
|
+
export declare const success: "success";
|
|
9
|
+
export declare const uploaded: "uploaded";
|
|
10
|
+
export declare const error: "error";
|
|
11
|
+
export declare const listItemStates: readonly ["uploading", "success", "uploaded", "error"];
|
|
12
|
+
export type FileUploadListItemState = typeof listItemStates[number];
|
|
13
|
+
export interface FileItem {
|
|
14
|
+
id: string;
|
|
15
|
+
fileName: string;
|
|
16
|
+
fileSize: string;
|
|
17
|
+
state: FileUploadListItemState;
|
|
18
|
+
progress: number;
|
|
19
|
+
thumbnail?: string;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface FileUploadParams {
|
|
23
|
+
accept?: string;
|
|
24
|
+
fileLimit?: number;
|
|
25
|
+
maxFileSize?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface FileActions {
|
|
28
|
+
progress(progress: number): void;
|
|
29
|
+
success(): void;
|
|
30
|
+
error(error: string): void;
|
|
31
|
+
dismiss(): void;
|
|
32
|
+
}
|
|
33
|
+
export interface FilesState {
|
|
34
|
+
fileItems: FileItem[];
|
|
35
|
+
abortControllers: AbortController[];
|
|
36
|
+
files: File[];
|
|
37
|
+
shouldAddToFormData: boolean[];
|
|
38
|
+
validFileCount: number;
|
|
39
|
+
}
|
|
40
|
+
export declare const getFormData: (name: string, filesState: FilesState) => FormData;
|
|
41
|
+
export type AddFilesAction = {
|
|
42
|
+
type: 'add';
|
|
43
|
+
payload: Array<{
|
|
44
|
+
fileItem: FileItem;
|
|
45
|
+
abortController: AbortController;
|
|
46
|
+
file: File;
|
|
47
|
+
shouldAddToFormData: boolean;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
export type RemoveFileAction = {
|
|
51
|
+
type: 'remove';
|
|
52
|
+
payload: FileItem;
|
|
53
|
+
};
|
|
54
|
+
export type UpdateFileAction = {
|
|
55
|
+
type: 'update';
|
|
56
|
+
payload: {
|
|
57
|
+
fileItem: FileItem;
|
|
58
|
+
updates: Partial<FileItem>;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export type FilesAction = AddFilesAction | RemoveFileAction | UpdateFileAction;
|
|
62
|
+
export declare const initialState: FilesState;
|
|
63
|
+
export interface FileUploadContextValue {
|
|
64
|
+
ctxAccept?: string;
|
|
65
|
+
ctxMultiple?: boolean;
|
|
66
|
+
ctxFileLimit?: number;
|
|
67
|
+
ctxMaxFileSize?: number;
|
|
68
|
+
ctxAddFiles?(files: FileList): void;
|
|
69
|
+
ctxDismissFile?(file: FileItem): void;
|
|
70
|
+
ctxFileItems?: FileItem[];
|
|
71
|
+
ctxError?: boolean;
|
|
72
|
+
ctxDisabled?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface FileUploadListContextValue {
|
|
75
|
+
ctxThumbnail?: boolean;
|
|
76
|
+
ctxSize?: FileUploadListSize;
|
|
77
|
+
ctxDisabled?: boolean;
|
|
78
|
+
}
|
|
79
|
+
export declare function convertBytesToFriendly(bytes: number): string;
|
|
80
|
+
export declare const validateFile: (file: File, fileCount: number, { accept, fileLimit, maxFileSize }: FileUploadParams) => string | undefined;
|
|
81
|
+
export declare const createFileItem: (file: File, { state, error, }: {
|
|
82
|
+
state: FileUploadListItemState;
|
|
83
|
+
error?: string;
|
|
84
|
+
}) => FileItem;
|
|
85
|
+
type ThumbnailGenerator = (file: File, callback: (thumbnail: string) => void) => undefined | string;
|
|
86
|
+
export declare const generateThumbnail: ThumbnailGenerator;
|
|
87
|
+
export declare function dismissFile(file: FileItem, dispatch: (action: FilesAction) => void): void;
|
|
88
|
+
export declare function addFiles(files: FileList | null, dispatch: (action: FilesAction) => void, validFileCount: number, accept?: string, fileLimit?: number, maxFileSize?: number, initialFileItemState?: FileUploadListItemState, onUpload?: (file: File, actions: FileActions, signal: AbortSignal) => boolean | void | undefined): void;
|
|
89
|
+
export declare function filesReducer(state: FilesState, action: FilesAction): FilesState;
|
|
90
|
+
export {};
|