@stokelp/ui 2.115.0 → 2.117.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.js","names":[],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n ...props\n}: ComboboxProps<T>) => {\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n const allItems = [...items, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n useEffect(() => {\n if (!withAutoFilter && !debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, withAutoFilter, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Chargement...\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Aucun résultat\n </Text>\n )\n // TODO: const multiple = props.multiple\n // TODO: multiple design, using input chips https://ark-ui.com/reat/examples/combobox-with-tags-input\n const multiple = false\n\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n // TODO: multiple design\n multiple={multiple}\n >\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsBA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,CAAQ,GAG3D,IAAO,EAAa,EAAO,EAAY,IAAS,GAAG,QAAQ,EAC/D,cAAc,EACZ,WAAW,GACb,EACF,CAAC,GAEK,KAAe,EAAY,EAAO,EAAY,YAAY,GAAG,cAAc,GAC3E,IAAU,EAAY,EAAO,EAAY,OAAO,GAAG,SAAS,GAC5D,IAAQ,EAAY,EAAO,EAAY,KAAK,GAAG,OAAO,GACtD,IAAU,EAAY,EAAO,EAAY,OAAO,GAAG,SAAS,GAC5D,IAAO,EAAY,EAAO,EAAY,IAAI,GAAG,MAAM,GACnD,IAAW,EAAY,EAAO,EAAY,QAAQ,GAAG,UAAU,GAC/D,IAAa,EAAY,EAAO,EAAY,UAAU,GAAG,YAAY,GACrE,IAAU,EAAY,EAAO,EAAY,OAAO,GAAG,SAAS,GA+B5D,UACJ,kBAAC,OAAD;CAAK,OAAM;CAAK,QAAO;CAAK,SAAQ;CAAY,MAAK;CAAO,OAAM;WAAlE,CACE,kBAAC,QAAD;EAAM,GAAE;EAAM,GAAE;EAAI,OAAM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UAAO,eACT,kBAAC,GAAD;KAEE,MAAM,CAAC,CAAC,EAAS,GAAO;KACxB,UAAS,MAAY,kBAAC,GAAD;MAAS,OAAO,EAAS,GAAO;MAAU;KAAkB,CAAA;eAEjF,kBAAC,GAAD;MAAkC,MAAM,EAAS;MAAe;gBAC9D,kBAAC,GAAD;OAA6B;OAAY,MAAM,EAAS;OAAQ,YAAY;MAAW,CAAA;KACnF,GAFK,EAAS,GAAO,KAErB;IACY,GAPb,EAAS,GAAO,KAOH;GAET,CAAA,EACf,CAAA,IAEF,EAAS,KAAI,MACX,kBAAC,GAAD;IAEE,MAAM,CAAC,CAAC,EAAK;IACb,UAAS,MAAY,kBAAC,GAAD;KAAS,OAAO,EAAK;KAAU;IAAkB,CAAA;cAEtE,kBAAC,GAAD;KAA6B;eAC3B,kBAAC,GAAD;MAA6B;MAAkB;MAAM,YAAY;KAAW,CAAA;IACxE,GAFK,EAAK,KAEV;GACY,GAPb,EAAK,KAOQ,CACrB,EAEI,CAAA,EACC,CAAA;EACM,CAAA,CAChB;;AAEV"}
1
+ {"version":3,"file":"Combobox.js","names":[],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n const allItems = [...items, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n useEffect(() => {\n if (!withAutoFilter && !debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, withAutoFilter, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Chargement...\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Aucun résultat\n </Text>\n )\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control is the bordered box, holding the\n // selected chips and a borderless growing input, with a flat bottom\n // while open so the dropdown attaches seamlessly.\n <ArkCombobox.Context>\n {api => (\n <Control\n css={{\n display: 'flex',\n alignItems: 'center',\n gap: 'space-4',\n minHeight: '40px',\n paddingBlock: 'space-4',\n paddingLeft: 'space-8',\n paddingRight: 'space-48',\n border: '1px solid {colors.grey.100}',\n borderRadius: 'radius-8',\n cursor: 'text',\n transitionProperty: 'border-color',\n transitionDuration: 'normal',\n _focusWithin: { borderColor: 'primary.500' },\n ...(api.open\n ? {\n borderColor: 'primary.500',\n borderBottomColor: 'grey.100',\n borderBottomLeftRadius: 'radius-0',\n borderBottomRightRadius: 'radius-0',\n }\n : {}),\n _disabled: { cursor: 'not-allowed', background: 'grey.50' },\n }}\n >\n <div\n className={css({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n gap: 'space-4',\n flex: '1',\n minWidth: '0',\n })}\n >\n {(api.selectedItems as T[]).map(item => (\n <Chip key={item.value} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(v => String(v) !== String(item.value)))}\n />\n )}\n </Chip>\n ))}\n <ArkCombobox.Input\n asChild\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput\n css={{\n border: 'none',\n minHeight: 'auto',\n height: 'auto',\n width: 'auto',\n flex: '1 1 90px',\n minWidth: '90px',\n paddingBlock: 'space-2',\n paddingInline: 'space-0',\n background: 'transparent',\n _hover: { borderColor: 'transparent' },\n _focus: { borderColor: 'transparent' },\n }}\n />\n </ArkCombobox.Input>\n </div>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n </Control>\n )}\n </ArkCombobox.Context>\n ) : (\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n )}\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,CAAQ,GAG3D,KAAO,EAAa,EAAO,EAAY,IAAS,GAAG,QAAQ,EAC/D,cAAc,EACZ,WAAW,GACb,EACF,CAAC,GAEK,KAAe,EAAY,EAAO,EAAY,YAAY,GAAG,cAAc,GAC3E,IAAU,EAAY,EAAO,EAAY,OAAO,GAAG,SAAS,GAC5D,IAAQ,EAAY,EAAO,EAAY,KAAK,GAAG,OAAO,GACtD,IAAU,EAAY,EAAO,EAAY,OAAO,GAAG,SAAS,GAC5D,IAAO,EAAY,EAAO,EAAY,IAAI,GAAG,MAAM,GACnD,IAAW,EAAY,EAAO,EAAY,QAAQ,GAAG,UAAU,GAC/D,IAAa,EAAY,EAAO,EAAY,UAAU,GAAG,YAAY,GACrE,IAAU,EAAY,EAAO,EAAY,OAAO,GAAG,SAAS,GAqC5D,UACJ,kBAAC,OAAD;CAAK,OAAM;CAAK,QAAO;CAAK,SAAQ;CAAY,MAAK;CAAO,OAAM;WAAlE,CACE,kBAAC,QAAD;EAAM,GAAE;EAAM,GAAE;EAAI,OAAM;EAAK,QAAO;EAAK,IAAG;EAAM,MAAK;CAAS,CAAA,GAClE,kBAAC,QAAD;EAAM,GAAE;EAAM,GAAE;EAAI,OAAM;EAAK,QAAO;EAAK,IAAG;EAAM,WAAW,EAAI,EAAE,QAAQ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EAAA,UACE,kBAAC,IAAD;IACE,QAAQ,KAAK,IAAI,IAAY,EAAS,QAAQ,GAAG;IACjD,WAAW,EAAS;IACpB,UAAU;IACV,OAAM;eAEJ,EAAE,UAAO,eACT,kBAAC,GAAD;KAEE,MAAM,CAAC,CAAC,EAAS,GAAO;KACxB,UAAS,MAAY,kBAAC,GAAD;MAAS,OAAO,EAAS,GAAO;MAAU;KAAkB,CAAA;eAEjF,kBAAC,GAAD;MAAkC,MAAM,EAAS;MAAe;gBAC9D,kBAAC,GAAD;OAA6B;OAAY,MAAM,EAAS;OAAQ,YAAY;MAAW,CAAA;KACnF,GAFK,EAAS,GAAO,KAErB;IACY,GAPb,EAAS,GAAO,KAOH;GAET,CAAA,EACf,CAAA,IAEF,EAAS,KAAI,MACX,kBAAC,GAAD;IAEE,MAAM,CAAC,CAAC,EAAK;IACb,UAAS,MAAY,kBAAC,GAAD;KAAS,OAAO,EAAK;KAAU;IAAkB,CAAA;cAEtE,kBAAC,GAAD;KAA6B;eAC3B,kBAAC,GAAD;MAA6B;MAAkB;MAAM,YAAY;KAAW,CAAA;IACxE,GAFK,EAAK,KAEV;GACY,GAPb,EAAK,KAOQ,CACrB,EAEI,CAAA,EACC,CAAA;EACM,CAAA,CAChB;;AAEV"}
@@ -38,6 +38,7 @@ export * from './dialog';
38
38
  export * from './avatar';
39
39
  export * from './menu';
40
40
  export * from './flag';
41
+ export * from './origin-select';
41
42
  export * from './chat';
42
43
  export * from './supplier-rating-badge';
43
44
  export * from './app';
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../text/Text.cjs"),t=require("../chip/Chip.cjs"),n=require("../combobox/Combobox.cjs"),r=require("../flag/styled.cjs");let i=require("react/jsx-runtime");var a=e=>{if(!e)return;let t=e.toLowerCase();return r.FlagCountryCodes.includes(t)?t:void 0},o=o=>(0,i.jsx)(n.Combobox,{...o,renderItem:t=>{let n=a(t.countryCode);return(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsx)(r.Flag,{countryCode:n,w:`21px`,h:`15px`}),(0,i.jsx)(e.Text,{truncate:!0,children:t.label})]})},renderValue:e=>{let n=a(e.countryCode);return(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsx)(r.Flag,{countryCode:n,w:`18px`,h:`13px`}),(0,i.jsx)(t.ChipLabel,{children:e.label})]})}});exports.OriginSelect=o;
2
+ //# sourceMappingURL=OriginSelect.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OriginSelect.cjs","names":[],"sources":["../../../src/components/origin-select/OriginSelect.tsx"],"sourcesContent":["import { Combobox, type ComboboxItem, type ComboboxProps } from '~/components/combobox'\nimport { ChipLabel } from '~/components/chip'\nimport { Flag, FlagCountryCodes, type FlagCountryCode } from '~/components/flag'\nimport { Text } from '~/components/text'\n\nexport type OriginSelectItem = ComboboxItem & {\n /**\n * ISO-3166 alpha-2 country code (case-insensitive). When it maps to a known\n * flag it is rendered next to the label, both in the list and in the selected\n * chips. Origins without a country code (e.g. FAO fishing areas) render label\n * only.\n */\n countryCode?: string\n}\n\n/**\n * A searchable (optionally multiple) origin picker built on top of `Combobox`.\n * Options are countries: each row shows the flag + name, and in `multiple` mode\n * the selection is displayed as removable flag chips. Search, keyboard nav and\n * chip removal come from `Combobox` for free.\n */\nexport type OriginSelectProps = Omit<ComboboxProps<OriginSelectItem>, 'renderItem' | 'renderValue'>\n\nconst toFlagCode = (countryCode?: string): FlagCountryCode | undefined => {\n if (!countryCode) return undefined\n const code = countryCode.toLowerCase()\n return (FlagCountryCodes as string[]).includes(code) ? (code as FlagCountryCode) : undefined\n}\n\nexport const OriginSelect = (props: OriginSelectProps) => (\n <Combobox<OriginSelectItem>\n {...props}\n renderItem={(item: OriginSelectItem) => {\n const code = toFlagCode(item.countryCode)\n return (\n <>\n {code && <Flag countryCode={code} w=\"21px\" h=\"15px\" />}\n <Text truncate>{item.label}</Text>\n </>\n )\n }}\n renderValue={(item: OriginSelectItem) => {\n const code = toFlagCode(item.countryCode)\n return (\n <>\n {code && <Flag countryCode={code} w=\"18px\" h=\"13px\" />}\n <ChipLabel>{item.label}</ChipLabel>\n </>\n )\n }}\n />\n)\n"],"mappings":"wLAuBA,IAAM,EAAc,GAAsD,CACxE,GAAI,CAAC,EAAa,OAClB,IAAM,EAAO,EAAY,YAAY,EACrC,OAAQ,EAAA,iBAA8B,SAAS,CAAI,EAAK,EAA2B,IAAA,EACrF,EAEa,EAAgB,IAC3B,EAAA,EAAA,KAAC,EAAA,SAAD,CACE,GAAI,EACJ,WAAa,GAA2B,CACtC,IAAM,EAAO,EAAW,EAAK,WAAW,EACxC,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,IAAQ,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,YAAa,EAAM,EAAE,OAAO,EAAE,MAAQ,CAAA,GACrD,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,SAAA,YAAU,EAAK,KAAY,CAAA,CACjC,CAAA,CAAA,CAEN,EACA,YAAc,GAA2B,CACvC,IAAM,EAAO,EAAW,EAAK,WAAW,EACxC,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,IAAQ,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,YAAa,EAAM,EAAE,OAAO,EAAE,MAAQ,CAAA,GACrD,EAAA,EAAA,KAAC,EAAA,UAAD,CAAA,SAAY,EAAK,KAAiB,CAAA,CAClC,CAAA,CAAA,CAEN,CACD,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { ComboboxItem, ComboboxProps } from '../combobox';
2
+ export type OriginSelectItem = ComboboxItem & {
3
+ /**
4
+ * ISO-3166 alpha-2 country code (case-insensitive). When it maps to a known
5
+ * flag it is rendered next to the label, both in the list and in the selected
6
+ * chips. Origins without a country code (e.g. FAO fishing areas) render label
7
+ * only.
8
+ */
9
+ countryCode?: string;
10
+ };
11
+ /**
12
+ * A searchable (optionally multiple) origin picker built on top of `Combobox`.
13
+ * Options are countries: each row shows the flag + name, and in `multiple` mode
14
+ * the selection is displayed as removable flag chips. Search, keyboard nav and
15
+ * chip removal come from `Combobox` for free.
16
+ */
17
+ export type OriginSelectProps = Omit<ComboboxProps<OriginSelectItem>, 'renderItem' | 'renderValue'>;
18
+ export declare const OriginSelect: (props: OriginSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { Text as e } from "../text/Text.js";
3
+ import { ChipLabel as t } from "../chip/Chip.js";
4
+ import { Combobox as n } from "../combobox/Combobox.js";
5
+ import { Flag as r, FlagCountryCodes as i } from "../flag/styled.js";
6
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ //#region src/components/origin-select/OriginSelect.tsx
8
+ var c = (e) => {
9
+ if (!e) return;
10
+ let t = e.toLowerCase();
11
+ return i.includes(t) ? t : void 0;
12
+ }, l = (i) => /* @__PURE__ */ o(n, {
13
+ ...i,
14
+ renderItem: (t) => {
15
+ let n = c(t.countryCode);
16
+ return /* @__PURE__ */ s(a, { children: [n && /* @__PURE__ */ o(r, {
17
+ countryCode: n,
18
+ w: "21px",
19
+ h: "15px"
20
+ }), /* @__PURE__ */ o(e, {
21
+ truncate: !0,
22
+ children: t.label
23
+ })] });
24
+ },
25
+ renderValue: (e) => {
26
+ let n = c(e.countryCode);
27
+ return /* @__PURE__ */ s(a, { children: [n && /* @__PURE__ */ o(r, {
28
+ countryCode: n,
29
+ w: "18px",
30
+ h: "13px"
31
+ }), /* @__PURE__ */ o(t, { children: e.label })] });
32
+ }
33
+ });
34
+ //#endregion
35
+ export { l as OriginSelect };
36
+
37
+ //# sourceMappingURL=OriginSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OriginSelect.js","names":[],"sources":["../../../src/components/origin-select/OriginSelect.tsx"],"sourcesContent":["import { Combobox, type ComboboxItem, type ComboboxProps } from '~/components/combobox'\nimport { ChipLabel } from '~/components/chip'\nimport { Flag, FlagCountryCodes, type FlagCountryCode } from '~/components/flag'\nimport { Text } from '~/components/text'\n\nexport type OriginSelectItem = ComboboxItem & {\n /**\n * ISO-3166 alpha-2 country code (case-insensitive). When it maps to a known\n * flag it is rendered next to the label, both in the list and in the selected\n * chips. Origins without a country code (e.g. FAO fishing areas) render label\n * only.\n */\n countryCode?: string\n}\n\n/**\n * A searchable (optionally multiple) origin picker built on top of `Combobox`.\n * Options are countries: each row shows the flag + name, and in `multiple` mode\n * the selection is displayed as removable flag chips. Search, keyboard nav and\n * chip removal come from `Combobox` for free.\n */\nexport type OriginSelectProps = Omit<ComboboxProps<OriginSelectItem>, 'renderItem' | 'renderValue'>\n\nconst toFlagCode = (countryCode?: string): FlagCountryCode | undefined => {\n if (!countryCode) return undefined\n const code = countryCode.toLowerCase()\n return (FlagCountryCodes as string[]).includes(code) ? (code as FlagCountryCode) : undefined\n}\n\nexport const OriginSelect = (props: OriginSelectProps) => (\n <Combobox<OriginSelectItem>\n {...props}\n renderItem={(item: OriginSelectItem) => {\n const code = toFlagCode(item.countryCode)\n return (\n <>\n {code && <Flag countryCode={code} w=\"21px\" h=\"15px\" />}\n <Text truncate>{item.label}</Text>\n </>\n )\n }}\n renderValue={(item: OriginSelectItem) => {\n const code = toFlagCode(item.countryCode)\n return (\n <>\n {code && <Flag countryCode={code} w=\"18px\" h=\"13px\" />}\n <ChipLabel>{item.label}</ChipLabel>\n </>\n )\n }}\n />\n)\n"],"mappings":";;;;;;;AAuBA,IAAM,KAAc,MAAsD;CACxE,IAAI,CAAC,GAAa;CAClB,IAAM,IAAO,EAAY,YAAY;CACrC,OAAQ,EAA8B,SAAS,CAAI,IAAK,IAA2B,KAAA;AACrF,GAEa,KAAgB,MAC3B,kBAAC,GAAD;CACE,GAAI;CACJ,aAAa,MAA2B;EACtC,IAAM,IAAO,EAAW,EAAK,WAAW;EACxC,OACE,kBAAA,GAAA,EAAA,UAAA,CACG,KAAQ,kBAAC,GAAD;GAAM,aAAa;GAAM,GAAE;GAAO,GAAE;EAAQ,CAAA,GACrD,kBAAC,GAAD;GAAM,UAAA;aAAU,EAAK;EAAY,CAAA,CACjC,EAAA,CAAA;CAEN;CACA,cAAc,MAA2B;EACvC,IAAM,IAAO,EAAW,EAAK,WAAW;EACxC,OACE,kBAAA,GAAA,EAAA,UAAA,CACG,KAAQ,kBAAC,GAAD;GAAM,aAAa;GAAM,GAAE;GAAO,GAAE;EAAQ,CAAA,GACrD,kBAAC,GAAD,EAAA,UAAY,EAAK,MAAiB,CAAA,CAClC,EAAA,CAAA;CAEN;AACD,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './OriginSelect';
@@ -1,2 +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;
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:`Non noté`,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.jsxs)(i.HStack,{justify:`space-between`,alignItems:`baseline`,gap:`space-8`,children:[(0,a.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,color:`grey.500`,children:h.components[t.key]}),(0,a.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`medium`,whiteSpace:`nowrap`,style:{color:t.color},color:t.color?void 0:`grey.300`,children:t.value})]}),(0,a.jsx)(i.Box,{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`}})})]},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
2
  //# sourceMappingURL=SupplierRatingBreakdown.cjs.map
@@ -1 +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 )\n}\n"],"mappings":"4aAKA,IAAa,EAAsB,EAgDtB,EAAuD,CAClE,MAAO,mBACP,iBAAkB,8BAClB,gBAAiB,oBACjB,gBAAiB,uBACjB,aAAc,IACd,MAAO,CAAE,QAAS,MAAO,MAAO,IAAK,KAAM,GAAI,EAC/C,WAAY,CACV,aAAc,kBACd,cAAe,mBACf,WAAY,sBACd,EACA,WAAY,CACV,QAAS,gCACT,iBAAkB,0BAClB,aAAc,mCACd,OAAQ,qBACR,YAAa,aACb,gBAAiB,iBACnB,CACF,EAEM,EAAkD,CACtD,UACA,mBACA,eACA,SACA,cACA,iBACF,EAEA,SAAgB,EAAc,EAAyB,CACrD,OAAO,EAAQ,QAAQ,CAAC,EAAE,QAAQ,IAAK,GAAG,CAC5C,CAGA,SAAgB,EAAoB,EAAiB,EAA8C,CACjG,GAAI,EAAU,GAAI,MAAO,GAAG,KAAK,MAAM,CAAO,EAAE,GAAG,EAAM,UACzD,IAAM,EAAQ,EAAU,GAGxB,OAFI,EAAQ,GAAW,GAAG,KAAK,MAAM,CAAK,EAAE,GAAG,EAAM,QAE9C,IADM,EAAQ,IACN,QAAQ,CAAC,EAAE,QAAQ,IAAK,GAAG,EAAE,GAAG,EAAM,MACvD,CAEA,SAAgB,EAAiB,EAAyB,CACxD,IAA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AAO,CAAE,WAAY,CAAE,WACpE,EAAO,MACJ,CAAA,CACN,CAAA,CAAA,CAED,GAET"}
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: 'Non noté',\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 <HStack justify=\"space-between\" alignItems=\"baseline\" gap=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" color=\"grey.500\">\n {labels.components[row.key]}\n </Text>\n <Text\n as=\"span\"\n fontSize=\"body.sm\"\n fontWeight=\"medium\"\n whiteSpace=\"nowrap\"\n style={{ color: row.color }}\n color={row.color ? undefined : 'grey.300'}\n >\n {row.value}\n </Text>\n </HStack>\n <Box 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 </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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,WAAW,UAAU,IAAI,mBAAjC,EACE,EAAA,EAAA,KAAC,EAAA,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"}
@@ -8,7 +8,7 @@ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  //#region src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx
9
9
  var u = 5, d = {
10
10
  title: "Note fournisseur",
11
- insufficientData: "Pas encore assez de données",
11
+ insufficientData: "Non noté",
12
12
  componentsTitle: "Détail de la note",
13
13
  completionTitle: "Complétion du compte",
14
14
  notAvailable: "—",
@@ -143,38 +143,37 @@ var _ = ({ rating: u, responseRate: _, labels: v }) => {
143
143
  }), w.map((t) => /* @__PURE__ */ l(o, {
144
144
  alignItems: "stretch",
145
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",
146
+ children: [/* @__PURE__ */ l(a, {
147
+ justify: "space-between",
148
+ alignItems: "baseline",
153
149
  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
- })
150
+ children: [/* @__PURE__ */ c(e, {
151
+ as: "span",
152
+ fontSize: "body.sm",
153
+ color: "grey.500",
154
+ children: y.components[t.key]
168
155
  }), /* @__PURE__ */ c(e, {
169
156
  as: "span",
170
157
  fontSize: "body.sm",
171
158
  fontWeight: "medium",
172
- minW: "48px",
173
- textAlign: "right",
159
+ whiteSpace: "nowrap",
174
160
  style: { color: t.color },
175
161
  color: t.color ? void 0 : "grey.300",
176
162
  children: t.value
177
163
  })]
164
+ }), /* @__PURE__ */ c(i, {
165
+ h: "3px",
166
+ bg: "grey.100",
167
+ borderRadius: "full",
168
+ overflow: "hidden",
169
+ children: /* @__PURE__ */ c(i, {
170
+ h: "100%",
171
+ borderRadius: "full",
172
+ style: {
173
+ width: t.barPercent == null ? "0%" : `${t.barPercent}%`,
174
+ background: t.color ?? "transparent"
175
+ }
176
+ })
178
177
  })]
179
178
  }, t.key))]
180
179
  }),
@@ -1 +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;EA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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"}
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: 'Non noté',\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 <HStack justify=\"space-between\" alignItems=\"baseline\" gap=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" color=\"grey.500\">\n {labels.components[row.key]}\n </Text>\n <Text\n as=\"span\"\n fontSize=\"body.sm\"\n fontWeight=\"medium\"\n whiteSpace=\"nowrap\"\n style={{ color: row.color }}\n color={row.color ? undefined : 'grey.300'}\n >\n {row.value}\n </Text>\n </HStack>\n <Box 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 </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,YAC3B,KAAgB,KAAW,YACxB;AACT;AAkBA,IAAa,KAA2B,EAAE,WAA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O,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"),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}});
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/origin-select/OriginSelect.cjs"),H=require("./components/chat/ChatMessage.cjs"),U=require("./components/chat/ChatDocumentMessage.cjs"),W=require("./components/chat/ChatProfileAvatar.cjs"),G=require("./components/chat/Chat.cjs"),K=require("./components/chat/ChatScoreBreakdown.cjs"),q=require("./components/chat/ChatTextInput.cjs"),J=require("./components/supplier-rating-badge/SupplierRatingBreakdown.cjs"),Y=require("./components/supplier-rating-badge/SupplierRatingBadge.cjs"),ae=require("./components/app/price-tag/PriceTag.cjs"),oe=require("./components/app/product-card-catalog/styled.cjs"),se=require("./components/app/navigation/AppNavigation.cjs"),ce=require("./components/app/navigation/language-select/AppNavigationLanguageSelect.cjs"),le=require("./components/app/mobile-navigation/MobileNavigation.cjs"),X=require("./components/app/mobile-card/MobileCardShell.cjs"),ue=require("./components/app/mobile-card/MobileCardHeader.cjs"),de=require("./components/app/mobile-card/MobileCardNotificationBadge.cjs"),fe=require("./components/app/mobile-card/MobileCardEntityRow.cjs"),Z=require("./components/app/mobile-card/MobileCardSkeleton.cjs"),pe=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 se.AppNavigation_exports}}),exports.AppNavigationLanguageSelect=ce.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 G.Chat_exports}}),exports.ChatDocumentMessage=U.ChatDocumentMessage,exports.ChatMessage=H.ChatMessage,exports.ChatProfileAvatar=W.ChatProfileAvatar,exports.ChatScoreBreakdown=K.ChatScoreBreakdown,exports.ChatTextInput=q.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=J.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=fe.MobileCardEntityRow,exports.MobileCardHeader=ue.MobileCardHeader,exports.MobileCardNotificationBadge=de.MobileCardNotificationBadge,exports.MobileCardShell=X.MobileCardShell,exports.MobileCardSkeleton=Z.MobileCardSkeleton,exports.MobileCardSkeletonList=Z.MobileCardSkeletonList,Object.defineProperty(exports,"MobileNavigation",{enumerable:!0,get:function(){return le.MobileNavigation_exports}}),exports.OriginSelect=V.OriginSelect,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=ae.PriceTag,Object.defineProperty(exports,"ProductCardCatalog",{enumerable:!0,get:function(){return oe.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=J.SUPPLIER_RATING_MAX,exports.Select=p.Select,exports.SelectLanguage=te.SelectLanguage,exports.SkeletonBlock=Z.SkeletonBlock,exports.StatusTagSelect=j.StatusTagSelect,exports.SupplierRatingBadge=Y.SupplierRatingBadge,exports.SupplierRatingBreakdown=J.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=J.formatOverall,Object.defineProperty(exports,"formatPhoneNumber",{enumerable:!0,get:function(){return $.formatPhoneNumber}}),Object.defineProperty(exports,"formatPhoneNumberIntl",{enumerable:!0,get:function(){return $.formatPhoneNumberIntl}}),exports.formatResponseDelay=J.formatResponseDelay,Object.defineProperty(exports,"getCountries",{enumerable:!0,get:function(){return $.getCountries}}),Object.defineProperty(exports,"getCountryCallingCode",{enumerable:!0,get:function(){return $.getCountryCallingCode}}),exports.getHeadlineColor=J.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=pe.preset,Object.defineProperty(exports,"useAccordion",{enumerable:!0,get:function(){return Q.useAccordion}});
package/dist/index.js CHANGED
@@ -46,25 +46,26 @@ import { styled_exports as Pe } from "./components/dialog/styled.js";
46
46
  import { styled_exports as Fe } from "./components/avatar/styled.js";
47
47
  import { Menu_exports as Ie } from "./components/menu/Menu.js";
48
48
  import { Flag as Le, FlagCountryCodes as Re } from "./components/flag/styled.js";
49
- import { ChatMessage as ze } from "./components/chat/ChatMessage.js";
50
- import { ChatDocumentMessage as Be } from "./components/chat/ChatDocumentMessage.js";
51
- import { ChatProfileAvatar as Ve } from "./components/chat/ChatProfileAvatar.js";
52
- import { Chat_exports as He } from "./components/chat/Chat.js";
53
- import { ChatScoreBreakdown as Ue } from "./components/chat/ChatScoreBreakdown.js";
54
- import { ChatTextInput as We } from "./components/chat/ChatTextInput.js";
55
- import { DEFAULT_SUPPLIER_RATING_LABELS as Ge, SUPPLIER_RATING_MAX as Ke, SupplierRatingBreakdown as qe, formatOverall as Je, formatResponseDelay as Ye, getHeadlineColor as Xe } from "./components/supplier-rating-badge/SupplierRatingBreakdown.js";
56
- import { SupplierRatingBadge as Ze } from "./components/supplier-rating-badge/SupplierRatingBadge.js";
57
- import { PriceTag as Qe } from "./components/app/price-tag/PriceTag.js";
58
- import { styled_exports as $e } from "./components/app/product-card-catalog/styled.js";
59
- import { AppNavigation_exports as et } from "./components/app/navigation/AppNavigation.js";
60
- import { AppNavigationLanguageSelect as tt } from "./components/app/navigation/language-select/AppNavigationLanguageSelect.js";
61
- import { MobileNavigation_exports as nt } from "./components/app/mobile-navigation/MobileNavigation.js";
62
- import { MobileCardShell as rt } from "./components/app/mobile-card/MobileCardShell.js";
63
- import { MobileCardHeader as it } from "./components/app/mobile-card/MobileCardHeader.js";
64
- import { MobileCardNotificationBadge as at } from "./components/app/mobile-card/MobileCardNotificationBadge.js";
65
- import { MobileCardEntityRow as ot } from "./components/app/mobile-card/MobileCardEntityRow.js";
66
- import { MobileCardSkeleton as st, MobileCardSkeletonList as ct, SkeletonBlock as lt } from "./components/app/mobile-card/MobileCardSkeleton.js";
67
- import { preset as ut } from "./preset.js";
68
- import { createListCollection as dt, createToaster as ft, parseColor as pt, parseDate as mt } from "@ark-ui/react";
69
- import { formatPhoneNumber as ht, formatPhoneNumberIntl as gt, getCountries as _t, getCountryCallingCode as vt, isPossiblePhoneNumber as yt, isSupportedCountry as bt, isValidPhoneNumber as xt, parsePhoneNumber as St } from "react-phone-number-input";
70
- export { e as Accordion, t as AccordionItem, n as AccordionItemContent, r as AccordionItemIndicator, i as AccordionItemTrigger, ne as ActionCard, re as ActionCardDescription, ie as ActionCardTitle, ae as Alert, et as AppNavigation, tt as AppNavigationLanguageSelect, Fe as Avatar, U as Box, he as Breadcrumb, ge as BreadcrumbItem, _e as BreadcrumbLink, o as Button, Ee as ButtonFilter, He as Chat, Be as ChatDocumentMessage, ze as ChatMessage, Ve as ChatProfileAvatar, Ue as ChatScoreBreakdown, We as ChatTextInput, s as Checkbox, Ae as CheckboxCard, c as CheckboxGroup, Q as Chip, $ as ChipAvatar, ee as ChipClearTrigger, te as ChipLabel, Ne as Collapsible, je as Combobox, Ge as DEFAULT_SUPPLIER_RATING_LABELS, W as DatePicker, Pe as Dialog, u as Drawer, d as DrawerBody, f as DrawerCloseTrigger, p as DrawerContent, m as DrawerContext, h as DrawerFooter, g as DrawerHeader, _ as DrawerTitle, v as DrawerTrigger, Le as Flag, Re as FlagCountryCodes, y as FormControl, S as FormHelperText, x as FormLabel, C as Heading, F as Highlight, I as HighlightedInput, Me as Icon, l as IconButton, Te as Illustration, P as Input, B as InputAddon, V as InputGroup, L as InputSlot, Ie as Menu, ot as MobileCardEntityRow, it as MobileCardHeader, at as MobileCardNotificationBadge, rt as MobileCardShell, st as MobileCardSkeleton, ct as MobileCardSkeletonList, nt as MobileNavigation, we as Pagination, H as PhoneNumberInput, ve as Popover, ye as PopoverAnchor, be as PopoverCloseTrigger, xe as PopoverContent, Se as PopoverContext, Ce as PopoverTrigger, Qe as PriceTag, $e as ProductCardCatalog, K as RadioButtonGroup, q as RadioButtonGroupItem, J as RadioButtonGroupLabel, ke as RadioCardGroup, Y as RadioGroup, X as RadioGroupItem, Z as RadioGroupLabel, R as Renderer, z as Root, Ke as SUPPLIER_RATING_MAX, M as Select, N as SelectLanguage, lt as SkeletonBlock, De as StatusTagSelect, Ze as SupplierRatingBadge, qe as SupplierRatingBreakdown, w as Switch, Oe as SwitchCard, oe as Table, se as TableContainer, ce as TableEmptyRow, le as TableGroupTitle, D as Tabs, O as TabsChip, k as TabsContent, A as TabsList, j as TabsTrigger, G as Tag, ue as Tbody, de as Td, T as Text, E as Textarea, fe as Th, pe as Thead, b as Tooltip, me as Tr, dt as createListCollection, ft as createToaster, Je as formatOverall, ht as formatPhoneNumber, gt as formatPhoneNumberIntl, Ye as formatResponseDelay, _t as getCountries, vt as getCountryCallingCode, Xe as getHeadlineColor, yt as isPossiblePhoneNumber, bt as isSupportedCountry, xt as isValidPhoneNumber, pt as parseColor, mt as parseDate, St as parsePhoneNumber, ut as preset, a as useAccordion };
49
+ import { OriginSelect as ze } from "./components/origin-select/OriginSelect.js";
50
+ import { ChatMessage as Be } from "./components/chat/ChatMessage.js";
51
+ import { ChatDocumentMessage as Ve } from "./components/chat/ChatDocumentMessage.js";
52
+ import { ChatProfileAvatar as He } from "./components/chat/ChatProfileAvatar.js";
53
+ import { Chat_exports as Ue } from "./components/chat/Chat.js";
54
+ import { ChatScoreBreakdown as We } from "./components/chat/ChatScoreBreakdown.js";
55
+ import { ChatTextInput as Ge } from "./components/chat/ChatTextInput.js";
56
+ import { DEFAULT_SUPPLIER_RATING_LABELS as Ke, SUPPLIER_RATING_MAX as qe, SupplierRatingBreakdown as Je, formatOverall as Ye, formatResponseDelay as Xe, getHeadlineColor as Ze } from "./components/supplier-rating-badge/SupplierRatingBreakdown.js";
57
+ import { SupplierRatingBadge as Qe } from "./components/supplier-rating-badge/SupplierRatingBadge.js";
58
+ import { PriceTag as $e } from "./components/app/price-tag/PriceTag.js";
59
+ import { styled_exports as et } from "./components/app/product-card-catalog/styled.js";
60
+ import { AppNavigation_exports as tt } from "./components/app/navigation/AppNavigation.js";
61
+ import { AppNavigationLanguageSelect as nt } from "./components/app/navigation/language-select/AppNavigationLanguageSelect.js";
62
+ import { MobileNavigation_exports as rt } from "./components/app/mobile-navigation/MobileNavigation.js";
63
+ import { MobileCardShell as it } from "./components/app/mobile-card/MobileCardShell.js";
64
+ import { MobileCardHeader as at } from "./components/app/mobile-card/MobileCardHeader.js";
65
+ import { MobileCardNotificationBadge as ot } from "./components/app/mobile-card/MobileCardNotificationBadge.js";
66
+ import { MobileCardEntityRow as st } from "./components/app/mobile-card/MobileCardEntityRow.js";
67
+ import { MobileCardSkeleton as ct, MobileCardSkeletonList as lt, SkeletonBlock as ut } from "./components/app/mobile-card/MobileCardSkeleton.js";
68
+ import { preset as dt } from "./preset.js";
69
+ import { createListCollection as ft, createToaster as pt, parseColor as mt, parseDate as ht } from "@ark-ui/react";
70
+ import { formatPhoneNumber as gt, formatPhoneNumberIntl as _t, getCountries as vt, getCountryCallingCode as yt, isPossiblePhoneNumber as bt, isSupportedCountry as xt, isValidPhoneNumber as St, parsePhoneNumber as Ct } from "react-phone-number-input";
71
+ export { e as Accordion, t as AccordionItem, n as AccordionItemContent, r as AccordionItemIndicator, i as AccordionItemTrigger, ne as ActionCard, re as ActionCardDescription, ie as ActionCardTitle, ae as Alert, tt as AppNavigation, nt as AppNavigationLanguageSelect, Fe as Avatar, U as Box, he as Breadcrumb, ge as BreadcrumbItem, _e as BreadcrumbLink, o as Button, Ee as ButtonFilter, Ue as Chat, Ve as ChatDocumentMessage, Be as ChatMessage, He as ChatProfileAvatar, We as ChatScoreBreakdown, Ge as ChatTextInput, s as Checkbox, Ae as CheckboxCard, c as CheckboxGroup, Q as Chip, $ as ChipAvatar, ee as ChipClearTrigger, te as ChipLabel, Ne as Collapsible, je as Combobox, Ke as DEFAULT_SUPPLIER_RATING_LABELS, W as DatePicker, Pe as Dialog, u as Drawer, d as DrawerBody, f as DrawerCloseTrigger, p as DrawerContent, m as DrawerContext, h as DrawerFooter, g as DrawerHeader, _ as DrawerTitle, v as DrawerTrigger, Le as Flag, Re as FlagCountryCodes, y as FormControl, S as FormHelperText, x as FormLabel, C as Heading, F as Highlight, I as HighlightedInput, Me as Icon, l as IconButton, Te as Illustration, P as Input, B as InputAddon, V as InputGroup, L as InputSlot, Ie as Menu, st as MobileCardEntityRow, at as MobileCardHeader, ot as MobileCardNotificationBadge, it as MobileCardShell, ct as MobileCardSkeleton, lt as MobileCardSkeletonList, rt as MobileNavigation, ze as OriginSelect, we as Pagination, H as PhoneNumberInput, ve as Popover, ye as PopoverAnchor, be as PopoverCloseTrigger, xe as PopoverContent, Se as PopoverContext, Ce as PopoverTrigger, $e as PriceTag, et as ProductCardCatalog, K as RadioButtonGroup, q as RadioButtonGroupItem, J as RadioButtonGroupLabel, ke as RadioCardGroup, Y as RadioGroup, X as RadioGroupItem, Z as RadioGroupLabel, R as Renderer, z as Root, qe as SUPPLIER_RATING_MAX, M as Select, N as SelectLanguage, ut as SkeletonBlock, De as StatusTagSelect, Qe as SupplierRatingBadge, Je as SupplierRatingBreakdown, w as Switch, Oe as SwitchCard, oe as Table, se as TableContainer, ce as TableEmptyRow, le as TableGroupTitle, D as Tabs, O as TabsChip, k as TabsContent, A as TabsList, j as TabsTrigger, G as Tag, ue as Tbody, de as Td, T as Text, E as Textarea, fe as Th, pe as Thead, b as Tooltip, me as Tr, ft as createListCollection, pt as createToaster, Ye as formatOverall, gt as formatPhoneNumber, _t as formatPhoneNumberIntl, Xe as formatResponseDelay, vt as getCountries, yt as getCountryCallingCode, Ze as getHeadlineColor, bt as isPossiblePhoneNumber, xt as isSupportedCountry, St as isValidPhoneNumber, mt as parseColor, ht as parseDate, Ct as parsePhoneNumber, dt as preset, a as useAccordion };