@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.
Files changed (244) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/dist/cjs/components/accordion/daikin-accordion.cjs +31 -6
  3. package/dist/cjs/components/accordion/daikin-accordion.d.ts +15 -9
  4. package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +105 -59
  5. package/dist/cjs/components/accordion-item/daikin-accordion-item.d.ts +28 -13
  6. package/dist/cjs/components/breadcrumb/daikin-breadcrumb.cjs +3 -6
  7. package/dist/cjs/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
  8. package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +38 -30
  9. package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
  10. package/dist/cjs/components/button/daikin-button.cjs +89 -128
  11. package/dist/cjs/components/button/daikin-button.d.ts +30 -27
  12. package/dist/cjs/components/checkbox/daikin-checkbox.cjs +99 -119
  13. package/dist/cjs/components/checkbox/daikin-checkbox.d.ts +27 -38
  14. package/dist/cjs/components/icon/daikin-icon.d.ts +4 -0
  15. package/dist/cjs/components/icon/icons.json.cjs +20 -0
  16. package/dist/cjs/components/icon/icons.json.d.ts +20 -0
  17. package/dist/cjs/components/index.cjs +18 -8
  18. package/dist/cjs/components/index.d.ts +4 -2
  19. package/dist/cjs/components/input-group/daikin-input-group.cjs +1 -1
  20. package/dist/cjs/components/input-group/daikin-input-group.d.ts +6 -0
  21. package/dist/cjs/components/list/daikin-list.cjs +24 -0
  22. package/dist/cjs/components/list/daikin-list.d.ts +28 -0
  23. package/dist/cjs/components/list/index.cjs +7 -0
  24. package/dist/cjs/components/list/index.d.ts +1 -0
  25. package/dist/cjs/components/list-item/daikin-list-item.cjs +125 -0
  26. package/dist/cjs/components/list-item/daikin-list-item.d.ts +64 -0
  27. package/dist/cjs/components/list-item/index.cjs +7 -0
  28. package/dist/cjs/components/list-item/index.d.ts +1 -0
  29. package/dist/cjs/components/notification/daikin-notification.cjs +14 -15
  30. package/dist/cjs/components/notification/daikin-notification.d.ts +13 -11
  31. package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +53 -29
  32. package/dist/cjs/components/progress-bar/daikin-progress-bar.d.ts +32 -10
  33. package/dist/cjs/components/radio/daikin-radio.cjs +73 -92
  34. package/dist/cjs/components/radio/daikin-radio.d.ts +23 -39
  35. package/dist/cjs/components/tab/daikin-tab.cjs +41 -46
  36. package/dist/cjs/components/tab/daikin-tab.d.ts +12 -12
  37. package/dist/cjs/components/{panel-switcher/daikin-panel-switcher.cjs → tab-panels/daikin-tab-panels.cjs} +8 -8
  38. package/dist/{cjs-dev/components/panel-switcher/daikin-panel-switcher.d.ts → cjs/components/tab-panels/daikin-tab-panels.d.ts} +17 -11
  39. package/dist/cjs/components/tab-panels/index.cjs +7 -0
  40. package/dist/cjs/components/tab-panels/index.d.ts +1 -0
  41. package/dist/cjs/components/{tab-group/daikin-tab-group.cjs → tabs/daikin-tabs.cjs} +29 -35
  42. package/dist/cjs/components/{tab-group/daikin-tab-group.d.ts → tabs/daikin-tabs.d.ts} +27 -21
  43. package/dist/cjs/components/tabs/index.cjs +7 -0
  44. package/dist/cjs/components/tabs/index.d.ts +1 -0
  45. package/dist/cjs/components/text-input/daikin-text-input.cjs +4 -3
  46. package/dist/cjs/components/text-input/daikin-text-input.d.ts +5 -0
  47. package/dist/cjs/components/textarea/daikin-textarea.cjs +3 -3
  48. package/dist/cjs/components/textarea/daikin-textarea.d.ts +5 -0
  49. package/dist/cjs/components/toggle/daikin-toggle.cjs +44 -68
  50. package/dist/cjs/components/toggle/daikin-toggle.d.ts +15 -26
  51. package/dist/cjs/components/tooltip/daikin-tooltip.d.ts +4 -0
  52. package/dist/cjs/index.cjs +18 -8
  53. package/dist/cjs/tailwind.css.cjs +1 -1
  54. package/dist/cjs-dev/components/accordion/daikin-accordion.cjs +31 -6
  55. package/dist/cjs-dev/components/accordion/daikin-accordion.d.ts +15 -9
  56. package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +105 -59
  57. package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.d.ts +28 -13
  58. package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.cjs +3 -6
  59. package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
  60. package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +38 -30
  61. package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
  62. package/dist/cjs-dev/components/button/daikin-button.cjs +89 -128
  63. package/dist/cjs-dev/components/button/daikin-button.d.ts +30 -27
  64. package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +99 -119
  65. package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.ts +27 -38
  66. package/dist/cjs-dev/components/icon/daikin-icon.d.ts +4 -0
  67. package/dist/cjs-dev/components/icon/icons.json.cjs +20 -0
  68. package/dist/cjs-dev/components/icon/icons.json.d.ts +20 -0
  69. package/dist/cjs-dev/components/index.cjs +18 -8
  70. package/dist/cjs-dev/components/index.d.ts +4 -2
  71. package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +1 -1
  72. package/dist/cjs-dev/components/input-group/daikin-input-group.d.ts +6 -0
  73. package/dist/cjs-dev/components/list/daikin-list.cjs +24 -0
  74. package/dist/cjs-dev/components/list/daikin-list.d.ts +28 -0
  75. package/dist/cjs-dev/components/list/index.cjs +7 -0
  76. package/dist/cjs-dev/components/list/index.d.ts +1 -0
  77. package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +125 -0
  78. package/dist/cjs-dev/components/list-item/daikin-list-item.d.ts +64 -0
  79. package/dist/cjs-dev/components/list-item/index.cjs +7 -0
  80. package/dist/cjs-dev/components/list-item/index.d.ts +1 -0
  81. package/dist/cjs-dev/components/notification/daikin-notification.cjs +14 -15
  82. package/dist/cjs-dev/components/notification/daikin-notification.d.ts +13 -11
  83. package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +53 -29
  84. package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.d.ts +32 -10
  85. package/dist/cjs-dev/components/radio/daikin-radio.cjs +73 -92
  86. package/dist/cjs-dev/components/radio/daikin-radio.d.ts +23 -39
  87. package/dist/cjs-dev/components/tab/daikin-tab.cjs +41 -46
  88. package/dist/cjs-dev/components/tab/daikin-tab.d.ts +12 -12
  89. package/dist/cjs-dev/components/{panel-switcher/daikin-panel-switcher.cjs → tab-panels/daikin-tab-panels.cjs} +9 -9
  90. package/dist/{cjs/components/panel-switcher/daikin-panel-switcher.d.ts → cjs-dev/components/tab-panels/daikin-tab-panels.d.ts} +17 -11
  91. package/dist/cjs-dev/components/tab-panels/index.cjs +7 -0
  92. package/dist/cjs-dev/components/tab-panels/index.d.ts +1 -0
  93. package/dist/cjs-dev/components/{tab-group/daikin-tab-group.cjs → tabs/daikin-tabs.cjs} +31 -37
  94. package/dist/{es-dev/components/tab-group/daikin-tab-group.d.ts → cjs-dev/components/tabs/daikin-tabs.d.ts} +27 -21
  95. package/dist/cjs-dev/components/tabs/index.cjs +7 -0
  96. package/dist/cjs-dev/components/tabs/index.d.ts +1 -0
  97. package/dist/cjs-dev/components/text-input/daikin-text-input.cjs +4 -3
  98. package/dist/cjs-dev/components/text-input/daikin-text-input.d.ts +5 -0
  99. package/dist/cjs-dev/components/textarea/daikin-textarea.cjs +3 -3
  100. package/dist/cjs-dev/components/textarea/daikin-textarea.d.ts +5 -0
  101. package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +44 -68
  102. package/dist/cjs-dev/components/toggle/daikin-toggle.d.ts +15 -26
  103. package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.ts +4 -0
  104. package/dist/cjs-dev/index.cjs +18 -8
  105. package/dist/cjs-dev/tailwind.css.cjs +1 -1
  106. package/dist/es/components/accordion/daikin-accordion.d.ts +15 -9
  107. package/dist/es/components/accordion/daikin-accordion.js +32 -7
  108. package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +28 -13
  109. package/dist/es/components/accordion-item/daikin-accordion-item.js +106 -60
  110. package/dist/es/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
  111. package/dist/es/components/breadcrumb/daikin-breadcrumb.js +3 -6
  112. package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
  113. package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +38 -30
  114. package/dist/es/components/button/daikin-button.d.ts +30 -27
  115. package/dist/es/components/button/daikin-button.js +90 -129
  116. package/dist/es/components/checkbox/daikin-checkbox.d.ts +27 -38
  117. package/dist/es/components/checkbox/daikin-checkbox.js +101 -121
  118. package/dist/es/components/icon/daikin-icon.d.ts +4 -0
  119. package/dist/es/components/icon/icons.json.d.ts +20 -0
  120. package/dist/es/components/icon/icons.json.js +20 -0
  121. package/dist/es/components/index.d.ts +4 -2
  122. package/dist/es/components/index.js +8 -4
  123. package/dist/es/components/input-group/daikin-input-group.d.ts +6 -0
  124. package/dist/es/components/input-group/daikin-input-group.js +1 -1
  125. package/dist/es/components/list/daikin-list.d.ts +28 -0
  126. package/dist/es/components/list/daikin-list.js +25 -0
  127. package/dist/es/components/list/index.d.ts +1 -0
  128. package/dist/es/components/list/index.js +4 -0
  129. package/dist/es/components/list-item/daikin-list-item.d.ts +64 -0
  130. package/dist/es/components/list-item/daikin-list-item.js +126 -0
  131. package/dist/es/components/list-item/index.d.ts +1 -0
  132. package/dist/es/components/list-item/index.js +4 -0
  133. package/dist/es/components/notification/daikin-notification.d.ts +13 -11
  134. package/dist/es/components/notification/daikin-notification.js +15 -16
  135. package/dist/es/components/progress-bar/daikin-progress-bar.d.ts +32 -10
  136. package/dist/es/components/progress-bar/daikin-progress-bar.js +53 -29
  137. package/dist/es/components/radio/daikin-radio.d.ts +23 -39
  138. package/dist/es/components/radio/daikin-radio.js +74 -93
  139. package/dist/es/components/tab/daikin-tab.d.ts +12 -12
  140. package/dist/es/components/tab/daikin-tab.js +42 -47
  141. package/dist/es/components/{panel-switcher/daikin-panel-switcher.d.ts → tab-panels/daikin-tab-panels.d.ts} +17 -11
  142. package/dist/es/components/{panel-switcher/daikin-panel-switcher.js → tab-panels/daikin-tab-panels.js} +9 -9
  143. package/dist/es/components/tab-panels/index.d.ts +1 -0
  144. package/dist/es/components/tab-panels/index.js +4 -0
  145. package/dist/es/components/{tab-group/daikin-tab-group.d.ts → tabs/daikin-tabs.d.ts} +27 -21
  146. package/dist/es/components/{tab-group/daikin-tab-group.js → tabs/daikin-tabs.js} +30 -36
  147. package/dist/es/components/tabs/index.d.ts +1 -0
  148. package/dist/es/components/tabs/index.js +4 -0
  149. package/dist/es/components/text-input/daikin-text-input.d.ts +5 -0
  150. package/dist/es/components/text-input/daikin-text-input.js +4 -3
  151. package/dist/es/components/textarea/daikin-textarea.d.ts +5 -0
  152. package/dist/es/components/textarea/daikin-textarea.js +3 -3
  153. package/dist/es/components/toggle/daikin-toggle.d.ts +15 -26
  154. package/dist/es/components/toggle/daikin-toggle.js +45 -69
  155. package/dist/es/components/tooltip/daikin-tooltip.d.ts +4 -0
  156. package/dist/es/index.js +8 -4
  157. package/dist/es/tailwind.css.js +1 -1
  158. package/dist/es-dev/components/accordion/daikin-accordion.d.ts +15 -9
  159. package/dist/es-dev/components/accordion/daikin-accordion.js +32 -7
  160. package/dist/es-dev/components/accordion-item/daikin-accordion-item.d.ts +28 -13
  161. package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +106 -60
  162. package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
  163. package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +3 -6
  164. package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
  165. package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +38 -30
  166. package/dist/es-dev/components/button/daikin-button.d.ts +30 -27
  167. package/dist/es-dev/components/button/daikin-button.js +90 -129
  168. package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +27 -38
  169. package/dist/es-dev/components/checkbox/daikin-checkbox.js +101 -121
  170. package/dist/es-dev/components/icon/daikin-icon.d.ts +4 -0
  171. package/dist/es-dev/components/icon/icons.json.d.ts +20 -0
  172. package/dist/es-dev/components/icon/icons.json.js +20 -0
  173. package/dist/es-dev/components/index.d.ts +4 -2
  174. package/dist/es-dev/components/index.js +8 -4
  175. package/dist/es-dev/components/input-group/daikin-input-group.d.ts +6 -0
  176. package/dist/es-dev/components/input-group/daikin-input-group.js +1 -1
  177. package/dist/es-dev/components/list/daikin-list.d.ts +28 -0
  178. package/dist/es-dev/components/list/daikin-list.js +25 -0
  179. package/dist/es-dev/components/list/index.d.ts +1 -0
  180. package/dist/es-dev/components/list/index.js +4 -0
  181. package/dist/es-dev/components/list-item/daikin-list-item.d.ts +64 -0
  182. package/dist/es-dev/components/list-item/daikin-list-item.js +126 -0
  183. package/dist/es-dev/components/list-item/index.d.ts +1 -0
  184. package/dist/es-dev/components/list-item/index.js +4 -0
  185. package/dist/es-dev/components/notification/daikin-notification.d.ts +13 -11
  186. package/dist/es-dev/components/notification/daikin-notification.js +15 -16
  187. package/dist/es-dev/components/progress-bar/daikin-progress-bar.d.ts +32 -10
  188. package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +53 -29
  189. package/dist/es-dev/components/radio/daikin-radio.d.ts +23 -39
  190. package/dist/es-dev/components/radio/daikin-radio.js +74 -93
  191. package/dist/es-dev/components/tab/daikin-tab.d.ts +12 -12
  192. package/dist/es-dev/components/tab/daikin-tab.js +42 -47
  193. package/dist/es-dev/components/{panel-switcher/daikin-panel-switcher.d.ts → tab-panels/daikin-tab-panels.d.ts} +17 -11
  194. package/dist/es-dev/components/{panel-switcher/daikin-panel-switcher.js → tab-panels/daikin-tab-panels.js} +10 -10
  195. package/dist/es-dev/components/tab-panels/index.d.ts +1 -0
  196. package/dist/es-dev/components/tab-panels/index.js +4 -0
  197. package/dist/{cjs-dev/components/tab-group/daikin-tab-group.d.ts → es-dev/components/tabs/daikin-tabs.d.ts} +27 -21
  198. package/dist/es-dev/components/{tab-group/daikin-tab-group.js → tabs/daikin-tabs.js} +32 -38
  199. package/dist/es-dev/components/tabs/index.d.ts +1 -0
  200. package/dist/es-dev/components/tabs/index.js +4 -0
  201. package/dist/es-dev/components/text-input/daikin-text-input.d.ts +5 -0
  202. package/dist/es-dev/components/text-input/daikin-text-input.js +4 -3
  203. package/dist/es-dev/components/textarea/daikin-textarea.d.ts +5 -0
  204. package/dist/es-dev/components/textarea/daikin-textarea.js +3 -3
  205. package/dist/es-dev/components/toggle/daikin-toggle.d.ts +15 -26
  206. package/dist/es-dev/components/toggle/daikin-toggle.js +45 -69
  207. package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +4 -0
  208. package/dist/es-dev/index.js +8 -4
  209. package/dist/es-dev/tailwind.css.js +1 -1
  210. package/icons/checkbox-indeterminate.svg +2 -2
  211. package/icons/chevron-down.svg +3 -0
  212. package/icons/chevron-left.svg +3 -0
  213. package/icons/chevron-right.svg +3 -0
  214. package/icons/chevron-up.svg +3 -0
  215. package/icons/status-error.svg +3 -0
  216. package/package.json +2 -1
  217. package/dist/cjs/components/panel-switcher/index.cjs +0 -7
  218. package/dist/cjs/components/panel-switcher/index.d.ts +0 -1
  219. package/dist/cjs/components/tab-group/index.cjs +0 -7
  220. package/dist/cjs/components/tab-group/index.d.ts +0 -1
  221. package/dist/cjs-dev/components/panel-switcher/index.cjs +0 -7
  222. package/dist/cjs-dev/components/panel-switcher/index.d.ts +0 -1
  223. package/dist/cjs-dev/components/tab-group/index.cjs +0 -7
  224. package/dist/cjs-dev/components/tab-group/index.d.ts +0 -1
  225. package/dist/es/components/panel-switcher/index.d.ts +0 -1
  226. package/dist/es/components/panel-switcher/index.js +0 -4
  227. package/dist/es/components/tab-group/index.d.ts +0 -1
  228. package/dist/es/components/tab-group/index.js +0 -4
  229. package/dist/es-dev/components/panel-switcher/index.d.ts +0 -1
  230. package/dist/es-dev/components/panel-switcher/index.js +0 -4
  231. package/dist/es-dev/components/tab-group/index.d.ts +0 -1
  232. package/dist/es-dev/components/tab-group/index.js +0 -4
  233. package/icons/accordion-chevron-up.svg +0 -3
  234. package/icons/radio-checked.svg +0 -4
  235. package/icons/radio-unchecked.svg +0 -4
  236. package/icons/status-negative.svg +0 -11
  237. /package/dist/cjs/components/{tab-group → tabs}/scroller.cjs +0 -0
  238. /package/dist/cjs/components/{tab-group → tabs}/scroller.d.ts +0 -0
  239. /package/dist/cjs-dev/components/{tab-group → tabs}/scroller.cjs +0 -0
  240. /package/dist/cjs-dev/components/{tab-group → tabs}/scroller.d.ts +0 -0
  241. /package/dist/es/components/{tab-group → tabs}/scroller.d.ts +0 -0
  242. /package/dist/es/components/{tab-group → tabs}/scroller.js +0 -0
  243. /package/dist/es-dev/components/{tab-group → tabs}/scroller.d.ts +0 -0
  244. /package/dist/es-dev/components/{tab-group → tabs}/scroller.js +0 -0
