asma-ui-core 3.88.0 → 3.89.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.
- package/Readme.md +61 -0
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +6 -6
- package/dist/components/utils/popover/PopoverAnatomy.js +46 -0
- package/dist/components/utils/popover/StyledPopoverV2.js +140 -0
- package/dist/index.js +180 -178
- package/dist/src/components/utils/popover/PopoverAnatomy.d.ts +36 -0
- package/dist/src/components/utils/popover/StyledPopoverV2.d.ts +76 -0
- package/dist/src/components/utils/popover/index.d.ts +1 -0
- package/dist/src/components/utils/popover/story/PopoverCases.d.ts +1 -0
- package/dist/src/components/utils/popover/story/PopoverGallery.d.ts +1 -0
- package/dist/src/components/utils/popover/story/popoverStoryFixtures.d.ts +21 -0
- package/dist/table/components/TableRow.js +50 -49
- package/package.json +1 -1
package/Readme.md
CHANGED
|
@@ -238,6 +238,67 @@ field does not pay for one. `onChange` reports digits only — the country trave
|
|
|
238
238
|
The picker has two shapes: below 744 px it is a full-screen sheet with its own search box, above it
|
|
239
239
|
the trigger itself is the combobox. Both are keyboard-operable and share one listbox.
|
|
240
240
|
|
|
241
|
+
### Popover
|
|
242
|
+
|
|
243
|
+
`StyledPopoverV2` is the Design System popover (ASMA-8183): an anchored surface with an optional
|
|
244
|
+
title, a close control and two optional footer rows. One implementation, two variants picked by
|
|
245
|
+
**content** rather than by breakpoint.
|
|
246
|
+
|
|
247
|
+
```tsx
|
|
248
|
+
import { StyledButton, StyledPopoverV2 } from 'asma-ui-core'
|
|
249
|
+
|
|
250
|
+
<StyledPopoverV2
|
|
251
|
+
dataTest='case-filter'
|
|
252
|
+
variant='action'
|
|
253
|
+
title='Filtrer søknader'
|
|
254
|
+
renderTrigger={({ ref, triggerProps }) => (
|
|
255
|
+
<StyledButton dataTest='case-filter-trigger' refLink={ref} type='button' {...triggerProps}>
|
|
256
|
+
{activeCount > 0 ? `Filter (${activeCount})` : 'Filter'}
|
|
257
|
+
</StyledButton>
|
|
258
|
+
)}
|
|
259
|
+
viewResultsAction={({ close }) => (
|
|
260
|
+
<StyledButton dataTest='case-filter-view' type='button' variant='text' onClick={close}>
|
|
261
|
+
{`Vis resultater (${matchCount})`}
|
|
262
|
+
</StyledButton>
|
|
263
|
+
)}
|
|
264
|
+
resetAction={
|
|
265
|
+
<StyledButton dataTest='case-filter-reset' type='button' variant='text' onClick={clearFilters}>
|
|
266
|
+
Nullstill
|
|
267
|
+
</StyledButton>
|
|
268
|
+
}
|
|
269
|
+
>
|
|
270
|
+
<CaseFilterForm value={filters} onChange={setFilters} />
|
|
271
|
+
</StyledPopoverV2>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
The two footer rows come straight from Figma. The **Reset filter** row is `space-between`:
|
|
275
|
+
`viewResultsAction` on the left (the live match count, which closes the surface — the filter has
|
|
276
|
+
already applied) and `resetAction` on the right. The **Actions** row (`footerActions`) is a single
|
|
277
|
+
right-aligned outlined button. Each of those slots, like `children`, may be a render-prop receiving
|
|
278
|
+
`close()`. In Storybook, **`AllCases`** gives every case its own trigger to open and operate, and
|
|
279
|
+
**`Gallery`** shows the same anatomies side by side, statically, for visual comparison.
|
|
280
|
+
|
|
281
|
+
`info` is read-only: a plain container the trigger points at with `aria-describedby`, not focus
|
|
282
|
+
trapped, so `Tab` walks out of it and closes it. `action` is a `role="dialog"` with a focus trap,
|
|
283
|
+
and covers both the Filter pattern (every change applies immediately — there is no apply step,
|
|
284
|
+
`Nullstill` clears) and the Actions pattern (a list of buttons; `children` may be a render-prop
|
|
285
|
+
receiving `close()` so activating one closes the surface).
|
|
286
|
+
|
|
287
|
+
There is deliberately **no `role="menu"` and no arrow-key navigation**: menu semantics bring a
|
|
288
|
+
keyboard contract that cannot coexist with the dialog model Filter uses, so everything inside is
|
|
289
|
+
reached with `Tab`. There is no arrow or anchor pointer either — the surface is edge-aligned to its
|
|
290
|
+
trigger at an 8px offset.
|
|
291
|
+
|
|
292
|
+
The consumer owns the trigger element (spread `triggerProps`, wire `ref` — `refLink` on
|
|
293
|
+
`StyledButton`), the filter state, and the `aria-live` region that announces the new result count.
|
|
294
|
+
Below 744px the surface takes `100vw - 32px` and an `info` popover is pinned below its trigger;
|
|
295
|
+
`action` should become a Bottom Sheet there, which is ASMA-8184 and not available yet.
|
|
296
|
+
|
|
297
|
+
`StyledPopover` (no `V2`) is a different thing and stays: the MUI-`Popover`-parity positioning
|
|
298
|
+
primitive that `StyledMenu`, `StyledFilterMenu`, the date-picker calendar and four table components
|
|
299
|
+
still build on. New code should reach for `StyledPopoverV2`; those consumers migrate across
|
|
300
|
+
gradually.
|
|
301
|
+
|
|
241
302
|
### Icons
|
|
242
303
|
|
|
243
304
|
Around 180 icons ship on a dedicated subpath so you only pay for the ones you use — each is its own
|