@daikin-oss/design-system-web-components 0.2.0 → 0.3.1

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 (249) hide show
  1. package/README.md +47 -7
  2. package/dist/cjs/components/accordion/daikin-accordion.cjs +37 -0
  3. package/dist/cjs/components/accordion/daikin-accordion.d.ts +40 -0
  4. package/dist/cjs/components/accordion/index.cjs +7 -0
  5. package/dist/cjs/components/accordion/index.d.ts +1 -0
  6. package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +177 -0
  7. package/dist/cjs/components/accordion-item/daikin-accordion-item.d.ts +56 -0
  8. package/dist/cjs/components/accordion-item/index.cjs +7 -0
  9. package/dist/cjs/components/accordion-item/index.d.ts +1 -0
  10. package/dist/cjs/components/button/daikin-button.cjs +25 -7
  11. package/dist/cjs/components/button/daikin-button.d.ts +21 -3
  12. package/dist/cjs/components/button/index.cjs +7 -0
  13. package/dist/cjs/components/checkbox/daikin-checkbox.d.ts +11 -1
  14. package/dist/cjs/components/checkbox/index.cjs +7 -0
  15. package/dist/cjs/components/icon/daikin-icon.cjs +87 -0
  16. package/dist/cjs/components/icon/daikin-icon.d.ts +49 -0
  17. package/dist/cjs/components/icon/icons.json.cjs +29 -0
  18. package/dist/cjs/components/icon/icons.json.d.ts +31 -0
  19. package/dist/cjs/components/icon/index.cjs +8 -0
  20. package/dist/cjs/components/icon/index.d.ts +1 -0
  21. package/dist/cjs/components/index.cjs +73 -0
  22. package/dist/cjs/components/index.d.ts +7 -0
  23. package/dist/cjs/components/input-group/daikin-input-group.d.ts +27 -1
  24. package/dist/cjs/components/input-group/index.cjs +7 -0
  25. package/dist/cjs/components/notification/daikin-notification.cjs +15 -33
  26. package/dist/cjs/components/notification/daikin-notification.d.ts +21 -7
  27. package/dist/cjs/components/notification/index.cjs +7 -0
  28. package/dist/cjs/components/panel-switcher/daikin-panel-switcher.cjs +55 -0
  29. package/dist/cjs/components/panel-switcher/daikin-panel-switcher.d.ts +51 -0
  30. package/dist/cjs/components/panel-switcher/index.cjs +7 -0
  31. package/dist/cjs/components/panel-switcher/index.d.ts +1 -0
  32. package/dist/cjs/components/radio/daikin-radio.d.ts +11 -1
  33. package/dist/cjs/components/radio/index.cjs +7 -0
  34. package/dist/cjs/components/tab/daikin-tab.cjs +126 -0
  35. package/dist/cjs/components/tab/daikin-tab.d.ts +55 -0
  36. package/dist/cjs/components/tab/index.cjs +7 -0
  37. package/dist/cjs/components/tab/index.d.ts +1 -0
  38. package/dist/cjs/components/tab-group/daikin-tab-group.cjs +211 -0
  39. package/dist/cjs/components/tab-group/daikin-tab-group.d.ts +105 -0
  40. package/dist/cjs/components/tab-group/index.cjs +7 -0
  41. package/dist/cjs/components/tab-group/index.d.ts +1 -0
  42. package/dist/cjs/components/tab-group/scroller.cjs +65 -0
  43. package/dist/cjs/components/tab-group/scroller.d.ts +25 -0
  44. package/dist/cjs/components/text-input/daikin-text-input.d.ts +16 -1
  45. package/dist/cjs/components/text-input/index.cjs +7 -0
  46. package/dist/cjs/components/textarea/daikin-textarea.d.ts +16 -1
  47. package/dist/cjs/components/textarea/index.cjs +7 -0
  48. package/dist/cjs/components/toggle/daikin-toggle.cjs +132 -0
  49. package/dist/cjs/components/toggle/daikin-toggle.d.ts +61 -0
  50. package/dist/cjs/components/toggle/index.cjs +7 -0
  51. package/dist/cjs/components/toggle/index.d.ts +1 -0
  52. package/dist/cjs/index.cjs +36 -0
  53. package/dist/cjs/tailwind.css.cjs +1 -1
  54. package/dist/cjs-dev/colors.cjs +80 -0
  55. package/dist/cjs-dev/colors.d.ts +69 -0
  56. package/dist/cjs-dev/components/accordion/daikin-accordion.cjs +37 -0
  57. package/dist/cjs-dev/components/accordion/daikin-accordion.d.ts +40 -0
  58. package/dist/cjs-dev/components/accordion/index.cjs +7 -0
  59. package/dist/cjs-dev/components/accordion/index.d.ts +1 -0
  60. package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +177 -0
  61. package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.d.ts +56 -0
  62. package/dist/cjs-dev/components/accordion-item/index.cjs +7 -0
  63. package/dist/cjs-dev/components/accordion-item/index.d.ts +1 -0
  64. package/dist/cjs-dev/components/button/daikin-button.cjs +215 -0
  65. package/dist/cjs-dev/components/button/daikin-button.d.ts +77 -0
  66. package/dist/cjs-dev/components/button/index.cjs +7 -0
  67. package/dist/cjs-dev/components/button/index.d.ts +1 -0
  68. package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +183 -0
  69. package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.ts +78 -0
  70. package/dist/cjs-dev/components/checkbox/index.cjs +7 -0
  71. package/dist/cjs-dev/components/checkbox/index.d.ts +1 -0
  72. package/dist/cjs-dev/components/icon/daikin-icon.cjs +96 -0
  73. package/dist/cjs-dev/components/icon/daikin-icon.d.ts +49 -0
  74. package/dist/cjs-dev/components/icon/icons.json.cjs +29 -0
  75. package/dist/cjs-dev/components/icon/icons.json.d.ts +31 -0
  76. package/dist/cjs-dev/components/icon/index.cjs +8 -0
  77. package/dist/cjs-dev/components/icon/index.d.ts +1 -0
  78. package/dist/cjs-dev/components/index.cjs +73 -0
  79. package/dist/cjs-dev/components/index.d.ts +14 -0
  80. package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +119 -0
  81. package/dist/cjs-dev/components/input-group/daikin-input-group.d.ts +73 -0
  82. package/dist/cjs-dev/components/input-group/index.cjs +7 -0
  83. package/dist/cjs-dev/components/input-group/index.d.ts +1 -0
  84. package/dist/cjs-dev/components/notification/daikin-notification.cjs +191 -0
  85. package/dist/cjs-dev/components/notification/daikin-notification.d.ts +76 -0
  86. package/dist/cjs-dev/components/notification/index.cjs +7 -0
  87. package/dist/cjs-dev/components/notification/index.d.ts +1 -0
  88. package/dist/cjs-dev/components/panel-switcher/daikin-panel-switcher.cjs +62 -0
  89. package/dist/cjs-dev/components/panel-switcher/daikin-panel-switcher.d.ts +51 -0
  90. package/dist/cjs-dev/components/panel-switcher/index.cjs +7 -0
  91. package/dist/cjs-dev/components/panel-switcher/index.d.ts +1 -0
  92. package/dist/cjs-dev/components/radio/daikin-radio.cjs +150 -0
  93. package/dist/cjs-dev/components/radio/daikin-radio.d.ts +76 -0
  94. package/dist/cjs-dev/components/radio/index.cjs +7 -0
  95. package/dist/cjs-dev/components/radio/index.d.ts +1 -0
  96. package/dist/cjs-dev/components/tab/daikin-tab.cjs +126 -0
  97. package/dist/cjs-dev/components/tab/daikin-tab.d.ts +55 -0
  98. package/dist/cjs-dev/components/tab/index.cjs +7 -0
  99. package/dist/cjs-dev/components/tab/index.d.ts +1 -0
  100. package/dist/cjs-dev/components/tab-group/daikin-tab-group.cjs +221 -0
  101. package/dist/cjs-dev/components/tab-group/daikin-tab-group.d.ts +105 -0
  102. package/dist/cjs-dev/components/tab-group/index.cjs +7 -0
  103. package/dist/cjs-dev/components/tab-group/index.d.ts +1 -0
  104. package/dist/cjs-dev/components/tab-group/scroller.cjs +65 -0
  105. package/dist/cjs-dev/components/tab-group/scroller.d.ts +25 -0
  106. package/dist/cjs-dev/components/text-input/daikin-text-input.cjs +137 -0
  107. package/dist/cjs-dev/components/text-input/daikin-text-input.d.ts +69 -0
  108. package/dist/cjs-dev/components/text-input/index.cjs +7 -0
  109. package/dist/cjs-dev/components/text-input/index.d.ts +1 -0
  110. package/dist/cjs-dev/components/textarea/daikin-textarea.cjs +168 -0
  111. package/dist/cjs-dev/components/textarea/daikin-textarea.d.ts +71 -0
  112. package/dist/cjs-dev/components/textarea/index.cjs +7 -0
  113. package/dist/cjs-dev/components/textarea/index.d.ts +1 -0
  114. package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +132 -0
  115. package/dist/cjs-dev/components/toggle/daikin-toggle.d.ts +61 -0
  116. package/dist/cjs-dev/components/toggle/index.cjs +7 -0
  117. package/dist/cjs-dev/components/toggle/index.d.ts +1 -0
  118. package/dist/cjs-dev/constants/events.cjs +4 -0
  119. package/dist/cjs-dev/constants/events.d.ts +1 -0
  120. package/dist/cjs-dev/index.cjs +75 -0
  121. package/dist/cjs-dev/index.d.ts +3 -0
  122. package/dist/cjs-dev/lit-analyzer-types.d.ts +112 -0
  123. package/dist/cjs-dev/tailwind.css.cjs +6 -0
  124. package/dist/cjs-dev/type-utils.d.ts +25 -0
  125. package/dist/es/components/accordion/daikin-accordion.d.ts +40 -0
  126. package/dist/es/components/accordion/daikin-accordion.js +38 -0
  127. package/dist/es/components/accordion/index.d.ts +1 -0
  128. package/dist/es/components/accordion/index.js +4 -0
  129. package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +56 -0
  130. package/dist/es/components/accordion-item/daikin-accordion-item.js +178 -0
  131. package/dist/es/components/accordion-item/index.d.ts +1 -0
  132. package/dist/es/components/accordion-item/index.js +4 -0
  133. package/dist/es/components/button/daikin-button.d.ts +21 -3
  134. package/dist/es/components/button/daikin-button.js +25 -7
  135. package/dist/es/components/button/index.js +4 -0
  136. package/dist/es/components/checkbox/daikin-checkbox.d.ts +11 -1
  137. package/dist/es/components/checkbox/index.js +4 -0
  138. package/dist/es/components/icon/daikin-icon.d.ts +49 -0
  139. package/dist/es/components/icon/daikin-icon.js +88 -0
  140. package/dist/es/components/icon/icons.json.d.ts +31 -0
  141. package/dist/es/components/icon/icons.json.js +29 -0
  142. package/dist/es/components/icon/index.d.ts +1 -0
  143. package/dist/es/components/icon/index.js +5 -0
  144. package/dist/es/components/index.d.ts +7 -0
  145. package/dist/es/components/index.js +31 -0
  146. package/dist/es/components/input-group/daikin-input-group.d.ts +27 -1
  147. package/dist/es/components/input-group/index.js +4 -0
  148. package/dist/es/components/notification/daikin-notification.d.ts +21 -7
  149. package/dist/es/components/notification/daikin-notification.js +15 -33
  150. package/dist/es/components/notification/index.js +4 -0
  151. package/dist/es/components/panel-switcher/daikin-panel-switcher.d.ts +51 -0
  152. package/dist/es/components/panel-switcher/daikin-panel-switcher.js +56 -0
  153. package/dist/es/components/panel-switcher/index.d.ts +1 -0
  154. package/dist/es/components/panel-switcher/index.js +4 -0
  155. package/dist/es/components/radio/daikin-radio.d.ts +11 -1
  156. package/dist/es/components/radio/index.js +4 -0
  157. package/dist/es/components/tab/daikin-tab.d.ts +55 -0
  158. package/dist/es/components/tab/daikin-tab.js +127 -0
  159. package/dist/es/components/tab/index.d.ts +1 -0
  160. package/dist/es/components/tab/index.js +4 -0
  161. package/dist/es/components/tab-group/daikin-tab-group.d.ts +105 -0
  162. package/dist/es/components/tab-group/daikin-tab-group.js +212 -0
  163. package/dist/es/components/tab-group/index.d.ts +1 -0
  164. package/dist/es/components/tab-group/index.js +4 -0
  165. package/dist/es/components/tab-group/scroller.d.ts +25 -0
  166. package/dist/es/components/tab-group/scroller.js +65 -0
  167. package/dist/es/components/text-input/daikin-text-input.d.ts +16 -1
  168. package/dist/es/components/text-input/index.js +4 -0
  169. package/dist/es/components/textarea/daikin-textarea.d.ts +16 -1
  170. package/dist/es/components/textarea/index.js +4 -0
  171. package/dist/es/components/toggle/daikin-toggle.d.ts +61 -0
  172. package/dist/es/components/toggle/daikin-toggle.js +133 -0
  173. package/dist/es/components/toggle/index.d.ts +1 -0
  174. package/dist/es/components/toggle/index.js +4 -0
  175. package/dist/es/index.js +16 -1
  176. package/dist/es/tailwind.css.js +1 -1
  177. package/dist/es-dev/colors.d.ts +69 -0
  178. package/dist/es-dev/colors.js +80 -0
  179. package/dist/es-dev/components/accordion/daikin-accordion.d.ts +40 -0
  180. package/dist/es-dev/components/accordion/daikin-accordion.js +38 -0
  181. package/dist/es-dev/components/accordion/index.d.ts +1 -0
  182. package/dist/es-dev/components/accordion/index.js +4 -0
  183. package/dist/es-dev/components/accordion-item/daikin-accordion-item.d.ts +56 -0
  184. package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +178 -0
  185. package/dist/es-dev/components/accordion-item/index.d.ts +1 -0
  186. package/dist/es-dev/components/accordion-item/index.js +4 -0
  187. package/dist/es-dev/components/button/daikin-button.d.ts +77 -0
  188. package/dist/es-dev/components/button/daikin-button.js +216 -0
  189. package/dist/es-dev/components/button/index.d.ts +1 -0
  190. package/dist/es-dev/components/button/index.js +4 -0
  191. package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +78 -0
  192. package/dist/es-dev/components/checkbox/daikin-checkbox.js +184 -0
  193. package/dist/es-dev/components/checkbox/index.d.ts +1 -0
  194. package/dist/es-dev/components/checkbox/index.js +4 -0
  195. package/dist/es-dev/components/icon/daikin-icon.d.ts +49 -0
  196. package/dist/es-dev/components/icon/daikin-icon.js +97 -0
  197. package/dist/es-dev/components/icon/icons.json.d.ts +31 -0
  198. package/dist/es-dev/components/icon/icons.json.js +29 -0
  199. package/dist/es-dev/components/icon/index.d.ts +1 -0
  200. package/dist/es-dev/components/icon/index.js +5 -0
  201. package/dist/es-dev/components/index.d.ts +14 -0
  202. package/dist/es-dev/components/index.js +31 -0
  203. package/dist/es-dev/components/input-group/daikin-input-group.d.ts +73 -0
  204. package/dist/es-dev/components/input-group/daikin-input-group.js +120 -0
  205. package/dist/es-dev/components/input-group/index.d.ts +1 -0
  206. package/dist/es-dev/components/input-group/index.js +4 -0
  207. package/dist/es-dev/components/notification/daikin-notification.d.ts +76 -0
  208. package/dist/es-dev/components/notification/daikin-notification.js +192 -0
  209. package/dist/es-dev/components/notification/index.d.ts +1 -0
  210. package/dist/es-dev/components/notification/index.js +4 -0
  211. package/dist/es-dev/components/panel-switcher/daikin-panel-switcher.d.ts +51 -0
  212. package/dist/es-dev/components/panel-switcher/daikin-panel-switcher.js +63 -0
  213. package/dist/es-dev/components/panel-switcher/index.d.ts +1 -0
  214. package/dist/es-dev/components/panel-switcher/index.js +4 -0
  215. package/dist/es-dev/components/radio/daikin-radio.d.ts +76 -0
  216. package/dist/es-dev/components/radio/daikin-radio.js +151 -0
  217. package/dist/es-dev/components/radio/index.d.ts +1 -0
  218. package/dist/es-dev/components/radio/index.js +4 -0
  219. package/dist/es-dev/components/tab/daikin-tab.d.ts +55 -0
  220. package/dist/es-dev/components/tab/daikin-tab.js +127 -0
  221. package/dist/es-dev/components/tab/index.d.ts +1 -0
  222. package/dist/es-dev/components/tab/index.js +4 -0
  223. package/dist/es-dev/components/tab-group/daikin-tab-group.d.ts +105 -0
  224. package/dist/es-dev/components/tab-group/daikin-tab-group.js +222 -0
  225. package/dist/es-dev/components/tab-group/index.d.ts +1 -0
  226. package/dist/es-dev/components/tab-group/index.js +4 -0
  227. package/dist/es-dev/components/tab-group/scroller.d.ts +25 -0
  228. package/dist/es-dev/components/tab-group/scroller.js +65 -0
  229. package/dist/es-dev/components/text-input/daikin-text-input.d.ts +69 -0
  230. package/dist/es-dev/components/text-input/daikin-text-input.js +138 -0
  231. package/dist/es-dev/components/text-input/index.d.ts +1 -0
  232. package/dist/es-dev/components/text-input/index.js +4 -0
  233. package/dist/es-dev/components/textarea/daikin-textarea.d.ts +71 -0
  234. package/dist/es-dev/components/textarea/daikin-textarea.js +169 -0
  235. package/dist/es-dev/components/textarea/index.d.ts +1 -0
  236. package/dist/es-dev/components/textarea/index.js +4 -0
  237. package/dist/es-dev/components/toggle/daikin-toggle.d.ts +61 -0
  238. package/dist/es-dev/components/toggle/daikin-toggle.js +133 -0
  239. package/dist/es-dev/components/toggle/index.d.ts +1 -0
  240. package/dist/es-dev/components/toggle/index.js +4 -0
  241. package/dist/es-dev/constants/events.d.ts +1 -0
  242. package/dist/es-dev/constants/events.js +4 -0
  243. package/dist/es-dev/index.d.ts +3 -0
  244. package/dist/es-dev/index.js +33 -0
  245. package/dist/es-dev/lit-analyzer-types.d.ts +112 -0
  246. package/dist/es-dev/tailwind.css.js +6 -0
  247. package/dist/es-dev/type-utils.d.ts +25 -0
  248. package/icons/accordion-chevron-up.svg +3 -0
  249. package/package.json +58 -27
