@stokelp/ui 2.113.0 → 2.115.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +1 -0
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.cjs +2 -0
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.cjs.map +1 -0
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.d.ts +9 -0
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.js +99 -0
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.js.map +1 -0
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs +2 -0
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs.map +1 -0
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.d.ts +53 -0
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js +232 -0
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js.map +1 -0
- package/dist/components/supplier-rating-badge/index.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +16 -14
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs +2 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js +25 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js.map +1 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs +2 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js +25 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js.map +1 -0
- package/dist/ui.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require("../text/Text.cjs"),t=require("../popover/Popover.cjs"),n=require("./SupplierRatingBreakdown.cjs");let r=require("@stokelp/styled-system/jsx"),i=require("react"),a=require("react/jsx-runtime");function o(e){let t=e/5;return t>=.8?{bg:`#E6F3D9`,color:`#3B6D11`}:t>=.6?{bg:`#FBF1CC`,color:`#92750C`}:t>=.4?{bg:`#FDF0E0`,color:`#C2740C`}:{bg:`#FCEBEB`,color:`#A32D2D`}}function s({rating:s,responseRate:c,labels:l}){let[u,d]=(0,i.useState)(!1),f=(0,i.useRef)(null),p=(0,i.useCallback)(()=>{f.current&&=(clearTimeout(f.current),null)},[]),m=(0,i.useCallback)(()=>{p(),f.current=setTimeout(()=>d(!1),120)},[p]);(0,i.useEffect)(()=>p,[p]);let h=e=>{e.pointerType===`mouse`&&(p(),d(!0))},g=e=>{e.pointerType===`mouse`&&m()},_=s.insufficientData||s.overall==null,v=l?.insufficientData??n.DEFAULT_SUPPLIER_RATING_LABELS.insufficientData,y=_?{bg:`#F1F2F4`,color:`#5B6472`}:o(s.overall);return(0,a.jsxs)(t.Popover,{open:u,onOpenChange:e=>d(e.open),positioning:{placement:`top-end`,gutter:8},autoFocus:!1,restoreFocus:!1,lazyMount:!0,unmountOnExit:!0,children:[(0,a.jsx)(t.PopoverTrigger,{asChild:!0,children:(0,a.jsx)(r.Box,{display:`inline-flex`,alignItems:`center`,w:`fit-content`,maxW:`100%`,px:`space-8`,py:`space-2`,borderRadius:`full`,tabIndex:0,cursor:`default`,style:{backgroundColor:y.bg},onPointerEnter:h,onPointerLeave:g,onFocus:()=>{p(),d(!0)},onBlur:()=>d(!1),children:(0,a.jsx)(e.Text,{size:`sm`,bold:!0,whiteSpace:`nowrap`,style:{color:y.color},children:_?v:`${n.formatOverall(s.overall)} ★`})})}),(0,a.jsx)(t.PopoverContent,{className:`panda-preflight-enabled`,zIndex:1e4,p:`0`,bg:`transparent`,border:`none`,borderRadius:`radius-8`,boxShadow:`0px 8px 16px 4px #1624861A`,onPointerEnter:h,onPointerLeave:g,children:(0,a.jsx)(n.SupplierRatingBreakdown,{rating:s,responseRate:c,labels:l})})]})}exports.SupplierRatingBadge=s;
|
|
2
|
+
//# sourceMappingURL=SupplierRatingBadge.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupplierRatingBadge.cjs","names":[],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBadge.tsx"],"sourcesContent":["import { Box } from '@stokelp/styled-system/jsx'\nimport { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { Popover, PopoverContent, PopoverTrigger, Text } from '~/components'\n\nimport {\n DEFAULT_SUPPLIER_RATING_LABELS,\n formatOverall,\n SUPPLIER_RATING_MAX,\n SupplierRatingBreakdown,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './SupplierRatingBreakdown'\n\nexport type SupplierRatingBadgeProps = {\n rating: SupplierRating\n /** Optional original response rate (0..100) reminded inside the breakdown. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nfunction getBadgeColors(overall: number): { bg: string; color: string } {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.8) return { bg: '#E6F3D9', color: '#3B6D11' }\n if (ratio >= 0.6) return { bg: '#FBF1CC', color: '#92750C' }\n if (ratio >= 0.4) return { bg: '#FDF0E0', color: '#C2740C' }\n return { bg: '#FCEBEB', color: '#A32D2D' }\n}\n\n/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */\nexport function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps) {\n const [open, setOpen] = useState(false)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n }, [])\n\n const scheduleClose = useCallback(() => {\n cancelClose()\n closeTimer.current = setTimeout(() => setOpen(false), 120)\n }, [cancelClose])\n\n useEffect(() => cancelClose, [cancelClose])\n\n const openOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n cancelClose()\n setOpen(true)\n }\n const closeOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n scheduleClose()\n }\n\n const insufficient = rating.insufficientData || rating.overall == null\n const insufficientLabel = labels?.insufficientData ?? DEFAULT_SUPPLIER_RATING_LABELS.insufficientData\n const colors = insufficient ? { bg: '#F1F2F4', color: '#5B6472' } : getBadgeColors(rating.overall as number)\n\n return (\n <Popover\n open={open}\n onOpenChange={e => setOpen(e.open)}\n positioning={{ placement: 'top-end', gutter: 8 }}\n autoFocus={false}\n restoreFocus={false}\n lazyMount\n unmountOnExit\n >\n <PopoverTrigger asChild>\n <Box\n display=\"inline-flex\"\n alignItems=\"center\"\n w=\"fit-content\"\n maxW=\"100%\"\n px=\"space-8\"\n py=\"space-2\"\n borderRadius=\"full\"\n tabIndex={0}\n cursor=\"default\"\n style={{ backgroundColor: colors.bg }}\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n onFocus={() => {\n cancelClose()\n setOpen(true)\n }}\n onBlur={() => setOpen(false)}\n >\n <Text size=\"sm\" bold whiteSpace=\"nowrap\" style={{ color: colors.color }}>\n {insufficient ? insufficientLabel : `${formatOverall(rating.overall as number)} ★`}\n </Text>\n </Box>\n </PopoverTrigger>\n <PopoverContent\n className=\"panda-preflight-enabled\"\n zIndex={10000}\n p=\"0\"\n bg=\"transparent\"\n border=\"none\"\n borderRadius=\"radius-8\"\n boxShadow=\"0px 8px 16px 4px #1624861A\"\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n >\n <SupplierRatingBreakdown rating={rating} responseRate={responseRate} labels={labels} />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":"8NAqBA,SAAS,EAAe,EAAgD,CACtE,IAAM,EAAQ,EAAA,EAId,OAHI,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACvD,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACvD,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACpD,CAAE,GAAI,UAAW,MAAO,SAAU,CAC3C,CAGA,SAAgB,EAAoB,CAAE,SAAQ,eAAc,UAAoC,CAC9F,GAAM,CAAC,EAAM,IAAA,EAAA,EAAA,UAAoB,EAAK,EAChC,GAAA,EAAA,EAAA,QAA0D,IAAI,EAE9D,GAAA,EAAA,EAAA,iBAAgC,CACpC,AAEE,EAAW,WADX,aAAa,EAAW,OAAO,EACV,KAEzB,EAAG,CAAC,CAAC,EAEC,GAAA,EAAA,EAAA,iBAAkC,CACtC,EAAY,EACZ,EAAW,QAAU,eAAiB,EAAQ,EAAK,EAAG,GAAG,CAC3D,EAAG,CAAC,CAAW,CAAC,GAEhB,EAAA,EAAA,eAAgB,EAAa,CAAC,CAAW,CAAC,EAE1C,IAAM,EAAe,GAAoB,CACnC,EAAE,cAAgB,UACtB,EAAY,EACZ,EAAQ,EAAI,EACd,EACM,EAAgB,GAAoB,CACpC,EAAE,cAAgB,SACtB,EAAc,CAChB,EAEM,EAAe,EAAO,kBAAoB,EAAO,SAAW,KAC5D,EAAoB,GAAQ,kBAAoB,EAAA,+BAA+B,iBAC/E,EAAS,EAAe,CAAE,GAAI,UAAW,MAAO,SAAU,EAAI,EAAe,EAAO,OAAiB,EAE3G,OACE,EAAA,EAAA,MAAC,EAAA,QAAD,CACQ,OACN,aAAc,GAAK,EAAQ,EAAE,IAAI,EACjC,YAAa,CAAE,UAAW,UAAW,OAAQ,CAAE,EAC/C,UAAW,GACX,aAAc,GACd,UAAA,GACA,cAAA,YAPF,EASE,EAAA,EAAA,KAAC,EAAA,eAAD,CAAgB,QAAA,aACd,EAAA,EAAA,KAAC,EAAA,IAAD,CACE,QAAQ,cACR,WAAW,SACX,EAAE,cACF,KAAK,OACL,GAAG,UACH,GAAG,UACH,aAAa,OACb,SAAU,EACV,OAAO,UACP,MAAO,CAAE,gBAAiB,EAAO,EAAG,EACpC,eAAgB,EAChB,eAAgB,EAChB,YAAe,CACb,EAAY,EACZ,EAAQ,EAAI,CACd,EACA,WAAc,EAAQ,EAAK,YAE3B,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,KAAK,KAAK,KAAA,GAAK,WAAW,SAAS,MAAO,CAAE,MAAO,EAAO,KAAM,WACnE,EAAe,EAAoB,GAAG,EAAA,cAAc,EAAO,OAAiB,EAAE,GAC3E,CAAA,CACH,CAAA,CACS,CAAA,GAChB,EAAA,EAAA,KAAC,EAAA,eAAD,CACE,UAAU,0BACV,OAAQ,IACR,EAAE,IACF,GAAG,cACH,OAAO,OACP,aAAa,WACb,UAAU,6BACV,eAAgB,EAChB,eAAgB,YAEhB,EAAA,EAAA,KAAC,EAAA,wBAAD,CAAiC,SAAsB,eAAsB,QAAS,CAAA,CACxE,CAAA,CACT,GAEb"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SupplierRating, SupplierRatingLabels } from './SupplierRatingBreakdown';
|
|
2
|
+
export type SupplierRatingBadgeProps = {
|
|
3
|
+
rating: SupplierRating;
|
|
4
|
+
/** Optional original response rate (0..100) reminded inside the breakdown. */
|
|
5
|
+
responseRate?: number;
|
|
6
|
+
labels?: Partial<SupplierRatingLabels>;
|
|
7
|
+
};
|
|
8
|
+
/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */
|
|
9
|
+
export declare function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Text as e } from "../text/Text.js";
|
|
3
|
+
import { Popover as t, PopoverContent as n, PopoverTrigger as r } from "../popover/Popover.js";
|
|
4
|
+
import { DEFAULT_SUPPLIER_RATING_LABELS as i, SupplierRatingBreakdown as a, formatOverall as o } from "./SupplierRatingBreakdown.js";
|
|
5
|
+
import { Box as s } from "@stokelp/styled-system/jsx";
|
|
6
|
+
import { useCallback as c, useEffect as l, useRef as u, useState as d } from "react";
|
|
7
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/supplier-rating-badge/SupplierRatingBadge.tsx
|
|
9
|
+
function m(e) {
|
|
10
|
+
let t = e / 5;
|
|
11
|
+
return t >= .8 ? {
|
|
12
|
+
bg: "#E6F3D9",
|
|
13
|
+
color: "#3B6D11"
|
|
14
|
+
} : t >= .6 ? {
|
|
15
|
+
bg: "#FBF1CC",
|
|
16
|
+
color: "#92750C"
|
|
17
|
+
} : t >= .4 ? {
|
|
18
|
+
bg: "#FDF0E0",
|
|
19
|
+
color: "#C2740C"
|
|
20
|
+
} : {
|
|
21
|
+
bg: "#FCEBEB",
|
|
22
|
+
color: "#A32D2D"
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function h({ rating: h, responseRate: g, labels: _ }) {
|
|
26
|
+
let [v, y] = d(!1), b = u(null), x = c(() => {
|
|
27
|
+
b.current &&= (clearTimeout(b.current), null);
|
|
28
|
+
}, []), S = c(() => {
|
|
29
|
+
x(), b.current = setTimeout(() => y(!1), 120);
|
|
30
|
+
}, [x]);
|
|
31
|
+
l(() => x, [x]);
|
|
32
|
+
let C = (e) => {
|
|
33
|
+
e.pointerType === "mouse" && (x(), y(!0));
|
|
34
|
+
}, w = (e) => {
|
|
35
|
+
e.pointerType === "mouse" && S();
|
|
36
|
+
}, T = h.insufficientData || h.overall == null, E = _?.insufficientData ?? i.insufficientData, D = T ? {
|
|
37
|
+
bg: "#F1F2F4",
|
|
38
|
+
color: "#5B6472"
|
|
39
|
+
} : m(h.overall);
|
|
40
|
+
return /* @__PURE__ */ p(t, {
|
|
41
|
+
open: v,
|
|
42
|
+
onOpenChange: (e) => y(e.open),
|
|
43
|
+
positioning: {
|
|
44
|
+
placement: "top-end",
|
|
45
|
+
gutter: 8
|
|
46
|
+
},
|
|
47
|
+
autoFocus: !1,
|
|
48
|
+
restoreFocus: !1,
|
|
49
|
+
lazyMount: !0,
|
|
50
|
+
unmountOnExit: !0,
|
|
51
|
+
children: [/* @__PURE__ */ f(r, {
|
|
52
|
+
asChild: !0,
|
|
53
|
+
children: /* @__PURE__ */ f(s, {
|
|
54
|
+
display: "inline-flex",
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
w: "fit-content",
|
|
57
|
+
maxW: "100%",
|
|
58
|
+
px: "space-8",
|
|
59
|
+
py: "space-2",
|
|
60
|
+
borderRadius: "full",
|
|
61
|
+
tabIndex: 0,
|
|
62
|
+
cursor: "default",
|
|
63
|
+
style: { backgroundColor: D.bg },
|
|
64
|
+
onPointerEnter: C,
|
|
65
|
+
onPointerLeave: w,
|
|
66
|
+
onFocus: () => {
|
|
67
|
+
x(), y(!0);
|
|
68
|
+
},
|
|
69
|
+
onBlur: () => y(!1),
|
|
70
|
+
children: /* @__PURE__ */ f(e, {
|
|
71
|
+
size: "sm",
|
|
72
|
+
bold: !0,
|
|
73
|
+
whiteSpace: "nowrap",
|
|
74
|
+
style: { color: D.color },
|
|
75
|
+
children: T ? E : `${o(h.overall)} ★`
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
}), /* @__PURE__ */ f(n, {
|
|
79
|
+
className: "panda-preflight-enabled",
|
|
80
|
+
zIndex: 1e4,
|
|
81
|
+
p: "0",
|
|
82
|
+
bg: "transparent",
|
|
83
|
+
border: "none",
|
|
84
|
+
borderRadius: "radius-8",
|
|
85
|
+
boxShadow: "0px 8px 16px 4px #1624861A",
|
|
86
|
+
onPointerEnter: C,
|
|
87
|
+
onPointerLeave: w,
|
|
88
|
+
children: /* @__PURE__ */ f(a, {
|
|
89
|
+
rating: h,
|
|
90
|
+
responseRate: g,
|
|
91
|
+
labels: _
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { h as SupplierRatingBadge };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=SupplierRatingBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupplierRatingBadge.js","names":[],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBadge.tsx"],"sourcesContent":["import { Box } from '@stokelp/styled-system/jsx'\nimport { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { Popover, PopoverContent, PopoverTrigger, Text } from '~/components'\n\nimport {\n DEFAULT_SUPPLIER_RATING_LABELS,\n formatOverall,\n SUPPLIER_RATING_MAX,\n SupplierRatingBreakdown,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './SupplierRatingBreakdown'\n\nexport type SupplierRatingBadgeProps = {\n rating: SupplierRating\n /** Optional original response rate (0..100) reminded inside the breakdown. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nfunction getBadgeColors(overall: number): { bg: string; color: string } {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.8) return { bg: '#E6F3D9', color: '#3B6D11' }\n if (ratio >= 0.6) return { bg: '#FBF1CC', color: '#92750C' }\n if (ratio >= 0.4) return { bg: '#FDF0E0', color: '#C2740C' }\n return { bg: '#FCEBEB', color: '#A32D2D' }\n}\n\n/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */\nexport function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps) {\n const [open, setOpen] = useState(false)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n }, [])\n\n const scheduleClose = useCallback(() => {\n cancelClose()\n closeTimer.current = setTimeout(() => setOpen(false), 120)\n }, [cancelClose])\n\n useEffect(() => cancelClose, [cancelClose])\n\n const openOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n cancelClose()\n setOpen(true)\n }\n const closeOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n scheduleClose()\n }\n\n const insufficient = rating.insufficientData || rating.overall == null\n const insufficientLabel = labels?.insufficientData ?? DEFAULT_SUPPLIER_RATING_LABELS.insufficientData\n const colors = insufficient ? { bg: '#F1F2F4', color: '#5B6472' } : getBadgeColors(rating.overall as number)\n\n return (\n <Popover\n open={open}\n onOpenChange={e => setOpen(e.open)}\n positioning={{ placement: 'top-end', gutter: 8 }}\n autoFocus={false}\n restoreFocus={false}\n lazyMount\n unmountOnExit\n >\n <PopoverTrigger asChild>\n <Box\n display=\"inline-flex\"\n alignItems=\"center\"\n w=\"fit-content\"\n maxW=\"100%\"\n px=\"space-8\"\n py=\"space-2\"\n borderRadius=\"full\"\n tabIndex={0}\n cursor=\"default\"\n style={{ backgroundColor: colors.bg }}\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n onFocus={() => {\n cancelClose()\n setOpen(true)\n }}\n onBlur={() => setOpen(false)}\n >\n <Text size=\"sm\" bold whiteSpace=\"nowrap\" style={{ color: colors.color }}>\n {insufficient ? insufficientLabel : `${formatOverall(rating.overall as number)} ★`}\n </Text>\n </Box>\n </PopoverTrigger>\n <PopoverContent\n className=\"panda-preflight-enabled\"\n zIndex={10000}\n p=\"0\"\n bg=\"transparent\"\n border=\"none\"\n borderRadius=\"radius-8\"\n boxShadow=\"0px 8px 16px 4px #1624861A\"\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n >\n <SupplierRatingBreakdown rating={rating} responseRate={responseRate} labels={labels} />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;AAqBA,S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EAAO,GAAG;IACpC,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;KAEb,AADA,EAAY,GACZ,EAAQ,EAAI;IACd;IACA,cAAc,EAAQ,EAAK;cAE3B,kBAAC,GAAD;KAAM,MAAK;KAAK,MAAA;KAAK,YAAW;KAAS,OAAO,EAAE,OAAO,EAAO,MAAM;eACnE,IAAe,IAAoB,GAAG,EAAc,EAAO,OAAiB,EAAE;IAC3E,CAAA;GACH,CAAA;EACS,CAAA,GAChB,kBAAC,GAAD;GACE,WAAU;GACV,QAAQ;GACR,GAAE;GACF,IAAG;GACH,QAAO;GACP,cAAa;GACb,WAAU;GACV,gBAAgB;GAChB,gBAAgB;aAEhB,kBAAC,GAAD;IAAiC;IAAsB;IAAsB;GAAS,CAAA;EACxE,CAAA,CACT;;AAEb"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require("../text/Text.cjs"),t=require("../icon/Icon.cjs"),n=require("../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs"),r=require("../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs");let i=require("@stokelp/styled-system/jsx"),a=require("react/jsx-runtime");var o=5,s={title:`Note fournisseur`,insufficientData:`Pas encore assez de données`,componentsTitle:`Détail de la note`,completionTitle:`Complétion du compte`,notAvailable:`—`,units:{minutes:`min`,hours:`h`,days:`j`},components:{responseRate:`Taux de réponse`,responseDelay:`Délai de réponse`,completion:`Complétion du compte`},completion:{profile:`Profil (photo et description)`,locationContacts:`Localisation et contact`,legalBanking:`Coordonnées légales et bancaires`,sector:`Secteur d'activité`,certificate:`Certificat`,productInterest:`Intérêt produit`}},c=[`profile`,`locationContacts`,`legalBanking`,`sector`,`certificate`,`productInterest`];function l(e){return e.toFixed(1).replace(`.`,`,`)}function u(e,t){if(e<60)return`${Math.round(e)} ${t.minutes}`;let n=e/60;return n<48?`${Math.round(n)} ${t.hours}`:`${(n/24).toFixed(1).replace(`.`,`,`)} ${t.days}`}function d(e){let t=e/5;return t>=.7?`#3B6D11`:t>=.4?`#854F0B`:`#A32D2D`}function f(e){return e>=70?`#639922`:e>=40?`#BA7517`:`#E24B4A`}var p=({rating:o,responseRate:p,labels:m})=>{let h={...s,...m,units:{...s.units,...m?.units},components:{...s.components,...m?.components},completion:{...s.completion,...m?.completion}},g=p!=null,_=o.responseDelayMinutes!=null,v=o.responseDelayScore==null?null:Math.round(o.responseDelayScore*100),y=Math.round(o.completionScore*100),b=[{key:`responseRate`,value:g?`${Math.round(p)} %`:h.notAvailable,barPercent:g?Math.round(p):null,color:g?f(Math.round(p)):void 0},{key:`responseDelay`,value:_?u(o.responseDelayMinutes,h.units):h.notAvailable,barPercent:v,color:v==null?void 0:f(v)},{key:`completion`,value:`${y} %`,barPercent:y,color:f(y)}];return(0,a.jsxs)(i.Box,{bg:`white`,borderRadius:`radius-8`,p:`space-16`,minW:`240px`,maxW:`260px`,css:{"& *":{fontFamily:`inherit`}},children:[(0,a.jsxs)(i.HStack,{justify:`space-between`,alignItems:`baseline`,mb:`space-8`,children:[(0,a.jsx)(e.Text,{as:`span`,fontSize:`body.md`,fontWeight:`bold`,children:h.title}),o.insufficientData||o.overall==null?(0,a.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`medium`,color:`grey.400`,children:h.insufficientData}):(0,a.jsxs)(e.Text,{as:`span`,fontSize:`body.lg`,fontWeight:`medium`,style:{color:d(o.overall)},children:[l(o.overall),` / `,5,` ★`]})]}),(0,a.jsx)(i.Box,{h:`1px`,bg:`grey.100`,mb:`space-8`}),(0,a.jsxs)(i.VStack,{alignItems:`stretch`,gap:`space-8`,mb:`space-8`,children:[(0,a.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`bold`,color:`grey.400`,children:h.componentsTitle}),b.map(t=>(0,a.jsxs)(i.VStack,{alignItems:`stretch`,gap:`space-2`,children:[(0,a.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,color:`grey.500`,children:h.components[t.key]}),(0,a.jsxs)(i.HStack,{alignItems:`center`,gap:`space-8`,children:[(0,a.jsx)(i.Box,{flex:`1`,h:`3px`,bg:`grey.100`,borderRadius:`full`,overflow:`hidden`,children:(0,a.jsx)(i.Box,{h:`100%`,borderRadius:`full`,style:{width:t.barPercent==null?`0%`:`${t.barPercent}%`,background:t.color??`transparent`}})}),(0,a.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`medium`,minW:`48px`,textAlign:`right`,style:{color:t.color},color:t.color?void 0:`grey.300`,children:t.value})]})]},t.key))]}),(0,a.jsx)(i.Box,{h:`1px`,bg:`grey.100`,mb:`space-8`}),(0,a.jsxs)(i.VStack,{alignItems:`stretch`,gap:`space-4`,children:[(0,a.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`bold`,color:`grey.400`,children:h.completionTitle}),c.map(s=>{let c=o.completion[s];return(0,a.jsxs)(i.HStack,{alignItems:`center`,gap:`space-8`,children:[(0,a.jsx)(t.Icon,{size:`sm`,color:c?`success.500`:`grey.300`,flexShrink:`0`,children:c?(0,a.jsx)(n.default,{}):(0,a.jsx)(r.default,{})}),(0,a.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,color:c?`grey.500`:`grey.400`,children:h.completion[s]})]},s)})]}),h.footer&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Box,{h:`1px`,bg:`grey.100`,mt:`space-8`,mb:`space-8`}),(0,a.jsx)(e.Text,{as:`span`,fontSize:`9px`,color:`grey.300`,style:{lineHeight:1},children:h.footer})]})]})};exports.DEFAULT_SUPPLIER_RATING_LABELS=s,exports.SUPPLIER_RATING_MAX=o,exports.SupplierRatingBreakdown=p,exports.formatOverall=l,exports.formatResponseDelay=u,exports.getHeadlineColor=d;
|
|
2
|
+
//# sourceMappingURL=SupplierRatingBreakdown.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupplierRatingBreakdown.cjs","names":[],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx"],"sourcesContent":["import { CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/outline'\nimport { Box, HStack, VStack } from '@stokelp/styled-system/jsx'\n\nimport { Icon, Text } from '~/components'\n\nexport const SUPPLIER_RATING_MAX = 5\n\nexport type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion'\n\nexport type SupplierRatingCompletionKey =\n | 'profile'\n | 'locationContacts'\n | 'legalBanking'\n | 'sector'\n | 'certificate'\n | 'productInterest'\n\nexport type SupplierRatingCompletion = Record<SupplierRatingCompletionKey, boolean>\n\nexport type SupplierRating = {\n /** Overall note out of 5. Absent when insufficientData is true. */\n overall?: number\n /** Response-rate sub-score, 0..1 (note calc only). Absent when insufficientData is true. */\n responseRateScore?: number\n /** Response-delay sub-score, 0..1 (note calc + colours the delay row). Absent when insufficientData is true. */\n responseDelayScore?: number\n /** Average response delay in MINUTES, for display. Absent when insufficientData is true. */\n responseDelayMinutes?: number\n /** Account-completion sub-score, 0..1. Always present. */\n completionScore: number\n /** True when the supplier has too few interactions for a reliable note. */\n insufficientData: boolean\n /** Completion checklist shown in the breakdown. */\n completion: SupplierRatingCompletion\n}\n\nexport type SupplierRatingLabels = {\n title: string\n /** Neutral state shown instead of a note when data is insufficient. */\n insufficientData: string\n /** Section heading above the sub-scores. */\n componentsTitle: string\n /** Section heading above the completion checklist. */\n completionTitle: string\n /** Value shown when a component has no data yet (e.g. \"—\"). */\n notAvailable: string\n /** Unit suffixes for the average response-delay value. */\n units: { minutes: string; hours: string; days: string }\n components: Record<SupplierRatingComponentKey, string>\n completion: Record<SupplierRatingCompletionKey, string>\n footer?: string\n}\n\nexport const DEFAULT_SUPPLIER_RATING_LABELS: SupplierRatingLabels = {\n title: 'Note fournisseur',\n insufficientData: 'Pas encore assez de données',\n componentsTitle: 'Détail de la note',\n completionTitle: 'Complétion du compte',\n notAvailable: '—',\n units: { minutes: 'min', hours: 'h', days: 'j' },\n components: {\n responseRate: 'Taux de réponse',\n responseDelay: 'Délai de réponse',\n completion: 'Complétion du compte',\n },\n completion: {\n profile: 'Profil (photo et description)',\n locationContacts: 'Localisation et contact',\n legalBanking: 'Coordonnées légales et bancaires',\n sector: \"Secteur d'activité\",\n certificate: 'Certificat',\n productInterest: 'Intérêt produit',\n },\n}\n\nconst COMPLETION_ORDER: SupplierRatingCompletionKey[] = [\n 'profile',\n 'locationContacts',\n 'legalBanking',\n 'sector',\n 'certificate',\n 'productInterest',\n]\n\nexport function formatOverall(overall: number): string {\n return overall.toFixed(1).replace('.', ',')\n}\n\n/** Average response delay: minutes → \"45 min\" / \"18 h\" / \"2,5 j\". */\nexport function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units']): string {\n if (minutes < 60) return `${Math.round(minutes)} ${units.minutes}`\n const hours = minutes / 60\n if (hours < 48) return `${Math.round(hours)} ${units.hours}`\n const days = hours / 24\n return `${days.toFixed(1).replace('.', ',')} ${units.days}`\n}\n\nexport function getHeadlineColor(overall: number): string {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.7) return '#3B6D11'\n if (ratio >= 0.4) return '#854F0B'\n return '#A32D2D'\n}\n\nfunction getBarColor(ratioPercent: number): string {\n if (ratioPercent >= 70) return '#639922'\n if (ratioPercent >= 40) return '#BA7517'\n return '#E24B4A'\n}\n\ntype ComponentRow = {\n key: SupplierRatingComponentKey\n value: string\n /** 0..100 bar fill, or null when there is no data. */\n barPercent: number | null\n /** Bar/value colour, or undefined for the neutral (no-data) state. */\n color?: string\n}\n\ntype SupplierRatingBreakdownProps = {\n rating: SupplierRating\n /** Original response rate (0..100), displayed as the \"Taux de réponse\" value. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nexport const SupplierRatingBreakdown = ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => {\n const labels: SupplierRatingLabels = {\n ...DEFAULT_SUPPLIER_RATING_LABELS,\n ...labelsProp,\n units: { ...DEFAULT_SUPPLIER_RATING_LABELS.units, ...labelsProp?.units },\n components: { ...DEFAULT_SUPPLIER_RATING_LABELS.components, ...labelsProp?.components },\n completion: { ...DEFAULT_SUPPLIER_RATING_LABELS.completion, ...labelsProp?.completion },\n }\n\n const hasResponseRate = responseRate != null\n const hasDelay = rating.responseDelayMinutes != null\n const delayPercent = rating.responseDelayScore != null ? Math.round(rating.responseDelayScore * 100) : null\n const completionPercent = Math.round(rating.completionScore * 100)\n\n const rows: ComponentRow[] = [\n {\n key: 'responseRate',\n value: hasResponseRate ? `${Math.round(responseRate)} %` : labels.notAvailable,\n barPercent: hasResponseRate ? Math.round(responseRate) : null,\n color: hasResponseRate ? getBarColor(Math.round(responseRate)) : undefined,\n },\n {\n key: 'responseDelay',\n value: hasDelay ? formatResponseDelay(rating.responseDelayMinutes as number, labels.units) : labels.notAvailable,\n barPercent: delayPercent,\n color: delayPercent != null ? getBarColor(delayPercent) : undefined,\n },\n {\n key: 'completion',\n value: `${completionPercent} %`,\n barPercent: completionPercent,\n color: getBarColor(completionPercent),\n },\n ]\n\n return (\n <Box\n bg=\"white\"\n borderRadius=\"radius-8\"\n p=\"space-16\"\n minW=\"240px\"\n maxW=\"260px\"\n css={{ '& *': { fontFamily: 'inherit' } }}\n >\n <HStack justify=\"space-between\" alignItems=\"baseline\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.md\" fontWeight=\"bold\">\n {labels.title}\n </Text>\n {rating.insufficientData || rating.overall == null ? (\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"medium\" color=\"grey.400\">\n {labels.insufficientData}\n </Text>\n ) : (\n <Text as=\"span\" fontSize=\"body.lg\" fontWeight=\"medium\" style={{ color: getHeadlineColor(rating.overall) }}>\n {formatOverall(rating.overall)} / {SUPPLIER_RATING_MAX} ★\n </Text>\n )}\n </HStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-8\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.componentsTitle}\n </Text>\n {rows.map(row => (\n <VStack key={row.key} alignItems=\"stretch\" gap=\"space-2\">\n <Text as=\"span\" fontSize=\"body.sm\" color=\"grey.500\">\n {labels.components[row.key]}\n </Text>\n <HStack alignItems=\"center\" gap=\"space-8\">\n <Box flex=\"1\" h=\"3px\" bg=\"grey.100\" borderRadius=\"full\" overflow=\"hidden\">\n <Box\n h=\"100%\"\n borderRadius=\"full\"\n style={{\n width: row.barPercent != null ? `${row.barPercent}%` : '0%',\n background: row.color ?? 'transparent',\n }}\n />\n </Box>\n <Text\n as=\"span\"\n fontSize=\"body.sm\"\n fontWeight=\"medium\"\n minW=\"48px\"\n textAlign=\"right\"\n style={{ color: row.color }}\n color={row.color ? undefined : 'grey.300'}\n >\n {row.value}\n </Text>\n </HStack>\n </VStack>\n ))}\n </VStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-4\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.completionTitle}\n </Text>\n {COMPLETION_ORDER.map(key => {\n const done = rating.completion[key]\n return (\n <HStack key={key} alignItems=\"center\" gap=\"space-8\">\n <Icon size=\"sm\" color={done ? 'success.500' : 'grey.300'} flexShrink=\"0\">\n {done ? <CheckCircleIcon /> : <XCircleIcon />}\n </Icon>\n <Text as=\"span\" fontSize=\"body.sm\" color={done ? 'grey.500' : 'grey.400'}>\n {labels.completion[key]}\n </Text>\n </HStack>\n )\n })}\n </VStack>\n\n {labels.footer && (\n <>\n <Box h=\"1px\" bg=\"grey.100\" mt=\"space-8\" mb=\"space-8\" />\n <Text as=\"span\" fontSize=\"9px\" color=\"grey.300\" style={{ lineHeight: 1 }}>\n {labels.footer}\n </Text>\n </>\n )}\n </Box>\n )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AA,KAAD,CAAM,GAAG,OAAO,SAAS,UAAU,WAAW,OAAO,MAAM,oBACxD,EAAO,eACJ,CAAA,EACL,EAAiB,IAAI,GAAO,CAC3B,IAAM,EAAO,EAAO,WAAW,GAC/B,OACE,EAAA,EAAA,MAAC,EAAA,OAAD,CAAkB,WAAW,SAAS,IAAI,mBAA1C,EACE,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,KAAK,KAAK,MAAO,EAAO,cAAgB,WAAY,WAAW,aAClE,GAAO,EAAA,EAAA,KAAC,EAAA,QAAD,CAAkB,CAAA,GAAI,EAAA,EAAA,KAAC,EAAA,QAAD,CAAc,CAAA,CACxC,CAAA,GACN,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,GAAG,OAAO,SAAS,UAAU,MAAO,EAAO,WAAa,oBAC3D,EAAO,WAAW,EACf,CAAA,CACA,GAPK,CAOL,CAEZ,CAAC,CACK,IAEP,EAAO,SACN,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,EAAA,IAAD,CAAK,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,SAAW,CAAA,GACtD,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,GAAG,OAAO,SAAS,MAAM,MAAM,WAAW,MAAO,CAAE,WAAY,CAAE,WACpE,EAAO,MACJ,CAAA,CACN,CAAA,CAAA,CAED,GAET"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare const SUPPLIER_RATING_MAX = 5;
|
|
2
|
+
export type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion';
|
|
3
|
+
export type SupplierRatingCompletionKey = 'profile' | 'locationContacts' | 'legalBanking' | 'sector' | 'certificate' | 'productInterest';
|
|
4
|
+
export type SupplierRatingCompletion = Record<SupplierRatingCompletionKey, boolean>;
|
|
5
|
+
export type SupplierRating = {
|
|
6
|
+
/** Overall note out of 5. Absent when insufficientData is true. */
|
|
7
|
+
overall?: number;
|
|
8
|
+
/** Response-rate sub-score, 0..1 (note calc only). Absent when insufficientData is true. */
|
|
9
|
+
responseRateScore?: number;
|
|
10
|
+
/** Response-delay sub-score, 0..1 (note calc + colours the delay row). Absent when insufficientData is true. */
|
|
11
|
+
responseDelayScore?: number;
|
|
12
|
+
/** Average response delay in MINUTES, for display. Absent when insufficientData is true. */
|
|
13
|
+
responseDelayMinutes?: number;
|
|
14
|
+
/** Account-completion sub-score, 0..1. Always present. */
|
|
15
|
+
completionScore: number;
|
|
16
|
+
/** True when the supplier has too few interactions for a reliable note. */
|
|
17
|
+
insufficientData: boolean;
|
|
18
|
+
/** Completion checklist shown in the breakdown. */
|
|
19
|
+
completion: SupplierRatingCompletion;
|
|
20
|
+
};
|
|
21
|
+
export type SupplierRatingLabels = {
|
|
22
|
+
title: string;
|
|
23
|
+
/** Neutral state shown instead of a note when data is insufficient. */
|
|
24
|
+
insufficientData: string;
|
|
25
|
+
/** Section heading above the sub-scores. */
|
|
26
|
+
componentsTitle: string;
|
|
27
|
+
/** Section heading above the completion checklist. */
|
|
28
|
+
completionTitle: string;
|
|
29
|
+
/** Value shown when a component has no data yet (e.g. "—"). */
|
|
30
|
+
notAvailable: string;
|
|
31
|
+
/** Unit suffixes for the average response-delay value. */
|
|
32
|
+
units: {
|
|
33
|
+
minutes: string;
|
|
34
|
+
hours: string;
|
|
35
|
+
days: string;
|
|
36
|
+
};
|
|
37
|
+
components: Record<SupplierRatingComponentKey, string>;
|
|
38
|
+
completion: Record<SupplierRatingCompletionKey, string>;
|
|
39
|
+
footer?: string;
|
|
40
|
+
};
|
|
41
|
+
export declare const DEFAULT_SUPPLIER_RATING_LABELS: SupplierRatingLabels;
|
|
42
|
+
export declare function formatOverall(overall: number): string;
|
|
43
|
+
/** Average response delay: minutes → "45 min" / "18 h" / "2,5 j". */
|
|
44
|
+
export declare function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units']): string;
|
|
45
|
+
export declare function getHeadlineColor(overall: number): string;
|
|
46
|
+
type SupplierRatingBreakdownProps = {
|
|
47
|
+
rating: SupplierRating;
|
|
48
|
+
/** Original response rate (0..100), displayed as the "Taux de réponse" value. */
|
|
49
|
+
responseRate?: number;
|
|
50
|
+
labels?: Partial<SupplierRatingLabels>;
|
|
51
|
+
};
|
|
52
|
+
export declare const SupplierRatingBreakdown: ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Text as e } from "../text/Text.js";
|
|
3
|
+
import { Icon as t } from "../icon/Icon.js";
|
|
4
|
+
import n from "../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js";
|
|
5
|
+
import r from "../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js";
|
|
6
|
+
import { Box as i, HStack as a, VStack as o } from "@stokelp/styled-system/jsx";
|
|
7
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx
|
|
9
|
+
var u = 5, d = {
|
|
10
|
+
title: "Note fournisseur",
|
|
11
|
+
insufficientData: "Pas encore assez de données",
|
|
12
|
+
componentsTitle: "Détail de la note",
|
|
13
|
+
completionTitle: "Complétion du compte",
|
|
14
|
+
notAvailable: "—",
|
|
15
|
+
units: {
|
|
16
|
+
minutes: "min",
|
|
17
|
+
hours: "h",
|
|
18
|
+
days: "j"
|
|
19
|
+
},
|
|
20
|
+
components: {
|
|
21
|
+
responseRate: "Taux de réponse",
|
|
22
|
+
responseDelay: "Délai de réponse",
|
|
23
|
+
completion: "Complétion du compte"
|
|
24
|
+
},
|
|
25
|
+
completion: {
|
|
26
|
+
profile: "Profil (photo et description)",
|
|
27
|
+
locationContacts: "Localisation et contact",
|
|
28
|
+
legalBanking: "Coordonnées légales et bancaires",
|
|
29
|
+
sector: "Secteur d'activité",
|
|
30
|
+
certificate: "Certificat",
|
|
31
|
+
productInterest: "Intérêt produit"
|
|
32
|
+
}
|
|
33
|
+
}, f = [
|
|
34
|
+
"profile",
|
|
35
|
+
"locationContacts",
|
|
36
|
+
"legalBanking",
|
|
37
|
+
"sector",
|
|
38
|
+
"certificate",
|
|
39
|
+
"productInterest"
|
|
40
|
+
];
|
|
41
|
+
function p(e) {
|
|
42
|
+
return e.toFixed(1).replace(".", ",");
|
|
43
|
+
}
|
|
44
|
+
function m(e, t) {
|
|
45
|
+
if (e < 60) return `${Math.round(e)} ${t.minutes}`;
|
|
46
|
+
let n = e / 60;
|
|
47
|
+
return n < 48 ? `${Math.round(n)} ${t.hours}` : `${(n / 24).toFixed(1).replace(".", ",")} ${t.days}`;
|
|
48
|
+
}
|
|
49
|
+
function h(e) {
|
|
50
|
+
let t = e / 5;
|
|
51
|
+
return t >= .7 ? "#3B6D11" : t >= .4 ? "#854F0B" : "#A32D2D";
|
|
52
|
+
}
|
|
53
|
+
function g(e) {
|
|
54
|
+
return e >= 70 ? "#639922" : e >= 40 ? "#BA7517" : "#E24B4A";
|
|
55
|
+
}
|
|
56
|
+
var _ = ({ rating: u, responseRate: _, labels: v }) => {
|
|
57
|
+
let y = {
|
|
58
|
+
...d,
|
|
59
|
+
...v,
|
|
60
|
+
units: {
|
|
61
|
+
...d.units,
|
|
62
|
+
...v?.units
|
|
63
|
+
},
|
|
64
|
+
components: {
|
|
65
|
+
...d.components,
|
|
66
|
+
...v?.components
|
|
67
|
+
},
|
|
68
|
+
completion: {
|
|
69
|
+
...d.completion,
|
|
70
|
+
...v?.completion
|
|
71
|
+
}
|
|
72
|
+
}, b = _ != null, x = u.responseDelayMinutes != null, S = u.responseDelayScore == null ? null : Math.round(u.responseDelayScore * 100), C = Math.round(u.completionScore * 100), w = [
|
|
73
|
+
{
|
|
74
|
+
key: "responseRate",
|
|
75
|
+
value: b ? `${Math.round(_)} %` : y.notAvailable,
|
|
76
|
+
barPercent: b ? Math.round(_) : null,
|
|
77
|
+
color: b ? g(Math.round(_)) : void 0
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: "responseDelay",
|
|
81
|
+
value: x ? m(u.responseDelayMinutes, y.units) : y.notAvailable,
|
|
82
|
+
barPercent: S,
|
|
83
|
+
color: S == null ? void 0 : g(S)
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: "completion",
|
|
87
|
+
value: `${C} %`,
|
|
88
|
+
barPercent: C,
|
|
89
|
+
color: g(C)
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
return /* @__PURE__ */ l(i, {
|
|
93
|
+
bg: "white",
|
|
94
|
+
borderRadius: "radius-8",
|
|
95
|
+
p: "space-16",
|
|
96
|
+
minW: "240px",
|
|
97
|
+
maxW: "260px",
|
|
98
|
+
css: { "& *": { fontFamily: "inherit" } },
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ l(a, {
|
|
101
|
+
justify: "space-between",
|
|
102
|
+
alignItems: "baseline",
|
|
103
|
+
mb: "space-8",
|
|
104
|
+
children: [/* @__PURE__ */ c(e, {
|
|
105
|
+
as: "span",
|
|
106
|
+
fontSize: "body.md",
|
|
107
|
+
fontWeight: "bold",
|
|
108
|
+
children: y.title
|
|
109
|
+
}), u.insufficientData || u.overall == null ? /* @__PURE__ */ c(e, {
|
|
110
|
+
as: "span",
|
|
111
|
+
fontSize: "body.sm",
|
|
112
|
+
fontWeight: "medium",
|
|
113
|
+
color: "grey.400",
|
|
114
|
+
children: y.insufficientData
|
|
115
|
+
}) : /* @__PURE__ */ l(e, {
|
|
116
|
+
as: "span",
|
|
117
|
+
fontSize: "body.lg",
|
|
118
|
+
fontWeight: "medium",
|
|
119
|
+
style: { color: h(u.overall) },
|
|
120
|
+
children: [
|
|
121
|
+
p(u.overall),
|
|
122
|
+
" / ",
|
|
123
|
+
5,
|
|
124
|
+
" ★"
|
|
125
|
+
]
|
|
126
|
+
})]
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ c(i, {
|
|
129
|
+
h: "1px",
|
|
130
|
+
bg: "grey.100",
|
|
131
|
+
mb: "space-8"
|
|
132
|
+
}),
|
|
133
|
+
/* @__PURE__ */ l(o, {
|
|
134
|
+
alignItems: "stretch",
|
|
135
|
+
gap: "space-8",
|
|
136
|
+
mb: "space-8",
|
|
137
|
+
children: [/* @__PURE__ */ c(e, {
|
|
138
|
+
as: "span",
|
|
139
|
+
fontSize: "body.sm",
|
|
140
|
+
fontWeight: "bold",
|
|
141
|
+
color: "grey.400",
|
|
142
|
+
children: y.componentsTitle
|
|
143
|
+
}), w.map((t) => /* @__PURE__ */ l(o, {
|
|
144
|
+
alignItems: "stretch",
|
|
145
|
+
gap: "space-2",
|
|
146
|
+
children: [/* @__PURE__ */ c(e, {
|
|
147
|
+
as: "span",
|
|
148
|
+
fontSize: "body.sm",
|
|
149
|
+
color: "grey.500",
|
|
150
|
+
children: y.components[t.key]
|
|
151
|
+
}), /* @__PURE__ */ l(a, {
|
|
152
|
+
alignItems: "center",
|
|
153
|
+
gap: "space-8",
|
|
154
|
+
children: [/* @__PURE__ */ c(i, {
|
|
155
|
+
flex: "1",
|
|
156
|
+
h: "3px",
|
|
157
|
+
bg: "grey.100",
|
|
158
|
+
borderRadius: "full",
|
|
159
|
+
overflow: "hidden",
|
|
160
|
+
children: /* @__PURE__ */ c(i, {
|
|
161
|
+
h: "100%",
|
|
162
|
+
borderRadius: "full",
|
|
163
|
+
style: {
|
|
164
|
+
width: t.barPercent == null ? "0%" : `${t.barPercent}%`,
|
|
165
|
+
background: t.color ?? "transparent"
|
|
166
|
+
}
|
|
167
|
+
})
|
|
168
|
+
}), /* @__PURE__ */ c(e, {
|
|
169
|
+
as: "span",
|
|
170
|
+
fontSize: "body.sm",
|
|
171
|
+
fontWeight: "medium",
|
|
172
|
+
minW: "48px",
|
|
173
|
+
textAlign: "right",
|
|
174
|
+
style: { color: t.color },
|
|
175
|
+
color: t.color ? void 0 : "grey.300",
|
|
176
|
+
children: t.value
|
|
177
|
+
})]
|
|
178
|
+
})]
|
|
179
|
+
}, t.key))]
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ c(i, {
|
|
182
|
+
h: "1px",
|
|
183
|
+
bg: "grey.100",
|
|
184
|
+
mb: "space-8"
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ l(o, {
|
|
187
|
+
alignItems: "stretch",
|
|
188
|
+
gap: "space-4",
|
|
189
|
+
children: [/* @__PURE__ */ c(e, {
|
|
190
|
+
as: "span",
|
|
191
|
+
fontSize: "body.sm",
|
|
192
|
+
fontWeight: "bold",
|
|
193
|
+
color: "grey.400",
|
|
194
|
+
children: y.completionTitle
|
|
195
|
+
}), f.map((i) => {
|
|
196
|
+
let o = u.completion[i];
|
|
197
|
+
return /* @__PURE__ */ l(a, {
|
|
198
|
+
alignItems: "center",
|
|
199
|
+
gap: "space-8",
|
|
200
|
+
children: [/* @__PURE__ */ c(t, {
|
|
201
|
+
size: "sm",
|
|
202
|
+
color: o ? "success.500" : "grey.300",
|
|
203
|
+
flexShrink: "0",
|
|
204
|
+
children: c(o ? n : r, {})
|
|
205
|
+
}), /* @__PURE__ */ c(e, {
|
|
206
|
+
as: "span",
|
|
207
|
+
fontSize: "body.sm",
|
|
208
|
+
color: o ? "grey.500" : "grey.400",
|
|
209
|
+
children: y.completion[i]
|
|
210
|
+
})]
|
|
211
|
+
}, i);
|
|
212
|
+
})]
|
|
213
|
+
}),
|
|
214
|
+
y.footer && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(i, {
|
|
215
|
+
h: "1px",
|
|
216
|
+
bg: "grey.100",
|
|
217
|
+
mt: "space-8",
|
|
218
|
+
mb: "space-8"
|
|
219
|
+
}), /* @__PURE__ */ c(e, {
|
|
220
|
+
as: "span",
|
|
221
|
+
fontSize: "9px",
|
|
222
|
+
color: "grey.300",
|
|
223
|
+
style: { lineHeight: 1 },
|
|
224
|
+
children: y.footer
|
|
225
|
+
})] })
|
|
226
|
+
]
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
//#endregion
|
|
230
|
+
export { d as DEFAULT_SUPPLIER_RATING_LABELS, u as SUPPLIER_RATING_MAX, _ as SupplierRatingBreakdown, p as formatOverall, m as formatResponseDelay, h as getHeadlineColor };
|
|
231
|
+
|
|
232
|
+
//# sourceMappingURL=SupplierRatingBreakdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupplierRatingBreakdown.js","names":[],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx"],"sourcesContent":["import { CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/outline'\nimport { Box, HStack, VStack } from '@stokelp/styled-system/jsx'\n\nimport { Icon, Text } from '~/components'\n\nexport const SUPPLIER_RATING_MAX = 5\n\nexport type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion'\n\nexport type SupplierRatingCompletionKey =\n | 'profile'\n | 'locationContacts'\n | 'legalBanking'\n | 'sector'\n | 'certificate'\n | 'productInterest'\n\nexport type SupplierRatingCompletion = Record<SupplierRatingCompletionKey, boolean>\n\nexport type SupplierRating = {\n /** Overall note out of 5. Absent when insufficientData is true. */\n overall?: number\n /** Response-rate sub-score, 0..1 (note calc only). Absent when insufficientData is true. */\n responseRateScore?: number\n /** Response-delay sub-score, 0..1 (note calc + colours the delay row). Absent when insufficientData is true. */\n responseDelayScore?: number\n /** Average response delay in MINUTES, for display. Absent when insufficientData is true. */\n responseDelayMinutes?: number\n /** Account-completion sub-score, 0..1. Always present. */\n completionScore: number\n /** True when the supplier has too few interactions for a reliable note. */\n insufficientData: boolean\n /** Completion checklist shown in the breakdown. */\n completion: SupplierRatingCompletion\n}\n\nexport type SupplierRatingLabels = {\n title: string\n /** Neutral state shown instead of a note when data is insufficient. */\n insufficientData: string\n /** Section heading above the sub-scores. */\n componentsTitle: string\n /** Section heading above the completion checklist. */\n completionTitle: string\n /** Value shown when a component has no data yet (e.g. \"—\"). */\n notAvailable: string\n /** Unit suffixes for the average response-delay value. */\n units: { minutes: string; hours: string; days: string }\n components: Record<SupplierRatingComponentKey, string>\n completion: Record<SupplierRatingCompletionKey, string>\n footer?: string\n}\n\nexport const DEFAULT_SUPPLIER_RATING_LABELS: SupplierRatingLabels = {\n title: 'Note fournisseur',\n insufficientData: 'Pas encore assez de données',\n componentsTitle: 'Détail de la note',\n completionTitle: 'Complétion du compte',\n notAvailable: '—',\n units: { minutes: 'min', hours: 'h', days: 'j' },\n components: {\n responseRate: 'Taux de réponse',\n responseDelay: 'Délai de réponse',\n completion: 'Complétion du compte',\n },\n completion: {\n profile: 'Profil (photo et description)',\n locationContacts: 'Localisation et contact',\n legalBanking: 'Coordonnées légales et bancaires',\n sector: \"Secteur d'activité\",\n certificate: 'Certificat',\n productInterest: 'Intérêt produit',\n },\n}\n\nconst COMPLETION_ORDER: SupplierRatingCompletionKey[] = [\n 'profile',\n 'locationContacts',\n 'legalBanking',\n 'sector',\n 'certificate',\n 'productInterest',\n]\n\nexport function formatOverall(overall: number): string {\n return overall.toFixed(1).replace('.', ',')\n}\n\n/** Average response delay: minutes → \"45 min\" / \"18 h\" / \"2,5 j\". */\nexport function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units']): string {\n if (minutes < 60) return `${Math.round(minutes)} ${units.minutes}`\n const hours = minutes / 60\n if (hours < 48) return `${Math.round(hours)} ${units.hours}`\n const days = hours / 24\n return `${days.toFixed(1).replace('.', ',')} ${units.days}`\n}\n\nexport function getHeadlineColor(overall: number): string {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.7) return '#3B6D11'\n if (ratio >= 0.4) return '#854F0B'\n return '#A32D2D'\n}\n\nfunction getBarColor(ratioPercent: number): string {\n if (ratioPercent >= 70) return '#639922'\n if (ratioPercent >= 40) return '#BA7517'\n return '#E24B4A'\n}\n\ntype ComponentRow = {\n key: SupplierRatingComponentKey\n value: string\n /** 0..100 bar fill, or null when there is no data. */\n barPercent: number | null\n /** Bar/value colour, or undefined for the neutral (no-data) state. */\n color?: string\n}\n\ntype SupplierRatingBreakdownProps = {\n rating: SupplierRating\n /** Original response rate (0..100), displayed as the \"Taux de réponse\" value. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nexport const SupplierRatingBreakdown = ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => {\n const labels: SupplierRatingLabels = {\n ...DEFAULT_SUPPLIER_RATING_LABELS,\n ...labelsProp,\n units: { ...DEFAULT_SUPPLIER_RATING_LABELS.units, ...labelsProp?.units },\n components: { ...DEFAULT_SUPPLIER_RATING_LABELS.components, ...labelsProp?.components },\n completion: { ...DEFAULT_SUPPLIER_RATING_LABELS.completion, ...labelsProp?.completion },\n }\n\n const hasResponseRate = responseRate != null\n const hasDelay = rating.responseDelayMinutes != null\n const delayPercent = rating.responseDelayScore != null ? Math.round(rating.responseDelayScore * 100) : null\n const completionPercent = Math.round(rating.completionScore * 100)\n\n const rows: ComponentRow[] = [\n {\n key: 'responseRate',\n value: hasResponseRate ? `${Math.round(responseRate)} %` : labels.notAvailable,\n barPercent: hasResponseRate ? Math.round(responseRate) : null,\n color: hasResponseRate ? getBarColor(Math.round(responseRate)) : undefined,\n },\n {\n key: 'responseDelay',\n value: hasDelay ? formatResponseDelay(rating.responseDelayMinutes as number, labels.units) : labels.notAvailable,\n barPercent: delayPercent,\n color: delayPercent != null ? getBarColor(delayPercent) : undefined,\n },\n {\n key: 'completion',\n value: `${completionPercent} %`,\n barPercent: completionPercent,\n color: getBarColor(completionPercent),\n },\n ]\n\n return (\n <Box\n bg=\"white\"\n borderRadius=\"radius-8\"\n p=\"space-16\"\n minW=\"240px\"\n maxW=\"260px\"\n css={{ '& *': { fontFamily: 'inherit' } }}\n >\n <HStack justify=\"space-between\" alignItems=\"baseline\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.md\" fontWeight=\"bold\">\n {labels.title}\n </Text>\n {rating.insufficientData || rating.overall == null ? (\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"medium\" color=\"grey.400\">\n {labels.insufficientData}\n </Text>\n ) : (\n <Text as=\"span\" fontSize=\"body.lg\" fontWeight=\"medium\" style={{ color: getHeadlineColor(rating.overall) }}>\n {formatOverall(rating.overall)} / {SUPPLIER_RATING_MAX} ★\n </Text>\n )}\n </HStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-8\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.componentsTitle}\n </Text>\n {rows.map(row => (\n <VStack key={row.key} alignItems=\"stretch\" gap=\"space-2\">\n <Text as=\"span\" fontSize=\"body.sm\" color=\"grey.500\">\n {labels.components[row.key]}\n </Text>\n <HStack alignItems=\"center\" gap=\"space-8\">\n <Box flex=\"1\" h=\"3px\" bg=\"grey.100\" borderRadius=\"full\" overflow=\"hidden\">\n <Box\n h=\"100%\"\n borderRadius=\"full\"\n style={{\n width: row.barPercent != null ? `${row.barPercent}%` : '0%',\n background: row.color ?? 'transparent',\n }}\n />\n </Box>\n <Text\n as=\"span\"\n fontSize=\"body.sm\"\n fontWeight=\"medium\"\n minW=\"48px\"\n textAlign=\"right\"\n style={{ color: row.color }}\n color={row.color ? undefined : 'grey.300'}\n >\n {row.value}\n </Text>\n </HStack>\n </VStack>\n ))}\n </VStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-4\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.completionTitle}\n </Text>\n {COMPLETION_ORDER.map(key => {\n const done = rating.completion[key]\n return (\n <HStack key={key} alignItems=\"center\" gap=\"space-8\">\n <Icon size=\"sm\" color={done ? 'success.500' : 'grey.300'} flexShrink=\"0\">\n {done ? <CheckCircleIcon /> : <XCircleIcon />}\n </Icon>\n <Text as=\"span\" fontSize=\"body.sm\" color={done ? 'grey.500' : 'grey.400'}>\n {labels.completion[key]}\n </Text>\n </HStack>\n )\n })}\n </VStack>\n\n {labels.footer && (\n <>\n <Box h=\"1px\" bg=\"grey.100\" mt=\"space-8\" mb=\"space-8\" />\n <Text as=\"span\" fontSize=\"9px\" color=\"grey.300\" style={{ lineHeight: 1 }}>\n {labels.footer}\n </Text>\n </>\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;AAKA,IAAa,IAAsB,GAgDtB,IAAuD;CAClE,OAAO;CACP,kBAAkB;CAClB,iBAAiB;CACjB,iBAAiB;CACjB,cAAc;CACd,OAAO;EAAE,SAAS;EAAO,OAAO;EAAK,MAAM;CAAI;CAC/C,YAAY;EACV,cAAc;EACd,eAAe;EACf,YAAY;CACd;CACA,YAAY;EACV,SAAS;EACT,kBAAkB;EAClB,cAAc;EACd,QAAQ;EACR,aAAa;EACb,iBAAiB;CACnB;AACF,GAEM,IAAkD;CACtD;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAgB,EAAc,GAAyB;CACrD,OAAO,EAAQ,QAAQ,CAAC,EAAE,QAAQ,KAAK,GAAG;AAC5C;AAGA,SAAgB,EAAoB,GAAiB,GAA8C;CACjG,IAAI,IAAU,IAAI,OAAO,GAAG,KAAK,MAAM,CAAO,EAAE,GAAG,EAAM;CACzD,IAAM,IAAQ,IAAU;CAGxB,OAFI,IAAQ,KAAW,GAAG,KAAK,MAAM,CAAK,EAAE,GAAG,EAAM,UAE9C,IADM,IAAQ,IACN,QAAQ,CAAC,EAAE,QAAQ,KAAK,GAAG,EAAE,GAAG,EAAM;AACvD;AAEA,SAAgB,EAAiB,GAAyB;CACxD,IAAM,IAAQ,IAAA;CAGd,OAFI,KAAS,KAAY,YACrB,KAAS,KAAY,YAClB;AACT;AAEA,SAAS,EAAY,GAA8B;CAGjD,OAFI,KAAgB,KAAW,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KAAI;cAAjC,CACE,kBAAC,GAAD;KAAM,IAAG;KAAO,UAAS;KAAU,YAAW;KAAO,OAAM;eACxD,EAAO;IACJ,CAAA,GACL,EAAiB,KAAI,MAAO;KAC3B,IAAM,IAAO,EAAO,WAAW;KAC/B,OACE,kBAAC,GAAD;MAAkB,YAAW;MAAS,KAAI;gBAA1C,CACE,kBAAC,GAAD;OAAM,MAAK;OAAK,OAAO,IAAO,gBAAgB;OAAY,YAAW;iBAC3D,EAAP,IAAQ,IAAsB,GAAvB,CAAkB,CAAkB;MACxC,CAAA,GACN,kBAAC,GAAD;OAAM,IAAG;OAAO,UAAS;OAAU,OAAO,IAAO,aAAa;iBAC3D,EAAO,WAAW;MACf,CAAA,CACA;QAPK,CAOL;IAEZ,CAAC,CACK;;GAEP,EAAO,UACN,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;IAAK,GAAE;IAAM,IAAG;IAAW,IAAG;IAAU,IAAG;GAAW,CAAA,GACtD,kBAAC,GAAD;IAAM,IAAG;IAAO,UAAS;IAAM,OAAM;IAAW,OAAO,EAAE,YAAY,EAAE;cACpE,EAAO;GACJ,CAAA,CACN,EAAA,CAAA;EAED;;AAET"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});/* empty css */const e=require("./components/accordion/Accordion.cjs"),t=require("./components/button/Button.cjs"),n=require("./components/checkbox/Checkbox.cjs"),r=require("./components/icon-button/IconButton.cjs"),i=require("./components/drawer/Drawer.cjs"),ee=require("./components/form/FormControl.cjs"),a=require("./components/tooltip/Tooltip.cjs"),o=require("./components/form/FormLabel.cjs"),s=require("./components/form/FormHelperText.cjs"),c=require("./components/heading/Heading.cjs"),l=require("./components/switch/Switch.cjs"),u=require("./components/text/Text.cjs"),d=require("./components/textarea/Textarea.cjs"),f=require("./components/tabs/Tabs.cjs"),
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});/* empty css */const e=require("./components/accordion/Accordion.cjs"),t=require("./components/button/Button.cjs"),n=require("./components/checkbox/Checkbox.cjs"),r=require("./components/icon-button/IconButton.cjs"),i=require("./components/drawer/Drawer.cjs"),ee=require("./components/form/FormControl.cjs"),a=require("./components/tooltip/Tooltip.cjs"),o=require("./components/form/FormLabel.cjs"),s=require("./components/form/FormHelperText.cjs"),c=require("./components/heading/Heading.cjs"),l=require("./components/switch/Switch.cjs"),u=require("./components/text/Text.cjs"),d=require("./components/textarea/Textarea.cjs"),f=require("./components/tabs/Tabs.cjs"),p=require("./components/select/Select.cjs"),te=require("./components/select-language/SelectLanguage.cjs"),ne=require("./components/input/Input.cjs"),m=require("./components/input/HighlightedInput.cjs"),re=require("./components/input/InputAddon.cjs"),h=require("./components/input/InputGroup.cjs"),g=require("./components/input/PhoneNumberInput.cjs"),_=require("./components/box/Box.cjs"),v=require("./components/date-picker/DatePicker.cjs"),y=require("./components/tag/Tag.cjs"),b=require("./components/radio-button-group/RadioButtonGroup.cjs"),x=require("./components/radio-group/RadioGroup.cjs"),S=require("./components/chip/Chip.cjs"),C=require("./components/action-card/ActionCard.cjs"),w=require("./components/alert/Alert.cjs"),T=require("./components/table/Table.cjs"),E=require("./components/breadcrumb/Breadcrumb.cjs"),D=require("./components/popover/Popover.cjs"),O=require("./components/pagination/Pagination.cjs"),k=require("./components/illustration/Illustration.cjs"),A=require("./components/button-filter/ButtonFilter.cjs"),j=require("./components/status-tag-select/StatusTagSelect.cjs"),M=require("./components/switch-card/namespace.cjs"),N=require("./components/radio-card-group/namespace.cjs"),P=require("./components/checkbox-card/namespace.cjs"),F=require("./components/combobox/Combobox.cjs"),I=require("./components/icon/Icon.cjs"),L=require("./components/collapsible/styled.cjs"),ie=require("./components/dialog/styled.cjs"),R=require("./components/avatar/styled.cjs"),z=require("./components/menu/Menu.cjs"),B=require("./components/flag/styled.cjs"),V=require("./components/chat/ChatMessage.cjs"),H=require("./components/chat/ChatDocumentMessage.cjs"),U=require("./components/chat/ChatProfileAvatar.cjs"),W=require("./components/chat/Chat.cjs"),G=require("./components/chat/ChatScoreBreakdown.cjs"),K=require("./components/chat/ChatTextInput.cjs"),q=require("./components/supplier-rating-badge/SupplierRatingBreakdown.cjs"),J=require("./components/supplier-rating-badge/SupplierRatingBadge.cjs"),Y=require("./components/app/price-tag/PriceTag.cjs"),ae=require("./components/app/product-card-catalog/styled.cjs"),oe=require("./components/app/navigation/AppNavigation.cjs"),se=require("./components/app/navigation/language-select/AppNavigationLanguageSelect.cjs"),ce=require("./components/app/mobile-navigation/MobileNavigation.cjs"),le=require("./components/app/mobile-card/MobileCardShell.cjs"),X=require("./components/app/mobile-card/MobileCardHeader.cjs"),ue=require("./components/app/mobile-card/MobileCardNotificationBadge.cjs"),de=require("./components/app/mobile-card/MobileCardEntityRow.cjs"),Z=require("./components/app/mobile-card/MobileCardSkeleton.cjs"),fe=require("./preset.cjs");let Q=require("@ark-ui/react"),$=require("react-phone-number-input");exports.Accordion=e.Accordion,exports.AccordionItem=e.AccordionItem,exports.AccordionItemContent=e.AccordionItemContent,exports.AccordionItemIndicator=e.AccordionItemIndicator,exports.AccordionItemTrigger=e.AccordionItemTrigger,exports.ActionCard=C.ActionCard,exports.ActionCardDescription=C.ActionCardDescription,exports.ActionCardTitle=C.ActionCardTitle,exports.Alert=w.Alert,Object.defineProperty(exports,"AppNavigation",{enumerable:!0,get:function(){return oe.AppNavigation_exports}}),exports.AppNavigationLanguageSelect=se.AppNavigationLanguageSelect,Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return R.styled_exports}}),exports.Box=_.Box,exports.Breadcrumb=E.Breadcrumb,exports.BreadcrumbItem=E.BreadcrumbItem,exports.BreadcrumbLink=E.BreadcrumbLink,exports.Button=t.Button,exports.ButtonFilter=A.ButtonFilter,Object.defineProperty(exports,"Chat",{enumerable:!0,get:function(){return W.Chat_exports}}),exports.ChatDocumentMessage=H.ChatDocumentMessage,exports.ChatMessage=V.ChatMessage,exports.ChatProfileAvatar=U.ChatProfileAvatar,exports.ChatScoreBreakdown=G.ChatScoreBreakdown,exports.ChatTextInput=K.ChatTextInput,exports.Checkbox=n.Checkbox,Object.defineProperty(exports,"CheckboxCard",{enumerable:!0,get:function(){return P.namespace_exports}}),exports.CheckboxGroup=n.CheckboxGroup,exports.Chip=S.Chip,exports.ChipAvatar=S.ChipAvatar,exports.ChipClearTrigger=S.ChipClearTrigger,exports.ChipLabel=S.ChipLabel,Object.defineProperty(exports,"Collapsible",{enumerable:!0,get:function(){return L.styled_exports}}),exports.Combobox=F.Combobox,exports.DEFAULT_SUPPLIER_RATING_LABELS=q.DEFAULT_SUPPLIER_RATING_LABELS,exports.DatePicker=v.DatePicker,Object.defineProperty(exports,"Dialog",{enumerable:!0,get:function(){return ie.styled_exports}}),exports.Drawer=i.Drawer,exports.DrawerBody=i.DrawerBody,exports.DrawerCloseTrigger=i.DrawerCloseTrigger,exports.DrawerContent=i.DrawerContent,exports.DrawerContext=i.DrawerContext,exports.DrawerFooter=i.DrawerFooter,exports.DrawerHeader=i.DrawerHeader,exports.DrawerTitle=i.DrawerTitle,exports.DrawerTrigger=i.DrawerTrigger,exports.Flag=B.Flag,exports.FlagCountryCodes=B.FlagCountryCodes,exports.FormControl=ee.FormControl,exports.FormHelperText=s.FormHelperText,exports.FormLabel=o.FormLabel,exports.Heading=c.Heading,exports.Highlight=m.Highlight,exports.HighlightedInput=m.HighlightedInput,exports.Icon=I.Icon,exports.IconButton=r.IconButton,exports.Illustration=k.Illustration,exports.Input=ne.Input,exports.InputAddon=re.InputAddon,exports.InputGroup=h.InputGroup,exports.InputSlot=m.InputSlot,Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return z.Menu_exports}}),exports.MobileCardEntityRow=de.MobileCardEntityRow,exports.MobileCardHeader=X.MobileCardHeader,exports.MobileCardNotificationBadge=ue.MobileCardNotificationBadge,exports.MobileCardShell=le.MobileCardShell,exports.MobileCardSkeleton=Z.MobileCardSkeleton,exports.MobileCardSkeletonList=Z.MobileCardSkeletonList,Object.defineProperty(exports,"MobileNavigation",{enumerable:!0,get:function(){return ce.MobileNavigation_exports}}),exports.Pagination=O.Pagination,exports.PhoneNumberInput=g.PhoneNumberInput,exports.Popover=D.Popover,exports.PopoverAnchor=D.PopoverAnchor,exports.PopoverCloseTrigger=D.PopoverCloseTrigger,exports.PopoverContent=D.PopoverContent,exports.PopoverContext=D.PopoverContext,exports.PopoverTrigger=D.PopoverTrigger,exports.PriceTag=Y.PriceTag,Object.defineProperty(exports,"ProductCardCatalog",{enumerable:!0,get:function(){return ae.styled_exports}}),exports.RadioButtonGroup=b.RadioButtonGroup,exports.RadioButtonGroupItem=b.RadioButtonGroupItem,exports.RadioButtonGroupLabel=b.RadioButtonGroupLabel,Object.defineProperty(exports,"RadioCardGroup",{enumerable:!0,get:function(){return N.namespace_exports}}),exports.RadioGroup=x.RadioGroup,exports.RadioGroupItem=x.RadioGroupItem,exports.RadioGroupLabel=x.RadioGroupLabel,exports.Renderer=m.Renderer,exports.Root=m.Root,exports.SUPPLIER_RATING_MAX=q.SUPPLIER_RATING_MAX,exports.Select=p.Select,exports.SelectLanguage=te.SelectLanguage,exports.SkeletonBlock=Z.SkeletonBlock,exports.StatusTagSelect=j.StatusTagSelect,exports.SupplierRatingBadge=J.SupplierRatingBadge,exports.SupplierRatingBreakdown=q.SupplierRatingBreakdown,exports.Switch=l.Switch,Object.defineProperty(exports,"SwitchCard",{enumerable:!0,get:function(){return M.namespace_exports}}),exports.Table=T.Table,exports.TableContainer=T.TableContainer,exports.TableEmptyRow=T.TableEmptyRow,exports.TableGroupTitle=T.TableGroupTitle,exports.Tabs=f.Tabs,exports.TabsChip=f.TabsChip,exports.TabsContent=f.TabsContent,exports.TabsList=f.TabsList,exports.TabsTrigger=f.TabsTrigger,exports.Tag=y.Tag,exports.Tbody=T.Tbody,exports.Td=T.Td,exports.Text=u.Text,exports.Textarea=d.Textarea,exports.Th=T.Th,exports.Thead=T.Thead,exports.Tooltip=a.Tooltip,exports.Tr=T.Tr,Object.defineProperty(exports,"createListCollection",{enumerable:!0,get:function(){return Q.createListCollection}}),Object.defineProperty(exports,"createToaster",{enumerable:!0,get:function(){return Q.createToaster}}),exports.formatOverall=q.formatOverall,Object.defineProperty(exports,"formatPhoneNumber",{enumerable:!0,get:function(){return $.formatPhoneNumber}}),Object.defineProperty(exports,"formatPhoneNumberIntl",{enumerable:!0,get:function(){return $.formatPhoneNumberIntl}}),exports.formatResponseDelay=q.formatResponseDelay,Object.defineProperty(exports,"getCountries",{enumerable:!0,get:function(){return $.getCountries}}),Object.defineProperty(exports,"getCountryCallingCode",{enumerable:!0,get:function(){return $.getCountryCallingCode}}),exports.getHeadlineColor=q.getHeadlineColor,Object.defineProperty(exports,"isPossiblePhoneNumber",{enumerable:!0,get:function(){return $.isPossiblePhoneNumber}}),Object.defineProperty(exports,"isSupportedCountry",{enumerable:!0,get:function(){return $.isSupportedCountry}}),Object.defineProperty(exports,"isValidPhoneNumber",{enumerable:!0,get:function(){return $.isValidPhoneNumber}}),Object.defineProperty(exports,"parseColor",{enumerable:!0,get:function(){return Q.parseColor}}),Object.defineProperty(exports,"parseDate",{enumerable:!0,get:function(){return Q.parseDate}}),Object.defineProperty(exports,"parsePhoneNumber",{enumerable:!0,get:function(){return $.parsePhoneNumber}}),exports.preset=fe.preset,Object.defineProperty(exports,"useAccordion",{enumerable:!0,get:function(){return Q.useAccordion}});
|