@telia/teddy 0.0.32 → 0.0.34
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/box/box.cjs +2 -2
- package/dist/components/box/box.js +2 -2
- package/dist/components/chip/chip-indicator.d.ts +2 -2
- package/dist/components/chip/chip.cjs +3 -3
- package/dist/components/chip/chip.js +3 -3
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/color-dot/color-dot-root.cjs +29 -0
- package/dist/components/color-dot/color-dot-root.d.ts +20 -0
- package/dist/components/color-dot/color-dot-root.js +29 -0
- package/dist/components/color-dot/index.cjs +5 -0
- package/dist/components/color-dot/index.d.ts +12 -0
- package/dist/components/color-dot/index.js +5 -0
- package/dist/components/expandable-card/expandable-card-button.cjs +29 -0
- package/dist/components/expandable-card/expandable-card-button.d.ts +33 -0
- package/dist/components/expandable-card/expandable-card-button.js +29 -0
- package/dist/components/expandable-card/expandable-card-content.cjs +32 -0
- package/dist/components/expandable-card/expandable-card-content.d.ts +5 -0
- package/dist/components/expandable-card/expandable-card-content.js +15 -0
- package/dist/components/expandable-card/expandable-card-description.cjs +14 -0
- package/dist/components/expandable-card/expandable-card-description.d.ts +5 -0
- package/dist/components/expandable-card/expandable-card-description.js +14 -0
- package/dist/components/expandable-card/expandable-card-header.cjs +13 -0
- package/dist/components/expandable-card/expandable-card-header.d.ts +4 -0
- package/dist/components/expandable-card/expandable-card-header.js +13 -0
- package/dist/components/expandable-card/expandable-card-hidden.cjs +13 -0
- package/dist/components/expandable-card/expandable-card-hidden.d.ts +4 -0
- package/dist/components/expandable-card/expandable-card-hidden.js +13 -0
- package/dist/components/expandable-card/expandable-card-indicator.cjs +16 -0
- package/dist/components/expandable-card/expandable-card-indicator.d.ts +7 -0
- package/dist/components/expandable-card/expandable-card-indicator.js +16 -0
- package/dist/components/expandable-card/expandable-card-item.cjs +36 -0
- package/dist/components/expandable-card/expandable-card-item.d.ts +5 -0
- package/dist/components/expandable-card/expandable-card-item.js +19 -0
- package/dist/components/expandable-card/expandable-card-line.cjs +16 -0
- package/dist/components/expandable-card/expandable-card-line.d.ts +8 -0
- package/dist/components/expandable-card/expandable-card-line.js +16 -0
- package/dist/components/expandable-card/expandable-card-price.cjs +13 -0
- package/dist/components/expandable-card/expandable-card-price.d.ts +4 -0
- package/dist/components/expandable-card/expandable-card-price.js +13 -0
- package/dist/components/expandable-card/expandable-card-root.cjs +51 -0
- package/dist/components/expandable-card/expandable-card-root.d.ts +6 -0
- package/dist/components/expandable-card/expandable-card-root.js +34 -0
- package/dist/components/expandable-card/expandable-card-slot.cjs +33 -0
- package/dist/components/expandable-card/expandable-card-slot.d.ts +8 -0
- package/dist/components/expandable-card/expandable-card-slot.js +33 -0
- package/dist/components/expandable-card/expandable-card-trigger.cjs +35 -0
- package/dist/components/expandable-card/expandable-card-trigger.d.ts +8 -0
- package/dist/components/expandable-card/expandable-card-trigger.js +18 -0
- package/dist/components/expandable-card/index.cjs +37 -0
- package/dist/components/expandable-card/index.d.ts +61 -0
- package/dist/components/expandable-card/index.js +37 -0
- package/dist/components/flex/flex.cjs +2 -2
- package/dist/components/flex/flex.js +2 -2
- package/dist/components/grid/grid.cjs +2 -2
- package/dist/components/grid/grid.js +2 -2
- package/dist/components/index.cjs +10 -4
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +8 -2
- package/dist/components/list/index.d.ts +3 -0
- package/dist/components/list/list.cjs +15 -15
- package/dist/components/list/list.d.ts +6 -1
- package/dist/components/list/list.js +15 -15
- package/dist/components/modal/modal.cjs +5 -2
- package/dist/components/modal/modal.js +5 -2
- package/dist/components/navigation-menu/global-navigation/global-navigation-mobile.cjs +0 -1
- package/dist/components/navigation-menu/global-navigation/global-navigation-mobile.d.ts +4 -1
- package/dist/components/navigation-menu/global-navigation/global-navigation-mobile.js +0 -1
- package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.cjs +45 -8
- package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.js +46 -9
- package/dist/components/navigation-menu/global-navigation/global-navigation-root.d.ts +3 -1
- package/dist/components/navigation-menu/global-navigation/global-navigation-root.js +2 -2
- package/dist/components/navigation-menu/global-navigation/global-navigation-search-field.cjs +7 -34
- package/dist/components/navigation-menu/global-navigation/global-navigation-search-field.js +7 -34
- package/dist/components/navigation-menu/global-navigation/global-navigation-search.cjs +0 -1
- package/dist/components/navigation-menu/global-navigation/global-navigation-search.js +2 -3
- package/dist/components/navigation-menu/global-navigation/global-navigation-shopping-cart.js +2 -2
- package/dist/components/navigation-menu/navigation-menu.d.ts +1 -1
- package/dist/components/notabene/index.cjs +14 -2
- package/dist/components/notabene/index.d.ts +16 -1
- package/dist/components/notabene/index.js +13 -1
- package/dist/components/notabene/notabene-heading.cjs +25 -0
- package/dist/components/notabene/notabene-heading.d.ts +5 -0
- package/dist/components/notabene/notabene-heading.js +25 -0
- package/dist/components/notabene/notabene-icon.cjs +18 -0
- package/dist/components/notabene/notabene-icon.d.ts +9 -0
- package/dist/components/notabene/notabene-icon.js +18 -0
- package/dist/components/notabene/notabene-root.cjs +22 -0
- package/dist/components/notabene/notabene-root.d.ts +6 -0
- package/dist/components/notabene/notabene-root.js +22 -0
- package/dist/components/notabene/notabene.content.cjs +15 -0
- package/dist/components/notabene/notabene.content.d.ts +5 -0
- package/dist/components/notabene/notabene.content.js +15 -0
- package/dist/components/notification/notification.d.ts +2 -2
- package/dist/components/progress-bar/progress-bar.d.ts +1 -1
- package/dist/components/radio-group/index.cjs +20 -2
- package/dist/components/radio-group/index.d.ts +70 -2
- package/dist/components/radio-group/index.js +19 -1
- package/dist/components/radio-group/radio-group-indicator.cjs +32 -0
- package/dist/components/radio-group/radio-group-indicator.d.ts +5 -0
- package/dist/components/radio-group/radio-group-indicator.js +15 -0
- package/dist/components/radio-group/radio-group-item-label.cjs +18 -0
- package/dist/components/radio-group/radio-group-item-label.d.ts +15 -0
- package/dist/components/radio-group/radio-group-item-label.js +18 -0
- package/dist/components/radio-group/radio-group-item.cjs +16 -0
- package/dist/components/radio-group/radio-group-item.d.ts +9 -0
- package/dist/components/radio-group/radio-group-item.js +16 -0
- package/dist/components/radio-group/radio-group-label.cjs +29 -0
- package/dist/components/radio-group/radio-group-label.d.ts +66 -0
- package/dist/components/radio-group/radio-group-label.js +29 -0
- package/dist/components/radio-group/radio-group-root.cjs +46 -0
- package/dist/components/radio-group/radio-group-root.d.ts +52 -0
- package/dist/components/radio-group/radio-group-root.js +29 -0
- package/dist/components/radio-group/radio-group-trigger.cjs +38 -0
- package/dist/components/radio-group/radio-group-trigger.d.ts +14 -0
- package/dist/components/radio-group/radio-group-trigger.js +21 -0
- package/dist/components/ribbon/index.cjs +6 -0
- package/dist/components/ribbon/index.d.ts +6 -0
- package/dist/components/ribbon/index.js +6 -0
- package/dist/components/ribbon/ribbon-root.cjs +32 -0
- package/dist/components/ribbon/ribbon-root.d.ts +13 -0
- package/dist/components/ribbon/ribbon-root.js +32 -0
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/tabs-list.cjs +11 -0
- package/dist/components/tabs/tabs-list.js +11 -0
- package/dist/components/tabs/tabs-root.d.ts +1 -1
- package/dist/components/tabs/tabs-trigger.cjs +2 -2
- package/dist/components/tabs/tabs-trigger.d.ts +1 -1
- package/dist/components/tabs/tabs-trigger.js +2 -2
- package/dist/components/toggle/toggle.d.ts +2 -2
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/main.cjs +10 -4
- package/dist/main.js +8 -2
- package/dist/style.css +725 -534
- package/dist/utils/generate-styling/grid.d.ts +24 -24
- package/dist/utils/generate-styling/index.d.ts +16 -16
- package/dist/utils/generate-styling/util.d.ts +2 -2
- package/package.json +1 -1
- package/dist/components/notabene/notabene.cjs +0 -35
- package/dist/components/notabene/notabene.d.ts +0 -15
- package/dist/components/notabene/notabene.js +0 -35
- package/dist/components/radio-group/radio-group.cjs +0 -110
- package/dist/components/radio-group/radio-group.d.ts +0 -161
- package/dist/components/radio-group/radio-group.js +0 -93
|
@@ -0,0 +1,29 @@
|
|
|
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 components_radioGroup_radioGroupRoot = require("./radio-group-root.cjs");
|
|
7
|
+
const reactSlot = require("@radix-ui/react-slot");
|
|
8
|
+
const GroupLabel = React.forwardRef(
|
|
9
|
+
({ className, asChild, as: Tag = "h3", children, ...props }, forwardRef) => {
|
|
10
|
+
const context = React.useContext(components_radioGroup_radioGroupRoot.RootContext);
|
|
11
|
+
const classes = clsx(
|
|
12
|
+
[components_radioGroup_radioGroupRoot.styles[`${components_radioGroup_radioGroupRoot.rootClassName}__group-label`]],
|
|
13
|
+
{
|
|
14
|
+
[components_radioGroup_radioGroupRoot.styles[`${components_radioGroup_radioGroupRoot.rootClassName}__group-label--required`]]: context == null ? void 0 : context.required
|
|
15
|
+
},
|
|
16
|
+
className
|
|
17
|
+
);
|
|
18
|
+
const fallbackId = React.useId();
|
|
19
|
+
const id = props.id || fallbackId;
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (context) {
|
|
22
|
+
context.setGroupLabelId(id);
|
|
23
|
+
}
|
|
24
|
+
}, [id, context]);
|
|
25
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { ...props, id, ref: forwardRef, className: classes, children: asChild ? children : Tag ? /* @__PURE__ */ jsxRuntime.jsx(Tag, { children }) : null });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
GroupLabel.displayName = "GroupLabel";
|
|
29
|
+
exports.GroupLabel = GroupLabel;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type GroupLabelProps = {
|
|
4
|
+
id?: string;
|
|
5
|
+
asChild?: false;
|
|
6
|
+
} & (AsChildProps | H2Props | H3Props | H4Props | H5Props | H6Props);
|
|
7
|
+
type AsChildProps = {
|
|
8
|
+
/**
|
|
9
|
+
* If `true`, the children element will be cloned and used instead of the heading element.
|
|
10
|
+
*/
|
|
11
|
+
asChild: true;
|
|
12
|
+
as?: never;
|
|
13
|
+
} & React.ComponentPropsWithoutRef<'h1'>;
|
|
14
|
+
type H2Props = {
|
|
15
|
+
as?: 'h2';
|
|
16
|
+
asChild?: false;
|
|
17
|
+
} & React.ComponentPropsWithoutRef<'h2'>;
|
|
18
|
+
type H3Props = {
|
|
19
|
+
as?: 'h3';
|
|
20
|
+
asChild?: false;
|
|
21
|
+
} & React.ComponentPropsWithoutRef<'h3'>;
|
|
22
|
+
type H4Props = {
|
|
23
|
+
as?: 'h4';
|
|
24
|
+
asChild?: false;
|
|
25
|
+
} & React.ComponentPropsWithoutRef<'h4'>;
|
|
26
|
+
type H5Props = {
|
|
27
|
+
as?: 'h5';
|
|
28
|
+
asChild?: false;
|
|
29
|
+
} & React.ComponentPropsWithoutRef<'h5'>;
|
|
30
|
+
type H6Props = {
|
|
31
|
+
as?: 'h6';
|
|
32
|
+
asChild?: false;
|
|
33
|
+
} & React.ComponentPropsWithoutRef<'h6'>;
|
|
34
|
+
/** Label for the radio group */
|
|
35
|
+
export declare const GroupLabel: React.ForwardRefExoticComponent<(({
|
|
36
|
+
id?: string | undefined;
|
|
37
|
+
asChild?: false | undefined;
|
|
38
|
+
} & {
|
|
39
|
+
as?: "h2" | undefined;
|
|
40
|
+
asChild?: false | undefined;
|
|
41
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">) | ({
|
|
42
|
+
id?: string | undefined;
|
|
43
|
+
asChild?: false | undefined;
|
|
44
|
+
} & {
|
|
45
|
+
as?: "h3" | undefined;
|
|
46
|
+
asChild?: false | undefined;
|
|
47
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">) | ({
|
|
48
|
+
id?: string | undefined;
|
|
49
|
+
asChild?: false | undefined;
|
|
50
|
+
} & {
|
|
51
|
+
as?: "h4" | undefined;
|
|
52
|
+
asChild?: false | undefined;
|
|
53
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">) | ({
|
|
54
|
+
id?: string | undefined;
|
|
55
|
+
asChild?: false | undefined;
|
|
56
|
+
} & {
|
|
57
|
+
as?: "h5" | undefined;
|
|
58
|
+
asChild?: false | undefined;
|
|
59
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">) | ({
|
|
60
|
+
id?: string | undefined;
|
|
61
|
+
asChild?: false | undefined;
|
|
62
|
+
} & {
|
|
63
|
+
as?: "h6" | undefined;
|
|
64
|
+
asChild?: false | undefined;
|
|
65
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">)) & React.RefAttributes<HTMLButtonElement>>;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import React__default from "react";
|
|
4
|
+
import { RootContext, s as styles, rootClassName } from "./radio-group-root.js";
|
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
+
const GroupLabel = React__default.forwardRef(
|
|
7
|
+
({ className, asChild, as: Tag = "h3", children, ...props }, forwardRef) => {
|
|
8
|
+
const context = React__default.useContext(RootContext);
|
|
9
|
+
const classes = clsx(
|
|
10
|
+
[styles[`${rootClassName}__group-label`]],
|
|
11
|
+
{
|
|
12
|
+
[styles[`${rootClassName}__group-label--required`]]: context == null ? void 0 : context.required
|
|
13
|
+
},
|
|
14
|
+
className
|
|
15
|
+
);
|
|
16
|
+
const fallbackId = React__default.useId();
|
|
17
|
+
const id = props.id || fallbackId;
|
|
18
|
+
React__default.useEffect(() => {
|
|
19
|
+
if (context) {
|
|
20
|
+
context.setGroupLabelId(id);
|
|
21
|
+
}
|
|
22
|
+
}, [id, context]);
|
|
23
|
+
return /* @__PURE__ */ jsx(Slot, { ...props, id, ref: forwardRef, className: classes, children: asChild ? children : Tag ? /* @__PURE__ */ jsx(Tag, { children }) : null });
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
GroupLabel.displayName = "GroupLabel";
|
|
27
|
+
export {
|
|
28
|
+
GroupLabel
|
|
29
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const RadioGroupPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadioGroupPrimitive);
|
|
24
|
+
const styles = {
|
|
25
|
+
"teddy-radio-group": "_teddy-radio-group_1flae_1",
|
|
26
|
+
"teddy-radio-group__group-label": "_teddy-radio-group__group-label_1flae_10",
|
|
27
|
+
"teddy-radio-group__label": "_teddy-radio-group__label_1flae_13",
|
|
28
|
+
"teddy-radio-group__group-label--required": "_teddy-radio-group__group-label--required_1flae_23",
|
|
29
|
+
"teddy-radio-group__item": "_teddy-radio-group__item_1flae_26",
|
|
30
|
+
"teddy-radio-group__trigger": "_teddy-radio-group__trigger_1flae_54",
|
|
31
|
+
"teddy-radio-group__indicator": "_teddy-radio-group__indicator_1flae_111"
|
|
32
|
+
};
|
|
33
|
+
const rootClassName = "teddy-radio-group";
|
|
34
|
+
const RootContext = React.createContext(void 0);
|
|
35
|
+
const Root = React.forwardRef(
|
|
36
|
+
({ className, ...props }, forwardRef) => {
|
|
37
|
+
const classes = clsx(styles[rootClassName], className);
|
|
38
|
+
const [groupLabelId, setGroupLabelId] = React.useState();
|
|
39
|
+
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 }) });
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
Root.displayName = "RadioGroup";
|
|
43
|
+
exports.Root = Root;
|
|
44
|
+
exports.RootContext = RootContext;
|
|
45
|
+
exports.rootClassName = rootClassName;
|
|
46
|
+
exports.styles = styles;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
4
|
+
export declare const rootClassName = "teddy-radio-group";
|
|
5
|
+
export declare const RootContext: React.Context<{
|
|
6
|
+
setGroupLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
7
|
+
required: boolean | undefined;
|
|
8
|
+
} | undefined>;
|
|
9
|
+
export type RootProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> & {
|
|
10
|
+
/** The value of the radio item that should be checked when initially rendered. Use when you do not need to control the state of the radio items. */
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
/** When `true`, prevents the user from interacting with radio items. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** The name of the group. Submitted with its owning form as part of a name/value pair. */
|
|
15
|
+
name?: string;
|
|
16
|
+
/** When `true`, indicates that the user must check a radio item before the owning form can be submitted. */
|
|
17
|
+
required?: boolean;
|
|
18
|
+
/** The controlled value of the radio item to check. Should be used in conjunction with onValueChange. */
|
|
19
|
+
value?: string;
|
|
20
|
+
/** Event handler called when the value changes. */
|
|
21
|
+
onValueChange?: (value: string) => void;
|
|
22
|
+
/** The orientation of the component. */
|
|
23
|
+
orientation?: 'horizontal' | 'vertical';
|
|
24
|
+
/** The reading direction of the radio group. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode. */
|
|
25
|
+
dir?: 'ltr' | 'rtl';
|
|
26
|
+
/** When true, keyboard navigation will loop from last item to first, and vice versa.
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
loop?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare const Root: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
32
|
+
/** The value of the radio item that should be checked when initially rendered. Use when you do not need to control the state of the radio items. */
|
|
33
|
+
defaultValue?: string | undefined;
|
|
34
|
+
/** When `true`, prevents the user from interacting with radio items. */
|
|
35
|
+
disabled?: boolean | undefined;
|
|
36
|
+
/** The name of the group. Submitted with its owning form as part of a name/value pair. */
|
|
37
|
+
name?: string | undefined;
|
|
38
|
+
/** When `true`, indicates that the user must check a radio item before the owning form can be submitted. */
|
|
39
|
+
required?: boolean | undefined;
|
|
40
|
+
/** The controlled value of the radio item to check. Should be used in conjunction with onValueChange. */
|
|
41
|
+
value?: string | undefined;
|
|
42
|
+
/** Event handler called when the value changes. */
|
|
43
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
44
|
+
/** The orientation of the component. */
|
|
45
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
46
|
+
/** The reading direction of the radio group. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode. */
|
|
47
|
+
dir?: "ltr" | "rtl" | undefined;
|
|
48
|
+
/** When true, keyboard navigation will loop from last item to first, and vice versa.
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
51
|
+
loop?: boolean | undefined;
|
|
52
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
5
|
+
const styles = {
|
|
6
|
+
"teddy-radio-group": "_teddy-radio-group_1flae_1",
|
|
7
|
+
"teddy-radio-group__group-label": "_teddy-radio-group__group-label_1flae_10",
|
|
8
|
+
"teddy-radio-group__label": "_teddy-radio-group__label_1flae_13",
|
|
9
|
+
"teddy-radio-group__group-label--required": "_teddy-radio-group__group-label--required_1flae_23",
|
|
10
|
+
"teddy-radio-group__item": "_teddy-radio-group__item_1flae_26",
|
|
11
|
+
"teddy-radio-group__trigger": "_teddy-radio-group__trigger_1flae_54",
|
|
12
|
+
"teddy-radio-group__indicator": "_teddy-radio-group__indicator_1flae_111"
|
|
13
|
+
};
|
|
14
|
+
const rootClassName = "teddy-radio-group";
|
|
15
|
+
const RootContext = React__default.createContext(void 0);
|
|
16
|
+
const Root = React__default.forwardRef(
|
|
17
|
+
({ className, ...props }, forwardRef) => {
|
|
18
|
+
const classes = clsx(styles[rootClassName], className);
|
|
19
|
+
const [groupLabelId, setGroupLabelId] = React__default.useState();
|
|
20
|
+
return /* @__PURE__ */ jsx(RootContext.Provider, { value: { setGroupLabelId, required: props.required }, children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, { "aria-labelledby": groupLabelId, ...props, ref: forwardRef, className: classes }) });
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
Root.displayName = "RadioGroup";
|
|
24
|
+
export {
|
|
25
|
+
Root,
|
|
26
|
+
RootContext,
|
|
27
|
+
rootClassName,
|
|
28
|
+
styles as s
|
|
29
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
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 components_radioGroup_radioGroupRoot = require("./radio-group-root.cjs");
|
|
7
|
+
const utils_composeRefs = require("../../utils/composeRefs.cjs");
|
|
8
|
+
const RadioGroupPrimitive = require("@radix-ui/react-radio-group");
|
|
9
|
+
const components_radioGroup_radioGroupItem = require("./radio-group-item.cjs");
|
|
10
|
+
const components_radioGroup_radioGroupIndicator = require("./radio-group-indicator.cjs");
|
|
11
|
+
function _interopNamespaceDefault(e) {
|
|
12
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
13
|
+
if (e) {
|
|
14
|
+
for (const k in e) {
|
|
15
|
+
if (k !== "default") {
|
|
16
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: () => e[k]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
n.default = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
const RadioGroupPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadioGroupPrimitive);
|
|
28
|
+
const Trigger = React.forwardRef(
|
|
29
|
+
({ className, children, ...props }, forwardRef) => {
|
|
30
|
+
const classes = clsx([components_radioGroup_radioGroupRoot.styles[`${components_radioGroup_radioGroupRoot.rootClassName}__trigger`]], className);
|
|
31
|
+
const context = React.useContext(components_radioGroup_radioGroupItem.ItemContext);
|
|
32
|
+
const ref = utils_composeRefs.useComposedRefs(forwardRef, context == null ? void 0 : context.triggerRef);
|
|
33
|
+
const id = props.id || (context == null ? void 0 : context.id);
|
|
34
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Item, { ...props, id, ref, className: classes, children: children || /* @__PURE__ */ jsxRuntime.jsx(components_radioGroup_radioGroupIndicator.Indicator, {}) });
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
Trigger.displayName = "Trigger";
|
|
38
|
+
exports.Trigger = Trigger;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
4
|
+
export type TriggerProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> & {
|
|
5
|
+
id?: string;
|
|
6
|
+
/** The value given as data when submitted with a name. This is used to determine which radio button is selected. */
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
/** Trigger is the element for selecting an option. An input will also render when used within a form to ensure events propagate correctly. */
|
|
10
|
+
export declare const Trigger: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
11
|
+
id?: string | undefined;
|
|
12
|
+
/** The value given as data when submitted with a name. This is used to determine which radio button is selected. */
|
|
13
|
+
value: string;
|
|
14
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import React__default from "react";
|
|
4
|
+
import { s as styles, rootClassName } from "./radio-group-root.js";
|
|
5
|
+
import { useComposedRefs } from "../../utils/composeRefs.js";
|
|
6
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
7
|
+
import { ItemContext } from "./radio-group-item.js";
|
|
8
|
+
import { Indicator } from "./radio-group-indicator.js";
|
|
9
|
+
const Trigger = React__default.forwardRef(
|
|
10
|
+
({ className, children, ...props }, forwardRef) => {
|
|
11
|
+
const classes = clsx([styles[`${rootClassName}__trigger`]], className);
|
|
12
|
+
const context = React__default.useContext(ItemContext);
|
|
13
|
+
const ref = useComposedRefs(forwardRef, context == null ? void 0 : context.triggerRef);
|
|
14
|
+
const id = props.id || (context == null ? void 0 : context.id);
|
|
15
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, { ...props, id, ref, className: classes, children: children || /* @__PURE__ */ jsx(Indicator, {}) });
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
Trigger.displayName = "Trigger";
|
|
19
|
+
export {
|
|
20
|
+
Trigger
|
|
21
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const components_ribbon_ribbonRoot = require("./ribbon-root.cjs");
|
|
4
|
+
components_ribbon_ribbonRoot.Root.displayName = "Ribbon";
|
|
5
|
+
const Ribbon = Object.assign(components_ribbon_ribbonRoot.Root);
|
|
6
|
+
exports.Ribbon = Ribbon;
|
|
@@ -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 clsx = require("clsx");
|
|
6
|
+
const components_flex_flex = require("../flex/flex.cjs");
|
|
7
|
+
const styles = {
|
|
8
|
+
"teddy-ribbon": "_teddy-ribbon_14u2k_2",
|
|
9
|
+
"teddy-ribbon--rounded": "_teddy-ribbon--rounded_14u2k_6",
|
|
10
|
+
"teddy-ribbon--backgroundColor-orange-100": "_teddy-ribbon--backgroundColor-orange-100_14u2k_9",
|
|
11
|
+
"teddy-ribbon--backgroundColor-green-50": "_teddy-ribbon--backgroundColor-green-50_14u2k_12",
|
|
12
|
+
"teddy-ribbon--iconPlacement-top": "_teddy-ribbon--iconPlacement-top_14u2k_19",
|
|
13
|
+
"teddy-ribbon--iconPlacement-center": "_teddy-ribbon--iconPlacement-center_14u2k_22"
|
|
14
|
+
};
|
|
15
|
+
const rootClassName = "teddy-ribbon";
|
|
16
|
+
const Root = React.forwardRef(
|
|
17
|
+
({ className, variant, iconPlacement, rounded, children, ...props }, forwardRef) => {
|
|
18
|
+
const classes = clsx(
|
|
19
|
+
[styles[`${rootClassName}`]],
|
|
20
|
+
{
|
|
21
|
+
[styles[`${rootClassName}--iconPlacement-${iconPlacement}`]]: iconPlacement,
|
|
22
|
+
[styles[`${rootClassName}--backgroundColor-${variant}`]]: variant,
|
|
23
|
+
[styles[`${rootClassName}--rounded`]]: rounded
|
|
24
|
+
},
|
|
25
|
+
className
|
|
26
|
+
);
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { ...props, ref: forwardRef, className: classes, children });
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
Root.displayName = "Root";
|
|
31
|
+
exports.Root = Root;
|
|
32
|
+
exports.rootClassName = rootClassName;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare const rootClassName = "teddy-ribbon";
|
|
4
|
+
export type RootProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
5
|
+
variant?: 'orange-100' | 'green-50';
|
|
6
|
+
iconPlacement?: "top" | "center";
|
|
7
|
+
rounded: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const Root: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
variant?: "orange-100" | "green-50" | undefined;
|
|
11
|
+
iconPlacement?: "center" | "top" | undefined;
|
|
12
|
+
rounded: boolean;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { Flex } from "../flex/flex.js";
|
|
5
|
+
const styles = {
|
|
6
|
+
"teddy-ribbon": "_teddy-ribbon_14u2k_2",
|
|
7
|
+
"teddy-ribbon--rounded": "_teddy-ribbon--rounded_14u2k_6",
|
|
8
|
+
"teddy-ribbon--backgroundColor-orange-100": "_teddy-ribbon--backgroundColor-orange-100_14u2k_9",
|
|
9
|
+
"teddy-ribbon--backgroundColor-green-50": "_teddy-ribbon--backgroundColor-green-50_14u2k_12",
|
|
10
|
+
"teddy-ribbon--iconPlacement-top": "_teddy-ribbon--iconPlacement-top_14u2k_19",
|
|
11
|
+
"teddy-ribbon--iconPlacement-center": "_teddy-ribbon--iconPlacement-center_14u2k_22"
|
|
12
|
+
};
|
|
13
|
+
const rootClassName = "teddy-ribbon";
|
|
14
|
+
const Root = React__default.forwardRef(
|
|
15
|
+
({ className, variant, iconPlacement, rounded, children, ...props }, forwardRef) => {
|
|
16
|
+
const classes = clsx(
|
|
17
|
+
[styles[`${rootClassName}`]],
|
|
18
|
+
{
|
|
19
|
+
[styles[`${rootClassName}--iconPlacement-${iconPlacement}`]]: iconPlacement,
|
|
20
|
+
[styles[`${rootClassName}--backgroundColor-${variant}`]]: variant,
|
|
21
|
+
[styles[`${rootClassName}--rounded`]]: rounded
|
|
22
|
+
},
|
|
23
|
+
className
|
|
24
|
+
);
|
|
25
|
+
return /* @__PURE__ */ jsx(Flex, { ...props, ref: forwardRef, className: classes, children });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
Root.displayName = "Root";
|
|
29
|
+
export {
|
|
30
|
+
Root,
|
|
31
|
+
rootClassName
|
|
32
|
+
};
|
|
@@ -5,7 +5,7 @@ import { ContentProps } from './tabs-content';
|
|
|
5
5
|
import { ScrollProps } from './tabs-scroll';
|
|
6
6
|
import { ScrollButtonProps } from './tabs-scroll-button';
|
|
7
7
|
|
|
8
|
-
export declare const Tabs: import('react').ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-tabs').TabsProps & import('react').RefAttributes<HTMLDivElement>, "ref">, "
|
|
8
|
+
export declare const Tabs: import('react').ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-tabs').TabsProps & import('react').RefAttributes<HTMLDivElement>, "ref">, "value" | "defaultValue" | "onValueChange" | "activationMode"> & {
|
|
9
9
|
value?: string | undefined;
|
|
10
10
|
onValueChange?: ((value: string) => void) | undefined;
|
|
11
11
|
defaultValue?: string | undefined;
|
|
@@ -16,7 +16,7 @@ export declare const Tabs: import('react').ForwardRefExoticComponent<Omit<Omit<i
|
|
|
16
16
|
List: import('react').ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-tabs').TabsListProps & import('react').RefAttributes<HTMLDivElement>, "ref">, "loop"> & {
|
|
17
17
|
loop?: boolean | undefined;
|
|
18
18
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
19
|
-
Trigger: import('react').ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-tabs').TabsTriggerProps & import('react').RefAttributes<HTMLButtonElement>, "ref">, "
|
|
19
|
+
Trigger: import('react').ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-tabs').TabsTriggerProps & import('react').RefAttributes<HTMLButtonElement>, "ref">, "disabled" | "value"> & {
|
|
20
20
|
value: string;
|
|
21
21
|
disabled?: boolean | undefined;
|
|
22
22
|
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -7,6 +7,7 @@ const clsx = require("clsx");
|
|
|
7
7
|
const components_tabs_tabsRoot = require("./tabs-root.cjs");
|
|
8
8
|
const components_tabs_tabsScroll = require("./tabs-scroll.cjs");
|
|
9
9
|
const utils_composeRefs = require("../../utils/composeRefs.cjs");
|
|
10
|
+
const tokens_motion_variables = require("../../tokens/motion/variables.cjs");
|
|
10
11
|
function _interopNamespaceDefault(e) {
|
|
11
12
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
12
13
|
if (e) {
|
|
@@ -29,6 +30,16 @@ const List = React.forwardRef(
|
|
|
29
30
|
const classes = clsx([components_tabs_tabsRoot.styles[`${components_tabs_tabsRoot.rootClassName}__list`]], className);
|
|
30
31
|
const scrollContext = React.useContext(components_tabs_tabsScroll.ScrollContext);
|
|
31
32
|
const rootContext = React.useContext(components_tabs_tabsRoot.RootContext);
|
|
33
|
+
const isFirstRender = React.useRef(true);
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
if (rootContext) {
|
|
36
|
+
const tabsContainer = rootContext == null ? void 0 : rootContext.listElement.current;
|
|
37
|
+
if (!tabsContainer)
|
|
38
|
+
return;
|
|
39
|
+
tabsContainer.style.setProperty("--_duration", isFirstRender.current ? "0ms" : tokens_motion_variables.teddyMotionDuration200);
|
|
40
|
+
isFirstRender.current = false;
|
|
41
|
+
}
|
|
42
|
+
}, [rootContext]);
|
|
32
43
|
if (!scrollContext) {
|
|
33
44
|
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
45
|
}
|
|
@@ -5,11 +5,22 @@ import clsx from "clsx";
|
|
|
5
5
|
import { s as styles, rootClassName, RootContext } from "./tabs-root.js";
|
|
6
6
|
import { ScrollContext, Scroll } from "./tabs-scroll.js";
|
|
7
7
|
import { composeRefs } from "../../utils/composeRefs.js";
|
|
8
|
+
import { teddyMotionDuration200 } from "../../tokens/motion/variables.js";
|
|
8
9
|
const List = React__default.forwardRef(
|
|
9
10
|
({ className, children, ...props }, forwardRef) => {
|
|
10
11
|
const classes = clsx([styles[`${rootClassName}__list`]], className);
|
|
11
12
|
const scrollContext = React__default.useContext(ScrollContext);
|
|
12
13
|
const rootContext = React__default.useContext(RootContext);
|
|
14
|
+
const isFirstRender = React__default.useRef(true);
|
|
15
|
+
React__default.useEffect(() => {
|
|
16
|
+
if (rootContext) {
|
|
17
|
+
const tabsContainer = rootContext == null ? void 0 : rootContext.listElement.current;
|
|
18
|
+
if (!tabsContainer)
|
|
19
|
+
return;
|
|
20
|
+
tabsContainer.style.setProperty("--_duration", isFirstRender.current ? "0ms" : teddyMotionDuration200);
|
|
21
|
+
isFirstRender.current = false;
|
|
22
|
+
}
|
|
23
|
+
}, [rootContext]);
|
|
13
24
|
if (!scrollContext) {
|
|
14
25
|
return /* @__PURE__ */ jsx(Scroll, { children: /* @__PURE__ */ jsx(TabsPrimitive.List, { ...props, ref: composeRefs(forwardRef, rootContext == null ? void 0 : rootContext.listElement), className: classes, children }) });
|
|
15
26
|
}
|
|
@@ -25,7 +25,7 @@ type RootContextType = {
|
|
|
25
25
|
value: string | undefined;
|
|
26
26
|
};
|
|
27
27
|
export declare const RootContext: React.Context<RootContextType | undefined>;
|
|
28
|
-
export declare const Root: React.ForwardRefExoticComponent<Omit<Omit<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>, "ref">, "
|
|
28
|
+
export declare const Root: React.ForwardRefExoticComponent<Omit<Omit<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>, "ref">, "value" | "defaultValue" | "onValueChange" | "activationMode"> & {
|
|
29
29
|
/** The controlled value of the tab to activate. Should be used in conjunction with onValueChange. */
|
|
30
30
|
value?: TabsPrimitive.TabsProps['value'];
|
|
31
31
|
/** Event handler called when the value changes. */
|
|
@@ -8,7 +8,6 @@ const components_tabs_tabsRoot = require("./tabs-root.cjs");
|
|
|
8
8
|
const components_scrollArea_index = require("../scroll-area/index.cjs");
|
|
9
9
|
const components_button_button = require("../button/button.cjs");
|
|
10
10
|
const utils_composeRefs = require("../../utils/composeRefs.cjs");
|
|
11
|
-
const tokens_motion_variables = require("../../tokens/motion/variables.cjs");
|
|
12
11
|
function _interopNamespaceDefault(e) {
|
|
13
12
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
14
13
|
if (e) {
|
|
@@ -31,6 +30,7 @@ const Trigger = React.forwardRef(
|
|
|
31
30
|
const classes = clsx([components_tabs_tabsRoot.styles[`${components_tabs_tabsRoot.rootClassName}__trigger`]], className);
|
|
32
31
|
const innerElementRef = React.useRef(null);
|
|
33
32
|
const context = React.useContext(components_tabs_tabsRoot.RootContext);
|
|
33
|
+
const isFirstRender = React.useRef(true);
|
|
34
34
|
React.useEffect(() => {
|
|
35
35
|
if ((context == null ? void 0 : context.value) === props.value && innerElementRef.current) {
|
|
36
36
|
const newTab = innerElementRef.current;
|
|
@@ -43,7 +43,7 @@ const Trigger = React.forwardRef(
|
|
|
43
43
|
const width = newTabWidth.toFixed(3);
|
|
44
44
|
tabsContainer.style.setProperty("--_width", width);
|
|
45
45
|
tabsContainer.style.setProperty("--_left", newTab.offsetLeft + "px");
|
|
46
|
-
|
|
46
|
+
isFirstRender.current = false;
|
|
47
47
|
}
|
|
48
48
|
}, [context, props.value]);
|
|
49
49
|
if (context == null ? void 0 : context.snapCenter) {
|
|
@@ -8,7 +8,7 @@ export type TriggerProps = Omit<React.ComponentPropsWithoutRef<typeof TabsPrimit
|
|
|
8
8
|
disabled?: TabsPrimitive.TabsTriggerProps['disabled'];
|
|
9
9
|
};
|
|
10
10
|
/** The button that activates its associated content.*/
|
|
11
|
-
export declare const Trigger: React.ForwardRefExoticComponent<Omit<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref">, "
|
|
11
|
+
export declare const Trigger: React.ForwardRefExoticComponent<Omit<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref">, "disabled" | "value"> & {
|
|
12
12
|
/** A unique value that associates the trigger with a content. */
|
|
13
13
|
value: TabsPrimitive.TabsTriggerProps['value'];
|
|
14
14
|
/** When true, prevents the user from interacting with the tab. */
|
|
@@ -6,12 +6,12 @@ import { s as styles, rootClassName, RootContext } from "./tabs-root.js";
|
|
|
6
6
|
import { ScrollArea } from "../scroll-area/index.js";
|
|
7
7
|
import { Button } from "../button/button.js";
|
|
8
8
|
import { composeRefs } from "../../utils/composeRefs.js";
|
|
9
|
-
import { teddyMotionDuration200 } from "../../tokens/motion/variables.js";
|
|
10
9
|
const Trigger = React__default.forwardRef(
|
|
11
10
|
({ className, ...props }, forwardRef) => {
|
|
12
11
|
const classes = clsx([styles[`${rootClassName}__trigger`]], className);
|
|
13
12
|
const innerElementRef = React__default.useRef(null);
|
|
14
13
|
const context = React__default.useContext(RootContext);
|
|
14
|
+
const isFirstRender = React__default.useRef(true);
|
|
15
15
|
React__default.useEffect(() => {
|
|
16
16
|
if ((context == null ? void 0 : context.value) === props.value && innerElementRef.current) {
|
|
17
17
|
const newTab = innerElementRef.current;
|
|
@@ -24,7 +24,7 @@ const Trigger = React__default.forwardRef(
|
|
|
24
24
|
const width = newTabWidth.toFixed(3);
|
|
25
25
|
tabsContainer.style.setProperty("--_width", width);
|
|
26
26
|
tabsContainer.style.setProperty("--_left", newTab.offsetLeft + "px");
|
|
27
|
-
|
|
27
|
+
isFirstRender.current = false;
|
|
28
28
|
}
|
|
29
29
|
}, [context, props.value]);
|
|
30
30
|
if (context == null ? void 0 : context.snapCenter) {
|
|
@@ -29,8 +29,8 @@ declare const Toggle: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHT
|
|
|
29
29
|
Input: React.ForwardRefExoticComponent<ToggleInputProps & React.RefAttributes<HTMLButtonElement>>;
|
|
30
30
|
Thumb: React.ForwardRefExoticComponent<Omit<SwitchPrimitive.SwitchThumbProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
31
31
|
Indicator: React.ForwardRefExoticComponent<Partial<Omit<React.SVGProps<SVGSVGElement> & {
|
|
32
|
-
name: "link" | "
|
|
33
|
-
size?: ("
|
|
32
|
+
name: "key" | "search" | "split" | "link" | "add" | "reverse" | "infinite" | "radio" | "visible" | "copy" | "help" | "zoom-out" | "filter" | "x" | "zoom" | "menu" | "map" | "summary" | "time" | "video" | "image" | "stop" | "download" | "alert" | "email" | "close" | "error" | "focus" | "play" | "present" | "alarm-off" | "alarm-on" | "attachment" | "bookmark-filled" | "bookmark" | "copy-filled" | "dislike" | "edit" | "heart-filled" | "heart" | "invisible" | "like" | "lock-open" | "lock" | "login" | "logout" | "maximize" | "minimize" | "mute" | "password-invisible" | "password-visible" | "play-filled" | "remove-filled" | "remove" | "save" | "send" | "settings" | "share" | "shortcut" | "shuffle" | "sync" | "skip-back-10sec" | "skip-back-30sec" | "skip-forward-10sec" | "skip-forward-30sec" | "star-filled" | "star" | "switch-arrows" | "tv-next" | "tv-pause" | "tv-previous" | "tv-stop" | "upload" | "volume" | "connected-building" | "home" | "hospital" | "industry" | "premises-datacenter" | "premises-large" | "premises-medium" | "premises-small" | "premises" | "store" | "address-book" | "b2b-customer" | "care" | "chat-robot" | "chat" | "child-1" | "child-2" | "conversation" | "customer-dialogue" | "dsl-hub" | "end-user" | "handshake" | "headphones" | "letter" | "mms" | "new-contact" | "new-group" | "news" | "parental-guide" | "people-hub" | "people" | "portal" | "signature" | "smiley-happy" | "smiley-sad" | "sms" | "support" | "user-admin" | "vcard" | "voicemail" | "battery" | "bluetooth" | "broadband" | "broken-phone" | "cast" | "cloud-connect" | "connected" | "core-router" | "daas-device" | "data-transfer" | "desktop" | "devices" | "esim-simcard" | "esim" | "face-id" | "fiber" | "fingerprint" | "fiveg" | "fourg" | "home-installation" | "industrial-iot" | "internet" | "it-service" | "laptop" | "mobile-broadband" | "network" | "phone-recycling" | "phone-ringing" | "phone" | "rack" | "refill-card" | "remote-control" | "repair" | "roaming" | "router" | "secure-device" | "sense-car" | "server" | "service-device" | "service-supervision" | "slow-wifi" | "smart-wifi" | "smartphone" | "smartwatch" | "tablet" | "trade-phone" | "tv" | "usb" | "voice-switch" | "wallplug" | "wireless-off" | "wireless-weak" | "wireless" | "world-alert" | "world-off" | "world-question" | "bar-chart" | "doc" | "document-doc" | "document-edit" | "document-pdf" | "document-ppt" | "excel" | "folder-copy" | "folder-new" | "folder" | "gif" | "graph" | "media-content" | "org-chart" | "pie-chart" | "print" | "register" | "report" | "simcard" | "spell-check" | "credit-card" | "euro" | "invoice" | "kontantkort" | "kr" | "late-payment" | "money-back-euro" | "money-back-kr" | "money-euro" | "money-kr" | "pay-monthly-euro" | "pay-monthly-kr" | "pay-once-euro" | "pay-once-kr" | "payment-success" | "savings" | "wallet" | "airplay" | "camera" | "entertainment" | "external" | "film" | "games" | "megaphone" | "microphone" | "music" | "player-settings" | "record" | "stream" | "trailer" | "video-conference" | "activity-level" | "ai-robot" | "bag" | "basketball" | "blood-pressure" | "bulb" | "business-continuity" | "business-intelligence" | "calendar" | "cart" | "close-circle" | "cloud" | "coffee" | "compass" | "construction" | "cookie" | "delivery" | "drone" | "education" | "efficiency" | "environment" | "facemask" | "flag" | "food" | "fraud" | "getting-started" | "home-care" | "job-search" | "layers" | "measuring-health" | "moisture" | "offering" | "offshore" | "optimization" | "pebble" | "pet-dog" | "pin" | "plane" | "plus-minus" | "police" | "power-grid" | "press-button" | "price" | "pulse" | "recycle" | "reservation" | "route" | "ruler" | "satellite" | "secured-1" | "secured-2" | "security-camera" | "shopping" | "snowflake" | "speedometer" | "spyware" | "suitcase" | "sustainability" | "tag" | "temperature" | "thinking" | "train" | "transfer" | "undo" | "wavelength" | "weather" | "world" | "android" | "apple" | "bankid-norway" | "bankid" | "facebook" | "instagram" | "youtube" | "linkedin" | "snapchat" | "telia-logo" | "whatsapp" | "windows" | "alert-filled" | "check-circle-filled" | "check-circle" | "error-filled" | "info-filled" | "info" | "question-filled" | "question" | "warning" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-subdirectory" | "arrow-up" | "card-view" | "checkmark-bold" | "checkmark" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "grid-view" | "list-view" | "minus-bold" | "minus" | "more-horizontal" | "more-vertical" | "plus" | "services" | "sorter" | "table-view";
|
|
33
|
+
size?: ("sm" | "md" | "lg" | "xl" | "font" | "xxs" | "xs") | undefined;
|
|
34
34
|
children?: React.ReactNode;
|
|
35
35
|
}, "ref">> & React.RefAttributes<SVGSVGElement>>;
|
|
36
36
|
};
|
|
@@ -17,7 +17,7 @@ export declare const Tooltip: typeof Root & {
|
|
|
17
17
|
}>) => void) | undefined;
|
|
18
18
|
side?: "top" | "bottom" | "left" | "right" | undefined;
|
|
19
19
|
sideOffset?: number | undefined;
|
|
20
|
-
align?: "
|
|
20
|
+
align?: "start" | "center" | "end" | undefined;
|
|
21
21
|
alignOffset?: number | undefined;
|
|
22
22
|
arrowPadding?: number | undefined;
|
|
23
23
|
avoidCollisions?: boolean | undefined;
|