@daikin-oss/design-system-web-components 0.3.2 → 0.5.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 +104 -0
- package/dist/cjs/components/accordion/daikin-accordion.cjs +24 -6
- package/dist/cjs/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +106 -59
- package/dist/cjs/components/accordion-item/daikin-accordion-item.d.ts +28 -13
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.cjs +3 -6
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +38 -30
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
- package/dist/cjs/components/button/daikin-button.cjs +89 -128
- package/dist/cjs/components/button/daikin-button.d.ts +30 -27
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +100 -119
- package/dist/cjs/components/checkbox/daikin-checkbox.d.ts +27 -38
- package/dist/cjs/components/dropdown/daikin-dropdown.cjs +367 -0
- package/dist/cjs/components/dropdown/daikin-dropdown.d.ts +100 -0
- package/dist/cjs/components/dropdown/index.cjs +7 -0
- package/dist/cjs/components/dropdown/index.d.ts +1 -0
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.cjs +112 -0
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.d.ts +42 -0
- package/dist/cjs/components/dropdown-item/index.cjs +7 -0
- package/dist/cjs/components/dropdown-item/index.d.ts +1 -0
- package/dist/cjs/components/icon/daikin-icon.d.ts +4 -0
- package/dist/cjs/components/icon/icons.json.cjs +29 -5
- package/dist/cjs/components/icon/icons.json.d.ts +29 -5
- package/dist/cjs/components/index.cjs +49 -14
- package/dist/cjs/components/index.d.ts +11 -4
- package/dist/cjs/components/input-group/daikin-input-group.cjs +103 -46
- package/dist/cjs/components/input-group/daikin-input-group.d.ts +69 -25
- package/dist/cjs/components/list/daikin-list.cjs +24 -0
- package/dist/cjs/components/list/daikin-list.d.ts +28 -0
- package/dist/cjs/components/list/index.cjs +7 -0
- package/dist/cjs/components/list/index.d.ts +1 -0
- package/dist/cjs/components/list-item/daikin-list-item.cjs +131 -0
- package/dist/cjs/components/list-item/daikin-list-item.d.ts +64 -0
- package/dist/cjs/components/list-item/index.cjs +7 -0
- package/dist/cjs/components/list-item/index.d.ts +1 -0
- package/dist/cjs/components/notification/daikin-notification.cjs +14 -15
- package/dist/cjs/components/notification/daikin-notification.d.ts +13 -11
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +53 -29
- package/dist/cjs/components/progress-bar/daikin-progress-bar.d.ts +32 -10
- package/dist/cjs/components/progress-indicator/daikin-progress-indicator.cjs +75 -0
- package/dist/cjs/components/progress-indicator/daikin-progress-indicator.d.ts +47 -0
- package/dist/cjs/components/progress-indicator/index.cjs +7 -0
- package/dist/cjs/components/progress-indicator/index.d.ts +1 -0
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.cjs +92 -0
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.d.ts +44 -0
- package/dist/cjs/components/progress-indicator-item/index.cjs +7 -0
- package/dist/cjs/components/progress-indicator-item/index.d.ts +1 -0
- package/dist/cjs/components/radio/daikin-radio.cjs +92 -90
- package/dist/cjs/components/radio/daikin-radio.d.ts +33 -35
- package/dist/cjs/components/radio-group/daikin-radio-group.cjs +144 -0
- package/dist/cjs/components/radio-group/daikin-radio-group.d.ts +82 -0
- package/dist/cjs/components/radio-group/index.cjs +7 -0
- package/dist/cjs/components/radio-group/index.d.ts +1 -0
- package/dist/cjs/components/select/daikin-select.cjs +160 -0
- package/dist/cjs/components/select/daikin-select.d.ts +60 -0
- package/dist/cjs/components/select/index.cjs +7 -0
- package/dist/cjs/components/select/index.d.ts +1 -0
- package/dist/cjs/components/tab/daikin-tab.cjs +48 -48
- package/dist/cjs/components/tab/daikin-tab.d.ts +12 -12
- package/dist/cjs/components/{panel-switcher/daikin-panel-switcher.cjs → tab-panels/daikin-tab-panels.cjs} +8 -8
- package/dist/cjs/components/tab-panels/daikin-tab-panels.d.ts +56 -0
- package/dist/cjs/components/tab-panels/index.cjs +7 -0
- package/dist/cjs/components/tab-panels/index.d.ts +1 -0
- package/dist/cjs/components/{tab-group/daikin-tab-group.cjs → tabs/daikin-tabs.cjs} +35 -36
- package/dist/{es-dev/components/tab-group/daikin-tab-group.d.ts → cjs/components/tabs/daikin-tabs.d.ts} +27 -25
- package/dist/cjs/components/tabs/index.cjs +7 -0
- package/dist/cjs/components/tabs/index.d.ts +1 -0
- package/dist/cjs/components/text-area/daikin-text-area.cjs +164 -0
- package/dist/cjs/components/text-area/daikin-text-area.d.ts +82 -0
- package/dist/cjs/components/text-area/index.cjs +7 -0
- package/dist/cjs/components/text-area/index.d.ts +1 -0
- package/dist/cjs/components/text-field/daikin-text-field.cjs +211 -0
- package/dist/cjs/components/text-field/daikin-text-field.d.ts +94 -0
- package/dist/cjs/components/text-field/index.cjs +7 -0
- package/dist/cjs/components/text-field/index.d.ts +1 -0
- package/dist/cjs/components/toggle/daikin-toggle.cjs +44 -68
- package/dist/cjs/components/toggle/daikin-toggle.d.ts +15 -26
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +77 -70
- package/dist/cjs/components/tooltip/daikin-tooltip.d.ts +39 -15
- package/dist/cjs/controllers/click-outside.cjs +29 -0
- package/dist/cjs/controllers/click-outside.d.ts +37 -0
- package/dist/cjs/controllers/floating-ui-auto-update.cjs +75 -0
- package/dist/cjs/controllers/floating-ui-auto-update.d.ts +22 -0
- package/dist/cjs/controllers/helpers/controller-directive.cjs +50 -0
- package/dist/cjs/controllers/helpers/controller-directive.d.ts +12 -0
- package/dist/cjs/index.cjs +49 -14
- package/dist/cjs/tailwind.css.cjs +1 -1
- package/dist/cjs/utils/reDispatch.cjs +10 -0
- package/dist/cjs/utils/reDispatch.d.ts +1 -0
- package/dist/cjs-dev/components/accordion/daikin-accordion.cjs +24 -6
- package/dist/cjs-dev/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +106 -59
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.d.ts +28 -13
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.cjs +3 -6
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +38 -30
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
- package/dist/cjs-dev/components/button/daikin-button.cjs +89 -128
- package/dist/cjs-dev/components/button/daikin-button.d.ts +30 -27
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +100 -119
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.ts +27 -38
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +367 -0
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.ts +100 -0
- package/dist/cjs-dev/components/dropdown/index.cjs +7 -0
- package/dist/cjs-dev/components/dropdown/index.d.ts +1 -0
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.cjs +112 -0
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.d.ts +42 -0
- package/dist/cjs-dev/components/dropdown-item/index.cjs +7 -0
- package/dist/cjs-dev/components/dropdown-item/index.d.ts +1 -0
- package/dist/cjs-dev/components/icon/daikin-icon.d.ts +4 -0
- package/dist/cjs-dev/components/icon/icons.json.cjs +29 -5
- package/dist/cjs-dev/components/icon/icons.json.d.ts +29 -5
- package/dist/cjs-dev/components/index.cjs +49 -14
- package/dist/cjs-dev/components/index.d.ts +11 -4
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +103 -46
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.ts +69 -25
- package/dist/cjs-dev/components/list/daikin-list.cjs +24 -0
- package/dist/cjs-dev/components/list/daikin-list.d.ts +28 -0
- package/dist/cjs-dev/components/list/index.cjs +7 -0
- package/dist/cjs-dev/components/list/index.d.ts +1 -0
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +131 -0
- package/dist/cjs-dev/components/list-item/daikin-list-item.d.ts +64 -0
- package/dist/cjs-dev/components/list-item/index.cjs +7 -0
- package/dist/cjs-dev/components/list-item/index.d.ts +1 -0
- package/dist/cjs-dev/components/notification/daikin-notification.cjs +14 -15
- package/dist/cjs-dev/components/notification/daikin-notification.d.ts +13 -11
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +53 -29
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.d.ts +32 -10
- package/dist/cjs-dev/components/progress-indicator/daikin-progress-indicator.cjs +85 -0
- package/dist/cjs-dev/components/progress-indicator/daikin-progress-indicator.d.ts +47 -0
- package/dist/cjs-dev/components/progress-indicator/index.cjs +7 -0
- package/dist/cjs-dev/components/progress-indicator/index.d.ts +1 -0
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.cjs +92 -0
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.d.ts +44 -0
- package/dist/cjs-dev/components/progress-indicator-item/index.cjs +7 -0
- package/dist/cjs-dev/components/progress-indicator-item/index.d.ts +1 -0
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +92 -90
- package/dist/cjs-dev/components/radio/daikin-radio.d.ts +33 -35
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.cjs +144 -0
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.d.ts +82 -0
- package/dist/cjs-dev/components/radio-group/index.cjs +7 -0
- package/dist/cjs-dev/components/radio-group/index.d.ts +1 -0
- package/dist/cjs-dev/components/select/daikin-select.cjs +160 -0
- package/dist/cjs-dev/components/select/daikin-select.d.ts +60 -0
- package/dist/cjs-dev/components/select/index.cjs +7 -0
- package/dist/cjs-dev/components/select/index.d.ts +1 -0
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +48 -48
- package/dist/cjs-dev/components/tab/daikin-tab.d.ts +12 -12
- package/dist/cjs-dev/components/{panel-switcher/daikin-panel-switcher.cjs → tab-panels/daikin-tab-panels.cjs} +9 -9
- package/dist/cjs-dev/components/tab-panels/daikin-tab-panels.d.ts +56 -0
- package/dist/cjs-dev/components/tab-panels/index.cjs +7 -0
- package/dist/cjs-dev/components/tab-panels/index.d.ts +1 -0
- package/dist/cjs-dev/components/{tab-group/daikin-tab-group.cjs → tabs/daikin-tabs.cjs} +37 -38
- package/dist/{cjs/components/tab-group/daikin-tab-group.d.ts → cjs-dev/components/tabs/daikin-tabs.d.ts} +27 -25
- package/dist/cjs-dev/components/tabs/index.cjs +7 -0
- package/dist/cjs-dev/components/tabs/index.d.ts +1 -0
- package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +164 -0
- package/dist/cjs-dev/components/text-area/daikin-text-area.d.ts +82 -0
- package/dist/cjs-dev/components/text-area/index.cjs +7 -0
- package/dist/cjs-dev/components/text-area/index.d.ts +1 -0
- package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +211 -0
- package/dist/cjs-dev/components/text-field/daikin-text-field.d.ts +94 -0
- package/dist/cjs-dev/components/text-field/index.cjs +7 -0
- package/dist/cjs-dev/components/text-field/index.d.ts +1 -0
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +44 -68
- package/dist/cjs-dev/components/toggle/daikin-toggle.d.ts +15 -26
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +77 -70
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.ts +39 -15
- package/dist/cjs-dev/controllers/click-outside.cjs +29 -0
- package/dist/cjs-dev/controllers/click-outside.d.ts +37 -0
- package/dist/cjs-dev/controllers/floating-ui-auto-update.cjs +82 -0
- package/dist/cjs-dev/controllers/floating-ui-auto-update.d.ts +22 -0
- package/dist/cjs-dev/controllers/helpers/controller-directive.cjs +50 -0
- package/dist/cjs-dev/controllers/helpers/controller-directive.d.ts +12 -0
- package/dist/cjs-dev/index.cjs +49 -14
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- package/dist/cjs-dev/utils/reDispatch.cjs +10 -0
- package/dist/cjs-dev/utils/reDispatch.d.ts +1 -0
- package/dist/es/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/es/components/accordion/daikin-accordion.js +25 -7
- package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +28 -13
- package/dist/es/components/accordion-item/daikin-accordion-item.js +107 -60
- package/dist/es/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +3 -6
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +38 -30
- package/dist/es/components/button/daikin-button.d.ts +30 -27
- package/dist/es/components/button/daikin-button.js +90 -129
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +27 -38
- package/dist/es/components/checkbox/daikin-checkbox.js +102 -121
- package/dist/es/components/dropdown/daikin-dropdown.d.ts +100 -0
- package/dist/es/components/dropdown/daikin-dropdown.js +368 -0
- package/dist/es/components/dropdown/index.d.ts +1 -0
- package/dist/es/components/dropdown/index.js +4 -0
- package/dist/es/components/dropdown-item/daikin-dropdown-item.d.ts +42 -0
- package/dist/es/components/dropdown-item/daikin-dropdown-item.js +113 -0
- package/dist/es/components/dropdown-item/index.d.ts +1 -0
- package/dist/es/components/dropdown-item/index.js +4 -0
- package/dist/es/components/icon/daikin-icon.d.ts +4 -0
- package/dist/es/components/icon/icons.json.d.ts +29 -5
- package/dist/es/components/icon/icons.json.js +29 -5
- package/dist/es/components/index.d.ts +11 -4
- package/dist/es/components/index.js +22 -8
- package/dist/es/components/input-group/daikin-input-group.d.ts +69 -25
- package/dist/es/components/input-group/daikin-input-group.js +105 -48
- package/dist/es/components/list/daikin-list.d.ts +28 -0
- package/dist/es/components/list/daikin-list.js +25 -0
- package/dist/es/components/list/index.d.ts +1 -0
- package/dist/es/components/list/index.js +4 -0
- package/dist/es/components/list-item/daikin-list-item.d.ts +64 -0
- package/dist/es/components/list-item/daikin-list-item.js +132 -0
- package/dist/es/components/list-item/index.d.ts +1 -0
- package/dist/es/components/list-item/index.js +4 -0
- package/dist/es/components/notification/daikin-notification.d.ts +13 -11
- package/dist/es/components/notification/daikin-notification.js +15 -16
- package/dist/es/components/progress-bar/daikin-progress-bar.d.ts +32 -10
- package/dist/es/components/progress-bar/daikin-progress-bar.js +53 -29
- package/dist/es/components/progress-indicator/daikin-progress-indicator.d.ts +47 -0
- package/dist/es/components/progress-indicator/daikin-progress-indicator.js +76 -0
- package/dist/es/components/progress-indicator/index.d.ts +1 -0
- package/dist/es/components/progress-indicator/index.js +4 -0
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.d.ts +44 -0
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.js +93 -0
- package/dist/es/components/progress-indicator-item/index.d.ts +1 -0
- package/dist/es/components/progress-indicator-item/index.js +4 -0
- package/dist/es/components/radio/daikin-radio.d.ts +33 -35
- package/dist/es/components/radio/daikin-radio.js +94 -92
- package/dist/es/components/radio-group/daikin-radio-group.d.ts +82 -0
- package/dist/es/components/radio-group/daikin-radio-group.js +145 -0
- package/dist/es/components/radio-group/index.d.ts +1 -0
- package/dist/es/components/radio-group/index.js +4 -0
- package/dist/es/components/select/daikin-select.d.ts +60 -0
- package/dist/es/components/select/daikin-select.js +161 -0
- package/dist/es/components/select/index.d.ts +1 -0
- package/dist/es/components/select/index.js +4 -0
- package/dist/es/components/tab/daikin-tab.d.ts +12 -12
- package/dist/es/components/tab/daikin-tab.js +49 -49
- package/dist/es/components/tab-panels/daikin-tab-panels.d.ts +56 -0
- package/dist/es/components/{panel-switcher/daikin-panel-switcher.js → tab-panels/daikin-tab-panels.js} +9 -9
- package/dist/es/components/tab-panels/index.d.ts +1 -0
- package/dist/es/components/tab-panels/index.js +4 -0
- package/dist/es/components/{tab-group/daikin-tab-group.d.ts → tabs/daikin-tabs.d.ts} +27 -25
- package/dist/es/components/{tab-group/daikin-tab-group.js → tabs/daikin-tabs.js} +36 -37
- package/dist/es/components/tabs/index.d.ts +1 -0
- package/dist/es/components/tabs/index.js +4 -0
- package/dist/es/components/text-area/daikin-text-area.d.ts +82 -0
- package/dist/es/components/text-area/daikin-text-area.js +165 -0
- package/dist/es/components/text-area/index.d.ts +1 -0
- package/dist/es/components/text-area/index.js +4 -0
- package/dist/es/components/text-field/daikin-text-field.d.ts +94 -0
- package/dist/es/components/text-field/daikin-text-field.js +212 -0
- package/dist/es/components/text-field/index.d.ts +1 -0
- package/dist/es/components/text-field/index.js +4 -0
- package/dist/es/components/toggle/daikin-toggle.d.ts +15 -26
- package/dist/es/components/toggle/daikin-toggle.js +45 -69
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +39 -15
- package/dist/es/components/tooltip/daikin-tooltip.js +78 -71
- package/dist/es/controllers/click-outside.d.ts +37 -0
- package/dist/es/controllers/click-outside.js +29 -0
- package/dist/es/controllers/floating-ui-auto-update.d.ts +22 -0
- package/dist/es/controllers/floating-ui-auto-update.js +75 -0
- package/dist/es/controllers/helpers/controller-directive.d.ts +12 -0
- package/dist/es/controllers/helpers/controller-directive.js +50 -0
- package/dist/es/index.js +22 -8
- package/dist/es/tailwind.css.js +1 -1
- package/dist/es/utils/reDispatch.d.ts +1 -0
- package/dist/es/utils/reDispatch.js +10 -0
- package/dist/es-dev/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/es-dev/components/accordion/daikin-accordion.js +25 -7
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.d.ts +28 -13
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +107 -60
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +3 -6
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +38 -30
- package/dist/es-dev/components/button/daikin-button.d.ts +30 -27
- package/dist/es-dev/components/button/daikin-button.js +90 -129
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +27 -38
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +102 -121
- package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +100 -0
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +368 -0
- package/dist/es-dev/components/dropdown/index.d.ts +1 -0
- package/dist/es-dev/components/dropdown/index.js +4 -0
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.d.ts +42 -0
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +113 -0
- package/dist/es-dev/components/dropdown-item/index.d.ts +1 -0
- package/dist/es-dev/components/dropdown-item/index.js +4 -0
- package/dist/es-dev/components/icon/daikin-icon.d.ts +4 -0
- package/dist/es-dev/components/icon/icons.json.d.ts +29 -5
- package/dist/es-dev/components/icon/icons.json.js +29 -5
- package/dist/es-dev/components/index.d.ts +11 -4
- package/dist/es-dev/components/index.js +22 -8
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +69 -25
- package/dist/es-dev/components/input-group/daikin-input-group.js +105 -48
- package/dist/es-dev/components/list/daikin-list.d.ts +28 -0
- package/dist/es-dev/components/list/daikin-list.js +25 -0
- package/dist/es-dev/components/list/index.d.ts +1 -0
- package/dist/es-dev/components/list/index.js +4 -0
- package/dist/es-dev/components/list-item/daikin-list-item.d.ts +64 -0
- package/dist/es-dev/components/list-item/daikin-list-item.js +132 -0
- package/dist/es-dev/components/list-item/index.d.ts +1 -0
- package/dist/es-dev/components/list-item/index.js +4 -0
- package/dist/es-dev/components/notification/daikin-notification.d.ts +13 -11
- package/dist/es-dev/components/notification/daikin-notification.js +15 -16
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.d.ts +32 -10
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +53 -29
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.d.ts +47 -0
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.js +86 -0
- package/dist/es-dev/components/progress-indicator/index.d.ts +1 -0
- package/dist/es-dev/components/progress-indicator/index.js +4 -0
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.d.ts +44 -0
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.js +93 -0
- package/dist/es-dev/components/progress-indicator-item/index.d.ts +1 -0
- package/dist/es-dev/components/progress-indicator-item/index.js +4 -0
- package/dist/es-dev/components/radio/daikin-radio.d.ts +33 -35
- package/dist/es-dev/components/radio/daikin-radio.js +94 -92
- package/dist/es-dev/components/radio-group/daikin-radio-group.d.ts +82 -0
- package/dist/es-dev/components/radio-group/daikin-radio-group.js +145 -0
- package/dist/es-dev/components/radio-group/index.d.ts +1 -0
- package/dist/es-dev/components/radio-group/index.js +4 -0
- package/dist/es-dev/components/select/daikin-select.d.ts +60 -0
- package/dist/es-dev/components/select/daikin-select.js +161 -0
- package/dist/es-dev/components/select/index.d.ts +1 -0
- package/dist/es-dev/components/select/index.js +4 -0
- package/dist/es-dev/components/tab/daikin-tab.d.ts +12 -12
- package/dist/es-dev/components/tab/daikin-tab.js +49 -49
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.d.ts +56 -0
- package/dist/es-dev/components/{panel-switcher/daikin-panel-switcher.js → tab-panels/daikin-tab-panels.js} +10 -10
- package/dist/es-dev/components/tab-panels/index.d.ts +1 -0
- package/dist/es-dev/components/tab-panels/index.js +4 -0
- package/dist/{cjs-dev/components/tab-group/daikin-tab-group.d.ts → es-dev/components/tabs/daikin-tabs.d.ts} +27 -25
- package/dist/es-dev/components/{tab-group/daikin-tab-group.js → tabs/daikin-tabs.js} +38 -39
- package/dist/es-dev/components/tabs/index.d.ts +1 -0
- package/dist/es-dev/components/tabs/index.js +4 -0
- package/dist/es-dev/components/text-area/daikin-text-area.d.ts +82 -0
- package/dist/es-dev/components/text-area/daikin-text-area.js +165 -0
- package/dist/es-dev/components/text-area/index.d.ts +1 -0
- package/dist/es-dev/components/text-area/index.js +4 -0
- package/dist/es-dev/components/text-field/daikin-text-field.d.ts +94 -0
- package/dist/es-dev/components/text-field/daikin-text-field.js +212 -0
- package/dist/es-dev/components/text-field/index.d.ts +1 -0
- package/dist/es-dev/components/text-field/index.js +4 -0
- package/dist/es-dev/components/toggle/daikin-toggle.d.ts +15 -26
- package/dist/es-dev/components/toggle/daikin-toggle.js +45 -69
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +39 -15
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +78 -71
- package/dist/es-dev/controllers/click-outside.d.ts +37 -0
- package/dist/es-dev/controllers/click-outside.js +29 -0
- package/dist/es-dev/controllers/floating-ui-auto-update.d.ts +22 -0
- package/dist/es-dev/controllers/floating-ui-auto-update.js +82 -0
- package/dist/es-dev/controllers/helpers/controller-directive.d.ts +12 -0
- package/dist/es-dev/controllers/helpers/controller-directive.js +50 -0
- package/dist/es-dev/index.js +22 -8
- package/dist/es-dev/tailwind.css.js +1 -1
- package/dist/es-dev/utils/reDispatch.d.ts +1 -0
- package/dist/es-dev/utils/reDispatch.js +10 -0
- package/icons/checkbox-indeterminate.svg +2 -2
- package/icons/chevron-down.svg +3 -0
- package/icons/chevron-left.svg +3 -0
- package/icons/chevron-right.svg +3 -0
- package/icons/chevron-up.svg +3 -0
- package/icons/dropdown-check.svg +3 -0
- package/icons/dropdown-chevron-down.svg +3 -0
- package/icons/required.svg +3 -0
- package/icons/status-error.svg +3 -0
- package/icons/status-negative.svg +3 -11
- package/icons/status-positive.svg +4 -14
- package/icons/status-success.svg +6 -0
- package/package.json +3 -2
- package/dist/cjs/components/panel-switcher/daikin-panel-switcher.d.ts +0 -50
- package/dist/cjs/components/panel-switcher/index.cjs +0 -7
- package/dist/cjs/components/panel-switcher/index.d.ts +0 -1
- package/dist/cjs/components/tab-group/index.cjs +0 -7
- package/dist/cjs/components/tab-group/index.d.ts +0 -1
- package/dist/cjs/components/text-input/daikin-text-input.cjs +0 -137
- package/dist/cjs/components/text-input/daikin-text-input.d.ts +0 -68
- package/dist/cjs/components/text-input/index.cjs +0 -7
- package/dist/cjs/components/text-input/index.d.ts +0 -1
- package/dist/cjs/components/textarea/daikin-textarea.cjs +0 -168
- package/dist/cjs/components/textarea/daikin-textarea.d.ts +0 -70
- package/dist/cjs/components/textarea/index.cjs +0 -7
- package/dist/cjs/components/textarea/index.d.ts +0 -1
- package/dist/cjs-dev/components/panel-switcher/daikin-panel-switcher.d.ts +0 -50
- package/dist/cjs-dev/components/panel-switcher/index.cjs +0 -7
- package/dist/cjs-dev/components/panel-switcher/index.d.ts +0 -1
- package/dist/cjs-dev/components/tab-group/index.cjs +0 -7
- package/dist/cjs-dev/components/tab-group/index.d.ts +0 -1
- package/dist/cjs-dev/components/text-input/daikin-text-input.cjs +0 -137
- package/dist/cjs-dev/components/text-input/daikin-text-input.d.ts +0 -68
- package/dist/cjs-dev/components/text-input/index.cjs +0 -7
- package/dist/cjs-dev/components/text-input/index.d.ts +0 -1
- package/dist/cjs-dev/components/textarea/daikin-textarea.cjs +0 -168
- package/dist/cjs-dev/components/textarea/daikin-textarea.d.ts +0 -70
- package/dist/cjs-dev/components/textarea/index.cjs +0 -7
- package/dist/cjs-dev/components/textarea/index.d.ts +0 -1
- package/dist/es/components/panel-switcher/daikin-panel-switcher.d.ts +0 -50
- package/dist/es/components/panel-switcher/index.d.ts +0 -1
- package/dist/es/components/panel-switcher/index.js +0 -4
- package/dist/es/components/tab-group/index.d.ts +0 -1
- package/dist/es/components/tab-group/index.js +0 -4
- package/dist/es/components/text-input/daikin-text-input.d.ts +0 -68
- package/dist/es/components/text-input/daikin-text-input.js +0 -138
- package/dist/es/components/text-input/index.d.ts +0 -1
- package/dist/es/components/text-input/index.js +0 -4
- package/dist/es/components/textarea/daikin-textarea.d.ts +0 -70
- package/dist/es/components/textarea/daikin-textarea.js +0 -169
- package/dist/es/components/textarea/index.d.ts +0 -1
- package/dist/es/components/textarea/index.js +0 -4
- package/dist/es-dev/components/panel-switcher/daikin-panel-switcher.d.ts +0 -50
- package/dist/es-dev/components/panel-switcher/index.d.ts +0 -1
- package/dist/es-dev/components/panel-switcher/index.js +0 -4
- package/dist/es-dev/components/tab-group/index.d.ts +0 -1
- package/dist/es-dev/components/tab-group/index.js +0 -4
- package/dist/es-dev/components/text-input/daikin-text-input.d.ts +0 -68
- package/dist/es-dev/components/text-input/daikin-text-input.js +0 -138
- package/dist/es-dev/components/text-input/index.d.ts +0 -1
- package/dist/es-dev/components/text-input/index.js +0 -4
- package/dist/es-dev/components/textarea/daikin-textarea.d.ts +0 -70
- package/dist/es-dev/components/textarea/daikin-textarea.js +0 -169
- package/dist/es-dev/components/textarea/index.d.ts +0 -1
- package/dist/es-dev/components/textarea/index.js +0 -4
- package/icons/accordion-chevron-up.svg +0 -3
- package/icons/notification-status-negative.svg +0 -3
- package/icons/notification-status-positive.svg +0 -5
- package/icons/radio-checked.svg +0 -4
- package/icons/radio-unchecked.svg +0 -4
- /package/dist/cjs/components/{tab-group → tabs}/scroller.cjs +0 -0
- /package/dist/cjs/components/{tab-group → tabs}/scroller.d.ts +0 -0
- /package/dist/cjs-dev/components/{tab-group → tabs}/scroller.cjs +0 -0
- /package/dist/cjs-dev/components/{tab-group → tabs}/scroller.d.ts +0 -0
- /package/dist/es/components/{tab-group → tabs}/scroller.d.ts +0 -0
- /package/dist/es/components/{tab-group → tabs}/scroller.js +0 -0
- /package/dist/es-dev/components/{tab-group → tabs}/scroller.d.ts +0 -0
- /package/dist/es-dev/components/{tab-group → tabs}/scroller.js +0 -0
- /package/icons/{notification-status-alarm.svg → status-alarm.svg} +0 -0
- /package/icons/{notification-status-information.svg → status-information.svg} +0 -0
- /package/icons/{notification-status-warning.svg → status-warning.svg} +0 -0
|
@@ -1,75 +1,73 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import { MergeVariantProps } from '../../type-utils';
|
|
3
|
-
declare const cvaRadio: (props?: ({
|
|
4
|
-
size?: "small" | "large" | null | undefined;
|
|
5
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
-
declare const cvaLabel: (props?: ({
|
|
7
|
-
size?: "small" | "large" | null | undefined;
|
|
8
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
-
type RadioVariantProps = MergeVariantProps<typeof cvaRadio | typeof cvaLabel>;
|
|
10
2
|
/**
|
|
11
3
|
* The radio button component is a UI element that allows users to select one options from a set of choices.
|
|
12
4
|
* It functions similarly to the HTML `<input type="radio">` tag. \
|
|
13
5
|
* Please note that **a radio group component is not yet available**, so you'll need to manually group radio buttons when using multiple instances.
|
|
14
6
|
*
|
|
7
|
+
* Hierarchies:
|
|
8
|
+
* - `daikin-radio-group` > `daikin-radio`
|
|
9
|
+
*
|
|
15
10
|
* @fires change - A cloned event of a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) emitted from the inner `<input type="radio">` element.
|
|
16
11
|
*
|
|
17
12
|
* @example
|
|
18
13
|
*
|
|
14
|
+
* ```js
|
|
15
|
+
* import "@daikin-oss/design-system-web-components/components/radio/index.js";
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
19
18
|
* ```html
|
|
20
19
|
* <daikin-radio name="name" value="value" label="Radio button label"></daikin-radio>
|
|
21
20
|
* ```
|
|
22
21
|
*/
|
|
23
22
|
export declare class DaikinRadio extends LitElement {
|
|
24
23
|
static readonly styles: import('lit').CSSResult;
|
|
25
|
-
private _handleClick;
|
|
26
|
-
static readonly formAssociated = true;
|
|
27
|
-
private _internals;
|
|
28
|
-
private _updateFormValue;
|
|
29
|
-
updated(changedProperties: Map<string, unknown>): void;
|
|
30
|
-
private _handleChange;
|
|
31
|
-
/**
|
|
32
|
-
* Specify the label text for the radio
|
|
33
|
-
*/
|
|
34
|
-
label: string;
|
|
35
24
|
/**
|
|
36
|
-
*
|
|
25
|
+
* Form name of the radio button.
|
|
37
26
|
*/
|
|
38
|
-
|
|
27
|
+
name: string;
|
|
39
28
|
/**
|
|
40
|
-
*
|
|
41
|
-
* when `left` the label will be in left of radio, when `right` label will be in right of radio
|
|
29
|
+
* Form value of the radio button.
|
|
42
30
|
*/
|
|
43
|
-
|
|
31
|
+
value: string;
|
|
44
32
|
/**
|
|
45
|
-
*
|
|
33
|
+
* Label text for the radio button.
|
|
46
34
|
*/
|
|
47
|
-
|
|
35
|
+
label: string;
|
|
48
36
|
/**
|
|
49
|
-
*
|
|
37
|
+
* Label position.
|
|
38
|
+
* - `right` (default): The label will be placed to the right of the radio button.
|
|
39
|
+
* - `hidden`: The label will not be shown.
|
|
50
40
|
*/
|
|
51
|
-
|
|
41
|
+
labelPosition: "right" | "hidden";
|
|
52
42
|
/**
|
|
53
|
-
*
|
|
43
|
+
* Whether the radio button is checked.
|
|
54
44
|
*/
|
|
55
45
|
checked: boolean;
|
|
56
46
|
/**
|
|
57
|
-
*
|
|
47
|
+
* Whether the radio button is disabled.
|
|
58
48
|
*/
|
|
59
|
-
|
|
49
|
+
disabled: boolean;
|
|
60
50
|
/**
|
|
61
|
-
*
|
|
51
|
+
* Whether the radio button can be focused.
|
|
52
|
+
* Automatically set by `daikin-radio-group` component.
|
|
62
53
|
*/
|
|
63
|
-
|
|
54
|
+
skipTab: boolean;
|
|
55
|
+
static readonly formAssociated = true;
|
|
56
|
+
private _radio;
|
|
64
57
|
/**
|
|
65
|
-
*
|
|
58
|
+
* Focuses on the inner radio.
|
|
59
|
+
* @param options focus options
|
|
66
60
|
*/
|
|
67
|
-
|
|
61
|
+
focus(options?: FocusOptions): void;
|
|
62
|
+
private _internals;
|
|
63
|
+
private _updateFormValue;
|
|
64
|
+
private _handleClick;
|
|
65
|
+
private _handleChange;
|
|
68
66
|
render(): import('lit-html').TemplateResult<1>;
|
|
67
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
69
68
|
}
|
|
70
69
|
declare global {
|
|
71
70
|
interface HTMLElementTagNameMap {
|
|
72
71
|
"daikin-radio": DaikinRadio;
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
|
-
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
3
|
-
import { property, customElement } from "lit/decorators.js";
|
|
2
|
+
import { css, unsafeCSS, LitElement, html, nothing } from "lit";
|
|
3
|
+
import { property, query, customElement } from "lit/decorators.js";
|
|
4
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
4
5
|
import tailwindStyles from "../../tailwind.css.js";
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
6
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -12,100 +13,104 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
12
13
|
if (kind && result) __defProp(target, key, result);
|
|
13
14
|
return result;
|
|
14
15
|
};
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
const RADIO_CLASS_NAME = cva([
|
|
17
|
+
"flex",
|
|
18
|
+
"justify-center",
|
|
19
|
+
"items-center",
|
|
20
|
+
"size-4",
|
|
21
|
+
"rounded-full",
|
|
22
|
+
"relative",
|
|
23
|
+
"appearance-none",
|
|
24
|
+
"focus-visible:outline",
|
|
25
|
+
"focus-visible:outline-2",
|
|
26
|
+
"focus-visible:outline-offset-2",
|
|
27
|
+
"focus-visible:outline-system-state-focus",
|
|
28
|
+
"unchecked:border-2",
|
|
29
|
+
"enabled:unchecked:border-system-state-neutral-active",
|
|
30
|
+
"enabled:unchecked:hover:bg-system-background-surface-hover",
|
|
31
|
+
"enabled:unchecked:active:bg-system-background-surface-press",
|
|
32
|
+
"checked:border-[5px]",
|
|
33
|
+
"enabled:checked:border-system-state-primary-active",
|
|
34
|
+
"enabled:checked:group-hover:border-system-state-primary-hover",
|
|
35
|
+
"enabled:checked:group-active:border-system-state-primary-press",
|
|
36
|
+
"disabled:border-system-state-disabled"
|
|
37
|
+
])();
|
|
38
|
+
const cvaLabel = cva(["pr-2"], {
|
|
39
|
+
variants: {
|
|
40
|
+
disabled: {
|
|
41
|
+
false: ["text-system-element-text-primary"],
|
|
42
|
+
true: ["text-system-state-disabled"]
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
|
-
);
|
|
43
|
-
const cvaLabel = cva(
|
|
44
|
-
["leading-8", "not-italic", "font-normal", "align-middle"],
|
|
45
|
-
{
|
|
46
|
-
variants: {
|
|
47
|
-
size: {
|
|
48
|
-
small: ["text-sm"],
|
|
49
|
-
large: ["text-base"]
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
);
|
|
45
|
+
});
|
|
54
46
|
let DaikinRadio = class extends LitElement {
|
|
55
47
|
constructor() {
|
|
56
48
|
super(...arguments);
|
|
57
|
-
this.
|
|
49
|
+
this.name = "";
|
|
50
|
+
this.value = "";
|
|
58
51
|
this.label = "";
|
|
59
|
-
this.size = "small";
|
|
60
52
|
this.labelPosition = "right";
|
|
61
|
-
this.disabled = false;
|
|
62
|
-
this.readonly = false;
|
|
63
53
|
this.checked = false;
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
54
|
+
this.disabled = false;
|
|
55
|
+
this.skipTab = false;
|
|
56
|
+
this._internals = this.attachInternals();
|
|
67
57
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Focuses on the inner radio.
|
|
60
|
+
* @param options focus options
|
|
61
|
+
*/
|
|
62
|
+
focus(options) {
|
|
63
|
+
var _a;
|
|
64
|
+
(_a = this._radio) == null ? void 0 : _a.focus(options);
|
|
72
65
|
}
|
|
73
66
|
_updateFormValue() {
|
|
74
67
|
this._internals.setFormValue(this.checked ? this.value : null);
|
|
75
68
|
}
|
|
76
|
-
|
|
77
|
-
if (
|
|
78
|
-
|
|
69
|
+
_handleClick(event) {
|
|
70
|
+
if (this.disabled) {
|
|
71
|
+
event.preventDefault();
|
|
79
72
|
}
|
|
80
73
|
}
|
|
81
74
|
_handleChange(event) {
|
|
82
|
-
|
|
83
|
-
const input = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("input");
|
|
84
|
-
this.checked = input.checked;
|
|
75
|
+
this.checked = event.target.checked;
|
|
85
76
|
this._updateFormValue();
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
this.dispatchEvent(
|
|
78
|
+
new Event("change", {
|
|
79
|
+
bubbles: true,
|
|
80
|
+
composed: true
|
|
81
|
+
})
|
|
82
|
+
);
|
|
88
83
|
}
|
|
89
84
|
render() {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
85
|
+
return html`<label class="group flex gap-2 items-center font-daikinSerif">
|
|
86
|
+
<span class="p-2">
|
|
87
|
+
<input
|
|
88
|
+
class=${RADIO_CLASS_NAME}
|
|
89
|
+
type="radio"
|
|
90
|
+
name=${this.name}
|
|
91
|
+
value=${this.value}
|
|
92
|
+
aria-label=${this.labelPosition === "hidden" ? this.label : nothing}
|
|
93
|
+
?disabled=${this.disabled}
|
|
94
|
+
.checked=${this.checked}
|
|
95
|
+
@click=${this._handleClick}
|
|
96
|
+
@change=${this._handleChange}
|
|
97
|
+
tabindex=${ifDefined(this.skipTab ? "-1" : void 0)}
|
|
98
|
+
/>
|
|
99
|
+
</span>
|
|
100
|
+
<span
|
|
101
|
+
class=${cvaLabel({
|
|
102
|
+
disabled: this.disabled
|
|
103
|
+
})}
|
|
104
|
+
?hidden=${this.labelPosition === "hidden"}
|
|
105
|
+
>
|
|
106
|
+
${this.label}
|
|
107
|
+
</span>
|
|
108
|
+
</label>`;
|
|
109
|
+
}
|
|
110
|
+
updated(changedProperties) {
|
|
111
|
+
if (changedProperties.has("checked")) {
|
|
112
|
+
this._updateFormValue();
|
|
113
|
+
}
|
|
109
114
|
}
|
|
110
115
|
};
|
|
111
116
|
DaikinRadio.styles = css`
|
|
@@ -117,32 +122,29 @@ DaikinRadio.styles = css`
|
|
|
117
122
|
`;
|
|
118
123
|
DaikinRadio.formAssociated = true;
|
|
119
124
|
__decorateClass([
|
|
120
|
-
property({ type: String })
|
|
121
|
-
], DaikinRadio.prototype, "
|
|
125
|
+
property({ type: String, reflect: true })
|
|
126
|
+
], DaikinRadio.prototype, "name", 2);
|
|
127
|
+
__decorateClass([
|
|
128
|
+
property({ type: String, reflect: true })
|
|
129
|
+
], DaikinRadio.prototype, "value", 2);
|
|
122
130
|
__decorateClass([
|
|
123
131
|
property({ type: String })
|
|
124
|
-
], DaikinRadio.prototype, "
|
|
132
|
+
], DaikinRadio.prototype, "label", 2);
|
|
125
133
|
__decorateClass([
|
|
126
134
|
property({ type: String, attribute: "label-position" })
|
|
127
135
|
], DaikinRadio.prototype, "labelPosition", 2);
|
|
128
|
-
__decorateClass([
|
|
129
|
-
property({ type: Boolean, reflect: true })
|
|
130
|
-
], DaikinRadio.prototype, "disabled", 2);
|
|
131
|
-
__decorateClass([
|
|
132
|
-
property({ type: Boolean, reflect: true })
|
|
133
|
-
], DaikinRadio.prototype, "readonly", 2);
|
|
134
136
|
__decorateClass([
|
|
135
137
|
property({ type: Boolean, reflect: true })
|
|
136
138
|
], DaikinRadio.prototype, "checked", 2);
|
|
137
139
|
__decorateClass([
|
|
138
|
-
property({ type:
|
|
139
|
-
], DaikinRadio.prototype, "
|
|
140
|
+
property({ type: Boolean, reflect: true })
|
|
141
|
+
], DaikinRadio.prototype, "disabled", 2);
|
|
140
142
|
__decorateClass([
|
|
141
|
-
property({ type:
|
|
142
|
-
], DaikinRadio.prototype, "
|
|
143
|
+
property({ type: Boolean, attribute: false })
|
|
144
|
+
], DaikinRadio.prototype, "skipTab", 2);
|
|
143
145
|
__decorateClass([
|
|
144
|
-
|
|
145
|
-
], DaikinRadio.prototype, "
|
|
146
|
+
query("input")
|
|
147
|
+
], DaikinRadio.prototype, "_radio", 2);
|
|
146
148
|
DaikinRadio = __decorateClass([
|
|
147
149
|
customElement("daikin-radio")
|
|
148
150
|
], DaikinRadio);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { MergeVariantProps } from '../../type-utils';
|
|
3
|
+
import { DaikinInputGroup } from '../input-group';
|
|
4
|
+
declare const radioGroupCN: (props?: ({
|
|
5
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
type RadioGroupProps = MergeVariantProps<typeof radioGroupCN>;
|
|
8
|
+
/**
|
|
9
|
+
* Radio groups are used to group multiple radio buttons so that make sure that only one will be selected in the group
|
|
10
|
+
*
|
|
11
|
+
* Hierarchies:
|
|
12
|
+
* - `daikin-radio-group` > `daikin-radio`
|
|
13
|
+
* - `daikin-input-group` > `daikin-radio-group` > `daikin-radio`
|
|
14
|
+
*
|
|
15
|
+
* @fires change - A custom event emitted when current checked radio changed.
|
|
16
|
+
*
|
|
17
|
+
* @slot - A slot for radio buttons. Place `daikin-radio` elements here.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* ```html
|
|
22
|
+
* <daikin-radio-group name="name">
|
|
23
|
+
* <daikin-radio value="value1" label="Option1"></daikin-radio>
|
|
24
|
+
* <daikin-radio value="value2" label="Option2"></daikin-radio>
|
|
25
|
+
* <daikin-radio value="value3" label="Option3"></daikin-radio>
|
|
26
|
+
* </daikin-radio-group>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* ```html
|
|
30
|
+
* <daikin-input-group label="Label text" helper="Helper text">
|
|
31
|
+
* <daikin-radio-group name="name">
|
|
32
|
+
* <daikin-radio value="value1" label="Option1"></daikin-radio>
|
|
33
|
+
* <daikin-radio value="value2" label="Option2"></daikin-radio>
|
|
34
|
+
* <daikin-radio value="value3" label="Option3"></daikin-radio>
|
|
35
|
+
* </daikin-radio-group>
|
|
36
|
+
* </daikin-input-group>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class DaikinRadioGroup extends LitElement {
|
|
40
|
+
static readonly styles: import('lit').CSSResult;
|
|
41
|
+
private readonly _radios;
|
|
42
|
+
/**
|
|
43
|
+
* Specify the radio group orientation
|
|
44
|
+
*/
|
|
45
|
+
orientation: RadioGroupProps["orientation"];
|
|
46
|
+
/**
|
|
47
|
+
* The form name.
|
|
48
|
+
*/
|
|
49
|
+
name: string;
|
|
50
|
+
/**
|
|
51
|
+
* `value` of the currently selected radio.
|
|
52
|
+
* see {@link DaikinRadio.value}
|
|
53
|
+
*/
|
|
54
|
+
value: string;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the radio group is required.
|
|
57
|
+
* Controlled by `daikin-input-group` when used within `daikin-input-group`.
|
|
58
|
+
*/
|
|
59
|
+
required: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The label text used as the value of aria-label.
|
|
62
|
+
* Set automatically by `reflectInputGroup` method.
|
|
63
|
+
*/
|
|
64
|
+
private _label;
|
|
65
|
+
private _updateRadios;
|
|
66
|
+
private readonly _handleRadioChange;
|
|
67
|
+
private _handleSlotChange;
|
|
68
|
+
/**
|
|
69
|
+
* Handles keyboard interactions in the radio list.
|
|
70
|
+
* https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
71
|
+
*/
|
|
72
|
+
private _handleKeyDown;
|
|
73
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
74
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
75
|
+
reflectInputGroup(inputGroup: DaikinInputGroup): void;
|
|
76
|
+
}
|
|
77
|
+
declare global {
|
|
78
|
+
interface HTMLElementTagNameMap {
|
|
79
|
+
"daikin-radio-group": DaikinRadioGroup;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
3
|
+
import { queryAssignedElements, property, state, 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 radioGroupCN = cva(["flex", "gap-2", "py-2", "pr-2"], {
|
|
17
|
+
variants: {
|
|
18
|
+
orientation: {
|
|
19
|
+
horizontal: ["flex-col"],
|
|
20
|
+
vertical: ["flex-row", "gap-3"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
let DaikinRadioGroup = class extends LitElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.orientation = "horizontal";
|
|
28
|
+
this.name = "";
|
|
29
|
+
this.value = "";
|
|
30
|
+
this.required = false;
|
|
31
|
+
this._label = null;
|
|
32
|
+
this._handleRadioChange = (event) => {
|
|
33
|
+
this.value = event.target.value;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
_updateRadios() {
|
|
37
|
+
const radios = this._radios;
|
|
38
|
+
const selectedRadio = radios.find((radio) => radio.value === this.value);
|
|
39
|
+
const firstEnabledRadio = radios.find((radio) => !radio.disabled);
|
|
40
|
+
for (const daikinRadio of this._radios) {
|
|
41
|
+
if (this.name) {
|
|
42
|
+
daikinRadio.name = this.name;
|
|
43
|
+
}
|
|
44
|
+
const isSelected = daikinRadio === selectedRadio;
|
|
45
|
+
daikinRadio.checked = isSelected;
|
|
46
|
+
daikinRadio.skipTab = selectedRadio ? !isSelected : daikinRadio !== firstEnabledRadio;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
_handleSlotChange() {
|
|
50
|
+
this._updateRadios();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Handles keyboard interactions in the radio list.
|
|
54
|
+
* https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
55
|
+
*/
|
|
56
|
+
_handleKeyDown(event) {
|
|
57
|
+
const moveOffset = {
|
|
58
|
+
ArrowRight: 1,
|
|
59
|
+
ArrowDown: 1,
|
|
60
|
+
ArrowLeft: -1,
|
|
61
|
+
ArrowUp: -1
|
|
62
|
+
}[event.key];
|
|
63
|
+
if (!moveOffset) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
const enabledRadios = this._radios.filter(({ disabled }) => !disabled);
|
|
68
|
+
if (!enabledRadios.length) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const activeElement = document.activeElement;
|
|
72
|
+
const focusedRadioIndex = activeElement ? enabledRadios.findIndex((radio) => radio.contains(activeElement)) : -1;
|
|
73
|
+
if (focusedRadioIndex < 0) {
|
|
74
|
+
const activeRadio = enabledRadios.find((radio) => radio.checked) ?? enabledRadios[0];
|
|
75
|
+
this.value = activeRadio.value;
|
|
76
|
+
activeRadio.focus();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const newIndex = (focusedRadioIndex + moveOffset + enabledRadios.length) % enabledRadios.length;
|
|
80
|
+
if (newIndex !== focusedRadioIndex) {
|
|
81
|
+
const newRadio = enabledRadios[newIndex];
|
|
82
|
+
this.value = newRadio.value;
|
|
83
|
+
newRadio.focus();
|
|
84
|
+
this.dispatchEvent(new Event("change"));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
const radioGroupClassName = radioGroupCN({ orientation: this.orientation });
|
|
89
|
+
return html`<fieldset
|
|
90
|
+
role="radiogroup"
|
|
91
|
+
aria-label=${// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround lit-analyzer checking
|
|
92
|
+
ifDefined(this._label)}
|
|
93
|
+
aria-required=${// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround lit-analyzer checking
|
|
94
|
+
ifDefined(this.required)}
|
|
95
|
+
@keydown=${this._handleKeyDown}
|
|
96
|
+
>
|
|
97
|
+
<slot
|
|
98
|
+
class=${radioGroupClassName}
|
|
99
|
+
@slotchange=${this._handleSlotChange}
|
|
100
|
+
@change=${this._handleRadioChange}
|
|
101
|
+
>
|
|
102
|
+
</slot>
|
|
103
|
+
</fieldset>`;
|
|
104
|
+
}
|
|
105
|
+
updated(changedProperties) {
|
|
106
|
+
if (changedProperties.has("value") || changedProperties.has("name")) {
|
|
107
|
+
this._updateRadios();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
reflectInputGroup(inputGroup) {
|
|
111
|
+
this._label = inputGroup.label;
|
|
112
|
+
this.required = !!inputGroup.required;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
DaikinRadioGroup.styles = css`
|
|
116
|
+
${unsafeCSS(tailwindStyles)}
|
|
117
|
+
|
|
118
|
+
:host {
|
|
119
|
+
display: inline-block;
|
|
120
|
+
}
|
|
121
|
+
`;
|
|
122
|
+
__decorateClass([
|
|
123
|
+
queryAssignedElements({ selector: "daikin-radio" })
|
|
124
|
+
], DaikinRadioGroup.prototype, "_radios", 2);
|
|
125
|
+
__decorateClass([
|
|
126
|
+
property({ type: String })
|
|
127
|
+
], DaikinRadioGroup.prototype, "orientation", 2);
|
|
128
|
+
__decorateClass([
|
|
129
|
+
property({ type: String, reflect: true })
|
|
130
|
+
], DaikinRadioGroup.prototype, "name", 2);
|
|
131
|
+
__decorateClass([
|
|
132
|
+
property({ type: String, reflect: true })
|
|
133
|
+
], DaikinRadioGroup.prototype, "value", 2);
|
|
134
|
+
__decorateClass([
|
|
135
|
+
property({ type: Boolean, reflect: true })
|
|
136
|
+
], DaikinRadioGroup.prototype, "required", 2);
|
|
137
|
+
__decorateClass([
|
|
138
|
+
state()
|
|
139
|
+
], DaikinRadioGroup.prototype, "_label", 2);
|
|
140
|
+
DaikinRadioGroup = __decorateClass([
|
|
141
|
+
customElement("daikin-radio-group")
|
|
142
|
+
], DaikinRadioGroup);
|
|
143
|
+
export {
|
|
144
|
+
DaikinRadioGroup
|
|
145
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-radio-group';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { DaikinInputGroup } from '../input-group';
|
|
3
|
+
/**
|
|
4
|
+
* A select component.
|
|
5
|
+
* This component accepts an HTML `<select>` element in the slot and applies styles to it.
|
|
6
|
+
* The `disabled` property of the component is also reflected in the `<select>` element in the slot.
|
|
7
|
+
*
|
|
8
|
+
* Hierarchy:
|
|
9
|
+
* - `daikin-input-group` > `daikin-select`
|
|
10
|
+
*
|
|
11
|
+
* @slot - A slot for an HTML `<select>` element which may contain `<option>` and `<optgroup>`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* ```html
|
|
16
|
+
* <daikin-select>
|
|
17
|
+
* <select name="select">
|
|
18
|
+
* <option value="value1">Option 1</option>
|
|
19
|
+
* <option value="value2">Option 2</option>
|
|
20
|
+
* <optgroup label="Group">
|
|
21
|
+
* <option value="value3">Option 3</option>
|
|
22
|
+
* <option value="value4">Option 4</option>
|
|
23
|
+
* </optgroup>
|
|
24
|
+
* </select>
|
|
25
|
+
* </daikin-select>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare class DaikinSelect extends LitElement {
|
|
29
|
+
static readonly styles: import('lit').CSSResult;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the select component is in an error state.
|
|
32
|
+
*/
|
|
33
|
+
error: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the select component is required.
|
|
36
|
+
*/
|
|
37
|
+
required: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the select component is disabled.
|
|
40
|
+
* This value will also be applied to the `disabled` property of the `<select>` element in the slot.
|
|
41
|
+
*/
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
private readonly _selects;
|
|
44
|
+
private get _select();
|
|
45
|
+
private _updateSelect;
|
|
46
|
+
private _handleSlotChange;
|
|
47
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
48
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
49
|
+
reflectInputGroup(inputGroup: DaikinInputGroup): void;
|
|
50
|
+
/**
|
|
51
|
+
* Focuses on the `<select>` element in the slot.
|
|
52
|
+
* @param options focus options
|
|
53
|
+
*/
|
|
54
|
+
focus(options?: FocusOptions): void;
|
|
55
|
+
}
|
|
56
|
+
declare global {
|
|
57
|
+
interface HTMLElementTagNameMap {
|
|
58
|
+
"daikin-select": DaikinSelect;
|
|
59
|
+
}
|
|
60
|
+
}
|