@cupra/ui-react 0.0.2-placeholder → 0.1.0-canary.0

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.
Files changed (130) hide show
  1. package/README.md +184 -18
  2. package/dist/components/Accordion/Accordion.d.ts +17 -0
  3. package/dist/components/Accordion/Accordion.js +8 -0
  4. package/dist/components/Avatar/Avatar.d.ts +9 -0
  5. package/dist/components/Avatar/Avatar.js +11 -0
  6. package/dist/components/Bullets/Bullets.d.ts +7 -0
  7. package/dist/components/Bullets/Bullets.js +6 -0
  8. package/dist/components/Button/Button.d.ts +10 -0
  9. package/dist/components/Button/Button.js +11 -0
  10. package/dist/components/CarouselIndicator/CarouselIndicator.d.ts +8 -0
  11. package/dist/components/CarouselIndicator/CarouselIndicator.js +9 -0
  12. package/dist/components/Checkbox/Checkbox.d.ts +9 -0
  13. package/dist/components/Checkbox/Checkbox.js +11 -0
  14. package/dist/components/Chip/Chip.d.ts +9 -0
  15. package/dist/components/Chip/Chip.js +9 -0
  16. package/dist/components/Chips/Chips.d.ts +10 -0
  17. package/dist/components/Chips/Chips.js +13 -0
  18. package/dist/components/Currency/Currency.d.ts +8 -0
  19. package/dist/components/Currency/Currency.js +9 -0
  20. package/dist/components/Dialog/Dialog.d.ts +11 -0
  21. package/dist/components/Dialog/Dialog.js +15 -0
  22. package/dist/components/DialogBody/DialogBody.d.ts +9 -0
  23. package/dist/components/DialogBody/DialogBody.js +9 -0
  24. package/dist/components/DialogFooter/DialogFooter.d.ts +9 -0
  25. package/dist/components/DialogFooter/DialogFooter.js +9 -0
  26. package/dist/components/DialogHeader/DialogHeader.d.ts +9 -0
  27. package/dist/components/DialogHeader/DialogHeader.js +9 -0
  28. package/dist/components/Divider/Divider.d.ts +7 -0
  29. package/dist/components/Divider/Divider.js +8 -0
  30. package/dist/components/Hyperlink/Hyperlink.d.ts +8 -0
  31. package/dist/components/Hyperlink/Hyperlink.js +11 -0
  32. package/dist/components/Icon/Icon.d.ts +7 -0
  33. package/dist/components/Icon/Icon.js +9 -0
  34. package/dist/components/IconButton/IconButton.d.ts +9 -0
  35. package/dist/components/IconButton/IconButton.js +11 -0
  36. package/dist/components/Input/Input.d.ts +11 -0
  37. package/dist/components/Input/Input.js +14 -0
  38. package/dist/components/LinkButton/LinkButton.d.ts +9 -0
  39. package/dist/components/LinkButton/LinkButton.js +11 -0
  40. package/dist/components/Loader/Loader.d.ts +20 -0
  41. package/dist/components/Loader/Loader.js +24 -0
  42. package/dist/components/Logo/Logo.d.ts +8 -0
  43. package/dist/components/Logo/Logo.js +9 -0
  44. package/dist/components/MapPin/MapPin.d.ts +8 -0
  45. package/dist/components/MapPin/MapPin.js +11 -0
  46. package/dist/components/Modal/Modal.d.ts +26 -0
  47. package/dist/components/Modal/Modal.js +49 -0
  48. package/dist/components/PasswordInput/PasswordInput.d.ts +19 -0
  49. package/dist/components/PasswordInput/PasswordInput.js +42 -0
  50. package/dist/components/PickerItem/PickerItem.d.ts +10 -0
  51. package/dist/components/PickerItem/PickerItem.js +12 -0
  52. package/dist/components/Radio/Radio.d.ts +18 -0
  53. package/dist/components/Radio/Radio.js +14 -0
  54. package/dist/components/RadioButton/RadioButton.d.ts +10 -0
  55. package/dist/components/RadioButton/RadioButton.js +10 -0
  56. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +16 -0
  57. package/dist/components/RadioButtonGroup/RadioButtonGroup.js +10 -0
  58. package/dist/components/Search/Search.d.ts +9 -0
  59. package/dist/components/Search/Search.js +8 -0
  60. package/dist/components/SearchInput/SearchInput.d.ts +20 -0
  61. package/dist/components/SearchInput/SearchInput.js +46 -0
  62. package/dist/components/SecondaryNavigation/SecondaryNavigation.d.ts +18 -0
  63. package/dist/components/SecondaryNavigation/SecondaryNavigation.js +16 -0
  64. package/dist/components/SegmentedControl/SegmentedControl.d.ts +10 -0
  65. package/dist/components/SegmentedControl/SegmentedControl.js +11 -0
  66. package/dist/components/Select/Select.d.ts +9 -0
  67. package/dist/components/Select/Select.js +6 -0
  68. package/dist/components/Selection/Selection.d.ts +8 -0
  69. package/dist/components/Selection/Selection.js +9 -0
  70. package/dist/components/SidebarNavigation/SidebarNavigation.d.ts +25 -0
  71. package/dist/components/SidebarNavigation/SidebarNavigation.js +15 -0
  72. package/dist/components/Slider/Slider.d.ts +8 -0
  73. package/dist/components/Slider/Slider.js +9 -0
  74. package/dist/components/StaticBox/StaticBox.d.ts +9 -0
  75. package/dist/components/StaticBox/StaticBox.js +11 -0
  76. package/dist/components/Stepper/Stepper.d.ts +8 -0
  77. package/dist/components/Stepper/Stepper.js +6 -0
  78. package/dist/components/Tabs/Tabs.d.ts +22 -0
  79. package/dist/components/Tabs/Tabs.js +19 -0
  80. package/dist/components/Tag/Tag.d.ts +11 -0
  81. package/dist/components/Tag/Tag.js +11 -0
  82. package/dist/components/Text/Text.d.ts +9 -0
  83. package/dist/components/Text/Text.js +9 -0
  84. package/dist/components/TextInput/TextInput.d.ts +21 -0
  85. package/dist/components/TextInput/TextInput.js +44 -0
  86. package/dist/components/Textarea/Textarea.d.ts +20 -0
  87. package/dist/components/Textarea/Textarea.js +57 -0
  88. package/dist/components/ThemeProvider/ThemeProvider.d.ts +9 -0
  89. package/dist/components/ThemeProvider/ThemeProvider.js +6 -0
  90. package/dist/components/Toast/Toast.d.ts +11 -0
  91. package/dist/components/Toast/Toast.js +16 -0
  92. package/dist/components/ToastMessage/ToastMessage.d.ts +10 -0
  93. package/dist/components/ToastMessage/ToastMessage.js +13 -0
  94. package/dist/components/ToggleButton/ToggleButton.d.ts +8 -0
  95. package/dist/components/ToggleButton/ToggleButton.js +11 -0
  96. package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +17 -0
  97. package/dist/components/ToggleSwitch/ToggleSwitch.js +22 -0
  98. package/dist/components/Tooltip/Tooltip.d.ts +11 -0
  99. package/dist/components/Tooltip/Tooltip.js +24 -0
  100. package/dist/components/index.d.ts +50 -0
  101. package/dist/components/interactive-card/InteractiveCard.d.ts +34 -0
  102. package/dist/components/interactive-card/InteractiveCard.js +19 -0
  103. package/dist/hooks/index.d.ts +5 -0
  104. package/dist/hooks/useBreakpoint.d.ts +3 -0
  105. package/dist/hooks/useBreakpoint.js +42 -0
  106. package/dist/hooks/useEventListeners.d.ts +9 -0
  107. package/dist/hooks/useEventListeners.js +26 -0
  108. package/dist/hooks/useHandleEvent.d.ts +5 -0
  109. package/dist/hooks/useHandleEvent.js +23 -0
  110. package/dist/hooks/useLoadScript.d.ts +2 -0
  111. package/dist/hooks/useResizeObserver/useResizeObserver.d.ts +6 -0
  112. package/dist/hooks/useResizeObserver/useResizeObserver.js +14 -0
  113. package/dist/index.d.ts +2 -0
  114. package/dist/index.js +112 -0
  115. package/dist/node_modules/.pnpm/@emotion_is-prop-valid@1.2.2/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js +10 -0
  116. package/dist/node_modules/.pnpm/@emotion_memoize@0.8.1/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +9 -0
  117. package/dist/node_modules/.pnpm/@emotion_unitless@0.8.1/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +52 -0
  118. package/dist/node_modules/.pnpm/styled-components@6.1.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.esm.js +572 -0
  119. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Enum.js +12 -0
  120. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Middleware.js +49 -0
  121. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Parser.js +131 -0
  122. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Prefixer.js +187 -0
  123. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Serializer.js +27 -0
  124. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Tokenizer.js +147 -0
  125. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Utility.js +56 -0
  126. package/dist/node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.js +18 -0
  127. package/dist/packages/ui-kit/dist-react/index.js +9205 -0
  128. package/dist/packages/ui-kit/dist-react/utils/breakpoints.js +11 -0
  129. package/dist/packages/ui-kit/dist-react/utils/debounce.js +11 -0
  130. package/package.json +56 -28
