Blame view

天文台pc/tianwentai-ui/node_modules/@radix-ui/react-separator/dist/index.mjs 1.09 KB
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  // packages/react/separator/src/separator.tsx
  import * as React from "react";
  import { Primitive } from "@radix-ui/react-primitive";
  import { jsx } from "react/jsx-runtime";
  var NAME = "Separator";
  var DEFAULT_ORIENTATION = "horizontal";
  var ORIENTATIONS = ["horizontal", "vertical"];
  var Separator = React.forwardRef((props, forwardedRef) => {
    const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
    const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
    const ariaOrientation = orientation === "vertical" ? orientation : void 0;
    const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
    return /* @__PURE__ */ jsx(
      Primitive.div,
      {
        "data-orientation": orientation,
        ...semanticProps,
        ...domProps,
        ref: forwardedRef
      }
    );
  });
  Separator.displayName = NAME;
  function isValidOrientation(orientation) {
    return ORIENTATIONS.includes(orientation);
  }
  var Root = Separator;
  export {
    Root,
    Separator
  };
  //# sourceMappingURL=index.mjs.map