monobill-mintui 0.6.675 → 0.6.677
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkbox.css +1 -1
- package/dist/choice.css +1 -1
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/browser.js +63 -24
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +63 -24
- package/dist/components/choice/Choice.d.ts.map +1 -1
- package/dist/components/choice/ChoiceOption.d.ts.map +1 -1
- package/dist/components/choice/browser.js +63 -11
- package/dist/components/choice/index.cjs +1 -1
- package/dist/components/choice/index.js +63 -11
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/browser.js +22 -20
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +22 -20
- package/dist/index.cjs +2 -2
- package/dist/index.css +4 -4
- package/dist/index.js +148 -55
- package/dist/select.css +1 -1
- package/dist/switch.css +1 -1
- package/package.json +1 -1
package/dist/checkbox.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* mint-ui component style: checkbox */
|
|
2
2
|
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
3
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing,.25rem) * 0)}.end{inset-inline-end:var(--spacing,.25rem)}.z-10{z-index:10}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing,.25rem) * 0)}.m-auto{margin:auto}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.h-3\.5{height:calc(var(--spacing,.25rem) * 3.5)}.h-4{height:calc(var(--spacing,.25rem) * 4)}.h-5{height:calc(var(--spacing,.25rem) * 5)}.h-full{height:100%}.w-3\.5{width:calc(var(--spacing,.25rem) * 3.5)}.w-5{width:calc(var(--spacing,.25rem) * 5)}.w-24{width:calc(var(--spacing,.25rem) * 24)}.w-full{width:100%}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse,pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing,.25rem) * .5)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.rounded{border-radius:.25rem}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-gray-300{border-color:var(--color-gray-300,oklch(87.2% .01 258.338))}.border-neutral-800{border-color:var(--color-neutral-800,oklch(26.9% 0 0))}.border-red-300{border-color:var(--color-red-300,oklch(80.8% .114 19.571))}.bg-gray-200{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}.bg-neutral-800{background-color:var(--color-neutral-800,oklch(26.9% 0 0))}.bg-white{background-color:var(--color-white,#fff)}.p-0{padding:calc(var(--spacing,.25rem) * 0)}.align-baseline{vertical-align:baseline}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.text-gray-500{color:var(--color-gray-500,oklch(55.1% .027 264.364))}.text-gray-900{color:var(--color-gray-900,oklch(21% .034 264.665))}.text-red-600{color:var(--color-red-600,oklch(57.7% .245 27.325))}.text-white{color:var(--color-white,#fff)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-gray-400{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}.ease-out{--tw-ease:var(--ease-out,cubic-bezier(0, 0, .2, 1));transition-timing-function:var(--ease-out,cubic-bezier(0, 0, .2, 1))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-gray-400:focus-visible{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.focus-visible\:ring-red-400:focus-visible{--tw-ring-color:var(--color-red-400,oklch(70.4% .191 22.216))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.dark\:border-gray-500:where(.dark,.dark *){border-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:border-neutral-600:where(.dark,.dark *){border-color:var(--color-neutral-600,oklch(43.9% 0 0))}.dark\:border-red-300:where(.dark,.dark *){border-color:var(--color-red-300,oklch(80.8% .114 19.571))}.dark\:bg-mint-elevated:where(.dark,.dark *){background-color:var(--mint-color-surface-raised)}.dark\:bg-mint-hover:where(.dark,.dark *){background-color:var(--mint-color-surface-hover)}.dark\:bg-neutral-600:where(.dark,.dark *){background-color:var(--color-neutral-600,oklch(43.9% 0 0))}.dark\:text-gray-100:where(.dark,.dark *){color:var(--color-gray-100,oklch(96.7% .003 264.542))}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400,oklch(70.7% .022 261.325))}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400,oklch(70.4% .191 22.216))}.dark\:ring-gray-500:where(.dark,.dark *),.dark\:focus-visible\:ring-gray-500:where(.dark,.dark *):focus-visible{--tw-ring-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:focus-visible\:ring-red-500:where(.dark,.dark *):focus-visible{--tw-ring-color:var(--color-red-500,oklch(63.7% .237 25.331))}}mint-checkbox{align-items:flex-start;gap:.65rem;display:inline-flex}.mint-checkbox-wrapper{border:1.5px solid var(--mint-color-border-strong,#b9c5bc);background:var(--mint-color-surface,#fff);cursor:pointer;border-radius:.3rem;flex:none;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;display:inline-flex;position:relative}.mint-checkbox-wrapper:has(input:checked){border-color:var(--mint-color-primary,#315943);background:var(--mint-color-primary,#315943)}.mint-checkbox-wrapper input{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-checkbox-label-container{flex-direction:column;flex:1;gap:.2rem;display:flex}.mint-checkbox-label{cursor:pointer;font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-checkbox-info{color:var(--mint-color-text-secondary,#66736a);font-size:.75rem;line-height:1rem}.mint-input-overlay{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-checkbox-check{width:.875rem;height:.875rem;color:var(--mint-color-on-primary,#fff);pointer-events:none;margin:auto;position:absolute;inset:0}mint-checkbox{align-items:center;min-height:2.5rem}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
3
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing,.25rem) * 0)}.end{inset-inline-end:var(--spacing,.25rem)}.z-10{z-index:10}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing,.25rem) * 0)}.m-auto{margin:auto}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.h-3\.5{height:calc(var(--spacing,.25rem) * 3.5)}.h-4{height:calc(var(--spacing,.25rem) * 4)}.h-5{height:calc(var(--spacing,.25rem) * 5)}.h-full{height:100%}.w-3\.5{width:calc(var(--spacing,.25rem) * 3.5)}.w-5{width:calc(var(--spacing,.25rem) * 5)}.w-24{width:calc(var(--spacing,.25rem) * 24)}.w-full{width:100%}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse,pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing,.25rem) * .5)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.rounded{border-radius:.25rem}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-gray-300{border-color:var(--color-gray-300,oklch(87.2% .01 258.338))}.border-neutral-800{border-color:var(--color-neutral-800,oklch(26.9% 0 0))}.border-red-300{border-color:var(--color-red-300,oklch(80.8% .114 19.571))}.bg-gray-200{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}.bg-neutral-800{background-color:var(--color-neutral-800,oklch(26.9% 0 0))}.bg-white{background-color:var(--color-white,#fff)}.p-0{padding:calc(var(--spacing,.25rem) * 0)}.align-baseline{vertical-align:baseline}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.text-gray-500{color:var(--color-gray-500,oklch(55.1% .027 264.364))}.text-gray-900{color:var(--color-gray-900,oklch(21% .034 264.665))}.text-red-600{color:var(--color-red-600,oklch(57.7% .245 27.325))}.text-white{color:var(--color-white,#fff)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-gray-400{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}.ease-in-out{--tw-ease:var(--ease-in-out,cubic-bezier(.4, 0, .2, 1));transition-timing-function:var(--ease-in-out,cubic-bezier(.4, 0, .2, 1))}.ease-out{--tw-ease:var(--ease-out,cubic-bezier(0, 0, .2, 1));transition-timing-function:var(--ease-out,cubic-bezier(0, 0, .2, 1))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-gray-400:focus-visible{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.focus-visible\:ring-red-400:focus-visible{--tw-ring-color:var(--color-red-400,oklch(70.4% .191 22.216))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.dark\:border-gray-500:where(.dark,.dark *){border-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:border-neutral-600:where(.dark,.dark *){border-color:var(--color-neutral-600,oklch(43.9% 0 0))}.dark\:border-red-300:where(.dark,.dark *){border-color:var(--color-red-300,oklch(80.8% .114 19.571))}.dark\:bg-mint-elevated:where(.dark,.dark *){background-color:var(--mint-color-surface-raised)}.dark\:bg-mint-hover:where(.dark,.dark *){background-color:var(--mint-color-surface-hover)}.dark\:bg-neutral-600:where(.dark,.dark *){background-color:var(--color-neutral-600,oklch(43.9% 0 0))}.dark\:text-gray-100:where(.dark,.dark *){color:var(--color-gray-100,oklch(96.7% .003 264.542))}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400,oklch(70.7% .022 261.325))}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400,oklch(70.4% .191 22.216))}.dark\:ring-gray-500:where(.dark,.dark *),.dark\:focus-visible\:ring-gray-500:where(.dark,.dark *):focus-visible{--tw-ring-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:focus-visible\:ring-red-500:where(.dark,.dark *):focus-visible{--tw-ring-color:var(--color-red-500,oklch(63.7% .237 25.331))}}mint-checkbox{align-items:flex-start;gap:.65rem;display:inline-flex}.mint-checkbox-wrapper{border:1.5px solid var(--mint-color-border-strong,#b9c5bc);background:var(--mint-color-surface,#fff);cursor:pointer;border-radius:.3rem;flex:none;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;display:inline-flex;position:relative}.mint-checkbox-wrapper:has(input:checked){border-color:var(--mint-color-primary,#315943);background:var(--mint-color-primary,#315943)}.mint-checkbox-wrapper input{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-checkbox-label-container{flex-direction:column;flex:1;gap:.2rem;display:flex}.mint-checkbox-label{cursor:pointer;font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-checkbox-info{color:var(--mint-color-text-secondary,#66736a);font-size:.75rem;line-height:1rem}.mint-input-overlay{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-checkbox-check{width:.875rem;height:.875rem;color:var(--mint-color-on-primary,#fff);pointer-events:none;margin:auto;position:absolute;inset:0}mint-checkbox{align-items:center;min-height:2.5rem}@keyframes mint-checkbox-skeleton-pulse{50%{opacity:.45}}@media (prefers-reduced-motion:reduce){.mint-checkbox-loading-skeleton>span{animation:none!important}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
package/dist/choice.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* mint-ui component style: choice */
|
|
2
2
|
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
3
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing,.25rem) * 0)}.end{inset-inline-end:var(--spacing,.25rem)}.z-10{z-index:10}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing,.25rem) * 0)}.mt-0\.5{margin-top:calc(var(--spacing,.25rem) * .5)}.mt-1{margin-top:calc(var(--spacing,.25rem) * 1)}.mb-2{margin-bottom:calc(var(--spacing,.25rem) * 2)}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing,.25rem) * 2)}.h-4{height:calc(var(--spacing,.25rem) * 4)}.h-5{height:calc(var(--spacing,.25rem) * 5)}.h-\[1rem\]{height:1rem}.w-2{width:calc(var(--spacing,.25rem) * 2)}.w-5{width:calc(var(--spacing,.25rem) * 5)}.w-20{width:calc(var(--spacing,.25rem) * 20)}.w-\[1rem\]{width:1rem}.w-full{width:100%}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse,pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing,.25rem) * .5)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.gap-3{gap:calc(var(--spacing,.25rem) * 3)}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-gray-300{border-color:var(--color-gray-300,oklch(87.2% .01 258.338))}.border-slate-800{border-color:var(--color-slate-800,oklch(27.9% .041 260.031))}.bg-gray-200{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}.bg-slate-800{background-color:var(--color-slate-800,oklch(27.9% .041 260.031))}.bg-white{background-color:var(--color-white,#fff)}.p-0{padding:calc(var(--spacing,.25rem) * 0)}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.text-gray-500{color:var(--color-gray-500,oklch(55.1% .027 264.364))}.text-gray-900{color:var(--color-gray-900,oklch(21% .034 264.665))}.text-red-600{color:var(--color-red-600,oklch(57.7% .245 27.325))}.opacity-40{opacity:.4}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-gray-400{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}.ease-out{--tw-ease:var(--ease-out,cubic-bezier(0, 0, .2, 1));transition-timing-function:var(--ease-out,cubic-bezier(0, 0, .2, 1))}.select-none{-webkit-user-select:none;user-select:none}.dark\:border-gray-500:where(.dark,.dark *){border-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:border-slate-600:where(.dark,.dark *){border-color:var(--color-slate-600,oklch(44.6% .043 257.281))}.dark\:bg-mint-elevated:where(.dark,.dark *){background-color:var(--mint-color-surface-raised)}.dark\:bg-mint-hover:where(.dark,.dark *){background-color:var(--mint-color-surface-hover)}.dark\:bg-slate-600:where(.dark,.dark *){background-color:var(--color-slate-600,oklch(44.6% .043 257.281))}.dark\:text-gray-100:where(.dark,.dark *){color:var(--color-gray-100,oklch(96.7% .003 264.542))}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400,oklch(70.7% .022 261.325))}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400,oklch(70.4% .191 22.216))}.dark\:ring-gray-500:where(.dark,.dark *){--tw-ring-color:var(--color-gray-500,oklch(55.1% .027 264.364))}}mint-choice{align-items:flex-start;gap:.65rem;display:inline-flex}.mint-choice-wrapper{border:1.5px solid var(--mint-color-border-strong,#b9c5bc);background:var(--mint-color-surface,#fff);cursor:pointer;border-radius:50%;flex:none;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;display:inline-flex;position:relative}.mint-choice-wrapper:has(input:checked){border-color:var(--mint-color-primary,#315943);background:var(--mint-color-primary,#315943)}.mint-choice-wrapper input{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-choice-label-container{flex-direction:column;flex:1;gap:.2rem;display:flex}.mint-choice-label{cursor:pointer;font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-choice-info{color:var(--mint-color-text-secondary,#66736a);font-size:.75rem;line-height:1rem}.mint-input-overlay{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-choice-indicator{background:var(--mint-color-surface,#fff);pointer-events:none;border-radius:50%;width:.625rem;height:.625rem;margin:auto;position:absolute;inset:0}mint-choice.mint-choice-group{flex-direction:column;align-items:stretch;gap:.5rem;width:100%;display:flex}.mint-choice-group-label{color:var(--mint-color-text,#28372e);font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-choice-options{flex-direction:column;gap:.65rem;display:flex}.mint-choice-option{display:block}.mint-choice-option-control{cursor:pointer;color:var(--mint-color-text,#28372e);align-items:center;gap:.55rem;display:inline-flex}.mint-choice-option-input{width:1.1rem;height:1.1rem;accent-color:var(--mint-color-primary,#315943);margin:0}.mint-choice-option:has(input:disabled) .mint-choice-option-control{cursor:not-allowed;opacity:.55}mint-choice:not(.mint-choice-group){align-items:center;min-height:2.5rem}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
3
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing,.25rem) * 0)}.end{inset-inline-end:var(--spacing,.25rem)}.z-10{z-index:10}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing,.25rem) * 0)}.mt-0\.5{margin-top:calc(var(--spacing,.25rem) * .5)}.mt-1{margin-top:calc(var(--spacing,.25rem) * 1)}.mb-2{margin-bottom:calc(var(--spacing,.25rem) * 2)}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing,.25rem) * 2)}.h-4{height:calc(var(--spacing,.25rem) * 4)}.h-5{height:calc(var(--spacing,.25rem) * 5)}.h-\[1\.1rem\]{height:1.1rem}.h-\[1rem\]{height:1rem}.w-2{width:calc(var(--spacing,.25rem) * 2)}.w-5{width:calc(var(--spacing,.25rem) * 5)}.w-20{width:calc(var(--spacing,.25rem) * 20)}.w-24{width:calc(var(--spacing,.25rem) * 24)}.w-\[1\.1rem\]{width:1.1rem}.w-\[1rem\]{width:1rem}.w-full{width:100%}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse,pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing,.25rem) * .5)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.gap-3{gap:calc(var(--spacing,.25rem) * 3)}.gap-\[\.55rem\]{gap:.55rem}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-gray-300{border-color:var(--color-gray-300,oklch(87.2% .01 258.338))}.border-slate-800{border-color:var(--color-slate-800,oklch(27.9% .041 260.031))}.bg-gray-200{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}.bg-slate-800{background-color:var(--color-slate-800,oklch(27.9% .041 260.031))}.bg-white{background-color:var(--color-white,#fff)}.p-0{padding:calc(var(--spacing,.25rem) * 0)}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.text-gray-500{color:var(--color-gray-500,oklch(55.1% .027 264.364))}.text-gray-900{color:var(--color-gray-900,oklch(21% .034 264.665))}.text-red-600{color:var(--color-red-600,oklch(57.7% .245 27.325))}.opacity-40{opacity:.4}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-gray-400{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}.ease-in-out{--tw-ease:var(--ease-in-out,cubic-bezier(.4, 0, .2, 1));transition-timing-function:var(--ease-in-out,cubic-bezier(.4, 0, .2, 1))}.ease-out{--tw-ease:var(--ease-out,cubic-bezier(0, 0, .2, 1));transition-timing-function:var(--ease-out,cubic-bezier(0, 0, .2, 1))}.select-none{-webkit-user-select:none;user-select:none}.dark\:border-gray-500:where(.dark,.dark *){border-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:border-slate-600:where(.dark,.dark *){border-color:var(--color-slate-600,oklch(44.6% .043 257.281))}.dark\:bg-mint-elevated:where(.dark,.dark *){background-color:var(--mint-color-surface-raised)}.dark\:bg-mint-hover:where(.dark,.dark *){background-color:var(--mint-color-surface-hover)}.dark\:bg-slate-600:where(.dark,.dark *){background-color:var(--color-slate-600,oklch(44.6% .043 257.281))}.dark\:text-gray-100:where(.dark,.dark *){color:var(--color-gray-100,oklch(96.7% .003 264.542))}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400,oklch(70.7% .022 261.325))}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400,oklch(70.4% .191 22.216))}.dark\:ring-gray-500:where(.dark,.dark *){--tw-ring-color:var(--color-gray-500,oklch(55.1% .027 264.364))}}mint-choice{align-items:flex-start;gap:.65rem;display:inline-flex}.mint-choice-wrapper{border:1.5px solid var(--mint-color-border-strong,#b9c5bc);background:var(--mint-color-surface,#fff);cursor:pointer;border-radius:50%;flex:none;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;display:inline-flex;position:relative}.mint-choice-wrapper:has(input:checked){border-color:var(--mint-color-primary,#315943);background:var(--mint-color-primary,#315943)}.mint-choice-wrapper input{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-choice-label-container{flex-direction:column;flex:1;gap:.2rem;display:flex}.mint-choice-label{cursor:pointer;font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-choice-info{color:var(--mint-color-text-secondary,#66736a);font-size:.75rem;line-height:1rem}.mint-input-overlay{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-choice-indicator{background:var(--mint-color-surface,#fff);pointer-events:none;border-radius:50%;width:.625rem;height:.625rem;margin:auto;position:absolute;inset:0}mint-choice.mint-choice-group{flex-direction:column;align-items:stretch;gap:.5rem;width:100%;display:flex}.mint-choice-group-label{color:var(--mint-color-text,#28372e);font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-choice-options{flex-direction:column;gap:.75rem;display:flex}.mint-choice-options:not(:has(mint-choice-option[info])){gap:.55rem}.mint-choice-option{display:block}.mint-choice-option-control{cursor:pointer;color:var(--mint-color-text,#28372e);align-items:flex-start;gap:.55rem;display:inline-flex}.mint-choice-option-input{width:1.1rem;height:1.1rem;accent-color:var(--mint-color-primary,#315943);margin:0}.mint-choice-option:has(input:disabled) .mint-choice-option-control{cursor:not-allowed;opacity:.55}mint-choice:not(.mint-choice-group){align-items:flex-start;min-height:2.5rem}mint-choice:not(.mint-choice-group):not([info]){min-height:1.5rem}@keyframes mint-choice-skeleton-pulse{50%{opacity:.45}}@media (prefers-reduced-motion:reduce){.mint-choice-loading-skeleton span{animation:none!important}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/Checkbox.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAA;AACtB,OAAO,qBAAqB,CAAA;AAM5B,cAAM,YAAa,SAAQ,WAAW;IACpC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,iBAAiB,CAAoC;IAC7D,OAAO,CAAC,eAAe,CAAoC;IAC3D,OAAO,CAAC,kBAAkB,CAAoC;IAC9D,OAAO,CAAC,kBAAkB,CAAoC;IAC9D,OAAO,CAAC,gBAAgB,CAAoC;IAC5D,OAAO,CAAC,aAAa,CAAyC;IAC9D,OAAO,CAAC,YAAY,CAAyC;;IAO7D,iBAAiB,IAAI,IAAI;IAQzB,oBAAoB,IAAI,IAAI;IAI5B,SAAS,IAAI,OAAO;IAKpB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IA4B9F,IAAI,OAAO,IAAI,OAAO,CAMrB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAgBzB;IAED,UAAU,IAAI,OAAO;IAKrB,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,KAAK,IAAI,MAAM;IAIf,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,MAAM;IAIlB,QAAQ,IAAI,OAAO;IAKnB,eAAe,IAAI,MAAM;IAIzB,kBAAkB,IAAI,MAAM;IAyC5B,MAAM,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/Checkbox.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAA;AACtB,OAAO,qBAAqB,CAAA;AAM5B,cAAM,YAAa,SAAQ,WAAW;IACpC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,iBAAiB,CAAoC;IAC7D,OAAO,CAAC,eAAe,CAAoC;IAC3D,OAAO,CAAC,kBAAkB,CAAoC;IAC9D,OAAO,CAAC,kBAAkB,CAAoC;IAC9D,OAAO,CAAC,gBAAgB,CAAoC;IAC5D,OAAO,CAAC,aAAa,CAAyC;IAC9D,OAAO,CAAC,YAAY,CAAyC;;IAO7D,iBAAiB,IAAI,IAAI;IAQzB,oBAAoB,IAAI,IAAI;IAI5B,SAAS,IAAI,OAAO;IAKpB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IA4B9F,IAAI,OAAO,IAAI,OAAO,CAMrB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAgBzB;IAED,UAAU,IAAI,OAAO;IAKrB,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,KAAK,IAAI,MAAM;IAIf,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,MAAM;IAIlB,QAAQ,IAAI,OAAO;IAKnB,eAAe,IAAI,MAAM;IAIzB,kBAAkB,IAAI,MAAM;IAyC5B,MAAM,IAAI,IAAI;IAkNd,mBAAmB,IAAI,IAAI;IAmJ3B,oBAAoB,IAAI,IAAI;IA+C5B,iBAAiB,IAAI,IAAI;IAmBzB,MAAM,IAAI,IAAI;IAgCd,OAAO,CAAC,eAAe;IAuEvB,OAAO,CAAC,iBAAiB;IAmDzB,OAAO,CAAC,0BAA0B;CAmBnC;AAOD,eAAe,YAAY,CAAA"}
|
|
@@ -35,7 +35,8 @@ var n = class extends HTMLElement {
|
|
|
35
35
|
"info",
|
|
36
36
|
"id",
|
|
37
37
|
"name",
|
|
38
|
-
"value"
|
|
38
|
+
"value",
|
|
39
|
+
"loading"
|
|
39
40
|
];
|
|
40
41
|
}
|
|
41
42
|
constructor() {
|
|
@@ -58,7 +59,7 @@ var n = class extends HTMLElement {
|
|
|
58
59
|
e ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this._checked = !!e, this._checkbox && (this._checkbox.checked = this._checked), this.updateVisualState();
|
|
59
60
|
}
|
|
60
61
|
isDisabled() {
|
|
61
|
-
return this.hasAttribute("disabled");
|
|
62
|
+
return this.hasAttribute("disabled") || this.getAttribute("loading") === "true";
|
|
62
63
|
}
|
|
63
64
|
getLabel() {
|
|
64
65
|
return this.getAttribute("label") || "";
|
|
@@ -79,31 +80,69 @@ var n = class extends HTMLElement {
|
|
|
79
80
|
return "mint-checkbox-control";
|
|
80
81
|
}
|
|
81
82
|
render() {
|
|
82
|
-
let e = this.
|
|
83
|
-
|
|
84
|
-
let i = this.
|
|
85
|
-
i ? this._checkbox.
|
|
86
|
-
let a = this.
|
|
87
|
-
a ? this._checkbox.
|
|
88
|
-
let o = this.
|
|
89
|
-
o ? this._checkbox.
|
|
90
|
-
let s =
|
|
91
|
-
s
|
|
92
|
-
let c =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
let
|
|
98
|
-
|
|
83
|
+
let e = this.getAttribute("loading") === "true";
|
|
84
|
+
this.toggleAttribute("aria-busy", e);
|
|
85
|
+
let t = this.getLabel(), n = this.getInfo(), r = this.isDisabled(), i = this.querySelector(".mint-checkbox-wrapper");
|
|
86
|
+
i || (i = document.createElement("div"), i.className = "mint-checkbox-wrapper", this.insertBefore(i, this.firstChild)), this._checkbox ? this._checkbox.parentElement !== i && i.appendChild(this._checkbox) : (this._checkbox = document.createElement("input"), this._checkbox.type = "checkbox", i.appendChild(this._checkbox), this.setupEventListeners()), this._checkbox.className = "mint-input-overlay", this._checkbox.style.cssText = "position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;", this._checkbox.checked = this._checked, this._checkbox.disabled = r, this._changeHandler || this.setupEventListeners();
|
|
87
|
+
let a = this.getId();
|
|
88
|
+
a ? this._checkbox.id = a : this._checkbox.removeAttribute("id");
|
|
89
|
+
let o = this.getName();
|
|
90
|
+
o ? this._checkbox.name = o : this._checkbox.removeAttribute("name");
|
|
91
|
+
let s = this.getValue();
|
|
92
|
+
s ? this._checkbox.value = s : this._checkbox.removeAttribute("value"), t ? this._checkbox.setAttribute("aria-label", t) : this._checkbox.removeAttribute("aria-label"), i.className = `mint-checkbox-wrapper ${this.getCheckboxClasses()}`, i.style.pointerEvents = "none", this._checkbox.style.pointerEvents = "auto";
|
|
93
|
+
let c = i.querySelector("mint-icon");
|
|
94
|
+
c || (c = document.createElement("mint-icon"), c.setAttribute("name", "check"), c.className = "mint-checkbox-check", c.style.transition = "opacity 200ms ease-out, transform 200ms ease-out", c.style.zIndex = "1", i.appendChild(c)), this.updateVisualState();
|
|
95
|
+
let l = this.querySelector(".mint-checkbox-label-container");
|
|
96
|
+
if (t || n) {
|
|
97
|
+
l || (l = document.createElement("div"), l.className = "mint-checkbox-label-container", this.appendChild(l));
|
|
98
|
+
let e = l.querySelector(".mint-checkbox-label");
|
|
99
|
+
t ? (e || (e = document.createElement("span"), e.className = "mint-checkbox-label", l.insertBefore(e, l.firstChild)), e.textContent = t, r ? e.style.opacity = "0.5" : e.style.opacity = "") : e && e.remove();
|
|
100
|
+
let i = l.querySelector(".mint-checkbox-info");
|
|
101
|
+
if (n ? (i || (i = document.createElement("span"), i.className = "mint-checkbox-info", l.appendChild(i)), i.textContent = n, r ? i.style.opacity = "0.5" : i.style.opacity = "") : i && i.remove(), r) l.style.cursor = "default", l._clickHandler && (l.removeEventListener("click", l._clickHandler), l._clickHandler = null);
|
|
99
102
|
else {
|
|
100
|
-
|
|
101
|
-
let e =
|
|
102
|
-
e &&
|
|
103
|
+
l.style.cursor = "pointer";
|
|
104
|
+
let e = l._clickHandler;
|
|
105
|
+
e && l.removeEventListener("click", e), l._clickHandler = (e) => {
|
|
103
106
|
this._checkbox && (e.target === this._checkbox || this._checkbox.contains(e.target) || e.composedPath().includes(this._checkbox)) || this.toggle();
|
|
104
|
-
},
|
|
107
|
+
}, l.addEventListener("click", l._clickHandler);
|
|
105
108
|
}
|
|
106
|
-
} else
|
|
109
|
+
} else l && l.remove();
|
|
110
|
+
let u = this.querySelector(":scope > .mint-checkbox-loading-skeleton");
|
|
111
|
+
if (e) {
|
|
112
|
+
if (!u) {
|
|
113
|
+
u = document.createElement("div"), u.className = "mint-checkbox-loading-skeleton", u.setAttribute("aria-hidden", "true"), Object.assign(u.style, {
|
|
114
|
+
position: "absolute",
|
|
115
|
+
inset: "0",
|
|
116
|
+
display: "flex",
|
|
117
|
+
alignItems: "center",
|
|
118
|
+
gap: "0.5rem",
|
|
119
|
+
pointerEvents: "none",
|
|
120
|
+
zIndex: "20"
|
|
121
|
+
});
|
|
122
|
+
let e = document.createElement("span");
|
|
123
|
+
if (Object.assign(e.style, {
|
|
124
|
+
display: "block",
|
|
125
|
+
width: "1.25rem",
|
|
126
|
+
height: "1.25rem",
|
|
127
|
+
flex: "none",
|
|
128
|
+
borderRadius: "0.25rem",
|
|
129
|
+
background: "var(--mint-color-surface-control, #e8eee9)",
|
|
130
|
+
animation: "mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite"
|
|
131
|
+
}), u.appendChild(e), t) {
|
|
132
|
+
let e = document.createElement("span");
|
|
133
|
+
Object.assign(e.style, {
|
|
134
|
+
display: "block",
|
|
135
|
+
width: "6rem",
|
|
136
|
+
height: "1rem",
|
|
137
|
+
borderRadius: "0.35rem",
|
|
138
|
+
background: "var(--mint-color-surface-control, #e8eee9)",
|
|
139
|
+
animation: "mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite"
|
|
140
|
+
}), u.appendChild(e);
|
|
141
|
+
}
|
|
142
|
+
this.appendChild(u);
|
|
143
|
+
}
|
|
144
|
+
this.style.position = "relative", u.style.display = "flex", i.style.visibility = "hidden", l && (l.style.visibility = "hidden");
|
|
145
|
+
} else u && (u.style.display = "none"), i.style.visibility = "", l && (l.style.visibility = "");
|
|
107
146
|
}
|
|
108
147
|
setupEventListeners() {
|
|
109
148
|
this.removeEventListeners(), this._checkbox && (this._changeHandler = (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunks/icon-CGXHKbMq.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-Cfhjb8tV.js`),e.a({name:`check`,viewBox:`0 0 24 24`,path:`M5 13l4 4L19 7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var n=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`]}constructor(){super(),this._checkbox=null,this._checked=!1,this._clickHandler=null}connectedCallback(){let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._checkbox&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._checkbox&&(this._checkbox.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this.getAttribute(`value`)||``}getCheckboxClasses(){return`mint-checkbox-control`}render(){let e=this.getLabel(),
|
|
1
|
+
const e=require(`../chunks/icon-CGXHKbMq.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-Cfhjb8tV.js`),e.a({name:`check`,viewBox:`0 0 24 24`,path:`M5 13l4 4L19 7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var n=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`,`loading`]}constructor(){super(),this._checkbox=null,this._checked=!1,this._clickHandler=null}connectedCallback(){let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._checkbox&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._checkbox&&(this._checkbox.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)||this.getAttribute(`loading`)===`true`}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this.getAttribute(`value`)||``}getCheckboxClasses(){return`mint-checkbox-control`}render(){let e=this.getAttribute(`loading`)===`true`;this.toggleAttribute(`aria-busy`,e);let t=this.getLabel(),n=this.getInfo(),r=this.isDisabled(),i=this.querySelector(`.mint-checkbox-wrapper`);i||(i=document.createElement(`div`),i.className=`mint-checkbox-wrapper`,this.insertBefore(i,this.firstChild)),this._checkbox?this._checkbox.parentElement!==i&&i.appendChild(this._checkbox):(this._checkbox=document.createElement(`input`),this._checkbox.type=`checkbox`,i.appendChild(this._checkbox),this.setupEventListeners()),this._checkbox.className=`mint-input-overlay`,this._checkbox.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._checkbox.checked=this._checked,this._checkbox.disabled=r,this._changeHandler||this.setupEventListeners();let a=this.getId();a?this._checkbox.id=a:this._checkbox.removeAttribute(`id`);let o=this.getName();o?this._checkbox.name=o:this._checkbox.removeAttribute(`name`);let s=this.getValue();s?this._checkbox.value=s:this._checkbox.removeAttribute(`value`),t?this._checkbox.setAttribute(`aria-label`,t):this._checkbox.removeAttribute(`aria-label`),i.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,i.style.pointerEvents=`none`,this._checkbox.style.pointerEvents=`auto`;let c=i.querySelector(`mint-icon`);c||(c=document.createElement(`mint-icon`),c.setAttribute(`name`,`check`),c.className=`mint-checkbox-check`,c.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,c.style.zIndex=`1`,i.appendChild(c)),this.updateVisualState();let l=this.querySelector(`.mint-checkbox-label-container`);if(t||n){l||(l=document.createElement(`div`),l.className=`mint-checkbox-label-container`,this.appendChild(l));let e=l.querySelector(`.mint-checkbox-label`);t?(e||(e=document.createElement(`span`),e.className=`mint-checkbox-label`,l.insertBefore(e,l.firstChild)),e.textContent=t,r?e.style.opacity=`0.5`:e.style.opacity=``):e&&e.remove();let i=l.querySelector(`.mint-checkbox-info`);if(n?(i||(i=document.createElement(`span`),i.className=`mint-checkbox-info`,l.appendChild(i)),i.textContent=n,r?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),r)l.style.cursor=`default`,l._clickHandler&&(l.removeEventListener(`click`,l._clickHandler),l._clickHandler=null);else{l.style.cursor=`pointer`;let e=l._clickHandler;e&&l.removeEventListener(`click`,e),l._clickHandler=e=>{this._checkbox&&(e.target===this._checkbox||this._checkbox.contains(e.target)||e.composedPath().includes(this._checkbox))||this.toggle()},l.addEventListener(`click`,l._clickHandler)}}else l&&l.remove();let u=this.querySelector(`:scope > .mint-checkbox-loading-skeleton`);if(e){if(!u){u=document.createElement(`div`),u.className=`mint-checkbox-loading-skeleton`,u.setAttribute(`aria-hidden`,`true`),Object.assign(u.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,gap:`0.5rem`,pointerEvents:`none`,zIndex:`20`});let e=document.createElement(`span`);if(Object.assign(e.style,{display:`block`,width:`1.25rem`,height:`1.25rem`,flex:`none`,borderRadius:`0.25rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite`}),u.appendChild(e),t){let e=document.createElement(`span`);Object.assign(e.style,{display:`block`,width:`6rem`,height:`1rem`,borderRadius:`0.35rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite`}),u.appendChild(e)}this.appendChild(u)}this.style.position=`relative`,u.style.display=`flex`,i.style.visibility=`hidden`,l&&(l.style.visibility=`hidden`)}else u&&(u.style.display=`none`),i.style.visibility=``,l&&(l.style.visibility=``)}setupEventListeners(){this.removeEventListeners(),this._checkbox&&(this._changeHandler=e=>{e.stopPropagation(),this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)},this._checkbox.addEventListener(`change`,this._changeHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`mousedown`,this._mousedownHandler),this._checkbox.addEventListener(`mouseup`,this._mouseupHandler),this._checkbox.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`touchstart`,this._touchstartHandler),this._checkbox.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._checkbox&&(this._changeHandler&&=(this._checkbox.removeEventListener(`change`,this._changeHandler),null),this._mousedownHandler&&=(this._checkbox.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._checkbox.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._checkbox.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._checkbox.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._checkbox.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-checkbox-wrapper`),t=e?.querySelector(`mint-icon`);t&&(t.style.opacity=this._checked?`1`:`0`,t.style.transform=this._checked?`scale(1)`:`scale(0.8)`),e&&(e.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,e.classList.contains(`mint-checkbox-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}toggle(){if(this._checkbox&&!this.isDisabled()){this._checkbox.checked=!this._checked,this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let e=new CustomEvent(`change`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}}};typeof customElements<`u`&&!customElements.get(`mint-checkbox`)&&t.t(`mint-checkbox`,n),module.exports=n;
|
|
@@ -23,7 +23,8 @@ var n = class extends HTMLElement {
|
|
|
23
23
|
"info",
|
|
24
24
|
"id",
|
|
25
25
|
"name",
|
|
26
|
-
"value"
|
|
26
|
+
"value",
|
|
27
|
+
"loading"
|
|
27
28
|
];
|
|
28
29
|
}
|
|
29
30
|
constructor() {
|
|
@@ -46,7 +47,7 @@ var n = class extends HTMLElement {
|
|
|
46
47
|
e ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this._checked = !!e, this._checkbox && (this._checkbox.checked = this._checked), this.updateVisualState();
|
|
47
48
|
}
|
|
48
49
|
isDisabled() {
|
|
49
|
-
return this.hasAttribute("disabled");
|
|
50
|
+
return this.hasAttribute("disabled") || this.getAttribute("loading") === "true";
|
|
50
51
|
}
|
|
51
52
|
getLabel() {
|
|
52
53
|
return this.getAttribute("label") || "";
|
|
@@ -67,31 +68,69 @@ var n = class extends HTMLElement {
|
|
|
67
68
|
return "mint-checkbox-control";
|
|
68
69
|
}
|
|
69
70
|
render() {
|
|
70
|
-
let e = this.
|
|
71
|
-
|
|
72
|
-
let i = this.
|
|
73
|
-
i ? this._checkbox.
|
|
74
|
-
let a = this.
|
|
75
|
-
a ? this._checkbox.
|
|
76
|
-
let o = this.
|
|
77
|
-
o ? this._checkbox.
|
|
78
|
-
let s =
|
|
79
|
-
s
|
|
80
|
-
let c =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
let
|
|
86
|
-
|
|
71
|
+
let e = this.getAttribute("loading") === "true";
|
|
72
|
+
this.toggleAttribute("aria-busy", e);
|
|
73
|
+
let t = this.getLabel(), n = this.getInfo(), r = this.isDisabled(), i = this.querySelector(".mint-checkbox-wrapper");
|
|
74
|
+
i || (i = document.createElement("div"), i.className = "mint-checkbox-wrapper", this.insertBefore(i, this.firstChild)), this._checkbox ? this._checkbox.parentElement !== i && i.appendChild(this._checkbox) : (this._checkbox = document.createElement("input"), this._checkbox.type = "checkbox", i.appendChild(this._checkbox), this.setupEventListeners()), this._checkbox.className = "mint-input-overlay", this._checkbox.style.cssText = "position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;", this._checkbox.checked = this._checked, this._checkbox.disabled = r, this._changeHandler || this.setupEventListeners();
|
|
75
|
+
let a = this.getId();
|
|
76
|
+
a ? this._checkbox.id = a : this._checkbox.removeAttribute("id");
|
|
77
|
+
let o = this.getName();
|
|
78
|
+
o ? this._checkbox.name = o : this._checkbox.removeAttribute("name");
|
|
79
|
+
let s = this.getValue();
|
|
80
|
+
s ? this._checkbox.value = s : this._checkbox.removeAttribute("value"), t ? this._checkbox.setAttribute("aria-label", t) : this._checkbox.removeAttribute("aria-label"), i.className = `mint-checkbox-wrapper ${this.getCheckboxClasses()}`, i.style.pointerEvents = "none", this._checkbox.style.pointerEvents = "auto";
|
|
81
|
+
let c = i.querySelector("mint-icon");
|
|
82
|
+
c || (c = document.createElement("mint-icon"), c.setAttribute("name", "check"), c.className = "mint-checkbox-check", c.style.transition = "opacity 200ms ease-out, transform 200ms ease-out", c.style.zIndex = "1", i.appendChild(c)), this.updateVisualState();
|
|
83
|
+
let l = this.querySelector(".mint-checkbox-label-container");
|
|
84
|
+
if (t || n) {
|
|
85
|
+
l || (l = document.createElement("div"), l.className = "mint-checkbox-label-container", this.appendChild(l));
|
|
86
|
+
let e = l.querySelector(".mint-checkbox-label");
|
|
87
|
+
t ? (e || (e = document.createElement("span"), e.className = "mint-checkbox-label", l.insertBefore(e, l.firstChild)), e.textContent = t, r ? e.style.opacity = "0.5" : e.style.opacity = "") : e && e.remove();
|
|
88
|
+
let i = l.querySelector(".mint-checkbox-info");
|
|
89
|
+
if (n ? (i || (i = document.createElement("span"), i.className = "mint-checkbox-info", l.appendChild(i)), i.textContent = n, r ? i.style.opacity = "0.5" : i.style.opacity = "") : i && i.remove(), r) l.style.cursor = "default", l._clickHandler && (l.removeEventListener("click", l._clickHandler), l._clickHandler = null);
|
|
87
90
|
else {
|
|
88
|
-
|
|
89
|
-
let e =
|
|
90
|
-
e &&
|
|
91
|
+
l.style.cursor = "pointer";
|
|
92
|
+
let e = l._clickHandler;
|
|
93
|
+
e && l.removeEventListener("click", e), l._clickHandler = (e) => {
|
|
91
94
|
this._checkbox && (e.target === this._checkbox || this._checkbox.contains(e.target) || e.composedPath().includes(this._checkbox)) || this.toggle();
|
|
92
|
-
},
|
|
95
|
+
}, l.addEventListener("click", l._clickHandler);
|
|
93
96
|
}
|
|
94
|
-
} else
|
|
97
|
+
} else l && l.remove();
|
|
98
|
+
let u = this.querySelector(":scope > .mint-checkbox-loading-skeleton");
|
|
99
|
+
if (e) {
|
|
100
|
+
if (!u) {
|
|
101
|
+
u = document.createElement("div"), u.className = "mint-checkbox-loading-skeleton", u.setAttribute("aria-hidden", "true"), Object.assign(u.style, {
|
|
102
|
+
position: "absolute",
|
|
103
|
+
inset: "0",
|
|
104
|
+
display: "flex",
|
|
105
|
+
alignItems: "center",
|
|
106
|
+
gap: "0.5rem",
|
|
107
|
+
pointerEvents: "none",
|
|
108
|
+
zIndex: "20"
|
|
109
|
+
});
|
|
110
|
+
let e = document.createElement("span");
|
|
111
|
+
if (Object.assign(e.style, {
|
|
112
|
+
display: "block",
|
|
113
|
+
width: "1.25rem",
|
|
114
|
+
height: "1.25rem",
|
|
115
|
+
flex: "none",
|
|
116
|
+
borderRadius: "0.25rem",
|
|
117
|
+
background: "var(--mint-color-surface-control, #e8eee9)",
|
|
118
|
+
animation: "mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite"
|
|
119
|
+
}), u.appendChild(e), t) {
|
|
120
|
+
let e = document.createElement("span");
|
|
121
|
+
Object.assign(e.style, {
|
|
122
|
+
display: "block",
|
|
123
|
+
width: "6rem",
|
|
124
|
+
height: "1rem",
|
|
125
|
+
borderRadius: "0.35rem",
|
|
126
|
+
background: "var(--mint-color-surface-control, #e8eee9)",
|
|
127
|
+
animation: "mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite"
|
|
128
|
+
}), u.appendChild(e);
|
|
129
|
+
}
|
|
130
|
+
this.appendChild(u);
|
|
131
|
+
}
|
|
132
|
+
this.style.position = "relative", u.style.display = "flex", i.style.visibility = "hidden", l && (l.style.visibility = "hidden");
|
|
133
|
+
} else u && (u.style.display = "none"), i.style.visibility = "", l && (l.style.visibility = "");
|
|
95
134
|
}
|
|
96
135
|
setupEventListeners() {
|
|
97
136
|
this.removeEventListeners(), this._checkbox && (this._changeHandler = (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Choice.d.ts","sourceRoot":"","sources":["../../../src/components/choice/Choice.ts"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,CAAA;AAEvB,cAAM,UAAW,SAAQ,WAAW;IAClC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,iBAAiB,CAA2B;;IAMpD,iBAAiB,IAAI,IAAI;IA6CzB,oBAAoB,IAAI,IAAI;IAI5B,SAAS,IAAI,OAAO;IAIpB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IA+B9F,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,OAAO;IAKnB,eAAe,IAAI,MAAM;IAIzB,KAAK,IAAI,MAAM;IAIf,UAAU,IAAI,OAAO;IAKrB,UAAU,IAAI,OAAO;IAKrB,QAAQ,IAAI,MAAM;IAKlB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IA4C7B,IAAI,KAAK,IAAI,MAAM,CAMlB;IAED,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,EAMzB;IAED,MAAM,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"Choice.d.ts","sourceRoot":"","sources":["../../../src/components/choice/Choice.ts"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,CAAA;AAEvB,cAAM,UAAW,SAAQ,WAAW;IAClC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,iBAAiB,CAA2B;;IAMpD,iBAAiB,IAAI,IAAI;IA6CzB,oBAAoB,IAAI,IAAI;IAI5B,SAAS,IAAI,OAAO;IAIpB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IA+B9F,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,OAAO;IAKnB,eAAe,IAAI,MAAM;IAIzB,KAAK,IAAI,MAAM;IAIf,UAAU,IAAI,OAAO;IAKrB,UAAU,IAAI,OAAO;IAKrB,QAAQ,IAAI,MAAM;IAKlB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IA4C7B,IAAI,KAAK,IAAI,MAAM,CAMlB;IAED,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,EAMzB;IAED,MAAM,IAAI,IAAI;IAoGd,OAAO,CAAC,eAAe;IAwEvB,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,uBAAuB;CA6BhC;AAOD,eAAe,UAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceOption.d.ts","sourceRoot":"","sources":["../../../src/components/choice/ChoiceOption.ts"],"names":[],"mappings":"AAGA,cAAM,gBAAiB,SAAQ,WAAW;IACxC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,MAAM,CAAgC;IAC9C,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,aAAa,CAAyC;IAC9D,OAAO,CAAC,aAAa,CAAyC;IAC9D,OAAO,CAAC,YAAY,CAAyC;IAC7D,OAAO,CAAC,eAAe,CAA4C;;IAMnE,iBAAiB,IAAI,IAAI;IAUzB,oBAAoB,IAAI,IAAI;IAyB5B,SAAS,IAAI,OAAO;IAKpB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAuB9F,IAAI,OAAO,IAAI,OAAO,CAMrB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAsBzB;IAED,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,UAAU,IAAI,OAAO;
|
|
1
|
+
{"version":3,"file":"ChoiceOption.d.ts","sourceRoot":"","sources":["../../../src/components/choice/ChoiceOption.ts"],"names":[],"mappings":"AAGA,cAAM,gBAAiB,SAAQ,WAAW;IACxC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,MAAM,CAAgC;IAC9C,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,aAAa,CAAyC;IAC9D,OAAO,CAAC,aAAa,CAAyC;IAC9D,OAAO,CAAC,YAAY,CAAyC;IAC7D,OAAO,CAAC,eAAe,CAA4C;;IAMnE,iBAAiB,IAAI,IAAI;IAUzB,oBAAoB,IAAI,IAAI;IAyB5B,SAAS,IAAI,OAAO;IAKpB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAuB9F,IAAI,OAAO,IAAI,OAAO,CAMrB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAsBzB;IAED,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,UAAU,IAAI,OAAO;IAUrB,OAAO,CAAC,kBAAkB;IA4C1B,MAAM,IAAI,IAAI;IAqVd,OAAO,CAAC,kBAAkB;IAsC1B,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,eAAe;IA6EvB,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,gBAAgB;IA2DxB,OAAO,CAAC,oBAAoB;CA0D7B;AAOD,eAAe,gBAAgB,CAAA"}
|
|
@@ -24,7 +24,8 @@ var t = class extends HTMLElement {
|
|
|
24
24
|
"id",
|
|
25
25
|
"name",
|
|
26
26
|
"value",
|
|
27
|
-
"required"
|
|
27
|
+
"required",
|
|
28
|
+
"loading"
|
|
28
29
|
];
|
|
29
30
|
}
|
|
30
31
|
constructor() {
|
|
@@ -55,7 +56,7 @@ var t = class extends HTMLElement {
|
|
|
55
56
|
e ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this._checked = !!e, this._radio && (this._radio.checked = this._checked), this.updateVisualState();
|
|
56
57
|
}
|
|
57
58
|
isDisabled() {
|
|
58
|
-
return this.hasAttribute("disabled");
|
|
59
|
+
return this.hasAttribute("disabled") || this.getAttribute("loading") === "true";
|
|
59
60
|
}
|
|
60
61
|
getLabel() {
|
|
61
62
|
return this.getAttribute("label") || "";
|
|
@@ -90,13 +91,63 @@ var t = class extends HTMLElement {
|
|
|
90
91
|
}), t ? this.setAttribute("value", t) : this.removeAttribute("value");
|
|
91
92
|
}
|
|
92
93
|
renderGroup() {
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
let e = this.getAttribute("loading") === "true";
|
|
95
|
+
this.toggleAttribute("aria-busy", e), this.classList.add("mint-choice-group"), this.setAttribute("role", "radiogroup");
|
|
96
|
+
let t = this.getAttribute("label") || "", n = this.querySelector(":scope > .mint-choice-group-label");
|
|
97
|
+
t && !n && (n = document.createElement("div"), n.className = "mint-choice-group-label", this.insertBefore(n, this.firstChild)), n && (t ? n.textContent = t : n.remove());
|
|
98
|
+
let r = this.querySelector(":scope > .mint-choice-options");
|
|
99
|
+
r || (r = document.createElement("div"), r.className = "mint-choice-options", n?.parentElement === this ? this.insertBefore(r, n.nextSibling) : this.insertBefore(r, this.firstChild)), Array.from(this.children).filter((e) => e.tagName === "MINT-CHOICE-OPTION" && e.parentElement !== r).forEach((e) => r.appendChild(e)), this.querySelectorAll("mint-choice-option").forEach((t) => {
|
|
100
|
+
t.toggleAttribute("loading", e), t.render();
|
|
101
|
+
});
|
|
102
|
+
let i = this.getAttribute("value");
|
|
103
|
+
i && this.setValue(i);
|
|
104
|
+
let a = r.querySelector(":scope > .mint-choice-loading-skeleton");
|
|
105
|
+
if (e) {
|
|
106
|
+
r.style.position = "relative", a || (a = document.createElement("div"), a.className = "mint-choice-loading-skeleton", a.setAttribute("aria-hidden", "true"), Object.assign(a.style, {
|
|
107
|
+
position: "absolute",
|
|
108
|
+
inset: "0",
|
|
109
|
+
display: "flex",
|
|
110
|
+
flexDirection: "column",
|
|
111
|
+
pointerEvents: "none",
|
|
112
|
+
zIndex: "20"
|
|
113
|
+
}), r.appendChild(a)), a.style.gap = r.querySelector(":scope > mint-choice-option[info]") ? "0.75rem" : "0.55rem";
|
|
114
|
+
let e = r.querySelectorAll(":scope > mint-choice-option").length, t = Array.from(a.children);
|
|
115
|
+
for (; t.length > e;) t.pop()?.remove();
|
|
116
|
+
for (; t.length < e;) {
|
|
117
|
+
let e = t.length, n = document.createElement("div");
|
|
118
|
+
Object.assign(n.style, {
|
|
119
|
+
display: "flex",
|
|
120
|
+
alignItems: "center",
|
|
121
|
+
gap: "0.55rem",
|
|
122
|
+
minHeight: "1.25rem",
|
|
123
|
+
flex: "none"
|
|
124
|
+
});
|
|
125
|
+
let r = document.createElement("span");
|
|
126
|
+
Object.assign(r.style, {
|
|
127
|
+
display: "block",
|
|
128
|
+
width: "1.1rem",
|
|
129
|
+
height: "1.1rem",
|
|
130
|
+
flex: "none",
|
|
131
|
+
borderRadius: "50%",
|
|
132
|
+
background: "var(--mint-color-surface-control, #e8eee9)",
|
|
133
|
+
animation: "mint-choice-skeleton-pulse 1.4s ease-in-out infinite"
|
|
134
|
+
});
|
|
135
|
+
let i = document.createElement("span");
|
|
136
|
+
Object.assign(i.style, {
|
|
137
|
+
display: "block",
|
|
138
|
+
width: `${e % 2 ? "5rem" : "6rem"}`,
|
|
139
|
+
height: "1rem",
|
|
140
|
+
borderRadius: "0.35rem",
|
|
141
|
+
background: "var(--mint-color-surface-control, #e8eee9)",
|
|
142
|
+
animation: "mint-choice-skeleton-pulse 1.4s ease-in-out infinite"
|
|
143
|
+
}), n.append(r, i), a.appendChild(n), t.push(n);
|
|
144
|
+
}
|
|
145
|
+
a.style.display = "flex", r.querySelectorAll(":scope > mint-choice-option").forEach((e) => {
|
|
146
|
+
e.style.visibility = "hidden";
|
|
147
|
+
});
|
|
148
|
+
} else a && (a.style.display = "none"), r.style.position = "", r.querySelectorAll(":scope > mint-choice-option").forEach((e) => {
|
|
149
|
+
e.style.visibility = "";
|
|
150
|
+
});
|
|
100
151
|
}
|
|
101
152
|
_activateGroupModeIfNeeded() {
|
|
102
153
|
this._groupMode || !this.querySelector("mint-choice-option") || (this._groupMode = !0, this.removeEventListeners(), this.querySelector(".mint-choice-wrapper")?.remove(), this.querySelector(".mint-choice-label-container")?.remove(), this._radio = null, this._groupChangeHandler = (e) => {
|
|
@@ -238,7 +289,8 @@ var t = class extends HTMLElement {
|
|
|
238
289
|
return [
|
|
239
290
|
"value",
|
|
240
291
|
"checked",
|
|
241
|
-
"disabled"
|
|
292
|
+
"disabled",
|
|
293
|
+
"loading"
|
|
242
294
|
];
|
|
243
295
|
}
|
|
244
296
|
constructor() {
|
|
@@ -262,7 +314,7 @@ var t = class extends HTMLElement {
|
|
|
262
314
|
},
|
|
263
315
|
bubbles: !1
|
|
264
316
|
})));
|
|
265
|
-
}, this._radio.addEventListener("change", this._changeHandler)), this._radio.name = e?.getAttribute("name") || "", this._radio.value = this.getAttribute("value") || "", this._radio.disabled = this.hasAttribute("disabled") || e?.hasAttribute("disabled") || !1, this._radio.required = e?.hasAttribute("required") || !1, this._radio.checked = this.hasAttribute("checked") || e?.getAttribute("value") === this._radio.value;
|
|
317
|
+
}, this._radio.addEventListener("change", this._changeHandler)), this._radio.name = e?.getAttribute("name") || "", this._radio.value = this.getAttribute("value") || "", this._radio.disabled = this.hasAttribute("disabled") || this.hasAttribute("loading") || e?.hasAttribute("disabled") || e?.hasAttribute("loading") || !1, this._radio.required = e?.hasAttribute("required") || !1, this._radio.checked = this.hasAttribute("checked") || e?.getAttribute("value") === this._radio.value;
|
|
266
318
|
let r = n.querySelector(".mint-choice-option-label");
|
|
267
319
|
r || (r = document.createElement("span"), r.className = "mint-choice-option-label", n.appendChild(r)), r.textContent = this._labelText;
|
|
268
320
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunks/register-element-tCL_F1YI.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`,`required`]}constructor(){super(),this._radio=null,this._checked=!1,this._groupMode=!1,this._groupChangeHandler=null,this._groupObserver=null}connectedCallback(){if(this._activateGroupModeIfNeeded(),this._groupObserver=new MutationObserver(()=>this._activateGroupModeIfNeeded()),this._groupObserver.observe(this,{childList:!0,subtree:!0}),this._groupMode)return;let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners(),this._groupChangeHandler&&=(this.removeEventListener(`choice-option-change`,this._groupChangeHandler),null),this._groupObserver?.disconnect(),this._groupObserver=null}attributeChangedCallback(e,t,n){if(this._groupMode){t!==n&&this.renderGroup();return}e===`checked`&&(this._checked=n!==null&&n!==`false`,this._radio&&(this._radio.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._radio&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._radio&&(this._radio.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this._groupMode?this.querySelector(`mint-choice-option input[type="radio"]:checked`)?.value||this.getAttribute(`value`)||``:this.getAttribute(`value`)||``}set value(e){this.setValue(e)}get value(){return this.getValue()}setValue(e){if(!this._groupMode){e?this.setAttribute(`value`,e):this.removeAttribute(`value`);return}let t=e==null?``:String(e);this.querySelectorAll(`mint-choice-option`).forEach(e=>{let n=e.getAttribute(`value`)===t,r=e.querySelector(`input[type="radio"]`);r&&(r.checked=n),e.toggleAttribute(`checked`,n)}),t?this.setAttribute(`value`,t):this.removeAttribute(`value`)}renderGroup(){this.classList.add(`mint-choice-group`),this.setAttribute(`role`,`radiogroup`);let e=this.getAttribute(`label`)||``,t=this.querySelector(`:scope > .mint-choice-group-label`);e&&!t&&(t=document.createElement(`div`),t.className=`mint-choice-group-label`,this.insertBefore(t,this.firstChild)),t&&(e?t.textContent=e:t.remove());let n=this.querySelector(`:scope > .mint-choice-options`);n||(n=document.createElement(`div`),n.className=`mint-choice-options`,t?.parentElement===this?this.insertBefore(n,t.nextSibling):this.insertBefore(n,this.firstChild)),Array.from(this.children).filter(e=>e.tagName===`MINT-CHOICE-OPTION`&&e.parentElement!==n).forEach(e=>n.appendChild(e)),this.querySelectorAll(`mint-choice-option`).forEach(e=>e.render());let r=this.getAttribute(`value`);r&&this.setValue(r)}_activateGroupModeIfNeeded(){this._groupMode||!this.querySelector(`mint-choice-option`)||(this._groupMode=!0,this.removeEventListeners(),this.querySelector(`.mint-choice-wrapper`)?.remove(),this.querySelector(`.mint-choice-label-container`)?.remove(),this._radio=null,this._groupChangeHandler=e=>{let t=e.target.closest?.(`mint-choice-option`);if(!t||!this.contains(t))return;let n=t.getAttribute(`value`)||``;n?this.setAttribute(`value`,n):this.removeAttribute(`value`),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))},this.addEventListener(`choice-option-change`,this._groupChangeHandler),this.renderGroup())}getChoiceClasses(){return`mint-choice-control`}render(){if(this._groupMode){this.renderGroup();return}let e=this.getLabel(),t=this.getInfo(),n=this.isDisabled(),r=this.querySelector(`.mint-choice-wrapper`);r||(r=document.createElement(`div`),r.className=`mint-choice-wrapper`,this.insertBefore(r,this.firstChild)),this._radio?this._radio.parentElement!==r&&r.appendChild(this._radio):(this._radio=document.createElement(`input`),this._radio.type=`radio`,r.appendChild(this._radio),this.setupEventListeners()),this._radio.className=`mint-input-overlay`,this._radio.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._radio.checked=this._checked,this._radio.disabled=n,this._changeHandler||this.setupEventListeners();let i=this.getId();i?this._radio.id=i:this._radio.removeAttribute(`id`);let a=this.getName();a?this._radio.name=a:this._radio.removeAttribute(`name`);let o=this.getValue();o?this._radio.value=o:this._radio.removeAttribute(`value`),e?this._radio.setAttribute(`aria-label`,e):this._radio.removeAttribute(`aria-label`),r.className=`mint-choice-wrapper ${this.getChoiceClasses()}`,r.style.pointerEvents=`none`,this._radio.style.pointerEvents=`auto`;let s=r.querySelector(`.mint-choice-indicator`);s||(s=document.createElement(`div`),s.className=`mint-choice-indicator`,s.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,s.style.zIndex=`1`,r.appendChild(s)),s.style.opacity=this._checked?`1`:`0`,s.style.transform=this._checked?`scale(1)`:`scale(0.8)`,this.updateVisualState();let c=this.querySelector(`.mint-choice-label-container`);if(e||t){c||(c=document.createElement(`div`),c.className=`mint-choice-label-container`,this.appendChild(c));let r=c.querySelector(`.mint-choice-label`);e?(r||(r=document.createElement(`span`),r.className=`mint-choice-label`,c.insertBefore(r,c.firstChild)),r.textContent=e,n?r.style.opacity=`0.5`:r.style.opacity=``):r&&r.remove();let i=c.querySelector(`.mint-choice-info`);if(t?(i||(i=document.createElement(`span`),i.className=`mint-choice-info`,c.appendChild(i)),i.textContent=t,n?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),n)c.style.cursor=`default`,c._clickHandler&&(c.removeEventListener(`click`,c._clickHandler),c._clickHandler=null);else{c.style.cursor=`pointer`;let e=c._clickHandler;e&&c.removeEventListener(`click`,e),c._clickHandler=e=>{this._radio&&(e.target===this._radio||this._radio.contains(e.target)||e.composedPath().includes(this._radio))||this.select()},c.addEventListener(`click`,c._clickHandler)}}else c&&c.remove()}setupEventListeners(){this.removeEventListeners(),this._radio&&(this._changeHandler=e=>{e.stopPropagation();let t=this._checked;if(this._checked=this._radio.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState(),this._checked){let e=this._radio.name;e&&document.querySelectorAll(`input[type="radio"][name="${e}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}})}if(t!==this._checked){let e=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}},this._radio.addEventListener(`change`,this._changeHandler),this._groupChangeHandler=e=>{e.target!==this._radio&&e.target.type===`radio`&&e.target.name===this._radio.name&&e.target.checked&&setTimeout(()=>{this._radio&&this._radio.checked!==this._checked&&(this._checked=this._radio.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState())},0)},document.addEventListener(`change`,this._groupChangeHandler,!0),this._clickHandler=e=>{let t=this._radio.name;t&&document.querySelectorAll(`input[type="radio"][name="${t}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}}),requestAnimationFrame(()=>{this._checked=this._radio.checked,this.updateVisualState()})},this._radio.addEventListener(`click`,this._clickHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-choice-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._radio.addEventListener(`mousedown`,this._mousedownHandler),this._radio.addEventListener(`mouseup`,this._mouseupHandler),this._radio.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-choice-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._radio.addEventListener(`touchstart`,this._touchstartHandler),this._radio.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._radio&&(this._changeHandler&&=(this._radio.removeEventListener(`change`,this._changeHandler),null),this._groupChangeHandler&&=(document.removeEventListener(`change`,this._groupChangeHandler),null),this._clickHandler&&=(this._radio.removeEventListener(`click`,this._clickHandler),null),this._mousedownHandler&&=(this._radio.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._radio.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._radio.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._radio.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._radio.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-choice-wrapper`),t=e?.querySelector(`.mint-choice-indicator`);t&&(t.style.opacity=this._checked?`1`:`0`,t.style.transform=this._checked?`scale(1)`:`scale(0.8)`),e&&(e.className=`mint-choice-wrapper ${this.getChoiceClasses()}`,e.classList.contains(`mint-choice-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}select(){if(this._radio&&!this.isDisabled()){this._radio.checked=!0,this._radio.dispatchEvent(new Event(`change`,{bubbles:!0})),this._checked=!0,this.hasAttribute(`checked`)||this.setAttribute(`checked`,``);let e=this._radio.name;e&&document.querySelectorAll(`input[type="radio"][name="${e}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}}),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)}}},n=class extends HTMLElement{static get observedAttributes(){return[`value`,`checked`,`disabled`]}constructor(){super(),this._labelText=``,this._radio=null,this._changeHandler=null}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.render()}render(){let e=this.closest(`mint-choice`),t=this.querySelector(`.mint-choice-option-label`);this._labelText||=t?.textContent?.trim()||this.textContent.trim();let n=this.querySelector(`:scope > .mint-choice-option-control`);n||(n=document.createElement(`label`),n.className=`mint-choice-option-control`,this.replaceChildren(n)),this._radio||(this._radio=document.createElement(`input`),this._radio.type=`radio`,this._radio.className=`mint-choice-option-input`,n.appendChild(this._radio),this._changeHandler=()=>{this._radio?.checked&&e&&(e.setValue(this.getAttribute(`value`)||``),e.dispatchEvent(new CustomEvent(`choice-option-change`,{detail:{value:this.getAttribute(`value`)||``,option:this},bubbles:!1})))},this._radio.addEventListener(`change`,this._changeHandler)),this._radio.name=e?.getAttribute(`name`)||``,this._radio.value=this.getAttribute(`value`)||``,this._radio.disabled=this.hasAttribute(`disabled`)||e?.hasAttribute(`disabled`)||!1,this._radio.required=e?.hasAttribute(`required`)||!1,this._radio.checked=this.hasAttribute(`checked`)||e?.getAttribute(`value`)===this._radio.value;let r=n.querySelector(`.mint-choice-option-label`);r||(r=document.createElement(`span`),r.className=`mint-choice-option-label`,n.appendChild(r)),r.textContent=this._labelText}};typeof customElements<`u`&&!customElements.get(`mint-choice`)&&e.t(`mint-choice`,t),typeof customElements<`u`&&!customElements.get(`mint-choice-option`)&&e.t(`mint-choice-option`,n),module.exports=t;
|
|
1
|
+
const e=require(`../chunks/register-element-tCL_F1YI.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`,`required`,`loading`]}constructor(){super(),this._radio=null,this._checked=!1,this._groupMode=!1,this._groupChangeHandler=null,this._groupObserver=null}connectedCallback(){if(this._activateGroupModeIfNeeded(),this._groupObserver=new MutationObserver(()=>this._activateGroupModeIfNeeded()),this._groupObserver.observe(this,{childList:!0,subtree:!0}),this._groupMode)return;let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners(),this._groupChangeHandler&&=(this.removeEventListener(`choice-option-change`,this._groupChangeHandler),null),this._groupObserver?.disconnect(),this._groupObserver=null}attributeChangedCallback(e,t,n){if(this._groupMode){t!==n&&this.renderGroup();return}e===`checked`&&(this._checked=n!==null&&n!==`false`,this._radio&&(this._radio.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._radio&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._radio&&(this._radio.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)||this.getAttribute(`loading`)===`true`}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this._groupMode?this.querySelector(`mint-choice-option input[type="radio"]:checked`)?.value||this.getAttribute(`value`)||``:this.getAttribute(`value`)||``}set value(e){this.setValue(e)}get value(){return this.getValue()}setValue(e){if(!this._groupMode){e?this.setAttribute(`value`,e):this.removeAttribute(`value`);return}let t=e==null?``:String(e);this.querySelectorAll(`mint-choice-option`).forEach(e=>{let n=e.getAttribute(`value`)===t,r=e.querySelector(`input[type="radio"]`);r&&(r.checked=n),e.toggleAttribute(`checked`,n)}),t?this.setAttribute(`value`,t):this.removeAttribute(`value`)}renderGroup(){let e=this.getAttribute(`loading`)===`true`;this.toggleAttribute(`aria-busy`,e),this.classList.add(`mint-choice-group`),this.setAttribute(`role`,`radiogroup`);let t=this.getAttribute(`label`)||``,n=this.querySelector(`:scope > .mint-choice-group-label`);t&&!n&&(n=document.createElement(`div`),n.className=`mint-choice-group-label`,this.insertBefore(n,this.firstChild)),n&&(t?n.textContent=t:n.remove());let r=this.querySelector(`:scope > .mint-choice-options`);r||(r=document.createElement(`div`),r.className=`mint-choice-options`,n?.parentElement===this?this.insertBefore(r,n.nextSibling):this.insertBefore(r,this.firstChild)),Array.from(this.children).filter(e=>e.tagName===`MINT-CHOICE-OPTION`&&e.parentElement!==r).forEach(e=>r.appendChild(e)),this.querySelectorAll(`mint-choice-option`).forEach(t=>{t.toggleAttribute(`loading`,e),t.render()});let i=this.getAttribute(`value`);i&&this.setValue(i);let a=r.querySelector(`:scope > .mint-choice-loading-skeleton`);if(e){r.style.position=`relative`,a||(a=document.createElement(`div`),a.className=`mint-choice-loading-skeleton`,a.setAttribute(`aria-hidden`,`true`),Object.assign(a.style,{position:`absolute`,inset:`0`,display:`flex`,flexDirection:`column`,pointerEvents:`none`,zIndex:`20`}),r.appendChild(a)),a.style.gap=r.querySelector(`:scope > mint-choice-option[info]`)?`0.75rem`:`0.55rem`;let e=r.querySelectorAll(`:scope > mint-choice-option`).length,t=Array.from(a.children);for(;t.length>e;)t.pop()?.remove();for(;t.length<e;){let e=t.length,n=document.createElement(`div`);Object.assign(n.style,{display:`flex`,alignItems:`center`,gap:`0.55rem`,minHeight:`1.25rem`,flex:`none`});let r=document.createElement(`span`);Object.assign(r.style,{display:`block`,width:`1.1rem`,height:`1.1rem`,flex:`none`,borderRadius:`50%`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-choice-skeleton-pulse 1.4s ease-in-out infinite`});let i=document.createElement(`span`);Object.assign(i.style,{display:`block`,width:`${e%2?`5rem`:`6rem`}`,height:`1rem`,borderRadius:`0.35rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-choice-skeleton-pulse 1.4s ease-in-out infinite`}),n.append(r,i),a.appendChild(n),t.push(n)}a.style.display=`flex`,r.querySelectorAll(`:scope > mint-choice-option`).forEach(e=>{e.style.visibility=`hidden`})}else a&&(a.style.display=`none`),r.style.position=``,r.querySelectorAll(`:scope > mint-choice-option`).forEach(e=>{e.style.visibility=``})}_activateGroupModeIfNeeded(){this._groupMode||!this.querySelector(`mint-choice-option`)||(this._groupMode=!0,this.removeEventListeners(),this.querySelector(`.mint-choice-wrapper`)?.remove(),this.querySelector(`.mint-choice-label-container`)?.remove(),this._radio=null,this._groupChangeHandler=e=>{let t=e.target.closest?.(`mint-choice-option`);if(!t||!this.contains(t))return;let n=t.getAttribute(`value`)||``;n?this.setAttribute(`value`,n):this.removeAttribute(`value`),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))},this.addEventListener(`choice-option-change`,this._groupChangeHandler),this.renderGroup())}getChoiceClasses(){return`mint-choice-control`}render(){if(this._groupMode){this.renderGroup();return}let e=this.getLabel(),t=this.getInfo(),n=this.isDisabled(),r=this.querySelector(`.mint-choice-wrapper`);r||(r=document.createElement(`div`),r.className=`mint-choice-wrapper`,this.insertBefore(r,this.firstChild)),this._radio?this._radio.parentElement!==r&&r.appendChild(this._radio):(this._radio=document.createElement(`input`),this._radio.type=`radio`,r.appendChild(this._radio),this.setupEventListeners()),this._radio.className=`mint-input-overlay`,this._radio.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._radio.checked=this._checked,this._radio.disabled=n,this._changeHandler||this.setupEventListeners();let i=this.getId();i?this._radio.id=i:this._radio.removeAttribute(`id`);let a=this.getName();a?this._radio.name=a:this._radio.removeAttribute(`name`);let o=this.getValue();o?this._radio.value=o:this._radio.removeAttribute(`value`),e?this._radio.setAttribute(`aria-label`,e):this._radio.removeAttribute(`aria-label`),r.className=`mint-choice-wrapper ${this.getChoiceClasses()}`,r.style.pointerEvents=`none`,this._radio.style.pointerEvents=`auto`;let s=r.querySelector(`.mint-choice-indicator`);s||(s=document.createElement(`div`),s.className=`mint-choice-indicator`,s.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,s.style.zIndex=`1`,r.appendChild(s)),s.style.opacity=this._checked?`1`:`0`,s.style.transform=this._checked?`scale(1)`:`scale(0.8)`,this.updateVisualState();let c=this.querySelector(`.mint-choice-label-container`);if(e||t){c||(c=document.createElement(`div`),c.className=`mint-choice-label-container`,this.appendChild(c));let r=c.querySelector(`.mint-choice-label`);e?(r||(r=document.createElement(`span`),r.className=`mint-choice-label`,c.insertBefore(r,c.firstChild)),r.textContent=e,n?r.style.opacity=`0.5`:r.style.opacity=``):r&&r.remove();let i=c.querySelector(`.mint-choice-info`);if(t?(i||(i=document.createElement(`span`),i.className=`mint-choice-info`,c.appendChild(i)),i.textContent=t,n?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),n)c.style.cursor=`default`,c._clickHandler&&(c.removeEventListener(`click`,c._clickHandler),c._clickHandler=null);else{c.style.cursor=`pointer`;let e=c._clickHandler;e&&c.removeEventListener(`click`,e),c._clickHandler=e=>{this._radio&&(e.target===this._radio||this._radio.contains(e.target)||e.composedPath().includes(this._radio))||this.select()},c.addEventListener(`click`,c._clickHandler)}}else c&&c.remove()}setupEventListeners(){this.removeEventListeners(),this._radio&&(this._changeHandler=e=>{e.stopPropagation();let t=this._checked;if(this._checked=this._radio.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState(),this._checked){let e=this._radio.name;e&&document.querySelectorAll(`input[type="radio"][name="${e}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}})}if(t!==this._checked){let e=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}},this._radio.addEventListener(`change`,this._changeHandler),this._groupChangeHandler=e=>{e.target!==this._radio&&e.target.type===`radio`&&e.target.name===this._radio.name&&e.target.checked&&setTimeout(()=>{this._radio&&this._radio.checked!==this._checked&&(this._checked=this._radio.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState())},0)},document.addEventListener(`change`,this._groupChangeHandler,!0),this._clickHandler=e=>{let t=this._radio.name;t&&document.querySelectorAll(`input[type="radio"][name="${t}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}}),requestAnimationFrame(()=>{this._checked=this._radio.checked,this.updateVisualState()})},this._radio.addEventListener(`click`,this._clickHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-choice-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._radio.addEventListener(`mousedown`,this._mousedownHandler),this._radio.addEventListener(`mouseup`,this._mouseupHandler),this._radio.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-choice-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._radio.addEventListener(`touchstart`,this._touchstartHandler),this._radio.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._radio&&(this._changeHandler&&=(this._radio.removeEventListener(`change`,this._changeHandler),null),this._groupChangeHandler&&=(document.removeEventListener(`change`,this._groupChangeHandler),null),this._clickHandler&&=(this._radio.removeEventListener(`click`,this._clickHandler),null),this._mousedownHandler&&=(this._radio.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._radio.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._radio.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._radio.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._radio.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-choice-wrapper`),t=e?.querySelector(`.mint-choice-indicator`);t&&(t.style.opacity=this._checked?`1`:`0`,t.style.transform=this._checked?`scale(1)`:`scale(0.8)`),e&&(e.className=`mint-choice-wrapper ${this.getChoiceClasses()}`,e.classList.contains(`mint-choice-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}select(){if(this._radio&&!this.isDisabled()){this._radio.checked=!0,this._radio.dispatchEvent(new Event(`change`,{bubbles:!0})),this._checked=!0,this.hasAttribute(`checked`)||this.setAttribute(`checked`,``);let e=this._radio.name;e&&document.querySelectorAll(`input[type="radio"][name="${e}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}}),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)}}},n=class extends HTMLElement{static get observedAttributes(){return[`value`,`checked`,`disabled`,`loading`]}constructor(){super(),this._labelText=``,this._radio=null,this._changeHandler=null}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.render()}render(){let e=this.closest(`mint-choice`),t=this.querySelector(`.mint-choice-option-label`);this._labelText||=t?.textContent?.trim()||this.textContent.trim();let n=this.querySelector(`:scope > .mint-choice-option-control`);n||(n=document.createElement(`label`),n.className=`mint-choice-option-control`,this.replaceChildren(n)),this._radio||(this._radio=document.createElement(`input`),this._radio.type=`radio`,this._radio.className=`mint-choice-option-input`,n.appendChild(this._radio),this._changeHandler=()=>{this._radio?.checked&&e&&(e.setValue(this.getAttribute(`value`)||``),e.dispatchEvent(new CustomEvent(`choice-option-change`,{detail:{value:this.getAttribute(`value`)||``,option:this},bubbles:!1})))},this._radio.addEventListener(`change`,this._changeHandler)),this._radio.name=e?.getAttribute(`name`)||``,this._radio.value=this.getAttribute(`value`)||``,this._radio.disabled=this.hasAttribute(`disabled`)||this.hasAttribute(`loading`)||e?.hasAttribute(`disabled`)||e?.hasAttribute(`loading`)||!1,this._radio.required=e?.hasAttribute(`required`)||!1,this._radio.checked=this.hasAttribute(`checked`)||e?.getAttribute(`value`)===this._radio.value;let r=n.querySelector(`.mint-choice-option-label`);r||(r=document.createElement(`span`),r.className=`mint-choice-option-label`,n.appendChild(r)),r.textContent=this._labelText}};typeof customElements<`u`&&!customElements.get(`mint-choice`)&&e.t(`mint-choice`,t),typeof customElements<`u`&&!customElements.get(`mint-choice-option`)&&e.t(`mint-choice-option`,n),module.exports=t;
|