@daikin-oss/design-system-web-components 0.2.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +47 -7
- package/dist/cjs/components/accordion/daikin-accordion.cjs +37 -0
- package/dist/cjs/components/accordion/daikin-accordion.d.ts +39 -0
- package/dist/cjs/components/accordion/index.cjs +7 -0
- package/dist/cjs/components/accordion/index.d.ts +1 -0
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +177 -0
- package/dist/cjs/components/accordion-item/daikin-accordion-item.d.ts +55 -0
- package/dist/cjs/components/accordion-item/index.cjs +7 -0
- package/dist/cjs/components/accordion-item/index.d.ts +1 -0
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.cjs +124 -0
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.d.ts +52 -0
- package/dist/cjs/components/breadcrumb/index.cjs +7 -0
- package/dist/cjs/components/breadcrumb/index.d.ts +1 -0
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +116 -0
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +62 -0
- package/dist/cjs/components/breadcrumb-item/index.cjs +7 -0
- package/dist/cjs/components/breadcrumb-item/index.d.ts +1 -0
- package/dist/cjs/components/button/daikin-button.cjs +25 -7
- package/dist/cjs/components/button/daikin-button.d.ts +21 -4
- package/dist/cjs/components/button/index.cjs +7 -0
- package/dist/cjs/components/checkbox/daikin-checkbox.d.ts +11 -2
- package/dist/cjs/components/checkbox/index.cjs +7 -0
- package/dist/cjs/components/icon/daikin-icon.cjs +87 -0
- package/dist/cjs/components/icon/daikin-icon.d.ts +48 -0
- package/dist/cjs/components/icon/icons.json.cjs +29 -0
- package/dist/cjs/components/icon/icons.json.d.ts +31 -0
- package/dist/cjs/components/icon/index.cjs +8 -0
- package/dist/cjs/components/icon/index.d.ts +1 -0
- package/dist/cjs/components/index.cjs +93 -0
- package/dist/cjs/components/index.d.ts +11 -0
- package/dist/cjs/components/input-group/daikin-input-group.cjs +1 -1
- package/dist/cjs/components/input-group/daikin-input-group.d.ts +27 -2
- package/dist/cjs/components/input-group/index.cjs +7 -0
- package/dist/cjs/components/notification/daikin-notification.cjs +15 -33
- package/dist/cjs/components/notification/daikin-notification.d.ts +21 -8
- package/dist/cjs/components/notification/index.cjs +7 -0
- package/dist/cjs/components/panel-switcher/daikin-panel-switcher.cjs +55 -0
- package/dist/cjs/components/panel-switcher/daikin-panel-switcher.d.ts +50 -0
- package/dist/cjs/components/panel-switcher/index.cjs +7 -0
- package/dist/cjs/components/panel-switcher/index.d.ts +1 -0
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +137 -0
- package/dist/cjs/components/progress-bar/daikin-progress-bar.d.ts +47 -0
- package/dist/cjs/components/progress-bar/index.cjs +7 -0
- package/dist/cjs/components/progress-bar/index.d.ts +1 -0
- package/dist/cjs/components/radio/daikin-radio.d.ts +11 -2
- package/dist/cjs/components/radio/index.cjs +7 -0
- package/dist/cjs/components/tab/daikin-tab.cjs +126 -0
- package/dist/cjs/components/tab/daikin-tab.d.ts +54 -0
- package/dist/cjs/components/tab/index.cjs +7 -0
- package/dist/cjs/components/tab/index.d.ts +1 -0
- package/dist/cjs/components/tab-group/daikin-tab-group.cjs +211 -0
- package/dist/cjs/components/tab-group/daikin-tab-group.d.ts +104 -0
- package/dist/cjs/components/tab-group/index.cjs +7 -0
- package/dist/cjs/components/tab-group/index.d.ts +1 -0
- package/dist/cjs/components/tab-group/scroller.cjs +65 -0
- package/dist/cjs/components/tab-group/scroller.d.ts +25 -0
- package/dist/cjs/components/text-input/daikin-text-input.d.ts +16 -2
- package/dist/cjs/components/text-input/index.cjs +7 -0
- package/dist/cjs/components/textarea/daikin-textarea.d.ts +16 -2
- package/dist/cjs/components/textarea/index.cjs +7 -0
- package/dist/cjs/components/toggle/daikin-toggle.cjs +132 -0
- package/dist/cjs/components/toggle/daikin-toggle.d.ts +60 -0
- package/dist/cjs/components/toggle/index.cjs +7 -0
- package/dist/cjs/components/toggle/index.d.ts +1 -0
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +223 -0
- package/dist/cjs/components/tooltip/daikin-tooltip.d.ts +76 -0
- package/dist/cjs/components/tooltip/index.cjs +7 -0
- package/dist/cjs/components/tooltip/index.d.ts +1 -0
- package/dist/cjs/index.cjs +56 -0
- package/dist/cjs/is-client.cjs +5 -0
- package/dist/cjs/is-client.d.ts +1 -0
- package/dist/cjs/tailwind.css.cjs +2 -2
- package/dist/cjs/type-utils.d.ts +0 -1
- package/dist/cjs-dev/colors.cjs +80 -0
- package/dist/cjs-dev/colors.d.ts +69 -0
- package/dist/cjs-dev/components/accordion/daikin-accordion.cjs +37 -0
- package/dist/cjs-dev/components/accordion/daikin-accordion.d.ts +39 -0
- package/dist/cjs-dev/components/accordion/index.cjs +7 -0
- package/dist/cjs-dev/components/accordion/index.d.ts +1 -0
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +177 -0
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.d.ts +55 -0
- package/dist/cjs-dev/components/accordion-item/index.cjs +7 -0
- package/dist/cjs-dev/components/accordion-item/index.d.ts +1 -0
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.cjs +124 -0
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.d.ts +52 -0
- package/dist/cjs-dev/components/breadcrumb/index.cjs +7 -0
- package/dist/cjs-dev/components/breadcrumb/index.d.ts +1 -0
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +116 -0
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +62 -0
- package/dist/cjs-dev/components/breadcrumb-item/index.cjs +7 -0
- package/dist/cjs-dev/components/breadcrumb-item/index.d.ts +1 -0
- package/dist/cjs-dev/components/button/daikin-button.cjs +215 -0
- package/dist/cjs-dev/components/button/daikin-button.d.ts +76 -0
- package/dist/cjs-dev/components/button/index.cjs +7 -0
- package/dist/cjs-dev/components/button/index.d.ts +1 -0
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +183 -0
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.ts +77 -0
- package/dist/cjs-dev/components/checkbox/index.cjs +7 -0
- package/dist/cjs-dev/components/checkbox/index.d.ts +1 -0
- package/dist/cjs-dev/components/icon/daikin-icon.cjs +96 -0
- package/dist/cjs-dev/components/icon/daikin-icon.d.ts +48 -0
- package/dist/cjs-dev/components/icon/icons.json.cjs +29 -0
- package/dist/cjs-dev/components/icon/icons.json.d.ts +31 -0
- package/dist/cjs-dev/components/icon/index.cjs +8 -0
- package/dist/cjs-dev/components/icon/index.d.ts +1 -0
- package/dist/cjs-dev/components/index.cjs +93 -0
- package/dist/cjs-dev/components/index.d.ts +18 -0
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +119 -0
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.ts +72 -0
- package/dist/cjs-dev/components/input-group/index.cjs +7 -0
- package/dist/cjs-dev/components/input-group/index.d.ts +1 -0
- package/dist/cjs-dev/components/notification/daikin-notification.cjs +191 -0
- package/dist/cjs-dev/components/notification/daikin-notification.d.ts +75 -0
- package/dist/cjs-dev/components/notification/index.cjs +7 -0
- package/dist/cjs-dev/components/notification/index.d.ts +1 -0
- package/dist/cjs-dev/components/panel-switcher/daikin-panel-switcher.cjs +62 -0
- package/dist/cjs-dev/components/panel-switcher/daikin-panel-switcher.d.ts +50 -0
- package/dist/cjs-dev/components/panel-switcher/index.cjs +7 -0
- package/dist/cjs-dev/components/panel-switcher/index.d.ts +1 -0
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +152 -0
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.d.ts +47 -0
- package/dist/cjs-dev/components/progress-bar/index.cjs +7 -0
- package/dist/cjs-dev/components/progress-bar/index.d.ts +1 -0
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +150 -0
- package/dist/cjs-dev/components/radio/daikin-radio.d.ts +75 -0
- package/dist/cjs-dev/components/radio/index.cjs +7 -0
- package/dist/cjs-dev/components/radio/index.d.ts +1 -0
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +126 -0
- package/dist/cjs-dev/components/tab/daikin-tab.d.ts +54 -0
- package/dist/cjs-dev/components/tab/index.cjs +7 -0
- package/dist/cjs-dev/components/tab/index.d.ts +1 -0
- package/dist/cjs-dev/components/tab-group/daikin-tab-group.cjs +221 -0
- package/dist/cjs-dev/components/tab-group/daikin-tab-group.d.ts +104 -0
- package/dist/cjs-dev/components/tab-group/index.cjs +7 -0
- package/dist/cjs-dev/components/tab-group/index.d.ts +1 -0
- package/dist/cjs-dev/components/tab-group/scroller.cjs +65 -0
- package/dist/cjs-dev/components/tab-group/scroller.d.ts +25 -0
- package/dist/cjs-dev/components/text-input/daikin-text-input.cjs +137 -0
- package/dist/cjs-dev/components/text-input/daikin-text-input.d.ts +68 -0
- package/dist/cjs-dev/components/text-input/index.cjs +7 -0
- package/dist/cjs-dev/components/text-input/index.d.ts +1 -0
- package/dist/cjs-dev/components/textarea/daikin-textarea.cjs +168 -0
- package/dist/cjs-dev/components/textarea/daikin-textarea.d.ts +70 -0
- package/dist/cjs-dev/components/textarea/index.cjs +7 -0
- package/dist/cjs-dev/components/textarea/index.d.ts +1 -0
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +132 -0
- package/dist/cjs-dev/components/toggle/daikin-toggle.d.ts +60 -0
- package/dist/cjs-dev/components/toggle/index.cjs +7 -0
- package/dist/cjs-dev/components/toggle/index.d.ts +1 -0
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +223 -0
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.ts +76 -0
- package/dist/cjs-dev/components/tooltip/index.cjs +7 -0
- package/dist/cjs-dev/components/tooltip/index.d.ts +1 -0
- package/dist/cjs-dev/constants/events.cjs +4 -0
- package/dist/cjs-dev/constants/events.d.ts +1 -0
- package/dist/cjs-dev/index.cjs +95 -0
- package/dist/cjs-dev/index.d.ts +3 -0
- package/dist/cjs-dev/is-client.cjs +5 -0
- package/dist/cjs-dev/is-client.d.ts +1 -0
- package/dist/cjs-dev/lit-analyzer-types.d.ts +112 -0
- package/dist/cjs-dev/tailwind.css.cjs +6 -0
- package/dist/cjs-dev/type-utils.d.ts +24 -0
- package/dist/es/components/accordion/daikin-accordion.d.ts +39 -0
- package/dist/es/components/accordion/daikin-accordion.js +38 -0
- package/dist/es/components/accordion/index.d.ts +1 -0
- package/dist/es/components/accordion/index.js +4 -0
- package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +55 -0
- package/dist/es/components/accordion-item/daikin-accordion-item.js +178 -0
- package/dist/es/components/accordion-item/index.d.ts +1 -0
- package/dist/es/components/accordion-item/index.js +4 -0
- package/dist/es/components/breadcrumb/daikin-breadcrumb.d.ts +52 -0
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +125 -0
- package/dist/es/components/breadcrumb/index.d.ts +1 -0
- package/dist/es/components/breadcrumb/index.js +4 -0
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +62 -0
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +117 -0
- package/dist/es/components/breadcrumb-item/index.d.ts +1 -0
- package/dist/es/components/breadcrumb-item/index.js +4 -0
- package/dist/es/components/button/daikin-button.d.ts +21 -4
- package/dist/es/components/button/daikin-button.js +25 -7
- package/dist/es/components/button/index.js +4 -0
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +11 -2
- package/dist/es/components/checkbox/index.js +4 -0
- package/dist/es/components/icon/daikin-icon.d.ts +48 -0
- package/dist/es/components/icon/daikin-icon.js +88 -0
- package/dist/es/components/icon/icons.json.d.ts +31 -0
- package/dist/es/components/icon/icons.json.js +29 -0
- package/dist/es/components/icon/index.d.ts +1 -0
- package/dist/es/components/icon/index.js +5 -0
- package/dist/es/components/index.d.ts +11 -0
- package/dist/es/components/index.js +39 -0
- package/dist/es/components/input-group/daikin-input-group.d.ts +27 -2
- package/dist/es/components/input-group/daikin-input-group.js +1 -1
- package/dist/es/components/input-group/index.js +4 -0
- package/dist/es/components/notification/daikin-notification.d.ts +21 -8
- package/dist/es/components/notification/daikin-notification.js +15 -33
- package/dist/es/components/notification/index.js +4 -0
- package/dist/es/components/panel-switcher/daikin-panel-switcher.d.ts +50 -0
- package/dist/es/components/panel-switcher/daikin-panel-switcher.js +56 -0
- package/dist/es/components/panel-switcher/index.d.ts +1 -0
- package/dist/es/components/panel-switcher/index.js +4 -0
- package/dist/es/components/progress-bar/daikin-progress-bar.d.ts +47 -0
- package/dist/es/components/progress-bar/daikin-progress-bar.js +138 -0
- package/dist/es/components/progress-bar/index.d.ts +1 -0
- package/dist/es/components/progress-bar/index.js +4 -0
- package/dist/es/components/radio/daikin-radio.d.ts +11 -2
- package/dist/es/components/radio/index.js +4 -0
- package/dist/es/components/tab/daikin-tab.d.ts +54 -0
- package/dist/es/components/tab/daikin-tab.js +127 -0
- package/dist/es/components/tab/index.d.ts +1 -0
- package/dist/es/components/tab/index.js +4 -0
- package/dist/es/components/tab-group/daikin-tab-group.d.ts +104 -0
- package/dist/es/components/tab-group/daikin-tab-group.js +212 -0
- package/dist/es/components/tab-group/index.d.ts +1 -0
- package/dist/es/components/tab-group/index.js +4 -0
- package/dist/es/components/tab-group/scroller.d.ts +25 -0
- package/dist/es/components/tab-group/scroller.js +65 -0
- package/dist/es/components/text-input/daikin-text-input.d.ts +16 -2
- package/dist/es/components/text-input/index.js +4 -0
- package/dist/es/components/textarea/daikin-textarea.d.ts +16 -2
- package/dist/es/components/textarea/index.js +4 -0
- package/dist/es/components/toggle/daikin-toggle.d.ts +60 -0
- package/dist/es/components/toggle/daikin-toggle.js +133 -0
- package/dist/es/components/toggle/index.d.ts +1 -0
- package/dist/es/components/toggle/index.js +4 -0
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +76 -0
- package/dist/es/components/tooltip/daikin-tooltip.js +224 -0
- package/dist/es/components/tooltip/index.d.ts +1 -0
- package/dist/es/components/tooltip/index.js +4 -0
- package/dist/es/index.js +24 -1
- package/dist/es/is-client.d.ts +1 -0
- package/dist/es/is-client.js +5 -0
- package/dist/es/tailwind.css.js +2 -2
- package/dist/es/type-utils.d.ts +0 -1
- package/dist/es-dev/colors.d.ts +69 -0
- package/dist/es-dev/colors.js +80 -0
- package/dist/es-dev/components/accordion/daikin-accordion.d.ts +39 -0
- package/dist/es-dev/components/accordion/daikin-accordion.js +38 -0
- package/dist/es-dev/components/accordion/index.d.ts +1 -0
- package/dist/es-dev/components/accordion/index.js +4 -0
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.d.ts +55 -0
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +178 -0
- package/dist/es-dev/components/accordion-item/index.d.ts +1 -0
- package/dist/es-dev/components/accordion-item/index.js +4 -0
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.d.ts +52 -0
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +125 -0
- package/dist/es-dev/components/breadcrumb/index.d.ts +1 -0
- package/dist/es-dev/components/breadcrumb/index.js +4 -0
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +62 -0
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +117 -0
- package/dist/es-dev/components/breadcrumb-item/index.d.ts +1 -0
- package/dist/es-dev/components/breadcrumb-item/index.js +4 -0
- package/dist/es-dev/components/button/daikin-button.d.ts +76 -0
- package/dist/es-dev/components/button/daikin-button.js +216 -0
- package/dist/es-dev/components/button/index.d.ts +1 -0
- package/dist/es-dev/components/button/index.js +4 -0
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +77 -0
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +184 -0
- package/dist/es-dev/components/checkbox/index.d.ts +1 -0
- package/dist/es-dev/components/checkbox/index.js +4 -0
- package/dist/es-dev/components/icon/daikin-icon.d.ts +48 -0
- package/dist/es-dev/components/icon/daikin-icon.js +97 -0
- package/dist/es-dev/components/icon/icons.json.d.ts +31 -0
- package/dist/es-dev/components/icon/icons.json.js +29 -0
- package/dist/es-dev/components/icon/index.d.ts +1 -0
- package/dist/es-dev/components/icon/index.js +5 -0
- package/dist/es-dev/components/index.d.ts +18 -0
- package/dist/es-dev/components/index.js +39 -0
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +72 -0
- package/dist/es-dev/components/input-group/daikin-input-group.js +120 -0
- package/dist/es-dev/components/input-group/index.d.ts +1 -0
- package/dist/es-dev/components/input-group/index.js +4 -0
- package/dist/es-dev/components/notification/daikin-notification.d.ts +75 -0
- package/dist/es-dev/components/notification/daikin-notification.js +192 -0
- package/dist/es-dev/components/notification/index.d.ts +1 -0
- package/dist/es-dev/components/notification/index.js +4 -0
- package/dist/es-dev/components/panel-switcher/daikin-panel-switcher.d.ts +50 -0
- package/dist/es-dev/components/panel-switcher/daikin-panel-switcher.js +63 -0
- package/dist/es-dev/components/panel-switcher/index.d.ts +1 -0
- package/dist/es-dev/components/panel-switcher/index.js +4 -0
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.d.ts +47 -0
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +153 -0
- package/dist/es-dev/components/progress-bar/index.d.ts +1 -0
- package/dist/es-dev/components/progress-bar/index.js +4 -0
- package/dist/es-dev/components/radio/daikin-radio.d.ts +75 -0
- package/dist/es-dev/components/radio/daikin-radio.js +151 -0
- package/dist/es-dev/components/radio/index.d.ts +1 -0
- package/dist/es-dev/components/radio/index.js +4 -0
- package/dist/es-dev/components/tab/daikin-tab.d.ts +54 -0
- package/dist/es-dev/components/tab/daikin-tab.js +127 -0
- package/dist/es-dev/components/tab/index.d.ts +1 -0
- package/dist/es-dev/components/tab/index.js +4 -0
- package/dist/es-dev/components/tab-group/daikin-tab-group.d.ts +104 -0
- package/dist/es-dev/components/tab-group/daikin-tab-group.js +222 -0
- package/dist/es-dev/components/tab-group/index.d.ts +1 -0
- package/dist/es-dev/components/tab-group/index.js +4 -0
- package/dist/es-dev/components/tab-group/scroller.d.ts +25 -0
- package/dist/es-dev/components/tab-group/scroller.js +65 -0
- package/dist/es-dev/components/text-input/daikin-text-input.d.ts +68 -0
- package/dist/es-dev/components/text-input/daikin-text-input.js +138 -0
- package/dist/es-dev/components/text-input/index.d.ts +1 -0
- package/dist/es-dev/components/text-input/index.js +4 -0
- package/dist/es-dev/components/textarea/daikin-textarea.d.ts +70 -0
- package/dist/es-dev/components/textarea/daikin-textarea.js +169 -0
- package/dist/es-dev/components/textarea/index.d.ts +1 -0
- package/dist/es-dev/components/textarea/index.js +4 -0
- package/dist/es-dev/components/toggle/daikin-toggle.d.ts +60 -0
- package/dist/es-dev/components/toggle/daikin-toggle.js +133 -0
- package/dist/es-dev/components/toggle/index.d.ts +1 -0
- package/dist/es-dev/components/toggle/index.js +4 -0
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +76 -0
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +224 -0
- package/dist/es-dev/components/tooltip/index.d.ts +1 -0
- package/dist/es-dev/components/tooltip/index.js +4 -0
- package/dist/es-dev/constants/events.d.ts +1 -0
- package/dist/es-dev/constants/events.js +4 -0
- package/dist/es-dev/index.d.ts +3 -0
- package/dist/es-dev/index.js +41 -0
- package/dist/es-dev/is-client.d.ts +1 -0
- package/dist/es-dev/is-client.js +5 -0
- package/dist/es-dev/lit-analyzer-types.d.ts +112 -0
- package/dist/es-dev/tailwind.css.js +6 -0
- package/dist/es-dev/type-utils.d.ts +24 -0
- package/icons/accordion-chevron-up.svg +3 -0
- package/icons/status-positive.svg +15 -0
- package/package.json +83 -50
- /package/icons/{input-group-error.svg → status-negative.svg} +0 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
3
|
+
import { property, state, customElement } from "lit/decorators.js";
|
|
4
|
+
import { createRef, ref } from "lit/directives/ref.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 cvaDetails = cva(
|
|
17
|
+
["flex", "w-full", "h-max", "bg-white", "font-daikinSerif", "overflow-clip"],
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
status: {
|
|
21
|
+
enabled: [],
|
|
22
|
+
disabled: ["text-[#DCDCDC]"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const cvaSummary = cva(
|
|
28
|
+
[
|
|
29
|
+
"flex",
|
|
30
|
+
"items-center",
|
|
31
|
+
"w-full",
|
|
32
|
+
"h-12",
|
|
33
|
+
"px-5",
|
|
34
|
+
"outline-none",
|
|
35
|
+
"relative",
|
|
36
|
+
"after:block",
|
|
37
|
+
"after:w-5",
|
|
38
|
+
"after:h-5",
|
|
39
|
+
"after:m-auto",
|
|
40
|
+
"after:top-0",
|
|
41
|
+
"after:right-4",
|
|
42
|
+
"after:bottom-0",
|
|
43
|
+
"after:absolute",
|
|
44
|
+
"after:i-daikin-accordion-chevron-up",
|
|
45
|
+
"after:transition-all"
|
|
46
|
+
],
|
|
47
|
+
{
|
|
48
|
+
variants: {
|
|
49
|
+
visible: {
|
|
50
|
+
open: ["after:rotate-0"],
|
|
51
|
+
close: ["after:-rotate-180"]
|
|
52
|
+
},
|
|
53
|
+
status: {
|
|
54
|
+
enabled: [
|
|
55
|
+
"hover:bg-[#DCDCDC]",
|
|
56
|
+
"hover:bg-[#DCDCDC]",
|
|
57
|
+
"hover:cursor-pointer",
|
|
58
|
+
"focus-visible:outline",
|
|
59
|
+
"focus-visible:outline-[2px]",
|
|
60
|
+
"focus-visible:outline-[#0097E0]",
|
|
61
|
+
"focus-visible:outline-offset-[-2px]",
|
|
62
|
+
"after:text-[#828282]"
|
|
63
|
+
],
|
|
64
|
+
disabled: ["text-[#DCDCDC]", "after:text-[#DCDCDC]"]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
const animationOption = {
|
|
70
|
+
duration: 250,
|
|
71
|
+
easing: "ease-in-out"
|
|
72
|
+
};
|
|
73
|
+
const contentCloseKeyframe = {
|
|
74
|
+
height: 0
|
|
75
|
+
};
|
|
76
|
+
const getContentOpenKeyframe = (content) => ({
|
|
77
|
+
height: `${content.offsetHeight}px`
|
|
78
|
+
});
|
|
79
|
+
let DaikinAccordionItem = class extends LitElement {
|
|
80
|
+
constructor() {
|
|
81
|
+
super(...arguments);
|
|
82
|
+
this._contentRef = createRef();
|
|
83
|
+
this.title = "";
|
|
84
|
+
this.open = false;
|
|
85
|
+
this.disabled = false;
|
|
86
|
+
this._detailsOpen = false;
|
|
87
|
+
}
|
|
88
|
+
_contentAnimate() {
|
|
89
|
+
const content = this._contentRef.value;
|
|
90
|
+
if (!content || this.open === this._detailsOpen) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (this.open) {
|
|
94
|
+
this._detailsOpen = this.open;
|
|
95
|
+
content.animate(
|
|
96
|
+
[contentCloseKeyframe, getContentOpenKeyframe(content)],
|
|
97
|
+
animationOption
|
|
98
|
+
);
|
|
99
|
+
} else {
|
|
100
|
+
const animation = content.animate(
|
|
101
|
+
[getContentOpenKeyframe(content), contentCloseKeyframe],
|
|
102
|
+
animationOption
|
|
103
|
+
);
|
|
104
|
+
animation.onfinish = () => {
|
|
105
|
+
this._detailsOpen = this.open;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
_handleSummaryClick(e) {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
if (this.disabled) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this.open = !this.open;
|
|
115
|
+
}
|
|
116
|
+
render() {
|
|
117
|
+
const accordionDetailsClassName = cvaDetails({
|
|
118
|
+
status: this.disabled ? "disabled" : "enabled"
|
|
119
|
+
});
|
|
120
|
+
const accordionSummaryClassName = cvaSummary({
|
|
121
|
+
status: this.disabled ? "disabled" : "enabled",
|
|
122
|
+
visible: this.open ? "open" : "close"
|
|
123
|
+
});
|
|
124
|
+
return html`<details
|
|
125
|
+
class=${accordionDetailsClassName}
|
|
126
|
+
?open=${this._detailsOpen}
|
|
127
|
+
?data-open=${this.open}
|
|
128
|
+
aria-disabled=${this.disabled}
|
|
129
|
+
>
|
|
130
|
+
<summary
|
|
131
|
+
class=${accordionSummaryClassName}
|
|
132
|
+
tabindex=${this.disabled ? -1 : 0}
|
|
133
|
+
@click=${this._handleSummaryClick}
|
|
134
|
+
>
|
|
135
|
+
${this.title}
|
|
136
|
+
</summary>
|
|
137
|
+
<div ${ref(this._contentRef)}>
|
|
138
|
+
<div class="pt-2 pb-6 px-5 text-sm">
|
|
139
|
+
<slot></slot>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</details>`;
|
|
143
|
+
}
|
|
144
|
+
firstUpdated() {
|
|
145
|
+
this._detailsOpen = this.open;
|
|
146
|
+
}
|
|
147
|
+
updated(changedProperties) {
|
|
148
|
+
if (changedProperties.has("open")) {
|
|
149
|
+
this._contentAnimate();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
DaikinAccordionItem.styles = css`
|
|
154
|
+
${unsafeCSS(tailwindStyles)}
|
|
155
|
+
|
|
156
|
+
:host {
|
|
157
|
+
display: block;
|
|
158
|
+
width: 100%;
|
|
159
|
+
}
|
|
160
|
+
`;
|
|
161
|
+
__decorateClass([
|
|
162
|
+
property({ type: String })
|
|
163
|
+
], DaikinAccordionItem.prototype, "title", 2);
|
|
164
|
+
__decorateClass([
|
|
165
|
+
property({ type: Boolean, reflect: true })
|
|
166
|
+
], DaikinAccordionItem.prototype, "open", 2);
|
|
167
|
+
__decorateClass([
|
|
168
|
+
property({ type: Boolean, reflect: true })
|
|
169
|
+
], DaikinAccordionItem.prototype, "disabled", 2);
|
|
170
|
+
__decorateClass([
|
|
171
|
+
state()
|
|
172
|
+
], DaikinAccordionItem.prototype, "_detailsOpen", 2);
|
|
173
|
+
DaikinAccordionItem = __decorateClass([
|
|
174
|
+
customElement("daikin-accordion-item")
|
|
175
|
+
], DaikinAccordionItem);
|
|
176
|
+
export {
|
|
177
|
+
DaikinAccordionItem
|
|
178
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-accordion-item';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* `daikin-breadcrumb` is a component for representing a breadcrumb list, and is used together with the `daikin-breadcrumb-item` component.
|
|
4
|
+
*
|
|
5
|
+
* Hierarchy:
|
|
6
|
+
* - `daikin-breadcrumb` > `daikin-breadcrumb-item`
|
|
7
|
+
*
|
|
8
|
+
* @slot - A slot for breadcrumb items. Place `breadcrumb-item` elements here.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
*
|
|
12
|
+
* ```html
|
|
13
|
+
* <daikin-breadcrumb>
|
|
14
|
+
* <daikin-breadcrumb-item href="#">
|
|
15
|
+
* Breadcrumb Item 1
|
|
16
|
+
* </daikin-breadcrumb-item>
|
|
17
|
+
* <daikin-breadcrumb-item href="#">
|
|
18
|
+
* Breadcrumb Item 2
|
|
19
|
+
* </daikin-breadcrumb-item>
|
|
20
|
+
* </daikin-breadcrumb>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class DaikinBreadcrumb extends LitElement {
|
|
24
|
+
static readonly styles: import('lit').CSSResult;
|
|
25
|
+
private resizeObserver;
|
|
26
|
+
private _slottedDaikinBreadCrumbItems;
|
|
27
|
+
private _divWrapRef;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the last breadcrumb item should have trailing slash.
|
|
30
|
+
*/
|
|
31
|
+
trailingSlash: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Specifies overflow.
|
|
34
|
+
* If `ellipsis`, some breadcrumb items will be omitted when the total width exceeds the container width.
|
|
35
|
+
*/
|
|
36
|
+
overflow: "visible" | "ellipsis";
|
|
37
|
+
private _expandedContentWidth;
|
|
38
|
+
private omitted;
|
|
39
|
+
get _isEllipsis(): boolean;
|
|
40
|
+
private _omit;
|
|
41
|
+
private _updateBreadcrumbs;
|
|
42
|
+
private _handleChange;
|
|
43
|
+
private _handleResizeObserver;
|
|
44
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
45
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
46
|
+
firstUpdated(): void;
|
|
47
|
+
}
|
|
48
|
+
declare global {
|
|
49
|
+
interface HTMLElementTagNameMap {
|
|
50
|
+
"daikin-breadcrumb": DaikinBreadcrumb;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
2
|
+
import { queryAssignedElements, property, customElement } from "lit/decorators.js";
|
|
3
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
4
|
+
import tailwindStyles from "../../tailwind.css.js";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
+
if (kind && result) __defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
let DaikinBreadcrumb = class extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
19
|
+
this._omit();
|
|
20
|
+
});
|
|
21
|
+
this._divWrapRef = createRef();
|
|
22
|
+
this.trailingSlash = false;
|
|
23
|
+
this.overflow = "visible";
|
|
24
|
+
this._expandedContentWidth = 0;
|
|
25
|
+
this.omitted = false;
|
|
26
|
+
}
|
|
27
|
+
get _isEllipsis() {
|
|
28
|
+
return this.overflow === "ellipsis";
|
|
29
|
+
}
|
|
30
|
+
_omit() {
|
|
31
|
+
const shouldOmit = this._isEllipsis && this.offsetWidth < this._expandedContentWidth;
|
|
32
|
+
if (this.omitted === shouldOmit) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.omitted = shouldOmit;
|
|
36
|
+
const daikinBreadCrumbItems = this._slottedDaikinBreadCrumbItems;
|
|
37
|
+
for (const [index, item] of daikinBreadCrumbItems.entries()) {
|
|
38
|
+
let mode = "normal";
|
|
39
|
+
if (shouldOmit) {
|
|
40
|
+
if (index === 0 || index >= daikinBreadCrumbItems.length - 2) {
|
|
41
|
+
continue;
|
|
42
|
+
} else if (index === 1) {
|
|
43
|
+
mode = "ellipsis";
|
|
44
|
+
} else {
|
|
45
|
+
mode = "hidden";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
item.hidden = mode === "hidden";
|
|
49
|
+
item.variant = mode === "ellipsis" ? "ellipsis" : "normal";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
_updateBreadcrumbs() {
|
|
53
|
+
const daikinBreadCrumbItems = this._slottedDaikinBreadCrumbItems;
|
|
54
|
+
for (const [index, item] of daikinBreadCrumbItems.entries()) {
|
|
55
|
+
if (index === daikinBreadCrumbItems.length - 1) {
|
|
56
|
+
item.trailingSlash = this.trailingSlash;
|
|
57
|
+
item.disabled = true;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
item.trailingSlash = true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_handleChange() {
|
|
64
|
+
this._updateBreadcrumbs();
|
|
65
|
+
}
|
|
66
|
+
_handleResizeObserver() {
|
|
67
|
+
if (this._isEllipsis) {
|
|
68
|
+
this.resizeObserver.observe(this);
|
|
69
|
+
} else {
|
|
70
|
+
this.resizeObserver.disconnect();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
return html`
|
|
75
|
+
<div class="flex gap-2" ${ref(this._divWrapRef)}>
|
|
76
|
+
<slot @slotchange=${this._handleChange}></slot>
|
|
77
|
+
</div>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
updated(changedProperties) {
|
|
81
|
+
if (changedProperties.has("trailingSlash")) {
|
|
82
|
+
this._updateBreadcrumbs();
|
|
83
|
+
}
|
|
84
|
+
if (changedProperties.has("overflow")) {
|
|
85
|
+
this._omit();
|
|
86
|
+
this._handleResizeObserver();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
firstUpdated() {
|
|
90
|
+
this._updateBreadcrumbs();
|
|
91
|
+
this._omit();
|
|
92
|
+
this._handleResizeObserver();
|
|
93
|
+
this.updateComplete.then(() => {
|
|
94
|
+
const divElement = this._divWrapRef.value;
|
|
95
|
+
if (!divElement) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this._expandedContentWidth = divElement.offsetWidth;
|
|
99
|
+
}).catch(() => {
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
DaikinBreadcrumb.styles = css`
|
|
104
|
+
${unsafeCSS(tailwindStyles)}
|
|
105
|
+
|
|
106
|
+
:host {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
__decorateClass([
|
|
112
|
+
queryAssignedElements()
|
|
113
|
+
], DaikinBreadcrumb.prototype, "_slottedDaikinBreadCrumbItems", 2);
|
|
114
|
+
__decorateClass([
|
|
115
|
+
property({ type: Boolean, reflect: true, attribute: "trailing-slash" })
|
|
116
|
+
], DaikinBreadcrumb.prototype, "trailingSlash", 2);
|
|
117
|
+
__decorateClass([
|
|
118
|
+
property({ type: String, reflect: true })
|
|
119
|
+
], DaikinBreadcrumb.prototype, "overflow", 2);
|
|
120
|
+
DaikinBreadcrumb = __decorateClass([
|
|
121
|
+
customElement("daikin-breadcrumb")
|
|
122
|
+
], DaikinBreadcrumb);
|
|
123
|
+
export {
|
|
124
|
+
DaikinBreadcrumb
|
|
125
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-breadcrumb';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { MergeVariantProps } from '../../type-utils';
|
|
3
|
+
declare const cvaLinkSlot: (props?: ({
|
|
4
|
+
variant?: "normal" | "ellipsis" | null | undefined;
|
|
5
|
+
disabled?: boolean | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
type LinkVariantProps = MergeVariantProps<typeof cvaLinkSlot>;
|
|
8
|
+
/**
|
|
9
|
+
* The `daikin-breadcrumb-item` is a component used to represent each item of the breadcrumb list, and is used as a child element of the `daikin-breadcrumb` component.
|
|
10
|
+
*
|
|
11
|
+
* Hierarchy:
|
|
12
|
+
* - `daikin-breadcrumb` > `daikin-breadcrumb-item`
|
|
13
|
+
*
|
|
14
|
+
* @slot - A slot for the breadcrumb item content.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* ```html
|
|
19
|
+
* <!-- See `daikin-breadcrumb` component for complete example. -->
|
|
20
|
+
* <daikin-breadcrumb-item href="#">
|
|
21
|
+
* Breadcrumb Item 1
|
|
22
|
+
* </daikin-breadcrumb-item>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class DaikinBreadcrumbItem extends LitElement {
|
|
26
|
+
static styles: import('lit').CSSResult;
|
|
27
|
+
/**
|
|
28
|
+
* Specify link href
|
|
29
|
+
*/
|
|
30
|
+
href: string;
|
|
31
|
+
/**
|
|
32
|
+
* Specifies the display content.
|
|
33
|
+
* If `ellipsis`, the "..." will be displayed instead of the link.
|
|
34
|
+
* Set automatically by `daikin-breadcrumb`.
|
|
35
|
+
*/
|
|
36
|
+
variant: LinkVariantProps["variant"];
|
|
37
|
+
/**
|
|
38
|
+
* Specify whether the link should be disabled
|
|
39
|
+
*/
|
|
40
|
+
disabled: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Specify the link target
|
|
43
|
+
*/
|
|
44
|
+
target: string | null;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the slash after the link should shown.
|
|
47
|
+
* Set automatically by `daikin-breadcrumb`.
|
|
48
|
+
*/
|
|
49
|
+
trailingSlash: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the link should be hidden when ellipsis mode.
|
|
52
|
+
* Set automatically by `daikin-breadcrumb`.
|
|
53
|
+
*/
|
|
54
|
+
hidden: boolean;
|
|
55
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
56
|
+
}
|
|
57
|
+
declare global {
|
|
58
|
+
interface HTMLElementTagNameMap {
|
|
59
|
+
"daikin-breadcrumb-item": DaikinBreadcrumbItem;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
3
|
+
import { property, 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 cvaLinkSlot = cva(
|
|
17
|
+
[
|
|
18
|
+
"slotted:h-8",
|
|
19
|
+
"slotted:font-normal",
|
|
20
|
+
"slotted:not-italic",
|
|
21
|
+
"slotted:leading-8",
|
|
22
|
+
"slotted:text-sm",
|
|
23
|
+
"slotted:text-daikinBlue-500",
|
|
24
|
+
"slotted:outline-none",
|
|
25
|
+
"slotted:font-daikinSerif"
|
|
26
|
+
],
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
normal: [
|
|
31
|
+
"slotted:hover:text-daikinBlue-300",
|
|
32
|
+
"slotted:active:text-daikinNeutral-800",
|
|
33
|
+
"slotted-[*:focus-visible]:text-daikinBlue-700"
|
|
34
|
+
],
|
|
35
|
+
ellipsis: ["slotted:hover:text-daikinBlue-300"]
|
|
36
|
+
},
|
|
37
|
+
disabled: {
|
|
38
|
+
true: [
|
|
39
|
+
"slotted:!text-daikinNeutral-800",
|
|
40
|
+
"slotted:pointer-events-none",
|
|
41
|
+
"slotted:cursor-default",
|
|
42
|
+
"slotted-[*:focus-visible]:!text-daikinNeutral-800"
|
|
43
|
+
],
|
|
44
|
+
false: []
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
let DaikinBreadcrumbItem = class extends LitElement {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments);
|
|
52
|
+
this.href = "";
|
|
53
|
+
this.variant = "normal";
|
|
54
|
+
this.disabled = false;
|
|
55
|
+
this.target = null;
|
|
56
|
+
this.trailingSlash = false;
|
|
57
|
+
this.hidden = false;
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
const slash = this.trailingSlash ? html`<span class="text-daikinNeutral-800 font-daikinSerif">/</span>` : null;
|
|
61
|
+
return html`
|
|
62
|
+
${this.variant === "normal" ? html`<slot name="link" class=${cvaLinkSlot(this)}>
|
|
63
|
+
<a
|
|
64
|
+
href=${ifDefined(this.href)}
|
|
65
|
+
target=${// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround lit-analyzer checking
|
|
66
|
+
ifDefined(this.target)}
|
|
67
|
+
>
|
|
68
|
+
<slot></slot>
|
|
69
|
+
</a>
|
|
70
|
+
</slot>` : (
|
|
71
|
+
// Though `cvaLinkSlot` is designed for slots, it contains "& > *" selector for fallback content so it can be used here.
|
|
72
|
+
html`<span class=${cvaLinkSlot(this)} aria-label="…">
|
|
73
|
+
<span>. . .</span>
|
|
74
|
+
</span> `
|
|
75
|
+
)}
|
|
76
|
+
${slash}
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
DaikinBreadcrumbItem.styles = css`
|
|
81
|
+
${unsafeCSS(tailwindStyles)}
|
|
82
|
+
|
|
83
|
+
:host {
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 8px;
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([hidden]) {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
__decorateClass([
|
|
95
|
+
property({ type: String, reflect: true })
|
|
96
|
+
], DaikinBreadcrumbItem.prototype, "href", 2);
|
|
97
|
+
__decorateClass([
|
|
98
|
+
property({ type: String, reflect: true })
|
|
99
|
+
], DaikinBreadcrumbItem.prototype, "variant", 2);
|
|
100
|
+
__decorateClass([
|
|
101
|
+
property({ type: Boolean, reflect: true })
|
|
102
|
+
], DaikinBreadcrumbItem.prototype, "disabled", 2);
|
|
103
|
+
__decorateClass([
|
|
104
|
+
property({ type: String, reflect: true })
|
|
105
|
+
], DaikinBreadcrumbItem.prototype, "target", 2);
|
|
106
|
+
__decorateClass([
|
|
107
|
+
property({ type: Boolean, reflect: true, attribute: "trailing-slash" })
|
|
108
|
+
], DaikinBreadcrumbItem.prototype, "trailingSlash", 2);
|
|
109
|
+
__decorateClass([
|
|
110
|
+
property({ type: Boolean, reflect: true })
|
|
111
|
+
], DaikinBreadcrumbItem.prototype, "hidden", 2);
|
|
112
|
+
DaikinBreadcrumbItem = __decorateClass([
|
|
113
|
+
customElement("daikin-breadcrumb-item")
|
|
114
|
+
], DaikinBreadcrumbItem);
|
|
115
|
+
export {
|
|
116
|
+
DaikinBreadcrumbItem
|
|
117
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-breadcrumb-item';
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { ARIARole } from '../../lit-analyzer-types';
|
|
3
3
|
import { MergeVariantProps } from '../../type-utils';
|
|
4
|
-
|
|
4
|
+
import { IconType } from '../icon/daikin-icon';
|
|
5
5
|
declare const cvaButton: (props?: ({
|
|
6
6
|
intent?: "primary" | "secondary" | "tertiary" | "primaryDanger" | null | undefined;
|
|
7
7
|
size?: "default" | "condensed" | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
9
|
type ButtonVariantProps = MergeVariantProps<typeof cvaButton>;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* The button component is a versatile UI element that triggers actions or submits forms when clicked.
|
|
12
|
+
* It functions similarly to the HTML `<button>` tag, allowing users to initiate various operations such as submitting data, opening dialogs, or navigating to different sections of an application.
|
|
13
|
+
*
|
|
14
|
+
* @fires click - A retargeted event of a [click event](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) emitted from the inner `<button>` element. Suppressed if `disabled` is true,
|
|
15
|
+
*
|
|
16
|
+
* @slot - A slot for the button content.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
*
|
|
20
|
+
* ```html
|
|
21
|
+
* <daikin-button>
|
|
22
|
+
* Button label
|
|
23
|
+
* </daikin-button>
|
|
24
|
+
* ```
|
|
12
25
|
*/
|
|
13
26
|
export declare class DaikinButton extends LitElement {
|
|
14
27
|
static readonly styles: import('lit').CSSResult;
|
|
@@ -23,11 +36,11 @@ export declare class DaikinButton extends LitElement {
|
|
|
23
36
|
/**
|
|
24
37
|
* Set a icon in the right of button label.
|
|
25
38
|
*/
|
|
26
|
-
rightIcon:
|
|
39
|
+
rightIcon: IconType | null;
|
|
27
40
|
/**
|
|
28
41
|
* Set a icon in the left of button label.
|
|
29
42
|
*/
|
|
30
|
-
leftIcon:
|
|
43
|
+
leftIcon: IconType | null;
|
|
31
44
|
/**
|
|
32
45
|
* Link `href`. If present, this button is rendered as `<a>`.
|
|
33
46
|
*/
|
|
@@ -49,6 +62,10 @@ export declare class DaikinButton extends LitElement {
|
|
|
49
62
|
*/
|
|
50
63
|
isLoading: boolean;
|
|
51
64
|
render(): import('lit-html').TemplateResult<1>;
|
|
65
|
+
/**
|
|
66
|
+
* Focuses on the inner button.
|
|
67
|
+
* @param options focus options
|
|
68
|
+
*/
|
|
52
69
|
focus(options?: FocusOptions | undefined): void;
|
|
53
70
|
}
|
|
54
71
|
declare global {
|
|
@@ -3,6 +3,7 @@ import { cva } from "class-variance-authority";
|
|
|
3
3
|
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
4
4
|
import { property, customElement } from "lit/decorators.js";
|
|
5
5
|
import tailwindStyles from "../../tailwind.css.js";
|
|
6
|
+
import "../icon/daikin-icon.js";
|
|
6
7
|
var __defProp = Object.defineProperty;
|
|
7
8
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
9
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -13,16 +14,21 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
13
14
|
if (kind && result) __defProp(target, key, result);
|
|
14
15
|
return result;
|
|
15
16
|
};
|
|
17
|
+
const BUTTON_ICON_SIZE_MAP = {
|
|
18
|
+
default: "m",
|
|
19
|
+
condensed: "s"
|
|
20
|
+
};
|
|
16
21
|
const cvaButton = cva(
|
|
17
22
|
[
|
|
18
23
|
"inline-flex",
|
|
19
24
|
"justify-center",
|
|
20
25
|
"items-center",
|
|
26
|
+
"gap-2",
|
|
21
27
|
"font-daikinSerif",
|
|
22
28
|
"font-bold",
|
|
23
29
|
"rounded-lg",
|
|
24
30
|
"tracking-wide",
|
|
25
|
-
"text-
|
|
31
|
+
"text-nowrap",
|
|
26
32
|
"disabled:cursor-default",
|
|
27
33
|
"w-full",
|
|
28
34
|
"h-full"
|
|
@@ -90,8 +96,8 @@ let DaikinButton = class extends LitElement {
|
|
|
90
96
|
super(...arguments);
|
|
91
97
|
this.variant = "primary";
|
|
92
98
|
this.disabled = false;
|
|
93
|
-
this.rightIcon =
|
|
94
|
-
this.leftIcon =
|
|
99
|
+
this.rightIcon = null;
|
|
100
|
+
this.leftIcon = null;
|
|
95
101
|
this.href = "";
|
|
96
102
|
this.size = "default";
|
|
97
103
|
this.type = "button";
|
|
@@ -104,12 +110,20 @@ let DaikinButton = class extends LitElement {
|
|
|
104
110
|
size: this.size
|
|
105
111
|
});
|
|
106
112
|
const content = html`
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
${this.leftIcon ? html`<daikin-icon
|
|
114
|
+
icon=${this.leftIcon}
|
|
115
|
+
size=${BUTTON_ICON_SIZE_MAP[this.size]}
|
|
116
|
+
color="current"
|
|
117
|
+
></daikin-icon>` : null}
|
|
118
|
+
<slot></slot>
|
|
119
|
+
${this.rightIcon ? html`<daikin-icon
|
|
120
|
+
icon=${this.rightIcon}
|
|
121
|
+
size=${BUTTON_ICON_SIZE_MAP[this.size]}
|
|
122
|
+
color="current"
|
|
123
|
+
></daikin-icon>` : null}
|
|
110
124
|
`;
|
|
111
125
|
if (this.href) {
|
|
112
|
-
return html
|
|
126
|
+
return html`<a
|
|
113
127
|
href="${this.href}"
|
|
114
128
|
class="${buttonClassName}"
|
|
115
129
|
role="${this.role}"
|
|
@@ -128,6 +142,10 @@ let DaikinButton = class extends LitElement {
|
|
|
128
142
|
</button>
|
|
129
143
|
`;
|
|
130
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Focuses on the inner button.
|
|
147
|
+
* @param options focus options
|
|
148
|
+
*/
|
|
131
149
|
focus(options) {
|
|
132
150
|
var _a, _b;
|
|
133
151
|
(_b = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("button")) == null ? void 0 : _b.focus(options);
|