fomantic-ui 2.9.0-beta.24 → 2.9.0-beta.240

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 (273) hide show
  1. package/.all-contributorsrc +206 -3
  2. package/.github/workflows/ci.yml +4 -4
  3. package/.github/workflows/nightly.yml +4 -4
  4. package/.github/workflows/release.yml +30 -0
  5. package/CONTRIBUTORS.md +75 -37
  6. package/README.md +8 -8
  7. package/dist/components/accordion.css +162 -26
  8. package/dist/components/accordion.js +1 -1
  9. package/dist/components/accordion.min.css +2 -2
  10. package/dist/components/accordion.min.js +2 -2
  11. package/dist/components/ad.css +1 -1
  12. package/dist/components/ad.min.css +1 -1
  13. package/dist/components/api.js +34 -30
  14. package/dist/components/api.min.js +3 -3
  15. package/dist/components/breadcrumb.css +1 -1
  16. package/dist/components/breadcrumb.min.css +1 -1
  17. package/dist/components/button.css +176 -134
  18. package/dist/components/button.min.css +2 -2
  19. package/dist/components/calendar.css +18 -1
  20. package/dist/components/calendar.js +10 -9
  21. package/dist/components/calendar.min.css +2 -2
  22. package/dist/components/calendar.min.js +3 -3
  23. package/dist/components/card.css +26 -19
  24. package/dist/components/card.min.css +2 -2
  25. package/dist/components/checkbox.css +2 -1
  26. package/dist/components/checkbox.js +17 -11
  27. package/dist/components/checkbox.min.css +2 -2
  28. package/dist/components/checkbox.min.js +3 -3
  29. package/dist/components/comment.css +11 -11
  30. package/dist/components/comment.min.css +1 -1
  31. package/dist/components/container.css +77 -1
  32. package/dist/components/container.min.css +2 -2
  33. package/dist/components/dimmer.css +28 -14
  34. package/dist/components/dimmer.js +1 -1
  35. package/dist/components/dimmer.min.css +2 -2
  36. package/dist/components/dimmer.min.js +2 -2
  37. package/dist/components/divider.css +1 -1
  38. package/dist/components/divider.min.css +1 -1
  39. package/dist/components/dropdown.css +49 -13
  40. package/dist/components/dropdown.js +60 -35
  41. package/dist/components/dropdown.min.css +2 -2
  42. package/dist/components/dropdown.min.js +3 -3
  43. package/dist/components/embed.css +1 -1
  44. package/dist/components/embed.js +1 -1
  45. package/dist/components/embed.min.css +1 -1
  46. package/dist/components/embed.min.js +2 -2
  47. package/dist/components/emoji.css +2 -2
  48. package/dist/components/feed.css +28 -28
  49. package/dist/components/feed.min.css +2 -2
  50. package/dist/components/flag.css +731 -625
  51. package/dist/components/flag.min.css +2 -2
  52. package/dist/components/form.css +106 -55
  53. package/dist/components/form.js +30 -28
  54. package/dist/components/form.min.css +2 -2
  55. package/dist/components/form.min.js +3 -3
  56. package/dist/components/grid.css +11 -8
  57. package/dist/components/grid.min.css +2 -2
  58. package/dist/components/header.css +3 -1
  59. package/dist/components/header.min.css +2 -2
  60. package/dist/components/icon.css +126 -47
  61. package/dist/components/icon.min.css +2 -2
  62. package/dist/components/image.css +1 -1
  63. package/dist/components/image.min.css +1 -1
  64. package/dist/components/input.css +734 -17
  65. package/dist/components/input.min.css +2 -2
  66. package/dist/components/item.css +13 -13
  67. package/dist/components/item.min.css +1 -1
  68. package/dist/components/label.css +1 -1
  69. package/dist/components/label.min.css +1 -1
  70. package/dist/components/list.css +1 -1
  71. package/dist/components/list.min.css +1 -1
  72. package/dist/components/loader.css +1 -1
  73. package/dist/components/loader.min.css +1 -1
  74. package/dist/components/menu.css +29 -5
  75. package/dist/components/menu.min.css +1 -1
  76. package/dist/components/message.css +41 -41
  77. package/dist/components/message.min.css +2 -2
  78. package/dist/components/modal.css +13 -1
  79. package/dist/components/modal.js +122 -47
  80. package/dist/components/modal.min.css +2 -2
  81. package/dist/components/modal.min.js +3 -3
  82. package/dist/components/nag.css +1 -1
  83. package/dist/components/nag.js +1 -1
  84. package/dist/components/nag.min.css +1 -1
  85. package/dist/components/nag.min.js +2 -2
  86. package/dist/components/placeholder.css +1 -1
  87. package/dist/components/placeholder.min.css +1 -1
  88. package/dist/components/popup.css +1 -1
  89. package/dist/components/popup.js +2 -2
  90. package/dist/components/popup.min.css +1 -1
  91. package/dist/components/popup.min.js +3 -3
  92. package/dist/components/progress.css +1 -1
  93. package/dist/components/progress.js +4 -1
  94. package/dist/components/progress.min.css +1 -1
  95. package/dist/components/progress.min.js +3 -3
  96. package/dist/components/rail.css +1 -1
  97. package/dist/components/rail.min.css +1 -1
  98. package/dist/components/rating.css +7 -46
  99. package/dist/components/rating.js +1 -1
  100. package/dist/components/rating.min.css +2 -2
  101. package/dist/components/rating.min.js +2 -2
  102. package/dist/components/reset.css +1 -1
  103. package/dist/components/reset.min.css +1 -1
  104. package/dist/components/reveal.css +1 -1
  105. package/dist/components/reveal.min.css +1 -1
  106. package/dist/components/search.css +1 -1
  107. package/dist/components/search.js +1 -1
  108. package/dist/components/search.min.css +1 -1
  109. package/dist/components/search.min.js +2 -2
  110. package/dist/components/segment.css +90 -6
  111. package/dist/components/segment.min.css +2 -2
  112. package/dist/components/shape.css +1 -1
  113. package/dist/components/shape.js +1 -1
  114. package/dist/components/shape.min.css +1 -1
  115. package/dist/components/shape.min.js +2 -2
  116. package/dist/components/sidebar.css +4 -2
  117. package/dist/components/sidebar.js +2 -2
  118. package/dist/components/sidebar.min.css +2 -2
  119. package/dist/components/sidebar.min.js +3 -3
  120. package/dist/components/site.css +61 -39
  121. package/dist/components/site.js +1 -1
  122. package/dist/components/site.min.css +2 -2
  123. package/dist/components/site.min.js +2 -2
  124. package/dist/components/slider.js +1 -1
  125. package/dist/components/slider.min.js +2 -2
  126. package/dist/components/state.js +1 -1
  127. package/dist/components/state.min.js +2 -2
  128. package/dist/components/statistic.css +1 -1
  129. package/dist/components/statistic.min.css +1 -1
  130. package/dist/components/step.css +4 -4
  131. package/dist/components/step.min.css +2 -2
  132. package/dist/components/sticky.css +1 -1
  133. package/dist/components/sticky.js +1 -1
  134. package/dist/components/sticky.min.css +1 -1
  135. package/dist/components/sticky.min.js +2 -2
  136. package/dist/components/tab.css +1 -1
  137. package/dist/components/tab.js +23 -5
  138. package/dist/components/tab.min.css +1 -1
  139. package/dist/components/tab.min.js +3 -3
  140. package/dist/components/table.css +1168 -26
  141. package/dist/components/table.min.css +2 -2
  142. package/dist/components/text.css +1 -1
  143. package/dist/components/text.min.css +1 -1
  144. package/dist/components/toast.css +39 -1
  145. package/dist/components/toast.js +56 -28
  146. package/dist/components/toast.min.css +2 -2
  147. package/dist/components/toast.min.js +3 -3
  148. package/dist/components/transition.css +1 -1
  149. package/dist/components/transition.js +1 -1
  150. package/dist/components/transition.min.css +1 -1
  151. package/dist/components/transition.min.js +2 -2
  152. package/dist/components/visibility.js +1 -1
  153. package/dist/components/visibility.min.js +2 -2
  154. package/dist/semantic.css +4600 -1517
  155. package/dist/semantic.js +375 -213
  156. package/dist/semantic.min.css +3 -3
  157. package/dist/semantic.min.js +3 -3
  158. package/dist/themes/default/assets/fonts/brand-icons.eot +0 -0
  159. package/dist/themes/default/assets/fonts/brand-icons.svg +801 -654
  160. package/dist/themes/default/assets/fonts/brand-icons.ttf +0 -0
  161. package/dist/themes/default/assets/fonts/brand-icons.woff +0 -0
  162. package/dist/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  163. package/dist/themes/default/assets/fonts/icons.eot +0 -0
  164. package/dist/themes/default/assets/fonts/icons.svg +1175 -1079
  165. package/dist/themes/default/assets/fonts/icons.ttf +0 -0
  166. package/dist/themes/default/assets/fonts/icons.woff +0 -0
  167. package/dist/themes/default/assets/fonts/icons.woff2 +0 -0
  168. package/dist/themes/default/assets/fonts/outline-icons.eot +0 -0
  169. package/dist/themes/default/assets/fonts/outline-icons.svg +93 -95
  170. package/dist/themes/default/assets/fonts/outline-icons.ttf +0 -0
  171. package/dist/themes/default/assets/fonts/outline-icons.woff +0 -0
  172. package/dist/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  173. package/examples/assets/library/iframe-content.js +8 -8
  174. package/examples/assets/library/iframe.js +3 -3
  175. package/package.json +10 -9
  176. package/src/definitions/behaviors/api.js +33 -29
  177. package/src/definitions/behaviors/form.js +29 -27
  178. package/src/definitions/collections/form.less +193 -140
  179. package/src/definitions/collections/grid.less +716 -680
  180. package/src/definitions/collections/menu.less +173 -126
  181. package/src/definitions/collections/message.less +48 -46
  182. package/src/definitions/collections/table.less +849 -262
  183. package/src/definitions/elements/button.less +586 -449
  184. package/src/definitions/elements/container.less +126 -8
  185. package/src/definitions/elements/emoji.less +15 -9
  186. package/src/definitions/elements/flag.less +7 -17
  187. package/src/definitions/elements/header.less +44 -35
  188. package/src/definitions/elements/icon.less +38 -31
  189. package/src/definitions/elements/input.less +256 -21
  190. package/src/definitions/elements/label.less +92 -91
  191. package/src/definitions/elements/list.less +55 -45
  192. package/src/definitions/elements/loader.less +30 -29
  193. package/src/definitions/elements/segment.less +146 -27
  194. package/src/definitions/elements/step.less +52 -48
  195. package/src/definitions/elements/text.less +17 -15
  196. package/src/definitions/globals/site.less +23 -2
  197. package/src/definitions/modules/accordion.less +175 -24
  198. package/src/definitions/modules/calendar.js +9 -8
  199. package/src/definitions/modules/calendar.less +20 -0
  200. package/src/definitions/modules/checkbox.js +16 -10
  201. package/src/definitions/modules/checkbox.less +34 -178
  202. package/src/definitions/modules/dimmer.less +21 -8
  203. package/src/definitions/modules/dropdown.js +59 -34
  204. package/src/definitions/modules/dropdown.less +145 -94
  205. package/src/definitions/modules/modal.js +121 -46
  206. package/src/definitions/modules/modal.less +12 -0
  207. package/src/definitions/modules/nag.less +20 -19
  208. package/src/definitions/modules/popup.js +1 -1
  209. package/src/definitions/modules/progress.js +3 -0
  210. package/src/definitions/modules/progress.less +19 -18
  211. package/src/definitions/modules/rating.less +49 -42
  212. package/src/definitions/modules/search.less +32 -16
  213. package/src/definitions/modules/sidebar.js +1 -1
  214. package/src/definitions/modules/sidebar.less +33 -19
  215. package/src/definitions/modules/slider.less +39 -38
  216. package/src/definitions/modules/tab.js +22 -4
  217. package/src/definitions/modules/toast.js +55 -27
  218. package/src/definitions/modules/toast.less +48 -16
  219. package/src/definitions/views/card.less +402 -361
  220. package/src/definitions/views/comment.less +92 -81
  221. package/src/definitions/views/feed.less +164 -144
  222. package/src/definitions/views/item.less +249 -196
  223. package/src/definitions/views/statistic.less +90 -88
  224. package/src/themes/bookish/elements/header.overrides +1 -1
  225. package/src/themes/chubby/elements/button.overrides +1 -1
  226. package/src/themes/chubby/elements/header.overrides +1 -1
  227. package/src/themes/default/assets/fonts/brand-icons.eot +0 -0
  228. package/src/themes/default/assets/fonts/brand-icons.svg +801 -654
  229. package/src/themes/default/assets/fonts/brand-icons.ttf +0 -0
  230. package/src/themes/default/assets/fonts/brand-icons.woff +0 -0
  231. package/src/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  232. package/src/themes/default/assets/fonts/icons.eot +0 -0
  233. package/src/themes/default/assets/fonts/icons.svg +1175 -1079
  234. package/src/themes/default/assets/fonts/icons.ttf +0 -0
  235. package/src/themes/default/assets/fonts/icons.woff +0 -0
  236. package/src/themes/default/assets/fonts/icons.woff2 +0 -0
  237. package/src/themes/default/assets/fonts/outline-icons.eot +0 -0
  238. package/src/themes/default/assets/fonts/outline-icons.svg +93 -95
  239. package/src/themes/default/assets/fonts/outline-icons.ttf +0 -0
  240. package/src/themes/default/assets/fonts/outline-icons.woff +0 -0
  241. package/src/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  242. package/src/themes/default/collections/menu.variables +6 -0
  243. package/src/themes/default/collections/table.variables +52 -0
  244. package/src/themes/default/elements/button.variables +7 -1
  245. package/src/themes/default/elements/container.variables +8 -0
  246. package/src/themes/default/elements/flag.overrides +1635 -986
  247. package/src/themes/default/elements/flag.variables +7 -5
  248. package/src/themes/default/elements/icon.overrides +75 -48
  249. package/src/themes/default/elements/icon.variables +1 -0
  250. package/src/themes/default/elements/input.variables +15 -0
  251. package/src/themes/default/elements/segment.variables +8 -0
  252. package/src/themes/default/elements/step.overrides +1 -1
  253. package/src/themes/default/globals/site.variables +6 -0
  254. package/src/themes/default/globals/variation.variables +139 -6
  255. package/src/themes/default/modules/accordion.variables +49 -2
  256. package/src/themes/default/modules/calendar.variables +3 -0
  257. package/src/themes/default/modules/checkbox.variables +5 -5
  258. package/src/themes/default/modules/dimmer.variables +1 -1
  259. package/src/themes/default/modules/dropdown.variables +4 -10
  260. package/src/themes/default/modules/modal.variables +13 -0
  261. package/src/themes/default/modules/toast.variables +3 -0
  262. package/src/themes/famfamfam/elements/flag.overrides +1026 -0
  263. package/src/themes/famfamfam/elements/flag.variables +13 -0
  264. package/src/themes/instagram/views/card.overrides +1 -1
  265. package/src/themes/material/collections/menu.overrides +1 -1
  266. package/src/themes/material/elements/button.overrides +1 -1
  267. package/src/themes/material/elements/header.overrides +1 -1
  268. package/src/themes/material/modules/dropdown.overrides +1 -1
  269. package/src/themes/material/modules/modal.overrides +1 -1
  270. package/src/themes/rtl/globals/site.overrides +1 -1
  271. package/tasks/build/css.js +6 -1
  272. package/tasks/config/project/install.js +11 -5
  273. package/test/helpers/sinon.js +2 -2
