@inc2734/unitone-css 0.102.3 → 1.0.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.
- package/dist/app.css +1 -1
- package/dist/app.js +1 -1
- package/dist/library.js +1 -1
- package/package.json +2 -4
- package/src/app.js +0 -1
- package/src/behaviors/_divider.scss +27 -0
- package/src/behaviors/_font-size.scss +11 -0
- package/src/behaviors/_index.scss +4 -2
- package/src/behaviors/_negative-gap.scss +2 -16
- package/src/behaviors/_padding.scss +0 -12
- package/src/compatibility/index.js +1 -1
- package/src/foundation/_index.scss +141 -1
- package/src/layout-primitives/_index.scss +49 -1
- package/src/layout-primitives/both-sides/_index.scss +31 -1
- package/src/layout-primitives/center/_index.scss +22 -1
- package/src/layout-primitives/cluster/_index.scss +104 -1
- package/src/layout-primitives/container/_index.scss +18 -1
- package/src/layout-primitives/cover/_index.scss +86 -1
- package/src/layout-primitives/decorator/_index.scss +109 -1
- package/src/layout-primitives/float/_index.scss +29 -1
- package/src/layout-primitives/frame/_index.scss +36 -1
- package/src/layout-primitives/gutters/_index.scss +30 -1
- package/src/layout-primitives/layers/_index.scss +141 -1
- package/src/layout-primitives/marquee/_index.scss +73 -1
- package/src/layout-primitives/masonry/_index.scss +26 -1
- package/src/layout-primitives/popover/_index.scss +1 -1
- package/src/layout-primitives/reel/_index.scss +55 -1
- package/src/layout-primitives/responsive-grid/_index.scss +225 -1
- package/src/layout-primitives/stack/_index.scss +182 -1
- package/src/layout-primitives/switcher/_index.scss +70 -1
- package/src/layout-primitives/text/_index.scss +144 -1
- package/src/layout-primitives/texture/_index.scss +271 -1
- package/src/layout-primitives/vertical-writing/_index.scss +118 -1
- package/src/layout-primitives/with-sidebar/_index.scss +304 -1
- package/src/library.js +0 -48
- package/src/settings/_body.scss +0 -1
- package/src/settings/_index.scss +3 -1
- package/src/settings/_root.scss +47 -9
- package/src/utilities/_font-size.scss +8 -15
- package/src/utilities/_index.scss +0 -1
- package/src/variables/_index.scss +83 -1
- package/dist/compatibility/fluid-typography.js +0 -1
- package/dist/compatibility/index.js +0 -1
- package/src/behaviors/_typography.scss +0 -21
- package/src/compatibility/fluid-typography.js +0 -18
- package/src/foundation/_foundation-core.scss +0 -135
- package/src/foundation/_foundation.scss +0 -3
- package/src/helper/_helper.scss +0 -3
- package/src/layout-primitives/_layout-primitives-core.scss +0 -49
- package/src/layout-primitives/_layout-primitives.scss +0 -3
- package/src/layout-primitives/both-sides/_both-sides-core.scss +0 -31
- package/src/layout-primitives/both-sides/_both-sides.scss +0 -3
- package/src/layout-primitives/center/_center-core.scss +0 -22
- package/src/layout-primitives/center/_center.scss +0 -3
- package/src/layout-primitives/cluster/_cluster-core.scss +0 -126
- package/src/layout-primitives/cluster/_cluster.scss +0 -3
- package/src/layout-primitives/container/_container-core.scss +0 -18
- package/src/layout-primitives/container/_container.scss +0 -3
- package/src/layout-primitives/cover/_cover-core.scss +0 -86
- package/src/layout-primitives/cover/_cover.scss +0 -3
- package/src/layout-primitives/decorator/_decorator-core.scss +0 -109
- package/src/layout-primitives/decorator/_decorator.scss +0 -3
- package/src/layout-primitives/float/_float-core.scss +0 -29
- package/src/layout-primitives/float/_float.scss +0 -3
- package/src/layout-primitives/frame/_frame-core.scss +0 -36
- package/src/layout-primitives/frame/_frame.scss +0 -3
- package/src/layout-primitives/gutters/_gutters-core.scss +0 -12
- package/src/layout-primitives/gutters/_gutters.scss +0 -3
- package/src/layout-primitives/layers/_layers-core.scss +0 -141
- package/src/layout-primitives/layers/_layers.scss +0 -3
- package/src/layout-primitives/marquee/_marquee-core.scss +0 -73
- package/src/layout-primitives/marquee/_marquee.scss +0 -3
- package/src/layout-primitives/masonry/_masonry-core.scss +0 -26
- package/src/layout-primitives/masonry/_masonry.scss +0 -3
- package/src/layout-primitives/reel/_reel-core.scss +0 -55
- package/src/layout-primitives/reel/_reel.scss +0 -3
- package/src/layout-primitives/responsive-grid/_responsive-grid-core.scss +0 -249
- package/src/layout-primitives/responsive-grid/_responsive-grid.scss +0 -3
- package/src/layout-primitives/stack/_stack-core.scss +0 -201
- package/src/layout-primitives/stack/_stack.scss +0 -3
- package/src/layout-primitives/switcher/_switcher-core.scss +0 -70
- package/src/layout-primitives/switcher/_switcher.scss +0 -3
- package/src/layout-primitives/text/_text-core.scss +0 -169
- package/src/layout-primitives/text/_text.scss +0 -3
- package/src/layout-primitives/texture/_texture-core.scss +0 -271
- package/src/layout-primitives/texture/_texture.scss +0 -3
- package/src/layout-primitives/vertical-writing/_vertical-writing-core.scss +0 -118
- package/src/layout-primitives/vertical-writing/_vertical-writing.scss +0 -3
- package/src/layout-primitives/with-sidebar/_with-sidebar-core.scss +0 -337
- package/src/layout-primitives/with-sidebar/_with-sidebar.scss +0 -3
- package/src/settings/_settings-core.scss +0 -3
- package/src/settings/_settings.scss +0 -3
- package/src/utilities/_typography.scss +0 -5
- package/src/variables/_variables-core.scss +0 -79
- package/src/variables/_variables.scss +0 -3
package/dist/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function e(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}function n(n){return function(e){if(Array.isArray(e))return t(e)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||e(n)||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 i(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,l,u=[],a=!0,d=!1;try{if(o=(n=n.call(t)).next,0===e);else for(;!(a=(i=o.call(n)).done)&&(u.push(i.value),u.length!==e);a=!0);}catch(t){d=!0,r=t}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw r}}return u}}(t,n)||e(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,u=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){a=!0,l=t},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw l}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var l="data-unitone-layout",u="".concat(200,"px 0px"),a=function(t){var e;return(null!==(e=t.getAttribute(l))&&void 0!==e?e:"").split(/\s+/).filter(Boolean)},d=function(t,e){return t.filter(function(t){return!e.includes(t)})},s=function(t,e){var n,i=e.filter(Boolean).join(" ");(null!==(n=t.getAttribute(l))&&void 0!==n?n:"")!==i&&t.setAttribute(l,i)},c=function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.getValue,l=i.delay,u=!0,a=new ResizeObserver(g(function(t){var i,l=r(t);try{for(l.s();!(i=l.n()).done;){var a=i.value,d=null==o?void 0:o(a);u?(n=d,u=!1):void 0!==d&&d===n||(e(a.target,a),n=d)}}catch(t){l.e(t)}finally{l.f()}},void 0===l?250:l));return a.observe(t),a},f=function(t,e,n){var i=new MutationObserver(function(e){requestAnimationFrame(function(){null!=t&&t.isConnected&&n(e)})});return i.observe(t,e),i},v=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,a=void 0===l?250:l,d=n.observeResize,s=void 0===d||d,v=n.observeIntersection,y=void 0!==v&&v,p=n.observeDirectChildrenResize,h=void 0!==p&&p,b=n.targetMutation,w=n.directChildMutation,A=y&&"undefined"!=typeof IntersectionObserver,z=!A||m(t),C=A&&!z,E=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;null!=n&&n.isConnected&&(!A||z?(C=!1,e(n)):C=!0)},S=function(t,e){var n,i=0;return function(){var r,o;null!==(o=n=null==t||null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)&&void 0!==o&&o.requestAnimationFrame?i||(i=n.requestAnimationFrame(function(){i=0,n=null,null!=t&&t.isConnected&&e(t)})):e(t)}}(t,E),N=function(){null!=t&&t.isConnected&&(!A||z?(C=!0,S()):C=!0)},O=function(){},V=s?h?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.getValue,o=n.delay,l=void 0===o?250:o,u=n.onChildList,a=new WeakMap,d=new Set,s=new ResizeObserver(g(function(n){var o,l=!1,u=r(n);try{for(u.s();!(o=u.n()).done;){var d=o.value,s=null==i?void 0:i(d);a.has(d.target)?(void 0!==s&&s===a.get(d.target)||(l=!0),a.set(d.target,s)):a.set(d.target,s)}}catch(t){u.e(t)}finally{u.f()}l&&e(t)},l)),c=function(){var e;Array.from(d).forEach(function(e){e.parentElement!==t&&(s.unobserve(e),d.delete(e),a.delete(e))}),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach(function(t){d.has(t)||(s.observe(t),d.add(t))})};s.observe(t),c();var v=f(t,{childList:!0},function(n){n.some(function(t){return"childList"===t.type})&&(c(),null==u||u(n),e(t))});return{resizeObserver:s,mutationObserver:v}}(t,N,{getValue:o,delay:a,onChildList:function(){O()}}):{resizeObserver:c(t,N,{getValue:o,delay:a})}:{mutationObserver:null};A&&function(t,e){var n=new IntersectionObserver(function(t){var n=i(t,1)[0];n&&e(n)},{rootMargin:u});n.observe(t)}(t,function(t){(z=t.isIntersecting)&&C&&N()}),null!=b&&b.options&&f(t,b.options,function(t){var e,n;(null!==(e=null===(n=b.shouldApply)||void 0===n?void 0:n.call(b,t))&&void 0!==e?e:0<t.length)&&N()});var M=null!=w&&w.attributeFilter&&w.shouldApply?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.attributeFilter,r=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver(function(n){requestAnimationFrame(function(){null!=t&&t.isConnected&&n.some(function(e){return"attributes"===e.type&&e.target.parentElement===t&&r(e)})&&e(t)})}),a=function(){var e;u.disconnect(),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach(function(t){u.observe(t,{attributes:!0,attributeFilter:i,attributeOldValue:l})})};return a(),{observer:u,syncObservedChildren:a}}(t,N,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;M&&(O=M.syncObservedChildren),!V.mutationObserver&&M&&f(t,{childList:!0},function(t){t.some(function(t){return"childList"===t.type})&&(O(),N())}),A&&!z||E(t)},y=function(t){var e;return null===(e=t.borderBoxSize)||void 0===e?void 0:e[0].inlineSize},p=function(t){var e;return parseInt(null===(e=t.contentRect)||void 0===e?void 0:e.width)},h=function(t){return!(null==t||!t.isConnected)&&0<t.getClientRects().length},m=function(t){var e;if(!h(t))return!1;var n=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;if(!n)return!0;var i=t.getBoundingClientRect(),r=n.innerWidth,o=n.innerHeight;return i.bottom>-200&&i.right>0&&i.top<o+200&&i.left<r};function g(t,e){var n;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];var l=this;clearTimeout(n),n=setTimeout(function(){t.apply(l,r)},e)}}var b=function(t){var e,i=Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]),r=i[0];if(r){var o=d(a(t),["divider:initialized","-stack"]);s(t,o);var l=new Map;if(i.forEach(function(t){var e=d(a(t),["-bol","-linewrap"]);l.set(t,e),s(t,e)}),h(t)){var u,c=r.getBoundingClientRect(),f=i.reduce(function(t,e){var n,i=window.getComputedStyle(e).getPropertyValue("position"),r=window.getComputedStyle(e).getPropertyValue("display");"absolute"!==i&&"fixed"!==i&&"none"!==r&&t.push({child:e,layoutTokens:null!==(n=l.get(e))&&void 0!==n?n:[],rect:e.getBoundingClientRect()});return t},[]);f.map(function(t,e){var i,r,o=t.child,l=t.layoutTokens,a=t.rect,d=n(l);return(0===e||(null===(i=u)||void 0===i?void 0:i.top)<a.top&&(null===(r=u)||void 0===r?void 0:r.left)>=a.left)&&d.push("-bol"),0<e&&c.top<a.top&&d.push("-linewrap"),u=a,{child:o,layoutTokens:d}}).forEach(function(t){var e=t.child,n=t.layoutTokens;s(e,n)});var v=f.every(function(t){return t.rect.left===c.left}),y=n(o);v&&y.push("-stack"),y.push("divider:initialized"),s(t,y)}}},w=function(t){var e,i,r=Array.from(t.children),o=d(a(t),["stairs:initialized"]);s(t,o);var l=r[0];if(l){if(t.style.removeProperty("--unitone--stairs-step-overflow-volume"),t.style.removeProperty("--unitone--max-stairs-step"),r.forEach(function(t){t.style.removeProperty("--unitone--stairs-step")}),h(t)){var u,c=null===(e=(null!==(i=t.getAttribute("data-unitone-layout"))&&void 0!==i?i:"").split(/\s+/).find(function(t){return t.startsWith("-stairs-up:")}))||void 0===e?void 0:e.replace("-stairs-up:",""),f=["up-down","down-up"].includes(c),v=window.getComputedStyle(t).getPropertyValue("flex-direction"),y=t.getBoundingClientRect().bottom,p=r.reduce(function(t,e){var n=window.getComputedStyle(e).getPropertyValue("position"),i=window.getComputedStyle(e).getPropertyValue("display");return"absolute"===n||"fixed"===n||"none"===i||t.push({child:e,rect:e.getBoundingClientRect()}),t},[]),m=0,g=m;p.map(function(t,e){var n,i,r=t.child,o=t.rect,a="row-reverse"===v?(null===(n=u)||void 0===n?void 0:n.left)<=o.left:(null===(i=u)||void 0===i?void 0:i.left)>=o.left;return 0===e||l===r&&!u||a?m=0:f?m=0===m?1:0:m++,u=o,m>g&&(g=m),{child:r,stairsStep:m}}).forEach(function(t){var e=t.child,n=t.stairsStep;e.style.setProperty("--unitone--stairs-step",n)}),t.style.setProperty("--unitone--max-stairs-step",g);var b=p.reduce(function(t,e){var n=e.child.getBoundingClientRect().bottom-y;return t>n?t:n},0);t.style.setProperty("--unitone--stairs-step-overflow-volume",b),s(t,[].concat(n(o),["stairs:initialized"]))}}else s(t,[].concat(n(o),["stairs:initialized"]))},A=function(t){return t.some(function(t){return"attributes"===t.type||"childList"===t.type&&[].concat(n(t.addedNodes),n(t.removedNodes)).some(function(t){return!function(t){return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&["vertical-writing__thresholder","vertical-writing:initialized","vertical-writing:safari"].includes(t.getAttribute("data-unitone-layout"))}(t)})})},z=function(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.fontSize);n!==parseFloat(e.getPropertyValue("--unitone--result--1em-px"))&&t.style.setProperty("--unitone--result--1em-px",n)},C=Symbol.for("@inc2734/unitone-css/layout-initializers"),E=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[C]||(globalThis[C]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[C])},S=function(t,e){var n,i;if(t.enabled()&&(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE){var r=new Set;null!==(n=e.matches)&&void 0!==n&&n.call(e,t.selector)&&r.add(e),null===(i=e.querySelectorAll)||void 0===i||i.call(e,t.selector).forEach(function(t){r.add(t)}),r.forEach(function(e){t.initialized.has(e)||(t.initialize(e),t.initialized.add(e))})}},N=function(t){var e=E();e&&e.initializers.forEach(function(e){S(e,t)})},O=function(){var t=E();t&&(t.pendingNodes.forEach(function(t){N(t)}),t.pendingNodes.clear(),t.rafId=0)},V=function(){var t=E();t&&!t.observer&&document.body&&(N(document.body),t.observer=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE&&t.pendingNodes.add(e)})}),!t.rafId&&0<t.pendingNodes.size&&(t.rafId=requestAnimationFrame(O))}),t.observer.observe(document.body,{childList:!0,subtree:!0}))},M=function(t){var e=t.key,n=t.selector,i=t.initialize,r=t.enabled,o=void 0===r?function(){return!0}:r,l=E();if(l&&!l.initializers.has(e)){var u={selector:n,initialize:i,enabled:o,initialized:new WeakSet};l.initializers.set(e,u),l.observer?S(u,document.body):"loading"!==document.readyState?V():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",V,{once:!0}),l.hasDOMContentLoadedListener=!0)}};M({key:"layout-primitives/marquee",selector:'[data-unitone-layout~="marquee-wrapper"]',initialize:function(t){var e;v(t,function(t){e=function(t){var e,n=function(t){var e,n=null!==(e=t.getAttribute("data-unitone-layout"))&&void 0!==e?e:"";n.split(/\s+/).includes("marquee:initialized")||t.setAttribute("data-unitone-layout","".concat(n," marquee:initialized").trim())},i=function(){return t.querySelectorAll(':scope > [data-unitone-layout~="marquee"]')},r=i();if(0!==r.length){var o=Array.from(r).some(function(t){var e;return(null!==(e=t.getAttribute(l))&&void 0!==e?e:"").split(/\s+/).includes("marquee:initialized")});if(1===t.childElementCount&&1===r.length){var u=r[0];(e=u.cloneNode(!0)).setAttribute("aria-hidden","true"),u.after(e)}return r=i(),o?(r.forEach(function(t){var e,n,i;i=(null!==(n=(e=t).getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/).filter(function(t){return t&&"marquee:initialized"!==t}).join(" "),e.setAttribute("data-unitone-layout",i)}),requestAnimationFrame(function(){null!=t&&t.isConnected&&i().forEach(function(t){n(t)})}),e):(r.forEach(function(t){n(t)}),e)}}(t)},{observeResize:!1,observeIntersection:!0,targetMutation:{options:{childList:!0},shouldApply:function(t){var n,i=t.flatMap(function(t){var e;return Array.from(null!==(e=t.addedNodes)&&void 0!==e?e:[])}),r=t.flatMap(function(t){var e;return Array.from(null!==(e=t.removedNodes)&&void 0!==e?e:[])});return null!==(n=e)&&void 0!==n&&n.isConnected&&1===i.length&&0===r.length&&i[0]===e?(e=null,!1):(e=null,!0)}}})}}),M({key:"layout-primitives/vertical-writing",selector:'[data-unitone-layout~="vertical-writing"]',initialize:function(t){v(t,function(t){var e;null!==(e=t.parentNode)&&void 0!==e&&e.style&&(t.parentNode.style.height=""),function(t){if(t){var e,i=a(t),r=d(i,["vertical-writing:safari","-force-switch"]),o=d(i,["vertical-writing:initialized","vertical-writing:safari","-force-switch"]);if(s(t,r),Array.from(t.children).reverse().some(function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position)&&"none"!==getComputedStyle(t).display)return e=t,!0}),e){var u=getComputedStyle(t),c=String(u.getPropertyValue("--unitone--threshold")).trim(),f=!1;if(c){var v=t.ownerDocument.createElement("div");v.setAttribute(l,"vertical-writing__thresholder"),t.appendChild(v),f=v.offsetWidth>=t.offsetWidth,v.remove()}f?o.push("-force-switch"):t.getBoundingClientRect().left>e.getBoundingClientRect().left&&o.push("vertical-writing:safari"),s(t,[].concat(n(o),["vertical-writing:initialized"])),requestAnimationFrame(function(){var n;if(null!=t&&t.isConnected&&null!==(n=t.parentNode)&&void 0!==n&&n.style){if(f)return void(t.parentNode.style.height="");var i=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=i.top+i.height,l=r.top+r.height;t.parentNode.style.height=o!==l?"".concat(Math.ceil(l-i.top),"px"):""}})}else s(t,[].concat(n(o),["vertical-writing:initialized"]))}}(t)},{getResizeValue:p,observeIntersection:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0},shouldApply:A}})}}),M({key:"behaviors/dividers",selector:'[data-unitone-layout*="-divider:"]',initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(t){if("data-unitone-layout"===t.attributeName){var i,r,o,l,u=[].concat(n(null!==(i=null==e||null===(r=e.ignore)||void 0===r?void 0:r.layout)&&void 0!==i?i:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=t.target.getAttribute(t.attributeName))&&void 0!==o?o:"").split(" ").filter(function(t){return!u.includes(t)}).join(" ")!==(null!==(l=t.oldValue)&&void 0!==l?l:"").split(" ").filter(function(t){return!u.includes(t)}).join(" ")}if("class"===t.attributeName){var a,d,s,c,f=n(null!==(a=null==e||null===(d=e.ignore)||void 0===d?void 0:d.className)&&void 0!==a?a:[]);return(null!==(s=t.target.getAttribute(t.attributeName))&&void 0!==s?s:"").split(" ").filter(function(t){return!f.includes(t)}).join(" ")!==(null!==(c=t.oldValue)&&void 0!==c?c:"").split(" ").filter(function(t){return!f.includes(t)}).join(" ")}return"style"===t.attributeName};v(t,b,{getResizeValue:y,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(e){return function(t,e){return t.some(function(t){return"attributes"===t.type&&e(t)})}(e,function(e){return e.target===t&&i(e)})}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:i}})}}),M({key:"behaviors/stairs",selector:'[data-unitone-layout*="-stairs:"]',initialize:function(t){v(t,w,{observeIntersection:!0,observeDirectChildrenResize:!0})}});M({key:"compatibility/fluid-typography",selector:'[style*="font-size:"], [data-unitone-layout~="-fluid-typography"]',initialize:function(t){var e=t.ownerDocument;e.defaultView.getComputedStyle(e.documentElement).getPropertyValue("--unitone--is-firefox").trim()&&v(t,z,{getResizeValue:y,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],characterData:!0},shouldApply:function(){return!0}}})},enabled:function(){return"undefined"!=typeof window&&"undefined"!=typeof document&&!!window.getComputedStyle(document.documentElement).getPropertyValue("--unitone--is-firefox").trim()}});
|
|
1
|
+
"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function e(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}function n(n){return function(e){if(Array.isArray(e))return t(e)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||e(n)||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 i(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,l,u=[],a=!0,d=!1;try{if(o=(n=n.call(t)).next,0===e);else for(;!(a=(i=o.call(n)).done)&&(u.push(i.value),u.length!==e);a=!0);}catch(t){d=!0,r=t}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw r}}return u}}(t,n)||e(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,u=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){a=!0,l=t},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw l}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var l="data-unitone-layout",u="".concat(200,"px 0px"),a=function(t){var e;return(null!==(e=t.getAttribute(l))&&void 0!==e?e:"").split(/\s+/).filter(Boolean)},d=function(t,e){return t.filter(function(t){return!e.includes(t)})},s=function(t,e){var n,i=e.filter(Boolean).join(" ");(null!==(n=t.getAttribute(l))&&void 0!==n?n:"")!==i&&t.setAttribute(l,i)},c=function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.getValue,l=i.delay,u=!0,a=new ResizeObserver(g(function(t){var i,l=r(t);try{for(l.s();!(i=l.n()).done;){var a=i.value,d=null==o?void 0:o(a);u?(n=d,u=!1):void 0!==d&&d===n||(e(a.target,a),n=d)}}catch(t){l.e(t)}finally{l.f()}},void 0===l?250:l));return a.observe(t),a},f=function(t,e,n){var i=new MutationObserver(function(e){requestAnimationFrame(function(){null!=t&&t.isConnected&&n(e)})});return i.observe(t,e),i},v=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,a=void 0===l?250:l,d=n.observeResize,s=void 0===d||d,v=n.observeIntersection,y=void 0!==v&&v,p=n.observeDirectChildrenResize,h=void 0!==p&&p,m=n.targetMutation,w=n.directChildMutation,A=y&&"undefined"!=typeof IntersectionObserver,C=!A||b(t),z=A&&!C,E=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;null!=n&&n.isConnected&&(!A||C?(z=!1,e(n)):z=!0)},S=function(t,e){var n,i=0;return function(){var r,o;null!==(o=n=null==t||null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)&&void 0!==o&&o.requestAnimationFrame?i||(i=n.requestAnimationFrame(function(){i=0,n=null,null!=t&&t.isConnected&&e(t)})):e(t)}}(t,E),N=function(){null!=t&&t.isConnected&&(!A||C?(z=!0,S()):z=!0)},O=function(){},M=s?h?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.getValue,o=n.delay,l=void 0===o?250:o,u=n.onChildList,a=new WeakMap,d=new Set,s=new ResizeObserver(g(function(n){var o,l=!1,u=r(n);try{for(u.s();!(o=u.n()).done;){var d=o.value,s=null==i?void 0:i(d);a.has(d.target)?(void 0!==s&&s===a.get(d.target)||(l=!0),a.set(d.target,s)):a.set(d.target,s)}}catch(t){u.e(t)}finally{u.f()}l&&e(t)},l)),c=function(){var e;Array.from(d).forEach(function(e){e.parentElement!==t&&(s.unobserve(e),d.delete(e),a.delete(e))}),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach(function(t){d.has(t)||(s.observe(t),d.add(t))})};s.observe(t),c();var v=f(t,{childList:!0},function(n){n.some(function(t){return"childList"===t.type})&&(c(),null==u||u(n),e(t))});return{resizeObserver:s,mutationObserver:v}}(t,N,{getValue:o,delay:a,onChildList:function(){O()}}):{resizeObserver:c(t,N,{getValue:o,delay:a})}:{mutationObserver:null};A&&function(t,e){var n=new IntersectionObserver(function(t){var n=i(t,1)[0];n&&e(n)},{rootMargin:u});n.observe(t)}(t,function(t){(C=t.isIntersecting)&&z&&N()}),null!=m&&m.options&&f(t,m.options,function(t){var e,n;(null!==(e=null===(n=m.shouldApply)||void 0===n?void 0:n.call(m,t))&&void 0!==e?e:0<t.length)&&N()});var V=null!=w&&w.attributeFilter&&w.shouldApply?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.attributeFilter,r=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver(function(n){requestAnimationFrame(function(){null!=t&&t.isConnected&&n.some(function(e){return"attributes"===e.type&&e.target.parentElement===t&&r(e)})&&e(t)})}),a=function(){var e;u.disconnect(),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach(function(t){u.observe(t,{attributes:!0,attributeFilter:i,attributeOldValue:l})})};return a(),{observer:u,syncObservedChildren:a}}(t,N,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;V&&(O=V.syncObservedChildren),!M.mutationObserver&&V&&f(t,{childList:!0},function(t){t.some(function(t){return"childList"===t.type})&&(O(),N())}),A&&!C||E(t)},y=function(t){var e;return null===(e=t.borderBoxSize)||void 0===e?void 0:e[0].inlineSize},p=function(t){var e;return parseInt(null===(e=t.contentRect)||void 0===e?void 0:e.width)},h=function(t){return!(null==t||!t.isConnected)&&0<t.getClientRects().length},b=function(t){var e;if(!h(t))return!1;var n=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;if(!n)return!0;var i=t.getBoundingClientRect(),r=n.innerWidth,o=n.innerHeight;return i.bottom>-200&&i.right>0&&i.top<o+200&&i.left<r};function g(t,e){var n;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];var l=this;clearTimeout(n),n=setTimeout(function(){t.apply(l,r)},e)}}var m=function(t){var e,i=Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]),r=i[0];if(r){var o=d(a(t),["divider:initialized","-stack"]);s(t,o);var l=new Map;if(i.forEach(function(t){var e=d(a(t),["-bol","-linewrap"]);l.set(t,e),s(t,e)}),h(t)){var u,c=r.getBoundingClientRect(),f=i.reduce(function(t,e){var n,i=window.getComputedStyle(e).getPropertyValue("position"),r=window.getComputedStyle(e).getPropertyValue("display");"absolute"!==i&&"fixed"!==i&&"none"!==r&&t.push({child:e,layoutTokens:null!==(n=l.get(e))&&void 0!==n?n:[],rect:e.getBoundingClientRect()});return t},[]);f.map(function(t,e){var i,r,o=t.child,l=t.layoutTokens,a=t.rect,d=n(l);return(0===e||(null===(i=u)||void 0===i?void 0:i.top)<a.top&&(null===(r=u)||void 0===r?void 0:r.left)>=a.left)&&d.push("-bol"),0<e&&c.top<a.top&&d.push("-linewrap"),u=a,{child:o,layoutTokens:d}}).forEach(function(t){var e=t.child,n=t.layoutTokens;s(e,n)});var v=f.every(function(t){return t.rect.left===c.left}),y=n(o);v&&y.push("-stack"),y.push("divider:initialized"),s(t,y)}}},w=function(t){var e,i,r=Array.from(t.children),o=d(a(t),["stairs:initialized"]);s(t,o);var l=r[0];if(l){if(t.style.removeProperty("--unitone--stairs-step-overflow-volume"),t.style.removeProperty("--unitone--max-stairs-step"),r.forEach(function(t){t.style.removeProperty("--unitone--stairs-step")}),h(t)){var u,c=null===(e=(null!==(i=t.getAttribute("data-unitone-layout"))&&void 0!==i?i:"").split(/\s+/).find(function(t){return t.startsWith("-stairs-up:")}))||void 0===e?void 0:e.replace("-stairs-up:",""),f=["up-down","down-up"].includes(c),v=window.getComputedStyle(t).getPropertyValue("flex-direction"),y=t.getBoundingClientRect().bottom,p=r.reduce(function(t,e){var n=window.getComputedStyle(e).getPropertyValue("position"),i=window.getComputedStyle(e).getPropertyValue("display");return"absolute"===n||"fixed"===n||"none"===i||t.push({child:e,rect:e.getBoundingClientRect()}),t},[]),b=0,g=b;p.map(function(t,e){var n,i,r=t.child,o=t.rect,a="row-reverse"===v?(null===(n=u)||void 0===n?void 0:n.left)<=o.left:(null===(i=u)||void 0===i?void 0:i.left)>=o.left;return 0===e||l===r&&!u||a?b=0:f?b=0===b?1:0:b++,u=o,b>g&&(g=b),{child:r,stairsStep:b}}).forEach(function(t){var e=t.child,n=t.stairsStep;e.style.setProperty("--unitone--stairs-step",n)}),t.style.setProperty("--unitone--max-stairs-step",g);var m=p.reduce(function(t,e){var n=e.child.getBoundingClientRect().bottom-y;return t>n?t:n},0);t.style.setProperty("--unitone--stairs-step-overflow-volume",m),s(t,[].concat(n(o),["stairs:initialized"]))}}else s(t,[].concat(n(o),["stairs:initialized"]))},A=function(t){return t.some(function(t){return"attributes"===t.type||"childList"===t.type&&[].concat(n(t.addedNodes),n(t.removedNodes)).some(function(t){return!function(t){return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&["vertical-writing__thresholder","vertical-writing:initialized","vertical-writing:safari"].includes(t.getAttribute("data-unitone-layout"))}(t)})})},C=Symbol.for("@inc2734/unitone-css/layout-initializers"),z=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[C]||(globalThis[C]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[C])},E=function(t,e){var n,i;if(t.enabled()&&(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE){var r=new Set;null!==(n=e.matches)&&void 0!==n&&n.call(e,t.selector)&&r.add(e),null===(i=e.querySelectorAll)||void 0===i||i.call(e,t.selector).forEach(function(t){r.add(t)}),r.forEach(function(e){t.initialized.has(e)||(t.initialize(e),t.initialized.add(e))})}},S=function(t){var e=z();e&&e.initializers.forEach(function(e){E(e,t)})},N=function(){var t=z();t&&(t.pendingNodes.forEach(function(t){S(t)}),t.pendingNodes.clear(),t.rafId=0)},O=function(){var t=z();t&&!t.observer&&document.body&&(S(document.body),t.observer=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE&&t.pendingNodes.add(e)})}),!t.rafId&&0<t.pendingNodes.size&&(t.rafId=requestAnimationFrame(N))}),t.observer.observe(document.body,{childList:!0,subtree:!0}))},M=function(t){var e=t.key,n=t.selector,i=t.initialize,r=t.enabled,o=void 0===r?function(){return!0}:r,l=z();if(l&&!l.initializers.has(e)){var u={selector:n,initialize:i,enabled:o,initialized:new WeakSet};l.initializers.set(e,u),l.observer?E(u,document.body):"loading"!==document.readyState?O():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",O,{once:!0}),l.hasDOMContentLoadedListener=!0)}};M({key:"layout-primitives/marquee",selector:'[data-unitone-layout~="marquee-wrapper"]',initialize:function(t){var e;v(t,function(t){e=function(t){var e,n=function(t){var e,n=null!==(e=t.getAttribute("data-unitone-layout"))&&void 0!==e?e:"";n.split(/\s+/).includes("marquee:initialized")||t.setAttribute("data-unitone-layout","".concat(n," marquee:initialized").trim())},i=function(){return t.querySelectorAll(':scope > [data-unitone-layout~="marquee"]')},r=i();if(0!==r.length){var o=Array.from(r).some(function(t){var e;return(null!==(e=t.getAttribute(l))&&void 0!==e?e:"").split(/\s+/).includes("marquee:initialized")});if(1===t.childElementCount&&1===r.length){var u=r[0];(e=u.cloneNode(!0)).setAttribute("aria-hidden","true"),u.after(e)}return r=i(),o?(r.forEach(function(t){var e,n,i;i=(null!==(n=(e=t).getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/).filter(function(t){return t&&"marquee:initialized"!==t}).join(" "),e.setAttribute("data-unitone-layout",i)}),requestAnimationFrame(function(){null!=t&&t.isConnected&&i().forEach(function(t){n(t)})}),e):(r.forEach(function(t){n(t)}),e)}}(t)},{observeResize:!1,observeIntersection:!0,targetMutation:{options:{childList:!0},shouldApply:function(t){var n,i=t.flatMap(function(t){var e;return Array.from(null!==(e=t.addedNodes)&&void 0!==e?e:[])}),r=t.flatMap(function(t){var e;return Array.from(null!==(e=t.removedNodes)&&void 0!==e?e:[])});return null!==(n=e)&&void 0!==n&&n.isConnected&&1===i.length&&0===r.length&&i[0]===e?(e=null,!1):(e=null,!0)}}})}}),M({key:"layout-primitives/vertical-writing",selector:'[data-unitone-layout~="vertical-writing"]',initialize:function(t){v(t,function(t){var e;null!==(e=t.parentNode)&&void 0!==e&&e.style&&(t.parentNode.style.height=""),function(t){if(t){var e,i=a(t),r=d(i,["vertical-writing:safari","-force-switch"]),o=d(i,["vertical-writing:initialized","vertical-writing:safari","-force-switch"]);if(s(t,r),Array.from(t.children).reverse().some(function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position)&&"none"!==getComputedStyle(t).display)return e=t,!0}),e){var u=getComputedStyle(t),c=String(u.getPropertyValue("--unitone--threshold")).trim(),f=!1;if(c){var v=t.ownerDocument.createElement("div");v.setAttribute(l,"vertical-writing__thresholder"),t.appendChild(v),f=v.offsetWidth>=t.offsetWidth,v.remove()}f?o.push("-force-switch"):t.getBoundingClientRect().left>e.getBoundingClientRect().left&&o.push("vertical-writing:safari"),s(t,[].concat(n(o),["vertical-writing:initialized"])),requestAnimationFrame(function(){var n;if(null!=t&&t.isConnected&&null!==(n=t.parentNode)&&void 0!==n&&n.style){if(f)return void(t.parentNode.style.height="");var i=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=i.top+i.height,l=r.top+r.height;t.parentNode.style.height=o!==l?"".concat(Math.ceil(l-i.top),"px"):""}})}else s(t,[].concat(n(o),["vertical-writing:initialized"]))}}(t)},{getResizeValue:p,observeIntersection:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0},shouldApply:A}})}}),M({key:"behaviors/dividers",selector:'[data-unitone-layout*="-divider:"]',initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(t){if("data-unitone-layout"===t.attributeName){var i,r,o,l,u=[].concat(n(null!==(i=null==e||null===(r=e.ignore)||void 0===r?void 0:r.layout)&&void 0!==i?i:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=t.target.getAttribute(t.attributeName))&&void 0!==o?o:"").split(" ").filter(function(t){return!u.includes(t)}).join(" ")!==(null!==(l=t.oldValue)&&void 0!==l?l:"").split(" ").filter(function(t){return!u.includes(t)}).join(" ")}if("class"===t.attributeName){var a,d,s,c,f=n(null!==(a=null==e||null===(d=e.ignore)||void 0===d?void 0:d.className)&&void 0!==a?a:[]);return(null!==(s=t.target.getAttribute(t.attributeName))&&void 0!==s?s:"").split(" ").filter(function(t){return!f.includes(t)}).join(" ")!==(null!==(c=t.oldValue)&&void 0!==c?c:"").split(" ").filter(function(t){return!f.includes(t)}).join(" ")}return"style"===t.attributeName};v(t,m,{getResizeValue:y,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(e){return function(t,e){return t.some(function(t){return"attributes"===t.type&&e(t)})}(e,function(e){return e.target===t&&i(e)})}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:i}})}}),M({key:"behaviors/stairs",selector:'[data-unitone-layout*="-stairs:"]',initialize:function(t){v(t,w,{observeIntersection:!0,observeDirectChildrenResize:!0})}});
|
package/dist/library.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function e(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function n(n){return function(e){if(Array.isArray(e))return t(e)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||e(n)||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(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,u,l=[],a=!0,s=!1;try{if(o=(n=n.call(t)).next,0===e);else for(;!(a=(r=o.call(n)).done)&&(l.push(r.value),l.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{if(!a&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(s)throw i}}return l}}(t,n)||e(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,l=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){a=!0,u=t},f:function(){try{l||null==n.return||n.return()}finally{if(a)throw u}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var u="data-unitone-layout",l="".concat(200,"px 0px"),a=function(t){var e;return(null!==(e=t.getAttribute(u))&&void 0!==e?e:"").split(/\s+/).filter(Boolean)},s=function(t,e){return t.filter(function(t){return!e.includes(t)})},c=function(t,e){var n,r=e.filter(Boolean).join(" ");(null!==(n=t.getAttribute(u))&&void 0!==n?n:"")!==r&&t.setAttribute(u,r)},d=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.getValue,u=r.delay,l=!0,a=new ResizeObserver(m(function(t){var r,u=i(t);try{for(u.s();!(r=u.n()).done;){var a=r.value,s=null==o?void 0:o(a);l?(n=s,l=!1):void 0!==s&&s===n||(e(a.target,a),n=s)}}catch(t){u.e(t)}finally{u.f()}},void 0===u?250:u));return a.observe(t),a},f=function(t,e,n){var r=new MutationObserver(function(e){requestAnimationFrame(function(){null!=t&&t.isConnected&&n(e)})});return r.observe(t,e),r},v=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,u=n.delay,a=void 0===u?250:u,s=n.observeResize,c=void 0===s||s,v=n.observeIntersection,p=void 0!==v&&v,y=n.observeDirectChildrenResize,h=void 0!==y&&y,b=n.targetMutation,w=n.directChildMutation,A=p&&"undefined"!=typeof IntersectionObserver,C=!A||g(t),z=A&&!C,S=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;null!=n&&n.isConnected&&(!A||C?(z=!1,e(n)):z=!0)},x=function(t,e){var n,r=0;return function(){var i,o;null!==(o=n=null==t||null===(i=t.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame(function(){r=0,n=null,null!=t&&t.isConnected&&e(t)})):e(t)}}(t,S),V=function(){null!=t&&t.isConnected&&(!A||C?(z=!0,x()):z=!0)},O=function(){},R=c?h?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getValue,o=n.delay,u=void 0===o?250:o,l=n.onChildList,a=new WeakMap,s=new Set,c=new ResizeObserver(m(function(n){var o,u=!1,l=i(n);try{for(l.s();!(o=l.n()).done;){var s=o.value,c=null==r?void 0:r(s);a.has(s.target)?(void 0!==c&&c===a.get(s.target)||(u=!0),a.set(s.target,c)):a.set(s.target,c)}}catch(t){l.e(t)}finally{l.f()}u&&e(t)},u)),d=function(){var e;Array.from(s).forEach(function(e){e.parentElement!==t&&(c.unobserve(e),s.delete(e),a.delete(e))}),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach(function(t){s.has(t)||(c.observe(t),s.add(t))})};c.observe(t),d();var v=f(t,{childList:!0},function(n){n.some(function(t){return"childList"===t.type})&&(d(),null==l||l(n),e(t))});return{resizeObserver:c,mutationObserver:v}}(t,V,{getValue:o,delay:a,onChildList:function(){O()}}):{resizeObserver:d(t,V,{getValue:o,delay:a})}:{mutationObserver:null};A&&function(t,e){var n=new IntersectionObserver(function(t){var n=r(t,1)[0];n&&e(n)},{rootMargin:l});n.observe(t)}(t,function(t){(C=t.isIntersecting)&&z&&V()}),null!=b&&b.options&&f(t,b.options,function(t){var e,n;(null!==(e=null===(n=b.shouldApply)||void 0===n?void 0:n.call(b,t))&&void 0!==e?e:0<t.length)&&V()});var F=null!=w&&w.attributeFilter&&w.shouldApply?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,u=void 0===o||o,l=new MutationObserver(function(n){requestAnimationFrame(function(){null!=t&&t.isConnected&&n.some(function(e){return"attributes"===e.type&&e.target.parentElement===t&&i(e)})&&e(t)})}),a=function(){var e;l.disconnect(),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach(function(t){l.observe(t,{attributes:!0,attributeFilter:r,attributeOldValue:u})})};return a(),{observer:l,syncObservedChildren:a}}(t,V,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;F&&(O=F.syncObservedChildren),!R.mutationObserver&&F&&f(t,{childList:!0},function(t){t.some(function(t){return"childList"===t.type})&&(O(),V())}),A&&!C||S(t)},p=function(t){var e;return null===(e=t.borderBoxSize)||void 0===e?void 0:e[0].inlineSize},y=function(t){var e;return parseInt(null===(e=t.contentRect)||void 0===e?void 0:e.width)},h=function(t){return!(null==t||!t.isConnected)&&0<t.getClientRects().length},g=function(t){var e;if(!h(t))return!1;var n=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;if(!n)return!0;var r=t.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function m(t,e){var n;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var u=this;clearTimeout(n),n=setTimeout(function(){t.apply(u,i)},e)}}var b=function(t){var e,r=Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]),i=r[0];if(i){var o=s(a(t),["divider:initialized","-stack"]);c(t,o);var u=new Map;if(r.forEach(function(t){var e=s(a(t),["-bol","-linewrap"]);u.set(t,e),c(t,e)}),h(t)){var l,d=i.getBoundingClientRect(),f=r.reduce(function(t,e){var n,r=window.getComputedStyle(e).getPropertyValue("position"),i=window.getComputedStyle(e).getPropertyValue("display");"absolute"!==r&&"fixed"!==r&&"none"!==i&&t.push({child:e,layoutTokens:null!==(n=u.get(e))&&void 0!==n?n:[],rect:e.getBoundingClientRect()});return t},[]);f.map(function(t,e){var r,i,o=t.child,u=t.layoutTokens,a=t.rect,s=n(u);return(0===e||(null===(r=l)||void 0===r?void 0:r.top)<a.top&&(null===(i=l)||void 0===i?void 0:i.left)>=a.left)&&s.push("-bol"),0<e&&d.top<a.top&&s.push("-linewrap"),l=a,{child:o,layoutTokens:s}}).forEach(function(t){var e=t.child,n=t.layoutTokens;c(e,n)});var v=f.every(function(t){return t.rect.left===d.left}),p=n(o);v&&p.push("-stack"),p.push("divider:initialized"),c(t,p)}}},w=function(t){var e,r,i=Array.from(t.children),o=s(a(t),["stairs:initialized"]);c(t,o);var u=i[0];if(u){if(t.style.removeProperty("--unitone--stairs-step-overflow-volume"),t.style.removeProperty("--unitone--max-stairs-step"),i.forEach(function(t){t.style.removeProperty("--unitone--stairs-step")}),h(t)){var l,d=null===(e=(null!==(r=t.getAttribute("data-unitone-layout"))&&void 0!==r?r:"").split(/\s+/).find(function(t){return t.startsWith("-stairs-up:")}))||void 0===e?void 0:e.replace("-stairs-up:",""),f=["up-down","down-up"].includes(d),v=window.getComputedStyle(t).getPropertyValue("flex-direction"),p=t.getBoundingClientRect().bottom,y=i.reduce(function(t,e){var n=window.getComputedStyle(e).getPropertyValue("position"),r=window.getComputedStyle(e).getPropertyValue("display");return"absolute"===n||"fixed"===n||"none"===r||t.push({child:e,rect:e.getBoundingClientRect()}),t},[]),g=0,m=g;y.map(function(t,e){var n,r,i=t.child,o=t.rect,a="row-reverse"===v?(null===(n=l)||void 0===n?void 0:n.left)<=o.left:(null===(r=l)||void 0===r?void 0:r.left)>=o.left;return 0===e||u===i&&!l||a?g=0:f?g=0===g?1:0:g++,l=o,g>m&&(m=g),{child:i,stairsStep:g}}).forEach(function(t){var e=t.child,n=t.stairsStep;e.style.setProperty("--unitone--stairs-step",n)}),t.style.setProperty("--unitone--max-stairs-step",m);var b=y.reduce(function(t,e){var n=e.child.getBoundingClientRect().bottom-p;return t>n?t:n},0);t.style.setProperty("--unitone--stairs-step-overflow-volume",b),c(t,[].concat(n(o),["stairs:initialized"]))}}else c(t,[].concat(n(o),["stairs:initialized"]))},A=function(t){return t.some(function(t){return"attributes"===t.type||"childList"===t.type&&[].concat(n(t.addedNodes),n(t.removedNodes)).some(function(t){return!function(t){return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&["vertical-writing__thresholder","vertical-writing:initialized","vertical-writing:safari"].includes(t.getAttribute("data-unitone-layout"))}(t)})})},C=function(t){if(t){var e,r=a(t),i=s(r,["vertical-writing:safari","-force-switch"]),o=s(r,["vertical-writing:initialized","vertical-writing:safari","-force-switch"]);if(c(t,i),Array.from(t.children).reverse().some(function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position)&&"none"!==getComputedStyle(t).display)return e=t,!0}),e){var l=getComputedStyle(t),d=String(l.getPropertyValue("--unitone--threshold")).trim(),f=!1;if(d){var v=t.ownerDocument.createElement("div");v.setAttribute(u,"vertical-writing__thresholder"),t.appendChild(v),f=v.offsetWidth>=t.offsetWidth,v.remove()}if(f)o.push("-force-switch");else t.getBoundingClientRect().left>e.getBoundingClientRect().left&&o.push("vertical-writing:safari");c(t,[].concat(n(o),["vertical-writing:initialized"])),requestAnimationFrame(function(){var n;if(null!=t&&t.isConnected&&null!==(n=t.parentNode)&&void 0!==n&&n.style){if(f)return void(t.parentNode.style.height="");var r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),o=r.top+r.height,u=i.top+i.height;t.parentNode.style.height=o!==u?"".concat(Math.ceil(u-r.top),"px"):""}})}else c(t,[].concat(n(o),["vertical-writing:initialized"]))}},z=function(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.fontSize);n!==parseFloat(e.getPropertyValue("--unitone--result--1em-px"))&&t.style.setProperty("--unitone--result--1em-px",n)},S=function(t){var e,n=function(t){var e,n=null!==(e=t.getAttribute("data-unitone-layout"))&&void 0!==e?e:"";n.split(/\s+/).includes("marquee:initialized")||t.setAttribute("data-unitone-layout","".concat(n," marquee:initialized").trim())},r=function(){return t.querySelectorAll(':scope > [data-unitone-layout~="marquee"]')},i=r();if(0!==i.length){var o=Array.from(i).some(function(t){var e;return(null!==(e=t.getAttribute(u))&&void 0!==e?e:"").split(/\s+/).includes("marquee:initialized")});if(1===t.childElementCount&&1===i.length){var l=i[0];(e=l.cloneNode(!0)).setAttribute("aria-hidden","true"),l.after(e)}return i=r(),o?(i.forEach(function(t){var e,n,r;r=(null!==(n=(e=t).getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/).filter(function(t){return t&&"marquee:initialized"!==t}).join(" "),e.setAttribute("data-unitone-layout",r)}),requestAnimationFrame(function(){null!=t&&t.isConnected&&r().forEach(function(t){n(t)})}),e):(i.forEach(function(t){n(t)}),e)}};exports.debounce=m,exports.dividersResizeObserver=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=function(t){if("data-unitone-layout"===t.attributeName){var r,i,o,u,l=[].concat(n(null!==(r=null==e||null===(i=e.ignore)||void 0===i?void 0:i.layout)&&void 0!==r?r:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=t.target.getAttribute(t.attributeName))&&void 0!==o?o:"").split(" ").filter(function(t){return!l.includes(t)}).join(" ")!==(null!==(u=t.oldValue)&&void 0!==u?u:"").split(" ").filter(function(t){return!l.includes(t)}).join(" ")}if("class"===t.attributeName){var a,s,c,d,f=n(null!==(a=null==e||null===(s=e.ignore)||void 0===s?void 0:s.className)&&void 0!==a?a:[]);return(null!==(c=t.target.getAttribute(t.attributeName))&&void 0!==c?c:"").split(" ").filter(function(t){return!f.includes(t)}).join(" ")!==(null!==(d=t.oldValue)&&void 0!==d?d:"").split(" ").filter(function(t){return!f.includes(t)}).join(" ")}return"style"===t.attributeName};v(t,b,{getResizeValue:p,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(e){return function(t,e){return t.some(function(t){return"attributes"===t.type&&e(t)})}(e,function(e){return e.target===t&&r(e)})}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:r}})},exports.marqueeResizeObserver=function(t){var e;v(t,function(t){e=S(t)},{observeResize:!1,observeIntersection:!0,targetMutation:{options:{childList:!0},shouldApply:function(t){var n,r=t.flatMap(function(t){var e;return Array.from(null!==(e=t.addedNodes)&&void 0!==e?e:[])}),i=t.flatMap(function(t){var e;return Array.from(null!==(e=t.removedNodes)&&void 0!==e?e:[])});return null!==(n=e)&&void 0!==n&&n.isConnected&&1===r.length&&0===i.length&&r[0]===e?(e=null,!1):(e=null,!0)}}})},exports.result1emPxForFireFoxObserver=function(t){var e=t.ownerDocument;e.defaultView.getComputedStyle(e.documentElement).getPropertyValue("--unitone--is-firefox").trim()&&v(t,z,{getResizeValue:p,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],characterData:!0},shouldApply:function(){return!0}}})},exports.setColumnCountForVertical=C,exports.setDividerLinewrap=b,exports.setMarquee=S,exports.setResult1emPxForFireFox=z,exports.setStairsStep=w,exports.stairsResizeObserver=function(t){v(t,w,{observeIntersection:!0,observeDirectChildrenResize:!0})},exports.verticalsResizeObserver=function(t){v(t,function(t){var e;null!==(e=t.parentNode)&&void 0!==e&&e.style&&(t.parentNode.style.height=""),C(t)},{getResizeValue:y,observeIntersection:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0},shouldApply:A}})};
|
|
1
|
+
"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function e(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function n(n){return function(e){if(Array.isArray(e))return t(e)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||e(n)||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(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,l,u=[],a=!0,s=!1;try{if(o=(n=n.call(t)).next,0===e);else for(;!(a=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(s)throw i}}return u}}(t,n)||e(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,u=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){a=!0,l=t},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw l}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var l="data-unitone-layout",u="".concat(200,"px 0px"),a=function(t){var e;return(null!==(e=t.getAttribute(l))&&void 0!==e?e:"").split(/\s+/).filter(Boolean)},s=function(t,e){return t.filter(function(t){return!e.includes(t)})},c=function(t,e){var n,r=e.filter(Boolean).join(" ");(null!==(n=t.getAttribute(l))&&void 0!==n?n:"")!==r&&t.setAttribute(l,r)},d=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.getValue,l=r.delay,u=!0,a=new ResizeObserver(b(function(t){var r,l=i(t);try{for(l.s();!(r=l.n()).done;){var a=r.value,s=null==o?void 0:o(a);u?(n=s,u=!1):void 0!==s&&s===n||(e(a.target,a),n=s)}}catch(t){l.e(t)}finally{l.f()}},void 0===l?250:l));return a.observe(t),a},f=function(t,e,n){var r=new MutationObserver(function(e){requestAnimationFrame(function(){null!=t&&t.isConnected&&n(e)})});return r.observe(t,e),r},v=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,a=void 0===l?250:l,s=n.observeResize,c=void 0===s||s,v=n.observeIntersection,p=void 0!==v&&v,y=n.observeDirectChildrenResize,h=void 0!==y&&y,m=n.targetMutation,w=n.directChildMutation,A=p&&"undefined"!=typeof IntersectionObserver,C=!A||g(t),z=A&&!C,S=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;null!=n&&n.isConnected&&(!A||C?(z=!1,e(n)):z=!0)},O=function(t,e){var n,r=0;return function(){var i,o;null!==(o=n=null==t||null===(i=t.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame(function(){r=0,n=null,null!=t&&t.isConnected&&e(t)})):e(t)}}(t,S),R=function(){null!=t&&t.isConnected&&(!A||C?(z=!0,O()):z=!0)},V=function(){},x=c?h?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getValue,o=n.delay,l=void 0===o?250:o,u=n.onChildList,a=new WeakMap,s=new Set,c=new ResizeObserver(b(function(n){var o,l=!1,u=i(n);try{for(u.s();!(o=u.n()).done;){var s=o.value,c=null==r?void 0:r(s);a.has(s.target)?(void 0!==c&&c===a.get(s.target)||(l=!0),a.set(s.target,c)):a.set(s.target,c)}}catch(t){u.e(t)}finally{u.f()}l&&e(t)},l)),d=function(){var e;Array.from(s).forEach(function(e){e.parentElement!==t&&(c.unobserve(e),s.delete(e),a.delete(e))}),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach(function(t){s.has(t)||(c.observe(t),s.add(t))})};c.observe(t),d();var v=f(t,{childList:!0},function(n){n.some(function(t){return"childList"===t.type})&&(d(),null==u||u(n),e(t))});return{resizeObserver:c,mutationObserver:v}}(t,R,{getValue:o,delay:a,onChildList:function(){V()}}):{resizeObserver:d(t,R,{getValue:o,delay:a})}:{mutationObserver:null};A&&function(t,e){var n=new IntersectionObserver(function(t){var n=r(t,1)[0];n&&e(n)},{rootMargin:u});n.observe(t)}(t,function(t){(C=t.isIntersecting)&&z&&R()}),null!=m&&m.options&&f(t,m.options,function(t){var e,n;(null!==(e=null===(n=m.shouldApply)||void 0===n?void 0:n.call(m,t))&&void 0!==e?e:0<t.length)&&R()});var E=null!=w&&w.attributeFilter&&w.shouldApply?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver(function(n){requestAnimationFrame(function(){null!=t&&t.isConnected&&n.some(function(e){return"attributes"===e.type&&e.target.parentElement===t&&i(e)})&&e(t)})}),a=function(){var e;u.disconnect(),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach(function(t){u.observe(t,{attributes:!0,attributeFilter:r,attributeOldValue:l})})};return a(),{observer:u,syncObservedChildren:a}}(t,R,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;E&&(V=E.syncObservedChildren),!x.mutationObserver&&E&&f(t,{childList:!0},function(t){t.some(function(t){return"childList"===t.type})&&(V(),R())}),A&&!C||S(t)},p=function(t){var e;return null===(e=t.borderBoxSize)||void 0===e?void 0:e[0].inlineSize},y=function(t){var e;return parseInt(null===(e=t.contentRect)||void 0===e?void 0:e.width)},h=function(t){return!(null==t||!t.isConnected)&&0<t.getClientRects().length},g=function(t){var e;if(!h(t))return!1;var n=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;if(!n)return!0;var r=t.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function b(t,e){var n;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var l=this;clearTimeout(n),n=setTimeout(function(){t.apply(l,i)},e)}}var m=function(t){var e,r=Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]),i=r[0];if(i){var o=s(a(t),["divider:initialized","-stack"]);c(t,o);var l=new Map;if(r.forEach(function(t){var e=s(a(t),["-bol","-linewrap"]);l.set(t,e),c(t,e)}),h(t)){var u,d=i.getBoundingClientRect(),f=r.reduce(function(t,e){var n,r=window.getComputedStyle(e).getPropertyValue("position"),i=window.getComputedStyle(e).getPropertyValue("display");"absolute"!==r&&"fixed"!==r&&"none"!==i&&t.push({child:e,layoutTokens:null!==(n=l.get(e))&&void 0!==n?n:[],rect:e.getBoundingClientRect()});return t},[]);f.map(function(t,e){var r,i,o=t.child,l=t.layoutTokens,a=t.rect,s=n(l);return(0===e||(null===(r=u)||void 0===r?void 0:r.top)<a.top&&(null===(i=u)||void 0===i?void 0:i.left)>=a.left)&&s.push("-bol"),0<e&&d.top<a.top&&s.push("-linewrap"),u=a,{child:o,layoutTokens:s}}).forEach(function(t){var e=t.child,n=t.layoutTokens;c(e,n)});var v=f.every(function(t){return t.rect.left===d.left}),p=n(o);v&&p.push("-stack"),p.push("divider:initialized"),c(t,p)}}},w=function(t){var e,r,i=Array.from(t.children),o=s(a(t),["stairs:initialized"]);c(t,o);var l=i[0];if(l){if(t.style.removeProperty("--unitone--stairs-step-overflow-volume"),t.style.removeProperty("--unitone--max-stairs-step"),i.forEach(function(t){t.style.removeProperty("--unitone--stairs-step")}),h(t)){var u,d=null===(e=(null!==(r=t.getAttribute("data-unitone-layout"))&&void 0!==r?r:"").split(/\s+/).find(function(t){return t.startsWith("-stairs-up:")}))||void 0===e?void 0:e.replace("-stairs-up:",""),f=["up-down","down-up"].includes(d),v=window.getComputedStyle(t).getPropertyValue("flex-direction"),p=t.getBoundingClientRect().bottom,y=i.reduce(function(t,e){var n=window.getComputedStyle(e).getPropertyValue("position"),r=window.getComputedStyle(e).getPropertyValue("display");return"absolute"===n||"fixed"===n||"none"===r||t.push({child:e,rect:e.getBoundingClientRect()}),t},[]),g=0,b=g;y.map(function(t,e){var n,r,i=t.child,o=t.rect,a="row-reverse"===v?(null===(n=u)||void 0===n?void 0:n.left)<=o.left:(null===(r=u)||void 0===r?void 0:r.left)>=o.left;return 0===e||l===i&&!u||a?g=0:f?g=0===g?1:0:g++,u=o,g>b&&(b=g),{child:i,stairsStep:g}}).forEach(function(t){var e=t.child,n=t.stairsStep;e.style.setProperty("--unitone--stairs-step",n)}),t.style.setProperty("--unitone--max-stairs-step",b);var m=y.reduce(function(t,e){var n=e.child.getBoundingClientRect().bottom-p;return t>n?t:n},0);t.style.setProperty("--unitone--stairs-step-overflow-volume",m),c(t,[].concat(n(o),["stairs:initialized"]))}}else c(t,[].concat(n(o),["stairs:initialized"]))},A=function(t){return t.some(function(t){return"attributes"===t.type||"childList"===t.type&&[].concat(n(t.addedNodes),n(t.removedNodes)).some(function(t){return!function(t){return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&["vertical-writing__thresholder","vertical-writing:initialized","vertical-writing:safari"].includes(t.getAttribute("data-unitone-layout"))}(t)})})},C=function(t){if(t){var e,r=a(t),i=s(r,["vertical-writing:safari","-force-switch"]),o=s(r,["vertical-writing:initialized","vertical-writing:safari","-force-switch"]);if(c(t,i),Array.from(t.children).reverse().some(function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position)&&"none"!==getComputedStyle(t).display)return e=t,!0}),e){var u=getComputedStyle(t),d=String(u.getPropertyValue("--unitone--threshold")).trim(),f=!1;if(d){var v=t.ownerDocument.createElement("div");v.setAttribute(l,"vertical-writing__thresholder"),t.appendChild(v),f=v.offsetWidth>=t.offsetWidth,v.remove()}if(f)o.push("-force-switch");else t.getBoundingClientRect().left>e.getBoundingClientRect().left&&o.push("vertical-writing:safari");c(t,[].concat(n(o),["vertical-writing:initialized"])),requestAnimationFrame(function(){var n;if(null!=t&&t.isConnected&&null!==(n=t.parentNode)&&void 0!==n&&n.style){if(f)return void(t.parentNode.style.height="");var r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),o=r.top+r.height,l=i.top+i.height;t.parentNode.style.height=o!==l?"".concat(Math.ceil(l-r.top),"px"):""}})}else c(t,[].concat(n(o),["vertical-writing:initialized"]))}},z=function(t){var e,n=function(t){var e,n=null!==(e=t.getAttribute("data-unitone-layout"))&&void 0!==e?e:"";n.split(/\s+/).includes("marquee:initialized")||t.setAttribute("data-unitone-layout","".concat(n," marquee:initialized").trim())},r=function(){return t.querySelectorAll(':scope > [data-unitone-layout~="marquee"]')},i=r();if(0!==i.length){var o=Array.from(i).some(function(t){var e;return(null!==(e=t.getAttribute(l))&&void 0!==e?e:"").split(/\s+/).includes("marquee:initialized")});if(1===t.childElementCount&&1===i.length){var u=i[0];(e=u.cloneNode(!0)).setAttribute("aria-hidden","true"),u.after(e)}return i=r(),o?(i.forEach(function(t){var e,n,r;r=(null!==(n=(e=t).getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/).filter(function(t){return t&&"marquee:initialized"!==t}).join(" "),e.setAttribute("data-unitone-layout",r)}),requestAnimationFrame(function(){null!=t&&t.isConnected&&r().forEach(function(t){n(t)})}),e):(i.forEach(function(t){n(t)}),e)}};exports.debounce=b,exports.dividersResizeObserver=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=function(t){if("data-unitone-layout"===t.attributeName){var r,i,o,l,u=[].concat(n(null!==(r=null==e||null===(i=e.ignore)||void 0===i?void 0:i.layout)&&void 0!==r?r:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=t.target.getAttribute(t.attributeName))&&void 0!==o?o:"").split(" ").filter(function(t){return!u.includes(t)}).join(" ")!==(null!==(l=t.oldValue)&&void 0!==l?l:"").split(" ").filter(function(t){return!u.includes(t)}).join(" ")}if("class"===t.attributeName){var a,s,c,d,f=n(null!==(a=null==e||null===(s=e.ignore)||void 0===s?void 0:s.className)&&void 0!==a?a:[]);return(null!==(c=t.target.getAttribute(t.attributeName))&&void 0!==c?c:"").split(" ").filter(function(t){return!f.includes(t)}).join(" ")!==(null!==(d=t.oldValue)&&void 0!==d?d:"").split(" ").filter(function(t){return!f.includes(t)}).join(" ")}return"style"===t.attributeName};v(t,m,{getResizeValue:p,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(e){return function(t,e){return t.some(function(t){return"attributes"===t.type&&e(t)})}(e,function(e){return e.target===t&&r(e)})}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:r}})},exports.marqueeResizeObserver=function(t){var e;v(t,function(t){e=z(t)},{observeResize:!1,observeIntersection:!0,targetMutation:{options:{childList:!0},shouldApply:function(t){var n,r=t.flatMap(function(t){var e;return Array.from(null!==(e=t.addedNodes)&&void 0!==e?e:[])}),i=t.flatMap(function(t){var e;return Array.from(null!==(e=t.removedNodes)&&void 0!==e?e:[])});return null!==(n=e)&&void 0!==n&&n.isConnected&&1===r.length&&0===i.length&&r[0]===e?(e=null,!1):(e=null,!0)}}})},exports.setColumnCountForVertical=C,exports.setDividerLinewrap=m,exports.setMarquee=z,exports.setStairsStep=w,exports.stairsResizeObserver=function(t){v(t,w,{observeIntersection:!0,observeDirectChildrenResize:!0})},exports.verticalsResizeObserver=function(t){v(t,function(t){var e;null!==(e=t.parentNode)&&void 0!==e&&e.style&&(t.parentNode.style.height=""),C(t)},{getResizeValue:y,observeIntersection:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0},shouldApply:A}})};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inc2734/unitone-css",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.10.0",
|
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
"./layout-primitives/*/react": "./dist/layout-primitives/*/react.js",
|
|
17
17
|
"./layout-primitives/*/behavior": "./dist/layout-primitives/*/behavior.js",
|
|
18
18
|
"./behaviors": "./dist/behaviors/index.js",
|
|
19
|
-
"./behaviors/*": "./dist/behaviors/*.js"
|
|
20
|
-
"./compatibility": "./dist/compatibility/index.js",
|
|
21
|
-
"./compatibility/*": "./dist/compatibility/*.js"
|
|
19
|
+
"./behaviors/*": "./dist/behaviors/*.js"
|
|
22
20
|
},
|
|
23
21
|
"license": "MIT",
|
|
24
22
|
"repository": {
|
package/src/app.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@mixin divider() {
|
|
2
|
+
:where([data-unitone-layout*="-divider\:"]) {
|
|
3
|
+
--unitone--divider-width: 1px;
|
|
4
|
+
--unitone--divider-style: solid;
|
|
5
|
+
--unitone--divider-color: var(--unitone--color--gray);
|
|
6
|
+
|
|
7
|
+
visibility: hidden;
|
|
8
|
+
|
|
9
|
+
&[data-unitone-layout~="divider:initialized"] {
|
|
10
|
+
visibility: visible;
|
|
11
|
+
}
|
|
12
|
+
> * {
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
> ::before {
|
|
17
|
+
content: '';
|
|
18
|
+
position: absolute;
|
|
19
|
+
inset: 0;
|
|
20
|
+
user-select: none;
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
border-width: 0;
|
|
23
|
+
border-style: var(--unitone--divider-style);
|
|
24
|
+
border-color: var(--unitone--divider-color);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@mixin font-size() {
|
|
2
|
+
@each $name in 2xs, xs, s, m, l, xl, 2xl, 3xl, 4xl, 5xl, 6xl {
|
|
3
|
+
[data-unitone-layout~="-font-size\:#{ $name }"] {
|
|
4
|
+
font-size: var(--unitone--font-size-#{ $name });
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
[data-unitone-layout~="-font-size\:#{ $name }"][data-unitone-layout~="-fluid-typography"] {
|
|
8
|
+
font-size: var(--unitone--font-size-#{ $name }-fluid);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
@use './auto-repeat';
|
|
6
6
|
@use './auto-phrase';
|
|
7
7
|
@use './background-clip';
|
|
8
|
+
@use './divider';
|
|
9
|
+
@use './font-size';
|
|
8
10
|
@use './gap';
|
|
9
11
|
@use './gutters';
|
|
10
12
|
@use './justify-content';
|
|
@@ -18,7 +20,6 @@
|
|
|
18
20
|
@use './position';
|
|
19
21
|
@use './stairs';
|
|
20
22
|
@use './text-orientation';
|
|
21
|
-
@use './typography';
|
|
22
23
|
|
|
23
24
|
@include align-content.align-content();
|
|
24
25
|
@include align-items.align-items();
|
|
@@ -27,6 +28,8 @@
|
|
|
27
28
|
@include auto-repeat.auto-repeat();
|
|
28
29
|
@include auto-phrase.auto-phrase();
|
|
29
30
|
@include background-clip.background-clip();
|
|
31
|
+
@include divider.divider();
|
|
32
|
+
@include font-size.font-size();
|
|
30
33
|
@include gap.gap();
|
|
31
34
|
@include gutters.gutters();
|
|
32
35
|
@include justify-content.justify-content();
|
|
@@ -40,4 +43,3 @@
|
|
|
40
43
|
@include stairs.stairs();
|
|
41
44
|
@include position.position();
|
|
42
45
|
@include text-orientation.text-orientation();
|
|
43
|
-
@include typography.typography();
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
@mixin negative-gap() {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
--unitone--negative-gap: var(--unitone--s#{ $i }) !important;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
@for $i from 1 through 7 {
|
|
9
|
-
[data-unitone-layout~="-negative"][data-unitone-layout~="-gap\:#{ $i }s"] {
|
|
10
|
-
--unitone--negative-gap: var(--unitone--s#{ $i }s) !important;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@for $i from 2 through 7 {
|
|
15
|
-
[data-unitone-layout~="-negative"][data-unitone-layout~="-gap\:#{ $i }m"] {
|
|
16
|
-
--unitone--negative-gap: var(--unitone--s#{ $i }m) !important;
|
|
17
|
-
}
|
|
2
|
+
[data-unitone-layout~="-negative"][data-unitone-layout*="-gap\:"] {
|
|
3
|
+
--unitone--negative-gap: var(--unitone--gap) !important;
|
|
18
4
|
}
|
|
19
5
|
}
|
|
@@ -19,10 +19,6 @@
|
|
|
19
19
|
[data-unitone-layout~="-padding-left\:#{ $i }"] {
|
|
20
20
|
--unitone--padding-left: var(--unitone--p#{ $i }) !important;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
[data-unitone-layout~="-padding\:#{ $i }"][data-unitone-layout~="gutters"] {
|
|
24
|
-
--unitone--padding: var(--unitone--s#{ $i }) !important;
|
|
25
|
-
}
|
|
26
22
|
}
|
|
27
23
|
|
|
28
24
|
@for $i from 1 through 7 {
|
|
@@ -45,10 +41,6 @@
|
|
|
45
41
|
[data-unitone-layout~="-padding-left\:#{ $i }s"] {
|
|
46
42
|
--unitone--padding-left: var(--unitone--p#{ $i }s) !important;
|
|
47
43
|
}
|
|
48
|
-
|
|
49
|
-
[data-unitone-layout~="-padding\:#{ $i }s"][data-unitone-layout~="gutters"] {
|
|
50
|
-
--unitone--padding: var(--unitone--s#{ $i }s) !important;
|
|
51
|
-
}
|
|
52
44
|
}
|
|
53
45
|
|
|
54
46
|
@for $i from 2 through 7 {
|
|
@@ -71,9 +63,5 @@
|
|
|
71
63
|
[data-unitone-layout~="-padding-left\:#{ $i }m"] {
|
|
72
64
|
--unitone--padding-left: var(--unitone--p#{ $i }m) !important;
|
|
73
65
|
}
|
|
74
|
-
|
|
75
|
-
[data-unitone-layout~="-padding\:#{ $i }m"][data-unitone-layout~="gutters"] {
|
|
76
|
-
--unitone--padding: var(--unitone--s#{ $i }m) !important;
|
|
77
|
-
}
|
|
78
66
|
}
|
|
79
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
// Kept as an import-compatible no-op entry.
|
|
@@ -1 +1,141 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../variables' as variables;
|
|
2
|
+
|
|
3
|
+
*,
|
|
4
|
+
*::before,
|
|
5
|
+
*::after {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
a {
|
|
10
|
+
text-underline-offset: 0.1em;
|
|
11
|
+
text-decoration-thickness: 1px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:where(
|
|
15
|
+
address,
|
|
16
|
+
article,
|
|
17
|
+
aside,
|
|
18
|
+
blockquote,
|
|
19
|
+
details,
|
|
20
|
+
dialog,
|
|
21
|
+
dd,
|
|
22
|
+
div,
|
|
23
|
+
dl,
|
|
24
|
+
dt,
|
|
25
|
+
fieldset,
|
|
26
|
+
figcaption,
|
|
27
|
+
figure,
|
|
28
|
+
footer,
|
|
29
|
+
form,
|
|
30
|
+
h1,
|
|
31
|
+
h2,
|
|
32
|
+
h3,
|
|
33
|
+
h4,
|
|
34
|
+
h5,
|
|
35
|
+
h6,
|
|
36
|
+
header,
|
|
37
|
+
hgroup,
|
|
38
|
+
hr,
|
|
39
|
+
li,
|
|
40
|
+
main,
|
|
41
|
+
nav,
|
|
42
|
+
ol,
|
|
43
|
+
p,
|
|
44
|
+
pre,
|
|
45
|
+
section,
|
|
46
|
+
table,
|
|
47
|
+
ul
|
|
48
|
+
) {
|
|
49
|
+
margin: 0;
|
|
50
|
+
padding: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:where(li) {
|
|
54
|
+
margin-inline-start: 1.5em;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:where(
|
|
58
|
+
h1,
|
|
59
|
+
h2,
|
|
60
|
+
h3,
|
|
61
|
+
h4,
|
|
62
|
+
h5,
|
|
63
|
+
h6
|
|
64
|
+
) {
|
|
65
|
+
font-size: 100%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
small {
|
|
69
|
+
font-size: smaller;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
sup {
|
|
73
|
+
font-size: smaller;
|
|
74
|
+
|
|
75
|
+
@supports (font-variant-position: super) {
|
|
76
|
+
font-variant-position: super;
|
|
77
|
+
vertical-align: baseline;
|
|
78
|
+
font-size: inherit;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
sub {
|
|
83
|
+
font-size: smaller;
|
|
84
|
+
|
|
85
|
+
@supports (font-variant-position: sub) {
|
|
86
|
+
font-variant-position: sub;
|
|
87
|
+
vertical-align: baseline;
|
|
88
|
+
font-size: inherit;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
img,
|
|
93
|
+
video {
|
|
94
|
+
height: auto;
|
|
95
|
+
max-width: 100%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
figure {
|
|
99
|
+
max-width: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
figcaption {
|
|
103
|
+
margin: var(--unitone--s-2) 0 0;
|
|
104
|
+
display: block;
|
|
105
|
+
width: 0;
|
|
106
|
+
min-width: fit-content !important;
|
|
107
|
+
font-size: var(--unitone--font-size-xs);
|
|
108
|
+
text-align: start;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
pre {
|
|
112
|
+
text-spacing-trim: space-all;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:where(
|
|
116
|
+
button,
|
|
117
|
+
input[type="button"],
|
|
118
|
+
input[type="submit"],
|
|
119
|
+
input[type="reset"],
|
|
120
|
+
[role="button"],
|
|
121
|
+
[role="tab"],
|
|
122
|
+
[role="switch"],
|
|
123
|
+
label,
|
|
124
|
+
select,
|
|
125
|
+
input[type="checkbox"],
|
|
126
|
+
input[type="radio"],
|
|
127
|
+
input[type="range"],
|
|
128
|
+
input[type="color"],
|
|
129
|
+
summary
|
|
130
|
+
) {
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:where(
|
|
135
|
+
button:disabled,
|
|
136
|
+
input:disabled,
|
|
137
|
+
select:disabled,
|
|
138
|
+
[aria-disabled="true"]
|
|
139
|
+
) {
|
|
140
|
+
cursor: not-allowed;
|
|
141
|
+
}
|
|
@@ -1 +1,49 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use 'both-sides';
|
|
2
|
+
@use 'center';
|
|
3
|
+
@use 'cluster';
|
|
4
|
+
@use 'container';
|
|
5
|
+
@use 'cover';
|
|
6
|
+
@use 'decorator';
|
|
7
|
+
@use 'dialog';
|
|
8
|
+
@use 'divider';
|
|
9
|
+
@use 'float';
|
|
10
|
+
@use 'frame';
|
|
11
|
+
@use 'gutters';
|
|
12
|
+
@use 'layers';
|
|
13
|
+
@use 'marquee';
|
|
14
|
+
@use 'masonry';
|
|
15
|
+
@use 'popover';
|
|
16
|
+
@use 'reel';
|
|
17
|
+
@use 'responsive-grid';
|
|
18
|
+
@use 'stack';
|
|
19
|
+
@use 'switcher';
|
|
20
|
+
@use 'text';
|
|
21
|
+
@use 'texture';
|
|
22
|
+
@use 'vertical-ends';
|
|
23
|
+
@use 'vertical-writing';
|
|
24
|
+
@use 'with-sidebar';
|
|
25
|
+
|
|
26
|
+
@include both-sides.both-sides();
|
|
27
|
+
@include center.center();
|
|
28
|
+
@include cluster.cluster();
|
|
29
|
+
@include container.container();
|
|
30
|
+
@include cover.cover();
|
|
31
|
+
@include decorator.decorator();
|
|
32
|
+
@include dialog.dialog();
|
|
33
|
+
@include divider.divider();
|
|
34
|
+
@include float.float();
|
|
35
|
+
@include frame.frame();
|
|
36
|
+
@include gutters.gutters();
|
|
37
|
+
@include layers.layers();
|
|
38
|
+
@include marquee.marquee();
|
|
39
|
+
@include masonry.masonry();
|
|
40
|
+
@include popover.popover();
|
|
41
|
+
@include reel.reel();
|
|
42
|
+
@include responsive-grid.responsive-grid();
|
|
43
|
+
@include stack.stack();
|
|
44
|
+
@include switcher.switcher();
|
|
45
|
+
@include text.text();
|
|
46
|
+
@include texture.texture();
|
|
47
|
+
@include vertical-ends.vertical-ends();
|
|
48
|
+
@include vertical-writing.vertical-writing();
|
|
49
|
+
@include with-sidebar.with-sidebar();
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
@
|
|
1
|
+
@mixin abstract-both-sides() {
|
|
2
|
+
--unitone--gap: var(--unitone--global--gap);
|
|
3
|
+
--unitone--column-gap: var(--unitone--gap);
|
|
4
|
+
--unitone--row-gap: var(--unitone--gap);
|
|
5
|
+
--unitone--align-items: start;
|
|
6
|
+
--unitone--content-width: fit-content;
|
|
7
|
+
--unitone--content-max-width: 100%;
|
|
8
|
+
|
|
9
|
+
display: flex;
|
|
10
|
+
column-gap: var(--unitone--column-gap);
|
|
11
|
+
row-gap: var(--unitone--row-gap);
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
align-items: var(--unitone--align-items);
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
|
|
16
|
+
> * {
|
|
17
|
+
--unitone--max-width: var(--unitone--content-max-width);
|
|
18
|
+
--unitone--flex-basis: var(--unitone--content-width);
|
|
19
|
+
|
|
20
|
+
flex-basis: var(--unitone--flex-basis);
|
|
21
|
+
flex-grow: 0;
|
|
22
|
+
max-width: min(100%, var(--unitone--max-width));
|
|
23
|
+
min-width: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@mixin both-sides() {
|
|
28
|
+
[data-unitone-layout~="both-sides"] {
|
|
29
|
+
@include abstract-both-sides();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1 +1,22 @@
|
|
|
1
|
-
@
|
|
1
|
+
@mixin abstract-center() {
|
|
2
|
+
--unitone--gutters: 0px;
|
|
3
|
+
--unitone--max-width: var(--unitone--measure);
|
|
4
|
+
|
|
5
|
+
box-sizing: content-box;
|
|
6
|
+
margin-right: auto;
|
|
7
|
+
margin-left: auto;
|
|
8
|
+
max-width: var(--unitone--max-width);
|
|
9
|
+
padding-right: var(--unitone--gutters);
|
|
10
|
+
padding-left: var(--unitone--gutters);
|
|
11
|
+
width: fit-content;
|
|
12
|
+
|
|
13
|
+
&[data-unitone-layout~="-with-text"] {
|
|
14
|
+
text-align: center;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin center() {
|
|
19
|
+
[data-unitone-layout~="center"] {
|
|
20
|
+
@include abstract-center();
|
|
21
|
+
}
|
|
22
|
+
}
|