@nova-design-system/nova-react 3.12.0 → 3.13.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 (59) hide show
  1. package/README.md +27 -58
  2. package/dist/cjs/collapse.animation-acda1bf5-BuORVmQv.js +214 -0
  3. package/dist/cjs/{constants-a857c476-Cj2b-su0.js → constants-d0f19e7b-s0SCO_vi.js} +5 -0
  4. package/dist/cjs/fade.animation-eb454088-Bma0SpTf.js +724 -0
  5. package/dist/cjs/{index-jBgPO7HC.js → index-Jgn7NELT.js} +2090 -1681
  6. package/dist/cjs/index.js +6 -1
  7. package/dist/cjs/{nv-accordion-item.entry-BUb_Apy8.js → nv-accordion-item.entry-C7vVmDCg.js} +74 -40
  8. package/dist/cjs/nv-accordion.entry-CFynyAOo.js +178 -0
  9. package/dist/cjs/{nv-alert.entry-nzJu8E5h.js → nv-alert.entry-C_FMs0Yi.js} +20 -20
  10. package/dist/cjs/{nv-avatar.entry-BPp1d-QO.js → nv-avatar.entry-BvjSzIHn.js} +7 -7
  11. package/dist/cjs/{nv-badge_2.entry-Bk56p4jv.js → nv-badge_2.entry-CLNvgVtj.js} +11 -11
  12. package/dist/cjs/{nv-breadcrumb.entry-DB3zR7FC.js → nv-breadcrumb.entry-Ch2Cvr_a.js} +1 -1
  13. package/dist/cjs/{nv-breadcrumbs.entry-CoGgEsro.js → nv-breadcrumbs.entry-DmH8AGIm.js} +1 -1
  14. package/dist/cjs/{nv-button.entry-psZ3_t6i.js → nv-button.entry-B0lusQ2w.js} +7 -7
  15. package/dist/cjs/{nv-buttongroup.entry-cNenBx1F.js → nv-buttongroup.entry-DLVCcdh9.js} +1 -1
  16. package/dist/cjs/{nv-calendar.entry-nkrORr_V.js → nv-calendar.entry-BmX0f_Or.js} +20 -16
  17. package/dist/cjs/{nv-col.entry-D4mInxLU.js → nv-col.entry-lysICYEC.js} +1 -1
  18. package/dist/cjs/{nv-datagrid.entry-D50O7eyc.js → nv-datagrid.entry-vG3h5dj3.js} +6 -6
  19. package/dist/cjs/{nv-datagridcolumn.entry-BuGX-3ev.js → nv-datagridcolumn.entry-9NynF9K-.js} +1 -1
  20. package/dist/cjs/{nv-dialog.entry-yiZIq-TV.js → nv-dialog.entry-Ctsz1K-O.js} +3 -3
  21. package/dist/cjs/{nv-dialogfooter_2.entry-C9ykJQK6.js → nv-dialogfooter_2.entry-B17HEgyc.js} +10 -7
  22. package/dist/cjs/{nv-fieldcheckbox.entry-CCRvvFJ3.js → nv-fieldcheckbox.entry-DMiADwqV.js} +1 -1
  23. package/dist/cjs/{nv-fielddate.entry-C4k6k980.js → nv-fielddate.entry-D3X6Jl3u.js} +1 -1
  24. package/dist/cjs/{nv-fielddaterange.entry-BhfV2KCd.js → nv-fielddaterange.entry-C8_SFFXW.js} +1 -1
  25. package/dist/cjs/{nv-fielddropdown.entry-Xkkvl_gb.js → nv-fielddropdown.entry-BiBR8Qgs.js} +1 -1
  26. package/dist/cjs/{nv-fielddropdownitem.entry-Ckwq6k6r.js → nv-fielddropdownitem.entry-DQ8QK4AS.js} +1 -1
  27. package/dist/cjs/{nv-fieldmultiselect.entry-D4PgRSFv.js → nv-fieldmultiselect.entry-J5VTOPum.js} +1 -31
  28. package/dist/cjs/{nv-fieldnumber.entry-BEnJ81XX.js → nv-fieldnumber.entry-Djpg1HMq.js} +2 -2
  29. package/dist/cjs/{nv-fieldpassword.entry-elzveqP8.js → nv-fieldpassword.entry-DKT9Xn5H.js} +1 -1
  30. package/dist/cjs/{nv-fieldradio.entry-xJpdsXGo.js → nv-fieldradio.entry-CPYf3K2o.js} +1 -1
  31. package/dist/cjs/{nv-fieldselect.entry-DVyO7LMD.js → nv-fieldselect.entry-DnbL7aZB.js} +1 -1
  32. package/dist/cjs/{nv-fieldslider.entry-O4TFO-Rl.js → nv-fieldslider.entry-CNRJuo7v.js} +25 -17
  33. package/dist/cjs/{nv-fieldtext.entry-p-9GEp1g.js → nv-fieldtext.entry-B9lIHck7.js} +1 -1
  34. package/dist/cjs/{nv-fieldtextarea.entry-Cvik8cci.js → nv-fieldtextarea.entry-B2EDj8cm.js} +1 -1
  35. package/dist/cjs/{nv-fieldtime.entry-mnsDon9M.js → nv-fieldtime.entry-CpoXpAPx.js} +60 -60
  36. package/dist/cjs/{nv-icon.entry-CrgnozDL.js → nv-icon.entry-DbOeEd4f.js} +7 -7
  37. package/dist/cjs/{nv-iconbutton_2.entry-M5EY3-1s.js → nv-iconbutton_2.entry-DR_wR73O.js} +1 -1
  38. package/dist/cjs/{nv-menu.entry-D7bORqXp.js → nv-menu.entry-DB_G8hS_.js} +1 -1
  39. package/dist/cjs/{nv-menuitem.entry-CaN6qNoB.js → nv-menuitem.entry-PBCNIzPI.js} +1 -1
  40. package/dist/cjs/nv-notification.entry-CyumbQS_.js +178 -0
  41. package/dist/cjs/{nv-popover.entry-DGeXSyhZ.js → nv-popover.entry-ttESQMgj.js} +9 -9
  42. package/dist/cjs/{nv-row.entry-B17DsCjM.js → nv-row.entry-DPEGaFeS.js} +2 -2
  43. package/dist/cjs/{nv-stack.entry-Dv3YU4nJ.js → nv-stack.entry-CTPwlz23.js} +2 -2
  44. package/dist/cjs/{nv-table.entry-BILyG-43.js → nv-table.entry-Dv1mZKcu.js} +3 -3
  45. package/dist/cjs/{nv-tablecolumn.entry-II6Z_gdO.js → nv-tablecolumn.entry-DrAaeHm-.js} +1 -1
  46. package/dist/cjs/{nv-toggle.entry-5Wmww2Cd.js → nv-toggle.entry-D2TRd371.js} +3 -3
  47. package/dist/cjs/{nv-togglebutton.entry-Dnmfrj0O.js → nv-togglebutton.entry-D95qOQ1K.js} +2 -2
  48. package/dist/cjs/{nv-togglebuttongroup.entry-C9mplQcb.js → nv-togglebuttongroup.entry-BNvyZgbh.js} +2 -2
  49. package/dist/cjs/{nv-tooltip.entry-CcUQrjAv.js → nv-tooltip.entry-oOw6EmyL.js} +2 -2
  50. package/dist/cjs/{stylefire.es-74da334a-y0piPjlz.js → style-value-types.es-f5d10b79-D0QCM8OB.js} +50 -694
  51. package/dist/cjs/{timeline.animation-adf35ecb-CE6Dsdxr.js → timeline.animation-79215cd4-KteJaZPb.js} +19 -0
  52. package/dist/generated/components.js +8 -0
  53. package/dist/generated/components.server.js +18 -1
  54. package/dist/types/generated/components.d.ts +5 -0
  55. package/dist/types/generated/components.server.d.ts +5 -0
  56. package/package.json +1 -1
  57. package/dist/cjs/collapse.animation-16e3af45-CChx_tQJ.js +0 -84
  58. package/dist/cjs/fade.animation-71e8e34c-BAw_TYsB.js +0 -68
  59. package/dist/cjs/nv-accordion.entry-hi3M0POV.js +0 -164
