@ilo-org/twig 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/dist/components/accordion/accordion-item.twig +22 -0
  2. package/dist/components/accordion/accordion.behavior.js +1 -0
  3. package/dist/components/accordion/accordion.css +1 -0
  4. package/dist/components/accordion/accordion.twig +16 -0
  5. package/dist/components/accordion/accordion.wingsuit.yml +77 -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 +84 -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 +101 -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/file-upload/file-upload.css +1 -0
  60. package/dist/components/fileupload/fileupload.behavior.js +1 -0
  61. package/dist/components/fileupload/fileupload.twig +20 -0
  62. package/dist/components/fileupload/fileupload.wingsuit.yml +95 -0
  63. package/dist/components/footer/footer.css +1 -0
  64. package/dist/components/footer/footer.twig +63 -0
  65. package/dist/components/footer/footer.wingsuit.yml +106 -0
  66. package/dist/components/form/fieldset.twig +70 -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/form/formcontrol.twig +89 -0
  71. package/dist/components/form/input.twig +10 -0
  72. package/dist/components/formcontrol/formcontrol.css +1 -0
  73. package/dist/components/heading/heading.css +1 -0
  74. package/dist/components/hero/hero.css +1 -0
  75. package/dist/components/hero/hero.twig +65 -0
  76. package/dist/components/hero/hero.wingsuit.yml +182 -0
  77. package/dist/components/herocard/herocard.css +1 -0
  78. package/dist/components/herocard/herocard.twig +30 -0
  79. package/dist/components/herocard/herocard.wingsuit.yml +71 -0
  80. package/dist/components/icon/icon.behavior.js +1 -0
  81. package/dist/components/icon/icon.css +1 -0
  82. package/dist/components/icon/icon.twig +4 -0
  83. package/dist/components/icon/icon.wingsuit.yml +29 -0
  84. package/dist/components/image/image.css +1 -0
  85. package/dist/components/image/image.twig +29 -0
  86. package/dist/components/image/image.wingsuit.yml +57 -0
  87. package/dist/components/input/input.css +1 -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-item.twig +6 -0
  96. package/dist/components/list/list.css +1 -0
  97. package/dist/components/list/list.twig +35 -0
  98. package/dist/components/list/list.wingsuit.yml +60 -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 +127 -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 +92 -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 +84 -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 +90 -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.wingsuit.yml +44 -0
  167. package/dist/components/tags/tag.twig +30 -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 +127 -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 +87 -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 +95 -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/video/videoplayer.twig +8 -0
  189. package/dist/global/styles.css +2 -0
  190. package/package.json +13 -9
  191. package/src/patterns/components/checkbox/checkbox.wingsuit.yml +1 -0
  192. package/src/patterns/components/dropdown/dropdown.wingsuit.yml +2 -1
  193. package/src/patterns/components/fileupload/fileupload.wingsuit.yml +1 -0
  194. package/src/patterns/components/list/list-item.twig +1 -1
  195. package/src/patterns/components/list/list-item.wingsuit.yml +1 -1
  196. package/src/patterns/components/list/list.twig +2 -2
  197. package/src/patterns/components/list/list.wingsuit.yml +11 -11
  198. package/src/patterns/components/navigation/navigation.wingsuit.yml +1 -0
  199. package/src/patterns/components/numberpicker/numberpicker.wingsuit.yml +1 -0
  200. package/src/patterns/components/radio/radio.wingsuit.yml +1 -0
  201. package/src/patterns/components/search/search.wingsuit.yml +1 -0
  202. package/src/patterns/components/tags/tag.twig +4 -4
  203. package/src/patterns/components/tags/tag.wingsuit.yml +4 -3
  204. package/src/patterns/components/tags/tags.twig +1 -1
  205. package/src/patterns/components/tags/tags.wingsuit.yml +3 -3
  206. package/src/patterns/components/textarea/textarea.wingsuit.yml +1 -0
  207. package/src/patterns/components/textinput/textinput.wingsuit.yml +1 -0
  208. package/src/patterns/components/toggle/toggle.wingsuit.yml +1 -0
  209. package/.browserslistrc +0 -4
  210. package/.eslintrc.js +0 -25
  211. package/.stylelintignore +0 -9
  212. package/.stylelintrc +0 -19
  213. package/.turbo/turbo-build:lib.log +0 -71
  214. package/CHANGELOG.md +0 -1036
  215. package/apps/storybook/assets.js +0 -10
  216. package/apps/storybook/main.js +0 -27
  217. package/apps/storybook/manager-head.html +0 -92
  218. package/apps/storybook/manager.js +0 -7
  219. package/apps/storybook/patterns/colors.stories.mdx +0 -23
  220. package/apps/storybook/patterns/intro.stories.mdx +0 -184
  221. package/apps/storybook/patterns/typeset.stories.mdx +0 -32
  222. package/apps/storybook/patterns/welcome.stories.mdx +0 -33
  223. package/apps/storybook/preview-body.html +0 -4
  224. package/apps/storybook/preview-head.html +0 -5
  225. package/apps/storybook/preview.js +0 -36
  226. package/apps/storybook/styles.scss +0 -25
  227. package/apps/storybook/theme.js +0 -46
  228. package/apps/storybook/welcome.scss +0 -131
  229. package/babel.config.js +0 -16
  230. package/copystyles.js +0 -16
  231. package/copytemplates.js +0 -27
  232. package/images/fao-logo.svg +0 -195
  233. package/images/favicon.ico +0 -0
  234. package/images/hero.jpg +0 -0
  235. package/images/ilo-dg.jpg +0 -0
  236. package/images/ilo-headquarters.jpg +0 -0
  237. package/images/large.jpg +0 -0
  238. package/images/logo_en_horizontal_blue.svg +0 -893
  239. package/images/media-file-poster.jpg +0 -0
  240. package/images/medium.jpg +0 -0
  241. package/images/publication.jpg +0 -0
  242. package/images/small.jpg +0 -0
  243. package/images/twig.svg +0 -6
  244. package/images/unhcr-logo.svg +0 -1
  245. package/images/unicef-logo.png +0 -0
  246. package/images/video-example.mp4 +0 -0
  247. package/images/wfp-logo.svg +0 -1
  248. package/images/who-logo.svg +0 -1
  249. package/images/youtube-video-poster.avif +0 -0
  250. package/importprefix.js +0 -20
  251. package/importsvgs.js +0 -5
  252. package/jest.config.js +0 -18
  253. package/postcss.config.js +0 -6
  254. package/rollup.config.js +0 -31
  255. package/wingsuit.config.js +0 -28
