@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,75 @@
|
|
|
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 TabsPrimitive = require("@radix-ui/react-tabs");
|
|
7
|
+
const reactUseControllableState = require("@radix-ui/react-use-controllable-state");
|
|
8
|
+
const utils_composeEventHandlers = require("../../utils/composeEventHandlers.cjs");
|
|
9
|
+
function _interopNamespaceDefault(e) {
|
|
10
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
11
|
+
if (e) {
|
|
12
|
+
for (const k in e) {
|
|
13
|
+
if (k !== "default") {
|
|
14
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: () => e[k]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
const TabsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TabsPrimitive);
|
|
26
|
+
const styles = {
|
|
27
|
+
"teddy-tabs__list": "_teddy-tabs__list_1finq_3",
|
|
28
|
+
"teddy-tabs--full-width": "_teddy-tabs--full-width_1finq_30",
|
|
29
|
+
"teddy-tabs__trigger": "_teddy-tabs__trigger_1finq_33",
|
|
30
|
+
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-button_1finq_48"
|
|
31
|
+
};
|
|
32
|
+
const rootClassName = "teddy-tabs";
|
|
33
|
+
const RootContext = React.createContext(void 0);
|
|
34
|
+
const Root = React.forwardRef(
|
|
35
|
+
({ className, onValueChange, fullWidth, snapCenter = true, ...props }, forwardRef) => {
|
|
36
|
+
const [activeElement, setActiveElement] = React.useState(null);
|
|
37
|
+
const listElement = React.useRef(null);
|
|
38
|
+
const [value, setValue] = reactUseControllableState.useControllableState({
|
|
39
|
+
prop: props.value,
|
|
40
|
+
onChange: onValueChange,
|
|
41
|
+
defaultProp: props.defaultValue
|
|
42
|
+
});
|
|
43
|
+
const classes = clsx(
|
|
44
|
+
[styles[`${rootClassName}`]],
|
|
45
|
+
{ [styles[`${rootClassName}--full-width`]]: fullWidth },
|
|
46
|
+
className
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
+
RootContext.Provider,
|
|
50
|
+
{
|
|
51
|
+
value: {
|
|
52
|
+
activeElement,
|
|
53
|
+
setActiveElement,
|
|
54
|
+
snapCenter,
|
|
55
|
+
value,
|
|
56
|
+
listElement
|
|
57
|
+
},
|
|
58
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
59
|
+
TabsPrimitive__namespace.Root,
|
|
60
|
+
{
|
|
61
|
+
...props,
|
|
62
|
+
onValueChange: utils_composeEventHandlers.composeEventHandlers(setValue, onValueChange),
|
|
63
|
+
ref: forwardRef,
|
|
64
|
+
className: classes
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
Root.displayName = "Root";
|
|
72
|
+
exports.Root = Root;
|
|
73
|
+
exports.RootContext = RootContext;
|
|
74
|
+
exports.rootClassName = rootClassName;
|
|
75
|
+
exports.styles = styles;
|
|
@@ -17,15 +17,12 @@ export type RootProps = Omit<React.ComponentPropsWithoutRef<typeof TabsPrimitive
|
|
|
17
17
|
*/
|
|
18
18
|
snapCenter?: boolean;
|
|
19
19
|
};
|
|
20
|
-
type ActiveElement = {
|
|
21
|
-
left: number;
|
|
22
|
-
width: number;
|
|
23
|
-
bottom: number;
|
|
24
|
-
};
|
|
25
20
|
type RootContextType = {
|
|
26
|
-
activeElement:
|
|
27
|
-
setActiveElement: React.Dispatch<React.SetStateAction<
|
|
21
|
+
activeElement: HTMLButtonElement | null;
|
|
22
|
+
setActiveElement: React.Dispatch<React.SetStateAction<HTMLButtonElement | null>>;
|
|
23
|
+
listElement: React.RefObject<HTMLDivElement>;
|
|
28
24
|
snapCenter: boolean;
|
|
25
|
+
value: string | undefined;
|
|
29
26
|
};
|
|
30
27
|
export declare const RootContext: React.Context<RootContextType | undefined>;
|
|
31
28
|
export declare const Root: React.ForwardRefExoticComponent<Omit<Omit<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>, "ref">, "defaultValue" | "value" | "onValueChange" | "activationMode"> & {
|
|
@@ -2,18 +2,25 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
6
|
+
import { composeEventHandlers } from "../../utils/composeEventHandlers.js";
|
|
5
7
|
const styles = {
|
|
6
|
-
"teddy-tabs__list": "_teddy-
|
|
7
|
-
"teddy-tabs--full-width": "_teddy-tabs--full-
|
|
8
|
-
"teddy-tabs__trigger": "_teddy-
|
|
9
|
-
"teddy-
|
|
10
|
-
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-button_1sgsx_34"
|
|
8
|
+
"teddy-tabs__list": "_teddy-tabs__list_1finq_3",
|
|
9
|
+
"teddy-tabs--full-width": "_teddy-tabs--full-width_1finq_30",
|
|
10
|
+
"teddy-tabs__trigger": "_teddy-tabs__trigger_1finq_33",
|
|
11
|
+
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-button_1finq_48"
|
|
11
12
|
};
|
|
12
13
|
const rootClassName = "teddy-tabs";
|
|
13
14
|
const RootContext = React__default.createContext(void 0);
|
|
14
15
|
const Root = React__default.forwardRef(
|
|
15
|
-
({ className, fullWidth, snapCenter = true, ...props }, forwardRef) => {
|
|
16
|
+
({ className, onValueChange, fullWidth, snapCenter = true, ...props }, forwardRef) => {
|
|
16
17
|
const [activeElement, setActiveElement] = React__default.useState(null);
|
|
18
|
+
const listElement = React__default.useRef(null);
|
|
19
|
+
const [value, setValue] = useControllableState({
|
|
20
|
+
prop: props.value,
|
|
21
|
+
onChange: onValueChange,
|
|
22
|
+
defaultProp: props.defaultValue
|
|
23
|
+
});
|
|
17
24
|
const classes = clsx(
|
|
18
25
|
[styles[`${rootClassName}`]],
|
|
19
26
|
{ [styles[`${rootClassName}--full-width`]]: fullWidth },
|
|
@@ -25,9 +32,19 @@ const Root = React__default.forwardRef(
|
|
|
25
32
|
value: {
|
|
26
33
|
activeElement,
|
|
27
34
|
setActiveElement,
|
|
28
|
-
snapCenter
|
|
35
|
+
snapCenter,
|
|
36
|
+
value,
|
|
37
|
+
listElement
|
|
29
38
|
},
|
|
30
|
-
children: /* @__PURE__ */ jsx(
|
|
39
|
+
children: /* @__PURE__ */ jsx(
|
|
40
|
+
TabsPrimitive.Root,
|
|
41
|
+
{
|
|
42
|
+
...props,
|
|
43
|
+
onValueChange: composeEventHandlers(setValue, onValueChange),
|
|
44
|
+
ref: forwardRef,
|
|
45
|
+
className: classes
|
|
46
|
+
}
|
|
47
|
+
)
|
|
31
48
|
}
|
|
32
49
|
);
|
|
33
50
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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_tabs_tabsRoot = require("./tabs-root.cjs");
|
|
7
|
+
const components_scrollArea_index = require("../scroll-area/index.cjs");
|
|
8
|
+
const ScrollButton = React.forwardRef(
|
|
9
|
+
({ className, ...props }, forwardRef) => {
|
|
10
|
+
const classes = clsx([components_tabs_tabsRoot.styles[`${components_tabs_tabsRoot.rootClassName}__scroll-button`]], className);
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components_scrollArea_index.ScrollArea.Button, { variant: "text", ...props, className: classes, ref: forwardRef });
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
ScrollButton.displayName = "ScrollButton";
|
|
15
|
+
exports.ScrollButton = ScrollButton;
|
|
@@ -0,0 +1,22 @@
|
|
|
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_tabs_tabsRoot = require("./tabs-root.cjs");
|
|
7
|
+
const components_scrollArea_index = require("../scroll-area/index.cjs");
|
|
8
|
+
const components_tabs_tabsScrollButton = require("./tabs-scroll-button.cjs");
|
|
9
|
+
const ScrollContext = React.createContext(false);
|
|
10
|
+
const Scroll = React.forwardRef(
|
|
11
|
+
({ className, children, ...props }, forwardRef) => {
|
|
12
|
+
const classes = clsx([components_tabs_tabsRoot.styles[`${components_tabs_tabsRoot.rootClassName}__scroll`]], className);
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ScrollContext.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsxs(components_scrollArea_index.ScrollArea, { ...props, className: classes, ref: forwardRef, children: [
|
|
14
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_tabs_tabsScrollButton.ScrollButton, { direction: "left" }),
|
|
15
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_tabs_tabsScrollButton.ScrollButton, { direction: "right" }),
|
|
16
|
+
children
|
|
17
|
+
] }) });
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
Scroll.displayName = "Scroll";
|
|
21
|
+
exports.Scroll = Scroll;
|
|
22
|
+
exports.ScrollContext = ScrollContext;
|
|
@@ -0,0 +1,55 @@
|
|
|
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_scrollArea_index = require("../scroll-area/index.cjs");
|
|
9
|
+
const components_button_button = require("../button/button.cjs");
|
|
10
|
+
const utils_composeRefs = require("../../utils/composeRefs.cjs");
|
|
11
|
+
const tokens_motion_variables = require("../../tokens/motion/variables.cjs");
|
|
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 TabsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TabsPrimitive);
|
|
29
|
+
const Trigger = React.forwardRef(
|
|
30
|
+
({ className, ...props }, forwardRef) => {
|
|
31
|
+
const classes = clsx([components_tabs_tabsRoot.styles[`${components_tabs_tabsRoot.rootClassName}__trigger`]], className);
|
|
32
|
+
const innerElementRef = React.useRef(null);
|
|
33
|
+
const context = React.useContext(components_tabs_tabsRoot.RootContext);
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
if ((context == null ? void 0 : context.value) === props.value && innerElementRef.current) {
|
|
36
|
+
const newTab = innerElementRef.current;
|
|
37
|
+
context == null ? void 0 : context.setActiveElement(newTab);
|
|
38
|
+
const tabsContainer = context == null ? void 0 : context.listElement.current;
|
|
39
|
+
if (!newTab || !tabsContainer)
|
|
40
|
+
return;
|
|
41
|
+
const newTabWidth = newTab.offsetWidth / tabsContainer.offsetWidth;
|
|
42
|
+
context == null ? void 0 : context.setActiveElement(innerElementRef.current);
|
|
43
|
+
tabsContainer.style.setProperty("--_width", newTabWidth.toFixed(3));
|
|
44
|
+
tabsContainer.style.setProperty("--_left", newTab.offsetLeft + "px");
|
|
45
|
+
tabsContainer.style.setProperty("--_duration", tokens_motion_variables.teddyMotionDuration200);
|
|
46
|
+
}
|
|
47
|
+
}, [context, props.value]);
|
|
48
|
+
if (context == null ? void 0 : context.snapCenter) {
|
|
49
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components_scrollArea_index.ScrollArea.Item, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "primary", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Trigger, { ...props, ref: utils_composeRefs.composeRefs(forwardRef, innerElementRef), className: classes }) }) });
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "primary", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Trigger, { ...props, ref: utils_composeRefs.composeRefs(forwardRef, innerElementRef), className: classes }) });
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
Trigger.displayName = "Trigger";
|
|
55
|
+
exports.Trigger = Trigger;
|
|
@@ -3,23 +3,33 @@ import React__default from "react";
|
|
|
3
3
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { s as styles, rootClassName, RootContext } from "./tabs-root.js";
|
|
6
|
-
import { composeEventHandlers } from "../../utils/composeEventHandlers.js";
|
|
7
6
|
import { ScrollArea } from "../scroll-area/index.js";
|
|
8
7
|
import { Button } from "../button/button.js";
|
|
8
|
+
import { composeRefs } from "../../utils/composeRefs.js";
|
|
9
|
+
import { teddyMotionDuration200 } from "../../tokens/motion/variables.js";
|
|
9
10
|
const Trigger = React__default.forwardRef(
|
|
10
11
|
({ className, ...props }, forwardRef) => {
|
|
11
12
|
const classes = clsx([styles[`${rootClassName}__trigger`]], className);
|
|
13
|
+
const innerElementRef = React__default.useRef(null);
|
|
12
14
|
const context = React__default.useContext(RootContext);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
React__default.useEffect(() => {
|
|
16
|
+
if ((context == null ? void 0 : context.value) === props.value && innerElementRef.current) {
|
|
17
|
+
const newTab = innerElementRef.current;
|
|
18
|
+
context == null ? void 0 : context.setActiveElement(newTab);
|
|
19
|
+
const tabsContainer = context == null ? void 0 : context.listElement.current;
|
|
20
|
+
if (!newTab || !tabsContainer)
|
|
21
|
+
return;
|
|
22
|
+
const newTabWidth = newTab.offsetWidth / tabsContainer.offsetWidth;
|
|
23
|
+
context == null ? void 0 : context.setActiveElement(innerElementRef.current);
|
|
24
|
+
tabsContainer.style.setProperty("--_width", newTabWidth.toFixed(3));
|
|
25
|
+
tabsContainer.style.setProperty("--_left", newTab.offsetLeft + "px");
|
|
26
|
+
tabsContainer.style.setProperty("--_duration", teddyMotionDuration200);
|
|
27
|
+
}
|
|
28
|
+
}, [context, props.value]);
|
|
19
29
|
if (context == null ? void 0 : context.snapCenter) {
|
|
20
|
-
return /* @__PURE__ */ jsx(ScrollArea.Item, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "primary", asChild: true, children: /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { ...props,
|
|
30
|
+
return /* @__PURE__ */ jsx(ScrollArea.Item, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "primary", asChild: true, children: /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { ...props, ref: composeRefs(forwardRef, innerElementRef), className: classes }) }) });
|
|
21
31
|
}
|
|
22
|
-
return /* @__PURE__ */ jsx(Button, { variant: "primary", asChild: true, children: /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { ...props,
|
|
32
|
+
return /* @__PURE__ */ jsx(Button, { variant: "primary", asChild: true, children: /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { ...props, ref: composeRefs(forwardRef, innerElementRef), className: classes }) });
|
|
23
33
|
}
|
|
24
34
|
);
|
|
25
35
|
Trigger.displayName = "Trigger";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const reactSlot = require("@radix-ui/react-slot");
|
|
5
|
+
const clsx = require("clsx");
|
|
6
|
+
const React = require("react");
|
|
7
|
+
const utils_generateStyling_index = require("../../utils/generate-styling/index.cjs");
|
|
8
|
+
const tokens_color_variables = require("../../tokens/color/variables.cjs");
|
|
9
|
+
const styles = {
|
|
10
|
+
"teddy-text": "_teddy-text_15w9u_2",
|
|
11
|
+
"teddy-text--disabled": "_teddy-text--disabled_15w9u_8",
|
|
12
|
+
"teddy-text--hyphens": "_teddy-text--hyphens_15w9u_11",
|
|
13
|
+
"teddy-text--paragraph-100": "_teddy-text--paragraph-100_15w9u_14",
|
|
14
|
+
"teddy-text--paragraph-100-medium": "_teddy-text--paragraph-100-medium_15w9u_20",
|
|
15
|
+
"teddy-text--paragraph-100-bold": "_teddy-text--paragraph-100-bold_15w9u_27",
|
|
16
|
+
"teddy-text--paragraph-200": "_teddy-text--paragraph-200_15w9u_34",
|
|
17
|
+
"teddy-text--preamble-100": "_teddy-text--preamble-100_15w9u_40",
|
|
18
|
+
"teddy-text--preamble-200": "_teddy-text--preamble-200_15w9u_46",
|
|
19
|
+
"teddy-text--additional-100": "_teddy-text--additional-100_15w9u_52",
|
|
20
|
+
"teddy-text--additional-100-medium": "_teddy-text--additional-100-medium_15w9u_58",
|
|
21
|
+
"teddy-text--overline-100": "_teddy-text--overline-100_15w9u_65",
|
|
22
|
+
"teddy-text--overline-200": "_teddy-text--overline-200_15w9u_72"
|
|
23
|
+
};
|
|
24
|
+
const rootClassName = "teddy-text";
|
|
25
|
+
const Text = React.forwardRef(({ faded, ...props }, forwardRef) => {
|
|
26
|
+
const color = faded ? tokens_color_variables.teddyColorTextMedium : props.color;
|
|
27
|
+
const {
|
|
28
|
+
className,
|
|
29
|
+
children,
|
|
30
|
+
disabled,
|
|
31
|
+
enableHyphenation,
|
|
32
|
+
variant = "paragraph-100",
|
|
33
|
+
asChild,
|
|
34
|
+
as: Tag = "p",
|
|
35
|
+
...rest
|
|
36
|
+
} = utils_generateStyling_index.extractProps({ ...props, color });
|
|
37
|
+
const classes = clsx(
|
|
38
|
+
styles[rootClassName],
|
|
39
|
+
styles[`${rootClassName}--${variant}`],
|
|
40
|
+
{
|
|
41
|
+
[styles[`${rootClassName}--hyphens`]]: enableHyphenation,
|
|
42
|
+
[styles[`${rootClassName}--disabled`]]: disabled
|
|
43
|
+
},
|
|
44
|
+
className
|
|
45
|
+
);
|
|
46
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { ...rest, ref: forwardRef, className: classes, children: asChild ? children : /* @__PURE__ */ jsxRuntime.jsx(Tag, { children }) });
|
|
47
|
+
});
|
|
48
|
+
Text.displayName = "Text";
|
|
49
|
+
exports.Text = Text;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const components_textField_textField = require("./text-field.cjs");
|
|
4
|
+
const components_textField_textFieldInput = require("./text-field-input.cjs");
|
|
5
|
+
const components_textField_textFieldLabel = require("./text-field-label.cjs");
|
|
6
|
+
const components_textField_textFieldInputGroup = require("./text-field-input-group.cjs");
|
|
7
|
+
const components_textField_textFieldHelperText = require("./text-field-helper-text.cjs");
|
|
8
|
+
const components_textField_textFieldErrorList = require("./text-field-error-list.cjs");
|
|
9
|
+
const components_textField_textFieldIndicator = require("./text-field-indicator.cjs");
|
|
10
|
+
const components_textField_textFieldButton = require("./text-field-button.cjs");
|
|
11
|
+
const components_textField_textFieldClearButton = require("./text-field-clear-button.cjs");
|
|
12
|
+
components_textField_textField.Root.displayName = "TextField";
|
|
13
|
+
components_textField_textFieldInput.Input.displayName = "TextField.Input";
|
|
14
|
+
components_textField_textFieldLabel.Label.displayName = "TextField.Label";
|
|
15
|
+
components_textField_textFieldInputGroup.InputGroup.displayName = "TextField.Group";
|
|
16
|
+
components_textField_textFieldHelperText.HelperText.displayName = "TextField.HelperText";
|
|
17
|
+
components_textField_textFieldErrorList.ErrorList.displayName = "TextField.ErrorList";
|
|
18
|
+
components_textField_textFieldIndicator.Indicator.displayName = "TextField.Indicator";
|
|
19
|
+
components_textField_textFieldButton.Button.displayName = "TextField.Button";
|
|
20
|
+
components_textField_textFieldClearButton.ClearButton.displayName = "TextField.ClearButton";
|
|
21
|
+
const TextField = Object.assign(components_textField_textField.Root, {
|
|
22
|
+
Input: components_textField_textFieldInput.Input,
|
|
23
|
+
Label: components_textField_textFieldLabel.Label,
|
|
24
|
+
InputGroup: components_textField_textFieldInputGroup.InputGroup,
|
|
25
|
+
HelperText: components_textField_textFieldHelperText.HelperText,
|
|
26
|
+
ErrorList: components_textField_textFieldErrorList.ErrorList,
|
|
27
|
+
Indicator: components_textField_textFieldIndicator.Indicator,
|
|
28
|
+
Button: components_textField_textFieldButton.Button,
|
|
29
|
+
ClearButton: components_textField_textFieldClearButton.ClearButton
|
|
30
|
+
});
|
|
31
|
+
exports.TextField = TextField;
|
|
@@ -1,2 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { TextFieldRootProps } from './text-field';
|
|
2
|
+
import { TextFieldInputProps } from './text-field-input';
|
|
3
|
+
import { TextFieldLabelProps } from './text-field-label';
|
|
4
|
+
import { TextFieldInputGroupProps } from './text-field-input-group';
|
|
5
|
+
import { TextFieldHelperTextProps } from './text-field-helper-text';
|
|
6
|
+
import { TextFieldErrorListProps } from './text-field-error-list';
|
|
7
|
+
import { TextFieldIndicatorProps } from './text-field-indicator';
|
|
8
|
+
import { TextFieldButtonProps } from './text-field-button';
|
|
9
|
+
import { TextFieldClearButtonProps } from './text-field-clear-button';
|
|
10
|
+
|
|
11
|
+
export declare const TextField: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & Pick<import('../input/input-indicator').InputIndicatorProps, "isLoading" | "isValid"> & {
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
readOnly?: boolean | undefined;
|
|
14
|
+
errors?: (string | null | undefined)[] | null | undefined;
|
|
15
|
+
isRequired?: boolean | undefined;
|
|
16
|
+
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
17
|
+
Input: import('react').ForwardRefExoticComponent<TextFieldInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
18
|
+
Label: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-label').LabelProps & import('react').RefAttributes<HTMLLabelElement>, "ref"> & {
|
|
19
|
+
disabled?: boolean | undefined;
|
|
20
|
+
isRequired?: boolean | undefined;
|
|
21
|
+
} & import('react').RefAttributes<HTMLLabelElement>>;
|
|
22
|
+
InputGroup: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
23
|
+
frameClassName?: string | undefined;
|
|
24
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
25
|
+
HelperText: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
26
|
+
ErrorList: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref">, "children"> & {
|
|
27
|
+
children?: import('react').ReactNode | ((args: Pick<import('./text-field').TextFieldContextValue, "errors">) => import('react').ReactNode);
|
|
28
|
+
} & import('react').RefAttributes<HTMLUListElement>>;
|
|
29
|
+
Indicator: import('react').ForwardRefExoticComponent<TextFieldIndicatorProps & import('react').RefAttributes<SVGSVGElement>>;
|
|
30
|
+
Button: import('react').ForwardRefExoticComponent<Omit<Omit<Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
|
|
31
|
+
asChild?: boolean | undefined;
|
|
32
|
+
loading?: boolean | undefined;
|
|
33
|
+
fullWidth?: boolean | undefined;
|
|
34
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
35
|
+
variant?: "text" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
iconOnly: true;
|
|
38
|
+
"aria-label": string;
|
|
39
|
+
} & import('react').RefAttributes<HTMLButtonElement>, "ref"> | Omit<Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
|
|
40
|
+
asChild?: boolean | undefined;
|
|
41
|
+
loading?: boolean | undefined;
|
|
42
|
+
fullWidth?: boolean | undefined;
|
|
43
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
44
|
+
variant?: "text" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
45
|
+
} & {
|
|
46
|
+
iconOnly?: false | undefined;
|
|
47
|
+
"aria-label"?: string | undefined;
|
|
48
|
+
} & import('react').RefAttributes<HTMLButtonElement>, "ref">, "variant"> & {
|
|
49
|
+
variant?: "attached" | "separated" | undefined;
|
|
50
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
51
|
+
ClearButton: import('react').ForwardRefExoticComponent<import('../input/input-clear-button').ClearButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
52
|
+
};
|
|
53
|
+
export type TextFieldProps = {
|
|
54
|
+
Root: TextFieldRootProps;
|
|
55
|
+
Input: TextFieldInputProps;
|
|
56
|
+
Label: TextFieldLabelProps;
|
|
57
|
+
Group: TextFieldInputGroupProps;
|
|
58
|
+
HelperText: TextFieldHelperTextProps;
|
|
59
|
+
ErrorList: TextFieldErrorListProps;
|
|
60
|
+
Indicator: TextFieldIndicatorProps;
|
|
61
|
+
Button: TextFieldButtonProps;
|
|
62
|
+
ClearButton: TextFieldClearButtonProps;
|
|
63
|
+
};
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Root } from "./text-field.js";
|
|
2
|
+
import { Input } from "./text-field-input.js";
|
|
3
|
+
import { Label } from "./text-field-label.js";
|
|
4
|
+
import { InputGroup } from "./text-field-input-group.js";
|
|
5
|
+
import { HelperText } from "./text-field-helper-text.js";
|
|
6
|
+
import { ErrorList } from "./text-field-error-list.js";
|
|
7
|
+
import { Indicator } from "./text-field-indicator.js";
|
|
8
|
+
import { Button } from "./text-field-button.js";
|
|
9
|
+
import { ClearButton } from "./text-field-clear-button.js";
|
|
10
|
+
Root.displayName = "TextField";
|
|
11
|
+
Input.displayName = "TextField.Input";
|
|
12
|
+
Label.displayName = "TextField.Label";
|
|
13
|
+
InputGroup.displayName = "TextField.Group";
|
|
14
|
+
HelperText.displayName = "TextField.HelperText";
|
|
15
|
+
ErrorList.displayName = "TextField.ErrorList";
|
|
16
|
+
Indicator.displayName = "TextField.Indicator";
|
|
17
|
+
Button.displayName = "TextField.Button";
|
|
18
|
+
ClearButton.displayName = "TextField.ClearButton";
|
|
19
|
+
const TextField = Object.assign(Root, {
|
|
20
|
+
Input,
|
|
21
|
+
Label,
|
|
22
|
+
InputGroup,
|
|
23
|
+
HelperText,
|
|
24
|
+
ErrorList,
|
|
25
|
+
Indicator,
|
|
26
|
+
Button,
|
|
27
|
+
ClearButton
|
|
28
|
+
});
|
|
2
29
|
export {
|
|
3
30
|
TextField
|
|
4
31
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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_textField_textField = require("./text-field.cjs");
|
|
7
|
+
const components_button_button = require("../button/button.cjs");
|
|
8
|
+
const Button = React.forwardRef(
|
|
9
|
+
({ className, variant, iconOnly, ...props }, forwardRef) => {
|
|
10
|
+
const classes = clsx(
|
|
11
|
+
[components_textField_textField.styles[`${components_textField_textField.rootClassName}__button`]],
|
|
12
|
+
{
|
|
13
|
+
[components_textField_textField.styles[`${components_textField_textField.rootClassName}__button--attached`]]: variant === "attached",
|
|
14
|
+
[components_textField_textField.styles[`${components_textField_textField.rootClassName}__button--separated`]]: variant === "separated"
|
|
15
|
+
},
|
|
16
|
+
className
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
components_button_button.Button,
|
|
20
|
+
{
|
|
21
|
+
...props,
|
|
22
|
+
variant: "primary",
|
|
23
|
+
...!iconOnly || !props["aria-label"] ? { iconOnly: false, "aria-label": void 0 } : { iconOnly: true, "aria-label": props["aria-label"] },
|
|
24
|
+
ref: forwardRef,
|
|
25
|
+
className: classes
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
Button.displayName = "Button";
|
|
31
|
+
exports.Button = Button;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Button as PrimitiveButton } from '../button';
|
|
3
|
+
|
|
4
|
+
export type TextFieldButtonProps = Omit<React.ComponentPropsWithoutRef<typeof PrimitiveButton>, 'variant'> & {
|
|
5
|
+
variant?: 'attached' | 'separated';
|
|
6
|
+
};
|
|
7
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
|
|
8
|
+
asChild?: boolean | undefined;
|
|
9
|
+
loading?: boolean | undefined;
|
|
10
|
+
fullWidth?: boolean | undefined;
|
|
11
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
12
|
+
variant?: "text" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
13
|
+
} & {
|
|
14
|
+
iconOnly: true;
|
|
15
|
+
"aria-label": string;
|
|
16
|
+
} & React.RefAttributes<HTMLButtonElement>, "ref"> | Omit<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
|
|
17
|
+
asChild?: boolean | undefined;
|
|
18
|
+
loading?: boolean | undefined;
|
|
19
|
+
fullWidth?: boolean | undefined;
|
|
20
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
21
|
+
variant?: "text" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
22
|
+
} & {
|
|
23
|
+
iconOnly?: false | undefined;
|
|
24
|
+
"aria-label"?: string | undefined;
|
|
25
|
+
} & React.RefAttributes<HTMLButtonElement>, "ref">, "variant"> & {
|
|
26
|
+
variant?: "attached" | "separated" | undefined;
|
|
27
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { s as styles, rootClassName } from "./text-field.js";
|
|
5
|
+
import { Button as Button$1 } from "../button/button.js";
|
|
6
|
+
const Button = React__default.forwardRef(
|
|
7
|
+
({ className, variant, iconOnly, ...props }, forwardRef) => {
|
|
8
|
+
const classes = clsx(
|
|
9
|
+
[styles[`${rootClassName}__button`]],
|
|
10
|
+
{
|
|
11
|
+
[styles[`${rootClassName}__button--attached`]]: variant === "attached",
|
|
12
|
+
[styles[`${rootClassName}__button--separated`]]: variant === "separated"
|
|
13
|
+
},
|
|
14
|
+
className
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
Button$1,
|
|
18
|
+
{
|
|
19
|
+
...props,
|
|
20
|
+
variant: "primary",
|
|
21
|
+
...!iconOnly || !props["aria-label"] ? { iconOnly: false, "aria-label": void 0 } : { iconOnly: true, "aria-label": props["aria-label"] },
|
|
22
|
+
ref: forwardRef,
|
|
23
|
+
className: classes
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
Button.displayName = "Button";
|
|
29
|
+
export {
|
|
30
|
+
Button
|
|
31
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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 components_input_inputClearButton = require("../input/input-clear-button.cjs");
|
|
6
|
+
const ClearButton = React.forwardRef(
|
|
7
|
+
(props, forwardRef) => {
|
|
8
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components_input_inputClearButton.ClearButton, { ...props, ref: forwardRef });
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
ClearButton.displayName = "ClearButton";
|
|
12
|
+
exports.ClearButton = ClearButton;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ClearButtonProps } from '../input/input-clear-button';
|
|
3
|
+
|
|
4
|
+
export type TextFieldClearButtonProps = ClearButtonProps;
|
|
5
|
+
/** This is a button that is used to clear the input field */
|
|
6
|
+
export declare const ClearButton: React.ForwardRefExoticComponent<ClearButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import { ClearButton as ClearButton$1 } from "../input/input-clear-button.js";
|
|
4
|
+
const ClearButton = React__default.forwardRef(
|
|
5
|
+
(props, forwardRef) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(ClearButton$1, { ...props, ref: forwardRef });
|
|
7
|
+
}
|
|
8
|
+
);
|
|
9
|
+
ClearButton.displayName = "ClearButton";
|
|
10
|
+
export {
|
|
11
|
+
ClearButton
|
|
12
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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_fieldErrorText_fieldErrorText = require("../field-error-text/field-error-text.cjs");
|
|
7
|
+
const components_textField_textField = require("./text-field.cjs");
|
|
8
|
+
const ErrorList = React.forwardRef(
|
|
9
|
+
({ className, children, ...props }, forwardRef) => {
|
|
10
|
+
const classes = clsx([components_textField_textField.styles[`${components_textField_textField.rootClassName}__error-list`]], className);
|
|
11
|
+
const context = React.useContext(components_textField_textField.TextFieldContext);
|
|
12
|
+
const errors = context == null ? void 0 : context.errors;
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
if (!context)
|
|
15
|
+
return;
|
|
16
|
+
const errorId = (errors == null ? void 0 : errors.length) ? `${context.id}-error` : void 0;
|
|
17
|
+
context == null ? void 0 : context.setErrorId(errorId);
|
|
18
|
+
}, [errors, context]);
|
|
19
|
+
if (!context || !context.errors)
|
|
20
|
+
return null;
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { id: context.errorId, "aria-live": "assertive", ...props, ref: forwardRef, className: classes, children: typeof children === "function" ? children({ errors }) : children || (errors == null ? void 0 : errors.map((error) => /* @__PURE__ */ jsxRuntime.jsx(components_fieldErrorText_fieldErrorText.FieldErrorText, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_fieldErrorText_fieldErrorText.FieldErrorText.Indicator, {}),
|
|
23
|
+
error
|
|
24
|
+
] }) }, error))) });
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
ErrorList.displayName = "ErrorList";
|
|
28
|
+
exports.ErrorList = ErrorList;
|