@daikin-oss/design-system-web-components 0.4.0 → 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 +41 -0
- package/dist/cjs/components/accordion/daikin-accordion.cjs +3 -10
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +15 -14
- package/dist/cjs/components/button/daikin-button.cjs +13 -13
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +35 -34
- 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/icons.json.cjs +10 -6
- package/dist/cjs/components/icon/icons.json.d.ts +10 -6
- package/dist/cjs/components/index.cjs +31 -6
- package/dist/cjs/components/index.d.ts +7 -2
- package/dist/cjs/components/input-group/daikin-input-group.cjs +103 -46
- package/dist/cjs/components/input-group/daikin-input-group.d.ts +65 -27
- package/dist/cjs/components/list-item/daikin-list-item.cjs +16 -10
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +1 -1
- 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 +38 -17
- package/dist/cjs/components/radio/daikin-radio.d.ts +14 -0
- 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 +27 -22
- package/dist/cjs/components/tab-panels/daikin-tab-panels.d.ts +3 -3
- package/dist/cjs/components/tabs/daikin-tabs.cjs +6 -1
- package/dist/cjs/components/tabs/daikin-tabs.d.ts +1 -5
- package/dist/cjs/components/text-area/daikin-text-area.cjs +164 -0
- package/dist/{es/components/textarea/daikin-textarea.d.ts → cjs/components/text-area/daikin-text-area.d.ts} +31 -24
- 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 +12 -12
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +77 -70
- package/dist/cjs/components/tooltip/daikin-tooltip.d.ts +35 -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 +31 -6
- 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 +3 -10
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +15 -14
- package/dist/cjs-dev/components/button/daikin-button.cjs +13 -13
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +35 -34
- 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/icons.json.cjs +10 -6
- package/dist/cjs-dev/components/icon/icons.json.d.ts +10 -6
- package/dist/cjs-dev/components/index.cjs +31 -6
- package/dist/cjs-dev/components/index.d.ts +7 -2
- 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 +65 -27
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +16 -10
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +1 -1
- 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 +38 -17
- package/dist/cjs-dev/components/radio/daikin-radio.d.ts +14 -0
- 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 +27 -22
- package/dist/cjs-dev/components/tab-panels/daikin-tab-panels.d.ts +3 -3
- package/dist/cjs-dev/components/tabs/daikin-tabs.cjs +6 -1
- package/dist/cjs-dev/components/tabs/daikin-tabs.d.ts +1 -5
- package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +164 -0
- package/dist/{es-dev/components/textarea/daikin-textarea.d.ts → cjs-dev/components/text-area/daikin-text-area.d.ts} +31 -24
- 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 +12 -12
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +77 -70
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.ts +35 -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 +31 -6
- 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.js +3 -10
- package/dist/es/components/accordion-item/daikin-accordion-item.js +15 -14
- package/dist/es/components/button/daikin-button.js +13 -13
- package/dist/es/components/checkbox/daikin-checkbox.js +35 -34
- 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/icons.json.d.ts +10 -6
- package/dist/es/components/icon/icons.json.js +10 -6
- package/dist/es/components/index.d.ts +7 -2
- package/dist/es/components/index.js +14 -4
- package/dist/es/components/input-group/daikin-input-group.d.ts +65 -27
- package/dist/es/components/input-group/daikin-input-group.js +105 -48
- package/dist/es/components/list-item/daikin-list-item.js +16 -10
- package/dist/es/components/progress-bar/daikin-progress-bar.js +1 -1
- 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 +14 -0
- package/dist/es/components/radio/daikin-radio.js +39 -18
- 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.js +27 -22
- package/dist/es/components/tab-panels/daikin-tab-panels.d.ts +3 -3
- package/dist/es/components/tabs/daikin-tabs.d.ts +1 -5
- package/dist/es/components/tabs/daikin-tabs.js +6 -1
- package/dist/{cjs/components/textarea/daikin-textarea.d.ts → es/components/text-area/daikin-text-area.d.ts} +31 -24
- 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.js +12 -12
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +35 -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 +14 -4
- 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.js +3 -10
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +15 -14
- package/dist/es-dev/components/button/daikin-button.js +13 -13
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +35 -34
- 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/icons.json.d.ts +10 -6
- package/dist/es-dev/components/icon/icons.json.js +10 -6
- package/dist/es-dev/components/index.d.ts +7 -2
- package/dist/es-dev/components/index.js +14 -4
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +65 -27
- package/dist/es-dev/components/input-group/daikin-input-group.js +105 -48
- package/dist/es-dev/components/list-item/daikin-list-item.js +16 -10
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +1 -1
- 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 +14 -0
- package/dist/es-dev/components/radio/daikin-radio.js +39 -18
- 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.js +27 -22
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.d.ts +3 -3
- package/dist/es-dev/components/tabs/daikin-tabs.d.ts +1 -5
- package/dist/es-dev/components/tabs/daikin-tabs.js +6 -1
- package/dist/{cjs-dev/components/textarea/daikin-textarea.d.ts → es-dev/components/text-area/daikin-text-area.d.ts} +31 -24
- 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.js +12 -12
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +35 -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 +14 -4
- 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/dropdown-check.svg +3 -0
- package/icons/dropdown-chevron-down.svg +3 -0
- package/icons/required.svg +3 -0
- package/icons/status-error.svg +1 -1
- package/icons/{notification-status-negative.svg → status-negative.svg} +1 -1
- package/icons/status-positive.svg +4 -14
- package/icons/status-success.svg +6 -0
- package/package.json +2 -2
- package/dist/cjs/components/text-input/daikin-text-input.cjs +0 -138
- package/dist/cjs/components/text-input/daikin-text-input.d.ts +0 -73
- 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/index.cjs +0 -7
- package/dist/cjs/components/textarea/index.d.ts +0 -1
- package/dist/cjs-dev/components/text-input/daikin-text-input.cjs +0 -138
- package/dist/cjs-dev/components/text-input/daikin-text-input.d.ts +0 -73
- 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/index.cjs +0 -7
- package/dist/cjs-dev/components/textarea/index.d.ts +0 -1
- package/dist/es/components/text-input/daikin-text-input.d.ts +0 -73
- package/dist/es/components/text-input/daikin-text-input.js +0 -139
- 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.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/text-input/daikin-text-input.d.ts +0 -73
- package/dist/es-dev/components/text-input/daikin-text-input.js +0 -139
- 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.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/notification-status-positive.svg +0 -5
- /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
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const classVarianceAuthority = require("class-variance-authority");
|
|
4
|
+
const lit = require("lit");
|
|
5
|
+
const decorators_js = require("lit/decorators.js");
|
|
6
|
+
const ifDefined_js = require("lit/directives/if-defined.js");
|
|
7
|
+
const tailwind = require("../../tailwind.css.cjs");
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result) __defProp(target, key, result);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
const radioGroupCN = classVarianceAuthority.cva(["flex", "gap-2", "py-2", "pr-2"], {
|
|
19
|
+
variants: {
|
|
20
|
+
orientation: {
|
|
21
|
+
horizontal: ["flex-col"],
|
|
22
|
+
vertical: ["flex-row", "gap-3"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
exports.DaikinRadioGroup = class DaikinRadioGroup extends lit.LitElement {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
this.orientation = "horizontal";
|
|
30
|
+
this.name = "";
|
|
31
|
+
this.value = "";
|
|
32
|
+
this.required = false;
|
|
33
|
+
this._label = null;
|
|
34
|
+
this._handleRadioChange = (event) => {
|
|
35
|
+
this.value = event.target.value;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
_updateRadios() {
|
|
39
|
+
const radios = this._radios;
|
|
40
|
+
const selectedRadio = radios.find((radio) => radio.value === this.value);
|
|
41
|
+
const firstEnabledRadio = radios.find((radio) => !radio.disabled);
|
|
42
|
+
for (const daikinRadio of this._radios) {
|
|
43
|
+
if (this.name) {
|
|
44
|
+
daikinRadio.name = this.name;
|
|
45
|
+
}
|
|
46
|
+
const isSelected = daikinRadio === selectedRadio;
|
|
47
|
+
daikinRadio.checked = isSelected;
|
|
48
|
+
daikinRadio.skipTab = selectedRadio ? !isSelected : daikinRadio !== firstEnabledRadio;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
_handleSlotChange() {
|
|
52
|
+
this._updateRadios();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Handles keyboard interactions in the radio list.
|
|
56
|
+
* https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
57
|
+
*/
|
|
58
|
+
_handleKeyDown(event) {
|
|
59
|
+
const moveOffset = {
|
|
60
|
+
ArrowRight: 1,
|
|
61
|
+
ArrowDown: 1,
|
|
62
|
+
ArrowLeft: -1,
|
|
63
|
+
ArrowUp: -1
|
|
64
|
+
}[event.key];
|
|
65
|
+
if (!moveOffset) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
const enabledRadios = this._radios.filter(({ disabled }) => !disabled);
|
|
70
|
+
if (!enabledRadios.length) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const activeElement = document.activeElement;
|
|
74
|
+
const focusedRadioIndex = activeElement ? enabledRadios.findIndex((radio) => radio.contains(activeElement)) : -1;
|
|
75
|
+
if (focusedRadioIndex < 0) {
|
|
76
|
+
const activeRadio = enabledRadios.find((radio) => radio.checked) ?? enabledRadios[0];
|
|
77
|
+
this.value = activeRadio.value;
|
|
78
|
+
activeRadio.focus();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const newIndex = (focusedRadioIndex + moveOffset + enabledRadios.length) % enabledRadios.length;
|
|
82
|
+
if (newIndex !== focusedRadioIndex) {
|
|
83
|
+
const newRadio = enabledRadios[newIndex];
|
|
84
|
+
this.value = newRadio.value;
|
|
85
|
+
newRadio.focus();
|
|
86
|
+
this.dispatchEvent(new Event("change"));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
const radioGroupClassName = radioGroupCN({ orientation: this.orientation });
|
|
91
|
+
return lit.html`<fieldset
|
|
92
|
+
role="radiogroup"
|
|
93
|
+
aria-label=${// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround lit-analyzer checking
|
|
94
|
+
ifDefined_js.ifDefined(this._label)}
|
|
95
|
+
aria-required=${// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround lit-analyzer checking
|
|
96
|
+
ifDefined_js.ifDefined(this.required)}
|
|
97
|
+
@keydown=${this._handleKeyDown}
|
|
98
|
+
>
|
|
99
|
+
<slot
|
|
100
|
+
class=${radioGroupClassName}
|
|
101
|
+
@slotchange=${this._handleSlotChange}
|
|
102
|
+
@change=${this._handleRadioChange}
|
|
103
|
+
>
|
|
104
|
+
</slot>
|
|
105
|
+
</fieldset>`;
|
|
106
|
+
}
|
|
107
|
+
updated(changedProperties) {
|
|
108
|
+
if (changedProperties.has("value") || changedProperties.has("name")) {
|
|
109
|
+
this._updateRadios();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
reflectInputGroup(inputGroup) {
|
|
113
|
+
this._label = inputGroup.label;
|
|
114
|
+
this.required = !!inputGroup.required;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
exports.DaikinRadioGroup.styles = lit.css`
|
|
118
|
+
${lit.unsafeCSS(tailwind.default)}
|
|
119
|
+
|
|
120
|
+
:host {
|
|
121
|
+
display: inline-block;
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
__decorateClass([
|
|
125
|
+
decorators_js.queryAssignedElements({ selector: "daikin-radio" })
|
|
126
|
+
], exports.DaikinRadioGroup.prototype, "_radios", 2);
|
|
127
|
+
__decorateClass([
|
|
128
|
+
decorators_js.property({ type: String })
|
|
129
|
+
], exports.DaikinRadioGroup.prototype, "orientation", 2);
|
|
130
|
+
__decorateClass([
|
|
131
|
+
decorators_js.property({ type: String, reflect: true })
|
|
132
|
+
], exports.DaikinRadioGroup.prototype, "name", 2);
|
|
133
|
+
__decorateClass([
|
|
134
|
+
decorators_js.property({ type: String, reflect: true })
|
|
135
|
+
], exports.DaikinRadioGroup.prototype, "value", 2);
|
|
136
|
+
__decorateClass([
|
|
137
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
138
|
+
], exports.DaikinRadioGroup.prototype, "required", 2);
|
|
139
|
+
__decorateClass([
|
|
140
|
+
decorators_js.state()
|
|
141
|
+
], exports.DaikinRadioGroup.prototype, "_label", 2);
|
|
142
|
+
exports.DaikinRadioGroup = __decorateClass([
|
|
143
|
+
decorators_js.customElement("daikin-radio-group")
|
|
144
|
+
], exports.DaikinRadioGroup);
|
|
@@ -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,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const daikinRadioGroup = require("./daikin-radio-group.cjs");
|
|
4
|
+
Object.defineProperty(exports, "DaikinRadioGroup", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: () => daikinRadioGroup.DaikinRadioGroup
|
|
7
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-radio-group';
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const classVarianceAuthority = require("class-variance-authority");
|
|
4
|
+
const lit = require("lit");
|
|
5
|
+
const decorators_js = require("lit/decorators.js");
|
|
6
|
+
const tailwind = require("../../tailwind.css.cjs");
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12
|
+
if (decorator = decorators[i])
|
|
13
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
|
+
if (kind && result) __defProp(target, key, result);
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
17
|
+
const cvaSelect = classVarianceAuthority.cva(
|
|
18
|
+
[
|
|
19
|
+
"block",
|
|
20
|
+
"w-full",
|
|
21
|
+
"h-full",
|
|
22
|
+
"relative",
|
|
23
|
+
"after:i-daikin-dropdown-chevron-down",
|
|
24
|
+
"after:w-6",
|
|
25
|
+
"after:h-6",
|
|
26
|
+
"after:m-auto",
|
|
27
|
+
"after:absolute",
|
|
28
|
+
"after:top-0",
|
|
29
|
+
"after:bottom-0",
|
|
30
|
+
"after:right-3",
|
|
31
|
+
"after:pointer-events-none",
|
|
32
|
+
"slotted-[select]:!appearance-none",
|
|
33
|
+
"slotted-[select]:!flex",
|
|
34
|
+
"slotted-[select]:!items-center",
|
|
35
|
+
"slotted-[select]:!gap-2",
|
|
36
|
+
"slotted-[select]:!w-full",
|
|
37
|
+
"slotted-[select]:!h-full",
|
|
38
|
+
"slotted-[select]:!min-h-12",
|
|
39
|
+
"slotted-[select]:!pl-4",
|
|
40
|
+
"slotted-[select]:!pr-12",
|
|
41
|
+
"slotted-[select]:!text-base",
|
|
42
|
+
"slotted-[select]:!font-daikinSerif",
|
|
43
|
+
"slotted-[select]:!border",
|
|
44
|
+
"slotted-[select]:!border-[--color-base]",
|
|
45
|
+
"slotted-[select]:!rounded-md",
|
|
46
|
+
"slotted-[select]:!font-daikinSerif",
|
|
47
|
+
"slotted-[select]:!leading-5",
|
|
48
|
+
"slotted-[select]:!outline",
|
|
49
|
+
"slotted-[select]:!outline-0",
|
|
50
|
+
"slotted-[select]:!-outline-offset-2",
|
|
51
|
+
"slotted-[select:focus-visible]:!outline-2",
|
|
52
|
+
"slotted-[select:focus-visible]:!outline-[--color-focus]",
|
|
53
|
+
"slotted-[select:enabled]:!cursor-pointer",
|
|
54
|
+
"slotted-[select:enabled]:!text-daikinNeutral-800",
|
|
55
|
+
"slotted-[select:enabled:hover]:!bg-[#f2f2f2]",
|
|
56
|
+
"slotted-[select:enabled:active]:!bg-daikinNeutral-100",
|
|
57
|
+
"slotted-[select:disabled]:!text-daikinNeutral-200",
|
|
58
|
+
"slotted-[select:disabled]:!border-daikinNeutral-200"
|
|
59
|
+
],
|
|
60
|
+
{
|
|
61
|
+
variants: {
|
|
62
|
+
disabled: {
|
|
63
|
+
false: ["after:text-daikinNeutral-900"],
|
|
64
|
+
true: ["after:text-daikinNeutral-200"]
|
|
65
|
+
},
|
|
66
|
+
error: {
|
|
67
|
+
false: [
|
|
68
|
+
"var-color-daikinNeutral-600/color-base",
|
|
69
|
+
"var-color-daikinBlue-700/color-focus"
|
|
70
|
+
],
|
|
71
|
+
true: [
|
|
72
|
+
"var-color-daikinRed-500/color-base",
|
|
73
|
+
"var-color-daikinRed-500/color-focus"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
exports.DaikinSelect = class DaikinSelect extends lit.LitElement {
|
|
80
|
+
constructor() {
|
|
81
|
+
super(...arguments);
|
|
82
|
+
this.error = false;
|
|
83
|
+
this.required = false;
|
|
84
|
+
this.disabled = false;
|
|
85
|
+
}
|
|
86
|
+
get _select() {
|
|
87
|
+
return this._selects[0] ?? null;
|
|
88
|
+
}
|
|
89
|
+
_updateSelect() {
|
|
90
|
+
const select = this._select;
|
|
91
|
+
if (select) {
|
|
92
|
+
select.disabled = this.disabled;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
_handleSlotChange() {
|
|
96
|
+
this._updateSelect();
|
|
97
|
+
}
|
|
98
|
+
render() {
|
|
99
|
+
return lit.html`<slot
|
|
100
|
+
class=${cvaSelect({ disabled: this.disabled, error: this.error })}
|
|
101
|
+
@slotchange=${this._handleSlotChange}
|
|
102
|
+
></slot>`;
|
|
103
|
+
}
|
|
104
|
+
updated(changedProperties) {
|
|
105
|
+
if (changedProperties.has("disabled")) {
|
|
106
|
+
this._updateSelect();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
reflectInputGroup(inputGroup) {
|
|
110
|
+
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
111
|
+
this.disabled = !!inputGroup.disabled;
|
|
112
|
+
this.required = !!inputGroup.required;
|
|
113
|
+
this.error = isError;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Focuses on the `<select>` element in the slot.
|
|
117
|
+
* @param options focus options
|
|
118
|
+
*/
|
|
119
|
+
focus(options) {
|
|
120
|
+
var _a;
|
|
121
|
+
(_a = this._select) == null ? void 0 : _a.focus(options);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
exports.DaikinSelect.styles = lit.css`
|
|
125
|
+
::slotted(select) {
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
margin: 0;
|
|
128
|
+
padding: 0;
|
|
129
|
+
border: 0 solid;
|
|
130
|
+
|
|
131
|
+
font: inherit;
|
|
132
|
+
font-feature-settings: inherit;
|
|
133
|
+
font-variation-settings: inherit;
|
|
134
|
+
letter-spacing: inherit;
|
|
135
|
+
color: inherit;
|
|
136
|
+
background: transparent;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
${lit.unsafeCSS(tailwind.default)}
|
|
140
|
+
|
|
141
|
+
:host {
|
|
142
|
+
display: block;
|
|
143
|
+
width: 100%;
|
|
144
|
+
}
|
|
145
|
+
`;
|
|
146
|
+
__decorateClass([
|
|
147
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
148
|
+
], exports.DaikinSelect.prototype, "error", 2);
|
|
149
|
+
__decorateClass([
|
|
150
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
151
|
+
], exports.DaikinSelect.prototype, "required", 2);
|
|
152
|
+
__decorateClass([
|
|
153
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
154
|
+
], exports.DaikinSelect.prototype, "disabled", 2);
|
|
155
|
+
__decorateClass([
|
|
156
|
+
decorators_js.queryAssignedElements({ selector: "select" })
|
|
157
|
+
], exports.DaikinSelect.prototype, "_selects", 2);
|
|
158
|
+
exports.DaikinSelect = __decorateClass([
|
|
159
|
+
decorators_js.customElement("daikin-select")
|
|
160
|
+
], exports.DaikinSelect);
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-select';
|
|
@@ -18,46 +18,50 @@ const cvaTab = classVarianceAuthority.cva(
|
|
|
18
18
|
[
|
|
19
19
|
"flex",
|
|
20
20
|
"w-full",
|
|
21
|
-
"
|
|
21
|
+
"min-w-14",
|
|
22
|
+
"h-10",
|
|
22
23
|
"items-center",
|
|
23
24
|
"justify-center",
|
|
24
25
|
"px-4",
|
|
25
26
|
"pt-2",
|
|
26
27
|
"pb-3",
|
|
27
|
-
"text-base",
|
|
28
|
-
"font-bold",
|
|
29
28
|
"text-center",
|
|
30
29
|
"font-daikinSerif",
|
|
31
|
-
"relative",
|
|
32
30
|
"tracking-wide",
|
|
33
31
|
"whitespace-nowrap",
|
|
34
|
-
"
|
|
32
|
+
"relative",
|
|
35
33
|
"focus-visible:outline-none",
|
|
36
|
-
"focus-visible:before:w-full",
|
|
37
|
-
"focus-visible:before:h-[calc(100%_-_4px)]",
|
|
38
|
-
"focus-visible:before:border",
|
|
39
|
-
"focus-visible:before:border-daikinBlue-700",
|
|
40
34
|
"focus-visible:before:absolute",
|
|
41
|
-
"focus-visible:before
|
|
42
|
-
"
|
|
35
|
+
"focus-visible:before:-inset-[3px]",
|
|
36
|
+
"focus-visible:before:z-[1]",
|
|
37
|
+
"focus-visible:before:border",
|
|
38
|
+
"focus-visible:before:border-2",
|
|
39
|
+
"focus-visible:before:border-system-state-focus",
|
|
40
|
+
"disabled:text-system-state-disabled",
|
|
41
|
+
"after:absolute",
|
|
42
|
+
"after:inset-0",
|
|
43
|
+
"after:top-auto"
|
|
43
44
|
],
|
|
44
45
|
{
|
|
45
46
|
variants: {
|
|
46
47
|
active: {
|
|
47
48
|
false: [
|
|
48
|
-
"
|
|
49
|
-
"
|
|
49
|
+
"enabled:text-system-state-neutral-active",
|
|
50
|
+
"enabled:hover:text-system-state-neutral-hover",
|
|
51
|
+
"enabled:hover:bg-system-background-surface-hover",
|
|
52
|
+
"enabled:active:text-system-state-neutral-press",
|
|
53
|
+
"enabled:active:bg-system-background-surface-press",
|
|
54
|
+
"after:h-[1px]",
|
|
55
|
+
"after:bg-system-element-divider-secondary"
|
|
50
56
|
],
|
|
51
57
|
true: [
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
58
|
+
"font-bold",
|
|
59
|
+
"enabled:text-system-state-primary-active",
|
|
60
|
+
"enabled:hover:bg-system-state-primary-surface-hover",
|
|
61
|
+
"enabled:active:bg-system-state-primary-surface-press",
|
|
56
62
|
"after:h-1",
|
|
57
|
-
"after:
|
|
58
|
-
"after:
|
|
59
|
-
"enabled:after:bg-daikinBlue-500",
|
|
60
|
-
"disabled:after:bg-daikinNeutral-200"
|
|
63
|
+
"enabled:after:bg-system-state-primary-active",
|
|
64
|
+
"disabled:after:bg-system-state-disabled"
|
|
61
65
|
]
|
|
62
66
|
}
|
|
63
67
|
}
|
|
@@ -101,7 +105,8 @@ exports.DaikinTab.styles = lit.css`
|
|
|
101
105
|
${lit.unsafeCSS(tailwind.default)}
|
|
102
106
|
|
|
103
107
|
:host {
|
|
104
|
-
display:
|
|
108
|
+
display: block;
|
|
109
|
+
width: 100%;
|
|
105
110
|
}
|
|
106
111
|
`;
|
|
107
112
|
__decorateClass([
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { ARIARole } from '../../lit-analyzer-types';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
5
|
-
* When a user selects a tab, the
|
|
4
|
+
* The tab panels component is a child element within the `daikin-tabs` that controls the display of the content panels associated with each tab.
|
|
5
|
+
* When a user selects a tab, the tab panels component ensures the corresponding content panel is shown while hiding the others.
|
|
6
6
|
*
|
|
7
7
|
* Hierarchy:
|
|
8
8
|
* - `daikin-tabs` > `daikin-tab-panels` ("panels" slot)
|
|
@@ -12,7 +12,7 @@ import { ARIARole } from '../../lit-analyzer-types';
|
|
|
12
12
|
* @example
|
|
13
13
|
*
|
|
14
14
|
* ```js
|
|
15
|
-
* import "@daikin-oss/design-system-web-components/components/
|
|
15
|
+
* import "@daikin-oss/design-system-web-components/components/tab-panels/index.js";
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
18
|
* ```html
|
|
@@ -170,7 +170,7 @@ exports.DaikinTabs = class DaikinTabs extends lit.LitElement {
|
|
|
170
170
|
render() {
|
|
171
171
|
return lit.html`
|
|
172
172
|
<div
|
|
173
|
-
|
|
173
|
+
class="flex flex-nowrap w-full p-[3px] overflow-auto relative before:absolute before:h-[1px] before:inset-[3px] before:top-auto before:bg-system-element-divider-secondary"
|
|
174
174
|
role="tablist"
|
|
175
175
|
@click=${this._handleTabClick}
|
|
176
176
|
@keydown=${this._handleKeyDown}
|
|
@@ -190,6 +190,11 @@ exports.DaikinTabs = class DaikinTabs extends lit.LitElement {
|
|
|
190
190
|
};
|
|
191
191
|
exports.DaikinTabs.styles = lit.css`
|
|
192
192
|
${lit.unsafeCSS(tailwind.default)}
|
|
193
|
+
|
|
194
|
+
:host {
|
|
195
|
+
display: block;
|
|
196
|
+
width: 100%;
|
|
197
|
+
}
|
|
193
198
|
`;
|
|
194
199
|
__decorateClass([
|
|
195
200
|
decorators_js.property({ type: String, reflect: true })
|
|
@@ -2,7 +2,6 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
2
2
|
/**
|
|
3
3
|
* The tab group component manages a group of tabs and switches the content displayed using the panel switcher component.
|
|
4
4
|
* It allows users to navigate between different sections of content by clicking on individual tabs.
|
|
5
|
-
* Tab groups do not provide styles; developers must apply styles to the wrapper of the tabs (`tablist` part) and to the panel switcher(s).
|
|
6
5
|
*
|
|
7
6
|
* > [!WARNING]
|
|
8
7
|
* > At least one tab must be available (that means, the tab must be present and enabled).
|
|
@@ -18,18 +17,15 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
18
17
|
* @slot - A slot for tab buttons. Place `daikin-tab` elements here.
|
|
19
18
|
* @slot panels - A slot for tab panels component. Place a `daikin-tab-panels` element here.
|
|
20
19
|
*
|
|
21
|
-
* @csspart tablist - The container element for the default (tab list) slot. Has "tablist" role.
|
|
22
|
-
*
|
|
23
20
|
* @example
|
|
24
21
|
*
|
|
25
22
|
* ```js
|
|
26
23
|
* import "@daikin-oss/design-system-web-components/components/tab/index.js";
|
|
27
24
|
* import "@daikin-oss/design-system-web-components/components/tab-group/index.js";
|
|
28
|
-
* import "@daikin-oss/design-system-web-components/components/
|
|
25
|
+
* import "@daikin-oss/design-system-web-components/components/tab-panels/index.js";
|
|
29
26
|
* ```
|
|
30
27
|
*
|
|
31
28
|
* ```html
|
|
32
|
-
* <!-- See storybook for styling tab group. You'll need `::part(tablist)` to style the tab container. -->
|
|
33
29
|
* <daikin-tabs value="foo">
|
|
34
30
|
* <daikin-tab value="foo">Foo tab</daikin-tab>
|
|
35
31
|
* <daikin-tab value="bar">Bar tab</daikin-tab>
|