@epfl-sti/poesis 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/LICENSE +217 -0
  2. package/README.md +204 -0
  3. package/dist/components/data-display/Card.d.ts +20 -0
  4. package/dist/components/data-display/Card.d.ts.map +1 -0
  5. package/dist/components/data-display/DescriptionList.d.ts +23 -0
  6. package/dist/components/data-display/DescriptionList.d.ts.map +1 -0
  7. package/dist/components/data-display/EmptyState.d.ts +18 -0
  8. package/dist/components/data-display/EmptyState.d.ts.map +1 -0
  9. package/dist/components/data-display/Table.d.ts +47 -0
  10. package/dist/components/data-display/Table.d.ts.map +1 -0
  11. package/dist/components/data-display/index.d.ts +5 -0
  12. package/dist/components/data-display/index.d.ts.map +1 -0
  13. package/dist/components/feedback/Alert.d.ts +18 -0
  14. package/dist/components/feedback/Alert.d.ts.map +1 -0
  15. package/dist/components/feedback/ConfirmDialog.d.ts +24 -0
  16. package/dist/components/feedback/ConfirmDialog.d.ts.map +1 -0
  17. package/dist/components/feedback/Dialog.d.ts +20 -0
  18. package/dist/components/feedback/Dialog.d.ts.map +1 -0
  19. package/dist/components/feedback/Toast.d.ts +5 -0
  20. package/dist/components/feedback/Toast.d.ts.map +1 -0
  21. package/dist/components/feedback/index.d.ts +6 -0
  22. package/dist/components/feedback/index.d.ts.map +1 -0
  23. package/dist/components/feedback/toastContext.d.ts +17 -0
  24. package/dist/components/feedback/toastContext.d.ts.map +1 -0
  25. package/dist/components/layout/BurgerDrawer.d.ts +25 -0
  26. package/dist/components/layout/BurgerDrawer.d.ts.map +1 -0
  27. package/dist/components/layout/PageShell.d.ts +32 -0
  28. package/dist/components/layout/PageShell.d.ts.map +1 -0
  29. package/dist/components/layout/SideNav.d.ts +22 -0
  30. package/dist/components/layout/SideNav.d.ts.map +1 -0
  31. package/dist/components/layout/TopNav.d.ts +24 -0
  32. package/dist/components/layout/TopNav.d.ts.map +1 -0
  33. package/dist/components/layout/index.d.ts +10 -0
  34. package/dist/components/layout/index.d.ts.map +1 -0
  35. package/dist/components/layout/types.d.ts +31 -0
  36. package/dist/components/layout/types.d.ts.map +1 -0
  37. package/dist/components/ui/Avatar.d.ts +25 -0
  38. package/dist/components/ui/Avatar.d.ts.map +1 -0
  39. package/dist/components/ui/Badge.d.ts +34 -0
  40. package/dist/components/ui/Badge.d.ts.map +1 -0
  41. package/dist/components/ui/Button.d.ts +35 -0
  42. package/dist/components/ui/Button.d.ts.map +1 -0
  43. package/dist/components/ui/Checkbox.d.ts +16 -0
  44. package/dist/components/ui/Checkbox.d.ts.map +1 -0
  45. package/dist/components/ui/DropdownMenu.d.ts +30 -0
  46. package/dist/components/ui/DropdownMenu.d.ts.map +1 -0
  47. package/dist/components/ui/IconButton.d.ts +34 -0
  48. package/dist/components/ui/IconButton.d.ts.map +1 -0
  49. package/dist/components/ui/Input.d.ts +21 -0
  50. package/dist/components/ui/Input.d.ts.map +1 -0
  51. package/dist/components/ui/LanguageSwitcher.d.ts +11 -0
  52. package/dist/components/ui/LanguageSwitcher.d.ts.map +1 -0
  53. package/dist/components/ui/Popover.d.ts +18 -0
  54. package/dist/components/ui/Popover.d.ts.map +1 -0
  55. package/dist/components/ui/RadioGroup.d.ts +45 -0
  56. package/dist/components/ui/RadioGroup.d.ts.map +1 -0
  57. package/dist/components/ui/Select.d.ts +15 -0
  58. package/dist/components/ui/Select.d.ts.map +1 -0
  59. package/dist/components/ui/Spinner.d.ts +19 -0
  60. package/dist/components/ui/Spinner.d.ts.map +1 -0
  61. package/dist/components/ui/Switch.d.ts +12 -0
  62. package/dist/components/ui/Switch.d.ts.map +1 -0
  63. package/dist/components/ui/Tabs.d.ts +36 -0
  64. package/dist/components/ui/Tabs.d.ts.map +1 -0
  65. package/dist/components/ui/Textarea.d.ts +18 -0
  66. package/dist/components/ui/Textarea.d.ts.map +1 -0
  67. package/dist/components/ui/ThemeToggle.d.ts +16 -0
  68. package/dist/components/ui/ThemeToggle.d.ts.map +1 -0
  69. package/dist/components/ui/Tooltip.d.ts +16 -0
  70. package/dist/components/ui/Tooltip.d.ts.map +1 -0
  71. package/dist/components/ui/index.d.ts +18 -0
  72. package/dist/components/ui/index.d.ts.map +1 -0
  73. package/dist/hooks/useAuth.d.ts +33 -0
  74. package/dist/hooks/useAuth.d.ts.map +1 -0
  75. package/dist/hooks/useLanguage.d.ts +14 -0
  76. package/dist/hooks/useLanguage.d.ts.map +1 -0
  77. package/dist/hooks/useTheme.d.ts +21 -0
  78. package/dist/hooks/useTheme.d.ts.map +1 -0
  79. package/dist/i18n/index.d.ts +3 -0
  80. package/dist/i18n/index.d.ts.map +1 -0
  81. package/dist/lib.d.ts +11 -0
  82. package/dist/lib.d.ts.map +1 -0
  83. package/dist/poesis.js +1870 -0
  84. package/dist/poesis.js.map +1 -0
  85. package/dist/routes/types.d.ts +39 -0
  86. package/dist/routes/types.d.ts.map +1 -0
  87. package/dist/theme/reactSelectStyles.d.ts +12 -0
  88. package/dist/theme/reactSelectStyles.d.ts.map +1 -0
  89. package/package.json +98 -0
