react-magma-dom 7.1.0-next.8 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/ai/SKILL.md +143 -0
  2. package/ai/setup-guide.md +44 -0
  3. package/ai/styling-guide.md +89 -0
  4. package/dist/components/Checkbox/index.d.ts +1 -1
  5. package/dist/components/Combobox/Combobox.stories.d.ts +47 -1
  6. package/dist/components/EmptyState/styles.d.ts +5 -0
  7. package/dist/components/IndeterminateCheckbox/index.d.ts +1 -1
  8. package/dist/components/Pagination/PageButton.d.ts +2 -0
  9. package/dist/components/Pagination/Pagination.d.ts +5 -0
  10. package/dist/components/Pagination/Pagination.stories.d.ts +29 -0
  11. package/dist/components/Pagination/usePagination.d.ts +1 -0
  12. package/dist/components/Pagination/utils.d.ts +1 -0
  13. package/dist/components/Radio/index.d.ts +1 -1
  14. package/dist/components/Select/ItemsList.d.ts +1 -1
  15. package/dist/components/Select/Select.stories.d.ts +43 -1
  16. package/dist/components/Select/utils.d.ts +3 -0
  17. package/dist/components/Stepper/Step.d.ts +3 -1
  18. package/dist/components/Table/Table.stories.d.ts +30 -0
  19. package/dist/components/Table/TableHeaderCell.d.ts +2 -1
  20. package/dist/components/Tabs/Tabs.stories.d.ts +47 -0
  21. package/dist/components/Tagline/Tagline.stories.d.ts +9 -0
  22. package/dist/components/Tagline/index.d.ts +21 -0
  23. package/dist/components/Toggle/index.d.ts +1 -1
  24. package/dist/components/TreeView/TreeItemHierarchyContext.d.ts +2 -0
  25. package/dist/components/TreeView/TreeView.d.ts +3 -3
  26. package/dist/components/TreeView/TreeView.stories.d.ts +21 -0
  27. package/dist/components/TreeView/TreeViewAnnounceContext.d.ts +4 -5
  28. package/dist/components/TreeView/TreeViewAnnouncer.d.ts +2 -1
  29. package/dist/components/TreeView/TreeViewVirtualizationContext.d.ts +8 -0
  30. package/dist/components/TreeView/VirtualizedTreeItemFlow.d.ts +8 -0
  31. package/dist/components/TreeView/useTreeItem.d.ts +3 -1
  32. package/dist/components/TreeView/utils.d.ts +3 -1
  33. package/dist/esm/index.js +1046 -469
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/i18n/interface.d.ts +3 -0
  36. package/dist/index.d.ts +2 -0
  37. package/dist/properties.json +56 -9
  38. package/dist/react-magma-dom.cjs.development.js +1041 -458
  39. package/dist/react-magma-dom.cjs.development.js.map +1 -1
  40. package/dist/react-magma-dom.cjs.production.min.js +1 -1
  41. package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
  42. package/package.json +9 -5
