@telia/teddy 0.4.4 → 0.4.6

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.
Files changed (82) hide show
  1. package/dist/components/card/card-illustration.d.ts +1 -1
  2. package/dist/components/channel-button/channel-button-root.d.ts +3 -3
  3. package/dist/components/channel-button/index.d.ts +3 -3
  4. package/dist/components/checkbox/checkbox-group.d.ts +1 -1
  5. package/dist/components/checkbox/index.d.ts +1 -1
  6. package/dist/components/chip/chip-indicator.d.ts +2 -2
  7. package/dist/components/chip/index.d.ts +2 -2
  8. package/dist/components/color-dot/index.d.ts +1 -1
  9. package/dist/components/expandable-card/expandable-card-button.d.ts +2 -2
  10. package/dist/components/expandable-card/index.d.ts +3 -3
  11. package/dist/components/flip-card/flip-card-back.cjs +39 -0
  12. package/dist/components/flip-card/flip-card-back.d.ts +27 -0
  13. package/dist/components/flip-card/flip-card-back.js +39 -0
  14. package/dist/components/flip-card/flip-card-footer.cjs +22 -0
  15. package/dist/components/flip-card/flip-card-footer.d.ts +14 -0
  16. package/dist/components/flip-card/flip-card-footer.js +22 -0
  17. package/dist/components/flip-card/flip-card-front.cjs +29 -0
  18. package/dist/components/flip-card/flip-card-front.d.ts +21 -0
  19. package/dist/components/flip-card/flip-card-front.js +29 -0
  20. package/dist/components/flip-card/flip-card-root.cjs +132 -0
  21. package/dist/components/flip-card/flip-card-root.d.ts +60 -0
  22. package/dist/components/flip-card/flip-card-root.js +132 -0
  23. package/dist/components/flip-card/flip-card-trigger.cjs +36 -0
  24. package/dist/components/flip-card/flip-card-trigger.d.ts +63 -0
  25. package/dist/components/flip-card/flip-card-trigger.js +36 -0
  26. package/dist/components/flip-card/index.cjs +18 -0
  27. package/dist/components/flip-card/index.d.ts +154 -0
  28. package/dist/components/flip-card/index.js +18 -0
  29. package/dist/components/icon/utils.d.ts +1 -1
  30. package/dist/components/index.cjs +2 -0
  31. package/dist/components/index.d.ts +1 -0
  32. package/dist/components/index.js +2 -0
  33. package/dist/components/modal/modal-close.cjs +1 -0
  34. package/dist/components/modal/modal-close.js +1 -0
  35. package/dist/components/navigation-menu/navigation-menu.cjs +1 -0
  36. package/dist/components/navigation-menu/navigation-menu.js +1 -0
  37. package/dist/components/notabene/notabene-icon.d.ts +2 -2
  38. package/dist/components/notification/index.d.ts +1 -1
  39. package/dist/components/notification/notification-icon.d.ts +2 -2
  40. package/dist/components/notification/notification-root.d.ts +1 -1
  41. package/dist/components/radio-card-group/radio-card-group-content.cjs +1 -0
  42. package/dist/components/radio-card-group/radio-card-group-content.js +1 -0
  43. package/dist/components/radio-card-group/radio-card-group-item-title.cjs +1 -0
  44. package/dist/components/radio-card-group/radio-card-group-item-title.js +1 -0
  45. package/dist/components/radio-card-group/radio-card-group-item.cjs +1 -0
  46. package/dist/components/radio-card-group/radio-card-group-item.js +1 -0
  47. package/dist/components/scroll-area/index.cjs +4 -3
  48. package/dist/components/scroll-area/index.d.ts +6 -3
  49. package/dist/components/scroll-area/index.js +3 -2
  50. package/dist/components/scroll-area/scroll-area-bar.cjs +6 -250
  51. package/dist/components/scroll-area/scroll-area-bar.js +6 -233
  52. package/dist/components/scroll-area/scroll-area-button.cjs +2 -2
  53. package/dist/components/scroll-area/scroll-area-button.d.ts +2 -2
  54. package/dist/components/scroll-area/scroll-area-button.js +1 -1
  55. package/dist/components/scroll-area/scroll-area-corner.cjs +2 -2
  56. package/dist/components/scroll-area/scroll-area-corner.js +1 -1
  57. package/dist/components/scroll-area/scroll-area-item.cjs +3 -3
  58. package/dist/components/scroll-area/scroll-area-item.js +1 -1
  59. package/dist/components/scroll-area/scroll-area-root.cjs +4 -5
  60. package/dist/components/scroll-area/scroll-area-root.d.ts +25 -3
  61. package/dist/components/scroll-area/scroll-area-root.js +1 -2
  62. package/dist/components/scroll-area/scroll-area-thumb.cjs +251 -6
  63. package/dist/components/scroll-area/scroll-area-thumb.js +234 -6
  64. package/dist/components/tabs/index.cjs +12 -13
  65. package/dist/components/tabs/index.d.ts +112 -56
  66. package/dist/components/tabs/index.js +12 -13
  67. package/dist/components/tabs/tabs-content.d.ts +2 -0
  68. package/dist/components/tabs/tabs-root.d.ts +10 -0
  69. package/dist/components/tabs/tabs-scroll-button.d.ts +2 -2
  70. package/dist/components/tabs/tabs-scroll.cjs +1 -1
  71. package/dist/components/tabs/tabs-scroll.d.ts +3 -1
  72. package/dist/components/tabs/tabs-scroll.js +1 -1
  73. package/dist/components/text-field/index.d.ts +2 -2
  74. package/dist/components/text-field/text-field-button.d.ts +2 -2
  75. package/dist/components/toggle/toggle.d.ts +2 -2
  76. package/dist/main.cjs +2 -0
  77. package/dist/main.js +2 -0
  78. package/dist/style.css +3373 -3307
  79. package/dist/utils/generate-styling/grid.d.ts +24 -24
  80. package/dist/utils/generate-styling/index.d.ts +16 -16
  81. package/dist/utils/generate-styling/util.d.ts +2 -2
  82. package/package.json +1 -1
