mbt-ui-kit 0.1.15 → 0.1.19

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 (63) hide show
  1. package/.ai/agent-examples/README.md +207 -0
  2. package/.ai/agent-reference/README.md +56 -0
  3. package/.ai/agent-rules/README.md +39 -0
  4. package/.ai/agent-rules/maintenance.md +22 -0
  5. package/AGENTS.md +41 -0
  6. package/README.md +187 -117
  7. package/dist/components/button/button.d.ts +2 -82
  8. package/dist/components/button/button.d.ts.map +1 -1
  9. package/dist/components/button/index.d.ts +2 -2
  10. package/dist/components/button/index.d.ts.map +1 -1
  11. package/dist/components/input/index.d.ts +3 -3
  12. package/dist/components/input/index.d.ts.map +1 -1
  13. package/dist/components/input/input.d.ts +2 -92
  14. package/dist/components/input/input.d.ts.map +1 -1
  15. package/dist/components/input/search-icon.d.ts +7 -0
  16. package/dist/components/input/search-icon.d.ts.map +1 -0
  17. package/dist/components/loader/index.d.ts +2 -2
  18. package/dist/components/loader/index.d.ts.map +1 -1
  19. package/dist/components/loader/loader.d.ts +2 -39
  20. package/dist/components/loader/loader.d.ts.map +1 -1
  21. package/dist/components/menu-button/graduation-cap-icon.d.ts +7 -0
  22. package/dist/components/menu-button/graduation-cap-icon.d.ts.map +1 -0
  23. package/dist/components/menu-button/index.d.ts +3 -3
  24. package/dist/components/menu-button/index.d.ts.map +1 -1
  25. package/dist/components/menu-button/menu-button.d.ts +1 -55
  26. package/dist/components/menu-button/menu-button.d.ts.map +1 -1
  27. package/dist/components/typography/heading.d.ts +7 -0
  28. package/dist/components/typography/heading.d.ts.map +1 -0
  29. package/dist/components/typography/index.d.ts +6 -6
  30. package/dist/components/typography/index.d.ts.map +1 -1
  31. package/dist/components/typography/metric.d.ts +9 -0
  32. package/dist/components/typography/metric.d.ts.map +1 -0
  33. package/dist/components/typography/text.d.ts +12 -0
  34. package/dist/components/typography/text.d.ts.map +1 -0
  35. package/dist/fonts/Inter-Italic-VariableFont_opsz,wght.ttf +0 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.d.ts +13 -15
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.mjs +117 -102
  40. package/dist/styles/fonts.css +23 -14
  41. package/dist/styles/mbt-ui-kit.css +1 -1
  42. package/dist/styles/tokens.css +54 -36
  43. package/dist/styles/tokens.d.ts +28 -20
  44. package/dist/styles/tokens.d.ts.map +1 -1
  45. package/dist/tokens-Bg607ibr.cjs +1 -0
  46. package/dist/{tokens-Bxhg1IBs.js → tokens-jzw6MWKU.js} +37 -33
  47. package/dist/tokens-only.cjs +1 -1
  48. package/dist/tokens-only.d.ts +3 -8
  49. package/dist/tokens-only.d.ts.map +1 -1
  50. package/dist/tokens-only.mjs +1 -1
  51. package/package.json +22 -9
  52. package/src/styles/_tokens.scss +48 -29
  53. package/dist/components/input/SearchIcon.d.ts +0 -26
  54. package/dist/components/input/SearchIcon.d.ts.map +0 -1
  55. package/dist/components/menu-button/GraduationCapIcon.d.ts +0 -6
  56. package/dist/components/menu-button/GraduationCapIcon.d.ts.map +0 -1
  57. package/dist/components/typography/Heading.d.ts +0 -34
  58. package/dist/components/typography/Heading.d.ts.map +0 -1
  59. package/dist/components/typography/Metric.d.ts +0 -50
  60. package/dist/components/typography/Metric.d.ts.map +0 -1
  61. package/dist/components/typography/Text.d.ts +0 -72
  62. package/dist/components/typography/Text.d.ts.map +0 -1
  63. package/dist/tokens-Bcuwagjb.cjs +0 -1
