@mozaic-ds/web-components 1.0.0-alpha.1 → 1.0.0-alpha.2
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/package.json +1 -1
- package/public/attributes-Dd-ZbJDt.js +2 -0
- package/public/{attributes-C2cU7aS9.js.map → attributes-Dd-ZbJDt.js.map} +1 -1
- package/public/components/badge/Badge.js +1 -1
- package/public/components/button/Button.js +1 -1
- package/public/components/button/Button.js.map +1 -1
- package/public/components/button/Button.svelte +12 -8
- package/public/components/button/IconButton.js +1 -1
- package/public/components/button/IconButton.js.map +1 -1
- package/public/components/checkbox/Checkbox.js +1 -1
- package/public/components/checkbox/Checkbox.js.map +1 -1
- package/public/components/checkbox/Checkbox.svelte +2 -0
- package/public/components/checkboxgroup/checkboxGroup.js +1 -1
- package/public/components/checkboxgroup/checkboxGroup.js.map +1 -1
- package/public/components/checkboxgroup/checkboxGroup.svelte +8 -18
- package/public/components/field/Field.js +1 -1
- package/public/components/iconbutton/IconButton.svelte +5 -3
- package/public/components/link/Link.js +1 -1
- package/public/components/link/Link.js.map +1 -1
- package/public/components/loader/Loader.js +1 -1
- package/public/components/loader/Loader.js.map +1 -1
- package/public/components/loader/Loader.svelte +3 -2
- package/public/components/overlay/Overlay.js +1 -1
- package/public/components/overlay/OverlayLoader.js +1 -1
- package/public/components/quantityselector/QuantitySelector.js +1 -1
- package/public/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/components/quantityselector/QuantitySelector.svelte +10 -11
- package/public/components/radio/Radio.js +1 -1
- package/public/components/radiogroup/RadioGroup.js +1 -1
- package/public/components/select/Select.js +1 -1
- package/public/components/statusbadge/StatusBadge.js +1 -1
- package/public/components/statusbadge/StatusDot.js +1 -1
- package/public/components/textarea/Textarea.js +1 -1
- package/public/components/textarea/Textarea.js.map +1 -1
- package/public/components/textinput/Textinput.js +1 -1
- package/public/components/textinput/Textinput.js.map +1 -1
- package/public/components/textinput/Textinput.svelte +5 -17
- package/public/components/toggle/Toggle.js +1 -1
- package/public/components/toggle/Toggle.js.map +1 -1
- package/public/custom-element-D6iR2OWc.js +2 -0
- package/public/{custom-element-C0xaDU2s.js.map → custom-element-D6iR2OWc.js.map} +1 -1
- package/public/each-BEbHCKXS.js +2 -0
- package/public/{each-6TetsjSv.js.map → each-BEbHCKXS.js.map} +1 -1
- package/public/html-BTWDDGk7.js +2 -0
- package/public/{html-h1-V2s6a.js.map → html-BTWDDGk7.js.map} +1 -1
- package/public/if-CxjAhvpF.js +2 -0
- package/public/{if-B_xe8pYW.js.map → if-CxjAhvpF.js.map} +1 -1
- package/public/{input-B-lhkJUW.js → input-D1i5U2EE.js} +2 -2
- package/public/{input-B-lhkJUW.js.map → input-D1i5U2EE.js.map} +1 -1
- package/public/{slot-DQF0Tqfq.js → slot-snFjRYH3.js} +2 -2
- package/public/{slot-DQF0Tqfq.js.map → slot-snFjRYH3.js.map} +1 -1
- package/public/attributes-C2cU7aS9.js +0 -2
- package/public/custom-element-C0xaDU2s.js +0 -2
- package/public/each-6TetsjSv.js +0 -2
- package/public/html-h1-V2s6a.js +0 -2
- package/public/if-B_xe8pYW.js +0 -2
package/package.json
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e,s as t,aC as a,aD as l,P as s,aE as r,aF as n,aG as u,aH as i,aI as c,aJ as o,y as f,aK as v,aL as d,ar as _,D as h,aM as m}from"./custom-element-D6iR2OWc.js";const b=Symbol("class");function p(e){if(f){var t=!1,a=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var a=e.value;A(e,"value",null),e.value=a}if(e.hasAttribute("checked")){var l=e.checked;A(e,"checked",null),e.checked=l}}};e.__on_r=a,v(a),d()}}function y(e,t){var a=e.__attributes??={};a.checked!==(a.checked=t??void 0)&&(e.checked=t)}function k(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function A(e,t,a,l){var s=e.__attributes??={};f&&(s[t]=e.getAttribute(t),"src"===t||"srcset"===t||"href"===t&&"LINK"===e.nodeName)?function(e,t,a){if(!h)return;if("srcset"===t&&function(e,t){var a=N(e.srcset),l=N(t);return l.length===a.length&&l.every((([e,t],l)=>t===a[l][1]&&(I(a[l][0],e)||I(e,a[l][0]))))}(e,a))return;if(I(e.getAttribute(t)??"",a))return;m(t,e.outerHTML.replace(e.innerHTML,e.innerHTML&&"..."),String(a))}(e,t,a??""):s[t]!==(s[t]=a)&&("style"===t&&"__styles"in e&&(e.__styles={}),"loading"===t&&(e[i]=a),null==a?e.removeAttribute(t):"string"!=typeof a&&w(e).includes(t)?e[t]=a:e.setAttribute(t,a))}function g(u,i,o,v,d=!1,h=!1,m=!1){let p=f&&h;p&&_(!1);var y=i||{},g="OPTION"===u.tagName;for(var L in i)L in o||(o[L]=null);o.class?o.class=e(o.class):(v||o[b])&&(o.class=null);var I=w(u),N=u.__attributes??={};for(const H in o){let x=o[H];if(g&&"value"===H&&null==x)u.value=u.__value="",y[H]=x;else if("class"!==H){var $=y[H];if(x!==$){y[H]=x;var C=H[0]+H[1];if("$$"!==C){if("on"===C){const E={},V="$$"+H;let B=H.slice(2);var M=c(B);if(a(B)&&(B=B.slice(0,-7),E.capture=!0),!M&&$){if(null!=x)continue;u.removeEventListener(B,y[V],E),y[V]=null}if(null!=x)if(M)u[`__${B}`]=x,s([B]);else{function D(e){y[H].call(this,e)}y[V]=l(B,u,D,E)}else M&&(u[`__${B}`]=void 0)}else if("style"===H&&null!=x)u.style.cssText=x+"";else if("autofocus"===H)r(u,Boolean(x));else if(h||"__value"!==H&&("value"!==H||null==x))if("selected"===H&&g)k(u,x);else{var R=H;d||(R=n(R));var T="defaultValue"===R||"defaultChecked"===R;if(null!=x||h||T)T||I.includes(R)&&(h||"string"!=typeof x)?u[R]=x:"function"!=typeof x&&A(u,R,x);else if(N[H]=null,"value"===R||"checked"===R){let K=u;const O=void 0===i;if("value"===R){let P=K.defaultValue;K.removeAttribute(R),K.defaultValue=P,K.value=K.__value=O?P:null}else{let S=K.defaultChecked;K.removeAttribute(R),K.defaultChecked=S,K.checked=!!O&&S}}else u.removeAttribute(H)}else u.value=u.__value=x;"style"===H&&"__styles"in u&&(u.__styles={})}}}else{var U="http://www.w3.org/1999/xhtml"===u.namespaceURI;t(u,U,x,v,i?.[b],o[b]),y[H]=x,y[b]=o[b]}}return p&&_(!0),y}var L=new Map;function w(e){var t,a=L.get(e.nodeName);if(a)return a;L.set(e.nodeName,a=[]);for(var l=e,s=Element.prototype;s!==l;){for(var r in t=o(l))t[r].set&&a.push(r);l=u(l)}return a}function I(e,t){return e===t||new URL(e,document.baseURI).href===new URL(t,document.baseURI).href}function N(e){return e.split(",").map((e=>e.trim().split(" ").filter(Boolean)))}export{b as C,A as a,y as b,p as r,g as s};
|
|
2
|
+
//# sourceMappingURL=attributes-Dd-ZbJDt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes-C2cU7aS9.js","sources":["../node_modules/svelte/src/internal/client/dom/elements/attributes.js"],"sourcesContent":["import { DEV } from 'esm-env';\nimport { hydrating, set_hydrating } from '../hydration.js';\nimport { get_descriptors, get_prototype_of } from '../../../shared/utils.js';\nimport { create_event, delegate } from './events.js';\nimport { add_form_reset_listener, autofocus } from './misc.js';\nimport * as w from '../../warnings.js';\nimport { LOADING_ATTR_SYMBOL } from '../../constants.js';\nimport { queue_idle_task } from '../task.js';\nimport { is_capture_event, is_delegated, normalize_attribute } from '../../../../utils.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { clsx } from '../../../shared/attributes.js';\nimport { set_class } from './class.js';\n\nexport const CLASS = Symbol('class');\nexport const STYLE = Symbol('style');\n\n/**\n * The value/checked attribute in the template actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLInputElement} input\n * @returns {void}\n */\nexport function remove_input_defaults(input) {\n\tif (!hydrating) return;\n\n\tvar already_removed = false;\n\n\t// We try and remove the default attributes later, rather than sync during hydration.\n\t// Doing it sync during hydration has a negative impact on performance, but deferring the\n\t// work in an idle task alleviates this greatly. If a form reset event comes in before\n\t// the idle callback, then we ensure the input defaults are cleared just before.\n\tvar remove_defaults = () => {\n\t\tif (already_removed) return;\n\t\talready_removed = true;\n\n\t\t// Remove the attributes but preserve the values\n\t\tif (input.hasAttribute('value')) {\n\t\t\tvar value = input.value;\n\t\t\tset_attribute(input, 'value', null);\n\t\t\tinput.value = value;\n\t\t}\n\n\t\tif (input.hasAttribute('checked')) {\n\t\t\tvar checked = input.checked;\n\t\t\tset_attribute(input, 'checked', null);\n\t\t\tinput.checked = checked;\n\t\t}\n\t};\n\n\t// @ts-expect-error\n\tinput.__on_r = remove_defaults;\n\tqueue_idle_task(remove_defaults);\n\tadd_form_reset_listener();\n}\n\n/**\n * @param {Element} element\n * @param {any} value\n */\nexport function set_value(element, value) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (\n\t\tattributes.value ===\n\t\t\t(attributes.value =\n\t\t\t\t// treat null and undefined the same for the initial value\n\t\t\t\tvalue ?? undefined) ||\n\t\t// @ts-expect-error\n\t\t// `progress` elements always need their value set when it's `0`\n\t\t(element.value === value && (value !== 0 || element.nodeName !== 'PROGRESS'))\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.value = value ?? '';\n}\n\n/**\n * @param {Element} element\n * @param {boolean} checked\n */\nexport function set_checked(element, checked) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (\n\t\tattributes.checked ===\n\t\t(attributes.checked =\n\t\t\t// treat null and undefined the same for the initial value\n\t\t\tchecked ?? undefined)\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.checked = checked;\n}\n\n/**\n * Sets the `selected` attribute on an `option` element.\n * Not set through the property because that doesn't reflect to the DOM,\n * which means it wouldn't be taken into account when a form is reset.\n * @param {HTMLOptionElement} element\n * @param {boolean} selected\n */\nexport function set_selected(element, selected) {\n\tif (selected) {\n\t\t// The selected option could've changed via user selection, and\n\t\t// setting the value without this check would set it back.\n\t\tif (!element.hasAttribute('selected')) {\n\t\t\telement.setAttribute('selected', '');\n\t\t}\n\t} else {\n\t\telement.removeAttribute('selected');\n\t}\n}\n\n/**\n * Applies the default checked property without influencing the current checked property.\n * @param {HTMLInputElement} element\n * @param {boolean} checked\n */\nexport function set_default_checked(element, checked) {\n\tconst existing_value = element.checked;\n\telement.defaultChecked = checked;\n\telement.checked = existing_value;\n}\n\n/**\n * Applies the default value property without influencing the current value property.\n * @param {HTMLInputElement | HTMLTextAreaElement} element\n * @param {string} value\n */\nexport function set_default_value(element, value) {\n\tconst existing_value = element.value;\n\telement.defaultValue = value;\n\telement.value = existing_value;\n}\n\n/**\n * @param {Element} element\n * @param {string} attribute\n * @param {string | null} value\n * @param {boolean} [skip_warning]\n */\nexport function set_attribute(element, attribute, value, skip_warning) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (hydrating) {\n\t\tattributes[attribute] = element.getAttribute(attribute);\n\n\t\tif (\n\t\t\tattribute === 'src' ||\n\t\t\tattribute === 'srcset' ||\n\t\t\t(attribute === 'href' && element.nodeName === 'LINK')\n\t\t) {\n\t\t\tif (!skip_warning) {\n\t\t\t\tcheck_src_in_dev_hydration(element, attribute, value ?? '');\n\t\t\t}\n\n\t\t\t// If we reset these attributes, they would result in another network request, which we want to avoid.\n\t\t\t// We assume they are the same between client and server as checking if they are equal is expensive\n\t\t\t// (we can't just compare the strings as they can be different between client and server but result in the\n\t\t\t// same url, so we would need to create hidden anchor elements to compare them)\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (attributes[attribute] === (attributes[attribute] = value)) return;\n\n\tif (attribute === 'style' && '__styles' in element) {\n\t\t// reset styles to force style: directive to update\n\t\telement.__styles = {};\n\t}\n\n\tif (attribute === 'loading') {\n\t\t// @ts-expect-error\n\t\telement[LOADING_ATTR_SYMBOL] = value;\n\t}\n\n\tif (value == null) {\n\t\telement.removeAttribute(attribute);\n\t} else if (typeof value !== 'string' && get_setters(element).includes(attribute)) {\n\t\t// @ts-ignore\n\t\telement[attribute] = value;\n\t} else {\n\t\telement.setAttribute(attribute, value);\n\t}\n}\n\n/**\n * @param {Element} dom\n * @param {string} attribute\n * @param {string} value\n */\nexport function set_xlink_attribute(dom, attribute, value) {\n\tdom.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @param {string} prop\n * @param {any} value\n */\nexport function set_custom_element_data(node, prop, value) {\n\t// We need to ensure that setting custom element props, which can\n\t// invoke lifecycle methods on other custom elements, does not also\n\t// associate those lifecycle methods with the current active reaction\n\t// or effect\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet was_hydrating = hydrating;\n\tif (hydrating) {\n\t\tset_hydrating(false);\n\t}\n\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\tif (\n\t\t\t// Don't compute setters for custom elements while they aren't registered yet,\n\t\t\t// because during their upgrade/instantiation they might add more setters.\n\t\t\t// Instead, fall back to a simple \"an object, then set as property\" heuristic.\n\t\t\tsetters_cache.has(node.nodeName) ||\n\t\t\t// customElements may not be available in browser extension contexts\n\t\t\t!customElements ||\n\t\t\tcustomElements.get(node.tagName.toLowerCase())\n\t\t\t\t? get_setters(node).includes(prop)\n\t\t\t\t: value && typeof value === 'object'\n\t\t) {\n\t\t\t// @ts-expect-error\n\t\t\tnode[prop] = value;\n\t\t} else {\n\t\t\t// We did getters etc checks already, stringify before passing to set_attribute\n\t\t\t// to ensure it doesn't invoke the same logic again, and potentially populating\n\t\t\t// the setters cache too early.\n\t\t\tset_attribute(node, prop, value == null ? value : String(value));\n\t\t}\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t\tif (was_hydrating) {\n\t\t\tset_hydrating(true);\n\t\t}\n\t}\n}\n\n/**\n * Spreads attributes onto a DOM element, taking into account the currently set attributes\n * @param {Element & ElementCSSInlineStyle} element\n * @param {Record<string | symbol, any> | undefined} prev\n * @param {Record<string | symbol, any>} next New attributes - this function mutates this object\n * @param {string} [css_hash]\n * @param {boolean} [preserve_attribute_case]\n * @param {boolean} [is_custom_element]\n * @param {boolean} [skip_warning]\n * @returns {Record<string, any>}\n */\nexport function set_attributes(\n\telement,\n\tprev,\n\tnext,\n\tcss_hash,\n\tpreserve_attribute_case = false,\n\tis_custom_element = false,\n\tskip_warning = false\n) {\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet is_hydrating_custom_element = hydrating && is_custom_element;\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(false);\n\t}\n\n\tvar current = prev || {};\n\tvar is_option_element = element.tagName === 'OPTION';\n\n\tfor (var key in prev) {\n\t\tif (!(key in next)) {\n\t\t\tnext[key] = null;\n\t\t}\n\t}\n\n\tif (next.class) {\n\t\tnext.class = clsx(next.class);\n\t} else if (css_hash || next[CLASS]) {\n\t\tnext.class = null; /* force call to set_class() */\n\t}\n\n\tvar setters = get_setters(element);\n\n\t// @ts-expect-error\n\tvar attributes = /** @type {Record<string, unknown>} **/ (element.__attributes ??= {});\n\n\t// since key is captured we use const\n\tfor (const key in next) {\n\t\t// let instead of var because referenced in a closure\n\t\tlet value = next[key];\n\n\t\t// Up here because we want to do this for the initial value, too, even if it's undefined,\n\t\t// and this wouldn't be reached in case of undefined because of the equality check below\n\t\tif (is_option_element && key === 'value' && value == null) {\n\t\t\t// The <option> element is a special case because removing the value attribute means\n\t\t\t// the value is set to the text content of the option element, and setting the value\n\t\t\t// to null or undefined means the value is set to the string \"null\" or \"undefined\".\n\t\t\t// To align with how we handle this case in non-spread-scenarios, this logic is needed.\n\t\t\t// There's a super-edge-case bug here that is left in in favor of smaller code size:\n\t\t\t// Because of the \"set missing props to null\" logic above, we can't differentiate\n\t\t\t// between a missing value and an explicitly set value of null or undefined. That means\n\t\t\t// that once set, the value attribute of an <option> element can't be removed. This is\n\t\t\t// a very rare edge case, and removing the attribute altogether isn't possible either\n\t\t\t// for the <option value={undefined}> case, so we're not losing any functionality here.\n\t\t\t// @ts-ignore\n\t\t\telement.value = element.__value = '';\n\t\t\tcurrent[key] = value;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (key === 'class') {\n\t\t\tvar is_html = element.namespaceURI === 'http://www.w3.org/1999/xhtml';\n\t\t\tset_class(element, is_html, value, css_hash, prev?.[CLASS], next[CLASS]);\n\t\t\tcurrent[key] = value;\n\t\t\tcurrent[CLASS] = next[CLASS];\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar prev_value = current[key];\n\t\tif (value === prev_value) continue;\n\n\t\tcurrent[key] = value;\n\n\t\tvar prefix = key[0] + key[1]; // this is faster than key.slice(0, 2)\n\t\tif (prefix === '$$') continue;\n\n\t\tif (prefix === 'on') {\n\t\t\t/** @type {{ capture?: true }} */\n\t\t\tconst opts = {};\n\t\t\tconst event_handle_key = '$$' + key;\n\t\t\tlet event_name = key.slice(2);\n\t\t\tvar delegated = is_delegated(event_name);\n\n\t\t\tif (is_capture_event(event_name)) {\n\t\t\t\tevent_name = event_name.slice(0, -7);\n\t\t\t\topts.capture = true;\n\t\t\t}\n\n\t\t\tif (!delegated && prev_value) {\n\t\t\t\t// Listening to same event but different handler -> our handle function below takes care of this\n\t\t\t\t// If we were to remove and add listeners in this case, it could happen that the event is \"swallowed\"\n\t\t\t\t// (the browser seems to not know yet that a new one exists now) and doesn't reach the handler\n\t\t\t\t// https://github.com/sveltejs/svelte/issues/11903\n\t\t\t\tif (value != null) continue;\n\n\t\t\t\telement.removeEventListener(event_name, current[event_handle_key], opts);\n\t\t\t\tcurrent[event_handle_key] = null;\n\t\t\t}\n\n\t\t\tif (value != null) {\n\t\t\t\tif (!delegated) {\n\t\t\t\t\t/**\n\t\t\t\t\t * @this {any}\n\t\t\t\t\t * @param {Event} evt\n\t\t\t\t\t */\n\t\t\t\t\tfunction handle(evt) {\n\t\t\t\t\t\tcurrent[key].call(this, evt);\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent[event_handle_key] = create_event(event_name, element, handle, opts);\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\telement[`__${event_name}`] = value;\n\t\t\t\t\tdelegate([event_name]);\n\t\t\t\t}\n\t\t\t} else if (delegated) {\n\t\t\t\t// @ts-ignore\n\t\t\t\telement[`__${event_name}`] = undefined;\n\t\t\t}\n\t\t} else if (key === 'style' && value != null) {\n\t\t\telement.style.cssText = value + '';\n\t\t} else if (key === 'autofocus') {\n\t\t\tautofocus(/** @type {HTMLElement} */ (element), Boolean(value));\n\t\t} else if (!is_custom_element && (key === '__value' || (key === 'value' && value != null))) {\n\t\t\t// @ts-ignore We're not running this for custom elements because __value is actually\n\t\t\t// how Lit stores the current value on the element, and messing with that would break things.\n\t\t\telement.value = element.__value = value;\n\t\t} else if (key === 'selected' && is_option_element) {\n\t\t\tset_selected(/** @type {HTMLOptionElement} */ (element), value);\n\t\t} else {\n\t\t\tvar name = key;\n\t\t\tif (!preserve_attribute_case) {\n\t\t\t\tname = normalize_attribute(name);\n\t\t\t}\n\n\t\t\tvar is_default = name === 'defaultValue' || name === 'defaultChecked';\n\n\t\t\tif (value == null && !is_custom_element && !is_default) {\n\t\t\t\tattributes[key] = null;\n\n\t\t\t\tif (name === 'value' || name === 'checked') {\n\t\t\t\t\t// removing value/checked also removes defaultValue/defaultChecked — preserve\n\t\t\t\t\tlet input = /** @type {HTMLInputElement} */ (element);\n\t\t\t\t\tconst use_default = prev === undefined;\n\t\t\t\t\tif (name === 'value') {\n\t\t\t\t\t\tlet previous = input.defaultValue;\n\t\t\t\t\t\tinput.removeAttribute(name);\n\t\t\t\t\t\tinput.defaultValue = previous;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tinput.value = input.__value = use_default ? previous : null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet previous = input.defaultChecked;\n\t\t\t\t\t\tinput.removeAttribute(name);\n\t\t\t\t\t\tinput.defaultChecked = previous;\n\t\t\t\t\t\tinput.checked = use_default ? previous : false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\telement.removeAttribute(key);\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tis_default ||\n\t\t\t\t(setters.includes(name) && (is_custom_element || typeof value !== 'string'))\n\t\t\t) {\n\t\t\t\t// @ts-ignore\n\t\t\t\telement[name] = value;\n\t\t\t} else if (typeof value !== 'function') {\n\t\t\t\tset_attribute(element, name, value);\n\t\t\t}\n\t\t}\n\t\tif (key === 'style' && '__styles' in element) {\n\t\t\t// reset styles to force style: directive to update\n\t\t\telement.__styles = {};\n\t\t}\n\t}\n\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(true);\n\t}\n\n\treturn current;\n}\n\n/** @type {Map<string, string[]>} */\nvar setters_cache = new Map();\n\n/** @param {Element} element */\nfunction get_setters(element) {\n\tvar setters = setters_cache.get(element.nodeName);\n\tif (setters) return setters;\n\tsetters_cache.set(element.nodeName, (setters = []));\n\n\tvar descriptors;\n\tvar proto = element; // In the case of custom elements there might be setters on the instance\n\tvar element_proto = Element.prototype;\n\n\t// Stop at Element, from there on there's only unnecessary setters we're not interested in\n\t// Do not use contructor.name here as that's unreliable in some browser environments\n\twhile (element_proto !== proto) {\n\t\tdescriptors = get_descriptors(proto);\n\n\t\tfor (var key in descriptors) {\n\t\t\tif (descriptors[key].set) {\n\t\t\t\tsetters.push(key);\n\t\t\t}\n\t\t}\n\n\t\tproto = get_prototype_of(proto);\n\t}\n\n\treturn setters;\n}\n\n/**\n * @param {any} element\n * @param {string} attribute\n * @param {string} value\n */\nfunction check_src_in_dev_hydration(element, attribute, value) {\n\tif (!DEV) return;\n\tif (attribute === 'srcset' && srcset_url_equal(element, value)) return;\n\tif (src_url_equal(element.getAttribute(attribute) ?? '', value)) return;\n\n\tw.hydration_attribute_changed(\n\t\tattribute,\n\t\telement.outerHTML.replace(element.innerHTML, element.innerHTML && '...'),\n\t\tString(value)\n\t);\n}\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nfunction src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\treturn new URL(element_src, document.baseURI).href === new URL(url, document.baseURI).href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element\n * @param {string} srcset\n * @returns {boolean}\n */\nfunction srcset_url_equal(element, srcset) {\n\tvar element_urls = split_srcset(element.srcset);\n\tvar urls = split_srcset(srcset);\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n"],"names":["CLASS","Symbol","remove_input_defaults","input","hydrating","already_removed","remove_defaults","hasAttribute","value","set_attribute","checked","__on_r","queue_idle_task","add_form_reset_listener","set_checked","element","attributes","__attributes","undefined","set_selected","selected","setAttribute","removeAttribute","attribute","skip_warning","getAttribute","nodeName","DEV","srcset","element_urls","split_srcset","urls","length","every","url","width","i","src_url_equal","srcset_url_equal","w.hydration_attribute_changed","outerHTML","replace","innerHTML","String","check_src_in_dev_hydration","__styles","LOADING_ATTR_SYMBOL","get_setters","includes","set_attributes","prev","next","css_hash","preserve_attribute_case","is_custom_element","is_hydrating_custom_element","set_hydrating","current","is_option_element","tagName","key","class","clsx","setters","__value","prev_value","prefix","opts","event_handle_key","event_name","slice","delegated","is_delegated","is_capture_event","capture","removeEventListener","delegate","handle","evt","call","this","create_event","style","cssText","autofocus","Boolean","name","normalize_attribute","is_default","use_default","previous","defaultValue","defaultChecked","is_html","namespaceURI","set_class","setters_cache","Map","descriptors","get","set","proto","element_proto","Element","prototype","get_descriptors","push","get_prototype_of","element_src","URL","document","baseURI","href","split","map","src","trim","filter"],"mappings":"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","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"attributes-Dd-ZbJDt.js","sources":["../node_modules/svelte/src/internal/client/dom/elements/attributes.js"],"sourcesContent":["import { DEV } from 'esm-env';\nimport { hydrating, set_hydrating } from '../hydration.js';\nimport { get_descriptors, get_prototype_of } from '../../../shared/utils.js';\nimport { create_event, delegate } from './events.js';\nimport { add_form_reset_listener, autofocus } from './misc.js';\nimport * as w from '../../warnings.js';\nimport { LOADING_ATTR_SYMBOL } from '../../constants.js';\nimport { queue_idle_task } from '../task.js';\nimport { is_capture_event, is_delegated, normalize_attribute } from '../../../../utils.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { clsx } from '../../../shared/attributes.js';\nimport { set_class } from './class.js';\n\nexport const CLASS = Symbol('class');\nexport const STYLE = Symbol('style');\n\n/**\n * The value/checked attribute in the template actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLInputElement} input\n * @returns {void}\n */\nexport function remove_input_defaults(input) {\n\tif (!hydrating) return;\n\n\tvar already_removed = false;\n\n\t// We try and remove the default attributes later, rather than sync during hydration.\n\t// Doing it sync during hydration has a negative impact on performance, but deferring the\n\t// work in an idle task alleviates this greatly. If a form reset event comes in before\n\t// the idle callback, then we ensure the input defaults are cleared just before.\n\tvar remove_defaults = () => {\n\t\tif (already_removed) return;\n\t\talready_removed = true;\n\n\t\t// Remove the attributes but preserve the values\n\t\tif (input.hasAttribute('value')) {\n\t\t\tvar value = input.value;\n\t\t\tset_attribute(input, 'value', null);\n\t\t\tinput.value = value;\n\t\t}\n\n\t\tif (input.hasAttribute('checked')) {\n\t\t\tvar checked = input.checked;\n\t\t\tset_attribute(input, 'checked', null);\n\t\t\tinput.checked = checked;\n\t\t}\n\t};\n\n\t// @ts-expect-error\n\tinput.__on_r = remove_defaults;\n\tqueue_idle_task(remove_defaults);\n\tadd_form_reset_listener();\n}\n\n/**\n * @param {Element} element\n * @param {any} value\n */\nexport function set_value(element, value) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (\n\t\tattributes.value ===\n\t\t\t(attributes.value =\n\t\t\t\t// treat null and undefined the same for the initial value\n\t\t\t\tvalue ?? undefined) ||\n\t\t// @ts-expect-error\n\t\t// `progress` elements always need their value set when it's `0`\n\t\t(element.value === value && (value !== 0 || element.nodeName !== 'PROGRESS'))\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.value = value ?? '';\n}\n\n/**\n * @param {Element} element\n * @param {boolean} checked\n */\nexport function set_checked(element, checked) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (\n\t\tattributes.checked ===\n\t\t(attributes.checked =\n\t\t\t// treat null and undefined the same for the initial value\n\t\t\tchecked ?? undefined)\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.checked = checked;\n}\n\n/**\n * Sets the `selected` attribute on an `option` element.\n * Not set through the property because that doesn't reflect to the DOM,\n * which means it wouldn't be taken into account when a form is reset.\n * @param {HTMLOptionElement} element\n * @param {boolean} selected\n */\nexport function set_selected(element, selected) {\n\tif (selected) {\n\t\t// The selected option could've changed via user selection, and\n\t\t// setting the value without this check would set it back.\n\t\tif (!element.hasAttribute('selected')) {\n\t\t\telement.setAttribute('selected', '');\n\t\t}\n\t} else {\n\t\telement.removeAttribute('selected');\n\t}\n}\n\n/**\n * Applies the default checked property without influencing the current checked property.\n * @param {HTMLInputElement} element\n * @param {boolean} checked\n */\nexport function set_default_checked(element, checked) {\n\tconst existing_value = element.checked;\n\telement.defaultChecked = checked;\n\telement.checked = existing_value;\n}\n\n/**\n * Applies the default value property without influencing the current value property.\n * @param {HTMLInputElement | HTMLTextAreaElement} element\n * @param {string} value\n */\nexport function set_default_value(element, value) {\n\tconst existing_value = element.value;\n\telement.defaultValue = value;\n\telement.value = existing_value;\n}\n\n/**\n * @param {Element} element\n * @param {string} attribute\n * @param {string | null} value\n * @param {boolean} [skip_warning]\n */\nexport function set_attribute(element, attribute, value, skip_warning) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (hydrating) {\n\t\tattributes[attribute] = element.getAttribute(attribute);\n\n\t\tif (\n\t\t\tattribute === 'src' ||\n\t\t\tattribute === 'srcset' ||\n\t\t\t(attribute === 'href' && element.nodeName === 'LINK')\n\t\t) {\n\t\t\tif (!skip_warning) {\n\t\t\t\tcheck_src_in_dev_hydration(element, attribute, value ?? '');\n\t\t\t}\n\n\t\t\t// If we reset these attributes, they would result in another network request, which we want to avoid.\n\t\t\t// We assume they are the same between client and server as checking if they are equal is expensive\n\t\t\t// (we can't just compare the strings as they can be different between client and server but result in the\n\t\t\t// same url, so we would need to create hidden anchor elements to compare them)\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (attributes[attribute] === (attributes[attribute] = value)) return;\n\n\tif (attribute === 'style' && '__styles' in element) {\n\t\t// reset styles to force style: directive to update\n\t\telement.__styles = {};\n\t}\n\n\tif (attribute === 'loading') {\n\t\t// @ts-expect-error\n\t\telement[LOADING_ATTR_SYMBOL] = value;\n\t}\n\n\tif (value == null) {\n\t\telement.removeAttribute(attribute);\n\t} else if (typeof value !== 'string' && get_setters(element).includes(attribute)) {\n\t\t// @ts-ignore\n\t\telement[attribute] = value;\n\t} else {\n\t\telement.setAttribute(attribute, value);\n\t}\n}\n\n/**\n * @param {Element} dom\n * @param {string} attribute\n * @param {string} value\n */\nexport function set_xlink_attribute(dom, attribute, value) {\n\tdom.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @param {string} prop\n * @param {any} value\n */\nexport function set_custom_element_data(node, prop, value) {\n\t// We need to ensure that setting custom element props, which can\n\t// invoke lifecycle methods on other custom elements, does not also\n\t// associate those lifecycle methods with the current active reaction\n\t// or effect\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet was_hydrating = hydrating;\n\tif (hydrating) {\n\t\tset_hydrating(false);\n\t}\n\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\tif (\n\t\t\t// Don't compute setters for custom elements while they aren't registered yet,\n\t\t\t// because during their upgrade/instantiation they might add more setters.\n\t\t\t// Instead, fall back to a simple \"an object, then set as property\" heuristic.\n\t\t\tsetters_cache.has(node.nodeName) ||\n\t\t\t// customElements may not be available in browser extension contexts\n\t\t\t!customElements ||\n\t\t\tcustomElements.get(node.tagName.toLowerCase())\n\t\t\t\t? get_setters(node).includes(prop)\n\t\t\t\t: value && typeof value === 'object'\n\t\t) {\n\t\t\t// @ts-expect-error\n\t\t\tnode[prop] = value;\n\t\t} else {\n\t\t\t// We did getters etc checks already, stringify before passing to set_attribute\n\t\t\t// to ensure it doesn't invoke the same logic again, and potentially populating\n\t\t\t// the setters cache too early.\n\t\t\tset_attribute(node, prop, value == null ? value : String(value));\n\t\t}\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t\tif (was_hydrating) {\n\t\t\tset_hydrating(true);\n\t\t}\n\t}\n}\n\n/**\n * Spreads attributes onto a DOM element, taking into account the currently set attributes\n * @param {Element & ElementCSSInlineStyle} element\n * @param {Record<string | symbol, any> | undefined} prev\n * @param {Record<string | symbol, any>} next New attributes - this function mutates this object\n * @param {string} [css_hash]\n * @param {boolean} [preserve_attribute_case]\n * @param {boolean} [is_custom_element]\n * @param {boolean} [skip_warning]\n * @returns {Record<string, any>}\n */\nexport function set_attributes(\n\telement,\n\tprev,\n\tnext,\n\tcss_hash,\n\tpreserve_attribute_case = false,\n\tis_custom_element = false,\n\tskip_warning = false\n) {\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet is_hydrating_custom_element = hydrating && is_custom_element;\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(false);\n\t}\n\n\tvar current = prev || {};\n\tvar is_option_element = element.tagName === 'OPTION';\n\n\tfor (var key in prev) {\n\t\tif (!(key in next)) {\n\t\t\tnext[key] = null;\n\t\t}\n\t}\n\n\tif (next.class) {\n\t\tnext.class = clsx(next.class);\n\t} else if (css_hash || next[CLASS]) {\n\t\tnext.class = null; /* force call to set_class() */\n\t}\n\n\tvar setters = get_setters(element);\n\n\t// @ts-expect-error\n\tvar attributes = /** @type {Record<string, unknown>} **/ (element.__attributes ??= {});\n\n\t// since key is captured we use const\n\tfor (const key in next) {\n\t\t// let instead of var because referenced in a closure\n\t\tlet value = next[key];\n\n\t\t// Up here because we want to do this for the initial value, too, even if it's undefined,\n\t\t// and this wouldn't be reached in case of undefined because of the equality check below\n\t\tif (is_option_element && key === 'value' && value == null) {\n\t\t\t// The <option> element is a special case because removing the value attribute means\n\t\t\t// the value is set to the text content of the option element, and setting the value\n\t\t\t// to null or undefined means the value is set to the string \"null\" or \"undefined\".\n\t\t\t// To align with how we handle this case in non-spread-scenarios, this logic is needed.\n\t\t\t// There's a super-edge-case bug here that is left in in favor of smaller code size:\n\t\t\t// Because of the \"set missing props to null\" logic above, we can't differentiate\n\t\t\t// between a missing value and an explicitly set value of null or undefined. That means\n\t\t\t// that once set, the value attribute of an <option> element can't be removed. This is\n\t\t\t// a very rare edge case, and removing the attribute altogether isn't possible either\n\t\t\t// for the <option value={undefined}> case, so we're not losing any functionality here.\n\t\t\t// @ts-ignore\n\t\t\telement.value = element.__value = '';\n\t\t\tcurrent[key] = value;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (key === 'class') {\n\t\t\tvar is_html = element.namespaceURI === 'http://www.w3.org/1999/xhtml';\n\t\t\tset_class(element, is_html, value, css_hash, prev?.[CLASS], next[CLASS]);\n\t\t\tcurrent[key] = value;\n\t\t\tcurrent[CLASS] = next[CLASS];\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar prev_value = current[key];\n\t\tif (value === prev_value) continue;\n\n\t\tcurrent[key] = value;\n\n\t\tvar prefix = key[0] + key[1]; // this is faster than key.slice(0, 2)\n\t\tif (prefix === '$$') continue;\n\n\t\tif (prefix === 'on') {\n\t\t\t/** @type {{ capture?: true }} */\n\t\t\tconst opts = {};\n\t\t\tconst event_handle_key = '$$' + key;\n\t\t\tlet event_name = key.slice(2);\n\t\t\tvar delegated = is_delegated(event_name);\n\n\t\t\tif (is_capture_event(event_name)) {\n\t\t\t\tevent_name = event_name.slice(0, -7);\n\t\t\t\topts.capture = true;\n\t\t\t}\n\n\t\t\tif (!delegated && prev_value) {\n\t\t\t\t// Listening to same event but different handler -> our handle function below takes care of this\n\t\t\t\t// If we were to remove and add listeners in this case, it could happen that the event is \"swallowed\"\n\t\t\t\t// (the browser seems to not know yet that a new one exists now) and doesn't reach the handler\n\t\t\t\t// https://github.com/sveltejs/svelte/issues/11903\n\t\t\t\tif (value != null) continue;\n\n\t\t\t\telement.removeEventListener(event_name, current[event_handle_key], opts);\n\t\t\t\tcurrent[event_handle_key] = null;\n\t\t\t}\n\n\t\t\tif (value != null) {\n\t\t\t\tif (!delegated) {\n\t\t\t\t\t/**\n\t\t\t\t\t * @this {any}\n\t\t\t\t\t * @param {Event} evt\n\t\t\t\t\t */\n\t\t\t\t\tfunction handle(evt) {\n\t\t\t\t\t\tcurrent[key].call(this, evt);\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent[event_handle_key] = create_event(event_name, element, handle, opts);\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\telement[`__${event_name}`] = value;\n\t\t\t\t\tdelegate([event_name]);\n\t\t\t\t}\n\t\t\t} else if (delegated) {\n\t\t\t\t// @ts-ignore\n\t\t\t\telement[`__${event_name}`] = undefined;\n\t\t\t}\n\t\t} else if (key === 'style' && value != null) {\n\t\t\telement.style.cssText = value + '';\n\t\t} else if (key === 'autofocus') {\n\t\t\tautofocus(/** @type {HTMLElement} */ (element), Boolean(value));\n\t\t} else if (!is_custom_element && (key === '__value' || (key === 'value' && value != null))) {\n\t\t\t// @ts-ignore We're not running this for custom elements because __value is actually\n\t\t\t// how Lit stores the current value on the element, and messing with that would break things.\n\t\t\telement.value = element.__value = value;\n\t\t} else if (key === 'selected' && is_option_element) {\n\t\t\tset_selected(/** @type {HTMLOptionElement} */ (element), value);\n\t\t} else {\n\t\t\tvar name = key;\n\t\t\tif (!preserve_attribute_case) {\n\t\t\t\tname = normalize_attribute(name);\n\t\t\t}\n\n\t\t\tvar is_default = name === 'defaultValue' || name === 'defaultChecked';\n\n\t\t\tif (value == null && !is_custom_element && !is_default) {\n\t\t\t\tattributes[key] = null;\n\n\t\t\t\tif (name === 'value' || name === 'checked') {\n\t\t\t\t\t// removing value/checked also removes defaultValue/defaultChecked — preserve\n\t\t\t\t\tlet input = /** @type {HTMLInputElement} */ (element);\n\t\t\t\t\tconst use_default = prev === undefined;\n\t\t\t\t\tif (name === 'value') {\n\t\t\t\t\t\tlet previous = input.defaultValue;\n\t\t\t\t\t\tinput.removeAttribute(name);\n\t\t\t\t\t\tinput.defaultValue = previous;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tinput.value = input.__value = use_default ? previous : null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet previous = input.defaultChecked;\n\t\t\t\t\t\tinput.removeAttribute(name);\n\t\t\t\t\t\tinput.defaultChecked = previous;\n\t\t\t\t\t\tinput.checked = use_default ? previous : false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\telement.removeAttribute(key);\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tis_default ||\n\t\t\t\t(setters.includes(name) && (is_custom_element || typeof value !== 'string'))\n\t\t\t) {\n\t\t\t\t// @ts-ignore\n\t\t\t\telement[name] = value;\n\t\t\t} else if (typeof value !== 'function') {\n\t\t\t\tset_attribute(element, name, value);\n\t\t\t}\n\t\t}\n\t\tif (key === 'style' && '__styles' in element) {\n\t\t\t// reset styles to force style: directive to update\n\t\t\telement.__styles = {};\n\t\t}\n\t}\n\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(true);\n\t}\n\n\treturn current;\n}\n\n/** @type {Map<string, string[]>} */\nvar setters_cache = new Map();\n\n/** @param {Element} element */\nfunction get_setters(element) {\n\tvar setters = setters_cache.get(element.nodeName);\n\tif (setters) return setters;\n\tsetters_cache.set(element.nodeName, (setters = []));\n\n\tvar descriptors;\n\tvar proto = element; // In the case of custom elements there might be setters on the instance\n\tvar element_proto = Element.prototype;\n\n\t// Stop at Element, from there on there's only unnecessary setters we're not interested in\n\t// Do not use contructor.name here as that's unreliable in some browser environments\n\twhile (element_proto !== proto) {\n\t\tdescriptors = get_descriptors(proto);\n\n\t\tfor (var key in descriptors) {\n\t\t\tif (descriptors[key].set) {\n\t\t\t\tsetters.push(key);\n\t\t\t}\n\t\t}\n\n\t\tproto = get_prototype_of(proto);\n\t}\n\n\treturn setters;\n}\n\n/**\n * @param {any} element\n * @param {string} attribute\n * @param {string} value\n */\nfunction check_src_in_dev_hydration(element, attribute, value) {\n\tif (!DEV) return;\n\tif (attribute === 'srcset' && srcset_url_equal(element, value)) return;\n\tif (src_url_equal(element.getAttribute(attribute) ?? '', value)) return;\n\n\tw.hydration_attribute_changed(\n\t\tattribute,\n\t\telement.outerHTML.replace(element.innerHTML, element.innerHTML && '...'),\n\t\tString(value)\n\t);\n}\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nfunction src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\treturn new URL(element_src, document.baseURI).href === new URL(url, document.baseURI).href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element\n * @param {string} srcset\n * @returns {boolean}\n */\nfunction srcset_url_equal(element, srcset) {\n\tvar element_urls = split_srcset(element.srcset);\n\tvar urls = split_srcset(srcset);\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n"],"names":["CLASS","Symbol","remove_input_defaults","input","hydrating","already_removed","remove_defaults","hasAttribute","value","set_attribute","checked","__on_r","queue_idle_task","add_form_reset_listener","set_checked","element","attributes","__attributes","undefined","set_selected","selected","setAttribute","removeAttribute","attribute","skip_warning","getAttribute","nodeName","DEV","srcset","element_urls","split_srcset","urls","length","every","url","width","i","src_url_equal","srcset_url_equal","w.hydration_attribute_changed","outerHTML","replace","innerHTML","String","check_src_in_dev_hydration","__styles","LOADING_ATTR_SYMBOL","get_setters","includes","set_attributes","prev","next","css_hash","preserve_attribute_case","is_custom_element","is_hydrating_custom_element","set_hydrating","current","is_option_element","tagName","key","class","clsx","setters","__value","prev_value","prefix","opts","event_handle_key","event_name","slice","delegated","is_delegated","is_capture_event","capture","removeEventListener","delegate","handle","evt","call","this","create_event","style","cssText","autofocus","Boolean","name","normalize_attribute","is_default","use_default","previous","defaultValue","defaultChecked","is_html","namespaceURI","set_class","setters_cache","Map","descriptors","get","set","proto","element_proto","Element","prototype","get_descriptors","push","get_prototype_of","element_src","URL","document","baseURI","href","split","map","src","trim","filter"],"mappings":"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","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as e,p as a,a as t,b as r,t as o,d as s,s as d,e as n,f as c,g as l,h as f,i as g,j as i,r as b}from"../../custom-element-
|
|
1
|
+
import{c as e,p as a,a as t,b as r,t as o,d as s,s as d,e as n,f as c,g as l,h as f,i as g,j as i,r as b}from"../../custom-element-D6iR2OWc.js";var u=o("<div> </div>");const m={hash:"svelte-1hwtfua",code:"/**\n * Do not edit directly, this file was auto-generated.\n */.mc-badge.svelte-1hwtfua {color:var(--badge-color-text-standard, #ffffff);background-color:var(--badge-color-background-standard, #464e63);height:1rem;min-width:1rem;padding:0 0.125rem;font-size:0.625rem;border-radius:1rem;font-weight:600;display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;}.mc-badge--m.svelte-1hwtfua {height:1.5rem;min-width:1.5rem;padding:0 0.25rem;font-size:0.75rem;}.mc-badge--accent.svelte-1hwtfua {color:var(--badge-color-text-accent, #ffffff);background-color:var(--badge-color-background-accent, #117f03);}.mc-badge--danger.svelte-1hwtfua {color:var(--badge-color-text-danger, #ffffff);background-color:var(--badge-color-background-danger, #c61112);}.mc-badge--inverse.svelte-1hwtfua {color:var(--badge-color-text-inverse, #464e63);background-color:var(--badge-color-background-inverse, #ffffff);}"};function v(e,o){a(o,!0),t(e,m);let v=r(o,"label",7,""),h=r(o,"style",7,"standard"),w=r(o,"size",7,"s");var k=u(),p=l(k,!0);return b(k),s((e=>{d(k,1,n(e),"svelte-1hwtfua"),c(p,v())}),[()=>function(e){const a=["mc-badge"];return e&&a.push(`mc-badge--${e}`),w()&&a.push(`mc-badge--${w()}`),a.join(" ")}(h())]),f(e,k),g({get label(){return v()},set label(e=""){v(e),i()},get style(){return h()},set style(e="standard"){h(e),i()},get size(){return w()},set size(e="s"){w(e),i()}})}customElements.define("m-badge",e(v,{label:{},style:{},size:{}},[],[],!1));export{v as default};
|
|
2
2
|
//# sourceMappingURL=Badge.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as o,p as t,a as e,b as r,t as n,d as l,h as c,i as a,k as d,g as b,j as u,r as s,s as i,l as v,m as g}from"../../custom-element-C0xaDU2s.js";import{i as m}from"../../if-B_xe8pYW.js";import{h as f}from"../../html-h1-V2s6a.js";import{s as h,a as k}from"../../slot-DQF0Tqfq.js";import{s as q}from"../../attributes-C2cU7aS9.js";var p=n('<span class="mc-button__icon svelte-q2e18l"><!></span>'),w=n('<span class="mc-button__icon svelte-q2e18l"><!></span>'),_=n("<span><!></span>"),y=n('<span class="mc-button__icon svelte-q2e18l"><!></span>'),x=n("<button><!> <!> <!> <!></button>");const z={hash:"svelte-q2e18l",code:"/**\n * Do not edit directly, this file was auto-generated.\n */.mc-button.svelte-q2e18l {color:var(--button-color-filled-standard-font, #ffffff);background-color:var(--button-color-filled-standard-background, #464e63);font-weight:600;padding:0 calc(1rem - 0.125rem);min-height:3rem;min-width:3rem;display:inline-flex;justify-content:center;vertical-align:middle;text-align:center;border:2px solid transparent;border-radius:0.25rem;transition:all ease 200ms;transition:box-shadow 200ms ease;align-items:center;box-sizing:border-box;fill:currentcolor;gap:0.25rem;cursor:pointer;}.mc-button.svelte-q2e18l:hover {background-color:var(--button-color-filled-standard-hover-background, #343b4c);}.mc-button.svelte-q2e18l:active {background-color:var(--button-color-filled-standard-active-background, #242938);}.mc-button.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button.svelte-q2e18l .mc-button__label:where(.svelte-q2e18l) {font-size:1rem;}.mc-button--s.svelte-q2e18l {padding:0 calc(0.75rem - 0.125rem);min-height:2rem;min-width:2rem;}.mc-button--s.svelte-q2e18l .mc-button__label:where(.svelte-q2e18l) {font-size:0.875rem;}.mc-button--s.svelte-q2e18l .mc-button__icon:where(.svelte-q2e18l) {width:1.25rem;height:1.25rem;}.mc-button--s.svelte-q2e18l .mc-button__icon:where(.svelte-q2e18l):only-child {width:1.25rem;height:1.25rem;}.mc-button--m.svelte-q2e18l {padding:0 calc(1rem - 0.125rem);min-height:3rem;min-width:3rem;}.mc-button--m.svelte-q2e18l .mc-button__label:where(.svelte-q2e18l) {font-size:1rem;}.mc-button--m.svelte-q2e18l .mc-button__icon:where(.svelte-q2e18l) {width:1.5rem;height:1.5rem;}.mc-button--m.svelte-q2e18l .mc-button__icon:where(.svelte-q2e18l):only-child {width:1.5rem;height:1.5rem;}.mc-button--l.svelte-q2e18l {padding:0 calc(1.25rem - 0.125rem);min-height:4rem;min-width:4rem;}.mc-button--l.svelte-q2e18l .mc-button__label:where(.svelte-q2e18l) {font-size:1.125rem;}.mc-button--l.svelte-q2e18l .mc-button__icon:where(.svelte-q2e18l) {width:2rem;height:2rem;}.mc-button--l.svelte-q2e18l .mc-button__icon:where(.svelte-q2e18l):only-child {width:2rem;height:2rem;}.mc-button__label.svelte-q2e18l {font-size:1rem;}.mc-button__icon.svelte-q2e18l {flex-shrink:0;width:1.5rem;height:1.5rem;}.mc-button.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button.svelte-q2e18l:focus-visible {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));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-button--icon-only.svelte-q2e18l {padding:0.25rem;}.mc-button--outlined.svelte-q2e18l {color:var(--button-color-outlined-standard-font, #242938);border-color:var(--button-color-outlined-standard-border, #8891aa);background-color:var(--button-color-outlined-standard-background, #ffffff);}.mc-button--outlined.svelte-q2e18l:hover {background-color:var(--button-color-outlined-standard-hover-background, #eff1f6);}.mc-button--outlined.svelte-q2e18l:active {background-color:var(--button-color-outlined-standard-active-background, #c9d0de);}.mc-button--outlined.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.svelte-q2e18l {color:var(--button-color-ghost-standard-font, #242938);background-color:var(--button-color-ghost-standard-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.svelte-q2e18l:hover {background-color:var(--button-color-ghost-standard-hover-background, rgba(70, 78, 99, 0.1));}.mc-button--ghost.svelte-q2e18l:active {background-color:var(--button-color-ghost-standard-active-background, rgba(70, 78, 99, 0.2));}.mc-button--ghost.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--accent.svelte-q2e18l {color:var(--button-color-filled-accent-font, #ffffff);background-color:var(--button-color-filled-accent-background, #117f03);}.mc-button--accent.svelte-q2e18l:hover {background-color:var(--button-color-filled-accent-hover-background, #006902);}.mc-button--accent.svelte-q2e18l:active {background-color:var(--button-color-filled-accent-active-background, #035010);}.mc-button--accent.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--danger.svelte-q2e18l {color:var(--button-color-filled-danger-font, #ffffff);background-color:var(--button-color-filled-danger-background, #c61112);}.mc-button--danger.svelte-q2e18l:hover {background-color:var(--button-color-filled-danger-hover-background, #8c0003);}.mc-button--danger.svelte-q2e18l:active {background-color:var(--button-color-filled-danger-active-background, #530000);}.mc-button--danger.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--inverse.svelte-q2e18l {--focus-color-mid: var(--focus-color-outline-outer, #000000);--focus-color-outer: var(--focus-color-outline-mid, #ffffff);color:var(--button-color-filled-inverse-font, #242938);background-color:var(--button-color-filled-inverse-background, #ffffff);}.mc-button--inverse.svelte-q2e18l:hover {background-color:var(--button-color-filled-inverse-hover-background, #e6e6e6);}.mc-button--inverse.svelte-q2e18l:active {background-color:var(--button-color-filled-inverse-active-background, #cccccc);}.mc-button--inverse.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--icon-button.svelte-q2e18l {border-radius:100%;padding:0;}.mc-button--loading.svelte-q2e18l .mc-button__label:where(.svelte-q2e18l),\n.mc-button--loading.svelte-q2e18l .mc-button__icon:where(.svelte-q2e18l) {visibility:hidden;}.mc-button--outlined.mc-button--standard.svelte-q2e18l {color:var(--button-color-outlined-standard-font, #242938);border-color:var(--button-color-outlined-standard-border, #8891aa);background-color:var(--button-color-outlined-standard-background, #ffffff);}.mc-button--outlined.mc-button--standard.svelte-q2e18l:hover {background-color:var(--button-color-outlined-standard-hover-background, #eff1f6);}.mc-button--outlined.mc-button--standard.svelte-q2e18l:active {background-color:var(--button-color-outlined-standard-active-background, #c9d0de);}.mc-button--outlined.mc-button--standard.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--accent.svelte-q2e18l {color:var(--button-color-outlined-accent-font, #117f03);border-color:var(--button-color-outlined-accent-border, #78be20);background-color:var(--button-color-outlined-accent-background, #ffffff);}.mc-button--outlined.mc-button--accent.svelte-q2e18l:hover {background-color:var(--button-color-outlined-accent-hover-background, #ebf5de);}.mc-button--outlined.mc-button--accent.svelte-q2e18l:active {background-color:var(--button-color-outlined-accent-active-background, #c5e39e);}.mc-button--outlined.mc-button--accent.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--danger.svelte-q2e18l {color:var(--button-color-outlined-danger-font, #c61112);border-color:var(--button-color-outlined-danger-border, #ef5f5c);background-color:var(--button-color-outlined-danger-background, #ffffff);}.mc-button--outlined.mc-button--danger.svelte-q2e18l:hover {background-color:var(--button-color-outlined-danger-hover-background, #fdeaea);}.mc-button--outlined.mc-button--danger.svelte-q2e18l:active {background-color:var(--button-color-outlined-danger-active-background, #f8bcbb);}.mc-button--outlined.mc-button--danger.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--inverse.svelte-q2e18l {color:var(--button-color-outlined-inverse-font, #ffffff);border-color:var(--button-color-outlined-inverse-border, #ffffff);background-color:var(--button-color-outlined-inverse-background, rgba(255, 255, 255, 0.01));}.mc-button--outlined.mc-button--inverse.svelte-q2e18l:hover {background-color:var(--button-color-outlined-inverse-hover-background, rgba(255, 255, 255, 0.1));}.mc-button--outlined.mc-button--inverse.svelte-q2e18l:active {background-color:var(--button-color-outlined-inverse-active-background, rgba(255, 255, 255, 0.2));}.mc-button--outlined.mc-button--inverse.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--standard.svelte-q2e18l {color:var(--button-color-ghost-standard-font, #242938);background-color:var(--button-color-ghost-standard-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--standard.svelte-q2e18l:hover {background-color:var(--button-color-ghost-standard-hover-background, rgba(70, 78, 99, 0.1));}.mc-button--ghost.mc-button--standard.svelte-q2e18l:active {background-color:var(--button-color-ghost-standard-active-background, rgba(70, 78, 99, 0.2));}.mc-button--ghost.mc-button--standard.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--accent.svelte-q2e18l {color:var(--button-color-ghost-accent-font, #117f03);background-color:var(--button-color-ghost-accent-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--accent.svelte-q2e18l:hover {background-color:var(--button-color-ghost-accent-hover-background, rgba(17, 127, 3, 0.1));}.mc-button--ghost.mc-button--accent.svelte-q2e18l:active {background-color:var(--button-color-ghost-accent-active-background, rgba(17, 127, 3, 0.2));}.mc-button--ghost.mc-button--accent.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--danger.svelte-q2e18l {color:var(--button-color-ghost-danger-font, #c61112);background-color:var(--button-color-ghost-danger-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--danger.svelte-q2e18l:hover {background-color:var(--button-color-ghost-danger-hover-background, rgba(198, 17, 18, 0.1));}.mc-button--ghost.mc-button--danger.svelte-q2e18l:active {background-color:var(--button-color-ghost-danger-active-background, rgba(198, 17, 18, 0.2));}.mc-button--ghost.mc-button--danger.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--inverse.svelte-q2e18l {color:var(--button-color-ghost-inverse-font, #ffffff);background-color:var(--button-color-ghost-inverse-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--inverse.svelte-q2e18l:hover {background-color:var(--button-color-ghost-inverse-hover-background, rgba(255, 255, 255, 0.1));}.mc-button--ghost.mc-button--inverse.svelte-q2e18l:active {background-color:var(--button-color-ghost-inverse-active-background, rgba(255, 255, 255, 0.2));}.mc-button--ghost.mc-button--inverse.svelte-q2e18l:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button__icon.svelte-q2e18l {pointer-events:none;}.hidden.svelte-q2e18l {visibility:hidden;}"};function $(o,n){const $=h(n);t(n,!0),e(o,z);let j=r(n,"style",7,"standard"),C=r(n,"size",7,"m"),D=r(n,"ghost",7,!1),E=r(n,"outlined",7,!1),L=r(n,"iconname",7),A=r(n,"iconmode",7),B=r(n,"disabled",7,!1),F=r(n,"type",7,"button"),G=r(n,"isloading",7,!1);function H(o,t,e){const r="only"===t;let n;switch(o){case"s":n="24px";break;case"m":n=r?"32px":"24px";break;case"l":n=r?"100%":"32px"}return`${e} size="${n}" `}var I=x();let J;var K=b(I),M=o=>{Loader(o,{theme:"standard",style:"color: currentColor; position: absolute;",size:"m",text:""})};m(K,(o=>{G()&&o(M)}));var N=d(K,2),O=o=>{var t=p(),e=b(t),r=o=>{var t=v(),e=g(t);k(e,n,"icon",{}),c(o,t)},l=(o,t)=>{var e=o=>{var t=v(),e=g(t);f(e,(()=>`<${H(C(),A(),L())} />`)),c(o,t)};m(o,(o=>{L()&&o(e)}),t)};m(e,(o=>{$.icon?o(r):o(l,!1)})),s(t),c(o,t)};m(N,(o=>{(L()||$.icon)&&"left"===A()&&o(O)}));var P=d(N,2),Q=o=>{var t=w(),e=b(t),r=o=>{var t=v(),e=g(t);k(e,n,"icon",{}),c(o,t)},l=(o,t)=>{var e=o=>{var t=v(),e=g(t);f(e,(()=>`<${H(C(),A(),L())} />`)),c(o,t)};m(o,(o=>{L()&&o(e)}),t)};m(e,(o=>{$.icon?o(r):o(l,!1)})),s(t),c(o,t)},R=o=>{var t=_();let e;var r=b(t);k(r,n,"default",{}),s(t),l((()=>e=i(t,1,"mc-button__label svelte-q2e18l",null,e,{hidden:G()}))),c(o,t)};m(P,(o=>{(L()||$.icon)&&"only"===A()?o(Q):o(R,!1)}));var S=d(P,2),T=o=>{var t=y(),e=b(t),r=o=>{var t=v(),e=g(t);k(e,n,"icon",{}),c(o,t)},l=(o,t)=>{var e=o=>{var t=v(),e=g(t);f(e,(()=>`<${H(C(),A(),L())} />`)),c(o,t)};m(o,(o=>{L()&&o(e)}),t)};m(e,(o=>{$.icon?o(r):o(l,!1)})),s(t),c(o,t)};return m(S,(o=>{(L()||$.icon)&&"right"===A()&&o(T)})),s(I),l((()=>{J=i(I,1,`mc-button ${(C()?`mc-button--${C()}`:"")??""} ${(j()?`mc-button--${j()}`:"")??""}`,"svelte-q2e18l",J,{"mc-button--ghost":D(),"mc-button--outlined":E(),"mc-button--icon-only":"only"==A(),"mc-button--loading":G()}),I.disabled=B(),q(I,"type",F())})),c(o,I),a({get style(){return j()},set style(o="standard"){j(o),u()},get size(){return C()},set size(o="m"){C(o),u()},get ghost(){return D()},set ghost(o=!1){D(o),u()},get outlined(){return E()},set outlined(o=!1){E(o),u()},get iconname(){return L()},set iconname(o){L(o),u()},get iconmode(){return A()},set iconmode(o){A(o),u()},get disabled(){return B()},set disabled(o=!1){B(o),u()},get type(){return F()},set type(o="button"){F(o),u()},get isloading(){return G()},set isloading(o=!1){G(o),u()}})}customElements.define("m-button",o($,{style:{},size:{},ghost:{},outlined:{},iconname:{},iconmode:{},disabled:{},type:{},isloading:{}},["icon","default"],[],!0));export{$ as default};
|
|
1
|
+
import{c as o,p as t,a as r,k as e,t as n,d as l,h as c,i as a,l as d,g as b,r as u,s,m as i,n as v}from"../../custom-element-D6iR2OWc.js";import{i as g}from"../../if-CxjAhvpF.js";import{h as m}from"../../html-BTWDDGk7.js";import{s as k,a as j}from"../../slot-snFjRYH3.js";import{s as f,C as h}from"../../attributes-Dd-ZbJDt.js";import p from"../loader/Loader.js";var w=n('<span class="mc-button__icon svelte-jolktj"><!></span>'),_=n('<span class="mc-button__icon svelte-jolktj"><!></span>'),y=n("<span><!></span>"),$=n('<span class="mc-button__icon svelte-jolktj"><!></span>'),x=n("<button><!> <!> <!> <!></button>");const z={hash:"svelte-jolktj",code:"/**\n * Do not edit directly, this file was auto-generated.\n */.mc-button.svelte-jolktj {color:var(--button-color-filled-standard-font, #ffffff);background-color:var(--button-color-filled-standard-background, #464e63);font-weight:600;padding:0 calc(1rem - 0.125rem);min-height:3rem;min-width:3rem;display:inline-flex;justify-content:center;vertical-align:middle;text-align:center;border:2px solid transparent;border-radius:0.25rem;transition:all ease 200ms;transition:box-shadow 200ms ease;align-items:center;box-sizing:border-box;fill:currentcolor;gap:0.25rem;cursor:pointer;}.mc-button.svelte-jolktj:hover {background-color:var(--button-color-filled-standard-hover-background, #343b4c);}.mc-button.svelte-jolktj:active {background-color:var(--button-color-filled-standard-active-background, #242938);}.mc-button.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button.svelte-jolktj .mc-button__label:where(.svelte-jolktj) {font-size:1rem;}.mc-button--s.svelte-jolktj {padding:0 calc(0.75rem - 0.125rem);min-height:2rem;min-width:2rem;}.mc-button--s.svelte-jolktj .mc-button__label:where(.svelte-jolktj) {font-size:0.875rem;}.mc-button--s.svelte-jolktj .mc-button__icon:where(.svelte-jolktj) {width:1.25rem;height:1.25rem;}.mc-button--s.svelte-jolktj .mc-button__icon:where(.svelte-jolktj):only-child {width:1.25rem;height:1.25rem;}.mc-button--m.svelte-jolktj {padding:0 calc(1rem - 0.125rem);min-height:3rem;min-width:3rem;}.mc-button--m.svelte-jolktj .mc-button__label:where(.svelte-jolktj) {font-size:1rem;}.mc-button--m.svelte-jolktj .mc-button__icon:where(.svelte-jolktj) {width:1.5rem;height:1.5rem;}.mc-button--m.svelte-jolktj .mc-button__icon:where(.svelte-jolktj):only-child {width:1.5rem;height:1.5rem;}.mc-button--l.svelte-jolktj {padding:0 calc(1.25rem - 0.125rem);min-height:4rem;min-width:4rem;}.mc-button--l.svelte-jolktj .mc-button__label:where(.svelte-jolktj) {font-size:1.125rem;}.mc-button--l.svelte-jolktj .mc-button__icon:where(.svelte-jolktj) {width:2rem;height:2rem;}.mc-button--l.svelte-jolktj .mc-button__icon:where(.svelte-jolktj):only-child {width:2rem;height:2rem;}.mc-button__label.svelte-jolktj {font-size:1rem;}.mc-button__icon.svelte-jolktj {flex-shrink:0;width:1.5rem;height:1.5rem;}.mc-button.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button.svelte-jolktj:focus-visible {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));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-button--icon-only.svelte-jolktj {padding:0.25rem;}.mc-button--outlined.svelte-jolktj {color:var(--button-color-outlined-standard-font, #242938);border-color:var(--button-color-outlined-standard-border, #8891aa);background-color:var(--button-color-outlined-standard-background, #ffffff);}.mc-button--outlined.svelte-jolktj:hover {background-color:var(--button-color-outlined-standard-hover-background, #eff1f6);}.mc-button--outlined.svelte-jolktj:active {background-color:var(--button-color-outlined-standard-active-background, #c9d0de);}.mc-button--outlined.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.svelte-jolktj {color:var(--button-color-ghost-standard-font, #242938);background-color:var(--button-color-ghost-standard-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.svelte-jolktj:hover {background-color:var(--button-color-ghost-standard-hover-background, rgba(70, 78, 99, 0.1));}.mc-button--ghost.svelte-jolktj:active {background-color:var(--button-color-ghost-standard-active-background, rgba(70, 78, 99, 0.2));}.mc-button--ghost.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--accent.svelte-jolktj {color:var(--button-color-filled-accent-font, #ffffff);background-color:var(--button-color-filled-accent-background, #117f03);}.mc-button--accent.svelte-jolktj:hover {background-color:var(--button-color-filled-accent-hover-background, #006902);}.mc-button--accent.svelte-jolktj:active {background-color:var(--button-color-filled-accent-active-background, #035010);}.mc-button--accent.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--danger.svelte-jolktj {color:var(--button-color-filled-danger-font, #ffffff);background-color:var(--button-color-filled-danger-background, #c61112);}.mc-button--danger.svelte-jolktj:hover {background-color:var(--button-color-filled-danger-hover-background, #8c0003);}.mc-button--danger.svelte-jolktj:active {background-color:var(--button-color-filled-danger-active-background, #530000);}.mc-button--danger.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--inverse.svelte-jolktj {--focus-color-mid: var(--focus-color-outline-outer, #000000);--focus-color-outer: var(--focus-color-outline-mid, #ffffff);color:var(--button-color-filled-inverse-font, #242938);background-color:var(--button-color-filled-inverse-background, #ffffff);}.mc-button--inverse.svelte-jolktj:hover {background-color:var(--button-color-filled-inverse-hover-background, #e6e6e6);}.mc-button--inverse.svelte-jolktj:active {background-color:var(--button-color-filled-inverse-active-background, #cccccc);}.mc-button--inverse.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--icon-button.svelte-jolktj {border-radius:100%;padding:0;}.mc-button--loading.svelte-jolktj .mc-button__label:where(.svelte-jolktj),\n.mc-button--loading.svelte-jolktj .mc-button__icon:where(.svelte-jolktj) {visibility:hidden;}.mc-button--outlined.mc-button--standard.svelte-jolktj {color:var(--button-color-outlined-standard-font, #242938);border-color:var(--button-color-outlined-standard-border, #8891aa);background-color:var(--button-color-outlined-standard-background, #ffffff);}.mc-button--outlined.mc-button--standard.svelte-jolktj:hover {background-color:var(--button-color-outlined-standard-hover-background, #eff1f6);}.mc-button--outlined.mc-button--standard.svelte-jolktj:active {background-color:var(--button-color-outlined-standard-active-background, #c9d0de);}.mc-button--outlined.mc-button--standard.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--accent.svelte-jolktj {color:var(--button-color-outlined-accent-font, #117f03);border-color:var(--button-color-outlined-accent-border, #78be20);background-color:var(--button-color-outlined-accent-background, #ffffff);}.mc-button--outlined.mc-button--accent.svelte-jolktj:hover {background-color:var(--button-color-outlined-accent-hover-background, #ebf5de);}.mc-button--outlined.mc-button--accent.svelte-jolktj:active {background-color:var(--button-color-outlined-accent-active-background, #c5e39e);}.mc-button--outlined.mc-button--accent.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--danger.svelte-jolktj {color:var(--button-color-outlined-danger-font, #c61112);border-color:var(--button-color-outlined-danger-border, #ef5f5c);background-color:var(--button-color-outlined-danger-background, #ffffff);}.mc-button--outlined.mc-button--danger.svelte-jolktj:hover {background-color:var(--button-color-outlined-danger-hover-background, #fdeaea);}.mc-button--outlined.mc-button--danger.svelte-jolktj:active {background-color:var(--button-color-outlined-danger-active-background, #f8bcbb);}.mc-button--outlined.mc-button--danger.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--inverse.svelte-jolktj {color:var(--button-color-outlined-inverse-font, #ffffff);border-color:var(--button-color-outlined-inverse-border, #ffffff);background-color:var(--button-color-outlined-inverse-background, rgba(255, 255, 255, 0.01));}.mc-button--outlined.mc-button--inverse.svelte-jolktj:hover {background-color:var(--button-color-outlined-inverse-hover-background, rgba(255, 255, 255, 0.1));}.mc-button--outlined.mc-button--inverse.svelte-jolktj:active {background-color:var(--button-color-outlined-inverse-active-background, rgba(255, 255, 255, 0.2));}.mc-button--outlined.mc-button--inverse.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--standard.svelte-jolktj {color:var(--button-color-ghost-standard-font, #242938);background-color:var(--button-color-ghost-standard-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--standard.svelte-jolktj:hover {background-color:var(--button-color-ghost-standard-hover-background, rgba(70, 78, 99, 0.1));}.mc-button--ghost.mc-button--standard.svelte-jolktj:active {background-color:var(--button-color-ghost-standard-active-background, rgba(70, 78, 99, 0.2));}.mc-button--ghost.mc-button--standard.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--accent.svelte-jolktj {color:var(--button-color-ghost-accent-font, #117f03);background-color:var(--button-color-ghost-accent-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--accent.svelte-jolktj:hover {background-color:var(--button-color-ghost-accent-hover-background, rgba(17, 127, 3, 0.1));}.mc-button--ghost.mc-button--accent.svelte-jolktj:active {background-color:var(--button-color-ghost-accent-active-background, rgba(17, 127, 3, 0.2));}.mc-button--ghost.mc-button--accent.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--danger.svelte-jolktj {color:var(--button-color-ghost-danger-font, #c61112);background-color:var(--button-color-ghost-danger-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--danger.svelte-jolktj:hover {background-color:var(--button-color-ghost-danger-hover-background, rgba(198, 17, 18, 0.1));}.mc-button--ghost.mc-button--danger.svelte-jolktj:active {background-color:var(--button-color-ghost-danger-active-background, rgba(198, 17, 18, 0.2));}.mc-button--ghost.mc-button--danger.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--inverse.svelte-jolktj {color:var(--button-color-ghost-inverse-font, #ffffff);background-color:var(--button-color-ghost-inverse-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--inverse.svelte-jolktj:hover {background-color:var(--button-color-ghost-inverse-hover-background, rgba(255, 255, 255, 0.1));}.mc-button--ghost.mc-button--inverse.svelte-jolktj:active {background-color:var(--button-color-ghost-inverse-active-background, rgba(255, 255, 255, 0.2));}.mc-button--ghost.mc-button--inverse.svelte-jolktj:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button__icon.svelte-jolktj {pointer-events:none;}.hidden.svelte-jolktj {visibility:hidden;}.loader-style.svelte-jolktj {color:currentColor;position:absolute;}"};function O(o,n){const O=k(n);t(n,!0),r(o,z);var C=this&&this.__rest||function(o,t){var r={};for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&t.indexOf(e)<0&&(r[e]=o[e]);if(null!=o&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(e=Object.getOwnPropertySymbols(o);n<e.length;n++)t.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(o,e[n])&&(r[e[n]]=o[e[n]])}return r};let P=e(n,["$$slots","$$events","$$legacy","$$host"]),{appearance:E="standard",size:S="m",ghost:D=!1,outlined:I=!1,iconname:L,iconmode:q,disabled:A=!1,type:B="button",isloading:F=!1}=P,G=C(P,["appearance","size","ghost","outlined","iconname","iconmode","disabled","type","isloading"]);function H(o,t,r){const e="only"===t;let n;switch(o){case"s":n="24px";break;case"m":n=e?"32px":"24px";break;case"l":n=e?"100%":"32px"}return`${r} size="${n}" `}var J=x();let K;var M=b(J),N=o=>{p(o,{theme:"standard",style:"color: currentColor; position: absolute;",size:"m",text:""})};g(M,(o=>{F&&o(N)}));var Q=d(M,2),R=o=>{var t=w(),r=b(t),e=o=>{var t=i(),r=v(t);j(r,n,"icon",{}),c(o,t)},l=(o,t)=>{var r=o=>{var t=i(),r=v(t);m(r,(()=>`<${H(S,q,L)} />`)),c(o,t)};g(o,(o=>{L&&o(r)}),t)};g(r,(o=>{O.icon?o(e):o(l,!1)})),u(t),c(o,t)};g(Q,(o=>{(L||O.icon)&&"left"===q&&o(R)}));var T=d(Q,2),U=o=>{var t=_(),r=b(t),e=o=>{var t=i(),r=v(t);j(r,n,"icon",{}),c(o,t)},l=(o,t)=>{var r=o=>{var t=i(),r=v(t);m(r,(()=>`<${H(S,q,L)} />`)),c(o,t)};g(o,(o=>{L&&o(r)}),t)};g(r,(o=>{O.icon?o(e):o(l,!1)})),u(t),c(o,t)},V=o=>{var t=y();s(t,1,"mc-button__label svelte-jolktj",null,{},{hidden:F});var r=b(t);j(r,n,"default",{}),u(t),c(o,t)};g(T,(o=>{(L||O.icon)&&"only"===q?o(U):o(V,!1)}));var W=d(T,2),X=o=>{var t=$(),r=b(t),e=o=>{var t=i(),r=v(t);j(r,n,"icon",{}),c(o,t)},l=(o,t)=>{var r=o=>{var t=i(),r=v(t);m(r,(()=>`<${H(S,q,L)} />`)),c(o,t)};g(o,(o=>{L&&o(r)}),t)};g(r,(o=>{O.icon?o(e):o(l,!1)})),u(t),c(o,t)};g(W,(o=>{(L||O.icon)&&"right"===q&&o(X)})),u(J),l((()=>K=f(J,K,{class:`mc-button ${(S?`mc-button--${S}`:"")??""} ${(E?`mc-button--${E}`:"")??""}`,disabled:A,type:B,...G,[h]:{"mc-button--ghost":D,"mc-button--outlined":I,"mc-button--icon-only":"only"==q,"mc-button--loading":F}},"svelte-jolktj"))),c(o,J),a()}customElements.define("m-button",o(O,{},["icon","default"],[],!0));export{O as default};
|
|
2
2
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/components/button/Button.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-button' }} />\n\n<script lang=\"ts\">\n
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/components/button/Button.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-button' }} />\n\n<script lang=\"ts\">\n import type {\n ButtonIconMode,\n ButtonSize,\n ButtonStyle,\n ButtonType,\n } from './button.types';\n\n import Loader from '../loader/Loader.svelte';\n\n interface Props {\n appearance?: ButtonStyle | undefined;\n size?: ButtonSize;\n ghost?: boolean;\n outlined?: boolean;\n iconname: string | undefined;\n iconmode: ButtonIconMode | undefined;\n disabled?: boolean;\n type?: ButtonType;\n isloading?: boolean;\n [key: string]: any;\n }\n\n let {\n appearance = 'standard',\n size = 'm',\n ghost = false,\n outlined = false,\n iconname,\n iconmode,\n disabled = false,\n type = 'button',\n isloading = false,\n ...events\n }: Props = $props();\n\n function generateIconName(\n size: ButtonSize,\n iconMode: ButtonIconMode,\n iconName: string,\n ): string {\n const isIconOnly = iconMode === 'only';\n let iconSize: string;\n\n switch (size) {\n case 's':\n iconSize = '24px';\n break;\n case 'm':\n iconSize = isIconOnly ? '32px' : '24px';\n break;\n case 'l':\n iconSize = isIconOnly ? '100%' : '32px';\n break;\n }\n\n return `${iconName} size=\"${iconSize}\" `;\n }\n</script>\n\n<button\n class=\"mc-button {size ? `mc-button--${size}` : ''} {appearance\n ? `mc-button--${appearance}`\n : ''}\"\n class:mc-button--ghost={ghost}\n class:mc-button--outlined={outlined}\n class:mc-button--icon-only={iconmode == 'only'}\n class:mc-button--loading={isloading}\n {disabled}\n {type}\n {...events}\n>\n {#if isloading}\n <Loader\n theme=\"standard\"\n style=\"color: currentColor; position: absolute;\"\n size=\"m\"\n text=\"\"\n />\n {/if}\n {#if (iconname || $$slots.icon) && iconmode === 'left'}\n <span class=\"mc-button__icon\">\n {#if $$slots.icon}\n <slot name=\"icon\" />\n {:else if iconname}\n {@html `<${generateIconName(size, iconmode, iconname)} />`}\n {/if}\n </span>\n {/if}\n\n {#if (iconname || $$slots.icon) && iconmode === 'only'}\n <span class=\"mc-button__icon\">\n {#if $$slots.icon}\n <slot name=\"icon\" />\n {:else if iconname}\n {@html `<${generateIconName(size, iconmode, iconname)} />`}\n {/if}\n </span>\n {:else}\n <span class=\"mc-button__label\" class:hidden={isloading}>\n <slot />\n </span>\n {/if}\n\n {#if (iconname || $$slots.icon) && iconmode === 'right'}\n <span class=\"mc-button__icon\">\n {#if $$slots.icon}\n <slot name=\"icon\" />\n {:else if iconname}\n {@html `<${generateIconName(size, iconmode, iconname)} />`}\n {/if}\n </span>\n {/if}\n</button>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/button';\n\n .mc-button__icon {\n pointer-events: none;\n }\n\n .hidden {\n visibility: hidden;\n }\n\n .loader-style {\n color: currentColor;\n position: absolute;\n }\n</style>\n"],"names":["__rest","this","s","e","_a","$.rest_props","$$props","appearance","size","ghost","outlined","iconname","iconmode","disabled","type","isloading","events","generateIconName","iconMode","iconName","isIconOnly","iconSize","$$render","consequent","$.html","node_4","consequent_2","$$slots","icon","consequent_1","alternate","consequent_3","node_8","consequent_5","consequent_4","alternate_1","consequent_6","alternate_2","node_13","consequent_8","consequent_7","alternate_3","consequent_9"],"mappings":"s7ZAEiB,IAAAA,EAAAC,MAAAA,KAAAD,QAAA,SAAAE,EAAAC,+TAuBX,IAAAC,EAAAC,EAAAC,EAAA,CAAA,UAAA,WAAA,WAAA,uBACFC,EAAa,WAAUC,KACvBA,EAAO,IAAGC,MACVA,GAAQ,EAAKC,SACbA,GAAW,EAAKC,SAChBA,EAAQC,SACRA,EAAQC,SACRA,GAAW,EAAKC,KAChBA,EAAO,SAAQC,UACfA,GAAY,GAAKX,EACdY,EAAMhB,EAAAI,EAAA,CAVP,aAAA,OAAA,QAAA,WAAA,WAAA,WAAA,WAAA,OAAA,cAaK,SAAAa,EACPT,EACAU,EACAC,SAEMC,EAA0B,SAAbF,MACfG,SAEIb,OACD,IACHa,EAAW,iBAER,IACHA,EAAWD,EAAa,OAAS,iBAE9B,IACHC,EAAWD,EAAa,OAAS,OAI3B,MAAA,GAAAD,WAAkBE,KAC9B,sIAeKN,GAASO,EAAAC,EAAA,6HAaGC,EAAAC,GAAA,IAAA,IAAAR,EAAiBT,EAAMI,EAAUD,2BADpCA,GAAQW,EAAAI,EAAA,gBAFbC,EAAQC,KAAIN,EAAAO,GAAAP,EAAAQ,GAAA,EAAA,2BAFfnB,GAAYgB,EAAQC,OAAsB,SAAbhB,GAAmBU,EAAAS,EAAA,6HAerCP,EAAAQ,GAAA,IAAA,IAAAf,EAAiBT,EAAMI,EAAUD,2BADpCA,GAAQW,EAAAW,EAAA,gBAFbN,EAAQC,KAAIN,EAAAY,GAAAZ,EAAAa,GAAA,EAAA,wFAO0BpB,0DATzCJ,GAAYgB,EAAQC,OAAsB,SAAbhB,EAAmBU,EAAAc,GAAAd,EAAAe,GAAA,EAAA,6HAmBrCb,EAAAc,GAAA,IAAA,IAAArB,EAAiBT,EAAMI,EAAUD,2BADpCA,GAAQW,EAAAiB,EAAA,gBAFbZ,EAAQC,KAAIN,EAAAkB,GAAAlB,EAAAmB,GAAA,EAAA,2BAFf9B,GAAYgB,EAAQC,OAAsB,UAAbhB,GAAoBU,EAAAoB,EAAA,6CA3CrClC,EAAI,cAAiBA,IAAS,YAAKD,EACnC,cAAAA,IACd,KAAE,0BAOFS,0BANoBP,wBACGC,EACC,uBAAY,QAAZE,uBACFG"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<svelte:options customElement={{ tag: 'm-button' }} />
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
|
-
// @ts-ignore Need to use internal Svelte function
|
|
5
4
|
import type {
|
|
6
5
|
ButtonIconMode,
|
|
7
6
|
ButtonSize,
|
|
@@ -9,10 +8,10 @@
|
|
|
9
8
|
ButtonType,
|
|
10
9
|
} from './button.types';
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
import Loader from '../loader/Loader.svelte';
|
|
13
12
|
|
|
14
13
|
interface Props {
|
|
15
|
-
|
|
14
|
+
appearance?: ButtonStyle | undefined;
|
|
16
15
|
size?: ButtonSize;
|
|
17
16
|
ghost?: boolean;
|
|
18
17
|
outlined?: boolean;
|
|
@@ -25,7 +24,7 @@
|
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
let {
|
|
28
|
-
|
|
27
|
+
appearance = 'standard',
|
|
29
28
|
size = 'm',
|
|
30
29
|
ghost = false,
|
|
31
30
|
outlined = false,
|
|
@@ -34,10 +33,9 @@
|
|
|
34
33
|
disabled = false,
|
|
35
34
|
type = 'button',
|
|
36
35
|
isloading = false,
|
|
36
|
+
...events
|
|
37
37
|
}: Props = $props();
|
|
38
38
|
|
|
39
|
-
let attributes = $derived({ ...rest });
|
|
40
|
-
|
|
41
39
|
function generateIconName(
|
|
42
40
|
size: ButtonSize,
|
|
43
41
|
iconMode: ButtonIconMode,
|
|
@@ -63,8 +61,8 @@
|
|
|
63
61
|
</script>
|
|
64
62
|
|
|
65
63
|
<button
|
|
66
|
-
class="mc-button {size ? `mc-button--${size}` : ''} {
|
|
67
|
-
? `mc-button--${
|
|
64
|
+
class="mc-button {size ? `mc-button--${size}` : ''} {appearance
|
|
65
|
+
? `mc-button--${appearance}`
|
|
68
66
|
: ''}"
|
|
69
67
|
class:mc-button--ghost={ghost}
|
|
70
68
|
class:mc-button--outlined={outlined}
|
|
@@ -72,6 +70,7 @@
|
|
|
72
70
|
class:mc-button--loading={isloading}
|
|
73
71
|
{disabled}
|
|
74
72
|
{type}
|
|
73
|
+
{...events}
|
|
75
74
|
>
|
|
76
75
|
{#if isloading}
|
|
77
76
|
<Loader
|
|
@@ -126,4 +125,9 @@
|
|
|
126
125
|
.hidden {
|
|
127
126
|
visibility: hidden;
|
|
128
127
|
}
|
|
128
|
+
|
|
129
|
+
.loader-style {
|
|
130
|
+
color: currentColor;
|
|
131
|
+
position: absolute;
|
|
132
|
+
}
|
|
129
133
|
</style>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as o,p as t,a as r,b as e,t as a,d as c,h as n,i as d,j as l,g as b,r as u,s}from"../../custom-element-C0xaDU2s.js";import{h as i}from"../../html-h1-V2s6a.js";import{s as v}from"../../attributes-C2cU7aS9.js";var g=a("<button><!></button>");const f={hash:"svelte-afhc2k",code:"/**\n * Do not edit directly, this file was auto-generated.\n */.mc-button.svelte-afhc2k {color:var(--button-color-filled-standard-font, #ffffff);background-color:var(--button-color-filled-standard-background, #464e63);font-weight:600;padding:0 calc(1rem - 0.125rem);min-height:3rem;min-width:3rem;display:inline-flex;justify-content:center;vertical-align:middle;text-align:center;border:2px solid transparent;border-radius:0.25rem;transition:all ease 200ms;transition:box-shadow 200ms ease;align-items:center;box-sizing:border-box;fill:currentcolor;gap:0.25rem;cursor:pointer;}.mc-button.svelte-afhc2k:hover {background-color:var(--button-color-filled-standard-hover-background, #343b4c);}.mc-button.svelte-afhc2k:active {background-color:var(--button-color-filled-standard-active-background, #242938);}.mc-button.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--s.svelte-afhc2k {padding:0 calc(0.75rem - 0.125rem);min-height:2rem;min-width:2rem;}.mc-button--m.svelte-afhc2k {padding:0 calc(1rem - 0.125rem);min-height:3rem;min-width:3rem;}.mc-button--l.svelte-afhc2k {padding:0 calc(1.25rem - 0.125rem);min-height:4rem;min-width:4rem;}.mc-button__label.svelte-afhc2k {font-size:1rem;}.mc-button__icon.svelte-afhc2k {flex-shrink:0;width:1.5rem;height:1.5rem;}.mc-button.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button.svelte-afhc2k:focus-visible {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));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-button--icon-only.svelte-afhc2k {padding:0.25rem;}.mc-button--outlined.svelte-afhc2k {color:var(--button-color-outlined-standard-font, #242938);border-color:var(--button-color-outlined-standard-border, #8891aa);background-color:var(--button-color-outlined-standard-background, #ffffff);}.mc-button--outlined.svelte-afhc2k:hover {background-color:var(--button-color-outlined-standard-hover-background, #eff1f6);}.mc-button--outlined.svelte-afhc2k:active {background-color:var(--button-color-outlined-standard-active-background, #c9d0de);}.mc-button--outlined.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.svelte-afhc2k {color:var(--button-color-ghost-standard-font, #242938);background-color:var(--button-color-ghost-standard-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.svelte-afhc2k:hover {background-color:var(--button-color-ghost-standard-hover-background, rgba(70, 78, 99, 0.1));}.mc-button--ghost.svelte-afhc2k:active {background-color:var(--button-color-ghost-standard-active-background, rgba(70, 78, 99, 0.2));}.mc-button--ghost.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--accent.svelte-afhc2k {color:var(--button-color-filled-accent-font, #ffffff);background-color:var(--button-color-filled-accent-background, #117f03);}.mc-button--accent.svelte-afhc2k:hover {background-color:var(--button-color-filled-accent-hover-background, #006902);}.mc-button--accent.svelte-afhc2k:active {background-color:var(--button-color-filled-accent-active-background, #035010);}.mc-button--accent.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--danger.svelte-afhc2k {color:var(--button-color-filled-danger-font, #ffffff);background-color:var(--button-color-filled-danger-background, #c61112);}.mc-button--danger.svelte-afhc2k:hover {background-color:var(--button-color-filled-danger-hover-background, #8c0003);}.mc-button--danger.svelte-afhc2k:active {background-color:var(--button-color-filled-danger-active-background, #530000);}.mc-button--danger.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--inverse.svelte-afhc2k {--focus-color-mid: var(--focus-color-outline-outer, #000000);--focus-color-outer: var(--focus-color-outline-mid, #ffffff);color:var(--button-color-filled-inverse-font, #242938);background-color:var(--button-color-filled-inverse-background, #ffffff);}.mc-button--inverse.svelte-afhc2k:hover {background-color:var(--button-color-filled-inverse-hover-background, #e6e6e6);}.mc-button--inverse.svelte-afhc2k:active {background-color:var(--button-color-filled-inverse-active-background, #cccccc);}.mc-button--inverse.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--icon-button.svelte-afhc2k {border-radius:100%;padding:0;}.mc-button--outlined.mc-button--standard.svelte-afhc2k {color:var(--button-color-outlined-standard-font, #242938);border-color:var(--button-color-outlined-standard-border, #8891aa);background-color:var(--button-color-outlined-standard-background, #ffffff);}.mc-button--outlined.mc-button--standard.svelte-afhc2k:hover {background-color:var(--button-color-outlined-standard-hover-background, #eff1f6);}.mc-button--outlined.mc-button--standard.svelte-afhc2k:active {background-color:var(--button-color-outlined-standard-active-background, #c9d0de);}.mc-button--outlined.mc-button--standard.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--accent.svelte-afhc2k {color:var(--button-color-outlined-accent-font, #117f03);border-color:var(--button-color-outlined-accent-border, #78be20);background-color:var(--button-color-outlined-accent-background, #ffffff);}.mc-button--outlined.mc-button--accent.svelte-afhc2k:hover {background-color:var(--button-color-outlined-accent-hover-background, #ebf5de);}.mc-button--outlined.mc-button--accent.svelte-afhc2k:active {background-color:var(--button-color-outlined-accent-active-background, #c5e39e);}.mc-button--outlined.mc-button--accent.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--danger.svelte-afhc2k {color:var(--button-color-outlined-danger-font, #c61112);border-color:var(--button-color-outlined-danger-border, #ef5f5c);background-color:var(--button-color-outlined-danger-background, #ffffff);}.mc-button--outlined.mc-button--danger.svelte-afhc2k:hover {background-color:var(--button-color-outlined-danger-hover-background, #fdeaea);}.mc-button--outlined.mc-button--danger.svelte-afhc2k:active {background-color:var(--button-color-outlined-danger-active-background, #f8bcbb);}.mc-button--outlined.mc-button--danger.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--inverse.svelte-afhc2k {color:var(--button-color-outlined-inverse-font, #ffffff);border-color:var(--button-color-outlined-inverse-border, #ffffff);background-color:var(--button-color-outlined-inverse-background, rgba(255, 255, 255, 0.01));}.mc-button--outlined.mc-button--inverse.svelte-afhc2k:hover {background-color:var(--button-color-outlined-inverse-hover-background, rgba(255, 255, 255, 0.1));}.mc-button--outlined.mc-button--inverse.svelte-afhc2k:active {background-color:var(--button-color-outlined-inverse-active-background, rgba(255, 255, 255, 0.2));}.mc-button--outlined.mc-button--inverse.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--standard.svelte-afhc2k {color:var(--button-color-ghost-standard-font, #242938);background-color:var(--button-color-ghost-standard-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--standard.svelte-afhc2k:hover {background-color:var(--button-color-ghost-standard-hover-background, rgba(70, 78, 99, 0.1));}.mc-button--ghost.mc-button--standard.svelte-afhc2k:active {background-color:var(--button-color-ghost-standard-active-background, rgba(70, 78, 99, 0.2));}.mc-button--ghost.mc-button--standard.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--accent.svelte-afhc2k {color:var(--button-color-ghost-accent-font, #117f03);background-color:var(--button-color-ghost-accent-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--accent.svelte-afhc2k:hover {background-color:var(--button-color-ghost-accent-hover-background, rgba(17, 127, 3, 0.1));}.mc-button--ghost.mc-button--accent.svelte-afhc2k:active {background-color:var(--button-color-ghost-accent-active-background, rgba(17, 127, 3, 0.2));}.mc-button--ghost.mc-button--accent.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--danger.svelte-afhc2k {color:var(--button-color-ghost-danger-font, #c61112);background-color:var(--button-color-ghost-danger-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--danger.svelte-afhc2k:hover {background-color:var(--button-color-ghost-danger-hover-background, rgba(198, 17, 18, 0.1));}.mc-button--ghost.mc-button--danger.svelte-afhc2k:active {background-color:var(--button-color-ghost-danger-active-background, rgba(198, 17, 18, 0.2));}.mc-button--ghost.mc-button--danger.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--inverse.svelte-afhc2k {color:var(--button-color-ghost-inverse-font, #ffffff);background-color:var(--button-color-ghost-inverse-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--inverse.svelte-afhc2k:hover {background-color:var(--button-color-ghost-inverse-hover-background, rgba(255, 255, 255, 0.1));}.mc-button--ghost.mc-button--inverse.svelte-afhc2k:active {background-color:var(--button-color-ghost-inverse-active-background, rgba(255, 255, 255, 0.2));}.mc-button--ghost.mc-button--inverse.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}"};function k(o,a){t(a,!0),r(o,f);let k=e(a,"style",7,"standard"),h=e(a,"size",7,"m"),m=e(a,"ghost",7,!1),p=e(a,"outlined",7,!1),w=e(a,"iconname",7),y=e(a,"disabled",7,!1),x=e(a,"type",7,"button");var z=g();let $;var j=b(z);return i(j,(()=>`<${function(o,t){let r;switch(o){case"s":r="20px";break;case"m":r="24px";break;case"l":r="32px"}return`${t} size="${r}" `}(h(),w())} />`)),u(z),c((()=>{$=s(z,1,`mc-button mc-button--icon-button ${(h()?`mc-button--${h()}`:"")??""} ${(k()?`mc-button--${k()}`:"")??""}`,"svelte-afhc2k",$,{"mc-button--ghost":m(),"mc-button--outlined":p()}),z.disabled=y(),v(z,"type",x())})),n(o,z),d({get style(){return k()},set style(o="standard"){k(o),l()},get size(){return h()},set size(o="m"){h(o),l()},get ghost(){return m()},set ghost(o=!1){m(o),l()},get outlined(){return p()},set outlined(o=!1){p(o),l()},get iconname(){return w()},set iconname(o){w(o),l()},get disabled(){return y()},set disabled(o=!1){y(o),l()},get type(){return x()},set type(o="button"){x(o),l()}})}customElements.define("m-icon-button",o(k,{style:{},size:{},ghost:{},outlined:{},iconname:{},disabled:{},type:{}},[],[],!1));export{k as default};
|
|
1
|
+
import{c as o,p as t,a as r,k as a,t as c,d as e,h as n,i as d,g as l,r as b}from"../../custom-element-D6iR2OWc.js";import{h as u}from"../../html-BTWDDGk7.js";import{s,C as i}from"../../attributes-Dd-ZbJDt.js";var v=c("<button><!></button>");const g={hash:"svelte-afhc2k",code:"/**\n * Do not edit directly, this file was auto-generated.\n */.mc-button.svelte-afhc2k {color:var(--button-color-filled-standard-font, #ffffff);background-color:var(--button-color-filled-standard-background, #464e63);font-weight:600;padding:0 calc(1rem - 0.125rem);min-height:3rem;min-width:3rem;display:inline-flex;justify-content:center;vertical-align:middle;text-align:center;border:2px solid transparent;border-radius:0.25rem;transition:all ease 200ms;transition:box-shadow 200ms ease;align-items:center;box-sizing:border-box;fill:currentcolor;gap:0.25rem;cursor:pointer;}.mc-button.svelte-afhc2k:hover {background-color:var(--button-color-filled-standard-hover-background, #343b4c);}.mc-button.svelte-afhc2k:active {background-color:var(--button-color-filled-standard-active-background, #242938);}.mc-button.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--s.svelte-afhc2k {padding:0 calc(0.75rem - 0.125rem);min-height:2rem;min-width:2rem;}.mc-button--m.svelte-afhc2k {padding:0 calc(1rem - 0.125rem);min-height:3rem;min-width:3rem;}.mc-button--l.svelte-afhc2k {padding:0 calc(1.25rem - 0.125rem);min-height:4rem;min-width:4rem;}.mc-button__label.svelte-afhc2k {font-size:1rem;}.mc-button__icon.svelte-afhc2k {flex-shrink:0;width:1.5rem;height:1.5rem;}.mc-button.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button.svelte-afhc2k:focus-visible {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));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-button--icon-only.svelte-afhc2k {padding:0.25rem;}.mc-button--outlined.svelte-afhc2k {color:var(--button-color-outlined-standard-font, #242938);border-color:var(--button-color-outlined-standard-border, #8891aa);background-color:var(--button-color-outlined-standard-background, #ffffff);}.mc-button--outlined.svelte-afhc2k:hover {background-color:var(--button-color-outlined-standard-hover-background, #eff1f6);}.mc-button--outlined.svelte-afhc2k:active {background-color:var(--button-color-outlined-standard-active-background, #c9d0de);}.mc-button--outlined.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.svelte-afhc2k {color:var(--button-color-ghost-standard-font, #242938);background-color:var(--button-color-ghost-standard-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.svelte-afhc2k:hover {background-color:var(--button-color-ghost-standard-hover-background, rgba(70, 78, 99, 0.1));}.mc-button--ghost.svelte-afhc2k:active {background-color:var(--button-color-ghost-standard-active-background, rgba(70, 78, 99, 0.2));}.mc-button--ghost.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--accent.svelte-afhc2k {color:var(--button-color-filled-accent-font, #ffffff);background-color:var(--button-color-filled-accent-background, #117f03);}.mc-button--accent.svelte-afhc2k:hover {background-color:var(--button-color-filled-accent-hover-background, #006902);}.mc-button--accent.svelte-afhc2k:active {background-color:var(--button-color-filled-accent-active-background, #035010);}.mc-button--accent.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--danger.svelte-afhc2k {color:var(--button-color-filled-danger-font, #ffffff);background-color:var(--button-color-filled-danger-background, #c61112);}.mc-button--danger.svelte-afhc2k:hover {background-color:var(--button-color-filled-danger-hover-background, #8c0003);}.mc-button--danger.svelte-afhc2k:active {background-color:var(--button-color-filled-danger-active-background, #530000);}.mc-button--danger.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--inverse.svelte-afhc2k {--focus-color-mid: var(--focus-color-outline-outer, #000000);--focus-color-outer: var(--focus-color-outline-mid, #ffffff);color:var(--button-color-filled-inverse-font, #242938);background-color:var(--button-color-filled-inverse-background, #ffffff);}.mc-button--inverse.svelte-afhc2k:hover {background-color:var(--button-color-filled-inverse-hover-background, #e6e6e6);}.mc-button--inverse.svelte-afhc2k:active {background-color:var(--button-color-filled-inverse-active-background, #cccccc);}.mc-button--inverse.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--icon-button.svelte-afhc2k {border-radius:100%;padding:0;}.mc-button--outlined.mc-button--standard.svelte-afhc2k {color:var(--button-color-outlined-standard-font, #242938);border-color:var(--button-color-outlined-standard-border, #8891aa);background-color:var(--button-color-outlined-standard-background, #ffffff);}.mc-button--outlined.mc-button--standard.svelte-afhc2k:hover {background-color:var(--button-color-outlined-standard-hover-background, #eff1f6);}.mc-button--outlined.mc-button--standard.svelte-afhc2k:active {background-color:var(--button-color-outlined-standard-active-background, #c9d0de);}.mc-button--outlined.mc-button--standard.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--accent.svelte-afhc2k {color:var(--button-color-outlined-accent-font, #117f03);border-color:var(--button-color-outlined-accent-border, #78be20);background-color:var(--button-color-outlined-accent-background, #ffffff);}.mc-button--outlined.mc-button--accent.svelte-afhc2k:hover {background-color:var(--button-color-outlined-accent-hover-background, #ebf5de);}.mc-button--outlined.mc-button--accent.svelte-afhc2k:active {background-color:var(--button-color-outlined-accent-active-background, #c5e39e);}.mc-button--outlined.mc-button--accent.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--danger.svelte-afhc2k {color:var(--button-color-outlined-danger-font, #c61112);border-color:var(--button-color-outlined-danger-border, #ef5f5c);background-color:var(--button-color-outlined-danger-background, #ffffff);}.mc-button--outlined.mc-button--danger.svelte-afhc2k:hover {background-color:var(--button-color-outlined-danger-hover-background, #fdeaea);}.mc-button--outlined.mc-button--danger.svelte-afhc2k:active {background-color:var(--button-color-outlined-danger-active-background, #f8bcbb);}.mc-button--outlined.mc-button--danger.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--outlined.mc-button--inverse.svelte-afhc2k {color:var(--button-color-outlined-inverse-font, #ffffff);border-color:var(--button-color-outlined-inverse-border, #ffffff);background-color:var(--button-color-outlined-inverse-background, rgba(255, 255, 255, 0.01));}.mc-button--outlined.mc-button--inverse.svelte-afhc2k:hover {background-color:var(--button-color-outlined-inverse-hover-background, rgba(255, 255, 255, 0.1));}.mc-button--outlined.mc-button--inverse.svelte-afhc2k:active {background-color:var(--button-color-outlined-inverse-active-background, rgba(255, 255, 255, 0.2));}.mc-button--outlined.mc-button--inverse.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--standard.svelte-afhc2k {color:var(--button-color-ghost-standard-font, #242938);background-color:var(--button-color-ghost-standard-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--standard.svelte-afhc2k:hover {background-color:var(--button-color-ghost-standard-hover-background, rgba(70, 78, 99, 0.1));}.mc-button--ghost.mc-button--standard.svelte-afhc2k:active {background-color:var(--button-color-ghost-standard-active-background, rgba(70, 78, 99, 0.2));}.mc-button--ghost.mc-button--standard.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--accent.svelte-afhc2k {color:var(--button-color-ghost-accent-font, #117f03);background-color:var(--button-color-ghost-accent-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--accent.svelte-afhc2k:hover {background-color:var(--button-color-ghost-accent-hover-background, rgba(17, 127, 3, 0.1));}.mc-button--ghost.mc-button--accent.svelte-afhc2k:active {background-color:var(--button-color-ghost-accent-active-background, rgba(17, 127, 3, 0.2));}.mc-button--ghost.mc-button--accent.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--danger.svelte-afhc2k {color:var(--button-color-ghost-danger-font, #c61112);background-color:var(--button-color-ghost-danger-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--danger.svelte-afhc2k:hover {background-color:var(--button-color-ghost-danger-hover-background, rgba(198, 17, 18, 0.1));}.mc-button--ghost.mc-button--danger.svelte-afhc2k:active {background-color:var(--button-color-ghost-danger-active-background, rgba(198, 17, 18, 0.2));}.mc-button--ghost.mc-button--danger.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-button--ghost.mc-button--inverse.svelte-afhc2k {color:var(--button-color-ghost-inverse-font, #ffffff);background-color:var(--button-color-ghost-inverse-background, rgba(255, 255, 255, 0.01));}.mc-button--ghost.mc-button--inverse.svelte-afhc2k:hover {background-color:var(--button-color-ghost-inverse-hover-background, rgba(255, 255, 255, 0.1));}.mc-button--ghost.mc-button--inverse.svelte-afhc2k:active {background-color:var(--button-color-ghost-inverse-active-background, rgba(255, 255, 255, 0.2));}.mc-button--ghost.mc-button--inverse.svelte-afhc2k:disabled {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}"};function f(o,c){t(c,!0),r(o,g);var f=this&&this.__rest||function(o,t){var r={};for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&t.indexOf(a)<0&&(r[a]=o[a]);if(null!=o&&"function"==typeof Object.getOwnPropertySymbols){var c=0;for(a=Object.getOwnPropertySymbols(o);c<a.length;c++)t.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(o,a[c])&&(r[a[c]]=o[a[c]])}return r};let k=a(c,["$$slots","$$events","$$legacy","$$host"]),{appearance:h="standard",size:m="m",ghost:p=!1,outlined:w=!1,iconname:y,disabled:$=!1,type:x="button"}=k,O=f(k,["appearance","size","ghost","outlined","iconname","disabled","type"]);var j=v();let _;var z=l(j);u(z,(()=>`<${function(o,t){let r;switch(o){case"s":r="20px";break;case"m":r="24px";break;case"l":r="32px"}return`${t} size="${r}" `}(m,y)} />`)),b(j),e((()=>_=s(j,_,{class:`mc-button mc-button--icon-button ${(m?`mc-button--${m}`:"")??""} ${(h?`mc-button--${h}`:"")??""}`,disabled:$,type:x,...O,[i]:{"mc-button--ghost":p,"mc-button--outlined":w}},"svelte-afhc2k"))),n(o,j),d()}customElements.define("m-icon-button",o(f,{},[],[],!1));export{f as default};
|
|
2
2
|
//# sourceMappingURL=IconButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sources":["../../../src/components/button/IconButton.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-icon-button', shadow: 'none' }} />\n\n<script lang=\"ts\">\n import type { ButtonSize, ButtonStyle, ButtonType } from './button.types';\n\n interface Props {\n
|
|
1
|
+
{"version":3,"file":"IconButton.js","sources":["../../../src/components/button/IconButton.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-icon-button', shadow: 'none' }} />\n\n<script lang=\"ts\">\n import type { ButtonSize, ButtonStyle, ButtonType } from './button.types';\n\n interface Props {\n appearance?: ButtonStyle | undefined;\n size?: ButtonSize;\n ghost?: boolean;\n outlined?: boolean;\n iconname: string;\n disabled?: boolean;\n type?: ButtonType;\n [key: string]: any;\n }\n\n let {\n appearance = 'standard',\n size = 'm',\n ghost = false,\n outlined = false,\n iconname,\n disabled = false,\n type = 'button',\n ...events\n }: Props = $props();\n\n function generateIconName(size: ButtonSize, iconName: string): string {\n let iconSize: string;\n\n switch (size) {\n case 's':\n iconSize = '20px';\n break;\n case 'm':\n iconSize = '24px';\n break;\n case 'l':\n iconSize = '32px';\n break;\n }\n\n return `${iconName} size=\"${iconSize}\" `;\n }\n</script>\n\n<button\n class=\"mc-button mc-button--icon-button {size\n ? `mc-button--${size}`\n : ''} {appearance ? `mc-button--${appearance}` : ''}\"\n class:mc-button--ghost={ghost}\n class:mc-button--outlined={outlined}\n {disabled}\n {type}\n {...events}\n>\n {@html `<${generateIconName(size, iconname)} />`}\n</button>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/button';\n</style>\n"],"names":["__rest","this","s","e","_a","$.rest_props","$$props","appearance","size","ghost","outlined","iconname","disabled","type","events","iconName","iconSize","generateIconName"],"mappings":"gzWAEiB,IAAAA,EAAAC,MAAAA,KAAAD,QAAA,SAAAE,EAAAC,+TAcX,IAAAC,EAAAC,EAAAC,EAAA,CAAA,UAAA,WAAA,WAAA,uBACFC,EAAa,WAAUC,KACvBA,EAAO,IAAGC,MACVA,GAAQ,EAAKC,SACbA,GAAW,EAAKC,SAChBA,EAAQC,SACRA,GAAW,EAAKC,KAChBA,EAAO,UAAQT,EACZU,EAAMd,EAAAI,EAAA,CARP,aAAA,OAAA,QAAA,WAAA,WAAA,WAAA,0DAWsBI,EAAkBO,OACtCC,SAEIR,OACD,IACHQ,EAAW,iBAER,IACHA,EAAW,iBAER,IACHA,EAAW,OAIL,MAAA,GAAAD,WAAkBC,KAC9B,CAaWC,CAAiBT,EAAMG,0EATOH,EACvB,cAAAA,IACd,KAAE,OAAGD,EAA2B,cAAAA,IAAe,KAAE,0BAKjDO,0BAJoBL,wBACGC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as e,p as
|
|
1
|
+
import{c as e,p as o,a as r,k as t,L as l,M as n,t as a,d as i,N as c,h as s,i as d,g as v,l as b,O as m,r as h}from"../../custom-element-D6iR2OWc.js";import{i as p}from"../../if-CxjAhvpF.js";import{r as f,a as u,s as g,C as k}from"../../attributes-Dd-ZbJDt.js";import{b as x}from"../../input-D1i5U2EE.js";var _=a('<label class="mc-checkbox__label svelte-1vlbnyp"></label>'),y=a('<div class="mc-checkbox svelte-1vlbnyp"><input> <!></div>');const w={hash:"svelte-1vlbnyp",code:"/**\n * Do not edit directly, this file was auto-generated.\n */\n/* stylelint-disable string-no-newline */.mc-checkbox.svelte-1vlbnyp {align-items:center;display:flex;gap:0.5rem;}.mc-checkbox__label.svelte-1vlbnyp {font-size:1rem;line-height:1.3;color:var(--forms-color-text-default, #000000);cursor:pointer;}.mc-checkbox__input.svelte-1vlbnyp {appearance:none;margin:0;cursor:pointer;transition:box-shadow 200ms ease;background-color:var(--forms-color-background-default, #ffffff);border:0.125rem solid var(--forms-color-border-default, #666666);border-radius:0.25rem;transition:all ease 200ms;height:1.25rem;width:1.25rem;}.mc-checkbox__input.svelte-1vlbnyp:hover {border-color:var(--forms-color-border-hover, #4d4d4d);}.mc-checkbox__input.svelte-1vlbnyp:focus-visible {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));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-checkbox__input.svelte-1vlbnyp:checked {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-inverse, %23ffffff)' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\");}.mc-checkbox__input.svelte-1vlbnyp:indeterminate {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-inverse, %23ffffff)' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\");}.mc-checkbox__input.svelte-1vlbnyp:checked, .mc-checkbox__input.svelte-1vlbnyp:indeterminate {background-color:var(--forms-color-background-checked, #117f03);background-size:1rem 1rem;background-position:center;}.mc-checkbox__input.svelte-1vlbnyp:checked, .mc-checkbox__input.svelte-1vlbnyp:indeterminate, .mc-checkbox__input.svelte-1vlbnyp:disabled {border-color:transparent;}.mc-checkbox__input.svelte-1vlbnyp:disabled {background-color:var(--forms-color-background-disabled, #d9d9d9);cursor:not-allowed;}.mc-checkbox__input.svelte-1vlbnyp:disabled:checked {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='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\");}.mc-checkbox__input.svelte-1vlbnyp:disabled:indeterminate {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='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\");}.mc-checkbox__input.svelte-1vlbnyp:disabled + .mc-checkbox__label:where(.svelte-1vlbnyp) {color:var(--forms-color-text-disabled, #737373);cursor:not-allowed;}.mc-checkbox__input.svelte-1vlbnyp:not(:disabled):checked:hover, .mc-checkbox__input.svelte-1vlbnyp:not(:disabled):indeterminate:hover {background-color:var(--forms-color-background-checked-hover, #006902);}.mc-checkbox__input.is-invalid.svelte-1vlbnyp:not(:checked):not(:indeterminate) {border-color:var(--forms-color-border-invalid, #ea302d);}.mc-checkbox__input.is-invalid.svelte-1vlbnyp:not(:checked):not(:indeterminate):hover {border-color:var(--forms-color-border-invalid-hover, #c61112);}\n\n/* stylelint-enable string-no-newline */\n/* stylelint-disable string-no-newline */\n\n/* stylelint-enable string-no-newline */"};function C(e,a){o(a,!0),r(e,w);var C=this&&this.__rest||function(e,o){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(t=Object.getOwnPropertySymbols(e);l<t.length;l++)o.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(r[t[l]]=e[t[l]])}return r};let E=t(a,["$$slots","$$events","$$legacy","$$host"]),{name:O="checkbox",id:j,indeterminate:$,disabled:z=!1,isinvalid:M=!1,label:B,ischecked:P}=E,H=C(E,["name","id","indeterminate","disabled","isinvalid","label","ischecked"]),S=l(n(P));var D=y(),I=v(D);let L;f(I);var N=b(I,2),q=e=>{var o=_();u(o,"for",O),o.textContent=B,s(e,o)};p(N,(e=>{B&&e(q)})),h(D),i((()=>L=g(I,L,{id:j,type:"checkbox",class:"mc-checkbox__input","aria-invalid":M,name:O,disabled:z,indeterminate:$,...H,[k]:{"is-invalid":M}},"svelte-1vlbnyp"))),x(I,(()=>c(S)),(e=>m(S,e))),s(e,D),d()}customElements.define("m-checkbox",e(C,{},[],[],!0));export{C as default};
|
|
2
2
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/checkbox/Checkbox.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-checkbox',\n }}\n/>\n\n<script lang=\"ts\">\n interface Props {\n name: string;\n id: string;\n checked: boolean;\n indeterminate: boolean;\n disabled?: boolean;\n isinvalid?: boolean;\n label: string;\n ischecked: boolean;\n }\n\n let {\n name = 'checkbox',\n id,\n indeterminate,\n disabled = false,\n isinvalid = false,\n label,\n ischecked,\n }: Props = $props();\n\n let isChecked = $state(ischecked);\n</script>\n\n<div class=\"mc-checkbox\">\n <input\n {id}\n type=\"checkbox\"\n class=\"mc-checkbox__input\"\n class:is-invalid={isinvalid}\n aria-invalid={isinvalid}\n {name}\n {disabled}\n {indeterminate}\n bind:checked={isChecked}\n />\n {#if label}\n <label for={name} class=\"mc-checkbox__label\">{label}</label>\n {/if}\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/checkbox';\n @use '@mozaic-ds/styles/components/field';\n</style>\n"],"names":["
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/checkbox/Checkbox.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-checkbox',\n }}\n/>\n\n<script lang=\"ts\">\n interface Props {\n name: string;\n id: string;\n checked: boolean;\n indeterminate: boolean;\n disabled?: boolean;\n isinvalid?: boolean;\n label: string;\n ischecked: boolean;\n }\n\n let {\n name = 'checkbox',\n id,\n indeterminate,\n disabled = false,\n isinvalid = false,\n label,\n ischecked,\n ...events\n }: Props = $props();\n\n let isChecked = $state(ischecked);\n</script>\n\n<div class=\"mc-checkbox\">\n <input\n {id}\n type=\"checkbox\"\n class=\"mc-checkbox__input\"\n class:is-invalid={isinvalid}\n aria-invalid={isinvalid}\n {name}\n {disabled}\n {indeterminate}\n bind:checked={isChecked}\n {...events}\n />\n {#if label}\n <label for={name} class=\"mc-checkbox__label\">{label}</label>\n {/if}\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/checkbox';\n @use '@mozaic-ds/styles/components/field';\n</style>\n"],"names":["_a","$.rest_props","$$props","name","id","indeterminate","disabled","isinvalid","label","ischecked","events","__rest","isChecked","$$render","consequent","$.bind_checked","input","$.get","$$value"],"mappings":"i9IAkBM,IAAAA,EAAAC,EAAAC,EAAA,CAAA,UAAA,WAAA,WAAA,iBACFC,EAAO,WAAUC,GACjBA,EAAEC,cACFA,EAAaC,SACbA,GAAW,EAAKC,UAChBA,GAAY,EAAKC,MACjBA,EAAKC,UACLA,GAAST,EACNU,EAAMC,EAAAX,EAAA,CARP,OAAA,KAAA,gBAAA,WAAA,YAAA,QAAA,cAWAY,MAAmBH,uEAiBTN,iBAAkCK,mBAD3CA,GAAKK,EAAAC,EAAA,wFAPMP,uCAKVG,oBANcH,wBAKJQ,EAAAC,GAAA,IAAAC,EAAAL,UAAAA,EAASM"}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
isinvalid = false,
|
|
25
25
|
label,
|
|
26
26
|
ischecked,
|
|
27
|
+
...events
|
|
27
28
|
}: Props = $props();
|
|
28
29
|
|
|
29
30
|
let isChecked = $state(ischecked);
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
{disabled}
|
|
41
42
|
{indeterminate}
|
|
42
43
|
bind:checked={isChecked}
|
|
44
|
+
{...events}
|
|
43
45
|
/>
|
|
44
46
|
{#if label}
|
|
45
47
|
<label for={name} class="mc-checkbox__label">{label}</label>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P as e,c as l,p as n,a as o,b as r,L as t,M as i,t as a,d as c,h as s,i as d,j as v,l as m,g as b,r as p,f as h,N as g,s as f,O as u}from"../../custom-element-D6iR2OWc.js";import{i as _}from"../../if-CxjAhvpF.js";import{e as k}from"../../each-BEbHCKXS.js";import{r as x,a as y,b as w}from"../../attributes-Dd-ZbJDt.js";import{a as E}from"../../input-D1i5U2EE.js";function C(e,l,n){l()(g(n))}var z=a('<legend class="mc-field__legend svelte-1vlbnyp"> </legend>'),j=a('<label class="mc-checkbox__label svelte-1vlbnyp"> </label>'),M=a('<div class="mc-checkbox mc-field__item svelte-1vlbnyp"><input type="checkbox"> <!></div>'),B=a('<div class="checkbox-group-container"><fieldset class="mc-field mc-field--group svelte-1vlbnyp"><!> <div class="mc-field__container svelte-1vlbnyp"></div></fieldset></div>');const H={hash:"svelte-1vlbnyp",code:"/**\n * Do not edit directly, this file was auto-generated.\n */\n/* stylelint-disable string-no-newline */.mc-checkbox.svelte-1vlbnyp {align-items:center;display:flex;gap:0.5rem;}.mc-checkbox__label.svelte-1vlbnyp {font-size:1rem;line-height:1.3;color:var(--forms-color-text-default, #000000);cursor:pointer;}.mc-checkbox__input.svelte-1vlbnyp {appearance:none;margin:0;cursor:pointer;transition:box-shadow 200ms ease;background-color:var(--forms-color-background-default, #ffffff);border:0.125rem solid var(--forms-color-border-default, #666666);border-radius:0.25rem;transition:all ease 200ms;height:1.25rem;width:1.25rem;}.mc-checkbox__input.svelte-1vlbnyp:hover {border-color:var(--forms-color-border-hover, #4d4d4d);}.mc-checkbox__input.svelte-1vlbnyp:focus-visible {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));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-checkbox__input.svelte-1vlbnyp:checked {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-inverse, %23ffffff)' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\");}.mc-checkbox__input.svelte-1vlbnyp:indeterminate {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-inverse, %23ffffff)' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\");}.mc-checkbox__input.svelte-1vlbnyp:checked, .mc-checkbox__input.svelte-1vlbnyp:indeterminate {background-color:var(--forms-color-background-checked, #117f03);background-size:1rem 1rem;background-position:center;}.mc-checkbox__input.svelte-1vlbnyp:checked, .mc-checkbox__input.svelte-1vlbnyp:indeterminate, .mc-checkbox__input.svelte-1vlbnyp:disabled {border-color:transparent;}.mc-checkbox__input.svelte-1vlbnyp:disabled {background-color:var(--forms-color-background-disabled, #d9d9d9);cursor:not-allowed;}.mc-checkbox__input.svelte-1vlbnyp:disabled:checked {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='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\");}.mc-checkbox__input.svelte-1vlbnyp:disabled:indeterminate {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='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\");}.mc-checkbox__input.svelte-1vlbnyp:disabled + .mc-checkbox__label:where(.svelte-1vlbnyp) {color:var(--forms-color-text-disabled, #737373);cursor:not-allowed;}.mc-checkbox__input.svelte-1vlbnyp:not(:disabled):checked:hover, .mc-checkbox__input.svelte-1vlbnyp:not(:disabled):indeterminate:hover {background-color:var(--forms-color-background-checked-hover, #006902);}.mc-checkbox__input.is-invalid.svelte-1vlbnyp:not(:checked):not(:indeterminate) {border-color:var(--forms-color-border-invalid, #ea302d);}.mc-checkbox__input.is-invalid.svelte-1vlbnyp:not(:checked):not(:indeterminate):hover {border-color:var(--forms-color-border-invalid-hover, #c61112);}\n\n/* stylelint-enable string-no-newline */\n/* stylelint-disable string-no-newline */ .mc-field__legend.svelte-1vlbnyp {font-size:0.875rem;line-height:1.3;font-weight:400;color:var(--field-color-label, #000000);}.mc-field__legend.svelte-1vlbnyp {padding-left:0;padding-right:0;}.mc-field__legend.svelte-1vlbnyp + .mc-field__container:where(.svelte-1vlbnyp) {margin-top:0.5rem;}.mc-field__item.svelte-1vlbnyp {padding-top:0.375rem;padding-bottom:0.375rem;}.mc-field__item.svelte-1vlbnyp:not(:last-child) {margin-bottom:0.25rem;}.mc-field--group.svelte-1vlbnyp {border:none;margin-left:0;margin-right:0;padding:0;}\n\n/* stylelint-enable string-no-newline */"};function A(e,l){n(l,!0),o(e,H);const a=[];let A=r(l,"id",7),D=r(l,"options",7),L=r(l,"legend",7),N=r(l,"selected",7),O=r(l,"onchange",7),P=t(i(N()));var $=B(),q=b($),F=b(q),G=e=>{var l=z(),n=b(l,!0);p(l),c((()=>h(n,L()))),s(e,l)};_(F,(e=>{L()&&L().length&&e(G)}));var I=m(F,2);return k(I,21,D,(e=>e.id),((e,l)=>{var n,o=M(),r=b(o);x(r),r.__change=[C,O,P];var t=m(r,2),i=e=>{var n=j(),o=b(n,!0);p(n),c((()=>{y(n,"for",g(l).id),h(o,g(l).label)})),s(e,n)};_(t,(e=>{g(l).label&&e(i)})),p(o),c((()=>{f(r,1,`mc-checkbox__input ${(g(l).isinvalid?" is-invalid":"")??""}`,"svelte-1vlbnyp"),y(r,"id",g(l).id),y(r,"name",g(l).name),w(r,g(l).checked),r.disabled=g(l).disabled,r.indeterminate=g(l).indeterminate,y(r,"aria-invalid",g(l).isinvalid),n!==(n=g(l).name)&&(r.value=null==(r.__value=g(l).name)?"":g(l).name)})),E(a,[],r,(()=>(g(l).name,g(P))),(e=>u(P,e))),s(e,o)})),p(I),p(q),p($),c((()=>y($,"id",A()))),s(e,$),d({get id(){return A()},set id(e){A(e),v()},get options(){return D()},set options(e){D(e),v()},get legend(){return L()},set legend(e){L(e),v()},get selected(){return N()},set selected(e){N(e),v()},get onchange(){return O()},set onchange(e){O(e),v()}})}e(["change"]),customElements.define("m-checkbox-group",l(A,{options:{attribute:"options",reflect:!0,type:"Array"},id:{},legend:{},selected:{},onchange:{}},[],[],!1));export{A as default};
|
|
2
2
|
//# sourceMappingURL=checkboxGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkboxGroup.js","sources":["../../../src/components/checkboxgroup/checkboxGroup.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-checkbox-group',\n props: {\n options: { reflect: true, type: 'Array', attribute: 'options' },\n },\n shadow: 'none',\n }}\n/>\n\n<script lang=\"ts\">\n import
|
|
1
|
+
{"version":3,"file":"checkboxGroup.js","sources":["../../../src/components/checkboxgroup/checkboxGroup.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-checkbox-group',\n props: {\n options: { reflect: true, type: 'Array', attribute: 'options' },\n },\n shadow: 'none',\n }}\n/>\n\n<script lang=\"ts\">\n import type { CheckboxGroupOption } from './checkboxgroup.types';\n\n interface Props {\n id: string;\n options: Array<CheckboxGroupOption>;\n legend: string;\n selected: Array<String>;\n }\n\n let { id, options, legend, selected, onchange }: Props = $props();\n let selectedValues = $state(selected);\n function selectValue() {\n onchange(selectedValues);\n }\n</script>\n\n<div class=\"checkbox-group-container\" {id}>\n <fieldset class=\"mc-field mc-field--group\">\n {#if legend && legend.length}\n <legend class=\"mc-field__legend\">\n {legend}\n </legend>\n {/if}\n <div class=\"mc-field__container\">\n {#each options as opt (opt.id)}\n <div class=\"mc-checkbox mc-field__item\">\n <input\n type=\"checkbox\"\n class=\"mc-checkbox__input {opt.isinvalid ? ' is-invalid' : ''}\"\n id={opt.id}\n name={opt.name}\n checked={opt.checked}\n disabled={opt.disabled}\n indeterminate={opt.indeterminate}\n aria-invalid={opt.isinvalid}\n bind:group={selectedValues}\n value={opt.name}\n onchange={selectValue}\n />\n {#if opt.label}\n <label for={opt.id} class=\"mc-checkbox__label\">{opt.label}</label>\n {/if}\n </div>\n {/each}\n </div>\n </fieldset>\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/checkbox';\n @use '@mozaic-ds/styles/components/field';\n</style>\n"],"names":["selectValue","_","onchange","selectedValues","id","$.prop","$$props","options","legend","selected","length","$$render","consequent","$.each","div_1","opt","$.set_attribute","label","$.get","$.set_text","text_1","consequent_1","$.set_class","input","isinvalid","name","$.set_checked","checked","disabled","indeterminate","input_value","value","__value","$$value"],"mappings":"2XAsBWA,EAAWC,EAAAC,EAAAC,GAClBD,MAASC,GACX,gnJAJMC,EAAEC,EAAAC,EAAA,KAAA,GAAEC,EAAOF,EAAAC,EAAA,UAAA,GAAEE,EAAMH,EAAAC,EAAA,SAAA,GAAEG,EAAQJ,EAAAC,EAAA,WAAA,GAAEJ,EAAQG,EAAAC,EAAA,WAAA,GACzCH,MAAwBM,wEAUrBD,wBAFAA,KAAUA,IAAOE,QAAMC,EAAAC,EAAA,wBAMnBC,EAAAC,EAAA,GAAAP,GAAWQ,GAAKA,EAAIX,QAATW,yCAaFf,EAAWE,EAAAC,uDAGTa,EAAAC,EAAA,MAAAC,EAAAH,GAAIX,IAAgCe,EAAAC,EAAAF,EAAAH,GAAIE,MAAK,qBADtDC,EAAAH,GAAIE,OAAKN,EAAAU,EAAA,iBAXeC,EAAAC,EAAA,EAAA,uBAAAL,EAAAH,GAAIS,UAAY,cAAgB,KAAE,KAAA,kBACzDR,EAAAO,EAAA,KAAAL,EAAAH,GAAIX,IACFY,EAAAO,EAAA,OAAAL,EAAAH,GAAIU,MACDC,EAAAH,EAAAL,EAAAH,GAAIY,SACHJ,EAAAK,SAAAV,EAAAH,GAAIa,SACCL,EAAAM,cAAAX,EAAAH,GAAIc,cACLb,EAAAO,EAAA,eAAAL,EAAAH,GAAIS,WAEXM,KAAAA,EAAAZ,EAAAH,GAAIU,QAAJF,EAAAQ,MAAA,OAAAR,EAAAS,QAAAd,EAAAH,GAAIU,MAAJ,GAAAP,EAAAH,GAAIU,wBAAJP,EAAAH,GAAIU,OADCtB,WAAAA,EAAc8B"}
|