package/README.md CHANGED
@@ -8,26 +8,66 @@ This project is an implementation of the Daikin Design Kit using Web Components.
8
8
 
9
9
  Start by installing the package:
10
10
 
11
- ```bash
12
- npm i @daikin-oss/design-system-web-components
11
+ ```sh
12
+ npm install @daikin-oss/design-system-web-components
13
13
  ```
14
14
 
15
- You can then import necessary components in your bundle:
15
+ You can then import necessary components in your bundle (the .js extension is optional):
16
16
 
17
- ```javascript
18
- import "@daikin-oss/design-system-web-components/dist/components/button/index.js";
17
+ ```js
18
+ import "@daikin-oss/design-system-web-components/components/button/index.js";
19
19
  ```
20
20
 
21
21
  By default, out-of-the-box, the styles are for Daikin brand in light mode.
22
22
 
23
+ ### Fonts
24
+
25
+ We use Roboto as the font for our UI components.
26
+ This font is not included in our package, so developers will need to include it in their apps.
27
+
28
+ The required weights and variants are as follows:
29
+
30
+ - Regular (400), Normal
31
+ - Bold (700), Normal
32
+
33
+ #### With Google Fonts
34
+
35
+ If you can use an external CDN, you can use Google Fonts to load it.
36
+
37
+ ```html
38
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
39
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
40
+ <link
41
+ href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap"
42
+ rel="stylesheet"
43
+ />
44
+ ```
45
+
46
+ #### With Fontsource
47
+
48
+ If you want to deliver fonts within your app without relying on an external CDN, you can use a package like [Fontsource](https://fontsource.org/fonts/roboto) to do this.
49
+
50
+ Install the package with:
51
+
52
+ ```sh
53
+ npm install @fontsource/roboto
54
+ ```
55
+
56
+ Then import it in your app:
57
+
58
+ ```js
59
+ import "@fontsource/roboto/400.css";
60
+ import "@fontsource/roboto/700.css";
61
+ ```
62
+
23
63
  ### Dark Mode and Brands/Themes
24
64
 
25
65
  _Due to the encapsulation of styles by the Web Components specification, how themes are applied may change in the future._
26
66
 
27
67
  For dark-mode support and non-daikin brands, you need to add the `tokens` package and include the CSS reference in your html:
28
68
 
29
- ```bash
30
- npm install '@daikin-oss/dds-tokens
69
+ ```sh
70
+ npm install @daikin-oss/dds-tokens
31
71
  ```
32
72
 
33
73
  #### Dark Mode
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const lit = require("lit");
4
+ const decorators_js = require("lit/decorators.js");
5
+ const tailwind = require("../../tailwind.css.cjs");
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13
+ if (kind && result) __defProp(target, key, result);
14
+ return result;
15
+ };
16
+ exports.DaikinAccordion = class DaikinAccordion extends lit.LitElement {
17
+ render() {
18
+ return lit.html`<div class="w-full border-y-[1px] border-y-[#CECECE]">
19
+ <slot></slot>
20
+ </div>`;
21
+ }
22
+ };
23
+ exports.DaikinAccordion.styles = lit.css`
24
+ ${lit.unsafeCSS(tailwind.default)}
25
+
26
+ :host {
27
+ display: block;
28
+ width: 100%;
29
+ }
30
+
31
+ ::slotted(daikin-accordion-item:not(:last-child)) {
32
+ border-bottom: 1px solid #cecece;
33
+ }
34
+ `;
35
+ exports.DaikinAccordion = __decorateClass([
36
+ decorators_js.customElement("daikin-accordion")
37
+ ], exports.DaikinAccordion);
@@ -0,0 +1,40 @@
1
+ import { LitElement } from 'lit';
2
+
3
+ /**
4
+ * The accordion component serves as the parent element that organizes and manages the overall structure of the accordion.
5
+ * Currently it only provides appropriate styles for individual accordion items.
6
+ *
7
+ * Hierarchy:
8
+ * - `daikin-accordion` > `daikin-accordion-item`
9
+ *
10
+ * @slot - A slot for the accordion items. Place `daikin-accordion-item` elements here.
11
+ *
12
+ * @example
13
+ *
14
+ * ```html
15
+ * <daikin-accordion>
16
+ * <daikin-accordion-item title="The first accordion item">
17
+ * Accordion 1 content.
18
+ * </daikin-accordion-item>
19
+ * <daikin-accordion-item title="The second accordion item" open>
20
+ * Accordion 2 content.
21
+ * </daikin-accordion-item>
22
+ * <daikin-accordion-item title="The third accordion item" disabled>
23
+ * Accordion 3 content.
24
+ * </daikin-accordion-item>
25
+ * <daikin-accordion-item title="The fourth accordion item" open disabled>
26
+ * Accordion 4 content.
27
+ * </daikin-accordion-item>
28
+ * </daikin-accordion>
29
+ * ```
30
+ */
31
+ export declare class DaikinAccordion extends LitElement {
32
+ static readonly styles: import('lit').CSSResult;
33
+ render(): import('lit-html').TemplateResult<1>;
34
+ }
35
+ declare global {
36
+ interface HTMLElementTagNameMap {
37
+ "daikin-accordion": DaikinAccordion;
38
+ }
39
+ }
40
+ export default DaikinAccordion;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const daikinAccordion = require("./daikin-accordion.cjs");
4
+ Object.defineProperty(exports, "DaikinAccordion", {
5
+ enumerable: true,
6
+ get: () => daikinAccordion.DaikinAccordion
7
+ });
@@ -0,0 +1 @@
1
+ export * from './daikin-accordion';
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const classVarianceAuthority = require("class-variance-authority");
4
+ const lit = require("lit");
5
+ const decorators_js = require("lit/decorators.js");
6
+ const ref_js = require("lit/directives/ref.js");
7
+ const tailwind = require("../../tailwind.css.cjs");
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __decorateClass = (decorators, target, key, kind) => {
11
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
12
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
13
+ if (decorator = decorators[i])
14
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
15
+ if (kind && result) __defProp(target, key, result);
16
+ return result;
17
+ };
18
+ const cvaDetails = classVarianceAuthority.cva(
19
+ ["flex", "w-full", "h-max", "bg-white", "font-daikinSerif", "overflow-clip"],
20
+ {
21
+ variants: {
22
+ status: {
23
+ enabled: [],
24
+ disabled: ["text-[#DCDCDC]"]
25
+ }
26
+ }
27
+ }
28
+ );
29
+ const cvaSummary = classVarianceAuthority.cva(
30
+ [
31
+ "flex",
32
+ "items-center",
33
+ "w-full",
34
+ "h-12",
35
+ "px-5",
36
+ "outline-none",
37
+ "relative",
38
+ "after:block",
39
+ "after:w-5",
40
+ "after:h-5",
41
+ "after:m-auto",
42
+ "after:top-0",
43
+ "after:right-4",
44
+ "after:bottom-0",
45
+ "after:absolute",
46
+ "after:i-daikin-accordion-chevron-up",
47
+ "after:transition-all"
48
+ ],
49
+ {
50
+ variants: {
51
+ visible: {
52
+ open: ["after:rotate-0"],
53
+ close: ["after:-rotate-180"]
54
+ },
55
+ status: {
56
+ enabled: [
57
+ "hover:bg-[#DCDCDC]",
58
+ "hover:bg-[#DCDCDC]",
59
+ "hover:cursor-pointer",
60
+ "focus-visible:outline",
61
+ "focus-visible:outline-[2px]",
62
+ "focus-visible:outline-[#0097E0]",
63
+ "focus-visible:outline-offset-[-2px]",
64
+ "after:text-[#828282]"
65
+ ],
66
+ disabled: ["text-[#DCDCDC]", "after:text-[#DCDCDC]"]
67
+ }
68
+ }
69
+ }
70
+ );
71
+ const animationOption = {
72
+ duration: 250,
73
+ easing: "ease-in-out"
74
+ };
75
+ const contentCloseKeyframe = {
76
+ height: 0
77
+ };
78
+ const getContentOpenKeyframe = (content) => ({
79
+ height: `${content.offsetHeight}px`
80
+ });
81
+ exports.DaikinAccordionItem = class DaikinAccordionItem extends lit.LitElement {
82
+ constructor() {
83
+ super(...arguments);
84
+ this._contentRef = ref_js.createRef();
85
+ this.title = "";
86
+ this.open = false;
87
+ this.disabled = false;
88
+ this._detailsOpen = false;
89
+ }
90
+ _contentAnimate() {
91
+ const content = this._contentRef.value;
92
+ if (!content || this.open === this._detailsOpen) {
93
+ return;
94
+ }
95
+ if (this.open) {
96
+ this._detailsOpen = this.open;
97
+ content.animate(
98
+ [contentCloseKeyframe, getContentOpenKeyframe(content)],
99
+ animationOption
100
+ );
101
+ } else {
102
+ const animation = content.animate(
103
+ [getContentOpenKeyframe(content), contentCloseKeyframe],
104
+ animationOption
105
+ );
106
+ animation.onfinish = () => {
107
+ this._detailsOpen = this.open;
108
+ };
109
+ }
110
+ }
111
+ _handleSummaryClick(e) {
112
+ e.preventDefault();
113
+ if (this.disabled) {
114
+ return;
115
+ }
116
+ this.open = !this.open;
117
+ }
118
+ render() {
119
+ const accordionDetailsClassName = cvaDetails({
120
+ status: this.disabled ? "disabled" : "enabled"
121
+ });
122
+ const accordionSummaryClassName = cvaSummary({
123
+ status: this.disabled ? "disabled" : "enabled",
124
+ visible: this.open ? "open" : "close"
125
+ });
126
+ return lit.html`<details
127
+ class=${accordionDetailsClassName}
128
+ ?open=${this._detailsOpen}
129
+ ?data-open=${this.open}
130
+ aria-disabled=${this.disabled}
131
+ >
132
+ <summary
133
+ class=${accordionSummaryClassName}
134
+ tabindex=${this.disabled ? -1 : 0}
135
+ @click=${this._handleSummaryClick}
136
+ >
137
+ ${this.title}
138
+ </summary>
139
+ <div ${ref_js.ref(this._contentRef)}>
140
+ <div class="pt-2 pb-6 px-5 text-sm">
141
+ <slot></slot>
142
+ </div>
143
+ </div>
144
+ </details>`;
145
+ }
146
+ firstUpdated() {
147
+ this._detailsOpen = this.open;
148
+ }
149
+ updated(changedProperties) {
150
+ if (changedProperties.has("open")) {
151
+ this._contentAnimate();
152
+ }
153
+ }
154
+ };
155
+ exports.DaikinAccordionItem.styles = lit.css`
156
+ ${lit.unsafeCSS(tailwind.default)}
157
+
158
+ :host {
159
+ display: block;
160
+ width: 100%;
161
+ }
162
+ `;
163
+ __decorateClass([
164
+ decorators_js.property({ type: String })
165
+ ], exports.DaikinAccordionItem.prototype, "title", 2);
166
+ __decorateClass([
167
+ decorators_js.property({ type: Boolean, reflect: true })
168
+ ], exports.DaikinAccordionItem.prototype, "open", 2);
169
+ __decorateClass([
170
+ decorators_js.property({ type: Boolean, reflect: true })
171
+ ], exports.DaikinAccordionItem.prototype, "disabled", 2);
172
+ __decorateClass([
173
+ decorators_js.state()
174
+ ], exports.DaikinAccordionItem.prototype, "_detailsOpen", 2);
175
+ exports.DaikinAccordionItem = __decorateClass([
176
+ decorators_js.customElement("daikin-accordion-item")
177
+ ], exports.DaikinAccordionItem);
@@ -0,0 +1,56 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+
3
+ /**
4
+ * The accordion item component is a child element within the `daikin-accordion` component.
5
+ * It functions similarly to the HTML `<details>` and `<summary>` tag, allowing users to expand or collapse the associated content by clicking on the header.
6
+ * This component is responsible for displaying the specific content within the accordion and allowing users to interact with each section independently.
7
+ *
8
+ * Hierarchy:
9
+ * - `daikin-accordion` > `daikin-accordion-item`
10
+ *
11
+ * @slot - A slot for the accordion item content.
12
+ *
13
+ * @example
14
+ *
15
+ * ```html
16
+ * <daikin-accordion-item title="The first accordion item">
17
+ * Accordion 1 content.
18
+ * </daikin-accordion-item>
19
+ * ```
20
+ */
21
+ export declare class DaikinAccordionItem extends LitElement {
22
+ static readonly styles: import('lit').CSSResult;
23
+ private _contentRef;
24
+ /**
25
+ * Heading of accordion
26
+ */
27
+ title: string;
28
+ /**
29
+ * Whether the accordion is open
30
+ */
31
+ open: boolean;
32
+ /**
33
+ * Whether the accordion is disabled
34
+ */
35
+ disabled: boolean;
36
+ /**
37
+ * Open attribute of the actual details element
38
+ *
39
+ * The default `open` attribute of the default details element does not allow the display of content to have transitions.
40
+ * To solve this, the `open` property that `daikin-accordion-item` receives manages the opening and closing of items independently of the open attribute.
41
+ *
42
+ * The `open` attribute, which should be present, is taken over by `_detailsOpen`.
43
+ */
44
+ private _detailsOpen;
45
+ private _contentAnimate;
46
+ private _handleSummaryClick;
47
+ render(): import('lit-html').TemplateResult<1>;
48
+ protected firstUpdated(): void;
49
+ protected updated(changedProperties: PropertyValues<this>): void;
50
+ }
51
+ declare global {
52
+ interface HTMLElementTagNameMap {
53
+ "daikin-accordion-item": DaikinAccordionItem;
54
+ }
55
+ }
56
+ export default DaikinAccordionItem;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const daikinAccordionItem = require("./daikin-accordion-item.cjs");
4
+ Object.defineProperty(exports, "DaikinAccordionItem", {
5
+ enumerable: true,
6
+ get: () => daikinAccordionItem.DaikinAccordionItem
7
+ });
@@ -0,0 +1 @@
1
+ export * from './daikin-accordion-item';
@@ -5,6 +5,7 @@ const classVarianceAuthority = require("class-variance-authority");
5
5
  const lit = require("lit");
6
6
  const decorators_js = require("lit/decorators.js");
7
7
  const tailwind = require("../../tailwind.css.cjs");
8
+ require("../icon/daikin-icon.cjs");
8
9
  var __defProp = Object.defineProperty;
9
10
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
11
  var __decorateClass = (decorators, target, key, kind) => {
@@ -15,16 +16,21 @@ var __decorateClass = (decorators, target, key, kind) => {
15
16
  if (kind && result) __defProp(target, key, result);
16
17
  return result;
17
18
  };
19
+ const BUTTON_ICON_SIZE_MAP = {
20
+ default: "m",
21
+ condensed: "s"
22
+ };
18
23
  const cvaButton = classVarianceAuthority.cva(
19
24
  [
20
25
  "inline-flex",
21
26
  "justify-center",
22
27
  "items-center",
28
+ "gap-2",
23
29
  "font-daikinSerif",
24
30
  "font-bold",
25
31
  "rounded-lg",
26
32
  "tracking-wide",
27
- "text-wrap",
33
+ "text-nowrap",
28
34
  "disabled:cursor-default",
29
35
  "w-full",
30
36
  "h-full"
@@ -92,8 +98,8 @@ exports.DaikinButton = class DaikinButton extends lit.LitElement {
92
98
  super(...arguments);
93
99
  this.variant = "primary";
94
100
  this.disabled = false;
95
- this.rightIcon = "";
96
- this.leftIcon = "";
101
+ this.rightIcon = null;
102
+ this.leftIcon = null;
97
103
  this.href = "";
98
104
  this.size = "default";
99
105
  this.type = "button";
@@ -106,12 +112,20 @@ exports.DaikinButton = class DaikinButton extends lit.LitElement {
106
112
  size: this.size
107
113
  });
108
114
  const content = lit.html`
109
- <slot name="leftIcon"></slot>
110
- <span><slot></slot></span>
111
- <slot name="rightIcon"></slot>
115
+ ${this.leftIcon ? lit.html`<daikin-icon
116
+ icon=${this.leftIcon}
117
+ size=${BUTTON_ICON_SIZE_MAP[this.size]}
118
+ color="current"
119
+ ></daikin-icon>` : null}
120
+ <slot></slot>
121
+ ${this.rightIcon ? lit.html`<daikin-icon
122
+ icon=${this.rightIcon}
123
+ size=${BUTTON_ICON_SIZE_MAP[this.size]}
124
+ color="current"
125
+ ></daikin-icon>` : null}
112
126
  `;
113
127
  if (this.href) {
114
- return lit.html` <a
128
+ return lit.html`<a
115
129
  href="${this.href}"
116
130
  class="${buttonClassName}"
117
131
  role="${this.role}"
@@ -130,6 +144,10 @@ exports.DaikinButton = class DaikinButton extends lit.LitElement {
130
144
  </button>
131
145
  `;
132
146
  }
