@serendie/ui 3.5.1-dev.202606160617 → 3.5.1-dev.202606240117

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.
@@ -1,8 +1,19 @@
1
- import { ComponentProps } from 'react';
2
- export declare const ListItemStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"title" | "description" | "root" | "badge" | "leftIcon" | "rightIcon" | "wrapper" | "textGroup", {
3
- isLargeLeftIcon: {
1
+ import { default as React, ComponentProps } from 'react';
2
+ export declare const ListItemStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"title" | "description" | "root" | "badge" | "wrapper" | "textGroup" | "subDescription" | "trailingElement" | "headingElement", {
3
+ isLargeHeadingElement: {
4
4
  true: {
5
- leftIcon: {
5
+ headingElement: {
6
+ "& svg": {
7
+ width: "40px";
8
+ height: "40px";
9
+ };
10
+ };
11
+ };
12
+ false: {};
13
+ };
14
+ isLargeTrailingElement: {
15
+ true: {
16
+ trailingElement: {
6
17
  "& svg": {
7
18
  width: "40px";
8
19
  height: "40px";
@@ -22,25 +33,44 @@ export declare const ListItemStyle: import('../../../styled-system/types').SlotR
22
33
  type ListItemBaseProps = {
23
34
  title: string;
24
35
  description?: string;
25
- rightIcon?: React.ReactElement;
26
- leftIcon?: React.ReactElement;
27
- isLargeLeftIcon?: boolean;
36
+ subDescription?: string;
37
+ trailingElement?: React.ReactElement;
38
+ headingElement?: React.ReactElement;
39
+ isLargeHeadingElement?: boolean;
40
+ isLargeTrailingElement?: boolean;
28
41
  badge?: number;
29
42
  children?: React.ReactNode;
30
43
  disabled?: boolean;
31
44
  selected?: boolean;
32
45
  focusVisible?: boolean;
33
46
  size?: "small";
47
+ /** @deprecated `leftIcon` は廃止予定です。`headingElement` を使ってください */
48
+ leftIcon?: React.ReactElement;
49
+ /** @deprecated `rightIcon` は廃止予定です。`trailingElement` を使ってください */
50
+ rightIcon?: React.ReactElement;
51
+ /** @deprecated `isLargeLeftIcon` は廃止予定です。`isLargeHeadingElement` を使ってください */
52
+ isLargeLeftIcon?: boolean;
53
+ /** @deprecated `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください */
54
+ isLargeRightIcon?: boolean;
34
55
  };
35
- type ExclusiveRightItemProps = ({
56
+ type ExclusiveTrailingItemProps = ({
36
57
  badge?: number;
37
58
  } & {
59
+ trailingElement?: never;
60
+ isLargeTrailingElement?: never;
61
+ /** @deprecated `rightIcon` は廃止予定です。`trailingElement` を使ってください */
38
62
  rightIcon?: never;
39
- }) | ({
63
+ /** @deprecated `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください */
64
+ isLargeRightIcon?: never;
65
+ }) | {
40
66
  badge?: never;
41
- } & {
67
+ trailingElement?: React.ReactElement;
68
+ isLargeTrailingElement?: boolean;
69
+ /** @deprecated `rightIcon` は廃止予定です。`trailingElement` を使ってください */
42
70
  rightIcon?: React.ReactElement;
43
- });
44
- type ListItemProps = ComponentProps<"li"> & ListItemBaseProps & ExclusiveRightItemProps;
71
+ /** @deprecated `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください */
72
+ isLargeRightIcon?: boolean;
73
+ };
74
+ type ListItemProps = ComponentProps<"li"> & ListItemBaseProps & ExclusiveTrailingItemProps;
45
75
  export declare const ListItem: React.FC<ListItemProps>;
46
76
  export {};
@@ -1,17 +1,19 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import { NotificationBadge as b } from "../NotificationBadge/NotificationBadge.js";
3
- import { cx as o } from "../../styled-system/css/cx.js";
4
- import { css as c } from "../../styled-system/css/css.js";
5
- import { sva as v } from "../../styled-system/css/sva.js";
6
- const p = v({
1
+ import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
+ import { useRef as D, useEffect as G } from "react";
3
+ import { NotificationBadge as O } from "../NotificationBadge/NotificationBadge.js";
4
+ import { cx as i } from "../../styled-system/css/cx.js";
5
+ import { css as g } from "../../styled-system/css/css.js";
6
+ import { sva as P } from "../../styled-system/css/sva.js";
7
+ const E = P({
7
8
  slots: [
8
9
  "root",
9
10
  "wrapper",
10
11
  "textGroup",
11
12
  "title",
12
13
  "description",
13
- "rightIcon",
14
- "leftIcon",
14
+ "subDescription",
15
+ "trailingElement",
16
+ "headingElement",
15
17
  "badge"
16
18
  ],
17
19
  base: {
@@ -64,8 +66,6 @@ const p = v({
64
66
  }
65
67
  },
66
68
  description: {
67
- display: "flex",
68
- flexDirection: "column",
69
69
  textStyle: "sd.system.typography.body.extraSmall_compact",
70
70
  color: "sd.system.color.component.onSurfaceVariant",
71
71
  _expanded: {
@@ -75,7 +75,17 @@ const p = v({
75
75
  opacity: 0.3
76
76
  }
77
77
  },
78
- leftIcon: {
78
+ subDescription: {
79
+ textStyle: "sd.system.typography.body.extraSmall_compact",
80
+ color: "sd.system.color.component.onSurfaceVariant",
81
+ _expanded: {
82
+ textStyle: "sd.system.typography.body.extraSmall_expanded"
83
+ },
84
+ _disabled: {
85
+ opacity: 0.3
86
+ }
87
+ },
88
+ headingElement: {
79
89
  flexShrink: 0,
80
90
  "& svg": {
81
91
  display: "block",
@@ -88,7 +98,7 @@ const p = v({
88
98
  opacity: 0.3
89
99
  }
90
100
  },
91
- rightIcon: {
101
+ trailingElement: {
92
102
  flexShrink: 0,
93
103
  "& svg": {
94
104
  width: "24px",
@@ -99,17 +109,24 @@ const p = v({
99
109
  }
100
110
  },
101
111
  badge: {
102
- position: "absolute",
103
- right: "sd.system.dimension.spacing.medium",
104
- top: "sd.system.dimension.spacing.extraSmall",
105
- height: 24,
106
- minW: 24
112
+ flexShrink: 0
107
113
  }
108
114
  },
109
115
  variants: {
110
- isLargeLeftIcon: {
116
+ isLargeHeadingElement: {
117
+ true: {
118
+ headingElement: {
119
+ "& svg": {
120
+ width: "40px",
121
+ height: "40px"
122
+ }
123
+ }
124
+ },
125
+ false: {}
126
+ },
127
+ isLargeTrailingElement: {
111
128
  true: {
112
- leftIcon: {
129
+ trailingElement: {
113
130
  "& svg": {
114
131
  width: "40px",
115
132
  height: "40px"
@@ -126,65 +143,95 @@ const p = v({
126
143
  }
127
144
  }
128
145
  }
129
- }), L = ({
130
- leftIcon: a,
146
+ }), Y = ({
147
+ headingElement: v,
148
+ trailingElement: b,
149
+ title: w,
150
+ description: s,
151
+ subDescription: a,
152
+ badge: n,
153
+ children: S,
154
+ disabled: _,
155
+ selected: L,
156
+ focusVisible: N,
157
+ className: H,
158
+ leftIcon: l,
131
159
  rightIcon: r,
132
- title: m,
133
- description: i,
134
- badge: l,
135
- children: d,
136
- disabled: x,
137
- selected: y,
138
- focusVisible: g,
139
- className: h,
140
- ...n
160
+ isLargeLeftIcon: o,
161
+ isLargeRightIcon: d,
162
+ ...m
141
163
  }) => {
142
- const [u, f] = p.splitVariantProps(n), e = p(u);
143
- return /* @__PURE__ */ s("li", { className: o(e.root, h), ...f, children: [
144
- /* @__PURE__ */ s(
145
- "div",
146
- {
147
- tabIndex: 1,
148
- className: o(
149
- e.wrapper,
150
- i && c({ alignItems: "flex-start" })
164
+ const y = D(!1);
165
+ G(() => {
166
+ y.current || process.env.NODE_ENV !== "production" && (l || r || o || d) && (y.current = !0, l && console.warn(
167
+ "[ListItem] `leftIcon` は廃止予定です。`headingElement` を使ってください。"
168
+ ), r && console.warn(
169
+ "[ListItem] `rightIcon` は廃止予定です。`trailingElement` を使ってください。"
170
+ ), o && console.warn(
171
+ "[ListItem] `isLargeLeftIcon` は廃止予定です。`isLargeHeadingElement` を使ってください。"
172
+ ), d && console.warn(
173
+ "[ListItem] `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください。"
174
+ ));
175
+ }, []);
176
+ const x = v ?? l, h = b ?? r, c = m.isLargeHeadingElement ?? o, u = m.isLargeTrailingElement ?? d, [T, k] = E.splitVariantProps(m), e = E({
177
+ ...T,
178
+ isLargeHeadingElement: c,
179
+ isLargeTrailingElement: u
180
+ }), p = (!!s || !!a) && !(!!c && !!s && !a), I = i(
181
+ e.wrapper,
182
+ p && g({ alignItems: "flex-start" })
183
+ ), V = i(
184
+ e.headingElement,
185
+ p && g({ marginTop: "sd.system.dimension.spacing.twoExtraSmall" })
186
+ ), C = i(
187
+ e.trailingElement,
188
+ p && g({ marginTop: "sd.system.dimension.spacing.twoExtraSmall" })
189
+ );
190
+ return /* @__PURE__ */ t("li", { className: i(e.root, H), ...k, children: /* @__PURE__ */ f(
191
+ "div",
192
+ {
193
+ tabIndex: 1,
194
+ className: I,
195
+ "data-disabled": _ ? !0 : void 0,
196
+ "data-selected": L ? !0 : void 0,
197
+ "data-focus-visible": N ? !0 : void 0,
198
+ children: [
199
+ x && /* @__PURE__ */ t(
200
+ "div",
201
+ {
202
+ className: V,
203
+ style: c ? { padding: "0", width: "40px", height: "40px" } : { padding: "0", width: "24px", height: "24px" },
204
+ children: x
205
+ }
151
206
  ),
152
- "data-disabled": x ? !0 : void 0,
153
- "data-selected": y ? !0 : void 0,
154
- "data-focus-visible": g ? !0 : void 0,
155
- children: [
156
- a && /* @__PURE__ */ t(
157
- "div",
158
- {
159
- className: e.leftIcon,
160
- style: n.isLargeLeftIcon ? { padding: "0", width: "40px", height: "40px" } : { padding: "0", width: "24px", height: "24px" },
161
- children: a
162
- }
163
- ),
164
- /* @__PURE__ */ s(
165
- "div",
166
- {
167
- className: o(
168
- e.textGroup,
169
- (!!i || !!d) && c({ alignItems: "flex-start" })
170
- ),
171
- children: [
172
- /* @__PURE__ */ t("span", { className: e.title, children: m }),
173
- /* @__PURE__ */ s("div", { className: e.description, children: [
174
- i,
175
- d
176
- ] })
177
- ]
178
- }
179
- ),
180
- r && /* @__PURE__ */ t("div", { className: e.rightIcon, children: r })
181
- ]
182
- }
183
- ),
184
- l && /* @__PURE__ */ t("div", { className: e.badge, children: /* @__PURE__ */ t(b, { count: l, variant: "secondary" }) })
185
- ] });
207
+ /* @__PURE__ */ f("div", { className: e.textGroup, children: [
208
+ /* @__PURE__ */ t("span", { className: e.title, children: w }),
209
+ s && /* @__PURE__ */ t("span", { className: e.description, children: s }),
210
+ a && /* @__PURE__ */ t("span", { className: e.subDescription, children: a }),
211
+ S
212
+ ] }),
213
+ h && /* @__PURE__ */ t(
214
+ "div",
215
+ {
216
+ className: C,
217
+ style: u ? { width: "40px", height: "40px" } : { width: "24px", height: "24px" },
218
+ children: h
219
+ }
220
+ ),
221
+ n != null && n > 0 && /* @__PURE__ */ t("div", { className: e.badge, children: /* @__PURE__ */ t(
222
+ O,
223
+ {
224
+ count: n,
225
+ variant: "secondary",
226
+ size: "small",
227
+ position: "relative"
228
+ }
229
+ ) })
230
+ ]
231
+ }
232
+ ) });
186
233
  };
187
234
  export {
188
- L as ListItem,
189
- p as ListItemStyle
235
+ Y as ListItem,
236
+ E as ListItemStyle
190
237
  };
@@ -14,6 +14,8 @@ export declare const dictionary: {
14
14
  readonly "pagination.nextPage": "次のページへ";
15
15
  readonly "pagination.goToPage": "ページ{{page}}へ移動";
16
16
  readonly "modalDialog.close": "閉じる";
17
+ readonly "breadcrumbs.label": "パンくずリスト";
18
+ readonly "breadcrumbs.showMore": "折りたたまれた項目を表示";
17
19
  };
18
20
  readonly en: {
19
21
  readonly "common.required": "Required";
@@ -30,5 +32,7 @@ export declare const dictionary: {
30
32
  readonly "pagination.nextPage": "Go to next page";
31
33
  readonly "pagination.goToPage": "Go to page {{page}}";
32
34
  readonly "modalDialog.close": "Close";
35
+ readonly "breadcrumbs.label": "Breadcrumb";
36
+ readonly "breadcrumbs.showMore": "Show more breadcrumbs";
33
37
  };
34
38
  };
@@ -1,4 +1,4 @@
1
- const a = {
1
+ const e = {
2
2
  ja: {
3
3
  "common.required": "必須",
4
4
  "textField.clearValue": "値をクリア",
@@ -13,7 +13,9 @@ const a = {
13
13
  "pagination.lastPage": "最後のページです",
14
14
  "pagination.nextPage": "次のページへ",
15
15
  "pagination.goToPage": "ページ{{page}}へ移動",
16
- "modalDialog.close": "閉じる"
16
+ "modalDialog.close": "閉じる",
17
+ "breadcrumbs.label": "パンくずリスト",
18
+ "breadcrumbs.showMore": "折りたたまれた項目を表示"
17
19
  },
18
20
  en: {
19
21
  "common.required": "Required",
@@ -29,9 +31,11 @@ const a = {
29
31
  "pagination.lastPage": "This is the last page",
30
32
  "pagination.nextPage": "Go to next page",
31
33
  "pagination.goToPage": "Go to page {{page}}",
32
- "modalDialog.close": "Close"
34
+ "modalDialog.close": "Close",
35
+ "breadcrumbs.label": "Breadcrumb",
36
+ "breadcrumbs.showMore": "Show more breadcrumbs"
33
37
  }
34
38
  };
35
39
  export {
36
- a as dictionary
40
+ e as dictionary
37
41
  };
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './components/Accordion/index.ts';
5
5
  export * from './components/Avatar/index.ts';
6
6
  export * from './components/Badge/index.ts';
7
7
  export * from './components/Banner/index.ts';
8
+ export * from './components/Breadcrumbs/index.ts';
8
9
  export * from './components/BottomNavigation/index.ts';
9
10
  export * from './components/Button/index.ts';
10
11
  export * from './components/Chart/index.ts';