@versini/ui-panel 2.2.7 → 2.2.8

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/README.md CHANGED
@@ -4,14 +4,29 @@
4
4
 
5
5
  > An accessible React slide-out panel component built with TypeScript and TailwindCSS.
6
6
 
7
- The Panel component provides slide-out panels and drawers with focus management, keyboard navigation, and customizable positioning.
8
-
7
+ The Panel component provides slide-out panels and drawers with focus management, keyboard navigation, document title management, optional animations, and customizable positioning / sizing.
9
8
 
10
9
  ## Table of Contents
11
10
 
11
+ - [Table of Contents](#table-of-contents)
12
12
  - [Features](#features)
13
13
  - [Installation](#installation)
14
14
  - [Usage](#usage)
15
+ - [Examples](#examples)
16
+ - [Message Box Variant](#message-box-variant)
17
+ - [Animated Panel (Fade)](#animated-panel-fade)
18
+ - [API](#api)
19
+ - [Panel Props](#panel-props)
20
+
21
+ ## Features
22
+
23
+ - **🪟 Versatile Layouts**: Standard panel and message box variants (`kind` prop)
24
+ - **🎯 Focus Management**: Uses underlying modal primitives for proper focus trapping & return
25
+ - **♿ Accessible**: ARIA compliant structure with heading, description, close control
26
+ - **🎬 Optional Animations**: Slide or fade entrance animations (`animation` / `animationType`)
27
+ - **📐 Responsive Sizing**: Predefined max widths (`small`, `medium`, `large`) above md breakpoint
28
+ - **🧩 Composable**: Footer slot for actions / extra content
29
+ - **🧪 Type Safe**: Fully typed props with inline documentation
15
30
 
16
31
  ## Installation
17
32
 
@@ -19,7 +34,7 @@ The Panel component provides slide-out panels and drawers with focus management,
19
34
  npm install @versini/ui-panel
20
35
  ```
21
36
 
22
- > **Note**: This component requires TailwindCSS and the `@versini/ui-styles` plugin for proper styling. See the [root README](../../README.md#tailwindcss-setup) for complete setup instructions.
37
+ > **Note**: This component requires TailwindCSS and the `@versini/ui-styles` plugin for proper styling. See the [installation documentation](https://versini-org.github.io/ui-components/?path=/docs/getting-started-installation--docs) for complete setup instructions.
23
38
 
24
39
  ## Usage
25
40
 
@@ -29,18 +44,87 @@ import { useState } from "react";
29
44
 
30
45
  function App() {
31
46
  const [open, setOpen] = useState(false);
32
-
47
+
33
48
  return (
34
49
  <>
35
50
  <button onClick={() => setOpen(true)}>Open Panel</button>
51
+ <Panel title="Panel Title" open={open} onOpenChange={setOpen}>
52
+ Panel content goes here.
53
+ </Panel>
54
+ </>
55
+ );
56
+ }
57
+ ```
58
+
59
+ ## Examples
60
+
61
+ ### Message Box Variant
62
+
63
+ ```tsx
64
+ import { Panel } from "@versini/ui-panel";
65
+ import { useState } from "react";
66
+
67
+ function MessageBoxExample() {
68
+ const [open, setOpen] = useState(false);
69
+ return (
70
+ <>
71
+ <button onClick={() => setOpen(true)}>Show Message</button>
36
72
  <Panel
37
- title="Panel Title"
73
+ kind="messagebox"
74
+ title="Session Expired"
38
75
  open={open}
39
76
  onOpenChange={setOpen}
77
+ footer={
78
+ <div className="flex justify-end gap-2">
79
+ <button
80
+ className="px-3 py-1 rounded bg-surface-lighter"
81
+ onClick={() => setOpen(false)}
82
+ >
83
+ Dismiss
84
+ </button>
85
+ <button className="px-3 py-1 rounded bg-blue-600 text-white">
86
+ Re‑authenticate
87
+ </button>
88
+ </div>
89
+ }
40
90
  >
41
- Panel content goes here.
91
+ Your session has expired. Please sign in again to continue.
42
92
  </Panel>
43
93
  </>
44
94
  );
45
95
  }
46
96
  ```
97
+
98
+ ### Animated Panel (Fade)
99
+
100
+ ```tsx
101
+ <Panel
102
+ title="Animated Panel"
103
+ open={open}
104
+ onOpenChange={setOpen}
105
+ animation
106
+ animationType="fade"
107
+ >
108
+ Content with fade animation.
109
+ </Panel>
110
+ ```
111
+
112
+ ## API
113
+
114
+ ### Panel Props
115
+
116
+ | Prop | Type | Default | Description |
117
+ | --------------- | ------------------------- | ------------- | ---------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------- |
118
+ | `open` | `boolean` | - | Whether the panel is open. |
119
+ | `onOpenChange` | `(open: boolean) => void` | - | Callback fired when open state changes. |
120
+ | `title` | `string` | - | Title displayed in the header (also used to augment `document.title`). |
121
+ | `children` | `React.ReactNode` | - | Main content of the panel. |
122
+ | `footer` | `React.ReactNode` | - | Optional footer content (actions, etc.). |
123
+ | `className` | `string` | - | Extra classes applied to width wrapper (overrides default width). |
124
+ | `borderMode` | `"dark" | "light"` | `"light"` | Visual style of border / surface. |
125
+ | `kind` | `"panel" | "messagebox"` | `"panel"` | Layout variant. |
126
+ | `animation` | `boolean` | `false` | Enable entrance animation. |
127
+ | `animationType` | `"slide" | "fade"` | `"slide"` | Animation style (only when `animation` is true). |
128
+ | `maxWidth` | `"small" | "medium" | "large"` | `"medium"` | Max width applied (≥ md breakpoint) for `kind="panel"`. |
129
+
130
+ > Also inherits any valid props for the underlying modal primitives where relevant.
@@ -506,13 +506,13 @@ const M = {
506
506
  );
507
507
  U.displayName = "ButtonIcon";
508
508
  /*!
509
- @versini/ui-button v7.1.3
509
+ @versini/ui-button v7.1.4
510
510
  © 2025 gizmette.com
511
511
  */
512
512
  try {
513
513
  window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
514
- version: "7.1.3",
515
- buildTime: "08/23/2025 09:08 AM EDT",
514
+ version: "7.1.4",
515
+ buildTime: "08/23/2025 10:05 AM EDT",
516
516
  homepage: "https://github.com/aversini/ui-components",
517
517
  license: "MIT"
518
518
  });
@@ -714,13 +714,13 @@ const Ye = h.forwardRef(function(e, r) {
714
714
  }) });
715
715
  });
716
716
  /*!
717
- @versini/ui-modal v2.0.7
717
+ @versini/ui-modal v2.0.8
718
718
  © 2025 gizmette.com
719
719
  */
720
720
  try {
721
721
  window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
722
- version: "2.0.7",
723
- buildTime: "08/23/2025 09:08 AM EDT",
722
+ version: "2.0.8",
723
+ buildTime: "08/23/2025 10:06 AM EDT",
724
724
  homepage: "https://github.com/aversini/ui-components",
725
725
  license: "MIT"
726
726
  });
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { MESSAGEBOX_CLASSNAME as o, PANEL_CLASSNAME as E, Panel as A } from "./components/Panel/Panel.js";
2
2
  /*!
3
- @versini/ui-panel v2.2.7
3
+ @versini/ui-panel v2.2.8
4
4
  © 2025 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
8
- version: "2.2.7",
9
- buildTime: "08/23/2025 09:09 AM EDT",
8
+ version: "2.2.8",
9
+ buildTime: "08/23/2025 10:06 AM EDT",
10
10
  homepage: "https://github.com/aversini/ui-components",
11
11
  license: "MIT"
12
12
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-panel",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -54,5 +54,5 @@
54
54
  "sideEffects": [
55
55
  "**/*.css"
56
56
  ],
57
- "gitHead": "7bbfa99a4441ef5b0828a37d190f694e199b663d"
57
+ "gitHead": "a1afd6e4613b1da7abf61d10a72614611521fb39"
58
58
  }