@serendie/ui 1.0.0 → 2.0.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.
Files changed (59) hide show
  1. package/dist/assets/checkboxIndeterminate.svg.js +5 -0
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Banner/Banner.d.ts +1 -1
  4. package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
  5. package/dist/components/Button/Button.d.ts +2 -2
  6. package/dist/components/Chart/SerendieChartProps.d.ts +40 -0
  7. package/dist/components/Chart/SerendieChartProps.js +127 -0
  8. package/dist/components/Chart/SerendieChartTheme.d.ts +2 -0
  9. package/dist/components/Chart/SerendieChartTheme.js +150 -0
  10. package/dist/components/Chart/chartData.d.ts +29 -0
  11. package/dist/components/Chart/index.d.ts +3 -0
  12. package/dist/components/Chart/index.js +15 -0
  13. package/dist/components/ChoiceBox/ChoiceBox.js +47 -41
  14. package/dist/components/DataTable/DataTableComponent.d.ts +23 -0
  15. package/dist/components/DataTable/DataTableComponent.js +52 -0
  16. package/dist/components/DataTable/createColumnHelper.d.ts +2 -0
  17. package/dist/components/DataTable/createColumnHelper.js +5 -0
  18. package/dist/components/DataTable/index.d.ts +19 -0
  19. package/dist/components/DataTable/index.js +28 -0
  20. package/dist/components/DataTable/table/BodyCell.d.ts +55 -0
  21. package/dist/components/DataTable/table/BodyCell.js +127 -0
  22. package/dist/components/DataTable/table/BodyCheckbox.d.ts +4 -0
  23. package/dist/components/DataTable/table/BodyCheckbox.js +22 -0
  24. package/dist/components/DataTable/table/HeaderCell.d.ts +8 -0
  25. package/dist/components/DataTable/table/HeaderCell.js +79 -0
  26. package/dist/components/DataTable/table/HeaderCheckbox.d.ts +2 -0
  27. package/dist/components/DataTable/table/HeaderCheckbox.js +26 -0
  28. package/dist/components/DataTable/table/HeaderRow.d.ts +11 -0
  29. package/dist/components/DataTable/table/HeaderRow.js +40 -0
  30. package/dist/components/DataTable/table/Root.d.ts +5 -0
  31. package/dist/components/DataTable/table/Root.js +34 -0
  32. package/dist/components/DataTable/table/Row.d.ts +5 -0
  33. package/dist/components/DataTable/table/Row.js +90 -0
  34. package/dist/components/DataTable/table/Tbody.d.ts +1 -0
  35. package/dist/components/DataTable/table/Tbody.js +7 -0
  36. package/dist/components/DataTable/table/Thead.d.ts +1 -0
  37. package/dist/components/DataTable/table/Thead.js +7 -0
  38. package/dist/components/DataTable/table/Tr.d.ts +1 -0
  39. package/dist/components/DataTable/table/Tr.js +27 -0
  40. package/dist/components/DataTable/table/index.d.ts +10 -0
  41. package/dist/components/DataTable/table/index.js +22 -0
  42. package/dist/components/DropdownMenu/DropdownMenu.d.ts +1 -1
  43. package/dist/components/IconButton/IconButton.d.ts +3 -3
  44. package/dist/components/Pagination/Pagination.d.ts +1 -1
  45. package/dist/components/RadioButton/RadioButton.d.ts +1 -1
  46. package/dist/components/Search/Search.d.ts +1 -1
  47. package/dist/components/Select/Select.d.ts +1 -1
  48. package/dist/components/Tabs/TabItem.d.ts +1 -1
  49. package/dist/components/Toast/Toast.d.ts +1 -1
  50. package/dist/index.d.ts +2 -0
  51. package/dist/index.js +109 -92
  52. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +100 -0
  53. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1741 -0
  54. package/dist/styled-system/tokens/index.js +4758 -0
  55. package/dist/styles.css +1 -1
  56. package/dist/tokens/getToken.js +4 -4
  57. package/dist/utils/colors.d.ts +1 -0
  58. package/dist/utils/colors.js +12 -0
  59. package/package.json +8 -2
