@daikin-oss/design-system-web-components 0.0.0 → 0.2.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 +145 -88
- package/dist/cjs/colors.cjs +80 -0
- package/{lib → dist/cjs}/colors.d.ts +0 -1
- package/dist/cjs/components/button/daikin-button.cjs +197 -0
- package/dist/cjs/components/button/daikin-button.d.ts +59 -0
- package/dist/cjs/components/button/index.d.ts +1 -0
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +183 -0
- package/dist/cjs/components/checkbox/daikin-checkbox.d.ts +68 -0
- package/dist/cjs/components/checkbox/index.d.ts +1 -0
- package/dist/cjs/components/index.d.ts +7 -0
- package/dist/cjs/components/input-group/daikin-input-group.cjs +119 -0
- package/dist/cjs/components/input-group/daikin-input-group.d.ts +47 -0
- package/dist/cjs/components/input-group/index.d.ts +1 -0
- package/dist/cjs/components/notification/daikin-notification.cjs +209 -0
- package/dist/cjs/components/notification/daikin-notification.d.ts +62 -0
- package/dist/cjs/components/notification/index.d.ts +1 -0
- package/dist/cjs/components/radio/daikin-radio.cjs +150 -0
- package/dist/cjs/components/radio/daikin-radio.d.ts +66 -0
- package/dist/cjs/components/radio/index.d.ts +1 -0
- package/dist/cjs/components/text-input/daikin-text-input.cjs +137 -0
- package/dist/cjs/components/text-input/daikin-text-input.d.ts +54 -0
- package/dist/cjs/components/text-input/index.d.ts +1 -0
- package/dist/cjs/components/textarea/daikin-textarea.cjs +168 -0
- package/dist/cjs/components/textarea/daikin-textarea.d.ts +56 -0
- package/dist/cjs/components/textarea/index.d.ts +1 -0
- package/dist/cjs/constants/events.cjs +4 -0
- package/dist/cjs/constants/events.d.ts +1 -0
- package/dist/cjs/index.cjs +39 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/lit-analyzer-types.d.ts +112 -0
- package/dist/cjs/tailwind.css.cjs +6 -0
- package/dist/cjs/type-utils.d.ts +25 -0
- package/dist/{colors.d.ts → es/colors.d.ts} +0 -1
- package/dist/es/colors.js +80 -0
- package/dist/es/components/button/daikin-button.d.ts +59 -0
- package/dist/es/components/button/daikin-button.js +198 -0
- package/dist/es/components/button/index.d.ts +1 -0
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +68 -0
- package/dist/es/components/checkbox/daikin-checkbox.js +184 -0
- package/dist/es/components/checkbox/index.d.ts +1 -0
- package/dist/es/components/index.d.ts +7 -0
- package/dist/es/components/input-group/daikin-input-group.d.ts +47 -0
- package/dist/es/components/input-group/daikin-input-group.js +120 -0
- package/dist/es/components/input-group/index.d.ts +1 -0
- package/dist/es/components/notification/daikin-notification.d.ts +62 -0
- package/dist/es/components/notification/daikin-notification.js +210 -0
- package/dist/es/components/notification/index.d.ts +1 -0
- package/dist/es/components/radio/daikin-radio.d.ts +66 -0
- package/dist/es/components/radio/daikin-radio.js +151 -0
- package/dist/es/components/radio/index.d.ts +1 -0
- package/dist/es/components/text-input/daikin-text-input.d.ts +54 -0
- package/dist/es/components/text-input/daikin-text-input.js +138 -0
- package/dist/es/components/text-input/index.d.ts +1 -0
- package/dist/es/components/textarea/daikin-textarea.d.ts +56 -0
- package/dist/es/components/textarea/daikin-textarea.js +169 -0
- package/dist/es/components/textarea/index.d.ts +1 -0
- package/dist/es/constants/events.d.ts +1 -0
- package/dist/es/constants/events.js +4 -0
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.js +18 -0
- package/dist/es/lit-analyzer-types.d.ts +112 -0
- package/dist/es/tailwind.css.js +6 -0
- package/dist/es/type-utils.d.ts +25 -0
- package/icons/checkbox-checked.svg +4 -0
- package/icons/checkbox-indeterminate.svg +3 -0
- package/icons/input-group-error.svg +11 -0
- package/icons/notification-close.svg +5 -0
- package/icons/notification-status-alarm.svg +5 -0
- package/icons/notification-status-information.svg +5 -0
- package/icons/notification-status-negative.svg +3 -0
- package/icons/notification-status-positive.svg +5 -0
- package/icons/notification-status-warning.svg +5 -0
- package/icons/radio-checked.svg +4 -0
- package/icons/radio-unchecked.svg +4 -0
- package/package.json +116 -82
- package/dist/_virtual/_tslib.js +0 -31
- package/dist/_virtual/_tslib.js.map +0 -1
- package/dist/colors.d.ts.map +0 -1
- package/dist/colors.js +0 -81
- package/dist/colors.js.map +0 -1
- package/dist/components/button/button.css.js +0 -7
- package/dist/components/button/button.css.js.map +0 -1
- package/dist/components/button/daikin-button.d.ts +0 -28
- package/dist/components/button/daikin-button.d.ts.map +0 -1
- package/dist/components/button/daikin-button.js +0 -125
- package/dist/components/button/daikin-button.js.map +0 -1
- package/dist/components/button/index.d.ts +0 -2
- package/dist/components/button/index.d.ts.map +0 -1
- package/dist/components/button/index.js +0 -2
- package/dist/components/button/index.js.map +0 -1
- package/dist/components/button/stories/common.d.ts +0 -15
- package/dist/components/button/stories/common.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -2
- package/dist/components/index.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/dist/node_modules/@daikinlab/dds-tokens/build/js/DKN/Light/variables.js +0 -66
- package/dist/node_modules/@daikinlab/dds-tokens/build/js/DKN/Light/variables.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/node/css-tag.js +0 -9
- package/dist/node_modules/@lit/reactive-element/node/css-tag.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/node/decorators/custom-element.js +0 -9
- package/dist/node_modules/@lit/reactive-element/node/decorators/custom-element.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/node/decorators/property.js +0 -9
- package/dist/node_modules/@lit/reactive-element/node/decorators/property.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js +0 -6
- package/dist/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/node/reactive-element.js +0 -12
- package/dist/node_modules/@lit/reactive-element/node/reactive-element.js.map +0 -1
- package/dist/node_modules/@lit-labs/ssr-dom-shim/index.js +0 -122
- package/dist/node_modules/@lit-labs/ssr-dom-shim/index.js.map +0 -1
- package/dist/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js +0 -85
- package/dist/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js.map +0 -1
- package/dist/node_modules/@netlify/classnames-template-literals/dist/classnames-template-literals.esm.js +0 -13
- package/dist/node_modules/@netlify/classnames-template-literals/dist/classnames-template-literals.esm.js.map +0 -1
- package/dist/node_modules/lit-element/lit-element.js +0 -13
- package/dist/node_modules/lit-element/lit-element.js.map +0 -1
- package/dist/node_modules/lit-html/node/lit-html.js +0 -9
- package/dist/node_modules/lit-html/node/lit-html.js.map +0 -1
- package/dist/node_modules/style-inject/dist/style-inject.es.js +0 -29
- package/dist/node_modules/style-inject/dist/style-inject.es.js.map +0 -1
- package/dist/tailwind.css.js +0 -7
- package/dist/tailwind.css.js.map +0 -1
- package/lib/_virtual/_tslib.js +0 -33
- package/lib/_virtual/_tslib.js.map +0 -1
- package/lib/colors.d.ts.map +0 -1
- package/lib/colors.js +0 -83
- package/lib/colors.js.map +0 -1
- package/lib/components/button/button.css.js +0 -9
- package/lib/components/button/button.css.js.map +0 -1
- package/lib/components/button/daikin-button.d.ts +0 -28
- package/lib/components/button/daikin-button.d.ts.map +0 -1
- package/lib/components/button/daikin-button.js +0 -127
- package/lib/components/button/daikin-button.js.map +0 -1
- package/lib/components/button/index.d.ts +0 -2
- package/lib/components/button/index.d.ts.map +0 -1
- package/lib/components/button/index.js +0 -5
- package/lib/components/button/index.js.map +0 -1
- package/lib/components/button/stories/common.d.ts +0 -15
- package/lib/components/button/stories/common.d.ts.map +0 -1
- package/lib/components/index.d.ts +0 -2
- package/lib/components/index.d.ts.map +0 -1
- package/lib/components/index.js +0 -5
- package/lib/components/index.js.map +0 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -9
- package/lib/index.js.map +0 -1
- package/lib/node_modules/@daikinlab/dds-tokens/build/js/DKN/Light/variables.js +0 -125
- package/lib/node_modules/@daikinlab/dds-tokens/build/js/DKN/Light/variables.js.map +0 -1
- package/lib/node_modules/@lit/reactive-element/node/css-tag.js +0 -16
- package/lib/node_modules/@lit/reactive-element/node/css-tag.js.map +0 -1
- package/lib/node_modules/@lit/reactive-element/node/decorators/custom-element.js +0 -11
- package/lib/node_modules/@lit/reactive-element/node/decorators/custom-element.js.map +0 -1
- package/lib/node_modules/@lit/reactive-element/node/decorators/property.js +0 -11
- package/lib/node_modules/@lit/reactive-element/node/decorators/property.js.map +0 -1
- package/lib/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js +0 -8
- package/lib/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js.map +0 -1
- package/lib/node_modules/@lit/reactive-element/node/reactive-element.js +0 -21
- package/lib/node_modules/@lit/reactive-element/node/reactive-element.js.map +0 -1
- package/lib/node_modules/@lit-labs/ssr-dom-shim/index.js +0 -126
- package/lib/node_modules/@lit-labs/ssr-dom-shim/index.js.map +0 -1
- package/lib/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js +0 -87
- package/lib/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js.map +0 -1
- package/lib/node_modules/@netlify/classnames-template-literals/dist/classnames-template-literals.esm.js +0 -15
- package/lib/node_modules/@netlify/classnames-template-literals/dist/classnames-template-literals.esm.js.map +0 -1
- package/lib/node_modules/lit-element/lit-element.js +0 -20
- package/lib/node_modules/lit-element/lit-element.js.map +0 -1
- package/lib/node_modules/lit-html/node/lit-html.js +0 -14
- package/lib/node_modules/lit-html/node/lit-html.js.map +0 -1
- package/lib/node_modules/style-inject/dist/style-inject.es.js +0 -31
- package/lib/node_modules/style-inject/dist/style-inject.es.js.map +0 -1
- package/lib/tailwind.css.js +0 -9
- package/lib/tailwind.css.js.map +0 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const classVarianceAuthority = require("class-variance-authority");
|
|
4
|
+
const lit = require("lit");
|
|
5
|
+
const decorators_js = require("lit/decorators.js");
|
|
6
|
+
const tailwind = require("../../tailwind.css.cjs");
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12
|
+
if (decorator = decorators[i])
|
|
13
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
|
+
if (kind && result) __defProp(target, key, result);
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
17
|
+
const cvaCheckbox = classVarianceAuthority.cva(
|
|
18
|
+
[
|
|
19
|
+
"appearance-none",
|
|
20
|
+
"inline-block",
|
|
21
|
+
"relative",
|
|
22
|
+
"rounded-sm",
|
|
23
|
+
"border-solid",
|
|
24
|
+
"border-2",
|
|
25
|
+
"after:absolute",
|
|
26
|
+
"after:text-white",
|
|
27
|
+
"checked:after:i-daikin-checkbox-checked",
|
|
28
|
+
"indeterminate:after:i-daikin-checkbox-indeterminate",
|
|
29
|
+
"focus-visible:outline-none",
|
|
30
|
+
"border-daikinNeutral-400",
|
|
31
|
+
"enabled:indeterminate:border-daikinBlue-600",
|
|
32
|
+
"enabled:indeterminate:bg-daikinBlue-600",
|
|
33
|
+
"enabled:checked:border-daikinBlue-600",
|
|
34
|
+
"enabled:checked:bg-daikinBlue-600",
|
|
35
|
+
"aria-controllable:focus-visible:border-daikinBlue-700",
|
|
36
|
+
"aria-controllable:hover:border-daikinBlue-300",
|
|
37
|
+
"aria-controllable:active:border-daikinBlue-600",
|
|
38
|
+
"aria-controllable:checked:focus-visible:border-daikinBlue-700",
|
|
39
|
+
"aria-controllable:checked:focus-visible:border-daikinBlue-700",
|
|
40
|
+
"aria-controllable:checked:focus-visible:bg-daikinBlue-700",
|
|
41
|
+
"aria-controllable:checked:focus-visible:bg-daikinBlue-700",
|
|
42
|
+
"aria-controllable:checked:hover:border-daikinBlue-300",
|
|
43
|
+
"aria-controllable:checked:hover:bg-daikinBlue-300",
|
|
44
|
+
"aria-controllable:checked:active:border-daikinBlue-600",
|
|
45
|
+
"aria-controllable:checked:active:bg-daikinBlue-600",
|
|
46
|
+
"aria-controllable:indeterminate:active:border-daikinBlue-600",
|
|
47
|
+
"aria-controllable:indeterminate:active:bg-daikinBlue-600",
|
|
48
|
+
"aria-controllable:indeterminate:hover:border-daikinBlue-300",
|
|
49
|
+
"aria-controllable:indeterminate:hover:bg-daikinBlue-300",
|
|
50
|
+
"aria-controllable:indeterminate:focus-visible:border-daikinBlue-700",
|
|
51
|
+
"aria-controllable:indeterminate:focus-visible:bg-daikinBlue-700",
|
|
52
|
+
"disabled:border-daikinNeutral-200",
|
|
53
|
+
"disabled:bg-white",
|
|
54
|
+
"disabled:indeterminate:bg-daikinNeutral-200",
|
|
55
|
+
"disabled:checked:bg-daikinNeutral-200"
|
|
56
|
+
],
|
|
57
|
+
{
|
|
58
|
+
variants: {
|
|
59
|
+
size: {
|
|
60
|
+
small: ["w-[18px]", "h-[18px]"],
|
|
61
|
+
large: ["w-5", "h-5"]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
const cvaLabel = classVarianceAuthority.cva(
|
|
67
|
+
["leading-8", "not-italic", "font-normal", "align-middle"],
|
|
68
|
+
{
|
|
69
|
+
variants: {
|
|
70
|
+
size: {
|
|
71
|
+
small: ["text-sm"],
|
|
72
|
+
large: ["text-base"]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
defaultVariants: {
|
|
76
|
+
size: "small"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
exports.DaikinCheckbox = class DaikinCheckbox extends lit.LitElement {
|
|
81
|
+
constructor() {
|
|
82
|
+
super(...arguments);
|
|
83
|
+
this._internals = this.attachInternals();
|
|
84
|
+
this.label = "";
|
|
85
|
+
this.size = "small";
|
|
86
|
+
this.labelPosition = "right";
|
|
87
|
+
this.disabled = false;
|
|
88
|
+
this.readonly = false;
|
|
89
|
+
this.checkState = "unchecked";
|
|
90
|
+
this.name = "";
|
|
91
|
+
this.value = "";
|
|
92
|
+
this.error = false;
|
|
93
|
+
}
|
|
94
|
+
_handleClick(event) {
|
|
95
|
+
if (this.readonly || this.disabled) {
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
_updateFormValue() {
|
|
100
|
+
this._internals.setFormValue(this.checked ? this.value : null);
|
|
101
|
+
}
|
|
102
|
+
get checked() {
|
|
103
|
+
return this.checkState === "checked";
|
|
104
|
+
}
|
|
105
|
+
_handleChange(event) {
|
|
106
|
+
if (!this._input) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this.checkState = this._input.checked ? "checked" : "unchecked";
|
|
110
|
+
this._updateFormValue();
|
|
111
|
+
this.dispatchEvent(new Event("change", event));
|
|
112
|
+
}
|
|
113
|
+
render() {
|
|
114
|
+
const checkboxClassName = cvaCheckbox({ size: this.size });
|
|
115
|
+
const labelClassName = cvaLabel({ size: this.size });
|
|
116
|
+
const isIndeterminate = this.checkState === "indeterminate";
|
|
117
|
+
const labelText = this.label ? lit.html`<span class=${labelClassName}>${this.label}</span>` : lit.html``;
|
|
118
|
+
const inputTag = lit.html`<input
|
|
119
|
+
class=${checkboxClassName}
|
|
120
|
+
type="checkbox"
|
|
121
|
+
name=${this.name}
|
|
122
|
+
value=${this.value}
|
|
123
|
+
aria-readonly=${this.readonly}
|
|
124
|
+
.indeterminate=${isIndeterminate}
|
|
125
|
+
.checked=${this.checked}
|
|
126
|
+
?readonly=${this.readonly}
|
|
127
|
+
?disabled=${this.disabled}
|
|
128
|
+
@change=${this._handleChange}
|
|
129
|
+
@click=${this._handleClick}
|
|
130
|
+
/>`;
|
|
131
|
+
const content = this.labelPosition === "left" ? lit.html`${labelText}${inputTag}` : lit.html`${inputTag}${labelText}`;
|
|
132
|
+
return lit.html`<label
|
|
133
|
+
class="inline-flex gap-[10px] items-center font-daikinSerif"
|
|
134
|
+
>${content}</label
|
|
135
|
+
>`;
|
|
136
|
+
}
|
|
137
|
+
updated(changedProperties) {
|
|
138
|
+
if (changedProperties.has("checkState")) {
|
|
139
|
+
this._updateFormValue();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
exports.DaikinCheckbox.styles = lit.css`
|
|
144
|
+
${lit.unsafeCSS(tailwind.default)}
|
|
145
|
+
|
|
146
|
+
:host {
|
|
147
|
+
display: inline-block;
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
exports.DaikinCheckbox.formAssociated = true;
|
|
151
|
+
__decorateClass([
|
|
152
|
+
decorators_js.query("input")
|
|
153
|
+
], exports.DaikinCheckbox.prototype, "_input", 2);
|
|
154
|
+
__decorateClass([
|
|
155
|
+
decorators_js.property({ type: String })
|
|
156
|
+
], exports.DaikinCheckbox.prototype, "label", 2);
|
|
157
|
+
__decorateClass([
|
|
158
|
+
decorators_js.property({ type: String })
|
|
159
|
+
], exports.DaikinCheckbox.prototype, "size", 2);
|
|
160
|
+
__decorateClass([
|
|
161
|
+
decorators_js.property({ type: String, attribute: "label-position" })
|
|
162
|
+
], exports.DaikinCheckbox.prototype, "labelPosition", 2);
|
|
163
|
+
__decorateClass([
|
|
164
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
165
|
+
], exports.DaikinCheckbox.prototype, "disabled", 2);
|
|
166
|
+
__decorateClass([
|
|
167
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
168
|
+
], exports.DaikinCheckbox.prototype, "readonly", 2);
|
|
169
|
+
__decorateClass([
|
|
170
|
+
decorators_js.property({ type: String, reflect: true, attribute: "check-state" })
|
|
171
|
+
], exports.DaikinCheckbox.prototype, "checkState", 2);
|
|
172
|
+
__decorateClass([
|
|
173
|
+
decorators_js.property({ type: String, reflect: true })
|
|
174
|
+
], exports.DaikinCheckbox.prototype, "name", 2);
|
|
175
|
+
__decorateClass([
|
|
176
|
+
decorators_js.property({ type: String, reflect: true })
|
|
177
|
+
], exports.DaikinCheckbox.prototype, "value", 2);
|
|
178
|
+
__decorateClass([
|
|
179
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
180
|
+
], exports.DaikinCheckbox.prototype, "error", 2);
|
|
181
|
+
exports.DaikinCheckbox = __decorateClass([
|
|
182
|
+
decorators_js.customElement("daikin-checkbox")
|
|
183
|
+
], exports.DaikinCheckbox);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { MergeVariantProps } from '../../type-utils';
|
|
3
|
+
|
|
4
|
+
declare const cvaCheckbox: (props?: ({
|
|
5
|
+
size?: "small" | "large" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
declare const cvaLabel: (props?: ({
|
|
8
|
+
size?: "small" | "large" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
type CheckboxVariantProps = MergeVariantProps<typeof cvaCheckbox | typeof cvaLabel>;
|
|
11
|
+
/**
|
|
12
|
+
* Primary UI component for user interaction
|
|
13
|
+
*/
|
|
14
|
+
export declare class DaikinCheckbox extends LitElement {
|
|
15
|
+
static readonly styles: import('lit').CSSResult;
|
|
16
|
+
private _handleClick;
|
|
17
|
+
static readonly formAssociated = true;
|
|
18
|
+
private _internals;
|
|
19
|
+
private _updateFormValue;
|
|
20
|
+
private _input;
|
|
21
|
+
get checked(): boolean;
|
|
22
|
+
private _handleChange;
|
|
23
|
+
/**
|
|
24
|
+
* Specify the label text for check box
|
|
25
|
+
*/
|
|
26
|
+
label: string;
|
|
27
|
+
/**
|
|
28
|
+
* Specify the component size
|
|
29
|
+
*/
|
|
30
|
+
size: CheckboxVariantProps["size"];
|
|
31
|
+
/**
|
|
32
|
+
* Specify the label position
|
|
33
|
+
* when `left` the label will be in left of checkbox, when `right` label will be in right of checkbox
|
|
34
|
+
*/
|
|
35
|
+
labelPosition: "left" | "right";
|
|
36
|
+
/**
|
|
37
|
+
* Specify whether the Checkbox should be disabled
|
|
38
|
+
*/
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Specify whether the checkbox is read only
|
|
42
|
+
*/
|
|
43
|
+
readonly: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Specify whether the checkbox is be checked
|
|
46
|
+
*/
|
|
47
|
+
checkState: "unchecked" | "indeterminate" | "checked";
|
|
48
|
+
/**
|
|
49
|
+
* The form name.
|
|
50
|
+
*/
|
|
51
|
+
name: string;
|
|
52
|
+
/**
|
|
53
|
+
* The value.
|
|
54
|
+
*/
|
|
55
|
+
value: string;
|
|
56
|
+
/**
|
|
57
|
+
* Specify whether the Checkbox is in a error state
|
|
58
|
+
*/
|
|
59
|
+
error: boolean;
|
|
60
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
61
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
62
|
+
}
|
|
63
|
+
declare global {
|
|
64
|
+
interface HTMLElementTagNameMap {
|
|
65
|
+
"daikin-checkbox": DaikinCheckbox;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-checkbox';
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const variables_js = require("@daikin-oss/dds-tokens/js/daikin/Light/variables.js");
|
|
4
|
+
const classVarianceAuthority = require("class-variance-authority");
|
|
5
|
+
const lit = require("lit");
|
|
6
|
+
const decorators_js = require("lit/decorators.js");
|
|
7
|
+
const tailwind = require("../../tailwind.css.cjs");
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result) __defProp(target, key, result);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
const cvaLabel = classVarianceAuthority.cva(["text-base", "font-bold"], {
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
enabled: ["text-daikinNeutral-800"],
|
|
22
|
+
disabled: ["text-daikinNeutral-200"]
|
|
23
|
+
},
|
|
24
|
+
required: {
|
|
25
|
+
optional: [],
|
|
26
|
+
required: ["after:content-['*']", "after:ml-[2px]"]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const cvaHelper = classVarianceAuthority.cva(["h-[22px]", "text-xs"], {
|
|
31
|
+
variants: {
|
|
32
|
+
variant: {
|
|
33
|
+
enabled: ["text-daikinNeutral-800"],
|
|
34
|
+
disabled: ["text-daikinNeutral-200"]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
exports.DaikinInputGroup = class DaikinInputGroup extends lit.LitElement {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
this.disabled = false;
|
|
42
|
+
this.required = false;
|
|
43
|
+
this.error = "";
|
|
44
|
+
this.textareaCounter = false;
|
|
45
|
+
}
|
|
46
|
+
_handleSlotChange() {
|
|
47
|
+
this._reflectSlotProperties();
|
|
48
|
+
}
|
|
49
|
+
_reflectSlotProperties() {
|
|
50
|
+
const isError = !this.disabled && !!this.error;
|
|
51
|
+
for (const control of this._controls) {
|
|
52
|
+
control.disabled = !!this.disabled;
|
|
53
|
+
control.error = isError;
|
|
54
|
+
}
|
|
55
|
+
for (const item of this._textareas) {
|
|
56
|
+
item.counter = this.textareaCounter;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
const inputGroupLabelClassName = cvaLabel({
|
|
61
|
+
variant: this.disabled ? "disabled" : "enabled",
|
|
62
|
+
required: this.required ? "required" : "optional"
|
|
63
|
+
});
|
|
64
|
+
const inputGroupHelperClassName = cvaHelper({
|
|
65
|
+
variant: this.disabled ? "disabled" : "enabled"
|
|
66
|
+
});
|
|
67
|
+
return lit.html`<fieldset class="content" ?disabled=${this.disabled}>
|
|
68
|
+
<label class="flex flex-col justify-center w-max gap-1 font-daikinSerif">
|
|
69
|
+
${this.label ? lit.html`<span class=${inputGroupLabelClassName}>${this.label}</span>` : null}
|
|
70
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
71
|
+
${this.helper && !this.error ? lit.html`<span class=${inputGroupHelperClassName}>${this.helper}</span>` : null}
|
|
72
|
+
${!this.disabled && !!this.error ? lit.html`<span
|
|
73
|
+
class="flex gap-2 text-[--input-group-border-color-error] leading-[22px] before:i-daikin-input-group-error before:block before:w-[16px] before:h-[22px]"
|
|
74
|
+
>${this.error}</span
|
|
75
|
+
>` : null}
|
|
76
|
+
</label>
|
|
77
|
+
</fieldset>`;
|
|
78
|
+
}
|
|
79
|
+
updated() {
|
|
80
|
+
this._reflectSlotProperties();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.DaikinInputGroup.styles = lit.css`
|
|
84
|
+
${lit.unsafeCSS(tailwind.default)}
|
|
85
|
+
|
|
86
|
+
:host {
|
|
87
|
+
--input-group-border-color-error: ${lit.unsafeCSS(variables_js.colorFeedbackNegative)};
|
|
88
|
+
|
|
89
|
+
display: block;
|
|
90
|
+
width: max-content;
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
__decorateClass([
|
|
94
|
+
decorators_js.property({ type: String })
|
|
95
|
+
], exports.DaikinInputGroup.prototype, "label", 2);
|
|
96
|
+
__decorateClass([
|
|
97
|
+
decorators_js.property({ type: String })
|
|
98
|
+
], exports.DaikinInputGroup.prototype, "helper", 2);
|
|
99
|
+
__decorateClass([
|
|
100
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
101
|
+
], exports.DaikinInputGroup.prototype, "disabled", 2);
|
|
102
|
+
__decorateClass([
|
|
103
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
104
|
+
], exports.DaikinInputGroup.prototype, "required", 2);
|
|
105
|
+
__decorateClass([
|
|
106
|
+
decorators_js.property({ type: String, reflect: true })
|
|
107
|
+
], exports.DaikinInputGroup.prototype, "error", 2);
|
|
108
|
+
__decorateClass([
|
|
109
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
110
|
+
], exports.DaikinInputGroup.prototype, "textareaCounter", 2);
|
|
111
|
+
__decorateClass([
|
|
112
|
+
decorators_js.queryAssignedElements({ selector: "daikin-textarea" })
|
|
113
|
+
], exports.DaikinInputGroup.prototype, "_textareas", 2);
|
|
114
|
+
__decorateClass([
|
|
115
|
+
decorators_js.queryAssignedElements({ selector: "daikin-text-input,daikin-textarea" })
|
|
116
|
+
], exports.DaikinInputGroup.prototype, "_controls", 2);
|
|
117
|
+
exports.DaikinInputGroup = __decorateClass([
|
|
118
|
+
decorators_js.customElement("daikin-input-group")
|
|
119
|
+
], exports.DaikinInputGroup);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { DaikinTextInput } from '../text-input/daikin-text-input';
|
|
3
|
+
import { DaikinTextarea } from '../textarea/daikin-textarea';
|
|
4
|
+
|
|
5
|
+
type ControlElement = DaikinTextInput | DaikinTextarea;
|
|
6
|
+
/**
|
|
7
|
+
* Primary UI component for user interaction
|
|
8
|
+
*/
|
|
9
|
+
export declare class DaikinInputGroup extends LitElement {
|
|
10
|
+
static readonly styles: import('lit').CSSResult;
|
|
11
|
+
/**
|
|
12
|
+
* Label text to place at the top of the field
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Helper text to place at the bottom of the field. In error conditions, this text is hidden.
|
|
17
|
+
*/
|
|
18
|
+
helper?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the field is disabled. Reflected in the `disabled` property of the input in the slot.
|
|
21
|
+
*/
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the field is required. An additional star mark will be added if `true`.
|
|
25
|
+
*/
|
|
26
|
+
required: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Error text to place at the bottom of the field. If specified, sets the `error` property of the element in the slot to `true`. Ignored if the `disabled` is `true`.
|
|
29
|
+
*/
|
|
30
|
+
error: string;
|
|
31
|
+
/**
|
|
32
|
+
* Whether to display the counter in the Textarea
|
|
33
|
+
*/
|
|
34
|
+
textareaCounter: boolean;
|
|
35
|
+
_textareas: DaikinTextarea[];
|
|
36
|
+
_controls: ControlElement[];
|
|
37
|
+
private _handleSlotChange;
|
|
38
|
+
private _reflectSlotProperties;
|
|
39
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
40
|
+
updated(): void;
|
|
41
|
+
}
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
"daikin-input-group": DaikinInputGroup;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export default DaikinInputGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-input-group';
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const variables_js = require("@daikin-oss/dds-tokens/js/daikin/Light/variables.js");
|
|
4
|
+
const classVarianceAuthority = require("class-variance-authority");
|
|
5
|
+
const lit = require("lit");
|
|
6
|
+
const decorators_js = require("lit/decorators.js");
|
|
7
|
+
const events = require("../../constants/events.cjs");
|
|
8
|
+
const tailwind = require("../../tailwind.css.cjs");
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
12
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
13
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
14
|
+
if (decorator = decorators[i])
|
|
15
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
16
|
+
if (kind && result) __defProp(target, key, result);
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
const cvaContainer = classVarianceAuthority.cva(
|
|
20
|
+
["flex", "box-border", "bg-white", "overflow-hidden", "font-daikinSerif"],
|
|
21
|
+
{
|
|
22
|
+
variants: {
|
|
23
|
+
variant: {
|
|
24
|
+
toast: [
|
|
25
|
+
"border-2",
|
|
26
|
+
"border-solid",
|
|
27
|
+
"rounded-lg",
|
|
28
|
+
"shadow-notification"
|
|
29
|
+
],
|
|
30
|
+
inline: []
|
|
31
|
+
},
|
|
32
|
+
status: {
|
|
33
|
+
positive: ["border-[--colorFeedbackPositive]"],
|
|
34
|
+
negative: ["border-[--colorFeedbackNegative]"],
|
|
35
|
+
warning: ["border-[--colorFeedbackWarning]"],
|
|
36
|
+
alarm: ["border-[--colorFeedbackAlarm]"],
|
|
37
|
+
information: ["border-[--colorFeedbackInformation]"]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "toast",
|
|
42
|
+
status: "positive"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
const cvaIconContainer = classVarianceAuthority.cva(
|
|
47
|
+
["flex-none", "flex", "justify-center", "items-center", "w-[44px]"],
|
|
48
|
+
{
|
|
49
|
+
variants: {
|
|
50
|
+
status: {
|
|
51
|
+
positive: ["bg-[--colorFeedbackPositive]"],
|
|
52
|
+
negative: ["bg-[--colorFeedbackNegative]"],
|
|
53
|
+
warning: ["bg-[--colorFeedbackWarning]"],
|
|
54
|
+
alarm: ["bg-[--colorFeedbackAlarm]"],
|
|
55
|
+
information: ["bg-[--colorFeedbackInformation]"]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
defaultVariants: {
|
|
59
|
+
status: "positive"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
const cvaIcon = classVarianceAuthority.cva(
|
|
64
|
+
[
|
|
65
|
+
"flex",
|
|
66
|
+
"justify-center",
|
|
67
|
+
"items-center",
|
|
68
|
+
"w-[24px]",
|
|
69
|
+
"h-[24px]",
|
|
70
|
+
"flex-none",
|
|
71
|
+
"text-white"
|
|
72
|
+
],
|
|
73
|
+
{
|
|
74
|
+
variants: {
|
|
75
|
+
status: {
|
|
76
|
+
positive: ["i-daikin-notification-status-positive"],
|
|
77
|
+
negative: ["i-daikin-notification-status-negative"],
|
|
78
|
+
warning: ["i-daikin-notification-status-warning"],
|
|
79
|
+
alarm: ["i-daikin-notification-status-alarm"],
|
|
80
|
+
information: ["i-daikin-notification-status-information"]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
defaultVariants: {
|
|
84
|
+
status: "positive"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
const cvaContent = classVarianceAuthority.cva(
|
|
89
|
+
["flex", "justify-center", "gap-1", "w-fit", "flex-none"],
|
|
90
|
+
{
|
|
91
|
+
variants: {
|
|
92
|
+
line: {
|
|
93
|
+
single: ["items-center", "flex-row"],
|
|
94
|
+
multi: ["items-start", "flex-col"]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
defaultVariants: {
|
|
98
|
+
line: "single"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
exports.DaikinNotification = class DaikinNotification extends lit.LitElement {
|
|
103
|
+
constructor() {
|
|
104
|
+
super(...arguments);
|
|
105
|
+
this.title = "";
|
|
106
|
+
this.description = "";
|
|
107
|
+
this.variant = "toast";
|
|
108
|
+
this.status = "positive";
|
|
109
|
+
this.line = "single";
|
|
110
|
+
this.open = false;
|
|
111
|
+
this.closeButton = false;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Call the event registered in "close"
|
|
115
|
+
*/
|
|
116
|
+
_handleClickClose() {
|
|
117
|
+
const event = new CustomEvent(events.EVENT_CLOSE);
|
|
118
|
+
this.open = false;
|
|
119
|
+
this.dispatchEvent(event);
|
|
120
|
+
}
|
|
121
|
+
render() {
|
|
122
|
+
return this.open ? lit.html`<aside
|
|
123
|
+
class=${cvaContainer({
|
|
124
|
+
variant: this.variant,
|
|
125
|
+
status: this.status
|
|
126
|
+
})}
|
|
127
|
+
>
|
|
128
|
+
<div
|
|
129
|
+
class=${cvaIconContainer({
|
|
130
|
+
status: this.status
|
|
131
|
+
})}
|
|
132
|
+
>
|
|
133
|
+
<span
|
|
134
|
+
class=${cvaIcon({
|
|
135
|
+
status: this.status
|
|
136
|
+
})}
|
|
137
|
+
></span>
|
|
138
|
+
</div>
|
|
139
|
+
<div
|
|
140
|
+
class="flex justify-between items-center gap-5 p-5 flex-[1_0_auto]"
|
|
141
|
+
>
|
|
142
|
+
<div
|
|
143
|
+
class=${cvaContent({
|
|
144
|
+
line: this.line
|
|
145
|
+
})}
|
|
146
|
+
>
|
|
147
|
+
${this.title && lit.html`<header class="text-[18px] font-bold flex-none">
|
|
148
|
+
${this.title}
|
|
149
|
+
</header>`}
|
|
150
|
+
<p class="text-[18px] flex-none">${this.description}</p>
|
|
151
|
+
</div>
|
|
152
|
+
${this.closeButton ? lit.html`
|
|
153
|
+
<div class="flex items-center gap-5">
|
|
154
|
+
<button
|
|
155
|
+
aria-label="Close"
|
|
156
|
+
class="relative flex w-5 h-5 text-daikinNeutral-500 i-daikin-notification-close"
|
|
157
|
+
@click=${() => this._handleClickClose()}
|
|
158
|
+
></button>
|
|
159
|
+
</div>
|
|
160
|
+
` : null}
|
|
161
|
+
</div>
|
|
162
|
+
</aside>` : null;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
exports.DaikinNotification.styles = lit.css`
|
|
166
|
+
${lit.unsafeCSS(tailwind.default)}
|
|
167
|
+
|
|
168
|
+
:host {
|
|
169
|
+
--colorFeedbackPositive: ${lit.unsafeCSS(variables_js.colorFeedbackPositive)};
|
|
170
|
+
--colorFeedbackWarning: ${lit.unsafeCSS(variables_js.colorFeedbackWarning)};
|
|
171
|
+
--colorFeedbackNegative: ${lit.unsafeCSS(variables_js.colorFeedbackNegative)};
|
|
172
|
+
--colorFeedbackAlarm: #f68c54;
|
|
173
|
+
--colorFeedbackInformation: #0097e0;
|
|
174
|
+
|
|
175
|
+
display: block;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:host([variant="toast"]) {
|
|
179
|
+
width: max-content;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
:host([variant="inline"]) {
|
|
183
|
+
width: 100%;
|
|
184
|
+
}
|
|
185
|
+
`;
|
|
186
|
+
__decorateClass([
|
|
187
|
+
decorators_js.property({ type: String })
|
|
188
|
+
], exports.DaikinNotification.prototype, "title", 2);
|
|
189
|
+
__decorateClass([
|
|
190
|
+
decorators_js.property({ type: String })
|
|
191
|
+
], exports.DaikinNotification.prototype, "description", 2);
|
|
192
|
+
__decorateClass([
|
|
193
|
+
decorators_js.property({ type: String, reflect: true })
|
|
194
|
+
], exports.DaikinNotification.prototype, "variant", 2);
|
|
195
|
+
__decorateClass([
|
|
196
|
+
decorators_js.property({ type: String })
|
|
197
|
+
], exports.DaikinNotification.prototype, "status", 2);
|
|
198
|
+
__decorateClass([
|
|
199
|
+
decorators_js.property({ type: String })
|
|
200
|
+
], exports.DaikinNotification.prototype, "line", 2);
|
|
201
|
+
__decorateClass([
|
|
202
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
203
|
+
], exports.DaikinNotification.prototype, "open", 2);
|
|
204
|
+
__decorateClass([
|
|
205
|
+
decorators_js.property({ type: Boolean })
|
|
206
|
+
], exports.DaikinNotification.prototype, "closeButton", 2);
|
|
207
|
+
exports.DaikinNotification = __decorateClass([
|
|
208
|
+
decorators_js.customElement("daikin-notification")
|
|
209
|
+
], exports.DaikinNotification);
|