@nanahoshi/mona-ui 0.46.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/api/button.json +1 -1
- package/docs/api/button.md +1 -0
- package/docs/api/check-box.json +1 -1
- package/docs/api/check-box.md +1 -0
- package/docs/api/chip.json +1 -1
- package/docs/api/chip.md +1 -0
- package/docs/api/common.json +1 -1
- package/docs/api/common.md +1 -1
- package/docs/api/index.json +1 -1
- package/docs/api/radio-button.json +1 -1
- package/docs/api/radio-button.md +1 -0
- package/docs/api/ripple.json +1 -0
- package/docs/api/ripple.md +75 -0
- package/docs/api/sidebar.json +1 -1
- package/docs/api/sidebar.md +1 -0
- package/docs/api/switch.json +1 -1
- package/docs/api/switch.md +1 -0
- package/docs/manifest.json +1 -1
- package/docs/ripple.md +360 -0
- package/docs/sidebar-menus.md +8 -0
- package/fesm2022/nanahoshi-mona-ui-button.mjs +20 -2
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +30 -5
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +13 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +9 -1
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +9 -3
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +12 -4
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +27 -3
- package/fesm2022/nanahoshi-mona-ui-ripple.mjs +196 -0
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +9 -3
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +21 -1
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +5 -1
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +28 -3
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +7 -1
- package/llms.txt +2 -0
- package/package.json +5 -1
- package/ripple/package.json +5 -0
- package/types/nanahoshi-mona-ui-button.d.ts +8 -1
- package/types/nanahoshi-mona-ui-calendar.d.ts +1 -0
- package/types/nanahoshi-mona-ui-check-box.d.ts +10 -1
- package/types/nanahoshi-mona-ui-chip.d.ts +8 -1
- package/types/nanahoshi-mona-ui-radio-button.d.ts +9 -1
- package/types/nanahoshi-mona-ui-ripple.d.ts +72 -0
- package/types/nanahoshi-mona-ui-sidebar.d.ts +12 -0
- package/types/nanahoshi-mona-ui-switch.d.ts +10 -2
package/docs/manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"essentials":"Mona UI is an Angular component library styled with Tailwind CSS 4. Its components are standalone and signal based: inputs are `input()` and `model()`, events are `output()`.\n\n## Essentials\n\n- Install with `npm install @nanahoshi/mona-ui`. The application needs Tailwind CSS 4.\n- Import the styles in the main stylesheet, after Tailwind: `@import \"tailwindcss\";` then `@import \"@nanahoshi/mona-ui/styles.css\";`. Without it, components render unstyled.\n- Import every symbol from its entry point, such as `import { ButtonDirective } from \"@nanahoshi/mona-ui/button\";`. Each page below names its entry point. The root `@nanahoshi/mona-ui` exports nothing.\n- Add what you import to the standalone component's `imports` array. There are no NgModules.\n- No provider is required. Optional ones: `provideThemeOptions` (`@nanahoshi/mona-ui/theme`) to pick a theme, `provideMonaI18n` (`@nanahoshi/mona-ui/i18n`) for locale and messages, `provideNotificationDefaults` (`@nanahoshi/mona-ui/notification`) and `provideSidebarStorage` (`@nanahoshi/mona-ui/sidebar`).\n- Form controls implement `FormValueControl` from `@angular/forms/signals`: bind them with `[formField]`. They have no `ControlValueAccessor`, but `[(ngModel)]` and `[formControl]` still work, because Angular binds a control's `value` and `touch` directly.\n\n## Common mistakes\n\n- Importing from `@nanahoshi/mona-ui` instead of an entry point such as `@nanahoshi/mona-ui/grid`.\n- Leaving out `@nanahoshi/mona-ui/styles.css`, or importing it before Tailwind.\n- Treating a `placeholder` as a label. Give each control a name: a `<label for>` pointed at its input id, `aria-label` or `aria-labelledby`. Those two are inputs on every component that takes a name, and the component moves them to the element that has the role.\n- Expecting the grid, list box or tabs to change their data. They report the change through an event, and you write it back to the data you bound.\n- Putting `[disabled]` on a `monaTooltip` that sits on a button: it disables the button too. Use `[tooltipDisabled]`.\n- Using the rich text editor without its packages and styles. Mona UI doesn't install them: add `@tiptap/core`, `@tiptap/pm`, `@tiptap/starter-kit`, `@tiptap/extension-highlight`, `@tiptap/extension-image`, `@tiptap/extension-list`, `@tiptap/extension-subscript`, `@tiptap/extension-superscript`, `@tiptap/extension-table`, `@tiptap/extension-text-align`, `@tiptap/extension-text-style`, `remixicon` and `@tailwindcss/typography`, then `@import \"remixicon/fonts/remixicon.css\";` and `@plugin \"@tailwindcss/typography\";` to the global stylesheet.\n- Exporting a chart without its packages. `exportChart` and `downloadChart` need `jspdf`, `svg2pdf.js` and `html2canvas-pro`, which Mona UI doesn't install.","pages":[{"category":"Get Started","description":"What Mona UI is, what it includes and how it is built.","file":"docs/introduction.md","kind":"guide","path":"introduction","slug":"introduction","title":"Introduction"},{"category":"Get Started","description":"Install the package, set up its styles and choose a theme.","file":"docs/installation.md","kind":"guide","path":"installation","slug":"installation","title":"Installation"},{"category":"Get Started","description":"Choose and switch themes, follow the system's dark mode, and use theme tokens in your own styles.","entryPoint":"theme","file":"docs/theming.md","kind":"guide","path":"theming","slug":"theming","title":"Theming"},{"category":"Get Started","description":"Mona, Luna, Anna and Rena side by side, and when to use each one.","file":"docs/theming-built-in-themes.md","kind":"guide","path":"theming/built-in-themes","slug":"theming-built-in-themes","title":"Built-in Themes"},{"category":"Get Started","description":"Generate a palette from brand colors, override tokens, or let users choose a color.","file":"docs/theming-custom-colors.md","kind":"guide","path":"theming/custom-colors","slug":"theming-custom-colors","title":"Custom Colors"},{"category":"Get Started","description":"Register a theme of your own, from scratch or based on a built-in theme.","file":"docs/theming-custom-themes.md","kind":"guide","path":"theming/custom-themes","slug":"theming-custom-themes","title":"Custom Themes"},{"category":"Get Started","description":"Connect Mona UI controls to Angular signal forms.","file":"docs/forms.md","kind":"guide","path":"forms","slug":"forms","title":"Forms"},{"category":"Actions","description":"Styles a native button and adds loading, toggle and disabled behavior.","entryPoint":"button","file":"docs/button.md","kind":"component","path":"button","slug":"button","title":"Button"},{"category":"Actions","description":"Joins related buttons into one control with a shared look and size.","entryPoint":"button-group","file":"docs/button-group.md","kind":"component","path":"button-group","slug":"button-group","title":"Button Group"},{"category":"Actions","description":"A single button that opens a menu of actions.","entryPoint":"dropdown-button","file":"docs/dropdown-button.md","kind":"component","path":"dropdown-button","slug":"dropdown-button","title":"Dropdown Button"},{"category":"Actions","description":"A primary action button paired with a menu of secondary actions.","entryPoint":"split-button","file":"docs/split-button.md","kind":"component","path":"split-button","slug":"split-button","title":"Split Button"},{"category":"Actions","description":"A row of controls that is one Tab stop, moving what doesn't fit into a More menu.","entryPoint":"toolbar","file":"docs/toolbar.md","kind":"component","path":"toolbar","slug":"toolbar","title":"Toolbar"},{"category":"Form Fields","description":"A numeric input whose value is a decimal string, for exact values like money.","entryPoint":"numeric-text-box","file":"docs/decimal-textbox.md","kind":"component","path":"decimal-textbox","slug":"decimal-textbox","title":"Decimal Text Box"},{"category":"Form Fields","description":"A rich text editor with a configurable toolbar and an HTML value.","entryPoint":"editor","file":"docs/editor.md","kind":"component","path":"editor","slug":"editor","title":"Editor"},{"category":"Form Fields","description":"Groups related form controls under a labelled border.","entryPoint":"fieldset","file":"docs/fieldset.md","kind":"component","path":"fieldset","slug":"fieldset","title":"Fieldset"},{"category":"Form Fields","description":"Picks files from a drop zone or the file dialog, checks them, and uploads them with progress.","entryPoint":"file-upload","file":"docs/file-upload.md","kind":"component","path":"file-upload","slug":"file-upload","title":"File Upload"},{"category":"Form Fields","description":"Labels one form control, describes it with a hint and shows its validation errors.","entryPoint":"form-field","file":"docs/form-field.md","kind":"component","path":"form-field","slug":"form-field","title":"Form Field"},{"category":"Form Fields","description":"Styles a native input element and keeps its browser behavior.","entryPoint":"text-box","file":"docs/input.md","kind":"component","path":"input","slug":"input","title":"Input"},{"category":"Form Fields","description":"Styled, accessible labels associated with form controls.","entryPoint":"label","file":"docs/label.md","kind":"component","path":"label","slug":"label","title":"Label"},{"category":"Form Fields","description":"A text input for values in a fixed format, such as phone numbers, that fills in the format as you type.","entryPoint":"masked-text-box","file":"docs/masked-textbox.md","kind":"component","path":"masked-textbox","slug":"masked-textbox","title":"Masked Text Box"},{"category":"Form Fields","description":"A number input with spinner buttons, bounds and decimal formatting.","entryPoint":"numeric-text-box","file":"docs/numeric-textbox.md","kind":"component","path":"numeric-textbox","slug":"numeric-textbox","title":"Numeric Text Box"},{"category":"Form Fields","description":"A segmented input for one-time passwords and verification codes.","entryPoint":"otp-input","file":"docs/otp-input.md","kind":"component","path":"otp-input","slug":"otp-input","title":"OTP Input"},{"category":"Form Fields","description":"Styles a native textarea element and keeps its browser behavior.","entryPoint":"text-area","file":"docs/textarea.md","kind":"component","path":"textarea","slug":"textarea","title":"Text Area"},{"category":"Form Fields","description":"A text input with prefix and suffix slots and an optional clear button.","entryPoint":"text-box","file":"docs/textbox.md","kind":"component","path":"textbox","slug":"textbox","title":"Text Box"},{"category":"Selection","description":"A text input that suggests matching options as the user types.","entryPoint":"auto-complete","file":"docs/auto-complete.md","kind":"component","path":"auto-complete","slug":"auto-complete","title":"Auto Complete"},{"category":"Selection","description":"A checkbox with label handling and an indeterminate state.","entryPoint":"check-box","file":"docs/checkbox.md","kind":"component","path":"checkbox","slug":"checkbox","title":"Checkbox"},{"category":"Selection","description":"A text input that resolves typed text to one item from a collection.","entryPoint":"combo-box","file":"docs/combo-box.md","kind":"component","path":"combo-box","slug":"combo-box","title":"Combo Box"},{"category":"Selection","description":"A closed control that opens a list for choosing exactly one option.","entryPoint":"dropdown-list","file":"docs/dropdown-list.md","kind":"component","path":"dropdown-list","slug":"dropdown-list","title":"Dropdown List"},{"category":"Selection","description":"A closed control that opens a tree for choosing one item from a hierarchy.","entryPoint":"dropdown-tree","file":"docs/dropdown-tree.md","kind":"component","path":"dropdown-tree","slug":"dropdown-tree","title":"Dropdown Tree"},{"category":"Selection","description":"A control that shows selected options as removable tags.","entryPoint":"multi-select","file":"docs/multi-select.md","kind":"component","path":"multi-select","slug":"multi-select","title":"Multi Select"},{"category":"Selection","description":"A control that opens a tree with checkboxes and shows the checked items as removable tags.","entryPoint":"multi-select-tree","file":"docs/multi-select-tree.md","kind":"component","path":"multi-select-tree","slug":"multi-select-tree","title":"Multi Select Tree"},{"category":"Selection","description":"Radio buttons and groups for choosing one option from several.","entryPoint":"radio-button","file":"docs/radio-button.md","kind":"component","path":"radio-button","slug":"radio-button","title":"Radio Button"},{"category":"Selection","description":"A two-handle slider for selecting a numeric interval.","entryPoint":"slider","file":"docs/range-slider.md","kind":"component","path":"range-slider","slug":"range-slider","title":"Range Slider"},{"category":"Selection","description":"Choose a value from a visual scale of icons, in whole or half steps.","entryPoint":"rating","file":"docs/rating.md","kind":"component","path":"rating","slug":"rating","title":"Rating"},{"category":"Selection","description":"A compact set of mutually exclusive options.","entryPoint":"segmented","file":"docs/segmented.md","kind":"component","path":"segmented","slug":"segmented","title":"Segmented"},{"category":"Selection","description":"A single-handle slider for selecting a numeric value.","entryPoint":"slider","file":"docs/slider.md","kind":"component","path":"slider","slug":"slider","title":"Slider"},{"category":"Selection","description":"A binary on and off toggle with optional state labels.","entryPoint":"switch","file":"docs/switch.md","kind":"component","path":"switch","slug":"switch","title":"Switch"},{"category":"Date, Time & Color","description":"Date selection in single, multiple and range modes across month, year and decade views.","entryPoint":"calendar","file":"docs/calendar.md","kind":"component","path":"calendar","slug":"calendar","title":"Calendar"},{"category":"Date, Time & Color","description":"A color editor for saturation, value, hue and alpha.","entryPoint":"color-gradient","file":"docs/color-gradient.md","kind":"component","path":"color-gradient","slug":"color-gradient","title":"Color Gradient"},{"category":"Date, Time & Color","description":"A grid of selectable color swatches from a built-in or custom scheme.","entryPoint":"color-palette","file":"docs/color-palette.md","kind":"component","path":"color-palette","slug":"color-palette","title":"Color Palette"},{"category":"Date, Time & Color","description":"A compact control that opens a color palette or gradient editor.","entryPoint":"color-picker","file":"docs/color-picker.md","kind":"component","path":"color-picker","slug":"color-picker","title":"Color Picker"},{"category":"Date, Time & Color","description":"A date input that opens a calendar popup.","entryPoint":"date-picker","file":"docs/date-picker.md","kind":"component","path":"date-picker","slug":"date-picker","title":"Date Picker"},{"category":"Date, Time & Color","description":"Two date inputs for a range of days, with a calendar popup that shows two months.","entryPoint":"date-range-picker","file":"docs/date-range-picker.md","kind":"component","path":"date-range-picker","slug":"date-range-picker","title":"Date Range Picker"},{"category":"Date, Time & Color","description":"An input for choosing a date and a time together.","entryPoint":"datetime-picker","file":"docs/datetime-picker.md","kind":"component","path":"datetime-picker","slug":"datetime-picker","title":"Date Time Picker"},{"category":"Date, Time & Color","description":"A time input that opens a time selector popup.","entryPoint":"time-picker","file":"docs/time-picker.md","kind":"component","path":"time-picker","slug":"time-picker","title":"Time Picker"},{"category":"Data","description":"Shows a person or entity as an image, text label or projected content, alone or stacked in a group.","entryPoint":"avatar","file":"docs/avatar.md","kind":"component","path":"avatar","slug":"avatar","title":"Avatar"},{"category":"Data","description":"A small filled or outlined label for a count or a status.","entryPoint":"badge","file":"docs/badge.md","kind":"component","path":"badge","slug":"badge","title":"Badge"},{"category":"Data","description":"A compact label that can be selected, removed or given a prefix.","entryPoint":"chip","file":"docs/chip.md","kind":"component","path":"chip","slug":"chip","title":"Chip"},{"category":"Data","description":"A board of columns that cards move between by dragging or with the keyboard, with column limits.","entryPoint":"kanban","file":"docs/kanban.md","kind":"component","path":"kanban","slug":"kanban","title":"Kanban"},{"category":"Data","description":"A selectable list with a toolbar for moving items and transferring them between lists.","entryPoint":"list-box","file":"docs/list-box.md","kind":"component","path":"list-box","slug":"list-box","title":"List Box"},{"category":"Data","description":"Renders a collection as a list, with optional selection, grouping and paging.","entryPoint":"list-view","file":"docs/list-view.md","kind":"component","path":"list-view","slug":"list-view","title":"List View"},{"category":"Data","description":"Pagination controls with page buttons, a page-size selector and a page-jump input.","entryPoint":"pager","file":"docs/pager.md","kind":"component","path":"pager","slug":"pager","title":"Pager"},{"category":"Data","description":"Encodes text or a URL as a scannable QR code, with logo overlays and PNG, SVG and PDF export.","entryPoint":"qr-code","file":"docs/qr-code.md","kind":"component","path":"qr-code","slug":"qr-code","title":"QR Code"},{"category":"Data","description":"Lets users reorder any list by dragging or with the keyboard, and move items between connected lists.","entryPoint":"sortable","file":"docs/sortable.md","kind":"component","path":"sortable","slug":"sortable","title":"Sortable"},{"category":"Data","description":"Dated events along a line, down the page or across it, with cards that can open and close.","entryPoint":"timeline","file":"docs/timeline.md","kind":"component","path":"timeline","slug":"timeline","title":"Timeline"},{"category":"Data","description":"Hierarchical data as an expandable, keyboard-navigable tree.","entryPoint":"tree-view","file":"docs/tree-view.md","kind":"component","path":"tree-view","slug":"tree-view","title":"Tree View"},{"category":"Conversation","description":"A conversation with people or an assistant: message bubbles by day and author, a message box that sends files, and replies that stream in.","entryPoint":"chat","file":"docs/chat.md","kind":"component","path":"chat","slug":"chat","title":"Chat"},{"category":"Grid","description":"Tabular data in typed columns with paging, templates and a toolbar, extended by feature directives.","entryPoint":"grid","file":"docs/grid.md","kind":"component","path":"grid","slug":"grid","title":"Grid Overview"},{"category":"Grid","description":"Sort rows by column headers and filter them from a header menu or a filter row.","entryPoint":"grid","file":"docs/grid-sorting-filtering.md","kind":"component","path":"grid-sorting-filtering","slug":"grid-sorting-filtering","title":"Sorting & Filtering"},{"category":"Grid","description":"Group rows by column values and show sums, averages and other aggregates in footers.","entryPoint":"grid","file":"docs/grid-grouping.md","kind":"component","path":"grid-grouping","slug":"grid-grouping","title":"Grouping & Aggregates"},{"category":"Grid","description":"Show hierarchical rows in a grid, nested or linked by a parent key, with expandable levels.","entryPoint":"grid","file":"docs/grid-tree.md","kind":"component","path":"grid-tree","slug":"grid-tree","title":"Tree List"},{"category":"Grid","description":"Select rows by key with checkboxes, clicks and the keyboard, or a range of cells to copy and paste.","entryPoint":"grid","file":"docs/grid-selection.md","kind":"component","path":"grid-selection","slug":"grid-selection","title":"Selection"},{"category":"Grid","description":"Edit cells or rows inline with Signal Forms, and add, save, cancel and remove rows.","entryPoint":"grid","file":"docs/grid-editing.md","kind":"component","path":"grid-editing","slug":"grid-editing","title":"Editing"},{"category":"Grid","description":"Group, resize, reorder, lock and hide columns, by pointer, keyboard or the column chooser.","entryPoint":"grid","file":"docs/grid-columns.md","kind":"component","path":"grid-columns","slug":"grid-columns","title":"Columns"},{"category":"Grid","description":"Expandable detail rows, row reordering by drag or keyboard, row classes and row sizing.","entryPoint":"grid","file":"docs/grid-rows.md","kind":"component","path":"grid-rows","slug":"grid-rows","title":"Rows"},{"category":"Grid","description":"Load pages from a server, or render only the visible rows of a large data set.","entryPoint":"grid","file":"docs/grid-server.md","kind":"component","path":"grid-server","slug":"grid-server","title":"Server Binding & Virtualization"},{"category":"Grid","description":"Save and restore the grid's columns, sort, filter, groups and page size, and export rows as CSV, Excel or PDF.","entryPoint":"grid","file":"docs/grid-state-export.md","kind":"component","path":"grid-state-export","slug":"grid-state-export","title":"State & Export"},{"category":"Charts","description":"High-performance Canvas charts composed from series, axes and interaction parts.","entryPoint":"chart","file":"docs/chart.md","kind":"component","path":"chart","slug":"chart","title":"Chart Overview"},{"category":"Charts","description":"Line, area and range area series for values that change across a continuous or category axis.","entryPoint":"chart","file":"docs/chart-line-area.md","kind":"component","path":"chart-line-area","slug":"chart-line-area","title":"Line & Area"},{"category":"Charts","description":"Bar, range bar and waterfall series for comparing values, intervals and running totals.","entryPoint":"chart","file":"docs/chart-bar.md","kind":"component","path":"chart-bar","slug":"chart-bar","title":"Bar & Waterfall"},{"category":"Charts","description":"Scatter and bubble series for the relationship between two or three numeric values.","entryPoint":"chart","file":"docs/chart-scatter.md","kind":"component","path":"chart-scatter","slug":"chart-scatter","title":"Scatter & Bubble"},{"category":"Charts","description":"Candlestick and OHLC series for open, high, low and close prices.","entryPoint":"chart","file":"docs/chart-financial.md","kind":"component","path":"chart-financial","slug":"chart-financial","title":"Financial"},{"category":"Charts","description":"A heatmap series that colors a grid of cells by value, with a color legend.","entryPoint":"chart","file":"docs/chart-heatmap.md","kind":"component","path":"chart-heatmap","slug":"chart-heatmap","title":"Heatmap"},{"category":"Charts","description":"Pie and donut series for the parts of a whole, with slice labels and a donut center.","entryPoint":"chart","file":"docs/chart-pie.md","kind":"component","path":"chart-pie","slug":"chart-pie","title":"Pie & Donut"},{"category":"Charts","description":"A funnel series for stages that narrow, with conversion and drop-off between them.","entryPoint":"chart","file":"docs/chart-funnel.md","kind":"component","path":"chart-funnel","slug":"chart-funnel","title":"Funnel"},{"category":"Charts","description":"A treemap series that tiles hierarchical data by value.","entryPoint":"chart","file":"docs/chart-treemap.md","kind":"component","path":"chart-treemap","slug":"chart-treemap","title":"Treemap"},{"category":"Charts","description":"Radar and polar series on angular and radial axes, for comparing metrics or directions.","entryPoint":"chart","file":"docs/chart-radar.md","kind":"component","path":"chart-radar","slug":"chart-radar","title":"Radar & Polar"},{"category":"Charts","description":"Radial bar, rose and gauge series that draw values as arcs around a center.","entryPoint":"chart","file":"docs/chart-radial.md","kind":"component","path":"chart-radial","slug":"chart-radial","title":"Radial"},{"category":"Charts","description":"A word-sized line, area, column or win-loss chart, for a table cell or a line of text.","entryPoint":"sparkline","file":"docs/sparkline.md","kind":"component","path":"sparkline","slug":"sparkline","title":"Sparkline"},{"category":"Navigation","description":"A navigation trail showing where the current page sits in a hierarchy.","entryPoint":"breadcrumb","file":"docs/breadcrumb.md","kind":"component","path":"breadcrumb","slug":"breadcrumb","title":"Breadcrumb"},{"category":"Navigation","description":"A searchable list of actions or options, operated from one input, inline or in a dialog.","entryPoint":"command","file":"docs/command.md","kind":"component","path":"command","slug":"command","title":"Command Menu"},{"category":"Navigation","description":"A popup menu attached to an element, opened by right-click or keyboard.","entryPoint":"contextmenu","file":"docs/contextmenu.md","kind":"component","path":"contextmenu","slug":"contextmenu","title":"Context Menu"},{"category":"Navigation","description":"A persistent horizontal bar of top-level menus.","entryPoint":"menubar","file":"docs/menubar.md","kind":"component","path":"menubar","slug":"menubar","title":"Menubar"},{"category":"Navigation","description":"Opens a menu from an element you already have, such as an icon button or a row action.","entryPoint":"popup-menu","file":"docs/popup-menu.md","kind":"component","path":"popup-menu","slug":"popup-menu","title":"Popup Menu"},{"category":"Navigation","description":"A composable application shell with collapsible side panels.","entryPoint":"sidebar","file":"docs/sidebar.md","kind":"component","path":"sidebar","slug":"sidebar","title":"Sidebar"},{"category":"Navigation","description":"Groups, menus, rows, submenus, badges, actions and loading rows inside a sidebar.","entryPoint":"sidebar","file":"docs/sidebar-menus.md","kind":"component","path":"sidebar/menus","slug":"sidebar-menus","title":"Sidebar Menus"},{"category":"Navigation","description":"Collapsing, controlled and remembered state, the drawer on small screens, and reading a sidebar from code.","entryPoint":"sidebar","file":"docs/sidebar-state.md","kind":"component","path":"sidebar/state","slug":"sidebar-state","title":"Sidebar State & Behavior"},{"category":"Navigation","description":"Guides users through a sequential, multi-step process.","entryPoint":"stepper","file":"docs/stepper.md","kind":"component","path":"stepper","slug":"stepper","title":"Stepper"},{"category":"Navigation","description":"Switches between panels of related content.","entryPoint":"tabs","file":"docs/tabs.md","kind":"component","path":"tabs","slug":"tabs","title":"Tabs"},{"category":"Overlays","description":"Modal or non-modal messages, confirmations and content dialogs.","entryPoint":"dialog","file":"docs/dialog.md","kind":"component","path":"dialog","slug":"dialog","title":"Dialog"},{"category":"Overlays","description":"A floating panel anchored to a target and opened by a configurable trigger.","entryPoint":"popover","file":"docs/popover.md","kind":"component","path":"popover","slug":"popover","title":"Popover"},{"category":"Overlays","description":"Positions arbitrary content relative to an anchor, a point or the viewport.","entryPoint":"popup","file":"docs/popup.md","kind":"component","path":"popup","slug":"popup","title":"Popup"},{"category":"Overlays","description":"A modal panel attached to an edge of the viewport.","entryPoint":"sheet","file":"docs/sheet.md","kind":"component","path":"sheet","slug":"sheet","title":"Sheet"},{"category":"Overlays","description":"A floating tooltip with projected content, anchored to a separate target.","entryPoint":"tooltip","file":"docs/tooltip.md","kind":"component","path":"tooltip","slug":"tooltip","title":"Tooltip"},{"category":"Overlays","description":"Replaces a native title attribute with a styled tooltip.","entryPoint":"tooltip","file":"docs/tooltip-directive.md","kind":"component","path":"tooltip-directive","slug":"tooltip-directive","title":"Tooltip Directive"},{"category":"Overlays","description":"A draggable, resizable floating window that can be minimized and maximized.","entryPoint":"window","file":"docs/window.md","kind":"component","path":"window","slug":"window","title":"Window"},{"category":"Layout","description":"Groups related content and actions on one raised surface.","entryPoint":"card","file":"docs/card.md","kind":"component","path":"card","slug":"card","title":"Card"},{"category":"Layout","description":"A headless disclosure primitive for expandable regions.","entryPoint":"collapsible","file":"docs/collapsible.md","kind":"component","path":"collapsible","slug":"collapsible","title":"Collapsible"},{"category":"Layout","description":"A header that shows and hides its content, designed to stack with other panels.","entryPoint":"expansion-panel","file":"docs/expansion-panel.md","kind":"component","path":"expansion-panel","slug":"expansion-panel","title":"Expansion Panel"},{"category":"Layout","description":"A fixed-size carousel that pages through a collection one item at a time.","entryPoint":"scroll-view","file":"docs/scroll-view.md","kind":"component","path":"scroll-view","slug":"scroll-view","title":"Scroll View"},{"category":"Layout","description":"A thin line between groups of content, across or down, with an optional label.","entryPoint":"separator","file":"docs/separator.md","kind":"component","path":"separator","slug":"separator","title":"Separator"},{"category":"Layout","description":"Lays out panes in a row or column that can be resized and collapsed.","entryPoint":"splitter","file":"docs/splitter.md","kind":"component","path":"splitter","slug":"splitter","title":"Splitter"},{"category":"Feedback","description":"A message that stays on the page, tinted for what it means, with optional actions and dismissal.","entryPoint":"alert","file":"docs/alert.md","kind":"component","path":"alert","slug":"alert","title":"Alert"},{"category":"Feedback","description":"A circular progress indicator with an optional custom label.","entryPoint":"circular-progress-bar","file":"docs/circular-progress-bar.md","kind":"component","path":"circular-progress-bar","slug":"circular-progress-bar","title":"Circular Progress Bar"},{"category":"Feedback","description":"Transient toast notifications with optional auto-dismiss.","entryPoint":"notification","file":"docs/notification.md","kind":"component","path":"notification","slug":"notification","title":"Notification"},{"category":"Feedback","description":"Fills an empty area with a muted label or projected content.","entryPoint":"placeholder","file":"docs/placeholder.md","kind":"component","path":"placeholder","slug":"placeholder","title":"Placeholder"},{"category":"Feedback","description":"A horizontal progress indicator with determinate and indeterminate modes.","entryPoint":"progress-bar","file":"docs/progress-bar.md","kind":"component","path":"progress-bar","slug":"progress-bar","title":"Progress Bar"},{"category":"Feedback","description":"A decorative placeholder block for content that is still loading.","entryPoint":"skeleton","file":"docs/skeleton.md","kind":"component","path":"skeleton","slug":"skeleton","title":"Skeleton"},{"category":"Feedback","description":"An animated loading indicator and a service for loading overlays.","entryPoint":"spinner","file":"docs/spinner.md","kind":"component","path":"spinner","slug":"spinner","title":"Spinner"}],"schemaVersion":1,"version":"0.46.0"}
|
|
1
|
+
{"essentials":"Mona UI is an Angular component library styled with Tailwind CSS 4. Its components are standalone and signal based: inputs are `input()` and `model()`, events are `output()`.\n\n## Essentials\n\n- Install with `npm install @nanahoshi/mona-ui`. The application needs Tailwind CSS 4.\n- Import the styles in the main stylesheet, after Tailwind: `@import \"tailwindcss\";` then `@import \"@nanahoshi/mona-ui/styles.css\";`. Without it, components render unstyled.\n- Import every symbol from its entry point, such as `import { ButtonDirective } from \"@nanahoshi/mona-ui/button\";`. Each page below names its entry point. The root `@nanahoshi/mona-ui` exports nothing.\n- Add what you import to the standalone component's `imports` array. There are no NgModules.\n- No provider is required. Optional ones: `provideThemeOptions` (`@nanahoshi/mona-ui/theme`) to pick a theme, `provideMonaI18n` (`@nanahoshi/mona-ui/i18n`) for locale and messages, `provideNotificationDefaults` (`@nanahoshi/mona-ui/notification`) and `provideSidebarStorage` (`@nanahoshi/mona-ui/sidebar`).\n- Form controls implement `FormValueControl` from `@angular/forms/signals`: bind them with `[formField]`. They have no `ControlValueAccessor`, but `[(ngModel)]` and `[formControl]` still work, because Angular binds a control's `value` and `touch` directly.\n\n## Common mistakes\n\n- Importing from `@nanahoshi/mona-ui` instead of an entry point such as `@nanahoshi/mona-ui/grid`.\n- Leaving out `@nanahoshi/mona-ui/styles.css`, or importing it before Tailwind.\n- Treating a `placeholder` as a label. Give each control a name: a `<label for>` pointed at its input id, `aria-label` or `aria-labelledby`. Those two are inputs on every component that takes a name, and the component moves them to the element that has the role.\n- Expecting the grid, list box or tabs to change their data. They report the change through an event, and you write it back to the data you bound.\n- Putting `[disabled]` on a `monaTooltip` that sits on a button: it disables the button too. Use `[tooltipDisabled]`.\n- Using the rich text editor without its packages and styles. Mona UI doesn't install them: add `@tiptap/core`, `@tiptap/pm`, `@tiptap/starter-kit`, `@tiptap/extension-highlight`, `@tiptap/extension-image`, `@tiptap/extension-list`, `@tiptap/extension-subscript`, `@tiptap/extension-superscript`, `@tiptap/extension-table`, `@tiptap/extension-text-align`, `@tiptap/extension-text-style`, `remixicon` and `@tailwindcss/typography`, then `@import \"remixicon/fonts/remixicon.css\";` and `@plugin \"@tailwindcss/typography\";` to the global stylesheet.\n- Exporting a chart without its packages. `exportChart` and `downloadChart` need `jspdf`, `svg2pdf.js` and `html2canvas-pro`, which Mona UI doesn't install.","pages":[{"category":"Get Started","description":"What Mona UI is, what it includes and how it is built.","file":"docs/introduction.md","kind":"guide","path":"introduction","slug":"introduction","title":"Introduction"},{"category":"Get Started","description":"Install the package, set up its styles and choose a theme.","file":"docs/installation.md","kind":"guide","path":"installation","slug":"installation","title":"Installation"},{"category":"Get Started","description":"Choose and switch themes, follow the system's dark mode, and use theme tokens in your own styles.","entryPoint":"theme","file":"docs/theming.md","kind":"guide","path":"theming","slug":"theming","title":"Theming"},{"category":"Get Started","description":"Mona, Luna, Anna and Rena side by side, and when to use each one.","file":"docs/theming-built-in-themes.md","kind":"guide","path":"theming/built-in-themes","slug":"theming-built-in-themes","title":"Built-in Themes"},{"category":"Get Started","description":"Generate a palette from brand colors, override tokens, or let users choose a color.","file":"docs/theming-custom-colors.md","kind":"guide","path":"theming/custom-colors","slug":"theming-custom-colors","title":"Custom Colors"},{"category":"Get Started","description":"Register a theme of your own, from scratch or based on a built-in theme.","file":"docs/theming-custom-themes.md","kind":"guide","path":"theming/custom-themes","slug":"theming-custom-themes","title":"Custom Themes"},{"category":"Get Started","description":"Turn on a ripple that spreads from where a button is pressed, and add it to your own elements.","entryPoint":"ripple","file":"docs/ripple.md","kind":"guide","path":"ripple","slug":"ripple","title":"Ripple"},{"category":"Get Started","description":"Connect Mona UI controls to Angular signal forms.","file":"docs/forms.md","kind":"guide","path":"forms","slug":"forms","title":"Forms"},{"category":"Actions","description":"Styles a native button and adds loading, toggle and disabled behavior.","entryPoint":"button","file":"docs/button.md","kind":"component","path":"button","slug":"button","title":"Button"},{"category":"Actions","description":"Joins related buttons into one control with a shared look and size.","entryPoint":"button-group","file":"docs/button-group.md","kind":"component","path":"button-group","slug":"button-group","title":"Button Group"},{"category":"Actions","description":"A single button that opens a menu of actions.","entryPoint":"dropdown-button","file":"docs/dropdown-button.md","kind":"component","path":"dropdown-button","slug":"dropdown-button","title":"Dropdown Button"},{"category":"Actions","description":"A primary action button paired with a menu of secondary actions.","entryPoint":"split-button","file":"docs/split-button.md","kind":"component","path":"split-button","slug":"split-button","title":"Split Button"},{"category":"Actions","description":"A row of controls that is one Tab stop, moving what doesn't fit into a More menu.","entryPoint":"toolbar","file":"docs/toolbar.md","kind":"component","path":"toolbar","slug":"toolbar","title":"Toolbar"},{"category":"Form Fields","description":"A numeric input whose value is a decimal string, for exact values like money.","entryPoint":"numeric-text-box","file":"docs/decimal-textbox.md","kind":"component","path":"decimal-textbox","slug":"decimal-textbox","title":"Decimal Text Box"},{"category":"Form Fields","description":"A rich text editor with a configurable toolbar and an HTML value.","entryPoint":"editor","file":"docs/editor.md","kind":"component","path":"editor","slug":"editor","title":"Editor"},{"category":"Form Fields","description":"Groups related form controls under a labelled border.","entryPoint":"fieldset","file":"docs/fieldset.md","kind":"component","path":"fieldset","slug":"fieldset","title":"Fieldset"},{"category":"Form Fields","description":"Picks files from a drop zone or the file dialog, checks them, and uploads them with progress.","entryPoint":"file-upload","file":"docs/file-upload.md","kind":"component","path":"file-upload","slug":"file-upload","title":"File Upload"},{"category":"Form Fields","description":"Labels one form control, describes it with a hint and shows its validation errors.","entryPoint":"form-field","file":"docs/form-field.md","kind":"component","path":"form-field","slug":"form-field","title":"Form Field"},{"category":"Form Fields","description":"Styles a native input element and keeps its browser behavior.","entryPoint":"text-box","file":"docs/input.md","kind":"component","path":"input","slug":"input","title":"Input"},{"category":"Form Fields","description":"Styled, accessible labels associated with form controls.","entryPoint":"label","file":"docs/label.md","kind":"component","path":"label","slug":"label","title":"Label"},{"category":"Form Fields","description":"A text input for values in a fixed format, such as phone numbers, that fills in the format as you type.","entryPoint":"masked-text-box","file":"docs/masked-textbox.md","kind":"component","path":"masked-textbox","slug":"masked-textbox","title":"Masked Text Box"},{"category":"Form Fields","description":"A number input with spinner buttons, bounds and decimal formatting.","entryPoint":"numeric-text-box","file":"docs/numeric-textbox.md","kind":"component","path":"numeric-textbox","slug":"numeric-textbox","title":"Numeric Text Box"},{"category":"Form Fields","description":"A segmented input for one-time passwords and verification codes.","entryPoint":"otp-input","file":"docs/otp-input.md","kind":"component","path":"otp-input","slug":"otp-input","title":"OTP Input"},{"category":"Form Fields","description":"Styles a native textarea element and keeps its browser behavior.","entryPoint":"text-area","file":"docs/textarea.md","kind":"component","path":"textarea","slug":"textarea","title":"Text Area"},{"category":"Form Fields","description":"A text input with prefix and suffix slots and an optional clear button.","entryPoint":"text-box","file":"docs/textbox.md","kind":"component","path":"textbox","slug":"textbox","title":"Text Box"},{"category":"Selection","description":"A text input that suggests matching options as the user types.","entryPoint":"auto-complete","file":"docs/auto-complete.md","kind":"component","path":"auto-complete","slug":"auto-complete","title":"Auto Complete"},{"category":"Selection","description":"A checkbox with label handling and an indeterminate state.","entryPoint":"check-box","file":"docs/checkbox.md","kind":"component","path":"checkbox","slug":"checkbox","title":"Checkbox"},{"category":"Selection","description":"A text input that resolves typed text to one item from a collection.","entryPoint":"combo-box","file":"docs/combo-box.md","kind":"component","path":"combo-box","slug":"combo-box","title":"Combo Box"},{"category":"Selection","description":"A closed control that opens a list for choosing exactly one option.","entryPoint":"dropdown-list","file":"docs/dropdown-list.md","kind":"component","path":"dropdown-list","slug":"dropdown-list","title":"Dropdown List"},{"category":"Selection","description":"A closed control that opens a tree for choosing one item from a hierarchy.","entryPoint":"dropdown-tree","file":"docs/dropdown-tree.md","kind":"component","path":"dropdown-tree","slug":"dropdown-tree","title":"Dropdown Tree"},{"category":"Selection","description":"A control that shows selected options as removable tags.","entryPoint":"multi-select","file":"docs/multi-select.md","kind":"component","path":"multi-select","slug":"multi-select","title":"Multi Select"},{"category":"Selection","description":"A control that opens a tree with checkboxes and shows the checked items as removable tags.","entryPoint":"multi-select-tree","file":"docs/multi-select-tree.md","kind":"component","path":"multi-select-tree","slug":"multi-select-tree","title":"Multi Select Tree"},{"category":"Selection","description":"Radio buttons and groups for choosing one option from several.","entryPoint":"radio-button","file":"docs/radio-button.md","kind":"component","path":"radio-button","slug":"radio-button","title":"Radio Button"},{"category":"Selection","description":"A two-handle slider for selecting a numeric interval.","entryPoint":"slider","file":"docs/range-slider.md","kind":"component","path":"range-slider","slug":"range-slider","title":"Range Slider"},{"category":"Selection","description":"Choose a value from a visual scale of icons, in whole or half steps.","entryPoint":"rating","file":"docs/rating.md","kind":"component","path":"rating","slug":"rating","title":"Rating"},{"category":"Selection","description":"A compact set of mutually exclusive options.","entryPoint":"segmented","file":"docs/segmented.md","kind":"component","path":"segmented","slug":"segmented","title":"Segmented"},{"category":"Selection","description":"A single-handle slider for selecting a numeric value.","entryPoint":"slider","file":"docs/slider.md","kind":"component","path":"slider","slug":"slider","title":"Slider"},{"category":"Selection","description":"A binary on and off toggle with optional state labels.","entryPoint":"switch","file":"docs/switch.md","kind":"component","path":"switch","slug":"switch","title":"Switch"},{"category":"Date, Time & Color","description":"Date selection in single, multiple and range modes across month, year and decade views.","entryPoint":"calendar","file":"docs/calendar.md","kind":"component","path":"calendar","slug":"calendar","title":"Calendar"},{"category":"Date, Time & Color","description":"A color editor for saturation, value, hue and alpha.","entryPoint":"color-gradient","file":"docs/color-gradient.md","kind":"component","path":"color-gradient","slug":"color-gradient","title":"Color Gradient"},{"category":"Date, Time & Color","description":"A grid of selectable color swatches from a built-in or custom scheme.","entryPoint":"color-palette","file":"docs/color-palette.md","kind":"component","path":"color-palette","slug":"color-palette","title":"Color Palette"},{"category":"Date, Time & Color","description":"A compact control that opens a color palette or gradient editor.","entryPoint":"color-picker","file":"docs/color-picker.md","kind":"component","path":"color-picker","slug":"color-picker","title":"Color Picker"},{"category":"Date, Time & Color","description":"A date input that opens a calendar popup.","entryPoint":"date-picker","file":"docs/date-picker.md","kind":"component","path":"date-picker","slug":"date-picker","title":"Date Picker"},{"category":"Date, Time & Color","description":"Two date inputs for a range of days, with a calendar popup that shows two months.","entryPoint":"date-range-picker","file":"docs/date-range-picker.md","kind":"component","path":"date-range-picker","slug":"date-range-picker","title":"Date Range Picker"},{"category":"Date, Time & Color","description":"An input for choosing a date and a time together.","entryPoint":"datetime-picker","file":"docs/datetime-picker.md","kind":"component","path":"datetime-picker","slug":"datetime-picker","title":"Date Time Picker"},{"category":"Date, Time & Color","description":"A time input that opens a time selector popup.","entryPoint":"time-picker","file":"docs/time-picker.md","kind":"component","path":"time-picker","slug":"time-picker","title":"Time Picker"},{"category":"Data","description":"Shows a person or entity as an image, text label or projected content, alone or stacked in a group.","entryPoint":"avatar","file":"docs/avatar.md","kind":"component","path":"avatar","slug":"avatar","title":"Avatar"},{"category":"Data","description":"A small filled or outlined label for a count or a status.","entryPoint":"badge","file":"docs/badge.md","kind":"component","path":"badge","slug":"badge","title":"Badge"},{"category":"Data","description":"A compact label that can be selected, removed or given a prefix.","entryPoint":"chip","file":"docs/chip.md","kind":"component","path":"chip","slug":"chip","title":"Chip"},{"category":"Data","description":"A board of columns that cards move between by dragging or with the keyboard, with column limits.","entryPoint":"kanban","file":"docs/kanban.md","kind":"component","path":"kanban","slug":"kanban","title":"Kanban"},{"category":"Data","description":"A selectable list with a toolbar for moving items and transferring them between lists.","entryPoint":"list-box","file":"docs/list-box.md","kind":"component","path":"list-box","slug":"list-box","title":"List Box"},{"category":"Data","description":"Renders a collection as a list, with optional selection, grouping and paging.","entryPoint":"list-view","file":"docs/list-view.md","kind":"component","path":"list-view","slug":"list-view","title":"List View"},{"category":"Data","description":"Pagination controls with page buttons, a page-size selector and a page-jump input.","entryPoint":"pager","file":"docs/pager.md","kind":"component","path":"pager","slug":"pager","title":"Pager"},{"category":"Data","description":"Encodes text or a URL as a scannable QR code, with logo overlays and PNG, SVG and PDF export.","entryPoint":"qr-code","file":"docs/qr-code.md","kind":"component","path":"qr-code","slug":"qr-code","title":"QR Code"},{"category":"Data","description":"Lets users reorder any list by dragging or with the keyboard, and move items between connected lists.","entryPoint":"sortable","file":"docs/sortable.md","kind":"component","path":"sortable","slug":"sortable","title":"Sortable"},{"category":"Data","description":"Dated events along a line, down the page or across it, with cards that can open and close.","entryPoint":"timeline","file":"docs/timeline.md","kind":"component","path":"timeline","slug":"timeline","title":"Timeline"},{"category":"Data","description":"Hierarchical data as an expandable, keyboard-navigable tree.","entryPoint":"tree-view","file":"docs/tree-view.md","kind":"component","path":"tree-view","slug":"tree-view","title":"Tree View"},{"category":"Conversation","description":"A conversation with people or an assistant: message bubbles by day and author, a message box that sends files, and replies that stream in.","entryPoint":"chat","file":"docs/chat.md","kind":"component","path":"chat","slug":"chat","title":"Chat"},{"category":"Grid","description":"Tabular data in typed columns with paging, templates and a toolbar, extended by feature directives.","entryPoint":"grid","file":"docs/grid.md","kind":"component","path":"grid","slug":"grid","title":"Grid Overview"},{"category":"Grid","description":"Sort rows by column headers and filter them from a header menu or a filter row.","entryPoint":"grid","file":"docs/grid-sorting-filtering.md","kind":"component","path":"grid-sorting-filtering","slug":"grid-sorting-filtering","title":"Sorting & Filtering"},{"category":"Grid","description":"Group rows by column values and show sums, averages and other aggregates in footers.","entryPoint":"grid","file":"docs/grid-grouping.md","kind":"component","path":"grid-grouping","slug":"grid-grouping","title":"Grouping & Aggregates"},{"category":"Grid","description":"Show hierarchical rows in a grid, nested or linked by a parent key, with expandable levels.","entryPoint":"grid","file":"docs/grid-tree.md","kind":"component","path":"grid-tree","slug":"grid-tree","title":"Tree List"},{"category":"Grid","description":"Select rows by key with checkboxes, clicks and the keyboard, or a range of cells to copy and paste.","entryPoint":"grid","file":"docs/grid-selection.md","kind":"component","path":"grid-selection","slug":"grid-selection","title":"Selection"},{"category":"Grid","description":"Edit cells or rows inline with Signal Forms, and add, save, cancel and remove rows.","entryPoint":"grid","file":"docs/grid-editing.md","kind":"component","path":"grid-editing","slug":"grid-editing","title":"Editing"},{"category":"Grid","description":"Group, resize, reorder, lock and hide columns, by pointer, keyboard or the column chooser.","entryPoint":"grid","file":"docs/grid-columns.md","kind":"component","path":"grid-columns","slug":"grid-columns","title":"Columns"},{"category":"Grid","description":"Expandable detail rows, row reordering by drag or keyboard, row classes and row sizing.","entryPoint":"grid","file":"docs/grid-rows.md","kind":"component","path":"grid-rows","slug":"grid-rows","title":"Rows"},{"category":"Grid","description":"Load pages from a server, or render only the visible rows of a large data set.","entryPoint":"grid","file":"docs/grid-server.md","kind":"component","path":"grid-server","slug":"grid-server","title":"Server Binding & Virtualization"},{"category":"Grid","description":"Save and restore the grid's columns, sort, filter, groups and page size, and export rows as CSV, Excel or PDF.","entryPoint":"grid","file":"docs/grid-state-export.md","kind":"component","path":"grid-state-export","slug":"grid-state-export","title":"State & Export"},{"category":"Charts","description":"High-performance Canvas charts composed from series, axes and interaction parts.","entryPoint":"chart","file":"docs/chart.md","kind":"component","path":"chart","slug":"chart","title":"Chart Overview"},{"category":"Charts","description":"Line, area and range area series for values that change across a continuous or category axis.","entryPoint":"chart","file":"docs/chart-line-area.md","kind":"component","path":"chart-line-area","slug":"chart-line-area","title":"Line & Area"},{"category":"Charts","description":"Bar, range bar and waterfall series for comparing values, intervals and running totals.","entryPoint":"chart","file":"docs/chart-bar.md","kind":"component","path":"chart-bar","slug":"chart-bar","title":"Bar & Waterfall"},{"category":"Charts","description":"Scatter and bubble series for the relationship between two or three numeric values.","entryPoint":"chart","file":"docs/chart-scatter.md","kind":"component","path":"chart-scatter","slug":"chart-scatter","title":"Scatter & Bubble"},{"category":"Charts","description":"Candlestick and OHLC series for open, high, low and close prices.","entryPoint":"chart","file":"docs/chart-financial.md","kind":"component","path":"chart-financial","slug":"chart-financial","title":"Financial"},{"category":"Charts","description":"A heatmap series that colors a grid of cells by value, with a color legend.","entryPoint":"chart","file":"docs/chart-heatmap.md","kind":"component","path":"chart-heatmap","slug":"chart-heatmap","title":"Heatmap"},{"category":"Charts","description":"Pie and donut series for the parts of a whole, with slice labels and a donut center.","entryPoint":"chart","file":"docs/chart-pie.md","kind":"component","path":"chart-pie","slug":"chart-pie","title":"Pie & Donut"},{"category":"Charts","description":"A funnel series for stages that narrow, with conversion and drop-off between them.","entryPoint":"chart","file":"docs/chart-funnel.md","kind":"component","path":"chart-funnel","slug":"chart-funnel","title":"Funnel"},{"category":"Charts","description":"A treemap series that tiles hierarchical data by value.","entryPoint":"chart","file":"docs/chart-treemap.md","kind":"component","path":"chart-treemap","slug":"chart-treemap","title":"Treemap"},{"category":"Charts","description":"Radar and polar series on angular and radial axes, for comparing metrics or directions.","entryPoint":"chart","file":"docs/chart-radar.md","kind":"component","path":"chart-radar","slug":"chart-radar","title":"Radar & Polar"},{"category":"Charts","description":"Radial bar, rose and gauge series that draw values as arcs around a center.","entryPoint":"chart","file":"docs/chart-radial.md","kind":"component","path":"chart-radial","slug":"chart-radial","title":"Radial"},{"category":"Charts","description":"A word-sized line, area, column or win-loss chart, for a table cell or a line of text.","entryPoint":"sparkline","file":"docs/sparkline.md","kind":"component","path":"sparkline","slug":"sparkline","title":"Sparkline"},{"category":"Navigation","description":"A navigation trail showing where the current page sits in a hierarchy.","entryPoint":"breadcrumb","file":"docs/breadcrumb.md","kind":"component","path":"breadcrumb","slug":"breadcrumb","title":"Breadcrumb"},{"category":"Navigation","description":"A searchable list of actions or options, operated from one input, inline or in a dialog.","entryPoint":"command","file":"docs/command.md","kind":"component","path":"command","slug":"command","title":"Command Menu"},{"category":"Navigation","description":"A popup menu attached to an element, opened by right-click or keyboard.","entryPoint":"contextmenu","file":"docs/contextmenu.md","kind":"component","path":"contextmenu","slug":"contextmenu","title":"Context Menu"},{"category":"Navigation","description":"A persistent horizontal bar of top-level menus.","entryPoint":"menubar","file":"docs/menubar.md","kind":"component","path":"menubar","slug":"menubar","title":"Menubar"},{"category":"Navigation","description":"Opens a menu from an element you already have, such as an icon button or a row action.","entryPoint":"popup-menu","file":"docs/popup-menu.md","kind":"component","path":"popup-menu","slug":"popup-menu","title":"Popup Menu"},{"category":"Navigation","description":"A composable application shell with collapsible side panels.","entryPoint":"sidebar","file":"docs/sidebar.md","kind":"component","path":"sidebar","slug":"sidebar","title":"Sidebar"},{"category":"Navigation","description":"Groups, menus, rows, submenus, badges, actions and loading rows inside a sidebar.","entryPoint":"sidebar","file":"docs/sidebar-menus.md","kind":"component","path":"sidebar/menus","slug":"sidebar-menus","title":"Sidebar Menus"},{"category":"Navigation","description":"Collapsing, controlled and remembered state, the drawer on small screens, and reading a sidebar from code.","entryPoint":"sidebar","file":"docs/sidebar-state.md","kind":"component","path":"sidebar/state","slug":"sidebar-state","title":"Sidebar State & Behavior"},{"category":"Navigation","description":"Guides users through a sequential, multi-step process.","entryPoint":"stepper","file":"docs/stepper.md","kind":"component","path":"stepper","slug":"stepper","title":"Stepper"},{"category":"Navigation","description":"Switches between panels of related content.","entryPoint":"tabs","file":"docs/tabs.md","kind":"component","path":"tabs","slug":"tabs","title":"Tabs"},{"category":"Overlays","description":"Modal or non-modal messages, confirmations and content dialogs.","entryPoint":"dialog","file":"docs/dialog.md","kind":"component","path":"dialog","slug":"dialog","title":"Dialog"},{"category":"Overlays","description":"A floating panel anchored to a target and opened by a configurable trigger.","entryPoint":"popover","file":"docs/popover.md","kind":"component","path":"popover","slug":"popover","title":"Popover"},{"category":"Overlays","description":"Positions arbitrary content relative to an anchor, a point or the viewport.","entryPoint":"popup","file":"docs/popup.md","kind":"component","path":"popup","slug":"popup","title":"Popup"},{"category":"Overlays","description":"A modal panel attached to an edge of the viewport.","entryPoint":"sheet","file":"docs/sheet.md","kind":"component","path":"sheet","slug":"sheet","title":"Sheet"},{"category":"Overlays","description":"A floating tooltip with projected content, anchored to a separate target.","entryPoint":"tooltip","file":"docs/tooltip.md","kind":"component","path":"tooltip","slug":"tooltip","title":"Tooltip"},{"category":"Overlays","description":"Replaces a native title attribute with a styled tooltip.","entryPoint":"tooltip","file":"docs/tooltip-directive.md","kind":"component","path":"tooltip-directive","slug":"tooltip-directive","title":"Tooltip Directive"},{"category":"Overlays","description":"A draggable, resizable floating window that can be minimized and maximized.","entryPoint":"window","file":"docs/window.md","kind":"component","path":"window","slug":"window","title":"Window"},{"category":"Layout","description":"Groups related content and actions on one raised surface.","entryPoint":"card","file":"docs/card.md","kind":"component","path":"card","slug":"card","title":"Card"},{"category":"Layout","description":"A headless disclosure primitive for expandable regions.","entryPoint":"collapsible","file":"docs/collapsible.md","kind":"component","path":"collapsible","slug":"collapsible","title":"Collapsible"},{"category":"Layout","description":"A header that shows and hides its content, designed to stack with other panels.","entryPoint":"expansion-panel","file":"docs/expansion-panel.md","kind":"component","path":"expansion-panel","slug":"expansion-panel","title":"Expansion Panel"},{"category":"Layout","description":"A fixed-size carousel that pages through a collection one item at a time.","entryPoint":"scroll-view","file":"docs/scroll-view.md","kind":"component","path":"scroll-view","slug":"scroll-view","title":"Scroll View"},{"category":"Layout","description":"A thin line between groups of content, across or down, with an optional label.","entryPoint":"separator","file":"docs/separator.md","kind":"component","path":"separator","slug":"separator","title":"Separator"},{"category":"Layout","description":"Lays out panes in a row or column that can be resized and collapsed.","entryPoint":"splitter","file":"docs/splitter.md","kind":"component","path":"splitter","slug":"splitter","title":"Splitter"},{"category":"Feedback","description":"A message that stays on the page, tinted for what it means, with optional actions and dismissal.","entryPoint":"alert","file":"docs/alert.md","kind":"component","path":"alert","slug":"alert","title":"Alert"},{"category":"Feedback","description":"A circular progress indicator with an optional custom label.","entryPoint":"circular-progress-bar","file":"docs/circular-progress-bar.md","kind":"component","path":"circular-progress-bar","slug":"circular-progress-bar","title":"Circular Progress Bar"},{"category":"Feedback","description":"Transient toast notifications with optional auto-dismiss.","entryPoint":"notification","file":"docs/notification.md","kind":"component","path":"notification","slug":"notification","title":"Notification"},{"category":"Feedback","description":"Fills an empty area with a muted label or projected content.","entryPoint":"placeholder","file":"docs/placeholder.md","kind":"component","path":"placeholder","slug":"placeholder","title":"Placeholder"},{"category":"Feedback","description":"A horizontal progress indicator with determinate and indeterminate modes.","entryPoint":"progress-bar","file":"docs/progress-bar.md","kind":"component","path":"progress-bar","slug":"progress-bar","title":"Progress Bar"},{"category":"Feedback","description":"A decorative placeholder block for content that is still loading.","entryPoint":"skeleton","file":"docs/skeleton.md","kind":"component","path":"skeleton","slug":"skeleton","title":"Skeleton"},{"category":"Feedback","description":"An animated loading indicator and a service for loading overlays.","entryPoint":"spinner","file":"docs/spinner.md","kind":"component","path":"spinner","slug":"spinner","title":"Spinner"}],"schemaVersion":1,"version":"0.47.0"}
|
package/docs/ripple.md
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
# Ripple
|
|
2
|
+
|
|
3
|
+
> Turn on a ripple that spreads from where a button is pressed, and add it to your own elements.
|
|
4
|
+
|
|
5
|
+
Entry point: `@nanahoshi/mona-ui/ripple`
|
|
6
|
+
|
|
7
|
+
A ripple is a wave that spreads from where a button is pressed, in the button's text color, and fades once it's let go. Ripples are off until you turn them on: `provideRipple()` gives one to Mona UI's buttons and the other components people press, from chips and menus to calendars, and the `monaRipple` directive adds one to elements of your own. Check boxes, radio buttons and switches draw a halo around the control instead.
|
|
8
|
+
|
|
9
|
+
## Try It
|
|
10
|
+
|
|
11
|
+
Press a button and hold it, then let go. The rest of this site has no ripples, so this example turns them on for itself.
|
|
12
|
+
|
|
13
|
+
`buttons-example.component.ts`
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { Component } from "@angular/core";
|
|
17
|
+
import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
18
|
+
import { ButtonGroupComponent } from "@nanahoshi/mona-ui/button-group";
|
|
19
|
+
import { RIPPLE_OPTIONS } from "@nanahoshi/mona-ui/ripple";
|
|
20
|
+
|
|
21
|
+
@Component({
|
|
22
|
+
selector: "app-ripple-buttons-example",
|
|
23
|
+
imports: [ButtonDirective, ButtonGroupComponent],
|
|
24
|
+
// Turns ripples on for this example only. An application turns them on everywhere with provideRipple().
|
|
25
|
+
providers: [{ provide: RIPPLE_OPTIONS, useValue: { enabled: true } }],
|
|
26
|
+
templateUrl: "./buttons-example.component.html"
|
|
27
|
+
})
|
|
28
|
+
export class RippleButtonsExampleComponent {}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`buttons-example.component.html`
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<div class="flex flex-col items-start gap-4">
|
|
35
|
+
<div class="flex flex-wrap items-center gap-3">
|
|
36
|
+
<button monaButton type="button">Default</button>
|
|
37
|
+
<button monaButton look="primary" type="button">Primary</button>
|
|
38
|
+
<button monaButton look="secondary" type="button">Secondary</button>
|
|
39
|
+
<button monaButton look="ghost" type="button">Ghost</button>
|
|
40
|
+
<button monaButton look="error" rounded="full" type="button">Delete</button>
|
|
41
|
+
</div>
|
|
42
|
+
<mona-button-group aria-label="Clipboard">
|
|
43
|
+
<button monaButton type="button" [toggleable]="false">Cut</button>
|
|
44
|
+
<button monaButton type="button" [toggleable]="false">Copy</button>
|
|
45
|
+
<button monaButton type="button" [toggleable]="false">Paste</button>
|
|
46
|
+
</mona-button-group>
|
|
47
|
+
<div class="flex flex-wrap items-center gap-3">
|
|
48
|
+
<button monaButton look="link" type="button">Link, without a ripple</button>
|
|
49
|
+
<button monaButton monaRippleDisabled type="button">Turned off</button>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Chips that toggle, tabs and list items ripple too:
|
|
55
|
+
|
|
56
|
+
`components-example.component.ts`
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { Component, signal } from "@angular/core";
|
|
60
|
+
import { ChipComponent } from "@nanahoshi/mona-ui/chip";
|
|
61
|
+
import { ListBoxComponent } from "@nanahoshi/mona-ui/list-box";
|
|
62
|
+
import { RIPPLE_OPTIONS } from "@nanahoshi/mona-ui/ripple";
|
|
63
|
+
import { TabComponent, TabContentTemplateDirective, TabsComponent } from "@nanahoshi/mona-ui/tabs";
|
|
64
|
+
|
|
65
|
+
@Component({
|
|
66
|
+
selector: "app-ripple-components-example",
|
|
67
|
+
imports: [ChipComponent, ListBoxComponent, TabComponent, TabContentTemplateDirective, TabsComponent],
|
|
68
|
+
// Turns ripples on for this example only. An application turns them on everywhere with provideRipple().
|
|
69
|
+
providers: [{ provide: RIPPLE_OPTIONS, useValue: { enabled: true } }],
|
|
70
|
+
templateUrl: "./components-example.component.html"
|
|
71
|
+
})
|
|
72
|
+
export class RippleComponentsExampleComponent {
|
|
73
|
+
protected readonly fruits = [
|
|
74
|
+
{ id: 1, name: "Apple" },
|
|
75
|
+
{ id: 2, name: "Banana" },
|
|
76
|
+
{ id: 3, name: "Cherry" },
|
|
77
|
+
{ id: 4, name: "Grape" }
|
|
78
|
+
];
|
|
79
|
+
protected readonly open = signal(true);
|
|
80
|
+
protected readonly selectedIds = signal<number[]>([2]);
|
|
81
|
+
protected readonly urgent = signal(false);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`components-example.component.html`
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<div class="flex flex-col gap-5">
|
|
89
|
+
<div class="flex flex-wrap gap-2" role="group" aria-label="Filter issues">
|
|
90
|
+
<mona-chip label="Open" [toggleable]="true" [(selected)]="open"></mona-chip>
|
|
91
|
+
<mona-chip label="Urgent" look="error" [toggleable]="true" [(selected)]="urgent"></mona-chip>
|
|
92
|
+
<mona-chip label="Removable" [toggleable]="true" [removable]="true"></mona-chip>
|
|
93
|
+
</div>
|
|
94
|
+
<mona-tabs aria-label="Account">
|
|
95
|
+
<mona-tab title="Account">
|
|
96
|
+
<ng-template monaTabContentTemplate>
|
|
97
|
+
<p class="p-4 text-sm">Name, email and language.</p>
|
|
98
|
+
</ng-template>
|
|
99
|
+
</mona-tab>
|
|
100
|
+
<mona-tab title="Security">
|
|
101
|
+
<ng-template monaTabContentTemplate>
|
|
102
|
+
<p class="p-4 text-sm">Password and two-factor sign-in.</p>
|
|
103
|
+
</ng-template>
|
|
104
|
+
</mona-tab>
|
|
105
|
+
<mona-tab title="Billing">
|
|
106
|
+
<ng-template monaTabContentTemplate>
|
|
107
|
+
<p class="p-4 text-sm">Plan and invoices.</p>
|
|
108
|
+
</ng-template>
|
|
109
|
+
</mona-tab>
|
|
110
|
+
</mona-tabs>
|
|
111
|
+
<mona-list-box
|
|
112
|
+
class="max-w-xs"
|
|
113
|
+
aria-label="Fruits"
|
|
114
|
+
height="160px"
|
|
115
|
+
selectBy="id"
|
|
116
|
+
selectionMode="multiple"
|
|
117
|
+
textField="name"
|
|
118
|
+
[items]="fruits"
|
|
119
|
+
[toolbar]="false"
|
|
120
|
+
[(selectedKeys)]="selectedIds" />
|
|
121
|
+
</div>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Check boxes, radio buttons and switches are too small for a wave inside them, so they draw a halo around the box, the circle or the handle. The switch's halo slides across with its handle:
|
|
125
|
+
|
|
126
|
+
`controls-example.component.ts`
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
import { Component, signal } from "@angular/core";
|
|
130
|
+
import { CheckBoxComponent } from "@nanahoshi/mona-ui/check-box";
|
|
131
|
+
import { LabelComponent } from "@nanahoshi/mona-ui/label";
|
|
132
|
+
import { RadioButtonComponent, RadioGroupComponent } from "@nanahoshi/mona-ui/radio-button";
|
|
133
|
+
import { RIPPLE_OPTIONS } from "@nanahoshi/mona-ui/ripple";
|
|
134
|
+
import { type SegmentedOption, SegmentedComponent } from "@nanahoshi/mona-ui/segmented";
|
|
135
|
+
import { SwitchComponent } from "@nanahoshi/mona-ui/switch";
|
|
136
|
+
|
|
137
|
+
@Component({
|
|
138
|
+
selector: "app-ripple-controls-example",
|
|
139
|
+
imports: [
|
|
140
|
+
CheckBoxComponent,
|
|
141
|
+
LabelComponent,
|
|
142
|
+
RadioButtonComponent,
|
|
143
|
+
RadioGroupComponent,
|
|
144
|
+
SegmentedComponent,
|
|
145
|
+
SwitchComponent
|
|
146
|
+
],
|
|
147
|
+
// Turns ripples on for this example only. An application turns them on everywhere with provideRipple().
|
|
148
|
+
providers: [{ provide: RIPPLE_OPTIONS, useValue: { enabled: true } }],
|
|
149
|
+
templateUrl: "./controls-example.component.html"
|
|
150
|
+
})
|
|
151
|
+
export class RippleControlsExampleComponent {
|
|
152
|
+
protected readonly digest = signal("daily");
|
|
153
|
+
protected readonly mentions = signal(false);
|
|
154
|
+
protected readonly paused = signal(false);
|
|
155
|
+
protected readonly replies = signal(true);
|
|
156
|
+
protected readonly theme = signal("system");
|
|
157
|
+
protected readonly themes: SegmentedOption<string>[] = [
|
|
158
|
+
{ label: "Light", value: "light" },
|
|
159
|
+
{ label: "Dark", value: "dark" },
|
|
160
|
+
{ label: "System", value: "system" }
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`controls-example.component.html`
|
|
166
|
+
|
|
167
|
+
```html
|
|
168
|
+
<div class="flex flex-col items-start gap-5">
|
|
169
|
+
<div class="flex flex-col gap-2">
|
|
170
|
+
<mona-check-box label="Email me about replies" [(checked)]="replies"></mona-check-box>
|
|
171
|
+
<mona-check-box label="Email me about mentions" [(checked)]="mentions"></mona-check-box>
|
|
172
|
+
</div>
|
|
173
|
+
<div class="flex flex-col items-start gap-2">
|
|
174
|
+
<mona-label text="Digest" [for]="digestGroup" />
|
|
175
|
+
<mona-radio-group #digestGroup [(value)]="digest">
|
|
176
|
+
<mona-radio-button label="Daily" radioValue="daily" />
|
|
177
|
+
<mona-radio-button label="Weekly" radioValue="weekly" />
|
|
178
|
+
</mona-radio-group>
|
|
179
|
+
</div>
|
|
180
|
+
<mona-label text="Pause notifications">
|
|
181
|
+
<mona-switch [(checked)]="paused" />
|
|
182
|
+
</mona-label>
|
|
183
|
+
<mona-segmented aria-label="Theme" [options]="themes" [(value)]="theme" />
|
|
184
|
+
</div>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Turn Ripples On
|
|
188
|
+
|
|
189
|
+
Add `provideRipple()` to your application's providers:
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
import { ApplicationConfig } from "@angular/core";
|
|
193
|
+
import { provideRipple } from "@nanahoshi/mona-ui/ripple";
|
|
194
|
+
|
|
195
|
+
export const appConfig: ApplicationConfig = {
|
|
196
|
+
providers: [
|
|
197
|
+
// ...your existing providers
|
|
198
|
+
provideRipple()
|
|
199
|
+
]
|
|
200
|
+
};
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
These then draw one when pressed:
|
|
204
|
+
|
|
205
|
+
| Component | Ripples |
|
|
206
|
+
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
207
|
+
| Buttons | Every look but `link` and `clear`, which have no surface to draw it on. That includes the buttons of button groups, dropdown buttons and split buttons. |
|
|
208
|
+
| Chips | A chip that toggles or is a link. A chip that only shows a value does nothing when pressed, so it doesn't ripple. |
|
|
209
|
+
| Tabs | Every tab but a disabled one. |
|
|
210
|
+
| List items | The items of List Box, List View, and the popups of Dropdown List, Combo Box, Auto Complete and Multi Select, when they can be selected or navigated. |
|
|
211
|
+
| Menus | The items of popup menus, context menus and menubars, and the menus of a menubar. |
|
|
212
|
+
| Tree View | Every node but a disabled one. |
|
|
213
|
+
| Calendar | The days, months and years of Calendar and of the date pickers' calendars, except the dates that can't be picked. |
|
|
214
|
+
| Stepper | The indicator of every step that can be reached. A step drawn by `monaStepperStepTemplate` looks as the template draws it, so it doesn't ripple. |
|
|
215
|
+
| Segmented | Every option but a disabled one. |
|
|
216
|
+
| Check boxes, radio buttons and switches | A halo around the box, the circle or the handle, unless the control is disabled or read-only. The `monaCheckbox` and `monaRadioButton` directives style a native input, which can't hold a ripple, so they have none. |
|
|
217
|
+
|
|
218
|
+
A press on a control inside one of these, such as a chip's remove button, a tab's close button, or a button in a list item's template, belongs to that control, so the item around it doesn't ripple. `provideRipple({ enabled: false })` keeps ripples off, for example behind a setting.
|
|
219
|
+
|
|
220
|
+
### Part of an Application
|
|
221
|
+
|
|
222
|
+
Provide `RIPPLE_OPTIONS` on a component to turn ripples on or off for everything inside it:
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
import { Component } from "@angular/core";
|
|
226
|
+
import { RIPPLE_OPTIONS } from "@nanahoshi/mona-ui/ripple";
|
|
227
|
+
|
|
228
|
+
@Component({
|
|
229
|
+
selector: "app-toolbar",
|
|
230
|
+
providers: [{ provide: RIPPLE_OPTIONS, useValue: { enabled: true } }],
|
|
231
|
+
templateUrl: "./toolbar.component.html"
|
|
232
|
+
})
|
|
233
|
+
export class ToolbarComponent {}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### One Component
|
|
237
|
+
|
|
238
|
+
`monaRippleDisabled` turns the ripple off for one button, chip, check box, radio button or switch:
|
|
239
|
+
|
|
240
|
+
```html
|
|
241
|
+
<button monaButton monaRippleDisabled>Save</button>
|
|
242
|
+
<mona-chip label="Archived" toggleable monaRippleDisabled></mona-chip>
|
|
243
|
+
<mona-switch aria-label="Sync" monaRippleDisabled></mona-switch>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Your Own Elements
|
|
247
|
+
|
|
248
|
+
Import `RippleDirective` and add `monaRipple` to anything else people press, such as a tile:
|
|
249
|
+
|
|
250
|
+
`custom-element-example.component.ts`
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
import { Component, signal } from "@angular/core";
|
|
254
|
+
import { RIPPLE_OPTIONS, RippleDirective } from "@nanahoshi/mona-ui/ripple";
|
|
255
|
+
|
|
256
|
+
interface Destination {
|
|
257
|
+
readonly description: string;
|
|
258
|
+
readonly name: string;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@Component({
|
|
262
|
+
selector: "app-ripple-custom-element-example",
|
|
263
|
+
imports: [RippleDirective],
|
|
264
|
+
// Turns ripples on for this example only. An application turns them on everywhere with provideRipple().
|
|
265
|
+
providers: [{ provide: RIPPLE_OPTIONS, useValue: { enabled: true } }],
|
|
266
|
+
templateUrl: "./custom-element-example.component.html"
|
|
267
|
+
})
|
|
268
|
+
export class RippleCustomElementExampleComponent {
|
|
269
|
+
protected readonly destinations: readonly Destination[] = [
|
|
270
|
+
{ name: "Projects", description: "Everything your team is working on." },
|
|
271
|
+
{ name: "Reports", description: "Weekly numbers and trends." },
|
|
272
|
+
{ name: "Settings", description: "Members, billing and integrations." }
|
|
273
|
+
];
|
|
274
|
+
protected readonly opened = signal("none");
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
`custom-element-example.component.html`
|
|
279
|
+
|
|
280
|
+
```html
|
|
281
|
+
<div class="flex flex-col gap-3">
|
|
282
|
+
<div class="grid gap-3 sm:grid-cols-3">
|
|
283
|
+
@for (destination of destinations; track destination.name) {
|
|
284
|
+
<button
|
|
285
|
+
monaRipple
|
|
286
|
+
type="button"
|
|
287
|
+
class="relative flex cursor-pointer flex-col items-start gap-1 rounded-lg border border-border bg-surface p-4 text-start text-foreground transition-colors hover:bg-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-indicator forced-colors:border-[ButtonBorder]"
|
|
288
|
+
(click)="opened.set(destination.name)">
|
|
289
|
+
<span class="text-sm font-medium">{{ destination.name }}</span>
|
|
290
|
+
<span class="text-sm text-muted-foreground">{{ destination.description }}</span>
|
|
291
|
+
</button>
|
|
292
|
+
}
|
|
293
|
+
</div>
|
|
294
|
+
<span aria-live="polite" class="text-sm">Opened: {{ opened() }}</span>
|
|
295
|
+
</div>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
The wave covers the element's padding box, in its corner radius, over its background and under its content. For that, the first press gives the element `isolation: isolate`, and makes it `relative` if its position is `static`. If the element's position can change later, set one with a class yourself, as the tiles above do with `relative`.
|
|
299
|
+
|
|
300
|
+
Mona UI's buttons, chips, check boxes, radio buttons and switches already have the directive. Don't add `monaRipple` to one: Angular doesn't allow a directive on an element twice. As on Mona UI's own components, a press on a button, link or form field inside the element doesn't make it ripple, unless the element is that field's `<label>`.
|
|
301
|
+
|
|
302
|
+
## Customize It
|
|
303
|
+
|
|
304
|
+
Three tokens set how the ripple looks and moves. It has its own timing rather than the theme's motion tokens, which keep menus and popups brisk:
|
|
305
|
+
|
|
306
|
+
| Token | Default | Sets |
|
|
307
|
+
| ----------------------------- | ------- | ---------------------------------------------------------- |
|
|
308
|
+
| `--mona-ripple-opacity` | `12%` | How much of the element's text color the wave shows. |
|
|
309
|
+
| `--mona-ripple-duration` | `450ms` | How long the wave takes to spread. |
|
|
310
|
+
| `--mona-ripple-fade-duration` | `300ms` | How long it takes to fade, once it has finished spreading. |
|
|
311
|
+
|
|
312
|
+
The wave starts moving at once and slows as it spreads, so a press shows straight away even at a longer duration. A halo takes the same tokens, reaches 10px past its control's edges, and is drawn in the theme's text color, since a checked box's own color is the one on its fill. Set the tokens in your styles, for the whole page or for one element:
|
|
313
|
+
|
|
314
|
+
```css
|
|
315
|
+
:root {
|
|
316
|
+
--mona-ripple-opacity: 16%;
|
|
317
|
+
--mona-ripple-duration: 600ms;
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Accessibility
|
|
322
|
+
|
|
323
|
+
The ripple is decoration, so nothing changes for assistive technology:
|
|
324
|
+
|
|
325
|
+
- Its layer is hidden from screen readers and takes no pointer events.
|
|
326
|
+
- There's no ripple with the system's reduced motion setting. The pressed background still shows the press.
|
|
327
|
+
- There's no ripple in forced colors, where it would paint as a solid block.
|
|
328
|
+
- Keyboard presses draw none. The focus indicator already shows where they act.
|
|
329
|
+
- Disabled and read-only components draw none, and neither do `aria-disabled` elements and loading buttons.
|
|
330
|
+
|
|
331
|
+
## API
|
|
332
|
+
|
|
333
|
+
Everything below is imported from `@nanahoshi/mona-ui/ripple`.
|
|
334
|
+
|
|
335
|
+
### `RippleDirective`
|
|
336
|
+
|
|
337
|
+
**Selector:** `[monaRipple]`
|
|
338
|
+
|
|
339
|
+
Draws a ripple when the element is pressed. Mona UI's buttons and the other components people press apply it themselves.
|
|
340
|
+
|
|
341
|
+
| Input | Type | Default | Description |
|
|
342
|
+
| -------------------- | --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
343
|
+
| `monaRippleDisabled` | `boolean` | `false` | Turns the ripple off for this element while ripples are on. Buttons, chips, check boxes, radio buttons and switches take it as well. |
|
|
344
|
+
|
|
345
|
+
### Providers
|
|
346
|
+
|
|
347
|
+
| Provider | Description |
|
|
348
|
+
| ------------------------ | -------------------------------------------------------------------------------------------- |
|
|
349
|
+
| `provideRipple(options)` | Turns ripples on for the application. `options` is optional; `{ enabled: false }` keeps them off. |
|
|
350
|
+
|
|
351
|
+
### Tokens
|
|
352
|
+
|
|
353
|
+
| Token | Type | Default |
|
|
354
|
+
| ---------------- | --------------- | -------------------- |
|
|
355
|
+
| `RIPPLE_OPTIONS` | `RippleOptions` | `{ enabled: false }` |
|
|
356
|
+
|
|
357
|
+
### Exported Types and Values
|
|
358
|
+
|
|
359
|
+
- **Types:** `RippleOptions`, with `enabled`.
|
|
360
|
+
- **Values:** `DEFAULT_RIPPLE_OPTIONS`, what `RIPPLE_OPTIONS` holds when nothing is provided.
|
package/docs/sidebar-menus.md
CHANGED
|
@@ -360,6 +360,14 @@ A submenu cannot render in a rail one icon wide, and there's no flyout. While on
|
|
|
360
360
|
|
|
361
361
|
`mona-sidebar-menu-skeleton` goes in an item in place of the row's control, laid out exactly like a real row, so the two animate as one. Vary `labelWidth` across a list so the placeholder doesn't look like a rigid grid, and set `[showIcon]="false"` for rows that have no icon.
|
|
362
362
|
|
|
363
|
+
If you resize the rows, resize the skeleton to match. Its `class` is merged over its own sizing, so the same classes that make a `monaSidebarMenuButton` denser fit the placeholder as well, and nothing shifts when the real rows replace it:
|
|
364
|
+
|
|
365
|
+
```html
|
|
366
|
+
<li monaSidebarMenuItem>
|
|
367
|
+
<mona-sidebar-menu-skeleton class="h-7 px-2" />
|
|
368
|
+
</li>
|
|
369
|
+
```
|
|
370
|
+
|
|
363
371
|
The skeleton is hidden from assistive technology. Mark what's loading on its container instead, with `aria-busy="true"`, and remove it when the rows arrive.
|
|
364
372
|
|
|
365
373
|
## Accessibility
|