@telia/teddy 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/accordion-content.cjs +32 -0
- package/dist/components/accordion/accordion-header.cjs +33 -0
- package/dist/components/accordion/accordion-indicator.cjs +16 -0
- package/dist/components/accordion/accordion-item.cjs +32 -0
- package/dist/components/accordion/accordion-root.cjs +56 -0
- package/dist/components/accordion/accordion-root.js +11 -11
- package/dist/components/accordion/accordion-title.cjs +15 -0
- package/dist/components/accordion/accordion-trigger.cjs +37 -0
- package/dist/components/accordion/index.cjs +25 -0
- package/dist/components/accordion/index.js +7 -0
- package/dist/components/badge/badge.cjs +43 -0
- package/dist/components/badge/index.cjs +4 -0
- package/dist/components/box/box.cjs +17 -0
- package/dist/components/box/index.cjs +4 -0
- package/dist/components/button/button.cjs +130 -0
- package/dist/components/button/button.js +24 -24
- package/dist/components/button/index.cjs +4 -0
- package/dist/components/card/card.cjs +219 -0
- package/dist/components/card/index.cjs +4 -0
- package/dist/components/chip/chip-indicator.cjs +16 -0
- package/dist/components/chip/chip-item.cjs +45 -0
- package/dist/components/chip/chip.cjs +48 -0
- package/dist/components/chip/index.cjs +10 -0
- package/dist/components/drawer/drawer-close.cjs +39 -0
- package/dist/components/drawer/drawer-close.d.ts +0 -3
- package/dist/components/drawer/drawer-close.js +1 -1
- package/dist/components/drawer/drawer-content.cjs +42 -0
- package/dist/components/drawer/drawer-content.d.ts +0 -3
- package/dist/components/drawer/drawer-content.js +1 -1
- package/dist/components/drawer/drawer-description.cjs +36 -0
- package/dist/components/drawer/drawer-description.d.ts +0 -3
- package/dist/components/drawer/drawer-description.js +1 -1
- package/dist/components/drawer/drawer-footer.cjs +16 -0
- package/dist/components/drawer/drawer-footer.d.ts +0 -3
- package/dist/components/drawer/drawer-footer.js +1 -1
- package/dist/components/drawer/drawer-overlay.cjs +43 -0
- package/dist/components/drawer/drawer-overlay.d.ts +0 -3
- package/dist/components/drawer/drawer-overlay.js +1 -1
- package/dist/components/drawer/drawer-root.cjs +28 -0
- package/dist/components/drawer/drawer-root.d.ts +1 -1
- package/dist/components/drawer/drawer-title.cjs +34 -0
- package/dist/components/drawer/drawer-title.d.ts +4 -3
- package/dist/components/drawer/drawer-title.js +1 -1
- package/dist/components/drawer/drawer-trigger.cjs +27 -0
- package/dist/components/drawer/drawer-trigger.d.ts +5 -3
- package/dist/components/drawer/index.cjs +28 -0
- package/dist/components/drawer/index.d.ts +28 -0
- package/dist/components/drawer/index.js +8 -0
- package/dist/components/field-error-text/field-error-text.cjs +30 -0
- package/dist/components/field-error-text/index.cjs +4 -0
- package/dist/components/flex/flex.cjs +19 -0
- package/dist/components/flex/index.cjs +4 -0
- package/dist/components/grid/grid.cjs +19 -0
- package/dist/components/grid/index.cjs +4 -0
- package/dist/components/heading/heading.cjs +55 -0
- package/dist/components/heading/index.cjs +4 -0
- package/dist/components/helper-text/helper-text.cjs +21 -0
- package/dist/components/helper-text/helper-text.d.ts +2 -4
- package/dist/components/helper-text/index.cjs +4 -0
- package/dist/components/icon/AllIcons.cjs +1091 -0
- package/dist/components/icon/AllIcons.d.ts +2 -0
- package/dist/components/icon/AllIcons.js +1092 -0
- package/dist/components/icon/icon.cjs +29 -0
- package/dist/components/icon/index.cjs +8 -0
- package/dist/components/icon/index.d.ts +1 -0
- package/dist/components/icon/index.js +2 -0
- package/dist/components/image/image.cjs +17 -0
- package/dist/components/image/index.cjs +4 -0
- package/dist/components/index.cjs +66 -0
- package/dist/components/index.js +6 -3
- package/dist/components/input/index.cjs +14 -0
- package/dist/components/input/index.d.ts +27 -2
- package/dist/components/input/index.js +10 -1
- package/dist/components/input/input-clear-button.cjs +43 -0
- package/dist/components/input/input-clear-button.d.ts +6 -0
- package/dist/components/input/input-clear-button.js +43 -0
- package/dist/components/input/input-group.cjs +132 -0
- package/dist/components/input/input-group.d.ts +16 -0
- package/dist/components/input/input-group.js +132 -0
- package/dist/components/input/input-indicator.cjs +10 -0
- package/dist/components/input/input-indicator.d.ts +23 -0
- package/dist/components/input/input-indicator.js +10 -0
- package/dist/components/input/input.cjs +9 -0
- package/dist/components/input/input.d.ts +4 -28
- package/dist/components/input/input.js +7 -114
- package/dist/components/label/index.cjs +4 -0
- package/dist/components/label/label.cjs +44 -0
- package/dist/components/link/index.cjs +4 -0
- package/dist/components/link/link.cjs +37 -0
- package/dist/components/link/link.js +10 -10
- package/dist/components/modal/index.cjs +4 -0
- package/dist/components/modal/modal.cjs +210 -0
- package/dist/components/modal/modal.js +17 -16
- package/dist/components/navigation-menu/index.cjs +4 -0
- package/dist/components/navigation-menu/navigation-menu.cjs +412 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +2 -0
- package/dist/components/navigation-menu/navigation-menu.js +24 -22
- package/dist/components/notification/index.cjs +4 -0
- package/dist/components/notification/notification.cjs +116 -0
- package/dist/components/notification/notification.js +8 -8
- package/dist/components/radio-group/index.cjs +4 -0
- package/dist/components/radio-group/radio-group.cjs +110 -0
- package/dist/components/scroll-area/index.cjs +9 -0
- package/dist/components/scroll-area/scroll-area-bar.cjs +175 -0
- package/dist/components/scroll-area/scroll-area-bar.js +8 -8
- package/dist/components/scroll-area/scroll-area-button.cjs +11 -0
- package/dist/components/scroll-area/scroll-area-corner.cjs +8 -0
- package/dist/components/scroll-area/scroll-area-item.cjs +42 -0
- package/dist/components/scroll-area/scroll-area-item.js +2 -1
- package/dist/components/scroll-area/scroll-area-root.cjs +11 -0
- package/dist/components/scroll-area/scroll-area-thumb.cjs +8 -0
- package/dist/components/spinner/index.cjs +4 -0
- package/dist/components/spinner/spinner.cjs +57 -0
- package/dist/components/tabs/index.cjs +16 -0
- package/dist/components/tabs/tabs-content.cjs +32 -0
- package/dist/components/tabs/tabs-list.cjs +39 -0
- package/dist/components/tabs/tabs-list.js +6 -4
- package/dist/components/tabs/tabs-root.cjs +75 -0
- package/dist/components/tabs/tabs-root.d.ts +4 -7
- package/dist/components/tabs/tabs-root.js +25 -8
- package/dist/components/tabs/tabs-scroll-button.cjs +15 -0
- package/dist/components/tabs/tabs-scroll.cjs +22 -0
- package/dist/components/tabs/tabs-trigger.cjs +55 -0
- package/dist/components/tabs/tabs-trigger.js +19 -9
- package/dist/components/text/index.cjs +4 -0
- package/dist/components/text/text.cjs +49 -0
- package/dist/components/text-field/index.cjs +31 -0
- package/dist/components/text-field/index.d.ts +63 -2
- package/dist/components/text-field/index.js +28 -1
- package/dist/components/text-field/text-field-button.cjs +31 -0
- package/dist/components/text-field/text-field-button.d.ts +27 -0
- package/dist/components/text-field/text-field-button.js +31 -0
- package/dist/components/text-field/text-field-clear-button.cjs +12 -0
- package/dist/components/text-field/text-field-clear-button.d.ts +6 -0
- package/dist/components/text-field/text-field-clear-button.js +12 -0
- package/dist/components/text-field/text-field-error-list.cjs +28 -0
- package/dist/components/text-field/text-field-error-list.d.ts +9 -0
- package/dist/components/text-field/text-field-error-list.js +28 -0
- package/dist/components/text-field/text-field-helper-text.cjs +19 -0
- package/dist/components/text-field/text-field-helper-text.d.ts +5 -0
- package/dist/components/text-field/text-field-helper-text.js +19 -0
- package/dist/components/text-field/text-field-indicator.cjs +14 -0
- package/dist/components/text-field/text-field-indicator.d.ts +6 -0
- package/dist/components/text-field/text-field-indicator.js +14 -0
- package/dist/components/text-field/text-field-input-group.cjs +11 -0
- package/dist/components/text-field/text-field-input-group.d.ts +7 -0
- package/dist/components/text-field/text-field-input-group.js +11 -0
- package/dist/components/text-field/text-field-input.cjs +27 -0
- package/dist/components/text-field/text-field-input.d.ts +5 -0
- package/dist/components/text-field/text-field-input.js +27 -0
- package/dist/components/text-field/text-field-label.cjs +27 -0
- package/dist/components/text-field/text-field-label.d.ts +8 -0
- package/dist/components/text-field/text-field-label.js +27 -0
- package/dist/components/text-field/text-field.cjs +54 -0
- package/dist/components/text-field/text-field.d.ts +12 -58
- package/dist/components/text-field/text-field.js +17 -101
- package/dist/components/text-field/util.cjs +4 -0
- package/dist/components/text-field/util.d.ts +1 -0
- package/dist/components/text-field/util.js +4 -0
- package/dist/components/text-spacing/index.cjs +4 -0
- package/dist/components/text-spacing/text-spacing.cjs +19 -0
- package/dist/components/toggle/index.cjs +4 -0
- package/dist/components/toggle/toggle.cjs +104 -0
- package/dist/components/visually-hidden/index.cjs +4 -0
- package/dist/components/visually-hidden/visually-hidden.cjs +26 -0
- package/dist/drawer.module-BxsrDZFu.js +14 -0
- package/dist/drawer.module-CWDhohQm.cjs +13 -0
- package/dist/icons/category.cjs +335 -0
- package/dist/icons/name.cjs +335 -0
- package/dist/icons/name.d.cjs +1 -0
- package/dist/main.cjs +374 -0
- package/dist/main.js +6 -3
- package/dist/style.css +573 -492
- package/dist/tokens/border/variables.cjs +20 -0
- package/dist/tokens/breakpoint/variables.cjs +10 -0
- package/dist/tokens/color/variables.cjs +454 -0
- package/dist/tokens/index.cjs +310 -0
- package/dist/tokens/motion/variables.cjs +24 -0
- package/dist/tokens/shadow/variables.cjs +10 -0
- package/dist/tokens/spacing/variables.cjs +48 -0
- package/dist/tokens/typography/variables.cjs +50 -0
- package/dist/utils/action.cjs +21 -0
- package/dist/utils/component-props-as.cjs +1 -0
- package/dist/utils/composeEventHandlers.cjs +11 -0
- package/dist/utils/composeRefs.cjs +18 -0
- package/dist/utils/generate-styling/align.cjs +32 -0
- package/dist/utils/generate-styling/color.cjs +12 -0
- package/dist/utils/generate-styling/flex.cjs +67 -0
- package/dist/utils/generate-styling/gap.cjs +22 -0
- package/dist/utils/generate-styling/grid.cjs +123 -0
- package/dist/utils/generate-styling/height.cjs +51 -0
- package/dist/utils/generate-styling/index.cjs +97 -0
- package/dist/utils/generate-styling/inset.cjs +33 -0
- package/dist/utils/generate-styling/justify.cjs +18 -0
- package/dist/utils/generate-styling/margin.cjs +33 -0
- package/dist/utils/generate-styling/object-fit.cjs +18 -0
- package/dist/utils/generate-styling/padding.cjs +33 -0
- package/dist/utils/generate-styling/position.cjs +21 -0
- package/dist/utils/generate-styling/util.cjs +33 -0
- package/dist/utils/generate-styling/width.cjs +26 -0
- package/dist/vite-env.d.cjs +1 -0
- package/package.json +6 -4
- package/dist/components/text-field/tex-field-label.d.ts +0 -0
- package/dist/components/text-field/tex-field-label.js +0 -1
- package/dist/drawer.module-B3QhrxH1.js +0 -14
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const clsx = require("clsx");
|
|
6
|
+
const RadioGroupPrimitive = require("@radix-ui/react-radio-group");
|
|
7
|
+
const components_label_label = require("../label/label.cjs");
|
|
8
|
+
const utils_composeRefs = require("../../utils/composeRefs.cjs");
|
|
9
|
+
const reactSlot = require("@radix-ui/react-slot");
|
|
10
|
+
function _interopNamespaceDefault(e) {
|
|
11
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
12
|
+
if (e) {
|
|
13
|
+
for (const k in e) {
|
|
14
|
+
if (k !== "default") {
|
|
15
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: () => e[k]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
const RadioGroupPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadioGroupPrimitive);
|
|
27
|
+
const styles = {
|
|
28
|
+
"teddy-radio-group": "_teddy-radio-group_1flae_1",
|
|
29
|
+
"teddy-radio-group__group-label": "_teddy-radio-group__group-label_1flae_10",
|
|
30
|
+
"teddy-radio-group__label": "_teddy-radio-group__label_1flae_13",
|
|
31
|
+
"teddy-radio-group__group-label--required": "_teddy-radio-group__group-label--required_1flae_23",
|
|
32
|
+
"teddy-radio-group__item": "_teddy-radio-group__item_1flae_26",
|
|
33
|
+
"teddy-radio-group__trigger": "_teddy-radio-group__trigger_1flae_54",
|
|
34
|
+
"teddy-radio-group__indicator": "_teddy-radio-group__indicator_1flae_111"
|
|
35
|
+
};
|
|
36
|
+
const rootClassName = "teddy-radio-group";
|
|
37
|
+
const RootContext = React.createContext(void 0);
|
|
38
|
+
const Root = React.forwardRef(
|
|
39
|
+
({ className, ...props }, forwardRef) => {
|
|
40
|
+
const classes = clsx([styles[`${rootClassName}`]], className);
|
|
41
|
+
const [groupLabelId, setGroupLabelId] = React.useState();
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RootContext.Provider, { value: { setGroupLabelId, required: props.required }, children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Root, { "aria-labelledby": groupLabelId, ...props, ref: forwardRef, className: classes }) });
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
Root.displayName = "RadioGroup";
|
|
46
|
+
const ItemContext = React.createContext(
|
|
47
|
+
void 0
|
|
48
|
+
);
|
|
49
|
+
const Item = React.forwardRef(({ className, ...props }, forwardRef) => {
|
|
50
|
+
const classes = clsx([styles[`${rootClassName}__item`]], className);
|
|
51
|
+
const triggerRef = React.useRef(null);
|
|
52
|
+
const triggerId = `${React.useId()}-trigger`;
|
|
53
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemContext.Provider, { value: { triggerRef, id: triggerId }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, ref: forwardRef, className: classes }) });
|
|
54
|
+
});
|
|
55
|
+
Item.displayName = "RadioGroup.Item";
|
|
56
|
+
const GroupLabel = React.forwardRef(
|
|
57
|
+
({ className, asChild, as: Tag = "h3", children, ...props }, forwardRef) => {
|
|
58
|
+
const context = React.useContext(RootContext);
|
|
59
|
+
const classes = clsx(
|
|
60
|
+
[styles[`${rootClassName}__group-label`]],
|
|
61
|
+
{
|
|
62
|
+
[styles[`${rootClassName}__group-label--required`]]: context == null ? void 0 : context.required
|
|
63
|
+
},
|
|
64
|
+
className
|
|
65
|
+
);
|
|
66
|
+
const fallbackId = React.useId();
|
|
67
|
+
const id = props.id || fallbackId;
|
|
68
|
+
React.useEffect(() => {
|
|
69
|
+
if (context) {
|
|
70
|
+
context.setGroupLabelId(id);
|
|
71
|
+
}
|
|
72
|
+
}, [id, context]);
|
|
73
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { ...props, id, ref: forwardRef, className: classes, children: asChild ? children : Tag ? /* @__PURE__ */ jsxRuntime.jsx(Tag, { children }) : null });
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
GroupLabel.displayName = "RadioGroup.GroupLabel";
|
|
77
|
+
const Trigger = React.forwardRef(
|
|
78
|
+
({ className, children, ...props }, forwardRef) => {
|
|
79
|
+
const classes = clsx([styles[`${rootClassName}__trigger`]], className);
|
|
80
|
+
const context = React.useContext(ItemContext);
|
|
81
|
+
const ref = utils_composeRefs.useComposedRefs(forwardRef, context == null ? void 0 : context.triggerRef);
|
|
82
|
+
const id = props.id || (context == null ? void 0 : context.id);
|
|
83
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Item, { ...props, id, ref, className: classes, children: children || /* @__PURE__ */ jsxRuntime.jsx(Indicator, {}) });
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
Trigger.displayName = "RadioGroup.Trigger";
|
|
87
|
+
const Indicator = React.forwardRef(
|
|
88
|
+
({ className, ...props }, forwardRef) => {
|
|
89
|
+
const classes = clsx([styles[`${rootClassName}__indicator`]], className);
|
|
90
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { ...props, ref: forwardRef, className: classes });
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
Indicator.displayName = "RadioGroup.Indicator";
|
|
94
|
+
const Label = React.forwardRef(
|
|
95
|
+
({ className, ...props }, forwardRef) => {
|
|
96
|
+
const classes = clsx([styles[`${rootClassName}__label`]], className);
|
|
97
|
+
const context = React.useContext(ItemContext);
|
|
98
|
+
const htmlFor = props.htmlFor || (context == null ? void 0 : context.id);
|
|
99
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components_label_label.Label, { ...props, htmlFor, ref: forwardRef, className: classes });
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
Label.displayName = "RadioGroup.Label";
|
|
103
|
+
const RadioGroup = Object.assign(Root, {
|
|
104
|
+
Item,
|
|
105
|
+
Trigger,
|
|
106
|
+
Indicator,
|
|
107
|
+
Label,
|
|
108
|
+
GroupLabel
|
|
109
|
+
});
|
|
110
|
+
exports.RadioGroup = RadioGroup;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const components_scrollArea_scrollAreaBar = require("./scroll-area-bar.cjs");
|
|
4
|
+
const components_scrollArea_scrollAreaItem = require("./scroll-area-item.cjs");
|
|
5
|
+
const ScrollArea = Object.assign(components_scrollArea_scrollAreaBar.Root, {
|
|
6
|
+
Item: components_scrollArea_scrollAreaItem.Item,
|
|
7
|
+
Button: components_scrollArea_scrollAreaBar.Button
|
|
8
|
+
});
|
|
9
|
+
exports.ScrollArea = ScrollArea;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const clsx = require("clsx");
|
|
6
|
+
const ScrollAreaPrimitive = require("@radix-ui/react-scroll-area");
|
|
7
|
+
const components_button_button = require("../button/button.cjs");
|
|
8
|
+
const utils_composeEventHandlers = require("../../utils/composeEventHandlers.cjs");
|
|
9
|
+
require("../../assets/sprite.5636ec8e-teddy.svg");
|
|
10
|
+
const components_icon_icon = require("../icon/icon.cjs");
|
|
11
|
+
const reactSlot = require("@radix-ui/react-slot");
|
|
12
|
+
function _interopNamespaceDefault(e) {
|
|
13
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
14
|
+
if (e) {
|
|
15
|
+
for (const k in e) {
|
|
16
|
+
if (k !== "default") {
|
|
17
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: () => e[k]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
n.default = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
const ScrollAreaPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(ScrollAreaPrimitive);
|
|
29
|
+
const styles = {
|
|
30
|
+
"teddy-scroll-area": "_teddy-scroll-area_1o8ft_3",
|
|
31
|
+
"teddy-scroll-area__viewport": "_teddy-scroll-area__viewport_1o8ft_7",
|
|
32
|
+
"teddy-scroll-area__scrollbar": "_teddy-scroll-area__scrollbar_1o8ft_12",
|
|
33
|
+
"teddy-scroll-area__scrollbar--hidden": "_teddy-scroll-area__scrollbar--hidden_1o8ft_33",
|
|
34
|
+
"teddy-scroll-area__thumb": "_teddy-scroll-area__thumb_1o8ft_46",
|
|
35
|
+
"teddy-scroll-area__corner": "_teddy-scroll-area__corner_1o8ft_63",
|
|
36
|
+
"teddy-scroll-area__button": "_teddy-scroll-area__button_1o8ft_66",
|
|
37
|
+
"teddy-scroll-area__button--hidden": "_teddy-scroll-area__button--hidden_1o8ft_94"
|
|
38
|
+
};
|
|
39
|
+
const Scrollbar = React.forwardRef(
|
|
40
|
+
({ className, ...props }, forwardRef) => {
|
|
41
|
+
const context = React.useContext(RootContext);
|
|
42
|
+
const classes = clsx(
|
|
43
|
+
[styles[`${rootClassName}__scrollbar`]],
|
|
44
|
+
{
|
|
45
|
+
[styles[`${rootClassName}__scrollbar--hidden`]]: (context == null ? void 0 : context.variant) !== "scrollbar"
|
|
46
|
+
},
|
|
47
|
+
className
|
|
48
|
+
);
|
|
49
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Scrollbar, { ...props, ref: forwardRef, className: classes });
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
Scrollbar.displayName = "Scrollbar";
|
|
53
|
+
const Thumb = React.forwardRef(
|
|
54
|
+
({ className, ...props }, forwardRef) => {
|
|
55
|
+
const classes = clsx([styles[`${rootClassName}__thumb`]], className);
|
|
56
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Thumb, { ...props, ref: forwardRef, className: classes });
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
Thumb.displayName = "Thumb";
|
|
60
|
+
const Corner = React.forwardRef(
|
|
61
|
+
({ className, ...props }, forwardRef) => {
|
|
62
|
+
const classes = clsx([styles[`${rootClassName}__corner`]], className);
|
|
63
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, { ...props, ref: forwardRef, className: classes });
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
Corner.displayName = "Corner";
|
|
67
|
+
const Button = React.forwardRef(
|
|
68
|
+
({ className, hidden, direction, children, ...props }, forwardRef) => {
|
|
69
|
+
const context = React.useContext(RootContext);
|
|
70
|
+
const internalHidden = hidden ?? (direction === "up" && !(context == null ? void 0 : context.hasScrollTop) || direction === "down" && !(context == null ? void 0 : context.hasScrollBottom) || direction === "left" && !(context == null ? void 0 : context.hasScrollLeft) || direction === "right" && !(context == null ? void 0 : context.hasScrollRight));
|
|
71
|
+
const classes = clsx(
|
|
72
|
+
[styles[`${rootClassName}__button`]],
|
|
73
|
+
{
|
|
74
|
+
[styles[`${rootClassName}__button--hidden`]]: internalHidden
|
|
75
|
+
},
|
|
76
|
+
className
|
|
77
|
+
);
|
|
78
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
+
components_button_button.Button,
|
|
80
|
+
{
|
|
81
|
+
iconOnly: true,
|
|
82
|
+
variant: "primary",
|
|
83
|
+
"aria-label": direction === "down" ? "Scroll ned" : direction === "up" ? "Scroll opp" : direction === "left" ? "Scroll venstre" : "Scroll høyre",
|
|
84
|
+
"data-direction": direction,
|
|
85
|
+
tabIndex: internalHidden ? -1 : void 0,
|
|
86
|
+
...props,
|
|
87
|
+
onClick: utils_composeEventHandlers.composeEventHandlers(props.onClick, (e) => {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
if (e.defaultPrevented)
|
|
90
|
+
return;
|
|
91
|
+
const scroll = (_a = context == null ? void 0 : context.scrollRef) == null ? void 0 : _a.getBoundingClientRect();
|
|
92
|
+
const scrollDirection = direction === "up" || direction === "left" ? -1 : 1;
|
|
93
|
+
const scrollAxis = direction === "up" || direction === "down" ? "top" : "left";
|
|
94
|
+
const scrollAmount = ((direction === "up" || direction === "down" ? scroll == null ? void 0 : scroll.height : scroll == null ? void 0 : scroll.width) || 0) * 0.7;
|
|
95
|
+
(_b = context == null ? void 0 : context.scrollRef) == null ? void 0 : _b.scrollBy({
|
|
96
|
+
[scrollAxis]: scrollAmount * scrollDirection,
|
|
97
|
+
behavior: "smooth"
|
|
98
|
+
});
|
|
99
|
+
}),
|
|
100
|
+
ref: forwardRef,
|
|
101
|
+
className: classes,
|
|
102
|
+
children: children || /* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
+
components_icon_icon.Icon,
|
|
104
|
+
{
|
|
105
|
+
name: direction === "down" ? "chevron-down" : direction === "up" ? "chevron-up" : direction === "left" ? "chevron-left" : "chevron-right"
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
components_button_button.Button.displayName = "Button";
|
|
113
|
+
const rootClassName = "teddy-scroll-area";
|
|
114
|
+
const RootContext = React.createContext(void 0);
|
|
115
|
+
const Root = React.forwardRef(
|
|
116
|
+
({ className, variant, children, ...props }, forwardRef) => {
|
|
117
|
+
const [scrollRef, setScrollRef] = React.useState(null);
|
|
118
|
+
const [hasScroll, setHasScroll] = React.useState(null);
|
|
119
|
+
const initialHasScrollLeft = scrollRef ? scrollRef.scrollLeft > 0 : null;
|
|
120
|
+
const initialHasScrollRight = scrollRef ? scrollRef.scrollLeft < scrollRef.scrollWidth - scrollRef.clientWidth : null;
|
|
121
|
+
const initialHasScrollTop = scrollRef ? scrollRef.scrollTop > 0 : null;
|
|
122
|
+
const initialHasScrollBottom = scrollRef ? scrollRef.scrollTop < scrollRef.scrollHeight - scrollRef.clientHeight : null;
|
|
123
|
+
const hasScrollLeft = hasScroll ? hasScroll.left : initialHasScrollLeft;
|
|
124
|
+
const hasScrollRight = hasScroll ? hasScroll.right : initialHasScrollRight;
|
|
125
|
+
const hasScrollTop = hasScroll ? hasScroll.top : initialHasScrollTop;
|
|
126
|
+
const hasScrollBottom = hasScroll ? hasScroll.bottom : initialHasScrollBottom;
|
|
127
|
+
const hasScrollHorizontal = hasScrollLeft || hasScrollRight;
|
|
128
|
+
const hasScrollVertical = hasScrollTop || hasScrollBottom;
|
|
129
|
+
const classes = clsx([styles[`${rootClassName}`]], className);
|
|
130
|
+
function handleScroll(e) {
|
|
131
|
+
const target = e.currentTarget;
|
|
132
|
+
setHasScroll({
|
|
133
|
+
left: target.scrollLeft > 0,
|
|
134
|
+
right: target.scrollLeft < target.scrollWidth - target.clientWidth,
|
|
135
|
+
top: target.scrollTop > 0,
|
|
136
|
+
bottom: target.scrollTop < target.scrollHeight - target.clientHeight
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
140
|
+
RootContext.Provider,
|
|
141
|
+
{
|
|
142
|
+
value: { scrollRef, variant, hasScrollTop, hasScrollBottom, hasScrollLeft, hasScrollRight },
|
|
143
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(ScrollAreaPrimitive__namespace.Root, { ...props, ref: forwardRef, className: classes, children: [
|
|
144
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
145
|
+
ScrollAreaPrimitive__namespace.Viewport,
|
|
146
|
+
{
|
|
147
|
+
onScroll: handleScroll,
|
|
148
|
+
ref: setScrollRef,
|
|
149
|
+
className: clsx([styles[`${rootClassName}__viewport`]]),
|
|
150
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slottable, { children })
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ jsxRuntime.jsx(Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(Thumb, {}) }),
|
|
154
|
+
/* @__PURE__ */ jsxRuntime.jsx(Scrollbar, { orientation: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsx(Thumb, {}) }),
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsx(Corner, {}),
|
|
156
|
+
variant === "button" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
157
|
+
hasScrollVertical && /* @__PURE__ */ jsxRuntime.jsx(Button, { direction: "up", hidden: !hasScrollTop }),
|
|
158
|
+
hasScrollVertical && /* @__PURE__ */ jsxRuntime.jsx(Button, { direction: "down", hidden: !hasScrollBottom }),
|
|
159
|
+
hasScrollHorizontal && /* @__PURE__ */ jsxRuntime.jsx(Button, { direction: "left", hidden: !hasScrollLeft }),
|
|
160
|
+
hasScrollHorizontal && /* @__PURE__ */ jsxRuntime.jsx(Button, { direction: "right", hidden: !hasScrollRight })
|
|
161
|
+
] })
|
|
162
|
+
] })
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
Root.displayName = "Root";
|
|
168
|
+
exports.Button = Button;
|
|
169
|
+
exports.Corner = Corner;
|
|
170
|
+
exports.Root = Root;
|
|
171
|
+
exports.RootContext = RootContext;
|
|
172
|
+
exports.Scrollbar = Scrollbar;
|
|
173
|
+
exports.Thumb = Thumb;
|
|
174
|
+
exports.rootClassName = rootClassName;
|
|
175
|
+
exports.styles = styles;
|
|
@@ -8,14 +8,14 @@ import "../../assets/sprite.5636ec8e-teddy.svg";
|
|
|
8
8
|
import { Icon } from "../icon/icon.js";
|
|
9
9
|
import { Slottable } from "@radix-ui/react-slot";
|
|
10
10
|
const styles = {
|
|
11
|
-
"teddy-scroll-area": "_teddy-scroll-
|
|
12
|
-
"teddy-scroll-area__viewport": "_teddy-scroll-
|
|
13
|
-
"teddy-scroll-area__scrollbar": "_teddy-scroll-
|
|
14
|
-
"teddy-scroll-area__scrollbar--hidden": "_teddy-scroll-area__scrollbar--
|
|
15
|
-
"teddy-scroll-area__thumb": "_teddy-scroll-
|
|
16
|
-
"teddy-scroll-area__corner": "_teddy-scroll-
|
|
17
|
-
"teddy-scroll-area__button": "_teddy-scroll-
|
|
18
|
-
"teddy-scroll-area__button--hidden": "_teddy-scroll-area__button--
|
|
11
|
+
"teddy-scroll-area": "_teddy-scroll-area_1o8ft_3",
|
|
12
|
+
"teddy-scroll-area__viewport": "_teddy-scroll-area__viewport_1o8ft_7",
|
|
13
|
+
"teddy-scroll-area__scrollbar": "_teddy-scroll-area__scrollbar_1o8ft_12",
|
|
14
|
+
"teddy-scroll-area__scrollbar--hidden": "_teddy-scroll-area__scrollbar--hidden_1o8ft_33",
|
|
15
|
+
"teddy-scroll-area__thumb": "_teddy-scroll-area__thumb_1o8ft_46",
|
|
16
|
+
"teddy-scroll-area__corner": "_teddy-scroll-area__corner_1o8ft_63",
|
|
17
|
+
"teddy-scroll-area__button": "_teddy-scroll-area__button_1o8ft_66",
|
|
18
|
+
"teddy-scroll-area__button--hidden": "_teddy-scroll-area__button--hidden_1o8ft_94"
|
|
19
19
|
};
|
|
20
20
|
const Scrollbar = React__default.forwardRef(
|
|
21
21
|
({ className, ...props }, forwardRef) => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("react/jsx-runtime");
|
|
4
|
+
require("react");
|
|
5
|
+
require("clsx");
|
|
6
|
+
const components_scrollArea_scrollAreaBar = require("./scroll-area-bar.cjs");
|
|
7
|
+
require("../button/button.cjs");
|
|
8
|
+
require("../../utils/composeEventHandlers.cjs");
|
|
9
|
+
require("../../assets/sprite.5636ec8e-teddy.svg");
|
|
10
|
+
require("../icon/icon.cjs");
|
|
11
|
+
exports.Button = components_scrollArea_scrollAreaBar.Button;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("react/jsx-runtime");
|
|
4
|
+
require("react");
|
|
5
|
+
require("clsx");
|
|
6
|
+
require("@radix-ui/react-scroll-area");
|
|
7
|
+
const components_scrollArea_scrollAreaBar = require("./scroll-area-bar.cjs");
|
|
8
|
+
exports.Corner = components_scrollArea_scrollAreaBar.Corner;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const clsx = require("clsx");
|
|
6
|
+
const components_scrollArea_scrollAreaBar = require("./scroll-area-bar.cjs");
|
|
7
|
+
const reactSlot = require("@radix-ui/react-slot");
|
|
8
|
+
const utils_composeEventHandlers = require("../../utils/composeEventHandlers.cjs");
|
|
9
|
+
const Item = React.forwardRef(
|
|
10
|
+
({ className, asChild, ...props }, forwardRef) => {
|
|
11
|
+
const classes = clsx([components_scrollArea_scrollAreaBar.styles[`${components_scrollArea_scrollAreaBar.rootClassName}__item`]], className);
|
|
12
|
+
const Comp = asChild ? reactSlot.Slot : "div";
|
|
13
|
+
const context = React.useContext(components_scrollArea_scrollAreaBar.RootContext);
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
|
+
Comp,
|
|
16
|
+
{
|
|
17
|
+
...props,
|
|
18
|
+
onClick: utils_composeEventHandlers.composeEventHandlers(props.onClick, (e) => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (e.defaultPrevented)
|
|
21
|
+
return;
|
|
22
|
+
const scroll = (_a = context == null ? void 0 : context.scrollRef) == null ? void 0 : _a.getBoundingClientRect();
|
|
23
|
+
const item = e.currentTarget.getBoundingClientRect();
|
|
24
|
+
const scrollViewVerticalCenter = ((scroll == null ? void 0 : scroll.top) || 0) + ((scroll == null ? void 0 : scroll.height) || 0) / 2;
|
|
25
|
+
const itemVerticalCenter = ((item == null ? void 0 : item.top) || 0) + ((item == null ? void 0 : item.height) || 0) / 2;
|
|
26
|
+
const scrollViewHorizontalCenter = ((scroll == null ? void 0 : scroll.left) || 0) + ((scroll == null ? void 0 : scroll.width) || 0) / 2;
|
|
27
|
+
const itemHorizontalCenter = ((item == null ? void 0 : item.left) || 0) + ((item == null ? void 0 : item.width) || 0) / 2;
|
|
28
|
+
const hasReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
29
|
+
(_b = context == null ? void 0 : context.scrollRef) == null ? void 0 : _b.scrollBy({
|
|
30
|
+
top: itemVerticalCenter - scrollViewVerticalCenter,
|
|
31
|
+
left: itemHorizontalCenter - scrollViewHorizontalCenter,
|
|
32
|
+
behavior: hasReducedMotion ? "auto" : "smooth"
|
|
33
|
+
});
|
|
34
|
+
}),
|
|
35
|
+
ref: forwardRef,
|
|
36
|
+
className: classes
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
Item.displayName = "Item";
|
|
42
|
+
exports.Item = Item;
|
|
@@ -23,10 +23,11 @@ const Item = React__default.forwardRef(
|
|
|
23
23
|
const itemVerticalCenter = ((item == null ? void 0 : item.top) || 0) + ((item == null ? void 0 : item.height) || 0) / 2;
|
|
24
24
|
const scrollViewHorizontalCenter = ((scroll == null ? void 0 : scroll.left) || 0) + ((scroll == null ? void 0 : scroll.width) || 0) / 2;
|
|
25
25
|
const itemHorizontalCenter = ((item == null ? void 0 : item.left) || 0) + ((item == null ? void 0 : item.width) || 0) / 2;
|
|
26
|
+
const hasReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
26
27
|
(_b = context == null ? void 0 : context.scrollRef) == null ? void 0 : _b.scrollBy({
|
|
27
28
|
top: itemVerticalCenter - scrollViewVerticalCenter,
|
|
28
29
|
left: itemHorizontalCenter - scrollViewHorizontalCenter,
|
|
29
|
-
behavior: "smooth"
|
|
30
|
+
behavior: hasReducedMotion ? "auto" : "smooth"
|
|
30
31
|
});
|
|
31
32
|
}),
|
|
32
33
|
ref: forwardRef,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("react/jsx-runtime");
|
|
4
|
+
require("react");
|
|
5
|
+
require("clsx");
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("react/jsx-runtime");
|
|
4
|
+
require("react");
|
|
5
|
+
require("clsx");
|
|
6
|
+
require("@radix-ui/react-scroll-area");
|
|
7
|
+
const components_scrollArea_scrollAreaBar = require("./scroll-area-bar.cjs");
|
|
8
|
+
exports.Thumb = components_scrollArea_scrollAreaBar.Thumb;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const clsx = require("clsx");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const dash = "_dash_ywden_1";
|
|
7
|
+
const rotate = "_rotate_ywden_1";
|
|
8
|
+
const styles = {
|
|
9
|
+
"teddy-spinner--xxs": "_teddy-spinner--xxs_ywden_1",
|
|
10
|
+
"teddy-spinner--xs": "_teddy-spinner--xs_ywden_5",
|
|
11
|
+
"teddy-spinner--sm": "_teddy-spinner--sm_ywden_9",
|
|
12
|
+
"teddy-spinner--md": "_teddy-spinner--md_ywden_13",
|
|
13
|
+
"teddy-spinner--lg": "_teddy-spinner--lg_ywden_18",
|
|
14
|
+
"teddy-spinner__circle": "_teddy-spinner__circle_ywden_23",
|
|
15
|
+
dash,
|
|
16
|
+
rotate,
|
|
17
|
+
"teddy-spinner__circle--disabled": "_teddy-spinner__circle--disabled_ywden_33",
|
|
18
|
+
"teddy-spinner__circle--negative": "_teddy-spinner__circle--negative_ywden_36",
|
|
19
|
+
"teddy-spinner__circle--negative-disabled": "_teddy-spinner__circle--negative-disabled_ywden_39"
|
|
20
|
+
};
|
|
21
|
+
const rootClassName = "teddy-spinner";
|
|
22
|
+
const SPINNER_VARIANT = {
|
|
23
|
+
PRIMARY: "primary",
|
|
24
|
+
DISABLED: "disabled",
|
|
25
|
+
NEGATIVE: "negative",
|
|
26
|
+
NEGATIVE_DISABLED: "negative-disabled"
|
|
27
|
+
};
|
|
28
|
+
const SPINNER_SIZE = {
|
|
29
|
+
XXS: "xxs",
|
|
30
|
+
XS: "xs",
|
|
31
|
+
SM: "sm",
|
|
32
|
+
MD: "md",
|
|
33
|
+
LG: "lg"
|
|
34
|
+
};
|
|
35
|
+
const Spinner = React.forwardRef(
|
|
36
|
+
({ size = SPINNER_SIZE.SM, variant = SPINNER_VARIANT.PRIMARY, className, ...props }, forwardRef) => {
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
+
"svg",
|
|
39
|
+
{
|
|
40
|
+
...props,
|
|
41
|
+
viewBox: "0 0 50 50",
|
|
42
|
+
className: clsx([styles[rootClassName], styles[`${rootClassName}--${size}`], className]),
|
|
43
|
+
ref: forwardRef,
|
|
44
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
45
|
+
"circle",
|
|
46
|
+
{
|
|
47
|
+
className: clsx(styles[`${rootClassName}__circle`], styles[`${rootClassName}__circle--${variant}`]),
|
|
48
|
+
cx: "25",
|
|
49
|
+
cy: "25",
|
|
50
|
+
r: "20"
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
exports.Spinner = Spinner;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const components_tabs_tabsRoot = require("./tabs-root.cjs");
|
|
4
|
+
const components_tabs_tabsList = require("./tabs-list.cjs");
|
|
5
|
+
const components_tabs_tabsTrigger = require("./tabs-trigger.cjs");
|
|
6
|
+
const components_tabs_tabsContent = require("./tabs-content.cjs");
|
|
7
|
+
const components_tabs_tabsScroll = require("./tabs-scroll.cjs");
|
|
8
|
+
const components_tabs_tabsScrollButton = require("./tabs-scroll-button.cjs");
|
|
9
|
+
const Tabs = Object.assign(components_tabs_tabsRoot.Root, {
|
|
10
|
+
List: components_tabs_tabsList.List,
|
|
11
|
+
Trigger: components_tabs_tabsTrigger.Trigger,
|
|
12
|
+
Content: components_tabs_tabsContent.Content,
|
|
13
|
+
Scroll: components_tabs_tabsScroll.Scroll,
|
|
14
|
+
ScrollButton: components_tabs_tabsScrollButton.ScrollButton
|
|
15
|
+
});
|
|
16
|
+
exports.Tabs = Tabs;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const TabsPrimitive = require("@radix-ui/react-tabs");
|
|
6
|
+
const clsx = require("clsx");
|
|
7
|
+
const components_tabs_tabsRoot = require("./tabs-root.cjs");
|
|
8
|
+
function _interopNamespaceDefault(e) {
|
|
9
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
|
+
if (e) {
|
|
11
|
+
for (const k in e) {
|
|
12
|
+
if (k !== "default") {
|
|
13
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: () => e[k]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
const TabsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TabsPrimitive);
|
|
25
|
+
const Content = React.forwardRef(
|
|
26
|
+
({ className, ...props }, forwardRef) => {
|
|
27
|
+
const classes = clsx([components_tabs_tabsRoot.styles[`${components_tabs_tabsRoot.rootClassName}__content`]], className);
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Content, { ...props, ref: forwardRef, className: classes });
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
Content.displayName = "Content";
|
|
32
|
+
exports.Content = Content;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const TabsPrimitive = require("@radix-ui/react-tabs");
|
|
6
|
+
const clsx = require("clsx");
|
|
7
|
+
const components_tabs_tabsRoot = require("./tabs-root.cjs");
|
|
8
|
+
const components_tabs_tabsScroll = require("./tabs-scroll.cjs");
|
|
9
|
+
const utils_composeRefs = require("../../utils/composeRefs.cjs");
|
|
10
|
+
function _interopNamespaceDefault(e) {
|
|
11
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
12
|
+
if (e) {
|
|
13
|
+
for (const k in e) {
|
|
14
|
+
if (k !== "default") {
|
|
15
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: () => e[k]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
const TabsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TabsPrimitive);
|
|
27
|
+
const List = React.forwardRef(
|
|
28
|
+
({ className, children, ...props }, forwardRef) => {
|
|
29
|
+
const classes = clsx([components_tabs_tabsRoot.styles[`${components_tabs_tabsRoot.rootClassName}__list`]], className);
|
|
30
|
+
const scrollContext = React.useContext(components_tabs_tabsScroll.ScrollContext);
|
|
31
|
+
const rootContext = React.useContext(components_tabs_tabsRoot.RootContext);
|
|
32
|
+
if (!scrollContext) {
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components_tabs_tabsScroll.Scroll, { children: /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.List, { ...props, ref: utils_composeRefs.composeRefs(forwardRef, rootContext == null ? void 0 : rootContext.listElement), className: classes, children }) });
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.List, { ...props, ref: utils_composeRefs.composeRefs(forwardRef, rootContext == null ? void 0 : rootContext.listElement), className: classes, children });
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
List.displayName = "List";
|
|
39
|
+
exports.List = List;
|
|
@@ -2,16 +2,18 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
4
4
|
import clsx from "clsx";
|
|
5
|
-
import { s as styles, rootClassName } from "./tabs-root.js";
|
|
5
|
+
import { s as styles, rootClassName, RootContext } from "./tabs-root.js";
|
|
6
6
|
import { ScrollContext, Scroll } from "./tabs-scroll.js";
|
|
7
|
+
import { composeRefs } from "../../utils/composeRefs.js";
|
|
7
8
|
const List = React__default.forwardRef(
|
|
8
|
-
({ className, ...props }, forwardRef) => {
|
|
9
|
+
({ className, children, ...props }, forwardRef) => {
|
|
9
10
|
const classes = clsx([styles[`${rootClassName}__list`]], className);
|
|
10
11
|
const scrollContext = React__default.useContext(ScrollContext);
|
|
12
|
+
const rootContext = React__default.useContext(RootContext);
|
|
11
13
|
if (!scrollContext) {
|
|
12
|
-
return /* @__PURE__ */ jsx(Scroll, { children: /* @__PURE__ */ jsx(TabsPrimitive.List, { ...props, ref: forwardRef, className: classes }) });
|
|
14
|
+
return /* @__PURE__ */ jsx(Scroll, { children: /* @__PURE__ */ jsx(TabsPrimitive.List, { ...props, ref: composeRefs(forwardRef, rootContext == null ? void 0 : rootContext.listElement), className: classes, children }) });
|
|
13
15
|
}
|
|
14
|
-
return /* @__PURE__ */ jsx(TabsPrimitive.List, { ...props, ref: forwardRef, className: classes });
|
|
16
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.List, { ...props, ref: composeRefs(forwardRef, rootContext == null ? void 0 : rootContext.listElement), className: classes, children });
|
|
15
17
|
}
|
|
16
18
|
);
|
|
17
19
|
List.displayName = "List";
|