@forgedevstack/bear 1.0.8 → 1.1.0
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 +11 -1
- package/dist/components/ActivityItem/ActivityItem.cjs +1 -1
- package/dist/components/ActivityItem/ActivityItem.js +1 -0
- package/dist/components/Alert/Alert.const.cjs +1 -1
- package/dist/components/Alert/Alert.const.js +3 -2
- package/dist/components/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.js +3 -2
- package/dist/components/Badge/Badge.cjs +1 -1
- package/dist/components/Badge/Badge.js +15 -14
- package/dist/components/BearLogo/EmberLogo.cjs +1 -1
- package/dist/components/BearLogo/EmberLogo.js +3 -2
- package/dist/components/BottomNavigation/BottomNavigation.cjs +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.js +3 -2
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.js +56 -55
- package/dist/components/Button/Button.types.d.ts +7 -0
- package/dist/components/Carousel/Carousel.cjs +1 -1
- package/dist/components/Carousel/Carousel.const.cjs +1 -0
- package/dist/components/Carousel/Carousel.const.d.ts +12 -0
- package/dist/components/Carousel/Carousel.const.js +9 -0
- package/dist/components/Carousel/Carousel.d.ts +14 -3
- package/dist/components/Carousel/Carousel.js +222 -75
- package/dist/components/Carousel/Carousel.types.d.ts +32 -2
- package/dist/components/Carousel/index.d.ts +1 -1
- package/dist/components/Chip/Chip.cjs +1 -1
- package/dist/components/Chip/Chip.js +3 -2
- package/dist/components/CodeEditor/CodeEditor.cjs +5 -0
- package/dist/components/CodeEditor/CodeEditor.const.cjs +1 -0
- package/dist/components/CodeEditor/CodeEditor.const.d.ts +21 -0
- package/dist/components/CodeEditor/CodeEditor.const.js +119 -0
- package/dist/components/CodeEditor/CodeEditor.d.ts +22 -0
- package/dist/components/CodeEditor/CodeEditor.js +250 -0
- package/dist/components/CodeEditor/CodeEditor.types.d.ts +80 -0
- package/dist/components/CodeEditor/CodeEditor.utils.cjs +1 -0
- package/dist/components/CodeEditor/CodeEditor.utils.d.ts +6 -0
- package/dist/components/CodeEditor/CodeEditor.utils.js +75 -0
- package/dist/components/CodeEditor/index.d.ts +2 -0
- package/dist/components/Columns/Columns.cjs +1 -1
- package/dist/components/Columns/Columns.js +9 -8
- package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.cjs +1 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.d.ts +27 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.js +35 -0
- package/dist/components/CountdownTimer/CountdownTimer.d.ts +7 -0
- package/dist/components/CountdownTimer/CountdownTimer.js +115 -0
- package/dist/components/CountdownTimer/CountdownTimer.types.d.ts +56 -0
- package/dist/components/CountdownTimer/index.d.ts +2 -0
- package/dist/components/Cropper/Cropper.cjs +1 -0
- package/dist/components/Cropper/Cropper.const.cjs +1 -0
- package/dist/components/Cropper/Cropper.const.d.ts +31 -0
- package/dist/components/Cropper/Cropper.const.js +33 -0
- package/dist/components/Cropper/Cropper.d.ts +21 -0
- package/dist/components/Cropper/Cropper.js +362 -0
- package/dist/components/Cropper/Cropper.types.d.ts +72 -0
- package/dist/components/Cropper/index.d.ts +2 -0
- package/dist/components/DataTable/DataTable.cjs +1 -1
- package/dist/components/DataTable/DataTable.js +5 -4
- package/dist/components/Divider/Divider.cjs +1 -1
- package/dist/components/Divider/Divider.js +15 -14
- package/dist/components/Dock/Dock.cjs +1 -0
- package/dist/components/Dock/Dock.const.cjs +1 -0
- package/dist/components/Dock/Dock.const.d.ts +25 -0
- package/dist/components/Dock/Dock.const.js +22 -0
- package/dist/components/Dock/Dock.d.ts +7 -0
- package/dist/components/Dock/Dock.js +144 -0
- package/dist/components/Dock/Dock.types.d.ts +42 -0
- package/dist/components/Dock/index.d.ts +2 -0
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.js +7 -6
- package/dist/components/FileTree/FileTree.cjs +1 -0
- package/dist/components/FileTree/FileTree.d.ts +3 -0
- package/dist/components/FileTree/FileTree.js +46 -0
- package/dist/components/FileTree/FileTree.types.d.ts +30 -0
- package/dist/components/FileTree/index.d.ts +2 -0
- package/dist/components/GradientText/GradientText.cjs +1 -0
- package/dist/components/GradientText/GradientText.const.cjs +1 -0
- package/dist/components/GradientText/GradientText.const.d.ts +15 -0
- package/dist/components/GradientText/GradientText.const.js +36 -0
- package/dist/components/GradientText/GradientText.d.ts +7 -0
- package/dist/components/GradientText/GradientText.js +52 -0
- package/dist/components/GradientText/GradientText.types.d.ts +27 -0
- package/dist/components/GradientText/index.d.ts +2 -0
- package/dist/components/Highlight/Highlight.cjs +1 -1
- package/dist/components/Highlight/Highlight.const.cjs +1 -0
- package/dist/components/Highlight/Highlight.const.d.ts +8 -0
- package/dist/components/Highlight/Highlight.const.js +15 -0
- package/dist/components/Highlight/Highlight.d.ts +4 -0
- package/dist/components/Highlight/Highlight.js +32 -24
- package/dist/components/Highlight/Highlight.types.d.ts +9 -1
- package/dist/components/Highlight/index.d.ts +1 -1
- package/dist/components/Icon/Icon.cjs +1 -1
- package/dist/components/Icon/Icon.js +17 -16
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.js +12 -11
- package/dist/components/Kbd/Kbd.cjs +1 -1
- package/dist/components/Kbd/Kbd.js +17 -16
- package/dist/components/Map/Map.cjs +1 -0
- package/dist/components/Map/Map.const.cjs +1 -0
- package/dist/components/Map/Map.const.d.ts +20 -0
- package/dist/components/Map/Map.const.js +26 -0
- package/dist/components/Map/Map.d.ts +20 -0
- package/dist/components/Map/Map.js +259 -0
- package/dist/components/Map/Map.types.d.ts +81 -0
- package/dist/components/Map/index.d.ts +2 -0
- package/dist/components/Marquee/Marquee.cjs +1 -0
- package/dist/components/Marquee/Marquee.const.cjs +1 -0
- package/dist/components/Marquee/Marquee.const.d.ts +11 -0
- package/dist/components/Marquee/Marquee.const.js +12 -0
- package/dist/components/Marquee/Marquee.d.ts +7 -0
- package/dist/components/Marquee/Marquee.js +106 -0
- package/dist/components/Marquee/Marquee.types.d.ts +32 -0
- package/dist/components/Marquee/index.d.ts +2 -0
- package/dist/components/Masonry/Masonry.cjs +1 -0
- package/dist/components/Masonry/Masonry.const.cjs +1 -0
- package/dist/components/Masonry/Masonry.const.d.ts +9 -0
- package/dist/components/Masonry/Masonry.const.js +9 -0
- package/dist/components/Masonry/Masonry.d.ts +7 -0
- package/dist/components/Masonry/Masonry.js +51 -0
- package/dist/components/Masonry/Masonry.types.d.ts +21 -0
- package/dist/components/Masonry/index.d.ts +2 -0
- package/dist/components/NavigableSelect/NavigableSelect.cjs +1 -0
- package/dist/components/NavigableSelect/NavigableSelect.const.cjs +1 -0
- package/dist/components/NavigableSelect/NavigableSelect.const.d.ts +23 -0
- package/dist/components/NavigableSelect/NavigableSelect.const.js +33 -0
- package/dist/components/NavigableSelect/NavigableSelect.d.ts +7 -0
- package/dist/components/NavigableSelect/NavigableSelect.js +361 -0
- package/dist/components/NavigableSelect/NavigableSelect.types.d.ts +56 -0
- package/dist/components/NavigableSelect/index.d.ts +2 -0
- package/dist/components/Progress/Progress.cjs +1 -1
- package/dist/components/Progress/Progress.js +3 -2
- package/dist/components/ResizablePanel/ResizablePanel.cjs +1 -0
- package/dist/components/ResizablePanel/ResizablePanel.const.cjs +1 -0
- package/dist/components/ResizablePanel/ResizablePanel.const.d.ts +11 -0
- package/dist/components/ResizablePanel/ResizablePanel.const.js +11 -0
- package/dist/components/ResizablePanel/ResizablePanel.d.ts +17 -0
- package/dist/components/ResizablePanel/ResizablePanel.js +70 -0
- package/dist/components/ResizablePanel/ResizablePanel.types.d.ts +21 -0
- package/dist/components/ResizablePanel/ResizablePanel.utils.cjs +1 -0
- package/dist/components/ResizablePanel/ResizablePanel.utils.d.ts +10 -0
- package/dist/components/ResizablePanel/ResizablePanel.utils.js +11 -0
- package/dist/components/ResizablePanel/index.d.ts +2 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.cjs +1 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.const.cjs +1 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.const.d.ts +2 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.const.js +5 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.d.ts +3 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.js +60 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.types.d.ts +15 -0
- package/dist/components/ResizableTextarea/index.d.ts +2 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.js +3 -2
- package/dist/components/ScrollArea/ScrollArea.cjs +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +3 -2
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.js +13 -12
- package/dist/components/Spinner/Spinner.cjs +1 -1
- package/dist/components/Spinner/Spinner.js +3 -2
- package/dist/components/Spotlight/Spotlight.cjs +1 -0
- package/dist/components/Spotlight/Spotlight.const.cjs +1 -0
- package/dist/components/Spotlight/Spotlight.const.d.ts +18 -0
- package/dist/components/Spotlight/Spotlight.const.js +9 -0
- package/dist/components/Spotlight/Spotlight.d.ts +7 -0
- package/dist/components/Spotlight/Spotlight.js +220 -0
- package/dist/components/Spotlight/Spotlight.types.d.ts +51 -0
- package/dist/components/Spotlight/index.d.ts +2 -0
- package/dist/components/StatCard/StatCard.cjs +1 -1
- package/dist/components/StatCard/StatCard.js +9 -8
- package/dist/components/Statistic/Statistic.cjs +1 -1
- package/dist/components/Statistic/Statistic.js +7 -6
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.js +11 -10
- package/dist/components/TimePicker/components/TimePickerColumnsDropdown/TimePickerColumnsDropdown.cjs +1 -1
- package/dist/components/TimePicker/components/TimePickerColumnsDropdown/TimePickerColumnsDropdown.js +16 -15
- package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
- package/dist/components/TimePicker/helpers/ClockFaceSvg.js +13 -12
- package/dist/components/Transition/Transition.cjs +1 -0
- package/dist/components/Transition/Transition.const.cjs +1 -0
- package/dist/components/Transition/Transition.const.d.ts +15 -0
- package/dist/components/Transition/Transition.const.js +73 -0
- package/dist/components/Transition/Transition.d.ts +37 -0
- package/dist/components/Transition/Transition.js +107 -0
- package/dist/components/Transition/Transition.types.d.ts +69 -0
- package/dist/components/Transition/index.d.ts +2 -0
- package/dist/components/Typewriter/Typewriter.cjs +1 -0
- package/dist/components/Typewriter/Typewriter.const.cjs +1 -0
- package/dist/components/Typewriter/Typewriter.const.d.ts +22 -0
- package/dist/components/Typewriter/Typewriter.const.js +11 -0
- package/dist/components/Typewriter/Typewriter.d.ts +7 -0
- package/dist/components/Typewriter/Typewriter.js +88 -0
- package/dist/components/Typewriter/Typewriter.types.d.ts +32 -0
- package/dist/components/Typewriter/index.d.ts +2 -0
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.const.cjs +1 -0
- package/dist/components/Typography/Typography.const.d.ts +22 -0
- package/dist/components/Typography/Typography.const.js +91 -0
- package/dist/components/Typography/Typography.js +75 -138
- package/dist/components/Typography/Typography.types.d.ts +17 -0
- package/dist/components/Watermark/Watermark.cjs +1 -0
- package/dist/components/Watermark/Watermark.const.cjs +1 -0
- package/dist/components/Watermark/Watermark.const.d.ts +30 -0
- package/dist/components/Watermark/Watermark.const.js +18 -0
- package/dist/components/Watermark/Watermark.d.ts +7 -0
- package/dist/components/Watermark/Watermark.js +96 -0
- package/dist/components/Watermark/Watermark.types.d.ts +35 -0
- package/dist/components/Watermark/index.d.ts +2 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +33 -1
- package/dist/components/index.js +270 -237
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +24 -19
- package/dist/hooks/useAnimate.cjs +1 -0
- package/dist/hooks/useAnimate.d.ts +61 -0
- package/dist/hooks/useAnimate.js +125 -0
- package/dist/hooks/useResponsive.cjs +1 -0
- package/dist/hooks/useResponsive.d.ts +35 -0
- package/dist/hooks/useResponsive.js +74 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +335 -295
- package/dist/styles.css +1 -1
- package/dist/utils/createSlots.cjs +1 -0
- package/dist/utils/createSlots.d.ts +70 -0
- package/dist/utils/createSlots.js +65 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,6 +62,7 @@ function App() {
|
|
|
62
62
|
- `Container` - Responsive container with max-width constraints
|
|
63
63
|
- `Flex` - Flexible box layout component
|
|
64
64
|
- `Grid` / `GridItem` - CSS Grid layout system
|
|
65
|
+
- `ResizablePanel` - Two-pane resizable layout with draggable divider (horizontal/vertical)
|
|
65
66
|
|
|
66
67
|
### UI Components
|
|
67
68
|
|
|
@@ -70,7 +71,7 @@ function App() {
|
|
|
70
71
|
- `Badge` - Status indicators and labels
|
|
71
72
|
- `Paper` - Elevated surface component
|
|
72
73
|
- `Divider` - Visual separator
|
|
73
|
-
- `Typography` - Text styling
|
|
74
|
+
- `Typography` - Text styling with gradient text and typewriter effect
|
|
74
75
|
- `Link` - Styled link component
|
|
75
76
|
|
|
76
77
|
### Form Components
|
|
@@ -120,6 +121,7 @@ function App() {
|
|
|
120
121
|
- `Avatar` / `AvatarGroup` - User avatar display
|
|
121
122
|
- `Chip` - Compact element for input, attribute, or action
|
|
122
123
|
- `TreeView` - Hierarchical tree structure
|
|
124
|
+
- `FileTree` - File/folder tree with selection and expand/collapse
|
|
123
125
|
- `Timeline` - Timeline component
|
|
124
126
|
- `Statistic` - Statistical display
|
|
125
127
|
- `EmptyState` - Empty state placeholder
|
|
@@ -153,8 +155,16 @@ import { Button } from '@forgedevstack/bear';
|
|
|
153
155
|
<Button variant="secondary">Secondary</Button>
|
|
154
156
|
<Button variant="outline">Outline</Button>
|
|
155
157
|
<Button variant="ghost">Ghost</Button>
|
|
158
|
+
|
|
159
|
+
// With icon (icon size matches text)
|
|
160
|
+
<Button variant="primary" leftIcon={<PlayIcon />}>View Demos</Button>
|
|
161
|
+
|
|
162
|
+
// Button label using Typography variant (h1, h2, body1, etc.)
|
|
163
|
+
<Button variant="primary" textVariant="subtitle1">Heading-style label</Button>
|
|
156
164
|
```
|
|
157
165
|
|
|
166
|
+
**Custom variants** (via `BearProvider`): pass `customVariants={{ myBrand: { bg: '#...', text: '#fff' } }}` and use `<Button variant="myBrand">`. Use `customTypography` for custom text styles and set `textVariant` on Button to use them.
|
|
167
|
+
|
|
158
168
|
### Card
|
|
159
169
|
|
|
160
170
|
```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("../../utils/cn.cjs");require("react");const m=({icon:s,iconBg:r="rgba(16, 185, 129, 0.2)",title:a,description:i,user:t,time:l,onClick:c,className:n,...x})=>e.jsxs("div",{className:d.cn("flex items-start gap-4 p-4 hover:bg-slate-700/30 dark:hover:bg-slate-700/30 rounded-xl transition-colors cursor-pointer",n),onClick:c,...x,children:[e.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-xl flex-shrink-0",style:{background:r},children:s}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-gray-900 dark:text-white font-medium truncate",children:a}),e.jsx("p",{className:"text-gray-500 dark:text-slate-400 text-sm truncate",children:i})]}),e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsx("p",{className:"text-gray-500 dark:text-slate-400 text-sm",children:l}),t&&e.jsx("p",{className:"text-gray-400 dark:text-slate-500 text-xs",children:t})]})]});exports.ActivityItem=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../utils/cn.cjs");require("react");const a={filled:e=>r.cn("bear-text-white bear-alert-filled",e==="success"&&"bear-alert-filled-success",e==="info"&&"bear-alert-filled-info",e==="warning"&&"bear-alert-filled-warning",e==="error"&&"bear-alert-filled-error"),outlined:()=>"bear-bg-transparent bear-border",standard:()=>""},l={SEVERITY:"info",VARIANT:"standard",SHOW_ICON:!0,CLOSABLE:!1};exports.ALERT_DEFAULTS=l;exports.ALERT_VARIANT_CLASSES=a;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/cn.js";
|
|
2
|
-
|
|
2
|
+
import "react";
|
|
3
|
+
const t = {
|
|
3
4
|
filled: (r) => e(
|
|
4
5
|
"bear-text-white bear-alert-filled",
|
|
5
6
|
r === "success" && "bear-alert-filled-success",
|
|
@@ -17,5 +18,5 @@ const l = {
|
|
|
17
18
|
};
|
|
18
19
|
export {
|
|
19
20
|
n as ALERT_DEFAULTS,
|
|
20
|
-
|
|
21
|
+
t as ALERT_VARIANT_CLASSES
|
|
21
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("../../utils/cn.cjs");require("react");const u=({children:a,position:t="sticky",variant:b="default",color:r="primary",className:s,leftContent:i,rightContent:l,centerContent:c,elevation:n=!0})=>{const d={fixed:"bear-fixed bear-top-0 bear-left-0 bear-right-0 bear-z-50",sticky:"bear-sticky bear-top-0 bear-z-50",static:"bear-static",relative:"bear-relative"},o={default:"",transparent:"bear-bg-transparent",blur:"bear-backdrop-blur-md"},p={default:"bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",primary:"bear-bg-pink-600 bear-text-white",dark:"bear-bg-gray-900 bear-text-white dark:bear-bg-black"},x=n?"bear-shadow-md bear-border-b bear-border-gray-200/10":"";return e.jsx("header",{className:m.cn("Bear-AppBar","bear-w-full bear-h-16 bear-px-4 bear-flex bear-items-center",d[t],o[b],p[r],x,s),style:{backgroundColor:r==="primary"?"var(--bear-primary-600)":void 0},children:a??e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bear-flex bear-items-center bear-gap-4",children:i}),e.jsx("div",{className:"bear-flex-1 bear-flex bear-items-center bear-justify-center",children:c}),e.jsx("div",{className:"bear-flex bear-items-center bear-gap-4",children:l})]})})};exports.AppBar=u;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as f, Fragment as x } from "react/jsx-runtime";
|
|
2
2
|
import { cn as g } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const u = ({
|
|
4
5
|
children: a,
|
|
5
6
|
position: t = "sticky",
|
|
6
7
|
variant: b = "default",
|
|
@@ -49,5 +50,5 @@ const k = ({
|
|
|
49
50
|
);
|
|
50
51
|
};
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
+
u as AppBar
|
|
53
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("../../utils/cn.cjs");require("react");const e=require("./Badge.constants.cjs"),u=({variant:s="neutral",size:n="sm",pill:t=!1,dot:d=!1,className:l,children:o,testId:i,...c})=>a.jsxs("span",{className:r.cn("Bear-Badge","bear-inline-flex bear-items-center bear-gap-1.5 bear-font-medium",e.sizeClasses[n],e.variantClasses[s],t?"Bear-Badge--pill bear-rounded-full":"bear-rounded-md",l),"data-testid":i,...c,children:[d&&a.jsx("span",{className:r.cn("Bear-Badge__dot",e.BADGE_DOT_SIZE_CLASSES,"bear-rounded-full",e.dotVariantColors[s])}),a.jsx("span",{className:"Bear-Badge__content",children:o})]});exports.Badge=u;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cn as r } from "../../utils/cn.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
import { dotVariantColors as p, BADGE_DOT_SIZE_CLASSES as B, variantClasses as f, sizeClasses as c } from "./Badge.constants.js";
|
|
5
|
+
const x = ({
|
|
5
6
|
variant: e = "neutral",
|
|
6
7
|
size: s = "sm",
|
|
7
|
-
pill:
|
|
8
|
-
dot:
|
|
9
|
-
className:
|
|
10
|
-
children:
|
|
8
|
+
pill: t = !1,
|
|
9
|
+
dot: d = !1,
|
|
10
|
+
className: l,
|
|
11
|
+
children: n,
|
|
11
12
|
testId: o,
|
|
12
13
|
...m
|
|
13
14
|
}) => /* @__PURE__ */ i(
|
|
@@ -17,28 +18,28 @@ const g = ({
|
|
|
17
18
|
"Bear-Badge",
|
|
18
19
|
"bear-inline-flex bear-items-center bear-gap-1.5 bear-font-medium",
|
|
19
20
|
c[s],
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
f[e],
|
|
22
|
+
t ? "Bear-Badge--pill bear-rounded-full" : "bear-rounded-md",
|
|
23
|
+
l
|
|
23
24
|
),
|
|
24
25
|
"data-testid": o,
|
|
25
26
|
...m,
|
|
26
27
|
children: [
|
|
27
|
-
|
|
28
|
+
d && /* @__PURE__ */ a(
|
|
28
29
|
"span",
|
|
29
30
|
{
|
|
30
31
|
className: r(
|
|
31
32
|
"Bear-Badge__dot",
|
|
32
|
-
|
|
33
|
+
B,
|
|
33
34
|
"bear-rounded-full",
|
|
34
|
-
|
|
35
|
+
p[e]
|
|
35
36
|
)
|
|
36
37
|
}
|
|
37
38
|
),
|
|
38
|
-
/* @__PURE__ */ a("span", { className: "Bear-Badge__content", children:
|
|
39
|
+
/* @__PURE__ */ a("span", { className: "Bear-Badge__content", children: n })
|
|
39
40
|
]
|
|
40
41
|
}
|
|
41
42
|
);
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
x as Badge
|
|
44
45
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../utils/cn.cjs");require("react");const t=({size:r=48,className:o,animated:s=!1})=>e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",className:l.cn("bear-logo",s&&"bear-animate-bear-glow",o),children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"emberFlameGrad",x1:"50%",y1:"100%",x2:"50%",y2:"0%",children:[e.jsx("stop",{offset:"0%",stopColor:"#ea580c"}),e.jsx("stop",{offset:"30%",stopColor:"#f97316"}),e.jsx("stop",{offset:"60%",stopColor:"#fb923c"}),e.jsx("stop",{offset:"100%",stopColor:"#fed7aa"})]}),e.jsxs("linearGradient",{id:"emberCoreGrad",x1:"50%",y1:"100%",x2:"50%",y2:"0%",children:[e.jsx("stop",{offset:"0%",stopColor:"#f97316"}),e.jsx("stop",{offset:"50%",stopColor:"#fbbf24"}),e.jsx("stop",{offset:"100%",stopColor:"#fef3c7"})]}),e.jsxs("filter",{id:"emberGlow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[e.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),e.jsxs("feMerge",{children:[e.jsx("feMergeNode",{in:"coloredBlur"}),e.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),e.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"#1a1a2e",stroke:"url(#emberFlameGrad)",strokeWidth:"2"}),e.jsx("path",{d:`M50 15
|
|
2
2
|
C35 30 25 45 25 60
|
|
3
3
|
C25 75 35 85 50 85
|
|
4
4
|
C65 85 75 75 75 60
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const n = ({
|
|
4
5
|
size: o = 48,
|
|
5
6
|
className: l,
|
|
6
7
|
animated: f = !1
|
|
@@ -87,5 +88,5 @@ const c = ({
|
|
|
87
88
|
}
|
|
88
89
|
);
|
|
89
90
|
export {
|
|
90
|
-
|
|
91
|
+
n as EmberLogo
|
|
91
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),b=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),b=require("../../utils/cn.cjs");require("react");const u=({items:n,value:s,onChange:t,showLabels:i="active",variant:l="default",className:c})=>{const d={default:"bear-bg-zinc-900 bear-border-t bear-border-zinc-800",elevated:"bear-bg-zinc-900 bear-shadow-[0_-4px_20px_rgba(0,0,0,0.3)]",transparent:"bear-bg-zinc-900/80 bear-backdrop-blur-md bear-border-t bear-border-zinc-800/50"},o=e=>i===!0||i==="always"?!0:i==="active"?e:!1;return r.jsx("nav",{className:b.cn("bear-fixed bear-bottom-0 bear-left-0 bear-right-0 bear-z-50 bear-h-16 bear-flex bear-items-center bear-justify-around bear-px-2",d[l],c),children:n.map(e=>{const a=s===e.id;return r.jsxs("button",{onClick:()=>!e.disabled&&(t==null?void 0:t(e.id)),disabled:e.disabled,className:b.cn("bear-flex bear-flex-col bear-items-center bear-justify-center bear-flex-1 bear-h-full bear-py-2 bear-transition-all",a?"bear-text-pink-400":"bear-text-zinc-500 hover:bear-text-zinc-300",e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:[r.jsxs("div",{className:"bear-relative",children:[r.jsx("span",{className:b.cn("bear-transition-transform",a&&"bear-scale-110"),children:e.icon}),e.badge!==void 0&&r.jsx("span",{className:"bear-absolute -bear-top-1 -bear-right-1 bear-min-w-[16px] bear-h-4 bear-px-1 bear-flex bear-items-center bear-justify-center bear-text-xs bear-font-medium bear-bg-pink-500 bear-text-white bear-rounded-full",children:e.badge})]}),o(a)&&r.jsx("span",{className:b.cn("bear-text-xs bear-mt-1 bear-transition-all",a?"bear-font-medium":""),children:e.label})]},e.id)})})};exports.BottomNavigation=u;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { cn as b } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const m = ({
|
|
4
5
|
items: n,
|
|
5
6
|
value: s,
|
|
6
7
|
onChange: t,
|
|
@@ -45,5 +46,5 @@ const p = ({
|
|
|
45
46
|
}) });
|
|
46
47
|
};
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
+
m as BottomNavigation
|
|
49
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("react"),A=require("../../utils/cn.cjs"),re=require("../Spinner/Spinner.cjs"),ne=require("../Typography/Typography.cjs"),se=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const oe=require("../../context/BearProvider.cjs"),b=require("./Button.constants.cjs"),V=B=>B in b.BUTTON_VARIANT,k=r.forwardRef((B,i)=>{var w,j;const{variant:e="primary",size:C="md",loading:d=!1,fullWidth:q=!1,icon:g,iconPosition:N="left",leftIcon:M,rightIcon:P,textVariant:z="inherit",spotlight:l=!1,spotlightColor:E="rgba(255, 255, 255, 0.35)",spotlightSize:f=150,disabled:U,className:O,children:D,testId:L,bis:F,style:H,onMouseMove:h,onMouseEnter:m,onMouseLeave:p,...X}=B,Y=U||d,v=se.useBearStyles(F,H),S=M??(g&&N==="left"?g:void 0),I=P??(g&&N==="right"?g:void 0),o=r.useContext(oe.BearContext),y=((j=(w=o==null?void 0:o.components)==null?void 0:w.Button)==null?void 0:j.root)||{},T=(o==null?void 0:o.customVariants)||{},x=!V(e)&&e in T,n=x?T[e]:null,c=r.useRef(null),[R,_]=r.useState({x:-1e3,y:-1e3}),[W,$]=r.useState(!1),Z=r.useCallback(t=>{if(l&&c.current){const u=c.current.getBoundingClientRect(),ee=t.clientX-u.left,te=t.clientY-u.top;_({x:ee,y:te})}h==null||h(t)},[l,h]),G=r.useCallback(t=>{if(l&&($(!0),c.current)){const u=c.current.getBoundingClientRect();_({x:t.clientX-u.left,y:t.clientY-u.top})}m==null||m(t)},[l,m]),J=r.useCallback(t=>{$(!1),_({x:-1e3,y:-1e3}),p==null||p(t)},[p]),a=b.VARIANT_DEFAULTS[e]||b.VARIANT_DEFAULTS.primary,K=r.useMemo(()=>x&&n?{backgroundColor:`var(--bear-${e}-bg, ${n.bg})`,color:n.text||"#ffffff",borderColor:n.border,"--bear-ring-color":n.ring||n.bg,...y,...v}:{backgroundColor:`var(--bear-btn-${e}-bg, ${a.bg})`,color:e==="outline"||e==="ghost"?`var(--bear-btn-${e}-text, ${a.text||"inherit"})`:"white",borderColor:e==="outline"?`var(--bear-btn-${e}-border, ${a.border||a.bg})`:void 0,"--bear-ring-color":`var(--bear-btn-${e}-ring, ${a.ring})`,...y,...v},[e,a,y,v,x,n]),Q=r.useCallback(t=>{c.current=t,typeof i=="function"?i(t):i&&(i.current=t)},[i]);return s.jsxs("button",{ref:Q,disabled:Y,style:K,className:A.cn("Bear-Button","bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-lg bear-transition-all bear-duration-200 bear-outline-none bear-relative bear-overflow-hidden",b.BUTTON_SIZE[C],V(e)?b.BUTTON_VARIANT[e]:"bear-btn-custom bear-text-white focus:bear-ring-2 focus:bear-ring-offset-2 disabled:bear-opacity-50 disabled:bear-cursor-not-allowed hover:bear-brightness-110 active:bear-brightness-95",q&&"bear-w-full",d&&"bear-cursor-wait",O),"data-testid":L,onMouseMove:Z,onMouseEnter:G,onMouseLeave:J,...X,children:[l&&s.jsx("span",{className:"Bear-Button__spotlight","aria-hidden":"true",style:{position:"absolute",pointerEvents:"none",left:0,top:0,width:f,height:f,borderRadius:"50%",background:`radial-gradient(circle at center, ${E} 0%, transparent 70%)`,opacity:W?1:0,transform:`translate(${R.x-f/2}px, ${R.y-f/2}px)`,transition:"opacity 0.15s ease-out",zIndex:1,mixBlendMode:"overlay"}}),d&&s.jsx(re.Spinner,{size:C==="xs"?"xs":"sm",className:"Bear-Button__spinner bear-absolute"}),s.jsxs("span",{className:A.cn("Bear-Button__content bear-inline-flex bear-items-center bear-gap-inherit bear-relative bear-z-10",d&&"bear-invisible"),children:[S&&s.jsx("span",{className:"Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0 [&_svg]:bear-w-[1em] [&_svg]:bear-h-[1em] [&_svg]:bear-min-w-[1em]",children:S}),s.jsx(ne.Typography,{variant:z,className:"Bear-Button__text",children:D}),I&&s.jsx("span",{className:"Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0 [&_svg]:bear-w-[1em] [&_svg]:bear-h-[1em] [&_svg]:bear-min-w-[1em]",children:I})]})]})});k.displayName="Button";exports.Button=k;
|
|
@@ -1,92 +1,93 @@
|
|
|
1
1
|
import { jsxs as V, jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as oe, useContext as ae, useRef as ie, useState as k, useCallback as p, useMemo as se } from "react";
|
|
3
3
|
import { cn as M } from "../../utils/cn.js";
|
|
4
|
-
import { Spinner as
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { useBearStyles as
|
|
4
|
+
import { Spinner as le } from "../Spinner/Spinner.js";
|
|
5
|
+
import { Typography as ce } from "../Typography/Typography.js";
|
|
6
|
+
import { useBearStyles as be } from "../../hooks/useBearStyles.js";
|
|
7
7
|
import "../../hooks/useBearComponent/useBearComponent.js";
|
|
8
|
-
import { BearContext as
|
|
9
|
-
import { VARIANT_DEFAULTS as z, BUTTON_VARIANT as P, BUTTON_SIZE as
|
|
10
|
-
const A = (h) => h in P,
|
|
8
|
+
import { BearContext as ue } from "../../context/BearProvider.js";
|
|
9
|
+
import { VARIANT_DEFAULTS as z, BUTTON_VARIANT as P, BUTTON_SIZE as de } from "./Button.constants.js";
|
|
10
|
+
const A = (h) => h in P, me = oe(
|
|
11
11
|
(h, a) => {
|
|
12
|
-
var
|
|
12
|
+
var R, T;
|
|
13
13
|
const {
|
|
14
14
|
variant: e = "primary",
|
|
15
|
-
size:
|
|
15
|
+
size: x = "md",
|
|
16
16
|
loading: b = !1,
|
|
17
17
|
fullWidth: E = !1,
|
|
18
18
|
icon: u,
|
|
19
19
|
iconPosition: C = "left",
|
|
20
20
|
leftIcon: j,
|
|
21
21
|
rightIcon: U,
|
|
22
|
+
textVariant: D = "inherit",
|
|
22
23
|
spotlight: i = !1,
|
|
23
|
-
spotlightColor:
|
|
24
|
+
spotlightColor: H = "rgba(255, 255, 255, 0.35)",
|
|
24
25
|
spotlightSize: d = 150,
|
|
25
|
-
disabled:
|
|
26
|
-
className:
|
|
27
|
-
children:
|
|
28
|
-
testId:
|
|
29
|
-
bis:
|
|
30
|
-
style:
|
|
31
|
-
onMouseMove:
|
|
32
|
-
onMouseEnter:
|
|
33
|
-
onMouseLeave:
|
|
34
|
-
...
|
|
35
|
-
} = h,
|
|
26
|
+
disabled: L,
|
|
27
|
+
className: O,
|
|
28
|
+
children: X,
|
|
29
|
+
testId: Y,
|
|
30
|
+
bis: F,
|
|
31
|
+
style: W,
|
|
32
|
+
onMouseMove: m,
|
|
33
|
+
onMouseEnter: f,
|
|
34
|
+
onMouseLeave: g,
|
|
35
|
+
...Z
|
|
36
|
+
} = h, q = L || b, v = be(F, W), I = j ?? (u && C === "left" ? u : void 0), N = U ?? (u && C === "right" ? u : void 0), n = ae(ue), B = ((T = (R = n == null ? void 0 : n.components) == null ? void 0 : R.Button) == null ? void 0 : T.root) || {}, $ = (n == null ? void 0 : n.customVariants) || {}, y = !A(e) && e in $, r = y ? $[e] : null, s = ie(null), [w, _] = k({ x: -1e3, y: -1e3 }), [G, S] = k(!1), J = p((t) => {
|
|
36
37
|
if (i && s.current) {
|
|
37
|
-
const l = s.current.getBoundingClientRect(),
|
|
38
|
-
|
|
38
|
+
const l = s.current.getBoundingClientRect(), re = t.clientX - l.left, ne = t.clientY - l.top;
|
|
39
|
+
_({ x: re, y: ne });
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
}, [i,
|
|
42
|
-
if (i && (
|
|
41
|
+
m == null || m(t);
|
|
42
|
+
}, [i, m]), K = p((t) => {
|
|
43
|
+
if (i && (S(!0), s.current)) {
|
|
43
44
|
const l = s.current.getBoundingClientRect();
|
|
44
|
-
|
|
45
|
+
_({
|
|
45
46
|
x: t.clientX - l.left,
|
|
46
47
|
y: t.clientY - l.top
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
-
}, [i,
|
|
51
|
-
|
|
52
|
-
}, [
|
|
50
|
+
f == null || f(t);
|
|
51
|
+
}, [i, f]), Q = p((t) => {
|
|
52
|
+
S(!1), _({ x: -1e3, y: -1e3 }), g == null || g(t);
|
|
53
|
+
}, [g]), o = z[e] || z.primary, ee = se(() => y && r ? {
|
|
53
54
|
backgroundColor: `var(--bear-${e}-bg, ${r.bg})`,
|
|
54
55
|
color: r.text || "#ffffff",
|
|
55
56
|
borderColor: r.border,
|
|
56
57
|
"--bear-ring-color": r.ring || r.bg,
|
|
57
|
-
...
|
|
58
|
-
...
|
|
58
|
+
...B,
|
|
59
|
+
...v
|
|
59
60
|
} : {
|
|
60
61
|
backgroundColor: `var(--bear-btn-${e}-bg, ${o.bg})`,
|
|
61
62
|
color: e === "outline" || e === "ghost" ? `var(--bear-btn-${e}-text, ${o.text || "inherit"})` : "white",
|
|
62
63
|
borderColor: e === "outline" ? `var(--bear-btn-${e}-border, ${o.border || o.bg})` : void 0,
|
|
63
64
|
"--bear-ring-color": `var(--bear-btn-${e}-ring, ${o.ring})`,
|
|
64
|
-
...
|
|
65
|
-
...
|
|
66
|
-
}, [e, o,
|
|
65
|
+
...B,
|
|
66
|
+
...v
|
|
67
|
+
}, [e, o, B, v, y, r]), te = p((t) => {
|
|
67
68
|
s.current = t, typeof a == "function" ? a(t) : a && (a.current = t);
|
|
68
69
|
}, [a]);
|
|
69
70
|
return /* @__PURE__ */ V(
|
|
70
71
|
"button",
|
|
71
72
|
{
|
|
72
|
-
ref:
|
|
73
|
-
disabled:
|
|
74
|
-
style:
|
|
73
|
+
ref: te,
|
|
74
|
+
disabled: q,
|
|
75
|
+
style: ee,
|
|
75
76
|
className: M(
|
|
76
77
|
"Bear-Button",
|
|
77
78
|
"bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-lg bear-transition-all bear-duration-200 bear-outline-none bear-relative bear-overflow-hidden",
|
|
78
|
-
|
|
79
|
+
de[x],
|
|
79
80
|
// Use built-in variant classes or custom variant base classes
|
|
80
81
|
A(e) ? P[e] : "bear-btn-custom bear-text-white focus:bear-ring-2 focus:bear-ring-offset-2 disabled:bear-opacity-50 disabled:bear-cursor-not-allowed hover:bear-brightness-110 active:bear-brightness-95",
|
|
81
82
|
E && "bear-w-full",
|
|
82
83
|
b && "bear-cursor-wait",
|
|
83
|
-
|
|
84
|
+
O
|
|
84
85
|
),
|
|
85
|
-
"data-testid":
|
|
86
|
-
onMouseMove:
|
|
87
|
-
onMouseEnter:
|
|
88
|
-
onMouseLeave:
|
|
89
|
-
...
|
|
86
|
+
"data-testid": Y,
|
|
87
|
+
onMouseMove: J,
|
|
88
|
+
onMouseEnter: K,
|
|
89
|
+
onMouseLeave: Q,
|
|
90
|
+
...Z,
|
|
90
91
|
children: [
|
|
91
92
|
i && /* @__PURE__ */ c(
|
|
92
93
|
"span",
|
|
@@ -101,16 +102,16 @@ const A = (h) => h in P, de = ne(
|
|
|
101
102
|
width: d,
|
|
102
103
|
height: d,
|
|
103
104
|
borderRadius: "50%",
|
|
104
|
-
background: `radial-gradient(circle at center, ${
|
|
105
|
-
opacity:
|
|
106
|
-
transform: `translate(${
|
|
105
|
+
background: `radial-gradient(circle at center, ${H} 0%, transparent 70%)`,
|
|
106
|
+
opacity: G ? 1 : 0,
|
|
107
|
+
transform: `translate(${w.x - d / 2}px, ${w.y - d / 2}px)`,
|
|
107
108
|
transition: "opacity 0.15s ease-out",
|
|
108
109
|
zIndex: 1,
|
|
109
110
|
mixBlendMode: "overlay"
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
),
|
|
113
|
-
b && /* @__PURE__ */ c(
|
|
114
|
+
b && /* @__PURE__ */ c(le, { size: x === "xs" ? "xs" : "sm", className: "Bear-Button__spinner bear-absolute" }),
|
|
114
115
|
/* @__PURE__ */ V(
|
|
115
116
|
"span",
|
|
116
117
|
{
|
|
@@ -119,9 +120,9 @@ const A = (h) => h in P, de = ne(
|
|
|
119
120
|
b && "bear-invisible"
|
|
120
121
|
),
|
|
121
122
|
children: [
|
|
122
|
-
I && /* @__PURE__ */ c("span", { className: "Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0", children: I }),
|
|
123
|
-
/* @__PURE__ */ c(
|
|
124
|
-
N && /* @__PURE__ */ c("span", { className: "Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0", children: N })
|
|
123
|
+
I && /* @__PURE__ */ c("span", { className: "Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0 [&_svg]:bear-w-[1em] [&_svg]:bear-h-[1em] [&_svg]:bear-min-w-[1em]", children: I }),
|
|
124
|
+
/* @__PURE__ */ c(ce, { variant: D, className: "Bear-Button__text", children: X }),
|
|
125
|
+
N && /* @__PURE__ */ c("span", { className: "Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0 [&_svg]:bear-w-[1em] [&_svg]:bear-h-[1em] [&_svg]:bear-min-w-[1em]", children: N })
|
|
125
126
|
]
|
|
126
127
|
}
|
|
127
128
|
)
|
|
@@ -130,7 +131,7 @@ const A = (h) => h in P, de = ne(
|
|
|
130
131
|
);
|
|
131
132
|
}
|
|
132
133
|
);
|
|
133
|
-
|
|
134
|
+
me.displayName = "Button";
|
|
134
135
|
export {
|
|
135
|
-
|
|
136
|
+
me as Button
|
|
136
137
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { BearSize, BearVariant } from '../../types';
|
|
3
3
|
import { BisProp } from '../../types/bis.types';
|
|
4
|
+
import { TypographyVariant } from '../Typography/Typography.types';
|
|
4
5
|
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'style'> {
|
|
5
6
|
/**
|
|
6
7
|
* Button variant style
|
|
@@ -30,6 +31,12 @@ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
|
|
|
30
31
|
leftIcon?: ReactNode;
|
|
31
32
|
/** Icon to show after text */
|
|
32
33
|
rightIcon?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Typography variant for the button label (e.g. h1, h2, body1).
|
|
36
|
+
* Use with BearProvider customTypography to add your own variants.
|
|
37
|
+
* @default 'inherit'
|
|
38
|
+
*/
|
|
39
|
+
textVariant?: TypographyVariant;
|
|
33
40
|
/** Enable mouse-follow spotlight hover effect */
|
|
34
41
|
spotlight?: boolean;
|
|
35
42
|
/** Spotlight color (default: rgba(255, 255, 255, 0.15)) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),i=require("../../utils/cn.cjs"),o=require("./Carousel.const.cjs"),le=({children:z,autoPlay:y=0,showDots:B=!0,showArrows:P=!0,loop:m=!0,slidesToShow:u=1,gap:x=16,pauseOnHover:_=!0,onSlideChange:k,transition:p="slide",transitionDuration:d=o.DEFAULT_TRANSITION_DURATION,indicator:v="dots",thumbnails:E,thumbnailSize:S=o.DEFAULT_THUMBNAIL_SIZE,keyboard:w=!0,draggable:A=!0,showProgress:G=!1,showCounter:X=!1,activeColor:h=o.DEFAULT_ACTIVE_COLOR,className:Z,style:q,testId:F})=>{const[t,H]=s.useState(0),[M,R]=s.useState(!1),[$,K]=s.useState(null),[C,O]=s.useState(null),[L,U]=s.useState(!1),V=s.useRef(null),I=s.useRef(null),N=s.Children.toArray(z),f=N.length,l=Math.max(0,f-u),n=s.useCallback(a=>{if(L)return;let e=a;m?a<0?e=l:a>l&&(e=0):e=Math.max(0,Math.min(l,a)),U(!0),H(e),k==null||k(e),setTimeout(()=>U(!1),d)},[L,m,l,k,d]),b=s.useCallback(()=>n(t+1),[n,t]),c=s.useCallback(()=>n(t-1),[n,t]);s.useEffect(()=>{if(y>0&&!M)return I.current=setInterval(b,y),()=>{I.current&&clearInterval(I.current)}},[y,M,b]);const Y=s.useCallback(a=>{w&&(a.key==="ArrowLeft"?c():a.key==="ArrowRight"&&b())},[w,c,b]),J=a=>{O(null),K(a.targetTouches[0].clientX)},Q=a=>{O(a.targetTouches[0].clientX)},ee=()=>{if(!$||!C)return;const a=$-C;a>o.MIN_SWIPE_DISTANCE?b():a<-o.MIN_SWIPE_DISTANCE&&c()},[T,j]=s.useState(!1),[W,ae]=s.useState(0),re=s.useCallback(a=>{A&&(j(!0),ae(a.clientX))},[A]),te=s.useCallback(a=>{if(!T)return;j(!1);const e=W-a.clientX;e>o.MIN_SWIPE_DISTANCE?b():e<-o.MIN_SWIPE_DISTANCE&&c()},[T,W,b,c]),D=`calc((100% - ${x*(u-1)}px) / ${u})`,se=a=>{const e=a===t,g=`${d}ms`;switch(p){case"fade":return{position:"absolute",inset:0,opacity:e?1:0,transition:`opacity ${g} ease-in-out`,zIndex:e?1:0,pointerEvents:e?"auto":"none"};case"zoom":return{position:"absolute",inset:0,opacity:e?1:0,transform:e?"scale(1)":"scale(0.85)",transition:`opacity ${g} ease, transform ${g} ease`,zIndex:e?1:0,pointerEvents:e?"auto":"none"};case"flip":return{position:"absolute",inset:0,opacity:e?1:0,transform:e?"rotateY(0deg)":"rotateY(90deg)",transition:`opacity ${g} ease, transform ${g} ease`,zIndex:e?1:0,pointerEvents:e?"auto":"none",backfaceVisibility:"hidden"};case"slide":default:return{}}},oe=p==="fade"||p==="zoom"||p==="flip";return r.jsxs("div",{ref:V,className:i.cn("bear-relative bear-overflow-hidden bear-outline-none",Z),style:q,onMouseEnter:()=>_&&R(!0),onMouseLeave:()=>{_&&R(!1),T&&j(!1)},onTouchStart:J,onTouchMove:Q,onTouchEnd:ee,onMouseDown:re,onMouseUp:te,onKeyDown:Y,tabIndex:w?0:void 0,"data-testid":F,role:"region","aria-label":"Carousel","aria-roledescription":"carousel",children:[G&&y>0&&r.jsx("div",{className:"bear-absolute bear-top-0 bear-left-0 bear-right-0 bear-z-20",style:{height:o.PROGRESS_BAR_HEIGHT},children:r.jsx("div",{className:"bear-h-full bear-transition-all bear-ease-linear",style:{width:`${(t+1)/f*100}%`,background:h,transition:`width ${d}ms ease`}})}),oe?r.jsx("div",{className:"bear-relative",style:{minHeight:200},children:N.map((a,e)=>r.jsx("div",{style:se(e),children:a},e))}):r.jsx("div",{className:"bear-flex",style:{gap:`${x}px`,transform:`translateX(calc(-${t} * (${D} + ${x}px)))`,transition:`transform ${d}ms cubic-bezier(0.25, 0.1, 0.25, 1)`},children:N.map((a,e)=>r.jsx("div",{className:"bear-shrink-0",style:{width:D},children:a},e))}),P&&f>u&&r.jsxs(r.Fragment,{children:[r.jsx("button",{onClick:c,disabled:!m&&t===0,className:i.cn("bear-absolute bear-left-2 bear-top-1/2 bear--translate-y-1/2","bear-rounded-full bear-flex bear-items-center bear-justify-center","bear-bg-white/90 dark:bear-bg-gray-800/90 bear-shadow-lg","bear-text-gray-700 dark:bear-text-gray-200","hover:bear-bg-white dark:hover:bear-bg-gray-700","bear-transition-all bear-z-10","disabled:bear-opacity-50 disabled:bear-cursor-not-allowed"),style:{width:o.ARROW_BUTTON_SIZE,height:o.ARROW_BUTTON_SIZE},"aria-label":"Previous slide",children:r.jsx("svg",{className:"bear-w-5 bear-h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),r.jsx("button",{onClick:b,disabled:!m&&t===l,className:i.cn("bear-absolute bear-right-2 bear-top-1/2 bear--translate-y-1/2","bear-rounded-full bear-flex bear-items-center bear-justify-center","bear-bg-white/90 dark:bear-bg-gray-800/90 bear-shadow-lg","bear-text-gray-700 dark:bear-text-gray-200","hover:bear-bg-white dark:hover:bear-bg-gray-700","bear-transition-all bear-z-10","disabled:bear-opacity-50 disabled:bear-cursor-not-allowed"),style:{width:o.ARROW_BUTTON_SIZE,height:o.ARROW_BUTTON_SIZE},"aria-label":"Next slide",children:r.jsx("svg",{className:"bear-w-5 bear-h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),X&&r.jsxs("div",{className:"bear-absolute bear-top-3 bear-right-3 bear-z-10 bear-bg-black/50 bear-text-white bear-text-xs bear-font-medium bear-px-2.5 bear-py-1 bear-rounded-full",children:[t+1," / ",f]}),B&&v!=="none"&&f>u&&r.jsx("div",{className:"bear-flex bear-justify-center bear-gap-2 bear-mt-4",children:v==="thumbnails"&&E?E.map((a,e)=>r.jsx("button",{onClick:()=>n(e),className:i.cn("bear-rounded bear-overflow-hidden bear-border-2 bear-transition-all",e===t?"bear-opacity-100 bear-scale-110":"bear-opacity-60 hover:bear-opacity-80"),style:{width:S,height:S,borderColor:e===t?h:"transparent"},"aria-label":`Go to slide ${e+1}`,children:r.jsx("img",{src:a,alt:"",className:"bear-w-full bear-h-full bear-object-cover"})},e)):v==="numbers"?Array.from({length:l+1}).map((a,e)=>r.jsx("button",{onClick:()=>n(e),className:i.cn("bear-w-7 bear-h-7 bear-rounded-full bear-text-xs bear-font-medium bear-transition-all","bear-flex bear-items-center bear-justify-center",e===t?"bear-text-white bear-shadow-md":"bear-bg-gray-200 dark:bear-bg-gray-600 bear-text-gray-600 dark:bear-text-gray-300 hover:bear-bg-gray-300 dark:hover:bear-bg-gray-500"),style:e===t?{background:h}:void 0,"aria-label":`Go to slide ${e+1}`,children:e+1},e)):v==="bars"?Array.from({length:l+1}).map((a,e)=>r.jsx("button",{onClick:()=>n(e),className:i.cn("bear-h-1 bear-rounded-full bear-transition-all",e===t?"bear-w-8":"bear-w-4 bear-bg-gray-300 dark:bear-bg-gray-600 hover:bear-bg-gray-400 dark:hover:bear-bg-gray-500"),style:e===t?{background:h}:void 0,"aria-label":`Go to slide ${e+1}`},e)):Array.from({length:l+1}).map((a,e)=>r.jsx("button",{onClick:()=>n(e),className:i.cn("bear-h-2.5 bear-rounded-full bear-transition-all",e===t?"bear-w-6":"bear-w-2.5 bear-bg-gray-300 dark:bear-bg-gray-600 hover:bear-bg-gray-400 dark:hover:bear-bg-gray-500"),style:e===t?{background:h}:void 0,"aria-label":`Go to slide ${e+1}`},e))})]})};exports.Carousel=le;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=500,_=50,I=48,A="var(--bear-primary-500)",E=40,R=3;exports.ARROW_BUTTON_SIZE=E;exports.DEFAULT_ACTIVE_COLOR=A;exports.DEFAULT_THUMBNAIL_SIZE=I;exports.DEFAULT_TRANSITION_DURATION=T;exports.MIN_SWIPE_DISTANCE=_;exports.PROGRESS_BAR_HEIGHT=R;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Default transition duration in ms */
|
|
2
|
+
export declare const DEFAULT_TRANSITION_DURATION = 500;
|
|
3
|
+
/** Min swipe distance to trigger navigation (px) */
|
|
4
|
+
export declare const MIN_SWIPE_DISTANCE = 50;
|
|
5
|
+
/** Default thumbnail size (px) */
|
|
6
|
+
export declare const DEFAULT_THUMBNAIL_SIZE = 48;
|
|
7
|
+
/** Default active color */
|
|
8
|
+
export declare const DEFAULT_ACTIVE_COLOR = "var(--bear-primary-500)";
|
|
9
|
+
/** Arrow button size (px) */
|
|
10
|
+
export declare const ARROW_BUTTON_SIZE = 40;
|
|
11
|
+
/** Progress bar height (px) */
|
|
12
|
+
export declare const PROGRESS_BAR_HEIGHT = 3;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const T = 500, _ = 50, I = 48, A = "var(--bear-primary-500)", E = 40, R = 3;
|
|
2
|
+
export {
|
|
3
|
+
E as ARROW_BUTTON_SIZE,
|
|
4
|
+
A as DEFAULT_ACTIVE_COLOR,
|
|
5
|
+
I as DEFAULT_THUMBNAIL_SIZE,
|
|
6
|
+
T as DEFAULT_TRANSITION_DURATION,
|
|
7
|
+
_ as MIN_SWIPE_DISTANCE,
|
|
8
|
+
R as PROGRESS_BAR_HEIGHT
|
|
9
|
+
};
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { CarouselProps } from './Carousel.types';
|
|
3
3
|
/**
|
|
4
|
-
* Carousel -
|
|
4
|
+
* Carousel - Feature-rich sliding content carousel
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* Supports slide, fade, zoom, and flip transitions, thumbnail indicators,
|
|
8
|
+
* keyboard navigation, drag/swipe, progress bar, and counter.
|
|
5
9
|
*
|
|
6
10
|
* @example
|
|
7
11
|
* ```tsx
|
|
8
|
-
* <Carousel
|
|
12
|
+
* <Carousel
|
|
13
|
+
* autoPlay={5000}
|
|
14
|
+
* transition="fade"
|
|
15
|
+
* indicator="thumbnails"
|
|
16
|
+
* thumbnails={['/img1.jpg', '/img2.jpg']}
|
|
17
|
+
* showArrows
|
|
18
|
+
* showProgress
|
|
19
|
+
* keyboard
|
|
20
|
+
* >
|
|
9
21
|
* <div>Slide 1</div>
|
|
10
22
|
* <div>Slide 2</div>
|
|
11
|
-
* <div>Slide 3</div>
|
|
12
23
|
* </Carousel>
|
|
13
24
|
* ```
|
|
14
25
|
*/
|