@cupra/ui-react 0.0.1-placeholder → 0.0.2-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.
- package/README.md +184 -18
- package/dist/components/Accordion/Accordion.d.ts +17 -0
- package/dist/components/Accordion/Accordion.js +8 -0
- package/dist/components/Avatar/Avatar.d.ts +9 -0
- package/dist/components/Avatar/Avatar.js +11 -0
- package/dist/components/Bullets/Bullets.d.ts +7 -0
- package/dist/components/Bullets/Bullets.js +6 -0
- package/dist/components/Button/Button.d.ts +10 -0
- package/dist/components/Button/Button.js +11 -0
- package/dist/components/CarouselIndicator/CarouselIndicator.d.ts +8 -0
- package/dist/components/CarouselIndicator/CarouselIndicator.js +9 -0
- package/dist/components/Checkbox/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox/Checkbox.js +11 -0
- package/dist/components/Chip/Chip.d.ts +9 -0
- package/dist/components/Chip/Chip.js +9 -0
- package/dist/components/Chips/Chips.d.ts +10 -0
- package/dist/components/Chips/Chips.js +13 -0
- package/dist/components/Currency/Currency.d.ts +8 -0
- package/dist/components/Currency/Currency.js +9 -0
- package/dist/components/Dialog/Dialog.d.ts +11 -0
- package/dist/components/Dialog/Dialog.js +15 -0
- package/dist/components/DialogBody/DialogBody.d.ts +9 -0
- package/dist/components/DialogBody/DialogBody.js +9 -0
- package/dist/components/DialogFooter/DialogFooter.d.ts +9 -0
- package/dist/components/DialogFooter/DialogFooter.js +9 -0
- package/dist/components/DialogHeader/DialogHeader.d.ts +9 -0
- package/dist/components/DialogHeader/DialogHeader.js +9 -0
- package/dist/components/Divider/Divider.d.ts +7 -0
- package/dist/components/Divider/Divider.js +8 -0
- package/dist/components/Hyperlink/Hyperlink.d.ts +8 -0
- package/dist/components/Hyperlink/Hyperlink.js +11 -0
- package/dist/components/Icon/Icon.d.ts +7 -0
- package/dist/components/Icon/Icon.js +9 -0
- package/dist/components/IconButton/IconButton.d.ts +9 -0
- package/dist/components/IconButton/IconButton.js +11 -0
- package/dist/components/Input/Input.d.ts +11 -0
- package/dist/components/Input/Input.js +14 -0
- package/dist/components/LinkButton/LinkButton.d.ts +9 -0
- package/dist/components/LinkButton/LinkButton.js +11 -0
- package/dist/components/Loader/Loader.d.ts +20 -0
- package/dist/components/Loader/Loader.js +24 -0
- package/dist/components/Logo/Logo.d.ts +8 -0
- package/dist/components/Logo/Logo.js +9 -0
- package/dist/components/MapPin/MapPin.d.ts +8 -0
- package/dist/components/MapPin/MapPin.js +11 -0
- package/dist/components/Modal/Modal.d.ts +26 -0
- package/dist/components/Modal/Modal.js +49 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +19 -0
- package/dist/components/PasswordInput/PasswordInput.js +42 -0
- package/dist/components/PickerItem/PickerItem.d.ts +10 -0
- package/dist/components/PickerItem/PickerItem.js +12 -0
- package/dist/components/Radio/Radio.d.ts +18 -0
- package/dist/components/Radio/Radio.js +14 -0
- package/dist/components/RadioButton/RadioButton.d.ts +10 -0
- package/dist/components/RadioButton/RadioButton.js +10 -0
- package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +16 -0
- package/dist/components/RadioButtonGroup/RadioButtonGroup.js +10 -0
- package/dist/components/Search/Search.d.ts +9 -0
- package/dist/components/Search/Search.js +8 -0
- package/dist/components/SearchInput/SearchInput.d.ts +20 -0
- package/dist/components/SearchInput/SearchInput.js +46 -0
- package/dist/components/SecondaryNavigation/SecondaryNavigation.d.ts +18 -0
- package/dist/components/SecondaryNavigation/SecondaryNavigation.js +16 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +10 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +11 -0
- package/dist/components/Select/Select.d.ts +9 -0
- package/dist/components/Select/Select.js +6 -0
- package/dist/components/Selection/Selection.d.ts +8 -0
- package/dist/components/Selection/Selection.js +9 -0
- package/dist/components/SidebarNavigation/SidebarNavigation.d.ts +25 -0
- package/dist/components/SidebarNavigation/SidebarNavigation.js +15 -0
- package/dist/components/Slider/Slider.d.ts +8 -0
- package/dist/components/Slider/Slider.js +9 -0
- package/dist/components/StaticBox/StaticBox.d.ts +9 -0
- package/dist/components/StaticBox/StaticBox.js +11 -0
- package/dist/components/Stepper/Stepper.d.ts +8 -0
- package/dist/components/Stepper/Stepper.js +6 -0
- package/dist/components/Tabs/Tabs.d.ts +22 -0
- package/dist/components/Tabs/Tabs.js +19 -0
- package/dist/components/Tag/Tag.d.ts +11 -0
- package/dist/components/Tag/Tag.js +11 -0
- package/dist/components/Text/Text.d.ts +9 -0
- package/dist/components/Text/Text.js +9 -0
- package/dist/components/TextInput/TextInput.d.ts +21 -0
- package/dist/components/TextInput/TextInput.js +44 -0
- package/dist/components/Textarea/Textarea.d.ts +20 -0
- package/dist/components/Textarea/Textarea.js +57 -0
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +9 -0
- package/dist/components/ThemeProvider/ThemeProvider.js +6 -0
- package/dist/components/Toast/Toast.d.ts +11 -0
- package/dist/components/Toast/Toast.js +16 -0
- package/dist/components/ToastMessage/ToastMessage.d.ts +10 -0
- package/dist/components/ToastMessage/ToastMessage.js +13 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +8 -0
- package/dist/components/ToggleButton/ToggleButton.js +11 -0
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +17 -0
- package/dist/components/ToggleSwitch/ToggleSwitch.js +22 -0
- package/dist/components/Tooltip/Tooltip.d.ts +11 -0
- package/dist/components/Tooltip/Tooltip.js +24 -0
- package/dist/components/index.d.ts +50 -0
- package/dist/components/interactive-card/InteractiveCard.d.ts +34 -0
- package/dist/components/interactive-card/InteractiveCard.js +19 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useBreakpoint.d.ts +3 -0
- package/dist/hooks/useBreakpoint.js +42 -0
- package/dist/hooks/useEventListeners.d.ts +9 -0
- package/dist/hooks/useEventListeners.js +26 -0
- package/dist/hooks/useHandleEvent.d.ts +5 -0
- package/dist/hooks/useHandleEvent.js +23 -0
- package/dist/hooks/useLoadScript.d.ts +2 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.d.ts +6 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.js +14 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +112 -0
- 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
- package/dist/node_modules/.pnpm/@emotion_memoize@0.8.1/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +9 -0
- package/dist/node_modules/.pnpm/@emotion_unitless@0.8.1/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +52 -0
- 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
- package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Enum.js +12 -0
- package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Middleware.js +49 -0
- package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Parser.js +131 -0
- package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Prefixer.js +187 -0
- package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Serializer.js +27 -0
- package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Tokenizer.js +147 -0
- package/dist/node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Utility.js +56 -0
- package/dist/node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.js +18 -0
- package/dist/packages/ui-kit/dist-react/index.js +9205 -0
- package/dist/packages/ui-kit/dist-react/utils/breakpoints.js +11 -0
- package/dist/packages/ui-kit/dist-react/utils/debounce.js +11 -0
- package/package.json +56 -28
package/README.md
CHANGED
|
@@ -1,27 +1,193 @@
|
|
|
1
|
-
#
|
|
1
|
+
# UI React (React Components)
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
|
-
|
|
5
|
-
It has been published to establish the package namespace and to support configuration processes within the continuous integration and release infrastructure.
|
|
4
|
+
React components and wrappers built on top of the DS-UI Web Components to provide a seamless React developer experience.
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
## Audience
|
|
7
|
+
React developers who want to use DS-UI components natively in React applications.
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
9
|
+
## Installation
|
|
10
|
+
- npm: `npm install @cupra/ui-react`
|
|
11
|
+
- pnpm: `pnpm add @cupra/ui-react`
|
|
12
|
+
- yarn: `yarn add @cupra/ui-react`
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
This release includes:
|
|
16
|
-
- `package.json` metadata
|
|
17
|
-
- `LICENSE.md`
|
|
18
|
-
- `README.md`
|
|
14
|
+
Access to the @cupra registry is required (see Requirements).
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
## Usage
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
<details><summary>View usage instructions</summary>
|
|
19
|
+
|
|
20
|
+
In React, the components can be imported from the `@cupra/ui-react` package. Each component has isolated styling and will not conflict with other versions of the library that may be loaded on the same page.
|
|
21
|
+
|
|
22
|
+
### Loading the CSS
|
|
23
|
+
|
|
24
|
+
You can load the CSS directly with a `<link>`, which is the most performant option. Specify the theme and version in the URL:
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<link rel='stylesheet' href='https://ds-assets.cupra.com/[version]/styles/[theme]/theme.css'>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- **[theme]**: Specify the theme name (e.g., `cupra`).
|
|
31
|
+
- **[version]**: Use the fixed version, such as `1.0`, `1.1.1`, etc.
|
|
32
|
+
|
|
33
|
+
Alternatively, you can use the `ThemeProvider` component to load the theme directly in your React application by setting the `theme` attribute. This approach eliminates the need to include a separate `<link>` tag for the stylesheet. However, from a performance perspective, using a `<link>` to load the CSS is generally more efficient.
|
|
34
|
+
|
|
35
|
+
Additionally, the `ThemeProvider` **is necessary** for the proper loading of **icons** and **fonts**.
|
|
36
|
+
|
|
37
|
+
Example:
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
import { Button, ThemeProvider, Icon, Modal, Tag, Input } from '@cupra/ui-react';
|
|
41
|
+
|
|
42
|
+
function App() {
|
|
43
|
+
const [count, setCount] = useState(0);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<ThemeProvider theme="cupra">
|
|
47
|
+
<Button variant="destructive" icon-name="filters-background">Click me!</Button>
|
|
48
|
+
<Icon icon-name="filters-background"></Icon>
|
|
49
|
+
</ThemeProvider>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
</details>
|
|
54
|
+
|
|
55
|
+
## Requirements
|
|
56
|
+
- Node.js per .nvmrc
|
|
57
|
+
- pnpm 9.4.0 or compatible
|
|
58
|
+
- Access to GitHub Packages for @cupra (configure .npmrc or .yarnrc.yml with your token)
|
|
59
|
+
|
|
60
|
+
## Versioning
|
|
61
|
+
This package follows semantic versioning. See repository releases for changes.
|
|
62
|
+
Note: @cupra/ui-react depends on @cupra/ui-kit.
|
|
24
63
|
|
|
25
64
|
## License
|
|
26
|
-
|
|
27
|
-
|
|
65
|
+
License: SEAT S.A. Library EULA 1.0
|
|
66
|
+
See LICENSE.md in this package for the full text. Third-party license attributions (if any) may be provided in THIRD_PARTY_LICENSES.md.
|
|
67
|
+
|
|
68
|
+
## Support
|
|
69
|
+
Please open issues in the repository issue tracker.
|
|
70
|
+
|
|
71
|
+
For contributing and monorepo details, see the root CONTRIBUTING.md.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Toast System
|
|
76
|
+
|
|
77
|
+
<details><summary>Toast</summary>
|
|
78
|
+
|
|
79
|
+
React exposes:
|
|
80
|
+
- **`<Toast />`** — container that renders toast messages.
|
|
81
|
+
- **`<ToastMessage />`** — reusable toast message template.
|
|
82
|
+
- **`Toast.add(options)`** — utility function to **add** a toast from anywhere in your app. Returns the `id` of the created toast.
|
|
83
|
+
|
|
84
|
+
> **Note:**
|
|
85
|
+
> The recommended behavior is to let toasts close automatically after `duration` or by user interaction.
|
|
86
|
+
> Programmatic removal should only be used when necessary.
|
|
87
|
+
|
|
88
|
+
### Basic Setup
|
|
89
|
+
|
|
90
|
+
```jsx
|
|
91
|
+
import { Toast } from '@cupra/ui-react';
|
|
92
|
+
|
|
93
|
+
export function AppRoot() {
|
|
94
|
+
return (
|
|
95
|
+
<>
|
|
96
|
+
{/* Place this once near the root of your app */}
|
|
97
|
+
<Toast position="top-right" />
|
|
98
|
+
{/* ...rest of your app */}
|
|
99
|
+
</>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Showing a Toast with `Toast.add`
|
|
105
|
+
|
|
106
|
+
```jsx
|
|
107
|
+
import { Toast } from '@cupra/ui-react';
|
|
108
|
+
|
|
109
|
+
function Example() {
|
|
110
|
+
const handleClick = () => {
|
|
111
|
+
Toast.add({
|
|
112
|
+
title: 'Success',
|
|
113
|
+
text: 'Operation completed successfully',
|
|
114
|
+
status: 'success',
|
|
115
|
+
duration: 5000, // Optional (ms). Default: 10000
|
|
116
|
+
// id: 'custom-id-optional', // Optional custom ID
|
|
117
|
+
// referenceId: 'my-template-id', // Optional template reference
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return <button onClick={handleClick}>Show toast</button>;
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Using Custom Templates with `<ToastMessage />`
|
|
126
|
+
|
|
127
|
+
```jsx
|
|
128
|
+
import { Toast, ToastMessage } from '@cupra/ui-react';
|
|
129
|
+
|
|
130
|
+
export function Templates() {
|
|
131
|
+
return (
|
|
132
|
+
<>
|
|
133
|
+
<Toast position="top-right" />
|
|
134
|
+
|
|
135
|
+
{/* Reusable template */}
|
|
136
|
+
<ToastMessage
|
|
137
|
+
data-id="custom-template"
|
|
138
|
+
title="Custom Toast"
|
|
139
|
+
text="You can put custom content here"
|
|
140
|
+
onClose={() => console.log('Template toast closed')}
|
|
141
|
+
>
|
|
142
|
+
<button>Action</button>
|
|
143
|
+
</ToastMessage>
|
|
144
|
+
</>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Trigger a toast using that template:
|
|
150
|
+
|
|
151
|
+
```jsx
|
|
152
|
+
Toast.add({ referenceId: 'custom-template', duration: 8000 });
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Removing a Toast (Optional)
|
|
156
|
+
|
|
157
|
+
It’s preferable to let toasts close automatically or via user interaction.
|
|
158
|
+
If you need to close one programmatically:
|
|
159
|
+
|
|
160
|
+
- By **`id`**: each toast has a unique ID (auto-generated unless provided manually).
|
|
161
|
+
- By **`referenceId`**: refers to a template; if several toasts share the same template ID, only one (the oldest) will be removed.
|
|
162
|
+
|
|
163
|
+
```javascript
|
|
164
|
+
// Remove by ID
|
|
165
|
+
window.dispatchEvent(new CustomEvent('toast:remove', { detail: { id: 'my-toast-id' } }));
|
|
166
|
+
|
|
167
|
+
// Remove by referenceId (template)
|
|
168
|
+
window.dispatchEvent(new CustomEvent('toast:remove', { detail: { referenceId: 'custom-template' } }));
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### API for `Toast.add(options)`
|
|
172
|
+
|
|
173
|
+
| Option | Type | Description |
|
|
174
|
+
|--------|------|-------------|
|
|
175
|
+
| **id** | `string` | Optional custom identifier. If not provided, a unique one is auto-generated. |
|
|
176
|
+
| **title** | `string` | Title text for the toast. |
|
|
177
|
+
| **text** | `string` | Body content of the toast. |
|
|
178
|
+
| **status** | `string` | One of `'success'`, `'error'`, `'warning'`, `'info'`, `'default'`. Controls the visual style. |
|
|
179
|
+
| **duration** | `number` | Time in milliseconds before auto-dismiss. Defaults to `10000`. |
|
|
180
|
+
| **referenceId** | `string` | ID of a `<ToastMessage />` template. If set, `title`, `text`, and `status` are ignored. |
|
|
181
|
+
|
|
182
|
+
### Component Props
|
|
183
|
+
|
|
184
|
+
**`<Toast />`**
|
|
185
|
+
- `position`: `'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'` (default: `'top-right'`).
|
|
186
|
+
|
|
187
|
+
**`<ToastMessage />`**
|
|
188
|
+
- `data-id`: template identifier.
|
|
189
|
+
- `data-template`: (default = `true`) marks it as a template.
|
|
190
|
+
- `title`, `text`, `status`: same meaning as in `Toast.add`.
|
|
191
|
+
- `onClose`: callback triggered when the toast closes (auto, user, or removal event).
|
|
192
|
+
|
|
193
|
+
</details>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DsAccordionAttrs } from '@cupra/ui-kit/react/types/ds-accordion';
|
|
2
|
+
import '@cupra/ui-kit/react';
|
|
3
|
+
import { type ReactElement } from 'react';
|
|
4
|
+
type Children = JSX.Element | JSX.Element[] | string;
|
|
5
|
+
interface AccordionProps extends DsAccordionAttrs {
|
|
6
|
+
children: Children;
|
|
7
|
+
}
|
|
8
|
+
export declare const Accordion: {
|
|
9
|
+
({ children, ...restProps }: AccordionProps): ReactElement;
|
|
10
|
+
Title: ({ children }: {
|
|
11
|
+
children: Children;
|
|
12
|
+
}) => ReactElement;
|
|
13
|
+
Content: ({ children }: {
|
|
14
|
+
children: Children;
|
|
15
|
+
}) => ReactElement;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
3
|
+
const n = ({ children: t, ...r }) => /* @__PURE__ */ o("ds-accordion-react", { ...r, children: t }), e = ({ children: t }) => /* @__PURE__ */ o("div", { slot: "title", children: t }), c = ({ children: t }) => /* @__PURE__ */ o("div", { slot: "content", children: t });
|
|
4
|
+
n.Title = e;
|
|
5
|
+
n.Content = c;
|
|
6
|
+
export {
|
|
7
|
+
n as Accordion
|
|
8
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import '@cupra/ui-kit/react';
|
|
3
|
+
import type { DsAvatarAttrs } from '@cupra/ui-kit/react/types/ds-avatar';
|
|
4
|
+
export type AvatarProps = DsAvatarAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
onClick?: (event: CustomEvent) => void;
|
|
7
|
+
image?: ReactNode | null;
|
|
8
|
+
};
|
|
9
|
+
export declare function Avatar(props: AvatarProps): ReactElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as i, cloneElement as m } from "react";
|
|
3
|
+
import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
|
|
4
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
5
|
+
function v(t) {
|
|
6
|
+
const { className: e, onClick: r, image: o, ...a } = t, { ref: l } = c({ click: r }), n = o && i(o) ? m(o, { slot: "media", ...o.props }) : null;
|
|
7
|
+
return /* @__PURE__ */ s("ds-avatar-react", { ref: l, class: e, ...a, children: n });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
v as Avatar
|
|
11
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DsBulletsAttrs } from '@cupra/ui-kit/react/types/ds-bullets';
|
|
2
|
+
import '@cupra/ui-kit/react';
|
|
3
|
+
import { type ReactElement } from 'react';
|
|
4
|
+
export interface BulletsProps extends DsBulletsAttrs {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Bullets: ({ className, ...rest }: BulletsProps) => ReactElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import '@cupra/ui-kit/react';
|
|
3
|
+
import type { DsButtonAttrs } from '@cupra/ui-kit/react/types/ds-button';
|
|
4
|
+
type ButtonProps = DsButtonAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
children: JSX.Element | JSX.Element[] | string;
|
|
7
|
+
onClick?: (event: CustomEvent) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function Button(props: ButtonProps): ReactElement;
|
|
10
|
+
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 u(t) {
|
|
6
|
+
const { className: o, children: r, onClick: n, ...c } = t, { ref: e } = i({ click: n });
|
|
7
|
+
return /* @__PURE__ */ s("ds-button-react", { ref: e, class: o, ...c, children: r });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
u as Button
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DsCarouselIndicatorAttrs } from '@cupra/ui-kit/react/types/ds-carousel-indicator';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import '@cupra/ui-kit/react';
|
|
4
|
+
type CarouselIndicatorProps = DsCarouselIndicatorAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function CarouselIndicator(props: CarouselIndicatorProps): ReactElement;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
3
|
+
function i(r) {
|
|
4
|
+
const { className: o, children: c, ...s } = r;
|
|
5
|
+
return /* @__PURE__ */ t("ds-carousel-indicator-react", { class: o, ...s });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
i as CarouselIndicator
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import '@cupra/ui-kit/react';
|
|
3
|
+
import { DsCheckboxAttrs } from '@cupra/ui-kit/react/types/ds-checkbox';
|
|
4
|
+
interface CheckboxProps extends DsCheckboxAttrs {
|
|
5
|
+
onChange?: (event: CustomEvent) => void;
|
|
6
|
+
children: JSX.Element | JSX.Element[] | string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Checkbox({ onChange, children, ...rest }: CheckboxProps): ReactElement;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as c } 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 s({ onChange: o, children: r, ...e }) {
|
|
6
|
+
const { ref: t } = n({ change: o });
|
|
7
|
+
return /* @__PURE__ */ c("ds-checkbox-react", { ref: t, ...e, children: r });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
s as Checkbox
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DsChipAttrs } from '@cupra/ui-kit/react/types/ds-chip';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import '@cupra/ui-kit/react';
|
|
4
|
+
type ChipProps = DsChipAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
children: JSX.Element | JSX.Element[] | string;
|
|
7
|
+
};
|
|
8
|
+
export declare function Chip(props: ChipProps): ReactElement;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
3
|
+
function p(r) {
|
|
4
|
+
const { className: o, children: s, ...t } = r;
|
|
5
|
+
return /* @__PURE__ */ c("ds-chip-react", { class: o, ...t, children: s });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
p as Chip
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DsChipsAttrs } from '@cupra/ui-kit/react/types/ds-chips';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import '@cupra/ui-kit/react';
|
|
4
|
+
type ChipsProps = DsChipsAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
children: JSX.Element | JSX.Element[] | string;
|
|
7
|
+
onChange?: (event: CustomEvent) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function Chips(props: ChipsProps): ReactElement;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { useHandleEvent as i } from "../../hooks/useHandleEvent.js";
|
|
5
|
+
function d(r) {
|
|
6
|
+
const { className: s, children: o, onChange: e, ...t } = r, { ref: n } = i({
|
|
7
|
+
"ds-chips:change": e
|
|
8
|
+
});
|
|
9
|
+
return /* @__PURE__ */ c("ds-chips-react", { ref: n, class: s, ...t, children: o });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
d as Chips
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import '@cupra/ui-kit/react';
|
|
3
|
+
import { DsCurrencyAttrs } from '@cupra/ui-kit/react/types/ds-currency';
|
|
4
|
+
type CurrencyProps = DsCurrencyAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function Currency(props: CurrencyProps): ReactElement;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DsDialogAttrs } from '@cupra/ui-kit/react/types/ds-dialog';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import '@cupra/ui-kit/react';
|
|
4
|
+
type DialogProps = DsDialogAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
withPortal?: boolean;
|
|
7
|
+
children: JSX.Element | JSX.Element[] | string;
|
|
8
|
+
onClose?: (event: CustomEvent) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function Dialog(props: DialogProps): ReactNode;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
|
|
5
|
+
function u(e) {
|
|
6
|
+
const { className: n, children: l, onClose: s, withPortal: i, ...o } = e, { ref: a } = c({
|
|
7
|
+
"ds-dialog:close": s
|
|
8
|
+
});
|
|
9
|
+
if (!o.open) return null;
|
|
10
|
+
const r = /* @__PURE__ */ t("ds-dialog-react", { ref: a, class: n, ...o, children: l });
|
|
11
|
+
return i ? /* @__PURE__ */ t("ds-portal-react", { style: { display: "none" }, children: r }) : r;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
u as Dialog
|
|
15
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DsDialogBodyAttrs } from '@cupra/ui-kit/react/types/ds-dialog-body';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import '@cupra/ui-kit/react';
|
|
4
|
+
type DialogBodyProps = DsDialogBodyAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: JSX.Element | JSX.Element[] | string;
|
|
7
|
+
};
|
|
8
|
+
export declare function DialogBody(props: DialogBodyProps): ReactElement;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
3
|
+
function i(o) {
|
|
4
|
+
const { className: r, children: s, ...t } = o;
|
|
5
|
+
return /* @__PURE__ */ a("ds-dialog-body-react", { class: r, ...t, children: s });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
i as DialogBody
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DsDialogFooterAttrs } from '@cupra/ui-kit/react/types/ds-dialog-footer';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import '@cupra/ui-kit/react';
|
|
4
|
+
type DialogFooterProps = DsDialogFooterAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: JSX.Element | JSX.Element[] | string;
|
|
7
|
+
};
|
|
8
|
+
export declare function DialogFooter(props: DialogFooterProps): 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 i(o) {
|
|
4
|
+
const { className: r, children: t, ...e } = o;
|
|
5
|
+
return /* @__PURE__ */ s("ds-dialog-footer-react", { class: r, ...e, children: t });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
i as DialogFooter
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DsDialogHeaderAttrs } from '@cupra/ui-kit/react/types/ds-dialog-header';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import '@cupra/ui-kit/react';
|
|
4
|
+
type DialogHeaderProps = DsDialogHeaderAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: JSX.Element | JSX.Element[] | string;
|
|
7
|
+
};
|
|
8
|
+
export declare function DialogHeader(props: DialogHeaderProps): 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 i(r) {
|
|
4
|
+
const { className: e, children: o, ...a } = r;
|
|
5
|
+
return /* @__PURE__ */ s("ds-dialog-header-react", { class: e, ...a, children: o });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
i as DialogHeader
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DsDividerAttrs } from '@cupra/ui-kit/react/types/ds-divider';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import '@cupra/ui-kit/react';
|
|
4
|
+
export interface DividerProps extends DsDividerAttrs {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function Divider({ className, ...rest }: DividerProps): ReactElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import '@cupra/ui-kit/react';
|
|
3
|
+
import { DsHyperlinkAttrs } from '@cupra/ui-kit/react/types/ds-hyperlink';
|
|
4
|
+
export type HyperlinkProps = DsHyperlinkAttrs & {
|
|
5
|
+
children: JSX.Element | JSX.Element[] | string;
|
|
6
|
+
onClick?: (event: CustomEvent) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function Hyperlink({ children, onClick, ...rest }: HyperlinkProps): ReactElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as i } 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 l({ children: r, onClick: t, ...e }) {
|
|
6
|
+
const { ref: o } = n({ click: t });
|
|
7
|
+
return /* @__PURE__ */ i("ds-hyperlink-react", { ref: o, ...e, children: r });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
l as Hyperlink
|
|
11
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DsIconAttrs } from '@cupra/ui-kit/react/types/ds-icon';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import '@cupra/ui-kit/react';
|
|
4
|
+
export interface IconProps extends DsIconAttrs {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function Icon(props: IconProps): ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
3
|
+
function a(o) {
|
|
4
|
+
const { "icon-name": n, className: c, ...r } = o;
|
|
5
|
+
return /* @__PURE__ */ e("ds-icon-react", { "icon-name": n, class: c, ...r });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
a as Icon
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import '@cupra/ui-kit/react';
|
|
3
|
+
import { type DsIconButtonAttrs } from '@cupra/ui-kit/react/types/ds-icon-button';
|
|
4
|
+
type IconButtonProps = DsIconButtonAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
onClick?: (event: CustomEvent) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function IconButton(props: IconButtonProps): ReactElement;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { useHandleEvent as e } from "../../hooks/useHandleEvent.js";
|
|
5
|
+
function l(o) {
|
|
6
|
+
const { className: t, onClick: r, ...n } = o, { ref: c } = e({ click: r });
|
|
7
|
+
return /* @__PURE__ */ s("ds-icon-button-react", { ref: c, class: t, ...n });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
l as IconButton
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DsInputAttrs } from '@cupra/ui-kit/react/types/ds-input';
|
|
2
|
+
import '@cupra/ui-kit/react';
|
|
3
|
+
import { ChangeEvent, FormEvent, ForwardRefExoticComponent, KeyboardEvent, RefAttributes } from 'react';
|
|
4
|
+
type InputProps = DsInputAttrs & {
|
|
5
|
+
className?: string;
|
|
6
|
+
onInput?: (event: FormEvent<HTMLInputElement>) => void;
|
|
7
|
+
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
8
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLElement>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
3
|
+
import { useHandleEvent as s } from "../../hooks/useHandleEvent.js";
|
|
4
|
+
import { forwardRef as i, useImperativeHandle as u } from "react";
|
|
5
|
+
const c = i(
|
|
6
|
+
({ className: e, onInput: t, onKeyDown: n, onChange: o, ...p }, a) => {
|
|
7
|
+
const { ref: r } = s({ input: t, keydown: n, change: o });
|
|
8
|
+
return u(a, () => r.current, []), /* @__PURE__ */ m("ds-input-react", { ref: r, class: e, ...p });
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
c.displayName = "Input";
|
|
12
|
+
export {
|
|
13
|
+
c as Input
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import '@cupra/ui-kit/react';
|
|
3
|
+
import { DsLinkButtonAttrs } from '@cupra/ui-kit/react/types/ds-link-button';
|
|
4
|
+
type LinkButtonProps = DsLinkButtonAttrs & {
|
|
5
|
+
children: JSX.Element | JSX.Element[] | string;
|
|
6
|
+
onClick?: (event: CustomEvent) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function LinkButton({ children, onClick, ...rest }: LinkButtonProps): ReactElement;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import "../../packages/ui-kit/dist-react/index.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { useHandleEvent as e } from "../../hooks/useHandleEvent.js";
|
|
5
|
+
function f({ children: t, onClick: o, ...r }) {
|
|
6
|
+
const { ref: n } = e({ click: o });
|
|
7
|
+
return /* @__PURE__ */ i("ds-link-button-react", { ref: n, ...r, children: t });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
f as LinkButton
|
|
11
|
+
};
|