diff --git a/user-guide/app-patterns.html b/user-guide/app-patterns.html new file mode 100644 index 0000000..15756e2 --- /dev/null +++ b/user-guide/app-patterns.html @@ -0,0 +1,2260 @@ + + + + + App Patterns · Decorator Kit Developer Guide + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to main content +
+
+
+
+ +
+ +
+
+ + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+
+ +

App Patterns

+ +

Common app interface pieces built from Bootstrap 3.3.7, the + version cdn.ucsd.edu serves: tabs, side menus, toolbars and item bars, action + menus, lists, pagination, dialogs, and responsive helpers. Each one has a live preview and + a prompt you can copy. Further down: dashboard building blocks, seven complete app shells, + and eight starter dashboards for campus areas.

+ +
+ + + +
+

Read the tags first

+

Bootstrap loads on every Decorator page, but the Decorator restyles only part of it. + Each pattern carries one of these tags:

+
    +
  • Decorator-styled The + Decorator stylesheet already styles it. Use the markup as is.
  • +
  • Neutral Layout, gray borders, + and link color only. Safe to use as is.
  • +
  • Brand layer Stock Bootstrap would + paint it #337ab7 blue. Add the matching block from + css/app-patterns.css, which + re-colors it to the Decorator palette in the canvas only.
  • +
  • Bootstrap docs Not in the + Decorator package. The markup comes from Bootstrap v3.3.7's own documentation + source (twbs/bootstrap, tag v3.3.7, + docs/_includes/).
  • +
+ +
+
+

Add the brand layer to a project

+

Run this once before you use any pattern tagged Brand layer.

+
+
+
+

Prompt

+ +
+
Add css/app-patterns.css to the project, copied from the Decorator Kit Developer Guide, and link it in the "site-specific CSS" block of each page that uses app patterns. Every rule must stay scoped under main#main-content plus an app-* class. Key active states on aria-current, aria-expanded, or :checked. Never target .active, .nav, .dropdown-menu, .btn-default, or any other class the header, navbar, or drawer uses.
+
+
+

Back to page index

+
+ + + + + +
+

Action bars and menus

+ + +
+
+

Toolbar and item bar

+

A bar of grouped actions above a list or table. On the left: a selection count + and bulk actions. On the right: an in-app search. Icon-only buttons need an + aria-label.

+

Brand layerDropdown: Decorator-styled

+

.btn-toolbar.app-toolbarrole="toolbar".btn-group.btn.app-tool.input-group

+
+
+ Live preview + +
+
+
+

Prompt

+ +
+
Above the [requests table], add an item bar: div.btn-toolbar.app-toolbar with role="toolbar" and aria-label="[Request actions]". Contents, in order:
+1. span.app-toolbar-count showing "[n] selected". Update it from js/[app].js and announce changes in an aria-live region.
+2. A .btn-group of button.btn.app-tool: [Approve, Archive, Delete]. Icon-only buttons get aria-label.
+3. A "More" dropdown (btn-group + dropdown-toggle + ul.dropdown-menu, following kitchen-sink/button_dropdowns.html) with [Export as CSV, Assign to…, Mark all as read].
+4. A right-aligned form.app-toolbar-search with role="search": an .sr-only label, an input-group with input.app-search-input, and an icon submit button.
+Include the toolbar block from css/app-patterns.css. Glyphicons only. This search filters the app, not the site. Leave the chrome search forms alone.
+
+

Sources: dist/kitchen-sink/icons.html (btn-toolbar), dist/kitchen-sink/button_dropdowns.html, dist/kitchen-sink/input_groups.html

+
+ + +
+
+

Action menu (dropdown)

+

A compact menu of actions for one item or one page. The Decorator styles + .dropdown-menu in navy with white links.

+

Decorator-styled

+

.btn-group.btn.btn-primary.dropdown-toggledata-toggle="dropdown"ul.dropdown-menuli.divider

+
+
+ Live preview + +
+
+
+

Prompt

+ +
+
Add a "[New request]" dropdown button using the single-button dropdown from kitchen-sink/button_dropdowns.html, with btn-primary (not btn-success or others). Add aria-haspopup="true" and aria-expanded="false" to the toggle. Menu items: [..], then a li.divider with role="separator", then [..]. Don't add CSS for .dropdown-menu — the Decorator already styles it.
+
+

Source: dist/kitchen-sink/button_dropdowns.html

+
+

Back to page index

+
+ + +
+

Lists and paging

+ + +
+
+

Item list

+

Clickable rows with a title, a summary line, and a count or status. For + inboxes, queues, and search results.

+

Brand layerBootstrap docs · list-group

+

.list-group.app-lista.list-group-item.list-group-item-heading.list-group-item-text.badge

+
+ +
+
+

Prompt

+ +
+
Render [requests] as a linked list group: div.list-group.app-list with one a.list-group-item per item, each holding h4.list-group-item-heading "[id · title]", p.list-group-item-text "[unit · date · status]", and an optional span.badge for unread counts. State status in words — don't use list-group-item-success/-info/-warning/-danger. Include the list and badge blocks from css/app-patterns.css. Escape all data before inserting it.
+
+
+ + +
+
+

Media list (people, comments, activity)

+

An image or avatar beside a text block. For comment threads, activity feeds, + and people pickers.

+

NeutralBootstrap docs · media

+

.media.app-media.media-leftimg.media-object.img-circle.media-body.media-heading

+
+
+ Live preview +
    +
  • +
    + +
    +
    +

    Jordan Lee

    +

    Facilities · 2 hours ago

    +

    Plumber scheduled for tomorrow morning. The area is roped off.

    +
    +
  • +
  • +
    + +
    +
    +

    Sam Rivera

    +

    Requester · Yesterday

    +

    Thanks! The sink on the 3rd floor has the same problem.

    +
    +
  • +
+
+
+
+

Prompt

