@godxjp/ui 5.0.2 → 6.0.1

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 (242) hide show
  1. package/README.md +101 -142
  2. package/dist/app/index.d.ts +140 -0
  3. package/dist/app/index.js +38 -0
  4. package/dist/app.prop-IobwLwaM.d.ts +90 -0
  5. package/dist/checkbox-NkFkqsQ8.d.ts +13 -0
  6. package/dist/chunk-2XW7J3EI.js +226 -0
  7. package/dist/chunk-3F2AKYRD.js +416 -0
  8. package/dist/chunk-3KPEZ5CF.js +37 -0
  9. package/dist/chunk-3UGU5TYP.js +89 -0
  10. package/dist/chunk-6RA3KSVK.js +588 -0
  11. package/dist/chunk-7NZFVD24.js +122 -0
  12. package/dist/chunk-7PWBC4BY.js +25 -0
  13. package/dist/chunk-7S7MYFXE.js +61 -0
  14. package/dist/chunk-7WRZG2IG.js +71 -0
  15. package/dist/chunk-B775Y6BE.js +1 -0
  16. package/dist/chunk-BHV2FUOA.js +111 -0
  17. package/dist/chunk-BI3HERR7.js +70 -0
  18. package/dist/chunk-BPSKQUL2.js +68 -0
  19. package/dist/chunk-CDWPQ5RP.js +187 -0
  20. package/dist/chunk-CP2LET6N.js +244 -0
  21. package/dist/chunk-CQBADMFG.js +20 -0
  22. package/dist/chunk-CRERCLIZ.js +33 -0
  23. package/dist/chunk-DU6ZYZRP.js +238 -0
  24. package/dist/chunk-DY5C44UP.js +55 -0
  25. package/dist/chunk-E4HJNQ62.js +117 -0
  26. package/dist/chunk-E76QIYSY.js +93 -0
  27. package/dist/chunk-F7PG4OEV.js +37 -0
  28. package/dist/chunk-GDSVW62T.js +171 -0
  29. package/dist/chunk-H2FHJOLU.js +178 -0
  30. package/dist/chunk-HJEBRCXL.js +55 -0
  31. package/dist/chunk-ICM6XBST.js +16 -0
  32. package/dist/chunk-IK7I3ABN.js +88 -0
  33. package/dist/chunk-L6J44O74.js +144 -0
  34. package/dist/chunk-LDSLS6HE.js +1 -0
  35. package/dist/chunk-LVNUHUEZ.js +191 -0
  36. package/dist/chunk-M64MVRLS.js +92 -0
  37. package/dist/chunk-NGQW3KEM.js +402 -0
  38. package/dist/chunk-NZ4FOC5N.js +559 -0
  39. package/dist/chunk-PIIRNAXA.js +26 -0
  40. package/dist/chunk-S66TJXJU.js +33 -0
  41. package/dist/chunk-SMLKNECP.js +133 -0
  42. package/dist/chunk-TAHBM3F2.js +66 -0
  43. package/dist/chunk-TO33OY4L.js +150 -0
  44. package/dist/chunk-TO7URV7U.js +51 -0
  45. package/dist/chunk-TOO5AEKL.js +81 -0
  46. package/dist/chunk-U3GHAOIJ.js +299 -0
  47. package/dist/chunk-U7N2A7A3.js +9 -0
  48. package/dist/chunk-UX634MYF.js +123 -0
  49. package/dist/chunk-V6UWJKZF.js +28 -0
  50. package/dist/chunk-VOHTRR5X.js +28 -0
  51. package/dist/chunk-WRFKVUPW.js +332 -0
  52. package/dist/chunk-WXW43RK5.js +24 -0
  53. package/dist/chunk-XG7XDYIM.js +60 -0
  54. package/dist/chunk-YFCQKO3B.js +842 -0
  55. package/dist/chunk-ZDWXGWLY.js +73 -0
  56. package/dist/chunk-ZLK5SPT6.js +11 -0
  57. package/dist/chunk-ZS6DTAM2.js +31 -0
  58. package/dist/chunk-ZT5UEUBO.js +1 -0
  59. package/dist/components/admin/index.d.ts +80 -0
  60. package/dist/components/admin/index.js +38 -0
  61. package/dist/components/data-display/badge.d.ts +12 -0
  62. package/dist/components/data-display/badge.js +3 -0
  63. package/dist/components/data-display/card.d.ts +87 -0
  64. package/dist/components/data-display/card.js +2 -0
  65. package/dist/components/data-display/index.d.ts +72 -0
  66. package/dist/components/data-display/index.js +89 -0
  67. package/dist/components/data-display/popover.d.ts +13 -0
  68. package/dist/components/data-display/popover.js +2 -0
  69. package/dist/components/data-display/scroll-area.d.ts +7 -0
  70. package/dist/components/data-display/scroll-area.js +2 -0
  71. package/dist/components/data-display/table.d.ts +10 -0
  72. package/dist/components/data-display/table.js +3 -0
  73. package/dist/components/data-entry/autocomplete.d.ts +16 -0
  74. package/dist/components/data-entry/autocomplete.js +8 -0
  75. package/dist/components/data-entry/calendar.d.ts +16 -0
  76. package/dist/components/data-entry/calendar.js +4 -0
  77. package/dist/components/data-entry/cascader.d.ts +32 -0
  78. package/dist/components/data-entry/cascader.js +13 -0
  79. package/dist/components/data-entry/checkbox.d.ts +13 -0
  80. package/dist/components/data-entry/checkbox.js +4 -0
  81. package/dist/components/data-entry/color-picker.d.ts +16 -0
  82. package/dist/components/data-entry/color-picker.js +6 -0
  83. package/dist/components/data-entry/command.d.ts +69 -0
  84. package/dist/components/data-entry/command.js +3 -0
  85. package/dist/components/data-entry/date-picker.d.ts +16 -0
  86. package/dist/components/data-entry/date-picker.js +8 -0
  87. package/dist/components/data-entry/date-range-picker.d.ts +16 -0
  88. package/dist/components/data-entry/date-range-picker.js +8 -0
  89. package/dist/components/data-entry/index.d.ts +53 -0
  90. package/dist/components/data-entry/index.js +152 -0
  91. package/dist/components/data-entry/input.d.ts +6 -0
  92. package/dist/components/data-entry/input.js +2 -0
  93. package/dist/components/data-entry/label.d.ts +8 -0
  94. package/dist/components/data-entry/label.js +2 -0
  95. package/dist/components/data-entry/radio.d.ts +24 -0
  96. package/dist/components/data-entry/radio.js +4 -0
  97. package/dist/components/data-entry/select.d.ts +18 -0
  98. package/dist/components/data-entry/select.js +3 -0
  99. package/dist/components/data-entry/slider.d.ts +16 -0
  100. package/dist/components/data-entry/slider.js +2 -0
  101. package/dist/components/data-entry/switch.d.ts +17 -0
  102. package/dist/components/data-entry/switch.js +2 -0
  103. package/dist/components/data-entry/textarea.d.ts +6 -0
  104. package/dist/components/data-entry/textarea.js +3 -0
  105. package/dist/components/data-entry/time-picker.d.ts +16 -0
  106. package/dist/components/data-entry/time-picker.js +7 -0
  107. package/dist/components/data-entry/transfer.d.ts +17 -0
  108. package/dist/components/data-entry/transfer.js +11 -0
  109. package/dist/components/data-entry/tree-select.d.ts +26 -0
  110. package/dist/components/data-entry/tree-select.js +13 -0
  111. package/dist/components/data-entry/upload.d.ts +42 -0
  112. package/dist/components/data-entry/upload.js +11 -0
  113. package/dist/components/feedback/alert.d.ts +60 -0
  114. package/dist/components/feedback/alert.js +7 -0
  115. package/dist/components/feedback/dialog.d.ts +64 -0
  116. package/dist/components/feedback/dialog.js +7 -0
  117. package/dist/components/feedback/index.d.ts +16 -0
  118. package/dist/components/feedback/index.js +14 -0
  119. package/dist/components/feedback/sheet.d.ts +24 -0
  120. package/dist/components/feedback/sheet.js +2 -0
  121. package/dist/components/feedback/sonner.d.ts +6 -0
  122. package/dist/components/feedback/sonner.js +1 -0
  123. package/dist/components/general/button.d.ts +20 -0
  124. package/dist/components/general/button.js +2 -0
  125. package/dist/components/general/index.d.ts +6 -0
  126. package/dist/components/general/index.js +2 -0
  127. package/dist/components/layout/index.d.ts +71 -0
  128. package/dist/components/layout/index.js +5 -0
  129. package/dist/components/navigation/dropdown-menu.d.ts +28 -0
  130. package/dist/components/navigation/dropdown-menu.js +2 -0
  131. package/dist/components/navigation/index.d.ts +32 -0
  132. package/dist/components/navigation/index.js +12 -0
  133. package/dist/components/navigation/pagination.d.ts +11 -0
  134. package/dist/components/navigation/pagination.js +7 -0
  135. package/dist/components/navigation/steps.d.ts +12 -0
  136. package/dist/components/navigation/steps.js +3 -0
  137. package/dist/components/navigation/tabs-items.d.ts +12 -0
  138. package/dist/components/navigation/tabs-items.js +3 -0
  139. package/dist/components/navigation/tabs.d.ts +12 -0
  140. package/dist/components/navigation/tabs.js +2 -0
  141. package/dist/components/query/index.d.ts +43 -0
  142. package/dist/components/query/index.js +8 -0
  143. package/dist/components/ui/index.d.ts +57 -0
  144. package/dist/components/ui/index.js +37 -0
  145. package/dist/content.prop-D1Dd3TAc.d.ts +31 -0
  146. package/dist/data-display.prop-DNTAzmDy.d.ts +58 -0
  147. package/dist/data-entry.prop-BEGA1lTq.d.ts +323 -0
  148. package/dist/data-table-D1u_rKLK.d.ts +83 -0
  149. package/dist/data.prop-BVvfKC_g.d.ts +41 -0
  150. package/dist/feedback.prop-BmxUlpAW.d.ts +64 -0
  151. package/dist/filter-bar-B7OGFO9S.d.ts +10 -0
  152. package/dist/form/index.d.ts +21 -0
  153. package/dist/form/index.js +4 -0
  154. package/dist/form.prop-BHgpuFFm.d.ts +41 -0
  155. package/dist/format-date-ByyZoqI5.d.ts +51 -0
  156. package/dist/general.prop-D7brMPNL.d.ts +16 -0
  157. package/dist/i18n/index.d.ts +217 -0
  158. package/dist/i18n/index.js +2 -0
  159. package/dist/index.d.ts +46 -26
  160. package/dist/index.js +39 -13062
  161. package/dist/inline-C5u6ptJV.d.ts +10 -0
  162. package/dist/interaction.prop-Cdn7wOtq.d.ts +25 -0
  163. package/dist/layout.prop-4TCNvyQZ.d.ts +20 -0
  164. package/dist/layout.prop-C795F0qg.d.ts +112 -0
  165. package/dist/lib/datetime/index.d.ts +31 -0
  166. package/dist/lib/datetime/index.js +1 -0
  167. package/dist/lib/utils.d.ts +5 -0
  168. package/dist/lib/utils.js +1 -0
  169. package/dist/navigation.prop-DpZqcXey.d.ts +78 -0
  170. package/dist/navigation.prop-DxBiClEH.d.ts +20 -0
  171. package/dist/props/components/index.d.ts +27 -0
  172. package/dist/props/components/index.js +1 -0
  173. package/dist/props/index.d.ts +28 -0
  174. package/dist/props/index.js +3 -0
  175. package/dist/props/registry.d.ts +649 -0
  176. package/dist/props/registry.js +1 -0
  177. package/dist/props/vocabulary/index.d.ts +7 -0
  178. package/dist/props/vocabulary/index.js +1 -0
  179. package/dist/query.prop-hIPrk2zI.d.ts +71 -0
  180. package/dist/search-input-uP01rY1L.d.ts +22 -0
  181. package/dist/shared.prop-BNRJc9K0.d.ts +45 -0
  182. package/dist/styles/alert-layout.css +191 -0
  183. package/dist/styles/badge-layout.css +22 -0
  184. package/dist/styles/card-layout.css +373 -0
  185. package/dist/styles/control.css +504 -0
  186. package/dist/styles/data-display-layout.css +246 -0
  187. package/dist/styles/density.css +43 -0
  188. package/dist/styles/dialog-layout.css +84 -0
  189. package/dist/styles/index.css +105 -0
  190. package/dist/styles/layout.css +479 -0
  191. package/dist/styles/shell-layout.css +604 -0
  192. package/dist/styles/table-layout.css +109 -0
  193. package/dist/theme/example.service.css +37 -0
  194. package/dist/tokens/base.css +13 -0
  195. package/dist/tokens/foundation.css +151 -0
  196. package/dist/tokens/primitives/badge.css +13 -0
  197. package/dist/tokens/primitives/card.css +29 -0
  198. package/dist/tokens/primitives/control.css +55 -0
  199. package/dist/tokens/primitives/feedback.css +17 -0
  200. package/dist/tokens/primitives/layout.css +20 -0
  201. package/dist/tokens/primitives/navigation.css +13 -0
  202. package/dist/tokens/primitives/table.css +10 -0
  203. package/dist/types-mvzYGrma.d.ts +37 -0
  204. package/dist/use-toast-Dol5bdY3.d.ts +34 -0
  205. package/package.json +279 -117
  206. package/scripts/ui-audit.mjs +179 -0
  207. package/BRAND.md +0 -296
  208. package/CHANGELOG.md +0 -668
  209. package/config/eslint.js +0 -54
  210. package/config/prettier.cjs +0 -20
  211. package/config/tsconfig.base.json +0 -22
  212. package/config/vitest.base.ts +0 -26
  213. package/dist/MiniMonth-YAmPGEpC.d.ts +0 -143
  214. package/dist/Table.types-BbsxoIYE.d.ts +0 -352
  215. package/dist/color-DO0qqUAb.d.ts +0 -38
  216. package/dist/components/composites.d.ts +0 -963
  217. package/dist/components/composites.js +0 -7343
  218. package/dist/components/composites.js.map +0 -1
  219. package/dist/components/primitives.d.ts +0 -2744
  220. package/dist/components/primitives.js +0 -7356
  221. package/dist/components/primitives.js.map +0 -1
  222. package/dist/components/shell.d.ts +0 -182
  223. package/dist/components/shell.js +0 -774
  224. package/dist/components/shell.js.map +0 -1
  225. package/dist/hooks.d.ts +0 -100
  226. package/dist/hooks.js +0 -558
  227. package/dist/hooks.js.map +0 -1
  228. package/dist/i18n.d.ts +0 -61
  229. package/dist/i18n.js +0 -860
  230. package/dist/i18n.js.map +0 -1
  231. package/dist/index.js.map +0 -1
  232. package/dist/padding-DY0JV5Ja.d.ts +0 -16
  233. package/dist/preferences.d.ts +0 -132
  234. package/dist/preferences.js +0 -262
  235. package/dist/preferences.js.map +0 -1
  236. package/dist/props.d.ts +0 -86
  237. package/dist/props.js +0 -16
  238. package/dist/props.js.map +0 -1
  239. package/dist/size-CQwNvOWd.d.ts +0 -19
  240. package/dist/types-LTj-2bl-.d.ts +0 -30
  241. package/dist/useTableViews-D5NIAJ7h.d.ts +0 -154
  242. package/src/tokens/tailwind.css +0 -158