@@ -1,235 +1,8 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import React__default from "react";
3
- import clsx from "clsx";
4
- import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
5
- import { Button as Button$1 } from "../button/button.js";
6
- import { composeEventHandlers } from "../../utils/composeEventHandlers.js";
7
- import "../../assets/sprite.1321fab0-teddy.svg";
8
- import { Icon } from "../icon/icon.js";
9
- import { Slottable } from "@radix-ui/react-slot";
10
- const styles = {
11
- "teddy-scroll-area": "_teddy-scroll-area_1r6mf_1",
12
- "teddy-scroll-area__viewport": "_teddy-scroll-area__viewport_1r6mf_5",
13
- "teddy-scroll-area__scrollbar": "_teddy-scroll-area__scrollbar_1r6mf_11",
14
- "teddy-scroll-area__scrollbar--hidden": "_teddy-scroll-area__scrollbar--hidden_1r6mf_32",
15
- "teddy-scroll-area__thumb": "_teddy-scroll-area__thumb_1r6mf_45",
16
- "teddy-scroll-area__corner": "_teddy-scroll-area__corner_1r6mf_62",
17
- "teddy-scroll-area__button": "_teddy-scroll-area__button_1r6mf_65",
18
- "teddy-scroll-area__button--hidden": "_teddy-scroll-area__button--hidden_1r6mf_93"
19
- };
20
- const Scrollbar = React__default.forwardRef(
21
- ({ className, ...props }, forwardRef) => {
22
- const context = React__default.useContext(RootContext);
23
- const classes = clsx(
24
- [styles[`${rootClassName}__scrollbar`]],
25
- {
26
- [styles[`${rootClassName}__scrollbar--hidden`]]: (context == null ? void 0 : context.variant) !== "scrollbar"
27
- },
28
- className
29
- );
30
- return /* @__PURE__ */ jsx(ScrollAreaPrimitive.Scrollbar, { ...props, ref: forwardRef, className: classes });
31
- }
32
- );
33
- Scrollbar.displayName = "Scrollbar";
34
- const Thumb = React__default.forwardRef(
35
- ({ className, ...props }, forwardRef) => {
36
- const classes = clsx([styles[`${rootClassName}__thumb`]], className);
37
- return /* @__PURE__ */ jsx(ScrollAreaPrimitive.Thumb, { ...props, ref: forwardRef, className: classes });
38
- }
39
- );
40
- Thumb.displayName = "Thumb";
41
- const Corner = React__default.forwardRef(
42
- ({ className, ...props }, forwardRef) => {
43
- const classes = clsx([styles[`${rootClassName}__corner`]], className);
44
- return /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, { ...props, ref: forwardRef, className: classes });
45
- }
46
- );
47
- Corner.displayName = "Corner";
48
- const directionToAriaLabel = {
49
- up: "Scroll opp",
50
- down: "Scroll ned",
51
- left: "Scroll til venstre",
52
- right: "Scroll til høyre"
53
- };
54
- const directionToIconName = {
55
- up: "chevron-up",
56
- down: "chevron-down",
57
- left: "chevron-left",
58
- right: "chevron-right"
59
- };
60
- const Button = React__default.forwardRef(
61
- ({ className, hidden, direction = "right", children, ...props }, forwardRef) => {
62
- const scrollAreaContext = React__default.useContext(RootContext);
63
- const shouldBeHidden = hidden ?? (direction === "up" && !(scrollAreaContext == null ? void 0 : scrollAreaContext.hasScrollTop) || direction === "down" && !(scrollAreaContext == null ? void 0 : scrollAreaContext.hasScrollBottom) || direction === "left" && !(scrollAreaContext == null ? void 0 : scrollAreaContext.hasScrollLeft) || direction === "right" && !(scrollAreaContext == null ? void 0 : scrollAreaContext.hasScrollRight));
64
- const buttonClasses = clsx(
65
- styles[`${rootClassName}__button`],
66
- {
67
- [styles[`${rootClassName}__button--hidden`]]: shouldBeHidden
68
- },
69
- className
70
- );
71
- const handleButtonClick = composeEventHandlers(props.onClick, (event) => {
72
- if (event.defaultPrevented)
73
- return;
74
- const scrollAreaElement = scrollAreaContext == null ? void 0 : scrollAreaContext.scrollRef;
75
- if (!scrollAreaElement)
76
- return;
77
- const scrollableItems = Array.from(scrollAreaElement.querySelectorAll("[data-in-view]"));
78
- const isHorizontalScroll = direction === "left" || direction === "right";
79
- const scrollProperty = isHorizontalScroll ? "left" : "top";
80
- const isScrollingBackward = direction === "left" || direction === "up";
81
- const currentScrollPosition = isHorizontalScroll ? scrollAreaElement.scrollLeft : scrollAreaElement.scrollTop;
82
- const viewportSize = isHorizontalScroll ? scrollAreaElement.clientWidth : scrollAreaElement.clientHeight;
83
- const scrollButtonSize = isHorizontalScroll ? event.currentTarget.offsetWidth : event.currentTarget.offsetHeight;
84
- const visibleAreaStart = currentScrollPosition + (isScrollingBackward ? scrollButtonSize : 0);
85
- const visibleAreaEnd = currentScrollPosition + viewportSize - (!isScrollingBackward ? scrollButtonSize : 0);
86
- const getItemBounds = (item) => {
87
- const itemStart = isHorizontalScroll ? item.offsetLeft : item.offsetTop;
88
- const itemEnd = itemStart + (isHorizontalScroll ? item.offsetWidth : item.offsetHeight);
89
- return { itemStart, itemEnd };
90
- };
91
- const isItemFullyVisible = (item) => {
92
- const { itemStart, itemEnd } = getItemBounds(item);
93
- return itemStart >= visibleAreaStart && itemEnd <= visibleAreaEnd;
94
- };
95
- const fullyVisibleItemIndices = scrollableItems.map((item, index) => {
96
- const isInView = item.getAttribute("data-in-view") === "true";
97
- const isFullyVisible = isItemFullyVisible(item);
98
- return isInView && isFullyVisible ? index : -1;
99
- }).filter((index) => index !== -1);
100
- const userPrefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
101
- const scrollBehavior = userPrefersReducedMotion ? "auto" : (scrollAreaContext == null ? void 0 : scrollAreaContext.scrollBehavior) ?? "smooth";
102
- function calculateScrollAmount() {
103
- if (fullyVisibleItemIndices.length <= 0) {
104
- const defaultScrollAmount = viewportSize - scrollButtonSize * 2;
105
- return isScrollingBackward ? currentScrollPosition - defaultScrollAmount : currentScrollPosition + defaultScrollAmount;
106
- }
107
- const isRightToLeft = scrollAreaContext == null ? void 0 : scrollAreaContext.isRtl;
108
- const effectiveBackwardDirection = isRightToLeft ? !isScrollingBackward : isScrollingBackward;
109
- const referenceItemIndex = effectiveBackwardDirection ? fullyVisibleItemIndices[0] : fullyVisibleItemIndices[fullyVisibleItemIndices.length - 1];
110
- const targetItemIndex = effectiveBackwardDirection ? referenceItemIndex > 0 ? referenceItemIndex - 1 : referenceItemIndex : referenceItemIndex < scrollableItems.length - 1 ? referenceItemIndex + 1 : referenceItemIndex;
111
- const targetItem = scrollableItems[targetItemIndex];
112
- const { itemStart, itemEnd } = getItemBounds(targetItem);
113
- const targetItemSize = itemEnd - itemStart;
114
- return isScrollingBackward ? itemStart + targetItemSize - viewportSize + scrollButtonSize : itemStart - scrollButtonSize;
115
- }
116
- const newScrollPosition = calculateScrollAmount();
117
- scrollAreaElement.scrollTo({
118
- [scrollProperty]: newScrollPosition,
119
- behavior: scrollBehavior
120
- });
121
- });
122
- return /* @__PURE__ */ jsx(
123
- Button$1,
124
- {
125
- iconOnly: true,
126
- variant: "primary",
127
- "aria-label": directionToAriaLabel[direction],
128
- "data-direction": direction,
129
- tabIndex: shouldBeHidden ? -1 : void 0,
130
- ...props,
131
- onClick: handleButtonClick,
132
- ref: forwardRef,
133
- className: buttonClasses,
134
- children: children || /* @__PURE__ */ jsx(Icon, { name: directionToIconName[direction] })
135
- }
136
- );
137
- }
138
- );
139
- Button.displayName = "Button";
140
- const rootClassName = "teddy-scroll-area";
141
- const RootContext = React__default.createContext(void 0);
142
- function isScrollable(element) {
143
- if (!element)
144
- return null;
145
- const buffer = 1;
146
- const scrollLeft = element.scrollLeft;
147
- const scrollWidth = element.scrollWidth;
148
- const offsetWidth = element.offsetWidth;
149
- const maxScrollLeft = scrollWidth - offsetWidth;
150
- const isRtl = getComputedStyle(element).direction === "rtl";
151
- let left;
152
- let right;
153
- if (isRtl) {
154
- const normalizedScrollLeft = Math.abs(scrollLeft);
155
- left = normalizedScrollLeft < maxScrollLeft - buffer;
156
- right = normalizedScrollLeft > buffer;
157
- } else {
158
- left = scrollLeft > buffer;
159
- right = scrollLeft < maxScrollLeft - buffer;
160
- }
161
- const scrollTop = element.scrollTop;
162
- const maxScrollTop = element.scrollHeight - element.offsetHeight;
163
- const top = scrollTop > buffer;
164
- const bottom = scrollTop < maxScrollTop - buffer;
165
- return {
166
- left,
167
- right,
168
- top,
169
- bottom
170
- };
171
- }
172
- const Root = React__default.forwardRef(
173
- ({ className, variant, scrollBehavior = "smooth", children, ...props }, forwardRef) => {
174
- const [scrollRef, setScrollRef] = React__default.useState(null);
175
- const [hasScroll, setHasScroll] = React__default.useState(null);
176
- const initialScrollable = isScrollable(scrollRef);
177
- const hasScrollLeft = hasScroll ? hasScroll.left : initialScrollable == null ? void 0 : initialScrollable.left;
178
- const hasScrollRight = hasScroll ? hasScroll.right : initialScrollable == null ? void 0 : initialScrollable.right;
179
- const hasScrollTop = hasScroll ? hasScroll.top : initialScrollable == null ? void 0 : initialScrollable.top;
180
- const hasScrollBottom = hasScroll ? hasScroll.bottom : initialScrollable == null ? void 0 : initialScrollable.bottom;
181
- const hasScrollHorizontal = hasScrollLeft || hasScrollRight;
182
- const hasScrollVertical = hasScrollTop || hasScrollBottom;
183
- function handleScroll(e) {
184
- const target = e.currentTarget;
185
- setHasScroll(isScrollable(target));
186
- }
187
- const classes = clsx([styles[`${rootClassName}`]], className);
188
- return /* @__PURE__ */ jsx(
189
- RootContext.Provider,
190
- {
191
- value: {
192
- scrollRef,
193
- variant,
194
- hasScrollTop,
195
- hasScrollBottom,
196
- hasScrollLeft,
197
- hasScrollRight,
198
- scrollBehavior,
199
- isRtl: props.dir === "rtl"
200
- },
201
- children: /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, { ...props, ref: forwardRef, className: classes, children: [
202
- /* @__PURE__ */ jsx(
203
- ScrollAreaPrimitive.Viewport,
204
- {
205
- onScroll: handleScroll,
206
- ref: setScrollRef,
207
- className: clsx([styles[`${rootClassName}__viewport`]]),
208
- children: /* @__PURE__ */ jsx(Slottable, { children })
209
- }
210
- ),
211
- /* @__PURE__ */ jsx(Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsx(Thumb, {}) }),
212
- /* @__PURE__ */ jsx(Scrollbar, { orientation: "horizontal", children: /* @__PURE__ */ jsx(Thumb, {}) }),
213
- /* @__PURE__ */ jsx(Corner, {}),
214
- variant === "button" && /* @__PURE__ */ jsxs(Fragment, { children: [
215
- hasScrollVertical && /* @__PURE__ */ jsx(Button, { direction: "up", hidden: !hasScrollTop }),
216
- hasScrollVertical && /* @__PURE__ */ jsx(Button, { direction: "down", hidden: !hasScrollBottom }),
217
- hasScrollHorizontal && /* @__PURE__ */ jsx(Button, { direction: "left", hidden: !hasScrollLeft }),
218
- hasScrollHorizontal && /* @__PURE__ */ jsx(Button, { direction: "right", hidden: !hasScrollRight })
219
- ] })
220
- ] })
221
- }
222
- );
223
- }
224
- );
225
- Root.displayName = "Root";
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "clsx";
4
+ import "@radix-ui/react-scroll-area";
5
+ import { S } from "./scroll-area-thumb.js";
226
6
  export {
227
- Button as B,
228
- Corner as C,
229
- Root as R,
230
- Scrollbar,
231
- Thumb as T,
232
- RootContext as a,
233
- rootClassName as r,
234
- styles as s
7
+ S as Scrollbar
235
8
  };
