@mozaic-ds/web-components 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Cross20.js +1 -1
- package/dist/Cross24.js +1 -1
- package/dist/CrossCircleFilled24.js +1 -1
- package/dist/Less24.js +2 -0
- package/dist/Less24.js.map +1 -0
- package/dist/attributes.js +1 -1
- package/dist/attributes.js.map +1 -1
- package/dist/bundle.d.ts +3 -0
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +3 -0
- package/dist/components/avatar/Avatar.js +2 -2
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/avatar/Avatar.stories.d.ts +2 -1
- package/dist/components/avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.stories.js +2 -1
- package/dist/components/avatar/Avatar.svelte +2 -2
- package/dist/components/breadcrumb/Breadcrumb.js +2 -2
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.stories.d.ts +1 -0
- package/dist/components/breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.stories.js +1 -0
- package/dist/components/breadcrumb/Breadcrumb.svelte +2 -2
- package/dist/components/button/Button.js +2 -2
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.stories.d.ts +2 -0
- package/dist/components/button/Button.stories.d.ts.map +1 -1
- package/dist/components/button/Button.stories.js +2 -0
- package/dist/components/button/Button.svelte +0 -1
- package/dist/components/button/Button.svelte.d.ts +0 -1
- package/dist/components/button/Button.svelte.d.ts.map +1 -1
- package/dist/components/callout/Callout.js +2 -2
- package/dist/components/callout/Callout.js.map +1 -1
- package/dist/components/callout/Callout.stories.d.ts +5 -2
- package/dist/components/callout/Callout.stories.d.ts.map +1 -1
- package/dist/components/callout/Callout.stories.js +5 -2
- package/dist/components/callout/Callout.svelte +2 -2
- package/dist/components/carousel/Carousel.js +4 -0
- package/dist/components/carousel/Carousel.js.map +1 -0
- package/dist/components/carousel/Carousel.spec.js +49 -0
- package/dist/components/carousel/Carousel.stories.d.ts +9 -0
- package/dist/components/carousel/Carousel.stories.d.ts.map +1 -0
- package/dist/components/carousel/Carousel.stories.js +72 -0
- package/dist/components/carousel/Carousel.svelte +187 -0
- package/dist/components/carousel/Carousel.svelte.d.ts +46 -0
- package/dist/components/carousel/Carousel.svelte.d.ts.map +1 -0
- package/dist/components/carousel/README.md +18 -0
- package/dist/components/checkbox/Checkbox.js +3 -3
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox/Checkbox.stories.d.ts +1 -0
- package/dist/components/checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/checkbox/Checkbox.stories.js +1 -0
- package/dist/components/checkbox/Checkbox.svelte +2 -0
- package/dist/components/checkbox/Checkbox.svelte.d.ts.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.js +4 -4
- package/dist/components/checkboxgroup/CheckboxGroup.js.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.stories.d.ts +1 -0
- package/dist/components/checkboxgroup/CheckboxGroup.stories.d.ts.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.stories.js +1 -0
- package/dist/components/checkboxgroup/CheckboxGroup.svelte +2 -2
- package/dist/components/circularprogressbar/CircularProgressbar.js +2 -2
- package/dist/components/circularprogressbar/CircularProgressbar.js.map +1 -1
- package/dist/components/circularprogressbar/CircularProgressbar.stories.d.ts +1 -0
- package/dist/components/circularprogressbar/CircularProgressbar.stories.d.ts.map +1 -1
- package/dist/components/circularprogressbar/CircularProgressbar.stories.js +1 -0
- package/dist/components/circularprogressbar/CircularProgressbar.svelte +0 -1
- package/dist/components/circularprogressbar/CircularProgressbar.svelte.d.ts +0 -1
- package/dist/components/circularprogressbar/CircularProgressbar.svelte.d.ts.map +1 -1
- package/dist/components/container/Container.js +2 -2
- package/dist/components/container/Container.stories.d.ts +1 -0
- package/dist/components/container/Container.stories.d.ts.map +1 -1
- package/dist/components/container/Container.stories.js +1 -0
- package/dist/components/datepicker/Datepicker.js +3 -3
- package/dist/components/datepicker/Datepicker.js.map +1 -1
- package/dist/components/datepicker/Datepicker.stories.d.ts +1 -0
- package/dist/components/datepicker/Datepicker.stories.d.ts.map +1 -1
- package/dist/components/datepicker/Datepicker.stories.js +1 -0
- package/dist/components/datepicker/Datepicker.svelte +2 -0
- package/dist/components/datepicker/Datepicker.svelte.d.ts.map +1 -1
- package/dist/components/divider/Divider.js +1 -1
- package/dist/components/divider/Divider.stories.d.ts +1 -0
- package/dist/components/divider/Divider.stories.d.ts.map +1 -1
- package/dist/components/divider/Divider.stories.js +1 -0
- package/dist/components/drawer/Drawer.js +2 -2
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/Drawer.stories.d.ts +2 -0
- package/dist/components/drawer/Drawer.stories.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.stories.js +2 -0
- package/dist/components/drawer/Drawer.svelte +12 -2
- package/dist/components/drawer/Drawer.svelte.d.ts.map +1 -1
- package/dist/components/field/Field.js +2 -2
- package/dist/components/field/Field.stories.d.ts +2 -0
- package/dist/components/field/Field.stories.d.ts.map +1 -1
- package/dist/components/field/Field.stories.js +2 -0
- package/dist/components/flag/Flag.js +2 -2
- package/dist/components/flag/Flag.js.map +1 -1
- package/dist/components/flag/Flag.stories.d.ts +1 -0
- package/dist/components/flag/Flag.stories.d.ts.map +1 -1
- package/dist/components/flag/Flag.stories.js +1 -0
- package/dist/components/flag/Flag.svelte +2 -2
- package/dist/components/iconbutton/IconButton.js +2 -2
- package/dist/components/iconbutton/IconButton.js.map +1 -1
- package/dist/components/iconbutton/IconButton.stories.d.ts +4 -2
- package/dist/components/iconbutton/IconButton.stories.d.ts.map +1 -1
- package/dist/components/iconbutton/IconButton.stories.js +4 -2
- package/dist/components/iconbutton/IconButton.svelte +0 -1
- package/dist/components/iconbutton/IconButton.svelte.d.ts +0 -1
- package/dist/components/iconbutton/IconButton.svelte.d.ts.map +1 -1
- package/dist/components/kpiitem/KpiItem.js +2 -2
- package/dist/components/kpiitem/KpiItem.js.map +1 -1
- package/dist/components/kpiitem/KpiItem.stories.d.ts +1 -0
- package/dist/components/kpiitem/KpiItem.stories.d.ts.map +1 -1
- package/dist/components/kpiitem/KpiItem.stories.js +1 -0
- package/dist/components/kpiitem/KpiItem.svelte +2 -2
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.js +2 -2
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.js.map +1 -1
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.stories.d.ts +1 -0
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.stories.d.ts.map +1 -1
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.stories.js +1 -0
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.svelte +2 -1
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.js +2 -2
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.js.map +1 -1
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.stories.d.ts +1 -0
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.stories.d.ts.map +1 -1
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.stories.js +1 -0
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.svelte +2 -1
- package/dist/components/link/Link.js +2 -2
- package/dist/components/link/Link.js.map +1 -1
- package/dist/components/link/Link.stories.d.ts +3 -0
- package/dist/components/link/Link.stories.d.ts.map +1 -1
- package/dist/components/link/Link.stories.js +3 -0
- package/dist/components/link/Link.svelte +2 -0
- package/dist/components/link/Link.svelte.d.ts.map +1 -1
- package/dist/components/loader/Loader.js +2 -2
- package/dist/components/loader/Loader.js.map +1 -1
- package/dist/components/loader/Loader.stories.d.ts +1 -0
- package/dist/components/loader/Loader.stories.d.ts.map +1 -1
- package/dist/components/loader/Loader.stories.js +1 -0
- package/dist/components/loader/Loader.svelte +2 -1
- package/dist/components/loadingoverlay/LoadingOverlay.js +2 -2
- package/dist/components/loadingoverlay/LoadingOverlay.js.map +1 -1
- package/dist/components/loadingoverlay/LoadingOverlay.stories.d.ts +1 -0
- package/dist/components/loadingoverlay/LoadingOverlay.stories.d.ts.map +1 -1
- package/dist/components/loadingoverlay/LoadingOverlay.stories.js +1 -0
- package/dist/components/loadingoverlay/LoadingOverlay.svelte +2 -2
- package/dist/components/modal/Modal.js +2 -2
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/Modal.stories.d.ts +5 -2
- package/dist/components/modal/Modal.stories.d.ts.map +1 -1
- package/dist/components/modal/Modal.stories.js +5 -2
- package/dist/components/modal/Modal.svelte +2 -1
- package/dist/components/numberbadge/NumberBadge.js +2 -2
- package/dist/components/numberbadge/NumberBadge.js.map +1 -1
- package/dist/components/numberbadge/NumberBadge.stories.d.ts +1 -0
- package/dist/components/numberbadge/NumberBadge.stories.d.ts.map +1 -1
- package/dist/components/numberbadge/NumberBadge.stories.js +1 -0
- package/dist/components/numberbadge/NumberBadge.svelte +5 -2
- package/dist/components/overlay/Overlay.js +2 -2
- package/dist/components/overlay/Overlay.stories.d.ts +1 -0
- package/dist/components/overlay/Overlay.stories.d.ts.map +1 -1
- package/dist/components/overlay/Overlay.stories.js +1 -0
- package/dist/components/pagination/Pagination.js +3 -3
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/Pagination.stories.d.ts +1 -0
- package/dist/components/pagination/Pagination.stories.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.stories.js +1 -0
- package/dist/components/passwordinput/PasswordInput.js +4 -3
- package/dist/components/passwordinput/PasswordInput.js.map +1 -1
- package/dist/components/passwordinput/PasswordInput.stories.d.ts +1 -0
- package/dist/components/passwordinput/PasswordInput.stories.d.ts.map +1 -1
- package/dist/components/passwordinput/PasswordInput.stories.js +1 -0
- package/dist/components/passwordinput/PasswordInput.svelte +2 -0
- package/dist/components/passwordinput/PasswordInput.svelte.d.ts.map +1 -1
- package/dist/components/phonenumber/PhoneNumber.js +22 -0
- package/dist/components/phonenumber/PhoneNumber.js.map +1 -0
- package/dist/components/phonenumber/PhoneNumber.spec.js +103 -0
- package/dist/components/phonenumber/PhoneNumber.stories.d.ts +14 -0
- package/dist/components/phonenumber/PhoneNumber.stories.d.ts.map +1 -0
- package/dist/components/phonenumber/PhoneNumber.stories.js +116 -0
- package/dist/components/phonenumber/PhoneNumber.svelte +896 -0
- package/dist/components/phonenumber/PhoneNumber.svelte.d.ts +60 -0
- package/dist/components/phonenumber/PhoneNumber.svelte.d.ts.map +1 -0
- package/dist/components/phonenumber/README.md +27 -0
- package/dist/components/pincode/Pincode.js +2 -2
- package/dist/components/pincode/Pincode.stories.d.ts +1 -0
- package/dist/components/pincode/Pincode.stories.d.ts.map +1 -1
- package/dist/components/pincode/Pincode.stories.js +1 -0
- package/dist/components/quantityselector/QuantitySelector.js +2 -2
- package/dist/components/quantityselector/QuantitySelector.js.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.stories.d.ts +1 -0
- package/dist/components/quantityselector/QuantitySelector.stories.d.ts.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.stories.js +1 -0
- package/dist/components/quantityselector/QuantitySelector.svelte +6 -2
- package/dist/components/quantityselector/QuantitySelector.svelte.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +2 -2
- package/dist/components/radio/Radio.js.map +1 -1
- package/dist/components/radio/Radio.stories.d.ts +1 -0
- package/dist/components/radio/Radio.stories.d.ts.map +1 -1
- package/dist/components/radio/Radio.stories.js +1 -0
- package/dist/components/radio/Radio.svelte +10 -1
- package/dist/components/radio/Radio.svelte.d.ts.map +1 -1
- package/dist/components/radiogroup/RadioGroup.js +1 -1
- package/dist/components/radiogroup/RadioGroup.stories.d.ts +1 -0
- package/dist/components/radiogroup/RadioGroup.stories.d.ts.map +1 -1
- package/dist/components/radiogroup/RadioGroup.stories.js +1 -0
- package/dist/components/segmentedcontrol/SegmentedControl.js +2 -2
- package/dist/components/segmentedcontrol/SegmentedControl.stories.d.ts +1 -0
- package/dist/components/segmentedcontrol/SegmentedControl.stories.d.ts.map +1 -1
- package/dist/components/segmentedcontrol/SegmentedControl.stories.js +1 -0
- package/dist/components/select/Select.js +2 -2
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/Select.stories.d.ts +1 -0
- package/dist/components/select/Select.stories.d.ts.map +1 -1
- package/dist/components/select/Select.stories.js +1 -0
- package/dist/components/select/Select.svelte +2 -0
- package/dist/components/select/Select.svelte.d.ts.map +1 -1
- package/dist/components/starrating/README.md +22 -0
- package/dist/components/starrating/StarRating.js +4 -0
- package/dist/components/starrating/StarRating.js.map +1 -0
- package/dist/components/starrating/StarRating.spec.js +108 -0
- package/dist/components/starrating/StarRating.stories.d.ts +13 -0
- package/dist/components/starrating/StarRating.stories.d.ts.map +1 -0
- package/dist/components/starrating/StarRating.stories.js +82 -0
- package/dist/components/starrating/StarRating.svelte +227 -0
- package/dist/components/starrating/StarRating.svelte.d.ts +46 -0
- package/dist/components/starrating/StarRating.svelte.d.ts.map +1 -0
- package/dist/components/statusbadge/StatusBadge.js +2 -2
- package/dist/components/statusbadge/StatusBadge.js.map +1 -1
- package/dist/components/statusbadge/StatusBadge.stories.d.ts +1 -0
- package/dist/components/statusbadge/StatusBadge.stories.d.ts.map +1 -1
- package/dist/components/statusbadge/StatusBadge.stories.js +1 -0
- package/dist/components/statusbadge/StatusBadge.svelte +2 -2
- package/dist/components/statusdot/StatusDot.js +2 -2
- package/dist/components/statusdot/StatusDot.js.map +1 -1
- package/dist/components/statusdot/StatusDot.stories.d.ts +1 -0
- package/dist/components/statusdot/StatusDot.stories.d.ts.map +1 -1
- package/dist/components/statusdot/StatusDot.stories.js +1 -0
- package/dist/components/statusdot/StatusDot.svelte +5 -2
- package/dist/components/statusmessage/StatusMessage.js +2 -2
- package/dist/components/statusmessage/StatusMessage.js.map +1 -1
- package/dist/components/statusmessage/StatusMessage.stories.d.ts +1 -0
- package/dist/components/statusmessage/StatusMessage.stories.d.ts.map +1 -1
- package/dist/components/statusmessage/StatusMessage.stories.js +1 -0
- package/dist/components/statusmessage/StatusMessage.svelte +2 -2
- package/dist/components/statusnotification/StatusNotification.js +2 -2
- package/dist/components/statusnotification/StatusNotification.js.map +1 -1
- package/dist/components/statusnotification/StatusNotification.stories.d.ts +4 -0
- package/dist/components/statusnotification/StatusNotification.stories.d.ts.map +1 -1
- package/dist/components/statusnotification/StatusNotification.stories.js +4 -0
- package/dist/components/statusnotification/StatusNotification.svelte +2 -1
- package/dist/components/steppercompact/StepperCompact.js +2 -2
- package/dist/components/steppercompact/StepperCompact.stories.d.ts +1 -0
- package/dist/components/steppercompact/StepperCompact.stories.d.ts.map +1 -1
- package/dist/components/steppercompact/StepperCompact.stories.js +1 -0
- package/dist/components/tab/Tab.js +1 -1
- package/dist/components/tab/Tab.js.map +1 -1
- package/dist/components/tab/Tab.svelte +0 -1
- package/dist/components/tab/Tab.svelte.d.ts +0 -1
- package/dist/components/tab/Tab.svelte.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +2 -2
- package/dist/components/tabs/Tabs.stories.d.ts +3 -0
- package/dist/components/tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.stories.js +3 -0
- package/dist/components/tag/Tag.js +2 -2
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/tag/Tag.stories.d.ts +1 -0
- package/dist/components/tag/Tag.stories.d.ts.map +1 -1
- package/dist/components/tag/Tag.stories.js +1 -0
- package/dist/components/tag/Tag.svelte +15 -4
- package/dist/components/tag/Tag.svelte.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +2 -2
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea/Textarea.stories.d.ts +1 -0
- package/dist/components/textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.stories.js +1 -0
- package/dist/components/textarea/Textarea.svelte +2 -0
- package/dist/components/textarea/Textarea.svelte.d.ts.map +1 -1
- package/dist/components/textinput/Textinput.js +2 -2
- package/dist/components/textinput/Textinput.js.map +1 -1
- package/dist/components/textinput/Textinput.stories.d.ts +1 -0
- package/dist/components/textinput/Textinput.stories.d.ts.map +1 -1
- package/dist/components/textinput/Textinput.stories.js +1 -0
- package/dist/components/textinput/Textinput.svelte +2 -0
- package/dist/components/textinput/Textinput.svelte.d.ts.map +1 -1
- package/dist/components/toaster/Toaster.js +2 -2
- package/dist/components/toaster/Toaster.js.map +1 -1
- package/dist/components/toaster/Toaster.stories.d.ts +3 -0
- package/dist/components/toaster/Toaster.stories.d.ts.map +1 -1
- package/dist/components/toaster/Toaster.stories.js +3 -0
- package/dist/components/toaster/Toaster.svelte +2 -0
- package/dist/components/toaster/Toaster.svelte.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.js +2 -2
- package/dist/components/toggle/Toggle.js.map +1 -1
- package/dist/components/toggle/Toggle.stories.d.ts +1 -0
- package/dist/components/toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.stories.js +1 -0
- package/dist/components/toggle/Toggle.svelte +18 -2
- package/dist/components/toggle/Toggle.svelte.d.ts.map +1 -1
- package/dist/components/togglegroup/ToggleGroup.js +2 -2
- package/dist/components/togglegroup/ToggleGroup.stories.d.ts +1 -0
- package/dist/components/togglegroup/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/components/togglegroup/ToggleGroup.stories.js +1 -0
- package/dist/components/tooltip/Tooltip.js +2 -2
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/tooltip/Tooltip.stories.d.ts +1 -0
- package/dist/components/tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.stories.js +1 -0
- package/dist/components/tooltip/Tooltip.svelte +2 -1
- package/dist/custom-element.js +3 -3
- package/dist/custom-element.js.map +1 -1
- package/dist/each.js +1 -1
- package/dist/each.js.map +1 -1
- package/dist/if.js +1 -1
- package/dist/if.js.map +1 -1
- package/dist/input.js +1 -1
- package/dist/input.js.map +1 -1
- package/dist/legacy.js +1 -1
- package/dist/main.d.ts +4 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -1
- package/dist/slot.js +1 -1
- package/dist/svelte-component.js +1 -1
- package/dist/this.js +1 -1
- package/dist/this.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,896 @@
|
|
|
1
|
+
<svelte:options
|
|
2
|
+
customElement={{
|
|
3
|
+
tag: 'm-phone-number',
|
|
4
|
+
extend: customElementForwardEvents,
|
|
5
|
+
}}
|
|
6
|
+
/>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { customElementForwardEvents } from '../../utils';
|
|
10
|
+
import {
|
|
11
|
+
parsePhoneNumberFromString,
|
|
12
|
+
isValidPhoneNumber,
|
|
13
|
+
getCountries,
|
|
14
|
+
getCountryCallingCode,
|
|
15
|
+
getExampleNumber,
|
|
16
|
+
type CountryCode,
|
|
17
|
+
} from 'libphonenumber-js';
|
|
18
|
+
import examples from 'libphonenumber-js/mobile/examples';
|
|
19
|
+
import ChevronDown20 from '@mozaic-ds/icons-svelte/svelte/ChevronDown20/ChevronDown20.svelte';
|
|
20
|
+
/**
|
|
21
|
+
* A phone number input is a specialized input field designed to capture and validate phone numbers, ensuring correct formatting based on country-specific dialing codes. It often includes a country selector that automatically adjusts the international dialing code. This component improves user experience by standardizing phone number entries, reducing errors, and facilitating global compatibility. It is commonly used in registration forms, authentication flows, and contact information fields.
|
|
22
|
+
*
|
|
23
|
+
* @event valid {CustomEvent<boolean>} - Emits the validity of the value when the PhoneNumber changes.
|
|
24
|
+
*/
|
|
25
|
+
interface Props {
|
|
26
|
+
/**
|
|
27
|
+
* A unique identifier for the phone number input element, used to associate the label with the form element.
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* The current value of the phone number input field.
|
|
32
|
+
*/
|
|
33
|
+
value?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Default country code for phone number formatting (e.g., 'FR', 'US', 'PT').
|
|
36
|
+
*/
|
|
37
|
+
defaultcountry?: CountryCode;
|
|
38
|
+
/**
|
|
39
|
+
* A placeholder text to show in the phone number input when it is empty.
|
|
40
|
+
*/
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Determines the size of the phone number input.
|
|
44
|
+
*/
|
|
45
|
+
size?: 's' | 'm';
|
|
46
|
+
/**
|
|
47
|
+
* If `true`, applies an invalid state to the password input.
|
|
48
|
+
*/
|
|
49
|
+
isinvalid?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* If `true`, disables the input, making it non-interactive.
|
|
52
|
+
*/
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* If `true`, the input is read-only (cannot be edited).
|
|
56
|
+
*/
|
|
57
|
+
readonly?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* If `true`, display the country calling code prefix (+33, +1, etc.).
|
|
60
|
+
*/
|
|
61
|
+
prefix?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* If `true`, display the country flag selector
|
|
64
|
+
*/
|
|
65
|
+
flag?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Locale for displaying country names (e.g., 'fr', 'en', 'es', 'pt').
|
|
68
|
+
*/
|
|
69
|
+
locale?: string;
|
|
70
|
+
/**
|
|
71
|
+
* List of country codes to display in the selector. If not provided, all countries will be shown.
|
|
72
|
+
*/
|
|
73
|
+
countrycodes?: CountryCode[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let {
|
|
77
|
+
id,
|
|
78
|
+
value = $bindable(''),
|
|
79
|
+
defaultcountry = 'FR',
|
|
80
|
+
placeholder = '',
|
|
81
|
+
size = 'm',
|
|
82
|
+
isinvalid,
|
|
83
|
+
disabled,
|
|
84
|
+
readonly,
|
|
85
|
+
prefix = true,
|
|
86
|
+
flag = true,
|
|
87
|
+
locale = 'en',
|
|
88
|
+
countrycodes,
|
|
89
|
+
...attrs
|
|
90
|
+
}: Props = $props();
|
|
91
|
+
let element: HTMLElement;
|
|
92
|
+
|
|
93
|
+
let phoneNumber: string = $state(value);
|
|
94
|
+
let selectedCountry: CountryCode = $state(defaultcountry);
|
|
95
|
+
|
|
96
|
+
$effect(() => {
|
|
97
|
+
value = phoneNumber;
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const countries: CountryCode[] = countrycodes || getCountries();
|
|
101
|
+
|
|
102
|
+
const dynamicPlaceholder = () => {
|
|
103
|
+
if (placeholder) return placeholder;
|
|
104
|
+
return getExampleNumber(selectedCountry, examples)?.formatNational() ?? '';
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const getCountryName = (cc: CountryCode) => {
|
|
108
|
+
try {
|
|
109
|
+
const dn = new Intl.DisplayNames([locale], { type: 'region' });
|
|
110
|
+
return dn.of(cc) || cc;
|
|
111
|
+
} catch {
|
|
112
|
+
return cc;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const getFlagUrl = (cc: CountryCode) => `https://flagcdn.com/${cc.toLowerCase()}.svg`;
|
|
117
|
+
|
|
118
|
+
const valid = () => {
|
|
119
|
+
if (!phoneNumber) return false;
|
|
120
|
+
try {
|
|
121
|
+
return isValidPhoneNumber(phoneNumber, selectedCountry);
|
|
122
|
+
} catch {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
$effect(() => {
|
|
128
|
+
const event = new CustomEvent('valid', {
|
|
129
|
+
detail: valid(),
|
|
130
|
+
bubbles: true,
|
|
131
|
+
composed: true,
|
|
132
|
+
});
|
|
133
|
+
element.dispatchEvent(event);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
$effect(() => {
|
|
137
|
+
if (value && value !== phoneNumber) {
|
|
138
|
+
if (value.startsWith('+')) {
|
|
139
|
+
try {
|
|
140
|
+
const parsed = parsePhoneNumberFromString(value, selectedCountry);
|
|
141
|
+
phoneNumber = parsed ? parsed.formatNational() : value;
|
|
142
|
+
} catch {
|
|
143
|
+
phoneNumber = value;
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
phoneNumber = value;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (!value) phoneNumber = '';
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
function handleInput(e: Event) {
|
|
153
|
+
const input = e.target as HTMLInputElement;
|
|
154
|
+
const raw = input.value;
|
|
155
|
+
const sanitized = raw.replace(/[^0-9+\s()-]/g, '');
|
|
156
|
+
phoneNumber = sanitized;
|
|
157
|
+
if (sanitized !== raw) input.value = sanitized;
|
|
158
|
+
}
|
|
159
|
+
</script>
|
|
160
|
+
|
|
161
|
+
<div id="mc-phone-number-input" class="mc-phone-number-input" bind:this={element}>
|
|
162
|
+
<div
|
|
163
|
+
class={[
|
|
164
|
+
'mc-phone-number-input__select-wrapper',
|
|
165
|
+
!flag && 'mc-phone-number-input__select-wrapper--hidden',
|
|
166
|
+
]}
|
|
167
|
+
>
|
|
168
|
+
<select
|
|
169
|
+
id="selectComponentId"
|
|
170
|
+
class={['mc-select', 'mc-phone-number-input__select', size !== 'm' && `mc-select--${size}`]}
|
|
171
|
+
bind:value={selectedCountry}
|
|
172
|
+
{disabled}
|
|
173
|
+
name="country-select"
|
|
174
|
+
>
|
|
175
|
+
<option value="" selected hidden></option>
|
|
176
|
+
|
|
177
|
+
{#each countries as country, index (index)}
|
|
178
|
+
<option value={country} data-flag={country.toLowerCase()}>
|
|
179
|
+
{getCountryName(country)} (+{getCountryCallingCode(country)})
|
|
180
|
+
</option>
|
|
181
|
+
{/each}
|
|
182
|
+
</select>
|
|
183
|
+
|
|
184
|
+
<div class="mc-phone-number-input__select-display">
|
|
185
|
+
<div class="mc-phone-number-input__flag">
|
|
186
|
+
{#if selectedCountry}
|
|
187
|
+
<img
|
|
188
|
+
class="mc-phone-number-input__flag-image"
|
|
189
|
+
src={getFlagUrl(selectedCountry)}
|
|
190
|
+
alt={getCountryName(selectedCountry)}
|
|
191
|
+
width="20"
|
|
192
|
+
/>
|
|
193
|
+
{/if}
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<span class="mc-phone-number-input__chevron">
|
|
197
|
+
<ChevronDown20 aria-hidden="true" />
|
|
198
|
+
</span>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div
|
|
203
|
+
class={[
|
|
204
|
+
'mc-text-input',
|
|
205
|
+
'mc-phone-number-input__input',
|
|
206
|
+
size !== 'm' && `mc-text-input--${size}`,
|
|
207
|
+
(isinvalid || (phoneNumber && !valid())) && 'is-invalid',
|
|
208
|
+
]}
|
|
209
|
+
>
|
|
210
|
+
{#if prefix}
|
|
211
|
+
<span class="mc-phone-number-input__country-code">
|
|
212
|
+
+{getCountryCallingCode(selectedCountry)}
|
|
213
|
+
</span>
|
|
214
|
+
{/if}
|
|
215
|
+
|
|
216
|
+
<input
|
|
217
|
+
type="tel"
|
|
218
|
+
bind:value={phoneNumber}
|
|
219
|
+
{id}
|
|
220
|
+
class="mc-phone-number-input__control mc-text-input__control"
|
|
221
|
+
placeholder={dynamicPlaceholder()}
|
|
222
|
+
name="phone-number"
|
|
223
|
+
aria-invalid={isinvalid}
|
|
224
|
+
{disabled}
|
|
225
|
+
{readonly}
|
|
226
|
+
oninput={handleInput}
|
|
227
|
+
{...attrs}
|
|
228
|
+
/>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
<style>/**
|
|
233
|
+
* Do not edit directly, this file was auto-generated.
|
|
234
|
+
*/
|
|
235
|
+
/* stylelint-disable string-no-newline */
|
|
236
|
+
.mc-text-input {
|
|
237
|
+
transition: box-shadow 200ms ease;
|
|
238
|
+
background-color: var(--forms-color-background-default, #ffffff);
|
|
239
|
+
border: var(--border-width-s, 0.0625rem) solid var(--forms-color-border-default, #666666);
|
|
240
|
+
border-radius: var(--forms-border-radius, 0.25rem);
|
|
241
|
+
transition: all ease 200ms;
|
|
242
|
+
color: var(--forms-color-text-default, #000000);
|
|
243
|
+
display: block;
|
|
244
|
+
width: 100%;
|
|
245
|
+
height: 3rem;
|
|
246
|
+
box-sizing: border-box;
|
|
247
|
+
display: flex;
|
|
248
|
+
align-items: center;
|
|
249
|
+
gap: 0.5rem;
|
|
250
|
+
}
|
|
251
|
+
.mc-text-input__control {
|
|
252
|
+
background-color: transparent;
|
|
253
|
+
border-width: 0;
|
|
254
|
+
font-family: inherit;
|
|
255
|
+
outline: none;
|
|
256
|
+
}
|
|
257
|
+
.mc-text-input__control[type=number] {
|
|
258
|
+
/* For Blink & WebKit rendering engines */
|
|
259
|
+
}
|
|
260
|
+
.mc-text-input__control[type=number]::-webkit-inner-spin-button, .mc-text-input__control[type=number]::-webkit-outer-spin-button {
|
|
261
|
+
appearance: none;
|
|
262
|
+
margin: 0;
|
|
263
|
+
}
|
|
264
|
+
.mc-text-input__control[type=number] {
|
|
265
|
+
/* For Gecko rendering engine */
|
|
266
|
+
appearance: textfield;
|
|
267
|
+
}
|
|
268
|
+
.mc-text-input__control[type=search]::-webkit-search-decoration, .mc-text-input__control[type=search]::-webkit-search-cancel-button {
|
|
269
|
+
appearance: none;
|
|
270
|
+
}
|
|
271
|
+
.mc-text-input__control {
|
|
272
|
+
padding: 0.75rem 0.6875rem;
|
|
273
|
+
font-size: var(--font-size-150, 1rem);
|
|
274
|
+
line-height: var(--line-height-s, 1.3);
|
|
275
|
+
font-weight: var(--font-weight-regular, 400);
|
|
276
|
+
flex-grow: 1;
|
|
277
|
+
}
|
|
278
|
+
.mc-text-input__control::placeholder {
|
|
279
|
+
color: var(--forms-color-placeholder, #666666);
|
|
280
|
+
}
|
|
281
|
+
.mc-text-input__icon {
|
|
282
|
+
fill: var(--forms-color-icon-default, #666666);
|
|
283
|
+
height: 1.5rem;
|
|
284
|
+
width: 1.5rem;
|
|
285
|
+
flex-shrink: 0;
|
|
286
|
+
}
|
|
287
|
+
.mc-text-input:focus-within {
|
|
288
|
+
box-shadow: 0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));
|
|
289
|
+
outline: 0.125rem solid transparent;
|
|
290
|
+
outline-offset: 0.125rem;
|
|
291
|
+
}
|
|
292
|
+
.mc-text-input:hover:not(:focus-within) {
|
|
293
|
+
border-color: var(--forms-color-border-hover, #4d4d4d);
|
|
294
|
+
box-shadow: 0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-hover, #4d4d4d);
|
|
295
|
+
}
|
|
296
|
+
.mc-text-input:has(input:disabled) {
|
|
297
|
+
background-color: var(--forms-color-background-disabled, #d9d9d9);
|
|
298
|
+
cursor: not-allowed;
|
|
299
|
+
border-color: transparent;
|
|
300
|
+
box-shadow: none;
|
|
301
|
+
color: var(--forms-color-text-disabled, #737373);
|
|
302
|
+
pointer-events: none;
|
|
303
|
+
}
|
|
304
|
+
.mc-text-input:has(input[readonly]) {
|
|
305
|
+
border-color: var(--forms-color-border-read-only, #cccccc);
|
|
306
|
+
pointer-events: none;
|
|
307
|
+
}
|
|
308
|
+
.mc-text-input:has(.mc-text-input__icon) {
|
|
309
|
+
padding-inline-start: 0.6875rem;
|
|
310
|
+
}
|
|
311
|
+
.mc-text-input:has(.mc-text-input__icon) .mc-text-input__control {
|
|
312
|
+
padding-inline-start: 0;
|
|
313
|
+
}
|
|
314
|
+
.mc-text-input:has(.mc-controls-options) {
|
|
315
|
+
padding-inline-end: 0.6875rem;
|
|
316
|
+
}
|
|
317
|
+
.mc-text-input:has(.mc-controls-options) .mc-text-input__control {
|
|
318
|
+
padding-inline-end: 0;
|
|
319
|
+
}
|
|
320
|
+
.mc-text-input--s {
|
|
321
|
+
height: 2rem;
|
|
322
|
+
}
|
|
323
|
+
.mc-text-input--s .mc-text-input__control {
|
|
324
|
+
padding: 0.375rem 0.6875rem;
|
|
325
|
+
font-size: var(--font-size-100, 0.875rem);
|
|
326
|
+
line-height: var(--line-height-s, 1.3);
|
|
327
|
+
}
|
|
328
|
+
.mc-text-input--s:has(.mc-text-input__icon) {
|
|
329
|
+
padding-inline-start: 0.4375rem;
|
|
330
|
+
}
|
|
331
|
+
.mc-text-input--s:has(.mc-controls-options) {
|
|
332
|
+
padding-inline-end: 0.4375rem;
|
|
333
|
+
}
|
|
334
|
+
.mc-text-input.is-invalid {
|
|
335
|
+
border-color: var(--forms-color-border-invalid, #ea302d);
|
|
336
|
+
box-shadow: 0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-invalid, #ea302d);
|
|
337
|
+
}
|
|
338
|
+
.mc-text-input.is-invalid:hover:not(:focus-within) {
|
|
339
|
+
border-color: var(--forms-color-border-invalid-hover, #c61112);
|
|
340
|
+
box-shadow: 0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-invalid-hover, #c61112);
|
|
341
|
+
}
|
|
342
|
+
.mc-text-input * {
|
|
343
|
+
box-sizing: border-box;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/* stylelint-enable string-no-newline */
|
|
347
|
+
.mc-button {
|
|
348
|
+
color: var(--button-color-filled-standard-font, #ffffff);
|
|
349
|
+
background-color: var(--button-color-filled-standard-background, #464e63);
|
|
350
|
+
}
|
|
351
|
+
.mc-button:hover {
|
|
352
|
+
background-color: var(--button-color-filled-standard-hover-background, #343b4c);
|
|
353
|
+
}
|
|
354
|
+
.mc-button:active {
|
|
355
|
+
background-color: var(--button-color-filled-standard-active-background, #242938);
|
|
356
|
+
}
|
|
357
|
+
.mc-button:disabled {
|
|
358
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
359
|
+
border-color: transparent;
|
|
360
|
+
color: var(--button-state-disabled-color, #737373);
|
|
361
|
+
cursor: not-allowed;
|
|
362
|
+
}
|
|
363
|
+
.mc-button {
|
|
364
|
+
font-weight: var(--font-weight-semi-bold, 600);
|
|
365
|
+
padding: 0 calc(1rem - 0.125rem);
|
|
366
|
+
min-height: 3rem;
|
|
367
|
+
min-width: 3rem;
|
|
368
|
+
}
|
|
369
|
+
.mc-button .mc-button__label {
|
|
370
|
+
font-size: var(--font-size-150, 1rem);
|
|
371
|
+
}
|
|
372
|
+
.mc-button {
|
|
373
|
+
display: inline-flex;
|
|
374
|
+
justify-content: center;
|
|
375
|
+
vertical-align: middle;
|
|
376
|
+
text-align: center;
|
|
377
|
+
border: 2px solid transparent;
|
|
378
|
+
border-radius: var(--button-border-radius-s, 0.25rem);
|
|
379
|
+
transition: all ease 200ms;
|
|
380
|
+
transition: box-shadow 200ms ease;
|
|
381
|
+
align-items: center;
|
|
382
|
+
box-sizing: border-box;
|
|
383
|
+
font-family: inherit;
|
|
384
|
+
fill: currentcolor;
|
|
385
|
+
gap: 0.25rem;
|
|
386
|
+
cursor: pointer;
|
|
387
|
+
}
|
|
388
|
+
.mc-button__label {
|
|
389
|
+
font-size: var(--font-size-150, 1rem);
|
|
390
|
+
}
|
|
391
|
+
.mc-button__icon {
|
|
392
|
+
flex-shrink: 0;
|
|
393
|
+
width: 1.5rem;
|
|
394
|
+
height: 1.5rem;
|
|
395
|
+
}
|
|
396
|
+
.mc-button:disabled {
|
|
397
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
398
|
+
border-color: transparent;
|
|
399
|
+
color: var(--button-state-disabled-color, #737373);
|
|
400
|
+
cursor: not-allowed;
|
|
401
|
+
}
|
|
402
|
+
.mc-button:focus-visible {
|
|
403
|
+
box-shadow: 0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));
|
|
404
|
+
outline: 0.125rem solid transparent;
|
|
405
|
+
outline-offset: 0.125rem;
|
|
406
|
+
}
|
|
407
|
+
.mc-button--s {
|
|
408
|
+
padding: 0 calc(0.75rem - 0.125rem);
|
|
409
|
+
min-height: 2rem;
|
|
410
|
+
min-width: 2rem;
|
|
411
|
+
}
|
|
412
|
+
.mc-button--s .mc-button__label {
|
|
413
|
+
font-size: var(--font-size-100, 0.875rem);
|
|
414
|
+
}
|
|
415
|
+
.mc-button--s .mc-button__icon {
|
|
416
|
+
width: 1.25rem;
|
|
417
|
+
height: 1.25rem;
|
|
418
|
+
}
|
|
419
|
+
.mc-button--s .mc-button__icon:only-child {
|
|
420
|
+
width: 1.25rem;
|
|
421
|
+
height: 1.25rem;
|
|
422
|
+
}
|
|
423
|
+
.mc-button--m {
|
|
424
|
+
padding: 0 calc(1rem - 0.125rem);
|
|
425
|
+
min-height: 3rem;
|
|
426
|
+
min-width: 3rem;
|
|
427
|
+
}
|
|
428
|
+
.mc-button--m .mc-button__label {
|
|
429
|
+
font-size: var(--font-size-150, 1rem);
|
|
430
|
+
}
|
|
431
|
+
.mc-button--m .mc-button__icon {
|
|
432
|
+
width: 1.5rem;
|
|
433
|
+
height: 1.5rem;
|
|
434
|
+
}
|
|
435
|
+
.mc-button--m .mc-button__icon:only-child {
|
|
436
|
+
width: 1.5rem;
|
|
437
|
+
height: 1.5rem;
|
|
438
|
+
}
|
|
439
|
+
.mc-button--l {
|
|
440
|
+
padding: 0 calc(1.25rem - 0.125rem);
|
|
441
|
+
min-height: 4rem;
|
|
442
|
+
min-width: 4rem;
|
|
443
|
+
}
|
|
444
|
+
.mc-button--l .mc-button__label {
|
|
445
|
+
font-size: var(--font-size-200, 1.125rem);
|
|
446
|
+
}
|
|
447
|
+
.mc-button--l .mc-button__icon {
|
|
448
|
+
width: 2rem;
|
|
449
|
+
height: 2rem;
|
|
450
|
+
}
|
|
451
|
+
.mc-button--l .mc-button__icon:only-child {
|
|
452
|
+
width: 2rem;
|
|
453
|
+
height: 2rem;
|
|
454
|
+
}
|
|
455
|
+
.mc-button--icon-only {
|
|
456
|
+
padding: 0.25rem;
|
|
457
|
+
}
|
|
458
|
+
.mc-button--outlined {
|
|
459
|
+
color: var(--button-color-outlined-standard-font, #242938);
|
|
460
|
+
border-color: var(--button-color-outlined-standard-border, #8891aa);
|
|
461
|
+
background-color: var(--button-color-outlined-standard-background, #ffffff);
|
|
462
|
+
}
|
|
463
|
+
.mc-button--outlined:hover {
|
|
464
|
+
background-color: var(--button-color-outlined-standard-hover-background, #eff1f6);
|
|
465
|
+
}
|
|
466
|
+
.mc-button--outlined:active {
|
|
467
|
+
background-color: var(--button-color-outlined-standard-active-background, #c9d0de);
|
|
468
|
+
}
|
|
469
|
+
.mc-button--outlined:disabled {
|
|
470
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
471
|
+
border-color: transparent;
|
|
472
|
+
color: var(--button-state-disabled-color, #737373);
|
|
473
|
+
cursor: not-allowed;
|
|
474
|
+
}
|
|
475
|
+
.mc-button--ghost {
|
|
476
|
+
color: var(--button-color-ghost-standard-font, #242938);
|
|
477
|
+
background-color: var(--button-color-ghost-standard-background, rgba(255, 255, 255, 0.01));
|
|
478
|
+
}
|
|
479
|
+
.mc-button--ghost:hover {
|
|
480
|
+
background-color: var(--button-color-ghost-standard-hover-background, rgba(70, 78, 99, 0.1));
|
|
481
|
+
}
|
|
482
|
+
.mc-button--ghost:active {
|
|
483
|
+
background-color: var(--button-color-ghost-standard-active-background, rgba(70, 78, 99, 0.2));
|
|
484
|
+
}
|
|
485
|
+
.mc-button--ghost:disabled {
|
|
486
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
487
|
+
border-color: transparent;
|
|
488
|
+
color: var(--button-state-disabled-color, #737373);
|
|
489
|
+
cursor: not-allowed;
|
|
490
|
+
}
|
|
491
|
+
.mc-button--accent {
|
|
492
|
+
color: var(--button-color-filled-accent-font, #ffffff);
|
|
493
|
+
background-color: var(--button-color-filled-accent-background, #117f03);
|
|
494
|
+
}
|
|
495
|
+
.mc-button--accent:hover {
|
|
496
|
+
background-color: var(--button-color-filled-accent-hover-background, #006902);
|
|
497
|
+
}
|
|
498
|
+
.mc-button--accent:active {
|
|
499
|
+
background-color: var(--button-color-filled-accent-active-background, #035010);
|
|
500
|
+
}
|
|
501
|
+
.mc-button--accent:disabled {
|
|
502
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
503
|
+
border-color: transparent;
|
|
504
|
+
color: var(--button-state-disabled-color, #737373);
|
|
505
|
+
cursor: not-allowed;
|
|
506
|
+
}
|
|
507
|
+
.mc-button--danger {
|
|
508
|
+
color: var(--button-color-filled-danger-font, #ffffff);
|
|
509
|
+
background-color: var(--button-color-filled-danger-background, #c61112);
|
|
510
|
+
}
|
|
511
|
+
.mc-button--danger:hover {
|
|
512
|
+
background-color: var(--button-color-filled-danger-hover-background, #8c0003);
|
|
513
|
+
}
|
|
514
|
+
.mc-button--danger:active {
|
|
515
|
+
background-color: var(--button-color-filled-danger-active-background, #530000);
|
|
516
|
+
}
|
|
517
|
+
.mc-button--danger:disabled {
|
|
518
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
519
|
+
border-color: transparent;
|
|
520
|
+
color: var(--button-state-disabled-color, #737373);
|
|
521
|
+
cursor: not-allowed;
|
|
522
|
+
}
|
|
523
|
+
.mc-button--inverse {
|
|
524
|
+
--focus-color-mid: var(--focus-color-outline-outer, #000000);
|
|
525
|
+
--focus-color-outer: var(--focus-color-outline-mid, #ffffff);
|
|
526
|
+
color: var(--button-color-filled-inverse-font, #242938);
|
|
527
|
+
background-color: var(--button-color-filled-inverse-background, #ffffff);
|
|
528
|
+
}
|
|
529
|
+
.mc-button--inverse:hover {
|
|
530
|
+
background-color: var(--button-color-filled-inverse-hover-background, #e6e6e6);
|
|
531
|
+
}
|
|
532
|
+
.mc-button--inverse:active {
|
|
533
|
+
background-color: var(--button-color-filled-inverse-active-background, #cccccc);
|
|
534
|
+
}
|
|
535
|
+
.mc-button--inverse:disabled {
|
|
536
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
537
|
+
border-color: transparent;
|
|
538
|
+
color: var(--button-state-disabled-color, #737373);
|
|
539
|
+
cursor: not-allowed;
|
|
540
|
+
}
|
|
541
|
+
.mc-button--icon-button {
|
|
542
|
+
border-radius: var(--border-radius-full, 100%);
|
|
543
|
+
padding: 0;
|
|
544
|
+
}
|
|
545
|
+
.mc-button--loading .mc-button__loader {
|
|
546
|
+
position: absolute;
|
|
547
|
+
color: currentcolor;
|
|
548
|
+
}
|
|
549
|
+
.mc-button--loading .mc-button__label,
|
|
550
|
+
.mc-button--loading .mc-button__icon {
|
|
551
|
+
visibility: hidden;
|
|
552
|
+
}
|
|
553
|
+
.mc-button--outlined.mc-button--standard {
|
|
554
|
+
color: var(--button-color-outlined-standard-font, #242938);
|
|
555
|
+
border-color: var(--button-color-outlined-standard-border, #8891aa);
|
|
556
|
+
background-color: var(--button-color-outlined-standard-background, #ffffff);
|
|
557
|
+
}
|
|
558
|
+
.mc-button--outlined.mc-button--standard:hover {
|
|
559
|
+
background-color: var(--button-color-outlined-standard-hover-background, #eff1f6);
|
|
560
|
+
}
|
|
561
|
+
.mc-button--outlined.mc-button--standard:active {
|
|
562
|
+
background-color: var(--button-color-outlined-standard-active-background, #c9d0de);
|
|
563
|
+
}
|
|
564
|
+
.mc-button--outlined.mc-button--standard:disabled {
|
|
565
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
566
|
+
border-color: transparent;
|
|
567
|
+
color: var(--button-state-disabled-color, #737373);
|
|
568
|
+
cursor: not-allowed;
|
|
569
|
+
}
|
|
570
|
+
.mc-button--outlined.mc-button--accent {
|
|
571
|
+
color: var(--button-color-outlined-accent-font, #117f03);
|
|
572
|
+
border-color: var(--button-color-outlined-accent-border, #78be20);
|
|
573
|
+
background-color: var(--button-color-outlined-accent-background, #ffffff);
|
|
574
|
+
}
|
|
575
|
+
.mc-button--outlined.mc-button--accent:hover {
|
|
576
|
+
background-color: var(--button-color-outlined-accent-hover-background, #ebf5de);
|
|
577
|
+
}
|
|
578
|
+
.mc-button--outlined.mc-button--accent:active {
|
|
579
|
+
background-color: var(--button-color-outlined-accent-active-background, #c5e39e);
|
|
580
|
+
}
|
|
581
|
+
.mc-button--outlined.mc-button--accent:disabled {
|
|
582
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
583
|
+
border-color: transparent;
|
|
584
|
+
color: var(--button-state-disabled-color, #737373);
|
|
585
|
+
cursor: not-allowed;
|
|
586
|
+
}
|
|
587
|
+
.mc-button--outlined.mc-button--danger {
|
|
588
|
+
color: var(--button-color-outlined-danger-font, #c61112);
|
|
589
|
+
border-color: var(--button-color-outlined-danger-border, #ef5f5c);
|
|
590
|
+
background-color: var(--button-color-outlined-danger-background, #ffffff);
|
|
591
|
+
}
|
|
592
|
+
.mc-button--outlined.mc-button--danger:hover {
|
|
593
|
+
background-color: var(--button-color-outlined-danger-hover-background, #fdeaea);
|
|
594
|
+
}
|
|
595
|
+
.mc-button--outlined.mc-button--danger:active {
|
|
596
|
+
background-color: var(--button-color-outlined-danger-active-background, #f8bcbb);
|
|
597
|
+
}
|
|
598
|
+
.mc-button--outlined.mc-button--danger:disabled {
|
|
599
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
600
|
+
border-color: transparent;
|
|
601
|
+
color: var(--button-state-disabled-color, #737373);
|
|
602
|
+
cursor: not-allowed;
|
|
603
|
+
}
|
|
604
|
+
.mc-button--outlined.mc-button--inverse {
|
|
605
|
+
color: var(--button-color-outlined-inverse-font, #ffffff);
|
|
606
|
+
border-color: var(--button-color-outlined-inverse-border, #ffffff);
|
|
607
|
+
background-color: var(--button-color-outlined-inverse-background, rgba(255, 255, 255, 0.01));
|
|
608
|
+
}
|
|
609
|
+
.mc-button--outlined.mc-button--inverse:hover {
|
|
610
|
+
background-color: var(--button-color-outlined-inverse-hover-background, rgba(255, 255, 255, 0.1));
|
|
611
|
+
}
|
|
612
|
+
.mc-button--outlined.mc-button--inverse:active {
|
|
613
|
+
background-color: var(--button-color-outlined-inverse-active-background, rgba(255, 255, 255, 0.2));
|
|
614
|
+
}
|
|
615
|
+
.mc-button--outlined.mc-button--inverse:disabled {
|
|
616
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
617
|
+
border-color: transparent;
|
|
618
|
+
color: var(--button-state-disabled-color, #737373);
|
|
619
|
+
cursor: not-allowed;
|
|
620
|
+
}
|
|
621
|
+
.mc-button--ghost.mc-button--standard {
|
|
622
|
+
color: var(--button-color-ghost-standard-font, #242938);
|
|
623
|
+
background-color: var(--button-color-ghost-standard-background, rgba(255, 255, 255, 0.01));
|
|
624
|
+
}
|
|
625
|
+
.mc-button--ghost.mc-button--standard:hover {
|
|
626
|
+
background-color: var(--button-color-ghost-standard-hover-background, rgba(70, 78, 99, 0.1));
|
|
627
|
+
}
|
|
628
|
+
.mc-button--ghost.mc-button--standard:active {
|
|
629
|
+
background-color: var(--button-color-ghost-standard-active-background, rgba(70, 78, 99, 0.2));
|
|
630
|
+
}
|
|
631
|
+
.mc-button--ghost.mc-button--standard:disabled {
|
|
632
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
633
|
+
border-color: transparent;
|
|
634
|
+
color: var(--button-state-disabled-color, #737373);
|
|
635
|
+
cursor: not-allowed;
|
|
636
|
+
}
|
|
637
|
+
.mc-button--ghost.mc-button--accent {
|
|
638
|
+
color: var(--button-color-ghost-accent-font, #117f03);
|
|
639
|
+
background-color: var(--button-color-ghost-accent-background, rgba(255, 255, 255, 0.01));
|
|
640
|
+
}
|
|
641
|
+
.mc-button--ghost.mc-button--accent:hover {
|
|
642
|
+
background-color: var(--button-color-ghost-accent-hover-background, rgba(17, 127, 3, 0.1));
|
|
643
|
+
}
|
|
644
|
+
.mc-button--ghost.mc-button--accent:active {
|
|
645
|
+
background-color: var(--button-color-ghost-accent-active-background, rgba(17, 127, 3, 0.2));
|
|
646
|
+
}
|
|
647
|
+
.mc-button--ghost.mc-button--accent:disabled {
|
|
648
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
649
|
+
border-color: transparent;
|
|
650
|
+
color: var(--button-state-disabled-color, #737373);
|
|
651
|
+
cursor: not-allowed;
|
|
652
|
+
}
|
|
653
|
+
.mc-button--ghost.mc-button--danger {
|
|
654
|
+
color: var(--button-color-ghost-danger-font, #c61112);
|
|
655
|
+
background-color: var(--button-color-ghost-danger-background, rgba(255, 255, 255, 0.01));
|
|
656
|
+
}
|
|
657
|
+
.mc-button--ghost.mc-button--danger:hover {
|
|
658
|
+
background-color: var(--button-color-ghost-danger-hover-background, rgba(198, 17, 18, 0.1));
|
|
659
|
+
}
|
|
660
|
+
.mc-button--ghost.mc-button--danger:active {
|
|
661
|
+
background-color: var(--button-color-ghost-danger-active-background, rgba(198, 17, 18, 0.2));
|
|
662
|
+
}
|
|
663
|
+
.mc-button--ghost.mc-button--danger:disabled {
|
|
664
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
665
|
+
border-color: transparent;
|
|
666
|
+
color: var(--button-state-disabled-color, #737373);
|
|
667
|
+
cursor: not-allowed;
|
|
668
|
+
}
|
|
669
|
+
.mc-button--ghost.mc-button--inverse {
|
|
670
|
+
color: var(--button-color-ghost-inverse-font, #ffffff);
|
|
671
|
+
background-color: var(--button-color-ghost-inverse-background, rgba(255, 255, 255, 0.01));
|
|
672
|
+
}
|
|
673
|
+
.mc-button--ghost.mc-button--inverse:hover {
|
|
674
|
+
background-color: var(--button-color-ghost-inverse-hover-background, rgba(255, 255, 255, 0.1));
|
|
675
|
+
}
|
|
676
|
+
.mc-button--ghost.mc-button--inverse:active {
|
|
677
|
+
background-color: var(--button-color-ghost-inverse-active-background, rgba(255, 255, 255, 0.2));
|
|
678
|
+
}
|
|
679
|
+
.mc-button--ghost.mc-button--inverse:disabled {
|
|
680
|
+
background-color: var(--button-state-disabled-background, #d9d9d9);
|
|
681
|
+
border-color: transparent;
|
|
682
|
+
color: var(--button-state-disabled-color, #737373);
|
|
683
|
+
cursor: not-allowed;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.mc-listbox {
|
|
687
|
+
position: fixed;
|
|
688
|
+
inset: 0;
|
|
689
|
+
display: flex;
|
|
690
|
+
align-items: flex-end;
|
|
691
|
+
justify-content: center;
|
|
692
|
+
z-index: 1;
|
|
693
|
+
padding: 0.5rem;
|
|
694
|
+
background-color: var(--overlay-color-background, rgba(0, 0, 0, 0.5));
|
|
695
|
+
inset: 0;
|
|
696
|
+
opacity: 0;
|
|
697
|
+
position: fixed;
|
|
698
|
+
pointer-events: none;
|
|
699
|
+
transition: opacity 0.4s ease, visibility 0ms 0.4s;
|
|
700
|
+
z-index: var(--overlay-z-index, 2);
|
|
701
|
+
}
|
|
702
|
+
.mc-listbox.is-visible {
|
|
703
|
+
opacity: 1;
|
|
704
|
+
pointer-events: all;
|
|
705
|
+
transition: opacity 0.4s ease, visibility 0ms;
|
|
706
|
+
visibility: visible;
|
|
707
|
+
}
|
|
708
|
+
.mc-listbox {
|
|
709
|
+
opacity: 1;
|
|
710
|
+
}
|
|
711
|
+
@media (width >= 680px) {
|
|
712
|
+
.mc-listbox {
|
|
713
|
+
position: relative;
|
|
714
|
+
display: block;
|
|
715
|
+
padding: 0;
|
|
716
|
+
background-color: transparent;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
.mc-listbox__content {
|
|
720
|
+
border: var(--border-width-s, 0.0625rem) solid var(--color-border-primary, #cccccc);
|
|
721
|
+
border-radius: var(--border-radius-m, 0.5rem);
|
|
722
|
+
width: 100%;
|
|
723
|
+
z-index: 10;
|
|
724
|
+
background-color: var(--color-background-primary, #ffffff);
|
|
725
|
+
pointer-events: all;
|
|
726
|
+
}
|
|
727
|
+
@media (width >= 680px) {
|
|
728
|
+
.mc-listbox__content {
|
|
729
|
+
width: 18.75rem;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
.mc-listbox__header {
|
|
733
|
+
display: flex;
|
|
734
|
+
align-items: center;
|
|
735
|
+
justify-content: center;
|
|
736
|
+
position: relative;
|
|
737
|
+
height: 4rem;
|
|
738
|
+
}
|
|
739
|
+
@media (width >= 680px) {
|
|
740
|
+
.mc-listbox__header {
|
|
741
|
+
display: none;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
.mc-listbox__title {
|
|
745
|
+
line-height: var(--line-height-s, 1.3);
|
|
746
|
+
font-weight: var(--font-weight-semi-bold, 600);
|
|
747
|
+
font-size: var(--font-size-100, 0.875rem);
|
|
748
|
+
color: var(--color-text-tertiary, #666666);
|
|
749
|
+
text-align: center;
|
|
750
|
+
margin: 0;
|
|
751
|
+
}
|
|
752
|
+
.mc-listbox__close {
|
|
753
|
+
position: absolute;
|
|
754
|
+
right: 1.25rem;
|
|
755
|
+
width: 1.5rem;
|
|
756
|
+
height: 1.5rem;
|
|
757
|
+
}
|
|
758
|
+
.mc-listbox__body {
|
|
759
|
+
overflow: hidden;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/* stylelint-disable string-no-newline */
|
|
763
|
+
.mc-select {
|
|
764
|
+
appearance: none;
|
|
765
|
+
font-family: inherit;
|
|
766
|
+
transition: box-shadow 200ms ease;
|
|
767
|
+
font-size: var(--font-size-150, 1rem);
|
|
768
|
+
line-height: var(--line-height-s, 1.3);
|
|
769
|
+
height: 3rem;
|
|
770
|
+
padding: 0 3rem 0 0.75rem;
|
|
771
|
+
background-position: right 1rem center;
|
|
772
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' fill='var(--forms-color-icon-interactive, %23000000)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E");
|
|
773
|
+
border: var(--border-width-s, 0.0625rem) solid var(--forms-color-border-default, #666666);
|
|
774
|
+
display: block;
|
|
775
|
+
width: 100%;
|
|
776
|
+
color: var(--forms-color-text-default, #000000);
|
|
777
|
+
background-color: var(--forms-color-background-default, #ffffff);
|
|
778
|
+
text-overflow: ellipsis;
|
|
779
|
+
background-repeat: no-repeat;
|
|
780
|
+
background-size: 1rem;
|
|
781
|
+
border-radius: var(--border-radius-s, 0.25rem);
|
|
782
|
+
}
|
|
783
|
+
.mc-select:hover {
|
|
784
|
+
border-color: var(--forms-color-border-hover, #4d4d4d);
|
|
785
|
+
box-shadow: 0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-hover, #4d4d4d);
|
|
786
|
+
}
|
|
787
|
+
.mc-select:focus {
|
|
788
|
+
box-shadow: 0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));
|
|
789
|
+
outline: 0.125rem solid transparent;
|
|
790
|
+
outline-offset: 0.125rem;
|
|
791
|
+
}
|
|
792
|
+
.mc-select:disabled {
|
|
793
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' fill='var(--forms-color-icon-disabled, %23737373)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E");
|
|
794
|
+
background-color: var(--forms-color-background-disabled, #d9d9d9);
|
|
795
|
+
border-color: transparent;
|
|
796
|
+
cursor: not-allowed;
|
|
797
|
+
box-shadow: none;
|
|
798
|
+
color: var(--forms-color-text-disabled, #737373);
|
|
799
|
+
}
|
|
800
|
+
.mc-select--readonly {
|
|
801
|
+
border-color: var(--forms-color-border-read-only, #cccccc);
|
|
802
|
+
pointer-events: none;
|
|
803
|
+
}
|
|
804
|
+
.mc-select.is-invalid {
|
|
805
|
+
border-color: var(--forms-color-border-invalid, #ea302d);
|
|
806
|
+
box-shadow: 0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-invalid, #ea302d);
|
|
807
|
+
}
|
|
808
|
+
.mc-select.is-invalid:hover {
|
|
809
|
+
border-color: var(--forms-color-border-invalid-hover, #c61112);
|
|
810
|
+
box-shadow: 0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-invalid-hover, #c61112);
|
|
811
|
+
}
|
|
812
|
+
.mc-select--s {
|
|
813
|
+
font-size: var(--font-size-100, 0.875rem);
|
|
814
|
+
line-height: var(--line-height-s, 1.3);
|
|
815
|
+
height: 2rem;
|
|
816
|
+
padding: 0 2rem 0 0.5rem;
|
|
817
|
+
background-position: right 0.5rem center;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
/* stylelint-enable string-no-newline */
|
|
821
|
+
.mc-phone-number-input {
|
|
822
|
+
font-family: var(--font-family, LeroyMerlin), sans-serif;
|
|
823
|
+
display: flex;
|
|
824
|
+
position: relative;
|
|
825
|
+
gap: 0.25rem;
|
|
826
|
+
}
|
|
827
|
+
.mc-phone-number-input__country-code {
|
|
828
|
+
font-weight: var(--font-weight-semi-bold, 600);
|
|
829
|
+
color: var(--forms-color-text-default, #000000);
|
|
830
|
+
font-size: var(--font-size-150, 1rem);
|
|
831
|
+
margin-left: 0.75rem;
|
|
832
|
+
}
|
|
833
|
+
.mc-phone-number-input__flag {
|
|
834
|
+
width: 1.5rem;
|
|
835
|
+
height: 1.125rem;
|
|
836
|
+
margin-left: auto;
|
|
837
|
+
display: flex;
|
|
838
|
+
align-items: center;
|
|
839
|
+
}
|
|
840
|
+
.mc-phone-number-input__flag-image {
|
|
841
|
+
width: 24px;
|
|
842
|
+
max-height: 18px;
|
|
843
|
+
border-radius: var(--border-radius-xs, 0.125rem);
|
|
844
|
+
}
|
|
845
|
+
.mc-phone-number-input__chevron {
|
|
846
|
+
width: 1.5rem;
|
|
847
|
+
height: 1.5rem;
|
|
848
|
+
margin: 0.75rem;
|
|
849
|
+
}
|
|
850
|
+
.mc-phone-number-input__select-wrapper {
|
|
851
|
+
position: relative;
|
|
852
|
+
}
|
|
853
|
+
.mc-phone-number-input__select-wrapper--hidden {
|
|
854
|
+
display: none;
|
|
855
|
+
}
|
|
856
|
+
.mc-phone-number-input__select {
|
|
857
|
+
width: 5.75rem;
|
|
858
|
+
padding: 0;
|
|
859
|
+
z-index: 2;
|
|
860
|
+
opacity: 0;
|
|
861
|
+
position: relative;
|
|
862
|
+
}
|
|
863
|
+
.mc-phone-number-input__select:hover + .mc-phone-number-input__select-display {
|
|
864
|
+
border-color: var(--forms-color-border-hover, #4d4d4d);
|
|
865
|
+
box-shadow: 0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-hover, #4d4d4d);
|
|
866
|
+
}
|
|
867
|
+
.mc-phone-number-input__select :read-only .mc-phone-number-input__chevron {
|
|
868
|
+
display: none;
|
|
869
|
+
}
|
|
870
|
+
.mc-phone-number-input__select-display {
|
|
871
|
+
box-sizing: border-box;
|
|
872
|
+
position: absolute;
|
|
873
|
+
top: 0;
|
|
874
|
+
right: 0;
|
|
875
|
+
width: 100%;
|
|
876
|
+
height: 100%;
|
|
877
|
+
display: flex;
|
|
878
|
+
align-items: center;
|
|
879
|
+
justify-content: space-between;
|
|
880
|
+
z-index: 1;
|
|
881
|
+
border: var(--border-width-s, 0.0625rem) solid var(--forms-color-border-default, #666666);
|
|
882
|
+
border-radius: var(--border-radius-s, 0.25rem);
|
|
883
|
+
}
|
|
884
|
+
.mc-phone-number-input__input {
|
|
885
|
+
gap: 0;
|
|
886
|
+
}
|
|
887
|
+
.mc-phone-number-input__control {
|
|
888
|
+
border-top-left-radius: 0;
|
|
889
|
+
border-bottom-left-radius: 0;
|
|
890
|
+
padding-left: 0.5rem;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
.mc-phone-number-input__chevron :global(svg) {
|
|
894
|
+
height: 100%;
|
|
895
|
+
width: 100%;
|
|
896
|
+
}</style>
|