@@ -0,0 +1,207 @@
1
+ # Agent Examples
2
+
3
+ Use these examples when a consumer app needs package-level usage patterns for `mbt-ui-kit`.
4
+
5
+ ## App Shell Setup
6
+
7
+ ```tsx
8
+ import { Button, Heading, Input, Text } from 'mbt-ui-kit';
9
+ import 'mbt-ui-kit/styles';
10
+
11
+ function SettingsPanel() {
12
+ return (
13
+ <div>
14
+ <Heading level={2}>Settings</Heading>
15
+ <Text muted>Configure your account preferences.</Text>
16
+ <Input label="Email" placeholder="name@example.com" fullWidth />
17
+ <Button type="button">Save changes</Button>
18
+ </div>
19
+ );
20
+ }
21
+ ```
22
+
23
+ ## Font Loading
24
+
25
+ Default consumer setup:
26
+
27
+ ```tsx
28
+ import 'mbt-ui-kit/styles';
29
+ ```
30
+
31
+ Advanced consumer preload setup:
32
+
33
+ ```tsx
34
+ import 'mbt-ui-kit/styles';
35
+ import plexSansRegularUrl from 'mbt-ui-kit/fonts/ibm-plex-sans-v23-latin-regular.woff2';
36
+ import plexSansMediumUrl from 'mbt-ui-kit/fonts/ibm-plex-sans-v23-latin-500.woff2';
37
+ import interVariableUrl from 'mbt-ui-kit/fonts/Inter-VariableFont_opsz,wght.ttf';
38
+
39
+ const preloadFonts = [plexSansRegularUrl, plexSansMediumUrl, interVariableUrl];
40
+ ```
41
+
42
+ - Use `mbt-ui-kit/styles` as the default package entrypoint.
43
+ - Preload `mbt-ui-kit/fonts/*` only when the consumer app wants better first paint for fonts already used above the fold.
44
+ - Do not import both `mbt-ui-kit/styles` and `mbt-ui-kit/fonts.css` unless the app intentionally needs separate early font-face loading.
45
+
46
+ ## Buttons
47
+
48
+ ```tsx
49
+ <Button>Start</Button>
50
+
51
+ <Button disabled>Coming Soon</Button>
52
+
53
+ <Button fullWidth onClick={handleSubmit}>
54
+ Confirm
55
+ </Button>
56
+
57
+ <Button type="button" onClick={handleOpenSettings}>
58
+ <SettingsIcon /> Settings
59
+ </Button>
60
+ ```
61
+
62
+ ## Inputs
63
+
64
+ ```tsx
65
+ <Input label="Search" placeholder="Find champion" showSearchIcon />
66
+
67
+ <Input label="Email" fullWidth value={email} onChange={(e) => setEmail(e.target.value)} />
68
+
69
+ <Input placeholder="Custom icon" icon={<CustomIcon />} />
70
+
71
+ <Input label="Disabled field" muted disabled />
72
+ ```
73
+
74
+ ## Typography
75
+
76
+ ```tsx
77
+ <Heading level={1}>Dashboard</Heading>
78
+ <Heading level={3}>Recent Matches</Heading>
79
+
80
+ <Text>Regular body copy.</Text>
81
+ <Text strong>Highlighted text.</Text>
82
+ <Text small muted>Secondary caption.</Text>
83
+ <Text label>Role</Text>
84
+
85
+ <Metric>1,234</Metric>
86
+ <Metric large>42,500</Metric>
87
+ <Metric as="span" muted>
88
+ 99
89
+ </Metric>
90
+ ```
91
+
92
+ ## Menu Buttons
93
+
94
+ ```tsx
95
+ <MenuButton>Training</MenuButton>
96
+
97
+ <MenuButton selected icon={<SettingsIcon />}>
98
+ Settings
99
+ </MenuButton>
100
+
101
+ <MenuButton small>Inventory</MenuButton>
102
+
103
+ <MenuButton disabled>Coming Soon</MenuButton>
104
+ ```
105
+
106
+ ## Loader
107
+
108
+ ```tsx
109
+ <Loader size="sm" />
110
+ <Loader size="md" />
111
+ <Loader size="lg" />
112
+
113
+ <Button loading>Saving</Button>
114
+ ```
115
+
116
+ ## Icons
117
+
118
+ ```tsx
119
+ <SearchIcon />
120
+
121
+ <MenuButton icon={<GraduationCapIcon />}>Training</MenuButton>
122
+ ```
123
+
124
+ ## Tokens In Styled Components
125
+
126
+ ```tsx
127
+ import styled from 'styled-components';
128
+ import { colors, fontSizes, radius, spacing } from 'mbt-ui-kit/tokens';
129
+
130
+ export const Card = styled.div`
131
+ display: grid;
132
+ gap: ${spacing[3]};
133
+ padding: ${spacing[5]};
134
+ border-radius: ${radius.md};
135
+ background: ${colors.surface};
136
+ color: ${colors.textPrimary};
137
+ font-size: ${fontSizes[3]};
138
+ `;
139
+ ```
140
+
141
+ ## Token-Only Import
142
+
143
+ ```tsx
144
+ import { colors, spacing, transitions } from 'mbt-ui-kit/tokens';
145
+
146
+ const panelStyle = {
147
+ backgroundColor: colors.surfaceRaised,
148
+ padding: spacing[4],
149
+ transition: `opacity ${transitions.fast}`,
150
+ };
151
+ ```
152
+
153
+ ## Gradient Tokens
154
+
155
+ ```tsx
156
+ import { colors } from 'mbt-ui-kit/tokens';
157
+
158
+ const heroStyle = {
159
+ background: colors.primaryGradient,
160
+ };
161
+
162
+ const customDiamondStyle = {
163
+ background: `linear-gradient(90deg, ${colors.diamondStop0} 0%, ${colors.diamondStop1} 25%, ${colors.diamondStop2} 50%, ${colors.diamondStop3} 75%, ${colors.diamondStop4} 100%)`,
164
+ };
165
+ ```
166
+
167
+ ## CSS Custom Properties
168
+
169
+ ```tsx
170
+ import 'mbt-ui-kit/tokens.css';
171
+ ```
172
+
173
+ ```css
174
+ .panel {
175
+ background-color: var(--mbt-color-surface);
176
+ color: var(--mbt-color-text-primary);
177
+ padding: var(--mbt-space-4);
178
+ border-radius: var(--mbt-radius-sm);
179
+ }
180
+
181
+ .hero {
182
+ background: var(--mbt-color-primary-gradient);
183
+ }
184
+ ```
185
+
186
+ ## Sass Tokens
187
+
188
+ ```scss
189
+ @use 'mbt-ui-kit/src/styles/tokens' as *;
190
+
191
+ .panel {
192
+ background-color: $surface;
193
+ color: $text-primary;
194
+ padding: $space-4;
195
+ border-radius: $radius-sm;
196
+ }
197
+
198
+ .hero {
199
+ background: $diamond-gradient;
200
+ }
201
+ ```
202
+
203
+ ## Guidance
204
+
205
+ - Prefer nearby consumer-app usage before inventing a new composition pattern.
206
+ - Prefer public package entrypoints over deep imports, except for the published Sass token path.
207
+ - Keep app-specific layout decisions in the consumer app; keep package examples focused on reusable component and token usage.
@@ -0,0 +1,56 @@
1
+ # Agent Reference
2
+
3
+ This folder holds factual package reference for `mbt-ui-kit`.
4
+
5
+ ## Public Entry Points
6
+
7
+ - `mbt-ui-kit` - components plus token exports from `src/index.ts`
8
+ - `mbt-ui-kit/styles` - built package stylesheet, including the package font-face declarations
9
+ - `mbt-ui-kit/fonts.css` - standalone font-face stylesheet for advanced consumer setup
10
+ - `mbt-ui-kit/fonts/*` - published font asset files for preload or direct asset access
11
+ - `mbt-ui-kit/tokens` - token-only module surface
12
+ - `mbt-ui-kit/tokens.css` - CSS custom properties surface
13
+ - `mbt-ui-kit/src/styles/tokens` - published Sass token surface for Sass consumers
14
+
15
+ ## Font Contract
16
+
17
+ - `fonts.primary` maps to `IBM Plex Sans`
18
+ - `fonts.secondary` maps to `Inter`
19
+ - `fonts.mono` maps to `IBM Plex Mono`
20
+ - importing `mbt-ui-kit/styles` is the default way to make those package fonts available in a consumer app
21
+ - importing `mbt-ui-kit/fonts.css` is an advanced alternative for apps that want font-face declarations without the full package stylesheet
22
+ - importing `mbt-ui-kit/fonts/*` is for direct asset access, such as preload tags in the consumer app shell
23
+
24
+ ## Primary Components
25
+
26
+ - `Button`
27
+ - `Input`
28
+ - `Loader`
29
+ - `Heading`
30
+ - `Text`
31
+ - `Metric`
32
+ - `MenuButton`
33
+ - `GraduationCapIcon`
34
+ - `SearchIcon`
35
+
36
+ ## Primary Token Families
37
+
38
+ - `tokens`
39
+ - `colors`
40
+ - `fonts`
41
+ - `fontSizes`
42
+ - `fontWeights`
43
+ - `fontFeatures`
44
+ - `spacing`
45
+ - `radius`
46
+ - `zIndex`
47
+ - `transitions`
48
+
49
+ ## Color Token Notes
50
+
51
+ - `colors` includes solid colors, gradient stop tokens, and convenience gradient strings.
52
+ - direct gradient tokens: `colors.primaryGradient` and `colors.diamondGradient`
53
+ - primary gradient stop tokens: `colors.primaryStop0`, `colors.primaryStop1`, `colors.primaryStop2`
54
+ - diamond gradient stop tokens: `colors.diamondStop0`, `colors.diamondStop1`, `colors.diamondStop2`, `colors.diamondStop3`, `colors.diamondStop4`
55
+
56
+ Reference docs should stay factual. Policy and maintenance rules belong in `.ai/agent-rules/`.
@@ -0,0 +1,39 @@
1
+ # Agent Rules
2
+
3
+ These files are the canonical package-owned rules for `mbt-ui-kit`.
4
+
5
+ ## Rule Map
6
+
7
+ - `.ai/agent-rules/README.md` - normative usage rules for imports, components, styling, and tokens.
8
+ - `.ai/agent-rules/maintenance.md` - required rule for keeping package guidance in sync with public changes.
9
+
10
+ ## Usage Rules
11
+
12
+ - Import components and tokens from public package entrypoints only.
13
+ - Prefer an existing `mbt-ui-kit` component before creating a new primitive in a consumer app.
14
+ - Prefer exported design tokens over hardcoded near-duplicate values.
15
+ - Use kebab-case for file names and folder names across this repo.
16
+ - Use `pnpm` as the package manager for this repo and keep a single lockfile.
17
+ - Use `mbt-ui-kit/styles` once at the app shell when the consumer app wants the package styles loaded globally.
18
+ - Treat `mbt-ui-kit/styles` as the default entrypoint for package styles and font-face declarations.
19
+ - Use `mbt-ui-kit/fonts.css` only when the consumer intentionally wants the package font-face declarations without the full styles bundle.
20
+ - Use `mbt-ui-kit/fonts/*` only when the consumer intentionally wants direct font-file access for preload or asset orchestration.
21
+ - Use `mbt-ui-kit/tokens` for token access when the consumer wants the token module surface.
22
+ - Use `mbt-ui-kit/tokens.css` when the consumer explicitly wants only the CSS custom properties stylesheet.
23
+ - Use `mbt-ui-kit/src/styles/tokens` for Sass extension workflows that intentionally depend on the published Sass token surface.
24
+ - Keep examples and rules package-focused; app-specific composition rules belong in the consuming app, not here.
25
+
26
+ ## Component Guidance
27
+
28
+ - Use `Button` for shared button behavior instead of recreating button primitives.
29
+ - Use `Input` for labeled text inputs and search-style input affordances.
30
+ - Use `Heading`, `Text`, and `Metric` for typography when the consumer wants the package typography primitives.
31
+ - Use `MenuButton` for sidebar or navigation-style button treatments, not as a generic replacement for every button.
32
+ - Use `Loader` for package-consistent loading states.
33
+
34
+ ## Token Guidance
35
+
36
+ - Preferred token families are `colors`, `fonts`, `fontSizes`, `fontWeights`, `fontFeatures`, `spacing`, `radius`, `zIndex`, and `transitions`.
37
+ - Use `colors.primaryGradient` and `colors.diamondGradient` when the consumer wants the package's default gradient strings directly.
38
+ - Use the exported gradient stop tokens when the consumer needs to compose the same gradients with a different angle or stop layout.
39
+ - When a consumer needs a custom value outside the token system, keep the exception local to that consumer instead of expanding package docs with app-only design rules.
@@ -0,0 +1,22 @@
1
+ # Maintenance Rule
2
+
3
+ Agents working in `mbt-ui-kit` must review and update package guidance whenever a change affects public behavior.
4
+
5
+ ## Update The Docs When
6
+
7
+ - component props or defaults change
8
+ - exported components are added, removed, or renamed
9
+ - token names or token values change in a way that affects usage
10
+ - package entrypoints or import paths change
11
+ - style-loading expectations change
12
+ - font asset paths, exported font entrypoints, or font-loading expectations change
13
+ - canonical examples need to change to stay correct
14
+
15
+ ## Required Files To Review
16
+
17
+ - `AGENTS.md`
18
+ - `.ai/agent-rules/README.md`
19
+ - `.ai/agent-reference/README.md`
20
+ - `.ai/agent-examples/README.md`
21
+
22
+ Do not finish public package work without reviewing these files.
package/AGENTS.md ADDED
@@ -0,0 +1,41 @@
1
+ # AGENTS.md
2
+
3
+ ## Purpose
4
+
5
+ - `mbt-ui-kit` is the shared React design-system package for MBT apps.
6
+ - This repo owns the canonical agent guidance for how to use the package.
7
+ - Consumer apps should read the installed package docs from `node_modules/mbt-ui-kit/...`.
8
+
9
+ ## Package Name
10
+
11
+ - npm package: `mbt-ui-kit`
12
+ - public entrypoints: `mbt-ui-kit`, `mbt-ui-kit/styles`, `mbt-ui-kit/fonts.css`, `mbt-ui-kit/fonts/*`, `mbt-ui-kit/tokens`, `mbt-ui-kit/tokens.css`
13
+ - published Sass token path: `mbt-ui-kit/src/styles/tokens`
14
+
15
+ ## Read This First
16
+
17
+ 1. `.ai/agent-rules/README.md`
18
+ 2. `.ai/agent-rules/maintenance.md`
19
+ 3. `.ai/agent-reference/README.md`
20
+ 4. `.ai/agent-examples/README.md`
21
+
22
+ ## Guidance Map
23
+
24
+ - `.ai/agent-rules/README.md` - package-owned usage rules, imports, styling boundaries, and token expectations.
25
+ - `.ai/agent-rules/maintenance.md` - required doc-sync rule when public usage changes.
26
+ - `.ai/agent-reference/README.md` - exported surfaces and lookup map.
27
+ - `.ai/agent-examples/README.md` - short canonical examples for common components and tokens.
28
+
29
+ ## Maintenance Rule
30
+
31
+ - If a change affects public components, props, tokens, styles, font assets, exports, or expected usage, update the guidance docs before considering the work complete.
32
+
33
+ ## Guardrails
34
+
35
+ - Document only public package behavior here.
36
+ - Prefer public entrypoints over deep source imports in examples, except for the published Sass token path.
37
+ - Treat `mbt-ui-kit/styles` as the default consumer entrypoint for loading package styles and font-face declarations.
38
+ - Treat `mbt-ui-kit/fonts.css` and `mbt-ui-kit/fonts/*` as advanced consumer entrypoints for apps that intentionally preload or separately stage package fonts.
39
+ - Use kebab-case for file names and folder names across this repo.
40
+ - Use `pnpm` as the package manager for this repo.
41
+ - Keep Storybook as maintainer reference material, not the canonical consumer contract.