@cupra/ui-react 1.0.0-canary.23 → 1.0.0-canary.25

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.
@@ -1,9 +1,8 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import '@cupra/ui-kit/react/ds-icon-button';
3
3
  import { type DsIconButtonAttrs } from '@cupra/ui-kit/react/types/ds-icon-button';
4
- type IconButtonProps = DsIconButtonAttrs & {
4
+ export type IconButtonProps = DsIconButtonAttrs & {
5
5
  className?: string;
6
6
  onClick?: (event: CustomEvent) => void;
7
7
  };
8
8
  export declare function IconButton(props: IconButtonProps): ReactElement;
9
- export {};
@@ -0,0 +1,8 @@
1
+ import type { ReactElement } from 'react';
2
+ import '@cupra/ui-kit/react/ds-rating';
3
+ import type { DsRatingAttrs } from '@cupra/ui-kit/react/types/ds-rating';
4
+ type RatingProps = DsRatingAttrs & {
5
+ className?: string;
6
+ };
7
+ export declare function Rating(props: RatingProps): ReactElement;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import "@cupra/ui-kit/react/ds-rating";
3
+ function c(r) {
4
+ const { className: t, ...o } = r;
5
+ return /* @__PURE__ */ s("ds-rating-react", { class: t, ...o });
6
+ }
7
+ export {
8
+ c as Rating
9
+ };
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ type Story = StoryObj;
5
+ export declare const Default: Story;
6
+ export declare const FullFive: Story;
7
+ export declare const RoundDownExample: Story;
8
+ export declare const HalfStarExample: Story;
9
+ export declare const NoRatingText: Story;
10
+ export declare const Disabled: Story;
@@ -1,5 +1,5 @@
1
1
  import { DsSecondaryNavigationAttrs } from '@cupra/ui-kit/react/types/ds-secondary-navigation';
2
- import { type ReactElement, type ReactNode } from 'react';
2
+ import { type AnchorHTMLAttributes, type ReactElement, type ReactNode } from 'react';
3
3
  import '@cupra/ui-kit/react/ds-secondary-navigation';
4
4
  type SecondaryNavigationProps = DsSecondaryNavigationAttrs & {
5
5
  className?: string;
@@ -8,11 +8,12 @@ type SecondaryNavigationProps = DsSecondaryNavigationAttrs & {
8
8
  };
9
9
  export declare function SecondaryNavigation(props: SecondaryNavigationProps): ReactElement;
10
10
  export declare namespace SecondaryNavigation {
11
- var Items: ({ children }: {
12
- children: ReactNode;
13
- }) => ReactElement;
11
+ var Item: ({ children, ...rest }: ItemProps) => ReactElement;
14
12
  var Actions: ({ children }: {
15
13
  children: ReactNode;
16
14
  }) => ReactElement;
17
15
  }
16
+ type ItemProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
17
+ children: ReactNode;
18
+ };
18
19
  export {};
@@ -1,17 +1,17 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as n } from "react/jsx-runtime";
2
2
  import "@cupra/ui-kit/react/ds-secondary-navigation";
3
3
  import "@cupra/ui-kit/react/utils/breakpoints";
4
4
  import "react";
5
5
  import { useHandleEvent as a } from "../../hooks/useHandleEvent.js";
