@forgedevstack/bear 1.1.3 → 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/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/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/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/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 +99 -66
- package/dist/components/Input/Input.types.d.ts +10 -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/index.d.ts +1 -1
- 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/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/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/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 +44 -0
- package/dist/components/index.js +353 -306
- package/dist/index.cjs +1 -1
- package/dist/index.js +439 -392
- 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/package.json +10 -3
|
@@ -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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../../utils/cn.cjs");require("react");const S=require("../Typography/Typography.cjs"),s=require("./Result.const.cjs"),E=require("./Result.icons.cjs"),A=n=>{const{status:t,title:o,subtitle:c,icon:i,extra:a,className:l,testId:u,...T}=n,d=i??E.getStatusIcon(t,s.STATUS_TEXT_CLASSES),_=s.STATUS_ICON_COLORS[t],C=t==="404"||t==="403"||t==="500";return e.jsxs("div",{className:r.cn(s.ROOT_CLASS,s.CONTAINER_CLASSES,l),"data-testid":u,...T,children:[e.jsx("div",{className:r.cn(s.ICON_WRAPPER_CLASSES,!C&&s.ICON_SIZE_CLASSES,_),children:d}),e.jsx(S.Typography,{variant:"h4",className:r.cn(s.TITLE_CLASSES,"bear-text-gray-900 dark:bear-text-zinc-100"),children:o}),c&&e.jsx(S.Typography,{variant:"body1",color:"secondary",className:s.SUBTITLE_CLASSES,children:c}),a&&e.jsx("div",{className:s.EXTRA_CLASSES,children:a})]})};exports.Result=A;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-Result",r="bear-flex bear-flex-col bear-items-center bear-justify-center bear-text-center bear-py-16 bear-px-6",S="bear-mb-4 bear-flex bear-items-center bear-justify-center",t="bear-w-16 bear-h-16",a={success:"bear-text-green-500 dark:bear-text-green-400",error:"bear-text-red-500 dark:bear-text-red-400",info:"bear-text-blue-500 dark:bear-text-blue-400",warning:"bear-text-amber-500 dark:bear-text-amber-400",404:"bear-text-gray-500 dark:bear-text-zinc-400",403:"bear-text-orange-500 dark:bear-text-orange-400",500:"bear-text-red-600 dark:bear-text-red-500"},b="bear-mb-2",n="bear-mb-6 bear-max-w-md",E="bear-flex bear-flex-wrap bear-gap-2 bear-justify-center",T="bear-text-5xl bear-font-bold bear-leading-none";exports.CONTAINER_CLASSES=r;exports.EXTRA_CLASSES=E;exports.ICON_SIZE_CLASSES=t;exports.ICON_WRAPPER_CLASSES=S;exports.ROOT_CLASS=e;exports.STATUS_ICON_COLORS=a;exports.STATUS_TEXT_CLASSES=T;exports.SUBTITLE_CLASSES=n;exports.TITLE_CLASSES=b;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ResultStatus } from './Result.types';
|
|
2
|
+
export declare const ROOT_CLASS = "Bear-Result";
|
|
3
|
+
export declare const CONTAINER_CLASSES = "bear-flex bear-flex-col bear-items-center bear-justify-center bear-text-center bear-py-16 bear-px-6";
|
|
4
|
+
export declare const ICON_WRAPPER_CLASSES = "bear-mb-4 bear-flex bear-items-center bear-justify-center";
|
|
5
|
+
export declare const ICON_SIZE_CLASSES = "bear-w-16 bear-h-16";
|
|
6
|
+
export declare const STATUS_ICON_COLORS: Record<ResultStatus, string>;
|
|
7
|
+
export declare const TITLE_CLASSES = "bear-mb-2";
|
|
8
|
+
export declare const SUBTITLE_CLASSES = "bear-mb-6 bear-max-w-md";
|
|
9
|
+
export declare const EXTRA_CLASSES = "bear-flex bear-flex-wrap bear-gap-2 bear-justify-center";
|
|
10
|
+
export declare const STATUS_TEXT_CLASSES = "bear-text-5xl bear-font-bold bear-leading-none";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const e = "Bear-Result", r = "bear-flex bear-flex-col bear-items-center bear-justify-center bear-text-center bear-py-16 bear-px-6", a = "bear-mb-4 bear-flex bear-items-center bear-justify-center", t = "bear-w-16 bear-h-16", b = {
|
|
2
|
+
success: "bear-text-green-500 dark:bear-text-green-400",
|
|
3
|
+
error: "bear-text-red-500 dark:bear-text-red-400",
|
|
4
|
+
info: "bear-text-blue-500 dark:bear-text-blue-400",
|
|
5
|
+
warning: "bear-text-amber-500 dark:bear-text-amber-400",
|
|
6
|
+
404: "bear-text-gray-500 dark:bear-text-zinc-400",
|
|
7
|
+
403: "bear-text-orange-500 dark:bear-text-orange-400",
|
|
8
|
+
500: "bear-text-red-600 dark:bear-text-red-500"
|
|
9
|
+
}, S = "bear-mb-2", n = "bear-mb-6 bear-max-w-md", x = "bear-flex bear-flex-wrap bear-gap-2 bear-justify-center", c = "bear-text-5xl bear-font-bold bear-leading-none";
|
|
10
|
+
export {
|
|
11
|
+
r as CONTAINER_CLASSES,
|
|
12
|
+
x as EXTRA_CLASSES,
|
|
13
|
+
t as ICON_SIZE_CLASSES,
|
|
14
|
+
a as ICON_WRAPPER_CLASSES,
|
|
15
|
+
e as ROOT_CLASS,
|
|
16
|
+
b as STATUS_ICON_COLORS,
|
|
17
|
+
c as STATUS_TEXT_CLASSES,
|
|
18
|
+
n as SUBTITLE_CLASSES,
|
|
19
|
+
S as TITLE_CLASSES
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t="0 0 24 24",r=64,n={width:r,height:r,viewBox:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},i=()=>s.jsxs("svg",{...n,children:[s.jsx("path",{d:"M9 12l2 2 4-4"}),s.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),l=()=>s.jsxs("svg",{...n,children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:"M15 9l-6 6M9 9l6 6"})]}),x=()=>s.jsxs("svg",{...n,children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:"M12 16v-4M12 8h.01"})]}),a=()=>s.jsx("svg",{...n,children:s.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0zM12 9v4M12 17h.01"})}),h={success:i,error:l,info:x,warning:a},j=(c,e)=>{const o=h[c];return o?s.jsx(o,{}):s.jsx("span",{className:e,children:c.toUpperCase()})};exports.getStatusIcon=j;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as c, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
const i = "0 0 24 24", e = 64, n = {
|
|
3
|
+
width: e,
|
|
4
|
+
height: e,
|
|
5
|
+
viewBox: i,
|
|
6
|
+
fill: "none",
|
|
7
|
+
stroke: "currentColor",
|
|
8
|
+
strokeWidth: 1.5,
|
|
9
|
+
strokeLinecap: "round",
|
|
10
|
+
strokeLinejoin: "round"
|
|
11
|
+
}, h = () => /* @__PURE__ */ o("svg", { ...n, children: [
|
|
12
|
+
/* @__PURE__ */ c("path", { d: "M9 12l2 2 4-4" }),
|
|
13
|
+
/* @__PURE__ */ c("circle", { cx: "12", cy: "12", r: "10" })
|
|
14
|
+
] }), l = () => /* @__PURE__ */ o("svg", { ...n, children: [
|
|
15
|
+
/* @__PURE__ */ c("circle", { cx: "12", cy: "12", r: "10" }),
|
|
16
|
+
/* @__PURE__ */ c("path", { d: "M15 9l-6 6M9 9l6 6" })
|
|
17
|
+
] }), a = () => /* @__PURE__ */ o("svg", { ...n, children: [
|
|
18
|
+
/* @__PURE__ */ c("circle", { cx: "12", cy: "12", r: "10" }),
|
|
19
|
+
/* @__PURE__ */ c("path", { d: "M12 16v-4M12 8h.01" })
|
|
20
|
+
] }), d = () => /* @__PURE__ */ c("svg", { ...n, children: /* @__PURE__ */ c("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0zM12 9v4M12 17h.01" }) }), p = {
|
|
21
|
+
success: h,
|
|
22
|
+
error: l,
|
|
23
|
+
info: a,
|
|
24
|
+
warning: d
|
|
25
|
+
}, v = (r, t) => {
|
|
26
|
+
const s = p[r];
|
|
27
|
+
return s ? /* @__PURE__ */ c(s, {}) : /* @__PURE__ */ c("span", { className: t, children: r.toUpperCase() });
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
v as getStatusIcon
|
|
31
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs as E, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { cn as S } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Typography as e } from "../Typography/Typography.js";
|
|
5
|
+
import { STATUS_ICON_COLORS as A, ICON_SIZE_CLASSES as _, ICON_WRAPPER_CLASSES as L, TITLE_CLASSES as N, SUBTITLE_CLASSES as I, EXTRA_CLASSES as p, CONTAINER_CLASSES as O, ROOT_CLASS as h, STATUS_TEXT_CLASSES as u } from "./Result.const.js";
|
|
6
|
+
import { getStatusIcon as x } from "./Result.icons.js";
|
|
7
|
+
const U = (o) => {
|
|
8
|
+
const {
|
|
9
|
+
status: t,
|
|
10
|
+
title: c,
|
|
11
|
+
subtitle: r,
|
|
12
|
+
icon: i,
|
|
13
|
+
extra: a,
|
|
14
|
+
className: n,
|
|
15
|
+
testId: l,
|
|
16
|
+
...m
|
|
17
|
+
} = o, T = i ?? x(t, u), d = A[t], C = t === "404" || t === "403" || t === "500";
|
|
18
|
+
return /* @__PURE__ */ E(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
className: S(h, O, n),
|
|
22
|
+
"data-testid": l,
|
|
23
|
+
...m,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ s("div", { className: S(L, !C && _, d), children: T }),
|
|
26
|
+
/* @__PURE__ */ s(e, { variant: "h4", className: S(N, "bear-text-gray-900 dark:bear-text-zinc-100"), children: c }),
|
|
27
|
+
r && /* @__PURE__ */ s(e, { variant: "body1", color: "secondary", className: I, children: r }),
|
|
28
|
+
a && /* @__PURE__ */ s("div", { className: p, children: a })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
U as Result
|
|
35
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
export type ResultStatus = 'success' | 'error' | 'info' | 'warning' | '404' | '403' | '500';
|
|
3
|
+
export interface ResultProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
status: ResultStatus;
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
extra?: ReactNode;
|
|
9
|
+
testId?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("../../utils/cn.cjs");require("react");const T=require("../Typography/Typography.cjs"),c=require("./RingProgress.const.cjs"),R=({sections:d,size:t=c.DEFAULT_SIZE,thickness:n=c.DEFAULT_THICKNESS,roundCaps:j=!1,label:s,rootColor:o,className:m,testId:x,...p})=>{const l=d.reduce((r,i)=>r+i.value,0),a=(t-n)/2,u=2*Math.PI*a,g=t/2,h=t/2;let y=0;return e.jsxs("div",{className:b.cn(c.ROOT_CLASS,m),"data-testid":x,...p,children:[e.jsxs("svg",{width:t,height:t,className:"bear-rotate-[-90deg]",children:[e.jsx("circle",{cx:g,cy:h,r:a,fill:"none",strokeWidth:n,className:o?void 0:c.TRACK_COLOR,style:o?{stroke:o}:void 0}),l>0&&d.map((r,i)=>{const f=r.value/l*u,v=-y;return y+=f,e.jsxs("g",{children:[e.jsx("circle",{cx:g,cy:h,r:a,fill:"none",strokeWidth:n,stroke:r.color,strokeDasharray:`${f} ${u}`,strokeDashoffset:v,strokeLinecap:j?"round":"butt"}),r.tooltip&&e.jsx("title",{children:r.tooltip})]},i)})]}),s!==void 0&&e.jsx("div",{className:"bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center",children:typeof s=="string"?e.jsx(T.Typography,{variant:"body2",color:"secondary",children:s}):s})]})};exports.RingProgress=R;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=120,r=12,t="Bear-RingProgress bear-relative bear-inline-flex",S="bear-stroke-gray-200 dark:bear-stroke-zinc-700";exports.DEFAULT_SIZE=e;exports.DEFAULT_THICKNESS=r;exports.ROOT_CLASS=t;exports.TRACK_COLOR=S;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as T } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Typography as k } from "../Typography/Typography.js";
|
|
5
|
+
import { DEFAULT_SIZE as x, TRACK_COLOR as N, DEFAULT_THICKNESS as O, ROOT_CLASS as S } from "./RingProgress.const.js";
|
|
6
|
+
const j = ({
|
|
7
|
+
sections: d,
|
|
8
|
+
size: t = x,
|
|
9
|
+
thickness: a = O,
|
|
10
|
+
roundCaps: g = !1,
|
|
11
|
+
label: o,
|
|
12
|
+
rootColor: s,
|
|
13
|
+
className: v,
|
|
14
|
+
testId: y,
|
|
15
|
+
...b
|
|
16
|
+
}) => {
|
|
17
|
+
const l = d.reduce((r, i) => r + i.value, 0), c = (t - a) / 2, m = 2 * Math.PI * c, f = t / 2, h = t / 2;
|
|
18
|
+
let p = 0;
|
|
19
|
+
return /* @__PURE__ */ n(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: T(S, v),
|
|
23
|
+
"data-testid": y,
|
|
24
|
+
...b,
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ n("svg", { width: t, height: t, className: "bear-rotate-[-90deg]", children: [
|
|
27
|
+
/* @__PURE__ */ e(
|
|
28
|
+
"circle",
|
|
29
|
+
{
|
|
30
|
+
cx: f,
|
|
31
|
+
cy: h,
|
|
32
|
+
r: c,
|
|
33
|
+
fill: "none",
|
|
34
|
+
strokeWidth: a,
|
|
35
|
+
className: s ? void 0 : N,
|
|
36
|
+
style: s ? { stroke: s } : void 0
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
l > 0 && d.map((r, i) => {
|
|
40
|
+
const u = r.value / l * m, L = -p;
|
|
41
|
+
return p += u, /* @__PURE__ */ n("g", { children: [
|
|
42
|
+
/* @__PURE__ */ e(
|
|
43
|
+
"circle",
|
|
44
|
+
{
|
|
45
|
+
cx: f,
|
|
46
|
+
cy: h,
|
|
47
|
+
r: c,
|
|
48
|
+
fill: "none",
|
|
49
|
+
strokeWidth: a,
|
|
50
|
+
stroke: r.color,
|
|
51
|
+
strokeDasharray: `${u} ${m}`,
|
|
52
|
+
strokeDashoffset: L,
|
|
53
|
+
strokeLinecap: g ? "round" : "butt"
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
r.tooltip && /* @__PURE__ */ e("title", { children: r.tooltip })
|
|
57
|
+
] }, i);
|
|
58
|
+
})
|
|
59
|
+
] }),
|
|
60
|
+
o !== void 0 && /* @__PURE__ */ e("div", { className: "bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center", children: typeof o == "string" ? /* @__PURE__ */ e(k, { variant: "body2", color: "secondary", children: o }) : o })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
j as RingProgress
|
|
67
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
export interface RingProgressSection {
|
|
3
|
+
value: number;
|
|
4
|
+
color: string;
|
|
5
|
+
tooltip?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RingProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
sections: RingProgressSection[];
|
|
9
|
+
size?: number;
|
|
10
|
+
thickness?: number;
|
|
11
|
+
roundCaps?: boolean;
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
rootColor?: string;
|
|
14
|
+
testId?: string;
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),r=require("react"),S=require("../../utils/cn.cjs"),y=require("../Button/Button.cjs"),s=require("./SignPad.const.cjs"),V=B=>{const{onChange:a,width:p,height:b=s.SIGN_PAD_DEFAULT_HEIGHT,strokeColor:O,strokeWidth:T=s.SIGN_PAD_DEFAULT_STROKE_WIDTH,backgroundColor:M,placeholder:U=s.SIGN_PAD_DEFAULT_PLACEHOLDER,disabled:o=!1,readOnly:c=!1,showClear:N=!0,showSave:m=!1,clearText:j="Clear",saveText:F="Save",outputFormat:P=s.SIGN_PAD_DEFAULT_OUTPUT_FORMAT,outputQuality:v=s.SIGN_PAD_DEFAULT_OUTPUT_QUALITY,className:H,testId:K,id:q,...W}=B,i=r.useRef(null),w=r.useRef(null),A=r.useRef(null),g=r.useRef(!1),[h,L]=r.useState(!1),[E,z]=r.useState(!1);r.useEffect(()=>{const e=()=>{z(document.documentElement.classList.contains("dark"))};e();const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]);const k=O||(E?s.SIGN_PAD_STROKE_DARK:s.SIGN_PAD_STROKE_LIGHT),C=M||(E?s.SIGN_PAD_BG_DARK:s.SIGN_PAD_BG_LIGHT),_=r.useCallback(()=>{const e=i.current,t=e==null?void 0:e.getContext("2d");!e||!t||(t.fillStyle=C==="transparent"?"rgba(0,0,0,0)":C,t.fillRect(0,0,e.width,e.height))},[C]);r.useEffect(()=>{const e=i.current,t=w.current;if(!e||!t)return;const n=()=>{const d=t.getBoundingClientRect(),f=p??Math.round(d.width),G=b;(e.width!==f||e.height!==G)&&(e.width=f,e.height=G,_())};n();const l=new ResizeObserver(n);return l.observe(t),()=>l.disconnect()},[p,b,_]),r.useEffect(()=>{_()},[_,E]),r.useEffect(()=>{const e=i.current;if(!e||o||c)return;const t=n=>n.preventDefault();return e.addEventListener("touchstart",t,{passive:!1}),e.addEventListener("touchmove",t,{passive:!1}),()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchmove",t)}},[o,c]);const D=r.useCallback(e=>{const t=i.current;if(!t)return{x:0,y:0};const n=t.getBoundingClientRect(),l=t.width/n.width,d=t.height/n.height;if("touches"in e){const f=e.touches[0];return{x:(f.clientX-n.left)*l,y:(f.clientY-n.top)*d}}return{x:(e.clientX-n.left)*l,y:(e.clientY-n.top)*d}},[]),I=r.useCallback(e=>{if(o||c)return;const t=D(e);g.current=!0,A.current=t},[o,c,D]),x=r.useCallback(e=>{if(!g.current||o||c)return;const t=i.current,n=t==null?void 0:t.getContext("2d"),l=A.current;if(!t||!n||!l)return;const d=D(e);n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(d.x,d.y),n.strokeStyle=k,n.lineWidth=T,n.lineCap="round",n.lineJoin="round",n.stroke(),A.current=d,L(!0)},[o,c,k,T,D]),R=r.useCallback(()=>{if(g.current){const e=i.current;if(e&&a){const t=e.toDataURL(P,v);a(t)}}g.current=!1,A.current=null},[a,P,v]),X=r.useCallback(()=>{const e=i.current,t=e==null?void 0:e.getContext("2d");!e||!t||(t.clearRect(0,0,e.width,e.height),_(),L(!1),a==null||a(null))},[_,a]),Y=r.useCallback(()=>{const e=i.current;if(!e||!h)return;const t=e.toDataURL(P,v);a==null||a(t)},[h,a,P,v]);return u.jsxs("div",{id:q,"data-testid":K,className:S.cn("Bear-SignPad bear-w-full",s.SIGN_PAD_ROOT_CLASSES,o&&"Bear-SignPad--disabled bear-opacity-50",c&&"Bear-SignPad--readonly",H),...W,children:[u.jsxs("div",{ref:w,className:S.cn("Bear-SignPad__canvas-wrapper bear-w-full bear-overflow-hidden","touch-none",s.SIGN_PAD_CANVAS_WRAPPER_CLASSES,!o&&!c&&s.SIGN_PAD_CANVAS_WRAPPER_HOVER,o&&"bear-cursor-not-allowed",!o&&!c&&"bear-cursor-crosshair"),children:[u.jsx("canvas",{ref:i,className:"Bear-SignPad__canvas bear-block bear-rounded-lg bear-w-full touch-none",style:{height:b,touchAction:"none"},onMouseDown:I,onMouseMove:x,onMouseUp:R,onMouseLeave:R,onTouchStart:I,onTouchMove:x,onTouchEnd:R}),!h&&u.jsx("div",{className:S.cn("Bear-SignPad__placeholder",s.SIGN_PAD_PLACEHOLDER_CLASSES),children:U}),u.jsx("div",{className:S.cn("Bear-SignPad__line",s.SIGN_PAD_LINE_CLASSES)}),u.jsx("span",{className:S.cn("Bear-SignPad__x-mark",s.SIGN_PAD_X_MARK_CLASSES),children:"×"})]}),(N||m)&&u.jsxs("div",{className:S.cn("Bear-SignPad__actions",s.SIGN_PAD_ACTIONS_CLASSES),children:[N&&u.jsx(y.Button,{size:"sm",variant:"ghost",onClick:X,disabled:o||!h,children:j}),m&&u.jsx(y.Button,{size:"sm",variant:"primary",onClick:Y,disabled:o||!h,children:F})]})]})};exports.SignPad=V;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=200,e=2,S="Sign here",A="image/png",r=.92,a="#1f2937",b="#f3f4f6",t="#ffffff",D="#18181b",P="bear-inline-flex bear-flex-col bear-gap-2",E="bear-relative bear-rounded-lg bear-border-2 bear-border-dashed bear-border-gray-300 dark:bear-border-zinc-600",I="hover:bear-border-pink-400 dark:hover:bear-border-pink-500",o="bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center bear-text-gray-400 dark:bear-text-zinc-500 bear-text-sm bear-pointer-events-none",G="bear-absolute bear-bottom-8 bear-left-4 bear-right-4 bear-border-b bear-border-gray-300 dark:bear-border-zinc-600",T="bear-absolute bear-bottom-6 bear-left-4 bear-text-gray-400 dark:bear-text-zinc-500 bear-text-lg bear-font-bold",N="bear-flex bear-gap-2 bear-justify-end";exports.SIGN_PAD_ACTIONS_CLASSES=N;exports.SIGN_PAD_BG_DARK=D;exports.SIGN_PAD_BG_LIGHT=t;exports.SIGN_PAD_CANVAS_WRAPPER_CLASSES=E;exports.SIGN_PAD_CANVAS_WRAPPER_HOVER=I;exports.SIGN_PAD_DEFAULT_HEIGHT=_;exports.SIGN_PAD_DEFAULT_OUTPUT_FORMAT=A;exports.SIGN_PAD_DEFAULT_OUTPUT_QUALITY=r;exports.SIGN_PAD_DEFAULT_PLACEHOLDER=S;exports.SIGN_PAD_DEFAULT_STROKE_WIDTH=e;exports.SIGN_PAD_LINE_CLASSES=G;exports.SIGN_PAD_PLACEHOLDER_CLASSES=o;exports.SIGN_PAD_ROOT_CLASSES=P;exports.SIGN_PAD_STROKE_DARK=b;exports.SIGN_PAD_STROKE_LIGHT=a;exports.SIGN_PAD_X_MARK_CLASSES=T;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
const e =
|
|
1
|
+
const e = 200, r = 2, a = "Sign here", b = "image/png", _ = 0.92, t = "#1f2937", o = "#f3f4f6", A = "#ffffff", S = "#18181b", n = "bear-inline-flex bear-flex-col bear-gap-2", s = "bear-relative bear-rounded-lg bear-border-2 bear-border-dashed bear-border-gray-300 dark:bear-border-zinc-600", D = "hover:bear-border-pink-400 dark:hover:bear-border-pink-500", P = "bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center bear-text-gray-400 dark:bear-text-zinc-500 bear-text-sm bear-pointer-events-none", c = "bear-absolute bear-bottom-8 bear-left-4 bear-right-4 bear-border-b bear-border-gray-300 dark:bear-border-zinc-600", E = "bear-absolute bear-bottom-6 bear-left-4 bear-text-gray-400 dark:bear-text-zinc-500 bear-text-lg bear-font-bold", I = "bear-flex bear-gap-2 bear-justify-end";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
I as SIGN_PAD_ACTIONS_CLASSES,
|
|
4
|
+
S as SIGN_PAD_BG_DARK,
|
|
5
|
+
A as SIGN_PAD_BG_LIGHT,
|
|
6
6
|
s as SIGN_PAD_CANVAS_WRAPPER_CLASSES,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
D as SIGN_PAD_CANVAS_WRAPPER_HOVER,
|
|
8
|
+
e as SIGN_PAD_DEFAULT_HEIGHT,
|
|
9
9
|
b as SIGN_PAD_DEFAULT_OUTPUT_FORMAT,
|
|
10
|
-
|
|
10
|
+
_ as SIGN_PAD_DEFAULT_OUTPUT_QUALITY,
|
|
11
11
|
a as SIGN_PAD_DEFAULT_PLACEHOLDER,
|
|
12
|
-
|
|
13
|
-
e as SIGN_PAD_DEFAULT_WIDTH,
|
|
12
|
+
r as SIGN_PAD_DEFAULT_STROKE_WIDTH,
|
|
14
13
|
c as SIGN_PAD_LINE_CLASSES,
|
|
15
14
|
P as SIGN_PAD_PLACEHOLDER_CLASSES,
|
|
16
|
-
|
|
15
|
+
n as SIGN_PAD_ROOT_CLASSES,
|
|
17
16
|
o as SIGN_PAD_STROKE_DARK,
|
|
18
|
-
|
|
17
|
+
t as SIGN_PAD_STROKE_LIGHT,
|
|
19
18
|
E as SIGN_PAD_X_MARK_CLASSES
|
|
20
19
|
};
|
|
@@ -3,14 +3,12 @@ import { SignPadProps } from './SignPad.types';
|
|
|
3
3
|
/**
|
|
4
4
|
* SignPad - Digital signature capture component
|
|
5
5
|
*
|
|
6
|
+
* Canvas fills 100% of its container width. Height is configurable.
|
|
7
|
+
* Uses ResizeObserver so drawing works correctly at any size.
|
|
8
|
+
*
|
|
6
9
|
* @example
|
|
7
10
|
* ```tsx
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* <SignPad
|
|
11
|
-
* onChange={setSignature}
|
|
12
|
-
* placeholder="Sign here"
|
|
13
|
-
* />
|
|
11
|
+
* <SignPad onChange={setSignature} placeholder="Sign here" />
|
|
14
12
|
* ```
|
|
15
13
|
*/
|
|
16
14
|
export declare const SignPad: FC<SignPadProps>;
|