@anker-in/headless-ui 0.0.27-alpha.5 → 0.0.27-alpha.7
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/cjs/biz-components/AccordionCards/index.d.ts +25 -0
- package/dist/cjs/biz-components/AccordionCards/index.js +2 -0
- package/dist/cjs/biz-components/AccordionCards/index.js.map +7 -0
- package/dist/cjs/biz-components/Graphic/index.d.ts +15 -0
- package/dist/cjs/biz-components/Graphic/index.js +2 -0
- package/dist/cjs/biz-components/Graphic/index.js.map +7 -0
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +2 -2
- package/dist/cjs/biz-components/index.d.ts +2 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/button.d.ts +1 -1
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/stories/accordionCards.stories.d.ts +28 -0
- package/dist/cjs/stories/accordionCards.stories.js +2 -0
- package/dist/cjs/stories/accordionCards.stories.js.map +7 -0
- package/dist/cjs/stories/button.stories.d.ts +3 -1
- package/dist/cjs/stories/button.stories.js +1 -1
- package/dist/cjs/stories/button.stories.js.map +3 -3
- package/dist/cjs/stories/graphic.stories.d.ts +49 -0
- package/dist/cjs/stories/graphic.stories.js +2 -0
- package/dist/cjs/stories/graphic.stories.js.map +7 -0
- package/dist/esm/biz-components/AccordionCards/index.d.ts +25 -0
- package/dist/esm/biz-components/AccordionCards/index.js +2 -0
- package/dist/esm/biz-components/AccordionCards/index.js.map +7 -0
- package/dist/esm/biz-components/Graphic/index.d.ts +15 -0
- package/dist/esm/biz-components/Graphic/index.js +2 -0
- package/dist/esm/biz-components/Graphic/index.js.map +7 -0
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +2 -2
- package/dist/esm/biz-components/index.d.ts +2 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +2 -2
- package/dist/esm/components/button.d.ts +1 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/stories/accordionCards.stories.d.ts +28 -0
- package/dist/esm/stories/accordionCards.stories.js +2 -0
- package/dist/esm/stories/accordionCards.stories.js.map +7 -0
- package/dist/esm/stories/button.stories.d.ts +3 -1
- package/dist/esm/stories/button.stories.js +1 -1
- package/dist/esm/stories/button.stories.js.map +3 -3
- package/dist/esm/stories/graphic.stories.d.ts +49 -0
- package/dist/esm/stories/graphic.stories.js +2 -0
- package/dist/esm/stories/graphic.stories.js.map +7 -0
- package/package.json +2 -2
- package/style.css +57 -18
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/AccordionCards/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { cn } from '../../helpers/utils'\nimport Picture from '../../components/picture'\nimport Button from '../../components/button'\nimport { useState, useEffect, useRef } from 'react';\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\nfunction useWindowWidth() {\n const [width, setWidth] = useState(window?.innerWidth || 0);\n useEffect(() => {\n const onResize = () => setWidth(window?.innerWidth || 0);\n window?.addEventListener('resize', onResize);\n return () => window?.removeEventListener('resize', onResize);\n }, []);\n return width <= 768;\n}\n\ntype AccordionCardsType = {\n products: Array<{\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: string\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n }>\n className?: string\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: {\n onClick: (v: any) => void\n },\n },\n}\n\nconst AccordionCards = ({\n products = [],\n className = '',\n shape = 'square',\n itemShape = 'square',\n event,\n primaryButton = '',\n}: AccordionCardsType) => {\n const isMobile = useWindowWidth();\n const [hoverIndex, setHoverIndex] = useState<number | null>(null);\n const [currentWidth, setCurrentWidth] = useState<{ [key: number]: boolean }>({});\n\n const accordionRef = useRef<HTMLDivElement[]>([])\n const refWidth = useRef<{ [key: number]: boolean }>({});\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el;\n }\n };\n\n const handleTransitionEnd = (index: number) => {\n const current = { ...refWidth.current, [index]: true }\n setCurrentWidth(current)\n refWidth.current = current\n };\n\n useEffect(() => {\n const element = accordionRef.current;\n element?.forEach((item, index) => {\n item.addEventListener('transitionend', ()=>handleTransitionEnd(index)); \n })\n return () => {\n element?.forEach((item, index) => {\n item.removeEventListener('transitionend', ()=>handleTransitionEnd(index)); \n })\n };\n }, [])\n\n // \u79FB\u52A8\u7AEF\n if (isMobile) {\n return (\n <div className={cn(\"flex gap-4 overflow-x-auto w-full h-[400px]\", className)}>\n {products?.map((item, idx) => (\n <div\n key={idx}\n className=\"grow-0 shrink-0 basis-[296px] bg-[#FFFFFF] border border-solid border-[#dddddd]\"\n >\n <Picture\n className=\"w-full h-full object-cover [&_img]:h-full [&_img]:object-cover\"\n source={item?.img}\n />\n </div>\n ))}\n </div>\n );\n }\n\n // \u684C\u9762\u7AEF\n return (\n <div className={cn(\"h-[336px] gap-4 flex w-full overflow-hidden laptop:h-[448px] desktop:h-[560px]\", className)}>\n {products?.map((item, idx) => {\n const isExpanded = hoverIndex === idx;\n const flexValue = isExpanded ? 6 : 1;\n return (\n <div\n key={idx}\n style={{\n flex: flexValue,\n transition: 'all 0.3s ease-in-out',\n }}\n ref={(el) => el && getRef(idx, el)}\n className={cn(\n 'relative overflow-hidden cursor-pointer',\n itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n onMouseEnter={() => setHoverIndex(idx)}\n onMouseLeave={() => {\n setHoverIndex(null)\n const current = { ...refWidth.current, [idx]: false }\n setCurrentWidth(current)\n refWidth.current = current\n }}\n >\n <Picture\n source={item?.img}\n className=\"w-full h-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n {\n currentWidth?.[idx] ?\n <div className={cn(\n 'absolute left-0 right-0 bottom-0 px-6 pb-6 overflow-hidden flex justify-between items-end',\n 'transition-all duration-[50ms] delay-[300ms]',\n isExpanded ? 'opacity-100' : 'opacity-0'\n )}>\n <div className=\"mr-1 flex-1 overflow-hidden\">\n <p className=\"mb-1 text-xl font-bold text-[#FFFFFF] laptop:text-2xl desktop:text-[32px]\">{item?.title}</p>\n <h3 className=\"text-sm font-medium text-[#FFFFFF] desktop:text-lg\">{item?.subTitle}</h3>\n </div>\n <Button\n size=\"sm\"\n hoverEffect=\"slide\"\n variant=\"secondary\"\n onClick={() => event?.primaryButton?.onClick?.(item)}\n className={cn(\n 'mb-1.5 overflow-hidden bg-transparent text-[#FFFFFF] font-bold text-sm desktop:text-base',\n shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n {primaryButton}\n </Button>\n </div>: null\n }\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default AccordionCards\n"],
|
|
5
|
+
"mappings": "AAwFwB,cAAAA,EA+CY,QAAAC,MA/CZ,oBAxFxB,OAAS,MAAAC,MAAU,sBACnB,OAAOC,MAAa,2BACpB,OAAOC,MAAY,0BACnB,OAAS,YAAAC,EAAU,aAAAC,EAAW,UAAAC,MAAc,QAG5C,SAASC,GAAiB,CACtB,KAAM,CAACC,EAAOC,CAAQ,EAAIL,EAAS,QAAQ,YAAc,CAAC,EAC1D,OAAAC,EAAU,IAAM,CACZ,MAAMK,EAAW,IAAMD,EAAS,QAAQ,YAAc,CAAC,EACvD,eAAQ,iBAAiB,SAAUC,CAAQ,EACpC,IAAM,QAAQ,oBAAoB,SAAUA,CAAQ,CAC/D,EAAG,CAAC,CAAC,EACEF,GAAS,GACpB,CA0BA,MAAMG,EAAiB,CAAC,CACpB,SAAAC,EAAW,CAAC,EACZ,UAAAC,EAAY,GACZ,MAAAC,EAAQ,SACR,UAAAC,EAAY,SACZ,MAAAC,EACA,cAAAC,EAAgB,EACpB,IAA0B,CACtB,MAAMC,EAAWX,EAAe,EAC1B,CAACY,EAAYC,CAAa,EAAIhB,EAAwB,IAAI,EAC1D,CAACiB,EAAcC,CAAe,EAAIlB,EAAqC,CAAC,CAAC,EAEzEmB,EAAejB,EAAyB,CAAC,CAAC,EAC1CkB,EAAWlB,EAAmC,CAAC,CAAC,EAEhDmB,EAAS,CAACC,EAAeC,IAAuB,CAC9CA,IACAJ,EAAa,QAAQG,CAAK,EAAIC,EAEtC,EAEMC,EAAuBF,GAAkB,CAC3C,MAAMG,EAAU,CAAE,GAAGL,EAAS,QAAS,CAACE,CAAK,EAAG,EAAK,EACrDJ,EAAgBO,CAAO,EACvBL,EAAS,QAAUK,CACvB,EAeA,OAbAxB,EAAU,IAAM,CACZ,MAAMyB,EAAUP,EAAa,QAC7B,OAAAO,GAAS,QAAQ,CAACC,EAAML,IAAU,CAC9BK,EAAK,iBAAiB,gBAAiB,IAAIH,EAAoBF,CAAK,CAAC,CACzE,CAAC,EACM,IAAM,CACTI,GAAS,QAAQ,CAACC,EAAML,IAAU,CAC9BK,EAAK,oBAAoB,gBAAiB,IAAIH,EAAoBF,CAAK,CAAC,CAC5E,CAAC,CACL,CACJ,EAAG,CAAC,CAAC,EAGDR,EAEInB,EAAC,OAAI,UAAWE,EAAG,8CAA+CY,CAAS,EACtE,SAAAD,GAAU,IAAI,CAACmB,EAAMC,IAClBjC,EAAC,OAEG,UAAU,kFAEV,SAAAA,EAACG,EAAA,CACG,UAAU,iEACV,OAAQ6B,GAAM,IAClB,GANKC,CAOT,CACH,EACL,EAMJjC,EAAC,OAAI,UAAWE,EAAG,iFAAkFY,CAAS,EACzG,SAAAD,GAAU,IAAI,CAACmB,EAAMC,IAAQ,CAC1B,MAAMC,EAAad,IAAea,EAElC,OACIhC,EAAC,OAEG,MAAO,CACH,KALMiC,EAAa,EAAI,EAMvB,WAAY,sBAChB,EACA,IAAMN,GAAOA,GAAMF,EAAOO,EAAKL,CAAE,EACjC,UAAW1B,EACP,0CACAc,IAAc,QAAU,cAAgB,EAC5C,EACA,aAAc,IAAMK,EAAcY,CAAG,EACrC,aAAc,IAAM,CAChBZ,EAAc,IAAI,EAClB,MAAMS,EAAU,CAAE,GAAGL,EAAS,QAAS,CAACQ,CAAG,EAAG,EAAM,EACpDV,EAAgBO,CAAO,EACvBL,EAAS,QAAUK,CACvB,EAEA,UAAA9B,EAACG,EAAA,CACG,OAAQ6B,GAAM,IACd,UAAU,iEACd,EAEIV,IAAeW,CAAG,EACdhC,EAAC,OAAI,UAAWC,EACZ,4FACA,+CACAgC,EAAa,cAAgB,WACjC,EACI,UAAAjC,EAAC,OAAI,UAAU,8BACX,UAAAD,EAAC,KAAE,UAAU,4EAA6E,SAAAgC,GAAM,MAAM,EACtGhC,EAAC,MAAG,UAAU,qDAAsD,SAAAgC,GAAM,SAAS,GACvF,EACAhC,EAACI,EAAA,CACG,KAAK,KACL,YAAY,QACZ,QAAQ,YACR,QAAS,IAAMa,GAAO,eAAe,UAAUe,CAAI,EACnD,UAAW9B,EACP,2FACAa,IAAU,QAAU,cAAgB,EACxC,EAEC,SAAAG,EACL,GACJ,EAAQ,OA7CXe,CA+CT,CAER,CAAC,EACL,CAER,EAEA,IAAOE,EAAQvB",
|
|
6
|
+
"names": ["jsx", "jsxs", "cn", "Picture", "Button", "useState", "useEffect", "useRef", "useWindowWidth", "width", "setWidth", "onResize", "AccordionCards", "products", "className", "shape", "itemShape", "event", "primaryButton", "isMobile", "hoverIndex", "setHoverIndex", "currentWidth", "setCurrentWidth", "accordionRef", "refWidth", "getRef", "index", "el", "handleTransitionEnd", "current", "element", "item", "idx", "isExpanded", "AccordionCards_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface GraphicProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
items: {
|
|
5
|
+
imgUrl: string;
|
|
6
|
+
title: string;
|
|
7
|
+
textColor?: string;
|
|
8
|
+
}[];
|
|
9
|
+
shape?: 'round' | 'square';
|
|
10
|
+
}
|
|
11
|
+
declare const _default: {
|
|
12
|
+
(props: Omit<GraphicProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as k}from"react/jsx-runtime";import p,{useMemo as d}from"react";import{cn as a}from"../../helpers/utils";import{withStyles as f}from"../../shared/Styles.js";import{Carousel as u,CarouselContent as g,CarouselItem as h}from"../../components";import{Picture as b,Text as C}from"../../components";const r=p.forwardRef(({items:o,shape:i,className:n,...m},x)=>{const l=o?.length||0,c=d(()=>{const s="basis-[296px]";let t="";return l===1&&(t="basis-[100%]"),l===2&&(t="tablet:basis-1/2"),l===3&&(t="laptop:basis-1/3"),l>3&&(t="laptop:basis-[288px] desktop:basis-[316px] lg-desktop:basis-[404px]"),`${s} ${t}`},[l]);return e(u,{ref:x,opts:{align:"start"},className:a("px-4 tablet:px-8 laptop:px-16",n),...m,children:e(p.Fragment,{children:e(g,{children:o.map((s,t)=>e(h,{className:a("pl-3 laptop:pl-4 flex-shrink-0 h-[360px]",c),children:k("div",{className:a("relative h-full",{"rounded-xl overflow-hidden laptop:rounded-2xl":i==="round"}),children:[e(b,{className:"h-full ",imgClassName:"h-full object-cover",source:s?.imgUrl}),e("div",{className:"p-4 absolute inset-0 laptop:p-6 flex flex-col justify-end z-[1]",children:e(C,{html:s?.title,style:{color:s?.textColor},className:"text-[24px] lg-desktop:text-[32px] font-bold leading-[1.2] [&_span]:font-medium desktop:text-[24px] desktop:[&_span]:text-[18px] [&_span]:text-[14px] text-lines-2"})})]})},t+s?.title))})},".0")})});r.displayName="Graphic";var S=f(r);export{S as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/Graphic/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { useMemo } from 'react'\nimport { cn } from '../../helpers/utils'\nimport { withStyles } from '../../shared/Styles.js'\nimport { Carousel, CarouselContent, CarouselItem } from '../../components'\nimport { Picture, Text } from '../../components'\n\nexport interface GraphicProps {\n className?: string\n items: {\n imgUrl: string\n title: string\n textColor?: string\n }[]\n shape?: 'round' | 'square'\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ items, shape, className, ...props }, ref) => {\n const itemsLength = items?.length || 0\n\n const itemStyle = useMemo(() => {\n const basisStyle = 'basis-[296px]'\n let breakPointStyle = ''\n if (itemsLength === 1) {\n breakPointStyle = 'basis-[100%]'\n }\n if (itemsLength === 2) {\n breakPointStyle = 'tablet:basis-1/2'\n }\n if (itemsLength === 3) {\n breakPointStyle = 'laptop:basis-1/3'\n }\n if (itemsLength > 3) {\n breakPointStyle = 'laptop:basis-[288px] desktop:basis-[316px] lg-desktop:basis-[404px]'\n }\n return `${basisStyle} ${breakPointStyle}`\n }, [itemsLength])\n\n return (\n <Carousel\n ref={ref}\n opts={{\n align: 'start',\n }}\n className={cn('px-4 tablet:px-8 laptop:px-16', className)}\n {...props}\n >\n <React.Fragment key=\".0\">\n <CarouselContent>\n {items.map((item, index) => (\n <CarouselItem\n key={index + item?.title}\n className={cn('pl-3 laptop:pl-4 flex-shrink-0 h-[360px]', itemStyle)}\n >\n <div className={cn(\"relative h-full\", {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: shape === 'round'\n })}>\n <Picture className=\"h-full \" imgClassName=\"h-full object-cover\" source={item?.imgUrl} />\n <div className=\"p-4 absolute inset-0 laptop:p-6 flex flex-col justify-end z-[1]\">\n <Text\n html={item?.title}\n style={{\n color: item?.textColor,\n }}\n className=\"text-[24px] lg-desktop:text-[32px] font-bold leading-[1.2] [&_span]:font-medium desktop:text-[24px] desktop:[&_span]:text-[18px] [&_span]:text-[14px] text-lines-2\"\n />\n </div>\n </div>\n </CarouselItem>\n ))}\n </CarouselContent>\n </React.Fragment>\n </Carousel>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withStyles(Graphic)\n"],
|
|
5
|
+
"mappings": "AAqDc,OAGE,OAAAA,EAHF,QAAAC,MAAA,oBArDd,OAAOC,GAAS,WAAAC,MAAe,QAC/B,OAAS,MAAAC,MAAU,sBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,YAAAC,EAAU,mBAAAC,EAAiB,gBAAAC,MAAoB,mBACxD,OAAS,WAAAC,EAAS,QAAAC,MAAY,mBAY9B,MAAMC,EAAUT,EAAM,WAAyC,CAAC,CAAE,MAAAU,EAAO,MAAAC,EAAO,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAAQ,CAC7G,MAAMC,EAAcL,GAAO,QAAU,EAE/BM,EAAYf,EAAQ,IAAM,CAC9B,MAAMgB,EAAa,gBACnB,IAAIC,EAAkB,GACtB,OAAIH,IAAgB,IAClBG,EAAkB,gBAEhBH,IAAgB,IAClBG,EAAkB,oBAEhBH,IAAgB,IAClBG,EAAkB,oBAEhBH,EAAc,IAChBG,EAAkB,uEAEb,GAAGD,CAAU,IAAIC,CAAe,EACzC,EAAG,CAACH,CAAW,CAAC,EAEhB,OACEjB,EAACM,EAAA,CACC,IAAKU,EACL,KAAM,CACJ,MAAO,OACT,EACA,UAAWZ,EAAG,gCAAiCU,CAAS,EACvD,GAAGC,EAEJ,SAAAf,EAACE,EAAM,SAAN,CACC,SAAAF,EAACO,EAAA,CACE,SAAAK,EAAM,IAAI,CAACS,EAAMC,IAChBtB,EAACQ,EAAA,CAEC,UAAWJ,EAAG,2CAA4Cc,CAAS,EAEnE,SAAAjB,EAAC,OAAI,UAAWG,EAAG,kBAAmB,CACnC,gDAAkDS,IAAU,OAC/D,CAAC,EACC,UAAAb,EAACS,EAAA,CAAQ,UAAU,UAAU,aAAa,sBAAsB,OAAQY,GAAM,OAAQ,EACtFrB,EAAC,OAAI,UAAU,kEACb,SAAAA,EAACU,EAAA,CACC,KAAMW,GAAM,MACZ,MAAO,CACL,MAAOA,GAAM,SACf,EACA,UAAU,qKACZ,EACF,GACF,GAhBKC,EAAQD,GAAM,KAiBrB,CACD,EACH,GAvBkB,IAwBpB,EACF,CAEJ,CAAC,EAEDV,EAAQ,YAAc,UAEtB,IAAOY,EAAQlB,EAAWM,CAAO",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "useMemo", "cn", "withStyles", "Carousel", "CarouselContent", "CarouselItem", "Picture", "Text", "Graphic", "items", "shape", "className", "props", "ref", "itemsLength", "itemStyle", "basisStyle", "breakPointStyle", "item", "index", "Graphic_default"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import m from"react";import{Button as c,Text as N}from"../../components/index.js";import{cn as a}from"../../helpers/index.js";import{withStyles as k}from"../../shared/Styles.js";const
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import m from"react";import{Button as c,Text as N}from"../../components/index.js";import{cn as a}from"../../helpers/index.js";import{withStyles as k}from"../../shared/Styles.js";const p=m.forwardRef(({title:x,subtitle:d,background:g,primaryButton:n,secondaryButton:l,theme:t="light",className:b,products:i=[]},f)=>{const o=t==="dark"?"text-white":"text-[#1D1D1F]",v=t==="dark"?"bg-white":"bg-[#1D1D1F]";return r("div",{ref:f,className:a("relative flex min-h-[720px] w-full flex-col justify-between overflow-hidden bg-cover bg-center bg-no-repeat",b),style:{backgroundImage:`url(${g})`},children:[r("div",{className:"relative z-10 flex flex-col gap-8 px-32 pt-[307px]",children:[r("div",{className:"max-w-[686px] space-y-4",children:[e("h1",{className:a("hero-banner-title font-mont text-[64px] font-bold leading-none tracking-[-0.04em]",o),children:x}),e("p",{className:a("hero-banner-subtitle text-lg font-medium leading-[1.2] tracking-[-0.02em]",o),children:d})]}),r("div",{className:"flex items-center gap-4",children:[l&&e(c,{size:"lg",variant:"primary",theme:t,className:"hero-banner-primary-button",...l,children:l.text}),n&&e(c,{size:"lg",variant:"secondary",theme:t,...n,className:"hero-banner-secondary-button bg-transparent border-black text-black hover:bg-black hover:text-white",children:n.text})]})]}),i.length>0&&e("div",{className:"relative z-10 flex items-center gap-3 px-32 pb-6",children:i.map((h,s)=>r(m.Fragment,{children:[e(N,{className:a("hero-banner-product-text text-sm font-medium leading-[1.2] tracking-[-0.02em]",t==="dark"?"text-white":"text-[#1D1D1F]"),children:h.title}),s<i.length-1&&e("div",{className:a("h-4 w-px",v)})]},s))})]})});p.displayName="HeroBanner";var F=k(p);export{F as default};
|
|
2
2
|
//# sourceMappingURL=HeroBanner.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/HeroBanner/HeroBanner.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from \"react\"\nimport type { HeroBannerProps } from \"./types.js\"\nimport { Button, Text } from \"../../components/index.js\"\nimport { cn } from \"../../helpers/index.js\"\nimport { withStyles } from \"../../shared/Styles.js\"\n\nconst HeroBanner = React.forwardRef<HTMLDivElement, HeroBannerProps>(\n ({ \n title, \n subtitle, \n background,\n primaryButton,\n secondaryButton,\n theme = \"light\",\n className,\n products = [] \n }, ref) => {\n const textColorClass = theme === \"dark\" ? \"text-white\" : \"text-[#1D1D1F]\"\n const dividerColorClass = theme === \"dark\" ? \"bg-white\" : \"bg-[#1D1D1F]\"\n\n return (\n <div \n ref={ref} \n className={cn(\n \"relative flex min-h-[720px] w-full flex-col justify-between overflow-hidden bg-cover bg-center bg-no-repeat\",\n className\n )}\n style={{ backgroundImage: `url(${background})` }}\n >\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"relative z-10 flex flex-col gap-8 px-32 pt-[307px]\">\n <div className=\"max-w-[686px] space-y-4\">\n <h1 className={cn(\n \"hero-banner-title font-mont text-[64px] font-bold leading-none tracking-[-0.04em]\",\n textColorClass\n )}>\n {title}\n </h1>\n <p className={cn(\n \"hero-banner-subtitle text-lg font-medium leading-[1.2] tracking-[-0.02em]\",\n textColorClass\n )}>\n {subtitle}\n </p>\n </div>\n \n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"flex items-center gap-4\">\n {secondaryButton && (\n <Button\n size=\"lg\"\n variant=\"
|
|
5
|
-
"mappings": "AA+BU,OACE,OAAAA,EADF,QAAAC,MAAA,oBA/BV,OAAOC,MAAW,QAElB,OAAS,UAAAC,EAAQ,QAAAC,MAAY,4BAC7B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAE3B,MAAMC,EAAaL,EAAM,WACvB,CAAC,CACC,MAAAM,EACA,SAAAC,EACA,WAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,MAAAC,EAAQ,QACR,UAAAC,EACA,SAAAC,EAAW,CAAC,CACd,EAAGC,IAAQ,CACT,MAAMC,EAAiBJ,IAAU,OAAS,aAAe,iBACnDK,EAAoBL,IAAU,OAAS,WAAa,eAE1D,OACEZ,EAAC,OACC,IAAKe,EACL,UAAWX,EACT,8GACAS,CACF,EACA,MAAO,CAAE,gBAAiB,OAAOJ,CAAU,GAAI,EAG/C,UAAAT,EAAC,OAAI,UAAU,qDACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAAC,MAAG,UAAWK,EACb,oFACAY,CACF,EACG,SAAAT,EACH,EACAR,EAAC,KAAE,UAAWK,EACZ,4EACAY,CACF,EACG,SAAAR,EACH,GACF,EAGAR,EAAC,OAAI,UAAU,0BACZ,UAAAW,GACCZ,EAACG,EAAA,CACC,KAAK,KACL,QAAQ,
|
|
4
|
+
"sourcesContent": ["import React from \"react\"\nimport type { HeroBannerProps } from \"./types.js\"\nimport { Button, Text } from \"../../components/index.js\"\nimport { cn } from \"../../helpers/index.js\"\nimport { withStyles } from \"../../shared/Styles.js\"\n\nconst HeroBanner = React.forwardRef<HTMLDivElement, HeroBannerProps>(\n ({ \n title, \n subtitle, \n background,\n primaryButton,\n secondaryButton,\n theme = \"light\",\n className,\n products = [] \n }, ref) => {\n const textColorClass = theme === \"dark\" ? \"text-white\" : \"text-[#1D1D1F]\"\n const dividerColorClass = theme === \"dark\" ? \"bg-white\" : \"bg-[#1D1D1F]\"\n\n return (\n <div \n ref={ref} \n className={cn(\n \"relative flex min-h-[720px] w-full flex-col justify-between overflow-hidden bg-cover bg-center bg-no-repeat\",\n className\n )}\n style={{ backgroundImage: `url(${background})` }}\n >\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"relative z-10 flex flex-col gap-8 px-32 pt-[307px]\">\n <div className=\"max-w-[686px] space-y-4\">\n <h1 className={cn(\n \"hero-banner-title font-mont text-[64px] font-bold leading-none tracking-[-0.04em]\",\n textColorClass\n )}>\n {title}\n </h1>\n <p className={cn(\n \"hero-banner-subtitle text-lg font-medium leading-[1.2] tracking-[-0.02em]\",\n textColorClass\n )}>\n {subtitle}\n </p>\n </div>\n \n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"flex items-center gap-4\">\n {secondaryButton && (\n <Button\n size=\"lg\"\n variant=\"primary\"\n theme={theme}\n className=\"hero-banner-primary-button\"\n {...secondaryButton}\n >\n {secondaryButton.text}\n </Button>\n )}\n {primaryButton && (\n <Button\n size=\"lg\"\n variant=\"secondary\"\n theme={theme}\n {...primaryButton}\n className=\"hero-banner-secondary-button bg-transparent border-black text-black hover:bg-black hover:text-white\"\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n </div>\n\n {/* \u5E95\u90E8\u4EA7\u54C1\u5217\u8868 */}\n {products.length > 0 && (\n <div className=\"relative z-10 flex items-center gap-3 px-32 pb-6\">\n {products.map((product, index) => (\n <React.Fragment key={index}>\n <Text\n className={cn(\n \"hero-banner-product-text text-sm font-medium leading-[1.2] tracking-[-0.02em]\",\n theme === \"dark\" ? \"text-white\" : \"text-[#1D1D1F]\"\n )}\n >\n {product.title}\n </Text>\n {index < products.length - 1 && (\n <div className={cn(\"h-4 w-px\", dividerColorClass)} />\n )}\n </React.Fragment>\n ))}\n </div>\n )}\n </div>\n )\n }\n)\n\nHeroBanner.displayName = \"HeroBanner\"\n\nexport default withStyles(HeroBanner)\n\n\n"],
|
|
5
|
+
"mappings": "AA+BU,OACE,OAAAA,EADF,QAAAC,MAAA,oBA/BV,OAAOC,MAAW,QAElB,OAAS,UAAAC,EAAQ,QAAAC,MAAY,4BAC7B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAE3B,MAAMC,EAAaL,EAAM,WACvB,CAAC,CACC,MAAAM,EACA,SAAAC,EACA,WAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,MAAAC,EAAQ,QACR,UAAAC,EACA,SAAAC,EAAW,CAAC,CACd,EAAGC,IAAQ,CACT,MAAMC,EAAiBJ,IAAU,OAAS,aAAe,iBACnDK,EAAoBL,IAAU,OAAS,WAAa,eAE1D,OACEZ,EAAC,OACC,IAAKe,EACL,UAAWX,EACT,8GACAS,CACF,EACA,MAAO,CAAE,gBAAiB,OAAOJ,CAAU,GAAI,EAG/C,UAAAT,EAAC,OAAI,UAAU,qDACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAAC,MAAG,UAAWK,EACb,oFACAY,CACF,EACG,SAAAT,EACH,EACAR,EAAC,KAAE,UAAWK,EACZ,4EACAY,CACF,EACG,SAAAR,EACH,GACF,EAGAR,EAAC,OAAI,UAAU,0BACZ,UAAAW,GACCZ,EAACG,EAAA,CACC,KAAK,KACL,QAAQ,UACR,MAAOU,EACP,UAAU,6BACT,GAAGD,EAEH,SAAAA,EAAgB,KACnB,EAEDD,GACCX,EAACG,EAAA,CACC,KAAK,KACL,QAAQ,YACR,MAAOU,EACN,GAAGF,EACJ,UAAU,sGAET,SAAAA,EAAc,KACjB,GAEJ,GACF,EAGCI,EAAS,OAAS,GACjBf,EAAC,OAAI,UAAU,mDACZ,SAAAe,EAAS,IAAI,CAACI,EAASC,IACtBnB,EAACC,EAAM,SAAN,CACC,UAAAF,EAACI,EAAA,CACC,UAAWC,EACT,gFACAQ,IAAU,OAAS,aAAe,gBACpC,EAEC,SAAAM,EAAQ,MACX,EACCC,EAAQL,EAAS,OAAS,GACzBf,EAAC,OAAI,UAAWK,EAAG,WAAYa,CAAiB,EAAG,IAVlCE,CAYrB,CACD,EACH,GAEJ,CAEJ,CACF,EAEAb,EAAW,YAAc,aAEzB,IAAOc,EAAQf,EAAWC,CAAU",
|
|
6
6
|
"names": ["jsx", "jsxs", "React", "Button", "Text", "cn", "withStyles", "HeroBanner", "title", "subtitle", "background", "primaryButton", "secondaryButton", "theme", "className", "products", "ref", "textColorClass", "dividerColorClass", "product", "index", "HeroBanner_default"]
|
|
7
7
|
}
|
|
@@ -6,4 +6,6 @@ export { default as ShelfDisplay } from './ShelfDisplay/index.js';
|
|
|
6
6
|
export { default as Evaluate } from './Evaluate/index.js';
|
|
7
7
|
export { default as Category } from './Category/index.js';
|
|
8
8
|
export { default as HeroBanner } from './HeroBanner/index.js';
|
|
9
|
+
export { default as AccordionCards } from './AccordionCards/index.js';
|
|
10
|
+
export { default as Graphic } from './Graphic/index.js';
|
|
9
11
|
export * from './Marquee';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{default as
|
|
1
|
+
import{default as e}from"./Shelf/index.js";import{default as t}from"./BrandEquity/index.js";import{default as l}from"./MemberEquity/index.js";import{default as p}from"./Slogan/index.js";import{default as m}from"./ShelfDisplay/index.js";import{default as x}from"./Evaluate/index.js";import{default as n}from"./Category/index.js";import{default as c}from"./HeroBanner/index.js";import{default as E}from"./AccordionCards/index.js";import{default as g}from"./Graphic/index.js";export*from"./Marquee";export{E as AccordionCards,t as BrandEquity,n as Category,x as Evaluate,g as Graphic,c as HeroBanner,l as MemberEquity,e as Shelf,m as ShelfDisplay,p as Slogan};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/biz-components/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as Shelf } from './Shelf/index.js'\nexport { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\
|
|
5
|
-
"mappings": "AAAA,OAAoB,WAAXA,MAAwB,mBACjC,OAAoB,WAAXA,MAA8B,yBACvC,OAAoB,WAAXA,MAA+B,0BACxC,OAAoB,WAAXA,MAAyB,oBAClC,OAAoB,WAAXA,MAA+B,0BACxC,OAAoB,WAAXA,MAA2B,sBACpC,OAAoB,WAAXA,MAA2B,sBACpC,OAAoB,WAAXA,MAA6B,
|
|
4
|
+
"sourcesContent": ["export { default as Shelf } from './Shelf/index.js'\nexport { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport * from './Marquee'"],
|
|
5
|
+
"mappings": "AAAA,OAAoB,WAAXA,MAAwB,mBACjC,OAAoB,WAAXA,MAA8B,yBACvC,OAAoB,WAAXA,MAA+B,0BACxC,OAAoB,WAAXA,MAAyB,oBAClC,OAAoB,WAAXA,MAA+B,0BACxC,OAAoB,WAAXA,MAA2B,sBACpC,OAAoB,WAAXA,MAA2B,sBACpC,OAAoB,WAAXA,MAA6B,wBACtC,OAAoB,WAAXA,MAAiC,4BAC1C,OAAoB,WAAXA,MAA0B,qBACnC,WAAc",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
* Button Variants
|
|
5
5
|
*/
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "link" | "
|
|
7
|
+
variant?: "link" | "primary" | "secondary" | "ghost" | null | undefined;
|
|
8
8
|
size?: "sm" | "base" | "lg" | "icon" | null | undefined;
|
|
9
9
|
hoverEffect?: "none" | "slide" | null | undefined;
|
|
10
10
|
state?: "default" | "disabled" | "loading" | null | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as w,jsx as e,jsxs as V}from"react/jsx-runtime";import*as y from"react";import{Slot as v}from"@radix-ui/react-slot";import{VisuallyHidden as g}from"@radix-ui/react-visually-hidden";import{cva as s}from"class-variance-authority";import u from"../icons/spinner.js";import{cn as h}from"../helpers/index.js";const x=s("ring-offset-background border-[1.6px] border-solid focus-visible:ring-ring rounded-btn inline-flex items-center justify-center text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none",{variants:{variant:{primary:"bg-btn-primary text-btn-primary-foreground hover:bg-btn-primary-active",secondary:"bg-btn-secondary border-info-primary text-btn-secondary-foreground hover:bg-btn-secondary-active hover:text-btn-secondary border border-solid",link:"text-info-primary underline-offset-4 hover:underline border-none hover:text-btn-primary-active",ghost:"hover:bg-btn-primary hover:text-btn-primary-foreground"},size:{sm:"px-3 py-2 text-[12px] leading-tight",base:"px-5 pt-[11px] pb-[10px] text-[14px] leading-tight",lg:"px-7 pt-[15px] pb-[14px] text-[16px] leading-tight",icon:"size-10 rounded-full leading-tight"},hoverEffect:{none:"",slide:""},state:{default:"",disabled:"",loading:""},theme:{dark:"",light:""}},compoundVariants:[{variant:"primary",hoverEffect:"slide",class:'z-[1] before:-z-[1] before:rounded-btn hover:!bg-btn-primary before:bg-btn-primary-active relative overflow-hidden before:absolute before:inset-y-0 before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[""] hover:before:translate-x-0'},{variant:"secondary",hoverEffect:"slide",class:'z-[1] before:-z-[1] before:rounded-btn hover:!bg-btn-secondary before:bg-btn-secondary-active relative overflow-hidden before:absolute before:inset-y-0 before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[""] hover:before:translate-x-0'},{variant:"primary",state:"loading",class:"bg-btn-primary-active"},{variant:"secondary",state:"loading",class:"bg-btn-secondary disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground"},{variant:"primary",state:"disabled",class:"disabled:bg-btn-primary-disabled disabled:text-btn-primary-disabled-foreground"},{variant:"secondary",state:"disabled",class:"disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground disabled:border-btn-secondary-disabled-border"},{variant:"secondary",theme:"dark",class:"text-info-white bg-info-primary hover:border-info-white hover:text-info-primary hover:bg-info-white"},{variant:"secondary",theme:"dark",state:"loading",class:"bg-btn-info-white text-info-primary border-info-white"},{variant:"secondary",theme:"dark",state:"disabled",class:"disabled:bg-text-info-quaternary disabled:text-info-white"},{variant:"link",state:"disabled",class:"disabled:text-info-quaternary"},{variant:"primary",theme:"dark",class:"text-info-primary hover:text-info-white bg-info-white hover:border-brand-0"},{variant:"primary",theme:"dark",state:"loading",class:"bg-btn-primary-active text-info-white border-brand-0"},{variant:"secondary",theme:"dark",class:"border-info-white"},{variant:"secondary",theme:"light",class:""},{variant:"link",theme:"dark",class:"text-info-white"}],defaultVariants:{variant:"primary",size:"base",hoverEffect:"none",state:"default",theme:"light"}}),k=s("",{variants:{variant:{primary:"stroke-btn-primary-foreground",secondary:"stroke-btn-secondary-foreground",link:"stroke-primary",ghost:"stroke-primary"},theme:{dark:"",light:""}},defaultVariants:{variant:"primary",theme:"light"}}),d=y.forwardRef(({asChild:b=!1,size:l="base",children:t,variant:a,theme:n="light",hoverEffect:f="none",className:c,disabled:o=!1,loading:r=!1,spinner:i,...p},m)=>e(b?v:"button",{disabled:o||r,className:h(x({variant:a,size:l,hoverEffect:f,state:r?"loading":o?"disabled":"default",theme:n}),c),ref:m,...p,children:r?V(w,{children:[e("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0,children:t}),e("span",{className:"absolute",children:i||e(u,{className:k({variant:a,theme:n})})}),e(g,{children:t})]}):t}));d.displayName="Button";var L=d;export{L as default};
|
|
2
2
|
//# sourceMappingURL=button.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/button.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport Spinner from '../icons/spinner.js'\nimport { cn } from '../helpers/index.js'\n\n/**\n * Button Variants\n */\nconst buttonVariants = cva(\n 'ring-offset-background focus-visible:ring-ring rounded-btn inline-flex items-center justify-center text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none',\n {\n variants: {\n variant: {\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport Spinner from '../icons/spinner.js'\nimport { cn } from '../helpers/index.js'\n\n/**\n * Button Variants\n */\nconst buttonVariants = cva(\n 'ring-offset-background border-[1.6px] border-solid focus-visible:ring-ring rounded-btn inline-flex items-center justify-center text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none',\n {\n variants: {\n variant: {\n primary: 'bg-btn-primary text-btn-primary-foreground hover:bg-btn-primary-active',\n secondary:\n 'bg-btn-secondary border-info-primary text-btn-secondary-foreground hover:bg-btn-secondary-active hover:text-btn-secondary border border-solid',\n link: 'text-info-primary underline-offset-4 hover:underline border-none hover:text-btn-primary-active',\n ghost: 'hover:bg-btn-primary hover:text-btn-primary-foreground',\n },\n size: {\n sm: 'px-3 py-2 text-[12px] leading-tight',\n base: 'px-5 pt-[11px] pb-[10px] text-[14px] leading-tight',\n lg: 'px-7 pt-[15px] pb-[14px] text-[16px] leading-tight',\n icon: 'size-10 rounded-full leading-tight',\n },\n /** hover \u72B6\u6001\u4E0B\u7684\u52A8\u753B\u6548\u679C,\u9700\u8981\u6CE8\u610F\u4E0D\u540Cvariant \u4E0B\u7684\u6548\u679C */\n hoverEffect: {\n none: '',\n slide: '',\n },\n state: {\n default: '',\n disabled: '',\n loading: '',\n },\n theme: {\n dark: '',\n light: '',\n },\n },\n compoundVariants: [\n {\n variant: 'primary',\n hoverEffect: 'slide',\n class:\n 'z-[1] before:-z-[1] before:rounded-btn hover:!bg-btn-primary before:bg-btn-primary-active relative overflow-hidden before:absolute before:inset-y-0 before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[\"\"] hover:before:translate-x-0',\n },\n {\n variant: 'secondary',\n hoverEffect: 'slide',\n class:\n 'z-[1] before:-z-[1] before:rounded-btn hover:!bg-btn-secondary before:bg-btn-secondary-active relative overflow-hidden before:absolute before:inset-y-0 before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[\"\"] hover:before:translate-x-0',\n },\n {\n variant: 'primary',\n state: 'loading',\n class: 'bg-btn-primary-active',\n },\n {\n variant: 'secondary',\n state: 'loading',\n class: 'bg-btn-secondary disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground',\n },\n {\n variant: 'primary',\n state: 'disabled',\n class: 'disabled:bg-btn-primary-disabled disabled:text-btn-primary-disabled-foreground',\n },\n {\n variant: 'secondary',\n state: 'disabled',\n class: 'disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground disabled:border-btn-secondary-disabled-border',\n },\n {\n variant: 'secondary',\n theme: 'dark',\n class: 'text-info-white bg-info-primary hover:border-info-white hover:text-info-primary hover:bg-info-white',\n },\n {\n variant: 'secondary',\n theme: 'dark',\n state: 'loading',\n class: 'bg-btn-info-white text-info-primary border-info-white',\n },\n {\n variant: 'secondary',\n theme: 'dark',\n state: 'disabled',\n class: 'disabled:bg-text-info-quaternary disabled:text-info-white',\n },\n {\n variant: 'link',\n state: 'disabled',\n class: 'disabled:text-info-quaternary',\n },\n {\n variant: 'primary',\n theme: 'dark',\n class: 'text-info-primary hover:text-info-white bg-info-white hover:border-brand-0',\n },\n {\n variant: 'primary',\n theme: 'dark',\n state: 'loading',\n class: 'bg-btn-primary-active text-info-white border-brand-0', \n },\n {\n variant: 'secondary',\n theme: 'dark',\n class: 'border-info-white',\n },\n {\n variant: 'secondary',\n theme: 'light',\n class: '',\n },\n {\n variant: 'link',\n theme: 'dark',\n class: 'text-info-white',\n },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'base',\n hoverEffect: 'none',\n state: 'default',\n theme: 'light',\n },\n }\n)\n\nconst loadingSvgVariants = cva('', {\n variants: {\n variant: {\n primary: 'stroke-btn-primary-foreground',\n secondary: 'stroke-btn-secondary-foreground',\n link: 'stroke-primary',\n ghost: 'stroke-primary',\n },\n theme: {\n dark: '',\n light: '',\n },\n },\n defaultVariants: {\n variant: 'primary',\n theme: 'light',\n },\n})\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /** \u8BBE\u7F6E\u6309\u94AE\u8F7D\u5165\u72B6\u6001 */\n loading?: boolean\n /** \u8BBE\u7F6E\u6309\u94AE\u5931\u6548\u72B6\u6001 */\n disabled?: boolean\n /** \u5B9A\u4E49\u81EA\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B\uFF0C \u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui */\n asChild?: boolean\n /** \u81EA\u5B9A\u4E49loading */\n spinner?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n asChild = false,\n size = 'base',\n children,\n variant,\n theme = 'light',\n hoverEffect = 'none',\n className,\n disabled = false,\n loading = false,\n spinner,\n ...props\n }: ButtonProps,\n ref\n ) => {\n const Comp = asChild ? Slot : 'button'\n const isInactive = disabled || loading\n const state = loading ? 'loading' : disabled ? 'disabled' : 'default'\n\n return (\n <Comp\n disabled={isInactive}\n className={cn(buttonVariants({ variant, size, hoverEffect, state, theme }), className)}\n ref={ref}\n {...props}\n >\n {loading ? (\n <>\n <span style={{ display: 'contents', visibility: 'hidden' }} aria-hidden>\n {children}\n </span>\n <span className=\"absolute\">\n {spinner ? (\n spinner\n ) : (\n <Spinner\n className={loadingSvgVariants({\n variant,\n theme,\n })}\n />\n )}\n </span>\n <VisuallyHidden>{children}</VisuallyHidden>\n </>\n ) : (\n children\n )}\n </Comp>\n )\n }\n)\n\nButton.displayName = 'Button'\nexport default Button\n"],
|
|
5
|
+
"mappings": "aAqMU,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBAnMV,UAAYC,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,kBAAAC,MAAsB,kCAC/B,OAA4B,OAAAC,MAAW,2BACvC,OAAOC,MAAa,sBACpB,OAAS,MAAAC,MAAU,sBAKnB,MAAMC,EAAiBH,EACrB,gRACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,yEACT,UACE,gJACF,KAAM,iGACN,MAAO,wDACT,EACA,KAAM,CACJ,GAAI,uCACJ,KAAM,qDACN,GAAI,sDACJ,KAAM,qCACR,EAEA,YAAa,CACX,KAAM,GACN,MAAO,EACT,EACA,MAAO,CACL,QAAS,GACT,SAAU,GACV,QAAS,EACX,EACA,MAAO,CACL,KAAM,GACN,MAAO,EACT,CACF,EACA,iBAAkB,CAChB,CACE,QAAS,UACT,YAAa,QACb,MACE,8SACJ,EACA,CACE,QAAS,YACT,YAAa,QACb,MACE,mTACJ,EACA,CACE,QAAS,UACT,MAAO,UACP,MAAO,uBACT,EACA,CACE,QAAS,YACT,MAAO,UACP,MAAO,qGACT,EACA,CACE,QAAS,UACT,MAAO,WACP,MAAO,gFACT,EACA,CACE,QAAS,YACT,MAAO,WACP,MAAO,kIACT,EACA,CACE,QAAS,YACT,MAAO,OACP,MAAO,qGACT,EACA,CACE,QAAS,YACT,MAAO,OACP,MAAO,UACP,MAAO,uDACT,EACA,CACE,QAAS,YACT,MAAO,OACP,MAAO,WACP,MAAO,2DACT,EACA,CACE,QAAS,OACT,MAAO,WACP,MAAO,+BACT,EACA,CACE,QAAS,UACT,MAAO,OACP,MAAO,4EACT,EACA,CACE,QAAS,UACT,MAAO,OACP,MAAO,UACP,MAAO,sDACT,EACA,CACE,QAAS,YACT,MAAO,OACP,MAAO,mBACT,EACA,CACE,QAAS,YACT,MAAO,QACP,MAAO,EACT,EACA,CACE,QAAS,OACT,MAAO,OACP,MAAO,iBACT,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,OACN,YAAa,OACb,MAAO,UACP,MAAO,OACT,CACF,CACF,EAEMI,EAAqBJ,EAAI,GAAI,CACjC,SAAU,CACR,QAAS,CACP,QAAS,gCACT,UAAW,kCACX,KAAM,iBACN,MAAO,gBACT,EACA,MAAO,CACL,KAAM,GACN,MAAO,EACT,CACF,EACA,gBAAiB,CACf,QAAS,UACT,MAAO,OACT,CACF,CAAC,EAeKK,EAASR,EAAM,WACnB,CACE,CACE,QAAAS,EAAU,GACV,KAAAC,EAAO,OACP,SAAAC,EACA,QAAAC,EACA,MAAAC,EAAQ,QACR,YAAAC,EAAc,OACd,UAAAC,EACA,SAAAC,EAAW,GACX,QAAAC,EAAU,GACV,QAAAC,EACA,GAAGC,CACL,EACAC,IAOEtB,EALWW,EAAUR,EAAO,SAK3B,CACC,SALee,GAAYC,EAM3B,UAAWZ,EAAGC,EAAe,CAAE,QAAAM,EAAS,KAAAF,EAAM,YAAAI,EAAa,MALjDG,EAAU,UAAYD,EAAW,WAAa,UAKU,MAAAH,CAAM,CAAC,EAAGE,CAAS,EACrF,IAAKK,EACJ,GAAGD,EAEH,SAAAF,EACClB,EAAAF,EAAA,CACE,UAAAC,EAAC,QAAK,MAAO,CAAE,QAAS,WAAY,WAAY,QAAS,EAAG,cAAW,GACpE,SAAAa,EACH,EACAb,EAAC,QAAK,UAAU,WACb,SAAAoB,GAGCpB,EAACM,EAAA,CACC,UAAWG,EAAmB,CAC5B,QAAAK,EACA,MAAAC,CACF,CAAC,EACH,EAEJ,EACAf,EAACI,EAAA,CAAgB,SAAAS,EAAS,GAC5B,EAEAA,EAEJ,CAGN,EAEAH,EAAO,YAAc,SACrB,IAAOa,EAAQb",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "React", "Slot", "VisuallyHidden", "cva", "Spinner", "cn", "buttonVariants", "loadingSvgVariants", "Button", "asChild", "size", "children", "variant", "theme", "hoverEffect", "className", "disabled", "loading", "spinner", "props", "ref", "button_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ products, className, shape, itemShape, event, primaryButton, }: {
|
|
5
|
+
products: Array<{
|
|
6
|
+
title: string;
|
|
7
|
+
img: string;
|
|
8
|
+
subTitle: string;
|
|
9
|
+
}>;
|
|
10
|
+
className?: string;
|
|
11
|
+
shape?: "round" | "square";
|
|
12
|
+
itemShape?: "round" | "square";
|
|
13
|
+
primaryButton?: string;
|
|
14
|
+
event?: {
|
|
15
|
+
primaryButton?: {
|
|
16
|
+
onClick: (v: any) => void;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
parameters: {
|
|
21
|
+
layout: string;
|
|
22
|
+
};
|
|
23
|
+
tags: string[];
|
|
24
|
+
};
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
export declare const Default: Story;
|
|
28
|
+
export declare const Round: Story;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import o from"../biz-components/AccordionCards";const t={title:"Biz-Components/AccordionCards",component:o,parameters:{layout:"fullscreen"},tags:["autodocs"]};var p=t;const e=[{title:"Apple Charging Solutions",img:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768",subTitle:"Dependable Charging for Your Entire Apple Ecosystem."},{title:"Apple Charging Solutions",img:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768",subTitle:"Dependable Charging for Your Entire Apple Ecosystem."},{title:"Apple Charging Solutions",img:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768",subTitle:"Dependable Charging for Your Entire Apple Ecosystem."},{title:"Apple Charging Solutions",img:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768",subTitle:"Dependable Charging for Your Entire Apple Ecosystem."}],i={args:{products:e,primaryButton:"Learn More"}},r={args:{products:e,shape:"round",itemShape:"round",primaryButton:"Learn More"}};export{i as Default,r as Round,p as default};
|
|
2
|
+
//# sourceMappingURL=accordionCards.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/stories/accordionCards.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport AccordionCards from '../biz-components/AccordionCards'\n\nconst meta = {\n title: 'Biz-Components/AccordionCards',\n component: AccordionCards,\n parameters: {\n layout: 'fullscreen',\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof AccordionCards>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst mock = [\n {\n title: 'Apple Charging Solutions',\n img: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.'\n },\n {\n title: 'Apple Charging Solutions',\n img: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.'\n },\n {\n title: 'Apple Charging Solutions',\n img: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.'\n },\n {\n title: 'Apple Charging Solutions',\n img: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.'\n },\n]\n\nexport const Default: Story = {\n args: {\n products: mock,\n primaryButton: 'Learn More'\n },\n}\n\nexport const Round: Story = {\n args: {\n products: mock,\n shape: 'round',\n itemShape: 'round',\n primaryButton: 'Learn More'\n },\n}\n"],
|
|
5
|
+
"mappings": "AACA,OAAOA,MAAoB,mCAE3B,MAAMC,EAAO,CACT,MAAO,gCACP,UAAWD,EACX,WAAY,CACR,OAAQ,YACZ,EACA,KAAM,CAAC,UAAU,CACrB,EAEA,IAAOE,EAAQD,EAGf,MAAME,EAAO,CACT,CACI,MAAO,2BACP,IAAK,gPACL,SAAU,sDACd,EACA,CACI,MAAO,2BACP,IAAK,gPACL,SAAU,sDACd,EACA,CACI,MAAO,2BACP,IAAK,gPACL,SAAU,sDACd,EACA,CACI,MAAO,2BACP,IAAK,gPACL,SAAU,sDACd,CACJ,EAEaC,EAAiB,CAC1B,KAAM,CACF,SAAUD,EACV,cAAe,YACnB,CACJ,EAEaE,EAAe,CACxB,KAAM,CACF,SAAUF,EACV,MAAO,QACP,UAAW,QACX,cAAe,YACnB,CACJ",
|
|
6
|
+
"names": ["AccordionCards", "meta", "accordionCards_stories_default", "mock", "Default", "Round"]
|
|
7
|
+
}
|
|
@@ -25,12 +25,14 @@ declare const meta: {
|
|
|
25
25
|
type: "select";
|
|
26
26
|
};
|
|
27
27
|
options: string[];
|
|
28
|
+
description: string;
|
|
28
29
|
};
|
|
29
30
|
size: {
|
|
30
31
|
control: {
|
|
31
32
|
type: "select";
|
|
32
33
|
};
|
|
33
34
|
options: string[];
|
|
35
|
+
description: string;
|
|
34
36
|
};
|
|
35
37
|
hoverEffect: {
|
|
36
38
|
description: string;
|
|
@@ -53,10 +55,10 @@ declare const meta: {
|
|
|
53
55
|
};
|
|
54
56
|
export default meta;
|
|
55
57
|
type Story = StoryObj<typeof meta>;
|
|
56
|
-
export declare const Nature: Story;
|
|
57
58
|
export declare const Primary: Story;
|
|
58
59
|
export declare const Secondary: Story;
|
|
59
60
|
export declare const Link: Story;
|
|
60
61
|
export declare const WithIcon: Story;
|
|
62
|
+
export declare const Loading: Story;
|
|
61
63
|
export declare const Aschild: Story;
|
|
62
64
|
export declare const Spinner: Story;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as
|
|
1
|
+
import{Fragment as s,jsx as t,jsxs as e}from"react/jsx-runtime";import{SearchIcon as o}from"@storybook/icons";import{Button as a}from"../components/index.js";import"react";const r={title:"Components/Button",component:a,parameters:{layout:"centered",docs:{description:{component:"\u6309\u94AE\u7EC4\u4EF6, \u5206\u4E3A\u591A\u79CD\u53D8\u4F53\u548C\u5927\u5C0F, \u652F\u6301 loading \u72B6\u6001\u548C\u56FE\u6807"}}},tags:["autodocs"],argTypes:{theme:{control:{type:"select"},options:["dark","light"],description:"\u4E3B\u9898, \u9ED8\u8BA4\u662F light"},variant:{control:{type:"select"},options:["primary","secondary","link","ghost"],description:"\u6309\u94AE\u7C7B\u578B, \u63A8\u8350\u4F7F\u7528 primary \u548C secondary\uFF0C link ; ghost \u5C06\u4F1A\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 secondary\uFF0C \u4EE3\u66FF"},size:{control:{type:"select"},options:["sm","base","lg","icon"],description:"\u6309\u94AE\u5927\u5C0F \u9ED8\u8BA4\u662F base, \u53EF\u9009\u503C: sm, base, lg, icon"},hoverEffect:{description:"hover \u72B6\u6001\u4E0B\u7684\u52A8\u753B\u6548\u679C\uFF0C\u4EC5\u5728variant\u662Fprimary \u548C secondary \u65F6\u751F\u6548",control:{type:"select"},options:["none","slide"]}},args:{theme:"light",variant:"primary",size:"base",children:"Button",asChild:!1,disabled:!1,loading:!1,hoverEffect:"none"}};var p=r;const d={args:{size:"lg",children:"Primary"}},g={args:{size:"lg",variant:"secondary",children:"Secondary"}},y={args:{size:"lg",variant:"link",children:"Link"}},h={args:{size:"lg",children:e(s,{children:["WithIcon ",t(o,{className:"ml-2"})]})}},m={args:{size:"lg",loading:!0}},f={args:{size:"lg",asChild:!0,children:t("a",{href:"http://example.com",children:"as a a tag"})}},v={args:{size:"lg",loading:!0,spinner:e("div",{className:"flex animate-pulse flex-row font-bold text-neutral-900",children:[t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2625",width:"1rem",className:"align-middle",children:t("path",{d:"M511.882596 287.998081h-0.361244a31.998984 31.998984 0 0 1-31.659415-31.977309v-0.361244c0-0.104761 0.115598-11.722364 0.115598-63.658399V96.000564a31.998984 31.998984 0 1 1 64.001581 0V192.001129c0 52.586273-0.111986 63.88237-0.119211 64.337537a32.002596 32.002596 0 0 1-31.977309 31.659415zM511.998194 959.99842a31.998984 31.998984 0 0 1-31.998984-31.998984v-96.379871c0-51.610915-0.111986-63.174332-0.115598-63.286318s0-0.242033 0-0.361243a31.998984 31.998984 0 0 1 63.997968-0.314283c0 0.455167 0.11921 11.711527 0.11921 64.034093v96.307622a31.998984 31.998984 0 0 1-32.002596 31.998984zM330.899406 363.021212a31.897836 31.897836 0 0 1-22.866739-9.612699c-0.075861-0.075861-8.207461-8.370021-44.931515-45.094076L195.198137 240.429485a31.998984 31.998984 0 0 1 45.256635-45.253022L308.336112 263.057803c37.182834 37.182834 45.090463 45.253022 45.41197 45.578141A31.998984 31.998984 0 0 1 330.899406 363.021212zM806.137421 838.11473a31.901448 31.901448 0 0 1-22.628318-9.374279L715.624151 760.859111c-36.724054-36.724054-45.018214-44.859267-45.097687-44.93874a31.998984 31.998984 0 0 1 44.77618-45.729864c0.32512 0.317895 8.395308 8.229136 45.578142 45.411969l67.88134 67.88134a31.998984 31.998984 0 0 1-22.624705 54.630914zM224.000113 838.11473a31.901448 31.901448 0 0 0 22.628317-9.374279l67.88134-67.88134c36.724054-36.724054 45.021826-44.859267 45.097688-44.93874a31.998984 31.998984 0 0 0-44.776181-45.729864c-0.32512 0.317895-8.395308 8.229136-45.578142 45.411969l-67.88134 67.884953a31.998984 31.998984 0 0 0 22.628318 54.627301zM255.948523 544.058589h-0.361244c-0.104761 0-11.722364-0.115598-63.658399-0.115598H95.942765a31.998984 31.998984 0 1 1 0-64.00158h95.996952c52.586273 0 63.88237 0.111986 64.337538 0.11921a31.998984 31.998984 0 0 1 31.659414 31.97731v0.361244a32.002596 32.002596 0 0 1-31.988146 31.659414zM767.939492 544.058589a32.002596 32.002596 0 0 1-31.995372-31.666639v-0.361244a31.998984 31.998984 0 0 1 31.659415-31.970085c0.455167 0 11.754876-0.11921 64.34115-0.11921h96.000564a31.998984 31.998984 0 0 1 0 64.00158H831.944685c-51.936034 0-63.553638 0.111986-63.665624 0.115598h-0.335957zM692.999446 363.0176a31.998984 31.998984 0 0 1-22.863126-54.381656c0.317895-0.32512 8.229136-8.395308 45.41197-45.578141l67.88134-67.884953A31.998984 31.998984 0 1 1 828.693489 240.429485l-67.892177 67.88134c-31.020013 31.023625-41.644196 41.759794-44.241539 44.393262l-0.697201 0.722488a31.908673 31.908673 0 0 1-22.863126 9.591025z",fill:"","p-id":"2626"})}),"\xA0loading..."]})}};export{f as Aschild,y as Link,m as Loading,d as Primary,g as Secondary,v as Spinner,h as WithIcon,p as default};
|
|
2
2
|
//# sourceMappingURL=button.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/button.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport { SearchIcon } from '@storybook/icons'\n\nimport { Button } from '../components/index.js'\nimport React from 'react'\n\n// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export\nconst meta = {\n // \u540C\u65F6\u5B9A\u4E49\u4E86\u9875\u9762\u5DE6\u4FA7\u83DC\u5355\n title: 'Components/Button',\n component: Button,\n parameters: {\n // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout\n layout: 'centered',\n docs: {\n description: {\n component: `\u6309\u94AE\u7EC4\u4EF6, \u5206\u4E3A\u591A\u79CD\u53D8\u4F53\u548C\u5927\u5C0F, \u652F\u6301 loading \u72B6\u6001\u548C\u56FE\u6807`\n }\n }\n },\n // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs\n tags: ['autodocs'],\n // More on argTypes: https://storybook.js.org/docs/api/argtypes\n argTypes: {\n theme: {\n control: {\n type: 'select',\n },\n options: ['dark', 'light'],\n description: '\u4E3B\u9898, \u9ED8\u8BA4\u662F light',\n },\n variant: {\n control: {\n type: 'select',\n },\n options: ['
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["Fragment", "jsx", "jsxs", "SearchIcon", "Button", "meta", "button_stories_default", "
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport { SearchIcon } from '@storybook/icons'\n\nimport { Button } from '../components/index.js'\nimport React from 'react'\n\n// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export\nconst meta = {\n // \u540C\u65F6\u5B9A\u4E49\u4E86\u9875\u9762\u5DE6\u4FA7\u83DC\u5355\n title: 'Components/Button',\n component: Button,\n parameters: {\n // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout\n layout: 'centered',\n docs: {\n description: {\n component: `\u6309\u94AE\u7EC4\u4EF6, \u5206\u4E3A\u591A\u79CD\u53D8\u4F53\u548C\u5927\u5C0F, \u652F\u6301 loading \u72B6\u6001\u548C\u56FE\u6807`\n }\n }\n },\n // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs\n tags: ['autodocs'],\n // More on argTypes: https://storybook.js.org/docs/api/argtypes\n argTypes: {\n theme: {\n control: {\n type: 'select',\n },\n options: ['dark', 'light'],\n description: '\u4E3B\u9898, \u9ED8\u8BA4\u662F light',\n },\n variant: {\n control: {\n type: 'select',\n },\n options: ['primary', 'secondary', 'link', 'ghost'],\n description: '\u6309\u94AE\u7C7B\u578B, \u63A8\u8350\u4F7F\u7528 primary \u548C secondary\uFF0C link ; ghost \u5C06\u4F1A\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 secondary\uFF0C \u4EE3\u66FF',\n },\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'base', 'lg', 'icon'],\n description: '\u6309\u94AE\u5927\u5C0F \u9ED8\u8BA4\u662F base, \u53EF\u9009\u503C: sm, base, lg, icon',\n },\n hoverEffect: {\n description: 'hover \u72B6\u6001\u4E0B\u7684\u52A8\u753B\u6548\u679C\uFF0C\u4EC5\u5728variant\u662Fprimary \u548C secondary \u65F6\u751F\u6548',\n control: {\n type: 'select',\n },\n options: ['none', 'slide'],\n },\n },\n args: {\n theme: 'light',\n variant: 'primary',\n size: 'base',\n children: 'Button',\n asChild: false,\n disabled: false,\n loading: false,\n hoverEffect: 'none',\n },\n} satisfies Meta<typeof Button>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\n// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args\n// args \u4F1A\u4F5C\u4E3A props \u4F20\u9012\u7ED9\u7EC4\u4EF6\n// Story\u7684\u540D\u4F1A\u4F5C\u4E3A\u83DC\u5355\u7684\u540D\u79F0 \u81EA\u52A8\u9996\u5B57\u6BCD\u5927\u5199\u5E76\u6309\u7167\u5927\u5199\u5B57\u6BCD\u62C6\u5206 UseAsButton => Use As Button\n\nexport const Primary: Story = {\n args: {\n size: 'lg',\n children: 'Primary',\n },\n}\n\nexport const Secondary: Story = {\n args: {\n size: 'lg',\n variant: 'secondary',\n children: 'Secondary',\n },\n}\n\nexport const Link: Story = {\n args: {\n size: 'lg',\n variant: 'link',\n children: 'Link',\n },\n}\n\nexport const WithIcon: Story = {\n args: {\n size: 'lg',\n children: (\n <>\n WithIcon <SearchIcon className=\"ml-2\" />\n </>\n ),\n },\n}\n\nexport const Loading: Story = {\n args: {\n size: 'lg',\n loading: true,\n },\n}\n\nexport const Aschild: Story = {\n args: {\n size: 'lg',\n asChild: true,\n children: <a href=\"http://example.com\">as a a tag</a>,\n },\n}\n\nexport const Spinner: Story = {\n args: {\n size: 'lg',\n loading: true,\n spinner: (\n <div className=\"flex animate-pulse flex-row font-bold text-neutral-900\">\n <svg\n viewBox=\"0 0 1024 1024\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n p-id=\"2625\"\n width=\"1rem\"\n className=\"align-middle\"\n >\n <path\n d=\"M511.882596 287.998081h-0.361244a31.998984 31.998984 0 0 1-31.659415-31.977309v-0.361244c0-0.104761 0.115598-11.722364 0.115598-63.658399V96.000564a31.998984 31.998984 0 1 1 64.001581 0V192.001129c0 52.586273-0.111986 63.88237-0.119211 64.337537a32.002596 32.002596 0 0 1-31.977309 31.659415zM511.998194 959.99842a31.998984 31.998984 0 0 1-31.998984-31.998984v-96.379871c0-51.610915-0.111986-63.174332-0.115598-63.286318s0-0.242033 0-0.361243a31.998984 31.998984 0 0 1 63.997968-0.314283c0 0.455167 0.11921 11.711527 0.11921 64.034093v96.307622a31.998984 31.998984 0 0 1-32.002596 31.998984zM330.899406 363.021212a31.897836 31.897836 0 0 1-22.866739-9.612699c-0.075861-0.075861-8.207461-8.370021-44.931515-45.094076L195.198137 240.429485a31.998984 31.998984 0 0 1 45.256635-45.253022L308.336112 263.057803c37.182834 37.182834 45.090463 45.253022 45.41197 45.578141A31.998984 31.998984 0 0 1 330.899406 363.021212zM806.137421 838.11473a31.901448 31.901448 0 0 1-22.628318-9.374279L715.624151 760.859111c-36.724054-36.724054-45.018214-44.859267-45.097687-44.93874a31.998984 31.998984 0 0 1 44.77618-45.729864c0.32512 0.317895 8.395308 8.229136 45.578142 45.411969l67.88134 67.88134a31.998984 31.998984 0 0 1-22.624705 54.630914zM224.000113 838.11473a31.901448 31.901448 0 0 0 22.628317-9.374279l67.88134-67.88134c36.724054-36.724054 45.021826-44.859267 45.097688-44.93874a31.998984 31.998984 0 0 0-44.776181-45.729864c-0.32512 0.317895-8.395308 8.229136-45.578142 45.411969l-67.88134 67.884953a31.998984 31.998984 0 0 0 22.628318 54.627301zM255.948523 544.058589h-0.361244c-0.104761 0-11.722364-0.115598-63.658399-0.115598H95.942765a31.998984 31.998984 0 1 1 0-64.00158h95.996952c52.586273 0 63.88237 0.111986 64.337538 0.11921a31.998984 31.998984 0 0 1 31.659414 31.97731v0.361244a32.002596 32.002596 0 0 1-31.988146 31.659414zM767.939492 544.058589a32.002596 32.002596 0 0 1-31.995372-31.666639v-0.361244a31.998984 31.998984 0 0 1 31.659415-31.970085c0.455167 0 11.754876-0.11921 64.34115-0.11921h96.000564a31.998984 31.998984 0 0 1 0 64.00158H831.944685c-51.936034 0-63.553638 0.111986-63.665624 0.115598h-0.335957zM692.999446 363.0176a31.998984 31.998984 0 0 1-22.863126-54.381656c0.317895-0.32512 8.229136-8.395308 45.41197-45.578141l67.88134-67.884953A31.998984 31.998984 0 1 1 828.693489 240.429485l-67.892177 67.88134c-31.020013 31.023625-41.644196 41.759794-44.241539 44.393262l-0.697201 0.722488a31.908673 31.908673 0 0 1-22.863126 9.591025z\"\n fill=\"\"\n p-id=\"2626\"\n ></path>\n </svg>\n loading...\n </div>\n ),\n },\n}\n"],
|
|
5
|
+
"mappings": "AAmGM,mBAAAA,EACW,OAAAC,EADX,QAAAC,MAAA,oBAlGN,OAAS,cAAAC,MAAkB,mBAE3B,OAAS,UAAAC,MAAc,yBACvB,MAAkB,QAGlB,MAAMC,EAAO,CAEX,MAAO,oBACP,UAAWD,EACX,WAAY,CAEV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,uIACb,CACF,CACF,EAEA,KAAM,CAAC,UAAU,EAEjB,SAAU,CACR,MAAO,CACL,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,OAAQ,OAAO,EACzB,YAAa,wCACf,EACA,QAAS,CACP,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,UAAW,YAAa,OAAQ,OAAO,EACjD,YAAa,8KACf,EACA,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,OAAQ,KAAM,MAAM,EACpC,YAAa,0FACf,EACA,YAAa,CACX,YAAa,mIACb,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,OAAQ,OAAO,CAC3B,CACF,EACA,KAAM,CACJ,MAAO,QACP,QAAS,UACT,KAAM,OACN,SAAU,SACV,QAAS,GACT,SAAU,GACV,QAAS,GACT,YAAa,MACf,CACF,EAEA,IAAOE,EAAQD,EAOR,MAAME,EAAiB,CAC5B,KAAM,CACJ,KAAM,KACN,SAAU,SACZ,CACF,EAEaC,EAAmB,CAC9B,KAAM,CACJ,KAAM,KACN,QAAS,YACT,SAAU,WACZ,CACF,EAEaC,EAAc,CACzB,KAAM,CACJ,KAAM,KACN,QAAS,OACT,SAAU,MACZ,CACF,EAEaC,EAAkB,CAC7B,KAAM,CACJ,KAAM,KACN,SACER,EAAAF,EAAA,CAAE,sBACSC,EAACE,EAAA,CAAW,UAAU,OAAO,GACxC,CAEJ,CACF,EAEaQ,EAAiB,CAC5B,KAAM,CACJ,KAAM,KACN,QAAS,EACX,CACF,EAEaC,EAAiB,CAC5B,KAAM,CACJ,KAAM,KACN,QAAS,GACT,SAAUX,EAAC,KAAE,KAAK,qBAAqB,sBAAU,CACnD,CACF,EAEaY,EAAiB,CAC5B,KAAM,CACJ,KAAM,KACN,QAAS,GACT,QACEX,EAAC,OAAI,UAAU,yDACb,UAAAD,EAAC,OACC,QAAQ,gBACR,QAAQ,MACR,MAAM,6BACN,OAAK,OACL,MAAM,OACN,UAAU,eAEV,SAAAA,EAAC,QACC,EAAE,o5EACF,KAAK,GACL,OAAK,OACN,EACH,EAAM,kBAER,CAEJ,CACF",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "SearchIcon", "Button", "meta", "button_stories_default", "Primary", "Secondary", "Link", "WithIcon", "Loading", "Aschild", "Spinner"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: {
|
|
5
|
+
(props: Omit<import("../biz-components/Graphic").GraphicProps & import("react").RefAttributes<HTMLDivElement>, keyof import("../shared/Styles").StylesProps> & Partial<import("../shared/Styles").StylesProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
argTypes: {
|
|
17
|
+
shape: {
|
|
18
|
+
control: {
|
|
19
|
+
type: "inline-radio";
|
|
20
|
+
};
|
|
21
|
+
options: string[];
|
|
22
|
+
description: string;
|
|
23
|
+
table: {
|
|
24
|
+
defaultValue: {
|
|
25
|
+
summary: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
decorators: ((Story: import("@storybook/core/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
31
|
+
ref?: import("react").LegacyRef<HTMLDivElement> | undefined;
|
|
32
|
+
className?: string | undefined;
|
|
33
|
+
key?: import("react").Key | null | undefined;
|
|
34
|
+
shape?: "round" | "square" | undefined;
|
|
35
|
+
items: {
|
|
36
|
+
imgUrl: string;
|
|
37
|
+
title: string;
|
|
38
|
+
textColor?: string;
|
|
39
|
+
}[];
|
|
40
|
+
style?: string | undefined;
|
|
41
|
+
uid?: string | undefined;
|
|
42
|
+
disabled?: boolean | undefined;
|
|
43
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
44
|
+
tags: string[];
|
|
45
|
+
};
|
|
46
|
+
export default meta;
|
|
47
|
+
type Story = StoryObj<typeof meta>;
|
|
48
|
+
export declare const Default: Story;
|
|
49
|
+
export declare const Round: Story;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import r from"../biz-components/Graphic";const s={title:"Biz-Components/Graphic",component:r,parameters:{layout:"fullscreen",docs:{description:{component:"\u56FE\u6587\u5C55\u793A\u6A21\u5757\uFF0C\u57FA\u4E8Eembla-carousel-react\uFF0Chttps://www.embla-carousel.com/get-started/react/"}}},argTypes:{shape:{control:{type:"inline-radio"},options:["square","round"],description:"\u5706\u89D2",table:{defaultValue:{summary:"square"}}}},decorators:[o=>t("div",{style:{paddingTop:"2em"},children:t(o,{})})],tags:["autodocs"]};var p=s;const e=[{imgUrl:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Frame_1973772030.png?v=1745724316",title:"<span>Welcome Offer</span><br>Sign Up for Special Offers Up to 20% Off"},{imgUrl:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Frame_1973772047.png?v=1745724318",title:"<span>Welcome Offer</span><br>Same Great Quality at Even Better Prices",textColor:"#FFF"},{imgUrl:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Frame_1973772030.png?v=1745724316",title:"<span>Welcome Offer</span><br>Sign Up for Special Offers Up to 20% Off"},{imgUrl:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Frame_1973772047.png?v=1745724318",title:"<span>Welcome Offer</span><br>Same Great Quality at Even Better Prices",textColor:"#FFF"}],i={args:{items:e}},l={args:{items:e,shape:"round"}};export{i as Default,l as Round,p as default};
|
|
2
|
+
//# sourceMappingURL=graphic.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/stories/graphic.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport Graphic from '../biz-components/Graphic'\n\nconst meta = {\n title: 'Biz-Components/Graphic',\n component: Graphic,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n component: '\u56FE\u6587\u5C55\u793A\u6A21\u5757\uFF0C\u57FA\u4E8Eembla-carousel-react\uFF0Chttps://www.embla-carousel.com/get-started/react/',\n },\n },\n },\n argTypes: {\n shape: {\n control: {\n type: 'inline-radio',\n },\n options: ['square', 'round'],\n description: '\u5706\u89D2',\n table: {\n defaultValue: {\n summary: 'square',\n },\n },\n },\n },\n decorators: [\n Story => (\n <div style={{ paddingTop: '2em' }}>\n <Story />\n </div>\n ),\n ],\n tags: ['autodocs'],\n} satisfies Meta<typeof Graphic>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst mockItems = [\n {\n imgUrl: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Frame_1973772030.png?v=1745724316',\n title: '<span>Welcome Offer</span><br>Sign Up for Special Offers Up to 20% Off',\n },\n {\n imgUrl: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Frame_1973772047.png?v=1745724318',\n title: '<span>Welcome Offer</span><br>Same Great Quality at Even Better Prices',\n textColor: '#FFF',\n },\n {\n imgUrl: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Frame_1973772030.png?v=1745724316',\n title: '<span>Welcome Offer</span><br>Sign Up for Special Offers Up to 20% Off',\n },\n {\n imgUrl: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Frame_1973772047.png?v=1745724318',\n title: '<span>Welcome Offer</span><br>Same Great Quality at Even Better Prices',\n textColor: '#FFF',\n },\n]\n\nexport const Default: Story = {\n args: {\n items: mockItems,\n },\n}\n\nexport const Round: Story = {\n args: {\n items: mockItems,\n shape: 'round',\n },\n}\n"],
|
|
5
|
+
"mappings": "AA+BQ,cAAAA,MAAA,oBA9BR,OAAOC,MAAa,4BAEpB,MAAMC,EAAO,CACX,MAAO,yBACP,UAAWD,EACX,WAAY,CACV,OAAQ,aACR,KAAM,CACJ,YAAa,CACX,UAAW,mIACb,CACF,CACF,EACA,SAAU,CACR,MAAO,CACL,QAAS,CACP,KAAM,cACR,EACA,QAAS,CAAC,SAAU,OAAO,EAC3B,YAAa,eACb,MAAO,CACL,aAAc,CACZ,QAAS,QACX,CACF,CACF,CACF,EACA,WAAY,CACVE,GACEH,EAAC,OAAI,MAAO,CAAE,WAAY,KAAM,EAC9B,SAAAA,EAACG,EAAA,EAAM,EACT,CAEJ,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOC,EAAQF,EAGf,MAAMG,EAAY,CAChB,CACE,OAAQ,2FACR,MAAO,wEACT,EACA,CACE,OAAQ,2FACR,MAAO,yEACP,UAAW,MACb,EACA,CACE,OAAQ,2FACR,MAAO,wEACT,EACA,CACE,OAAQ,2FACR,MAAO,yEACP,UAAW,MACb,CACF,EAEaC,EAAiB,CAC5B,KAAM,CACJ,MAAOD,CACT,CACF,EAEaE,EAAe,CAC1B,KAAM,CACJ,MAAOF,EACP,MAAO,OACT,CACF",
|
|
6
|
+
"names": ["jsx", "Graphic", "meta", "Story", "graphic_stories_default", "mockItems", "Default", "Round"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anker-in/headless-ui",
|
|
3
|
-
"version": "0.0.27-alpha.
|
|
3
|
+
"version": "0.0.27-alpha.7",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/cjs/index.d.ts",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"clsx": "^2.1.1",
|
|
79
79
|
"embla-carousel-autoplay": "^8.5.2",
|
|
80
80
|
"embla-carousel-class-names": "^8.5.2",
|
|
81
|
-
"embla-carousel-react": "^8.
|
|
81
|
+
"embla-carousel-react": "^8.6.0",
|
|
82
82
|
"embla-carousel-wheel-gestures": "^8.0.1",
|
|
83
83
|
"fitty": "^2.4.2",
|
|
84
84
|
"postcss": "^8.4.38",
|