@cupra/ui-react 1.0.0-canary.15 → 1.0.0-canary.17

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 (120) hide show
  1. package/README.md +9 -3
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Accordion/Accordion.js +8 -0
  4. package/dist/components/Avatar/Avatar.d.ts +1 -1
  5. package/dist/components/Avatar/Avatar.js +12 -0
  6. package/dist/components/Bullets/Bullets.d.ts +1 -1
  7. package/dist/components/Bullets/Bullets.js +6 -0
  8. package/dist/components/Button/Button.d.ts +1 -1
  9. package/dist/components/Button/Button.js +21 -0
  10. package/dist/components/CarouselIndicator/CarouselIndicator.d.ts +1 -1
  11. package/dist/components/CarouselIndicator/CarouselIndicator.js +9 -0
  12. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  13. package/dist/components/Checkbox/Checkbox.js +12 -0
  14. package/dist/components/Chip/Chip.d.ts +1 -1
  15. package/dist/components/Chip/Chip.js +9 -0
  16. package/dist/components/Chips/Chips.d.ts +1 -1
  17. package/dist/components/Chips/Chips.js +14 -0
  18. package/dist/components/Currency/Currency.d.ts +1 -1
  19. package/dist/components/Currency/Currency.js +9 -0
  20. package/dist/components/Dialog/Dialog.d.ts +1 -1
  21. package/dist/components/Dialog/Dialog.js +16 -0
  22. package/dist/components/DialogBody/DialogBody.d.ts +1 -1
  23. package/dist/components/DialogBody/DialogBody.js +9 -0
  24. package/dist/components/DialogFooter/DialogFooter.d.ts +1 -1
  25. package/dist/components/DialogFooter/DialogFooter.js +9 -0
  26. package/dist/components/DialogHeader/DialogHeader.d.ts +1 -1
  27. package/dist/components/DialogHeader/DialogHeader.js +9 -0
  28. package/dist/components/Divider/Divider.d.ts +1 -1
  29. package/dist/components/Divider/Divider.js +8 -0
  30. package/dist/components/Hyperlink/Hyperlink.d.ts +1 -1
  31. package/dist/components/Hyperlink/Hyperlink.js +12 -0
  32. package/dist/components/Icon/Icon.d.ts +1 -1
  33. package/dist/components/Icon/Icon.js +9 -0
  34. package/dist/components/IconButton/IconButton.d.ts +1 -1
  35. package/dist/components/IconButton/IconButton.js +20 -0
  36. package/dist/components/Input/Input.d.ts +1 -1
  37. package/dist/components/Input/Input.js +14 -0
  38. package/dist/components/InteractiveCard/InteractiveCard.d.ts +1 -1
  39. package/dist/components/InteractiveCard/InteractiveCard.js +27 -0
  40. package/dist/components/LinkButton/LinkButton.d.ts +1 -1
  41. package/dist/components/LinkButton/LinkButton.js +12 -0
  42. package/dist/components/Loader/Loader.d.ts +4 -1
  43. package/dist/components/Loader/Loader.js +27 -0
  44. package/dist/components/Logo/Logo.d.ts +1 -1
  45. package/dist/components/Logo/Logo.js +9 -0
  46. package/dist/components/MapPin/MapPin.d.ts +1 -1
  47. package/dist/components/MapPin/MapPin.js +12 -0
  48. package/dist/components/Modal/Modal.d.ts +1 -1
  49. package/dist/components/Modal/Modal.js +50 -0
  50. package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
  51. package/dist/components/PasswordInput/PasswordInput.js +40 -0
  52. package/dist/components/PickerItem/PickerItem.d.ts +1 -1
  53. package/dist/components/PickerItem/PickerItem.js +21 -0
  54. package/dist/components/Radio/Radio.d.ts +1 -1
  55. package/dist/components/Radio/Radio.js +15 -0
  56. package/dist/components/RadioButton/RadioButton.d.ts +1 -1
  57. package/dist/components/RadioButton/RadioButton.js +10 -0
  58. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
  59. package/dist/components/RadioButtonGroup/RadioButtonGroup.js +10 -0
  60. package/dist/components/Search/Search.d.ts +1 -1
  61. package/dist/components/Search/Search.js +8 -0
  62. package/dist/components/SearchInput/SearchInput.d.ts +1 -1
  63. package/dist/components/SearchInput/SearchInput.js +47 -0
  64. package/dist/components/SecondaryNavigation/SecondaryNavigation.d.ts +1 -1
  65. package/dist/components/SecondaryNavigation/SecondaryNavigation.js +17 -0
  66. package/dist/components/SegmentedControl/SegmentedControl.d.ts +1 -1
  67. package/dist/components/SegmentedControl/SegmentedControl.js +12 -0
  68. package/dist/components/Select/Select.d.ts +1 -1
  69. package/dist/components/Select/Select.js +6 -0
  70. package/dist/components/Selection/Selection.d.ts +1 -1
  71. package/dist/components/Selection/Selection.js +9 -0
  72. package/dist/components/SidebarNavigation/SidebarNavigation.d.ts +1 -1
  73. package/dist/components/SidebarNavigation/SidebarNavigation.js +15 -0
  74. package/dist/components/Slider/Slider.d.ts +2 -2
  75. package/dist/components/Slider/Slider.js +16 -0
  76. package/dist/components/StaticBox/StaticBox.d.ts +1 -1
  77. package/dist/components/StaticBox/StaticBox.js +21 -0
  78. package/dist/components/Stepper/Stepper.d.ts +1 -1
  79. package/dist/components/Stepper/Stepper.js +6 -0
  80. package/dist/components/Tabs/Tabs.d.ts +1 -1
  81. package/dist/components/Tabs/Tabs.js +20 -0
  82. package/dist/components/Tag/Tag.d.ts +1 -1
  83. package/dist/components/Tag/Tag.js +12 -0
  84. package/dist/components/Text/Text.d.ts +1 -1
  85. package/dist/components/Text/Text.js +9 -0
  86. package/dist/components/TextInput/TextInput.d.ts +1 -1
  87. package/dist/components/TextInput/TextInput.js +45 -0
  88. package/dist/components/Textarea/Textarea.d.ts +1 -1
  89. package/dist/components/Textarea/Textarea.js +58 -0
  90. package/dist/components/ThemeProvider/ThemeProvider.d.ts +1 -1
  91. package/dist/components/ThemeProvider/ThemeProvider.js +6 -0
  92. package/dist/components/Toast/Toast.d.ts +1 -1
  93. package/dist/components/Toast/Toast.js +16 -0
  94. package/dist/components/ToastMessage/ToastMessage.d.ts +1 -1
  95. package/dist/components/ToastMessage/ToastMessage.js +14 -0
  96. package/dist/components/ToggleButton/ToggleButton.d.ts +1 -1
  97. package/dist/components/ToggleButton/ToggleButton.js +12 -0
  98. package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +1 -1
  99. package/dist/components/ToggleSwitch/ToggleSwitch.js +23 -0
  100. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  101. package/dist/components/Tooltip/Tooltip.js +25 -0
  102. package/dist/hooks/useBreakpoint.js +42 -0
  103. package/dist/hooks/useEventListeners.js +26 -0
  104. package/dist/hooks/useHandleEvent.js +25 -0
  105. package/dist/hooks/useResizeObserver/useResizeObserver.js +14 -0
  106. package/dist/index.d.ts +0 -2
  107. package/dist/index.js +112 -3309
  108. 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
  109. package/dist/node_modules/.pnpm/@emotion_memoize@0.8.1/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +9 -0
  110. package/dist/node_modules/.pnpm/@emotion_unitless@0.8.1/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +52 -0
  111. 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
  112. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Enum.js +12 -0
  113. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Middleware.js +49 -0
  114. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Parser.js +131 -0
  115. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Prefixer.js +187 -0
  116. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Serializer.js +27 -0
  117. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Tokenizer.js +147 -0
  118. package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Utility.js +56 -0
  119. package/dist/node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.js +18 -0
  120. package/package.json +17 -5
