@cloudfrogger/goodui 0.0.72 → 0.0.74

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 (43) hide show
  1. package/ai/README.md +6 -0
  2. package/ai/catalog/components/good-form-row.json +16 -1
  3. package/ai/catalog/components/good-group.json +1 -2
  4. package/ai/catalog/components/good-header-themetoggle.json +1 -8
  5. package/ai/catalog/components/good-heading-2.json +3 -1
  6. package/ai/catalog/components/good-heading-group.json +3 -1
  7. package/ai/catalog/components/good-section.json +49 -1
  8. package/ai/catalog/components/good-table.json +55 -0
  9. package/ai/catalog/index.json +6 -6
  10. package/ai/examples/settings.html +3 -2
  11. package/ai/examples/settings.ts +2 -2
  12. package/ai/guides/common-mistakes.md +6 -0
  13. package/ai/guides/layout.md +4 -2
  14. package/ai/guides/page-patterns.md +7 -1
  15. package/ai/manifest.json +2 -2
  16. package/ai/skill/goodui/SKILL.md +12 -2
  17. package/angular/projects/goodui/package.json +1 -1
  18. package/angular/projects/goodui/src/lib/actions.ts +4 -4
  19. package/angular/projects/goodui/src/lib/group.ts +1 -1
  20. package/angular/projects/goodui/src/lib/table.ts +6 -1
  21. package/angular/projects/goodui/src/lib/theme.ts +1 -2
  22. package/angular/projects/goodui/src/lib/typography.ts +4 -1
  23. package/angular/projects/goodui/src/styles.css +30 -2
  24. package/design/component-map.json +44 -8
  25. package/design/settings-layout-contract.json +166 -0
  26. package/design/typography-components.json +2 -1
  27. package/design.md +4 -3
  28. package/fesm2022/cloudfrogger-goodui.mjs +28 -21
  29. package/fesm2022/cloudfrogger-goodui.mjs.map +1 -1
  30. package/guides/components/group.md +18 -0
  31. package/guides/components/header-themetoggle.md +3 -3
  32. package/guides/components/main-view.md +4 -0
  33. package/guides/components/settings.md +2 -0
  34. package/guides/components/table.md +8 -0
  35. package/guides/components/typography.md +23 -0
  36. package/guides/contributing/design-to-code.md +16 -1
  37. package/guides/layout/screen-design.md +63 -0
  38. package/homepage/src/app/examples/settings/settings-page.html +112 -0
  39. package/homepage/src/app/examples/settings/settings-page.ts +133 -0
  40. package/homepage/src/app/examples/settings/source-code.generated.ts +3 -0
  41. package/package.json +2 -2
  42. package/styles.css +1 -1
  43. package/types/cloudfrogger-goodui.d.ts +10 -4
@@ -39,3 +39,21 @@ Use `[fullWidth]="true"` on `form[goodForm]` when its content should use all of
39
39
  Import `GoodGroupComponent` and `GoodFormRowComponent` from `@cloudfrogger/goodui` alongside Form, FormField, and control components. The [Groups homepage page](../../homepage/src/app/groups-page.ts) shows all three appearances, an untitled Group, and copyable code. The [registration example](../../homepage/src/app/examples/user-registration/user-registration-form.ts) shows the row and grouping in a complete reactive form.
40
40
 
41
41
  Penpot publishes `goodui.group.outline`, `.outline-no-title`, `.contrast`, and `.plain` plus `goodui.form-row.2` and `.3` on `19 Groups`. Their IDs and Angular inputs are in [group-components.json](../../design/group-components.json). Group boards contain linked FormRow instances; FormRow boards contain linked FormField instances. The frame, surface, radius, padding, and gaps bind to `group.*` and `form-row.gap` tokens. In Penpot the outlined title uses a small background piece over the border. The Angular layout uses a heading over the border with CSS. Responsive stacking and focus or validation state are runtime behavior; Penpot specimens show the desktop composition.
42
+
43
+ ## Repeated rows with actions
44
+
45
+ Project a Button or ActionGroup with `good-form-row-actions` alongside two or three FormFields. FormRow reserves an intrinsic-width final track and aligns the action with the control line. Labels, hints, and errors remain owned by FormField. Rows with three fields become two tracks below 700 px container width, and all fields stack below 500 px; the action moves to the end and loses its label offset only when all fields stack below 500 px. Wrap rows in a plain Group or `form[goodForm]` to establish the container width. Keep labels explicit on every row for accessible repeated controls. The row owns layout only; adding/removing records and validating values belong to the application.
46
+
47
+ ```html
48
+ <good-form-row [columns]="3">
49
+ <good-form-field><!-- First labeled control --></good-form-field>
50
+ <good-form-field><!-- Second labeled control --></good-form-field>
51
+ <good-form-field><!-- Third labeled control --></good-form-field>
52
+ <good-button good-form-row-actions variant="ghost" ariaLabel="Remove window 1"
53
+ (click)="removeRow(0)">Remove</good-button>
54
+ </good-form-row>
55
+ ```
56
+
57
+ The [Settings example](../../homepage/src/app/examples/settings/settings-page.html) demonstrates repeated day/from/until rows, validation, removal, and draft cancellation on desktop and mobile.
58
+
59
+ Page `44 Settings` adds linked-control specimens for the three-field action row in desktop and mobile layouts. Their IDs are recorded in [settings-layout-contract.json](../../design/settings-layout-contract.json); the original two- and three-column FormRow components remain unchanged.
@@ -1,6 +1,6 @@
1
1
  # Header theme toggle
2
2
 
3
- `goodui.theme-toggle` maps to `good-header-themetoggle`. It is an optional 36 × 36 px topbar action. One click cycles **Light → System → Dark → Light** without opening a menu. The icon shows the current preference: sun, monitor, or moon. The accessible button label names both the current and next mode; keyboard users activate it with Enter or Space.
3
+ `goodui.theme-toggle` maps to `good-header-themetoggle`. It is an optional 36 × 36 px topbar action. One click switches **Light ↔ Dark** without opening a menu. The icon shows the currently active theme: sun for Light or moon for Dark, including when the initial theme follows the system. The accessible button label names both the current and next mode; keyboard users activate it with Enter or Space.
4
4
 
5
5
  ```html
6
6
  <good-app-shell [showThemeToggle]="true">
@@ -10,7 +10,7 @@
10
10
 
11
11
  Set `[showThemeToggle]="false"` to remove it. `good-header-actions` and `good-app-header` accept the same input. A custom composition can place `<good-header-themetoggle />` directly. The main menu owns spacing, while the control owns its hit area and hover style.
12
12
 
13
- `GoodThemeService.preference()` is `light`, `system`, or `dark`; `theme()` remains the resolved `light` or `dark` value used for colors and theme-aware artwork. Explicit Light and Dark choices are stored in the `goodui-theme` cookie for one year. System mode removes the cookie and follows `prefers-color-scheme`, including changes while the page is open. Apps can select a mode with `theme.setTheme('system')` or advance it with `theme.cycle()`. The legacy `theme.toggle()` remains a direct light/dark switch for callers that need one. Older `localStorage` values are ignored.
13
+ `GoodThemeService.preference()` is `light`, `system`, or `dark`; `theme()` remains the resolved `light` or `dark` value used for colors and theme-aware artwork. Explicit Light and Dark choices are stored in the `goodui-theme` cookie for one year. System mode removes the cookie and follows `prefers-color-scheme`, including changes while the page is open. System remains an initialization fallback and a programmatic preference, not a third selector state. Apps can restore it with `theme.setTheme('system')`. Both `theme.cycle()` and `theme.toggle()` switch from the resolved theme directly to its opposite and persist that explicit choice. Older `localStorage` values are ignored.
14
14
 
15
15
  To apply the correct color before Angular and its CSS load, put this script and critical background in the consuming app's `src/index.html` head, before other styles or scripts. The fallback colors match GoodUI's default `color.canvas` token; update them if your app overrides that token.
16
16
 
@@ -30,4 +30,4 @@ To apply the correct color before Angular and its CSS load, put this script and
30
30
  </style>
31
31
  ```
