@daikin-oss/design-system-web-components 1.3.1 → 1.4.0-next.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.
Files changed (164) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/dist/cjs/base/dds-element.cjs +1 -1
  3. package/dist/cjs/components/badge/daikin-badge.cjs +133 -0
  4. package/dist/cjs/components/badge/daikin-badge.d.cts +85 -0
  5. package/dist/cjs/components/badge/index.cjs +7 -0
  6. package/dist/cjs/components/badge/index.d.cts +1 -0
  7. package/dist/cjs/components/button/daikin-button.d.cts +1 -1
  8. package/dist/cjs/components/calendar/daikin-calendar.cjs +28 -6
  9. package/dist/cjs/components/calendar/daikin-calendar.d.cts +9 -0
  10. package/dist/cjs/components/combobox/daikin-combobox.cjs +6 -3
  11. package/dist/cjs/components/date-picker/daikin-date-picker.cjs +26 -2
  12. package/dist/cjs/components/date-picker/daikin-date-picker.d.cts +5 -0
  13. package/dist/cjs/components/dropdown/daikin-dropdown.cjs +5 -7
  14. package/dist/cjs/components/icon/daikin-icon.cjs +4 -4
  15. package/dist/cjs/components/icon/daikin-icon.d.cts +8 -0
  16. package/dist/cjs/components/icon/icons.json.cjs +1 -1
  17. package/dist/cjs/components/icon/icons.json.d.cts +8 -0
  18. package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +1 -1
  19. package/dist/cjs/components/index.cjs +10 -0
  20. package/dist/cjs/components/index.d.cts +2 -0
  21. package/dist/cjs/components/inline-notification/daikin-inline-notification.d.cts +4 -1
  22. package/dist/cjs/components/input-group/daikin-input-group.cjs +21 -6
  23. package/dist/cjs/components/menu/daikin-menu.cjs +21 -10
  24. package/dist/cjs/components/menu/daikin-menu.d.cts +6 -1
  25. package/dist/cjs/components/pagination/daikin-pagination.cjs +2 -1
  26. package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.cjs +2 -2
  27. package/dist/cjs/components/status-message/daikin-status-message.cjs +110 -0
  28. package/dist/cjs/components/status-message/daikin-status-message.d.cts +51 -0
  29. package/dist/cjs/components/status-message/index.cjs +7 -0
  30. package/dist/cjs/components/status-message/index.d.cts +1 -0
  31. package/dist/cjs/components/table/daikin-table.cjs +2 -2
  32. package/dist/cjs/components/time-picker/daikin-time-picker.cjs +1 -1
  33. package/dist/cjs/components/toast-notification/daikin-toast-notification.d.cts +4 -1
  34. package/dist/cjs/components/tree/daikin-tree.d.cts +2 -1
  35. package/dist/cjs/components/tree-item/daikin-tree-item.d.cts +6 -1
  36. package/dist/cjs/components/tree-section/daikin-tree-section.d.cts +6 -1
  37. package/dist/cjs/index.cjs +10 -0
  38. package/dist/cjs/tailwind.css.cjs +1 -1
  39. package/dist/cjs/utils/calendar-common.cjs +6 -0
  40. package/dist/cjs/utils/calendar-common.d.cts +7 -0
  41. package/dist/cjs/utils/notification-common.d.cts +1 -1
  42. package/dist/cjs-dev/base/dds-element.cjs +1 -1
  43. package/dist/cjs-dev/components/badge/daikin-badge.cjs +133 -0
  44. package/dist/cjs-dev/components/badge/daikin-badge.d.cts +85 -0
  45. package/dist/cjs-dev/components/badge/index.cjs +7 -0
  46. package/dist/cjs-dev/components/badge/index.d.cts +1 -0
  47. package/dist/cjs-dev/components/button/daikin-button.d.cts +1 -1
  48. package/dist/cjs-dev/components/calendar/daikin-calendar.cjs +28 -6
  49. package/dist/cjs-dev/components/calendar/daikin-calendar.d.cts +9 -0
  50. package/dist/cjs-dev/components/combobox/daikin-combobox.cjs +6 -3
  51. package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +26 -2
  52. package/dist/cjs-dev/components/date-picker/daikin-date-picker.d.cts +5 -0
  53. package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +5 -7
  54. package/dist/cjs-dev/components/icon/daikin-icon.cjs +4 -4
  55. package/dist/cjs-dev/components/icon/daikin-icon.d.cts +8 -0
  56. package/dist/cjs-dev/components/icon/icons.json.cjs +1 -1
  57. package/dist/cjs-dev/components/icon/icons.json.d.cts +8 -0
  58. package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +1 -1
  59. package/dist/cjs-dev/components/index.cjs +10 -0
  60. package/dist/cjs-dev/components/index.d.cts +2 -0
  61. package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.d.cts +4 -1
  62. package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +21 -6
  63. package/dist/cjs-dev/components/menu/daikin-menu.cjs +21 -10
  64. package/dist/cjs-dev/components/menu/daikin-menu.d.cts +6 -1
  65. package/dist/cjs-dev/components/pagination/daikin-pagination.cjs +2 -1
  66. package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.cjs +2 -2
  67. package/dist/cjs-dev/components/status-message/daikin-status-message.cjs +110 -0
  68. package/dist/cjs-dev/components/status-message/daikin-status-message.d.cts +51 -0
  69. package/dist/cjs-dev/components/status-message/index.cjs +7 -0
  70. package/dist/cjs-dev/components/status-message/index.d.cts +1 -0
  71. package/dist/cjs-dev/components/table/daikin-table.cjs +2 -2
  72. package/dist/cjs-dev/components/time-picker/daikin-time-picker.cjs +1 -1
  73. package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.d.cts +4 -1
  74. package/dist/cjs-dev/components/tree/daikin-tree.d.cts +2 -1
  75. package/dist/cjs-dev/components/tree-item/daikin-tree-item.d.cts +6 -1
  76. package/dist/cjs-dev/components/tree-section/daikin-tree-section.d.cts +6 -1
  77. package/dist/cjs-dev/index.cjs +10 -0
  78. package/dist/cjs-dev/tailwind.css.cjs +1 -1
  79. package/dist/cjs-dev/utils/calendar-common.cjs +6 -0
  80. package/dist/cjs-dev/utils/calendar-common.d.cts +7 -0
  81. package/dist/cjs-dev/utils/notification-common.d.cts +1 -1
  82. package/dist/es/base/dds-element.js +1 -1
  83. package/dist/es/components/badge/daikin-badge.d.ts +85 -0
  84. package/dist/es/components/badge/daikin-badge.js +134 -0
  85. package/dist/es/components/badge/index.d.ts +1 -0
  86. package/dist/es/components/badge/index.js +4 -0
  87. package/dist/es/components/button/daikin-button.d.ts +1 -1
  88. package/dist/es/components/calendar/daikin-calendar.d.ts +9 -0
  89. package/dist/es/components/calendar/daikin-calendar.js +29 -7
  90. package/dist/es/components/combobox/daikin-combobox.js +6 -3
  91. package/dist/es/components/date-picker/daikin-date-picker.d.ts +5 -0
  92. package/dist/es/components/date-picker/daikin-date-picker.js +26 -2
  93. package/dist/es/components/dropdown/daikin-dropdown.js +6 -8
  94. package/dist/es/components/icon/daikin-icon.d.ts +8 -0
  95. package/dist/es/components/icon/daikin-icon.js +4 -4
  96. package/dist/es/components/icon/icons.json.d.ts +8 -0
  97. package/dist/es/components/icon/icons.json.js +1 -1
  98. package/dist/es/components/icon-button/daikin-icon-button.d.ts +1 -1
  99. package/dist/es/components/index.d.ts +2 -0
  100. package/dist/es/components/index.js +4 -0
  101. package/dist/es/components/inline-notification/daikin-inline-notification.d.ts +4 -1
  102. package/dist/es/components/input-group/daikin-input-group.js +21 -6
  103. package/dist/es/components/menu/daikin-menu.d.ts +6 -1
  104. package/dist/es/components/menu/daikin-menu.js +21 -10
  105. package/dist/es/components/pagination/daikin-pagination.js +2 -1
  106. package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.js +2 -2
  107. package/dist/es/components/status-message/daikin-status-message.d.ts +51 -0
  108. package/dist/es/components/status-message/daikin-status-message.js +111 -0
  109. package/dist/es/components/status-message/index.d.ts +1 -0
  110. package/dist/es/components/status-message/index.js +4 -0
  111. package/dist/es/components/table/daikin-table.js +2 -2
  112. package/dist/es/components/time-picker/daikin-time-picker.js +1 -1
  113. package/dist/es/components/toast-notification/daikin-toast-notification.d.ts +4 -1
  114. package/dist/es/components/tree/daikin-tree.d.ts +2 -1
  115. package/dist/es/components/tree-item/daikin-tree-item.d.ts +6 -1
  116. package/dist/es/components/tree-section/daikin-tree-section.d.ts +6 -1
  117. package/dist/es/index.js +4 -0
  118. package/dist/es/tailwind.css.js +1 -1
  119. package/dist/es/utils/calendar-common.d.ts +7 -0
  120. package/dist/es/utils/calendar-common.js +6 -0
  121. package/dist/es/utils/notification-common.d.ts +1 -1
  122. package/dist/es-dev/base/dds-element.js +1 -1
  123. package/dist/es-dev/components/badge/daikin-badge.d.ts +85 -0
  124. package/dist/es-dev/components/badge/daikin-badge.js +134 -0
  125. package/dist/es-dev/components/badge/index.d.ts +1 -0
  126. package/dist/es-dev/components/badge/index.js +4 -0
  127. package/dist/es-dev/components/button/daikin-button.d.ts +1 -1
  128. package/dist/es-dev/components/calendar/daikin-calendar.d.ts +9 -0
  129. package/dist/es-dev/components/calendar/daikin-calendar.js +29 -7
  130. package/dist/es-dev/components/combobox/daikin-combobox.js +6 -3
  131. package/dist/es-dev/components/date-picker/daikin-date-picker.d.ts +5 -0
  132. package/dist/es-dev/components/date-picker/daikin-date-picker.js +26 -2
  133. package/dist/es-dev/components/dropdown/daikin-dropdown.js +6 -8
  134. package/dist/es-dev/components/icon/daikin-icon.d.ts +8 -0
  135. package/dist/es-dev/components/icon/daikin-icon.js +4 -4
  136. package/dist/es-dev/components/icon/icons.json.d.ts +8 -0
  137. package/dist/es-dev/components/icon/icons.json.js +1 -1
  138. package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +1 -1
  139. package/dist/es-dev/components/index.d.ts +2 -0
  140. package/dist/es-dev/components/index.js +4 -0
  141. package/dist/es-dev/components/inline-notification/daikin-inline-notification.d.ts +4 -1
  142. package/dist/es-dev/components/input-group/daikin-input-group.js +21 -6
  143. package/dist/es-dev/components/menu/daikin-menu.d.ts +6 -1
  144. package/dist/es-dev/components/menu/daikin-menu.js +21 -10
  145. package/dist/es-dev/components/pagination/daikin-pagination.js +2 -1
  146. package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.js +2 -2
  147. package/dist/es-dev/components/status-message/daikin-status-message.d.ts +51 -0
  148. package/dist/es-dev/components/status-message/daikin-status-message.js +111 -0
  149. package/dist/es-dev/components/status-message/index.d.ts +1 -0
  150. package/dist/es-dev/components/status-message/index.js +4 -0
  151. package/dist/es-dev/components/table/daikin-table.js +2 -2
  152. package/dist/es-dev/components/time-picker/daikin-time-picker.js +1 -1
  153. package/dist/es-dev/components/toast-notification/daikin-toast-notification.d.ts +4 -1
  154. package/dist/es-dev/components/tree/daikin-tree.d.ts +2 -1
  155. package/dist/es-dev/components/tree-item/daikin-tree-item.d.ts +6 -1
  156. package/dist/es-dev/components/tree-section/daikin-tree-section.d.ts +6 -1
  157. package/dist/es-dev/index.js +4 -0
  158. package/dist/es-dev/tailwind.css.js +1 -1
  159. package/dist/es-dev/utils/calendar-common.d.ts +7 -0
  160. package/dist/es-dev/utils/calendar-common.js +6 -0
  161. package/dist/es-dev/utils/notification-common.d.ts +1 -1
  162. package/icons/neutral.svg +3 -0
  163. package/icons/notification.svg +3 -0
  164. package/package.json +1 -1