@@ -3,9 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("react/jsx-runtime");
4
4
  require("react");
5
5
  require("clsx");
6
- const components_scrollArea_scrollAreaBar = require("./scroll-area-bar.cjs");
6
+ const components_scrollArea_scrollAreaThumb = require("./scroll-area-thumb.cjs");
7
7
  require("../button/button.cjs");
8
8
  require("../../utils/composeEventHandlers.cjs");
9
9
  require("../../assets/sprite.1321fab0-teddy.svg");
10
10
  require("../icon/icon.cjs");
11
- exports.Button = components_scrollArea_scrollAreaBar.Button;
11
+ exports.Button = components_scrollArea_scrollAreaThumb.Button;
@@ -17,7 +17,7 @@ export declare const Button: React.ForwardRefExoticComponent<Omit<Omit<Omit<Reac
17
17
  loading?: boolean | undefined;
18
18
  fullWidth?: boolean | undefined;
19
19
  size?: "sm" | "md" | "lg" | undefined;
20
- variant?: "primary" | "text" | "list-item" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
20
+ variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
21
21
  borderStyle?: ("default" | "dashed") | undefined;
22
22
  } & {
23
23
  iconOnly: true;
@@ -29,7 +29,7 @@ export declare const Button: React.ForwardRefExoticComponent<Omit<Omit<Omit<Reac
29
29
  loading?: boolean | undefined;
30
30
  fullWidth?: boolean | undefined;
31
31
  size?: "sm" | "md" | "lg" | undefined;
32
- variant?: "primary" | "text" | "list-item" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
32
+ variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
33
33
  borderStyle?: ("default" | "dashed") | undefined;
34
34
  } & {
35
35
  iconOnly?: false | undefined;
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "clsx";
4
- import { B } from "./scroll-area-bar.js";
4
+ import { B } from "./scroll-area-thumb.js";
5
5
  import "../button/button.js";
6
6
  import "../../utils/composeEventHandlers.js";
7
7
  import "../../assets/sprite.1321fab0-teddy.svg";
@@ -4,5 +4,5 @@ require("react/jsx-runtime");
4
4
  require("react");
5
5
  require("clsx");
6
6
  require("@radix-ui/react-scroll-area");
7
- const components_scrollArea_scrollAreaBar = require("./scroll-area-bar.cjs");
8
- exports.Corner = components_scrollArea_scrollAreaBar.Corner;
7
+ const components_scrollArea_scrollAreaThumb = require("./scroll-area-thumb.cjs");
8
+ exports.Corner = components_scrollArea_scrollAreaThumb.Corner;
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "clsx";
4
4
  import "@radix-ui/react-scroll-area";
5
- import { C } from "./scroll-area-bar.js";
5
+ import { C } from "./scroll-area-thumb.js";
6
6
  export {
7
7
  C as Corner
8
8
  };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
- const components_scrollArea_scrollAreaBar = require("./scroll-area-bar.cjs");
6
+ const components_scrollArea_scrollAreaThumb = require("./scroll-area-thumb.cjs");
7
7
  const reactSlot = require("@radix-ui/react-slot");
8
8
  const utils_composeEventHandlers = require("../../utils/composeEventHandlers.cjs");
9
9
  const utils_composeRefs = require("../../utils/composeRefs.cjs");
@@ -24,7 +24,7 @@ function scrollItemToCenter(item, scrollArea, scrollBehavior) {
24
24
  }
25
25
  const Item = React.forwardRef(
26
26
  ({ className, asChild, isSelected, scrollBehavior, scrollBehaviorOnMount, ...props }, forwardRef) => {
27
- const classes = clsx([components_scrollArea_scrollAreaBar.styles[`${components_scrollArea_scrollAreaBar.rootClassName}__item`]], className);
27
+ const classes = clsx([components_scrollArea_scrollAreaThumb.styles[`${components_scrollArea_scrollAreaThumb.rootClassName}__item`]], className);
28
28
  const Comp = asChild ? reactSlot.Slot : "div";
29
29
  const ref = React.useRef(null);
30
30
  const { ref: inViewRef, inView } = reactIntersectionObserver.useInView({
@@ -37,7 +37,7 @@ const Item = React.forwardRef(
37
37
  [inViewRef]
38
38
  );
39
39
  const composedRef = utils_composeRefs.useComposedRefs(ref, forwardRef, adjustedInViewRef);
40
- const context = React.useContext(components_scrollArea_scrollAreaBar.RootContext);
40
+ const context = React.useContext(components_scrollArea_scrollAreaThumb.RootContext);
41
41
  const internalScrollBehavior = scrollBehavior ?? (context == null ? void 0 : context.scrollBehavior) ?? "smooth";
42
42
  React.useEffect(() => {
43
43
  if (isSelected && ref.current && (context == null ? void 0 : context.scrollRef)) {
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
- import { s as styles, r as rootClassName, a as RootContext } from "./scroll-area-bar.js";
4
+ import { s as styles, r as rootClassName, a as RootContext } from "./scroll-area-thumb.js";
5
5
  import { Slot } from "@radix-ui/react-slot";
6
6
  import { composeEventHandlers } from "../../utils/composeEventHandlers.js";
7
7
  import { useComposedRefs } from "../../utils/composeRefs.js";
@@ -4,8 +4,7 @@ require("react/jsx-runtime");
4
4
  require("react");
5
5
  require("clsx");
6
6
  require("@radix-ui/react-scroll-area");
7
- const components_scrollArea_scrollAreaBar = require("./scroll-area-bar.cjs");
8
- require("@radix-ui/react-slot");
9
- exports.Root = components_scrollArea_scrollAreaBar.Root;
10
- exports.RootContext = components_scrollArea_scrollAreaBar.RootContext;
11
- exports.rootClassName = components_scrollArea_scrollAreaBar.rootClassName;
7
+ const components_scrollArea_scrollAreaThumb = require("./scroll-area-thumb.cjs");
8
+ exports.Root = components_scrollArea_scrollAreaThumb.Root;
9
+ exports.RootContext = components_scrollArea_scrollAreaThumb.RootContext;
10
+ exports.rootClassName = components_scrollArea_scrollAreaThumb.rootClassName;
@@ -2,15 +2,26 @@ import { default as React } from 'react';
2
2
 
3
3
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
4
4
  export declare const rootClassName = "teddy-scroll-area";
5
- type Variant = 'scrollbar' | 'button';
5
+ type Variant = 'scrollbar' | 'button' | 'hidden';
6
6
  export type RootProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & {
7
7
  /** There are three different variants
8
8
  * - `scrollbar`: The scrollbar will be visible on hover and scroll
9
9
  * - `button`: There will be buttons to scroll
10
- * - `undefined`: The scrollbar will not be visible
10
+ * - `hidden`: The scrollbar will not be visible
11
11
  */
12
12
  variant?: Variant | undefined;
13
+ /**
14
+ * The scroll behavior of the scroll area
15
+ */
13
16
  scrollBehavior?: 'smooth' | 'auto';
17
+ /**
18
+ * To style the viewport, viewport is the inner container of the scroll area
19
+ */
20
+ viewPortClassName?: string;
21
+ /**
22
+ * To style the scrollbar
23
+ */
24
+ barClassName?: string;
14
25
  };
15
26
  type RootContextType = {
16
27
  scrollRef: HTMLDivElement | null;
@@ -27,9 +38,20 @@ export declare const Root: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimit
27
38
  /** There are three different variants
28
39
  * - `scrollbar`: The scrollbar will be visible on hover and scroll
29
40
  * - `button`: There will be buttons to scroll
30
- * - `undefined`: The scrollbar will not be visible
41
+ * - `hidden`: The scrollbar will not be visible
31
42
  */
32
43
  variant?: Variant | undefined;
44
+ /**
45
+ * The scroll behavior of the scroll area
46
+ */
33
47
  scrollBehavior?: "auto" | "smooth" | undefined;
48
+ /**
49
+ * To style the viewport, viewport is the inner container of the scroll area
50
+ */
51
+ viewPortClassName?: string | undefined;
52
+ /**
53
+ * To style the scrollbar
54
+ */
55
+ barClassName?: string | undefined;
34
56
  } & React.RefAttributes<HTMLDivElement>>;
35
57
  export {};
@@ -2,8 +2,7 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "clsx";
4
4
  import "@radix-ui/react-scroll-area";
5
- import { R, a, r } from "./scroll-area-bar.js";
6
- import "@radix-ui/react-slot";
5
+ import { R, a, r } from "./scroll-area-thumb.js";
7
6
  export {
8
7
  R as Root,
9
8
  a as RootContext,