@forgedevstack/bear 1.2.6 → 1.2.7
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 +6 -2
- package/dist/components/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.js +37 -36
- package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +32 -32
- package/dist/components/Backdrop/Backdrop.cjs +1 -1
- package/dist/components/Backdrop/Backdrop.const.cjs +1 -1
- package/dist/components/Backdrop/Backdrop.const.d.ts +2 -1
- package/dist/components/Backdrop/Backdrop.const.js +4 -3
- package/dist/components/Backdrop/Backdrop.js +36 -29
- package/dist/components/Backdrop/Backdrop.types.d.ts +2 -0
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.js +48 -48
- package/dist/components/Chip/Chip.cjs +1 -1
- package/dist/components/Chip/Chip.const.cjs +1 -1
- package/dist/components/Chip/Chip.const.d.ts +10 -0
- package/dist/components/Chip/Chip.const.js +11 -1
- package/dist/components/Chip/Chip.js +24 -22
- package/dist/components/ChipGroup/ChipGroup.cjs +1 -1
- package/dist/components/ChipGroup/ChipGroup.const.cjs +1 -1
- package/dist/components/ChipGroup/ChipGroup.const.d.ts +6 -3
- package/dist/components/ChipGroup/ChipGroup.const.js +6 -3
- package/dist/components/ChipGroup/ChipGroup.js +83 -29
- package/dist/components/ChipGroup/ChipGroup.types.d.ts +5 -0
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +57 -54
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.const.cjs +1 -0
- package/dist/components/EmptyState/EmptyState.const.d.ts +26 -1
- package/dist/components/EmptyState/EmptyState.const.js +29 -0
- package/dist/components/EmptyState/EmptyState.js +49 -31
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.const.cjs +1 -1
- package/dist/components/Input/Input.const.d.ts +10 -0
- package/dist/components/Input/Input.const.js +16 -6
- package/dist/components/Input/Input.js +96 -96
- package/dist/components/MessageList/MessageList.cjs +1 -1
- package/dist/components/MessageList/MessageList.js +98 -92
- package/dist/components/MessageList/MessageList.types.d.ts +2 -0
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.const.cjs +1 -1
- package/dist/components/Modal/Modal.const.js +7 -8
- package/dist/components/Modal/Modal.js +60 -55
- package/dist/components/PageHeader/PageHeader.cjs +1 -0
- package/dist/components/PageHeader/PageHeader.const.cjs +1 -0
- package/dist/components/PageHeader/PageHeader.const.d.ts +6 -0
- package/dist/components/PageHeader/PageHeader.const.js +9 -0
- package/dist/components/PageHeader/PageHeader.d.ts +3 -0
- package/dist/components/PageHeader/PageHeader.js +57 -0
- package/dist/components/PageHeader/PageHeader.types.d.ts +10 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +108 -99
- package/dist/components/Select/Select.types.d.ts +3 -1
- package/dist/components/Snackbar/Snackbar.cjs +1 -1
- package/dist/components/Snackbar/Snackbar.js +62 -60
- package/dist/components/Snackbar/Snackbar.types.d.ts +2 -0
- package/dist/components/Tabs/Tabs.cjs +1 -1
- package/dist/components/Tabs/Tabs.const.cjs +1 -0
- package/dist/components/Tabs/Tabs.const.d.ts +2 -0
- package/dist/components/Tabs/Tabs.const.js +5 -0
- package/dist/components/Tabs/Tabs.js +40 -35
- package/dist/components/Tabs/Tabs.types.d.ts +1 -0
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.const.cjs +1 -1
- package/dist/components/Toast/Toast.const.js +7 -15
- package/dist/components/Toast/Toast.js +99 -95
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +267 -265
- package/dist/context/BearProvider.js +1 -1
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +45 -41
- package/dist/hooks/useBreakpoint/index.d.ts +4 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.cjs +1 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.const.cjs +1 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.const.d.ts +8 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.const.js +10 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.d.ts +2 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.js +26 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.types.d.ts +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +446 -431
- package/dist/styles.css +0 -4
- package/dist/utils/generateBearId.const.cjs +1 -1
- package/dist/utils/generateBearId.const.d.ts +4 -2
- package/dist/utils/generateBearId.const.js +6 -4
- package/dist/utils/generateBearId.utils.cjs +1 -1
- package/dist/utils/generateBearId.utils.js +33 -21
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.js +27 -18
- package/dist/utils/liveRegion.const.cjs +1 -0
- package/dist/utils/liveRegion.const.d.ts +5 -0
- package/dist/utils/liveRegion.const.js +17 -0
- package/dist/utils/liveRegion.utils.cjs +1 -0
- package/dist/utils/liveRegion.utils.d.ts +7 -0
- package/dist/utils/liveRegion.utils.js +10 -0
- package/dist/utils/useBearId.cjs +1 -1
- package/dist/utils/useBearId.js +5 -4
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -170984,10 +170984,6 @@
|
|
|
170984
170984
|
--bear-ring-color: rgba(245, 158, 11, 0.2);
|
|
170985
170985
|
}
|
|
170986
170986
|
|
|
170987
|
-
.dark .dark\:bear-bg-amber-900\/20, .bear-dark .dark\:bear-bg-amber-900\/20 {
|
|
170988
|
-
background-color: rgba(120, 53, 15, 0.2);
|
|
170989
|
-
}
|
|
170990
|
-
|
|
170991
170987
|
.dark .dark\:bear-bg-black, .bear-dark .dark\:bear-bg-black {
|
|
170992
170988
|
background-color: #000000;
|
|
170993
170989
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _="Bear",E="
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _="Bear",E="-",I=12,R="abcdefghijklmnopqrstuvwxyz",A=128,T=1e5,D=999999;exports.BEAR_ID_MAX_LENGTH=A;exports.BEAR_ID_NUMERIC_MAX=D;exports.BEAR_ID_NUMERIC_MIN=T;exports.BEAR_ID_PREFIX=_;exports.BEAR_ID_SEGMENT_DIGIT_LENGTH=I;exports.BEAR_ID_SEGMENT_LETTERS=R;exports.BEAR_ID_SEPARATOR=E;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const BEAR_ID_PREFIX = "Bear";
|
|
2
|
-
export declare const BEAR_ID_SEPARATOR = "
|
|
2
|
+
export declare const BEAR_ID_SEPARATOR = "-";
|
|
3
|
+
export declare const BEAR_ID_SEGMENT_DIGIT_LENGTH = 12;
|
|
4
|
+
export declare const BEAR_ID_SEGMENT_LETTERS = "abcdefghijklmnopqrstuvwxyz";
|
|
5
|
+
export declare const BEAR_ID_MAX_LENGTH = 128;
|
|
3
6
|
export declare const BEAR_ID_NUMERIC_MIN = 100000;
|
|
4
7
|
export declare const BEAR_ID_NUMERIC_MAX = 999999;
|
|
5
|
-
export declare const BEAR_ID_MAX_LENGTH = 128;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
const _ = "Bear", E = "
|
|
1
|
+
const _ = "Bear", E = "-", I = 12, R = "abcdefghijklmnopqrstuvwxyz", A = 128, o = 1e5, t = 999999;
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
A as BEAR_ID_MAX_LENGTH,
|
|
4
|
+
t as BEAR_ID_NUMERIC_MAX,
|
|
5
|
+
o as BEAR_ID_NUMERIC_MIN,
|
|
6
6
|
_ as BEAR_ID_PREFIX,
|
|
7
|
+
I as BEAR_ID_SEGMENT_DIGIT_LENGTH,
|
|
8
|
+
R as BEAR_ID_SEGMENT_LETTERS,
|
|
7
9
|
E as BEAR_ID_SEPARATOR
|
|
8
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./generateBearId.const.cjs"),E=t=>{const e=t.replace(/[^a-zA-Z0-9]/g,"");return e?e.charAt(0).toUpperCase()+e.slice(1):"Component"},_=()=>{const t=Math.floor(Math.random()*c.BEAR_ID_SEGMENT_LETTERS.length),e=c.BEAR_ID_SEGMENT_LETTERS.charAt(t);let n="";for(let a=0;a<c.BEAR_ID_SEGMENT_DIGIT_LENGTH;a+=1)n+=String(Math.floor(Math.random()*10));return`${e}${n}`},s=t=>{if(!t)return;const e=t.replace(/[^a-zA-Z0-9]/g,"");return e.length>0?e:void 0},o=(t,e,n)=>{const a=[c.BEAR_ID_PREFIX,t,e],l=s(n);l&&a.push(l);const r=a.join(c.BEAR_ID_SEPARATOR);return r.length>c.BEAR_ID_MAX_LENGTH?r.slice(0,c.BEAR_ID_MAX_LENGTH):r},I=(t,e)=>{const n=(e==null?void 0:e.componentName)??t??"Component",a=E(n);return o(a,_(),e==null?void 0:e.suffix)},d=t=>{let e=0;for(let r=0;r<t.length;r+=1)e=e*31+t.charCodeAt(r)>>>0;const n=c.BEAR_ID_SEGMENT_LETTERS.charAt(e%c.BEAR_ID_SEGMENT_LETTERS.length);let a="",l=e;for(let r=0;r<c.BEAR_ID_SEGMENT_DIGIT_LENGTH;r+=1)a+=String(l%10),l=Math.floor(l/10)+(e>>>r%16&65535);return`${n}${a}`},T=(t,e)=>{const n=E(t);return o(n,d(e))},i=(t,e)=>t??e;exports.formatBearId=T;exports.generateBearId=I;exports.resolveBearId=i;
|
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
import { BEAR_ID_PREFIX as
|
|
2
|
-
const
|
|
1
|
+
import { BEAR_ID_PREFIX as d, BEAR_ID_SEPARATOR as m, BEAR_ID_MAX_LENGTH as o, BEAR_ID_SEGMENT_LETTERS as l, BEAR_ID_SEGMENT_DIGIT_LENGTH as s } from "./generateBearId.const.js";
|
|
2
|
+
const h = (t) => {
|
|
3
|
+
const e = t.replace(/[^a-zA-Z0-9]/g, "");
|
|
4
|
+
return e ? e.charAt(0).toUpperCase() + e.slice(1) : "Component";
|
|
5
|
+
}, A = () => {
|
|
6
|
+
const t = Math.floor(Math.random() * l.length), e = l.charAt(t);
|
|
7
|
+
let n = "";
|
|
8
|
+
for (let a = 0; a < s; a += 1)
|
|
9
|
+
n += String(Math.floor(Math.random() * 10));
|
|
10
|
+
return `${e}${n}`;
|
|
11
|
+
}, f = (t) => {
|
|
3
12
|
if (!t)
|
|
4
13
|
return;
|
|
5
|
-
const e = t.replace(/[^a-zA-Z0-
|
|
14
|
+
const e = t.replace(/[^a-zA-Z0-9]/g, "");
|
|
6
15
|
return e.length > 0 ? e : void 0;
|
|
7
|
-
},
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
const n = (e == null ? void 0 : e.componentName) ?? t ?? "
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
+
}, i = (t, e, n) => {
|
|
17
|
+
const a = [d, t, e], c = f(n);
|
|
18
|
+
c && a.push(c);
|
|
19
|
+
const r = a.join(m);
|
|
20
|
+
return r.length > o ? r.slice(0, o) : r;
|
|
21
|
+
}, E = (t, e) => {
|
|
22
|
+
const n = (e == null ? void 0 : e.componentName) ?? t ?? "Component", a = h(n);
|
|
23
|
+
return i(a, A(), e == null ? void 0 : e.suffix);
|
|
24
|
+
}, g = (t) => {
|
|
16
25
|
let e = 0;
|
|
17
26
|
for (let r = 0; r < t.length; r += 1)
|
|
18
27
|
e = e * 31 + t.charCodeAt(r) >>> 0;
|
|
19
|
-
const n = l
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return
|
|
24
|
-
},
|
|
28
|
+
const n = l.charAt(e % l.length);
|
|
29
|
+
let a = "", c = e;
|
|
30
|
+
for (let r = 0; r < s; r += 1)
|
|
31
|
+
a += String(c % 10), c = Math.floor(c / 10) + (e >>> r % 16 & 65535);
|
|
32
|
+
return `${n}${a}`;
|
|
33
|
+
}, _ = (t, e) => {
|
|
34
|
+
const n = h(t);
|
|
35
|
+
return i(n, g(e));
|
|
36
|
+
}, I = (t, e) => t ?? e;
|
|
25
37
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
38
|
+
_ as formatBearId,
|
|
39
|
+
E as generateBearId,
|
|
40
|
+
I as resolveBearId
|
|
29
41
|
};
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./cn.cjs"),I=require("./deepMerge.cjs"),t=require("./createSlots.cjs"),r=require("./generateBearId.utils.cjs"),s=require("./useBearId.cjs"),B=require("./getResponsiveClass.utils.cjs"),e=require("./generateBearId.const.cjs"),R=require("./liveRegion.const.cjs"),_=require("./liveRegion.utils.cjs");exports.cn=E.cn;exports.styleForge=E.styleForge;exports.deepMerge=I.deepMerge;exports.createSlots=t.createSlots;exports.formatBearId=r.formatBearId;exports.generateBearId=r.generateBearId;exports.resolveBearId=r.resolveBearId;exports.useBearId=s.useBearId;exports.getResponsiveClass=B.getResponsiveClass;exports.BEAR_ID_MAX_LENGTH=e.BEAR_ID_MAX_LENGTH;exports.BEAR_ID_NUMERIC_MAX=e.BEAR_ID_NUMERIC_MAX;exports.BEAR_ID_NUMERIC_MIN=e.BEAR_ID_NUMERIC_MIN;exports.BEAR_ID_PREFIX=e.BEAR_ID_PREFIX;exports.BEAR_ID_SEGMENT_DIGIT_LENGTH=e.BEAR_ID_SEGMENT_DIGIT_LENGTH;exports.BEAR_ID_SEGMENT_LETTERS=e.BEAR_ID_SEGMENT_LETTERS;exports.BEAR_ID_SEPARATOR=e.BEAR_ID_SEPARATOR;exports.BEAR_ARIA_LIVE_BY_SEVERITY=R.BEAR_ARIA_LIVE_BY_SEVERITY;exports.BEAR_ARIA_ROLE_BY_SEVERITY=R.BEAR_ARIA_ROLE_BY_SEVERITY;exports.getBearAriaLive=_.getBearAriaLive;exports.getBearAriaRole=_.getBearAriaRole;exports.getBearLiveRegionProps=_.getBearLiveRegionProps;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -6,4 +6,7 @@ export { generateBearId, formatBearId, resolveBearId } from './generateBearId.ut
|
|
|
6
6
|
export type { GenerateBearIdOptions } from './generateBearId.types';
|
|
7
7
|
export { useBearId } from './useBearId';
|
|
8
8
|
export { getResponsiveClass } from './getResponsiveClass.utils';
|
|
9
|
-
export { BEAR_ID_PREFIX, BEAR_ID_SEPARATOR, BEAR_ID_NUMERIC_MIN, BEAR_ID_NUMERIC_MAX, BEAR_ID_MAX_LENGTH, } from './generateBearId.const';
|
|
9
|
+
export { BEAR_ID_PREFIX, BEAR_ID_SEPARATOR, BEAR_ID_SEGMENT_DIGIT_LENGTH, BEAR_ID_SEGMENT_LETTERS, BEAR_ID_NUMERIC_MIN, BEAR_ID_NUMERIC_MAX, BEAR_ID_MAX_LENGTH, } from './generateBearId.const';
|
|
10
|
+
export { BEAR_ARIA_LIVE_BY_SEVERITY, BEAR_ARIA_ROLE_BY_SEVERITY, } from './liveRegion.const';
|
|
11
|
+
export type { BearLiveSeverity, BearAriaLive, BearAriaRole } from './liveRegion.const';
|
|
12
|
+
export { getBearAriaLive, getBearAriaRole, getBearLiveRegionProps, } from './liveRegion.utils';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { deepMerge as
|
|
3
|
-
import { createSlots as
|
|
4
|
-
import { formatBearId as
|
|
1
|
+
import { cn as _, styleForge as E } from "./cn.js";
|
|
2
|
+
import { deepMerge as R } from "./deepMerge.js";
|
|
3
|
+
import { createSlots as A } from "./createSlots.js";
|
|
4
|
+
import { formatBearId as B, generateBearId as a, resolveBearId as p } from "./generateBearId.utils.js";
|
|
5
5
|
import { useBearId as m } from "./useBearId.js";
|
|
6
|
-
import { getResponsiveClass as
|
|
7
|
-
import { BEAR_ID_MAX_LENGTH as
|
|
6
|
+
import { getResponsiveClass as s } from "./getResponsiveClass.utils.js";
|
|
7
|
+
import { BEAR_ID_MAX_LENGTH as g, BEAR_ID_NUMERIC_MAX as D, BEAR_ID_NUMERIC_MIN as M, BEAR_ID_PREFIX as L, BEAR_ID_SEGMENT_DIGIT_LENGTH as N, BEAR_ID_SEGMENT_LETTERS as S, BEAR_ID_SEPARATOR as i } from "./generateBearId.const.js";
|
|
8
|
+
import { BEAR_ARIA_LIVE_BY_SEVERITY as l, BEAR_ARIA_ROLE_BY_SEVERITY as G } from "./liveRegion.const.js";
|
|
9
|
+
import { getBearAriaLive as v, getBearAriaRole as Y, getBearLiveRegionProps as C } from "./liveRegion.utils.js";
|
|
8
10
|
export {
|
|
9
|
-
|
|
11
|
+
l as BEAR_ARIA_LIVE_BY_SEVERITY,
|
|
12
|
+
G as BEAR_ARIA_ROLE_BY_SEVERITY,
|
|
13
|
+
g as BEAR_ID_MAX_LENGTH,
|
|
10
14
|
D as BEAR_ID_NUMERIC_MAX,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
N as
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_ as
|
|
17
|
-
A as
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
a as
|
|
21
|
-
|
|
15
|
+
M as BEAR_ID_NUMERIC_MIN,
|
|
16
|
+
L as BEAR_ID_PREFIX,
|
|
17
|
+
N as BEAR_ID_SEGMENT_DIGIT_LENGTH,
|
|
18
|
+
S as BEAR_ID_SEGMENT_LETTERS,
|
|
19
|
+
i as BEAR_ID_SEPARATOR,
|
|
20
|
+
_ as cn,
|
|
21
|
+
A as createSlots,
|
|
22
|
+
R as deepMerge,
|
|
23
|
+
B as formatBearId,
|
|
24
|
+
a as generateBearId,
|
|
25
|
+
v as getBearAriaLive,
|
|
26
|
+
Y as getBearAriaRole,
|
|
27
|
+
C as getBearLiveRegionProps,
|
|
28
|
+
s as getResponsiveClass,
|
|
29
|
+
p as resolveBearId,
|
|
30
|
+
E as styleForge,
|
|
22
31
|
m as useBearId
|
|
23
32
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={success:"polite",info:"polite",warning:"polite",error:"assertive",default:"polite"},e={success:"status",info:"status",warning:"status",error:"alert",default:"status"};exports.BEAR_ARIA_LIVE_BY_SEVERITY=t;exports.BEAR_ARIA_ROLE_BY_SEVERITY=e;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type BearLiveSeverity = 'success' | 'info' | 'warning' | 'error' | 'default';
|
|
2
|
+
export type BearAriaLive = 'polite' | 'assertive';
|
|
3
|
+
export type BearAriaRole = 'status' | 'alert';
|
|
4
|
+
export declare const BEAR_ARIA_LIVE_BY_SEVERITY: Record<BearLiveSeverity, BearAriaLive>;
|
|
5
|
+
export declare const BEAR_ARIA_ROLE_BY_SEVERITY: Record<BearLiveSeverity, BearAriaRole>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
success: "polite",
|
|
3
|
+
info: "polite",
|
|
4
|
+
warning: "polite",
|
|
5
|
+
error: "assertive",
|
|
6
|
+
default: "polite"
|
|
7
|
+
}, s = {
|
|
8
|
+
success: "status",
|
|
9
|
+
info: "status",
|
|
10
|
+
warning: "status",
|
|
11
|
+
error: "alert",
|
|
12
|
+
default: "status"
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
t as BEAR_ARIA_LIVE_BY_SEVERITY,
|
|
16
|
+
s as BEAR_ARIA_ROLE_BY_SEVERITY
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./liveRegion.const.cjs"),t=(e="default")=>r.BEAR_ARIA_LIVE_BY_SEVERITY[e],a=(e="default")=>r.BEAR_ARIA_ROLE_BY_SEVERITY[e],i=(e="default")=>({role:a(e),"aria-live":t(e)});exports.getBearAriaLive=t;exports.getBearAriaRole=a;exports.getBearLiveRegionProps=i;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BearAriaLive, BearAriaRole, BearLiveSeverity } from './liveRegion.const';
|
|
2
|
+
export declare const getBearAriaLive: (severity?: BearLiveSeverity) => BearAriaLive;
|
|
3
|
+
export declare const getBearAriaRole: (severity?: BearLiveSeverity) => BearAriaRole;
|
|
4
|
+
export declare const getBearLiveRegionProps: (severity?: BearLiveSeverity) => {
|
|
5
|
+
role: BearAriaRole;
|
|
6
|
+
'aria-live': BearAriaLive;
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BEAR_ARIA_LIVE_BY_SEVERITY as a, BEAR_ARIA_ROLE_BY_SEVERITY as o } from "./liveRegion.const.js";
|
|
2
|
+
const r = (e = "default") => a[e], t = (e = "default") => o[e], A = (e = "default") => ({
|
|
3
|
+
role: t(e),
|
|
4
|
+
"aria-live": r(e)
|
|
5
|
+
});
|
|
6
|
+
export {
|
|
7
|
+
r as getBearAriaLive,
|
|
8
|
+
t as getBearAriaRole,
|
|
9
|
+
A as getBearLiveRegionProps
|
|
10
|
+
};
|
package/dist/utils/useBearId.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),c=require("./generateBearId.const.cjs"),u=require("./generateBearId.utils.cjs"),o=(t,e)=>{const a=s.useId();return s.useMemo(()=>{const r=u.formatBearId(t,a);if(!e)return r;const n=e.replace(/[^a-zA-Z0-9]/g,"");return n?`${r}${c.BEAR_ID_SEPARATOR}${n}`:r},[t,a,e])};exports.useBearId=o;
|
package/dist/utils/useBearId.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { useId as c, useMemo as d } from "react";
|
|
2
|
+
import { BEAR_ID_SEPARATOR as m } from "./generateBearId.const.js";
|
|
2
3
|
import { formatBearId as n } from "./generateBearId.utils.js";
|
|
3
|
-
const
|
|
4
|
+
const p = (t, r) => {
|
|
4
5
|
const o = c();
|
|
5
6
|
return d(() => {
|
|
6
7
|
const e = n(t, o);
|
|
7
8
|
if (!r)
|
|
8
9
|
return e;
|
|
9
|
-
const a = r.replace(/[^a-zA-Z0-
|
|
10
|
-
return a ? `${e}
|
|
10
|
+
const a = r.replace(/[^a-zA-Z0-9]/g, "");
|
|
11
|
+
return a ? `${e}${m}${a}` : e;
|
|
11
12
|
}, [t, o, r]);
|
|
12
13
|
};
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
p as useBearId
|
|
15
16
|
};
|
package/package.json
CHANGED