@@ -66,7 +66,8 @@ $.fn.modal = function(parameters) {
66
66
 
67
67
  $module = $(this),
68
68
  $context = $(settings.context),
69
- $close = $module.find(selector.close),
69
+ $closeIcon = $module.find(selector.closeIcon),
70
+ $inputs,
70
71
 
71
72
  $allModals,
72
73
  $otherModals,
@@ -92,6 +93,7 @@ $.fn.modal = function(parameters) {
92
93
  module = {
93
94
 
94
95
  initialize: function() {
96
+ module.create.id();
95
97
  if(!$module.hasClass('modal')) {
96
98
  module.create.modal();
97
99
  if(!$.isFunction(settings.onHidden)) {
@@ -116,15 +118,17 @@ $.fn.modal = function(parameters) {
116
118
  $actions.empty();
117
119
  }
118
120
  settings.actions.forEach(function (el) {
119
- var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
121
+ var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
120
122
  text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
121
123
  cls = module.helpers.deQuote(el[fields.class] || ''),
122
124
  click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
123
125
  $actions.append($('<button/>', {
124
126
  html: icon + text,
127
+ 'aria-label': $('<div>'+(el[fields.text] || el[fields.icon] || '')+'</div>').text(),
125
128
  class: className.button + ' ' + cls,
126
129
  click: function () {
127
- if (click.call(element, $module) === false) {
130
+ var button = $(this);
131
+ if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
128
132
  return;
129
133
  }
130
134
  module.hide();
@@ -135,7 +139,6 @@ $.fn.modal = function(parameters) {
135
139
  module.cache = {};
136
140
  module.verbose('Initializing dimmer', $context);
137
141
 
138
- module.create.id();
139
142
  module.create.dimmer();
140
143
 
141
144
  if ( settings.allowMultiple ) {
@@ -145,11 +148,9 @@ $.fn.modal = function(parameters) {
145
148
  $module.addClass('top aligned');
146
149
  }
147
150
  module.refreshModals();
148
-
151
+ module.refreshInputs();
149
152
  module.bind.events();
150
- if(settings.observeChanges) {
151
- module.observeChanges();
152
- }
153
+ module.observeChanges();
153
154
  module.instantiate();
154
155
  if(settings.autoShow){
155
156
  module.show();
@@ -166,16 +167,20 @@ $.fn.modal = function(parameters) {
166
167
 
167
168
  create: {
168
169
  modal: function() {
169
- $module = $('<div/>', {class: className.modal});
170
+ $module = $('<div/>', {class: className.modal, role: 'dialog', 'aria-modal': true});
170
171
  if (settings.closeIcon) {
171
- $close = $('<i/>', {class: className.close})
172
- $module.append($close);
172
+ $closeIcon = $('<i/>', {class: className.close, role: 'button', tabindex: 0, 'aria-label': settings.text.close})
173
+ $module.append($closeIcon);
173
174
  }
174
175
  if (settings.title !== '') {
175
- $('<div/>', {class: className.title}).appendTo($module);
176
+ var titleId = '_' + module.get.id() + 'title';
177
+ $module.attr('aria-labelledby', titleId);
178
+ $('<div/>', {class: className.title, id: titleId}).appendTo($module);
176
179
  }
177
180
  if (settings.content !== '') {
178
- $('<div/>', {class: className.content}).appendTo($module);
181
+ var descId = '_' + module.get.id() + 'desc';
182
+ $module.attr('aria-describedby', descId);
183
+ $('<div/>', {class: className.content, id: descId}).appendTo($module);
179
184
  }
180
185
  if (module.has.configActions()) {
181
186
  $('<div/>', {class: className.actions}).appendTo($module);
@@ -206,13 +211,13 @@ $.fn.modal = function(parameters) {
206
211
  $dimmer = $dimmable.dimmer('get dimmer');
207
212
  },
208
213
  id: function() {
209
- id = (Math.random().toString(16) + '000000000').substr(2, 8);
214
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
210
215
  elementEventNamespace = '.' + id;
211
216
  module.verbose('Creating unique id for element', id);
212
217
  },
213
218
  innerDimmer: function() {
214
- if ( $module.find(selector.dimmer).length == 0 ) {
215
- $module.prepend('<div class="ui inverted dimmer"></div>');
219
+ if ( $module.find(selector.dimmer).length === 0 ) {
220
+ $('<div/>', {class: className.innerDimmer}).prependTo($module);
216
221
  }
217
222
  }
218
223
  },
@@ -228,15 +233,21 @@ $.fn.modal = function(parameters) {
228
233
  ;
229
234
  $window.off(elementEventNamespace);
230
235
  $dimmer.off(elementEventNamespace);
231
- $close.off(eventNamespace);
236
+ $closeIcon.off(elementEventNamespace);
237
+ if($inputs) {
238
+ $inputs.off(elementEventNamespace);
239
+ }
232
240
  $context.dimmer('destroy');
233
241
  },
234
242
 
235
243
  observeChanges: function() {
236
244
  if('MutationObserver' in window) {
237
245
  observer = new MutationObserver(function(mutations) {
238
- module.debug('DOM tree modified, refreshing');
239
- module.refresh();
246
+ if(settings.observeChanges) {
247
+ module.debug('DOM tree modified, refreshing');
248
+ module.refresh();
249
+ }
250
+ module.refreshInputs();
240
251
  });
241
252
  observer.observe(element, {
242
253
  childList : true,
@@ -261,6 +272,23 @@ $.fn.modal = function(parameters) {
261
272
  $allModals = $otherModals.add($module);
262
273
  },
263
274
 
275
+ refreshInputs: function(){
276
+ if($inputs){
277
+ $inputs
278
+ .off('keydown' + elementEventNamespace)
279
+ ;
280
+ }
281
+ $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
282
+ return $(this).closest('.disabled').length === 0;
283
+ });
284
+ $inputs.first()
285
+ .on('keydown' + elementEventNamespace, module.event.inputKeyDown.first)
286
+ ;
287
+ $inputs.last()
288
+ .on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
289
+ ;
290
+ },
291
+
264
292
  attachEvents: function(selector, event) {
265
293
  var
266
294
  $toggle = $(selector)
@@ -289,6 +317,9 @@ $.fn.modal = function(parameters) {
289
317
  .on('click' + eventNamespace, selector.approve, module.event.approve)
290
318
  .on('click' + eventNamespace, selector.deny, module.event.deny)
291
319
  ;
320
+ $closeIcon
321
+ .on('keyup' + elementEventNamespace, module.event.closeKeyUp)
322
+ ;
292
323
  $window
293
324
  .on('resize' + elementEventNamespace, module.event.resize)
294
325
  ;
@@ -307,7 +338,7 @@ $.fn.modal = function(parameters) {
307
338
 
308
339
  get: {
309
340
  id: function() {
310
- return (Math.random().toString(16) + '000000000').substr(2, 8);
341
+ return id;
311
342
  },
312
343
  element: function() {
313
344
  return $module;
@@ -346,10 +377,38 @@ $.fn.modal = function(parameters) {
346
377
  close: function() {
347
378
  module.hide();
348
379
  },
380
+ closeKeyUp: function(event){
381
+ var
382
+ keyCode = event.which
383
+ ;
384
+ if ((keyCode === settings.keys.enter || keyCode === settings.keys.space) && $module.hasClass(className.front)) {
385
+ module.hide();
386
+ }
387
+ },
388
+ inputKeyDown: {
389
+ first: function(event) {
390
+ var
391
+ keyCode = event.which
392
+ ;
393
+ if (keyCode === settings.keys.tab && event.shiftKey) {
394
+ $inputs.last().focus();
395
+ event.preventDefault();
396
+ }
397
+ },
398
+ last: function(event) {
399
+ var
400
+ keyCode = event.which
401
+ ;
402
+ if (keyCode === settings.keys.tab && !event.shiftKey) {
403
+ $inputs.first().focus();
404
+ event.preventDefault();
405
+ }
406
+ }
407
+ },
349
408
  mousedown: function(event) {
350
409
  var
351
410
  $target = $(event.target),
352
- isRtl = module.is.rtl();
411
+ isRtl = module.is.rtl()
353
412
  ;
354
413
  initialMouseDownInModal = ($target.closest(selector.modal).length > 0);
355
414
  if(initialMouseDownInModal) {
@@ -397,10 +456,9 @@ $.fn.modal = function(parameters) {
397
456
  },
398
457
  keyboard: function(event) {
399
458
  var
400
- keyCode = event.which,
401
- escapeKey = 27
459
+ keyCode = event.which
402
460
  ;
403
- if(keyCode == escapeKey) {
461
+ if(keyCode === settings.keys.escape) {
404
462
  if(settings.closable) {
405
463
  module.debug('Escape key pressed hiding modal');
406
464
  if ( $module.hasClass(className.front) ) {
@@ -715,7 +773,7 @@ $.fn.modal = function(parameters) {
715
773
  $module
716
774
  .off('mousedown' + elementEventNamespace)
717
775
  ;
718
- }
776
+ }
719
777
  $dimmer
720
778
  .off('mousedown' + elementEventNamespace)
721
779
  ;
@@ -900,13 +958,10 @@ $.fn.modal = function(parameters) {
900
958
  set: {
901
959
  autofocus: function() {
902
960
  var
903
- $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
904
- return $(this).closest('.disabled').length === 0;
905
- }),
906
961
  $autofocus = $inputs.filter('[autofocus]'),
907
962
  $input = ($autofocus.length > 0)
908
963
  ? $autofocus.first()
909
- : $inputs.first()
964
+ : ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
910
965
  ;
911
966
  if($input.length > 0) {
912
967
  $input.focus();
@@ -988,7 +1043,7 @@ $.fn.modal = function(parameters) {
988
1043
  ? $(document).scrollTop() + settings.padding
989
1044
  : $(document).scrollTop() + (module.cache.contextHeight - module.cache.height - settings.padding),
990
1045
  marginLeft: -(module.cache.width / 2)
991
- })
1046
+ })
992
1047
  ;
993
1048
  } else {
994
1049
  $module
@@ -997,7 +1052,7 @@ $.fn.modal = function(parameters) {
997
1052
  ? -(module.cache.height / 2)
998
1053
  : settings.padding / 2,
999
1054
  marginLeft: -(module.cache.width / 2)
1000
- })
1055
+ })
1001
1056
  ;
1002
1057
  }
1003
1058
  module.verbose('Setting modal offset for legacy mode');
@@ -1323,11 +1378,19 @@ $.fn.modal.settings = {
1323
1378
  // called after deny selector match
1324
1379
  onDeny : function(){ return true; },
1325
1380
 
1381
+ keys : {
1382
+ space : 32,
1383
+ enter : 13,
1384
+ escape : 27,
1385
+ tab : 9,
1386
+ },
1387
+
1326
1388
  selector : {
1327
1389
  title : '> .header',
1328
1390
  content : '> .content',
1329
1391
  actions : '> .actions',
1330
1392
  close : '> .close',
1393
+ closeIcon: '> .close',
1331
1394
  approve : '.actions .positive, .actions .approve, .actions .ok',
1332
1395
  deny : '.actions .negative, .actions .deny, .actions .cancel',
1333
1396
  modal : '.ui.modal',
@@ -1359,11 +1422,13 @@ $.fn.modal.settings = {
1359
1422
  template : 'ui tiny modal',
1360
1423
  ok : 'positive',
1361
1424
  cancel : 'negative',
1362
- prompt : 'ui fluid input'
1425
+ prompt : 'ui fluid input',
1426
+ innerDimmer: 'ui inverted dimmer'
1363
1427
  },
1364
1428
  text: {
1365
1429
  ok : 'Ok',
1366
- cancel: 'Cancel'
1430
+ cancel: 'Cancel',
1431
+ close : 'Close'
1367
1432
  }
1368
1433
  };
1369
1434
 
@@ -1389,33 +1454,39 @@ $.fn.modal.settings.templates = {
1389
1454
  },
1390
1455
  alert: function () {
1391
1456
  var settings = this.get.settings(),
1392
- args = settings.templates.getArguments(arguments)
1457
+ args = settings.templates.getArguments(arguments),
1458
+ approveFn = args.handler
1393
1459
  ;
1394
1460
  return {
1395
1461
  title : args.title,
1396
1462
  content: args.content,
1463
+ onApprove: approveFn,
1397
1464
  actions: [{
1398
1465
  text : settings.text.ok,
1399
1466
  class: settings.className.ok,
1400
- click: args.handler
1467
+ click: approveFn
1401
1468
  }]
1402
1469
  }
1403
1470
  },
1404
1471
  confirm: function () {
1405
1472
  var settings = this.get.settings(),
1406
- args = settings.templates.getArguments(arguments)
1473
+ args = settings.templates.getArguments(arguments),
1474
+ approveFn = function(){args.handler(true)},
1475
+ denyFn = function(){args.handler(false)}
1407
1476
  ;
1408
1477
  return {
1409
1478
  title : args.title,
1410
1479
  content: args.content,
1480
+ onApprove: approveFn,
1481
+ onDeny: denyFn,
1411
1482
  actions: [{
1412
1483
  text : settings.text.ok,
1413
1484
  class: settings.className.ok,
1414
- click: function(){args.handler(true)}
1485
+ click: approveFn
1415
1486
  },{
1416
1487
  text: settings.text.cancel,
1417
1488
  class: settings.className.cancel,
1418
- click: function(){args.handler(false)}
1489
+ click: denyFn
1419
1490
  }]
1420
1491
  }
1421
1492
  },
@@ -1423,7 +1494,14 @@ $.fn.modal.settings.templates = {
1423
1494
  var $this = this,
1424
1495
  settings = this.get.settings(),
1425
1496
  args = settings.templates.getArguments(arguments),
1426
- input = $($.parseHTML(args.content)).filter('.ui.input')
1497
+ input = $($.parseHTML(args.content)).filter('.ui.input'),
1498
+ approveFn = function(){
1499
+ var settings = $this.get.settings(),
1500
+ inputField = $this.get.element().find(settings.selector.prompt)[0]
1501
+ ;
1502
+ args.handler($(inputField).val());
1503
+ },
1504
+ denyFn = function(){args.handler(null)}
1427
1505
  ;
1428
1506
  if (input.length === 0) {
1429
1507
  args.content += '<p><div class="'+settings.className.prompt+'"><input placeholder="'+this.helpers.deQuote(args.placeholder || '')+'" type="text" value="'+this.helpers.deQuote(args.defaultValue || '')+'"></div></p>';
@@ -1431,19 +1509,16 @@ $.fn.modal.settings.templates = {
1431
1509
  return {
1432
1510
  title : args.title,
1433
1511
  content: args.content,
1512
+ onApprove: approveFn,
1513
+ onDeny: denyFn,
1434
1514
  actions: [{
1435
1515
  text: settings.text.ok,
1436
1516
  class: settings.className.ok,
1437
- click: function(){
1438
- var settings = $this.get.settings(),
1439
- inputField = $this.get.element().find(settings.selector.prompt)[0]
1440
- ;
1441
- args.handler($(inputField).val());
1442
- }
1517
+ click: approveFn
1443
1518
  },{
1444
1519
  text: settings.text.cancel,
1445
1520
  class: settings.className.cancel,
1446
- click: function(){args.handler(null)}
1521
+ click: denyFn
1447
1522
  }]
1448
1523
  }
1449
1524
  }
@@ -80,8 +80,10 @@
80
80
  height: @closeHitbox;
81
81
  padding: @closePadding;
82
82
  }
83
+ .ui.modal > .close:focus,
83
84
  .ui.modal > .close:hover {
84
85
  opacity: 1;
86
+ outline: none;
85
87
  }
86
88
 
87
89
  /*--------------
@@ -206,6 +208,16 @@
206
208
  .ui.modal:not(.fullscreen) {
207
209
  width: @tabletWidth;
208
210
  margin: @tabletMargin;
211
+ & > .active.dimmer + .close:not(.inside) {
212
+ pointer-events: none;
213
+ opacity: @closeOpacityDimmed;
214
+ }
215
+ }
216
+ .ui.dimmer > .ui.modal:not(.fullscreen) > .close:not(.inside){
217
+ text-shadow: @closeShadow;
218
+ }
219
+ .ui.inverted.dimmer > .ui.modal:not(.fullscreen) > .close:not(.inside){
220
+ text-shadow: @invertedCloseShadow;
209
221
  }
210
222
  }
211
223
  @media only screen and (min-width : @computerBreakpoint) {
@@ -169,28 +169,29 @@ a.ui.nag {
169
169
  /*--------------
170
170
  Colors
171
171
  -------------- */
172
-
173
- each(@colors, {
174
- @color: replace(@key, '@', '');
175
- @c: @colors[@@color][color];
176
- @l: @colors[@@color][light];
177
- @isVeryDark: @colors[@@color][isVeryDark];
178
-
179
- .ui.@{color}.nag {
180
- background-color: @c;
181
- & when (@isVeryDark) {
182
- color: @invertedTextColor;
172
+ & when not (@variationNagColors = false) {
173
+ each(@variationNagColors, {
174
+ @color: @value;
175
+ @c: @colors[@@color][color];
176
+ @l: @colors[@@color][light];
177
+ @isVeryDark: @colors[@@color][isVeryDark];
178
+
179
+ .ui.@{color}.nag {
180
+ background-color: @c;
181
+ & when (@isVeryDark) {
182
+ color: @invertedTextColor;
183
+ }
183
184
  }
184
- }
185
- & when (@variationNagInverted) {
186
- .ui.inverted.@{color}.nag {
187
- background-color: @l;
188
- & .title when (@isVeryDark) {
189
- color: @titleColor;
185
+ & when (@variationNagInverted) {
186
+ .ui.inverted.@{color}.nag {
187
+ background-color: @l;
188
+ & .title when (@isVeryDark) {
189
+ color: @titleColor;
190
+ }
190
191
  }
191
192
  }
192
- }
193
- })
193
+ })
194
+ }
194
195
 
195
196
  & when (@variationNagGroups) {
196
197
  /*******************************
@@ -309,7 +309,7 @@ $.fn.popup = function(parameters) {
309
309
  },
310
310
 
311
311
  createID: function() {
312
- id = (Math.random().toString(16) + '000000000').substr(2, 8);
312
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
313
313
  elementNamespace = '.' + id;
314
314
  module.verbose('Creating unique id for element', id);
315
315
  },
@@ -607,6 +607,9 @@ $.fn.progress = function(parameters) {
607
607
  }
608
608
  else {
609
609
  module.remove.active();
610
+ module.remove.warning();
611
+ module.remove.error();
612
+ module.remove.success();
610
613
  module.set.label(settings.text.active);
611
614
  }
612
615
  },
@@ -446,25 +446,26 @@
446
446
  /*--------------
447
447
  Colors
448
448
  ---------------*/
449
-
450
- each(@colors, {
451
- @color: replace(@key, '@', '');
452
- @c: @colors[@@color][color];
453
- @l: @colors[@@color][light];
454
-
455
- .ui.indeterminate.@{color}.progress .bar::before,
456
- .ui.@{color}.progress .bar,
457
- .ui.progress .@{color}.bar {
458
- background-color: @c;
459
- }
460
- & when (@variationProgressInverted) {
461
- .ui.inverted.indeterminate.@{color}.progress .bar::before,
462
- .ui.@{color}.inverted.progress .bar,
463
- .ui.inverted.progress .@{color}.bar {
464
- background-color: @l;
449
+ & when not (@variationProgressColors = false) {
450
+ each(@variationProgressColors, {
451
+ @color: @value;
452
+ @c: @colors[@@color][color];
453
+ @l: @colors[@@color][light];
454
+
455
+ .ui.indeterminate.@{color}.progress .bar::before,
456
+ .ui.@{color}.progress .bar,
457
+ .ui.progress .@{color}.bar {
458
+ background-color: @c;
465
459
  }
466
- }
467
- })
460
+ & when (@variationProgressInverted) {
461
+ .ui.inverted.indeterminate.@{color}.progress .bar::before,
462
+ .ui.@{color}.inverted.progress .bar,
463
+ .ui.inverted.progress .@{color}.bar {
464
+ background-color: @l;
465
+ }
466
+ }
467
+ })
468
+ }
468
469
 
469
470
  /*--------------
470
471
  Sizes
@@ -69,13 +69,20 @@
69
69
  color: @activeColor;
70
70
  }
71
71
 
72
- /* Partially Active Icon */
73
- .ui.rating .icon.partial.active {
74
- background: linear-gradient(to right, @activeColor 0% var(--full), @inactiveColor var(--full) 100%);
75
- background-clip: text;
76
- color: transparent;
77
- }
72
+ & when (@variationRatingPartial) {
73
+ /* Partially Active Icon */
74
+ .ui.rating .icon.partial.active {
75
+ background: linear-gradient(to right, @activeColor 0% var(--full), @inactiveColor var(--full) 100%);
76
+ }
78
77
 
78
+ /* central override for colors */
79
+ .ui.ui.rating .icon.partial.active {
80
+ -webkit-background-clip: text;
81
+ background-clip: text;
82
+ color: transparent;
83
+ text-shadow: none;
84
+ }
85
+ }
79
86
  /* Selected Icon */
80
87
  .ui.rating .icon.selected,
81
88
  .ui.rating .icon.selected.active,
@@ -88,42 +95,42 @@
88
95
  /*--------------
89
96
  Colors
90
97
  -------------- */
91
-
92
- each(@colors, {
93
- @color: replace(@key, '@', '');
94
- @c: @colors[@@color][color];
95
- @l: @colors[@@color][light];
96
- @h: @colors[@@color][hover];
97
- @lh: @colors[@@color][lightHover];
98
-
99
- .ui.@{color}.rating .active.icon {
100
- color: @l;
101
- text-shadow: 0px -@shadowWidth 0px @c,
102
- -@shadowWidth 0px 0px @c,
103
- 0px @shadowWidth 0px @c,
104
- @shadowWidth 0px 0px @c;
105
- }
106
- .ui.@{color}.rating .icon.selected,
107
- .ui.@{color}.rating .icon.selected.active,
108
- .ui.@{color}.rating .icon.selected.partial.active {
109
- background: inherit;
110
- color: @lh;
111
- text-shadow: 0px -@shadowWidth 0px @h,
112
- -@shadowWidth 0px 0px @h,
113
- 0px @shadowWidth 0px @h,
114
- @shadowWidth 0px 0px @h;
115
-
116
- -webkit-text-stroke: unset;
117
- background-clip: unset;
118
- }
119
- .ui.@{color}.rating .icon.partial.active {
120
- background: linear-gradient(to right, @l 0% var(--full), @inactiveColor var(--full) 100%);
121
- text-shadow: none;
122
- -webkit-text-stroke: @c 0.78px;
123
- background-clip: text;
124
- color: transparent;
125
- }
126
- })
98
+ & when not (@variationRatingColors = false) {
99
+ each(@variationRatingColors, {
100
+ @color: @value;
101
+ @c: @colors[@@color][color];
102
+ @l: @colors[@@color][light];
103
+ @h: @colors[@@color][hover];
104
+ @lh: @colors[@@color][lightHover];
105
+
106
+ .ui.@{color}.rating .active.icon {
107
+ color: @l;
108
+ text-shadow: 0px -@shadowWidth 0px @c,
109
+ -@shadowWidth 0px 0px @c,
110
+ 0px @shadowWidth 0px @c,
111
+ @shadowWidth 0px 0px @c;
112
+ }
113
+ .ui.@{color}.rating .icon.selected,
114
+ .ui.@{color}.rating .icon.selected.active,
115
+ .ui.@{color}.rating .icon.selected.partial.active {
116
+ background: inherit;
117
+ color: @lh;
118
+ text-shadow: 0px -@shadowWidth 0px @h,
119
+ -@shadowWidth 0px 0px @h,
120
+ 0px @shadowWidth 0px @h,
121
+ @shadowWidth 0px 0px @h;
122
+
123
+ -webkit-text-stroke: unset;
124
+ background-clip: unset;
125
+ }
126
+ & when (@variationRatingPartial) {
127
+ .ui.@{color}.rating .icon.partial.active {
128
+ background: linear-gradient(to right, @l 0% var(--full), @inactiveColor var(--full) 100%);
129
+ -webkit-text-stroke: @c 0.78px;
130
+ }
131
+ }
132
+ })
133
+ }
127
134
 
128
135
 
129
136
  /*******************************