noph-ui 0.11.9 → 0.12.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.
@@ -6,11 +6,12 @@
6
6
  element = $bindable(),
7
7
  showPopover = $bindable(),
8
8
  hidePopover = $bindable(),
9
+ quick = false,
9
10
  children,
10
11
  headline,
11
12
  icon,
12
13
  supportingText,
13
- buttons,
14
+ actions,
14
15
  divider,
15
16
  ...attributes
16
17
  }: DialogProps = $props()
@@ -24,7 +25,12 @@
24
25
  }
25
26
  </script>
26
27
 
27
- <div bind:this={element} popover="auto" class="np-dialog-container" {...attributes}>
28
+ <div
29
+ bind:this={element}
30
+ popover="auto"
31
+ {...attributes}
32
+ class={['np-dialog-container', !quick && 'np-animate']}
33
+ >
28
34
  <div
29
35
  role="none"
30
36
  class="np-backdrop"
@@ -48,9 +54,9 @@
48
54
  {#if children}
49
55
  {@render children()}
50
56
  {/if}
51
- {#if buttons}
52
- <div class="np-dialog-buttons">
53
- {@render buttons()}
57
+ {#if actions}
58
+ <div class="np-dialog-actions">
59
+ {@render actions()}
54
60
  </div>
55
61
  {/if}
56
62
  </div>
@@ -60,12 +66,10 @@
60
66
  .np-dialog-container {
61
67
  background: transparent;
62
68
  border: none;
69
+ margin: auto;
63
70
  padding: 9px 14px 20px 14px;
64
71
  z-index: 1000;
65
72
  padding: 2rem 1rem;
66
- transition:
67
- display 0.25s allow-discrete,
68
- overlay 0.25s allow-discrete;
69
73
  }
70
74
  .np-dialog {
71
75
  border: 0;
@@ -79,12 +83,20 @@
79
83
  max-height: 100dvh;
80
84
  scrollbar-color: var(--np-color-on-surface-variant) transparent;
81
85
  scrollbar-width: thin;
86
+ position: relative;
87
+ }
88
+
89
+ .np-animate {
90
+ transition:
91
+ display 0.25s allow-discrete,
92
+ overlay 0.25s allow-discrete;
93
+ }
94
+
95
+ .np-animate[popover] .np-dialog {
82
96
  transition: opacity 0.25s ease;
83
97
  opacity: 0;
84
- margin: auto;
85
- position: relative;
86
98
  }
87
- .np-dialog-container:popover-open .np-dialog {
99
+ .np-animate:popover-open .np-dialog {
88
100
  opacity: 1;
89
101
  @starting-style {
90
102
  opacity: 0;
@@ -94,10 +106,13 @@
94
106
  inset: 0;
95
107
  position: fixed;
96
108
  background-color: var(--np-color-scrim);
109
+ opacity: 0.38;
110
+ }
111
+ .np-animate[popover] .np-backdrop {
97
112
  opacity: 0;
98
113
  transition: opacity 0.25s ease;
99
114
  }
100
- .np-dialog-container[popover]:popover-open .np-backdrop {
115
+ .np-animate[popover]:popover-open .np-backdrop {
101
116
  opacity: 0.38;
102
117
  @starting-style {
103
118
  opacity: 0;
@@ -117,10 +132,11 @@
117
132
  font-size: 1.5rem;
118
133
  font-weight: 400;
119
134
  }
120
- .np-dialog-buttons {
135
+ .np-dialog-actions {
121
136
  display: flex;
122
137
  justify-content: flex-end;
123
138
  gap: 0.5rem;
139
+ box-sizing: border-box;
124
140
  margin-top: 1.5rem;
125
141
  }
126
142
  .np-dialog-supporting-text {
@@ -5,7 +5,8 @@ export interface DialogProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class
5
5
  headline: string;
6
6
  supportingText?: string;
7
7
  divider?: boolean;
8
- buttons?: Snippet;
8
+ actions?: Snippet;
9
+ quick?: boolean;
9
10
  element?: HTMLElement;
10
11
  showPopover?: () => void;
11
12
  hidePopover?: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.11.9",
3
+ "version": "0.12.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {