@zendeskgarden/container-tabs
Advanced tools
Comparing version
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.4.0](https://github.com/zendeskgarden/react-containers/compare/@zendeskgarden/container-tabs@0.3.6...@zendeskgarden/container-tabs@0.4.0) (2020-01-15) | ||
### Features | ||
* move ID utilities to react-uid ([#142](https://github.com/zendeskgarden/react-containers/issues/142)) ([9f30572](https://github.com/zendeskgarden/react-containers/commit/9f3057202c94ca497b11b6f05ef649c87d5a5716)) | ||
## [0.3.6](https://github.com/zendeskgarden/react-containers/compare/@zendeskgarden/container-tabs@0.3.5...@zendeskgarden/container-tabs@0.3.6) (2019-11-13) | ||
@@ -8,0 +19,0 @@ |
@@ -6,3 +6,3 @@ /*! | ||
*/ | ||
!function(e,r){for(var t in r)e[t]=r[t]}(exports,function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=4)}([function(e,r){e.exports=require("prop-types")},function(e,r){e.exports=require("react")},function(e,r){e.exports=require("@zendeskgarden/container-selection")},function(e,r){e.exports=require("@zendeskgarden/container-utilities")},function(e,r,t){"use strict";t.r(r);var n=t(1),o=t(2),i=t(3);function c(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var t=[],n=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(t.push(c.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return t}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?a(t,!0).forEach((function(r){l(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(t).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function l(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function f(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function d(e,r,t){if(null==e)throw new Error('Accessibility Error: You must provide an "'.concat(r,'" option to "').concat(t,'()"'))}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.vertical,t=e.idPrefix,a=f(e,["vertical","idPrefix"]),l=Object(o.useSelection)(u({direction:r?"vertical":"horizontal",defaultSelectedIndex:0},a)),s=l.selectedItem,b=l.focusedItem,p=l.getContainerProps,y=l.getItemProps,v=c(Object(n.useState)(t||Object(i.generateId)("garden-tabs-container")),1)[0],g="".concat(v,"--panel"),O="".concat(v,"--tab");return{selectedItem:s,focusedItem:b,getTabPanelProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.role,t=void 0===r?"tabpanel":r,n=e.index,o=e.item,i=f(e,["role","index","item"]);d(n,"index","getTabPanelProps"),d(o,"item","getTabPanelProps");var c=o!==s;return u({role:t,tabIndex:0,id:"".concat(g,":").concat(n),hidden:c,"aria-labelledby":"".concat(O,":").concat(n)},i)},getTabListProps:function(e){return p(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.role,n=void 0===t?"tablist":t,o=f(e,["role"]);return u({role:n,"aria-orientation":r?"vertical":"horizontal","data-garden-container-id":"containers.tabs","data-garden-container-version":"0.3.6"},o)}(e))},getTabProps:function(e){return y(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.role,t=void 0===r?"tab":r,n=e.index,o=f(e,["role","index"]);return d(n,"index","getTabProps"),u({id:"".concat(O,":").concat(n),"aria-controls":"".concat(g,":").concat(n),role:t},o)}(e),"getTabProps")}}}var b=t(0),p=t.n(b);function y(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var v=function(e){var r=e.children,t=e.render;return(void 0===t?r:t)(s(y(e,["children","render"])))};v.propTypes={children:p.a.func,render:p.a.func,vertical:p.a.bool,idPrefix:p.a.string,defaultSelectedIndex:p.a.number,onSelect:p.a.func},t.d(r,"useTabs",(function(){return s})),t.d(r,"TabsContainer",(function(){return v}))}])); | ||
!function(e,t){for(var r in t)e[r]=t[r]}(exports,function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("react-uid")},function(e,t){e.exports=require("@zendeskgarden/container-selection")},function(e,t,r){"use strict";r.r(t);var n=r(1),o=r(2),i=r(3);function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function d(e,t,r){if(null==e)throw new Error('Accessibility Error: You must provide an "'.concat(t,'" option to "').concat(r,'()"'))}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertical,r=e.idPrefix,a=f(e,["vertical","idPrefix"]),l=Object(i.useSelection)(u({direction:t?"vertical":"horizontal",defaultSelectedIndex:0},a)),s=l.selectedItem,b=l.focusedItem,p=l.getContainerProps,y=l.getItemProps,v=Object(o.useUIDSeed)(),O=c(Object(n.useState)(r||v("tabs_".concat("0.4.0"))),1)[0],g="".concat(O,"--panel"),j="".concat(O,"--tab");return{selectedItem:s,focusedItem:b,getTabPanelProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.role,r=void 0===t?"tabpanel":t,n=e.index,o=e.item,i=f(e,["role","index","item"]);d(n,"index","getTabPanelProps"),d(o,"item","getTabPanelProps");var c=o!==s;return u({role:r,tabIndex:0,id:"".concat(g,":").concat(n),hidden:c,"aria-labelledby":"".concat(j,":").concat(n)},i)},getTabListProps:function(e){return p(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.role,n=void 0===r?"tablist":r,o=f(e,["role"]);return u({role:n,"aria-orientation":t?"vertical":"horizontal","data-garden-container-id":"containers.tabs","data-garden-container-version":"0.4.0"},o)}(e))},getTabProps:function(e){return y(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.role,r=void 0===t?"tab":t,n=e.index,o=f(e,["role","index"]);return d(n,"index","getTabProps"),u({id:"".concat(j,":").concat(n),"aria-controls":"".concat(g,":").concat(n),role:r},o)}(e),"getTabProps")}}}var b=r(0),p=r.n(b);function y(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var v=function(e){var t=e.children,r=e.render;return(void 0===r?t:r)(s(y(e,["children","render"])))};v.propTypes={children:p.a.func,render:p.a.func,vertical:p.a.bool,idPrefix:p.a.string,defaultSelectedIndex:p.a.number,onSelect:p.a.func},r.d(t,"useTabs",(function(){return s})),r.d(t,"TabsContainer",(function(){return v}))}])); | ||
//# sourceMappingURL=index.js.map |
@@ -11,3 +11,3 @@ { | ||
}, | ||
"version": "0.3.6", | ||
"version": "0.4.0", | ||
"main": "./dist/index.js", | ||
@@ -22,4 +22,4 @@ "files": [ | ||
"dependencies": { | ||
"@zendeskgarden/container-selection": "^1.2.6", | ||
"@zendeskgarden/container-utilities": "^0.3.0" | ||
"@zendeskgarden/container-selection": "^1.2.7", | ||
"react-uid": "^2.2.0" | ||
}, | ||
@@ -44,3 +44,3 @@ "peerDependencies": { | ||
"zendeskgarden:src": "src/index.ts", | ||
"gitHead": "f1a55248b2b494923d8961b83eb432cc32380bc9" | ||
"gitHead": "e7657227289f9e6aa14c46292601b713497832ba" | ||
} |
Sorry, the diff of this file is not supported yet
36961
0.94%+ Added
+ Added
- Removed