@namroodinc/liquid-editorial 0.6.8 → 0.6.9

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 (120) hide show
  1. package/README.md +108 -2
  2. package/UPGRADING.md +65 -0
  3. package/dist/chunks/CollectionView-BIuOL917.cjs +2 -0
  4. package/dist/chunks/CollectionView-BIuOL917.cjs.map +1 -0
  5. package/dist/chunks/CollectionView-Cr12UFWa.js +179 -0
  6. package/dist/chunks/CollectionView-Cr12UFWa.js.map +1 -0
  7. package/dist/chunks/LoadState-B7GTDlWv.js +71 -0
  8. package/dist/chunks/LoadState-B7GTDlWv.js.map +1 -0
  9. package/dist/chunks/LoadState-C7tQ6fIP.cjs +2 -0
  10. package/dist/chunks/LoadState-C7tQ6fIP.cjs.map +1 -0
  11. package/dist/chunks/Wizard-B_CPW1V6.cjs +2 -0
  12. package/dist/chunks/Wizard-B_CPW1V6.cjs.map +1 -0
  13. package/dist/chunks/Wizard-C1iR5z44.js +99 -0
  14. package/dist/chunks/Wizard-C1iR5z44.js.map +1 -0
  15. package/dist/components/CollectionView/empty.d.cts +15 -0
  16. package/dist/components/CollectionView/empty.d.cts.map +1 -0
  17. package/dist/components/CollectionView/empty.d.ts +15 -0
  18. package/dist/components/CollectionView/empty.d.ts.map +1 -0
  19. package/dist/components/CollectionView/filters.d.cts +6 -0
  20. package/dist/components/CollectionView/filters.d.cts.map +1 -0
  21. package/dist/components/CollectionView/filters.d.ts +6 -0
  22. package/dist/components/CollectionView/filters.d.ts.map +1 -0
  23. package/dist/components/CollectionView/index.cjs +1 -0
  24. package/dist/components/CollectionView/index.d.cts +6 -0
  25. package/dist/components/CollectionView/index.d.cts.map +1 -0
  26. package/dist/components/CollectionView/index.d.ts +6 -0
  27. package/dist/components/CollectionView/index.d.ts.map +1 -0
  28. package/dist/components/CollectionView/index.js +2 -0
  29. package/dist/components/CollectionView/style.css +70 -0
  30. package/dist/components/CollectionView/toolbar.d.cts +5 -0
  31. package/dist/components/CollectionView/toolbar.d.cts.map +1 -0
  32. package/dist/components/CollectionView/toolbar.d.ts +5 -0
  33. package/dist/components/CollectionView/toolbar.d.ts.map +1 -0
  34. package/dist/components/CollectionView/types.d.cts +40 -0
  35. package/dist/components/CollectionView/types.d.cts.map +1 -0
  36. package/dist/components/CollectionView/types.d.ts +40 -0
  37. package/dist/components/CollectionView/types.d.ts.map +1 -0
  38. package/dist/components/EditLayout/style.css +1 -1
  39. package/dist/components/EditSection/index.cjs +2 -0
  40. package/dist/components/EditSection/index.cjs.map +1 -0
  41. package/dist/components/EditSection/index.d.cts +9 -0
  42. package/dist/components/EditSection/index.d.cts.map +1 -0
  43. package/dist/components/EditSection/index.d.ts +9 -0
  44. package/dist/components/EditSection/index.d.ts.map +1 -0
  45. package/dist/components/EditSection/index.js +22 -0
  46. package/dist/components/EditSection/index.js.map +1 -0
  47. package/dist/components/EditSection/style.css +31 -0
  48. package/dist/components/FormEditor/README.md +16 -0
  49. package/dist/components/LoadState/error.d.cts +13 -0
  50. package/dist/components/LoadState/error.d.cts.map +1 -0
  51. package/dist/components/LoadState/error.d.ts +13 -0
  52. package/dist/components/LoadState/error.d.ts.map +1 -0
  53. package/dist/components/LoadState/index.cjs +1 -0
  54. package/dist/components/LoadState/index.d.cts +15 -0
  55. package/dist/components/LoadState/index.d.cts.map +1 -0
  56. package/dist/components/LoadState/index.d.ts +15 -0
  57. package/dist/components/LoadState/index.d.ts.map +1 -0
  58. package/dist/components/LoadState/index.js +1 -0
  59. package/dist/components/LoadState/types.d.cts +3 -0
  60. package/dist/components/LoadState/types.d.cts.map +1 -0
  61. package/dist/components/LoadState/types.d.ts +3 -0
  62. package/dist/components/LoadState/types.d.ts.map +1 -0
  63. package/dist/components/LoadState/useRetryAttempt.d.cts +15 -0
  64. package/dist/components/LoadState/useRetryAttempt.d.cts.map +1 -0
  65. package/dist/components/LoadState/useRetryAttempt.d.ts +15 -0
  66. package/dist/components/LoadState/useRetryAttempt.d.ts.map +1 -0
  67. package/dist/components/MetaList/index.cjs +2 -0
  68. package/dist/components/MetaList/index.cjs.map +1 -0
  69. package/dist/components/MetaList/index.d.cts +7 -0
  70. package/dist/components/MetaList/index.d.cts.map +1 -0
  71. package/dist/components/MetaList/index.d.ts +7 -0
  72. package/dist/components/MetaList/index.d.ts.map +1 -0
  73. package/dist/components/MetaList/index.js +13 -0
  74. package/dist/components/MetaList/index.js.map +1 -0
  75. package/dist/components/MetaList/style.css +19 -0
  76. package/dist/components/PageHeader/index.cjs +2 -0
  77. package/dist/components/PageHeader/index.cjs.map +1 -0
  78. package/dist/components/PageHeader/index.d.cts +9 -0
  79. package/dist/components/PageHeader/index.d.cts.map +1 -0
  80. package/dist/components/PageHeader/index.d.ts +9 -0
  81. package/dist/components/PageHeader/index.d.ts.map +1 -0
  82. package/dist/components/PageHeader/index.js +27 -0
  83. package/dist/components/PageHeader/index.js.map +1 -0
  84. package/dist/components/PageHeader/style.css +39 -0
  85. package/dist/components/Stepper/index.cjs +1 -1
  86. package/dist/components/Stepper/index.cjs.map +1 -1
  87. package/dist/components/Stepper/index.d.cts +8 -0
  88. package/dist/components/Stepper/index.d.cts.map +1 -1
  89. package/dist/components/Stepper/index.d.ts +8 -0
  90. package/dist/components/Stepper/index.d.ts.map +1 -1
  91. package/dist/components/Stepper/index.js +15 -14
  92. package/dist/components/Stepper/index.js.map +1 -1
  93. package/dist/components/Stepper/style.css +53 -0
  94. package/dist/components/Wizard/actions.d.cts +13 -0
  95. package/dist/components/Wizard/actions.d.cts.map +1 -0
  96. package/dist/components/Wizard/actions.d.ts +13 -0
  97. package/dist/components/Wizard/actions.d.ts.map +1 -0
  98. package/dist/components/Wizard/index.cjs +1 -0
  99. package/dist/components/Wizard/index.d.cts +7 -0
  100. package/dist/components/Wizard/index.d.cts.map +1 -0
  101. package/dist/components/Wizard/index.d.ts +7 -0
  102. package/dist/components/Wizard/index.d.ts.map +1 -0
  103. package/dist/components/Wizard/index.js +2 -0
  104. package/dist/components/Wizard/review-table.d.cts +13 -0
  105. package/dist/components/Wizard/review-table.d.cts.map +1 -0
  106. package/dist/components/Wizard/review-table.d.ts +13 -0
  107. package/dist/components/Wizard/review-table.d.ts.map +1 -0
  108. package/dist/components/Wizard/style.css +13 -0
  109. package/dist/components/Wizard/types.d.cts +35 -0
  110. package/dist/components/Wizard/types.d.cts.map +1 -0
  111. package/dist/components/Wizard/types.d.ts +35 -0
  112. package/dist/components/Wizard/types.d.ts.map +1 -0
  113. package/dist/index.cjs +1 -1
  114. package/dist/index.d.cts +13 -1
  115. package/dist/index.d.cts.map +1 -1
  116. package/dist/index.d.ts +13 -1
  117. package/dist/index.d.ts.map +1 -1
  118. package/dist/index.js +36 -30
  119. package/dist/styles.css +5 -0
  120. package/package.json +1 -1
package/README.md CHANGED
@@ -77,7 +77,18 @@ Field supplies labels and validation relationships. Button supplies action styli
77
77
 
78
78
  ## Component catalogue
79
79
 
