@yamada-ui/breadcrumb 0.1.11 → 0.2.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.
@@ -2,26 +2,55 @@ import * as _yamada_ui_core from '@yamada-ui/core';
2
2
  import { HTMLUIProps, ThemeProps, CSSUIProps } from '@yamada-ui/core';
3
3
 
4
4
  type BreadcrumbOptions = {
5
+ /**
6
+ * The visual separator between each breadcrumb item.
7
+ *
8
+ * @default '/'
9
+ */
5
10
  separator?: string | JSX.Element;
11
+ /**
12
+ * The left and right margin applied to the separator.
13
+ *
14
+ * @default 'sm'
15
+ */
6
16
  gap?: CSSUIProps['mx'];
17
+ /**
18
+ * Props for ol element.
19
+ */
20
+ listProps?: HTMLUIProps<'ol'>;
7
21
  };
8
- type BreadcrumbProps = HTMLUIProps<'nav'> & ThemeProps<'Breadcrumb'> & BreadcrumbOptions;
22
+ type BreadcrumbProps = Omit<HTMLUIProps<'nav'>, 'gap'> & ThemeProps<'Breadcrumb'> & BreadcrumbOptions;
9
23
  declare const Breadcrumb: _yamada_ui_core.Component<"nav", BreadcrumbProps>;
10
- type BreadcrumbItemOptions = {
24
+ type BreadcrumbItemOptions = Pick<BreadcrumbProps, 'separator' | 'gap'> & {
25
+ /**
26
+ * If `true`, change to span element.
27
+ *
28
+ * @default false
29
+ */
11
30
  isCurrentPage?: boolean;
31
+ /**
32
+ * If `true`, not show separator.
33
+ *
34
+ * @default false
35
+ */
12
36
  isLastChild?: boolean;
13
- separator?: string | JSX.Element;
14
- gap?: CSSUIProps['mx'];
15
37
  };
16
38
  type BreadcrumbItemProps = HTMLUIProps<'li'> & BreadcrumbItemOptions;
17
39
  declare const BreadcrumbItem: _yamada_ui_core.Component<"li", BreadcrumbItemOptions>;
18
40
  type BreadcrumbLinkOptions = {
41
+ /**
42
+ * If `true`, change to span element.
43
+ *
44
+ * @default false
45
+ */
19
46
  isCurrentPage?: boolean;
20
- separator?: string | JSX.Element;
21
47
  };
22
48
  type BreadcrumbLinkProps = HTMLUIProps<'a'> & BreadcrumbLinkOptions;
23
49
  declare const BreadcrumbLink: _yamada_ui_core.Component<"a", BreadcrumbLinkProps>;
24
50
  type BreadcrumbSeparatorOptions = {
51
+ /**
52
+ * The CSS `margin-inline-start`, and `margin-inline-end` property.
53
+ */
25
54
  gap?: CSSUIProps['mx'];
26
55
  };
27
56
  type BreadcrumbSeparatorProps = HTMLUIProps<'span'> & BreadcrumbSeparatorOptions;
@@ -36,7 +36,14 @@ var [BreadcrumbProvider, useBreadcrumb] = (0, import_utils.createContext)({
36
36
  });
37
37
  var Breadcrumb = (0, import_core.forwardRef)((props, ref) => {
38
38
  const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Breadcrumb", props);
39
- const { className, children, separator = "/", gap = "sm", ...rest } = (0, import_core.omitThemeProps)(mergedProps);
39
+ const {
40
+ className,
41
+ children,
42
+ separator = "/",
43
+ gap = "sm",
44
+ listProps,
45
+ ...rest
46
+ } = (0, import_core.omitThemeProps)(mergedProps);
40
47
  const css = {
41
48
  display: "flex",
42
49
  alignItems: "center",
@@ -58,7 +65,7 @@ var Breadcrumb = (0, import_core.forwardRef)((props, ref) => {
58
65
  className: (0, import_utils.cx)("ui-breadcrumb", className),
59
66
  __css: styles.container,
60
67
  ...rest,
61
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.ol, { className: "ui-breadcrumb-list", __css: css, children: cloneChildren })
68
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.ol, { className: "ui-breadcrumb-list", ...listProps, __css: css, children: cloneChildren })
62
69
  }
63
70
  ) });
64
71
  });
@@ -92,13 +99,14 @@ var BreadcrumbItem = (0, import_core.forwardRef)(
92
99
  }
93
100
  );