32
32
 
33
- Penpot `01 Components` publishes `goodui.theme-toggle.light`, `.system`, and `.dark`. These are the three runtime states of the same Angular selector, each bound to `control.action-size`, `radius.action`, `color.surface`, and `color.icon`. HeaderActions uses the Light instance as its representative default composition; Angular renders the matching icon for the active preference.
33
+ Penpot `01 Components` publishes `goodui.theme-toggle.light` and `.dark`, bound to `control.action-size`, `radius.action`, `color.surface`, and `color.icon`. They represent the active theme, including a theme resolved from the device setting. The former System specimen has been removed; the Light and Dark library IDs are preserved. HeaderActions uses the Light instance as its representative composition.
@@ -41,3 +41,7 @@ For a fixed strip above a height-filling workspace, set `layout="fill"` and mark
41
41
  ```
42
42
 
43
43
  Fill layout keeps the projected header's 30 px desktop or 24 px mobile side inset while its workspace reaches the edges. Without heading content, the workspace can touch the topbar. Penpot `goodui.main-view.fill-heading` and `.fill-heading-mobile` preserve this geometry; the linked Heading and Summary are projected content, not MainView text inputs. See [Typography](typography.md) and [the migration guide](../migrations/explicit-headings.md).
44
+
45
+ The [Settings example](../../homepage/src/app/examples/settings/settings-page.html) composes the page heading and `[good-main-view-actions]` with `good-section layout="settings"`. Section headers own their local actions; MainView owns Edit, Cancel, and Save. Tables use `frameAppearance="none"` to avoid nested frames. Application data and draft state stay in the example.
46
+
47
+ At 640 px viewport width and below, MainView places page actions after the heading and description in a full-width row. ActionGroup can wrap its controls without squeezing the page heading into a narrow column.
@@ -9,3 +9,5 @@
9
9
  The menu stays inside the viewport near its right edge, is keyboard accessible, and returns focus to its trigger when closed.
10
10
 
11
11
  Settings is optional in the standard topbar: set `[showSettings]="true"` on `good-app-shell`, `good-app-header`, or `good-header-actions` to include it.
12
+
13
+ For a settings **page**, compose MainView with [settings Sections](typography.md#settings-sections), page actions, DetailList, and Forms. The [complete Settings example](../../homepage/src/app/examples/settings/settings-page.html) includes workspace overview, read mode, explicit editing, repeated rows, and name-confirmed archiving. The `good-settings` selector continues to represent only the shell header menu.
@@ -254,3 +254,11 @@ For cursor mode, pass the backend's opaque `nextCursor` and `hasNextPage` with e
254
254
  | `request` | — | Complete request for manual search, sorting, or pagination. |
255
255
 
256
256
  Penpot page `16 Tables` publishes `goodui.table` with `style=default/bordered/striped/compact` and `state=populated/empty`. A populated specimen contains linked Badge, Switch, and action controls to show composition; their values and actions are runtime data. Optional search and pagination are composed parts of the same `good-table` selector. [table-variants.json](../../design/table-variants.json) records the published IDs. Penpot and CSS share the `table.*` token relationships through the token export and generation workflow.
257
+
258
+ ## Embed a quiet table in a section
259
+
260
+ `frameAppearance="none"` removes the outer border, radius, and surface, retaining semantic headers and row separators. `density="compact"` changes cell padding and row height independently of the frame or `tableStyle`. Set `density="default"` to explicitly use normal cells, including with legacy `tableStyle="compact"`. Omitting `density` preserves the existing style behavior. All existing style variants and IDs remain supported.
261
+
262
+ For search beside Section actions, keep `searchable` false and bind `[searchTerm]` from a small GoodUI Input in `[good-section-actions]`. Search uses the existing client filter or manual request path, resets pagination and cursor history, and emits `searchChange` when the effective term changes. The default integrated search remains available through `searchable`; avoid showing both search controls. See [Settings sections](typography.md#settings-sections) and the [complete Settings example](../../homepage/src/app/examples/settings/settings-page.html).
263
+
264
+ The embedded normal and compact Penpot components are published on `44 Settings`; their stable IDs and exact Angular inputs are in [settings-layout-contract.json](../../design/settings-layout-contract.json). They supplement the original eight Table variants on `16 Tables`.
@@ -210,3 +210,26 @@ The current Penpot plugin rejects applying a `fontFamilies` token to text. The s
210
210
  ## Penpot reference page
211
211
 
212
212
  Open **43 Typography Reference** for a dedicated overview of the seven heading levels, Summary, Paragraph, Eyebrow, Citation, Hint, ErrorText, and FieldLabel, plus linked HeadingGroup and Prose compositions. The examples are real library instances. Their main components remain on **12 Typography**, so changes to the design system propagate to this reference without creating duplicate component families. The page and board IDs are listed in `design/typography-components.json`.
213
+
214
+ ## Settings sections
215
+
216
+ Use `good-section layout="settings"` to compose settings pages. Project a `good-heading-group` with a semantic heading and Summary, then put controls in `[good-section-actions]`. The Section owns 24 px vertical padding, a quiet bottom divider, a 24 px heading-to-content gap, and a wrapping header. Adjacent settings Sections have no extra outer gap. Use `appearance="danger"` for a quiet destructive section: only its heading gains the destructive text color; its surface stays neutral and its bottom divider is omitted. Place the actual destructive command behind an application-owned confirmation.
217
+
218
+ ```html
219
+ <good-section layout="settings">
220
+ <good-heading-group>
221
+ <good-heading-2>Team access</good-heading-2>
222
+ <good-summary>Review who can use this workspace.</good-summary>
223
+ </good-heading-group>
224
+ <good-action-group good-section-actions spacing="small">
225
+ <good-input label="Search teams" size="small" [value]="query()" (valueChange)="query.set($event)" />
226
+ <good-button size="small">Add team</good-button>
227
+ </good-action-group>
228
+ <good-table frameAppearance="none" density="compact" [searchTerm]="query()"
229
+ [data]="teams" [columns]="columns" [reorderable]="false" />
230
+ </good-section>
231
+ ```
232
+
233
+ The existing `spacing` behavior and default Section layout remain available. `good-settings` is the header menu; it does not own page structure. See the complete [Settings example](../../homepage/src/app/examples/settings/settings-page.html) for overview → detail → read → edit, cancellation, validation, repeated rows, and archive confirmation. It uses only GoodUI composition and Angular Forms, with no example CSS.
234
+
235
+ The settings and danger compositions are published on `44 Settings`; [settings-layout-contract.json](../../design/settings-layout-contract.json) records their stable IDs, inputs, and slots. Default and content Section variants on `12 Typography` keep their existing IDs and spacing semantics.
@@ -51,7 +51,7 @@ File ID: `a552d28a-7556-80e4-8008-d3392c96c899`. Dedicated control pages include
51
51
  | `goodui.app-header.help-submenu-open` | `521fe58c-da62-80e2-8008-d3cb522ee751` |
52
52
  | `goodui.app-shell.help-submenu-open` | `521fe58c-da62-80e2-8008-d3cb84e00368` |
53
53
  | `goodui.main-menu.default` | `521fe58c-da62-80e2-8008-d33f6619a524` |
54
- | `goodui.theme-toggle.light` / `.system` / `.dark` | `f52a309e-8b45-80e4-8008-d86c7ab97196` / `f52a309e-8b45-80e4-8008-d86c7bab8421` / `f52a309e-8b45-80e4-8008-d86c7c8f020f` |
54
+ | `goodui.theme-toggle.light` / `.dark` | `f52a309e-8b45-80e4-8008-d86c7ab97196` / `f52a309e-8b45-80e4-8008-d86c7c8f020f` |
55
55
  | `goodui.search` (`hotkey=false`) / `.open` | `521fe58c-da62-80e2-8008-d33f6563524e` / `521fe58c-da62-80e2-8008-d33ffe1c4f79` |
56
56
  | `goodui.notifications.default` / `.open` | `521fe58c-da62-80e2-8008-d33f65811a2c` / `521fe58c-da62-80e2-8008-d33fff9a20ba` |
57
57
  | `goodui.notifications.unread` | `5fd6a355-e255-80dc-8008-d81d121a0160` (linked bell and destructive Badge with 16 px `notification.count.*` overrides) |
@@ -293,3 +293,18 @@ The Header shell is published as `goodui.app-header` with its seven existing sta
293
293
  ### Declarative shell regions
294
294
 
295
295
  The four published `goodui.sidebar` states map to `good-sidebar` / `GoodSidebarComponent`; the seven `goodui.app-header` states map to `good-app-header` / `GoodAppHeaderComponent`. All eleven former SidebarContainer/Header IDs and main-instance IDs remain stable, and the AppShell compositions retain linked copies. Navigation is projected: Sidebar owns its items; AppHeader owns HeaderMenu and HeaderActions. Shell array and mobile-menu configuration inputs are removed. The same Sidebar component is presented in a mobile modal drawer without duplicating state.
296
+
297
+ ### Settings page composition
298
+
299
+ Page `44 Settings` publishes the following additions. All original Section, Table, and FormRow IDs remain valid. [settings-layout-contract.json](../../design/settings-layout-contract.json) records the inputs, slots, responsive rules, and six example board IDs.
300
+
301
+ | Penpot component | Stable library ID | Angular mapping |
302
+ | --- | --- | --- |
303
+ | `goodui.section.settings` | `489901a3-7f15-8049-8008-fc89e6cf3bc1` | `good-section layout="settings"` |
304
+ | `goodui.section.settings-danger` | `489901a3-7f15-8049-8008-fc89ecca52fa` | `good-section layout="settings" appearance="danger"` |
305
+ | `goodui.table.embedded-default` | `489901a3-7f15-8049-8008-fc89ece41d55` | `good-table frameAppearance="none" density="default"` |
306
+ | `goodui.table.embedded-compact` | `489901a3-7f15-8049-8008-fc89ed012d9b` | `good-table frameAppearance="none" density="compact"` |
307
+ | `goodui.form-row.3-actions` | `489901a3-7f15-8049-8008-fc8a65b2f013` | `good-form-row [columns]="3"` with `[good-form-row-actions]` |
308
+ | `goodui.form-row.3-actions-mobile` | `489901a3-7f15-8049-8008-fc8a672942eb` | The same row below 500 px container width |
309
+
310
+ The examples demonstrate workspace overview → detail read mode → edit mode at desktop and mobile widths. Their outer composition frames are detached to accommodate projected content and runtime table cells, which Penpot does not allow adding to component copies. The Heading, Summary, Sidebar, Header, FormField, Input, Button, and repeated FormRow instances remain linked. The embedded library Table specimens retain linked Badge, Switch, and ActionMenu parts. External search is a small Input in the section action area; filtering, saving, cancellation, and confirmation execute in the Angular example.
@@ -0,0 +1,63 @@
1
+ # Designing a GoodUI screen
2
+
3
+ Use this guide when designing or substantially recomposing a screen in Penpot or Angular. The component catalog answers which APIs exist. This guide helps decide what people should see first, how the pieces fit together, and whether the rendered result works. Follow the user's reference, product requirements, and established application design when they specify a different arrangement.
4
+
5
+ ## Establish the composition before adding controls
6
+
7
+ Describe the primary user task, the information needed to complete it, the most important action, and what must remain usable on a narrow screen. Keep this to a few sentences in the working plan; use the available requirements and make routine decisions without adding an approval step.
8
+
9
+ When a reference is supplied, inspect it visually. Identify its main regions, their relative widths, reading order, density, and action placement. Preserve those relationships when choosing GoodUI components. Replacing a compact command strip with a vertical Listbox changes the workflow even if both expose the same commands. Identify the missing capability if GoodUI cannot express an essential relationship.
10
+
11
+ Without a reference, inspect the closest complete GoodUI example and its matching guides. Reuse its composition where it fits the task; replace its sample content and domain behavior. Do not assemble an application by copying unrelated showcase specimens into a single page. A component showcase demonstrates options, while an application needs a clear task and hierarchy.
12
+
13
+ ## Choose the page structure
14
+
15
+ | User task | Starting composition | Inspect these references |
16
+ | --- | --- | --- |
17
+ | Find and compare records | MainView heading and page actions, Table, useful search and filters | [Table](../components/table.md), `ai/examples/table-view.html` |
18
+ | Review and change settings | Overview → detail in read mode → explicit editing; settings Sections with local actions | [Settings example](../../homepage/src/app/examples/settings/settings-page.html), [Section](../components/typography.md#settings-sections) |
19
+ | Complete a form | Labeled fields in Groups and responsive FormRows; validation near its fields; clear submit/cancel actions | [Registration example](../../homepage/src/app/examples/user-registration/user-registration-form.html), [Group](../components/group.md) |
20
+ | Work across a collection and its selected item | Height-filling workspace with list/detail panes and commands near the workspace | [Mail workspace](../../homepage/src/app/examples/mail-workspace/mail-workspace-page.html), [Resizable](../components/resizable.md), [ActionBar](../components/action-bar.md) |
21
+ | Work on a schedule | Height-filling Calendar with its documented controls and a usable mobile presentation | [Calendar workspace](../../homepage/src/app/examples/calendar-workspace/calendar-workspace-page.html), [Calendar](../components/calendar.md) |
22
+
23
+ These are starting points, not a requirement to turn every workflow into one of these pages. Inspect only the relevant example. For a named case study, start with `ai/case-studies/index.md` and open that study's relevant screen.
24
+
25
+ MainView owns the page inset, heading, and page actions. Choose its page or fill layout deliberately. Direct Sections align a centered content page; a fill workspace reserves the remaining height for a primary child that owns scrolling. Read [MainView](../components/main-view.md) and [layout rules](layout-rules.md) for the actual behavior rather than recreating it with app-specific padding or offsets.
26
+
27
+ ## Give each visual treatment a purpose
28
+
29
+ | Decision | GoodUI guidance |
30
+ | --- | --- |
31
+ | Heading hierarchy | Use the page heading for the current object or task, section headings for related content, and field labels for controls. A Summary should help the person use the page; omit redundant narration of obvious controls. |
32
+ | Surface hierarchy | Use a Section for page structure, a Group for related content or fields, and a Card when a bounded surface helps identify an independent unit. Avoid stacking Card → framed Group → framed Table for the same set of records. |
33
+ | Action hierarchy | Put page actions in `[good-main-view-actions]`, section actions in `[good-section-actions]`, and record actions in their row or detail context. Give the current task's main action visual priority; use quieter variants for secondary actions. Several equally prominent buttons should represent equally important choices. |
34
+ | Reading and editing | Use text and DetailList for a readable summary. Enter editing deliberately when the workflow benefits from separate read/edit modes. Disabled inputs communicate unavailable controls, so do not use them merely to display saved values. Keep drafts separate from saved data and make Cancel actually discard changes. |
35
+ | Tables and search | Choose frame and density independently. An embedded Table can use `frameAppearance="none"` and `density="compact"`. A small Input can drive `[searchTerm]` beside section actions. Keep the integrated toolbar when the Table owns the search context. |
36
+ | Repeated fields | Use FormRow with labeled FormFields and `[good-form-row-actions]`. Keep labels and controls aligned even when a field has an error. Adding/removing rows and time or domain validation belong to the application. |
37
+ | Destructive actions | Give the consequence clear wording and proportionate confirmation. `good-section layout="settings" appearance="danger"` supplies quiet emphasis. A large red surface is not a default container for every archive action. |
38
+ | Color and decoration | Use semantic GoodUI colors and radius/spacing roles. Reserve semantic error, warning, success, and selection treatments for those meanings. Do not add badges, gradients, icons, or shadows solely to make a sparse screen look busy. Respect intentional brand treatments in the user's reference. |
39
+ | Status and feedback | Keep task or field errors nearby, immediate action feedback brief, and revisitable background messages in the shell Notifications center. See [Notifications](../components/notifications.md). |
40
+
41
+ Keep spacing owned by the appropriate container. Check whether apparent excess space comes from two nested containers before adding negative margins or smaller field padding. If the requested composition needs a missing reusable capability, inspect the current catalog and guides, describe the precise gap, and follow the user's project rules for extending GoodUI. Keep domain-specific styling and business logic out of the library.
42
+
43
+ ## Design the narrow layout as a workflow
44
+
45
+ Keep the title and description readable when page actions wrap. Keep the primary record identifier and essential actions visible when secondary table columns disappear. Hide information only when the task remains understandable; use a detail view or local table scrolling for information that must remain available. Never solve page overflow by clipping the whole page or removing an essential action.
46
+
47
+ Use the documented responsive containers before adding viewport-specific wrappers. Check the component's available width inside a sidebar, pane, or modal as well as the browser width. For repeated rows, preserve the relationship between each label, field, error, and removal action after stacking. Review long names, validation messages, empty lists, and realistic record counts rather than only short placeholder text.
48
+
49
+ ## Review the rendered result before reporting completion
50
+
51
+ Start with one representative screen and its main interaction. Inspect it before repeating the composition across the application. Fix the cause in the component or container that owns it, then review the affected views again. This is an implementation check, not a mandatory user approval gate.
52
+
53
+ | Review | Evidence to inspect | Revise when |
54
+ | --- | --- | --- |
55
+ | Task and hierarchy | The initial viewport, current object, headings, and main action | The person must scan several equally emphasized regions to find the next action, or developer-facing explanation displaces useful content. |
56
+ | Composition | The whole screen and, when provided, the reference beside it | Relative region sizes, reading order, density, or action placement no longer support the requested workflow. |
57
+ | Alignment and spacing | Heading/content edges, section rhythm, labels, controls, and repeated rows | Nested frames add unintended padding, action buttons squeeze headings, or a message displaces neighboring controls. |
58
+ | Responsive behavior | A representative desktop and mobile width; GoodUI baselines are 1440 × 900 and 390 × 844 | Essential information or actions vanish, labels collide, a page overflows, or a height-filling workspace has competing page/pane scrollbars. |
59
+ | States and accessibility | Main interaction, empty/error/loading states that apply, visible focus, keyboard use, and both themes | A happy-path screenshot hides broken Cancel, unreadable contrast, missing names, or inaccessible actions. |
60
+
61
+ For Angular, open the built/running page in a browser and inspect actual screenshots and interactions. For Penpot, inspect the live linked instances and targeted exports, checking content bounds as well as root bounds. Distinguish a compile check, a rendered visual check, a working local interaction, and verified backend persistence. If rendering tools or a connection are unavailable, report the specific remaining check. A passing build cannot establish design quality.
62
+
63
+ Record the chosen pattern/reference, the meaningful layout decisions, and the checks performed in the final handoff. Do not invent a numeric design score or claim universal visual quality from an automated check. The guide makes design decisions and review evidence more explicit; it cannot guarantee that every agent will produce a good result.
@@ -0,0 +1,112 @@
1
+ <good-main-view>
2
+ <good-heading-1>{{ detail() ? (workspace()?.name ?? 'Workspace not found') : 'Settings' }}</good-heading-1>
3
+ <good-summary>{{ detail() ? 'Manage workspace details, team access, and availability.' : 'Choose a workspace to review and manage its settings.' }}</good-summary>
4
+ <good-action-group good-main-view-actions spacing="small">
5
+ @if (workspace()) {
6
+ @if (editing()) {
7
+ <good-button variant="outline" (click)="cancel()">Cancel</good-button>
8
+ <good-button (click)="save()">Save changes</good-button>
9
+ } @else { <good-button (click)="edit()">Edit settings</good-button> }
10
+ }
11
+ <good-button variant="ghost" (click)="sourceOpen.set(true)">View source</good-button>
12
+ </good-action-group>
13
+ <good-section><good-breadcrumbs [items]="breadcrumbs()" /></good-section>
14
+ @if (!detail()) {
15
+ <good-section layout="settings">
16
+ <good-heading-group><good-heading-2>Workspaces</good-heading-2><good-summary>Open a workspace to read its configuration before making changes.</good-summary></good-heading-group>
17
+ <good-input good-section-actions label="Search workspaces" type="search" size="small" placeholder="Search workspaces" [value]="query()" (valueChange)="query.set($event)" />
18
+ <good-table label="Workspaces" frameAppearance="none" density="compact" [reorderable]="false"
19
+ [data]="store.workspaces()" [columns]="columns" [getRowId]="rowId" [searchTerm]="query()">
20
+ <ng-template goodTableCell="name" let-row><good-link [route]="'/examples/settings/' + row.id">{{ row.name }}</good-link></ng-template>
21
+ </good-table>
22
+ <good-paragraph>Changes in this example are kept in memory for this session. Reloading restores the sample workspaces.</good-paragraph>
23
+ </good-section>
24
+ } @else if (workspace(); as current) {
25
+ @if (feedback()) { <good-section><good-paragraph role="status">{{ feedback() }}</good-paragraph></good-section> }
26
+ <good-section layout="settings">
27
+ <good-heading-group><good-heading-2>General</good-heading-2><good-summary>The name and region used to identify this workspace.</good-summary></good-heading-group>
28
+ @if (editing()) {
29
+ <form goodForm [fullWidth]="true" [formGroup]="form" (ngSubmit)="save()">
30
+ <good-form-row>
31
+ <good-form-field><good-field-label forId="workspace-name" [required]="true">Workspace name</good-field-label>
32
+ <good-input inputId="workspace-name" label="Workspace name" formControlName="name" [error]="form.controls.name.touched && form.controls.name.invalid" />
33
+ @if (form.controls.name.touched && form.controls.name.invalid) { <good-error-text>Enter a workspace name.</good-error-text> }
34
+ </good-form-field>
35
+ <good-form-field><good-field-label forId="workspace-region" [required]="true">Region</good-field-label>
36
+ <good-input inputId="workspace-region" label="Region" formControlName="region" [error]="form.controls.region.touched && form.controls.region.invalid" />
37
+ @if (form.controls.region.touched && form.controls.region.invalid) { <good-error-text>Enter a region.</good-error-text> }
38
+ </good-form-field>
39
+ </good-form-row>
40
+ </form>
41
+ } @else {
42
+ <good-detail-list><div goodDetailRow><dt>Workspace name</dt><dd>{{ current.name }}</dd></div><div goodDetailRow><dt>Region</dt><dd>{{ current.region }}</dd></div></good-detail-list>
43
+ }
44
+ </good-section>
45
+ <good-section layout="settings">
46
+ <good-heading-group><good-heading-2>Team access</good-heading-2><good-summary>Review the teams that can use this workspace.</good-summary></good-heading-group>
47
+ <good-action-group good-section-actions spacing="small">
48
+ <good-input label="Search teams" type="search" size="small" placeholder="Search teams" [value]="memberQuery()" (valueChange)="memberQuery.set($event)" />
49
+ @if (editing()) { <good-button size="small" variant="outline" (click)="addMember()">Add example team</good-button> }
50
+ </good-action-group>
51
+ <good-table label="Team access" frameAppearance="none" density="compact" [reorderable]="false"
52
+ [data]="displayedMembers()" [columns]="memberColumns" [getRowId]="rowId" [searchTerm]="memberQuery()" emptyMessage="No teams found">
53
+ <ng-template goodTableCell="actions" let-row>
54
+ @if (editing()) { <good-button size="small" variant="ghost" [ariaLabel]="'Remove ' + row.name" (click)="removeMember(row.id)">Remove</good-button> }
55
+ @else { <good-paragraph>—</good-paragraph> }
56
+ </ng-template>
57
+ </good-table>
58
+ </good-section>
59
+ <good-section layout="settings">
60
+ <good-heading-group><good-heading-2>Availability</good-heading-2><good-summary>Set the recurring windows for this workspace. Each end time must follow its start time.</good-summary></good-heading-group>
61
+ @if (editing()) { <good-button good-section-actions size="small" variant="outline" (click)="addRow()">Add window</good-button> }
62
+ @if (editing()) {
63
+ <form goodForm [fullWidth]="true" [formGroup]="form" (ngSubmit)="save()">
64
+ @for (row of form.controls.schedule.controls; track row; let index = $index) {
65
+ <good-group appearance="plain" [formGroup]="row">
66
+ <good-form-row [columns]="3">
67
+ <good-form-field><good-field-label [forId]="'day-' + row.controls.id.value">Day</good-field-label>
68
+ <good-input [inputId]="'day-' + row.controls.id.value" [label]="'Day ' + (index + 1)" formControlName="day" [error]="row.controls.day.touched && row.controls.day.invalid" />
69
+ @if (row.controls.day.touched && row.controls.day.invalid) { <good-error-text>Enter a day.</good-error-text> }
70
+ </good-form-field>
71
+ <good-form-field><good-field-label [forId]="'start-' + row.controls.id.value">From</good-field-label>
72
+ <good-input [inputId]="'start-' + row.controls.id.value" [label]="'From ' + (index + 1)" placeholder="HH:MM" formControlName="start" [error]="row.touched && row.invalid" />
73
+ </good-form-field>
74
+ <good-form-field><good-field-label [forId]="'end-' + row.controls.id.value">Until</good-field-label>
75
+ <good-input [inputId]="'end-' + row.controls.id.value" [label]="'Until ' + (index + 1)" placeholder="HH:MM" formControlName="end" [error]="row.touched && row.invalid" />
76
+ </good-form-field>
77
+ <good-button good-form-row-actions variant="ghost" [ariaLabel]="'Remove window ' + (index + 1)" (click)="removeRow(index)">Remove</good-button>
78
+ </good-form-row>
79
+ @if (row.touched && row.invalid) { <good-error-text>Enter a day and a valid start and end time. The end must be after the start.</good-error-text> }
80
+ </good-group>
81
+ } @empty { <good-paragraph>No availability windows. Add a window to get started.</good-paragraph> }
82
+ </form>
83
+ } @else {
84
+ <good-detail-list>
85
+ @for (row of current.schedule; track row.id) { <div goodDetailRow><dt>{{ row.day }}</dt><dd>{{ row.start }}–{{ row.end }}</dd></div> }
86
+ </good-detail-list>
87
+ @if (!current.schedule.length) { <good-paragraph>No availability windows configured.</good-paragraph> }
88
+ }
89
+ </good-section>
90
+ @if (!editing()) {
91
+ <good-section layout="settings" appearance="danger">
92
+ <good-heading-group><good-heading-2>Archive workspace</good-heading-2><good-summary>Remove this workspace from the active overview. Confirm its name before continuing.</good-summary></good-heading-group>
93
+ <good-button good-section-actions variant="outline" (click)="archiveName.set(''); archiveOpen.set(true)">Archive workspace</good-button>
94
+ </good-section>
95
+ }
96
+ } @else {
97
+ <good-section><good-alert tone="neutral" title="Workspace not found" message="This workspace is unavailable or has been archived." /><good-link route="/examples/settings">Back to settings</good-link></good-section>
98
+ }
99
+ </good-main-view>
100
+ <good-modal [(open)]="archiveOpen">
101
+ <good-modal-header title="Archive workspace" />
102
+ <good-group appearance="plain">
103
+ <good-paragraph>Enter {{ workspace()?.name }} to archive this workspace in the demo.</good-paragraph>
104
+ <good-input label="Workspace name to confirm" [value]="archiveName()" (valueChange)="archiveName.set($event)" />
105
+ <good-action-group><good-button variant="outline" (click)="archiveOpen.set(false)">Cancel</good-button><good-button variant="destructive" [disabled]="archiveName() !== workspace()?.name" (click)="archive()">Confirm archive</good-button></good-action-group>
106
+ </good-group>
107
+ </good-modal>
108
+ <good-modal [(open)]="sourceOpen" size="large" [scrollBody]="true">
109
+ <good-modal-header title="Settings example source" />
110
+ <good-code-block [code]="htmlSource" language="html" title="settings-page.html" />
111
+ <good-code-block [code]="typescriptSource" language="typescript" title="settings-page.ts" />
112
+ </good-modal>
@@ -0,0 +1,133 @@
1
+ import { ChangeDetectionStrategy, Component, Injectable, computed, effect, inject, signal } from '@angular/core';
2
+ import { toSignal } from '@angular/core/rxjs-interop';
3
+ import { AbstractControl, FormArray, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
4
+ import { ActivatedRoute, Router } from '@angular/router';
5
+ import {
6
+ GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent,
7
+ GoodCodeBlockComponent, GoodDetailListComponent, GoodDetailRowDirective, GoodErrorTextComponent,
8
+ GoodFieldLabelComponent, GoodFormDirective, GoodFormFieldComponent, GoodFormRowComponent,
9
+ GoodGroupComponent, GoodHeading1Component, GoodHeading2Component, GoodHeadingGroupComponent,
10
+ GoodInputComponent, GoodLinkComponent, GoodMainViewComponent, GoodModalComponent,
11
+ GoodModalHeaderComponent, GoodParagraphComponent, GoodSectionComponent, GoodSummaryComponent,
12
+ GoodTableCellDirective, GoodTableColumn, GoodTableComponent,
13
+ } from '@cloudfrogger/goodui';
14
+ import { settingsHtml, settingsTs } from './source-code.generated';
15
+
16
+ interface ScheduleRow { id: string; day: string; start: string; end: string }
17
+ interface Member { id: string; name: string; role: string }
18
+ interface Workspace { id: string; name: string; region: string; members: Member[]; schedule: ScheduleRow[] }
19
+
20
+ @Injectable({ providedIn: 'root' })
21
+ export class SettingsDemoStore {
22
+ readonly workspaces = signal<Workspace[]>([
23
+ { id: 'studio', name: 'Design studio', region: 'Europe', members: [
24
+ { id: 'team-1', name: 'Design team', role: 'Editor' }, { id: 'team-2', name: 'Review team', role: 'Viewer' },
25
+ ], schedule: [{ id: 'slot-1', day: 'Monday', start: '09:00', end: '17:00' }] },
26
+ { id: 'sandbox', name: 'Sandbox', region: 'North America', members: [], schedule: [] },
27
+ { id: 'research', name: 'Research lab', region: 'Europe', members: [], schedule: [] },
28
+ ]);
29
+ }
30
+
31
+ function scheduleGroup(row: ScheduleRow) {
32
+ return new FormGroup({
33
+ id: new FormControl(row.id, { nonNullable: true }),
34
+ day: new FormControl(row.day, { nonNullable: true, validators: [Validators.required] }),
35
+ start: new FormControl(row.start, { nonNullable: true, validators: [Validators.required, Validators.pattern(/^(?:[01]\d|2[0-3]):[0-5]\d$/)] }),
36
+ end: new FormControl(row.end, { nonNullable: true, validators: [Validators.required, Validators.pattern(/^(?:[01]\d|2[0-3]):[0-5]\d$/)] }),
37
+ }, { validators: (control: AbstractControl) => {
38
+ const { start, end } = control.value;
39
+ return start && end && start >= end ? { timeOrder: true } : null;
40
+ } });
41
+ }
42
+
43
+ @Component({
44
+ selector: 'example-settings-page', standalone: true,
45
+ changeDetection: ChangeDetectionStrategy.OnPush,
46
+ imports: [ReactiveFormsModule, GoodMainViewComponent, GoodHeading1Component, GoodSummaryComponent,
47
+ GoodSectionComponent, GoodHeadingGroupComponent, GoodHeading2Component, GoodActionGroupComponent,
48
+ GoodButtonComponent, GoodInputComponent, GoodLinkComponent, GoodTableComponent, GoodTableCellDirective,
49
+ GoodBreadcrumbsComponent, GoodDetailListComponent, GoodDetailRowDirective, GoodFormDirective,
50
+ GoodFormFieldComponent, GoodFieldLabelComponent, GoodFormRowComponent, GoodGroupComponent,
51
+ GoodErrorTextComponent, GoodParagraphComponent, GoodAlertComponent, GoodModalComponent,
52
+ GoodModalHeaderComponent, GoodCodeBlockComponent],
53
+ templateUrl: './settings-page.html',
54
+ })
55
+ export class SettingsPageComponent {
56
+ readonly store = inject(SettingsDemoStore);
57
+ private readonly router = inject(Router);
58
+ private readonly params = toSignal(inject(ActivatedRoute).paramMap);
59
+ readonly workspace = computed(() => this.store.workspaces().find(item => item.id === this.params()?.get('id')));
60
+ readonly detail = computed(() => !!this.params()?.get('id'));
61
+ readonly editing = signal(false);
62
+ readonly query = signal('');
63
+ readonly memberQuery = signal('');
64
+ readonly feedback = signal('');
65
+ readonly sourceOpen = signal(false);
66
+ readonly archiveOpen = signal(false);
67
+ readonly archiveName = signal('');
68
+ readonly htmlSource = settingsHtml;
69
+ readonly typescriptSource = settingsTs;
70
+ readonly draftMembers = signal<Member[]>([]);
71
+ readonly displayedMembers = computed(() => this.editing() ? this.draftMembers() : this.workspace()?.members ?? []);
72
+ readonly breadcrumbs = computed(() => [
73
+ { label: 'Settings', route: '/examples/settings' },
74
+ ...(this.detail() ? [{ label: this.workspace()?.name ?? 'Workspace not found' }] : []),
75
+ ]);
76
+ readonly form = new FormGroup({
77
+ name: new FormControl('', { nonNullable: true, validators: [Validators.required, Validators.pattern(/\S/)] }),
78
+ region: new FormControl('', { nonNullable: true, validators: [Validators.required, Validators.pattern(/\S/)] }),
79
+ schedule: new FormArray<ReturnType<typeof scheduleGroup>>([]),
80
+ });
81
+ readonly rowId = (row: { id: string }) => row.id;
82
+ readonly columns: GoodTableColumn<Workspace>[] = [
83
+ { accessorKey: 'name', header: 'Workspace', enableSorting: true },
84
+ { accessorKey: 'region', header: 'Region', meta: { visibleFrom: 'sm' } },
85
+ { id: 'members', header: 'Members', accessorFn: row => row.members.length, meta: { align: 'end' } },
86
+ ];
87
+ readonly memberColumns: GoodTableColumn<Member>[] = [
88
+ { accessorKey: 'name', header: 'Team', enableSorting: true },
89
+ { accessorKey: 'role', header: 'Access', meta: { visibleFrom: 'sm' } },
90
+ { id: 'actions', header: 'Actions', meta: { align: 'end' }, enableGlobalFilter: false },
91
+ ];
92
+ private nextId = 0;
93
+
94
+ constructor() {
95
+ effect(() => { this.params(); this.editing.set(false); this.feedback.set(''); this.archiveOpen.set(false); });
96
+ }
97
+ open(id: string): void { void this.router.navigate(['/examples/settings', id]); }
98
+ edit(): void {
99
+ const workspace = this.workspace();
100
+ if (!workspace) return;
101
+ this.form.reset({ name: workspace.name, region: workspace.region });
102
+ this.form.controls.schedule.clear();
103
+ workspace.schedule.forEach(row => this.form.controls.schedule.push(scheduleGroup(row)));
104
+ this.draftMembers.set(workspace.members.map(member => ({ ...member })));
105
+ this.feedback.set(''); this.editing.set(true);
106
+ }
107
+ cancel(): void { this.editing.set(false); this.feedback.set('Changes discarded.'); }
108
+ addRow(): void {
109
+ this.form.controls.schedule.push(scheduleGroup({ id: `new-slot-${++this.nextId}`, day: '', start: '09:00', end: '17:00' }));
110
+ }
111
+ removeRow(index: number): void { this.form.controls.schedule.removeAt(index); }
112
+ addMember(): void {
113
+ this.draftMembers.update(members => [...members, { id: `new-team-${++this.nextId}`, name: 'Example team', role: 'Viewer' }]);
114
+ }
115
+ removeMember(id: string): void { this.draftMembers.update(members => members.filter(member => member.id !== id)); }
116
+ save(): void {
117
+ this.form.markAllAsTouched();
118
+ if (this.form.invalid) { this.feedback.set('Check the highlighted fields before saving.'); return; }
119
+ const workspace = this.workspace();
120
+ if (!workspace) return;
121
+ const values = this.form.getRawValue();
122
+ this.store.workspaces.update(items => items.map(item => item.id === workspace.id
123
+ ? { ...item, ...values, name: values.name.trim(), region: values.region.trim(), members: this.draftMembers() } : item));
124
+ this.editing.set(false); this.feedback.set('Workspace settings saved for this demo session.');
125
+ }
126
+ archive(): void {
127
+ const workspace = this.workspace();
128
+ if (!workspace || this.archiveName() !== workspace.name) return;
129
+ this.store.workspaces.update(items => items.filter(item => item.id !== workspace.id));
130
+ this.archiveOpen.set(false);
131
+ void this.router.navigate(['/examples/settings']);
132
+ }
133
+ }
@@ -0,0 +1,3 @@
1
+ // Generated from the editable example files. Run npm run examples:sync after changing them.
2
+ export const settingsHtml = "<good-main-view>\n <good-heading-1>{{ detail() ? (workspace()?.name ?? 'Workspace not found') : 'Settings' }}</good-heading-1>\n <good-summary>{{ detail() ? 'Manage workspace details, team access, and availability.' : 'Choose a workspace to review and manage its settings.' }}</good-summary>\n <good-action-group good-main-view-actions spacing=\"small\">\n @if (workspace()) {\n @if (editing()) {\n <good-button variant=\"outline\" (click)=\"cancel()\">Cancel</good-button>\n <good-button (click)=\"save()\">Save changes</good-button>\n } @else { <good-button (click)=\"edit()\">Edit settings</good-button> }\n }\n <good-button variant=\"ghost\" (click)=\"sourceOpen.set(true)\">View source</good-button>\n </good-action-group>\n <good-section><good-breadcrumbs [items]=\"breadcrumbs()\" /></good-section>\n @if (!detail()) {\n <good-section layout=\"settings\">\n <good-heading-group><good-heading-2>Workspaces</good-heading-2><good-summary>Open a workspace to read its configuration before making changes.</good-summary></good-heading-group>\n <good-input good-section-actions label=\"Search workspaces\" type=\"search\" size=\"small\" placeholder=\"Search workspaces\" [value]=\"query()\" (valueChange)=\"query.set($event)\" />\n <good-table label=\"Workspaces\" frameAppearance=\"none\" density=\"compact\" [reorderable]=\"false\"\n [data]=\"store.workspaces()\" [columns]=\"columns\" [getRowId]=\"rowId\" [searchTerm]=\"query()\">\n <ng-template goodTableCell=\"name\" let-row><good-link [route]=\"'/examples/settings/' + row.id\">{{ row.name }}</good-link></ng-template>\n </good-table>\n <good-paragraph>Changes in this example are kept in memory for this session. Reloading restores the sample workspaces.</good-paragraph>\n </good-section>\n } @else if (workspace(); as current) {\n @if (feedback()) { <good-section><good-paragraph role=\"status\">{{ feedback() }}</good-paragraph></good-section> }\n <good-section layout=\"settings\">\n <good-heading-group><good-heading-2>General</good-heading-2><good-summary>The name and region used to identify this workspace.</good-summary></good-heading-group>\n @if (editing()) {\n <form goodForm [fullWidth]=\"true\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\n <good-form-row>\n <good-form-field><good-field-label forId=\"workspace-name\" [required]=\"true\">Workspace name</good-field-label>\n <good-input inputId=\"workspace-name\" label=\"Workspace name\" formControlName=\"name\" [error]=\"form.controls.name.touched && form.controls.name.invalid\" />\n @if (form.controls.name.touched && form.controls.name.invalid) { <good-error-text>Enter a workspace name.</good-error-text> }\n </good-form-field>\n <good-form-field><good-field-label forId=\"workspace-region\" [required]=\"true\">Region</good-field-label>\n <good-input inputId=\"workspace-region\" label=\"Region\" formControlName=\"region\" [error]=\"form.controls.region.touched && form.controls.region.invalid\" />\n @if (form.controls.region.touched && form.controls.region.invalid) { <good-error-text>Enter a region.</good-error-text> }\n </good-form-field>\n </good-form-row>\n </form>\n } @else {\n <good-detail-list><div goodDetailRow><dt>Workspace name</dt><dd>{{ current.name }}</dd></div><div goodDetailRow><dt>Region</dt><dd>{{ current.region }}</dd></div></good-detail-list>\n }\n </good-section>\n <good-section layout=\"settings\">\n <good-heading-group><good-heading-2>Team access</good-heading-2><good-summary>Review the teams that can use this workspace.</good-summary></good-heading-group>\n <good-action-group good-section-actions spacing=\"small\">\n <good-input label=\"Search teams\" type=\"search\" size=\"small\" placeholder=\"Search teams\" [value]=\"memberQuery()\" (valueChange)=\"memberQuery.set($event)\" />\n @if (editing()) { <good-button size=\"small\" variant=\"outline\" (click)=\"addMember()\">Add example team</good-button> }\n </good-action-group>\n <good-table label=\"Team access\" frameAppearance=\"none\" density=\"compact\" [reorderable]=\"false\"\n [data]=\"displayedMembers()\" [columns]=\"memberColumns\" [getRowId]=\"rowId\" [searchTerm]=\"memberQuery()\" emptyMessage=\"No teams found\">\n <ng-template goodTableCell=\"actions\" let-row>\n @if (editing()) { <good-button size=\"small\" variant=\"ghost\" [ariaLabel]=\"'Remove ' + row.name\" (click)=\"removeMember(row.id)\">Remove</good-button> }\n @else { <good-paragraph>—</good-paragraph> }\n </ng-template>\n </good-table>\n </good-section>\n <good-section layout=\"settings\">\n <good-heading-group><good-heading-2>Availability</good-heading-2><good-summary>Set the recurring windows for this workspace. Each end time must follow its start time.</good-summary></good-heading-group>\n @if (editing()) { <good-button good-section-actions size=\"small\" variant=\"outline\" (click)=\"addRow()\">Add window</good-button> }\n @if (editing()) {\n <form goodForm [fullWidth]=\"true\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\n @for (row of form.controls.schedule.controls; track row; let index = $index) {\n <good-group appearance=\"plain\" [formGroup]=\"row\">\n <good-form-row [columns]=\"3\">\n <good-form-field><good-field-label [forId]=\"'day-' + row.controls.id.value\">Day</good-field-label>\n <good-input [inputId]=\"'day-' + row.controls.id.value\" [label]=\"'Day ' + (index + 1)\" formControlName=\"day\" [error]=\"row.controls.day.touched && row.controls.day.invalid\" />\n @if (row.controls.day.touched && row.controls.day.invalid) { <good-error-text>Enter a day.</good-error-text> }\n </good-form-field>\n <good-form-field><good-field-label [forId]=\"'start-' + row.controls.id.value\">From</good-field-label>\n <good-input [inputId]=\"'start-' + row.controls.id.value\" [label]=\"'From ' + (index + 1)\" placeholder=\"HH:MM\" formControlName=\"start\" [error]=\"row.touched && row.invalid\" />\n </good-form-field>\n <good-form-field><good-field-label [forId]=\"'end-' + row.controls.id.value\">Until</good-field-label>\n <good-input [inputId]=\"'end-' + row.controls.id.value\" [label]=\"'Until ' + (index + 1)\" placeholder=\"HH:MM\" formControlName=\"end\" [error]=\"row.touched && row.invalid\" />\n </good-form-field>\n <good-button good-form-row-actions variant=\"ghost\" [ariaLabel]=\"'Remove window ' + (index + 1)\" (click)=\"removeRow(index)\">Remove</good-button>\n </good-form-row>\n @if (row.touched && row.invalid) { <good-error-text>Enter a day and a valid start and end time. The end must be after the start.</good-error-text> }\n </good-group>\n } @empty { <good-paragraph>No availability windows. Add a window to get started.</good-paragraph> }\n </form>\n } @else {\n <good-detail-list>\n @for (row of current.schedule; track row.id) { <div goodDetailRow><dt>{{ row.day }}</dt><dd>{{ row.start }}–{{ row.end }}</dd></div> }\n </good-detail-list>\n @if (!current.schedule.length) { <good-paragraph>No availability windows configured.</good-paragraph> }\n }\n </good-section>\n @if (!editing()) {\n <good-section layout=\"settings\" appearance=\"danger\">\n <good-heading-group><good-heading-2>Archive workspace</good-heading-2><good-summary>Remove this workspace from the active overview. Confirm its name before continuing.</good-summary></good-heading-group>\n <good-button good-section-actions variant=\"outline\" (click)=\"archiveName.set(''); archiveOpen.set(true)\">Archive workspace</good-button>\n </good-section>\n }\n } @else {\n <good-section><good-alert tone=\"neutral\" title=\"Workspace not found\" message=\"This workspace is unavailable or has been archived.\" /><good-link route=\"/examples/settings\">Back to settings</good-link></good-section>\n }\n</good-main-view>\n<good-modal [(open)]=\"archiveOpen\">\n <good-modal-header title=\"Archive workspace\" />\n <good-group appearance=\"plain\">\n <good-paragraph>Enter {{ workspace()?.name }} to archive this workspace in the demo.</good-paragraph>\n <good-input label=\"Workspace name to confirm\" [value]=\"archiveName()\" (valueChange)=\"archiveName.set($event)\" />\n <good-action-group><good-button variant=\"outline\" (click)=\"archiveOpen.set(false)\">Cancel</good-button><good-button variant=\"destructive\" [disabled]=\"archiveName() !== workspace()?.name\" (click)=\"archive()\">Confirm archive</good-button></good-action-group>\n </good-group>\n</good-modal>\n<good-modal [(open)]=\"sourceOpen\" size=\"large\" [scrollBody]=\"true\">\n <good-modal-header title=\"Settings example source\" />\n <good-code-block [code]=\"htmlSource\" language=\"html\" title=\"settings-page.html\" />\n <good-code-block [code]=\"typescriptSource\" language=\"typescript\" title=\"settings-page.ts\" />\n</good-modal>\n";
3
+ export const settingsTs = "import { ChangeDetectionStrategy, Component, Injectable, computed, effect, inject, signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { AbstractControl, FormArray, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport {\n GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent,\n GoodCodeBlockComponent, GoodDetailListComponent, GoodDetailRowDirective, GoodErrorTextComponent,\n GoodFieldLabelComponent, GoodFormDirective, GoodFormFieldComponent, GoodFormRowComponent,\n GoodGroupComponent, GoodHeading1Component, GoodHeading2Component, GoodHeadingGroupComponent,\n GoodInputComponent, GoodLinkComponent, GoodMainViewComponent, GoodModalComponent,\n GoodModalHeaderComponent, GoodParagraphComponent, GoodSectionComponent, GoodSummaryComponent,\n GoodTableCellDirective, GoodTableColumn, GoodTableComponent,\n} from '@cloudfrogger/goodui';\nimport { settingsHtml, settingsTs } from './source-code.generated';\n\ninterface ScheduleRow { id: string; day: string; start: string; end: string }\ninterface Member { id: string; name: string; role: string }\ninterface Workspace { id: string; name: string; region: string; members: Member[]; schedule: ScheduleRow[] }\n\n@Injectable({ providedIn: 'root' })\nexport class SettingsDemoStore {\n readonly workspaces = signal<Workspace[]>([\n { id: 'studio', name: 'Design studio', region: 'Europe', members: [\n { id: 'team-1', name: 'Design team', role: 'Editor' }, { id: 'team-2', name: 'Review team', role: 'Viewer' },\n ], schedule: [{ id: 'slot-1', day: 'Monday', start: '09:00', end: '17:00' }] },\n { id: 'sandbox', name: 'Sandbox', region: 'North America', members: [], schedule: [] },\n { id: 'research', name: 'Research lab', region: 'Europe', members: [], schedule: [] },\n ]);\n}\n\nfunction scheduleGroup(row: ScheduleRow) {\n return new FormGroup({\n id: new FormControl(row.id, { nonNullable: true }),\n day: new FormControl(row.day, { nonNullable: true, validators: [Validators.required] }),\n start: new FormControl(row.start, { nonNullable: true, validators: [Validators.required, Validators.pattern(/^(?:[01]\\d|2[0-3]):[0-5]\\d$/)] }),\n end: new FormControl(row.end, { nonNullable: true, validators: [Validators.required, Validators.pattern(/^(?:[01]\\d|2[0-3]):[0-5]\\d$/)] }),\n }, { validators: (control: AbstractControl) => {\n const { start, end } = control.value;\n return start && end && start >= end ? { timeOrder: true } : null;\n } });\n}\n\n@Component({\n selector: 'example-settings-page', standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ReactiveFormsModule, GoodMainViewComponent, GoodHeading1Component, GoodSummaryComponent,\n GoodSectionComponent, GoodHeadingGroupComponent, GoodHeading2Component, GoodActionGroupComponent,\n GoodButtonComponent, GoodInputComponent, GoodLinkComponent, GoodTableComponent, GoodTableCellDirective,\n GoodBreadcrumbsComponent, GoodDetailListComponent, GoodDetailRowDirective, GoodFormDirective,\n GoodFormFieldComponent, GoodFieldLabelComponent, GoodFormRowComponent, GoodGroupComponent,\n GoodErrorTextComponent, GoodParagraphComponent, GoodAlertComponent, GoodModalComponent,\n GoodModalHeaderComponent, GoodCodeBlockComponent],\n templateUrl: './settings-page.html',\n})\nexport class SettingsPageComponent {\n readonly store = inject(SettingsDemoStore);\n private readonly router = inject(Router);\n private readonly params = toSignal(inject(ActivatedRoute).paramMap);\n readonly workspace = computed(() => this.store.workspaces().find(item => item.id === this.params()?.get('id')));\n readonly detail = computed(() => !!this.params()?.get('id'));\n readonly editing = signal(false);\n readonly query = signal('');\n readonly memberQuery = signal('');\n readonly feedback = signal('');\n readonly sourceOpen = signal(false);\n readonly archiveOpen = signal(false);\n readonly archiveName = signal('');\n readonly htmlSource = settingsHtml;\n readonly typescriptSource = settingsTs;\n readonly draftMembers = signal<Member[]>([]);\n readonly displayedMembers = computed(() => this.editing() ? this.draftMembers() : this.workspace()?.members ?? []);\n readonly breadcrumbs = computed(() => [\n { label: 'Settings', route: '/examples/settings' },\n ...(this.detail() ? [{ label: this.workspace()?.name ?? 'Workspace not found' }] : []),\n ]);\n readonly form = new FormGroup({\n name: new FormControl('', { nonNullable: true, validators: [Validators.required, Validators.pattern(/\\S/)] }),\n region: new FormControl('', { nonNullable: true, validators: [Validators.required, Validators.pattern(/\\S/)] }),\n schedule: new FormArray<ReturnType<typeof scheduleGroup>>([]),\n });\n readonly rowId = (row: { id: string }) => row.id;\n readonly columns: GoodTableColumn<Workspace>[] = [\n { accessorKey: 'name', header: 'Workspace', enableSorting: true },\n { accessorKey: 'region', header: 'Region', meta: { visibleFrom: 'sm' } },\n { id: 'members', header: 'Members', accessorFn: row => row.members.length, meta: { align: 'end' } },\n ];\n readonly memberColumns: GoodTableColumn<Member>[] = [\n { accessorKey: 'name', header: 'Team', enableSorting: true },\n { accessorKey: 'role', header: 'Access', meta: { visibleFrom: 'sm' } },\n { id: 'actions', header: 'Actions', meta: { align: 'end' }, enableGlobalFilter: false },\n ];\n private nextId = 0;\n\n constructor() {\n effect(() => { this.params(); this.editing.set(false); this.feedback.set(''); this.archiveOpen.set(false); });\n }\n open(id: string): void { void this.router.navigate(['/examples/settings', id]); }\n edit(): void {\n const workspace = this.workspace();\n if (!workspace) return;\n this.form.reset({ name: workspace.name, region: workspace.region });\n this.form.controls.schedule.clear();\n workspace.schedule.forEach(row => this.form.controls.schedule.push(scheduleGroup(row)));\n this.draftMembers.set(workspace.members.map(member => ({ ...member })));\n this.feedback.set(''); this.editing.set(true);\n }\n cancel(): void { this.editing.set(false); this.feedback.set('Changes discarded.'); }\n addRow(): void {\n this.form.controls.schedule.push(scheduleGroup({ id: `new-slot-${++this.nextId}`, day: '', start: '09:00', end: '17:00' }));\n }\n removeRow(index: number): void { this.form.controls.schedule.removeAt(index); }\n addMember(): void {\n this.draftMembers.update(members => [...members, { id: `new-team-${++this.nextId}`, name: 'Example team', role: 'Viewer' }]);\n }\n removeMember(id: string): void { this.draftMembers.update(members => members.filter(member => member.id !== id)); }\n save(): void {\n this.form.markAllAsTouched();\n if (this.form.invalid) { this.feedback.set('Check the highlighted fields before saving.'); return; }\n const workspace = this.workspace();\n if (!workspace) return;\n const values = this.form.getRawValue();\n this.store.workspaces.update(items => items.map(item => item.id === workspace.id\n ? { ...item, ...values, name: values.name.trim(), region: values.region.trim(), members: this.draftMembers() } : item));\n this.editing.set(false); this.feedback.set('Workspace settings saved for this demo session.');\n }\n archive(): void {\n const workspace = this.workspace();\n if (!workspace || this.archiveName() !== workspace.name) return;\n this.store.workspaces.update(items => items.filter(item => item.id !== workspace.id));\n this.archiveOpen.set(false);\n void this.router.navigate(['/examples/settings']);\n }\n}\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudfrogger/goodui",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -35,5 +35,5 @@
35
35
  "module": "fesm2022/cloudfrogger-goodui.mjs",
36
36
  "typings": "types/cloudfrogger-goodui.d.ts",
37
37
  "type": "module",
38
- "gitHead": "5d1926a175234b41707fd1cda6509178eec00ec2"
38
+ "gitHead": "ebaa8e262b306a488b0d3793428b4a1b0fa0ca33"
39
39
  }