@cupra/ui-react 1.0.0-canary.15 → 1.0.0-canary.16
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/dist/components/Accordion/Accordion.js +8 -0
- package/dist/components/Avatar/Avatar.js +11 -0
- package/dist/components/Bullets/Bullets.js +6 -0
- package/dist/components/Button/Button.js +20 -0
- package/dist/components/CarouselIndicator/CarouselIndicator.js +9 -0
- package/dist/components/Checkbox/Checkbox.js +11 -0
- package/dist/components/Chip/Chip.js +9 -0
- package/dist/components/Chips/Chips.js +13 -0
- package/dist/components/Currency/Currency.js +9 -0
- package/dist/components/Dialog/Dialog.js +15 -0
- package/dist/components/DialogBody/DialogBody.js +9 -0
- package/dist/components/DialogFooter/DialogFooter.js +9 -0
- package/dist/components/DialogHeader/DialogHeader.js +9 -0
- package/dist/components/Divider/Divider.js +8 -0
- package/dist/components/Hyperlink/Hyperlink.js +11 -0
- package/dist/components/Icon/Icon.js +9 -0
- package/dist/components/IconButton/IconButton.js +19 -0
- package/dist/components/Input/Input.js +14 -0
- package/dist/components/InteractiveCard/InteractiveCard.js +26 -0
- package/dist/components/LinkButton/LinkButton.js +11 -0
- package/dist/components/Loader/Loader.js +24 -0
- package/dist/components/Logo/Logo.js +9 -0
- package/dist/components/MapPin/MapPin.js +11 -0
- package/dist/components/Modal/Modal.js +49 -0
- package/dist/components/PasswordInput/PasswordInput.js +39 -0
- package/dist/components/PickerItem/PickerItem.js +21 -0
- package/dist/components/Radio/Radio.js +14 -0
- package/dist/components/RadioButton/RadioButton.js +10 -0
- package/dist/components/RadioButtonGroup/RadioButtonGroup.js +10 -0
- package/dist/components/Search/Search.js +8 -0
- package/dist/components/SearchInput/SearchInput.js +46 -0
- package/dist/components/SecondaryNavigation/SecondaryNavigation.js +16 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +11 -0
- package/dist/components/Select/Select.js +6 -0
- package/dist/components/Selection/Selection.js +9 -0
- package/dist/components/SidebarNavigation/SidebarNavigation.js +15 -0
- package/dist/components/Slider/Slider.js +16 -0
- package/dist/components/StaticBox/StaticBox.js +20 -0
- package/dist/components/Stepper/Stepper.js +6 -0
- package/dist/components/Tabs/Tabs.js +19 -0
- package/dist/components/Tag/Tag.js +11 -0
- package/dist/components/Text/Text.js +9 -0
- package/dist/components/TextInput/TextInput.js +44 -0
- package/dist/components/Textarea/Textarea.js +57 -0
- package/dist/components/ThemeProvider/ThemeProvider.js +6 -0
- package/dist/components/Toast/Toast.js +16 -0
- package/dist/components/ToastMessage/ToastMessage.js +13 -0
- package/dist/components/ToggleButton/ToggleButton.js +11 -0
- package/dist/components/ToggleSwitch/ToggleSwitch.js +22 -0
- package/dist/components/Tooltip/Tooltip.js +24 -0
- package/dist/hooks/useBreakpoint.js +42 -0
- package/dist/hooks/useEventListeners.js +26 -0
- package/dist/hooks/useHandleEvent.js +25 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.js +14 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +112 -3309
- 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 +9226 -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 +1 -1
|
@@ -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 { 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 { 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,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,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,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,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,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,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,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,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,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