@consumidor-positivo/aurora 0.0.193 → 0.0.195
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/components/Carousel/index.es.js.map +1 -1
- package/dist/components/Footer/index.es.js +1 -1
- package/dist/components/Footer/index.es.js.map +1 -1
- package/dist/components/Footer/styles.css +1 -1
- package/dist/components/misc/index.d.ts +3 -0
- package/dist/components/misc/index.es.js +6 -1
- package/dist/components/misc/index.es.js.map +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.es.js +10 -5
- package/dist/main.es.js.map +1 -1
- package/dist/react-if.esm-CGh0ofh0.js +65 -0
- package/dist/react-if.esm-CGh0ofh0.js.map +1 -0
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Prototype/Carousel/Scrollbar.tsx","../../../lib/components/Prototype/Carousel/helpers.ts","../../../lib/components/Prototype/Carousel/Pagination.tsx","../../../node_modules/react-snap-carousel/dist/use-snap-carousel.mjs","../../../lib/components/Prototype/Carousel/useCarouselDrag.ts","../../../lib/components/Prototype/Carousel/useCarousel.ts","../../../lib/components/Prototype/Carousel/index.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\ntype ScrollbarProps = {\n pages: number[][];\n pageToEnterIndex: number;\n};\n\nexport const Scrollbar = ({ pageToEnterIndex, pages }: ScrollbarProps) => {\n const scrollTrail = useRef<HTMLDivElement>(null);\n const scrollbar = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!scrollTrail.current || !scrollbar.current) return;\n const trailSize = scrollTrail.current.offsetWidth;\n const barSize = scrollbar.current.offsetWidth;\n const availableScrollSpace = trailSize - barSize;\n\n const currentPercentage = (pageToEnterIndex + 1) / pages.length;\n const scrollDistance = currentPercentage * availableScrollSpace;\n\n const barTranslate = pageToEnterIndex === 0 ? 0 : scrollDistance;\n scrollbar.current.style.transform = `translateX(${barTranslate}px)`;\n }, [pages, pageToEnterIndex]);\n\n return (\n <div className=\"au-carousel__scrollbar\" ref={scrollTrail}>\n <div className=\"au-carousel__scrollbar-scroll\" ref={scrollbar}></div>\n </div>\n );\n};\n","//TODO remove\n\nconst isClient = () =>\n !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n )\n\nexport function isMobile() {\n if (!isClient()) return\n return !!window.matchMedia('screen and (max-width:767px)').matches\n}\n","import { Conditional } from '@components/misc'\nimport { isMobile } from './helpers'\nimport { Text } from '@components/Text'\n\ntype PaginationProps = {\n pages: number[][]\n pageToEnterIndex: number\n mobileText: string\n}\n\nexport const Pagination = ({\n pageToEnterIndex,\n pages,\n mobileText,\n}: PaginationProps) => {\n return (\n <div className=\"au-carousel__pagination\">\n <Text color=\"secondary\" weight=\"regular\">\n <Conditional\n condition={!isMobile()}\n renderIf={'Página'}\n renderElse={mobileText}\n />{' '}\n <b>\n {pageToEnterIndex + 1} de {pages.length}\n </b>\n </Text>\n </div>\n )\n}\n","// src/use-snap-carousel.tsx\nimport { useState, useCallback, useEffect as useEffect2, useMemo } from \"react\";\n\n// src/use-isomorphic-layout-effect.tsx\nimport { useEffect, useLayoutEffect } from \"react\";\nvar useIsomorphicLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/use-snap-carousel.tsx\nvar useSnapCarousel = ({\n axis = \"x\",\n initialPages = []\n} = {}) => {\n const dimension = axis === \"x\" ? \"width\" : \"height\";\n const scrollDimension = axis === \"x\" ? \"scrollWidth\" : \"scrollHeight\";\n const clientDimension = axis === \"x\" ? \"clientWidth\" : \"clientHeight\";\n const nearSidePos = axis === \"x\" ? \"left\" : \"top\";\n const farSidePos = axis === \"x\" ? \"right\" : \"bottom\";\n const scrollPos = axis === \"x\" ? \"scrollLeft\" : \"scrollTop\";\n const [scrollEl, setScrollEl] = useState(null);\n const [{ pages, activePageIndex }, setCarouselState] = useState({\n pages: initialPages,\n activePageIndex: 0\n });\n const refreshActivePage = useCallback(\n (pages2) => {\n if (!scrollEl) {\n return;\n }\n const hasScrolledToEnd = Math.floor(scrollEl[scrollDimension] - scrollEl[scrollPos]) <= scrollEl[clientDimension];\n if (hasScrolledToEnd) {\n setCarouselState({ pages: pages2, activePageIndex: pages2.length - 1 });\n return;\n }\n const items = Array.from(scrollEl.children);\n const scrollPort = scrollEl.getBoundingClientRect();\n const offsets = pages2.map((page) => {\n const leadIndex = page[0];\n const leadEl = items[leadIndex];\n assert(leadEl instanceof HTMLElement, \"Expected HTMLElement\");\n const scrollSpacing = getEffectiveScrollSpacing(\n scrollEl,\n leadEl,\n nearSidePos\n );\n const rect = leadEl.getBoundingClientRect();\n const offset = rect[nearSidePos] - scrollPort[nearSidePos] - scrollSpacing;\n return Math.abs(offset);\n });\n const minOffset = Math.min(...offsets);\n const nextActivePageIndex = offsets.indexOf(minOffset);\n setCarouselState({ pages: pages2, activePageIndex: nextActivePageIndex });\n },\n [scrollEl, clientDimension, nearSidePos, scrollDimension, scrollPos]\n );\n const refresh = useCallback(() => {\n if (!scrollEl) {\n return;\n }\n const items = Array.from(scrollEl.children);\n const scrollPort = scrollEl.getBoundingClientRect();\n let currPageStartPos;\n const pages2 = items.reduce((acc, item, i) => {\n assert(item instanceof HTMLElement, \"Expected HTMLElement\");\n const currPage = acc[acc.length - 1];\n const rect = getOffsetRect(item, item.parentElement);\n if (!currPage || item.dataset.shouldSnap === \"true\" || rect[farSidePos] - currPageStartPos > Math.ceil(scrollPort[dimension])) {\n acc.push([i]);\n const scrollSpacing = getEffectiveScrollSpacing(\n scrollEl,\n item,\n nearSidePos\n );\n currPageStartPos = rect[nearSidePos] - scrollSpacing;\n } else {\n currPage.push(i);\n }\n return acc;\n }, []);\n refreshActivePage(pages2);\n }, [refreshActivePage, scrollEl, dimension, farSidePos, nearSidePos]);\n useIsomorphicLayoutEffect(() => {\n refresh();\n }, [refresh]);\n useEffect2(() => {\n const handle = () => {\n refresh();\n };\n window.addEventListener(\"resize\", handle);\n window.addEventListener(\"orientationchange\", handle);\n return () => {\n window.removeEventListener(\"resize\", handle);\n window.removeEventListener(\"orientationchange\", handle);\n };\n }, [refresh]);\n useEffect2(() => {\n if (!scrollEl) {\n return;\n }\n const handle = () => {\n refreshActivePage(pages);\n };\n scrollEl.addEventListener(\"scroll\", handle);\n return () => {\n scrollEl.removeEventListener(\"scroll\", handle);\n };\n }, [refreshActivePage, pages, scrollEl]);\n const handleGoTo = (index, opts) => {\n if (!scrollEl) {\n return;\n }\n const page = pages[index];\n if (!page) {\n return;\n }\n const items = Array.from(scrollEl.children);\n const leadIndex = page[0];\n const leadEl = items[leadIndex];\n if (!(leadEl instanceof HTMLElement)) {\n return;\n }\n const scrollSpacing = getEffectiveScrollSpacing(\n scrollEl,\n leadEl,\n nearSidePos\n );\n const behavior = (opts == null ? void 0 : opts.behavior) || \"smooth\";\n scrollEl.scrollTo({\n behavior,\n [nearSidePos]: getOffsetRect(leadEl, leadEl.parentElement)[nearSidePos] - scrollSpacing\n });\n };\n const handlePrev = (opts) => {\n handleGoTo(activePageIndex - 1, opts);\n };\n const handleNext = (opts) => {\n handleGoTo(activePageIndex + 1, opts);\n };\n const snapPointIndexes = useMemo(\n () => new Set(pages.map((page) => page[0])),\n [pages]\n );\n const hasPrevPage = activePageIndex > 0;\n const hasNextPage = activePageIndex < pages.length - 1;\n return {\n hasPrevPage,\n hasNextPage,\n prev: handlePrev,\n next: handleNext,\n goTo: handleGoTo,\n refresh,\n pages,\n activePageIndex,\n snapPointIndexes,\n scrollRef: setScrollEl\n };\n};\nvar getOffsetRect = (el, relativeTo) => {\n const rect = _getOffsetRect(el);\n if (!relativeTo) {\n return rect;\n }\n const relativeRect = _getOffsetRect(relativeTo);\n return {\n left: rect.left - relativeRect.left,\n top: rect.top - relativeRect.top,\n right: rect.right - relativeRect.left,\n bottom: rect.bottom - relativeRect.top,\n width: rect.width,\n height: rect.height\n };\n};\nvar _getOffsetRect = (el) => {\n const rect = el.getBoundingClientRect();\n let scrollLeft = 0;\n let scrollTop = 0;\n let parentEl = el.parentElement;\n while (parentEl) {\n scrollLeft += parentEl.scrollLeft;\n scrollTop += parentEl.scrollTop;\n parentEl = parentEl.parentElement;\n }\n const left = rect.left + scrollLeft;\n const top = rect.top + scrollTop;\n return {\n left,\n top,\n right: left + rect.width,\n bottom: top + rect.height,\n width: rect.width,\n height: rect.height\n };\n};\nvar getScrollPaddingUsedValue = (el, pos) => {\n const style = window.getComputedStyle(el);\n const scrollPadding = style.getPropertyValue(`scroll-padding-${pos}`) || \"0px\";\n if (scrollPadding === \"auto\") {\n return 0;\n }\n const invalidMsg = `Unsupported scroll padding value, expected <length> or <percentage> value, received ${scrollPadding}`;\n if (scrollPadding.endsWith(\"px\")) {\n const value = parseInt(scrollPadding);\n assert(!Number.isNaN(value), invalidMsg);\n return value;\n }\n if (scrollPadding.endsWith(\"%\")) {\n const value = parseInt(scrollPadding);\n assert(!Number.isNaN(value), invalidMsg);\n return el.clientWidth / 100 * value;\n }\n throw new RSCError(invalidMsg);\n};\nvar getScrollMarginUsedValue = (el, pos) => {\n const style = window.getComputedStyle(el);\n const scrollMargin = style.getPropertyValue(`scroll-margin-${pos}`) || \"0px\";\n const invalidMsg = `Unsupported scroll margin value, expected <length> value, received ${scrollMargin}`;\n assert(scrollMargin.endsWith(\"px\"), invalidMsg);\n const value = parseInt(scrollMargin);\n assert(!Number.isNaN(value), invalidMsg);\n return value;\n};\nvar getEffectiveScrollSpacing = (scrollEl, itemEl, pos) => {\n const scrollPadding = getScrollPaddingUsedValue(scrollEl, pos);\n const scrollMargin = getScrollMarginUsedValue(itemEl, pos);\n const rect = getOffsetRect(itemEl, itemEl.parentElement);\n return Math.min(scrollPadding + scrollMargin, rect[pos]);\n};\nfunction assert(value, message) {\n if (value) {\n return;\n }\n throw new RSCError(message);\n}\nvar RSCError = class extends Error {\n constructor(message) {\n super(`[react-snap-carousel]: ${message}`);\n }\n};\nexport {\n useSnapCarousel\n};\n","import { isMobile } from './helpers'\nimport { useState } from 'react'\n\ntype UseCarouselDragArgs = {\n goPrevious: () => void\n goNext: () => void\n}\n\nexport function useCarouselDrag({ goPrevious, goNext }: UseCarouselDragArgs) {\n const [isPressing, setIsPressing] = useState(false)\n const [dragStartPosition, setDragStartPosition] = useState(0)\n\n function handleStartDrag(e: React.MouseEvent<HTMLUListElement, MouseEvent>) {\n if (isMobile()) return\n setIsPressing(true)\n document.addEventListener('mouseup', handleRelease)\n setDragStartPosition(e.clientX)\n }\n\n function handleRelease() {\n document.removeEventListener('mouseup', handleRelease)\n setIsPressing(false)\n setDragStartPosition(0)\n }\n\n function handleMouseMove(e: React.MouseEvent<HTMLUListElement, MouseEvent>) {\n if (isMobile() || (!isMobile() && !isPressing)) return\n\n const currentX = e.clientX\n if (currentX > dragStartPosition) {\n goPrevious()\n } else if (currentX < dragStartPosition) {\n goNext()\n }\n }\n\n return {\n handleMouseMove,\n handleStartDrag,\n }\n}\n","import { useEffect, useRef, useState } from 'react'\nimport { useSnapCarousel } from 'react-snap-carousel'\nimport { useCarouselDrag } from './useCarouselDrag'\n\ntype UseCarouselArgs = {\n items: unknown[]\n}\n\nexport default function useCarousel({ items }: UseCarouselArgs) {\n const {\n scrollRef,\n pages,\n activePageIndex,\n hasPrevPage,\n hasNextPage,\n prev,\n next,\n snapPointIndexes,\n refresh,\n } = useSnapCarousel({ axis: 'x' })\n const showControls = snapPointIndexes.size > 1\n const [numberOfItems, setNumberOfItems] = useState(items.length)\n const [nextPage, setNextPage] = useState(0)\n const railRef = useRef<HTMLElement | null>(null)\n const rootRef = useRef<HTMLDivElement | null>(null)\n const { handleMouseMove, handleStartDrag } = useCarouselDrag({\n goNext,\n goPrevious,\n })\n\n useEffect(() => {\n if (items.length !== numberOfItems) {\n refresh()\n setNumberOfItems(items.length)\n }\n }, [items])\n\n function setRef(el: HTMLElement | null) {\n scrollRef(el)\n railRef.current = el\n }\n\n function goNext() {\n const nextIndex = activePageIndex + 1\n setNextPage(nextIndex)\n next()\n }\n\n function goPrevious() {\n setNextPage(activePageIndex === 0 ? activePageIndex : activePageIndex - 1)\n prev()\n }\n\n return {\n rootRef,\n setRef,\n nextPage,\n pages,\n railRef,\n hasPrevPage,\n hasNextPage,\n goPrevious,\n next,\n goNext,\n snapPointIndexes,\n activePageIndex,\n handleMouseMove,\n handleStartDrag,\n showControls,\n }\n}\n","/**\n * Carousel Component\n * \n * @requires react-snap-carousel\n * This component requires the 'react-snap-carousel' package to be installed.\n * Install it using: npm install react-snap-carousel\n */\n\nimport classNames from 'classnames'\nimport { Scrollbar } from './Scrollbar'\nimport { Pagination } from './Pagination'\nimport useCarousel from './useCarousel'\nimport { CarouselProps } from './types'\n\nimport { Button } from '@components/Button'\nimport { Conditional } from '@components/misc'\nimport { IconChevronLeft, IconChevronRight } from '@components/icons'\n\nimport './styles.scss'\n\nexport const Carousel = ({\n items,\n type,\n mobileText = '',\n draggable = true,\n}: CarouselProps) => {\n const {\n rootRef,\n setRef,\n snapPointIndexes,\n activePageIndex,\n pages,\n hasPrevPage,\n goPrevious,\n hasNextPage,\n goNext,\n handleStartDrag,\n handleMouseMove,\n showControls,\n } = useCarousel({\n items,\n })\n\n const cl = classNames('au-carousel', { 'au-carousel--draggable': draggable })\n return (\n <div className={cl} ref={rootRef}>\n <ul\n className=\"au-carousel__rail\"\n ref={setRef}\n onMouseDown={draggable ? handleStartDrag : undefined}\n onMouseMove={draggable ? handleMouseMove : undefined}>\n {items.map((item, i) => {\n const key = `au-${item.key || i}`\n return (\n <li\n className={classNames('au-carousel__item', {\n 'au-carousel__item--snap': snapPointIndexes.has(i),\n })}\n data-key={key}\n key={key}>\n {item}\n </li>\n )\n })}\n </ul>\n\n <Conditional\n condition={showControls}\n renderIf={\n <div className=\"au-carousel__actions\">\n {type === 'scrollbar' && (\n <Scrollbar pageToEnterIndex={activePageIndex} pages={pages} />\n )}\n\n {type === 'pages' && (\n <Pagination\n pageToEnterIndex={activePageIndex}\n pages={pages}\n mobileText={mobileText}\n />\n )}\n\n <div\n className={classNames('au-carousel__btns', {\n 'au-carousel__btns--pages': type === 'pages',\n })}>\n <Button\n round\n type=\"outlined\"\n disabled={!hasPrevPage}\n onClick={goPrevious}>\n <IconChevronLeft />\n </Button>\n <Button\n round\n type=\"outlined\"\n disabled={!hasNextPage}\n onClick={goNext}>\n <IconChevronRight />\n </Button>\n </div>\n </div>\n }\n />\n </div>\n )\n}\n"],"names":["useEffect2"],"mappings":";;;;;;;;;AAOO,MAAM,YAAY,CAAC,EAAE,kBAAkB,YAA4B;AAClE,QAAA,cAAc,OAAuB,IAAI;AACzC,QAAA,YAAY,OAAuB,IAAI;AAE7C,YAAU,MAAM;AACd,QAAI,CAAC,YAAY,WAAW,CAAC,UAAU,QAAS;AAC1C,UAAA,YAAY,YAAY,QAAQ;AAChC,UAAA,UAAU,UAAU,QAAQ;AAClC,UAAM,uBAAuB,YAAY;AAEnC,UAAA,qBAAqB,mBAAmB,KAAK,MAAM;AACzD,UAAM,iBAAiB,oBAAoB;AAErC,UAAA,eAAe,qBAAqB,IAAI,IAAI;AAClD,cAAU,QAAQ,MAAM,YAAY,cAAc,YAAY;AAAA,EAAA,GAC7D,CAAC,OAAO,gBAAgB,CAAC;AAE5B,SACG,oBAAA,OAAA,EAAI,WAAU,0BAAyB,KAAK,aAC3C,UAAC,oBAAA,OAAA,EAAI,WAAU,iCAAgC,KAAK,UAAA,CAAW,EACjE,CAAA;AAEJ;AC3BA,MAAM,WAAW,MACf,CAAC,EACC,OAAO,WAAW,eAClB,OAAO,YACP,OAAO,SAAS;AAGb,SAAS,WAAW;AACrB,MAAA,CAAC,WAAY;AACjB,SAAO,CAAC,CAAC,OAAO,WAAW,8BAA8B,EAAE;AAC7D;ACFO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AAEnB,SAAA,oBAAC,SAAI,WAAU,2BACb,+BAAC,MAAK,EAAA,OAAM,aAAY,QAAO,WAC7B,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAA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AAAA,IACH;AAAA,IAEA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,QACX,UACE,qBAAC,OAAI,EAAA,WAAU,wBACZ,UAAA;AAAA,UAAA,SAAS,eACR,oBAAC,WAAU,EAAA,kBAAkB,iBAAiB,OAAc;AAAA,UAG7D,SAAS,WACR;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,kBAAkB;AAAA,cAClB;AAAA,cACA;AAAA,YAAA;AAAA,UACF;AAAA,UAGF;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,WAAW,qBAAqB;AAAA,gBACzC,4BAA4B,SAAS;AAAA,cAAA,CACtC;AAAA,cACD,UAAA;AAAA,gBAAA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,OAAK;AAAA,oBACL,MAAK;AAAA,oBACL,UAAU,CAAC;AAAA,oBACX,SAAS;AAAA,oBACT,8BAAC,iBAAgB,EAAA;AAAA,kBAAA;AAAA,gBACnB;AAAA,gBACA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,OAAK;AAAA,oBACL,MAAK;AAAA,oBACL,UAAU,CAAC;AAAA,oBACX,SAAS;AAAA,oBACT,8BAAC,kBAAiB,EAAA;AAAA,kBAAA;AAAA,gBACpB;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF,EAAA,CAAA;AAEJ;","x_google_ignoreList":[3]}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Prototype/Carousel/Scrollbar.tsx","../../../lib/components/Prototype/Carousel/helpers.ts","../../../lib/components/Prototype/Carousel/Pagination.tsx","../../../node_modules/react-snap-carousel/dist/use-snap-carousel.mjs","../../../lib/components/Prototype/Carousel/useCarouselDrag.ts","../../../lib/components/Prototype/Carousel/useCarousel.ts","../../../lib/components/Prototype/Carousel/index.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\ntype ScrollbarProps = {\n pages: number[][];\n pageToEnterIndex: number;\n};\n\nexport const Scrollbar = ({ pageToEnterIndex, pages }: ScrollbarProps) => {\n const scrollTrail = useRef<HTMLDivElement>(null);\n const scrollbar = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!scrollTrail.current || !scrollbar.current) return;\n const trailSize = scrollTrail.current.offsetWidth;\n const barSize = scrollbar.current.offsetWidth;\n const availableScrollSpace = trailSize - barSize;\n\n const currentPercentage = (pageToEnterIndex + 1) / pages.length;\n const scrollDistance = currentPercentage * availableScrollSpace;\n\n const barTranslate = pageToEnterIndex === 0 ? 0 : scrollDistance;\n scrollbar.current.style.transform = `translateX(${barTranslate}px)`;\n }, [pages, pageToEnterIndex]);\n\n return (\n <div className=\"au-carousel__scrollbar\" ref={scrollTrail}>\n <div className=\"au-carousel__scrollbar-scroll\" ref={scrollbar}></div>\n </div>\n );\n};\n","//TODO remove\n\nconst isClient = () =>\n !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n )\n\nexport function isMobile() {\n if (!isClient()) return\n return !!window.matchMedia('screen and (max-width:767px)').matches\n}\n","import { Conditional } from '@components/misc'\nimport { isMobile } from './helpers'\nimport { Text } from '@components/Text'\n\ntype PaginationProps = {\n pages: number[][]\n pageToEnterIndex: number\n mobileText: string\n}\n\nexport const Pagination = ({\n pageToEnterIndex,\n pages,\n mobileText,\n}: PaginationProps) => {\n return (\n <div className=\"au-carousel__pagination\">\n <Text color=\"secondary\" weight=\"regular\">\n <Conditional\n condition={!isMobile()}\n renderIf={'Página'}\n renderElse={mobileText}\n />{' '}\n <b>\n {pageToEnterIndex + 1} de {pages.length}\n </b>\n </Text>\n </div>\n )\n}\n","// src/use-snap-carousel.tsx\nimport { useState, useCallback, useEffect as useEffect2, useMemo } from \"react\";\n\n// src/use-isomorphic-layout-effect.tsx\nimport { useEffect, useLayoutEffect } from \"react\";\nvar useIsomorphicLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/use-snap-carousel.tsx\nvar useSnapCarousel = ({\n axis = \"x\",\n initialPages = []\n} = {}) => {\n const dimension = axis === \"x\" ? \"width\" : \"height\";\n const scrollDimension = axis === \"x\" ? \"scrollWidth\" : \"scrollHeight\";\n const clientDimension = axis === \"x\" ? \"clientWidth\" : \"clientHeight\";\n const nearSidePos = axis === \"x\" ? \"left\" : \"top\";\n const farSidePos = axis === \"x\" ? \"right\" : \"bottom\";\n const scrollPos = axis === \"x\" ? \"scrollLeft\" : \"scrollTop\";\n const [scrollEl, setScrollEl] = useState(null);\n const [{ pages, activePageIndex }, setCarouselState] = useState({\n pages: initialPages,\n activePageIndex: 0\n });\n const refreshActivePage = useCallback(\n (pages2) => {\n if (!scrollEl) {\n return;\n }\n const hasScrolledToEnd = Math.floor(scrollEl[scrollDimension] - scrollEl[scrollPos]) <= scrollEl[clientDimension];\n if (hasScrolledToEnd) {\n setCarouselState({ pages: pages2, activePageIndex: pages2.length - 1 });\n return;\n }\n const items = Array.from(scrollEl.children);\n const scrollPort = scrollEl.getBoundingClientRect();\n const offsets = pages2.map((page) => {\n const leadIndex = page[0];\n const leadEl = items[leadIndex];\n assert(leadEl instanceof HTMLElement, \"Expected HTMLElement\");\n const scrollSpacing = getEffectiveScrollSpacing(\n scrollEl,\n leadEl,\n nearSidePos\n );\n const rect = leadEl.getBoundingClientRect();\n const offset = rect[nearSidePos] - scrollPort[nearSidePos] - scrollSpacing;\n return Math.abs(offset);\n });\n const minOffset = Math.min(...offsets);\n const nextActivePageIndex = offsets.indexOf(minOffset);\n setCarouselState({ pages: pages2, activePageIndex: nextActivePageIndex });\n },\n [scrollEl, clientDimension, nearSidePos, scrollDimension, scrollPos]\n );\n const refresh = useCallback(() => {\n if (!scrollEl) {\n return;\n }\n const items = Array.from(scrollEl.children);\n const scrollPort = scrollEl.getBoundingClientRect();\n let currPageStartPos;\n const pages2 = items.reduce((acc, item, i) => {\n assert(item instanceof HTMLElement, \"Expected HTMLElement\");\n const currPage = acc[acc.length - 1];\n const rect = getOffsetRect(item, item.parentElement);\n if (!currPage || item.dataset.shouldSnap === \"true\" || rect[farSidePos] - currPageStartPos > Math.ceil(scrollPort[dimension])) {\n acc.push([i]);\n const scrollSpacing = getEffectiveScrollSpacing(\n scrollEl,\n item,\n nearSidePos\n );\n currPageStartPos = rect[nearSidePos] - scrollSpacing;\n } else {\n currPage.push(i);\n }\n return acc;\n }, []);\n refreshActivePage(pages2);\n }, [refreshActivePage, scrollEl, dimension, farSidePos, nearSidePos]);\n useIsomorphicLayoutEffect(() => {\n refresh();\n }, [refresh]);\n useEffect2(() => {\n const handle = () => {\n refresh();\n };\n window.addEventListener(\"resize\", handle);\n window.addEventListener(\"orientationchange\", handle);\n return () => {\n window.removeEventListener(\"resize\", handle);\n window.removeEventListener(\"orientationchange\", handle);\n };\n }, [refresh]);\n useEffect2(() => {\n if (!scrollEl) {\n return;\n }\n const handle = () => {\n refreshActivePage(pages);\n };\n scrollEl.addEventListener(\"scroll\", handle);\n return () => {\n scrollEl.removeEventListener(\"scroll\", handle);\n };\n }, [refreshActivePage, pages, scrollEl]);\n const handleGoTo = (index, opts) => {\n if (!scrollEl) {\n return;\n }\n const page = pages[index];\n if (!page) {\n return;\n }\n const items = Array.from(scrollEl.children);\n const leadIndex = page[0];\n const leadEl = items[leadIndex];\n if (!(leadEl instanceof HTMLElement)) {\n return;\n }\n const scrollSpacing = getEffectiveScrollSpacing(\n scrollEl,\n leadEl,\n nearSidePos\n );\n const behavior = (opts == null ? void 0 : opts.behavior) || \"smooth\";\n scrollEl.scrollTo({\n behavior,\n [nearSidePos]: getOffsetRect(leadEl, leadEl.parentElement)[nearSidePos] - scrollSpacing\n });\n };\n const handlePrev = (opts) => {\n handleGoTo(activePageIndex - 1, opts);\n };\n const handleNext = (opts) => {\n handleGoTo(activePageIndex + 1, opts);\n };\n const snapPointIndexes = useMemo(\n () => new Set(pages.map((page) => page[0])),\n [pages]\n );\n const hasPrevPage = activePageIndex > 0;\n const hasNextPage = activePageIndex < pages.length - 1;\n return {\n hasPrevPage,\n hasNextPage,\n prev: handlePrev,\n next: handleNext,\n goTo: handleGoTo,\n refresh,\n pages,\n activePageIndex,\n snapPointIndexes,\n scrollRef: setScrollEl\n };\n};\nvar getOffsetRect = (el, relativeTo) => {\n const rect = _getOffsetRect(el);\n if (!relativeTo) {\n return rect;\n }\n const relativeRect = _getOffsetRect(relativeTo);\n return {\n left: rect.left - relativeRect.left,\n top: rect.top - relativeRect.top,\n right: rect.right - relativeRect.left,\n bottom: rect.bottom - relativeRect.top,\n width: rect.width,\n height: rect.height\n };\n};\nvar _getOffsetRect = (el) => {\n const rect = el.getBoundingClientRect();\n let scrollLeft = 0;\n let scrollTop = 0;\n let parentEl = el.parentElement;\n while (parentEl) {\n scrollLeft += parentEl.scrollLeft;\n scrollTop += parentEl.scrollTop;\n parentEl = parentEl.parentElement;\n }\n const left = rect.left + scrollLeft;\n const top = rect.top + scrollTop;\n return {\n left,\n top,\n right: left + rect.width,\n bottom: top + rect.height,\n width: rect.width,\n height: rect.height\n };\n};\nvar getScrollPaddingUsedValue = (el, pos) => {\n const style = window.getComputedStyle(el);\n const scrollPadding = style.getPropertyValue(`scroll-padding-${pos}`) || \"0px\";\n if (scrollPadding === \"auto\") {\n return 0;\n }\n const invalidMsg = `Unsupported scroll padding value, expected <length> or <percentage> value, received ${scrollPadding}`;\n if (scrollPadding.endsWith(\"px\")) {\n const value = parseInt(scrollPadding);\n assert(!Number.isNaN(value), invalidMsg);\n return value;\n }\n if (scrollPadding.endsWith(\"%\")) {\n const value = parseInt(scrollPadding);\n assert(!Number.isNaN(value), invalidMsg);\n return el.clientWidth / 100 * value;\n }\n throw new RSCError(invalidMsg);\n};\nvar getScrollMarginUsedValue = (el, pos) => {\n const style = window.getComputedStyle(el);\n const scrollMargin = style.getPropertyValue(`scroll-margin-${pos}`) || \"0px\";\n const invalidMsg = `Unsupported scroll margin value, expected <length> value, received ${scrollMargin}`;\n assert(scrollMargin.endsWith(\"px\"), invalidMsg);\n const value = parseInt(scrollMargin);\n assert(!Number.isNaN(value), invalidMsg);\n return value;\n};\nvar getEffectiveScrollSpacing = (scrollEl, itemEl, pos) => {\n const scrollPadding = getScrollPaddingUsedValue(scrollEl, pos);\n const scrollMargin = getScrollMarginUsedValue(itemEl, pos);\n const rect = getOffsetRect(itemEl, itemEl.parentElement);\n return Math.min(scrollPadding + scrollMargin, rect[pos]);\n};\nfunction assert(value, message) {\n if (value) {\n return;\n }\n throw new RSCError(message);\n}\nvar RSCError = class extends Error {\n constructor(message) {\n super(`[react-snap-carousel]: ${message}`);\n }\n};\nexport {\n useSnapCarousel\n};\n","import { isMobile } from './helpers'\nimport { useState } from 'react'\n\ntype UseCarouselDragArgs = {\n goPrevious: () => void\n goNext: () => void\n}\n\nexport function useCarouselDrag({ goPrevious, goNext }: UseCarouselDragArgs) {\n const [isPressing, setIsPressing] = useState(false)\n const [dragStartPosition, setDragStartPosition] = useState(0)\n\n function handleStartDrag(e: React.MouseEvent<HTMLUListElement, MouseEvent>) {\n if (isMobile()) return\n setIsPressing(true)\n document.addEventListener('mouseup', handleRelease)\n setDragStartPosition(e.clientX)\n }\n\n function handleRelease() {\n document.removeEventListener('mouseup', handleRelease)\n setIsPressing(false)\n setDragStartPosition(0)\n }\n\n function handleMouseMove(e: React.MouseEvent<HTMLUListElement, MouseEvent>) {\n if (isMobile() || (!isMobile() && !isPressing)) return\n\n const currentX = e.clientX\n if (currentX > dragStartPosition) {\n goPrevious()\n } else if (currentX < dragStartPosition) {\n goNext()\n }\n }\n\n return {\n handleMouseMove,\n handleStartDrag,\n }\n}\n","import { useEffect, useRef, useState } from 'react'\nimport { SnapCarouselResult, useSnapCarousel } from 'react-snap-carousel'\nimport { useCarouselDrag } from './useCarouselDrag'\n\ntype UseCarouselArgs = {\n items: unknown[]\n}\n\nexport default function useCarousel({ items }: UseCarouselArgs) {\n const {\n scrollRef,\n pages,\n activePageIndex,\n hasPrevPage,\n hasNextPage,\n prev,\n next,\n snapPointIndexes,\n refresh,\n }: SnapCarouselResult = useSnapCarousel({ axis: 'x' })\n const showControls = snapPointIndexes.size > 1\n const [numberOfItems, setNumberOfItems] = useState(items.length)\n const [nextPage, setNextPage] = useState(0)\n const railRef = useRef<HTMLElement | null>(null)\n const rootRef = useRef<HTMLDivElement | null>(null)\n const { handleMouseMove, handleStartDrag } = useCarouselDrag({\n goNext,\n goPrevious,\n })\n\n useEffect(() => {\n if (items.length !== numberOfItems) {\n refresh()\n setNumberOfItems(items.length)\n }\n }, [items])\n\n function setRef(el: HTMLElement | null) {\n scrollRef(el)\n railRef.current = el\n }\n\n function goNext() {\n const nextIndex = activePageIndex + 1\n setNextPage(nextIndex)\n next()\n }\n\n function goPrevious() {\n setNextPage(activePageIndex === 0 ? activePageIndex : activePageIndex - 1)\n prev()\n }\n\n return {\n rootRef,\n setRef,\n nextPage,\n pages,\n railRef,\n hasPrevPage,\n hasNextPage,\n goPrevious,\n next,\n goNext,\n snapPointIndexes,\n activePageIndex,\n handleMouseMove,\n handleStartDrag,\n showControls,\n }\n}\n","/**\n * Carousel Component\n * \n * @requires react-snap-carousel\n * This component requires the 'react-snap-carousel' package to be installed.\n * Install it using: npm install react-snap-carousel\n */\n\nimport classNames from 'classnames'\nimport { Scrollbar } from './Scrollbar'\nimport { Pagination } from './Pagination'\nimport useCarousel from './useCarousel'\nimport { CarouselProps } from './types'\n\nimport { Button } from '@components/Button'\nimport { Conditional } from '@components/misc'\nimport { IconChevronLeft, IconChevronRight } from '@components/icons'\n\nimport './styles.scss'\n\nexport const Carousel = ({\n items,\n type,\n mobileText = '',\n draggable = true,\n}: CarouselProps) => {\n const {\n rootRef,\n setRef,\n snapPointIndexes,\n activePageIndex,\n pages,\n hasPrevPage,\n goPrevious,\n hasNextPage,\n goNext,\n handleStartDrag,\n handleMouseMove,\n showControls,\n } = useCarousel({\n items,\n })\n\n const cl = classNames('au-carousel', { 'au-carousel--draggable': draggable })\n return (\n <div className={cl} ref={rootRef}>\n <ul\n className=\"au-carousel__rail\"\n ref={setRef}\n onMouseDown={draggable ? handleStartDrag : undefined}\n onMouseMove={draggable ? handleMouseMove : undefined}>\n {items.map((item, i) => {\n const key = `au-${item.key || i}`\n return (\n <li\n className={classNames('au-carousel__item', {\n 'au-carousel__item--snap': snapPointIndexes.has(i),\n })}\n data-key={key}\n key={key}>\n {item}\n </li>\n )\n })}\n </ul>\n\n <Conditional\n condition={showControls}\n renderIf={\n <div className=\"au-carousel__actions\">\n {type === 'scrollbar' && (\n <Scrollbar pageToEnterIndex={activePageIndex} pages={pages} />\n )}\n\n {type === 'pages' && (\n <Pagination\n pageToEnterIndex={activePageIndex}\n pages={pages}\n mobileText={mobileText}\n />\n )}\n\n <div\n className={classNames('au-carousel__btns', {\n 'au-carousel__btns--pages': type === 'pages',\n })}>\n <Button\n round\n type=\"outlined\"\n disabled={!hasPrevPage}\n onClick={goPrevious}>\n <IconChevronLeft />\n </Button>\n <Button\n round\n type=\"outlined\"\n disabled={!hasNextPage}\n onClick={goNext}>\n <IconChevronRight />\n </Button>\n </div>\n </div>\n }\n />\n </div>\n )\n}\n"],"names":["useEffect2"],"mappings":";;;;;;;;;AAOO,MAAM,YAAY,CAAC,EAAE,kBAAkB,YAA4B;AAClE,QAAA,cAAc,OAAuB,IAAI;AACzC,QAAA,YAAY,OAAuB,IAAI;AAE7C,YAAU,MAAM;AACd,QAAI,CAAC,YAAY,WAAW,CAAC,UAAU,QAAS;AAC1C,UAAA,YAAY,YAAY,QAAQ;AAChC,UAAA,UAAU,UAAU,QAAQ;AAClC,UAAM,uBAAuB,YAAY;AAEnC,UAAA,qBAAqB,mBAAmB,KAAK,MAAM;AACzD,UAAM,iBAAiB,oBAAoB;AAErC,UAAA,eAAe,qBAAqB,IAAI,IAAI;AAClD,cAAU,QAAQ,MAAM,YAAY,cAAc,YAAY;AAAA,EAAA,GAC7D,CAAC,OAAO,gBAAgB,CAAC;AAE5B,SACG,oBAAA,OAAA,EAAI,WAAU,0BAAyB,KAAK,aAC3C,UAAC,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,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF,EAAA,CAAA;AAEJ;","x_google_ignoreList":[3]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Footer/data.tsx","../../../lib/components/Footer/index.tsx"],"sourcesContent":["import {\n IconInstagram,\n IconFacebook,\n IconYoutube,\n IconLinkedin,\n IconTiktok,\n} from '../icons'\n\nexport const certificatesMap = {\n fintech2022: {\n logo: 'https://assets.acordocerto.com.br/f/114280/47x62/6ffd0990ed/fintech-2022.png',\n name: 'Melhores Fintechs 2022',\n },\n fintech2023: {\n logo: 'https://assets.acordocerto.com.br/f/114280/84x73/b48cc08aa5/fintech-2023.png',\n name: 'Melhores Fintechs 2023',\n },\n pcidss: {\n logo: 'https://assets.acordocerto.com.br/f/114280/85x36/8be091fa1c/pci-dss.png',\n name: 'PCI DSS Compliant',\n },\n quintessa: {\n logo: 'https://assets.acordocerto.com.br/f/114280/122x40/16f41476c0/quintessa.png',\n name: 'Quintessa',\n },\n ra1000: {\n logo: 'https://assets.acordocerto.com.br/f/114280/100x58/ad8bed26c8/ra1000.png',\n name: 'RA 1000',\n },\n reclameaqui: {\n logo: 'https://assets.acordocerto.com.br/f/114280/60x60/b85fcf03dd/reclame-aqui.png',\n name: 'Ótimo Reclame Aqui',\n },\n scaleup: {\n logo: 'https://assets.acordocerto.com.br/f/114280/104x50/07c8b89dbe/scale-up.png',\n name: 'Scale Up',\n },\n sslblindado: {\n logo: 'https://assets.acordocerto.com.br/f/114280/75x54/60734a2cc4/ssl-blindado.png',\n name: 'SSL Blindado',\n },\n}\nexport const socialsMap = {\n instagram: {\n name: 'Instagram',\n icon: <IconInstagram />,\n },\n facebook: {\n name: 'Facebook',\n icon: <IconFacebook />,\n },\n youtube: {\n name: 'Youtube',\n icon: <IconYoutube />,\n },\n linkedin: {\n name: 'Linkedin',\n icon: <IconLinkedin />,\n },\n tiktok: {\n name: 'TikTok',\n icon: <IconTiktok />,\n },\n}\n\nexport const storesMap = {\n googleplay: {\n name: 'Google Play',\n icon: 'https://assets.acordocerto.com.br/f/114280/117x36/e0e7eda65d/google-play.png',\n },\n appstore: {\n name: 'App Store',\n icon: 'https://assets.acordocerto.com.br/f/114280/117x36/38b0d1ecc9/app-store.png',\n },\n}\n","import classNames from 'classnames'\nimport { Text } from '../Text'\nimport { FooterProps } from './types'\nimport { certificatesMap, socialsMap, storesMap } from './data'\nimport { Conditional } from '../misc'\nimport { LazyImage } from '../LazyImage'\nimport { isMobile } from '@core/utils/isMobile'\nimport './styles.scss'\n\nexport const Footer = ({\n logo,\n categoryLinks,\n socialLinks,\n cnpj,\n address,\n companyOverview,\n certificates,\n copyrights,\n stores = {},\n}: FooterProps) => {\n const usedCertificates = certificates.map(\n (certificate) => certificatesMap[certificate],\n )\n\n const usedSocials = Object.keys(socialLinks).map((social) => {\n return {\n ...socialsMap[social as keyof typeof socialsMap],\n url: socialLinks[social as keyof typeof socialLinks],\n }\n })\n\n const usedStores = Object.keys(stores).map((store) => {\n return {\n ...storesMap[store as keyof typeof storesMap],\n url: stores[store as keyof typeof stores],\n }\n })\n\n const handleClick = (url: string) => {\n window.open(url, '_blank')\n }\n\n const showCertificatesBorder = usedCertificates.length > 3 && !!isMobile()\n \n if (categoryLinks) {\n return (\n <footer role=\"contentinfo\" className=\"au-footer-full\">\n <div className=\"au-footer-full__container\">\n <div className=\"au-footer-full__logo\">{logo}</div>\n <div className=\"au-footer-full__links\">\n {categoryLinks.map(({ categoryTitle, links }, index) => {\n return (\n <div key={index} className=\"au-footer-full__links-category\">\n <Text as=\"h2\" variant=\"heading-micro\" weight=\"bold\">\n {categoryTitle}\n </Text>\n {links.map(({ title, url }, index) => {\n return (\n <div\n className={classNames('au-footer-full__links', {\n 'au-footer-full__links--is-clickable': !!url,\n })}\n key={index}\n onClick={() => url && handleClick(url)}>\n <Text\n as=\"a\"\n variant=\"body-medium\"\n weight=\"regular\"\n color=\"secondary\">\n {title}\n </Text>\n </div>\n )\n })}\n </div>\n )\n })}\n <div className=\"au-footer-full__company-info\">\n <Text as=\"h2\" variant=\"heading-micro\" weight=\"bold\">\n Siga a gente\n </Text>\n <div className=\"au-footer-full__links-socials\">\n {usedSocials.map(({ icon, url }, index) => {\n return (\n <div\n className={classNames('au-footer-full__links', {\n 'au-footer-full__links--is-clickable': !!url,\n })}\n key={index}\n onClick={() => url && handleClick(url)}>\n {icon}\n </div>\n )\n })}\n </div>\n <Text\n as=\"div\"\n variant=\"body-medium\"\n weight=\"regular\"\n color=\"secondary\">\n <Text\n as=\"strong\"\n weight=\"bold\"\n color=\"secondary\">\n CNPJ:\n </Text> {cnpj}\n </Text>\n <Text\n as=\"div\"\n variant=\"body-medium\"\n weight=\"regular\"\n color=\"secondary\">\n <Text\n as=\"h2\"\n variant=\"body-medium\"\n weight=\"bold\"\n color=\"secondary\">\n Localização:\n </Text>\n {address}\n </Text>\n </div>\n </div>\n <Conditional\n condition={!!usedStores.length && Boolean(isMobile())}\n renderIf={\n <div className=\"au-footer-full__stores\">\n <Text\n className=\"au-footer-full__stores-title\"\n as=\"h2\"\n variant=\"heading-micro\"\n weight=\"bold\">\n Baixe nosso app\n </Text>\n {usedStores.map(({ icon, url, name }, index) => {\n return (\n <LazyImage\n className={classNames('au-footer-full__stores-logo', {\n 'au-footer-full__stores-logo--is-clickable': !!url,\n })}\n key={index}\n src={icon}\n alt={name}\n onClick={() => url && handleClick(url)}\n />\n )\n })}\n </div>\n }\n />\n {companyOverview && (\n <div className=\"au-footer-full__company-overview\">\n <Text color=\"secondary\">{companyOverview}</Text>\n </div>\n )}\n <div className=\"au-footer-full__bottom\">\n <div className={classNames(\"au-footer-full__bottom-certificates\", {\n 'au-footer-full__bottom-certificates--with-border': showCertificatesBorder,\n })}>\n {usedCertificates.map(({ logo, name }, index) => {\n return <LazyImage key={index} src={logo} alt={name} />\n })}\n </div>\n <div className=\"au-footer-full__bottom-side\">\n <Conditional\n condition={!!usedStores.length && !isMobile()}\n renderIf={\n <div className=\"au-footer-full__stores\">\n <Text\n className=\"au-footer-full__stores-title\"\n as=\"h2\"\n variant=\"heading-micro\"\n weight=\"bold\">\n Baixe nosso app\n </Text>\n {usedStores.map(({ icon, url, name }, index) => {\n return (\n <LazyImage\n className={classNames('au-footer-full__stores-logo', {\n 'au-footer-full__stores-logo--is-clickable': !!url,\n })}\n key={index}\n src={icon}\n alt={name}\n onClick={() => url && handleClick(url)}\n />\n )\n })}\n </div>\n }\n />\n <Text\n as=\"h2\"\n variant=\"body-medium\"\n weight=\"regular\"\n color=\"secondary\"\n className=\"au-footer-full__copyrights\"\n dangerouslySetInnerHTML={copyrights}\n />\n </div>\n </div>\n </div>\n </footer>\n )\n }\n\n return (\n <footer role=\"contentinfo\" className=\"au-footer\">\n <div className=\"au-footer__container\">\n <div className=\"au-footer__content\">\n <div className=\"au-footer__content-logos\">\n {logo}\n <div className=\"au-footer__content-divider\" />\n <div className=\"au-footer__content-certificates\">\n {usedCertificates.map(({ logo, name }, index) => {\n return <LazyImage key={index} src={logo} alt={name} />\n })}\n </div>\n </div>\n <div className=\"au-footer__content-copyrights\">\n <Text\n as=\"h2\"\n variant=\"body-medium\"\n weight=\"regular\"\n color=\"secondary\">\n {copyrights}\n </Text>\n </div>\n </div>\n </div>\n </footer>\n )\n}\n"],"names":["index","logo"],"mappings":";;;;;;;;;;;;AAQO,MAAM,kBAAkB;AAAA,EAC7B,aAAa;AAAA,IACX,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,aAAa;AA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,GAEL;AAAA,EAAA,GACF,GACF,EACF,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Footer/data.tsx","../../../lib/components/Footer/index.tsx"],"sourcesContent":["import {\n IconInstagram,\n IconFacebook,\n IconYoutube,\n IconLinkedin,\n IconTiktok,\n} from '../icons'\n\nexport const certificatesMap = {\n fintech2022: {\n logo: 'https://assets.acordocerto.com.br/f/114280/47x62/6ffd0990ed/fintech-2022.png',\n name: 'Melhores Fintechs 2022',\n },\n fintech2023: {\n logo: 'https://assets.acordocerto.com.br/f/114280/84x73/b48cc08aa5/fintech-2023.png',\n name: 'Melhores Fintechs 2023',\n },\n pcidss: {\n logo: 'https://assets.acordocerto.com.br/f/114280/85x36/8be091fa1c/pci-dss.png',\n name: 'PCI DSS Compliant',\n },\n quintessa: {\n logo: 'https://assets.acordocerto.com.br/f/114280/122x40/16f41476c0/quintessa.png',\n name: 'Quintessa',\n },\n ra1000: {\n logo: 'https://assets.acordocerto.com.br/f/114280/100x58/ad8bed26c8/ra1000.png',\n name: 'RA 1000',\n },\n reclameaqui: {\n logo: 'https://assets.acordocerto.com.br/f/114280/60x60/b85fcf03dd/reclame-aqui.png',\n name: 'Ótimo Reclame Aqui',\n },\n scaleup: {\n logo: 'https://assets.acordocerto.com.br/f/114280/104x50/07c8b89dbe/scale-up.png',\n name: 'Scale Up',\n },\n sslblindado: {\n logo: 'https://assets.acordocerto.com.br/f/114280/75x54/60734a2cc4/ssl-blindado.png',\n name: 'SSL Blindado',\n },\n}\nexport const socialsMap = {\n instagram: {\n name: 'Instagram',\n icon: <IconInstagram />,\n },\n facebook: {\n name: 'Facebook',\n icon: <IconFacebook />,\n },\n youtube: {\n name: 'Youtube',\n icon: <IconYoutube />,\n },\n linkedin: {\n name: 'Linkedin',\n icon: <IconLinkedin />,\n },\n tiktok: {\n name: 'TikTok',\n icon: <IconTiktok />,\n },\n}\n\nexport const storesMap = {\n googleplay: {\n name: 'Google Play',\n icon: 'https://assets.acordocerto.com.br/f/114280/117x36/e0e7eda65d/google-play.png',\n },\n appstore: {\n name: 'App Store',\n icon: 'https://assets.acordocerto.com.br/f/114280/117x36/38b0d1ecc9/app-store.png',\n },\n}\n","import classNames from 'classnames'\nimport { Text } from '../Text'\nimport { FooterProps } from './types'\nimport { certificatesMap, socialsMap, storesMap } from './data'\nimport { Conditional } from '../misc'\nimport { LazyImage } from '../LazyImage'\nimport { isMobile } from '@core/utils/isMobile'\nimport './styles.scss'\n\nexport const Footer = ({\n logo,\n categoryLinks,\n socialLinks,\n cnpj,\n address,\n companyOverview,\n certificates,\n copyrights,\n stores = {},\n}: FooterProps) => {\n const usedCertificates = certificates.map(\n (certificate) => certificatesMap[certificate],\n )\n\n const usedSocials = Object.keys(socialLinks).map((social) => {\n return {\n ...socialsMap[social as keyof typeof socialsMap],\n url: socialLinks[social as keyof typeof socialLinks],\n }\n })\n\n const usedStores = Object.keys(stores).map((store) => {\n return {\n ...storesMap[store as keyof typeof storesMap],\n url: stores[store as keyof typeof stores],\n }\n })\n\n const handleClick = (url: string) => {\n window.open(url, '_blank')\n }\n\n const showCertificatesBorder = usedCertificates.length > 3 && !!isMobile()\n \n if (categoryLinks) {\n return (\n <footer role=\"contentinfo\" className=\"au-footer-full\">\n <div className=\"au-footer-full__container\">\n <div className=\"au-footer-full__logo\">{logo}</div>\n <div className=\"au-footer-full__links\">\n {categoryLinks.map(({ categoryTitle, links }, index) => {\n return (\n <div key={index} className=\"au-footer-full__links-category\">\n <Text as=\"h2\" variant=\"heading-micro\" weight=\"bold\">\n {categoryTitle}\n </Text>\n {links.map(({ title, url }, index) => {\n return (\n <div\n className={classNames('au-footer-full__links', {\n 'au-footer-full__links--is-clickable': !!url,\n })}\n key={index}\n onClick={() => url && handleClick(url)}>\n <Text\n as=\"a\"\n variant=\"body-medium\"\n weight=\"regular\"\n color=\"secondary\">\n {title}\n </Text>\n </div>\n )\n })}\n </div>\n )\n })}\n <div className=\"au-footer-full__company-info\">\n <Text as=\"h2\" variant=\"heading-micro\" weight=\"bold\">\n Siga a gente\n </Text>\n <div className=\"au-footer-full__links-socials\">\n {usedSocials.map(({ icon, url }, index) => {\n return (\n <div\n className={classNames('au-footer-full__links', {\n 'au-footer-full__links--is-clickable': !!url,\n })}\n key={index}\n onClick={() => url && handleClick(url)}>\n {icon}\n </div>\n )\n })}\n </div>\n <Text\n as=\"div\"\n variant=\"body-medium\"\n weight=\"regular\"\n color=\"secondary\">\n <Text\n as=\"strong\"\n weight=\"bold\"\n color=\"secondary\">\n CNPJ:\n </Text> {cnpj}\n </Text>\n <Text\n as=\"div\"\n variant=\"body-medium\"\n weight=\"regular\"\n color=\"secondary\">\n <Text\n as=\"h2\"\n variant=\"body-medium\"\n weight=\"bold\"\n color=\"secondary\">\n Localização (sem atendimento ao público):\n </Text>\n {address}\n </Text>\n </div>\n </div>\n <Conditional\n condition={!!usedStores.length && Boolean(isMobile())}\n renderIf={\n <div className=\"au-footer-full__stores\">\n <Text\n className=\"au-footer-full__stores-title\"\n as=\"h2\"\n variant=\"heading-micro\"\n weight=\"bold\">\n Baixe nosso app\n </Text>\n {usedStores.map(({ icon, url, name }, index) => {\n return (\n <LazyImage\n className={classNames('au-footer-full__stores-logo', {\n 'au-footer-full__stores-logo--is-clickable': !!url,\n })}\n key={index}\n src={icon}\n alt={name}\n onClick={() => url && handleClick(url)}\n />\n )\n })}\n </div>\n }\n />\n {companyOverview && (\n <div className=\"au-footer-full__company-overview\">\n <Text color=\"secondary\">{companyOverview}</Text>\n </div>\n )}\n <div className=\"au-footer-full__bottom\">\n <div className={classNames(\"au-footer-full__bottom-certificates\", {\n 'au-footer-full__bottom-certificates--with-border': showCertificatesBorder,\n })}>\n {usedCertificates.map(({ logo, name }, index) => {\n return <LazyImage key={index} src={logo} alt={name} />\n })}\n </div>\n <div className=\"au-footer-full__bottom-side\">\n <Conditional\n condition={!!usedStores.length && !isMobile()}\n renderIf={\n <div className=\"au-footer-full__stores\">\n <Text\n className=\"au-footer-full__stores-title\"\n as=\"h2\"\n variant=\"heading-micro\"\n weight=\"bold\">\n Baixe nosso app\n </Text>\n {usedStores.map(({ icon, url, name }, index) => {\n return (\n <LazyImage\n className={classNames('au-footer-full__stores-logo', {\n 'au-footer-full__stores-logo--is-clickable': !!url,\n })}\n key={index}\n src={icon}\n alt={name}\n onClick={() => url && handleClick(url)}\n />\n )\n })}\n </div>\n }\n />\n <Text\n as=\"h2\"\n variant=\"body-medium\"\n weight=\"regular\"\n color=\"secondary\"\n className=\"au-footer-full__copyrights\"\n dangerouslySetInnerHTML={copyrights}\n />\n </div>\n </div>\n </div>\n </footer>\n )\n }\n\n return (\n <footer role=\"contentinfo\" className=\"au-footer\">\n <div className=\"au-footer__container\">\n <div className=\"au-footer__content\">\n <div className=\"au-footer__content-logos\">\n {logo}\n <div className=\"au-footer__content-divider\" />\n <div className=\"au-footer__content-certificates\">\n {usedCertificates.map(({ logo, name }, index) => {\n return <LazyImage key={index} src={logo} alt={name} />\n })}\n </div>\n </div>\n <div className=\"au-footer__content-copyrights\">\n <Text\n as=\"h2\"\n variant=\"body-medium\"\n weight=\"regular\"\n color=\"secondary\">\n {copyrights}\n </Text>\n </div>\n </div>\n </div>\n </footer>\n )\n}\n"],"names":["index","logo"],"mappings":";;;;;;;;;;;;AAQO,MAAM,kBAAkB;AAAA,EAC7B,aAAa;AAAA,IACX,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA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
-
.au-footer{background-color:#fff;border-top:1px solid #e2e4e9;padding-block:32px}@media (min-width: 600px){.au-footer{padding-block:48px}}.au-footer__container{width:100%;max-width:1232px;margin:0 auto;padding:0 24px}@media (min-width: 1024px){.au-footer__container{padding:0 16px}}.au-footer__container{display:flex;flex-direction:column;gap:48px}.au-footer__content{display:flex;align-items:center;justify-content:space-between}@media (max-width: 1023px){.au-footer__content{gap:32px;flex-direction:column}}.au-footer__content-logos{display:flex;gap:16px;align-items:center}@media (max-width: 1023px){.au-footer__content-logos{gap:32px;flex-direction:column}}.au-footer__content-divider{display:none}@media (min-width: 1024px){.au-footer__content-divider{display:block;width:1px;height:60px;background-color:#e2e4e9}}.au-footer__content-certificates{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}@media (max-width: 1023px){.au-footer__content-certificates{justify-content:center;padding-top:32px;border-top:1px solid #e2e4e9}}@media (min-width: 1024px){.au-footer__content-certificates{margin-right:8px}}.au-footer__content-copyrights{max-width:385px;text-align:center}@media (min-width: 1024px){.au-footer__content-copyrights{text-align:right}}.au-footer__bottom{display:flex;align-items:center;justify-content:center;text-align:center}.au-footer-full{background-color:#fff;border-top:1px solid #e2e4e9;padding-block:32px}@media (min-width: 600px){.au-footer-full{padding-block:48px}}@media (min-width: 1024px){.au-footer-full{padding-block:64px}}.au-footer-full__container{width:100%;max-width:1232px;margin:0 auto;padding:0 24px}@media (min-width: 1024px){.au-footer-full__container{padding:0 16px}}.au-footer-full__container{gap:32px;display:flex;flex-direction:column}@media (min-width: 1024px){.au-footer-full__container{gap:48px}}.au-footer-full__logo{display:flex;align-items:center}.au-footer-full__links{display:flex;flex-direction:column;gap:32px}@media (min-width: 1024px){.au-footer-full__links{flex-direction:row;justify-content:space-between}}.au-footer-full__links--is-clickable{cursor:pointer}.au-footer-full__links--is-clickable:hover .au-text{color:#16181d}.au-footer-full__links-category{max-width:272px;display:flex;flex-direction:column;gap:16px}.au-footer-full__links-socials{display:flex;align-items:center;gap:16px}.au-footer-full__company-info{max-width:
|
|
1
|
+
.au-footer{background-color:#fff;border-top:1px solid #e2e4e9;padding-block:32px}@media (min-width: 600px){.au-footer{padding-block:48px}}.au-footer__container{width:100%;max-width:1232px;margin:0 auto;padding:0 24px}@media (min-width: 1024px){.au-footer__container{padding:0 16px}}.au-footer__container{display:flex;flex-direction:column;gap:48px}.au-footer__content{display:flex;align-items:center;justify-content:space-between}@media (max-width: 1023px){.au-footer__content{gap:32px;flex-direction:column}}.au-footer__content-logos{display:flex;gap:16px;align-items:center}@media (max-width: 1023px){.au-footer__content-logos{gap:32px;flex-direction:column}}.au-footer__content-divider{display:none}@media (min-width: 1024px){.au-footer__content-divider{display:block;width:1px;height:60px;background-color:#e2e4e9}}.au-footer__content-certificates{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}@media (max-width: 1023px){.au-footer__content-certificates{justify-content:center;padding-top:32px;border-top:1px solid #e2e4e9}}@media (min-width: 1024px){.au-footer__content-certificates{margin-right:8px}}.au-footer__content-copyrights{max-width:385px;text-align:center}@media (min-width: 1024px){.au-footer__content-copyrights{text-align:right}}.au-footer__bottom{display:flex;align-items:center;justify-content:center;text-align:center}.au-footer-full{background-color:#fff;border-top:1px solid #e2e4e9;padding-block:32px}@media (min-width: 600px){.au-footer-full{padding-block:48px}}@media (min-width: 1024px){.au-footer-full{padding-block:64px}}.au-footer-full__container{width:100%;max-width:1232px;margin:0 auto;padding:0 24px}@media (min-width: 1024px){.au-footer-full__container{padding:0 16px}}.au-footer-full__container{gap:32px;display:flex;flex-direction:column}@media (min-width: 1024px){.au-footer-full__container{gap:48px}}.au-footer-full__logo{display:flex;align-items:center}.au-footer-full__links{display:flex;flex-direction:column;gap:32px}@media (min-width: 1024px){.au-footer-full__links{flex-direction:row;justify-content:space-between}}.au-footer-full__links--is-clickable{cursor:pointer}.au-footer-full__links--is-clickable:hover .au-text{color:#16181d}.au-footer-full__links-category{max-width:272px;display:flex;flex-direction:column;gap:16px}.au-footer-full__links-socials{display:flex;align-items:center;gap:16px}.au-footer-full__company-info{max-width:320px;display:flex;flex-direction:column;gap:24px}@media (min-width: 1024px){.au-footer-full__company-info{gap:16px}}.au-footer-full__company-overview{padding-top:32px;border-top:1px solid #e2e4e9}@media (min-width: 1024px){.au-footer-full__company-overview{padding-top:48px}}.au-footer-full__bottom{display:flex;flex-direction:column;justify-content:space-between;align-items:center;gap:32px}@media (min-width: 1024px){.au-footer-full__bottom{gap:48px;flex-direction:row;padding-top:48px;border-top:1px solid #e2e4e9}}.au-footer-full__bottom-certificates{display:flex;align-items:center;flex-direction:row;width:100%;justify-content:space-between;flex-wrap:wrap;gap:32px 0px}.au-footer-full__bottom-certificates--with-border{border-top:1px solid #e2e4e9;padding-top:32px}@media (min-width: 1024px){.au-footer-full__bottom-certificates{justify-content:start;flex-wrap:nowrap;gap:32px}}.au-footer-full__bottom-side{display:flex;width:100%;flex-direction:column;align-items:center;border-top:1px solid #e2e4e9;text-align:center}@media (min-width: 1024px){.au-footer-full__bottom-side{border-top:0;text-align:right;align-items:flex-end}}.au-footer-full__stores{display:flex;gap:13px;flex-wrap:wrap;align-items:center}@media (min-width: 1024px){.au-footer-full__stores{gap:16px}}.au-footer-full__stores-title{text-align:left}@media (max-width: 599px){.au-footer-full__stores-title{width:100%}}.au-footer-full__stores-logo{cursor:pointer;max-width:129px}@media (max-width: 599px){.au-footer-full__stores-logo{flex:1}}@media (min-width: 1024px){.au-footer-full__stores-logo{width:117px}}.au-footer-full__stores-logo--is-clickable{cursor:pointer}.au-footer-full__stores-logo--is-clickable:hover{opacity:.6}.au-footer-full__copyrights{padding-top:32px}@media (min-width: 1024px){.au-footer-full__copyrights{padding-top:16px}}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Conditional } from "../Conditional/index.es.js";
|
|
2
|
+
import { C, D, W, S } from "../../react-if.esm-CGh0ofh0.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
C as Case,
|
|
5
|
+
Conditional,
|
|
6
|
+
D as Default,
|
|
7
|
+
W as If,
|
|
8
|
+
S as Switch
|
|
4
9
|
};
|
|
5
10
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/main.d.ts
CHANGED
package/dist/main.es.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { C, D, W, S } from "./react-if.esm-CGh0ofh0.js";
|
|
1
2
|
import { Button } from "./components/Button/index.es.js";
|
|
2
3
|
import { PureSwitch } from "./components/Pure/index.es.js";
|
|
3
4
|
import { CardSwitch } from "./components/Card/index.es.js";
|
|
@@ -354,7 +355,7 @@ import { IconZoomIn } from "./components/icons/IconZoomIn/index.es.js";
|
|
|
354
355
|
import { IconZoomOut } from "./components/icons/IconZoomOut/index.es.js";
|
|
355
356
|
import { IconSocialGoogle } from "./components/icons/IconSocialGoogle/index.es.js";
|
|
356
357
|
import { Carousel } from "./components/Carousel/index.es.js";
|
|
357
|
-
import { k as k2, j as j2, l as l2, i as i2, a as a2, B, ai, aj, ah, x, w, v, u, t, s, r, K, J, I, H, g as g2, G, F, E, D, A, z, y, W, V, U, T, S, b as b2, R, a6, a5, a4, a3, a2 as a22, f as f2, a1, h as h2, q as q2, p as p2, o as o2, c as c2, n as n2, m as m2, d as d2, Q, P, O, N, M, C, L as L2, a0, $, _, Z, Y, e as e2, X, ak, av, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, au, aw, ay, az, ax, al, am, an, ao, ap, aq, ar, as, at, a7, a8, a9, aa, ab, ac, ad, ae, af, ag } from "./tokens-D_iASp38.js";
|
|
358
|
+
import { k as k2, j as j2, l as l2, i as i2, a as a2, B, ai, aj, ah, x, w, v, u, t, s, r, K, J, I, H, g as g2, G, F, E, D as D2, A, z, y, W as W2, V, U, T, S as S2, b as b2, R, a6, a5, a4, a3, a2 as a22, f as f2, a1, h as h2, q as q2, p as p2, o as o2, c as c2, n as n2, m as m2, d as d2, Q, P, O, N, M, C as C2, L as L2, a0, $, _, Z, Y, e as e2, X, ak, av, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, au, aw, ay, az, ax, al, am, an, ao, ap, aq, ar, as, at, a7, a8, a9, aa, ab, ac, ad, ae, af, ag } from "./tokens-D_iASp38.js";
|
|
358
359
|
import './components/main/styles.css';const CardContainer = ({
|
|
359
360
|
direction,
|
|
360
361
|
alignItems,
|
|
@@ -484,15 +485,15 @@ export {
|
|
|
484
485
|
G as COLOR_BRAND_CYAN_60,
|
|
485
486
|
F as COLOR_BRAND_EMERALD_10,
|
|
486
487
|
E as COLOR_BRAND_EMERALD_20,
|
|
487
|
-
|
|
488
|
+
D2 as COLOR_BRAND_EMERALD_30,
|
|
488
489
|
A as COLOR_BRAND_EMERALD_40,
|
|
489
490
|
z as COLOR_BRAND_EMERALD_50,
|
|
490
491
|
y as COLOR_BRAND_EMERALD_60,
|
|
491
|
-
|
|
492
|
+
W2 as COLOR_ERROR_00,
|
|
492
493
|
V as COLOR_ERROR_10,
|
|
493
494
|
U as COLOR_ERROR_20,
|
|
494
495
|
T as COLOR_ERROR_30,
|
|
495
|
-
|
|
496
|
+
S2 as COLOR_ERROR_40,
|
|
496
497
|
b2 as COLOR_ERROR_50,
|
|
497
498
|
R as COLOR_ERROR_60,
|
|
498
499
|
a6 as COLOR_INFO_00,
|
|
@@ -515,7 +516,7 @@ export {
|
|
|
515
516
|
O as COLOR_SUCCESS_20,
|
|
516
517
|
N as COLOR_SUCCESS_30,
|
|
517
518
|
M as COLOR_SUCCESS_40,
|
|
518
|
-
|
|
519
|
+
C2 as COLOR_SUCCESS_50,
|
|
519
520
|
L2 as COLOR_SUCCESS_60,
|
|
520
521
|
a0 as COLOR_WARNING_00,
|
|
521
522
|
$ as COLOR_WARNING_10,
|
|
@@ -528,10 +529,12 @@ export {
|
|
|
528
529
|
components as Card,
|
|
529
530
|
CardSwitch,
|
|
530
531
|
Carousel,
|
|
532
|
+
C as Case,
|
|
531
533
|
Checkbox,
|
|
532
534
|
Conditional,
|
|
533
535
|
Container,
|
|
534
536
|
DatepickerField,
|
|
537
|
+
D as Default,
|
|
535
538
|
Drawer,
|
|
536
539
|
EmailField,
|
|
537
540
|
av as FONT_BODY,
|
|
@@ -871,6 +874,7 @@ export {
|
|
|
871
874
|
IconZapOff,
|
|
872
875
|
IconZoomIn,
|
|
873
876
|
IconZoomOut,
|
|
877
|
+
W as If,
|
|
874
878
|
Image,
|
|
875
879
|
InputField,
|
|
876
880
|
LazyImage,
|
|
@@ -922,6 +926,7 @@ export {
|
|
|
922
926
|
SelectField,
|
|
923
927
|
Skeleton,
|
|
924
928
|
Spinner,
|
|
929
|
+
S as Switch,
|
|
925
930
|
Tabs,
|
|
926
931
|
Tag,
|
|
927
932
|
Text,
|
package/dist/main.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.es.js","sources":["../lib/components/Card/Container/index.tsx","../lib/components/Card/Image/index.tsx","../lib/components/Card/Root/index.tsx","../lib/components/Card/Tag/index.tsx","../lib/components/Card/index.tsx","../lib/components/Drawer/hooks.ts"],"sourcesContent":["import classNames from 'classnames'\nimport { CSSProperties, ReactNode } from 'react'\n\nexport type CardContainerProps = {\n direction?: 'column' | 'row'\n alignItems?: 'center' | 'start'\n justifyContent?: 'center' | 'space-between'\n gap?: number\n width?: number\n children: ReactNode\n}\nexport const CardContainer = ({\n direction,\n alignItems,\n justifyContent,\n gap,\n width,\n children,\n}: CardContainerProps) => {\n const containerClasses = classNames('au-card__container', {\n [`au-card__container--direction-${direction}`]: direction,\n [`au-card__container--align-items-${alignItems}`]: alignItems,\n [`au-card__container--justify-content-${justifyContent}`]: justifyContent,\n })\n\n const containerStyle: CSSProperties = {\n gap: `${gap}px`,\n width: `${width}px`\n }\n return (\n <div style={containerStyle} className={containerClasses}>\n {children}\n </div>\n )\n}\n","import { CSSProperties } from 'react'\n\nexport type CardImageProps = {\n src: string\n alt?: string\n width?: number\n height?: number\n}\nexport const CardImage = ({ src, alt, width, height }: CardImageProps) => {\n const imageSize: CSSProperties = {\n width: `${width}px`,\n height: `${height}px`,\n }\n\n return (\n <div>\n <img style={imageSize} src={src} alt={alt} />\n </div>\n )\n}\n","import classNames from 'classnames'\nimport { CSSProperties, ReactNode, Ref } from 'react'\n\nexport type CardRootProps = {\n border?: boolean\n color?: 'primary' | 'secondary'\n width?: number\n height?: number\n maxWidth?: number\n maxHeight?: number\n paddingLess?: boolean;\n hoverShadow?: boolean\n className?: string;\n children: ReactNode\n ref?: Ref<HTMLDivElement>\n}\nexport const CardRoot = ({\n border = true,\n color = 'primary',\n width,\n height,\n maxWidth,\n maxHeight,\n hoverShadow,\n paddingLess,\n children,\n className,\n ref\n}: CardRootProps) => {\n const rootClasses = classNames('au-card__root', {\n 'au-card__root--border-none': !border,\n 'au-card__root--color-secondary': color === 'secondary',\n 'au-card__root--with-hover-shadow': !!hoverShadow,\n 'au-card__root--paddingless': !!paddingLess,\n [String(className)]: !!className\n })\n const rootSize: CSSProperties = {\n width: `${width}px`,\n height: `${height}px`,\n maxWidth: `${maxWidth}px`,\n maxHeight: `${maxHeight}px`\n }\n\n return (\n <div\n ref={ref}\n style={rootSize}\n className={rootClasses}>\n {children}\n </div>\n )\n}\n","import classNames from 'classnames'\nimport { ReactNode } from 'react'\n\nexport type CardTagProps = {\n color?: 'primary' | 'secondary'\n icon?: ReactNode\n children: ReactNode\n}\nexport const CardTag = ({\n color = 'primary',\n icon,\n children,\n}: CardTagProps) => {\n const tagClasses = classNames('au-card__tag', {\n 'au-card__tag--primary': color === 'primary',\n 'au-card__tag--secondary': color === 'secondary',\n })\n return (\n <div className={tagClasses}>\n <span>{icon}</span>\n <span>{children}</span>\n </div>\n )\n}\n","import { CardContainer, CardContainerProps } from './Container'\nimport { CardEmphasis, CardEmphasisProps } from './Emphasis'\nimport { CardImage, CardImageProps } from './Image'\nimport { CardRoot, CardRootProps } from './Root'\nimport { CardTag, CardTagProps } from './Tag'\nimport './styles.scss'\n\ntype Components = {\n Root: React.FC<CardRootProps>\n Container: React.FC<CardContainerProps>\n Emphasis: React.FC<CardEmphasisProps>\n Image: React.FC<CardImageProps>\n Tag: React.FC<CardTagProps>\n}\n\nconst components: Components = {\n Root: CardRoot,\n Container: CardContainer,\n Emphasis: CardEmphasis,\n Image: CardImage,\n Tag: CardTag,\n}\n\nObject.keys(components).forEach((key) => {\n const component = components[key as keyof Components]\n component.displayName = `Card.${key}`\n})\n\nexport { components as Card }\n","import { useState } from 'react'\n\ntype UseDrawerProps = Record<string, boolean>\n\nexport function useDrawer(props: UseDrawerProps) {\n const [drawerOpen, setDrawerOpen] = useState<UseDrawerProps>(props)\n\n function handleOpenDrawer(name: string) {\n setDrawerOpen((prev) => {\n return {\n ...prev,\n [name]: !prev[name],\n }\n })\n }\n\n return {\n handleOpenDrawer,\n drawerOpen,\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.es.js","sources":["../lib/components/Card/Container/index.tsx","../lib/components/Card/Image/index.tsx","../lib/components/Card/Root/index.tsx","../lib/components/Card/Tag/index.tsx","../lib/components/Card/index.tsx","../lib/components/Drawer/hooks.ts"],"sourcesContent":["import classNames from 'classnames'\nimport { CSSProperties, ReactNode } from 'react'\n\nexport type CardContainerProps = {\n direction?: 'column' | 'row'\n alignItems?: 'center' | 'start'\n justifyContent?: 'center' | 'space-between'\n gap?: number\n width?: number\n children: ReactNode\n}\nexport const CardContainer = ({\n direction,\n alignItems,\n justifyContent,\n gap,\n width,\n children,\n}: CardContainerProps) => {\n const containerClasses = classNames('au-card__container', {\n [`au-card__container--direction-${direction}`]: direction,\n [`au-card__container--align-items-${alignItems}`]: alignItems,\n [`au-card__container--justify-content-${justifyContent}`]: justifyContent,\n })\n\n const containerStyle: CSSProperties = {\n gap: `${gap}px`,\n width: `${width}px`\n }\n return (\n <div style={containerStyle} className={containerClasses}>\n {children}\n </div>\n )\n}\n","import { CSSProperties } from 'react'\n\nexport type CardImageProps = {\n src: string\n alt?: string\n width?: number\n height?: number\n}\nexport const CardImage = ({ src, alt, width, height }: CardImageProps) => {\n const imageSize: CSSProperties = {\n width: `${width}px`,\n height: `${height}px`,\n }\n\n return (\n <div>\n <img style={imageSize} src={src} alt={alt} />\n </div>\n )\n}\n","import classNames from 'classnames'\nimport { CSSProperties, ReactNode, Ref } from 'react'\n\nexport type CardRootProps = {\n border?: boolean\n color?: 'primary' | 'secondary'\n width?: number\n height?: number\n maxWidth?: number\n maxHeight?: number\n paddingLess?: boolean;\n hoverShadow?: boolean\n className?: string;\n children: ReactNode\n ref?: Ref<HTMLDivElement>\n}\nexport const CardRoot = ({\n border = true,\n color = 'primary',\n width,\n height,\n maxWidth,\n maxHeight,\n hoverShadow,\n paddingLess,\n children,\n className,\n ref\n}: CardRootProps) => {\n const rootClasses = classNames('au-card__root', {\n 'au-card__root--border-none': !border,\n 'au-card__root--color-secondary': color === 'secondary',\n 'au-card__root--with-hover-shadow': !!hoverShadow,\n 'au-card__root--paddingless': !!paddingLess,\n [String(className)]: !!className\n })\n const rootSize: CSSProperties = {\n width: `${width}px`,\n height: `${height}px`,\n maxWidth: `${maxWidth}px`,\n maxHeight: `${maxHeight}px`\n }\n\n return (\n <div\n ref={ref}\n style={rootSize}\n className={rootClasses}>\n {children}\n </div>\n )\n}\n","import classNames from 'classnames'\nimport { ReactNode } from 'react'\n\nexport type CardTagProps = {\n color?: 'primary' | 'secondary'\n icon?: ReactNode\n children: ReactNode\n}\nexport const CardTag = ({\n color = 'primary',\n icon,\n children,\n}: CardTagProps) => {\n const tagClasses = classNames('au-card__tag', {\n 'au-card__tag--primary': color === 'primary',\n 'au-card__tag--secondary': color === 'secondary',\n })\n return (\n <div className={tagClasses}>\n <span>{icon}</span>\n <span>{children}</span>\n </div>\n )\n}\n","import { CardContainer, CardContainerProps } from './Container'\nimport { CardEmphasis, CardEmphasisProps } from './Emphasis'\nimport { CardImage, CardImageProps } from './Image'\nimport { CardRoot, CardRootProps } from './Root'\nimport { CardTag, CardTagProps } from './Tag'\nimport './styles.scss'\n\ntype Components = {\n Root: React.FC<CardRootProps>\n Container: React.FC<CardContainerProps>\n Emphasis: React.FC<CardEmphasisProps>\n Image: React.FC<CardImageProps>\n Tag: React.FC<CardTagProps>\n}\n\nconst components: Components = {\n Root: CardRoot,\n Container: CardContainer,\n Emphasis: CardEmphasis,\n Image: CardImage,\n Tag: CardTag,\n}\n\nObject.keys(components).forEach((key) => {\n const component = components[key as keyof Components]\n component.displayName = `Card.${key}`\n})\n\nexport { components as Card }\n","import { useState } from 'react'\n\ntype UseDrawerProps = Record<string, boolean>\n\nexport function useDrawer(props: UseDrawerProps) {\n const [drawerOpen, setDrawerOpen] = useState<UseDrawerProps>(props)\n\n function handleOpenDrawer(name: string) {\n setDrawerOpen((prev) => {\n return {\n ...prev,\n [name]: !prev[name],\n }\n })\n }\n\n return {\n handleOpenDrawer,\n drawerOpen,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA0B;AAClB,QAAA,mBAAmB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AAAA,EAAA;AAGP;AC3CO,MAAM,UAAU,CAAC;AAAA,EACtB,QAAQ;AAAA,EACR;AAAA,EACA;AACF,MAAoB;AACZ,QAAA,aAAa,WAAW,gBAAgB;AAAA,IAC5C,yBAAyB,UAAU;AAAA,IACnC,2BAA2B,UAAU;AAAA,EAAA,CACtC;AAEC,SAAA,qBAAC,OAAI,EAAA,WAAW,YACd,UAAA;AAAA,IAAA,oBAAC,UAAM,UAAK,KAAA,CAAA;AAAA,IACZ,oBAAC,UAAM,UAAS;AAAA,EAClB,EAAA,CAAA;AAEJ;ACRA,MAAM,aAAyB;AAAA,EAC7B,MAAM;AAAA,EACN,WAAW;AAAA,EACX,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AACP;AAEA,OAAO,KAAK,UAAU,EAAE,QAAQ,CAAC,QAAQ;AACjC,QAAA,YAAY,WAAW,GAAuB;AAC1C,YAAA,cAAc,QAAQ,GAAG;AACrC,CAAC;ACtBM,SAAS,UAAU,OAAuB;AAC/C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAyB,KAAK;AAElE,WAAS,iBAAiB,MAAc;AACtC,kBAAc,CAAC,SAAS;AACf,aAAA;AAAA,QACL,GAAG;AAAA,QACH,CAAC,IAAI,GAAG,CAAC,KAAK,IAAI;AAAA,MAAA;AAAA,IACpB,CACD;AAAA,EACH;AAEO,SAAA;AAAA,IACL;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as $dbSRa$react from "react";
|
|
2
|
+
import $dbSRa$react__default, { Fragment } from "react";
|
|
3
|
+
var render = function render2(props) {
|
|
4
|
+
if (typeof props.children === "function") {
|
|
5
|
+
return $dbSRa$react__default.createElement(Fragment, null, props.children());
|
|
6
|
+
}
|
|
7
|
+
return $dbSRa$react__default.createElement(Fragment, null, props.children || null);
|
|
8
|
+
};
|
|
9
|
+
var Case = function Case2(_ref) {
|
|
10
|
+
var _ref$children = _ref.children, children = _ref$children === void 0 ? null : _ref$children;
|
|
11
|
+
return render({
|
|
12
|
+
children
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var Default = function Default2(_ref) {
|
|
16
|
+
var _ref$children = _ref.children, children = _ref$children === void 0 ? null : _ref$children;
|
|
17
|
+
return render({
|
|
18
|
+
children
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
function isFunction(input) {
|
|
22
|
+
return typeof input === "function";
|
|
23
|
+
}
|
|
24
|
+
var getConditionResult = function getConditionResult2(condition) {
|
|
25
|
+
var conditionResult = Boolean(typeof condition === "function" ? condition() : condition);
|
|
26
|
+
return conditionResult;
|
|
27
|
+
};
|
|
28
|
+
var Switch = function Switch2(_ref) {
|
|
29
|
+
var _ref2;
|
|
30
|
+
var children = _ref.children;
|
|
31
|
+
var matchingCase = void 0;
|
|
32
|
+
var defaultCase = void 0;
|
|
33
|
+
if (isFunction(children)) {
|
|
34
|
+
children = children();
|
|
35
|
+
}
|
|
36
|
+
$dbSRa$react.Children.forEach(children, function(child) {
|
|
37
|
+
if (!$dbSRa$react.isValidElement(child)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!matchingCase && child.type === Case) {
|
|
41
|
+
var childProps = child.props;
|
|
42
|
+
var conditionResult = getConditionResult(childProps.condition);
|
|
43
|
+
if (conditionResult) {
|
|
44
|
+
matchingCase = child;
|
|
45
|
+
}
|
|
46
|
+
} else if (!defaultCase && child.type === Default) {
|
|
47
|
+
defaultCase = child;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return (_ref2 = matchingCase != null ? matchingCase : defaultCase) != null ? _ref2 : null;
|
|
51
|
+
};
|
|
52
|
+
var When = function When2(_ref) {
|
|
53
|
+
var condition = _ref.condition, _ref$children = _ref.children, children = _ref$children === void 0 ? null : _ref$children;
|
|
54
|
+
var conditionResult = Boolean(getConditionResult(condition));
|
|
55
|
+
return conditionResult && children ? render({
|
|
56
|
+
children
|
|
57
|
+
}) : null;
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
Case as C,
|
|
61
|
+
Default as D,
|
|
62
|
+
Switch as S,
|
|
63
|
+
When as W
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=react-if.esm-CGh0ofh0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-if.esm-CGh0ofh0.js","sources":["../node_modules/react-if/dist/react-if.esm.js"],"sourcesContent":["import * as React from 'react';\nimport React__default, { Fragment, useRef, useState, useMemo, useEffect } from 'react';\n\n/**\n * Renders a React component while also checking whether the children are a function or not\n * @param props Props of the component to render\n */\nvar render = function render(props) {\n if (typeof props.children === 'function') {\n return React__default.createElement(Fragment, null, props.children());\n }\n return React__default.createElement(Fragment, null, props.children || null);\n};\n\n/**\n * If the `<Case />` is the first one to have its condition evaluates to true\n * inside the parent `<Switch />` it will be the only rendered.\n * @param props The props to pass down to the `<Case />` component\n */\nvar Case = function Case(_ref) {\n var _ref$children = _ref.children,\n children = _ref$children === void 0 ? null : _ref$children;\n return render({\n children: children\n });\n};\n\n/**\n * If no `<Case />` have its condition evaluates to true inside the parent `<Switch />`,\n * the first `<Default />` will be the only one rendered.\n * @param props The props to pass down to the `<Default />` component\n */\nvar Default = function Default(_ref) {\n var _ref$children = _ref.children,\n children = _ref$children === void 0 ? null : _ref$children;\n return render({\n children: children\n });\n};\n\n/**\n * Must only contain a single child, which it renders as-is.\n * Should not be used outside of an `<If />` block.\n * @param props The props to pass down to the `<Else />` component\n */\nvar Else = function Else(props) {\n return render(props);\n};\n\n/**\n * Must contain only a single child, which it renders as-is.\n * Should not be used outside of an `<If />` block whose condition prop is a promise.\n * @param props The props to pass down to the `<Fallback />` component\n */\nvar Fallback = function Fallback(props) {\n return render(props);\n};\n\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nfunction _regeneratorRuntime() {\n _regeneratorRuntime = function () {\n return r;\n };\n var t,\n r = {},\n e = Object.prototype,\n n = e.hasOwnProperty,\n o = \"function\" == typeof Symbol ? Symbol : {},\n i = o.iterator || \"@@iterator\",\n a = o.asyncIterator || \"@@asyncIterator\",\n u = o.toStringTag || \"@@toStringTag\";\n function c(t, r, e, n) {\n return Object.defineProperty(t, r, {\n value: e,\n enumerable: !n,\n configurable: !n,\n writable: !n\n });\n }\n try {\n c({}, \"\");\n } catch (t) {\n c = function (t, r, e) {\n return t[r] = e;\n };\n }\n function h(r, e, n, o) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype);\n return c(a, \"_invoke\", function (r, e, n) {\n var o = 1;\n return function (i, a) {\n if (3 === o) throw Error(\"Generator is already running\");\n if (4 === o) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var u = n.delegate;\n if (u) {\n var c = d(u, n);\n if (c) {\n if (c === f) continue;\n return c;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (1 === o) throw o = 4, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = 3;\n var h = s(r, e, n);\n if (\"normal\" === h.type) {\n if (o = n.done ? 4 : 2, h.arg === f) continue;\n return {\n value: h.arg,\n done: n.done\n };\n }\n \"throw\" === h.type && (o = 4, n.method = \"throw\", n.arg = h.arg);\n }\n };\n }(r, n, new Context(o || [])), !0), a;\n }\n function s(t, r, e) {\n try {\n return {\n type: \"normal\",\n arg: t.call(r, e)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n r.wrap = h;\n var f = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var l = {};\n c(l, i, function () {\n return this;\n });\n var p = Object.getPrototypeOf,\n y = p && p(p(x([])));\n y && y !== e && n.call(y, i) && (l = y);\n var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);\n function g(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (r) {\n c(t, r, function (t) {\n return this._invoke(r, t);\n });\n });\n }\n function AsyncIterator(t, r) {\n function e(o, i, a, u) {\n var c = s(t[o], t, i);\n if (\"throw\" !== c.type) {\n var h = c.arg,\n f = h.value;\n return f && \"object\" == typeof f && n.call(f, \"__await\") ? r.resolve(f.__await).then(function (t) {\n e(\"next\", t, a, u);\n }, function (t) {\n e(\"throw\", t, a, u);\n }) : r.resolve(f).then(function (t) {\n h.value = t, a(h);\n }, function (t) {\n return e(\"throw\", t, a, u);\n });\n }\n u(c.arg);\n }\n var o;\n c(this, \"_invoke\", function (t, n) {\n function i() {\n return new r(function (r, o) {\n e(t, n, r, o);\n });\n }\n return o = o ? o.then(i, i) : i();\n }, !0);\n }\n function d(r, e) {\n var n = e.method,\n o = r.i[n];\n if (o === t) return e.delegate = null, \"throw\" === n && r.i.return && (e.method = \"return\", e.arg = t, d(r, e), \"throw\" === e.method) || \"return\" !== n && (e.method = \"throw\", e.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), f;\n var i = s(o, r.i, e.arg);\n if (\"throw\" === i.type) return e.method = \"throw\", e.arg = i.arg, e.delegate = null, f;\n var a = i.arg;\n return a ? a.done ? (e[r.r] = a.value, e.next = r.n, \"return\" !== e.method && (e.method = \"next\", e.arg = t), e.delegate = null, f) : a : (e.method = \"throw\", e.arg = new TypeError(\"iterator result is not an object\"), e.delegate = null, f);\n }\n function w(t) {\n this.tryEntries.push(t);\n }\n function m(r) {\n var e = r[4] || {};\n e.type = \"normal\", e.arg = t, r[4] = e;\n }\n function Context(t) {\n this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0);\n }\n function x(r) {\n if (null != r) {\n var e = r[i];\n if (e) return e.call(r);\n if (\"function\" == typeof r.next) return r;\n if (!isNaN(r.length)) {\n var o = -1,\n a = function e() {\n for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e;\n return e.value = t, e.done = !0, e;\n };\n return a.next = a;\n }\n }\n throw new TypeError(typeof r + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, \"constructor\", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), r.isGeneratorFunction = function (t) {\n var r = \"function\" == typeof t && t.constructor;\n return !!r && (r === GeneratorFunction || \"GeneratorFunction\" === (r.displayName || r.name));\n }, r.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, \"GeneratorFunction\")), t.prototype = Object.create(v), t;\n }, r.awrap = function (t) {\n return {\n __await: t\n };\n }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {\n return this;\n }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(h(t, e, n, o), i);\n return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, g(v), c(v, u, \"Generator\"), c(v, i, function () {\n return this;\n }), c(v, \"toString\", function () {\n return \"[object Generator]\";\n }), r.keys = function (t) {\n var r = Object(t),\n e = [];\n for (var n in r) e.unshift(n);\n return function t() {\n for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t;\n return t.done = !0, t;\n };\n }, r.values = x, Context.prototype = {\n constructor: Context,\n reset: function (r) {\n if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) \"t\" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t);\n },\n stop: function () {\n this.done = !0;\n var t = this.tryEntries[0][4];\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function (r) {\n if (this.done) throw r;\n var e = this;\n function n(t) {\n a.type = \"throw\", a.arg = r, e.next = t;\n }\n for (var o = e.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i[4],\n u = this.prev,\n c = i[1],\n h = i[2];\n if (-1 === i[0]) return n(\"end\"), !1;\n if (!c && !h) throw Error(\"try statement without catch or finally\");\n if (null != i[0] && i[0] <= u) {\n if (u < c) return this.method = \"next\", this.arg = t, n(c), !0;\n if (u < h) return n(h), !1;\n }\n }\n },\n abrupt: function (t, r) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var n = this.tryEntries[e];\n if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) {\n var o = n;\n break;\n }\n }\n o && (\"break\" === t || \"continue\" === t) && o[0] <= r && r <= o[2] && (o = null);\n var i = o ? o[4] : {};\n return i.type = t, i.arg = r, o ? (this.method = \"next\", this.next = o[2], f) : this.complete(i);\n },\n complete: function (t, r) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && r && (this.next = r), f;\n },\n finish: function (t) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var e = this.tryEntries[r];\n if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;\n }\n },\n catch: function (t) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var e = this.tryEntries[r];\n if (e[0] === t) {\n var n = e[4];\n if (\"throw\" === n.type) {\n var o = n.arg;\n m(e);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function (r, e, n) {\n return this.delegate = {\n i: x(r),\n r: e,\n n: n\n }, \"next\" === this.method && (this.arg = t), f;\n }\n }, r;\n}\n\n/**\n * Must contain only a single child, which it renders as-is.\n * Should not be used outside of an `<If />` block.\n * @param props The props to pass down to the `<Then />` component\n */\nvar Then = function Then(props) {\n return render(props);\n};\n\n/**\n * The MIT License (MIT)\n *\n * Copyright © `2020` `The Sapphire Community and its contributors`\n *\n * Source: https://github.com/sapphiredev/utilities/blob/main/packages/utilities/src/lib/isThenable.ts\n * Full license: https://github.com/sapphiredev/utilities/blob/main/LICENSE.md\n */\n/**\n * Verify if the input is a function.\n * @param input The function to verify\n */\nfunction isFunction(input) {\n return typeof input === 'function';\n}\nfunction hasThen(input) {\n return Reflect.has(input, 'then') && isFunction(input.then);\n}\nfunction hasCatch(input) {\n return Reflect.has(input, 'catch') && isFunction(input[\"catch\"]);\n}\n/**\n * Verify if an object is a promise.\n * @param input The promise to verify\n */\nfunction isThenable(input) {\n if (typeof input !== 'object' || input === null) return false;\n return input instanceof Promise || input !== Promise.prototype && hasThen(input) && hasCatch(input);\n}\n\n/**\n * Compare two arrays without checking for possible nested properties\n * @param a Array to compare with b\n * @param b Array to compare with a\n * @returns True if arrays are identical, false if they are different\n */\nvar shallowArraysEqual = function shallowArraysEqual(a, b) {\n if (!Array.isArray(a) || !Array.isArray(b)) throw new Error('shallowArraysEqual only accepts arrays as parameters');\n if (a.length !== b.length) return false;\n for (var i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n};\n/**\n * Create a CancellablePromise from a native Promise\n * @param promise The promise object to wrap\n * @returns Return value is an object of type CancellablePromise, with 2 properties:\n * - promise: a promise that can be left pending\n * - cancel: the function to use for cancelling the returned promise\n */\nvar createCancellablePromise = function createCancellablePromise(promise) {\n if (!isThenable(promise)) {\n throw new Error('Argument of createCancellablePromise should be a Promise');\n }\n var isCancelled = {\n value: false\n };\n var wrappedPromise = new Promise(/*#__PURE__*/function () {\n var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(res, rej) {\n var d;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return promise;\n case 3:\n d = _context.sent;\n if (!isCancelled.value) {\n res(d);\n }\n _context.next = 10;\n break;\n case 7:\n _context.prev = 7;\n _context.t0 = _context[\"catch\"](0);\n if (!isCancelled.value) {\n rej(_context.t0);\n }\n case 10:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 7]]);\n }));\n return function (_x, _x2) {\n return _ref.apply(this, arguments);\n };\n }());\n // Forward potential additional properties\n Object.keys(promise).forEach(function (key) {\n wrappedPromise[key] = promise[key];\n });\n return {\n promise: wrappedPromise,\n cancel: function cancel() {\n isCancelled.value = true;\n }\n };\n};\n\n/**\n * Calls a function only once during component lifecycle;\n * When dependency array is provided, will call the function again if at least one of the dependencies changed\n * @param callback The function to execute only once\n * @param dependencies A list of dependencies whose value, if changed since last call,\n * will trigger the execution of the callback\n */\nvar useSingleton = function useSingleton(callback, dependencies) {\n if (dependencies === void 0) {\n dependencies = [];\n }\n var hasRan = useRef(false);\n var lastDependencies = useRef([]);\n // Parameters type check\n if (typeof callback !== 'function') {\n throw new Error(\"Incorrect callback parameter for useSingleton hook; expected a function, but got: '\" + typeof callback + \"'.\");\n }\n if (!Array.isArray(dependencies)) {\n throw new Error(\"Incorrect dependencies parameter for useSingleton; expected an array, but got: '\" + typeof dependencies + \"'.\");\n }\n var hasDependencies = Array.isArray(dependencies) && dependencies.length > 0;\n if (hasDependencies) {\n // Has dependencies\n var hasAnyDependencyChanged = !shallowArraysEqual(lastDependencies.current, dependencies);\n if (hasAnyDependencyChanged) {\n // Any dep has changed => overwrite last dependencies and execute callback\n lastDependencies.current = dependencies;\n } else if (hasRan.current) {\n // No dep has changed => same behaviour as if no dependencies\n return;\n }\n } else if (hasRan.current) {\n // No dependencies\n return;\n }\n callback();\n hasRan.current = true;\n};\n\n/**\n * Is included in the `<If />` component, rendered when the condition prop of `<If />` is a Promise;\n * Renders the Fallback component, if contains any, until provided promise is fulfilled;\n * Renders `<Then />` when promise is fulfilled, `<Else />` when rejected\n */\nfunction IfAsync(_ref) {\n var promise = _ref.promise,\n _ref$keepAlive = _ref.keepAlive,\n keepAlive = _ref$keepAlive === void 0 ? false : _ref$keepAlive,\n children = _ref.children;\n var _useState = useState(null),\n isResolved = _useState[0],\n setIsResolved = _useState[1];\n var _useState2 = useState(null),\n returnValue = _useState2[0],\n setReturnValue = _useState2[1];\n // Make promise cancellable\n var cancellablePromise = useMemo(function () {\n return createCancellablePromise(promise);\n }, [promise]);\n var history = useRef([]); // Keep history of promises\n // Handle unmount\n useEffect(function () {\n return function () {\n if (!keepAlive) {\n cancellablePromise.cancel();\n }\n };\n }, [cancellablePromise, cancellablePromise.promise, keepAlive]);\n // Await promise\n useSingleton(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var data;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n setIsResolved(null);\n setReturnValue(null);\n _context.prev = 2;\n _context.next = 5;\n return cancellablePromise.promise;\n case 5:\n data = _context.sent;\n setReturnValue(data);\n setIsResolved(true);\n history.current.push(cancellablePromise);\n _context.next = 16;\n break;\n case 11:\n _context.prev = 11;\n _context.t0 = _context[\"catch\"](2);\n setReturnValue(_context.t0);\n setIsResolved(false);\n history.current.push(cancellablePromise);\n case 16:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[2, 11]]);\n })), [cancellablePromise.promise]);\n if (!children || !isThenable(promise)) {\n return null;\n }\n if (isResolved === null) {\n // Promise is pending\n var hasFallback = React.Children.toArray(children).find(function (c) {\n return c.type === Fallback;\n });\n return React.createElement(Fragment, null, hasFallback || null);\n }\n if (!isResolved) {\n // Promise is fulfilled and rejected\n var hasElse = React.Children.toArray(children).find(function (c) {\n return c.type === Else;\n });\n if (!hasElse) return React.createElement(Fragment, null, null);\n // Inject caught error\n var elseElement = hasElse;\n var hasElseProps = hasElse.props;\n if (typeof hasElseProps.children === 'function') {\n elseElement = _extends({}, hasElse, {\n props: _extends({}, hasElseProps, {\n children: function children() {\n return hasElseProps.children(returnValue, history.current, cancellablePromise.promise);\n }\n })\n });\n }\n return React.createElement(Fragment, null, elseElement);\n }\n // Promise is fulfilled and resolved\n var hasThen = React.Children.toArray(children).find(function (c) {\n return c.type === Then;\n });\n if (!hasThen) return React.createElement(Fragment, null, null);\n // Inject promise return value\n var thenElement = hasThen;\n var hasThenProps = hasThen.props;\n if (typeof hasThenProps.children === 'function') {\n thenElement = _extends({}, hasThen, {\n props: _extends({}, hasThenProps, {\n children: function children() {\n return hasThenProps.children(returnValue, history.current, cancellablePromise.promise);\n }\n })\n });\n }\n return React.createElement(Fragment, null, thenElement);\n}\n\n/**\n * Resolves a condition that is {@link BooleanLike} or returns {@link BooleanLike} from a function\n * @param condition The condition to resolve\n */\nvar getConditionResult = function getConditionResult(condition) {\n var conditionResult = Boolean(typeof condition === 'function' ? condition() : condition);\n return conditionResult;\n};\n\n/**\n * Handles errors by throwing them to the console.\n * `__DEV__` is replaced by dts-cli using {@link https://www.npmjs.com/package/babel-plugin-dev-expression babel-plugin-dev-expressions}\n * which will ensure this entire throw is not present in production\n * @param condition The condition to check\n * @param message The message to throw if `condition` resolves to `true`\n */\nfunction tinyWarning(condition, message) {\n if (process.env.NODE_ENV !== \"production\") {\n if (condition) {\n // check console for IE9 support which provides console\n // only with open devtools\n if (typeof console !== 'undefined') {\n console.warn(message);\n }\n // Throwing an error and catching it immediately to improve debugging\n // Users can utilize 'pause on caught exceptions' to get into this throw\n try {\n throw new Error(message);\n } catch (x) {\n // noop\n }\n }\n }\n}\n\n/**\n * If condition evaluates to true, renders the `<Then />` block will be rendered,\n * otherwise renders the `<Else />` block. Either block may be omitted.\n *\n * This component can contain any number of `<Then />` or `<Else />` blocks,\n * but only the first block of the right type (either Then or Else, depending on the condition) will be rendered.\n * @param __namedParameters The props to pass down to the `<IF />` component, see {@link ComponentWithConditionProps}\n */\nvar If = function If(_ref) {\n var condition = _ref.condition,\n _ref$keepAlive = _ref.keepAlive,\n keepAlive = _ref$keepAlive === void 0 ? false : _ref$keepAlive,\n children = _ref.children;\n if (!children) {\n return null;\n }\n tinyWarning(!Array.isArray(children) && !(children.type === Else || children.type === Then) || !React__default.Children.toArray(children).every(function (child) {\n return child.type === Else || child.type === Then || child.type === Fallback;\n }), 'The <If> component should contain <Then /> <Else /> or <Fallback /> components as its children');\n if (isThenable(condition)) {\n return React__default.createElement(IfAsync, {\n promise: condition,\n keepAlive: keepAlive\n }, children);\n }\n var conditionResult = getConditionResult(condition);\n return React__default.createElement(Fragment, null, React__default.Children.toArray(children).find(function (c) {\n return c.type !== Else !== !conditionResult;\n }) || null);\n};\n\n/**\n * It will render the first matching `<Case />`, or the first encountered `<Default />` (or `null`).\n *\n * This component can contain any number of `<Case />` and one `<Default />` blocks\n * @param __namedParameters Children to pass into the `<Switch />` component\n */\nvar Switch = function Switch(_ref) {\n var _ref2;\n var children = _ref.children;\n // -- Inspired by react-router --\n // We use React.Children.forEach instead of React.Children.toArray().find()\n // here because toArray adds keys to all child elements and we do not want\n // to trigger an unmount/remount for two children <Case>s or <Default>s\n var matchingCase = undefined;\n var defaultCase = undefined;\n // If the children are a function then resolve it first\n if (isFunction(children)) {\n children = children();\n }\n React.Children.forEach(children, function (child) {\n // not a valid react child, don't add it\n /* istanbul ignore next - This is only a safe fail for people writing bad code */\n if (!React.isValidElement(child)) {\n return;\n }\n if (!matchingCase && child.type === Case) {\n var childProps = child.props;\n var conditionResult = getConditionResult(childProps.condition);\n if (conditionResult) {\n matchingCase = child;\n } // else not matching condition, don't add it\n } else if (!defaultCase && child.type === Default) {\n defaultCase = child;\n } // else unknown type, don't add it\n });\n return (_ref2 = matchingCase != null ? matchingCase : defaultCase) != null ? _ref2 : null;\n};\n\n/** A shorthand for\n *\n * ```jsx\n * <If condition={...}>\n * <Else>\n * { ... }\n * </Else>\n * </If>\n * ```\n *\n * The same rules apply to the child elements as with using the `<Else />` block.\n *\n * @param __namedParameters The props to pass down to the `<IF />` component, see {@link ComponentWithConditionProps}\n */\nvar Unless = function Unless(_ref) {\n var condition = _ref.condition,\n _ref$children = _ref.children,\n children = _ref$children === void 0 ? null : _ref$children;\n var conditionResult = Boolean(getConditionResult(condition));\n return !conditionResult && children ? render({\n children: children\n }) : null;\n};\n\n/** A shorthand for\n *\n * ```jsx\n * <If condition={...}>\n * <Then>\n * { ... }\n * </Then>\n * </If>\n * ```\n *\n * The same rules apply to the child elements as with using the `<Then /`> block.\n *\n * @param __namedParameters The props to pass down to the `<IF />` component, see {@link ComponentWithConditionProps}\n */\nvar When = function When(_ref) {\n var condition = _ref.condition,\n _ref$children = _ref.children,\n children = _ref$children === void 0 ? null : _ref$children;\n var conditionResult = Boolean(getConditionResult(condition));\n return conditionResult && children ? render({\n children: children\n }) : null;\n};\n\nexport { Case, Default, Else, Fallback, If, Switch, Then, Unless, When };\n//# sourceMappingURL=react-if.esm.js.map\n"],"names":["render","React__default","Case","Default","getConditionResult","Switch","React","When"],"mappings":";;AAOA,IAAI,SAAS,SAASA,QAAO,OAAO;AAClC,MAAI,OAAO,MAAM,aAAa,YAAY;AACxC,WAAOC,sBAAe,cAAc,UAAU,MAAM,MAAM,SAAQ,CAAE;AAAA,EACrE;AACD,SAAOA,sBAAe,cAAc,UAAU,MAAM,MAAM,YAAY,IAAI;AAC5E;AAOG,IAAC,OAAO,SAASC,MAAK,MAAM;AAC7B,MAAI,gBAAgB,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,CAAA,IAAI;AACP;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consumidor-positivo/aurora",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.195",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.es.js",
|
|
7
7
|
"modules": "./dist/main.es.js",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"dotenv": "16.4.5",
|
|
46
46
|
"react-aria-components": "1.3.3",
|
|
47
|
+
"react-if": "4.1.6",
|
|
47
48
|
"vite-plugin-dts": "4.0.0-beta.1"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|