@telegraph/modal 0.1.21 → 0.1.22
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.
- package/CHANGELOG.md +8 -0
- package/README.md +31 -17
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +481 -466
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/Modal/Modal.d.ts +7 -1
- package/dist/types/Modal/Modal.d.ts.map +1 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @telegraph/modal
|
|
2
2
|
|
|
3
|
+
## 0.1.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#686](https://github.com/knocklabs/telegraph/pull/686) [`e93b9a6`](https://github.com/knocklabs/telegraph/commit/e93b9a6c120dcc4b3cba129c21d43e892f56c87f) Thanks [@kylemcd](https://github.com/kylemcd)! - feat: add Modal.Heading component to standardize modal titles with default size 3 and medium weight
|
|
8
|
+
|
|
9
|
+
- [#682](https://github.com/knocklabs/telegraph/pull/682) [`5196b27`](https://github.com/knocklabs/telegraph/commit/5196b2774b2aa218da7fa721ee59fd16049d18de) Thanks [@dependabot](https://github.com/apps/dependabot)! - chore(deps): bump @radix-ui/react-portal from 1.1.9 to 1.1.10
|
|
10
|
+
|
|
3
11
|
## 0.1.21
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ export const BasicModal = () => {
|
|
|
49
49
|
<Modal.Root open={open} onOpenChange={setOpen} a11yTitle="Settings">
|
|
50
50
|
<Modal.Content>
|
|
51
51
|
<Modal.Header>
|
|
52
|
-
<
|
|
52
|
+
<Modal.Heading>Settings</Modal.Heading>
|
|
53
53
|
<Modal.Close />
|
|
54
54
|
</Modal.Header>
|
|
55
55
|
|
|
@@ -130,6 +130,18 @@ Footer section typically containing action buttons.
|
|
|
130
130
|
|
|
131
131
|
Inherits all Stack props for layout and styling.
|
|
132
132
|
|
|
133
|
+
### `<Modal.Heading>`
|
|
134
|
+
|
|
135
|
+
Standardized heading component for modal titles with consistent styling.
|
|
136
|
+
|
|
137
|
+
| Prop | Type | Default | Description |
|
|
138
|
+
| -------- | ------------------------------------------------- | ---------- | ------------------ |
|
|
139
|
+
| `as` | `TgphElement` | `"h2"` | HTML element type |
|
|
140
|
+
| `size` | `"0" \| "1" \| "2" \| "3" \| "4" \| "5" \| ... ` | `"3"` | Heading size |
|
|
141
|
+
| `weight` | `"regular" \| "medium" \| "semi-bold" \| "bold"` | `"medium"` | Font weight |
|
|
142
|
+
|
|
143
|
+
Inherits all Heading props from `@telegraph/typography` for additional styling.
|
|
144
|
+
|
|
133
145
|
### `<Modal.Close>`
|
|
134
146
|
|
|
135
147
|
Close button that dismisses the modal.
|
|
@@ -168,7 +180,7 @@ const BasicModal = () => {
|
|
|
168
180
|
<Modal.Root open={open} onOpenChange={setOpen} a11yTitle="Basic Modal">
|
|
169
181
|
<Modal.Content>
|
|
170
182
|
<Modal.Header>
|
|
171
|
-
<
|
|
183
|
+
<Modal.Heading>Modal Title</Modal.Heading>
|
|
172
184
|
<Modal.Close />
|
|
173
185
|
</Modal.Header>
|
|
174
186
|
|
|
@@ -195,7 +207,7 @@ const ConfirmationModal = ({ open, onClose, onConfirm, title, message }) => (
|
|
|
195
207
|
<Modal.Header>
|
|
196
208
|
<Stack direction="row" align="center" gap="2">
|
|
197
209
|
<Icon icon={AlertTriangle} color="red" />
|
|
198
|
-
<
|
|
210
|
+
<Modal.Heading>{title}</Modal.Heading>
|
|
199
211
|
</Stack>
|
|
200
212
|
<Modal.Close />
|
|
201
213
|
</Modal.Header>
|
|
@@ -248,7 +260,7 @@ const FormModal = ({ open, onClose, onSubmit }) => {
|
|
|
248
260
|
<Modal.Root open={open} onOpenChange={onClose} a11yTitle="Add User">
|
|
249
261
|
<Modal.Content>
|
|
250
262
|
<Modal.Header>
|
|
251
|
-
<
|
|
263
|
+
<Modal.Heading>Add New User</Modal.Heading>
|
|
252
264
|
<Modal.Close />
|
|
253
265
|
</Modal.Header>
|
|
254
266
|
|
|
@@ -304,7 +316,7 @@ const FullScreenModal = ({ open, onClose, children }) => (
|
|
|
304
316
|
<Modal.Root open={open} onOpenChange={onClose} a11yTitle="Full Screen View">
|
|
305
317
|
<Modal.Content w="screen" maxW="screen" h="screen" rounded="0">
|
|
306
318
|
<Modal.Header>
|
|
307
|
-
<
|
|
319
|
+
<Modal.Heading>Full Screen Modal</Modal.Heading>
|
|
308
320
|
<Modal.Close />
|
|
309
321
|
</Modal.Header>
|
|
310
322
|
|
|
@@ -342,7 +354,7 @@ const StackedModalsExample = () => {
|
|
|
342
354
|
>
|
|
343
355
|
<Modal.Content>
|
|
344
356
|
<Modal.Header>
|
|
345
|
-
<
|
|
357
|
+
<Modal.Heading>First Modal</Modal.Heading>
|
|
346
358
|
<Modal.Close />
|
|
347
359
|
</Modal.Header>
|
|
348
360
|
|
|
@@ -363,7 +375,7 @@ const StackedModalsExample = () => {
|
|
|
363
375
|
>
|
|
364
376
|
<Modal.Content>
|
|
365
377
|
<Modal.Header>
|
|
366
|
-
<
|
|
378
|
+
<Modal.Heading>Second Modal</Modal.Heading>
|
|
367
379
|
<Modal.Close />
|
|
368
380
|
</Modal.Header>
|
|
369
381
|
|
|
@@ -384,7 +396,7 @@ const StackedModalsExample = () => {
|
|
|
384
396
|
>
|
|
385
397
|
<Modal.Content>
|
|
386
398
|
<Modal.Header>
|
|
387
|
-
<
|
|
399
|
+
<Modal.Heading>Third Modal</Modal.Heading>
|
|
388
400
|
<Modal.Close />
|
|
389
401
|
</Modal.Header>
|
|
390
402
|
|
|
@@ -423,7 +435,7 @@ const CustomFocusModal = ({ open, onClose }) => {
|
|
|
423
435
|
>
|
|
424
436
|
<Modal.Content>
|
|
425
437
|
<Modal.Header>
|
|
426
|
-
<
|
|
438
|
+
<Modal.Heading>Custom Focus Management</Modal.Heading>
|
|
427
439
|
<Modal.Close />
|
|
428
440
|
</Modal.Header>
|
|
429
441
|
|
|
@@ -464,7 +476,7 @@ const LoadingModal = ({ open, onClose }) => {
|
|
|
464
476
|
<Modal.Root open={open} onOpenChange={onClose} a11yTitle="Save Changes">
|
|
465
477
|
<Modal.Content>
|
|
466
478
|
<Modal.Header>
|
|
467
|
-
<
|
|
479
|
+
<Modal.Heading>Save Changes</Modal.Heading>
|
|
468
480
|
<Modal.Close disabled={loading} />
|
|
469
481
|
</Modal.Header>
|
|
470
482
|
|
|
@@ -509,7 +521,7 @@ const AnimatedModal = ({ open, onClose }) => (
|
|
|
509
521
|
transition={{ duration: 0.2 }}
|
|
510
522
|
>
|
|
511
523
|
<Modal.Header>
|
|
512
|
-
<
|
|
524
|
+
<Modal.Heading>Animated Modal</Modal.Heading>
|
|
513
525
|
<Modal.Close />
|
|
514
526
|
</Modal.Header>
|
|
515
527
|
|
|
@@ -551,7 +563,7 @@ const ControlledModal = () => {
|
|
|
551
563
|
>
|
|
552
564
|
<Modal.Content>
|
|
553
565
|
<Modal.Header>
|
|
554
|
-
<
|
|
566
|
+
<Modal.Heading>Controlled Modal</Modal.Heading>
|
|
555
567
|
{canClose && <Modal.Close />}
|
|
556
568
|
</Modal.Header>
|
|
557
569
|
|
|
@@ -598,7 +610,7 @@ const WizardModal = ({ open, onClose }) => {
|
|
|
598
610
|
<Modal.Root open={open} onOpenChange={onClose} a11yTitle="Setup Wizard">
|
|
599
611
|
<Modal.Content>
|
|
600
612
|
<Modal.Header>
|
|
601
|
-
<
|
|
613
|
+
<Modal.Heading>{steps[currentStep].title}</Modal.Heading>
|
|
602
614
|
<Modal.Close />
|
|
603
615
|
</Modal.Header>
|
|
604
616
|
|
|
@@ -717,7 +729,7 @@ The modal component uses Telegraph design tokens for consistent styling:
|
|
|
717
729
|
>
|
|
718
730
|
<Modal.Content>
|
|
719
731
|
<Modal.Header>
|
|
720
|
-
<
|
|
732
|
+
<Modal.Heading>Delete Item</Modal.Heading>
|
|
721
733
|
<Modal.Close />
|
|
722
734
|
</Modal.Header>
|
|
723
735
|
|
|
@@ -781,7 +793,7 @@ export const SettingsModal = ({ open, onClose, settings, onSave }) => {
|
|
|
781
793
|
>
|
|
782
794
|
<Modal.Content maxW="120">
|
|
783
795
|
<Modal.Header>
|
|
784
|
-
<
|
|
796
|
+
<Modal.Heading>Settings</Modal.Heading>
|
|
785
797
|
<Modal.Close />
|
|
786
798
|
</Modal.Header>
|
|
787
799
|
|
|
@@ -874,7 +886,9 @@ export const ImageGalleryModal = ({
|
|
|
874
886
|
<Modal.Content w="screen" maxW="screen" h="screen" rounded="0" p="0">
|
|
875
887
|
<Modal.Header px="6" py="4">
|
|
876
888
|
<Stack direction="row" align="center" justify="between" w="full">
|
|
877
|
-
<
|
|
889
|
+
<Modal.Heading>
|
|
890
|
+
{currentImage?.title || `Image ${currentIndex + 1}`}
|
|
891
|
+
</Modal.Heading>
|
|
878
892
|
<Stack direction="row" gap="2">
|
|
879
893
|
<Button
|
|
880
894
|
variant="ghost"
|
|
@@ -980,7 +994,7 @@ export const ExportModal = ({ open, onClose, onExport }) => {
|
|
|
980
994
|
<Modal.Root open={open} onOpenChange={onClose} a11yTitle="Export Data">
|
|
981
995
|
<Modal.Content>
|
|
982
996
|
<Modal.Header>
|
|
983
|
-
<
|
|
997
|
+
<Modal.Heading>Export Data</Modal.Heading>
|
|
984
998
|
<Modal.Close />
|
|
985
999
|
</Modal.Header>
|
|
986
1000
|
|