@daikin-oss/design-system-web-components 0.3.1 → 0.3.2
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/CHANGELOG.md +44 -0
- package/dist/cjs/components/accordion/daikin-accordion.d.ts +0 -1
- package/dist/cjs/components/accordion-item/daikin-accordion-item.d.ts +0 -1
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.cjs +124 -0
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.d.ts +52 -0
- package/dist/cjs/components/breadcrumb/index.cjs +7 -0
- package/dist/cjs/components/breadcrumb/index.d.ts +1 -0
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +116 -0
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +62 -0
- package/dist/cjs/components/breadcrumb-item/index.cjs +7 -0
- package/dist/cjs/components/breadcrumb-item/index.d.ts +1 -0
- package/dist/cjs/components/button/daikin-button.d.ts +0 -1
- package/dist/cjs/components/checkbox/daikin-checkbox.d.ts +0 -1
- package/dist/cjs/components/icon/daikin-icon.d.ts +0 -1
- package/dist/cjs/components/index.cjs +20 -0
- package/dist/cjs/components/index.d.ts +4 -0
- package/dist/cjs/components/input-group/daikin-input-group.cjs +1 -1
- package/dist/cjs/components/input-group/daikin-input-group.d.ts +0 -1
- package/dist/cjs/components/notification/daikin-notification.d.ts +0 -1
- package/dist/cjs/components/panel-switcher/daikin-panel-switcher.d.ts +0 -1
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +137 -0
- package/dist/cjs/components/progress-bar/daikin-progress-bar.d.ts +47 -0
- package/dist/cjs/components/progress-bar/index.cjs +7 -0
- package/dist/cjs/components/progress-bar/index.d.ts +1 -0
- package/dist/cjs/components/radio/daikin-radio.d.ts +0 -1
- package/dist/cjs/components/tab/daikin-tab.d.ts +0 -1
- package/dist/cjs/components/tab-group/daikin-tab-group.d.ts +0 -1
- package/dist/cjs/components/text-input/daikin-text-input.d.ts +0 -1
- package/dist/cjs/components/textarea/daikin-textarea.d.ts +0 -1
- package/dist/cjs/components/toggle/daikin-toggle.d.ts +0 -1
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +223 -0
- package/dist/cjs/components/tooltip/daikin-tooltip.d.ts +76 -0
- package/dist/cjs/components/tooltip/index.cjs +7 -0
- package/dist/cjs/components/tooltip/index.d.ts +1 -0
- package/dist/cjs/index.cjs +20 -0
- package/dist/cjs/is-client.cjs +5 -0
- package/dist/cjs/is-client.d.ts +1 -0
- package/dist/cjs/tailwind.css.cjs +2 -2
- package/dist/cjs/type-utils.d.ts +0 -1
- package/dist/cjs-dev/components/accordion/daikin-accordion.d.ts +0 -1
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.d.ts +0 -1
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.cjs +124 -0
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.d.ts +52 -0
- package/dist/cjs-dev/components/breadcrumb/index.cjs +7 -0
- package/dist/cjs-dev/components/breadcrumb/index.d.ts +1 -0
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +116 -0
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +62 -0
- package/dist/cjs-dev/components/breadcrumb-item/index.cjs +7 -0
- package/dist/cjs-dev/components/breadcrumb-item/index.d.ts +1 -0
- package/dist/cjs-dev/components/button/daikin-button.d.ts +0 -1
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.ts +0 -1
- package/dist/cjs-dev/components/icon/daikin-icon.d.ts +0 -1
- package/dist/cjs-dev/components/index.cjs +20 -0
- package/dist/cjs-dev/components/index.d.ts +4 -0
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +1 -1
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.ts +0 -1
- package/dist/cjs-dev/components/notification/daikin-notification.d.ts +0 -1
- package/dist/cjs-dev/components/panel-switcher/daikin-panel-switcher.d.ts +0 -1
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +152 -0
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.d.ts +47 -0
- package/dist/cjs-dev/components/progress-bar/index.cjs +7 -0
- package/dist/cjs-dev/components/progress-bar/index.d.ts +1 -0
- package/dist/cjs-dev/components/radio/daikin-radio.d.ts +0 -1
- package/dist/cjs-dev/components/tab/daikin-tab.d.ts +0 -1
- package/dist/cjs-dev/components/tab-group/daikin-tab-group.d.ts +0 -1
- package/dist/cjs-dev/components/text-input/daikin-text-input.d.ts +0 -1
- package/dist/cjs-dev/components/textarea/daikin-textarea.d.ts +0 -1
- package/dist/cjs-dev/components/toggle/daikin-toggle.d.ts +0 -1
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +223 -0
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.ts +76 -0
- package/dist/cjs-dev/components/tooltip/index.cjs +7 -0
- package/dist/cjs-dev/components/tooltip/index.d.ts +1 -0
- package/dist/cjs-dev/index.cjs +20 -0
- package/dist/cjs-dev/is-client.cjs +5 -0
- package/dist/cjs-dev/is-client.d.ts +1 -0
- package/dist/cjs-dev/tailwind.css.cjs +2 -2
- package/dist/cjs-dev/type-utils.d.ts +0 -1
- package/dist/es/components/accordion/daikin-accordion.d.ts +0 -1
- package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +0 -1
- package/dist/es/components/breadcrumb/daikin-breadcrumb.d.ts +52 -0
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +125 -0
- package/dist/es/components/breadcrumb/index.d.ts +1 -0
- package/dist/es/components/breadcrumb/index.js +4 -0
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +62 -0
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +117 -0
- package/dist/es/components/breadcrumb-item/index.d.ts +1 -0
- package/dist/es/components/breadcrumb-item/index.js +4 -0
- package/dist/es/components/button/daikin-button.d.ts +0 -1
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +0 -1
- package/dist/es/components/icon/daikin-icon.d.ts +0 -1
- package/dist/es/components/index.d.ts +4 -0
- package/dist/es/components/index.js +8 -0
- package/dist/es/components/input-group/daikin-input-group.d.ts +0 -1
- package/dist/es/components/input-group/daikin-input-group.js +1 -1
- package/dist/es/components/notification/daikin-notification.d.ts +0 -1
- package/dist/es/components/panel-switcher/daikin-panel-switcher.d.ts +0 -1
- package/dist/es/components/progress-bar/daikin-progress-bar.d.ts +47 -0
- package/dist/es/components/progress-bar/daikin-progress-bar.js +138 -0
- package/dist/es/components/progress-bar/index.d.ts +1 -0
- package/dist/es/components/progress-bar/index.js +4 -0
- package/dist/es/components/radio/daikin-radio.d.ts +0 -1
- package/dist/es/components/tab/daikin-tab.d.ts +0 -1
- package/dist/es/components/tab-group/daikin-tab-group.d.ts +0 -1
- package/dist/es/components/text-input/daikin-text-input.d.ts +0 -1
- package/dist/es/components/textarea/daikin-textarea.d.ts +0 -1
- package/dist/es/components/toggle/daikin-toggle.d.ts +0 -1
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +76 -0
- package/dist/es/components/tooltip/daikin-tooltip.js +224 -0
- package/dist/es/components/tooltip/index.d.ts +1 -0
- package/dist/es/components/tooltip/index.js +4 -0
- package/dist/es/index.js +8 -0
- package/dist/es/is-client.d.ts +1 -0
- package/dist/es/is-client.js +5 -0
- package/dist/es/tailwind.css.js +2 -2
- package/dist/es/type-utils.d.ts +0 -1
- package/dist/es-dev/components/accordion/daikin-accordion.d.ts +0 -1
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.d.ts +0 -1
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.d.ts +52 -0
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +125 -0
- package/dist/es-dev/components/breadcrumb/index.d.ts +1 -0
- package/dist/es-dev/components/breadcrumb/index.js +4 -0
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +62 -0
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +117 -0
- package/dist/es-dev/components/breadcrumb-item/index.d.ts +1 -0
- package/dist/es-dev/components/breadcrumb-item/index.js +4 -0
- package/dist/es-dev/components/button/daikin-button.d.ts +0 -1
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +0 -1
- package/dist/es-dev/components/icon/daikin-icon.d.ts +0 -1
- package/dist/es-dev/components/index.d.ts +4 -0
- package/dist/es-dev/components/index.js +8 -0
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +0 -1
- package/dist/es-dev/components/input-group/daikin-input-group.js +1 -1
- package/dist/es-dev/components/notification/daikin-notification.d.ts +0 -1
- package/dist/es-dev/components/panel-switcher/daikin-panel-switcher.d.ts +0 -1
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.d.ts +47 -0
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +153 -0
- package/dist/es-dev/components/progress-bar/index.d.ts +1 -0
- package/dist/es-dev/components/progress-bar/index.js +4 -0
- package/dist/es-dev/components/radio/daikin-radio.d.ts +0 -1
- package/dist/es-dev/components/tab/daikin-tab.d.ts +0 -1
- package/dist/es-dev/components/tab-group/daikin-tab-group.d.ts +0 -1
- package/dist/es-dev/components/text-input/daikin-text-input.d.ts +0 -1
- package/dist/es-dev/components/textarea/daikin-textarea.d.ts +0 -1
- package/dist/es-dev/components/toggle/daikin-toggle.d.ts +0 -1
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +76 -0
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +224 -0
- package/dist/es-dev/components/tooltip/index.d.ts +1 -0
- package/dist/es-dev/components/tooltip/index.js +4 -0
- package/dist/es-dev/index.js +8 -0
- package/dist/es-dev/is-client.d.ts +1 -0
- package/dist/es-dev/is-client.js +5 -0
- package/dist/es-dev/tailwind.css.js +2 -2
- package/dist/es-dev/type-utils.d.ts +0 -1
- package/icons/status-positive.svg +15 -0
- package/package.json +46 -44
- /package/icons/{input-group-error.svg → status-negative.svg} +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
2
|
+
import { queryAssignedElements, property, customElement } from "lit/decorators.js";
|
|
3
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
4
|
+
import tailwindStyles from "../../tailwind.css.js";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
+
if (kind && result) __defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
let DaikinBreadcrumb = class extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
19
|
+
this._omit();
|
|
20
|
+
});
|
|
21
|
+
this._divWrapRef = createRef();
|
|
22
|
+
this.trailingSlash = false;
|
|
23
|
+
this.overflow = "visible";
|
|
24
|
+
this._expandedContentWidth = 0;
|
|
25
|
+
this.omitted = false;
|
|
26
|
+
}
|
|
27
|
+
get _isEllipsis() {
|
|
28
|
+
return this.overflow === "ellipsis";
|
|
29
|
+
}
|
|
30
|
+
_omit() {
|
|
31
|
+
const shouldOmit = this._isEllipsis && this.offsetWidth < this._expandedContentWidth;
|
|
32
|
+
if (this.omitted === shouldOmit) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.omitted = shouldOmit;
|
|
36
|
+
const daikinBreadCrumbItems = this._slottedDaikinBreadCrumbItems;
|
|
37
|
+
for (const [index, item] of daikinBreadCrumbItems.entries()) {
|
|
38
|
+
let mode = "normal";
|
|
39
|
+
if (shouldOmit) {
|
|
40
|
+
if (index === 0 || index >= daikinBreadCrumbItems.length - 2) {
|
|
41
|
+
continue;
|
|
42
|
+
} else if (index === 1) {
|
|
43
|
+
mode = "ellipsis";
|
|
44
|
+
} else {
|
|
45
|
+
mode = "hidden";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
item.hidden = mode === "hidden";
|
|
49
|
+
item.variant = mode === "ellipsis" ? "ellipsis" : "normal";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
_updateBreadcrumbs() {
|
|
53
|
+
const daikinBreadCrumbItems = this._slottedDaikinBreadCrumbItems;
|
|
54
|
+
for (const [index, item] of daikinBreadCrumbItems.entries()) {
|
|
55
|
+
if (index === daikinBreadCrumbItems.length - 1) {
|
|
56
|
+
item.trailingSlash = this.trailingSlash;
|
|
57
|
+
item.disabled = true;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
item.trailingSlash = true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_handleChange() {
|
|
64
|
+
this._updateBreadcrumbs();
|
|
65
|
+
}
|
|
66
|
+
_handleResizeObserver() {
|
|
67
|
+
if (this._isEllipsis) {
|
|
68
|
+
this.resizeObserver.observe(this);
|
|
69
|
+
} else {
|
|
70
|
+
this.resizeObserver.disconnect();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
return html`
|
|
75
|
+
<div class="flex gap-2" ${ref(this._divWrapRef)}>
|
|
76
|
+
<slot @slotchange=${this._handleChange}></slot>
|
|
77
|
+
</div>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
updated(changedProperties) {
|
|
81
|
+
if (changedProperties.has("trailingSlash")) {
|
|
82
|
+
this._updateBreadcrumbs();
|
|
83
|
+
}
|
|
84
|
+
if (changedProperties.has("overflow")) {
|
|
85
|
+
this._omit();
|
|
86
|
+
this._handleResizeObserver();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
firstUpdated() {
|
|
90
|
+
this._updateBreadcrumbs();
|
|
91
|
+
this._omit();
|
|
92
|
+
this._handleResizeObserver();
|
|
93
|
+
this.updateComplete.then(() => {
|
|
94
|
+
const divElement = this._divWrapRef.value;
|
|
95
|
+
if (!divElement) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this._expandedContentWidth = divElement.offsetWidth;
|
|
99
|
+
}).catch(() => {
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
DaikinBreadcrumb.styles = css`
|
|
104
|
+
${unsafeCSS(tailwindStyles)}
|
|
105
|
+
|
|
106
|
+
:host {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
__decorateClass([
|
|
112
|
+
queryAssignedElements()
|
|
113
|
+
], DaikinBreadcrumb.prototype, "_slottedDaikinBreadCrumbItems", 2);
|
|
114
|
+
__decorateClass([
|
|
115
|
+
property({ type: Boolean, reflect: true, attribute: "trailing-slash" })
|
|
116
|
+
], DaikinBreadcrumb.prototype, "trailingSlash", 2);
|
|
117
|
+
__decorateClass([
|
|
118
|
+
property({ type: String, reflect: true })
|
|
119
|
+
], DaikinBreadcrumb.prototype, "overflow", 2);
|
|
120
|
+
DaikinBreadcrumb = __decorateClass([
|
|
121
|
+
customElement("daikin-breadcrumb")
|
|
122
|
+
], DaikinBreadcrumb);
|
|
123
|
+
export {
|
|
124
|
+
DaikinBreadcrumb
|
|
125
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-breadcrumb';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { MergeVariantProps } from '../../type-utils';
|
|
3
|
+
declare const cvaLinkSlot: (props?: ({
|
|
4
|
+
variant?: "normal" | "ellipsis" | null | undefined;
|
|
5
|
+
disabled?: boolean | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
type LinkVariantProps = MergeVariantProps<typeof cvaLinkSlot>;
|
|
8
|
+
/**
|
|
9
|
+
* The `daikin-breadcrumb-item` is a component used to represent each item of the breadcrumb list, and is used as a child element of the `daikin-breadcrumb` component.
|
|
10
|
+
*
|
|
11
|
+
* Hierarchy:
|
|
12
|
+
* - `daikin-breadcrumb` > `daikin-breadcrumb-item`
|
|
13
|
+
*
|
|
14
|
+
* @slot - A slot for the breadcrumb item content.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* ```html
|
|
19
|
+
* <!-- See `daikin-breadcrumb` component for complete example. -->
|
|
20
|
+
* <daikin-breadcrumb-item href="#">
|
|
21
|
+
* Breadcrumb Item 1
|
|
22
|
+
* </daikin-breadcrumb-item>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class DaikinBreadcrumbItem extends LitElement {
|
|
26
|
+
static styles: import('lit').CSSResult;
|
|
27
|
+
/**
|
|
28
|
+
* Specify link href
|
|
29
|
+
*/
|
|
30
|
+
href: string;
|
|
31
|
+
/**
|
|
32
|
+
* Specifies the display content.
|
|
33
|
+
* If `ellipsis`, the "..." will be displayed instead of the link.
|
|
34
|
+
* Set automatically by `daikin-breadcrumb`.
|
|
35
|
+
*/
|
|
36
|
+
variant: LinkVariantProps["variant"];
|
|
37
|
+
/**
|
|
38
|
+
* Specify whether the link should be disabled
|
|
39
|
+
*/
|
|
40
|
+
disabled: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Specify the link target
|
|
43
|
+
*/
|
|
44
|
+
target: string | null;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the slash after the link should shown.
|
|
47
|
+
* Set automatically by `daikin-breadcrumb`.
|
|
48
|
+
*/
|
|
49
|
+
trailingSlash: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the link should be hidden when ellipsis mode.
|
|
52
|
+
* Set automatically by `daikin-breadcrumb`.
|
|
53
|
+
*/
|
|
54
|
+
hidden: boolean;
|
|
55
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
56
|
+
}
|
|
57
|
+
declare global {
|
|
58
|
+
interface HTMLElementTagNameMap {
|
|
59
|
+
"daikin-breadcrumb-item": DaikinBreadcrumbItem;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
3
|
+
import { property, customElement } from "lit/decorators.js";
|
|
4
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
|
+
import tailwindStyles from "../../tailwind.css.js";
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
9
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
10
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11
|
+
if (decorator = decorators[i])
|
|
12
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13
|
+
if (kind && result) __defProp(target, key, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
const cvaLinkSlot = cva(
|
|
17
|
+
[
|
|
18
|
+
"slotted:h-8",
|
|
19
|
+
"slotted:font-normal",
|
|
20
|
+
"slotted:not-italic",
|
|
21
|
+
"slotted:leading-8",
|
|
22
|
+
"slotted:text-sm",
|
|
23
|
+
"slotted:text-daikinBlue-500",
|
|
24
|
+
"slotted:outline-none",
|
|
25
|
+
"slotted:font-daikinSerif"
|
|
26
|
+
],
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
normal: [
|
|
31
|
+
"slotted:hover:text-daikinBlue-300",
|
|
32
|
+
"slotted:active:text-daikinNeutral-800",
|
|
33
|
+
"slotted-[*:focus-visible]:text-daikinBlue-700"
|
|
34
|
+
],
|
|
35
|
+
ellipsis: ["slotted:hover:text-daikinBlue-300"]
|
|
36
|
+
},
|
|
37
|
+
disabled: {
|
|
38
|
+
true: [
|
|
39
|
+
"slotted:!text-daikinNeutral-800",
|
|
40
|
+
"slotted:pointer-events-none",
|
|
41
|
+
"slotted:cursor-default",
|
|
42
|
+
"slotted-[*:focus-visible]:!text-daikinNeutral-800"
|
|
43
|
+
],
|
|
44
|
+
false: []
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
let DaikinBreadcrumbItem = class extends LitElement {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments);
|
|
52
|
+
this.href = "";
|
|
53
|
+
this.variant = "normal";
|
|
54
|
+
this.disabled = false;
|
|
55
|
+
this.target = null;
|
|
56
|
+
this.trailingSlash = false;
|
|
57
|
+
this.hidden = false;
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
const slash = this.trailingSlash ? html`<span class="text-daikinNeutral-800 font-daikinSerif">/</span>` : null;
|
|
61
|
+
return html`
|
|
62
|
+
${this.variant === "normal" ? html`<slot name="link" class=${cvaLinkSlot(this)}>
|
|
63
|
+
<a
|
|
64
|
+
href=${ifDefined(this.href)}
|
|
65
|
+
target=${// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround lit-analyzer checking
|
|
66
|
+
ifDefined(this.target)}
|
|
67
|
+
>
|
|
68
|
+
<slot></slot>
|
|
69
|
+
</a>
|
|
70
|
+
</slot>` : (
|
|
71
|
+
// Though `cvaLinkSlot` is designed for slots, it contains "& > *" selector for fallback content so it can be used here.
|
|
72
|
+
html`<span class=${cvaLinkSlot(this)} aria-label="…">
|
|
73
|
+
<span>. . .</span>
|
|
74
|
+
</span> `
|
|
75
|
+
)}
|
|
76
|
+
${slash}
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
DaikinBreadcrumbItem.styles = css`
|
|
81
|
+
${unsafeCSS(tailwindStyles)}
|
|
82
|
+
|
|
83
|
+
:host {
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 8px;
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([hidden]) {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
__decorateClass([
|
|
95
|
+
property({ type: String, reflect: true })
|
|
96
|
+
], DaikinBreadcrumbItem.prototype, "href", 2);
|
|
97
|
+
__decorateClass([
|
|
98
|
+
property({ type: String, reflect: true })
|
|
99
|
+
], DaikinBreadcrumbItem.prototype, "variant", 2);
|
|
100
|
+
__decorateClass([
|
|
101
|
+
property({ type: Boolean, reflect: true })
|
|
102
|
+
], DaikinBreadcrumbItem.prototype, "disabled", 2);
|
|
103
|
+
__decorateClass([
|
|
104
|
+
property({ type: String, reflect: true })
|
|
105
|
+
], DaikinBreadcrumbItem.prototype, "target", 2);
|
|
106
|
+
__decorateClass([
|
|
107
|
+
property({ type: Boolean, reflect: true, attribute: "trailing-slash" })
|
|
108
|
+
], DaikinBreadcrumbItem.prototype, "trailingSlash", 2);
|
|
109
|
+
__decorateClass([
|
|
110
|
+
property({ type: Boolean, reflect: true })
|
|
111
|
+
], DaikinBreadcrumbItem.prototype, "hidden", 2);
|
|
112
|
+
DaikinBreadcrumbItem = __decorateClass([
|
|
113
|
+
customElement("daikin-breadcrumb-item")
|
|
114
|
+
], DaikinBreadcrumbItem);
|
|
115
|
+
export {
|
|
116
|
+
DaikinBreadcrumbItem
|
|
117
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-breadcrumb-item';
|
|
@@ -2,7 +2,6 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
import { ARIARole } from '../../lit-analyzer-types';
|
|
3
3
|
import { MergeVariantProps } from '../../type-utils';
|
|
4
4
|
import { IconType } from '../icon/daikin-icon';
|
|
5
|
-
|
|
6
5
|
declare const cvaButton: (props?: ({
|
|
7
6
|
intent?: "primary" | "secondary" | "tertiary" | "primaryDanger" | null | undefined;
|
|
8
7
|
size?: "default" | "condensed" | null | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import { MergeVariantProps } from '../../type-utils';
|
|
3
|
-
|
|
4
3
|
declare const cvaCheckbox: (props?: ({
|
|
5
4
|
size?: "small" | "large" | null | undefined;
|
|
6
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
export * from './accordion';
|
|
2
2
|
export * from './accordion-item';
|
|
3
|
+
export * from './breadcrumb';
|
|
4
|
+
export * from './breadcrumb-item';
|
|
3
5
|
export * from './button';
|
|
4
6
|
export * from './checkbox';
|
|
5
7
|
export * from './icon';
|
|
6
8
|
export * from './input-group';
|
|
7
9
|
export * from './notification';
|
|
8
10
|
export * from './panel-switcher';
|
|
11
|
+
export * from './progress-bar';
|
|
9
12
|
export * from './radio';
|
|
10
13
|
export * from './tab';
|
|
11
14
|
export * from './tab-group';
|
|
12
15
|
export * from './text-input';
|
|
13
16
|
export * from './textarea';
|
|
14
17
|
export * from './toggle';
|
|
18
|
+
export * from './tooltip';
|
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
import { DaikinAccordion } from "./accordion/daikin-accordion.js";
|
|
2
2
|
import { DaikinAccordionItem } from "./accordion-item/daikin-accordion-item.js";
|
|
3
|
+
import { DaikinBreadcrumb } from "./breadcrumb/daikin-breadcrumb.js";
|
|
4
|
+
import { DaikinBreadcrumbItem } from "./breadcrumb-item/daikin-breadcrumb-item.js";
|
|
3
5
|
import { DaikinButton } from "./button/daikin-button.js";
|
|
4
6
|
import { DaikinCheckbox } from "./checkbox/daikin-checkbox.js";
|
|
5
7
|
import { DaikinIcon, iconList } from "./icon/daikin-icon.js";
|
|
6
8
|
import { DaikinInputGroup } from "./input-group/daikin-input-group.js";
|
|
7
9
|
import { DaikinNotification } from "./notification/daikin-notification.js";
|
|
8
10
|
import { DaikinPanelSwitcher } from "./panel-switcher/daikin-panel-switcher.js";
|
|
11
|
+
import { DaikinProgressBar } from "./progress-bar/daikin-progress-bar.js";
|
|
9
12
|
import { DaikinRadio } from "./radio/daikin-radio.js";
|
|
10
13
|
import { DaikinTab } from "./tab/daikin-tab.js";
|
|
11
14
|
import { DaikinTabGroup } from "./tab-group/daikin-tab-group.js";
|
|
12
15
|
import { DaikinTextInput } from "./text-input/daikin-text-input.js";
|
|
13
16
|
import { DaikinTextarea } from "./textarea/daikin-textarea.js";
|
|
14
17
|
import { DaikinToggle } from "./toggle/daikin-toggle.js";
|
|
18
|
+
import { DaikinTooltip } from "./tooltip/daikin-tooltip.js";
|
|
15
19
|
export {
|
|
16
20
|
DaikinAccordion,
|
|
17
21
|
DaikinAccordionItem,
|
|
22
|
+
DaikinBreadcrumb,
|
|
23
|
+
DaikinBreadcrumbItem,
|
|
18
24
|
DaikinButton,
|
|
19
25
|
DaikinCheckbox,
|
|
20
26
|
DaikinIcon,
|
|
21
27
|
DaikinInputGroup,
|
|
22
28
|
DaikinNotification,
|
|
23
29
|
DaikinPanelSwitcher,
|
|
30
|
+
DaikinProgressBar,
|
|
24
31
|
DaikinRadio,
|
|
25
32
|
DaikinTab,
|
|
26
33
|
DaikinTabGroup,
|
|
27
34
|
DaikinTextInput,
|
|
28
35
|
DaikinTextarea,
|
|
29
36
|
DaikinToggle,
|
|
37
|
+
DaikinTooltip,
|
|
30
38
|
iconList
|
|
31
39
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { DaikinTextInput } from '../text-input/daikin-text-input';
|
|
3
3
|
import { DaikinTextarea } from '../textarea/daikin-textarea';
|
|
4
|
-
|
|
5
4
|
type ControlElement = DaikinTextInput | DaikinTextarea;
|
|
6
5
|
/**
|
|
7
6
|
* The input group component serves as a wrapper for a `daikin-text-input` or `daikin-textarea` component, providing additional elements such as labels, helper texts, or a counter.
|
|
@@ -68,7 +68,7 @@ let DaikinInputGroup = class extends LitElement {
|
|
|
68
68
|
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
69
69
|
${this.helper && !this.error ? html`<span class=${inputGroupHelperClassName}>${this.helper}</span>` : null}
|
|
70
70
|
${!this.disabled && !!this.error ? html`<span
|
|
71
|
-
class="flex gap-2 text-[--input-group-border-color-error] leading-[22px] before:i-daikin-
|
|
71
|
+
class="flex gap-2 text-[--input-group-border-color-error] leading-[22px] before:i-daikin-status-negative before:block before:w-[16px] before:h-[22px]"
|
|
72
72
|
>${this.error}</span
|
|
73
73
|
>` : null}
|
|
74
74
|
</label>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { MergeVariantProps } from '../../type-utils';
|
|
3
|
-
|
|
4
3
|
declare const cvaContainer: (props?: ({
|
|
5
4
|
variant?: "toast" | "inline" | null | undefined;
|
|
6
5
|
status?: "alarm" | "information" | "negative" | "positive" | "warning" | null | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { ARIARole } from '../../lit-analyzer-types';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* The panel switcher component is a child element within the `daikin-tab-group` that controls the display of the content panels associated with each tab.
|
|
6
5
|
* When a user selects a tab, the panel switcher component ensures the corresponding content panel is shown while hiding the others.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* The progress bar component is used to visually convey the progress to the user.
|
|
4
|
+
*
|
|
5
|
+
* There are four variants of the progress bar:
|
|
6
|
+
*
|
|
7
|
+
* - "inprogress": The default variant. Use this when you know the exact progress. The length of the bar is the ratio of `value` to `max`.
|
|
8
|
+
* - "indeterminate": Use this variant when you don't know the exact progress. In this variant, the `value` is ignored and the bar always animates from left to right with a constant length.
|
|
9
|
+
* - "completed": In addition to "inprogress", a completed icon is added. In this variant, the `value` is ignored and the bar always expands to the full width.
|
|
10
|
+
* - "error": In addition to "inprogress", an error icon is added and the color becomes red. In this variant, the `value` is ignored and the bar always expands to the full width.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* ```html
|
|
15
|
+
* <daikin-progress-bar value="40" helper="Progress bar helper">
|
|
16
|
+
* Progress bar label
|
|
17
|
+
* </daikin-progress-bar>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class DaikinProgressBar extends LitElement {
|
|
21
|
+
static readonly styles: import('lit').CSSResult;
|
|
22
|
+
/**
|
|
23
|
+
* Value of the progress bar
|
|
24
|
+
*/
|
|
25
|
+
value: number;
|
|
26
|
+
/**
|
|
27
|
+
* Variant of the progress bar
|
|
28
|
+
*/
|
|
29
|
+
variant: "inprogress" | "completed" | "indeterminate" | "error";
|
|
30
|
+
/**
|
|
31
|
+
* The max value of the progress bar
|
|
32
|
+
*/
|
|
33
|
+
max: number;
|
|
34
|
+
/**
|
|
35
|
+
* Helper text
|
|
36
|
+
*/
|
|
37
|
+
helper: string;
|
|
38
|
+
private _validateProperties;
|
|
39
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
40
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
41
|
+
}
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
"daikin-progress-bar": DaikinProgressBar;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export default DaikinProgressBar;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { colorFeedbackPositive, colorFeedbackNegative } from "@daikin-oss/dds-tokens/js/daikin/Light/variables.js";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
4
|
+
import { property, customElement } from "lit/decorators.js";
|
|
5
|
+
import tailwindStyles from "../../tailwind.css.js";
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
9
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
10
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11
|
+
if (decorator = decorators[i])
|
|
12
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13
|
+
if (kind && result) __defProp(target, key, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
const cvaBar = cva(
|
|
17
|
+
[
|
|
18
|
+
"w-full",
|
|
19
|
+
"h-1",
|
|
20
|
+
"bg-daikinNeutral-200",
|
|
21
|
+
"overflow-hidden",
|
|
22
|
+
"relative",
|
|
23
|
+
"after:block",
|
|
24
|
+
"after:h-full",
|
|
25
|
+
"after:absolute",
|
|
26
|
+
"after:left-0"
|
|
27
|
+
],
|
|
28
|
+
{
|
|
29
|
+
variants: {
|
|
30
|
+
variant: {
|
|
31
|
+
inprogress: ["after:w-[--bar-width]", "after:bg-daikinBlue-500"],
|
|
32
|
+
completed: ["after:w-full", "after:bg-[--colorFeedbackPositive]"],
|
|
33
|
+
indeterminate: [
|
|
34
|
+
"after:w-1/2",
|
|
35
|
+
"after:bg-daikinBlue-500",
|
|
36
|
+
"after:animate-[progress-bar-indeterminate_1200ms_linear_infinite]"
|
|
37
|
+
],
|
|
38
|
+
error: ["after:w-full", "after:bg-[--colorFeedbackNegative]"]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
const cvaIcon = cva(["size-4"], {
|
|
44
|
+
variants: {
|
|
45
|
+
variant: {
|
|
46
|
+
inprogress: ["none"],
|
|
47
|
+
completed: ["i-daikin-status-positive"],
|
|
48
|
+
indeterminate: [],
|
|
49
|
+
error: ["i-daikin-status-negative"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const cvaHelper = cva(["text-xs", "mt-2"], {
|
|
54
|
+
variants: {
|
|
55
|
+
variant: {
|
|
56
|
+
inprogress: [],
|
|
57
|
+
completed: [],
|
|
58
|
+
indeterminate: [],
|
|
59
|
+
error: ["text-[--colorFeedbackNegative]"]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
let DaikinProgressBar = class extends LitElement {
|
|
64
|
+
constructor() {
|
|
65
|
+
super(...arguments);
|
|
66
|
+
this.value = 0;
|
|
67
|
+
this.variant = "inprogress";
|
|
68
|
+
this.max = 100;
|
|
69
|
+
this.helper = "";
|
|
70
|
+
}
|
|
71
|
+
// Validate the 'value' and 'max' properties to ensure they are valid
|
|
72
|
+
_validateProperties() {
|
|
73
|
+
if (typeof this.value !== "number" || this.value < 0) {
|
|
74
|
+
{
|
|
75
|
+
console.warn(
|
|
76
|
+
`Invalid 'value' property: ${this.value}. Falling back to 0.`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
this.value = 0;
|
|
80
|
+
}
|
|
81
|
+
if (typeof this.max !== "number" || this.max <= 0) {
|
|
82
|
+
{
|
|
83
|
+
console.warn(
|
|
84
|
+
`Invalid 'max' property: ${this.max}. Falling back to 100.`
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
this.max = 100;
|
|
88
|
+
}
|
|
89
|
+
if (this.value > this.max) {
|
|
90
|
+
{
|
|
91
|
+
console.warn(
|
|
92
|
+
`'value' property: ${this.value} exceeds 'max' property: ${this.max}. Clamping value to max.`
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
this.value = this.max;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
render() {
|
|
99
|
+
const progressRatio = Math.min(Math.max(this.value / this.max, 0), 1);
|
|
100
|
+
return html`<div class="flex flex-col w-full font-daikinSerif">
|
|
101
|
+
<div class="flex justify-between items-center mb-2.5">
|
|
102
|
+
<span class="text-sm leading-[22px] font-medium"><slot></slot></span>
|
|
103
|
+
<span class=${cvaIcon({ variant: this.variant })}></span>
|
|
104
|
+
</div>
|
|
105
|
+
<div
|
|
106
|
+
class=${cvaBar({ variant: this.variant })}
|
|
107
|
+
role="progressbar"
|
|
108
|
+
aria-label=${this.textContent ?? ""}
|
|
109
|
+
aria-valuenow=${this.value}
|
|
110
|
+
aria-valuemin="0"
|
|
111
|
+
aria-valuemax=${this.max}
|
|
112
|
+
style=${`--bar-width:${progressRatio * 100}%`}
|
|
113
|
+
></div>
|
|
114
|
+
${this.helper ? html`<span class=${cvaHelper({ variant: this.variant })}
|
|
115
|
+
>${this.helper}</span
|
|
116
|
+
>` : null}
|
|
117
|
+
</div>`;
|
|
118
|
+
}
|
|
119
|
+
updated(changedProperties) {
|
|
120
|
+
if (changedProperties.has("value") || changedProperties.has("max")) {
|
|
121
|
+
this._validateProperties();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
DaikinProgressBar.styles = css`
|
|
126
|
+
${unsafeCSS(tailwindStyles)}
|
|
127
|
+
|
|
128
|
+
:host {
|
|
129
|
+
--colorFeedbackPositive: ${unsafeCSS(colorFeedbackPositive)};
|
|
130
|
+
--colorFeedbackNegative: ${unsafeCSS(colorFeedbackNegative)};
|
|
131
|
+
|
|
132
|
+
display: block;
|
|
133
|
+
width: 100%;
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
__decorateClass([
|
|
137
|
+
property({ type: Number })
|
|
138
|
+
], DaikinProgressBar.prototype, "value", 2);
|
|
139
|
+
__decorateClass([
|
|
140
|
+
property({ type: String })
|
|
141
|
+
], DaikinProgressBar.prototype, "variant", 2);
|
|
142
|
+
__decorateClass([
|
|
143
|
+
property({ type: Number })
|
|
144
|
+
], DaikinProgressBar.prototype, "max", 2);
|
|
145
|
+
__decorateClass([
|
|
146
|
+
property({ type: String })
|
|
147
|
+
], DaikinProgressBar.prototype, "helper", 2);
|
|
148
|
+
DaikinProgressBar = __decorateClass([
|
|
149
|
+
customElement("daikin-progress-bar")
|
|
150
|
+
], DaikinProgressBar);
|
|
151
|
+
export {
|
|
152
|
+
DaikinProgressBar
|
|
153
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-progress-bar';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* The tab component is a child element within the `daikin-tab-group` component, representing a clickable button or label that users interact with to switch between different panels of content.
|
|
5
4
|
* Each tab corresponds to a specific panel and is typically labeled to indicate the content it reveals.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* The tab group component manages a group of tabs and switches the content displayed using the panel switcher component.
|
|
5
4
|
* It allows users to navigate between different sections of content by clicking on individual tabs.
|