@ilo-org/twig 0.17.0 → 0.17.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 (237) hide show
  1. package/dist/components/accordion/accordion.behavior.js +1 -0
  2. package/dist/components/accordion/accordion.css +1 -0
  3. package/dist/components/accordion/accordion.twig +16 -0
  4. package/dist/components/accordion/accordion.wingsuit.yml +77 -0
  5. package/dist/components/accordion-item/accordion-item.twig +22 -0
  6. package/dist/components/breadcrumb/breadcrumb.behavior.js +1 -0
  7. package/dist/components/breadcrumb/breadcrumb.css +1 -0
  8. package/dist/components/breadcrumb/breadcrumb.twig +43 -0
  9. package/dist/components/breadcrumb/breadcrumb.wingsuit.yml +36 -0
  10. package/dist/components/button/button.css +1 -0
  11. package/dist/components/button/button.twig +23 -0
  12. package/dist/components/button/button.wingsuit.yml +114 -0
  13. package/dist/components/callout/callout.behavior.js +1 -0
  14. package/dist/components/callout/callout.css +1 -0
  15. package/dist/components/callout/callout.twig +41 -0
  16. package/dist/components/callout/callout.wingsuit.yml +72 -0
  17. package/dist/components/card/card.css +1 -0
  18. package/dist/components/card/card.twig +24 -0
  19. package/dist/components/card/card.wingsuit.yml +227 -0
  20. package/dist/components/card_data/card_data.twig +101 -0
  21. package/dist/components/card_data/card_data.wingsuit.yml +135 -0
  22. package/dist/components/card_detail/card_detail.twig +37 -0
  23. package/dist/components/card_detail/card_detail.wingsuit.yml +71 -0
  24. package/dist/components/card_factlist/card_factlist.twig +21 -0
  25. package/dist/components/card_factlist/card_factlist.wingsuit.yml +46 -0
  26. package/dist/components/card_feature/card_feature.twig +39 -0
  27. package/dist/components/card_feature/card_feature.wingsuit.yml +80 -0
  28. package/dist/components/card_multilink/card_multilink.twig +45 -0
  29. package/dist/components/card_multilink/card_multilink.wingsuit.yml +91 -0
  30. package/dist/components/card_promo/card_promo.twig +35 -0
  31. package/dist/components/card_promo/card_promo.wingsuit.yml +71 -0
  32. package/dist/components/card_stat/card_stat.twig +24 -0
  33. package/dist/components/card_stat/card_stat.wingsuit.yml +44 -0
  34. package/dist/components/card_text/card_text.twig +35 -0
  35. package/dist/components/card_text/card_text.wingsuit.yml +57 -0
  36. package/dist/components/cardgroup/cardgroup.css +1 -0
  37. package/dist/components/cardgroup/cardgroup.twig +46 -0
  38. package/dist/components/cardgroup/cardgroup.wingsuit.yml +158 -0
  39. package/dist/components/checkbox/checkbox.css +1 -0
  40. package/dist/components/checkbox/checkbox.twig +17 -0
  41. package/dist/components/checkbox/checkbox.wingsuit.yml +83 -0
  42. package/dist/components/container/container.css +1 -0
  43. package/dist/components/contextmenu/contextmenu.css +1 -0
  44. package/dist/components/contextmenu/contextmenu.twig +12 -0
  45. package/dist/components/contextmenu/contextmenu.wingsuit.yml +24 -0
  46. package/dist/components/credit/credit.css +1 -0
  47. package/dist/components/datacard/datacard.css +1 -0
  48. package/dist/components/datepicker/datepicker.css +1 -0
  49. package/dist/components/datepicker/datepicker.twig +20 -0
  50. package/dist/components/datepicker/datepicker.wingsuit.yml +72 -0
  51. package/dist/components/detailcard/detailcard.css +1 -0
  52. package/dist/components/dropdown/dropdown.css +1 -0
  53. package/dist/components/dropdown/dropdown.twig +22 -0
  54. package/dist/components/dropdown/dropdown.wingsuit.yml +100 -0
  55. package/dist/components/empty/empty.css +1 -0
  56. package/dist/components/factlistcard/factlistcard.css +1 -0
  57. package/dist/components/featurecard/featurecard.css +1 -0
  58. package/dist/components/fieldset/fieldset.css +1 -0
  59. package/dist/components/fieldset/fieldset.twig +70 -0
  60. package/dist/components/file-upload/file-upload.css +1 -0
  61. package/dist/components/fileupload/fileupload.behavior.js +1 -0
  62. package/dist/components/fileupload/fileupload.twig +20 -0
  63. package/dist/components/fileupload/fileupload.wingsuit.yml +94 -0
  64. package/dist/components/footer/footer.css +1 -0
  65. package/dist/components/footer/footer.twig +63 -0
  66. package/dist/components/footer/footer.wingsuit.yml +106 -0
  67. package/dist/components/form/form.css +1 -0
  68. package/dist/components/form/form.twig +19 -0
  69. package/dist/components/form/form.wingsuit.yml +205 -0
  70. package/dist/components/formcontrol/formcontrol.css +1 -0
  71. package/dist/components/formcontrol/formcontrol.twig +89 -0
  72. package/dist/components/heading/heading.css +1 -0
  73. package/dist/components/hero/hero.css +1 -0
  74. package/dist/components/hero/hero.twig +65 -0
  75. package/dist/components/hero/hero.wingsuit.yml +182 -0
  76. package/dist/components/herocard/herocard.css +1 -0
  77. package/dist/components/herocard/herocard.twig +30 -0
  78. package/dist/components/herocard/herocard.wingsuit.yml +71 -0
  79. package/dist/components/icon/icon.behavior.js +1 -0
  80. package/dist/components/icon/icon.css +1 -0
  81. package/dist/components/icon/icon.twig +4 -0
  82. package/dist/components/icon/icon.wingsuit.yml +29 -0
  83. package/dist/components/image/image.css +1 -0
  84. package/dist/components/image/image.twig +29 -0
  85. package/dist/components/image/image.wingsuit.yml +57 -0
  86. package/dist/components/input/input.css +1 -0
  87. package/dist/components/input/input.twig +10 -0
  88. package/dist/components/link/link.css +1 -0
  89. package/dist/components/link/link.twig +8 -0
  90. package/dist/components/link/link.wingsuit.yml +36 -0
  91. package/dist/components/linklist/linklist.behavior.js +1 -0
  92. package/dist/components/linklist/linklist.css +1 -0
  93. package/dist/components/linklist/linklist.twig +26 -0
  94. package/dist/components/linklist/linklist.wingsuit.yml +55 -0
  95. package/dist/components/list/list.css +1 -0
  96. package/dist/components/list/list.twig +35 -0
  97. package/dist/components/list/list.wingsuit.yml +60 -0
  98. package/dist/components/list-item/list-item.twig +6 -0
  99. package/dist/components/list-item/list-item.wingsuit.yml +19 -0
  100. package/dist/components/loading/loading.behavior.js +1 -0
  101. package/dist/components/loading/loading.css +1 -0
  102. package/dist/components/loading/loading.twig +8 -0
  103. package/dist/components/loading/loading.wingsuit.yml +39 -0
  104. package/dist/components/localnav/localnav.twig +86 -0
  105. package/dist/components/localnav/localnav.wingsuit.yml +88 -0
  106. package/dist/components/logo/logo.css +1 -0
  107. package/dist/components/logogrid/logogrid.css +1 -0
  108. package/dist/components/logogrid/logogrid.twig +17 -0
  109. package/dist/components/logogrid/logogrid.wingsuit.yml +45 -0
  110. package/dist/components/modal/modal.behavior.js +1 -0
  111. package/dist/components/modal/modal.css +1 -0
  112. package/dist/components/modal/modal.twig +20 -0
  113. package/dist/components/modal/modal.wingsuit.yml +61 -0
  114. package/dist/components/multilinkcard/multilinkcard.css +1 -0
  115. package/dist/components/navigation/navigation.behavior.js +1 -0
  116. package/dist/components/navigation/navigation.css +1 -0
  117. package/dist/components/navigation/navigation.twig +171 -0
  118. package/dist/components/navigation/navigation.wingsuit.yml +126 -0
  119. package/dist/components/notification/notification.behavior.js +1 -0
  120. package/dist/components/notification/notification.css +1 -0
  121. package/dist/components/notification/notification.twig +18 -0
  122. package/dist/components/notification/notification.wingsuit.yml +59 -0
  123. package/dist/components/numberpicker/numberpicker.twig +16 -0
  124. package/dist/components/numberpicker/numberpicker.wingsuit.yml +91 -0
  125. package/dist/components/pagination/pagination.css +1 -0
  126. package/dist/components/pagination/pagination.twig +49 -0
  127. package/dist/components/pagination/pagination.wingsuit.yml +75 -0
  128. package/dist/components/picture/picture.twig +21 -0
  129. package/dist/components/polyfill/polyfill.twig +10 -0
  130. package/dist/components/profile/profile.css +1 -0
  131. package/dist/components/profile/profile.twig +26 -0
  132. package/dist/components/profile/profile.wingsuit.yml +46 -0
  133. package/dist/components/promocard/promocard.css +1 -0
  134. package/dist/components/radio/radio.css +1 -0
  135. package/dist/components/radio/radio.twig +23 -0
  136. package/dist/components/radio/radio.wingsuit.yml +83 -0
  137. package/dist/components/readmore/readmore.behavior.js +1 -0
  138. package/dist/components/readmore/readmore.css +1 -0
  139. package/dist/components/readmore/readmore.twig +16 -0
  140. package/dist/components/readmore/readmore.wingsuit.yml +37 -0
  141. package/dist/components/richtext/richtext.css +1 -0
  142. package/dist/components/richtext/richtext.twig +6 -0
  143. package/dist/components/richtext/richtext.wingsuit.yml +13 -0
  144. package/dist/components/search/search.behavior.js +1 -0
  145. package/dist/components/search/search.twig +31 -0
  146. package/dist/components/search/search.wingsuit.yml +89 -0
  147. package/dist/components/searchfield/searchfield.css +1 -0
  148. package/dist/components/socialmedia/socialmedia.css +1 -0
  149. package/dist/components/socialmedia/socialmedia.twig +17 -0
  150. package/dist/components/socialmedia/socialmedia.wingsuit.yml +59 -0
  151. package/dist/components/statcard/statcard.css +1 -0
  152. package/dist/components/table/table.behavior.js +1 -0
  153. package/dist/components/table/table.css +1 -0
  154. package/dist/components/table/table.twig +39 -0
  155. package/dist/components/table/table.wingsuit.yml +112 -0
  156. package/dist/components/tableofcontents/tableofcontents.behavior.js +1 -0
  157. package/dist/components/tableofcontents/tableofcontents.css +1 -0
  158. package/dist/components/tableofcontents/tableofcontents.twig +47 -0
  159. package/dist/components/tableofcontents/tableofcontents.wingsuit.yml +44 -0
  160. package/dist/components/tabs/tabs.behavior.js +1 -0
  161. package/dist/components/tabs/tabs.css +1 -0
  162. package/dist/components/tabs/tabs.twig +26 -0
  163. package/dist/components/tabs/tabs.wingsuit.yml +169 -0
  164. package/dist/components/tag/tag.behavior.js +1 -0
  165. package/dist/components/tag/tag.css +1 -0
  166. package/dist/components/tag/tag.twig +30 -0
  167. package/dist/components/tag/tag.wingsuit.yml +43 -0
  168. package/dist/components/tags/tags.twig +15 -0
  169. package/dist/components/tags/tags.wingsuit.yml +45 -0
  170. package/dist/components/textarea/textarea.css +1 -0
  171. package/dist/components/textarea/textarea.twig +14 -0
  172. package/dist/components/textarea/textarea.wingsuit.yml +126 -0
  173. package/dist/components/textcard/textcard.css +1 -0
  174. package/dist/components/textinput/textinput.css +1 -0
  175. package/dist/components/textinput/textinput.twig +14 -0
  176. package/dist/components/textinput/textinput.wingsuit.yml +86 -0
  177. package/dist/components/toggle/toggle.css +1 -0
  178. package/dist/components/toggle/toggle.twig +36 -0
  179. package/dist/components/toggle/toggle.wingsuit.yml +94 -0
  180. package/dist/components/tooltip/tooltip.behavior.js +1 -0
  181. package/dist/components/tooltip/tooltip.css +1 -0
  182. package/dist/components/tooltip/tooltip.twig +14 -0
  183. package/dist/components/tooltip/tooltip.wingsuit.yml +53 -0
  184. package/dist/components/video/video.behavior.js +16 -0
  185. package/dist/components/video/video.css +1 -0
  186. package/dist/components/video/video.twig +18 -0
  187. package/dist/components/video/video.wingsuit.yml +82 -0
  188. package/dist/components/videoplayer/videoplayer.twig +8 -0
  189. package/dist/global/styles.css +2 -0
  190. package/package.json +13 -9
  191. package/.browserslistrc +0 -4
  192. package/.eslintrc.js +0 -25
  193. package/.stylelintignore +0 -9
  194. package/.stylelintrc +0 -19
  195. package/.turbo/turbo-build:lib.log +0 -71
  196. package/CHANGELOG.md +0 -1036
  197. package/apps/storybook/assets.js +0 -10
  198. package/apps/storybook/main.js +0 -27
  199. package/apps/storybook/manager-head.html +0 -92
  200. package/apps/storybook/manager.js +0 -7
  201. package/apps/storybook/patterns/colors.stories.mdx +0 -23
  202. package/apps/storybook/patterns/intro.stories.mdx +0 -184
  203. package/apps/storybook/patterns/typeset.stories.mdx +0 -32
  204. package/apps/storybook/patterns/welcome.stories.mdx +0 -33
  205. package/apps/storybook/preview-body.html +0 -4
  206. package/apps/storybook/preview-head.html +0 -5
  207. package/apps/storybook/preview.js +0 -36
  208. package/apps/storybook/styles.scss +0 -25
  209. package/apps/storybook/theme.js +0 -46
  210. package/apps/storybook/welcome.scss +0 -131
  211. package/babel.config.js +0 -16
  212. package/copystyles.js +0 -16
  213. package/copytemplates.js +0 -27
  214. package/images/fao-logo.svg +0 -195
  215. package/images/favicon.ico +0 -0
  216. package/images/hero.jpg +0 -0
  217. package/images/ilo-dg.jpg +0 -0
  218. package/images/ilo-headquarters.jpg +0 -0
  219. package/images/large.jpg +0 -0
  220. package/images/logo_en_horizontal_blue.svg +0 -893
  221. package/images/media-file-poster.jpg +0 -0
  222. package/images/medium.jpg +0 -0
  223. package/images/publication.jpg +0 -0
  224. package/images/small.jpg +0 -0
  225. package/images/twig.svg +0 -6
  226. package/images/unhcr-logo.svg +0 -1
  227. package/images/unicef-logo.png +0 -0
  228. package/images/video-example.mp4 +0 -0
  229. package/images/wfp-logo.svg +0 -1
  230. package/images/who-logo.svg +0 -1
  231. package/images/youtube-video-poster.avif +0 -0
  232. package/importprefix.js +0 -20
  233. package/importsvgs.js +0 -5
  234. package/jest.config.js +0 -18
  235. package/postcss.config.js +0 -6
  236. package/rollup.config.js +0 -31
  237. package/wingsuit.config.js +0 -28
