@ably/ui 14.0.0-dev.f6c8d86 → 14.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.
Files changed (118) hide show
  1. package/core/Accordion.js +1 -1
  2. package/core/Code.js +1 -1
  3. package/core/ContactFooter/component.css +9 -7
  4. package/core/ContactFooter.js +1 -1
  5. package/core/CookieMessage/component.css +12 -10
  6. package/core/CookieMessage.js +1 -1
  7. package/core/Expander.js +1 -0
  8. package/core/Flash/component.css +21 -19
  9. package/core/Flash.js +1 -1
  10. package/core/Footer/component.css +24 -22
  11. package/core/Footer.js +1 -1
  12. package/core/Meganav/component.css +105 -103
  13. package/core/Meganav/component.js +1 -1
  14. package/core/Meganav.js +1 -1
  15. package/core/Notice/component.css +6 -4
  16. package/core/Notice/component.js +1 -1
  17. package/core/Notice.js +1 -1
  18. package/core/Slider/component.css +32 -30
  19. package/core/Slider/component.js +1 -1
  20. package/core/Slider.js +1 -1
  21. package/core/Table/Table.js +1 -1
  22. package/core/Table/TableCell.js +3 -3
  23. package/core/Table/data.js +1 -1
  24. package/core/Table.js +1 -1
  25. package/core/scripts.js +1 -1
  26. package/core/styles/buttons.css +123 -121
  27. package/core/styles/forms.css +51 -49
  28. package/core/styles/layout.css +16 -14
  29. package/core/styles/properties.css +252 -250
  30. package/core/styles/text.css +167 -165
  31. package/core/styles.components.css +24 -22
  32. package/core/utils/syntax-highlighter.css +59 -55
  33. package/package.json +2 -4
  34. package/src/core/Accordion.tsx +8 -6
  35. package/src/core/Code.tsx +0 -1
  36. package/src/core/ContactFooter/component.css +9 -7
  37. package/src/core/ContactFooter.tsx +0 -1
  38. package/src/core/CookieMessage/component.css +12 -10
  39. package/src/core/CookieMessage.tsx +0 -1
  40. package/src/core/Expander/Expander.stories.tsx +132 -0
  41. package/src/core/Expander.tsx +63 -0
  42. package/src/core/Flash/component.css +21 -19
  43. package/src/core/Flash.tsx +0 -1
  44. package/src/core/Footer/component.css +24 -22
  45. package/src/core/Footer.tsx +0 -1
  46. package/src/core/Meganav/component.css +105 -103
  47. package/src/core/Meganav/component.js +0 -2
  48. package/src/core/Meganav.tsx +0 -1
  49. package/src/core/Notice/component.css +6 -4
  50. package/src/core/Notice/component.js +0 -1
  51. package/src/core/Notice.tsx +0 -1
  52. package/src/core/Slider/Slider.stories.tsx +2 -2
  53. package/src/core/Slider/component.css +32 -30
  54. package/src/core/Slider/component.js +0 -2
  55. package/src/core/Slider.tsx +51 -20
  56. package/src/core/Table/Table.tsx +1 -2
  57. package/src/core/Table/TableCell.tsx +2 -40
  58. package/src/core/Table/data.tsx +21 -1
  59. package/src/core/Table.tsx +1 -12
  60. package/src/core/scripts.js +0 -2
  61. package/src/core/styles/buttons.css +123 -121
  62. package/src/core/styles/forms.css +51 -49
  63. package/src/core/styles/layout.css +16 -14
  64. package/src/core/styles/properties.css +252 -250
  65. package/src/core/styles/text.css +167 -165
  66. package/src/core/styles.components.css +24 -22
  67. package/src/core/utils/syntax-highlighter.css +59 -55
  68. package/core/.DS_Store +0 -0
  69. package/core/Accordion/.DS_Store +0 -0
  70. package/core/Code/.DS_Store +0 -0
  71. package/core/ContactFooter/.DS_Store +0 -0
  72. package/core/CookieMessage/.DS_Store +0 -0
  73. package/core/CustomerLogos/.DS_Store +0 -0
  74. package/core/DropdownMenu/.DS_Store +0 -0
  75. package/core/FeaturedLink/.DS_Store +0 -0
  76. package/core/Flash/.DS_Store +0 -0
  77. package/core/Footer/.DS_Store +0 -0
  78. package/core/Icon/.DS_Store +0 -0
  79. package/core/Loader/.DS_Store +0 -0
  80. package/core/Logo/.DS_Store +0 -0
  81. package/core/Meganav/.DS_Store +0 -0
  82. package/core/MeganavBlogPostsList/.DS_Store +0 -0
  83. package/core/MeganavControl/.DS_Store +0 -0
  84. package/core/MeganavControlMobileDropdown/.DS_Store +0 -0
  85. package/core/MeganavControlMobilePanelClose/.DS_Store +0 -0
  86. package/core/MeganavControlMobilePanelOpen/.DS_Store +0 -0
  87. package/core/MeganavSearchAutocomplete/.DS_Store +0 -0
  88. package/core/MeganavSearchSuggestions/.DS_Store +0 -0
  89. package/core/Notice/.DS_Store +0 -0
  90. package/core/Slider/.DS_Store +0 -0
  91. package/core/Table/.DS_Store +0 -0
  92. package/core/Tooltip/.DS_Store +0 -0
  93. package/src/.DS_Store +0 -0
  94. package/src/core/.DS_Store +0 -0
  95. package/src/core/Accordion/.DS_Store +0 -0
  96. package/src/core/Code/.DS_Store +0 -0
  97. package/src/core/ContactFooter/.DS_Store +0 -0
  98. package/src/core/CookieMessage/.DS_Store +0 -0
  99. package/src/core/CustomerLogos/.DS_Store +0 -0
  100. package/src/core/DropdownMenu/.DS_Store +0 -0
  101. package/src/core/FeaturedLink/.DS_Store +0 -0
  102. package/src/core/Flash/.DS_Store +0 -0
  103. package/src/core/Footer/.DS_Store +0 -0
  104. package/src/core/Icon/.DS_Store +0 -0
  105. package/src/core/Loader/.DS_Store +0 -0
  106. package/src/core/Logo/.DS_Store +0 -0
  107. package/src/core/Meganav/.DS_Store +0 -0
  108. package/src/core/MeganavBlogPostsList/.DS_Store +0 -0
  109. package/src/core/MeganavControl/.DS_Store +0 -0
  110. package/src/core/MeganavControlMobileDropdown/.DS_Store +0 -0
  111. package/src/core/MeganavControlMobilePanelClose/.DS_Store +0 -0
  112. package/src/core/MeganavControlMobilePanelOpen/.DS_Store +0 -0
  113. package/src/core/MeganavSearchAutocomplete/.DS_Store +0 -0
  114. package/src/core/MeganavSearchSuggestions/.DS_Store +0 -0
  115. package/src/core/Notice/.DS_Store +0 -0
  116. package/src/core/Slider/.DS_Store +0 -0
  117. package/src/core/Table/.DS_Store +0 -0
  118. package/src/core/Tooltip/.DS_Store +0 -0
