@nation-a/ui 0.5.0 → 0.5.1

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 CHANGED
@@ -2172,6 +2172,12 @@ const DialogBackdrop = React.forwardRef((props, ref) => {
2172
2172
  return /* @__PURE__ */ jsxRuntime.jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });
2173
2173
  });
2174
2174
  DialogBackdrop.displayName = "DialogBackdrop";
2175
+ const DialogCloseTrigger = React.forwardRef((props, ref) => {
2176
+ const dialog = useDialogContext();
2177
+ const mergedProps = mergeProps(dialog.getCloseTriggerProps(), props);
2178
+ return /* @__PURE__ */ jsxRuntime.jsx(ark.button, { ...mergedProps, ref });
2179
+ });
2180
+ DialogCloseTrigger.displayName = "DialogCloseTrigger";
2175
2181
  const DialogContent = React.forwardRef((props, ref) => {
2176
2182
  const dialog = useDialogContext();
2177
2183
  const presence = usePresenceContext();
@@ -3717,6 +3723,14 @@ const textRecipe = cva({
3717
3723
  variant: "body.md"
3718
3724
  },
3719
3725
  variants: {
3726
+ font: {
3727
+ inter: {
3728
+ fontFamily: "inter"
3729
+ },
3730
+ notoSans: {
3731
+ fontFamily: "notoSans"
3732
+ }
3733
+ },
3720
3734
  variant: {
3721
3735
  "display.lg": {
3722
3736
  textStyle: "display.lg"
@@ -3736,6 +3750,9 @@ const textRecipe = cva({
3736
3750
  "title.md": {
3737
3751
  textStyle: "title.md"
3738
3752
  },
3753
+ "title.sm": {
3754
+ textStyle: "title.sm"
3755
+ },
3739
3756
  "body.lg": {
3740
3757
  textStyle: "body.lg"
3741
3758
  },
@@ -3755,7 +3772,7 @@ const textRecipe = cva({
3755
3772
  }
3756
3773
  });
3757
3774
  const Text = React.forwardRef((props, ref) => {
3758
- const { variant = "body.md", children, ...rest } = props;
3775
+ const { variant = "body.md", font = "notoSans", children, ...rest } = props;
3759
3776
  const textType = (variant == null ? void 0 : variant.split(".")[0]) || "body";
3760
3777
  const componentMap = {
3761
3778
  display: styled("h1", textRecipe),
@@ -3765,7 +3782,7 @@ const Text = React.forwardRef((props, ref) => {
3765
3782
  label: styled("span", textRecipe)
3766
3783
  };
3767
3784
  const TextComponent = componentMap[textType];
3768
- return /* @__PURE__ */ jsxRuntime.jsx(TextComponent, { ref, textStyle: variant, ...rest, children });
3785
+ return /* @__PURE__ */ jsxRuntime.jsx(TextComponent, { ref, textStyle: variant, font, ...rest, children });
3769
3786
  });
3770
3787
  Text.displayName = "Text";
3771
3788
  const shouldForwardProp = (prop, variantKeys, options = {}) => {
@@ -3815,7 +3832,7 @@ const createStyleContext = (recipe) => {
3815
3832
  };
3816
3833
  const dialogRecipe = sva({
3817
3834
  className: "dialog",
3818
- slots: anatomy.keys(),
3835
+ slots: [...anatomy.keys(), "header", "footer", "body"],
3819
3836
  base: {
3820
3837
  backdrop: {
3821
3838
  backdropFilter: "blur(4px)",
@@ -3844,17 +3861,22 @@ const dialogRecipe = sva({
3844
3861
  overflow: "auto",
3845
3862
  position: "fixed",
3846
3863
  top: "0",
3847
- width: "full",
3848
- height: "full",
3849
- zIndex: "modal"
3864
+ width: "100vw",
3865
+ height: "100vh",
3866
+ zIndex: "modal",
3867
+ p: "4"
3850
3868
  },
3851
3869
  content: {
3852
- background: "white",
3853
- borderRadius: "sm",
3854
- boxShadow: "overlay",
3855
- minW: "sm",
3856
3870
  position: "relative",
3857
- p: "3",
3871
+ backgroundColor: "surface.layer_1",
3872
+ borderRadius: "lg",
3873
+ width: "full",
3874
+ minW: "xs",
3875
+ maxW: "md",
3876
+ display: "flex",
3877
+ flexDirection: "column",
3878
+ gap: "6",
3879
+ py: "4",
3858
3880
  _open: {
3859
3881
  animation: "dialog-in"
3860
3882
  },
@@ -3862,12 +3884,36 @@ const dialogRecipe = sva({
3862
3884
  animation: "dialog-out"
3863
3885
  }
3864
3886
  },
3887
+ closeTrigger: {
3888
+ position: "absolute",
3889
+ top: "4",
3890
+ right: "4"
3891
+ },
3865
3892
  title: {
3866
- textStyle: "title.lg"
3893
+ display: "flex",
3894
+ alignItems: "center",
3895
+ gap: "1",
3896
+ color: "content.neutral.default",
3897
+ textStyle: "headline.sm"
3867
3898
  },
3868
3899
  description: {
3869
- color: "content.neutral.default_inverse",
3900
+ color: "content.neutral.default",
3870
3901
  textStyle: "body.md"
3902
+ },
3903
+ header: {
3904
+ display: "flex",
3905
+ flexDirection: "column",
3906
+ gap: "2",
3907
+ px: "6"
3908
+ },
3909
+ footer: {
3910
+ display: "flex",
3911
+ gap: "2",
3912
+ px: "4",
3913
+ justifyContent: "flex-end"
3914
+ },
3915
+ body: {
3916
+ px: "4"
3871
3917
  }
3872
3918
  }
3873
3919
  });
@@ -3879,6 +3925,27 @@ const Content = withContext(DialogContent, "content");
3879
3925
  const Title = withContext(DialogTitle, "title");
3880
3926
  const Description = withContext(DialogDescription, "description");
3881
3927
  const Positioner = withContext(DialogPositioner, "positioner");
3928
+ const Header = withContext(ark.header, "header");
3929
+ const Footer = withContext(
3930
+ ({ orientation = "horizontal", className, ...props }) => {
3931
+ return /* @__PURE__ */ jsxRuntime.jsx(
3932
+ ark.footer,
3933
+ {
3934
+ className: cx(
3935
+ css$1({
3936
+ display: "flex",
3937
+ flexDirection: orientation === "horizontal" ? "row" : "column"
3938
+ }),
3939
+ className
3940
+ ),
3941
+ ...props
3942
+ }
3943
+ );
3944
+ },
3945
+ "footer"
3946
+ );
3947
+ const Body = withContext(ark.main, "body");
3948
+ const CloseTrigger = withContext(DialogCloseTrigger, "closeTrigger");
3882
3949
  const Dialog = {
3883
3950
  Root,
3884
3951
  Backdrop: Backdrop$1,
@@ -3886,7 +3953,11 @@ const Dialog = {
3886
3953
  Content,
3887
3954
  Title,
3888
3955
  Description,
3889
- Positioner
3956
+ Positioner,
3957
+ Header,
3958
+ Footer,
3959
+ Body,
3960
+ CloseTrigger
3890
3961
  };
3891
3962
  const iconButtonRecipe = cva({
3892
3963
  base: {