@insymetri/styleguide 0.1.82 → 0.1.83
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/IIMenu/IIMenu.svelte +10 -2
- package/package.json +1 -1
|
@@ -283,7 +283,15 @@
|
|
|
283
283
|
return -1
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
|
|
286
|
+
// Named-utility button reset. Avoids `[all:unset]`, which in TW v4 sorts after
|
|
287
|
+
// named utilities and so wins the cascade over any layout classes a consumer
|
|
288
|
+
// passes (clobbering their `display`/padding). These named resets participate
|
|
289
|
+
// in the cascade normally and are overridable via `cn`/tailwind-merge.
|
|
290
|
+
const buttonReset = 'appearance-none bg-transparent border-0 p-0 m-0 text-inherit [font:inherit] outline-none cursor-default'
|
|
291
|
+
// Children triggers own their content layout; default to an inline-flex row so a
|
|
292
|
+
// value + caret sit on one line even when the consumer passes no display class.
|
|
293
|
+
const childrenTriggerClass = `${buttonReset} inline-flex items-center text-left`
|
|
294
|
+
const defaultTriggerClass = `${buttonReset} inline-flex items-center justify-center p-4 rounded-4 text-secondary transition-all duration-fast hover:bg-background hover:text-body data-[state=open]:bg-background data-[state=open]:text-body motion-reduce:transition-none`
|
|
287
295
|
</script>
|
|
288
296
|
|
|
289
297
|
{#snippet itemContent(item: MenuItem)}
|
|
@@ -427,7 +435,7 @@
|
|
|
427
435
|
aria-haspopup="menu"
|
|
428
436
|
aria-expanded={open}
|
|
429
437
|
data-state={open ? 'open' : 'closed'}
|
|
430
|
-
class={cn(children ?
|
|
438
|
+
class={cn(children ? childrenTriggerClass : defaultTriggerClass, triggerClass, className)}
|
|
431
439
|
onclick={toggle}
|
|
432
440
|
onkeydown={handleTriggerKeydown}
|
|
433
441
|
>
|