@forgedevstack/bear 1.0.6 → 1.0.8
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/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.const.cjs +1 -1
- package/dist/components/Alert/Alert.const.d.ts +4 -0
- package/dist/components/Alert/Alert.const.js +9 -15
- package/dist/components/Alert/Alert.js +43 -38
- package/dist/components/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.js +20 -16
- package/dist/components/BackTop/BackTop.cjs +1 -0
- package/dist/components/BackTop/BackTop.const.cjs +1 -0
- package/dist/components/BackTop/BackTop.const.d.ts +34 -0
- package/dist/components/BackTop/BackTop.const.js +29 -0
- package/dist/components/BackTop/BackTop.d.ts +21 -0
- package/dist/components/BackTop/BackTop.js +87 -0
- package/dist/components/BackTop/BackTop.types.d.ts +28 -0
- package/dist/components/BackTop/index.d.ts +3 -0
- package/dist/components/Badge/Badge.constants.d.ts +4 -4
- package/dist/components/Badge/Badge.types.d.ts +3 -3
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts +3 -0
- package/dist/components/BottomSheet/BottomSheet.js +103 -0
- package/dist/components/BottomSheet/BottomSheet.types.d.ts +13 -0
- package/dist/components/BottomSheet/index.d.ts +2 -0
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.constants.cjs +38 -48
- package/dist/components/Button/Button.constants.d.ts +22 -3
- package/dist/components/Button/Button.constants.js +51 -50
- package/dist/components/Button/Button.d.ts +14 -7
- package/dist/components/Button/Button.js +123 -43
- package/dist/components/Button/Button.types.d.ts +26 -4
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +3 -2
- package/dist/components/Card/Card.const.d.ts +2 -2
- package/dist/components/Card/Card.types.d.ts +2 -2
- package/dist/components/Chat/Chat.cjs +1 -0
- package/dist/components/Chat/Chat.const.cjs +1 -0
- package/dist/components/Chat/Chat.const.d.ts +26 -0
- package/dist/components/Chat/Chat.const.js +29 -0
- package/dist/components/Chat/Chat.d.ts +21 -0
- package/dist/components/Chat/Chat.js +179 -0
- package/dist/components/Chat/Chat.types.d.ts +55 -0
- package/dist/components/Chat/index.d.ts +2 -0
- package/dist/components/Confetti/Confetti.cjs +1 -0
- package/dist/components/Confetti/Confetti.const.cjs +1 -0
- package/dist/components/Confetti/Confetti.const.d.ts +16 -0
- package/dist/components/Confetti/Confetti.const.js +36 -0
- package/dist/components/Confetti/Confetti.d.ts +23 -0
- package/dist/components/Confetti/Confetti.js +94 -0
- package/dist/components/Confetti/Confetti.types.d.ts +50 -0
- package/dist/components/Confetti/index.d.ts +4 -0
- package/dist/components/Confetti/useConfetti.cjs +1 -0
- package/dist/components/Confetti/useConfetti.d.ts +13 -0
- package/dist/components/Confetti/useConfetti.js +12 -0
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.js +3 -2
- package/dist/components/DiffViewer/DiffViewer.cjs +1 -0
- package/dist/components/DiffViewer/DiffViewer.const.cjs +1 -0
- package/dist/components/DiffViewer/DiffViewer.const.d.ts +18 -0
- package/dist/components/DiffViewer/DiffViewer.const.js +21 -0
- package/dist/components/DiffViewer/DiffViewer.d.ts +18 -0
- package/dist/components/DiffViewer/DiffViewer.js +127 -0
- package/dist/components/DiffViewer/DiffViewer.types.d.ts +40 -0
- package/dist/components/DiffViewer/DiffViewer.utils.cjs +3 -0
- package/dist/components/DiffViewer/DiffViewer.utils.d.ts +9 -0
- package/dist/components/DiffViewer/DiffViewer.utils.js +39 -0
- package/dist/components/DiffViewer/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +35 -35
- package/dist/components/EmojiPicker/EmojiPicker.cjs +1 -0
- package/dist/components/EmojiPicker/EmojiPicker.const.cjs +1 -0
- package/dist/components/EmojiPicker/EmojiPicker.const.d.ts +5 -0
- package/dist/components/EmojiPicker/EmojiPicker.const.js +10 -0
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +3 -0
- package/dist/components/EmojiPicker/EmojiPicker.js +63 -0
- package/dist/components/EmojiPicker/EmojiPicker.types.d.ts +6 -0
- package/dist/components/EmojiPicker/index.d.ts +3 -0
- package/dist/components/FloatingChat/FloatingChat.cjs +1 -0
- package/dist/components/FloatingChat/FloatingChat.const.cjs +1 -0
- package/dist/components/FloatingChat/FloatingChat.const.d.ts +12 -0
- package/dist/components/FloatingChat/FloatingChat.const.js +15 -0
- package/dist/components/FloatingChat/FloatingChat.d.ts +19 -0
- package/dist/components/FloatingChat/FloatingChat.js +144 -0
- package/dist/components/FloatingChat/FloatingChat.types.d.ts +44 -0
- package/dist/components/FloatingChat/index.d.ts +2 -0
- package/dist/components/JsonViewer/JsonViewer.cjs +1 -0
- package/dist/components/JsonViewer/JsonViewer.const.cjs +1 -0
- package/dist/components/JsonViewer/JsonViewer.const.d.ts +4 -0
- package/dist/components/JsonViewer/JsonViewer.const.js +24 -0
- package/dist/components/JsonViewer/JsonViewer.d.ts +17 -0
- package/dist/components/JsonViewer/JsonViewer.js +195 -0
- package/dist/components/JsonViewer/JsonViewer.types.d.ts +54 -0
- package/dist/components/JsonViewer/index.d.ts +2 -0
- package/dist/components/Kanban/Kanban.cjs +1 -0
- package/dist/components/Kanban/Kanban.d.ts +3 -0
- package/dist/components/Kanban/Kanban.js +91 -0
- package/dist/components/Kanban/Kanban.types.d.ts +21 -0
- package/dist/components/Kanban/index.d.ts +2 -0
- package/dist/components/MentionsInput/MentionsInput.cjs +1 -0
- package/dist/components/MentionsInput/MentionsInput.d.ts +3 -0
- package/dist/components/MentionsInput/MentionsInput.js +140 -0
- package/dist/components/MentionsInput/MentionsInput.types.d.ts +21 -0
- package/dist/components/MentionsInput/index.d.ts +2 -0
- package/dist/components/QRCode/QRCode.cjs +1 -0
- package/dist/components/QRCode/QRCode.const.cjs +1 -0
- package/dist/components/QRCode/QRCode.const.d.ts +21 -0
- package/dist/components/QRCode/QRCode.const.js +11 -0
- package/dist/components/QRCode/QRCode.d.ts +29 -0
- package/dist/components/QRCode/QRCode.js +68 -0
- package/dist/components/QRCode/QRCode.types.d.ts +32 -0
- package/dist/components/QRCode/QRCode.utils.cjs +1 -0
- package/dist/components/QRCode/QRCode.utils.d.ts +12 -0
- package/dist/components/QRCode/QRCode.utils.js +74 -0
- package/dist/components/QRCode/index.d.ts +3 -0
- package/dist/components/RichEditor/RichEditor.cjs +1 -1
- package/dist/components/RichEditor/RichEditor.const.cjs +2 -2
- package/dist/components/RichEditor/RichEditor.const.d.ts +4 -1
- package/dist/components/RichEditor/RichEditor.const.js +51 -18
- package/dist/components/RichEditor/RichEditor.js +106 -105
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +105 -95
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.d.ts +2 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +47 -29
- package/dist/components/SegmentedControl/SegmentedControl.cjs +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +58 -0
- package/dist/components/SegmentedControl/SegmentedControl.types.d.ts +16 -0
- package/dist/components/SegmentedControl/index.d.ts +2 -0
- package/dist/components/SignPad/SignPad.cjs +1 -1
- package/dist/components/SignPad/SignPad.js +98 -90
- package/dist/components/SliderRange/SliderRange.cjs +1 -0
- package/dist/components/SliderRange/SliderRange.d.ts +3 -0
- package/dist/components/SliderRange/SliderRange.js +142 -0
- package/dist/components/SliderRange/SliderRange.types.d.ts +17 -0
- package/dist/components/SliderRange/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.types.d.ts +2 -2
- package/dist/components/TagsInput/TagsInput.cjs +1 -0
- package/dist/components/TagsInput/TagsInput.d.ts +3 -0
- package/dist/components/TagsInput/TagsInput.js +100 -0
- package/dist/components/TagsInput/TagsInput.types.d.ts +16 -0
- package/dist/components/TagsInput/index.d.ts +2 -0
- package/dist/components/Terminal/Terminal.cjs +1 -0
- package/dist/components/Terminal/Terminal.const.cjs +1 -0
- package/dist/components/Terminal/Terminal.const.d.ts +32 -0
- package/dist/components/Terminal/Terminal.const.js +42 -0
- package/dist/components/Terminal/Terminal.d.ts +27 -0
- package/dist/components/Terminal/Terminal.js +155 -0
- package/dist/components/Terminal/Terminal.types.d.ts +49 -0
- package/dist/components/Terminal/index.d.ts +2 -0
- package/dist/components/Tour/Tour.cjs +1 -0
- package/dist/components/Tour/Tour.const.cjs +1 -0
- package/dist/components/Tour/Tour.const.d.ts +25 -0
- package/dist/components/Tour/Tour.const.js +38 -0
- package/dist/components/Tour/Tour.d.ts +17 -0
- package/dist/components/Tour/Tour.js +179 -0
- package/dist/components/Tour/Tour.types.d.ts +80 -0
- package/dist/components/Tour/index.d.ts +4 -0
- package/dist/components/Tour/useTour.cjs +1 -0
- package/dist/components/Tour/useTour.d.ts +14 -0
- package/dist/components/Tour/useTour.js +27 -0
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.d.ts +5 -1
- package/dist/components/Typography/Typography.js +93 -57
- package/dist/components/Typography/Typography.types.d.ts +29 -2
- package/dist/components/VirtualList/VirtualList.cjs +1 -0
- package/dist/components/VirtualList/VirtualList.d.ts +3 -0
- package/dist/components/VirtualList/VirtualList.js +68 -0
- package/dist/components/VirtualList/VirtualList.types.d.ts +10 -0
- package/dist/components/VirtualList/index.d.ts +2 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +35 -1
- package/dist/components/index.js +240 -198
- package/dist/context/BearProvider.cjs +1 -1
- package/dist/context/BearProvider.d.ts +110 -5
- package/dist/context/BearProvider.js +198 -53
- package/dist/context/defaultTheme.cjs +1 -1
- package/dist/context/defaultTheme.js +11 -11
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +18 -0
- package/dist/hooks/index.js +56 -35
- package/dist/hooks/useBearComponent/index.d.ts +2 -0
- package/dist/hooks/useBearComponent/useBearComponent.cjs +1 -0
- package/dist/hooks/useBearComponent/useBearComponent.d.ts +71 -0
- package/dist/hooks/useBearComponent/useBearComponent.js +54 -0
- package/dist/hooks/useBearComponent/useBearComponent.types.d.ts +40 -0
- package/dist/hooks/useDragDrop/index.d.ts +2 -0
- package/dist/hooks/useDragDrop/useDragDrop.cjs +1 -0
- package/dist/hooks/useDragDrop/useDragDrop.d.ts +22 -0
- package/dist/hooks/useDragDrop/useDragDrop.js +56 -0
- package/dist/hooks/useDragDrop/useDragDrop.types.d.ts +55 -0
- package/dist/hooks/useIdle/index.d.ts +2 -0
- package/dist/hooks/useIdle/useIdle.cjs +1 -0
- package/dist/hooks/useIdle/useIdle.d.ts +22 -0
- package/dist/hooks/useIdle/useIdle.js +66 -0
- package/dist/hooks/useIdle/useIdle.types.d.ts +29 -0
- package/dist/hooks/useLazyLoad/index.d.ts +2 -0
- package/dist/hooks/useLazyLoad/useLazyLoad.cjs +1 -0
- package/dist/hooks/useLazyLoad/useLazyLoad.d.ts +26 -0
- package/dist/hooks/useLazyLoad/useLazyLoad.js +27 -0
- package/dist/hooks/useLazyLoad/useLazyLoad.types.d.ts +25 -0
- package/dist/hooks/useLongPress/index.d.ts +2 -0
- package/dist/hooks/useLongPress/useLongPress.cjs +1 -0
- package/dist/hooks/useLongPress/useLongPress.d.ts +17 -0
- package/dist/hooks/useLongPress/useLongPress.js +44 -0
- package/dist/hooks/useLongPress/useLongPress.types.d.ts +26 -0
- package/dist/hooks/useOnline/index.d.ts +2 -0
- package/dist/hooks/useOnline/useOnline.cjs +1 -0
- package/dist/hooks/useOnline/useOnline.d.ts +16 -0
- package/dist/hooks/useOnline/useOnline.js +25 -0
- package/dist/hooks/useOnline/useOnline.types.d.ts +15 -0
- package/dist/hooks/usePageVisibility/index.d.ts +2 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.cjs +1 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.d.ts +19 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.js +26 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.types.d.ts +15 -0
- package/dist/hooks/useSpotlight/index.d.ts +2 -0
- package/dist/hooks/useSpotlight/useSpotlight.cjs +1 -0
- package/dist/hooks/useSpotlight/useSpotlight.d.ts +24 -0
- package/dist/hooks/useSpotlight/useSpotlight.js +49 -0
- package/dist/hooks/useSpotlight/useSpotlight.types.d.ts +23 -0
- package/dist/hooks/useWebSocket/index.d.ts +2 -0
- package/dist/hooks/useWebSocket/useWebSocket.cjs +1 -0
- package/dist/hooks/useWebSocket/useWebSocket.d.ts +22 -0
- package/dist/hooks/useWebSocket/useWebSocket.js +75 -0
- package/dist/hooks/useWebSocket/useWebSocket.types.d.ts +44 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +327 -264
- package/dist/styles.css +1 -1
- package/dist/types/component.types.d.ts +125 -42
- package/dist/types/theme.types.d.ts +82 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),x=require("../../utils/cn.cjs"),r=require("./Alert.const.cjs"),w={success:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),info:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),warning:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),error:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})},k=()=>e.jsxs("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),C=h=>{const{severity:t=r.ALERT_DEFAULTS.SEVERITY,variant:a=r.ALERT_DEFAULTS.VARIANT,title:l,icon:n=r.ALERT_DEFAULTS.SHOW_ICON,action:c,closable:u=r.ALERT_DEFAULTS.CLOSABLE,onClose:i,children:d,className:v,testId:g,id:j,...f}=h,[y,A]=m.useState(!0);if(!y)return null;const o=a==="filled",s={success:{bg:"var(--bear-success-50)",border:"var(--bear-success-500)",text:"var(--bear-success-800)",icon:"var(--bear-success-600)"},info:{bg:"var(--bear-info-50)",border:"var(--bear-info-500)",text:"var(--bear-info-800)",icon:"var(--bear-info-600)"},warning:{bg:"var(--bear-warning-50)",border:"var(--bear-warning-500)",text:"var(--bear-warning-800)",icon:"var(--bear-warning-600)"},error:{bg:"var(--bear-danger-50)",border:"var(--bear-danger-500)",text:"var(--bear-danger-800)",icon:"var(--bear-danger-600)"}}[t],_=()=>{A(!1),i==null||i()},b=()=>n===!1?null:n!==!0?n:w[t];return e.jsxs("div",{id:j,role:"alert","aria-live":"polite",className:x.cn("Bear-Alert","bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg",r.ALERT_VARIANT_CLASSES[a](t),v),style:{backgroundColor:o?void 0:s.bg,borderColor:a==="outlined"?s.border:void 0,color:o?void 0:s.text},"data-testid":g,...f,children:[b()&&e.jsx("span",{className:"Bear-Alert__icon bear-flex-shrink-0 bear-mt-0.5",style:{color:o?"currentColor":s.icon},children:b()}),e.jsxs("div",{className:"Bear-Alert__content bear-flex-1 bear-min-w-0",children:[l&&e.jsx("div",{className:"Bear-Alert__title bear-font-semibold bear-mb-1",children:l}),d&&e.jsx("div",{className:"Bear-Alert__message bear-text-sm",children:d})]}),c&&e.jsx("div",{className:"Bear-Alert__action bear-flex-shrink-0",children:c}),u&&e.jsx("button",{type:"button",onClick:_,className:x.cn("Bear-Alert__close","bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-black/10 bear-transition-colors","bear-bg-transparent bear-border-none bear-cursor-pointer"),"aria-label":"Close alert",children:e.jsx(k,{})})]})};exports.Alert=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../utils/cn.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../utils/cn.cjs"),a={filled:e=>r.cn("bear-text-white bear-alert-filled",e==="success"&&"bear-alert-filled-success",e==="info"&&"bear-alert-filled-info",e==="warning"&&"bear-alert-filled-warning",e==="error"&&"bear-alert-filled-error"),outlined:()=>"bear-bg-transparent bear-border",standard:()=>""},l={SEVERITY:"info",VARIANT:"standard",SHOW_ICON:!0,CLOSABLE:!1};exports.ALERT_DEFAULTS=l;exports.ALERT_VARIANT_CLASSES=a;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { AlertSeverity, AlertVariant } from './Alert.types';
|
|
2
|
+
/**
|
|
3
|
+
* Alert severity colors using CSS variables for theme support
|
|
4
|
+
* These map to the theme's success, info, warning, and danger color scales
|
|
5
|
+
*/
|
|
2
6
|
export declare const ALERT_SEVERITY_COLORS: Record<AlertSeverity, {
|
|
3
7
|
bg: string;
|
|
4
8
|
border: string;
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/cn.js";
|
|
2
|
-
const
|
|
3
|
-
success: { bg: "rgba(34, 197, 94, 0.1)", border: "#22c55e", text: "#166534", icon: "#22c55e" },
|
|
4
|
-
info: { bg: "rgba(59, 130, 246, 0.1)", border: "#3b82f6", text: "#1e40af", icon: "#3b82f6" },
|
|
5
|
-
warning: { bg: "rgba(245, 158, 11, 0.1)", border: "#f59e0b", text: "#92400e", icon: "#f59e0b" },
|
|
6
|
-
error: { bg: "rgba(239, 68, 68, 0.1)", border: "#ef4444", text: "#991b1b", icon: "#ef4444" }
|
|
7
|
-
}, n = {
|
|
2
|
+
const l = {
|
|
8
3
|
filled: (r) => e(
|
|
9
|
-
"bear-text-white",
|
|
10
|
-
r === "success" && "bear-
|
|
11
|
-
r === "info" && "bear-
|
|
12
|
-
r === "warning" && "bear-
|
|
13
|
-
r === "error" && "bear-
|
|
4
|
+
"bear-text-white bear-alert-filled",
|
|
5
|
+
r === "success" && "bear-alert-filled-success",
|
|
6
|
+
r === "info" && "bear-alert-filled-info",
|
|
7
|
+
r === "warning" && "bear-alert-filled-warning",
|
|
8
|
+
r === "error" && "bear-alert-filled-error"
|
|
14
9
|
),
|
|
15
10
|
outlined: () => "bear-bg-transparent bear-border",
|
|
16
11
|
standard: () => ""
|
|
17
|
-
},
|
|
12
|
+
}, n = {
|
|
18
13
|
SEVERITY: "info",
|
|
19
14
|
VARIANT: "standard",
|
|
20
15
|
SHOW_ICON: !0,
|
|
21
16
|
CLOSABLE: !1
|
|
22
17
|
};
|
|
23
18
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
n as ALERT_VARIANT_CLASSES
|
|
19
|
+
n as ALERT_DEFAULTS,
|
|
20
|
+
l as ALERT_VARIANT_CLASSES
|
|
27
21
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as k } from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { ALERT_DEFAULTS as
|
|
5
|
-
const
|
|
3
|
+
import { cn as v } from "../../utils/cn.js";
|
|
4
|
+
import { ALERT_DEFAULTS as t, ALERT_VARIANT_CLASSES as C } from "./Alert.const.js";
|
|
5
|
+
const _ = {
|
|
6
6
|
success: /* @__PURE__ */ r("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: [
|
|
7
7
|
/* @__PURE__ */ e("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
8
8
|
/* @__PURE__ */ e("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
@@ -22,73 +22,78 @@ const w = {
|
|
|
22
22
|
/* @__PURE__ */ e("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
23
23
|
/* @__PURE__ */ e("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
24
24
|
] })
|
|
25
|
-
},
|
|
25
|
+
}, B = () => /* @__PURE__ */ r("svg", { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: [
|
|
26
26
|
/* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
27
27
|
/* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
28
|
-
] }),
|
|
28
|
+
] }), W = (x) => {
|
|
29
29
|
const {
|
|
30
|
-
severity:
|
|
31
|
-
variant:
|
|
30
|
+
severity: o = t.SEVERITY,
|
|
31
|
+
variant: i = t.VARIANT,
|
|
32
32
|
title: c,
|
|
33
|
-
icon: n =
|
|
33
|
+
icon: n = t.SHOW_ICON,
|
|
34
34
|
action: d,
|
|
35
|
-
closable:
|
|
36
|
-
onClose:
|
|
37
|
-
children:
|
|
38
|
-
className:
|
|
39
|
-
testId:
|
|
40
|
-
id:
|
|
41
|
-
...
|
|
42
|
-
} =
|
|
43
|
-
if (!
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
closable: u = t.CLOSABLE,
|
|
36
|
+
onClose: l,
|
|
37
|
+
children: b,
|
|
38
|
+
className: g,
|
|
39
|
+
testId: f,
|
|
40
|
+
id: m,
|
|
41
|
+
...y
|
|
42
|
+
} = x, [p, w] = k(!0);
|
|
43
|
+
if (!p) return null;
|
|
44
|
+
const s = i === "filled", a = {
|
|
45
|
+
success: { bg: "var(--bear-success-50)", border: "var(--bear-success-500)", text: "var(--bear-success-800)", icon: "var(--bear-success-600)" },
|
|
46
|
+
info: { bg: "var(--bear-info-50)", border: "var(--bear-info-500)", text: "var(--bear-info-800)", icon: "var(--bear-info-600)" },
|
|
47
|
+
warning: { bg: "var(--bear-warning-50)", border: "var(--bear-warning-500)", text: "var(--bear-warning-800)", icon: "var(--bear-warning-600)" },
|
|
48
|
+
error: { bg: "var(--bear-danger-50)", border: "var(--bear-danger-500)", text: "var(--bear-danger-800)", icon: "var(--bear-danger-600)" }
|
|
49
|
+
}[o], A = () => {
|
|
50
|
+
w(!1), l == null || l();
|
|
51
|
+
}, h = () => n === !1 ? null : n !== !0 ? n : _[o];
|
|
47
52
|
return /* @__PURE__ */ r(
|
|
48
53
|
"div",
|
|
49
54
|
{
|
|
50
|
-
id:
|
|
55
|
+
id: m,
|
|
51
56
|
role: "alert",
|
|
52
57
|
"aria-live": "polite",
|
|
53
|
-
className:
|
|
58
|
+
className: v(
|
|
54
59
|
"Bear-Alert",
|
|
55
60
|
"bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg",
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
C[i](o),
|
|
62
|
+
g
|
|
58
63
|
),
|
|
59
64
|
style: {
|
|
60
|
-
backgroundColor: s ? void 0 :
|
|
61
|
-
borderColor:
|
|
62
|
-
color: s ? void 0 :
|
|
65
|
+
backgroundColor: s ? void 0 : a.bg,
|
|
66
|
+
borderColor: i === "outlined" ? a.border : void 0,
|
|
67
|
+
color: s ? void 0 : a.text
|
|
63
68
|
},
|
|
64
|
-
"data-testid":
|
|
65
|
-
...
|
|
69
|
+
"data-testid": f,
|
|
70
|
+
...y,
|
|
66
71
|
children: [
|
|
67
|
-
|
|
72
|
+
h() && /* @__PURE__ */ e(
|
|
68
73
|
"span",
|
|
69
74
|
{
|
|
70
75
|
className: "Bear-Alert__icon bear-flex-shrink-0 bear-mt-0.5",
|
|
71
|
-
style: { color: s ? "currentColor" :
|
|
72
|
-
children:
|
|
76
|
+
style: { color: s ? "currentColor" : a.icon },
|
|
77
|
+
children: h()
|
|
73
78
|
}
|
|
74
79
|
),
|
|
75
80
|
/* @__PURE__ */ r("div", { className: "Bear-Alert__content bear-flex-1 bear-min-w-0", children: [
|
|
76
81
|
c && /* @__PURE__ */ e("div", { className: "Bear-Alert__title bear-font-semibold bear-mb-1", children: c }),
|
|
77
|
-
|
|
82
|
+
b && /* @__PURE__ */ e("div", { className: "Bear-Alert__message bear-text-sm", children: b })
|
|
78
83
|
] }),
|
|
79
84
|
d && /* @__PURE__ */ e("div", { className: "Bear-Alert__action bear-flex-shrink-0", children: d }),
|
|
80
|
-
|
|
85
|
+
u && /* @__PURE__ */ e(
|
|
81
86
|
"button",
|
|
82
87
|
{
|
|
83
88
|
type: "button",
|
|
84
|
-
onClick:
|
|
85
|
-
className:
|
|
89
|
+
onClick: A,
|
|
90
|
+
className: v(
|
|
86
91
|
"Bear-Alert__close",
|
|
87
92
|
"bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-black/10 bear-transition-colors",
|
|
88
93
|
"bear-bg-transparent bear-border-none bear-cursor-pointer"
|
|
89
94
|
),
|
|
90
95
|
"aria-label": "Close alert",
|
|
91
|
-
children: /* @__PURE__ */ e(
|
|
96
|
+
children: /* @__PURE__ */ e(B, {})
|
|
92
97
|
}
|
|
93
98
|
)
|
|
94
99
|
]
|
|
@@ -96,5 +101,5 @@ const w = {
|
|
|
96
101
|
);
|
|
97
102
|
};
|
|
98
103
|
export {
|
|
99
|
-
|
|
104
|
+
W as Alert
|
|
100
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("../../utils/cn.cjs"),g=({children:a,position:t="sticky",variant:b="default",color:r="primary",className:s,leftContent:i,rightContent:l,centerContent:c,elevation:n=!0})=>{const d={fixed:"bear-fixed bear-top-0 bear-left-0 bear-right-0 bear-z-50",sticky:"bear-sticky bear-top-0 bear-z-50",static:"bear-static",relative:"bear-relative"},o={default:"",transparent:"bear-bg-transparent",blur:"bear-backdrop-blur-md"},p={default:"bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",primary:"bear-bg-pink-600 bear-text-white",dark:"bear-bg-gray-900 bear-text-white dark:bear-bg-black"},x=n?"bear-shadow-md bear-border-b bear-border-gray-200/10":"";return e.jsx("header",{className:m.cn("Bear-AppBar","bear-w-full bear-h-16 bear-px-4 bear-flex bear-items-center",d[t],o[b],p[r],x,s),style:{backgroundColor:r==="primary"?"var(--bear-primary-600)":void 0},children:a??e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bear-flex bear-items-center bear-gap-4",children:i}),e.jsx("div",{className:"bear-flex-1 bear-flex bear-items-center bear-justify-center",children:c}),e.jsx("div",{className:"bear-flex bear-items-center bear-gap-4",children:l})]})})};exports.AppBar=g;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as f, Fragment as x } from "react/jsx-runtime";
|
|
2
2
|
import { cn as g } from "../../utils/cn.js";
|
|
3
|
-
const
|
|
3
|
+
const k = ({
|
|
4
4
|
children: a,
|
|
5
5
|
position: t = "sticky",
|
|
6
|
-
variant:
|
|
7
|
-
color:
|
|
6
|
+
variant: b = "default",
|
|
7
|
+
color: r = "primary",
|
|
8
8
|
className: s,
|
|
9
9
|
leftContent: i,
|
|
10
10
|
rightContent: l,
|
|
@@ -17,26 +17,30 @@ const u = ({
|
|
|
17
17
|
static: "bear-static",
|
|
18
18
|
relative: "bear-relative"
|
|
19
19
|
}, o = {
|
|
20
|
-
default: "bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",
|
|
21
|
-
transparent: "bear-bg-transparent",
|
|
22
|
-
blur: "bear-bg-white/80 dark:bear-bg-zinc-900/80 bear-backdrop-blur-md"
|
|
23
|
-
}, f = {
|
|
24
20
|
default: "",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, p =
|
|
21
|
+
transparent: "bear-bg-transparent",
|
|
22
|
+
blur: "bear-backdrop-blur-md"
|
|
23
|
+
}, p = {
|
|
24
|
+
default: "bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",
|
|
25
|
+
primary: "bear-bg-pink-600 bear-text-white",
|
|
26
|
+
dark: "bear-bg-gray-900 bear-text-white dark:bear-bg-black"
|
|
27
|
+
}, m = n ? "bear-shadow-md bear-border-b bear-border-gray-200/10" : "";
|
|
28
28
|
return /* @__PURE__ */ e(
|
|
29
29
|
"header",
|
|
30
30
|
{
|
|
31
31
|
className: g(
|
|
32
|
+
"Bear-AppBar",
|
|
32
33
|
"bear-w-full bear-h-16 bear-px-4 bear-flex bear-items-center",
|
|
33
34
|
d[t],
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
o[b],
|
|
36
|
+
p[r],
|
|
37
|
+
m,
|
|
37
38
|
s
|
|
38
39
|
),
|
|
39
|
-
|
|
40
|
+
style: {
|
|
41
|
+
backgroundColor: r === "primary" ? "var(--bear-primary-600)" : void 0
|
|
42
|
+
},
|
|
43
|
+
children: a ?? /* @__PURE__ */ f(x, { children: [
|
|
40
44
|
/* @__PURE__ */ e("div", { className: "bear-flex bear-items-center bear-gap-4", children: i }),
|
|
41
45
|
/* @__PURE__ */ e("div", { className: "bear-flex-1 bear-flex bear-items-center bear-justify-center", children: c }),
|
|
42
46
|
/* @__PURE__ */ e("div", { className: "bear-flex bear-items-center bear-gap-4", children: l })
|
|
@@ -45,5 +49,5 @@ const u = ({
|
|
|
45
49
|
);
|
|
46
50
|
};
|
|
47
51
|
export {
|
|
48
|
-
|
|
52
|
+
k as AppBar
|
|
49
53
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),s=require("react"),v=require("../../utils/cn.cjs"),y=require("../Button/Button.cjs"),o=require("./BackTop.const.cjs"),I=({bottom:l=o.BACKTOP_DEFAULTS.BOTTOM,right:a=o.BACKTOP_DEFAULTS.RIGHT,visibleAt:b=o.BACKTOP_DEFAULTS.VISIBLE_AT,duration:c=o.BACKTOP_DEFAULTS.DURATION,target:i,children:p,size:u=o.BACKTOP_DEFAULTS.SIZE,variant:h=o.BACKTOP_DEFAULTS.VARIANT,animated:A=o.BACKTOP_DEFAULTS.ANIMATED,className:S,testId:w,onClick:r,...B})=>{const[f,E]=s.useState(!1),t=o.BACKTOP_SIZES[u],n=s.useCallback(()=>i?i():typeof window<"u"?window:null,[i]);s.useEffect(()=>{const e=n();if(!e)return;const T=()=>{const g=e===window?window.scrollY||document.documentElement.scrollTop:e.scrollTop;E(g>=b)};return e.addEventListener("scroll",T,{passive:!0}),T(),()=>{e.removeEventListener("scroll",T)}},[n,b]);const m=s.useCallback(()=>{const e=n();e&&(r==null||r(),e===window?window.scrollTo({top:0,behavior:c>0?"smooth":"auto"}):e.scrollTo({top:0,behavior:c>0?"smooth":"auto"}))},[n,c,r]),L=d.jsx("svg",{width:t.iconSize,height:t.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M18 15l-6-6-6 6"})}),O=u==="sm"?"sm":u==="lg"?"lg":"md";return d.jsx(y.Button,{variant:h,size:O,className:v.cn("Bear-BackTop","!bear-rounded-full !bear-p-0","!bear-fixed !bear-shadow-lg",A&&"bear-transition-all bear-duration-300 bear-ease-out",f?"bear-opacity-100 bear-translate-y-0 bear-scale-100":"bear-opacity-0 bear-translate-y-5 bear-scale-75 bear-pointer-events-none",S),style:{bottom:typeof l=="number"?`${l}px`:l,right:typeof a=="number"?`${a}px`:a,width:t.width,height:t.height,minWidth:t.width,zIndex:9999},onClick:m,"aria-label":"Scroll to top","data-testid":w,...B,children:p||L})};exports.BackTop=I;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i={BOTTOM:40,RIGHT:40,VISIBLE_AT:400,DURATION:300,SIZE:"md",VARIANT:"primary",ANIMATED:!0},t={sm:{width:36,height:36,iconSize:16},md:{width:44,height:44,iconSize:20},lg:{width:52,height:52,iconSize:24}};exports.BACKTOP_DEFAULTS=i;exports.BACKTOP_SIZES=t;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BackTop component defaults
|
|
3
|
+
* Uses Bear Button for consistent styling
|
|
4
|
+
*/
|
|
5
|
+
export declare const BACKTOP_DEFAULTS: {
|
|
6
|
+
readonly BOTTOM: 40;
|
|
7
|
+
readonly RIGHT: 40;
|
|
8
|
+
readonly VISIBLE_AT: 400;
|
|
9
|
+
readonly DURATION: 300;
|
|
10
|
+
readonly SIZE: "md";
|
|
11
|
+
readonly VARIANT: "primary";
|
|
12
|
+
readonly ANIMATED: true;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* BackTop size configurations
|
|
16
|
+
* Controls the button dimensions and icon size
|
|
17
|
+
*/
|
|
18
|
+
export declare const BACKTOP_SIZES: {
|
|
19
|
+
readonly sm: {
|
|
20
|
+
readonly width: 36;
|
|
21
|
+
readonly height: 36;
|
|
22
|
+
readonly iconSize: 16;
|
|
23
|
+
};
|
|
24
|
+
readonly md: {
|
|
25
|
+
readonly width: 44;
|
|
26
|
+
readonly height: 44;
|
|
27
|
+
readonly iconSize: 20;
|
|
28
|
+
};
|
|
29
|
+
readonly lg: {
|
|
30
|
+
readonly width: 52;
|
|
31
|
+
readonly height: 52;
|
|
32
|
+
readonly iconSize: 24;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
BOTTOM: 40,
|
|
3
|
+
RIGHT: 40,
|
|
4
|
+
VISIBLE_AT: 400,
|
|
5
|
+
DURATION: 300,
|
|
6
|
+
SIZE: "md",
|
|
7
|
+
VARIANT: "primary",
|
|
8
|
+
ANIMATED: !0
|
|
9
|
+
}, t = {
|
|
10
|
+
sm: {
|
|
11
|
+
width: 36,
|
|
12
|
+
height: 36,
|
|
13
|
+
iconSize: 16
|
|
14
|
+
},
|
|
15
|
+
md: {
|
|
16
|
+
width: 44,
|
|
17
|
+
height: 44,
|
|
18
|
+
iconSize: 20
|
|
19
|
+
},
|
|
20
|
+
lg: {
|
|
21
|
+
width: 52,
|
|
22
|
+
height: 52,
|
|
23
|
+
iconSize: 24
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
i as BACKTOP_DEFAULTS,
|
|
28
|
+
t as BACKTOP_SIZES
|
|
29
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BackTopProps } from './BackTop.types';
|
|
3
|
+
/**
|
|
4
|
+
* BackTop - Scroll to top button
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* // Basic usage
|
|
9
|
+
* <BackTop />
|
|
10
|
+
*
|
|
11
|
+
* // Custom position and threshold
|
|
12
|
+
* <BackTop bottom={60} right={20} visibleAt={200} />
|
|
13
|
+
*
|
|
14
|
+
* // Custom content
|
|
15
|
+
* <BackTop>
|
|
16
|
+
* <span>↑ Top</span>
|
|
17
|
+
* </BackTop>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const BackTop: FC<BackTopProps>;
|
|
21
|
+
export default BackTop;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useCallback as b, useEffect as A } from "react";
|
|
3
|
+
import { cn as x } from "../../utils/cn.js";
|
|
4
|
+
import { Button as L } from "../Button/Button.js";
|
|
5
|
+
import { BACKTOP_DEFAULTS as o, BACKTOP_SIZES as z } from "./BackTop.const.js";
|
|
6
|
+
const V = ({
|
|
7
|
+
bottom: s = o.BOTTOM,
|
|
8
|
+
right: l = o.RIGHT,
|
|
9
|
+
visibleAt: u = o.VISIBLE_AT,
|
|
10
|
+
duration: a = o.DURATION,
|
|
11
|
+
target: i,
|
|
12
|
+
children: m,
|
|
13
|
+
size: c = o.SIZE,
|
|
14
|
+
variant: T = o.VARIANT,
|
|
15
|
+
animated: f = o.ANIMATED,
|
|
16
|
+
className: h,
|
|
17
|
+
testId: w,
|
|
18
|
+
onClick: r,
|
|
19
|
+
...S
|
|
20
|
+
}) => {
|
|
21
|
+
const [I, g] = y(!1), t = z[c], n = b(() => i ? i() : typeof window < "u" ? window : null, [i]);
|
|
22
|
+
A(() => {
|
|
23
|
+
const e = n();
|
|
24
|
+
if (!e) return;
|
|
25
|
+
const d = () => {
|
|
26
|
+
const E = e === window ? window.scrollY || document.documentElement.scrollTop : e.scrollTop;
|
|
27
|
+
g(E >= u);
|
|
28
|
+
};
|
|
29
|
+
return e.addEventListener("scroll", d, { passive: !0 }), d(), () => {
|
|
30
|
+
e.removeEventListener("scroll", d);
|
|
31
|
+
};
|
|
32
|
+
}, [n, u]);
|
|
33
|
+
const v = b(() => {
|
|
34
|
+
const e = n();
|
|
35
|
+
e && (r == null || r(), e === window ? window.scrollTo({
|
|
36
|
+
top: 0,
|
|
37
|
+
behavior: a > 0 ? "smooth" : "auto"
|
|
38
|
+
}) : e.scrollTo({
|
|
39
|
+
top: 0,
|
|
40
|
+
behavior: a > 0 ? "smooth" : "auto"
|
|
41
|
+
}));
|
|
42
|
+
}, [n, a, r]), B = /* @__PURE__ */ p(
|
|
43
|
+
"svg",
|
|
44
|
+
{
|
|
45
|
+
width: t.iconSize,
|
|
46
|
+
height: t.iconSize,
|
|
47
|
+
viewBox: "0 0 24 24",
|
|
48
|
+
fill: "none",
|
|
49
|
+
stroke: "currentColor",
|
|
50
|
+
strokeWidth: 2.5,
|
|
51
|
+
strokeLinecap: "round",
|
|
52
|
+
strokeLinejoin: "round",
|
|
53
|
+
children: /* @__PURE__ */ p("path", { d: "M18 15l-6-6-6 6" })
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
return /* @__PURE__ */ p(
|
|
57
|
+
L,
|
|
58
|
+
{
|
|
59
|
+
variant: T,
|
|
60
|
+
size: c === "sm" ? "sm" : c === "lg" ? "lg" : "md",
|
|
61
|
+
className: x(
|
|
62
|
+
"Bear-BackTop",
|
|
63
|
+
"!bear-rounded-full !bear-p-0",
|
|
64
|
+
"!bear-fixed !bear-shadow-lg",
|
|
65
|
+
f && "bear-transition-all bear-duration-300 bear-ease-out",
|
|
66
|
+
I ? "bear-opacity-100 bear-translate-y-0 bear-scale-100" : "bear-opacity-0 bear-translate-y-5 bear-scale-75 bear-pointer-events-none",
|
|
67
|
+
h
|
|
68
|
+
),
|
|
69
|
+
style: {
|
|
70
|
+
bottom: typeof s == "number" ? `${s}px` : s,
|
|
71
|
+
right: typeof l == "number" ? `${l}px` : l,
|
|
72
|
+
width: t.width,
|
|
73
|
+
height: t.height,
|
|
74
|
+
minWidth: t.width,
|
|
75
|
+
zIndex: 9999
|
|
76
|
+
},
|
|
77
|
+
onClick: v,
|
|
78
|
+
"aria-label": "Scroll to top",
|
|
79
|
+
"data-testid": w,
|
|
80
|
+
...S,
|
|
81
|
+
children: m || B
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
V as BackTop
|
|
87
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { BearVariant, BearSize } from '../../types';
|
|
3
|
+
export interface BackTopProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
4
|
+
/** Distance from bottom of viewport */
|
|
5
|
+
bottom?: number | string;
|
|
6
|
+
/** Distance from right of viewport */
|
|
7
|
+
right?: number | string;
|
|
8
|
+
/** Show threshold - scroll distance before button appears */
|
|
9
|
+
visibleAt?: number;
|
|
10
|
+
/** Scroll duration in ms */
|
|
11
|
+
duration?: number;
|
|
12
|
+
/** Target element to scroll (defaults to window) */
|
|
13
|
+
target?: () => HTMLElement | null;
|
|
14
|
+
/** Custom icon or content */
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/** Button size - uses Bear Button sizes */
|
|
17
|
+
size?: Extract<BearSize, 'sm' | 'md' | 'lg'>;
|
|
18
|
+
/** Button variant - uses Bear Button variants */
|
|
19
|
+
variant?: BearVariant;
|
|
20
|
+
/** Show/hide animation */
|
|
21
|
+
animated?: boolean;
|
|
22
|
+
/** Custom class name */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Test ID */
|
|
25
|
+
testId?: string;
|
|
26
|
+
/** Callback when clicked */
|
|
27
|
+
onClick?: () => void;
|
|
28
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BearSize, BearVariant } from '../../types';
|
|
2
2
|
/** Dot size utility classes (bear-w-1.5 bear-h-1.5). */
|
|
3
3
|
export declare const BADGE_DOT_SIZE_CLASSES = "bear-w-1.5 bear-h-1.5";
|
|
4
|
-
export declare const sizeClasses: Record<Exclude<
|
|
5
|
-
export declare const variantClasses: Record<
|
|
6
|
-
export declare const dotVariantColors: Record<
|
|
4
|
+
export declare const sizeClasses: Record<Exclude<BearSize, 'xl'>, string>;
|
|
5
|
+
export declare const variantClasses: Record<BearVariant | 'neutral', string>;
|
|
6
|
+
export declare const dotVariantColors: Record<BearVariant | 'neutral', string>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BearSize, BearVariant } from '../../types';
|
|
3
3
|
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
4
|
/** Badge variant */
|
|
5
|
-
variant?:
|
|
5
|
+
variant?: BearVariant | 'neutral';
|
|
6
6
|
/** Badge size */
|
|
7
|
-
size?: Exclude<
|
|
7
|
+
size?: Exclude<BearSize, 'xl'>;
|
|
8
8
|
/** Whether badge is pill shaped */
|
|
9
9
|
pill?: boolean;
|
|
10
10
|
/** Whether badge has a dot indicator */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),p=require("react-dom"),f=require("../../utils/cn.cjs"),N=require("../Icon/index.cjs"),x=300,S={sm:"bear-max-h-[40%]",md:"bear-max-h-[60%]",lg:"bear-max-h-[80%]",full:"bear-max-h-[95%]"},q=({isOpen:n,onClose:s,title:b,children:h,size:v="md",showCloseButton:i=!0,closeOnBackdrop:y=!0,closeOnEscape:d=!0,showHandle:k=!0,className:g})=>{const[a,u]=r.useState(n),[c,o]=r.useState(!1),[j,m]=r.useState(!1);r.useEffect(()=>{if(n){u(!0),o(!1);const t=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(t)}if(a){m(!1),o(!0);const t=setTimeout(()=>{u(!1),o(!1)},x);return()=>clearTimeout(t)}},[n,a]);const l=r.useCallback(t=>{d&&t.key==="Escape"&&s()},[d,s]);if(r.useEffect(()=>(a&&(document.addEventListener("keydown",l),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",l),document.body.style.overflow=""}),[a,l]),!a)return null;const w=e.jsxs("div",{className:"bear-fixed bear-inset-0 bear-z-50 bear-flex bear-items-end bear-justify-center",children:[e.jsx("div",{className:f.cn("bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",c?"bear-opacity-0":"bear-opacity-100"),style:{transitionDuration:`${x}ms`},onClick:y?s:void 0,"aria-hidden":"true"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":b?"bottom-sheet-title":void 0,className:f.cn("Bear-BottomSheet bear-relative bear-w-full bear-rounded-t-2xl bear-shadow-2xl bear-overflow-hidden bear-transition-transform bear-duration-300","bear-bg-white dark:bear-bg-neutral-900 bear-border-t bear-border-neutral-200 dark:bear-border-neutral-700",S[v],j&&!c?"bear-translate-y-0":"bear-translate-y-full",g),children:[k&&e.jsx("div",{className:"bear-flex bear-justify-center bear-pt-2 bear-pb-1",children:e.jsx("div",{className:"bear-w-12 bear-h-1 bear-rounded-full bear-bg-neutral-300 dark:bear-bg-neutral-600","aria-hidden":!0})}),(b||i)&&e.jsxs("div",{className:"bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700",children:[b&&e.jsx("h2",{id:"bottom-sheet-title",className:"bear-text-lg bear-font-semibold bear-text-neutral-900 dark:bear-text-white",children:b}),i&&e.jsx("button",{onClick:s,className:"bear-p-1 bear-rounded-lg bear-text-neutral-500 dark:bear-text-neutral-400 hover:bear-text-neutral-900 dark:hover:bear-text-white hover:bear-bg-neutral-100 dark:hover:bear-bg-neutral-700 bear-transition-colors","aria-label":"Close",children:e.jsx(N.XIcon,{className:"bear-w-5 bear-h-5"})})]}),e.jsx("div",{className:"bear-flex-1 bear-overflow-y-auto bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300",children:h})]})]});return p.createPortal(w,document.body)};exports.BottomSheet=q;
|