@@ -0,0 +1,158 @@
1
+ cardgroup:
2
+ namespace: Components/Cards
3
+ use: "@components/cardgroup/cardgroup.twig"
4
+ label: Card Group
5
+ description: A group of cards
6
+ visibility: storybook
7
+ settings:
8
+ collapsed:
9
+ type: select
10
+ label: collapsed
11
+ description: Optionally collapses margins between the cards.
12
+ required: false
13
+ preview: "false"
14
+ options:
15
+ "true": "true"
16
+ "false": "false"
17
+ cardcount:
18
+ type: select
19
+ label: collapsed
20
+ description: Number of cards to show in a row, also determines the width of the cards as a function of how many there need to be. This will override the width set in the `size` setting.
21
+ required: false
22
+ preview: "three"
23
+ options:
24
+ one: one
25
+ two: two
26
+ three: three
27
+ four: four
28
+ size:
29
+ type: select
30
+ label: Size
31
+ description: Sets the layout of the cards in the group. See the `Card` component for more info on this setting, which has different effects on the different types of cards.
32
+ required: false
33
+ preview: "standard"
34
+ options:
35
+ standard: standard
36
+ narrow: narrow
37
+ wide: wide
38
+ fluid: fluid
39
+ alignment:
40
+ type: select
41
+ label: Alignment
42
+ description: Positions the image to the right or to the left of the content when the card is displayed in a `wide` or `fluid` size. Has no effect if the card is displayed in a `standard` or `narrow` size. Only used by `Multilink Card`.
43
+ preview: "left"
44
+ options:
45
+ left: Left
46
+ right: Right
47
+ theme:
48
+ type: select
49
+ label: Theme
50
+ description: Sets all of the cards to appear as either light or dark. Used by all card groups except for `Multilink Card`, `Data Card` and `Stat Card`.
51
+ required: false
52
+ preview: "dark"
53
+ options:
54
+ dark: Dark
55
+ light: Light
56
+ type:
57
+ type: select
58
+ label: Type
59
+ description: Sets the type of cards to render in the Card Group
60
+ preview: "feature"
61
+ options:
62
+ feature: Feature
63
+ text: Text
64
+ detail: Detail
65
+ promo: Promo
66
+ multilink: Multilink
67
+ data: Data
68
+ stat: Stat
69
+ factlist: Factlist
70
+ fields:
71
+ group:
72
+ type: object
73
+ label: Group of cards
74
+ description: "The group of cards. Each card can be one of the following types: multilink, feature, detail, graphicpromo, stat, graphic, factlist, data."
75
+ preview:
76
+ - eyebrow: "Press release"
77
+ title: "ILO welcomes first global agreement on working conditions and rights of professional football players"
78
+ link: "https://www.ilo.org/"
79
+ cta:
80
+ label: "Read the press release"
81
+ url: "https://www.ilo.org/global/about-the-ilo/newsroom/news/WCMS_846303/lang--en/index.htm"
82
+ theme: dark
83
+ image:
84
+ alt: "Image alt text"
85
+ loading: "lazy"
86
+ url:
87
+ - breakpoint: "(min-width: 0px)"
88
+ src: "/images/small.jpg"
89
+ - breakpoint: "(min-width: 800px)"
90
+ src: "/images/medium.jpg"
91
+ - breakpoint: "(min-width: 1200px)"
92
+ src: "/images/large.jpg"
93
+ - breakpoint: "(min-width: 1440px)"
94
+ src: "/images/large.jpg"
95
+ - eyebrow: "Report"
96
+ title: "Renewable energy jobs hit 12.7 million globally"
97
+ link: "https://www.ilo.org/"
98
+ cta:
99
+ label: "Read the press release"
100
+ url: "https://www.ilo.org/global/about-the-ilo/newsroom/news/WCMS_846303/lang--en/index.htm"
101
+ theme: dark
102
+ image:
103
+ alt: "Image alt text"
104
+ loading: "lazy"
105
+ url:
106
+ - breakpoint: "(min-width: 0px)"
107
+ src: "/images/small.jpg"
108
+ - breakpoint: "(min-width: 800px)"
109
+ src: "/images/medium.jpg"
110
+ - breakpoint: "(min-width: 1200px)"
111
+ src: "/images/large.jpg"
112
+ - breakpoint: "(min-width: 1440px)"
113
+ src: "/images/large.jpg"
114
+ - eyebrow: "Podcast"
115
+ title: "Telangana and Andhra Pradesh launch pre-departure handbook for Indians going to the European Union"
116
+ link: "https://www.ilo.org/"
117
+ cta:
118
+ label: "Read the press release"
119
+ url: "https://www.ilo.org/global/about-the-ilo/newsroom/news/WCMS_846303/lang--en/index.htm"
120
+ theme: dark
121
+ image:
122
+ alt: "Image alt text"
123
+ loading: "lazy"
124
+ url:
125
+ - breakpoint: "(min-width: 0px)"
126
+ src: "/images/small.jpg"
127
+ - breakpoint: "(min-width: 800px)"
128
+ src: "/images/medium.jpg"
129
+ - breakpoint: "(min-width: 1200px)"
130
+ src: "/images/large.jpg"
131
+ - breakpoint: "(min-width: 1440px)"
132
+ src: "/images/large.jpg"
133
+ - eyebrow: "Podcast"
134
+ title: "Can digital technology be an equality machine?"
135
+ link: "https://www.ilo.org/"
136
+ cta:
137
+ label: "Read the press release"
138
+ url: "https://www.ilo.org/global/about-the-ilo/newsroom/news/WCMS_846303/lang--en/index.htm"
139
+ theme: dark
140
+ image:
141
+ alt: "Image alt text"
142
+ loading: "lazy"
143
+ url:
144
+ - breakpoint: "(min-width: 0px)"
145
+ src: "/images/small.jpg"
146
+ - breakpoint: "(min-width: 800px)"
147
+ src: "/images/medium.jpg"
148
+ - breakpoint: "(min-width: 1200px)"
149
+ src: "/images/large.jpg"
150
+ - breakpoint: "(min-width: 1440px)"
151
+ src: "/images/large.jpg"
152
+ cta:
153
+ type: object
154
+ label: CTA
155
+ description: Button to display after the cards in the group
156
+ preview:
157
+ label: "Discover our unique mission"
158
+ url: "https://www.ilo.org"
@@ -0,0 +1 @@
1
+ .ilo--checkbox{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;display:grid;height:1.2861736334rem;margin:0;position:relative;place-content:center;width:1.2861736334rem;transform:none;cursor:pointer}.ilo--checkbox:before{height:.857449089rem;left:.2143622722rem;top:.2143622722rem;width:.857449089rem;z-index:1}.ilo--checkbox:after,.ilo--checkbox:before{content:"";background-color:#b8c4cc;position:absolute}.ilo--checkbox:after{border:.2143622722rem solid #b8c4cc;height:1.2861736334rem;left:0;top:0;width:1.2861736334rem;z-index:0}.ilo--checkbox:checked:before{background-color:#230050;background-repeat:no-repeat;background-size:contain;background-position:50%;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 10'%3E%3Cpath fill='%23EDF0F2' d='M4.375 6.25l-2.5-2.5L0 5.625 4.375 10 12.5 1.875 10.625 0l-6.25 6.25z'/%3E%3C/svg%3E")}.ilo--checkbox:checked:after{background-color:#230050;border-color:#230050}.ilo--checkbox:focus{outline:0}.ilo--checkbox:focus:after{background-color:#ffcd2d;border-color:#ffcd2d}.ilo--checkbox:focus:checked:after{border-color:#ffcd2d}.ilo--checkbox:disabled{opacity:.45;pointer-events:none}.ilo--checkbox:invalid:after,.ilo--checkbox__error .ilo--checkbox:after,.ilo--checkbox__error:after{border-color:#fa3c4b}.ilo--checkbox:invalid:checked:after,.ilo--checkbox__error .ilo--checkbox:checked:after,.ilo--checkbox__error:checked:after{border-color:#230050}
@@ -0,0 +1,17 @@
1
+ {# checkbox.twig #}
2
+
3
+ {% extends "@components/form/formcontrol.twig" %}
4
+
5
+ {% set disabled = disabled|default(false) %}
6
+ {% set baseClass = 'ilo' ~ '--checkbox' %}
7
+ {% set errorClass = baseClass ~ '__error' %}
8
+ {% set CheckboxClasses = [baseClass] %}
9
+
10
+ {% if error %}
11
+ {% set CheckboxClasses = CheckboxClasses|merge([errorClass]) %}
12
+ {% endif %}
13
+
14
+
15
+ {% block formfield %}
16
+ <input id="{{ id|default(name) }}" name="{{ name }}" {% if disabled %} disabled {% endif %} {% if required %} required {% endif %} type="checkbox" class="{{ CheckboxClasses|join(' ') }}" {% if defaultChecked %} checked {% endif %} {% if ariaDescribedBy %} aria-describedby="{{ ariaDescribedBy }}" {% endif %} {% if value %} value="{{ value }}" {% endif %}/>
17
+ {% endblock %}
@@ -0,0 +1,84 @@
1
+ checkbox:
2
+ namespace: Components/Forms
3
+ use: "@components/checkbox/checkbox.twig"
4
+ label: Checkbox
5
+ description:
6
+ The checkbox component provides users with a switch they can use to
7
+ select more than one option from a list.
8
+ visibility: storybook
9
+ fields:
10
+ label:
11
+ type: text
12
+ label: Label
13
+ description: The label for the form element.
14
+ preview: "Do you agree to these terms?"
15
+ tooltip:
16
+ type: string
17
+ label: Tooltip
18
+ description: The tooltip for the form element.
19
+ helper:
20
+ type: text
21
+ label: Helper Text
22
+ description: The helper text for the form element.
23
+ id:
24
+ type: text
25
+ label: ID
26
+ description: The ID of the input.
27
+ name:
28
+ type: text
29
+ label: Name
30
+ description: The name of the input.
31
+ class:
32
+ type: text
33
+ label: Class
34
+ description: The class of the form field.
35
+ preview: checkbox
36
+ default: ""
37
+ value:
38
+ type: text
39
+ label: Value
40
+ description: The value of the input.
41
+ preview: "1"
42
+ settings:
43
+ defaultSelected:
44
+ type: boolean
45
+ label: Default Selected
46
+ description: The default selected state of the form element.
47
+ preview: false
48
+ labelPlacement:
49
+ type: select
50
+ label: Label Placement
51
+ description: The placement of the label for the form element.
52
+ preview: "end"
53
+ options:
54
+ start: start
55
+ end: end
56
+ top: top
57
+ bottom: bottom
58
+ labelSize:
59
+ type: select
60
+ label: Label Size
61
+ description: The size of the label for the form element.
62
+ preview: "small"
63
+ options:
64
+ small: small
65
+ medium: medium
66
+ large: large
67
+ disabled:
68
+ type: boolean
69
+ label: Disabled
70
+ description: The disabled state of the form element.
71
+ preview: false
72
+ default: false
73
+ required:
74
+ type: boolean
75
+ label: Required
76
+ description: The required state of the form element.
77
+ preview: false
78
+ default: false
79
+ error:
80
+ type: boolean
81
+ label: Error
82
+ description: Adds an error state to the form control.
83
+ preview: false
84
+ default: false
@@ -0,0 +1 @@
1
+ .ilo--container{margin-right:auto;margin-left:auto;max-width:1300px;padding:0 1.0718113612rem;width:100%}
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.ilo--context-menu{border-radius:.1071811361rem;background-color:#edf0f2;display:inline-block;position:relative;width:auto}.ilo--context-menu:before{background-position:top;background-repeat:no-repeat;background-size:contain;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='%23EDF0F2' d='M24 24L0 0v24h24z'/%3E%3C/svg%3E");content:"";height:.6430868167rem;position:absolute;left:50%;top:-.3215434084rem;transform:translateX(-50%) rotate(135deg);width:.6430868167rem}.ilo--context-menu--item{padding:0 .4287245445rem}.ilo--context-menu--item:first-of-type{border-top-left-radius:2px;border-top-right-radius:2px}.ilo--context-menu--item:last-of-type{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.ilo--context-menu--item:last-of-type a{border-bottom:none}.ilo--context-menu--item:focus,.ilo--context-menu--item:hover{background-color:#ebf5fd}.ilo--context-menu--item.endsection{border-bottom:.1607717042rem solid #fff}.ilo--context-menu--item.endsection .ilo--context-menu--link{border-bottom:none}.ilo--context-menu--link{border-bottom:.1071811361rem solid #fff;color:#230050;display:inline-block;font-family:Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-weight:500;padding:.857449089rem .4287245445rem;text-decoration:none;width:100%;font-size:11.94px;letter-spacing:normal;line-height:16.24px;letter-spacing:-.1px}.ilo--context-menu--link:visited{color:#230050}.ilo--context-menu--link:active{color:#230050;outline:0}.ilo--context-menu--link:focus,.ilo--context-menu--link:hover{color:#1e2dbe;outline:0;text-decoration:underline;text-decoration-thickness:.1071811361rem}
@@ -0,0 +1,12 @@
1
+ {#
2
+ CONTEXT MENU COMPONENT
3
+ #}
4
+ <ul class="ilo--context-menu">
5
+ {% for link in links %}
6
+ <li class="ilo--context-menu--item{% if link.endsection == 'true' %} endsection{% endif %}">
7
+ <a href="{{link.url}}" class="ilo--context-menu--link">
8
+ <span class="ilo--context-menu--label">{{link.label}}</span>
9
+ </a>
10
+ </li>
11
+ {% endfor %}
12
+ </ul>
@@ -0,0 +1,24 @@
1
+ contextmenu:
2
+ namespace: Components/Navigation
3
+ use: "@components/contextmenu/contextmenu.twig"
4
+ label: Context Menu
5
+ description: The ContextMenu receives a list of urls with labels and an optional prop indicating if this link is at the end of a 'section.'
6
+ fields:
7
+ links:
8
+ type: object
9
+ label: Links
10
+ description: The context menu item items.
11
+ required: true
12
+ preview:
13
+ - label: Link One
14
+ url: "http://www.google.com"
15
+ - label: Link Two
16
+ url: "http://www.google.com"
17
+ - endsection: "true"
18
+ label: Link Three Ends A Section
19
+ url: "http://www.google.com"
20
+ - label: Link Four
21
+ url: "http://www.google.com"
22
+ - label: Link Five Is Slightly Longer
23
+ url: "http://www.google.com"
24
+ visibility: storybook
@@ -0,0 +1 @@
1
+ .ilo--credit{color:#fff;display:inline-block;height:1.2861736334rem;padding:0;position:relative;font-size:11.94px;letter-spacing:-.02em;line-height:16.24px}.ilo--credit--label{background-color:#2d2d2d;padding:4px 8px 4px 12px}.ilo--credit:after{background-position:100% 0;background-repeat:no-repeat;background-size:contain;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='%232D2D2D' d='M24 24L0 0v24h24z'/%3E%3C/svg%3E");content:"";height:1.2861736334rem;position:absolute;left:100%;top:-.2143622722rem;width:1.2861736334rem}@media screen and (max-width:1023px){.ilo--credit{width:75%}.ilo--credit--label{bottom:calc(100% + 1px);display:none;left:0;margin-bottom:.6430868167rem;position:absolute}.ilo--credit--label:after{background-position:0 0;background-size:contain;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 11'%3E%3Cpath fill='%232D2D2D' d='M6 10.846L12 0H0l6 10.846z'/%3E%3C/svg%3E");height:.6430868167rem;left:0.32154rem;bottom:-.6430868167rem;width:.6430868167rem}.ilo--credit--label:after,.ilo--credit:before{background-repeat:no-repeat;content:"";position:absolute}.ilo--credit:before{background-color:#2d2d2d;background-position:calc(100% - 4px) 50%;background-size:.6430868167rem .6430868167rem;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill='%23FFF' d='M8 0C6.4 0 4.9.5 3.6 1.3c-1.4.9-2.4 2.2-3 3.6C0 6.4-.2 8 .2 9.6c.3 1.6 1.1 3 2.2 4.1 1.1 1.1 2.5 1.9 4.1 2.2s3.2.2 4.6-.5c1.5-.6 2.7-1.6 3.6-2.9.8-1.4 1.3-2.9 1.3-4.5 0-2.1-.8-4.2-2.3-5.7C12.2.8 10.1 0 8 0zm0 14c-1.2 0-2.3-.4-3.3-1-1-.7-1.8-1.6-2.2-2.7C2 9.2 1.9 8 2.1 6.8c.2-1.2.8-2.2 1.6-3.1.8-.8 1.9-1.4 3.1-1.6 1.2-.2 2.4-.1 3.5.4s2 1.2 2.7 2.2c.7 1 1 2.1 1 3.3 0 1.6-.6 3.1-1.8 4.2C11.1 13.4 9.6 14 8 14z'/%3E%3Cpath fill='%23FFF' d='M9 7H7v5h2V7zM8 6c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1z'/%3E%3C/svg%3E");height:1.2861736334rem;left:0;top:0;width:1.5541264737rem}.ilo--credit:after{left:1.5541264737rem;top:0}.ilo--credit:hover .ilo--credit--label{display:inline-block}}[dir=rtl] .ilo--credit:after{background-position:0 0;left:auto;right:100%;transform:scaleX(-1)}@media screen and (max-width:1023px){[dir=rtl] .ilo--credit--label{left:auto;right:0}[dir=rtl] .ilo--credit--label:after{background-position:100% 0;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 11'%3E%3Cpath fill='%232D2D2D' d='M6 10.846L12 0H0l6 10.846z'/%3E%3C/svg%3E");left:auto;right:0.32154rem}[dir=rtl] .ilo--credit:before{background-position:4px;left:auto;right:0}[dir=rtl] .ilo--credit:after{left:auto;right:1.5541264737rem}}
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.ilo--card__type__data{--max-width:32.154340836rem;background:#ebf5fd;border-bottom:.1607717042rem solid #bedcfa;padding:2.5723472669rem 2.1436227224rem 3.0010718114rem;position:relative;width:100%}.ilo--card__type__data .ilo--card--content{display:grid;grid-template-columns:1fr;grid-template-rows:auto;row-gap:1.3933547696rem}@media screen and (min-width:610px){.ilo--card__type__data{padding:2.5723472669rem}.ilo--card__type__data__columns__two .ilo--card--content{grid-template-columns:minmax(10.718113612rem,32%) minmax(53%,1fr);column-gap:14%}.ilo--card__type__data__columns__two .ilo--card--content__with-image .ilo--card--area--image{grid-column:1/2;grid-row:1/span 4}.ilo--card__type__data__columns__two .ilo--card--content__with-image .ilo--card--area--content,.ilo--card__type__data__columns__two .ilo--card--content__with-image .ilo--card--area--cta,.ilo--card__type__data__columns__two .ilo--card--content__with-image .ilo--card--area--files,.ilo--card__type__data__columns__two .ilo--card--content__with-image .ilo--card--area--links{grid-column:2/3}.ilo--card__type__data__columns__two .ilo--card--content__no-image-with-links .ilo--card--area--content,.ilo--card__type__data__columns__two .ilo--card--content__no-image-with-links .ilo--card--area--files{grid-column:1/2}.ilo--card__type__data__columns__two .ilo--card--content__no-image-with-links .ilo--card--area--cta{grid-column:1/2/3/3}.ilo--card__type__data__columns__two .ilo--card--content__no-image-with-links .ilo--card--area--links{grid-area:1/2/3/3}}.ilo--card__type__data.ilo--card__size__narrow{--max-width:16.1307609861rem;clip-path:polygon(0 0,calc(100% - 72px) 0,100% 40px,100% 100%,0 100%);padding:2.1436227224rem 1.2861736334rem 3.0010718114rem}@media screen and (max-width:609px){.ilo--card__type__data.ilo--card__size__narrow{--max-width:100%}}.ilo--card__type__data.ilo--card__size__wide{--max-width:41.6934619507rem}.ilo--card__type__data.ilo--card__size__wide.ilo--card__type__data__columns__one{padding:2.5723472669rem 2.1436227224rem 3.0010718114rem}.ilo--card__type__data.ilo--card__size__wide.ilo--card__type__data__columns__two{padding:2.5723472669rem 2.5723472669rem 3.0010718114rem 6.0021436227rem}.ilo--card__type__data.ilo--card__size__fluid,.ilo--card__type__data.ilo--card__size__wide{clip-path:polygon(0 0,calc(100% - 86px) 0,100% 48px,100% 100%,0 100%)}.ilo--card__type__data .ilo--card--image{width:100%;max-width:200px}.ilo--card__type__data--content-label{font-size:14.93px;letter-spacing:normal;line-height:20.3px;margin-bottom:.4932760997rem;color:#6d6d6d}.ilo--card__type__data .ilo--card--eyebrow{margin:0 0 .857449089rem}.ilo--card__type__data--content-copy{font-size:23.32px;letter-spacing:-.035em;line-height:29.15px;color:#2d2d2d;font-family:Overpass,Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-weight:500}.ilo--card__type__data [class*=ilo--link]{font-size:18.66px;letter-spacing:-.035em;line-height:24.26px;line-height:1.8;margin-inline-end:.6430868167rem;margin-bottom:.6430868167rem}.ilo--card__type__data [class*=button]{margin:.2143622722rem .4287245445rem .2143622722rem 0}.ilo--card__type__data [class*=button]:last-of-type{margin-right:0}
@@ -0,0 +1 @@
1
+ .ilo--datepicker{cursor:pointer}.ilo--datepicker::-webkit-calendar-picker-indicator{cursor:pointer}.ilo--input.ilo--datepicker{padding:.6430868167rem .857449089rem}
@@ -0,0 +1,20 @@
1
+ {# datepicker.twig #}
2
+
3
+ {% extends "@components/form/formcontrol.twig" %}
4
+
5
+
6
+ {# Default values and input preparation #}
7
+ {% set disabled = disabled|default(false) %}
8
+ {% set inputClass = 'ilo' ~ '--input' %}
9
+ {% set baseClass = 'ilo' ~ '--datepicker' %}
10
+ {% set datePickerClasses = [inputClass, baseClass] %}
11
+
12
+ {% if error %}
13
+ {% set datePickerClasses = datePickerClasses|merge(['error']) %}
14
+ {% endif %}
15
+
16
+ {% block formfield %}
17
+
18
+ <input type="date" id="{{ id|default(name) }}" name="{{ name }}" {% if onBlur %} onblur="{{ onBlur }}" {% endif %} {% if disabled %} disabled {% endif %} placeholder="{{ placeholder|default('') }}" {% if required %} required {% endif %} class="{{ datePickerClasses|join(' ') }}" {% if max %} max="{{ max }}" {% endif %} {% if min %} min="{{ min }}" {% endif %} {% if step %} step="{{ step }}" {% endif %} {% if ariaDescribedBy %} aria-describedby="{{ ariaDescribedBy }}" {% endif %}/>
19
+
20
+ {% endblock %}
@@ -0,0 +1,72 @@
1
+ datepicker:
2
+ namespace: Components/Forms
3
+ use: "@components/datepicker/datepicker.twig"
4
+ label: Date Picker
5
+ description: The Date Picker component is used to select a date from a calendar.
6
+ visibility: storybook
7
+ fields:
8
+ label:
9
+ type: text
10
+ label: Label
11
+ description: The label for the form element.
12
+ preview: "Select a date"
13
+ tooltip:
14
+ type: string
15
+ label: Tooltip
16
+ description: The tooltip for the form element.
17
+ helper:
18
+ type: text
19
+ label: Helper Text
20
+ description: The helper text for the form element.
21
+ id:
22
+ type: text
23
+ label: ID
24
+ description: The ID of the input.
25
+ name:
26
+ type: text
27
+ label: Name
28
+ description: The name of the input.
29
+ class:
30
+ type: text
31
+ label: Class
32
+ description: The class of the form field.
33
+ preview: checkbox
34
+ default: ""
35
+ settings:
36
+ labelPlacement:
37
+ type: select
38
+ label: Label Placement
39
+ description: The placement of the label for the form element.
40
+ preview: "top"
41
+ options:
42
+ start: start
43
+ end: end
44
+ top: top
45
+ bottom: bottom
46
+ labelSize:
47
+ type: select
48
+ label: Label Size
49
+ description: The size of the label for the form element.
50
+ preview: medium
51
+ options:
52
+ small: small
53
+ medium: medium
54
+ large: large
55
+ disabled:
56
+ type: boolean
57
+ label: Disabled
58
+ description: The disabled state of the form element.
59
+ preview: false
60
+ default: false
61
+ required:
62
+ type: boolean
63
+ label: Required
64
+ description: The required state of the form element.
65
+ preview: false
66
+ default: false
67
+ error:
68
+ type: boolean
69
+ label: Error
70
+ description: Adds an error state to the form control.
71
+ preview: false
72
+ default: false
@@ -0,0 +1 @@
1
+ .ilo--card__type__detail{--max-width:18.3815648446rem;border-bottom:.1607717042rem solid #edf0f2;padding:1.7148981779rem 0;position:relative;transition-property:border;transition-duration:.15s;transition-timing-function:ease-out}@media screen and (min-width:1024px){.ilo--card__type__detail{padding:1.7148981779rem 0}}@media screen and (max-width:609px){.ilo--card__type__detail{--max-width:100%}}.ilo--card__type__detail:focus,.ilo--card__type__detail:focus-within,.ilo--card__type__detail: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));border-bottom:.1607717042rem solid #1e2dbe}.ilo--card__type__detail:focus-within picture:before,.ilo--card__type__detail:focus picture:before,.ilo--card__type__detail:hover picture:before{opacity:.4;z-index:2}.ilo--card__type__detail:focus-within .ilo--card--date-extra:before,.ilo--card__type__detail:focus .ilo--card--date-extra:before,.ilo--card__type__detail:hover .ilo--card--date-extra:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 11'%3E%3Cpath fill='%231E2DBE' d='M6 10.846L12 0H0l6 10.846z'/%3E%3C/svg%3E")}.ilo--card__type__detail .ilo--card--eyebrow{margin-bottom:.857449089rem}.ilo--card__type__detail .ilo--card--title{padding:0 0 .4287245445rem}@media screen and (min-width:1024px){.ilo--card__size__wide .ilo--card__type__detail .ilo--card--title{font-size:23.32px;line-height:29.15px;font-size:18.66px;letter-spacing:-.035em;line-height:24.26px}}.ilo--card__type__detail.ilo--card__size__fluid,.ilo--card__type__detail.ilo--card__size__wide{--max-width:39.9249732047rem}@media screen and (min-width:1024px){.ilo--card__type__detail.ilo--card__size__fluid .ilo--card--title,.ilo--card__type__detail.ilo--card__size__wide .ilo--card--title{font-size:23.32px;letter-spacing:-.035em;line-height:29.15px}}@media screen and (min-width:1024px){.ilo--card__type__detail.ilo--card__size__fluid .ilo--card--image--wrapper,.ilo--card__type__detail.ilo--card__size__wide .ilo--card--image--wrapper{flex:0 0 10.5037513398rem}}@media screen and (min-width:1024px){.ilo--card__type__detail.ilo--card__size__fluid .ilo--card--picture,.ilo--card__type__detail.ilo--card__size__wide .ilo--card--picture{width:10.5037513398rem}}.ilo--card__type__detail.ilo--card__size__narrow{--max-width:18.3815648446rem}@media screen and (max-width:609px){.ilo--card__type__detail.ilo--card__size__narrow{--max-width:100%}}.ilo--card__type__detail picture{display:flex;position:relative}.ilo--card__type__detail picture:before{background-color:#1e2dbe;content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:-1;transition-property:opacity;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card__type__detail .ilo--card--wrap{display:flex}.ilo--card__type__detail .ilo--card--title{font-size:18.66px;letter-spacing:-.035em;line-height:24.26px}.ilo--card__type__detail .ilo--card--image--wrapper{flex:0 0 4.1264737406rem}.ilo--card__type__detail .ilo--card--picture{object-fit:contain;width:4.1264737406rem}.ilo--card__type__detail .ilo--card--content{padding:0 1.2861736334rem}.ilo--card__type__detail .ilo--card--date-extra{font-size:16px;letter-spacing:normal;line-height:23.36px;margin-bottom:0;padding-left:1.2861736334rem;position:relative}.ilo--card__type__detail .ilo--card--date-extra:before{background-repeat:no-repeat;content:"";display:inline-block;height:.7502679528rem;left:0;position:absolute;top:50%;transform:rotate(-90deg) translateX(50%);width:.6430868167rem;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 11'%3E%3Cpath fill='%232D2D2D' d='M6 10.846L12 0H0l6 10.846z'/%3E%3C/svg%3E")}.ilo--card__type__detail .ilo--card--date{font-size:16px;letter-spacing:normal;line-height:23.36px}
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.ilo--dropdown{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:.1071811361rem solid #b8c4cc;border-radius:0;box-sizing:content-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.4115755627rem;margin:0;outline:0;padding:0 3.0010718114rem 0 .857449089rem;white-space:nowrap;width:calc(100% - 78px);background-position:calc(100% - 14px) 50%,100%;background-repeat:no-repeat;background-size:24px 24px,102px 100%;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='M12 16.78l-8-8 1.455-1.56L12 13.767l6.546-6.545L20 8.779l-8 8z'/%3E%3C/svg%3E"),linear-gradient(90deg,transparent 0,transparent calc(50% - .81px),#b8c4cc calc(50% - .8px),#b8c4cc calc(50% + .8px),#edf0f2 calc(50% + .81px),#edf0f2)}.ilo--dropdown,.ilo--dropdown option{overflow:hidden;text-overflow:ellipsis}.ilo--dropdown option{width:calc(100% - 48px)}.ilo--dropdown:hover{cursor:pointer}.ilo--dropdown:focus,.ilo--dropdown:hover{background-color:#ebf5fd;border-bottom:.1071811361rem solid #b8c4cc;border-left:.1607717042rem solid #1e2dbe;border-right:.1071811361rem solid #b8c4cc;border-top:.1071811361rem solid #b8c4cc;border-left-width:2px;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='M12 16.78l-8-8 1.455-1.56L12 13.767l6.546-6.545L20 8.779l-8 8z'/%3E%3C/svg%3E"),linear-gradient(90deg,transparent 0,transparent calc(50% - .81px),#b8c4cc calc(50% - .8px),#b8c4cc calc(50% + .8px),transparent calc(50% + .81px),transparent)}.ilo--dropdown:active{background-position:calc(100% - 14px) 50%,100%;background-repeat:no-repeat;background-size:24px 24px,102px 100%;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='M12 16.78l-8-8 1.455-1.56L12 13.767l6.546-6.545L20 8.779l-8 8z'/%3E%3C/svg%3E"),linear-gradient(90deg,transparent 0,transparent calc(50% - .81px),#b8c4cc calc(50% - .8px),#b8c4cc calc(50% + .8px),#edf0f2 calc(50% + .81px),#edf0f2);border:.1071811361rem solid #b8c4cc}.ilo--dropdown:disabled{opacity:.45;pointer-events:none}.error .ilo--dropdown,.ilo--dropdown.error,.ilo--dropdown:invalid{background-color:#fff;border-bottom:.1071811361rem solid #b8c4cc;border-left:.1607717042rem solid #c8303c;border-right:.1071811361rem solid #b8c4cc;border-top:.1071811361rem solid #b8c4cc}[dir=rtl] .ilo--dropdown{padding:0 .857449089rem 0 3.0010718114rem;background-position:calc(0% + 14px) 50%,0;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='M12 16.78l-8-8 1.455-1.56L12 13.767l6.546-6.545L20 8.779l-8 8z'/%3E%3C/svg%3E"),linear-gradient(270deg,transparent 0,transparent calc(50% - .81px),#b8c4cc calc(50% - .8px),#b8c4cc calc(50% + .8px),#edf0f2 calc(50% + .81px),#edf0f2)}
@@ -0,0 +1,22 @@
1
+ {# dropdown.twig #}
2
+
3
+ {% extends "@components/form/formcontrol.twig" %}
4
+
5
+ {% set disabled = disabled|default(false) %}
6
+ {% set baseClass = 'ilo' ~ '--dropdown' %}
7
+ {% set dropdownClasses = [baseClass, class] %}
8
+ {% if error %}
9
+ {% set dropdownClasses = dropdownClasses|merge(['error']) %}
10
+ {% endif %}
11
+
12
+ {% block formfield %}
13
+ <div class="{{ baseClass }}--wrapper" {% if style %} style="{{ style }}" {% endif %}>
14
+ <select id="{{ id|default(name) }}" autocomplete="{{ autocomplete|default('off') }}" name="{{ name }}" {% if required %} required {% endif %} {% if onBlur %} onblur="{{ onBlur }}" {% endif %} {% if disabled %} disabled {% endif %} class="{{ dropdownClasses|join(' ') }}" value="{{ currentvalue|default(value) }}" {% if form %} form="{{ form }}" {% endif %} {% if multiple %} multiple {% endif %} {% if selectSize %} size="{{ selectSize }}" {% endif %} {% if ariaDescribedBy %} aria-describedby="{{ ariaDescribedBy }}" {% endif %}>
15
+ {% for option in options %}
16
+ <option {% if option.disabled %} disabled {% endif %} value="{{ option.value }}" {% if defaultOption and defaultOption == option.value %} selected {% endif %}>
17
+ {{ option.label }}
18
+ </option>
19
+ {% endfor %}
20
+ </select>
21
+ </div>
22
+ {% endblock %}
@@ -0,0 +1,101 @@
1
+ dropdown:
2
+ namespace: Components/Forms
3
+ use: "@components/dropdown/dropdown.twig"
4
+ label: Dropdown
5
+ description: The Dropdown displays a select element with options, and is most
6
+ commonly used in forms.
7
+ visibility: storybook
8
+ fields:
9
+ label:
10
+ type: text
11
+ label: Label
12
+ description: The label for the form element.
13
+ preview: "Select a country"
14
+ tooltip:
15
+ type: string
16
+ label: Tooltip
17
+ description: The tooltip for the form element.
18
+ helper:
19
+ type: text
20
+ label: Helper Text
21
+ description: The helper text for the form element.
22
+ id:
23
+ type: text
24
+ label: ID
25
+ description: The ID of the input.
26
+ name:
27
+ type: text
28
+ label: Name
29
+ description: The name of the input.
30
+ class:
31
+ type: text
32
+ label: Class
33
+ description: The class of the form field.
34
+ preview: checkbox
35
+ default: ""
36
+ style:
37
+ type: text
38
+ label: Style
39
+ description: The style of the form field.
40
+ defaultOption:
41
+ type: text
42
+ label: Default Option
43
+ description: The value of the default option for the form element.
44
+ preview: "TH"
45
+ options:
46
+ type: object
47
+ label: Options
48
+ description: The options for the form element.
49
+ preview:
50
+ - label: Switzerland
51
+ value: CH
52
+ - label: Côte d'Ivoire
53
+ value: CI
54
+ - label: Thailand
55
+ value: TH
56
+ - label: United States
57
+ value: US
58
+ - label: Zimbabwe
59
+ value: ZW
60
+ - label: Afghanistan
61
+ value: AF
62
+ - label: Åland Islands
63
+ value: AX
64
+ settings:
65
+ labelPlacement:
66
+ type: select
67
+ label: Label Placement
68
+ description: The placement of the label for the form element.
69
+ preview: "top"
70
+ options:
71
+ start: start
72
+ end: end
73
+ top: top
74
+ bottom: bottom
75
+ labelSize:
76
+ type: select
77
+ label: Label Size
78
+ description: The size of the label for the form element.
79
+ preview: medium
80
+ options:
81
+ small: small
82
+ medium: medium
83
+ large: large
84
+ disabled:
85
+ type: boolean
86
+ label: Disabled
87
+ description: The disabled state of the form element.
88
+ preview: false
89
+ default: false
90
+ required:
91
+ type: boolean
92
+ label: Required
93
+ description: The required state of the form element.
94
+ preview: false
95
+ default: false
96
+ error:
97
+ type: boolean
98
+ label: Error
99
+ description: Adds an error state to the form control.
100
+ preview: false
101
+ default: false
@@ -0,0 +1 @@
1
+ @keyframes a{0%{opacity:1}to{opacity:0}}.ilo--empty{position:relative}.ilo--empty,.ilo--empty:before{background:linear-gradient(108.07deg,#b8c4cc .17%,#ebf5fd 75.36%);border-radius:4px;height:100%;width:100%}.ilo--empty:before{animation-duration:2s;animation-name:a;animation-iteration-count:infinite;animation-direction:alternate;content:"";left:0;position:absolute;top:0;transform:rotate(-180deg);z-index:1}.ilo--empty.storybook{height:400px;width:600px}
@@ -0,0 +1 @@
1
+ .ilo--card__type__factlist{--max-width:20.0964630225rem;border-bottom:.1607717042rem solid #b8c4cc;padding:2.1436227224rem 1.2861736334rem 2.5723472669rem;clip-path:polygon(0 0,calc(100% - 72px) 0,100% 40px,100% 100%,0 100%)}@media screen and (min-width:1024px){.ilo--card__type__factlist{padding:2.5723472669rem 2.1436227224rem 3.0010718114rem}}.ilo--card__type__factlist.ilo--card__size__wide{--max-width:45.8735262594rem;padding:2.5723472669rem 2.1436227224rem 3.0010718114rem}@media screen and (min-width:610px){.ilo--card__type__factlist.ilo--card__size__wide{clip-path:polygon(0 0,calc(100% - 87px) 0,100% 48px,100% 100%,0 100%)}}.ilo--card__type__factlist.ilo--card__size__narrow{--max-width:20.0964630225rem;padding:2.1436227224rem 1.2861736334rem 2.5723472669rem;clip-path:polygon(0 0,calc(100% - 72px) 0,100% 40px,100% 100%,0 100%)}.ilo--card__type__factlist.ilo--card__theme__dark{border-bottom:.1607717042rem solid #fa3c4b}.ilo--card__type__factlist.ilo--card__theme__dark .ilo--card--title,.ilo--card__type__factlist.ilo--card__theme__dark .ilo--list__item{color:#fff}.ilo--card__type__factlist.ilo--card__theme__dark .ilo--list__item:last-of-type{margin-bottom:0}.ilo--card__type__factlist.ilo--card__theme__dark:focus-within .ilo--card--title,.ilo--card__type__factlist.ilo--card__theme__dark:focus .ilo--card--title,.ilo--card__type__factlist.ilo--card__theme__dark:hover .ilo--card--title{color:#fff}.ilo--card__type__factlist.ilo--card__theme__dark:focus-within .ilo--list__item,.ilo--card__type__factlist.ilo--card__theme__dark:focus .ilo--list__item,.ilo--card__type__factlist.ilo--card__theme__dark:hover .ilo--list__item{color:#fff}.ilo--card__type__factlist .ilo--card--title{color:#2d2d2d;font-size:23.32px;letter-spacing:-.035em;line-height:29.15px;margin-bottom:1.1476152197rem}@media screen and (min-width:1024px){.ilo--card__type__factlist .ilo--card--title{font-size:29.16px;letter-spacing:-.035em;line-height:36.45px;margin-bottom:1.4315916399rem}}
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.ilo--card__type__feature{--max-width:22.0793140407rem;border-bottom:.1607717042rem solid #b8c4cc;display:flex;margin-top:0;position:relative}.ilo--card__type__feature.ilo--card__theme__dark{border-bottom:.1607717042rem solid #fa3c4b}.ilo--card__type__feature.ilo--card__theme__dark .ilo--link-list{border-top:2px solid rgba(237,240,242,.25)}.ilo--card__type__feature.ilo--card__theme__dark .ilo--link-list--link{color:#fff;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='%23FFF' d='M8.638 19.996l-.988-.988L14.657 12 7.65 4.992l.988-.989 7.505 7.5a.702.702 0 0 1 0 .995l-7.505 7.498z'/%3E%3C/svg%3E")}[dir=rtl] .ilo--card__type__feature.ilo--card__theme__dark .ilo--link-list--link{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='%23FFF' d='M7.9 12.5l-.2-.2c0-.1-.1-.2-.1-.3s0-.2.1-.3c0-.1.1-.2.2-.2L15.4 4l1 1-7 7 7 7-1 1-7.5-7.5z'/%3E%3C/svg%3E")}.ilo--card__type__feature.ilo--card__theme__dark:focus-within .ilo--link-list--link,.ilo--card__type__feature.ilo--card__theme__dark:focus .ilo--link-list--link,.ilo--card__type__feature.ilo--card__theme__dark:hover .ilo--link-list--link{color:#1e2dbe;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='M8.638 19.996l-.988-.988L14.657 12 7.65 4.992l.988-.989 7.505 7.5a.702.702 0 0 1 0 .995l-7.505 7.498z'/%3E%3C/svg%3E")}[dir=rtl] .ilo--card__type__feature.ilo--card__theme__dark:focus-within .ilo--link-list--link,[dir=rtl] .ilo--card__type__feature.ilo--card__theme__dark:focus .ilo--link-list--link,[dir=rtl] .ilo--card__type__feature.ilo--card__theme__dark:hover .ilo--link-list--link{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='M7.9 12.5l-.2-.2c0-.1-.1-.2-.1-.3s0-.2.1-.3c0-.1.1-.2.2-.2L15.4 4l1 1-7 7 7 7-1 1-7.5-7.5z'/%3E%3C/svg%3E")}.ilo--card__type__feature picture:before{transition-property:opacity;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card__type__feature:focus,.ilo--card__type__feature:focus-within,.ilo--card__type__feature:hover{background-color:#fff;border-bottom:.1607717042rem solid #1e2dbe;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))}.ilo--card__type__feature:focus-within picture:before,.ilo--card__type__feature:focus picture:before,.ilo--card__type__feature:hover picture:before{opacity:.4;z-index:1;transition-property:opacity;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card__type__feature:focus-within .ilo--card--picture,.ilo--card__type__feature:focus .ilo--card--picture,.ilo--card__type__feature:hover .ilo--card--picture{filter:saturate(0)}.ilo--card__type__feature .ilo--link-list{border-top:.1071811361rem solid #edf0f2;margin-left:-1.2861736334rem;margin-right:-1.2861736334rem;position:relative;z-index:2}.ilo--card__type__feature .ilo--link-list--link,.ilo--card__type__feature .ilo--link-list--link:hover{border-bottom:none;padding-inline:1.2861736334rem .4287245445rem}.ilo--card__type__feature.ilo--card__size__narrow .ilo--card--wrap{display:flex;flex-wrap:wrap;width:100%}.ilo--card__type__feature.ilo--card__size__narrow .ilo--card--content,.ilo--card__type__feature.ilo--card__size__narrow .ilo--card--image--wrapper{width:100%}.ilo--card__type__feature.ilo--card__size__fluid,.ilo--card__type__feature.ilo--card__size__wide{--max-width:40.4072883173rem}@media screen and (min-width:610px){.ilo--card__type__feature.ilo--card__size__fluid .ilo--card--wrap,.ilo--card__type__feature.ilo--card__size__wide .ilo--card--wrap{flex-direction:row}.ilo--card__type__feature.ilo--card__size__fluid .ilo--card--content,.ilo--card__type__feature.ilo--card__size__wide .ilo--card--content{display:flex;flex-direction:row;flex-wrap:wrap;position:relative;width:50%}.ilo--card__type__feature.ilo--card__size__fluid .ilo--card--image--wrapper,.ilo--card__type__feature.ilo--card__size__wide .ilo--card--image--wrapper{width:50%}.ilo--card__type__feature.ilo--card__size__fluid .ilo--card--image,.ilo--card__type__feature.ilo--card__size__wide .ilo--card--image{object-fit:cover}.ilo--card__type__feature.ilo--card__size__fluid .ilo--card--date,.ilo--card__type__feature.ilo--card__size__wide .ilo--card--date{align-self:flex-end;width:100%}.ilo--card__type__feature.ilo--card__size__fluid .ilo--card--eyebrow,.ilo--card__type__feature.ilo--card__size__fluid .ilo--card--title,.ilo--card__type__feature.ilo--card__size__wide .ilo--card--eyebrow,.ilo--card__type__feature.ilo--card__size__wide .ilo--card--title{width:100%}.ilo--card__type__feature.ilo--card__size__fluid .ilo--link-list,.ilo--card__type__feature.ilo--card__size__wide .ilo--link-list{width:calc(100% + 48px);align-self:flex-end}}.ilo--card__type__feature .ilo--card--wrap{display:flex;flex-direction:column;width:100%}.ilo--card__type__feature picture{display:flex;height:100%;position:relative}.ilo--card__type__feature picture:before{background-color:#1e2dbe;content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .15s ease-in-out;width:100%;z-index:-1}.ilo--card__type__feature picture img{object-fit:cover}.ilo--card__type__feature .ilo--card--content{display:flex;flex:1 1 auto;flex-direction:column;padding:1.2861736334rem 1.2861736334rem .4287245445rem}.ilo--card__type__feature.ilo--card__linklist .ilo--card--content{padding-bottom:0}.ilo--card__type__feature .ilo--card--title{font-size:23.32px;letter-spacing:-.035em;line-height:29.15px;margin-bottom:1.2861736334rem;font-family:Overpass,Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-weight:700;flex:1}.ilo--card__type__feature .ilo--card--eyebrow{font-size:14.93px;letter-spacing:normal;line-height:19.71px;margin-bottom:.3376482577rem}.ilo--card__type__feature .ilo--card--date{margin-bottom:1.7148981779rem;margin-top:auto}
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.ilo--fieldset{box-sizing:border-box;appearance:none}.ilo--fieldset--legend-wrapper{margin-bottom:.8717716645rem}.ilo--fieldset--legend-wrapper .ilo--tooltip--wrapper{top:.1071811361rem}.ilo--fieldset--legend{font-family:Overpass,Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-weight:700;font-size:16px;letter-spacing:-.02em;line-height:21.6px}.ilo--fieldset--direction__column>.ilo--fieldset--elements{display:flex;justify-content:flex-start;align-items:flex-start;flex-direction:column;gap:.8717716645rem}.ilo--fieldset--direction__row>.ilo--fieldset--elements{display:flex;justify-content:flex-start;align-items:flex-start;flex-direction:row;gap:.8717716645rem}.ilo--fieldset--direction__row-reverse>.ilo--fieldset--elements{display:flex;justify-content:flex-start;align-items:flex-start;flex-direction:row-reverse;gap:.8717716645rem}.ilo--fieldset--direction__column-reverse>.ilo--fieldset--elements{display:flex;justify-content:flex-start;align-items:flex-start;flex-direction:column-reverse;gap:.8717716645rem}.ilo--fieldset--wrap__nowrap>.ilo--fieldset--elements{flex-wrap:nowrap}.ilo--fieldset--wrap__wrap>.ilo--fieldset--elements{flex-wrap:wrap}.ilo--fieldset--wrap__wrap-reverse>.ilo--fieldset--elements{flex-wrap:wrap-reverse}.ilo--fieldset--wrap__reverse>.ilo--fieldset--elements{flex-wrap:reverse}.ilo--fieldset--helper,.ilo--fieldset__error{font-family:Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-size:11.94px;letter-spacing:normal;line-height:16.24px;margin-top:.4832142725rem}.ilo--fieldset--helper{color:#6d6d6d}.ilo--fieldset__error{color:#c8303c}.ilo--fieldset__disabled{opacity:.5;pointer-events:none}.ilo--fieldset .ilo--tooltip--wrapper{margin-left:.2143622722rem}
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.ilo--file-upload--input{order:3;background-color:#fff;border:1.5px solid #b8c4cc;color:#230050;content:attr(data-label);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:700;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border-top-left-radius:2px;border-top-right-radius:2px;padding:7px 18px;font-size:16px;letter-spacing:-.02em;line-height:21.6px}.ilo--file-upload--input input{visibility:hidden;color:transparent;width:0}.ilo--form__theme__dark .ilo--file-upload--input{color:#230050}.ilo--file-upload--input:hover{background-color:#ebf5fd;border:1.5px solid #1e2dbe;cursor:pointer;color:#1e2dbe;outline:0}.ilo--file-upload--input:focus{background-color:#fff;border:1.5px solid #1e2dbe;color:#230050;outline:0}.ilo--file-upload--input:focus-visible{outline:0}.ilo--file-upload--input:active{background-color:#1e2dbe;border:2px solid #1e2dbe;color:#ebf5fd}.ilo--file-upload--input:disabled{opacity:.45;pointer-events:none}.error .ilo--file-upload--input,.ilo--file-upload--input.error,.ilo--file-upload--input:invalid{background-color:#fff;border-bottom:.1071811361rem solid #b8c4cc;border-left:.1607717042rem solid #c8303c;border-right:.1071811361rem solid #b8c4cc;border-top:.1071811361rem solid #b8c4cc}.ilo--file-upload--list{order:4;display:flex;flex-flow:column;padding-top:.4287245445rem;gap:.4287245445rem}.ilo--file-upload--list-item{display:block;background-color:#edf0f2;border-bottom:.1071811361rem solid #edf0f2;border-left:.1607717042rem solid #230050;border-right:.1071811361rem solid #edf0f2;border-top:.1071811361rem solid #edf0f2;box-sizing:border-box;font-family:Overpass,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;outline:0;padding:.6430868167rem .6430868167rem .857449089rem}
@@ -0,0 +1 @@
1
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function t(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}function n(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||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 r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o="change",i=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.prefix=this.element.dataset.prefix,this.init()},r=[{key:"init",value:function(){return this.cacheDomReferences().setupHandlers().enable(),this}},{key:"cacheDomReferences",value:function(){return this.container=this.element.parentElement.parentElement,this.formControl=this.container.parentElement,this}},{key:"setupHandlers",value:function(){return this.onChange=this.onChange.bind(this),this}},{key:"enable",value:function(){var e=this;return this.element.addEventListener(o,(function(t){return e.onChange(t)})),this}},{key:"formatBytes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!+e)return"0 Bytes";var n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,r)).toFixed(n))," ").concat(["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r])}},{key:"onChange",value:function(){var e=this,t="".concat(this.prefix,"--file-upload--list"),r=this.formControl.querySelector(".".concat(t));r&&r.remove(),(r=document.createElement("ul")).classList.add(t),this.formControl.appendChild(r);var o="";return n(this.element.files).forEach((function(t){var n=e.formatBytes(t.size);o+=e.template(t.name,n)})),r.innerHTML=o,this}},{key:"template",value:function(e,t){return'<li class="ilo--file-upload--list-item">'.concat(e," (").concat(t,")</li>")}}],r&&t(e.prototype,r),i&&t(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,i}();Drupal.behaviors.fileupload={attach:function(){Array.prototype.forEach.call(document.querySelectorAll('[data-loadcomponent="FileUpload"]'),(function(e){new i(e)}))}}}));
@@ -0,0 +1,20 @@
1
+ {# fileupload.twig #}
2
+
3
+ {% extends "@components/form/formcontrol.twig" %}
4
+
5
+ {% set baseClass = 'ilo' ~ '--file-upload' %}
6
+ {% set fileUploadClasses = [baseClass] %}
7
+ {% set inputClass = baseClass ~ '--input' %}
8
+
9
+ {% if error %}
10
+ {% set fileUploadClasses = fileUploadClasses|merge(['error']) %}
11
+ {% endif %}
12
+
13
+ {% block formfield %}
14
+ <div class="{{ fileUploadClasses|join(' ') }}">
15
+ <label class="{{ inputClass }}">
16
+ {{ placeholder }}
17
+ <input id="{{ id|default(name) }}" name="{{ name }}" {% if disabled %} disabled {% endif %} {% if multiple %} multiple {% endif %} placeholder="{{ placeholder }}" {% if required %} required {% endif %} type="file" data-label="{{ placeholder }}" aria-describedby="{{ ariaDescribedBy }}" {% if accept %} accept="{{ accept }}" {% endif %} data-loadcomponent="FileUpload" data-prefix="ilo"/>
18
+ </label>
19
+ </div>
20
+ {% endblock %}