@vetc-miniapp/ui-react 0.0.26 → 0.0.28
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/index.js +1 -41
- package/package.json +3 -2
- package/dist/bridge.js +0 -20
- package/dist/components/app.js +0 -34
- package/dist/components/avatar/Avatar.js +0 -33
- package/dist/components/avatar/index.js +0 -1
- package/dist/components/bottom-sheet/BottomSheet.js +0 -70
- package/dist/components/bottom-sheet/index.js +0 -1
- package/dist/components/button/Button.js +0 -165
- package/dist/components/button/index.js +0 -1
- package/dist/components/button-group/ButtonGroup.js +0 -21
- package/dist/components/button-group/index.js +0 -1
- package/dist/components/card/Card.js +0 -35
- package/dist/components/card/index.js +0 -1
- package/dist/components/checkbox/Checkbox.js +0 -94
- package/dist/components/checkbox/index.js +0 -1
- package/dist/components/chip/Chip.js +0 -83
- package/dist/components/chip/index.js +0 -1
- package/dist/components/dialog/Dialog.js +0 -51
- package/dist/components/dialog/index.js +0 -1
- package/dist/components/divider/Divider.js +0 -18
- package/dist/components/divider/index.js +0 -1
- package/dist/components/input/Input.js +0 -51
- package/dist/components/input/index.js +0 -1
- package/dist/components/list/List.js +0 -72
- package/dist/components/list/index.js +0 -1
- package/dist/components/loading/Loading.js +0 -33
- package/dist/components/loading/index.js +0 -1
- package/dist/components/modal/Modal.js +0 -50
- package/dist/components/modal/index.js +0 -1
- package/dist/components/navigation-bar/NavigationBar.js +0 -70
- package/dist/components/navigation-bar/index.js +0 -1
- package/dist/components/radio/Radio.js +0 -88
- package/dist/components/radio/index.js +0 -1
- package/dist/components/select/Select.js +0 -30
- package/dist/components/select/index.js +0 -1
- package/dist/components/switch/Switch.js +0 -81
- package/dist/components/switch/index.js +0 -1
- package/dist/components/tab-bar/TabBar.js +0 -60
- package/dist/components/tab-bar/index.js +0 -1
- package/dist/components/textarea/Textarea.js +0 -33
- package/dist/components/textarea/index.js +0 -1
- package/dist/components/toast/Toast.js +0 -61
- package/dist/components/toast/index.js +0 -1
- package/dist/components/typography/Typography.js +0 -143
- package/dist/components/typography/index.js +0 -1
- package/dist/hooks/use-app-pause.js +0 -25
- package/dist/hooks/use-app-resume.js +0 -25
- package/dist/hooks/use-app-state.js +0 -1
- package/dist/hooks/use-did-hide.js +0 -20
- package/dist/hooks/use-did-show.js +0 -20
- package/dist/hooks/use-listener-scan-qr.js +0 -25
- package/dist/hooks/use-navigate.js +0 -23
- package/dist/hooks/use-tap-app-bar.js +0 -20
- package/dist/styles/VETCProvider.js +0 -124
- package/dist/tokens/colors.js +0 -75
- package/dist/tokens/index.js +0 -3
- package/dist/tokens/spacing.js +0 -56
- package/dist/tokens/typography.js +0 -57
- package/dist/types/app.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,41 +1 @@
|
|
|
1
|
-
// ─── Styles (import once at app root) ────────────────────────────────────────
|
|
2
|
-
// import '@vetc-miniapp/ui-react/src/ui-react/styles/tokens.css';
|
|
3
|
-
// ─── Theme Provider ───────────────────────────────────────────────────────────
|
|
4
|
-
export { VETCProvider, vetcAntdTheme } from './styles/VETCProvider';
|
|
5
|
-
// ─── Tokens ───────────────────────────────────────────────────────────────────
|
|
6
|
-
export { colorGlobal, colorAlias } from './tokens/colors';
|
|
7
|
-
export { fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textStyle } from './tokens/typography';
|
|
8
|
-
export { spacing, borderRadius, componentHeight, shadow } from './tokens/spacing';
|
|
9
|
-
// ─── Components ───────────────────────────────────────────────────────────────
|
|
10
|
-
export { Button } from './components/button';
|
|
11
|
-
export { ButtonGroup } from './components/button-group';
|
|
12
|
-
export { Typography, Display, Headline, Title, Label, Body } from './components/typography';
|
|
13
|
-
export { Input, PasswordInput } from './components/input';
|
|
14
|
-
export { Textarea } from './components/textarea';
|
|
15
|
-
export { Select } from './components/select';
|
|
16
|
-
export { Checkbox, CheckboxGroup } from './components/checkbox';
|
|
17
|
-
export { Radio, RadioGroup } from './components/radio';
|
|
18
|
-
export { Switch } from './components/switch';
|
|
19
|
-
export { Chip } from './components/chip';
|
|
20
|
-
export { Avatar } from './components/avatar';
|
|
21
|
-
export { Card } from './components/card';
|
|
22
|
-
export { List, ListItem } from './components/list';
|
|
23
|
-
export { Divider } from './components/divider';
|
|
24
|
-
export { Spinner, SkeletonLoader } from './components/loading';
|
|
25
|
-
export { toast, useToast } from './components/toast';
|
|
26
|
-
export { Modal, useConfirm } from './components/modal';
|
|
27
|
-
export { Dialog } from './components/dialog';
|
|
28
|
-
export { BottomSheet } from './components/bottom-sheet';
|
|
29
|
-
export { NavigationBar } from './components/navigation-bar';
|
|
30
|
-
export { TabBar } from './components/tab-bar';
|
|
31
|
-
// ─── App (Router + Native init) ───────────────────────────────────────────────
|
|
32
|
-
export { App } from './components/app';
|
|
33
|
-
// ─── Hooks (existing) ─────────────────────────────────────────────────────────
|
|
34
|
-
export * from './hooks/use-app-resume';
|
|
35
|
-
export * from './hooks/use-app-pause';
|
|
36
|
-
export * from './hooks/use-did-show';
|
|
37
|
-
export * from './hooks/use-did-hide';
|
|
38
|
-
export * from './hooks/use-tap-app-bar';
|
|
39
|
-
export * from './hooks/use-navigate';
|
|
40
|
-
export * from './hooks/use-app-state';
|
|
41
|
-
export * from './hooks/use-listener-scan-qr';
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{ConfigProvider as a,theme as i,App as n,Input as o,Select as l,Tag as c,Avatar as d,Card as v,Divider as s,Skeleton as g,Spin as h,message as p,notification as f,Modal as b}from"antd";import u,{useState as y,useEffect as m,useRef as x}from"react";import{LoadingOutlined as w}from"@ant-design/icons";import{createPortal as k}from"react-dom";const S={white:"#ffffff",black:"#000000",blue02:"#f4fbff",blue05:"#e4f4ff",blue10:"#cae9ff",blue15:"#afddff",blue20:"#95d1ff",blue25:"#7ac4fb",blue30:"#60b6f4",blue35:"#45a8eb",blue40:"#2b99df",blue45:"#108ad1",blue50:"#007ac1",blue60:"#005c9e",blue70:"#004179",blue80:"#002853",blue90:"#00122a",green02:"#f2fef2",green05:"#dffbdf",green10:"#bff4bf",green15:"#9feca7",green20:"#82e194",green25:"#68d583",green30:"#50c775",green35:"#39b669",green40:"#25a45e",green45:"#23965b",green50:"#208758",green60:"#1b6b4d",green70:"#15503f",green80:"#0f342d",green90:"#081a18",gray02:"#f9fafa",gray05:"#f1f1f2",gray10:"#e3e4e6",gray15:"#d4d6d9",gray20:"#c6c8cc",gray25:"#b8babf",gray30:"#abacb2",gray35:"#9d9ea5",gray40:"#8f9098",gray45:"#82828a",gray50:"#74747d",gray60:"#5e5d64",gray70:"#47464b",gray80:"#2f2f32",gray90:"#181719",red02:"#fff6f9",red05:"#ffe7f0",red10:"#ffd0de",red15:"#ffb8cc",red20:"#ffa1b8",red25:"#ff89a3",red30:"#fb718d",red35:"#f55c78",red40:"#ee4b62",red45:"#e53b4d",red50:"#da2c39",red60:"#b4211f",red70:"#852419",red80:"#571f12",red90:"#2b130a",orange02:"#fffbf0",orange05:"#fff3da",orange10:"#ffe3b4",orange15:"#ffd08f",orange20:"#ffbb69",orange25:"#ffa447",orange30:"#ff8c2f",orange35:"#ef7720",orange40:"#dd6e1d",orange45:"#cb651b",orange50:"#b85c18",orange60:"#934913",orange70:"#6f370f",orange80:"#4a250a",orange90:"#251205",yellow02:"#fff8e7",yellow05:"#ffefbc",yellow10:"#ffe374",yellow15:"#ffd62b",yellow20:"#f9c600",yellow25:"#e9b900",yellow30:"#daaa00",yellow35:"#ca9b00",yellow40:"#bb8b00",yellow45:"#ab7b00",yellow50:"#9c6b00",yellow60:"#7c4b00",yellow70:"#5d2f00",yellow80:"#3e1800",yellow90:"#1f0700"},z={brand:S.green40,brandDark:S.green50,brandLight:S.green05,positive:S.green50,positiveVariant:S.green05,onPositive:S.white,onPositiveVariant:S.green60,negative:S.red50,onNegative:S.white,warning:S.orange30,onWarning:S.white,outline:S.gray50,outlineVariant:S.gray10,outlineInverse:S.gray40,theme:S.white,themeVariant:S.gray05,inverseTheme:S.gray90,primaryOnTheme:S.gray90,secondaryOnTheme:S.gray60,primaryOnInverseTheme:S.white,secondaryOnInverseTheme:S.gray20,disabledBackground:S.gray10,disabledContent:S.gray30,disabledOutline:S.gray20,overlay:"rgba(0, 0, 0, 0.4)",overlayVariant:"rgba(0, 0, 0, 0.16)",skeleton:"rgba(0, 0, 0, 0.1)"},C={token:{colorPrimary:z.brand,colorPrimaryHover:S.green35,colorPrimaryActive:z.brandDark,colorPrimaryBg:S.green02,colorPrimaryBgHover:S.green05,colorError:z.negative,colorErrorHover:S.red60,colorErrorBg:S.red02,colorWarning:z.warning,colorWarningBg:S.orange02,colorSuccess:z.positive,colorSuccessBg:S.green02,colorText:z.primaryOnTheme,colorTextSecondary:z.secondaryOnTheme,colorTextDisabled:z.disabledContent,colorTextPlaceholder:S.gray50,colorBgContainer:z.theme,colorBgLayout:z.themeVariant,colorBgSpotlight:z.inverseTheme,colorBorder:S.gray20,colorBorderSecondary:S.gray10,colorSplit:S.gray10,colorFill:S.gray05,colorFillSecondary:S.gray10,colorFillTertiary:S.gray15,fontFamily:'"Roboto", system-ui, -apple-system, sans-serif',fontSize:16,fontSizeSM:13,fontSizeLG:18,fontSizeXL:19,fontSizeHeading1:32,fontSizeHeading2:28,fontSizeHeading3:24,fontSizeHeading4:19,fontSizeHeading5:16,fontWeightStrong:600,lineHeight:1.5,borderRadius:8,borderRadiusSM:6,borderRadiusLG:12,borderRadiusXS:4,controlHeight:48,controlHeightSM:32,controlHeightLG:56,paddingXS:8,paddingSM:12,padding:16,paddingMD:16,paddingLG:24,motionDurationFast:"150ms",motionDurationMid:"250ms"},components:{Button:{primaryColor:"#ffffff",defaultBorderColor:S.gray20,defaultColor:z.primaryOnTheme,borderRadius:12,borderRadiusSM:8,borderRadiusLG:12,controlHeight:48,controlHeightSM:32,paddingInline:16,paddingInlineSM:12,fontWeight:600},Input:{borderRadius:8,controlHeight:48,paddingInline:12,colorBorder:S.gray20,hoverBorderColor:z.outline,activeBorderColor:z.brand},Select:{borderRadius:8,controlHeight:48},Checkbox:{borderRadius:4,controlInteractiveSize:20},Radio:{radioSize:20,dotSize:8},Switch:{trackHeight:32,trackMinWidth:52,handleSize:28,colorPrimary:z.brand},Modal:{borderRadiusLG:16,paddingContentHorizontalLG:16,paddingMD:16},Card:{borderRadius:16,paddingLG:16}}};function H({children:t}){return e(a,{theme:{...C,algorithm:i.defaultAlgorithm},children:e(n,{children:t})})}const W={primary:'"Roboto", system-ui, -apple-system, sans-serif'},B={regular:400,medium:500,semibold:600,bold:700,black:900},L={"2xs":"10px",xs:"12px",sm:"14px",base:"16px",lg:"20px",xl:"24px","2xl":"28px","3xl":"32px","4xl":"36px"},F={tight:"120%",normal:"140%",relaxed:"150%"},N={none:"0",sm:"0.1px",md:"0.25px",lg:"0.5px"},M={display4xl:{fontSize:L["4xl"],fontWeight:B.bold,lineHeight:F.tight},display3xl:{fontSize:L["3xl"],fontWeight:B.bold,lineHeight:F.tight},display2xl:{fontSize:L["2xl"],fontWeight:B.bold,lineHeight:F.tight},headlineXl:{fontSize:L.xl,fontWeight:B.bold,lineHeight:F.normal},headlineLg:{fontSize:L.lg,fontWeight:B.semibold,lineHeight:F.normal},titleBase:{fontSize:L.base,fontWeight:B.semibold,lineHeight:F.relaxed,letterSpacing:N.sm},titleSm:{fontSize:L.sm,fontWeight:B.semibold,lineHeight:F.relaxed,letterSpacing:N.sm},labelBase:{fontSize:L.base,fontWeight:B.semibold,lineHeight:F.relaxed},labelSm:{fontSize:L.sm,fontWeight:B.semibold,lineHeight:F.relaxed,letterSpacing:N.lg},labelXs:{fontSize:L.xs,fontWeight:B.semibold,lineHeight:F.relaxed,letterSpacing:N.lg},bodyBase:{fontSize:L.base,fontWeight:B.regular,lineHeight:F.relaxed,letterSpacing:N.sm},bodySm:{fontSize:L.sm,fontWeight:B.regular,lineHeight:F.relaxed,letterSpacing:N.md},bodyXs:{fontSize:L.xs,fontWeight:B.regular,lineHeight:F.relaxed,letterSpacing:N.lg},body2xs:{fontSize:L["2xs"],fontWeight:B.regular,lineHeight:F.relaxed,letterSpacing:N.lg}},I={0:"0px",1:"1px",2:"2px",4:"4px",6:"6px",8:"8px",10:"10px",12:"12px",14:"14px",16:"16px",20:"20px",24:"24px",32:"32px",40:"40px",48:"48px",56:"56px",64:"64px",72:"72px",80:"80px"},R={none:"0px",xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px","2xl":"24px",pill:"1000px"},T={buttonLg:"48px",buttonSm:"32px",input:"48px",navBar:"56px",bottomNav:"56px",tabBar:"56px",listItem:"56px",chip:"32px",chipSm:"24px",iconStd:"24px",iconSm:"20px"},$={none:"none",sm:"0 1px 4px rgba(0, 0, 0, 0.08)",md:"0 2px 8px rgba(0, 0, 0, 0.12)",lg:"0 4px 16px rgba(0, 0, 0, 0.16)"},A={filled:{bg:"var(--vetc-color-brand)",bgHover:"var(--vetc-color-brand-hover)",bgActive:"var(--vetc-color-brand-active)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},outlined:{bg:"transparent",bgHover:"var(--vetc-green-02)",bgActive:"var(--vetc-green-05)",text:"var(--vetc-color-brand)",border:"var(--vetc-color-brand)",shadow:"none"},elevated:{bg:"var(--vetc-color-bg)",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-brand)",border:"transparent",shadow:"var(--vetc-shadow-md)"},ghost:{bg:"transparent",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-brand)",border:"transparent",shadow:"none"},danger:{bg:"var(--vetc-color-negative)",bgHover:"var(--vetc-red-60)",bgActive:"var(--vetc-red-60)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},"danger-outlined":{bg:"transparent",bgHover:"var(--vetc-red-02)",bgActive:"var(--vetc-red-05)",text:"var(--vetc-color-negative)",border:"var(--vetc-color-negative)",shadow:"none"}},D={filled:{bg:"var(--vetc-gray-90)",bgHover:"var(--vetc-gray-80)",bgActive:"var(--vetc-gray-70)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},outlined:{bg:"transparent",bgHover:"var(--vetc-gray-05)",bgActive:"var(--vetc-gray-10)",text:"var(--vetc-gray-90)",border:"var(--vetc-gray-90)",shadow:"none"},elevated:{bg:"var(--vetc-color-bg)",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-text-primary)",border:"transparent",shadow:"var(--vetc-shadow-md)"},ghost:{bg:"transparent",bgHover:"var(--vetc-color-bg-hover)",bgActive:"var(--vetc-color-bg-pressed)",text:"var(--vetc-color-text-primary)",border:"transparent",shadow:"none"},danger:{bg:"var(--vetc-color-negative)",bgHover:"var(--vetc-red-60)",bgActive:"var(--vetc-red-60)",text:"var(--vetc-white)",border:"transparent",shadow:"none"},"danger-outlined":{bg:"transparent",bgHover:"var(--vetc-red-02)",bgActive:"var(--vetc-red-05)",text:"var(--vetc-color-negative)",border:"var(--vetc-color-negative)",shadow:"none"}},O=({color:r})=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{animation:"vetc-btn-spin 0.6s linear infinite",flexShrink:0},"aria-hidden":"true",children:[e("circle",{cx:"8",cy:"8",r:"6",stroke:r,strokeOpacity:"0.25",strokeWidth:"2"}),e("path",{d:"M8 2a6 6 0 016 6",stroke:r,strokeWidth:"2",strokeLinecap:"round"})]});function P({style:a="filled",variant:i="brand",size:n="lg",shape:o="rounded",block:l=!1,disabled:c=!1,loading:d=!1,icon:v,iconRight:s,onClick:g,children:h,htmlType:p="button",className:f="",css:b,id:u}){const[m,x]=y(!1),[w,k]=y(!1),S=("neutral"===i?D:A)[a],z=c||d,C="lg"===n?"var(--vetc-btn-height-lg)":"var(--vetc-btn-height-sm)",H="lg"===n?"var(--vetc-btn-font-size-lg)":"var(--vetc-btn-font-size-sm)",W="lg"===n?"var(--vetc-btn-padding-x-lg)":"var(--vetc-btn-padding-x-sm)",B="pill"===o?"var(--vetc-btn-radius-pill)":"lg"===n?"var(--vetc-btn-radius-lg)":"var(--vetc-btn-radius-sm)";let L=S.bg,F=S.border,N=S.shadow;z?(L="var(--vetc-btn-disabled-bg)",F="var(--vetc-btn-disabled-border)",N="none"):m?L=S.bgActive:w&&(L=S.bgHover);const M=z?"var(--vetc-btn-disabled-text)":S.text,I=z?"var(--vetc-gray-30)":S.text;return t(r,{children:[t("button",{id:u,type:p,disabled:z,onClick:g,onMouseEnter:()=>k(!0),onMouseLeave:()=>{k(!1),x(!1)},onMouseDown:()=>x(!0),onMouseUp:()=>x(!1),className:`vetc-btn vetc-btn--${a} vetc-btn--${i} vetc-btn--${n} ${f}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"var(--vetc-space-8)",height:C,width:l?"100%":void 0,paddingInline:W,borderRadius:B,border:`1px solid ${F}`,backgroundColor:L,boxShadow:N,color:M,fontSize:H,fontWeight:"var(--vetc-btn-font-weight)",fontFamily:"var(--vetc-font-family)",lineHeight:"var(--vetc-line-height-relaxed)",cursor:z?"not-allowed":"pointer",transition:"background-color var(--vetc-transition-fast), box-shadow var(--vetc-transition-fast)",userSelect:"none",outline:"none",whiteSpace:"nowrap",...b},children:[d?e(O,{color:I}):v&&e("span",{style:{display:"inline-flex",flexShrink:0},children:v}),h&&e("span",{children:h}),s&&!d&&e("span",{style:{display:"inline-flex",flexShrink:0},children:s})]}),e("style",{children:"@keyframes vetc-btn-spin { to { transform: rotate(360deg); } }"})]})}function j({primary:a,secondary:i=[],content:n,layout:o="inline",variant:l="none"}){const c="inline"===o,d="bounding"===l?{backgroundColor:"var(--vetc-btn-group-bg)",borderTop:"1px solid var(--vetc-btn-group-border-color)",padding:"var(--vetc-btn-group-padding)",fontFamily:"var(--vetc-font-family)"}:{fontFamily:"var(--vetc-font-family)"},v=c?{display:"flex",gap:"var(--vetc-btn-group-gap)",alignItems:"stretch"}:{display:"flex",flexDirection:"column",gap:"var(--vetc-btn-group-gap)"},s=i.map((t,r)=>e(P,{style:"outlined",variant:"neutral",block:!c,loading:t.loading,disabled:t.disabled,onClick:t.onClick,css:c?{flex:1}:void 0,children:t.label},r)),g=e(P,{style:a.danger?"danger":"filled",variant:a.variant??"brand",block:!c,loading:a.loading,disabled:a.disabled,onClick:a.onClick,css:c?{flex:1}:void 0,children:a.label});return t("div",{style:d,children:[n&&e("div",{style:{marginBottom:"var(--vetc-btn-group-padding)"},children:n}),e("div",{style:v,children:t(r,c?{children:[s,g]}:{children:[g,s]})})]})}const X={display4xl:{fontSize:"var(--vetc-font-size-4xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-tight)"},display3xl:{fontSize:"var(--vetc-font-size-3xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-tight)"},display2xl:{fontSize:"var(--vetc-font-size-2xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-tight)"},headlineXl:{fontSize:"var(--vetc-font-size-xl)",fontWeight:"var(--vetc-font-weight-bold)",lineHeight:"var(--vetc-line-height-normal)"},headlineLg:{fontSize:"var(--vetc-font-size-lg)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-normal)"},titleBase:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-sm)"},titleSm:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-sm)"},labelBase:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)"},labelSm:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},labelXs:{fontSize:"var(--vetc-font-size-xs)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},labelXxs:{fontSize:"var(--vetc-font-size-2xs)",fontWeight:"var(--vetc-font-weight-semibold)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},bodyBase:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-sm)"},bodySm:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-md)"},bodyXs:{fontSize:"var(--vetc-font-size-xs)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"},body2xs:{fontSize:"var(--vetc-font-size-2xs)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",letterSpacing:"var(--vetc-letter-spacing-lg)"}},V={primary:"var(--vetc-color-text-primary)",secondary:"var(--vetc-color-text-secondary)",tertiary:"var(--vetc-color-text-tertiary)",disabled:"var(--vetc-color-text-disabled)",brand:"var(--vetc-color-brand)",error:"var(--vetc-color-text-error)",warning:"var(--vetc-color-warning)",success:"var(--vetc-color-positive)",inherit:"inherit"};function E({variant:t="bodyBase",color:r="primary",strikethrough:a=!1,underline:i=!1,truncate:n=!1,lines:o,as:l="span",children:c,className:d="",style:v,id:s}){const g={fontFamily:"var(--vetc-font-family)",margin:0,padding:0,...X[t]??X.bodyBase,color:V[r],textDecoration:a?"line-through":i?"underline":"none",...n&&!o?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:{},...o?{display:"-webkit-box",WebkitLineClamp:o,WebkitBoxOrient:"vertical",overflow:"hidden"}:{},...v};return e(l,{id:s,className:`vetc-text vetc-text--${t} ${d}`,style:g,children:c})}function _({level:t="2xl",...r}){return e(E,{...r,variant:`display${t}`,as:r.as??"h1"})}function q({level:t="xl",...r}){return e(E,{...r,variant:"xl"===t?"headlineXl":"headlineLg",as:r.as??"h2"})}function G({size:t="base",...r}){return e(E,{...r,variant:"base"===t?"titleBase":"titleSm",as:r.as??"h3"})}function Q({size:t="base",...r}){return e(E,{...r,variant:{base:"labelBase",sm:"labelSm",xs:"labelXs",xxs:"labelXxs"}[t],as:r.as??"span"})}function Y({size:t="base",...r}){return e(E,{...r,variant:{base:"bodyBase",sm:"bodySm",xs:"bodyXs","2xs":"body2xs"}[t],as:r.as??"p"})}function K({htmlFor:r,required:a,disabled:i,children:n}){return t("label",{htmlFor:r,style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-label-font-size)",fontWeight:"var(--vetc-input-label-font-weight)",lineHeight:"var(--vetc-line-height-relaxed)",color:i?"var(--vetc-color-text-disabled)":"var(--vetc-input-label-color)",display:"block"},children:[n,a&&e("span",{style:{color:"var(--vetc-color-negative)",marginLeft:"var(--vetc-space-2)"},children:"*"})]})}function U({color:t,children:r}){return e("span",{style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-helper-font-size)",lineHeight:"var(--vetc-line-height-relaxed)",color:t},children:r})}const J={height:"var(--vetc-input-height)",borderRadius:"var(--vetc-input-radius)",paddingInline:"var(--vetc-input-padding-x)",fontSize:"var(--vetc-input-font-size)",fontFamily:"var(--vetc-font-family)"};function Z({label:r,placeholder:a,value:i,defaultValue:n,helperText:l,status:c="default",error:d,disabled:v=!1,readOnly:s=!1,maxLength:g,showCount:h=!1,prefix:p,suffix:f,allowClear:b=!1,onChange:u,onFocus:y,onBlur:m,onPressEnter:x,type:w="text",id:k,name:S,className:z="",style:C,required:H=!1}){const W=!!d?"error":c,B="error"===W?"error":void 0,L=d??l,F="error"===W?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)";return t("div",{className:`vetc-input-wrapper ${z}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",...C},children:[r&&e(K,{htmlFor:k,required:H,disabled:v,children:r}),e(o,{id:k,name:S,type:w,value:i,defaultValue:n,placeholder:a,disabled:v,readOnly:s,maxLength:g,showCount:h,prefix:p,suffix:f,allowClear:b,status:B,onChange:e=>u?.(e.target.value,e),onFocus:y,onBlur:m,onPressEnter:x,style:J}),L&&e(U,{color:F,children:L})]})}function ee({label:r,placeholder:a,value:i,defaultValue:n,helperText:l,status:c="default",error:d,disabled:v=!1,readOnly:s=!1,maxLength:g,onChange:h,onFocus:p,onBlur:f,id:b,name:u,className:y="",style:m,required:x=!1}){const w=!!d,k="error"===(w?"error":c)?"error":void 0,S=d??l,z=w?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)";return t("div",{className:`vetc-input-wrapper ${y??""}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",...m},children:[r&&e(K,{htmlFor:b,required:x,disabled:v,children:r}),e(o.Password,{id:b,name:u,value:i,defaultValue:n,placeholder:a,disabled:v,readOnly:s,maxLength:g,status:k,onChange:e=>h?.(e.target.value,e),onFocus:p,onBlur:f,style:J}),S&&e(U,{color:z,children:S})]})}const{TextArea:te}=o;function re({htmlFor:r,required:a,disabled:i,children:n}){return t("label",{htmlFor:r,style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-label-font-size)",fontWeight:"var(--vetc-input-label-font-weight)",lineHeight:"var(--vetc-line-height-relaxed)",color:i?"var(--vetc-color-text-disabled)":"var(--vetc-input-label-color)",display:"block"},children:[n,a&&e("span",{style:{color:"var(--vetc-color-negative)",marginLeft:"var(--vetc-space-2)"},children:"*"})]})}function ae({label:r,placeholder:a,value:i,defaultValue:n,helperText:o,error:l,disabled:c=!1,readOnly:d=!1,maxLength:v,showCount:s=!1,rows:g=4,autoSize:h,onChange:p,onFocus:f,onBlur:b,id:u,name:y,className:m="",style:x,required:w=!1}){const k=!!l,S=l??o,z=k?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)";return t("div",{className:`vetc-textarea-wrapper ${m}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",...x},children:[r&&e(re,{htmlFor:u,required:w,disabled:c,children:r}),e(te,{id:u,name:y,value:i,defaultValue:n,placeholder:a,disabled:c,readOnly:d,maxLength:v,showCount:s,rows:g,autoSize:h,status:k?"error":void 0,onChange:e=>p?.(e.target.value),onFocus:f,onBlur:b,style:{borderRadius:"var(--vetc-input-radius)",padding:"var(--vetc-input-padding-x)",fontSize:"var(--vetc-input-font-size)",fontFamily:"var(--vetc-font-family)",resize:"vertical"}}),S&&e("span",{style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-helper-font-size)",lineHeight:"var(--vetc-line-height-relaxed)",color:z},children:S})]})}function ie({label:r,placeholder:a,value:i,defaultValue:n,options:o=[],helperText:c,error:d,disabled:v=!1,multiple:s=!1,searchable:g=!1,allowClear:h=!1,loading:p=!1,onChange:f,onSearch:b,id:u,className:y="",style:m,required:x=!1,popupMatchSelectWidth:w=!0}){const k=!!d,S=d??c,z=k?"var(--vetc-input-helper-color-error)":"var(--vetc-input-helper-color)";return t("div",{className:`vetc-select-wrapper ${y}`,style:{display:"flex",flexDirection:"column",gap:"var(--vetc-input-gap)",...m},children:[r&&t("label",{htmlFor:u,style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-label-font-size)",fontWeight:"var(--vetc-input-label-font-weight)",lineHeight:"var(--vetc-line-height-relaxed)",color:v?"var(--vetc-color-text-disabled)":"var(--vetc-input-label-color)",display:"block"},children:[r,x&&e("span",{style:{color:"var(--vetc-color-negative)",marginLeft:"var(--vetc-space-2)"},children:"*"})]}),e(l,{id:u,value:i,defaultValue:n,placeholder:a,options:o,disabled:v,mode:s?"multiple":void 0,showSearch:g,allowClear:h,loading:p,status:k?"error":void 0,onChange:f,onSearch:b,popupMatchSelectWidth:w,style:{height:"var(--vetc-input-height)",width:"100%",fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-font-size)"}}),S&&e("span",{style:{fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-input-helper-font-size)",lineHeight:"var(--vetc-line-height-relaxed)",color:z},children:S})]})}const ne=()=>e("svg",{width:"12",height:"9",viewBox:"0 0 12 9",fill:"none","aria-hidden":"true",children:e("path",{d:"M1 4L4.5 7.5L11 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),oe=()=>e("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none","aria-hidden":"true",children:e("path",{d:"M1 1H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})});function le({label:r,description:a,checked:i,defaultChecked:n=!1,indeterminate:o=!1,disabled:l=!1,variant:c="brand",onChange:d,value:v,id:s,className:g="",style:h}){const[p,f]=y(n),[b,u]=y(!1),m=void 0!==i,x=m?i:p,w="brand"===c?"var(--vetc-color-brand)":"var(--vetc-gray-90)";let k="transparent",S=l?"var(--vetc-color-border-disabled)":b?w:"var(--vetc-color-border)",z="var(--vetc-white)";return(x||o)&&(k=l?"var(--vetc-color-bg-disabled)":w,S=l?"var(--vetc-color-border-disabled)":b?"brand"===c?"var(--vetc-color-brand-hover)":"var(--vetc-gray-70)":w,z=l?"var(--vetc-color-text-disabled)":"var(--vetc-white)",l&&(k="var(--vetc-color-bg-disabled)")),t("label",{htmlFor:s,className:`vetc-checkbox ${g}`,onMouseEnter:()=>!l&&u(!0),onMouseLeave:()=>u(!1),style:{display:"inline-flex",alignItems:a?"flex-start":"center",gap:"var(--vetc-space-12)",cursor:l?"not-allowed":"pointer",userSelect:"none",fontFamily:"var(--vetc-font-family)",...h},children:[e("input",{id:s,type:"checkbox",checked:x,disabled:l,value:v,onChange:()=>{if(l)return;const e=!x;m||f(e),d?.(e)},style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-checked":o?"mixed":x}),t("span",{"aria-hidden":"true",style:{width:"20px",height:"20px",flexShrink:0,borderRadius:"var(--vetc-radius-xs)",border:`1.5px solid ${S}`,backgroundColor:k,display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color var(--vetc-transition-fast), border-color var(--vetc-transition-fast)",color:z,marginTop:a?"2px":0},children:[x&&!o&&e(ne,{}),o&&e(oe,{})]}),(r||a)&&t("span",{style:{display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)"},children:[r&&e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:l?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)"},children:r}),a&&e("span",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:l?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)"},children:a})]})]})}function ce({options:t,value:r,defaultValue:a=[],direction:i="vertical",disabled:n=!1,variant:o="brand",onChange:l,className:c="",style:d}){const[v,s]=y(a),g=void 0!==r,h=g?r:v;return e("div",{className:`vetc-checkbox-group ${c}`,style:{display:"flex",flexDirection:"vertical"===i?"column":"row",flexWrap:"horizontal"===i?"wrap":void 0,gap:"vertical"===i?"var(--vetc-space-12)":"var(--vetc-space-16)",fontFamily:"var(--vetc-font-family)",...d},children:t.map(t=>e(le,{label:t.label,description:t.description,checked:h.includes(t.value),disabled:t.disabled??n,variant:o,value:t.value,onChange:e=>((e,t)=>{const r=t?[...h,e]:h.filter(t=>t!==e);g||s(r),l?.(r)})(t.value,e)},String(t.value)))})}function de({label:r,description:a,checked:i,defaultChecked:n=!1,disabled:o=!1,variant:l="brand",onChange:c,value:d,id:v,className:s="",style:g}){const[h,p]=y(n),[f,b]=y(!1),u=void 0!==i,m=u?i:h,x="brand"===l?"var(--vetc-color-brand)":"var(--vetc-gray-90)",w=o?"var(--vetc-color-border-disabled)":m?f?"brand"===l?"var(--vetc-color-brand-hover)":"var(--vetc-gray-70)":x:f?x:"var(--vetc-color-border)",k=o?"var(--vetc-color-text-disabled)":x;return t("label",{htmlFor:v,className:`vetc-radio ${s}`,onMouseEnter:()=>!o&&b(!0),onMouseLeave:()=>b(!1),style:{display:"inline-flex",alignItems:a?"flex-start":"center",gap:"var(--vetc-space-12)",cursor:o?"not-allowed":"pointer",userSelect:"none",fontFamily:"var(--vetc-font-family)",...g},children:[e("input",{id:v,type:"radio",checked:m,disabled:o,value:d,onChange:()=>{o||m||(u||p(!0),c?.(!0))},style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"}}),e("span",{"aria-hidden":"true",style:{width:"20px",height:"20px",flexShrink:0,borderRadius:"50%",border:`1.5px solid ${w}`,backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color var(--vetc-transition-fast)",marginTop:a?"2px":0},children:m&&e("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:k,flexShrink:0}})}),(r||a)&&t("span",{style:{display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)"},children:[r&&e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:o?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)"},children:r}),a&&e("span",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:o?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)"},children:a})]})]})}function ve({options:t,value:r,defaultValue:a,direction:i="vertical",disabled:n=!1,variant:o="brand",onChange:l,className:c="",style:d}){const[v,s]=y(a),g=void 0!==r,h=g?r:v;return e("div",{role:"radiogroup",className:`vetc-radio-group ${c}`,style:{display:"flex",flexDirection:"vertical"===i?"column":"row",flexWrap:"horizontal"===i?"wrap":void 0,gap:"vertical"===i?"var(--vetc-space-12)":"var(--vetc-space-16)",fontFamily:"var(--vetc-font-family)",...d},children:t.map(t=>e(de,{label:t.label,description:t.description,checked:h===t.value,disabled:t.disabled??n,variant:o,value:t.value,onChange:()=>{return e=t.value,g||s(e),void l?.(e);var e}},String(t.value)))})}function se({label:a,description:i,labelPosition:n="right",checked:o,defaultChecked:l=!1,disabled:c=!1,loading:d=!1,variant:v="brand",onChange:s,id:g,className:h="",style:p}){const[f,b]=y(l),u=void 0!==o,m=u?o:f,x=c||d,w=()=>{if(x)return;const e=!m;u||b(e),s?.(e)},k=t("button",{id:g,type:"button",role:"switch","aria-checked":m,disabled:x,onClick:w,className:`vetc-switch ${h}`,style:{position:"relative",display:"inline-flex",alignItems:"center",width:"var(--vetc-switch-width)",height:"var(--vetc-switch-height)",borderRadius:"var(--vetc-radius-pill)",backgroundColor:x?"var(--vetc-color-bg-disabled)":m?"brand"===v?"var(--vetc-switch-on-bg)":"var(--vetc-gray-90)":"var(--vetc-switch-off-bg)",border:"none",cursor:x?"not-allowed":"pointer",padding:0,flexShrink:0,transition:"background-color var(--vetc-transition-fast)",outline:"none",...a||i?{}:p},children:[e("span",{style:{position:"absolute",left:m?"calc(100% - 30px)":"2px",width:"var(--vetc-switch-thumb-size)",height:"var(--vetc-switch-thumb-size)",borderRadius:"50%",backgroundColor:x?"var(--vetc-gray-20)":"var(--vetc-white)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",transition:"left var(--vetc-transition-fast)",display:"flex",alignItems:"center",justifyContent:"center"},children:d&&t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{animation:"vetc-btn-spin 0.6s linear infinite"},"aria-hidden":"true",children:[e("circle",{cx:"6",cy:"6",r:"4",stroke:"var(--vetc-gray-30)",strokeWidth:"1.5"}),e("path",{d:"M6 2a4 4 0 014 4",stroke:"var(--vetc-color-brand)",strokeWidth:"1.5",strokeLinecap:"round"})]})}),e("style",{children:"@keyframes vetc-btn-spin { to { transform: rotate(360deg); } }"})]});if(!a&&!i)return k;const S=t("span",{style:{display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)",flex:1},children:[a&&e("span",{style:{fontSize:"var(--vetc-font-size-base)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:x?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-primary)"},children:a}),i&&e("span",{style:{fontSize:"var(--vetc-font-size-sm)",fontWeight:"var(--vetc-font-weight-regular)",lineHeight:"var(--vetc-line-height-relaxed)",color:x?"var(--vetc-color-text-disabled)":"var(--vetc-color-text-secondary)"},children:i})]});return e("div",{style:{display:"flex",alignItems:"center",gap:"var(--vetc-space-12)",flexDirection:"left"===n?"row-reverse":"row",fontFamily:"var(--vetc-font-family)",cursor:x?"not-allowed":"pointer",...p},onClick:w,children:t(r,"right"===n?{children:[k,S]}:{children:[S,k]})})}const ge={default:{bg:"var(--vetc-chip-default-bg)",border:"var(--vetc-chip-default-border)",text:"var(--vetc-chip-default-text)",filledBg:"var(--vetc-chip-default-filled-bg)"},brand:{bg:"var(--vetc-chip-brand-bg)",border:"var(--vetc-chip-brand-border)",text:"var(--vetc-chip-brand-text)",filledBg:"var(--vetc-chip-brand-filled-bg)"},positive:{bg:"var(--vetc-chip-positive-bg)",border:"var(--vetc-chip-positive-border)",text:"var(--vetc-chip-positive-text)",filledBg:"var(--vetc-chip-positive-filled-bg)"},negative:{bg:"var(--vetc-chip-negative-bg)",border:"var(--vetc-chip-negative-border)",text:"var(--vetc-chip-negative-text)",filledBg:"var(--vetc-chip-negative-filled-bg)"},warning:{bg:"var(--vetc-chip-warning-bg)",border:"var(--vetc-chip-warning-border)",text:"var(--vetc-chip-warning-text)",filledBg:"var(--vetc-chip-warning-filled-bg)"},info:{bg:"var(--vetc-chip-info-bg)",border:"var(--vetc-chip-info-border)",text:"var(--vetc-chip-info-text)",filledBg:"var(--vetc-chip-info-filled-bg)"}};function he({style:t="tinted",type:r="default",shape:a="pill",size:i="md",icon:n,closable:o=!1,onClose:l,onClick:d,children:v,className:s="",css:g,id:h}){const p=ge[r],f="md"===i?"var(--vetc-chip-height-md)":"var(--vetc-chip-height-sm)",b="md"===i?"var(--vetc-chip-padding-x-md)":"var(--vetc-chip-padding-x-sm)",u="md"===i?"var(--vetc-chip-font-size-md)":"var(--vetc-chip-font-size-sm)",y="pill"===a?"var(--vetc-chip-radius-pill)":"var(--vetc-chip-radius-rounded)";let m=p.bg,x=`1px solid ${p.border}`,w=p.text;return"filled"===t?(m=p.filledBg,x="none",w="var(--vetc-white)"):"outlined"===t&&(m="transparent",x=`1px solid ${p.border}`,w=p.text),e(c,{id:h,closable:o,onClose:e=>{e.preventDefault(),l?.()},onClick:d,icon:n,className:`vetc-chip vetc-chip--${t} vetc-chip--${r} ${s}`,style:{display:"inline-flex",alignItems:"center",height:f,padding:`0 ${b}`,borderRadius:y,background:m,border:x,color:w,fontSize:u,fontWeight:"var(--vetc-chip-font-weight)",fontFamily:"var(--vetc-font-family)",cursor:d?"pointer":"default",userSelect:"none",lineHeight:1,gap:"var(--vetc-space-4)",transition:"var(--vetc-transition-fast)",...g},children:v})}const pe={xl:"var(--vetc-avatar-size-xl)",lg:"var(--vetc-avatar-size-lg)",md:"var(--vetc-avatar-size-md)",sm:"var(--vetc-avatar-size-sm)",xs:"var(--vetc-avatar-size-xs)"},fe={xl:56,lg:48,md:40,sm:32,xs:24},be={xl:"var(--vetc-font-size-2xl)",lg:"var(--vetc-font-size-xl)",md:"var(--vetc-font-size-base)",sm:"var(--vetc-font-size-sm)",xs:"var(--vetc-font-size-2xs)"};function ue({src:t,alt:r,initials:a,icon:i,size:n="md",shape:o="circle",color:l,className:c="",style:v,onClick:s,id:g}){return e("span",{id:g,style:{display:"inline-flex",flexShrink:0,width:pe[n],height:pe[n]},children:e(d,{src:t,alt:r,icon:t||a?void 0:i,size:fe[n],shape:o,onClick:s,className:`vetc-avatar vetc-avatar--${n} ${c}`,style:{backgroundColor:t?void 0:l??"var(--vetc-avatar-bg-default)",fontSize:be[n],fontWeight:"var(--vetc-font-weight-bold)",fontFamily:"var(--vetc-font-family)",color:"var(--vetc-avatar-text-color)",cursor:s?"pointer":"default",flexShrink:0,...v},children:!t&&a?a.slice(0,2).toUpperCase():void 0})})}function ye({elevation:t="outlined",title:r,extra:a,children:i,onClick:n,className:o="",style:l,bodyStyle:c,id:d}){return e(v,{id:d,title:r,extra:a,onClick:n,className:`vetc-card vetc-card--${t} ${o}`,styles:{body:{padding:"var(--vetc-card-padding)",fontFamily:"var(--vetc-font-family)",...c},header:r?{borderBottom:"1px solid var(--vetc-card-border)",padding:"var(--vetc-space-12) var(--vetc-card-padding)"}:void 0},style:{borderRadius:"var(--vetc-card-radius)",border:{flat:"none",raised:"none",outlined:"1px solid var(--vetc-card-border)"}[t],boxShadow:{flat:"var(--vetc-shadow-none)",raised:"var(--vetc-card-shadow-raised)",outlined:"var(--vetc-shadow-none)"}[t],cursor:n?"pointer":"default",overflow:"hidden",backgroundColor:"var(--vetc-card-bg)",fontFamily:"var(--vetc-font-family)",transition:"box-shadow var(--vetc-transition-fast)",...l},children:i})}function me({disabled:t}){return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:e("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:t?"var(--vetc-color-icon-disabled)":"var(--vetc-color-icon-muted)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function xe({leading:r,title:a,description:i,trailing:n,arrow:o=!1,divider:l=!0,onClick:c,disabled:d=!1,className:v="",style:s,id:g}){const h=!!c&&!d;return t("div",{id:g,role:h?"button":void 0,tabIndex:h?0:void 0,className:`vetc-list-item ${v}`,onClick:d?void 0:c,onKeyDown:h?e=>{"Enter"!==e.key&&" "!==e.key||c?.()}:void 0,style:{display:"flex",alignItems:"center",minHeight:"var(--vetc-list-item-height)",padding:"0 var(--vetc-list-item-padding-x)",gap:"var(--vetc-list-item-gap)",cursor:h?"pointer":"default",borderBottom:l?"1px solid var(--vetc-list-item-border)":"none",backgroundColor:"var(--vetc-list-item-bg)",opacity:d?.5:1,fontFamily:"var(--vetc-font-family)",transition:"background-color var(--vetc-transition-fast)",outline:"none",...s},onMouseEnter:e=>{h&&(e.currentTarget.style.backgroundColor="var(--vetc-list-item-bg-hover)")},onMouseLeave:e=>{h&&(e.currentTarget.style.backgroundColor="var(--vetc-list-item-bg)")},children:[r&&e("div",{style:{flexShrink:0,display:"flex",alignItems:"center",color:"var(--vetc-list-item-icon-color)"},children:r}),t("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"var(--vetc-space-2)"},children:[e("span",{style:{fontSize:"var(--vetc-list-item-title-size)",fontWeight:"var(--vetc-list-item-title-weight)",color:d?"var(--vetc-color-text-disabled)":"var(--vetc-list-item-title-color)",lineHeight:"var(--vetc-line-height-relaxed)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a}),i&&e("span",{style:{fontSize:"var(--vetc-list-item-desc-size)",fontWeight:"var(--vetc-font-weight-regular)",color:d?"var(--vetc-color-text-disabled)":"var(--vetc-list-item-desc-color)",lineHeight:"var(--vetc-line-height-relaxed)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i})]}),(n||o)&&t("div",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:"var(--vetc-space-8)",color:"var(--vetc-list-item-icon-color)"},children:[n,o&&e(me,{disabled:d})]})]})}function we({items:t,renderItem:r,bordered:a=!1,className:i="",style:n,id:o}){return e("div",{id:o,className:`vetc-list ${i}`,style:{border:a?"1px solid var(--vetc-color-border-variant)":"none",borderRadius:a?"var(--vetc-card-radius)":0,overflow:"hidden",backgroundColor:"var(--vetc-color-bg)",...n},children:t.map((t,a)=>e(u.Fragment,{children:r(t,a)},a))})}function ke({orientation:t="horizontal",label:r,labelAlign:a="center",thickness:i=1,color:n,margin:o,className:l="",style:c}){const d="vertical"===t;return e(s,{type:d?"vertical":"horizontal",orientationMargin:"center"!==a?0:void 0,orientation:"center"!==a?a:void 0,className:`vetc-divider ${l}`,style:{borderColor:n??"var(--vetc-divider-color)",borderTopWidth:d?void 0:i,borderLeftWidth:d?i:void 0,margin:o??(d?"0 var(--vetc-divider-margin-v)":"var(--vetc-divider-margin-h) 0"),fontFamily:"var(--vetc-font-family)",fontSize:"var(--vetc-divider-label-size)",color:"var(--vetc-divider-label-color)",...c},children:r})}const Se={sm:16,md:24,lg:40};function ze({size:t="md",color:r,fullscreen:a=!1,tip:i,children:n,spinning:o=!0,className:l="",style:c}){const d=e(w,{style:{fontSize:Se[t],color:r??"var(--vetc-spinner-color)"},spin:!0});return n?e(h,{spinning:o,indicator:d,tip:i,className:`vetc-spinner ${l}`,style:c,children:n}):e("div",a?{className:`vetc-spinner-overlay ${l}`,style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--vetc-color-overlay)",zIndex:9999,...c},children:e(h,{spinning:o,indicator:d,tip:i})}:{className:`vetc-spinner ${l}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...c},children:e(h,{spinning:o,indicator:d,tip:i})})}function Ce({rows:t=3,avatar:r=!1,avatarSize:a=40,title:i=!0,loading:n=!0,className:o="",style:l,children:c}){return e(g,{active:!0,loading:n,avatar:!!r&&{size:a,shape:"circle"},title:i,paragraph:{rows:t},className:`vetc-skeleton ${o}`,style:l,children:c})}const He={borderRadius:"var(--vetc-toast-radius)",fontFamily:"var(--vetc-font-family)"},We={show(e){const{type:t="default",message:r,description:a,duration:i=3,placement:n="top",icon:o,onClose:l}=e;"default"!==t?f[t]({message:r,description:a,duration:i,placement:n,icon:o,onClose:l,style:He}):p.open({type:"info",content:r,duration:i,onClose:l})},success:(e,t)=>We.show({message:e,description:t,type:"success"}),error:(e,t)=>We.show({message:e,description:t,type:"error"}),warning:(e,t)=>We.show({message:e,description:t,type:"warning"}),info:(e,t)=>We.show({message:e,description:t,type:"info"})};function Be(){const[e,t]=f.useNotification(),r=t=>{const{type:r="info",message:a,description:i,duration:n=3,placement:o="top",icon:l,onClose:c}=t;e["default"===r?"info":r]({message:a,description:i,duration:n,placement:o,icon:l,onClose:c,style:He})};return{contextHolder:t,toast:{show:r,success:(e,t)=>r({message:e,description:t,type:"success"}),error:(e,t)=>r({message:e,description:t,type:"error"}),warning:(e,t)=>r({message:e,description:t,type:"warning"}),info:(e,t)=>r({message:e,description:t,type:"info"})}}}const Le={height:"var(--vetc-btn-height-lg)",borderRadius:"var(--vetc-btn-radius-lg)",fontWeight:"var(--vetc-btn-font-weight)",fontSize:"var(--vetc-btn-font-size-lg)",fontFamily:"var(--vetc-font-family)"};function Fe({open:t,title:r,children:a,footer:i,okText:n="Xác nhận",cancelText:o="Hủy",okDisabled:l=!1,okLoading:c=!1,okDanger:d=!1,onOk:v,onCancel:s,maskClosable:g=!0,closable:h=!0,width:p,className:f="",style:u,id:y}){return e(b,{open:t,title:r,okText:n,cancelText:o,okButtonProps:{disabled:l,loading:c,danger:d,style:Le},cancelButtonProps:{style:Le},footer:null===i?null:i,onOk:v,onCancel:s,maskClosable:g,closable:h,width:p??"var(--vetc-modal-width)",centered:!0,className:`vetc-modal ${f}`,style:{fontFamily:"var(--vetc-font-family)",...u},styles:{header:{padding:"var(--vetc-modal-padding) var(--vetc-modal-padding) 0",borderBottom:"none"},body:{padding:"var(--vetc-space-8) var(--vetc-modal-padding) var(--vetc-modal-padding)"},footer:{padding:"0 var(--vetc-modal-padding) var(--vetc-modal-padding)",borderTop:"none"},mask:{backgroundColor:"var(--vetc-modal-overlay)"}},children:a})}function Ne(){return{confirm:e=>{b.confirm({title:e.title,content:e.content,okText:e.okText??"Xác nhận",cancelText:e.cancelText??"Hủy",okButtonProps:{danger:e.okDanger,style:{...Le,height:40}},cancelButtonProps:{style:{...Le,height:40}},centered:!0,onOk:e.onOk,onCancel:e.onCancel,styles:{mask:{backgroundColor:"var(--vetc-modal-overlay)"}}})}}}function Me({open:a,image:i,title:n,description:o,okText:l="Xác nhận",cancelText:c="Hủy",okDisabled:d=!1,okLoading:v=!1,okDanger:s=!1,onOk:g,onCancel:h,maskClosable:p=!0}){if(m(()=>(document.body.style.overflow=a?"hidden":"",()=>{document.body.style.overflow=""}),[a]),!a)return null;const f=n||o;return e(r,{children:k(e("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--vetc-dialog-overlay)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,padding:"0 var(--vetc-space-24)"},onClick:p?h:void 0,children:t("div",{style:{width:"100%",maxWidth:"var(--vetc-dialog-width)",backgroundColor:"var(--vetc-dialog-bg)",borderRadius:"var(--vetc-dialog-radius)",overflow:"hidden",boxShadow:"var(--vetc-shadow-lg)",fontFamily:"var(--vetc-font-family)"},onClick:e=>e.stopPropagation(),children:[i&&e("div",{style:{width:"100%",height:"var(--vetc-dialog-image-height)",overflow:"hidden",flexShrink:0},children:e("img",{src:i,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}),f&&t("div",{style:{padding:"var(--vetc-dialog-padding)"},children:[n&&e("div",{style:{fontSize:"var(--vetc-dialog-title-size)",fontWeight:"var(--vetc-dialog-title-weight)",color:"var(--vetc-color-text-primary)",lineHeight:"var(--vetc-line-height-relaxed)",marginBottom:o?"var(--vetc-space-8)":0},children:n}),o&&e("div",{style:{fontSize:"var(--vetc-dialog-desc-size)",color:"var(--vetc-dialog-desc-color)",lineHeight:"var(--vetc-line-height-relaxed)"},children:o})]}),t("div",{style:{display:"flex",gap:"var(--vetc-dialog-btn-gap)",padding:f?"0 var(--vetc-dialog-padding) var(--vetc-dialog-padding)":"var(--vetc-dialog-padding)"},children:[h&&e(P,{block:!0,style:"outlined",variant:"neutral",onClick:h,children:c}),e(P,{block:!0,style:s?"danger":"filled",loading:v,disabled:d,onClick:g,children:l})]})]})}),document.body)})}function Ie({open:a,title:i,children:n,maskClosable:o=!0,showHandle:l=!0,maxHeight:c="90vh",onClose:d,className:v="",style:s,id:g}){return m(()=>(document.body.style.overflow=a?"hidden":"",()=>{document.body.style.overflow=""}),[a]),a?t(r,{children:[e("div",{className:"vetc-bottom-sheet-overlay","aria-hidden":"true",onClick:()=>o&&d?.(),style:{position:"fixed",inset:0,backgroundColor:"var(--vetc-sheet-overlay)",zIndex:1e3,animation:"vetc-fade-in var(--vetc-transition-base)"}}),t("div",{id:g,role:"dialog","aria-modal":"true",className:`vetc-bottom-sheet ${v}`,style:{position:"fixed",bottom:0,left:0,right:0,backgroundColor:"var(--vetc-sheet-bg)",borderRadius:"var(--vetc-sheet-radius) var(--vetc-sheet-radius) 0 0",maxHeight:c,overflowY:"auto",zIndex:1001,fontFamily:"var(--vetc-font-family)",animation:"vetc-slide-up var(--vetc-transition-slow) cubic-bezier(0.32, 0.72, 0, 1)",...s},children:[l&&e("div",{style:{display:"flex",justifyContent:"center",paddingTop:"var(--vetc-space-8)",paddingBottom:"var(--vetc-space-4)"},children:e("div",{style:{width:"var(--vetc-sheet-handle-width)",height:"var(--vetc-sheet-handle-height)",borderRadius:"var(--vetc-radius-pill)",backgroundColor:"var(--vetc-sheet-handle-color)"}})}),i&&t("div",{style:{padding:"var(--vetc-space-12) var(--vetc-sheet-padding)",borderBottom:"1px solid var(--vetc-sheet-border)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e("span",{style:{fontSize:"var(--vetc-sheet-title-size)",fontWeight:"var(--vetc-sheet-title-weight)",color:"var(--vetc-sheet-title-color)",lineHeight:"var(--vetc-line-height-relaxed)"},children:i}),d&&e("button",{onClick:d,"aria-label":"Đóng",style:{background:"none",border:"none",cursor:"pointer",padding:"var(--vetc-space-4)",display:"flex",color:"var(--vetc-color-icon-muted)",borderRadius:"var(--vetc-radius-pill)",transition:"background-color var(--vetc-transition-fast)"},children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),e("div",{style:{padding:"var(--vetc-sheet-padding)"},children:n})]}),e("style",{children:"\n @keyframes vetc-fade-in {\n from { opacity: 0 }\n to { opacity: 1 }\n }\n @keyframes vetc-slide-up {\n from { transform: translateY(100%) }\n to { transform: translateY(0) }\n }\n "})]}):null}function Re(){return e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e("path",{d:"M15 19L8 12L15 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Te(){return e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const $e={background:"none",border:"none",cursor:"pointer",width:"var(--vetc-nav-icon-btn-size)",height:"var(--vetc-nav-icon-btn-size)",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--vetc-radius-pill)",color:"var(--vetc-nav-icon-color)",flexShrink:0,padding:0,transition:"background-color var(--vetc-transition-fast)"};function Ae({title:r,leading:a="none",leadingIcon:i,onLeadingPress:n,actions:o=[],leftSlot:l,rightSlot:c,backgroundColor:d,divider:v=!0,transparent:s=!1,className:g="",style:h,id:p,showBack:f,backIcon:b,onBack:u,left:y,right:m}){const x=f?"back":a,w=i??b,k=n??u;return t("header",{id:p,className:`vetc-nav-bar ${g}`,style:{display:"flex",alignItems:"center",height:"var(--vetc-nav-height)",padding:"0 var(--vetc-nav-padding-x)",backgroundColor:s?"transparent":d??"var(--vetc-nav-bg)",borderBottom:v&&!s?"1px solid var(--vetc-nav-border)":"none",fontFamily:"var(--vetc-font-family)",position:"relative",...h},children:[e("div",{style:{display:"flex",alignItems:"center",minWidth:"var(--vetc-nav-icon-btn-size)",zIndex:1},children:(()=>{if(void 0!==l||void 0!==y)return l??y;if("none"===x)return null;const t=w??e("close"===x?Te:Re,{});return e("button",{onClick:k,style:$e,"aria-label":"close"===x?"Đóng":"Quay lại",children:t})})()}),r&&e("div",{style:{position:"absolute",left:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:e("span",{style:{fontSize:"var(--vetc-nav-title-size)",fontWeight:"var(--vetc-nav-title-weight)",color:"var(--vetc-nav-title-color)",lineHeight:"var(--vetc-line-height-normal)",maxWidth:"60%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})}),e("div",{style:{display:"flex",alignItems:"center",gap:"var(--vetc-space-4)",marginLeft:"auto",zIndex:1},children:void 0!==c||void 0!==m?c??m:o.slice(0,2).map((t,r)=>e("button",{id:t.id,onClick:t.onClick,disabled:t.disabled,"aria-label":t.label,style:{...$e,opacity:t.disabled?.4:1},children:t.icon},r))})]})}function De({items:r,activeKey:a,onChange:i,variant:n="brand",backgroundColor:o,divider:l=!0,className:c="",style:d,id:v}){const s="brand"===n?"var(--vetc-tab-color-active)":"var(--vetc-color-text-primary)";return e("nav",{id:v,className:`vetc-tab-bar ${c}`,style:{display:"flex",alignItems:"stretch",height:"var(--vetc-tab-height)",backgroundColor:o??"var(--vetc-tab-bg)",borderTop:l?"1px solid var(--vetc-tab-border)":"none",fontFamily:"var(--vetc-font-family)",...d},children:r.map(r=>{const n=r.key===a,o=r.disabled?"var(--vetc-tab-color-disabled)":n?s:"var(--vetc-tab-color-inactive)";return t("button",{disabled:r.disabled,onClick:()=>!r.disabled&&i?.(r.key),"aria-current":n?"page":void 0,"aria-label":r.label,className:"vetc-tab-bar__item"+(n?" vetc-tab-bar__item--active":""),style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--vetc-space-2)",background:"none",border:"none",cursor:r.disabled?"not-allowed":"pointer",padding:"var(--vetc-space-6) 0",position:"relative",opacity:r.disabled?.5:1,transition:"color var(--vetc-transition-fast)",color:o},children:[t("div",{style:{position:"relative",display:"inline-flex"},children:[e("span",{style:{color:o,display:"flex",fontSize:"24px",lineHeight:1},children:n&&r.activeIcon?r.activeIcon:r.icon}),void 0!==r.badge&&e("span",{style:{position:"absolute",top:"calc(-1 * var(--vetc-space-4))",right:"calc(-1 * var(--vetc-space-8))",minWidth:"var(--vetc-tab-badge-size)",height:"var(--vetc-tab-badge-size)",backgroundColor:"var(--vetc-tab-badge-bg)",borderRadius:"var(--vetc-radius-pill)",fontSize:"var(--vetc-tab-badge-font-size)",fontWeight:"var(--vetc-font-weight-semibold)",color:"var(--vetc-tab-badge-text)",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 var(--vetc-space-4)",lineHeight:1},children:r.badge})]}),e("span",{style:{fontSize:"var(--vetc-tab-label-size)",fontWeight:"var(--vetc-tab-label-weight)",color:o,lineHeight:"var(--vetc-line-height-relaxed)"},children:r.label})]},r.key)})})}const Oe="undefined"!=typeof window,Pe=(e,t={})=>{const r=Oe&&window.flutter_inappwebview&&window.flutter_inappwebview.callHandler&&"function"==typeof window.flutter_inappwebview.callHandler?window.flutter_inappwebview:null;return r?r.callHandler("MiniAppBridge",{action:e,payload:t}):Promise.resolve({ok:!1,error:"BRIDGE_CALL_FAILED"})};let je=new Map,Xe="/";function Ve(){return je.get(Xe)}function Ee(e){Xe=e}function _e({config:t}){const[r,a]=y(null);if(m(()=>{!function(e){je=new Map(e.pages.map(e=>[e.pathname,e]))}(t);Ee((window.location.pathname||"/").replace("/miniapp","")||"/");let e=Ve()??null;e||(Ee("/"),e=Ve()??null),a(e),Pe("registerAppConfig",{config:t}).catch(()=>{})},[t]),!r)return e("div",{});const i=r.Component;return e(i,{})}function qe(e){const t=x(e);m(()=>{t.current=e},[e]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const e=window.MiniApp,r=()=>{try{t.current?.()}catch(e){console.error("[useAppResume error]",e)}};return e.on("appResume",r),()=>e.off("appResume",r)},[])}function Ge(e){const t=x(e);m(()=>{t.current=e},[e]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const e=window.MiniApp,r=()=>{try{t.current?.()}catch(e){console.error("[useAppPause error]",e)}};return e.on("appPause",r),()=>e.off("appPause",r)},[])}function Qe(e,t){const r=x(t);m(()=>{r.current=t},[t]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const t=window.MiniApp,a=t=>{t?.route===e&&r.current?.(t)};return t.on("didShow",a),()=>t.off("didShow",a)},[e])}function Ye(e,t){const r=x(t);m(()=>{r.current=t},[t]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const t=window.MiniApp,a=t=>{t?.route===e&&r.current?.(t)};return t.on("didHide",a),()=>t.off("didHide",a)},[e])}function Ke(e,t){const r=x(t);m(()=>{r.current=t},[t]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const t=window.MiniApp,a=t=>{t?.route===e&&r.current?.(t)};return t.on("onTapAppBar",a),()=>t.off("onTapAppBar",a)},[e])}function Ue(){return(e,t={},r={})=>{"number"!=typeof e?Pe("navigate",{type:"native",action:"push",route:e,params:t,options:r}).catch(console.error):Pe("navigate",{type:"native",action:"pop",delta:Math.abs(e)})}}function Je(e){const t=x(e);m(()=>{t.current=e},[e]),m(()=>{if("undefined"==typeof window||!window.MiniApp)return;const e=window.MiniApp,r=e=>{try{t.current?.(e)}catch(e){console.error("[useListenerScanQr error]",e)}};return e.on("scanQrResult",r),()=>e.off("scanQrResult",r)},[])}export{_e as App,ue as Avatar,Y as Body,Ie as BottomSheet,P as Button,j as ButtonGroup,ye as Card,le as Checkbox,ce as CheckboxGroup,he as Chip,Me as Dialog,_ as Display,ke as Divider,q as Headline,Z as Input,Q as Label,we as List,xe as ListItem,Fe as Modal,Ae as NavigationBar,ee as PasswordInput,de as Radio,ve as RadioGroup,ie as Select,Ce as SkeletonLoader,ze as Spinner,se as Switch,De as TabBar,ae as Textarea,G as Title,E as Typography,H as VETCProvider,R as borderRadius,z as colorAlias,S as colorGlobal,T as componentHeight,W as fontFamily,L as fontSize,B as fontWeight,N as letterSpacing,F as lineHeight,$ as shadow,I as spacing,M as textStyle,We as toast,Ge as useAppPause,qe as useAppResume,Ne as useConfirm,Ye as useDidHide,Qe as useDidShow,Je as useListenerScanQr,Ue as useNavigate,Ke as useTapAppBar,Be as useToast,C as vetcAntdTheme};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vetc-miniapp/ui-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "MiniApp Platform UI React",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "tsc -p tsconfig.build.json && cp src/ui-react/styles/tokens.css dist/styles/tokens.css"
|
|
20
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && rollup -c && mkdir -p dist/styles && cp src/ui-react/styles/tokens.css dist/styles/tokens.css"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
23
|
"miniapp",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
37
37
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
38
38
|
"@rollup/plugin-terser": "^0.4.4",
|
|
39
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
39
40
|
"@types/node": "^25.2.0",
|
|
40
41
|
"@types/react": "^19.2.14",
|
|
41
42
|
"@types/react-dom": "^19.2.3",
|
package/dist/bridge.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* ================= Types ================= */
|
|
2
|
-
/* ================= Runtime helpers ================= */
|
|
3
|
-
export const isBrowser = typeof window !== "undefined";
|
|
4
|
-
export const getBridge = () => {
|
|
5
|
-
if (!isBrowser || !window.flutter_inappwebview || !window.flutter_inappwebview.callHandler || typeof window.flutter_inappwebview.callHandler != "function") {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
return window.flutter_inappwebview;
|
|
9
|
-
};
|
|
10
|
-
/* ================= Core bridge call ================= */
|
|
11
|
-
export const callHost = (action, payload = {}) => {
|
|
12
|
-
const bridge = getBridge();
|
|
13
|
-
if (!bridge) {
|
|
14
|
-
return Promise.resolve({ ok: false, error: "BRIDGE_CALL_FAILED" });
|
|
15
|
-
}
|
|
16
|
-
return bridge.callHandler("MiniAppBridge", {
|
|
17
|
-
action,
|
|
18
|
-
payload,
|
|
19
|
-
});
|
|
20
|
-
};
|
package/dist/components/app.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { callHost } from "../bridge";
|
|
4
|
-
let routeMap = new Map();
|
|
5
|
-
let currentPath = "/";
|
|
6
|
-
export function initRouter(config) {
|
|
7
|
-
routeMap = new Map(config.pages.map((p) => [p.pathname, p]));
|
|
8
|
-
}
|
|
9
|
-
export function getCurrentPage() {
|
|
10
|
-
return routeMap.get(currentPath);
|
|
11
|
-
}
|
|
12
|
-
export function setCurrentPath(path) {
|
|
13
|
-
currentPath = path;
|
|
14
|
-
}
|
|
15
|
-
export function App({ config }) {
|
|
16
|
-
const [page, setPage] = useState(null);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
initRouter(config);
|
|
19
|
-
const rawPath = window.location.pathname || "/";
|
|
20
|
-
const path = rawPath.replace("/miniapp", "") || "/";
|
|
21
|
-
setCurrentPath(path);
|
|
22
|
-
let current = getCurrentPage() ?? null;
|
|
23
|
-
if (!current) {
|
|
24
|
-
setCurrentPath("/");
|
|
25
|
-
current = getCurrentPage() ?? null;
|
|
26
|
-
}
|
|
27
|
-
setPage(current);
|
|
28
|
-
callHost("registerAppConfig", { config });
|
|
29
|
-
}, [config]);
|
|
30
|
-
if (!page)
|
|
31
|
-
return _jsx("div", {});
|
|
32
|
-
const Component = page.Component;
|
|
33
|
-
return _jsx(Component, {});
|
|
34
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Avatar as AntAvatar } from 'antd';
|
|
3
|
-
// Map size token name to CSS var
|
|
4
|
-
const sizeVarMap = {
|
|
5
|
-
xl: 'var(--vetc-avatar-size-xl)',
|
|
6
|
-
lg: 'var(--vetc-avatar-size-lg)',
|
|
7
|
-
md: 'var(--vetc-avatar-size-md)',
|
|
8
|
-
sm: 'var(--vetc-avatar-size-sm)',
|
|
9
|
-
xs: 'var(--vetc-avatar-size-xs)',
|
|
10
|
-
};
|
|
11
|
-
// Pixel values needed for antd size prop (numeric)
|
|
12
|
-
const sizePxMap = { xl: 56, lg: 48, md: 40, sm: 32, xs: 24 };
|
|
13
|
-
// Font size scales with avatar size (from Figma)
|
|
14
|
-
const fontSizeMap = {
|
|
15
|
-
xl: 'var(--vetc-font-size-2xl)',
|
|
16
|
-
lg: 'var(--vetc-font-size-xl)',
|
|
17
|
-
md: 'var(--vetc-font-size-base)',
|
|
18
|
-
sm: 'var(--vetc-font-size-sm)',
|
|
19
|
-
xs: 'var(--vetc-font-size-2xs)',
|
|
20
|
-
};
|
|
21
|
-
export function Avatar({ src, alt, initials, icon, size = 'md', shape = 'circle', color, className = '', style, onClick, id, }) {
|
|
22
|
-
return (_jsx("span", { id: id, style: { display: 'inline-flex', flexShrink: 0, width: sizeVarMap[size], height: sizeVarMap[size] }, children: _jsx(AntAvatar, { src: src, alt: alt, icon: !src && !initials ? icon : undefined, size: sizePxMap[size], shape: shape, onClick: onClick, className: `vetc-avatar vetc-avatar--${size} ${className}`, style: {
|
|
23
|
-
backgroundColor: !src ? (color ?? 'var(--vetc-avatar-bg-default)') : undefined,
|
|
24
|
-
fontSize: fontSizeMap[size],
|
|
25
|
-
fontWeight: 'var(--vetc-font-weight-bold)',
|
|
26
|
-
fontFamily: 'var(--vetc-font-family)',
|
|
27
|
-
color: 'var(--vetc-avatar-text-color)',
|
|
28
|
-
cursor: onClick ? 'pointer' : 'default',
|
|
29
|
-
flexShrink: 0,
|
|
30
|
-
...style,
|
|
31
|
-
}, children: !src && initials ? initials.slice(0, 2).toUpperCase() : undefined }) }));
|
|
32
|
-
}
|
|
33
|
-
export default Avatar;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Avatar } from './Avatar';
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* VETC BottomSheet — tokenized
|
|
4
|
-
* Figma: Sheet page — 16px top radius, handle bar, slide-up animation
|
|
5
|
-
*/
|
|
6
|
-
import { useEffect } from 'react';
|
|
7
|
-
export function BottomSheet({ open, title, children, maskClosable = true, showHandle = true, maxHeight = '90vh', onClose, className = '', style, id, }) {
|
|
8
|
-
// Lock body scroll when open
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
document.body.style.overflow = open ? 'hidden' : '';
|
|
11
|
-
return () => { document.body.style.overflow = ''; };
|
|
12
|
-
}, [open]);
|
|
13
|
-
if (!open)
|
|
14
|
-
return null;
|
|
15
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "vetc-bottom-sheet-overlay", "aria-hidden": "true", onClick: () => maskClosable && onClose?.(), style: {
|
|
16
|
-
position: 'fixed',
|
|
17
|
-
inset: 0,
|
|
18
|
-
backgroundColor: 'var(--vetc-sheet-overlay)',
|
|
19
|
-
zIndex: 1000,
|
|
20
|
-
animation: 'vetc-fade-in var(--vetc-transition-base)',
|
|
21
|
-
} }), _jsxs("div", { id: id, role: "dialog", "aria-modal": "true", className: `vetc-bottom-sheet ${className}`, style: {
|
|
22
|
-
position: 'fixed',
|
|
23
|
-
bottom: 0,
|
|
24
|
-
left: 0,
|
|
25
|
-
right: 0,
|
|
26
|
-
backgroundColor: 'var(--vetc-sheet-bg)',
|
|
27
|
-
borderRadius: `var(--vetc-sheet-radius) var(--vetc-sheet-radius) 0 0`,
|
|
28
|
-
maxHeight,
|
|
29
|
-
overflowY: 'auto',
|
|
30
|
-
zIndex: 1001,
|
|
31
|
-
fontFamily: 'var(--vetc-font-family)',
|
|
32
|
-
animation: 'vetc-slide-up var(--vetc-transition-slow) cubic-bezier(0.32, 0.72, 0, 1)',
|
|
33
|
-
...style,
|
|
34
|
-
}, children: [showHandle && (_jsx("div", { style: { display: 'flex', justifyContent: 'center', paddingTop: 'var(--vetc-space-8)', paddingBottom: 'var(--vetc-space-4)' }, children: _jsx("div", { style: {
|
|
35
|
-
width: 'var(--vetc-sheet-handle-width)',
|
|
36
|
-
height: 'var(--vetc-sheet-handle-height)',
|
|
37
|
-
borderRadius: 'var(--vetc-radius-pill)',
|
|
38
|
-
backgroundColor: 'var(--vetc-sheet-handle-color)',
|
|
39
|
-
} }) })), title && (_jsxs("div", { style: {
|
|
40
|
-
padding: `var(--vetc-space-12) var(--vetc-sheet-padding)`,
|
|
41
|
-
borderBottom: `1px solid var(--vetc-sheet-border)`,
|
|
42
|
-
display: 'flex',
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
justifyContent: 'space-between',
|
|
45
|
-
}, children: [_jsx("span", { style: {
|
|
46
|
-
fontSize: 'var(--vetc-sheet-title-size)',
|
|
47
|
-
fontWeight: 'var(--vetc-sheet-title-weight)',
|
|
48
|
-
color: 'var(--vetc-sheet-title-color)',
|
|
49
|
-
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
50
|
-
}, children: title }), onClose && (_jsx("button", { onClick: onClose, "aria-label": "\u0110\u00F3ng", style: {
|
|
51
|
-
background: 'none',
|
|
52
|
-
border: 'none',
|
|
53
|
-
cursor: 'pointer',
|
|
54
|
-
padding: 'var(--vetc-space-4)',
|
|
55
|
-
display: 'flex',
|
|
56
|
-
color: 'var(--vetc-color-icon-muted)',
|
|
57
|
-
borderRadius: 'var(--vetc-radius-pill)',
|
|
58
|
-
transition: 'background-color var(--vetc-transition-fast)',
|
|
59
|
-
}, children: _jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M18 6L6 18M6 6L18 18", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) }))] })), _jsx("div", { style: { padding: 'var(--vetc-sheet-padding)' }, children: children })] }), _jsx("style", { children: `
|
|
60
|
-
@keyframes vetc-fade-in {
|
|
61
|
-
from { opacity: 0 }
|
|
62
|
-
to { opacity: 1 }
|
|
63
|
-
}
|
|
64
|
-
@keyframes vetc-slide-up {
|
|
65
|
-
from { transform: translateY(100%) }
|
|
66
|
-
to { transform: translateY(0) }
|
|
67
|
-
}
|
|
68
|
-
` })] }));
|
|
69
|
-
}
|
|
70
|
-
export default BottomSheet;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { BottomSheet } from './BottomSheet';
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* VETC Button Component
|
|
4
|
-
* Figma: filled/outlined/elevated/ghost styles
|
|
5
|
-
* Large: h=48px, radius=12px, font=16px/600
|
|
6
|
-
* Small: h=32px, radius=8px, font=14px/600
|
|
7
|
-
* style: filled | outlined | elevated | ghost | danger | danger-outlined
|
|
8
|
-
* variant: brand (green) | neutral (gray-90)
|
|
9
|
-
*/
|
|
10
|
-
import { useState } from 'react';
|
|
11
|
-
const BRAND = {
|
|
12
|
-
filled: {
|
|
13
|
-
bg: 'var(--vetc-color-brand)',
|
|
14
|
-
bgHover: 'var(--vetc-color-brand-hover)',
|
|
15
|
-
bgActive: 'var(--vetc-color-brand-active)',
|
|
16
|
-
text: 'var(--vetc-white)',
|
|
17
|
-
border: 'transparent',
|
|
18
|
-
shadow: 'none',
|
|
19
|
-
},
|
|
20
|
-
outlined: {
|
|
21
|
-
bg: 'transparent',
|
|
22
|
-
bgHover: 'var(--vetc-green-02)',
|
|
23
|
-
bgActive: 'var(--vetc-green-05)',
|
|
24
|
-
text: 'var(--vetc-color-brand)',
|
|
25
|
-
border: 'var(--vetc-color-brand)',
|
|
26
|
-
shadow: 'none',
|
|
27
|
-
},
|
|
28
|
-
elevated: {
|
|
29
|
-
bg: 'var(--vetc-color-bg)',
|
|
30
|
-
bgHover: 'var(--vetc-color-bg-hover)',
|
|
31
|
-
bgActive: 'var(--vetc-color-bg-pressed)',
|
|
32
|
-
text: 'var(--vetc-color-brand)',
|
|
33
|
-
border: 'transparent',
|
|
34
|
-
shadow: 'var(--vetc-shadow-md)',
|
|
35
|
-
},
|
|
36
|
-
ghost: {
|
|
37
|
-
bg: 'transparent',
|
|
38
|
-
bgHover: 'var(--vetc-color-bg-hover)',
|
|
39
|
-
bgActive: 'var(--vetc-color-bg-pressed)',
|
|
40
|
-
text: 'var(--vetc-color-brand)',
|
|
41
|
-
border: 'transparent',
|
|
42
|
-
shadow: 'none',
|
|
43
|
-
},
|
|
44
|
-
danger: {
|
|
45
|
-
bg: 'var(--vetc-color-negative)',
|
|
46
|
-
bgHover: 'var(--vetc-red-60)',
|
|
47
|
-
bgActive: 'var(--vetc-red-60)',
|
|
48
|
-
text: 'var(--vetc-white)',
|
|
49
|
-
border: 'transparent',
|
|
50
|
-
shadow: 'none',
|
|
51
|
-
},
|
|
52
|
-
'danger-outlined': {
|
|
53
|
-
bg: 'transparent',
|
|
54
|
-
bgHover: 'var(--vetc-red-02)',
|
|
55
|
-
bgActive: 'var(--vetc-red-05)',
|
|
56
|
-
text: 'var(--vetc-color-negative)',
|
|
57
|
-
border: 'var(--vetc-color-negative)',
|
|
58
|
-
shadow: 'none',
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
const NEUTRAL = {
|
|
62
|
-
filled: {
|
|
63
|
-
bg: 'var(--vetc-gray-90)',
|
|
64
|
-
bgHover: 'var(--vetc-gray-80)',
|
|
65
|
-
bgActive: 'var(--vetc-gray-70)',
|
|
66
|
-
text: 'var(--vetc-white)',
|
|
67
|
-
border: 'transparent',
|
|
68
|
-
shadow: 'none',
|
|
69
|
-
},
|
|
70
|
-
outlined: {
|
|
71
|
-
bg: 'transparent',
|
|
72
|
-
bgHover: 'var(--vetc-gray-05)',
|
|
73
|
-
bgActive: 'var(--vetc-gray-10)',
|
|
74
|
-
text: 'var(--vetc-gray-90)',
|
|
75
|
-
border: 'var(--vetc-gray-90)',
|
|
76
|
-
shadow: 'none',
|
|
77
|
-
},
|
|
78
|
-
elevated: {
|
|
79
|
-
bg: 'var(--vetc-color-bg)',
|
|
80
|
-
bgHover: 'var(--vetc-color-bg-hover)',
|
|
81
|
-
bgActive: 'var(--vetc-color-bg-pressed)',
|
|
82
|
-
text: 'var(--vetc-color-text-primary)',
|
|
83
|
-
border: 'transparent',
|
|
84
|
-
shadow: 'var(--vetc-shadow-md)',
|
|
85
|
-
},
|
|
86
|
-
ghost: {
|
|
87
|
-
bg: 'transparent',
|
|
88
|
-
bgHover: 'var(--vetc-color-bg-hover)',
|
|
89
|
-
bgActive: 'var(--vetc-color-bg-pressed)',
|
|
90
|
-
text: 'var(--vetc-color-text-primary)',
|
|
91
|
-
border: 'transparent',
|
|
92
|
-
shadow: 'none',
|
|
93
|
-
},
|
|
94
|
-
// danger variants are semantic — variant (brand/neutral) has no effect
|
|
95
|
-
danger: {
|
|
96
|
-
bg: 'var(--vetc-color-negative)',
|
|
97
|
-
bgHover: 'var(--vetc-red-60)',
|
|
98
|
-
bgActive: 'var(--vetc-red-60)',
|
|
99
|
-
text: 'var(--vetc-white)',
|
|
100
|
-
border: 'transparent',
|
|
101
|
-
shadow: 'none',
|
|
102
|
-
},
|
|
103
|
-
'danger-outlined': {
|
|
104
|
-
bg: 'transparent',
|
|
105
|
-
bgHover: 'var(--vetc-red-02)',
|
|
106
|
-
bgActive: 'var(--vetc-red-05)',
|
|
107
|
-
text: 'var(--vetc-color-negative)',
|
|
108
|
-
border: 'var(--vetc-color-negative)',
|
|
109
|
-
shadow: 'none',
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
const LoadingSpinner = ({ color }) => (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", style: { animation: 'vetc-btn-spin 0.6s linear infinite', flexShrink: 0 }, "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "8", r: "6", stroke: color, strokeOpacity: "0.25", strokeWidth: "2" }), _jsx("path", { d: "M8 2a6 6 0 016 6", stroke: color, strokeWidth: "2", strokeLinecap: "round" })] }));
|
|
113
|
-
export function Button({ style = 'filled', variant = 'brand', size = 'lg', shape = 'rounded', block = false, disabled = false, loading = false, icon, iconRight, onClick, children, htmlType = 'button', className = '', css, id, }) {
|
|
114
|
-
const [pressed, setPressed] = useState(false);
|
|
115
|
-
const [hovered, setHovered] = useState(false);
|
|
116
|
-
const tokens = (variant === 'neutral' ? NEUTRAL : BRAND)[style];
|
|
117
|
-
const isDisabled = disabled || loading;
|
|
118
|
-
const height = size === 'lg' ? 'var(--vetc-btn-height-lg)' : 'var(--vetc-btn-height-sm)';
|
|
119
|
-
const fontSize = size === 'lg' ? 'var(--vetc-btn-font-size-lg)' : 'var(--vetc-btn-font-size-sm)';
|
|
120
|
-
const paddingX = size === 'lg' ? 'var(--vetc-btn-padding-x-lg)' : 'var(--vetc-btn-padding-x-sm)';
|
|
121
|
-
const radius = shape === 'pill' ? 'var(--vetc-btn-radius-pill)'
|
|
122
|
-
: size === 'lg' ? 'var(--vetc-btn-radius-lg)'
|
|
123
|
-
: 'var(--vetc-btn-radius-sm)';
|
|
124
|
-
let bg = tokens.bg;
|
|
125
|
-
let border = tokens.border;
|
|
126
|
-
let shadow = tokens.shadow;
|
|
127
|
-
if (isDisabled) {
|
|
128
|
-
bg = 'var(--vetc-btn-disabled-bg)';
|
|
129
|
-
border = 'var(--vetc-btn-disabled-border)';
|
|
130
|
-
shadow = 'none';
|
|
131
|
-
}
|
|
132
|
-
else if (pressed) {
|
|
133
|
-
bg = tokens.bgActive;
|
|
134
|
-
}
|
|
135
|
-
else if (hovered) {
|
|
136
|
-
bg = tokens.bgHover;
|
|
137
|
-
}
|
|
138
|
-
const textColor = isDisabled ? 'var(--vetc-btn-disabled-text)' : tokens.text;
|
|
139
|
-
const spinnerColor = isDisabled ? 'var(--vetc-gray-30)' : tokens.text;
|
|
140
|
-
return (_jsxs(_Fragment, { children: [_jsxs("button", { id: id, type: htmlType, disabled: isDisabled, onClick: onClick, onMouseEnter: () => setHovered(true), onMouseLeave: () => { setHovered(false); setPressed(false); }, onMouseDown: () => setPressed(true), onMouseUp: () => setPressed(false), className: `vetc-btn vetc-btn--${style} vetc-btn--${variant} vetc-btn--${size} ${className}`, style: {
|
|
141
|
-
display: 'inline-flex',
|
|
142
|
-
alignItems: 'center',
|
|
143
|
-
justifyContent: 'center',
|
|
144
|
-
gap: 'var(--vetc-space-8)',
|
|
145
|
-
height,
|
|
146
|
-
width: block ? '100%' : undefined,
|
|
147
|
-
paddingInline: paddingX,
|
|
148
|
-
borderRadius: radius,
|
|
149
|
-
border: `1px solid ${border}`,
|
|
150
|
-
backgroundColor: bg,
|
|
151
|
-
boxShadow: shadow,
|
|
152
|
-
color: textColor,
|
|
153
|
-
fontSize,
|
|
154
|
-
fontWeight: 'var(--vetc-btn-font-weight)',
|
|
155
|
-
fontFamily: 'var(--vetc-font-family)',
|
|
156
|
-
lineHeight: 'var(--vetc-line-height-relaxed)',
|
|
157
|
-
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
158
|
-
transition: 'background-color var(--vetc-transition-fast), box-shadow var(--vetc-transition-fast)',
|
|
159
|
-
userSelect: 'none',
|
|
160
|
-
outline: 'none',
|
|
161
|
-
whiteSpace: 'nowrap',
|
|
162
|
-
...css,
|
|
163
|
-
}, children: [loading ? _jsx(LoadingSpinner, { color: spinnerColor }) : icon && _jsx("span", { style: { display: 'inline-flex', flexShrink: 0 }, children: icon }), children && _jsx("span", { children: children }), iconRight && !loading && _jsx("span", { style: { display: 'inline-flex', flexShrink: 0 }, children: iconRight })] }), _jsx("style", { children: `@keyframes vetc-btn-spin { to { transform: rotate(360deg); } }` })] }));
|
|
164
|
-
}
|
|
165
|
-
export default Button;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Button } from './Button';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from '../button';
|
|
3
|
-
export function ButtonGroup({ primary, secondary = [], content, layout = 'inline', variant = 'none', }) {
|
|
4
|
-
const isInline = layout === 'inline';
|
|
5
|
-
const isBounding = variant === 'bounding';
|
|
6
|
-
const containerStyle = isBounding
|
|
7
|
-
? {
|
|
8
|
-
backgroundColor: 'var(--vetc-btn-group-bg)',
|
|
9
|
-
borderTop: `1px solid var(--vetc-btn-group-border-color)`,
|
|
10
|
-
padding: 'var(--vetc-btn-group-padding)',
|
|
11
|
-
fontFamily: 'var(--vetc-font-family)',
|
|
12
|
-
}
|
|
13
|
-
: { fontFamily: 'var(--vetc-font-family)' };
|
|
14
|
-
const rowStyle = isInline
|
|
15
|
-
? { display: 'flex', gap: 'var(--vetc-btn-group-gap)', alignItems: 'stretch' }
|
|
16
|
-
: { display: 'flex', flexDirection: 'column', gap: 'var(--vetc-btn-group-gap)' };
|
|
17
|
-
const secondaryBtns = secondary.map((action, i) => (_jsx(Button, { style: "outlined", variant: "neutral", block: !isInline, loading: action.loading, disabled: action.disabled, onClick: action.onClick, css: isInline ? { flex: 1 } : undefined, children: action.label }, i)));
|
|
18
|
-
const primaryBtn = (_jsx(Button, { style: primary.danger ? 'danger' : 'filled', variant: primary.variant ?? 'brand', block: !isInline, loading: primary.loading, disabled: primary.disabled, onClick: primary.onClick, css: isInline ? { flex: 1 } : undefined, children: primary.label }));
|
|
19
|
-
return (_jsxs("div", { style: containerStyle, children: [content && (_jsx("div", { style: { marginBottom: 'var(--vetc-btn-group-padding)' }, children: content })), _jsx("div", { style: rowStyle, children: isInline ? (_jsxs(_Fragment, { children: [secondaryBtns, primaryBtn] })) : (_jsxs(_Fragment, { children: [primaryBtn, secondaryBtns] })) })] }));
|
|
20
|
-
}
|
|
21
|
-
export default ButtonGroup;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ButtonGroup } from './ButtonGroup';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Card as AntCard } from 'antd';
|
|
3
|
-
export function Card({ elevation = 'outlined', title, extra, children, onClick, className = '', style, bodyStyle, id, }) {
|
|
4
|
-
const shadowMap = {
|
|
5
|
-
flat: 'var(--vetc-shadow-none)',
|
|
6
|
-
raised: 'var(--vetc-card-shadow-raised)',
|
|
7
|
-
outlined: 'var(--vetc-shadow-none)',
|
|
8
|
-
};
|
|
9
|
-
const borderMap = {
|
|
10
|
-
flat: 'none',
|
|
11
|
-
raised: 'none',
|
|
12
|
-
outlined: `1px solid var(--vetc-card-border)`,
|
|
13
|
-
};
|
|
14
|
-
return (_jsx(AntCard, { id: id, title: title, extra: extra, onClick: onClick, className: `vetc-card vetc-card--${elevation} ${className}`, styles: {
|
|
15
|
-
body: {
|
|
16
|
-
padding: 'var(--vetc-card-padding)',
|
|
17
|
-
fontFamily: 'var(--vetc-font-family)',
|
|
18
|
-
...bodyStyle,
|
|
19
|
-
},
|
|
20
|
-
header: title
|
|
21
|
-
? { borderBottom: `1px solid var(--vetc-card-border)`, padding: `var(--vetc-space-12) var(--vetc-card-padding)` }
|
|
22
|
-
: undefined,
|
|
23
|
-
}, style: {
|
|
24
|
-
borderRadius: 'var(--vetc-card-radius)',
|
|
25
|
-
border: borderMap[elevation],
|
|
26
|
-
boxShadow: shadowMap[elevation],
|
|
27
|
-
cursor: onClick ? 'pointer' : 'default',
|
|
28
|
-
overflow: 'hidden',
|
|
29
|
-
backgroundColor: 'var(--vetc-card-bg)',
|
|
30
|
-
fontFamily: 'var(--vetc-font-family)',
|
|
31
|
-
transition: `box-shadow var(--vetc-transition-fast)`,
|
|
32
|
-
...style,
|
|
33
|
-
}, children: children }));
|
|
34
|
-
}
|
|
35
|
-
export default Card;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Card } from './Card';
|