94
101
  var BreadcrumbLink = (0, import_core.forwardRef)(
95
- ({ className, children, isCurrentPage, separator, ...rest }, ref) => {
102
+ ({ className, children, isCurrentPage, ...rest }, ref) => {
96
103
  const styles = useBreadcrumb();
97
104
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
98
105
  import_core.ui.a,
99
106
  {
100
107
  ref,
101
108
  as: !isCurrentPage ? "a" : "span",
109
+ "aria-current": isCurrentPage ? "page" : void 0,
102
110
  className: (0, import_utils.cx)("ui-breadcrumb-link", className),
103
111
  __css: styles.link,
104
112
  ...rest,
@@ -3,7 +3,7 @@ import {
3
3
  BreadcrumbItem,
4
4
  BreadcrumbLink,
5
5
  BreadcrumbSeparator
6
- } from "./chunk-T5TK2PER.mjs";
6
+ } from "./chunk-XFDKKENS.mjs";
7
7
  export {
8
8
  Breadcrumb,
9
9
  BreadcrumbItem,
@@ -14,7 +14,14 @@ var [BreadcrumbProvider, useBreadcrumb] = createContext({
14
14
  });
15
15
  var Breadcrumb = forwardRef((props, ref) => {
16
16
  const [styles, mergedProps] = useMultiComponentStyle("Breadcrumb", props);
17
- const { className, children, separator = "/", gap = "sm", ...rest } = omitThemeProps(mergedProps);
17
+ const {
18
+ className,
19
+ children,
20
+ separator = "/",
21
+ gap = "sm",
22
+ listProps,
23
+ ...rest
24
+ } = omitThemeProps(mergedProps);
18
25
  const css = {
19
26
  display: "flex",
20
27
  alignItems: "center",
@@ -36,7 +43,7 @@ var Breadcrumb = forwardRef((props, ref) => {
36
43
  className: cx("ui-breadcrumb", className),
37
44
  __css: styles.container,
38
45
  ...rest,
39
- children: /* @__PURE__ */ jsx(ui.ol, { className: "ui-breadcrumb-list", __css: css, children: cloneChildren })
46
+ children: /* @__PURE__ */ jsx(ui.ol, { className: "ui-breadcrumb-list", ...listProps, __css: css, children: cloneChildren })
40
47
  }
41
48
  ) });
42
49
  });
@@ -70,13 +77,14 @@ var BreadcrumbItem = forwardRef(
70
77
  }
71
78
  );
72
79
  var BreadcrumbLink = forwardRef(
73
- ({ className, children, isCurrentPage, separator, ...rest }, ref) => {
80
+ ({ className, children, isCurrentPage, ...rest }, ref) => {
74
81
  const styles = useBreadcrumb();
75
82
  return /* @__PURE__ */ jsx(
76
83
  ui.a,
77
84
  {
78
85
  ref,
79
86
  as: !isCurrentPage ? "a" : "span",
87
+ "aria-current": isCurrentPage ? "page" : void 0,
80
88
  className: cx("ui-breadcrumb-link", className),
81
89
  __css: styles.link,
82
90
  ...rest,
package/dist/index.js CHANGED
@@ -38,7 +38,14 @@ var [BreadcrumbProvider, useBreadcrumb] = (0, import_utils.createContext)({
38
38
  });
39
39
  var Breadcrumb = (0, import_core.forwardRef)((props, ref) => {
40
40
  const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Breadcrumb", props);
41
- const { className, children, separator = "/", gap = "sm", ...rest } = (0, import_core.omitThemeProps)(mergedProps);
41
+ const {
42
+ className,
43
+ children,
44
+ separator = "/",
45
+ gap = "sm",
46
+ listProps,
47
+ ...rest
48
+ } = (0, import_core.omitThemeProps)(mergedProps);
42
49
  const css = {
43
50
  display: "flex",
44
51
  alignItems: "center",
@@ -60,7 +67,7 @@ var Breadcrumb = (0, import_core.forwardRef)((props, ref) => {
60
67
  className: (0, import_utils.cx)("ui-breadcrumb", className),
61
68
  __css: styles.container,
62
69
  ...rest,
63
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.ol, { className: "ui-breadcrumb-list", __css: css, children: cloneChildren })
70
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.ol, { className: "ui-breadcrumb-list", ...listProps, __css: css, children: cloneChildren })
64
71
  }
65
72
  ) });
66
73
  });
@@ -94,13 +101,14 @@ var BreadcrumbItem = (0, import_core.forwardRef)(
94
101
  }
95
102
  );
96
103
  var BreadcrumbLink = (0, import_core.forwardRef)(
97
- ({ className, children, isCurrentPage, separator, ...rest }, ref) => {
104
+ ({ className, children, isCurrentPage, ...rest }, ref) => {
98
105
  const styles = useBreadcrumb();
99
106
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
100
107
  import_core.ui.a,
101
108
  {
102
109
  ref,
103
110
  as: !isCurrentPage ? "a" : "span",
111
+ "aria-current": isCurrentPage ? "page" : void 0,
104
112
  className: (0, import_utils.cx)("ui-breadcrumb-link", className),
105
113
  __css: styles.link,
106
114
  ...rest,
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  BreadcrumbItem,
4
4
  BreadcrumbLink,
5
5
  BreadcrumbSeparator
6
- } from "./chunk-T5TK2PER.mjs";
6
+ } from "./chunk-XFDKKENS.mjs";
7
7
  export {
8
8
  Breadcrumb,
9
9
  BreadcrumbItem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/breadcrumb",
3
- "version": "0.1.11",
3
+ "version": "0.2.0",
4
4
  "description": "Yamada UI breadcrumb component",
5
5
  "keywords": [
6
6
  "yamada",
@@ -35,7 +35,7 @@
35
35
  "url": "https://github.com/hirotomoyamada/yamada-ui/issues"
36
36
  },
37
37
  "dependencies": {
38
- "@yamada-ui/core": "0.3.0",
38
+ "@yamada-ui/core": "0.3.1",
39
39
  "@yamada-ui/utils": "0.1.1"
40
40
  },
41
41
  "devDependencies": {
@@ -70,6 +70,6 @@
70
70
  "build:fast": "tsup src",
71
71
  "clean": "rimraf dist .turbo",
72
72
  "typecheck": "tsc --noEmit",
73
- "gen:types": "tsx ../../../scripts/generate-types"
73
+ "gen:docs": "tsx ../../../scripts/generate-docs"
74
74
  }
75
75
  }