nitro-web 0.0.57 → 0.0.58

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.
@@ -2,13 +2,14 @@
2
2
  import { isObject, isString, queryObject } from 'nitro-web/util'
3
3
  import { X, CircleCheck } from 'lucide-react'
4
4
  import { MessageObject } from 'nitro-web/types'
5
+ import { twMerge } from 'nitro-web'
5
6
 
6
7
  /**
7
8
  * Shows a message
8
9
  * Triggered by navigating to a link with a valid query string, or
9
10
  * by setting store.message to a string or more explicitly, to an object
10
11
  **/
11
- export function Message() {
12
+ export function Message({ className }: { className?: string }) {
12
13
  const devDontHide = false
13
14
  const [store, setStore] = useTracked()
14
15
  const [visible, setVisible] = useState(false)
@@ -81,13 +82,13 @@ export function Message() {
81
82
  setVisible(false)
82
83
  setTimeout(() => setStore(s => ({ ...s, message: undefined })), 250)
83
84
  }
84
-
85
+
85
86
  return (
86
87
  <>
87
88
  {/* Global notification live region, render this permanently at the end of the document */}
88
89
  <div
89
90
  aria-live="assertive"
90
- className="pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-20 nitro-message"
91
+ className={`${twMerge(`pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-[101] ${className||''}`)} nitro-message`}
91
92
  >
92
93
  <div className="flex w-full flex-col items-center space-y-4 sm:items-end">
93
94
  {isObject(store.message) && (
@@ -1,4 +1,4 @@
1
- import { IsFirstRender } from 'nitro-web'
1
+ import { IsFirstRender, twMerge } from 'nitro-web'
2
2
  import SvgX1 from 'nitro-web/client/imgs/icons/x1.svg'
3
3
 
4
4
  type ModalProps = {
@@ -64,7 +64,7 @@ export function Modal({ show, setShow, children, maxWidth, minHeight, dismissabl
64
64
  return (
65
65
  <div
66
66
  onClick={(e) => e.stopPropagation()}
67
- class={`fixed top-0 w-[100vw] h-[100vh] z-[700] nitro-modal ${_state.root}`}
67
+ class={`${twMerge(`fixed top-0 w-[100vw] h-[100vh] z-[100] ${_state.root} ${props.className}`)} nitro-modal`}
68
68
  >
69
69
  <div class={`!absolute inset-0 box-content bg-gray-500/70 transition-opacity ${_state.bg}`}></div>
70
70
  <div class={`relative h-[100vh] overflow-y-auto transition-[opacity,transform] ${_state.container}`}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitro-web",
3
- "version": "0.0.57",
3
+ "version": "0.0.58",
4
4
  "repository": "github:boycce/nitro-web",
5
5
  "homepage": "https://boycce.github.io/nitro-web/",
6
6
  "description": "Nitro is a battle-tested, modular base project to turbocharge your projects, styled using Tailwind 🚀",