@cupra/ui-react 1.0.0-canary.3 → 1.0.0-canary.31
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 +21 -8
- package/{THIRD-PARTY-LICENSES.MD → THIRD_PARTY_LICENSES.MD} +3 -3
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.js +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +8 -7
- package/dist/components/Badge/Badge.d.ts +7 -0
- package/dist/components/Badge/Badge.js +8 -0
- package/dist/components/Badge/stories/CupraDiagonal.stories.d.ts +8 -0
- package/dist/components/Bullets/Bullets.d.ts +1 -1
- package/dist/components/Bullets/Bullets.js +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +7 -6
- package/dist/components/CarouselIndicator/CarouselIndicator.d.ts +1 -1
- package/dist/components/CarouselIndicator/CarouselIndicator.js +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +7 -6
- package/dist/components/Chip/Chip.d.ts +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Chips/Chips.d.ts +1 -1
- package/dist/components/Chips/Chips.js +7 -6
- package/dist/components/Currency/Currency.d.ts +1 -1
- package/dist/components/Currency/Currency.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/Dialog.js +11 -9
- package/dist/components/DialogBody/DialogBody.d.ts +1 -1
- package/dist/components/DialogBody/DialogBody.js +1 -1
- package/dist/components/DialogFooter/DialogFooter.d.ts +1 -1
- package/dist/components/DialogFooter/DialogFooter.js +1 -1
- package/dist/components/DialogHeader/DialogHeader.d.ts +1 -1
- package/dist/components/DialogHeader/DialogHeader.js +1 -1
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.js +1 -1
- package/dist/components/Hyperlink/Hyperlink.d.ts +1 -1
- package/dist/components/Hyperlink/Hyperlink.js +6 -5
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/IconButton/IconButton.d.ts +2 -3
- package/dist/components/IconButton/IconButton.js +7 -6
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/InteractiveCard/InteractiveCard.d.ts +1 -1
- package/dist/components/InteractiveCard/InteractiveCard.js +5 -4
- package/dist/components/LinkButton/LinkButton.d.ts +1 -1
- package/dist/components/LinkButton/LinkButton.js +4 -3
- package/dist/components/Loader/Loader.d.ts +4 -1
- package/dist/components/Loader/Loader.js +16 -13
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logo/Logo.js +1 -1
- package/dist/components/MainTitle/MainTitle.d.ts +17 -0
- package/dist/components/MainTitle/MainTitle.js +19 -0
- package/dist/components/MainTitle/stories/CupraDiagonal.stories.d.ts +9 -0
- package/dist/components/MapPin/MapPin.d.ts +1 -1
- package/dist/components/MapPin/MapPin.js +8 -7
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.js +15 -13
- package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +33 -35
- package/dist/components/PickerItem/PickerItem.d.ts +1 -1
- package/dist/components/PickerItem/PickerItem.js +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js +7 -6
- package/dist/components/RadioButton/RadioButton.d.ts +1 -1
- package/dist/components/RadioButton/RadioButton.js +1 -1
- package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
- package/dist/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/dist/components/Rating/Rating.d.ts +8 -0
- package/dist/components/Rating/Rating.js +9 -0
- package/dist/components/Rating/stories/CupraDiagonal.stories.d.ts +10 -0
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Search/Search.js +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.js +8 -7
- package/dist/components/SecondaryNavigation/SecondaryNavigation.d.ts +6 -5
- package/dist/components/SecondaryNavigation/SecondaryNavigation.js +11 -10
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +8 -7
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Selection/Selection.d.ts +1 -1
- package/dist/components/Selection/Selection.js +1 -1
- package/dist/components/SidebarNavigation/SidebarNavigation.d.ts +1 -1
- package/dist/components/SidebarNavigation/SidebarNavigation.js +1 -1
- package/dist/components/Slider/Slider.d.ts +2 -2
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/StaticBox/StaticBox.d.ts +1 -1
- package/dist/components/StaticBox/StaticBox.js +7 -6
- package/dist/components/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +11 -10
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.js +8 -7
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/TextInput/TextInput.d.ts +1 -1
- package/dist/components/TextInput/TextInput.js +15 -14
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/Textarea/Textarea.js +4 -3
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/components/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/ToastMessage/ToastMessage.d.ts +1 -1
- package/dist/components/ToastMessage/ToastMessage.js +7 -6
- package/dist/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleButton.js +4 -3
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.js +9 -8
- package/dist/components/Tooltip/Tooltip.d.ts +30 -10
- package/dist/components/Tooltip/Tooltip.js +13 -22
- package/dist/components/Tooltip/stories/CupraDiagonal.stories.d.ts +5 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/hooks/useBreakpoint.js +13 -13
- package/dist/hooks/useHandleEvent.js +18 -16
- package/dist/index.js +109 -103
- package/package.json +20 -9
- package/dist/packages/ui-kit/dist-react/index.js +0 -9221
- package/dist/packages/ui-kit/dist-react/utils/breakpoints.js +0 -11
- package/dist/packages/ui-kit/dist-react/utils/debounce.js +0 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import '@cupra/ui-kit/react';
|
|
2
|
+
import '@cupra/ui-kit/react/ds-static-box';
|
|
3
3
|
import type { DsStaticBoxAttrs } from '@cupra/ui-kit/react/types/ds-static-box';
|
|
4
4
|
type StaticBoxProps = DsStaticBoxAttrs & {
|
|
5
5
|
className?: string;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import "@cupra/ui-kit/react/utils/breakpoints";
|
|
2
3
|
import "react";
|
|
3
4
|
import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
|
|
4
|
-
import "
|
|
5
|
-
function
|
|
6
|
-
const { className: o, children: s, size: t, ...
|
|
5
|
+
import "@cupra/ui-kit/react/ds-static-box";
|
|
6
|
+
function x(r) {
|
|
7
|
+
const { className: o, children: s, size: t, ...i } = r, { ref: e } = c({});
|
|
7
8
|
return /* @__PURE__ */ n(
|
|
8
9
|
"ds-static-box-react",
|
|
9
10
|
{
|
|
10
|
-
ref:
|
|
11
|
+
ref: e,
|
|
11
12
|
size: typeof t == "string" ? t : JSON.stringify(t),
|
|
12
13
|
class: o,
|
|
13
|
-
...
|
|
14
|
+
...i,
|
|
14
15
|
children: s
|
|
15
16
|
}
|
|
16
17
|
);
|
|
17
18
|
}
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
x as StaticBox
|
|
20
21
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "@cupra/ui-kit/react/utils/breakpoints";
|
|
2
3
|
import "react";
|
|
3
4
|
import { useHandleEvent as i } from "../../hooks/useHandleEvent.js";
|
|
4
|
-
import "
|
|
5
|
-
function
|
|
5
|
+
import "@cupra/ui-kit/react/ds-tabs";
|
|
6
|
+
function n({ children: t, onChange: e, ...o }) {
|
|
6
7
|
const { ref: a } = i({ change: e });
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ r("ds-tabs-react", { ref: a, ...o, children: t });
|
|
8
9
|
}
|
|
9
10
|
function l({ children: t }) {
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ r("div", { role: "tab", slot: "tab", children: t });
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
function p({ children: t }) {
|
|
14
|
+
return /* @__PURE__ */ r("div", { role: "tabpanel", slot: "panel", children: t });
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
n.Tab = l;
|
|
17
|
+
n.Panel = p;
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
n as Tabs
|
|
19
20
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
|
-
import '@cupra/ui-kit/react';
|
|
2
|
+
import '@cupra/ui-kit/react/ds-tag';
|
|
3
3
|
import { DsTagAttrs } from '@cupra/ui-kit/react/types/ds-tag';
|
|
4
4
|
type Children = JSX.Element | JSX.Element[] | string;
|
|
5
5
|
interface TabsProps extends DsTagAttrs {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import "@cupra/ui-kit/react/utils/breakpoints";
|
|
2
3
|
import "react";
|
|
3
|
-
import { useHandleEvent as
|
|
4
|
-
import "
|
|
5
|
-
function
|
|
6
|
-
const { children: r, onClickIcon: t, className: c, ...n } = o, { ref: e } =
|
|
7
|
-
return /* @__PURE__ */
|
|
4
|
+
import { useHandleEvent as s } from "../../hooks/useHandleEvent.js";
|
|
5
|
+
import "@cupra/ui-kit/react/ds-tag";
|
|
6
|
+
function d(o) {
|
|
7
|
+
const { children: r, onClickIcon: t, className: c, ...n } = o, { ref: e } = s({ clickicon: t });
|
|
8
|
+
return /* @__PURE__ */ i("ds-tag-react", { ref: e, class: c, ...n, children: r });
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
d as Tag
|
|
11
12
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DsTextAttrs } from '@cupra/ui-kit/react/types/ds-text';
|
|
2
2
|
import { type ReactElement } from 'react';
|
|
3
|
-
import '@cupra/ui-kit/react';
|
|
3
|
+
import '@cupra/ui-kit/react/ds-text';
|
|
4
4
|
type TextProps = DsTextAttrs & {
|
|
5
5
|
className?: string;
|
|
6
6
|
children: JSX.Element | JSX.Element[] | string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
2
|
+
import "@cupra/ui-kit/react/ds-text";
|
|
3
3
|
function a(t) {
|
|
4
4
|
const { className: r, children: e, ...o } = t;
|
|
5
5
|
return /* @__PURE__ */ s("ds-text-react", { class: r, ...o, children: e });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DsTextInputAttrs } from '@cupra/ui-kit/react/types/ds-text-input';
|
|
2
2
|
import { ChangeEvent, FormEvent, KeyboardEvent, type ReactElement } from 'react';
|
|
3
|
-
import '@cupra/ui-kit/react';
|
|
3
|
+
import '@cupra/ui-kit/react/ds-text-input';
|
|
4
4
|
type TextInputProps = DsTextInputAttrs & {
|
|
5
5
|
type?: 'text' | 'email' | 'number' | 'url' | 'tel';
|
|
6
6
|
className?: string;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { jsxs as y, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
2
|
+
import "@cupra/ui-kit/react/ds-text-input";
|
|
3
|
+
import "@cupra/ui-kit/react/utils/breakpoints";
|
|
3
4
|
import "react";
|
|
4
5
|
import { useHandleEvent as b } from "../../hooks/useHandleEvent.js";
|
|
5
|
-
function
|
|
6
|
+
function k(n) {
|
|
6
7
|
const {
|
|
7
8
|
className: r,
|
|
8
9
|
children: I,
|
|
9
10
|
onChange: o,
|
|
10
|
-
onInput:
|
|
11
|
-
onKeyDown:
|
|
11
|
+
onInput: p,
|
|
12
|
+
onKeyDown: i,
|
|
12
13
|
inputId: e,
|
|
13
|
-
placeHolder:
|
|
14
|
+
placeHolder: l,
|
|
14
15
|
type: a,
|
|
15
16
|
value: d,
|
|
16
17
|
label: s,
|
|
17
18
|
required: c,
|
|
18
|
-
disabled:
|
|
19
|
-
pattern:
|
|
20
|
-
maxLength:
|
|
19
|
+
disabled: m,
|
|
20
|
+
pattern: u,
|
|
21
|
+
maxLength: h,
|
|
21
22
|
minLength: x,
|
|
22
23
|
...f
|
|
23
|
-
} = n, { ref: g } = b({ change: o, input:
|
|
24
|
+
} = n, { ref: g } = b({ change: o, input: p, keydown: i });
|
|
24
25
|
return /* @__PURE__ */ y("ds-text-input-react", { ref: g, class: r, ...f, children: [
|
|
25
26
|
/* @__PURE__ */ t("label", { htmlFor: e, children: s }),
|
|
26
27
|
/* @__PURE__ */ t(
|
|
@@ -28,17 +29,17 @@ function L(n) {
|
|
|
28
29
|
{
|
|
29
30
|
id: e,
|
|
30
31
|
type: a || "text",
|
|
31
|
-
placeholder:
|
|
32
|
+
placeholder: l,
|
|
32
33
|
value: d,
|
|
33
34
|
required: c,
|
|
34
|
-
disabled:
|
|
35
|
+
disabled: m,
|
|
35
36
|
minLength: x,
|
|
36
|
-
maxLength:
|
|
37
|
-
pattern:
|
|
37
|
+
maxLength: h,
|
|
38
|
+
pattern: u
|
|
38
39
|
}
|
|
39
40
|
)
|
|
40
41
|
] });
|
|
41
42
|
}
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
k as TextInput
|
|
44
45
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DsTextareaAttrs } from '@cupra/ui-kit/react/types/ds-textarea';
|
|
2
2
|
import { type ReactElement } from 'react';
|
|
3
|
-
import '@cupra/ui-kit/react';
|
|
3
|
+
import '@cupra/ui-kit/react/ds-textarea';
|
|
4
4
|
type TextareaProps = DsTextareaAttrs & {
|
|
5
5
|
className?: string;
|
|
6
6
|
onChange?: (event: typeof InputEvent) => void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsxs as E, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
2
|
+
import "@cupra/ui-kit/react/ds-textarea";
|
|
3
|
+
import "@cupra/ui-kit/react/utils/breakpoints";
|
|
3
4
|
import "react";
|
|
4
5
|
import { useHandleEvent as j } from "../../hooks/useHandleEvent.js";
|
|
5
|
-
function
|
|
6
|
+
function F(t) {
|
|
6
7
|
const {
|
|
7
8
|
className: o,
|
|
8
9
|
children: I,
|
|
@@ -53,5 +54,5 @@ function C(t) {
|
|
|
53
54
|
);
|
|
54
55
|
}
|
|
55
56
|
export {
|
|
56
|
-
|
|
57
|
+
F as Textarea
|
|
57
58
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
2
|
+
import "@cupra/ui-kit/react/ds-theme-provider";
|
|
3
3
|
const i = ({ children: r, ...e }) => /* @__PURE__ */ o("ds-theme-provider-react", { ...e, children: r });
|
|
4
4
|
export {
|
|
5
5
|
i as ThemeProvider
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DsToastMessageAttrs } from '@cupra/ui-kit/react/types/ds-toast-message';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
import '@cupra/ui-kit/react';
|
|
3
|
+
import '@cupra/ui-kit/react/ds-toast-message';
|
|
4
4
|
export type ToastMessageProps = DsToastMessageAttrs & {
|
|
5
5
|
className?: string;
|
|
6
6
|
children?: ReactNode;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
2
|
+
import "@cupra/ui-kit/react/ds-toast-message";
|
|
3
|
+
import "@cupra/ui-kit/react/utils/breakpoints";
|
|
3
4
|
import "react";
|
|
4
5
|
import { useHandleEvent as n } from "../../hooks/useHandleEvent.js";
|
|
5
|
-
function
|
|
6
|
-
const { className: s, children:
|
|
7
|
-
"toast:remove":
|
|
6
|
+
function d(o) {
|
|
7
|
+
const { className: s, children: t, onClose: e, ...r } = o, { ref: a } = n({
|
|
8
|
+
"toast:remove": e
|
|
8
9
|
});
|
|
9
|
-
return /* @__PURE__ */ m("ds-toast-message-react", { ref: a, class: s, ...r, children:
|
|
10
|
+
return /* @__PURE__ */ m("ds-toast-message-react", { ref: a, class: s, ...r, children: t });
|
|
10
11
|
}
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
d as ToastMessage
|
|
13
14
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
|
-
import '@cupra/ui-kit/react';
|
|
2
|
+
import '@cupra/ui-kit/react/ds-toggle-button';
|
|
3
3
|
import { type DsToggleButtonAttrs } from '@cupra/ui-kit/react/types/ds-toggle-button';
|
|
4
4
|
type ToggleButtonProps = DsToggleButtonAttrs & {
|
|
5
5
|
onChange?: (event: CustomEvent) => void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "@cupra/ui-kit/react/utils/breakpoints";
|
|
2
3
|
import "react";
|
|
3
4
|
import { useHandleEvent as n } from "../../hooks/useHandleEvent.js";
|
|
4
|
-
import "
|
|
5
|
-
function
|
|
5
|
+
import "@cupra/ui-kit/react/ds-toggle-button";
|
|
6
|
+
function c({ onChange: t, ...o }) {
|
|
6
7
|
const { ref: r } = n({ change: t });
|
|
7
8
|
return /* @__PURE__ */ e("ds-toggle-button-react", { ref: r, ...o });
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
c as ToggleButton
|
|
11
12
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChangeEvent, type ReactElement } from 'react';
|
|
2
|
-
import '@cupra/ui-kit/react';
|
|
2
|
+
import '@cupra/ui-kit/react/ds-toggle-switch';
|
|
3
3
|
import { DsToggleSwitchAttrs } from '@cupra/ui-kit/react/types/ds-toggle-switch';
|
|
4
4
|
type Children = JSX.Element | JSX.Element[] | string;
|
|
5
5
|
interface ToggleSwitchProps extends DsToggleSwitchAttrs {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { jsxs as f, jsx as
|
|
1
|
+
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import "@cupra/ui-kit/react/utils/breakpoints";
|
|
2
3
|
import "react";
|
|
3
4
|
import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
|
|
4
|
-
import "
|
|
5
|
-
function r({ label:
|
|
5
|
+
import "@cupra/ui-kit/react/ds-toggle-switch";
|
|
6
|
+
function r({ label: t, onChange: i, ...o }) {
|
|
6
7
|
const { ref: e } = c({ change: i });
|
|
7
8
|
return /* @__PURE__ */ f("ds-toggle-switch-react", { ref: e, ...o, children: [
|
|
8
|
-
|
|
9
|
+
t && /* @__PURE__ */ n("div", { slot: "label", children: t }),
|
|
9
10
|
o.children
|
|
10
11
|
] });
|
|
11
12
|
}
|
|
12
|
-
function l({ children:
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
function l({ children: t }) {
|
|
14
|
+
return /* @__PURE__ */ n("div", { slot: "off", children: t });
|
|
14
15
|
}
|
|
15
|
-
function s({ children:
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
function s({ children: t }) {
|
|
17
|
+
return /* @__PURE__ */ n("div", { slot: "on", children: t });
|
|
17
18
|
}
|
|
18
19
|
r.Off = l;
|
|
19
20
|
r.On = s;
|
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
import { type ReactElement } from 'react';
|
|
2
|
-
import '@cupra/ui-kit/react';
|
|
1
|
+
import { type HTMLAttributes, type ImgHTMLAttributes, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import '@cupra/ui-kit/react/ds-tooltip';
|
|
3
3
|
import { DsTooltipAttrs } from '@cupra/ui-kit/react/types/ds-tooltip';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
children:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { type IconButtonProps } from '../IconButton/IconButton';
|
|
5
|
+
export type TooltipProps = DsTooltipAttrs & {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type CloseButtonProps = Omit<IconButtonProps, 'icon-name'>;
|
|
9
|
+
export declare const Tooltip: {
|
|
10
|
+
({ children, ...restProps }: TooltipProps): ReactElement;
|
|
11
|
+
Header: {
|
|
12
|
+
({ children, ...props }: {
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
} & HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
CloseButton: {
|
|
18
|
+
(props: CloseButtonProps): ReactElement;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
Content: {
|
|
22
|
+
({ children, ...props }: {
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
} & HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
Img: {
|
|
28
|
+
({ alt, ...props }: ImgHTMLAttributes<HTMLImageElement>): ReactElement;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
onClickConfirmButton: i,
|
|
14
|
-
...e
|
|
15
|
-
}) {
|
|
16
|
-
const { ref: n } = c({
|
|
17
|
-
"click-cancel-button": r,
|
|
18
|
-
"click-confirm-button": i
|
|
19
|
-
});
|
|
20
|
-
return /* @__PURE__ */ t("ds-tooltip-react", { ref: n, ...e, children: /* @__PURE__ */ t(l, { children: o }) });
|
|
21
|
-
}
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "@cupra/ui-kit/react/ds-tooltip";
|
|
3
|
+
import { IconButton as a } from "../IconButton/IconButton.js";
|
|
4
|
+
const n = ({ children: t, ...o }) => /* @__PURE__ */ e("ds-tooltip-react", { ...o, children: t }), r = ({ children: t, ...o }) => /* @__PURE__ */ e("div", { slot: "header", ...o, children: t }), s = (t) => /* @__PURE__ */ e(a, { slot: "close-button", "icon-name": "cross", ...t }), l = ({ children: t, ...o }) => /* @__PURE__ */ e("div", { slot: "content", ...o, children: t }), i = ({ alt: t, ...o }) => /* @__PURE__ */ e("img", { alt: t ?? "", slot: "image", ...o });
|
|
5
|
+
n.Header = r;
|
|
6
|
+
n.CloseButton = s;
|
|
7
|
+
n.Content = l;
|
|
8
|
+
n.Img = i;
|
|
9
|
+
r.displayName = "Tooltip.Header";
|
|
10
|
+
s.displayName = "Tooltip.CloseButton";
|
|
11
|
+
l.displayName = "Tooltip.Content";
|
|
12
|
+
i.displayName = "Tooltip.Img";
|
|
22
13
|
export {
|
|
23
|
-
|
|
14
|
+
n as Tooltip
|
|
24
15
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './Accordion/Accordion';
|
|
2
|
+
export * from './Badge/Badge';
|
|
2
3
|
export * from './Bullets/Bullets';
|
|
3
4
|
export * from './Button/Button';
|
|
4
5
|
export * from './CarouselIndicator/CarouselIndicator';
|
|
@@ -18,6 +19,7 @@ export * from './Input/Input';
|
|
|
18
19
|
export * from './LinkButton/LinkButton';
|
|
19
20
|
export * from './Loader/Loader';
|
|
20
21
|
export * from './Logo/Logo';
|
|
22
|
+
export * from './MainTitle/MainTitle';
|
|
21
23
|
export * from './MapPin/MapPin';
|
|
22
24
|
export * from './Modal/Modal';
|
|
23
25
|
export * from './PasswordInput/PasswordInput';
|
|
@@ -25,6 +27,7 @@ export * from './PickerItem/PickerItem';
|
|
|
25
27
|
export * from './Radio/Radio';
|
|
26
28
|
export * from './RadioButton/RadioButton';
|
|
27
29
|
export * from './RadioButtonGroup/RadioButtonGroup';
|
|
30
|
+
export * from './Rating/Rating';
|
|
28
31
|
export * from './Search/Search';
|
|
29
32
|
export * from './SearchInput/SearchInput';
|
|
30
33
|
export * from './SecondaryNavigation/SecondaryNavigation';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { breakpoints as
|
|
1
|
+
import { breakpoints as a } from "@cupra/ui-kit/react/utils/breakpoints";
|
|
2
2
|
import { useState as m, useLayoutEffect as d } from "react";
|
|
3
|
-
const
|
|
3
|
+
const o = ["xs", "s", "m", "l", "xl", "xxl"];
|
|
4
4
|
function c() {
|
|
5
|
-
const
|
|
6
|
-
return
|
|
7
|
-
const r = `(min-width: ${
|
|
5
|
+
const n = {};
|
|
6
|
+
return o.forEach((s, t) => {
|
|
7
|
+
const r = `(min-width: ${a[s]}px)`;
|
|
8
8
|
let e = "";
|
|
9
|
-
if (t <
|
|
10
|
-
const i =
|
|
11
|
-
e = ` and (max-width: ${
|
|
9
|
+
if (t < o.length - 1) {
|
|
10
|
+
const i = o[t + 1];
|
|
11
|
+
e = ` and (max-width: ${a[i] - 1}px)`;
|
|
12
12
|
}
|
|
13
|
-
s
|
|
14
|
-
}),
|
|
13
|
+
n[s] = window.matchMedia(r + e);
|
|
14
|
+
}), n;
|
|
15
15
|
}
|
|
16
16
|
const p = () => {
|
|
17
|
-
const [
|
|
17
|
+
const [n, s] = m(() => {
|
|
18
18
|
const t = c();
|
|
19
19
|
let r = "";
|
|
20
20
|
return Object.keys(t).forEach((e) => {
|
|
@@ -24,7 +24,7 @@ const p = () => {
|
|
|
24
24
|
return d(() => {
|
|
25
25
|
const t = c(), r = Object.keys(t).map((e) => {
|
|
26
26
|
const i = (u) => {
|
|
27
|
-
u.matches &&
|
|
27
|
+
u.matches && s(e);
|
|
28
28
|
};
|
|
29
29
|
return t[e].addListener(i), () => {
|
|
30
30
|
t[e].removeListener(i);
|
|
@@ -35,7 +35,7 @@ const p = () => {
|
|
|
35
35
|
e();
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
}, []),
|
|
38
|
+
}, []), n;
|
|
39
39
|
};
|
|
40
40
|
export {
|
|
41
41
|
p as useBreakpoint
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useRef as f, useEffect as l } from "react";
|
|
2
|
+
function d(n) {
|
|
3
|
+
const t = f(null), e = f(n);
|
|
4
|
+
return l(() => {
|
|
5
|
+
e.current = n;
|
|
6
|
+
}, [n]), l(() => {
|
|
7
|
+
const c = t.current;
|
|
8
|
+
if (!c) return;
|
|
9
|
+
const o = {};
|
|
10
|
+
return Object.keys(e.current).forEach((r) => {
|
|
11
|
+
const u = (i) => {
|
|
12
|
+
const s = e.current[r];
|
|
13
|
+
s && s(i);
|
|
11
14
|
};
|
|
12
|
-
|
|
15
|
+
o[r] = u, c.addEventListener(r, u);
|
|
13
16
|
}), () => {
|
|
14
|
-
Object.keys(
|
|
15
|
-
|
|
16
|
-
(t = r == null ? void 0 : r.current) == null || t.removeEventListener(c, n[c]);
|
|
17
|
+
Object.keys(o).forEach((r) => {
|
|
18
|
+
c.removeEventListener(r, o[r]);
|
|
17
19
|
});
|
|
18
20
|
};
|
|
19
|
-
}, [
|
|
21
|
+
}, [t.current, e.current]), { ref: t };
|
|
20
22
|
}
|
|
21
23
|
export {
|
|
22
|
-
|
|
24
|
+
d as useHandleEvent
|
|
23
25
|
};
|