147
+ /**
148
+ * Focuses on the inner button.
149
+ * @param options focus options
150
+ */
133
151
  focus(options) {
134
152
  var _a, _b;
135
153
  (_b = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("button")) == null ? void 0 : _b.focus(options);
@@ -1,6 +1,7 @@
1
1
  import { LitElement } from 'lit';
2
2
  import { ARIARole } from '../../lit-analyzer-types';
3
3
  import { MergeVariantProps } from '../../type-utils';
4
+ import { IconType } from '../icon/daikin-icon';
4
5
 
5
6
  declare const cvaButton: (props?: ({
6
7
  intent?: "primary" | "secondary" | "tertiary" | "primaryDanger" | null | undefined;
@@ -8,7 +9,20 @@ declare const cvaButton: (props?: ({
8
9
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
10
  type ButtonVariantProps = MergeVariantProps<typeof cvaButton>;
10
11
  /**
11
- * Primary UI component for user interaction
12
+ * The button component is a versatile UI element that triggers actions or submits forms when clicked.
13
+ * It functions similarly to the HTML `<button>` tag, allowing users to initiate various operations such as submitting data, opening dialogs, or navigating to different sections of an application.
14
+ *
15
+ * @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,
16
+ *
17
+ * @slot - A slot for the button content.
18
+ *
19
+ * @example
20
+ *
21
+ * ```html
22
+ * <daikin-button>
23
+ * Button label
24
+ * </daikin-button>
25
+ * ```
12
26
  */
13
27
  export declare class DaikinButton extends LitElement {
14
28
  static readonly styles: import('lit').CSSResult;
@@ -23,11 +37,11 @@ export declare class DaikinButton extends LitElement {
23
37
  /**
24
38
  * Set a icon in the right of button label.
25
39
  */
26
- rightIcon: string;
40
+ rightIcon: IconType | null;
27
41
  /**
28
42
  * Set a icon in the left of button label.
29
43
  */
30
- leftIcon: string;
44
+ leftIcon: IconType | null;
31
45
  /**
32
46
  * Link `href`. If present, this button is rendered as `<a>`.
33
47
  */
@@ -49,6 +63,10 @@ export declare class DaikinButton extends LitElement {
49
63
  */
50
64
  isLoading: boolean;
51
65
  render(): import('lit-html').TemplateResult<1>;
66
+ /**
67
+ * Focuses on the inner button.
68
+ * @param options focus options
69
+ */
52
70
  focus(options?: FocusOptions | undefined): void;
53
71
  }
54
72
  declare global {
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const daikinButton = require("./daikin-button.cjs");
4
+ Object.defineProperty(exports, "DaikinButton", {
5
+ enumerable: true,
6
+ get: () => daikinButton.DaikinButton
7
+ });
@@ -9,7 +9,17 @@ declare const cvaLabel: (props?: ({
9
9
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
10
10
  type CheckboxVariantProps = MergeVariantProps<typeof cvaCheckbox | typeof cvaLabel>;
11
11
  /**
12
- * Primary UI component for user interaction
12
+ * The checkbox component is a UI element that allows users to select one or more options from a list of choices.
13
+ * It functions similarly to the HTML `<input type="checkbox">` tag, enabling users to toggle the selection of each option independently.
14
+ * This component is ideal for cases where multiple selections are allowed or required.
15
+ *
16
+ * @fires change - A cloned event of a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) emitted from the inner `<input type="checkbox">` element.
17
+ *
18
+ * @example
19
+ *
20
+ * ```html
21
+ * <daikin-checkbox label="Checkbox label" name="name" value="value"></daikin-checkbox>
22
+ * ```
13
23
  */
14
24
  export declare class DaikinCheckbox extends LitElement {
15
25
  static readonly styles: import('lit').CSSResult;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const daikinCheckbox = require("./daikin-checkbox.cjs");
4
+ Object.defineProperty(exports, "DaikinCheckbox", {
5
+ enumerable: true,
6
+ get: () => daikinCheckbox.DaikinCheckbox
7
+ });
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const variables_js = require("@daikin-oss/dds-tokens/js/daikin/Light/variables.js");
4
+ const classVarianceAuthority = require("class-variance-authority");
5
+ const lit = require("lit");
6
+ const decorators_js = require("lit/decorators.js");
7
+ const tailwind = require("../../tailwind.css.cjs");
8
+ const icons = require("./icons.json.cjs");
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 iconList = Object.keys(icons.icons);
20
+ const iconClassMap = Object.fromEntries(
21
+ Object.entries(icons.icons).map(([name, object]) => [name, object.class])
22
+ );
23
+ const cvaIcon = classVarianceAuthority.cva(["block"], {
24
+ variants: {
25
+ icon: iconClassMap,
26
+ size: {
27
+ s: [`w-[--size-s]`, `h-[--size-s]`],
28
+ m: [`w-[--size-m]`, `h-[--size-m]`],
29
+ l: [`w-[--size-l]`, `h-[--size-l]`],
30
+ xl: [`w-[--size-xl]`, `h-[--size-xl]`]
31
+ },
32
+ color: {
33
+ black: ["text-black"],
34
+ white: ["text-white"],
35
+ default: ["text-[--default-color]"],
36
+ current: []
37
+ // uses `currentColor`
38
+ }
39
+ }
40
+ });
41
+ exports.DaikinIcon = class DaikinIcon extends lit.LitElement {
42
+ constructor() {
43
+ super(...arguments);
44
+ this.icon = null;
45
+ this.color = "default";
46
+ this.size = "m";
47
+ }
48
+ render() {
49
+ var _a;
50
+ const defaultColor = (_a = icons.icons[this.icon ?? ""]) == null ? void 0 : _a.color;
51
+ return lit.html`<span
52
+ class=${cvaIcon({
53
+ icon: this.icon,
54
+ color: this.color,
55
+ size: this.size
56
+ })}
57
+ style=${`--default-color:${defaultColor ?? "#000000"}`}
58
+ role="presentation"
59
+ ></span>`;
60
+ }
61
+ };
62
+ exports.DaikinIcon.styles = lit.css`
63
+ ${lit.unsafeCSS(tailwind.default)}
64
+
65
+ :host {
66
+ --size-s: ${lit.unsafeCSS(variables_js.space12)};
67
+ --size-m: ${lit.unsafeCSS(variables_js.space16)};
68
+ --size-l: ${lit.unsafeCSS(variables_js.space20)};
69
+ --size-xl: ${lit.unsafeCSS(variables_js.space24)};
70
+
71
+ display: block;
72
+ width: max-content;
73
+ }
74
+ `;
75
+ __decorateClass([
76
+ decorators_js.property({ type: String, reflect: true })
77
+ ], exports.DaikinIcon.prototype, "icon", 2);
78
+ __decorateClass([
79
+ decorators_js.property({ type: String, reflect: true })
80
+ ], exports.DaikinIcon.prototype, "color", 2);
81
+ __decorateClass([
82
+ decorators_js.property({ type: String, reflect: true })
83
+ ], exports.DaikinIcon.prototype, "size", 2);
84
+ exports.DaikinIcon = __decorateClass([
85
+ decorators_js.customElement("daikin-icon")
86
+ ], exports.DaikinIcon);
87
+ exports.iconList = iconList;