@iris-ui-kit/vue 0.2.2 → 0.2.4
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/index.cjs +86 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +86 -31
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -4507,6 +4507,12 @@ var IrisNumberInput = vue.defineComponent({
|
|
|
4507
4507
|
const rawText = vue.ref(
|
|
4508
4508
|
props.modelValue === null || props.modelValue === void 0 ? "" : String(props.modelValue)
|
|
4509
4509
|
);
|
|
4510
|
+
vue.watch(
|
|
4511
|
+
() => props.modelValue,
|
|
4512
|
+
(next) => {
|
|
4513
|
+
rawText.value = next === null || next === void 0 ? "" : String(next);
|
|
4514
|
+
}
|
|
4515
|
+
);
|
|
4510
4516
|
const startValue = vue.computed(() => {
|
|
4511
4517
|
if (Number.isFinite(props.min) && props.min !== -Infinity) return props.min;
|
|
4512
4518
|
return 0;
|
|
@@ -10462,10 +10468,82 @@ var IrisTabs = vue.defineComponent({
|
|
|
10462
10468
|
return () => slots.default?.();
|
|
10463
10469
|
}
|
|
10464
10470
|
});
|
|
10471
|
+
|
|
10472
|
+
// src/primitives/tabs/styles.ts
|
|
10473
|
+
var STYLE_ID2 = "iris-tabs-styles";
|
|
10474
|
+
var CSS6 = `
|
|
10475
|
+
:where(.iris-tabs-list) {
|
|
10476
|
+
display: flex;
|
|
10477
|
+
gap: 2px;
|
|
10478
|
+
}
|
|
10479
|
+
:where(.iris-tabs-list[data-orientation="horizontal"]) {
|
|
10480
|
+
flex-direction: row;
|
|
10481
|
+
border-bottom: 1px solid var(--iris-border);
|
|
10482
|
+
}
|
|
10483
|
+
:where(.iris-tabs-list[data-orientation="vertical"]) {
|
|
10484
|
+
flex-direction: column;
|
|
10485
|
+
border-inline-end: 1px solid var(--iris-border);
|
|
10486
|
+
}
|
|
10487
|
+
:where(.iris-tabs-trigger) {
|
|
10488
|
+
padding: 8px var(--iris-padding-md);
|
|
10489
|
+
font-size: 14px;
|
|
10490
|
+
font-weight: 500;
|
|
10491
|
+
font-family: inherit;
|
|
10492
|
+
cursor: pointer;
|
|
10493
|
+
opacity: 1;
|
|
10494
|
+
border: none;
|
|
10495
|
+
outline: none;
|
|
10496
|
+
background: transparent;
|
|
10497
|
+
color: var(--iris-muted);
|
|
10498
|
+
transition: color 120ms ease, border-color 120ms ease;
|
|
10499
|
+
}
|
|
10500
|
+
:where(.iris-tabs-trigger[data-orientation="horizontal"]) {
|
|
10501
|
+
margin-bottom: -1px;
|
|
10502
|
+
border-bottom: 2px solid transparent;
|
|
10503
|
+
}
|
|
10504
|
+
:where(.iris-tabs-trigger[data-orientation="vertical"]) {
|
|
10505
|
+
margin-inline-end: -1px;
|
|
10506
|
+
border-inline-end: 2px solid transparent;
|
|
10507
|
+
}
|
|
10508
|
+
:where(.iris-tabs-trigger[data-state="active"]) {
|
|
10509
|
+
color: var(--iris-primary);
|
|
10510
|
+
}
|
|
10511
|
+
:where(.iris-tabs-trigger[data-state="active"][data-orientation="horizontal"]) {
|
|
10512
|
+
border-bottom-color: var(--iris-primary);
|
|
10513
|
+
}
|
|
10514
|
+
:where(.iris-tabs-trigger[data-state="active"][data-orientation="vertical"]) {
|
|
10515
|
+
border-inline-end-color: var(--iris-primary);
|
|
10516
|
+
}
|
|
10517
|
+
:where(.iris-tabs-trigger[data-disabled]) {
|
|
10518
|
+
cursor: not-allowed;
|
|
10519
|
+
opacity: 0.5;
|
|
10520
|
+
}
|
|
10521
|
+
:where(.iris-tabs-trigger:focus-visible) {
|
|
10522
|
+
outline: 2px solid var(--iris-focus-ring, var(--iris-primary));
|
|
10523
|
+
outline-offset: 2px;
|
|
10524
|
+
}
|
|
10525
|
+
`.trim();
|
|
10526
|
+
var installed6 = false;
|
|
10527
|
+
function installTabsStyles() {
|
|
10528
|
+
if (installed6) return;
|
|
10529
|
+
if (typeof document === "undefined") return;
|
|
10530
|
+
if (document.getElementById(STYLE_ID2)) {
|
|
10531
|
+
installed6 = true;
|
|
10532
|
+
return;
|
|
10533
|
+
}
|
|
10534
|
+
const style = document.createElement("style");
|
|
10535
|
+
style.id = STYLE_ID2;
|
|
10536
|
+
style.textContent = CSS6;
|
|
10537
|
+
document.head.appendChild(style);
|
|
10538
|
+
installed6 = true;
|
|
10539
|
+
}
|
|
10540
|
+
|
|
10541
|
+
// src/primitives/tabs/TabsList.ts
|
|
10465
10542
|
var IrisTabsList = vue.defineComponent({
|
|
10466
10543
|
name: "IrisTabsList",
|
|
10467
10544
|
inheritAttrs: false,
|
|
10468
10545
|
setup(_, { slots, attrs }) {
|
|
10546
|
+
installTabsStyles();
|
|
10469
10547
|
const ctx = vue.inject(TabsContextKey);
|
|
10470
10548
|
if (!ctx) {
|
|
10471
10549
|
throw new Error("[iris-ui] IrisTabsList must be inside an IrisTabs");
|
|
@@ -10481,14 +10559,8 @@ var IrisTabsList = vue.defineComponent({
|
|
|
10481
10559
|
"aria-orientation": ctx.orientation.value,
|
|
10482
10560
|
"data-iris-tabs-list": "",
|
|
10483
10561
|
"data-orientation": ctx.orientation.value,
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
flexDirection: ctx.orientation.value === "horizontal" ? "row" : "column",
|
|
10487
|
-
gap: "2px",
|
|
10488
|
-
borderBottom: ctx.orientation.value === "horizontal" ? "1px solid var(--iris-border)" : "none",
|
|
10489
|
-
borderInlineEnd: ctx.orientation.value === "vertical" ? "1px solid var(--iris-border)" : "none",
|
|
10490
|
-
...attrs.style ?? {}
|
|
10491
|
-
}
|
|
10562
|
+
class: ["iris-tabs-list", attrs.class],
|
|
10563
|
+
style: attrs.style
|
|
10492
10564
|
},
|
|
10493
10565
|
slots.default?.()
|
|
10494
10566
|
);
|
|
@@ -10503,6 +10575,7 @@ var IrisTabsTrigger = vue.defineComponent({
|
|
|
10503
10575
|
asChild: { type: Boolean, default: false }
|
|
10504
10576
|
},
|
|
10505
10577
|
setup(props, { slots, attrs }) {
|
|
10578
|
+
installTabsStyles();
|
|
10506
10579
|
const ctx = vue.inject(TabsContextKey);
|
|
10507
10580
|
if (!ctx) {
|
|
10508
10581
|
throw new Error("[iris-ui] IrisTabsTrigger must be inside an IrisTabs");
|
|
@@ -10551,7 +10624,9 @@ var IrisTabsTrigger = vue.defineComponent({
|
|
|
10551
10624
|
"data-disabled": isDisabled.value ? "" : void 0,
|
|
10552
10625
|
disabled: isDisabled.value ? true : void 0,
|
|
10553
10626
|
onClick,
|
|
10554
|
-
onKeydown: onKeyDown
|
|
10627
|
+
onKeydown: onKeyDown,
|
|
10628
|
+
class: ["iris-tabs-trigger", attrs.class],
|
|
10629
|
+
style: attrs.style
|
|
10555
10630
|
};
|
|
10556
10631
|
if (props.asChild) {
|
|
10557
10632
|
const root = findFirstElement(slots.default?.());
|
|
@@ -10562,37 +10637,17 @@ var IrisTabsTrigger = vue.defineComponent({
|
|
|
10562
10637
|
return null;
|
|
10563
10638
|
}
|
|
10564
10639
|
const merged = mergeSlotProps(
|
|
10565
|
-
{ ...
|
|
10640
|
+
{ ...attrs, ...triggerProps },
|
|
10566
10641
|
root.props ?? {}
|
|
10567
10642
|
);
|
|
10568
10643
|
return vue.h(root.type, merged, root.children);
|
|
10569
10644
|
}
|
|
10570
|
-
const colors = isActive.value ? { background: "transparent", color: "var(--iris-primary)" } : { background: "transparent", color: "var(--iris-muted)" };
|
|
10571
|
-
const borderActive = ctx.orientation.value === "horizontal" ? { borderBottom: `2px solid ${isActive.value ? "var(--iris-primary)" : "transparent"}` } : {
|
|
10572
|
-
borderInlineEnd: `2px solid ${isActive.value ? "var(--iris-primary)" : "transparent"}`
|
|
10573
|
-
};
|
|
10574
10645
|
return vue.h(
|
|
10575
10646
|
"button",
|
|
10576
10647
|
{
|
|
10577
10648
|
type: "button",
|
|
10578
10649
|
...attrs,
|
|
10579
|
-
...triggerProps
|
|
10580
|
-
style: {
|
|
10581
|
-
padding: "8px var(--iris-padding-md)",
|
|
10582
|
-
fontSize: "14px",
|
|
10583
|
-
fontWeight: "500",
|
|
10584
|
-
fontFamily: "inherit",
|
|
10585
|
-
cursor: isDisabled.value ? "not-allowed" : "pointer",
|
|
10586
|
-
opacity: isDisabled.value ? "0.5" : "1",
|
|
10587
|
-
border: "none",
|
|
10588
|
-
outline: "none",
|
|
10589
|
-
marginBottom: ctx.orientation.value === "horizontal" ? "-1px" : void 0,
|
|
10590
|
-
marginInlineEnd: ctx.orientation.value === "vertical" ? "-1px" : void 0,
|
|
10591
|
-
transition: "color 120ms ease, border-color 120ms ease",
|
|
10592
|
-
...colors,
|
|
10593
|
-
...borderActive,
|
|
10594
|
-
...attrs.style ?? {}
|
|
10595
|
-
}
|
|
10650
|
+
...triggerProps
|
|
10596
10651
|
},
|
|
10597
10652
|
slots.default?.()
|
|
10598
10653
|
);
|