@@ -0,0 +1,169 @@
1
+ tabs:
2
+ namespace: Components/User Interface
3
+ use: "@components/tabs/tabs.twig"
4
+ label: Tabs
5
+ description: The Tabs component displays content that is subdivided into sections, providing an interface for toggling visually between sections
6
+ fields:
7
+ items:
8
+ type: object
9
+ label: Items
10
+ description: The items and labels for each tab
11
+ preview:
12
+ - label: "Tab Label With A Really Really Lenghty Title Even Though We Do Not Recommend Such A Lengthy Title"
13
+ component: "image"
14
+ componentdata:
15
+ alt: "My alt text"
16
+ caption: "Women construction workers in Nepal build roads and bridges as part of a National Rural Transport Programme co-sponsored by the ILO."
17
+ credit: "© Marcel Crozet/ILO"
18
+ url:
19
+ - breakpoint: 0
20
+ src: "/images/small.jpg"
21
+ - breakpoint: 800
22
+ src: "/images/medium.jpg"
23
+ - breakpoint: 1200
24
+ src: "/images/large.jpg"
25
+ - breakpoint: 1440
26
+ src: "/images/large.jpg"
27
+ - label: "Tab Label 2"
28
+ component: "richtext"
29
+ componentdata:
30
+ content: "<h2>International Labour Organization</h2> <p>The <b>International Labour Organization</b> (<b>ILO</b>) is a <a href='https://www.un.org'>United Nations</a> agency whose mandate is to advance social and economic justice by setting international labour standards. Founded in October 1919 under the League of Nations, it is the first and oldest specialised agency of the UN. The ILO has 187 member states: 186 out of 193 UN member states plus the Cook Islands.</p> <p>Whereas also the failure of any nation to adopt humane conditions of labour is an obstacle in the way of other nations which desire to improve the conditions in their own countries.</p> <figure><img alt='placeholder image' class='right' src='/images/ilo-headquarters.jpg'><figcaption>The ILO's headquarters in Geneva, Switzerland. ©Steiner SA</figcaption></figure> <h3>ILO Constitution</h3> <p>The driving forces for the ILO's creation arose from security, humanitarian, political and economic considerations.</p> <blockquote> <p>The fundamental ideas that forged the ILO one hundred and three years ago still underpin the global pledge to leave no one behind.</p> <cite>ILO Director-General Gilbert F. Houngbo</cite> </blockquote> Reflecting these ideas, the Preamble of the ILO Constitution states:</p> <ol> <li>Whereas universal and lasting peace can be established only if it is based upon social justice;</li> <li>And whereas conditions of labour exist involving such injustice, hardship and privation to large numbers of people as to produce unrest so great that the peace and harmony of the world are imperilled; and an improvement of those conditions is urgently required;</li> <li>Whereas also the failure of any nation to adopt humane conditions of labour is an obstacle in the way of other nations which desire to improve the conditions in their own countries.</li> </ol>"
31
+ required: true
32
+ variants:
33
+ default:
34
+ label: Default
35
+ description: the default settings for the Tabs
36
+ withicon:
37
+ label: With Icon
38
+ description: Tabs with Icons
39
+ fields:
40
+ items:
41
+ - label: "Tab One"
42
+ component: "image"
43
+ componentdata:
44
+ alt: "My alt text"
45
+ caption: "my image caption"
46
+ credit: "Photo: copyright 2022 Person S. Name"
47
+ url:
48
+ - breakpoint: 0
49
+ src: "https://place-hold.it/400x300?text=Tab One Image"
50
+ - breakpoint: 800
51
+ src: "https://place-hold.it/800x600?text=Tab One tImage"
52
+ - breakpoint: 1200
53
+ src: "https://place-hold.it/1200x900?text=Tab One Image"
54
+ - breakpoint: 1440
55
+ src: "https://place-hold.it/1600x1200?text=Tab One Image"
56
+ icon: error
57
+ - label: "Tab Two"
58
+ component: "image"
59
+ componentdata:
60
+ alt: "My alt text"
61
+ caption: "my image caption"
62
+ credit: "Photo: copyright 2022 Person S. Name"
63
+ url:
64
+ - breakpoint: 0
65
+ src: "https://place-hold.it/400x300?text=Tab Two Image"
66
+ - breakpoint: 800
67
+ src: "https://place-hold.it/800x600?text=Tab Two Image"
68
+ - breakpoint: 1200
69
+ src: "https://place-hold.it/1200x900?text=Tab Two Image"
70
+ - breakpoint: 1440
71
+ src: "https://place-hold.it/1600x1200?text=Tab Two Image"
72
+ icon: error
73
+ - label: "Tab Three"
74
+ component: "image"
75
+ componentdata:
76
+ alt: "My alt text"
77
+ caption: "my image caption"
78
+ credit: "Photo: copyright 2022 Person S. Name"
79
+ url:
80
+ - breakpoint: 0
81
+ src: "https://place-hold.it/400x300?text=Tab Three Image"
82
+ - breakpoint: 800
83
+ src: "https://place-hold.it/800x600?text=Tab Three Image"
84
+ - breakpoint: 1200
85
+ src: "https://place-hold.it/1200x900?text=Tab Three Image"
86
+ - breakpoint: 1440
87
+ src: "https://place-hold.it/1600x1200?text=Tab Three Image"
88
+ icon: error
89
+ fiveitems:
90
+ label: Five Items
91
+ description: Tab component with five items
92
+ fields:
93
+ items:
94
+ - label: "Tab One"
95
+ component: "image"
96
+ componentdata:
97
+ alt: "My alt text"
98
+ caption: "my image caption"
99
+ credit: "Photo: copyright 2022 Person S. Name"
100
+ url:
101
+ - breakpoint: 0
102
+ src: "https://place-hold.it/400x300?text=Tab One Image"
103
+ - breakpoint: 800
104
+ src: "https://place-hold.it/800x600?text=Tab One tImage"
105
+ - breakpoint: 1200
106
+ src: "https://place-hold.it/1200x900?text=Tab One Image"
107
+ - breakpoint: 1440
108
+ src: "https://place-hold.it/1600x1200?text=Tab One Image"
109
+ - label: "Tab Two"
110
+ component: "image"
111
+ componentdata:
112
+ alt: "My alt text"
113
+ caption: "my image caption"
114
+ credit: "Photo: copyright 2022 Person S. Name"
115
+ url:
116
+ - breakpoint: 0
117
+ src: "https://place-hold.it/400x300?text=Tab Two Image"
118
+ - breakpoint: 800
119
+ src: "https://place-hold.it/800x600?text=Tab Two Image"
120
+ - breakpoint: 1200
121
+ src: "https://place-hold.it/1200x900?text=Tab Two Image"
122
+ - breakpoint: 1440
123
+ src: "https://place-hold.it/1600x1200?text=Tab Two Image"
124
+ - label: "Tab Three"
125
+ component: "image"
126
+ componentdata:
127
+ alt: "My alt text"
128
+ caption: "my image caption"
129
+ credit: "Photo: copyright 2022 Person S. Name"
130
+ url:
131
+ - breakpoint: 0
132
+ src: "https://place-hold.it/400x300?text=Tab Three Image"
133
+ - breakpoint: 800
134
+ src: "https://place-hold.it/800x600?text=Tab Three Image"
135
+ - breakpoint: 1200
136
+ src: "https://place-hold.it/1200x900?text=Tab Three Image"
137
+ - breakpoint: 1440
138
+ src: "https://place-hold.it/1600x1200?text=Tab Three Image"
139
+ - label: "Tab Four Has A Really Lenghthy Title Which Might Get Truncated"
140
+ component: "image"
141
+ componentdata:
142
+ alt: "My alt text"
143
+ caption: "my image caption"
144
+ credit: "Photo: copyright 2022 Person S. Name"
145
+ url:
146
+ - breakpoint: 0
147
+ src: "https://place-hold.it/400x300?text=Tab Four Image"
148
+ - breakpoint: 800
149
+ src: "https://place-hold.it/800x600?text=Tab Four Image"
150
+ - breakpoint: 1200
151
+ src: "https://place-hold.it/1200x900?text=Tab Four Image"
152
+ - breakpoint: 1440
153
+ src: "https://place-hold.it/1600x1200?text=Tab Four Image"
154
+ - label: "Tab Five"
155
+ component: "image"
156
+ componentdata:
157
+ alt: "My alt text"
158
+ caption: "my image caption"
159
+ credit: "Photo: copyright 2022 Person S. Name"
160
+ url:
161
+ - breakpoint: 0
162
+ src: "https://place-hold.it/400x300?text=Tab Five Image"
163
+ - breakpoint: 800
164
+ src: "https://place-hold.it/800x600?text=Tab Five Image"
165
+ - breakpoint: 1200
166
+ src: "https://place-hold.it/1200x900?text=Tab Five Image"
167
+ - breakpoint: 1440
168
+ src: "https://place-hold.it/1600x1200?text=Tab Five Image"
169
+ visibility: storybook
@@ -0,0 +1 @@
1
+ !function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function e(e,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,t(r.key),r)}}function i(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function r(t){var e=i(t.itemStatuses);return e.indexOf(t.id)>-1?e=e.filter((function(e){return e!==t.id})):t.allowMultipleExpanded?e.push(t.id):e=[t.id],e}var a="click",o=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.element=e,this.multipleActive=!0,this.itemStatuses=[],this.init()},(i=[{key:"init",value:function(){return this.cacheDomReferences().setupHandlers().enable(),this}},{key:"cacheDomReferences",value:function(){var t=this;return this.buttonTags=this.element.querySelectorAll(".ilo--tag--button"),this.multipleActive=this.element.getAttribute("data-multipleactive"),this.buttonTags.forEach((function(e,i){var n=e.dataset.active,a=t.buttonTags[i].getAttribute("id");"true"===n&&(t.itemStatuses=r({id:a,itemStatuses:t.itemStatuses,allowMultipleActive:t.multipleActive}))})),this}},{key:"setupHandlers",value:function(){return this.onClick=this.onClick.bind(this),this.updateTagItems=this.updateTagItems.bind(this),this}},{key:"enable",value:function(){var t=this;return this.buttonTags.length>0&&this.buttonTags.forEach((function(e,i){e.addEventListener(a,(function(){return t.onClick(i)}))})),this}},{key:"onClick",value:function(t){var e=this.buttonTags[t].getAttribute("id");return this.itemStatuses=r({id:e,itemStatuses:this.itemStatuses,allowMultipleacmultipleActive:this.multipleActive}),this.removeParentDom(e),this}},{key:"removeParentDom",value:function(t){var e=document.getElementById(t);return e&&e.parentElement.remove(),this}},{key:"updateTagItems",value:function(){var t=this;return this.tags.forEach((function(e,i){var n=e.getAttribute("id");t.itemStatuses.indexOf(n)>-1?(t.tags[i].classList.add("ilo--tag--active"),t.tags[i].setAttribute("data-active","true")):(t.tags[i].classList.remove("ilo--tag--active"),t.tags[i].setAttribute("data-active","true"))})),this}}])&&e(t.prototype,i),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,i,n}();Drupal.behaviors.tag={attach:function(){Array.prototype.forEach.call(document.querySelectorAll('[data-loadcomponent="Tag"]'),(function(t){t.dataset.jsProcessed||(new o(t),t.dataset.jsProcessed=!0)}))}}}));
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.ilo--tag-set{list-style:none}.ilo--tag-set__item{display:inline-block;margin:.2143622722rem}.ilo--tag{font-size:14.93px;letter-spacing:-.02em;line-height:20.16px;background:#edf0f2;border:none;color:#6d6d6d;display:inline-block;font-family:Overpass,Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-weight:500;padding:.4287245445rem .6430868167rem;text-decoration:none;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out;max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ilo--tag--active{background:#edf0f2;color:#230050;outline:0}.ilo--tag--anchor{cursor:unset;pointer-events:none}.ilo--tag--anchor.ilo--tag--active{background:#edf0f2;color:#230050;cursor:pointer;outline:0}.ilo--tag--anchor.ilo--tag--active:hover{text-decoration:none}.ilo--tag--anchor.ilo--tag--active:focus,.ilo--tag--anchor.ilo--tag--active:hover{background:#ebf5fd;color:#1e2dbe;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--tag--anchor.ilo--tag--active:focus{outline:0}.ilo--tag--anchor.ilo--tag--active.ilo--tag--active{pointer-events:auto}.ilo--tag--button{font-size:14.93px;letter-spacing:-.02em;line-height:20.16px;cursor:pointer;display:none;opacity:0;padding-right:1.9292604502rem;position:relative;visibility:hidden}.ilo--tag--button.ilo--tag--active{background:#edf0f2;color:#230050;display:block;opacity:1;outline:0;visibility:visible;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--tag--button.icon__position--right .ilo--icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23230050' d='M16.95 15.536L13.414 12l3.536-3.535-1.414-1.415L12 10.586 8.464 7.05 7.05 8.465 10.586 12 7.05 15.536l1.414 1.414L12 13.414l3.536 3.536 1.414-1.414z'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:contain;height:100%;max-height:24px;max-width:24px;position:absolute;right:10px;top:50%;transform:translateY(-50%);width:100%}.ilo--tag--button:hover{background:#ebf5fd;color:#1e2dbe;text-decoration:none;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--tag--button:hover.icon__position--right .ilo--icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231E2DBE' d='M16.95 15.536L13.414 12l3.536-3.535-1.414-1.415L12 10.586 8.464 7.05 7.05 8.465 10.586 12 7.05 15.536l1.414 1.414L12 13.414l3.536 3.536 1.414-1.414z'/%3E%3C/svg%3E")}.ilo--tag--button:focus{background:#ebf5fd;color:#1e2dbe;outline:0}.ilo--tag--reset{font-size:14.93px;letter-spacing:-.02em;line-height:20.16px;padding:.3483386924rem .5627009646rem;cursor:pointer;display:none;opacity:0;position:relative;visibility:hidden}.ilo--tag--reset.ilo--tag--active{background:#fff;border:1.5px solid #b8c4cc;color:#230050;display:block;opacity:1;outline:0;visibility:visible;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--tag--reset.icon__position--right .ilo--icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23230050' d='M16.95 15.536L13.414 12l3.536-3.535-1.414-1.415L12 10.586 8.464 7.05 7.05 8.465 10.586 12 7.05 15.536l1.414 1.414L12 13.414l3.536 3.536 1.414-1.414z'/%3E%3C/svg%3E");height:100%;max-height:28px;max-width:28px;position:absolute;right:5px;top:5px;width:100%}.ilo--tag--reset:hover{background:#ebf5fd;border:1.5px solid #ebf5fd;color:#1e2dbe;text-decoration:none;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--tag--reset:hover.icon__position--right .ilo--icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231E2DBE' d='M16.95 15.536L13.414 12l3.536-3.535-1.414-1.415L12 10.586 8.464 7.05 7.05 8.465 10.586 12 7.05 15.536l1.414 1.414L12 13.414l3.536 3.536 1.414-1.414z'/%3E%3C/svg%3E")}.ilo--tag--reset:focus{background:#ebf5fd;border:1.5px solid #ebf5fd;color:#1e2dbe;outline:0}
@@ -0,0 +1,30 @@
1
+ {#
2
+ TAG COMPONENT
3
+ #}
4
+ {% if tagType == "button" and defaultActive %}
5
+ <li class="ilo--tags__item">
6
+ <button class="ilo--tag ilo--tag--button ilo--tag--active icon__position--right" id="{{ id }}" data-active={{ defaultActive }} type="button">
7
+ {{content}}
8
+ <span class="ilo--icon" title="Remove"></span>
9
+ </button>
10
+ </li>
11
+ {% elseif tagType == "reset" %}
12
+ <li class="ilo--tags__item">
13
+ <button class="ilo--tag ilo--tag--reset ilo--tag--active" id="{{ id }}" data-active={{ defaultActive }} type="button">
14
+ {{content}}
15
+ </button>
16
+ </li>
17
+ {% elseif tagType == "anchor" %}
18
+ <li class="ilo--tags__item">
19
+ <a class="ilo--tag ilo--tag--anchor {% if defaultActive %} ilo--tag--active{% endif %}" href="{{ url }}" id="{{ id }}" data-active={{ defaultActive }}>
20
+ {{content}}
21
+ </a>
22
+ </li>
23
+ {% elseif tagType == "display" %}
24
+ <li class="ilo--tags__item">
25
+ <span class="ilo--tag {% if defaultActive %} ilo--tag--active{% endif %}" id="{{ id }}" data-active={{ defaultActive }}>
26
+ {{content}}
27
+ </span>
28
+ </li>
29
+ {% else %}
30
+ {% endif %}
@@ -0,0 +1,43 @@
1
+ tag:
2
+ use: "@components/tags/tag.twig"
3
+ label: Tag
4
+ description: A display or interactable tag
5
+ fields:
6
+ content:
7
+ type: text
8
+ label: Content
9
+ description: The tag text content.
10
+ preview:
11
+ faker: lorem.word
12
+ id:
13
+ type: text
14
+ label: ID
15
+ description: The tag's id.
16
+ preview:
17
+ faker: lorem.word
18
+ url:
19
+ type: text
20
+ label: URL
21
+ description: The tag's url reference
22
+ preview:
23
+ faker: https://www.google.com/
24
+ settings:
25
+ defaultActive:
26
+ type: select
27
+ label: Default Active
28
+ description: The tag loads in an active state
29
+ options:
30
+ "true": "true"
31
+ "false": "false"
32
+ preview: "false"
33
+ required: false
34
+ tagType:
35
+ type: type
36
+ label: Tag Type
37
+ description: The type of tag. Anchor and button have potential user interactions where display is static.
38
+ options:
39
+ anchor: Anchor
40
+ button: Button
41
+ display: Display
42
+ preview: display
43
+ visibility: storybook
@@ -0,0 +1,15 @@
1
+ {#
2
+ TAGS COMPONENT
3
+ #}
4
+ <ul class="ilo--tags" data-loadcomponent="Tag" data-multipleactive="{{ allowMultipleActive|default(true) }}">
5
+ {% for item in items %}
6
+ {% include "@components/tags/tag.twig" with {
7
+ content: item.content,
8
+ defaultActive: item.defaultActive,
9
+ id: item.id,
10
+ prefix: prefix,
11
+ tagType: tagType,
12
+ url: item.url|default(null),
13
+ } only %}
14
+ {% endfor %}
15
+ </ul>
@@ -0,0 +1,45 @@
1
+ tags:
2
+ namespace: Components/User Interface
3
+ use: "@components/tags/tags.twig"
4
+ label: Tags
5
+ description: A group of tags
6
+ fields:
7
+ items:
8
+ type: object
9
+ label: Items
10
+ description: An array of tag data to implement a Tag component
11
+ required: true
12
+ preview:
13
+ - content: content 1
14
+ id: tag1
15
+ defaultActive: true
16
+ url: https://www.google.com/
17
+ - content: content 2
18
+ id: tag2
19
+ defaultActive: true
20
+ url: https://www.google.com/
21
+ - content: content 3
22
+ id: tag3
23
+ defaultActive: false
24
+ settings:
25
+ allowMultipleActive:
26
+ type: select
27
+ label: Allow Multiple Active
28
+ description: Allow multiple tag items to be active at once.
29
+ options:
30
+ "true": "true"
31
+ "false": "false"
32
+ preview: "true"
33
+ required: false
34
+ tagType:
35
+ type: select
36
+ label: Tag Type
37
+ description: Type of tags
38
+ options:
39
+ anchor: Anchor
40
+ button: Button
41
+ display: Display
42
+ reset: Reset
43
+ preview: display
44
+ required: true
45
+ visibility: storybook
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.ilo--textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:.1071811361rem solid #b8c4cc;box-sizing:border-box;font-family:Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-weight:500;font-size:16px;letter-spacing:-.02em;line-height:21.6px;height:2.5723472669rem;margin:0;max-width:100%;min-height:6.4308681672rem;min-width:100%;outline:0;position:relative;padding:.857449089rem .6430868167rem;width:100%}.ilo--textarea:focus{background-color:#ebf5fd;border-bottom:.1071811361rem solid #b8c4cc;border-left:.1607717042rem solid #1e2dbe;border-right:.1071811361rem solid #b8c4cc;border-top:.1071811361rem solid #b8c4cc;padding-left:.6430868167rem}.ilo--textarea:disabled{opacity:.45;pointer-events:none}.ilo--textarea:invalid,.ilo--textarea__error,.ilo--textarea__error .ilo--textarea{background-color:#fff;border-bottom:.1071811361rem solid #b8c4cc;border-left:.1607717042rem solid #c8303c;border-right:.1071811361rem solid #b8c4cc;border-top:.1071811361rem solid #b8c4cc}
@@ -0,0 +1,14 @@
1
+ {# textarea.twig #}
2
+
3
+ {% extends "@components/form/formcontrol.twig" %}
4
+
5
+ {% set baseClass = prefix ~ '--textarea' %}
6
+ {% set textAreaClass = [baseClass] %}
7
+ {% if error %}
8
+ {% set textAreaClass = textAreaClass|merge([baseClass ~ "__error"]) %}
9
+ {% endif %}
10
+
11
+
12
+ {% block formfield %}
13
+ <textarea class="{{ textAreaClass|join(' ') }}" name="{{ name }}" id="{{ id|default(name) }}" aria-describedby="{{ ariaDescribedBy }}" {% if disabled %} disabled {% endif %} {% if required %} required {% endif %} {% if placeholder %} placeholder="{{ placeholder }}" {% endif %} {% if form %} form="{{ form }}" {% endif %} {% if maxlength %} maxlength="{{ maxlength }}" {% endif %} {% if minlength %} minlength="{{ minlength }}" {% endif %} {% if spellcheck %} spellcheck="{{ spellcheck }}" {% endif %} {% if wrap %} wrap="{{ wrap }}" {% endif %}>{{ value|default('') }}</textarea>
14
+ {% endblock %}
@@ -0,0 +1,126 @@
1
+ textarea:
2
+ namespace: Components/Forms
3
+ use: "@components/textarea/textarea.twig"
4
+ label: Text Area
5
+ description: The TextArea component allows users to enter multi-line text. It's used to capture free-form text, such as a comment or a description.
6
+ visibility: storybook
7
+ fields:
8
+ label:
9
+ type: text
10
+ label: Label
11
+ description: The label for the form element.
12
+ preview: "Insert your name here"
13
+ tooltip:
14
+ type: string
15
+ description: The tooltip for the form element.
16
+ preview: "This is a tooltip"
17
+ helper:
18
+ type: text
19
+ label: Helper Text
20
+ description: The helper text for the form element.
21
+ preview: "Enter first name and last name"
22
+ id:
23
+ type: text
24
+ label: ID
25
+ description: The ID of the text area.
26
+ name:
27
+ type: text
28
+ label: Name
29
+ description: The name of the text area.
30
+ placeholder:
31
+ type: text
32
+ label: Placeholder
33
+ description: The placeholder of the text area.
34
+ preview: Enter your life story here
35
+ default: ""
36
+ class:
37
+ type: text
38
+ label: Class
39
+ description: The class of the text area.
40
+ preview: textinput
41
+ default: ""
42
+ pattern:
43
+ type: text
44
+ label: Pattern
45
+ description: The pattern of the text area.
46
+ preview: textinput``
47
+ default: ""
48
+ form:
49
+ type: text
50
+ label: Form
51
+ description: The form of the text area if it's not nested in a form element.
52
+ preview: textinput
53
+ default: ""
54
+ maxlength:
55
+ type: number
56
+ label: Max Length
57
+ description: The maximum length of the text area.
58
+ preview: 100
59
+ minlength:
60
+ type: number
61
+ label: Min Length
62
+ description: The minimum length of the text area.
63
+ preview: 0
64
+ style:
65
+ type: text
66
+ label: Style
67
+ description: The style of the text area.
68
+ preview: "width: 100%;"
69
+ settings:
70
+ labelPlacement:
71
+ type: select
72
+ label: Label Placement
73
+ description: The placement of the label for the form element.
74
+ preview: "top"
75
+ default: "top"
76
+ options:
77
+ start: start
78
+ end: end
79
+ top: top
80
+ bottom: bottom
81
+ labelSize:
82
+ type: select
83
+ label: Label Size
84
+ description: The size of the label for the form element.
85
+ preview: "medium"
86
+ default: "medium"
87
+ options:
88
+ small: small
89
+ medium: medium
90
+ large: large
91
+ disabled:
92
+ type: boolean
93
+ label: Disabled
94
+ description: The disabled state of the text area.
95
+ preview: false
96
+ default: false
97
+ required:
98
+ type: boolean
99
+ label: Required
100
+ description: The required state of the text area.
101
+ preview: false
102
+ default: false
103
+ error:
104
+ type: boolean
105
+ label: Error
106
+ description: Adds an error state to the form control.
107
+ preview: false
108
+ default: false
109
+ spellcheck:
110
+ type: select
111
+ label: Spellcheck
112
+ description: The spellcheck state of the text area.
113
+ options:
114
+ "true": "true"
115
+ "false": "false"
116
+ default: default
117
+ preview: default
118
+ wrap:
119
+ type: select
120
+ label: Wrap
121
+ description: The wrap state of the text area.
122
+ options:
123
+ hard: hard
124
+ soft: soft
125
+ off: off
126
+ preview: off
@@ -0,0 +1 @@
1
+ .ilo--card__type__text{--max-width:16.1307609861rem;border-bottom:.1607717042rem solid #b8c4cc;padding:2.1436227224rem 1.2861736334rem 1.7148981779rem}.ilo--card__type__text,[dir=rtl] .ilo--card__type__text{clip-path:polygon(0 0,calc(100% - 72px) 0,100% 40px,100% 100%,0 100%)}[dir=rtl] .ilo--card__type__text{clip-path:polygon(72px 0,100% 0,100% 100%,0 100%,0 40px)}.ilo--card__type__text [class$=profile__theme__light] *{color:#2d2d2d}.ilo--card__type__text [class$=profile__theme__dark] *{color:#fff}.ilo--card__type__text:focus,.ilo--card__type__text:focus-within,.ilo--card__type__text:hover{filter:drop-shadow(0 -4px 16px rgba(30,45,190,.05)) drop-shadow(0 10px 20px rgba(30,45,190,.08)) drop-shadow(0 4px 8px rgba(30,45,190,.05)) drop-shadow(0 .8px 1.6px rgba(30,45,190,.04));transition-property:border-color;transition-duration:.15s;transition-timing-function:ease-out;border-color:#1e2dbe}.ilo--card__type__text:focus-within [class*=profile__theme] *,.ilo--card__type__text:focus [class*=profile__theme] *,.ilo--card__type__text:hover [class*=profile__theme] *{color:#1e2dbe}@media screen and (max-width:609px){.ilo--card__type__text{--max-width:100%}}.ilo--card__type__text.ilo--card__size__fluid,.ilo--card__type__text.ilo--card__size__wide{--max-width:28.0278670954rem;padding:2.1436227224rem 1.7148981779rem 1.7148981779rem}.ilo--card__type__text.ilo--card__size__narrow{--max-width:16.1307609861rem;padding:2.1436227224rem 1.2861736334rem 1.7148981779rem}@media screen and (max-width:609px){.ilo--card__type__text.ilo--card__size__narrow{--max-width:100%}}.ilo--card__type__text.ilo--card__size__narrow .ilo--card--title{font-size:18.66px;letter-spacing:-.035em;line-height:24.26px;margin-bottom:1.674953518rem}.ilo--card__type__text.ilo--card__dark{border-bottom:.1607717042rem solid #fa3c4b}.ilo--card__type__text .ilo--card--eyebrow{margin-bottom:1.0110920672rem}.ilo--card__type__text .ilo--card--title{font-size:18.66px;letter-spacing:-.035em;line-height:24.26px;margin-bottom:1.674953518rem}@media screen and (min-width:610px){.ilo--card__type__text .ilo--card--title{font-size:23.32px;letter-spacing:-.035em;line-height:29.15px;margin-bottom:1.5763397642rem}}.ilo--card__type__text .ilo--card--date{display:block;margin-bottom:1.4398166117rem}.ilo--card__type__text .ilo--card--content{display:flex;flex-direction:column;position:relative}.ilo--card__type__text .ilo--card--content>*{justify-self:flex-start}.ilo--card__type__text .ilo--card--content>:last-child{justify-self:flex-end;margin-bottom:0}
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.ilo--text-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:.1071811361rem solid #b8c4cc;box-sizing:border-box;font-family:Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-weight:500;font-size:16px;letter-spacing:-.02em;line-height:21.6px;height:2.5723472669rem;margin:0;outline:0;padding:.857449089rem .6430868167rem;width:100%}.ilo--text-input:focus{background-color:#ebf5fd;border-bottom:.1071811361rem solid #b8c4cc;border-left:.1607717042rem solid #1e2dbe;border-right:.1071811361rem solid #b8c4cc;border-top:.1071811361rem solid #b8c4cc;padding-left:.6430868167rem;outline:0}.ilo--text-input:disabled{opacity:.45;pointer-events:none}.ilo--text-input:invalid,.ilo--text-input__error{background-color:#fff;border-bottom:.1071811361rem solid #b8c4cc;border-left:.1607717042rem solid #c8303c;border-right:.1071811361rem solid #b8c4cc;border-top:.1071811361rem solid #b8c4cc}
@@ -0,0 +1,14 @@
1
+ {# text-input.twig #}
2
+
3
+ {% extends "@components/form/formcontrol.twig" %}
4
+
5
+ {% set baseClass = prefix ~ "--text-input" %}
6
+ {% set inputClass = [baseClass] %}
7
+ {% if error %}
8
+ {% set inputClass = inputClass|merge([baseClass ~ "__error"]) %}
9
+ {% endif %}
10
+
11
+ {% block formfield %}
12
+ <input id="{{ id|default(name) }}" name="{{ name }}" type="{{ type|default("text") }}" class="{{ inputClass|join(" ") }}" {% if placeholder %} placeholder="{{ placeholder }}" {% endif %} {% if disabled %} disabled {% endif %} {% if required %} required {% endif %} {% if pattern %} pattern="{{ pattern }}" {% endif %} {% if ariaDescribedBy %} aria-describedby="{{ ariaDescribedBy }}" {% endif %}/>
13
+
14
+ {% endblock %}
@@ -0,0 +1,86 @@
1
+ textinput:
2
+ namespace: Components/Forms
3
+ use: "@components/textinput/textinput.twig"
4
+ label: Text Input
5
+ description: The TextInput field provides a way for users with a single line of text to enter into a form. Use this component for things like names, email addresses, passwords and other short form fields.
6
+ visibility: storybook
7
+ fields:
8
+ label:
9
+ type: text
10
+ label: Label
11
+ description: The label for the form element.
12
+ preview: "Insert your name here"
13
+ tooltip:
14
+ type: string
15
+ description: The tooltip for the form element.
16
+ preview: "This is a tooltip"
17
+ helper:
18
+ type: text
19
+ label: Helper Text
20
+ description: The helper text for the form element.
21
+ preview: "Enter first name and last name"
22
+ id:
23
+ type: text
24
+ label: ID
25
+ description: The ID of the text input.
26
+ name:
27
+ type: text
28
+ label: Name
29
+ description: The name of the text input.
30
+ placeholder:
31
+ type: text
32
+ label: Placeholder
33
+ description: The placeholder of the text input.
34
+ preview: Sarah Martinez
35
+ default: ""
36
+ class:
37
+ type: text
38
+ label: Class
39
+ description: The class of the text input.
40
+ preview: textinput
41
+ default: ""
42
+ pattern:
43
+ type: text
44
+ label: Pattern
45
+ description: The pattern of the text input.
46
+ default: ""
47
+ settings:
48
+ labelPlacement:
49
+ type: select
50
+ label: Label Placement
51
+ description: The placement of the label for the form element.
52
+ preview: "top"
53
+ default: "top"
54
+ options:
55
+ start: start
56
+ end: end
57
+ top: top
58
+ bottom: bottom
59
+ labelSize:
60
+ type: select
61
+ label: Label Size
62
+ description: The size of the label for the form element.
63
+ preview: "medium"
64
+ default: "medium"
65
+ options:
66
+ small: small
67
+ medium: medium
68
+ large: large
69
+ disabled:
70
+ type: boolean
71
+ label: Disabled
72
+ description: The disabled state of the text input.
73
+ preview: false
74
+ default: false
75
+ required:
76
+ type: boolean
77
+ label: Required
78
+ description: The required state of the text input.
79
+ preview: false
80
+ default: false
81
+ error:
82
+ type: boolean
83
+ label: Error
84
+ description: Adds an error state to the form control.
85
+ preview: false
86
+ default: false
@@ -0,0 +1 @@
1
+ .ilo--input--toggle{grid-area:a;position:relative;display:inline-block;width:var(--toggle-width);height:var(--toggle-height);--base-toggle-width:2.4651661308rem;--base-toggle-height:1.2861736334rem}.ilo--input--toggle__size__small{--toggle-width:var(--base-toggle-width);--toggle-height:var(--base-toggle-height)}.ilo--input--toggle__size__medium{--toggle-width:calc(var(--base-toggle-width) * 1.5);--toggle-height:calc(var(--base-toggle-height) * 1.5)}.ilo--input--toggle__size__large{--toggle-width:calc(var(--base-toggle-width) * 2);--toggle-height:calc(var(--base-toggle-height) * 2)}.ilo--input--toggle__disabled{cursor:not-allowed;opacity:.5}.ilo--input--toggle__error .ilo--input--toggle--slider{outline-color:#fa3c4b!important;outline-width:calc(var(--toggle-height)/ 8);outline-style:solid}.ilo--input--toggle input[type=checkbox]{opacity:0;width:100%;height:100%;padding:0;margin:0;cursor:pointer}.ilo--input--toggle--slider{position:absolute;pointer-events:none;top:0;left:0;right:0;bottom:0;background-color:#b8c4cc;border-radius:calc(var(--toggle-height)/ 2);transition-property:background;transition-duration:.15s;transition-timing-function:ease-out}.ilo--input--toggle--slider:before{position:absolute;content:"";height:calc(var(--toggle-height) - var(--toggle-height)/ 3);width:calc(var(--toggle-height) - var(--toggle-height)/ 3);left:calc(var(--toggle-height)/ 6);bottom:calc(var(--toggle-height)/ 6);background-color:#fff;border-radius:50%;transition-property:transform,background;transition-duration:.15s;transition-timing-function:ease-out}input[type=checkbox]:checked+.ilo--input--toggle--slider{background-color:#230050}input[type=checkbox]:focus+.ilo--input--toggle--slider{outline-color:#ffcd2d;outline-width:calc(var(--toggle-height)/ 8);outline-style:solid}input:checked+.ilo--input--toggle--slider:before{transform:translateX(calc(var(--toggle-width) - var(--toggle-height)));background-color:#ebf5fd}
@@ -0,0 +1,36 @@
1
+ {# toggle.twig #}
2
+
3
+ {% extends "@components/form/formcontrol.twig" %}
4
+
5
+ {# Define the default values, these values can be overridden when the template is included or extended. #}
6
+ {% set size = size|default("medium") %}
7
+ {% set error = error|default(false) %}
8
+ {% set disabled = disabled|default(false) %}
9
+ {% set defaultChecked = defaultChecked|default(false) %}
10
+ {% set required = required|default(false) %}
11
+ {% set name = name|default("toggle") %}
12
+ {% set id = id|default(name) %}
13
+ {% set ariaDescribedBy = ariaDescribedBy|default("") %}
14
+
15
+ {# Calculate dynamic classes based on the passed values. #}
16
+ {% set baseClass = prefix ~ "--input--toggle" %}
17
+ {% set sliderClass = baseClass ~ "--slider" %}
18
+ {% set toggleClass = [baseClass, class, baseClass ~ "__size__" ~ size] %}
19
+
20
+ {% if not disabled and error %}
21
+ {% set toggleClass = toggleClass|merge([baseClass ~ "__error"]) %}
22
+ {% endif %}
23
+ {% if disabled %}
24
+ {% set toggleClass = toggleClass|merge([baseClass ~ "__disabled"]) %}
25
+ {% endif %}
26
+
27
+ {% block formfield %}
28
+
29
+ <div class="{{ toggleClass|join(" ") }}">
30
+ <input {% if defaultchecked %} defaultchecked {% endif %} {% if required %} required {% endif %} {% if checked %} checked {% endif %} name="{{ name }}" id="{{ id }}" type="checkbox" role="switch" aria-describedby="{{ ariaDescribedBy }}"/>
31
+
32
+
33
+ <span class="{{ sliderClass }}"/>
34
+ </div>
35
+
36
+ {% endblock %}