@matekit/react 0.0.0-stage → 0.1.1
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/CHANGELOG.md +102 -0
- package/LICENSE +202 -0
- package/NOTICE +56 -0
- package/README.md +115 -2
- package/dist/atoms/Divider/Divider.d.ts +49 -0
- package/dist/atoms/Divider/Divider.js +29 -0
- package/dist/atoms/FocusRing/FocusRing.d.ts +16 -0
- package/dist/atoms/FocusRing/FocusRing.js +16 -0
- package/dist/atoms/Group/Group.d.ts +38 -0
- package/dist/atoms/Group/Group.js +34 -0
- package/dist/atoms/Icon/Icon.d.ts +23 -0
- package/dist/atoms/Icon/Icon.js +19 -0
- package/dist/atoms/Interactive/Interactive.d.ts +98 -0
- package/dist/atoms/Interactive/Interactive.js +87 -0
- package/dist/atoms/Ripple/Ripple.d.ts +14 -0
- package/dist/atoms/Ripple/Ripple.js +63 -0
- package/dist/atoms/Shape/Shape.d.ts +24 -0
- package/dist/atoms/Shape/Shape.js +19 -0
- package/dist/atoms/Shape/shapes.d.ts +8 -0
- package/dist/atoms/Shape/shapes.js +40 -0
- package/dist/atoms/Stack/Stack.d.ts +58 -0
- package/dist/atoms/Stack/Stack.js +33 -0
- package/dist/atoms/StateLayer/StateLayer.d.ts +17 -0
- package/dist/atoms/StateLayer/StateLayer.js +17 -0
- package/dist/atoms/index.d.ts +10 -0
- package/dist/atoms/index.js +10 -0
- package/dist/fonts/roboto-flex/OFL.txt +93 -0
- package/dist/fonts/roboto-flex/roboto-flex-cyrillic-ext.woff2 +0 -0
- package/dist/fonts/roboto-flex/roboto-flex-cyrillic.woff2 +0 -0
- package/dist/fonts/roboto-flex/roboto-flex-greek.woff2 +0 -0
- package/dist/fonts/roboto-flex/roboto-flex-latin-ext.woff2 +0 -0
- package/dist/fonts/roboto-flex/roboto-flex-latin.woff2 +0 -0
- package/dist/fonts/roboto-flex/roboto-flex-vietnamese.woff2 +0 -0
- package/dist/icons/icons.d.ts +89 -0
- package/dist/icons/icons.js +186 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +3 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +12 -0
- package/dist/internal/accessible-name.d.ts +17 -0
- package/dist/internal/accessible-name.js +33 -0
- package/dist/internal/anchor-position.d.ts +99 -0
- package/dist/internal/anchor-position.js +159 -0
- package/dist/internal/anchored-drag.d.ts +25 -0
- package/dist/internal/anchored-drag.js +106 -0
- package/dist/internal/dev.d.ts +2 -0
- package/dist/internal/dev.js +18 -0
- package/dist/internal/diagnostics.d.ts +46 -0
- package/dist/internal/diagnostics.js +125 -0
- package/dist/internal/group-label.d.ts +22 -0
- package/dist/internal/group-label.js +50 -0
- package/dist/internal/interactive.d.ts +28 -0
- package/dist/internal/interactive.js +18 -0
- package/dist/internal/layout-element.d.ts +21 -0
- package/dist/internal/layout-element.js +33 -0
- package/dist/internal/merge-refs.d.ts +13 -0
- package/dist/internal/merge-refs.js +35 -0
- package/dist/internal/modal-dialog.d.ts +63 -0
- package/dist/internal/modal-dialog.js +267 -0
- package/dist/internal/navigation-count.d.ts +38 -0
- package/dist/internal/navigation-count.js +60 -0
- package/dist/internal/navigation-item.d.ts +14 -0
- package/dist/internal/navigation-item.js +17 -0
- package/dist/internal/nearest-scroller.d.ts +4 -0
- package/dist/internal/nearest-scroller.js +17 -0
- package/dist/internal/open-state.d.ts +15 -0
- package/dist/internal/open-state.js +42 -0
- package/dist/internal/roving-focus.d.ts +41 -0
- package/dist/internal/roving-focus.js +126 -0
- package/dist/internal/settle-animations.d.ts +33 -0
- package/dist/internal/settle-animations.js +48 -0
- package/dist/internal/time-period.d.ts +10 -0
- package/dist/internal/time-period.js +26 -0
- package/dist/internal/time.d.ts +23 -0
- package/dist/internal/time.js +69 -0
- package/dist/internal/typeahead.d.ts +17 -0
- package/dist/internal/typeahead.js +35 -0
- package/dist/molecules/Badge/Badge.d.ts +25 -0
- package/dist/molecules/Badge/Badge.js +16 -0
- package/dist/molecules/Button/Button.d.ts +48 -0
- package/dist/molecules/Button/Button.js +34 -0
- package/dist/molecules/Card/Card.d.ts +159 -0
- package/dist/molecules/Card/Card.js +119 -0
- package/dist/molecules/Checkbox/Checkbox.d.ts +26 -0
- package/dist/molecules/Checkbox/Checkbox.js +40 -0
- package/dist/molecules/Chip/AssistChip.d.ts +23 -0
- package/dist/molecules/Chip/AssistChip.js +22 -0
- package/dist/molecules/Chip/ChipGroup.d.ts +85 -0
- package/dist/molecules/Chip/ChipGroup.js +92 -0
- package/dist/molecules/Chip/FilterChip.d.ts +33 -0
- package/dist/molecules/Chip/FilterChip.js +30 -0
- package/dist/molecules/Chip/InputChip.d.ts +60 -0
- package/dist/molecules/Chip/InputChip.js +107 -0
- package/dist/molecules/Chip/SuggestionChip.d.ts +24 -0
- package/dist/molecules/Chip/SuggestionChip.js +17 -0
- package/dist/molecules/Chip/chip-content.d.ts +39 -0
- package/dist/molecules/Chip/chip-content.js +95 -0
- package/dist/molecules/Chip/chip-element.d.ts +14 -0
- package/dist/molecules/Chip/chip-element.js +14 -0
- package/dist/molecules/Chip/strings.d.ts +8 -0
- package/dist/molecules/Chip/strings.js +5 -0
- package/dist/molecules/Fab/Fab.d.ts +78 -0
- package/dist/molecules/Fab/Fab.js +52 -0
- package/dist/molecules/IconButton/IconButton.d.ts +59 -0
- package/dist/molecules/IconButton/IconButton.js +36 -0
- package/dist/molecules/LoadingIndicator/LoadingIndicator.d.ts +38 -0
- package/dist/molecules/LoadingIndicator/LoadingIndicator.js +25 -0
- package/dist/molecules/LoadingIndicator/determinate.d.ts +3 -0
- package/dist/molecules/LoadingIndicator/determinate.js +47 -0
- package/dist/molecules/LoadingIndicator/loading-indicator-data.d.ts +21 -0
- package/dist/molecules/LoadingIndicator/loading-indicator-data.js +72 -0
- package/dist/molecules/ProgressIndicator/CircularProgressIndicator.d.ts +35 -0
- package/dist/molecules/ProgressIndicator/CircularProgressIndicator.js +30 -0
- package/dist/molecules/ProgressIndicator/LinearProgressIndicator.d.ts +43 -0
- package/dist/molecules/ProgressIndicator/LinearProgressIndicator.js +28 -0
- package/dist/molecules/ProgressIndicator/circular-wavy-data.d.ts +5 -0
- package/dist/molecules/ProgressIndicator/circular-wavy-data.js +19 -0
- package/dist/molecules/ProgressIndicator/progress.d.ts +24 -0
- package/dist/molecules/ProgressIndicator/progress.js +60 -0
- package/dist/molecules/RadioButton/RadioButton.d.ts +27 -0
- package/dist/molecules/RadioButton/RadioButton.js +70 -0
- package/dist/molecules/RadioButton/RadioGroup.d.ts +73 -0
- package/dist/molecules/RadioButton/RadioGroup.js +82 -0
- package/dist/molecules/ScrollField/ScrollField.d.ts +61 -0
- package/dist/molecules/ScrollField/ScrollField.js +352 -0
- package/dist/molecules/Slider/RangeSlider.d.ts +60 -0
- package/dist/molecules/Slider/RangeSlider.js +169 -0
- package/dist/molecules/Slider/Slider.d.ts +54 -0
- package/dist/molecules/Slider/Slider.js +71 -0
- package/dist/molecules/Slider/slider-shared.d.ts +26 -0
- package/dist/molecules/Slider/slider-shared.js +98 -0
- package/dist/molecules/Switch/Switch.d.ts +22 -0
- package/dist/molecules/Switch/Switch.js +20 -0
- package/dist/molecules/TextField/TextField.d.ts +83 -0
- package/dist/molecules/TextField/TextField.js +146 -0
- package/dist/molecules/TextField/TextFieldSlots.d.ts +22 -0
- package/dist/molecules/TextField/TextFieldSlots.js +24 -0
- package/dist/molecules/TimeInput/TimeInput.d.ts +108 -0
- package/dist/molecules/TimeInput/TimeInput.js +347 -0
- package/dist/molecules/TimeInput/strings.d.ts +13 -0
- package/dist/molecules/TimeInput/strings.js +10 -0
- package/dist/molecules/TimeScroll/TimeScroll.d.ts +106 -0
- package/dist/molecules/TimeScroll/TimeScroll.js +213 -0
- package/dist/molecules/TimeScroll/strings.d.ts +13 -0
- package/dist/molecules/TimeScroll/strings.js +12 -0
- package/dist/molecules/index.d.ts +27 -0
- package/dist/molecules/index.js +25 -0
- package/dist/organisms/BottomSheet/BottomSheet.d.ts +128 -0
- package/dist/organisms/BottomSheet/BottomSheet.js +432 -0
- package/dist/organisms/BottomSheet/BottomSheetSlots.d.ts +17 -0
- package/dist/organisms/BottomSheet/BottomSheetSlots.js +16 -0
- package/dist/organisms/BottomSheet/StandardBottomSheet.d.ts +37 -0
- package/dist/organisms/BottomSheet/StandardBottomSheet.js +206 -0
- package/dist/organisms/BottomSheet/bottom-sheet-context.d.ts +31 -0
- package/dist/organisms/BottomSheet/bottom-sheet-context.js +12 -0
- package/dist/organisms/BottomSheet/sheet-drag.d.ts +1 -0
- package/dist/organisms/BottomSheet/sheet-drag.js +4 -0
- package/dist/organisms/BottomSheet/strings.d.ts +9 -0
- package/dist/organisms/BottomSheet/strings.js +8 -0
- package/dist/organisms/ButtonGroup/ButtonGroup.d.ts +97 -0
- package/dist/organisms/ButtonGroup/ButtonGroup.js +242 -0
- package/dist/organisms/ButtonGroup/ButtonGroupItem.d.ts +36 -0
- package/dist/organisms/ButtonGroup/ButtonGroupItem.js +47 -0
- package/dist/organisms/Dialog/Dialog.d.ts +186 -0
- package/dist/organisms/Dialog/Dialog.js +193 -0
- package/dist/organisms/Dialog/DialogSlots.d.ts +60 -0
- package/dist/organisms/Dialog/DialogSlots.js +54 -0
- package/dist/organisms/Dialog/strings.d.ts +5 -0
- package/dist/organisms/Dialog/strings.js +5 -0
- package/dist/organisms/FabMenu/FabMenu.d.ts +104 -0
- package/dist/organisms/FabMenu/FabMenu.js +142 -0
- package/dist/organisms/FabMenu/strings.d.ts +9 -0
- package/dist/organisms/FabMenu/strings.js +5 -0
- package/dist/organisms/List/List.d.ts +190 -0
- package/dist/organisms/List/List.js +148 -0
- package/dist/organisms/Menu/Menu.d.ts +313 -0
- package/dist/organisms/Menu/Menu.js +865 -0
- package/dist/organisms/Menu/MenuSlots.d.ts +35 -0
- package/dist/organisms/Menu/MenuSlots.js +36 -0
- package/dist/organisms/NavigationBar/NavigationBar.d.ts +96 -0
- package/dist/organisms/NavigationBar/NavigationBar.js +77 -0
- package/dist/organisms/NavigationRail/ModalNavigationRail.d.ts +105 -0
- package/dist/organisms/NavigationRail/ModalNavigationRail.js +272 -0
- package/dist/organisms/NavigationRail/NavigationRail.d.ts +148 -0
- package/dist/organisms/NavigationRail/NavigationRail.js +114 -0
- package/dist/organisms/NavigationRail/NavigationRailSection.d.ts +54 -0
- package/dist/organisms/NavigationRail/NavigationRailSection.js +96 -0
- package/dist/organisms/NavigationRail/strings.d.ts +7 -0
- package/dist/organisms/NavigationRail/strings.js +7 -0
- package/dist/organisms/NavigationSuite/NavigationSuite.d.ts +109 -0
- package/dist/organisms/NavigationSuite/NavigationSuite.js +86 -0
- package/dist/organisms/PaneScaffold/PaneScaffold.d.ts +118 -0
- package/dist/organisms/PaneScaffold/PaneScaffold.js +132 -0
- package/dist/organisms/Search/Search.d.ts +213 -0
- package/dist/organisms/Search/Search.js +783 -0
- package/dist/organisms/Search/SearchSlots.d.ts +18 -0
- package/dist/organisms/Search/SearchSlots.js +19 -0
- package/dist/organisms/Search/strings.d.ts +21 -0
- package/dist/organisms/Search/strings.js +12 -0
- package/dist/organisms/Select/Select.d.ts +186 -0
- package/dist/organisms/Select/Select.js +597 -0
- package/dist/organisms/Select/SelectSlots.d.ts +12 -0
- package/dist/organisms/Select/SelectSlots.js +12 -0
- package/dist/organisms/SideSheet/SideSheet.d.ts +88 -0
- package/dist/organisms/SideSheet/SideSheet.js +109 -0
- package/dist/organisms/SideSheet/SideSheetSlots.d.ts +35 -0
- package/dist/organisms/SideSheet/SideSheetSlots.js +37 -0
- package/dist/organisms/SideSheet/strings.d.ts +7 -0
- package/dist/organisms/SideSheet/strings.js +6 -0
- package/dist/organisms/Snackbar/Snackbar.d.ts +46 -0
- package/dist/organisms/Snackbar/Snackbar.js +36 -0
- package/dist/organisms/Snackbar/SnackbarHost.d.ts +57 -0
- package/dist/organisms/Snackbar/SnackbarHost.js +221 -0
- package/dist/organisms/Snackbar/snackbar-queue.d.ts +81 -0
- package/dist/organisms/Snackbar/snackbar-queue.js +114 -0
- package/dist/organisms/Snackbar/strings.d.ts +8 -0
- package/dist/organisms/Snackbar/strings.js +5 -0
- package/dist/organisms/SplitButton/SplitButton.d.ts +73 -0
- package/dist/organisms/SplitButton/SplitButton.js +77 -0
- package/dist/organisms/SplitButton/strings.d.ts +9 -0
- package/dist/organisms/SplitButton/strings.js +5 -0
- package/dist/organisms/Tabs/TabLink.d.ts +27 -0
- package/dist/organisms/Tabs/TabLink.js +25 -0
- package/dist/organisms/Tabs/TabNav.d.ts +19 -0
- package/dist/organisms/Tabs/TabNav.js +55 -0
- package/dist/organisms/Tabs/Tabs.d.ts +147 -0
- package/dist/organisms/Tabs/Tabs.js +223 -0
- package/dist/organisms/Tabs/tab-content.d.ts +23 -0
- package/dist/organisms/Tabs/tab-content.js +105 -0
- package/dist/organisms/Tabs/tab-fit.d.ts +4 -0
- package/dist/organisms/Tabs/tab-fit.js +65 -0
- package/dist/organisms/Tabs/tab-motion.d.ts +2 -0
- package/dist/organisms/Tabs/tab-motion.js +68 -0
- package/dist/organisms/TimePickerDialog/TimePickerDialog.d.ts +26 -0
- package/dist/organisms/TimePickerDialog/TimePickerDialog.js +34 -0
- package/dist/organisms/Toolbar/Toolbar.d.ts +75 -0
- package/dist/organisms/Toolbar/Toolbar.js +84 -0
- package/dist/organisms/Toolbar/ToolbarLayout.d.ts +44 -0
- package/dist/organisms/Toolbar/ToolbarLayout.js +90 -0
- package/dist/organisms/Toolbar/ToolbarScroll.d.ts +8 -0
- package/dist/organisms/Toolbar/ToolbarScroll.js +222 -0
- package/dist/organisms/Tooltip/RichTooltip.d.ts +73 -0
- package/dist/organisms/Tooltip/RichTooltip.js +250 -0
- package/dist/organisms/Tooltip/Tooltip.d.ts +52 -0
- package/dist/organisms/Tooltip/Tooltip.js +99 -0
- package/dist/organisms/Tooltip/tooltip-behavior.d.ts +43 -0
- package/dist/organisms/Tooltip/tooltip-behavior.js +307 -0
- package/dist/organisms/TopAppBar/TopAppBar.d.ts +107 -0
- package/dist/organisms/TopAppBar/TopAppBar.js +78 -0
- package/dist/organisms/TopAppBar/TopAppBarScroll.d.ts +7 -0
- package/dist/organisms/TopAppBar/TopAppBarScroll.js +155 -0
- package/dist/organisms/index.d.ts +36 -0
- package/dist/organisms/index.js +36 -0
- package/dist/palettes/blue.css +275 -0
- package/dist/palettes/green.css +275 -0
- package/dist/palettes/index.css +823 -0
- package/dist/palettes/orange.css +275 -0
- package/dist/shapes.css +115 -0
- package/dist/strings/index.d.ts +35 -0
- package/dist/strings/index.js +39 -0
- package/dist/styles-no-fonts.css +12025 -0
- package/dist/styles.css +12123 -0
- package/dist/stylesheet.d.ts +2 -0
- package/dist/tokens/breakpoints.d.ts +33 -0
- package/dist/tokens/breakpoints.js +31 -0
- package/dist/tokens/space.d.ts +26 -0
- package/dist/tokens/space.js +26 -0
- package/package.json +110 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FocusRing } from '../../atoms/FocusRing/FocusRing.js';
|
|
3
|
+
import { Ripple } from '../../atoms/Ripple/Ripple.js';
|
|
4
|
+
import { StateLayer } from '../../atoms/StateLayer/StateLayer.js';
|
|
5
|
+
import { Interactive } from '../../atoms/Interactive/Interactive.js';
|
|
6
|
+
import { assertRenderElement, cx } from '../../internal/interactive.js';
|
|
7
|
+
/**
|
|
8
|
+
* Material 3 Expressive icon button.
|
|
9
|
+
*
|
|
10
|
+
* The icon is the child; the component sizes it with `--mk-icon-size` (20 to 40 px depending on
|
|
11
|
+
* the size). `label` is the name screen readers announce. With `href` or `render` it is a link
|
|
12
|
+
* that looks the same (an icon that opens another page).
|
|
13
|
+
*
|
|
14
|
+
* Customization with CSS variables:
|
|
15
|
+
* - `--mk-icon-button-color`: icon color of the unselected `standard` style (defaults to
|
|
16
|
+
* `on-surface-variant`). Inherited: set on a container, it affects the buttons inside.
|
|
17
|
+
* Selected and disabled keep their colors.
|
|
18
|
+
* - `--mk-icon-button-selected-container` and `--mk-icon-button-selected-color`: background
|
|
19
|
+
* (defaults to none) and icon color (`primary`) of the selected `standard` toggle. Also
|
|
20
|
+
* inherited; the Toolbar sets them for its buttons.
|
|
21
|
+
* - `--mk-icon-button-selected-round`: `1` keeps the selected toggle round (by default it turns
|
|
22
|
+
* square); the Toolbar uses it, as in the kit.
|
|
23
|
+
*
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <IconButton label="Search"><SearchIcon /></IconButton>
|
|
26
|
+
* <IconButton variant="filled" width="wide" label="Favorite" selected={fav} onClick={() => setFav(!fav)}>
|
|
27
|
+
* <StarIcon filled={fav} />
|
|
28
|
+
* </IconButton>
|
|
29
|
+
* <IconButton label="Settings" render={<Link href="/settings" />}><SettingsIcon /></IconButton>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function IconButton(props) {
|
|
33
|
+
const { label, variant = 'standard', size = 'sm', width = 'default', shape = 'round', selected, className, children, ...rest } = props;
|
|
34
|
+
assertRenderElement('IconButton', rest.render);
|
|
35
|
+
return (_jsxs(Interactive, { ...(selected === undefined ? {} : { 'aria-pressed': selected }), ...rest, "aria-label": label, "data-variant": variant, "data-size": size, "data-width": width, "data-shape": shape, className: cx('mk-icon-button', className), children: [_jsx(StateLayer, {}), _jsx(Ripple, {}), _jsx(FocusRing, {}), children] }));
|
|
36
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { AccessibleNameProps } from '../../internal/accessible-name.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The accessible name is required (ARIA requires it on a `progressbar` and the indicator has no
|
|
5
|
+
* visible text): `label` (becomes `aria-label`), `aria-labelledby` (the id of a visible label) or
|
|
6
|
+
* `aria-label`. TypeScript requires at least one (AccessibleNameProps).
|
|
7
|
+
*/
|
|
8
|
+
export type LoadingIndicatorProps = Omit<HTMLAttributes<HTMLSpanElement>, 'aria-label' | 'aria-labelledby' | 'role' | 'children'> & AccessibleNameProps & {
|
|
9
|
+
/**
|
|
10
|
+
* With a container: a `primary-container` circle with the shape in `on-primary-container`.
|
|
11
|
+
* Defaults to `false`.
|
|
12
|
+
*/
|
|
13
|
+
contained?: boolean | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Progress from 0 to 1 (clamped outside that range). Without `value`, the indicator is
|
|
16
|
+
* indeterminate: it spins and changes shape on its own. With `value`, it is determinate: it goes
|
|
17
|
+
* from the circle to the SoftBurst shape and turns half a revolution as it advances.
|
|
18
|
+
*/
|
|
19
|
+
value?: number | undefined;
|
|
20
|
+
/** Ref to the `<span>` with `role="progressbar"`. */
|
|
21
|
+
ref?: Ref<HTMLSpanElement> | undefined;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Material 3 Expressive loading indicator: a shape that spins and morphs through seven shapes
|
|
25
|
+
* (indeterminate) or advances with `value` (determinate). It measures 48 × 48; set another size
|
|
26
|
+
* with `width` and `height` in CSS and the shape scales.
|
|
27
|
+
*
|
|
28
|
+
* With reduced motion (`prefers-reduced-motion: reduce`), the indeterminate one stays still on
|
|
29
|
+
* the first shape, pulsing in opacity (the same activity signal as the indeterminate progress
|
|
30
|
+
* indicators); the determinate one stays still.
|
|
31
|
+
*
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <LoadingIndicator label="Loading messages" />
|
|
34
|
+
* <LoadingIndicator contained label="Refreshing" />
|
|
35
|
+
* <LoadingIndicator value={0.4} label="Uploading photo" />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function LoadingIndicator({ label, 'aria-label': ariaLabel, contained, value, className, ...props }: LoadingIndicatorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clampProgress, determinatePathData, determinateRotation } from './determinate.js';
|
|
3
|
+
import { CYCLE_MS, GLOBAL_ROTATION_MS, MORPH_MS, MORPH_ROTATION, SHAPE_KEY_SPLINES, SHAPE_KEY_TIMES, STEPS, TRANSITIONS, VIEW_BOX, VISIBILITY_KEY_TIMES, } from './loading-indicator-data.js';
|
|
4
|
+
const repeat = { repeatCount: 'indefinite' };
|
|
5
|
+
/**
|
|
6
|
+
* Material 3 Expressive loading indicator: a shape that spins and morphs through seven shapes
|
|
7
|
+
* (indeterminate) or advances with `value` (determinate). It measures 48 × 48; set another size
|
|
8
|
+
* with `width` and `height` in CSS and the shape scales.
|
|
9
|
+
*
|
|
10
|
+
* With reduced motion (`prefers-reduced-motion: reduce`), the indeterminate one stays still on
|
|
11
|
+
* the first shape, pulsing in opacity (the same activity signal as the indeterminate progress
|
|
12
|
+
* indicators); the determinate one stays still.
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <LoadingIndicator label="Loading messages" />
|
|
16
|
+
* <LoadingIndicator contained label="Refreshing" />
|
|
17
|
+
* <LoadingIndicator value={0.4} label="Uploading photo" />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export function LoadingIndicator({ label, 'aria-label': ariaLabel, contained, value, className, ...props }) {
|
|
21
|
+
const progress = value === undefined ? undefined : clampProgress(value);
|
|
22
|
+
return (_jsx("span", { ...props, role: "progressbar", "aria-label": label ?? ariaLabel, ...(progress === undefined
|
|
23
|
+
? {}
|
|
24
|
+
: { 'aria-valuemin': 0, 'aria-valuemax': 100, 'aria-valuenow': Math.round(progress * 100) }), className: className ? `mk-loading-indicator ${className}` : 'mk-loading-indicator', "data-contained": contained ? '' : undefined, children: _jsx("svg", { className: "mk-loading-indicator-svg", viewBox: VIEW_BOX, "aria-hidden": "true", focusable: "false", children: progress === undefined ? (_jsxs(_Fragment, { children: [_jsxs("g", { className: "mk-loading-indicator-motion", children: [_jsx("animateTransform", { attributeName: "transform", type: "rotate", values: "0;360", dur: `${GLOBAL_ROTATION_MS}ms`, ...repeat }), _jsxs("g", { children: [_jsx("animateTransform", { attributeName: "transform", type: "rotate", values: MORPH_ROTATION.values, keyTimes: MORPH_ROTATION.keyTimes, keySplines: MORPH_ROTATION.keySplines, calcMode: "spline", accumulate: "sum", dur: `${MORPH_MS}ms`, ...repeat }), TRANSITIONS.map((t) => (_jsxs("path", { className: "mk-loading-indicator-shape", children: [_jsx("animate", { attributeName: "d", values: t.values, keyTimes: SHAPE_KEY_TIMES, keySplines: SHAPE_KEY_SPLINES, calcMode: "spline", begin: t.begin, dur: `${CYCLE_MS}ms`, ...repeat }), _jsx("animate", { attributeName: "visibility", values: "visible;hidden;visible", keyTimes: VISIBILITY_KEY_TIMES, calcMode: "discrete", begin: t.begin, dur: `${CYCLE_MS}ms`, ...repeat })] }, t.begin)))] })] }), _jsx("path", { className: "mk-loading-indicator-still", d: STEPS[0] })] })) : (_jsx("path", { d: determinatePathData(progress), transform: `rotate(${determinateRotation(progress)})` })) }) }));
|
|
25
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Contorno del indicador determinado (sin JSX, para probarlo en Node contra el Morph de
|
|
2
|
+
// scripts/lib/shapes/). Como en Compose (LoadingIndicatorImpl con progress), la forma es el Morph
|
|
3
|
+
// Circle → SoftBurst en `value` y cada fotograma se centra por el rectángulo de sus puntos. El
|
|
4
|
+
// Morph es una interpolación lineal de dos contornos con la misma estructura, así que alcanza con
|
|
5
|
+
// guardar el de inicio y el de fin (loading-indicator-data.ts) e interpolar acá.
|
|
6
|
+
import { DETERMINATE } from './loading-indicator-data.js';
|
|
7
|
+
// `value` acotado a [0, 1]; NaN cuenta como 0, como en Compose.
|
|
8
|
+
export function clampProgress(value) {
|
|
9
|
+
return Number.isNaN(value) ? 0 : Math.min(1, Math.max(0, value));
|
|
10
|
+
}
|
|
11
|
+
// Atributo `d` (relativo, en las unidades del viewBox) del indicador determinado en `value`, ya
|
|
12
|
+
// acotado. Coordenadas enteras: 0,05 dp de error a 48 dp.
|
|
13
|
+
export function determinatePathData(value) {
|
|
14
|
+
const { start, end } = DETERMINATE;
|
|
15
|
+
const points = start.map((s, i) => s + (end[i] - s) * value);
|
|
16
|
+
let minX = Infinity;
|
|
17
|
+
let minY = Infinity;
|
|
18
|
+
let maxX = -Infinity;
|
|
19
|
+
let maxY = -Infinity;
|
|
20
|
+
for (let i = 0; i < points.length; i += 2) {
|
|
21
|
+
minX = Math.min(minX, points[i]);
|
|
22
|
+
maxX = Math.max(maxX, points[i]);
|
|
23
|
+
minY = Math.min(minY, points[i + 1]);
|
|
24
|
+
maxY = Math.max(maxY, points[i + 1]);
|
|
25
|
+
}
|
|
26
|
+
const dx = (minX + maxX) / 2;
|
|
27
|
+
const dy = (minY + maxY) / 2;
|
|
28
|
+
const r = points.map((v, i) => Math.round(v - (i % 2 === 0 ? dx : dy)) || 0);
|
|
29
|
+
// Diferencias entre coordenadas absolutas ya redondeadas: el error no se acumula.
|
|
30
|
+
const num = (v) => (v < 0 ? String(v) : ` ${v}`);
|
|
31
|
+
let x0 = r[0];
|
|
32
|
+
let y0 = r[1];
|
|
33
|
+
let d = `M${x0}${num(y0)}c`;
|
|
34
|
+
for (let i = 2; i < r.length; i += 6) {
|
|
35
|
+
for (let j = 0; j < 6; j++) {
|
|
36
|
+
const v = r[i + j] - (j % 2 === 0 ? x0 : y0);
|
|
37
|
+
d += i === 2 && j === 0 ? String(v) : num(v);
|
|
38
|
+
}
|
|
39
|
+
x0 = r[i + 4];
|
|
40
|
+
y0 = r[i + 5];
|
|
41
|
+
}
|
|
42
|
+
return d + 'z';
|
|
43
|
+
}
|
|
44
|
+
// Giro del indicador determinado en `value`: media vuelta en sentido antihorario hasta 1.
|
|
45
|
+
export function determinateRotation(value) {
|
|
46
|
+
return -value * 180;
|
|
47
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const VIEW_BOX = "-240 -240 480 480";
|
|
2
|
+
export declare const GLOBAL_ROTATION_MS = 4666;
|
|
3
|
+
export declare const MORPH_MS = 650;
|
|
4
|
+
export declare const CYCLE_MS = 4550;
|
|
5
|
+
export declare const MORPH_ROTATION: {
|
|
6
|
+
readonly values: '0;69.219;98.53;98.246;90;90';
|
|
7
|
+
readonly keyTimes: '0;0.2136;0.4272;0.456923;0.457077;1';
|
|
8
|
+
readonly keySplines: '0.296 0.02 0.52 0.51;0.302 0.697 0.586 1;0.4 0 0.8 0.6;0 0 1 1;0 0 1 1';
|
|
9
|
+
};
|
|
10
|
+
export declare const SHAPE_KEY_TIMES = "0;0.030514;0.061029;1";
|
|
11
|
+
export declare const SHAPE_KEY_SPLINES = "0.296 0.02 0.52 0.51;0.302 0.697 0.586 1;1 0 0 1";
|
|
12
|
+
export declare const VISIBILITY_KEY_TIMES = "0;0.065275;0.922418";
|
|
13
|
+
export declare const TRANSITIONS: ReadonlyArray<{
|
|
14
|
+
begin: string;
|
|
15
|
+
values: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const STEPS: readonly string[];
|
|
18
|
+
export declare const DETERMINATE: {
|
|
19
|
+
readonly start: readonly number[];
|
|
20
|
+
readonly end: readonly number[];
|
|
21
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Generado por scripts/build-shapes.ts. No editar a mano.
|
|
2
|
+
// Fuente: androidx/androidx@b842c5b3a5, compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/LoadingIndicator.kt
|
|
3
|
+
// Geometría de androidx.graphics.shapes (Morph) y MaterialShapes.kt: Apache-2.0, The Android Open
|
|
4
|
+
// Source Project. Cómo se calcula: scripts/lib/shapes/LoadingIndicator.ts (ADR-0011).
|
|
5
|
+
//
|
|
6
|
+
// Unidades: viewBox de 480 centrado en el origen (10 por dp del contenedor de 48).
|
|
7
|
+
// Error máximo de los fotogramas frente a Compose: 0,19 dp.
|
|
8
|
+
// viewBox del indicador.
|
|
9
|
+
export const VIEW_BOX = '-240 -240 480 480';
|
|
10
|
+
// Una vuelta entera, lineal (GlobalRotationDurationMillis).
|
|
11
|
+
export const GLOBAL_ROTATION_MS = 4666;
|
|
12
|
+
// Un cambio de forma (MorphIntervalMillis) y el ciclo de las 7 transiciones.
|
|
13
|
+
export const MORPH_MS = 650;
|
|
14
|
+
export const CYCLE_MS = 4550;
|
|
15
|
+
// El giro de cada cambio de forma, de 0 a 90° con el resorte (se suma en cada repetición).
|
|
16
|
+
export const MORPH_ROTATION = {
|
|
17
|
+
values: '0;69.219;98.53;98.246;90;90',
|
|
18
|
+
keyTimes: '0;0.2136;0.4272;0.456923;0.457077;1',
|
|
19
|
+
keySplines: '0.296 0.02 0.52 0.51;0.302 0.697 0.586 1;0.4 0 0.8 0.6;0 0 1 1;0 0 1 1',
|
|
20
|
+
};
|
|
21
|
+
// Tiempos de los contornos y de su visibilidad (los mismos para las 7 transiciones).
|
|
22
|
+
export const SHAPE_KEY_TIMES = '0;0.030514;0.061029;1';
|
|
23
|
+
export const SHAPE_KEY_SPLINES = '0.296 0.02 0.52 0.51;0.302 0.697 0.586 1;1 0 0 1';
|
|
24
|
+
export const VISIBILITY_KEY_TIMES = '0;0.065275;0.922418';
|
|
25
|
+
// Una transición por forma (SoftBurst → Cookie9Sided → Pentagon → Pill → Sunny → Cookie4Sided → Oval → SoftBurst): su
|
|
26
|
+
// desfase y los cuatro contornos, todos con la misma estructura de comandos.
|
|
27
|
+
export const TRANSITIONS = [
|
|
28
|
+
{
|
|
29
|
+
begin: '0s',
|
|
30
|
+
values: 'M67-113c2 8 10 14 18 13 3 0 6 0 9-1 7 0 14-1 21-1 12-1 22 12 17 23-3 7-6 13-8 20-1 3-2 5-3 8-4 8-1 16 6 21 3 1 5 3 8 4 6 4 12 8 18 11 10 7 10 23 0 29-6 4-12 8-18 12-3 1-5 3-8 4-7 4-10 13-6 21 1 3 2 5 3 8 3 6 5 13 8 19 5 12-4 25-17 24-7-1-14-1-21-2-3 0-6 0-9 0-8-1-16 5-18 13 0 3-1 5-2 8-1 7-3 14-5 21-3 12-17 17-27 9-6-5-11-10-16-14-3-2-5-4-7-6-6-5-16-5-22 0-2 2-4 4-6 6-6 4-11 9-17 14-9 8-24 3-27-9-2-7-4-14-5-21-1-3-2-5-2-8-2-8-10-14-18-13-3 0-6 0-9 1-7 0-14 1-21 1-12 1-22-12-17-23 4-9 8-19 11-28 4-8 1-16-6-21-9-5-17-10-26-15-4-3-7-8-8-13 0-6 2-13 8-16 9-6 17-11 26-16 7-4 10-13 6-21-1-3-2-5-3-8-3-6-5-13-8-19-5-12 4-25 17-24 7 1 14 1 21 2 3 0 6 0 9 0 8 1 16-5 18-13 0-3 1-5 2-8 1-7 3-14 5-21 3-12 17-17 27-9 6 5 11 10 16 14 3 2 5 4 7 6 6 5 16 5 22 0 2-2 4-4 6-6 6-4 11-9 17-14 9-8 24-3 27 9 2 7 4 14 5 21 1 3 2 5 2 8z;M60-128c5 5 12 10 20 11 2 1 5 1 7 1 8 1 14 3 20 5 10 4 18 14 20 24 1 7 1 13 1 20-1 3-1 6-1 8 0 8 3 16 8 21 1 2 3 4 5 6 5 5 9 11 12 16 5 10 5 22 0 32-3 5-7 11-12 16-2 2-4 4-5 6-5 6-8 13-8 21 0 2 0 5 1 8 0 7 0 13-1 20-2 10-10 20-20 24-6 2-12 4-19 5-3 0-6 0-8 1-8 1-15 6-20 12-1 2-3 4-4 6-4 6-8 11-13 15-8 7-20 9-31 6-6-2-12-4-18-8-2-2-5-3-7-5-7-3-15-4-22-3-3 1-5 2-8 3-6 2-13 3-19 3-11 0-22-5-28-15-4-5-7-11-9-18-1-3-1-5-3-8-3-7-8-12-15-16-2-1-4-2-7-3-6-2-12-6-17-9-6-5-11-13-11-21 0-4 1-9 1-13 1-4 0-8-1-11-2-4-3-7-4-11-1-2-1-4-1-6 0-3 2-6 3-8 3-4 5-7 7-11 2-5 3-11 1-16-1-3-1-6-3-8-2-7-4-13-4-20-1-11 4-22 12-29 5-3 11-7 17-9 3-1 5-2 7-3 7-4 12-9 15-17 2-2 2-4 3-7 2-7 5-13 9-18 6-10 17-15 28-15 6 0 13 1 19 3 3 1 5 2 8 3 7 1 15 0 22-3 2-2 5-3 7-5 6-4 12-6 18-8 11-3 23-1 31 6 5 4 9 9 13 15 1 2 3 4 4 7z;M62-135c6 5 12 8 19 11 3 1 5 1 8 2 7 1 13 4 19 7 9 7 16 15 21 25 3 6 4 13 4 20 0 3 1 6 1 8 1 8 4 15 8 21 1 3 3 5 4 7 5 5 8 11 10 18 3 11 3 21 0 32-2 7-5 13-10 18-1 2-3 5-4 7-4 6-7 13-8 21 0 3-1 5-1 8 0 7-1 14-4 20-5 10-12 18-21 25-6 3-12 6-19 7-3 1-5 1-8 2-7 3-13 6-19 11-2 2-4 4-6 6-5 5-10 10-17 12-10 5-21 7-31 6-7-1-14-3-20-7-2-1-4-3-7-3-7-3-14-5-22-5-3 0-5 0-8 1-7 1-14 1-21-1-11-3-20-9-28-17-4-5-8-11-10-17-1-3-2-5-3-8-4-6-8-12-14-17-2-2-4-4-7-5-6-4-11-9-15-14-4-7-6-13-9-19-1-3-2-5-2-8-1-2 0-4 1-6 1-3 2-6 4-9 1-1 2-2 2-4 1-1 2-3 2-4 0-3 0-6-1-9 0-5-1-10-2-14 0-3-1-6-2-8-3-7-4-13-3-20 0-11 4-21 10-31 4-6 9-10 15-14 3-1 5-3 7-5 6-5 10-11 14-17 1-3 2-5 3-8 2-6 6-12 11-17 7-8 16-14 27-17 7-2 14-2 21-1 3 1 5 1 8 1 8 0 15-2 22-5 3-1 5-2 7-3 6-4 13-6 20-7 11-1 21 1 32 6 6 3 11 7 16 12 2 2 4 4 6 6z;M67-113c2 8 10 14 18 13 3 0 6 0 9-1 7 0 14-1 21-1 12-1 22 12 17 23-3 7-6 13-8 20-1 3-2 5-3 8-4 8-1 16 6 21 3 1 5 3 8 4 6 4 12 8 18 11 10 7 10 23 0 29-6 4-12 8-18 12-3 1-5 3-8 4-7 4-10 13-6 21 1 3 2 5 3 8 3 6 5 13 8 19 5 12-4 25-17 24-7-1-14-1-21-2-3 0-6 0-9 0-8-1-16 5-18 13 0 3-1 5-2 8-1 7-3 14-5 21-3 12-17 17-27 9-6-5-11-10-16-14-3-2-5-4-7-6-6-5-16-5-22 0-2 2-4 4-6 6-6 4-11 9-17 14-9 8-24 3-27-9-2-7-4-14-5-21-1-3-2-5-2-8-2-8-10-14-18-13-3 0-6 0-9 1-7 0-14 1-21 1-12 1-22-12-17-23 4-9 8-19 11-28 4-8 1-16-6-21-9-5-17-10-26-15-4-3-7-8-8-13 0-6 2-13 8-16 9-6 17-11 26-16 7-4 10-13 6-21-1-3-2-5-3-8-3-6-5-13-8-19-5-12 4-25 17-24 7 1 14 1 21 2 3 0 6 0 9 0 8 1 16-5 18-13 0-3 1-5 2-8 1-7 3-14 5-21 3-12 17-17 27-9 6 5 11 10 16 14 3 2 5 4 7 6 6 5 16 5 22 0 2-2 4-4 6-6 6-4 11-9 17-14 9-8 24-3 27 9 2 7 4 14 5 21 1 3 2 5 2 8z',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
begin: '-3900ms',
|
|
34
|
+
values: 'M142-34c17 20 17 48 0 68 0 0-1 0-1 1-8 9-12 21-12 34 1 26-18 48-43 51-13 2-24 8-32 18 0 0 0 1-1 1-15 20-44 25-66 12 0-1-1-1-1-1-11-6-24-8-36-6-25 6-50-9-58-33-4-12-12-22-22-28-1 0-1-1-2-1-17-9-27-27-27-46 0-6 2-11 4-17 5-12 5-26 0-38-2-6-4-11-4-17 0-19 10-37 27-46 1 0 1-1 2-1 10-6 18-16 22-28 8-24 33-39 58-33 12 2 25 0 36-6 0 0 1 0 1-1 22-13 51-8 66 12 1 0 1 1 1 1 8 10 19 16 32 18 25 3 44 25 43 51 0 13 4 25 12 34 0 1 1 1 1 1z;M140-31c14 18 14 44 0 62 0 1 0 1-1 1-6 9-12 19-17 29-9 19-23 38-38 52-8 7-16 16-22 25 0 0-1 0-1 1-14 18-38 25-59 17-1 0-1 0-2-1-10-4-21-7-31-9-21-3-42-12-59-23-9-5-18-10-28-14-1 0-2 0-2 0-21-9-34-28-33-50 0-9 0-19 0-28 2-21 2-41 0-62 0-9 0-19 0-28-1-22 12-41 33-50 0 0 1 0 2 0 10-4 19-9 28-14 17-11 38-20 59-23 10-2 21-5 31-9 1-1 1-1 2-1 21-8 45-1 59 17 0 1 1 1 1 1 6 9 14 18 22 25 15 14 29 33 38 52 5 10 11 20 17 29 1 0 1 0 1 1z;M140-30c12 18 12 42 0 60 0 1-1 1-1 1-6 9-13 18-19 26-14 17-26 34-37 53-6 10-11 19-18 28 0 0 0 0 0 1-13 17-35 25-56 19-1 0-2 0-2 0-10-3-20-7-30-11-19-7-39-13-60-18-10-3-20-5-30-9-1 0-1 0-2 0-21-8-36-28-36-51 0-11 0-22 0-33-1-24-1-48 0-72 0-11 0-22 0-33 0-23 15-43 36-51 1 0 1 0 2 0 10-4 20-6 30-9 21-5 41-11 60-18 10-4 20-8 30-11 0 0 1 0 2 0 21-6 43 2 56 19 0 1 0 1 0 1 7 9 12 18 18 28 11 19 23 36 37 53 6 8 13 17 19 26 0 0 1 0 1 1z;M142-34c17 20 17 48 0 68 0 0-1 0-1 1-8 9-12 21-12 34 1 26-18 48-43 51-13 2-24 8-32 18 0 0 0 1-1 1-15 20-44 25-66 12 0-1-1-1-1-1-11-6-24-8-36-6-25 6-50-9-58-33-4-12-12-22-22-28-1 0-1-1-2-1-17-9-27-27-27-46 0-6 2-11 4-17 5-12 5-26 0-38-2-6-4-11-4-17 0-19 10-37 27-46 1 0 1-1 2-1 10-6 18-16 22-28 8-24 33-39 58-33 12 2 25 0 36-6 0 0 1 0 1-1 22-13 51-8 66 12 1 0 1 1 1 1 8 10 19 16 32 18 25 3 44 25 43 51 0 13 4 25 12 34 0 1 1 1 1 1z',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
begin: '-3250ms',
|
|
38
|
+
values: 'M139-30c13 19 13 45 0 64-2 1-3 3-4 5-2 3-4 6-6 8-22 31-43 62-65 92-5 7-10 12-17 16-3 2-6 3-10 4-10 3-22 4-33 0-19-6-38-13-57-19-16-6-33-11-49-17-5-1-9-3-13-4-22-7-37-28-37-51 0-12 0-23 0-34 0-6 0-12 0-18 0-27 0-53 0-80 0-23 15-44 37-51 24-8 48-17 73-25 5-2 10-3 16-5 10-3 20-7 30-10 22-8 47 0 60 19 6 8 11 16 17 25 14 19 27 38 41 57 5 8 11 16 17 24z;M140-53c14 21 21 46 19 70 0 3 0 6-1 9 0 4-1 8-2 13-9 49-43 91-87 112-8 4-18 7-28 9-4 0-9 1-13 2-13 0-26-1-38-5-23-6-43-18-61-32-15-13-31-26-46-38-4-4-7-7-11-11-16-15-27-36-30-58-2-10-3-20-3-30 1-5 1-10 1-15 2-24 8-47 18-67 8-18 22-33 39-43 20-11 42-19 65-22 5-1 10-2 15-3 9 0 19 0 28 0 20 1 39 9 55 22 7 6 13 12 19 19 15 16 29 31 44 47 6 7 12 14 17 21z;M138-59c15 21 24 46 28 72 0 3 0 7 0 10 0 5 0 10-1 15-4 57-42 104-95 120-11 3-22 6-33 6-6 1-10 1-15 2-14-1-28-3-41-7-23-6-45-19-62-38-15-16-29-31-44-47-4-4-7-8-10-13-14-19-23-40-28-62-2-9-3-18-3-27 0-5 1-10 1-15 3-22 11-43 25-61 11-15 25-28 40-39 18-12 39-20 61-22 5 0 10 0 15-1 9 1 18 2 27 4 19 5 37 13 53 23 7 5 14 10 21 17 15 14 29 28 44 43 7 6 12 12 17 20z;M139-30c13 19 13 45 0 64-2 1-3 3-4 5-2 3-4 6-6 8-22 31-43 62-65 92-5 7-10 12-17 16-3 2-6 3-10 4-10 3-22 4-33 0-19-6-38-13-57-19-16-6-33-11-49-17-5-1-9-3-13-4-22-7-37-28-37-51 0-12 0-23 0-34 0-6 0-12 0-18 0-27 0-53 0-80 0-23 15-44 37-51 24-8 48-17 73-25 5-2 10-3 16-5 10-3 20-7 30-10 22-8 47 0 60 19 6 8 11 16 17 25 14 19 27 38 41 57 5 8 11 16 17 24z',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
begin: '-2600ms',
|
|
42
|
+
values: 'M163 38c0 0 0 1 0 1-1 11-4 22-8 32-1 5-3 9-5 13-5 10-10 19-17 28-7 8-14 15-22 21-8 7-18 13-28 17-4 2-8 4-12 6-10 3-21 6-32 7 0 0-1 0-1 0-5 0-10 1-14 1-3 0-6 0-8 0-6 0-11-1-17-2-2 0-5-1-7-1-5-1-11-3-16-5-13-4-24-11-35-18-7-5-13-10-19-16-10-11-21-21-32-32-4-4-8-8-12-12-3-3-5-6-8-8-15-18-25-39-31-62-2-10-3-21-3-32 0-4 1-9 1-14 0 0 0-1 0-1 1-11 4-22 8-32 1-5 3-9 5-13 5-10 10-19 17-28 7-8 14-15 22-21 8-7 18-13 28-17 4-2 8-4 12-6 10-3 21-6 32-7 0 0 1 0 1 0 5 0 10-1 14-1 11 0 22 1 32 3 23 6 44 16 62 31 2 3 5 5 8 8 4 4 8 8 12 12 11 11 21 22 32 32 6 6 11 12 16 19 7 11 14 23 18 35 2 5 4 11 5 16 0 3 1 5 1 7 1 6 2 11 2 17 0 2 0 5 0 8 0 4-1 9-1 14z;M158 21c0 0 0 1 0 1-7 10-14 20-21 30-3 4-5 9-6 14-2 12-4 24-6 36-3 11-12 21-23 23-12 2-24 4-36 6-5 1-10 3-14 6-10 7-20 14-30 21 0 0-1 0-1 0-5 3-10 5-16 5-5 0-10-2-14-5-9-6-18-13-27-20-3-2-8-4-12-4-11-2-22-3-34-4-12-2-22-11-26-22-2-5-3-9-5-14-3-9-6-18-9-27-1-3-3-7-5-10-1-2-2-4-4-6-10-11-19-24-26-36-4-6-6-13-6-20 0-6 2-11 5-16 0 0 0-1 0-1 7-10 14-20 21-30 3-4 5-9 6-14 2-12 4-24 6-36 3-11 12-21 23-23 12-2 24-4 36-6 5-1 10-3 14-6 10-7 20-14 30-21 0 0 1 0 1 0 5-3 10-5 16-5 7 0 14 2 20 6 12 7 25 16 36 26 2 2 4 3 6 4 3 2 7 4 10 5 9 3 18 6 27 9 5 2 9 3 14 5 11 4 20 14 22 26 1 12 2 23 4 34 0 4 2 9 4 12 7 9 14 18 20 27 3 4 5 9 5 14 0 6-2 11-5 16z;M156 14c0 0 0 0 0 0-9 10-18 20-27 29-4 5-6 10-6 15-1 13-1 26-2 40 0 13-10 23-23 23-14 1-27 1-40 2-5 0-10 2-14 6-10 9-20 18-30 27 0 0 0 0 0 0-5 4-10 6-16 6-6 0-13-2-18-6-10-10-20-19-30-28-4-3-10-6-15-6-14-1-27-2-41-3-12-1-22-11-22-24 0-4 0-9 0-13 1-8 1-16 1-24 0-4 0-7-1-9-1-2-2-4-4-5-7-9-15-18-24-27-4-4-6-9-6-15 0-6 2-11 6-16 0 0 0 0 0 0 9-10 18-20 27-29 4-5 6-10 6-15 1-13 1-26 2-40 0-13 10-23 23-23 14-1 27-1 40-2 5 0 10-2 14-6 10-9 20-18 30-27 0 0 0 0 0 0 5-4 10-6 16-6 6 0 11 2 15 6 9 9 18 17 27 24 1 2 3 3 5 4 2 1 5 1 9 1 8 0 16 0 24-1 4 0 9 0 13 0 13 0 23 10 24 22 1 14 2 27 3 41 0 5 3 11 6 15 9 10 18 20 28 30 4 5 6 12 6 18 0 6-2 11-6 16z;M163 38c0 0 0 1 0 1-1 11-4 22-8 32-1 5-3 9-5 13-5 10-10 19-17 28-7 8-14 15-22 21-8 7-18 13-28 17-4 2-8 4-12 6-10 3-21 6-32 7 0 0-1 0-1 0-5 0-10 1-14 1-3 0-6 0-8 0-6 0-11-1-17-2-2 0-5-1-7-1-5-1-11-3-16-5-13-4-24-11-35-18-7-5-13-10-19-16-10-11-21-21-32-32-4-4-8-8-12-12-3-3-5-6-8-8-15-18-25-39-31-62-2-10-3-21-3-32 0-4 1-9 1-14 0 0 0-1 0-1 1-11 4-22 8-32 1-5 3-9 5-13 5-10 10-19 17-28 7-8 14-15 22-21 8-7 18-13 28-17 4-2 8-4 12-6 10-3 21-6 32-7 0 0 1 0 1 0 5 0 10-1 14-1 11 0 22 1 32 3 23 6 44 16 62 31 2 3 5 5 8 8 4 4 8 8 12 12 11 11 21 22 32 32 6 6 11 12 16 19 7 11 14 23 18 35 2 5 4 11 5 16 0 3 1 5 1 7 1 6 2 11 2 17 0 2 0 5 0 8 0 4-1 9-1 14z',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
begin: '-1950ms',
|
|
46
|
+
values: 'M17 156c-5 4-10 6-16 6-6 1-12-1-18-6-9-8-19-16-29-25-4-3-9-5-14-6-13-1-26-2-39-3-12-1-22-11-23-23-1-13-2-26-3-39-1-5-3-10-6-14-9-10-17-20-25-29-5-6-7-12-6-18 0-6 2-11 6-16 1-1 2-2 3-4 7-8 14-16 22-25 3-4 5-9 6-14 0-2 0-4 0-6 0-3 1-5 1-7 0-9 1-17 2-26 1-12 11-22 23-23 9-1 17-2 26-2 2 0 4-1 7-1 2 0 4 0 6 0 5-1 10-3 14-6 9-8 17-15 25-22 2-1 3-2 4-3 5-4 10-6 16-6 6-1 12 1 18 6 9 8 19 16 29 25 4 3 9 5 14 6 13 1 26 2 39 3 12 1 22 11 23 23 1 9 2 17 2 26 0 2 1 4 1 7 0 2 0 4 0 6 1 5 3 10 6 14 7 9 15 17 22 25 1 2 2 3 3 4 4 5 6 10 6 16 1 6-1 12-6 18-8 9-16 19-25 29-3 4-5 9-6 14-1 13-2 26-3 39-1 12-11 22-23 23-9 1-17 2-26 2-2 0-4 1-7 1-2 0-4 0-6 0-5 1-10 3-14 6-9 8-17 15-25 22-2 1-3 2-4 3z;M-19 139c-4 2-8 3-11 4-5 2-10 3-15 2-9 0-18-2-27-4-4-2-8-3-12-4-9-2-18-5-26-9-8-4-15-11-19-19-4-8-7-17-9-27-1-4-2-8-3-11-2-9-4-18-4-27-1-4 0-9 1-13 2-4 3-8 5-12 1-1 2-2 2-3 4-7 7-15 9-22 1-7 1-14 0-20 0-3-1-7-2-10-2-4-3-8-5-12-5-15-6-31-2-45 6-21 23-38 44-44 14-3 30-3 45 2 4 2 8 3 12 5 3 1 7 2 10 2 6 2 13 2 19 0 8-2 15-5 23-9 1 0 2-1 3-2 4-2 7-3 11-4 5-2 10-3 15-2 9 0 18 2 27 4 4 2 8 3 12 4 9 2 18 5 26 9 13 8 23 21 26 35 4 14 4 30-2 45-1 4-2 8-4 12-1 3-2 7-3 10-1 6-1 13 1 20 2 7 5 15 9 22 0 1 1 2 2 3 2 4 3 8 4 11 2 5 3 10 2 15 0 9-2 18-5 27-1 4-2 8-3 12-2 9-5 18-9 26-8 13-21 23-36 27-14 3-29 3-44-2-4-2-8-3-12-5-4-1-7-2-10-2-7-2-13-2-20 0-7 2-15 5-22 9-1 0-2 1-3 2z;M-34 131c-3 1-7 3-10 4-4 2-8 4-13 6-9 3-18 4-26 3-4 0-7 0-10-2-8-2-16-7-22-12-6-5-11-11-16-17-5-6-10-14-12-22-1-3-1-6-2-10 0-8 1-17 5-25 1-4 3-8 5-12 1-3 3-6 4-10 0-1 1-2 1-3 3-7 4-14 4-21 0-7-1-14-3-22-1-3-2-7-4-11-2-4-4-9-6-14-8-18-9-37-3-54 8-24 27-44 52-52 16-5 35-4 53 4 5 2 9 4 14 6 4 2 8 3 11 4 8 2 15 3 22 3 7 0 14-1 21-4 1 0 2-1 3-1 4-1 7-3 10-4 4-2 9-4 13-6 9-3 18-4 26-3 4 0 7 0 11 2 7 2 15 7 21 12 13 10 23 24 28 40 5 16 4 35-4 53-2 5-4 9-6 14-2 4-3 8-4 11-2 8-3 15-3 22 0 7 1 14 4 21 0 1 1 2 1 3 1 4 3 7 4 10 2 4 4 8 6 13 3 9 4 18 3 26 0 4 0 7-2 11-2 7-6 15-12 21-10 13-24 23-40 28-16 5-35 4-53-4-5-2-9-4-14-6-4-2-8-3-11-4-7-2-15-3-22-3-7 0-14 1-21 4-1 0-2 1-3 1z;M17 156c-5 4-10 6-16 6-6 1-12-1-18-6-9-8-19-16-29-25-4-3-9-5-14-6-13-1-26-2-39-3-12-1-22-11-23-23-1-13-2-26-3-39-1-5-3-10-6-14-9-10-17-20-25-29-5-6-7-12-6-18 0-6 2-11 6-16 1-1 2-2 3-4 7-8 14-16 22-25 3-4 5-9 6-14 0-2 0-4 0-6 0-3 1-5 1-7 0-9 1-17 2-26 1-12 11-22 23-23 9-1 17-2 26-2 2 0 4-1 7-1 2 0 4 0 6 0 5-1 10-3 14-6 9-8 17-15 25-22 2-1 3-2 4-3 5-4 10-6 16-6 6-1 12 1 18 6 9 8 19 16 29 25 4 3 9 5 14 6 13 1 26 2 39 3 12 1 22 11 23 23 1 9 2 17 2 26 0 2 1 4 1 7 0 2 0 4 0 6 1 5 3 10 6 14 7 9 15 17 22 25 1 2 2 3 3 4 4 5 6 10 6 16 1 6-1 12-6 18-8 9-16 19-25 29-3 4-5 9-6 14-1 13-2 26-3 39-1 12-11 22-23 23-9 1-17 2-26 2-2 0-4 1-7 1-2 0-4 0-6 0-5 1-10 3-14 6-9 8-17 15-25 22-2 1-3 2-4 3z',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
begin: '-1300ms',
|
|
50
|
+
values: 'M-40 138c-3 1-7 2-11 3-54 15-105-36-90-90 1-4 2-7 3-11 2-4 4-9 6-13 7-17 7-37 0-54-2-4-4-8-6-13-5-12-7-25-6-37 4-35 33-64 68-67 12-1 24 1 36 6 4 2 9 4 13 6 17 7 37 7 54 0 4-2 8-4 13-6 3-1 7-2 11-3 54-15 105 36 90 90-1 4-2 7-3 11-2 4-4 9-6 13-7 17-7 37 0 54 2 4 4 8 6 13 5 12 7 25 6 37-4 35-33 64-68 67-12 1-24-1-36-6-4-2-9-4-13-6-17-7-37-7-54 0-4 2-8 4-13 6z;M-24 136c-3-1-6-2-9-3-45-15-85-55-100-100-1-3-2-6-3-9-2-4-3-9-4-13-4-17-8-35-12-51-1-5-2-9-2-14-2-12-2-23 0-34 7-35 31-60 66-66 11-2 23-2 35 0 4 0 9 1 13 2 17 4 34 8 51 12 5 1 9 3 13 4 3 1 6 2 9 3 45 15 85 55 100 100 1 3 2 6 3 9 2 4 3 9 4 13 4 17 8 35 12 51 1 5 2 9 2 14 2 12 2 23 0 34-7 35-31 60-66 66-11 2-23 2-35 0-4 0-9-1-13-2-17-4-34-8-51-12-4-1-9-2-13-4z;M-17 136c-3-2-6-4-9-6-40-28-76-64-104-104-2-3-4-6-6-9-2-4-5-9-7-13-9-17-15-34-17-50-1-4-1-9-1-13-1-12 0-23 3-34 8-34 31-57 65-65 11-3 22-4 34-3 5 0 9 0 14 1 16 2 33 8 50 17 4 2 8 5 12 8 3 1 6 3 9 5 40 28 76 64 104 104 2 3 4 6 6 9 2 4 5 9 7 13 9 17 15 34 17 50 1 4 1 9 1 13 1 12 0 23-3 34-8 34-31 57-65 65-11 3-22 4-34 3-5 0-9 0-14-1-16-2-33-8-50-17-4-2-8-5-12-7z;M-40 138c-3 1-7 2-11 3-54 15-105-36-90-90 1-4 2-7 3-11 2-4 4-9 6-13 7-17 7-37 0-54-2-4-4-8-6-13-5-12-7-25-6-37 4-35 33-64 68-67 12-1 24 1 36 6 4 2 9 4 13 6 17 7 37 7 54 0 4-2 8-4 13-6 3-1 7-2 11-3 54-15 105 36 90 90-1 4-2 7-3 11-2 4-4 9-6 13-7 17-7 37 0 54 2 4 4 8 6 13 5 12 7 25 6 37-4 35-33 64-68 67-12 1-24-1-36-6-4-2-9-4-13-6-17-7-37-7-54 0-4 2-8 4-13 6z',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
begin: '-650ms',
|
|
54
|
+
values: 'M157 91c0 2-1 4-1 5-3 10-7 18-12 26-6 9-13 17-22 23-8 5-17 8-26 11-2 0-3 1-5 1-5 1-11 2-17 2-9 1-19 0-28-1-9-1-17-3-26-6-5-1-11-3-16-6-4-1-9-3-13-5-5-3-10-5-15-8-2-1-3-1-4-2-4-3-9-5-13-8-5-3-9-7-14-10-4-3-7-6-11-9-4-3-9-7-13-11-7-7-14-14-20-21-8-9-15-18-22-28-3-5-7-10-10-16-1-2-3-5-4-7-6-11-10-22-14-32-4-12-7-23-9-35-1-9-2-19-1-28 0-6 1-12 2-17 0-2 1-4 1-5 3-10 7-18 12-26 6-9 13-17 22-23 8-5 17-8 26-11 2 0 3-1 5-1 5-1 11-2 17-2 9-1 19 0 28 1 9 1 17 3 26 6 5 1 11 3 16 6 4 1 9 3 13 5 5 3 10 5 15 8 2 1 3 1 4 2 4 3 9 5 13 8 5 3 9 7 14 10 4 3 7 6 11 9 4 3 9 7 13 11 7 7 14 14 20 21 8 9 15 18 22 28 3 5 7 10 10 16 1 2 3 5 4 7 6 11 10 22 14 32 4 12 7 23 9 35 1 9 2 19 1 28 0 6-1 12-2 17z;M129 57c0 1 0 3 1 4 2 10 4 19 6 28 2 11-7 22-19 23-9 0-19 1-29 1-1 0-3 0-4 0-7 2-12 6-14 11-4 7-8 14-12 21-4 10-18 13-27 6-7-5-15-11-22-16-5-5-14-5-20-1-6 4-13 8-20 13-2 1-4 1-6 2-8 1-17-4-20-12-2-8-5-16-8-24-3-7-9-12-16-12-9 0-18-1-26-1-12-1-20-12-18-23 1-9 2-18 4-27 1-6-1-12-4-17-1-2-3-3-5-5-8-6-15-13-23-19-9-8-10-23-2-31 6-6 13-12 19-18 5-4 7-10 7-17 0-1 0-3-1-4-2-10-4-19-6-28-2-11 7-22 19-23 9 0 19-1 29-1 1 0 3 0 4 0 7-2 12-6 14-11 4-7 8-14 12-21 4-10 18-13 27-6 7 5 15 11 22 16 5 5 14 5 20 1 6-4 13-8 20-13 2-1 4-1 6-2 8-1 17 4 20 12 2 8 5 16 8 24 3 7 9 12 16 12 9 0 18 1 26 1 12 1 20 12 18 23-1 9-2 18-4 27-1 6 1 12 4 17 1 2 3 3 5 5 8 6 15 13 23 19 9 8 10 23 2 31-6 6-13 12-19 18-5 4-7 10-7 17z;M117 42c0 1 1 3 1 5 5 9 9 18 14 27 6 12-4 25-17 24-10-1-20-2-30-4-1 0-3 0-5 1-6 1-11 6-12 13-2 11-3 21-5 32-3 14-18 19-28 10-8-6-15-13-23-20-7-6-17-6-23 1-8 7-16 14-23 21-3 2-5 4-7 4-10 3-20-2-22-12-2-11-4-21-7-31-1-9-9-15-18-14-10 2-21 3-31 4-13 2-23-11-17-24 5-9 10-18 14-27 3-6 3-12-1-16-1-2-3-4-5-5-8-5-17-9-26-14-11-6-11-22 1-28 9-5 18-10 28-15 6-3 9-9 8-16 0-1-1-3-1-5-5-9-9-18-14-27-6-12 4-25 17-24 10 1 20 2 30 4 1 0 3 0 5-1 6-1 11-6 12-13 2-11 3-21 5-32 3-14 18-19 28-10 8 6 15 13 23 20 7 6 17 6 23-1 8-7 16-14 23-21 3-2 5-4 7-4 10-3 20 2 22 12 2 11 4 21 7 31 1 9 9 15 18 14 10-2 21-3 31-4 13-2 23 11 17 24-5 9-10 18-14 27-3 6-3 12 1 16 1 2 3 4 5 5 8 5 17 9 26 14 11 6 11 22-1 28-9 5-18 10-28 15-6 3-9 9-8 16z;M157 91c0 2-1 4-1 5-3 10-7 18-12 26-6 9-13 17-22 23-8 5-17 8-26 11-2 0-3 1-5 1-5 1-11 2-17 2-9 1-19 0-28-1-9-1-17-3-26-6-5-1-11-3-16-6-4-1-9-3-13-5-5-3-10-5-15-8-2-1-3-1-4-2-4-3-9-5-13-8-5-3-9-7-14-10-4-3-7-6-11-9-4-3-9-7-13-11-7-7-14-14-20-21-8-9-15-18-22-28-3-5-7-10-10-16-1-2-3-5-4-7-6-11-10-22-14-32-4-12-7-23-9-35-1-9-2-19-1-28 0-6 1-12 2-17 0-2 1-4 1-5 3-10 7-18 12-26 6-9 13-17 22-23 8-5 17-8 26-11 2 0 3-1 5-1 5-1 11-2 17-2 9-1 19 0 28 1 9 1 17 3 26 6 5 1 11 3 16 6 4 1 9 3 13 5 5 3 10 5 15 8 2 1 3 1 4 2 4 3 9 5 13 8 5 3 9 7 14 10 4 3 7 6 11 9 4 3 9 7 13 11 7 7 14 14 20 21 8 9 15 18 22 28 3 5 7 10 10 16 1 2 3 5 4 7 6 11 10 22 14 32 4 12 7 23 9 35 1 9 2 19 1 28 0 6-1 12-2 17z',
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
// Los 7 pasos quietos, en orden, con el giro con que se ven en la animación.
|
|
58
|
+
export const STEPS = [
|
|
59
|
+
'M75-103c3 2 7 3 11 3 10-1 20-1 30-2 12-1 22 12 17 23-4 9-8 19-11 28-4 8-1 16 6 21 9 5 17 10 26 15 10 7 10 23 0 29-9 6-17 11-26 16-7 4-10 13-6 21 3 9 7 18 11 27 5 12-4 25-17 24-10-1-20-1-30-2-8-1-16 5-18 13-2 9-4 19-7 29-3 12-17 17-27 9-8-7-15-13-23-20-6-5-16-5-22 0-8 7-15 13-23 20-9 8-24 3-27-9-3-10-5-20-7-29-2-8-10-14-18-13-10 1-20 1-30 2-12 1-22-12-17-23 4-9 8-19 11-28 4-8 1-16-6-21-9-5-17-10-26-15-10-7-10-23 0-29 9-6 17-11 26-16 7-4 10-13 6-21-3-9-7-18-11-27-5-12 4-25 17-24 10 1 20 1 30 2 8 1 16-5 18-13 2-9 4-19 7-29 3-12 17-17 27-9 8 7 15 13 23 20 6 5 16 5 22 0 8-7 15-13 23-20 9-8 24-3 27 9 3 10 5 20 7 29 1 4 4 8 7 10z',
|
|
60
|
+
'M0 160c-12 0-24-5-34-13-9-9-22-14-35-13-26 1-48-18-51-43-2-13-9-25-19-33-20-15-25-44-12-66 7-11 10-24 7-37-6-25 9-50 33-58 13-4 23-13 29-24 12-23 39-33 63-23 12 5 26 5 38 0 24-10 51 0 63 23 6 11 16 20 29 24 24 8 39 33 33 58-3 13 0 26 7 37 13 22 8 51-12 66-10 8-17 20-19 33-3 25-25 44-51 43-13-1-26 4-35 13-10 8-22 13-34 13z',
|
|
61
|
+
'M-150 0c0-11 3-22 10-32 25-35 50-70 74-106 14-19 38-26 60-19 40 13 80 26 119 40 22 7 37 28 37 51 0 44 0 88 0 132 0 23-15 44-37 51-39 14-79 27-119 40-22 7-46 0-60-19-24-36-49-71-74-106-7-10-10-21-10-32z',
|
|
62
|
+
'M123-123c22 22 37 52 40 85 0 5 1 10 1 14 0 38-15 75-42 102-15 15-29 29-44 44-27 27-64 42-102 42-4 0-9-1-14-1-66-7-118-59-125-125 0-5-1-10-1-14 0-38 15-75 42-102 15-15 29-29 44-44 27-27 64-42 102-42 4 0 9 1 14 1 33 3 63 18 85 40z',
|
|
63
|
+
'M0 163c-6 0-12-2-17-6-9-8-19-16-29-25-4-3-9-5-14-6-13-1-26-2-39-3-12-1-22-11-23-23-1-13-2-26-3-39-1-5-3-10-6-14-9-10-17-20-25-29-8-10-8-24 0-34 8-9 16-19 25-29 3-4 5-9 6-14 1-13 2-26 3-39 1-12 11-22 23-23 13-1 26-2 39-3 5-1 10-3 14-6 10-9 20-17 29-25 10-8 24-8 34 0 9 8 19 16 29 25 4 3 9 5 14 6 13 1 26 2 39 3 12 1 22 11 23 23 1 13 2 26 3 39 1 5 3 10 6 14 9 10 17 20 25 29 8 10 8 24 0 34-8 9-16 19-25 29-3 4-5 9-6 14-1 13-2 26-3 39-1 12-11 22-23 23-13 1-26 2-39 3-5 1-10 3-14 6-10 9-20 17-29 25-5 4-11 6-17 6z',
|
|
64
|
+
'M-122-122c20-20 51-29 82-16 4 2 9 4 13 6 17 7 37 7 54 0 4-2 8-4 13-6 62-26 124 36 98 98-2 4-4 9-6 13-7 17-7 37 0 54 2 4 4 8 6 13 26 62-36 124-98 98-4-2-9-4-13-6-17-7-37-7-54 0-4 2-9 4-13 6-62 26-124-36-98-98 2-4 4-9 6-13 7-17 7-37 0-54-2-4-4-8-6-13-13-31-4-62 16-82z',
|
|
65
|
+
'M-134-134c11-12 25-19 43-23 34-7 77 2 119 26 42 24 79 61 103 103 24 42 33 85 26 119-7 35-31 59-66 66-34 7-77-2-119-26-42-24-79-61-103-103-24-42-33-85-26-119 4-18 11-32 23-43z',
|
|
66
|
+
];
|
|
67
|
+
// El indicador determinado (Circle girado 18° → SoftBurst): el contorno de inicio y de fin, sin
|
|
68
|
+
// centrar, como lista plana (x e y del moveTo y seis números por curva).
|
|
69
|
+
export const DETERMINATE = {
|
|
70
|
+
start: [377, 190, 377, 194, 376.8, 198, 376.6, 202, 375.9, 211.9, 374.5, 221.8, 372.3, 231.4, 369.8, 242.5, 366.3, 253.3, 361.8, 263.7, 357.9, 272.9, 353.2, 281.7, 347.9, 290.1, 345.8, 293.4, 343.6, 296.7, 341.2, 299.9, 338.9, 303.1, 336.4, 306.3, 333.9, 309.4, 327.5, 317, 320.6, 324.1, 313.2, 330.6, 304.6, 338.1, 295.4, 344.8, 285.6, 350.6, 277.1, 355.7, 268.2, 360.1, 258.9, 363.8, 255.2, 365.2, 251.5, 366.6, 247.8, 367.8, 243.9, 369, 240.1, 370.2, 236.2, 371.1, 226.6, 373.6, 216.8, 375.3, 207, 376.2, 195.7, 377.2, 184.3, 377.2, 172.9, 376.2, 163.1, 375.3, 153.2, 373.6, 143.6, 371.1, 139.8, 370.1, 136, 369, 132.2, 367.8, 128.4, 366.6, 124.6, 365.2, 120.9, 363.7, 111.7, 360, 102.8, 355.7, 94.3, 350.6, 84.5, 344.8, 75.3, 338.1, 66.8, 330.6, 59.3, 324.1, 52.4, 316.9, 46, 309.2, 43.5, 306.2, 41.1, 303.1, 38.8, 299.9, 36.4, 296.6, 34.1, 293.3, 32, 289.9, 26.7, 281.5, 22.1, 272.8, 18.2, 263.7, 13.7, 253.2, 10.2, 242.4, 7.7, 231.3, 5.5, 221.6, 4.1, 211.8, 3.4, 201.8, 3.2, 197.9, 3, 193.9, 3, 190, 3, 186, 3.2, 182, 3.4, 178, 4.1, 168.1, 5.5, 158.2, 7.7, 148.6, 10.2, 137.5, 13.7, 126.7, 18.2, 116.3, 22.1, 107.1, 26.8, 98.3, 32.1, 89.9, 34.2, 86.6, 36.4, 83.3, 38.8, 80.1, 41.1, 76.9, 43.6, 73.7, 46.1, 70.6, 52.5, 63, 59.4, 55.9, 66.8, 49.4, 75.4, 41.9, 84.6, 35.2, 94.4, 29.4, 102.9, 24.3, 111.8, 19.9, 121.1, 16.2, 124.8, 14.8, 128.5, 13.4, 132.2, 12.2, 136.1, 11, 139.9, 9.8, 143.8, 8.9, 153.4, 6.4, 163.2, 4.7, 173, 3.8, 184.3, 2.8, 195.7, 2.8, 207.1, 3.8, 216.9, 4.7, 226.8, 6.4, 236.4, 8.9, 240.2, 9.9, 244, 11, 247.8, 12.2, 251.6, 13.4, 255.4, 14.8, 259.1, 16.3, 268.3, 20, 277.2, 24.3, 285.7, 29.4, 295.5, 35.2, 304.7, 41.9, 313.2, 49.4, 320.7, 55.9, 327.6, 63.1, 334, 70.8, 336.5, 73.8, 338.9, 76.9, 341.2, 80.1, 343.6, 83.4, 345.9, 86.7, 348, 90.1, 353.3, 98.5, 357.9, 107.2, 361.8, 116.3, 366.3, 126.8, 369.8, 137.6, 372.3, 148.7, 374.5, 158.4, 375.9, 168.2, 376.6, 178.2, 376.8, 182.1, 377, 186.1, 377, 190],
|
|
71
|
+
end: [337.2, 189.9, 337.2, 194.4, 338.7, 199, 341.9, 202.7, 349.3, 211.4, 356.6, 220.1, 364, 228.8, 373.5, 239.9, 368, 257.2, 353.7, 260.7, 342.6, 263.4, 331.5, 266.2, 320.3, 268.9, 315.7, 270, 311.8, 272.8, 309.1, 276.4, 306.4, 280.1, 305, 284.7, 305.4, 289.5, 306.3, 300.9, 307.1, 312.3, 308, 323.7, 309.1, 338.3, 294.5, 348.9, 280.9, 343.4, 270.3, 339.1, 259.7, 334.8, 249.1, 330.4, 244.6, 328.6, 239.9, 328.6, 235.6, 329.9, 231.3, 331.3, 227.4, 334.2, 224.9, 338.4, 218.9, 348.1, 212.9, 357.8, 206.9, 367.5, 199.2, 380, 181.1, 380, 173.4, 367.6, 167.3, 357.8, 161.3, 348.1, 155.2, 338.3, 152.7, 334.3, 148.9, 331.4, 144.6, 330, 140.3, 328.6, 135.5, 328.7, 131, 330.5, 120.4, 334.8, 109.9, 339.2, 99.3, 343.5, 85.8, 349.1, 71.1, 338.5, 72.2, 323.9, 73, 312.4, 73.9, 301, 74.7, 289.6, 75, 284.8, 73.6, 280.3, 71, 276.6, 68.3, 272.9, 64.4, 270.1, 59.7, 269, 48.6, 266.3, 37.5, 263.6, 26.4, 260.9, 12.2, 257.5, 6.6, 240.3, 16, 229.1, 23.4, 220.3, 30.8, 211.5, 38.2, 202.8, 41.3, 199.1, 42.8, 194.6, 42.8, 190.1, 42.8, 185.6, 41.3, 181, 38.1, 177.3, 30.7, 168.6, 23.4, 159.9, 16, 151.2, 6.5, 140.1, 12, 122.8, 26.3, 119.3, 37.4, 116.6, 48.5, 113.8, 59.7, 111.1, 64.3, 110, 68.2, 107.2, 70.9, 103.6, 73.6, 99.9, 75, 95.3, 74.6, 90.5, 73.7, 79.1, 72.9, 67.7, 72, 56.3, 70.9, 41.7, 85.5, 31.1, 99.1, 36.6, 109.7, 40.9, 120.3, 45.2, 130.9, 49.6, 135.4, 51.4, 140.1, 51.4, 144.4, 50.1, 148.7, 48.7, 152.6, 45.8, 155.1, 41.6, 161.1, 31.9, 167.1, 22.2, 173.1, 12.5, 180.8, 0, 198.9, 0, 206.6, 12.4, 212.7, 22.2, 218.7, 31.9, 224.8, 41.7, 227.3, 45.7, 231.1, 48.6, 235.4, 50, 239.7, 51.4, 244.5, 51.3, 249, 49.5, 259.6, 45.2, 270.1, 40.8, 280.7, 36.5, 294.2, 30.9, 308.9, 41.5, 307.8, 56.1, 307, 67.6, 306.1, 79, 305.3, 90.4, 305, 95.2, 306.4, 99.7, 309, 103.4, 311.7, 107.1, 315.6, 109.9, 320.3, 111, 331.4, 113.7, 342.5, 116.4, 353.6, 119.1, 367.8, 122.5, 373.4, 139.7, 364, 150.9, 356.6, 159.7, 349.2, 168.5, 341.8, 177.2, 338.7, 180.9, 337.2, 185.4, 337.2, 189.9],
|
|
72
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { AccessibleNameProps } from '../../internal/accessible-name.ts';
|
|
3
|
+
import { type ProgressIndicatorThickness } from './progress.ts';
|
|
4
|
+
/**
|
|
5
|
+
* The accessible name is required (ARIA requires it on a `progressbar` and the indicator has no
|
|
6
|
+
* visible text): `label` (becomes `aria-label`), `aria-labelledby` (the id of a visible label) or
|
|
7
|
+
* `aria-label`. TypeScript requires at least one (AccessibleNameProps).
|
|
8
|
+
*/
|
|
9
|
+
export type CircularProgressIndicatorProps = Omit<HTMLAttributes<HTMLSpanElement>, 'aria-label' | 'aria-labelledby' | 'role' | 'children'> & AccessibleNameProps & {
|
|
10
|
+
/**
|
|
11
|
+
* Progress from 0 to 1 (clamped outside that range). Without `value`, the indicator is
|
|
12
|
+
* indeterminate. Changes animate (500 ms linear), except with reduced motion.
|
|
13
|
+
*/
|
|
14
|
+
value?: number | undefined;
|
|
15
|
+
/** Material 3 Expressive wave (when determinate, between 10 % and 95 %). Defaults to `false`. */
|
|
16
|
+
wavy?: boolean | undefined;
|
|
17
|
+
/** Thickness of the indicator and the track, in px: 4 or 8. Defaults to `4`. */
|
|
18
|
+
thickness?: ProgressIndicatorThickness | undefined;
|
|
19
|
+
/** Ref to the `<span>` with `role="progressbar"`. */
|
|
20
|
+
ref?: Ref<HTMLSpanElement> | undefined;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Material 3 (Expressive) circular progress indicator: `secondary-container` track and `primary`
|
|
24
|
+
* indicator with round ends, 4 apart, advancing clockwise from 12 o'clock. It measures 40 × 40 (44
|
|
25
|
+
* with thickness 8), or 48 × 48 (52) with the wave.
|
|
26
|
+
*
|
|
27
|
+
* With reduced motion, it does not spin, the wave does not move and value changes do not animate;
|
|
28
|
+
* the indeterminate indicator stays still at a quarter turn, pulsing (opacity).
|
|
29
|
+
*
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <CircularProgressIndicator label="Refreshing" />
|
|
32
|
+
* <CircularProgressIndicator label="Downloading" value={0.6} wavy />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function CircularProgressIndicator({ label, 'aria-label': ariaLabel, value, wavy, thickness, className, style, ...props }: CircularProgressIndicatorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FLAT_PATH, TRACK_LENGTH, TRACK_PATH, WAVE_PATH } from './circular-wavy-data.js';
|
|
3
|
+
import { CIRCULAR_FLAT_LENGTH, CIRCULAR_FLAT_PATH, circularSize, clampProgress, hasWave, progressAria, } from './progress.js';
|
|
4
|
+
/**
|
|
5
|
+
* Material 3 (Expressive) circular progress indicator: `secondary-container` track and `primary`
|
|
6
|
+
* indicator with round ends, 4 apart, advancing clockwise from 12 o'clock. It measures 40 × 40 (44
|
|
7
|
+
* with thickness 8), or 48 × 48 (52) with the wave.
|
|
8
|
+
*
|
|
9
|
+
* With reduced motion, it does not spin, the wave does not move and value changes do not animate;
|
|
10
|
+
* the indeterminate indicator stays still at a quarter turn, pulsing (opacity).
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <CircularProgressIndicator label="Refreshing" />
|
|
14
|
+
* <CircularProgressIndicator label="Downloading" value={0.6} wavy />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export function CircularProgressIndicator({ label, 'aria-label': ariaLabel, value, wavy, thickness, className, style, ...props }) {
|
|
18
|
+
const progress = value === undefined ? undefined : clampProgress(value);
|
|
19
|
+
const indeterminate = progress === undefined;
|
|
20
|
+
const wave = !!wavy && (indeterminate || hasWave(progress));
|
|
21
|
+
const size = circularSize(!!wavy, thickness ?? 4);
|
|
22
|
+
const trackPath = wavy ? TRACK_PATH : CIRCULAR_FLAT_PATH;
|
|
23
|
+
const trackLength = wavy ? TRACK_LENGTH : CIRCULAR_FLAT_LENGTH;
|
|
24
|
+
const activePath = wavy ? (wave ? WAVE_PATH : FLAT_PATH) : CIRCULAR_FLAT_PATH;
|
|
25
|
+
const vars = { '--_cpi-track-length': trackLength, ...(indeterminate ? {} : { '--_cpi-value': progress }) };
|
|
26
|
+
return (_jsx("span", { ...props, role: "progressbar", "aria-label": label ?? ariaLabel, ...progressAria(progress), className: className ? `mk-circular-progress-indicator ${className}` : 'mk-circular-progress-indicator', "data-wavy": wavy ? '' : undefined, "data-thickness": thickness === 8 ? '8' : undefined, "data-indeterminate": indeterminate ? '' : undefined, "data-wave": wave ? '' : undefined, style: { ...style, ...vars }, children: _jsx("svg", { className: "mk-circular-progress-indicator-svg", viewBox: `${-size / 2} ${-size / 2} ${size} ${size}`, "aria-hidden": "true", focusable: "false", children: _jsx("g", { className: "mk-circular-progress-indicator-rotor", children: _jsxs("g", { className: "mk-circular-progress-indicator-step", children: [_jsx("path", { className: "mk-circular-progress-indicator-track", d: trackPath, pathLength: trackLength }), _jsx("path", { className: "mk-circular-progress-indicator-track mk-circular-progress-indicator-track-inner", d: trackPath, pathLength: trackLength }), _jsx("path", { className: "mk-circular-progress-indicator-active", d: activePath, pathLength: 100,
|
|
27
|
+
// La propiedad CSS `d` (Chrome y Firefox) permite la transición entre los dos contornos
|
|
28
|
+
// del Morph; donde no existe, manda el atributo.
|
|
29
|
+
style: wavy ? { d: `path("${activePath}")` } : undefined })] }) }) }) }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { AccessibleNameProps } from '../../internal/accessible-name.ts';
|
|
3
|
+
import { type ProgressIndicatorThickness } from './progress.ts';
|
|
4
|
+
/**
|
|
5
|
+
* The accessible name is required (ARIA requires it on a `progressbar` and the indicator has no
|
|
6
|
+
* visible text): `label` (becomes `aria-label`), `aria-labelledby` (the id of a visible label) or
|
|
7
|
+
* `aria-label`. TypeScript requires at least one (AccessibleNameProps).
|
|
8
|
+
*/
|
|
9
|
+
export type LinearProgressIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, 'aria-label' | 'aria-labelledby' | 'role' | 'children'> & AccessibleNameProps & {
|
|
10
|
+
/**
|
|
11
|
+
* Progress from 0 to 1 (clamped outside that range). Without `value`, the indicator is
|
|
12
|
+
* indeterminate. Changes animate (500 ms linear, Compose's recommendation for the Expressive
|
|
13
|
+
* indicators), except with reduced motion.
|
|
14
|
+
*/
|
|
15
|
+
value?: number | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Material 3 Expressive wave. In the determinate indicator it shows between 10 % and 95 %
|
|
18
|
+
* (outside that range the indicator flattens) and moves one wavelength per second. Defaults
|
|
19
|
+
* to `false`.
|
|
20
|
+
*/
|
|
21
|
+
wavy?: boolean | undefined;
|
|
22
|
+
/** Thickness of the indicator and the track, in px: 4 or 8. Defaults to `4`. */
|
|
23
|
+
thickness?: ProgressIndicatorThickness | undefined;
|
|
24
|
+
/** Ref to the `<div>` with `role="progressbar"`. */
|
|
25
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Material 3 (Expressive) linear progress indicator: `secondary-container` track, `primary`
|
|
29
|
+
* indicator with round ends, a gap of 4 between them and, when determinate, a stop dot at the end
|
|
30
|
+
* of the track. It takes the width of its container (in a flex row, give it `flex: 1` or a
|
|
31
|
+
* width); the height comes from the thickness (4 or 8, and 10 or 14 with the wave). It follows the
|
|
32
|
+
* text direction (in RTL it advances from right to left).
|
|
33
|
+
*
|
|
34
|
+
* With reduced motion, the wave does not move, value changes do not animate and the indeterminate
|
|
35
|
+
* indicator stays still, pulsing (opacity).
|
|
36
|
+
*
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <LinearProgressIndicator label="Uploading photo" value={0.4} />
|
|
39
|
+
* <LinearProgressIndicator label="Loading" wavy />
|
|
40
|
+
* <LinearProgressIndicator label="Copying" value={progress} wavy thickness={8} />
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function LinearProgressIndicator({ label, 'aria-label': ariaLabel, value, wavy, thickness, className, style, ...props }: LinearProgressIndicatorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LINEAR_FLAT_PATH, LINEAR_WAVELENGTH, clampProgress, hasWave, linearWavePath, progressAria, } from './progress.js';
|
|
3
|
+
const WAVE_PATHS = {
|
|
4
|
+
determinate: linearWavePath(LINEAR_WAVELENGTH.determinate),
|
|
5
|
+
indeterminate: linearWavePath(LINEAR_WAVELENGTH.indeterminate),
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Material 3 (Expressive) linear progress indicator: `secondary-container` track, `primary`
|
|
9
|
+
* indicator with round ends, a gap of 4 between them and, when determinate, a stop dot at the end
|
|
10
|
+
* of the track. It takes the width of its container (in a flex row, give it `flex: 1` or a
|
|
11
|
+
* width); the height comes from the thickness (4 or 8, and 10 or 14 with the wave). It follows the
|
|
12
|
+
* text direction (in RTL it advances from right to left).
|
|
13
|
+
*
|
|
14
|
+
* With reduced motion, the wave does not move, value changes do not animate and the indeterminate
|
|
15
|
+
* indicator stays still, pulsing (opacity).
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <LinearProgressIndicator label="Uploading photo" value={0.4} />
|
|
19
|
+
* <LinearProgressIndicator label="Loading" wavy />
|
|
20
|
+
* <LinearProgressIndicator label="Copying" value={progress} wavy thickness={8} />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export function LinearProgressIndicator({ label, 'aria-label': ariaLabel, value, wavy, thickness, className, style, ...props }) {
|
|
24
|
+
const progress = value === undefined ? undefined : clampProgress(value);
|
|
25
|
+
const indeterminate = progress === undefined;
|
|
26
|
+
const path = wavy ? WAVE_PATHS[indeterminate ? 'indeterminate' : 'determinate'] : LINEAR_FLAT_PATH;
|
|
27
|
+
return (_jsx("div", { ...props, role: "progressbar", "aria-label": label ?? ariaLabel, ...progressAria(progress), className: className ? `mk-linear-progress-indicator ${className}` : 'mk-linear-progress-indicator', "data-wavy": wavy ? '' : undefined, "data-thickness": thickness === 8 ? '8' : undefined, "data-indeterminate": indeterminate ? '' : undefined, "data-wave": wavy && (indeterminate || hasWave(progress)) ? '' : undefined, style: indeterminate ? style : { ...style, '--_lpi-value': progress }, children: _jsxs("div", { className: "mk-linear-progress-indicator-canvas", children: [_jsx("span", { className: "mk-linear-progress-indicator-track", "data-segment": "end" }), indeterminate && (_jsxs(_Fragment, { children: [_jsx("span", { className: "mk-linear-progress-indicator-track", "data-segment": "middle" }), _jsx("span", { className: "mk-linear-progress-indicator-track", "data-segment": "start" })] })), _jsxs("svg", { className: "mk-linear-progress-indicator-svg", "aria-hidden": "true", focusable: "false", children: [_jsx("path", { className: "mk-linear-progress-indicator-active", "data-line": "1", d: path }), indeterminate && _jsx("path", { className: "mk-linear-progress-indicator-active", "data-line": "2", d: path })] }), !indeterminate && _jsx("span", { className: "mk-linear-progress-indicator-stop" })] }) }));
|
|
28
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const WAVE_VERTICES = 9;
|
|
2
|
+
export declare const TRACK_PATH = "M0 -21.45C2.48 -21.45 4.97 -21.02 7.34 -20.16C12.08 -18.43 16.05 -15.09 18.58 -10.73C21.1 -6.36 22 -1.24 21.12 3.72C20.25 8.69 17.65 13.19 13.79 16.43C9.92 19.67 5.04 21.45 0 21.45C-5.04 21.45 -9.92 19.67 -13.79 16.43C-17.65 13.19 -20.25 8.69 -21.12 3.72C-22 -1.24 -21.1 -6.36 -18.58 -10.73C-16.05 -15.09 -12.08 -18.43 -7.34 -20.16C-4.97 -21.02 -2.48 -21.45 0 -21.45Z";
|
|
3
|
+
export declare const TRACK_LENGTH = 134.775;
|
|
4
|
+
export declare const FLAT_PATH = "M0 -21.51C1.16 -21.51 2.31 -21.42 3.44 -21.24C6.1 -20.8 8.66 -19.87 10.98 -18.49C11.96 -17.9 12.9 -17.24 13.79 -16.5C14.68 -15.75 15.5 -14.94 16.24 -14.07C18.01 -12.03 19.37 -9.67 20.26 -7.12C20.63 -6.04 20.92 -4.93 21.12 -3.79C21.33 -2.65 21.43 -1.5 21.45 -0.35C21.49 2.35 21.01 5.03 20.05 7.55C19.65 8.62 19.15 9.66 18.58 10.66C18 11.66 17.34 12.61 16.62 13.5C14.91 15.59 12.82 17.34 10.47 18.66C9.47 19.22 8.42 19.7 7.34 20.09C6.25 20.49 5.14 20.79 4.01 21.01C1.36 21.51 -1.36 21.51 -4.02 21.01C-5.14 20.79 -6.25 20.49 -7.34 20.09C-8.42 19.7 -9.47 19.22 -10.47 18.66C-12.83 17.34 -14.91 15.59 -16.62 13.5C-17.34 12.61 -18 11.66 -18.58 10.66C-19.16 9.66 -19.65 8.62 -20.06 7.55C-21.01 5.02 -21.49 2.34 -21.45 -0.36C-21.43 -1.5 -21.32 -2.65 -21.12 -3.79C-20.92 -4.93 -20.63 -6.04 -20.25 -7.13C-19.36 -9.68 -18 -12.03 -16.24 -14.08C-15.49 -14.94 -14.67 -15.75 -13.79 -16.5C-12.9 -17.24 -11.96 -17.91 -10.98 -18.49C-8.66 -19.87 -6.1 -20.81 -3.43 -21.24C-2.3 -21.42 -1.16 -21.51 0 -21.51Z";
|
|
5
|
+
export declare const WAVE_PATH = "M0.04 -19.37C1.19 -19.37 2.34 -19.66 3.39 -20.23C5.96 -21.65 9.19 -20.47 10.24 -17.72C10.66 -16.61 11.36 -15.65 12.24 -14.9C13.13 -14.16 14.19 -13.64 15.36 -13.41C18.25 -12.84 19.96 -9.86 19 -7.08C18.61 -5.96 18.53 -4.77 18.72 -3.64C18.92 -2.5 19.41 -1.41 20.15 -0.48C22 1.8 21.4 5.19 18.87 6.7C17.85 7.31 17.02 8.16 16.45 9.16C15.87 10.16 15.54 11.3 15.52 12.5C15.46 15.43 12.82 17.64 9.92 17.18C8.74 16.99 7.56 17.11 6.47 17.5C5.39 17.9 4.4 18.56 3.62 19.46C1.69 21.67 -1.76 21.67 -3.68 19.45C-4.46 18.54 -5.44 17.88 -6.53 17.48C-7.61 17.08 -8.79 16.96 -9.97 17.14C-12.87 17.6 -15.51 15.38 -15.55 12.44C-15.57 11.25 -15.9 10.11 -16.47 9.11C-17.05 8.11 -17.87 7.25 -18.89 6.64C-21.41 5.12 -22 1.73 -20.15 -0.55C-19.4 -1.48 -18.91 -2.56 -18.71 -3.7C-18.5 -4.83 -18.59 -6.02 -18.97 -7.15C-19.92 -9.93 -18.2 -12.91 -15.31 -13.46C-14.14 -13.69 -13.07 -14.2 -12.19 -14.94C-11.3 -15.69 -10.6 -16.65 -10.17 -17.76C-9.12 -20.5 -5.88 -21.67 -3.31 -20.24C-2.27 -19.66 -1.12 -19.37 0.04 -19.37Z";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Generado por scripts/build-shapes.ts. No editar a mano.
|
|
2
|
+
// Fuente: androidx/androidx@acea2f5c1f, compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/internal/CircularWavyProgressModifiers.kt
|
|
3
|
+
// Geometría de androidx.graphics.shapes (RoundedPolygon.circle, RoundedPolygon.star y Morph):
|
|
4
|
+
// Apache-2.0, The Android Open Source Project. Cómo se calcula:
|
|
5
|
+
// scripts/lib/shapes/CircularWavyProgress.ts (ADR-0011).
|
|
6
|
+
//
|
|
7
|
+
// Unidades: dp, centrado en el origen, escalado a 44 (size - stroke en 48 × 48 con trazo 4 y en
|
|
8
|
+
// 52 × 52 con trazo 8). Los contornos empiezan a las 12 y van en sentido horario.
|
|
9
|
+
// Pista: radio 21,45 a 21,45. Onda: radio 18,66 a 21,83 (amplitud 1,58 dp).
|
|
10
|
+
// Vértices (ondas) del contorno: 2π · 22 / 15 redondeado (CircularShapes.update).
|
|
11
|
+
export const WAVE_VERTICES = 9;
|
|
12
|
+
// Pista: el círculo de 9 vértices (trackPolygon).
|
|
13
|
+
export const TRACK_PATH = 'M0 -21.45C2.48 -21.45 4.97 -21.02 7.34 -20.16C12.08 -18.43 16.05 -15.09 18.58 -10.73C21.1 -6.36 22 -1.24 21.12 3.72C20.25 8.69 17.65 13.19 13.79 16.43C9.92 19.67 5.04 21.45 0 21.45C-5.04 21.45 -9.92 19.67 -13.79 16.43C-17.65 13.19 -20.25 8.69 -21.12 3.72C-22 -1.24 -21.1 -6.36 -18.58 -10.73C-16.05 -15.09 -12.08 -18.43 -7.34 -20.16C-4.97 -21.02 -2.48 -21.45 0 -21.45Z';
|
|
14
|
+
// Largo de la pista, en dp: convierte la separación (en dp) a la fracción del trazo.
|
|
15
|
+
export const TRACK_LENGTH = 134.775;
|
|
16
|
+
// Indicador sin onda: el Morph círculo → estrella en 0 (misma estructura que WAVE_PATH).
|
|
17
|
+
export const FLAT_PATH = 'M0 -21.51C1.16 -21.51 2.31 -21.42 3.44 -21.24C6.1 -20.8 8.66 -19.87 10.98 -18.49C11.96 -17.9 12.9 -17.24 13.79 -16.5C14.68 -15.75 15.5 -14.94 16.24 -14.07C18.01 -12.03 19.37 -9.67 20.26 -7.12C20.63 -6.04 20.92 -4.93 21.12 -3.79C21.33 -2.65 21.43 -1.5 21.45 -0.35C21.49 2.35 21.01 5.03 20.05 7.55C19.65 8.62 19.15 9.66 18.58 10.66C18 11.66 17.34 12.61 16.62 13.5C14.91 15.59 12.82 17.34 10.47 18.66C9.47 19.22 8.42 19.7 7.34 20.09C6.25 20.49 5.14 20.79 4.01 21.01C1.36 21.51 -1.36 21.51 -4.02 21.01C-5.14 20.79 -6.25 20.49 -7.34 20.09C-8.42 19.7 -9.47 19.22 -10.47 18.66C-12.83 17.34 -14.91 15.59 -16.62 13.5C-17.34 12.61 -18 11.66 -18.58 10.66C-19.16 9.66 -19.65 8.62 -20.06 7.55C-21.01 5.02 -21.49 2.34 -21.45 -0.36C-21.43 -1.5 -21.32 -2.65 -21.12 -3.79C-20.92 -4.93 -20.63 -6.04 -20.25 -7.13C-19.36 -9.68 -18 -12.03 -16.24 -14.08C-15.49 -14.94 -14.67 -15.75 -13.79 -16.5C-12.9 -17.24 -11.96 -17.91 -10.98 -18.49C-8.66 -19.87 -6.1 -20.81 -3.43 -21.24C-2.3 -21.42 -1.16 -21.51 0 -21.51Z';
|
|
18
|
+
// Indicador con onda: el Morph en 1, la estrella de 9 puntas.
|
|
19
|
+
export const WAVE_PATH = 'M0.04 -19.37C1.19 -19.37 2.34 -19.66 3.39 -20.23C5.96 -21.65 9.19 -20.47 10.24 -17.72C10.66 -16.61 11.36 -15.65 12.24 -14.9C13.13 -14.16 14.19 -13.64 15.36 -13.41C18.25 -12.84 19.96 -9.86 19 -7.08C18.61 -5.96 18.53 -4.77 18.72 -3.64C18.92 -2.5 19.41 -1.41 20.15 -0.48C22 1.8 21.4 5.19 18.87 6.7C17.85 7.31 17.02 8.16 16.45 9.16C15.87 10.16 15.54 11.3 15.52 12.5C15.46 15.43 12.82 17.64 9.92 17.18C8.74 16.99 7.56 17.11 6.47 17.5C5.39 17.9 4.4 18.56 3.62 19.46C1.69 21.67 -1.76 21.67 -3.68 19.45C-4.46 18.54 -5.44 17.88 -6.53 17.48C-7.61 17.08 -8.79 16.96 -9.97 17.14C-12.87 17.6 -15.51 15.38 -15.55 12.44C-15.57 11.25 -15.9 10.11 -16.47 9.11C-17.05 8.11 -17.87 7.25 -18.89 6.64C-21.41 5.12 -22 1.73 -20.15 -0.55C-19.4 -1.48 -18.91 -2.56 -18.71 -3.7C-18.5 -4.83 -18.59 -6.02 -18.97 -7.15C-19.92 -9.93 -18.2 -12.91 -15.31 -13.46C-14.14 -13.69 -13.07 -14.2 -12.19 -14.94C-11.3 -15.69 -10.6 -16.65 -10.17 -17.76C-9.12 -20.5 -5.88 -21.67 -3.31 -20.24C-2.27 -19.66 -1.12 -19.37 0.04 -19.37Z';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare function clampProgress(value: number): number;
|
|
2
|
+
/** The kit's thicknesses ("Thickness"): 4 (the tokens' one) and 8. */
|
|
3
|
+
export type ProgressIndicatorThickness = 4 | 8;
|
|
4
|
+
export declare const LINEAR_MAX_WIDTH = 4096;
|
|
5
|
+
export declare const LINEAR_WAVELENGTH: {
|
|
6
|
+
readonly determinate: 40;
|
|
7
|
+
readonly indeterminate: 20;
|
|
8
|
+
};
|
|
9
|
+
export declare function linearWavePath(wavelength: number): string;
|
|
10
|
+
export declare const LINEAR_FLAT_PATH: string;
|
|
11
|
+
export declare function hasWave(progress: number): boolean;
|
|
12
|
+
export declare function circularSize(wavy: boolean, thickness: ProgressIndicatorThickness): number;
|
|
13
|
+
export declare const CIRCULAR_FLAT_RADIUS = 18;
|
|
14
|
+
export declare const CIRCULAR_FLAT_PATH = "M0 -18A18 18 0 1 1 0 18A18 18 0 1 1 0 -18Z";
|
|
15
|
+
export declare const CIRCULAR_FLAT_LENGTH: number;
|
|
16
|
+
export declare function progressAria(progress: number | undefined): {
|
|
17
|
+
'aria-valuemin'?: never;
|
|
18
|
+
'aria-valuemax'?: never;
|
|
19
|
+
'aria-valuenow'?: never;
|
|
20
|
+
} | {
|
|
21
|
+
'aria-valuemin': number;
|
|
22
|
+
'aria-valuemax': number;
|
|
23
|
+
'aria-valuenow': number;
|
|
24
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Datos y cálculos compartidos de LinearProgressIndicator y CircularProgressIndicator (sin JSX,
|
|
2
|
+
// sin estado: universal). Fuente de cada valor, en androidx/androidx, carpeta
|
|
3
|
+
// compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/:
|
|
4
|
+
// - tokens/LinearProgressIndicatorTokens.kt y tokens/CircularProgressIndicatorTokens.kt
|
|
5
|
+
// (@76990c62ac): grosor 4, separación TrackActiveSpace = Space50 = 4, StopSize 4,
|
|
6
|
+
// LargeHeight 10, ActiveWaveAmplitude 3 (lineal) y 1,6 (circular), longitudes de onda 40 y 20
|
|
7
|
+
// (lineal) y 15 (circular), Size 40 y LargeSize 48 (circular);
|
|
8
|
+
// - WavyProgressIndicator.kt (@76990c62ac): indicatorAmplitude (onda solo entre 10 % y 95 %),
|
|
9
|
+
// velocidad de la onda (una longitud de onda por segundo), ProgressAnimationSpec;
|
|
10
|
+
// - internal/LinearWavyProgressModifiers.kt (@acea2f5c1f): el trazado de la onda (cuadráticas
|
|
11
|
+
// con el control a height - stroke del centro), los tramos y la separación, el punto final;
|
|
12
|
+
// - ProgressIndicator.kt (@080d2b3e53): los tiempos de los indeterminados.
|
|
13
|
+
// El grosor de 8 (con alto 14 en el lineal y 44/52 en el circular) sale del kit
|
|
14
|
+
// (docs/research/05-medidas.md) y de los ejemplos de Compose (ProgressIndicatorSamples.kt
|
|
15
|
+
// @acea2f5c1f: LinearThickWavyProgressIndicatorSample, CircularThickWavyProgressIndicatorSample).
|
|
16
|
+
// `value` acotado a [0, 1]; NaN cuenta como 0, como en LoadingIndicator.
|
|
17
|
+
export function clampProgress(value) {
|
|
18
|
+
return Number.isNaN(value) ? 0 : Math.min(1, Math.max(0, value));
|
|
19
|
+
}
|
|
20
|
+
// Distancia vertical del control de cada cuadrática al centro: height - stroke (10 - 4 y
|
|
21
|
+
// 14 - 8). La curva llega a la mitad: 3 dp, ActiveWaveAmplitude.
|
|
22
|
+
const WAVE_CONTROL = 6;
|
|
23
|
+
// Ancho máximo del lineal con onda. El trazado se precalcula (sin JavaScript en el navegador no
|
|
24
|
+
// se puede medir el ancho) y cubre este ancho más dos longitudes de onda de desplazamiento; más
|
|
25
|
+
// allá, el indicador se corta. 4096 px cubre una pantalla 4K a lo ancho.
|
|
26
|
+
export const LINEAR_MAX_WIDTH = 4096;
|
|
27
|
+
// Longitud de onda del lineal: determinado (ActiveWaveWavelength) e indeterminado.
|
|
28
|
+
export const LINEAR_WAVELENGTH = { determinate: 40, indeterminate: 20 };
|
|
29
|
+
// Trazado de la onda del lineal, en px, con el centro en y = 0: cuadráticas alternadas (la `t`
|
|
30
|
+
// de SVG refleja el control anterior), la primera hacia abajo, como fullProgressPath en
|
|
31
|
+
// LinearProgressDrawingCache.updateFullPaths.
|
|
32
|
+
export function linearWavePath(wavelength) {
|
|
33
|
+
const half = wavelength / 2;
|
|
34
|
+
const count = Math.ceil((LINEAR_MAX_WIDTH + 2 * wavelength) / half);
|
|
35
|
+
return `M0 0q${half / 2} ${WAVE_CONTROL} ${half} 0` + ` t${half} 0`.repeat(count - 1);
|
|
36
|
+
}
|
|
37
|
+
// El mismo largo, plano.
|
|
38
|
+
export const LINEAR_FLAT_PATH = `M0 0H${LINEAR_MAX_WIDTH + 2 * LINEAR_WAVELENGTH.determinate}`;
|
|
39
|
+
// Amplitud del determinado con onda (WavyProgressIndicatorDefaults.indicatorAmplitude): plana
|
|
40
|
+
// hasta el 10 % y desde el 95 %, entera en el medio. El cambio se anima en CSS.
|
|
41
|
+
export function hasWave(progress) {
|
|
42
|
+
return progress > 0.1 && progress < 0.95;
|
|
43
|
+
}
|
|
44
|
+
// Lado del circular (kit): plano 40 y 44, con onda 48 y 52, según el grosor.
|
|
45
|
+
export function circularSize(wavy, thickness) {
|
|
46
|
+
return (wavy ? 48 : 40) + (thickness === 8 ? 4 : 0);
|
|
47
|
+
}
|
|
48
|
+
// Radio del centro del trazo del circular plano: (40 - 4) / 2 = (44 - 8) / 2 = 18. El circular con
|
|
49
|
+
// onda usa los contornos de circular-wavy-data.ts.
|
|
50
|
+
export const CIRCULAR_FLAT_RADIUS = 18;
|
|
51
|
+
// Círculo de radio 18 centrado en el origen que empieza a las 12 y va en sentido horario.
|
|
52
|
+
export const CIRCULAR_FLAT_PATH = `M0 ${-CIRCULAR_FLAT_RADIUS}A${CIRCULAR_FLAT_RADIUS} ${CIRCULAR_FLAT_RADIUS} 0 1 1 0 ${CIRCULAR_FLAT_RADIUS}A${CIRCULAR_FLAT_RADIUS} ${CIRCULAR_FLAT_RADIUS} 0 1 1 0 ${-CIRCULAR_FLAT_RADIUS}Z`;
|
|
53
|
+
// Largo del círculo de radio 18.
|
|
54
|
+
export const CIRCULAR_FLAT_LENGTH = 2 * Math.PI * CIRCULAR_FLAT_RADIUS;
|
|
55
|
+
// Atributos ARIA del rol progressbar: sin aria-valuenow si es indeterminado (WAI-ARIA).
|
|
56
|
+
export function progressAria(progress) {
|
|
57
|
+
return progress === undefined
|
|
58
|
+
? {}
|
|
59
|
+
: { 'aria-valuemin': 0, 'aria-valuemax': 100, 'aria-valuenow': Math.round(progress * 100) };
|
|
60
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
export interface RadioButtonProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'children'> {
|
|
3
|
+
/** Text or content of the label; it is the accessible name. Clicking it also selects the radio. */
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/** Ref to the native `<input>`. */
|
|
6
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Material 3 radio button, on a native `<input type="radio">`: it works in forms, with the
|
|
10
|
+
* keyboard (arrows between the group's options, Space to select the focused one) and with screen
|
|
11
|
+
* readers, which announce the position in the group.
|
|
12
|
+
*
|
|
13
|
+
* Inside a `RadioGroup`, `value` is enough: the radio takes the `name` from the group and is
|
|
14
|
+
* selected when the group's value is its own (compared as text). Its own `checked`,
|
|
15
|
+
* `defaultChecked` or `name` win over the group, and its own `onChange` is called before the
|
|
16
|
+
* group's notification. Standalone, the input props pass through as they are. `className` and
|
|
17
|
+
* `style` go to the container (`<label>`).
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <RadioGroup defaultValue="pickup" aria-label="Delivery">
|
|
21
|
+
* <RadioButton value="pickup">Pick up in store</RadioButton>
|
|
22
|
+
* <RadioButton value="home">Home delivery</RadioButton>
|
|
23
|
+
* </RadioGroup>
|
|
24
|
+
* <RadioButton name="size" value="m" defaultChecked>Medium</RadioButton>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function RadioButton({ children, className, style, ref, name, value, checked, defaultChecked, required, onChange, onKeyDown, onFocus, onBlur, onPointerDown, ...inputProps }: RadioButtonProps): import("react").JSX.Element;
|