@daikin-oss/design-system-web-components 1.2.0 → 1.3.0-next.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 +85 -49
- package/dist/cjs/base/dds-element.cjs +1 -1
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +1 -0
- package/dist/cjs/components/avatar/daikin-avatar.cjs +1 -0
- package/dist/cjs/components/calendar/daikin-calendar.cjs +2 -0
- package/dist/cjs/components/card-header/daikin-card-header.cjs +1 -1
- package/dist/cjs/components/carousel/daikin-carousel.cjs +7 -3
- package/dist/cjs/components/carousel-item/daikin-carousel-item.cjs +2 -2
- package/dist/cjs/components/chip/daikin-chip.cjs +106 -0
- package/dist/cjs/components/chip/daikin-chip.d.cts +36 -0
- package/dist/cjs/components/chip/index.cjs +7 -0
- package/dist/cjs/components/chip/index.d.cts +1 -0
- package/dist/cjs/components/combobox/daikin-combobox.cjs +604 -0
- package/dist/cjs/components/combobox/daikin-combobox.d.cts +134 -0
- package/dist/cjs/components/combobox/index.cjs +8 -0
- package/dist/cjs/components/combobox/index.d.cts +1 -0
- package/dist/cjs/components/date-picker/daikin-date-picker.cjs +31 -16
- package/dist/cjs/components/date-picker/daikin-date-picker.d.cts +2 -1
- package/dist/cjs/components/dropdown/daikin-dropdown.cjs +52 -37
- package/dist/cjs/components/dropdown/daikin-dropdown.d.cts +4 -3
- package/dist/cjs/components/icon/daikin-icon.cjs +117 -12
- package/dist/cjs/components/icon/daikin-icon.d.cts +129 -9
- package/dist/cjs/components/icon/icons.json.cjs +6 -2
- package/dist/cjs/components/icon/icons.json.d.cts +0 -12
- package/dist/cjs/components/icon-button/daikin-icon-button.cjs +12 -2
- package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +8 -0
- package/dist/cjs/components/index.cjs +36 -0
- package/dist/cjs/components/index.d.cts +5 -0
- package/dist/cjs/components/input-group/daikin-input-group.cjs +1 -1
- package/dist/cjs/components/input-group/daikin-input-group.d.cts +40 -13
- package/dist/cjs/components/list-item/daikin-list-item.cjs +2 -2
- package/dist/cjs/components/modal-header/daikin-modal-header.cjs +1 -1
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +3 -3
- package/dist/cjs/components/select/daikin-select.cjs +6 -1
- package/dist/cjs/components/tab/daikin-tab.cjs +1 -0
- package/dist/cjs/components/table/daikin-table.cjs +33 -12
- package/dist/cjs/components/table/daikin-table.d.cts +67 -34
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +31 -6
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.d.cts +7 -0
- package/dist/cjs/components/text-field/daikin-text-field.cjs +191 -56
- package/dist/cjs/components/text-field/daikin-text-field.d.cts +32 -3
- package/dist/cjs/components/text-field/number-utils.cjs +61 -0
- package/dist/cjs/components/text-field/number-utils.d.cts +26 -0
- package/dist/cjs/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
- package/dist/cjs/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
- package/dist/cjs/components/text-masked-field/index.cjs +7 -0
- package/dist/cjs/components/text-masked-field/index.d.cts +1 -0
- package/dist/cjs/components/time-picker/daikin-time-picker.cjs +577 -0
- package/dist/cjs/components/time-picker/daikin-time-picker.d.cts +165 -0
- package/dist/cjs/components/time-picker/index.cjs +17 -0
- package/dist/cjs/components/time-picker/index.d.cts +1 -0
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +1 -1
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +12 -2
- package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +8 -1
- package/dist/cjs/controllers/floating-ui-auto-update.cjs +22 -4
- package/dist/cjs/controllers/floating-ui-auto-update.d.cts +12 -0
- package/dist/cjs/icon-registry.cjs +170 -0
- package/dist/cjs/icon-registry.d.cts +120 -0
- package/dist/cjs/index.cjs +39 -0
- package/dist/cjs/index.d.cts +1 -0
- package/dist/cjs/tailwind.css.cjs +1 -1
- package/dist/cjs/utils/notification-common.d.cts +2 -2
- package/dist/cjs-dev/base/dds-element.cjs +1 -1
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +1 -0
- package/dist/cjs-dev/components/avatar/daikin-avatar.cjs +1 -0
- package/dist/cjs-dev/components/calendar/daikin-calendar.cjs +2 -0
- package/dist/cjs-dev/components/card-header/daikin-card-header.cjs +1 -1
- package/dist/cjs-dev/components/carousel/daikin-carousel.cjs +7 -3
- package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.cjs +2 -2
- package/dist/cjs-dev/components/chip/daikin-chip.cjs +106 -0
- package/dist/cjs-dev/components/chip/daikin-chip.d.cts +36 -0
- package/dist/cjs-dev/components/chip/index.cjs +7 -0
- package/dist/cjs-dev/components/chip/index.d.cts +1 -0
- package/dist/cjs-dev/components/combobox/daikin-combobox.cjs +604 -0
- package/dist/cjs-dev/components/combobox/daikin-combobox.d.cts +134 -0
- package/dist/cjs-dev/components/combobox/index.cjs +8 -0
- package/dist/cjs-dev/components/combobox/index.d.cts +1 -0
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +31 -16
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.d.cts +2 -1
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +52 -37
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +4 -3
- package/dist/cjs-dev/components/icon/daikin-icon.cjs +141 -16
- package/dist/cjs-dev/components/icon/daikin-icon.d.cts +129 -9
- package/dist/cjs-dev/components/icon/icons.json.cjs +6 -2
- package/dist/cjs-dev/components/icon/icons.json.d.cts +0 -12
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +12 -2
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +8 -0
- package/dist/cjs-dev/components/index.cjs +36 -0
- package/dist/cjs-dev/components/index.d.cts +5 -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.cts +40 -13
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +2 -2
- package/dist/cjs-dev/components/modal-header/daikin-modal-header.cjs +1 -1
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +3 -3
- package/dist/cjs-dev/components/select/daikin-select.cjs +6 -1
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +1 -0
- package/dist/cjs-dev/components/table/daikin-table.cjs +36 -15
- package/dist/cjs-dev/components/table/daikin-table.d.cts +67 -34
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +31 -6
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.d.cts +7 -0
- package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +191 -56
- package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +32 -3
- package/dist/cjs-dev/components/text-field/number-utils.cjs +64 -0
- package/dist/cjs-dev/components/text-field/number-utils.d.cts +26 -0
- package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
- package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
- package/dist/cjs-dev/components/text-masked-field/index.cjs +7 -0
- package/dist/cjs-dev/components/text-masked-field/index.d.cts +1 -0
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.cjs +589 -0
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.d.cts +165 -0
- package/dist/cjs-dev/components/time-picker/index.cjs +17 -0
- package/dist/cjs-dev/components/time-picker/index.d.cts +1 -0
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +1 -1
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +12 -2
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +8 -1
- package/dist/cjs-dev/controllers/floating-ui-auto-update.cjs +22 -4
- package/dist/cjs-dev/controllers/floating-ui-auto-update.d.cts +12 -0
- package/dist/cjs-dev/icon-registry.cjs +170 -0
- package/dist/cjs-dev/icon-registry.d.cts +120 -0
- package/dist/cjs-dev/index.cjs +39 -0
- package/dist/cjs-dev/index.d.cts +1 -0
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- package/dist/cjs-dev/utils/notification-common.d.cts +2 -2
- package/dist/es/base/dds-element.js +1 -1
- package/dist/es/components/accordion-item/daikin-accordion-item.js +1 -0
- package/dist/es/components/avatar/daikin-avatar.js +1 -0
- package/dist/es/components/calendar/daikin-calendar.js +2 -0
- package/dist/es/components/card-header/daikin-card-header.js +1 -1
- package/dist/es/components/carousel/daikin-carousel.js +7 -3
- package/dist/es/components/carousel-item/daikin-carousel-item.js +2 -2
- package/dist/es/components/chip/daikin-chip.d.ts +36 -0
- package/dist/es/components/chip/daikin-chip.js +107 -0
- package/dist/es/components/chip/index.d.ts +1 -0
- package/dist/es/components/chip/index.js +4 -0
- package/dist/es/components/combobox/daikin-combobox.d.ts +134 -0
- package/dist/es/components/combobox/daikin-combobox.js +605 -0
- package/dist/es/components/combobox/index.d.ts +1 -0
- package/dist/es/components/combobox/index.js +5 -0
- package/dist/es/components/date-picker/daikin-date-picker.d.ts +2 -1
- package/dist/es/components/date-picker/daikin-date-picker.js +32 -17
- package/dist/es/components/dropdown/daikin-dropdown.d.ts +4 -3
- package/dist/es/components/dropdown/daikin-dropdown.js +52 -37
- package/dist/es/components/icon/daikin-icon.d.ts +129 -9
- package/dist/es/components/icon/daikin-icon.js +118 -13
- package/dist/es/components/icon/icons.json.d.ts +0 -12
- package/dist/es/components/icon/icons.json.js +5 -1
- package/dist/es/components/icon-button/daikin-icon-button.d.ts +8 -0
- package/dist/es/components/icon-button/daikin-icon-button.js +12 -2
- package/dist/es/components/index.d.ts +5 -0
- package/dist/es/components/index.js +22 -1
- package/dist/es/components/input-group/daikin-input-group.d.ts +40 -13
- package/dist/es/components/input-group/daikin-input-group.js +1 -1
- package/dist/es/components/list-item/daikin-list-item.js +2 -2
- package/dist/es/components/modal-header/daikin-modal-header.js +1 -1
- package/dist/es/components/progress-bar/daikin-progress-bar.js +3 -3
- package/dist/es/components/select/daikin-select.js +6 -1
- package/dist/es/components/tab/daikin-tab.js +1 -0
- package/dist/es/components/table/daikin-table.d.ts +67 -34
- package/dist/es/components/table/daikin-table.js +33 -12
- package/dist/es/components/table-header-cell/daikin-table-header-cell.d.ts +7 -0
- package/dist/es/components/table-header-cell/daikin-table-header-cell.js +31 -6
- package/dist/es/components/text-field/daikin-text-field.d.ts +32 -3
- package/dist/es/components/text-field/daikin-text-field.js +191 -56
- package/dist/es/components/text-field/number-utils.d.ts +26 -0
- package/dist/es/components/text-field/number-utils.js +61 -0
- package/dist/es/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
- package/dist/es/components/text-masked-field/daikin-text-masked-field.js +313 -0
- package/dist/es/components/text-masked-field/index.d.ts +1 -0
- package/dist/es/components/text-masked-field/index.js +4 -0
- package/dist/es/components/time-picker/daikin-time-picker.d.ts +165 -0
- package/dist/es/components/time-picker/daikin-time-picker.js +578 -0
- package/dist/es/components/time-picker/index.d.ts +1 -0
- package/dist/es/components/time-picker/index.js +14 -0
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +1 -1
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +8 -1
- package/dist/es/components/tooltip/daikin-tooltip.js +12 -2
- package/dist/es/controllers/floating-ui-auto-update.d.ts +12 -0
- package/dist/es/controllers/floating-ui-auto-update.js +22 -4
- package/dist/es/icon-registry.d.ts +120 -0
- package/dist/es/icon-registry.js +170 -0
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +25 -1
- package/dist/es/tailwind.css.js +1 -1
- package/dist/es/utils/notification-common.d.ts +2 -2
- package/dist/es-dev/base/dds-element.js +1 -1
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +1 -0
- package/dist/es-dev/components/avatar/daikin-avatar.js +1 -0
- package/dist/es-dev/components/calendar/daikin-calendar.js +2 -0
- package/dist/es-dev/components/card-header/daikin-card-header.js +1 -1
- package/dist/es-dev/components/carousel/daikin-carousel.js +7 -3
- package/dist/es-dev/components/carousel-item/daikin-carousel-item.js +2 -2
- package/dist/es-dev/components/chip/daikin-chip.d.ts +36 -0
- package/dist/es-dev/components/chip/daikin-chip.js +107 -0
- package/dist/es-dev/components/chip/index.d.ts +1 -0
- package/dist/es-dev/components/chip/index.js +4 -0
- package/dist/es-dev/components/combobox/daikin-combobox.d.ts +134 -0
- package/dist/es-dev/components/combobox/daikin-combobox.js +605 -0
- package/dist/es-dev/components/combobox/index.d.ts +1 -0
- package/dist/es-dev/components/combobox/index.js +5 -0
- package/dist/es-dev/components/date-picker/daikin-date-picker.d.ts +2 -1
- package/dist/es-dev/components/date-picker/daikin-date-picker.js +32 -17
- package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +4 -3
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +52 -37
- package/dist/es-dev/components/icon/daikin-icon.d.ts +129 -9
- package/dist/es-dev/components/icon/daikin-icon.js +142 -17
- package/dist/es-dev/components/icon/icons.json.d.ts +0 -12
- package/dist/es-dev/components/icon/icons.json.js +5 -1
- package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +8 -0
- package/dist/es-dev/components/icon-button/daikin-icon-button.js +12 -2
- package/dist/es-dev/components/index.d.ts +5 -0
- package/dist/es-dev/components/index.js +22 -1
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +40 -13
- package/dist/es-dev/components/input-group/daikin-input-group.js +1 -1
- package/dist/es-dev/components/list-item/daikin-list-item.js +2 -2
- package/dist/es-dev/components/modal-header/daikin-modal-header.js +1 -1
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +3 -3
- package/dist/es-dev/components/select/daikin-select.js +6 -1
- package/dist/es-dev/components/tab/daikin-tab.js +1 -0
- package/dist/es-dev/components/table/daikin-table.d.ts +67 -34
- package/dist/es-dev/components/table/daikin-table.js +36 -15
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.d.ts +7 -0
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +31 -6
- package/dist/es-dev/components/text-field/daikin-text-field.d.ts +32 -3
- package/dist/es-dev/components/text-field/daikin-text-field.js +191 -56
- package/dist/es-dev/components/text-field/number-utils.d.ts +26 -0
- package/dist/es-dev/components/text-field/number-utils.js +64 -0
- package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
- package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.js +313 -0
- package/dist/es-dev/components/text-masked-field/index.d.ts +1 -0
- package/dist/es-dev/components/text-masked-field/index.js +4 -0
- package/dist/es-dev/components/time-picker/daikin-time-picker.d.ts +165 -0
- package/dist/es-dev/components/time-picker/daikin-time-picker.js +590 -0
- package/dist/es-dev/components/time-picker/index.d.ts +1 -0
- package/dist/es-dev/components/time-picker/index.js +14 -0
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +1 -1
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +8 -1
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +12 -2
- package/dist/es-dev/controllers/floating-ui-auto-update.d.ts +12 -0
- package/dist/es-dev/controllers/floating-ui-auto-update.js +22 -4
- package/dist/es-dev/icon-registry.d.ts +120 -0
- package/dist/es-dev/icon-registry.js +170 -0
- package/dist/es-dev/index.d.ts +1 -0
- package/dist/es-dev/index.js +25 -1
- package/dist/es-dev/tailwind.css.js +1 -1
- package/dist/es-dev/utils/notification-common.d.ts +2 -2
- package/icons/number-minus.svg +5 -0
- package/icons/number-plus.svg +5 -0
- package/package.json +14 -4
- package/icons/dropdown-chevron-down.svg +0 -3
|
@@ -89,6 +89,7 @@ let DaikinAvatar = class extends LitElement {
|
|
|
89
89
|
</span>`;
|
|
90
90
|
} else if (this.type === "button") {
|
|
91
91
|
return html`<button
|
|
92
|
+
type="button"
|
|
92
93
|
class=${cvaWrapper({ type: "button" })}
|
|
93
94
|
aria-label=${ifDefined(this.alt ?? void 0)}
|
|
94
95
|
aria-haspopup=${ifDefined(this.avatarAriaHaspopup ?? void 0)}
|
|
@@ -261,6 +261,7 @@ let DaikinCalendar = class extends LitElement {
|
|
|
261
261
|
}) {
|
|
262
262
|
const variant = selected ? "selected" : today ? "today" : "default";
|
|
263
263
|
return html`<button
|
|
264
|
+
type="button"
|
|
264
265
|
class=${cvaContentButton({ variant, date: false })}
|
|
265
266
|
?disabled=${disabled}
|
|
266
267
|
role="radio"
|
|
@@ -384,6 +385,7 @@ let DaikinCalendar = class extends LitElement {
|
|
|
384
385
|
week,
|
|
385
386
|
(date) => date.getTime(),
|
|
386
387
|
(date) => html`<button
|
|
388
|
+
type="button"
|
|
387
389
|
class=${cvaContentButton({
|
|
388
390
|
variant: date.getTime() === (value == null ? void 0 : value.getTime()) ? "selected" : date.getTime() === today.getTime() ? "today" : "default",
|
|
389
391
|
date: true
|
|
@@ -141,13 +141,16 @@ let DaikinCarousel = class extends DDSElement {
|
|
|
141
141
|
<span class=${cvaButton({ intent: "previous" })}></span>
|
|
142
142
|
</daikin-icon-button>
|
|
143
143
|
<div
|
|
144
|
-
class="w-full overflow-clip relative focus-within:outline focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-ddt-color-common-border-focus"
|
|
144
|
+
class="w-full overflow-clip relative focus-within:outline focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-ddt-color-common-border-focus [container-type:inline-size]"
|
|
145
145
|
aria-live="polite"
|
|
146
146
|
>
|
|
147
147
|
<div
|
|
148
|
-
class="flex w-[calc(
|
|
148
|
+
class="flex w-[calc(100cqw*var(--total))] transition-transform translate-x-[calc(-100%*var(--current)/var(--total))] duration-[--ddc-transition-duration]"
|
|
149
149
|
>
|
|
150
|
-
<slot
|
|
150
|
+
<slot
|
|
151
|
+
class="slotted:w-[calc(100%/var(--total))]"
|
|
152
|
+
@slotchange=${this._handleSlotchange}
|
|
153
|
+
></slot>
|
|
151
154
|
</div>
|
|
152
155
|
</div>
|
|
153
156
|
<daikin-icon-button
|
|
@@ -172,6 +175,7 @@ let DaikinCarousel = class extends DDSElement {
|
|
|
172
175
|
this._items,
|
|
173
176
|
(_, index) => index,
|
|
174
177
|
(_, index) => html`<button
|
|
178
|
+
type="button"
|
|
175
179
|
class=${INDICATOR_CLASS_NAME}
|
|
176
180
|
aria-label="Slide ${index + 1}"
|
|
177
181
|
aria-selected=${this.currentIndex === index}
|
|
@@ -38,12 +38,12 @@ let DaikinCarouselItem = class extends DDSElement {
|
|
|
38
38
|
>
|
|
39
39
|
<slot
|
|
40
40
|
name="title"
|
|
41
|
-
class="leading-[130%] font-bold"
|
|
41
|
+
class="leading-[130%] font-bold natural-break"
|
|
42
42
|
@slotchange=${this._handleFooterSlotChange}
|
|
43
43
|
></slot>
|
|
44
44
|
<slot
|
|
45
45
|
name="description"
|
|
46
|
-
class="text-sm"
|
|
46
|
+
class="text-sm natural-break"
|
|
47
47
|
@slotchange=${this._handleFooterSlotChange}
|
|
48
48
|
></slot>
|
|
49
49
|
</div>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* A chip is a small UI component that represents a single piece of information, a filter, or a contact. Think of it as a compact tag or a small, clickable token.
|
|
4
|
+
*
|
|
5
|
+
* @fires remove - A custom event emitted when a user clicks the remove button.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```js
|
|
10
|
+
* import "@daikin-oss/design-system-web-components/components/chip/index.js";
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* ```html
|
|
14
|
+
* <daikin-chip chip-aria-label="Chip Text">Text</daikin-chip>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare class DaikinChip extends LitElement {
|
|
18
|
+
static readonly styles: import('lit').CSSResult;
|
|
19
|
+
/**
|
|
20
|
+
* Provides an accessible name of the chip.
|
|
21
|
+
*/
|
|
22
|
+
chipAriaLabel: string | null;
|
|
23
|
+
private _focusableElement;
|
|
24
|
+
private _handleRemoveClick;
|
|
25
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
26
|
+
/**
|
|
27
|
+
* Focuses on the inner remove button
|
|
28
|
+
* @param options focus options
|
|
29
|
+
*/
|
|
30
|
+
focus(options?: FocusOptions): void;
|
|
31
|
+
}
|
|
32
|
+
declare global {
|
|
33
|
+
interface HTMLElementTagNameMap {
|
|
34
|
+
"daikin-chip": DaikinChip;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { unsafeCSS, css, LitElement, html } from "lit";
|
|
3
|
+
import { property, query, 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 cvaWrapper = cva([
|
|
17
|
+
"flex",
|
|
18
|
+
"items-center",
|
|
19
|
+
"rounded-[100px]",
|
|
20
|
+
"overflow-hidden",
|
|
21
|
+
"size-full",
|
|
22
|
+
"border",
|
|
23
|
+
"px-1",
|
|
24
|
+
"border-ddt-color-common-neutral-default"
|
|
25
|
+
]);
|
|
26
|
+
const cvaRemoveButton = cva([
|
|
27
|
+
"w-4",
|
|
28
|
+
"h-4",
|
|
29
|
+
"flex",
|
|
30
|
+
"items-center",
|
|
31
|
+
"justify-center",
|
|
32
|
+
"rounded-full",
|
|
33
|
+
"overflow-hidden",
|
|
34
|
+
"focus-visible:outline",
|
|
35
|
+
"focus-visible:outline-2",
|
|
36
|
+
"focus-visible:outline-ddt-color-common-border-focus",
|
|
37
|
+
"enabled:var-color-ddt-color-common-neutral-default/color-primary",
|
|
38
|
+
"enabled:hover:var-color-ddt-color-common-neutral-hover/color-primary",
|
|
39
|
+
"enabled:hover:var-color-ddt-color-common-surface-neutral-hover/color-secondary",
|
|
40
|
+
"enabled:active:var-color-ddt-color-common-neutral-press/color-primary",
|
|
41
|
+
"enabled:active:var-color-ddt-color-common-surface-neutral-press/color-secondary",
|
|
42
|
+
"text-[--color-primary]",
|
|
43
|
+
"bg-[--color-secondary]"
|
|
44
|
+
]);
|
|
45
|
+
let DaikinChip = class extends LitElement {
|
|
46
|
+
constructor() {
|
|
47
|
+
super(...arguments);
|
|
48
|
+
this.chipAriaLabel = null;
|
|
49
|
+
}
|
|
50
|
+
_handleRemoveClick(event) {
|
|
51
|
+
event.stopPropagation();
|
|
52
|
+
this.dispatchEvent(new Event("remove", { bubbles: true, composed: true }));
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
return html`
|
|
56
|
+
<div
|
|
57
|
+
role="group"
|
|
58
|
+
class=${cvaWrapper()}
|
|
59
|
+
aria-label=${ifDefined(this.chipAriaLabel)}
|
|
60
|
+
>
|
|
61
|
+
<slot
|
|
62
|
+
name="left-icon"
|
|
63
|
+
class="icon-size-4 text-ddt-color-common-text-primary"
|
|
64
|
+
></slot>
|
|
65
|
+
<span class="text-ddt-color-common-text-primary px-1 mr-[2px]">
|
|
66
|
+
<slot></slot>
|
|
67
|
+
</span>
|
|
68
|
+
<button
|
|
69
|
+
type="button"
|
|
70
|
+
class=${cvaRemoveButton()}
|
|
71
|
+
aria-label="Remove"
|
|
72
|
+
@click=${this._handleRemoveClick}
|
|
73
|
+
>
|
|
74
|
+
<span class="i-daikin-close text-[--color-primary]"></span>
|
|
75
|
+
</button>
|
|
76
|
+
</div>
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Focuses on the inner remove button
|
|
81
|
+
* @param options focus options
|
|
82
|
+
*/
|
|
83
|
+
focus(options) {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = this._focusableElement) == null ? void 0 : _a.focus(options);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
DaikinChip.styles = css`
|
|
89
|
+
${unsafeCSS(tailwindStyles)}
|
|
90
|
+
|
|
91
|
+
:host {
|
|
92
|
+
display: inline-flex;
|
|
93
|
+
width: max-content;
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
__decorateClass([
|
|
97
|
+
property({ type: String, reflect: true, attribute: "chip-aria-label" })
|
|
98
|
+
], DaikinChip.prototype, "chipAriaLabel", 2);
|
|
99
|
+
__decorateClass([
|
|
100
|
+
query("button")
|
|
101
|
+
], DaikinChip.prototype, "_focusableElement", 2);
|
|
102
|
+
DaikinChip = __decorateClass([
|
|
103
|
+
customElement("daikin-chip")
|
|
104
|
+
], DaikinChip);
|
|
105
|
+
export {
|
|
106
|
+
DaikinChip
|
|
107
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./daikin-chip.js";
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
3
|
+
import { DaikinInputGroup } from "../input-group/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Interface for combobox option object
|
|
6
|
+
*/
|
|
7
|
+
export interface ComboboxOption {
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
value?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Type for combobox items - can be string or object array
|
|
14
|
+
*/
|
|
15
|
+
export type ComboboxItem = string | ComboboxOption;
|
|
16
|
+
export declare function defaultFilterFn(items: readonly ComboboxItem[], value: string): readonly ComboboxItem[];
|
|
17
|
+
/**
|
|
18
|
+
* A combobox component.
|
|
19
|
+
* Unlike a dropdown component, a combobox primarily functions as a text field (using a native <input> tag) that can accept custom user input. The dropdown list serves as a helpful aid to expedite the user's input process.
|
|
20
|
+
*
|
|
21
|
+
* @fires change - A custom event emitted when a user selects a combobox item or inputs a custom value.
|
|
22
|
+
* @fires input - A retargeted event of a [input event](https://developer.mozilla.org/en-US/docs/Web/API/Element/input_event). Triggered when the user types in the input field, clicks clear button, or selects from dropdown options.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
*
|
|
26
|
+
* ```js
|
|
27
|
+
* import "@daikin-oss/design-system-web-components/components/combobox/index.js";
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* ```html
|
|
31
|
+
* <daikin-combobox></daikin-combobox>
|
|
32
|
+
*
|
|
33
|
+
* <script>
|
|
34
|
+
* const combobox = document.querySelector("daikin-combobox");
|
|
35
|
+
* combobox.items = [ "Apple", "Banana", "Cherry" ];
|
|
36
|
+
* </script>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class DaikinCombobox extends DDSFormElement {
|
|
40
|
+
static readonly styles: import('lit').CSSResult;
|
|
41
|
+
/**
|
|
42
|
+
* Placeholder text of the combobox.
|
|
43
|
+
*/
|
|
44
|
+
placeholder: string | null;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the combobox is disabled.
|
|
47
|
+
*/
|
|
48
|
+
disabled: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the combobox is required.
|
|
51
|
+
*/
|
|
52
|
+
required: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the combobox is in an error state.
|
|
55
|
+
*/
|
|
56
|
+
error: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the combobox menu is opened.
|
|
59
|
+
*/
|
|
60
|
+
open: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* An array of items for the combobox dropdown. Can be:
|
|
63
|
+
* - Array of strings: ['Option 1', 'Option 2']
|
|
64
|
+
* - Array of objects: [{label: 'Option 1', disabled: false}, {label: 'Option 2', disabled: true}]
|
|
65
|
+
*/
|
|
66
|
+
items: ComboboxItem[];
|
|
67
|
+
private _viewItems;
|
|
68
|
+
private _currentFocusItemIndex;
|
|
69
|
+
/**
|
|
70
|
+
* This property accepts a function that allows users to customize the logic for matching options in the dropdown.
|
|
71
|
+
* Default implementation performs case-insensitive substring matching.
|
|
72
|
+
*/
|
|
73
|
+
filter: typeof defaultFilterFn;
|
|
74
|
+
private _input;
|
|
75
|
+
/**
|
|
76
|
+
* The label text used as the value of aria-label.
|
|
77
|
+
* Set automatically by `reflectInputGroup` method.
|
|
78
|
+
*/
|
|
79
|
+
private _label;
|
|
80
|
+
private _autoUpdateController;
|
|
81
|
+
private _clickOutsideController;
|
|
82
|
+
private _onClickOutside;
|
|
83
|
+
private _moveFocusByKeydown;
|
|
84
|
+
private _updateFormValue;
|
|
85
|
+
private _closePopup;
|
|
86
|
+
private _handleFocusOut;
|
|
87
|
+
private _handleClick;
|
|
88
|
+
private _handleArrowClick;
|
|
89
|
+
private _handleClickItem;
|
|
90
|
+
private _handleKeyDown;
|
|
91
|
+
/**
|
|
92
|
+
* Handle `floating-ready` event dispatched by `FloatingUIAutoUpdateController`.
|
|
93
|
+
* The combobox menu opens after the Floating UI has finished calculating its position, so there is a slight time lag between the change to `this.open` and the actual display.
|
|
94
|
+
* Since the focus cannot be moved until the element is displayed on the screen, the focus is moved to the item after receiving the completion of the Floating UI position calculation here.
|
|
95
|
+
*/
|
|
96
|
+
private _handleFloatingReady;
|
|
97
|
+
/**
|
|
98
|
+
* Handles the clear button click event.
|
|
99
|
+
* Clears the current value and triggers form value update.
|
|
100
|
+
*/
|
|
101
|
+
private _handleClearClick;
|
|
102
|
+
/**
|
|
103
|
+
* Synchronizes the display items based on the current filter state.
|
|
104
|
+
* @param type - Whether to show all items or apply filtering
|
|
105
|
+
*/
|
|
106
|
+
private _synchronizeShowItems;
|
|
107
|
+
/**
|
|
108
|
+
* Handles input events from the combobox input field.
|
|
109
|
+
* Updates the value, applies filtering, and opens dropdown if matches are found.
|
|
110
|
+
*/
|
|
111
|
+
private _handleInput;
|
|
112
|
+
/**
|
|
113
|
+
* Handles change events from the combobox input field.
|
|
114
|
+
* Dispatches a custom change event when the input value changes and loses focus.
|
|
115
|
+
*/
|
|
116
|
+
private _handleChange;
|
|
117
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
118
|
+
/**
|
|
119
|
+
* Focuses on the input element.
|
|
120
|
+
* @param options focus options
|
|
121
|
+
*/
|
|
122
|
+
focus(options?: FocusOptions): void;
|
|
123
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
124
|
+
/**
|
|
125
|
+
* This method is used by `daikin-input-group` to reflect it's attributes to this component.
|
|
126
|
+
* @private
|
|
127
|
+
*/
|
|
128
|
+
reflectInputGroup(inputGroup: DaikinInputGroup): void;
|
|
129
|
+
}
|
|
130
|
+
declare global {
|
|
131
|
+
interface HTMLElementTagNameMap {
|
|
132
|
+
"daikin-combobox": DaikinCombobox;
|
|
133
|
+
}
|
|
134
|
+
}
|