package/LICENSE ADDED
@@ -0,0 +1,217 @@
1
+ Copyright 2026 Andrii Babarytskyi, Juan Convers
2
+ Assisted by Claude Opus 4.6
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+
17
+ Apache License
18
+ Version 2.0, January 2004
19
+ http://www.apache.org/licenses/
20
+
21
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
22
+
23
+ 1. Definitions.
24
+
25
+ "License" shall mean the terms and conditions for use, reproduction,
26
+ and distribution as defined by Sections 1 through 9 of this document.
27
+
28
+ "Licensor" shall mean the copyright owner or entity authorized by
29
+ the copyright owner that is granting the License.
30
+
31
+ "Legal Entity" shall mean the union of the acting entity and all
32
+ other entities that control, are controlled by, or are under common
33
+ control with that entity. For the purposes of this definition,
34
+ "control" means (i) the power, direct or indirect, to cause the
35
+ direction or management of such entity, whether by contract or
36
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
37
+ outstanding shares, or (iii) beneficial ownership of such entity.
38
+
39
+ "You" (or "Your") shall mean an individual or Legal Entity
40
+ exercising permissions granted by this License.
41
+
42
+ "Source" form shall mean the preferred form for making modifications,
43
+ including but not limited to software source code, documentation
44
+ source, and configuration files.
45
+
46
+ "Object" form shall mean any form resulting from mechanical
47
+ transformation or translation of a Source form, including but
48
+ not limited to compiled object code, generated documentation,
49
+ and conversions to other media types.
50
+
51
+ "Work" shall mean the work of authorship, whether in Source or
52
+ Object form, made available under the License, as indicated by a
53
+ copyright notice that is included in or attached to the work
54
+ (an example is provided in the Appendix below).
55
+
56
+ "Derivative Works" shall mean any work, whether in Source or Object
57
+ form, that is based on (or derived from) the Work and for which the
58
+ editorial revisions, annotations, elaborations, or other modifications
59
+ represent, as a whole, an original work of authorship. For the purposes
60
+ of this License, Derivative Works shall not include works that remain
61
+ separable from, or merely link (or bind by name) to the interfaces of,
62
+ the Work and Derivative Works thereof.
63
+
64
+ "Contribution" shall mean any work of authorship, including
65
+ the original version of the Work and any modifications or additions
66
+ to that Work or Derivative Works thereof, that is intentionally
67
+ submitted to Licensor for inclusion in the Work by the copyright owner
68
+ or by an individual or Legal Entity authorized to submit on behalf of
69
+ the copyright owner. For the purposes of this definition, "submitted"
70
+ means any form of electronic, verbal, or written communication sent
71
+ to the Licensor or its representatives, including but not limited to
72
+ communication on electronic mailing lists, source code control systems,
73
+ and issue tracking systems that are managed by, or on behalf of, the
74
+ Licensor for the purpose of discussing and improving the Work, but
75
+ excluding communication that is conspicuously marked or otherwise
76
+ designated in writing by the copyright owner as "Not a Contribution."
77
+
78
+ "Contributor" shall mean Licensor and any individual or Legal Entity
79
+ on behalf of whom a Contribution has been received by Licensor and
80
+ subsequently incorporated within the Work.
81
+
82
+ 2. Grant of Copyright License. Subject to the terms and conditions of
83
+ this License, each Contributor hereby grants to You a perpetual,
84
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
85
+ copyright license to reproduce, prepare Derivative Works of,
86
+ publicly display, publicly perform, sublicense, and distribute the
87
+ Work and such Derivative Works in Source or Object form.
88
+
89
+ 3. Grant of Patent License. Subject to the terms and conditions of
90
+ this License, each Contributor hereby grants to You a perpetual,
91
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
92
+ (except as stated in this section) patent license to make, have made,
93
+ use, offer to sell, sell, import, and otherwise transfer the Work,
94
+ where such license applies only to those patent claims licensable
95
+ by such Contributor that are necessarily infringed by their
96
+ Contribution(s) alone or by combination of their Contribution(s)
97
+ with the Work to which such Contribution(s) was submitted. If You
98
+ institute patent litigation against any entity (including a
99
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
100
+ or a Contribution incorporated within the Work constitutes direct
101
+ or contributory patent infringement, then any patent licenses
102
+ granted to You under this License for that Work shall terminate
103
+ as of the date such litigation is filed.
104
+
105
+ 4. Redistribution. You may reproduce and distribute copies of the
106
+ Work or Derivative Works thereof in any medium, with or without
107
+ modifications, and in Source or Object form, provided that You
108
+ meet the following conditions:
109
+
110
+ (a) You must give any other recipients of the Work or
111
+ Derivative Works a copy of this License; and
112
+
113
+ (b) You must cause any modified files to carry prominent notices
114
+ stating that You changed the files; and
115
+
116
+ (c) You must retain, in the Source form of any Derivative Works
117
+ that You distribute, all copyright, patent, trademark, and
118
+ attribution notices from the Source form of the Work,
119
+ excluding those notices that do not pertain to any part of
120
+ the Derivative Works; and
121
+
122
+ (d) If the Work includes a "NOTICE" text file as part of its
123
+ distribution, then any Derivative Works that You distribute must
124
+ include a readable copy of the attribution notices contained
125
+ within such NOTICE file, excluding those notices that do not
126
+ pertain to any part of the Derivative Works, in at least one
127
+ of the following places: within a NOTICE text file distributed
128
+ as part of the Derivative Works; within the Source form or
129
+ documentation, if provided along with the Derivative Works; or,
130
+ within a display generated by the Derivative Works, if and
131
+ wherever such third-party notices normally appear. The contents
132
+ of the NOTICE file are for informational purposes only and
133
+ do not modify the License. You may add Your own attribution
134
+ notices within Derivative Works that You distribute, alongside
135
+ or as an addendum to the NOTICE text from the Work, provided
136
+ that such additional attribution notices cannot be construed
137
+ as modifying the License.
138
+
139
+ You may add Your own copyright statement to Your modifications and
140
+ may provide additional or different license terms and conditions
141
+ for use, reproduction, or distribution of Your modifications, or
142
+ for any such Derivative Works as a whole, provided Your use,
143
+ reproduction, and distribution of the Work otherwise complies with
144
+ the conditions stated in this License.
145
+
146
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
147
+ any Contribution intentionally submitted for inclusion in the Work
148
+ by You to the Licensor shall be under the terms and conditions of
149
+ this License, without any additional terms or conditions.
150
+ Notwithstanding the above, nothing herein shall supersede or modify
151
+ the terms of any separate license agreement you may have executed
152
+ with Licensor regarding such Contributions.
153
+
154
+ 6. Trademarks. This License does not grant permission to use the trade
155
+ names, trademarks, service marks, or product names of the Licensor,
156
+ except as required for reasonable and customary use in describing the
157
+ origin of the Work and reproducing the content of the NOTICE file.
158
+
159
+ 7. Disclaimer of Warranty. Unless required by applicable law or
160
+ agreed to in writing, Licensor provides the Work (and each
161
+ Contributor provides its Contributions) on an "AS IS" BASIS,
162
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
163
+ implied, including, without limitation, any warranties or conditions
164
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
165
+ PARTICULAR PURPOSE. You are solely responsible for determining the
166
+ appropriateness of using or redistributing the Work and assume any
167
+ risks associated with Your exercise of permissions under this License.
168
+
169
+ 8. Limitation of Liability. In no event and under no legal theory,
170
+ whether in tort (including negligence), contract, or otherwise,
171
+ unless required by applicable law (such as deliberate and grossly
172
+ negligent acts) or agreed to in writing, shall any Contributor be
173
+ liable to You for damages, including any direct, indirect, special,
174
+ incidental, or consequential damages of any character arising as a
175
+ result of this License or out of the use or inability to use the
176
+ Work (including but not limited to damages for loss of goodwill,
177
+ work stoppage, computer failure or malfunction, or any and all
178
+ other commercial damages or losses), even if such Contributor
179
+ has been advised of the possibility of such damages.
180
+
181
+ 9. Accepting Warranty or Additional Liability. While redistributing
182
+ the Work or Derivative Works thereof, You may choose to offer,
183
+ and charge a fee for, acceptance of support, warranty, indemnity,
184
+ or other liability obligations and/or rights consistent with this
185
+ License. However, in accepting such obligations, You may act only
186
+ on Your own behalf and on Your sole responsibility, not on behalf
187
+ of any other Contributor, and only if You agree to indemnify,
188
+ defend, and hold each Contributor harmless for any liability
189
+ incurred by, or claims asserted against, such Contributor by reason
190
+ of your accepting any such warranty or additional liability.
191
+
192
+ END OF TERMS AND CONDITIONS
193
+
194
+ APPENDIX: How to apply the Apache License to your work.
195
+
196
+ To apply the Apache License to your work, attach the following
197
+ boilerplate notice, with the fields enclosed by brackets "[]"
198
+ replaced with your own identifying information. (Don't include
199
+ the brackets!) The text should be enclosed in the appropriate
200
+ comment syntax for the file format. We also recommend that a
201
+ file or class name and description of purpose be included on the
202
+ same "printed page" as the copyright notice for easier
203
+ identification within third-party archives.
204
+
205
+ Copyright [yyyy] [name of copyright owner]
206
+
207
+ Licensed under the Apache License, Version 2.0 (the "License");
208
+ you may not use this file except in compliance with the License.
209
+ You may obtain a copy of the License at
210
+
211
+ http://www.apache.org/licenses/LICENSE-2.0
212
+
213
+ Unless required by applicable law or agreed to in writing, software
214
+ distributed under the License is distributed on an "AS IS" BASIS,
215
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
216
+ See the License for the specific language governing permissions and
217
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,204 @@
1
+ # Poesis
2
+
3
+ EPFL Intranet React UI component library — a themed, accessible component kit built
4
+ with React, TypeScript, and Tailwind CSS v4.
5
+
6
+ ## Features
7
+
8
+ - **30+ components** — buttons, inputs, cards, dialogs, toasts, tables, navigation shells, and more
9
+ - **EPFL design tokens** — colors, typography, spacing, shadows, and radii baked into Tailwind's `@theme`
10
+ - **Dark mode** — light / dark themes with a single `.dark` class toggle and `useTheme` hook
11
+ - **i18n ready** — built-in EN/FR support via `react-i18next`, with a `useLanguage` hook and `LanguageSwitcher` component
12
+ - **CSS auto-injection** — styles are embedded in the JS bundle; no separate stylesheet import needed
13
+ - **Fully typed** — TypeScript declarations ship with the package
14
+ - **Storybook** — every component has interactive stories with accessibility checks
15
+
16
+ ## Installation
17
+
18
+ ```sh
19
+ npm install poesis
20
+ ```
21
+
22
+ ### Peer dependencies
23
+
24
+ Poesis expects the following packages in your project:
25
+
26
+ | Package | Version | Required |
27
+ | ----------------------- | ---------------------- | -------- |
28
+ | `react` | `^18.0.0 \|\| ^19.0.0` | yes |
29
+ | `react-dom` | `^18.0.0 \|\| ^19.0.0` | yes |
30
+ | `@floating-ui/react` | `^0.27.0` | yes |
31
+ | `i18next` | `^25.0.0` | yes |
32
+ | `react-i18next` | `^16.0.0` | yes |
33
+ | `react-bootstrap-icons` | `^1.11.0` | optional |
34
+ | `react-router-dom` | `^6.0.0 \|\| ^7.0.0` | optional |
35
+ | `react-select` | `^5.0.0` | optional |
36
+
37
+ ## Quick start
38
+
39
+ ```tsx
40
+ import { Button, Card, Alert, initTheme, ToastProvider } from "poesis";
41
+
42
+ // Initialise theme once at app startup
43
+ initTheme();
44
+
45
+ function App() {
46
+ return (
47
+ <ToastProvider>
48
+ <Card header="Dashboard">
49
+ <Alert variant="info">Welcome back!</Alert>
50
+ <Button variant="primary">Get Started</Button>
51
+ </Card>
52
+ </ToastProvider>
53
+ );
54
+ }
55
+ ```
56
+
57
+ No CSS import is needed — styles are injected automatically when you import any
58
+ component.
59
+
60
+ ## Components
61
+
62
+ ### Primitives
63
+
64
+ `Button` · `IconButton` · `Badge` · `Avatar` · `Spinner`
65
+
66
+ ### Form Controls
67
+
68
+ `Input` · `Textarea` · `Select` · `Checkbox` · `Switch` · `RadioGroup`
69
+
70
+ ### Data Display
71
+
72
+ `Card` · `Table` · `DescriptionList` · `EmptyState`
73
+
74
+ ### Feedback
75
+
76
+ `Alert` · `Dialog` · `ConfirmDialog` · `ToastProvider` / `useToast`
77
+
78
+ ### Layout
79
+
80
+ `PageShell` · `TopNav` · `SideNav` · `BurgerDrawer`
81
+
82
+ ### Overlays & Navigation
83
+
84
+ `DropdownMenu` · `Popover` · `Tooltip` · `Tabs`
85
+
86
+ ### Theme & i18n
87
+
88
+ `ThemeToggle` · `LanguageSwitcher`
89
+
90
+ ## Hooks
91
+
92
+ | Hook | Description |
93
+ | ------------- | ------------------------------------------------ |
94
+ | `useTheme` | Current theme (`light` / `dark`) and toggle/set |
95
+ | `initTheme` | Initialise theme from localStorage / system pref |
96
+ | `useLanguage` | Current language (`en` / `fr`) and toggle/set |
97
+ | `useAuth` | Access the authenticated user and role setter |
98
+ | `useToast` | Imperatively add/remove toast notifications |
99
+
100
+ ## Theme utilities
101
+
102
+ - `epflSelectTheme` — drop-in `react-select` theme using EPFL design tokens
103
+ - `epflSelectClassNames` — Tailwind-based classNames config for `react-select`
104
+
105
+ ## Development
106
+
107
+ ### Prerequisites
108
+
109
+ - Node.js 24 (see `.nvmrc`)
110
+ - npm
111
+
112
+ ### Scripts
113
+
114
+ ```sh
115
+ # Install dependencies
116
+ npm install
117
+
118
+ # Start Storybook (development)
119
+ npm run storybook
120
+
121
+ # Build the library (dist/poesis.js + type declarations)
122
+ npm run build
123
+
124
+ # Build Storybook as a static site
125
+ npm run build-storybook
126
+
127
+ # Lint with ESLint
128
+ npm run lint
129
+
130
+ # Format with Prettier (4-space indent)
131
+ npm run format
132
+
133
+ # Check formatting (CI)
134
+ npm run format:check
135
+
136
+ # Build + run integration tests
137
+ npm run test:integration
138
+ ```
139
+
140
+ ### Project structure
141
+
142
+ ```
143
+ ├── src/
144
+ │ ├── components/
145
+ │ │ ├── ui/ # Primitives, form controls, overlays
146
+ │ │ ├── layout/ # PageShell, TopNav, SideNav, BurgerDrawer
147
+ │ │ ├── data-display/ # Card, Table, DescriptionList, EmptyState
148
+ │ │ └── feedback/ # Alert, Dialog, ConfirmDialog, Toast
149
+ │ ├── hooks/ # useTheme, useLanguage, useAuth
150
+ │ ├── theme/ # react-select theme utilities
151
+ │ ├── i18n/ # i18next config + EN/FR translation files
152
+ │ ├── stories/ # Storybook stories
153
+ │ ├── pages/ # Demo app placeholder pages
154
+ │ ├── routes/ # Route config + role types
155
+ │ ├── lib.ts # Library entry point (public API)
156
+ │ └── index.css # Tailwind v4 @theme + design tokens
157
+ ├── integration-tests/ # Consumer-simulation integration tests
158
+ ├── .storybook/ # Storybook configuration
159
+ ├── vite.config.ts # Vite lib mode + Tailwind + Storybook tests
160
+ ├── tsconfig.lib.json # TypeScript config for .d.ts generation
161
+ ├── PLAN.md # Implementation plan & phase tracker
162
+ └── STYLING.md # Full design system specification
163
+ ```
164
+
165
+ ### Building the library
166
+
167
+ ```sh
168
+ npm run build
169
+ ```
170
+
171
+ This runs two steps:
172
+
173
+ 1. **Vite** builds `src/lib.ts` into `dist/poesis.js` (ESM, with CSS injected into JS)
174
+ 2. **TypeScript** emits declaration files into `dist/` (`lib.d.ts` + per-component `.d.ts`)
175
+
176
+ ### Integration tests
177
+
178
+ A separate test project in `integration-tests/` imports from the built `dist/`
179
+ exactly like a real consumer would. It renders components in a headless Chromium
180
+ browser via Vitest + Playwright and verifies exports, DOM output, CSS injection,
181
+ accessibility attributes, and component composition.
182
+
183
+ ```sh
184
+ npm run test:integration
185
+ ```
186
+
187
+ See [`integration-tests/README.md`](integration-tests/README.md) for details.
188
+
189
+ ## Design system
190
+
191
+ The full design system specification — colors, typography, spacing, shadows,
192
+ theming strategy, layout architecture, and component inventory — is documented
193
+ in [`STYLING.md`](STYLING.md).
194
+
195
+ ## Authors
196
+
197
+ - Andrii Babarytskyi
198
+ - Juan Convers
199
+
200
+ Assisted by Claude Opus 4.6
201
+
202
+ ## License
203
+
204
+ Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full text.
@@ -0,0 +1,20 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
+ export interface CardProps extends ComponentPropsWithoutRef<"div"> {
3
+ /** Optional header content — rendered above the body with a bottom border. */
4
+ header?: ReactNode;
5
+ /** Optional footer content — rendered below the body with a top border. */
6
+ footer?: ReactNode;
7
+ /** Optional actions aligned to the right inside the footer area. */
8
+ actions?: ReactNode;
9
+ /** Remove the default padding on the body section. */
10
+ noPadding?: boolean;
11
+ /** Card body content. */
12
+ children?: ReactNode;
13
+ }
14
+ /**
15
+ * Elevated surface container with optional header, footer, and actions slots.
16
+ *
17
+ * Uses `radius-md` and `shadow-md` from the design tokens.
18
+ */
19
+ export declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
20
+ //# sourceMappingURL=Card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/data-display/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAIlF,MAAM,WAAW,SAAU,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IAC9D,8EAA8E;IAC9E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,oEAAoE;IACpE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,sDAAsD;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAID;;;;GAIG;AACH,eAAO,MAAM,IAAI,sGAqCf,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
+ export interface DescriptionItem {
3
+ /** Label / key text. */
4
+ label: ReactNode;
5
+ /** Value / description text. */
6
+ value: ReactNode;
7
+ }
8
+ export type DescriptionListLayout = "vertical" | "horizontal";
9
+ export interface DescriptionListProps extends ComponentPropsWithoutRef<"dl"> {
10
+ /** Array of key-value items. */
11
+ items: DescriptionItem[];
12
+ /** Layout direction. @default "horizontal" */
13
+ layout?: DescriptionListLayout;
14
+ /** Show a light divider between items. @default true */
15
+ dividers?: boolean;
16
+ }
17
+ /**
18
+ * Key-value pair layout for detail views.
19
+ *
20
+ * Supports horizontal (label left, value right) and vertical (label above value) layouts.
21
+ */
22
+ export declare const DescriptionList: import("react").ForwardRefExoticComponent<DescriptionListProps & import("react").RefAttributes<HTMLDListElement>>;
23
+ //# sourceMappingURL=DescriptionList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DescriptionList.d.ts","sourceRoot":"","sources":["../../../src/components/data-display/DescriptionList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAIlF,MAAM,WAAW,eAAe;IAC5B,wBAAwB;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,gCAAgC;IAChC,KAAK,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB,CAAC,IAAI,CAAC;IACxE,gCAAgC;IAChC,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAID;;;;GAIG;AACH,eAAO,MAAM,eAAe,mHA2C3B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
+ export interface EmptyStateProps extends ComponentPropsWithoutRef<"div"> {
3
+ /** Optional illustration or icon element. */
4
+ illustration?: ReactNode;
5
+ /** Primary message. */
6
+ title: string;
7
+ /** Optional secondary description. */
8
+ description?: string;
9
+ /** Optional call-to-action element (e.g. a Button). */
10
+ action?: ReactNode;
11
+ }
12
+ /**
13
+ * Placeholder shown when a view has no content.
14
+ *
15
+ * Provides an illustration slot, message, and optional CTA.
16
+ */
17
+ export declare const EmptyState: import("react").ForwardRefExoticComponent<EmptyStateProps & import("react").RefAttributes<HTMLDivElement>>;
18
+ //# sourceMappingURL=EmptyState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/data-display/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAIlF,MAAM,WAAW,eAAgB,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACpE,6CAA6C;IAC7C,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,MAAM,CAAC,EAAE,SAAS,CAAC;CACtB;AAID;;;;GAIG;AACH,eAAO,MAAM,UAAU,4GAgCrB,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
+ export type SortDirection = "asc" | "desc";
3
+ export interface SortState {
4
+ /** Column key currently sorted. */
5
+ column: string;
6
+ /** Sort direction. */
7
+ direction: SortDirection;
8
+ }
9
+ export interface TableColumn<T> {
10
+ /** Unique key used for sorting & React keying. */
11
+ key: string;
12
+ /** Column header label. */
13
+ header: ReactNode;
14
+ /** Render the cell content for a given row. */
15
+ cell: (row: T, index: number) => ReactNode;
16
+ /** Enable sorting on this column. @default false */
17
+ sortable?: boolean;
18
+ /** Optional header cell className. */
19
+ headerClassName?: string;
20
+ /** Optional body cell className. */
21
+ cellClassName?: string;
22
+ }
23
+ export interface TableProps<T> extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
24
+ /** Column definitions. */
25
+ columns: TableColumn<T>[];
26
+ /** Row data array. */
27
+ data: T[];
28
+ /** Unique key extractor for each row. */
29
+ rowKey: (row: T, index: number) => string | number;
30
+ /** Show striped rows. @default true */
31
+ striped?: boolean;
32
+ /** Controlled sort state. */
33
+ sort?: SortState;
34
+ /** Called when a sortable column header is clicked. */
35
+ onSortChange?: (sort: SortState) => void;
36
+ /** Content shown when data is empty. */
37
+ emptyContent?: ReactNode;
38
+ }
39
+ /**
40
+ * Data table with sortable headers, striped rows, and a responsive scroll wrapper.
41
+ *
42
+ * Accepts generic row type `T` for full type safety.
43
+ */
44
+ export declare const Table: <T>(props: TableProps<T> & {
45
+ ref?: React.Ref<HTMLDivElement>;
46
+ }) => React.ReactElement | null;
47
+ //# sourceMappingURL=Table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/data-display/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EAIjB,MAAM,OAAO,CAAC;AAKf,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,SAAS;IACtB,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,SAAS,EAAE,aAAa,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC1B,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,MAAM,EAAE,SAAS,CAAC;IAClB,+CAA+C;IAC/C,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAC3C,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oCAAoC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IACpF,0BAA0B;IAC1B,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,sBAAsB;IACtB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,yCAAyC;IACzC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC;IACnD,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,uDAAuD;IACvD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACzC,wCAAwC;IACxC,YAAY,CAAC,EAAE,SAAS,CAAC;CAC5B;AAsBD;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAoIZ,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;CAAE,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { Card, type CardProps } from "./Card";
2
+ export { DescriptionList, type DescriptionItem, type DescriptionListLayout, type DescriptionListProps, } from "./DescriptionList";
3
+ export { EmptyState, type EmptyStateProps } from "./EmptyState";
4
+ export { Table, type SortDirection, type SortState, type TableColumn, type TableProps, } from "./Table";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/data-display/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACH,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EACH,KAAK,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,UAAU,GAClB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { type ReactNode } from "react";
2
+ export type AlertVariant = "success" | "warning" | "error" | "info";
3
+ export interface AlertProps {
4
+ /** Visual variant — controls icon, color, and background. */
5
+ variant: AlertVariant;
6
+ /** Optional bold title above the body. */
7
+ title?: string;
8
+ /** Alert body content. */
9
+ children: ReactNode;
10
+ /** Show a dismiss (×) button. */
11
+ dismissible?: boolean;
12
+ /** Callback fired when the dismiss button is clicked. */
13
+ onDismiss?: () => void;
14
+ /** Additional CSS classes on the root element. */
15
+ className?: string;
16
+ }
17
+ export declare function Alert({ variant, title, children, dismissible, onDismiss, className, }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
18
+ //# sourceMappingURL=Alert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAWjD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,WAAW,UAAU;IACvB,6DAA6D;IAC7D,OAAO,EAAE,YAAY,CAAC;IACtB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,iCAAiC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAoCD,wBAAgB,KAAK,CAAC,EAClB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAAmB,EACnB,SAAS,EACT,SAAc,GACjB,EAAE,UAAU,kDAsCZ"}
@@ -0,0 +1,24 @@
1
+ import { type ReactNode } from "react";
2
+ import { type DialogSize } from "./Dialog";
3
+ export interface ConfirmDialogProps {
4
+ /** Whether the dialog is open. */
5
+ open: boolean;
6
+ /** Callback to close without confirming. */
7
+ onCancel: () => void;
8
+ /** Callback when the user confirms the action. */
9
+ onConfirm: () => void;
10
+ /** Dialog title. */
11
+ title: string;
12
+ /** Body message / description. */
13
+ children: ReactNode;
14
+ /** Text for the confirm button. Default: "Confirm". */
15
+ confirmLabel?: string;
16
+ /** Text for the cancel button. Default: "Cancel". */
17
+ cancelLabel?: string;
18
+ /** Danger variant — red confirm button with a warning icon. */
19
+ danger?: boolean;
20
+ /** Width preset. Default: "sm". */
21
+ size?: DialogSize;
22
+ }
23
+ export declare function ConfirmDialog({ open, onCancel, onConfirm, title, children, confirmLabel, cancelLabel, danger, size, }: ConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
24
+ //# sourceMappingURL=ConfirmDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAInD,MAAM,WAAW,kBAAkB;IAC/B,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,kDAAkD;IAClD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,IAAI,CAAC,EAAE,UAAU,CAAC;CACrB;AAID,wBAAgB,aAAa,CAAC,EAC1B,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,KAAK,EACL,QAAQ,EACR,YAAwB,EACxB,WAAsB,EACtB,MAAc,EACd,IAAW,GACd,EAAE,kBAAkB,2CAoCpB"}
@@ -0,0 +1,20 @@
1
+ import { type ReactNode } from "react";
2
+ export type DialogSize = "sm" | "md" | "lg";
3
+ export interface DialogProps {
4
+ /** Whether the dialog is open. */
5
+ open: boolean;
6
+ /** Callback to close the dialog. */
7
+ onClose: () => void;
8
+ /** Optional dialog title shown in the header. */
9
+ title?: string;
10
+ /** Width preset. Default: "md". */
11
+ size?: DialogSize;
12
+ /** Dialog body content. */
13
+ children: ReactNode;
14
+ /** Optional footer (buttons, etc.). */
15
+ footer?: ReactNode;
16
+ /** Additional CSS classes on the panel. */
17
+ className?: string;
18
+ }
19
+ export declare function Dialog({ open, onClose, title, size, children, footer, className, }: DialogProps): import("react").ReactPortal | null;
20
+ //# sourceMappingURL=Dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM9E,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,WAAW,WAAW;IACxB,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,oCAAoC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,2BAA2B;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,uCAAuC;IACvC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAYD,wBAAgB,MAAM,CAAC,EACnB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,IAAW,EACX,QAAQ,EACR,MAAM,EACN,SAAc,GACjB,EAAE,WAAW,sCA4Hb"}
@@ -0,0 +1,5 @@
1
+ import { type ReactNode } from "react";
2
+ export declare function ToastProvider({ children }: {
3
+ children: ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=Toast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AA0HjF,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CA8BlE"}
@@ -0,0 +1,6 @@
1
+ export { Alert, type AlertProps, type AlertVariant } from "./Alert";
2
+ export { ConfirmDialog, type ConfirmDialogProps } from "./ConfirmDialog";
3
+ export { Dialog, type DialogProps, type DialogSize } from "./Dialog";
4
+ export { ToastProvider } from "./Toast";
5
+ export { useToast, type ToastData, type ToastVariant } from "./toastContext";
6
+ //# sourceMappingURL=index.d.ts.map