@@ -0,0 +1,5 @@
1
+ import * as e from "react";
2
+ const l = (t) => /* @__PURE__ */ e.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M3.25 6C3.25 4.48122 4.48122 3.25 6 3.25H18C19.5188 3.25 20.75 4.48122 20.75 6V18C20.75 19.5188 19.5188 20.75 18 20.75H6C4.48122 20.75 3.25 19.5188 3.25 18V6Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17 12.75H7V11.25H17V12.75Z", fill: "currentColor", className: "checkmark" }));
3
+ export {
4
+ l as default
5
+ };
@@ -1,6 +1,6 @@
1
1
  import { AccordionItemProps } from '@ark-ui/react';
2
2
  import { RecipeVariantProps } from '../../../styled-system/types';
3
- declare const AccordionStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"item" | "title" | "itemIndicator" | "icon" | "description", {
3
+ declare const AccordionStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"title" | "description" | "item" | "icon" | "itemIndicator", {
4
4
  isLeftIcon: {
5
5
  true: {
6
6
  item: {
@@ -1,6 +1,6 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { RecipeVariantProps } from '../../../styled-system/css';
3
- declare const BannerStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"container" | "title" | "icon" | "description", {
3
+ declare const BannerStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"container" | "title" | "description" | "icon", {
4
4
  type: {
5
5
  information: {
6
6
  container: {
@@ -1,6 +1,6 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { RecipeVariantProps } from '../../../styled-system/css';
3
- export declare const BottomNavigationItemStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"icon" | "label" | "root" | "iconGroup" | "badge", {
3
+ export declare const BottomNavigationItemStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"label" | "root" | "icon" | "iconGroup" | "badge", {
4
4
  isActive: {
5
5
  true: {
6
6
  label: {
@@ -117,14 +117,14 @@ type ButtonLoadingProps = {
117
117
  };
118
118
  export declare const Button: React.ForwardRefExoticComponent<(Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
119
119
  styleType?: "filled" | "outlined" | "ghost" | "rectangle" | undefined;
120
- size?: "small" | "medium" | undefined;
120
+ size?: "medium" | "small" | undefined;
121
121
  } & {
122
122
  leftIcon?: React.ReactElement;
123
123
  } & {
124
124
  rightIcon?: never;
125
125
  } & ButtonLoadingProps, "ref"> | Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
126
126
  styleType?: "filled" | "outlined" | "ghost" | "rectangle" | undefined;
127
- size?: "small" | "medium" | undefined;
127
+ size?: "medium" | "small" | undefined;
128
128
  } & {
129
129
  leftIcon?: never;
130
130
  } & {
@@ -0,0 +1,40 @@
1
+ import { BarSvgProps, BarDatum } from '@nivo/bar';
2
+ import { LineSeries, LineSvgProps } from '@nivo/line';
3
+ import { PieSvgProps } from '@nivo/pie';
4
+ export type ChartColorCategory = "primary" | "positive" | "negative" | "notice" | "multi";
5
+ export declare const getChartColors: (category: ChartColorCategory, count?: number) => string[];
6
+ export declare const getChartColor: (category: ChartColorCategory, index?: number) => string;
7
+ export declare const defaultChartMargin: {
8
+ top: number;
9
+ right: number;
10
+ bottom: number;
11
+ left: number;
12
+ };
13
+ export declare const compactChartMargin: {
14
+ top: number;
15
+ right: number;
16
+ bottom: number;
17
+ left: number;
18
+ };
19
+ export declare const legendChartMargin: {
20
+ top: number;
21
+ right: number;
22
+ bottom: number;
23
+ left: number;
24
+ };
25
+ export declare const spaciousChartMargin: {
26
+ top: number;
27
+ right: number;
28
+ bottom: number;
29
+ left: number;
30
+ };
31
+ type ChartPropsResult = {
32
+ bar: Partial<BarSvgProps<BarDatum>>;
33
+ line: Partial<LineSvgProps<LineSeries>>;
34
+ pie: Partial<PieSvgProps<Record<string, unknown>>>;
35
+ };
36
+ export declare const useChartProps: <T extends keyof ChartPropsResult>(chartType: T, colorCategory?: ChartColorCategory) => ChartPropsResult[T];
37
+ export declare const useBarChartProps: (c?: ChartColorCategory) => Partial<BarSvgProps<BarDatum>>;
38
+ export declare const useLineChartProps: (c?: ChartColorCategory) => Partial<LineSvgProps<LineSeries>>;
39
+ export declare const usePieChartProps: (c?: ChartColorCategory) => Partial<PieSvgProps<Record<string, unknown>>>;
40
+ export {};
@@ -0,0 +1,127 @@
1
+ import { token as r } from "../../styled-system/tokens/index.js";
2
+ import n from "../../node_modules/@serendie/design-token/dist/tokens.js";
3
+ import { SerendieChartTheme as p } from "./SerendieChartTheme.js";
4
+ import { getContrastTextColor as i } from "../../utils/colors.js";
5
+ const c = (s, t) => {
6
+ const a = {
7
+ primary: [
8
+ r("colors.sd.system.color.chart.mark.primary.01"),
9
+ r("colors.sd.system.color.chart.mark.primary.02"),
10
+ r("colors.sd.system.color.chart.mark.primary.03"),
11
+ r("colors.sd.system.color.chart.mark.primary.04"),
12
+ r("colors.sd.system.color.chart.mark.primary.05"),
13
+ r("colors.sd.system.color.chart.mark.primary.06")
14
+ ],
15
+ positive: [
16
+ r("colors.sd.system.color.chart.mark.positive.01"),
17
+ r("colors.sd.system.color.chart.mark.positive.02"),
18
+ r("colors.sd.system.color.chart.mark.positive.03"),
19
+ r("colors.sd.system.color.chart.mark.positive.04"),
20
+ r("colors.sd.system.color.chart.mark.positive.05"),
21
+ r("colors.sd.system.color.chart.mark.positive.06")
22
+ ],
23
+ negative: [
24
+ r("colors.sd.system.color.chart.mark.negative.01"),
25
+ r("colors.sd.system.color.chart.mark.negative.02"),
26
+ r("colors.sd.system.color.chart.mark.negative.03"),
27
+ r("colors.sd.system.color.chart.mark.negative.04"),
28
+ r("colors.sd.system.color.chart.mark.negative.05"),
29
+ r("colors.sd.system.color.chart.mark.negative.06")
30
+ ],
31
+ notice: [
32
+ r("colors.sd.system.color.chart.mark.notice.01"),
33
+ r("colors.sd.system.color.chart.mark.notice.02"),
34
+ r("colors.sd.system.color.chart.mark.notice.03"),
35
+ r("colors.sd.system.color.chart.mark.notice.04"),
36
+ r("colors.sd.system.color.chart.mark.notice.05"),
37
+ r("colors.sd.system.color.chart.mark.notice.06")
38
+ ],
39
+ multi: [
40
+ r("colors.sd.system.color.chart.mark.multi.01"),
41
+ r("colors.sd.system.color.chart.mark.multi.02"),
42
+ r("colors.sd.system.color.chart.mark.multi.03"),
43
+ r("colors.sd.system.color.chart.mark.multi.04"),
44
+ r("colors.sd.system.color.chart.mark.multi.05"),
45
+ r("colors.sd.system.color.chart.mark.multi.06"),
46
+ r("colors.sd.system.color.chart.mark.multi.07"),
47
+ r("colors.sd.system.color.chart.mark.multi.08"),
48
+ r("colors.sd.system.color.chart.mark.multi.09"),
49
+ r("colors.sd.system.color.chart.mark.multi.10")
50
+ ]
51
+ }[s];
52
+ return t ? a.slice(0, t) : a;
53
+ }, C = (s, t = 0) => c(s)[t] || c(s)[0], o = n.sd.system.dimension.spacing, h = {
54
+ top: parseInt(o.large, 10),
55
+ right: parseInt(o.large, 10),
56
+ bottom: parseInt(o.fourExtraLarge, 10),
57
+ left: parseInt(o.fiveExtraLarge, 10)
58
+ }, L = {
59
+ top: parseInt(o.small, 10),
60
+ right: parseInt(o.small, 10),
61
+ bottom: parseInt(o.twoExtraLarge, 10),
62
+ left: parseInt(o.threeExtraLarge, 10)
63
+ }, b = {
64
+ top: parseInt(o.large, 10),
65
+ right: parseInt(o.sixExtraLarge, 10),
66
+ bottom: parseInt(o.fourExtraLarge, 10),
67
+ left: parseInt(o.fiveExtraLarge, 10)
68
+ }, f = {
69
+ top: parseInt(o.extraLarge, 10),
70
+ right: parseInt(o.extraLarge, 10),
71
+ bottom: parseInt(o.fiveExtraLarge, 10),
72
+ left: parseInt(o.sixExtraLarge, 10)
73
+ }, l = (s, t = "primary") => {
74
+ const m = c(t), a = {
75
+ theme: p,
76
+ colors: m,
77
+ margin: h
78
+ };
79
+ return {
80
+ bar: {
81
+ ...a,
82
+ padding: 0.3,
83
+ innerPadding: 1,
84
+ borderRadius: 0,
85
+ enableLabel: !0,
86
+ labelTextColor: (e) => i(e.color)
87
+ },
88
+ line: {
89
+ ...a,
90
+ enablePoints: !0,
91
+ pointSize: 6,
92
+ pointBorderWidth: 2,
93
+ pointBorderColor: { from: "serieColor" },
94
+ enableGridX: !0,
95
+ enableGridY: !0
96
+ },
97
+ pie: {
98
+ ...a,
99
+ innerRadius: 0.5,
100
+ padAngle: 0.7,
101
+ cornerRadius: 0,
102
+ activeOuterRadiusOffset: 8,
103
+ enableArcLabels: !0,
104
+ enableArcLinkLabels: !0,
105
+ arcLabelsTextColor: (e) => i(e.color),
106
+ arcLinkLabelsColor: r(
107
+ "colors.sd.system.color.chart.component.onChartSurface"
108
+ ),
109
+ arcLinkLabelsThickness: 2,
110
+ arcLinkLabelsTextColor: r(
111
+ "colors.sd.system.color.chart.component.onChartSurface"
112
+ )
113
+ }
114
+ }[s];
115
+ }, v = (s = "primary") => l("bar", s), x = (s = "primary") => l("line", s), I = (s = "primary") => l("pie", s);
116
+ export {
117
+ L as compactChartMargin,
118
+ h as defaultChartMargin,
119
+ C as getChartColor,
120
+ c as getChartColors,
121
+ b as legendChartMargin,
122
+ f as spaciousChartMargin,
123
+ v as useBarChartProps,
124
+ l as useChartProps,
125
+ x as useLineChartProps,
126
+ I as usePieChartProps
127
+ };
@@ -0,0 +1,2 @@
1
+ import { PartialTheme } from '@nivo/theming';
2
+ export declare const SerendieChartTheme: PartialTheme;
@@ -0,0 +1,150 @@
1
+ import { token as t } from "../../styled-system/tokens/index.js";
2
+ import r from "../../node_modules/@serendie/design-token/dist/tokens.js";
3
+ const o = r.sd.reference.typography, e = r.sd.system.dimension.spacing, n = {
4
+ background: t("colors.sd.system.color.chart.component.chartSurface"),
5
+ // 軸関連のスタイル
6
+ axis: {
7
+ domain: {
8
+ line: {
9
+ stroke: t("colors.sd.system.color.chart.component.scalemark"),
10
+ strokeWidth: 1
11
+ }
12
+ },
13
+ ticks: {
14
+ line: {
15
+ stroke: "transparent",
16
+ // 目盛り線を非表示
17
+ strokeWidth: 0
18
+ },
19
+ text: {
20
+ fill: t("colors.sd.system.color.chart.component.onChartSurface"),
21
+ fontSize: parseInt(o.scale.expanded.extraSmall, 10),
22
+ // 13px
23
+ fontFamily: o.fontFamily.primary
24
+ }
25
+ },
26
+ legend: {
27
+ text: {
28
+ fill: t("colors.sd.system.color.chart.component.onChartSurface"),
29
+ fontSize: parseInt(o.scale.expanded.small, 10),
30
+ // 14px
31
+ fontWeight: o.fontWeight.regular,
32
+ // 400
33
+ fontFamily: o.fontFamily.primary
34
+ }
35
+ }
36
+ },
37
+ // グリッド線のスタイル
38
+ grid: {
39
+ line: {
40
+ stroke: t("colors.sd.system.color.chart.component.scalemark"),
41
+ strokeWidth: 1
42
+ }
43
+ },
44
+ // 凡例のスタイル
45
+ legends: {
46
+ text: {
47
+ fill: t("colors.sd.system.color.chart.component.onChartSurface"),
48
+ fontSize: parseInt(o.scale.expanded.extraSmall, 10),
49
+ // 13px
50
+ fontFamily: o.fontFamily.primary
51
+ },
52
+ ticks: {
53
+ line: {
54
+ strokeWidth: 1
55
+ }
56
+ },
57
+ title: {
58
+ text: {
59
+ fill: t("colors.sd.system.color.chart.component.onChartSurface"),
60
+ fontSize: parseInt(o.scale.expanded.small, 10),
61
+ // 14px
62
+ fontWeight: o.fontWeight.regular,
63
+ // 500
64
+ fontFamily: o.fontFamily.primary
65
+ }
66
+ }
67
+ },
68
+ // ラベルのスタイル(バー内のテキスト)
69
+ labels: {
70
+ text: {
71
+ fill: t("colors.sd.system.color.chart.component.onChartSurface"),
72
+ fontSize: parseInt(o.scale.expanded.extraSmall, 10),
73
+ // 13px
74
+ fontWeight: o.fontWeight.regular,
75
+ // 500
76
+ fontFamily: o.fontFamily.primary
77
+ }
78
+ },
79
+ // ツールチップのスタイル
80
+ tooltip: {
81
+ container: {
82
+ background: t("colors.sd.system.color.chart.component.chartSurface"),
83
+ color: t("colors.sd.system.color.chart.component.onChartSurface"),
84
+ fontSize: parseInt(o.scale.expanded.extraSmall, 10),
85
+ // 13px
86
+ fontFamily: o.fontFamily.primary,
87
+ borderRadius: 6,
88
+ boxShadow: "0 3px 14px rgba(0, 0, 0, 0.2)",
89
+ border: `1px solid ${t("colors.sd.system.color.chart.component.scalemark")}`,
90
+ padding: `${parseInt(e.small, 10)}px ${parseInt(e.medium, 10)}px`
91
+ }
92
+ },
93
+ // 注釈のスタイル
94
+ annotations: {
95
+ text: {
96
+ fill: t("colors.sd.system.color.chart.component.onChartSurface"),
97
+ fontSize: parseInt(o.scale.expanded.extraSmall, 10),
98
+ // 13px
99
+ fontFamily: o.fontFamily.primary
100
+ },
101
+ link: {
102
+ stroke: t("colors.sd.system.color.chart.component.scalemark"),
103
+ strokeWidth: 1,
104
+ strokeOpacity: 0.3
105
+ },
106
+ outline: {
107
+ stroke: t("colors.sd.system.color.chart.component.scalemark"),
108
+ strokeWidth: 2,
109
+ strokeOpacity: 0.3,
110
+ fill: "transparent"
111
+ }
112
+ },
113
+ // ドットのスタイル(折れ線グラフなど)
114
+ dots: {
115
+ text: {
116
+ fill: t("colors.sd.system.color.chart.component.onChartSurface"),
117
+ fontSize: parseInt(o.scale.expanded.extraSmall, 10),
118
+ // 13px
119
+ fontFamily: o.fontFamily.primary
120
+ }
121
+ },
122
+ // マーカーのスタイル(しきい値線など)
123
+ markers: {
124
+ lineColor: t("colors.sd.system.color.chart.component.threshold"),
125
+ lineStrokeWidth: 1,
126
+ text: {
127
+ fontFamily: o.fontFamily.primary,
128
+ fontSize: parseInt(o.scale.expanded.extraSmall, 10),
129
+ // 13px
130
+ fill: t("colors.sd.system.color.chart.component.onChartSurface"),
131
+ outlineWidth: 2,
132
+ outlineColor: t(
133
+ "colors.sd.system.color.chart.component.chartSurface"
134
+ ),
135
+ outlineOpacity: 1
136
+ }
137
+ },
138
+ // クロスヘアのスタイル
139
+ crosshair: {
140
+ line: {
141
+ stroke: t("colors.sd.system.color.chart.component.scalemark"),
142
+ strokeWidth: 1,
143
+ strokeOpacity: 0.5,
144
+ strokeDasharray: "3 3"
145
+ }
146
+ }
147
+ };
148
+ export {
149
+ n as SerendieChartTheme
150
+ };
@@ -0,0 +1,29 @@
1
+ export declare const barData: {
2
+ month: string;
3
+ value: number;
4
+ }[];
5
+ export declare const multiSeriesData: {
6
+ month: string;
7
+ sales: number;
8
+ profit: number;
9
+ cost: number;
10
+ }[];
11
+ export declare const lineData: {
12
+ id: string;
13
+ data: {
14
+ x: string;
15
+ y: number;
16
+ }[];
17
+ }[];
18
+ export declare const pieData: {
19
+ id: string;
20
+ value: number;
21
+ }[];
22
+ export declare const stackedData: {
23
+ category: string;
24
+ segment1: number;
25
+ segment2: number;
26
+ segment3: number;
27
+ segment4: number;
28
+ segment5: number;
29
+ }[];
@@ -0,0 +1,3 @@
1
+ export { SerendieChartTheme } from './SerendieChartTheme';
2
+ export type { ChartColorCategory } from './SerendieChartProps';
3
+ export { useChartProps, useBarChartProps, useLineChartProps, usePieChartProps, getChartColors, getChartColor, defaultChartMargin, compactChartMargin, legendChartMargin, spaciousChartMargin, } from './SerendieChartProps';
@@ -0,0 +1,15 @@
1
+ import { SerendieChartTheme as e } from "./SerendieChartTheme.js";
2
+ import { compactChartMargin as o, defaultChartMargin as C, getChartColor as h, getChartColors as s, legendChartMargin as i, spaciousChartMargin as p, useBarChartProps as g, useChartProps as n, useLineChartProps as u, usePieChartProps as P } from "./SerendieChartProps.js";
3
+ export {
4
+ e as SerendieChartTheme,
5
+ o as compactChartMargin,
6
+ C as defaultChartMargin,
7
+ h as getChartColor,
8
+ s as getChartColors,
9
+ i as legendChartMargin,
10
+ p as spaciousChartMargin,
11
+ g as useBarChartProps,
12
+ n as useChartProps,
13
+ u as useLineChartProps,
14
+ P as usePieChartProps
15
+ };
@@ -1,23 +1,24 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
2
  import "../../styled-system/css/css.js";
3
3
  import { cx as n } from "../../styled-system/css/cx.js";
4
4
  import "../../styled-system/helpers.js";
5
- import { sva as a } from "../../styled-system/css/sva.js";
6
- import p from "../../assets/checkboxChecked.svg.js";
7
- import I from "../../assets/checkboxUnchecked.svg.js";
8
- import C from "../../assets/radioChecked.svg.js";
9
- import x from "../../assets/radioUnchecked.svg.js";
10
- import { checkboxUncheckedIconCss as l, checkboxCheckedIconCss as b, checkboxIconCss as f } from "../CheckBox/CheckBox.js";
11
- import { radioUncheckedIconCss as u, radioCheckedIconCss as U, radioIconCss as N } from "../RadioButton/RadioButton.js";
5
+ import { sva as k } from "../../styled-system/css/sva.js";
6
+ import I from "../../assets/checkboxChecked.svg.js";
7
+ import p from "../../assets/checkboxUnchecked.svg.js";
8
+ import C from "../../assets/checkboxIndeterminate.svg.js";
9
+ import x from "../../assets/radioChecked.svg.js";
10
+ import l from "../../assets/radioUnchecked.svg.js";
11
+ import { checkboxUncheckedIconCss as f, checkboxCheckedIconCss as b, checkboxIconCss as u } from "../CheckBox/CheckBox.js";
12
+ import { radioUncheckedIconCss as U, radioCheckedIconCss as N, radioIconCss as g } from "../RadioButton/RadioButton.js";
12
13
  import { RadioGroupItem as R } from "../../node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js";
13
- import { RadioGroupItemContext as g } from "../../node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-context.js";
14
+ import { RadioGroupItemContext as S } from "../../node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-context.js";
14
15
  import { RadioGroupItemControl as v } from "../../node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js";
15
- import { RadioGroupItemHiddenInput as S } from "../../node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-hidden-input.js";
16
- import { CheckboxRoot as G } from "../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root.js";
17
- import { CheckboxContext as P } from "../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-context.js";
18
- import { CheckboxControl as j } from "../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-control.js";
19
- import { CheckboxHiddenInput as y } from "../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js";
20
- const h = a({
16
+ import { RadioGroupItemHiddenInput as G } from "../../node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-hidden-input.js";
17
+ import { CheckboxRoot as P } from "../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root.js";
18
+ import { CheckboxContext as j } from "../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-context.js";
19
+ import { CheckboxControl as y } from "../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-control.js";
20
+ import { CheckboxHiddenInput as B } from "../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js";
21
+ const h = k({
21
22
  slots: [
22
23
  "root",
23
24
  "radioItem",
@@ -31,53 +32,58 @@ const h = a({
31
32
  root: {
32
33
  display: "flex"
33
34
  },
34
- radioItem: N,
35
- radioCheckedIcon: U,
36
- radioUncheckedIcon: u,
37
- checkboxItem: f,
35
+ radioItem: g,
36
+ radioCheckedIcon: N,
37
+ radioUncheckedIcon: U,
38
+ checkboxItem: u,
38
39
  checkboxCheckedIcon: b,
39
- checkboxUncheckedIcon: l
40
+ checkboxUncheckedIcon: f
40
41
  }
41
- }), Y = ({
42
+ }), _ = ({
42
43
  type: r,
43
44
  value: t,
44
- className: i,
45
- ...s
45
+ className: d,
46
+ ...i
46
47
  }) => {
47
- const [k, m] = h.splitVariantProps(s), c = h(k);
48
+ const [s, a] = h.splitVariantProps(i), e = h(s);
48
49
  if (r === "radio")
49
- return /* @__PURE__ */ d(
50
+ return /* @__PURE__ */ m(
50
51
  R,
51
52
  {
52
53
  value: t,
53
- className: n("group", c.root, i),
54
- ...m,
54
+ className: n("group", e.root, d),
55
+ ...a,
55
56
  children: [
56
- /* @__PURE__ */ o(g, { children: (e) => /* @__PURE__ */ o(v, { className: c.radioItem, asChild: !0, children: e.checked ? /* @__PURE__ */ o(C, { className: c.radioCheckedIcon }) : /* @__PURE__ */ o(x, { className: c.radioUncheckedIcon }) }) }),
57
- /* @__PURE__ */ o(S, {})
57
+ /* @__PURE__ */ o(S, { children: (c) => /* @__PURE__ */ o(v, { className: e.radioItem, asChild: !0, children: c.checked ? /* @__PURE__ */ o(x, { className: e.radioCheckedIcon }) : /* @__PURE__ */ o(l, { className: e.radioUncheckedIcon }) }) }),
58
+ /* @__PURE__ */ o(G, {})
58
59
  ]
59
60
  }
60
61
  );
61
62
  if (r === "checkbox")
62
- return /* @__PURE__ */ d(
63
- G,
63
+ return /* @__PURE__ */ o(
64
+ P,
64
65
  {
65
66
  value: t,
66
- className: n("group", c.root, i),
67
- ...m,
68
- children: [
69
- /* @__PURE__ */ o(P, { children: (e) => /* @__PURE__ */ o(j, { className: c.checkboxItem, children: e.checked ? /* @__PURE__ */ o(p, { className: c.checkboxCheckedIcon }) : /* @__PURE__ */ o(
70
- I,
67
+ className: n("group", e.root, d),
68
+ ...i,
69
+ children: /* @__PURE__ */ o(j, { children: (c) => /* @__PURE__ */ m(y, { className: e.checkboxItem, children: [
70
+ c.checked === !0 ? /* @__PURE__ */ o(I, { className: e.checkboxCheckedIcon }) : c.checkedState === "indeterminate" ? /* @__PURE__ */ o(
71
+ C,
71
72
  {
72
- className: c.checkboxUncheckedIcon
73
+ className: e.checkboxCheckedIcon
73
74
  }
74
- ) }) }),
75
- /* @__PURE__ */ o(y, {})
76
- ]
75
+ ) : /* @__PURE__ */ o(
76
+ p,
77
+ {
78
+ className: e.checkboxUncheckedIcon
79
+ }
80
+ ),
81
+ /* @__PURE__ */ o(B, { checked: c.checked })
82
+ ] }) })
77
83
  }
78
84
  );
79
85
  };
80
86
  export {
81
- Y as ChoiceBox,
87
+ _ as ChoiceBox,
82
88
  h as ChoiceBoxStyle
83
89
  };
@@ -0,0 +1,23 @@
1
+ import { ColumnDef, SortingState } from '@tanstack/react-table';
2
+ /**
3
+ * TanStack Tableは設計上、各カラムが異なる値の型を持つことを前提としています。
4
+ * createColumnHelperは各カラムに正確な型(string, number等)を付与しますが、
5
+ * これらを単一の配列にまとめる際、TypeScriptの型システムの制約により問題が生じます。
6
+ *
7
+ * TanStack Table自体も内部実装で`ColumnDef<TData, any>[]`を使用しており、
8
+ * これは意図的な設計判断です。これに従い、型エイリアスで意図を明確にします。
9
+ * https://github.com/TanStack/table/blob/0cc6992c7836489661a0954a2b56e620850ad4da/packages/table-core/src/types.ts#L288C1-L289C1
10
+ */
11
+ type TableColumnDef<TData> = ColumnDef<TData, any>;
12
+ export interface DataTableComponentProps<TData = Record<string, unknown>> {
13
+ data: TData[];
14
+ columns: TableColumnDef<TData>[];
15
+ enableRowSelection?: boolean;
16
+ enableSorting?: boolean;
17
+ initialSorting?: SortingState;
18
+ onRowSelectionChange?: (selection: Record<string, boolean>) => void;
19
+ onSortingChange?: (sorting: SortingState) => void;
20
+ className?: string;
21
+ }
22
+ export declare function DataTableComponent<TData = Record<string, unknown>>({ data, columns, enableRowSelection, enableSorting, initialSorting, onSortingChange, className, }: DataTableComponentProps<TData>): import("react/jsx-runtime").JSX.Element;
23
+ export default DataTableComponent;
@@ -0,0 +1,52 @@
1
+ import { jsxs as M, jsx as e } from "react/jsx-runtime";
2
+ import { useState as a } from "react";
3
+ import { useReactTable as T } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
4
+ import { DataTable as t } from "./index.js";
5
+ import { getSortedRowModel as S, getCoreRowModel as b } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
6
+ function D({
7
+ data: l = [],
8
+ columns: m = [],
9
+ enableRowSelection: r = !0,
10
+ enableSorting: c = !0,
11
+ initialSorting: f = [],
12
+ onSortingChange: s,
13
+ className: w
14
+ }) {
15
+ const [R, p] = a({}), [i, g] = a(f), u = (o) => {
16
+ const n = typeof o == "function" ? o(i) : o;
17
+ g(n), s == null || s(n);
18
+ }, d = T({
19
+ data: l,
20
+ columns: m,
21
+ getCoreRowModel: b(),
22
+ getSortedRowModel: S(),
23
+ state: { rowSelection: R, sorting: i },
24
+ onRowSelectionChange: p,
25
+ onSortingChange: u,
26
+ enableRowSelection: r,
27
+ enableSorting: c
28
+ });
29
+ return /* @__PURE__ */ M(t.Root, { className: w, children: [
30
+ /* @__PURE__ */ e(t.Thead, { children: d.getHeaderGroups().map((o) => /* @__PURE__ */ e(
31
+ t.HeaderRow,
32
+ {
33
+ headerGroup: o,
34
+ enableRowSelection: r,
35
+ table: d
36
+ },
37
+ o.id
38
+ )) }),
39
+ /* @__PURE__ */ e(t.Tbody, { children: d.getRowModel().rows.map((o) => /* @__PURE__ */ e(
40
+ t.Row,
41
+ {
42
+ row: o,
43
+ enableRowSelection: r
44
+ },
45
+ o.id
46
+ )) })
47
+ ] });
48
+ }
49
+ export {
50
+ D as DataTableComponent,
51
+ D as default
52
+ };
@@ -0,0 +1,2 @@
1
+ import { createColumnHelper as TanstackCreateColumnHelper } from '@tanstack/react-table';
2
+ export declare const createColumnHelper: typeof TanstackCreateColumnHelper;
@@ -0,0 +1,5 @@
1
+ import { createColumnHelper as e } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
2
+ const o = e;
3
+ export {
4
+ o as createColumnHelper
5
+ };
@@ -0,0 +1,19 @@
1
+ import { createColumnHelper } from './createColumnHelper';
2
+ import { DataTableComponent, DataTableComponentProps } from './DataTableComponent';
3
+ import { BodyCell, Root, Row, HeaderRow, Thead, Tr, HeaderCheckbox, BodyCheckbox, Tbody, HeaderCell } from './table';
4
+ interface DataTableCompound {
5
+ <TData = Record<string, unknown>>(props: DataTableComponentProps<TData>): JSX.Element;
6
+ BodyCell: typeof BodyCell;
7
+ BodyCheckbox: typeof BodyCheckbox;
8
+ Tbody: typeof Tbody;
9
+ HeaderCell: typeof HeaderCell;
10
+ HeaderCheckbox: typeof HeaderCheckbox;
11
+ HeaderRow: typeof HeaderRow;
12
+ Root: typeof Root;
13
+ Row: typeof Row;
14
+ Thead: typeof Thead;
15
+ Tr: typeof Tr;
16
+ createColumnHelper: typeof createColumnHelper;
17
+ }
18
+ declare const DataTable: DataTableCompound;
19
+ export { DataTable, DataTableComponent };