@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
package/README.md
CHANGED
|
@@ -38,6 +38,8 @@ Public components generate root `id` values as `Bear-{Component}-{alphanumeric}`
|
|
|
38
38
|
|
|
39
39
|
## Installation
|
|
40
40
|
|
|
41
|
+
Bear installs `@forgedevstack/bear-icons` as an **optional dependency**. The default install includes components, theme, and icons.
|
|
42
|
+
|
|
41
43
|
```bash
|
|
42
44
|
npm install @forgedevstack/bear
|
|
43
45
|
# or
|
|
@@ -46,6 +48,30 @@ pnpm add @forgedevstack/bear
|
|
|
46
48
|
yarn add @forgedevstack/bear
|
|
47
49
|
```
|
|
48
50
|
|
|
51
|
+
### Install without icons
|
|
52
|
+
|
|
53
|
+
npm has no `--no-icons` flag. Skip the icon package with `--omit=optional`:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install @forgedevstack/bear --omit=optional
|
|
57
|
+
# yarn
|
|
58
|
+
yarn add @forgedevstack/bear --ignore-optional
|
|
59
|
+
# pnpm
|
|
60
|
+
pnpm add @forgedevstack/bear --no-optional
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Do not import icons from `@forgedevstack/bear` after a no-icons install.
|
|
64
|
+
|
|
65
|
+
### Icons only
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm install @forgedevstack/bear-icons
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { SearchIcon, BearIcons } from '@forgedevstack/bear-icons';
|
|
73
|
+
```
|
|
74
|
+
|
|
49
75
|
### Import CSS (Required)
|
|
50
76
|
|
|
51
77
|
Import the compiled CSS file once in your app:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("../../../../constants/generals.const.cjs"),r=require("../../../../utils/cn.cjs");require("react");const a=require("../../../Box/Box.cjs"),g=require("../../../Typography/Typography.cjs"),m=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("../../../../constants/generals.const.cjs"),r=require("../../../../utils/cn.cjs");require("react");const a=require("../../../Box/Box.cjs"),g=require("../../../Typography/Typography.cjs"),m=require("@forgedevstack/bear-icons"),p=require("../../hooks/useAccordion.cjs"),_=require("./AccordionItem.utils.cjs"),y=c=>{const{id:n,title:i,children:s,disabled:o=u.BOOLEAN_FALSE,icon:b,className:d}=c,{openItems:l,toggleItem:x}=p.useAccordion(),t=_.isAccordionItemOpen(l,n);return e.jsxs(a.Box,{className:r.cn("Bear-Accordion__item bear-bg-white dark:bear-bg-zinc-900",d),children:[e.jsxs("button",{type:"button",onClick:()=>!o&&x(n),disabled:o,className:r.cn("Bear-Accordion__trigger 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",o&&"Bear-Accordion__trigger--disabled bear-opacity-50 bear-cursor-not-allowed"),"aria-expanded":t,children:[e.jsx(g.Typography,{className:"Bear-Accordion__title",children:i}),e.jsx(a.Box,{className:"Bear-Accordion__icon",children:b||e.jsx(m.ChevronDownIcon,{className:r.cn("bear-w-5 bear-h-5 bear-text-gray-500 dark:bear-text-gray-400 bear-transition-transform bear-duration-200",t&&"bear-rotate-180")})})]}),e.jsx(a.Box,{className:r.cn("Bear-Accordion__content-wrapper","bear-overflow-hidden bear-transition-all bear-duration-200",t?"Bear-Accordion__content-wrapper--open bear-max-h-96":"bear-max-h-0"),children:e.jsx(a.Box,{className:"Bear-Accordion__content 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",children:s})})]})};exports.AccordionItem=y;
|
|
@@ -4,7 +4,7 @@ import { cn as e } from "../../../../utils/cn.js";
|
|
|
4
4
|
import "react";
|
|
5
5
|
import { Box as a } from "../../../Box/Box.js";
|
|
6
6
|
import { Typography as x } from "../../../Typography/Typography.js";
|
|
7
|
-
import { ChevronDownIcon as _ } from "
|
|
7
|
+
import { ChevronDownIcon as _ } from "@forgedevstack/bear-icons";
|
|
8
8
|
import { useAccordion as h } from "../../hooks/useAccordion.js";
|
|
9
9
|
import { isAccordionItemOpen as f } from "./AccordionItem.utils.js";
|
|
10
10
|
const O = (c) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),h=require("react"),e=require("../../constants/generals.const.cjs"),R=require("../../utils/cn.cjs"),i=require("../Box/Box.cjs"),g=require("../Button/Button.cjs"),j=require("../Flex/Flex.cjs"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),h=require("react"),e=require("../../constants/generals.const.cjs"),R=require("../../utils/cn.cjs"),i=require("../Box/Box.cjs"),g=require("../Button/Button.cjs"),j=require("../Flex/Flex.cjs"),t=require("@forgedevstack/bear-icons"),b=require("../Typography/Typography.cjs"),x=require("./Alert.const.cjs"),S=I=>{const{severity:s=e.INFO,variant:o=e.VARIANT_STANDARD,title:A,icon:a=e.BOOLEAN_TRUE,action:u,closable:B=e.BOOLEAN_FALSE,onClose:c,children:_,className:E,testId:N,...L}=I,[O,T]=h.useState(e.BOOLEAN_TRUE);if(!O)return null;const l=o===e.VARIANT_FILLED,n=x.ALERT_SEVERITY_COLORS[s],m=()=>{T(e.BOOLEAN_FALSE),c==null||c()},d=a===e.BOOLEAN_FALSE?null:a!==e.BOOLEAN_TRUE?a:s===e.INFO?r.jsx(t.InfoIcon,{}):s==="success"?r.jsx(t.BearIcons.CheckCircleIcon,{}):s==="warning"?r.jsx(t.BearIcons.WarningIcon,{}):r.jsx(t.BearIcons.ErrorIcon,{});return r.jsxs(j.Flex,{role:"alert","aria-live":"polite",className:R.cn("Bear-Alert bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg",x.ALERT_VARIANT_CLASSES[o](s),E),style:{backgroundColor:l?void 0:n.bg,borderColor:o===e.VARIANT_OUTLINED?n.border:void 0,color:l?void 0:n.text},"data-testid":N,...L,children:[d&&r.jsx(i.Box,{as:"span",className:"Bear-Alert__icon bear-flex-shrink-0 bear-mt-0.5",style:{color:l?"currentColor":n.icon},children:d}),r.jsxs(i.Box,{className:"Bear-Alert__content bear-flex-1 bear-min-w-0",children:[A&&r.jsx(b.Typography,{weight:"semibold",className:"Bear-Alert__title bear-mb-1",children:A}),_&&r.jsx(b.Typography,{className:"Bear-Alert__message bear-text-sm",children:_})]}),u&&r.jsx(i.Box,{className:"Bear-Alert__action bear-flex-shrink-0",children:u}),B&&r.jsx(g.Button,{variant:e.VARIANT_GHOST,onClick:m,className:"Bear-Alert__close bear-flex-shrink-0 bear-p-1","aria-label":e.LABEL_CLOSE_ALERT,children:r.jsx(t.CloseIcon,{})})]})};exports.Alert=S;
|
|
@@ -5,7 +5,7 @@ import { cn as V } from "../../utils/cn.js";
|
|
|
5
5
|
import { Box as c } from "../Box/Box.js";
|
|
6
6
|
import { Button as k } from "../Button/Button.js";
|
|
7
7
|
import { Flex as y } from "../Flex/Flex.js";
|
|
8
|
-
import { CloseIcon as F, InfoIcon as D, BearIcons as m } from "
|
|
8
|
+
import { CloseIcon as F, InfoIcon as D, BearIcons as m } from "@forgedevstack/bear-icons";
|
|
9
9
|
import { Typography as p } from "../Typography/Typography.js";
|
|
10
10
|
import { ALERT_SEVERITY_COLORS as w, ALERT_VARIANT_CLASSES as j } from "./Alert.const.js";
|
|
11
11
|
const Q = (N) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),T=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),T=require("react"),h=require("../../constants/numbers.const.cjs"),b=require("../../constants/generals.const.cjs"),c=require("../../utils/cn.cjs"),x=require("../Box/Box.cjs"),E=require("@forgedevstack/bear-icons"),r=require("./Avatar.const.cjs"),S=n=>{const{showFallback:t,initials:s,src:i,alt:o,rest:A,onImageError:e}=n;return t?s?a.jsx(x.Box,{as:"span",className:"Bear-Avatar__initials bear-font-medium bear-text-gray-600 dark:bear-text-gray-300 bear-uppercase",children:s.slice(0,h.AVATAR_MAX_INITIALS)}):a.jsx(E.UserIcon,{className:"Bear-Avatar__placeholder bear-w-3/5 bear-h-3/5 bear-text-gray-400"}):a.jsx("img",{src:i,alt:o,onError:e,className:"Bear-Avatar__image bear-w-full bear-h-full bear-object-cover",...A})},I=n=>{const{src:t,alt:s=r.AVATAR_DEFAULTS.ALT,initials:i,size:o=r.AVATAR_DEFAULTS.SIZE,variant:A=r.AVATAR_DEFAULTS.VARIANT,status:e,bordered:l=b.BOOLEAN_FALSE,className:u,testId:d,...g}=n,[_,m]=T.useState(b.BOOLEAN_FALSE),v=!t||_;return a.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[A],l&&"Bear-Avatar--bordered bear-ring-2 bear-ring-white dark:bear-ring-gray-900",u),"data-testid":d,children:[S({showFallback:v,initials:i,src:t,alt:s,rest:g,onImageError:()=>m(!0)}),e&&a.jsx("span",{className:c.cn("Bear-Avatar__status",`Bear-Avatar__status--${e}`,"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[e])})]})};exports.Avatar=I;
|
|
@@ -4,7 +4,7 @@ import { AVATAR_MAX_INITIALS as v } from "../../constants/numbers.const.js";
|
|
|
4
4
|
import { BOOLEAN_FALSE as A } from "../../constants/generals.const.js";
|
|
5
5
|
import { cn as m } from "../../utils/cn.js";
|
|
6
6
|
import { Box as T } from "../Box/Box.js";
|
|
7
|
-
import { UserIcon as I } from "
|
|
7
|
+
import { UserIcon as I } from "@forgedevstack/bear-icons";
|
|
8
8
|
import { AVATAR_DEFAULTS as b, AVATAR_STATUS as x, AVATAR_VARIANT as E, AVATAR_SIZE as N } from "./Avatar.const.js";
|
|
9
9
|
const w = (s) => {
|
|
10
10
|
const { showFallback: a, initials: e, src: o, alt: i, rest: n, onImageError: r } = s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),a=require("react"),u=require("../../constants/numbers.const.cjs"),i=require("../../constants/generals.const.cjs"),g=require("../../utils/cn.cjs"),L=require("../Button/Button.cjs"),U=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),a=require("react"),u=require("../../constants/numbers.const.cjs"),i=require("../../constants/generals.const.cjs"),g=require("../../utils/cn.cjs"),L=require("../Button/Button.cjs"),U=require("@forgedevstack/bear-icons"),t=require("./BackTop.const.cjs"),P=p=>{const{bottom:c=t.BACKTOP_DEFAULTS.BOTTOM,right:l=t.BACKTOP_DEFAULTS.RIGHT,visibleAt:d=t.BACKTOP_DEFAULTS.VISIBLE_AT,duration:b=t.BACKTOP_DEFAULTS.DURATION,target:T,children:B,size:A=t.BACKTOP_DEFAULTS.SIZE,variant:E=t.BACKTOP_DEFAULTS.VARIANT,animated:S=t.BACKTOP_DEFAULTS.ANIMATED,className:_,testId:h,onClick:o,...w}=p,[I,f]=a.useState(!1),n=t.BACKTOP_SIZES[A],s=a.useCallback(()=>T?T():typeof window<"u"?window:null,[T]);a.useEffect(()=>{const e=s();if(!e)return;const r=()=>{const C=e===window?window.scrollY||document.documentElement.scrollTop:e.scrollTop;f(C>=d)};return e.addEventListener("scroll",r,{passive:!0}),r(),()=>{e.removeEventListener("scroll",r)}},[s,d]);const m=a.useCallback(()=>{const e=s();if(!e)return;o==null||o();const r=b>u.ZERO?i.SCROLL_BEHAVIOR_SMOOTH:i.SCROLL_BEHAVIOR_AUTO;if(e===window){window.scrollTo({top:u.ZERO,behavior:r});return}e.scrollTo({top:u.ZERO,behavior:r})},[s,b,o]);return O.jsx(L.Button,{variant:E,size:t.BACKTOP_BUTTON_SIZE[A],className:g.cn("Bear-BackTop","!bear-rounded-full !bear-p-0","!bear-fixed !bear-shadow-lg bear-z-[9999]",S&&"bear-transition-all bear-duration-300 bear-ease-out",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",_),style:{bottom:typeof c=="number"?`${c}${i.UNIT_PX}`:c,right:typeof l=="number"?`${l}${i.UNIT_PX}`:l,width:n.width,height:n.height,minWidth:n.width},onClick:m,"aria-label":"Scroll to top","data-testid":h,...w,children:B||O.jsx(U.ChevronsUpIcon,{size:n.iconSize})})};exports.BackTop=P;
|
|
@@ -4,7 +4,7 @@ import { ZERO as c } from "../../constants/numbers.const.js";
|
|
|
4
4
|
import { SCROLL_BEHAVIOR_SMOOTH as C, SCROLL_BEHAVIOR_AUTO as L, UNIT_PX as u } from "../../constants/generals.const.js";
|
|
5
5
|
import { cn as R } from "../../utils/cn.js";
|
|
6
6
|
import { Button as N } from "../Button/Button.js";
|
|
7
|
-
import { ChevronsUpIcon as z } from "
|
|
7
|
+
import { ChevronsUpIcon as z } from "@forgedevstack/bear-icons";
|
|
8
8
|
import { BACKTOP_DEFAULTS as t, BACKTOP_SIZES as U, BACKTOP_BUTTON_SIZE as V } from "./BackTop.const.js";
|
|
9
9
|
const M = (f) => {
|
|
10
10
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../constants/generals.const.cjs"),r=require("@forgedevstack/bear-icons"),a={dismissLabel:e.LABEL_DISMISS},n={info:r.InfoIcon,success:r.CheckCircleIcon,warning:r.WarningIcon,error:r.ErrorIcon},b={static:"",sticky:"bear-sticky bear-top-0 bear-z-40"},s={info:"bear-bg-[var(--bear-info-50,#eff6ff)] bear-text-[var(--bear-info-800,#1e40af)]",success:"bear-bg-[var(--bear-success-50,#f0fdf4)] bear-text-[var(--bear-success-800,#166534)]",warning:"bear-bg-[var(--bear-warning-50,#fffbeb)] bear-text-[var(--bear-warning-800,#92400e)]",error:"bear-bg-[var(--bear-danger-50,#fef2f2)] bear-text-[var(--bear-danger-800,#991b1b)]"};exports.BANNER_DEFAULT_ICON_MAP=n;exports.BANNER_DEFAULT_TRANSLATIONS=a;exports.BANNER_POSITION_CLASSES=b;exports.BANNER_SEVERITY_CLASSES=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LABEL_DISMISS as r } from "../../constants/generals.const.js";
|
|
2
|
-
import { ErrorIcon as e, WarningIcon as a, CheckCircleIcon as b, InfoIcon as n } from "
|
|
2
|
+
import { ErrorIcon as e, WarningIcon as a, CheckCircleIcon as b, InfoIcon as n } from "@forgedevstack/bear-icons";
|
|
3
3
|
const c = {
|
|
4
4
|
dismissLabel: r
|
|
5
5
|
}, f = {
|
|
@@ -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"),p=require("../../constants/generals.const.cjs"),o=require("../../utils/cn.cjs");require("react");const c=require("../Box/Box.cjs"),q=require("../Flex/Flex.cjs"),x=require("@forgedevstack/bear-icons"),s=require("../Typography/Typography.cjs"),n=require("./Blockquote.const.cjs"),m=t=>{const{cite:r,icon:l,color:a=p.COLOR_DEFAULT,children:i,className:b,testId:u,...d}=t;return e.jsx("blockquote",{className:o.cn("Bear-Blockquote bear-pl-4 bear-py-2 bear-border-l-4 bear-bg-gray-50 dark:bear-bg-zinc-800/50 bear-rounded-r bear-not-italic",n.BORDER_COLOR_MAP[a],b),"data-testid":u,cite:r,...d,children:e.jsxs(q.Flex,{className:"bear-gap-3",children:[e.jsx(c.Box,{as:"span",className:o.cn("bear-flex-shrink-0",n.ICON_COLOR_MAP[a]),children:l??e.jsx(x.QuoteIcon,{className:"bear-w-6 bear-h-6"})}),e.jsxs(c.Box,{className:"bear-flex-1 bear-min-w-0",children:[e.jsx(s.Typography,{variant:"body1",component:"span",children:i}),r&&e.jsxs(s.Typography,{variant:"caption",color:"secondary",component:"cite",className:"Bear-Blockquote__cite bear-mt-2 bear-block",children:["— ",r]})]})]})})};exports.Blockquote=m;
|
|
@@ -4,7 +4,7 @@ import { cn as t } from "../../utils/cn.js";
|
|
|
4
4
|
import "react";
|
|
5
5
|
import { Box as c } from "../Box/Box.js";
|
|
6
6
|
import { Flex as f } from "../Flex/Flex.js";
|
|
7
|
-
import { QuoteIcon as h } from "
|
|
7
|
+
import { QuoteIcon as h } from "@forgedevstack/bear-icons";
|
|
8
8
|
import { Typography as i } from "../Typography/Typography.js";
|
|
9
9
|
import { ICON_COLOR_MAP as N, BORDER_COLOR_MAP as O } from "./Blockquote.const.js";
|
|
10
10
|
const C = (m) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),w=require("react-dom"),d=require("../../constants/numbers.const.cjs"),e=require("../../constants/generals.const.cjs"),g=require("../../constants/keys.const.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),w=require("react-dom"),d=require("../../constants/numbers.const.cjs"),e=require("../../constants/generals.const.cjs"),g=require("../../constants/keys.const.cjs"),b=require("../../utils/cn.cjs"),l=require("../Box/Box.cjs"),R=require("../Button/Button.cjs"),E=require("../Flex/Flex.cjs"),j=require("@forgedevstack/bear-icons"),q=require("../Typography/Typography.cjs"),F=require("./BottomSheet.const.cjs"),v=A=>{const{isOpen:i,onClose:o,title:s,children:_,size:y=e.SIZE_MD,showCloseButton:m=e.BOOLEAN_TRUE,closeOnBackdrop:L=e.BOOLEAN_TRUE,closeOnEscape:O=e.BOOLEAN_TRUE,showHandle:N=e.BOOLEAN_TRUE,enableScroll:f=e.BOOLEAN_TRUE,isSticky:S=e.BOOLEAN_FALSE,className:p}=A,[a,h]=t.useState(i),[x,c]=t.useState(e.BOOLEAN_FALSE),[T,B]=t.useState(e.BOOLEAN_FALSE);t.useEffect(()=>{if(i){h(e.BOOLEAN_TRUE),c(e.BOOLEAN_FALSE);const n=requestAnimationFrame(()=>B(e.BOOLEAN_TRUE));return()=>cancelAnimationFrame(n)}if(a){B(e.BOOLEAN_FALSE),c(e.BOOLEAN_TRUE);const n=setTimeout(()=>{h(e.BOOLEAN_FALSE),c(e.BOOLEAN_FALSE)},d.THREE_HUNDRED);return()=>clearTimeout(n)}},[i,a]);const u=t.useCallback(n=>{O&&n.key===g.KEY_ESCAPE&&o()},[O,o]);if(t.useEffect(()=>(a&&(document.addEventListener("keydown",u),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=""}),[a,u]),!a)return null;const k=r.jsxs(E.Flex,{className:"bear-fixed bear-inset-0 bear-items-end bear-justify-center",style:{zIndex:d.BACKDROP_DEFAULT_Z_INDEX},children:[r.jsx(l.Box,{className:b.cn("bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",x?"bear-opacity-0":"bear-opacity-100"),style:{transitionDuration:`${d.THREE_HUNDRED}ms`},onClick:L?o:void 0,"aria-hidden":"true"}),r.jsxs(l.Box,{role:"dialog","aria-modal":"true","aria-labelledby":s?"bottom-sheet-title":void 0,className:b.cn("Bear-BottomSheet bear-relative bear-w-full bear-rounded-t-2xl bear-shadow-2xl bear-transition-transform bear-duration-300","bear-flex bear-flex-col bear-min-h-0 bear-overflow-hidden","bear-bg-white dark:bear-bg-neutral-900 bear-border-t bear-border-neutral-200 dark:bear-border-neutral-700",F.BOTTOM_SHEET_SIZE_CLASSES[y],T&&!x?"bear-translate-y-0":"bear-translate-y-full",p),children:[N&&r.jsx(E.Flex,{className:"bear-justify-center bear-pt-2 bear-pb-1",children:r.jsx(l.Box,{className:"bear-w-12 bear-h-1 bear-rounded-full bear-bg-neutral-300 dark:bear-bg-neutral-600","aria-hidden":!0})}),(s||m)&&r.jsxs(E.Flex,{className:b.cn("bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700 bear-shrink-0",S&&"bear-sticky bear-top-0 bear-z-10 bear-bg-white dark:bear-bg-neutral-900"),children:[s&&r.jsx(q.Typography,{id:"bottom-sheet-title",weight:"semibold",className:"bear-text-lg bear-text-neutral-900 dark:bear-text-white",children:s}),m&&r.jsx(R.Button,{variant:e.VARIANT_GHOST,onClick:o,"aria-label":e.LABEL_CLOSE,children:r.jsx(j.XIcon,{className:"bear-w-5 bear-h-5"})})]}),r.jsx(l.Box,{className:b.cn("bear-flex-1 bear-min-h-0 bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300",f?"bear-overflow-y-auto":"bear-overflow-hidden"),children:_})]})]});return w.createPortal(k,document.body)};exports.BottomSheet=v;
|
|
@@ -8,7 +8,7 @@ import { cn as i } from "../../utils/cn.js";
|
|
|
8
8
|
import { Box as l } from "../Box/Box.js";
|
|
9
9
|
import { Button as M } from "../Button/Button.js";
|
|
10
10
|
import { Flex as f } from "../Flex/Flex.js";
|
|
11
|
-
import { XIcon as z } from "
|
|
11
|
+
import { XIcon as z } from "@forgedevstack/bear-icons";
|
|
12
12
|
import { Typography as P } from "../Typography/Typography.js";
|
|
13
13
|
import { BOTTOM_SHEET_SIZE_CLASSES as U } from "./BottomSheet.const.js";
|
|
14
14
|
const ae = (N) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),b=require("react"),v=require("../../context/BearProvider.cjs"),Z=require("../../utils/maxVisible.utils.cjs"),w=require("../../utils/cn.cjs"),D=require("../Dropdown/Dropdown.cjs"),d=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),b=require("react"),v=require("../../context/BearProvider.cjs"),Z=require("../../utils/maxVisible.utils.cjs"),w=require("../../utils/cn.cjs"),D=require("../Dropdown/Dropdown.cjs"),d=require("@forgedevstack/bear-icons"),l=require("./Breadcrumbs.const.cjs"),V=_=>{const{items:n,separator:k,maxItems:p,itemsBeforeCollapse:h=l.BREADCRUMBS_DEFAULTS.ITEMS_BEFORE_COLLAPSE,itemsAfterCollapse:u=l.BREADCRUMBS_DEFAULTS.ITEMS_AFTER_COLLAPSE,className:A,size:x=l.BREADCRUMBS_DEFAULTS.SIZE,showHomeIcon:z=l.BREADCRUMBS_DEFAULTS.SHOW_HOME_ICON,testId:M,"aria-label":O="Breadcrumb"}=_,I=v.useBearThemeOptional(),{direction:f}=v.useBearDirectionOptional(),[o,E]=b.useState(null),[U,S]=b.useState({}),[B,L]=b.useState(()=>typeof window<"u"?window.innerWidth:1200);b.useEffect(()=>{const e=()=>L(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),b.useEffect(()=>{E(null),S({})},[n]);const C=b.useMemo(()=>p==null?void 0:Z.resolveMaxVisible(p,{width:B,theme:I}),[p,B,I]),T=()=>k||(f==="rtl"?r.jsx(d.BearIcons.ChevronLeftIcon,{className:w.cn(l.BREADCRUMBS_ICON_SIZE[x],"bear-text-zinc-500 bear-mx-2")}):r.jsx(d.BearIcons.ChevronRightIcon,{className:w.cn(l.BREADCRUMBS_ICON_SIZE[x],"bear-text-zinc-500 bear-mx-2")})),y=(e,s,t)=>{const a=r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1 bear-max-w-[12rem] bear-truncate md:bear-max-w-none",children:[s===0&&z&&r.jsx(d.BearIcons.HomeIcon,{className:l.BREADCRUMBS_ICON_SIZE[x]}),e.icon,e.label]}),c=t?r.jsx("span",{className:"bear-text-zinc-300 bear-font-medium","aria-current":"page",children:a}):e.href?r.jsx("a",{href:e.href,className:"bear-text-zinc-400 hover:bear-text-primary-400 bear-transition-colors bear-truncate",children:a}):e.onClick?r.jsx("button",{type:"button",onClick:e.onClick,className:"bear-text-zinc-400 hover:bear-text-primary-400 bear-transition-colors bear-truncate",children:a}):r.jsx("span",{className:"bear-text-zinc-400 bear-truncate",children:a});if(e.dropdownItems&&e.dropdownItems.length>0&&!t){const m=U[s],N=e.dropdownItems.find(i=>i.key===m);return r.jsx(D.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:r.jsxs("button",{type:"button",className:"bear-inline-flex bear-items-center bear-gap-1 bear-text-zinc-400 hover:bear-text-primary-400 bear-transition-colors","aria-haspopup":"true",children:[a,N&&r.jsx("span",{className:"bear-ml-1 bear-max-w-[8rem] bear-truncate bear-text-xs bear-text-zinc-300",children:N.label}),r.jsx(d.BearIcons.ChevronDownIcon,{size:14})]}),items:e.dropdownItems.map(i=>({key:i.key,label:i.label,disabled:i.disabled,selected:m===i.key,onClick:()=>{var g;S(H=>({...H,[s]:i.key})),(g=i.onClick)==null||g.call(i)}}))})}return c},P=C!=null&&n.length>C,j=h,q=n.length-u;let R=n.map((e,s)=>({type:"item",item:e,index:s}));if(P){const e=n.slice(0,h),s=n.slice(-u),t=n.slice(h,n.length-u);R=[...e.map((a,c)=>({type:"item",item:a,index:c})),...t.length?[{type:"ellipsis",hidden:t}]:[],...s.map((a,c)=>({type:"item",item:a,index:n.length-u+c}))]}const F=o!=null&&o>=j&&o<q;return r.jsx("nav",{dir:f,"data-testid":M,className:w.cn("bear-flex bear-min-w-0 bear-items-center bear-flex-wrap",l.BREADCRUMBS_SIZE[x],A),"aria-label":O,children:r.jsx("ol",{className:"bear-flex bear-min-w-0 bear-items-center bear-flex-wrap bear-list-none bear-p-0 bear-m-0",children:R.map((e,s)=>r.jsxs("li",{className:"bear-flex bear-min-w-0 bear-items-center",children:[s>0&&r.jsx("span",{"aria-hidden":"true",children:T()}),e.type==="ellipsis"?r.jsxs("span",{className:"bear-inline-flex bear-min-w-0 bear-max-w-full bear-items-center bear-gap-1",children:[r.jsx(D.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:r.jsx("button",{type:"button",className:"bear-inline-flex bear-items-center bear-justify-center bear-rounded bear-px-2 bear-py-1 bear-text-zinc-400 hover:bear-bg-[var(--bear-bg-tertiary)] hover:bear-text-primary-400 bear-transition-colors","aria-label":"Hidden breadcrumbs",children:r.jsx(d.BearIcons.MoreHorizIcon,{size:18})}),items:e.hidden.map((t,a)=>{const c=j+a;return{key:`${t.label}-${a}`,label:t.label,onClick:()=>{var m;E(c),(m=t.onClick)==null||m.call(t)}}})}),F&&o!=null&&r.jsx("span",{className:"bear-min-w-0 bear-max-w-[12rem] bear-truncate md:bear-max-w-none bear-inline-flex bear-items-center",children:y(n[o],o,o===n.length-1)})]}):y(e.item,e.index,e.index===n.length-1)]},s))})})};exports.Breadcrumbs=V;
|
|
@@ -4,7 +4,7 @@ import { useBearThemeOptional as K, useBearDirectionOptional as q } from "../../
|
|
|
4
4
|
import { resolveMaxVisible as G } from "../../utils/maxVisible.utils.js";
|
|
5
5
|
import { cn as w } from "../../utils/cn.js";
|
|
6
6
|
import { Dropdown as _ } from "../Dropdown/Dropdown.js";
|
|
7
|
-
import { BearIcons as b } from "
|
|
7
|
+
import { BearIcons as b } from "@forgedevstack/bear-icons";
|
|
8
8
|
import { BREADCRUMBS_DEFAULTS as h, BREADCRUMBS_SIZE as J, BREADCRUMBS_ICON_SIZE as I } from "./Breadcrumbs.const.js";
|
|
9
9
|
const le = (D) => {
|
|
10
10
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),ze=require("../../constants/numbers.const.cjs"),pe=require("../../constants/generals.const.cjs"),w=require("../../utils/cn.cjs"),fe=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");require("../../context/BearProvider.cjs");const l=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs"),Oe=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.cjs");require("../FormControl/FormControl.context.cjs");const v=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),ze=require("../../constants/numbers.const.cjs"),pe=require("../../constants/generals.const.cjs"),w=require("../../utils/cn.cjs"),fe=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");require("../../context/BearProvider.cjs");const l=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs"),Oe=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.cjs");require("../FormControl/FormControl.context.cjs");const v=require("@forgedevstack/bear-icons"),F=require("../OverlayPortal/OverlayPortal.const.cjs"),Be=require("../Transition/Transition.cjs"),je=require("../Transition/Transition.const.cjs"),s=require("./Calendar.const.cjs"),u=require("./Calendar.utils.cjs"),De=require("./Calendar.helpers.cjs"),Re=P=>{const{viewDate:A,value:L=null,onSelect:g,onViewChange:n,minDate:z,maxDate:p,disabledDates:M=[],highlightedDates:Y=[],weekdayLabels:S=s.DEFAULT_WEEKDAYS,firstDayOfWeek:m=s.NUMBER.ZERO,showWeekNumbers:Te=!1,slots:r={},clearable:ae=!0,onClear:h,showTodayButton:te=!0,onToday:x,bis:ne,style:oe,inline:q=!1,className:se,open:I}=P,{openEffect:_,closeEffect:N}=Oe.resolveOverlayEffects(P),i=A.getFullYear(),U=fe.useBearStyles(ne,oe),c=A.getMonth(),ie=b.useMemo(()=>new Date,[]),f=b.useCallback(()=>{n==null||n(new Date(i-s.NUMBER.ONE,c,s.NUMBER.ONE))},[i,c,n]),W=b.useCallback(()=>{n==null||n(new Date(i,c-s.NUMBER.ONE,s.NUMBER.ONE))},[i,c,n]),H=b.useCallback(()=>{n==null||n(new Date(i,c+s.NUMBER.ONE,s.NUMBER.ONE))},[i,c,n]),O=b.useCallback(()=>{n==null||n(new Date(i+s.NUMBER.ONE,c,s.NUMBER.ONE))},[i,c,n]),B=W,j=H,ce={onPrevYear:f,onPrevMonth:W,onNextMonth:H,onNextYear:O},be=b.useCallback(t=>z&&t<z||p&&t>p?!0:M.some(a=>u.isSameDay(a,t)),[z,p,M]),de=b.useCallback(t=>Y.some(a=>u.isSameDay(a,t)),[Y]),le=b.useMemo(()=>u.buildCalendarGrid(i,c,m),[i,c,m]),G=b.useMemo(()=>u.reorderWeekdays(S,m),[S,m]),V=s.MONTHS[c],D=L!=null,ue=q?"Bear-Calendar Bear-Calendar--inline bear-block bear-w-full bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-none bear-border bear-border-zinc-200 dark:bear-border-zinc-700 bear-p-4 bear-text-zinc-900 dark:bear-text-zinc-100":"Bear-Calendar Bear-Calendar--dropdown bear-mt-2 bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-xl bear-border bear-border-zinc-200 dark:bear-border-zinc-700 bear-p-4 bear-w-80 bear-text-zinc-900 dark:bear-text-zinc-100",Z=q?void 0:{zIndex:s.CALENDAR_DROPDOWN_Z_INDEX},he=()=>{if(r.header)return r.header({month:V,year:i,onPrev:B,onNext:j,nav:ce});const t=r.navPrevYear,a=r.navPrev,o=r.navNext,d=r.navNextYear,C=r.headerLabel||De.DefaultHeaderLabel;return e.jsxs("div",{className:"Bear-Calendar__header bear-flex bear-items-center bear-justify-between bear-gap-1 bear-mb-4",children:[e.jsxs("div",{className:"Bear-Calendar__nav-left bear-flex bear-items-center bear-gap-0.5",children:[t?t({onClick:f}):e.jsx("button",{type:"button",onClick:f,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Previous year",children:e.jsx(v.ChevronsLeftIcon,{size:16})}),a?a({onClick:B}):e.jsx("button",{type:"button",onClick:B,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Previous month",children:e.jsx(v.ChevronLeftIcon,{size:16})})]}),C({month:V,year:i}),e.jsxs("div",{className:"Bear-Calendar__nav-right bear-flex bear-items-center bear-gap-0.5",children:[o?o({onClick:j}):e.jsx("button",{type:"button",onClick:j,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Next month",children:e.jsx(v.ChevronRightIcon,{size:16})}),d?d({onClick:O}):e.jsx("button",{type:"button",onClick:O,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Next year",children:e.jsx(v.ChevronsRightIcon,{size:16})})]})]})},xe=()=>{if(r.weekdays)return r.weekdays({days:G});const t=r.weekday;return e.jsx("div",{className:"Bear-Calendar__weekdays bear-grid bear-grid-cols-7 bear-gap-1 bear-mb-2",children:G.map(a=>t?e.jsx("div",{children:t({label:a})},a):e.jsx("div",{className:w.cn("Bear-Calendar__weekday bear-text-center bear-text-xs bear-font-medium bear-uppercase bear-text-zinc-500 dark:bear-text-zinc-400",s.WEEKEND_LABELS.includes(a)&&"bear-text-red-500"),children:a},a))})},_e=(t,a)=>{const{date:o,isCurrentMonth:d}=t,C=o.getDate(),ke=o.getDay(),ve=u.isWeekendDay(ke),y=u.isSameDay(L,o),T=u.isSameDay(ie,o),k=be(o),ee=de(o),re=()=>{k||g==null||g(o)},ge={date:o,day:C,isCurrentMonth:d,isSelected:y,isToday:T,isDisabled:k,isHighlighted:ee,onClick:re};return r.day?e.jsx("span",{children:r.day(ge)},a):e.jsx("button",{type:"button",onClick:re,disabled:k,className:w.cn("Bear-Calendar__day bear-w-8 bear-h-8 bear-rounded-full bear-text-sm bear-font-medium bear-transition-colors bear-flex bear-items-center bear-justify-center",y&&"Bear-Calendar__day--selected bear-bg-primary-500 bear-text-white hover:bear-bg-primary-600",!y&&T&&"Bear-Calendar__day--today bear-ring-2 bear-ring-primary-500/50 bear-bg-transparent",!y&&!T&&(d?ve?"Bear-Calendar__day--weekend bear-text-red-500 dark:bear-text-red-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800":"bear-text-zinc-700 dark:bear-text-zinc-300 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800":"Bear-Calendar__day--other bear-text-zinc-500 dark:bear-text-zinc-600 hover:bear-bg-zinc-50 dark:hover:bear-bg-zinc-800/50"),ee&&!y&&"Bear-Calendar__day--highlighted bear-bg-primary-500/15",k&&"Bear-Calendar__day--disabled bear-opacity-40 bear-cursor-not-allowed"),children:C},a)},Ne=()=>{const t=le.map((a,o)=>_e(a,o));return r.daysGrid?r.daysGrid({children:t,className:"Bear-Calendar__grid bear-grid bear-grid-cols-7 bear-gap-1"}):e.jsx("div",{className:"Bear-Calendar__grid bear-grid bear-grid-cols-7 bear-gap-1",children:t})},ye=()=>{const t=ae&&D&&h,a=te&&x;if(!t&&!a)return null;if(r.footer){const o=r.clearButton,d=r.todayButton;return r.footer({children:e.jsxs("div",{className:"Bear-Calendar__footer bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200 dark:bear-border-zinc-700",children:[t&&o?o({onClick:h,hasSelection:D}):t?e.jsx("button",{type:"button",onClick:h,className:"Bear-Calendar__clear-btn bear-text-sm bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-text-zinc-700 dark:hover:bear-text-zinc-200 bear-transition-colors",children:"Clear"}):e.jsx("span",{}),a&&d?d({onClick:x}):a?e.jsx("button",{type:"button",onClick:x,className:"Bear-Calendar__today-btn bear-text-sm bear-text-primary-600 dark:bear-text-primary-400 hover:bear-text-primary-700 dark:hover:bear-text-primary-300 bear-font-medium",children:"Today"}):null]})})}return r.clearButton&&r.todayButton?e.jsxs("div",{className:"Bear-Calendar__footer bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200 dark:bear-border-zinc-700",children:[t&&r.clearButton({onClick:h,hasSelection:D}),a&&r.todayButton({onClick:x})]}):e.jsxs("div",{className:"Bear-Calendar__footer bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200 dark:bear-border-zinc-700",children:[t?e.jsx("button",{type:"button",onClick:h,className:"Bear-Calendar__clear-btn bear-text-sm bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-text-zinc-700 dark:hover:bear-text-zinc-200 bear-transition-colors",children:"Clear"}):e.jsx("span",{}),a?e.jsx("button",{type:"button",onClick:x,className:"Bear-Calendar__today-btn bear-text-sm bear-text-primary-400 hover:bear-text-primary-300 bear-font-medium bear-transition-colors",children:"Today"}):null]})},K=e.jsxs(e.Fragment,{children:[he(),xe(),Ne(),ye()]}),X=w.cn(ue,se),J=Object.keys(U).length?U:void 0,me=Z?{...J,...Z}:J,R=r.root?r.root({children:K,className:X}):e.jsx("div",{className:X,style:me,children:K}),Ee=I!==void 0,E=I??pe.BOOLEAN_TRUE;if(!(Ee&&(_!==l.OVERLAY_OPEN_EFFECT_NONE||N!==l.OVERLAY_OPEN_EFFECT_NONE)))return R;const Q=E?_:N,$=Q===l.OVERLAY_OPEN_EFFECT_NONE?_===l.OVERLAY_OPEN_EFFECT_NONE?N===l.OVERLAY_OPEN_EFFECT_NONE?void 0:F.OVERLAY_EFFECT_TRANSITION[N]:F.OVERLAY_EFFECT_TRANSITION[_]:F.OVERLAY_EFFECT_TRANSITION[Q],Ce=E&&_===l.OVERLAY_OPEN_EFFECT_NONE||!E&&N===l.OVERLAY_OPEN_EFFECT_NONE;return $?e.jsx(Be.Transition,{show:E,name:$,duration:Ce?ze.ZERO:je.DEFAULT_DURATION,children:R}):R};exports.Calendar=Re;
|
|
@@ -9,7 +9,7 @@ import "../../context/BearProvider.js";
|
|
|
9
9
|
import { OVERLAY_OPEN_EFFECT_NONE as l } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js";
|
|
10
10
|
import { resolveOverlayEffects as we } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.js";
|
|
11
11
|
import "../FormControl/FormControl.context.js";
|
|
12
|
-
import { ChevronsLeftIcon as Oe, ChevronLeftIcon as Te, ChevronRightIcon as Pe, ChevronsRightIcon as Le } from "
|
|
12
|
+
import { ChevronsLeftIcon as Oe, ChevronLeftIcon as Te, ChevronRightIcon as Pe, ChevronsRightIcon as Le } from "@forgedevstack/bear-icons";
|
|
13
13
|
import { OVERLAY_EFFECT_TRANSITION as Y } from "../OverlayPortal/OverlayPortal.const.js";
|
|
14
14
|
import { Transition as Re } from "../Transition/Transition.js";
|
|
15
15
|
import { DEFAULT_DURATION as Ye } from "../Transition/Transition.const.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("../../constants/numbers.const.cjs"),l=require("../../utils/cn.cjs");require("react");const c=require("./Chart.const.cjs"),m=require("./Chart.utils.cjs"),B=w=>{const{data:o,height:R=c.CHART.DEFAULT_HEIGHT,showLabels:x=!0,showValues:C=!1,animated:$=!0,color:j,orientation:v="vertical",barRadius:t=c.CHART.DEFAULT_BAR_RADIUS,barGap:y=c.CHART.DEFAULT_BAR_GAP,stacked:b=!1,className:A,...E}=w,u=o.map(a=>m.getStackTotal(a.stacks,a.value)),N=Math.max(...u,s.ONE),e=v==="vertical";return r.jsx("div",{className:l.cn("Bear-Chart Bear-Chart--bar bear-w-full",A),style:{height:R},...E,children:r.jsx("div",{className:l.cn("bear-h-full",e?"bear-flex bear-items-end bear-justify-between":"bear-flex bear-flex-col bear-justify-between"),style:{gap:`${y}rem`},children:o.map((a,h)=>{const d=b&&a.stacks&&a.stacks.length>s.ZERO?a.stacks:[a.value],n=u[h],f=n/N*c.CHART.VIEWBOX;return r.jsxs("div",{className:l.cn(e?"bear-flex-1 bear-flex bear-flex-col bear-items-center bear-gap-1":"bear-flex-1 bear-flex bear-items-center bear-gap-2"),children:[x&&!e&&r.jsx("span",{className:"bear-w-16 bear-truncate bear-text-xs bear-text-gray-600 dark:bear-text-slate-300",children:a.label}),r.jsx("div",{className:l.cn(e?"bear-w-full bear-flex-1 bear-flex bear-items-end":"bear-flex-1 bear-h-full bear-flex bear-items-center"),children:r.jsx("div",{className:l.cn("bear-flex",e?"bear-w-full bear-flex-col-reverse":"bear-h-3/4 bear-flex-row",$&&(e?"animate-grow-up":"animate-grow-right")),style:e?{height:`${f}%`}:{width:`${f}%`},children:d.map((T,i)=>{const k=n>s.ZERO?T/n*c.CHART.VIEWBOX:s.ZERO,O=i===s.ZERO,p=i===d.length-s.ONE,g=b?e?p?`${t}px ${t}px 0 0`:"0":p?`0 ${t}px ${t}px 0`:"0":e?`${t}px ${t}px 0 0`:`0 ${t}px ${t}px 0`;return r.jsx("div",{className:"bear-transition-all bear-duration-500 bear-ease-out",style:{[e?"height":"width"]:`${k}%`,[e?"width":"height"]:"100%",backgroundColor:m.getChartColor(b?i:h,a.color||j),borderRadius:g,opacity:.9}},`${a.label}-${i}`)})})}),C&&r.jsx("span",{className:"bear-text-xs bear-text-gray-500 dark:bear-text-slate-400",children:n}),x&&e&&r.jsx("span",{className:"bear-max-w-full bear-truncate bear-text-xs bear-text-gray-600 dark:bear-text-slate-300",children:a.label})]},a.label)})})})};exports.BarChart=B;
|
|
@@ -1,65 +1,85 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as V } from "react/jsx-runtime";
|
|
2
|
+
import { ONE as g, ZERO as i } from "../../constants/numbers.const.js";
|
|
3
|
+
import { cn as l } from "../../utils/cn.js";
|
|
3
4
|
import "react";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
5
|
+
import { CHART as s } from "./Chart.const.js";
|
|
6
|
+
import { getStackTotal as _, getChartColor as j } from "./Chart.utils.js";
|
|
7
|
+
const P = (w) => {
|
|
8
|
+
const {
|
|
9
|
+
data: n,
|
|
10
|
+
height: $ = s.DEFAULT_HEIGHT,
|
|
11
|
+
showLabels: x = !0,
|
|
12
|
+
showValues: v = !1,
|
|
13
|
+
animated: N = !0,
|
|
14
|
+
color: k,
|
|
15
|
+
orientation: y = "vertical",
|
|
16
|
+
barRadius: r = s.DEFAULT_BAR_RADIUS,
|
|
17
|
+
barGap: A = s.DEFAULT_BAR_GAP,
|
|
18
|
+
stacked: b = !1,
|
|
19
|
+
className: E,
|
|
20
|
+
...B
|
|
21
|
+
} = w, h = n.map((a) => _(a.stacks, a.value)), C = Math.max(...h, g), e = y === "vertical";
|
|
22
|
+
return /* @__PURE__ */ t("div", { className: l("Bear-Chart Bear-Chart--bar bear-w-full", E), style: { height: $ }, ...B, children: /* @__PURE__ */ t(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: l("bear-h-full", e ? "bear-flex bear-items-end bear-justify-between" : "bear-flex bear-flex-col bear-justify-between"),
|
|
26
|
+
style: { gap: `${A}rem` },
|
|
27
|
+
children: n.map((a, f) => {
|
|
28
|
+
const d = b && a.stacks && a.stacks.length > i ? a.stacks : [a.value], c = h[f], p = c / C * s.VIEWBOX;
|
|
29
|
+
return /* @__PURE__ */ V(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: l(
|
|
33
|
+
e ? "bear-flex-1 bear-flex bear-flex-col bear-items-center bear-gap-1" : "bear-flex-1 bear-flex bear-items-center bear-gap-2"
|
|
34
|
+
),
|
|
35
|
+
children: [
|
|
36
|
+
x && !e && /* @__PURE__ */ t("span", { className: "bear-w-16 bear-truncate bear-text-xs bear-text-gray-600 dark:bear-text-slate-300", children: a.label }),
|
|
37
|
+
/* @__PURE__ */ t(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: l(
|
|
41
|
+
e ? "bear-w-full bear-flex-1 bear-flex bear-items-end" : "bear-flex-1 bear-h-full bear-flex bear-items-center"
|
|
42
|
+
),
|
|
43
|
+
children: /* @__PURE__ */ t(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: l(
|
|
47
|
+
"bear-flex",
|
|
48
|
+
e ? "bear-w-full bear-flex-col-reverse" : "bear-h-3/4 bear-flex-row",
|
|
49
|
+
N && (e ? "animate-grow-up" : "animate-grow-right")
|
|
50
|
+
),
|
|
51
|
+
style: e ? { height: `${p}%` } : { width: `${p}%` },
|
|
52
|
+
children: d.map((R, o) => {
|
|
53
|
+
const T = c > i ? R / c * s.VIEWBOX : i, L = o === i, m = o === d.length - g, u = b ? e ? m ? `${r}px ${r}px 0 0` : "0" : m ? `0 ${r}px ${r}px 0` : "0" : e ? `${r}px ${r}px 0 0` : `0 ${r}px ${r}px 0`;
|
|
54
|
+
return /* @__PURE__ */ t(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: "bear-transition-all bear-duration-500 bear-ease-out",
|
|
58
|
+
style: {
|
|
59
|
+
[e ? "height" : "width"]: `${T}%`,
|
|
60
|
+
[e ? "width" : "height"]: "100%",
|
|
61
|
+
backgroundColor: j(b ? o : f, a.color || k),
|
|
62
|
+
borderRadius: u,
|
|
63
|
+
opacity: 0.9
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
`${a.label}-${o}`
|
|
67
|
+
);
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
v && /* @__PURE__ */ t("span", { className: "bear-text-xs bear-text-gray-500 dark:bear-text-slate-400", children: c }),
|
|
74
|
+
x && e && /* @__PURE__ */ t("span", { className: "bear-max-w-full bear-truncate bear-text-xs bear-text-gray-600 dark:bear-text-slate-300", children: a.label })
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
a.label
|
|
78
|
+
);
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
) });
|
|
62
82
|
};
|
|
63
83
|
export {
|
|
64
|
-
|
|
84
|
+
P as BarChart
|
|
65
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("./BarChart.cjs"),C=require("./LineChart.cjs"),n=require("./PieChart.cjs"),i=require("./RadarChart.cjs"),A=require("./FunnelChart.cjs"),t=require("./Chart.const.cjs"),s={[t.CHART_TYPES.BAR]:r=>e.jsx(a.BarChart,{...r}),[t.CHART_TYPES.STACKED]:r=>e.jsx(a.BarChart,{...r,stacked:!0}),[t.CHART_TYPES.LINE]:r=>e.jsx(C.LineChart,{...r}),[t.CHART_TYPES.AREA]:r=>e.jsx(C.LineChart,{...r,fill:!0}),[t.CHART_TYPES.PIE]:r=>e.jsx(n.PieChart,{...r}),[t.CHART_TYPES.DONUT]:r=>e.jsx(n.PieChart,{...r,innerRadius:t.CHART.DEFAULT_INNER_RADIUS}),[t.CHART_TYPES.RADAR]:r=>e.jsx(i.RadarChart,{...r}),[t.CHART_TYPES.FUNNEL]:r=>e.jsx(A.FunnelChart,{...r})},E=r=>{const{type:R,...T}=r;return(s[R]??s[t.CHART_TYPES.BAR])(T)};exports.Chart=E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E={DEFAULT_HEIGHT:200,DEFAULT_BAR_RADIUS:4,DEFAULT_BAR_GAP:.2,DEFAULT_STROKE_WIDTH:2,DEFAULT_INNER_RADIUS:.6,DEFAULT_START_ANGLE:-90,DEFAULT_PAD_ANGLE:2,OUTER_RADIUS:45,CENTER:50,HALF_SWEEP:180,FULL_SWEEP:360,EXPLODE_OFFSET:4,ROSE_MIN_RADIUS:14,RADAR_RINGS:4,RADAR_LABEL_OFFSET:8,FUNNEL_MIN_WIDTH:18,SLICE_DELAY_MS:100,DOT_RADIUS:1.5,VIEWBOX:100,LINE_Y_RANGE:80,LINE_Y_PAD:10,BEZIER_DIVISOR:3,LARGE_ARC_THRESHOLD:180,HALF_PIE_START:-180},_={BAR:"bar",LINE:"line",AREA:"area",PIE:"pie",DONUT:"donut",RADAR:"radar",FUNNEL:"funnel",STACKED:"stacked"},A="full",R="half",T="rose",L="bottom",I="none",D=["#ec4899","#8b5cf6","#3b82f6","#10b981","#f59e0b","#ef4444","#06b6d4","#84cc16"];exports.CHART=E;exports.CHART_LEGEND_BOTTOM=L;exports.CHART_LEGEND_NONE=I;exports.CHART_TYPES=_;exports.DEFAULT_COLORS=D;exports.PIE_VIEW_FULL=A;exports.PIE_VIEW_HALF=R;exports.PIE_VIEW_ROSE=T;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chart constants
|
|
3
|
-
*/
|
|
4
1
|
export declare const CHART: {
|
|
5
2
|
readonly DEFAULT_HEIGHT: 200;
|
|
6
3
|
readonly DEFAULT_BAR_RADIUS: 4;
|
|
@@ -11,6 +8,21 @@ export declare const CHART: {
|
|
|
11
8
|
readonly DEFAULT_PAD_ANGLE: 2;
|
|
12
9
|
readonly OUTER_RADIUS: 45;
|
|
13
10
|
readonly CENTER: 50;
|
|
11
|
+
readonly HALF_SWEEP: 180;
|
|
12
|
+
readonly FULL_SWEEP: 360;
|
|
13
|
+
readonly EXPLODE_OFFSET: 4;
|
|
14
|
+
readonly ROSE_MIN_RADIUS: 14;
|
|
15
|
+
readonly RADAR_RINGS: 4;
|
|
16
|
+
readonly RADAR_LABEL_OFFSET: 8;
|
|
17
|
+
readonly FUNNEL_MIN_WIDTH: 18;
|
|
18
|
+
readonly SLICE_DELAY_MS: 100;
|
|
19
|
+
readonly DOT_RADIUS: 1.5;
|
|
20
|
+
readonly VIEWBOX: 100;
|
|
21
|
+
readonly LINE_Y_RANGE: 80;
|
|
22
|
+
readonly LINE_Y_PAD: 10;
|
|
23
|
+
readonly BEZIER_DIVISOR: 3;
|
|
24
|
+
readonly LARGE_ARC_THRESHOLD: 180;
|
|
25
|
+
readonly HALF_PIE_START: -180;
|
|
14
26
|
};
|
|
15
27
|
export declare const CHART_TYPES: {
|
|
16
28
|
readonly BAR: "bar";
|
|
@@ -18,5 +30,14 @@ export declare const CHART_TYPES: {
|
|
|
18
30
|
readonly AREA: "area";
|
|
19
31
|
readonly PIE: "pie";
|
|
20
32
|
readonly DONUT: "donut";
|
|
33
|
+
readonly RADAR: "radar";
|
|
34
|
+
readonly FUNNEL: "funnel";
|
|
35
|
+
readonly STACKED: "stacked";
|
|
21
36
|
};
|
|
37
|
+
export declare const PIE_VIEW_FULL = "full";
|
|
38
|
+
export declare const PIE_VIEW_HALF = "half";
|
|
39
|
+
export declare const PIE_VIEW_ROSE = "rose";
|
|
40
|
+
export declare const CHART_LEGEND_RIGHT = "right";
|
|
41
|
+
export declare const CHART_LEGEND_BOTTOM = "bottom";
|
|
42
|
+
export declare const CHART_LEGEND_NONE = "none";
|
|
22
43
|
export declare const DEFAULT_COLORS: readonly ["#ec4899", "#8b5cf6", "#3b82f6", "#10b981", "#f59e0b", "#ef4444", "#06b6d4", "#84cc16"];
|