@stokelp/ui 2.127.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/_virtual/_rolldown/runtime.cjs +1 -1
- package/dist/_virtual/_rolldown/runtime.js +4 -5
- package/dist/components/accordion/Accordion.cjs +1 -1
- package/dist/components/accordion/Accordion.cjs.map +1 -1
- package/dist/components/accordion/Accordion.d.ts +1 -1
- package/dist/components/accordion/Accordion.js +1 -2
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/action-card/ActionCard.cjs.map +1 -1
- package/dist/components/action-card/ActionCard.d.ts +1 -1
- package/dist/components/action-card/ActionCard.js +1 -2
- package/dist/components/action-card/ActionCard.js.map +1 -1
- package/dist/components/alert/Alert.cjs.map +1 -1
- package/dist/components/alert/Alert.d.ts +1 -1
- package/dist/components/alert/Alert.js +1 -2
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.d.ts +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.js +1 -2
- package/dist/components/app/mobile-card/MobileCardEntityRow.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.d.ts +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.js +1 -2
- package/dist/components/app/mobile-card/MobileCardHeader.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.d.ts +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.js +2 -3
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.d.ts +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.js +1 -2
- package/dist/components/app/mobile-card/MobileCardShell.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardSkeleton.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardSkeleton.d.ts +3 -3
- package/dist/components/app/mobile-card/MobileCardSkeleton.js +1 -2
- package/dist/components/app/mobile-card/MobileCardSkeleton.js.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.d.ts +2 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.js +2 -3
- package/dist/components/app/mobile-navigation/MobileNavigation.js.map +1 -1
- package/dist/components/app/navigation/AppNavigation.cjs +1 -1
- package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
- package/dist/components/app/navigation/AppNavigation.d.ts +2 -2
- package/dist/components/app/navigation/AppNavigation.js +3 -4
- package/dist/components/app/navigation/AppNavigation.js.map +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs.map +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js +5 -6
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js.map +1 -1
- package/dist/components/app/price-tag/PriceTag.cjs.map +1 -1
- package/dist/components/app/price-tag/PriceTag.d.ts +3 -5
- package/dist/components/app/price-tag/PriceTag.js +1 -2
- package/dist/components/app/price-tag/PriceTag.js.map +1 -1
- package/dist/components/app/product-card-catalog/styled.cjs +1 -1
- package/dist/components/app/product-card-catalog/styled.cjs.map +1 -1
- package/dist/components/app/product-card-catalog/styled.d.ts +1 -1
- package/dist/components/app/product-card-catalog/styled.js +2 -3
- package/dist/components/app/product-card-catalog/styled.js.map +1 -1
- package/dist/components/avatar/styled.cjs +1 -1
- package/dist/components/avatar/styled.cjs.map +1 -1
- package/dist/components/avatar/styled.d.ts +6 -10
- package/dist/components/avatar/styled.js +2 -3
- package/dist/components/avatar/styled.js.map +1 -1
- package/dist/components/box/Box.cjs +1 -1
- package/dist/components/box/Box.cjs.map +1 -1
- package/dist/components/box/Box.d.ts +1 -1
- package/dist/components/box/Box.js +3 -4
- package/dist/components/box/Box.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +1 -2
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/button/Button.cjs.map +1 -1
- package/dist/components/button/Button.js +1 -2
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button-filter/ButtonFilter.cjs.map +1 -1
- package/dist/components/button-filter/ButtonFilter.d.ts +5 -6
- package/dist/components/button-filter/ButtonFilter.js +1 -2
- package/dist/components/button-filter/ButtonFilter.js.map +1 -1
- package/dist/components/chat/Chat.cjs +1 -1
- package/dist/components/chat/Chat.cjs.map +1 -1
- package/dist/components/chat/Chat.d.ts +6 -10
- package/dist/components/chat/Chat.js +2 -3
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/ChatDocumentMessage.cjs +1 -1
- package/dist/components/chat/ChatDocumentMessage.cjs.map +1 -1
- package/dist/components/chat/ChatDocumentMessage.js +3 -4
- package/dist/components/chat/ChatDocumentMessage.js.map +1 -1
- package/dist/components/chat/ChatMessage.cjs.map +1 -1
- package/dist/components/chat/ChatMessage.d.ts +5 -8
- package/dist/components/chat/ChatMessage.js +1 -2
- package/dist/components/chat/ChatMessage.js.map +1 -1
- package/dist/components/chat/ChatProfileAvatar.cjs.map +1 -1
- package/dist/components/chat/ChatProfileAvatar.js +1 -2
- package/dist/components/chat/ChatProfileAvatar.js.map +1 -1
- package/dist/components/chat/ChatScoreBreakdown.cjs.map +1 -1
- package/dist/components/chat/ChatScoreBreakdown.d.ts +1 -1
- package/dist/components/chat/ChatScoreBreakdown.js +1 -2
- package/dist/components/chat/ChatScoreBreakdown.js.map +1 -1
- package/dist/components/chat/ChatTextInput.cjs.map +1 -1
- package/dist/components/chat/ChatTextInput.js +1 -2
- package/dist/components/chat/ChatTextInput.js.map +1 -1
- package/dist/components/checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -2
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.cjs.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.js +1 -2
- package/dist/components/checkbox-card/CheckboxCard.js.map +1 -1
- package/dist/components/checkbox-card/namespace.cjs +1 -1
- package/dist/components/checkbox-card/namespace.cjs.map +1 -1
- package/dist/components/checkbox-card/namespace.js +2 -3
- package/dist/components/checkbox-card/namespace.js.map +1 -1
- package/dist/components/chip/Chip.cjs.map +1 -1
- package/dist/components/chip/Chip.d.ts +2 -2
- package/dist/components/chip/Chip.js +1 -2
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/collapsible/styled.cjs +1 -1
- package/dist/components/collapsible/styled.cjs.map +1 -1
- package/dist/components/collapsible/styled.d.ts +1 -1
- package/dist/components/collapsible/styled.js +2 -3
- package/dist/components/collapsible/styled.js.map +1 -1
- package/dist/components/combobox/Combobox.cjs +1 -1
- package/dist/components/combobox/Combobox.cjs.map +1 -1
- package/dist/components/combobox/Combobox.d.ts +4 -3
- package/dist/components/combobox/Combobox.js +66 -64
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/date-picker/DatePicker.cjs.map +1 -1
- package/dist/components/date-picker/DatePicker.js +1 -2
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/dialog/styled.cjs +1 -1
- package/dist/components/dialog/styled.cjs.map +1 -1
- package/dist/components/dialog/styled.d.ts +2 -2
- package/dist/components/dialog/styled.js +2 -3
- package/dist/components/dialog/styled.js.map +1 -1
- package/dist/components/drawer/Drawer.cjs.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +2 -2
- package/dist/components/drawer/Drawer.js +1 -2
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/flag/styled.cjs.map +1 -1
- package/dist/components/flag/styled.d.ts +211 -213
- package/dist/components/flag/styled.js +1 -2
- package/dist/components/flag/styled.js.map +1 -1
- package/dist/components/form/FormControl.cjs +1 -1
- package/dist/components/form/FormControl.cjs.map +1 -1
- package/dist/components/form/FormControl.js +11 -7
- package/dist/components/form/FormControl.js.map +1 -1
- package/dist/components/form/FormHelperText.cjs.map +1 -1
- package/dist/components/form/FormHelperText.js +1 -2
- package/dist/components/form/FormHelperText.js.map +1 -1
- package/dist/components/form/FormLabel.cjs.map +1 -1
- package/dist/components/form/FormLabel.js +1 -2
- package/dist/components/form/FormLabel.js.map +1 -1
- package/dist/components/heading/Heading.cjs +1 -1
- package/dist/components/heading/Heading.cjs.map +1 -1
- package/dist/components/heading/Heading.d.ts +1 -1
- package/dist/components/heading/Heading.js +3 -4
- package/dist/components/heading/Heading.js.map +1 -1
- package/dist/components/icon/Icon.cjs.map +1 -1
- package/dist/components/icon/Icon.js +1 -2
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/icon-button/IconButton.cjs.map +1 -1
- package/dist/components/icon-button/IconButton.js +1 -2
- package/dist/components/icon-button/IconButton.js.map +1 -1
- package/dist/components/illustration/Illustration.cjs.map +1 -1
- package/dist/components/illustration/Illustration.js +1 -2
- package/dist/components/illustration/Illustration.js.map +1 -1
- package/dist/components/illustration/patterns.cjs.map +1 -1
- package/dist/components/illustration/patterns.js +1 -2
- package/dist/components/illustration/patterns.js.map +1 -1
- package/dist/components/input/HighlightedInput.cjs.map +1 -1
- package/dist/components/input/HighlightedInput.d.ts +4 -4
- package/dist/components/input/HighlightedInput.js +1 -2
- package/dist/components/input/HighlightedInput.js.map +1 -1
- package/dist/components/input/Input.cjs.map +1 -1
- package/dist/components/input/Input.js +1 -2
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input/InputAddon.cjs.map +1 -1
- package/dist/components/input/InputAddon.d.ts +5 -6
- package/dist/components/input/InputAddon.js +1 -2
- package/dist/components/input/InputAddon.js.map +1 -1
- package/dist/components/input/InputGroup.cjs.map +1 -1
- package/dist/components/input/InputGroup.js +1 -2
- package/dist/components/input/InputGroup.js.map +1 -1
- package/dist/components/input/PhoneNumberInput.cjs.map +1 -1
- package/dist/components/input/PhoneNumberInput.js +1 -2
- package/dist/components/input/PhoneNumberInput.js.map +1 -1
- package/dist/components/menu/Menu.cjs +1 -1
- package/dist/components/menu/Menu.cjs.map +1 -1
- package/dist/components/menu/Menu.d.ts +2 -2
- package/dist/components/menu/Menu.js +2 -3
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/origin-select/OriginSelect.cjs.map +1 -1
- package/dist/components/origin-select/OriginSelect.d.ts +1 -1
- package/dist/components/origin-select/OriginSelect.js +1 -2
- package/dist/components/origin-select/OriginSelect.js.map +1 -1
- package/dist/components/pagination/Pagination.cjs.map +1 -1
- package/dist/components/pagination/Pagination.d.ts +2 -2
- package/dist/components/pagination/Pagination.js +1 -2
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/use-pagination.cjs.map +1 -1
- package/dist/components/pagination/use-pagination.js +1 -2
- package/dist/components/pagination/use-pagination.js.map +1 -1
- package/dist/components/popover/Popover.cjs.map +1 -1
- package/dist/components/popover/Popover.d.ts +2 -2
- package/dist/components/popover/Popover.js +1 -2
- package/dist/components/popover/Popover.js.map +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.cjs.map +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.d.ts +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.js +1 -2
- package/dist/components/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/dist/components/radio-card-group/RadioCardGroup.cjs.map +1 -1
- package/dist/components/radio-card-group/RadioCardGroup.d.ts +3 -3
- package/dist/components/radio-card-group/RadioCardGroup.js +1 -2
- package/dist/components/radio-card-group/RadioCardGroup.js.map +1 -1
- package/dist/components/radio-card-group/namespace.cjs +1 -1
- package/dist/components/radio-card-group/namespace.cjs.map +1 -1
- package/dist/components/radio-card-group/namespace.js +2 -3
- package/dist/components/radio-card-group/namespace.js.map +1 -1
- package/dist/components/radio-group/RadioGroup.cjs.map +1 -1
- package/dist/components/radio-group/RadioGroup.d.ts +1 -1
- package/dist/components/radio-group/RadioGroup.js +1 -2
- package/dist/components/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/select/Select.cjs +1 -1
- package/dist/components/select/Select.cjs.map +1 -1
- package/dist/components/select/Select.d.ts +1 -1
- package/dist/components/select/Select.js +2 -7
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select-language/SelectLanguage.cjs +1 -1
- package/dist/components/select-language/SelectLanguage.cjs.map +1 -1
- package/dist/components/select-language/SelectLanguage.js +45 -43
- package/dist/components/select-language/SelectLanguage.js.map +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.cjs +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.cjs.map +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.js +30 -31
- package/dist/components/status-tag-select/StatusTagSelect.js.map +1 -1
- package/dist/components/steps/Steps.cjs.map +1 -1
- package/dist/components/steps/Steps.d.ts +1 -1
- package/dist/components/steps/Steps.js +1 -2
- package/dist/components/steps/Steps.js.map +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.cjs.map +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.d.ts +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.js +1 -2
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.js.map +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs.map +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.d.ts +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js +53 -54
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js.map +1 -1
- package/dist/components/supplier-rating-badge/labels.cjs.map +1 -1
- package/dist/components/supplier-rating-badge/labels.js +1 -2
- package/dist/components/supplier-rating-badge/labels.js.map +1 -1
- package/dist/components/switch/Switch.cjs.map +1 -1
- package/dist/components/switch/Switch.js +1 -2
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/components/switch-card/SwitchCard.cjs.map +1 -1
- package/dist/components/switch-card/SwitchCard.d.ts +4 -3
- package/dist/components/switch-card/SwitchCard.js +1 -2
- package/dist/components/switch-card/SwitchCard.js.map +1 -1
- package/dist/components/switch-card/namespace.cjs +1 -1
- package/dist/components/switch-card/namespace.cjs.map +1 -1
- package/dist/components/switch-card/namespace.js +2 -3
- package/dist/components/switch-card/namespace.js.map +1 -1
- package/dist/components/table/Table.cjs +1 -1
- package/dist/components/table/Table.cjs.map +1 -1
- package/dist/components/table/Table.js +3 -4
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/TableProvider.cjs.map +1 -1
- package/dist/components/table/TableProvider.js +1 -2
- package/dist/components/table/TableProvider.js.map +1 -1
- package/dist/components/tabs/Tabs.cjs.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +5 -9
- package/dist/components/tabs/Tabs.js +1 -2
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tag/Tag.cjs.map +1 -1
- package/dist/components/tag/Tag.js +1 -2
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/text/Text.cjs +1 -1
- package/dist/components/text/Text.cjs.map +1 -1
- package/dist/components/text/Text.d.ts +1 -1
- package/dist/components/text/Text.js +3 -4
- package/dist/components/text/Text.js.map +1 -1
- package/dist/components/textarea/Textarea.cjs.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +5 -6
- package/dist/components/textarea/Textarea.js +1 -2
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +2 -2
- package/dist/components/tooltip/Tooltip.js +1 -2
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/ui-labels/UiLabelsProvider.cjs.map +1 -1
- package/dist/components/ui-labels/UiLabelsProvider.js +1 -2
- package/dist/components/ui-labels/UiLabelsProvider.js.map +1 -1
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +1 -2
- package/dist/icons/index.js.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +1 -0
- package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ArrowDownTrayIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +1 -0
- package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ArrowLeftCircleIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +1 -0
- package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ChatBubbleLeftRightIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs.map +1 -0
- package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons → @heroicons}/react/24/outline/esm/CheckCircleIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +1 -0
- package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons → @heroicons}/react/24/outline/esm/DocumentTextIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs.map +1 -0
- package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons → @heroicons}/react/24/outline/esm/XCircleIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js.map +1 -0
- package/dist/node_modules/deepmerge/dist/cjs.cjs +2 -0
- package/dist/node_modules/deepmerge/dist/cjs.cjs.map +1 -0
- package/dist/node_modules/{.pnpm/deepmerge@4.3.1/node_modules/deepmerge → deepmerge}/dist/cjs.js +3 -4
- package/dist/node_modules/deepmerge/dist/cjs.js.map +1 -0
- package/dist/preset.cjs +1 -1
- package/dist/preset.cjs.map +1 -1
- package/dist/preset.js +7 -6
- package/dist/preset.js.map +1 -1
- package/dist/shared/ConditionalWrapper.cjs.map +1 -1
- package/dist/shared/ConditionalWrapper.js +1 -2
- package/dist/shared/ConditionalWrapper.js.map +1 -1
- package/dist/shared/assets/icons.cjs.map +1 -1
- package/dist/shared/assets/icons.d.ts +2 -2
- package/dist/shared/assets/icons.js +1 -2
- package/dist/shared/assets/icons.js.map +1 -1
- package/dist/shared/hooks/useUncontrolled.cjs.map +1 -1
- package/dist/shared/hooks/useUncontrolled.js +1 -2
- package/dist/shared/hooks/useUncontrolled.js.map +1 -1
- package/dist/shared/utils/events.cjs.map +1 -1
- package/dist/shared/utils/events.js +1 -2
- package/dist/shared/utils/events.js.map +1 -1
- package/dist/theme/breakpoints.cjs.map +1 -1
- package/dist/theme/breakpoints.js +1 -2
- package/dist/theme/breakpoints.js.map +1 -1
- package/dist/theme/conditions.cjs.map +1 -1
- package/dist/theme/conditions.js +1 -2
- package/dist/theme/conditions.js.map +1 -1
- package/dist/theme/containers.cjs +1 -1
- package/dist/theme/containers.cjs.map +1 -1
- package/dist/theme/containers.d.ts +1 -1
- package/dist/theme/containers.js +2 -3
- package/dist/theme/containers.js.map +1 -1
- package/dist/theme/globalCss.cjs.map +1 -1
- package/dist/theme/globalCss.d.ts +1 -1
- package/dist/theme/globalCss.js +1 -2
- package/dist/theme/globalCss.js.map +1 -1
- package/dist/theme/keyframes.cjs.map +1 -1
- package/dist/theme/keyframes.d.ts +1 -1
- package/dist/theme/keyframes.js +1 -2
- package/dist/theme/keyframes.js.map +1 -1
- package/dist/theme/recipes/accordion.cjs.map +1 -1
- package/dist/theme/recipes/accordion.d.ts +32 -2
- package/dist/theme/recipes/accordion.js +1 -2
- package/dist/theme/recipes/accordion.js.map +1 -1
- package/dist/theme/recipes/action-card.cjs.map +1 -1
- package/dist/theme/recipes/action-card.d.ts +2 -2
- package/dist/theme/recipes/action-card.js +1 -2
- package/dist/theme/recipes/action-card.js.map +1 -1
- package/dist/theme/recipes/alert.cjs.map +1 -1
- package/dist/theme/recipes/alert.d.ts +30 -2
- package/dist/theme/recipes/alert.js +1 -2
- package/dist/theme/recipes/alert.js.map +1 -1
- package/dist/theme/recipes/app/mobile-navigation.cjs.map +1 -1
- package/dist/theme/recipes/app/mobile-navigation.d.ts +51 -2
- package/dist/theme/recipes/app/mobile-navigation.js +1 -2
- package/dist/theme/recipes/app/mobile-navigation.js.map +1 -1
- package/dist/theme/recipes/app/navigation-language-select.cjs +1 -1
- package/dist/theme/recipes/app/navigation-language-select.cjs.map +1 -1
- package/dist/theme/recipes/app/navigation-language-select.d.ts +105 -2
- package/dist/theme/recipes/app/navigation-language-select.js +31 -39
- package/dist/theme/recipes/app/navigation-language-select.js.map +1 -1
- package/dist/theme/recipes/app/navigation.cjs.map +1 -1
- package/dist/theme/recipes/app/navigation.d.ts +125 -2
- package/dist/theme/recipes/app/navigation.js +1 -2
- package/dist/theme/recipes/app/navigation.js.map +1 -1
- package/dist/theme/recipes/app/price-tag.cjs.map +1 -1
- package/dist/theme/recipes/app/price-tag.d.ts +41 -2
- package/dist/theme/recipes/app/price-tag.js +1 -2
- package/dist/theme/recipes/app/price-tag.js.map +1 -1
- package/dist/theme/recipes/app/product-card-catalog.cjs.map +1 -1
- package/dist/theme/recipes/app/product-card-catalog.d.ts +2 -2
- package/dist/theme/recipes/app/product-card-catalog.js +1 -2
- package/dist/theme/recipes/app/product-card-catalog.js.map +1 -1
- package/dist/theme/recipes/avatar-group.cjs.map +1 -1
- package/dist/theme/recipes/avatar-group.d.ts +14 -2
- package/dist/theme/recipes/avatar-group.js +1 -2
- package/dist/theme/recipes/avatar-group.js.map +1 -1
- package/dist/theme/recipes/avatar.cjs.map +1 -1
- package/dist/theme/recipes/avatar.d.ts +53 -2
- package/dist/theme/recipes/avatar.js +1 -2
- package/dist/theme/recipes/avatar.js.map +1 -1
- package/dist/theme/recipes/breadcrumb.cjs.map +1 -1
- package/dist/theme/recipes/breadcrumb.d.ts +2 -2
- package/dist/theme/recipes/breadcrumb.js +1 -2
- package/dist/theme/recipes/breadcrumb.js.map +1 -1
- package/dist/theme/recipes/button-filter.cjs.map +1 -1
- package/dist/theme/recipes/button-filter.d.ts +1 -1
- package/dist/theme/recipes/button-filter.js +1 -2
- package/dist/theme/recipes/button-filter.js.map +1 -1
- package/dist/theme/recipes/button.cjs.map +1 -1
- package/dist/theme/recipes/button.d.ts +93 -2
- package/dist/theme/recipes/button.js +1 -2
- package/dist/theme/recipes/button.js.map +1 -1
- package/dist/theme/recipes/chat/chat-document-message.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-document-message.d.ts +1 -1
- package/dist/theme/recipes/chat/chat-document-message.js +1 -2
- package/dist/theme/recipes/chat/chat-document-message.js.map +1 -1
- package/dist/theme/recipes/chat/chat-input-text.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-input-text.d.ts +1 -1
- package/dist/theme/recipes/chat/chat-input-text.js +1 -2
- package/dist/theme/recipes/chat/chat-input-text.js.map +1 -1
- package/dist/theme/recipes/chat/chat-message.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-message.d.ts +28 -2
- package/dist/theme/recipes/chat/chat-message.js +1 -2
- package/dist/theme/recipes/chat/chat-message.js.map +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.d.ts +9 -2
- package/dist/theme/recipes/chat/chat-profile-avatar.js +1 -2
- package/dist/theme/recipes/chat/chat-profile-avatar.js.map +1 -1
- package/dist/theme/recipes/chat/chat.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat.d.ts +2 -2
- package/dist/theme/recipes/chat/chat.js +1 -2
- package/dist/theme/recipes/chat/chat.js.map +1 -1
- package/dist/theme/recipes/checkbox-card.cjs.map +1 -1
- package/dist/theme/recipes/checkbox-card.d.ts +1 -1
- package/dist/theme/recipes/checkbox-card.js +1 -2
- package/dist/theme/recipes/checkbox-card.js.map +1 -1
- package/dist/theme/recipes/checkbox-group.cjs.map +1 -1
- package/dist/theme/recipes/checkbox-group.d.ts +1 -1
- package/dist/theme/recipes/checkbox-group.js +1 -2
- package/dist/theme/recipes/checkbox-group.js.map +1 -1
- package/dist/theme/recipes/checkbox.cjs +1 -1
- package/dist/theme/recipes/checkbox.cjs.map +1 -1
- package/dist/theme/recipes/checkbox.d.ts +26 -2
- package/dist/theme/recipes/checkbox.js +7 -8
- package/dist/theme/recipes/checkbox.js.map +1 -1
- package/dist/theme/recipes/chip.cjs.map +1 -1
- package/dist/theme/recipes/chip.d.ts +148 -2
- package/dist/theme/recipes/chip.js +1 -2
- package/dist/theme/recipes/chip.js.map +1 -1
- package/dist/theme/recipes/collapsible.cjs.map +1 -1
- package/dist/theme/recipes/collapsible.d.ts +2 -2
- package/dist/theme/recipes/collapsible.js +1 -2
- package/dist/theme/recipes/collapsible.js.map +1 -1
- package/dist/theme/recipes/combobox.cjs +1 -1
- package/dist/theme/recipes/combobox.cjs.map +1 -1
- package/dist/theme/recipes/combobox.d.ts +33 -2
- package/dist/theme/recipes/combobox.js +6 -6
- package/dist/theme/recipes/combobox.js.map +1 -1
- package/dist/theme/recipes/common/group-card.cjs.map +1 -1
- package/dist/theme/recipes/common/group-card.d.ts +1 -1
- package/dist/theme/recipes/common/group-card.js +1 -2
- package/dist/theme/recipes/common/group-card.js.map +1 -1
- package/dist/theme/recipes/datepicker.cjs +1 -1
- package/dist/theme/recipes/datepicker.cjs.map +1 -1
- package/dist/theme/recipes/datepicker.d.ts +2 -2
- package/dist/theme/recipes/datepicker.js +6 -7
- package/dist/theme/recipes/datepicker.js.map +1 -1
- package/dist/theme/recipes/dialog.cjs.map +1 -1
- package/dist/theme/recipes/dialog.d.ts +2 -2
- package/dist/theme/recipes/dialog.js +1 -2
- package/dist/theme/recipes/dialog.js.map +1 -1
- package/dist/theme/recipes/drawer.cjs.map +1 -1
- package/dist/theme/recipes/drawer.d.ts +31 -2
- package/dist/theme/recipes/drawer.js +4 -4
- package/dist/theme/recipes/drawer.js.map +1 -1
- package/dist/theme/recipes/flag.cjs.map +1 -1
- package/dist/theme/recipes/flag.d.ts +15 -2
- package/dist/theme/recipes/flag.js +1 -2
- package/dist/theme/recipes/flag.js.map +1 -1
- package/dist/theme/recipes/form/control.cjs.map +1 -1
- package/dist/theme/recipes/form/control.d.ts +1 -1
- package/dist/theme/recipes/form/control.js +1 -2
- package/dist/theme/recipes/form/control.js.map +1 -1
- package/dist/theme/recipes/form/helper-text.cjs.map +1 -1
- package/dist/theme/recipes/form/helper-text.d.ts +1 -1
- package/dist/theme/recipes/form/helper-text.js +1 -2
- package/dist/theme/recipes/form/helper-text.js.map +1 -1
- package/dist/theme/recipes/form/label.cjs.map +1 -1
- package/dist/theme/recipes/form/label.d.ts +15 -2
- package/dist/theme/recipes/form/label.js +1 -2
- package/dist/theme/recipes/form/label.js.map +1 -1
- package/dist/theme/recipes/heading.cjs.map +1 -1
- package/dist/theme/recipes/heading.d.ts +33 -2
- package/dist/theme/recipes/heading.js +1 -2
- package/dist/theme/recipes/heading.js.map +1 -1
- package/dist/theme/recipes/highlightedInput.cjs.map +1 -1
- package/dist/theme/recipes/highlightedInput.d.ts +2 -2
- package/dist/theme/recipes/highlightedInput.js +1 -2
- package/dist/theme/recipes/highlightedInput.js.map +1 -1
- package/dist/theme/recipes/icon-button.cjs +1 -1
- package/dist/theme/recipes/icon-button.cjs.map +1 -1
- package/dist/theme/recipes/icon-button.d.ts +1 -1
- package/dist/theme/recipes/icon-button.js +1 -2
- package/dist/theme/recipes/icon-button.js.map +1 -1
- package/dist/theme/recipes/icon.cjs.map +1 -1
- package/dist/theme/recipes/icon.d.ts +25 -2
- package/dist/theme/recipes/icon.js +1 -2
- package/dist/theme/recipes/icon.js.map +1 -1
- package/dist/theme/recipes/illustration.cjs.map +1 -1
- package/dist/theme/recipes/illustration.d.ts +29 -2
- package/dist/theme/recipes/illustration.js +1 -2
- package/dist/theme/recipes/illustration.js.map +1 -1
- package/dist/theme/recipes/index.cjs +1 -1
- package/dist/theme/recipes/index.cjs.map +1 -1
- package/dist/theme/recipes/index.d.ts +1464 -49
- package/dist/theme/recipes/index.js +3 -4
- package/dist/theme/recipes/index.js.map +1 -1
- package/dist/theme/recipes/input-addon.cjs.map +1 -1
- package/dist/theme/recipes/input-addon.d.ts +1 -1
- package/dist/theme/recipes/input-addon.js +1 -2
- package/dist/theme/recipes/input-addon.js.map +1 -1
- package/dist/theme/recipes/input-group.cjs.map +1 -1
- package/dist/theme/recipes/input-group.d.ts +1 -1
- package/dist/theme/recipes/input-group.js +1 -2
- package/dist/theme/recipes/input-group.js.map +1 -1
- package/dist/theme/recipes/input.cjs +1 -1
- package/dist/theme/recipes/input.cjs.map +1 -1
- package/dist/theme/recipes/input.d.ts +9 -2
- package/dist/theme/recipes/input.js +5 -6
- package/dist/theme/recipes/input.js.map +1 -1
- package/dist/theme/recipes/menu.cjs.map +1 -1
- package/dist/theme/recipes/menu.d.ts +20 -2
- package/dist/theme/recipes/menu.js +1 -2
- package/dist/theme/recipes/menu.js.map +1 -1
- package/dist/theme/recipes/pagination.cjs +1 -1
- package/dist/theme/recipes/pagination.cjs.map +1 -1
- package/dist/theme/recipes/pagination.d.ts +2 -2
- package/dist/theme/recipes/pagination.js +3 -4
- package/dist/theme/recipes/pagination.js.map +1 -1
- package/dist/theme/recipes/phone-number-input.cjs.map +1 -1
- package/dist/theme/recipes/phone-number-input.d.ts +9 -2
- package/dist/theme/recipes/phone-number-input.js +1 -2
- package/dist/theme/recipes/phone-number-input.js.map +1 -1
- package/dist/theme/recipes/popover.cjs.map +1 -1
- package/dist/theme/recipes/popover.d.ts +2 -2
- package/dist/theme/recipes/popover.js +1 -2
- package/dist/theme/recipes/popover.js.map +1 -1
- package/dist/theme/recipes/radio-button-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-button-group.d.ts +25 -2
- package/dist/theme/recipes/radio-button-group.js +1 -2
- package/dist/theme/recipes/radio-button-group.js.map +1 -1
- package/dist/theme/recipes/radio-card-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-card-group.d.ts +36 -2
- package/dist/theme/recipes/radio-card-group.js +1 -2
- package/dist/theme/recipes/radio-card-group.js.map +1 -1
- package/dist/theme/recipes/radio-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-group.d.ts +27 -2
- package/dist/theme/recipes/radio-group.js +1 -2
- package/dist/theme/recipes/radio-group.js.map +1 -1
- package/dist/theme/recipes/select-language.cjs.map +1 -1
- package/dist/theme/recipes/select-language.d.ts +15 -2
- package/dist/theme/recipes/select-language.js +1 -2
- package/dist/theme/recipes/select-language.js.map +1 -1
- package/dist/theme/recipes/select.cjs +1 -1
- package/dist/theme/recipes/select.cjs.map +1 -1
- package/dist/theme/recipes/select.d.ts +30 -2
- package/dist/theme/recipes/select.js +3 -18
- package/dist/theme/recipes/select.js.map +1 -1
- package/dist/theme/recipes/status-tag-select.cjs.map +1 -1
- package/dist/theme/recipes/status-tag-select.d.ts +125 -2
- package/dist/theme/recipes/status-tag-select.js +1 -2
- package/dist/theme/recipes/status-tag-select.js.map +1 -1
- package/dist/theme/recipes/steps.cjs.map +1 -1
- package/dist/theme/recipes/steps.d.ts +2 -2
- package/dist/theme/recipes/steps.js +1 -2
- package/dist/theme/recipes/steps.js.map +1 -1
- package/dist/theme/recipes/switch-card.cjs.map +1 -1
- package/dist/theme/recipes/switch-card.d.ts +1 -1
- package/dist/theme/recipes/switch-card.js +1 -2
- package/dist/theme/recipes/switch-card.js.map +1 -1
- package/dist/theme/recipes/switch.cjs.map +1 -1
- package/dist/theme/recipes/switch.d.ts +22 -2
- package/dist/theme/recipes/switch.js +1 -2
- package/dist/theme/recipes/switch.js.map +1 -1
- package/dist/theme/recipes/table-container.cjs.map +1 -1
- package/dist/theme/recipes/table-container.d.ts +1 -1
- package/dist/theme/recipes/table-container.js +1 -2
- package/dist/theme/recipes/table-container.js.map +1 -1
- package/dist/theme/recipes/table-empty-row.cjs.map +1 -1
- package/dist/theme/recipes/table-empty-row.d.ts +1 -1
- package/dist/theme/recipes/table-empty-row.js +1 -2
- package/dist/theme/recipes/table-empty-row.js.map +1 -1
- package/dist/theme/recipes/table-group-title.cjs.map +1 -1
- package/dist/theme/recipes/table-group-title.d.ts +15 -2
- package/dist/theme/recipes/table-group-title.js +1 -2
- package/dist/theme/recipes/table-group-title.js.map +1 -1
- package/dist/theme/recipes/table.cjs.map +1 -1
- package/dist/theme/recipes/table.d.ts +2 -2
- package/dist/theme/recipes/table.js +1 -2
- package/dist/theme/recipes/table.js.map +1 -1
- package/dist/theme/recipes/tabs-chip.cjs.map +1 -1
- package/dist/theme/recipes/tabs-chip.d.ts +29 -2
- package/dist/theme/recipes/tabs-chip.js +1 -2
- package/dist/theme/recipes/tabs-chip.js.map +1 -1
- package/dist/theme/recipes/tabs.cjs.map +1 -1
- package/dist/theme/recipes/tabs.d.ts +49 -2
- package/dist/theme/recipes/tabs.js +1 -2
- package/dist/theme/recipes/tabs.js.map +1 -1
- package/dist/theme/recipes/tag.cjs.map +1 -1
- package/dist/theme/recipes/tag.d.ts +109 -2
- package/dist/theme/recipes/tag.js +1 -2
- package/dist/theme/recipes/tag.js.map +1 -1
- package/dist/theme/recipes/text.cjs.map +1 -1
- package/dist/theme/recipes/text.d.ts +29 -2
- package/dist/theme/recipes/text.js +1 -2
- package/dist/theme/recipes/text.js.map +1 -1
- package/dist/theme/recipes/textarea.cjs.map +1 -1
- package/dist/theme/recipes/textarea.d.ts +1 -1
- package/dist/theme/recipes/textarea.js +1 -2
- package/dist/theme/recipes/textarea.js.map +1 -1
- package/dist/theme/recipes/tooltip.cjs.map +1 -1
- package/dist/theme/recipes/tooltip.d.ts +2 -2
- package/dist/theme/recipes/tooltip.js +1 -2
- package/dist/theme/recipes/tooltip.js.map +1 -1
- package/dist/theme/semantic-tokens/colors.cjs.map +1 -1
- package/dist/theme/semantic-tokens/colors.js +1 -2
- package/dist/theme/semantic-tokens/colors.js.map +1 -1
- package/dist/theme/semantic-tokens/gradients.cjs.map +1 -1
- package/dist/theme/semantic-tokens/gradients.js +1 -2
- package/dist/theme/semantic-tokens/gradients.js.map +1 -1
- package/dist/theme/semantic-tokens/index.cjs.map +1 -1
- package/dist/theme/semantic-tokens/index.js +1 -2
- package/dist/theme/semantic-tokens/index.js.map +1 -1
- package/dist/theme/text-styles.cjs.map +1 -1
- package/dist/theme/text-styles.d.ts +1 -1
- package/dist/theme/text-styles.js +1 -2
- package/dist/theme/text-styles.js.map +1 -1
- package/dist/theme/tokens/animations.cjs.map +1 -1
- package/dist/theme/tokens/animations.js +1 -2
- package/dist/theme/tokens/animations.js.map +1 -1
- package/dist/theme/tokens/aspect-ratios.cjs.map +1 -1
- package/dist/theme/tokens/aspect-ratios.js +1 -2
- package/dist/theme/tokens/aspect-ratios.js.map +1 -1
- package/dist/theme/tokens/blurs.cjs.map +1 -1
- package/dist/theme/tokens/blurs.js +1 -2
- package/dist/theme/tokens/blurs.js.map +1 -1
- package/dist/theme/tokens/borders.cjs.map +1 -1
- package/dist/theme/tokens/borders.js +1 -2
- package/dist/theme/tokens/borders.js.map +1 -1
- package/dist/theme/tokens/colors.cjs.map +1 -1
- package/dist/theme/tokens/colors.js +1 -2
- package/dist/theme/tokens/colors.js.map +1 -1
- package/dist/theme/tokens/durations.cjs.map +1 -1
- package/dist/theme/tokens/durations.js +1 -2
- package/dist/theme/tokens/durations.js.map +1 -1
- package/dist/theme/tokens/easings.cjs.map +1 -1
- package/dist/theme/tokens/easings.js +1 -2
- package/dist/theme/tokens/easings.js.map +1 -1
- package/dist/theme/tokens/index.cjs.map +1 -1
- package/dist/theme/tokens/index.js +1 -2
- package/dist/theme/tokens/index.js.map +1 -1
- package/dist/theme/tokens/radii.cjs.map +1 -1
- package/dist/theme/tokens/radii.js +1 -2
- package/dist/theme/tokens/radii.js.map +1 -1
- package/dist/theme/tokens/shadows.cjs.map +1 -1
- package/dist/theme/tokens/shadows.js +1 -2
- package/dist/theme/tokens/shadows.js.map +1 -1
- package/dist/theme/tokens/sizes.cjs.map +1 -1
- package/dist/theme/tokens/sizes.js +1 -2
- package/dist/theme/tokens/sizes.js.map +1 -1
- package/dist/theme/tokens/spacing.cjs.map +1 -1
- package/dist/theme/tokens/spacing.js +1 -2
- package/dist/theme/tokens/spacing.js.map +1 -1
- package/dist/theme/tokens/typography.cjs.map +1 -1
- package/dist/theme/tokens/typography.js +1 -2
- package/dist/theme/tokens/typography.js.map +1 -1
- package/dist/theme/tokens/z-index.cjs.map +1 -1
- package/dist/theme/tokens/z-index.js +1 -2
- package/dist/theme/tokens/z-index.js.map +1 -1
- package/dist/theme/utilities.cjs.map +1 -1
- package/dist/theme/utilities.js +0 -1
- package/dist/theme/utilities.js.map +1 -1
- package/dist/ui.css +1 -1
- package/dist/utils/slots.cjs +1 -1
- package/dist/utils/slots.cjs.map +1 -1
- package/dist/utils/slots.js +3 -4
- package/dist/utils/slots.js.map +1 -1
- package/package.json +14 -15
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs +0 -2
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs.map +0 -1
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.js","names":[],"sources":["../../../src/components/steps/Steps.tsx"],"sourcesContent":["import { Steps as ArkSteps } from '@ark-ui/react'\nimport { ComponentProps } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { steps } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots.tsx'\n\nconst { withProvider, withContext } = createStyleContext(steps)\n\nexport const Steps = withProvider(styled(ArkSteps.Root), 'root')\nexport const StepsList = withContext(styled(ArkSteps.List), 'list')\nexport const StepsItem = withContext(styled(ArkSteps.Item), 'item')\nexport const StepsTrigger = withContext(styled(ArkSteps.Trigger), 'trigger')\nexport const StepsIndicator = withContext(styled(ArkSteps.Indicator), 'indicator')\nexport const StepsSeparator = withContext(styled(ArkSteps.Separator), 'separator')\nexport const StepsContent = withContext(styled(ArkSteps.Content), 'content')\n\nexport interface StepsProps extends ComponentProps<typeof Steps> {}\n\nexport interface StepsListProps extends ComponentProps<typeof StepsList> {}\n\nexport interface StepsItemProps extends ComponentProps<typeof StepsItem> {}\n\nexport interface StepsTriggerProps extends ComponentProps<typeof StepsTrigger> {}\n\nexport interface StepsIndicatorProps extends ComponentProps<typeof StepsIndicator> {}\n\nexport interface StepsSeparatorProps extends ComponentProps<typeof StepsSeparator> {}\n\nexport interface StepsContentProps extends ComponentProps<typeof StepsContent> {}\n"],"mappings":";;;;;;AAMA,IAAM,EAAE,iBAAc,
|
|
1
|
+
{"version":3,"file":"Steps.js","names":["Steps","ArkSteps","createStyleContext","steps","Steps$1","withProvider","styled","Steps","StepsList","withContext","StepsItem","StepsTrigger","StepsIndicator","StepsSeparator","StepsContent"],"sources":["../../../src/components/steps/Steps.tsx"],"sourcesContent":["import { Steps as ArkSteps } from '@ark-ui/react'\nimport { ComponentProps } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { steps } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots.tsx'\n\nconst { withProvider, withContext } = createStyleContext(steps)\n\nexport const Steps = withProvider(styled(ArkSteps.Root), 'root')\nexport const StepsList = withContext(styled(ArkSteps.List), 'list')\nexport const StepsItem = withContext(styled(ArkSteps.Item), 'item')\nexport const StepsTrigger = withContext(styled(ArkSteps.Trigger), 'trigger')\nexport const StepsIndicator = withContext(styled(ArkSteps.Indicator), 'indicator')\nexport const StepsSeparator = withContext(styled(ArkSteps.Separator), 'separator')\nexport const StepsContent = withContext(styled(ArkSteps.Content), 'content')\n\nexport interface StepsProps extends ComponentProps<typeof Steps> {}\n\nexport interface StepsListProps extends ComponentProps<typeof StepsList> {}\n\nexport interface StepsItemProps extends ComponentProps<typeof StepsItem> {}\n\nexport interface StepsTriggerProps extends ComponentProps<typeof StepsTrigger> {}\n\nexport interface StepsIndicatorProps extends ComponentProps<typeof StepsIndicator> {}\n\nexport interface StepsSeparatorProps extends ComponentProps<typeof StepsSeparator> {}\n\nexport interface StepsContentProps extends ComponentProps<typeof StepsContent> {}\n"],"mappings":";;;;;;AAMA,IAAM,EAAE,iBAAc,mBAAgBE,EAAmBC,CAAK,GAEjDH,IAAQK,EAAaC,EAAOL,EAAS,IAAI,GAAG,MAAM,GAClDO,IAAYC,EAAYH,EAAOL,EAAS,IAAI,GAAG,MAAM,GACrDS,IAAYD,EAAYH,EAAOL,EAAS,IAAI,GAAG,MAAM,GACrDU,IAAeF,EAAYH,EAAOL,EAAS,OAAO,GAAG,SAAS,GAC9DW,IAAiBH,EAAYH,EAAOL,EAAS,SAAS,GAAG,WAAW,GACpEY,IAAiBJ,EAAYH,EAAOL,EAAS,SAAS,GAAG,WAAW,GACpEa,IAAeL,EAAYH,EAAOL,EAAS,OAAO,GAAG,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupplierRatingBadge.cjs","names":[],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBadge.tsx"],"sourcesContent":["import { Box } from '@stokelp/styled-system/jsx'\nimport { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { Popover, PopoverContent, PopoverTrigger, Text } from '~/components'\n\nimport {\n formatOverall,\n SUPPLIER_RATING_MAX,\n SupplierRatingBreakdown,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './SupplierRatingBreakdown'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\n\nexport type SupplierRatingBadgeProps = {\n rating: SupplierRating\n /** Optional original response rate (0..100) reminded inside the breakdown. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nfunction getBadgeColors(overall: number): { bg: string; color: string } {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.8) return { bg: '#E6F3D9', color: '#3B6D11' }\n if (ratio >= 0.6) return { bg: '#FBF1CC', color: '#92750C' }\n if (ratio >= 0.4) return { bg: '#FDF0E0', color: '#C2740C' }\n return { bg: '#FCEBEB', color: '#A32D2D' }\n}\n\n/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */\nexport function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps) {\n const [open, setOpen] = useState(false)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n }, [])\n\n const scheduleClose = useCallback(() => {\n cancelClose()\n closeTimer.current = setTimeout(() => setOpen(false), 120)\n }, [cancelClose])\n\n useEffect(() => cancelClose, [cancelClose])\n\n const openOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n cancelClose()\n setOpen(true)\n }\n const closeOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n scheduleClose()\n }\n\n const insufficient = rating.insufficientData || rating.overall == null\n const uiLabels = useUiLabels()\n const insufficientLabel = labels?.insufficientData ?? uiLabels.supplierRating.insufficientData\n const colors = insufficient ? { bg: '#F1F2F4', color: '#5B6472' } : getBadgeColors(rating.overall as number)\n\n return (\n <Popover\n open={open}\n onOpenChange={e => setOpen(e.open)}\n positioning={{ placement: 'top-end', gutter: 8 }}\n autoFocus={false}\n restoreFocus={false}\n lazyMount\n unmountOnExit\n >\n <PopoverTrigger asChild>\n <Box\n display=\"inline-flex\"\n alignItems=\"center\"\n w=\"fit-content\"\n maxW=\"100%\"\n px=\"space-8\"\n py=\"space-2\"\n borderRadius=\"full\"\n tabIndex={0}\n cursor=\"default\"\n style={{ backgroundColor: colors.bg }}\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n onFocus={() => {\n cancelClose()\n setOpen(true)\n }}\n onBlur={() => setOpen(false)}\n >\n <Text size=\"sm\" bold whiteSpace=\"nowrap\" style={{ color: colors.color }}>\n {insufficient ? insufficientLabel : `${formatOverall(rating.overall as number, uiLabels.locale)} ★`}\n </Text>\n </Box>\n </PopoverTrigger>\n <PopoverContent\n className=\"panda-preflight-enabled\"\n zIndex={10000}\n p=\"0\"\n bg=\"transparent\"\n border=\"none\"\n borderRadius=\"radius-8\"\n boxShadow=\"0px 8px 16px 4px #1624861A\"\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n >\n <SupplierRatingBreakdown rating={rating} responseRate={responseRate} labels={labels} />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":"6QAqBA,
|
|
1
|
+
{"version":3,"file":"SupplierRatingBadge.cjs","names":["useState","useRef","useCallback","useUiLabels","Popover","PopoverTrigger","Box","Text","formatOverall","PopoverContent","SupplierRatingBreakdown","require_Text","require_UiLabelsProvider","require_Popover","require_SupplierRatingBreakdown","_stokelp_styled_system_jsx","react","react_jsx_runtime","getBadgeColors","ratio","overall","SupplierRatingBadge","open","setOpen","closeTimer","cancelClose","scheduleClose","openOnMouse","closeOnMouse","insufficient","rating","uiLabels","insufficientLabel","labels","colors"],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBadge.tsx"],"sourcesContent":["import { Box } from '@stokelp/styled-system/jsx'\nimport { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { Popover, PopoverContent, PopoverTrigger, Text } from '~/components'\n\nimport {\n formatOverall,\n SUPPLIER_RATING_MAX,\n SupplierRatingBreakdown,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './SupplierRatingBreakdown'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\n\nexport type SupplierRatingBadgeProps = {\n rating: SupplierRating\n /** Optional original response rate (0..100) reminded inside the breakdown. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nfunction getBadgeColors(overall: number): { bg: string; color: string } {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.8) return { bg: '#E6F3D9', color: '#3B6D11' }\n if (ratio >= 0.6) return { bg: '#FBF1CC', color: '#92750C' }\n if (ratio >= 0.4) return { bg: '#FDF0E0', color: '#C2740C' }\n return { bg: '#FCEBEB', color: '#A32D2D' }\n}\n\n/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */\nexport function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps) {\n const [open, setOpen] = useState(false)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n }, [])\n\n const scheduleClose = useCallback(() => {\n cancelClose()\n closeTimer.current = setTimeout(() => setOpen(false), 120)\n }, [cancelClose])\n\n useEffect(() => cancelClose, [cancelClose])\n\n const openOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n cancelClose()\n setOpen(true)\n }\n const closeOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n scheduleClose()\n }\n\n const insufficient = rating.insufficientData || rating.overall == null\n const uiLabels = useUiLabels()\n const insufficientLabel = labels?.insufficientData ?? uiLabels.supplierRating.insufficientData\n const colors = insufficient ? { bg: '#F1F2F4', color: '#5B6472' } : getBadgeColors(rating.overall as number)\n\n return (\n <Popover\n open={open}\n onOpenChange={e => setOpen(e.open)}\n positioning={{ placement: 'top-end', gutter: 8 }}\n autoFocus={false}\n restoreFocus={false}\n lazyMount\n unmountOnExit\n >\n <PopoverTrigger asChild>\n <Box\n display=\"inline-flex\"\n alignItems=\"center\"\n w=\"fit-content\"\n maxW=\"100%\"\n px=\"space-8\"\n py=\"space-2\"\n borderRadius=\"full\"\n tabIndex={0}\n cursor=\"default\"\n style={{ backgroundColor: colors.bg }}\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n onFocus={() => {\n cancelClose()\n setOpen(true)\n }}\n onBlur={() => setOpen(false)}\n >\n <Text size=\"sm\" bold whiteSpace=\"nowrap\" style={{ color: colors.color }}>\n {insufficient ? insufficientLabel : `${formatOverall(rating.overall as number, uiLabels.locale)} ★`}\n </Text>\n </Box>\n </PopoverTrigger>\n <PopoverContent\n className=\"panda-preflight-enabled\"\n zIndex={10000}\n p=\"0\"\n bg=\"transparent\"\n border=\"none\"\n borderRadius=\"radius-8\"\n boxShadow=\"0px 8px 16px 4px #1624861A\"\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n >\n <SupplierRatingBreakdown rating={rating} responseRate={responseRate} labels={labels} />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":"A,6QAqBA,SAASkB,EAAe,EAAgD,CACtE,IAAMC,EAAQC,EAAA,EAId,OAHID,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACvDA,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACvDA,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACpD,CAAE,GAAI,UAAW,MAAO,SAAU,CAC3C,CAGA,SAAgBE,EAAoB,CAAE,SAAQ,eAAc,UAAoC,CAC9F,GAAM,CAACC,EAAMC,IAAA,EAAWvB,EAAAA,SAAAA,CAAS,EAAK,EAChCwB,GAAA,EAAavB,EAAAA,OAAAA,CAA6C,IAAI,EAE9DwB,GAAA,EAAcvB,EAAAA,YAAAA,KAAkB,CACpC,AAEEsB,EAAW,WADX,aAAaA,EAAW,OAAO,EACV,KAEzB,EAAG,CAAC,CAAC,EAECE,GAAA,EAAgBxB,EAAAA,YAAAA,KAAkB,CACtCuB,EAAY,EACZ,EAAW,QAAU,eAAiBF,EAAQ,EAAK,EAAG,GAAG,CAC3D,EAAG,CAACE,CAAW,CAAC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CACE,UAAU,0BACV,OAAQ,IACR,EAAE,IACF,GAAG,cACH,OAAO,OACP,aAAa,WACb,UAAU,6BACV,eAAgBkB,EAChB,eAAgBC,EAEhB,UAAA,EAAAX,EAAA,IAAA,CAACP,EAAAA,wBAAD,CAAiC,SAAsB,eAAsB,QAAS,CAAA,CACxE,CAAA,CACT,C,EAEb,C"}
|
|
@@ -6,4 +6,4 @@ export type SupplierRatingBadgeProps = {
|
|
|
6
6
|
labels?: Partial<SupplierRatingLabels>;
|
|
7
7
|
};
|
|
8
8
|
/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */
|
|
9
|
-
export declare function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps): import(
|
|
9
|
+
export declare function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps): import('react').JSX.Element;
|
|
@@ -6,7 +6,7 @@ import { SupplierRatingBreakdown as a, formatOverall as o } from "./SupplierRati
|
|
|
6
6
|
import { Box as s } from "@stokelp/styled-system/jsx";
|
|
7
7
|
import { useCallback as c, useEffect as l, useRef as u, useState as d } from "react";
|
|
8
8
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
|
-
|
|
9
|
+
// src/components/supplier-rating-badge/SupplierRatingBadge.tsx
|
|
10
10
|
function m(e) {
|
|
11
11
|
let t = e / 5;
|
|
12
12
|
return t >= .8 ? {
|
|
@@ -94,7 +94,6 @@ function h({ rating: h, responseRate: g, labels: _ }) {
|
|
|
94
94
|
})]
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
//#endregion
|
|
98
97
|
export { h as SupplierRatingBadge };
|
|
99
98
|
|
|
100
99
|
//# sourceMappingURL=SupplierRatingBadge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupplierRatingBadge.js","names":[],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBadge.tsx"],"sourcesContent":["import { Box } from '@stokelp/styled-system/jsx'\nimport { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { Popover, PopoverContent, PopoverTrigger, Text } from '~/components'\n\nimport {\n formatOverall,\n SUPPLIER_RATING_MAX,\n SupplierRatingBreakdown,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './SupplierRatingBreakdown'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\n\nexport type SupplierRatingBadgeProps = {\n rating: SupplierRating\n /** Optional original response rate (0..100) reminded inside the breakdown. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nfunction getBadgeColors(overall: number): { bg: string; color: string } {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.8) return { bg: '#E6F3D9', color: '#3B6D11' }\n if (ratio >= 0.6) return { bg: '#FBF1CC', color: '#92750C' }\n if (ratio >= 0.4) return { bg: '#FDF0E0', color: '#C2740C' }\n return { bg: '#FCEBEB', color: '#A32D2D' }\n}\n\n/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */\nexport function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps) {\n const [open, setOpen] = useState(false)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n }, [])\n\n const scheduleClose = useCallback(() => {\n cancelClose()\n closeTimer.current = setTimeout(() => setOpen(false), 120)\n }, [cancelClose])\n\n useEffect(() => cancelClose, [cancelClose])\n\n const openOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n cancelClose()\n setOpen(true)\n }\n const closeOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n scheduleClose()\n }\n\n const insufficient = rating.insufficientData || rating.overall == null\n const uiLabels = useUiLabels()\n const insufficientLabel = labels?.insufficientData ?? uiLabels.supplierRating.insufficientData\n const colors = insufficient ? { bg: '#F1F2F4', color: '#5B6472' } : getBadgeColors(rating.overall as number)\n\n return (\n <Popover\n open={open}\n onOpenChange={e => setOpen(e.open)}\n positioning={{ placement: 'top-end', gutter: 8 }}\n autoFocus={false}\n restoreFocus={false}\n lazyMount\n unmountOnExit\n >\n <PopoverTrigger asChild>\n <Box\n display=\"inline-flex\"\n alignItems=\"center\"\n w=\"fit-content\"\n maxW=\"100%\"\n px=\"space-8\"\n py=\"space-2\"\n borderRadius=\"full\"\n tabIndex={0}\n cursor=\"default\"\n style={{ backgroundColor: colors.bg }}\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n onFocus={() => {\n cancelClose()\n setOpen(true)\n }}\n onBlur={() => setOpen(false)}\n >\n <Text size=\"sm\" bold whiteSpace=\"nowrap\" style={{ color: colors.color }}>\n {insufficient ? insufficientLabel : `${formatOverall(rating.overall as number, uiLabels.locale)} ★`}\n </Text>\n </Box>\n </PopoverTrigger>\n <PopoverContent\n className=\"panda-preflight-enabled\"\n zIndex={10000}\n p=\"0\"\n bg=\"transparent\"\n border=\"none\"\n borderRadius=\"radius-8\"\n boxShadow=\"0px 8px 16px 4px #1624861A\"\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n >\n <SupplierRatingBreakdown rating={rating} responseRate={responseRate} labels={labels} />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;;AAqBA,
|
|
1
|
+
{"version":3,"file":"SupplierRatingBadge.js","names":["getBadgeColors","ratio","overall","SupplierRatingBadge","open","setOpen","useState","closeTimer","useRef","cancelClose","useCallback","scheduleClose","openOnMouse","closeOnMouse","insufficient","rating","uiLabels","useUiLabels","insufficientLabel","labels","colors","Popover","PopoverTrigger","Box","Text","formatOverall","PopoverContent","SupplierRatingBreakdown"],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBadge.tsx"],"sourcesContent":["import { Box } from '@stokelp/styled-system/jsx'\nimport { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { Popover, PopoverContent, PopoverTrigger, Text } from '~/components'\n\nimport {\n formatOverall,\n SUPPLIER_RATING_MAX,\n SupplierRatingBreakdown,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './SupplierRatingBreakdown'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\n\nexport type SupplierRatingBadgeProps = {\n rating: SupplierRating\n /** Optional original response rate (0..100) reminded inside the breakdown. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nfunction getBadgeColors(overall: number): { bg: string; color: string } {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.8) return { bg: '#E6F3D9', color: '#3B6D11' }\n if (ratio >= 0.6) return { bg: '#FBF1CC', color: '#92750C' }\n if (ratio >= 0.4) return { bg: '#FDF0E0', color: '#C2740C' }\n return { bg: '#FCEBEB', color: '#A32D2D' }\n}\n\n/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */\nexport function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps) {\n const [open, setOpen] = useState(false)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n }, [])\n\n const scheduleClose = useCallback(() => {\n cancelClose()\n closeTimer.current = setTimeout(() => setOpen(false), 120)\n }, [cancelClose])\n\n useEffect(() => cancelClose, [cancelClose])\n\n const openOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n cancelClose()\n setOpen(true)\n }\n const closeOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n scheduleClose()\n }\n\n const insufficient = rating.insufficientData || rating.overall == null\n const uiLabels = useUiLabels()\n const insufficientLabel = labels?.insufficientData ?? uiLabels.supplierRating.insufficientData\n const colors = insufficient ? { bg: '#F1F2F4', color: '#5B6472' } : getBadgeColors(rating.overall as number)\n\n return (\n <Popover\n open={open}\n onOpenChange={e => setOpen(e.open)}\n positioning={{ placement: 'top-end', gutter: 8 }}\n autoFocus={false}\n restoreFocus={false}\n lazyMount\n unmountOnExit\n >\n <PopoverTrigger asChild>\n <Box\n display=\"inline-flex\"\n alignItems=\"center\"\n w=\"fit-content\"\n maxW=\"100%\"\n px=\"space-8\"\n py=\"space-2\"\n borderRadius=\"full\"\n tabIndex={0}\n cursor=\"default\"\n style={{ backgroundColor: colors.bg }}\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n onFocus={() => {\n cancelClose()\n setOpen(true)\n }}\n onBlur={() => setOpen(false)}\n >\n <Text size=\"sm\" bold whiteSpace=\"nowrap\" style={{ color: colors.color }}>\n {insufficient ? insufficientLabel : `${formatOverall(rating.overall as number, uiLabels.locale)} ★`}\n </Text>\n </Box>\n </PopoverTrigger>\n <PopoverContent\n className=\"panda-preflight-enabled\"\n zIndex={10000}\n p=\"0\"\n bg=\"transparent\"\n border=\"none\"\n borderRadius=\"radius-8\"\n boxShadow=\"0px 8px 16px 4px #1624861A\"\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n >\n <SupplierRatingBreakdown rating={rating} responseRate={responseRate} labels={labels} />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;;AAqBA,SAASA,EAAe,GAAgD;CACtE,IAAMC,IAAQC,IAAA;CAId,OAHID,KAAS,KAAY;EAAE,IAAI;EAAW,OAAO;CAAU,IACvDA,KAAS,KAAY;EAAE,IAAI;EAAW,OAAO;CAAU,IACvDA,KAAS,KAAY;EAAE,IAAI;EAAW,OAAO;CAAU,IACpD;EAAE,IAAI;EAAW,OAAO;CAAU;AAC3C;AAGA,SAAgBE,EAAoB,EAAE,WAAQ,iBAAc,aAAoC;CAC9F,IAAM,CAACC,GAAMC,KAAWC,EAAS,EAAK,GAChCC,IAAaC,EAA6C,IAAI,GAE9DC,IAAcC,QAAkB;EACpC,AAEEH,EAAW,aADX,aAAaA,EAAW,OAAO,GACV;CAEzB,GAAG,CAAC,CAAC,GAECI,IAAgBD,QAAk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;GACF,IAAG;GACH,QAAO;GACP,cAAa;GACb,WAAU;GACV,gBAAgBd;GAChB,gBAAgBC;GAEhB,UAAA,kBAACc,GAAD;IAAiC;IAAsB;IAAsB;GAAS,CAAA;EACxE,CAAA,CACT;;AAEb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../text/Text.cjs"),t=require("./labels.cjs"),n=require("../ui-labels/UiLabelsProvider.cjs"),r=require("../icon/Icon.cjs"),i=require("../../node_modules
|
|
1
|
+
"use client";const e=require("../text/Text.cjs"),t=require("./labels.cjs"),n=require("../ui-labels/UiLabelsProvider.cjs"),r=require("../icon/Icon.cjs"),i=require("../../node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs"),a=require("../../node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs");let o=require("@stokelp/styled-system/jsx"),s=require("react/jsx-runtime");var c=5,l=[`profile`,`location`,`contacts`,`legalBanking`,`sector`,`certificate`];function u(e,t=`fr-FR`){return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}function d(e,t,n=`fr-FR`){if(e<60)return`${Math.round(e)} ${t.minutes}`;let r=e/60;if(r<48)return`${Math.round(r)} ${t.hours}`;let i=r/24;return`${new Intl.NumberFormat(n,{maximumFractionDigits:1}).format(i)} ${t.days}`}function f(e){let t=e/5;return t>=.7?`#3B6D11`:t>=.4?`#854F0B`:`#A32D2D`}function p(e){return e>=70?`#639922`:e>=40?`#BA7517`:`#E24B4A`}var m=({rating:c,responseRate:m,labels:h})=>{let g=n.useUiLabels(),_=t.mergeSupplierRatingLabels(g.supplierRating,h),v=m!=null,y=c.responseDelayMinutes!=null,b=c.responseDelayScore==null?null:Math.round(c.responseDelayScore*100),x=Math.round(c.completionScore*100),S=[{key:`responseRate`,value:v?`${Math.round(m)} %`:_.notAvailable,barPercent:v?Math.round(m):null,color:v?p(Math.round(m)):void 0},{key:`responseDelay`,value:y?d(c.responseDelayMinutes,_.units,g.locale):_.notAvailable,barPercent:b,color:b==null?void 0:p(b)},{key:`completion`,value:`${x} %`,barPercent:x,color:p(x)}];return(0,s.jsxs)(o.Box,{bg:`white`,borderRadius:`radius-8`,p:`space-16`,minW:`240px`,maxW:`260px`,css:{"& *":{fontFamily:`inherit`}},children:[(0,s.jsxs)(o.HStack,{justify:`space-between`,alignItems:`baseline`,mb:`space-8`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.md`,fontWeight:`bold`,children:_.title}),c.insufficientData||c.overall==null?(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`medium`,color:`grey.400`,children:_.insufficientData}):(0,s.jsxs)(e.Text,{as:`span`,fontSize:`body.lg`,fontWeight:`medium`,style:{color:f(c.overall)},children:[u(c.overall,g.locale),` / `,5,` ★`]})]}),(0,s.jsx)(o.Box,{h:`1px`,bg:`grey.100`,mb:`space-8`}),(0,s.jsxs)(o.VStack,{alignItems:`stretch`,gap:`space-8`,mb:`space-8`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`bold`,color:`grey.400`,children:_.componentsTitle}),S.map(t=>(0,s.jsxs)(o.VStack,{alignItems:`stretch`,gap:`space-2`,children:[(0,s.jsxs)(o.HStack,{justify:`space-between`,alignItems:`baseline`,gap:`space-8`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,color:`grey.500`,children:_.components[t.key]}),(0,s.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,s.jsx)(o.Box,{h:`3px`,bg:`grey.100`,borderRadius:`full`,overflow:`hidden`,children:(0,s.jsx)(o.Box,{h:`100%`,borderRadius:`full`,style:{width:t.barPercent==null?`0%`:`${t.barPercent}%`,background:t.color??`transparent`}})})]},t.key))]}),(0,s.jsx)(o.Box,{h:`1px`,bg:`grey.100`,mb:`space-8`}),(0,s.jsxs)(o.VStack,{alignItems:`stretch`,gap:`space-4`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`bold`,color:`grey.400`,children:_.completionTitle}),l.map(t=>{let n=c.completion[t];return(0,s.jsxs)(o.HStack,{alignItems:`center`,gap:`space-8`,children:[(0,s.jsx)(r.Icon,{size:`sm`,color:n?`success.500`:`grey.300`,flexShrink:`0`,children:n?(0,s.jsx)(i.default,{}):(0,s.jsx)(a.default,{})}),(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,color:n?`grey.500`:`grey.400`,children:_.completion[t]})]},t)})]}),_.footer&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Box,{h:`1px`,bg:`grey.100`,mt:`space-8`,mb:`space-8`}),(0,s.jsx)(e.Text,{as:`span`,fontSize:`9px`,color:`grey.300`,style:{lineHeight:1},children:_.footer})]})]})};exports.DEFAULT_SUPPLIER_RATING_LABELS=t.DEFAULT_SUPPLIER_RATING_LABELS,exports.SUPPLIER_RATING_MAX=c,exports.SupplierRatingBreakdown=m,exports.formatOverall=u,exports.formatResponseDelay=d,exports.getHeadlineColor=f,exports.mergeSupplierRatingLabels=t.mergeSupplierRatingLabels;
|
|
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'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport {\n mergeSupplierRatingLabels,\n type SupplierRatingCompletionKey,\n type SupplierRatingComponentKey,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './labels'\n\nexport * from './labels'\n\nexport const SUPPLIER_RATING_MAX = 5\n\nconst COMPLETION_ORDER: SupplierRatingCompletionKey[] = [\n 'profile',\n 'location',\n 'contacts',\n 'legalBanking',\n 'sector',\n 'certificate',\n]\n\n/** Note with one decimal in the reader's number format (\"4,2\" in French, \"4.2\" in English). */\nexport function formatOverall(overall: number, locale = 'fr-FR'): string {\n return new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(overall)\n}\n\n/** Average response delay: minutes → \"45 min\" / \"18 h\" / \"2,5 j\". */\nexport function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units'], locale = 'fr-FR'): 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 `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(days)} ${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 uiLabels = useUiLabels()\n const labels = mergeSupplierRatingLabels(uiLabels.supplierRating, labelsProp)\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\n ? formatResponseDelay(rating.responseDelayMinutes as number, labels.units, uiLabels.locale)\n : 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, uiLabels.locale)} / {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":"qfAeA,IAAa,EAAsB,EAE7B,EAAkD,CACtD,UACA,WACA,WACA,eACA,SACA,aACF,EAGA,SAAgB,EAAc,EAAiB,EAAS,QAAiB,CACvE,OAAO,IAAI,KAAK,aAAa,EAAQ,CAAE,sBAAuB,EAAG,sBAAuB,CAAE,CAAC,EAAE,OAAO,CAAO,CAC7G,CAGA,SAAgB,EAAoB,EAAiB,EAAsC,EAAS,QAAiB,CACnH,GAA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AA,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"}
|
|
1
|
+
{"version":3,"file":"SupplierRatingBreakdown.cjs","names":["useUiLabels","mergeSupplierRatingLabels","Box","HStack","Text","VStack","Icon","CheckCircleIcon","XCircleIcon","_Fragment","require_Text","require_labels","require_UiLabelsProvider","require_Icon","require_CheckCircleIcon","require_XCircleIcon","_stokelp_styled_system_jsx","react_jsx_runtime","SUPPLIER_RATING_MAX","COMPLETION_ORDER","formatOverall","locale","overall","formatResponseDelay","minutes","units","hours","days","getHeadlineColor","ratio","getBarColor","ratioPercent","SupplierRatingBreakdown","labelsProp","uiLabels","labels","hasResponseRate","responseRate","hasDelay","rating","delayPercent","completionPercent","rows","row","done","key"],"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'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport {\n mergeSupplierRatingLabels,\n type SupplierRatingCompletionKey,\n type SupplierRatingComponentKey,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './labels'\n\nexport * from './labels'\n\nexport const SUPPLIER_RATING_MAX = 5\n\nconst COMPLETION_ORDER: SupplierRatingCompletionKey[] = [\n 'profile',\n 'location',\n 'contacts',\n 'legalBanking',\n 'sector',\n 'certificate',\n]\n\n/** Note with one decimal in the reader's number format (\"4,2\" in French, \"4.2\" in English). */\nexport function formatOverall(overall: number, locale = 'fr-FR'): string {\n return new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(overall)\n}\n\n/** Average response delay: minutes → \"45 min\" / \"18 h\" / \"2,5 j\". */\nexport function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units'], locale = 'fr-FR'): 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 `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(days)} ${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 uiLabels = useUiLabels()\n const labels = mergeSupplierRatingLabels(uiLabels.supplierRating, labelsProp)\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\n ? formatResponseDelay(rating.responseDelayMinutes as number, labels.units, uiLabels.locale)\n : 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, uiLabels.locale)} / {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":"A,uYAeA,IAAakB,EAAsB,EAE7BC,EAAkD,CACtD,UACA,WACA,WACA,eACA,SACA,aACF,EAGA,SAAgBC,EAAc,EAAiB,EAAS,QAAiB,CACvE,OAAO,IAAI,KAAK,aAAaC,EAAQ,CAAE,sBAAuB,EAAG,sBAAuB,CAAE,CAAC,CAAC,CAAC,OAAOC,CAAO,CAC7G,CAGA,SAAgBC,EAAoB,EAAiB,EAAsC,EAAS,QAAiB,CACnH,GAAIC,EAAU,GAAI,MAAO,GAAG,KAAK,MAAMA,CAAO,EAAE,GAAGC,EAAM,UACzD,IAAMC,EAAQF,EAAU,GACxB,GAAIE,EAAQ,GAAI,MAAO,GAAG,KAAK,MAAMA,CAAK,EAA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3B,EAAA,IAAA,CAACV,EAAAA,QAAD,CAAkB,CAAA,GAAI,EAAAU,EAAA,IAAA,CAACT,EAAAA,QAAD,CAAc,CAAA,CACxC,CAAA,GACN,EAAAS,EAAA,IAAA,CAACb,EAAAA,KAAD,CAAM,GAAG,OAAO,SAAS,UAAU,MAAOwC,EAAO,WAAa,WAC3D,SAAAT,EAAO,WAAWU,EACf,CAAA,CACA,CAPK,EAAAA,CAOL,CAEZ,CAAC,CACK,C,GAEPV,EAAO,SACN,EAAAlB,EAAA,KAAA,CAAAR,EAAAA,SAAA,CAAA,SAAA,EACE,EAAAQ,EAAA,IAAA,CAACf,EAAAA,IAAD,CAAK,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,SAAW,CAAA,GACtD,EAAAe,EAAA,IAAA,CAACb,EAAAA,KAAD,CAAM,GAAG,OAAO,SAAS,MAAM,MAAM,WAAW,MAAO,CAAE,WAAY,CAAE,EACpE,SAAA+B,EAAO,MACJ,CAAA,CACN,CAAA,CAAA,CAED,C,EAET,E"}
|
|
@@ -12,4 +12,4 @@ type SupplierRatingBreakdownProps = {
|
|
|
12
12
|
responseRate?: number;
|
|
13
13
|
labels?: Partial<SupplierRatingLabels>;
|
|
14
14
|
};
|
|
15
|
-
export declare const SupplierRatingBreakdown: ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => import(
|
|
15
|
+
export declare const SupplierRatingBreakdown: ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => import('react').JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Text as e } from "../text/Text.js";
|
|
3
|
-
import {
|
|
4
|
-
import { useUiLabels as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Box as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
|
|
11
|
-
var
|
|
3
|
+
import { DEFAULT_SUPPLIER_RATING_LABELS as t, mergeSupplierRatingLabels as n } from "./labels.js";
|
|
4
|
+
import { useUiLabels as r } from "../ui-labels/UiLabelsProvider.js";
|
|
5
|
+
import { Icon as i } from "../icon/Icon.js";
|
|
6
|
+
import a from "../../node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js";
|
|
7
|
+
import o from "../../node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js";
|
|
8
|
+
import { Box as s, HStack as c, VStack as l } from "@stokelp/styled-system/jsx";
|
|
9
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
+
// src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx
|
|
11
|
+
var p = 5, m = [
|
|
12
12
|
"profile",
|
|
13
13
|
"location",
|
|
14
14
|
"contacts",
|
|
@@ -16,48 +16,48 @@ var f = 5, p = [
|
|
|
16
16
|
"sector",
|
|
17
17
|
"certificate"
|
|
18
18
|
];
|
|
19
|
-
function
|
|
19
|
+
function h(e, t = "fr-FR") {
|
|
20
20
|
return new Intl.NumberFormat(t, {
|
|
21
21
|
minimumFractionDigits: 1,
|
|
22
22
|
maximumFractionDigits: 1
|
|
23
23
|
}).format(e);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function g(e, t, n = "fr-FR") {
|
|
26
26
|
if (e < 60) return `${Math.round(e)} ${t.minutes}`;
|
|
27
27
|
let r = e / 60;
|
|
28
28
|
if (r < 48) return `${Math.round(r)} ${t.hours}`;
|
|
29
29
|
let i = r / 24;
|
|
30
30
|
return `${new Intl.NumberFormat(n, { maximumFractionDigits: 1 }).format(i)} ${t.days}`;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function _(e) {
|
|
33
33
|
let t = e / 5;
|
|
34
34
|
return t >= .7 ? "#3B6D11" : t >= .4 ? "#854F0B" : "#A32D2D";
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function v(e) {
|
|
37
37
|
return e >= 70 ? "#639922" : e >= 40 ? "#BA7517" : "#E24B4A";
|
|
38
38
|
}
|
|
39
|
-
var
|
|
40
|
-
let b =
|
|
39
|
+
var y = ({ rating: t, responseRate: p, labels: y }) => {
|
|
40
|
+
let b = r(), x = n(b.supplierRating, y), S = p != null, C = t.responseDelayMinutes != null, w = t.responseDelayScore == null ? null : Math.round(t.responseDelayScore * 100), T = Math.round(t.completionScore * 100), E = [
|
|
41
41
|
{
|
|
42
42
|
key: "responseRate",
|
|
43
|
-
value: S ? `${Math.round(
|
|
44
|
-
barPercent: S ? Math.round(
|
|
45
|
-
color: S ?
|
|
43
|
+
value: S ? `${Math.round(p)} %` : x.notAvailable,
|
|
44
|
+
barPercent: S ? Math.round(p) : null,
|
|
45
|
+
color: S ? v(Math.round(p)) : void 0
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
key: "responseDelay",
|
|
49
|
-
value: C ?
|
|
49
|
+
value: C ? g(t.responseDelayMinutes, x.units, b.locale) : x.notAvailable,
|
|
50
50
|
barPercent: w,
|
|
51
|
-
color: w == null ? void 0 :
|
|
51
|
+
color: w == null ? void 0 : v(w)
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
key: "completion",
|
|
55
55
|
value: `${T} %`,
|
|
56
56
|
barPercent: T,
|
|
57
|
-
color:
|
|
57
|
+
color: v(T)
|
|
58
58
|
}
|
|
59
59
|
];
|
|
60
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ f(s, {
|
|
61
61
|
bg: "white",
|
|
62
62
|
borderRadius: "radius-8",
|
|
63
63
|
p: "space-16",
|
|
@@ -65,62 +65,62 @@ var v = ({ rating: f, responseRate: v, labels: y }) => {
|
|
|
65
65
|
maxW: "260px",
|
|
66
66
|
css: { "& *": { fontFamily: "inherit" } },
|
|
67
67
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ f(c, {
|
|
69
69
|
justify: "space-between",
|
|
70
70
|
alignItems: "baseline",
|
|
71
71
|
mb: "space-8",
|
|
72
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ d(e, {
|
|
73
73
|
as: "span",
|
|
74
74
|
fontSize: "body.md",
|
|
75
75
|
fontWeight: "bold",
|
|
76
76
|
children: x.title
|
|
77
|
-
}),
|
|
77
|
+
}), t.insufficientData || t.overall == null ? /* @__PURE__ */ d(e, {
|
|
78
78
|
as: "span",
|
|
79
79
|
fontSize: "body.sm",
|
|
80
80
|
fontWeight: "medium",
|
|
81
81
|
color: "grey.400",
|
|
82
82
|
children: x.insufficientData
|
|
83
|
-
}) : /* @__PURE__ */
|
|
83
|
+
}) : /* @__PURE__ */ f(e, {
|
|
84
84
|
as: "span",
|
|
85
85
|
fontSize: "body.lg",
|
|
86
86
|
fontWeight: "medium",
|
|
87
|
-
style: { color:
|
|
87
|
+
style: { color: _(t.overall) },
|
|
88
88
|
children: [
|
|
89
|
-
|
|
89
|
+
h(t.overall, b.locale),
|
|
90
90
|
" / ",
|
|
91
91
|
5,
|
|
92
92
|
" ★"
|
|
93
93
|
]
|
|
94
94
|
})]
|
|
95
95
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ d(s, {
|
|
97
97
|
h: "1px",
|
|
98
98
|
bg: "grey.100",
|
|
99
99
|
mb: "space-8"
|
|
100
100
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ f(l, {
|
|
102
102
|
alignItems: "stretch",
|
|
103
103
|
gap: "space-8",
|
|
104
104
|
mb: "space-8",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ d(e, {
|
|
106
106
|
as: "span",
|
|
107
107
|
fontSize: "body.sm",
|
|
108
108
|
fontWeight: "bold",
|
|
109
109
|
color: "grey.400",
|
|
110
110
|
children: x.componentsTitle
|
|
111
|
-
}), E.map((t) => /* @__PURE__ */
|
|
111
|
+
}), E.map((t) => /* @__PURE__ */ f(l, {
|
|
112
112
|
alignItems: "stretch",
|
|
113
113
|
gap: "space-2",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
114
|
+
children: [/* @__PURE__ */ f(c, {
|
|
115
115
|
justify: "space-between",
|
|
116
116
|
alignItems: "baseline",
|
|
117
117
|
gap: "space-8",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ d(e, {
|
|
119
119
|
as: "span",
|
|
120
120
|
fontSize: "body.sm",
|
|
121
121
|
color: "grey.500",
|
|
122
122
|
children: x.components[t.key]
|
|
123
|
-
}), /* @__PURE__ */
|
|
123
|
+
}), /* @__PURE__ */ d(e, {
|
|
124
124
|
as: "span",
|
|
125
125
|
fontSize: "body.sm",
|
|
126
126
|
fontWeight: "medium",
|
|
@@ -129,12 +129,12 @@ var v = ({ rating: f, responseRate: v, labels: y }) => {
|
|
|
129
129
|
color: t.color ? void 0 : "grey.300",
|
|
130
130
|
children: t.value
|
|
131
131
|
})]
|
|
132
|
-
}), /* @__PURE__ */
|
|
132
|
+
}), /* @__PURE__ */ d(s, {
|
|
133
133
|
h: "3px",
|
|
134
134
|
bg: "grey.100",
|
|
135
135
|
borderRadius: "full",
|
|
136
136
|
overflow: "hidden",
|
|
137
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ d(s, {
|
|
138
138
|
h: "100%",
|
|
139
139
|
borderRadius: "full",
|
|
140
140
|
style: {
|
|
@@ -145,45 +145,45 @@ var v = ({ rating: f, responseRate: v, labels: y }) => {
|
|
|
145
145
|
})]
|
|
146
146
|
}, t.key))]
|
|
147
147
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ d(s, {
|
|
149
149
|
h: "1px",
|
|
150
150
|
bg: "grey.100",
|
|
151
151
|
mb: "space-8"
|
|
152
152
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ f(l, {
|
|
154
154
|
alignItems: "stretch",
|
|
155
155
|
gap: "space-4",
|
|
156
|
-
children: [/* @__PURE__ */
|
|
156
|
+
children: [/* @__PURE__ */ d(e, {
|
|
157
157
|
as: "span",
|
|
158
158
|
fontSize: "body.sm",
|
|
159
159
|
fontWeight: "bold",
|
|
160
160
|
color: "grey.400",
|
|
161
161
|
children: x.completionTitle
|
|
162
|
-
}),
|
|
163
|
-
let
|
|
164
|
-
return /* @__PURE__ */
|
|
162
|
+
}), m.map((n) => {
|
|
163
|
+
let r = t.completion[n];
|
|
164
|
+
return /* @__PURE__ */ f(c, {
|
|
165
165
|
alignItems: "center",
|
|
166
166
|
gap: "space-8",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ d(i, {
|
|
168
168
|
size: "sm",
|
|
169
|
-
color:
|
|
169
|
+
color: r ? "success.500" : "grey.300",
|
|
170
170
|
flexShrink: "0",
|
|
171
|
-
children:
|
|
172
|
-
}), /* @__PURE__ */
|
|
171
|
+
children: d(r ? a : o, {})
|
|
172
|
+
}), /* @__PURE__ */ d(e, {
|
|
173
173
|
as: "span",
|
|
174
174
|
fontSize: "body.sm",
|
|
175
|
-
color:
|
|
176
|
-
children: x.completion[
|
|
175
|
+
color: r ? "grey.500" : "grey.400",
|
|
176
|
+
children: x.completion[n]
|
|
177
177
|
})]
|
|
178
|
-
},
|
|
178
|
+
}, n);
|
|
179
179
|
})]
|
|
180
180
|
}),
|
|
181
|
-
x.footer && /* @__PURE__ */
|
|
181
|
+
x.footer && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(s, {
|
|
182
182
|
h: "1px",
|
|
183
183
|
bg: "grey.100",
|
|
184
184
|
mt: "space-8",
|
|
185
185
|
mb: "space-8"
|
|
186
|
-
}), /* @__PURE__ */
|
|
186
|
+
}), /* @__PURE__ */ d(e, {
|
|
187
187
|
as: "span",
|
|
188
188
|
fontSize: "9px",
|
|
189
189
|
color: "grey.300",
|
|
@@ -193,7 +193,6 @@ var v = ({ rating: f, responseRate: v, labels: y }) => {
|
|
|
193
193
|
]
|
|
194
194
|
});
|
|
195
195
|
};
|
|
196
|
-
|
|
197
|
-
export { f as SUPPLIER_RATING_MAX, v as SupplierRatingBreakdown, m as formatOverall, h as formatResponseDelay, g as getHeadlineColor };
|
|
196
|
+
export { t as DEFAULT_SUPPLIER_RATING_LABELS, p as SUPPLIER_RATING_MAX, y as SupplierRatingBreakdown, h as formatOverall, g as formatResponseDelay, _ as getHeadlineColor, n as mergeSupplierRatingLabels };
|
|
198
197
|
|
|
199
198
|
//# sourceMappingURL=SupplierRatingBreakdown.js.map
|
|
@@ -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'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport {\n mergeSupplierRatingLabels,\n type SupplierRatingCompletionKey,\n type SupplierRatingComponentKey,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './labels'\n\nexport * from './labels'\n\nexport const SUPPLIER_RATING_MAX = 5\n\nconst COMPLETION_ORDER: SupplierRatingCompletionKey[] = [\n 'profile',\n 'location',\n 'contacts',\n 'legalBanking',\n 'sector',\n 'certificate',\n]\n\n/** Note with one decimal in the reader's number format (\"4,2\" in French, \"4.2\" in English). */\nexport function formatOverall(overall: number, locale = 'fr-FR'): string {\n return new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(overall)\n}\n\n/** Average response delay: minutes → \"45 min\" / \"18 h\" / \"2,5 j\". */\nexport function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units'], locale = 'fr-FR'): 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 `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(days)} ${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 uiLabels = useUiLabels()\n const labels = mergeSupplierRatingLabels(uiLabels.supplierRating, labelsProp)\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\n ? formatResponseDelay(rating.responseDelayMinutes as number, labels.units, uiLabels.locale)\n : 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, uiLabels.locale)} / {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":";;;;;;;;;;AAeA,IAAa,IAAsB,GAE7B,IAAkD;CACtD;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,SAAgB,EAAc,GAAiB,IAAS,SAAiB;CACvE,OAAO,IAAI,KAAK,aAAa,GAAQ;EAAE,uBAAuB;EAAG,uBAAuB;CAAE,CAAC,EAAE,OAAO,CAAO;AAC7G;AAGA,SAAgB,EAAoB,GAAiB,GAAsC,IAAS,SAAiB;CACnH,IAAI,IAAU,IAAI,OAAO,GAAG,KAAK,MAAM,CAAO,EAAE,GAAG,EAAM;CACzD,IAAM,IAAQ,IAAU;CACxB,IAAI,IAAQ,IAAI,OAAO,GAAG,KAAK,MAAM,CAAK,EAAE,GAAG,EAAM;CACrD,IAAM,IAAO,IAAQ;CACrB,OAAO,GAAG,IAAI,KAAK,aAAa,GAAQ,EAAE,uBAAuB,EAAE,CAAC,EAAE,OAAO,CAAI,EAAE,GAAG,EAAM;AAC9F;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,K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,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"}
|
|
1
|
+
{"version":3,"file":"SupplierRatingBreakdown.js","names":["CheckCircleIcon","XCircleIcon","_Fragment","ForwardRef","ForwardRef$1","SUPPLIER_RATING_MAX","COMPLETION_ORDER","formatOverall","locale","overall","formatResponseDelay","minutes","units","hours","days","getHeadlineColor","ratio","getBarColor","ratioPercent","SupplierRatingBreakdown","labelsProp","uiLabels","useUiLabels","labels","mergeSupplierRatingLabels","hasResponseRate","responseRate","hasDelay","rating","delayPercent","completionPercent","rows","Box","HStack","Text","VStack","row","done","key","Icon","jsx","Fragment","DEFAULT_SUPPLIER_RATING_LABELS"],"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'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport {\n mergeSupplierRatingLabels,\n type SupplierRatingCompletionKey,\n type SupplierRatingComponentKey,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './labels'\n\nexport * from './labels'\n\nexport const SUPPLIER_RATING_MAX = 5\n\nconst COMPLETION_ORDER: SupplierRatingCompletionKey[] = [\n 'profile',\n 'location',\n 'contacts',\n 'legalBanking',\n 'sector',\n 'certificate',\n]\n\n/** Note with one decimal in the reader's number format (\"4,2\" in French, \"4.2\" in English). */\nexport function formatOverall(overall: number, locale = 'fr-FR'): string {\n return new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(overall)\n}\n\n/** Average response delay: minutes → \"45 min\" / \"18 h\" / \"2,5 j\". */\nexport function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units'], locale = 'fr-FR'): 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 `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(days)} ${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 uiLabels = useUiLabels()\n const labels = mergeSupplierRatingLabels(uiLabels.supplierRating, labelsProp)\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\n ? formatResponseDelay(rating.responseDelayMinutes as number, labels.units, uiLabels.locale)\n : 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, uiLabels.locale)} / {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":";;;;;;;;;;AAeA,IAAaK,IAAsB,GAE7BC,IAAkD;CACtD;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,SAAgBC,EAAc,GAAiB,IAAS,SAAiB;CACvE,OAAO,IAAI,KAAK,aAAaC,GAAQ;EAAE,uBAAu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C8B,GAAD;IAAK,GAAE;IAAM,IAAG;IAAW,IAAG;IAAU,IAAG;GAAW,CAAA,GACtD,kBAACE,GAAD;IAAM,IAAG;IAAO,UAAS;IAAM,OAAM;IAAW,OAAO,EAAE,YAAY,EAAE;IACpE,UAAAX,EAAO;GACJ,CAAA,CACN,EAAA,CAAA;EAED;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.cjs","names":[],"sources":["../../../src/components/supplier-rating-badge/labels.ts"],"sourcesContent":["// Labels of the supplier rating, apart from the components so UiLabelsProvider can carry an\n// app-wide translation without an import cycle. The defaults are French: an app that renders in\n// another locale passes its own through UiLabelsProvider (or the `labels` prop).\n\nexport type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion'\n\nexport type SupplierRatingCompletionKey =\n
|
|
1
|
+
{"version":3,"file":"labels.cjs","names":["DEFAULT_SUPPLIER_RATING_LABELS","mergeSupplierRatingLabels","base","override"],"sources":["../../../src/components/supplier-rating-badge/labels.ts"],"sourcesContent":["// Labels of the supplier rating, apart from the components so UiLabelsProvider can carry an\n// app-wide translation without an import cycle. The defaults are French: an app that renders in\n// another locale passes its own through UiLabelsProvider (or the `labels` prop).\n\nexport type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion'\n\nexport type SupplierRatingCompletionKey =\n 'profile' | 'location' | 'contacts' | 'legalBanking' | 'sector' | 'certificate'\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 location: 'Localisation',\n contacts: 'Contact',\n legalBanking: 'Coordonnées légales et bancaires',\n sector: \"Secteur d'activité\",\n certificate: 'Certificat',\n },\n}\n\n/** `base` overridden by `override`, nested groups merged key by key. */\nexport function mergeSupplierRatingLabels(\n base: SupplierRatingLabels,\n override?: Partial<SupplierRatingLabels>,\n): SupplierRatingLabels {\n return {\n ...base,\n ...override,\n units: { ...base.units, ...override?.units },\n components: { ...base.components, ...override?.components },\n completion: { ...base.completion, ...override?.completion },\n }\n}\n"],"mappings":"A,aA6CA,IAAaA,EAAuD,CAClE,MAAO,mBACP,iBAAkB,WAClB,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,SAAU,eACV,SAAU,UACV,aAAc,mCACd,OAAQ,qBACR,YAAa,YACf,CACF,EAGA,SAAgBC,EACd,EACA,EACsB,CACtB,MAAO,CACL,GAAGC,EACH,GAAGC,EACH,MAAO,CAAE,GAAGD,EAAK,MAAO,GAAGC,GAAU,KAAM,EAC3C,WAAY,CAAE,GAAGD,EAAK,WAAY,GAAGC,GAAU,UAAW,EAC1D,WAAY,CAAE,GAAGD,EAAK,WAAY,GAAGC,GAAU,UAAW,CAC5D,CACF,C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
// src/components/supplier-rating-badge/labels.ts
|
|
3
3
|
var e = {
|
|
4
4
|
title: "Note fournisseur",
|
|
5
5
|
insufficientData: "Non noté",
|
|
@@ -43,7 +43,6 @@ function t(e, t) {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
//#endregion
|
|
47
46
|
export { e as DEFAULT_SUPPLIER_RATING_LABELS, t as mergeSupplierRatingLabels };
|
|
48
47
|
|
|
49
48
|
//# sourceMappingURL=labels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.js","names":[],"sources":["../../../src/components/supplier-rating-badge/labels.ts"],"sourcesContent":["// Labels of the supplier rating, apart from the components so UiLabelsProvider can carry an\n// app-wide translation without an import cycle. The defaults are French: an app that renders in\n// another locale passes its own through UiLabelsProvider (or the `labels` prop).\n\nexport type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion'\n\nexport type SupplierRatingCompletionKey =\n
|
|
1
|
+
{"version":3,"file":"labels.js","names":["DEFAULT_SUPPLIER_RATING_LABELS","mergeSupplierRatingLabels","base","override"],"sources":["../../../src/components/supplier-rating-badge/labels.ts"],"sourcesContent":["// Labels of the supplier rating, apart from the components so UiLabelsProvider can carry an\n// app-wide translation without an import cycle. The defaults are French: an app that renders in\n// another locale passes its own through UiLabelsProvider (or the `labels` prop).\n\nexport type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion'\n\nexport type SupplierRatingCompletionKey =\n 'profile' | 'location' | 'contacts' | 'legalBanking' | 'sector' | 'certificate'\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 location: 'Localisation',\n contacts: 'Contact',\n legalBanking: 'Coordonnées légales et bancaires',\n sector: \"Secteur d'activité\",\n certificate: 'Certificat',\n },\n}\n\n/** `base` overridden by `override`, nested groups merged key by key. */\nexport function mergeSupplierRatingLabels(\n base: SupplierRatingLabels,\n override?: Partial<SupplierRatingLabels>,\n): SupplierRatingLabels {\n return {\n ...base,\n ...override,\n units: { ...base.units, ...override?.units },\n components: { ...base.components, ...override?.components },\n completion: { ...base.completion, ...override?.completion },\n }\n}\n"],"mappings":";;AA6CA,IAAaA,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,UAAU;EACV,UAAU;EACV,cAAc;EACd,QAAQ;EACR,aAAa;CACf;AACF;AAGA,SAAgBC,EACd,GACA,GACsB;CACtB,OAAO;EACL,GAAGC;EACH,GAAGC;EACH,OAAO;GAAE,GAAGD,EAAK;GAAO,GAAGC,GAAU;EAAM;EAC3C,YAAY;GAAE,GAAGD,EAAK;GAAY,GAAGC,GAAU;EAAW;EAC1D,YAAY;GAAE,GAAGD,EAAK;GAAY,GAAGC,GAAU;EAAW;CAC5D;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.cjs","names":[],"sources":["../../../src/components/switch/Switch.tsx"],"sourcesContent":["import { Switch as ArkSwitch, type SwitchRootProps } from '@ark-ui/react'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { splitCssProps } from '@stokelp/styled-system/jsx'\nimport { switchRecipe, type SwitchRecipeVariantProps } from '@stokelp/styled-system/recipes'\nimport type { Assign, JsxStyleProps } from '@stokelp/styled-system/types'\nimport { forwardRef, type ReactNode } from 'react'\n\nexport interface SwitchProps extends Assign<JsxStyleProps, SwitchRootProps>, SwitchRecipeVariantProps {\n children?: ReactNode\n}\n\nexport const Switch = forwardRef<HTMLLabelElement, SwitchProps>((props, ref) => {\n const [variantProps, switchProps] = switchRecipe.splitVariantProps(props)\n const [cssProps, localProps] = splitCssProps(switchProps)\n const { children, className, ...rootProps } = localProps\n const styles = switchRecipe(variantProps)\n\n return (\n <ArkSwitch.Root ref={ref} className={cx(styles.root, css(cssProps), className)} {...rootProps}>\n <ArkSwitch.Control className={styles.control}>\n <ArkSwitch.Thumb className={styles.thumb} />\n </ArkSwitch.Control>\n {children ? <ArkSwitch.Label className={styles.label}>{children}</ArkSwitch.Label> : null}\n <ArkSwitch.HiddenInput />\n </ArkSwitch.Root>\n )\n})\n\nSwitch.displayName = 'Switch'\n"],"mappings":"0NAWA,
|
|
1
|
+
{"version":3,"file":"Switch.cjs","names":["forwardRef","switchRecipe","splitCssProps","ArkSwitch","cx","css","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","_stokelp_styled_system_css","Switch","variantProps","switchProps","props","cssProps","localProps","rootProps","styles","className","children"],"sources":["../../../src/components/switch/Switch.tsx"],"sourcesContent":["import { Switch as ArkSwitch, type SwitchRootProps } from '@ark-ui/react'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { splitCssProps } from '@stokelp/styled-system/jsx'\nimport { switchRecipe, type SwitchRecipeVariantProps } from '@stokelp/styled-system/recipes'\nimport type { Assign, JsxStyleProps } from '@stokelp/styled-system/types'\nimport { forwardRef, type ReactNode } from 'react'\n\nexport interface SwitchProps extends Assign<JsxStyleProps, SwitchRootProps>, SwitchRecipeVariantProps {\n children?: ReactNode\n}\n\nexport const Switch = forwardRef<HTMLLabelElement, SwitchProps>((props, ref) => {\n const [variantProps, switchProps] = switchRecipe.splitVariantProps(props)\n const [cssProps, localProps] = splitCssProps(switchProps)\n const { children, className, ...rootProps } = localProps\n const styles = switchRecipe(variantProps)\n\n return (\n <ArkSwitch.Root ref={ref} className={cx(styles.root, css(cssProps), className)} {...rootProps}>\n <ArkSwitch.Control className={styles.control}>\n <ArkSwitch.Thumb className={styles.thumb} />\n </ArkSwitch.Control>\n {children ? <ArkSwitch.Label className={styles.label}>{children}</ArkSwitch.Label> : null}\n <ArkSwitch.HiddenInput />\n </ArkSwitch.Root>\n )\n})\n\nSwitch.displayName = 'Switch'\n"],"mappings":"A,0NAWA,IAAaY,GAAA,EAASZ,EAAAA,WAAAA,EAA2C,EAAO,IAAQ,CAC9E,GAAM,CAACa,EAAcC,GAAeb,EAAAA,aAAa,kBAAkBc,CAAK,EAClE,CAACC,EAAUC,IAAA,EAAcf,EAAAA,cAAAA,CAAcY,CAAW,EAClD,CAAE,WAAU,YAAW,GAAGI,GAAcD,EACxCE,GAAA,EAASlB,EAAAA,aAAAA,CAAaY,CAAY,EAExC,OACE,EAAAH,EAAA,KAAA,CAACP,EAAAA,OAAU,KAAX,CAAqB,MAAK,WAAA,EAAWC,EAAAA,GAAAA,CAAGe,EAAO,MAAA,EAAMd,EAAAA,IAAAA,CAAIW,CAAQ,EAAGI,CAAS,EAAG,GAAIF,EAApF,SAAA,EACE,EAAAR,EAAA,IAAA,CAACP,EAAAA,OAAU,QAAX,CAAmB,UAAWgB,EAAO,QACnC,UAAA,EAAAT,EAAA,IAAA,CAACP,EAAAA,OAAU,MAAX,CAAiB,UAAWgB,EAAO,KAAQ,CAAA,CAC1B,CAAA,EAClBE,GAAW,EAAAX,EAAA,IAAA,CAACP,EAAAA,OAAU,MAAX,CAAiB,UAAWgB,EAAO,MAAQ,UAA0B,CAAA,EAAI,MACrF,EAAAT,EAAA,IAAA,CAACP,EAAAA,OAAU,YAAX,CAAwB,CAAA,CACV,C,EAEpB,CAAC,EAED,EAAO,YAAc,S"}
|