@mindlogic-ai/logician-ui 5.0.0-alpha.11 → 5.0.0-alpha.13

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 (89) hide show
  1. package/README.md +1 -0
  2. package/dist/components/Input/Input.d.ts.map +1 -1
  3. package/dist/components/Input/Input.js +4 -0
  4. package/dist/components/Input/Input.js.map +1 -1
  5. package/dist/components/Input/Input.mjs +4 -0
  6. package/dist/components/Input/Input.mjs.map +1 -1
  7. package/dist/components/NavList/NavList.d.ts +34 -0
  8. package/dist/components/NavList/NavList.d.ts.map +1 -0
  9. package/dist/components/NavList/NavList.js +113 -0
  10. package/dist/components/NavList/NavList.js.map +1 -0
  11. package/dist/components/NavList/NavList.mjs +111 -0
  12. package/dist/components/NavList/NavList.mjs.map +1 -0
  13. package/dist/components/NavList/NavList.styles.d.ts +90 -0
  14. package/dist/components/NavList/NavList.styles.d.ts.map +1 -0
  15. package/dist/components/NavList/NavList.styles.js +104 -0
  16. package/dist/components/NavList/NavList.styles.js.map +1 -0
  17. package/dist/components/NavList/NavList.styles.mjs +97 -0
  18. package/dist/components/NavList/NavList.styles.mjs.map +1 -0
  19. package/dist/components/NavList/NavList.translations.json.js +19 -0
  20. package/dist/components/NavList/NavList.translations.json.js.map +1 -0
  21. package/dist/components/NavList/NavList.translations.json.mjs +14 -0
  22. package/dist/components/NavList/NavList.translations.json.mjs.map +1 -0
  23. package/dist/components/NavList/NavList.types.d.ts +131 -0
  24. package/dist/components/NavList/NavList.types.d.ts.map +1 -0
  25. package/dist/components/NavList/NavListContext.d.ts +30 -0
  26. package/dist/components/NavList/NavListContext.d.ts.map +1 -0
  27. package/dist/components/NavList/NavListContext.js +16 -0
  28. package/dist/components/NavList/NavListContext.js.map +1 -0
  29. package/dist/components/NavList/NavListContext.mjs +13 -0
  30. package/dist/components/NavList/NavListContext.mjs.map +1 -0
  31. package/dist/components/NavList/NavListGroup.d.ts +31 -0
  32. package/dist/components/NavList/NavListGroup.d.ts.map +1 -0
  33. package/dist/components/NavList/NavListGroup.js +115 -0
  34. package/dist/components/NavList/NavListGroup.js.map +1 -0
  35. package/dist/components/NavList/NavListGroup.mjs +113 -0
  36. package/dist/components/NavList/NavListGroup.mjs.map +1 -0
  37. package/dist/components/NavList/NavListItem.d.ts +15 -0
  38. package/dist/components/NavList/NavListItem.d.ts.map +1 -0
  39. package/dist/components/NavList/NavListItem.js +269 -0
  40. package/dist/components/NavList/NavListItem.js.map +1 -0
  41. package/dist/components/NavList/NavListItem.mjs +267 -0
  42. package/dist/components/NavList/NavListItem.mjs.map +1 -0
  43. package/dist/components/NavList/NavListSkeleton.d.ts +17 -0
  44. package/dist/components/NavList/NavListSkeleton.d.ts.map +1 -0
  45. package/dist/components/NavList/NavListSkeleton.js +33 -0
  46. package/dist/components/NavList/NavListSkeleton.js.map +1 -0
  47. package/dist/components/NavList/NavListSkeleton.mjs +31 -0
  48. package/dist/components/NavList/NavListSkeleton.mjs.map +1 -0
  49. package/dist/components/NavList/index.d.ts +7 -0
  50. package/dist/components/NavList/index.d.ts.map +1 -0
  51. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  52. package/dist/components/Textarea/Textarea.js +4 -0
  53. package/dist/components/Textarea/Textarea.js.map +1 -1
  54. package/dist/components/Textarea/Textarea.mjs +4 -0
  55. package/dist/components/Textarea/Textarea.mjs.map +1 -1
  56. package/dist/index.d.ts +2 -1
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +12 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/index.mjs +6 -1
  61. package/dist/index.mjs.map +1 -1
  62. package/dist/utils/focusRing.d.ts +22 -0
  63. package/dist/utils/focusRing.d.ts.map +1 -1
  64. package/dist/utils/focusRing.js +22 -0
  65. package/dist/utils/focusRing.js.map +1 -1
  66. package/dist/utils/focusRing.mjs +21 -1
  67. package/dist/utils/focusRing.mjs.map +1 -1
  68. package/package.json +2 -1
  69. package/src/components/Input/Input.tsx +4 -0
  70. package/src/components/Menu/Menu.usage.mdx +8 -0
  71. package/src/components/NavList/NavList.stories.tsx +895 -0
  72. package/src/components/NavList/NavList.styles.ts +114 -0
  73. package/src/components/NavList/NavList.test.tsx +1254 -0
  74. package/src/components/NavList/NavList.translations.json +9 -0
  75. package/src/components/NavList/NavList.tsx +160 -0
  76. package/src/components/NavList/NavList.types.ts +145 -0
  77. package/src/components/NavList/NavList.usage.mdx +540 -0
  78. package/src/components/NavList/NavListContext.ts +25 -0
  79. package/src/components/NavList/NavListGroup.tsx +243 -0
  80. package/src/components/NavList/NavListItem.tsx +525 -0
  81. package/src/components/NavList/NavListSkeleton.tsx +57 -0
  82. package/src/components/NavList/index.ts +14 -0
  83. package/src/components/Tabs/Tabs.usage.mdx +58 -14
  84. package/src/components/Textarea/Textarea.tsx +4 -0
  85. package/src/components/Tooltip/Tooltip.usage.mdx +8 -0
  86. package/src/components/a11y.kwcag.test.tsx +66 -0
  87. package/src/components/claude.md +1 -1
  88. package/src/index.ts +7 -1
  89. package/src/utils/focusRing.ts +23 -0