@@ -0,0 +1,85 @@
1
+ import { DDSElement } from "../../base/index.js";
2
+ /**
3
+ * A badge is used to display notification counts, status indicators, or small dots in the UI—commonly for message alerts or status marking.
4
+ *
5
+ * @slot - A slot for anchoring element. Place `daikin-icon-button` here.
6
+ *
7
+ * @example
8
+ *
9
+ * ```js
10
+ * import "@daikin-oss/design-system-web-components/components/badge/index.js";
11
+ * import "@daikin-oss/design-system-web-components/components/icon/index.js";
12
+ * import "@daikin-oss/design-system-web-components/components/icon-button/index.js";
13
+ * ```
14
+ *
15
+ * ```html
16
+ * <daikin-badge count="42" max-count="999" color="danger">
17
+ * <daikin-icon-button variant="ghost" size="m" buttonAriaLabel="42 unread notifications">
18
+ * <daikin-icon
19
+ * class="w-8 h-8"
20
+ * icon="notification"
21
+ * size="current"
22
+ * color="current"
23
+ * >
24
+ * </daikin-icon>
25
+ * </daikin-icon-button>
26
+ * </daikin-badge>
27
+ * ```
28
+ */
29
+ export declare class DaikinBadge extends DDSElement {
30
+ static readonly styles: import('lit').CSSResult;
31
+ /**
32
+ * Badge type.
33
+ * - "number": Displays a number (e.g., message count, quantity).
34
+ * - "dot": Displays only a small dot (e.g., status indicator).
35
+ * @default "dot"
36
+ */
37
+ type: "number" | "dot";
38
+ /**
39
+ * The numeric content displayed in the badge.
40
+ * Only effective when type="number".
41
+ * Accepts a string or null; will be parsed as a number internally.
42
+ * @example "5"
43
+ */
44
+ count: string | null;
45
+ /**
46
+ * The maximum number to display in the badge.
47
+ * If the count exceeds this value, it will display as "maxCount+", e.g., "99+".
48
+ * Only effective when type="number".
49
+ * @example "99"
50
+ */
51
+ maxCount: string | null;
52
+ /**
53
+ * Whether to hide the badge.
54
+ * - true: The badge is not displayed (slot content remains visible).
55
+ * - false: The badge is displayed normally.
56
+ * @default false
57
+ */
58
+ invisible: boolean;
59
+ /**
60
+ * Badge color.
61
+ * Supports predefined semantic color tokens (danger, alarm, warning, success, information).
62
+ * @default "danger"
63
+ */
64
+ color: "danger" | "alarm" | "warning" | "success" | "information";
65
+ /**
66
+ * Computes the actual number to display in the badge.
67
+ * - If count is null or invalid, displays "0".
68
+ * - If count exceeds maxCount, displays "maxCount+".
69
+ * - Otherwise, displays the actual number.
70
+ */
71
+ private get _count();
72
+ /**
73
+ * Renders the badge component.
74
+ * - Renders a small dot when type="dot".
75
+ * - Renders a number when type="number" and count > 0.
76
+ * - Does not render the badge if invisible=true.
77
+ * - The slot wraps the icon button.
78
+ */
79
+ render(): import('lit-html').TemplateResult<1>;
80
+ }
81
+ declare global {
82
+ interface HTMLElementTagNameMap {
83
+ "daikin-badge": DaikinBadge;
84
+ }
85
+ }
@@ -0,0 +1,134 @@
1
+ import { cva } from "class-variance-authority";
2
+ import { unsafeCSS, css, html } from "lit";
3
+ import { property } from "lit/decorators.js";
4
+ import { DDSElement } from "../../base/dds-element.js";
5
+ import "../../base/dds-form-element.js";
6
+ import { ddsElement } from "../../base/decorators.js";
7
+ import "../../base/define.js";
8
+ import tailwindStyles from "../../tailwind.css.js";
9
+ var __defProp = Object.defineProperty;
10
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11
+ var __decorateClass = (decorators, target, key, kind) => {
12
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
13
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
14
+ if (decorator = decorators[i])
15
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
16
+ if (kind && result) __defProp(target, key, result);
17
+ return result;
18
+ };
19
+ const cvaBadge = cva(["absolute", "rounded-full"], {
20
+ variants: {
21
+ type: {
22
+ number: [
23
+ "h-4",
24
+ "min-w-4",
25
+ "px-1",
26
+ "text-[10px]",
27
+ "font-normal",
28
+ "font-daikinSerif",
29
+ "text-white",
30
+ "flex",
31
+ "items-center",
32
+ "justify-center",
33
+ "-top-[2px]",
34
+ "-right-[2px]",
35
+ "before:content-[attr(data-count)]",
36
+ "before:leading-none",
37
+ "before:whitespace-nowrap",
38
+ "data-[count=0]:hidden"
39
+ ],
40
+ dot: ["w-2", "h-2", "top-1", "right-1"]
41
+ },
42
+ color: {
43
+ danger: ["bg-ddt-color-common-danger-default"],
44
+ alarm: ["bg-ddt-color-common-alarm"],
45
+ warning: ["bg-ddt-color-common-warning"],
46
+ success: ["bg-ddt-color-common-success"],
47
+ information: ["bg-ddt-color-common-information"]
48
+ }
49
+ }
50
+ });
51
+ let DaikinBadge = class extends DDSElement {
52
+ constructor() {
53
+ super(...arguments);
54
+ this.type = "dot";
55
+ this.count = null;
56
+ this.maxCount = "99";
57
+ this.invisible = false;
58
+ this.color = "danger";
59
+ }
60
+ /**
61
+ * Computes the actual number to display in the badge.
62
+ * - If count is null or invalid, displays "0".
63
+ * - If count exceeds maxCount, displays "maxCount+".
64
+ * - Otherwise, displays the actual number.
65
+ */
66
+ get _count() {
67
+ if (this.count == null) {
68
+ return "0";
69
+ }
70
+ const count = parseInt(this.count, 10);
71
+ const maxCount = this.maxCount ? parseInt(this.maxCount, 10) : null;
72
+ if (isNaN(count) || count < 0) {
73
+ return "0";
74
+ }
75
+ if (maxCount != null && !isNaN(maxCount) && count > maxCount) {
76
+ return `${maxCount.toLocaleString()}+`;
77
+ }
78
+ return count.toLocaleString();
79
+ }
80
+ /**
81
+ * Renders the badge component.
82
+ * - Renders a small dot when type="dot".
83
+ * - Renders a number when type="number" and count > 0.
84
+ * - Does not render the badge if invisible=true.
85
+ * - The slot wraps the icon button.
86
+ */
87
+ render() {
88
+ return html`
89
+ <slot></slot>
90
+ <span
91
+ role="presentation"
92
+ data-count=${this._count}
93
+ class=${cvaBadge({
94
+ type: this.type,
95
+ color: this.color
96
+ })}
97
+ ?hidden=${this.invisible}
98
+ ></span>
99
+ `;
100
+ }
101
+ };
102
+ DaikinBadge.styles = css`
103
+ ${unsafeCSS(tailwindStyles)}
104
+
105
+ :host {
106
+ display: inline-flex;
107
+ position: relative;
108
+ }
109
+
110
+ span[hidden] {
111
+ display: none;
112
+ }
113
+ `;
114
+ __decorateClass([
115
+ property({ type: String, reflect: true })
116
+ ], DaikinBadge.prototype, "type", 2);
117
+ __decorateClass([
118
+ property({ type: String, reflect: true })
119
+ ], DaikinBadge.prototype, "count", 2);
120
+ __decorateClass([
121
+ property({ type: String, reflect: true, attribute: "max-count" })
122
+ ], DaikinBadge.prototype, "maxCount", 2);
123
+ __decorateClass([
124
+ property({ type: Boolean, reflect: true })
125
+ ], DaikinBadge.prototype, "invisible", 2);
126
+ __decorateClass([
127
+ property({ type: String, reflect: true })
128
+ ], DaikinBadge.prototype, "color", 2);
129
+ DaikinBadge = __decorateClass([
130
+ ddsElement("daikin-badge")
131
+ ], DaikinBadge);
132
+ export {
133
+ DaikinBadge
134
+ };
@@ -0,0 +1 @@
1
+ export * from "./daikin-badge.js";
@@ -0,0 +1,4 @@
1
+ import { DaikinBadge } from "./daikin-badge.js";
2
+ export {
3
+ DaikinBadge
4
+ };
@@ -2,7 +2,7 @@ import { DDSFormSubmitElement } from "../../base/index.js";
2
2
  import { ARIARole } from "../../lit-analyzer-types.js";
