@k8o/arte-odyssey 10.0.0 → 10.1.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.
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
3
3
  //#region src/components/data-display/card/interactive-card.tsx
4
4
  const InteractiveCard = ({ children, width = "full", appearance = "shadow", ...rest }) => /* @__PURE__ */ jsx("div", {
5
5
  ...rest,
6
- className: cn("rounded-xl transition-transform hover:scale-[1.02] active:scale-[0.98]", appearance === "shadow" && "shadow-sm", appearance === "bordered" && "border border-border-mute", width === "full" && "w-full", width === "fit" && "w-fit", "bg-bg-base"),
6
+ className: cn("rounded-xl transition-transform hover:scale-[1.02] active:scale-[0.98]", appearance === "shadow" && "shadow-sm border border-transparent dark:border-border-subtle", appearance === "bordered" && "border border-border-mute", width === "full" && "w-full", width === "fit" && "w-fit", "bg-bg-base"),
7
7
  children
8
8
  });
9
9
  //#endregion
@@ -3,7 +3,7 @@ declare const CheckboxGroup: import("react").FC<{
3
3
  invalid?: boolean;
4
4
  required?: boolean;
5
5
  name: string;
6
- } & Omit<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, "className" | "style" | "name" | "defaultValue" | "onChange"> & {
6
+ } & Omit<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, "className" | "style" | "defaultValue" | "onChange" | "name"> & {
7
7
  children?: import("react").ReactNode | undefined;
8
8
  } & ({
9
9
  value: string[];
@@ -18,7 +18,7 @@ declare const CheckboxGroup: import("react").FC<{
18
18
  invalid?: boolean;
19
19
  required?: boolean;
20
20
  name: string;
21
- } & Omit<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, "className" | "style" | "name" | "defaultValue" | "onChange"> & {
21
+ } & Omit<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, "className" | "style" | "defaultValue" | "onChange" | "name"> & {
22
22
  children?: import("react").ReactNode | undefined;
23
23
  } & ({
24
24
  value: string[];
@@ -33,7 +33,7 @@ declare const CheckboxGroup: import("react").FC<{
33
33
  Item: import("react").FC<{
34
34
  itemValue?: string;
35
35
  label: string;
36
- } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "value" | "type" | "className" | "style" | "checked" | "defaultChecked" | "children" | "onChange"> & ({
36
+ } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "value" | "type" | "className" | "style" | "defaultChecked" | "children" | "onChange" | "checked"> & ({
37
37
  value: boolean;
38
38
  onChange: (checked: boolean, event: import("react").ChangeEvent<HTMLInputElement>) => void;
39
39
  defaultChecked?: never;
@@ -0,0 +1,11 @@
1
+ //#region src/components/layout/_shared/padding.d.ts
2
+ type PaddingSize = 'none' | 'sm' | 'md' | 'lg' | 'xl';
3
+ declare const PADDING_CLASS: {
4
+ readonly none: "p-0";
5
+ readonly sm: "p-2";
6
+ readonly md: "p-4";
7
+ readonly lg: "p-6";
8
+ readonly xl: "p-8";
9
+ };
10
+ //#endregion
11
+ export { PADDING_CLASS, PaddingSize };
@@ -0,0 +1,10 @@
1
+ //#region src/components/layout/_shared/padding.ts
2
+ const PADDING_CLASS = {
3
+ none: "p-0",
4
+ sm: "p-2",
5
+ md: "p-4",
6
+ lg: "p-6",
7
+ xl: "p-8"
8
+ };
9
+ //#endregion
10
+ export { PADDING_CLASS };
@@ -1,10 +1,12 @@
1
1
  import { GapSize } from "../_shared/gap.mjs";
2
+ import { PaddingSize } from "../_shared/padding.mjs";
2
3
  import { FC, HTMLAttributes, PropsWithChildren } from "react";
3
4
 
4
5
  //#region src/components/layout/stack/stack.d.ts
5
6
  type StackProps = PropsWithChildren<{
6
7
  direction?: 'row' | 'column';
7
- gap?: GapSize;
8
+ gap?: GapSize; /** Inner padding on all sides. Stack has no padding by default. */
9
+ padding?: PaddingSize;
8
10
  align?: 'start' | 'center' | 'end' | 'stretch';
9
11
  justify?: 'start' | 'center' | 'end' | 'between';
10
12
  } & Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'style'>>;
@@ -1,5 +1,6 @@
1
1
  import { cn } from "../../../helpers/cn.mjs";
2
2
  import { GAP_CLASS } from "../_shared/gap.mjs";
3
+ import { PADDING_CLASS } from "../_shared/padding.mjs";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  //#region src/components/layout/stack/stack.tsx
5
6
  const ALIGN_CLASS = {
@@ -14,9 +15,9 @@ const JUSTIFY_CLASS = {
14
15
  end: "justify-end",
15
16
  between: "justify-between"
16
17
  };
17
- const Stack = ({ direction = "column", gap = "md", align, justify, children, ...rest }) => /* @__PURE__ */ jsx("div", {
18
+ const Stack = ({ direction = "column", gap = "md", padding, align, justify, children, ...rest }) => /* @__PURE__ */ jsx("div", {
18
19
  ...rest,
19
- className: cn("flex", direction === "row" ? "flex-row" : "flex-col", GAP_CLASS[gap], align && ALIGN_CLASS[align], justify && JUSTIFY_CLASS[justify]),
20
+ className: cn("flex", direction === "row" ? "flex-row" : "flex-col", GAP_CLASS[gap], padding && PADDING_CLASS[padding], align && ALIGN_CLASS[align], justify && JUSTIFY_CLASS[justify]),
20
21
  children
21
22
  });
22
23
  //#endregion
@@ -170,11 +170,19 @@ function renderSeparator(props) {
170
170
  orientation: u(props.orientation)
171
171
  });
172
172
  }
173
+ const CARD_PADDING_CLASS = {
174
+ sm: "p-4",
175
+ md: "p-6",
176
+ lg: "p-8"
177
+ };
173
178
  function renderCard(props, children) {
174
179
  return /* @__PURE__ */ jsx(Card, {
175
180
  appearance: u(props.appearance),
176
181
  width: u(props.width),
177
- children
182
+ children: /* @__PURE__ */ jsx("div", {
183
+ className: CARD_PADDING_CLASS[props.size ?? "md"],
184
+ children
185
+ })
178
186
  });
179
187
  }
180
188
  const TabsView = ({ props }) => {
@@ -203,6 +211,7 @@ function renderStack(props, children) {
203
211
  direction: u(props.direction),
204
212
  gap: u(props.gap),
205
213
  justify: u(props.justify),
214
+ padding: u(props.padding),
206
215
  children
207
216
  });
208
217
  }
@@ -468,7 +477,10 @@ function renderInteractiveCard(props, children) {
468
477
  return /* @__PURE__ */ jsx(InteractiveCard, {
469
478
  appearance: u(props.appearance),
470
479
  width: u(props.width),
471
- children
480
+ children: /* @__PURE__ */ jsx("div", {
481
+ className: CARD_PADDING_CLASS[props.size ?? "md"],
482
+ children
483
+ })
472
484
  });
473
485
  }
474
486
  function renderForm(props, children) {
@@ -215,9 +215,9 @@ declare const iconButtonProps: z.ZodObject<{
215
215
  lg: "lg";
216
216
  }>>;
217
217
  color: z.ZodOptional<z.ZodEnum<{
218
+ transparent: "transparent";
218
219
  primary: "primary";
219
220
  secondary: "secondary";
220
- transparent: "transparent";
221
221
  base: "base";
222
222
  }>>;
223
223
  }, z.core.$strip>;
@@ -252,9 +252,9 @@ declare const badgeProps: z.ZodObject<{
252
252
  tone: z.ZodOptional<z.ZodEnum<{
253
253
  success: "success";
254
254
  error: "error";
255
+ neutral: "neutral";
255
256
  info: "info";
256
257
  warning: "warning";
257
- neutral: "neutral";
258
258
  }>>;
259
259
  variant: z.ZodOptional<z.ZodEnum<{
260
260
  solid: "solid";
@@ -320,6 +320,11 @@ declare const cardProps: z.ZodObject<{
320
320
  shadow: "shadow";
321
321
  bordered: "bordered";
322
322
  }>>;
323
+ size: z.ZodOptional<z.ZodEnum<{
324
+ sm: "sm";
325
+ md: "md";
326
+ lg: "lg";
327
+ }>>;
323
328
  }, z.core.$strip>;
324
329
  declare const interactiveCardProps: z.ZodObject<{
325
330
  width: z.ZodOptional<z.ZodEnum<{
@@ -330,6 +335,11 @@ declare const interactiveCardProps: z.ZodObject<{
330
335
  shadow: "shadow";
331
336
  bordered: "bordered";
332
337
  }>>;
338
+ size: z.ZodOptional<z.ZodEnum<{
339
+ sm: "sm";
340
+ md: "md";
341
+ lg: "lg";
342
+ }>>;
333
343
  }, z.core.$strip>;
334
344
  declare const alertProps: z.ZodObject<{
335
345
  tone: z.ZodEnum<{
@@ -393,11 +403,18 @@ declare const stackProps: z.ZodObject<{
393
403
  column: "column";
394
404
  }>>;
395
405
  gap: z.ZodOptional<z.ZodEnum<{
406
+ none: "none";
396
407
  sm: "sm";
397
408
  md: "md";
398
409
  lg: "lg";
399
410
  xl: "xl";
411
+ }>>;
412
+ padding: z.ZodOptional<z.ZodEnum<{
400
413
  none: "none";
414
+ sm: "sm";
415
+ md: "md";
416
+ lg: "lg";
417
+ xl: "xl";
401
418
  }>>;
402
419
  align: z.ZodOptional<z.ZodEnum<{
403
420
  start: "start";
@@ -416,11 +433,11 @@ declare const gridProps: z.ZodObject<{
416
433
  cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<"auto-fill">, z.ZodLiteral<"auto-fit">]>>;
417
434
  minItemSize: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<24>, z.ZodLiteral<32>, z.ZodLiteral<40>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<80>]>>;
418
435
  gap: z.ZodOptional<z.ZodEnum<{
436
+ none: "none";
419
437
  sm: "sm";
420
438
  md: "md";
421
439
  lg: "lg";
422
440
  xl: "xl";
423
- none: "none";
424
441
  }>>;
425
442
  }, z.core.$strip>;
426
443
  declare const scrollLinkedProps: z.ZodObject<{}, z.core.$strip>;
@@ -212,7 +212,12 @@ const tableProps = z.object({
212
212
  });
213
213
  const cardProps = z.object({
214
214
  width: z.enum(["full", "fit"]).optional(),
215
- appearance: z.enum(["shadow", "bordered"]).optional()
215
+ appearance: z.enum(["shadow", "bordered"]).optional(),
216
+ size: z.enum([
217
+ "sm",
218
+ "md",
219
+ "lg"
220
+ ]).optional()
216
221
  });
217
222
  const interactiveCardProps = cardProps;
218
223
  const alertProps = z.object({
@@ -274,6 +279,13 @@ const stackProps = z.object({
274
279
  "lg",
275
280
  "xl"
276
281
  ]).optional(),
282
+ padding: z.enum([
283
+ "none",
284
+ "sm",
285
+ "md",
286
+ "lg",
287
+ "xl"
288
+ ]).optional(),
277
289
  align: z.enum([
278
290
  "start",
279
291
  "center",
@@ -39,11 +39,18 @@ declare const catalog: import("@json-render/core").Catalog<{
39
39
  column: "column";
40
40
  }>>;
41
41
  gap: import("zod").ZodOptional<import("zod").ZodEnum<{
42
+ none: "none";
42
43
  sm: "sm";
43
44
  md: "md";
44
45
  lg: "lg";
45
46
  xl: "xl";
47
+ }>>;
48
+ padding: import("zod").ZodOptional<import("zod").ZodEnum<{
46
49
  none: "none";
50
+ sm: "sm";
51
+ md: "md";
52
+ lg: "lg";
53
+ xl: "xl";
47
54
  }>>;
48
55
  align: import("zod").ZodOptional<import("zod").ZodEnum<{
49
56
  start: "start";
@@ -66,11 +73,11 @@ declare const catalog: import("@json-render/core").Catalog<{
66
73
  cols: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<1>, import("zod").ZodLiteral<2>, import("zod").ZodLiteral<3>, import("zod").ZodLiteral<4>, import("zod").ZodLiteral<5>, import("zod").ZodLiteral<6>, import("zod").ZodLiteral<"auto-fill">, import("zod").ZodLiteral<"auto-fit">]>>;
67
74
  minItemSize: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<24>, import("zod").ZodLiteral<32>, import("zod").ZodLiteral<40>, import("zod").ZodLiteral<48>, import("zod").ZodLiteral<64>, import("zod").ZodLiteral<80>]>>;
68
75
  gap: import("zod").ZodOptional<import("zod").ZodEnum<{
76
+ none: "none";
69
77
  sm: "sm";
70
78
  md: "md";
71
79
  lg: "lg";
72
80
  xl: "xl";
73
- none: "none";
74
81
  }>>;
75
82
  }, import("zod/v4/core").$strip>;
76
83
  slots: string[];
@@ -109,6 +116,11 @@ declare const catalog: import("@json-render/core").Catalog<{
109
116
  shadow: "shadow";
110
117
  bordered: "bordered";
111
118
  }>>;
119
+ size: import("zod").ZodOptional<import("zod").ZodEnum<{
120
+ sm: "sm";
121
+ md: "md";
122
+ lg: "lg";
123
+ }>>;
112
124
  }, import("zod/v4/core").$strip>;
113
125
  slots: string[];
114
126
  description: string;
@@ -119,9 +131,9 @@ declare const catalog: import("@json-render/core").Catalog<{
119
131
  tone: import("zod").ZodOptional<import("zod").ZodEnum<{
120
132
  success: "success";
121
133
  error: "error";
134
+ neutral: "neutral";
122
135
  info: "info";
123
136
  warning: "warning";
124
- neutral: "neutral";
125
137
  }>>;
126
138
  variant: import("zod").ZodOptional<import("zod").ZodEnum<{
127
139
  solid: "solid";
@@ -492,9 +504,9 @@ declare const catalog: import("@json-render/core").Catalog<{
492
504
  lg: "lg";
493
505
  }>>;
494
506
  color: import("zod").ZodOptional<import("zod").ZodEnum<{
507
+ transparent: "transparent";
495
508
  primary: "primary";
496
509
  secondary: "secondary";
497
- transparent: "transparent";
498
510
  base: "base";
499
511
  }>>;
500
512
  }, import("zod/v4/core").$strip>;
@@ -610,6 +622,11 @@ declare const catalog: import("@json-render/core").Catalog<{
610
622
  shadow: "shadow";
611
623
  bordered: "bordered";
612
624
  }>>;
625
+ size: import("zod").ZodOptional<import("zod").ZodEnum<{
626
+ sm: "sm";
627
+ md: "md";
628
+ lg: "lg";
629
+ }>>;
613
630
  }, import("zod/v4/core").$strip>;
614
631
  slots: string[];
615
632
  description: string;
@@ -16,7 +16,7 @@ const catalog = defineCatalog(schema, {
16
16
  Stack: {
17
17
  props: stackProps,
18
18
  slots: ["default"],
19
- description: "子要素を縦/横に等間隔で並べるレイアウトコンテナ。"
19
+ description: "子要素を縦/横に等間隔で並べるレイアウトコンテナ。gap で子要素間の間隔、padding(none〜xl)で内側の余白を付ける。セクションに余白が欲しいときは padding を指定する。"
20
20
  },
21
21
  Grid: {
22
22
  props: gridProps,
@@ -30,7 +30,7 @@ const catalog = defineCatalog(schema, {
30
30
  Card: {
31
31
  props: cardProps,
32
32
  slots: ["default"],
33
- description: "コンテンツをまとめるカード(コンテナ)。"
33
+ description: "コンテンツをまとめるカード(コンテナ)。内側 padding は size(sm/md/lg、デフォルト md)で決まる。中身を Stack で囲む場合に重ねて padding を指定する必要はない。"
34
34
  },
35
35
  Badge: {
36
36
  props: badgeProps,
@@ -155,7 +155,7 @@ const catalog = defineCatalog(schema, {
155
155
  InteractiveCard: {
156
156
  props: interactiveCardProps,
157
157
  slots: ["default"],
158
- description: "ホバーアニメーション付きのカード。"
158
+ description: "ホバーアニメーション付きのカード。Card と同様に内側 padding は size(sm/md/lg、デフォルト md)で決まる。"
159
159
  },
160
160
  Form: {
161
161
  props: formProps,
@@ -16,3 +16,7 @@
16
16
  @import './tokens.css';
17
17
  @import './utilities.css';
18
18
  @source '../components';
19
+ /* The json-render / openui integrations' renderers emit utility classes too
20
+ (e.g. card padding), so they must be scanned alongside components — else a
21
+ class only used in a renderer (not in any component) is never generated. */
22
+ @source '../integrations';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k8o/arte-odyssey",
3
- "version": "10.0.0",
3
+ "version": "10.1.0",
4
4
  "description": "k8o's react ui library",
5
5
  "keywords": [
6
6
  "components",