@@ -0,0 +1,114 @@
1
+ import type {
2
+ NavListOrientation,
3
+ NavListResponsiveOrientation,
4
+ } from './NavList.types';
5
+
6
+ /**
7
+ * The tokens a row paints, exported so the usage page's token table reads what
8
+ * the component renders.
9
+ *
10
+ * **The current row is a PLACE, not a value** — the same rule as `TAB_RAMP`
11
+ * and the app's nav rail (`NavigationLinkButton.utils.tsx` in factchat-nextjs).
12
+ * It is carried by ink, weight and a neutral fill, never by the brand hue: a
13
+ * rail that spends colour on "you are here" is what stops a success or error
14
+ * colour from registering when it appears.
15
+ *
16
+ * `bg.emphasized` rather than `bg.muted` for the fill, because rails sit on the
17
+ * sidebar wash and the fill has to separate from THAT: in light `bg.muted` is
18
+ * only OKLab dE 0.027 from the wash, under the threshold where two flat areas
19
+ * read as different, and `bg.emphasized` is 0.052 (measured in that file).
20
+ * Hover uses the same fill, so the current row does not change under the
21
+ * pointer and a hovered row previews exactly what selecting it looks like.
22
+ *
23
+ * `currentLabel` is `fg.emphasized`, which the theme aliases to `fg.default`
24
+ * today — so on the stock theme the current row is told apart by WEIGHT and
25
+ * FILL, not by a second ink. The role is still named separately so a theme
26
+ * that splits the two (and the app's nav rail, which reads the same pair)
27
+ * moves the current label without touching the rest.
28
+ *
29
+ * **Pressed is one step past hover**, on every row, current ones included —
30
+ * otherwise a press on the row you are already on gives no sign it landed.
31
+ * No `bg.*` role is darker than `bg.emphasized` in light (it is the top of
32
+ * the `layer.1` ladder), so the step is `border.default`: the next neutral in
33
+ * both modes (light `#D8D2CA` after `#E5DFD9`, dark `#48443E` after
34
+ * `#3F3B34`), the same fill the BottomSheet handle uses. Under
35
+ * `prefers-contrast: more` that token turns into a 3:1 stroke grey and the
36
+ * label would drop to 2.8:1, so high contrast takes `border.strong`, which
37
+ * high contrast leaves alone. `NavList.test.tsx` checks every pair.
38
+ */
39
+ export const NAV_LIST_RAMP = {
40
+ label: 'fg.default',
41
+ currentLabel: 'fg.emphasized',
42
+ currentFill: 'bg.emphasized',
43
+ hoverFill: 'bg.emphasized',
44
+ pressedFill: 'border.default',
45
+ pressedFillMoreContrast: 'border.strong',
46
+ trailing: 'fg.muted',
47
+ groupTitle: 'fg.muted',
48
+ } as const;
49
+
50
+ /** The pressed fill, with its high-contrast swap. */
51
+ export const pressedFill = {
52
+ bg: NAV_LIST_RAMP.pressedFill,
53
+ _moreContrast: { bg: NAV_LIST_RAMP.pressedFillMoreContrast },
54
+ } as const;
55
+
56
+ /**
57
+ * Chakra's `_rtl`/`_ltr` and `:dir()` read `dir` ATTRIBUTES, and zag stamps
58
+ * `dir="ltr"` on every part it renders (tooltip triggers — the rows — and the
59
+ * collapsible group) from Ark's locale, before any effect can measure the
60
+ * page. An author `direction` beats the UA rule that maps the attribute, so
61
+ * every stamped element takes the direction it inherits instead: the server
62
+ * render lays an RTL rail out right to left on its first paint.
63
+ */
64
+ export const inheritDirection = { direction: 'inherit' } as const;
65
+
66
+ /**
67
+ * A locale whose direction is `dir`: the inherited one when it already
68
+ * agrees, so a Korean app keeps formatting in Korean, otherwise a stand-in.
69
+ * Ark has no other way to set the `dir` zag stamps (its hooks omit the prop).
70
+ */
71
+ export const localeFor = (
72
+ inherited: { locale: string; dir: 'ltr' | 'rtl' },
73
+ dir: 'ltr' | 'rtl'
74
+ ) =>
75
+ inherited.dir === dir ? inherited.locale : dir === 'rtl' ? 'ar' : 'en-US';
76
+
77
+ /**
78
+ * Map an orientation (or a per-breakpoint object of them) to a style value per
79
+ * breakpoint, so the axis switch is CSS rather than a `useBreakpointValue`
80
+ * that renders the wrong axis on the server.
81
+ */
82
+ export const byOrientation = <T>(
83
+ orientation: NavListResponsiveOrientation,
84
+ vertical: T,
85
+ horizontal: T
86
+ ): T | Record<string, T> => {
87
+ const pick = (o: NavListOrientation) =>
88
+ o === 'horizontal' ? horizontal : vertical;
89
+ if (typeof orientation === 'string') return pick(orientation);
90
+ // A breakpoint object with no `base` still starts vertical — the default —
91
+ // instead of leaving the smallest screens with no axis at all.
92
+ return Object.fromEntries(
93
+ Object.entries({ base: 'vertical', ...orientation }).map(([bp, o]) => [
94
+ bp,
95
+ pick(o as NavListOrientation),
96
+ ])
97
+ );
98
+ };
99
+
100
+ /** The list box shared by the root list and every group's list. */
101
+ export const listStyles = (orientation: NavListResponsiveOrientation) =>
102
+ ({
103
+ listStyleType: 'none',
104
+ m: 0,
105
+ p: 0,
106
+ display: 'flex',
107
+ gap: 0.5,
108
+ minW: 0,
109
+ flexDirection: byOrientation(orientation, 'column', 'row'),
110
+ alignItems: byOrientation(orientation, 'stretch', 'center'),
111
+ // A row never wraps: a strip that grows to three lines as items are added
112
+ // eats the content it navigates. The root scrolls sideways instead.
113
+ flexWrap: 'nowrap',
114
+ }) as const;