@astryxdesign/core 0.4.6 → 0.4.7-canary.29be96d
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 +35 -0
- package/dist/BottomSheet/BottomSheet.d.ts +1 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +54 -15
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts +6 -0
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts.map +1 -0
- package/dist/BottomSheet/BottomSheetEdgeTint.js +62 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +1 -0
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts +1 -0
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +10 -4
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +23 -5
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +5 -5
- package/dist/Calendar/Calendar.d.ts +3 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +13 -14
- package/dist/Calendar/getInitialFocusDate.d.ts +46 -0
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -0
- package/dist/Calendar/getInitialFocusDate.js +62 -0
- package/dist/Chat/ChatMessageList.d.ts +22 -3
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +6 -3
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +34 -1
- package/dist/Dialog/Dialog.d.ts +7 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +48 -22
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +6 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +10 -3
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.d.ts.map +1 -1
- package/dist/Markdown/parser.d.ts +38 -1
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +149 -23
- package/dist/MultiSelector/MultiSelector.d.ts +15 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +17 -6
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts.map +1 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +5 -0
- package/dist/Stepper/Step.d.ts +140 -0
- package/dist/Stepper/Step.d.ts.map +1 -0
- package/dist/Stepper/Step.js +1045 -0
- package/dist/Stepper/StepStatus.d.ts +24 -0
- package/dist/Stepper/StepStatus.d.ts.map +1 -0
- package/dist/Stepper/StepStatus.js +1 -0
- package/dist/Stepper/Stepper.d.ts +93 -0
- package/dist/Stepper/Stepper.d.ts.map +1 -0
- package/dist/Stepper/Stepper.js +184 -0
- package/dist/Stepper/StepperContext.d.ts +41 -0
- package/dist/Stepper/StepperContext.d.ts.map +1 -0
- package/dist/Stepper/StepperContext.js +34 -0
- package/dist/Stepper/index.d.ts +8 -0
- package/dist/Stepper/index.d.ts.map +1 -0
- package/dist/Stepper/index.js +7 -0
- package/dist/Stepper/stepper.stylex.d.ts +15 -0
- package/dist/Stepper/stepper.stylex.d.ts.map +1 -0
- package/dist/Stepper/stepper.stylex.js +20 -0
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +5 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +4 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +20 -8
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -1
- package/dist/Table/plugins/rowStatus/useTableRowStatus.js +10 -3
- package/dist/Table/plugins/selection/useTableSelection.d.ts +16 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +19 -5
- package/dist/Table/types.d.ts +22 -4
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -0
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +6 -2
- package/dist/astryx.css +41 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +10 -3
- package/dist/hooks/useListFocus.d.ts +5 -2
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +12 -6
- package/dist/hooks/useMergedRefs.d.ts +18 -0
- package/dist/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/hooks/useMergedRefs.js +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/utils/timeParser.d.ts +1 -1
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +26 -12
- package/locales/en.json +14 -6
- package/locales/pseudo.json +6 -0
- package/package.json +8 -3
- package/src/Avatar/Avatar.doc.mjs +2 -1
- package/src/BottomSheet/BottomSheet.test.tsx +123 -0
- package/src/BottomSheet/BottomSheet.tsx +36 -4
- package/src/BottomSheet/BottomSheetEdgeTint.test.tsx +225 -0
- package/src/BottomSheet/BottomSheetEdgeTint.tsx +82 -0
- package/src/BottomSheet/BottomSheetPanel.test.tsx +66 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +19 -0
- package/src/BottomSheet/BottomSheetSwitcher.tsx +13 -0
- package/src/BottomSheet/useSheetGestures.test.ts +27 -0
- package/src/BottomSheet/useSheetGestures.ts +25 -5
- package/src/Breadcrumbs/BreadcrumbItem.tsx +2 -1
- package/src/Button/Button.doc.mjs +22 -0
- package/src/Calendar/Calendar.doc.mjs +4 -3
- package/src/Calendar/Calendar.test.tsx +52 -0
- package/src/Calendar/Calendar.tsx +18 -15
- package/src/Calendar/getInitialFocusDate.test.ts +94 -0
- package/src/Calendar/getInitialFocusDate.ts +93 -0
- package/src/Chat/ChatMessageList.doc.mjs +9 -1
- package/src/Chat/ChatMessageList.test.tsx +46 -0
- package/src/Chat/ChatMessageList.tsx +28 -4
- package/src/CodeBlock/CodeBlock.doc.mjs +6 -0
- package/src/ContextMenu/ContextMenu.doc.mjs +5 -0
- package/src/DateInput/DateInputTouch.test.tsx +36 -0
- package/src/DateInput/TouchDateField.tsx +35 -1
- package/src/Dialog/Dialog.doc.mjs +8 -3
- package/src/Dialog/Dialog.test.tsx +71 -0
- package/src/Dialog/Dialog.tsx +72 -20
- package/src/Field/Field.doc.mjs +11 -0
- package/src/Heading/Heading.test.tsx +23 -1
- package/src/Heading/Heading.tsx +6 -2
- package/src/Kbd/Kbd.test.tsx +17 -0
- package/src/Kbd/Kbd.tsx +10 -3
- package/src/Link/Link.doc.mjs +11 -0
- package/src/Markdown/index.ts +1 -0
- package/src/Markdown/parser.perf.test.ts +71 -1
- package/src/Markdown/parser.test.ts +145 -2
- package/src/Markdown/parser.ts +208 -22
- package/src/MoreMenu/MoreMenu.doc.mjs +7 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +10 -0
- package/src/MultiSelector/MultiSelector.test.tsx +105 -0
- package/src/MultiSelector/MultiSelector.tsx +50 -6
- package/src/MultiSelector/index.ts +1 -0
- package/src/NumberInput/NumberInput.doc.mjs +5 -0
- package/src/Popover/Popover.test.tsx +27 -1
- package/src/PowerSearch/PowerSearch.doc.mjs +10 -0
- package/src/Selector/Selector.doc.mjs +11 -0
- package/src/Selector/Selector.test.tsx +21 -0
- package/src/Selector/Selector.tsx +11 -1
- package/src/Stepper/Step.doc.mjs +98 -0
- package/src/Stepper/Step.tsx +1638 -0
- package/src/Stepper/StepStatus.ts +26 -0
- package/src/Stepper/Stepper.doc.mjs +370 -0
- package/src/Stepper/Stepper.test.tsx +1024 -0
- package/src/Stepper/Stepper.tsx +258 -0
- package/src/Stepper/StepperContext.ts +71 -0
- package/src/Stepper/index.ts +18 -0
- package/src/Stepper/stepper.stylex.ts +19 -0
- package/src/TabList/Tab.tsx +5 -1
- package/src/TabList/TabList.test.tsx +21 -4
- package/src/Table/BaseTable.tsx +6 -3
- package/src/Table/Table.test.tsx +35 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows-perf.test.tsx +112 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +100 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +17 -8
- package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +13 -7
- package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +12 -3
- package/src/Table/plugins/selection/useTableSelection.test.tsx +76 -0
- package/src/Table/plugins/selection/useTableSelection.tsx +40 -7
- package/src/Table/types.ts +22 -4
- package/src/Table/useBaseTablePlugins.ts +5 -0
- package/src/Table/useTableGroupedRows.doc.mjs +5 -4
- package/src/Table/useTableRowStatus.doc.mjs +1 -1
- package/src/Table/useTableSelection.doc.mjs +31 -0
- package/src/Text/Text.test.tsx +23 -1
- package/src/Text/Text.tsx +6 -2
- package/src/TextInput/TextInput.doc.mjs +10 -0
- package/src/Toast/Toast.doc.mjs +6 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +10 -0
- package/src/Toolbar/Toolbar.doc.mjs +5 -0
- package/src/__tests__/apiContractDrift.test.tsx +80 -0
- package/src/__tests__/fieldContract.test.tsx +24 -0
- package/src/__tests__/structuralComponentContract.test.tsx +39 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useHotkeys.test.ts +18 -0
- package/src/hooks/useHotkeys.ts +10 -3
- package/src/hooks/useListFocus.doc.mjs +2 -2
- package/src/hooks/useListFocus.test.tsx +65 -3
- package/src/hooks/useListFocus.ts +15 -7
- package/src/hooks/useMergedRefs.doc.mjs +79 -0
- package/src/hooks/useMergedRefs.test.tsx +62 -0
- package/src/hooks/useMergedRefs.ts +36 -0
- package/src/index.ts +1 -0
- package/src/theme/MediaTheme.doc.mjs +5 -5
- package/src/utils/timeParser.test.ts +6 -1
- package/src/utils/timeParser.ts +35 -13
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Step.tsx
|
|
3
|
+
* @input Uses React, stylex, theme tokens (including the motion duration token
|
|
4
|
+
* the connector fill animates on), StepperContext
|
|
5
|
+
* @output Exports Step component and StepProps
|
|
6
|
+
* @position Individual step item; used inside Stepper
|
|
7
|
+
*
|
|
8
|
+
* Every connector this file draws — the separated progress bars and the
|
|
9
|
+
* on-track segments alike — paints its accent fill as a scaled ::before rather
|
|
10
|
+
* than by swapping a background color, so a step the flow advances into grows
|
|
11
|
+
* its line along the track. See the CONNECTOR FILL block in the styles below
|
|
12
|
+
* for the axis/RTL/reduced-motion rules that go with it.
|
|
13
|
+
*
|
|
14
|
+
* Exactly one change animates: advancing a single step. Going back, jumping
|
|
15
|
+
* forward by more than one, and mounting mid-flow all land at once. The rule
|
|
16
|
+
* and the reasoning behind it sit above the styles; the arithmetic that keeps
|
|
17
|
+
* the one animated span reading as a single front — an on-track span is drawn
|
|
18
|
+
* by two steps, three where a content slot splits it — is in the component.
|
|
19
|
+
* Nothing about it is public API: Stepper hands each Step the step it came
|
|
20
|
+
* from through context, and the rest is derived.
|
|
21
|
+
*
|
|
22
|
+
* SYNC: When modified, update these files to stay in sync:
|
|
23
|
+
* - /packages/core/src/Stepper/Stepper.doc.mjs
|
|
24
|
+
* - /packages/core/src/Stepper/Stepper.test.tsx
|
|
25
|
+
* - /packages/core/src/Stepper/index.ts
|
|
26
|
+
* - /apps/storybook/stories/Stepper.stories.tsx
|
|
27
|
+
* - /packages/cli/assets/templates/blocks/components/Stepper/ (showcase blocks)
|
|
28
|
+
* - /packages/cli/assets/templates/blocks/components/Step/ (showcase blocks)
|
|
29
|
+
*/
|
|
30
|
+
import { type ReactNode } from 'react';
|
|
31
|
+
import type { BaseProps } from '../BaseProps';
|
|
32
|
+
import type { StepStatus } from './StepStatus';
|
|
33
|
+
/**
|
|
34
|
+
* Built-in indicator presets. Anything other than these strings passed to
|
|
35
|
+
* `indicator` is treated as a custom ReactNode (e.g. an `<Icon />`).
|
|
36
|
+
* - 'auto': numbered badge for not-yet-reached steps, a check once completed
|
|
37
|
+
* (default)
|
|
38
|
+
* - 'number': always a numbered badge
|
|
39
|
+
* - 'none': no indicator — just the progress bar and label
|
|
40
|
+
*/
|
|
41
|
+
export type StepIndicatorPreset = 'auto' | 'number' | 'none';
|
|
42
|
+
export type StepDensity = 'compact' | 'balanced' | 'spacious';
|
|
43
|
+
export interface StepProps extends BaseProps<HTMLLIElement> {
|
|
44
|
+
/** Ref forwarded to the root element */
|
|
45
|
+
ref?: React.Ref<HTMLLIElement>;
|
|
46
|
+
/**
|
|
47
|
+
* Zero-based index of this step. Used to derive progress (completed /
|
|
48
|
+
* active / not-started) relative to the parent's `activeStep`.
|
|
49
|
+
*/
|
|
50
|
+
step: number;
|
|
51
|
+
/**
|
|
52
|
+
* Step label text.
|
|
53
|
+
*/
|
|
54
|
+
label: string;
|
|
55
|
+
/**
|
|
56
|
+
* Optional description shown below the label.
|
|
57
|
+
*/
|
|
58
|
+
description?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Content rendered below the label and description. Useful in vertical
|
|
61
|
+
* steppers to show form fields or detailed content for each step.
|
|
62
|
+
*/
|
|
63
|
+
children?: ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* Semantic status for the step, mapped to the global Astryx semantic tokens
|
|
66
|
+
* (`accent`, `success`, `warning`, `error`). In the default `auto` indicator
|
|
67
|
+
* mode it sets both the indicator color and a matching glyph: `success` shows
|
|
68
|
+
* a green check-circle, `warning`/`error` show the shared Input status icons.
|
|
69
|
+
* `accent` is color-only. The current (in-progress) step always keeps its
|
|
70
|
+
* current-step indicator regardless of `status`. Never recolors the
|
|
71
|
+
* connector/track.
|
|
72
|
+
*
|
|
73
|
+
* Because the indicator glyphs are decorative (aria-hidden), the status also
|
|
74
|
+
* reaches assistive technology as text: visually hidden "completed" /
|
|
75
|
+
* "warning" / "error" next to the label, and composed into the accessible
|
|
76
|
+
* name of clickable steps.
|
|
77
|
+
*/
|
|
78
|
+
status?: StepStatus;
|
|
79
|
+
/**
|
|
80
|
+
* Disable interaction for this step.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
isDisabled?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Marks the step as optional, appending an "Optional" affordance after the
|
|
86
|
+
* label.
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
isOptional?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Trailing content rendered at the end of the label row (e.g. a timestamp
|
|
92
|
+
* or status chip).
|
|
93
|
+
*/
|
|
94
|
+
endContent?: ReactNode;
|
|
95
|
+
/**
|
|
96
|
+
* What to show as the step indicator. Accepts a preset string or any
|
|
97
|
+
* ReactNode:
|
|
98
|
+
* - 'auto': numbered badge until completed, then a check (default)
|
|
99
|
+
* - 'number': always a numbered badge
|
|
100
|
+
* - 'none': no indicator, just the bar + label
|
|
101
|
+
* - ReactNode: any custom icon or element to render as the indicator
|
|
102
|
+
* @default 'auto'
|
|
103
|
+
*/
|
|
104
|
+
indicator?: StepIndicatorPreset | ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* Controls vertical padding of the step. Falls back to the stepper-level
|
|
107
|
+
* density when unset.
|
|
108
|
+
* - 'compact': minimal padding (4px block)
|
|
109
|
+
* - 'balanced': default (8px block)
|
|
110
|
+
* - 'spacious': generous (12px block, 12px inline)
|
|
111
|
+
*/
|
|
112
|
+
density?: StepDensity;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* An individual step within an Stepper. Renders a 4px progress-bar segment,
|
|
116
|
+
* an indicator (numbered badge, check, or any custom icon), a label with
|
|
117
|
+
* optional description, and an optional content slot.
|
|
118
|
+
*
|
|
119
|
+
* Progress (completed / active / not-started) is derived from the parent's
|
|
120
|
+
* `activeStep` and this step's `step` prop. The optional `status` prop layers a
|
|
121
|
+
* semantic meaning on top: in the default `auto` indicator mode it recolors the
|
|
122
|
+
* indicator and swaps in a matching glyph (`success` → green check-circle,
|
|
123
|
+
* `warning`/`error` → the shared Input status icons). The current step always
|
|
124
|
+
* keeps its current-step ring. `status` never recolors the connector/track.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```
|
|
128
|
+
* <Step step={0} label="Account details" description="Enter your email" />
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```
|
|
133
|
+
* <Step step={1} label="Payment" status="error" />
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
export declare function Step({ step, label, description, children, status, isDisabled, isOptional, endContent, indicator: indicatorProp, density: densityProp, xstyle, className, style, ref, 'data-testid': dataTestId, ...rest }: StepProps): import("react").JSX.Element;
|
|
137
|
+
export declare namespace Step {
|
|
138
|
+
var displayName: string;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=Step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../src/Stepper/Step.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAY,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAmBhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAM5C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,aAAa,CAAC;IACzD,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC5C;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AA4tBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,UAAkB,EAClB,UAAkB,EAClB,UAAU,EACV,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,WAAW,EACpB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,aAAa,EAAE,UAAU,EACzB,GAAG,IAAI,EACR,EAAE,SAAS,+BAitBX;yBAluBe,IAAI"}
|