@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
@@ -14,100 +14,90 @@ var __decorateClass = (decorators, target, key, kind) => {
14
14
  if (kind && result) __defProp(target, key, result);
15
15
  return result;
16
16
  };
17
- const cvaRadio = classVarianceAuthority.cva(
18
- [
19
- "appearance-none",
20
- "relative",
21
- "after:absolute",
22
- "after:i-daikin-radio-unchecked",
23
- "checked:after:i-daikin-radio-checked",
24
- "enabled:after:text-[#8C8C8C]",
25
- "enabled:checked:after:text-daikinBlue-500",
26
- "aria-controllable:hover:after:i-daikin-radio-checked",
27
- "aria-controllable:hover:after:text-daikinBlue-300",
28
- "aria-controllable:active:after:i-daikin-radio-checked",
29
- "aria-controllable:active:after:text-daikinBlue-500",
30
- "focus-visible:outline-none",
31
- "aria-controllable:focus-visible:after:i-daikin-radio-unchecked",
32
- "aria-controllable:focus-visible:checked:after:i-daikin-radio-checked",
33
- "aria-controllable:focus-visible:after:text-daikinBlue-700",
34
- "disabled:after:text-daikinNeutral-200"
35
- ],
36
- {
37
- variants: {
38
- size: {
39
- small: ["w-[14px]", "h-[14px]"],
40
- large: ["w-4", "h-4"]
41
- }
17
+ const RADIO_CLASS_NAME = classVarianceAuthority.cva([
18
+ "flex",
19
+ "justify-center",
20
+ "items-center",
21
+ "size-4",
22
+ "bg-white",
23
+ "rounded-full",
24
+ "relative",
25
+ "appearance-none",
26
+ "focus-visible:outline",
27
+ "focus-visible:outline-1",
28
+ "focus-visible:outline-offset-1",
29
+ "focus-visible:outline-daikinBlue-700",
30
+ "unchecked:border-2",
31
+ "enabled:unchecked:border-daikinNeutral-600",
32
+ "enabled:unchecked:hover:border-daikinNeutral-400",
33
+ "enabled:unchecked:active:border-daikinNeutral-700",
34
+ "checked:border-[5px]",
35
+ "enabled:checked:border-daikinBlue-500",
36
+ "enabled:checked:group-hover:border-daikinBlue-300",
37
+ "enabled:checked:group-active:border-daikinBlue-600",
38
+ "disabled:border-daikinNeutral-200"
39
+ ])();
40
+ const cvaLabel = classVarianceAuthority.cva([], {
41
+ variants: {
42
+ disabled: {
43
+ false: [],
44
+ true: ["text-daikinNeutral-200"]
42
45
  }
43
46
  }
44
- );
45
- const cvaLabel = classVarianceAuthority.cva(
46
- ["leading-8", "not-italic", "font-normal", "align-middle"],
47
- {
48
- variants: {
49
- size: {
50
- small: ["text-sm"],
51
- large: ["text-base"]
52
- }
53
- }
54
- }
55
- );
47
+ });
56
48
  exports.DaikinRadio = class DaikinRadio extends lit.LitElement {
57
49
  constructor() {
58
50
  super(...arguments);
59
- this._internals = this.attachInternals();
51
+ this.name = "";
52
+ this.value = "";
60
53
  this.label = "";
61
- this.size = "small";
62
54
  this.labelPosition = "right";
63
- this.disabled = false;
64
- this.readonly = false;
65
55
  this.checked = false;
66
- this.name = "";
67
- this.value = "";
68
- this.error = false;
69
- }
70
- _handleClick(event) {
71
- if (this.readonly || this.disabled) {
72
- event.preventDefault();
73
- }
56
+ this.disabled = false;
57
+ this._internals = this.attachInternals();
74
58
  }
75
59
  _updateFormValue() {
76
60
  this._internals.setFormValue(this.checked ? this.value : null);
77
61
  }
78
- updated(changedProperties) {
79
- if (changedProperties.has("checked")) {
80
- this._updateFormValue();
62
+ _handleClick(event) {
63
+ if (this.disabled) {
64
+ event.preventDefault();
81
65
  }
82
66
  }
83
67
  _handleChange(event) {
84
- var _a;
85
- const input = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("input");
86
- this.checked = input.checked;
68
+ this.checked = event.target.checked;
87
69
  this._updateFormValue();
88
- const newEvent = new Event("change", event);
89
- this.dispatchEvent(newEvent);
70
+ this.dispatchEvent(new Event("change", event));
90
71
  }
91
72
  render() {
92
- const labelClassName = cvaLabel({ size: this.size });
93
- const radioClassName = cvaRadio({ size: this.size });
94
- const labelText = this.label ? lit.html`<span class="${labelClassName}">${this.label}</span>` : lit.html``;
95
- const inputTag = lit.html`<input
96
- class=${radioClassName}
97
- type="radio"
98
- name=${this.name}
99
- value=${this.value}
100
- aria-readonly=${this.readonly}
101
- ?disabled=${this.disabled}
102
- .checked=${this.checked}
103
- @click=${this._handleClick}
104
- @change=${this._handleChange}
105
- />`;
106
- const inputArea = this.labelPosition === "left" ? lit.html`${labelText}${inputTag}` : lit.html`${inputTag}${labelText}`;
107
- return lit.html`<label
108
- class="inline-flex w-full h-full gap-[8px] items-center font-daikinSerif"
109
- >${inputArea}</label
110
- >`;
73
+ return lit.html`<label class="group flex gap-2 items-center font-daikinSerif">
74
+ <div class="p-2">
75
+ <input
76
+ class=${RADIO_CLASS_NAME}
77
+ type="radio"
78
+ name=${this.name}
79
+ value=${this.value}
80
+ aria-label=${this.labelPosition === "hidden" ? this.label : lit.nothing}
81
+ ?disabled=${this.disabled}
82
+ .checked=${this.checked}
83
+ @click=${this._handleClick}
84
+ @change=${this._handleChange}
85
+ />
86
+ </div>
87
+ <span
88
+ class=${cvaLabel({
89
+ disabled: this.disabled
90
+ })}
91
+ ?hidden=${this.labelPosition === "hidden"}
92
+ >
93
+ ${this.label}
94
+ </span>
95
+ </label>`;
96
+ }
97
+ updated(changedProperties) {
98
+ if (changedProperties.has("checked")) {
99
+ this._updateFormValue();
100
+ }
111
101
  }
112
102
  };
113
103
  exports.DaikinRadio.styles = lit.css`
@@ -119,32 +109,23 @@ exports.DaikinRadio.styles = lit.css`
119
109
  `;
120
110
  exports.DaikinRadio.formAssociated = true;
121
111
  __decorateClass([
122
- decorators_js.property({ type: String })
123
- ], exports.DaikinRadio.prototype, "label", 2);
112
+ decorators_js.property({ type: String, reflect: true })
113
+ ], exports.DaikinRadio.prototype, "name", 2);
114
+ __decorateClass([
115
+ decorators_js.property({ type: String, reflect: true })
116
+ ], exports.DaikinRadio.prototype, "value", 2);
124
117
  __decorateClass([
125
118
  decorators_js.property({ type: String })
126
- ], exports.DaikinRadio.prototype, "size", 2);
119
+ ], exports.DaikinRadio.prototype, "label", 2);
127
120
  __decorateClass([
128
121
  decorators_js.property({ type: String, attribute: "label-position" })
129
122
  ], exports.DaikinRadio.prototype, "labelPosition", 2);
130
- __decorateClass([
131
- decorators_js.property({ type: Boolean, reflect: true })
132
- ], exports.DaikinRadio.prototype, "disabled", 2);
133
- __decorateClass([
134
- decorators_js.property({ type: Boolean, reflect: true })
135
- ], exports.DaikinRadio.prototype, "readonly", 2);
136
123
  __decorateClass([
137
124
  decorators_js.property({ type: Boolean, reflect: true })
138
125
  ], exports.DaikinRadio.prototype, "checked", 2);
139
- __decorateClass([
140
- decorators_js.property({ type: String, reflect: true })
141
- ], exports.DaikinRadio.prototype, "name", 2);
142
- __decorateClass([
143
- decorators_js.property({ type: String, reflect: true })
144
- ], exports.DaikinRadio.prototype, "value", 2);
145
126
  __decorateClass([
146
127
  decorators_js.property({ type: Boolean, reflect: true })
147
- ], exports.DaikinRadio.prototype, "error", 2);
128
+ ], exports.DaikinRadio.prototype, "disabled", 2);
148
129
  exports.DaikinRadio = __decorateClass([
149
130
  decorators_js.customElement("daikin-radio")
150
131
  ], exports.DaikinRadio);
@@ -1,12 +1,4 @@
1
1
  import { LitElement } from 'lit';
2
- import { MergeVariantProps } from '../../type-utils';
3
- declare const cvaRadio: (props?: ({
4
- size?: "small" | "large" | null | undefined;
5
- } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
- declare const cvaLabel: (props?: ({
7
- size?: "small" | "large" | null | undefined;
8
- } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
- type RadioVariantProps = MergeVariantProps<typeof cvaRadio | typeof cvaLabel>;
10
2
  /**
11
3
  * The radio button component is a UI element that allows users to select one options from a set of choices.
12
4
  * It functions similarly to the HTML `<input type="radio">` tag. \
@@ -16,60 +8,52 @@ type RadioVariantProps = MergeVariantProps<typeof cvaRadio | typeof cvaLabel>;
16
8
  *
17
9
  * @example
18
10
  *
11
+ * ```js
12
+ * import "@daikin-oss/design-system-web-components/components/radio/index.js";
13
+ * ```
14
+ *
19
15
  * ```html
20
16
  * <daikin-radio name="name" value="value" label="Radio button label"></daikin-radio>
21
17
  * ```
22
18
  */
23
19
  export declare class DaikinRadio extends LitElement {
24
20
  static readonly styles: import('lit').CSSResult;
25
- private _handleClick;
26
- static readonly formAssociated = true;
27
- private _internals;
28
- private _updateFormValue;
29
- updated(changedProperties: Map<string, unknown>): void;
30
- private _handleChange;
31
- /**
32
- * Specify the label text for the radio
33
- */
34
- label: string;
35
21
  /**
36
- * Specify the component size
22
+ * Form name of the radio button.
37
23
  */
38
- size: RadioVariantProps["size"];
24
+ name: string;
39
25
  /**
40
- * Specify the label position
41
- * when `left` the label will be in left of radio, when `right` label will be in right of radio
26
+ * Form value of the radio button.
42
27
  */
43
- labelPosition: "left" | "right";
28
+ value: string;
44
29
  /**
45
- * Specify whether the Radio should be disabled
30
+ * Label text for the radio button.
46
31
  */
47
- disabled: boolean;
32
+ label: string;
48
33
  /**
49
- * Specify whether the radio is read only
34
+ * Label position.
35
+ * - `right` (default): The label will be placed to the right of the radio button.
36
+ * - `hidden`: The label will not be shown.
50
37
  */
51
- readonly: boolean;
38
+ labelPosition: "right" | "hidden";
52
39
  /**
53
- * Specify whether the radio is be checked
40
+ * Whether the radio button is checked.
54
41
  */
55
42
  checked: boolean;
56
43
  /**
57
- * The form name.
58
- */
59
- name: string;
60
- /**
61
- * The form value.
62
- */
63
- value: string;
64
- /**
65
- * Specify whether the Radio is in a error state
44
+ * Whether the radio button is disabled.
66
45
  */
67
- error: boolean;
46
+ disabled: boolean;
47
+ static readonly formAssociated = true;
48
+ private _internals;
49
+ private _updateFormValue;
50
+ private _handleClick;
51
+ private _handleChange;
68
52
  render(): import('lit-html').TemplateResult<1>;
53
+ updated(changedProperties: Map<string, unknown>): void;
69
54
  }
70
55
  declare global {
71
56
  interface HTMLElementTagNameMap {
72
57
  "daikin-radio": DaikinRadio;
73
58
  }
74
59
  }
75
- export {};
@@ -21,38 +21,44 @@ const cvaTab = classVarianceAuthority.cva(
21
21
  "h-full",
22
22
  "items-center",
23
23
  "justify-center",
24
+ "px-4",
25
+ "pt-2",
26
+ "pb-3",
27
+ "text-base",
28
+ "font-bold",
24
29
  "text-center",
25
- "relative",
26
30
  "font-daikinSerif",
27
- "text-base",
31
+ "relative",
28
32
  "tracking-wide",
29
33
  "whitespace-nowrap",
30
34
  "contain-paint",
31
- "disabled:cursor-default",
32
- "after:content-['']",
33
- "after:z-1",
34
- "after:absolute",
35
- "after:bottom-0",
36
- "after:left-0",
37
- "after:right-0",
38
- "after:w-full",
39
- "text-daikinBlue-500",
40
- "hover:text-daikinBlue-400",
41
- "active:text-daikinBlue-600",
42
- "focus-visible:text-daikinBlue-700",
43
- "disabled:text-daikinNeutral-300",
44
- "aria-selected:after:h-1",
45
- "aria-selected:after:bg-daikinBlue-500",
46
- "hover:aria-selected:after:bg-daikinBlue-400",
47
- "active:aria-selected:after:bg-daikinBlue-600",
48
- "focus-visible:aria-selected:after:bg-daikinBlue-700",
49
- "disabled:after:bg-daikinNeutral-300"
35
+ "focus-visible:outline-none",
36
+ "focus-visible:before:w-full",
37
+ "focus-visible:before:h-[calc(100%_-_4px)]",
38
+ "focus-visible:before:border",
39
+ "focus-visible:before:border-daikinBlue-700",
40
+ "focus-visible:before:absolute",
41
+ "focus-visible:before:top-0",
42
+ "disabled:text-daikinNeutral-200"
50
43
  ],
51
44
  {
52
45
  variants: {
53
- size: {
54
- default: ["px-4"],
55
- condensed: ["px-[10px]"]
46
+ active: {
47
+ false: [
48
+ "hover:text-daikinNeutral-500",
49
+ "active:text-daikinNeutral-700"
50
+ ],
51
+ true: [
52
+ "text-daikinBlue-500",
53
+ "hover:text-daikinBlue-300",
54
+ "active:text-daikinBlue-600",
55
+ "after:w-full",
56
+ "after:h-1",
57
+ "after:absolute",
58
+ "after:bottom-0",
59
+ "enabled:after:bg-daikinBlue-500",
60
+ "disabled:after:bg-daikinNeutral-200"
61
+ ]
56
62
  }
57
63
  }
58
64
  }
@@ -61,31 +67,26 @@ exports.DaikinTab = class DaikinTab extends lit.LitElement {
61
67
  constructor() {
62
68
  super();
63
69
  this.value = "";
64
- this.size = "default";
65
70
  this.disabled = false;
66
71
  this.active = false;
67
- this.addEventListener("click", this._handleClick);
68
- }
69
- _handleClick(event) {
70
- if (this.disabled) {
71
- event.stopImmediatePropagation();
72
- }
72
+ this.addEventListener("click", (event) => {
73
+ if (this.disabled) {
74
+ event.stopImmediatePropagation();
75
+ }
76
+ });
73
77
  }
74
78
  /**
75
79
  * Focuses on the inner button.
76
80
  * @param options focus options
77
81
  */
78
82
  focus(options) {
79
- var _a, _b;
80
- (_b = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("button")) == null ? void 0 : _b.focus(options);
83
+ var _a;
84
+ (_a = this._button) == null ? void 0 : _a.focus(options);
81
85
  }
82
86
  render() {
83
- const cn = cvaTab({
84
- size: this.size
85
- });
86
87
  return lit.html`
87
88
  <button
88
- class=${cn}
89
+ class=${cvaTab({ active: this.active })}
89
90
  ?disabled=${this.disabled}
90
91
  role="tab"
91
92
  aria-selected=${!this.disabled && this.active}
@@ -101,26 +102,20 @@ exports.DaikinTab.styles = lit.css`
101
102
 
102
103
  :host {
103
104
  display: inline-block;
104
- width: fit-content;
105
- height: 48px;
106
- }
107
-
108
- :host([size="condensed"]) {
109
- height: 40px;
110
105
  }
111
106
  `;
112
107
  __decorateClass([
113
108
  decorators_js.property({ type: String, reflect: true })
114
109
  ], exports.DaikinTab.prototype, "value", 2);
115
- __decorateClass([
116
- decorators_js.property({ type: String, reflect: true })
117
- ], exports.DaikinTab.prototype, "size", 2);
118
110
  __decorateClass([
119
111
  decorators_js.property({ type: Boolean, reflect: true })
120
112
  ], exports.DaikinTab.prototype, "disabled", 2);
121
113
  __decorateClass([
122
114
  decorators_js.property({ type: Boolean, reflect: true })
123
115
  ], exports.DaikinTab.prototype, "active", 2);
116
+ __decorateClass([
117
+ decorators_js.query("button")
118
+ ], exports.DaikinTab.prototype, "_button", 2);
124
119
  exports.DaikinTab = __decorateClass([
125
120
  decorators_js.customElement("daikin-tab")
126
121
  ], exports.DaikinTab);
@@ -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 {
@@ -14,7 +14,7 @@ var __decorateClass = (decorators, target, key, kind) => {
14
14
  if (kind && result) __defProp(target, key, result);
15
15
  return result;
16
16
  };
17
- exports.DaikinPanelSwitcher = class DaikinPanelSwitcher extends lit.LitElement {
17
+ exports.DaikinTabPanels = class DaikinTabPanels extends lit.LitElement {
18
18
  constructor() {
19
19
  super(...arguments);
20
20
  this.value = "";
@@ -35,21 +35,21 @@ exports.DaikinPanelSwitcher = class DaikinPanelSwitcher extends lit.LitElement {
35
35
  );
36
36
  }
37
37
  };
38
- exports.DaikinPanelSwitcher.styles = lit.css`
38
+ exports.DaikinTabPanels.styles = lit.css`
39
39
  ${lit.unsafeCSS(tailwind.default)}
40
40
  `;
41
41
  __decorateClass([
42
42
  decorators_js.property({ type: String, reflect: true })
43
- ], exports.DaikinPanelSwitcher.prototype, "value", 2);
43
+ ], exports.DaikinTabPanels.prototype, "value", 2);
44
44
  __decorateClass([
45
45
  decorators_js.property({
46
46
  type: Array,
47
47
  hasChanged: (newValue, oldValue) => JSON.stringify(newValue) !== JSON.stringify(oldValue)
48
48
  })
49
- ], exports.DaikinPanelSwitcher.prototype, "panels", 2);
49
+ ], exports.DaikinTabPanels.prototype, "panels", 2);
50
50
  __decorateClass([
51
51
  decorators_js.property({ type: String, reflect: true, attribute: "panel-role" })
52
- ], exports.DaikinPanelSwitcher.prototype, "panelRole", 2);
53
- exports.DaikinPanelSwitcher = __decorateClass([
54
- decorators_js.customElement("daikin-panel-switcher")
55
- ], exports.DaikinPanelSwitcher);
52
+ ], exports.DaikinTabPanels.prototype, "panelRole", 2);
53
+ exports.DaikinTabPanels = __decorateClass([
54
+ decorators_js.customElement("daikin-tab-panels")
55
+ ], exports.DaikinTabPanels);
@@ -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
  }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const daikinTabPanels = require("./daikin-tab-panels.cjs");
4
+ Object.defineProperty(exports, "DaikinTabPanels", {
5
+ enumerable: true,
6
+ get: () => daikinTabPanels.DaikinTabPanels
7
+ });
@@ -0,0 +1 @@
1
+ export * from './daikin-tab-panels';