@mozaic-ds/web-components 1.0.0-beta.4 → 1.0.0-beta.6
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 +2 -0
- package/dist/Cross20.js.map +1 -0
- package/dist/Cross24.js +1 -1
- package/dist/CrossCircleFilled24.js +1 -1
- package/dist/attributes.js +1 -1
- package/dist/bundle.d.ts +43 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +4 -2
- package/dist/components/avatar/Avatar.js +7 -0
- package/dist/components/avatar/Avatar.js.map +1 -0
- package/dist/components/avatar/Avatar.stories.d.ts +9 -0
- package/dist/components/avatar/Avatar.stories.d.ts.map +1 -0
- package/dist/components/avatar/Avatar.stories.js +67 -0
- package/dist/components/avatar/Avatar.svelte +63 -0
- package/dist/components/avatar/Avatar.svelte.d.ts +37 -0
- package/dist/components/avatar/Avatar.svelte.d.ts.map +1 -0
- package/dist/components/breadcrumb/Breadcrumb.js +9 -6
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.stories.d.ts +6 -5
- package/dist/components/breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.stories.js +55 -58
- package/dist/components/breadcrumb/Breadcrumb.svelte +45 -29
- package/dist/components/breadcrumb/Breadcrumb.svelte.d.ts +24 -7
- package/dist/components/breadcrumb/Breadcrumb.svelte.d.ts.map +1 -1
- package/dist/components/button/Button.js +6 -3
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.stories.d.ts.map +1 -1
- package/dist/components/button/Button.stories.js +1 -0
- package/dist/components/button/Button.svelte +105 -102
- package/dist/components/callout/Callout.js +10 -0
- package/dist/components/callout/Callout.js.map +1 -0
- package/dist/components/callout/Callout.stories.d.ts +18 -0
- package/dist/components/callout/Callout.stories.d.ts.map +1 -0
- package/dist/components/callout/Callout.stories.js +122 -0
- package/dist/components/callout/Callout.svelte +112 -0
- package/dist/components/callout/Callout.svelte.d.ts +49 -0
- package/dist/components/callout/Callout.svelte.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.js +6 -3
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox/Checkbox.svelte +39 -33
- package/dist/components/checkboxgroup/CheckboxGroup.js +7 -4
- package/dist/components/checkboxgroup/CheckboxGroup.js.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.svelte +39 -33
- package/dist/components/circularprogressbar/CircularProgressbar.js +7 -4
- package/dist/components/circularprogressbar/CircularProgressbar.js.map +1 -1
- package/dist/components/circularprogressbar/CircularProgressbar.svelte +17 -14
- package/dist/components/datepicker/Datepicker.js +6 -3
- package/dist/components/datepicker/Datepicker.js.map +1 -1
- package/dist/components/datepicker/Datepicker.svelte +50 -47
- package/dist/components/drawer/Drawer.js +15 -12
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/Drawer.svelte +113 -110
- package/dist/components/field/Field.js +6 -3
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/field/Field.svelte +18 -15
- package/dist/components/flag/Flag.js +5 -2
- package/dist/components/flag/Flag.js.map +1 -1
- package/dist/components/flag/Flag.svelte +15 -12
- package/dist/components/iconbutton/IconButton.js +5 -2
- package/dist/components/iconbutton/IconButton.js.map +1 -1
- package/dist/components/iconbutton/IconButton.svelte +105 -102
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.js +5 -2
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.js.map +1 -1
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.svelte +7 -3
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.js +5 -3
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.js.map +1 -1
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.svelte +24 -12
- package/dist/components/link/Link.js +5 -2
- package/dist/components/link/Link.js.map +1 -1
- package/dist/components/link/Link.svelte +12 -9
- package/dist/components/loader/Loader.js +10 -7
- package/dist/components/loader/Loader.js.map +1 -1
- package/dist/components/loader/Loader.svelte +7 -4
- package/dist/components/modal/Modal.js +17 -14
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/Modal.stories.d.ts.map +1 -1
- package/dist/components/modal/Modal.stories.js +1 -0
- package/dist/components/modal/Modal.svelte +115 -111
- package/dist/components/numberbadge/NumberBadge.js +5 -2
- package/dist/components/numberbadge/NumberBadge.js.map +1 -1
- package/dist/components/numberbadge/NumberBadge.svelte +15 -12
- package/dist/components/overlay/Overlay.js +5 -2
- package/dist/components/overlay/Overlay.js.map +1 -1
- package/dist/components/overlay/Overlay.svelte +5 -2
- package/dist/components/overlayloader/OverlayLoader.js +7 -4
- package/dist/components/overlayloader/OverlayLoader.js.map +1 -1
- package/dist/components/overlayloader/OverlayLoader.svelte +9 -6
- package/dist/components/pagination/Pagination.js +11 -8
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/Pagination.svelte +23 -20
- package/dist/components/passwordinput/PasswordInput.js +8 -5
- package/dist/components/passwordinput/PasswordInput.js.map +1 -1
- package/dist/components/passwordinput/PasswordInput.svelte +32 -29
- package/dist/components/pincode/Pincode.js +7 -4
- package/dist/components/pincode/Pincode.js.map +1 -1
- package/dist/components/pincode/Pincode.svelte +19 -16
- package/dist/components/quantityselector/QuantitySelector.js +6 -3
- package/dist/components/quantityselector/QuantitySelector.js.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.svelte +28 -25
- package/dist/components/radio/Radio.js +5 -2
- package/dist/components/radio/Radio.js.map +1 -1
- package/dist/components/radio/Radio.svelte +19 -16
- package/dist/components/radiogroup/RadioGroup.js +7 -4
- package/dist/components/radiogroup/RadioGroup.js.map +1 -1
- package/dist/components/radiogroup/RadioGroup.svelte +34 -31
- package/dist/components/select/Select.js +6 -3
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/Select.svelte +23 -20
- package/dist/components/statusbadge/StatusBadge.js +5 -2
- package/dist/components/statusbadge/StatusBadge.js.map +1 -1
- package/dist/components/statusbadge/StatusBadge.svelte +23 -20
- package/dist/components/statusdot/StatusDot.js +5 -2
- package/dist/components/statusdot/StatusDot.js.map +1 -1
- package/dist/components/statusdot/StatusDot.stories.d.ts +10 -13
- package/dist/components/statusdot/StatusDot.stories.d.ts.map +1 -1
- package/dist/components/statusdot/StatusDot.stories.js +49 -43
- package/dist/components/statusdot/StatusDot.svelte +22 -12
- package/dist/components/statusdot/StatusDot.svelte.d.ts +11 -3
- package/dist/components/statusdot/StatusDot.svelte.d.ts.map +1 -1
- package/dist/components/statusdot/StatusDot.types.d.ts +1 -1
- package/dist/components/statusdot/StatusDot.types.d.ts.map +1 -1
- package/dist/components/statusnotification/StatusNotification.js +6 -2
- package/dist/components/statusnotification/StatusNotification.js.map +1 -1
- package/dist/components/statusnotification/StatusNotification.svelte +364 -49
- package/dist/components/statusnotification/StatusNotification.svelte.d.ts.map +1 -1
- package/dist/components/tabs/Tab.js +5 -2
- package/dist/components/tabs/Tab.js.map +1 -1
- package/dist/components/tabs/Tab.svelte +14 -11
- package/dist/components/tabs/Tabs.js +5 -2
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.stories.js +1 -0
- package/dist/components/tabs/Tabs.svelte +22 -19
- package/dist/components/tags/Tag.js +5 -2
- package/dist/components/tags/Tag.js.map +1 -1
- package/dist/components/tags/Tag.svelte +38 -35
- package/dist/components/tags/TagContextualised.js +5 -2
- package/dist/components/tags/TagContextualised.js.map +1 -1
- package/dist/components/tags/TagContextualised.svelte +38 -35
- package/dist/components/tags/TagInteractive.js +5 -2
- package/dist/components/tags/TagInteractive.js.map +1 -1
- package/dist/components/tags/TagInteractive.svelte +38 -35
- package/dist/components/tags/TagRemovable.js +5 -2
- package/dist/components/tags/TagRemovable.js.map +1 -1
- package/dist/components/tags/TagRemovable.svelte +38 -35
- package/dist/components/tags/TagSelectable.js +5 -2
- package/dist/components/tags/TagSelectable.js.map +1 -1
- package/dist/components/tags/TagSelectable.svelte +38 -35
- package/dist/components/textarea/Textarea.js +6 -3
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea/Textarea.svelte +35 -32
- package/dist/components/textinput/Textinput.js +8 -5
- package/dist/components/textinput/Textinput.js.map +1 -1
- package/dist/components/textinput/Textinput.svelte +32 -29
- package/dist/components/toaster/Toaster.js +13 -0
- package/dist/components/toaster/Toaster.js.map +1 -0
- package/dist/components/toaster/Toaster.stories.d.ts +20 -0
- package/dist/components/toaster/Toaster.stories.d.ts.map +1 -0
- package/dist/components/toaster/Toaster.stories.js +156 -0
- package/dist/components/toaster/Toaster.svelte +640 -0
- package/dist/components/toaster/Toaster.svelte.d.ts +54 -0
- package/dist/components/toaster/Toaster.svelte.d.ts.map +1 -0
- package/dist/components/toggle/Toggle.js +5 -2
- package/dist/components/toggle/Toggle.js.map +1 -1
- package/dist/components/toggle/Toggle.svelte +24 -21
- package/dist/components/togglegroup/ToggleGroup.js +6 -3
- package/dist/components/togglegroup/ToggleGroup.js.map +1 -1
- package/dist/components/togglegroup/ToggleGroup.svelte +39 -36
- package/dist/components/tooltip/Tooltip.js +7 -4
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/tooltip/Tooltip.svelte +11 -8
- 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/index-client.js +2 -0
- package/dist/index-client.js.map +1 -0
- package/dist/input.js +1 -1
- package/dist/input.js.map +1 -1
- package/dist/legacy.js +1 -1
- package/dist/main.d.ts +7 -4
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +7 -4
- package/dist/slot.js +1 -1
- package/dist/snippet.js +1 -1
- package/package.json +9 -11
- package/dist/icons-storybook.js +0 -88
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import{n as
|
|
1
|
+
import{n as L,c as M,p as P,a as y,b as r,f as C,d as m,t as u,e as B,o as H,h as w,i as D,j as i,s as j,r as f,g as F}from"../../custom-element.js";import{i as S}from"../../if.js";import{s as E,r as T}from"../../attributes.js";import{a as Y}from"../../input.js";import{c as q}from"../../custom-element-forward-events.js";var A=C('<span class="mc-toggle__label svelte-10phbx3"> </span>'),G=C('<div><label class="mc-toggle__container svelte-10phbx3"><input class="mc-toggle__input svelte-10phbx3" type="checkbox"/> <!></label></div>');const I={hash:"svelte-10phbx3",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
|
-
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Do not edit directly, this file was auto-generated.
|
|
6
|
+
*/.mc-toggle.svelte-10phbx3 {width:fit-content;}.mc-toggle__container.svelte-10phbx3 {display:flex;align-items:center;cursor:pointer;gap:0.5rem;position:relative;padding:0.25rem;}.mc-toggle__container.svelte-10phbx3::before, .mc-toggle__container.svelte-10phbx3::after {content:"";}.mc-toggle__container.svelte-10phbx3::before {transition:box-shadow 200ms ease;height:1.5rem;width:2.5rem;background-color:#666666;border-radius:1rem;flex-shrink:0;}.mc-toggle__container.svelte-10phbx3::after {height:1.25rem;width:1.25rem;background-color:#ffffff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23666666' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.364a.75.75 0 1 0-1.06-1.061L10 8.939 6.364 5.303a.75.75 0 0 0-1.06 1.06L8.94 10l-3.637 3.636a.75.75 0 1 0 1.06 1.06L10 11.062l3.636 3.636a.75.75 0 0 0 1.061-1.06L11.061 10z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");border-radius:100%;background-position:center;left:0.375rem;position:absolute;top:50%;transform:translateY(-50%);}.mc-toggle__input.svelte-10phbx3 {clip-path:inset(100%);clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}.mc-toggle__label.svelte-10phbx3 {color:#000000;font-size:1rem;font-weight:400;line-height:1.5;}.mc-toggle.svelte-10phbx3:has(:where(.svelte-10phbx3):checked) .mc-toggle__container:where(.svelte-10phbx3)::before {background-color:#117f03;}.mc-toggle.svelte-10phbx3:has(:where(.svelte-10phbx3):checked) .mc-toggle__container:where(.svelte-10phbx3)::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23117f03' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.553a.75.75 0 0 1 0 1.06l-5.833 5.834a.75.75 0 0 1-1.06 0l-2.5-2.5a.75.75 0 0 1 1.06-1.06l1.97 1.97 5.303-5.304a.75.75 0 0 1 1.06 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");transform:translate(1rem, -50%);}.mc-toggle.svelte-10phbx3:has(:where(.svelte-10phbx3):disabled) .mc-toggle__container:where(.svelte-10phbx3) {cursor:not-allowed;}.mc-toggle.svelte-10phbx3:has(:where(.svelte-10phbx3):disabled) .mc-toggle__container:where(.svelte-10phbx3)::before {background-color:#d9d9d9;}.mc-toggle.svelte-10phbx3:has(:where(.svelte-10phbx3):disabled) .mc-toggle__container:where(.svelte-10phbx3)::after {background-color:#737373;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23d9d9d9' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.364a.75.75 0 1 0-1.06-1.061L10 8.939 6.364 5.303a.75.75 0 0 0-1.06 1.06L8.94 10l-3.637 3.636a.75.75 0 1 0 1.06 1.06L10 11.062l3.636 3.636a.75.75 0 0 0 1.061-1.06L11.061 10z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");}.mc-toggle.svelte-10phbx3:has(:where(.svelte-10phbx3):disabled) .mc-toggle__label:where(.svelte-10phbx3) {color:#737373;}.mc-toggle.svelte-10phbx3:has(:where(.svelte-10phbx3):disabled:checked) .mc-toggle__container:where(.svelte-10phbx3)::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23d9d9d9' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.553a.75.75 0 0 1 0 1.06l-5.833 5.834a.75.75 0 0 1-1.06 0l-2.5-2.5a.75.75 0 0 1 1.06-1.06l1.97 1.97 5.303-5.304a.75.75 0 0 1 1.06 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");}.mc-toggle.svelte-10phbx3:has(:where(.svelte-10phbx3):focus-visible) .mc-toggle__container:where(.svelte-10phbx3)::before {box-shadow:0 0 0 0.125rem var(--focus-color-mid, #ffffff), 0 0 0 0.25rem var(--focus-color-outer, #000000);outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-toggle--m.svelte-10phbx3 .mc-toggle__container:where(.svelte-10phbx3)::before {height:2rem;width:3.5rem;}.mc-toggle--m.svelte-10phbx3 .mc-toggle__container:where(.svelte-10phbx3)::after {height:1.5rem;width:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23666666' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.707a1 1 0 0 0-1.414-1.414L12 10.586 7.707 6.293a1 1 0 0 0-1.414 1.414L10.586 12l-4.293 4.293a1 1 0 1 0 1.414 1.414L12 13.414l4.293 4.293a1 1 0 0 0 1.414-1.414L13.414 12z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");left:0.5rem;}.mc-toggle--m.svelte-10phbx3:has(:where(.svelte-10phbx3):checked) .mc-toggle__container:where(.svelte-10phbx3)::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23117f03' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.793a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L10 14.086l6.293-6.293a1 1 0 0 1 1.414 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");transform:translate(1.5rem, -50%);}.mc-toggle--m.svelte-10phbx3:has(:where(.svelte-10phbx3):disabled) .mc-toggle__container:where(.svelte-10phbx3)::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23d9d9d9' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.707a1 1 0 0 0-1.414-1.414L12 10.586 7.707 6.293a1 1 0 0 0-1.414 1.414L10.586 12l-4.293 4.293a1 1 0 1 0 1.414 1.414L12 13.414l4.293 4.293a1 1 0 0 0 1.414-1.414L13.414 12z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");}.mc-toggle--m.svelte-10phbx3:has(:where(.svelte-10phbx3):disabled:checked) .mc-toggle__container:where(.svelte-10phbx3)::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23d9d9d9' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.793a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L10 14.086l6.293-6.293a1 1 0 0 1 1.414 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");}.mc-toggle--hide-label.svelte-10phbx3 .mc-toggle__label:where(.svelte-10phbx3) {clip-path:inset(100%);clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}`};function J(v,l){P(l,!0),y(v,I);let h=r(l,"name",7),o=r(l,"checked",15),d=r(l,"disabled",7,!1),n=r(l,"size",7,"m"),s=r(l,"label",7),c=r(l,"onchange",7),p=r(l,"onblur",7);var g=G();let b;var x=m(g),a=m(x);T(a),a.__change=function(...e){var t;(t=c())==null||t.apply(this,e)};var _=j(a,2);{var k=e=>{var t=A(),z=m(t,!0);f(t),u(()=>F(z,s())),w(e,t)};S(_,e=>{s()&&e(k)})}return f(x),f(g),u(e=>{b=B(g,1,"mc-toggle svelte-10phbx3",null,b,e),E(a,"id",h()),E(a,"name",h()),a.disabled=d()},[()=>({"mc-toggle--hide-label":!s(),"mc-toggle--m":n()==="m"})]),H("blur",a,function(...e){var t;(t=p())==null||t.apply(this,e)}),Y(a,o),w(v,g),D({get name(){return h()},set name(e){h(e),i()},get checked(){return o()},set checked(e){o(e),i()},get disabled(){return d()},set disabled(e=!1){d(e),i()},get size(){return n()},set size(e="m"){n(e),i()},get label(){return s()},set label(e){s(e),i()},get onchange(){return c()},set onchange(e){c(e),i()},get onblur(){return p()},set onblur(e){p(e),i()}})}L(["change"]);customElements.define("m-toggle",M(J,{name:{},checked:{},disabled:{},size:{},label:{},onchange:{},onblur:{}},[],[],!0,q));
|
|
4
7
|
//# sourceMappingURL=Toggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.js","sources":["../../../src/components/toggle/Toggle.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-toggle',\n extend: customElementForwardEvents,\n }}\n/>\n\n<script lang=\"ts\">\n import type { ToggleSize } from './toggle.types';\n import { customElementForwardEvents } from '../../utils';\n\n interface Props {\n name: string;\n checked: boolean;\n disabled?: boolean;\n size?: ToggleSize;\n label: string;\n onchange?: (event: Event) => void;\n onblur?: (event: FocusEvent) => void;\n }\n\n let {\n name,\n checked = $bindable(),\n disabled = false,\n size = 'm',\n label,\n onchange,\n onblur\n }: Props = $props();\n</script>\n\n<div\n class=\"mc-toggle\"\n class:mc-toggle--hide-label={!label}\n class:mc-toggle--m={size === 'm'}\n>\n <label class=\"mc-toggle__container\">\n <input\n class=\"mc-toggle__input\"\n id={name}\n {name}\n type=\"checkbox\"\n bind:checked\n {disabled}\n {onchange}\n {onblur}\n />\n {#if label}\n <span class=\"mc-toggle__label\">{label}</span>\n {/if}\n </label>\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/toggle';\n</style>\n"],"names":["name","$.prop","$$props","checked","disabled","size","label","onchange","onblur","$$render","consequent","customElementForwardEvents"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toggle.js","sources":["../../../src/components/toggle/Toggle.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-toggle',\n extend: customElementForwardEvents,\n }}\n/>\n\n<script lang=\"ts\">\n import type { ToggleSize } from './toggle.types';\n import { customElementForwardEvents } from '../../utils';\n\n interface Props {\n name: string;\n checked: boolean;\n disabled?: boolean;\n size?: ToggleSize;\n label: string;\n onchange?: (event: Event) => void;\n onblur?: (event: FocusEvent) => void;\n }\n\n let {\n name,\n checked = $bindable(),\n disabled = false,\n size = 'm',\n label,\n onchange,\n onblur\n }: Props = $props();\n</script>\n\n<div\n class=\"mc-toggle\"\n class:mc-toggle--hide-label={!label}\n class:mc-toggle--m={size === 'm'}\n>\n <label class=\"mc-toggle__container\">\n <input\n class=\"mc-toggle__input\"\n id={name}\n {name}\n type=\"checkbox\"\n bind:checked\n {disabled}\n {onchange}\n {onblur}\n />\n {#if label}\n <span class=\"mc-toggle__label\">{label}</span>\n {/if}\n </label>\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/toggle';\n</style>\n"],"names":["name","$.prop","$$props","checked","disabled","size","label","onchange","onblur","$$render","consequent","customElementForwardEvents"],"mappings":";;;;;w/NAAA,oBAsBIA,EAAIC,EAAAC,EAAA,OAAA,CAAA,EACJC,EAAOF,EAAAC,EAAA,UAAA,EAAA,EACPE,mBAAW,EAAK,EAChBC,eAAO,GAAG,EACVC,EAAKL,EAAAC,EAAA,QAAA,CAAA,EACLK,EAAQN,EAAAC,EAAA,WAAA,CAAA,EACRM,EAAAP,EAAAC,EAAA,SAAA,CAAA,oKAqBkCI,EAAK,CAAA,CAAA,kBADlCA,EAAK,GAAAG,EAAAC,CAAA,iFARJV,GAAI,kEANkBM,EAAK,EACf,eAAAD,EAAI,IAAK,oOAXhB,GAAK,6CACT,IAAG,iKAKd,qIA3BYM"}
|
|
@@ -55,6 +55,9 @@
|
|
|
55
55
|
<style>/**
|
|
56
56
|
* Do not edit directly, this file was auto-generated.
|
|
57
57
|
*/
|
|
58
|
+
/**
|
|
59
|
+
* Do not edit directly, this file was auto-generated.
|
|
60
|
+
*/
|
|
58
61
|
.mc-toggle {
|
|
59
62
|
width: fit-content;
|
|
60
63
|
}
|
|
@@ -73,16 +76,16 @@
|
|
|
73
76
|
transition: box-shadow 200ms ease;
|
|
74
77
|
height: 1.5rem;
|
|
75
78
|
width: 2.5rem;
|
|
76
|
-
background-color:
|
|
77
|
-
border-radius:
|
|
79
|
+
background-color: #666666;
|
|
80
|
+
border-radius: 1rem;
|
|
78
81
|
flex-shrink: 0;
|
|
79
82
|
}
|
|
80
83
|
.mc-toggle__container::after {
|
|
81
84
|
height: 1.25rem;
|
|
82
85
|
width: 1.25rem;
|
|
83
|
-
background-color:
|
|
84
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='
|
|
85
|
-
border-radius:
|
|
86
|
+
background-color: #ffffff;
|
|
87
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23666666' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.364a.75.75 0 1 0-1.06-1.061L10 8.939 6.364 5.303a.75.75 0 0 0-1.06 1.06L8.94 10l-3.637 3.636a.75.75 0 1 0 1.06 1.06L10 11.062l3.636 3.636a.75.75 0 0 0 1.061-1.06L11.061 10z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
88
|
+
border-radius: 100%;
|
|
86
89
|
background-position: center;
|
|
87
90
|
left: 0.375rem;
|
|
88
91
|
position: absolute;
|
|
@@ -100,36 +103,36 @@
|
|
|
100
103
|
width: 1px;
|
|
101
104
|
}
|
|
102
105
|
.mc-toggle__label {
|
|
103
|
-
color:
|
|
104
|
-
font-size:
|
|
105
|
-
font-weight:
|
|
106
|
-
line-height:
|
|
106
|
+
color: #000000;
|
|
107
|
+
font-size: 1rem;
|
|
108
|
+
font-weight: 400;
|
|
109
|
+
line-height: 1.5;
|
|
107
110
|
}
|
|
108
111
|
.mc-toggle:has(:checked) .mc-toggle__container::before {
|
|
109
|
-
background-color:
|
|
112
|
+
background-color: #117f03;
|
|
110
113
|
}
|
|
111
114
|
.mc-toggle:has(:checked) .mc-toggle__container::after {
|
|
112
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='
|
|
115
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23117f03' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.553a.75.75 0 0 1 0 1.06l-5.833 5.834a.75.75 0 0 1-1.06 0l-2.5-2.5a.75.75 0 0 1 1.06-1.06l1.97 1.97 5.303-5.304a.75.75 0 0 1 1.06 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
113
116
|
transform: translate(1rem, -50%);
|
|
114
117
|
}
|
|
115
118
|
.mc-toggle:has(:disabled) .mc-toggle__container {
|
|
116
119
|
cursor: not-allowed;
|
|
117
120
|
}
|
|
118
121
|
.mc-toggle:has(:disabled) .mc-toggle__container::before {
|
|
119
|
-
background-color:
|
|
122
|
+
background-color: #d9d9d9;
|
|
120
123
|
}
|
|
121
124
|
.mc-toggle:has(:disabled) .mc-toggle__container::after {
|
|
122
|
-
background-color:
|
|
123
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='
|
|
125
|
+
background-color: #737373;
|
|
126
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23d9d9d9' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.364a.75.75 0 1 0-1.06-1.061L10 8.939 6.364 5.303a.75.75 0 0 0-1.06 1.06L8.94 10l-3.637 3.636a.75.75 0 1 0 1.06 1.06L10 11.062l3.636 3.636a.75.75 0 0 0 1.061-1.06L11.061 10z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
124
127
|
}
|
|
125
128
|
.mc-toggle:has(:disabled) .mc-toggle__label {
|
|
126
|
-
color:
|
|
129
|
+
color: #737373;
|
|
127
130
|
}
|
|
128
131
|
.mc-toggle:has(:disabled:checked) .mc-toggle__container::after {
|
|
129
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='
|
|
132
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23d9d9d9' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.553a.75.75 0 0 1 0 1.06l-5.833 5.834a.75.75 0 0 1-1.06 0l-2.5-2.5a.75.75 0 0 1 1.06-1.06l1.97 1.97 5.303-5.304a.75.75 0 0 1 1.06 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
130
133
|
}
|
|
131
134
|
.mc-toggle:has(:focus-visible) .mc-toggle__container::before {
|
|
132
|
-
box-shadow: 0 0 0 0.125rem var(--focus-color-mid,
|
|
135
|
+
box-shadow: 0 0 0 0.125rem var(--focus-color-mid, #ffffff), 0 0 0 0.25rem var(--focus-color-outer, #000000);
|
|
133
136
|
outline: 0.125rem solid transparent;
|
|
134
137
|
outline-offset: 0.125rem;
|
|
135
138
|
}
|
|
@@ -140,18 +143,18 @@
|
|
|
140
143
|
.mc-toggle--m .mc-toggle__container::after {
|
|
141
144
|
height: 1.5rem;
|
|
142
145
|
width: 1.5rem;
|
|
143
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='
|
|
146
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23666666' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.707a1 1 0 0 0-1.414-1.414L12 10.586 7.707 6.293a1 1 0 0 0-1.414 1.414L10.586 12l-4.293 4.293a1 1 0 1 0 1.414 1.414L12 13.414l4.293 4.293a1 1 0 0 0 1.414-1.414L13.414 12z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
144
147
|
left: 0.5rem;
|
|
145
148
|
}
|
|
146
149
|
.mc-toggle--m:has(:checked) .mc-toggle__container::after {
|
|
147
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='
|
|
150
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23117f03' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.793a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L10 14.086l6.293-6.293a1 1 0 0 1 1.414 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
148
151
|
transform: translate(1.5rem, -50%);
|
|
149
152
|
}
|
|
150
153
|
.mc-toggle--m:has(:disabled) .mc-toggle__container::after {
|
|
151
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='
|
|
154
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23d9d9d9' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.707a1 1 0 0 0-1.414-1.414L12 10.586 7.707 6.293a1 1 0 0 0-1.414 1.414L10.586 12l-4.293 4.293a1 1 0 1 0 1.414 1.414L12 13.414l4.293 4.293a1 1 0 0 0 1.414-1.414L13.414 12z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
152
155
|
}
|
|
153
156
|
.mc-toggle--m:has(:disabled:checked) .mc-toggle__container::after {
|
|
154
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='
|
|
157
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23d9d9d9' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.793a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L10 14.086l6.293-6.293a1 1 0 0 1 1.414 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
155
158
|
}
|
|
156
159
|
.mc-toggle--hide-label .mc-toggle__label {
|
|
157
160
|
clip-path: inset(100%);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import{c as I,k as O,a as S,b as s,f as
|
|
1
|
+
import{c as I,k as O,a as S,b as s,f as b,t as f,h as p,i as T,p as Y,l as q,d,s as P,r,j as o,g as y,m as a,e as J}from"../../custom-element.js";import{i as B}from"../../if.js";import{e as K}from"../../each.js";import{s as C,r as N}from"../../attributes.js";import{b as Q}from"../../input.js";import{c as R}from"../../custom-element-forward-events.js";var U=b('<legend class="mc-field__legend svelte-t87zbg"> </legend>'),V=b('<span class="mc-toggle__label svelte-t87zbg"> </span>'),W=b('<div><label class="mc-toggle__container svelte-t87zbg"><input class="mc-toggle__input svelte-t87zbg" type="checkbox"/> <!></label></div>'),X=b('<fieldset class="mc-field mc-field--group svelte-t87zbg"><!> <div class="mc-field__container svelte-t87zbg"></div></fieldset>');const Z={hash:"svelte-t87zbg",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Do not edit directly, this file was auto-generated.
|
|
6
|
+
*/
|
|
7
|
+
/* stylelint-disable string-no-newline */ .mc-field__legend.svelte-t87zbg {font-size:0.875rem;line-height:1.3;font-weight:400;color:#000000;}.mc-field__legend.svelte-t87zbg {padding-inline:0;}.mc-field--group.svelte-t87zbg {border-width:0;margin-inline:0;padding:0;}
|
|
5
8
|
|
|
6
|
-
/* stylelint-enable string-no-newline */.mc-toggle.svelte-
|
|
9
|
+
/* stylelint-enable string-no-newline */.mc-toggle.svelte-t87zbg {width:fit-content;}.mc-toggle__container.svelte-t87zbg {display:flex;align-items:center;cursor:pointer;gap:0.5rem;position:relative;padding:0.25rem;}.mc-toggle__container.svelte-t87zbg::before, .mc-toggle__container.svelte-t87zbg::after {content:"";}.mc-toggle__container.svelte-t87zbg::before {transition:box-shadow 200ms ease;height:1.5rem;width:2.5rem;background-color:#666666;border-radius:1rem;flex-shrink:0;}.mc-toggle__container.svelte-t87zbg::after {height:1.25rem;width:1.25rem;background-color:#ffffff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23666666' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.364a.75.75 0 1 0-1.06-1.061L10 8.939 6.364 5.303a.75.75 0 0 0-1.06 1.06L8.94 10l-3.637 3.636a.75.75 0 1 0 1.06 1.06L10 11.062l3.636 3.636a.75.75 0 0 0 1.061-1.06L11.061 10z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");border-radius:100%;background-position:center;left:0.375rem;position:absolute;top:50%;transform:translateY(-50%);}.mc-toggle__input.svelte-t87zbg {clip-path:inset(100%);clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}.mc-toggle__label.svelte-t87zbg {color:#000000;font-size:1rem;font-weight:400;line-height:1.5;}.mc-toggle.svelte-t87zbg:has(:where(.svelte-t87zbg):checked) .mc-toggle__container:where(.svelte-t87zbg)::before {background-color:#117f03;}.mc-toggle.svelte-t87zbg:has(:where(.svelte-t87zbg):checked) .mc-toggle__container:where(.svelte-t87zbg)::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23117f03' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.553a.75.75 0 0 1 0 1.06l-5.833 5.834a.75.75 0 0 1-1.06 0l-2.5-2.5a.75.75 0 0 1 1.06-1.06l1.97 1.97 5.303-5.304a.75.75 0 0 1 1.06 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");transform:translate(1rem, -50%);}.mc-toggle.svelte-t87zbg:has(:where(.svelte-t87zbg):disabled) .mc-toggle__container:where(.svelte-t87zbg) {cursor:not-allowed;}.mc-toggle.svelte-t87zbg:has(:where(.svelte-t87zbg):disabled) .mc-toggle__container:where(.svelte-t87zbg)::before {background-color:#d9d9d9;}.mc-toggle.svelte-t87zbg:has(:where(.svelte-t87zbg):disabled) .mc-toggle__container:where(.svelte-t87zbg)::after {background-color:#737373;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23d9d9d9' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.364a.75.75 0 1 0-1.06-1.061L10 8.939 6.364 5.303a.75.75 0 0 0-1.06 1.06L8.94 10l-3.637 3.636a.75.75 0 1 0 1.06 1.06L10 11.062l3.636 3.636a.75.75 0 0 0 1.061-1.06L11.061 10z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");}.mc-toggle.svelte-t87zbg:has(:where(.svelte-t87zbg):disabled) .mc-toggle__label:where(.svelte-t87zbg) {color:#737373;}.mc-toggle.svelte-t87zbg:has(:where(.svelte-t87zbg):disabled:checked) .mc-toggle__container:where(.svelte-t87zbg)::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23d9d9d9' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.553a.75.75 0 0 1 0 1.06l-5.833 5.834a.75.75 0 0 1-1.06 0l-2.5-2.5a.75.75 0 0 1 1.06-1.06l1.97 1.97 5.303-5.304a.75.75 0 0 1 1.06 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");}.mc-toggle.svelte-t87zbg:has(:where(.svelte-t87zbg):focus-visible) .mc-toggle__container:where(.svelte-t87zbg)::before {box-shadow:0 0 0 0.125rem var(--focus-color-mid, #ffffff), 0 0 0 0.25rem var(--focus-color-outer, #000000);outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-toggle--m.svelte-t87zbg .mc-toggle__container:where(.svelte-t87zbg)::before {height:2rem;width:3.5rem;}.mc-toggle--m.svelte-t87zbg .mc-toggle__container:where(.svelte-t87zbg)::after {height:1.5rem;width:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23666666' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.707a1 1 0 0 0-1.414-1.414L12 10.586 7.707 6.293a1 1 0 0 0-1.414 1.414L10.586 12l-4.293 4.293a1 1 0 1 0 1.414 1.414L12 13.414l4.293 4.293a1 1 0 0 0 1.414-1.414L13.414 12z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");left:0.5rem;}.mc-toggle--m.svelte-t87zbg:has(:where(.svelte-t87zbg):checked) .mc-toggle__container:where(.svelte-t87zbg)::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23117f03' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.793a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L10 14.086l6.293-6.293a1 1 0 0 1 1.414 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");transform:translate(1.5rem, -50%);}.mc-toggle--m.svelte-t87zbg:has(:where(.svelte-t87zbg):disabled) .mc-toggle__container:where(.svelte-t87zbg)::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23d9d9d9' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.707a1 1 0 0 0-1.414-1.414L12 10.586 7.707 6.293a1 1 0 0 0-1.414 1.414L10.586 12l-4.293 4.293a1 1 0 1 0 1.414 1.414L12 13.414l4.293 4.293a1 1 0 0 0 1.414-1.414L13.414 12z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");}.mc-toggle--m.svelte-t87zbg:has(:where(.svelte-t87zbg):disabled:checked) .mc-toggle__container:where(.svelte-t87zbg)::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23d9d9d9' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.793a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L10 14.086l6.293-6.293a1 1 0 0 1 1.414 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");}.mc-toggle--hide-label.svelte-t87zbg .mc-toggle__label:where(.svelte-t87zbg) {clip-path:inset(100%);clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}`};function $(z,i){const x=O();Y(i,!0),S(z,Z);const H=[];let n=s(i,"name",7),h=s(i,"id",7,x),c=s(i,"options",7),m=s(i,"legend",7),v=s(i,"values",31,()=>q([]));function D(e){var t;return((t=c()[e])==null?void 0:t.id)??`${h()}-${e}`}var u=X(),k=d(u);{var j=e=>{var t=U(),g=d(t,!0);r(t),f(()=>y(g,m())),p(e,t)};B(k,e=>{m()&&e(j)})}var w=P(k,2);return K(w,23,c,(e,t)=>D(t),(e,t)=>{var g=W(),L=d(g),l=d(L);N(l);var M,A=P(l,2);{var F=E=>{var _=V(),G=d(_,!0);r(_),f(()=>y(G,a(t).label)),p(E,_)};B(A,E=>{a(t).label&&E(F)})}r(L),r(g),f(()=>{J(g,1,`mc-toggle mc-field__item ${a(t).label?"":" mc-toggle--hide-label"} ${a(t).size==="m"?" mc-toggle--m":""}`,"svelte-t87zbg"),C(l,"id",n()),C(l,"name",n()),l.disabled=a(t).disabled,M!==(M=a(t).value)&&(l.value=(l.__value=a(t).value)??"")}),Q(H,[],l,()=>(a(t).value,v()),v),p(e,g)}),r(w),r(u),f(()=>C(w,"id",h())),p(z,u),T({get name(){return n()},set name(e){n(e),o()},get id(){return h()},set id(e=x){h(e),o()},get options(){return c()},set options(e){c(e),o()},get legend(){return m()},set legend(e){m(e),o()},get values(){return v()},set values(e=[]){v(e),o()}})}customElements.define("m-toggle-group",I($,{options:{attribute:"options",reflect:!0,type:"Array"},name:{},id:{},legend:{},values:{}},[],[],!0,R));
|
|
7
10
|
//# sourceMappingURL=ToggleGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleGroup.js","sources":["../../../src/components/togglegroup/ToggleGroup.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-toggle-group',\n props: {\n options: { reflect: true, type: 'Array', attribute: 'options' },\n },\n extend: customElementForwardEvents,\n }}\n/>\n\n<script lang=\"ts\">\n import { customElementForwardEvents } from '../../utils';\n\n interface ToggleGroupOption {\n value: string;\n id?: string;\n label?: string;\n disabled?: boolean;\n indeterminate?: boolean;\n isinvalid?: boolean;\n size?: 's' | 'm';\n }\n\n interface Props {\n options: Array<ToggleGroupOption>;\n name: string;\n id?: string;\n legend?: string;\n values?: Array<string | number>;\n }\n\n const uid = $props.id();\n let {\n name,\n id = uid,\n options,\n legend,\n values = $bindable([]),\n }: Props = $props();\n\n function getOptionId(index: number): string {\n return options[index]?.id ?? `${id}-${index}`;\n }\n</script>\n\n<fieldset class=\"mc-field mc-field--group\">\n {#if legend}\n <legend class=\"mc-field__legend\">\n {legend}\n </legend>\n {/if}\n <div {id} class=\"mc-field__container\">\n {#each options as opt, index (getOptionId(index))}\n <div\n class=\"mc-toggle mc-field__item {!opt.label\n ? ' mc-toggle--hide-label'\n : ''} {opt.size === 'm' ? ' mc-toggle--m' : ''}\"\n >\n <label class=\"mc-toggle__container\">\n <input\n class=\"mc-toggle__input\"\n id={name}\n {name}\n type=\"checkbox\"\n bind:group={values}\n value={opt.value}\n disabled={opt.disabled}\n />\n {#if opt.label}\n <span class=\"mc-toggle__label\">{opt.label}</span>\n {/if}\n </label>\n </div>\n {/each}\n </div>\n</fieldset>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/field';\n @use '@mozaic-ds/styles/components/toggle';\n</style>\n"],"names":["uid","$.props_id","name","$.prop","$$props","id","options","legend","values","$.proxy","getOptionId","index","_a","$$render","consequent","$.each","div","opt","$.template_effect","$.set_text","text_1","$.get","consequent_1","$.set_class","div_1","input","input_value","customElementForwardEvents"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToggleGroup.js","sources":["../../../src/components/togglegroup/ToggleGroup.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-toggle-group',\n props: {\n options: { reflect: true, type: 'Array', attribute: 'options' },\n },\n extend: customElementForwardEvents,\n }}\n/>\n\n<script lang=\"ts\">\n import { customElementForwardEvents } from '../../utils';\n\n interface ToggleGroupOption {\n value: string;\n id?: string;\n label?: string;\n disabled?: boolean;\n indeterminate?: boolean;\n isinvalid?: boolean;\n size?: 's' | 'm';\n }\n\n interface Props {\n options: Array<ToggleGroupOption>;\n name: string;\n id?: string;\n legend?: string;\n values?: Array<string | number>;\n }\n\n const uid = $props.id();\n let {\n name,\n id = uid,\n options,\n legend,\n values = $bindable([]),\n }: Props = $props();\n\n function getOptionId(index: number): string {\n return options[index]?.id ?? `${id}-${index}`;\n }\n</script>\n\n<fieldset class=\"mc-field mc-field--group\">\n {#if legend}\n <legend class=\"mc-field__legend\">\n {legend}\n </legend>\n {/if}\n <div {id} class=\"mc-field__container\">\n {#each options as opt, index (getOptionId(index))}\n <div\n class=\"mc-toggle mc-field__item {!opt.label\n ? ' mc-toggle--hide-label'\n : ''} {opt.size === 'm' ? ' mc-toggle--m' : ''}\"\n >\n <label class=\"mc-toggle__container\">\n <input\n class=\"mc-toggle__input\"\n id={name}\n {name}\n type=\"checkbox\"\n bind:group={values}\n value={opt.value}\n disabled={opt.disabled}\n />\n {#if opt.label}\n <span class=\"mc-toggle__label\">{opt.label}</span>\n {/if}\n </label>\n </div>\n {/each}\n </div>\n</fieldset>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/field';\n @use '@mozaic-ds/styles/components/toggle';\n</style>\n"],"names":["uid","$.props_id","name","$.prop","$$props","id","options","legend","values","$.proxy","getOptionId","index","_a","$$render","consequent","$.each","div","opt","$.template_effect","$.set_text","text_1","$.get","consequent_1","$.set_class","div_1","input","input_value","customElementForwardEvents"],"mappings":";;;;;;;;8+NAAA,OA+BQA,EAAGC,EAAA,gCAEPC,EAAIC,EAAAC,EAAA,OAAA,CAAA,EACJC,aAAKL,CAAG,EACRM,EAAOH,EAAAC,EAAA,UAAA,CAAA,EACPG,EAAMJ,EAAAC,EAAA,SAAA,CAAA,EACNI,EAAML,EAAAC,EAAA,SAAA,GAAA,IAAAK,EAAA,CAAA,CAAA,CAAA,WAGCC,EAAYC,EAAuB,OACnC,QAAAC,EAAAN,EAAO,EAACK,CAAK,IAAb,YAAAC,EAAgB,KAAS,GAAAP,OAAMM,CAAK,EAC7C,gEAMKJ,EAAM,CAAA,CAAA,kBAFNA,EAAM,GAAAM,EAAAC,CAAA,iBAMFC,OAAAA,EAAAC,EAAA,GAAAV,GAAWW,EAAGN,IAASD,EAAYC,CAAK,KAA7BM,IAAG,iFAiBmBC,EAAA,IAAAC,EAAAC,EAAAC,EAAAJ,CAAG,EAAC,KAAK,CAAA,kBADtCI,EAAAJ,CAAG,EAAC,OAAKJ,EAAAS,CAAA,qBAdkBC,EAAAC,EAAA,EAAA,4BAAAH,EAAAJ,CAAG,EAAC,MAElC,GADA,wBACE,IAAGI,EAAAJ,CAAG,EAAC,OAAS,IAAM,gBAAkB,EAAE,GAAA,eAAA,WAKxCf,GAAI,kBAKEuB,EAAA,SAAAJ,EAAAJ,CAAG,EAAC,SADPS,KAAAA,EAAAL,EAAAJ,CAAG,EAAC,SAAJQ,EAAA,OAAAA,EAAA,QAAAJ,EAAAJ,CAAG,EAAC,QAAK,oBAATI,EAAAJ,CAAG,EAAC,MADCT,EAAM,GAANA,gIA9BfR,EAAG,oKASZ,+IArCY2B"}
|
|
@@ -78,22 +78,25 @@
|
|
|
78
78
|
<style>/**
|
|
79
79
|
* Do not edit directly, this file was auto-generated.
|
|
80
80
|
*/
|
|
81
|
+
/**
|
|
82
|
+
* Do not edit directly, this file was auto-generated.
|
|
83
|
+
*/
|
|
81
84
|
/* stylelint-disable string-no-newline */
|
|
82
85
|
.mc-field__label, .mc-field__legend {
|
|
83
|
-
font-size:
|
|
84
|
-
line-height:
|
|
85
|
-
font-weight:
|
|
86
|
-
color:
|
|
86
|
+
font-size: 0.875rem;
|
|
87
|
+
line-height: 1.3;
|
|
88
|
+
font-weight: 400;
|
|
89
|
+
color: #000000;
|
|
87
90
|
}
|
|
88
91
|
.mc-field__legend {
|
|
89
92
|
padding-inline: 0;
|
|
90
93
|
}
|
|
91
94
|
.mc-field__requirement, .mc-field__help {
|
|
92
|
-
font-size:
|
|
93
|
-
line-height:
|
|
94
|
-
font-weight:
|
|
95
|
+
font-size: 0.75rem;
|
|
96
|
+
line-height: 1.5;
|
|
97
|
+
font-weight: 400;
|
|
95
98
|
vertical-align: top;
|
|
96
|
-
color:
|
|
99
|
+
color: #666666;
|
|
97
100
|
}
|
|
98
101
|
.mc-field__help {
|
|
99
102
|
display: block;
|
|
@@ -103,8 +106,8 @@
|
|
|
103
106
|
margin-top: 0.5rem;
|
|
104
107
|
}
|
|
105
108
|
.mc-field__validation-message {
|
|
106
|
-
font-size:
|
|
107
|
-
line-height:
|
|
109
|
+
font-size: 0.875rem;
|
|
110
|
+
line-height: 1.5;
|
|
108
111
|
display: inline-flex;
|
|
109
112
|
gap: 0.25rem;
|
|
110
113
|
margin-top: 0.25rem;
|
|
@@ -115,19 +118,19 @@
|
|
|
115
118
|
width: 1.25rem;
|
|
116
119
|
}
|
|
117
120
|
.mc-field__validation-message.is-valid {
|
|
118
|
-
color:
|
|
121
|
+
color: #117f03;
|
|
119
122
|
}
|
|
120
123
|
.mc-field__validation-message.is-valid::before {
|
|
121
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='
|
|
124
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23117f03' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M3.25 10c0-3.72792 3.02208-6.75 6.75-6.75 3.7279 0 6.75 3.02208 6.75 6.75 0 3.7279-3.0221 6.75-6.75 6.75-3.72792 0-6.75-3.0221-6.75-6.75ZM10 1.75c-4.55635 0-8.25 3.69365-8.25 8.25 0 4.5563 3.69365 8.25 8.25 8.25 4.5563 0 8.25-3.6937 8.25-8.25 0-4.55635-3.6937-8.25-8.25-8.25Zm4.2803 6.697c.2929-.2929.2929-.76777 0-1.06066-.2929-.2929-.7677-.2929-1.0606 0L9.16667 11.4393 7.197 9.46967c-.2929-.29289-.76777-.29289-1.06066 0-.2929.29289-.2929.76773 0 1.06063l2.5 2.5c.29289.2929.76776.2929 1.06066 0l4.5833-4.5833Z'/%3E%3C/svg%3E");
|
|
122
125
|
}
|
|
123
126
|
.mc-field__validation-message.is-invalid {
|
|
124
|
-
color:
|
|
127
|
+
color: #c61112;
|
|
125
128
|
}
|
|
126
129
|
.mc-field__validation-message.is-invalid::before {
|
|
127
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='
|
|
130
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23c61112' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 3.25c-3.72792 0-6.75 3.02208-6.75 6.75 0 3.7279 3.02208 6.75 6.75 6.75 3.7279 0 6.75-3.0221 6.75-6.75 0-3.72792-3.0221-6.75-6.75-6.75ZM1.75 10c0-4.55635 3.69365-8.25 8.25-8.25 4.5563 0 8.25 3.69365 8.25 8.25 0 4.5563-3.6937 8.25-8.25 8.25-4.55635 0-8.25-3.6937-8.25-8.25ZM10 5.91667c.4142 0 .75.33578.75.75v4.16663c0 .4142-.3358.75-.75.75-.41421 0-.75-.3358-.75-.75V6.66667c0-.41422.33579-.75.75-.75Zm0 8.25003c.4602 0 .8333-.3731.8333-.8334 0-.4602-.3731-.8333-.8333-.8333-.46024 0-.83333.3731-.83333.8333 0 .4603.37309.8334.83333.8334Z'/%3E%3C/svg%3E");
|
|
128
131
|
}
|
|
129
132
|
.mc-field__validation-message.is-loading {
|
|
130
|
-
color:
|
|
133
|
+
color: #666666;
|
|
131
134
|
}
|
|
132
135
|
.mc-field--group {
|
|
133
136
|
border-width: 0;
|
|
@@ -164,16 +167,16 @@
|
|
|
164
167
|
transition: box-shadow 200ms ease;
|
|
165
168
|
height: 1.5rem;
|
|
166
169
|
width: 2.5rem;
|
|
167
|
-
background-color:
|
|
168
|
-
border-radius:
|
|
170
|
+
background-color: #666666;
|
|
171
|
+
border-radius: 1rem;
|
|
169
172
|
flex-shrink: 0;
|
|
170
173
|
}
|
|
171
174
|
.mc-toggle__container::after {
|
|
172
175
|
height: 1.25rem;
|
|
173
176
|
width: 1.25rem;
|
|
174
|
-
background-color:
|
|
175
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='
|
|
176
|
-
border-radius:
|
|
177
|
+
background-color: #ffffff;
|
|
178
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23666666' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.364a.75.75 0 1 0-1.06-1.061L10 8.939 6.364 5.303a.75.75 0 0 0-1.06 1.06L8.94 10l-3.637 3.636a.75.75 0 1 0 1.06 1.06L10 11.062l3.636 3.636a.75.75 0 0 0 1.061-1.06L11.061 10z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
179
|
+
border-radius: 100%;
|
|
177
180
|
background-position: center;
|
|
178
181
|
left: 0.375rem;
|
|
179
182
|
position: absolute;
|
|
@@ -191,36 +194,36 @@
|
|
|
191
194
|
width: 1px;
|
|
192
195
|
}
|
|
193
196
|
.mc-toggle__label {
|
|
194
|
-
color:
|
|
195
|
-
font-size:
|
|
196
|
-
font-weight:
|
|
197
|
-
line-height:
|
|
197
|
+
color: #000000;
|
|
198
|
+
font-size: 1rem;
|
|
199
|
+
font-weight: 400;
|
|
200
|
+
line-height: 1.5;
|
|
198
201
|
}
|
|
199
202
|
.mc-toggle:has(:checked) .mc-toggle__container::before {
|
|
200
|
-
background-color:
|
|
203
|
+
background-color: #117f03;
|
|
201
204
|
}
|
|
202
205
|
.mc-toggle:has(:checked) .mc-toggle__container::after {
|
|
203
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='
|
|
206
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23117f03' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.553a.75.75 0 0 1 0 1.06l-5.833 5.834a.75.75 0 0 1-1.06 0l-2.5-2.5a.75.75 0 0 1 1.06-1.06l1.97 1.97 5.303-5.304a.75.75 0 0 1 1.06 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
204
207
|
transform: translate(1rem, -50%);
|
|
205
208
|
}
|
|
206
209
|
.mc-toggle:has(:disabled) .mc-toggle__container {
|
|
207
210
|
cursor: not-allowed;
|
|
208
211
|
}
|
|
209
212
|
.mc-toggle:has(:disabled) .mc-toggle__container::before {
|
|
210
|
-
background-color:
|
|
213
|
+
background-color: #d9d9d9;
|
|
211
214
|
}
|
|
212
215
|
.mc-toggle:has(:disabled) .mc-toggle__container::after {
|
|
213
|
-
background-color:
|
|
214
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='
|
|
216
|
+
background-color: #737373;
|
|
217
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23d9d9d9' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.364a.75.75 0 1 0-1.06-1.061L10 8.939 6.364 5.303a.75.75 0 0 0-1.06 1.06L8.94 10l-3.637 3.636a.75.75 0 1 0 1.06 1.06L10 11.062l3.636 3.636a.75.75 0 0 0 1.061-1.06L11.061 10z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
215
218
|
}
|
|
216
219
|
.mc-toggle:has(:disabled) .mc-toggle__label {
|
|
217
|
-
color:
|
|
220
|
+
color: #737373;
|
|
218
221
|
}
|
|
219
222
|
.mc-toggle:has(:disabled:checked) .mc-toggle__container::after {
|
|
220
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='
|
|
223
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='%23d9d9d9' viewBox='0 0 20 20'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M14.697 6.553a.75.75 0 0 1 0 1.06l-5.833 5.834a.75.75 0 0 1-1.06 0l-2.5-2.5a.75.75 0 0 1 1.06-1.06l1.97 1.97 5.303-5.304a.75.75 0 0 1 1.06 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h20v20H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
221
224
|
}
|
|
222
225
|
.mc-toggle:has(:focus-visible) .mc-toggle__container::before {
|
|
223
|
-
box-shadow: 0 0 0 0.125rem var(--focus-color-mid,
|
|
226
|
+
box-shadow: 0 0 0 0.125rem var(--focus-color-mid, #ffffff), 0 0 0 0.25rem var(--focus-color-outer, #000000);
|
|
224
227
|
outline: 0.125rem solid transparent;
|
|
225
228
|
outline-offset: 0.125rem;
|
|
226
229
|
}
|
|
@@ -231,18 +234,18 @@
|
|
|
231
234
|
.mc-toggle--m .mc-toggle__container::after {
|
|
232
235
|
height: 1.5rem;
|
|
233
236
|
width: 1.5rem;
|
|
234
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='
|
|
237
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23666666' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.707a1 1 0 0 0-1.414-1.414L12 10.586 7.707 6.293a1 1 0 0 0-1.414 1.414L10.586 12l-4.293 4.293a1 1 0 1 0 1.414 1.414L12 13.414l4.293 4.293a1 1 0 0 0 1.414-1.414L13.414 12z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
235
238
|
left: 0.5rem;
|
|
236
239
|
}
|
|
237
240
|
.mc-toggle--m:has(:checked) .mc-toggle__container::after {
|
|
238
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='
|
|
241
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23117f03' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.793a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L10 14.086l6.293-6.293a1 1 0 0 1 1.414 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
239
242
|
transform: translate(1.5rem, -50%);
|
|
240
243
|
}
|
|
241
244
|
.mc-toggle--m:has(:disabled) .mc-toggle__container::after {
|
|
242
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='
|
|
245
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23d9d9d9' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.707a1 1 0 0 0-1.414-1.414L12 10.586 7.707 6.293a1 1 0 0 0-1.414 1.414L10.586 12l-4.293 4.293a1 1 0 1 0 1.414 1.414L12 13.414l4.293 4.293a1 1 0 0 0 1.414-1.414L13.414 12z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
243
246
|
}
|
|
244
247
|
.mc-toggle--m:has(:disabled:checked) .mc-toggle__container::after {
|
|
245
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='
|
|
248
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.5rem' width='1.5rem' fill='%23d9d9d9' viewBox='0 0 24 24'%3E%3Cg clip-path='url(%23a)'%3E%3Cpath fill-rule='evenodd' d='M17.707 7.793a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L10 14.086l6.293-6.293a1 1 0 0 1 1.414 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h24v24H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
246
249
|
}
|
|
247
250
|
.mc-toggle--hide-label .mc-toggle__label {
|
|
248
251
|
clip-path: inset(100%);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as f,p as _,a as z,b as i,f as b,d as x,s as g,r as d,t as u,e as w,g as y,h as E,i as C,j as n}from"../../custom-element.js";import{s as B}from"../../slot.js";import{s as h}from"../../attributes.js";var D=b('<div><!> <span class="mc-tooltip__content svelte-zvx9k5" role="tooltip"> </span></div>');const M={hash:"svelte-zvx9k5",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Do not edit directly, this file was auto-generated.
|
|
6
|
+
*/.mc-tooltip.svelte-zvx9k5 {display:inline-flex;position:relative;}.mc-tooltip.svelte-zvx9k5:focus, .mc-tooltip.svelte-zvx9k5:hover {cursor:help;}.mc-tooltip.svelte-zvx9k5:focus .mc-tooltip__content:where(.svelte-zvx9k5), .mc-tooltip.svelte-zvx9k5:hover .mc-tooltip__content:where(.svelte-zvx9k5) {visibility:visible;}.mc-tooltip__content.svelte-zvx9k5 {font-size:0.875rem;border-radius:0.25rem;line-height:1.3;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;align-items:center;max-width:16rem;min-width:4rem;background-color:#242938;box-sizing:border-box;color:#ffffff;position:absolute;text-align:center;visibility:hidden;z-index:var(--tooltip-z-index, 1);border:1px solid #636d88;word-break:break-all;padding:0.375rem 0.5rem;}
|
|
7
|
+
@supports (width: max-content) {.mc-tooltip__content.svelte-zvx9k5 {width:max-content;}
|
|
8
|
+
}.mc-tooltip__content.svelte-zvx9k5::before {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='0.5rem' width='0.5rem' viewBox='0 0 8 8'%3E%3Cpath fill='%23636d88' d='M1.79 3.11l6.21-3.11v8l-6.21-3.11a1 1 0 0 1-.45-1.34 1 1 0 0 1 .45-.44z'/%3E%3C/svg%3E");background-color:transparent;background-repeat:no-repeat;background-size:0.625rem;content:"";height:0.625rem;position:absolute;width:0.625rem;}.mc-tooltip__content.svelte-zvx9k5::after {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='0.5rem' width='0.5rem' viewBox='0 0 8 8'%3E%3Cpath fill='%23242938' d='M1.79 3.11l6.21-3.11v8l-6.21-3.11a1 1 0 0 1-.45-1.34 1 1 0 0 1 .45-.44z'/%3E%3C/svg%3E");background-color:transparent;background-repeat:no-repeat;background-size:0.5rem;content:"";height:0.5rem;position:absolute;width:0.5rem;}.mc-tooltip--top.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5) {top:0;left:50%;transform:translate(-50%, calc(-100% - 1rem));}.mc-tooltip--top.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::after, .mc-tooltip--top.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::before {bottom:0;left:50%;transform:translate(-50%, 100%) rotate(-90deg);}.mc-tooltip--top.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::before {bottom:-1px;}.mc-tooltip--right.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5) {top:50%;right:0;transform:translate(calc(100% + 1rem), -50%);}.mc-tooltip--right.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::after, .mc-tooltip--right.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::before {top:50%;left:0;transform:translate(-99%, -50%);}.mc-tooltip--right.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::before {left:-1px;}.mc-tooltip--left.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5) {left:0;top:50%;transform:translate(calc(-100% - 1rem), -50%);}.mc-tooltip--left.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::after, .mc-tooltip--left.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::before {top:50%;right:0;transform:translate(99%, -50%) rotate(180deg);}.mc-tooltip--left.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::before {right:-1px;}.mc-tooltip--bottom.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5) {bottom:0;left:50%;transform:translate(-50%, calc(100% + 1rem));}.mc-tooltip--bottom.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::after, .mc-tooltip--bottom.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::before {top:0;left:50%;transform:translate(-50%, -100%) rotate(90deg);}.mc-tooltip--bottom.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::before {top:-1px;}.mc-tooltip--no-pointer.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::after, .mc-tooltip--no-pointer.svelte-zvx9k5 .mc-tooltip__content:where(.svelte-zvx9k5)::before {background:none;}`};function j(v,e){_(e,!0),z(v,M);let r=i(e,"id",7),s=i(e,"text",7),o=i(e,"position",7,"top"),a=i(e,"pointer",7,!0);var l=D();let p;var m=x(l);B(m,e,"default",{});var c=g(m,2),k=x(c,!0);return d(c),d(l),u(t=>{p=w(l,1,"mc-tooltip svelte-zvx9k5",null,p,t),h(l,"aria-describedby",r()),h(c,"id",r()),y(k,s())},[()=>({"mc-tooltip--no-pointer":!a(),"mc-tooltip--top":o()==="top","mc-tooltip--bottom":o()==="bottom","mc-tooltip--left":o()==="left","mc-tooltip--right":o()==="right"})]),E(v,l),C({get id(){return r()},set id(t){r(t),n()},get text(){return s()},set text(t){s(t),n()},get position(){return o()},set position(t="top"){o(t),n()},get pointer(){return a()},set pointer(t=!0){a(t),n()}})}customElements.define("m-tooltip",f(j,{options:{attribute:"pointer",reflect:!0,type:"Boolean"},id:{},text:{},position:{},pointer:{}},["default"],[],!0));
|
|
6
9
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/tooltip/Tooltip.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-tooltip',\n props: {\n options: { reflect: true, type: 'Boolean', attribute: 'pointer' },\n },\n }}\n/>\n\n<script lang=\"ts\">\n interface Props {\n id: string;\n text: string;\n position?: 'top' | 'bottom' | 'left' | 'right';\n pointer?: boolean;\n }\n\n let { id, text, position = 'top', pointer = true }: Props = $props();\n</script>\n\n<div\n class=\"mc-tooltip\"\n class:mc-tooltip--no-pointer={!pointer}\n class:mc-tooltip--top={position === 'top'}\n class:mc-tooltip--bottom={position === 'bottom'}\n class:mc-tooltip--left={position === 'left'}\n class:mc-tooltip--right={position === 'right'}\n aria-describedby={id}\n>\n <slot />\n <span {id} class=\"mc-tooltip__content\" role=\"tooltip\">\n {text}\n </span>\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/tooltip';\n</style>\n"],"names":["id","$.prop","$$props","text","position","pointer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/tooltip/Tooltip.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-tooltip',\n props: {\n options: { reflect: true, type: 'Boolean', attribute: 'pointer' },\n },\n }}\n/>\n\n<script lang=\"ts\">\n interface Props {\n id: string;\n text: string;\n position?: 'top' | 'bottom' | 'left' | 'right';\n pointer?: boolean;\n }\n\n let { id, text, position = 'top', pointer = true }: Props = $props();\n</script>\n\n<div\n class=\"mc-tooltip\"\n class:mc-tooltip--no-pointer={!pointer}\n class:mc-tooltip--top={position === 'top'}\n class:mc-tooltip--bottom={position === 'bottom'}\n class:mc-tooltip--left={position === 'left'}\n class:mc-tooltip--right={position === 'right'}\n aria-describedby={id}\n>\n <slot />\n <span {id} class=\"mc-tooltip__content\" role=\"tooltip\">\n {text}\n </span>\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/tooltip';\n</style>\n"],"names":["id","$.prop","$$props","text","position","pointer"],"mappings":";;;;;;;85FAAA,oBAiBQA,EAAEC,EAAAC,EAAA,KAAA,CAAA,EAAEC,EAAIF,EAAAC,EAAA,OAAA,CAAA,EAAEE,mBAAW,KAAK,EAAEC,kBAAU,EAAI,mKAU9BL,GAAE,oBAIjBG,GAAI,oCATwBE,EAAO,EACf,kBAAAD,EAAQ,IAAK,MACV,qBAAAA,EAAQ,IAAK,SACf,mBAAAA,EAAQ,IAAK,OACZ,oBAAAA,EAAQ,IAAK,sJATX,MAAK,mDAAY,GAAI,YAClD"}
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
<style>/**
|
|
37
37
|
* Do not edit directly, this file was auto-generated.
|
|
38
38
|
*/
|
|
39
|
+
/**
|
|
40
|
+
* Do not edit directly, this file was auto-generated.
|
|
41
|
+
*/
|
|
39
42
|
.mc-tooltip {
|
|
40
43
|
display: inline-flex;
|
|
41
44
|
position: relative;
|
|
@@ -47,9 +50,9 @@
|
|
|
47
50
|
visibility: visible;
|
|
48
51
|
}
|
|
49
52
|
.mc-tooltip__content {
|
|
50
|
-
font-size:
|
|
51
|
-
border-radius:
|
|
52
|
-
line-height:
|
|
53
|
+
font-size: 0.875rem;
|
|
54
|
+
border-radius: 0.25rem;
|
|
55
|
+
line-height: 1.3;
|
|
53
56
|
display: -webkit-box;
|
|
54
57
|
-webkit-box-orient: vertical;
|
|
55
58
|
-webkit-line-clamp: 2;
|
|
@@ -57,14 +60,14 @@
|
|
|
57
60
|
align-items: center;
|
|
58
61
|
max-width: 16rem;
|
|
59
62
|
min-width: 4rem;
|
|
60
|
-
background-color:
|
|
63
|
+
background-color: #242938;
|
|
61
64
|
box-sizing: border-box;
|
|
62
|
-
color:
|
|
65
|
+
color: #ffffff;
|
|
63
66
|
position: absolute;
|
|
64
67
|
text-align: center;
|
|
65
68
|
visibility: hidden;
|
|
66
69
|
z-index: var(--tooltip-z-index, 1);
|
|
67
|
-
border:
|
|
70
|
+
border: 1px solid #636d88;
|
|
68
71
|
word-break: break-all;
|
|
69
72
|
padding: 0.375rem 0.5rem;
|
|
70
73
|
}
|
|
@@ -74,7 +77,7 @@
|
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
.mc-tooltip__content::before {
|
|
77
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='0.5rem' width='0.5rem' viewBox='0 0 8 8'%3E%3Cpath fill='
|
|
80
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='0.5rem' width='0.5rem' viewBox='0 0 8 8'%3E%3Cpath fill='%23636d88' d='M1.79 3.11l6.21-3.11v8l-6.21-3.11a1 1 0 0 1-.45-1.34 1 1 0 0 1 .45-.44z'/%3E%3C/svg%3E");
|
|
78
81
|
background-color: transparent;
|
|
79
82
|
background-repeat: no-repeat;
|
|
80
83
|
background-size: 0.625rem;
|
|
@@ -84,7 +87,7 @@
|
|
|
84
87
|
width: 0.625rem;
|
|
85
88
|
}
|
|
86
89
|
.mc-tooltip__content::after {
|
|
87
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='0.5rem' width='0.5rem' viewBox='0 0 8 8'%3E%3Cpath fill='
|
|
90
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='0.5rem' width='0.5rem' viewBox='0 0 8 8'%3E%3Cpath fill='%23242938' d='M1.79 3.11l6.21-3.11v8l-6.21-3.11a1 1 0 0 1-.45-1.34 1 1 0 0 1 .45-.44z'/%3E%3C/svg%3E");
|
|
88
91
|
background-color: transparent;
|
|
89
92
|
background-repeat: no-repeat;
|
|
90
93
|
background-size: 0.5rem;
|