package/config/eslint.js DELETED
@@ -1,54 +0,0 @@
1
- // @godxjp/ui — shared ESLint flat config.
2
- //
3
- // Consume in a service frontend with a single line:
4
- //
5
- // // eslint.config.js
6
- // export { default } from "@godxjp/ui/eslint-config"
7
- //
8
- // Locked stack (umbrella frontend-architecture spec §9):
9
- // ESLint 9.x + typescript-eslint 8.x (strict + stylistic)
10
- // eslint-plugin-react 7.x + eslint-plugin-react-hooks 5.x
11
- // eslint-plugin-jsx-a11y 6.x (WCAG 2.1 AA in JSX)
12
- // eslint-config-prettier (turns off formatting conflicts)
13
- //
14
- // This file is intentionally kept dependency-free at the @godxjp/ui level
15
- // so it can be consumed before peerDependencies install. The locked rule
16
- // sets above are declared as peerDependencies by the consumer's package.json;
17
- // when a service uses the umbrella workspace those peers resolve automatically.
18
-
19
- /** @type {import("eslint").Linter.Config[]} */
20
- const config = [
21
- {
22
- // Global ignores — applies before any rules.
23
- ignores: ["dist/**", "node_modules/**", "*.d.ts"],
24
- },
25
- {
26
- files: ["**/*.{ts,tsx}"],
27
- languageOptions: {
28
- parserOptions: {
29
- ecmaVersion: "latest",
30
- sourceType: "module",
31
- ecmaFeatures: { jsx: true },
32
- },
33
- },
34
- rules: {
35
- // React 19 does not require the React import for JSX.
36
- "react/react-in-jsx-scope": "off",
37
- // Always exhaustive deps.
38
- "react-hooks/exhaustive-deps": "warn",
39
- // Accessibility baseline.
40
- "jsx-a11y/alt-text": "error",
41
- "jsx-a11y/aria-props": "error",
42
- "jsx-a11y/aria-proptypes": "error",
43
- "jsx-a11y/aria-unsupported-elements": "error",
44
- "jsx-a11y/role-has-required-aria-props": "error",
45
- "jsx-a11y/role-supports-aria-props": "error",
46
- "jsx-a11y/interactive-supports-focus": "warn",
47
- "jsx-a11y/click-events-have-key-events": "warn",
48
- // No console in production code.
49
- "no-console": ["warn", { allow: ["warn", "error"] }],
50
- },
51
- },
52
- ]
53
-
54
- export default config
@@ -1,20 +0,0 @@
1
- // @godxjp/ui — shared Prettier config.
2
- //
3
- // Consume in a service frontend:
4
- // // .prettierrc.json → "prettier": "@godxjp/ui/prettier-config"
5
- // // or package.json: "prettier": "@godxjp/ui/prettier-config"
6
-
7
- /** @type {import("prettier").Config} */
8
- module.exports = {
9
- semi: false,
10
- singleQuote: false,
11
- trailingComma: "all",
12
- printWidth: 100,
13
- tabWidth: 2,
14
- useTabs: false,
15
- bracketSameLine: false,
16
- arrowParens: "always",
17
- endOfLine: "lf",
18
- // Tailwind class sorting — service must install prettier-plugin-tailwindcss separately.
19
- plugins: [],
20
- }
@@ -1,22 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "compilerOptions": {
4
- "target": "ES2022",
5
- "lib": ["ES2022", "DOM", "DOM.Iterable"],
6
- "module": "ESNext",
7
- "moduleResolution": "Bundler",
8
- "jsx": "react-jsx",
9
- "strict": true,
10
- "noUncheckedIndexedAccess": true,
11
- "noImplicitOverride": true,
12
- "exactOptionalPropertyTypes": true,
13
- "noPropertyAccessFromIndexSignature": false,
14
- "skipLibCheck": true,
15
- "isolatedModules": true,
16
- "esModuleInterop": false,
17
- "allowSyntheticDefaultImports": true,
18
- "resolveJsonModule": true,
19
- "forceConsistentCasingInFileNames": true,
20
- "verbatimModuleSyntax": true
21
- }
22
- }
@@ -1,26 +0,0 @@
1
- // @godxjp/ui — shared Vitest config base.
2
- //
3
- // Consume in a service frontend:
4
- //
5
- // // vitest.config.ts
6
- // import base from "@godxjp/ui/vitest-config"
7
- // import { mergeConfig } from "vitest/config"
8
- // export default mergeConfig(base, { test: { /* service overrides */ } })
9
-
10
- import { defineConfig } from "vitest/config"
11
-
12
- export default defineConfig({
13
- test: {
14
- environment: "jsdom",
15
- globals: false,
16
- include: ["src/**/*.test.{ts,tsx}"],
17
- exclude: ["e2e/**", "dist/**", "node_modules/**"],
18
- coverage: {
19
- provider: "v8",
20
- thresholds: {
21
- statements: 75,
22
- branches: 70,
23
- },
24
- },
25
- },
26
- })
@@ -1,143 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode, HTMLAttributes, ComponentProps } from 'react';
3
- import { S as SizeProp } from './size-CQwNvOWd.js';
4
-
5
- type SegmentedControlVariant = "bar" | "pill";
6
- /** Subset of the shared `SizeProp` — SegmentedControl only ships the
7
- * two compact-side rungs in practice (no `"large"` design canon yet). */
8
- type SegmentedControlSize = Exclude<SizeProp, "large">;
9
- type SegmentedControlOrientation = "horizontal" | "vertical";
10
- interface SegmentedControlItem<V extends string = string> {
11
- value: V;
12
- label: ReactNode;
13
- icon?: ReactNode;
14
- disabled?: boolean;
15
- }
16
- interface SegmentedControlProps<V extends string = string> extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
17
- items: SegmentedControlItem<V>[];
18
- value?: V;
19
- defaultValue?: V;
20
- onChange?: (next: V) => void;
21
- variant?: SegmentedControlVariant;
22
- size?: SegmentedControlSize;
23
- /** Axis of the radiogroup — controls Arrow-key direction for the
24
- * roving-tabindex pattern (per WAI-ARIA APG radiogroup). */
25
- orientation?: SegmentedControlOrientation;
26
- /** Accessible name for the group — falls back to a generic role label. */
27
- "aria-label"?: string;
28
- }
29
- declare function SegmentedControl<V extends string = string>({ items, value: controlled, defaultValue, onChange, variant, size, orientation, className, ...rest }: SegmentedControlProps<V>): react_jsx_runtime.JSX.Element;
30
-
31
- /**
32
- * Locale used by `fmtHour`. Adds the JA suffix style (`9時`) for `ja`
33
- * and keeps `HH:00` for everything else.
34
- */
35
- type TimeLocale = "vi" | "ja" | "en";
36
- /** Parse "HH:MM" into { h, m }. Tolerates missing minutes. */
37
- declare function parseHM(value: string): {
38
- h: number;
39
- m: number;
40
- };
41
- /** Pixel offset for a given clock time within a day-grid column. */
42
- declare function minToY(h: number, m: number, options: {
43
- dayStartH: number;
44
- pxPerMin: number;
45
- }): number;
46
- /** Format an hour cell label per locale. */
47
- declare function fmtHour(h: number, locale: TimeLocale): string;
48
- /** Default day-grid sizing the WeekView / DayView screens use. */
49
- declare const DEFAULT_GRID: {
50
- readonly dayStartH: 6;
51
- readonly dayEndH: 22;
52
- readonly pxPerMin: 0.9;
53
- };
54
- /**
55
- * Build a 6×7 Mon-first month grid for (year, monthIdx1to12). Lead-in
56
- * cells from the previous month and tail cells from the next month are
57
- * flagged `dim: true`. Shared by MiniMonth + MonthView.
58
- */
59
- interface MonthCellRef {
60
- y: number;
61
- m: number;
62
- d: number;
63
- dim: boolean;
64
- }
65
- declare function buildMonthGrid(year: number, month: number): MonthCellRef[];
66
- /** YYYY-MM-DD key for a {y,m,d} triple. */
67
- declare function ymd(y: number, m: number, d: number): string;
68
-
69
- interface CalendarEvent {
70
- id: string;
71
- /** Color reference — `CalendarRef.id` whose `color` paints the event. */
72
- calId: string;
73
- title: string;
74
- /** YYYY-MM-DD. */
75
- date: string;
76
- allDay?: boolean;
77
- /** HH:MM (24h). Required when `allDay` is false. */
78
- start?: string;
79
- /** HH:MM (24h). Required when `allDay` is false. */
80
- end?: string;
81
- attendees: string[];
82
- /** Free-form status — caller decides which strings are meaningful. */
83
- status?: string;
84
- /** Free-form event kind — caller decides. */
85
- type?: string;
86
- location?: string;
87
- note?: string;
88
- }
89
- interface CalendarRef {
90
- id: string;
91
- name: string;
92
- color: string;
93
- shown?: boolean;
94
- /** Optional grouping bucket used by sidebar lists. */
95
- group?: string;
96
- /** True for read-only feeds (e.g. national holidays). */
97
- readonly?: boolean;
98
- }
99
- interface PersonRef {
100
- id: string;
101
- name: string;
102
- /** Short label (2–3 chars) for avatar text. */
103
- short: string;
104
- color: string;
105
- email?: string;
106
- org?: string;
107
- role?: string;
108
- /** Marks the viewer themselves. */
109
- self?: boolean;
110
- }
111
- /**
112
- * Visual treatment hint for an EventBlock — separated from
113
- * `CalendarEvent.status` so the primitive stays generic. Consumers map
114
- * their `type` + `status` into one of these.
115
- */
116
- type EventBlockVariant = "solid" | "tint" | "tentative" | "focus";
117
-
118
- /**
119
- * MiniMonth — compact 6×7 month grid for sidebars and date pickers.
120
- * Mon-first, 22px-cell. Renders an event dot when `eventDots[ymd]` is
121
- * truthy and `--accent-color` for today/selected states.
122
- */
123
- interface MiniMonthYMD {
124
- y: number;
125
- m: number;
126
- d: number;
127
- }
128
- interface MiniMonthProps extends Omit<ComponentProps<"div">, "onSelect"> {
129
- /** Year of the grid. */
130
- year: number;
131
- /** Month (1–12) of the grid. */
132
- month: number;
133
- today: MiniMonthYMD;
134
- selected?: MiniMonthYMD;
135
- /** Map of YYYY-MM-DD → has-event boolean. */
136
- eventDots?: Record<string, boolean>;
137
- onSelect?: (ymd: MiniMonthYMD) => void;
138
- /** Day-of-week labels — Mon-first. Default JA single chars. */
139
- dowLabels?: readonly [string, string, string, string, string, string, string];
140
- }
141
- declare function MiniMonth({ year, month, today, selected, eventDots, onSelect, dowLabels, className, ...rest }: MiniMonthProps): react_jsx_runtime.JSX.Element;
142
-
143
- export { type CalendarEvent as C, DEFAULT_GRID as D, type EventBlockVariant as E, MiniMonth as M, type PersonRef as P, SegmentedControl as S, type TimeLocale as T, type CalendarRef as a, type MiniMonthProps as b, type MiniMonthYMD as c, type MonthCellRef as d, type SegmentedControlItem as e, type SegmentedControlOrientation as f, type SegmentedControlProps as g, type SegmentedControlSize as h, type SegmentedControlVariant as i, buildMonthGrid as j, fmtHour as k, minToY as m, parseHM as p, ymd as y };
@@ -1,352 +0,0 @@
1
- import { RowData, Row as Row$1, ColumnDef, VisibilityState, ColumnPinningState, Table } from '@tanstack/react-table';
2
- import { ComponentProps, ReactNode, MouseEvent, CSSProperties, Ref, HTMLAttributes } from 'react';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { C as ColorProp, D as DensityProp } from './color-DO0qqUAb.js';
5
-
6
- type GutterValue = number | [number, number] | Partial<Record<Breakpoint, number>>;
7
- type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
8
- type Justify = "start" | "end" | "center" | "space-around" | "space-between" | "space-evenly";
9
- type Align = "top" | "middle" | "bottom" | "stretch";
10
- interface RowProps extends Omit<ComponentProps<"div">, "children"> {
11
- /** Horizontal gap (px), or [horizontal, vertical], or per-breakpoint object. */
12
- gutter?: GutterValue;
13
- /** Flex justify on the cross axis. */
14
- justify?: Justify;
15
- /** Flex align on the main axis. */
16
- align?: Align;
17
- /** Wrap children when sum > 24 cols (default true). */
18
- wrap?: boolean;
19
- children?: ReactNode;
20
- }
21
- declare function useRowGutter(): [number, number];
22
- declare function Row({ gutter, justify, align, wrap, className, style, children, ...rest }: RowProps): react_jsx_runtime.JSX.Element;
23
-
24
- /**
25
- * Tag — Ant-Design label chip.
26
- *
27
- * <Tag>basic</Tag>
28
- * <Tag color="success">done</Tag>
29
- * <Tag color="oklch(56% 0.15 240)">custom hue</Tag>
30
- * <Tag closable onClose={() => …}>removable</Tag>
31
- * <Tag bordered={false}>borderless</Tag>
32
- *
33
- * Distinct from <Badge>: Badge is for status pills (a numeric or
34
- * single short word), Tag is for labels (potentially many in a row,
35
- * potentially closable).
36
- */
37
- /**
38
- * Tag accepts the framework's full semantic palette except `"secondary"`
39
- * (that one is reserved for Typography text-dimming). Aliased from the
40
- * shared `ColorProp` so the vocabulary stays in lockstep with Alert,
41
- * Result, Timeline, etc.
42
- */
43
- type TagPresetColor = Exclude<ColorProp, "secondary">;
44
- interface TagProps extends Omit<ComponentProps<"span">, "color"> {
45
- /** Preset hue or a custom CSS color. */
46
- color?: TagPresetColor | string;
47
- /** Show outline (default `true`). Borderless = solid-tinted background only. */
48
- bordered?: boolean;
49
- /** Show an × button. Calls `onClose`. */
50
- closable?: boolean;
51
- onClose?: (e: MouseEvent<HTMLButtonElement>) => void;
52
- /** Leading icon. */
53
- icon?: ReactNode;
54
- }
55
- declare function Tag({ color, bordered, closable, onClose, icon, className, style, children, ...rest }: TagProps): react_jsx_runtime.JSX.Element;
56
-
57
- /**
58
- * @godxjp/ui Table — type surface.
59
- *
60
- * Split out of `Table.tsx` in Stage 4 of the refactor (Plan §3) so
61
- * the primitive file focuses on rendering + state, while consumers
62
- * and the `<DataTable>` composite consume a focused type module.
63
- *
64
- * Also hosts the TanStack `ColumnMeta` augmentation — every consumer
65
- * that touches a `meta` field benefits from the typed interface.
66
- */
67
-
68
- type TableStickySide = "left" | "right";
69
- type TableStickyConfig = TableStickySide | false | {
70
- side: TableStickySide;
71
- from?: Breakpoint;
72
- };
73
- declare module "@tanstack/react-table" {
74
- /**
75
- * Primitive-level `ColumnMeta` — fields consumed by the `<Table>`
76
- * primitive itself: cell rendering, sort UI in headers, sticky
77
- * positioning.
78
- *
79
- * Composite-only fields (`filterable`, `filterLabel`,
80
- * `filterOptions`, `hideable`) live in
81
- * `composites/data-table/DataTable.types.ts` and are merged into
82
- * `ColumnMeta` whenever a consumer imports from
83
- * `@godxjp/ui/components/composites`.
84
- */
85
- interface ColumnMeta<TData extends RowData, TValue> {
86
- className?: string;
87
- headerClassName?: string;
88
- cellClassName?: string | ((row: Row$1<TData>) => string | undefined);
89
- style?: CSSProperties;
90
- headerStyle?: CSSProperties;
91
- cellStyle?: CSSProperties | ((row: Row$1<TData>) => CSSProperties | undefined);
92
- sortable?: boolean;
93
- sticky?: TableStickyConfig;
94
- }
95
- }
96
-
97
- type TableDensity = DensityProp;
98
- type TableColumn<TData, TValue = unknown> = ColumnDef<TData, TValue>;
99
- type TableColumnVisibility = VisibilityState;
100
- type TableRowKey<TData> = Extract<keyof TData, string> | ((row: TData, index: number) => string | number);
101
- type TableFilterOperator = "eq" | "neq" | "contains" | "startsWith" | "endsWith" | "gt" | "gte" | "lt" | "lte" | "between" | "in";
102
- interface TableFilter {
103
- key: string;
104
- operator?: TableFilterOperator;
105
- value?: string | number | boolean | null;
106
- valueLabel?: ReactNode;
107
- }
108
- interface TableSort {
109
- key: string;
110
- direction: "asc" | "desc";
111
- }
112
- /** Multi-sort: ordered list whose head is the primary key. */
113
- type TableSortState = TableSort | TableSort[] | null;
114
- /** Numbered pagination (default behaviour for general lists). */
115
- interface TablePaginationNumberedConfig {
116
- type?: "numbered";
117
- current: number;
118
- pageSize: number;
119
- total: number;
120
- pageSizeOptions?: number[];
121
- showSizeChanger?: boolean;
122
- hideOnSinglePage?: boolean;
123
- disabled?: boolean;
124
- showTotal?: (total: number, range: [number, number]) => ReactNode;
125
- onChange?: (page: number, pageSize: number) => void;
126
- }
127
- /** Load-more pagination (feed-like activity / notification lists). */
128
- interface TablePaginationLoadMoreConfig {
129
- type: "load-more";
130
- hasMore: boolean;
131
- onLoadMore: () => void;
132
- currentCount: number;
133
- total: number;
134
- batchSize?: number;
135
- loadingMore?: boolean;
136
- loadMoreLabel?: ReactNode;
137
- progressLabel?: (currentCount: number, total: number) => ReactNode;
138
- }
139
- /** Cursor pagination (time-series jump-to-period for kintai / payroll). */
140
- interface TablePaginationCursorConfig {
141
- type: "cursor";
142
- value: string;
143
- onChange: (value: string) => void;
144
- label: ReactNode;
145
- prevLabel?: ReactNode;
146
- nextLabel?: ReactNode;
147
- jumpToLatestLabel?: ReactNode;
148
- /** HTML input type — `"month"` (default), `"date"`, or `"week"`. */
149
- inputType?: "month" | "date" | "week";
150
- onPrev?: () => void;
151
- onNext?: () => void;
152
- onJumpToLatest?: () => void;
153
- disabled?: boolean;
154
- }
155
- type TablePaginationVariantConfig = TablePaginationNumberedConfig | TablePaginationLoadMoreConfig | TablePaginationCursorConfig;
156
- interface TableViewSnapshot {
157
- filters?: TableFilter[];
158
- sort?: TableSort | null;
159
- columnVisibility?: TableColumnVisibility;
160
- }
161
- interface TableViewItem extends TableViewSnapshot {
162
- key: string;
163
- label: ReactNode;
164
- count?: ReactNode;
165
- dotColor?: string;
166
- disabled?: boolean;
167
- deletable?: boolean;
168
- }
169
- interface TableViewsConfig {
170
- items: TableViewItem[];
171
- activeKey?: string;
172
- onActiveKeyChange?: (key: string) => void;
173
- onViewApply?: (view: TableViewItem) => void;
174
- onDeleteView?: (view: TableViewItem) => void;
175
- onItemsChange?: (items: TableViewItem[]) => void;
176
- saveable?: boolean;
177
- saveLabel?: ReactNode;
178
- deleteLabel?: string;
179
- onSaveCurrent?: () => void;
180
- }
181
- interface TableToolbarSearchConfig {
182
- value: string;
183
- onValueChange: (value: string) => void;
184
- onSearch?: (value: string) => void;
185
- onClear?: () => void;
186
- placeholder?: string;
187
- ariaLabel?: string;
188
- inputRef?: Ref<HTMLInputElement>;
189
- suffix?: ReactNode;
190
- disabled?: boolean;
191
- }
192
- interface TableToolbarButtonConfig {
193
- label?: ReactNode;
194
- onClick?: () => void;
195
- disabled?: boolean;
196
- }
197
- interface TableToolbarFilterConfig extends TableToolbarButtonConfig {
198
- count?: number;
199
- }
200
- type TableToolbarColumnConfig = TableToolbarButtonConfig;
201
- interface TableToolbarConfig {
202
- search?: false | TableToolbarSearchConfig;
203
- filter?: false | TableToolbarFilterConfig;
204
- columns?: false | TableToolbarColumnConfig;
205
- primaryAction?: false | ReactNode | TableToolbarButtonConfig;
206
- actions?: ReactNode;
207
- }
208
- interface TableBatchActionsContext<TData> {
209
- selectedRowKeys: string[];
210
- selectedRows: Row$1<TData>[];
211
- totalSelectableCount: number;
212
- selectAllVisible: () => void;
213
- clearSelection: () => void;
214
- }
215
- interface TableBatchActionsConfig<TData> {
216
- selectedRowKeys: string[];
217
- onSelectedRowKeysChange: (keys: string[]) => void;
218
- actions: ReactNode | ((context: TableBatchActionsContext<TData>) => ReactNode);
219
- getCheckboxDisabled?: (row: Row$1<TData>) => boolean;
220
- selectedLabel?: (count: number) => ReactNode;
221
- selectAllLabel?: (count: number) => ReactNode;
222
- clearLabel?: ReactNode;
223
- }
224
- interface TableFilterOption {
225
- value: string;
226
- label: ReactNode;
227
- disabled?: boolean;
228
- }
229
- interface TableFilterItem {
230
- key: string;
231
- label: ReactNode;
232
- value?: string;
233
- valueLabel?: ReactNode;
234
- operator?: TableFilterOperator;
235
- options?: TableFilterOption[];
236
- onValueChange?: (value: string) => void;
237
- color?: TagPresetColor | string;
238
- closable?: boolean;
239
- onClose?: () => void;
240
- }
241
- type TableFilterBar = ReactNode | TableFilterItem[];
242
- type TablePagination = ReactNode | false | TablePaginationVariantConfig;
243
- type TableToolbar = ReactNode | false | TableToolbarConfig;
244
- type TableViews = ReactNode | false | TableViewsConfig;
245
- /** Expand-row config (rule 32 — no `expanded`-singular / `expand` synonyms). */
246
- interface TableExpandableConfig<TData> {
247
- /** Rows whose expand panel is open. */
248
- expandedRowKeys?: string[];
249
- defaultExpandedRowKeys?: string[];
250
- onExpandedRowsChange?: (keys: string[]) => void;
251
- /** Renders the inline detail panel. */
252
- renderExpandedRow: (row: Row$1<TData>) => ReactNode;
253
- /** Allows more than one open expand panel at a time. Default `false`. */
254
- allowMultiple?: boolean;
255
- /** Hide the expand toggle for rows that have no detail panel. */
256
- rowExpandable?: (row: Row$1<TData>) => boolean;
257
- }
258
- /** Inline-edit config — single editing row, multi-row dirty tracking. */
259
- interface TableEditingConfig<TData> {
260
- /** The row currently in editing mode. `null` exits editing. */
261
- rowId: string | null;
262
- onStart?: (rowId: string) => void;
263
- onCommit?: (rowId: string, patch: Record<string, unknown>) => void;
264
- onCancel?: (rowId: string) => void;
265
- /** Renders an inline editor for a cell. Return `null` to fall back to the column's normal cell. */
266
- renderEditCell?: (column: TableColumn<TData, unknown>, row: Row$1<TData>) => ReactNode;
267
- /** Rows that should be read-only (confirmed records / locked rows). */
268
- isRowReadOnly?: (row: Row$1<TData>) => boolean;
269
- /** Row + cell ids that carry unsaved changes — for the warning dot + footer banner. */
270
- dirtyRowIds?: string[];
271
- dirtyCellIds?: string[];
272
- /** Footer banner — show "N rows unsaved" + Save-all / Cancel-all controls. */
273
- onSaveAll?: () => void;
274
- onCancelAll?: () => void;
275
- saveAllLabel?: ReactNode;
276
- cancelAllLabel?: ReactNode;
277
- unsavedLabel?: (count: number) => ReactNode;
278
- }
279
- /** Row-group config — either a key resolver or a richer descriptor. */
280
- interface TableGroupDescriptor {
281
- key: string;
282
- label: ReactNode;
283
- count?: ReactNode;
284
- total?: ReactNode;
285
- }
286
- type TableGroupBy<TData> = (row: TData) => string | TableGroupDescriptor | undefined;
287
- /** Tree-row config. Children are resolved per parent row. */
288
- interface TableTreeConfig<TData> {
289
- children: (row: TData) => TData[] | undefined;
290
- defaultExpandedNodes?: string[];
291
- expandedNodes?: string[];
292
- onExpandedNodesChange?: (keys: string[]) => void;
293
- /** Hard cap on nesting depth (defaults to a reasonable 8). */
294
- maxDepth?: number;
295
- }
296
- /** Column-pinning callback (TanStack-canonical name). */
297
- type TableColumnPinningChange = (pinning: ColumnPinningState) => void;
298
- /**
299
- * Selection slice the slim primitive understands — strictly the
300
- * checkbox column wiring. The batch action band that surfaces
301
- * actions lives on the `<DataTable>` composite (Stage 4b, v5.0.0).
302
- */
303
- interface TableSelectionConfig<TData> {
304
- selectedRowKeys: string[];
305
- onSelectedRowKeysChange: (keys: string[]) => void;
306
- getCheckboxDisabled?: (row: Row$1<TData>) => boolean;
307
- }
308
- interface TableProps<TData> extends Omit<HTMLAttributes<HTMLTableElement>, "children"> {
309
- columns: TableColumn<TData, unknown>[];
310
- data: TData[];
311
- density?: TableDensity;
312
- containerClassName?: string;
313
- stickyHeader?: boolean;
314
- rowKey?: TableRowKey<TData>;
315
- getRowId?: (row: TData, index: number) => string;
316
- caption?: ReactNode;
317
- defaultColumnVisibility?: TableColumnVisibility;
318
- columnVisibility?: TableColumnVisibility;
319
- onColumnVisibilityChange?: (columnVisibility: TableColumnVisibility) => void;
320
- /**
321
- * Active sort. Pass a single `TableSort` for single-key sort (legacy)
322
- * or `TableSort[]` for multi-sort (shift-click adds keys; canon ⑤).
323
- */
324
- sort?: TableSortState;
325
- onSortChange?: (sort: TableSortState) => void;
326
- /** Enable per-column horizontal resize handles (canon ⑤). */
327
- resizable?: boolean;
328
- /** Inline expand-row config (canon ⑥). */
329
- expandable?: TableExpandableConfig<TData>;
330
- /** Inline editing config (canon ⑦). */
331
- editing?: TableEditingConfig<TData>;
332
- /** Row-group descriptor — same vocabulary as TanStack `getGroupedRowModel`. */
333
- groupBy?: TableGroupBy<TData>;
334
- /** Tree-row resolver (canon ⑧, hierarchical rows). */
335
- tree?: TableTreeConfig<TData>;
336
- /** Receives column-pinning changes from the column manager lock toggle (canon ⑨). */
337
- onColumnPinningChange?: TableColumnPinningChange;
338
- /** Checkbox-column wiring. Use the `<DataTable>` composite for the batch action band. */
339
- selection?: TableSelectionConfig<TData>;
340
- footer?: ReactNode;
341
- empty?: ReactNode;
342
- rowClassName?: string | ((row: Row$1<TData>) => string | undefined);
343
- /**
344
- * Pre-built TanStack `useReactTable` instance, supplied by the
345
- * `<DataTable>` composite. When provided, the primitive skips
346
- * its internal `useReactTable` and consumes the externally-managed
347
- * instance.
348
- */
349
- instance?: Table<TData>;
350
- }
351
-
352
- export { type Align as A, type Breakpoint as B, useRowGutter as C, type GutterValue as G, type Justify as J, Row as R, type TableBatchActionsConfig as T, type RowProps as a, type TableColumn as b, type TableColumnPinningChange as c, type TableColumnVisibility as d, type TableDensity as e, type TableEditingConfig as f, type TableExpandableConfig as g, type TableFilter as h, type TableFilterBar as i, type TableFilterOption as j, type TableGroupBy as k, type TablePagination as l, type TableProps as m, type TableRowKey as n, type TableSelectionConfig as o, type TableSort as p, type TableSortState as q, type TableToolbar as r, type TableToolbarConfig as s, type TableTreeConfig as t, type TableViewItem as u, type TableViewSnapshot as v, type TableViews as w, Tag as x, type TagPresetColor as y, type TagProps as z };
@@ -1,38 +0,0 @@
1
- /**
2
- * Shared density prop-vocabulary per cardinal rule 23 §B.
3
- *
4
- * Different from `SizeProp` — density rescales the surrounding padding /
5
- * row-height tokens (`--density-element-*`) while size targets the
6
- * primitive's own visual axis. Tables and lists use `density` to fit
7
- * more rows on screen without shrinking the type.
8
- */
9
- type DensityProp = "compact" | "default" | "comfortable";
10
-
11
- /**
12
- * Shared semantic-color prop-vocabulary per cardinal rule 23 §B.
13
- *
14
- * Every primitive that exposes a `color` prop picks from this superset.
15
- * Each value maps 1:1 to a CSS variable (`--info`, `--success`,
16
- * `--warning`, `--destructive`, `--attention`, `--primary`, `--secondary`)
17
- * — same semantic slot across the whole system, only the hue / intensity
18
- * scale shifts per primitive (cardinal rule 21 — `data-accent` rebinds
19
- * `--primary`'s hue without renaming the slot).
20
- *
21
- * Existing primitives (AlertColor, ResultColor, ProgressColor,
22
- * TagPresetColor, TimelineColor, TypographyColor) each accept a subset
23
- * — point their aliases at `Extract<ColorProp, …>` instead of
24
- * redeclaring the literals inline.
25
- *
26
- * Vocabulary note: the canonical name for the danger slot in this
27
- * palette is `"destructive"` — every primitive that exposes a `color`
28
- * prop now uses that name. The shared `StatusProp` (form-field
29
- * validation) uses `"error"` deliberately — form errors are NOT
30
- * destructive actions; the two concerns deserve distinct verbs.
31
- */
32
- type ColorProp = "default" | "info" | "success" | "warning" | "destructive" | "attention" | "primary" | "secondary";
33
- /** Subset accepted by feedback primitives — same 5-slot ladder used
34
- * by Alert / Result / Progress (no brand `primary`, no text-only
35
- * `secondary` / `attention`). */
36
- type FeedbackColorProp = Extract<ColorProp, "default" | "info" | "success" | "warning" | "destructive">;
37
-
38
- export type { ColorProp as C, DensityProp as D, FeedbackColorProp as F };