package/ai/SKILL.md ADDED
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: react-magma
3
+ description: Use when writing or editing React UI in a project that depends on react-magma-dom (Cengage's accessible component library) — finding the right component, its props, theming, inverse surfaces, icons and accessibility.
4
+ ---
5
+
6
+ # React Magma (react-magma-dom 7.1.0)
7
+
8
+ Accessible React component library. This guide is generated for react-magma-dom 7.1.0, which requires React ^18.3.1.
9
+
10
+ ## How to use this guide
11
+
12
+ 1. Find the matching component in the Catalog before creating UI. Use it whenever its API supports the requested behavior.
13
+ 2. Read the installed declarations and JSDoc: required/optional props, defaults, accepted values and enums. Inspect implementation when unclear; never guess or force unsupported props with casts or `any`.
14
+ 3. Before layout or styling work, read [styling-guide.md](styling-guide.md). Read [setup-guide.md](setup-guide.md) for app setup and theme APIs.
15
+ 4. Preserve requested behavior; do not invent required fields, validation or defaults.
16
+ 5. Review your diff against the rules below, then run the project's configured type-check. A bundler build may not check TypeScript; report when no type-check is available.
17
+
18
+ ## Required design-system rules
19
+
20
+ - Use `Heading` with a semantic `level` instead of raw `h1`–`h6`, and `Paragraph` instead of raw `p` for standalone content; preserve built-in component typography. Use Magma typography variants for other styled text.
21
+ - Use Magma layout and widgets: `Container`, `Flex`, `Grid`, `Spacer`, `Card`, `Table`, `Tabs`, `Pagination`, `EmptyState`, etc. Keep native semantic landmarks; custom replacements require an API gap or an explicit user/project exception. Explain any exception.
22
+ - Read the active `ThemeContext` for spacing, colors, fonts, text sizes, radii, icons and breakpoints. Do not introduce literal design values, external fonts or cosmetic overrides of Magma states.
23
+ - Map intended spacing to the nearest active `spaceScale` value; ties use the smaller value. With default tokens, 5px becomes `spacing02` (4px), not a new 5px rule. Do not bypass tokens with arithmetic. Preserve explicit requirements and accessibility constraints; see [styling-guide.md](styling-guide.md) for structural CSS exceptions.
24
+
25
+ ## Library conventions
26
+
27
+ - Omit optional props when the desired value is already the component default. Verify defaults in the installed version's declarations, JSDoc or implementation before omitting them. Set props explicitly when overriding a default; keep required props and explicit values needed to override inherited context.
28
+ - Import from the package root: `import { Button, ButtonColor } from 'react-magma-dom'`.
29
+ - Variants are exported enums (`ButtonColor.secondary`, `ModalSize.large`).
30
+ - Dark backgrounds: `isInverse` prop, or `<InverseContext.Provider value={{ isInverse: true }}>` for a region.
31
+ - Accessibility is built in: form fields take `labelText`, icon-only buttons require `aria-label`, `Heading` takes a semantic `level`.
32
+ - `Hyperlink` takes `to`, not `href`.
33
+ - When an icon is needed, look for it in `react-magma-icons` first and verify its exported name and props in the installed package. Import from `react-magma-icons`; don't draw a replacement or use another icon library unless the project specifically requires it.
34
+ - Charts and file upload ship as separate packages, listed under Add-on packages with their package name. If the package is not installed, propose installing it and ask first. Read its declarations under `node_modules/<package>/dist`. Charts also need `import '@react-magma/charts/dist/charts.css'` once.
35
+
36
+ Theme, i18n, and other package-level APIs: [setup-guide.md](setup-guide.md).
37
+
38
+ ## Catalog
39
+
40
+ Format: **Folder** — purpose (search words). Not for: need → better component. Also: related exports. Exports not listed are internal helpers.
41
+
42
+ ### Actions
43
+ - **Button** — Performs an action or submits a form (button, cta, submit, primary action). Not for: navigation → Hyperlink; icon only → IconButton; on/off setting → Toggle. Also: ButtonColor, ButtonShape, ButtonSize, ButtonTextTransform, ButtonType, ButtonVariant
44
+ - **IconButton** — Button with an icon, with or without text (icon button, close button, toolbar button). Also: ButtonIconPosition
45
+ - **AIButton** — Animated gradient button for AI features (ai action, generate, assistant button). Also: AIButtonShape, AIButtonSize, AIButtonTextTransform, AIButtonType, AIButtonVariant
46
+ - **ButtonGroup** — Lays out and aligns related buttons (button bar, actions row, button set). Also: ButtonGroupAlignment, ButtonGroupOrientation
47
+ - **ToggleButton** — Button with a pressed/selected state (pressed button, bold/italic toggle, selectable button). Also: ToggleButtonRole
48
+ - **ToggleButtonGroup** — Group of ToggleButtons with single or multiple selection (segmented control, view switcher, button toggle group). Also: ToggleButtonGroupRole
49
+ - **Dropdown** — Menu of actions or links opened from a button (menu, actions menu, kebab menu, overflow menu, split button). Not for: choosing a form value → Select. Also: DropdownAlignment, DropdownButton, DropdownContent, DropdownDivider, DropdownDropDirection, DropdownExpandableMenuButton, DropdownExpandableMenuGroup, DropdownExpandableMenuItem, DropdownExpandableMenuListItem, DropdownExpandableMenuPanel, DropdownHeader, DropdownMenuGroup, DropdownMenuItem, DropdownMenuNavItem, DropdownSplitButton
50
+
51
+ ### Forms
52
+ - **Form** — Form container with header, description and actions (form, form layout)
53
+ - **Input** — Text field with label, helper and error message (text field, textbox, email field, number field, form field). Also: InputMessage
54
+ - **PasswordInput** — Password field with show/hide toggle (password, show password)
55
+ - **Search** — Search field with `onSearch`, clear and loading states (search box, search bar, filter field)
56
+ - **Textarea** — Multi-line text field (textarea, comment box, multiline input)
57
+ - **CharacterCounter** — Remaining-characters counter; prefer `maxCount` on Input/Textarea (character limit, char count)
58
+ - **Select** — Choose one or many (`isMulti`) values from a list (dropdown list, picker, single select, multi select). Not for: typing to filter or create → Combobox; browser-native list → NativeSelect; action menu → Dropdown
59
+ - **Combobox** — Select with typing, filtering and creating items (autocomplete, typeahead, searchable select, creatable select)
60
+ - **NativeSelect** — Magma-styled browser <select> (native select, html select)
61
+ - **Checkbox** — Checkbox for one boolean or one of many options (checkbox, check box, agree). Also: CheckboxTextPosition
62
+ - **IndeterminateCheckbox** — Tri-state checkbox (checked, unchecked, indeterminate) (select all, partial selection, tri-state). Also: IndeterminateCheckboxStatus
63
+ - **Radio** — Single radio option; use inside RadioGroup (radio, radio button, option). Also: RadioTextPosition
64
+ - **RadioGroup** — Labelled group of mutually exclusive Radios (radio group, choose one)
65
+ - **Toggle** — On/off switch for a setting (switch, toggle switch, enable setting). Also: ToggleTextPosition
66
+ - **DatePicker** — Date field with calendar popup (date, calendar, date input)
67
+ - **TimePicker** — Time field with keyboard entry (time, time input, clock)
68
+ - **DateTimePicker** — Combined date and time field (datetime, date and time, schedule)
69
+ - **FormGroup** — Labelled group of Checkboxes or Toggles with shared error (checkbox group, checkbox list, options group)
70
+ - **Fieldset** — Semantic <fieldset> with legend for related controls (fieldset, legend, group of fields)
71
+ - **Label** — Standalone field label; fields already render `labelText` (label). Also: LabelPosition
72
+ - **FormFieldContainer** — Label, helper and error wiring for a custom field (custom field, field wrapper)
73
+ - **InputBase** — Low-level unlabelled input; prefer Input (bare input). Also: InputIconPosition, InputSize, InputType
74
+
75
+ ### Overlays
76
+ - **Modal** — Dialog that blocks the page and traps focus (dialog, popup, lightbox, confirm window, overlay). Not for: side panel → Drawer; small anchored content → Popover. Also: ModalSize
77
+ - **Drawer** — Panel sliding in from a screen edge (side panel, off-canvas, slide-out, sheet, sidebar). Also: DrawerPosition
78
+ - **Popover** — Interactive content anchored to a trigger (popover, flyout, callout, info bubble). Not for: hover text only → Tooltip. Also: PopoverAlignment, PopoverContent, PopoverFooter, PopoverHeader, PopoverPosition, PopoverTrigger
79
+ - **Tooltip** — Short text on hover or focus (tooltip, hint, hover text). Also: TooltipArrow, TooltipPosition
80
+
81
+ ### Feedback
82
+ - **AlertBase** — Low-level alert primitive used by Alert and Toast (alert primitive, toast primitive). Not for: standard inline alert → Alert. Also: AlertVariant
83
+ - **Alert** — Inline message with optional dismiss (alert, message, warning, error message, info box). Not for: page-wide notice → Banner; temporary notice → Toast
84
+ - **Banner** — Full-width system or app-level message (banner, announcement bar, site notice)
85
+ - **Toast** — Temporary notification; render inside ToastsContainer (toast, snackbar, notification, flash message). Also: ToastsContainer
86
+ - **EmptyState** — No-content message with icon and actions (empty state, no results, nothing here, zero state)
87
+ - **LoadingIndicator** — Page or section loading with progressive messages (loading screen, loader, please wait). Also: LoadingIndicatorType
88
+ - **Spinner** — Small inline loading spinner (spinner, busy indicator)
89
+ - **ProgressBar** — Linear progress of a task (progress bar, percent complete, upload progress). Also: ProgressBarColor
90
+ - **ProgressRing** — Circular progress indicator (progress circle, radial progress)
91
+ - **Skeleton** — Placeholder shapes while content loads (skeleton, shimmer, placeholder, ghost loading). Also: SkeletonAnimation, SkeletonVariant
92
+
93
+ ### Navigation
94
+ - **Hyperlink** — Link (prop `to`), can look like a button (link, anchor, href, link button). Also: HyperlinkIconPosition
95
+ - **Breadcrumb** — Location within a page hierarchy (breadcrumbs, trail, path). Also: BreadcrumbItem
96
+ - **Tabs** — Switch between panels of related content (tabs, tab panel, segmented content, scroll spy). Not for: links to other pages → NavTabs. Also: CustomTab, Tab, TabPanel, TabPanelsContainer, TabScrollSpyPanel, TabsAlignment, TabsBorderPosition, TabsContainer, TabsIconPosition, TabsOrientation, TabsScrollSpyContainer, TabsTextTransform
97
+ - **NavTabs** — Tab-styled navigation between pages (nav tabs, page tabs, tab navigation). Also: NavTab
98
+ - **Pagination** — Page number navigation (pagination, pager, page numbers). Also: PageButtonSize, PaginationType
99
+ - **Stepper** — Progress through multi-step flows (stepper, wizard, steps, progress steps). Also: ResponsiveStepperContainer, Step, StepperLayout, StepperOrientation
100
+ - **TreeView** — Expandable hierarchical list with selection (tree, folder tree, nested list, hierarchy, file explorer). Also: TreeItem, TreeNodeType, TreeViewSelectable
101
+ - **AppBar** — Top header bar for the current screen (header, top bar, navbar, app header). Also: AppBarPosition
102
+ - **SkipLink** — Skip-to-main-content link and its target (skip link, skip navigation). Also: SkipLinkContent
103
+
104
+ ### Layout
105
+ - **Container** — Centers content horizontally with max width (container, page wrapper, wrapper)
106
+ - **Flex** — Responsive 12-column flexbox rows and columns (flex, row, column, stack, responsive columns). Also: FlexAlignContent, FlexAlignItems, FlexBehavior, FlexDirection, FlexJustify, FlexWrap
107
+ - **Grid** — CSS grid container with grid props (grid, css grid, grid layout). Also: GridAlignContent, GridAlignItems, GridAutoFlow, GridDisplay, GridItem, GridItemAlignSelf, GridItemJustifySelf, GridJustifyContent, GridJustifyItems
108
+ - **Spacer** — Horizontal or vertical gap from the space scale (spacer, gap, margin, whitespace). Also: SpacerAxis
109
+ - **Card** — Surface for grouped content (card, tile, panel, box). Also: CardAlignment, CardBody, CardBorderRadius, CardCalloutType, CardCornerTreatment, CardHeading
110
+ - **Accordion** — Stacked collapsible sections (accordion, collapse, expandable section, faq). Also: AccordionButton, AccordionIconPosition, AccordionItem, AccordionPanel
111
+ - **BreakpointsContainer** — Render different content per screen size (responsive, breakpoint, mobile/desktop content). Also: Breakpoint, BreakpointScreenSize
112
+ - **HideAtBreakpoint** — Hide content above or below a breakpoint (hide on mobile, hide on desktop, responsive visibility). Also: HideAtBreakpointDisplayType
113
+
114
+ ### Content and data
115
+ - **Typography** — Low-level typography primitive for custom text styles (typography, text style, styled text). Not for: semantic heading → Heading; paragraph → Paragraph. Also: TypographyColor, TypographyContextVariant, TypographyVisualStyle
116
+ - **Heading** — Headings h1–h6 (`level`), style set separately (heading, title, h1, h2)
117
+ - **Paragraph** — Body text with typography styles (paragraph, body text, text, copy)
118
+ - **List** — Ordered or unordered list, optional icons (list, bullet list, numbered list). Also: IconAlignment, IconSizes, ListItem
119
+ - **DefinitionList** — Term/description pairs (definition list, key value, details list, dl). Also: DefinitionListItem, DefinitionListType
120
+ - **BlockQuote** — Styled quotation with attribution (quote, blockquote, citation). Also: BlockQuoteItem
121
+ - **Table** — Composable table (rows, cells, sorting, pagination) (table, rows, columns, sortable table). Not for: table from data props → Datagrid. Also: TableBody, TableCell, TableCellAlign, TableDensity, TableHead, TableHeaderCell, TableHeaderCellScope, TablePagination, TableRow, TableRowColor, TableSortDirection
122
+ - **Datagrid** — Table rendered from columns/rows props, selection and pagination (data grid, data table, selectable rows)
123
+ - **Badge** — Small label or count (badge, counter, status label, pill). Also: BadgeColor, BadgeVariant, BadgeWeight
124
+ - **Tag** — Category chip, clickable or removable (tag, chip, filter chip, token). Also: TagColor, TagSize
125
+ - **Tagline** — Short, emphasized text that introduces or labels content (tagline, eyebrow, overline, section label)
126
+
127
+ ### Utilities
128
+ - **VisuallyHidden** — Content for screen readers only (sr-only, screen reader text, visually hidden)
129
+ - **Announce** — aria-live region announcing dynamic changes (live region, aria-live, announce)
130
+ - **Transition** — framer-motion enter/exit animations (animation, fade, slide, collapse animation)
131
+
132
+ ### Add-on packages
133
+ - **CarbonChart** (`@react-magma/charts`) — Accessible chart (`type`: bar, line, area, pie, donut, gauge, scatter…); `chartToolbar` adds table view, fullscreen and downloads (chart, graph, data visualization, bar chart, line chart, pie chart, dashboard). Also: CarbonChartType
134
+ - **ChartTable** (`@react-magma/charts`) — Parts for a custom chart toolbar and table view; prefer `CarbonChart` `chartToolbar` (chart toolbar, chart data table, fullscreen chart). Also: ChartDataTable, ChartFullscreenButton, ChartMoreOptionsButton, ChartTableButton, ChartTableModal, ChartToolbar
135
+ - **Dropzone** (`@react-magma/dropzone`) — Drag-and-drop file upload with previews, type/size/count limits and progress (file upload, drag and drop, dropzone, file input, attachment, uploader). Also: FileIcon
136
+
137
+ ### Public hooks
138
+
139
+ Public hooks available for consumer use: `useDeviceDetect`, `useFocusLock`, `useMediaQuery`.
140
+
141
+ ### Other public exports
142
+
143
+ `GlobalStyles`, `I18nContext`, `InverseContext`, `ThemeContext`, `defaultI18n`, `magma`, `styled`
@@ -0,0 +1,44 @@
1
+ # React Magma setup and theming
2
+
3
+ ## App root
4
+
5
+ ```tsx
6
+ import {
7
+ GlobalStyles,
8
+ I18nContext,
9
+ ThemeContext,
10
+ defaultI18n,
11
+ magma,
12
+ } from 'react-magma-dom';
13
+
14
+ <ThemeContext.Provider value={magma}>
15
+ <I18nContext.Provider value={defaultI18n}>
16
+ <GlobalStyles />
17
+ <App />
18
+ </I18nContext.Provider>
19
+ </ThemeContext.Provider>;
20
+ ```
21
+
22
+ `ThemeContext` defaults to `magma`; add the provider only for a custom theme. For a custom theme, spread `magma` and override keys: `{ ...magma, colors: { ...magma.colors, primary: '…' } }`.
23
+
24
+ ## Required Magma styling
25
+
26
+ Use Magma components and the active Magma theme for UI styling. Follow [styling-guide.md](styling-guide.md) for typography, layout, token selection and examples. Existing custom CSS does not authorize a different design system; design-system overrides need an explicit user or project instruction naming their scope.
27
+
28
+ ## Theme tokens and styling
29
+
30
+ React Magma exposes design tokens through `ThemeContext` and `magma`. Read the current theme from `ThemeContext`, rather than styling from the static default `magma` object, so custom themes are respected. Apply tokens through the consumer application's existing styling approach; React Magma does not require consumers to use Emotion or any other styling library.
31
+
32
+ Token groups include `spaceScale` (`spacing01`…`spacing14`), `typeScale` (`size01`…`size16`), `colors`, `borderRadius*`, `breakpoints` (`xs`, `small`, `medium`, `large`, `xl`), and `iconSizes`. Check exact token values before mapping a design value (for example, `spaceScale.spacing04` is `12px`, not 16px).
33
+
34
+ Use the token itself in styles or component props, rather than copying its current literal value. When creating CSS variables for tokens, place them where their consumers can inherit them, including content rendered through portals such as Modal.
35
+
36
+ Use component variants and supported props before adding CSS. Do not override Magma typography, colors, focus, hover or disabled states just to create a different visual style. Explicitly requested overrides must still preserve theming and accessibility.
37
+
38
+ ## Inverse (dark surfaces)
39
+
40
+ Components accept `isInverse`. For a whole region use `<InverseContext.Provider value={{ isInverse: true }}>`; read it in your own components with `useIsInverse(props.isInverse)`.
41
+
42
+ ## i18n
43
+
44
+ User-facing strings built into components come from `I18nContext`. Override by spreading `defaultI18n` and replacing keys; do not hard-code those labels in props when an i18n key exists.
@@ -0,0 +1,89 @@
1
+ # Required React Magma components and tokens
2
+
3
+ Use this page before writing layout, typography or custom styles. React Magma is the required default design system for agent-created UI. A different design system requires an explicit user request or project instruction naming its scope; existing custom styles alone do not authorize it. Follow the allowances below for unsupported APIs, structural CSS and accessibility, and report any exception and its reason.
4
+
5
+ ## Choose components first
6
+
7
+ - Render standalone headings through `Heading` and paragraphs through `Paragraph`. Choose semantic heading levels independently of `TypographyVisualStyle`. If a component already supplies typography through a title, header, description or label prop, use that API without nesting another heading or paragraph inside it. For example, `Modal.header` already renders a `Heading`.
8
+ - Use `Typography` or supported typography variants for other styled text. Do not replace fonts or recreate typography with raw headings, paragraphs, CSS font rules or remote font imports.
9
+ - Use `Container`, `Flex`, `Grid`, `Spacer` and `Card` for the layout and surfaces they support. `Flex` requires `behavior`; direction, alignment and other variants use exported enums. Check each component's actual props before use.
10
+ - Use available widgets such as `Table`, `Tabs`, `Pagination`, `Accordion`, `Tooltip` and `EmptyState` instead of styling and maintaining custom equivalents. Use Magma controls, feedback and icons where supported.
11
+ - Keep native semantic elements such as `main`, `nav`, `section` and `form` where needed. Do not use paragraph typography for control labels; use the control's label API. Avoid wrappers that break valid table/list markup or semantics.
12
+ - If an API cannot support the requested behavior, select another suitable Magma component first. If none fits, use accessible native markup or a small custom implementation, style it with theme tokens, and explain the gap. Never invent props or bypass types.
13
+
14
+ ## Select tokens, not arbitrary design values
15
+
16
+ Read the active theme with `useContext(ThemeContext)`. Use that theme's `spaceScale`, `colors`, typography, `borderRadius*`, `iconSizes` and `breakpoints`. Inspect their installed definitions; token names are not pixel values. Use appropriate semantic colors and typography variants, rather than numerically matching colors or guessing font sizes.
17
+
18
+ For agent-chosen padding, margin and gaps:
19
+
20
+ 1. Inspect the active `spaceScale` values.
21
+ 2. Select the closest token to the intended spacing; when equally close, select the smaller value. Compare actual lengths in consistent units.
22
+ 3. Reference the token in the implementation. Do not copy a literal or add/subtract a constant to manufacture an off-scale value.
23
+
24
+ Default-theme examples (custom themes can change these values):
25
+
26
+ | Intended spacing | Use | Default value |
27
+ |---|---|---|
28
+ | 5px | `theme.spaceScale.spacing02` | 4px |
29
+ | 6px (tie) | `theme.spaceScale.spacing02` | 4px |
30
+ | 7px | `theme.spaceScale.spacing03` | 8px |
31
+ | 18px | `theme.spaceScale.spacing05` | 16px |
32
+
33
+ Some component props are numeric multipliers or enum keys, not CSS lengths. For example, `Flex.spacing` is a number with component-defined spacing behavior, not a `spaceScale` string. Inspect that API; use its supported spacing semantics or a token-based style such as `gap` rather than passing a token to an incompatible prop.
34
+
35
+ Keep Magma component defaults and supported variants. Never use CSS or `!important` to replace their typography, colors or interactive states with a different design. Custom styling uses the application's existing styling tools, with values from the active Magma theme; do not install another styling library.
36
+
37
+ ## Necessary structural values and exceptions
38
+
39
+ Tokens govern visual design choices, not every CSS number. Values such as `0`, `auto`, percentages, `1fr`, flex ratios, content-dependent dimensions and positioning needed for behavior are valid structural CSS. Keywords such as `inherit`, `currentColor` and `transparent` are valid when preserving token-derived styling or behavior. Use the library's dimensions or component props where available. Do not invent token names when no corresponding token exists.
40
+
41
+ Do not round an explicit user requirement, an accessibility minimum or a behavior-critical size to an unsuitable smaller token. Use a suitable supported value and explain the exception. Do not round or rewrite the library's internal styles. Choose colors by their intended role and accessible contrast, not by numeric proximity.
42
+
43
+ ## Example: theme-aware layout and typography
44
+
45
+ ```tsx
46
+ import { useContext } from 'react';
47
+ import {
48
+ Button,
49
+ ButtonColor,
50
+ Container,
51
+ Flex,
52
+ FlexBehavior,
53
+ FlexDirection,
54
+ Heading,
55
+ Paragraph,
56
+ ThemeContext,
57
+ } from 'react-magma-dom';
58
+
59
+ export function CoursesIntro() {
60
+ const theme = useContext(ThemeContext);
61
+
62
+ return (
63
+ <main
64
+ style={{
65
+ backgroundColor: theme.colors.neutral100,
66
+ paddingBlock: theme.spaceScale.spacing06,
67
+ }}
68
+ >
69
+ <Container gutterWidth={theme.spaceScale.spacing05}>
70
+ <Flex
71
+ behavior={FlexBehavior.container}
72
+ direction={FlexDirection.column}
73
+ style={{ gap: theme.spaceScale.spacing03 }}
74
+ >
75
+ <Heading level={1}>Courses</Heading>
76
+ <Paragraph noMargins>Manage your learning catalog.</Paragraph>
77
+ <Button color={ButtonColor.primary}>Create course</Button>
78
+ </Flex>
79
+ </Container>
80
+ </main>
81
+ );
82
+ }
83
+ ```
84
+
85
+ The inline style demonstrates reading tokens without requiring a styling library; use the consumer project's styling tools in real code. If using CSS variables, make sure portal content can also inherit them.
86
+
87
+ ## Review before finishing
88
+
89
+ Inspect changed JSX and styles for raw headings/paragraphs, custom Magma widget replacements, literal spacing/colors/fonts, remote fonts and cosmetic component overrides. Replace them with components, supported variants and tokens, or report the specific justified exception. Run the project's available type-check and relevant checks; do not equate a bundler build with TypeScript validation.
@@ -60,7 +60,7 @@ export interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElemen
60
60
  */
61
61
  testId?: string;
62
62
  /**
63
- * Whether the label appears to the left of the right of the checkbox
63
+ * Whether the label appears to the left or the right of the checkbox
64
64
  * @default CheckboxTextPosition.right
65
65
  */
66
66
  textPosition?: CheckboxTextPosition;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { LabelPosition } from '../Label';
3
3
  import { SelectOptions } from '../Select';
4
- import { MultiComboboxProps } from '.';
4
+ import { ComboboxProps, MultiComboboxProps } from '.';
5
5
  declare const _default: any;
6
6
  export default _default;
7
7
  export declare const Default: {
@@ -176,3 +176,49 @@ export declare const ControlledSelectedItem: {
176
176
  export declare const ControlledItems: {
177
177
  render: () => React.JSX.Element;
178
178
  };
179
+ export declare const DuplicateLabels: {
180
+ render: (props: ComboboxProps<SelectOptions>) => React.JSX.Element;
181
+ args: {
182
+ labelText: string;
183
+ defaultItems: ({
184
+ label: string;
185
+ value: string;
186
+ disabled?: undefined;
187
+ } | {
188
+ label: string;
189
+ value: string;
190
+ disabled: string;
191
+ })[];
192
+ disableCreateItem: boolean;
193
+ errorMessage: string;
194
+ helperMessage: string;
195
+ placeholder: string;
196
+ isClearable: boolean;
197
+ isMulti: boolean;
198
+ isLoading: boolean;
199
+ disabled: boolean;
200
+ };
201
+ };
202
+ export declare const MultiDuplicateLabels: {
203
+ render: (props: MultiComboboxProps<SelectOptions>) => React.JSX.Element;
204
+ args: {
205
+ labelText: string;
206
+ isClearable: boolean;
207
+ defaultItems: ({
208
+ label: string;
209
+ value: string;
210
+ disabled?: undefined;
211
+ } | {
212
+ label: string;
213
+ value: string;
214
+ disabled: string;
215
+ })[];
216
+ disableCreateItem: boolean;
217
+ errorMessage: string;
218
+ helperMessage: string;
219
+ placeholder: string;
220
+ isMulti: boolean;
221
+ isLoading: boolean;
222
+ disabled: boolean;
223
+ };
224
+ };
@@ -10,6 +10,11 @@ export declare function getIllustrationIconColor(props: {
10
10
  isInverse?: boolean;
11
11
  theme: ThemeInterface;
12
12
  }): string;
13
+ export declare function getLoadingSpinnerColor(props: {
14
+ isDanger?: boolean;
15
+ isInverse?: boolean;
16
+ theme: ThemeInterface;
17
+ }): string;
13
18
  export declare const StyledEmptyState: import("@emotion/styled").StyledComponent<{
14
19
  theme?: import("@emotion/react").Theme;
15
20
  as?: import("react").ElementType<any, "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "center" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "search" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">;
@@ -3,7 +3,7 @@ import { Omit } from '../../utils';
3
3
  import { CheckboxProps } from '../Checkbox';
4
4
  export interface IndeterminateCheckboxProps extends Omit<CheckboxProps, 'checked'> {
5
5
  /**
6
- * Status of the indeterminate, three-state checkbox, which includes and indeterminate (e.g. mixed) option.
6
+ * Status of the indeterminate, three-state checkbox, which includes an indeterminate (e.g. mixed) option.
7
7
  * @default IndeterminateCheckboxStatus.unchecked
8
8
  */
9
9
  status: IndeterminateCheckboxStatus;
@@ -4,4 +4,6 @@ export interface PageButtonProps extends ButtonProps {
4
4
  isSelected?: boolean;
5
5
  }
6
6
  export declare function pageButtonTypeSize(props: any): string;
7
+ export declare function pageButtonTypeLineHeight(props: any): string;
8
+ export declare function pageButtonTypeLetterSpacing(props: any): string;
7
9
  export declare const PageButton: React.ForwardRefExoticComponent<PageButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -16,6 +16,11 @@ export interface BasePaginationProps extends React.HTMLAttributes<HTMLDivElement
16
16
  * @default false
17
17
  */
18
18
  disabled?: boolean;
19
+ /**
20
+ * If true, ellipses in classic Pagination become page-jump controls.
21
+ * @default false
22
+ */
23
+ enablePageJump?: boolean;
19
24
  /**
20
25
  * If true, hides the next page button
21
26
  * @default false
@@ -10,6 +10,7 @@ export declare const Default: {
10
10
  hideNextButton: boolean;
11
11
  isInverse: boolean;
12
12
  disabled: boolean;
13
+ enablePageJump: boolean;
13
14
  };
14
15
  };
15
16
  export declare const DefaultSelected: {
@@ -20,6 +21,29 @@ export declare const DefaultSelected: {
20
21
  hideNextButton: boolean;
21
22
  isInverse: boolean;
22
23
  disabled: boolean;
24
+ enablePageJump: boolean;
25
+ };
26
+ };
27
+ export declare const LargePageCount: {
28
+ args: {
29
+ count: number;
30
+ defaultPage: number;
31
+ enablePageJump: boolean;
32
+ hidePreviousButton: boolean;
33
+ hideNextButton: boolean;
34
+ isInverse: boolean;
35
+ disabled: boolean;
36
+ };
37
+ };
38
+ export declare const PageJump: {
39
+ args: {
40
+ count: number;
41
+ defaultPage: number;
42
+ enablePageJump: boolean;
43
+ hidePreviousButton: boolean;
44
+ hideNextButton: boolean;
45
+ isInverse: boolean;
46
+ disabled: boolean;
23
47
  };
24
48
  };
25
49
  export declare const AdjacentPages: {
@@ -31,6 +55,7 @@ export declare const AdjacentPages: {
31
55
  hideNextButton: boolean;
32
56
  isInverse: boolean;
33
57
  disabled: boolean;
58
+ enablePageJump: boolean;
34
59
  };
35
60
  };
36
61
  export declare const EdgePages: {
@@ -42,6 +67,7 @@ export declare const EdgePages: {
42
67
  hideNextButton: boolean;
43
68
  isInverse: boolean;
44
69
  disabled: boolean;
70
+ enablePageJump: boolean;
45
71
  };
46
72
  };
47
73
  export declare const Size: {
@@ -52,6 +78,7 @@ export declare const Size: {
52
78
  hideNextButton: boolean;
53
79
  isInverse: boolean;
54
80
  disabled: boolean;
81
+ enablePageJump: boolean;
55
82
  };
56
83
  };
57
84
  export declare const SimplePagination: {
@@ -62,6 +89,7 @@ export declare const SimplePagination: {
62
89
  hideNextButton: boolean;
63
90
  isInverse: boolean;
64
91
  disabled: boolean;
92
+ enablePageJump: boolean;
65
93
  };
66
94
  parameters: {
67
95
  controls: {
@@ -79,6 +107,7 @@ export declare const SimplePaginationOnPageChange: {
79
107
  hideNextButton: boolean;
80
108
  isInverse: boolean;
81
109
  disabled: boolean;
110
+ enablePageJump: boolean;
82
111
  };
83
112
  parameters: {
84
113
  controls: {
@@ -55,6 +55,7 @@ export interface UsePaginationProps {
55
55
  showLastButton?: boolean;
56
56
  }
57
57
  export declare function usePagination(props?: Partial<UsePaginationProps>): {
58
+ handlePageChange: (event: any, value: any) => void;
58
59
  page: any;
59
60
  pageButtons: ({
60
61
  onClick: (event: any) => void;
@@ -5,6 +5,7 @@ interface PaginationI18n {
5
5
  pagesLabel: string;
6
6
  selectedLabel: string;
7
7
  }
8
+ export declare const formatPageNumber: (pageNumber: number) => string;
8
9
  export declare const paginationLabel: (count: number, pagination: PaginationI18n) => string;
9
10
  export declare const pageAriaLabel: (selectedPage: number, count: number, pagination: PaginationI18n) => string;
10
11
  export {};
@@ -40,7 +40,7 @@ export interface RadioProps extends React.InputHTMLAttributes<HTMLInputElement>
40
40
  */
41
41
  testId?: string;
42
42
  /**
43
- * Whether the label appears to the left of the right of the radio button
43
+ * Whether the label appears to the left or the right of the radio button
44
44
  * @default RadioTextPosition.right
45
45
  */
46
46
  textPosition?: RadioTextPosition;
@@ -17,7 +17,7 @@ interface ItemsListProps<T> {
17
17
  menuStyle?: React.CSSProperties;
18
18
  setFloating?: (node: ReferenceType) => void;
19
19
  setHighlightedIndex?: (index: number) => void;
20
- selectedItem?: string;
20
+ selectedItem?: T;
21
21
  }
22
22
  export declare function ItemsList<T>(props: ItemsListProps<T>): React.JSX.Element;
23
23
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { LabelPosition } from '../Label';
3
- import { MultiSelectProps, SelectOptions } from './';
3
+ import { MultiSelectProps, SelectOptions, SelectProps } from './';
4
4
  declare const _default: any;
5
5
  export default _default;
6
6
  export declare const Default: {
@@ -245,3 +245,45 @@ export declare const MultiWithDisabledItems: {
245
245
  labelPosition: LabelPosition;
246
246
  };
247
247
  };
248
+ export declare const DuplicateLabels: {
249
+ render: (props: SelectProps<SelectOptions>) => React.JSX.Element;
250
+ args: {
251
+ labelText: string;
252
+ items: ({
253
+ label: string;
254
+ value: string;
255
+ disabled: boolean;
256
+ } | {
257
+ label: string;
258
+ value: string;
259
+ disabled?: undefined;
260
+ })[];
261
+ errorMessage: string;
262
+ helperMessage: string;
263
+ isClearable: boolean;
264
+ isLabelVisuallyHidden: boolean;
265
+ isMulti: boolean;
266
+ labelPosition: LabelPosition;
267
+ };
268
+ };
269
+ export declare const MultiDuplicateLabels: {
270
+ render: (props: MultiSelectProps<SelectOptions>) => React.JSX.Element;
271
+ args: {
272
+ labelText: string;
273
+ isClearable: boolean;
274
+ items: ({
275
+ label: string;
276
+ value: string;
277
+ disabled: boolean;
278
+ } | {
279
+ label: string;
280
+ value: string;
281
+ disabled?: undefined;
282
+ })[];
283
+ errorMessage: string;
284
+ helperMessage: string;
285
+ isLabelVisuallyHidden: boolean;
286
+ isMulti: boolean;
287
+ labelPosition: LabelPosition;
288
+ };
289
+ };
@@ -1,2 +1,5 @@
1
1
  export declare function isItemDisabled(item: any): boolean;
2
+ export declare function isSameItem<T>(item: T, itemToCompare: T, itemToString: (item: T) => string): boolean;
3
+ export declare function findItemIndex<T>(items: T[], itemToFind: T, itemToString: (item: T) => string, excludedIndexes?: Set<number>): number;
4
+ export declare function getSelectedItemIndexes<T>(items: T[], selectedItems: T[], itemToString: (item: T) => string): Set<number>;
2
5
  export declare const setFocusedItem: (step: number, highlightedIndex: number, items: any[], setHighlightedIndex: (index: number) => void) => void;
@@ -55,6 +55,8 @@ export declare enum StepStatus {
55
55
  }
56
56
  export declare const HiddenLabelText: import("@emotion/styled").StyledComponent<{
57
57
  theme?: import("@emotion/react").Theme;
58
- as?: React.ElementType<any, "symbol" | "object" | "label" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "center" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "search" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">;
58
+ as?: React.ElementType<any, "symbol" | "object" | "label" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "center" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "search" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">; /**
59
+ * @internal
60
+ */
59
61
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
60
62
  export declare const Step: React.ForwardRefExoticComponent<StepProps & React.RefAttributes<HTMLDivElement>>;
@@ -192,3 +192,33 @@ export declare const ScrollableTable: {
192
192
  };
193
193
  };
194
194
  };
195
+ export declare const LargeTable: {
196
+ render: (args: any) => React.JSX.Element;
197
+ args: {
198
+ rowCount: number;
199
+ memoizeRows: boolean;
200
+ tableTitle: string;
201
+ };
202
+ argTypes: {
203
+ rowCount: {
204
+ control: {
205
+ type: string;
206
+ };
207
+ };
208
+ memoizeRows: {
209
+ control: {
210
+ type: string;
211
+ };
212
+ };
213
+ };
214
+ parameters: {
215
+ a11y: {
216
+ disable: boolean;
217
+ };
218
+ docs: {
219
+ description: {
220
+ story: string;
221
+ };
222
+ };
223
+ };
224
+ };