@cupra/ui-kit 2.0.0-canary.113 → 2.0.0-canary.115
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/cjs/components/ds-breadcrumbs/ds-breadcrumbs.cjs +8 -8
- package/dist/cjs/components/ds-date-picker/ds-date-picker.cjs +1 -1
- package/dist/cjs/components/ds-text/ds-text.cjs +3 -3
- package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist/cjs/decorators/customUiKitElement.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/utils/IconsManager.cjs +1 -1
- package/dist/cjs/utils/PubSub.cjs +1 -1
- package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist/cjs/utils/componentFactory.cjs +124 -122
- package/dist/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist/cjs/utils/version.cjs +1 -0
- package/dist/esm/components/ds-breadcrumbs/ds-breadcrumbs.js +13 -12
- package/dist/esm/components/ds-date-picker/ds-date-picker.js +2 -7
- package/dist/esm/components/ds-text/ds-text.js +10 -10
- package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/decorators/customUiKitElement.js +14 -13
- package/dist/esm/index.js +3 -2
- package/dist/esm/utils/IconsManager.js +1 -1
- package/dist/esm/utils/PubSub.js +1 -1
- package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist/esm/utils/componentFactory.js +130 -125
- package/dist/esm/utils/cssWithTokens.js +1 -1
- package/dist/esm/utils/htmlWithTokens.js +1 -1
- package/dist/esm/utils/version.js +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/componentFactory.d.ts +1 -0
- package/dist/types/utils/version.d.ts +2 -0
- package/dist-react/cjs/components/ds-breadcrumbs/ds-breadcrumbs.cjs +8 -8
- package/dist-react/cjs/components/ds-date-picker/ds-date-picker.cjs +1 -1
- package/dist-react/cjs/components/ds-text/ds-text.cjs +3 -3
- package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist-react/cjs/decorators/customUiKitElement.cjs +1 -1
- package/dist-react/cjs/index.cjs +1 -1
- package/dist-react/cjs/utils/IconsManager.cjs +1 -1
- package/dist-react/cjs/utils/PubSub.cjs +1 -1
- package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist-react/cjs/utils/componentFactory.cjs +113 -112
- package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist-react/cjs/utils/version.cjs +1 -0
- package/dist-react/esm/components/ds-breadcrumbs/ds-breadcrumbs.js +13 -12
- package/dist-react/esm/components/ds-date-picker/ds-date-picker.js +2 -7
- package/dist-react/esm/components/ds-text/ds-text.js +10 -10
- package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/decorators/customUiKitElement.js +14 -13
- package/dist-react/esm/index.js +3 -2
- package/dist-react/esm/utils/IconsManager.js +1 -1
- package/dist-react/esm/utils/PubSub.js +1 -1
- package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist-react/esm/utils/componentFactory.js +117 -114
- package/dist-react/esm/utils/cssWithTokens.js +1 -1
- package/dist-react/esm/utils/htmlWithTokens.js +1 -1
- package/dist-react/esm/utils/version.js +4 -0
- package/dist-react/types/index.d.ts +1 -0
- package/dist-react/types/utils/componentFactory.d.ts +1 -0
- package/dist-react/types/utils/version.d.ts +2 -0
- package/package.json +2 -2
|
@@ -5,12 +5,12 @@ import { n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_mod
|
|
|
5
5
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.js";
|
|
6
6
|
import { __decorate as r } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
7
7
|
import { UiKitElement as i } from "../base/UiKitElement.js";
|
|
8
|
-
import {
|
|
9
|
-
import { booleanConverter as o } from "../../utils/booleanConverter.js";
|
|
10
|
-
import { e as s } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
11
|
-
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.js";
|
|
12
|
-
import { s as c, u as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/static.js";
|
|
8
|
+
import { s as a, u as o } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/static.js";
|
|
13
9
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/static-html.js";
|
|
10
|
+
import { customUiKitElement as s } from "../../decorators/customUiKitElement.js";
|
|
11
|
+
import { booleanConverter as c } from "../../utils/booleanConverter.js";
|
|
12
|
+
import { e as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
13
|
+
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.js";
|
|
14
14
|
import { ViewportMixin as u } from "../../mixins/ViewportMixin.js";
|
|
15
15
|
import { objectConverter as d } from "../../utils/objectConverter.js";
|
|
16
16
|
import { o as f } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/style-map.js";
|
|
@@ -51,12 +51,12 @@ var m = new Set([
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
|
-
let t = (this.htmlTagName ?? "").toLowerCase(), n =
|
|
55
|
-
return
|
|
54
|
+
let t = (this.htmlTagName ?? "").toLowerCase(), n = a(m.has(t) ? t : "span");
|
|
55
|
+
return o`
|
|
56
56
|
<${n}
|
|
57
57
|
part="container"
|
|
58
58
|
data-testid="ds-text-container"
|
|
59
|
-
class=${
|
|
59
|
+
class=${l(this.classes)}
|
|
60
60
|
style=${f({ color: this.color || "var(--ui-kit-text-color)" })}
|
|
61
61
|
>
|
|
62
62
|
${this.value ? this.value : e}
|
|
@@ -79,10 +79,10 @@ r([t({
|
|
|
79
79
|
reflect: !0
|
|
80
80
|
})], h.prototype, "color", void 0), r([t({
|
|
81
81
|
type: Boolean,
|
|
82
|
-
converter:
|
|
82
|
+
converter: c,
|
|
83
83
|
reflect: !0
|
|
84
84
|
})], h.prototype, "uppercase", void 0), r([n({
|
|
85
85
|
slot: "",
|
|
86
86
|
flatten: !0
|
|
87
|
-
})], h.prototype, "slotedNodes", void 0), h = r([
|
|
87
|
+
})], h.prototype, "slotedNodes", void 0), h = r([s("ds-text")], h);
|
|
88
88
|
//#endregion
|
|
@@ -50,7 +50,7 @@ var p = class extends o {
|
|
|
50
50
|
}
|
|
51
51
|
loadThemeStyles() {
|
|
52
52
|
return this.loadStyles ? new Promise((e, t) => {
|
|
53
|
-
let n = "/2.0.0-canary.
|
|
53
|
+
let n = "/2.0.0-canary.115", r = `https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;
|
|
54
54
|
if (document.head.querySelector(`link[href="${r}"]`)) e();
|
|
55
55
|
else {
|
|
56
56
|
let i = `ui-kit-theme-${n}`, a = document.getElementById(i), o = document.createElement("link");
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VERSION_TAG_SUFFIX as e } from "../utils/version.js";
|
|
2
|
+
import { reactFactory as t, standardFactory as n } from "../utils/componentFactory.js";
|
|
2
3
|
//#region src/decorators/customUiKitElement.ts
|
|
3
|
-
function
|
|
4
|
-
return function(
|
|
5
|
-
if (!
|
|
6
|
-
let
|
|
7
|
-
if (globalThis?.customElements?.get(
|
|
8
|
-
let
|
|
9
|
-
Array.isArray(
|
|
10
|
-
constructor(...
|
|
11
|
-
super(...
|
|
4
|
+
function r(r, i) {
|
|
5
|
+
return function(a) {
|
|
6
|
+
if (!a?.prototype) throw TypeError("@customUiKitElement requires a class that extends HTMLElement.");
|
|
7
|
+
let o = typeof __UIKIT_TARGET__ < "u" && __UIKIT_TARGET__ === "react", s = o ? `${r}${e}` : r;
|
|
8
|
+
if (globalThis?.customElements?.get(s)) return;
|
|
9
|
+
let c = i?.skipTagAsComponentName ? [] : [r];
|
|
10
|
+
Array.isArray(i?.extendComponentNames) && (c = [...i.extendComponentNames, ...c]), globalThis?.customElements?.define?.(s, class extends a {
|
|
11
|
+
constructor(...e) {
|
|
12
|
+
super(...e), this.componentFactory = o ? t : n;
|
|
12
13
|
}
|
|
13
14
|
static {
|
|
14
|
-
this.componentName =
|
|
15
|
+
this.componentName = c;
|
|
15
16
|
}
|
|
16
17
|
connectedCallback() {
|
|
17
|
-
|
|
18
|
+
a.prototype.connectedCallback?.call(this), this.setAttribute("data-ui-kit-version", "2.0.0-canary.115");
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
//#endregion
|
|
23
|
-
export {
|
|
24
|
+
export { r as customUiKitElement };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VERSION as e, VERSION_TAG_SUFFIX as t } from "./utils/version.js";
|
|
1
2
|
import "./components/index.js";
|
|
2
|
-
import { iconNames as
|
|
3
|
-
export { e as iconNames };
|
|
3
|
+
import { iconNames as n } from "./components/ds-icon/iconNames.js";
|
|
4
|
+
export { e as VERSION, t as VERSION_TAG_SUFFIX, n as iconNames };
|
|
@@ -25,7 +25,7 @@ var n = class {
|
|
|
25
25
|
return console.error(`Failed to fetch icon "${e}":`, t), "";
|
|
26
26
|
}), t.subscribe("theme", this.handleChangeTheme);
|
|
27
27
|
}
|
|
28
|
-
}, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
}, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.115"), i = globalThis, a = i[r];
|
|
29
29
|
a || (a = new n(), Object.defineProperty(i, r, {
|
|
30
30
|
value: a,
|
|
31
31
|
writable: !1,
|
package/dist/esm/utils/PubSub.js
CHANGED
|
@@ -18,7 +18,7 @@ var e = class {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
}, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
}, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.115"), n = globalThis, r = n[t];
|
|
22
22
|
r || (r = new e(), Object.defineProperty(n, t, {
|
|
23
23
|
value: r,
|
|
24
24
|
writable: !1,
|
|
@@ -4,7 +4,7 @@ var t = e(20), n = class e {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.stylePromises = /* @__PURE__ */ new Map(), this.getStyles = async ({ componentName: e, theme: n }) => {
|
|
6
6
|
if (!n || !e) return;
|
|
7
|
-
let r = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
7
|
+
let r = `https://ds-assets.cupra.com/2.0.0-canary.115/styles/${n}/components/${e}.css`, i = this.getCachedStyleSheetPromise({ url: r });
|
|
8
8
|
if (i) return i;
|
|
9
9
|
let a = t(() => this.fetchStyle({ url: r })).then((e) => (e || this.stylePromises.delete(r), e));
|
|
10
10
|
return this.stylePromises.set(r, a), this.stylePromises.get(r);
|
|
@@ -2,9 +2,12 @@ import { x as e } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-ht
|
|
|
2
2
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
|
|
3
3
|
import { o as t } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js";
|
|
4
4
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/if-defined.js";
|
|
5
|
+
import { s as n, u as r } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/static.js";
|
|
6
|
+
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/static-html.js";
|
|
7
|
+
import { VERSION_TAG_SUFFIX as i } from "./version.js";
|
|
5
8
|
//#region src/utils/componentFactory.ts
|
|
6
|
-
var n = {
|
|
7
|
-
createIcon: (n) => (
|
|
9
|
+
var a = n(`ds-icon${i}`), o = n(`ds-calendar-day${i}`), s = n(`ds-button${i}`), c = n(`ds-divider${i}`), l = n(`ds-icon-button${i}`), u = n(`ds-loader-spinner${i}`), d = n(`ds-skeleton${i}`), f = n(`ds-toast-message${i}`), p = n(`ds-inline-alert${i}`), m = n(`ds-tooltip${i}`), h = {
|
|
10
|
+
createIcon: (n) => (_("ds-icon", () => import("../components/ds-icon/ds-icon.js")), e`
|
|
8
11
|
<ds-icon
|
|
9
12
|
class=${t(n?.class)}
|
|
10
13
|
data-testid=${t(n?.["data-testid"])}
|
|
@@ -22,7 +25,7 @@ var n = {
|
|
|
22
25
|
${n.children}
|
|
23
26
|
</ds-icon>
|
|
24
27
|
`),
|
|
25
|
-
createCalendarDay: (n = {}) => (
|
|
28
|
+
createCalendarDay: (n = {}) => (_("ds-calendar-day", () => import("../components/ds-calendar-day/ds-calendar-day.js")), e`
|
|
26
29
|
<ds-calendar-day
|
|
27
30
|
class=${t(n?.class)}
|
|
28
31
|
day=${t(n?.day)}
|
|
@@ -34,7 +37,7 @@ var n = {
|
|
|
34
37
|
data-testid=${t(n?.["data-testid"])}
|
|
35
38
|
></ds-calendar-day>
|
|
36
39
|
`),
|
|
37
|
-
createButton: (n = {}) => (
|
|
40
|
+
createButton: (n = {}) => (_("ds-button", () => import("../components/ds-button/ds-button.js")), e`
|
|
38
41
|
<ds-button
|
|
39
42
|
class=${n?.class}
|
|
40
43
|
@click=${n?.["@click"]}
|
|
@@ -56,7 +59,7 @@ var n = {
|
|
|
56
59
|
${n.children}
|
|
57
60
|
</ds-button>
|
|
58
61
|
`),
|
|
59
|
-
createDivider: (t = {}) => (
|
|
62
|
+
createDivider: (t = {}) => (_("ds-divider", () => import("../components/ds-divider/ds-divider.js")), e`
|
|
60
63
|
<ds-divider
|
|
61
64
|
class=${t?.class}
|
|
62
65
|
variant=${t?.variant ?? "primary"}
|
|
@@ -65,7 +68,7 @@ var n = {
|
|
|
65
68
|
>
|
|
66
69
|
</ds-divider>
|
|
67
70
|
`),
|
|
68
|
-
createIconButton: (n = {}) => (
|
|
71
|
+
createIconButton: (n = {}) => (_("ds-icon-button", () => import("../components/ds-icon-button/ds-icon-button.js")), e`
|
|
69
72
|
<ds-icon-button
|
|
70
73
|
class=${n?.class}
|
|
71
74
|
@click=${n?.["@click"]}
|
|
@@ -84,14 +87,14 @@ var n = {
|
|
|
84
87
|
${n.children}
|
|
85
88
|
</ds-icon-button>
|
|
86
89
|
`),
|
|
87
|
-
createLoaderSpinner: (t = {}) => (
|
|
90
|
+
createLoaderSpinner: (t = {}) => (_("ds-loader-spinner", () => import("../components/ds-loader-spinner/ds-loader-spinner.js")), e`
|
|
88
91
|
<ds-loader-spinner
|
|
89
92
|
?show=${t?.show}
|
|
90
93
|
orientation=${t?.orientation ?? "row"}
|
|
91
94
|
mode=${t?.mode ?? "light"}
|
|
92
95
|
></ds-loader-spinner>
|
|
93
96
|
`),
|
|
94
|
-
createSkeleton: (n = {}) => (
|
|
97
|
+
createSkeleton: (n = {}) => (_("ds-skeleton", () => import("../components/ds-skeleton/ds-skeleton.js")), e`
|
|
95
98
|
<ds-skeleton
|
|
96
99
|
class=${t(n?.class)}
|
|
97
100
|
data-testid=${t(n?.["data-testid"])}
|
|
@@ -101,7 +104,7 @@ var n = {
|
|
|
101
104
|
animation=${t(n?.animation)}
|
|
102
105
|
></ds-skeleton>
|
|
103
106
|
`),
|
|
104
|
-
createToastMessage: (t) => (
|
|
107
|
+
createToastMessage: (t) => (_("ds-toast-message", () => import("../components/ds-toast-message/ds-toast-message.js")), e`
|
|
105
108
|
<ds-toast-message
|
|
106
109
|
data-id="${t["data-id"]}"
|
|
107
110
|
data-template="${t["data-template"]}"
|
|
@@ -110,7 +113,7 @@ var n = {
|
|
|
110
113
|
status="${t.status}"
|
|
111
114
|
></ds-toast-message>
|
|
112
115
|
`),
|
|
113
|
-
createInlineAlert: (t) => (
|
|
116
|
+
createInlineAlert: (t) => (_("ds-inline-alert", () => import("../components/ds-inline-alert/ds-inline-alert.js")), e`
|
|
114
117
|
<ds-inline-alert
|
|
115
118
|
title="${t.title}"
|
|
116
119
|
text="${t.text}"
|
|
@@ -118,8 +121,9 @@ var n = {
|
|
|
118
121
|
?show=${t.show ?? !0}
|
|
119
122
|
></ds-inline-alert>
|
|
120
123
|
`),
|
|
121
|
-
createTooltip: (n = {}) => (
|
|
124
|
+
createTooltip: (n = {}) => (_("ds-tooltip", () => import("../components/ds-tooltip/ds-tooltip.js")), e`
|
|
122
125
|
<ds-tooltip
|
|
126
|
+
class=${t(n?.class)}
|
|
123
127
|
mode=${t(n.mode)}
|
|
124
128
|
?show=${n.show ?? !1}
|
|
125
129
|
?disable-hover-listener=${n?.["disable-hover-listener"]}
|
|
@@ -130,138 +134,139 @@ var n = {
|
|
|
130
134
|
<div slot="content">${n.content}</div>
|
|
131
135
|
</ds-tooltip>
|
|
132
136
|
`)
|
|
133
|
-
},
|
|
134
|
-
createIcon: (
|
|
135
|
-
|
|
136
|
-
class=${t(
|
|
137
|
-
data-testid=${t(
|
|
138
|
-
@click=${
|
|
139
|
-
@keydown=${
|
|
140
|
-
icon-name=${
|
|
141
|
-
color=${t(
|
|
142
|
-
background-color=${t(
|
|
143
|
-
size=${t(
|
|
144
|
-
aria-label=${t(
|
|
145
|
-
aria-hidden=${t(
|
|
146
|
-
role=${t(
|
|
147
|
-
tabindex=${t(
|
|
137
|
+
}, g = {
|
|
138
|
+
createIcon: (e) => (_(`ds-icon${i}`, () => import("../components/ds-icon/ds-icon.js")), r`
|
|
139
|
+
<${a}
|
|
140
|
+
class=${t(e?.class)}
|
|
141
|
+
data-testid=${t(e?.["data-testid"])}
|
|
142
|
+
@click=${e?.["@click"]}
|
|
143
|
+
@keydown=${e?.["@keydown"]}
|
|
144
|
+
icon-name=${e?.["icon-name"]}
|
|
145
|
+
color=${t(e?.color)}
|
|
146
|
+
background-color=${t(e?.["background-color"])}
|
|
147
|
+
size=${t(e?.size)}
|
|
148
|
+
aria-label=${t(e?.["aria-label"])}
|
|
149
|
+
aria-hidden=${t(e?.["aria-hidden"])}
|
|
150
|
+
role=${t(e?.role)}
|
|
151
|
+
tabindex=${t(e?.tabindex)}
|
|
148
152
|
>
|
|
149
|
-
${
|
|
150
|
-
|
|
153
|
+
${e.children}
|
|
154
|
+
</${a}>
|
|
151
155
|
`),
|
|
152
|
-
createCalendarDay: (
|
|
153
|
-
|
|
154
|
-
class=${t(
|
|
155
|
-
day=${t(
|
|
156
|
-
size=${t(
|
|
157
|
-
?disabled=${
|
|
158
|
-
?selected=${
|
|
159
|
-
?today=${
|
|
160
|
-
?outside-month=${
|
|
161
|
-
data-testid=${t(
|
|
162
|
-
|
|
156
|
+
createCalendarDay: (e = {}) => (_(`ds-calendar-day${i}`, () => import("../components/ds-calendar-day/ds-calendar-day.js")), r`
|
|
157
|
+
<${o}
|
|
158
|
+
class=${t(e?.class)}
|
|
159
|
+
day=${t(e?.day)}
|
|
160
|
+
size=${t(e?.size)}
|
|
161
|
+
?disabled=${e?.disabled}
|
|
162
|
+
?selected=${e?.selected}
|
|
163
|
+
?today=${e?.today}
|
|
164
|
+
?outside-month=${e?.["outside-month"]}
|
|
165
|
+
data-testid=${t(e?.["data-testid"])}
|
|
166
|
+
></${o}>
|
|
163
167
|
`),
|
|
164
|
-
createButton: (
|
|
165
|
-
|
|
166
|
-
class=${
|
|
167
|
-
@click=${
|
|
168
|
-
.size=${t(
|
|
169
|
-
type=${
|
|
170
|
-
icon-position=${
|
|
171
|
-
.rounded=${
|
|
172
|
-
.full-width=${
|
|
173
|
-
variant=${
|
|
174
|
-
mode=${
|
|
175
|
-
.disabled=${
|
|
176
|
-
icon-name=${
|
|
177
|
-
html-tag-name=${
|
|
178
|
-
href=${
|
|
179
|
-
rel=${
|
|
180
|
-
target=${
|
|
181
|
-
data-testid=${
|
|
168
|
+
createButton: (e = {}) => (_(`ds-button${i}`, () => import("../components/ds-button/ds-button.js")), r`
|
|
169
|
+
<${s}
|
|
170
|
+
class=${e?.class}
|
|
171
|
+
@click=${e?.["@click"]}
|
|
172
|
+
.size=${t(e?.size)}
|
|
173
|
+
type=${e?.type}
|
|
174
|
+
icon-position=${e?.["icon-position"]}
|
|
175
|
+
.rounded=${e?.rounded}
|
|
176
|
+
.full-width=${e?.["full-width"]}
|
|
177
|
+
variant=${e?.variant ?? "primary"}
|
|
178
|
+
mode=${e?.mode ?? "light"}
|
|
179
|
+
.disabled=${e?.disabled}
|
|
180
|
+
icon-name=${e?.["icon-name"]}
|
|
181
|
+
html-tag-name=${e?.["html-tag-name"]}
|
|
182
|
+
href=${e?.href}
|
|
183
|
+
rel=${e?.rel}
|
|
184
|
+
target=${e?.target}
|
|
185
|
+
data-testid=${e?.["data-testid"]}
|
|
182
186
|
>
|
|
183
|
-
${
|
|
184
|
-
|
|
187
|
+
${e.children}
|
|
188
|
+
</${s}>
|
|
185
189
|
`),
|
|
186
|
-
createDivider: (
|
|
187
|
-
|
|
188
|
-
class=${
|
|
189
|
-
variant=${
|
|
190
|
-
orientation=${
|
|
191
|
-
data-testid=${
|
|
190
|
+
createDivider: (e = {}) => (_(`ds-divider${i}`, () => import("../components/ds-divider/ds-divider.js")), r`
|
|
191
|
+
<${c}
|
|
192
|
+
class=${e?.class}
|
|
193
|
+
variant=${e?.variant ?? "primary"}
|
|
194
|
+
orientation=${e?.orientation ?? "horizontal"}
|
|
195
|
+
data-testid=${e?.["data-testid"]}
|
|
192
196
|
>
|
|
193
|
-
|
|
197
|
+
</${c}>
|
|
194
198
|
`),
|
|
195
|
-
createIconButton: (
|
|
196
|
-
|
|
197
|
-
class=${
|
|
198
|
-
@click=${
|
|
199
|
-
size=${t(
|
|
200
|
-
variant=${
|
|
201
|
-
mode=${
|
|
202
|
-
.disabled=${
|
|
203
|
-
icon-name=${
|
|
204
|
-
html-tag-name=${
|
|
205
|
-
href=${
|
|
206
|
-
rel=${
|
|
207
|
-
target=${
|
|
208
|
-
data-testid=${
|
|
209
|
-
data-aria-label=${
|
|
199
|
+
createIconButton: (e = {}) => (_(`ds-icon-button${i}`, () => import("../components/ds-icon-button/ds-icon-button.js")), r`
|
|
200
|
+
<${l}
|
|
201
|
+
class=${e?.class}
|
|
202
|
+
@click=${e?.["@click"]}
|
|
203
|
+
size=${t(e?.size)}
|
|
204
|
+
variant=${e?.variant ?? "primary"}
|
|
205
|
+
mode=${e?.mode ?? "light"}
|
|
206
|
+
.disabled=${e?.disabled}
|
|
207
|
+
icon-name=${e?.["icon-name"]}
|
|
208
|
+
html-tag-name=${e?.["html-tag-name"]}
|
|
209
|
+
href=${e?.href}
|
|
210
|
+
rel=${e?.rel}
|
|
211
|
+
target=${e?.target}
|
|
212
|
+
data-testid=${e?.["data-testid"]}
|
|
213
|
+
data-aria-label=${e?.["data-aria-label"]}
|
|
210
214
|
>
|
|
211
|
-
${
|
|
212
|
-
|
|
215
|
+
${e.children}
|
|
216
|
+
</${l}>
|
|
213
217
|
`),
|
|
214
|
-
createLoaderSpinner: (
|
|
215
|
-
|
|
216
|
-
?show=${
|
|
217
|
-
orientation=${
|
|
218
|
-
mode=${
|
|
219
|
-
|
|
218
|
+
createLoaderSpinner: (e = {}) => (_(`ds-loader-spinner${i}`, () => import("../components/ds-loader-spinner/ds-loader-spinner.js")), r`
|
|
219
|
+
<${u}
|
|
220
|
+
?show=${e?.show}
|
|
221
|
+
orientation=${e?.orientation ?? "row"}
|
|
222
|
+
mode=${e?.mode ?? "light"}
|
|
223
|
+
></${u}>
|
|
220
224
|
`),
|
|
221
|
-
createSkeleton: (
|
|
222
|
-
|
|
223
|
-
class=${t(
|
|
224
|
-
data-testid=${t(
|
|
225
|
-
variant=${t(
|
|
226
|
-
width=${t(
|
|
227
|
-
height=${t(
|
|
228
|
-
animation=${t(
|
|
229
|
-
|
|
225
|
+
createSkeleton: (e = {}) => (_(`ds-skeleton${i}`, () => import("../components/ds-skeleton/ds-skeleton.js")), r`
|
|
226
|
+
<${d}
|
|
227
|
+
class=${t(e?.class)}
|
|
228
|
+
data-testid=${t(e?.["data-testid"])}
|
|
229
|
+
variant=${t(e?.variant)}
|
|
230
|
+
width=${t(e?.width)}
|
|
231
|
+
height=${t(e?.height)}
|
|
232
|
+
animation=${t(e?.animation)}
|
|
233
|
+
></${d}>
|
|
230
234
|
`),
|
|
231
|
-
createToastMessage: (
|
|
232
|
-
|
|
233
|
-
data-id="${
|
|
234
|
-
data-template="${
|
|
235
|
-
title="${
|
|
236
|
-
text="${
|
|
237
|
-
status="${
|
|
238
|
-
|
|
235
|
+
createToastMessage: (e) => (_(`ds-toast-message${i}`, () => import("../components/ds-toast-message/ds-toast-message.js")), r`
|
|
236
|
+
<${f}
|
|
237
|
+
data-id="${e["data-id"]}"
|
|
238
|
+
data-template="${e["data-template"]}"
|
|
239
|
+
title="${e.title}"
|
|
240
|
+
text="${e.text}"
|
|
241
|
+
status="${e.status}"
|
|
242
|
+
></${f}>
|
|
239
243
|
`),
|
|
240
|
-
createInlineAlert: (
|
|
241
|
-
|
|
242
|
-
title="${
|
|
243
|
-
text="${
|
|
244
|
-
status="${
|
|
245
|
-
?show=${
|
|
246
|
-
|
|
244
|
+
createInlineAlert: (e) => (_(`ds-inline-alert${i}`, () => import("../components/ds-inline-alert/ds-inline-alert.js")), r`
|
|
245
|
+
<${p}
|
|
246
|
+
title="${e.title}"
|
|
247
|
+
text="${e.text}"
|
|
248
|
+
status="${e.status}"
|
|
249
|
+
?show=${e.show ?? !0}
|
|
250
|
+
></${p}>
|
|
247
251
|
`),
|
|
248
|
-
createTooltip: (
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
?
|
|
253
|
-
?disable-
|
|
254
|
-
?disable-
|
|
252
|
+
createTooltip: (e = {}) => (_(`ds-tooltip${i}`, () => import("../components/ds-tooltip/ds-tooltip.js")), r`
|
|
253
|
+
<${m}
|
|
254
|
+
class=${t(e?.class)}
|
|
255
|
+
mode=${t(e.mode)}
|
|
256
|
+
?show=${e.show ?? !1}
|
|
257
|
+
?disable-hover-listener=${e?.["disable-hover-listener"]}
|
|
258
|
+
?disable-focus-listener=${e?.["disable-focus-listener"]}
|
|
259
|
+
?disable-press-listener=${e?.["disable-press-listener"]}
|
|
255
260
|
>
|
|
256
|
-
${
|
|
257
|
-
<div slot="content">${
|
|
258
|
-
|
|
261
|
+
${e.children}
|
|
262
|
+
<div slot="content">${e.content}</div>
|
|
263
|
+
</${m}>
|
|
259
264
|
`)
|
|
260
265
|
};
|
|
261
|
-
function
|
|
266
|
+
function _(e, t) {
|
|
262
267
|
try {
|
|
263
268
|
typeof window < "u" && typeof customElements < "u" && !customElements.get(e) && t().catch((e) => {});
|
|
264
269
|
} catch {}
|
|
265
270
|
}
|
|
266
271
|
//#endregion
|
|
267
|
-
export {
|
|
272
|
+
export { g as reactFactory, h as standardFactory };
|
|
@@ -2,7 +2,7 @@ import { i as e, r as t } from "../node_modules/.pnpm/@lit_reactive-element@2.1.
|
|
|
2
2
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
|
|
3
3
|
//#region src/utils/cssWithTokens.ts
|
|
4
4
|
function n(n, ...r) {
|
|
5
|
-
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
5
|
+
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-115"))}`;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as cssWithTokens };
|
|
@@ -4,7 +4,7 @@ import { o as t } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-ht
|
|
|
4
4
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.js";
|
|
5
5
|
//#region src/utils/htmlWithTokens.ts
|
|
6
6
|
function n(n, ...r) {
|
|
7
|
-
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
7
|
+
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-115"))}`;
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
10
|
export { n as htmlWithTokens };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export type ComponentFactory = {
|
|
|
20
20
|
createToastMessage: GetAttributes<DsToastMessageAttrs>;
|
|
21
21
|
createInlineAlert: GetAttributes<DsInlineAlertAttrs>;
|
|
22
22
|
createTooltip: GetAttributes<DsTooltipAttrs & {
|
|
23
|
+
class?: string;
|
|
23
24
|
children?: any;
|
|
24
25
|
content?: any;
|
|
25
26
|
}>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const n=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),r=require(`../base/UiKitElement.cjs`),i=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/if-defined.cjs`);const a=require(`../../
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const n=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),r=require(`../base/UiKitElement.cjs`),i=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/if-defined.cjs`);const a=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/static.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/static-html.cjs`);const o=require(`../../decorators/customUiKitElement.cjs`);require(`../ds-breadcrumbs-item/ds-breadcrumbs-item.cjs`);var s=[{below:768,maxItems:3},{below:1024,maxItems:4}],c=5,l=class extends r.UiKitElement{constructor(...e){super(...e),this.items=[],this.maxItems=c,this.itemTag=`ds-breadcrumbs-item`,this.onResize=()=>{this.maxItems=s.find(({below:e})=>window.innerWidth<e)?.maxItems??c}}async firstUpdated(e){super.firstUpdated(e),this.onResize()}connectedCallback(){super.connectedCallback(),window.addEventListener(`resize`,this.onResize)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`resize`,this.onResize)}handleSlotChange(e){let t=e.target.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase().startsWith(`ds-breadcrumbs-item`));t.length>0&&(this.itemTag=t[0].tagName.toLowerCase()),this.items=t.map(e=>({label:e.getAttribute(`label`)||e.textContent?.trim()||``,href:e.getAttribute(`href`)||e.querySelector(`[slot="item"]`)?.getAttribute(`href`)||void 0,disabled:e.hasAttribute(`disabled`),loading:e.hasAttribute(`loading`),selected:e.hasAttribute(`selected`)}))}get separatorIcon(){return this.componentFactory.createIcon({class:`separator-icon`,"icon-name":`arrow-right`,size:24})}itemTemplate(t,n){let r=t.selected||n,i=a.s(this.itemTag),o=r||t.disabled||!t.href?a.u`<span slot="item">${t.label}</span>`:a.u`<a href=${t.href} slot="item">${t.label}</a>`;return a.u`<li class="breadcrumb-list-item">
|
|
2
2
|
<${i}
|
|
3
3
|
?selected=${r}
|
|
4
4
|
?disabled=${t.disabled}
|
|
5
5
|
?loading=${t.loading}
|
|
6
6
|
>
|
|
7
|
-
${
|
|
7
|
+
${o}
|
|
8
8
|
</${i}>
|
|
9
9
|
${n?e.E:this.separatorIcon}
|
|
10
|
-
</li>`}get slotTemplate(){return
|
|
11
|
-
${this.items.slice(1,this.items.length-(this.maxItems-2)).map(e=>
|
|
10
|
+
</li>`}get slotTemplate(){return a.u`<slot @slotchange=${this.handleSlotChange} style="display: none;"></slot>`}get overflowMenuTemplate(){return a.u`<ul class="overflow-menu" role="menu">
|
|
11
|
+
${this.items.slice(1,this.items.length-(this.maxItems-2)).map(e=>a.u`
|
|
12
12
|
<li class="overflow-menu-item" role="none">
|
|
13
13
|
<a href=${i.o(e.href)} class="overflow-menu-link" role="menuitem">${e.label}</a>
|
|
14
14
|
</li>
|
|
15
15
|
`)}
|
|
16
|
-
</ul>`}get overflowTriggerTemplate(){return
|
|
16
|
+
</ul>`}get overflowTriggerTemplate(){return a.u`<button class="overflow-trigger">
|
|
17
17
|
<span class="overflow-label">...</span>
|
|
18
|
-
</button>`}get tooltipTemplate(){return this.componentFactory.createTooltip({content:this.overflowMenuTemplate,children:this.overflowTriggerTemplate})}get listTemplate(){let{items:e,maxItems:t}=this;if(e.length<=t)return e.map((t,n)=>this.itemTemplate(t,n===e.length-1));let n=e.slice(e.length-(t-2));return
|
|
18
|
+
</button>`}get tooltipTemplate(){return this.componentFactory.createTooltip({class:`breadcrumbs-tooltip`,content:this.overflowMenuTemplate,children:this.overflowTriggerTemplate})}get listTemplate(){let{items:e,maxItems:t}=this;if(e.length<=t)return e.map((t,n)=>this.itemTemplate(t,n===e.length-1));let n=e.slice(e.length-(t-2));return a.u`
|
|
19
19
|
${this.itemTemplate(e[0],!1)}
|
|
20
20
|
<li class="breadcrumb-list-item">
|
|
21
21
|
<div class="overflow-item-wrapper">
|
|
@@ -24,11 +24,11 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
24
24
|
</div>
|
|
25
25
|
</li>
|
|
26
26
|
${n.map((e,t)=>this.itemTemplate(e,t===n.length-1))}
|
|
27
|
-
`}render(){return
|
|
27
|
+
`}render(){return a.u`
|
|
28
28
|
${this.slotTemplate}
|
|
29
29
|
<nav class="container" aria-label="Breadcrumb">
|
|
30
30
|
<ol class="breadcrumb-list">
|
|
31
31
|
${this.listTemplate}
|
|
32
32
|
</ol>
|
|
33
33
|
</nav>
|
|
34
|
-
`}};n.__decorate([t.r()],l.prototype,`items`,void 0),n.__decorate([t.r()],l.prototype,`maxItems`,void 0),n.__decorate([t.r()],l.prototype,`itemTag`,void 0),l=n.__decorate([
|
|
34
|
+
`}};n.__decorate([t.r()],l.prototype,`items`,void 0),n.__decorate([t.r()],l.prototype,`maxItems`,void 0),n.__decorate([t.r()],l.prototype,`itemTag`,void 0),l=n.__decorate([o.customUiKitElement(`ds-breadcrumbs`)],l);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const r=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),i=require(`../base/UiKitElement.cjs`),a=require(`../../decorators/customUiKitElement.cjs`),o=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const s=require(`../../mixins/inputStatesMixin.cjs`),c=require(`./styles/common.styles.cjs`);var l,u=class extends s.inputStatesMixin(i.UiKitElement){static{l=this}constructor(...e){super(...e),this.size=`large`,this.helperText=``,this.forcedError=``,this.invalidError=``,this.readonlyText=``,this.dataAriaLabelCalendarButton=``,this.isExpanded=!1,this.handleCalendarButtonClick=()=>{this.inputStates.disabled||this.inputStates.readonly||(this.isExpanded=!this.isExpanded)},this.handleCalendarChange=e=>{e.stopPropagation();let t=e.detail.value;this.nativeInput&&(this.nativeInput.value=t,this.nativeInput.dispatchEvent(new Event(`input`,{bubbles:!0}))),this.isExpanded=!1},this.handleDocumentClick=e=>{this.isExpanded&&!this.contains(e.target)&&(this.isExpanded=!1)}}static{this.styles=[c.commonStyles]}static{this.nativeStylesInjected=!1}connectedCallback(){super.connectedCallback(),document.addEventListener(`click`,this.handleDocumentClick),this.addEventListener(`ds-calendar-change`,this.handleCalendarChange),l.injectNativeInputStyles()}static injectNativeInputStyles(){if(l.nativeStylesInjected)return;l.nativeStylesInjected=!0;let e=document.createElement(`style`);e.
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const r=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),i=require(`../base/UiKitElement.cjs`),a=require(`../../decorators/customUiKitElement.cjs`),o=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const s=require(`../../mixins/inputStatesMixin.cjs`),c=require(`./styles/common.styles.cjs`);var l,u=class extends s.inputStatesMixin(i.UiKitElement){static{l=this}constructor(...e){super(...e),this.size=`large`,this.helperText=``,this.forcedError=``,this.invalidError=``,this.readonlyText=``,this.dataAriaLabelCalendarButton=``,this.isExpanded=!1,this.handleCalendarButtonClick=()=>{this.inputStates.disabled||this.inputStates.readonly||(this.isExpanded=!this.isExpanded)},this.handleCalendarChange=e=>{e.stopPropagation();let t=e.detail.value;this.nativeInput&&(this.nativeInput.value=t,this.nativeInput.dispatchEvent(new Event(`input`,{bubbles:!0}))),this.isExpanded=!1},this.handleDocumentClick=e=>{this.isExpanded&&!this.contains(e.target)&&(this.isExpanded=!1)}}static{this.styles=[c.commonStyles]}static{this.nativeStylesInjected=!1}connectedCallback(){super.connectedCallback(),this.classList.add(`ds-date-picker`),document.addEventListener(`click`,this.handleDocumentClick),this.addEventListener(`ds-calendar-change`,this.handleCalendarChange),l.injectNativeInputStyles()}static injectNativeInputStyles(){if(l.nativeStylesInjected)return;l.nativeStylesInjected=!0;let e=document.createElement(`style`);e.textContent=[`.ds-date-picker input[type="date"]::-webkit-calendar-picker-indicator { display: none !important; }`,`.ds-date-picker input[type="date"]::-webkit-inner-spin-button { display: none !important; }`].join(`
|
|
2
2
|
`),document.head.appendChild(e)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`click`,this.handleDocumentClick),this.removeEventListener(`ds-calendar-change`,this.handleCalendarChange)}get classes(){return{container:!0,error:!!this.forcedError,[this.size]:!!this.size,disabled:this.inputStates.disabled,readonly:this.inputStates.readonly,filled:this.inputStates.filled,invalid:this.inputStates.invalid,focus:this.inputStates.focus,"focus-visible":this.inputStates.focusVisible,expanded:this.isExpanded}}render(){return e.x`
|
|
3
3
|
<div class=${o.e(this.classes)}>
|
|
4
4
|
<div class="input-container">
|