@@ -1,5 +1,5 @@
1
1
  import { cva } from "class-variance-authority";
2
- import { css, unsafeCSS, LitElement, html } from "lit";
2
+ import { css, unsafeCSS, LitElement, html, nothing } from "lit";
3
3
  import { property, customElement } from "lit/decorators.js";
4
4
  import tailwindStyles from "../../tailwind.css.js";
5
5
  var __defProp = Object.defineProperty;
@@ -12,100 +12,90 @@ var __decorateClass = (decorators, target, key, kind) => {
12
12
  if (kind && result) __defProp(target, key, result);
13
13
  return result;
14
14
  };
15
- const cvaRadio = cva(
16
- [
17
- "appearance-none",
18
- "relative",
19
- "after:absolute",
20
- "after:i-daikin-radio-unchecked",
21
- "checked:after:i-daikin-radio-checked",
22
- "enabled:after:text-[#8C8C8C]",
23
- "enabled:checked:after:text-daikinBlue-500",
24
- "aria-controllable:hover:after:i-daikin-radio-checked",
25
- "aria-controllable:hover:after:text-daikinBlue-300",
26
- "aria-controllable:active:after:i-daikin-radio-checked",
27
- "aria-controllable:active:after:text-daikinBlue-500",
28
- "focus-visible:outline-none",
29
- "aria-controllable:focus-visible:after:i-daikin-radio-unchecked",
30
- "aria-controllable:focus-visible:checked:after:i-daikin-radio-checked",
31
- "aria-controllable:focus-visible:after:text-daikinBlue-700",
32
- "disabled:after:text-daikinNeutral-200"
33
- ],
34
- {
35
- variants: {
36
- size: {
37
- small: ["w-[14px]", "h-[14px]"],
38
- large: ["w-4", "h-4"]
39
- }
15
+ const RADIO_CLASS_NAME = cva([
16
+ "flex",
17
+ "justify-center",
18
+ "items-center",
19
+ "size-4",
20
+ "bg-white",
21
+ "rounded-full",
22
+ "relative",
23
+ "appearance-none",
24
+ "focus-visible:outline",
25
+ "focus-visible:outline-1",
26
+ "focus-visible:outline-offset-1",
27
+ "focus-visible:outline-daikinBlue-700",
28
+ "unchecked:border-2",
29
+ "enabled:unchecked:border-daikinNeutral-600",
30
+ "enabled:unchecked:hover:border-daikinNeutral-400",
31
+ "enabled:unchecked:active:border-daikinNeutral-700",
32
+ "checked:border-[5px]",
33
+ "enabled:checked:border-daikinBlue-500",
34
+ "enabled:checked:group-hover:border-daikinBlue-300",
35
+ "enabled:checked:group-active:border-daikinBlue-600",
36
+ "disabled:border-daikinNeutral-200"
37
+ ])();
38
+ const cvaLabel = cva([], {
39
+ variants: {
40
+ disabled: {
41
+ false: [],
42
+ true: ["text-daikinNeutral-200"]
40
43
  }
41
44
  }
42
- );
43
- const cvaLabel = cva(
44
- ["leading-8", "not-italic", "font-normal", "align-middle"],
45
- {
46
- variants: {
47
- size: {
48
- small: ["text-sm"],
49
- large: ["text-base"]
50
- }
51
- }
52
- }
53
- );
45
+ });
54
46
  let DaikinRadio = class extends LitElement {
55
47
  constructor() {
56
48
  super(...arguments);
57
- this._internals = this.attachInternals();
49
+ this.name = "";
50
+ this.value = "";
58
51
  this.label = "";
59
- this.size = "small";
60
52
  this.labelPosition = "right";
61
- this.disabled = false;
62
- this.readonly = false;
63
53
  this.checked = false;
64
- this.name = "";
65
- this.value = "";
66
- this.error = false;
67
- }
68
- _handleClick(event) {
69
- if (this.readonly || this.disabled) {
70
- event.preventDefault();
71
- }
54
+ this.disabled = false;
55
+ this._internals = this.attachInternals();
72
56
  }
73
57
  _updateFormValue() {
74
58
  this._internals.setFormValue(this.checked ? this.value : null);
75
59
  }
76
- updated(changedProperties) {
77
- if (changedProperties.has("checked")) {
78
- this._updateFormValue();
60
+ _handleClick(event) {
61
+ if (this.disabled) {
62
+ event.preventDefault();
79
63
  }
80
64
  }
81
65
  _handleChange(event) {
82
- var _a;
83
- const input = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("input");
84
- this.checked = input.checked;
66
+ this.checked = event.target.checked;
85
67
  this._updateFormValue();
86
- const newEvent = new Event("change", event);
87
- this.dispatchEvent(newEvent);
68
+ this.dispatchEvent(new Event("change", event));
88
69
  }
89
70
  render() {
90
- const labelClassName = cvaLabel({ size: this.size });
91
- const radioClassName = cvaRadio({ size: this.size });
92
- const labelText = this.label ? html`<span class="${labelClassName}">${this.label}</span>` : html``;
93
- const inputTag = html`<input
94
- class=${radioClassName}
95
- type="radio"
96
- name=${this.name}
97
- value=${this.value}
98
- aria-readonly=${this.readonly}
99
- ?disabled=${this.disabled}
100
- .checked=${this.checked}
101
- @click=${this._handleClick}
102
- @change=${this._handleChange}
103
- />`;
104
- const inputArea = this.labelPosition === "left" ? html`${labelText}${inputTag}` : html`${inputTag}${labelText}`;
105
- return html`<label
106
- class="inline-flex w-full h-full gap-[8px] items-center font-daikinSerif"
107
- >${inputArea}</label
108
- >`;
71
+ return html`<label class="group flex gap-2 items-center font-daikinSerif">
72
+ <div class="p-2">
73
+ <input
74
+ class=${RADIO_CLASS_NAME}
75
+ type="radio"
76
+ name=${this.name}
77
+ value=${this.value}
78
+ aria-label=${this.labelPosition === "hidden" ? this.label : nothing}
79
+ ?disabled=${this.disabled}
80
+ .checked=${this.checked}
81
+ @click=${this._handleClick}
82
+ @change=${this._handleChange}
83
+ />
84
+ </div>
85
+ <span
86
+ class=${cvaLabel({
87
+ disabled: this.disabled
88
+ })}
89
+ ?hidden=${this.labelPosition === "hidden"}
90
+ >
91
+ ${this.label}
92
+ </span>
93
+ </label>`;
94
+ }
95
+ updated(changedProperties) {
96
+ if (changedProperties.has("checked")) {
97
+ this._updateFormValue();
98
+ }
109
99
  }
110
100
  };
111
101
  DaikinRadio.styles = css`
@@ -117,32 +107,23 @@ DaikinRadio.styles = css`
117
107
  `;
118
108
  DaikinRadio.formAssociated = true;
119
109
  __decorateClass([
120
- property({ type: String })
121
- ], DaikinRadio.prototype, "label", 2);
110
+ property({ type: String, reflect: true })
111
+ ], DaikinRadio.prototype, "name", 2);
112
+ __decorateClass([
113
+ property({ type: String, reflect: true })
114
+ ], DaikinRadio.prototype, "value", 2);
122
115
  __decorateClass([
123
116
  property({ type: String })
124
- ], DaikinRadio.prototype, "size", 2);
117
+ ], DaikinRadio.prototype, "label", 2);
125
118
  __decorateClass([
126
119
  property({ type: String, attribute: "label-position" })
127
120
  ], DaikinRadio.prototype, "labelPosition", 2);
128
- __decorateClass([
129
- property({ type: Boolean, reflect: true })
130
- ], DaikinRadio.prototype, "disabled", 2);
131
- __decorateClass([
132
- property({ type: Boolean, reflect: true })
133
- ], DaikinRadio.prototype, "readonly", 2);
134
121
  __decorateClass([
135
122
  property({ type: Boolean, reflect: true })
136
123
  ], DaikinRadio.prototype, "checked", 2);
137
- __decorateClass([
138
- property({ type: String, reflect: true })
139
- ], DaikinRadio.prototype, "name", 2);
140
- __decorateClass([
141
- property({ type: String, reflect: true })
142
- ], DaikinRadio.prototype, "value", 2);
143
124
  __decorateClass([
144
125
  property({ type: Boolean, reflect: true })
145
- ], DaikinRadio.prototype, "error", 2);
126
+ ], DaikinRadio.prototype, "disabled", 2);
146
127
  DaikinRadio = __decorateClass([
147
128
  customElement("daikin-radio")
148
129
  ], DaikinRadio);
@@ -1,10 +1,10 @@
1
1
  import { LitElement } from 'lit';
2
2
  /**
3
- * The tab component is a child element within the `daikin-tab-group` component, representing a clickable button or label that users interact with to switch between different panels of content.
3
+ * The tab component is a child element within the `daikin-tabs` component, representing a clickable button or label that users interact with to switch between different panels of content.
4
4
  * Each tab corresponds to a specific panel and is typically labeled to indicate the content it reveals.
5
5
  *
6
6
  * Hierarchy:
7
- * - `daikin-tab-group` > `daikin-tab`
7
+ * - `daikin-tabs` > `daikin-tab`
8
8
  *
9
9
  * @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,
10
10
  *
@@ -12,8 +12,12 @@ import { LitElement } from 'lit';
12
12
  *
13
13
  * @example
14
14
  *
15
+ * ```js
16
+ * import "@daikin-oss/design-system-web-components/components/tab/index.js";
17
+ * ```
18
+ *
15
19
  * ```html
16
- * <!-- See `daikin-tab-group` component for complete example. -->
20
+ * <!-- See `daikin-tabs` component for complete example. -->
17
21
  * <daikin-tab value="foo">Foo tab</daikin-tab>
18
22
  * ```
19
23
  */
@@ -21,30 +25,26 @@ export declare class DaikinTab extends LitElement {
21
25
  static readonly styles: import('lit').CSSResult;
22
26
  /**
23
27
  * A unique string that identifies a tab.
24
- * Must be unique within the `daikin-tab-group` component.
28
+ * Must be unique within the `daikin-tabs` component.
25
29
  */
26
30
  value: string;
27
31
  /**
28
- * Size of tab
29
- */
30
- size: "default" | "condensed";
31
- /**
32
- * Whether to show the disabled state.
32
+ * Whether the tab is disabled.
33
33
  */
34
34
  disabled: boolean;
35
35
  /**
36
36
  * Whether to show the active (selected) state.
37
37
  * Ignored if `disabled` is `true`.
38
- * Set automatically by `daikin-tab-group` component.
38
+ * Set automatically by `daikin-tabs` component.
39
39
  */
40
40
  active: boolean;
41
- private _handleClick;
41
+ private _button;
42
42
  constructor();
43
43
  /**
44
44
  * Focuses on the inner button.
45
45
  * @param options focus options
46
46
  */
47
- focus(options?: FocusOptions | undefined): void;
47
+ focus(options?: FocusOptions): void;
48
48
  render(): import('lit-html').TemplateResult<1>;
49
49
  }
50
50
  declare global {
@@ -1,6 +1,6 @@
1
1
  import { cva } from "class-variance-authority";
2
2
  import { css, unsafeCSS, LitElement, html } from "lit";
3
- import { property, customElement } from "lit/decorators.js";
3
+ import { property, query, customElement } from "lit/decorators.js";
4
4
  import tailwindStyles from "../../tailwind.css.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -19,38 +19,44 @@ const cvaTab = cva(
19
19
  "h-full",
20
20
  "items-center",
21
21
  "justify-center",
22
+ "px-4",
23
+ "pt-2",
24
+ "pb-3",
25
+ "text-base",
26
+ "font-bold",
22
27
  "text-center",
23
- "relative",
24
28
  "font-daikinSerif",
25
- "text-base",
29
+ "relative",
26
30
  "tracking-wide",
27
31
  "whitespace-nowrap",
28
32
  "contain-paint",
29
- "disabled:cursor-default",
30
- "after:content-['']",
31
- "after:z-1",
32
- "after:absolute",
33
- "after:bottom-0",
34
- "after:left-0",
35
- "after:right-0",
36
- "after:w-full",
37
- "text-daikinBlue-500",
38
- "hover:text-daikinBlue-400",
39
- "active:text-daikinBlue-600",
40
- "focus-visible:text-daikinBlue-700",
41
- "disabled:text-daikinNeutral-300",
42
- "aria-selected:after:h-1",
43
- "aria-selected:after:bg-daikinBlue-500",
44
- "hover:aria-selected:after:bg-daikinBlue-400",
45
- "active:aria-selected:after:bg-daikinBlue-600",
46
- "focus-visible:aria-selected:after:bg-daikinBlue-700",
47
- "disabled:after:bg-daikinNeutral-300"
33
+ "focus-visible:outline-none",
34
+ "focus-visible:before:w-full",
35
+ "focus-visible:before:h-[calc(100%_-_4px)]",
36
+ "focus-visible:before:border",
37
+ "focus-visible:before:border-daikinBlue-700",
38
+ "focus-visible:before:absolute",
39
+ "focus-visible:before:top-0",
40
+ "disabled:text-daikinNeutral-200"
48
41
  ],
49
42
  {
50
43
  variants: {
51
- size: {
52
- default: ["px-4"],
53
- condensed: ["px-[10px]"]
44
+ active: {
45
+ false: [
46
+ "hover:text-daikinNeutral-500",
47
+ "active:text-daikinNeutral-700"
48
+ ],
49
+ true: [
50
+ "text-daikinBlue-500",
51
+ "hover:text-daikinBlue-300",
52
+ "active:text-daikinBlue-600",
53
+ "after:w-full",
54
+ "after:h-1",
55
+ "after:absolute",
56
+ "after:bottom-0",
57
+ "enabled:after:bg-daikinBlue-500",
58
+ "disabled:after:bg-daikinNeutral-200"
59
+ ]
54
60
  }
55
61
  }
56
62
  }
@@ -59,31 +65,26 @@ let DaikinTab = class extends LitElement {
59
65
  constructor() {
60
66
  super();
61
67
  this.value = "";
62
- this.size = "default";
63
68
  this.disabled = false;
64
69
  this.active = false;
65
- this.addEventListener("click", this._handleClick);
66
- }
67
- _handleClick(event) {
68
- if (this.disabled) {
69
- event.stopImmediatePropagation();
70
- }
70
+ this.addEventListener("click", (event) => {
71
+ if (this.disabled) {
72
+ event.stopImmediatePropagation();
73
+ }
74
+ });
71
75
  }
72
76
  /**
73
77
  * Focuses on the inner button.
74
78
  * @param options focus options
75
79
  */
76
80
  focus(options) {
77
- var _a, _b;
78
- (_b = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("button")) == null ? void 0 : _b.focus(options);
81
+ var _a;
82
+ (_a = this._button) == null ? void 0 : _a.focus(options);
79
83
  }
80
84
  render() {
81
- const cn = cvaTab({
82
- size: this.size
83
- });
84
85
  return html`
85
86
  <button
86
- class=${cn}
87
+ class=${cvaTab({ active: this.active })}
87
88
  ?disabled=${this.disabled}
88
89
  role="tab"
89
90
  aria-selected=${!this.disabled && this.active}
@@ -99,26 +100,20 @@ DaikinTab.styles = css`
99
100
 
100
101
  :host {
101
102
  display: inline-block;
102
- width: fit-content;
103
- height: 48px;
104
- }
105
-
106
- :host([size="condensed"]) {
107
- height: 40px;
108
103
  }
109
104
  `;
110
105
  __decorateClass([
111
106
  property({ type: String, reflect: true })
112
107
  ], DaikinTab.prototype, "value", 2);
113
- __decorateClass([
114
- property({ type: String, reflect: true })
115
- ], DaikinTab.prototype, "size", 2);
116
108
  __decorateClass([
117
109
  property({ type: Boolean, reflect: true })
118
110
  ], DaikinTab.prototype, "disabled", 2);
119
111
  __decorateClass([
120
112
  property({ type: Boolean, reflect: true })
121
113
  ], DaikinTab.prototype, "active", 2);
114
+ __decorateClass([
115
+ query("button")
116
+ ], DaikinTab.prototype, "_button", 2);
122
117
  DaikinTab = __decorateClass([
123
118
  customElement("daikin-tab")
124
119
  ], DaikinTab);
@@ -1,50 +1,56 @@
1
1
  import { LitElement } from 'lit';
2
2
  import { ARIARole } from '../../lit-analyzer-types';
3
3
  /**
4
- * The panel switcher component is a child element within the `daikin-tab-group` that controls the display of the content panels associated with each tab.
4
+ * The panel switcher component is a child element within the `daikin-tabs` that controls the display of the content panels associated with each tab.
5
5
  * When a user selects a tab, the panel switcher component ensures the corresponding content panel is shown while hiding the others.
6
6
  *
7
7
  * Hierarchy:
8
- * - `daikin-tab-group` > `daikin-panel-switcher` ("panels" slot)
8
+ * - `daikin-tabs` > `daikin-tab-panels` ("panels" slot)
9
9
  *
10
10
  * @slot panel:\<name\> - A slot for each panel content.
11
11
  *
12
12
  * @example
13
13
  *
14
+ * ```js
15
+ * import "@daikin-oss/design-system-web-components/components/panel-switcher/index.js";
16
+ * ```
17
+ *
14
18
  * ```html
15
19
  * <!-- Note that `panels` must be set via property. -->
16
- * <daikin-panel-switcher
20
+ * <daikin-tab-panels
17
21
  * class="block w-full h-full"
18
- * .panels="${['foo', 'bar', 'baz']}"
22
+ * panel-role="tabpanel"
19
23
  * value="foo"
20
- * panelRole="tabpanel"
24
+ * .panels="${['foo', 'bar', 'baz']}"
21
25
  * >
22
26
  * <div slot="panel:foo">Foo Panel (visible)</div>
23
27
  * <div slot="panel:bar">Bar Panel (hidden)</div>
24
28
  * <div slot="panel:baz">Baz Panel (hidden)</div>
25
- * </daikin-panel-switcher>
29
+ * </daikin-tab-panels>
26
30
  * ```
27
31
  */
28
- export declare class DaikinPanelSwitcher extends LitElement {
32
+ export declare class DaikinTabPanels extends LitElement {
29
33
  static readonly styles: import('lit').CSSResult;
30
34
  /**
31
35
  * The panel to be displayed.
32
- * Set automatically by `daikin-tab-group` if used within it.
36
+ * Set automatically by `daikin-tabs` if used within it.
33
37
  */
34
38
  value: string;
35
39
  /**
36
- * Set automatically by `daikin-tab-group` if used within it.
40
+ * A list of panel names.
41
+ * This is used as the slot name for panels (`panel:<name>`).
42
+ * Set automatically by `daikin-tabs` if used within it.
37
43
  */
38
44
  panels: string[];
39
45
  /**
40
46
  * `role` attribute of the container.
41
- * Set to "tablist" automatically by `daikin-tab-group` if used within it.
47
+ * Set to "tablist" automatically by `daikin-tabs` if used within it.
42
48
  */
43
49
  panelRole: ARIARole | null;
44
50
  render(): unknown;
45
51
  }
46
52
  declare global {
47
53
  interface HTMLElementTagNameMap {
48
- "daikin-panel-switcher": DaikinPanelSwitcher;
54
+ "daikin-tab-panels": DaikinTabPanels;
49
55
  }
50
56
  }
@@ -12,7 +12,7 @@ var __decorateClass = (decorators, target, key, kind) => {
12
12
  if (kind && result) __defProp(target, key, result);
13
13
  return result;
14
14
  };
15
- let DaikinPanelSwitcher = class extends LitElement {
15
+ let DaikinTabPanels = class extends LitElement {
16
16
  constructor() {
17
17
  super(...arguments);
18
18
  this.value = "";
@@ -33,24 +33,24 @@ let DaikinPanelSwitcher = class extends LitElement {
33
33
  );
34
34
  }
35
35
  };
36
- DaikinPanelSwitcher.styles = css`
36
+ DaikinTabPanels.styles = css`
37
37
  ${unsafeCSS(tailwindStyles)}
38
38
  `;
39
39
  __decorateClass([
40
40
  property({ type: String, reflect: true })
41
- ], DaikinPanelSwitcher.prototype, "value", 2);
41
+ ], DaikinTabPanels.prototype, "value", 2);
42
42
  __decorateClass([
43
43
  property({
44
44
  type: Array,
45
45
  hasChanged: (newValue, oldValue) => JSON.stringify(newValue) !== JSON.stringify(oldValue)
46
46
  })
47
- ], DaikinPanelSwitcher.prototype, "panels", 2);
47
+ ], DaikinTabPanels.prototype, "panels", 2);
48
48
  __decorateClass([
49
49
  property({ type: String, reflect: true, attribute: "panel-role" })
50
- ], DaikinPanelSwitcher.prototype, "panelRole", 2);
51
- DaikinPanelSwitcher = __decorateClass([
52
- customElement("daikin-panel-switcher")
53
- ], DaikinPanelSwitcher);
50
+ ], DaikinTabPanels.prototype, "panelRole", 2);
51
+ DaikinTabPanels = __decorateClass([
52
+ customElement("daikin-tab-panels")
53
+ ], DaikinTabPanels);
54
54
  export {
55
- DaikinPanelSwitcher
55
+ DaikinTabPanels
56
56
  };
@@ -0,0 +1 @@
1
+ export * from './daikin-tab-panels';
@@ -0,0 +1,4 @@
1
+ import { DaikinTabPanels } from "./daikin-tab-panels.js";
2
+ export {
3
+ DaikinTabPanels
4
+ };
@@ -9,34 +9,40 @@ import { LitElement, PropertyValues } from 'lit';
9
9
  * > Otherwise, unexpected behavior may be encountered.
10
10
  *
11
11
  * Hierarchies:
12
- * - `daikin-tab-group` > `daikin-tab`
13
- * - `daikin-tab-group` > `daikin-panel-switcher` ("panels" slot)
12
+ * - `daikin-tabs` > `daikin-tab`
13
+ * - `daikin-tabs` > `daikin-tab-panels` ("panels" slot)
14
14
  *
15
- * @fires beforechange - _Cancellable._ A custom event emitted when the current tab is about to be changed by user interaction.
16
- * @fires change - A custom event emitted when the current tab is changed.
15
+ * @fires beforechange - _Cancellable._ A custom event emitted when the current tab is about to be changed by user interaction. The current value can be obtained with `event.target.value` and the new value with `event.detail.newTab.value`.
16
+ * @fires change - A custom event emitted when the current tab is changed. The new value can be obtained with `event.target.value`.
17
17
  *
18
18
  * @slot - A slot for tab buttons. Place `daikin-tab` elements here.
19
- * @slot panels - A slot for a panel switcher component. Place `daikin-panel-switcher` element(s) here.
19
+ * @slot panels - A slot for tab panels component. Place a `daikin-tab-panels` element here.
20
20
  *
21
21
  * @csspart tablist - The container element for the default (tab list) slot. Has "tablist" role.
22
22
  *
23
23
  * @example
24
24
  *
25
+ * ```js
26
+ * import "@daikin-oss/design-system-web-components/components/tab/index.js";
27
+ * import "@daikin-oss/design-system-web-components/components/tab-group/index.js";
28
+ * import "@daikin-oss/design-system-web-components/components/panel-switcher/index.js";
29
+ * ```
30
+ *
25
31
  * ```html
26
32
  * <!-- See storybook for styling tab group. You'll need `::part(tablist)` to style the tab container. -->
27
- * <daikin-tab-group value="foo">
33
+ * <daikin-tabs value="foo">
28
34
  * <daikin-tab value="foo">Foo tab</daikin-tab>
29
35
  * <daikin-tab value="bar">Bar tab</daikin-tab>
30
- * <!-- At least one "daikin-panel-switcher" is needed to switch the content. -->
31
- * <daikin-panel-switcher slot="panels">
36
+ * <!-- At least one "daikin-tab-panels" is needed to switch the content. -->
37
+ * <daikin-tab-panels slot="panels">
32
38
  * <!-- Mind the "panel:" prefix. -->
33
39
  * <p slot="panel:foo">Foo tab content.</p>
34
40
  * <p slot="panel:bar">Bar tab content.</p>
35
- * </daikin-panel-switcher>
36
- * </daikin-tab-group>
41
+ * </daikin-tab-panels>
42
+ * </daikin-tabs>
37
43
  * ```
38
44
  */
39
- export declare class DaikinTabGroup extends LitElement {
45
+ export declare class DaikinTabs extends LitElement {
40
46
  static readonly styles: import('lit').CSSResult;
41
47
  /**
42
48
  * `value` of the currently selected tab (`daikin-tab`).
@@ -45,26 +51,26 @@ export declare class DaikinTabGroup extends LitElement {
45
51
  /**
46
52
  * Tab(s) in the default slot.
47
53
  */
48
- private _tabs;
54
+ private readonly _tabs;
49
55
  /**
50
56
  * Panel switcher(s) in the `panels` slot.
51
57
  */
52
- private _panelSwitchers;
58
+ private readonly _panelSwitchers;
53
59
  /**
54
60
  * Emits `beforechange` event if necessary and returns whether we should proceed.
55
61
  *
56
- * 1. Check if `newValue` is different from `value`.
62
+ * 1. Check if `newTab.value` is different from `value`.
57
63
  * 2. Emit "beforechange" event.
58
- * 3. Check if the event is canceled.
64
+ * 3. Check and return whether the event is canceled.
59
65
  *
60
- * @param newValue The `value` of the newly active tab.
66
+ * @param newTab The newly active tab element.
61
67
  * @returns `true` if we should proceed (event is emitted and not canceled). `false` otherwise.
62
68
  */
63
69
  private _emitBeforeChange;
64
70
  /**
65
71
  * Updates `this.value` and emit "change" event.
66
72
  *
67
- * @param newValue The `value` of the newly active tab.
73
+ * @param newTab The newly active tab element.
68
74
  */
69
75
  private _updateValue;
70
76
  /**
@@ -76,14 +82,14 @@ export declare class DaikinTabGroup extends LitElement {
76
82
  */
77
83
  private _updateTabs;
78
84
  /**
79
- * Updates `daikin-panel-switcher` component(s)' properties in the slot.
85
+ * Updates `daikin-tab-panels` component(s)' properties in the slot.
80
86
  *
81
87
  * Invoke when:
82
88
  * - `this.value` is changed.
83
89
  * - the default slot's content is changed.
84
90
  * - the panel slot's content is changed.
85
91
  */
86
- private _updatePanelSwitcher;
92
+ private _updateTabPanels;
87
93
  /**
88
94
  * Handles "click" event emitted by `daikin-tab` component.
89
95
  */
@@ -93,12 +99,12 @@ export declare class DaikinTabGroup extends LitElement {
93
99
  */
94
100
  private _handleKeyDown;
95
101
  private _handleSlotChange;
96
- private _handlePanelSwitcherSlotChange;
102
+ private _handleTabPanelsSlotChange;
97
103
  render(): import('lit-html').TemplateResult<1>;
98
104
  updated(changedProperties: PropertyValues<this>): void;
99
105
  }
100
106
  declare global {
101
107
  interface HTMLElementTagNameMap {
102
- "daikin-tab-group": DaikinTabGroup;
108
+ "daikin-tabs": DaikinTabs;
103
109
  }
104
110
  }