@daikin-oss/design-system-web-components 0.3.2 → 0.4.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 +63 -0
- package/dist/cjs/components/accordion/daikin-accordion.cjs +31 -6
- package/dist/cjs/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +105 -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 +99 -119
- package/dist/cjs/components/checkbox/daikin-checkbox.d.ts +27 -38
- package/dist/cjs/components/icon/daikin-icon.d.ts +4 -0
- package/dist/cjs/components/icon/icons.json.cjs +20 -0
- package/dist/cjs/components/icon/icons.json.d.ts +20 -0
- package/dist/cjs/components/index.cjs +18 -8
- package/dist/cjs/components/index.d.ts +4 -2
- package/dist/cjs/components/input-group/daikin-input-group.cjs +1 -1
- package/dist/cjs/components/input-group/daikin-input-group.d.ts +6 -0
- 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 +125 -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/radio/daikin-radio.cjs +73 -92
- package/dist/cjs/components/radio/daikin-radio.d.ts +23 -39
- package/dist/cjs/components/tab/daikin-tab.cjs +41 -46
- 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-dev/components/panel-switcher/daikin-panel-switcher.d.ts → cjs/components/tab-panels/daikin-tab-panels.d.ts} +17 -11
- 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} +29 -35
- package/dist/cjs/components/{tab-group/daikin-tab-group.d.ts → tabs/daikin-tabs.d.ts} +27 -21
- package/dist/cjs/components/tabs/index.cjs +7 -0
- package/dist/cjs/components/tabs/index.d.ts +1 -0
- package/dist/cjs/components/text-input/daikin-text-input.cjs +4 -3
- package/dist/cjs/components/text-input/daikin-text-input.d.ts +5 -0
- package/dist/cjs/components/textarea/daikin-textarea.cjs +3 -3
- package/dist/cjs/components/textarea/daikin-textarea.d.ts +5 -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.d.ts +4 -0
- package/dist/cjs/index.cjs +18 -8
- package/dist/cjs/tailwind.css.cjs +1 -1
- package/dist/cjs-dev/components/accordion/daikin-accordion.cjs +31 -6
- package/dist/cjs-dev/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +105 -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 +99 -119
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.ts +27 -38
- package/dist/cjs-dev/components/icon/daikin-icon.d.ts +4 -0
- package/dist/cjs-dev/components/icon/icons.json.cjs +20 -0
- package/dist/cjs-dev/components/icon/icons.json.d.ts +20 -0
- package/dist/cjs-dev/components/index.cjs +18 -8
- package/dist/cjs-dev/components/index.d.ts +4 -2
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +1 -1
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.ts +6 -0
- 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 +125 -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/radio/daikin-radio.cjs +73 -92
- package/dist/cjs-dev/components/radio/daikin-radio.d.ts +23 -39
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +41 -46
- 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/components/panel-switcher/daikin-panel-switcher.d.ts → cjs-dev/components/tab-panels/daikin-tab-panels.d.ts} +17 -11
- 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} +31 -37
- package/dist/{es-dev/components/tab-group/daikin-tab-group.d.ts → cjs-dev/components/tabs/daikin-tabs.d.ts} +27 -21
- 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-input/daikin-text-input.cjs +4 -3
- package/dist/cjs-dev/components/text-input/daikin-text-input.d.ts +5 -0
- package/dist/cjs-dev/components/textarea/daikin-textarea.cjs +3 -3
- package/dist/cjs-dev/components/textarea/daikin-textarea.d.ts +5 -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.d.ts +4 -0
- package/dist/cjs-dev/index.cjs +18 -8
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- package/dist/es/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/es/components/accordion/daikin-accordion.js +32 -7
- package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +28 -13
- package/dist/es/components/accordion-item/daikin-accordion-item.js +106 -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 +101 -121
- package/dist/es/components/icon/daikin-icon.d.ts +4 -0
- package/dist/es/components/icon/icons.json.d.ts +20 -0
- package/dist/es/components/icon/icons.json.js +20 -0
- package/dist/es/components/index.d.ts +4 -2
- package/dist/es/components/index.js +8 -4
- package/dist/es/components/input-group/daikin-input-group.d.ts +6 -0
- package/dist/es/components/input-group/daikin-input-group.js +1 -1
- 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 +126 -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/radio/daikin-radio.d.ts +23 -39
- package/dist/es/components/radio/daikin-radio.js +74 -93
- package/dist/es/components/tab/daikin-tab.d.ts +12 -12
- package/dist/es/components/tab/daikin-tab.js +42 -47
- package/dist/es/components/{panel-switcher/daikin-panel-switcher.d.ts → tab-panels/daikin-tab-panels.d.ts} +17 -11
- 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 -21
- package/dist/es/components/{tab-group/daikin-tab-group.js → tabs/daikin-tabs.js} +30 -36
- package/dist/es/components/tabs/index.d.ts +1 -0
- package/dist/es/components/tabs/index.js +4 -0
- package/dist/es/components/text-input/daikin-text-input.d.ts +5 -0
- package/dist/es/components/text-input/daikin-text-input.js +4 -3
- package/dist/es/components/textarea/daikin-textarea.d.ts +5 -0
- package/dist/es/components/textarea/daikin-textarea.js +3 -3
- 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 +4 -0
- package/dist/es/index.js +8 -4
- package/dist/es/tailwind.css.js +1 -1
- package/dist/es-dev/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/es-dev/components/accordion/daikin-accordion.js +32 -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 +106 -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 +101 -121
- package/dist/es-dev/components/icon/daikin-icon.d.ts +4 -0
- package/dist/es-dev/components/icon/icons.json.d.ts +20 -0
- package/dist/es-dev/components/icon/icons.json.js +20 -0
- package/dist/es-dev/components/index.d.ts +4 -2
- package/dist/es-dev/components/index.js +8 -4
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +6 -0
- package/dist/es-dev/components/input-group/daikin-input-group.js +1 -1
- 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 +126 -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/radio/daikin-radio.d.ts +23 -39
- package/dist/es-dev/components/radio/daikin-radio.js +74 -93
- package/dist/es-dev/components/tab/daikin-tab.d.ts +12 -12
- package/dist/es-dev/components/tab/daikin-tab.js +42 -47
- package/dist/es-dev/components/{panel-switcher/daikin-panel-switcher.d.ts → tab-panels/daikin-tab-panels.d.ts} +17 -11
- 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 -21
- package/dist/es-dev/components/{tab-group/daikin-tab-group.js → tabs/daikin-tabs.js} +32 -38
- 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-input/daikin-text-input.d.ts +5 -0
- package/dist/es-dev/components/text-input/daikin-text-input.js +4 -3
- package/dist/es-dev/components/textarea/daikin-textarea.d.ts +5 -0
- package/dist/es-dev/components/textarea/daikin-textarea.js +3 -3
- 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 +4 -0
- package/dist/es-dev/index.js +8 -4
- package/dist/es-dev/tailwind.css.js +1 -1
- 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/status-error.svg +3 -0
- package/package.json +2 -1
- 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-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/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-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/icons/accordion-chevron-up.svg +0 -3
- package/icons/radio-checked.svg +0 -4
- package/icons/radio-unchecked.svg +0 -4
- package/icons/status-negative.svg +0 -11
- /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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const variables_js = require("@daikin-oss/dds-tokens/js/daikin/Light/variables.js");
|
|
4
3
|
const classVarianceAuthority = require("class-variance-authority");
|
|
5
4
|
const lit = require("lit");
|
|
6
5
|
const decorators_js = require("lit/decorators.js");
|
|
6
|
+
const ifDefined_js = require("lit/directives/if-defined.js");
|
|
7
7
|
const tailwind = require("../../tailwind.css.cjs");
|
|
8
8
|
require("../icon/daikin-icon.cjs");
|
|
9
9
|
var __defProp = Object.defineProperty;
|
|
@@ -16,200 +16,161 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
16
16
|
if (kind && result) __defProp(target, key, result);
|
|
17
17
|
return result;
|
|
18
18
|
};
|
|
19
|
-
const BUTTON_ICON_SIZE_MAP = {
|
|
20
|
-
default: "m",
|
|
21
|
-
condensed: "s"
|
|
22
|
-
};
|
|
23
19
|
const cvaButton = classVarianceAuthority.cva(
|
|
24
20
|
[
|
|
25
21
|
"inline-flex",
|
|
26
22
|
"justify-center",
|
|
27
23
|
"items-center",
|
|
28
|
-
"
|
|
24
|
+
"w-full",
|
|
25
|
+
"h-full",
|
|
29
26
|
"font-daikinSerif",
|
|
30
27
|
"font-bold",
|
|
31
|
-
"rounded
|
|
28
|
+
"rounded",
|
|
29
|
+
"px-3",
|
|
32
30
|
"tracking-wide",
|
|
33
31
|
"text-nowrap",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
32
|
+
"focus-visible:outline",
|
|
33
|
+
"focus-visible:outline-2",
|
|
34
|
+
"focus-visible:outline-offset-2",
|
|
35
|
+
"focus-visible:outline-[#0081C0]",
|
|
36
|
+
"var-color-transparent/color-secondary",
|
|
37
|
+
"link-disabled:var-color-daikinNeutral-400/color-primary"
|
|
37
38
|
],
|
|
38
39
|
{
|
|
39
40
|
variants: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"enabled:
|
|
45
|
-
"enabled:
|
|
46
|
-
"enabled:active:
|
|
47
|
-
"disabled:bg-[--buttonColorBackgroundPrimaryDisabled]",
|
|
48
|
-
"focus-visible:outline-none"
|
|
49
|
-
],
|
|
50
|
-
secondary: [
|
|
51
|
-
"border-2",
|
|
52
|
-
"bg-white",
|
|
53
|
-
"text-daikinBlue-500",
|
|
54
|
-
"border-daikinBlue-500",
|
|
55
|
-
"enabled:hover:text-daikinBlue-300",
|
|
56
|
-
"enabled:hover:border-daikinBlue-300",
|
|
57
|
-
"enabled:active:text-daikinBlue-600",
|
|
58
|
-
"enabled:active:border-daikinBlue-600",
|
|
59
|
-
"enabled:focus-visible:text-daikinBlue-700",
|
|
60
|
-
"enabled:focus-visible:border-daikinBlue-700",
|
|
61
|
-
"disabled:border-daikinNeutral-300",
|
|
62
|
-
"disabled:text-daikinNeutral-400",
|
|
63
|
-
"disabled:border",
|
|
64
|
-
"focus-visible:outline-none"
|
|
41
|
+
color: {
|
|
42
|
+
default: [
|
|
43
|
+
"link-enabled:var-color-daikinBlue-500/color-primary",
|
|
44
|
+
"link-enabled:hover:var-color-[#0081C0]/color-primary",
|
|
45
|
+
"link-enabled:hover:var-color-[#DDF3FC]/color-secondary",
|
|
46
|
+
"link-enabled:active:var-color-[#00689A]/color-primary",
|
|
47
|
+
"link-enabled:active:var-color-[#BBE7F9]/color-secondary"
|
|
65
48
|
],
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"enabled:
|
|
72
|
-
"disabled:bg-transparent",
|
|
73
|
-
"disabled:text-daikinNeutral-400"
|
|
74
|
-
],
|
|
75
|
-
primaryDanger: [
|
|
76
|
-
"bg-daikinRed",
|
|
77
|
-
"text-white",
|
|
78
|
-
"enabled:hover:bg-daikinRed-400",
|
|
79
|
-
"enabled:focus-visible:bg-daikinRed-700",
|
|
80
|
-
"enabled:active:bg-daikinRed-700",
|
|
81
|
-
"disabled:bg-daikinNeutral-300",
|
|
82
|
-
"focus-visible:outline-none"
|
|
49
|
+
danger: [
|
|
50
|
+
"link-enabled:var-color-[#D80C18]/color-primary",
|
|
51
|
+
"link-enabled:hover:var-color-[#B90A15]/color-primary",
|
|
52
|
+
"link-enabled:hover:var-color-[#FDD9DB]/color-secondary",
|
|
53
|
+
"link-enabled:active:var-color-[#9A0911]/color-primary",
|
|
54
|
+
"link-enabled:active:var-color-[#FBB3B7]/color-secondary"
|
|
83
55
|
]
|
|
84
56
|
},
|
|
57
|
+
variant: {
|
|
58
|
+
fill: ["text-white", "bg-[--color-primary]"],
|
|
59
|
+
outline: [
|
|
60
|
+
"border",
|
|
61
|
+
"text-[--color-primary]",
|
|
62
|
+
"bg-[--color-secondary]",
|
|
63
|
+
"border-[--color-primary]"
|
|
64
|
+
],
|
|
65
|
+
ghost: ["text-[--color-primary]", "bg-[--color-secondary]"]
|
|
66
|
+
},
|
|
85
67
|
size: {
|
|
86
|
-
|
|
87
|
-
|
|
68
|
+
small: ["text-sm"],
|
|
69
|
+
medium: ["text-sm"]
|
|
88
70
|
}
|
|
89
|
-
},
|
|
90
|
-
defaultVariants: {
|
|
91
|
-
intent: "primary",
|
|
92
|
-
size: "condensed"
|
|
93
71
|
}
|
|
94
72
|
}
|
|
95
73
|
);
|
|
96
74
|
exports.DaikinButton = class DaikinButton extends lit.LitElement {
|
|
97
75
|
constructor() {
|
|
98
|
-
super(
|
|
99
|
-
this.variant = "
|
|
76
|
+
super();
|
|
77
|
+
this.variant = "fill";
|
|
78
|
+
this.size = "medium";
|
|
79
|
+
this.color = "default";
|
|
100
80
|
this.disabled = false;
|
|
101
|
-
this.
|
|
102
|
-
this.leftIcon = null;
|
|
103
|
-
this.href = "";
|
|
104
|
-
this.size = "default";
|
|
81
|
+
this.href = null;
|
|
105
82
|
this.type = "button";
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
83
|
+
this.buttonRole = null;
|
|
84
|
+
this.addEventListener("click", (event) => {
|
|
85
|
+
if (this.disabled) {
|
|
86
|
+
event.stopImmediatePropagation();
|
|
87
|
+
}
|
|
88
|
+
});
|
|
108
89
|
}
|
|
109
90
|
render() {
|
|
110
|
-
const
|
|
111
|
-
|
|
91
|
+
const className = cvaButton({
|
|
92
|
+
variant: this.variant,
|
|
93
|
+
color: this.color,
|
|
112
94
|
size: this.size
|
|
113
95
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
icon=${this.leftIcon}
|
|
117
|
-
size=${BUTTON_ICON_SIZE_MAP[this.size]}
|
|
118
|
-
color="current"
|
|
119
|
-
></daikin-icon>` : null}
|
|
120
|
-
<slot></slot>
|
|
121
|
-
${this.rightIcon ? lit.html`<daikin-icon
|
|
122
|
-
icon=${this.rightIcon}
|
|
123
|
-
size=${BUTTON_ICON_SIZE_MAP[this.size]}
|
|
124
|
-
color="current"
|
|
125
|
-
></daikin-icon>` : null}
|
|
126
|
-
`;
|
|
127
|
-
if (this.href) {
|
|
96
|
+
if (this.type === "link") {
|
|
97
|
+
const linkDisabled = this.disabled || this.href == null;
|
|
128
98
|
return lit.html`<a
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
role
|
|
99
|
+
class=${className}
|
|
100
|
+
href=${ifDefined_js.ifDefined(!linkDisabled ? this.href ?? void 0 : void 0)}
|
|
101
|
+
role=${ifDefined_js.ifDefined(
|
|
102
|
+
this.buttonRole ?? (linkDisabled ? "link" : void 0)
|
|
103
|
+
)}
|
|
104
|
+
aria-disabled=${ifDefined_js.ifDefined(linkDisabled ? "true" : void 0)}
|
|
132
105
|
>
|
|
133
|
-
|
|
106
|
+
<slot name="left-icon"><span class="block -ml-1"></span></slot>
|
|
107
|
+
<span class="px-2"><slot></slot></span>
|
|
108
|
+
<slot name="right-icon"><span class="block -mr-1"></span></slot>
|
|
134
109
|
</a>`;
|
|
135
110
|
}
|
|
136
111
|
return lit.html`
|
|
137
112
|
<button
|
|
138
|
-
class
|
|
139
|
-
?disabled
|
|
140
|
-
type
|
|
141
|
-
role
|
|
113
|
+
class=${className}
|
|
114
|
+
?disabled=${this.disabled}
|
|
115
|
+
type=${this.type}
|
|
116
|
+
role=${ifDefined_js.ifDefined(this.buttonRole ?? void 0)}
|
|
142
117
|
>
|
|
143
|
-
|
|
118
|
+
<slot name="left-icon"><span class="block -ml-1"></span></slot>
|
|
119
|
+
<span class="px-2"><slot></slot></span>
|
|
120
|
+
<slot name="right-icon"><span class="block -mr-1"></span></slot>
|
|
144
121
|
</button>
|
|
145
122
|
`;
|
|
146
123
|
}
|
|
147
124
|
/**
|
|
148
|
-
* Focuses on the inner button.
|
|
125
|
+
* Focuses on the inner button or link.
|
|
149
126
|
* @param options focus options
|
|
150
127
|
*/
|
|
151
128
|
focus(options) {
|
|
152
|
-
var _a
|
|
153
|
-
(
|
|
129
|
+
var _a;
|
|
130
|
+
(_a = this._focusableElement) == null ? void 0 : _a.focus(options);
|
|
154
131
|
}
|
|
155
132
|
};
|
|
156
133
|
exports.DaikinButton.styles = lit.css`
|
|
157
134
|
${lit.unsafeCSS(tailwind.default)}
|
|
158
135
|
|
|
159
136
|
:host {
|
|
160
|
-
--buttonColorBackgroundPrimaryActive: ${lit.unsafeCSS(
|
|
161
|
-
variables_js.buttonColorBackgroundPrimaryActive
|
|
162
|
-
)};
|
|
163
|
-
--buttonColorBackgroundPrimaryFocus: ${lit.unsafeCSS(
|
|
164
|
-
variables_js.buttonColorBackgroundPrimaryFocus
|
|
165
|
-
)};
|
|
166
|
-
--buttonColorBackgroundPrimaryHover: ${lit.unsafeCSS(
|
|
167
|
-
variables_js.buttonColorBackgroundPrimaryHover
|
|
168
|
-
)};
|
|
169
|
-
--buttonColorBackgroundPrimaryPress: ${lit.unsafeCSS(
|
|
170
|
-
variables_js.buttonColorBackgroundPrimaryPress
|
|
171
|
-
)};
|
|
172
|
-
--buttonColorBackgroundPrimaryDisabled: ${lit.unsafeCSS(
|
|
173
|
-
variables_js.buttonColorBackgroundPrimaryDisabled
|
|
174
|
-
)};
|
|
175
|
-
|
|
176
137
|
display: inline-block;
|
|
177
|
-
width: fit-content;
|
|
178
|
-
min-height: 42px;
|
|
179
|
-
height: 1px;
|
|
180
138
|
}
|
|
181
139
|
|
|
182
|
-
:host([size="
|
|
183
|
-
min-
|
|
140
|
+
:host([size="small"]) {
|
|
141
|
+
min-width: 52px;
|
|
142
|
+
height: 32px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:host([size="medium"]) {
|
|
146
|
+
min-width: 60px;
|
|
147
|
+
height: 48px;
|
|
184
148
|
}
|
|
185
149
|
`;
|
|
186
150
|
__decorateClass([
|
|
187
|
-
decorators_js.property({ type: String })
|
|
151
|
+
decorators_js.property({ type: String, reflect: true })
|
|
188
152
|
], exports.DaikinButton.prototype, "variant", 2);
|
|
189
|
-
__decorateClass([
|
|
190
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
191
|
-
], exports.DaikinButton.prototype, "disabled", 2);
|
|
192
153
|
__decorateClass([
|
|
193
154
|
decorators_js.property({ type: String, reflect: true })
|
|
194
|
-
], exports.DaikinButton.prototype, "
|
|
155
|
+
], exports.DaikinButton.prototype, "size", 2);
|
|
195
156
|
__decorateClass([
|
|
196
157
|
decorators_js.property({ type: String, reflect: true })
|
|
197
|
-
], exports.DaikinButton.prototype, "
|
|
158
|
+
], exports.DaikinButton.prototype, "color", 2);
|
|
198
159
|
__decorateClass([
|
|
199
|
-
decorators_js.property({ type:
|
|
200
|
-
], exports.DaikinButton.prototype, "
|
|
160
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
161
|
+
], exports.DaikinButton.prototype, "disabled", 2);
|
|
201
162
|
__decorateClass([
|
|
202
163
|
decorators_js.property({ type: String, reflect: true })
|
|
203
|
-
], exports.DaikinButton.prototype, "
|
|
164
|
+
], exports.DaikinButton.prototype, "href", 2);
|
|
204
165
|
__decorateClass([
|
|
205
166
|
decorators_js.property({ type: String, reflect: true })
|
|
206
167
|
], exports.DaikinButton.prototype, "type", 2);
|
|
207
168
|
__decorateClass([
|
|
208
|
-
decorators_js.property({ type: String, reflect: true })
|
|
209
|
-
], exports.DaikinButton.prototype, "
|
|
169
|
+
decorators_js.property({ type: String, reflect: true, attribute: "button-role" })
|
|
170
|
+
], exports.DaikinButton.prototype, "buttonRole", 2);
|
|
210
171
|
__decorateClass([
|
|
211
|
-
decorators_js.
|
|
212
|
-
], exports.DaikinButton.prototype, "
|
|
172
|
+
decorators_js.query("a,button")
|
|
173
|
+
], exports.DaikinButton.prototype, "_focusableElement", 2);
|
|
213
174
|
exports.DaikinButton = __decorateClass([
|
|
214
175
|
decorators_js.customElement("daikin-button")
|
|
215
176
|
], exports.DaikinButton);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { ARIARole } from '../../lit-analyzer-types';
|
|
3
3
|
import { MergeVariantProps } from '../../type-utils';
|
|
4
|
-
import { IconType } from '../icon/daikin-icon';
|
|
5
4
|
declare const cvaButton: (props?: ({
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
color?: "default" | "danger" | null | undefined;
|
|
6
|
+
variant?: "fill" | "outline" | "ghost" | null | undefined;
|
|
7
|
+
size?: "small" | "medium" | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
9
|
type ButtonVariantProps = MergeVariantProps<typeof cvaButton>;
|
|
10
10
|
/**
|
|
@@ -14,9 +14,15 @@ type ButtonVariantProps = MergeVariantProps<typeof cvaButton>;
|
|
|
14
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
15
|
*
|
|
16
16
|
* @slot - A slot for the button content.
|
|
17
|
+
* @slot left-icon - A slot for an icon to be placed to the left of the text. Place `daikin-icon` or something similar.
|
|
18
|
+
* @slot right-icon - A slot for an icon to be placed to the right of the text. Place `daikin-icon` or something similar.
|
|
17
19
|
*
|
|
18
20
|
* @example
|
|
19
21
|
*
|
|
22
|
+
* ```js
|
|
23
|
+
* import "@daikin-oss/design-system-web-components/components/button/index.js";
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
20
26
|
* ```html
|
|
21
27
|
* <daikin-button>
|
|
22
28
|
* Button label
|
|
@@ -26,47 +32,44 @@ type ButtonVariantProps = MergeVariantProps<typeof cvaButton>;
|
|
|
26
32
|
export declare class DaikinButton extends LitElement {
|
|
27
33
|
static readonly styles: import('lit').CSSResult;
|
|
28
34
|
/**
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
variant: ButtonVariantProps["intent"];
|
|
32
|
-
/**
|
|
33
|
-
* `true` if the button should be disabled.
|
|
35
|
+
* Variant of the button.
|
|
34
36
|
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Set a icon in the right of button label.
|
|
38
|
-
*/
|
|
39
|
-
rightIcon: IconType | null;
|
|
37
|
+
variant: ButtonVariantProps["variant"];
|
|
40
38
|
/**
|
|
41
|
-
*
|
|
39
|
+
* Size of the button.
|
|
42
40
|
*/
|
|
43
|
-
|
|
41
|
+
size: "small" | "medium";
|
|
44
42
|
/**
|
|
45
|
-
*
|
|
43
|
+
* Color of the button.
|
|
46
44
|
*/
|
|
47
|
-
|
|
45
|
+
color: ButtonVariantProps["color"];
|
|
48
46
|
/**
|
|
49
|
-
*
|
|
47
|
+
* Whether the button is disabled.
|
|
50
48
|
*/
|
|
51
|
-
|
|
49
|
+
disabled: boolean;
|
|
52
50
|
/**
|
|
53
|
-
*
|
|
51
|
+
* Link `href`.
|
|
52
|
+
* Only used if the `type` is `"link"`.
|
|
53
|
+
* If omitted with `type="link"`, the link will be treated as [a placeholder link](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element:~:text=If%20the%20a%20element%20has%20no%20href%20attribute) and rendered as disabled state.
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
href: string | null;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Type of the button.
|
|
58
|
+
* If `"link"` is specified, the button will be rendered as an `<a>` element or `<span>` element (if `disabled` is `true`).
|
|
58
59
|
*/
|
|
59
|
-
|
|
60
|
+
type: "button" | "submit" | "reset" | "link";
|
|
60
61
|
/**
|
|
61
|
-
*
|
|
62
|
+
* Optional ARIA role of the button.
|
|
62
63
|
*/
|
|
63
|
-
|
|
64
|
+
buttonRole: ARIARole | null;
|
|
65
|
+
private _focusableElement;
|
|
66
|
+
constructor();
|
|
64
67
|
render(): import('lit-html').TemplateResult<1>;
|
|
65
68
|
/**
|
|
66
|
-
* Focuses on the inner button.
|
|
69
|
+
* Focuses on the inner button or link.
|
|
67
70
|
* @param options focus options
|
|
68
71
|
*/
|
|
69
|
-
focus(options?: FocusOptions
|
|
72
|
+
focus(options?: FocusOptions): void;
|
|
70
73
|
}
|
|
71
74
|
declare global {
|
|
72
75
|
interface HTMLElementTagNameMap {
|