@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,62 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { MergeVariantProps } from '../../type-utils';
|
|
3
|
+
|
|
4
|
+
declare const cvaContainer: (props?: ({
|
|
5
|
+
variant?: "toast" | "inline" | null | undefined;
|
|
6
|
+
status?: "positive" | "negative" | "warning" | "alarm" | "information" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
declare const cvaIconContainer: (props?: ({
|
|
9
|
+
status?: "positive" | "negative" | "warning" | "alarm" | "information" | null | undefined;
|
|
10
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
11
|
+
declare const cvaIcon: (props?: ({
|
|
12
|
+
status?: "positive" | "negative" | "warning" | "alarm" | "information" | null | undefined;
|
|
13
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
14
|
+
declare const cvaContent: (props?: ({
|
|
15
|
+
line?: "single" | "multi" | null | undefined;
|
|
16
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
17
|
+
type NotificationVariantProps = MergeVariantProps<typeof cvaContainer | typeof cvaIconContainer | typeof cvaIcon | typeof cvaContent>;
|
|
18
|
+
/**
|
|
19
|
+
* Primary UI component for user interaction
|
|
20
|
+
*/
|
|
21
|
+
export declare class DaikinNotification extends LitElement {
|
|
22
|
+
static readonly styles: import('lit').CSSResult;
|
|
23
|
+
/**
|
|
24
|
+
* Title text
|
|
25
|
+
*/
|
|
26
|
+
title: string;
|
|
27
|
+
/**
|
|
28
|
+
* Description text
|
|
29
|
+
*/
|
|
30
|
+
description: string;
|
|
31
|
+
/**
|
|
32
|
+
* Type of notification
|
|
33
|
+
*/
|
|
34
|
+
variant: NotificationVariantProps["variant"];
|
|
35
|
+
/**
|
|
36
|
+
* Status of notification
|
|
37
|
+
*/
|
|
38
|
+
status: NotificationVariantProps["status"];
|
|
39
|
+
/**
|
|
40
|
+
* Display in single or multiple lines
|
|
41
|
+
*/
|
|
42
|
+
line: NotificationVariantProps["line"];
|
|
43
|
+
/**
|
|
44
|
+
* Whether the component is open
|
|
45
|
+
*/
|
|
46
|
+
open: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether to display the close button
|
|
49
|
+
*/
|
|
50
|
+
closeButton: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Call the event registered in "close"
|
|
53
|
+
*/
|
|
54
|
+
private _handleClickClose;
|
|
55
|
+
render(): import('lit-html').TemplateResult<1> | null;
|
|
56
|
+
}
|
|
57
|
+
declare global {
|
|
58
|
+
interface HTMLElementTagNameMap {
|
|
59
|
+
"daikin-notification": DaikinNotification;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-notification';
|
|
@@ -0,0 +1,150 @@
|
|
|
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 cvaRadio = classVarianceAuthority.cva(
|
|
18
|
+
[
|
|
19
|
+
"appearance-none",
|
|
20
|
+
"relative",
|
|
21
|
+
"after:absolute",
|
|
22
|
+
"after:i-daikin-radio-unchecked",
|
|
23
|
+
"checked:after:i-daikin-radio-checked",
|
|
24
|
+
"enabled:after:text-[#8C8C8C]",
|
|
25
|
+
"enabled:checked:after:text-daikinBlue-500",
|
|
26
|
+
"aria-controllable:hover:after:i-daikin-radio-checked",
|
|
27
|
+
"aria-controllable:hover:after:text-daikinBlue-300",
|
|
28
|
+
"aria-controllable:active:after:i-daikin-radio-checked",
|
|
29
|
+
"aria-controllable:active:after:text-daikinBlue-500",
|
|
30
|
+
"focus-visible:outline-none",
|
|
31
|
+
"aria-controllable:focus-visible:after:i-daikin-radio-unchecked",
|
|
32
|
+
"aria-controllable:focus-visible:checked:after:i-daikin-radio-checked",
|
|
33
|
+
"aria-controllable:focus-visible:after:text-daikinBlue-700",
|
|
34
|
+
"disabled:after:text-daikinNeutral-200"
|
|
35
|
+
],
|
|
36
|
+
{
|
|
37
|
+
variants: {
|
|
38
|
+
size: {
|
|
39
|
+
small: ["w-[14px]", "h-[14px]"],
|
|
40
|
+
large: ["w-4", "h-4"]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
const cvaLabel = classVarianceAuthority.cva(
|
|
46
|
+
["leading-8", "not-italic", "font-normal", "align-middle"],
|
|
47
|
+
{
|
|
48
|
+
variants: {
|
|
49
|
+
size: {
|
|
50
|
+
small: ["text-sm"],
|
|
51
|
+
large: ["text-base"]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
exports.DaikinRadio = class DaikinRadio extends lit.LitElement {
|
|
57
|
+
constructor() {
|
|
58
|
+
super(...arguments);
|
|
59
|
+
this._internals = this.attachInternals();
|
|
60
|
+
this.label = "";
|
|
61
|
+
this.size = "small";
|
|
62
|
+
this.labelPosition = "right";
|
|
63
|
+
this.disabled = false;
|
|
64
|
+
this.readonly = false;
|
|
65
|
+
this.checked = false;
|
|
66
|
+
this.name = "";
|
|
67
|
+
this.value = "";
|
|
68
|
+
this.error = false;
|
|
69
|
+
}
|
|
70
|
+
_handleClick(event) {
|
|
71
|
+
if (this.readonly || this.disabled) {
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
_updateFormValue() {
|
|
76
|
+
this._internals.setFormValue(this.checked ? this.value : null);
|
|
77
|
+
}
|
|
78
|
+
updated(changedProperties) {
|
|
79
|
+
if (changedProperties.has("checked")) {
|
|
80
|
+
this._updateFormValue();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
_handleChange(event) {
|
|
84
|
+
var _a;
|
|
85
|
+
const input = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("input");
|
|
86
|
+
this.checked = input.checked;
|
|
87
|
+
this._updateFormValue();
|
|
88
|
+
const newEvent = new Event("change", event);
|
|
89
|
+
this.dispatchEvent(newEvent);
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
const labelClassName = cvaLabel({ size: this.size });
|
|
93
|
+
const radioClassName = cvaRadio({ size: this.size });
|
|
94
|
+
const labelText = this.label ? lit.html`<span class="${labelClassName}">${this.label}</span>` : lit.html``;
|
|
95
|
+
const inputTag = lit.html`<input
|
|
96
|
+
class=${radioClassName}
|
|
97
|
+
type="radio"
|
|
98
|
+
name=${this.name}
|
|
99
|
+
value=${this.value}
|
|
100
|
+
aria-readonly=${this.readonly}
|
|
101
|
+
?disabled=${this.disabled}
|
|
102
|
+
.checked=${this.checked}
|
|
103
|
+
@click=${this._handleClick}
|
|
104
|
+
@change=${this._handleChange}
|
|
105
|
+
/>`;
|
|
106
|
+
const inputArea = this.labelPosition === "left" ? lit.html`${labelText}${inputTag}` : lit.html`${inputTag}${labelText}`;
|
|
107
|
+
return lit.html`<label
|
|
108
|
+
class="inline-flex w-full h-full gap-[8px] items-center font-daikinSerif"
|
|
109
|
+
>${inputArea}</label
|
|
110
|
+
>`;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
exports.DaikinRadio.styles = lit.css`
|
|
114
|
+
${lit.unsafeCSS(tailwind.default)}
|
|
115
|
+
|
|
116
|
+
:host {
|
|
117
|
+
display: inline-block;
|
|
118
|
+
}
|
|
119
|
+
`;
|
|
120
|
+
exports.DaikinRadio.formAssociated = true;
|
|
121
|
+
__decorateClass([
|
|
122
|
+
decorators_js.property({ type: String })
|
|
123
|
+
], exports.DaikinRadio.prototype, "label", 2);
|
|
124
|
+
__decorateClass([
|
|
125
|
+
decorators_js.property({ type: String })
|
|
126
|
+
], exports.DaikinRadio.prototype, "size", 2);
|
|
127
|
+
__decorateClass([
|
|
128
|
+
decorators_js.property({ type: String, attribute: "label-position" })
|
|
129
|
+
], exports.DaikinRadio.prototype, "labelPosition", 2);
|
|
130
|
+
__decorateClass([
|
|
131
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
132
|
+
], exports.DaikinRadio.prototype, "disabled", 2);
|
|
133
|
+
__decorateClass([
|
|
134
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
135
|
+
], exports.DaikinRadio.prototype, "readonly", 2);
|
|
136
|
+
__decorateClass([
|
|
137
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
138
|
+
], exports.DaikinRadio.prototype, "checked", 2);
|
|
139
|
+
__decorateClass([
|
|
140
|
+
decorators_js.property({ type: String, reflect: true })
|
|
141
|
+
], exports.DaikinRadio.prototype, "name", 2);
|
|
142
|
+
__decorateClass([
|
|
143
|
+
decorators_js.property({ type: String, reflect: true })
|
|
144
|
+
], exports.DaikinRadio.prototype, "value", 2);
|
|
145
|
+
__decorateClass([
|
|
146
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
147
|
+
], exports.DaikinRadio.prototype, "error", 2);
|
|
148
|
+
exports.DaikinRadio = __decorateClass([
|
|
149
|
+
decorators_js.customElement("daikin-radio")
|
|
150
|
+
], exports.DaikinRadio);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { MergeVariantProps } from '../../type-utils';
|
|
3
|
+
|
|
4
|
+
declare const cvaRadio: (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 RadioVariantProps = MergeVariantProps<typeof cvaRadio | typeof cvaLabel>;
|
|
11
|
+
/**
|
|
12
|
+
* Primary UI component for user interaction
|
|
13
|
+
*/
|
|
14
|
+
export declare class DaikinRadio extends LitElement {
|
|
15
|
+
static readonly styles: import('lit').CSSResult;
|
|
16
|
+
private _handleClick;
|
|
17
|
+
static readonly formAssociated = true;
|
|
18
|
+
private _internals;
|
|
19
|
+
private _updateFormValue;
|
|
20
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
21
|
+
private _handleChange;
|
|
22
|
+
/**
|
|
23
|
+
* Specify the label text for the radio
|
|
24
|
+
*/
|
|
25
|
+
label: string;
|
|
26
|
+
/**
|
|
27
|
+
* Specify the component size
|
|
28
|
+
*/
|
|
29
|
+
size: RadioVariantProps["size"];
|
|
30
|
+
/**
|
|
31
|
+
* Specify the label position
|
|
32
|
+
* when `left` the label will be in left of radio, when `right` label will be in right of radio
|
|
33
|
+
*/
|
|
34
|
+
labelPosition: "left" | "right";
|
|
35
|
+
/**
|
|
36
|
+
* Specify whether the Radio should be disabled
|
|
37
|
+
*/
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Specify whether the radio is read only
|
|
41
|
+
*/
|
|
42
|
+
readonly: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Specify whether the radio is be checked
|
|
45
|
+
*/
|
|
46
|
+
checked: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The form name.
|
|
49
|
+
*/
|
|
50
|
+
name: string;
|
|
51
|
+
/**
|
|
52
|
+
* The form value.
|
|
53
|
+
*/
|
|
54
|
+
value: string;
|
|
55
|
+
/**
|
|
56
|
+
* Specify whether the Radio is in a error state
|
|
57
|
+
*/
|
|
58
|
+
error: boolean;
|
|
59
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
60
|
+
}
|
|
61
|
+
declare global {
|
|
62
|
+
interface HTMLElementTagNameMap {
|
|
63
|
+
"daikin-radio": DaikinRadio;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-radio';
|
|
@@ -0,0 +1,137 @@
|
|
|
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 ifDefined_js = require("lit/directives/if-defined.js");
|
|
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 cvaInput = classVarianceAuthority.cva(
|
|
20
|
+
[
|
|
21
|
+
"w-[340px]",
|
|
22
|
+
"h-12",
|
|
23
|
+
"text-daikinNeutral-900",
|
|
24
|
+
"border",
|
|
25
|
+
"border-solid",
|
|
26
|
+
"px-[9px]",
|
|
27
|
+
"rounded-[6px]",
|
|
28
|
+
"font-daikinSerif",
|
|
29
|
+
"placeholder:text-daikinNeutral-200",
|
|
30
|
+
"enabled:hover:outline",
|
|
31
|
+
"enabled:hover:outline-2",
|
|
32
|
+
"enabled:hover:outline-[--text-input-outline-color-hover]",
|
|
33
|
+
"enabled:active:outline",
|
|
34
|
+
"enabled:active:outline-2",
|
|
35
|
+
"enabled:active:outline-[--text-input-outline-color-active]",
|
|
36
|
+
"focus-visible:outline",
|
|
37
|
+
"focus-visible:outline-2",
|
|
38
|
+
"focus-visible:outline-[--text-input-outline-color-active]",
|
|
39
|
+
"disabled:text-[--text-input-outline-color-disabled]",
|
|
40
|
+
"disabled:bg-[--text-input-background-color]",
|
|
41
|
+
"disabled:border-[--text-input-outline-color-disabled]"
|
|
42
|
+
],
|
|
43
|
+
{
|
|
44
|
+
variants: {
|
|
45
|
+
variant: {
|
|
46
|
+
normal: ["border-daikinNeutral-600"],
|
|
47
|
+
error: ["bg-daikinRed-50", "border-[--text-input-border-color-error]"]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
exports.DaikinTextInput = class DaikinTextInput extends lit.LitElement {
|
|
53
|
+
constructor() {
|
|
54
|
+
super(...arguments);
|
|
55
|
+
this._internals = this.attachInternals();
|
|
56
|
+
this.value = "";
|
|
57
|
+
this.type = "text";
|
|
58
|
+
this.placeholder = "";
|
|
59
|
+
this.disabled = false;
|
|
60
|
+
this.readonly = false;
|
|
61
|
+
this.error = false;
|
|
62
|
+
}
|
|
63
|
+
_handleInput(e) {
|
|
64
|
+
this.value = e.target.value;
|
|
65
|
+
this._internals.setFormValue(this.value);
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
const textInputInputClassName = cvaInput({
|
|
69
|
+
variant: !this.disabled && this.error ? "error" : "normal"
|
|
70
|
+
});
|
|
71
|
+
return lit.html`<input
|
|
72
|
+
class=${textInputInputClassName}
|
|
73
|
+
type=${this.type}
|
|
74
|
+
value=${this.value}
|
|
75
|
+
placeholder=${this.placeholder}
|
|
76
|
+
name=${ifDefined_js.ifDefined(this.name)}
|
|
77
|
+
maxlength=${ifDefined_js.ifDefined(this.maxlength)}
|
|
78
|
+
autocomplete=${// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround lit-analyzer checking
|
|
79
|
+
ifDefined_js.ifDefined(this.autocomplete)}
|
|
80
|
+
?disabled=${this.disabled}
|
|
81
|
+
?readonly=${this.readonly}
|
|
82
|
+
@change=${(e) => this.dispatchEvent(new Event("change", e))}
|
|
83
|
+
@input=${this._handleInput}
|
|
84
|
+
/>`;
|
|
85
|
+
}
|
|
86
|
+
updated(changedProperties) {
|
|
87
|
+
if (!changedProperties.has("value")) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this._internals.setFormValue(this.value);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.DaikinTextInput.styles = lit.css`
|
|
94
|
+
${lit.unsafeCSS(tailwind.default)}
|
|
95
|
+
|
|
96
|
+
:host {
|
|
97
|
+
--text-input-background-color: #ffffff;
|
|
98
|
+
--text-input-border-color-error: ${lit.unsafeCSS(variables_js.colorFeedbackNegative)};
|
|
99
|
+
--text-input-outline-color-disabled: #dcdcdc;
|
|
100
|
+
--text-input-outline-color-active: #cecece;
|
|
101
|
+
--text-input-outline-color-hover: #54c3f1;
|
|
102
|
+
|
|
103
|
+
display: block;
|
|
104
|
+
width: max-content;
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
exports.DaikinTextInput.formAssociated = true;
|
|
108
|
+
__decorateClass([
|
|
109
|
+
decorators_js.property({ type: String, reflect: true })
|
|
110
|
+
], exports.DaikinTextInput.prototype, "value", 2);
|
|
111
|
+
__decorateClass([
|
|
112
|
+
decorators_js.property({ type: String })
|
|
113
|
+
], exports.DaikinTextInput.prototype, "type", 2);
|
|
114
|
+
__decorateClass([
|
|
115
|
+
decorators_js.property({ type: String })
|
|
116
|
+
], exports.DaikinTextInput.prototype, "placeholder", 2);
|
|
117
|
+
__decorateClass([
|
|
118
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
119
|
+
], exports.DaikinTextInput.prototype, "disabled", 2);
|
|
120
|
+
__decorateClass([
|
|
121
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
122
|
+
], exports.DaikinTextInput.prototype, "readonly", 2);
|
|
123
|
+
__decorateClass([
|
|
124
|
+
decorators_js.property({ type: String, reflect: true })
|
|
125
|
+
], exports.DaikinTextInput.prototype, "name", 2);
|
|
126
|
+
__decorateClass([
|
|
127
|
+
decorators_js.property({ type: Number })
|
|
128
|
+
], exports.DaikinTextInput.prototype, "maxlength", 2);
|
|
129
|
+
__decorateClass([
|
|
130
|
+
decorators_js.property({ type: String })
|
|
131
|
+
], exports.DaikinTextInput.prototype, "autocomplete", 2);
|
|
132
|
+
__decorateClass([
|
|
133
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
134
|
+
], exports.DaikinTextInput.prototype, "error", 2);
|
|
135
|
+
exports.DaikinTextInput = __decorateClass([
|
|
136
|
+
decorators_js.customElement("daikin-text-input")
|
|
137
|
+
], exports.DaikinTextInput);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Primary UI component for user interaction
|
|
5
|
+
*/
|
|
6
|
+
export declare class DaikinTextInput extends LitElement {
|
|
7
|
+
static readonly styles: import('lit').CSSResult;
|
|
8
|
+
static readonly formAssociated = true;
|
|
9
|
+
private _internals;
|
|
10
|
+
/**
|
|
11
|
+
* Field value
|
|
12
|
+
*/
|
|
13
|
+
value: string;
|
|
14
|
+
/**
|
|
15
|
+
* Type of field
|
|
16
|
+
*/
|
|
17
|
+
type: "text" | "email" | "tel" | "search";
|
|
18
|
+
/**
|
|
19
|
+
* Placeholder text
|
|
20
|
+
*/
|
|
21
|
+
placeholder: string;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the field is disabled
|
|
24
|
+
*/
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the field is readonly
|
|
28
|
+
*/
|
|
29
|
+
readonly: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Name of the input field control used in the form
|
|
32
|
+
*/
|
|
33
|
+
name?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Maximum length in field values
|
|
36
|
+
*/
|
|
37
|
+
maxlength?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Specify auto-completion values
|
|
40
|
+
*/
|
|
41
|
+
autocomplete?: HTMLInputElement["autocomplete"];
|
|
42
|
+
/**
|
|
43
|
+
* Error state. Ignored if the `disabled` is `true`.
|
|
44
|
+
*/
|
|
45
|
+
error: boolean;
|
|
46
|
+
private _handleInput;
|
|
47
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
48
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
49
|
+
}
|
|
50
|
+
declare global {
|
|
51
|
+
interface HTMLElementTagNameMap {
|
|
52
|
+
"daikin-text-input": DaikinTextInput;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-text-input';
|
|
@@ -0,0 +1,168 @@
|
|
|
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 ifDefined_js = require("lit/directives/if-defined.js");
|
|
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 cvaTextarea = classVarianceAuthority.cva(
|
|
20
|
+
[
|
|
21
|
+
"w-[340px]",
|
|
22
|
+
"h-[120px]",
|
|
23
|
+
"text-daikinNeutral-900",
|
|
24
|
+
"border",
|
|
25
|
+
"border-solid",
|
|
26
|
+
"px-[9px]",
|
|
27
|
+
"py-1",
|
|
28
|
+
"font-daikinSerif",
|
|
29
|
+
"rounded-[6px]",
|
|
30
|
+
"placeholder:text-daikinNeutral-200",
|
|
31
|
+
"enabled:hover:outline",
|
|
32
|
+
"enabled:hover:outline-2",
|
|
33
|
+
"enabled:hover:outline-[--text-input-outline-color-hover]",
|
|
34
|
+
"enabled:active:outline",
|
|
35
|
+
"enabled:active:outline-2",
|
|
36
|
+
"enabled:active:outline-[--text-input-outline-color-active]",
|
|
37
|
+
"focus-visible:outline",
|
|
38
|
+
"focus-visible:outline-2",
|
|
39
|
+
"focus-visible:outline-[--text-input-outline-color-active]",
|
|
40
|
+
"disabled:text-[--text-input-outline-color-disabled]",
|
|
41
|
+
"disabled:bg-[--text-input-background-color]",
|
|
42
|
+
"disabled:border-[--text-input-outline-color-disabled]"
|
|
43
|
+
],
|
|
44
|
+
{
|
|
45
|
+
variants: {
|
|
46
|
+
variant: {
|
|
47
|
+
normal: ["border-daikinNeutral-600"],
|
|
48
|
+
error: ["bg-daikinRed-50", "border-[--text-input-border-color-error]"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
const cvaCounter = classVarianceAuthority.cva(
|
|
54
|
+
["absolute", "top-[-24px]", "right-0", "text-[12px]", "font-daikinSerif"],
|
|
55
|
+
{
|
|
56
|
+
variants: {
|
|
57
|
+
variant: {
|
|
58
|
+
normal: ["text-daikinNeutral-900"],
|
|
59
|
+
disabled: ["text-[--text-input-outline-color-disabled]"]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
exports.DaikinTextarea = class DaikinTextarea extends lit.LitElement {
|
|
65
|
+
constructor() {
|
|
66
|
+
super(...arguments);
|
|
67
|
+
this._internals = this.attachInternals();
|
|
68
|
+
this.value = "";
|
|
69
|
+
this.placeholder = "";
|
|
70
|
+
this.disabled = false;
|
|
71
|
+
this.required = false;
|
|
72
|
+
this.readonly = false;
|
|
73
|
+
this.maxlength = 100;
|
|
74
|
+
this.error = false;
|
|
75
|
+
this.counter = false;
|
|
76
|
+
this._textareaCounter = 0;
|
|
77
|
+
}
|
|
78
|
+
_updateValueAndCounter(value) {
|
|
79
|
+
this._internals.setFormValue(value);
|
|
80
|
+
this._textareaCounter = [...value].length;
|
|
81
|
+
}
|
|
82
|
+
_handleInput(e) {
|
|
83
|
+
this.value = e.target.value;
|
|
84
|
+
this._updateValueAndCounter(this.value);
|
|
85
|
+
}
|
|
86
|
+
render() {
|
|
87
|
+
const textareaClassName = cvaTextarea({
|
|
88
|
+
variant: !this.disabled && this.error ? "error" : "normal"
|
|
89
|
+
});
|
|
90
|
+
const textareaCounterClassName = cvaCounter({
|
|
91
|
+
variant: this.disabled ? "disabled" : "normal"
|
|
92
|
+
});
|
|
93
|
+
return lit.html`<textarea
|
|
94
|
+
class=${textareaClassName}
|
|
95
|
+
.value=${this.value}
|
|
96
|
+
placeholder=${this.placeholder}
|
|
97
|
+
maxlength=${this.maxlength}
|
|
98
|
+
autocomplete=${// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround lit-analyzer checking
|
|
99
|
+
ifDefined_js.ifDefined(this.autocomplete)}
|
|
100
|
+
?disabled=${this.disabled}
|
|
101
|
+
?readonly=${this.readonly}
|
|
102
|
+
@change=${(e) => this.dispatchEvent(new Event("change", e))}
|
|
103
|
+
@input=${this._handleInput}
|
|
104
|
+
@keydown=${this._handleInput}
|
|
105
|
+
></textarea>
|
|
106
|
+
${this.counter ? lit.html`
|
|
107
|
+
<span class=${textareaCounterClassName}
|
|
108
|
+
>${this._textareaCounter}/${this.maxlength}</span
|
|
109
|
+
>
|
|
110
|
+
` : null}`;
|
|
111
|
+
}
|
|
112
|
+
updated(changedProperties) {
|
|
113
|
+
if (!changedProperties.has("value")) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this._updateValueAndCounter(this.value);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
exports.DaikinTextarea.styles = lit.css`
|
|
120
|
+
${lit.unsafeCSS(tailwind.default)}
|
|
121
|
+
|
|
122
|
+
:host {
|
|
123
|
+
--text-input-border-color-error: ${lit.unsafeCSS(variables_js.colorFeedbackNegative)};
|
|
124
|
+
--text-input-outline-color-hover: #54c3f1;
|
|
125
|
+
--text-input-outline-color-disabled: #dcdcdc;
|
|
126
|
+
--text-input-outline-color-active: #cecece;
|
|
127
|
+
--text-input-background-color: #ffffff;
|
|
128
|
+
|
|
129
|
+
display: block;
|
|
130
|
+
width: max-content;
|
|
131
|
+
height: 120px;
|
|
132
|
+
position: relative;
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
exports.DaikinTextarea.formAssociated = true;
|
|
136
|
+
__decorateClass([
|
|
137
|
+
decorators_js.property({ type: String })
|
|
138
|
+
], exports.DaikinTextarea.prototype, "value", 2);
|
|
139
|
+
__decorateClass([
|
|
140
|
+
decorators_js.property({ type: String })
|
|
141
|
+
], exports.DaikinTextarea.prototype, "placeholder", 2);
|
|
142
|
+
__decorateClass([
|
|
143
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
144
|
+
], exports.DaikinTextarea.prototype, "disabled", 2);
|
|
145
|
+
__decorateClass([
|
|
146
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
147
|
+
], exports.DaikinTextarea.prototype, "required", 2);
|
|
148
|
+
__decorateClass([
|
|
149
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
150
|
+
], exports.DaikinTextarea.prototype, "readonly", 2);
|
|
151
|
+
__decorateClass([
|
|
152
|
+
decorators_js.property({ type: Number, reflect: true })
|
|
153
|
+
], exports.DaikinTextarea.prototype, "maxlength", 2);
|
|
154
|
+
__decorateClass([
|
|
155
|
+
decorators_js.property({ type: String, reflect: true })
|
|
156
|
+
], exports.DaikinTextarea.prototype, "autocomplete", 2);
|
|
157
|
+
__decorateClass([
|
|
158
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
159
|
+
], exports.DaikinTextarea.prototype, "error", 2);
|
|
160
|
+
__decorateClass([
|
|
161
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
162
|
+
], exports.DaikinTextarea.prototype, "counter", 2);
|
|
163
|
+
__decorateClass([
|
|
164
|
+
decorators_js.state()
|
|
165
|
+
], exports.DaikinTextarea.prototype, "_textareaCounter", 2);
|
|
166
|
+
exports.DaikinTextarea = __decorateClass([
|
|
167
|
+
decorators_js.customElement("daikin-textarea")
|
|
168
|
+
], exports.DaikinTextarea);
|