@telia/teddy 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -10
- package/dist/assets/5161b177f001ea1a.svg +1080 -0
- package/dist/assets/badge.css +1 -0
- package/dist/assets/button.css +1 -1
- package/dist/assets/grid.css +1 -0
- package/dist/assets/heading.css +1 -0
- package/dist/assets/icon.css +1 -1
- package/dist/assets/input.css +1 -1
- package/dist/assets/label.css +1 -1
- package/dist/assets/link.css +1 -0
- package/dist/assets/main.css +1 -1
- package/dist/assets/navigation-menu.css +1 -0
- package/dist/assets/text-field.css +1 -1
- package/dist/assets/text-spacing.css +1 -0
- package/dist/assets/text.css +1 -1
- package/dist/assets/visually-hidden.css +1 -0
- package/dist/badge-CbHdlkcM.js +742 -0
- package/dist/components/accordion/accordion.d.ts +59 -0
- package/dist/components/accordion/accordion.js +24 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.js +4 -0
- package/dist/components/badge/badge.d.ts +21 -0
- package/dist/components/badge/badge.js +24 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +4 -0
- package/dist/components/button/button.d.ts +19 -20
- package/dist/components/button/button.js +82 -71
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/card/card.d.ts +68 -0
- package/dist/components/card/card.js +24 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +4 -0
- package/dist/components/field-error-text/field-error-text.d.ts +4 -3
- package/dist/components/field-error-text/field-error-text.js +12 -12
- package/dist/components/grid/grid.d.ts +77 -0
- package/dist/components/grid/grid.js +393 -0
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/grid/index.js +4 -0
- package/dist/components/heading/heading.d.ts +63 -0
- package/dist/components/heading/heading.js +53 -0
- package/dist/components/heading/index.d.ts +2 -0
- package/dist/components/heading/index.js +4 -0
- package/dist/components/helper-text/helper-text.d.ts +2 -1
- package/dist/components/helper-text/helper-text.js +7 -7
- package/dist/components/icon/icon.d.ts +13 -2
- package/dist/components/icon/icon.js +22 -22
- package/dist/components/icon/index.d.ts +2 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +38 -21
- package/dist/components/input/input.d.ts +14 -23
- package/dist/components/input/input.js +72 -50
- package/dist/components/label/label.d.ts +3 -1
- package/dist/components/label/label.js +23 -51
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/link/index.js +4 -0
- package/dist/components/link/link.d.ts +49 -0
- package/dist/components/link/link.js +36 -0
- package/dist/components/navigation-menu/index.d.ts +2 -0
- package/dist/components/navigation-menu/index.js +4 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +126 -0
- package/dist/components/navigation-menu/navigation-menu.js +10 -0
- package/dist/components/spinner/spinner.d.ts +2 -1
- package/dist/components/spinner/spinner.js +5 -5
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +4 -0
- package/dist/components/switch/switch.d.ts +44 -0
- package/dist/components/switch/switch.js +23 -0
- package/dist/components/text/text.d.ts +15 -8
- package/dist/components/text/text.js +27 -41
- package/dist/components/text-field/text-field.d.ts +24 -24
- package/dist/components/text-field/text-field.js +102 -125
- package/dist/components/text-spacing/index.d.ts +2 -0
- package/dist/components/text-spacing/index.js +4 -0
- package/dist/components/text-spacing/text-spacing.d.ts +19 -0
- package/dist/components/text-spacing/text-spacing.js +17 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +4 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +15 -0
- package/dist/components/visually-hidden/visually-hidden.js +24 -0
- package/dist/icons/category.d.ts +985 -0
- package/dist/icons/category.js +333 -0
- package/dist/icons/name.d.ts +1 -1
- package/dist/icons/name.js +250 -200
- package/dist/index-DM5e-Whg.js +43 -0
- package/dist/index-DpfSJps6.js +75 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +53 -36
- package/dist/navigation-menu-BgN7IKev.js +1334 -0
- package/dist/tokens/spacing/variables.json.d.ts +34 -0
- package/dist/utils/action.d.ts +1 -1
- package/dist/utils/composeEventHandlers.d.ts +30 -0
- package/dist/utils/composeEventHandlers.js +9 -0
- package/dist/utils/composeRefs.d.ts +40 -0
- package/dist/utils/composeRefs.js +14 -0
- package/dist/utils/layout.d.ts +12 -0
- package/dist/utils/layout.js +11 -0
- package/package.json +25 -24
- package/dist/assets/f2a2f391a886d395.svg +0 -284
- package/dist/index-TI1xsy6a.js +0 -70
- package/dist/teams/index.d.ts +0 -0
- package/dist/teams/index.js +0 -1
- package/dist/teams/min-side/index.d.ts +0 -0
- package/dist/teams/min-side/index.js +0 -1
- package/dist/teams/webshop/index.d.ts +0 -0
- package/dist/teams/webshop/index.js +0 -1
- /package/dist/{teams/business/index.d.ts → components/text-field/tex-field-label.d.ts} +0 -0
- /package/dist/{teams/business/index.js → components/text-field/tex-field-label.js} +0 -0
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export * from './card';
|
|
2
|
+
export * from './grid';
|
|
3
|
+
export * from './navigation-menu';
|
|
4
|
+
export * from './switch';
|
|
5
|
+
export * from './accordion';
|
|
6
|
+
export * from './link';
|
|
7
|
+
export * from './badge';
|
|
1
8
|
export * from './button';
|
|
2
9
|
export * from './field-error-text';
|
|
3
10
|
export * from './helper-text';
|
|
@@ -7,3 +14,6 @@ export * from './label';
|
|
|
7
14
|
export * from './spinner';
|
|
8
15
|
export * from './text';
|
|
9
16
|
export * from './text-field';
|
|
17
|
+
export * from './heading';
|
|
18
|
+
export * from './visually-hidden';
|
|
19
|
+
export * from './text-spacing';
|
package/dist/components/index.js
CHANGED
|
@@ -1,23 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { A as e, B as t, C as p, S as x } from "../badge-CbHdlkcM.js";
|
|
2
|
+
import { Grid as m } from "./grid/grid.js";
|
|
3
|
+
import { N as i } from "../navigation-menu-BgN7IKev.js";
|
|
4
|
+
import { Link as d } from "./link/link.js";
|
|
5
|
+
import { Button as l } from "./button/button.js";
|
|
6
|
+
import { FieldErrorText as c } from "./field-error-text/field-error-text.js";
|
|
7
|
+
import { HelperText as g } from "./helper-text/helper-text.js";
|
|
8
|
+
import { default as S } from "../assets/5161b177f001ea1a.svg";
|
|
9
|
+
import { Icon as I } from "./icon/icon.js";
|
|
10
|
+
import { Input as C, InputGroup as F } from "./input/input.js";
|
|
11
|
+
import { Label as L } from "./label/label.js";
|
|
12
|
+
import { Spinner as b } from "./spinner/spinner.js";
|
|
13
|
+
import { Text as k } from "./text/text.js";
|
|
14
|
+
import { TextField as w } from "./text-field/text-field.js";
|
|
15
|
+
import { Heading as E } from "./heading/heading.js";
|
|
16
|
+
import { VisuallyHidden as V } from "./visually-hidden/visually-hidden.js";
|
|
17
|
+
import { TextSpacing as q } from "./text-spacing/text-spacing.js";
|
|
11
18
|
export {
|
|
12
|
-
e as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
e as Accordion,
|
|
20
|
+
t as Badge,
|
|
21
|
+
l as Button,
|
|
22
|
+
p as Card,
|
|
23
|
+
c as FieldErrorText,
|
|
24
|
+
m as Grid,
|
|
25
|
+
E as Heading,
|
|
26
|
+
g as HelperText,
|
|
27
|
+
I as Icon,
|
|
28
|
+
C as Input,
|
|
29
|
+
F as InputGroup,
|
|
30
|
+
L as Label,
|
|
31
|
+
d as Link,
|
|
32
|
+
i as NavigationMenu,
|
|
33
|
+
b as Spinner,
|
|
34
|
+
x as Switch,
|
|
35
|
+
k as Text,
|
|
36
|
+
w as TextField,
|
|
37
|
+
q as TextSpacing,
|
|
38
|
+
V as VisuallyHidden,
|
|
39
|
+
S as iconsHref
|
|
23
40
|
};
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
2
3
|
type InputGroupRootProps = React.ComponentPropsWithoutRef<'div'> & {};
|
|
3
4
|
type ValidationState = 'valid' | 'invalid';
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
5
|
+
type Input = React.ComponentPropsWithoutRef<'input'>;
|
|
6
|
+
type InputProps = Omit<Input, 'children'> & {
|
|
7
|
+
/** Whether the input should display its "valid" or "invalid" visual styling. */
|
|
8
8
|
validationState?: ValidationState;
|
|
9
|
-
/**
|
|
10
|
-
* Whether to show a loading indicator.
|
|
11
|
-
*/
|
|
9
|
+
/** Whether to show a loading indicator. */
|
|
12
10
|
isLoading?: boolean;
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
13
12
|
};
|
|
14
|
-
/**
|
|
15
|
-
* The input
|
|
16
|
-
*/
|
|
13
|
+
/** The input element */
|
|
17
14
|
declare const Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children"> & {
|
|
18
|
-
/**
|
|
19
|
-
* Whether the input should display its "valid" or "invalid" visual styling.
|
|
20
|
-
*/
|
|
15
|
+
/** Whether the input should display its "valid" or "invalid" visual styling. */
|
|
21
16
|
validationState?: ValidationState | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* Whether to show a loading indicator.
|
|
24
|
-
*/
|
|
17
|
+
/** Whether to show a loading indicator. */
|
|
25
18
|
isLoading?: boolean | undefined;
|
|
19
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
26
20
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
27
21
|
type InputIndicatorProps = React.ComponentPropsWithoutRef<'svg'> & {
|
|
28
22
|
isLoading?: boolean;
|
|
@@ -30,14 +24,11 @@ type InputIndicatorProps = React.ComponentPropsWithoutRef<'svg'> & {
|
|
|
30
24
|
};
|
|
31
25
|
declare const InputGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>> & {
|
|
32
26
|
Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children"> & {
|
|
33
|
-
/**
|
|
34
|
-
* Whether the input should display its "valid" or "invalid" visual styling.
|
|
35
|
-
*/
|
|
27
|
+
/** Whether the input should display its "valid" or "invalid" visual styling. */
|
|
36
28
|
validationState?: ValidationState | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* Whether to show a loading indicator.
|
|
39
|
-
*/
|
|
29
|
+
/** Whether to show a loading indicator. */
|
|
40
30
|
isLoading?: boolean | undefined;
|
|
31
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
41
32
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
42
33
|
Indicator: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
43
34
|
isLoading?: boolean | undefined;
|
|
@@ -1,82 +1,104 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c
|
|
4
|
-
import
|
|
5
|
-
import "../../assets/
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Spinner as
|
|
8
|
-
const
|
|
9
|
-
"teddy-input": "_teddy-
|
|
10
|
-
"teddy-input__frame": "_teddy-
|
|
11
|
-
"teddy-input__input": "_teddy-
|
|
12
|
-
"teddy-input__input--valid": "_teddy-input__input--
|
|
13
|
-
"teddy-input__input--invalid": "_teddy-input__input--
|
|
14
|
-
"teddy-input__indicator": "_teddy-
|
|
15
|
-
"teddy-input__input--error": "_teddy-input__input--
|
|
16
|
-
fadeInAnimation:
|
|
17
|
-
scaleInAnimation:
|
|
18
|
-
},
|
|
19
|
-
function
|
|
20
|
-
const e =
|
|
1
|
+
import '../../assets/input.css';
|
|
2
|
+
import { jsxs as y, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { c } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import s from "react";
|
|
5
|
+
import "../../assets/5161b177f001ea1a.svg";
|
|
6
|
+
import { Icon as C } from "../icon/icon.js";
|
|
7
|
+
import { Spinner as h } from "../spinner/spinner.js";
|
|
8
|
+
const x = "_fadeInAnimation_1o9uu_1", A = "_scaleInAnimation_1o9uu_1", a = {
|
|
9
|
+
"teddy-input": "_teddy-input_1o9uu_17",
|
|
10
|
+
"teddy-input__frame": "_teddy-input__frame_1o9uu_24",
|
|
11
|
+
"teddy-input__input": "_teddy-input__input_1o9uu_31",
|
|
12
|
+
"teddy-input__input--valid": "_teddy-input__input--valid_1o9uu_66",
|
|
13
|
+
"teddy-input__input--invalid": "_teddy-input__input--invalid_1o9uu_66",
|
|
14
|
+
"teddy-input__indicator": "_teddy-input__indicator_1o9uu_72",
|
|
15
|
+
"teddy-input__input--error": "_teddy-input__input--error_1o9uu_75",
|
|
16
|
+
fadeInAnimation: x,
|
|
17
|
+
scaleInAnimation: A
|
|
18
|
+
}, _ = "teddy-input";
|
|
19
|
+
function G(i) {
|
|
20
|
+
const e = i == null ? void 0 : i.target;
|
|
21
21
|
if (e.closest("input, button, a"))
|
|
22
22
|
return;
|
|
23
|
-
const t = [...
|
|
23
|
+
const t = [...i.currentTarget.getElementsByTagName("input")].find((d) => d);
|
|
24
24
|
if (!t)
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
26
|
+
const r = (t.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_PRECEDING) !== 0 ? 0 : t.value.length;
|
|
27
27
|
requestAnimationFrame(() => {
|
|
28
28
|
try {
|
|
29
|
-
t.setSelectionRange(
|
|
29
|
+
t.setSelectionRange(r, r);
|
|
30
30
|
} finally {
|
|
31
31
|
t.focus();
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
({ className:
|
|
37
|
-
const
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */ o(
|
|
40
|
-
/* @__PURE__ */ o("div", { className:
|
|
35
|
+
const g = s.createContext(void 0), p = s.forwardRef(
|
|
36
|
+
({ className: i, children: e, ...t }, n) => {
|
|
37
|
+
const u = c([a[`${_}`]], i);
|
|
38
|
+
return /* @__PURE__ */ y("div", { ...t, onPointerDown: G, ref: n, className: u, children: [
|
|
39
|
+
/* @__PURE__ */ o(g.Provider, { value: !0, children: e }),
|
|
40
|
+
/* @__PURE__ */ o("div", { className: a[`${_}__frame`] })
|
|
41
41
|
] });
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
({ className:
|
|
47
|
-
const
|
|
44
|
+
p.displayName = "InputGroup";
|
|
45
|
+
const v = s.forwardRef(
|
|
46
|
+
({ className: i, isLoading: e, validationState: t, ...n }, u) => {
|
|
47
|
+
const r = s.useContext(g), d = c(
|
|
48
48
|
[
|
|
49
|
-
|
|
49
|
+
a[`${_}__input`],
|
|
50
50
|
{
|
|
51
|
-
[
|
|
52
|
-
[
|
|
51
|
+
[a[`${_}__input--valid`]]: t === "valid",
|
|
52
|
+
[a[`${_}__input--error`]]: t === "invalid"
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
|
-
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
i
|
|
56
|
+
), N = r === !0;
|
|
57
|
+
function m(f) {
|
|
58
|
+
var I;
|
|
59
|
+
(I = n.onValueChange) == null || I.call(n, f.target.value), n.onChange && n.onChange(f);
|
|
60
|
+
}
|
|
61
|
+
return N ? /* @__PURE__ */ o(
|
|
62
|
+
"input",
|
|
63
|
+
{
|
|
64
|
+
"aria-invalid": t === "invalid",
|
|
65
|
+
...n,
|
|
66
|
+
onChange: m,
|
|
67
|
+
className: d,
|
|
68
|
+
ref: u
|
|
69
|
+
}
|
|
70
|
+
) : /* @__PURE__ */ y(p, { children: [
|
|
71
|
+
/* @__PURE__ */ o(
|
|
72
|
+
"input",
|
|
73
|
+
{
|
|
74
|
+
"aria-invalid": t === "invalid",
|
|
75
|
+
...n,
|
|
76
|
+
onChange: m,
|
|
77
|
+
className: d,
|
|
78
|
+
ref: u
|
|
79
|
+
}
|
|
80
|
+
),
|
|
59
81
|
/* @__PURE__ */ o(l, { isValid: t === "valid", isLoading: e })
|
|
60
82
|
] });
|
|
61
83
|
}
|
|
62
84
|
);
|
|
63
|
-
|
|
64
|
-
const l =
|
|
65
|
-
({ className:
|
|
85
|
+
v.displayName = "Input";
|
|
86
|
+
const l = s.forwardRef(
|
|
87
|
+
({ className: i, isLoading: e, isValid: t, ...n }, u) => {
|
|
66
88
|
if (!t && !e)
|
|
67
89
|
return null;
|
|
68
90
|
if (!t && e)
|
|
69
|
-
return /* @__PURE__ */ o(
|
|
70
|
-
const
|
|
71
|
-
return /* @__PURE__ */ o(
|
|
91
|
+
return /* @__PURE__ */ o(h, { className: i, size: "xs", ...n, ref: u });
|
|
92
|
+
const r = c([a[`${_}__indicator`]], i);
|
|
93
|
+
return /* @__PURE__ */ o(C, { ...n, size: "md", name: "check-circle-filled", className: r, ref: u });
|
|
72
94
|
}
|
|
73
95
|
);
|
|
74
96
|
l.displayName = "InputIndicator";
|
|
75
|
-
const
|
|
76
|
-
Input:
|
|
97
|
+
const T = Object.assign(p, {
|
|
98
|
+
Input: v,
|
|
77
99
|
Indicator: l
|
|
78
100
|
});
|
|
79
101
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
102
|
+
v as Input,
|
|
103
|
+
T as InputGroup
|
|
82
104
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
export type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & {
|
|
4
4
|
disabled?: boolean;
|
|
5
|
+
isRequired?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & {
|
|
7
8
|
disabled?: boolean | undefined;
|
|
9
|
+
isRequired?: boolean | undefined;
|
|
8
10
|
} & React.RefAttributes<HTMLLabelElement>>;
|
|
9
11
|
export { Label };
|
|
@@ -1,61 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { _ as
|
|
4
|
-
import
|
|
5
|
-
import "
|
|
6
|
-
import { c as
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
"button",
|
|
10
|
-
"div",
|
|
11
|
-
"form",
|
|
12
|
-
"h2",
|
|
13
|
-
"h3",
|
|
14
|
-
"img",
|
|
15
|
-
"input",
|
|
16
|
-
"label",
|
|
17
|
-
"li",
|
|
18
|
-
"nav",
|
|
19
|
-
"ol",
|
|
20
|
-
"p",
|
|
21
|
-
"span",
|
|
22
|
-
"svg",
|
|
23
|
-
"ul"
|
|
24
|
-
], y = x.reduce((a, t) => {
|
|
25
|
-
const e = /* @__PURE__ */ f((o, r) => {
|
|
26
|
-
const { asChild: l, ...n } = o, m = l ? p : t;
|
|
27
|
-
return $(() => {
|
|
28
|
-
window[Symbol.for("radix-ui")] = !0;
|
|
29
|
-
}, []), /* @__PURE__ */ i(m, d({}, n, {
|
|
30
|
-
ref: r
|
|
31
|
-
}));
|
|
32
|
-
});
|
|
33
|
-
return e.displayName = `Primitive.${t}`, {
|
|
34
|
-
...a,
|
|
35
|
-
[t]: e
|
|
36
|
-
};
|
|
37
|
-
}, {}), v = /* @__PURE__ */ f((a, t) => /* @__PURE__ */ i(y.label, d({}, a, {
|
|
38
|
-
ref: t,
|
|
1
|
+
import '../../assets/label.css';
|
|
2
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
+
import { _ as b } from "../../index-DpfSJps6.js";
|
|
4
|
+
import n, { forwardRef as i, createElement as m } from "react";
|
|
5
|
+
import { $ as _ } from "../../index-DM5e-Whg.js";
|
|
6
|
+
import { c as $ } from "../../clsx-DB4S2d7J.js";
|
|
7
|
+
const u = /* @__PURE__ */ i((a, d) => /* @__PURE__ */ m(_.label, b({}, a, {
|
|
8
|
+
ref: d,
|
|
39
9
|
onMouseDown: (e) => {
|
|
40
|
-
var
|
|
41
|
-
(
|
|
10
|
+
var l;
|
|
11
|
+
(l = a.onMouseDown) === null || l === void 0 || l.call(a, e), !e.defaultPrevented && e.detail > 1 && e.preventDefault();
|
|
42
12
|
}
|
|
43
|
-
}))),
|
|
44
|
-
"teddy-label": "_teddy-
|
|
45
|
-
"teddy-label--disabled": "_teddy-label--
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
13
|
+
}))), p = u, o = {
|
|
14
|
+
"teddy-label": "_teddy-label_1hc8e_1",
|
|
15
|
+
"teddy-label--disabled": "_teddy-label--disabled_1hc8e_8",
|
|
16
|
+
"teddy-label--required": "_teddy-label--required_1hc8e_12"
|
|
17
|
+
}, r = "teddy-label", y = n.forwardRef(
|
|
18
|
+
({ className: a, disabled: d, isRequired: e, children: l, ...t }, s) => {
|
|
19
|
+
const c = $(
|
|
20
|
+
[o[r]],
|
|
50
21
|
{
|
|
51
|
-
[
|
|
22
|
+
[o[`${r}--disabled`]]: d,
|
|
23
|
+
[o[`${r}--required`]]: e
|
|
52
24
|
},
|
|
53
25
|
a
|
|
54
26
|
);
|
|
55
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ f(p, { ...t, ref: s, className: c, children: l });
|
|
56
28
|
}
|
|
57
29
|
);
|
|
58
|
-
|
|
30
|
+
y.displayName = "Label";
|
|
59
31
|
export {
|
|
60
|
-
|
|
32
|
+
y as Label
|
|
61
33
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
/** -------------------------------------------------------------------------------------------------
|
|
4
|
+
* Link
|
|
5
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
6
|
+
type Variant = 'text' | 'text-negative' | 'standalone' | 'standalone-negative' | 'navigation' | 'navigation-negative';
|
|
7
|
+
type LinkProps = React.ComponentPropsWithoutRef<'a'> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
/** Disables visited styling */
|
|
10
|
+
disableVisited?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* This sets a minimum size on the targetable area of the link. Please note
|
|
13
|
+
* it also changes display value to flex, meaning its container will behave
|
|
14
|
+
* like a block element. You can wrap this component in a flex container
|
|
15
|
+
* for additional layout control.
|
|
16
|
+
*/
|
|
17
|
+
ensureTargetArea?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* A silent link is intended to wrap an element
|
|
20
|
+
* to make it a link but not add any styling
|
|
21
|
+
* except for the pointer cursor and focus style.
|
|
22
|
+
*/
|
|
23
|
+
silent?: boolean;
|
|
24
|
+
variant: Variant;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
declare const Link: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
30
|
+
asChild?: boolean | undefined;
|
|
31
|
+
/** Disables visited styling */
|
|
32
|
+
disableVisited?: boolean | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* This sets a minimum size on the targetable area of the link. Please note
|
|
35
|
+
* it also changes display value to flex, meaning its container will behave
|
|
36
|
+
* like a block element. You can wrap this component in a flex container
|
|
37
|
+
* for additional layout control.
|
|
38
|
+
*/
|
|
39
|
+
ensureTargetArea?: boolean | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* A silent link is intended to wrap an element
|
|
42
|
+
* to make it a link but not add any styling
|
|
43
|
+
* except for the pointer cursor and focus style.
|
|
44
|
+
*/
|
|
45
|
+
silent?: boolean | undefined;
|
|
46
|
+
variant: Variant;
|
|
47
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
48
|
+
export { Link };
|
|
49
|
+
export type { LinkProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import '../../assets/link.css';
|
|
2
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import { c } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import g from "react";
|
|
5
|
+
import { $ as v } from "../../index-DpfSJps6.js";
|
|
6
|
+
const e = {
|
|
7
|
+
"teddy-link": "_teddy-link_1jza5_1",
|
|
8
|
+
"teddy-link--text": "_teddy-link--text_1jza5_15",
|
|
9
|
+
"teddy-link--standalone": "_teddy-link--standalone_1jza5_15",
|
|
10
|
+
"teddy-link--navigation": "_teddy-link--navigation_1jza5_15",
|
|
11
|
+
"teddy-link--disable-visited": "_teddy-link--disable-visited_1jza5_25",
|
|
12
|
+
"teddy-link--text-negative": "_teddy-link--text-negative_1jza5_28",
|
|
13
|
+
"teddy-link--standalone-negative": "_teddy-link--standalone-negative_1jza5_28",
|
|
14
|
+
"teddy-link--navigation-negative": "_teddy-link--navigation-negative_1jza5_28",
|
|
15
|
+
"teddy-link--ensure-target-area": "_teddy-link--ensure-target-area_1jza5_56",
|
|
16
|
+
"teddy-link--silent": "_teddy-link--silent_1jza5_62"
|
|
17
|
+
}, t = "teddy-link", f = g.forwardRef(
|
|
18
|
+
({ className: s, variant: a, silent: d, disableVisited: _, ensureTargetArea: r, asChild: o, children: n, ...i }, k) => {
|
|
19
|
+
const y = c(
|
|
20
|
+
[e[`${t}`]],
|
|
21
|
+
e[`${t}--${a}`],
|
|
22
|
+
{
|
|
23
|
+
[e[`${t}--silent`]]: d,
|
|
24
|
+
[e[`${t}--negative`]]: a.endsWith("negative"),
|
|
25
|
+
[e[`${t}--disable-visited`]]: _ ?? d,
|
|
26
|
+
[e[`${t}--ensure-target-area`]]: r
|
|
27
|
+
},
|
|
28
|
+
s
|
|
29
|
+
);
|
|
30
|
+
return /* @__PURE__ */ l(v, { ...i, ref: k, className: y, children: o ? n : /* @__PURE__ */ l("a", { href: i.href, children: n }) });
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
f.displayName = "Link";
|
|
34
|
+
export {
|
|
35
|
+
f as Link
|
|
36
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
4
|
+
/** -------------------------------------------------------------------------------------------------
|
|
5
|
+
* NavigationMenuRoot
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
type RootProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root> & {
|
|
8
|
+
/** The default top menu value
|
|
9
|
+
* @example "private" | "business"
|
|
10
|
+
*/
|
|
11
|
+
defaultTopMenuValue?: string;
|
|
12
|
+
};
|
|
13
|
+
/** -------------------------------------------------------------------------------------------------
|
|
14
|
+
* NavigationMenu.TopMenuList
|
|
15
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
16
|
+
type TopMenuListProps = React.ComponentPropsWithoutRef<'ul'>;
|
|
17
|
+
/** -------------------------------------------------------------------------------------------------
|
|
18
|
+
* NavigationMenu.TopMenuItem
|
|
19
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
20
|
+
type TopMenuItemProps = React.ComponentPropsWithoutRef<'li'>;
|
|
21
|
+
/** -------------------------------------------------------------------------------------------------
|
|
22
|
+
* NavigationMenu.TopMenuTrigger
|
|
23
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
24
|
+
type TopMenuTriggerProps = React.ComponentPropsWithoutRef<'button'> & {
|
|
25
|
+
value: string;
|
|
26
|
+
};
|
|
27
|
+
/** -------------------------------------------------------------------------------------------------
|
|
28
|
+
* NavigationMenuList
|
|
29
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
30
|
+
type ListProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List> & {
|
|
31
|
+
variant?: 'gray';
|
|
32
|
+
/** If the list should be contained by the top menu, provide a value that matches the top menu value
|
|
33
|
+
* @example
|
|
34
|
+
* <NavigationMenu.TopMenuTrigger value="home" />
|
|
35
|
+
* <NavigationMenu.List value="home" />
|
|
36
|
+
*/
|
|
37
|
+
value?: string;
|
|
38
|
+
};
|
|
39
|
+
/** -------------------------------------------------------------------------------------------------
|
|
40
|
+
* NavigationMenuItem
|
|
41
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
42
|
+
type ItemProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item> & {
|
|
43
|
+
defaultValue?: string;
|
|
44
|
+
};
|
|
45
|
+
/** -------------------------------------------------------------------------------------------------
|
|
46
|
+
* NavigationMenuTrigger
|
|
47
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
48
|
+
type TriggerProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger> & {
|
|
49
|
+
variant?: 'default' | 'small';
|
|
50
|
+
};
|
|
51
|
+
/** -------------------------------------------------------------------------------------------------
|
|
52
|
+
* NavigationMenuContent
|
|
53
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
54
|
+
type ContentProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content> & {
|
|
55
|
+
variant?: 'default' | 'float';
|
|
56
|
+
};
|
|
57
|
+
/** -------------------------------------------------------------------------------------------------
|
|
58
|
+
* NavigationMenuLink
|
|
59
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
60
|
+
type LinkProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Link> & {
|
|
61
|
+
variant?: 'default' | 'small' | 'button';
|
|
62
|
+
};
|
|
63
|
+
/** -------------------------------------------------------------------------------------------------
|
|
64
|
+
* NavigationMenuIndicator
|
|
65
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
66
|
+
type IndicatorProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>;
|
|
67
|
+
/** -------------------------------------------------------------------------------------------------
|
|
68
|
+
* NavigationMenuViewport
|
|
69
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
70
|
+
type ViewportProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>;
|
|
71
|
+
/** -------------------------------------------------------------------------------------------------
|
|
72
|
+
* NavigationMenuSub
|
|
73
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
74
|
+
type SubProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Sub>;
|
|
75
|
+
declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
76
|
+
/** The default top menu value
|
|
77
|
+
* @example "private" | "business"
|
|
78
|
+
*/
|
|
79
|
+
defaultTopMenuValue?: string | undefined;
|
|
80
|
+
} & React.RefAttributes<HTMLElement>> & {
|
|
81
|
+
List: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & {
|
|
82
|
+
variant?: "gray" | undefined;
|
|
83
|
+
/** If the list should be contained by the top menu, provide a value that matches the top menu value
|
|
84
|
+
* @example
|
|
85
|
+
* <NavigationMenu.TopMenuTrigger value="home" />
|
|
86
|
+
* <NavigationMenu.List value="home" />
|
|
87
|
+
*/
|
|
88
|
+
value?: string | undefined;
|
|
89
|
+
} & React.RefAttributes<HTMLUListElement>>;
|
|
90
|
+
Item: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>, "ref"> & {
|
|
91
|
+
defaultValue?: string | undefined;
|
|
92
|
+
} & React.RefAttributes<HTMLLIElement>>;
|
|
93
|
+
Trigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
94
|
+
variant?: "small" | "default" | undefined;
|
|
95
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
96
|
+
Content: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
97
|
+
variant?: "default" | "float" | undefined;
|
|
98
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
99
|
+
Link: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "ref"> & {
|
|
100
|
+
variant?: "button" | "small" | "default" | undefined;
|
|
101
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
102
|
+
Indicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
103
|
+
Viewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
104
|
+
Sub: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuSubProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
105
|
+
TopMenuList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
106
|
+
TopMenuItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
107
|
+
TopMenuTrigger: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
108
|
+
value: string;
|
|
109
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
110
|
+
};
|
|
111
|
+
type NavigationMenuProps = {
|
|
112
|
+
Root: RootProps;
|
|
113
|
+
List: ListProps;
|
|
114
|
+
Item: ItemProps;
|
|
115
|
+
Trigger: TriggerProps;
|
|
116
|
+
Content: ContentProps;
|
|
117
|
+
Link: LinkProps;
|
|
118
|
+
Indicator: IndicatorProps;
|
|
119
|
+
Viewport: ViewportProps;
|
|
120
|
+
Sub: SubProps;
|
|
121
|
+
TopMenuList: TopMenuListProps;
|
|
122
|
+
TopMenuItem: TopMenuItemProps;
|
|
123
|
+
TopMenuTrigger: TopMenuTriggerProps;
|
|
124
|
+
};
|
|
125
|
+
export { NavigationMenu };
|
|
126
|
+
export type { NavigationMenuProps };
|