80
- All **44 families** and **94 runtime exports** are listed below, including compound components, hooks, helpers, and compatibility aliases. Each family links to a practical guide and its source stories. Run Storybook locally for interactive examples; this README does not assume a hosted Storybook. Exported TypeScript declarations provide the detailed prop reference.
80
+ All **50 families** and **103 runtime exports** are listed below, including compound components, hooks, helpers, and compatibility aliases. Each family links to a practical guide and its source stories. Run Storybook locally for interactive examples; this README does not assume a hosted Storybook. Exported TypeScript declarations provide the detailed prop reference.
81
+
82
+ ### Collection and editing catalogue
83
+
84
+ | Family / usage | Public exports | Source examples |
85
+ | --- | --- | --- |
86
+ | [CollectionView](#collectionview) | `CollectionView`, `CollectionEmpty` | [Stories](https://github.com/namroodinc/liquid-editorial/blob/main/src/components/CollectionView/CollectionView.stories.tsx) |
87
+ | [EditSection](#editsection) | `EditSection` | [Stories](https://github.com/namroodinc/liquid-editorial/blob/main/src/components/EditSection/EditSection.stories.tsx) |
88
+ | [PageHeader](#pageheader) | `PageHeader` | [Stories](https://github.com/namroodinc/liquid-editorial/blob/main/src/components/PageHeader/PageHeader.stories.tsx) |
89
+ | [MetaList](#metalist) | `MetaList` | [Stories](https://github.com/namroodinc/liquid-editorial/blob/main/src/components/MetaList/MetaList.stories.tsx) |
90
+ | [LoadState](#loadstate) | `LoadState`, `LoadError` | [Stories](https://github.com/namroodinc/liquid-editorial/blob/main/src/components/LoadState/LoadState.stories.tsx) |
91
+ | [Wizard](#wizard) | `Wizard`, `ReviewTable` | [Stories](https://github.com/namroodinc/liquid-editorial/blob/main/src/components/Wizard/Wizard.stories.tsx) |
81
92
 
82
93
  ### Actions and feedback catalogue
83
94
 
@@ -1525,7 +1536,7 @@ Active links use `aria-current`; buttons use `aria-pressed`. Items support an ic
1525
1536
 
1526
1537
  ### Stepper
1527
1538
 
1528
- Progress through ordered steps. `activeStep` is a zero-based index; earlier steps appear complete. Size defaults to `"md"`, with `"sm"` available for compact bands.
1539
+ Progress through ordered steps. `activeStep` is a zero-based index; earlier steps appear complete. Size defaults to `"md"`, with `"sm"` available for compact bands. `orientation` defaults to `"horizontal"`; `"vertical"` stacks steps with each marker beside its label, and `"auto"` stacks them while the stepper is narrower than 28rem, for dialogs, drawers and sidebars. `"auto"` makes the stepper an inline-size container, so give it a definite width rather than sizing it to its content.
1529
1540
 
1530
1541
  ```tsx
1531
1542
  import { useState } from "react";
@@ -1942,3 +1953,98 @@ Validation or version-push failures stop publishing. If publication fails after
1942
1953
  ## License
1943
1954
 
1944
1955
  MIT © Namrood Inc.
1956
+
1957
+ ### CollectionView
1958
+
1959
+ `CollectionView` composes TableFrame, controlled search/filter/Mine/view controls,
1960
+ selection actions, loading feedback and pagination. Supply `title`, `count`,
1961
+ `query`, `onQueryChange`, `status`, `onRetry`, `pagination` and `children`.
1962
+ `pagination` takes Pagination's props: `page`, `pageSize`, `totalResults` and
1963
+ `onChange`, plus any of its options. Its `size`, `menuPlacement` and `isDisabled`
1964
+ override the collection's defaults (`md`, menus opening upward, enabled). Paging
1965
+ stays operable while a page loads, so focus stays on the pressed Next or Previous
1966
+ button; pass `pagination.isDisabled` to lock it. A pending selection also locks it.
1967
+ Optional `filter`, `mine`, `view`, `selection` and `actions` configure the toolbar.
1968
+ The selected count is announced from a status region present before selection.
1969
+ When Clear or a selection action leaves with focus, focus returns to the title.
1970
+ The application owns filtering, records, eligibility, selection and requests.
1971
+ Search retains its native 200-character cap; counts stay exact above 99.
1972
+ `CollectionEmpty` takes `kind="empty" | "no-match"`, a plural `noun`, initial
1973
+ `title`, optional `description`, `icon` and `action`. No-match feedback points
1974
+ back to search. Import both from the root or `components/CollectionView`.
1975
+
1976
+ ### EditSection
1977
+
1978
+ `<EditSection title="Details" actions={<Button>Configure</Button>}>…</EditSection>`
1979
+ groups editor content under a named section and h2. Several actions stay grouped
1980
+ at the header's end. The section and wrapping header use `lg` gaps. FormEditor
1981
+ supplies its own `lg` gap between fields.
1982
+
1983
+ ### PageHeader
1984
+
1985
+ `<PageHeader title={<em>Article</em>} description="Editorial workspace" actions={…} />`
1986
+ renders a wrapping native header and h1, with optional description and actions.
1987
+ Headings clear their own browser margins, so `reset.css` remains optional.
1988
+ It forwards native header attributes and a ref. Routing and back navigation stay
1989
+ with the application; the title accepts React content. Long headings wrap.
1990
+
1991
+ ### MetaList
1992
+
1993
+ `<MetaList items={[["Status", "Draft"], ["Author", <strong>Ada</strong>]]} />`
1994
+ renders read-only facts as a definition list. Terms may repeat. Row spacing stays
1995
+ compact; values wrap and align to the end. Import from the root or
1996
+ `components/MetaList`.
1997
+
1998
+ ### LoadState
1999
+
2000
+ `<LoadState status={status} error={error} onRetry={reload}>{content}</LoadState>`
2001
+ shows a skeleton, failure or ready content. A first error is a quiet note; retries
2002
+ announce progress and repeated failure politely. Keep the component mounted and
2003
+ report `loading` then `error`/`ready` during retries. Report `loading` as the retry
2004
+ starts: a retry that reports no load within a second lapses, so a later load (a
2005
+ new filter, say) shows the skeleton rather than "Trying again…". Retry retains its
2006
+ DOM node and focus while pending, ignores repeat activation, and success renders
2007
+ children.
2008
+ `LoadError` is the standalone Banner composition; its optional `retryState` is
2009
+ `"pending" | "failed"`. Import both from `components/LoadState` or the root.
2010
+ They do not fetch, cache or decide application refresh policy.
2011
+
2012
+ ### Wizard
2013
+
2014
+ `Wizard` requires `isOpen`, `title`, `steps`, `submitLabel`, `onSubmit` and
2015
+ `onClose`. Each step has `id`, `label` and React `content`, with optional
2016
+ `description`, modal `title`/`modalDescription`, `canContinue`, `onInvalid`,
2017
+ `primaryAction` and `hideSecondary`. Multiple steps use controlled `activeStep`
2018
+ and `onStepChange`; one step defaults to index 0. An index past the last step,
2019
+ such as after a conditional step is removed, shows the last step; with no steps,
2020
+ only the dialog frame and its Close button show. `isPending` guards close,
2021
+ progress and actions; `isNavigable={false}` prevents direct progress navigation.
2022
+ Second clicks of double-clicks cannot skip a step or submit a second time. Blocked
2023
+ Back/Cancel and Next/Finish buttons stay focusable with `aria-disabled`, so focus
2024
+ survives a step that cannot continue yet and a pending submission.
2025
+
2026
+ Each step's content mounts fresh when the active step changes, so steps that
2027
+ render the same component type (two FormEditors, say) never share touched,
2028
+ error or uncontrolled state. Keep values in application state above the wizard.
2029
+
2030
+ The default dialog is Modal. Supply a **stable component reference** through
2031
+ `modalComponent: ComponentType<ModalProps>` to retain application dialog hiding
2032
+ or close coordination. It stays mounted and receives `isOpen={false}` when the
2033
+ wizard closes, so it can run exit animations or close bookkeeping. Do not create
2034
+ that component inline during rendering.
2035
+ Applications own validation, persistence and drafts, including whether to confirm
2036
+ leaving. Keep step state above the wizard if closing should preserve it.
2037
+ `ReviewTable` renders `rows: { term, value, step }[]`, `onStepChange` and optional
2038
+ `isDisabled` for review/edit navigation; terms may repeat. Both export from
2039
+ `components/Wizard`.
2040
+
2041
+ Collection, editor, heading, metadata, loading and wizard components compose
2042
+ presentation; they are not FormEditor value controls and need no field adapter.
2043
+ Use `lg` (`var(--space-6)`, normally 24px) between form fields, groups and sections.
2044
+ EditLayout uses the same section gap; Wizard separates progress and step content
2045
+ with `lg` gaps. Label/hint internals, option rows, metadata, tables and button
2046
+ bars keep their compact spacing. General Grid and Stack defaults are unchanged.
2047
+
2048
+ Wizard progress uses Stepper's `orientation="auto"`, stacking vertically when its
2049
+ available width is below 28rem so step labels and descriptions stay readable in
2050
+ narrow dialogs.
package/UPGRADING.md CHANGED
@@ -2,6 +2,71 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.6.9
6
+
7
+ ### Shared collection, editor, loading and wizard presentation
8
+
9
+ Adds CollectionView/CollectionEmpty, EditSection, PageHeader, MetaList,
10
+ LoadState/LoadError and Wizard/ReviewTable, with props/types at the root and
11
+ family imports. Toolbar/filter helpers, retry tracking and wizard actions stay
12
+ private. Composed families can omit a stylesheet when they own no CSS.
13
+
14
+ Stepper gains `orientation: "horizontal" | "vertical" | "auto"` (default
15
+ `horizontal`, exported as `StepperOrientation`). `vertical` stacks steps with
16
+ each marker beside its label; `auto` makes the stepper an inline-size container
17
+ and stacks below 28rem. Wizard progress uses `auto`, so labels and descriptions
18
+ stay readable in narrow dialogs.
19
+
20
+ Behavior to rely on:
21
+
22
+ - CollectionView passes the application's `pagination` options through, so its
23
+ `size`, `menuPlacement` and `isDisabled` win. Paging stays operable while a page
24
+ loads, keeping focus on the pressed button; a pending selection still locks it.
25
+ The selected count is announced from a status region mounted before selection.
26
+ When Clear or a selection action unmounts with focus, focus moves to the title.
27
+ - LoadState lets a retry claim only a load reported within a second; later loads
28
+ show the skeleton instead of the old failure with "Trying again…".
29
+ - Wizard clamps `activeStep` to the last step and shows only its dialog frame
30
+ without steps. Each step's content mounts fresh when the step changes. Blocked
31
+ footer buttons stay focusable with `aria-disabled`. A `modalComponent` stays
32
+ mounted and receives `isOpen={false}` on close.
33
+ - EditSection groups several actions at the header's end. PageHeader and
34
+ EditSection headings clear their own browser margins without `reset.css`.
35
+ - MetaList and ReviewTable accept repeated terms.
36
+
37
+ Adoption: replace equivalent application presentation and CSS with these
38
+ components; keep records, search/filter calculations, routing, permissions,
39
+ requests and workflow state in the application. Import the aggregate stylesheet.
40
+ PageHeader accepts React title content, description, actions and native header
41
+ attributes; it has no router-specific back option. Use required Wizard `isOpen`
42
+ and a stable optional `modalComponent` when bridging application Modal behavior;
43
+ an application modal must render nothing (or its exit state) when `isOpen` is
44
+ false. Keep wizard step values in application state above the wizard. Report
45
+ `loading` as a LoadState retry starts. Pass `pagination.isDisabled` to lock paging
46
+ during application work. Use Stepper `orientation="auto"` or `"vertical"` for
47
+ narrow progress instead of overriding `.ds-stepper__*` internals.
48
+ Layout/feedback components need no FormEditor adapter.
49
+
50
+ EditSection's body/header, EditLayout's section gap and Wizard layout use `lg`
51
+ (`var(--space-6)`, normally 24px). FormEditor's field gap remains `lg`. Audit
52
+ application form-group gaps and remove overlapping margins; preserve compact
53
+ control/option/metadata/toolbar spacing. Grid/Stack defaults are unchanged.
54
+
55
+ Compatibility: additive exports and an additive Stepper prop; no removed APIs,
56
+ dependencies or value changes. Existing EditLayout content now has a 24px
57
+ section gap (previously 32px). Steppers without `orientation` render as before.
58
+ Wizard footer buttons report blocked state with `aria-disabled` rather than the
59
+ native `disabled` attribute; update tests that assert `toBeDisabled()` on them.
60
+
61
+ Verification: run `npm run validate`, consuming lint/typechecks/tests/build,
62
+ check controlled collection selection/count/filter behavior, paging by keyboard
63
+ while pages load, focus after Clear and bulk actions, quiet first failure,
64
+ focused pending Retry and polite repeated failures, wizard validation/pending and
65
+ double-click guards, focus on Next/Finish across blocked steps, per-step form
66
+ state, plus application modal hiding/drag-close integration including its close
67
+ transition. Review all themes at 1440px, 390px and 320px, including long
68
+ headings, narrow wizard progress and forms/dialogs.
69
+
5
70
  ## 0.6.8
6
71
 
7
72
  ### Supporting hints beside field labels
@@ -0,0 +1,2 @@
1
+ const e=require("../components/Button/index.cjs"),t=require("./portalScope-BVA1-Ypu.cjs"),n=require("../components/ButtonGroup/index.cjs"),r=require("../components/Badge/index.cjs"),i=require("../components/SearchField/index.cjs"),a=require("../components/Select/index.cjs"),o=require("../components/Table/index.cjs"),s=require("../components/Pagination/index.cjs"),c=require("./LoadState-C7tQ6fIP.cjs");let l=require("react"),u=require("react/jsx-runtime");function d({title:t,query:r,onQueryChange:o,filter:s,mine:c,view:l,actions:d}){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i.SearchField,{size:`sm`,maxLength:200,placeholder:`Search ${t.toLowerCase()}`,"aria-label":`Search ${t.toLowerCase()}`,value:r,onChange:e=>o(e.target.value),onClear:()=>o(``)}),s&&(0,u.jsx)(`div`,{className:`ds-collection-view__filter`,children:(0,u.jsx)(a.Select,{size:`sm`,"aria-label":s.label,value:s.value,options:s.options,onValueChange:s.onChange})}),c&&(0,u.jsx)(e.Button,{size:`sm`,iconStart:`user`,variant:c.isPressed?`active`:`neutral`,"aria-pressed":c.isPressed,onClick:()=>c.onChange(!c.isPressed),children:c.label}),l&&(0,u.jsxs)(n.ButtonGroup,{isAttached:!1,"aria-label":`${t} view`,children:[(0,u.jsx)(e.Button,{size:`sm`,isIconOnly:!0,iconStart:`layout-grid`,"aria-label":`Grid view`,"aria-pressed":l.value===`grid`,variant:l.value===`grid`?`active`:`neutral`,onClick:()=>l.onChange(`grid`)}),(0,u.jsx)(e.Button,{size:`sm`,isIconOnly:!0,iconStart:`list`,"aria-label":`Table view`,"aria-pressed":l.value===`table`,variant:l.value===`table`?`active`:`neutral`,onClick:()=>l.onChange(`table`)})]}),d]})}function f({title:n,count:i,query:a,onQueryChange:s,filter:c,mine:f,view:p,selection:m,actions:h}){let g=!!m?.count,_=(0,l.useRef)(null),v=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let e=v.current;!g&&e&&!e.isConnected&&t.i(document.activeElement)&&(v.current=null,_.current?.focus({preventScroll:!0}))},[g]),(0,u.jsx)(o.TableToolbar,{className:`ds-collection-view__toolbar`,"data-selected":g||void 0,onFocus:e=>{v.current=e.target},onBlur:e=>{e.relatedTarget&&(v.current=null)},start:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`span`,{className:`ds-collection-view__selected`,role:`status`,children:g&&`${m.count} selected`}),!g&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`span`,{ref:_,className:`ds-table-toolbar__title`,tabIndex:-1,children:n}),(0,u.jsx)(r.Badge,{shape:`count`,appearance:`soft`,isCountExact:!0,className:`ds-collection-view__count`,children:i})]})]}),end:g?(0,u.jsxs)(u.Fragment,{children:[m.reason&&(0,u.jsx)(`span`,{className:`ds-collection-view__reason`,children:m.reason}),m.actions,(0,u.jsx)(e.Button,{size:`sm`,variant:`simple`,isDisabled:m.isPending,onClick:m.onClear,children:`Clear`})]}):(0,u.jsx)(d,{title:n,query:a,onQueryChange:s,filter:c,mine:f,view:p,actions:h})})}function p({kind:e,noun:t,icon:n,title:r,description:i,action:a}){return e===`no-match`?(0,u.jsx)(o.TableEmpty,{icon:`search`,title:`No matching ${t}`,description:`Try a different search or clear a filter.`}):(0,u.jsx)(o.TableEmpty,{icon:n,title:r,description:i,action:a})}function m({title:e,count:t,query:n,onQueryChange:r,status:i,error:a,onRetry:l,pagination:d,filter:p,mine:m,view:h,selection:g,actions:_,children:v}){return(0,u.jsxs)(o.TableFrame,{className:`ds-collection-view`,"aria-busy":i===`loading`||g?.isPending||void 0,children:[(0,u.jsx)(f,{title:e,count:t,query:n,onQueryChange:r,filter:p,mine:m,view:h,selection:g,actions:_}),(0,u.jsx)(`div`,{className:`ds-collection-view__body`,"data-feedback":i!==`ready`||void 0,children:(0,u.jsx)(c.t,{status:i,error:a,onRetry:l,children:v})}),(0,u.jsx)(`div`,{className:`ds-collection-view__footer`,children:(0,u.jsx)(s.Pagination,{size:`md`,menuPlacement:`top`,...d,isDisabled:d.isDisabled||g?.isPending})})]})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return m}});
2
+ //# sourceMappingURL=CollectionView-BIuOL917.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionView-BIuOL917.cjs","names":["_Fragment","SearchField","Select","Button","ButtonGroup","useRef","cannotHoldFocus","TableToolbar","_Fragment","Badge","Button","TableEmpty","TableFrame","LoadState","Pagination","require_components_Button_index","require_portalScope","require_components_ButtonGroup_index","require_components_Badge_index","require_components_SearchField_index","require_components_Select_index","require_components_Table_index","require_components_Pagination_index","require_LoadState","react","react_jsx_runtime","CollectionFilters","title","query","onQueryChange","event","filter","mine","view","actions","CollectionToolbar","selected","selection","titleRef","focused","previous","count","CollectionEmpty","kind","noun","CollectionView","status","pagination"],"sources":["../../src/components/CollectionView/filters.tsx","../../src/components/CollectionView/toolbar.tsx","../../src/components/CollectionView/empty.tsx","../../src/components/CollectionView/index.tsx"],"sourcesContent":["import { Button } from \"../Button\";\nimport { ButtonGroup } from \"../ButtonGroup\";\nimport { SearchField } from \"../SearchField\";\nimport { Select } from \"../Select\";\nimport type { CollectionViewProps } from \"./types\";\n\ntype FiltersProps = Pick<\n CollectionViewProps,\n \"title\" | \"query\" | \"onQueryChange\" | \"filter\" | \"mine\" | \"view\" | \"actions\"\n>;\n\n/** Search and view controls for a collection without an active selection. */\nexport function CollectionFilters({\n title,\n query,\n onQueryChange,\n filter,\n mine,\n view,\n actions,\n}: FiltersProps) {\n return (\n <>\n <SearchField\n size=\"sm\"\n maxLength={200}\n placeholder={`Search ${title.toLowerCase()}`}\n aria-label={`Search ${title.toLowerCase()}`}\n value={query}\n onChange={(event) => onQueryChange(event.target.value)}\n onClear={() => onQueryChange(\"\")}\n />\n {filter && (\n <div className=\"ds-collection-view__filter\">\n <Select\n size=\"sm\"\n aria-label={filter.label}\n value={filter.value}\n options={filter.options}\n onValueChange={filter.onChange}\n />\n </div>\n )}\n {mine && (\n <Button\n size=\"sm\"\n iconStart=\"user\"\n variant={mine.isPressed ? \"active\" : \"neutral\"}\n aria-pressed={mine.isPressed}\n onClick={() => mine.onChange(!mine.isPressed)}\n >\n {mine.label}\n </Button>\n )}\n {view && (\n <ButtonGroup\n isAttached={false}\n aria-label={`${title} view`}\n >\n <Button\n size=\"sm\"\n isIconOnly\n iconStart=\"layout-grid\"\n aria-label=\"Grid view\"\n aria-pressed={view.value === \"grid\"}\n variant={view.value === \"grid\" ? \"active\" : \"neutral\"}\n onClick={() => view.onChange(\"grid\")}\n />\n <Button\n size=\"sm\"\n isIconOnly\n iconStart=\"list\"\n aria-label=\"Table view\"\n aria-pressed={view.value === \"table\"}\n variant={view.value === \"table\" ? \"active\" : \"neutral\"}\n onClick={() => view.onChange(\"table\")}\n />\n </ButtonGroup>\n )}\n {actions}\n </>\n );\n}\n","import { useEffect, useRef } from \"react\";\nimport { Badge } from \"../Badge\";\nimport { Button } from \"../Button\";\nimport { TableToolbar } from \"../Table\";\nimport { cannotHoldFocus } from \"../../internal/dialogFocus\";\nimport type { CollectionViewProps } from \"./types\";\nimport { CollectionFilters } from \"./filters\";\ntype ToolbarProps = Pick<\n CollectionViewProps,\n | \"title\"\n | \"count\"\n | \"query\"\n | \"onQueryChange\"\n | \"filter\"\n | \"mine\"\n | \"view\"\n | \"selection\"\n | \"actions\"\n>;\nexport function CollectionToolbar({\n title,\n count,\n query,\n onQueryChange,\n filter,\n mine,\n view,\n selection,\n actions,\n}: ToolbarProps) {\n const selected = Boolean(selection?.count);\n const titleRef = useRef<HTMLSpanElement>(null);\n // The toolbar control holding focus. A blur toward the page or a removal\n // keeps it, so the selection ending can tell that it took focus away.\n const focused = useRef<Element | null>(null);\n useEffect(() => {\n const previous = focused.current;\n // Clear, or a selection action, unmounted with focus: return it to the\n // collection's title rather than leave it on the page.\n if (!selected && previous && !previous.isConnected && cannotHoldFocus(document.activeElement)) {\n focused.current = null;\n titleRef.current?.focus({ preventScroll: true });\n }\n }, [selected]);\n return (\n <TableToolbar\n className=\"ds-collection-view__toolbar\"\n data-selected={selected || undefined}\n onFocus={(event) => {\n focused.current = event.target;\n }}\n onBlur={(event) => {\n if (event.relatedTarget) {\n focused.current = null;\n }\n }}\n start={\n <>\n {/* Mounted throughout, so screen readers hear the first selection. */}\n <span\n className=\"ds-collection-view__selected\"\n role=\"status\"\n >\n {selected && `${selection!.count} selected`}\n </span>\n {!selected && (\n <>\n <span\n ref={titleRef}\n className=\"ds-table-toolbar__title\"\n tabIndex={-1}\n >\n {title}\n </span>\n <Badge\n shape=\"count\"\n appearance=\"soft\"\n isCountExact\n className=\"ds-collection-view__count\"\n >\n {count}\n </Badge>\n </>\n )}\n </>\n }\n end={\n selected ? (\n <>\n {selection!.reason && (\n <span className=\"ds-collection-view__reason\">{selection!.reason}</span>\n )}\n {selection!.actions}\n <Button\n size=\"sm\"\n variant=\"simple\"\n isDisabled={selection!.isPending}\n onClick={selection!.onClear}\n >\n Clear\n </Button>\n </>\n ) : (\n <CollectionFilters\n title={title}\n query={query}\n onQueryChange={onQueryChange}\n filter={filter}\n mine={mine}\n view={view}\n actions={actions}\n />\n )\n }\n />\n );\n}\n","import { TableEmpty, type TableEmptyProps } from \"../Table\";\nimport type { CollectionEmptyKind } from \"./types\";\n\nexport interface CollectionEmptyProps extends Pick<\n TableEmptyProps,\n \"icon\" | \"description\" | \"action\"\n> {\n kind: CollectionEmptyKind;\n /** Plural noun for the no-match title, e.g. \"entries\". */\n noun: string;\n /** Shown when the collection itself has no items. */\n title: string;\n}\n\n/**\n * What a searchable collection's frame shows instead of its table: how to\n * start an empty collection, or a pointer back to the search field.\n */\nexport function CollectionEmpty({\n kind,\n noun,\n icon,\n title,\n description,\n action,\n}: CollectionEmptyProps) {\n if (kind === \"no-match\") {\n return (\n <TableEmpty\n icon=\"search\"\n title={`No matching ${noun}`}\n description=\"Try a different search or clear a filter.\"\n />\n );\n }\n return (\n <TableEmpty\n icon={icon}\n title={title}\n description={description}\n action={action}\n />\n );\n}\n","import { Pagination } from \"../Pagination\";\nimport { TableFrame } from \"../Table\";\nimport { CollectionToolbar } from \"./toolbar\";\nimport { LoadState } from \"../LoadState\";\nimport type { CollectionViewProps } from \"./types\";\nimport \"./style.css\";\nexport type { CollectionViewProps, CollectionEmptyKind } from \"./types\";\nexport { CollectionEmpty } from \"./empty\";\nexport type { CollectionEmptyProps } from \"./empty\";\n\nexport function CollectionView({\n title,\n count,\n query,\n onQueryChange,\n status,\n error,\n onRetry,\n pagination,\n filter,\n mine,\n view,\n selection,\n actions,\n children,\n}: CollectionViewProps) {\n return (\n <TableFrame\n className=\"ds-collection-view\"\n aria-busy={status === \"loading\" || selection?.isPending || undefined}\n >\n <CollectionToolbar\n title={title}\n count={count}\n query={query}\n onQueryChange={onQueryChange}\n filter={filter}\n mine={mine}\n view={view}\n selection={selection}\n actions={actions}\n />\n <div\n className=\"ds-collection-view__body\"\n data-feedback={status !== \"ready\" || undefined}\n >\n <LoadState\n status={status}\n error={error}\n onRetry={onRetry}\n >\n {children}\n </LoadState>\n </div>\n <div className=\"ds-collection-view__footer\">\n {/* Paging stays live while a page loads: disabling the pressed Next or\n Previous button would drop its focus on every page change. */}\n <Pagination\n size=\"md\"\n menuPlacement=\"top\"\n {...pagination}\n isDisabled={pagination.isDisabled || selection?.isPending}\n />\n </div>\n </TableFrame>\n );\n}\n"],"mappings":"A,0cAYA,SAAgB0B,EAAkB,CAChC,QACA,QACA,gBACA,SACA,OACA,OACA,WACe,CACf,OACE,EAAAD,EAAA,KAAA,CAAAzB,EAAAA,SAAA,CAAA,SAAA,EACE,EAAAyB,EAAA,IAAA,CAACxB,EAAAA,YAAD,CACE,KAAK,KACL,UAAW,IACX,YAAa,UAAU0B,EAAM,YAAY,IACzC,aAAY,UAAUA,EAAM,YAAY,IACxC,MAAOC,EACP,SAAW,GAAUC,EAAcC,EAAM,OAAO,KAAK,EACrD,YAAeD,EAAc,EAAE,CAChC,CAAA,EACAE,IACC,EAAAN,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BACb,UAAA,EAAAA,EAAA,IAAA,CAACvB,EAAAA,OAAD,CACE,KAAK,KACL,aAAY6B,EAAO,MACnB,MAAOA,EAAO,MACd,QAASA,EAAO,QAChB,cAAeA,EAAO,QACvB,CAAA,CACE,CAAA,EAENC,IACC,EAAAP,EAAA,IAAA,CAACtB,EAAAA,OAAD,CACE,KAAK,K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ACM,cACL,QACT,CAAA,CAEL,CCjCA,SAAgBkC,EAAe,CAC7B,QACA,QACA,QACA,gBACA,SACA,QACA,UACA,aACA,SACA,OACA,OACA,YACA,UACA,YACsB,CACtB,OACE,EAAApB,EAAA,KAAA,CAACb,EAAAA,WAAD,CACE,UAAU,qBACV,YAAWkC,IAAW,WAAaT,GAAW,WAAa,IAAA,GAF7D,SAAA,EAIE,EAAAZ,EAAA,IAAA,CAACU,EAAD,CACS,QACA,QACA,QACQ,gBACP,SACF,OACA,OACK,YACF,SACV,CAAA,GACD,EAAAV,EAAA,IAAA,CAAC,MAAD,CACE,UAAU,2BACV,gBAAeqB,IAAW,SAAW,IAAA,GAErC,UAAA,EAAArB,EAAA,IAAA,CAACZ,EAAAA,EAAD,CACU,SACD,QACE,UAER,UACQ,CAAA,CACR,CAAA,GACL,EAAAY,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BAGb,UAAA,EAAAA,EAAA,IAAA,CAACX,EAAAA,WAAD,CACE,KAAK,KACL,cAAc,MACd,GAAIiC,EACJ,WAAYA,EAAW,YAAcV,GAAW,SACjD,CAAA,CACE,CAAA,CACK,C,EAEhB,C"}
@@ -0,0 +1,179 @@
1
+ import { Button as e } from "../components/Button/index.js";
2
+ import { i as t } from "./portalScope-AzzPM54i.js";
3
+ import { ButtonGroup as n } from "../components/ButtonGroup/index.js";
4
+ import { Badge as r } from "../components/Badge/index.js";
5
+ import { SearchField as i } from "../components/SearchField/index.js";
6
+ import { Select as a } from "../components/Select/index.js";
7
+ import { TableEmpty as o, TableFrame as s, TableToolbar as c } from "../components/Table/index.js";
8
+ import { Pagination as l } from "../components/Pagination/index.js";
9
+ import { t as u } from "./LoadState-B7GTDlWv.js";
10
+ import { useEffect as d, useRef as f } from "react";
11
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
12
+ //#region src/components/CollectionView/filters.tsx
13
+ function g({ title: t, query: r, onQueryChange: o, filter: s, mine: c, view: l, actions: u }) {
14
+ return /* @__PURE__ */ h(p, { children: [
15
+ /* @__PURE__ */ m(i, {
16
+ size: "sm",
17
+ maxLength: 200,
18
+ placeholder: `Search ${t.toLowerCase()}`,
19
+ "aria-label": `Search ${t.toLowerCase()}`,
20
+ value: r,
21
+ onChange: (e) => o(e.target.value),
22
+ onClear: () => o("")
23
+ }),
24
+ s && /* @__PURE__ */ m("div", {
25
+ className: "ds-collection-view__filter",
26
+ children: /* @__PURE__ */ m(a, {
27
+ size: "sm",
28
+ "aria-label": s.label,
29
+ value: s.value,
30
+ options: s.options,
31
+ onValueChange: s.onChange
32
+ })
33
+ }),
34
+ c && /* @__PURE__ */ m(e, {
35
+ size: "sm",
36
+ iconStart: "user",
37
+ variant: c.isPressed ? "active" : "neutral",
38
+ "aria-pressed": c.isPressed,
39
+ onClick: () => c.onChange(!c.isPressed),
40
+ children: c.label
41
+ }),
42
+ l && /* @__PURE__ */ h(n, {
43
+ isAttached: !1,
44
+ "aria-label": `${t} view`,
45
+ children: [/* @__PURE__ */ m(e, {
46
+ size: "sm",
47
+ isIconOnly: !0,
48
+ iconStart: "layout-grid",
49
+ "aria-label": "Grid view",
50
+ "aria-pressed": l.value === "grid",
51
+ variant: l.value === "grid" ? "active" : "neutral",
52
+ onClick: () => l.onChange("grid")
53
+ }), /* @__PURE__ */ m(e, {
54
+ size: "sm",
55
+ isIconOnly: !0,
56
+ iconStart: "list",
57
+ "aria-label": "Table view",
58
+ "aria-pressed": l.value === "table",
59
+ variant: l.value === "table" ? "active" : "neutral",
60
+ onClick: () => l.onChange("table")
61
+ })]
62
+ }),
63
+ u
64
+ ] });
65
+ }
66
+ //#endregion
67
+ //#region src/components/CollectionView/toolbar.tsx
68
+ function _({ title: n, count: i, query: a, onQueryChange: o, filter: s, mine: l, view: u, selection: _, actions: v }) {
69
+ let y = !!_?.count, b = f(null), x = f(null);
70
+ return d(() => {
71
+ let e = x.current;
72
+ !y && e && !e.isConnected && t(document.activeElement) && (x.current = null, b.current?.focus({ preventScroll: !0 }));
73
+ }, [y]), /* @__PURE__ */ m(c, {
74
+ className: "ds-collection-view__toolbar",
75
+ "data-selected": y || void 0,
76
+ onFocus: (e) => {
77
+ x.current = e.target;
78
+ },
79
+ onBlur: (e) => {
80
+ e.relatedTarget && (x.current = null);
81
+ },
82
+ start: /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("span", {
83
+ className: "ds-collection-view__selected",
84
+ role: "status",
85
+ children: y && `${_.count} selected`
86
+ }), !y && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("span", {
87
+ ref: b,
88
+ className: "ds-table-toolbar__title",
89
+ tabIndex: -1,
90
+ children: n
91
+ }), /* @__PURE__ */ m(r, {
92
+ shape: "count",
93
+ appearance: "soft",
94
+ isCountExact: !0,
95
+ className: "ds-collection-view__count",
96
+ children: i
97
+ })] })] }),
98
+ end: y ? /* @__PURE__ */ h(p, { children: [
99
+ _.reason && /* @__PURE__ */ m("span", {
100
+ className: "ds-collection-view__reason",
101
+ children: _.reason
102
+ }),
103
+ _.actions,
104
+ /* @__PURE__ */ m(e, {
105
+ size: "sm",
106
+ variant: "simple",
107
+ isDisabled: _.isPending,
108
+ onClick: _.onClear,
109
+ children: "Clear"
110
+ })
111
+ ] }) : /* @__PURE__ */ m(g, {
112
+ title: n,
113
+ query: a,
114
+ onQueryChange: o,
115
+ filter: s,
116
+ mine: l,
117
+ view: u,
118
+ actions: v
119
+ })
120
+ });
121
+ }
122
+ //#endregion
123
+ //#region src/components/CollectionView/empty.tsx
124
+ function v({ kind: e, noun: t, icon: n, title: r, description: i, action: a }) {
125
+ return e === "no-match" ? /* @__PURE__ */ m(o, {
126
+ icon: "search",
127
+ title: `No matching ${t}`,
128
+ description: "Try a different search or clear a filter."
129
+ }) : /* @__PURE__ */ m(o, {
130
+ icon: n,
131
+ title: r,
132
+ description: i,
133
+ action: a
134
+ });
135
+ }
136
+ //#endregion
137
+ //#region src/components/CollectionView/index.tsx
138
+ function y({ title: e, count: t, query: n, onQueryChange: r, status: i, error: a, onRetry: o, pagination: c, filter: d, mine: f, view: p, selection: g, actions: v, children: y }) {
139
+ return /* @__PURE__ */ h(s, {
140
+ className: "ds-collection-view",
141
+ "aria-busy": i === "loading" || g?.isPending || void 0,
142
+ children: [
143
+ /* @__PURE__ */ m(_, {
144
+ title: e,
145
+ count: t,
146
+ query: n,
147
+ onQueryChange: r,
148
+ filter: d,
149
+ mine: f,
150
+ view: p,
151
+ selection: g,
152
+ actions: v
153
+ }),
154
+ /* @__PURE__ */ m("div", {
155
+ className: "ds-collection-view__body",
156
+ "data-feedback": i !== "ready" || void 0,
157
+ children: /* @__PURE__ */ m(u, {
158
+ status: i,
159
+ error: a,
160
+ onRetry: o,
161
+ children: y
162
+ })
163
+ }),
164
+ /* @__PURE__ */ m("div", {
165
+ className: "ds-collection-view__footer",
166
+ children: /* @__PURE__ */ m(l, {
167
+ size: "md",
168
+ menuPlacement: "top",
169
+ ...c,
170
+ isDisabled: c.isDisabled || g?.isPending
171
+ })
172
+ })
173
+ ]
174
+ });
175
+ }
176
+ //#endregion
177
+ export { v as n, y as t };
178
+
179
+ //# sourceMappingURL=CollectionView-Cr12UFWa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionView-Cr12UFWa.js","names":["_Fragment","_Fragment","cannotHoldFocus","LoadState","Fragment$1","CollectionFilters","SearchField","title","query","onQueryChange","event","filter","Select","mine","Button","view","ButtonGroup","actions","CollectionToolbar","selected","selection","titleRef","useRef","focused","useEffect","previous","TableToolbar","Badge","count","CollectionEmpty","kind","TableEmpty","noun","CollectionView","TableFrame","status","Pagination","pagination"],"sources":["../../src/components/CollectionView/filters.tsx","../../src/components/CollectionView/toolbar.tsx","../../src/components/CollectionView/empty.tsx","../../src/components/CollectionView/index.tsx"],"sourcesContent":["import { Button } from \"../Button\";\nimport { ButtonGroup } from \"../ButtonGroup\";\nimport { SearchField } from \"../SearchField\";\nimport { Select } from \"../Select\";\nimport type { CollectionViewProps } from \"./types\";\n\ntype FiltersProps = Pick<\n CollectionViewProps,\n \"title\" | \"query\" | \"onQueryChange\" | \"filter\" | \"mine\" | \"view\" | \"actions\"\n>;\n\n/** Search and view controls for a collection without an active selection. */\nexport function CollectionFilters({\n title,\n query,\n onQueryChange,\n filter,\n mine,\n view,\n actions,\n}: FiltersProps) {\n return (\n <>\n <SearchField\n size=\"sm\"\n maxLength={200}\n placeholder={`Search ${title.toLowerCase()}`}\n aria-label={`Search ${title.toLowerCase()}`}\n value={query}\n onChange={(event) => onQueryChange(event.target.value)}\n onClear={() => onQueryChange(\"\")}\n />\n {filter && (\n <div className=\"ds-collection-view__filter\">\n <Select\n size=\"sm\"\n aria-label={filter.label}\n value={filter.value}\n options={filter.options}\n onValueChange={filter.onChange}\n />\n </div>\n )}\n {mine && (\n <Button\n size=\"sm\"\n iconStart=\"user\"\n variant={mine.isPressed ? \"active\" : \"neutral\"}\n aria-pressed={mine.isPressed}\n onClick={() => mine.onChange(!mine.isPressed)}\n >\n {mine.label}\n </Button>\n )}\n {view && (\n <ButtonGroup\n isAttached={false}\n aria-label={`${title} view`}\n >\n <Button\n size=\"sm\"\n isIconOnly\n iconStart=\"layout-grid\"\n aria-label=\"Grid view\"\n aria-pressed={view.value === \"grid\"}\n variant={view.value === \"grid\" ? \"active\" : \"neutral\"}\n onClick={() => view.onChange(\"grid\")}\n />\n <Button\n size=\"sm\"\n isIconOnly\n iconStart=\"list\"\n aria-label=\"Table view\"\n aria-pressed={view.value === \"table\"}\n variant={view.value === \"table\" ? \"active\" : \"neutral\"}\n onClick={() => view.onChange(\"table\")}\n />\n </ButtonGroup>\n )}\n {actions}\n </>\n );\n}\n","import { useEffect, useRef } from \"react\";\nimport { Badge } from \"../Badge\";\nimport { Button } from \"../Button\";\nimport { TableToolbar } from \"../Table\";\nimport { cannotHoldFocus } from \"../../internal/dialogFocus\";\nimport type { CollectionViewProps } from \"./types\";\nimport { CollectionFilters } from \"./filters\";\ntype ToolbarProps = Pick<\n CollectionViewProps,\n | \"title\"\n | \"count\"\n | \"query\"\n | \"onQueryChange\"\n | \"filter\"\n | \"mine\"\n | \"view\"\n | \"selection\"\n | \"actions\"\n>;\nexport function CollectionToolbar({\n title,\n count,\n query,\n onQueryChange,\n filter,\n mine,\n view,\n selection,\n actions,\n}: ToolbarProps) {\n const selected = Boolean(selection?.count);\n const titleRef = useRef<HTMLSpanElement>(null);\n // The toolbar control holding focus. A blur toward the page or a removal\n // keeps it, so the selection ending can tell that it took focus away.\n const focused = useRef<Element | null>(null);\n useEffect(() => {\n const previous = focused.current;\n // Clear, or a selection action, unmounted with focus: return it to the\n // collection's title rather than leave it on the page.\n if (!selected && previous && !previous.isConnected && cannotHoldFocus(document.activeElement)) {\n focused.current = null;\n titleRef.current?.focus({ preventScroll: true });\n }\n }, [selected]);\n return (\n <TableToolbar\n className=\"ds-collection-view__toolbar\"\n data-selected={selected || undefined}\n onFocus={(event) => {\n focused.current = event.target;\n }}\n onBlur={(event) => {\n if (event.relatedTarget) {\n focused.current = null;\n }\n }}\n start={\n <>\n {/* Mounted throughout, so screen readers hear the first selection. */}\n <span\n className=\"ds-collection-view__selected\"\n role=\"status\"\n >\n {selected && `${selection!.count} selected`}\n </span>\n {!selected && (\n <>\n <span\n ref={titleRef}\n className=\"ds-table-toolbar__title\"\n tabIndex={-1}\n >\n {title}\n </span>\n <Badge\n shape=\"count\"\n appearance=\"soft\"\n isCountExact\n className=\"ds-collection-view__count\"\n >\n {count}\n </Badge>\n </>\n )}\n </>\n }\n end={\n selected ? (\n <>\n {selection!.reason && (\n <span className=\"ds-collection-view__reason\">{selection!.reason}</span>\n )}\n {selection!.actions}\n <Button\n size=\"sm\"\n variant=\"simple\"\n isDisabled={selection!.isPending}\n onClick={selection!.onClear}\n >\n Clear\n </Button>\n </>\n ) : (\n <CollectionFilters\n title={title}\n query={query}\n onQueryChange={onQueryChange}\n filter={filter}\n mine={mine}\n view={view}\n actions={actions}\n />\n )\n }\n />\n );\n}\n","import { TableEmpty, type TableEmptyProps } from \"../Table\";\nimport type { CollectionEmptyKind } from \"./types\";\n\nexport interface CollectionEmptyProps extends Pick<\n TableEmptyProps,\n \"icon\" | \"description\" | \"action\"\n> {\n kind: CollectionEmptyKind;\n /** Plural noun for the no-match title, e.g. \"entries\". */\n noun: string;\n /** Shown when the collection itself has no items. */\n title: string;\n}\n\n/**\n * What a searchable collection's frame shows instead of its table: how to\n * start an empty collection, or a pointer back to the search field.\n */\nexport function CollectionEmpty({\n kind,\n noun,\n icon,\n title,\n description,\n action,\n}: CollectionEmptyProps) {\n if (kind === \"no-match\") {\n return (\n <TableEmpty\n icon=\"search\"\n title={`No matching ${noun}`}\n description=\"Try a different search or clear a filter.\"\n />\n );\n }\n return (\n <TableEmpty\n icon={icon}\n title={title}\n description={description}\n action={action}\n />\n );\n}\n","import { Pagination } from \"../Pagination\";\nimport { TableFrame } from \"../Table\";\nimport { CollectionToolbar } from \"./toolbar\";\nimport { LoadState } from \"../LoadState\";\nimport type { CollectionViewProps } from \"./types\";\nimport \"./style.css\";\nexport type { CollectionViewProps, CollectionEmptyKind } from \"./types\";\nexport { CollectionEmpty } from \"./empty\";\nexport type { CollectionEmptyProps } from \"./empty\";\n\nexport function CollectionView({\n title,\n count,\n query,\n onQueryChange,\n status,\n error,\n onRetry,\n pagination,\n filter,\n mine,\n view,\n selection,\n actions,\n children,\n}: CollectionViewProps) {\n return (\n <TableFrame\n className=\"ds-collection-view\"\n aria-busy={status === \"loading\" || selection?.isPending || undefined}\n >\n <CollectionToolbar\n title={title}\n count={count}\n query={query}\n onQueryChange={onQueryChange}\n filter={filter}\n mine={mine}\n view={view}\n selection={selection}\n actions={actions}\n />\n <div\n className=\"ds-collection-view__body\"\n data-feedback={status !== \"ready\" || undefined}\n >\n <LoadState\n status={status}\n error={error}\n onRetry={onRetry}\n >\n {children}\n </LoadState>\n </div>\n <div className=\"ds-collection-view__footer\">\n {/* Paging stays live while a page loads: disabling the pressed Next or\n Previous button would drop its focus on every page change. */}\n <Pagination\n size=\"md\"\n menuPlacement=\"top\"\n {...pagination}\n isDisabled={pagination.isDisabled || selection?.isPending}\n />\n </div>\n </TableFrame>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgBK,EAAkB,EAChC,UACA,UACA,kBACA,WACA,SACA,SACA,cACe;CACf,OACE,kBAAAL,GAAA,EAAA,UAAA;EACE,kBAACM,GAAD;GACE,MAAK;GACL,WAAW;GACX,aAAa,UAAUC,EAAM,YAAY;GACzC,cAAY,UAAUA,EAAM,YAAY;GACxC,OAAOC;GACP,WAAW,MAAUC,EAAcC,EAAM,OAAO,KAAK;GACrD,eAAeD,EAAc,EAAE;EAChC,CAAA;EACAE,KACC,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,MAAK;IACL,cAAYD,EAAO;IACnB,OAAOA,EAAO;IACd,SAASA,EAAO;IAChB,eAAeA,EAAO;GACvB,CAAA;EACE,CAAA;EAENE,KACC,kBAACC,GAAD;GACE,MAAK;GACL,WAAU;GACV,SAASD,EAAK,YAAY,WAAW;GACrC,gBAAcA,EAAK;GACnB,eAAeA,EAAK,SAAS,CAACA,EAAK,SAAS;GAE3C,UAAAA,EAAK;EACA,CAAA;EAETE,KACC,kBAACC,GAAD;GACE,YAAY;GACZ,cAAY,GAAGT,EAAM;GAFvB,UAAA,CAIE,kBAACO,GAAD;IACE,MAAK;IACL,YAAA;IACA,WAAU;IACV,cAAW;IACX,gBAAcC,EAAK,UAAU;IAC7B,SAASA,EAAK,UAAU,SAAS,WAAW;IAC5C,eAAeA,EAAK,SAAS,MAAM;GACpC,CAAA,GACD,kBAACD,GAAD;IACE,MAAK;IACL,YAAA;IACA,WAAU;IACV,cAAW;IACX,gBAAcC,EAAK,UAAU;IAC7B,SAASA,EAAK,UAAU,UAAU,WAAW;IAC7C,eAAeA,EAAK,SAAS,OAAO;GACrC,CAAA,CACU;;EAEdE;CACD,EAAA,CAAA;AAEN;;;AC/DA,SAAgBC,EAAkB,EAChC,UACA,UACA,UACA,k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gBwB,EAAgB,EAC9B,SACA,SACA,SACA,UACA,gBACA,aACuB;CAUvB,OATIC,MAAS,aAET,kBAACC,GAAD;EACE,MAAK;EACL,OAAO,eAAeC;EACtB,aAAY;CACb,CAAA,IAIH,kBAACD,GAAD;EACQ;EACC;EACM;EACL;CACT,CAAA;AAEL;;;ACjCA,SAAgBE,EAAe,EAC7B,UACA,UACA,UACA,kBACA,WACA,UACA,YACA,eACA,WACA,SACA,SACA,cACA,YACA,eACsB;CACtB,OACE,kBAACC,GAAD;EACE,WAAU;EACV,aAAWC,MAAW,aAAaf,GAAW,aAAa,KAAA;EAF7D,UAAA;GAIE,kBAACF,GAAD;IACS;IACA;IACA;IACQ;IACP;IACF;IACA;IACK;IACF;GACV,CAAA;GACD,kBAAC,OAAD;IACE,WAAU;IACV,iBAAeiB,MAAW,WAAW,KAAA;IAErC,UAAA,kBAAChC,GAAD;KACU;KACD;KACE;KAER;IACQ,CAAA;GACR,CAAA;GACL,kBAAC,OAAD;IAAK,WAAU;IAGb,UAAA,kBAACiC,GAAD;KACE,MAAK;KACL,eAAc;KACd,GAAIC;KACJ,YAAYA,EAAW,cAAcjB,GAAW;IACjD,CAAA;GACE,CAAA;EACK;;AAEhB"}
@@ -0,0 +1,71 @@
1
+ import { Button as e } from "../components/Button/index.js";
2
+ import { Banner as t } from "../components/Banner/index.js";
3
+ import { SkeletonText as n } from "../components/Skeleton/index.js";
4
+ import { useEffect as r, useState as i } from "react";
5
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ //#region src/components/LoadState/error.tsx
7
+ var c = {
8
+ pending: "Trying again…",
9
+ failed: "Still couldn't load this."
10
+ };
11
+ function l({ error: n, onRetry: r, retryState: i }) {
12
+ return /* @__PURE__ */ s(t, {
13
+ tone: "danger",
14
+ role: "note",
15
+ icon: "auto",
16
+ title: "Couldn't load this",
17
+ actions: r && /* @__PURE__ */ o(e, {
18
+ size: "sm",
19
+ isPending: i === "pending",
20
+ isFocusableWhenDisabled: !0,
21
+ onClick: r,
22
+ children: "Try again"
23
+ }),
24
+ children: [
25
+ n?.message,
26
+ " ",
27
+ /* @__PURE__ */ o("span", {
28
+ role: "status",
29
+ children: i && c[i]
30
+ })
31
+ ]
32
+ });
33
+ }
34
+ //#endregion
35
+ //#region src/components/LoadState/useRetryAttempt.ts
36
+ var u = 1e3;
37
+ function d(e, t, n) {
38
+ let [a, o] = i(null), [s, c] = i(e);
39
+ e !== s && (c(e), a?.phase === "pending" && e === "error" ? o({ phase: "failed" }) : (a?.phase !== "pending" || e !== "loading") && o(null));
40
+ let l = a?.phase === "pending" && e !== "loading";
41
+ r(() => {
42
+ if (!l) return;
43
+ let e = setTimeout(() => o((e) => e === a ? null : e), u);
44
+ return () => clearTimeout(e);
45
+ }, [a, l]);
46
+ let d = a?.phase === "pending" && e === "loading" ? "pending" : a?.phase === "failed" && e === "error" ? "failed" : void 0;
47
+ return {
48
+ state: d,
49
+ error: d === "pending" ? a?.error : t,
50
+ retry: n && (() => {
51
+ o({
52
+ phase: "pending",
53
+ error: t
54
+ }), n();
55
+ })
56
+ };
57
+ }
58
+ //#endregion
59
+ //#region src/components/LoadState/index.tsx
60
+ function f({ status: e, error: t, onRetry: r, children: i }) {
61
+ let s = d(e, t, r);
62
+ return e === "error" || s.state === "pending" ? /* @__PURE__ */ o(l, {
63
+ error: s.error,
64
+ onRetry: s.retry,
65
+ retryState: s.state
66
+ }) : e === "loading" ? /* @__PURE__ */ o(n, { lines: 4 }) : /* @__PURE__ */ o(a, { children: i });
67
+ }
68
+ //#endregion
69
+ export { l as n, f as t };
70
+
71
+ //# sourceMappingURL=LoadState-B7GTDlWv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoadState-B7GTDlWv.js","names":["_Fragment","Fragment$1","retryNotes","LoadError","Banner","onRetry","Button","retryState","error","RETRY_START_WINDOW_MS","useRetryAttempt","attempt","setAttempt","useState","seenStatus","setSeenStatus","status","awaitsLoad","timer","current","state","LoadState","retry","SkeletonText"],"sources":["../../src/components/LoadState/error.tsx","../../src/components/LoadState/useRetryAttempt.ts","../../src/components/LoadState/index.tsx"],"sourcesContent":["import { Banner } from \"../Banner\";\nimport { Button } from \"../Button\";\n\nimport type { RetryState } from \"./types\";\n\nconst retryNotes: Record<RetryState, string> = {\n pending: \"Trying again…\",\n failed: \"Still couldn't load this.\",\n};\n\n/**\n * Persistent load feedback; the owning view controls when it is shown. A first\n * failure stays quiet, while a retry's progress and repeated failure are announced.\n */\nexport interface LoadErrorProps {\n error?: Error | null;\n onRetry?: () => void;\n /** Set while the owner keeps this banner mounted through a retry, so Retry keeps focus. */\n retryState?: RetryState;\n}\n\nexport function LoadError({ error, onRetry, retryState }: LoadErrorProps) {\n return (\n <Banner\n tone=\"danger\"\n role=\"note\"\n icon=\"auto\"\n title=\"Couldn't load this\"\n actions={\n onRetry && (\n <Button\n size=\"sm\"\n isPending={retryState === \"pending\"}\n isFocusableWhenDisabled\n onClick={onRetry}\n >\n Try again\n </Button>\n )\n }\n >\n {error?.message} <span role=\"status\">{retryState && retryNotes[retryState]}</span>\n </Banner>\n );\n}\n","import { useEffect, useState } from \"react\";\nimport type { RetryState } from \"./types\";\nimport type { LoadStatus } from \"./types\";\n\n/**\n * How long a retry waits for its load to be reported. Loads usually start in\n * the retry handler or within a few ticks of it, such as a query library's\n * batched notification. A later load is unrelated.\n */\nconst RETRY_START_WINDOW_MS = 1000;\n\ninterface Attempt {\n phase: RetryState;\n /** The failure being retried, kept on screen while the retry loads. */\n error?: Error | null;\n}\n\n/**\n * A retry started from failure feedback. The owner keeps that feedback mounted\n * while the retry loads, so Retry keeps focus, and reports a repeated failure.\n * Success, or any load the retry didn't start, clears it. A retry that reports\n * no load within RETRY_START_WINDOW_MS, for example because the owner keeps\n * `error` while refetching, lapses, so a later unrelated load shows a skeleton.\n */\nexport function useRetryAttempt(\n status: LoadStatus,\n error: Error | null | undefined,\n onRetry?: () => void,\n) {\n const [attempt, setAttempt] = useState<Attempt | null>(null);\n const [seenStatus, setSeenStatus] = useState(status);\n if (status !== seenStatus) {\n setSeenStatus(status);\n if (attempt?.phase === \"pending\" && status === \"error\") {\n setAttempt({ phase: \"failed\" });\n } else if (attempt?.phase !== \"pending\" || status !== \"loading\") {\n setAttempt(null);\n }\n }\n const awaitsLoad = attempt?.phase === \"pending\" && status !== \"loading\";\n useEffect(() => {\n if (!awaitsLoad) {\n return;\n }\n const timer = setTimeout(\n () => setAttempt((current) => (current === attempt ? null : current)),\n RETRY_START_WINDOW_MS,\n );\n return () => clearTimeout(timer);\n }, [attempt, awaitsLoad]);\n const state: RetryState | undefined =\n attempt?.phase === \"pending\" && status === \"loading\"\n ? \"pending\"\n : attempt?.phase === \"failed\" && status === \"error\"\n ? \"failed\"\n : undefined;\n return {\n state,\n error: state === \"pending\" ? attempt?.error : error,\n retry:\n onRetry &&\n (() => {\n setAttempt({\n phase: \"pending\",\n error,\n });\n onRetry();\n }),\n };\n}\n","import { SkeletonText } from \"../Skeleton\";\nimport { LoadError } from \"./error\";\nimport { useRetryAttempt } from \"./useRetryAttempt\";\nimport type { LoadStatus } from \"./types\";\nimport type { ReactNode } from \"react\";\n\nexport interface LoadStateProps {\n status: LoadStatus;\n error?: Error | null;\n onRetry?: () => void;\n /** Rendered once loaded. */\n children?: ReactNode;\n}\n\n/** The loading and failed states every API-backed view shares; children render once ready. */\nexport function LoadState({ status, error, onRetry, children }: LoadStateProps) {\n const retry = useRetryAttempt(status, error, onRetry);\n // One LoadError instance spans a retry, so focus stays on its Retry button.\n if (status === \"error\" || retry.state === \"pending\") {\n return (\n <LoadError\n error={retry.error}\n onRetry={retry.retry}\n retryState={retry.state}\n />\n );\n }\n if (status === \"loading\") {\n return <SkeletonText lines={4} />;\n }\n return <>{children}</>;\n}\n\nexport { LoadError } from \"./error\";\nexport type { LoadErrorProps } from \"./error\";\nexport type { LoadStatus, RetryState } from \"./types\";\n"],"mappings":";;;;;;AAKA,IAAME,IAAyC;CAC7C,SAAS;CACT,QAAQ;AACV;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D,OAZIW,MAAW,WAAWM,EAAM,UAAU,YAEtC,kBAACnB,GAAD;EACE,OAAOmB,EAAM;EACb,SAASA,EAAM;EACf,YAAYA,EAAM;CACnB,CAAA,IAGDN,MAAW,YACN,kBAACO,GAAD,EAAc,OAAO,EAAI,CAAA,IAE3B,kBAAAvB,GAAA,EAAG,YAAW,CAAA;AACvB"}
@@ -0,0 +1,2 @@
1
+ const e=require("../components/Button/index.cjs"),t=require("../components/Banner/index.cjs"),n=require("../components/Skeleton/index.cjs");let r=require("react"),i=require("react/jsx-runtime");var a={pending:`Trying again…`,failed:`Still couldn't load this.`};function o({error:n,onRetry:r,retryState:o}){return(0,i.jsxs)(t.Banner,{tone:`danger`,role:`note`,icon:`auto`,title:`Couldn't load this`,actions:r&&(0,i.jsx)(e.Button,{size:`sm`,isPending:o===`pending`,isFocusableWhenDisabled:!0,onClick:r,children:`Try again`}),children:[n?.message,` `,(0,i.jsx)(`span`,{role:`status`,children:o&&a[o]})]})}var s=1e3;function c(e,t,n){let[i,a]=(0,r.useState)(null),[o,c]=(0,r.useState)(e);e!==o&&(c(e),i?.phase===`pending`&&e===`error`?a({phase:`failed`}):(i?.phase!==`pending`||e!==`loading`)&&a(null));let l=i?.phase===`pending`&&e!==`loading`;(0,r.useEffect)(()=>{if(!l)return;let e=setTimeout(()=>a(e=>e===i?null:e),s);return()=>clearTimeout(e)},[i,l]);let u=i?.phase===`pending`&&e===`loading`?`pending`:i?.phase===`failed`&&e===`error`?`failed`:void 0;return{state:u,error:u===`pending`?i?.error:t,retry:n&&(()=>{a({phase:`pending`,error:t}),n()})}}function l({status:e,error:t,onRetry:r,children:a}){let s=c(e,t,r);return e===`error`||s.state===`pending`?(0,i.jsx)(o,{error:s.error,onRetry:s.retry,retryState:s.state}):e===`loading`?(0,i.jsx)(n.SkeletonText,{lines:4}):(0,i.jsx)(i.Fragment,{children:a})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
2
+ //# sourceMappingURL=LoadState-C7tQ6fIP.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoadState-C7tQ6fIP.cjs","names":["Banner","Button","useState","SkeletonText","_Fragment","require_components_Button_index","require_components_Banner_index","require_components_Skeleton_index","react","react_jsx_runtime","retryNotes","LoadError","onRetry","retryState","error","RETRY_START_WINDOW_MS","useRetryAttempt","attempt","setAttempt","seenStatus","setSeenStatus","status","awaitsLoad","timer","current","state","LoadState","retry"],"sources":["../../src/components/LoadState/error.tsx","../../src/components/LoadState/useRetryAttempt.ts","../../src/components/LoadState/index.tsx"],"sourcesContent":["import { Banner } from \"../Banner\";\nimport { Button } from \"../Button\";\n\nimport type { RetryState } from \"./types\";\n\nconst retryNotes: Record<RetryState, string> = {\n pending: \"Trying again…\",\n failed: \"Still couldn't load this.\",\n};\n\n/**\n * Persistent load feedback; the owning view controls when it is shown. A first\n * failure stays quiet, while a retry's progress and repeated failure are announced.\n */\nexport interface LoadErrorProps {\n error?: Error | null;\n onRetry?: () => void;\n /** Set while the owner keeps this banner mounted through a retry, so Retry keeps focus. */\n retryState?: RetryState;\n}\n\nexport function LoadError({ error, onRetry, retryState }: LoadErrorProps) {\n return (\n <Banner\n tone=\"danger\"\n role=\"note\"\n icon=\"auto\"\n title=\"Couldn't load this\"\n actions={\n onRetry && (\n <Button\n size=\"sm\"\n isPending={retryState === \"pending\"}\n isFocusableWhenDisabled\n onClick={onRetry}\n >\n Try again\n </Button>\n )\n }\n >\n {error?.message} <span role=\"status\">{retryState && retryNotes[retryState]}</span>\n </Banner>\n );\n}\n","import { useEffect, useState } from \"react\";\nimport type { RetryState } from \"./types\";\nimport type { LoadStatus } from \"./types\";\n\n/**\n * How long a retry waits for its load to be reported. Loads usually start in\n * the retry handler or within a few ticks of it, such as a query library's\n * batched notification. A later load is unrelated.\n */\nconst RETRY_START_WINDOW_MS = 1000;\n\ninterface Attempt {\n phase: RetryState;\n /** The failure being retried, kept on screen while the retry loads. */\n error?: Error | null;\n}\n\n/**\n * A retry started from failure feedback. The owner keeps that feedback mounted\n * while the retry loads, so Retry keeps focus, and reports a repeated failure.\n * Success, or any load the retry didn't start, clears it. A retry that reports\n * no load within RETRY_START_WINDOW_MS, for example because the owner keeps\n * `error` while refetching, lapses, so a later unrelated load shows a skeleton.\n */\nexport function useRetryAttempt(\n status: LoadStatus,\n error: Error | null | undefined,\n onRetry?: () => void,\n) {\n const [attempt, setAttempt] = useState<Attempt | null>(null);\n const [seenStatus, setSeenStatus] = useState(status);\n if (status !== seenStatus) {\n setSeenStatus(status);\n if (attempt?.phase === \"pending\" && status === \"error\") {\n setAttempt({ phase: \"failed\" });\n } else if (attempt?.phase !== \"pending\" || status !== \"loading\") {\n setAttempt(null);\n }\n }\n const awaitsLoad = attempt?.phase === \"pending\" && status !== \"loading\";\n useEffect(() => {\n if (!awaitsLoad) {\n return;\n }\n const timer = setTimeout(\n () => setAttempt((current) => (current === attempt ? null : current)),\n RETRY_START_WINDOW_MS,\n );\n return () => clearTimeout(timer);\n }, [attempt, awaitsLoad]);\n const state: RetryState | undefined =\n attempt?.phase === \"pending\" && status === \"loading\"\n ? \"pending\"\n : attempt?.phase === \"failed\" && status === \"error\"\n ? \"failed\"\n : undefined;\n return {\n state,\n error: state === \"pending\" ? attempt?.error : error,\n retry:\n onRetry &&\n (() => {\n setAttempt({\n phase: \"pending\",\n error,\n });\n onRetry();\n }),\n };\n}\n","import { SkeletonText } from \"../Skeleton\";\nimport { LoadError } from \"./error\";\nimport { useRetryAttempt } from \"./useRetryAttempt\";\nimport type { LoadStatus } from \"./types\";\nimport type { ReactNode } from \"react\";\n\nexport interface LoadStateProps {\n status: LoadStatus;\n error?: Error | null;\n onRetry?: () => void;\n /** Rendered once loaded. */\n children?: ReactNode;\n}\n\n/** The loading and failed states every API-backed view shares; children render once ready. */\nexport function LoadState({ status, error, onRetry, children }: LoadStateProps) {\n const retry = useRetryAttempt(status, error, onRetry);\n // One LoadError instance spans a retry, so focus stays on its Retry button.\n if (status === \"error\" || retry.state === \"pending\") {\n return (\n <LoadError\n error={retry.error}\n onRetry={retry.retry}\n retryState={retry.state}\n />\n );\n }\n if (status === \"loading\") {\n return <SkeletonText lines={4} />;\n }\n return <>{children}</>;\n}\n\nexport { LoadError } from \"./error\";\nexport type { LoadErrorProps } from \"./error\";\nexport type { LoadStatus, RetryState } from \"./types\";\n"],"mappings":"A,kMAKA,IAAMU,EAAyC,CAC7C,QAAS,gBACT,OAAQ,2BACV,EAaA,SAAgBC,EAAU,CAAE,QAAO,UAAS,cAA8B,CACxE,OACE,EAAAF,EAAA,KAAA,CAACT,EAAAA,OAAD,CACE,KAAK,SACL,KAAK,OACL,KAAK,OACL,MAAM,qBACN,QACEY,IACE,EAAAH,EAAA,IAAA,CAACR,EAAAA,OAAD,CACE,KAAK,KACL,UAAWY,IAAe,UAC1B,wBAAA,GACA,QAASD,EACV,SAAA,WAEO,CAAA,EAdd,SAAA,CAkBGE,GAAO,QAAQ,KAAC,EAAAL,EAAA,IAAA,CAAC,OAAD,CAAM,KAAK,SAAU,SAAAI,GAAcH,EAAWG,EAAkB,CAAA,CAC3E,C,EAEZ,CCnCA,IAAME,EAAwB,IAe9B,SAAgBC,EACd,EACA,EACA,EACA,CACA,GAAM,CAACC,EAASC,IAAA,EAAchB,EAAAA,SAAAA,CAAyB,IAAI,EACrD,CAACiB,EAAYC,IAAA,EAAiBlB,EAAAA,SAAAA,CAASmB,CAAM,EAC/CA,IAAWF,IACbC,EAAcC,CAAM,EAChBJ,GAAS,QAAU,WAAaI,IAAW,QAC7CH,EAAW,CAAE,MAAO,QAAS,CAAC,GACrBD,GAAS,QAAU,WAAaI,IAAW,YACpDH,EAAW,IAAI,GAGnB,IAAMI,EAAaL,GAAS,QAAU,WAAaI,IAAW,WAC9D,EAAAb,EAAA,UAAA,KAAgB,CACd,GAAI,CAACc,EACH,OAEF,IAAMC,EAAQ,eACNL,EAAY,GAAaM,IAAYP,EAAU,KAAOO,CAAQ,EACpET,CACF,EACA,UAAa,aAAaQ,CAAK,CACjC,EAAG,CAACN,EAASK,CAAU,CAAC,EACxB,IAAMG,EACJR,GAAS,QAAU,WAAaI,IAAW,UACvC,UACAJ,GAAS,QAAU,UAAYI,IAAW,QACxC,SACA,IAAA,GACR,MAAO,CACL,QACA,MAAOI,IAAU,UAAYR,GAAS,MAAQH,EAC9C,MACEF,QACO,CACLM,EAAW,CACT,MAAO,UACP,OACF,CAAC,EACDN,EAAQ,CACV,EACJ,CACF,CCtDA,SAAgBc,EAAU,CAAE,SAAQ,QAAO,UAAS,YAA4B,CAC9E,IAAMC,EAAQX,EAAgBK,EAAQP,EAAOF,CAAO,EAcpD,OAZIS,IAAW,SAAWM,EAAM,QAAU,WAEtC,EAAAlB,EAAA,IAAA,CAACE,EAAD,CACE,MAAOgB,EAAM,MACb,QAASA,EAAM,MACf,WAAYA,EAAM,KACnB,CAAA,EAGDN,IAAW,WACN,EAAAZ,EAAA,IAAA,CAACN,EAAAA,aAAD,CAAc,MAAO,CAAI,CAAA,GAE3B,EAAAM,EAAA,IAAA,CAAAL,EAAAA,SAAA,CAAG,UAAW,CAAA,CACvB,C"}
@@ -0,0 +1,2 @@
1
+ const e=require("../components/Button/index.cjs"),t=require("../components/Modal/index.cjs"),n=require("../components/Table/index.cjs"),r=require("../components/Stepper/index.cjs");let i=require("react"),a=require("react/jsx-runtime");var o=e=>t=>{t.detail<=1&&e()};function s({step:t,isFirst:n,isLast:r,isPending:i,submitLabel:s,onBack:c,onAdvance:l}){return(0,a.jsxs)(a.Fragment,{children:[!t.hideSecondary&&(0,a.jsx)(e.Button,{isDisabled:i,isFocusableWhenDisabled:!0,onClick:o(c),children:n?`Cancel`:`Back`}),(0,a.jsx)(e.Button,{variant:`primary`,isDisabled:i||t.canContinue===!1&&!t.onInvalid,isPending:i,isFocusableWhenDisabled:!0,onClick:o(l),children:t.primaryAction?.label??(r?s:`Next`)})]})}function c({rows:t,onStepChange:r,isDisabled:i=!1}){return(0,a.jsx)(n.TableFrame,{children:(0,a.jsxs)(n.Table,{children:[(0,a.jsx)(n.TableHead,{children:(0,a.jsxs)(n.TableRow,{children:[(0,a.jsx)(n.TableHeaderCell,{children:`Setting`}),(0,a.jsx)(n.TableHeaderCell,{children:`Value`}),(0,a.jsx)(n.TableHeaderCell,{width:`control`,align:`end`,"aria-label":`Actions`})]})}),(0,a.jsx)(n.TableBody,{children:t.map((t,o)=>(0,a.jsxs)(n.TableRow,{children:[(0,a.jsx)(n.TableCell,{emphasis:`primary`,children:t.term}),(0,a.jsx)(n.TableCell,{children:t.value}),(0,a.jsx)(n.TableCell,{width:`control`,align:`end`,children:(0,a.jsx)(e.Button,{isDisabled:i,size:`sm`,variant:`simple`,"aria-label":`Edit ${t.term}`,onClick:()=>r(t.step),children:`Edit`})})]},o))})]})})}function l({isOpen:e,modalComponent:n=t.Modal,title:o,description:c,steps:l,activeStep:u=0,onStepChange:d=()=>{},submitLabel:f,onSubmit:p,isPending:m=!1,isNavigable:h=!0,onClose:g}){let _=Math.min(Math.max(u,0),l.length-1),v=l[_],y=_===0,b=_===l.length-1,x=()=>{m||g()};return(0,a.jsx)(n,{isOpen:e,size:`md`,title:v?.title??o,description:v?.modalDescription??c,onClose:x,footer:v&&(0,a.jsx)(s,{step:v,isFirst:y,isLast:b,isPending:m,submitLabel:f,onBack:y?x:()=>d(_-1),onAdvance:()=>{!m&&v&&(v.canContinue===!1?v.onInvalid?.():v.primaryAction?v.primaryAction.onClick():b?p():d(_+1))}}),children:(0,a.jsxs)(`div`,{className:`ds-wizard__content`,children:[l.length>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Stepper,{size:`md`,orientation:`auto`,activeStep:_,steps:l.map(({id:e,label:t,description:n})=>({id:e,label:t,description:n})),onStepChange:h&&!m?d:void 0}),(0,a.jsx)(`hr`,{className:`ds-wizard__rule`})]}),v&&(0,a.jsx)(i.Fragment,{children:v.content},v.id)]})})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
2
+ //# sourceMappingURL=Wizard-B_CPW1V6.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Wizard-B_CPW1V6.cjs","names":["_Fragment","Button","TableFrame","Table","TableHead","TableRow","TableHeaderCell","TableBody","TableCell","Button","Modal","_Fragment","Stepper","Fragment","require_components_Button_index","require_components_Modal_index","require_components_Table_index","require_components_Stepper_index","react","react_jsx_runtime","singleClick","event","action","WizardActions","step","isPending","onBack","isFirst","onAdvance","isLast","submitLabel","ReviewTable","rows","row","onStepChange","index","Wizard","ModalComponent","activeStep","steps","close","onClose","title","description","onSubmit","isNavigable"],"sources":["../../src/components/Wizard/actions.tsx","../../src/components/Wizard/review-table.tsx","../../src/components/Wizard/index.tsx"],"sourcesContent":["import type { MouseEvent } from \"react\";\nimport { Button } from \"../Button\";\nimport type { WizardStep } from \"./types\";\n\n// A footer changes meaning between steps. Ignore the second click of a double-click.\n// Blocked footer buttons stay focusable: the pressed Next/Finish button is the\n// same element on the following step, so native disabling would drop its focus.\nconst singleClick = (action: () => void) => (event: MouseEvent<HTMLButtonElement>) => {\n if (event.detail <= 1) {\n action();\n }\n};\n\ninterface WizardActionsProps {\n step: WizardStep;\n isFirst: boolean;\n isLast: boolean;\n isPending: boolean;\n submitLabel: string;\n onBack: () => void;\n onAdvance: () => void;\n}\n\nexport function WizardActions({\n step,\n isFirst,\n isLast,\n isPending,\n submitLabel,\n onBack,\n onAdvance,\n}: WizardActionsProps) {\n return (\n <>\n {!step.hideSecondary && (\n <Button\n isDisabled={isPending}\n isFocusableWhenDisabled\n onClick={singleClick(onBack)}\n >\n {isFirst ? \"Cancel\" : \"Back\"}\n </Button>\n )}\n <Button\n variant=\"primary\"\n isDisabled={isPending || (step.canContinue === false && !step.onInvalid)}\n isPending={isPending}\n isFocusableWhenDisabled\n onClick={singleClick(onAdvance)}\n >\n {step.primaryAction?.label ?? (isLast ? submitLabel : \"Next\")}\n </Button>\n </>\n );\n}\n","import { Button } from \"../Button\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableFrame,\n TableHead,\n TableHeaderCell,\n TableRow,\n} from \"../Table\";\nimport type { ReactNode } from \"react\";\n\nexport interface ReviewRow {\n term: string;\n value: ReactNode;\n step: number;\n}\n\nexport interface ReviewTableProps {\n rows: ReviewRow[];\n isDisabled?: boolean;\n onStepChange: (index: number) => void;\n}\n\nexport function ReviewTable({ rows, onStepChange, isDisabled = false }: ReviewTableProps) {\n return (\n <TableFrame>\n <Table>\n <TableHead>\n <TableRow>\n <TableHeaderCell>Setting</TableHeaderCell>\n <TableHeaderCell>Value</TableHeaderCell>\n <TableHeaderCell\n width=\"control\"\n align=\"end\"\n aria-label=\"Actions\"\n />\n </TableRow>\n </TableHead>\n <TableBody>\n {/* Terms may repeat, and rows hold no state of their own, so position is the key. */}\n {rows.map((row, index) => (\n <TableRow key={index}>\n <TableCell emphasis=\"primary\">{row.term}</TableCell>\n <TableCell>{row.value}</TableCell>\n <TableCell\n width=\"control\"\n align=\"end\"\n >\n <Button\n isDisabled={isDisabled}\n size=\"sm\"\n variant=\"simple\"\n aria-label={`Edit ${row.term}`}\n onClick={() => onStepChange(row.step)}\n >\n Edit\n </Button>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </TableFrame>\n );\n}\n","import { Fragment } from \"react\";\nimport { Modal } from \"../Modal\";\nimport { Stepper } from \"../Stepper\";\nimport { WizardActions } from \"./actions\";\nimport type { WizardProps, WizardStep } from \"./types\";\nimport \"./style.css\";\n\nexport type { WizardProps, WizardStep } from \"./types\";\nexport { ReviewTable } from \"./review-table\";\nexport type { ReviewTableProps, ReviewRow } from \"./review-table\";\n\n/** Controlled layout and navigation; applications own values, validation and actions. */\nexport function Wizard({\n isOpen,\n modalComponent: ModalComponent = Modal,\n title,\n description,\n steps,\n activeStep = 0,\n onStepChange = () => {},\n submitLabel,\n onSubmit,\n isPending = false,\n isNavigable = true,\n onClose,\n}: WizardProps) {\n // An index past the end, such as after a conditional step is removed, shows\n // the last step. Without steps, such as while they load, only the frame shows.\n const index = Math.min(Math.max(activeStep, 0), steps.length - 1);\n const step: WizardStep | undefined = steps[index];\n const isFirst = index === 0;\n const isLast = index === steps.length - 1;\n const close = () => {\n if (!isPending) {\n onClose();\n }\n };\n const advance = () => {\n if (isPending || !step) {\n return;\n }\n if (step.canContinue === false) {\n step.onInvalid?.();\n return;\n }\n if (step.primaryAction) {\n step.primaryAction.onClick();\n } else if (isLast) {\n onSubmit();\n } else {\n onStepChange(index + 1);\n }\n };\n // The modal stays rendered while closed, so an application modal sees\n // isOpen={false} and can run its own close behavior.\n return (\n <ModalComponent\n isOpen={isOpen}\n size=\"md\"\n title={step?.title ?? title}\n description={step?.modalDescription ?? description}\n onClose={close}\n footer={\n step && (\n <WizardActions\n step={step}\n isFirst={isFirst}\n isLast={isLast}\n isPending={isPending}\n submitLabel={submitLabel}\n onBack={isFirst ? close : () => onStepChange(index - 1)}\n onAdvance={advance}\n />\n )\n }\n >\n <div className=\"ds-wizard__content\">\n {steps.length > 1 && (\n <>\n <Stepper\n size=\"md\"\n orientation=\"auto\"\n activeStep={index}\n steps={steps.map(({ id, label, description }) => ({ id, label, description }))}\n onStepChange={isNavigable && !isPending ? onStepChange : undefined}\n />\n <hr className=\"ds-wizard__rule\" />\n </>\n )}\n {/* Each step mounts fresh, so steps sharing a component type never share its state. */}\n {step && <Fragment key={step.id}>{step.content}</Fragment>}\n </div>\n </ModalComponent>\n );\n}\n"],"mappings":"A,2OAOA,IAAMoB,EAAe,GAAwB,GAAyC,CAChFC,EAAM,QAAU,GAClBC,EAAO,CAEX,EAYA,SAAgBC,EAAc,CAC5B,OACA,UACA,SACA,YACA,cACA,SACA,aACqB,CACrB,OACE,EAAAJ,EAAA,KAAA,CAAAnB,EAAAA,SAAA,CAAA,SAAA,CACG,CAACwB,EAAK,gBACL,EAAAL,EAAA,IAAA,CAAClB,EAAAA,OAAD,CACE,WAAYwB,EAC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