@@ -0,0 +1,14 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import "@cupra/ui-kit/react/ds-toast-message";
3
+ import "@cupra/ui-kit/react/utils/breakpoints";
4
+ import "react";
5
+ import { useHandleEvent as n } from "../../hooks/useHandleEvent.js";
6
+ function d(o) {
7
+ const { className: s, children: t, onClose: e, ...r } = o, { ref: a } = n({
8
+ "toast:remove": e
9
+ });
10
+ return /* @__PURE__ */ m("ds-toast-message-react", { ref: a, class: s, ...r, children: t });
11
+ }
12
+ export {
13
+ d as ToastMessage
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;
@@ -0,0 +1,12 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import "@cupra/ui-kit/react/utils/breakpoints";
3
+ import "react";
4
+ import { useHandleEvent as n } from "../../hooks/useHandleEvent.js";
5
+ import "@cupra/ui-kit/react/ds-toggle-button";
6
+ function c({ onChange: t, ...o }) {
7
+ const { ref: r } = n({ change: t });
8
+ return /* @__PURE__ */ e("ds-toggle-button-react", { ref: r, ...o });
9
+ }
10
+ export {
11
+ c as ToggleButton
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 {
@@ -0,0 +1,23 @@
1
+ import { jsxs as f, jsx as n } from "react/jsx-runtime";
2
+ import "@cupra/ui-kit/react/utils/breakpoints";
3
+ import "react";
4
+ import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
5
+ import "@cupra/ui-kit/react/ds-toggle-switch";
6
+ function r({ label: t, onChange: i, ...o }) {
7
+ const { ref: e } = c({ change: i });
8
+ return /* @__PURE__ */ f("ds-toggle-switch-react", { ref: e, ...o, children: [
9
+ t && /* @__PURE__ */ n("div", { slot: "label", children: t }),
10
+ o.children
11
+ ] });
12
+ }
13
+ function l({ children: t }) {
14
+ return /* @__PURE__ */ n("div", { slot: "off", children: t });
15
+ }
16
+ function s({ children: t }) {
17
+ return /* @__PURE__ */ n("div", { slot: "on", children: t });
18
+ }
19
+ r.Off = l;
20
+ r.On = s;
21
+ export {
22
+ r as ToggleSwitch
23
+ };
@@ -1,5 +1,5 @@
1
1
  import { type ReactElement } from 'react';
2
- import '@cupra/ui-kit/react';
2
+ import '@cupra/ui-kit/react/ds-tooltip';
3
3
  import { DsTooltipAttrs } from '@cupra/ui-kit/react/types/ds-tooltip';
4
4
  type Children = JSX.Element | JSX.Element[] | string;
5
5
  interface TooltipProps extends DsTooltipAttrs {
@@ -0,0 +1,25 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import "@cupra/ui-kit/react/utils/breakpoints";
3
+ import "react";
4
+ import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
5
+ 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";
6
+ import "@cupra/ui-kit/react/ds-tooltip";
7
+ const m = p.div`
8
+ display: flex;
9
+ align-items: center;
10
+ `;
11
+ function x({
12
+ children: o,
13
+ onClickCancelButton: r,
14
+ onClickConfirmButton: i,
15
+ ...e
16
+ }) {
17
+ const { ref: n } = c({
18
+ "click-cancel-button": r,
19
+ "click-confirm-button": i
20
+ });
21
+ return /* @__PURE__ */ t("ds-tooltip-react", { ref: n, ...e, children: /* @__PURE__ */ t(m, { children: o }) });
22
+ }
23
+ export {
24
+ x as Tooltip
25
+ };
@@ -0,0 +1,42 @@
1
+ import { breakpoints as a } from "@cupra/ui-kit/react/utils/breakpoints";
2
+ import { useState as m, useLayoutEffect as d } from "react";
3
+ const o = ["xs", "s", "m", "l", "xl", "xxl"];
4
+ function c() {
5
+ const n = {};
6
+ return o.forEach((s, t) => {
7
+ const r = `(min-width: ${a[s]}px)`;
8
+ let e = "";
9
+ if (t < o.length - 1) {
10
+ const i = o[t + 1];
11
+ e = ` and (max-width: ${a[i] - 1}px)`;
12
+ }
13
+ n[s] = window.matchMedia(r + e);
14
+ }), n;
15
+ }
16
+ const p = () => {
17
+ const [n, s] = 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 && s(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
+ }, []), n;
39
+ };
40
+ export {
41
+ p as useBreakpoint
42
+ };
@@ -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,25 @@
1
+ import { useRef as u, useEffect as l } from "react";
2
+ function d(e) {
3
+ const o = u(null), n = u(e);
4
+ return l(() => {
5
+ n.current = e;
6
+ }, [e]), l(() => {
7
+ const t = o.current;
8
+ if (!t) return;
9
+ const c = {};
10
+ return Object.keys(n.current).forEach((r) => {
11
+ const s = (i) => {
12
+ const f = n.current[r];
13
+ f && f(i);
14
+ };
15
+ c[r] = s, t.addEventListener(r, s);
16
+ }), () => {
17
+ Object.keys(c).forEach((r) => {
18
+ t.removeEventListener(r, c[r]);
19
+ });
20
+ };
21
+ }, []), { ref: o };
22
+ }
23
+ export {
24
+ d as useHandleEvent
25
+ };
@@ -0,0 +1,14 @@
1
+ import { useEffect as s } from "react";
2
+ function o(t) {
3
+ const { callback: r, element: n } = t;
4
+ s(() => {
5
+ if (!n) return;
6
+ const e = new ResizeObserver(r);
7
+ return e.observe(n), () => {
8
+ e == null || e.disconnect();
9
+ };
10
+ }, [n, r]);
11
+ }
12
+ export {
13
+ o as useResizeObserver
14
+ };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,2 @@
1
1
  export * from './components';
2
2
  export * from './hooks';
3
- export declare const CupraUiReact: Record<string, any>;
4
- export default CupraUiReact;