@nation-a/ui 0.10.8 → 0.11.0
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 +217 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +217 -22
- package/dist/index.js.map +1 -1
- package/dist/styled-system/styles.css +0 -4
- package/dist/types/components/Tabs/Tabs.stories.d.ts +1 -1
- package/dist/types/components/Tabs/index.d.ts +2 -2
- package/dist/types/components/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3539,11 +3539,42 @@ const getPortalNode = (cb) => {
|
|
|
3539
3539
|
};
|
|
3540
3540
|
const subscribe = () => () => {
|
|
3541
3541
|
};
|
|
3542
|
+
function useDebounce(value, delay2) {
|
|
3543
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
3544
|
+
useEffect(() => {
|
|
3545
|
+
const timer = setTimeout(() => {
|
|
3546
|
+
setDebouncedValue(value);
|
|
3547
|
+
}, delay2);
|
|
3548
|
+
return () => {
|
|
3549
|
+
clearTimeout(timer);
|
|
3550
|
+
};
|
|
3551
|
+
}, [value, delay2]);
|
|
3552
|
+
return debouncedValue;
|
|
3553
|
+
}
|
|
3542
3554
|
const [TabsProvider, useTabsContext] = createContext({
|
|
3543
3555
|
name: "TabsContext",
|
|
3544
3556
|
hookName: "useTabsContext",
|
|
3545
3557
|
providerName: "<TabsProvider />"
|
|
3546
3558
|
});
|
|
3559
|
+
const TabContent = forwardRef((props, ref) => {
|
|
3560
|
+
const [contentProps, localProps] = createSplitProps()(props, ["value"]);
|
|
3561
|
+
const tabs = useTabsContext();
|
|
3562
|
+
const renderStrategyProps = useRenderStrategyPropsContext();
|
|
3563
|
+
const presence = usePresence({
|
|
3564
|
+
...renderStrategyProps,
|
|
3565
|
+
present: useDebounce(tabs.value === props.value, 0),
|
|
3566
|
+
immediate: true
|
|
3567
|
+
});
|
|
3568
|
+
const mergedProps = mergeProps(tabs.getContentProps(contentProps), presence.getPresenceProps(), localProps);
|
|
3569
|
+
return /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children: presence.unmounted ? null : /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) }) });
|
|
3570
|
+
});
|
|
3571
|
+
TabContent.displayName = "TabContent";
|
|
3572
|
+
const TabIndicator = forwardRef((props, ref) => {
|
|
3573
|
+
const tabs = useTabsContext();
|
|
3574
|
+
const mergedProps = mergeProps(tabs.getIndicatorProps(), props);
|
|
3575
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
3576
|
+
});
|
|
3577
|
+
TabIndicator.displayName = "TabIndicator";
|
|
3547
3578
|
const TabList = forwardRef((props, ref) => {
|
|
3548
3579
|
const tabs = useTabsContext();
|
|
3549
3580
|
const mergedProps = mergeProps(tabs.getListProps(), props);
|
|
@@ -5943,16 +5974,16 @@ const dialogRecipe = sva({
|
|
|
5943
5974
|
}
|
|
5944
5975
|
}
|
|
5945
5976
|
});
|
|
5946
|
-
const { withRootProvider: withRootProvider$
|
|
5947
|
-
const Root$
|
|
5948
|
-
const Backdrop$1 = withContext$
|
|
5949
|
-
const Trigger$
|
|
5950
|
-
const Content$
|
|
5951
|
-
const Title = withContext$
|
|
5952
|
-
const Description$1 = withContext$
|
|
5953
|
-
const Positioner = withContext$
|
|
5954
|
-
const Header = withContext$
|
|
5955
|
-
const Footer = withContext$
|
|
5977
|
+
const { withRootProvider: withRootProvider$2, withContext: withContext$3 } = createStyleContext(dialogRecipe);
|
|
5978
|
+
const Root$3 = withRootProvider$2(DialogRoot);
|
|
5979
|
+
const Backdrop$1 = withContext$3(DialogBackdrop, "backdrop");
|
|
5980
|
+
const Trigger$2 = withContext$3(DialogTrigger, "trigger");
|
|
5981
|
+
const Content$2 = withContext$3(DialogContent, "content");
|
|
5982
|
+
const Title = withContext$3(DialogTitle, "title");
|
|
5983
|
+
const Description$1 = withContext$3(DialogDescription, "description");
|
|
5984
|
+
const Positioner = withContext$3(DialogPositioner, "positioner");
|
|
5985
|
+
const Header = withContext$3(ark.header, "header");
|
|
5986
|
+
const Footer = withContext$3(
|
|
5956
5987
|
({ orientation = "horizontal", className, ...props }) => {
|
|
5957
5988
|
return /* @__PURE__ */ jsx(
|
|
5958
5989
|
ark.footer,
|
|
@@ -5970,13 +6001,13 @@ const Footer = withContext$2(
|
|
|
5970
6001
|
},
|
|
5971
6002
|
"footer"
|
|
5972
6003
|
);
|
|
5973
|
-
const Body = withContext$
|
|
5974
|
-
const CloseTrigger = withContext$
|
|
6004
|
+
const Body = withContext$3(ark.main, "body");
|
|
6005
|
+
const CloseTrigger = withContext$3(DialogCloseTrigger, "closeTrigger");
|
|
5975
6006
|
const Dialog = {
|
|
5976
|
-
Root: Root$
|
|
6007
|
+
Root: Root$3,
|
|
5977
6008
|
Backdrop: Backdrop$1,
|
|
5978
|
-
Trigger: Trigger$
|
|
5979
|
-
Content: Content$
|
|
6009
|
+
Trigger: Trigger$2,
|
|
6010
|
+
Content: Content$2,
|
|
5980
6011
|
Title,
|
|
5981
6012
|
Description: Description$1,
|
|
5982
6013
|
Positioner,
|
|
@@ -9896,20 +9927,20 @@ const navigationRecipe = sva({
|
|
|
9896
9927
|
}
|
|
9897
9928
|
}
|
|
9898
9929
|
});
|
|
9899
|
-
const { withRootProvider, withContext: withContext$
|
|
9900
|
-
const Root$
|
|
9901
|
-
const Trigger = withContext$
|
|
9930
|
+
const { withRootProvider: withRootProvider$1, withContext: withContext$2 } = createStyleContext(navigationRecipe);
|
|
9931
|
+
const Root$2 = withRootProvider$1(TabsRoot);
|
|
9932
|
+
const Trigger$1 = withContext$2(
|
|
9902
9933
|
({ icon, label, ...props }) => /* @__PURE__ */ jsxs(TabTrigger, { ...props, children: [
|
|
9903
9934
|
icon,
|
|
9904
9935
|
label
|
|
9905
9936
|
] }),
|
|
9906
9937
|
"trigger"
|
|
9907
9938
|
);
|
|
9908
|
-
const List = withContext$
|
|
9939
|
+
const List$1 = withContext$2(TabList, "list");
|
|
9909
9940
|
const Navigation = {
|
|
9910
|
-
Root: Root$
|
|
9911
|
-
Item: Trigger,
|
|
9912
|
-
List
|
|
9941
|
+
Root: Root$2,
|
|
9942
|
+
Item: Trigger$1,
|
|
9943
|
+
List: List$1
|
|
9913
9944
|
};
|
|
9914
9945
|
const tagRecipe = cva({
|
|
9915
9946
|
base: {
|
|
@@ -10430,6 +10461,169 @@ const Textarea = forwardRef(
|
|
|
10430
10461
|
);
|
|
10431
10462
|
Textarea.displayName = "Textarea";
|
|
10432
10463
|
const index = memo$1(Textarea);
|
|
10464
|
+
const tabsRecipe = sva({
|
|
10465
|
+
className: "tabs",
|
|
10466
|
+
slots: anatomy$1.keys(),
|
|
10467
|
+
base: {
|
|
10468
|
+
root: {
|
|
10469
|
+
display: "flex",
|
|
10470
|
+
width: "full",
|
|
10471
|
+
flexDirection: "column"
|
|
10472
|
+
},
|
|
10473
|
+
list: {
|
|
10474
|
+
display: "flex",
|
|
10475
|
+
flexShrink: "0",
|
|
10476
|
+
flexDirection: "row",
|
|
10477
|
+
overflowX: "auto",
|
|
10478
|
+
position: "relative",
|
|
10479
|
+
scrollbarWidth: "none",
|
|
10480
|
+
"&::-webkit-scrollbar": {
|
|
10481
|
+
display: "none"
|
|
10482
|
+
}
|
|
10483
|
+
},
|
|
10484
|
+
trigger: {
|
|
10485
|
+
alignItems: "center",
|
|
10486
|
+
color: "content.neutral.subtlest",
|
|
10487
|
+
cursor: "pointer",
|
|
10488
|
+
display: "inline-flex",
|
|
10489
|
+
flexShrink: "0",
|
|
10490
|
+
gap: "2",
|
|
10491
|
+
justifyContent: "center",
|
|
10492
|
+
px: "4",
|
|
10493
|
+
py: "2",
|
|
10494
|
+
textStyle: "label.md",
|
|
10495
|
+
transition: "all",
|
|
10496
|
+
transitionDuration: "normal",
|
|
10497
|
+
transitionTimingFunction: "default",
|
|
10498
|
+
whiteSpace: "nowrap",
|
|
10499
|
+
_disabled: {
|
|
10500
|
+
color: "content.neutral.disabled",
|
|
10501
|
+
cursor: "not-allowed"
|
|
10502
|
+
},
|
|
10503
|
+
_hover: {
|
|
10504
|
+
color: "content.neutral.hovered"
|
|
10505
|
+
},
|
|
10506
|
+
_selected: {
|
|
10507
|
+
color: "content.neutral.bold"
|
|
10508
|
+
}
|
|
10509
|
+
},
|
|
10510
|
+
content: {
|
|
10511
|
+
pt: "4"
|
|
10512
|
+
},
|
|
10513
|
+
indicator: {
|
|
10514
|
+
width: "var(--width)",
|
|
10515
|
+
height: "2px",
|
|
10516
|
+
borderRadius: "xs",
|
|
10517
|
+
background: "content.neutral.bold",
|
|
10518
|
+
bottom: "0px"
|
|
10519
|
+
}
|
|
10520
|
+
},
|
|
10521
|
+
variants: {
|
|
10522
|
+
variant: {
|
|
10523
|
+
line: {
|
|
10524
|
+
list: {
|
|
10525
|
+
borderBottomWidth: "1px",
|
|
10526
|
+
borderColor: "background.neutral.selected"
|
|
10527
|
+
}
|
|
10528
|
+
},
|
|
10529
|
+
enclosed: {
|
|
10530
|
+
list: {
|
|
10531
|
+
p: "16px 0 0 16px",
|
|
10532
|
+
borderRadius: "md",
|
|
10533
|
+
gap: "16"
|
|
10534
|
+
},
|
|
10535
|
+
trigger: {
|
|
10536
|
+
borderRadius: "full",
|
|
10537
|
+
_selected: {
|
|
10538
|
+
background: "background.neutral.selected"
|
|
10539
|
+
}
|
|
10540
|
+
},
|
|
10541
|
+
indicator: {
|
|
10542
|
+
display: "none"
|
|
10543
|
+
}
|
|
10544
|
+
}
|
|
10545
|
+
},
|
|
10546
|
+
fitted: {
|
|
10547
|
+
true: {
|
|
10548
|
+
root: {
|
|
10549
|
+
width: "100%"
|
|
10550
|
+
},
|
|
10551
|
+
list: {
|
|
10552
|
+
width: "100%",
|
|
10553
|
+
p: 1,
|
|
10554
|
+
overflowX: "visible"
|
|
10555
|
+
},
|
|
10556
|
+
trigger: {
|
|
10557
|
+
flex: 1,
|
|
10558
|
+
justifyContent: "center",
|
|
10559
|
+
overflow: "hidden",
|
|
10560
|
+
textOverflow: "ellipsis",
|
|
10561
|
+
whiteSpace: "nowrap"
|
|
10562
|
+
}
|
|
10563
|
+
}
|
|
10564
|
+
},
|
|
10565
|
+
bottomLine: {
|
|
10566
|
+
true: {
|
|
10567
|
+
list: {
|
|
10568
|
+
borderBottomWidth: "1px",
|
|
10569
|
+
borderColor: "background.neutral.selected"
|
|
10570
|
+
}
|
|
10571
|
+
},
|
|
10572
|
+
false: {
|
|
10573
|
+
list: {
|
|
10574
|
+
borderBottomWidth: "0px"
|
|
10575
|
+
}
|
|
10576
|
+
}
|
|
10577
|
+
},
|
|
10578
|
+
shadow: {
|
|
10579
|
+
true: {
|
|
10580
|
+
list: {
|
|
10581
|
+
boxShadow: "0px 8px 12px 0px var(--colors-semantic-shadow-overlay, rgba(0, 0, 0, 0.08))"
|
|
10582
|
+
}
|
|
10583
|
+
}
|
|
10584
|
+
}
|
|
10585
|
+
},
|
|
10586
|
+
compoundVariants: [
|
|
10587
|
+
{
|
|
10588
|
+
variant: "enclosed",
|
|
10589
|
+
fitted: true,
|
|
10590
|
+
css: {
|
|
10591
|
+
list: {
|
|
10592
|
+
background: "background.neutral.default",
|
|
10593
|
+
borderRadius: "full"
|
|
10594
|
+
}
|
|
10595
|
+
}
|
|
10596
|
+
},
|
|
10597
|
+
{
|
|
10598
|
+
variant: "enclosed",
|
|
10599
|
+
bottomLine: true,
|
|
10600
|
+
css: {
|
|
10601
|
+
list: {
|
|
10602
|
+
borderBottomWidth: "0px"
|
|
10603
|
+
}
|
|
10604
|
+
}
|
|
10605
|
+
}
|
|
10606
|
+
],
|
|
10607
|
+
defaultVariants: {
|
|
10608
|
+
variant: "line",
|
|
10609
|
+
fitted: false,
|
|
10610
|
+
bottomLine: true,
|
|
10611
|
+
shadow: false
|
|
10612
|
+
}
|
|
10613
|
+
});
|
|
10614
|
+
const { withRootProvider, withContext: withContext$1 } = createStyleContext(tabsRecipe);
|
|
10615
|
+
const Root$1 = withRootProvider(TabsRoot);
|
|
10616
|
+
const List = withContext$1(TabList, "list");
|
|
10617
|
+
const Trigger = withContext$1(TabTrigger, "trigger");
|
|
10618
|
+
const Content$1 = withContext$1(TabContent, "content");
|
|
10619
|
+
const Indicator = withContext$1(TabIndicator, "indicator");
|
|
10620
|
+
const Tabs = Object.assign(Root$1, {
|
|
10621
|
+
Root: Root$1,
|
|
10622
|
+
List,
|
|
10623
|
+
Trigger,
|
|
10624
|
+
Content: Content$1,
|
|
10625
|
+
Indicator
|
|
10626
|
+
});
|
|
10433
10627
|
function definePreset(preset2) {
|
|
10434
10628
|
return preset2;
|
|
10435
10629
|
}
|
|
@@ -11010,6 +11204,7 @@ export {
|
|
|
11010
11204
|
Portal,
|
|
11011
11205
|
Spinner,
|
|
11012
11206
|
Stack2 as Stack,
|
|
11207
|
+
Tabs,
|
|
11013
11208
|
index$2 as Tag,
|
|
11014
11209
|
Text,
|
|
11015
11210
|
index as TextArea,
|