@cupra/ui-react 1.0.0-canary.24 → 1.0.0-canary.26

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 {};
@@ -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,31 @@
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;
9
- }
10
- export declare function Tooltip({ children, onClickCancelButton, onClickConfirmButton, ...restProps }: TooltipProps): ReactElement;
11
- export {};
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,25 +1,19 @@
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 e } from "react/jsx-runtime";
2
+ import a 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 m } from "../IconButton/IconButton.js";
5
+ const p = a.div`
8
6
  display: flex;
9
7
  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
- }
8
+ `, n = ({ children: t, ...o }) => /* @__PURE__ */ e("ds-tooltip-react", { ...o, children: /* @__PURE__ */ e(p, { children: t }) }), r = ({ children: t, ...o }) => /* @__PURE__ */ e("div", { slot: "header", ...o, children: t }), i = (t) => /* @__PURE__ */ e(m, { "icon-name": "cross", ...t }), s = ({ children: t, ...o }) => /* @__PURE__ */ e("div", { slot: "content", ...o, children: t }), l = ({ alt: t, ...o }) => /* @__PURE__ */ e("img", { alt: t ?? "", slot: "image", ...o });
9
+ n.Header = r;
10
+ n.CloseButton = i;
11
+ n.Content = s;
12
+ n.Img = l;
13
+ r.displayName = "Tooltip.Header";
14
+ i.displayName = "Tooltip.CloseButton";
15
+ s.displayName = "Tooltip.Content";
16
+ l.displayName = "Tooltip.Img";
23
17
  export {
24
- x as Tooltip
18
+ n as Tooltip
25
19
  };
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cupra/ui-react",
3
- "version": "1.0.0-canary.24",
3
+ "version": "1.0.0-canary.26",
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.14"
47
+ "@cupra/ui-kit": "1.0.0-canary.16"
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.14"
69
+ "@cupra/ui-kit": "1.0.0-canary.16"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "rm -rf dist && tsc --declaration --emitDeclarationOnly && vite build --emptyOutDir false",