@forgedevstack/bear 1.1.1 → 1.1.4
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/components/ActionIcon/ActionIcon.cjs +1 -0
- package/dist/components/ActionIcon/ActionIcon.const.cjs +1 -0
- package/dist/components/ActionIcon/ActionIcon.const.d.ts +7 -0
- package/dist/components/ActionIcon/ActionIcon.const.js +68 -0
- package/dist/components/ActionIcon/ActionIcon.d.ts +4 -0
- package/dist/components/ActionIcon/ActionIcon.js +42 -0
- package/dist/components/ActionIcon/ActionIcon.types.d.ts +11 -0
- package/dist/components/ActionIcon/index.d.ts +2 -0
- package/dist/components/Affix/Affix.cjs +1 -0
- package/dist/components/Affix/Affix.const.cjs +1 -0
- package/dist/components/Affix/Affix.const.d.ts +6 -0
- package/dist/components/Affix/Affix.const.js +9 -0
- package/dist/components/Affix/Affix.d.ts +4 -0
- package/dist/components/Affix/Affix.js +69 -0
- package/dist/components/Affix/Affix.types.d.ts +10 -0
- package/dist/components/Affix/index.d.ts +2 -0
- package/dist/components/AlertDialog/AlertDialog.cjs +1 -0
- package/dist/components/AlertDialog/AlertDialog.const.cjs +1 -0
- package/dist/components/AlertDialog/AlertDialog.const.d.ts +5 -0
- package/dist/components/AlertDialog/AlertDialog.const.js +8 -0
- package/dist/components/AlertDialog/AlertDialog.d.ts +4 -0
- package/dist/components/AlertDialog/AlertDialog.js +107 -0
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +34 -0
- package/dist/components/AlertDialog/index.d.ts +3 -0
- package/dist/components/Anchor/Anchor.cjs +1 -0
- package/dist/components/Anchor/Anchor.const.cjs +1 -0
- package/dist/components/Anchor/Anchor.const.d.ts +9 -0
- package/dist/components/Anchor/Anchor.const.js +11 -0
- package/dist/components/Anchor/Anchor.d.ts +4 -0
- package/dist/components/Anchor/Anchor.js +91 -0
- package/dist/components/Anchor/Anchor.types.d.ts +16 -0
- package/dist/components/Anchor/index.d.ts +2 -0
- package/dist/components/AspectRatio/AspectRatio.cjs +1 -0
- package/dist/components/AspectRatio/AspectRatio.d.ts +3 -0
- package/dist/components/AspectRatio/AspectRatio.js +29 -0
- package/dist/components/AspectRatio/AspectRatio.types.d.ts +9 -0
- package/dist/components/AspectRatio/index.d.ts +2 -0
- package/dist/components/Blockquote/Blockquote.cjs +1 -0
- package/dist/components/Blockquote/Blockquote.const.cjs +1 -0
- package/dist/components/Blockquote/Blockquote.const.d.ts +5 -0
- package/dist/components/Blockquote/Blockquote.const.js +19 -0
- package/dist/components/Blockquote/Blockquote.d.ts +4 -0
- package/dist/components/Blockquote/Blockquote.js +56 -0
- package/dist/components/Blockquote/Blockquote.types.d.ts +9 -0
- package/dist/components/Blockquote/index.d.ts +2 -0
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.constants.cjs +2 -2
- package/dist/components/Button/Button.constants.d.ts +1 -0
- package/dist/components/Button/Button.constants.js +10 -3
- package/dist/components/Button/Button.js +92 -84
- package/dist/components/Button/Button.types.d.ts +2 -0
- package/dist/components/CheckboxCard/CheckboxCard.cjs +1 -0
- package/dist/components/CheckboxCard/CheckboxCard.const.cjs +1 -0
- package/dist/components/CheckboxCard/CheckboxCard.const.d.ts +7 -0
- package/dist/components/CheckboxCard/CheckboxCard.const.js +22 -0
- package/dist/components/CheckboxCard/CheckboxCard.d.ts +5 -0
- package/dist/components/CheckboxCard/CheckboxCard.js +132 -0
- package/dist/components/CheckboxCard/CheckboxCard.types.d.ts +21 -0
- package/dist/components/CheckboxCard/index.d.ts +2 -0
- package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
- package/dist/components/ColorPicker/ColorPicker.const.cjs +1 -0
- package/dist/components/ColorPicker/ColorPicker.const.d.ts +26 -0
- package/dist/components/ColorPicker/ColorPicker.const.js +38 -0
- package/dist/components/ColorPicker/ColorPicker.js +61 -78
- package/dist/components/ColorSwatch/ColorSwatch.cjs +1 -0
- package/dist/components/ColorSwatch/ColorSwatch.const.cjs +1 -0
- package/dist/components/ColorSwatch/ColorSwatch.const.d.ts +16 -0
- package/dist/components/ColorSwatch/ColorSwatch.const.js +19 -0
- package/dist/components/ColorSwatch/ColorSwatch.d.ts +5 -0
- package/dist/components/ColorSwatch/ColorSwatch.js +92 -0
- package/dist/components/ColorSwatch/ColorSwatch.types.d.ts +23 -0
- package/dist/components/ColorSwatch/ColorSwatch.utils.cjs +1 -0
- package/dist/components/ColorSwatch/ColorSwatch.utils.d.ts +6 -0
- package/dist/components/ColorSwatch/ColorSwatch.utils.js +14 -0
- package/dist/components/ColorSwatch/index.d.ts +2 -0
- package/dist/components/ContextMenu/ContextMenu.cjs +1 -0
- package/dist/components/ContextMenu/ContextMenu.const.cjs +1 -0
- package/dist/components/ContextMenu/ContextMenu.const.d.ts +9 -0
- package/dist/components/ContextMenu/ContextMenu.const.js +12 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenu.js +64 -0
- package/dist/components/ContextMenu/ContextMenu.types.d.ts +23 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.const.cjs +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.const.d.ts +27 -0
- package/dist/components/DateRangePicker/DateRangePicker.const.js +74 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +4 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +115 -0
- package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +26 -0
- package/dist/components/DateRangePicker/DateRangePicker.utils.cjs +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.utils.d.ts +4 -0
- package/dist/components/DateRangePicker/DateRangePicker.utils.js +22 -0
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/Descriptions/Descriptions.cjs +1 -0
- package/dist/components/Descriptions/Descriptions.const.cjs +1 -0
- package/dist/components/Descriptions/Descriptions.const.d.ts +24 -0
- package/dist/components/Descriptions/Descriptions.const.js +27 -0
- package/dist/components/Descriptions/Descriptions.d.ts +4 -0
- package/dist/components/Descriptions/Descriptions.js +65 -0
- package/dist/components/Descriptions/Descriptions.types.d.ts +16 -0
- package/dist/components/Descriptions/index.d.ts +2 -0
- package/dist/components/Fieldset/Fieldset.cjs +1 -0
- package/dist/components/Fieldset/Fieldset.const.cjs +1 -0
- package/dist/components/Fieldset/Fieldset.const.d.ts +5 -0
- package/dist/components/Fieldset/Fieldset.const.js +16 -0
- package/dist/components/Fieldset/Fieldset.d.ts +4 -0
- package/dist/components/Fieldset/Fieldset.js +47 -0
- package/dist/components/Fieldset/Fieldset.types.d.ts +10 -0
- package/dist/components/Fieldset/index.d.ts +2 -0
- package/dist/components/FormField/FormField.cjs +1 -0
- package/dist/components/FormField/FormField.const.cjs +1 -0
- package/dist/components/FormField/FormField.const.d.ts +20 -0
- package/dist/components/FormField/FormField.const.js +23 -0
- package/dist/components/FormField/FormField.d.ts +3 -0
- package/dist/components/FormField/FormField.js +127 -0
- package/dist/components/FormField/FormField.types.d.ts +23 -0
- package/dist/components/FormField/index.d.ts +2 -0
- package/dist/components/ImageGallery/ImageGallery.cjs +1 -0
- package/dist/components/ImageGallery/ImageGallery.const.cjs +1 -0
- package/dist/components/ImageGallery/ImageGallery.const.d.ts +13 -0
- package/dist/components/ImageGallery/ImageGallery.const.js +16 -0
- package/dist/components/ImageGallery/ImageGallery.d.ts +4 -0
- package/dist/components/ImageGallery/ImageGallery.js +61 -0
- package/dist/components/ImageGallery/ImageGallery.types.d.ts +22 -0
- package/dist/components/ImageGallery/index.d.ts +2 -0
- package/dist/components/Indicator/Indicator.cjs +1 -0
- package/dist/components/Indicator/Indicator.const.cjs +1 -0
- package/dist/components/Indicator/Indicator.const.d.ts +15 -0
- package/dist/components/Indicator/Indicator.const.js +26 -0
- package/dist/components/Indicator/Indicator.d.ts +4 -0
- package/dist/components/Indicator/Indicator.js +56 -0
- package/dist/components/Indicator/Indicator.types.d.ts +16 -0
- package/dist/components/Indicator/index.d.ts +2 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.cjs +1 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.const.cjs +1 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.const.d.ts +7 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.const.js +10 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.d.ts +4 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.js +51 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.types.d.ts +13 -0
- package/dist/components/InfiniteScroll/index.d.ts +2 -0
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.js +114 -44
- package/dist/components/Input/Input.types.d.ts +20 -0
- package/dist/components/Input/Input.utils.cjs +1 -0
- package/dist/components/Input/Input.utils.d.ts +2 -0
- package/dist/components/Input/Input.utils.js +15 -0
- package/dist/components/Input/components/ClearIcon/ClearIcon.cjs +1 -0
- package/dist/components/Input/components/ClearIcon/ClearIcon.d.ts +7 -0
- package/dist/components/Input/components/ClearIcon/ClearIcon.js +25 -0
- package/dist/components/Input/components/ClearIcon/index.d.ts +1 -0
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/InputGroup/InputGroup.cjs +1 -0
- package/dist/components/InputGroup/InputGroup.d.ts +4 -0
- package/dist/components/InputGroup/InputGroup.js +63 -0
- package/dist/components/InputGroup/InputGroup.types.d.ts +23 -0
- package/dist/components/InputGroup/index.d.ts +2 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.cjs +1 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.const.cjs +1 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.const.d.ts +6 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.const.js +9 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.d.ts +4 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.js +42 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.types.d.ts +11 -0
- package/dist/components/LoadingOverlay/index.d.ts +2 -0
- package/dist/components/NumberFormatter/NumberFormatter.cjs +1 -0
- package/dist/components/NumberFormatter/NumberFormatter.const.cjs +1 -0
- package/dist/components/NumberFormatter/NumberFormatter.const.d.ts +5 -0
- package/dist/components/NumberFormatter/NumberFormatter.const.js +8 -0
- package/dist/components/NumberFormatter/NumberFormatter.d.ts +4 -0
- package/dist/components/NumberFormatter/NumberFormatter.js +53 -0
- package/dist/components/NumberFormatter/NumberFormatter.types.d.ts +20 -0
- package/dist/components/NumberFormatter/NumberFormatter.utils.cjs +1 -0
- package/dist/components/NumberFormatter/NumberFormatter.utils.d.ts +2 -0
- package/dist/components/NumberFormatter/NumberFormatter.utils.js +19 -0
- package/dist/components/NumberFormatter/index.d.ts +2 -0
- package/dist/components/PasswordInput/PasswordInput.cjs +1 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +3 -0
- package/dist/components/PasswordInput/PasswordInput.js +61 -0
- package/dist/components/PasswordInput/PasswordInput.types.d.ts +18 -0
- package/dist/components/PasswordInput/index.d.ts +2 -0
- package/dist/components/Popconfirm/Popconfirm.cjs +1 -0
- package/dist/components/Popconfirm/Popconfirm.const.cjs +1 -0
- package/dist/components/Popconfirm/Popconfirm.const.d.ts +13 -0
- package/dist/components/Popconfirm/Popconfirm.const.js +20 -0
- package/dist/components/Popconfirm/Popconfirm.d.ts +4 -0
- package/dist/components/Popconfirm/Popconfirm.js +65 -0
- package/dist/components/Popconfirm/Popconfirm.types.d.ts +16 -0
- package/dist/components/Popconfirm/index.d.ts +2 -0
- package/dist/components/RadioCard/RadioCard.cjs +1 -0
- package/dist/components/RadioCard/RadioCard.const.cjs +1 -0
- package/dist/components/RadioCard/RadioCard.const.d.ts +7 -0
- package/dist/components/RadioCard/RadioCard.const.js +22 -0
- package/dist/components/RadioCard/RadioCard.d.ts +5 -0
- package/dist/components/RadioCard/RadioCard.js +111 -0
- package/dist/components/RadioCard/RadioCard.types.d.ts +22 -0
- package/dist/components/RadioCard/index.d.ts +2 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.cjs +1 -1
- package/dist/components/ResizableTextarea/ResizableTextarea.js +90 -54
- package/dist/components/ResizableTextarea/ResizableTextarea.types.d.ts +10 -0
- package/dist/components/Result/Result.cjs +1 -0
- package/dist/components/Result/Result.const.cjs +1 -0
- package/dist/components/Result/Result.const.d.ts +10 -0
- package/dist/components/Result/Result.const.js +20 -0
- package/dist/components/Result/Result.d.ts +4 -0
- package/dist/components/Result/Result.icons.cjs +1 -0
- package/dist/components/Result/Result.icons.d.ts +3 -0
- package/dist/components/Result/Result.icons.js +31 -0
- package/dist/components/Result/Result.js +35 -0
- package/dist/components/Result/Result.types.d.ts +10 -0
- package/dist/components/Result/index.d.ts +2 -0
- package/dist/components/RichEditor/RichEditor.cjs +1 -1
- package/dist/components/RichEditor/RichEditor.js +186 -169
- package/dist/components/RichEditor/RichEditor.types.d.ts +4 -0
- package/dist/components/RingProgress/RingProgress.cjs +1 -0
- package/dist/components/RingProgress/RingProgress.const.cjs +1 -0
- package/dist/components/RingProgress/RingProgress.const.d.ts +4 -0
- package/dist/components/RingProgress/RingProgress.const.js +7 -0
- package/dist/components/RingProgress/RingProgress.d.ts +4 -0
- package/dist/components/RingProgress/RingProgress.js +67 -0
- package/dist/components/RingProgress/RingProgress.types.d.ts +15 -0
- package/dist/components/RingProgress/index.d.ts +2 -0
- package/dist/components/SignPad/SignPad.cjs +1 -1
- package/dist/components/SignPad/SignPad.const.cjs +1 -1
- package/dist/components/SignPad/SignPad.const.js +10 -11
- package/dist/components/SignPad/SignPad.d.ts +4 -6
- package/dist/components/SignPad/SignPad.js +108 -116
- package/dist/components/SignPad/SignPad.types.d.ts +2 -2
- package/dist/components/SplitButton/SplitButton.cjs +1 -0
- package/dist/components/SplitButton/SplitButton.const.cjs +1 -0
- package/dist/components/SplitButton/SplitButton.const.d.ts +25 -0
- package/dist/components/SplitButton/SplitButton.const.js +27 -0
- package/dist/components/SplitButton/SplitButton.d.ts +4 -0
- package/dist/components/SplitButton/SplitButton.js +73 -0
- package/dist/components/SplitButton/SplitButton.types.d.ts +21 -0
- package/dist/components/SplitButton/index.d.ts +2 -0
- package/dist/components/Spoiler/Spoiler.cjs +1 -0
- package/dist/components/Spoiler/Spoiler.const.cjs +1 -0
- package/dist/components/Spoiler/Spoiler.const.d.ts +6 -0
- package/dist/components/Spoiler/Spoiler.const.js +9 -0
- package/dist/components/Spoiler/Spoiler.d.ts +4 -0
- package/dist/components/Spoiler/Spoiler.js +59 -0
- package/dist/components/Spoiler/Spoiler.types.d.ts +10 -0
- package/dist/components/Spoiler/index.d.ts +2 -0
- package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.cjs +1 -1
- package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.js +63 -57
- package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
- package/dist/components/TimePicker/helpers/ClockFaceSvg.d.ts +0 -7
- package/dist/components/TimePicker/helpers/ClockFaceSvg.js +32 -31
- package/dist/components/TreeSelect/TreeSelect.cjs +1 -0
- package/dist/components/TreeSelect/TreeSelect.const.cjs +1 -0
- package/dist/components/TreeSelect/TreeSelect.const.d.ts +19 -0
- package/dist/components/TreeSelect/TreeSelect.const.js +22 -0
- package/dist/components/TreeSelect/TreeSelect.d.ts +4 -0
- package/dist/components/TreeSelect/TreeSelect.js +128 -0
- package/dist/components/TreeSelect/TreeSelect.types.d.ts +25 -0
- package/dist/components/TreeSelect/TreeSelect.utils.cjs +1 -0
- package/dist/components/TreeSelect/TreeSelect.utils.d.ts +5 -0
- package/dist/components/TreeSelect/TreeSelect.utils.js +25 -0
- package/dist/components/TreeSelect/index.d.ts +2 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +54 -0
- package/dist/components/index.js +349 -292
- package/dist/index.cjs +1 -1
- package/dist/index.js +439 -382
- package/dist/postcss/bear-plugin.cjs +86 -0
- package/dist/styles/_alerts.css +14 -0
- package/dist/styles/_base.css +56 -0
- package/dist/styles/_buttons.css +108 -0
- package/dist/styles/_effects.css +90 -0
- package/dist/styles/_marquee.css +25 -0
- package/dist/styles/main.css +5 -0
- package/dist/styles.css +1 -1
- package/dist/types/component.types.d.ts +13 -0
- package/package.json +10 -6
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as O, useState as R, useRef as l, useEffect as S } from "react";
|
|
3
|
+
import { cn as _ } from "../../utils/cn.js";
|
|
4
|
+
import { DEFAULT_ANIMATION_DURATION as g, ROOT_CLASSES as h, ANIMATION_FRAME_RATE as V } from "./NumberFormatter.const.js";
|
|
5
|
+
import { buildFormatter as b } from "./NumberFormatter.utils.js";
|
|
6
|
+
const k = (t) => {
|
|
7
|
+
const {
|
|
8
|
+
value: e,
|
|
9
|
+
prefix: d = "",
|
|
10
|
+
suffix: A = "",
|
|
11
|
+
animated: m = !1,
|
|
12
|
+
animationDuration: s = g,
|
|
13
|
+
className: D,
|
|
14
|
+
testId: F,
|
|
15
|
+
...y
|
|
16
|
+
} = t, N = O(() => b(t), [
|
|
17
|
+
t.formatStyle,
|
|
18
|
+
t.locale,
|
|
19
|
+
t.currency,
|
|
20
|
+
t.currencyDisplay,
|
|
21
|
+
t.unit,
|
|
22
|
+
t.unitDisplay,
|
|
23
|
+
t.notation,
|
|
24
|
+
t.minimumFractionDigits,
|
|
25
|
+
t.maximumFractionDigits,
|
|
26
|
+
t.signDisplay
|
|
27
|
+
]), [I, r] = R(e), n = l(e), a = l(0);
|
|
28
|
+
S(() => {
|
|
29
|
+
if (!m) {
|
|
30
|
+
r(e), n.current = e;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const c = n.current, o = e - c;
|
|
34
|
+
if (o === 0) return;
|
|
35
|
+
const u = Math.max(1, Math.round(s / V));
|
|
36
|
+
let i = 0;
|
|
37
|
+
const f = () => {
|
|
38
|
+
i++;
|
|
39
|
+
const x = i / u, T = 1 - Math.pow(1 - x, 3);
|
|
40
|
+
r(c + o * T), i < u ? a.current = requestAnimationFrame(f) : (r(e), n.current = e);
|
|
41
|
+
};
|
|
42
|
+
return a.current = requestAnimationFrame(f), () => cancelAnimationFrame(a.current);
|
|
43
|
+
}, [e, m, s]);
|
|
44
|
+
const M = N.format(I);
|
|
45
|
+
return /* @__PURE__ */ E("span", { className: _(h, D), "data-testid": F, ...y, children: [
|
|
46
|
+
d,
|
|
47
|
+
M,
|
|
48
|
+
A
|
|
49
|
+
] });
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
k as NumberFormatter
|
|
53
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type NumberFormatStyle = 'decimal' | 'currency' | 'percent' | 'compact' | 'unit';
|
|
3
|
+
export interface NumberFormatterProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
value: number;
|
|
5
|
+
formatStyle?: NumberFormatStyle;
|
|
6
|
+
locale?: string;
|
|
7
|
+
currency?: string;
|
|
8
|
+
currencyDisplay?: 'symbol' | 'code' | 'name' | 'narrowSymbol';
|
|
9
|
+
unit?: string;
|
|
10
|
+
unitDisplay?: 'short' | 'long' | 'narrow';
|
|
11
|
+
notation?: 'standard' | 'scientific' | 'engineering' | 'compact';
|
|
12
|
+
minimumFractionDigits?: number;
|
|
13
|
+
maximumFractionDigits?: number;
|
|
14
|
+
signDisplay?: 'auto' | 'never' | 'always' | 'exceptZero';
|
|
15
|
+
prefix?: string;
|
|
16
|
+
suffix?: string;
|
|
17
|
+
animated?: boolean;
|
|
18
|
+
animationDuration?: number;
|
|
19
|
+
testId?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./NumberFormatter.const.cjs"),p=m=>{const{formatStyle:t="decimal",locale:s=u.DEFAULT_LOCALE,currency:l=u.DEFAULT_CURRENCY,currencyDisplay:e,unit:n,unitDisplay:r,notation:c,minimumFractionDigits:o,maximumFractionDigits:a,signDisplay:y}=m,i={signDisplay:y};return t==="currency"?(i.style="currency",i.currency=l,e&&(i.currencyDisplay=e)):t==="percent"?i.style="percent":t==="compact"?i.notation="compact":t==="unit"&&n&&(i.style="unit",i.unit=n,r&&(i.unitDisplay=r)),c&&t!=="compact"&&(i.notation=c),o!==void 0&&(i.minimumFractionDigits=o),a!==void 0&&(i.maximumFractionDigits=a),new Intl.NumberFormat(s,i)};exports.buildFormatter=p;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DEFAULT_LOCALE as y, DEFAULT_CURRENCY as p } from "./NumberFormatter.const.js";
|
|
2
|
+
const D = (m) => {
|
|
3
|
+
const {
|
|
4
|
+
formatStyle: t = "decimal",
|
|
5
|
+
locale: s = y,
|
|
6
|
+
currency: u = p,
|
|
7
|
+
currencyDisplay: n,
|
|
8
|
+
unit: c,
|
|
9
|
+
unitDisplay: r,
|
|
10
|
+
notation: e,
|
|
11
|
+
minimumFractionDigits: o,
|
|
12
|
+
maximumFractionDigits: a,
|
|
13
|
+
signDisplay: l
|
|
14
|
+
} = m, i = { signDisplay: l };
|
|
15
|
+
return t === "currency" ? (i.style = "currency", i.currency = u, n && (i.currencyDisplay = n)) : t === "percent" ? i.style = "percent" : t === "compact" ? i.notation = "compact" : t === "unit" && c && (i.style = "unit", i.unit = c, r && (i.unitDisplay = r)), e && t !== "compact" && (i.notation = e), o !== void 0 && (i.minimumFractionDigits = o), a !== void 0 && (i.maximumFractionDigits = a), new Intl.NumberFormat(s, i);
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
D as buildFormatter
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),b=require("../../utils/cn.cjs"),L=require("../Input/Input.cjs"),i=require("../Icon/icons/action.cjs"),_=b.cn("Bear-PasswordInput__shift bear-text-xs bear-font-medium bear-px-1.5 bear-py-0.5","bear-rounded bear-bg-amber-100 bear-text-amber-700","dark:bear-bg-amber-900/40 dark:bear-text-amber-400","bear-select-none bear-whitespace-nowrap"),S=({visible:t,onVisibilityChange:a,hideToggle:d=!1,toggleAriaLabel:u="Toggle password visibility",showShiftIndicator:n=!1,visibleIcon:l,hiddenIcon:p,...w})=>{const[x,m]=s.useState(!1),[f,I]=s.useState(!1),o=t!==void 0,c=o?t:x,g=s.useCallback(()=>{o?a==null||a(!t):m(e=>!e)},[o,t,a]);s.useEffect(()=>{if(!n)return;const e=j=>I(j.getModifierState("CapsLock"));return window.addEventListener("keydown",e),window.addEventListener("keyup",e),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",e)}},[n]);const v=r.jsx(i.VisibilityOffIcon,{className:"bear-w-4 bear-h-4"}),k=r.jsx(i.VisibilityIcon,{className:"bear-w-4 bear-h-4"}),y=d?void 0:r.jsxs("span",{className:"Bear-PasswordInput__actions bear-inline-flex bear-items-center bear-gap-1.5",children:[n&&f&&r.jsx("span",{className:_,children:"Caps"}),r.jsx("button",{type:"button",tabIndex:-1,onClick:g,className:b.cn("Bear-PasswordInput__toggle bear-inline-flex bear-items-center bear-justify-center","bear-text-gray-400 hover:bear-text-gray-600 dark:hover:bear-text-gray-300","bear-transition-colors bear-cursor-pointer"),"aria-label":u,children:c?l??v:p??k})]});return r.jsx(L.Input,{type:c?"text":"password",rightAddon:y,autoComplete:"current-password",...w})};exports.PasswordInput=S;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsxs as L, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useCallback as _, useEffect as E } from "react";
|
|
3
|
+
import { cn as c } from "../../utils/cn.js";
|
|
4
|
+
import { Input as N } from "../Input/Input.js";
|
|
5
|
+
import { VisibilityOffIcon as B, VisibilityIcon as C } from "../Icon/icons/action.js";
|
|
6
|
+
const O = c(
|
|
7
|
+
"Bear-PasswordInput__shift bear-text-xs bear-font-medium bear-px-1.5 bear-py-0.5",
|
|
8
|
+
"bear-rounded bear-bg-amber-100 bear-text-amber-700",
|
|
9
|
+
"dark:bear-bg-amber-900/40 dark:bear-text-amber-400",
|
|
10
|
+
"bear-select-none bear-whitespace-nowrap"
|
|
11
|
+
), A = ({
|
|
12
|
+
visible: a,
|
|
13
|
+
onVisibilityChange: t,
|
|
14
|
+
hideToggle: i = !1,
|
|
15
|
+
toggleAriaLabel: d = "Toggle password visibility",
|
|
16
|
+
showShiftIndicator: s = !1,
|
|
17
|
+
visibleIcon: l,
|
|
18
|
+
hiddenIcon: p,
|
|
19
|
+
...m
|
|
20
|
+
}) => {
|
|
21
|
+
const [u, f] = b(!1), [w, x] = b(!1), n = a !== void 0, o = n ? a : u, k = _(() => {
|
|
22
|
+
n ? t == null || t(!a) : f((e) => !e);
|
|
23
|
+
}, [n, a, t]);
|
|
24
|
+
E(() => {
|
|
25
|
+
if (!s) return;
|
|
26
|
+
const e = (y) => x(y.getModifierState("CapsLock"));
|
|
27
|
+
return window.addEventListener("keydown", e), window.addEventListener("keyup", e), () => {
|
|
28
|
+
window.removeEventListener("keydown", e), window.removeEventListener("keyup", e);
|
|
29
|
+
};
|
|
30
|
+
}, [s]);
|
|
31
|
+
const v = /* @__PURE__ */ r(B, { className: "bear-w-4 bear-h-4" }), I = /* @__PURE__ */ r(C, { className: "bear-w-4 bear-h-4" }), g = i ? void 0 : /* @__PURE__ */ L("span", { className: "Bear-PasswordInput__actions bear-inline-flex bear-items-center bear-gap-1.5", children: [
|
|
32
|
+
s && w && /* @__PURE__ */ r("span", { className: O, children: "Caps" }),
|
|
33
|
+
/* @__PURE__ */ r(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
type: "button",
|
|
37
|
+
tabIndex: -1,
|
|
38
|
+
onClick: k,
|
|
39
|
+
className: c(
|
|
40
|
+
"Bear-PasswordInput__toggle bear-inline-flex bear-items-center bear-justify-center",
|
|
41
|
+
"bear-text-gray-400 hover:bear-text-gray-600 dark:hover:bear-text-gray-300",
|
|
42
|
+
"bear-transition-colors bear-cursor-pointer"
|
|
43
|
+
),
|
|
44
|
+
"aria-label": d,
|
|
45
|
+
children: o ? l ?? v : p ?? I
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
] });
|
|
49
|
+
return /* @__PURE__ */ r(
|
|
50
|
+
N,
|
|
51
|
+
{
|
|
52
|
+
type: o ? "text" : "password",
|
|
53
|
+
rightAddon: g,
|
|
54
|
+
autoComplete: "current-password",
|
|
55
|
+
...m
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
A as PasswordInput
|
|
61
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { InputProps } from '../Input/Input.types';
|
|
3
|
+
export interface PasswordInputProps extends Omit<InputProps, 'type' | 'rightAddon'> {
|
|
4
|
+
/** Whether password is currently visible */
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
/** Controlled visibility toggle */
|
|
7
|
+
onVisibilityChange?: (visible: boolean) => void;
|
|
8
|
+
/** Hide the toggle button entirely */
|
|
9
|
+
hideToggle?: boolean;
|
|
10
|
+
/** Aria label for the toggle button */
|
|
11
|
+
toggleAriaLabel?: string;
|
|
12
|
+
/** Show Caps Lock / Shift indicator when active */
|
|
13
|
+
showShiftIndicator?: boolean;
|
|
14
|
+
/** Custom icon for "visible" state (replaces default VisibilityOffIcon) */
|
|
15
|
+
visibleIcon?: ReactNode;
|
|
16
|
+
/** Custom icon for "hidden" state (replaces default VisibilityIcon) */
|
|
17
|
+
hiddenIcon?: ReactNode;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),d=require("../../utils/cn.cjs"),S=require("../Typography/Typography.cjs"),n=require("./Popconfirm.const.cjs"),j=e.jsx("svg",{className:"bear-w-4 bear-h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),O=C=>{const{title:N,description:u,onConfirm:a,onCancel:o,confirmText:h=n.DEFAULT_CONFIRM_TEXT,cancelText:T=n.DEFAULT_CANCEL_TEXT,icon:p=j,placement:L="bottom",disabled:m=!1,children:_,variant:f="default",testId:b}=C,[s,E]=c.useState(!1),i=c.useRef(null),t=c.useCallback(()=>E(!1),[]);c.useEffect(()=>{const r=l=>{i.current&&!i.current.contains(l.target)&&t()};return s&&document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[s,t]),c.useEffect(()=>{const r=l=>{l.key==="Escape"&&t()};return s&&document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[s,t]);const v=()=>{m||E(!s)},A=()=>{a==null||a(),t()},x=()=>{o==null||o(),t()},y=f==="danger"?n.CONFIRM_BTN_DANGER_CLASSES:n.CONFIRM_BTN_DEFAULT_CLASSES;return e.jsxs("div",{ref:i,className:d.cn(n.ROOT_CLASS,"bear-relative bear-inline-block"),"data-testid":b,children:[e.jsx("div",{onClick:v,className:d.cn("bear-cursor-pointer",m&&"bear-opacity-50 bear-cursor-not-allowed bear-pointer-events-none"),children:_}),s&&e.jsxs("div",{className:d.cn(n.POPUP_CLASSES,n.PLACEMENT_OFFSETS[L]),children:[e.jsxs("div",{className:n.ICON_AREA_CLASSES,children:[e.jsx("div",{className:n.ICON_WRAPPER_CLASSES,children:p}),e.jsxs("div",{className:n.CONTENT_CLASSES,children:[e.jsx(S.Typography,{variant:"body2",className:"bear-text-gray-900 dark:bear-text-zinc-100",children:N}),u&&e.jsx(S.Typography,{variant:"caption",color:"secondary",className:"bear-mt-0.5",children:u})]})]}),e.jsxs("div",{className:n.BUTTONS_WRAPPER_CLASSES,children:[e.jsx("button",{type:"button",className:n.CANCEL_BTN_CLASSES,onClick:x,children:T}),e.jsx("button",{type:"button",className:y,onClick:A,children:h})]})]})]})};exports.Popconfirm=O;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-Popconfirm",r="bear-absolute bear-z-[9999] bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-p-4 bear-min-w-[220px] bear-max-w-[320px]",a={top:"bear-bottom-full bear-left-1/2 -bear-translate-x-1/2 bear-mb-2",bottom:"bear-top-full bear-left-1/2 -bear-translate-x-1/2 bear-mt-2",left:"bear-right-full bear-top-1/2 -bear-translate-y-1/2 bear-mr-2",right:"bear-left-full bear-top-1/2 -bear-translate-y-1/2 bear-ml-2"},b="bear-flex bear-items-center bear-gap-3 bear-mb-3",t="bear-flex-shrink-0 bear-w-8 bear-h-8 bear-flex bear-items-center bear-justify-center bear-rounded-full bear-bg-amber-100 dark:bear-bg-amber-900/30 bear-text-amber-600 dark:bear-text-amber-400",S="bear-flex-1 bear-min-w-0",o="bear-flex bear-justify-end bear-gap-2 bear-mt-4",n="bear-px-3 bear-py-1.5 bear-text-sm bear-font-medium bear-rounded-md bear-transition-colors bear-bg-pink-500 bear-text-white hover:bear-bg-pink-600 dark:hover:bear-bg-pink-600",E="bear-px-3 bear-py-1.5 bear-text-sm bear-font-medium bear-rounded-md bear-transition-colors bear-bg-red-500 bear-text-white hover:bear-bg-red-600 dark:hover:bear-bg-red-600",_="bear-px-3 bear-py-1.5 bear-text-sm bear-font-medium bear-rounded-md bear-transition-colors bear-bg-white dark:bear-bg-zinc-700 bear-text-gray-700 dark:bear-text-zinc-300 bear-border bear-border-gray-300 dark:bear-border-zinc-600 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-600",C="Confirm",A="Cancel";exports.BUTTONS_WRAPPER_CLASSES=o;exports.CANCEL_BTN_CLASSES=_;exports.CONFIRM_BTN_DANGER_CLASSES=E;exports.CONFIRM_BTN_DEFAULT_CLASSES=n;exports.CONTENT_CLASSES=S;exports.DEFAULT_CANCEL_TEXT=A;exports.DEFAULT_CONFIRM_TEXT=C;exports.ICON_AREA_CLASSES=b;exports.ICON_WRAPPER_CLASSES=t;exports.PLACEMENT_OFFSETS=a;exports.POPUP_CLASSES=r;exports.ROOT_CLASS=e;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PopconfirmPlacement } from './Popconfirm.types';
|
|
2
|
+
export declare const ROOT_CLASS = "Bear-Popconfirm";
|
|
3
|
+
export declare const POPUP_CLASSES = "bear-absolute bear-z-[9999] bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-p-4 bear-min-w-[220px] bear-max-w-[320px]";
|
|
4
|
+
export declare const PLACEMENT_OFFSETS: Record<PopconfirmPlacement, string>;
|
|
5
|
+
export declare const ICON_AREA_CLASSES = "bear-flex bear-items-center bear-gap-3 bear-mb-3";
|
|
6
|
+
export declare const ICON_WRAPPER_CLASSES = "bear-flex-shrink-0 bear-w-8 bear-h-8 bear-flex bear-items-center bear-justify-center bear-rounded-full bear-bg-amber-100 dark:bear-bg-amber-900/30 bear-text-amber-600 dark:bear-text-amber-400";
|
|
7
|
+
export declare const CONTENT_CLASSES = "bear-flex-1 bear-min-w-0";
|
|
8
|
+
export declare const BUTTONS_WRAPPER_CLASSES = "bear-flex bear-justify-end bear-gap-2 bear-mt-4";
|
|
9
|
+
export declare const CONFIRM_BTN_DEFAULT_CLASSES = "bear-px-3 bear-py-1.5 bear-text-sm bear-font-medium bear-rounded-md bear-transition-colors bear-bg-pink-500 bear-text-white hover:bear-bg-pink-600 dark:hover:bear-bg-pink-600";
|
|
10
|
+
export declare const CONFIRM_BTN_DANGER_CLASSES = "bear-px-3 bear-py-1.5 bear-text-sm bear-font-medium bear-rounded-md bear-transition-colors bear-bg-red-500 bear-text-white hover:bear-bg-red-600 dark:hover:bear-bg-red-600";
|
|
11
|
+
export declare const CANCEL_BTN_CLASSES = "bear-px-3 bear-py-1.5 bear-text-sm bear-font-medium bear-rounded-md bear-transition-colors bear-bg-white dark:bear-bg-zinc-700 bear-text-gray-700 dark:bear-text-zinc-300 bear-border bear-border-gray-300 dark:bear-border-zinc-600 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-600";
|
|
12
|
+
export declare const DEFAULT_CONFIRM_TEXT = "Confirm";
|
|
13
|
+
export declare const DEFAULT_CANCEL_TEXT = "Cancel";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const e = "Bear-Popconfirm", r = "bear-absolute bear-z-[9999] bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-p-4 bear-min-w-[220px] bear-max-w-[320px]", a = {
|
|
2
|
+
top: "bear-bottom-full bear-left-1/2 -bear-translate-x-1/2 bear-mb-2",
|
|
3
|
+
bottom: "bear-top-full bear-left-1/2 -bear-translate-x-1/2 bear-mt-2",
|
|
4
|
+
left: "bear-right-full bear-top-1/2 -bear-translate-y-1/2 bear-mr-2",
|
|
5
|
+
right: "bear-left-full bear-top-1/2 -bear-translate-y-1/2 bear-ml-2"
|
|
6
|
+
}, b = "bear-flex bear-items-center bear-gap-3 bear-mb-3", t = "bear-flex-shrink-0 bear-w-8 bear-h-8 bear-flex bear-items-center bear-justify-center bear-rounded-full bear-bg-amber-100 dark:bear-bg-amber-900/30 bear-text-amber-600 dark:bear-text-amber-400", o = "bear-flex-1 bear-min-w-0", n = "bear-flex bear-justify-end bear-gap-2 bear-mt-4", d = "bear-px-3 bear-py-1.5 bear-text-sm bear-font-medium bear-rounded-md bear-transition-colors bear-bg-pink-500 bear-text-white hover:bear-bg-pink-600 dark:hover:bear-bg-pink-600", i = "bear-px-3 bear-py-1.5 bear-text-sm bear-font-medium bear-rounded-md bear-transition-colors bear-bg-red-500 bear-text-white hover:bear-bg-red-600 dark:hover:bear-bg-red-600", s = "bear-px-3 bear-py-1.5 bear-text-sm bear-font-medium bear-rounded-md bear-transition-colors bear-bg-white dark:bear-bg-zinc-700 bear-text-gray-700 dark:bear-text-zinc-300 bear-border bear-border-gray-300 dark:bear-border-zinc-600 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-600", l = "Confirm", m = "Cancel";
|
|
7
|
+
export {
|
|
8
|
+
n as BUTTONS_WRAPPER_CLASSES,
|
|
9
|
+
s as CANCEL_BTN_CLASSES,
|
|
10
|
+
i as CONFIRM_BTN_DANGER_CLASSES,
|
|
11
|
+
d as CONFIRM_BTN_DEFAULT_CLASSES,
|
|
12
|
+
o as CONTENT_CLASSES,
|
|
13
|
+
m as DEFAULT_CANCEL_TEXT,
|
|
14
|
+
l as DEFAULT_CONFIRM_TEXT,
|
|
15
|
+
b as ICON_AREA_CLASSES,
|
|
16
|
+
t as ICON_WRAPPER_CLASSES,
|
|
17
|
+
a as PLACEMENT_OFFSETS,
|
|
18
|
+
r as POPUP_CLASSES,
|
|
19
|
+
e as ROOT_CLASS
|
|
20
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R, useRef as y, useCallback as F, useEffect as C } from "react";
|
|
3
|
+
import { cn as l } from "../../utils/cn.js";
|
|
4
|
+
import { Typography as S } from "../Typography/Typography.js";
|
|
5
|
+
import { DEFAULT_CONFIRM_TEXT as P, DEFAULT_CANCEL_TEXT as x, ICON_AREA_CLASSES as I, ICON_WRAPPER_CLASSES as g, CONTENT_CLASSES as w, BUTTONS_WRAPPER_CLASSES as B, CANCEL_BTN_CLASSES as U, CONFIRM_BTN_DANGER_CLASSES as D, CONFIRM_BTN_DEFAULT_CLASSES as M, PLACEMENT_OFFSETS as j, POPUP_CLASSES as W, ROOT_CLASS as z } from "./Popconfirm.const.js";
|
|
6
|
+
const X = /* @__PURE__ */ e("svg", { className: "bear-w-4 bear-h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }), Q = (N) => {
|
|
7
|
+
const {
|
|
8
|
+
title: u,
|
|
9
|
+
description: d,
|
|
10
|
+
onConfirm: o,
|
|
11
|
+
onCancel: s,
|
|
12
|
+
confirmText: h = P,
|
|
13
|
+
cancelText: L = x,
|
|
14
|
+
icon: f = X,
|
|
15
|
+
placement: p = "bottom",
|
|
16
|
+
disabled: m = !1,
|
|
17
|
+
children: _,
|
|
18
|
+
variant: T = "default",
|
|
19
|
+
testId: v
|
|
20
|
+
} = N, [n, E] = R(!1), c = y(null), t = F(() => E(!1), []);
|
|
21
|
+
C(() => {
|
|
22
|
+
const r = (i) => {
|
|
23
|
+
c.current && !c.current.contains(i.target) && t();
|
|
24
|
+
};
|
|
25
|
+
return n && document.addEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
|
|
26
|
+
}, [n, t]), C(() => {
|
|
27
|
+
const r = (i) => {
|
|
28
|
+
i.key === "Escape" && t();
|
|
29
|
+
};
|
|
30
|
+
return n && document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
31
|
+
}, [n, t]);
|
|
32
|
+
const A = () => {
|
|
33
|
+
m || E(!n);
|
|
34
|
+
}, b = () => {
|
|
35
|
+
o == null || o(), t();
|
|
36
|
+
}, k = () => {
|
|
37
|
+
s == null || s(), t();
|
|
38
|
+
}, O = T === "danger" ? D : M;
|
|
39
|
+
return /* @__PURE__ */ a("div", { ref: c, className: l(z, "bear-relative bear-inline-block"), "data-testid": v, children: [
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
onClick: A,
|
|
44
|
+
className: l("bear-cursor-pointer", m && "bear-opacity-50 bear-cursor-not-allowed bear-pointer-events-none"),
|
|
45
|
+
children: _
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
n && /* @__PURE__ */ a("div", { className: l(W, j[p]), children: [
|
|
49
|
+
/* @__PURE__ */ a("div", { className: I, children: [
|
|
50
|
+
/* @__PURE__ */ e("div", { className: g, children: f }),
|
|
51
|
+
/* @__PURE__ */ a("div", { className: w, children: [
|
|
52
|
+
/* @__PURE__ */ e(S, { variant: "body2", className: "bear-text-gray-900 dark:bear-text-zinc-100", children: u }),
|
|
53
|
+
d && /* @__PURE__ */ e(S, { variant: "caption", color: "secondary", className: "bear-mt-0.5", children: d })
|
|
54
|
+
] })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ a("div", { className: B, children: [
|
|
57
|
+
/* @__PURE__ */ e("button", { type: "button", className: U, onClick: k, children: L }),
|
|
58
|
+
/* @__PURE__ */ e("button", { type: "button", className: O, onClick: b, children: h })
|
|
59
|
+
] })
|
|
60
|
+
] })
|
|
61
|
+
] });
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
Q as Popconfirm
|
|
65
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type PopconfirmPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
+
export interface PopconfirmProps {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
onConfirm?: () => void;
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
confirmText?: string;
|
|
9
|
+
cancelText?: string;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
placement?: PopconfirmPlacement;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
variant?: 'default' | 'danger';
|
|
15
|
+
testId?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("react"),A=require("../../utils/cn.cjs"),j=require("../Typography/Typography.cjs"),s=require("./RadioCard.const.cjs"),x=c.createContext(null),h=({value:d,checked:t,onChange:i,label:f,description:n,icon:u,disabled:l=!1,variant:v="default",size:y="md",testId:R,className:k,onClick:r,...S})=>{const e=c.useContext(x),o=!!e,m=o?(e==null?void 0:e.value)===d:!!t,N=c.useCallback(b=>{l||((e==null?void 0:e.disabled)??!1)||(r==null||r(b),o&&e?e.onChange(d):i==null||i(d))},[l,e,o,d,i,r]),p=l||((e==null?void 0:e.disabled)??!1);return a.jsxs("div",{role:"radio","aria-checked":m,"aria-disabled":p,tabIndex:p?void 0:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),N(b))},className:A.cn(s.ROOT_CLASS,s.SIZE_PADDING_MAP[y],s.VARIANT_CLASSES[v],m&&s.CHECKED_CLASSES,p&&"bear-opacity-50 bear-cursor-not-allowed bear-pointer-events-none",!p&&"hover:bear-border-gray-300 dark:hover:bear-border-gray-600",k),onClick:N,"data-testid":R,...S,children:[a.jsx("div",{className:A.cn("bear-absolute bear-top-3 bear-right-3 bear-flex bear-items-center bear-justify-center bear-rounded-full bear-border-2",m?"bear-border-pink-500 dark:bear-border-pink-400":"bear-border-gray-300 dark:bear-border-gray-600",s.RADIO_INDICATOR_SIZE_MAP[y]),children:m&&a.jsx("div",{className:"bear-w-2 bear-h-2 bear-rounded-full bear-bg-pink-500 dark:bear-bg-pink-400"})}),u&&a.jsx("div",{className:"bear-mb-3 bear-flex bear-items-center bear-justify-center bear-text-gray-500 dark:bear-text-gray-400",children:u}),a.jsx(j.Typography,{variant:"body2",weight:"medium",className:"bear-block",children:f}),n&&a.jsx(j.Typography,{variant:"caption",color:"secondary",className:"bear-mt-1 bear-block",children:n})]})};h.displayName="RadioCard";const _=({value:d,onChange:t,children:i,columns:f=s.DEFAULT_COLUMNS,gap:n=s.DEFAULT_GAP,name:u,testId:l,className:v,...y})=>{const[R,k]=c.useState(""),r=d!==void 0,S=r?d:R,e=c.useCallback(o=>{r||k(o),t==null||t(o)},[r,t]);return a.jsx(x.Provider,{value:{value:S,onChange:e,name:u},children:a.jsx("div",{role:"radiogroup",className:A.cn("Bear-RadioCardGroup bear-grid",v),style:{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`,gap:`${n*.25}rem`},"data-testid":l,...y,children:i})})};_.displayName="RadioCardGroup";exports.RadioCard=h;exports.RadioCardGroup=_;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={sm:"bear-p-3",md:"bear-p-4",lg:"bear-p-5"},e={default:"bear-border bear-border-gray-200 dark:bear-border-gray-700",outline:"bear-border bear-border-dashed bear-border-gray-300 dark:bear-border-gray-600",filled:"bear-bg-gray-50 dark:bear-bg-gray-800/50"},a="bear-border-pink-500 dark:bear-border-pink-400 bear-ring-2 bear-ring-pink-500/30 dark:bear-ring-pink-400/30 bear-bg-pink-50 dark:bear-bg-pink-950/30",b="Bear-RadioCard bear-relative bear-rounded-lg bear-transition-all bear-duration-200 bear-cursor-pointer bear-text-left",d={sm:"bear-w-4 bear-h-4",md:"bear-w-5 bear-h-5",lg:"bear-w-6 bear-h-6"},o=1,A=4;exports.CHECKED_CLASSES=a;exports.DEFAULT_COLUMNS=o;exports.DEFAULT_GAP=A;exports.RADIO_INDICATOR_SIZE_MAP=d;exports.ROOT_CLASS=b;exports.SIZE_PADDING_MAP=r;exports.VARIANT_CLASSES=e;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const SIZE_PADDING_MAP: Record<'sm' | 'md' | 'lg', string>;
|
|
2
|
+
export declare const VARIANT_CLASSES: Record<'default' | 'outline' | 'filled', string>;
|
|
3
|
+
export declare const CHECKED_CLASSES = "bear-border-pink-500 dark:bear-border-pink-400 bear-ring-2 bear-ring-pink-500/30 dark:bear-ring-pink-400/30 bear-bg-pink-50 dark:bear-bg-pink-950/30";
|
|
4
|
+
export declare const ROOT_CLASS = "Bear-RadioCard bear-relative bear-rounded-lg bear-transition-all bear-duration-200 bear-cursor-pointer bear-text-left";
|
|
5
|
+
export declare const RADIO_INDICATOR_SIZE_MAP: Record<'sm' | 'md' | 'lg', string>;
|
|
6
|
+
export declare const DEFAULT_COLUMNS = 1;
|
|
7
|
+
export declare const DEFAULT_GAP = 4;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
sm: "bear-p-3",
|
|
3
|
+
md: "bear-p-4",
|
|
4
|
+
lg: "bear-p-5"
|
|
5
|
+
}, a = {
|
|
6
|
+
default: "bear-border bear-border-gray-200 dark:bear-border-gray-700",
|
|
7
|
+
outline: "bear-border bear-border-dashed bear-border-gray-300 dark:bear-border-gray-600",
|
|
8
|
+
filled: "bear-bg-gray-50 dark:bear-bg-gray-800/50"
|
|
9
|
+
}, e = "bear-border-pink-500 dark:bear-border-pink-400 bear-ring-2 bear-ring-pink-500/30 dark:bear-ring-pink-400/30 bear-bg-pink-50 dark:bear-bg-pink-950/30", b = "Bear-RadioCard bear-relative bear-rounded-lg bear-transition-all bear-duration-200 bear-cursor-pointer bear-text-left", d = {
|
|
10
|
+
sm: "bear-w-4 bear-h-4",
|
|
11
|
+
md: "bear-w-5 bear-h-5",
|
|
12
|
+
lg: "bear-w-6 bear-h-6"
|
|
13
|
+
}, o = 1, n = 4;
|
|
14
|
+
export {
|
|
15
|
+
e as CHECKED_CLASSES,
|
|
16
|
+
o as DEFAULT_COLUMNS,
|
|
17
|
+
n as DEFAULT_GAP,
|
|
18
|
+
d as RADIO_INDICATOR_SIZE_MAP,
|
|
19
|
+
b as ROOT_CLASS,
|
|
20
|
+
r as SIZE_PADDING_MAP,
|
|
21
|
+
a as VARIANT_CLASSES
|
|
22
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsxs as R, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as _, useContext as h, useCallback as D, useState as E } from "react";
|
|
3
|
+
import { cn as A } from "../../utils/cn.js";
|
|
4
|
+
import { Typography as S } from "../Typography/Typography.js";
|
|
5
|
+
import { RADIO_INDICATOR_SIZE_MAP as G, CHECKED_CLASSES as T, VARIANT_CLASSES as x, SIZE_PADDING_MAP as L, ROOT_CLASS as C, DEFAULT_COLUMNS as O, DEFAULT_GAP as P } from "./RadioCard.const.js";
|
|
6
|
+
const I = _(null), j = ({
|
|
7
|
+
value: a,
|
|
8
|
+
checked: t,
|
|
9
|
+
onChange: i,
|
|
10
|
+
label: p,
|
|
11
|
+
description: l,
|
|
12
|
+
icon: c,
|
|
13
|
+
disabled: b = !1,
|
|
14
|
+
variant: u = "default",
|
|
15
|
+
size: n = "md",
|
|
16
|
+
testId: y,
|
|
17
|
+
className: v,
|
|
18
|
+
onClick: e,
|
|
19
|
+
...k
|
|
20
|
+
}) => {
|
|
21
|
+
const r = h(I), s = !!r, m = s ? (r == null ? void 0 : r.value) === a : !!t, N = D(
|
|
22
|
+
(o) => {
|
|
23
|
+
b || ((r == null ? void 0 : r.disabled) ?? !1) || (e == null || e(o), s && r ? r.onChange(a) : i == null || i(a));
|
|
24
|
+
},
|
|
25
|
+
[b, r, s, a, i, e]
|
|
26
|
+
), f = b || ((r == null ? void 0 : r.disabled) ?? !1);
|
|
27
|
+
return /* @__PURE__ */ R(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
role: "radio",
|
|
31
|
+
"aria-checked": m,
|
|
32
|
+
"aria-disabled": f,
|
|
33
|
+
tabIndex: f ? void 0 : 0,
|
|
34
|
+
onKeyDown: (o) => {
|
|
35
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), N(o));
|
|
36
|
+
},
|
|
37
|
+
className: A(
|
|
38
|
+
C,
|
|
39
|
+
L[n],
|
|
40
|
+
x[u],
|
|
41
|
+
m && T,
|
|
42
|
+
f && "bear-opacity-50 bear-cursor-not-allowed bear-pointer-events-none",
|
|
43
|
+
!f && "hover:bear-border-gray-300 dark:hover:bear-border-gray-600",
|
|
44
|
+
v
|
|
45
|
+
),
|
|
46
|
+
onClick: N,
|
|
47
|
+
"data-testid": y,
|
|
48
|
+
...k,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ d(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: A(
|
|
54
|
+
"bear-absolute bear-top-3 bear-right-3 bear-flex bear-items-center bear-justify-center bear-rounded-full bear-border-2",
|
|
55
|
+
m ? "bear-border-pink-500 dark:bear-border-pink-400" : "bear-border-gray-300 dark:bear-border-gray-600",
|
|
56
|
+
G[n]
|
|
57
|
+
),
|
|
58
|
+
children: m && /* @__PURE__ */ d("div", { className: "bear-w-2 bear-h-2 bear-rounded-full bear-bg-pink-500 dark:bear-bg-pink-400" })
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
c && /* @__PURE__ */ d("div", { className: "bear-mb-3 bear-flex bear-items-center bear-justify-center bear-text-gray-500 dark:bear-text-gray-400", children: c }),
|
|
62
|
+
/* @__PURE__ */ d(S, { variant: "body2", weight: "medium", className: "bear-block", children: p }),
|
|
63
|
+
l && /* @__PURE__ */ d(S, { variant: "caption", color: "secondary", className: "bear-mt-1 bear-block", children: l })
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
j.displayName = "RadioCard";
|
|
69
|
+
const w = ({
|
|
70
|
+
value: a,
|
|
71
|
+
onChange: t,
|
|
72
|
+
children: i,
|
|
73
|
+
columns: p = O,
|
|
74
|
+
gap: l = P,
|
|
75
|
+
name: c,
|
|
76
|
+
testId: b,
|
|
77
|
+
className: u,
|
|
78
|
+
...n
|
|
79
|
+
}) => {
|
|
80
|
+
const [y, v] = E(""), e = a !== void 0, k = e ? a : y, r = D(
|
|
81
|
+
(s) => {
|
|
82
|
+
e || v(s), t == null || t(s);
|
|
83
|
+
},
|
|
84
|
+
[e, t]
|
|
85
|
+
);
|
|
86
|
+
return /* @__PURE__ */ d(
|
|
87
|
+
I.Provider,
|
|
88
|
+
{
|
|
89
|
+
value: { value: k, onChange: r, name: c },
|
|
90
|
+
children: /* @__PURE__ */ d(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
role: "radiogroup",
|
|
94
|
+
className: A("Bear-RadioCardGroup bear-grid", u),
|
|
95
|
+
style: {
|
|
96
|
+
gridTemplateColumns: `repeat(${p}, minmax(0, 1fr))`,
|
|
97
|
+
gap: `${l * 0.25}rem`
|
|
98
|
+
},
|
|
99
|
+
"data-testid": b,
|
|
100
|
+
...n,
|
|
101
|
+
children: i
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
w.displayName = "RadioCardGroup";
|
|
108
|
+
export {
|
|
109
|
+
j as RadioCard,
|
|
110
|
+
w as RadioCardGroup
|
|
111
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
export interface RadioCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
3
|
+
value: string;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
variant?: 'default' | 'outline' | 'filled';
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
testId?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface RadioCardGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
15
|
+
value?: string;
|
|
16
|
+
onChange?: (value: string) => void;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
columns?: number;
|
|
19
|
+
gap?: number;
|
|
20
|
+
name?: string;
|
|
21
|
+
testId?: string;
|
|
22
|
+
}
|
|
@@ -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("react/jsx-runtime"),i=require("react"),d=require("../../utils/cn.cjs"),j=require("./ResizableTextarea.const.cjs"),I=({label:f,helperText:v,error:u,minHeight:r=j.DEFAULT_MIN_HEIGHT,maxHeight:n=j.DEFAULT_MAX_HEIGHT,resizable:s=!0,showCharCount:p=!1,charCountMax:k,className:E,style:L,testId:N,...a})=>{const x=!!u,l=k??a.maxLength,y=typeof a.value=="string"?a.value.length:typeof a.defaultValue=="string"?a.defaultValue.length:0,z=l!=null&&y>l,B=i.useRef(null),[g,M]=i.useState(r),h=i.useRef(0),m=i.useRef(r),D=i.useCallback(t=>{var w,T;if(!s)return;t.preventDefault(),h.current=t.clientY,m.current=g,(T=(w=t.target).setPointerCapture)==null||T.call(w,t.pointerId);const R=b=>{const c=b.clientY-h.current;let o=m.current+c;r>0&&(o=Math.max(r,o)),n>0&&(o=Math.min(n,o)),M(o)},_=()=>{var b,c;(c=(b=t.target).releasePointerCapture)==null||c.call(b,t.pointerId),window.removeEventListener("pointermove",R),window.removeEventListener("pointerup",_)};window.addEventListener("pointermove",R),window.addEventListener("pointerup",_)},[s,g,r,n]);return e.jsxs("div",{className:d.cn("Bear-ResizableTextarea bear-flex bear-flex-col bear-gap-1.5",E),"data-testid":N,children:[f&&e.jsx("label",{className:"Bear-ResizableTextarea__label bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-300",children:f}),e.jsxs("div",{className:"bear-relative",children:[e.jsx("textarea",{ref:B,"aria-invalid":x||void 0,className:d.cn("bear-w-full bear-rounded-lg bear-border","bear-bg-white dark:bear-bg-gray-900 bear-text-gray-900 dark:bear-text-gray-100","bear-p-3 bear-resize-none focus:bear-outline-none focus:bear-ring-2",x?"bear-border-red-500 focus:bear-ring-red-500":"bear-border-gray-300 dark:bear-border-gray-600 focus:bear-ring-pink-500/50"),style:{...L,minHeight:s?r:void 0,height:s?g:void 0,maxHeight:n>0?n:void 0},...a}),s&&e.jsx("div",{role:"separator",onPointerDown:D,className:"Bear-ResizableTextarea__handle bear-absolute bear-right-0 bear-bottom-0 bear-w-4 bear-h-4 bear-cursor-s-resize bear-opacity-50 hover:bear-opacity-100",style:{background:"linear-gradient(135deg, transparent 50%, currentColor 50%)"}})]}),e.jsxs("div",{className:"Bear-ResizableTextarea__footer bear-flex bear-items-center bear-justify-between bear-gap-2",children:[v||u?e.jsx("p",{className:d.cn("Bear-ResizableTextarea__helper bear-text-sm bear-flex-1",x?"bear-text-red-500":"bear-text-gray-500 dark:bear-text-gray-400"),children:u||v}):p?e.jsx("span",{}):null,p&&l!=null&&e.jsxs("span",{className:d.cn("Bear-ResizableTextarea__char-count bear-text-xs bear-tabular-nums bear-shrink-0",z?"bear-text-red-500":"bear-text-gray-400 dark:bear-text-gray-500"),children:[y,"/",l]})]})]})};exports.ResizableTextarea=I;
|