package/core/Notice.js CHANGED
@@ -1 +1 @@
1
- import React,{useEffect}from"react";import NoticeScripts from"./Notice/component.js";import"./Notice/component.css";import Icon from"./Icon";const contentWrapperClasses="w-full pr-8 ui-text-p3 self-center";const ContentWrapper=({buttonLink,children})=>buttonLink?React.createElement("a",{href:buttonLink,className:contentWrapperClasses},children):React.createElement("div",{className:contentWrapperClasses},children);const Notice=({buttonLink,buttonLabel,bodyText,title,config,closeBtn,bgColor="bg-gradient-active-orange",textColor="text-white"})=>{useEffect(()=>{NoticeScripts({bannerContainer:document.querySelector('[data-id="ui-notice"]'),cookieId:config===null||config===void 0?void 0:config.cookieId,noticeId:config===null||config===void 0?void 0:config.noticeId,options:{collapse:(config===null||config===void 0?void 0:config.collapse)||false}})},[]);const wrapperClasses=["ui-announcement",bgColor,textColor].join(" ");return React.createElement("div",{className:wrapperClasses,"data-id":"ui-notice",style:{maxHeight:0,overflow:"hidden"}},React.createElement("div",{className:"ui-grid-px py-16 max-w-screen-xl mx-auto flex items-start"},React.createElement(ContentWrapper,{buttonLink:buttonLink!==null&&buttonLink!==void 0?buttonLink:"#"},React.createElement("strong",{className:"font-bold whitespace-nowrap pr-4"},title),React.createElement("span",{className:"pr-4"},bodyText),buttonLabel&&React.createElement("span",{className:"underline cursor-pointer whitespace-nowrap"},buttonLabel)),closeBtn&&React.createElement("button",{type:"button",className:"ml-auto h-20 w-20 border-none bg-none self-baseline"},React.createElement(Icon,{name:"icon-gui-close",size:"1.25rem",color:"text-cool-black"}))))};export default Notice;
1
+ import React,{useEffect}from"react";import NoticeScripts from"./Notice/component.js";import Icon from"./Icon";const contentWrapperClasses="w-full pr-8 ui-text-p3 self-center";const ContentWrapper=({buttonLink,children})=>buttonLink?React.createElement("a",{href:buttonLink,className:contentWrapperClasses},children):React.createElement("div",{className:contentWrapperClasses},children);const Notice=({buttonLink,buttonLabel,bodyText,title,config,closeBtn,bgColor="bg-gradient-active-orange",textColor="text-white"})=>{useEffect(()=>{NoticeScripts({bannerContainer:document.querySelector('[data-id="ui-notice"]'),cookieId:config===null||config===void 0?void 0:config.cookieId,noticeId:config===null||config===void 0?void 0:config.noticeId,options:{collapse:(config===null||config===void 0?void 0:config.collapse)||false}})},[]);const wrapperClasses=["ui-announcement",bgColor,textColor].join(" ");return React.createElement("div",{className:wrapperClasses,"data-id":"ui-notice",style:{maxHeight:0,overflow:"hidden"}},React.createElement("div",{className:"ui-grid-px py-16 max-w-screen-xl mx-auto flex items-start"},React.createElement(ContentWrapper,{buttonLink:buttonLink!==null&&buttonLink!==void 0?buttonLink:"#"},React.createElement("strong",{className:"font-bold whitespace-nowrap pr-4"},title),React.createElement("span",{className:"pr-4"},bodyText),buttonLabel&&React.createElement("span",{className:"underline cursor-pointer whitespace-nowrap"},buttonLabel)),closeBtn&&React.createElement("button",{type:"button",className:"ml-auto h-20 w-20 border-none bg-none self-baseline"},React.createElement(Icon,{name:"icon-gui-close",size:"1.25rem",color:"text-cool-black"}))))};export default Notice;
@@ -1,38 +1,40 @@
1
- .ui-slider-marker {
2
- font-size: 0.5rem;
3
- top: -1px;
1
+ @layer components {
2
+ .ui-slider-marker {
3
+ font-size: 0.5rem;
4
+ top: -1px;
4
5
 
5
- @apply leading-none px-4 relative;
6
- }
7
-
8
- @keyframes fillAnimation {
9
- 0% {
10
- width: 0%;
11
- }
12
- 100% {
13
- width: 100%;
6
+ @apply leading-none px-4 relative;
14
7
  }
15
- }
16
-
17
- .ui-icon-cta {
18
- @apply cursor-pointer overflow-hidden;
19
- @apply rounded border-2 border-mid-grey hover:border-active-orange;
20
- transition: all 0.4s;
21
- }
22
8
 
23
- @screen sm {
24
- .ui-icon-cta-left:hover .ui-icon-cta-holder {
25
- transform: translateX(-120%);
9
+ @keyframes fillAnimation {
10
+ 0% {
11
+ width: 0%;
12
+ }
13
+ 100% {
14
+ width: 100%;
15
+ }
26
16
  }
27
- .ui-icon-cta-right .ui-icon-cta-holder {
28
- transform: translateX(-120%);
17
+
18
+ .ui-icon-cta {
19
+ @apply cursor-pointer overflow-hidden;
20
+ @apply rounded border-2 border-mid-grey hover:border-active-orange;
21
+ transition: all 0.4s;
29
22
  }
30
- .ui-icon-cta-right:hover .ui-icon-cta-holder {
31
- transform: translateX(0%);
23
+
24
+ @screen sm {
25
+ .ui-icon-cta-left:hover .ui-icon-cta-holder {
26
+ transform: translateX(-120%);
27
+ }
28
+ .ui-icon-cta-right .ui-icon-cta-holder {
29
+ transform: translateX(-120%);
30
+ }
31
+ .ui-icon-cta-right:hover .ui-icon-cta-holder {
32
+ transform: translateX(0%);
33
+ }
32
34
  }
33
- }
34
35
 
35
- .ui-icon-cta-holder {
36
- @apply w-full h-full;
37
- transition: all 0.4s;
36
+ .ui-icon-cta-holder {
37
+ @apply w-full h-full;
38
+ transition: all 0.4s;
39
+ }
38
40
  }
@@ -1 +1 @@
1
- import"./component.css";import throttle from"lodash.throttle";import{queryId,queryIdAll}from"../dom-query";const mdBreakpoint=()=>window.matchMedia("(min-width: 48rem)").matches;const DRAG_BUFFER=20;const init=slidesContainer=>{const transformContainer=queryId("slider-strip",slidesContainer);const slides=Array.from(queryIdAll("slider-slide",slidesContainer));const slideLeftChevron=queryId("slider-previous",slidesContainer);const slideRightChevron=queryId("slider-next",slidesContainer);const slideMarkers=Array.from(queryIdAll("slider-marker",slidesContainer));const sliderControls=queryId("slider-controls",slidesContainer);sliderControls.classList.replace("hidden","flex");const slidesLength=slides.length;const slidesWidth=slidesContainer.getBoundingClientRect().width;const{width:slideWidth,left:slideLeftDistance}=slides[0].getBoundingClientRect();const{left:slideLeftDistanceSecond}=slides[1].getBoundingClientRect();const slideGap=slideLeftDistanceSecond-slideLeftDistance-slideWidth;const adjustment=(slidesWidth-slideWidth)/2;let currentIndex=0;let touchStartX=0;const calculateTransform=index=>index*-slideWidth+adjustment+index*-slideGap;const updateSlide=index=>transformContainer.style.transform=`translateX(${calculateTransform(index)}px)`;const updateMarkers=index=>{slideMarkers.forEach(marker=>marker.classList.remove("text-active-orange"));slideMarkers[index].classList.remove("text-cool-black");slideMarkers[index].classList.add("text-active-orange")};const slideLeft=()=>{currentIndex=currentIndex-1<=0?0:currentIndex-1;updateSlide(currentIndex);updateMarkers(currentIndex)};const slideRight=()=>{currentIndex=currentIndex+1>=slidesLength?currentIndex:currentIndex+1;updateSlide(currentIndex);updateMarkers(currentIndex)};updateSlide(0);updateMarkers(0);slideLeftChevron.addEventListener("click",slideLeft);transformContainer.addEventListener("touchstart",e=>{var _e_touches_;touchStartX=(_e_touches_=e.touches[0])===null||_e_touches_===void 0?void 0:_e_touches_.clientX});transformContainer.addEventListener("touchend",e=>{var _e_changedTouches_;const distance=((_e_changedTouches_=e.changedTouches[0])===null||_e_changedTouches_===void 0?void 0:_e_changedTouches_.clientX)-touchStartX;if(Math.abs(distance)<DRAG_BUFFER)return;const direction=distance>0?slideLeft:slideRight;direction()});slideRightChevron.addEventListener("click",slideRight);return()=>{transformContainer.style.transform=null;sliderControls.classList.replace("flex","hidden")}};const Slider=({container,mqEnableThreshold})=>{if(!container)return;const breakpointCheck=mqEnableThreshold||(()=>!mdBreakpoint());let unmount=()=>{};if(breakpointCheck())unmount=init(container);window.addEventListener("resize",throttle(()=>{if(breakpointCheck()){unmount=init(container)}else{unmount()}},100))};export default Slider;
1
+ import throttle from"lodash.throttle";import{queryId,queryIdAll}from"../dom-query";const mdBreakpoint=()=>window.matchMedia("(min-width: 48rem)").matches;const DRAG_BUFFER=20;const init=slidesContainer=>{const transformContainer=queryId("slider-strip",slidesContainer);const slides=Array.from(queryIdAll("slider-slide",slidesContainer));const slideLeftChevron=queryId("slider-previous",slidesContainer);const slideRightChevron=queryId("slider-next",slidesContainer);const slideMarkers=Array.from(queryIdAll("slider-marker",slidesContainer));const sliderControls=queryId("slider-controls",slidesContainer);sliderControls.classList.replace("hidden","flex");const slidesLength=slides.length;const slidesWidth=slidesContainer.getBoundingClientRect().width;const{width:slideWidth,left:slideLeftDistance}=slides[0].getBoundingClientRect();const{left:slideLeftDistanceSecond}=slides[1].getBoundingClientRect();const slideGap=slideLeftDistanceSecond-slideLeftDistance-slideWidth;const adjustment=(slidesWidth-slideWidth)/2;let currentIndex=0;let touchStartX=0;const calculateTransform=index=>index*-slideWidth+adjustment+index*-slideGap;const updateSlide=index=>transformContainer.style.transform=`translateX(${calculateTransform(index)}px)`;const updateMarkers=index=>{slideMarkers.forEach(marker=>marker.classList.remove("text-active-orange"));slideMarkers[index].classList.remove("text-cool-black");slideMarkers[index].classList.add("text-active-orange")};const slideLeft=()=>{currentIndex=currentIndex-1<=0?0:currentIndex-1;updateSlide(currentIndex);updateMarkers(currentIndex)};const slideRight=()=>{currentIndex=currentIndex+1>=slidesLength?currentIndex:currentIndex+1;updateSlide(currentIndex);updateMarkers(currentIndex)};updateSlide(0);updateMarkers(0);slideLeftChevron.addEventListener("click",slideLeft);transformContainer.addEventListener("touchstart",e=>{var _e_touches_;touchStartX=(_e_touches_=e.touches[0])===null||_e_touches_===void 0?void 0:_e_touches_.clientX});transformContainer.addEventListener("touchend",e=>{var _e_changedTouches_;const distance=((_e_changedTouches_=e.changedTouches[0])===null||_e_changedTouches_===void 0?void 0:_e_changedTouches_.clientX)-touchStartX;if(Math.abs(distance)<DRAG_BUFFER)return;const direction=distance>0?slideLeft:slideRight;direction()});slideRightChevron.addEventListener("click",slideRight);return()=>{transformContainer.style.transform=null;sliderControls.classList.replace("flex","hidden")}};const Slider=({container,mqEnableThreshold})=>{if(!container)return;const breakpointCheck=mqEnableThreshold||(()=>!mdBreakpoint());let unmount=()=>{};if(breakpointCheck())unmount=init(container);window.addEventListener("resize",throttle(()=>{if(breakpointCheck()){unmount=init(container)}else{unmount()}},100))};export default Slider;
package/core/Slider.js CHANGED
@@ -1 +1 @@
1
- import React,{useState,useEffect,useRef}from"react";import Icon from"../core/Icon.tsx";import"./Slider/component.css";const SlideIndicator=({numSlides,activeIndex,interval,intervalIndicator,isInline})=>{return React.createElement("ul",{className:`flex gap-4 left-1/2 ${isInline?"bottom-0":"absolute -bottom-40 transform -translate-x-1/2"}`},Array.from({length:numSlides},(_,i)=>intervalIndicator?React.createElement("li",{key:i,className:"relative w-40 h-4 mx-1 rounded-full bg-neutral-500"},i===activeIndex&&React.createElement("li",{className:"absolute inset-0 rounded-full bg-active-orange",style:{animation:`fillAnimation ${interval}ms linear`}})):React.createElement("li",{key:i},React.createElement("span",{className:`ui-slider-marker ${i===activeIndex?"text-active-orange":"text-cool-black"}`,"data-id":"slider-marker"},"⬤"))))};const Slider=({children,options})=>{const[activeIndex,setActiveIndex]=useState(0);const[touchStartX,setTouchStartX]=useState(0);const[touchEndX,setTouchEndX]=useState(0);const timerRef=useRef(null);const isInline=(options===null||options===void 0?void 0:options.controlPosition)==="inline";const next=()=>{setActiveIndex(prevIndex=>(prevIndex+1)%children.length);resetInterval()};const prev=()=>{setActiveIndex(prevIndex=>prevIndex>0?prevIndex-1:children.length-1);resetInterval()};const resetInterval=()=>{if(timerRef.current)clearInterval(timerRef.current);var _options_interval;timerRef.current=setInterval(next,(_options_interval=options===null||options===void 0?void 0:options.interval)!==null&&_options_interval!==void 0?_options_interval:1e4)};const handleTouchStart=e=>{setTouchStartX(e.touches[0].clientX)};const handleTouchMove=e=>{setTouchEndX(e.touches[0].clientX)};const handleTouchEnd=()=>{if(touchStartX-touchEndX>50){next()}if(touchStartX-touchEndX<-50){prev()}};useEffect(()=>{resetInterval();return()=>{if(timerRef.current)clearInterval(timerRef.current)}},[children.length,options===null||options===void 0?void 0:options.interval]);var _options_interval;return React.createElement("div",{className:"relative",onTouchStart:handleTouchStart,onTouchMove:handleTouchMove,onTouchEnd:handleTouchEnd},React.createElement("div",{className:"overflow-hidden w-full py-40"},React.createElement("div",{className:"flex items-center transition-transform ease-in-out duration-500",style:{transform:`translateX(-${activeIndex*100}%)`}},children.map((child,index)=>React.createElement("div",{key:index,className:"w-full flex-shrink-0 flex justify-center sm:px-60 transition-opacity ease-in delay-500 duration-500",style:{opacity:activeIndex===index?1:.1}},child)))),React.createElement("div",{className:`flex items-center pointer-events-none ${isInline?"ui-standard-container justify-center gap-24":"sm:flex sm:absolute inset-0 justify-between"}`},React.createElement("button",{className:`${isInline?"w-32 h-32":"hidden sm:flex w-48 h-48"} pointer-events-auto rounded border border-mid-grey hover:border-active-orange flex justify-center items-center ui-icon-cta ui-icon-cta-left`,onClick:prev},React.createElement("div",{className:"ui-icon-cta-holder flex gap-4"},React.createElement("div",{className:"w-full h-full flex-shrink-0 flex items-center justify-center"},React.createElement(Icon,{name:"icon-gui-arrow-left",size:"1.5rem"})),React.createElement("div",{className:"w-full h-full flex-shrink-0 flex items-center justify-center"},React.createElement(Icon,{name:"icon-gui-arrow-left",size:"1.5rem"})))),React.createElement(SlideIndicator,{numSlides:children.length,activeIndex:activeIndex,interval:(_options_interval=options===null||options===void 0?void 0:options.interval)!==null&&_options_interval!==void 0?_options_interval:1e4,intervalIndicator:options===null||options===void 0?void 0:options.intervalIndicator,isInline:isInline}),React.createElement("button",{className:`${isInline?"w-32 h-32":"hidden sm:flex w-48 h-48"} pointer-events-auto rounded border border-mid-grey hover:border-active-orange justify-center items-center ui-icon-cta ui-icon-cta-right`,onClick:next},React.createElement("div",{className:"ui-icon-cta-holder flex gap-4"},React.createElement("div",{className:"w-full h-full flex-shrink-0 flex items-center justify-center"},React.createElement(Icon,{name:"icon-gui-arrow-right",size:"1.5rem"})),React.createElement("div",{className:"w-full h-full flex-shrink-0 flex items-center justify-center"},React.createElement(Icon,{name:"icon-gui-arrow-right",size:"1.5rem"}))))))};export default Slider;
1
+ import React,{useState,useEffect,useRef}from"react";import Icon from"./Icon";const SLIDE_TRANSITION_LENGTH=300;const SlideIndicator=({numSlides,activeIndex,interval,intervalIndicator,isInline})=>{return React.createElement("ul",{className:`flex gap-4 left-1/2 ${isInline?"bottom-0":"absolute bottom-0 transform -translate-x-1/2"}`},Array.from({length:numSlides},(_,i)=>intervalIndicator?React.createElement("li",{key:i,className:"relative w-40 h-4 mx-1 rounded-full bg-neutral-500"},i===activeIndex&&React.createElement("span",{className:"absolute inset-0 rounded-full bg-active-orange",style:{animation:`fillAnimation ${interval}ms linear`}})):React.createElement("li",{key:i},React.createElement("span",{className:`ui-slider-marker ${i===activeIndex?"text-active-orange":"text-cool-black"}`,"data-id":"slider-marker"},"⬤"))))};const setupSlides=(children,activeIndex)=>[children[activeIndex===0?children.length-1:activeIndex-1],children[activeIndex],children[activeIndex===children.length-1?0:activeIndex+1]];const Slider=({children,options})=>{const[activeIndex,setActiveIndex]=useState(0);const[touchStartX,setTouchStartX]=useState(0);const[touchEndX,setTouchEndX]=useState(0);const[slides,setSlides]=useState(setupSlides(children,activeIndex));const[translationCoefficient,setTranslationCoefficient]=useState(0);const timerRef=useRef(null);const[slideLock,setSlideLock]=useState(false);const isInline=(options===null||options===void 0?void 0:options.controlPosition)==="inline";const next=()=>{if(!slideLock){setActiveIndex(prevIndex=>(prevIndex+1)%children.length);setTranslationCoefficient(1);resetInterval();setSlideLock(true)}};const prev=()=>{if(!slideLock){setActiveIndex(prevIndex=>prevIndex>0?prevIndex-1:children.length-1);setTranslationCoefficient(-1);resetInterval();setSlideLock(true)}};const resetInterval=()=>{if(timerRef.current)clearInterval(timerRef.current);var _options_interval;timerRef.current=setInterval(next,(_options_interval=options===null||options===void 0?void 0:options.interval)!==null&&_options_interval!==void 0?_options_interval:1e4)};const handleTouchStart=e=>{setTouchStartX(e.touches[0].clientX)};const handleTouchMove=e=>{setTouchEndX(e.touches[0].clientX)};const handleTouchEnd=()=>{if(touchStartX-touchEndX>50){next()}if(touchStartX-touchEndX<-50){prev()}};useEffect(()=>{resetInterval();return()=>{if(timerRef.current)clearInterval(timerRef.current)}},[children.length,options===null||options===void 0?void 0:options.interval]);useEffect(()=>{setTimeout(()=>{setSlides(setupSlides(children,activeIndex));setTranslationCoefficient(0);setSlideLock(false)},SLIDE_TRANSITION_LENGTH)},[activeIndex]);var _options_interval;return React.createElement("div",{className:"relative",onTouchStart:handleTouchStart,onTouchMove:handleTouchMove,onTouchEnd:handleTouchEnd},React.createElement("div",{className:"overflow-y-visible overflow-x-clip w-full py-40"},React.createElement("div",{className:`flex items-center ${translationCoefficient!==0?`transition-transform ease-in-out duration-${SLIDE_TRANSITION_LENGTH}`:""} `,style:{transform:`translateX(-${(translationCoefficient+1)*100}%)`}},slides.map((child,index)=>React.createElement("div",{key:index,className:"w-full flex-shrink-0 flex justify-center sm:px-60"},child)))),React.createElement("div",{className:`flex items-center pointer-events-none ${isInline?"ui-standard-container justify-center gap-24 -mt-16":"sm:flex sm:absolute inset-0 justify-between"}`},React.createElement("button",{className:`${isInline?"w-32 h-32":"hidden sm:flex w-48 h-48"} pointer-events-auto rounded border border-mid-grey hover:border-active-orange flex justify-center items-center ui-icon-cta ui-icon-cta-left`,onClick:prev},React.createElement("div",{className:"ui-icon-cta-holder flex gap-4"},React.createElement("div",{className:"w-full h-full flex-shrink-0 flex items-center justify-center"},React.createElement(Icon,{name:"icon-gui-arrow-left",size:"1.5rem"})),React.createElement("div",{className:"w-full h-full flex-shrink-0 flex items-center justify-center"},React.createElement(Icon,{name:"icon-gui-arrow-left",size:"1.5rem"})))),React.createElement(SlideIndicator,{numSlides:children.length,activeIndex:activeIndex,interval:(_options_interval=options===null||options===void 0?void 0:options.interval)!==null&&_options_interval!==void 0?_options_interval:1e4,intervalIndicator:options===null||options===void 0?void 0:options.intervalIndicator,isInline:isInline}),React.createElement("button",{className:`${isInline?"w-32 h-32":"hidden sm:flex w-48 h-48"} pointer-events-auto rounded border border-mid-grey hover:border-active-orange justify-center items-center ui-icon-cta ui-icon-cta-right`,onClick:next},React.createElement("div",{className:"ui-icon-cta-holder flex gap-4"},React.createElement("div",{className:"w-full h-full flex-shrink-0 flex items-center justify-center"},React.createElement(Icon,{name:"icon-gui-arrow-right",size:"1.5rem"})),React.createElement("div",{className:"w-full h-full flex-shrink-0 flex items-center justify-center"},React.createElement(Icon,{name:"icon-gui-arrow-right",size:"1.5rem"}))))))};export default Slider;
@@ -1 +1 @@
1
- import React,{cloneElement}from"react";export const Table=({id,children,...rest})=>{var _rest_className;return React.createElement("table",{id:id,...rest,className:`ui-standard-container mb-4 sm:table-fixed ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}`},children)};export const TableBody=({children,...rest})=>React.createElement("tbody",rest,children);export const TableHeader=({children,...rest})=>{var _rest_className;return React.createElement("thead",{...rest,className:`sticky bg-white z-10 top-0 ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}`},cloneElement(children,{isHeader:true}))};export const TableRowHeader=({children,...rest})=>{var _rest_className;return React.createElement("tr",{className:`-ml-24 mt-8 sm:ml-0 sm:mt-0 bg-light-grey sm:sticky z-10 ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}`,style:{top:"4rem"}},cloneElement(children,{isRowHeader:true}))};
1
+ import React,{cloneElement}from"react";export const Table=({id,children,...rest})=>{var _rest_className;return React.createElement("table",{id:id,...rest,className:`ui-standard-container mb-4 sm:table-fixed ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}`},children)};export const TableBody=({children,...rest})=>React.createElement("tbody",rest,children);export const TableHeader=({children,...rest})=>{var _rest_className;return React.createElement("thead",{...rest,className:`sticky bg-white z-10 top-0 ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}`},cloneElement(children,{isHeader:true}))};export const TableRowHeader=({children,...rest})=>{var _rest_className;return React.createElement("tr",{className:`-ml-24 mt-8 sm:ml-0 sm:mt-0 sm:sticky z-10 ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}`},cloneElement(children,{isRowHeader:true}))};
@@ -1,7 +1,7 @@
1
- import React from"react";import Icon from"../Icon";const Supported=()=>React.createElement(Icon,{name:"icon-gui-check-circled-fill",size:"1.5rem",color:"text-gui-success",additionalCSS:"flex-grow-0 flex-shrink-0","data-testid":"supported-icon"});const Unsupported=()=>React.createElement(Icon,{name:"icon-gui-cross-circled-fill",size:"1.5rem",color:"text-gui-error",additionalCSS:"flex-grow-0 flex-shrink-0","data-testid":"unsupported-icon"});const Partial=()=>React.createElement(Icon,{name:"icon-gui-partial",size:"1.5rem",additionalCSS:"flex-grow-0 flex-shrink-0","data-testid":"partial-icon"});const LabelCell=({children,...rest})=>{var _rest_className;const classes=`
2
- ui-text-p1 !font-bold pt-24 pb-8 border-light-grey sm:p-24 sm:relative sm:top-2 flex sm:table-cell ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}
1
+ import React from"react";const LabelCell=({children,...rest})=>{var _rest_className;const classes=`
2
+ ui-text-p1 font-bold pt-24 pb-8 border-light-grey sm:p-24 sm:relative sm:top-2 flex sm:table-cell ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}
3
3
  `;return React.createElement("td",{...rest,className:classes},children)};const TableCell=({children,isRowHeader,...rest})=>{var _rest_className;return React.createElement("td",{...rest,className:`
4
4
  border-light-grey sm:p-24 leading-none flex sm:table-cell
5
5
  ${isRowHeader?"rounded-l-none rounded-r sm:rounded-lg py-20 px-24":"py-6"}
6
6
  ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}
7
- `},children)};const HeaderCell=({children,...rest})=>{var _rest_className;return React.createElement("td",{...rest,className:`ui-text-h3 px-24 py-24 hidden sm:table-cell ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}`},children)};const CtaCell=({children,...rest})=>{var _rest_className;return React.createElement("td",{...rest,className:`pt-24 hidden sm:table-cell ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}`},children)};export{TableCell,LabelCell,HeaderCell,CtaCell,Supported,Unsupported,Partial};
7
+ `},children)};const HeaderCell=({children,...rest})=>{var _rest_className;return React.createElement("td",{...rest,className:`ui-text-h3 px-24 py-24 hidden sm:table-cell ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}`},children)};const CtaCell=({children,...rest})=>{var _rest_className;return React.createElement("td",{...rest,className:`pt-24 hidden sm:table-cell ${(_rest_className=rest===null||rest===void 0?void 0:rest.className)!==null&&_rest_className!==void 0?_rest_className:""}`},children)};export{TableCell,LabelCell,HeaderCell,CtaCell};
@@ -1 +1 @@
1
- import React,{Fragment}from"react";import Tooltip from"../Tooltip";import{Supported,Unsupported}from"./TableCell";import Table from"../Table";const testRow=index=>({label:`Label ${index+1}`,cells:[{label:"text",content:"Cell content",column:"Free"},{label:"yes",content:React.createElement("div",{className:"flex items-center sm:flex-col sm:items-start"},React.createElement("span",{className:"sm:order-1 px-6 sm:py-6 sm:px-0"},"Supported"),React.createElement("span",{className:"sm:order-0"},React.createElement(Supported,null))),column:"PAYG"},{label:"no",content:React.createElement("div",{className:"flex items-center sm:flex-col sm:items-start"},React.createElement("span",{className:"sm:order-1 px-6 sm:py-6 sm:px-0"},"Unsupported"),React.createElement("span",{className:"sm:order-0"},React.createElement(Unsupported,null))),column:"Custom"}]});const sections=["Features","Support","Technical Support"].map(label=>({label,rows:[...Array(5)].map((_,i)=>testRow(i))}));export const PricingPageTable=()=>{return React.createElement("div",{className:"ui-standard-container"},React.createElement("h2",{className:"ui-text-h2 text-center m-32"},"Pricing Page Table"),React.createElement("p",{className:"text-center m-32"},"Example content"),React.createElement(Table.Root,null,React.createElement(Table.Header,null,React.createElement(Table.Row,null,React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"Free")),React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"PAYG")),React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"Custom")))),React.createElement(Table.Body,null,sections.map(section=>React.createElement(Fragment,{key:section.label},React.createElement(Table.RowHeader,null,React.createElement(Table.Cell,{colSpan:4},section.label)),section.rows.map(row=>React.createElement(Table.Row,{key:row.label},React.createElement(Table.LabelCell,{key:row.label,className:"border-t border-light-grey"},React.createElement("a",{className:"ui-link",href:"#"},row.label),React.createElement(Tooltip,null,"Example tooltip")),row.cells.map(cell=>React.createElement(Table.Cell,{key:cell.label,className:"last:mb-16 sm:mb-0"},React.createElement("div",{className:"flex-1 sm:hidden !text-dark-grey ui-text-overline2"},cell.column),cell.content)))))),React.createElement(Table.Row,null,React.createElement(Table.Cell,null),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn-secondary"},"Get started")),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn-secondary"},"Get started")),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn"},"Contact sales"))))))};
1
+ import React,{Fragment}from"react";import Tooltip from"../Tooltip";import Table from"../Table";import Icon from"../Icon";const Supported=()=>React.createElement(Icon,{name:"icon-gui-check-circled-fill",size:"1.5rem",color:"text-gui-success",additionalCSS:"flex-grow-0 flex-shrink-0","data-testid":"supported-icon"});const Unsupported=()=>React.createElement(Icon,{name:"icon-gui-cross-circled-fill",size:"1.5rem",color:"text-gui-error",additionalCSS:"flex-grow-0 flex-shrink-0","data-testid":"unsupported-icon"});const testRow=index=>({label:`Label ${index+1}`,cells:[{label:"text",content:"Cell content",column:"Free"},{label:"yes",content:React.createElement("div",{className:"flex items-center sm:flex-col sm:items-start"},React.createElement("span",{className:"sm:order-1 px-6 sm:py-6 sm:px-0"},"Supported"),React.createElement("span",{className:"sm:order-0"},React.createElement(Supported,null))),column:"PAYG"},{label:"no",content:React.createElement("div",{className:"flex items-center sm:flex-col sm:items-start"},React.createElement("span",{className:"sm:order-1 px-6 sm:py-6 sm:px-0"},"Unsupported"),React.createElement("span",{className:"sm:order-0"},React.createElement(Unsupported,null))),column:"Custom"}]});const sections=["Features","Support","Technical Support"].map(label=>({label,rows:[...Array(5)].map((_,i)=>testRow(i))}));export const PricingPageTable=()=>{return React.createElement("div",{className:"ui-standard-container"},React.createElement("h2",{className:"ui-text-h2 text-center m-32"},"Pricing Page Table"),React.createElement("p",{className:"text-center m-32"},"Example content"),React.createElement(Table.Root,null,React.createElement(Table.Header,null,React.createElement(Table.Row,null,React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"Free")),React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"PAYG")),React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"Custom")))),React.createElement(Table.Body,null,sections.map(section=>React.createElement(Fragment,{key:section.label},React.createElement(Table.RowHeader,null,React.createElement(Table.Cell,{colSpan:4},section.label)),section.rows.map(row=>React.createElement(Table.Row,{key:row.label},React.createElement(Table.LabelCell,{key:row.label,className:"border-t border-light-grey"},React.createElement("a",{className:"ui-link",href:"#"},row.label),React.createElement(Tooltip,null,"Example tooltip")),row.cells.map(cell=>React.createElement(Table.Cell,{key:cell.label,className:"last:mb-16 sm:mb-0"},React.createElement("div",{className:"flex-1 sm:hidden !text-dark-grey ui-text-overline2"},cell.column),cell.content)))))),React.createElement(Table.Row,null,React.createElement(Table.Cell,null),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn-secondary"},"Get started")),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn-secondary"},"Get started")),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn"},"Contact sales"))))))};
package/core/Table.js CHANGED
@@ -1 +1 @@
1
- import{Table,TableRowHeader,TableHeader,TableBody}from"./Table/Table";import{TableRow}from"./Table/TableRow";import{TableCell,LabelCell,HeaderCell,CtaCell,Supported,Unsupported,Partial}from"./Table/TableCell";export default{Root:Table,Row:TableRow,Cell:TableCell,LabelCell,HeaderCell,CtaCell,RowHeader:TableRowHeader,Body:TableBody,Header:TableHeader,Supported,Unsupported,Partial};
1
+ import{Table,TableRowHeader,TableHeader,TableBody}from"./Table/Table";import{TableRow}from"./Table/TableRow";import{TableCell,LabelCell,HeaderCell,CtaCell}from"./Table/TableCell";export default{Root:Table,Row:TableRow,Cell:TableCell,LabelCell,HeaderCell,CtaCell,RowHeader:TableRowHeader,Body:TableBody,Header:TableHeader};
package/core/scripts.js CHANGED
@@ -1 +1 @@
1
- import"array-flat-polyfill";import"./styles.css";export{default as reactRenderer,renderComponent}from"./react-renderer";export{default as loadSprites}from"./load-sprites";export{default as toggleChatWidget}from"./hubspot-chat-toggle";export*from"./remote-data-store";export*from"./remote-blogs-posts";export*from"./remote-session-data";export*from"./dom-query";
1
+ import"array-flat-polyfill";export{default as reactRenderer,renderComponent}from"./react-renderer";export{default as loadSprites}from"./load-sprites";export{default as toggleChatWidget}from"./hubspot-chat-toggle";export*from"./remote-data-store";export*from"./remote-blogs-posts";export*from"./remote-session-data";export*from"./dom-query";
@@ -1,122 +1,124 @@
1
- .ui-btn {
2
- @apply text-white bg-cool-black text-btn2 font-sans font-bold inline-block rounded p-btn;
3
- @apply hover:text-white hover:bg-active-orange;
4
- @apply active:text-white active:bg-red-orange;
5
- @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
6
- @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
7
- @apply transition-colors;
8
- @apply inline-flex items-center justify-center;
9
- }
10
-
11
- .ui-btn-alt {
12
- transition: background-position 0.2s;
13
- background: linear-gradient(
14
- 61.2deg,
15
- var(--color-active-orange) 5%,
16
- #fe5215 19%,
17
- #fc4a13 27%,
18
- #f73c10 33%,
19
- #f1280a 39%,
20
- #e90f04 44%,
21
- var(--color-red-orange) 50%
22
- );
23
- background-size: 200% 100%;
24
- background-position: 0% 0%;
25
-
26
- @apply text-white text-btn2 font-sans font-bold inline-block rounded p-btn;
27
- @apply focus:outline-gui-focus;
28
- @apply inline-flex items-center justify-center;
29
- }
30
-
31
- .ui-btn-alt:hover,
32
- .ui-btn-alt:focus {
33
- background-position: 100% 0%;
34
- }
35
-
36
- .ui-btn-alt:disabled {
37
- background: linear-gradient(var(--gradient-transparent));
38
- @apply bg-gui-unavailable text-mid-grey cursor-not-allowed;
39
- }
40
-
41
- .ui-btn-invert {
42
- @apply text-cool-black bg-white text-btn2 font-sans font-bold inline-block rounded p-btn;
43
- @apply hover:text-white hover:bg-active-orange;
44
- @apply active:text-white active:bg-red-orange;
45
- @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
46
- @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
47
- @apply transition-colors;
48
- @apply inline-flex items-center justify-center;
49
- }
50
-
51
- .ui-btn-secondary {
52
- @apply text-cool-black bg-white text-btn2 font-sans font-bold inline-block border-btn border-cool-black rounded p-btn;
53
- @apply hover:text-cool-black hover:border-active-orange hover:bg-white;
54
- @apply active:border-red-orange active:bg-white;
55
- @apply focus:border-cool-black focus:bg-white focus:outline-gui-focus;
56
- @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:bg-white disabled:cursor-not-allowed;
57
- @apply transition-colors;
58
- @apply inline-flex items-center justify-center;
59
- }
60
-
61
- .ui-btn-secondary-invert {
62
- @apply text-white bg-cool-black text-btn2 font-sans font-bold inline-block border-btn border-mid-grey rounded p-btn;
63
- @apply hover:text-white hover:border-active-orange;
64
- @apply active:border-red-orange;
65
- @apply focus:outline-gui-focus;
66
- @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:cursor-not-allowed;
67
- @apply transition-colors;
68
- @apply inline-flex items-center justify-center;
69
- }
70
-
71
- .ui-btn-icon {
72
- @apply w-24 h-24 mr-16;
73
- }
74
-
75
- .ui-btn-icon-small {
76
- @apply w-20 h-20 mr-12;
77
- }
78
-
79
- .ui-btn-icon-xsmall {
80
- @apply w-16 h-16 mr-8;
81
- }
82
-
83
- .ui-chip {
84
- @apply text-btn3 p-chip rounded text-cool-black;
85
- @apply hover:bg-mid-grey;
86
- @apply active:bg-red-orange active:text-white;
87
- @apply focus:bg-red-orange focus:text-white focus:outline-none;
88
- @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
89
- @apply transition-colors;
90
- }
91
-
92
- .ui-chip[data-selected] {
93
- @apply bg-active-orange text-white;
94
- }
95
-
96
- .ui-chip[data-selected]:hover {
97
- @apply bg-mid-grey text-cool-black;
98
- }
99
-
100
- .ui-chip[data-selected]:focus {
101
- @apply bg-red-orange text-white;
102
- }
103
-
104
- .ui-chip-alt {
105
- @apply text-btn3 p-chip rounded text-white;
106
- @apply hover:bg-gui-hover;
107
- @apply active:bg-gui-active active:text-white;
108
- @apply focus:bg-gui-active focus:text-white focus:outline-none;
109
- @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
110
- @apply transition-colors;
111
- }
112
-
113
- .ui-chip-alt[data-selected] {
114
- @apply bg-dark-grey text-white;
115
- }
116
- .ui-chip-alt[data-selected]:hover {
117
- @apply bg-gui-hover text-white;
118
- }
119
-
120
- .ui-chip-alt[data-selected]:focus {
121
- @apply bg-gui-active text-white;
1
+ @layer components {
2
+ .ui-btn {
3
+ @apply text-white bg-cool-black text-btn2 font-sans font-bold inline-block rounded p-btn;
4
+ @apply hover:text-white hover:bg-active-orange;
5
+ @apply active:text-white active:bg-red-orange;
6
+ @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
7
+ @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
8
+ @apply transition-colors;
9
+ @apply inline-flex items-center justify-center;
10
+ }
11
+
12
+ .ui-btn-alt {
13
+ transition: background-position 0.2s;
14
+ background: linear-gradient(
15
+ 61.2deg,
16
+ var(--color-active-orange) 5%,
17
+ #fe5215 19%,
18
+ #fc4a13 27%,
19
+ #f73c10 33%,
20
+ #f1280a 39%,
21
+ #e90f04 44%,
22
+ var(--color-red-orange) 50%
23
+ );
24
+ background-size: 200% 100%;
25
+ background-position: 0% 0%;
26
+
27
+ @apply text-white text-btn2 font-sans font-bold inline-block rounded p-btn;
28
+ @apply focus:outline-gui-focus;
29
+ @apply inline-flex items-center justify-center;
30
+ }
31
+
32
+ .ui-btn-alt:hover,
33
+ .ui-btn-alt:focus {
34
+ background-position: 100% 0%;
35
+ }
36
+
37
+ .ui-btn-alt:disabled {
38
+ background: linear-gradient(var(--gradient-transparent));
39
+ @apply bg-gui-unavailable text-mid-grey cursor-not-allowed;
40
+ }
41
+
42
+ .ui-btn-invert {
43
+ @apply text-cool-black bg-white text-btn2 font-sans font-bold inline-block rounded p-btn;
44
+ @apply hover:text-white hover:bg-active-orange;
45
+ @apply active:text-white active:bg-red-orange;
46
+ @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
47
+ @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
48
+ @apply transition-colors;
49
+ @apply inline-flex items-center justify-center;
50
+ }
51
+
52
+ .ui-btn-secondary {
53
+ @apply text-cool-black bg-white text-btn2 font-sans font-bold inline-block border-btn border-cool-black rounded p-btn;
54
+ @apply hover:text-cool-black hover:border-active-orange hover:bg-white;
55
+ @apply active:border-red-orange active:bg-white;
56
+ @apply focus:border-cool-black focus:bg-white focus:outline-gui-focus;
57
+ @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:bg-white disabled:cursor-not-allowed;
58
+ @apply transition-colors;
59
+ @apply inline-flex items-center justify-center;
60
+ }
61
+
62
+ .ui-btn-secondary-invert {
63
+ @apply text-white bg-cool-black text-btn2 font-sans font-bold inline-block border-btn border-mid-grey rounded p-btn;
64
+ @apply hover:text-white hover:border-active-orange;
65
+ @apply active:border-red-orange;
66
+ @apply focus:outline-gui-focus;
67
+ @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:cursor-not-allowed;
68
+ @apply transition-colors;
69
+ @apply inline-flex items-center justify-center;
70
+ }
71
+
72
+ .ui-btn-icon {
73
+ @apply w-24 h-24 mr-16;
74
+ }
75
+
76
+ .ui-btn-icon-small {
77
+ @apply w-20 h-20 mr-12;
78
+ }
79
+
80
+ .ui-btn-icon-xsmall {
81
+ @apply w-16 h-16 mr-8;
82
+ }
83
+
84
+ .ui-chip {
85
+ @apply text-btn3 p-chip rounded text-cool-black;
86
+ @apply hover:bg-mid-grey;
87
+ @apply active:bg-red-orange active:text-white;
88
+ @apply focus:bg-red-orange focus:text-white focus:outline-none;
89
+ @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
90
+ @apply transition-colors;
91
+ }
92
+
93
+ .ui-chip[data-selected] {
94
+ @apply bg-active-orange text-white;
95
+ }
96
+
97
+ .ui-chip[data-selected]:hover {
98
+ @apply bg-mid-grey text-cool-black;
99
+ }
100
+
101
+ .ui-chip[data-selected]:focus {
102
+ @apply bg-red-orange text-white;
103
+ }
104
+
105
+ .ui-chip-alt {
106
+ @apply text-btn3 p-chip rounded text-white;
107
+ @apply hover:bg-gui-hover;
108
+ @apply active:bg-gui-active active:text-white;
109
+ @apply focus:bg-gui-active focus:text-white focus:outline-none;
110
+ @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
111
+ @apply transition-colors;
112
+ }
113
+
114
+ .ui-chip-alt[data-selected] {
115
+ @apply bg-dark-grey text-white;
116
+ }
117
+ .ui-chip-alt[data-selected]:hover {
118
+ @apply bg-gui-hover text-white;
119
+ }
120
+
121
+ .ui-chip-alt[data-selected]:focus {
122
+ @apply bg-gui-active text-white;
123
+ }
122
124
  }
@@ -1,62 +1,64 @@
1
- .ui-checkbox-p1 {
2
- @apply flex items-start mb-16 font-sans font-medium;
3
- }
1
+ @layer components {
2
+ .ui-checkbox-p1 {
3
+ @apply flex items-start mb-16 font-sans font-medium;
4
+ }
4
5
 
5
- .ui-checkbox-p2 {
6
- @apply flex items-start mb-12 font-sans font-medium;
7
- }
6
+ .ui-checkbox-p2 {
7
+ @apply flex items-start mb-12 font-sans font-medium;
8
+ }
8
9
 
9
- .ui-checkbox-input {
10
- @apply opacity-0 absolute h-20 w-20;
11
- }
10
+ .ui-checkbox-input {
11
+ @apply opacity-0 absolute h-20 w-20;
12
+ }
12
13
 
13
- .ui-checkbox-styled {
14
- @apply w-20 h-20 mr-16;
15
- @apply bg-white flex flex-shrink-0 justify-center items-center;
16
- @apply border border-dark-grey rounded-md focus-within:border-active-orange;
17
- }
14
+ .ui-checkbox-styled {
15
+ @apply w-20 h-20 mr-16;
16
+ @apply bg-white flex flex-shrink-0 justify-center items-center;
17
+ @apply border border-dark-grey rounded-md focus-within:border-active-orange;
18
+ }
18
19
 
19
- .ui-checkbox-styled-tick {
20
- @apply hidden text-white;
21
- }
20
+ .ui-checkbox-styled-tick {
21
+ @apply hidden text-white;
22
+ }
22
23
 
23
- .ui-checkbox-label-p1 {
24
- @apply select-none;
25
- @apply text-p1 font-medium text-cool-black;
26
- }
24
+ .ui-checkbox-label-p1 {
25
+ @apply select-none;
26
+ @apply text-p1 font-medium text-cool-black;
27
+ }
27
28
 
28
- .ui-checkbox-label-p2 {
29
- @apply select-none;
30
- @apply text-p2 font-medium text-cool-black;
31
- }
29
+ .ui-checkbox-label-p2 {
30
+ @apply select-none;
31
+ @apply text-p2 font-medium text-cool-black;
32
+ }
32
33
 
33
- .ui-checkbox-input:disabled + .ui-checkbox-styled {
34
- @apply bg-gui-unavailable border;
35
- }
34
+ .ui-checkbox-input:disabled + .ui-checkbox-styled {
35
+ @apply bg-gui-unavailable border;
36
+ }
36
37
 
37
- .ui-checkbox-input:focus + .ui-checkbox-styled {
38
- border-width: 0.125rem;
39
- @apply border-gui-focus;
40
- }
38
+ .ui-checkbox-input:focus + .ui-checkbox-styled {
39
+ border-width: 0.125rem;
40
+ @apply border-gui-focus;
41
+ }
41
42
 
42
- .ui-checkbox-input:checked + .ui-checkbox-styled {
43
- @apply bg-active-orange border-dark-grey border;
44
- }
43
+ .ui-checkbox-input:checked + .ui-checkbox-styled {
44
+ @apply bg-active-orange border-dark-grey border;
45
+ }
45
46
 
46
- .ui-checkbox-input:checked + .ui-checkbox-styled svg {
47
- @apply block;
48
- }
47
+ .ui-checkbox-input:checked + .ui-checkbox-styled svg {
48
+ @apply block;
49
+ }
49
50
 
50
- .ui-textarea {
51
- @apply font-sans font-medium text-cool-black text-p1;
52
- @apply p-input mb-16;
53
- @apply bg-light-grey border-mid-grey transition-input border rounded block w-full;
54
- @apply hover:bg-white hover:shadow-input hover:border-transparent;
55
- @apply focus:bg-white focus:shadow-input focus:border-transparent focus:outline-gui-focus;
56
- }
51
+ .ui-textarea {
52
+ @apply font-sans font-medium text-cool-black text-p1;
53
+ @apply p-input mb-16;
54
+ @apply bg-light-grey border-mid-grey transition-input border rounded block w-full;
55
+ @apply hover:bg-white hover:shadow-input hover:border-transparent;
56
+ @apply focus:bg-white focus:shadow-input focus:border-transparent focus:outline-gui-focus;
57
+ }
57
58
 
58
- .ui-textarea::placeholder {
59
- /* CSS vars don't work in ::placeholder in Webkit :( */
60
- /* color: var(--text-dark-grey); */
61
- color: #76767c;
59
+ .ui-textarea::placeholder {
60
+ /* CSS vars don't work in ::placeholder in Webkit :( */
61
+ /* color: var(--text-dark-grey); */
62
+ color: #76767c;
63
+ }
62
64
  }
@@ -1,19 +1,21 @@
1
- .ui-standard-container {
2
- @apply w-full max-w-screen-xl mx-auto px-24 sm:px-32 md:px-40 lg:px-64;
3
- }
1
+ @layer components {
2
+ .ui-standard-container {
3
+ @apply w-full max-w-screen-xl mx-auto px-24 sm:px-32 md:px-40 lg:px-64;
4
+ }
4
5
 
5
- .ui-grid-gap {
6
- @apply gap-8 sm:gap-16 md:gap-24 xl:gap-32;
7
- }
6
+ .ui-grid-gap {
7
+ @apply gap-8 sm:gap-16 md:gap-24 xl:gap-32;
8
+ }
8
9
 
9
- .ui-grid-gap-x {
10
- @apply gap-x-8 sm:gap-x-16 md:gap-x-24 xl:gap-x-32;
11
- }
10
+ .ui-grid-gap-x {
11
+ @apply gap-x-8 sm:gap-x-16 md:gap-x-24 xl:gap-x-32;
12
+ }
12
13
 
13
- .ui-grid-px {
14
- @apply px-24 sm:px-32 md:px-40 lg:px-64;
15
- }
14
+ .ui-grid-px {
15
+ @apply px-24 sm:px-32 md:px-40 lg:px-64;
16
+ }
16
17
 
17
- .ui-grid-mx {
18
- @apply mx-24 sm:mx-32 md:mx-40 lg:mx-64;
18
+ .ui-grid-mx {
19
+ @apply mx-24 sm:mx-32 md:mx-40 lg:mx-64;
20
+ }
19
21
  }