package/README.md CHANGED
@@ -5,7 +5,8 @@
5
5
  - [Nova Components React](#nova-components-react)
6
6
  - [Key Features](#key-features)
7
7
  - [Installation](#installation)
8
- - [Setup Using Tailwind (Recommended)](#setup-using-tailwind-recommended)
8
+ - [Setting up Tailwind](#setting-up-tailwind)
9
+ - [About Tailwind and the Nova Plugin](#about-tailwind-and-the-nova-plugin)
9
10
  - [1. Install Tailwind CSS and the Vite Plugin](#1-install-tailwind-css-and-the-vite-plugin)
10
11
  - [2. Configure the Vite Plugin](#2-configure-the-vite-plugin)
11
12
  - [3. Create `tailwind.config.ts`](#3-create-tailwindconfigts)
@@ -14,9 +15,6 @@
14
15
  - [6. Use Nova Components with Tailwind Utilities](#6-use-nova-components-with-tailwind-utilities)
15
16
  - [7. Setup the Nova Font](#7-setup-the-nova-font)
16
17
  - [Creating Your Own Style Components with Tailwind](#creating-your-own-style-components-with-tailwind)
17
- - [Setup Without Tailwind (Not Recommended)](#setup-without-tailwind-not-recommended)
18
- - [1. Include Nova Tokens and Nova Utilities](#1-include-nova-tokens-and-nova-utilities)
19
- - [2. Use Nova Components](#2-use-nova-components)
20
18
  - [Nova Font Pro Integration](#nova-font-pro-integration)
21
19
  - [Option 1: Import in Global CSS (Recommended)](#option-1-import-in-global-css-recommended)
22
20
  - [Option 2: HTML Integration](#option-2-html-integration)
@@ -27,7 +25,7 @@
27
25
  ## Key Features
28
26
 
29
27
  - **Lightweight Integration**: Leverage Nova Web Components with minimal configuration in React.
30
- - **Customizable Styling**: Use Tailwind (recommended) or Nova’s utility classes to quickly style components.
28
+ - **Customizable Styling**: Use Tailwind’s utility classes with the Nova Tailwind theme and plugin for token-driven styling and layouts.
31
29
  - **Dark Mode Ready**: Toggle dark mode by adding the `dark` class to your `body` element.
32
30
  - **Nova Font Pro Support**: Easily integrate Nova’s custom font for a consistent design experience.
33
31
 
@@ -59,13 +57,27 @@ npm config set strict-ssl false
59
57
 
60
58
  ---
61
59
 
62
- ## Setup Using Tailwind (Recommended)
60
+ ## Setting up Tailwind
63
61
 
64
- We highly recommend using Tailwind CSS for styling, as it ensures an optimized bundle size and a powerful utility-first workflow. Nova offers a dedicated Tailwind plugin and theme, allowing you to seamlessly integrate Nova’s design tokens with Tailwind’s utility classes for a consistent and efficient styling workflow.
62
+ Nova React requires Tailwind CSS for styling. Tailwind provides a powerful utility-first workflow and an optimized bundle size. Nova includes a dedicated Tailwind theme and plugin that map Nova’s design tokens to Tailwind’s theme and utilities, enabling consistent, token-driven styling across your app.
65
63
 
66
64
  > **Tailwind Version**
67
65
  > This guide is written for Tailwind v4. While compatible with v3, some features may not work as expected.
68
66
 
67
+ ### About Tailwind and the Nova Plugin
68
+
69
+ - **What is Tailwind?** A utility-first CSS framework with low-level, composable classes (flex, grid, spacing, color, typography) to rapidly build UIs.
70
+ - **Nova Tokens**: Nova ships design tokens as CSS variables (via the Spark and Ocean themes) covering colors, spacing, typography, radii, shadows, and more.
71
+ - **Integration**:
72
+ - `novaTailwindTheme` wires Nova tokens into Tailwind’s theme scales.
73
+ - The Nova Tailwind plugin exposes utilities and variants that reference those tokens, so your Tailwind classes resolve to Nova’s token values at runtime.
74
+ - **Why import tokens CSS?** Import one token CSS file (`spark.css` or `ocean.css`) so the underlying CSS variables exist at runtime. The Tailwind utilities generated by the plugin read from these variables.
75
+ - **How to use**:
76
+ - Build responsive layouts with standard Tailwind utilities (flex, grid, gap, spacing).
77
+ - Customize Nova components by applying classes to `nv-*` elements and their slotted content.
78
+ - Centralize repeated patterns using Tailwind’s `@apply`.
79
+ - **Do not mix with legacy utilities**: When using Tailwind, do not import `@nova-design-system/nova-base/dist/css/nova-utils.css` to avoid redundant CSS and larger bundles.
80
+
69
81
  Below is an example setup using Vite + React. If you’re using another framework or bundler, please refer to the [Tailwind Installation Guide](https://tailwindcss.com/docs/installation).
70
82
 
71
83
  ### 1. Install Tailwind CSS and the Vite Plugin
@@ -137,6 +149,8 @@ createRoot(document.getElementById('root')!).render(
137
149
  )
138
150
  ```
139
151
 
152
+ > When using Tailwind, do not import `@nova-design-system/nova-base/dist/css/nova-utils.css`.
153
+
140
154
  ### 6. Use Nova Components with Tailwind Utilities
141
155
 
142
156
  ```tsx
@@ -158,6 +172,9 @@ const MyComponent: React.FC = () => {
158
172
  export default MyComponent
159
173
  ```
160
174
 
175
+ - Apply Tailwind classes to build layouts (e.g., `flex`, `grid`, `gap-*`, `p-*`, `m-*`).
176
+ - Compose classes to customize the look and spacing of Nova components and their content.
177
+
161
178
  ### 7. Setup the Nova Font
162
179
 
163
180
  Follow the steps in the [Nova Font Pro Integration](#nova-font-pro-integration) section below.
@@ -201,59 +218,11 @@ This ensures consistent styling and keeps your markup clean. Any colors or spaci
201
218
 
202
219
  ---
203
220
 
204
- ## Setup Without Tailwind (Not Recommended)
205
-
206
- If you don’t plan to use Tailwind, Nova provides a large utility CSS file for quick prototyping. Be aware that this approach will increase your CSS bundle size, offer less options, and lacks the flexibility and optimizations of Tailwind.
207
-
208
- ### 1. Include Nova Tokens and Nova Utilities
209
-
210
- In your entry point (`main.tsx`):
211
-
212
- ```ts
213
- import { StrictMode } from 'react'
214
- import { createRoot } from 'react-dom/client'
215
-
216
- import '@nova-design-system/nova-base/dist/css/spark.css' // or ocean.css
217
- import '@nova-design-system/nova-base/dist/css/nova-utils.css'
218
- import './index.css'
219
-
220
- import App from './App.tsx'
221
-
222
- createRoot(document.getElementById('root')!).render(
223
- <StrictMode>
224
- <App />
225
- </StrictMode>
226
- )
227
- ```
228
-
229
- ### 2. Use Nova Components
230
-
231
- ```tsx
232
- import { useState } from 'react'
233
- import { NvButton } from "@nova-design-system/nova-react"
234
-
235
- const MyComponent: React.FC = () => {
236
- const [count, setCount] = useState(0)
237
-
238
- return (
239
- <div className="flex items-center justify-center">
240
- <NvButton danger onClick={() => setCount(count + 1)}>
241
- Count is {count}
242
- </NvButton>
243
- </div>
244
- )
245
- }
246
-
247
- export default MyComponent
248
- ```
249
-
250
- ---
251
-
252
221
  ## Nova Font Pro Integration
253
222
 
254
223
  > [!WARNING]
255
224
  > Nova Fonts is a protected asset and is not included in the Nova Base package. You need to include the Nova Fonts CSS file in your project.
256
- > To get the Nova Fonts URL, please contact us via Teams or get the URL in the Nova Design System [internal wiki](https://dev.azure.com/elia-digitization/Nova/_wiki/wikis/Nova.wiki/30245/Nova-Font-Pro).
225
+ > To get the Nova Fonts URL, **please contact us via Teams** or get the URL in the Nova Design System [internal wiki](https://dev.azure.com/elia-digitization/Nova/_wiki/wikis/Nova.wiki/30245/Nova-Font-Pro).
257
226
 
258
227
  Once you have the URL, you can integrate it using any of these methods:
259
228
 
@@ -261,7 +230,7 @@ export default MyComponent
261
230
  In your main CSS file (e.g., `src/index.css`):
262
231
 
263
232
  ```css
264
- @import url('https://novaassets.azureedge.net/fonts/nova-fonts-pro.css');
233
+ @import url('contact-us-for-URL/nova-fonts-pro.css');
265
234
  ```
266
235
 
267
236
  ### Option 2: HTML Integration
@@ -271,7 +240,7 @@ In your `index.html`:
271
240
  <!DOCTYPE html>
272
241
  <html>
273
242
  <head>
274
- <link rel="stylesheet" href="https://novaassets.azureedge.net/fonts/nova-fonts-pro.css">
243
+ <link rel="stylesheet" href="contact-us-for-URL/nova-fonts-pro.css">
275
244
  </head>
276
245
  <body>
277
246
  <div id="root"></div>
@@ -0,0 +1,214 @@
1
+ 'use strict';
2
+
3
+ var styleValueTypes_esF5d10b79 = require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
4
+
5
+ const a = (a1, a2) => 1.0 - 3.0 * a2 + 3.0 * a1;
6
+ const b = (a1, a2) => 3.0 * a2 - 6.0 * a1;
7
+ const c = (a1) => 3.0 * a1;
8
+ const calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;
9
+ const getSlope = (t, a1, a2) => 3.0 * a(a1, a2) * t * t + 2.0 * b(a1, a2) * t + c(a1);
10
+ const subdivisionPrecision = 0.0000001;
11
+ const subdivisionMaxIterations = 10;
12
+ function binarySubdivide(aX, aA, aB, mX1, mX2) {
13
+ let currentX;
14
+ let currentT;
15
+ let i = 0;
16
+ do {
17
+ currentT = aA + (aB - aA) / 2.0;
18
+ currentX = calcBezier(currentT, mX1, mX2) - aX;
19
+ if (currentX > 0.0) {
20
+ aB = currentT;
21
+ }
22
+ else {
23
+ aA = currentT;
24
+ }
25
+ } while (Math.abs(currentX) > subdivisionPrecision &&
26
+ ++i < subdivisionMaxIterations);
27
+ return currentT;
28
+ }
29
+ const newtonIterations = 8;
30
+ const newtonMinSlope = 0.001;
31
+ function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
32
+ for (let i = 0; i < newtonIterations; ++i) {
33
+ const currentSlope = getSlope(aGuessT, mX1, mX2);
34
+ if (currentSlope === 0.0) {
35
+ return aGuessT;
36
+ }
37
+ const currentX = calcBezier(aGuessT, mX1, mX2) - aX;
38
+ aGuessT -= currentX / currentSlope;
39
+ }
40
+ return aGuessT;
41
+ }
42
+ const kSplineTableSize = 11;
43
+ const kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
44
+ function cubicBezier(mX1, mY1, mX2, mY2) {
45
+ const sampleValues = new Float32Array(kSplineTableSize);
46
+ for (let i = 0; i < kSplineTableSize; ++i) {
47
+ sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
48
+ }
49
+ function getTForX(aX) {
50
+ let intervalStart = 0.0;
51
+ let currentSample = 1;
52
+ const lastSample = kSplineTableSize - 1;
53
+ for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
54
+ intervalStart += kSampleStepSize;
55
+ }
56
+ --currentSample;
57
+ const dist = (aX - sampleValues[currentSample]) /
58
+ (sampleValues[currentSample + 1] - sampleValues[currentSample]);
59
+ const guessForT = intervalStart + dist * kSampleStepSize;
60
+ const initialSlope = getSlope(guessForT, mX1, mX2);
61
+ if (initialSlope >= newtonMinSlope) {
62
+ return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
63
+ }
64
+ else if (initialSlope === 0.0) {
65
+ return guessForT;
66
+ }
67
+ else {
68
+ return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
69
+ }
70
+ }
71
+ return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);
72
+ }
73
+
74
+ /**
75
+ * Read current box metrics (height + vertical margins).
76
+ * @param {HTMLElement} node - The element to measure.
77
+ * @returns {object} The box metrics.
78
+ */
79
+ function getBoxMetrics(node) {
80
+ const rectHeight = node.getBoundingClientRect().height;
81
+ const style = getComputedStyle(node);
82
+ const marginTop = parseFloat(style.marginTop) || 0;
83
+ const marginBottom = parseFloat(style.marginBottom) || 0;
84
+ const total = rectHeight + marginTop + marginBottom;
85
+ return { height: rectHeight, marginTop, marginBottom, total };
86
+ }
87
+ const useCollapse = (node, { duration = 200, overflow = 'hidden' } = {}) => {
88
+ let currentAnimation = null;
89
+ const stop = () => {
90
+ if (currentAnimation) {
91
+ currentAnimation.stop();
92
+ currentAnimation = null;
93
+ }
94
+ };
95
+ const setStyle = (styles) => {
96
+ for (const [k, v] of Object.entries(styles)) {
97
+ node.style[k] = v;
98
+ }
99
+ };
100
+ /** Instantly apply collapsed styles (no animation). */
101
+ function setCollapsed() {
102
+ stop();
103
+ setStyle({
104
+ height: '0px',
105
+ marginTop: '0px',
106
+ marginBottom: '0px',
107
+ overflow,
108
+ });
109
+ }
110
+ /** Instantly apply expanded styles (no animation). */
111
+ function setExpanded() {
112
+ stop();
113
+ setStyle({
114
+ height: '',
115
+ marginTop: '',
116
+ marginBottom: '',
117
+ overflow: '',
118
+ });
119
+ }
120
+ /**
121
+ * Collapse: animate from current box (height + margins) down to 0.
122
+ */
123
+ function collapse() {
124
+ stop();
125
+ return new Promise(resolve => {
126
+ const { height, marginTop, marginBottom, total } = getBoxMetrics(node);
127
+ // Lock current box
128
+ setStyle({
129
+ height: `${height}px`,
130
+ marginTop: `${marginTop}px`,
131
+ marginBottom: `${marginBottom}px`,
132
+ overflow,
133
+ willChange: 'height, margin',
134
+ });
135
+ const denom = total > 0 ? total : 0.0001; // avoid divide-by-zero
136
+ currentAnimation = styleValueTypes_esF5d10b79.animate({
137
+ from: total,
138
+ to: 0,
139
+ duration,
140
+ ease: cubicBezier(0.2, 0, 0, 1),
141
+ onUpdate: v => {
142
+ const ratio = v / denom;
143
+ setStyle({
144
+ height: `${height * ratio}px`,
145
+ marginTop: `${marginTop * ratio}px`,
146
+ marginBottom: `${marginBottom * ratio}px`,
147
+ });
148
+ },
149
+ onComplete: () => {
150
+ setStyle({
151
+ height: '0px',
152
+ marginTop: '0px',
153
+ marginBottom: '0px',
154
+ willChange: '',
155
+ });
156
+ resolve();
157
+ },
158
+ });
159
+ });
160
+ }
161
+ /**
162
+ * Expand: animate from 0 box to the element's natural box (height + margins),
163
+ * then restore `height: auto` and computed margins.
164
+ */
165
+ function expand() {
166
+ stop();
167
+ return new Promise(resolve => {
168
+ // Let the element size naturally to measure the target box
169
+ setStyle({
170
+ height: '',
171
+ marginTop: '',
172
+ marginBottom: '',
173
+ overflow,
174
+ });
175
+ const { height, marginTop, marginBottom, total } = getBoxMetrics(node);
176
+ // Start locked at zero box
177
+ setStyle({
178
+ height: '0px',
179
+ marginTop: '0px',
180
+ marginBottom: '0px',
181
+ willChange: 'height, margin',
182
+ });
183
+ const denom = total > 0 ? total : 0.0001;
184
+ currentAnimation = styleValueTypes_esF5d10b79.animate({
185
+ from: 0,
186
+ to: total,
187
+ duration,
188
+ ease: cubicBezier(0.2, 0, 0, 1),
189
+ onUpdate: v => {
190
+ const ratio = v / denom;
191
+ setStyle({
192
+ height: `${height * ratio}px`,
193
+ marginTop: `${marginTop * ratio}px`,
194
+ marginBottom: `${marginBottom * ratio}px`,
195
+ });
196
+ },
197
+ onComplete: () => {
198
+ // Restore natural layout
199
+ setStyle({
200
+ height: '',
201
+ marginTop: '',
202
+ marginBottom: '',
203
+ overflow: '',
204
+ willChange: '',
205
+ });
206
+ resolve();
207
+ },
208
+ });
209
+ });
210
+ }
211
+ return { collapse, expand, setCollapsed, setExpanded };
212
+ };
213
+
214
+ exports.useCollapse = useCollapse;
@@ -44,6 +44,11 @@ exports.ButtonType = void 0;
44
44
  ButtonType["Reset"] = "reset";
45
45
  ButtonType["Button"] = "button";
46
46
  })(exports.ButtonType || (exports.ButtonType = {}));
47
+ var NotificationEmphasis;
48
+ (function (NotificationEmphasis) {
49
+ NotificationEmphasis["Medium"] = "medium";
50
+ NotificationEmphasis["High"] = "high";
51
+ })(NotificationEmphasis || (NotificationEmphasis = {}));
47
52
  var ToggleButtonEmphasis;
48
53
  (function (ToggleButtonEmphasis) {
49
54
  ToggleButtonEmphasis["High"] = "high";