@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
@@ -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,178 @@
1
+ import { cva } from "class-variance-authority";
2
+ import { css, unsafeCSS, LitElement, html } from "lit";
3
+ import { property, state, customElement } from "lit/decorators.js";
4
+ import { createRef, ref } from "lit/directives/ref.js";
5
+ import tailwindStyles from "../../tailwind.css.js";
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
+ const cvaDetails = cva(
17
+ ["flex", "w-full", "h-max", "bg-white", "font-daikinSerif", "overflow-clip"],
18
+ {
19
+ variants: {
20
+ status: {
21
+ enabled: [],
22
+ disabled: ["text-[#DCDCDC]"]
23
+ }
24
+ }
25
+ }
26
+ );
27
+ const cvaSummary = cva(
28
+ [
29
+ "flex",
30
+ "items-center",
31
+ "w-full",
32
+ "h-12",
33
+ "px-5",
34
+ "outline-none",
35
+ "relative",
36
+ "after:block",
37
+ "after:w-5",
38
+ "after:h-5",
39
+ "after:m-auto",
40
+ "after:top-0",
41
+ "after:right-4",
42
+ "after:bottom-0",
43
+ "after:absolute",
44
+ "after:i-daikin-accordion-chevron-up",
45
+ "after:transition-all"
46
+ ],
47
+ {
48
+ variants: {
49
+ visible: {
50
+ open: ["after:rotate-0"],
51
+ close: ["after:-rotate-180"]
52
+ },
53
+ status: {
54
+ enabled: [
55
+ "hover:bg-[#DCDCDC]",
56
+ "hover:bg-[#DCDCDC]",
57
+ "hover:cursor-pointer",
58
+ "focus-visible:outline",
59
+ "focus-visible:outline-[2px]",
60
+ "focus-visible:outline-[#0097E0]",
61
+ "focus-visible:outline-offset-[-2px]",
62
+ "after:text-[#828282]"
63
+ ],
64
+ disabled: ["text-[#DCDCDC]", "after:text-[#DCDCDC]"]
65
+ }
66
+ }
67
+ }
68
+ );
69
+ const animationOption = {
70
+ duration: 250,
71
+ easing: "ease-in-out"
72
+ };
73
+ const contentCloseKeyframe = {
74
+ height: 0
75
+ };
76
+ const getContentOpenKeyframe = (content) => ({
77
+ height: `${content.offsetHeight}px`
78
+ });
79
+ let DaikinAccordionItem = class extends LitElement {
80
+ constructor() {
81
+ super(...arguments);
82
+ this._contentRef = createRef();
83
+ this.title = "";
84
+ this.open = false;
85
+ this.disabled = false;
86
+ this._detailsOpen = false;
87
+ }
88
+ _contentAnimate() {
89
+ const content = this._contentRef.value;
90
+ if (!content || this.open === this._detailsOpen) {
91
+ return;
92
+ }
93
+ if (this.open) {
94
+ this._detailsOpen = this.open;
95
+ content.animate(
96
+ [contentCloseKeyframe, getContentOpenKeyframe(content)],
97
+ animationOption
98
+ );
99
+ } else {
100
+ const animation = content.animate(
101
+ [getContentOpenKeyframe(content), contentCloseKeyframe],
102
+ animationOption
103
+ );
104
+ animation.onfinish = () => {
105
+ this._detailsOpen = this.open;
106
+ };
107
+ }
108
+ }
109
+ _handleSummaryClick(e) {
110
+ e.preventDefault();
111
+ if (this.disabled) {
112
+ return;
113
+ }
114
+ this.open = !this.open;
115
+ }
116
+ render() {
117
+ const accordionDetailsClassName = cvaDetails({
118
+ status: this.disabled ? "disabled" : "enabled"
119
+ });
120
+ const accordionSummaryClassName = cvaSummary({
121
+ status: this.disabled ? "disabled" : "enabled",
122
+ visible: this.open ? "open" : "close"
123
+ });
124
+ return html`<details
125
+ class=${accordionDetailsClassName}
126
+ ?open=${this._detailsOpen}
127
+ ?data-open=${this.open}
128
+ aria-disabled=${this.disabled}
129
+ >
130
+ <summary
131
+ class=${accordionSummaryClassName}
132
+ tabindex=${this.disabled ? -1 : 0}
133
+ @click=${this._handleSummaryClick}
134
+ >
135
+ ${this.title}
136
+ </summary>
137
+ <div ${ref(this._contentRef)}>
138
+ <div class="pt-2 pb-6 px-5 text-sm">
139
+ <slot></slot>
140
+ </div>
141
+ </div>
142
+ </details>`;
143
+ }
144
+ firstUpdated() {
145
+ this._detailsOpen = this.open;
146
+ }
147
+ updated(changedProperties) {
148
+ if (changedProperties.has("open")) {
149
+ this._contentAnimate();
150
+ }
151
+ }
152
+ };
153
+ DaikinAccordionItem.styles = css`
154
+ ${unsafeCSS(tailwindStyles)}
155
+
156
+ :host {
157
+ display: block;
158
+ width: 100%;
159
+ }
160
+ `;
161
+ __decorateClass([
162
+ property({ type: String })
163
+ ], DaikinAccordionItem.prototype, "title", 2);
164
+ __decorateClass([
165
+ property({ type: Boolean, reflect: true })
166
+ ], DaikinAccordionItem.prototype, "open", 2);
167
+ __decorateClass([
168
+ property({ type: Boolean, reflect: true })
169
+ ], DaikinAccordionItem.prototype, "disabled", 2);
170
+ __decorateClass([
171
+ state()
172
+ ], DaikinAccordionItem.prototype, "_detailsOpen", 2);
173
+ DaikinAccordionItem = __decorateClass([
174
+ customElement("daikin-accordion-item")
175
+ ], DaikinAccordionItem);
176
+ export {
177
+ DaikinAccordionItem
178
+ };
@@ -0,0 +1 @@
1
+ export * from './daikin-accordion-item';
@@ -0,0 +1,4 @@
1
+ import { DaikinAccordionItem } from "./daikin-accordion-item.js";
2
+ export {
3
+ DaikinAccordionItem
4
+ };
@@ -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 {
@@ -3,6 +3,7 @@ import { cva } from "class-variance-authority";
3
3
  import { css, unsafeCSS, LitElement, html } from "lit";
4
4
  import { property, customElement } from "lit/decorators.js";
5
5
  import tailwindStyles from "../../tailwind.css.js";
6
+ import "../icon/daikin-icon.js";
6
7
  var __defProp = Object.defineProperty;
7
8
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
9
  var __decorateClass = (decorators, target, key, kind) => {
@@ -13,16 +14,21 @@ var __decorateClass = (decorators, target, key, kind) => {
13
14
  if (kind && result) __defProp(target, key, result);
14
15
  return result;
15
16
  };
17
+ const BUTTON_ICON_SIZE_MAP = {
18
+ default: "m",
19
+ condensed: "s"
20
+ };
16
21
  const cvaButton = cva(
17
22
  [
18
23
  "inline-flex",
19
24
  "justify-center",
20
25
  "items-center",
26
+ "gap-2",
21
27
  "font-daikinSerif",
22
28
  "font-bold",
23
29
  "rounded-lg",
24
30
  "tracking-wide",
25
- "text-wrap",
31
+ "text-nowrap",
26
32
  "disabled:cursor-default",
27
33
  "w-full",
28
34
  "h-full"
@@ -90,8 +96,8 @@ let DaikinButton = class extends LitElement {
90
96
  super(...arguments);
91
97
  this.variant = "primary";
92
98
  this.disabled = false;
93
- this.rightIcon = "";
94
- this.leftIcon = "";
99
+ this.rightIcon = null;
100
+ this.leftIcon = null;
95
101
  this.href = "";
96
102
  this.size = "default";
97
103
  this.type = "button";
@@ -104,12 +110,20 @@ let DaikinButton = class extends LitElement {
104
110
  size: this.size
105
111
  });
106
112
  const content = html`
107
- <slot name="leftIcon"></slot>
108
- <span><slot></slot></span>
109
- <slot name="rightIcon"></slot>
113
+ ${this.leftIcon ? html`<daikin-icon
114
+ icon=${this.leftIcon}
115
+ size=${BUTTON_ICON_SIZE_MAP[this.size]}
116
+ color="current"
117
+ ></daikin-icon>` : null}
118
+ <slot></slot>
119
+ ${this.rightIcon ? html`<daikin-icon
120
+ icon=${this.rightIcon}
121
+ size=${BUTTON_ICON_SIZE_MAP[this.size]}
122
+ color="current"
123
+ ></daikin-icon>` : null}
110
124
  `;
111
125
  if (this.href) {
112
- return html` <a
126
+ return html`<a
113
127
  href="${this.href}"
114
128
  class="${buttonClassName}"
115
129
  role="${this.role}"
@@ -128,6 +142,10 @@ let DaikinButton = class extends LitElement {
128
142
  </button>
129
143
  `;
130
144
  }
145
+ /**
146
+ * Focuses on the inner button.
147
+ * @param options focus options
148
+ */
131
149
  focus(options) {
132
150
  var _a, _b;
133
151
  (_b = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("button")) == null ? void 0 : _b.focus(options);
@@ -0,0 +1,4 @@
1
+ import { DaikinButton } from "./daikin-button.js";
2
+ export {
3
+ DaikinButton
4
+ };
@@ -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,4 @@
1
+ import { DaikinCheckbox } from "./daikin-checkbox.js";
2
+ export {
3
+ DaikinCheckbox
4
+ };
@@ -0,0 +1,49 @@
1
+ import { LitElement } from 'lit';
2
+ import { MergeVariantProps } from '../../type-utils';
3
+ import { icons } from './icons.json';
4
+
5
+ export declare const iconList: string[];
6
+ export type IconType = keyof typeof icons;
7
+ declare const cvaIcon: (props?: ({
8
+ icon?: string | number | null | undefined;
9
+ size?: "s" | "m" | "l" | "xl" | null | undefined;
10
+ color?: "black" | "white" | "default" | "current" | null | undefined;
11
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
12
+ export type IconVariantProps = MergeVariantProps<typeof cvaIcon>;
13
+ /**
14
+ * The icon component is a versatile UI element used to display small graphical symbols or images that represent actions, objects, or concepts within an application.
15
+ * The icon set is provided by DDS.
16
+ *
17
+ * To use an arbitrary color, specify `"current"` for the `color` property and set the `color` CSS property to the color you want to use.
18
+ *
19
+ * If you try to use an icon that does not exist, a blank space will be displayed.
20
+ * In the development build, warnings will be displayed in the console, so please check there if you encounter any unexpected behavior.
21
+ *
22
+ * @example
23
+ *
24
+ * ```html
25
+ * <daikin-icon icon="information" color="black" size="m"></daikin-icon>
26
+ * ```
27
+ */
28
+ export declare class DaikinIcon extends LitElement {
29
+ static readonly styles: import('lit').CSSResult;
30
+ /**
31
+ * Specify the name of the icon
32
+ */
33
+ icon: IconType | null;
34
+ /**
35
+ * Specify icon color
36
+ */
37
+ color: IconVariantProps["color"];
38
+ /**
39
+ * Specify the height and width of the icon
40
+ */
41
+ size: IconVariantProps["size"];
42
+ render(): import('lit-html').TemplateResult<1>;
43
+ }
44
+ declare global {
45
+ interface HTMLElementTagNameMap {
46
+ "daikin-icon": DaikinIcon;
47
+ }
48
+ }
49
+ export default DaikinIcon;
@@ -0,0 +1,88 @@
1
+ import { space12, space16, space20, space24 } from "@daikin-oss/dds-tokens/js/daikin/Light/variables.js";
2
+ import { cva } from "class-variance-authority";
3
+ import { css, unsafeCSS, LitElement, html } from "lit";
4
+ import { property, customElement } from "lit/decorators.js";
5
+ import tailwindStyles from "../../tailwind.css.js";
6
+ import { icons } from "./icons.json.js";
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __decorateClass = (decorators, target, key, kind) => {
10
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
11
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
+ if (decorator = decorators[i])
13
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
14
+ if (kind && result) __defProp(target, key, result);
15
+ return result;
16
+ };
17
+ const iconList = Object.keys(icons);
18
+ const iconClassMap = Object.fromEntries(
19
+ Object.entries(icons).map(([name, object]) => [name, object.class])
20
+ );
21
+ const cvaIcon = cva(["block"], {
22
+ variants: {
23
+ icon: iconClassMap,
24
+ size: {
25
+ s: [`w-[--size-s]`, `h-[--size-s]`],
26
+ m: [`w-[--size-m]`, `h-[--size-m]`],
27
+ l: [`w-[--size-l]`, `h-[--size-l]`],
28
+ xl: [`w-[--size-xl]`, `h-[--size-xl]`]
29
+ },
30
+ color: {
31
+ black: ["text-black"],
32
+ white: ["text-white"],
33
+ default: ["text-[--default-color]"],
34
+ current: []
35
+ // uses `currentColor`
36
+ }
37
+ }
38
+ });
39
+ let DaikinIcon = class extends LitElement {
40
+ constructor() {
41
+ super(...arguments);
42
+ this.icon = null;
43
+ this.color = "default";
44
+ this.size = "m";
45
+ }
46
+ render() {
47
+ var _a;
48
+ const defaultColor = (_a = icons[this.icon ?? ""]) == null ? void 0 : _a.color;
49
+ return html`<span
50
+ class=${cvaIcon({
51
+ icon: this.icon,
52
+ color: this.color,
53
+ size: this.size
54
+ })}
55
+ style=${`--default-color:${defaultColor ?? "#000000"}`}
56
+ role="presentation"
57
+ ></span>`;
58
+ }
59
+ };
60
+ DaikinIcon.styles = css`
61
+ ${unsafeCSS(tailwindStyles)}
62
+
63
+ :host {
64
+ --size-s: ${unsafeCSS(space12)};
65
+ --size-m: ${unsafeCSS(space16)};
66
+ --size-l: ${unsafeCSS(space20)};
67
+ --size-xl: ${unsafeCSS(space24)};
68
+
69
+ display: block;
70
+ width: max-content;
71
+ }
72
+ `;
73
+ __decorateClass([
74
+ property({ type: String, reflect: true })
75
+ ], DaikinIcon.prototype, "icon", 2);
76
+ __decorateClass([
77
+ property({ type: String, reflect: true })
78
+ ], DaikinIcon.prototype, "color", 2);
79
+ __decorateClass([
80
+ property({ type: String, reflect: true })
81
+ ], DaikinIcon.prototype, "size", 2);
82
+ DaikinIcon = __decorateClass([
83
+ customElement("daikin-icon")
84
+ ], DaikinIcon);
85
+ export {
86
+ DaikinIcon,
87
+ iconList
88
+ };
@@ -0,0 +1,31 @@
1
+ declare const _default: {
2
+ "icons": {
3
+ "alarm": {
4
+ "class": "i-daikin-notification-status-alarm",
5
+ "color": null
6
+ },
7
+ "close": {
8
+ "class": "i-daikin-notification-close",
9
+ "color": "#a0a0a0"
10
+ },
11
+ "information": {
12
+ "class": "i-daikin-notification-status-information",
13
+ "color": null
14
+ },
15
+ "negative": {
16
+ "class": "i-daikin-notification-status-negative",
17
+ "color": null
18
+ },
19
+ "positive": {
20
+ "class": "i-daikin-notification-status-positive",
21
+ "color": null
22
+ },
23
+ "warning": {
24
+ "class": "i-daikin-notification-status-warning",
25
+ "color": null
26
+ }
27
+ }
28
+ }
29
+ ;
30
+
31
+ export default _default;
@@ -0,0 +1,29 @@
1
+ const icons = {
2
+ alarm: {
3
+ "class": "i-daikin-notification-status-alarm",
4
+ color: null
5
+ },
6
+ close: {
7
+ "class": "i-daikin-notification-close",
8
+ color: "#a0a0a0"
9
+ },
10
+ information: {
11
+ "class": "i-daikin-notification-status-information",
12
+ color: null
13
+ },
14
+ negative: {
15
+ "class": "i-daikin-notification-status-negative",
16
+ color: null
17
+ },
18
+ positive: {
19
+ "class": "i-daikin-notification-status-positive",
20
+ color: null
21
+ },
22
+ warning: {
23
+ "class": "i-daikin-notification-status-warning",
24
+ color: null
25
+ }
26
+ };
27
+ export {
28
+ icons
29
+ };
@@ -0,0 +1 @@
1
+ export * from './daikin-icon';
@@ -0,0 +1,5 @@
1
+ import { DaikinIcon, iconList } from "./daikin-icon.js";
2
+ export {
3
+ DaikinIcon,
4
+ iconList
5
+ };
@@ -1,7 +1,14 @@
1
+ export * from './accordion';
2
+ export * from './accordion-item';
1
3
  export * from './button';
2
4
  export * from './checkbox';
5
+ export * from './icon';
3
6
  export * from './input-group';
4
7
  export * from './notification';
8
+ export * from './panel-switcher';
5
9
  export * from './radio';
10
+ export * from './tab';
11
+ export * from './tab-group';
6
12
  export * from './text-input';
7
13
  export * from './textarea';
14
+ export * from './toggle';
@@ -0,0 +1,31 @@
1
+ import { DaikinAccordion } from "./accordion/daikin-accordion.js";
2
+ import { DaikinAccordionItem } from "./accordion-item/daikin-accordion-item.js";
3
+ import { DaikinButton } from "./button/daikin-button.js";
4
+ import { DaikinCheckbox } from "./checkbox/daikin-checkbox.js";
5
+ import { DaikinIcon, iconList } from "./icon/daikin-icon.js";
6
+ import { DaikinInputGroup } from "./input-group/daikin-input-group.js";
7
+ import { DaikinNotification } from "./notification/daikin-notification.js";
8
+ import { DaikinPanelSwitcher } from "./panel-switcher/daikin-panel-switcher.js";
9
+ import { DaikinRadio } from "./radio/daikin-radio.js";
10
+ import { DaikinTab } from "./tab/daikin-tab.js";
11
+ import { DaikinTabGroup } from "./tab-group/daikin-tab-group.js";
12
+ import { DaikinTextInput } from "./text-input/daikin-text-input.js";
13
+ import { DaikinTextarea } from "./textarea/daikin-textarea.js";
14
+ import { DaikinToggle } from "./toggle/daikin-toggle.js";
15
+ export {
16
+ DaikinAccordion,
17
+ DaikinAccordionItem,
18
+ DaikinButton,
19
+ DaikinCheckbox,
20
+ DaikinIcon,
21
+ DaikinInputGroup,
22
+ DaikinNotification,
23
+ DaikinPanelSwitcher,
24
+ DaikinRadio,
25
+ DaikinTab,
26
+ DaikinTabGroup,
27
+ DaikinTextInput,
28
+ DaikinTextarea,
29
+ DaikinToggle,
30
+ iconList
31
+ };