3
3
  import { MergeVariantProps } from "../../type-utils.js";
4
4
  declare const cvaButton: (props?: ({
5
- color?: "default" | "danger" | null | undefined;
5
+ color?: "danger" | "default" | null | undefined;
6
6
  variant?: "fill" | "outline" | "ghost" | null | undefined;
7
7
  size?: "small" | "medium" | "large" | null | undefined;
8
8
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -46,6 +46,15 @@ export declare class DaikinCalendar extends DDSElement {
46
46
  * Intended for use only by `daikin-date-picker`.
47
47
  */
48
48
  view: "year" | "month" | "day";
49
+ /**
50
+ * The date that was last focused.
51
+ * Used to preserve focus when tabbing out and back in.
52
+ */
53
+ private _lastFocusedDate;
54
+ /**
55
+ * The date to be focused.
56
+ * Used to set focus on a date that is not in the current view (year and month).
57
+ */
49
58
  private _dateToBeFocused;
50
59
  private get _value();
51
60
  private get _min();
@@ -8,7 +8,7 @@ import "../../base/dds-form-element.js";
8
8
  import { ddsElement } from "../../base/decorators.js";
9
9
  import "../../base/define.js";
10
10
  import tailwindStyles from "../../tailwind.css.js";
11
- import { tryParseDateFromProperty, parseDateFromProperty, cloneDate, isMonthOutOfRange, getDateByMonthOffsetClamped, formatDateForProperty, clampDate, isSameYearMonth, createDateClamped, calcWeeksOnCalendar, isDateOutOfRange, cvaIconButton, normalizeDate, DEFAULT_MIN_DATE, DEFAULT_MAX_DATE } from "../../utils/calendar-common.js";
11
+ import { tryParseDateFromProperty, parseDateFromProperty, cloneDate, isMonthOutOfRange, getDateByMonthOffsetClamped, formatDateForProperty, clampDate, isSameYearMonth, createDateClamped, calcWeeksOnCalendar, toFirstDayOfMonth, isDateOutOfRange, cvaIconButton, normalizeDate, DEFAULT_MIN_DATE, DEFAULT_MAX_DATE } from "../../utils/calendar-common.js";
12
12
  import { scrollIntoViewOnlyParent } from "../../utils/scroller.js";
13
13
  import "../icon-button/daikin-icon-button.js";
14
14
  var __defProp = Object.defineProperty;
@@ -129,6 +129,7 @@ let DaikinCalendar = class extends DDSElement {
129
129
  this.max = "2099-12-31";
130
130
  this.defaultValue = null;
131
131
  this.view = "day";
132
+ this._lastFocusedDate = null;
132
133
  this._dateToBeFocused = null;
133
134
  this._viewDate = getToday();
134
135
  }
@@ -175,6 +176,7 @@ let DaikinCalendar = class extends DDSElement {
175
176
  }
176
177
  _navigateMonth(date, offset) {
177
178
  this._viewDate = getDateByMonthOffsetClamped(date, offset);
179
+ this._lastFocusedDate = null;
178
180
  }
179
181
  _handleCalendarClick(date) {
180
182
  this.value = formatDateForProperty(date);
@@ -206,6 +208,7 @@ let DaikinCalendar = class extends DDSElement {
206
208
  `[data-type=day][data-date="${formatDateForProperty(dateToBeFocused)}"]`
207
209
  );
208
210
  if (dateButton && isSameYearMonth(dateToBeFocused, focusedDate)) {
211
+ this._lastFocusedDate = dateToBeFocused;
209
212
  dateButton.focus();
210
213
  } else {
211
214
  this._dateToBeFocused = dateToBeFocused;
@@ -361,7 +364,19 @@ let DaikinCalendar = class extends DDSElement {
361
364
  viewDate.getUTCFullYear(),
362
365
  viewDate.getUTCMonth()
363
366
  );
364
- const focusable = value && isSameYearMonth(viewDate, value) ? value : isSameYearMonth(viewDate, today) ? today : clampDate(viewDate, min, max);
367
+ const focusable = (
368
+ // If the last focused date is in the same month as the view date, use it as the focusable date.
369
+ this._lastFocusedDate && isSameYearMonth(viewDate, this._lastFocusedDate) ? this._lastFocusedDate : (
370
+ // If the value is in the same month as the view date, use it as the focusable date.
371
+ value && isSameYearMonth(viewDate, value) ? value : (
372
+ // If today's date is in the same month as the view date, use it as the focusable date.
373
+ isSameYearMonth(viewDate, today) ? today : (
374
+ // Otherwise, use the first day of the month (clamped).
375
+ clampDate(toFirstDayOfMonth(viewDate), min, max)
376
+ )
377
+ )
378
+ )
379
+ );
365
380
  return html`<div class="flex flex-col gap-2 w-full h-72" role="grid">
366
381
  <div class="flex gap-1 flex-wrap w-full px-4" role="row">
367
382
  ${repeat(
@@ -396,9 +411,7 @@ let DaikinCalendar = class extends DDSElement {
396
411
  })}
397
412
  role="gridcell"
398
413
  ?disabled=${isDateOutOfRange(date, min, max)}
399
- tabindex=${ifDefined(
400
- focusable.getTime() != date.getTime() ? -1 : void 0
401
- )}
414
+ tabindex=${date.getTime() === focusable.getTime() ? nothing : -1}
402
415
  aria-current=${date.getTime() === today.getTime() ? "date" : nothing}
403
416
  aria-selected=${date.getTime() === (value == null ? void 0 : value.getTime())}
404
417
  data-type="day"
@@ -496,11 +509,14 @@ let DaikinCalendar = class extends DDSElement {
496
509
  }
497
510
  }
498
511
  updated(changedProperties) {
499
- if (changedProperties.has("_viewDate") && this._dateToBeFocused != null) {
512
+ if (this._dateToBeFocused != null) {
500
513
  const dateButton = this.renderRoot.querySelector(
501
514
  `[data-type=day][data-date="${formatDateForProperty(this._dateToBeFocused)}"]`
502
515
  );
503
- dateButton == null ? void 0 : dateButton.focus();
516
+ if (dateButton) {
517
+ this._lastFocusedDate = this._dateToBeFocused;
518
+ dateButton.focus();
519
+ }
504
520
  this._dateToBeFocused = null;
505
521
  }
506
522
  if (changedProperties.get("view") != null) {
@@ -543,6 +559,12 @@ __decorateClass([
543
559
  __decorateClass([
544
560
  property({ type: String, attribute: false })
545
561
  ], DaikinCalendar.prototype, "view", 2);
562
+ __decorateClass([
563
+ state()
564
+ ], DaikinCalendar.prototype, "_lastFocusedDate", 2);
565
+ __decorateClass([
566
+ state()
567
+ ], DaikinCalendar.prototype, "_dateToBeFocused", 2);
546
568
  __decorateClass([
547
569
  state()
548
570
  ], DaikinCalendar.prototype, "_viewDate", 2);
@@ -104,8 +104,11 @@ const cvaOption = cva(
104
104
  "active:var-color-ddt-color-common-surface-selected-press/color-primary",
105
105
  "after:i-daikin-dropdown-check",
106
106
  "after:size-6",
107
- "after:flex-none",
108
- "justify-between"
107
+ "pr-10",
108
+ "after:absolute",
109
+ "after:right-3",
110
+ "after:top-1/2",
111
+ "after:-translate-y-1/2"
109
112
  ]
110
113
  },
111
114
  disabled: {
@@ -431,7 +434,7 @@ let DaikinCombobox = class extends DDSFormElement {
431
434
  aria-label=${ifDefined(this._label ?? void 0)}
432
435
  aria-expanded=${this.open && !this.disabled}
433
436
  aria-disabled=${this.disabled}
434
- aria-controls="combobox-items"
437
+ aria-controls=${ifDefined(this.open ? "combobox-items" : void 0)}
435
438
  aria-autocomplete="list"
436
439
  aria-required=${this.required}
437
440
  aria-haspopup="listbox"
@@ -70,12 +70,16 @@ export declare class DaikinDatePicker extends DDSFormElement {
70
70
  private _autoUpdateController;
71
71
  private _dateInputElement;
72
72
  private _calendarElement;
73
+ private _calendarButtonElement;
73
74
  private get _value();
74
75
  private get _min();
75
76
  private get _max();
76
77
  private get _defaultValue();
77
78
  private get _viewDate();
78
79
  private get _open();
80
+ private _ignoreCloseByFocusTrap;
81
+ private _handleCloseCalendar;
82
+ private readonly _focusTrapController;
79
83
  private _emitSelect;
80
84
  private _handleFocusIn;
81
85
  private _handleFocusOut;
@@ -84,6 +88,7 @@ export declare class DaikinDatePicker extends DDSFormElement {
84
88
  private _handleKeyDown;
85
89
  private _handleBeforeInput;
86
90
  private _handleSelect;
91
+ private _handlePointerDown;
87
92
  private _handlePointerUp;
88
93
  private _handleCalendarKeyDown;
89
94
  private _handleToggle;
@@ -10,6 +10,7 @@ import { DDSFormElement } from "../../base/dds-form-element.js";
10
10
  import { ddsElement } from "../../base/decorators.js";
11
11
  import "../../base/define.js";
12
12
  import { FloatingUIAutoUpdateController } from "../../controllers/floating-ui-auto-update.js";
13
+ import { FocusTrapController } from "../../controllers/focus-trap.js";
13
14
  import tailwindStyles from "../../tailwind.css.js";
14
15
  import { tryParseDateFromProperty, parseDateFromProperty, DEFAULT_MIN_DATE, DEFAULT_MAX_DATE, formatDateForProperty, isDateOutOfRange, cvaIconButton, countDaysForYearMonth } from "../../utils/calendar-common.js";
15
16
  import { reDispatch } from "../../utils/re-dispatch.js";
@@ -56,7 +57,7 @@ const cvaField = cva(
56
57
  "pl-4",
57
58
  "pr-10",
58
59
  "rounded",
59
- "overflow-hidden",
60
+ "truncate",
60
61
  "outline",
61
62
  "outline-[--color-border]",
62
63
  "outline-0",
@@ -243,6 +244,18 @@ let DaikinDatePicker = class extends DDSFormElement {
243
244
  this._autoUpdateController = new FloatingUIAutoUpdateController(this);
244
245
  this._dateInputElement = createRef();
245
246
  this._calendarElement = createRef();
247
+ this._calendarButtonElement = createRef();
248
+ this._ignoreCloseByFocusTrap = false;
249
+ this._handleCloseCalendar = () => {
250
+ var _a;
251
+ if (this._ignoreCloseByFocusTrap) return;
252
+ this.open = false;
253
+ (_a = this._calendarButtonElement.value) == null ? void 0 : _a.focus();
254
+ };
255
+ this._focusTrapController = new FocusTrapController(
256
+ this,
257
+ this._handleCloseCalendar
258
+ );
246
259
  }
247
260
  get _value() {
248
261
  return tryParseDateFromProperty(this.value);
@@ -406,7 +419,11 @@ let DaikinDatePicker = class extends DDSFormElement {
406
419
  }
407
420
  this._emitSelect();
408
421
  }
422
+ _handlePointerDown() {
423
+ this._ignoreCloseByFocusTrap = true;
424
+ }
409
425
  _handlePointerUp() {
426
+ this._ignoreCloseByFocusTrap = false;
410
427
  if (this.disabled || this.readonly) {
411
428
  return;
412
429
  }
@@ -504,12 +521,14 @@ let DaikinDatePicker = class extends DDSFormElement {
504
521
  @mouseup=${this._handleMouseUp}
505
522
  />
506
523
  <daikin-icon-button
524
+ ${ref(this._calendarButtonElement)}
507
525
  class="absolute top-0 bottom-0 right-2 m-auto"
508
526
  type="button"
509
527
  color="neutral"
510
528
  variant="ghost"
511
529
  button-aria-label="Open the date picker"
512
530
  ?disabled=${this.disabled}
531
+ @pointerdown=${this._handlePointerDown}
513
532
  @pointerup=${this._handlePointerUp}
514
533
  @keydown=${this._handleCalendarKeyDown}
515
534
  >
@@ -518,6 +537,7 @@ let DaikinDatePicker = class extends DDSFormElement {
518
537
  </div>
519
538
  <daikin-calendar
520
539
  ${ref(this._calendarElement)}
540
+ ${this._focusTrapController.refContainer()}
521
541
  id="calendar"
522
542
  .value=${this._value ? formatDateForProperty(this._value) : null}
523
543
  min=${formatDateForProperty(min)}
@@ -525,7 +545,7 @@ let DaikinDatePicker = class extends DDSFormElement {
525
545
  default-value=${ifDefined(
526
546
  this._defaultValue ? formatDateForProperty(this._defaultValue) : void 0
527
547
  )}
528
- popover="auto"
548
+ popover="manual"
529
549
  class="absolute left-[--floating-x,0] top-[--floating-y,0]"
530
550
  @toggle=${this._handleToggle}
531
551
  @select=${this._handleSelect}
@@ -544,6 +564,10 @@ let DaikinDatePicker = class extends DDSFormElement {
544
564
  },
545
565
  this.open
546
566
  )
567
+ )}
568
+ ${guard(
569
+ [this.open],
570
+ () => this._focusTrapController.directive(this.open)
547
571
  )}`;
548
572
  }
549
573
  willUpdate(changedProperties) {
@@ -1,8 +1,7 @@
1
1
  import { flip, offset, size } from "@floating-ui/dom";
2
2
  import { cva } from "class-variance-authority";
3
- import { unsafeCSS, css, html } from "lit";
3
+ import { unsafeCSS, css, nothing, html } from "lit";
4
4
  import { property, queryAssignedElements, query, state } from "lit/decorators.js";
5
- import { ifDefined } from "lit/directives/if-defined.js";
6
5
  import { createRef, ref } from "lit/directives/ref.js";
7
6
  import "../../base/dds-element.js";
8
7
  import { DDSFormElement } from "../../base/dds-form-element.js";
@@ -324,6 +323,7 @@ let DaikinDropdown = class extends DDSFormElement {
324
323
  return html`<div class="w-full" @keydown=${this._handleKeyDown}>
325
324
  <button
326
325
  ${ref(this._dropdownRef)}
326
+ id="dropdown-button"
327
327
  type="button"
328
328
  class=${cvaButton({
329
329
  open: this.open,
@@ -334,7 +334,7 @@ let DaikinDropdown = class extends DDSFormElement {
334
334
  aria-label=${this._label ?? fallbackLabel}
335
335
  aria-expanded=${this.open && !this.disabled}
336
336
  aria-disabled=${this.disabled}
337
- aria-controls="dropdown-items"
337
+ aria-controls=${this.open ? "dropdown-items" : nothing}
338
338
  aria-required=${this.required}
339
339
  aria-haspopup="listbox"
340
340
  @pointerup=${this._handlePointerUp}
@@ -348,16 +348,14 @@ let DaikinDropdown = class extends DDSFormElement {
348
348
  </button>
349
349
  <div
350
350
  id="dropdown-items"
351
+ role="listbox"
351
352
  popover="manual"
352
353
  class="flex flex-col overflow-hidden floating-unready:hidden absolute left-[--floating-x,0] top-[--floating-y,0] min-w-[--floating-width] max-h-[12.5rem] border border-ddt-color-divider opacity-1 transition-[opacity] rounded max-w-min"
354
+ aria-labelledby="dropdown-button"
353
355
  @floating-ready=${this._handleFloatingReady}
354
356
  ${this._autoUpdateController.refFloating()}
355
357
  >
356
- <div
357
- class="flex-1 overflow-y-auto break-all"
358
- aria-label=${ifDefined(this._label ?? void 0)}
359
- role="listbox"
360
- >
358
+ <div class="flex-1 overflow-y-auto break-all">
361
359
  <slot
362
360
  @slotchange=${this._handleSlotChange}
363
361
  @select=${this._handleSelect}
@@ -78,6 +78,14 @@ declare const icons: {
78
78
  class: string;
79
79
  color: null;
80
80
  };
81
+ notification: {
82
+ class: string;
83
+ color: null;
84
+ };
85
+ neutral: {
86
+ class: string;
87
+ color: null;
88
+ };
81
89
  };
82
90
  export declare const iconList: string[];
83
91
  export type IconType = keyof typeof icons;
@@ -162,19 +162,19 @@ DaikinIcon.styles = css`
162
162
  }
163
163
 
164
164
  :host([size="s"]) {
165
- --ddc-icon-size: 12px;
165
+ --ddc-icon-size: 16px;
166
166
  }
167
167
 
168
168
  :host([size="m"]) {
169
- --ddc-icon-size: 16px;
169
+ --ddc-icon-size: 24px;
170
170
  }
171
171
 
172
172
  :host([size="l"]) {
173
- --ddc-icon-size: 20px;
173
+ --ddc-icon-size: 32px;
174
174
  }
175
175
 
176
176
  :host([size="xl"]) {
177
- --ddc-icon-size: 24px;
177
+ --ddc-icon-size: 40px;
178
178
  }
179
179
  `;
180
180
  __decorateClass([
@@ -75,6 +75,14 @@ declare const _default: {
75
75
  "cross": {
76
76
  "class": "i-daikin-close",
77
77
  "color": null
78
+ },
79
+ "notification": {
80
+ "class": "i-daikin-notification",
81
+ "color": null
82
+ },
83
+ "neutral": {
84
+ "class": "i-daikin-neutral",
85
+ "color": null
78
86
  }
79
87
  }
80
88
  }
@@ -1,4 +1,4 @@
1
- const icons = { "logo-positive": { "class": "i-daikin-logo-positive", "color": null }, "logo-negative": { "class": "i-daikin-logo-negative", "color": null }, "alarm": { "class": "i-daikin-alarm", "color": null }, "close": { "class": "i-daikin-close", "color": "#a0a0a0" }, "information": { "class": "i-daikin-information", "color": null }, "error": { "class": "i-daikin-error", "color": null }, "success": { "class": "i-daikin-success", "color": null }, "warning": { "class": "i-daikin-warning", "color": null }, "pagination-chevron-left": { "class": "i-daikin-pagination-chevron-left", "color": "#414141" }, "pagination-chevron-right": { "class": "i-daikin-pagination-chevron-right", "color": "#414141" }, "profile": { "class": "i-daikin-profile", "color": null }, "chevron-up": { "class": "i-daikin-chevron-up", "color": null }, "chevron-down": { "class": "i-daikin-chevron-down", "color": null }, "chevron-left": { "class": "i-daikin-chevron-left", "color": null }, "chevron-right": { "class": "i-daikin-chevron-right", "color": null }, "sort": { "class": "i-daikin-sort", "color": null }, "negative": { "class": "i-daikin-error", "color": null }, "positive": { "class": "i-daikin-success", "color": null }, "cross": { "class": "i-daikin-close", "color": null } };
1
+ const icons = { "logo-positive": { "class": "i-daikin-logo-positive", "color": null }, "logo-negative": { "class": "i-daikin-logo-negative", "color": null }, "alarm": { "class": "i-daikin-alarm", "color": null }, "close": { "class": "i-daikin-close", "color": "#a0a0a0" }, "information": { "class": "i-daikin-information", "color": null }, "error": { "class": "i-daikin-error", "color": null }, "success": { "class": "i-daikin-success", "color": null }, "warning": { "class": "i-daikin-warning", "color": null }, "pagination-chevron-left": { "class": "i-daikin-pagination-chevron-left", "color": "#414141" }, "pagination-chevron-right": { "class": "i-daikin-pagination-chevron-right", "color": "#414141" }, "profile": { "class": "i-daikin-profile", "color": null }, "chevron-up": { "class": "i-daikin-chevron-up", "color": null }, "chevron-down": { "class": "i-daikin-chevron-down", "color": null }, "chevron-left": { "class": "i-daikin-chevron-left", "color": null }, "chevron-right": { "class": "i-daikin-chevron-right", "color": null }, "sort": { "class": "i-daikin-sort", "color": null }, "negative": { "class": "i-daikin-error", "color": null }, "positive": { "class": "i-daikin-success", "color": null }, "cross": { "class": "i-daikin-close", "color": null }, "notification": { "class": "i-daikin-notification", "color": null }, "neutral": { "class": "i-daikin-neutral", "color": null } };
2
2
  const iconsJson = {
3
3
  icons
4
4
  };
@@ -2,7 +2,7 @@ import { DDSFormSubmitElement } from "../../base/index.js";
2
2
  import { ARIARole } from "../../lit-analyzer-types.js";
3
3
  import { MergeVariantProps } from "../../type-utils.js";
4
4
  declare const cvaIconButton: (props?: ({
5
- color?: "default" | "danger" | "neutral" | null | undefined;
5
+ color?: "danger" | "default" | "neutral" | null | undefined;
6
6
  variant?: "fill" | "outline" | "ghost" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
8
  type IconButtonVariantProps = MergeVariantProps<typeof cvaIconButton>;
@@ -1,6 +1,7 @@
1
1
  export * from "./accordion/index.js";
2
2
  export * from "./accordion-item/index.js";
3
3
  export * from "./avatar/index.js";
4
+ export * from "./badge/index.js";
4
5
  export * from "./breadcrumb/index.js";
5
6
  export * from "./breadcrumb-item/index.js";
6
7
  export * from "./button/index.js";
@@ -38,6 +39,7 @@ export * from "./radio/index.js";
38
39
  export * from "./radio-group/index.js";
39
40
  export * from "./select/index.js";
40
41
  export * from "./slider/index.js";
42
+ export * from "./status-message/index.js";
41
43
  export * from "./tab/index.js";
42
44
  export * from "./tab-panels/index.js";
43
45
  export * from "./table/index.js";
@@ -1,6 +1,7 @@
1
1
  import { DaikinAccordion } from "./accordion/daikin-accordion.js";
2
2
  import { DaikinAccordionItem } from "./accordion-item/daikin-accordion-item.js";
3
3
  import { DaikinAvatar } from "./avatar/daikin-avatar.js";
4
+ import { DaikinBadge } from "./badge/daikin-badge.js";
4
5
  import { DaikinBreadcrumb } from "./breadcrumb/daikin-breadcrumb.js";
5
6
  import { DaikinBreadcrumbItem } from "./breadcrumb-item/daikin-breadcrumb-item.js";
6
7
  import { DaikinButton } from "./button/daikin-button.js";
@@ -38,6 +39,7 @@ import { DaikinRadio } from "./radio/daikin-radio.js";
38
39
  import { DaikinRadioGroup } from "./radio-group/daikin-radio-group.js";
39
40
  import { DaikinSelect } from "./select/daikin-select.js";
40
41
  import { DaikinSlider } from "./slider/daikin-slider.js";
42
+ import { DaikinStatusMessage } from "./status-message/daikin-status-message.js";
41
43
  import { DaikinTab } from "./tab/daikin-tab.js";
42
44
  import { DaikinTabPanels } from "./tab-panels/daikin-tab-panels.js";
43
45
  import { DaikinTable } from "./table/daikin-table.js";
@@ -59,6 +61,7 @@ export {
59
61
  DaikinAccordion,
60
62
  DaikinAccordionItem,
61
63
  DaikinAvatar,
64
+ DaikinBadge,
62
65
  DaikinBreadcrumb,
63
66
  DaikinBreadcrumbItem,
64
67
  DaikinButton,
@@ -96,6 +99,7 @@ export {
96
99
  DaikinRadioGroup,
97
100
  DaikinSelect,
98
101
  DaikinSlider,
102
+ DaikinStatusMessage,
99
103
  DaikinTab,
100
104
  DaikinTabPanels,
101
105
  DaikinTable,