@forgedevstack/bear 1.0.3 → 1.0.4-alpha
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/Accordion/Accordion.cjs +1 -1
- package/dist/components/Accordion/Accordion.const.cjs +1 -0
- package/dist/components/Accordion/Accordion.const.d.ts +10 -0
- package/dist/components/Accordion/Accordion.const.js +8 -0
- package/dist/components/Accordion/Accordion.d.ts +1 -0
- package/dist/components/Accordion/Accordion.js +49 -44
- package/dist/components/Accordion/Accordion.types.d.ts +2 -0
- package/dist/components/Accordion/index.d.ts +3 -2
- package/dist/components/ActivityItem/ActivityItem.cjs +1 -0
- package/dist/components/ActivityItem/ActivityItem.d.ts +7 -0
- package/dist/components/ActivityItem/ActivityItem.js +44 -0
- package/dist/components/ActivityItem/ActivityItem.types.d.ts +17 -0
- package/dist/components/ActivityItem/index.d.ts +2 -0
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.const.cjs +1 -0
- package/dist/components/Alert/Alert.const.d.ts +14 -0
- package/dist/components/Alert/Alert.const.js +27 -0
- package/dist/components/Alert/Alert.js +54 -63
- package/dist/components/Alert/Alert.types.d.ts +3 -1
- package/dist/components/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.const.cjs +1 -0
- package/dist/components/Avatar/Avatar.const.d.ts +28 -0
- package/dist/components/Avatar/Avatar.const.js +28 -0
- package/dist/components/Avatar/Avatar.js +49 -60
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Badge/Badge.cjs +1 -1
- package/dist/components/Badge/Badge.js +24 -22
- package/dist/components/BearLogo/EmberLogo.cjs +17 -0
- package/dist/components/BearLogo/EmberLogo.js +91 -0
- package/dist/components/BearLogo/index.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.const.cjs +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.const.d.ts +16 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.const.js +19 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +49 -34
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +8 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.constants.cjs +1 -1
- package/dist/components/Button/Button.constants.d.ts +2 -2
- package/dist/components/Button/Button.constants.js +2 -2
- package/dist/components/Button/Button.js +41 -46
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.helpers.cjs +1 -0
- package/dist/components/Calendar/Calendar.helpers.d.ts +10 -0
- package/dist/components/Calendar/Calendar.helpers.js +9 -0
- package/dist/components/Calendar/Calendar.js +112 -115
- package/dist/components/Card/Card.cjs +1 -1
- package/dist/components/Card/Card.const.cjs +1 -0
- package/dist/components/Card/Card.const.d.ts +13 -0
- package/dist/components/Card/Card.const.js +32 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Card/Card.js +101 -105
- package/dist/components/Card/index.d.ts +3 -2
- package/dist/components/Chart/Chart.cjs +1 -0
- package/dist/components/Chart/Chart.const.d.ts +15 -0
- package/dist/components/Chart/Chart.d.ts +18 -0
- package/dist/components/Chart/Chart.js +225 -0
- package/dist/components/Chart/Chart.types.d.ts +51 -0
- package/dist/components/Chart/Chart.utils.d.ts +31 -0
- package/dist/components/Chart/index.d.ts +2 -0
- package/dist/components/CodeBlock/CodeBlock.cjs +2 -2
- package/dist/components/CodeBlock/CodeBlock.js +65 -52
- package/dist/components/CodeBlock/CodeBlock.types.d.ts +12 -1
- package/dist/components/Editable/Editable.cjs +1 -1
- package/dist/components/Editable/Editable.js +115 -115
- package/dist/components/Gauge/Gauge.cjs +1 -0
- package/dist/components/Gauge/Gauge.d.ts +3 -0
- package/dist/components/Gauge/Gauge.js +92 -0
- package/dist/components/Gauge/Gauge.types.d.ts +27 -0
- package/dist/components/Gauge/index.d.ts +2 -0
- package/dist/components/Icon/icons/editor.cjs +1 -1
- package/dist/components/Icon/icons/editor.d.ts +1 -0
- package/dist/components/Icon/icons/editor.js +66 -61
- package/dist/components/Icon/icons/misc.cjs +1 -1
- package/dist/components/Icon/icons/misc.d.ts +13 -0
- package/dist/components/Icon/icons/misc.js +157 -88
- package/dist/components/Icon/index.d.ts +22 -0
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.js +36 -35
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.const.cjs +1 -0
- package/dist/components/Modal/Modal.const.d.ts +10 -0
- package/dist/components/Modal/Modal.const.js +17 -0
- package/dist/components/Modal/Modal.d.ts +11 -0
- package/dist/components/Modal/Modal.js +80 -77
- package/dist/components/Modal/Modal.types.d.ts +6 -1
- package/dist/components/Modal/index.d.ts +3 -2
- package/dist/components/Rating/Rating.cjs +1 -1
- package/dist/components/Rating/Rating.const.cjs +1 -0
- package/dist/components/Rating/Rating.const.d.ts +14 -0
- package/dist/components/Rating/Rating.const.js +22 -0
- package/dist/components/Rating/Rating.d.ts +5 -10
- package/dist/components/Rating/Rating.js +135 -93
- package/dist/components/Rating/Rating.types.d.ts +27 -25
- package/dist/components/Rating/index.d.ts +2 -2
- package/dist/components/RichEditor/RichEditor.cjs +1 -10
- package/dist/components/RichEditor/RichEditor.const.cjs +141 -0
- package/dist/components/RichEditor/RichEditor.const.d.ts +137 -0
- package/dist/components/RichEditor/RichEditor.const.js +279 -0
- package/dist/components/RichEditor/RichEditor.d.ts +14 -0
- package/dist/components/RichEditor/RichEditor.js +341 -129
- package/dist/components/RichEditor/RichEditor.types.d.ts +38 -1
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.js +25 -0
- package/dist/components/RichEditor/components/ToolbarButton/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +126 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.js +57 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.d.ts +7 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +45 -0
- package/dist/components/RichEditor/components/ToolbarMore/index.d.ts +2 -0
- package/dist/components/RichEditor/components/index.d.ts +4 -0
- package/dist/components/RichEditor/helpers/formatHelpers.cjs +1 -0
- package/dist/components/RichEditor/helpers/formatHelpers.d.ts +57 -0
- package/dist/components/RichEditor/helpers/formatHelpers.js +26 -0
- package/dist/components/RichEditor/helpers/index.d.ts +1 -0
- package/dist/components/RichEditor/index.d.ts +4 -2
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.const.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.const.d.ts +16 -0
- package/dist/components/Sidebar/Sidebar.const.js +22 -0
- package/dist/components/Sidebar/Sidebar.d.ts +14 -2
- package/dist/components/Sidebar/Sidebar.js +50 -138
- package/dist/components/Sidebar/Sidebar.types.d.ts +7 -3
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.cjs +1 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.d.ts +4 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.js +45 -0
- package/dist/components/Sidebar/components/SidebarGroup/index.d.ts +2 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.cjs +1 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.d.ts +4 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.js +66 -0
- package/dist/components/Sidebar/components/SidebarItem/index.d.ts +2 -0
- package/dist/components/Sidebar/components/index.d.ts +2 -0
- package/dist/components/Sidebar/index.d.ts +5 -2
- package/dist/components/SignPad/SignPad.cjs +1 -0
- package/dist/components/SignPad/SignPad.const.cjs +1 -0
- package/dist/components/SignPad/SignPad.const.d.ts +19 -0
- package/dist/components/SignPad/SignPad.const.js +20 -0
- package/dist/components/SignPad/SignPad.d.ts +17 -0
- package/dist/components/SignPad/SignPad.js +161 -0
- package/dist/components/SignPad/SignPad.types.d.ts +37 -0
- package/dist/components/SignPad/index.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.const.cjs +36 -0
- package/dist/components/Skeleton/Skeleton.const.d.ts +12 -0
- package/dist/components/Skeleton/Skeleton.const.js +58 -0
- package/dist/components/Skeleton/Skeleton.d.ts +15 -24
- package/dist/components/Skeleton/Skeleton.js +132 -103
- package/dist/components/Skeleton/Skeleton.types.d.ts +18 -8
- package/dist/components/Skeleton/index.d.ts +2 -2
- package/dist/components/Sparkline/Sparkline.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.const.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.const.d.ts +16 -0
- package/dist/components/Sparkline/Sparkline.const.js +16 -0
- package/dist/components/Sparkline/Sparkline.d.ts +3 -0
- package/dist/components/Sparkline/Sparkline.js +80 -0
- package/dist/components/Sparkline/Sparkline.types.d.ts +19 -0
- package/dist/components/Sparkline/Sparkline.utils.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.utils.d.ts +27 -0
- package/dist/components/Sparkline/Sparkline.utils.js +30 -0
- package/dist/components/Sparkline/index.d.ts +5 -0
- package/dist/components/SpeedDial/SpeedDial.cjs +12 -1
- package/dist/components/SpeedDial/SpeedDial.const.cjs +1 -0
- package/dist/components/SpeedDial/SpeedDial.const.d.ts +22 -0
- package/dist/components/SpeedDial/SpeedDial.const.js +26 -0
- package/dist/components/SpeedDial/SpeedDial.d.ts +5 -7
- package/dist/components/SpeedDial/SpeedDial.js +154 -144
- package/dist/components/SpeedDial/SpeedDial.types.d.ts +26 -29
- package/dist/components/SpeedDial/index.d.ts +1 -1
- package/dist/components/Spinner/Spinner.cjs +1 -1
- package/dist/components/Spinner/Spinner.js +17 -15
- package/dist/components/StatCard/StatCard.cjs +1 -0
- package/dist/components/StatCard/StatCard.d.ts +7 -0
- package/dist/components/StatCard/StatCard.js +36 -0
- package/dist/components/StatCard/StatCard.types.d.ts +13 -0
- package/dist/components/StatCard/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.const.cjs +1 -0
- package/dist/components/Stepper/Stepper.const.d.ts +29 -0
- package/dist/components/Stepper/Stepper.const.js +46 -0
- package/dist/components/Stepper/Stepper.d.ts +10 -3
- package/dist/components/Stepper/Stepper.js +143 -92
- package/dist/components/Stepper/Stepper.types.d.ts +63 -13
- package/dist/components/Stepper/index.d.ts +2 -2
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.js +74 -47
- package/dist/components/Switch/Switch.types.d.ts +11 -1
- package/dist/components/Tabs/Tabs.cjs +1 -1
- package/dist/components/Tabs/Tabs.js +33 -29
- package/dist/components/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.constants.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.constants.d.ts +14 -0
- package/dist/components/TimePicker/TimePicker.constants.js +18 -4
- package/dist/components/TimePicker/TimePicker.js +92 -91
- package/dist/components/Timeline/Timeline.cjs +1 -1
- package/dist/components/Timeline/Timeline.const.cjs +1 -0
- package/dist/components/Timeline/Timeline.const.d.ts +40 -0
- package/dist/components/Timeline/Timeline.const.js +58 -0
- package/dist/components/Timeline/Timeline.d.ts +16 -2
- package/dist/components/Timeline/Timeline.js +131 -63
- package/dist/components/Timeline/Timeline.types.d.ts +30 -11
- package/dist/components/Timeline/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.js +37 -35
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.js +38 -36
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +17 -5
- package/dist/components/index.js +216 -195
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +24 -0
- package/dist/hooks/index.js +42 -14
- package/dist/hooks/useBounce/index.d.ts +2 -0
- package/dist/hooks/useBounce/useBounce.cjs +1 -0
- package/dist/hooks/useBounce/useBounce.d.ts +2 -0
- package/dist/hooks/useBounce/useBounce.js +36 -0
- package/dist/hooks/useBounce/useBounce.types.d.ts +27 -0
- package/dist/hooks/useClickOutside/index.d.ts +2 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +22 -0
- package/dist/hooks/useClickOutside/useClickOutside.types.d.ts +10 -0
- package/dist/hooks/useClipboard/index.d.ts +2 -0
- package/dist/hooks/useClipboard/useClipboard.cjs +1 -0
- package/dist/hooks/useClipboard/useClipboard.d.ts +15 -0
- package/dist/hooks/useClipboard/useClipboard.js +22 -0
- package/dist/hooks/useClipboard/useClipboard.types.d.ts +20 -0
- package/dist/hooks/useDebounce/index.d.ts +2 -0
- package/dist/hooks/useDebounce/useDebounce.cjs +1 -0
- package/dist/hooks/useDebounce/useDebounce.d.ts +32 -0
- package/dist/hooks/useDebounce/useDebounce.js +39 -0
- package/dist/hooks/useDebounce/useDebounce.types.d.ts +20 -0
- package/dist/hooks/useFloat/index.d.ts +2 -0
- package/dist/hooks/useFloat/useFloat.cjs +1 -0
- package/dist/hooks/useFloat/useFloat.d.ts +2 -0
- package/dist/hooks/useFloat/useFloat.js +37 -0
- package/dist/hooks/useFloat/useFloat.types.d.ts +25 -0
- package/dist/hooks/useIntersectionObserver/index.d.ts +2 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.cjs +1 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +25 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.js +39 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.types.d.ts +22 -0
- package/dist/hooks/useKeyPress/index.d.ts +2 -0
- package/dist/hooks/useKeyPress/useKeyPress.cjs +1 -0
- package/dist/hooks/useKeyPress/useKeyPress.d.ts +22 -0
- package/dist/hooks/useKeyPress/useKeyPress.js +39 -0
- package/dist/hooks/useKeyPress/useKeyPress.types.d.ts +19 -0
- package/dist/hooks/useLocalStorage/index.d.ts +2 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.cjs +1 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.d.ts +11 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.js +47 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.types.d.ts +16 -0
- package/dist/hooks/useMediaQuery/index.d.ts +3 -0
- package/dist/hooks/useMediaQuery/useMediaQuery.d.ts +12 -0
- package/dist/hooks/useMediaQuery/useMediaQuery.types.d.ts +21 -0
- package/dist/hooks/useParallax/index.d.ts +2 -0
- package/dist/hooks/useParallax/useParallax.cjs +1 -0
- package/dist/hooks/useParallax/useParallax.d.ts +2 -0
- package/dist/hooks/useParallax/useParallax.js +36 -0
- package/dist/hooks/useParallax/useParallax.types.d.ts +19 -0
- package/dist/hooks/usePulse/index.d.ts +2 -0
- package/dist/hooks/usePulse/usePulse.cjs +1 -0
- package/dist/hooks/usePulse/usePulse.d.ts +2 -0
- package/dist/hooks/usePulse/usePulse.js +38 -0
- package/dist/hooks/usePulse/usePulse.types.d.ts +29 -0
- package/dist/hooks/useShake/index.d.ts +2 -0
- package/dist/hooks/useShake/useShake.cjs +1 -0
- package/dist/hooks/useShake/useShake.d.ts +2 -0
- package/dist/hooks/useShake/useShake.js +14 -0
- package/dist/hooks/useShake/useShake.types.d.ts +19 -0
- package/dist/hooks/useSlide/index.d.ts +2 -0
- package/dist/hooks/useSlide/useSlide.cjs +1 -0
- package/dist/hooks/useSlide/useSlide.d.ts +2 -0
- package/dist/hooks/useSlide/useSlide.js +68 -0
- package/dist/hooks/useSlide/useSlide.types.d.ts +36 -0
- package/dist/hooks/useThrottle/index.d.ts +2 -0
- package/dist/hooks/useThrottle/useThrottle.cjs +1 -0
- package/dist/hooks/useThrottle/useThrottle.d.ts +26 -0
- package/dist/hooks/useThrottle/useThrottle.js +44 -0
- package/dist/hooks/useThrottle/useThrottle.types.d.ts +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +273 -224
- package/dist/styles.css +1 -1
- package/package.json +16 -23
- package/dist/components/RichEditor/RichEditor.icons.cjs +0 -1
- package/dist/components/RichEditor/RichEditor.icons.d.ts +0 -16
- package/dist/components/RichEditor/RichEditor.icons.js +0 -62
- package/dist/components/RichEditor/RichEditor.utils.cjs +0 -1
- package/dist/components/RichEditor/RichEditor.utils.d.ts +0 -3
- package/dist/components/RichEditor/RichEditor.utils.js +0 -22
|
@@ -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"),x=require("react"),n=require("../../utils/cn.cjs"),o=require("./Accordion.const.cjs"),C=x.createContext(null),b=i=>{const{children:c,allowMultiple:a=!1,defaultOpen:d=[],className:t,testId:l,id:u}=i,[s,A]=x.useState(d),_=r=>{A(m=>m.includes(r)?m.filter(S=>S!==r):a?[...m,r]:[r])};return e.jsx(C.Provider,{value:{openItems:s,toggleItem:_,allowMultiple:a},children:e.jsx("div",{id:u,className:n.cn("Bear-Accordion",o.ACCORDION_ROOT_CLASSES,t),"data-testid":l,children:c})})},h=i=>{const{id:c,title:a,children:d,disabled:t=!1,icon:l,className:u}=i,s=x.useContext(C);if(!s)throw new Error("AccordionItem must be used within an Accordion");const{openItems:A,toggleItem:_}=s,r=A.includes(c);return e.jsxs("div",{className:n.cn("Bear-Accordion__item",o.ACCORDION_ITEM_CLASSES,u),children:[e.jsxs("button",{onClick:()=>!t&&_(c),disabled:t,className:n.cn("Bear-Accordion__trigger",o.ACCORDION_TRIGGER_CLASSES,t&&`Bear-Accordion__trigger--disabled ${o.ACCORDION_TRIGGER_DISABLED_CLASSES}`),"aria-expanded":r,children:[e.jsx("span",{className:"Bear-Accordion__title",children:a}),e.jsx("span",{className:"Bear-Accordion__icon",children:l||e.jsx("svg",{className:n.cn("bear-w-5 bear-h-5 bear-text-gray-500 dark:bear-text-gray-400 bear-transition-transform bear-duration-200",r&&"bear-rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),e.jsx("div",{className:n.cn("Bear-Accordion__content-wrapper","bear-overflow-hidden bear-transition-all bear-duration-200",r?"Bear-Accordion__content-wrapper--open bear-max-h-96":"bear-max-h-0"),children:e.jsx("div",{className:n.cn("Bear-Accordion__content",o.ACCORDION_CONTENT_CLASSES),children:d})})]})};exports.Accordion=b;exports.AccordionItem=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="bear-divide-y bear-divide-gray-200 dark:bear-divide-gray-700 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-overflow-hidden",r="bear-bg-white dark:bear-bg-zinc-900",a="bear-w-full bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-text-left bear-font-medium bear-text-gray-900 dark:bear-text-white hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-800 bear-transition-colors",b="bear-opacity-50 bear-cursor-not-allowed",S="bear-px-4 bear-py-3 bear-text-gray-600 dark:bear-text-gray-300 bear-bg-gray-50 dark:bear-bg-zinc-800/50";exports.ACCORDION_CONTENT_CLASSES=S;exports.ACCORDION_ITEM_CLASSES=r;exports.ACCORDION_ROOT_CLASSES=e;exports.ACCORDION_TRIGGER_CLASSES=a;exports.ACCORDION_TRIGGER_DISABLED_CLASSES=b;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const ACCORDION_MAX_HEIGHT = 96;
|
|
2
|
+
export declare const ACCORDION_TRANSITION_DURATION = 200;
|
|
3
|
+
export declare const ACCORDION_ICON_SIZE = 5;
|
|
4
|
+
export declare const ACCORDION_PADDING_X = 4;
|
|
5
|
+
export declare const ACCORDION_PADDING_Y = 3;
|
|
6
|
+
export declare const ACCORDION_ROOT_CLASSES = "bear-divide-y bear-divide-gray-200 dark:bear-divide-gray-700 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-overflow-hidden";
|
|
7
|
+
export declare const ACCORDION_ITEM_CLASSES = "bear-bg-white dark:bear-bg-zinc-900";
|
|
8
|
+
export declare const ACCORDION_TRIGGER_CLASSES = "bear-w-full bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-text-left bear-font-medium bear-text-gray-900 dark:bear-text-white hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-800 bear-transition-colors";
|
|
9
|
+
export declare const ACCORDION_TRIGGER_DISABLED_CLASSES = "bear-opacity-50 bear-cursor-not-allowed";
|
|
10
|
+
export declare const ACCORDION_CONTENT_CLASSES = "bear-px-4 bear-py-3 bear-text-gray-600 dark:bear-text-gray-300 bear-bg-gray-50 dark:bear-bg-zinc-800/50";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const r = "bear-divide-y bear-divide-gray-200 dark:bear-divide-gray-700 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-overflow-hidden", e = "bear-bg-white dark:bear-bg-zinc-900", a = "bear-w-full bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-text-left bear-font-medium bear-text-gray-900 dark:bear-text-white hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-800 bear-transition-colors", b = "bear-opacity-50 bear-cursor-not-allowed", t = "bear-px-4 bear-py-3 bear-text-gray-600 dark:bear-text-gray-300 bear-bg-gray-50 dark:bear-bg-zinc-800/50";
|
|
2
|
+
export {
|
|
3
|
+
t as ACCORDION_CONTENT_CLASSES,
|
|
4
|
+
e as ACCORDION_ITEM_CLASSES,
|
|
5
|
+
r as ACCORDION_ROOT_CLASSES,
|
|
6
|
+
a as ACCORDION_TRIGGER_CLASSES,
|
|
7
|
+
b as ACCORDION_TRIGGER_DISABLED_CLASSES
|
|
8
|
+
};
|
|
@@ -1,79 +1,84 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as h, useState as
|
|
1
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as h, useState as N, useContext as S } from "react";
|
|
3
3
|
import { cn as o } from "../../utils/cn.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
import { ACCORDION_ROOT_CLASSES as b, ACCORDION_TRIGGER_DISABLED_CLASSES as O, ACCORDION_TRIGGER_CLASSES as f, ACCORDION_CONTENT_CLASSES as I, ACCORDION_ITEM_CLASSES as x } from "./Accordion.const.js";
|
|
5
|
+
const C = h(null), w = (i) => {
|
|
6
|
+
const {
|
|
7
|
+
children: t,
|
|
8
|
+
allowMultiple: a = !1,
|
|
9
|
+
defaultOpen: s = [],
|
|
10
|
+
className: n,
|
|
11
|
+
testId: d,
|
|
12
|
+
id: l
|
|
13
|
+
} = i, [c, m] = N(s), _ = (e) => {
|
|
14
|
+
m((A) => A.includes(e) ? A.filter((p) => p !== e) : a ? [...A, e] : [e]);
|
|
13
15
|
};
|
|
14
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ r(C.Provider, { value: { openItems: c, toggleItem: _, allowMultiple: a }, children: /* @__PURE__ */ r(
|
|
15
17
|
"div",
|
|
16
18
|
{
|
|
17
|
-
|
|
19
|
+
id: l,
|
|
20
|
+
className: o("Bear-Accordion", b, n),
|
|
18
21
|
"data-testid": d,
|
|
19
|
-
children:
|
|
22
|
+
children: t
|
|
20
23
|
}
|
|
21
24
|
) });
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (!
|
|
25
|
+
}, L = (i) => {
|
|
26
|
+
const {
|
|
27
|
+
id: t,
|
|
28
|
+
title: a,
|
|
29
|
+
children: s,
|
|
30
|
+
disabled: n = !1,
|
|
31
|
+
icon: d,
|
|
32
|
+
className: l
|
|
33
|
+
} = i, c = S(C);
|
|
34
|
+
if (!c)
|
|
32
35
|
throw new Error("AccordionItem must be used within an Accordion");
|
|
33
|
-
const { openItems:
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
+
const { openItems: m, toggleItem: _ } = c, e = m.includes(t);
|
|
37
|
+
return /* @__PURE__ */ u("div", { className: o("Bear-Accordion__item", x, l), children: [
|
|
38
|
+
/* @__PURE__ */ u(
|
|
36
39
|
"button",
|
|
37
40
|
{
|
|
38
|
-
onClick: () => !
|
|
39
|
-
disabled:
|
|
41
|
+
onClick: () => !n && _(t),
|
|
42
|
+
disabled: n,
|
|
40
43
|
className: o(
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
t && "bear-opacity-50 bear-cursor-not-allowed"
|
|
44
|
+
"Bear-Accordion__trigger",
|
|
45
|
+
f,
|
|
46
|
+
n && `Bear-Accordion__trigger--disabled ${O}`
|
|
45
47
|
),
|
|
48
|
+
"aria-expanded": e,
|
|
46
49
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
d || /* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ r("span", { className: "Bear-Accordion__title", children: a }),
|
|
51
|
+
/* @__PURE__ */ r("span", { className: "Bear-Accordion__icon", children: d || /* @__PURE__ */ r(
|
|
49
52
|
"svg",
|
|
50
53
|
{
|
|
51
54
|
className: o(
|
|
52
|
-
"bear-w-5 bear-h-5 bear-text-gray-500 bear-transition-transform bear-duration-200",
|
|
53
|
-
|
|
55
|
+
"bear-w-5 bear-h-5 bear-text-gray-500 dark:bear-text-gray-400 bear-transition-transform bear-duration-200",
|
|
56
|
+
e && "bear-rotate-180"
|
|
54
57
|
),
|
|
55
58
|
fill: "none",
|
|
56
59
|
viewBox: "0 0 24 24",
|
|
57
60
|
stroke: "currentColor",
|
|
58
|
-
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
|
|
59
63
|
}
|
|
60
|
-
)
|
|
64
|
+
) })
|
|
61
65
|
]
|
|
62
66
|
}
|
|
63
67
|
),
|
|
64
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ r(
|
|
65
69
|
"div",
|
|
66
70
|
{
|
|
67
71
|
className: o(
|
|
72
|
+
"Bear-Accordion__content-wrapper",
|
|
68
73
|
"bear-overflow-hidden bear-transition-all bear-duration-200",
|
|
69
|
-
|
|
74
|
+
e ? "Bear-Accordion__content-wrapper--open bear-max-h-96" : "bear-max-h-0"
|
|
70
75
|
),
|
|
71
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ r("div", { className: o("Bear-Accordion__content", I), children: s })
|
|
72
77
|
}
|
|
73
78
|
)
|
|
74
79
|
] });
|
|
75
80
|
};
|
|
76
81
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
82
|
+
w as Accordion,
|
|
83
|
+
L as AccordionItem
|
|
79
84
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { Accordion, AccordionItem } from './Accordion';
|
|
2
|
-
export
|
|
1
|
+
export { Accordion, AccordionItem, default } from './Accordion';
|
|
2
|
+
export * from './Accordion.types';
|
|
3
|
+
export * from './Accordion.const';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("../../utils/cn.cjs"),m=({icon:s,iconBg:r="rgba(16, 185, 129, 0.2)",title:a,description:i,user:t,time:l,onClick:c,className:n,...x})=>e.jsxs("div",{className:d.cn("flex items-start gap-4 p-4 hover:bg-slate-700/30 dark:hover:bg-slate-700/30 rounded-xl transition-colors cursor-pointer",n),onClick:c,...x,children:[e.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-xl flex-shrink-0",style:{background:r},children:s}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-gray-900 dark:text-white font-medium truncate",children:a}),e.jsx("p",{className:"text-gray-500 dark:text-slate-400 text-sm truncate",children:i})]}),e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsx("p",{className:"text-gray-500 dark:text-slate-400 text-sm",children:l}),t&&e.jsx("p",{className:"text-gray-400 dark:text-slate-500 text-xs",children:t})]})]});exports.ActivityItem=m;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as m } from "../../utils/cn.js";
|
|
3
|
+
const g = ({
|
|
4
|
+
icon: a,
|
|
5
|
+
iconBg: s = "rgba(16, 185, 129, 0.2)",
|
|
6
|
+
title: l,
|
|
7
|
+
description: i,
|
|
8
|
+
user: r,
|
|
9
|
+
time: c,
|
|
10
|
+
onClick: n,
|
|
11
|
+
className: d,
|
|
12
|
+
...x
|
|
13
|
+
}) => /* @__PURE__ */ t(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: m(
|
|
17
|
+
"flex items-start gap-4 p-4 hover:bg-slate-700/30 dark:hover:bg-slate-700/30 rounded-xl transition-colors cursor-pointer",
|
|
18
|
+
d
|
|
19
|
+
),
|
|
20
|
+
onClick: n,
|
|
21
|
+
...x,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ e(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: "flex items-center justify-center w-10 h-10 rounded-xl flex-shrink-0",
|
|
27
|
+
style: { background: s },
|
|
28
|
+
children: a
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
|
|
32
|
+
/* @__PURE__ */ e("p", { className: "text-gray-900 dark:text-white font-medium truncate", children: l }),
|
|
33
|
+
/* @__PURE__ */ e("p", { className: "text-gray-500 dark:text-slate-400 text-sm truncate", children: i })
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ t("div", { className: "text-right flex-shrink-0", children: [
|
|
36
|
+
/* @__PURE__ */ e("p", { className: "text-gray-500 dark:text-slate-400 text-sm", children: c }),
|
|
37
|
+
r && /* @__PURE__ */ e("p", { className: "text-gray-400 dark:text-slate-500 text-xs", children: r })
|
|
38
|
+
] })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
export {
|
|
43
|
+
g as ActivityItem
|
|
44
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ActivityItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Icon element */
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
/** Icon background color/gradient */
|
|
6
|
+
iconBg?: string;
|
|
7
|
+
/** Activity title */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Activity description */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** User who performed the activity */
|
|
12
|
+
user?: string;
|
|
13
|
+
/** Time of the activity */
|
|
14
|
+
time: string;
|
|
15
|
+
/** Click handler */
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
}
|
|
@@ -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("react"),h=require("../../utils/cn.cjs"),r=require("./Alert.const.cjs"),k={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"})]})},E=()=>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"})]}),L=b=>{const{severity:s=r.ALERT_DEFAULTS.SEVERITY,variant:i=r.ALERT_DEFAULTS.VARIANT,title:a,icon:l=r.ALERT_DEFAULTS.SHOW_ICON,action:c,closable:u=r.ALERT_DEFAULTS.CLOSABLE,onClose:n,children:d,className:j,testId:A,id:y,...v}=b,[_,f]=m.useState(!0);if(!_)return null;const t=r.ALERT_SEVERITY_COLORS[s],o=i==="filled",g=()=>{f(!1),n==null||n()},x=()=>l===!1?null:l!==!0?l:k[s];return e.jsxs("div",{id:y,role:"alert","aria-live":"polite",className:h.cn("Bear-Alert","bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg",r.ALERT_VARIANT_CLASSES[i](s),j),style:{backgroundColor:o?void 0:t.bg,borderColor:i==="outlined"?t.border:void 0,color:o?void 0:t.text},"data-testid":A,...v,children:[x()&&e.jsx("span",{className:"Bear-Alert__icon bear-flex-shrink-0 bear-mt-0.5",style:{color:o?"currentColor":t.icon},children:x()}),e.jsxs("div",{className:"Bear-Alert__content bear-flex-1 bear-min-w-0",children:[a&&e.jsx("div",{className:"Bear-Alert__title bear-font-semibold bear-mb-1",children:a}),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:g,className:h.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(E,{})})]})};exports.Alert=L;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../utils/cn.cjs"),b={success:{bg:"rgba(34, 197, 94, 0.1)",border:"#22c55e",text:"#166534",icon:"#22c55e"},info:{bg:"rgba(59, 130, 246, 0.1)",border:"#3b82f6",text:"#1e40af",icon:"#3b82f6"},warning:{bg:"rgba(245, 158, 11, 0.1)",border:"#f59e0b",text:"#92400e",icon:"#f59e0b"},error:{bg:"rgba(239, 68, 68, 0.1)",border:"#ef4444",text:"#991b1b",icon:"#ef4444"}},n={filled:e=>r.cn("bear-text-white",e==="success"&&"bear-bg-green-500",e==="info"&&"bear-bg-blue-500",e==="warning"&&"bear-bg-amber-500",e==="error"&&"bear-bg-red-500"),outlined:()=>"bear-bg-transparent bear-border",standard:()=>""},a={SEVERITY:"info",VARIANT:"standard",SHOW_ICON:!0,CLOSABLE:!1};exports.ALERT_DEFAULTS=a;exports.ALERT_SEVERITY_COLORS=b;exports.ALERT_VARIANT_CLASSES=n;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AlertSeverity, AlertVariant } from './Alert.types';
|
|
2
|
+
export declare const ALERT_SEVERITY_COLORS: Record<AlertSeverity, {
|
|
3
|
+
bg: string;
|
|
4
|
+
border: string;
|
|
5
|
+
text: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const ALERT_VARIANT_CLASSES: Record<AlertVariant, (severity: AlertSeverity) => string>;
|
|
9
|
+
export declare const ALERT_DEFAULTS: {
|
|
10
|
+
SEVERITY: AlertSeverity;
|
|
11
|
+
VARIANT: AlertVariant;
|
|
12
|
+
SHOW_ICON: boolean;
|
|
13
|
+
CLOSABLE: boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
const a = {
|
|
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 = {
|
|
8
|
+
filled: (r) => e(
|
|
9
|
+
"bear-text-white",
|
|
10
|
+
r === "success" && "bear-bg-green-500",
|
|
11
|
+
r === "info" && "bear-bg-blue-500",
|
|
12
|
+
r === "warning" && "bear-bg-amber-500",
|
|
13
|
+
r === "error" && "bear-bg-red-500"
|
|
14
|
+
),
|
|
15
|
+
outlined: () => "bear-bg-transparent bear-border",
|
|
16
|
+
standard: () => ""
|
|
17
|
+
}, o = {
|
|
18
|
+
SEVERITY: "info",
|
|
19
|
+
VARIANT: "standard",
|
|
20
|
+
SHOW_ICON: !0,
|
|
21
|
+
CLOSABLE: !1
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
o as ALERT_DEFAULTS,
|
|
25
|
+
a as ALERT_SEVERITY_COLORS,
|
|
26
|
+
n as ALERT_VARIANT_CLASSES
|
|
27
|
+
};
|
|
@@ -1,103 +1,94 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k } from "react";
|
|
3
|
+
import { cn as x } from "../../utils/cn.js";
|
|
4
|
+
import { ALERT_DEFAULTS as i, ALERT_SEVERITY_COLORS as C, ALERT_VARIANT_CLASSES as B } from "./Alert.const.js";
|
|
4
5
|
const w = {
|
|
5
|
-
success: /* @__PURE__ */
|
|
6
|
+
success: /* @__PURE__ */ r("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: [
|
|
6
7
|
/* @__PURE__ */ e("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
7
8
|
/* @__PURE__ */ e("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
8
9
|
] }),
|
|
9
|
-
info: /* @__PURE__ */
|
|
10
|
+
info: /* @__PURE__ */ r("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: [
|
|
10
11
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
11
12
|
/* @__PURE__ */ e("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
12
13
|
/* @__PURE__ */ e("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
13
14
|
] }),
|
|
14
|
-
warning: /* @__PURE__ */
|
|
15
|
+
warning: /* @__PURE__ */ r("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: [
|
|
15
16
|
/* @__PURE__ */ e("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" }),
|
|
16
17
|
/* @__PURE__ */ e("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
17
18
|
/* @__PURE__ */ e("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
18
19
|
] }),
|
|
19
|
-
error: /* @__PURE__ */
|
|
20
|
+
error: /* @__PURE__ */ r("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: [
|
|
20
21
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
21
22
|
/* @__PURE__ */ e("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
22
23
|
/* @__PURE__ */ e("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
23
24
|
] })
|
|
24
|
-
},
|
|
25
|
+
}, N = () => /* @__PURE__ */ r("svg", { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: [
|
|
25
26
|
/* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
26
27
|
/* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
27
|
-
] }),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
action: c,
|
|
48
|
-
closable: x = !1,
|
|
49
|
-
onClose: i,
|
|
50
|
-
children: d,
|
|
51
|
-
className: f,
|
|
52
|
-
testId: g,
|
|
53
|
-
...u
|
|
54
|
-
}) => {
|
|
55
|
-
const [m, y] = p(!0);
|
|
56
|
-
if (!m) return null;
|
|
57
|
-
const t = C[r], a = n === "filled", k = () => {
|
|
58
|
-
y(!1), i == null || i();
|
|
59
|
-
}, h = () => l === !1 ? null : l !== !0 ? l : w[r];
|
|
60
|
-
return /* @__PURE__ */ o(
|
|
28
|
+
] }), R = (u) => {
|
|
29
|
+
const {
|
|
30
|
+
severity: l = i.SEVERITY,
|
|
31
|
+
variant: o = i.VARIANT,
|
|
32
|
+
title: c,
|
|
33
|
+
icon: n = i.SHOW_ICON,
|
|
34
|
+
action: d,
|
|
35
|
+
closable: f = i.CLOSABLE,
|
|
36
|
+
onClose: a,
|
|
37
|
+
children: h,
|
|
38
|
+
className: m,
|
|
39
|
+
testId: v,
|
|
40
|
+
id: y,
|
|
41
|
+
...g
|
|
42
|
+
} = u, [A, _] = k(!0);
|
|
43
|
+
if (!A) return null;
|
|
44
|
+
const t = C[l], s = o === "filled", p = () => {
|
|
45
|
+
_(!1), a == null || a();
|
|
46
|
+
}, b = () => n === !1 ? null : n !== !0 ? n : w[l];
|
|
47
|
+
return /* @__PURE__ */ r(
|
|
61
48
|
"div",
|
|
62
49
|
{
|
|
50
|
+
id: y,
|
|
63
51
|
role: "alert",
|
|
64
|
-
|
|
52
|
+
"aria-live": "polite",
|
|
53
|
+
className: x(
|
|
54
|
+
"Bear-Alert",
|
|
65
55
|
"bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg",
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
B[o](l),
|
|
57
|
+
m
|
|
68
58
|
),
|
|
69
59
|
style: {
|
|
70
|
-
backgroundColor:
|
|
71
|
-
borderColor:
|
|
72
|
-
color:
|
|
60
|
+
backgroundColor: s ? void 0 : t.bg,
|
|
61
|
+
borderColor: o === "outlined" ? t.border : void 0,
|
|
62
|
+
color: s ? void 0 : t.text
|
|
73
63
|
},
|
|
74
|
-
"data-testid":
|
|
75
|
-
...
|
|
64
|
+
"data-testid": v,
|
|
65
|
+
...g,
|
|
76
66
|
children: [
|
|
77
|
-
|
|
67
|
+
b() && /* @__PURE__ */ e(
|
|
78
68
|
"span",
|
|
79
69
|
{
|
|
80
|
-
className: "bear-flex-shrink-0 bear-mt-0.5",
|
|
81
|
-
style: { color:
|
|
82
|
-
children:
|
|
70
|
+
className: "Bear-Alert__icon bear-flex-shrink-0 bear-mt-0.5",
|
|
71
|
+
style: { color: s ? "currentColor" : t.icon },
|
|
72
|
+
children: b()
|
|
83
73
|
}
|
|
84
74
|
),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
87
|
-
|
|
75
|
+
/* @__PURE__ */ r("div", { className: "Bear-Alert__content bear-flex-1 bear-min-w-0", children: [
|
|
76
|
+
c && /* @__PURE__ */ e("div", { className: "Bear-Alert__title bear-font-semibold bear-mb-1", children: c }),
|
|
77
|
+
h && /* @__PURE__ */ e("div", { className: "Bear-Alert__message bear-text-sm", children: h })
|
|
88
78
|
] }),
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
d && /* @__PURE__ */ e("div", { className: "Bear-Alert__action bear-flex-shrink-0", children: d }),
|
|
80
|
+
f && /* @__PURE__ */ e(
|
|
91
81
|
"button",
|
|
92
82
|
{
|
|
93
83
|
type: "button",
|
|
94
|
-
onClick:
|
|
95
|
-
className:
|
|
84
|
+
onClick: p,
|
|
85
|
+
className: x(
|
|
86
|
+
"Bear-Alert__close",
|
|
96
87
|
"bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-black/10 bear-transition-colors",
|
|
97
88
|
"bear-bg-transparent bear-border-none bear-cursor-pointer"
|
|
98
89
|
),
|
|
99
90
|
"aria-label": "Close alert",
|
|
100
|
-
children: /* @__PURE__ */ e(
|
|
91
|
+
children: /* @__PURE__ */ e(N, {})
|
|
101
92
|
}
|
|
102
93
|
)
|
|
103
94
|
]
|
|
@@ -105,5 +96,5 @@ const w = {
|
|
|
105
96
|
);
|
|
106
97
|
};
|
|
107
98
|
export {
|
|
108
|
-
|
|
99
|
+
R as Alert
|
|
109
100
|
};
|
|
@@ -18,6 +18,8 @@ export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'
|
|
|
18
18
|
onClose?: () => void;
|
|
19
19
|
/** Content of the alert */
|
|
20
20
|
children?: ReactNode;
|
|
21
|
-
/**
|
|
21
|
+
/** Unique identifier for testing */
|
|
22
22
|
testId?: string;
|
|
23
|
+
/** HTML id attribute */
|
|
24
|
+
id?: string;
|
|
23
25
|
}
|
|
@@ -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"),g=require("react"),c=require("../../utils/cn.cjs"),r=require("./Avatar.const.cjs"),h=A=>{const{src:i,alt:a=r.AVATAR_DEFAULTS.ALT,initials:n,size:o=r.AVATAR_DEFAULTS.SIZE,variant:s=r.AVATAR_DEFAULTS.VARIANT,status:t,bordered:b=!1,className:d,testId:l,...u}=A,[v,m]=g.useState(!1),_=!i||v;return e.jsxs("div",{className:c.cn("Bear-Avatar","bear-relative bear-inline-flex bear-items-center bear-justify-center","bear-bg-gray-200 dark:bear-bg-gray-700","bear-overflow-hidden",r.AVATAR_SIZE[o],r.AVATAR_VARIANT[s],b&&"Bear-Avatar--bordered bear-ring-2 bear-ring-white dark:bear-ring-gray-900",d),"data-testid":l,children:[_?n?e.jsx("span",{className:"Bear-Avatar__initials bear-font-medium bear-text-gray-600 dark:bear-text-gray-300 bear-uppercase",children:n.slice(0,r.AVATAR_DEFAULTS.MAX_INITIALS)}):e.jsx("svg",{className:"Bear-Avatar__placeholder bear-w-3/5 bear-h-3/5 bear-text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})}):e.jsx("img",{src:i,alt:a,onError:()=>m(!0),className:"Bear-Avatar__image bear-w-full bear-h-full bear-object-cover",...u}),t&&e.jsx("span",{className:c.cn("Bear-Avatar__status",`Bear-Avatar__status--${t}`,"bear-absolute bear-bottom-0 bear-right-0","bear-w-1/4 bear-h-1/4 bear-min-w-[8px] bear-min-h-[8px]","bear-rounded-full bear-ring-2 bear-ring-white dark:bear-ring-gray-900",r.AVATAR_STATUS[t])})]})},x=A=>{const{children:i,max:a,size:n=r.AVATAR_DEFAULTS.SIZE,className:o}=A,s=g.Children.toArray(i),t=a?s.slice(0,a):s,b=a?s.length-a:0;return e.jsxs("div",{className:c.cn("Bear-AvatarGroup bear-flex bear--space-x-2",o),children:[t.map((d,l)=>e.jsx("div",{className:"Bear-AvatarGroup__item bear-relative",style:{zIndex:t.length-l},children:d},l)),b>0&&e.jsxs("div",{className:c.cn("Bear-AvatarGroup__overflow","bear-relative bear-inline-flex bear-items-center bear-justify-center","bear-bg-gray-200 dark:bear-bg-gray-700 bear-rounded-full","bear-ring-2 bear-ring-white dark:bear-ring-gray-900","bear-text-gray-600 dark:bear-text-gray-300 bear-font-medium",r.AVATAR_SIZE[n]),style:{zIndex:0},children:["+",b]})]})};exports.Avatar=h;exports.AvatarGroup=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={xs:"bear-w-6 bear-h-6 bear-text-xs",sm:"bear-w-8 bear-h-8 bear-text-sm",md:"bear-w-10 bear-h-10 bear-text-base",lg:"bear-w-12 bear-h-12 bear-text-lg",xl:"bear-w-16 bear-h-16 bear-text-xl","2xl":"bear-w-20 bear-h-20 bear-text-2xl"},r={circle:"bear-rounded-full",rounded:"bear-rounded-lg",square:"bear-rounded-none"},A={online:"bear-bg-green-500",offline:"bear-bg-gray-400",away:"bear-bg-yellow-500",busy:"bear-bg-red-500"},a={SIZE:"md",VARIANT:"circle",ALT:"Avatar",MAX_INITIALS:2};exports.AVATAR_DEFAULTS=a;exports.AVATAR_SIZE=e;exports.AVATAR_STATUS=A;exports.AVATAR_VARIANT=r;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Avatar component constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const AVATAR_SIZE: {
|
|
5
|
+
readonly xs: "bear-w-6 bear-h-6 bear-text-xs";
|
|
6
|
+
readonly sm: "bear-w-8 bear-h-8 bear-text-sm";
|
|
7
|
+
readonly md: "bear-w-10 bear-h-10 bear-text-base";
|
|
8
|
+
readonly lg: "bear-w-12 bear-h-12 bear-text-lg";
|
|
9
|
+
readonly xl: "bear-w-16 bear-h-16 bear-text-xl";
|
|
10
|
+
readonly '2xl': "bear-w-20 bear-h-20 bear-text-2xl";
|
|
11
|
+
};
|
|
12
|
+
export declare const AVATAR_VARIANT: {
|
|
13
|
+
readonly circle: "bear-rounded-full";
|
|
14
|
+
readonly rounded: "bear-rounded-lg";
|
|
15
|
+
readonly square: "bear-rounded-none";
|
|
16
|
+
};
|
|
17
|
+
export declare const AVATAR_STATUS: {
|
|
18
|
+
readonly online: "bear-bg-green-500";
|
|
19
|
+
readonly offline: "bear-bg-gray-400";
|
|
20
|
+
readonly away: "bear-bg-yellow-500";
|
|
21
|
+
readonly busy: "bear-bg-red-500";
|
|
22
|
+
};
|
|
23
|
+
export declare const AVATAR_DEFAULTS: {
|
|
24
|
+
readonly SIZE: "md";
|
|
25
|
+
readonly VARIANT: "circle";
|
|
26
|
+
readonly ALT: "Avatar";
|
|
27
|
+
readonly MAX_INITIALS: 2;
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
xs: "bear-w-6 bear-h-6 bear-text-xs",
|
|
3
|
+
sm: "bear-w-8 bear-h-8 bear-text-sm",
|
|
4
|
+
md: "bear-w-10 bear-h-10 bear-text-base",
|
|
5
|
+
lg: "bear-w-12 bear-h-12 bear-text-lg",
|
|
6
|
+
xl: "bear-w-16 bear-h-16 bear-text-xl",
|
|
7
|
+
"2xl": "bear-w-20 bear-h-20 bear-text-2xl"
|
|
8
|
+
}, r = {
|
|
9
|
+
circle: "bear-rounded-full",
|
|
10
|
+
rounded: "bear-rounded-lg",
|
|
11
|
+
square: "bear-rounded-none"
|
|
12
|
+
}, a = {
|
|
13
|
+
online: "bear-bg-green-500",
|
|
14
|
+
offline: "bear-bg-gray-400",
|
|
15
|
+
away: "bear-bg-yellow-500",
|
|
16
|
+
busy: "bear-bg-red-500"
|
|
17
|
+
}, b = {
|
|
18
|
+
SIZE: "md",
|
|
19
|
+
VARIANT: "circle",
|
|
20
|
+
ALT: "Avatar",
|
|
21
|
+
MAX_INITIALS: 2
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
b as AVATAR_DEFAULTS,
|
|
25
|
+
e as AVATAR_SIZE,
|
|
26
|
+
a as AVATAR_STATUS,
|
|
27
|
+
r as AVATAR_VARIANT
|
|
28
|
+
};
|