@@ -0,0 +1,22 @@
1
+ import { type ReactElement } from 'react';
2
+ import '@cupra/ui-kit/react';
3
+ import { DsTabsAttrs } from '@cupra/ui-kit/react/types/ds-tabs';
4
+ type Children = JSX.Element | JSX.Element[] | string;
5
+ interface CustomParams {
6
+ selectedTab: number;
7
+ }
8
+ interface TabsProps extends DsTabsAttrs {
9
+ onChange?: (event: CustomEvent<CustomParams>) => void;
10
+ children: Children;
11
+ }
12
+ export declare function Tabs({ children, onChange, ...rest }: TabsProps): ReactElement;
13
+ export declare namespace Tabs {
14
+ var Tab: ({ children }: TabProps) => ReactElement;
15
+ var Panel: ({ children }: {
16
+ children: Children;
17
+ }) => ReactElement;
18
+ }
19
+ interface TabProps {
20
+ children: Children;
21
+ }
22
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useHandleEvent as i } from "../../hooks/useHandleEvent.js";
4
+ import "../../packages/ui-kit/dist-react/index.js";
5
+ function r({ children: t, onChange: e, ...o }) {
6
+ const { ref: a } = i({ change: e });
7
+ return /* @__PURE__ */ n("ds-tabs-react", { ref: a, ...o, children: t });
8
+ }
9
+ function l({ children: t }) {
10
+ return /* @__PURE__ */ n("div", { role: "tab", slot: "tab", children: t });
11
+ }
12
+ function s({ children: t }) {
13
+ return /* @__PURE__ */ n("div", { role: "tabpanel", slot: "panel", children: t });
14
+ }
15
+ r.Tab = l;
16
+ r.Panel = s;
17
+ export {
18
+ r as Tabs
19
+ };
@@ -0,0 +1,11 @@
1
+ import { type ReactElement } from 'react';
2
+ import '@cupra/ui-kit/react';
3
+ import { DsTagAttrs } from '@cupra/ui-kit/react/types/ds-tag';
4
+ type Children = JSX.Element | JSX.Element[] | string;
5
+ interface TabsProps extends DsTagAttrs {
6
+ onClickIcon?: (event: CustomEvent) => void;
7
+ children: Children;
8
+ className?: string;
9
+ }
10
+ export declare function Tag(props: Readonly<TabsProps>): ReactElement;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useHandleEvent as i } from "../../hooks/useHandleEvent.js";
4
+ import "../../packages/ui-kit/dist-react/index.js";
5
+ function f(o) {
6
+ const { children: r, onClickIcon: t, className: c, ...n } = o, { ref: e } = i({ clickicon: t });
7
+ return /* @__PURE__ */ s("ds-tag-react", { ref: e, class: c, ...n, children: r });
8
+ }
9
+ export {
10
+ f as Tag
11
+ };
@@ -0,0 +1,9 @@
1
+ import { DsTextAttrs } from '@cupra/ui-kit/react/types/ds-text';
2
+ import { type ReactElement } from 'react';
3
+ import '@cupra/ui-kit/react';
4
+ type TextProps = DsTextAttrs & {
5
+ className?: string;
6
+ children: JSX.Element | JSX.Element[] | string;
7
+ };
8
+ export declare function Text(props: TextProps): ReactElement;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import "../../packages/ui-kit/dist-react/index.js";
3
+ function a(t) {
4
+ const { className: r, children: e, ...o } = t;
5
+ return /* @__PURE__ */ s("ds-text-react", { class: r, ...o, children: e });
6
+ }
7
+ export {
8
+ a as Text
9
+ };
@@ -0,0 +1,21 @@
1
+ import { DsTextInputAttrs } from '@cupra/ui-kit/react/types/ds-text-input';
2
+ import { ChangeEvent, FormEvent, KeyboardEvent, type ReactElement } from 'react';
3
+ import '@cupra/ui-kit/react';
4
+ type TextInputProps = DsTextInputAttrs & {
5
+ type?: 'text' | 'email' | 'number' | 'url' | 'tel';
6
+ className?: string;
7
+ onInput?: (event: FormEvent<HTMLInputElement>) => void;
8
+ onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
9
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
10
+ inputId: string;
11
+ placeHolder?: string;
12
+ value?: string;
13
+ label: string;
14
+ required?: boolean;
15
+ disabled?: boolean;
16
+ minLength?: number;
17
+ maxLength?: number;
18
+ pattern?: string;
19
+ };
20
+ export declare function TextInput(props: TextInputProps): ReactElement;
21
+ export {};
@@ -0,0 +1,44 @@
1
+ import { jsxs as y, jsx as t } from "react/jsx-runtime";
2
+ import "../../packages/ui-kit/dist-react/index.js";
3
+ import "react";
4
+ import { useHandleEvent as b } from "../../hooks/useHandleEvent.js";
5
+ function L(n) {
6
+ const {
7
+ className: r,
8
+ children: I,
9
+ onChange: o,
10
+ onInput: l,
11
+ onKeyDown: p,
12
+ inputId: e,
13
+ placeHolder: i,
14
+ type: a,
15
+ value: d,
16
+ label: s,
17
+ required: c,
18
+ disabled: u,
19
+ pattern: h,
20
+ maxLength: m,
21
+ minLength: x,
22
+ ...f
23
+ } = n, { ref: g } = b({ change: o, input: l, keydown: p });
24
+ return /* @__PURE__ */ y("ds-text-input-react", { ref: g, class: r, ...f, children: [
25
+ /* @__PURE__ */ t("label", { htmlFor: e, children: s }),
26
+ /* @__PURE__ */ t(
27
+ "input",
28
+ {
29
+ id: e,
30
+ type: a || "text",
31
+ placeholder: i,
32
+ value: d,
33
+ required: c,
34
+ disabled: u,
35
+ minLength: x,
36
+ maxLength: m,
37
+ pattern: h
38
+ }
39
+ )
40
+ ] });
41
+ }
42
+ export {
43
+ L as TextInput
44
+ };
@@ -0,0 +1,20 @@
1
+ import { DsTextareaAttrs } from '@cupra/ui-kit/react/types/ds-textarea';
2
+ import { type ReactElement } from 'react';
3
+ import '@cupra/ui-kit/react';
4
+ type TextareaProps = DsTextareaAttrs & {
5
+ className?: string;
6
+ onChange?: (event: typeof InputEvent) => void;
7
+ onInput?: (event: typeof InputEvent) => void;
8
+ textareaId: string;
9
+ placeholder?: string;
10
+ value?: string;
11
+ label: string;
12
+ required?: boolean;
13
+ disabled?: boolean;
14
+ minLength?: number;
15
+ maxLength?: number;
16
+ rows?: number;
17
+ cols?: number;
18
+ };
19
+ export declare function Textarea(props: TextareaProps): ReactElement;
20
+ export {};
@@ -0,0 +1,57 @@
1
+ import { jsxs as E, jsx as r } from "react/jsx-runtime";
2
+ import "../../packages/ui-kit/dist-react/index.js";
3
+ import "react";
4
+ import { useHandleEvent as j } from "../../hooks/useHandleEvent.js";
5
+ function C(t) {
6
+ const {
7
+ className: o,
8
+ children: I,
9
+ onChange: a,
10
+ onInput: n,
11
+ textareaId: e,
12
+ placeholder: l,
13
+ value: i,
14
+ label: d,
15
+ required: s,
16
+ disabled: c,
17
+ minLength: h,
18
+ maxLength: p,
19
+ rows: m,
20
+ cols: x,
21
+ forcedError: u,
22
+ helperText: f,
23
+ invalidError: g,
24
+ ...v
25
+ } = t, { ref: b } = j({ change: a, input: n });
26
+ return /* @__PURE__ */ E(
27
+ "ds-textarea-react",
28
+ {
29
+ ref: b,
30
+ class: o,
31
+ "forced-error": u,
32
+ "helper-text": f,
33
+ "invalid-error": g,
34
+ ...v,
35
+ children: [
36
+ /* @__PURE__ */ r("label", { htmlFor: e, children: d }),
37
+ /* @__PURE__ */ r(
38
+ "textarea",
39
+ {
40
+ id: e,
41
+ placeholder: l,
42
+ value: i,
43
+ required: s,
44
+ disabled: c,
45
+ minLength: h,
46
+ maxLength: p,
47
+ rows: m,
48
+ cols: x
49
+ }
50
+ )
51
+ ]
52
+ }
53
+ );
54
+ }
55
+ export {
56
+ C as Textarea
57
+ };
@@ -0,0 +1,9 @@
1
+ import '@cupra/ui-kit/react';
2
+ import { DsThemeProviderAttrs } from '@cupra/ui-kit/react/types/ds-theme-provider';
3
+ import { type ReactElement } from 'react';
4
+ type Children = JSX.Element | JSX.Element[] | string;
5
+ interface ThemeProviderProps extends DsThemeProviderAttrs {
6
+ children: Children;
7
+ }
8
+ export declare const ThemeProvider: ({ children, ...restProps }: ThemeProviderProps) => ReactElement;
9
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "../../packages/ui-kit/dist-react/index.js";
3
+ const i = ({ children: r, ...e }) => /* @__PURE__ */ o("ds-theme-provider-react", { ...e, children: r });
4
+ export {
5
+ i as ThemeProvider
6
+ };
@@ -0,0 +1,11 @@
1
+ import type { DsToastAttrs, ToastOptions } from '@cupra/ui-kit/react/types/ds-toast';
2
+ import { type ReactNode } from 'react';
3
+ import '@cupra/ui-kit/react';
4
+ type ToastProps = DsToastAttrs & {
5
+ className?: string;
6
+ };
7
+ export declare function Toast(props: ToastProps): ReactNode;
8
+ export declare namespace Toast {
9
+ var add: (options: ToastOptions) => void;
10
+ }
11
+ export {};
@@ -0,0 +1,16 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import "../../packages/ui-kit/dist-react/index.js";
3
+ function e(t) {
4
+ const { className: o, ...s } = t;
5
+ return /* @__PURE__ */ a("ds-toast-react", { class: o, ...s });
6
+ }
7
+ e.add = (t) => {
8
+ window.dispatchEvent(
9
+ new CustomEvent("toast:add", {
10
+ detail: t
11
+ })
12
+ );
13
+ };
14
+ export {
15
+ e as Toast
16
+ };
@@ -0,0 +1,10 @@
1
+ import { DsToastMessageAttrs } from '@cupra/ui-kit/react/types/ds-toast-message';
2
+ import { type ReactNode } from 'react';
3
+ import '@cupra/ui-kit/react';
4
+ type ToastMessageProps = DsToastMessageAttrs & {
5
+ className?: string;
6
+ children?: ReactNode;
7
+ onClose?: (event: CustomEvent) => void;
8
+ };
9
+ export declare function ToastMessage(props: ToastMessageProps): ReactNode;
10
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import "../../packages/ui-kit/dist-react/index.js";
3
+ import "react";
4
+ import { useHandleEvent as n } from "../../hooks/useHandleEvent.js";
5
+ function f(o) {
6
+ const { className: s, children: e, onClose: t, ...r } = o, { ref: a } = n({
7
+ "toast:remove": t
8
+ });
9
+ return /* @__PURE__ */ m("ds-toast-message-react", { ref: a, class: s, ...r, children: e });
10
+ }
11
+ export {
12
+ f as ToastMessage
13
+ };
@@ -0,0 +1,8 @@
1
+ import { type ReactElement } from 'react';
2
+ import '@cupra/ui-kit/react';
3
+ import { type DsToggleButtonAttrs } from '@cupra/ui-kit/react/types/ds-toggle-button';
4
+ type ToggleButtonProps = DsToggleButtonAttrs & {
5
+ onChange?: (event: CustomEvent) => void;
6
+ };
7
+ export declare function ToggleButton({ onChange, ...rest }: ToggleButtonProps): ReactElement;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useHandleEvent as n } from "../../hooks/useHandleEvent.js";
4
+ import "../../packages/ui-kit/dist-react/index.js";
5
+ function u({ onChange: t, ...o }) {
6
+ const { ref: r } = n({ change: t });
7
+ return /* @__PURE__ */ e("ds-toggle-button-react", { ref: r, ...o });
8
+ }
9
+ export {
10
+ u as ToggleButton
11
+ };
@@ -0,0 +1,17 @@
1
+ import { type ChangeEvent, type ReactElement } from 'react';
2
+ import '@cupra/ui-kit/react';
3
+ import { DsToggleSwitchAttrs } from '@cupra/ui-kit/react/types/ds-toggle-switch';
4
+ type Children = JSX.Element | JSX.Element[] | string;
5
+ interface ToggleSwitchProps extends DsToggleSwitchAttrs {
6
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
7
+ }
8
+ export declare function ToggleSwitch({ label, onChange, ...rest }: ToggleSwitchProps): ReactElement;
9
+ export declare namespace ToggleSwitch {
10
+ var Off: ({ children }: {
11
+ children: Children;
12
+ }) => ReactElement;
13
+ var On: ({ children }: {
14
+ children: Children;
15
+ }) => ReactElement;
16
+ }
17
+ export {};
@@ -0,0 +1,22 @@
1
+ import { jsxs as f, jsx as t } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
4
+ import "../../packages/ui-kit/dist-react/index.js";
5
+ function r({ label: n, onChange: i, ...o }) {
6
+ const { ref: e } = c({ change: i });
7
+ return /* @__PURE__ */ f("ds-toggle-switch-react", { ref: e, ...o, children: [
8
+ n && /* @__PURE__ */ t("div", { slot: "label", children: n }),
9
+ o.children
10
+ ] });
11
+ }
12
+ function l({ children: n }) {
13
+ return /* @__PURE__ */ t("div", { slot: "off", children: n });
14
+ }
15
+ function s({ children: n }) {
16
+ return /* @__PURE__ */ t("div", { slot: "on", children: n });
17
+ }
18
+ r.Off = l;
19
+ r.On = s;
20
+ export {
21
+ r as ToggleSwitch
22
+ };
@@ -0,0 +1,11 @@
1
+ import { type ReactElement } from 'react';
2
+ import '@cupra/ui-kit/react';
3
+ import { DsTooltipAttrs } from '@cupra/ui-kit/react/types/ds-tooltip';
4
+ type Children = JSX.Element | JSX.Element[] | string;
5
+ interface TooltipProps extends DsTooltipAttrs {
6
+ children: Children;
7
+ onClickCancelButton?: (event: CustomEvent) => void;
8
+ onClickConfirmButton?: (event: CustomEvent) => void;
9
+ }
10
+ export declare function Tooltip({ children, onClickCancelButton, onClickConfirmButton, ...restProps }: TooltipProps): ReactElement;
11
+ export {};
@@ -0,0 +1,24 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
4
+ import p from "../../node_modules/.pnpm/styled-components@6.1.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.esm.js";
5
+ import "../../packages/ui-kit/dist-react/index.js";
6
+ const l = p.div`
7
+ display: flex;
8
+ align-items: center;
9
+ `;
10
+ function u({
11
+ children: o,
12
+ onClickCancelButton: r,
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
+ }
22
+ export {
23
+ u as Tooltip
24
+ };
@@ -0,0 +1,50 @@
1
+ export * from './Accordion/Accordion';
2
+ export * from './Bullets/Bullets';
3
+ export * from './Button/Button';
4
+ export * from './CarouselIndicator/CarouselIndicator';
5
+ export * from './Checkbox/Checkbox';
6
+ export * from './Chip/Chip';
7
+ export * from './Chips/Chips';
8
+ export * from './Currency/Currency';
9
+ export * from './Dialog/Dialog';
10
+ export * from './DialogBody/DialogBody';
11
+ export * from './DialogFooter/DialogFooter';
12
+ export * from './DialogHeader/DialogHeader';
13
+ export * from './Divider/Divider';
14
+ export * from './Hyperlink/Hyperlink';
15
+ export * from './Icon/Icon';
16
+ export * from './IconButton/IconButton';
17
+ export * from './Input/Input';
18
+ export * from './LinkButton/LinkButton';
19
+ export * from './Loader/Loader';
20
+ export * from './Logo/Logo';
21
+ export * from './MapPin/MapPin';
22
+ export * from './Modal/Modal';
23
+ export * from './PasswordInput/PasswordInput';
24
+ export * from './PickerItem/PickerItem';
25
+ export * from './Radio/Radio';
26
+ export * from './RadioButton/RadioButton';
27
+ export * from './RadioButtonGroup/RadioButtonGroup';
28
+ export * from './Search/Search';
29
+ export * from './SearchInput/SearchInput';
30
+ export * from './SecondaryNavigation/SecondaryNavigation';
31
+ export * from './SegmentedControl/SegmentedControl';
32
+ export * from './Select/Select';
33
+ export * from './Selection/Selection';
34
+ export * from './Slider/Slider';
35
+ export * from './Tabs/Tabs';
36
+ export * from './Tag/Tag';
37
+ export * from './Text/Text';
38
+ export * from './TextInput/TextInput';
39
+ export * from './Textarea/Textarea';
40
+ export * from './ThemeProvider/ThemeProvider';
41
+ export * from './ToggleButton/ToggleButton';
42
+ export * from './ToggleSwitch/ToggleSwitch';
43
+ export * from './Tooltip/Tooltip';
44
+ export * from './Toast/Toast';
45
+ export * from './ToastMessage/ToastMessage';
46
+ export * from './Avatar/Avatar';
47
+ export * from './StaticBox/StaticBox';
48
+ export * from './Stepper/Stepper';
49
+ export * from './interactive-card/InteractiveCard';
50
+ export * from './SidebarNavigation/SidebarNavigation';
@@ -0,0 +1,34 @@
1
+ import type { ReactElement } from 'react';
2
+ import '@cupra/ui-kit/react';
3
+ import type { DsInteractiveCardAttrs } from '@cupra/ui-kit/react/types/ds-interactive-card';
4
+ type Children = JSX.Element | JSX.Element[] | string;
5
+ type InteractiveCardProps = DsInteractiveCardAttrs & {
6
+ className?: string;
7
+ children?: Children;
8
+ onClick?: (event: CustomEvent) => void;
9
+ };
10
+ export declare function InteractiveCard(props: InteractiveCardProps): ReactElement;
11
+ export declare namespace InteractiveCard {
12
+ var Title: ({ children }: {
13
+ children: Children;
14
+ }) => ReactElement;
15
+ var Subtitle: ({ children }: {
16
+ children: Children;
17
+ }) => ReactElement;
18
+ var Meta: ({ children }: {
19
+ children: Children;
20
+ }) => ReactElement;
21
+ var Content: ({ children }: {
22
+ children: Children;
23
+ }) => ReactElement;
24
+ var Cta: ({ children }: {
25
+ children: Children;
26
+ }) => ReactElement;
27
+ var ErrorTitle: ({ children }: {
28
+ children: Children;
29
+ }) => ReactElement;
30
+ var ErrorText: ({ children }: {
31
+ children: Children;
32
+ }) => ReactElement;
33
+ }
34
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useHandleEvent as l } from "../../hooks/useHandleEvent.js";
4
+ import "../../packages/ui-kit/dist-react/index.js";
5
+ function e(t) {
6
+ const { className: o, children: n, onClick: i, ...s } = t, { ref: c } = l({ click: i });
7
+ return /* @__PURE__ */ r("ds-interactive-card-react", { ref: c, class: o, ...s, children: n });
8
+ }
9
+ const a = ({ children: t }) => /* @__PURE__ */ r("div", { slot: "title", children: t }), u = ({ children: t }) => /* @__PURE__ */ r("div", { slot: "subtitle", children: t }), d = ({ children: t }) => /* @__PURE__ */ r("div", { slot: "meta", children: t }), v = ({ children: t }) => /* @__PURE__ */ r("div", { slot: "content", children: t }), m = ({ children: t }) => /* @__PURE__ */ r("div", { slot: "cta", children: t }), p = ({ children: t }) => /* @__PURE__ */ r("div", { slot: "error-title", children: t }), C = ({ children: t }) => /* @__PURE__ */ r("div", { slot: "error-text", children: t });
10
+ e.Title = a;
11
+ e.Subtitle = u;
12
+ e.Meta = d;
13
+ e.Content = v;
14
+ e.Cta = m;
15
+ e.ErrorTitle = p;
16
+ e.ErrorText = C;
17
+ export {
18
+ e as InteractiveCard
19
+ };
@@ -0,0 +1,5 @@
1
+ export * from './useBreakpoint';
2
+ export * from './useEventListeners';
3
+ export * from './useHandleEvent';
4
+ export * from './useLoadScript';
5
+ export * from './useResizeObserver/useResizeObserver';
@@ -0,0 +1,3 @@
1
+ type Breakpoint = 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
2
+ export declare const useBreakpoint: () => Breakpoint | string;
3
+ export {};
@@ -0,0 +1,42 @@
1
+ import { breakpoints as o } from "../packages/ui-kit/dist-react/utils/breakpoints.js";
2
+ import { useState as m, useLayoutEffect as d } from "react";
3
+ const a = ["xs", "s", "m", "l", "xl", "xxl"];
4
+ function c() {
5
+ const s = {};
6
+ return a.forEach((n, t) => {
7
+ const r = `(min-width: ${o[n]}px)`;
8
+ let e = "";
9
+ if (t < a.length - 1) {
10
+ const i = a[t + 1];
11
+ e = ` and (max-width: ${o[i] - 1}px)`;
12
+ }
13
+ s[n] = window.matchMedia(r + e);
14
+ }), s;
15
+ }
16
+ const p = () => {
17
+ const [s, n] = m(() => {
18
+ const t = c();
19
+ let r = "";
20
+ return Object.keys(t).forEach((e) => {
21
+ t[e].matches && (r = e);
22
+ }), r;
23
+ });
24
+ return d(() => {
25
+ const t = c(), r = Object.keys(t).map((e) => {
26
+ const i = (u) => {
27
+ u.matches && n(e);
28
+ };
29
+ return t[e].addListener(i), () => {
30
+ t[e].removeListener(i);
31
+ };
32
+ });
33
+ return () => {
34
+ r.forEach((e) => {
35
+ e();
36
+ });
37
+ };
38
+ }, []), s;
39
+ };
40
+ export {
41
+ p as useBreakpoint
42
+ };
@@ -0,0 +1,9 @@
1
+ interface EventHandler {
2
+ eventName: string;
3
+ handler: (event: MouseEvent | TouchEvent) => void;
4
+ options?: AddEventListenerOptions;
5
+ dependencies?: any[];
6
+ target?: EventTarget;
7
+ }
8
+ export declare const useEventListeners: (eventHandlers: EventHandler[]) => void;
9
+ export {};
@@ -0,0 +1,26 @@
1
+ import { useEffect as p } from "react";
2
+ const E = (n) => {
3
+ p(
4
+ () => {
5
+ const e = [];
6
+ return n.forEach((t) => {
7
+ const { eventName: o, handler: a, options: r, target: s = document } = t, c = (i) => {
8
+ a(i);
9
+ };
10
+ s.addEventListener(o, c, r);
11
+ const u = () => {
12
+ s.removeEventListener(o, c, r);
13
+ };
14
+ e.push(u);
15
+ }), () => {
16
+ e.forEach((t) => {
17
+ t();
18
+ });
19
+ };
20
+ },
21
+ n.flatMap(({ dependencies: e }) => e ?? [])
22
+ );
23
+ };
24
+ export {
25
+ E as useEventListeners
26
+ };
@@ -0,0 +1,5 @@
1
+ type UseHandleEventProps = Record<string, any>;
2
+ export declare function useHandleEvent(eventsMap: UseHandleEventProps): {
3
+ ref: any;
4
+ };
5
+ export {};
@@ -0,0 +1,23 @@
1
+ import { useRef as d, useEffect as f } from "react";
2
+ function s(o) {
3
+ const r = d(null);
4
+ return f(() => {
5
+ const n = {};
6
+ return Object.keys(o).forEach((c) => {
7
+ var l;
8
+ const t = (E) => {
9
+ var u;
10
+ (u = o[c]) == null || u.call(o, E);
11
+ };
12
+ n[c] = t, (l = r == null ? void 0 : r.current) == null || l.addEventListener(c, t);
13
+ }), () => {
14
+ Object.keys(n).forEach((c) => {
15
+ var t;
16
+ (t = r == null ? void 0 : r.current) == null || t.removeEventListener(c, n[c]);
17
+ });
18
+ };
19
+ }, [r, o]), { ref: r };
20
+ }
21
+ export {
22
+ s as useHandleEvent
23
+ };
@@ -0,0 +1,2 @@
1
+ declare const useLoadScript: (src: string) => (() => void);
2
+ export default useLoadScript;
@@ -0,0 +1,6 @@
1
+ interface UseResizeObserverFn {
2
+ callback: () => void;
3
+ element?: HTMLElement;
4
+ }
5
+ export declare function useResizeObserver(params: UseResizeObserverFn): void;
6
+ export {};