6
- function n(t) {
7
- const { className: s, children: e, onSelect: r, ...i } = t, { ref: c } = a({
8
- "ds-secondary-navigation:select": r
6
+ function e(t) {
7
+ const { className: o, children: r, onSelect: s, ...i } = t, { ref: c } = a({
8
+ "ds-secondary-navigation:select": s
9
9
  });
10
- return /* @__PURE__ */ o("ds-secondary-navigation-react", { ref: c, class: s, ...i, children: e });
10
+ return /* @__PURE__ */ n("ds-secondary-navigation-react", { ref: c, class: o, ...i, children: r });
11
11
  }
12
- const m = ({ children: t }) => /* @__PURE__ */ o("div", { slot: "items", children: t }), d = ({ children: t }) => /* @__PURE__ */ o("div", { slot: "actions", children: t });
13
- n.Items = m;
14
- n.Actions = d;
12
+ const m = ({ children: t, ...o }) => /* @__PURE__ */ n("a", { slot: "items", ...o, children: t }), d = ({ children: t }) => /* @__PURE__ */ n("div", { slot: "actions", children: t });
13
+ e.Item = m;
14
+ e.Actions = d;
15
15
  export {
16
- n as SecondaryNavigation
16
+ e as SecondaryNavigation
17
17
  };
@@ -1,11 +1,19 @@
1
- import { type ReactElement } from 'react';
1
+ import { type HTMLAttributes, type ImgHTMLAttributes, type ReactElement, type ReactNode } from 'react';
2
2
  import '@cupra/ui-kit/react/ds-tooltip';
3
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;
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 function Tooltip({ children, ...restProps }: TooltipProps): ReactElement;
10
+ export declare namespace Tooltip {
11
+ var Header: ({ children, ...props }: {
12
+ children?: ReactNode;
13
+ } & HTMLAttributes<HTMLDivElement>) => JSX.Element;
14
+ var CloseButton: (props: CloseButtonProps) => ReactElement;
15
+ var Content: ({ children, ...props }: {
16
+ children?: ReactNode;
17
+ } & HTMLAttributes<HTMLDivElement>) => JSX.Element;
18
+ var Img: (props: ImgHTMLAttributes<HTMLImageElement>) => ReactElement;
9
19
  }
10
- export declare function Tooltip({ children, onClickCancelButton, onClickConfirmButton, ...restProps }: TooltipProps): ReactElement;
11
- export {};
@@ -1,25 +1,30 @@
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";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import e 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
3
  import "@cupra/ui-kit/react/ds-tooltip";
7
- const m = p.div`
4
+ import { IconButton as i } from "../IconButton/IconButton.js";
5
+ const c = e.div`
8
6
  display: flex;
9
7
  align-items: center;
10
8
  `;
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 }) });
9
+ function r({ children: t, ...n }) {
10
+ return /* @__PURE__ */ o("ds-tooltip-react", { ...n, children: /* @__PURE__ */ o(c, { children: t }) });
22
11
  }
12
+ function m({ children: t, ...n }) {
13
+ return /* @__PURE__ */ o("div", { slot: "header", ...n, children: t });
14
+ }
15
+ function u(t) {
16
+ return /* @__PURE__ */ o(i, { "icon-name": "cross", ...t });
17
+ }
18
+ function s({ children: t, ...n }) {
19
+ return /* @__PURE__ */ o("div", { slot: "content", ...n, children: t });
20
+ }
21
+ function l(t) {
22
+ return /* @__PURE__ */ o("img", { slot: "image", ...t });
23
+ }
24
+ r.Header = m;
25
+ r.CloseButton = u;
26
+ r.Content = s;
27
+ r.Img = l;
23
28
  export {
24
- x as Tooltip
29
+ r as Tooltip
25
30
  };
@@ -0,0 +1,5 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ type Story = StoryObj;
5
+ export declare const Primary: Story;
@@ -25,6 +25,7 @@ export * from './PickerItem/PickerItem';
25
25
  export * from './Radio/Radio';
26
26
  export * from './RadioButton/RadioButton';
27
27
  export * from './RadioButtonGroup/RadioButtonGroup';
28
+ export * from './Rating/Rating';
28
29
  export * from './Search/Search';
29
30
  export * from './SearchInput/SearchInput';
30
31
  export * from './SecondaryNavigation/SecondaryNavigation';
package/dist/index.js CHANGED
@@ -10,8 +10,8 @@ import { Dialog as B } from "./components/Dialog/Dialog.js";
10
10
  import { DialogBody as I } from "./components/DialogBody/DialogBody.js";
11
11
  import { DialogFooter as C } from "./components/DialogFooter/DialogFooter.js";
12
12
  import { DialogHeader as k } from "./components/DialogHeader/DialogHeader.js";
13
- import { Divider as b } from "./components/Divider/Divider.js";
14
- import { Hyperlink as P } from "./components/Hyperlink/Hyperlink.js";
13
+ import { Divider as R } from "./components/Divider/Divider.js";
14
+ import { Hyperlink as y } from "./components/Hyperlink/Hyperlink.js";
15
15
  import { Icon as H } from "./components/Icon/Icon.js";
16
16
  import { IconButton as w } from "./components/IconButton/IconButton.js";
17
17
  import { Input as E } from "./components/Input/Input.js";
@@ -25,37 +25,38 @@ import { PickerItem as Y } from "./components/PickerItem/PickerItem.js";
25
25
  import { Radio as _ } from "./components/Radio/Radio.js";
26
26
  import { RadioButton as oo } from "./components/RadioButton/RadioButton.js";
27
27
  import { RadioButtonGroup as eo } from "./components/RadioButtonGroup/RadioButtonGroup.js";
28
- import { Search as po } from "./components/Search/Search.js";
29
- import { SearchInput as mo } from "./components/SearchInput/SearchInput.js";
30
- import { SecondaryNavigation as ao } from "./components/SecondaryNavigation/SecondaryNavigation.js";
31
- import { SegmentedControl as no } from "./components/SegmentedControl/SegmentedControl.js";
32
- import { Select as uo } from "./components/Select/Select.js";
33
- import { Selection as co } from "./components/Selection/Selection.js";
34
- import { Slider as So } from "./components/Slider/Slider.js";
35
- import { Tabs as Bo } from "./components/Tabs/Tabs.js";
36
- import { Tag as Io } from "./components/Tag/Tag.js";
37
- import { Text as Co } from "./components/Text/Text.js";
38
- import { TextInput as ko } from "./components/TextInput/TextInput.js";
39
- import { Textarea as bo } from "./components/Textarea/Textarea.js";
40
- import { ThemeProvider as Po } from "./components/ThemeProvider/ThemeProvider.js";
41
- import { ToggleButton as Ho } from "./components/ToggleButton/ToggleButton.js";
42
- import { ToggleSwitch as wo } from "./components/ToggleSwitch/ToggleSwitch.js";
43
- import { Tooltip as Eo } from "./components/Tooltip/Tooltip.js";
44
- import { Toast as zo } from "./components/Toast/Toast.js";
45
- import { ToastMessage as Go } from "./components/ToastMessage/ToastMessage.js";
46
- import { Avatar as jo } from "./components/Avatar/Avatar.js";
47
- import { StaticBox as Jo } from "./components/StaticBox/StaticBox.js";
48
- import { Stepper as Qo } from "./components/Stepper/Stepper.js";
49
- import { InteractiveCard as Vo } from "./components/InteractiveCard/InteractiveCard.js";
50
- import { SidebarNavigation as Xo } from "./components/SidebarNavigation/SidebarNavigation.js";
51
- import { useBreakpoint as Zo } from "./hooks/useBreakpoint.js";
52
- import { useEventListeners as $o } from "./hooks/useEventListeners.js";
53
- import { useHandleEvent as rr } from "./hooks/useHandleEvent.js";
28
+ import { Rating as po } from "./components/Rating/Rating.js";
29
+ import { Search as mo } from "./components/Search/Search.js";
30
+ import { SearchInput as ao } from "./components/SearchInput/SearchInput.js";
31
+ import { SecondaryNavigation as no } from "./components/SecondaryNavigation/SecondaryNavigation.js";
32
+ import { SegmentedControl as uo } from "./components/SegmentedControl/SegmentedControl.js";
33
+ import { Select as co } from "./components/Select/Select.js";
34
+ import { Selection as So } from "./components/Selection/Selection.js";
35
+ import { Slider as Bo } from "./components/Slider/Slider.js";
36
+ import { Tabs as Io } from "./components/Tabs/Tabs.js";
37
+ import { Tag as Co } from "./components/Tag/Tag.js";
38
+ import { Text as ko } from "./components/Text/Text.js";
39
+ import { TextInput as Ro } from "./components/TextInput/TextInput.js";
40
+ import { Textarea as yo } from "./components/Textarea/Textarea.js";
41
+ import { ThemeProvider as Ho } from "./components/ThemeProvider/ThemeProvider.js";
42
+ import { ToggleButton as wo } from "./components/ToggleButton/ToggleButton.js";
43
+ import { ToggleSwitch as Eo } from "./components/ToggleSwitch/ToggleSwitch.js";
44
+ import { Tooltip as zo } from "./components/Tooltip/Tooltip.js";
45
+ import { Toast as Go } from "./components/Toast/Toast.js";
46
+ import { ToastMessage as jo } from "./components/ToastMessage/ToastMessage.js";
47
+ import { Avatar as Jo } from "./components/Avatar/Avatar.js";
48
+ import { StaticBox as Qo } from "./components/StaticBox/StaticBox.js";
49
+ import { Stepper as Vo } from "./components/Stepper/Stepper.js";
50
+ import { InteractiveCard as Xo } from "./components/InteractiveCard/InteractiveCard.js";
51
+ import { SidebarNavigation as Zo } from "./components/SidebarNavigation/SidebarNavigation.js";
52
+ import { useBreakpoint as $o } from "./hooks/useBreakpoint.js";
53
+ import { useEventListeners as rr } from "./hooks/useEventListeners.js";
54
+ import { useHandleEvent as tr } from "./hooks/useHandleEvent.js";
54
55
  import "react";
55
- import { useResizeObserver as tr } from "./hooks/useResizeObserver/useResizeObserver.js";
56
+ import { useResizeObserver as xr } from "./hooks/useResizeObserver/useResizeObserver.js";
56
57
  export {
57
58
  t as Accordion,
58
- jo as Avatar,
59
+ Jo as Avatar,
59
60
  x as Bullets,
60
61
  f as Button,
61
62
  i as CarouselIndicator,
@@ -67,12 +68,12 @@ export {
67
68
  I as DialogBody,
68
69
  C as DialogFooter,
69
70
  k as DialogHeader,
70
- b as Divider,
71
- P as Hyperlink,
71
+ R as Divider,
72
+ y as Hyperlink,
72
73
  H as Icon,
73
74
  w as IconButton,
74
75
  E as Input,
75
- Vo as InteractiveCard,
76
+ Xo as InteractiveCard,
76
77
  z as LinkButton,
77
78
  G as Loader,
78
79
  O as LoaderLogo,
@@ -84,29 +85,30 @@ export {
84
85
  _ as Radio,
85
86
  oo as RadioButton,
86
87
  eo as RadioButtonGroup,
87
- po as Search,
88
- mo as SearchInput,
89
- ao as SecondaryNavigation,
90
- no as SegmentedControl,
91
- uo as Select,
92
- co as Selection,
93
- Xo as SidebarNavigation,
94
- So as Slider,
95
- Jo as StaticBox,
96
- Qo as Stepper,
97
- Bo as Tabs,
98
- Io as Tag,
99
- Co as Text,
100
- ko as TextInput,
101
- bo as Textarea,
102
- Po as ThemeProvider,
103
- zo as Toast,
104
- Go as ToastMessage,
105
- Ho as ToggleButton,
106
- wo as ToggleSwitch,
107
- Eo as Tooltip,
108
- Zo as useBreakpoint,
109
- $o as useEventListeners,
110
- rr as useHandleEvent,
111
- tr as useResizeObserver
88
+ po as Rating,
89
+ mo as Search,
90
+ ao as SearchInput,
91
+ no as SecondaryNavigation,
92
+ uo as SegmentedControl,
93
+ co as Select,
94
+ So as Selection,
95
+ Zo as SidebarNavigation,
96
+ Bo as Slider,
97
+ Qo as StaticBox,
98
+ Vo as Stepper,
99
+ Io as Tabs,
100
+ Co as Tag,
101
+ ko as Text,
102
+ Ro as TextInput,
103
+ yo as Textarea,
104
+ Ho as ThemeProvider,
105
+ Go as Toast,
106
+ jo as ToastMessage,
107
+ wo as ToggleButton,
108
+ Eo as ToggleSwitch,
109
+ zo as Tooltip,
110
+ $o as useBreakpoint,
111
+ rr as useEventListeners,
112
+ tr as useHandleEvent,
113
+ xr as useResizeObserver
112
114
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cupra/ui-react",
3
- "version": "1.0.0-canary.23",
3
+ "version": "1.0.0-canary.25",
4
4
  "description": "React components library",
5
5
  "author": "SEAT S.A.",
6
6
  "license": "SEAT S.A. Library EULA 1.0",
@@ -44,7 +44,7 @@
44
44
  "peerDependencies": {
45
45
  "react": ">= 18.3.1 < 20",
46
46
  "react-dom": ">= 18.3.1 < 20",
47
- "@cupra/ui-kit": "1.0.0-canary.13"
47
+ "@cupra/ui-kit": "1.0.0-canary.15"
48
48
  },
49
49
  "dependencies": {
50
50
  "styled-components": "^6.1.16"
@@ -66,7 +66,7 @@
66
66
  "storybook": "^8.6.14",
67
67
  "typescript": "^5.8.2",
68
68
  "vite": "^6.4.1",
69
- "@cupra/ui-kit": "1.0.0-canary.13"
69
+ "@cupra/ui-kit": "1.0.0-canary.15"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "rm -rf dist && tsc --declaration --emitDeclarationOnly && vite build --emptyOutDir false",