+ +
+
Show the [comment thread] as a Bootstrap 3 media list (the markup from the Bootstrap docs' media example): ul.media-list with one li.media.app-media per entry, containing .media-left > img.media-object.img-circle (64 × 64, alt="" because the name is next to it) and .media-body with h4.media-heading [name], p.app-media-meta [role · time], and the text. Include the media block from css/app-patterns.css. Escape user text before rendering it.
+
+
+ + +
+
+

Pagination

+

Page through long lists. Stock Bootstrap paints the current page #337ab7 and + the links are only 34px tall. The brand layer re-colors them and makes each + link a 44 × 44 touch target.

+

Brand layer

+

nav[aria-label]ul.pagination.app-paginationaria-current="page"

+
+
+ Live preview + +
+
+
+

Prompt

+ +
+
Add pagination under the [list] following kitchen-sink/pagination.html: nav aria-label="[Request pages]" > ul.pagination.app-pagination. Mark the current page with aria-current="page" on its link, not li.active. The previous/next links get aria-label ("Previous page", "Next page") with aria-hidden arrows. Include the pagination block from css/app-patterns.css.
+
+

Source: dist/kitchen-sink/pagination.html

+
+

Back to page index

+
+ + +
+

Dialogs and disclosure

+ + +
+
+

Modal dialog

+

A confirmation or short form that needs a decision before the user continues. + modal.js handles focus, the Esc key, and the backdrop. Keep the + modal markup inside the canvas.

+

NeutralBrand layer: headerBootstrap docs · js/modal

+

data-toggle="modal".modal.fade.app-modalrole="dialog"aria-labelledby.modal-dialog.modal-content

+
+
+ Live preview + +
+
+
+

Prompt

+ +
+ +
+
+ + +
+
+

Expand and collapse

+

For FAQs and grouped details, use the Decorator drawer, which + base.min.js already runs. Use Bootstrap's panel-group accordion + only when you need its events.

+

Decorator-styled

+

.drawer-wrapper.drawer

+
+
+
+

Prompt

+ +
+
For the expandable [details] section, use the Decorator drawer (.drawer-wrapper > .drawer with h2 > a / div pairs, from templates/modules.html), not a Bootstrap panel-group accordion.
+
+
+

Back to page index

+
+ + +
+

Helpers and responsive utilities

+ +
+
+

Responsive utilities

+

Show or hide content by breakpoint. Resize the window to see which chip + shows. Bootstrap 3 breakpoints: xs <768px, sm ≥768px, md ≥992px, + lg ≥1200px.

+

NeutralBootstrap docs · responsive-utilities

+

.visible-xs-inline-block.hidden-xs.visible-md-block.hidden-print

+
+
+ Live preview +

+ You're on xs (phone) + You're on sm (tablet) + You're on md (laptop) + You're on lg (desktop) +

+
+
+
+

Prompt

+ +
+
On phones (xs), hide the [toolbar's text labels] with .hidden-xs and keep the icons. Every icon-only button needs an aria-label. Use Bootstrap 3 responsive utilities (visible-*-block/-inline/-inline-block, hidden-*). Don't write media queries for what these classes already do.
+
+
+ +
+
+

Helper class reference

+

Colorless Bootstrap helpers that are safe anywhere in the canvas, plus the + ones to avoid.

+
+
+
+ + + + + + + + + + + + + + + + +
Bootstrap 3.3.7 helper classes
ClassUse it forStatus
.sr-only, .sr-only-focusableText for screen readers only, such as labels for icon buttons and hidden form labelsSafe
.pull-left, .pull-right, .clearfixFloating a small element and clearing itSafe (not on the two-column split)
.center-block, .text-left/-center/-rightCentering blocks and aligning textSafe
.list-unstyled, .list-inlineRemoving bullets and inline link rowsSafe
.img-responsive, .img-rounded, .img-circleFluid images and avatarsSafe
.embed-responsive.embed-responsive-16by9A true 16:9 video box inside an app. Modules use .embed-videoSafe
.visible-*, .hidden-*, .hidden-printShowing and hiding by breakpoint, and for printSafe
.text-muted, .smallSecondary text (gray #777)Neutral. Check contrast
.text-*/.bg-* with -success/-info/-warning/-danger—Avoid: stock Bootstrap colors
.label-*, .progress-bar, .nav-pills active—Avoid, or add a canvas brand layer
title="" tooltips (tooltip.js)—Avoid: unreachable by keyboard and touch. Use visible help text
+
+
+
+
+

Prompt

+ +
+
Prefer Bootstrap 3.3.7 helper classes (sr-only, text-center, pull-*, clearfix, list-inline, img-circle, embed-responsive, visible-*/hidden-*) over new CSS. Don't use any -success/-info/-warning/-danger class, .label-*, .progress-bar, or title-attribute tooltips. Replace tooltips with a visible .help-block.
+
+
+

Back to page index

+
+ + +
+

Dashboard building blocks

+

Six small pieces that almost every dashboard reuses. None needs a charting library. + Each one shows its value as text, so it works without color and with a screen reader. + The styles live in css/app-patterns.css.

+ + +
+
+

Key number with trend

+

A headline number, what it measures, and how it changed. The arrow is decorative. + The words "up" and "down" carry the meaning.

+

div.styledBrand layer

+

div.styled.app-stat.app-stat-value.app-stat-label.app-trend

+
+
+ Live preview +
+
+
+ 1,284 + Tickets this month + Up 6% from August +
+
+
+
+ 3.1h + Median first response + Down 20 min (better) +
+
+
+
+ 94% + Satisfaction + No change +
+
+
+
+
+
+

Prompt

+ +
+
Add a row of [3] key numbers: .col-sm-4 columns, each a div.styled.app-stat with span.app-stat-value, span.app-stat-label, and span.app-trend. The trend is a Glyphicon arrow (aria-hidden) plus words: "Up 6% from August", "Down 20 min (better)", or "No change". Never show a trend by color alone. Include the KPI block from css/app-patterns.css.
+
+
+ + +
+
+

Data bars

+

A labeled horizontal bar for comparing a few values: fill rate, occupancy, budget + used. The number is printed beside every bar, and the bar itself is hidden from + screen readers. For more than about 10 rows, or real charts, use a table or a + charting library from canvas-components/.

+

Brand layer

+

ul.app-bars.app-bar-label.app-bar-track.app-bar-fill.app-w-[0–100].app-bar-value

+
+
+ Live preview +
+

Residence hall occupancy

+
    +
  • Revelle96%
  • +
  • Muir91%
  • +
  • Sixth77%
  • +
  • Seventh52%
  • +
+
+
+
+
+

Prompt

+ +
+
Show [occupancy by college] as data bars: a div.app-panel with p.app-panel-title, then ul.app-bars labelled by that title. Each li holds span.app-bar-label, span.app-bar-track (aria-hidden="true") containing span.app-bar-fill with the nearest 5% width class (app-w-0 … app-w-100), and span.app-bar-value with the exact number. Use .app-bar-attn to highlight a row, but say why in text too. No inline style widths — set the class from JS.
+
+
+ + +
+
+

Status list

+

A list of named things, each with a status badge. Four states use only Decorator + colors, and every state is spelled out in words.

+

Brand layerlist-group

+

.list-group.app-status-listspan.app-status[data-status="ok|warn|down|info"]

+
+
+ Live preview +
    +
  • Canvas LMS Operational
  • +
  • UCSD-PROTECTED Wi-Fi DegradedSlow connections in Geisel. Engineers are on site.
  • +
  • Print stations Outage
  • +
  • VPN Maintenance Sat 6 a.m.
  • +
+
+
+
+

Prompt

+ +
+
List [services] as ul.list-group.app-status-list. Each li.list-group-item has span.app-status-name, a span.app-status with data-status set to ok, warn, down, or info (a Glyphicon plus the words "Operational", "Degraded", "Outage", or "Maintenance [when]"), and an optional span.app-muted detail line. Don't use label-*, list-group-item-success/-warning/-danger, or any other Bootstrap contextual class.
+
+
+ + +
+
+

Deadline timeline

+

What's coming up, in date order. Urgent items get a gold marker plus the word + "urgent" for screen readers.

+

Brand layer

+

ol.app-timelineli[data-urgent].app-timeline-date.app-timeline-title

+
+
+ Live preview +
    +
  1. · 3 days (urgent)NIH R01 submissionDept. of Bioengineering · PI: Chen
  2. +
  3. · 2 weeksNSF CAREER internal reviewOffice of Research Affairs
  4. +
  5. · 5 weeksQuarterly effort certificationAll sponsored projects
  6. +
+
+
+
+

Prompt

+ +
+
Show upcoming [deadlines] as ol.app-timeline in date order. Each li has span.app-timeline-date (a <time datetime> plus "· [time remaining]"), span.app-timeline-title, and span.app-muted context. Items due within [7] days get data-urgent and an .sr-only "(urgent)". Compute the time remaining in js/[app].js from the datetime values.
+
+
+ + +
+
+

Checklist progress

+

A read-only list of steps with a summary line and a data bar. For onboarding, + closeouts, and move-in. Use real checkboxes if people check items off on this + screen.

+

Brand layer

+

ul.app-checklistli[data-done]ul.app-bars

+
+
+ Live preview +
+

Onboarding: Alex Kim, Programmer Analyst

+
    +
  • 3 of 5 done60%
  • +
+
    +
  • Offer letter signed (done)
  • +
  • Background check cleared (done)
  • +
  • Active Directory account (done)
  • +
  • Cyber-security training (to do)
  • +
  • Parking permit (to do)
  • +
+
+
+
+
+

Prompt

+ +
+
Show [onboarding] progress in a div.app-panel: p.app-panel-title "[person, role]", a one-row ul.app-bars "[n] of [total] done", then ul.app-checklist. Done items get data-done, a glyphicon-check, and an .sr-only "(done)". Open items get glyphicon-unchecked and "(to do)". If people check steps off on this screen, use real labeled checkboxes instead.
+
+
+ + +
+
+

Filter bar

+

Scopes the whole dashboard: term, unit, date range. Labels stay visible, and every + control is at least 44px tall.

+

FormsBrand layer

+

form.app-filterbar.form-group.form-control.app-filter-control

+
+
+ Live preview +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+

Prompt

+ +
+
Add a filter bar at the top of the dashboard: form.app-filterbar with aria-label="Dashboard filters". Each control is a .form-group with a visible label and a .form-control.app-filter-control: [Term select, College select, From date, To date], then a btn-primary "Apply". Keep the filters in the URL query string so views can be bookmarked, but never put personal data in it. Update the page from js/[app].js and announce "Showing [scope]" in an aria-live region.
+
+
+ +

Back to page index

+
+ + +
+

Putting it together: app shells

+

Complete app screens, each combining several of the patterns above. Every shell has + a live preview, the build order from top to bottom, and one prompt that builds the whole + screen. Start from the closest one and change the placeholders.

+ + + +
+
+

Request manager

+

Template: blank-slate.html

+

Brand layerDecorator dropdown

+
+
+ Live preview +
+ + +
+
+
+
+

Prompt

+ +
+
Create [requests.html] from blank-slate.html for a [request manager] app. Add it to the drawer and the navbar. Link css/app-patterns.css (copied from the Decorator Kit Developer Guide) in the site-specific CSS block.
+Canvas, inside div.app-shell:
+1. Item bar (div.btn-toolbar.app-toolbar, role="toolbar"): [New], bulk [Archive, Refresh] icon buttons with aria-labels, and a right-aligned in-app search form.
+2. A .row: a .col-sm-3 side menu (nav > .list-group.app-sidemenu with [Inbox, Assigned to me, Closed] and badge counts, current item marked aria-current="page") and a .col-sm-9 work area.
+3. In the work area: Bootstrap tabs (ul.nav.nav-tabs.app-tabs, role="tablist") for [Open, Due soon]. Each tab panel holds a .list-group.app-list of requests and a nav > ul.pagination.app-pagination.
+4. A "Close request" modal (.modal.fade.app-modal) at the end of the canvas.
+Load the data from [requests.json] in js/requests.js and escape every value. Use Bootstrap 3.3.7 data-api behaviors (tab, dropdown, modal, buttons) — no other JS framework. No -success/-info/-warning/-danger classes. Status is always written in words.
+
+
+ + +
+
+

Operations dashboard

+

The at-a-glance home screen of an internal tool: headline numbers, what needs + attention, and recent activity.

+

Template: blank-slate.html

+
    +
  1. View header with a "last updated" line and a refresh button
  2. +
  3. Four stat boxes (div.styled.app-stat) in a .row
  4. +
  5. .msg.alert that appears only when something needs attention
  6. +
  7. Two columns: a table.styled-dark of items due and a media list of recent activity
  8. +
+

div.styled · .msg · table.styled-darkBrand layer

+
+
+ Live preview +
+
+

Facilities Dashboard

+
+ Updated 9:41 a.m. + +
+
+
+
+
42Open requests
+
+
+
7Due today
+
+
+
3Overdue
+
+
+
1.8dAvg. time to close
+
+
+
+

3 overdue

+ Three requests are past their due date. Review overdue requests. +
+
+
+
+ + + + + + + + +
Due today
RequestBuildingStatus
RQ-1042GeiselIn progress
RQ-1051Price CenterNot started
RQ-1057RIMACWaiting on parts
+
+
+
+

Recent activity

+
    +
  • +
    +

    Jordan Lee closed RQ-1039

    12 minutes ago

    +
  • +
  • +
    +

    Sam Rivera opened RQ-1057

    1 hour ago

    +
  • +
+
+
+
+
+
+
+

Prompt

+ +
+
Create [dashboard.html] from blank-slate.html for the [Facilities] dashboard. Add it to the drawer and the navbar. Link css/app-patterns.css.
+Canvas, inside div.app-shell:
+1. div.app-view-head with h4.app-view-title "[Facilities Dashboard]", an "Updated [time]" span.app-muted, and an icon refresh button (aria-label="Refresh dashboard").
+2. A .row of four .col-xs-6.col-md-3 stat boxes, each a div.styled.app-stat with span.app-stat-value and span.app-stat-label: [Open requests, Due today, Overdue, Avg. time to close].
+3. A .msg.alert only when overdue > 0, with a link to the overdue list.
+4. A .row: .col-md-7 with a table.styled-dark.app-table "Due today" (caption, th scope="col", tr.even on alternate rows) and .col-md-5 with a ul.media-list of recent activity (li.media.app-media, avatar alt="").
+Load data from [dashboard.json] in js/dashboard.js, escape every value, and announce refreshes in an aria-live region. Status is words, never color alone. No -success/-info/-warning/-danger classes, no progress bars.
+
+
+ + +
+
+

Data admin table

+

Manage a list of records in bulk: select rows, act on them, switch views, and + page through.

+

Template: blank-slate.html · for sorting and search at scale, swap in the DataTables widget

+
    +
  1. View header with a primary "Add" action menu
  2. +
  3. Item bar: selection count, bulk actions, view switcher, search
  4. +
  5. table.styled-dark with a checkbox column (each with an .sr-only label)
  6. +
  7. Row count and pagination
  8. +
+

Dropdown · table.styled-darkBrand layer

+
+
+ Live preview +
+
+

Room Inventory

+
+ + +
+
+ +
+ + + + + + + + + + + + + +
Rooms
RoomBuildingSeatsStatus
107Geisel40Available
115Center Hall220Booked
2Price Center12Under repair
+
+
+ Showing 1–3 of 48 rooms + +
+
+
+
+
+

Prompt

+ +
+
Create [rooms.html] from blank-slate.html for a [room inventory] admin tool. Add it to the drawer and the navbar. Link css/app-patterns.css.
+Canvas, inside div.app-shell:
+1. div.app-view-head: h4.app-view-title "[Room Inventory]" and a btn-primary "Add" dropdown (dropdown-menu-right) with [Single room, Import from CSV].
+2. Item bar (div.btn-toolbar.app-toolbar, role="toolbar"): span.app-toolbar-count "[n] selected", bulk [Edit, Export] app-tool buttons, a .btn-group.app-segmented radio filter [All, Available], and a right-aligned in-app search form.
+3. table.styled-dark.app-table in .table-responsive: a first column of checkboxes, each with its own .sr-only label ("Select [room]"), and a "Select all" checkbox in the header. Columns: [Room, Building, Seats, Status]. Status in words. tr.even on alternate rows.
+4. div.app-view-head with "Showing x–y of n" and nav > ul.pagination.app-pagination (aria-current="page").
+In js/rooms.js: keep the selection count and "Select all" in sync, announce changes in an aria-live region, and escape every value. If sorting or search across more than ~200 rows is needed, use the DataTables widget (widgets/datatables.html) for the table instead.
+
+
+ + +
+
+

Settings and profile

+

Sectioned preferences with a side menu, grouped form fields, and one save bar.

+

Template: two-column.html or blank-slate.html

+
    +
  1. Side menu of settings sections (current one marked aria-current)
  2. +
  3. Form grouped with fieldset/legend
  4. +
  5. Segmented control for a single choice, checkboxes for toggles
  6. +
  7. .app-savebar with Cancel / Save, and a .msg.info confirmation after saving
  8. +
+

Forms · .msg.infoBrand layer

+
+
+ Live preview +
+
+
+ +
+
+

Notifications

+
+

Saved

+ Your notification settings were updated. +
+
+
+ Email me when +
+
+
+
+
+ Digest frequency +
+ + + +
+

Digests arrive at 7 a.m. Pacific.

+
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+

Prompt

+ +
+
Create [settings.html] from [two-column.html] for the app's settings. Add "Settings" to the drawer, the navbar, and the side nav. Link css/app-patterns.css.
+Canvas, inside div.app-shell, as a .row:
+1. .col-sm-3: nav aria-label="Settings sections" > .list-group.app-sidemenu with a heading and [Profile, Notifications, Accessibility, Connected apps]. The current section gets aria-current="page".
+2. .col-sm-9: h4.app-view-title for the section, then a form. Group related fields in fieldset.app-facet with a legend: checkboxes for on/off options, a .btn-group.app-segmented radio group for single choices, and .form-group/.form-control inputs with labels and autocomplete. Help text goes in .help-block, linked with aria-describedby.
+3. div.app-savebar at the end: btn-default "Cancel" (reset) and btn-primary "Save changes".
+After a successful save, show a .msg.info "Saved" above the form and move focus to it. Show validation errors above the form in a .msg.alert. Submit logic goes in js/settings.js, with a CSRF token.
+
+
+ + +
+
+

Multi-step application

+

A longer form split into steps, with a visible step indicator and + Back / Continue controls. For a full wizard with validation per step, use the + Wizard widget.

+

Template: blank-slate.html · alternative: widgets/wizard.html

+
    +
  1. Step indicator (ol.app-steps, with the current step marked aria-current="step" and completed steps named in text)
  2. +
  3. The current step's fieldset
  4. +
  5. Save bar with Back, Save draft, and Continue
  6. +
+

FormsBrand layer

+
+
+ Live preview (static) +
+

Research Funding Application

+
    +
  1. Applicant (completed)
  2. +
  3. Project
  4. +
  5. Budget
  6. +
  7. Review
  8. +
+
+
+ Step 2 of 4: Project +
+ + +
+
+ + +

250 words or fewer.

+
+
+
+ + + +
+
+
+
+
+
+

Prompt

+ +
+
Create [apply.html] from blank-slate.html for a [4]-step [funding application]. Link css/app-patterns.css.
+Canvas, inside div.app-shell:
+1. h4.app-view-title "[Research Funding Application]".
+2. ol.app-steps with aria-label="Application progress" and one li per step: [Applicant, Project, Budget, Review]. The current step gets aria-current="step". Completed steps get data-state="done" plus an .sr-only "(completed)".
+3. One fieldset.app-facet per step, with legend "Step n of 4: [name]" and Bootstrap 3 form fields (labels, autocomplete, help-block linked via aria-describedby). Show only the current step's fieldset.
+4. div.app-savebar with btn-default "Back", btn-default "Save draft", and btn-primary "Continue" ("Submit" on the last step).
+In js/apply.js: validate each step before advancing, show errors above the form in a .msg.alert, move focus to the new step's legend, and update aria-current. Save drafts to [endpoint] with a CSRF token. If the steps need branching or per-step validation UI, use the Wizard widget (widgets/wizard.html) instead.
+
+
+ + +
+
+

Record detail

+

A single item's page: what it is, what happened to it, and what you can do next.

+

Template: two-column.html

+
    +
  1. Breadcrumb back to the list (the template's breadcrumb, pointed at real pages)
  2. +
  3. Header: title, status in words, and an Actions dropdown
  4. +
  5. Tabs: Details (dl.dl-horizontal), Activity (media list plus a comment form), Files (item list)
  6. +
+

Dropdowndl-horizontalBrand layer

+
+
+ Live preview +
+
+
+

RQ-1042 · Leaking sink, Geisel 2nd floor

+ Status: In progress · Opened Sep 18 by Sam Rivera +
+ +
+ +
+
+
+
Location
Geisel Library, 2nd floor east restroom
+
Category
Plumbing
+
Assigned to
Jordan Lee, Facilities
+
Due
September 23, 2026
+
+
+
+
    +
  • +
    +
    Jordan Lee

    2 hours ago

    Plumber scheduled for tomorrow morning.

    +
  • +
+
+
+ + +
+ +
+
+ +
+
+
+
+
+

Prompt

+ +
+
Create [request-detail.html] from two-column.html as the detail view for one [request]. Set the breadcrumb to Home › [Requests] › [RQ-id], resolved from this page's folder. Link css/app-patterns.css.
+Canvas, inside div.app-shell:
+1. div.app-view-head: h4.app-view-title "[id · title]", a span.app-muted line with the status in words plus who opened it and when, and a btn-primary "Actions" dropdown (dropdown-menu-right) with [Reassign…, Change due date…, divider, Close request…]. "Close request…" opens a .modal.fade.app-modal confirmation.
+2. Bootstrap tabs (ul.nav.nav-tabs.app-tabs, role="tablist"):
+   - Details: dl.dl-horizontal.app-details with [Location, Category, Assigned to, Due].
+   - Activity (with a count badge): ul.media-list of comments (li.media.app-media), then a comment form with a labeled textarea and a btn-default "Post comment".
+   - Files: .list-group.app-list of attachments with a Glyphicon and size.
+Load the record from [api/requests/:id] in js/request-detail.js. Escape all user text, and send comments with a CSRF token.
+
+
+ + +
+
+ +

Search results for a catalog, directory, or knowledge base, with filter facets, + a result count, and an empty state.

+

Template: blank-slate.html

+
    +
  1. A large in-app search bar (not the site search)
  2. +
  3. Filter facets as checkbox fieldsets in a side column
  4. +
  5. Result count (announced to screen readers), a sort dropdown, and an item list
  6. +
  7. Pagination and an empty state for zero results
  8. +
+

Dropdown · formsBrand layer

+
+
+ Live preview +
+
+ +
+ + +
+
+
+
+
+
+ Level +
+
+
+
+
+ Quarter +
+
+
+
+
+
+
+

14 results for “data science”

+
+ + +
+
+ + +
+ +

Empty state: No courses match. Try removing a filter or checking the spelling.

+
+
+
+
+
+
+
+

Prompt

+ +
+ +
+
+

Back to page index

+
+ + +
+

Dashboards by campus area

+

Starter dashboards for the kinds of internal tools UC San Diego units build most often. + Each one names who it's for and the data it touches, and combines the building blocks and + patterns above. All names and numbers are made up.

+ +
+

Before you connect real data

+ Many of these dashboards show protected data: FERPA student records, personnel + records, research budgets. Put them behind campus Single Sign-On, check authorization on + every request, keep personal data out of URLs and logs, and treat anything you're + unsure of as sensitive. Every prompt below includes these rules, so leave them in. +
+ + +
+
+

Build a dashboard with an agent, in four prompts

+

Don't ask for the whole app at once. Send these four prompts in order, and review + the result of each before you send the next. Paste the dashboard prompt of your + choice into step 2.

+
+
+
+
+

Step 1 · Scaffold

+ +
+
Create [dashboard.html] from blank-slate.html (from node_modules/ucsd-decorator-v5/dist/templates). Rewrite every CSS and script path to cdn.ucsd.edu. Add "[Dashboard name]" to the drawer and the navbar, leaving both search blocks as shipped. Copy css/app-patterns.css from the Decorator Kit Developer Guide and link it in the site-specific CSS block. Create an empty js/[dashboard].js and load it after base.min.js. Stop there, and show me the diff.
+
+
+
+

Step 2 · Static layout

+ +
+
Inside main#main-content only, build the static layout below using hard-coded sample data that is obviously fake. Use the Decorator and app-patterns classes named in it. No JavaScript yet.
+[paste one dashboard prompt from the Developer Guide here]
+
+
+
+

Step 3 · Wire the data

+ +
+
In js/[dashboard].js, replace the sample data with data from [endpoint]. Keep the static markup as the no-JavaScript fallback where you can. Build DOM nodes with textContent (never innerHTML with data), set data-bar widths with app-w-* classes, and announce refreshes and filter changes in one aria-live region. The endpoint requires campus SSO. Handle 401/403 by showing a .msg.alert with a sign-in link, and handle empty results with an .app-empty state. Don't log response bodies.
+
+
+
+

Step 4 · Review and verify

+ +
+
Review [dashboard.html]:
+- Did anything change outside main#main-content? Are all Decorator assets loaded from cdn.ucsd.edu?
+- Any -success/-info/-warning/-danger, label-*, progress-bar, or title tooltips?
+- One h1, headings in order, every status and trend written in words, 44px targets, visible focus, labeled inputs?
+- No personal data in URLs, logs, or localStorage? SSO and authorization checked on every request?
+Fix what you find, then run `npx ucsd-decorator-kit verify` and report the findings. Don't run --accept.
+
+
+
+ + +
+
+ Student success · College advising +

Advisor caseload

+

For: college academic advisors. Data: student + records (FERPA), appointments, holds, early alerts.

+

Template: blank-slate.html

+
    +
  1. Filter bar: term and college
  2. +
  3. Four key numbers: caseload, appointments today, holds, early alerts
  4. +
  5. Today's appointments table and an early-alert status list
  6. +
+
+
+ Live preview +
+

Advisor Caseload · Muir College

+
+
+
+ +
+
+
312Students assigned
+
9Appointments today
+
14Registration holds Down 5 this week
+
6New early alerts
+
+
+
+
+ + + + + + + + +
Today's appointments
TimeStudentReason
9:00Student A.Major declaration
9:30Student B.Academic probation
10:15Student C.Study abroad
+
+
+
+
+

Early alerts

+
    +
  • Student D.Missed 3 classes
  • +
  • Student E.Midterm below C
  • +
  • Student F.Advisor note
  • +
+
+
+
+
+
+
+
+

Prompt

+ +
+
Build an advisor caseload dashboard for [college] advisors in [advising.html], from blank-slate.html, with css/app-patterns.css. Canvas, inside div.app-shell:
+1. h4.app-view-title "Advisor Caseload · [College]".
+2. form.app-filterbar: Term and College selects, Apply.
+3. Four div.styled.app-stat key numbers: Students assigned, Appointments today, Registration holds (with an .app-trend), New early alerts.
+4. A .row: .col-md-7 has a table.styled-dark.app-table "Today's appointments" (Time, Student, Reason; each student name links to a detail view). .col-md-5 has a div.app-panel "Early alerts" with ul.app-status-list (status in words).
+FERPA data: require campus SSO, and return only students assigned to the signed-in advisor, checked server-side on every request. No student IDs or names in URLs, logs, or browser storage. Show preferred names. Log access to student records for audit. Data comes from [endpoint], loaded in js/advising.js.
+
+
+ + +
+
+ Academic affairs · Department scheduling +

Course enrollment and waitlists

+

For: department schedulers and undergraduate coordinators. + Data: section capacity, enrollment, and waitlists, all aggregate.

+

Template: two-column.html

+
    +
  1. Quarter switcher (segmented control)
  2. +
  3. Data bars: fill rate by course
  4. +
  5. Waitlist table, sorted by pressure, with an export action
  6. +
+
+
+ Live preview +
+
+

Enrollment · Cognitive Science

+
+ + + +
+
+
+
+
+

Seats filled

+
    +
  • COGS 1100% (full)
  • +
  • COGS 14A92%
  • +
  • COGS 10881%
  • +
  • COGS 18046%
  • +
+
+
+
+
+ + + + + + + + +
Largest waitlists
CourseWaitlistCap
COGS 184400
COGS 14A31250
COGS 10812300
+
+
+
+
+
+
+
+
+

Prompt

+ +
+
Build a course enrollment dashboard for the [department] in [enrollment.html], from two-column.html, with css/app-patterns.css. Add it to the drawer, the navbar, and the side nav. Canvas, inside div.app-shell:
+1. div.app-view-head: h4.app-view-title "Enrollment · [Department]" and a .btn-group.app-segmented quarter switcher [Fall, Winter, Spring].
+2. A .row: .col-md-6 has a div.app-panel "Seats filled" with ul.app-bars per course (a full course gets .app-bar-attn, and the value text says "100% (full)"). .col-md-6 has a table.styled-dark.app-table "Largest waitlists" (Course, Waitlist, Cap), sorted by waitlist, then an .app-savebar with an "Export CSV" button.
+Aggregate data only, with no student-level rows. Load it from [endpoint] per quarter in js/enrollment.js, and announce quarter changes in an aria-live region.
+
+
+ + +
+
+ Research · Department research administration +

Proposals and awards

+

For: department research administrators and PIs. + Data: proposal pipeline, sponsor deadlines, award spending.

+

Template: blank-slate.html

+
    +
  1. Pipeline data bars: proposals by stage
  2. +
  3. Deadline timeline for the next 30 days
  4. +
  5. Tabbed award table: Active, Ending soon
  6. +
+
+
+ Live preview +
+

Research Administration · Bioengineering

+
+
+
+

Proposal pipeline

+
    +
  • Drafting12
  • +
  • Dept. review6
  • +
  • At OCGA4
  • +
  • Submitted20
  • +
+
+
+
+
+

Next 30 days

+
    +
  1. · 3 days (urgent)NIH R01 · Chen
  2. +
  3. · 2 weeksNSF CAREER · Patel
  4. +
+
+
+
+ +
+
+
+ + + + + + + +
Active awards
AwardSponsorSpentEnds
Tissue scaffoldsNIH64%Jun 2027
Wearable sensorsDoD88% (ahead of plan)Dec 2026
+
+
+

Awards needing closeout or no-cost extension decisions.

+
+
+
+
+
+

Prompt

+ +
+
Build a research administration dashboard for [department] in [research.html], from blank-slate.html, with css/app-patterns.css. Canvas, inside div.app-shell:
+1. h4.app-view-title "Research Administration · [Department]".
+2. A .row: .col-md-6 has a div.app-panel "Proposal pipeline" with ul.app-bars per stage [Drafting, Dept. review, At OCGA, Submitted] showing counts. .col-md-6 has a div.app-panel "Next 30 days" with ol.app-timeline of sponsor deadlines (data-urgent within 7 days).
+3. Bootstrap tabs (.app-tabs): "Active awards" and "Ending in 90 days" (with a count badge). Each is a table.styled-dark.app-table (Award, Sponsor, Spent %, Ends). Explain over- or under-spending in words.
+Budget data is confidential: SSO, show only awards where the user is PI or a department admin (checked server-side), no amounts in URLs or logs. Data from [endpoint], in js/research.js.
+
+
+ + +
+
+ Housing, Dining & Hospitality +

Residence operations

+

For: residential life and operations staff. Data: + occupancy by neighborhood, maintenance tickets, dining location status.

+

Template: blank-slate.html

+
    +
  1. Key numbers: beds filled, open work orders, move-in checklist
  2. +
  3. Occupancy data bars by college
  4. +
  5. Dining locations status list
  6. +
+
+
+ Live preview +
+

Residence Operations · Fall move-in

+
+
15,240Beds filled Up 310 today
+
87Open work orders
+
4 of 6Move-in tasks done
+
+
+
+
+

Occupancy by college

+
    +
  • Revelle97%
  • +
  • Warren95%
  • +
  • Eighth86%
  • +
  • Seventh66% (check-ins open)
  • +
+
+
+
+
+

Dining locations

+
    +
  • 64 DegreesOpen
  • +
  • PinesLong line
  • +
  • Club MedClosed
  • +
+
+
+
+
+
+
+
+

Prompt

+ +
+
Build a residence operations dashboard in [housing.html], from blank-slate.html, with css/app-patterns.css. Canvas, inside div.app-shell:
+1. h4.app-view-title "Residence Operations · [event]".
+2. Three .col-sm-4 div.styled.app-stat: Beds filled (with an .app-trend), Open work orders, Move-in tasks done ("4 of 6").
+3. A .row: .col-md-7 has a div.app-panel "Occupancy by college" with ul.app-bars for [Revelle … Eighth] (explain the highlighted row in its value text). .col-md-5 has a div.app-panel "Dining locations" with ul.app-status-list (Open / Long line / Closed).
+Refresh every [5] minutes in js/housing.js and announce "Updated [time]" in an aria-live region, without moving focus. Aggregate data only — no resident names on this screen.
+
+
+ + +
+
+ IT Services · Working example +

Service status board

+

For: the service desk and anyone checking campus systems. + Data: public service status. This one works: + filter to issues, search by name, and the count updates for screen readers. + The script is js/status-board.js, + about 60 lines of plain JavaScript.

+

Template: blank-slate.html

+
    +
  1. Key numbers: operational, degraded, outages
  2. +
  3. Item bar: an All / Needs attention filter, search, and a live count
  4. +
  5. Status list with detail lines, plus an empty state
  6. +
+
+
+ Live preview · try it +
+
+

Campus Service Status

+ Updated 9:41 a.m. +
+
+
9Operational
+
2Degraded
+
1Outage
+
+ +
    +
  • Canvas LMS Operational
  • +
  • UCSD-PROTECTED Wi-Fi DegradedSlow connections in Geisel Library. Engineers are on site.
  • +
  • Email and Calendar Operational
  • +
  • Print stations OutageCard readers offline campus-wide. Next update 11 a.m.
  • +
  • VPN Operational
  • +
  • Single Sign-On Operational
  • +
  • Zoom Operational
  • +
  • Library catalog DegradedSearches may time out. The vendor is investigating.
  • +
  • TritonLink Operational
  • +
  • Campus phones Operational
  • +
  • Research storage Operational
  • +
  • Concur Operational
  • +
+ +
+
+
+
+

Prompt

+ +
+
Build a campus service status board in [status.html], from blank-slate.html, with css/app-patterns.css, following the working example in the Decorator Kit Developer Guide (js/status-board.js). Canvas, inside div#its-board.app-shell:
+1. div.app-view-head: h4.app-view-title "Campus Service Status" and an "Updated [time]" span.app-muted.
+2. Three .col-xs-4 div.styled.app-stat counts: Operational, Degraded, Outage.
+3. div.btn-toolbar.app-toolbar: a .btn-group.app-segmented radio filter [All, Needs attention], a span.app-live-count with role="status", and a right-aligned search form (.sr-only label).
+4. ul.app-status-list with one li per service, carrying data-service and data-status, a status badge, and an optional detail line. Then a hidden div.app-empty.
+Render the full list in HTML so it works without JavaScript. In js/status-board.js, filter by toggling Bootstrap's .hidden class. Listen for filter changes with jQuery ($(board).on('change', ...)), because button.js fires them through jQuery. Search on input. Update the count text on every change. Load statuses from [status feed] on an interval.
+
+
+ + +
+
+ Facilities management · Sustainability +

Energy and work orders

+

For: facilities managers and sustainability staff. + Data: building energy use against targets, work orders by priority.

+

Template: blank-slate.html

+
    +
  1. Filter bar: date range
  2. +
  3. Key numbers with trends against last year
  4. +
  5. Energy use against target as data bars, and a work-order tab set
  6. +
+
+
+ Live preview +
+

Energy & Work Orders · September

+
+
18.2GWh used Down 4% from last year
+
71%From on-site generation
+
243Open work orders Up 12 this week
+
+
+

Energy use against monthly target (top buildings)

+
    +
  • Jacobs Hall108% (over)
  • +
  • Geisel Library92%
  • +
  • Price Center79%
  • +
+
+
+
+
+
+

Prompt

+ +
+
Build an energy and work-order dashboard in [energy.html], from blank-slate.html, with css/app-patterns.css. Canvas, inside div.app-shell:
+1. h4.app-view-title "Energy & Work Orders · [period]" and a form.app-filterbar with From/To dates.
+2. Three .col-sm-4 div.styled.app-stat with .app-trend compared to last year: GWh used, % from on-site generation, Open work orders.
+3. A div.app-panel "Energy use against monthly target" with ul.app-bars for the top [10] buildings. Cap the bar at app-w-100 and say "[n]% (over)" in the value text when a building is over target.
+4. Bootstrap tabs (.app-tabs) for work orders by priority [Emergency, Urgent, Routine]. Each is a table.styled-dark.app-table.
+If a real chart is needed, add a charting library under canvas-components/ with its README, and keep the data table as the accessible alternative. Data from [endpoint], in js/energy.js.
+
+
+ + +
+
+ UC San Diego Library +

Study space availability

+

For: students (public view) and library staff. + Data: room status, occupancy by floor, busy hours.

+

Template: blank-slate.html

+
    +
  1. Floor switcher (segmented control)
  2. +
  3. Room tiles with status words and a "Book" link
  4. +
  5. Busy-hours data bars
  6. +
+
+
+ Live preview +
+
+

Geisel Study Rooms

+
+ + + +
+
+
+
+ +
+
+
+

Usually busy

+
    +
  • 10 a.m.55%
  • +
  • 2 p.m.90% (peak)
  • +
  • 8 p.m.70%
  • +
+
+
+
+
+
+
+
+

Prompt

+ +
+
Build a study room availability page in [rooms.html], from blank-slate.html, with css/app-patterns.css. Canvas, inside div.app-shell:
+1. div.app-view-head: h4.app-view-title "[Building] Study Rooms" and a .btn-group.app-segmented floor switcher.
+2. A .row: .col-md-7 has ul.app-tiles with one li per room — the room name, a span.app-status in words ("Available", "In use until 3 p.m.", "Reserved at 2 p.m."), and for available rooms a "Book" link with .sr-only room context. .col-md-5 has a div.app-panel "Usually busy" with ul.app-bars by hour.
+Students are anonymous on this page — show no booker names. "Book" goes to [booking system] and needs SSO there. Refresh statuses every [2] minutes in js/rooms.js and announce changes politely.
+
+
+ + +
+
+ Human Resources · Department HR +

New-hire onboarding tracker

+

For: department HR contacts and hiring managers. + Data: personnel records and onboarding task status.

+

Template: two-column.html

+
    +
  1. Side menu of new hires with progress counts
  2. +
  3. The selected hire's checklist progress
  4. +
  5. Upcoming start dates timeline (in the prompt; not shown in the preview)
  6. +
+
+
+ Live preview +
+
+
+ +
+
+
+

Alex Kim · Programmer Analyst · starts Oct 1

+
    +
  • 3 of 5 done60%
  • +
+
    +
  • Offer letter signed (done)
  • +
  • Background check (done)
  • +
  • Active Directory account (done)
  • +
  • Cyber-security training (to do)
  • +
  • Equipment request (to do)
  • +
+
+
+
+
+
+
+
+

Prompt

+ +
+
Build a new-hire onboarding tracker in [onboarding.html], from two-column.html, with css/app-patterns.css. Add it to the drawer, the navbar, and the side nav. Canvas, inside div.app-shell, as a .row:
+1. .col-sm-3: nav aria-label="New hires" > .list-group.app-sidemenu with a heading "Starting soon" and one link per hire with a "[done]/[total]" badge. The selected hire gets aria-current="page".
+2. .col-sm-9: a div.app-panel titled "[name] · [title] · starts [date]", a one-row ul.app-bars "[n] of [total] done", and ul.app-checklist (data-done plus .sr-only "(done)" / "(to do)").
+3. Below it, a div.app-panel "Start dates" with ol.app-timeline (data-urgent for starts within 7 days where tasks are still open).
+Personnel data: SSO, show only hires in the user's department (checked server-side), no names or employee IDs in URLs, and audit-log every view. Data from [endpoint], in js/onboarding.js.
+
+
+ +

Back to page index

+
+ + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/user-guide/css/app-patterns.css b/user-guide/css/app-patterns.css new file mode 100644 index 0000000..ec23d9b --- /dev/null +++ b/user-guide/css/app-patterns.css @@ -0,0 +1,818 @@ +/* + * App patterns — brand layer for Bootstrap 3.3.7 components. + * + * Bootstrap paints some app components in its stock blue (#337ab7), and the + * Decorator's base.min.css doesn't restyle them. This file brings them onto + * the Decorator palette, for the canvas only. + * + * How it stays out of the chrome: + * - Every rule is scoped under main#main-content and an app-* class that + * exists only in the canvas. + * - No rule names a class the chrome also uses (.nav, .active, + * .dropdown-menu, .btn-default, .caret, .form-control, .input-group ...). + * Active states are keyed on aria-current / aria-expanded / :checked, + * which the markup needs for accessibility anyway. + * + * Part of the Decorator Kit Developer Guide. Copy this file into a project + * as-is, or copy only the blocks you use. + */ + +/* ---- Tabs: .nav.nav-tabs.app-tabs ------------------------------------- */ + +main#main-content .app-tabs > li > a { + color: #00629b; + min-height: 44px; + padding: 11px 16px; +} + +main#main-content .app-tabs > li > a[aria-expanded="true"] { + color: #182b49; + font-weight: 700; + box-shadow: inset 0 3px 0 #00629b; +} + +main#main-content .app-tabs > li > a:focus { + outline: 3px solid #ffcd00; + outline-offset: -3px; +} + +main#main-content .app-tab-panels { + padding: 16px 4px 0; +} + +/* ---- Side menu: .list-group.app-sidemenu ------------------------------ */ + +main#main-content .app-sidemenu .list-group-item { + color: #182b49; + min-height: 44px; + padding: 11px 15px; +} + +main#main-content .app-sidemenu a.list-group-item:hover, +main#main-content .app-sidemenu a.list-group-item:focus { + background: #f5f0e6; + color: #182b49; +} + +main#main-content .app-sidemenu a.list-group-item:focus { + outline: 3px solid #ffcd00; + outline-offset: -3px; + z-index: 3; +} + +main#main-content .app-sidemenu .list-group-item[aria-current="page"], +main#main-content .app-sidemenu .list-group-item[aria-current="page"]:hover, +main#main-content .app-sidemenu .list-group-item[aria-current="page"]:focus { + background: #00629b; + border-color: #00629b; + color: #fff; + z-index: 2; +} + +main#main-content .app-sidemenu .app-sidemenu-heading { + background: #182b49; + border-color: #182b49; + color: #fff; + font-weight: 700; + letter-spacing: 0.06em; + text-transform: uppercase; + font-size: 13px; +} + +/* ---- Counts on list items: .badge inside an app-* list ---------------- */ + +main#main-content .app-sidemenu .badge, +main#main-content .app-list .badge { + background: #182b49; +} + +main#main-content .app-sidemenu [aria-current="page"] .badge { + background: #fff; + color: #00629b; +} + +/* ---- Item list: .list-group.app-list ---------------------------------- */ + +main#main-content .app-list .list-group-item { + min-height: 44px; +} + +main#main-content .app-list a.list-group-item { + color: #182b49; +} + +main#main-content .app-list a.list-group-item:hover, +main#main-content .app-list a.list-group-item:focus { + background: #f5f0e6; +} + +main#main-content .app-list .list-group-item-heading { + font-weight: 700; + color: #182b49; +} + +/* ---- Pagination: nav > ul.pagination.app-pagination ------------------- */ + +main#main-content .app-pagination > li > a { + color: #00629b; + min-width: 44px; + min-height: 44px; + padding: 11px 14px; + text-align: center; +} + +main#main-content .app-pagination > li > a:hover, +main#main-content .app-pagination > li > a:focus { + background: #f5f0e6; + color: #182b49; +} + +main#main-content .app-pagination > li > a[aria-current="page"], +main#main-content .app-pagination > li > a[aria-current="page"]:hover { + background: #00629b; + border-color: #00629b; + color: #fff; +} + +main#main-content .app-pagination > li > a:focus { + outline: 3px solid #ffcd00; + outline-offset: -3px; + z-index: 3; +} + +/* ---- Segmented control: .btn-group.app-segmented ---------------------- */ + +main#main-content .app-segmented .btn { + min-height: 44px; + padding: 11px 16px; + background: #fff; + color: #00629b; + border: 1px solid #00629b; +} + +main#main-content .app-segmented label.btn:has(input:checked) { + background: #00629b; + color: #fff; +} + +main#main-content .app-segmented label.btn:has(input:focus-visible) { + outline: 3px solid #ffcd00; + outline-offset: 2px; + z-index: 3; +} + +/* ---- Toolbar / item bar: .btn-toolbar.app-toolbar --------------------- */ + +main#main-content .app-toolbar { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8px; + margin-left: 0; + padding: 8px; + border: 1px solid #d6d6d6; + border-radius: 8px; + background: #fff; +} + +main#main-content .app-toolbar > .btn-group, +main#main-content .app-toolbar > .app-toolbar-search { + float: none; + margin-left: 0; +} + +main#main-content .app-tool { + min-width: 44px; + min-height: 44px; + background: #fff; + color: #182b49; + border: 1px solid #b3b3b3; +} + +main#main-content .app-tool:hover, +main#main-content .app-tool:focus { + background: #f5f0e6; +} + +main#main-content .app-tool:focus { + outline: 3px solid #ffcd00; + outline-offset: 1px; + z-index: 3; +} + +main#main-content .app-toolbar-count { + font-weight: 700; + color: #182b49; + margin: 0 8px 0 4px; +} + +main#main-content .app-toolbar-search { + margin-left: auto !important; + min-width: 200px; + flex: 0 1 280px; +} + +main#main-content .app-toolbar-search .app-search-input { + min-height: 44px; +} + +main#main-content .app-toolbar-search .app-tool { + height: 44px; +} + +/* ---- Media list: .media.app-media ------------------------------------ */ + +main#main-content .app-media .media-object { + width: 64px; + height: 64px; +} + +main#main-content .app-media .media-heading { + font-weight: 700; + color: #182b49; +} + +main#main-content .app-media-meta { + color: #595959; + font-size: 13px; +} + +/* ---- Modal: .modal.app-modal ----------------------------------------- */ + +main#main-content .app-modal .modal-header { + background: #182b49; + color: #fff; + border-radius: 5px 5px 0 0; +} + +main#main-content .app-modal .modal-title { + font-weight: 700; +} + +main#main-content .app-modal .app-modal-close { + color: #fff; + opacity: 1; + text-shadow: none; + min-width: 44px; + min-height: 44px; + margin: -12px -12px 0 0; + font-size: 28px; +} + +main#main-content .app-modal .app-modal-close:focus { + outline: 3px solid #ffcd00; +} + +/* ---- App shell composite -------------------------------------------- */ + +main#main-content .app-shell { + border: 1px solid #d6d6d6; + border-radius: 8px; + padding: 12px; +} + +main#main-content .app-shell > .app-toolbar { + margin-bottom: 12px; +} + +/* ---- Menu-style links: no underline; hover and focus carry the cue --- */ + +main#main-content .app-sidemenu a.list-group-item, +main#main-content .app-list a.list-group-item, +main#main-content .app-tabs > li > a, +main#main-content .app-pagination > li > a { + text-decoration: none; +} + +main#main-content .app-list a.list-group-item:hover .list-group-item-heading, +main#main-content .app-list a.list-group-item:focus .list-group-item-heading { + text-decoration: underline; +} + +main#main-content .app-list .list-group-item-text { + color: #595959; +} + +/* ==================================================================== * + * App shells — pieces used by the composite examples * + * ==================================================================== */ + +/* View title inside a shell (an h4, so it nests under the page's h3) */ +main#main-content .app-view-title { + font-weight: 700; + font-size: 20px; + color: #182b49; + margin: 4px 0 12px; +} + +main#main-content .app-view-head { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 8px; + margin-bottom: 12px; +} + +main#main-content .app-view-head .app-view-title { + margin: 0; +} + +main#main-content .app-muted { + color: #595959; + font-size: 13px; +} + +/* ---- Stat boxes: div.styled.app-stat (Decorator sand box) ----------- */ + +main#main-content .app-stat { + margin-bottom: 12px; +} + +main#main-content .app-stat-value { + display: block; + font-family: "Teko-SemiBold", sans-serif; + font-size: 44px; + line-height: 1; + color: #00629b; +} + +main#main-content .app-stat-label { + display: block; + font-weight: 700; + color: #182b49; +} + +/* ---- Step indicator: ol.app-steps ----------------------------------- */ + +main#main-content .app-steps { + list-style: none; + counter-reset: app-step; + display: flex; + flex-wrap: wrap; + gap: 8px; + padding: 0; + margin: 0 0 16px; +} + +main#main-content .app-steps li { + counter-increment: app-step; + flex: 1 1 140px; + padding: 10px 12px 10px 44px; + position: relative; + border: 1px solid #d6d6d6; + border-radius: 6px; + color: #595959; + min-height: 44px; +} + +main#main-content .app-steps li::before { + content: counter(app-step); + position: absolute; + left: 10px; + top: 9px; + width: 24px; + height: 24px; + line-height: 24px; + text-align: center; + border-radius: 50%; + border: 2px solid #595959; + font-weight: 700; + font-size: 13px; +} + +main#main-content .app-steps li[data-state="done"] { + color: #182b49; +} + +main#main-content .app-steps li[data-state="done"]::before { + content: "\2713"; + background: #182b49; + border-color: #182b49; + color: #fff; +} + +main#main-content .app-steps li[aria-current="step"] { + border-color: #00629b; + color: #182b49; + font-weight: 700; + box-shadow: inset 0 -3px 0 #00629b; +} + +main#main-content .app-steps li[aria-current="step"]::before { + background: #00629b; + border-color: #00629b; + color: #fff; +} + +/* ---- Sticky action bar for forms: .app-savebar ---------------------- */ + +main#main-content .app-savebar { + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + gap: 8px; + padding: 12px 0 0; + margin-top: 8px; + border-top: 1px solid #d6d6d6; +} + +main#main-content .app-savebar .btn { + margin-bottom: 0; +} + +/* ---- Filter facets: fieldset.app-facet ------------------------------ */ + +main#main-content .app-facet { + border: 1px solid #d6d6d6; + border-radius: 6px; + padding: 8px 12px 4px; + margin-bottom: 12px; +} + +main#main-content .app-facet legend { + font-size: 14px; + font-weight: 700; + color: #182b49; + border: 0; + width: auto; + padding: 0 4px; + margin: 0; +} + +main#main-content .app-facet .checkbox label { + min-height: 32px; + padding-top: 4px; +} + +/* ---- Record details: dl.app-details --------------------------------- */ + +main#main-content .app-details dt { + color: #595959; + font-weight: 700; +} + +main#main-content .app-details dd { + margin-bottom: 8px; + color: #182b49; +} + +/* ---- Data table helpers --------------------------------------------- */ + +main#main-content .app-table { + width: 100%; +} + +main#main-content .app-table td, +main#main-content .app-table th { + vertical-align: middle; +} + +main#main-content .app-table input[type="checkbox"] { + width: 20px; + height: 20px; + margin: 0; +} + +/* ---- Empty state ---------------------------------------------------- */ + +main#main-content .app-empty { + text-align: center; + padding: 24px 12px; + border: 2px dashed #d6d6d6; + border-radius: 8px; + color: #595959; +} + +main#main-content .app-empty .glyphicon { + font-size: 32px; + color: #00629b; + display: block; + margin-bottom: 8px; +} + +/* ---- Paired buttons: give secondary buttons the same size as the primary + one (the Decorator only sizes .btn-primary / .jumbotron .btn) ---- */ + +main#main-content .app-savebar .btn, +main#main-content .app-modal .modal-footer .btn { + min-height: 44px; + min-width: 120px; + padding: 0.8em 1.5em; + font-size: 0.9375em; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; + border-radius: 8px; +} + +/* ---- Count badge on a tab ------------------------------------------- */ + +main#main-content .app-tabs .badge { + background: #182b49; +} + +/* ---- Readable item-list titles at any heading level ----------------- */ + +main#main-content .app-list .list-group-item-heading { + font-size: 16px; +} + +/* ==================================================================== * + * Dashboard building blocks * + * ==================================================================== */ + +/* ---- Panel: a bordered region inside a dashboard ------------------- */ + +main#main-content .app-panel { + border: 1px solid #d6d6d6; + border-radius: 8px; + padding: 12px 16px; + margin-bottom: 16px; + background: #fff; +} + +main#main-content .app-panel-title { + font-family: Roboto, sans-serif; + font-size: 15px; + font-weight: 700; + color: #182b49; + letter-spacing: 0.02em; + margin: 0 0 10px; +} + +/* ---- KPI with trend: div.styled.app-stat + .app-trend -------------- */ + +main#main-content .app-trend { + display: block; + margin-top: 4px; + font-size: 13px; + color: #182b49; +} + +main#main-content .app-trend .glyphicon { + font-size: 11px; + margin-right: 2px; +} + +/* ---- Data bars: ul.app-bars --------------------------------------- */ + +main#main-content .app-bars { + list-style: none; + padding: 0; + margin: 0; +} + +main#main-content .app-bars li { + display: grid; + grid-template-columns: minmax(90px, 34%) 1fr auto; + align-items: center; + gap: 10px; + padding: 5px 0; +} + +main#main-content .app-bar-label { + color: #182b49; + font-size: 14px; +} + +main#main-content .app-bar-track { + display: block; + height: 14px; + background: #ececec; + border-radius: 7px; + overflow: hidden; +} + +main#main-content .app-bar-fill { + display: block; + height: 100%; + background: #00629b; + border-radius: 7px; +} + +main#main-content .app-bar-fill.app-bar-alt { + background: #182b49; +} + +main#main-content .app-bar-fill.app-bar-attn { + background: #ffcd00; +} + +main#main-content .app-bar-value { + font-weight: 700; + color: #182b49; + font-size: 14px; + min-width: 3.5em; + text-align: right; +} + +/* Width steps for .app-bar-fill (5% increments) */ +main#main-content .app-w-0 { width: 0%; } +main#main-content .app-w-5 { width: 5%; } +main#main-content .app-w-10 { width: 10%; } +main#main-content .app-w-15 { width: 15%; } +main#main-content .app-w-20 { width: 20%; } +main#main-content .app-w-25 { width: 25%; } +main#main-content .app-w-30 { width: 30%; } +main#main-content .app-w-35 { width: 35%; } +main#main-content .app-w-40 { width: 40%; } +main#main-content .app-w-45 { width: 45%; } +main#main-content .app-w-50 { width: 50%; } +main#main-content .app-w-55 { width: 55%; } +main#main-content .app-w-60 { width: 60%; } +main#main-content .app-w-65 { width: 65%; } +main#main-content .app-w-70 { width: 70%; } +main#main-content .app-w-75 { width: 75%; } +main#main-content .app-w-80 { width: 80%; } +main#main-content .app-w-85 { width: 85%; } +main#main-content .app-w-90 { width: 90%; } +main#main-content .app-w-95 { width: 95%; } +main#main-content .app-w-100 { width: 100%; } + +/* ---- Status badge: span.app-status[data-status] -------------------- */ + +main#main-content .app-status { + display: inline-block; + font-size: 13px; + font-weight: 700; + padding: 3px 10px; + border-radius: 12px; + white-space: nowrap; + border: 1px solid transparent; +} + +main#main-content .app-status[data-status="ok"] { + color: #00629b; + border-color: #00629b; + background: #fff; +} + +main#main-content .app-status[data-status="warn"] { + color: #182b49; + background: #ffcd00; +} + +main#main-content .app-status[data-status="down"] { + color: #fff; + background: #182b49; +} + +main#main-content .app-status[data-status="info"] { + color: #182b49; + background: #f5f0e6; +} + +/* ---- Status list: .list-group.app-status-list --------------------- */ + +main#main-content .app-status-list .list-group-item { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 6px; + min-height: 44px; + color: #182b49; +} + +main#main-content .app-status-list .app-status-name { + font-weight: 700; +} + +main#main-content .app-status-list .app-muted { + flex-basis: 100%; +} + +/* ---- Deadline timeline: ol.app-timeline --------------------------- */ + +main#main-content .app-timeline { + list-style: none; + padding: 0 0 0 16px; + margin: 0; + border-left: 3px solid #d6d6d6; +} + +main#main-content .app-timeline li { + position: relative; + padding: 0 0 14px 14px; +} + +main#main-content .app-timeline li::before { + content: ""; + position: absolute; + left: -25px; + top: 4px; + width: 15px; + height: 15px; + border-radius: 50%; + background: #fff; + border: 3px solid #00629b; +} + +main#main-content .app-timeline li[data-urgent]::before { + background: #ffcd00; + border-color: #182b49; +} + +main#main-content .app-timeline-date { + display: block; + font-size: 13px; + font-weight: 700; + color: #00629b; + text-transform: uppercase; + letter-spacing: 0.04em; +} + +main#main-content .app-timeline-title { + display: block; + color: #182b49; + font-weight: 700; +} + +/* ---- Checklist: ul.app-checklist ---------------------------------- */ + +main#main-content .app-checklist { + list-style: none; + padding: 0; + margin: 0; +} + +main#main-content .app-checklist li { + padding: 6px 0 6px 30px; + position: relative; + color: #182b49; + border-bottom: 1px solid #ececec; +} + +main#main-content .app-checklist li .glyphicon { + position: absolute; + left: 4px; + top: 9px; + color: #00629b; +} + +main#main-content .app-checklist li[data-done] { + color: #595959; +} + +/* ---- Filter bar: form.form-inline.app-filterbar ------------------- */ + +main#main-content .app-filterbar { + display: flex; + flex-wrap: wrap; + align-items: flex-end; + gap: 10px 14px; + padding: 10px 12px; + margin-bottom: 16px; + background: #f5f0e6; + border-radius: 8px; +} + +main#main-content .app-filterbar .form-group { + margin: 0; +} + +main#main-content .app-filterbar label { + display: block; + font-size: 13px; + color: #182b49; + margin-bottom: 2px; +} + +main#main-content .app-filterbar .app-filter-control { + min-height: 44px; +} + +main#main-content .app-filterbar .btn { + min-height: 44px; + margin-bottom: 0; +} + +/* ---- Grid of small tiles (rooms, locations) ----------------------- */ + +main#main-content .app-tiles { + list-style: none; + padding: 0; + margin: 0; + display: grid; + grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); + gap: 8px; +} + +main#main-content .app-tiles li { + border: 1px solid #d6d6d6; + border-radius: 6px; + padding: 8px 10px; + color: #182b49; +} + +main#main-content .app-tiles li strong { + display: block; +} + +/* ---- Working-example extras --------------------------------------- */ + +main#main-content .app-live-count { + font-weight: 700; + color: #182b49; +} diff --git a/user-guide/css/guide.css b/user-guide/css/guide.css new file mode 100644 index 0000000..d46be73 --- /dev/null +++ b/user-guide/css/guide.css @@ -0,0 +1,650 @@ +/* + * Decorator Kit Developer Guide — canvas styles. + * + * Every rule is scoped under main#main-content and a guide-* class that only + * exists inside the canvas. Nothing here names a chrome class or id, paints + * the page ground, or overrides a Decorator module. Colors are the verified + * Decorator values (see CLAUDE.md, "Verified chrome facts"). + */ + +/* ---- Section rhythm ---------------------------------------------------- */ + +main#main-content .guide-section { + padding-top: 24px; + margin-bottom: 48px; + border-top: 1px solid #d6d6d6; +} + +main#main-content .guide-section:first-of-type { + border-top: 0; +} + +main#main-content .guide-intro { + font-size: 18px; + line-height: 1.6; + max-width: 760px; +} + +main#main-content .guide-meta { + color: #595959; + font-size: 14px; +} + +/* ---- Specimen card ------------------------------------------------------ */ + +main#main-content .guide-specimen { + border: 1px solid #d6d6d6; + border-radius: 8px; + margin: 0 0 32px; + overflow: hidden; +} + +main#main-content .guide-specimen-head { + padding: 16px 20px 8px; +} + +main#main-content .guide-specimen-head h3 { + font-family: Roboto, sans-serif; + font-weight: 700; + font-size: 20px; + color: #182b49; + margin: 0 0 4px; +} + +main#main-content .guide-specimen-head p { + margin: 0 0 8px; +} + +main#main-content .guide-classes code { + display: inline-block; + margin: 0 4px 4px 0; + color: #182b49; + background: #f5f0e6; +} + +main#main-content .guide-preview { + padding: 20px; + border-top: 1px dashed #d6d6d6; + border-bottom: 1px dashed #d6d6d6; +} + +main#main-content .guide-preview-flush { + padding: 0; +} + +main#main-content .guide-preview-label { + display: block; + font-size: 12px; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; + color: #595959; + margin: 0 0 12px; +} + +main#main-content .guide-preview-flush .guide-preview-label { + margin: 12px 20px; +} + +/* ---- Prompt block: an inset panel inside the card ---------------------- */ + +main#main-content .guide-prompt { + margin: 16px 20px 20px; + padding: 14px 16px 16px; + background: #f6f7f9; + border: 1px solid #e3e5e8; + border-radius: 12px; + color: #182b49; +} + +main#main-content .guide-prompt-bar { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 8px; + margin-bottom: 8px; +} + +main#main-content .guide-prompt-title { + display: flex; + align-items: center; + gap: 8px; + font-size: 13px; + font-weight: 700; + letter-spacing: 0.02em; + color: #182b49; + margin: 0; +} + +main#main-content .guide-prompt-title .glyphicon { + display: inline-flex; + align-items: center; + justify-content: center; + width: 26px; + height: 26px; + border-radius: 7px; + background: rgba(0, 98, 155, 0.1); + color: #00629b; + font-size: 12px; + top: 0; +} + +main#main-content .guide-prompt pre { + background: #fff; + border: 1px solid #e3e5e8; + border-radius: 8px; + color: #182b49; + margin: 0; + padding: 14px 16px; + font-size: 13.5px; + line-height: 1.65; + white-space: pre-wrap; + word-break: normal; + overflow-wrap: anywhere; +} + +main#main-content .guide-copy { + display: inline-flex; + align-items: center; + gap: 6px; + min-height: 44px; + min-width: 44px; + padding: 8px 18px; + border: 1px solid #cfd5dc; + border-radius: 22px; + background: #fff; + color: #182b49; + font-weight: 700; + font-size: 14px; + box-shadow: 0 1px 2px rgba(24, 43, 73, 0.06); + transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; +} + +main#main-content .guide-copy .glyphicon { + top: 0; + font-size: 13px; +} + +main#main-content .guide-copy:hover { + border-color: #00629b; + color: #00629b; +} + +main#main-content .guide-copy:focus { + outline: 3px solid #ffcd00; + outline-offset: 2px; +} + +main#main-content .guide-copy.is-copied, +main#main-content .guide-copy.is-copied:hover { + background: #00629b; + border-color: #00629b; + color: #fff; +} + +@media (prefers-reduced-motion: reduce) { + main#main-content .guide-copy { + transition: none; + } +} + +main#main-content .guide-source { + padding: 10px 20px; + font-size: 13px; + color: #595959; + margin: 0; +} + +/* ---- Layout wireframes -------------------------------------------------- */ + +main#main-content .guide-wire { + border: 1px solid #b3b3b3; + border-radius: 6px; + overflow: hidden; + font-size: 12px; + font-weight: 700; + letter-spacing: 0.04em; + text-transform: uppercase; + margin-bottom: 12px; +} + +main#main-content .guide-wire-band { + padding: 6px 10px; + color: #fff; +} + +main#main-content .guide-wire-header { background: #2b92b9; } +main#main-content .guide-wire-title { background: #fff; color: #182b49; border-bottom: 1px solid #d6d6d6; } +main#main-content .guide-wire-nav { background: #00629b; } +main#main-content .guide-wire-footer { background: #00629b; } + +main#main-content .guide-wire-body { + display: flex; + gap: 6px; + padding: 6px; + min-height: 150px; + background: #fff; +} + +main#main-content .guide-wire-col { + border-radius: 4px; + padding: 8px; + display: flex; + align-items: center; + justify-content: center; + text-align: center; +} + +main#main-content .guide-wire-canvas { + flex: 3; + background: #fff3c2; + border: 2px dashed #c9a100; + color: #5c4a00; +} + +main#main-content .guide-wire-side { + flex: 1; + background: #f5f0e6; + color: #182b49; +} + +main#main-content .guide-wire-stack { + flex-direction: column; + gap: 6px; + padding: 6px; +} + +main#main-content .guide-wire-stack .guide-wire-col { + width: 100%; +} + +main#main-content .guide-wire-hero { + background: #182b49; + color: #fff; + min-height: 60px; +} + +main#main-content .guide-wire-legend { + font-size: 13px; + color: #595959; +} + +main#main-content .guide-wire-legend span { + display: inline-block; + width: 14px; + height: 14px; + vertical-align: -2px; + margin-right: 4px; + border-radius: 3px; +} + +main#main-content .guide-wire-legend .guide-key-canvas { + background: #fff3c2; + border: 2px dashed #c9a100; +} + +main#main-content .guide-wire-legend .guide-key-chrome { + background: #00629b; +} + +/* ---- Color swatches ----------------------------------------------------- */ + +main#main-content .guide-swatches { + list-style: none; + padding: 0; + margin: 0; + display: grid; + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + gap: 12px; +} + +main#main-content .guide-swatches li { + border: 1px solid #d6d6d6; + border-radius: 6px; + overflow: hidden; + font-size: 13px; +} + +main#main-content .guide-swatch-chip { + height: 64px; +} + +main#main-content .guide-swatch-text { + padding: 8px 10px; +} + +main#main-content .guide-swatch-text strong { + display: block; +} + +main#main-content .guide-chip-blue { background: #00629b; } +main#main-content .guide-chip-navy { background: #182b49; } +main#main-content .guide-chip-yellow { background: #ffcd00; } +main#main-content .guide-chip-header { background: #2b92b9; } +main#main-content .guide-chip-active { background: #004268; } +main#main-content .guide-chip-sand { background: #f5f0e6; } + +/* ---- Do / don't --------------------------------------------------------- */ + +main#main-content .guide-rule-list { + padding-left: 0; + list-style: none; +} + +main#main-content .guide-rule-list li { + padding: 8px 0 8px 32px; + position: relative; + border-bottom: 1px solid #ececec; +} + +main#main-content .guide-rule-list .glyphicon { + position: absolute; + left: 4px; + top: 11px; +} + +main#main-content .guide-do .glyphicon { color: #00629b; } +main#main-content .guide-dont .glyphicon { color: #182b49; } + +/* ---- Recipes ------------------------------------------------------------ */ + +main#main-content .guide-recipe-stack { + counter-reset: guide-step; + list-style: none; + padding: 0; + margin: 0 0 8px; +} + +main#main-content .guide-recipe-stack li { + counter-increment: guide-step; + padding: 8px 12px 8px 44px; + margin-bottom: 6px; + background: #f5f0e6; + border-radius: 6px; + position: relative; +} + +main#main-content .guide-recipe-stack li::before { + content: counter(guide-step); + position: absolute; + left: 10px; + top: 7px; + width: 24px; + height: 24px; + line-height: 24px; + text-align: center; + border-radius: 50%; + background: #00629b; + color: #fff; + font-weight: 700; + font-size: 13px; +} + +/* ---- Visible focus for canvas links ------------------------------------- */ + +main#main-content .guide-section a:focus, +main#main-content .guide-specimen a:focus { + outline: 3px solid #ffcd00; + outline-offset: 2px; +} + +/* Tiles, news and CTA images in previews keep their module sizing; this only + caps the preview images the guide itself adds. */ +main#main-content .guide-preview figure img { + max-width: 100%; + height: auto; +} + +/* Live region for copy feedback */ +main#main-content .guide-status { + min-height: 1px; +} + +/* ---- Brand-status tags (app patterns page) ------------------------------ */ + +main#main-content .guide-tag { + display: inline-block; + font-size: 12px; + font-weight: 700; + letter-spacing: 0.04em; + text-transform: uppercase; + padding: 3px 8px; + border-radius: 4px; + margin: 0 6px 6px 0; + border: 1px solid transparent; +} + +main#main-content .guide-tag-decorator { + background: #00629b; + color: #fff; +} + +main#main-content .guide-tag-neutral { + background: #fff; + color: #182b49; + border-color: #182b49; +} + +main#main-content .guide-tag-layer { + background: #ffcd00; + color: #182b49; +} + +main#main-content .guide-tag-source { + background: #f5f0e6; + color: #182b49; +} + +/* Responsive-utility demo chips */ +main#main-content .guide-bp { + display: inline-block; + padding: 10px 14px; + border-radius: 6px; + background: #182b49; + color: #fff; + font-weight: 700; +} + +/* ---- Page index: grouped cards ----------------------------------------- */ + +main#main-content .guide-index-lead { + color: #595959; + font-size: 16px; + margin: 0 0 20px; +} + +main#main-content .guide-index-grid { + display: flex; + flex-wrap: wrap; +} + +main#main-content .guide-index-grid > [class*="col-"] { + display: flex; + margin-bottom: 24px; +} + +main#main-content .guide-index-card { + flex: 1; + background: #fff; + border: 1px solid #e3e5e8; + border-radius: 14px; + box-shadow: 0 1px 2px rgba(24, 43, 73, 0.06), 0 6px 20px rgba(24, 43, 73, 0.06); + overflow: hidden; +} + +main#main-content .guide-index-head { + display: flex; + align-items: flex-start; + gap: 12px; + padding: 18px 18px 14px; +} + +main#main-content .guide-index-head > div { + flex: 1; + min-width: 0; +} + +main#main-content .guide-index-head h3 { + font-family: Roboto, sans-serif; + font-size: 18px; + font-weight: 700; + line-height: 1.3; + color: #182b49; + margin: 2px 0 2px; +} + +main#main-content .guide-index-head p { + font-size: 14px; + color: #595959; + margin: 0; +} + +main#main-content .guide-index-icon { + flex: none; + display: flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + border-radius: 10px; + background: rgba(0, 98, 155, 0.1); + color: #00629b; + font-size: 18px; +} + +main#main-content .guide-index-count { + flex: none; + min-width: 28px; + padding: 2px 9px; + border-radius: 12px; + background: #f1f2f4; + color: #182b49; + font-size: 13px; + font-weight: 700; + text-align: center; + margin-top: 4px; +} + +main#main-content .guide-index-list { + list-style: none; + margin: 0; + padding: 0 0 6px; +} + +main#main-content .guide-index-list li + li a { + box-shadow: inset 0 1px 0 #eceef1; +} + +main#main-content .guide-index-list a { + display: flex; + align-items: center; + gap: 12px; + min-height: 56px; + padding: 9px 18px; + color: #182b49; + text-decoration: none; + transition: background-color 0.15s ease; +} + +main#main-content .guide-index-list a:hover { + background: rgba(0, 98, 155, 0.06); +} + +main#main-content .guide-index-list a:focus { + outline: 3px solid #ffcd00; + outline-offset: -3px; + background: rgba(0, 98, 155, 0.06); +} + +main#main-content .guide-index-text { + flex: 1; + min-width: 0; +} + +main#main-content .guide-index-title { + display: block; + font-size: 15px; + font-weight: 600; + line-height: 1.35; +} + +main#main-content .guide-index-list a:hover .guide-index-title, +main#main-content .guide-index-list a:focus .guide-index-title { + color: #00629b; +} + +main#main-content .guide-index-sub { + display: block; + font-size: 13px; + line-height: 1.4; + color: #595959; + margin-top: 1px; +} + +main#main-content .guide-index-list .glyphicon-chevron-right { + flex: none; + font-size: 11px; + color: #9aa3ad; +} + +main#main-content .guide-index-list a:hover .glyphicon-chevron-right, +main#main-content .guide-index-list a:focus .glyphicon-chevron-right { + color: #00629b; +} + +main#main-content .guide-index-pill { + display: inline-block; + margin-left: 6px; + padding: 1px 8px; + border-radius: 10px; + background: #ffcd00; + color: #182b49; + font-size: 11px; + font-weight: 700; + letter-spacing: 0.04em; + text-transform: uppercase; + vertical-align: 1px; +} + +@media (prefers-reduced-motion: reduce) { + main#main-content .guide-index-list a { + transition: none; + } +} + +main#main-content .guide-backtop { + text-align: right; + font-size: 14px; + margin: -8px 0 0; +} + +main#main-content .guide-backtop a { + display: inline-block; + min-height: 44px; + padding: 12px 4px; +} + +main#main-content .guide-area { + display: block; + font-size: 12px; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; + color: #00629b; + margin-bottom: 2px; +} + +main#main-content .guide-step-prompts .guide-prompt + .guide-prompt { + margin-top: -8px; +} + +/* ---- Page subtitle under the h1 ----------------------------------------- */ + +main#main-content .guide-subtitle { + font-size: 20px; + line-height: 1.45; + color: #182b49; + max-width: 760px; + margin: -4px 0 16px; +} diff --git a/user-guide/img/avatar-a-128.jpg b/user-guide/img/avatar-a-128.jpg new file mode 100644 index 0000000..fdf1ab7 Binary files /dev/null and b/user-guide/img/avatar-a-128.jpg differ diff --git a/user-guide/img/avatar-b-128.jpg b/user-guide/img/avatar-b-128.jpg new file mode 100644 index 0000000..102efe2 Binary files /dev/null and b/user-guide/img/avatar-b-128.jpg differ diff --git a/user-guide/img/cta-faculty-550x370.jpg b/user-guide/img/cta-faculty-550x370.jpg new file mode 100644 index 0000000..9c1c600 Binary files /dev/null and b/user-guide/img/cta-faculty-550x370.jpg differ diff --git a/user-guide/img/cta-staff-550x370.jpg b/user-guide/img/cta-staff-550x370.jpg new file mode 100644 index 0000000..9f244ba Binary files /dev/null and b/user-guide/img/cta-staff-550x370.jpg differ diff --git a/user-guide/img/news-building-388x246.jpg b/user-guide/img/news-building-388x246.jpg new file mode 100644 index 0000000..82c5107 Binary files /dev/null and b/user-guide/img/news-building-388x246.jpg differ diff --git a/user-guide/img/news-faculty-388x246.jpg b/user-guide/img/news-faculty-388x246.jpg new file mode 100644 index 0000000..761d931 Binary files /dev/null and b/user-guide/img/news-faculty-388x246.jpg differ diff --git a/user-guide/img/news-staff-388x246.jpg b/user-guide/img/news-staff-388x246.jpg new file mode 100644 index 0000000..dde9bc7 Binary files /dev/null and b/user-guide/img/news-staff-388x246.jpg differ diff --git a/user-guide/img/tile-building-550x370.jpg b/user-guide/img/tile-building-550x370.jpg new file mode 100644 index 0000000..491348b Binary files /dev/null and b/user-guide/img/tile-building-550x370.jpg differ diff --git a/user-guide/img/tile-faculty-550x370.jpg b/user-guide/img/tile-faculty-550x370.jpg new file mode 100644 index 0000000..ab07001 Binary files /dev/null and b/user-guide/img/tile-faculty-550x370.jpg differ diff --git a/user-guide/img/tile-staff-550x370.jpg b/user-guide/img/tile-staff-550x370.jpg new file mode 100644 index 0000000..9f244ba Binary files /dev/null and b/user-guide/img/tile-staff-550x370.jpg differ diff --git a/user-guide/index.html b/user-guide/index.html new file mode 100644 index 0000000..390197d --- /dev/null +++ b/user-guide/index.html @@ -0,0 +1,1420 @@ + + + + + Decorator Kit Developer Guide + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to main content +
+
+
+
+ +
+ +
+
+ + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+
+ +

Decorator Kit Developer Guide

+ +

Layouts, components, app patterns, and copy-ready prompts for building on Decorator 5.

+ +

A visual reference for building UC San Diego pages and apps with an AI + agent. Every example on this page is live Decorator 5 markup, and each one has a prompt + you can copy and adapt. Use the prompts on their own, or combine them into the app recipes + further down.

+ +

Built on ucsd-decorator-v5@5.0.4 · + Bootstrap 3.3.7 as served from cdn.ucsd.edu · Markup sourced from + node_modules/ucsd-decorator-v5/dist/

+ +
+ + +
+

Start here

+ +

The kit's rules already tell the agent to stay inside the canvas, read markup from the + npm package, and load the Decorator from the CDN. A good prompt adds the four decisions + the agent is not allowed to make for you:

+ +
    +
  1. Template: which layout to start from. The agent will stop and ask + if you leave this out.
  2. +
  3. File: the new page name. Say so if it should replace + index.html.
  4. +
  5. Pieces: the modules and components to use, by name. The names + on this page match the reference files.
  6. +
  7. Content: real headings, copy, links, and data, or say which + parts are placeholders.
  8. +
+ +
+
+

Prompt template

+

Fill in the brackets. Delete any line you don't need.

+
+
+
+

Prompt

+ +
+
Start from the Decorator [two-column.html] template and save it as [page-name.html] at the project root.
+Site title: [Department name]. Navigation items: [Home, About, Services, Contact] — update the drawer, the navbar, and the side nav.
+In the canvas, build:
+1. [module or component name] — [what it says / does]
+2. [module or component name] — [what it says / does]
+3. [module or component name] — [what it says / does]
+Images: [real paths + alt text, or "use placeholders at the module's documented size"].
+Custom behavior goes in js/[name].js. Styles go in css/[name].css, scoped to main#main-content.
+Don't use Bootstrap -success/-info/-warning/-danger classes. Keep every chrome region as shipped.
+
+
+
+ + +
+

Layout templates

+ +

Four templates cover almost every page. The yellow dashed area is the canvas, + the only part the agent may edit. The blue bands are chrome: the header, + navbar, drawer, search, and footer. They look the same on every page.

+ +

Canvas (editable) +    Chrome (do not edit)

+ +
+
+
+
+

blank-slate.html

+

Full-width canvas under the navbar. Best for apps, dashboards, and + single-purpose tools.

+
+
+ +
+
+
+

Prompt

+ +
+
Use blank-slate.html. Copy it to [app.html] and rewrite its CSS and script paths to cdn.ucsd.edu. Replace only what's inside main#main-content with [describe the app].
+
+
+
+ +
+
+
+

two-column.html

+

Side navigation plus a wide content column. Best for department pages + and documentation. This guide uses it.

+
+
+ +
+
+
+

Prompt

+ +
+
Use two-column.html. Save it as [about.html]. Keep pull-right on the main section and keep the DOM order as shipped. Side nav (article.main-content-nav) lists: [items]. Canvas content: [modules].
+
+
+
+
+ +
+
+
+
+

three-column.html

+

Left menu, wide middle column, and a right column for related links, + contacts, or alerts.

+
+
+ +
+
+
+

Prompt

+ +
+
Use three-column.html. Save it as [resources.html]. Left menu: [items]. Middle: [content]. Right info column: a .msg.info note with [office hours] and a list of [related links].
+
+
+
+ +
+
+
+

homepage.html

+

Carousel hero and stacked callout modules. For a site's landing page.

+
+
+ +
+
+
+

Prompt

+ +
+
Use homepage.html as the new index.html (overwrite is OK). Hero: [3] slides at 1440 × 530 with headlines [..]. Below it, stack: callout content with 3 boxes, tiles with links, and news with images.
+
+
+
+
+
+ + +
+

Brand basics

+ +
+
+

Decorator colors

+

These are the values the Decorator itself uses. Use them for your canvas CSS + instead of inventing new ones.

+
+
+
    +
  • UC San Diego Blue#00629B · buttons, footer
  • +
  • Navy#182B49 · h2, text links, hovers
  • +
  • Gold#FFCD00 · .styled-yellow, alerts
  • +
  • Header#2B92B9 · .layout-header (chrome)
  • +
  • Active nav#004268 · navbar active item
  • +
  • Sand#F5F0E6 · .msg.info, div.styled
  • +
+
+

Source: dist/css/base.css, checked against the live + cdn.ucsd.edu stylesheet.

+
+ +
+
+

Typography

+

h1 and h2 get Teko SemiBold and a brand color (on the CDN build, h2 is navy). From + h3 down there's no brand styling unless the heading sits inside a + module wrapper, so put lower headings in a module.

+

h1h2div.styled.text-link

+
+
+ Live preview +

The section headings on this page are h2. Body copy is Roboto. Inline links use the Decorator link + color.

+
+

Inside div.styled

+

A sand box that gives h3–h6 the brand blue. Use it + for asides and "on this page" boxes.

+
+
+
+
+

Prompt

+ +
+
Use one h1 per page and h2 for each section. If a section needs h3 headings, put them inside a Decorator module wrapper or a div.styled box. Don't restyle the headings. Fonts are Roboto and Teko only.
+
+
+
+ + +
+

Components

+ +

Bootstrap 3 loads on every Decorator page, but the Decorator only restyles some of it. + The components below are the on-brand ones. Anything that paints a color and isn't + styled in base.css renders in stock Bootstrap blue, green, or red. See + Guardrails.

+ +
+

App patterns

+ Building an app? Tabs, side menus, toolbars, list groups, pagination, modals and + responsive helpers each have their own page: App Patterns. + It also has complete app shells and + starter dashboards for campus areas. +
+ + +
+
+

Buttons

+

The Decorator restyles -primary and -default. For a gold + call to action, use .styled-yellow.

+

.btn.btn-primary.btn.btn-default.btn.styled-yellow.btn-block

+
+
+ Live preview + + + Gold CTA +
+
+
+

Prompt

+ +
+
Add a primary action button "[Apply now]" (btn btn-primary) and a secondary "[Learn more]" (btn btn-default), using the markup in kitchen-sink/buttons.html. Use a <button> for actions and an <a> for navigation. No btn-success/-info/-warning/-danger.
+
+

Source: dist/kitchen-sink/buttons.html

+
+ + +
+
+

Messages and alerts

+

Use the Decorator's own message boxes, not Bootstrap's alert-info + family. .msg.alert is gold with a warning icon and + .msg.info is sand with an info icon.

+

.msg.alert.msg.info

+
+
+ Live preview +
+

Alert

+ Registration closes Friday at 5 p.m. +
+
+

Note

+ Office hours are Monday–Thursday, 9 a.m.–4 p.m. +
+
+
+
+

Prompt

+ +
+
Show a deadline warning using the Decorator .msg.alert box (from kitchen-sink/alerts.html, "Legacy Alert Styles"), with heading "[Alert]" and text "[..]". Use .msg.info for neutral notes. Don't use Bootstrap alert-info/-success/-warning/-danger.
+
+

Source: dist/kitchen-sink/alerts.html, "Legacy Alert Styles"

+
+ + +
+
+

Breadcrumbs

+

Every template puts one at the top of the canvas. Point each link at a real page.

+

ol.breadcrumb.breadcrumbs-listli.active

+
+
+ Live preview + +
+
+
+

Prompt

+ +
+
Set the breadcrumb to Home › [Section] › [This page]. Resolve each href relative to this page's own folder.
+
+
+ + +
+
+

Forms

+

Stock Bootstrap 3 form markup. The Decorator restyles .form-control. + Every input gets a <label for> and a standard + autocomplete value.

+

.form-group.form-control.checkbox.help-block

+
+
+ Live preview +
+
+
+ + +
+
+ + +

Use your @ucsd.edu address.

+
+
+
+ + +
+
+ +
+ +
+
+
+
+

Prompt

+ +
+
Build a [contact] form using the Bootstrap 3 markup in kitchen-sink/forms.html (basic example). Fields: [name, email, topic select, message textarea]. Bind each label with for/id, use standard autocomplete values, no autofocus. Show validation errors above the form in a .msg.alert box. Put the submit logic in js/[form-name].js.
+
+

Source: dist/kitchen-sink/forms.html, "Basic example"

+
+ + +
+
+

Input group with button

+

For a search or filter box inside your app. It isn't the site search, which is + chrome.

+

.input-group.input-group-btn

+
+
+ Live preview +
+ +
+ + + + +
+
+
+
+
+

Prompt

+ +
+
Add a filter box above the [course list] using the "Button addons" input group from kitchen-sink/input_groups.html, with an .sr-only label. Scope any CSS to main#main-content so it can't reach the site search. Filtering logic goes in js/[filter].js.
+
+

Source: dist/kitchen-sink/input_groups.html, "Button addons"

+
+ + +
+
+

Tables

+

The Decorator styles table.styled (gray header) and + table.styled-dark (blue header). Mark alternate rows with + tr.even. Wrap wide tables in .table-responsive.

+

table.styled-darktable.styledtr.even.table-responsive

+
+
+ Live preview +
+ + + + + + + + + + +
Open service requests
TicketRequesterStatus
RQ-1042FacilitiesIn progress
RQ-1043RegistrarWaiting on requester
RQ-1044LibraryClosed
+
+
+
+
+

Prompt

+ +
+
Render [data] as a table.styled-dark inside .table-responsive, with a <caption>, th scope="col", and tr.even on alternate rows. Show status as text, not color alone. If it needs sorting or paging, use the DataTables widget instead (see Widgets).
+
+

Source: dist/css/base.css, "table" section

+
+ + +
+
+

Drawer (accordion)

+

Expandable sections for FAQs and long lists. base.min.js handles the + expand and collapse, so you write no JavaScript.

+

.drawer-wrapper.drawerh2 > a

+
+
+ Live preview +
+
+

Who can submit a request?

+
+

Any current faculty, staff, or student with an active UC San Diego + account.

+
+

How long does review take?

+
+

Most requests are reviewed within three business days.

+
+
+
+
+
+
+

Prompt

+ +
+
Add an FAQ using the drawer module (.drawer-wrapper > .drawer, from the Text and Headline module in templates/modules.html). Questions: [..]. Keep the h2 > a / div pairs exactly as shipped, and don't add accordion JavaScript — base.min.js already handles it.
+
+

Source: dist/templates/modules.html and dist/kitchen-sink/javascript_components.html, "Drawers"

+
+ + +
+
+

Grid, helpers, and Glyphicons

+

Colorless Bootstrap layout and utility classes are safe anywhere in the canvas. + Icons are Glyphicons. Font Awesome isn't part of the Decorator.

+

.row.col-sm-*.col-md-*.img-responsive.sr-only.text-center.list-unstyled.glyphicon

+
+
+ Live preview +
+
+

Schedule

+
+
+

Contact

+
+
+

Location

+
+
+
+
+
+

Prompt

+ +
+
Lay out [three feature blurbs] in a Bootstrap 3 .row with .col-sm-4 columns. Use Glyphicons with aria-hidden="true" next to visible text. No Font Awesome.
+
+

Source: dist/kitchen-sink/icons.html, helper_classes.html

+
+
+ + +
+

Modules

+ +

Modules are the Decorator's page building blocks. Copy each module's wrapper, grid, and + classes exactly, and change only the text, image src/alt, and + link href. Each one is designed for a single image size; images at other + sizes get cropped.

+ + +
+
+

Full-width text and CTA

+

A headline, a short paragraph, and one button on a textured band.

+

.jumbotron.jumbotron-full-width.side-image-white.bubbles

+
+
+ Live preview +
+
+
+
+

Research Computing Help

+

Get storage, compute time, and one-on-one consulting for your lab's + research projects.

+ Request support +
+
+
+
+
+
+
+

Prompt

+ +
+
Add the full-width text and CTA module (jumbotron jumbotron-full-width side-image-white bubbles) from templates/two-column.html. Headline: "[..]". Blurb: "[..]". Button: "[..]" linking to [url].
+
+
+ + +
+
+

Call to action with image

+

Text on one side and an image on the other. Flip the column order to put the image + on the left. Image size: 550 × 370.

+

.jumbotron.side-image-white.col-md-6figure > img.img-responsive

+
+
+ Live preview +
+
+
+
+

Who We Are

+

Our staff supports faculty, students, and partners with timely, + innovative services. Meet the team behind every program.

+

Meet the staff

+
+
+
+ Staff members talking in a campus office +
+
+
+
+
+
+
+
+

Prompt

+ +
+
Add a "Text and CTA w/Full Height Image Right" module from templates/modules.html. Headline "[..]" (about 25 characters per line, 2 lines max), blurb of about 100 words, button "[..]". Image: [path], 550 × 370, alt "[..]". No text in the image.
+
+
+ + +
+
+

Call to action, sand style

+

The same layout on the Decorator's sand background, with the image on the left. + Image size: 550 × 370.

+

.jumbotron.jumbotron-sand

+
+
+ Live preview +
+
+
+
+
+ Faculty members in a seminar room +
+
+
+

Faculty Mentoring

+

Pair with a faculty mentor in your field for a quarter of guided + research and career advice.

+

Find a mentor

+
+
+
+
+
+
+
+

Prompt

+ +
+
Add the "Dark Background Text and CTA" module (jumbotron jumbotron-sand) from templates/modules.html, with the image on the left. Headline "[..]", blurb "[..]", button "[..]". Image: [path] at 550 × 370 with alt text.
+
+
+ + +
+
+

Callout content, one box

+

One centered panel over a preset background. The class supplies the image, so don't + add your own.

+

.jumbotron-callout-content-one.navy-yellow.panel.panel-primary.panel-text

+
+
+ Live preview + +
+
+
+

Prompt

+ +
+
Add Callout Content One (jumbotron side-image-white jumbotron-callout-content-one navy-yellow) from templates/two-column.html. Use the class background (don't supply an image). Panel heading "[..]", text "[..]", button .styled-yellow "[..]".
+
+
+ + +
+
+

Callout content, two to four boxes

+

Semi-transparent blue panels on a background. Use the .jumbotron-orbs-1 + preset texture, or a custom image at 1200 × 410 + (1200 × 800 for four boxes or longer copy).

+

.jumbotron-callout-content-two.jumbotron-orbs-1.cta-two-three.text-indent

+
+
+ Live preview +
+
+
+
+

Get Started

+
+
+
+
+
+
+

New Students

+

Orientation dates, advising, and your + first-quarter checklist.

+

Start here

+
+
+
+
+
+
+

Transfer Students

+

Credit evaluation, major prep, and + transfer-specific events.

+

Transfer guide

+
+
+
+
+
+
+
+
+
+

Prompt

+ +
+
Add "Callout Content with [2|3|4] boxes" from templates/modules.html with the jumbotron-orbs-1 preset background. Don't carry over the inline style="" background or min-height from the demo. Section headline "[..]". Boxes: [title / one-sentence blurb / text-link] × [n].
+
+
+ + +
+
+

Tiles with links

+

Image tiles with white link text. The images are shaded automatically. Image size: + 550 × 370, cropped to 200px tall, so keep the subject centered.

+

.jumbotron.jumbotron-tile-links.flex.wrapperimg.background-image

+
+
+ Live preview + +
+
+
+

Prompt

+ +
+
Add a tiles-with-links module. Take the flex/wrapper markup from the "Callout Content Blocks" block in templates/modules.html, but change the wrapper class from jumbotron-cta-blocks to jumbotron-tile-links, since the demo class isn't styled. Give every img.background-image an alt attribute (alt="" if the link text says it all). Tiles: [label → url] × [n]. Images at 550 × 370.
+
+
+ + +
+
+

News with images

+

Three linked cards with date and headline. All three images must be + 388 × 246. The CMS also has an auto-populated version driven by + a feed. Its endpoint URL is the only value you should change.

+

.jumbotron.jumbotron-gray.jumbotron-newsa.panel.panel-default.panel-news-date.panel-news-title

+
+ +
+
+

Prompt

+ +
+
Add the "News with Images" module from templates/modules.html. Three items: [date / headline / url / image path + alt]. All images 388 × 246. Keep the a.panel.panel-default card structure, and remove the invalid alt attribute the demo puts on the <a> tags.
+
+
+ + +
+
+

Event listing

+

A stacked list of events with an image, a linked title, and the date and time.

+

.event-listing.date-time.col-md-3 + .col-md-9

+
+
+ Live preview +
+
+
+
+
+
+ +
+
+
+

Fall Open House

+

October 3 from 10 a.m.–2 p.m.

+

Tour the labs, meet faculty, and learn about graduate programs.

+
+
+
+
+
+
+
+
+

Prompt

+ +
+
Add the "Multiple Listings" event module from templates/modules.html (section.jumbotron > .container > .event-listing, one per event). Events: [title / url / date-time text / blurb / image + alt]. For a calendar view instead, use the FullCalendar widget.
+
+
+ +
+
+

Image sizes at a glance

+

The sizes the campus CMS publishes for each module. Every image in the same module + uses the same size.

+
+
+
+ + + + + + + + + + + + + +
Module image sizes
ModuleSize (px)
Hero — homepage1440 × 530
Intro banner — article1500 × 480
Image rotator900 × 335
Call to action / Tiles with links550 × 370
Call to action — inset1200 × 388
Callout content / Text block1200 × 410 (taller: 1200 × 800)
News with images388 × 246
Profile photo198 × 231
+
+
+
+
+ + +
+

Widgets

+ +

Widgets need their own CSS and JavaScript as well as markup. Ask the agent to bring the + widget's <link> and <script> tags across from the + reference page and to put the setup code in a named file under js/. + See live widget demos.

+ +
+
+
+
+

DataTables

+

Sortable, searchable, paged tables for directories and reports.

+
+
+
+

Prompt

+ +
+
Add the DataTables widget from widgets/datatables.html. Bring its CSS and JS tags across and fix their paths. Load the rows from [data.json]. Setup code goes in js/[directory-table].js. Columns: [..].
+
+
+
+
+
+
+

FullCalendar

+

Month, week, and list views of events.

+
+
+
+

Prompt

+ +
+
Add the FullCalendar widget from widgets/fullcalendar.html. Bring its dependencies across. Events come from [events.json]. Setup code goes in js/[calendar].js, with no inline $(document).ready.
+
+
+
+
+
+
+
+
+

Wizard

+

Multi-step forms such as applications or intake.

+
+
+
+

Prompt

+ +
+
Build a [3]-step [application] with the Wizard widget from widgets/wizard.html. Steps: [..]. Each step's fields follow the kitchen-sink/forms.html rules (labels, autocomplete, errors above the form). Setup code goes in js/[wizard].js.
+
+
+
+
+
+
+

MaxChar

+

A live character counter for text areas.

+
+
+
+

Prompt

+ +
+
Add a [500]-character limit to the [message] textarea with the MaxChar widget from widgets/MaxChar.html. Announce the remaining count to screen readers.
+
+
+
+
+
+ + +
+

App recipes

+ +

Recipes combine the pieces above into complete pages. Each numbered list is the canvas + from top to bottom. Copy the prompt and replace the placeholders with your own content.

+ + +
+
+

Department landing page

+

Template: homepage.html

+
    +
  1. Hero carousel with 3 slides at 1440 × 530
  2. +
  3. Callout content with 3 boxes (Students · Research · Give)
  4. +
  5. Tiles with links for the main audiences
  6. +
  7. News with images
  8. +
  9. Event listing for the next three events
  10. +
+
+
+
+

Prompt

+ +
+
Build the landing page for [Department of X] from homepage.html, saved as index.html (overwrite is OK). Rewrite the asset paths to cdn.ucsd.edu.
+Navigation (drawer + navbar): Home, About, Academics, Research, News, Contact.
+Canvas, top to bottom:
+1. Hero with 3 slides (1440 × 530): [headline + link] each.
+2. Callout content with 3 boxes on the jumbotron-orbs-1 preset: Students, Research, Give — one sentence and a text-link each.
+3. Tiles with links (jumbotron-tile-links, not jumbotron-cta-blocks): Faculty, Staff, Visit — 550 × 370 images with alt text.
+4. News with images: 3 items at 388 × 246.
+5. Event listing: next 3 events.
+Use placeholder images at the right sizes where I haven't given one.
+
+
+ + +
+
+

Service request app

+

Template: two-column.html

+
    +
  1. h1 and a short intro paragraph
  2. +
  3. .msg.info with turnaround times
  4. +
  5. Error summary area (.msg.alert, hidden until submit)
  6. +
  7. Request form: name, email, department, type, details (MaxChar)
  8. +
  9. Drawer FAQ
  10. +
+
+
+
+

Prompt

+ +
+
Create request.html from two-column.html for a [Facilities service request] app. Add "Request service" to the drawer, the navbar, and the side nav.
+Canvas:
+1. h1 "Request Service" and a one-paragraph intro.
+2. A .msg.info box: "Most requests are reviewed within 3 business days."
+3. An error summary container above the form that shows a .msg.alert listing each invalid field (with a link to it) after a failed submit.
+4. A Bootstrap 3 form (kitchen-sink/forms.html): full name (autocomplete=name), email (autocomplete=email), department select, request type radio group in a fieldset with a legend, and a details textarea with a 1000-character MaxChar counter. Submit is btn btn-primary.
+5. A drawer FAQ with 3 questions.
+Validation and submit logic go in js/request-form.js. POST to [endpoint] with a CSRF token. Don't log form contents.
+
+
+ + +
+
+

Staff directory

+

Template: blank-slate.html

+
    +
  1. h1 and a filter input group
  2. +
  3. DataTables table from a JSON file
  4. +
  5. Call-to-action module: "Can't find someone?"
  6. +
+
+
+
+

Prompt

+ +
+
Create directory.html from blank-slate.html. Add "Directory" to the drawer and the navbar.
+Canvas:
+1. h1 "Staff Directory" and a one-line intro.
+2. The DataTables widget (widgets/datatables.html) loading data/staff.json with the columns Name, Title, Unit, Email (mailto link), Phone. Bring the widget's CSS/JS across. Setup code goes in js/directory.js.
+3. A sand CTA module (jumbotron-sand): "Can't find someone?" with a btn btn-default linking to [campus directory].
+Escape every value from staff.json before rendering it.
+
+
+ + +
+
+

Status dashboard

+

Template: blank-slate.html

+
    +
  1. h1 with a "last updated" line
  2. +
  3. .msg.alert for active incidents (only when one exists)
  4. +
  5. Callout content with 4 boxes: one per service, status as text
  6. +
  7. table.styled-dark incident history
  8. +
+
+
+
+

Prompt

+ +
+
Create status.html from blank-slate.html for a [service status] dashboard.
+Canvas:
+1. h1 "Service Status" and a "Last updated [time]" paragraph.
+2. When there's an active incident, a .msg.alert with its summary.
+3. Callout content with 4 boxes (jumbotron-callout-content-two, jumbotron-orbs-1): one per service — [Email, Wi-Fi, Canvas, VPN]. Show status as words ("Operational", "Degraded") plus a Glyphicon, never color alone.
+4. A table.styled-dark of the last 10 incidents inside .table-responsive, with a caption and th scope.
+Load the data from [status.json] in js/status.js and escape every value. Don't use label-success/-warning/-danger or progress bars.
+
+
+ + +
+
+

Knowledge base article

+

Template: three-column.html

+
    +
  1. Left menu: article categories
  2. +
  3. Middle: h1, steps, drawer FAQ
  4. +
  5. Right: div.styled "On this page" plus a .msg.info contact box
  6. +
+
+
+
+

Prompt

+ +
+
Create kb/[article-slug].html from three-column.html. Resolve every nav href relative to kb/.
+Left menu: [categories]. Middle column: h1 "[title]", an intro, an ordered list of steps, then a drawer FAQ with [3] questions. Right column: a div.styled box with h3 "On this page" and anchor links to each h2, then a .msg.info box with the help desk contact.
+
+
+
+ + +
+

Guardrails

+ +

The kit's rule files enforce these automatically, and the verify check fails + when one is broken. Writing them into your prompt helps the agent get it right on the + first try.

+ +
+
+
+

Do

+
    +
  • Name the template in every new-page prompt.
  • +
  • Load the Decorator CSS and JS from cdn.ucsd.edu.
  • +
  • Scope every CSS rule to main#main-content.
  • +
  • Put scripts in named files under js/.
  • +
  • Update the drawer, the navbar, and the side nav when you add a page.
  • +
  • Give each module images at its documented size, with alt text.
  • +
  • Keep both search forms, in the drawer and the navbar, as shipped.
  • +
+
+
+
+
+

Don't

+
    +
  • Use *-success, *-info, *-warning, or *-danger classes.
  • +
  • Use pagination, progress-bar, label-*, or list-group. They render in stock Bootstrap colors.
  • +
  • Edit the header, title band, navbar, drawer, search, or footer.
  • +
  • Add <style> blocks or style="" attributes.
  • +
  • Paint the page background or stretch a color past the canvas.
  • +
  • Add Font Awesome or any font besides Roboto, Teko, Brix Sans, or Refrigerator Deluxe.
  • +
  • Copy markup from a browser's DOM inspector or a whole kitchen-sink page.
  • +
+
+
+
+ +
+
+

Review prompt

+

Run this after the agent finishes a page.

+
+
+
+

Prompt

+ +
+
Review [page.html] against the Decorator rules:
+- Is every change inside main#main-content?
+- Do all Decorator CSS/JS tags point at cdn.ucsd.edu?
+- Does any class end in -success/-info/-warning/-danger, or come only from bootstrap.min.css while painting a color?
+- One h1, headings in order, alt text on every image, labels on every input, 44px touch targets?
+- Does the new page appear in the drawer, the navbar, and the side nav?
+Then run `npx ucsd-decorator-kit verify` and report the findings. Don't run it with --accept.
+
+
+ +

Accessibility reference: UC San + Diego website accessibility checklist.

+
+ +
+ + +
+
+
+ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/user-guide/js/guide.js b/user-guide/js/guide.js new file mode 100644 index 0000000..eb70660 --- /dev/null +++ b/user-guide/js/guide.js @@ -0,0 +1,77 @@ +/* + * Decorator Kit Developer Guide — copy-to-clipboard for prompt blocks. + * + * Touches only elements inside the canvas (main#main-content). Each + * button.guide-copy names the
 it copies with data-copy-target.
+ */
+(function () {
+  "use strict";
+
+  var canvas = document.getElementById("main-content");
+  if (!canvas) return;
+
+  var status = canvas.querySelector(".guide-status");
+
+  function announce(message) {
+    if (!status) return;
+    status.textContent = "";
+    window.setTimeout(function () {
+      status.textContent = message;
+    }, 50);
+  }
+
+  function fallbackCopy(text) {
+    var area = document.createElement("textarea");
+    area.value = text;
+    area.setAttribute("readonly", "");
+    area.className = "sr-only";
+    canvas.appendChild(area);
+    area.select();
+    var ok = false;
+    try {
+      ok = document.execCommand("copy");
+    } catch (e) {
+      ok = false;
+    }
+    canvas.removeChild(area);
+    return ok;
+  }
+
+  function flash(button, ok) {
+    var label = button.querySelector(".guide-copy-label");
+    var icon = button.querySelector(".glyphicon");
+    if (!label) return;
+    window.clearTimeout(button._guideTimer);
+    label.textContent = ok ? "Copied" : "Press Ctrl+C";
+    if (icon) icon.className = "glyphicon " + (ok ? "glyphicon-ok" : "glyphicon-copy");
+    button.classList.toggle("is-copied", ok);
+    button._guideTimer = window.setTimeout(function () {
+      label.textContent = "Copy";
+      if (icon) icon.className = "glyphicon glyphicon-copy";
+      button.classList.remove("is-copied");
+    }, 2000);
+  }
+
+  canvas.addEventListener("click", function (event) {
+    var button = event.target.closest("button.guide-copy");
+    if (!button || !canvas.contains(button)) return;
+
+    var target = document.getElementById(button.getAttribute("data-copy-target"));
+    if (!target) return;
+    var text = target.textContent.trim();
+
+    function done(ok) {
+      flash(button, ok);
+      announce(ok ? "Prompt copied to clipboard." : "Copy failed. Select the prompt text and copy it manually.");
+    }
+
+    if (navigator.clipboard && window.isSecureContext) {
+      navigator.clipboard.writeText(text).then(
+        function () { done(true); },
+        function () { done(fallbackCopy(text)); }
+      );
+    } else {
+      done(fallbackCopy(text));
+    }
+  });
+})();
diff --git a/user-guide/js/status-board.js b/user-guide/js/status-board.js
new file mode 100644
index 0000000..4e1c9c3
--- /dev/null
+++ b/user-guide/js/status-board.js
@@ -0,0 +1,58 @@
+/*
+ * Working example: IT service status board (Decorator Kit Developer Guide, App Patterns).
+ *
+ * Progressive enhancement over markup that already lists every service, so
+ * the board is readable with JavaScript off. The script adds filtering (All /
+ * Needs attention), search by name, a live result count for screen readers,
+ * and an empty state. It reads and writes only elements inside #its-board,
+ * which lives in the canvas.
+ *
+ * jQuery is used for the change listener because Bootstrap's button.js
+ * (data-toggle="buttons") announces radio changes with jQuery's trigger(),
+ * which native addEventListener handlers never see.
+ */
+(function ($) {
+  "use strict";
+
+  var board = document.getElementById("its-board");
+  if (!board || !$) return;
+
+  var items = Array.prototype.slice.call(board.querySelectorAll("[data-service]"));
+  var search = board.querySelector("#its-q");
+  var count = board.querySelector(".app-live-count");
+  var empty = board.querySelector(".app-empty");
+  var form = board.querySelector("form.app-toolbar-search");
+
+  function currentFilter() {
+    var checked = board.querySelector('input[name="its-show"]:checked');
+    return checked ? checked.value : "all";
+  }
+
+  function apply() {
+    var filter = currentFilter();
+    var term = (search.value || "").trim().toLowerCase();
+    var shown = 0;
+
+    items.forEach(function (item) {
+      var name = item.getAttribute("data-service").toLowerCase();
+      var status = item.getAttribute("data-status");
+      var visible = (filter === "all" || status !== "ok") && (!term || name.indexOf(term) !== -1);
+      item.classList.toggle("hidden", !visible);
+      if (visible) shown += 1;
+    });
+
+    count.textContent = shown + (shown === 1 ? " service" : " services") + " shown";
+    empty.classList.toggle("hidden", shown > 0);
+  }
+
+  $(board).on("change", 'input[name="its-show"]', apply);
+  search.addEventListener("input", apply);
+  if (form) {
+    form.addEventListener("submit", function (event) {
+      event.preventDefault();
+      apply();
+    });
+  }
+
+  apply();
+})(window.jQuery);