@forgedevstack/bear 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/dist/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -1
- package/dist/components/Accordion/components/AccordionItem/AccordionItem.js +1 -1
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.js +1 -1
- package/dist/components/BackTop/BackTop.cjs +1 -1
- package/dist/components/BackTop/BackTop.js +1 -1
- package/dist/components/Banner/Banner.const.cjs +1 -1
- package/dist/components/Banner/Banner.const.js +1 -1
- package/dist/components/Blockquote/Blockquote.cjs +1 -1
- package/dist/components/Blockquote/Blockquote.js +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +1 -1
- package/dist/components/Chart/BarChart.cjs +1 -1
- package/dist/components/Chart/BarChart.d.ts +1 -2
- package/dist/components/Chart/BarChart.js +81 -61
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.const.cjs +1 -1
- package/dist/components/Chart/Chart.const.d.ts +24 -3
- package/dist/components/Chart/Chart.const.js +39 -16
- package/dist/components/Chart/Chart.d.ts +1 -5
- package/dist/components/Chart/Chart.js +19 -23
- package/dist/components/Chart/Chart.types.d.ts +11 -19
- package/dist/components/Chart/Chart.utils.cjs +1 -1
- package/dist/components/Chart/Chart.utils.d.ts +8 -18
- package/dist/components/Chart/Chart.utils.js +39 -3
- package/dist/components/Chart/FunnelChart.cjs +1 -0
- package/dist/components/Chart/FunnelChart.d.ts +2 -0
- package/dist/components/Chart/FunnelChart.js +59 -0
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.d.ts +1 -2
- package/dist/components/Chart/LineChart.js +51 -55
- package/dist/components/Chart/PieChart.cjs +1 -1
- package/dist/components/Chart/PieChart.d.ts +1 -2
- package/dist/components/Chart/PieChart.js +121 -106
- package/dist/components/Chart/PieChart.types.d.ts +8 -0
- package/dist/components/Chart/RadarChart.cjs +1 -0
- package/dist/components/Chart/RadarChart.d.ts +2 -0
- package/dist/components/Chart/RadarChart.js +100 -0
- package/dist/components/Chart/index.d.ts +3 -1
- package/dist/components/Chat/Chat.cjs +1 -1
- package/dist/components/Chat/Chat.js +1 -1
- package/dist/components/CurrencyInput/CurrencyInput.cjs +1 -1
- package/dist/components/CurrencyInput/CurrencyInput.js +1 -1
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +1 -1
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.const.cjs +1 -1
- package/dist/components/Drawer/Drawer.const.d.ts +2 -11
- package/dist/components/Drawer/Drawer.const.js +6 -55
- package/dist/components/Drawer/Drawer.d.ts +1 -2
- package/dist/components/Drawer/Drawer.js +87 -131
- package/dist/components/Drawer/Drawer.types.d.ts +16 -3
- package/dist/components/Drawer/Drawer.utils.d.ts +0 -4
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.cjs +1 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.d.ts +2 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.js +26 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.types.d.ts +20 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.cjs +1 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.d.ts +2 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.js +17 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.cjs +1 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.d.ts +2 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.js +9 -0
- package/dist/components/Drawer/components/DrawerHeader/index.d.ts +2 -0
- package/dist/components/Drawer/components/index.d.ts +1 -0
- package/dist/components/Drawer/helpers/DrawerOptionalHeader.cjs +1 -0
- package/dist/components/Drawer/helpers/DrawerOptionalHeader.d.ts +2 -0
- package/dist/components/Drawer/helpers/DrawerOptionalHeader.js +9 -0
- package/dist/components/Drawer/helpers/index.d.ts +1 -0
- package/dist/components/Drawer/hooks/index.d.ts +1 -0
- package/dist/components/Drawer/hooks/useDrawer.cjs +1 -0
- package/dist/components/Drawer/hooks/useDrawer.d.ts +2 -0
- package/dist/components/Drawer/hooks/useDrawer.js +51 -0
- package/dist/components/Editable/Editable.cjs +1 -1
- package/dist/components/Editable/Editable.js +1 -1
- package/dist/components/FileTree/FileTree.cjs +1 -1
- package/dist/components/FileTree/FileTree.js +1 -1
- package/dist/components/FloatingChat/FloatingChat.cjs +1 -1
- package/dist/components/FloatingChat/FloatingChat.js +1 -1
- package/dist/components/Gauge/Gauge.cjs +1 -1
- package/dist/components/Gauge/Gauge.const.cjs +1 -1
- package/dist/components/Gauge/Gauge.const.d.ts +5 -0
- package/dist/components/Gauge/Gauge.const.js +11 -6
- package/dist/components/Gauge/Gauge.d.ts +1 -2
- package/dist/components/Gauge/Gauge.js +69 -45
- package/dist/components/Gauge/Gauge.types.d.ts +11 -2
- package/dist/components/Gauge/helpers/GaugeLinearBar.cjs +1 -0
- package/dist/components/Gauge/helpers/GaugeLinearBar.d.ts +2 -0
- package/dist/components/Gauge/helpers/GaugeLinearBar.js +40 -0
- package/dist/components/Heatmap/Heatmap.cjs +1 -1
- package/dist/components/Heatmap/Heatmap.const.cjs +1 -1
- package/dist/components/Heatmap/Heatmap.const.d.ts +2 -0
- package/dist/components/Heatmap/Heatmap.const.js +8 -6
- package/dist/components/Heatmap/Heatmap.js +51 -47
- package/dist/components/Heatmap/Heatmap.types.d.ts +1 -1
- package/dist/components/Icon/Icon.d.ts +2 -39
- package/dist/components/Icon/Icon.types.d.ts +1 -17
- package/dist/components/Icon/icons/action.d.ts +1 -85
- package/dist/components/Icon/icons/bear.d.ts +1 -12
- package/dist/components/Icon/icons/charts.d.ts +1 -0
- package/dist/components/Icon/icons/commerce.d.ts +1 -25
- package/dist/components/Icon/icons/communication.d.ts +1 -48
- package/dist/components/Icon/icons/content.d.ts +1 -53
- package/dist/components/Icon/icons/device.d.ts +1 -27
- package/dist/components/Icon/icons/editor.d.ts +1 -54
- package/dist/components/Icon/icons/file.d.ts +1 -25
- package/dist/components/Icon/icons/index.d.ts +1 -9
- package/dist/components/Icon/icons/media.d.ts +1 -64
- package/dist/components/Icon/icons/misc.d.ts +1 -96
- package/dist/components/Icon/icons/navigation.d.ts +1 -56
- package/dist/components/Icon/icons/social.d.ts +1 -24
- package/dist/components/Icon/icons/status.d.ts +1 -61
- package/dist/components/Icon/index.d.ts +2 -605
- package/dist/components/ImageAnnotation/ImageAnnotation.cjs +1 -1
- package/dist/components/ImageAnnotation/ImageAnnotation.js +1 -1
- package/dist/components/JsonViewer/JsonViewer.cjs +1 -1
- package/dist/components/JsonViewer/JsonViewer.js +1 -1
- package/dist/components/MediaPlayer/MediaPlayer.cjs +1 -1
- package/dist/components/MediaPlayer/MediaPlayer.js +1 -1
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/PageNav/PageNav.cjs +1 -1
- package/dist/components/PageNav/PageNav.js +1 -1
- package/dist/components/PasswordInput/PasswordInput.cjs +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +5 -5
- package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -1
- package/dist/components/PropsPlayground/PropsPlayground.js +1 -1
- package/dist/components/Rating/components/StarIcon/StarIcon.cjs +1 -1
- package/dist/components/Rating/components/StarIcon/StarIcon.js +1 -1
- package/dist/components/Result/Result.utils.cjs +1 -1
- package/dist/components/Result/Result.utils.js +1 -1
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +1 -1
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.js +1 -1
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +1 -1
- package/dist/components/RichEditor/components/ToolbarSignature/ToolbarSignature.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarSignature/ToolbarSignature.js +1 -1
- package/dist/components/RichEditor/helpers/IconRender.cjs +1 -1
- package/dist/components/RichEditor/helpers/IconRender.js +16 -16
- package/dist/components/RichEditor/helpers/toolbarItemRender.cjs +1 -1
- package/dist/components/RichEditor/helpers/toolbarItemRender.js +23 -23
- package/dist/components/RingProgress/RingProgress.cjs +1 -1
- package/dist/components/RingProgress/RingProgress.const.cjs +1 -1
- package/dist/components/RingProgress/RingProgress.const.d.ts +3 -0
- package/dist/components/RingProgress/RingProgress.const.js +7 -4
- package/dist/components/RingProgress/RingProgress.js +38 -37
- package/dist/components/RingProgress/RingProgress.types.d.ts +1 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.js +16 -15
- package/dist/components/Sidebar/Sidebar.types.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.utils.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.utils.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.utils.js +11 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.cjs +1 -1
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.js +1 -1
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.cjs +1 -1
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.js +55 -51
- package/dist/components/Sidebar/index.d.ts +1 -0
- package/dist/components/SliderRange/SliderRange.cjs +1 -1
- package/dist/components/SliderRange/SliderRange.js +19 -19
- package/dist/components/Sparkline/Sparkline.cjs +1 -1
- package/dist/components/Sparkline/Sparkline.const.cjs +1 -1
- package/dist/components/Sparkline/Sparkline.const.d.ts +5 -0
- package/dist/components/Sparkline/Sparkline.const.js +9 -4
- package/dist/components/Sparkline/Sparkline.d.ts +1 -2
- package/dist/components/Sparkline/Sparkline.js +75 -53
- package/dist/components/Sparkline/Sparkline.types.d.ts +2 -0
- package/dist/components/Sparkline/Sparkline.utils.cjs +1 -1
- package/dist/components/Sparkline/Sparkline.utils.d.ts +7 -12
- package/dist/components/Sparkline/Sparkline.utils.js +33 -20
- package/dist/components/Sparkline/index.d.ts +2 -2
- package/dist/components/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Tabs/TabList.cjs +1 -1
- package/dist/components/Tabs/TabList.js +1 -1
- package/dist/components/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.js +1 -1
- package/dist/components/TimelineChart/TimelineChart.cjs +1 -1
- package/dist/components/TimelineChart/TimelineChart.const.cjs +1 -1
- package/dist/components/TimelineChart/TimelineChart.const.d.ts +3 -0
- package/dist/components/TimelineChart/TimelineChart.const.js +7 -4
- package/dist/components/TimelineChart/TimelineChart.js +56 -42
- package/dist/components/TimelineChart/TimelineChart.types.d.ts +1 -1
- package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
- package/dist/components/TreeSelect/TreeSelect.js +1 -1
- package/dist/components/TreeSelect/components/TreeSelectExpandControl/TreeSelectExpandControl.cjs +1 -1
- package/dist/components/TreeSelect/components/TreeSelectExpandControl/TreeSelectExpandControl.js +1 -1
- package/dist/components/TreeView/TreeView.cjs +1 -1
- package/dist/components/TreeView/TreeView.js +3 -2
- package/dist/components/TreeView/components/TreeViewExpandControl/TreeViewExpandControl.cjs +1 -1
- package/dist/components/TreeView/components/TreeViewExpandControl/TreeViewExpandControl.js +1 -1
- package/dist/components/TreeView/components/TreeViewNodeIcon/TreeViewNodeIcon.cjs +1 -1
- package/dist/components/TreeView/components/TreeViewNodeIcon/TreeViewNodeIcon.js +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +409 -406
- package/dist/constants/generals.const.cjs +1 -1
- package/dist/constants/generals.const.d.ts +4 -0
- package/dist/constants/generals.const.js +50 -47
- package/dist/icons.cjs +1 -1
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +1 -6
- package/dist/index.cjs +1 -1
- package/dist/index.js +551 -548
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.cjs +1 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.cjs +1 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.js +14 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.js +35 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/action.cjs +1 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/action.js +26 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.cjs +1 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.js +4 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.cjs +1 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.js +130 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.cjs +1 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.js +12 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.cjs +1 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.js +18 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/status.cjs +1 -0
- package/dist/node_modules/@forgedevstack/bear-icons/dist/status.js +6 -0
- package/dist/styles/_drawer.css +213 -0
- package/dist/styles/_overlays.css +0 -1
- package/dist/styles/main.css +1 -0
- package/dist/styles.css +226 -25
- package/package.json +5 -1
- package/dist/components/Icon/Icon.cjs +0 -1
- package/dist/components/Icon/Icon.const.d.ts +0 -1
- package/dist/components/Icon/Icon.js +0 -45
- package/dist/components/Icon/icons/action.cjs +0 -1
- package/dist/components/Icon/icons/action.js +0 -351
- package/dist/components/Icon/icons/bear.cjs +0 -1
- package/dist/components/Icon/icons/bear.js +0 -47
- package/dist/components/Icon/icons/commerce.cjs +0 -1
- package/dist/components/Icon/icons/commerce.js +0 -124
- package/dist/components/Icon/icons/communication.cjs +0 -1
- package/dist/components/Icon/icons/communication.js +0 -184
- package/dist/components/Icon/icons/content.cjs +0 -1
- package/dist/components/Icon/icons/content.js +0 -231
- package/dist/components/Icon/icons/device.cjs +0 -1
- package/dist/components/Icon/icons/device.js +0 -122
- package/dist/components/Icon/icons/editor.cjs +0 -1
- package/dist/components/Icon/icons/editor.js +0 -285
- package/dist/components/Icon/icons/file.cjs +0 -1
- package/dist/components/Icon/icons/file.js +0 -120
- package/dist/components/Icon/icons/media.cjs +0 -1
- package/dist/components/Icon/icons/media.js +0 -306
- package/dist/components/Icon/icons/misc.cjs +0 -1
- package/dist/components/Icon/icons/misc.js +0 -450
- package/dist/components/Icon/icons/navigation.cjs +0 -1
- package/dist/components/Icon/icons/navigation.js +0 -215
- package/dist/components/Icon/icons/social.cjs +0 -1
- package/dist/components/Icon/icons/social.js +0 -89
- package/dist/components/Icon/icons/status.cjs +0 -1
- package/dist/components/Icon/icons/status.js +0 -271
- package/dist/components/Icon/index.cjs +0 -1
- package/dist/components/Icon/index.js +0 -79
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),_=require("../../utils/cn.cjs");require("react");const I=require("../../utils/useBearId.cjs"),N=require("../Typography/Typography.cjs"),i=require("../Flex/Flex.cjs"),e=require("./Gauge.const.cjs"),D=require("./hooks/useGauge.cjs"),b=require("./helpers/GaugeArcSvg.cjs"),R=require("./helpers/GaugeLinearBar.cjs"),y=s=>{const{value:E,min:U=e.GAUGE_DEFAULT_MIN,max:f=e.GAUGE_DEFAULT_MAX,size:t=e.GAUGE_DEFAULT_SIZE,strokeWidth:c=e.GAUGE_DEFAULT_STROKE_WIDTH,color:l=e.GAUGE_DEFAULT_COLOR,trackColor:u,showLabel:A=!0,label:G,animated:m=!0,fillDurationMs:h=e.GAUGE_DEFAULT_FILL_DURATION_MS,arcAngle:x=e.GAUGE_DEFAULT_ARC_ANGLE,variant:g=e.GAUGE_VARIANT_ARC,gradient:n,className:o,...d}=s,L=g===e.GAUGE_VARIANT_RING?s.arcAngle??e.GAUGE_RING_ARC_ANGLE:x,T=I.useBearId("Gauge","gradient"),r=D.useGauge({value:E,min:U,max:f,strokeWidth:c,arcAngle:L,animated:m,fillDurationMs:h});return g===e.GAUGE_VARIANT_LINEAR?a.jsx(i.Flex,{align:"center",justify:"center",className:_.cn("bear-relative bear-inline-flex",o),style:{width:t},...d,children:a.jsx(R.GaugeLinearBar,{percentage:r.percentage,color:l,trackColor:u,gradient:n,animated:r.animated,fillDurationMs:r.fillDurationMs,showLabel:A,label:G})}):a.jsxs(i.Flex,{align:"center",justify:"center",className:_.cn("bear-relative bear-inline-flex",o),style:{width:t,height:t},...d,children:[a.jsx(b.GaugeArcSvg,{radius:r.radius,strokeWidth:c,circumference:r.circumference,dashOffset:r.dashOffset,startAngle:r.startAngle,color:l,trackColor:u,gradientId:n?T:void 0,gradient:n,animated:r.animated,fillDurationMs:r.fillDurationMs}),A&&a.jsx(i.Flex,{align:"center",justify:"center",className:"bear-absolute bear-inset-0",children:G||a.jsxs(N.Typography,{variant:"h4",className:"bear-text-[var(--bear-text-primary)]",children:[Math.round(r.percentage),"%"]})})]})};exports.Gauge=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=0,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=0,G=100,_=120,E=10,U="var(--bear-primary-500, #ec4899)",T=270,I=900,N=50,R="cubic-bezier(0.4, 0, 0.2, 1)",L="arc",c="linear",t="ring",n=360,o=8;exports.GAUGE_ANIMATION_EASING=R;exports.GAUGE_DEFAULT_ARC_ANGLE=T;exports.GAUGE_DEFAULT_COLOR=U;exports.GAUGE_DEFAULT_FILL_DURATION_MS=I;exports.GAUGE_DEFAULT_MAX=G;exports.GAUGE_DEFAULT_MIN=A;exports.GAUGE_DEFAULT_SIZE=_;exports.GAUGE_DEFAULT_STROKE_WIDTH=E;exports.GAUGE_LINEAR_TRACK_HEIGHT=o;exports.GAUGE_RING_ARC_ANGLE=n;exports.GAUGE_VARIANT_ARC=L;exports.GAUGE_VARIANT_LINEAR=c;exports.GAUGE_VARIANT_RING=t;exports.GAUGE_VIEWBOX_CENTER=N;
|
|
@@ -7,3 +7,8 @@ export declare const GAUGE_DEFAULT_ARC_ANGLE = 270;
|
|
|
7
7
|
export declare const GAUGE_DEFAULT_FILL_DURATION_MS = 900;
|
|
8
8
|
export declare const GAUGE_VIEWBOX_CENTER = 50;
|
|
9
9
|
export declare const GAUGE_ANIMATION_EASING = "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
10
|
+
export declare const GAUGE_VARIANT_ARC = "arc";
|
|
11
|
+
export declare const GAUGE_VARIANT_LINEAR = "linear";
|
|
12
|
+
export declare const GAUGE_VARIANT_RING = "ring";
|
|
13
|
+
export declare const GAUGE_RING_ARC_ANGLE = 360;
|
|
14
|
+
export declare const GAUGE_LINEAR_TRACK_HEIGHT = 8;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
const A = 0,
|
|
1
|
+
const A = 0, G = 100, _ = 120, E = 10, U = "var(--bear-primary-500, #ec4899)", c = 270, I = 900, T = 50, n = "cubic-bezier(0.4, 0, 0.2, 1)", o = "arc", t = "linear", N = "ring", R = 360, s = 8;
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
n as GAUGE_ANIMATION_EASING,
|
|
4
4
|
c as GAUGE_DEFAULT_ARC_ANGLE,
|
|
5
5
|
U as GAUGE_DEFAULT_COLOR,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
I as GAUGE_DEFAULT_FILL_DURATION_MS,
|
|
7
|
+
G as GAUGE_DEFAULT_MAX,
|
|
8
8
|
A as GAUGE_DEFAULT_MIN,
|
|
9
9
|
_ as GAUGE_DEFAULT_SIZE,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
E as GAUGE_DEFAULT_STROKE_WIDTH,
|
|
11
|
+
s as GAUGE_LINEAR_TRACK_HEIGHT,
|
|
12
|
+
R as GAUGE_RING_ARC_ANGLE,
|
|
13
|
+
o as GAUGE_VARIANT_ARC,
|
|
14
|
+
t as GAUGE_VARIANT_LINEAR,
|
|
15
|
+
N as GAUGE_VARIANT_RING,
|
|
16
|
+
T as GAUGE_VIEWBOX_CENTER
|
|
12
17
|
};
|
|
@@ -1,70 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cn as
|
|
1
|
+
import { jsx as r, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import { cn as d } from "../../utils/cn.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { useBearId as D } from "../../utils/useBearId.js";
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { GAUGE_DEFAULT_MIN as T, GAUGE_DEFAULT_MAX as
|
|
8
|
-
import { useGauge as
|
|
9
|
-
import { GaugeArcSvg as
|
|
10
|
-
|
|
5
|
+
import { Typography as I } from "../Typography/Typography.js";
|
|
6
|
+
import { Flex as i } from "../Flex/Flex.js";
|
|
7
|
+
import { GAUGE_DEFAULT_MIN as T, GAUGE_DEFAULT_MAX as R, GAUGE_DEFAULT_SIZE as b, GAUGE_DEFAULT_STROKE_WIDTH as v, GAUGE_DEFAULT_COLOR as x, GAUGE_DEFAULT_FILL_DURATION_MS as F, GAUGE_DEFAULT_ARC_ANGLE as M, GAUGE_VARIANT_ARC as y, GAUGE_VARIANT_RING as O, GAUGE_RING_ARC_ANGLE as j, GAUGE_VARIANT_LINEAR as C } from "./Gauge.const.js";
|
|
8
|
+
import { useGauge as S } from "./hooks/useGauge.js";
|
|
9
|
+
import { GaugeArcSvg as w } from "./helpers/GaugeArcSvg.js";
|
|
10
|
+
import { GaugeLinearBar as V } from "./helpers/GaugeLinearBar.js";
|
|
11
|
+
const P = (n) => {
|
|
11
12
|
const {
|
|
12
|
-
value:
|
|
13
|
-
min:
|
|
14
|
-
max:
|
|
15
|
-
size:
|
|
16
|
-
strokeWidth:
|
|
17
|
-
color:
|
|
18
|
-
trackColor:
|
|
19
|
-
showLabel:
|
|
20
|
-
label:
|
|
21
|
-
animated:
|
|
22
|
-
fillDurationMs:
|
|
23
|
-
arcAngle:
|
|
13
|
+
value: f,
|
|
14
|
+
min: g = T,
|
|
15
|
+
max: E = R,
|
|
16
|
+
size: a = b,
|
|
17
|
+
strokeWidth: l = v,
|
|
18
|
+
color: s = x,
|
|
19
|
+
trackColor: o,
|
|
20
|
+
showLabel: A = !0,
|
|
21
|
+
label: c,
|
|
22
|
+
animated: U = !0,
|
|
23
|
+
fillDurationMs: h = F,
|
|
24
|
+
arcAngle: p = M,
|
|
25
|
+
variant: m = y,
|
|
24
26
|
gradient: t,
|
|
25
|
-
className:
|
|
26
|
-
...
|
|
27
|
-
} =
|
|
28
|
-
value:
|
|
29
|
-
min:
|
|
30
|
-
max:
|
|
31
|
-
strokeWidth:
|
|
32
|
-
arcAngle:
|
|
33
|
-
animated:
|
|
34
|
-
fillDurationMs:
|
|
27
|
+
className: G,
|
|
28
|
+
...u
|
|
29
|
+
} = n, L = m === O ? n.arcAngle ?? j : p, N = D("Gauge", "gradient"), e = S({
|
|
30
|
+
value: f,
|
|
31
|
+
min: g,
|
|
32
|
+
max: E,
|
|
33
|
+
strokeWidth: l,
|
|
34
|
+
arcAngle: L,
|
|
35
|
+
animated: U,
|
|
36
|
+
fillDurationMs: h
|
|
35
37
|
});
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
38
|
+
return m === C ? /* @__PURE__ */ r(
|
|
39
|
+
i,
|
|
38
40
|
{
|
|
39
41
|
align: "center",
|
|
40
42
|
justify: "center",
|
|
41
|
-
className:
|
|
42
|
-
style: { width:
|
|
43
|
-
...
|
|
43
|
+
className: d("bear-relative bear-inline-flex", G),
|
|
44
|
+
style: { width: a },
|
|
45
|
+
...u,
|
|
46
|
+
children: /* @__PURE__ */ r(
|
|
47
|
+
V,
|
|
48
|
+
{
|
|
49
|
+
percentage: e.percentage,
|
|
50
|
+
color: s,
|
|
51
|
+
trackColor: o,
|
|
52
|
+
gradient: t,
|
|
53
|
+
animated: e.animated,
|
|
54
|
+
fillDurationMs: e.fillDurationMs,
|
|
55
|
+
showLabel: A,
|
|
56
|
+
label: c
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
) : /* @__PURE__ */ _(
|
|
61
|
+
i,
|
|
62
|
+
{
|
|
63
|
+
align: "center",
|
|
64
|
+
justify: "center",
|
|
65
|
+
className: d("bear-relative bear-inline-flex", G),
|
|
66
|
+
style: { width: a, height: a },
|
|
67
|
+
...u,
|
|
44
68
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
69
|
+
/* @__PURE__ */ r(
|
|
70
|
+
w,
|
|
47
71
|
{
|
|
48
72
|
radius: e.radius,
|
|
49
|
-
strokeWidth:
|
|
73
|
+
strokeWidth: l,
|
|
50
74
|
circumference: e.circumference,
|
|
51
75
|
dashOffset: e.dashOffset,
|
|
52
76
|
startAngle: e.startAngle,
|
|
53
|
-
color:
|
|
54
|
-
trackColor:
|
|
55
|
-
gradientId: t ?
|
|
77
|
+
color: s,
|
|
78
|
+
trackColor: o,
|
|
79
|
+
gradientId: t ? N : void 0,
|
|
56
80
|
gradient: t,
|
|
57
81
|
animated: e.animated,
|
|
58
82
|
fillDurationMs: e.fillDurationMs
|
|
59
83
|
}
|
|
60
84
|
),
|
|
61
|
-
|
|
62
|
-
|
|
85
|
+
A && /* @__PURE__ */ r(
|
|
86
|
+
i,
|
|
63
87
|
{
|
|
64
88
|
align: "center",
|
|
65
89
|
justify: "center",
|
|
66
90
|
className: "bear-absolute bear-inset-0",
|
|
67
|
-
children:
|
|
91
|
+
children: c || /* @__PURE__ */ _(I, { variant: "h4", className: "bear-text-[var(--bear-text-primary)]", children: [
|
|
68
92
|
Math.round(e.percentage),
|
|
69
93
|
"%"
|
|
70
94
|
] })
|
|
@@ -75,5 +99,5 @@ const B = (o) => {
|
|
|
75
99
|
);
|
|
76
100
|
};
|
|
77
101
|
export {
|
|
78
|
-
|
|
102
|
+
P as Gauge
|
|
79
103
|
};
|
|
@@ -24,8 +24,17 @@ export interface GaugeProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
24
24
|
animated?: boolean;
|
|
25
25
|
/** Fill transition duration in ms when animated */
|
|
26
26
|
fillDurationMs?: number;
|
|
27
|
-
/** Arc angle (180 for half, 270 for 3/4, 360 for full) */
|
|
28
27
|
arcAngle?: number;
|
|
29
|
-
|
|
28
|
+
variant?: 'arc' | 'linear' | 'ring';
|
|
30
29
|
gradient?: [string, string];
|
|
31
30
|
}
|
|
31
|
+
export interface GaugeLinearBarProps {
|
|
32
|
+
percentage: number;
|
|
33
|
+
color: string;
|
|
34
|
+
trackColor?: string;
|
|
35
|
+
gradient?: [string, string];
|
|
36
|
+
animated: boolean;
|
|
37
|
+
fillDurationMs: number;
|
|
38
|
+
showLabel: boolean;
|
|
39
|
+
label?: ReactNode;
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("../../Flex/Flex.cjs"),n=require("../../Box/Box.cjs"),b=require("../../Typography/Typography.cjs"),i=require("../Gauge.const.cjs"),h=t=>{const{percentage:o,color:l,trackColor:u,gradient:r,animated:a,fillDurationMs:s,showLabel:c,label:d}=t;return e.jsxs(g.Flex,{direction:"column",gap:2,className:"Bear-Gauge Bear-Gauge--linear bear-w-full",children:[e.jsx(n.Box,{className:"Bear-Gauge__linear-track bear-w-full bear-overflow-hidden bear-rounded-full",style:{height:i.GAUGE_LINEAR_TRACK_HEIGHT,backgroundColor:u??"var(--bear-border-default)"},children:e.jsx(n.Box,{className:"Bear-Gauge__linear-fill bear-h-full bear-rounded-full",style:{width:`${o}%`,background:r?`linear-gradient(90deg, ${r[0]}, ${r[1]})`:l,transitionProperty:a?"width":void 0,transitionDuration:a?`${s}ms`:void 0,transitionTimingFunction:a?i.GAUGE_ANIMATION_EASING:void 0}})}),c&&(d||e.jsxs(b.Typography,{variant:"caption",color:"muted",children:[Math.round(o),"%"]}))]})};exports.GaugeLinearBar=h;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsxs as o, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as m } from "../../Flex/Flex.js";
|
|
3
|
+
import { Box as l } from "../../Box/Box.js";
|
|
4
|
+
import { Typography as g } from "../../Typography/Typography.js";
|
|
5
|
+
import { GAUGE_LINEAR_TRACK_HEIGHT as f, GAUGE_ANIMATION_EASING as b } from "../Gauge.const.js";
|
|
6
|
+
const N = (n) => {
|
|
7
|
+
const { percentage: e, color: t, trackColor: d, gradient: r, animated: a, fillDurationMs: u, showLabel: c, label: s } = n;
|
|
8
|
+
return /* @__PURE__ */ o(m, { direction: "column", gap: 2, className: "Bear-Gauge Bear-Gauge--linear bear-w-full", children: [
|
|
9
|
+
/* @__PURE__ */ i(
|
|
10
|
+
l,
|
|
11
|
+
{
|
|
12
|
+
className: "Bear-Gauge__linear-track bear-w-full bear-overflow-hidden bear-rounded-full",
|
|
13
|
+
style: {
|
|
14
|
+
height: f,
|
|
15
|
+
backgroundColor: d ?? "var(--bear-border-default)"
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */ i(
|
|
18
|
+
l,
|
|
19
|
+
{
|
|
20
|
+
className: "Bear-Gauge__linear-fill bear-h-full bear-rounded-full",
|
|
21
|
+
style: {
|
|
22
|
+
width: `${e}%`,
|
|
23
|
+
background: r ? `linear-gradient(90deg, ${r[0]}, ${r[1]})` : t,
|
|
24
|
+
transitionProperty: a ? "width" : void 0,
|
|
25
|
+
transitionDuration: a ? `${u}ms` : void 0,
|
|
26
|
+
transitionTimingFunction: a ? b : void 0
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
c && (s || /* @__PURE__ */ o(g, { variant: "caption", color: "muted", children: [
|
|
33
|
+
Math.round(e),
|
|
34
|
+
"%"
|
|
35
|
+
] }))
|
|
36
|
+
] });
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
N as GaugeLinearBar
|
|
40
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("react"),N=require("../../utils/cn.cjs"),W=require("../Popover/Popover.cjs"),k=require("../Typography/Typography.cjs"),n=require("./Heatmap.const.cjs"),b=require("./Heatmap.utils.cjs"),K=({data:L,startDate:p,endDate:_,colorScale:u=n.DEFAULT_COLOR_SCALE,cellSize:d=n.DEFAULT_CELL_SIZE,cellGap:m=n.DEFAULT_CELL_GAP,showDayLabels:v=!0,showMonthLabels:C=!0,emptyColor:y,tooltipFormat:E,onCellClick:h,renderTooltip:i,cellShape:D=n.CELL_SHAPE_SQUARE,testId:O,className:P,...R})=>{const[x,H]=l.useState(null),[q,g]=l.useState(!1),S=l.useRef(new Map),{weeks:A,dataMap:T,maxValue:f}=l.useMemo(()=>{const e=_?new Date(_):new Date,a=p?new Date(p):new Date(e.getFullYear()-1,e.getMonth(),e.getDate()),c=new Map;let o=0;for(const r of L)c.set(r.date,r),r.value>o&&(o=r.value);return{weeks:b.getWeeks(a,e),dataMap:c,maxValue:o}},[L,p,_]),U=l.useCallback(e=>{if(e===0||f===0)return y??n.DEFAULT_EMPTY_COLOR;const a=Math.min(Math.floor(e/f*(u.length-1)),u.length-1);return u[a]},[f,y,u]),M=v?28:0,F=l.useCallback(e=>{!e||!i||(H(e),g(!0))},[i]),Y=l.useCallback(()=>{g(!1),H(null)},[]);return s.jsxs("div",{className:N.cn("Bear-Heatmap relative inline-block",P),"data-testid":O,...R,children:[C&&s.jsx("div",{className:"Bear-Heatmap__months flex mb-1",style:{paddingLeft:M},children:A.map((e,a)=>{const c=e[0],o=a===0||c.getDate()<=n.DAYS_IN_WEEK;return s.jsx(k.Typography,{variant:"caption",className:"Bear-Heatmap__month text-gray-400 dark:text-gray-500 text-[10px]",style:{width:d+m,textAlign:"left"},children:o?n.MONTH_LABELS[c.getMonth()]:""},a)})}),s.jsxs("div",{className:"Bear-Heatmap__grid flex",children:[v&&s.jsx("div",{className:"Bear-Heatmap__days flex flex-col mr-1",style:{gap:m},children:n.DAY_LABELS.map((e,a)=>s.jsx(k.Typography,{variant:"caption",className:"Bear-Heatmap__day text-gray-400 dark:text-gray-500 text-[10px] flex items-center justify-end",style:{height:d,width:M-n.LABEL_PAD},children:e},a))}),s.jsx("div",{className:"Bear-Heatmap__weeks flex",style:{gap:m},children:A.map((e,a)=>s.jsx("div",{className:"Bear-Heatmap__week flex flex-col",style:{gap:m},children:e.map((c,o)=>{const r=b.toKey(c),t=T.get(r),j=(t==null?void 0:t.value)??0,I=U(j),w=s.jsx("div",{ref:B=>{B&&S.current.set(r,B)},className:N.cn("Bear-Heatmap__cell cursor-pointer transition-transform hover:scale-125",D===n.CELL_SHAPE_CIRCLE?"rounded-full":"rounded-sm"),style:{width:d,height:d,backgroundColor:I},title:i?void 0:t?E?E(t):`${r}: ${j}`:r,onClick:()=>t&&(h==null?void 0:h(t)),onMouseEnter:()=>F(t),onMouseLeave:Y},o);return i&&t&&(x==null?void 0:x.date)===t.date?s.jsx(W.Popover,{content:i(t),trigger:"hover",placement:"top",open:q,onOpenChange:g,arrow:!1,children:w},o):w})},a))})]})]})};exports.Heatmap=K;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=12,E=3,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=12,E=3,_=["#161b22","#0e4429","#006d32","#26a641","#39d353"],A="#ebedf0",S=["","Mon","","Wed","","Fri",""],C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t=7,c=4,e="square",o="circle";exports.CELL_SHAPE_CIRCLE=o;exports.CELL_SHAPE_SQUARE=e;exports.DAYS_IN_WEEK=t;exports.DAY_LABELS=S;exports.DEFAULT_CELL_GAP=E;exports.DEFAULT_CELL_SIZE=L;exports.DEFAULT_COLOR_SCALE=_;exports.DEFAULT_EMPTY_COLOR=A;exports.LABEL_PAD=c;exports.MONTH_LABELS=C;
|
|
@@ -6,3 +6,5 @@ export declare const DAY_LABELS: string[];
|
|
|
6
6
|
export declare const MONTH_LABELS: string[];
|
|
7
7
|
export declare const DAYS_IN_WEEK = 7;
|
|
8
8
|
export declare const LABEL_PAD = 4;
|
|
9
|
+
export declare const CELL_SHAPE_SQUARE = "square";
|
|
10
|
+
export declare const CELL_SHAPE_CIRCLE = "circle";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
const L = 12,
|
|
1
|
+
const L = 12, E = 3, A = ["#161b22", "#0e4429", "#006d32", "#26a641", "#39d353"], _ = "#ebedf0", c = ["", "Mon", "", "Wed", "", "Fri", ""], n = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], o = 7, t = 4, s = "square", e = "circle";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
e as CELL_SHAPE_CIRCLE,
|
|
4
|
+
s as CELL_SHAPE_SQUARE,
|
|
5
|
+
o as DAYS_IN_WEEK,
|
|
6
|
+
c as DAY_LABELS,
|
|
7
|
+
E as DEFAULT_CELL_GAP,
|
|
6
8
|
L as DEFAULT_CELL_SIZE,
|
|
7
|
-
|
|
9
|
+
A as DEFAULT_COLOR_SCALE,
|
|
8
10
|
_ as DEFAULT_EMPTY_COLOR,
|
|
9
11
|
t as LABEL_PAD,
|
|
10
|
-
|
|
12
|
+
n as MONTH_LABELS
|
|
11
13
|
};
|
|
@@ -1,103 +1,107 @@
|
|
|
1
1
|
import { jsxs as N, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { useState as D, useRef as
|
|
3
|
-
import { cn as
|
|
2
|
+
import { useState as D, useRef as K, useMemo as V, useCallback as g } from "react";
|
|
3
|
+
import { cn as k } from "../../utils/cn.js";
|
|
4
4
|
import { Popover as $ } from "../Popover/Popover.js";
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { DEFAULT_EMPTY_COLOR as
|
|
7
|
-
import { getWeeks as
|
|
8
|
-
const
|
|
9
|
-
data:
|
|
5
|
+
import { Typography as O } from "../Typography/Typography.js";
|
|
6
|
+
import { DEFAULT_EMPTY_COLOR as Q, DEFAULT_COLOR_SCALE as Z, DAYS_IN_WEEK as q, MONTH_LABELS as J, DEFAULT_CELL_SIZE as X, DEFAULT_CELL_GAP as G, DAY_LABELS as z, LABEL_PAD as ee, CELL_SHAPE_SQUARE as te, CELL_SHAPE_CIRCLE as ae } from "./Heatmap.const.js";
|
|
7
|
+
import { getWeeks as re, toKey as ne } from "./Heatmap.utils.js";
|
|
8
|
+
const de = ({
|
|
9
|
+
data: L,
|
|
10
10
|
startDate: p,
|
|
11
11
|
endDate: d,
|
|
12
|
-
colorScale: i =
|
|
13
|
-
cellSize: l =
|
|
14
|
-
cellGap: c =
|
|
15
|
-
showDayLabels:
|
|
16
|
-
showMonthLabels:
|
|
17
|
-
emptyColor:
|
|
18
|
-
tooltipFormat:
|
|
12
|
+
colorScale: i = Z,
|
|
13
|
+
cellSize: l = X,
|
|
14
|
+
cellGap: c = G,
|
|
15
|
+
showDayLabels: x = !0,
|
|
16
|
+
showMonthLabels: C = !0,
|
|
17
|
+
emptyColor: E,
|
|
18
|
+
tooltipFormat: v,
|
|
19
19
|
onCellClick: f,
|
|
20
20
|
renderTooltip: m,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
cellShape: P = te,
|
|
22
|
+
testId: R,
|
|
23
|
+
className: b,
|
|
24
|
+
...U
|
|
24
25
|
}) => {
|
|
25
|
-
const [
|
|
26
|
+
const [_, y] = D(null), [F, u] = D(!1), Y = K(/* @__PURE__ */ new Map()), { weeks: A, dataMap: j, maxValue: h } = V(() => {
|
|
26
27
|
const e = d ? new Date(d) : /* @__PURE__ */ new Date(), a = p ? new Date(p) : new Date(e.getFullYear() - 1, e.getMonth(), e.getDate()), o = /* @__PURE__ */ new Map();
|
|
27
28
|
let n = 0;
|
|
28
|
-
for (const r of
|
|
29
|
+
for (const r of L)
|
|
29
30
|
o.set(r.date, r), r.value > n && (n = r.value);
|
|
30
|
-
return { weeks:
|
|
31
|
-
}, [
|
|
31
|
+
return { weeks: re(a, e), dataMap: o, maxValue: n };
|
|
32
|
+
}, [L, p, d]), I = g(
|
|
32
33
|
(e) => {
|
|
33
|
-
if (e === 0 ||
|
|
34
|
-
const a = Math.min(Math.floor(e /
|
|
34
|
+
if (e === 0 || h === 0) return E ?? Q;
|
|
35
|
+
const a = Math.min(Math.floor(e / h * (i.length - 1)), i.length - 1);
|
|
35
36
|
return i[a];
|
|
36
37
|
},
|
|
37
|
-
[
|
|
38
|
-
),
|
|
39
|
-
!e || !m || (
|
|
38
|
+
[h, E, i]
|
|
39
|
+
), H = x ? 28 : 0, S = g((e) => {
|
|
40
|
+
!e || !m || (y(e), u(!0));
|
|
40
41
|
}, [m]), T = g(() => {
|
|
41
|
-
u(!1),
|
|
42
|
+
u(!1), y(null);
|
|
42
43
|
}, []);
|
|
43
|
-
return /* @__PURE__ */ N("div", { className:
|
|
44
|
-
|
|
45
|
-
const o = e[0], n = a === 0 || o.getDate() <=
|
|
44
|
+
return /* @__PURE__ */ N("div", { className: k("Bear-Heatmap relative inline-block", b), "data-testid": R, ...U, children: [
|
|
45
|
+
C && /* @__PURE__ */ s("div", { className: "Bear-Heatmap__months flex mb-1", style: { paddingLeft: H }, children: A.map((e, a) => {
|
|
46
|
+
const o = e[0], n = a === 0 || o.getDate() <= q;
|
|
46
47
|
return /* @__PURE__ */ s(
|
|
47
|
-
|
|
48
|
+
O,
|
|
48
49
|
{
|
|
49
50
|
variant: "caption",
|
|
50
51
|
className: "Bear-Heatmap__month text-gray-400 dark:text-gray-500 text-[10px]",
|
|
51
52
|
style: { width: l + c, textAlign: "left" },
|
|
52
|
-
children: n ?
|
|
53
|
+
children: n ? J[o.getMonth()] : ""
|
|
53
54
|
},
|
|
54
55
|
a
|
|
55
56
|
);
|
|
56
57
|
}) }),
|
|
57
58
|
/* @__PURE__ */ N("div", { className: "Bear-Heatmap__grid flex", children: [
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
x && /* @__PURE__ */ s("div", { className: "Bear-Heatmap__days flex flex-col mr-1", style: { gap: c }, children: z.map((e, a) => /* @__PURE__ */ s(
|
|
60
|
+
O,
|
|
60
61
|
{
|
|
61
62
|
variant: "caption",
|
|
62
63
|
className: "Bear-Heatmap__day text-gray-400 dark:text-gray-500 text-[10px] flex items-center justify-end",
|
|
63
|
-
style: { height: l, width:
|
|
64
|
+
style: { height: l, width: H - ee },
|
|
64
65
|
children: e
|
|
65
66
|
},
|
|
66
67
|
a
|
|
67
68
|
)) }),
|
|
68
|
-
/* @__PURE__ */ s("div", { className: "Bear-Heatmap__weeks flex", style: { gap: c }, children:
|
|
69
|
-
const r =
|
|
69
|
+
/* @__PURE__ */ s("div", { className: "Bear-Heatmap__weeks flex", style: { gap: c }, children: A.map((e, a) => /* @__PURE__ */ s("div", { className: "Bear-Heatmap__week flex flex-col", style: { gap: c }, children: e.map((o, n) => {
|
|
70
|
+
const r = ne(o), t = j.get(r), w = (t == null ? void 0 : t.value) ?? 0, W = I(w), M = /* @__PURE__ */ s(
|
|
70
71
|
"div",
|
|
71
72
|
{
|
|
72
|
-
ref: (
|
|
73
|
-
|
|
73
|
+
ref: (B) => {
|
|
74
|
+
B && Y.current.set(r, B);
|
|
74
75
|
},
|
|
75
|
-
className:
|
|
76
|
+
className: k(
|
|
77
|
+
"Bear-Heatmap__cell cursor-pointer transition-transform hover:scale-125",
|
|
78
|
+
P === ae ? "rounded-full" : "rounded-sm"
|
|
79
|
+
),
|
|
76
80
|
style: { width: l, height: l, backgroundColor: W },
|
|
77
|
-
title: m ? void 0 : t ?
|
|
81
|
+
title: m ? void 0 : t ? v ? v(t) : `${r}: ${w}` : r,
|
|
78
82
|
onClick: () => t && (f == null ? void 0 : f(t)),
|
|
79
|
-
onMouseEnter: () =>
|
|
83
|
+
onMouseEnter: () => S(t),
|
|
80
84
|
onMouseLeave: T
|
|
81
85
|
},
|
|
82
86
|
n
|
|
83
87
|
);
|
|
84
|
-
return m && t && (
|
|
88
|
+
return m && t && (_ == null ? void 0 : _.date) === t.date ? /* @__PURE__ */ s(
|
|
85
89
|
$,
|
|
86
90
|
{
|
|
87
91
|
content: m(t),
|
|
88
92
|
trigger: "hover",
|
|
89
93
|
placement: "top",
|
|
90
|
-
open:
|
|
94
|
+
open: F,
|
|
91
95
|
onOpenChange: u,
|
|
92
96
|
arrow: !1,
|
|
93
|
-
children:
|
|
97
|
+
children: M
|
|
94
98
|
},
|
|
95
99
|
n
|
|
96
|
-
) :
|
|
100
|
+
) : M;
|
|
97
101
|
}) }, a)) })
|
|
98
102
|
] })
|
|
99
103
|
] });
|
|
100
104
|
};
|
|
101
105
|
export {
|
|
102
|
-
|
|
106
|
+
de as Heatmap
|
|
103
107
|
};
|
|
@@ -30,6 +30,6 @@ export interface HeatmapProps extends Omit<HTMLAttributes<HTMLDivElement>, 'chil
|
|
|
30
30
|
onCellClick?: (cell: HeatmapCell) => void;
|
|
31
31
|
/** Render custom hover content per cell */
|
|
32
32
|
renderTooltip?: (cell: HeatmapCell) => ReactNode;
|
|
33
|
-
|
|
33
|
+
cellShape?: 'square' | 'circle';
|
|
34
34
|
testId?: string;
|
|
35
35
|
}
|
|
@@ -1,39 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Icon wrapper component for SVG icons
|
|
5
|
-
* Allows customizing size, color, and animation
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```tsx
|
|
9
|
-
* <Icon size="md" color="#f97316">
|
|
10
|
-
* <path d="M12 2L2 7l10 5 10-5-10-5z" />
|
|
11
|
-
* </Icon>
|
|
12
|
-
*
|
|
13
|
-
* // Or use the pre-made icons
|
|
14
|
-
* <EmberIcon.Check size="sm" color="green" />
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare const Icon: FC<IconProps>;
|
|
18
|
-
export declare const CheckIcon: FC<Omit<IconProps, 'children'>>;
|
|
19
|
-
export declare const XIcon: FC<Omit<IconProps, 'children'>>;
|
|
20
|
-
export declare const ChevronDownIcon: FC<Omit<IconProps, 'children'>>;
|
|
21
|
-
export declare const ChevronRightIcon: FC<Omit<IconProps, 'children'>>;
|
|
22
|
-
export declare const PlusIcon: FC<Omit<IconProps, 'children'>>;
|
|
23
|
-
export declare const MinusIcon: FC<Omit<IconProps, 'children'>>;
|
|
24
|
-
export declare const SearchIcon: FC<Omit<IconProps, 'children'>>;
|
|
25
|
-
export declare const MenuIcon: FC<Omit<IconProps, 'children'>>;
|
|
26
|
-
export declare const SettingsIcon: FC<Omit<IconProps, 'children'>>;
|
|
27
|
-
export declare const BearPawIcon: FC<Omit<IconProps, 'children'>>;
|
|
28
|
-
export declare const BearIcons: {
|
|
29
|
-
Check: FC<Omit<IconProps, "children">>;
|
|
30
|
-
X: FC<Omit<IconProps, "children">>;
|
|
31
|
-
ChevronDown: FC<Omit<IconProps, "children">>;
|
|
32
|
-
ChevronRight: FC<Omit<IconProps, "children">>;
|
|
33
|
-
Plus: FC<Omit<IconProps, "children">>;
|
|
34
|
-
Minus: FC<Omit<IconProps, "children">>;
|
|
35
|
-
Search: FC<Omit<IconProps, "children">>;
|
|
36
|
-
Menu: FC<Omit<IconProps, "children">>;
|
|
37
|
-
Settings: FC<Omit<IconProps, "children">>;
|
|
38
|
-
BearPaw: FC<Omit<IconProps, "children">>;
|
|
39
|
-
};
|
|
1
|
+
export * from '@forgedevstack/bear-icons';
|
|
2
|
+
export { default } from '@forgedevstack/bear-icons';
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { BearSize } from '../../types';
|
|
3
|
-
export interface IconProps extends SVGAttributes<SVGElement> {
|
|
4
|
-
id?: string;
|
|
5
|
-
/** Icon size */
|
|
6
|
-
size?: BearSize | number;
|
|
7
|
-
/** Icon color (CSS color value) */
|
|
8
|
-
color?: string;
|
|
9
|
-
/** Stroke width for stroke-based icons */
|
|
10
|
-
strokeWidth?: number;
|
|
11
|
-
/** Whether icon should spin */
|
|
12
|
-
spin?: boolean;
|
|
13
|
-
/** Test ID */
|
|
14
|
-
testId?: string;
|
|
15
|
-
/** The SVG path or children */
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
}
|
|
1
|
+
export type { IconProps, IconSize } from '@forgedevstack/bear-icons';
|