@daikin-oss/design-system-web-components 0.6.0 → 1.0.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/CHANGELOG.md +167 -12
- package/README.md +40 -23
- package/dist/cjs/base/dds-element.cjs +8 -0
- package/dist/cjs/base/dds-element.d.cts +4 -0
- package/dist/cjs/base/decorators.cjs +13 -0
- package/dist/cjs/base/decorators.d.cts +2 -0
- package/dist/cjs/base/define.cjs +18 -0
- package/dist/cjs/base/define.d.cts +1 -0
- package/dist/cjs/base/index.cjs +8 -0
- package/dist/cjs/base/index.d.cts +3 -0
- package/dist/cjs/components/accordion/daikin-accordion.cjs +39 -6
- package/dist/cjs/components/accordion/daikin-accordion.d.cts +15 -2
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +45 -85
- package/dist/cjs/components/accordion-item/daikin-accordion-item.d.cts +10 -16
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.cjs +27 -85
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.d.cts +12 -24
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +33 -82
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.d.cts +16 -25
- package/dist/cjs/components/button/daikin-button.cjs +36 -23
- package/dist/cjs/components/button/daikin-button.d.cts +8 -5
- package/dist/cjs/components/card/daikin-card.cjs +67 -0
- package/dist/cjs/components/card/daikin-card.d.cts +48 -0
- package/dist/cjs/components/card/index.cjs +7 -0
- package/dist/cjs/components/card/index.d.cts +1 -0
- package/dist/cjs/components/card-footer/daikin-card-footer.cjs +33 -0
- package/dist/cjs/components/card-footer/daikin-card-footer.d.cts +33 -0
- package/dist/cjs/components/card-footer/index.cjs +7 -0
- package/dist/cjs/components/card-footer/index.d.cts +1 -0
- package/dist/cjs/components/card-header/daikin-card-header.cjs +59 -0
- package/dist/cjs/components/card-header/daikin-card-header.d.cts +35 -0
- package/dist/cjs/components/card-header/index.cjs +7 -0
- package/dist/cjs/components/card-header/index.d.cts +1 -0
- package/dist/cjs/components/carousel/daikin-carousel.cjs +217 -0
- package/dist/cjs/components/carousel/daikin-carousel.d.cts +56 -0
- package/dist/cjs/components/carousel/index.cjs +7 -0
- package/dist/cjs/components/carousel/index.d.cts +1 -0
- package/dist/cjs/components/carousel-item/daikin-carousel-item.cjs +80 -0
- package/dist/cjs/components/carousel-item/daikin-carousel-item.d.cts +50 -0
- package/dist/cjs/components/carousel-item/index.cjs +7 -0
- package/dist/cjs/components/carousel-item/index.d.cts +1 -0
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +63 -45
- package/dist/cjs/components/checkbox/daikin-checkbox.d.cts +4 -2
- package/dist/cjs/components/dropdown/daikin-dropdown.cjs +30 -19
- package/dist/cjs/components/dropdown/daikin-dropdown.d.cts +16 -2
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.cjs +21 -14
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.d.cts +10 -2
- package/dist/cjs/components/icon/daikin-icon.cjs +16 -13
- package/dist/cjs/components/icon/daikin-icon.d.cts +5 -5
- package/dist/cjs/components/icon/icons.json.cjs +1 -70
- package/dist/cjs/components/icon/icons.json.d.cts +0 -8
- package/dist/cjs/components/icon-button/daikin-icon-button.cjs +29 -25
- package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +2 -2
- package/dist/cjs/components/index.cjs +56 -5
- package/dist/cjs/components/index.d.cts +11 -1
- package/dist/cjs/components/inline-notification/daikin-inline-notification.cjs +92 -0
- package/dist/cjs/components/inline-notification/daikin-inline-notification.d.cts +55 -0
- package/dist/cjs/components/inline-notification/index.cjs +7 -0
- package/dist/cjs/components/inline-notification/index.d.cts +1 -0
- package/dist/cjs/components/input-group/daikin-input-group.cjs +71 -52
- package/dist/cjs/components/input-group/daikin-input-group.d.cts +25 -8
- package/dist/cjs/components/link/daikin-link.cjs +40 -55
- package/dist/cjs/components/link/daikin-link.d.cts +2 -2
- package/dist/cjs/components/list/daikin-list.cjs +9 -9
- package/dist/cjs/components/list/daikin-list.d.cts +7 -2
- package/dist/cjs/components/list-item/daikin-list-item.cjs +16 -13
- package/dist/cjs/components/list-item/daikin-list-item.d.cts +6 -2
- package/dist/cjs/components/pagination/daikin-pagination.cjs +40 -33
- package/dist/cjs/components/pagination/daikin-pagination.d.cts +6 -2
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +33 -18
- package/dist/cjs/components/progress-bar/daikin-progress-bar.d.cts +3 -2
- package/dist/cjs/components/progress-indicator/daikin-progress-indicator.cjs +17 -26
- package/dist/cjs/components/progress-indicator/daikin-progress-indicator.d.cts +12 -5
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.cjs +28 -29
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.d.cts +8 -4
- package/dist/cjs/components/radio/daikin-radio.cjs +57 -33
- package/dist/cjs/components/radio/daikin-radio.d.cts +18 -8
- package/dist/cjs/components/radio-group/daikin-radio-group.cjs +31 -11
- package/dist/cjs/components/radio-group/daikin-radio-group.d.cts +20 -14
- package/dist/cjs/components/select/daikin-select.cjs +25 -16
- package/dist/cjs/components/select/daikin-select.d.cts +11 -2
- package/dist/cjs/components/tab/daikin-tab.cjs +38 -23
- package/dist/cjs/components/tab/daikin-tab.d.cts +7 -2
- package/dist/cjs/components/tab-panels/daikin-tab-panels.cjs +9 -7
- package/dist/cjs/components/tab-panels/daikin-tab-panels.d.cts +2 -2
- package/dist/cjs/components/table/daikin-table.cjs +15 -12
- package/dist/cjs/components/table/daikin-table.d.cts +9 -2
- package/dist/cjs/components/table-cell/daikin-table-cell.cjs +10 -7
- package/dist/cjs/components/table-cell/daikin-table-cell.d.cts +6 -2
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +12 -10
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.d.cts +6 -2
- package/dist/cjs/components/tabs/daikin-tabs.cjs +25 -10
- package/dist/cjs/components/tabs/daikin-tabs.d.cts +8 -2
- package/dist/cjs/components/text-area/daikin-text-area.cjs +31 -20
- package/dist/cjs/components/text-area/daikin-text-area.d.cts +7 -2
- package/dist/cjs/components/text-field/daikin-text-field.cjs +29 -19
- package/dist/cjs/components/text-field/daikin-text-field.d.cts +7 -2
- package/dist/cjs/components/toast-notification/daikin-toast-notification.cjs +94 -0
- package/dist/cjs/components/toast-notification/daikin-toast-notification.d.cts +69 -0
- package/dist/cjs/components/toast-notification/index.cjs +7 -0
- package/dist/cjs/components/toast-notification/index.d.cts +1 -0
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.cjs +192 -0
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +67 -0
- package/dist/cjs/components/toast-notification-manager/index.cjs +7 -0
- package/dist/cjs/components/toast-notification-manager/index.d.cts +1 -0
- package/dist/cjs/components/toggle/daikin-toggle.cjs +18 -15
- package/dist/cjs/components/toggle/daikin-toggle.d.cts +3 -2
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +45 -33
- package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +16 -6
- package/dist/cjs/components/tree/common.cjs +90 -0
- package/dist/cjs/components/tree/common.d.cts +32 -0
- package/dist/cjs/components/tree/daikin-tree.cjs +108 -0
- package/dist/cjs/components/tree/daikin-tree.d.cts +73 -0
- package/dist/cjs/components/tree/index.cjs +7 -0
- package/dist/cjs/components/tree/index.d.cts +1 -0
- package/dist/cjs/components/tree-item/daikin-tree-item.cjs +201 -0
- package/dist/cjs/components/tree-item/daikin-tree-item.d.cts +95 -0
- package/dist/cjs/components/tree-item/index.cjs +8 -0
- package/dist/cjs/components/tree-item/index.d.cts +1 -0
- package/dist/cjs/components/tree-section/daikin-tree-section.cjs +230 -0
- package/dist/cjs/components/tree-section/daikin-tree-section.d.cts +109 -0
- package/dist/cjs/components/tree-section/index.cjs +7 -0
- package/dist/cjs/components/tree-section/index.d.cts +1 -0
- package/dist/cjs/controllers/click-outside.d.cts +1 -1
- package/dist/cjs/index.cjs +56 -7
- package/dist/cjs/index.d.cts +0 -1
- package/dist/cjs/tailwind.css.cjs +1 -1
- package/dist/cjs/utils/is-simple-key.cjs +6 -0
- package/dist/cjs/utils/is-simple-key.d.cts +7 -0
- package/dist/cjs/utils/notification-common.cjs +121 -0
- package/dist/cjs/utils/notification-common.d.cts +19 -0
- package/dist/cjs-dev/base/dds-element.cjs +8 -0
- package/dist/cjs-dev/base/dds-element.d.cts +4 -0
- package/dist/cjs-dev/base/decorators.cjs +13 -0
- package/dist/cjs-dev/base/decorators.d.cts +2 -0
- package/dist/cjs-dev/base/define.cjs +18 -0
- package/dist/cjs-dev/base/define.d.cts +1 -0
- package/dist/cjs-dev/base/index.cjs +8 -0
- package/dist/cjs-dev/base/index.d.cts +3 -0
- package/dist/cjs-dev/components/accordion/daikin-accordion.cjs +46 -6
- package/dist/cjs-dev/components/accordion/daikin-accordion.d.cts +15 -2
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +45 -85
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.d.cts +10 -16
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.cjs +27 -85
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.d.cts +12 -24
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +33 -82
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.cts +16 -25
- package/dist/cjs-dev/components/button/daikin-button.cjs +36 -23
- package/dist/cjs-dev/components/button/daikin-button.d.cts +8 -5
- package/dist/cjs-dev/components/card/daikin-card.cjs +67 -0
- package/dist/cjs-dev/components/card/daikin-card.d.cts +48 -0
- package/dist/cjs-dev/components/card/index.cjs +7 -0
- package/dist/cjs-dev/components/card/index.d.cts +1 -0
- package/dist/cjs-dev/components/card-footer/daikin-card-footer.cjs +33 -0
- package/dist/cjs-dev/components/card-footer/daikin-card-footer.d.cts +33 -0
- package/dist/cjs-dev/components/card-footer/index.cjs +7 -0
- package/dist/cjs-dev/components/card-footer/index.d.cts +1 -0
- package/dist/cjs-dev/components/card-header/daikin-card-header.cjs +59 -0
- package/dist/cjs-dev/components/card-header/daikin-card-header.d.cts +35 -0
- package/dist/cjs-dev/components/card-header/index.cjs +7 -0
- package/dist/cjs-dev/components/card-header/index.d.cts +1 -0
- package/dist/cjs-dev/components/carousel/daikin-carousel.cjs +227 -0
- package/dist/cjs-dev/components/carousel/daikin-carousel.d.cts +56 -0
- package/dist/cjs-dev/components/carousel/index.cjs +7 -0
- package/dist/cjs-dev/components/carousel/index.d.cts +1 -0
- package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.cjs +80 -0
- package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.d.cts +50 -0
- package/dist/cjs-dev/components/carousel-item/index.cjs +7 -0
- package/dist/cjs-dev/components/carousel-item/index.d.cts +1 -0
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +63 -45
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.cts +4 -2
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +30 -19
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +16 -2
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.cjs +21 -14
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.d.cts +10 -2
- package/dist/cjs-dev/components/icon/daikin-icon.cjs +16 -13
- package/dist/cjs-dev/components/icon/daikin-icon.d.cts +5 -5
- package/dist/cjs-dev/components/icon/icons.json.cjs +1 -70
- package/dist/cjs-dev/components/icon/icons.json.d.cts +0 -8
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +29 -25
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +2 -2
- package/dist/cjs-dev/components/index.cjs +56 -5
- package/dist/cjs-dev/components/index.d.cts +11 -1
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.cjs +92 -0
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.d.cts +55 -0
- package/dist/cjs-dev/components/inline-notification/index.cjs +7 -0
- package/dist/cjs-dev/components/inline-notification/index.d.cts +1 -0
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +71 -52
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.cts +25 -8
- package/dist/cjs-dev/components/link/daikin-link.cjs +40 -55
- package/dist/cjs-dev/components/link/daikin-link.d.cts +2 -2
- package/dist/cjs-dev/components/list/daikin-list.cjs +9 -9
- package/dist/cjs-dev/components/list/daikin-list.d.cts +7 -2
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +16 -13
- package/dist/cjs-dev/components/list-item/daikin-list-item.d.cts +6 -2
- package/dist/cjs-dev/components/pagination/daikin-pagination.cjs +40 -33
- package/dist/cjs-dev/components/pagination/daikin-pagination.d.cts +6 -2
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +33 -18
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.d.cts +3 -2
- package/dist/cjs-dev/components/progress-indicator/daikin-progress-indicator.cjs +17 -36
- package/dist/cjs-dev/components/progress-indicator/daikin-progress-indicator.d.cts +12 -5
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.cjs +28 -29
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.d.cts +8 -4
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +57 -33
- package/dist/cjs-dev/components/radio/daikin-radio.d.cts +18 -8
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.cjs +31 -11
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.d.cts +20 -14
- package/dist/cjs-dev/components/select/daikin-select.cjs +25 -16
- package/dist/cjs-dev/components/select/daikin-select.d.cts +11 -2
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +38 -23
- package/dist/cjs-dev/components/tab/daikin-tab.d.cts +7 -2
- package/dist/cjs-dev/components/tab-panels/daikin-tab-panels.cjs +9 -7
- package/dist/cjs-dev/components/tab-panels/daikin-tab-panels.d.cts +2 -2
- package/dist/cjs-dev/components/table/daikin-table.cjs +15 -12
- package/dist/cjs-dev/components/table/daikin-table.d.cts +9 -2
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.cjs +10 -7
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.d.cts +6 -2
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +12 -10
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.d.cts +6 -2
- package/dist/cjs-dev/components/tabs/daikin-tabs.cjs +25 -10
- package/dist/cjs-dev/components/tabs/daikin-tabs.d.cts +8 -2
- package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +31 -20
- package/dist/cjs-dev/components/text-area/daikin-text-area.d.cts +7 -2
- package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +29 -19
- package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +7 -2
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.cjs +94 -0
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.d.cts +69 -0
- package/dist/cjs-dev/components/toast-notification/index.cjs +7 -0
- package/dist/cjs-dev/components/toast-notification/index.d.cts +1 -0
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.cjs +192 -0
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +67 -0
- package/dist/cjs-dev/components/toast-notification-manager/index.cjs +7 -0
- package/dist/cjs-dev/components/toast-notification-manager/index.d.cts +1 -0
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +18 -15
- package/dist/cjs-dev/components/toggle/daikin-toggle.d.cts +3 -2
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +45 -33
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +16 -6
- package/dist/cjs-dev/components/tree/common.cjs +90 -0
- package/dist/cjs-dev/components/tree/common.d.cts +32 -0
- package/dist/cjs-dev/components/tree/daikin-tree.cjs +108 -0
- package/dist/cjs-dev/components/tree/daikin-tree.d.cts +73 -0
- package/dist/cjs-dev/components/tree/index.cjs +7 -0
- package/dist/cjs-dev/components/tree/index.d.cts +1 -0
- package/dist/cjs-dev/components/tree-item/daikin-tree-item.cjs +201 -0
- package/dist/cjs-dev/components/tree-item/daikin-tree-item.d.cts +95 -0
- package/dist/cjs-dev/components/tree-item/index.cjs +8 -0
- package/dist/cjs-dev/components/tree-item/index.d.cts +1 -0
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.cjs +230 -0
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.d.cts +109 -0
- package/dist/cjs-dev/components/tree-section/index.cjs +7 -0
- package/dist/cjs-dev/components/tree-section/index.d.cts +1 -0
- package/dist/cjs-dev/controllers/click-outside.d.cts +1 -1
- package/dist/cjs-dev/index.cjs +56 -7
- package/dist/cjs-dev/index.d.cts +0 -1
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- package/dist/cjs-dev/utils/is-simple-key.cjs +6 -0
- package/dist/cjs-dev/utils/is-simple-key.d.cts +7 -0
- package/dist/cjs-dev/utils/notification-common.cjs +124 -0
- package/dist/cjs-dev/utils/notification-common.d.cts +19 -0
- package/dist/es/base/dds-element.d.ts +4 -0
- package/dist/es/base/dds-element.js +8 -0
- package/dist/es/base/decorators.d.ts +2 -0
- package/dist/es/base/decorators.js +13 -0
- package/dist/es/base/define.d.ts +1 -0
- package/dist/es/base/define.js +18 -0
- package/dist/es/base/index.d.ts +3 -0
- package/dist/es/base/index.js +8 -0
- package/dist/es/components/accordion/daikin-accordion.d.ts +15 -2
- package/dist/es/components/accordion/daikin-accordion.js +38 -5
- package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +10 -16
- package/dist/es/components/accordion-item/daikin-accordion-item.js +44 -84
- package/dist/es/components/breadcrumb/daikin-breadcrumb.d.ts +12 -24
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +26 -84
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +16 -25
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +32 -81
- package/dist/es/components/button/daikin-button.d.ts +8 -5
- package/dist/es/components/button/daikin-button.js +35 -22
- package/dist/es/components/card/daikin-card.d.ts +48 -0
- package/dist/es/components/card/daikin-card.js +68 -0
- package/dist/es/components/card/index.d.ts +1 -0
- package/dist/es/components/card/index.js +4 -0
- package/dist/es/components/card-footer/daikin-card-footer.d.ts +33 -0
- package/dist/es/components/card-footer/daikin-card-footer.js +34 -0
- package/dist/es/components/card-footer/index.d.ts +1 -0
- package/dist/es/components/card-footer/index.js +4 -0
- package/dist/es/components/card-header/daikin-card-header.d.ts +35 -0
- package/dist/es/components/card-header/daikin-card-header.js +60 -0
- package/dist/es/components/card-header/index.d.ts +1 -0
- package/dist/es/components/card-header/index.js +4 -0
- package/dist/es/components/carousel/daikin-carousel.d.ts +56 -0
- package/dist/es/components/carousel/daikin-carousel.js +218 -0
- package/dist/es/components/carousel/index.d.ts +1 -0
- package/dist/es/components/carousel/index.js +4 -0
- package/dist/es/components/carousel-item/daikin-carousel-item.d.ts +50 -0
- package/dist/es/components/carousel-item/daikin-carousel-item.js +81 -0
- package/dist/es/components/carousel-item/index.d.ts +1 -0
- package/dist/es/components/carousel-item/index.js +4 -0
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +4 -2
- package/dist/es/components/checkbox/daikin-checkbox.js +62 -44
- package/dist/es/components/dropdown/daikin-dropdown.d.ts +16 -2
- package/dist/es/components/dropdown/daikin-dropdown.js +29 -18
- package/dist/es/components/dropdown-item/daikin-dropdown-item.d.ts +10 -2
- package/dist/es/components/dropdown-item/daikin-dropdown-item.js +20 -13
- package/dist/es/components/icon/daikin-icon.d.ts +5 -5
- package/dist/es/components/icon/daikin-icon.js +15 -12
- package/dist/es/components/icon/icons.json.d.ts +0 -8
- package/dist/es/components/icon/icons.json.js +1 -70
- package/dist/es/components/icon-button/daikin-icon-button.d.ts +2 -2
- package/dist/es/components/icon-button/daikin-icon-button.js +28 -24
- package/dist/es/components/index.d.ts +11 -1
- package/dist/es/components/index.js +23 -2
- package/dist/es/components/inline-notification/daikin-inline-notification.d.ts +55 -0
- package/dist/es/components/inline-notification/daikin-inline-notification.js +93 -0
- package/dist/es/components/inline-notification/index.d.ts +1 -0
- package/dist/es/components/inline-notification/index.js +4 -0
- package/dist/es/components/input-group/daikin-input-group.d.ts +25 -8
- package/dist/es/components/input-group/daikin-input-group.js +70 -51
- package/dist/es/components/link/daikin-link.d.ts +2 -2
- package/dist/es/components/link/daikin-link.js +39 -54
- package/dist/es/components/list/daikin-list.d.ts +7 -2
- package/dist/es/components/list/daikin-list.js +7 -7
- package/dist/es/components/list-item/daikin-list-item.d.ts +6 -2
- package/dist/es/components/list-item/daikin-list-item.js +15 -12
- package/dist/es/components/pagination/daikin-pagination.d.ts +6 -2
- package/dist/es/components/pagination/daikin-pagination.js +39 -32
- package/dist/es/components/progress-bar/daikin-progress-bar.d.ts +3 -2
- package/dist/es/components/progress-bar/daikin-progress-bar.js +32 -17
- package/dist/es/components/progress-indicator/daikin-progress-indicator.d.ts +12 -5
- package/dist/es/components/progress-indicator/daikin-progress-indicator.js +16 -25
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.d.ts +8 -4
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.js +27 -28
- package/dist/es/components/radio/daikin-radio.d.ts +18 -8
- package/dist/es/components/radio/daikin-radio.js +56 -32
- package/dist/es/components/radio-group/daikin-radio-group.d.ts +20 -14
- package/dist/es/components/radio-group/daikin-radio-group.js +30 -10
- package/dist/es/components/select/daikin-select.d.ts +11 -2
- package/dist/es/components/select/daikin-select.js +24 -15
- package/dist/es/components/tab/daikin-tab.d.ts +7 -2
- package/dist/es/components/tab/daikin-tab.js +37 -22
- package/dist/es/components/tab-panels/daikin-tab-panels.d.ts +2 -2
- package/dist/es/components/tab-panels/daikin-tab-panels.js +8 -6
- package/dist/es/components/table/daikin-table.d.ts +9 -2
- package/dist/es/components/table/daikin-table.js +14 -11
- package/dist/es/components/table-cell/daikin-table-cell.d.ts +6 -2
- package/dist/es/components/table-cell/daikin-table-cell.js +9 -6
- package/dist/es/components/table-header-cell/daikin-table-header-cell.d.ts +6 -2
- package/dist/es/components/table-header-cell/daikin-table-header-cell.js +11 -9
- package/dist/es/components/tabs/daikin-tabs.d.ts +8 -2
- package/dist/es/components/tabs/daikin-tabs.js +24 -9
- package/dist/es/components/text-area/daikin-text-area.d.ts +7 -2
- package/dist/es/components/text-area/daikin-text-area.js +30 -19
- package/dist/es/components/text-field/daikin-text-field.d.ts +7 -2
- package/dist/es/components/text-field/daikin-text-field.js +28 -18
- package/dist/es/components/toast-notification/daikin-toast-notification.d.ts +69 -0
- package/dist/es/components/toast-notification/daikin-toast-notification.js +95 -0
- package/dist/es/components/toast-notification/index.d.ts +1 -0
- package/dist/es/components/toast-notification/index.js +4 -0
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +67 -0
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.js +193 -0
- package/dist/es/components/toast-notification-manager/index.d.ts +1 -0
- package/dist/es/components/toast-notification-manager/index.js +4 -0
- package/dist/es/components/toggle/daikin-toggle.d.ts +3 -2
- package/dist/es/components/toggle/daikin-toggle.js +17 -14
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +16 -6
- package/dist/es/components/tooltip/daikin-tooltip.js +44 -32
- package/dist/es/components/tree/common.d.ts +32 -0
- package/dist/es/components/tree/common.js +90 -0
- package/dist/es/components/tree/daikin-tree.d.ts +73 -0
- package/dist/es/components/tree/daikin-tree.js +109 -0
- package/dist/es/components/tree/index.d.ts +1 -0
- package/dist/es/components/tree/index.js +4 -0
- package/dist/es/components/tree-item/daikin-tree-item.d.ts +95 -0
- package/dist/es/components/tree-item/daikin-tree-item.js +202 -0
- package/dist/es/components/tree-item/index.d.ts +1 -0
- package/dist/es/components/tree-item/index.js +5 -0
- package/dist/es/components/tree-section/daikin-tree-section.d.ts +109 -0
- package/dist/es/components/tree-section/daikin-tree-section.js +231 -0
- package/dist/es/components/tree-section/index.d.ts +1 -0
- package/dist/es/components/tree-section/index.js +4 -0
- package/dist/es/controllers/click-outside.d.ts +1 -1
- package/dist/es/index.d.ts +0 -1
- package/dist/es/index.js +23 -4
- package/dist/es/tailwind.css.js +1 -1
- package/dist/es/utils/is-simple-key.d.ts +7 -0
- package/dist/es/utils/is-simple-key.js +6 -0
- package/dist/es/utils/notification-common.d.ts +19 -0
- package/dist/es/utils/notification-common.js +121 -0
- package/dist/es-dev/base/dds-element.d.ts +4 -0
- package/dist/es-dev/base/dds-element.js +8 -0
- package/dist/es-dev/base/decorators.d.ts +2 -0
- package/dist/es-dev/base/decorators.js +13 -0
- package/dist/es-dev/base/define.d.ts +1 -0
- package/dist/es-dev/base/define.js +18 -0
- package/dist/es-dev/base/index.d.ts +3 -0
- package/dist/es-dev/base/index.js +8 -0
- package/dist/es-dev/components/accordion/daikin-accordion.d.ts +15 -2
- package/dist/es-dev/components/accordion/daikin-accordion.js +45 -5
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.d.ts +10 -16
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +44 -84
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.d.ts +12 -24
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +26 -84
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +16 -25
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +32 -81
- package/dist/es-dev/components/button/daikin-button.d.ts +8 -5
- package/dist/es-dev/components/button/daikin-button.js +35 -22
- package/dist/es-dev/components/card/daikin-card.d.ts +48 -0
- package/dist/es-dev/components/card/daikin-card.js +68 -0
- package/dist/es-dev/components/card/index.d.ts +1 -0
- package/dist/es-dev/components/card/index.js +4 -0
- package/dist/es-dev/components/card-footer/daikin-card-footer.d.ts +33 -0
- package/dist/es-dev/components/card-footer/daikin-card-footer.js +34 -0
- package/dist/es-dev/components/card-footer/index.d.ts +1 -0
- package/dist/es-dev/components/card-footer/index.js +4 -0
- package/dist/es-dev/components/card-header/daikin-card-header.d.ts +35 -0
- package/dist/es-dev/components/card-header/daikin-card-header.js +60 -0
- package/dist/es-dev/components/card-header/index.d.ts +1 -0
- package/dist/es-dev/components/card-header/index.js +4 -0
- package/dist/es-dev/components/carousel/daikin-carousel.d.ts +56 -0
- package/dist/es-dev/components/carousel/daikin-carousel.js +228 -0
- package/dist/es-dev/components/carousel/index.d.ts +1 -0
- package/dist/es-dev/components/carousel/index.js +4 -0
- package/dist/es-dev/components/carousel-item/daikin-carousel-item.d.ts +50 -0
- package/dist/es-dev/components/carousel-item/daikin-carousel-item.js +81 -0
- package/dist/es-dev/components/carousel-item/index.d.ts +1 -0
- package/dist/es-dev/components/carousel-item/index.js +4 -0
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +4 -2
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +62 -44
- package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +16 -2
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +29 -18
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.d.ts +10 -2
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +20 -13
- package/dist/es-dev/components/icon/daikin-icon.d.ts +5 -5
- package/dist/es-dev/components/icon/daikin-icon.js +15 -12
- package/dist/es-dev/components/icon/icons.json.d.ts +0 -8
- package/dist/es-dev/components/icon/icons.json.js +1 -70
- package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +2 -2
- package/dist/es-dev/components/icon-button/daikin-icon-button.js +28 -24
- package/dist/es-dev/components/index.d.ts +11 -1
- package/dist/es-dev/components/index.js +23 -2
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.d.ts +55 -0
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.js +93 -0
- package/dist/es-dev/components/inline-notification/index.d.ts +1 -0
- package/dist/es-dev/components/inline-notification/index.js +4 -0
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +25 -8
- package/dist/es-dev/components/input-group/daikin-input-group.js +70 -51
- package/dist/es-dev/components/link/daikin-link.d.ts +2 -2
- package/dist/es-dev/components/link/daikin-link.js +39 -54
- package/dist/es-dev/components/list/daikin-list.d.ts +7 -2
- package/dist/es-dev/components/list/daikin-list.js +7 -7
- package/dist/es-dev/components/list-item/daikin-list-item.d.ts +6 -2
- package/dist/es-dev/components/list-item/daikin-list-item.js +15 -12
- package/dist/es-dev/components/pagination/daikin-pagination.d.ts +6 -2
- package/dist/es-dev/components/pagination/daikin-pagination.js +39 -32
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.d.ts +3 -2
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +32 -17
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.d.ts +12 -5
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.js +16 -35
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.d.ts +8 -4
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.js +27 -28
- package/dist/es-dev/components/radio/daikin-radio.d.ts +18 -8
- package/dist/es-dev/components/radio/daikin-radio.js +56 -32
- package/dist/es-dev/components/radio-group/daikin-radio-group.d.ts +20 -14
- package/dist/es-dev/components/radio-group/daikin-radio-group.js +30 -10
- package/dist/es-dev/components/select/daikin-select.d.ts +11 -2
- package/dist/es-dev/components/select/daikin-select.js +24 -15
- package/dist/es-dev/components/tab/daikin-tab.d.ts +7 -2
- package/dist/es-dev/components/tab/daikin-tab.js +37 -22
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.d.ts +2 -2
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.js +8 -6
- package/dist/es-dev/components/table/daikin-table.d.ts +9 -2
- package/dist/es-dev/components/table/daikin-table.js +14 -11
- package/dist/es-dev/components/table-cell/daikin-table-cell.d.ts +6 -2
- package/dist/es-dev/components/table-cell/daikin-table-cell.js +9 -6
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.d.ts +6 -2
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +11 -9
- package/dist/es-dev/components/tabs/daikin-tabs.d.ts +8 -2
- package/dist/es-dev/components/tabs/daikin-tabs.js +24 -9
- package/dist/es-dev/components/text-area/daikin-text-area.d.ts +7 -2
- package/dist/es-dev/components/text-area/daikin-text-area.js +30 -19
- package/dist/es-dev/components/text-field/daikin-text-field.d.ts +7 -2
- package/dist/es-dev/components/text-field/daikin-text-field.js +28 -18
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.d.ts +69 -0
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.js +95 -0
- package/dist/es-dev/components/toast-notification/index.d.ts +1 -0
- package/dist/es-dev/components/toast-notification/index.js +4 -0
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +67 -0
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.js +193 -0
- package/dist/es-dev/components/toast-notification-manager/index.d.ts +1 -0
- package/dist/es-dev/components/toast-notification-manager/index.js +4 -0
- package/dist/es-dev/components/toggle/daikin-toggle.d.ts +3 -2
- package/dist/es-dev/components/toggle/daikin-toggle.js +17 -14
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +16 -6
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +44 -32
- package/dist/es-dev/components/tree/common.d.ts +32 -0
- package/dist/es-dev/components/tree/common.js +90 -0
- package/dist/es-dev/components/tree/daikin-tree.d.ts +73 -0
- package/dist/es-dev/components/tree/daikin-tree.js +109 -0
- package/dist/es-dev/components/tree/index.d.ts +1 -0
- package/dist/es-dev/components/tree/index.js +4 -0
- package/dist/es-dev/components/tree-item/daikin-tree-item.d.ts +95 -0
- package/dist/es-dev/components/tree-item/daikin-tree-item.js +202 -0
- package/dist/es-dev/components/tree-item/index.d.ts +1 -0
- package/dist/es-dev/components/tree-item/index.js +5 -0
- package/dist/es-dev/components/tree-section/daikin-tree-section.d.ts +109 -0
- package/dist/es-dev/components/tree-section/daikin-tree-section.js +231 -0
- package/dist/es-dev/components/tree-section/index.d.ts +1 -0
- package/dist/es-dev/components/tree-section/index.js +4 -0
- package/dist/es-dev/controllers/click-outside.d.ts +1 -1
- package/dist/es-dev/index.d.ts +0 -1
- package/dist/es-dev/index.js +23 -4
- package/dist/es-dev/tailwind.css.js +1 -1
- package/dist/es-dev/utils/is-simple-key.d.ts +7 -0
- package/dist/es-dev/utils/is-simple-key.js +6 -0
- package/dist/es-dev/utils/notification-common.d.ts +19 -0
- package/dist/es-dev/utils/notification-common.js +124 -0
- package/icons/checkbox-checked.svg +2 -3
- package/icons/sort.svg +1 -1
- package/icons/status-error.svg +1 -1
- package/icons/status-negative.svg +4 -2
- package/icons/status-warning.svg +2 -4
- package/package.json +58 -49
- package/dist/cjs/colors.cjs +0 -80
- package/dist/cjs/colors.d.cts +0 -69
- package/dist/cjs/components/notification/daikin-notification.cjs +0 -197
- package/dist/cjs/components/notification/daikin-notification.d.cts +0 -77
- package/dist/cjs/components/notification/index.cjs +0 -7
- package/dist/cjs/components/notification/index.d.cts +0 -1
- package/dist/cjs/constants/events.cjs +0 -4
- package/dist/cjs-dev/colors.cjs +0 -80
- package/dist/cjs-dev/colors.d.cts +0 -69
- package/dist/cjs-dev/components/notification/daikin-notification.cjs +0 -197
- package/dist/cjs-dev/components/notification/daikin-notification.d.cts +0 -77
- package/dist/cjs-dev/components/notification/index.cjs +0 -7
- package/dist/cjs-dev/components/notification/index.d.cts +0 -1
- package/dist/cjs-dev/constants/events.cjs +0 -4
- package/dist/es/colors.d.ts +0 -69
- package/dist/es/colors.js +0 -80
- package/dist/es/components/notification/daikin-notification.d.ts +0 -77
- package/dist/es/components/notification/daikin-notification.js +0 -198
- package/dist/es/components/notification/index.d.ts +0 -1
- package/dist/es/components/notification/index.js +0 -4
- package/dist/es/constants/events.js +0 -4
- package/dist/es-dev/colors.d.ts +0 -69
- package/dist/es-dev/colors.js +0 -80
- package/dist/es-dev/components/notification/daikin-notification.d.ts +0 -77
- package/dist/es-dev/components/notification/daikin-notification.js +0 -198
- package/dist/es-dev/components/notification/index.d.ts +0 -1
- package/dist/es-dev/components/notification/index.js +0 -4
- package/dist/es-dev/constants/events.js +0 -4
- package/icons/arrow-up.svg +0 -3
- package/icons/status-success.svg +0 -6
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import { css, unsafeCSS,
|
|
3
|
-
import { property, state
|
|
2
|
+
import { css, unsafeCSS, html } from "lit";
|
|
3
|
+
import { property, state } from "lit/decorators.js";
|
|
4
4
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
|
+
import { DDSElement } from "../../base/dds-element.js";
|
|
6
|
+
import { ddsElement } from "../../base/decorators.js";
|
|
7
|
+
import "../../base/define.js";
|
|
5
8
|
import tailwindStyles from "../../tailwind.css.js";
|
|
6
9
|
var __defProp = Object.defineProperty;
|
|
7
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -17,39 +20,43 @@ const cvaTextArea = cva(
|
|
|
17
20
|
[
|
|
18
21
|
"w-full",
|
|
19
22
|
"h-full",
|
|
23
|
+
"bg-ddt-color-common-background-default",
|
|
20
24
|
"px-4",
|
|
21
25
|
"py-3",
|
|
22
26
|
"rounded",
|
|
23
27
|
"font-daikinSerif",
|
|
24
28
|
"outline",
|
|
25
29
|
"outline-[--color-border]",
|
|
26
|
-
"outline-
|
|
27
|
-
"-outline-offset-
|
|
28
|
-
"placeholder:text-
|
|
30
|
+
"outline-1",
|
|
31
|
+
"-outline-offset-1",
|
|
32
|
+
"placeholder:text-ddt-color-common-text-secondary",
|
|
29
33
|
// Define `--color-border` as a CSS variable that references `--color-state-focus` and `--color-base` in that order.
|
|
30
34
|
// `--color-base` indicates the color of the border when the element is normal, hovered, or disabled.
|
|
31
35
|
"define-[--color-state-active,--color-state-focus,--color-base]/color-border",
|
|
32
36
|
"border",
|
|
33
37
|
"border-[--color-border]",
|
|
38
|
+
"enabled:text-ddt-color-common-text-primary",
|
|
39
|
+
"enabled:hover:bg-ddt-color-common-surface-hover",
|
|
40
|
+
"enabled:active:bg-ddt-color-common-surface-press",
|
|
41
|
+
"focus-visible:outline-2",
|
|
42
|
+
"focus-visible:-outline-offset-2",
|
|
34
43
|
// Update `--color-base` depending on the state.
|
|
35
44
|
// The default `--color-base` and `--color-state-focus` values are defined in `variants.error` because they differ depending on whether or not the input has an error state.
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"disabled:var-color-system-state-disabled/color-base",
|
|
41
|
-
"disabled:text-system-state-disabled",
|
|
42
|
-
"disabled:bg-white",
|
|
43
|
-
"disabled:placeholder:text-system-state-disabled"
|
|
45
|
+
"disabled:var-color-ddt-color-common-disabled/color-base",
|
|
46
|
+
"disabled:text-ddt-color-common-disabled",
|
|
47
|
+
"disabled:bg-color-common-background-default",
|
|
48
|
+
"disabled:placeholder:text-ddt-color-common-disabled"
|
|
44
49
|
],
|
|
45
50
|
{
|
|
46
51
|
variants: {
|
|
47
52
|
error: {
|
|
48
53
|
false: [
|
|
49
|
-
"enabled:var-color-
|
|
50
|
-
"
|
|
54
|
+
"enabled:var-color-ddt-color-common-neutral-default/color-base",
|
|
55
|
+
"enabled:hover:var-color-ddt-color-common-neutral-hover/color-base",
|
|
56
|
+
"enabled:active:var-color-ddt-color-common-neutral-press/color-base",
|
|
57
|
+
"focus-visible:var-color-ddt-color-common-border-focus/color-state-focus"
|
|
51
58
|
],
|
|
52
|
-
true: ["enabled:var-color-
|
|
59
|
+
true: ["enabled:var-color-ddt-color-common-danger-default/color-base"]
|
|
53
60
|
},
|
|
54
61
|
resize: {
|
|
55
62
|
false: ["resize-none"],
|
|
@@ -58,7 +65,7 @@ const cvaTextArea = cva(
|
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
67
|
);
|
|
61
|
-
let DaikinTextArea = class extends
|
|
68
|
+
let DaikinTextArea = class extends DDSElement {
|
|
62
69
|
constructor() {
|
|
63
70
|
super(...arguments);
|
|
64
71
|
this._internals = this.attachInternals();
|
|
@@ -109,8 +116,12 @@ let DaikinTextArea = class extends LitElement {
|
|
|
109
116
|
}
|
|
110
117
|
this._updateValue(this.value);
|
|
111
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* This method is used by `daikin-input-group` to reflect it's attributes to this component.
|
|
121
|
+
* @private
|
|
122
|
+
*/
|
|
112
123
|
reflectInputGroup(inputGroup) {
|
|
113
|
-
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
124
|
+
const isError = !inputGroup.disabled && (!!inputGroup.error || !!inputGroup.textareaLimitExceeded);
|
|
114
125
|
this.disabled = !!inputGroup.disabled;
|
|
115
126
|
this.required = !!inputGroup.required;
|
|
116
127
|
this.error = isError;
|
|
@@ -158,7 +169,7 @@ __decorateClass([
|
|
|
158
169
|
state()
|
|
159
170
|
], DaikinTextArea.prototype, "_label", 2);
|
|
160
171
|
DaikinTextArea = __decorateClass([
|
|
161
|
-
|
|
172
|
+
ddsElement("daikin-text-area")
|
|
162
173
|
], DaikinTextArea);
|
|
163
174
|
export {
|
|
164
175
|
DaikinTextArea
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { DDSElement } from "../../base/index.js";
|
|
2
3
|
import { DaikinInputGroup } from "../input-group/index.js";
|
|
3
4
|
/**
|
|
4
5
|
* The text field component is a UI element that allows users to input single-line text data.
|
|
@@ -26,7 +27,7 @@ import { DaikinInputGroup } from "../input-group/index.js";
|
|
|
26
27
|
* <daikin-text-field name="name"></daikin-text-field>
|
|
27
28
|
* ```
|
|
28
29
|
*/
|
|
29
|
-
export declare class DaikinTextField extends
|
|
30
|
+
export declare class DaikinTextField extends DDSElement {
|
|
30
31
|
static readonly styles: import('lit').CSSResult;
|
|
31
32
|
static readonly formAssociated = true;
|
|
32
33
|
private _internals;
|
|
@@ -85,6 +86,10 @@ export declare class DaikinTextField extends LitElement {
|
|
|
85
86
|
private _handleInput;
|
|
86
87
|
render(): import('lit-html').TemplateResult<1>;
|
|
87
88
|
updated(changedProperties: PropertyValues<this>): void;
|
|
89
|
+
/**
|
|
90
|
+
* This method is used by `daikin-input-group` to reflect it's attributes to this component.
|
|
91
|
+
* @private
|
|
92
|
+
*/
|
|
88
93
|
reflectInputGroup(inputGroup: DaikinInputGroup): void;
|
|
89
94
|
}
|
|
90
95
|
declare global {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import { css, unsafeCSS,
|
|
3
|
-
import { property, state
|
|
2
|
+
import { css, unsafeCSS, html } from "lit";
|
|
3
|
+
import { property, state } from "lit/decorators.js";
|
|
4
4
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
|
+
import { DDSElement } from "../../base/dds-element.js";
|
|
6
|
+
import { ddsElement } from "../../base/decorators.js";
|
|
7
|
+
import "../../base/define.js";
|
|
5
8
|
import tailwindStyles from "../../tailwind.css.js";
|
|
6
9
|
var __defProp = Object.defineProperty;
|
|
7
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -19,6 +22,7 @@ const cvaInput = cva(
|
|
|
19
22
|
"items-center",
|
|
20
23
|
"w-full",
|
|
21
24
|
"h-full",
|
|
25
|
+
"bg-ddt-color-common-background-default",
|
|
22
26
|
"relative",
|
|
23
27
|
"px-2",
|
|
24
28
|
"rounded",
|
|
@@ -28,31 +32,33 @@ const cvaInput = cva(
|
|
|
28
32
|
"outline-[--color-border]",
|
|
29
33
|
"outline-0",
|
|
30
34
|
"-outline-offset-2",
|
|
31
|
-
"placeholder:text-
|
|
35
|
+
"placeholder:text-ddt-color-common-text-secondary",
|
|
32
36
|
// Define `--color-border` as a CSS variable that references `--color-state-focus` and `--color-base` in that order.
|
|
33
37
|
// `--color-base` indicates the color of the border when the element is normal, hovered, or disabled.
|
|
34
38
|
"define-[--color-state-focus,--color-base]/color-border",
|
|
35
39
|
"border",
|
|
36
40
|
"border-[--color-border]",
|
|
41
|
+
"enabled:text-ddt-color-common-text-primary",
|
|
42
|
+
"enabled:hover:bg-ddt-color-common-surface-hover",
|
|
43
|
+
"enabled:active:bg-ddt-color-common-surface-press",
|
|
44
|
+
"focus-visible:outline-2",
|
|
37
45
|
// Update `--color-base` depending on the state.
|
|
38
46
|
// The default `--color-base` and `--color-state-focus` values are defined in `variants.error` because they differ depending on whether or not the input has an error state.
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"disabled:var-color-system-state-disabled/color-base",
|
|
44
|
-
"disabled:text-system-state-disabled",
|
|
45
|
-
"disabled:bg-white",
|
|
46
|
-
"disabled:placeholder:text-system-state-disabled"
|
|
47
|
+
"disabled:var-color-ddt-color-common-disabled/color-base",
|
|
48
|
+
"disabled:text-ddt-color-common-disabled",
|
|
49
|
+
"disabled:bg-ddt-color-common-background-default",
|
|
50
|
+
"disabled:placeholder:text-ddt-color-common-disabled"
|
|
47
51
|
],
|
|
48
52
|
{
|
|
49
53
|
variants: {
|
|
50
54
|
error: {
|
|
51
55
|
false: [
|
|
52
|
-
"enabled:var-color-
|
|
53
|
-
"
|
|
56
|
+
"enabled:var-color-ddt-color-common-neutral-default/color-base",
|
|
57
|
+
"enabled:hover:var-color-ddt-color-common-neutral-hover/color-base",
|
|
58
|
+
"enabled:active:var-color-ddt-color-common-neutral-press/color-base",
|
|
59
|
+
"focus-visible:var-color-ddt-color-common-border-focus/color-state-focus"
|
|
54
60
|
],
|
|
55
|
-
true: ["enabled:var-color-
|
|
61
|
+
true: ["enabled:var-color-ddt-color-common-danger-default/color-base"]
|
|
56
62
|
},
|
|
57
63
|
leftIcon: {
|
|
58
64
|
false: ["pl-4"],
|
|
@@ -74,13 +80,13 @@ const cvaIcon = cva(
|
|
|
74
80
|
right: "right-3"
|
|
75
81
|
},
|
|
76
82
|
disabled: {
|
|
77
|
-
false: ["text-
|
|
78
|
-
true: ["text-
|
|
83
|
+
false: ["text-ddt-color-common-text-primary"],
|
|
84
|
+
true: ["text-ddt-color-common-disabled"]
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
87
|
}
|
|
82
88
|
);
|
|
83
|
-
let DaikinTextField = class extends
|
|
89
|
+
let DaikinTextField = class extends DDSElement {
|
|
84
90
|
constructor() {
|
|
85
91
|
super(...arguments);
|
|
86
92
|
this._internals = this.attachInternals();
|
|
@@ -157,6 +163,10 @@ let DaikinTextField = class extends LitElement {
|
|
|
157
163
|
}
|
|
158
164
|
this._internals.setFormValue(this.value);
|
|
159
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* This method is used by `daikin-input-group` to reflect it's attributes to this component.
|
|
168
|
+
* @private
|
|
169
|
+
*/
|
|
160
170
|
reflectInputGroup(inputGroup) {
|
|
161
171
|
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
162
172
|
this.disabled = !!inputGroup.disabled;
|
|
@@ -216,7 +226,7 @@ __decorateClass([
|
|
|
216
226
|
state()
|
|
217
227
|
], DaikinTextField.prototype, "_hasRightIcon", 2);
|
|
218
228
|
DaikinTextField = __decorateClass([
|
|
219
|
-
|
|
229
|
+
ddsElement("daikin-text-field")
|
|
220
230
|
], DaikinTextField);
|
|
221
231
|
export {
|
|
222
232
|
DaikinTextField
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { DDSElement } from "../../base/index.js";
|
|
2
|
+
import { MergeVariantProps } from "../../type-utils.js";
|
|
3
|
+
import { cvaContainer, cvaContent, cvaTimestamp } from "../../utils/notification-common.js";
|
|
4
|
+
export type ToastNotificationVariantProps = MergeVariantProps<typeof cvaContainer | typeof cvaContent | typeof cvaTimestamp>;
|
|
5
|
+
/**
|
|
6
|
+
* The toast notification component is a UI element used to inform users about important updates, alerts, or messages within an application.
|
|
7
|
+
*
|
|
8
|
+
* Toast notification displays a brief message that should appear temporarily at the edge of the screen, typically in the bottom or top corner.
|
|
9
|
+
* Toast notification is ideal for conveying transient information that does not require user interaction, such as success messages, warnings, or alerts.
|
|
10
|
+
*
|
|
11
|
+
* Hierarchy:
|
|
12
|
+
* - `daikin-toast-notification-manager` > `daikin-toast-notification`
|
|
13
|
+
*
|
|
14
|
+
* @fires close - A custom event emitted when a user clicks the close button.
|
|
15
|
+
*
|
|
16
|
+
* @slot A slot for the toast notification description content.
|
|
17
|
+
* @slot title - A slot for the toast notification title content.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* ```js
|
|
22
|
+
* import "@daikin-oss/design-system-web-components/components/toast-notification/index.js";
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* ```html
|
|
26
|
+
* <daikin-toast-notification>
|
|
27
|
+
* <span slot="title">ToastNotification title</span>
|
|
28
|
+
* <span slot="description">ToastNotification description</span>
|
|
29
|
+
* </daikin-toast-notification>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class DaikinToastNotification extends DDSElement {
|
|
33
|
+
static readonly styles: import('lit').CSSResult;
|
|
34
|
+
/**
|
|
35
|
+
* Name of the toast notification.
|
|
36
|
+
*/
|
|
37
|
+
name: string;
|
|
38
|
+
/**
|
|
39
|
+
* Status of the toast notification.
|
|
40
|
+
*/
|
|
41
|
+
status: ToastNotificationVariantProps["status"];
|
|
42
|
+
/**
|
|
43
|
+
* Specify how to arrange the elements.
|
|
44
|
+
*/
|
|
45
|
+
layout: ToastNotificationVariantProps["layout"];
|
|
46
|
+
/**
|
|
47
|
+
* Whether to display the close button.
|
|
48
|
+
*/
|
|
49
|
+
closable: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The timestamp to display.
|
|
52
|
+
*/
|
|
53
|
+
timestamp: Date | null;
|
|
54
|
+
/**
|
|
55
|
+
* Specify how long to display the toast (in msec).
|
|
56
|
+
* If `null` is specified, the toast will not be automatically closed.
|
|
57
|
+
*/
|
|
58
|
+
duration: number | null;
|
|
59
|
+
/**
|
|
60
|
+
* Emits a "close" event.
|
|
61
|
+
*/
|
|
62
|
+
private _handleClickClose;
|
|
63
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
64
|
+
}
|
|
65
|
+
declare global {
|
|
66
|
+
interface HTMLElementTagNameMap {
|
|
67
|
+
"daikin-toast-notification": DaikinToastNotification;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { css, unsafeCSS, html, nothing } from "lit";
|
|
2
|
+
import { property } from "lit/decorators.js";
|
|
3
|
+
import { DDSElement } from "../../base/dds-element.js";
|
|
4
|
+
import { ddsElement } from "../../base/decorators.js";
|
|
5
|
+
import "../../base/define.js";
|
|
6
|
+
import tailwindStyles from "../../tailwind.css.js";
|
|
7
|
+
import { TOAST_ANIMATION_DURATION, cvaContainer, cvaContent, cvaTitle, cvaDescription, cvaTimestamp, formatDate } from "../../utils/notification-common.js";
|
|
8
|
+
import "../icon-button/daikin-icon-button.js";
|
|
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
|
+
let DaikinToastNotification = class extends DDSElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.name = "";
|
|
23
|
+
this.status = "positive";
|
|
24
|
+
this.layout = "horizontal";
|
|
25
|
+
this.closable = false;
|
|
26
|
+
this.timestamp = null;
|
|
27
|
+
this.duration = null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Emits a "close" event.
|
|
31
|
+
*/
|
|
32
|
+
_handleClickClose(event) {
|
|
33
|
+
this.dispatchEvent(new Event("close", event));
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return html`<div
|
|
37
|
+
class=${cvaContainer({ variant: "toast", status: this.status })}
|
|
38
|
+
role="alert"
|
|
39
|
+
>
|
|
40
|
+
<div class=${cvaContent({ layout: this.layout })}>
|
|
41
|
+
<slot class=${cvaTitle({ layout: this.layout })} name="title"></slot>
|
|
42
|
+
<slot
|
|
43
|
+
class=${cvaDescription({ layout: this.layout })}
|
|
44
|
+
name="description"
|
|
45
|
+
></slot>
|
|
46
|
+
${this.timestamp ? html`<span class=${cvaTimestamp({ layout: this.layout })}
|
|
47
|
+
>${formatDate(this.timestamp)}</span
|
|
48
|
+
>` : nothing}
|
|
49
|
+
</div>
|
|
50
|
+
<slot name="action" class="flex-none"></slot>
|
|
51
|
+
${this.closable ? html`<daikin-icon-button
|
|
52
|
+
variant="ghost"
|
|
53
|
+
button-aria-label="Close"
|
|
54
|
+
@click=${this._handleClickClose}
|
|
55
|
+
>
|
|
56
|
+
<span
|
|
57
|
+
class="flex size-6 text-ddt-color-common-text-secondary relative i-daikin-cross"
|
|
58
|
+
></span>
|
|
59
|
+
</daikin-icon-button>` : nothing}
|
|
60
|
+
</div>`;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
DaikinToastNotification.styles = css`
|
|
64
|
+
${unsafeCSS(tailwindStyles)}
|
|
65
|
+
|
|
66
|
+
:host {
|
|
67
|
+
display: block;
|
|
68
|
+
|
|
69
|
+
--ddc-toast-animation-duration: ${unsafeCSS(TOAST_ANIMATION_DURATION)}ms;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
__decorateClass([
|
|
73
|
+
property({ type: String, reflect: true })
|
|
74
|
+
], DaikinToastNotification.prototype, "name", 2);
|
|
75
|
+
__decorateClass([
|
|
76
|
+
property({ type: String })
|
|
77
|
+
], DaikinToastNotification.prototype, "status", 2);
|
|
78
|
+
__decorateClass([
|
|
79
|
+
property({ type: String })
|
|
80
|
+
], DaikinToastNotification.prototype, "layout", 2);
|
|
81
|
+
__decorateClass([
|
|
82
|
+
property({ type: Boolean, reflect: true })
|
|
83
|
+
], DaikinToastNotification.prototype, "closable", 2);
|
|
84
|
+
__decorateClass([
|
|
85
|
+
property({ type: Object, reflect: true, attribute: false })
|
|
86
|
+
], DaikinToastNotification.prototype, "timestamp", 2);
|
|
87
|
+
__decorateClass([
|
|
88
|
+
property({ type: Number, reflect: true })
|
|
89
|
+
], DaikinToastNotification.prototype, "duration", 2);
|
|
90
|
+
DaikinToastNotification = __decorateClass([
|
|
91
|
+
ddsElement("daikin-toast-notification")
|
|
92
|
+
], DaikinToastNotification);
|
|
93
|
+
export {
|
|
94
|
+
DaikinToastNotification
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./daikin-toast-notification.js";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DDSElement } from "../../base/index.js";
|
|
2
|
+
import { MergeVariantProps } from "../../type-utils.js";
|
|
3
|
+
declare const cvaContainer: (props?: ({
|
|
4
|
+
position?: "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export type ToastPosition = MergeVariantProps<typeof cvaContainer>["position"];
|
|
7
|
+
/**
|
|
8
|
+
* The toast manager component manages the position and display state of notification toasts.
|
|
9
|
+
* Just place a notification toast in the slot and it will automatically be placed, stacked and animated.
|
|
10
|
+
*
|
|
11
|
+
* Hierarchy:
|
|
12
|
+
* - `daikin-toast-notification-manager` > `daikin-toast-notification`
|
|
13
|
+
*
|
|
14
|
+
* @fires close - A custom event emitted when a user clicks the close button. The toast manager does not remove toast elements, so you will need to remove the relevant toast element after receiving this event.
|
|
15
|
+
*
|
|
16
|
+
* @slot A slot for toasts. Place `daikin-toast-notification` elements here.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
*
|
|
20
|
+
* ```js
|
|
21
|
+
* import "@daikin-oss/design-system-web-components/components/toast-notification-manager/index.js";
|
|
22
|
+
* import "@daikin-oss/design-system-web-components/components/toast-notification/index.js";
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* ```html
|
|
26
|
+
* <daikin-toast-notification-manager>
|
|
27
|
+
* <daikin-toast-notification name="toast1">
|
|
28
|
+
* <span slot="title">Toast title</span>
|
|
29
|
+
* <span slot="description">Toast description</span>
|
|
30
|
+
* </daikin-toast-notification>
|
|
31
|
+
* <daikin-toast-notification name="toast2">
|
|
32
|
+
* <span slot="title">Toast title</span>
|
|
33
|
+
* <span slot="description">Toast description</span>
|
|
34
|
+
* </daikin-toast-notification>
|
|
35
|
+
* <daikin-toast-notification name="toast3">
|
|
36
|
+
* <span slot="title">Toast title</span>
|
|
37
|
+
* <span slot="description">Toast description</span>
|
|
38
|
+
* </daikin-toast-notification>
|
|
39
|
+
* </daikin-toast-notification-manager>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare class DaikinToastNotificationManager extends DDSElement {
|
|
43
|
+
static readonly styles: import('lit').CSSResult;
|
|
44
|
+
/**
|
|
45
|
+
* Specify where on the screen the toast will be displayed.
|
|
46
|
+
*/
|
|
47
|
+
position: ToastPosition;
|
|
48
|
+
private readonly _items;
|
|
49
|
+
private _knownItemSet;
|
|
50
|
+
private _closedItemSet;
|
|
51
|
+
private _containerRef;
|
|
52
|
+
private get _positionY();
|
|
53
|
+
private get _sign();
|
|
54
|
+
private _close;
|
|
55
|
+
private _handleClose;
|
|
56
|
+
private _handleNewItem;
|
|
57
|
+
private _handleSlotchange;
|
|
58
|
+
private _scheduleRemoveToast;
|
|
59
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
60
|
+
protected firstUpdated(): void;
|
|
61
|
+
}
|
|
62
|
+
declare global {
|
|
63
|
+
interface HTMLElementTagNameMap {
|
|
64
|
+
"daikin-toast-notification-manager": DaikinToastNotificationManager;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { css, unsafeCSS, html } from "lit";
|
|
3
|
+
import { property, queryAssignedElements } from "lit/decorators.js";
|
|
4
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
5
|
+
import { DDSElement } from "../../base/dds-element.js";
|
|
6
|
+
import { ddsElement } from "../../base/decorators.js";
|
|
7
|
+
import "../../base/define.js";
|
|
8
|
+
import tailwindStyles from "../../tailwind.css.js";
|
|
9
|
+
import { TOAST_ANIMATION_DURATION } from "../../utils/notification-common.js";
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
13
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
14
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
15
|
+
if (decorator = decorators[i])
|
|
16
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
17
|
+
if (kind && result) __defProp(target, key, result);
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
20
|
+
const CONTAINER_TRANSITION_DURATION = "--container-transition-duration";
|
|
21
|
+
const CONTAINER_MOVE_OFFSET_Y = "--container-move-offset-y";
|
|
22
|
+
const TOAST_MOVE_OFFSET_X = "24px";
|
|
23
|
+
const TOAST_MOVE_OFFSET_Y_TOP_SIGN = -1;
|
|
24
|
+
const TOAST_MOVE_OFFSET_Y_BOTTOM_SIGN = 1;
|
|
25
|
+
const cvaContainer = cva(
|
|
26
|
+
[
|
|
27
|
+
"flex",
|
|
28
|
+
"gap-2",
|
|
29
|
+
"w-max",
|
|
30
|
+
"fixed",
|
|
31
|
+
"transition-transform",
|
|
32
|
+
"translate-y-[var(--container-move-offset-y,0)]",
|
|
33
|
+
"duration-[var(--container-transition-duration,200ms)]"
|
|
34
|
+
],
|
|
35
|
+
{
|
|
36
|
+
variants: {
|
|
37
|
+
position: {
|
|
38
|
+
top: [
|
|
39
|
+
"items-center",
|
|
40
|
+
"flex-col",
|
|
41
|
+
"m-auto",
|
|
42
|
+
"top-4",
|
|
43
|
+
"left-0",
|
|
44
|
+
"right-0"
|
|
45
|
+
],
|
|
46
|
+
"top-left": ["items-start", "flex-col", "top-4", "left-4"],
|
|
47
|
+
"top-right": ["items-end", "flex-col", "top-4", "right-4"],
|
|
48
|
+
bottom: [
|
|
49
|
+
"items-center",
|
|
50
|
+
"flex-col-reverse",
|
|
51
|
+
"m-auto",
|
|
52
|
+
"bottom-4",
|
|
53
|
+
"left-0",
|
|
54
|
+
"right-0"
|
|
55
|
+
],
|
|
56
|
+
"bottom-left": [
|
|
57
|
+
"items-start",
|
|
58
|
+
"flex-col-reverse",
|
|
59
|
+
"bottom-4",
|
|
60
|
+
"left-4"
|
|
61
|
+
],
|
|
62
|
+
"bottom-right": [
|
|
63
|
+
"items-end",
|
|
64
|
+
"flex-col-reverse",
|
|
65
|
+
"bottom-4",
|
|
66
|
+
"right-4"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
let DaikinToastNotificationManager = class extends DDSElement {
|
|
73
|
+
constructor() {
|
|
74
|
+
super(...arguments);
|
|
75
|
+
this.position = "bottom-right";
|
|
76
|
+
this._knownItemSet = /* @__PURE__ */ new Set();
|
|
77
|
+
this._closedItemSet = /* @__PURE__ */ new WeakSet();
|
|
78
|
+
this._containerRef = createRef();
|
|
79
|
+
}
|
|
80
|
+
get _positionY() {
|
|
81
|
+
return this.position.startsWith("top") ? "top" : "bottom";
|
|
82
|
+
}
|
|
83
|
+
get _sign() {
|
|
84
|
+
return this._positionY === "top" ? TOAST_MOVE_OFFSET_Y_TOP_SIGN : TOAST_MOVE_OFFSET_Y_BOTTOM_SIGN;
|
|
85
|
+
}
|
|
86
|
+
_close(target) {
|
|
87
|
+
if (this._closedItemSet.has(target)) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this._closedItemSet.add(target);
|
|
91
|
+
const items = this._items;
|
|
92
|
+
const targetIndex = items.findIndex((item) => item === target);
|
|
93
|
+
if (targetIndex === -1) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const moveOffsetY = `calc(${0.5 * this._sign}rem + ${target.clientHeight * this._sign}px)`;
|
|
97
|
+
for (const [index, item] of items.entries()) {
|
|
98
|
+
item.style.removeProperty("--transition-duration");
|
|
99
|
+
if (index > targetIndex) {
|
|
100
|
+
item.style.setProperty("--move-offset-y", moveOffsetY);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
target.style.setProperty("--move-offset-x", TOAST_MOVE_OFFSET_X);
|
|
104
|
+
target.style.setProperty("--opacity", "0");
|
|
105
|
+
target.style.setProperty("--pointer-events", "none");
|
|
106
|
+
setTimeout(() => {
|
|
107
|
+
for (const item of this._items) {
|
|
108
|
+
item.style.setProperty("--transition-duration", "0");
|
|
109
|
+
item.style.removeProperty("--move-offset-y");
|
|
110
|
+
}
|
|
111
|
+
target.hidden = true;
|
|
112
|
+
this.dispatchEvent(new CustomEvent("close", { detail: { target } }));
|
|
113
|
+
}, TOAST_ANIMATION_DURATION);
|
|
114
|
+
}
|
|
115
|
+
_handleClose(event) {
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
this._close(event.target);
|
|
118
|
+
}
|
|
119
|
+
_handleNewItem(newItem) {
|
|
120
|
+
const container = this._containerRef.value;
|
|
121
|
+
if (!container) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
requestAnimationFrame(() => {
|
|
125
|
+
newItem.style.setProperty("--opacity", "0");
|
|
126
|
+
container.style.setProperty(CONTAINER_TRANSITION_DURATION, "0");
|
|
127
|
+
container.style.setProperty(
|
|
128
|
+
CONTAINER_MOVE_OFFSET_Y,
|
|
129
|
+
`calc(${0.5 * this._sign}rem + ${newItem.clientHeight * this._sign}px)`
|
|
130
|
+
);
|
|
131
|
+
requestAnimationFrame(() => {
|
|
132
|
+
container.style.removeProperty(CONTAINER_TRANSITION_DURATION);
|
|
133
|
+
container.style.removeProperty(CONTAINER_MOVE_OFFSET_Y);
|
|
134
|
+
newItem.style.removeProperty("--opacity");
|
|
135
|
+
this._scheduleRemoveToast(newItem);
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
_handleSlotchange() {
|
|
140
|
+
const items = this._items;
|
|
141
|
+
const newItems = items.filter((item) => !this._knownItemSet.has(item));
|
|
142
|
+
this._knownItemSet = new Set(items);
|
|
143
|
+
for (const newItem of newItems) {
|
|
144
|
+
this._handleNewItem(newItem);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
_scheduleRemoveToast(target) {
|
|
148
|
+
if (target.duration === null) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
setTimeout(() => {
|
|
152
|
+
this._close(target);
|
|
153
|
+
}, target.duration);
|
|
154
|
+
}
|
|
155
|
+
render() {
|
|
156
|
+
return html`<aside
|
|
157
|
+
${ref(this._containerRef)}
|
|
158
|
+
class=${cvaContainer({ position: this.position })}
|
|
159
|
+
popover="manual"
|
|
160
|
+
>
|
|
161
|
+
<slot
|
|
162
|
+
@close=${this._handleClose}
|
|
163
|
+
@slotchange=${this._handleSlotchange}
|
|
164
|
+
></slot>
|
|
165
|
+
</aside>`;
|
|
166
|
+
}
|
|
167
|
+
firstUpdated() {
|
|
168
|
+
const container = this._containerRef.value;
|
|
169
|
+
if (container) {
|
|
170
|
+
container.showPopover();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
DaikinToastNotificationManager.styles = css`
|
|
175
|
+
${unsafeCSS(tailwindStyles)}
|
|
176
|
+
|
|
177
|
+
:host {
|
|
178
|
+
display: block;
|
|
179
|
+
width: max-content;
|
|
180
|
+
}
|
|
181
|
+
`;
|
|
182
|
+
__decorateClass([
|
|
183
|
+
property({ type: String, reflect: true })
|
|
184
|
+
], DaikinToastNotificationManager.prototype, "position", 2);
|
|
185
|
+
__decorateClass([
|
|
186
|
+
queryAssignedElements({ selector: "daikin-toast-notification" })
|
|
187
|
+
], DaikinToastNotificationManager.prototype, "_items", 2);
|
|
188
|
+
DaikinToastNotificationManager = __decorateClass([
|
|
189
|
+
ddsElement("daikin-toast-notification-manager")
|
|
190
|
+
], DaikinToastNotificationManager);
|
|
191
|
+
export {
|
|
192
|
+
DaikinToastNotificationManager
|
|
193
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./daikin-toast-notification-manager.js";
|