@astryxdesign/core 0.6.2-canary.fc74d7e → 0.6.3-canary.01fa439
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 +81 -0
- package/dist/Chat/ChatComposerDrawer.d.ts +12 -4
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +19 -14
- package/dist/Dialog/DialogHeader.d.ts +8 -1
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +10 -1
- package/dist/Field/InputClearButton.d.ts +4 -2
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +4 -2
- package/dist/Selector/Selector.d.ts +9 -7
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +6 -4
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +14 -4
- package/dist/ToggleButton/ToggleButton.d.ts +7 -5
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +8 -26
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +3 -0
- package/dist/TreeList/TreeListItem.d.ts +6 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +12 -2
- package/dist/TreeList/TreeListTypes.d.ts +8 -1
- package/dist/TreeList/TreeListTypes.d.ts.map +1 -1
- package/dist/astryx.css +1 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +10 -0
- package/locales/af-ZA.json +530 -1
- package/locales/ar-SA.json +490 -1
- package/locales/ca-ES.json +514 -1
- package/locales/cs-CZ.json +498 -1
- package/locales/da-DK.json +522 -1
- package/locales/de-DE.json +522 -1
- package/locales/el-GR.json +498 -1
- package/locales/es-ES.json +510 -1
- package/locales/fi-FI.json +498 -1
- package/locales/fr-FR.json +534 -1
- package/locales/he-IL.json +498 -1
- package/locales/hu-HU.json +498 -1
- package/locales/it-IT.json +510 -1
- package/locales/ja-JP.json +490 -1
- package/locales/ko-KR.json +498 -1
- package/locales/nl-NL.json +534 -1
- package/locales/no-NO.json +510 -1
- package/locales/pl-PL.json +506 -1
- package/locales/pt-BR.json +506 -1
- package/locales/pt-PT.json +506 -1
- package/locales/ro-RO.json +506 -1
- package/locales/ru-RU.json +498 -1
- package/locales/sr-SP.json +498 -1
- package/locales/sv-SE.json +502 -1
- package/locales/tr-TR.json +498 -1
- package/locales/uk-UA.json +498 -1
- package/locales/vi-VN.json +502 -1
- package/locales/zh-CN.json +490 -1
- package/locales/zh-TW.json +490 -1
- package/package.json +3 -3
- package/src/Chat/ChatComposerDrawer.doc.mjs +12 -5
- package/src/Chat/ChatComposerDrawer.spec.md +176 -72
- package/src/Chat/ChatComposerDrawer.test.tsx +46 -0
- package/src/Chat/ChatComposerDrawer.tsx +25 -7
- package/src/Dialog/DialogHeader.doc.mjs +12 -0
- package/src/Dialog/DialogHeader.test.tsx +97 -0
- package/src/Dialog/DialogHeader.tsx +25 -3
- package/src/Dialog/modules/DialogHeader.spec.md +75 -38
- package/src/Field/InputClearButton.test.tsx +17 -3
- package/src/Field/InputClearButton.tsx +5 -2
- package/src/Selector/Selector.doc.mjs +2 -2
- package/src/Selector/Selector.spec.md +49 -50
- package/src/Selector/Selector.test.tsx +61 -55
- package/src/Selector/Selector.tsx +17 -13
- package/src/Slider/Slider.doc.mjs +6 -3
- package/src/Slider/Slider.test.tsx +94 -1
- package/src/Slider/Slider.tsx +15 -2
- package/src/ToggleButton/ToggleButton.doc.mjs +3 -3
- package/src/ToggleButton/ToggleButton.test.tsx +166 -4
- package/src/ToggleButton/ToggleButton.tsx +17 -31
- package/src/ToggleButton/ToggleButtonGroup.doc.mjs +3 -3
- package/src/TreeList/TreeList.doc.mjs +3 -3
- package/src/TreeList/TreeList.test.tsx +29 -0
- package/src/TreeList/TreeList.tsx +3 -0
- package/src/TreeList/TreeListItem.tsx +15 -1
- package/src/TreeList/TreeListTypes.ts +11 -1
- package/src/tailwind-theme.css +0 -6
- package/src/theme/generateThemeRules.test.ts +30 -0
- package/src/theme/generateThemeRules.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,86 @@
|
|
|
1
1
|
# @xds/core
|
|
2
2
|
|
|
3
|
+
# 0.6.3
|
|
4
|
+
|
|
5
|
+
#### New Features
|
|
6
|
+
|
|
7
|
+
- Show each shared InputClearButton's contextual action label in a tooltip. Clearable inputs now give sighted users the same specific action name already available to assistive technology. (#6354)
|
|
8
|
+
- ChatComposerDrawer: add a `collapsedSummary` composition slot that replaces the complete Collapsed summary anatomy part when provided. Omitting it preserves the existing neutral Badge and label. (#5399)
|
|
9
|
+
- DialogHeader: add end-content edge compensation control (#6465)
|
|
10
|
+
DialogHeader now accepts `endContentEdgeCompensation="inline" | "block" | "all"` to select which axes of its existing end-content wrapper receive fixed compensation. Omitting the prop preserves the current automatic compensation whenever the close action renders.
|
|
11
|
+
- Markdown: add native typed frontmatter metadata (#6381)
|
|
12
|
+
Use `createMarkdownFrontmatter()` from `@astryxdesign/core/Markdown/plugins` to decode a document-start key/value block into typed metadata, keep unfinished streaming metadata hidden, and remove completed metadata syntax from rendered Markdown.
|
|
13
|
+
- Markdown: add the core plugin protocol (#6340)
|
|
14
|
+
Use `createMarkdownPlugin()` and Markdown's `plugins` prop to compose bounded source syntax, immutable typed AST transforms, and extension renderers. Import `parseMarkdownAst()` or `parseInlineAst()` from `@astryxdesign/core/Markdown/parser` when server code needs the canonical tree. The same ordered plugins work with parser entry points and Markdown-derived Outline items, while omitted or empty plugin lists preserve existing behavior.
|
|
15
|
+
- Markdown: add a limited Remark compatibility adapter (#6345)
|
|
16
|
+
Import `createMarkdownRemarkTransform()` from `@astryxdesign/core/Markdown/remark` to run one synchronous transform-only Remark plugin over the documented MDAST subset. Every invocation gets a fresh mutable tree and an isolated file, and each plugin's compatibility is proven by fixtures rather than assumed: async work, parser or compiler plugins, processor state, raw HTML, unsupported nodes, forged positions, and metadata Astryx cannot represent keep the last valid readable document and report one diagnostic. The adapter is a separate entry point, so it stays out of every bundle that does not import it.
|
|
17
|
+
- Markdown: add a semantic code-fence transform helper (#6343)
|
|
18
|
+
Use `createMarkdownFenceTransform()` to annotate declared fenced-code languages with typed extension data while standard plugin `renderers` own presentation and text projection. `components.code` retains precedence, and declined, missing, or failed proposals preserve Markdown's accessible, copyable `CodeBlock` fallback.
|
|
19
|
+
- Markdown: add an immutable source-decoration helper (#6344)
|
|
20
|
+
Use `createMarkdownSourceDecoration()` to attach non-visual metadata to every block a validated UTF-16 source range touches, and `getMarkdownSourceDecorations()` to read it back in a later plugin. It works through `<Markdown>` and Outline with no extra parser options, resolves independently of the order earlier transforms left blocks in, and appears on the settled document rather than on partial streaming chunks, so a decoration never appears and then vanishes. Metadata lives in one versioned Astryx-owned envelope that never merges foreign node data. Rendered output, copyable text, accessible names, heading ids, focus order, navigation, and source provenance are unchanged.
|
|
21
|
+
|
|
22
|
+
Markdown transforms also got faster, and a plugin now always observes a fully immutable tree — including blocks a Core helper carried over untouched. Core-authored helpers now validate the nodes a caller's callback produced and run on a trusted path that skips the whole-tree validation and freezing applied to plugin-authored output, freezing walks only what a transform changed, a plugin list that contributes no inline syntax no longer costs anything per source character, and the helpers' per-match allocations and rebuilds are gone. The representative three-helper set now adds about 20 percent over an empty pipeline, inside its 25 percent budget, down from roughly 3.3x.
|
|
23
|
+
|
|
24
|
+
- Markdown: add an immutable text-transform helper (#6342)
|
|
25
|
+
Use `createMarkdownTextTransform()` to replace matching prose with typed Markdown nodes while preserving links, images, code, math, citations, and existing extension syntax as protected contexts.
|
|
26
|
+
- Add pressed feedback to CheckboxInput, Collapsible, Link, Slider, Switch, TabList, RadioList, and unselected SegmentedControl items. Enabled controls paint `--color-overlay-pressed` on their interaction surface during pointer hold or drag; disabled controls and selected SegmentedControl items keep their existing surfaces. (#6380)
|
|
27
|
+
- Let a TreeList item carry row styles (#6238)
|
|
28
|
+
`TreeListItemData` gains `xstyle`, `className`, and `style`, applied to the item's row element, as the TreeList contract's per-item styling seam requires.
|
|
29
|
+
|
|
30
|
+
`TreeList` takes rows as data, so nothing previously handed back the row's element. That prevents row-scoped primitives such as `useContainerReveal` from installing the class and inline custom properties that jointly isolate each row's hover and focus state; applying the reveal to the whole tree would expose every row action at once.
|
|
31
|
+
|
|
32
|
+
`Item` already accepts the same row styling props, so a list converting to a tree keeps its reveal wiring instead of having to mark the whole tree.
|
|
33
|
+
|
|
34
|
+
#### Fixes
|
|
35
|
+
|
|
36
|
+
- Make overflowing BottomSheet text keyboard reachable with a named scroll-body tab stop. Add shared focus-time keyboard delegation to `useScrollableArea`: forward Tab may enter the first native link/button directly, while inputs, composite widgets, and nested scroll owners retain the viewport stop. Reverse traversal skips the delegated viewport; pointer/programmatic focus and content changes never trigger delegation. Sheet scroll containment now applies only while content overflows and uses the shared `contain` policy, which permits native edge feedback. (#6301)
|
|
37
|
+
- Keep ChatComposer's public composition contracts aligned: custom inputs now submit the value they supply, disabled default editors expose their state to assistive technology, and an explicitly shown Stop action remains pointer-operable while editing is disabled. (#6398)
|
|
38
|
+
- Keep collapsed `ChatComposerDrawer` content out of keyboard and assistive-technology navigation, and show the shared focus indicator on its disclosure control. (#6416)
|
|
39
|
+
- Keep programmatic ChatComposerInput edits observable, deliver dropped files through `onFiles`, and let `onPaste` intercept text before default token conversion. (#6419)
|
|
40
|
+
- Export `ChatComposerTokenElementProps` and forward supported span props and refs from `ChatComposerTokenElement` (#6443).
|
|
41
|
+
- Keep the chat dictation control disabled when speech recognition is unavailable, and preserve theme control over its clipping feedback (#6444).
|
|
42
|
+
- Clip the resizable SideNav handle within the sidebar bounds (#6196)
|
|
43
|
+
- scope the 16px text-control font-size floor to iOS with `@supports (-webkit-touch-callout: none)` inside the coarse-pointer query, so Android and touch-screen laptops keep the theme's type scale instead of an inflated 16px (#6085; fixes #6015)
|
|
44
|
+
- Kbd: render the `esc` and `return` aliases with the same glyphs and accessible names as `escape` and `enter` (#5657)
|
|
45
|
+
This partial fix for #5403 normalizes the two unambiguous aliases already accepted by `useHotkeys`. Kbd now renders `esc` as `Esc` with the accessible name `Escape`, and `return` as `↵` with the accessible name `Enter`. Its lookup tables now also avoid prototype-chain collisions when rendering arbitrary key names. The platform-specific rendering contract for `meta` and display choice for `space` remain unresolved in #5403 pending separate API and design decisions.
|
|
46
|
+
- LayoutFooter: add playground wrapper and default children for docsite preview (#6341)
|
|
47
|
+
Prevents the properties-tab preview on the docsite from rendering an empty stage by wrapping LayoutFooter inside a Layout scaffold with representative footer content in the footer slot.
|
|
48
|
+
- PowerSearch: switching the field or operator while the value menu is open now shows the new field's options instead of the old ones. (#6357)
|
|
49
|
+
- Move focusable ProgressBar target marks outside the `progressbar` subtree (#6248)
|
|
50
|
+
- Selector: collapse an option's mark column when its resolved selection indicator renders nothing. (#5619)
|
|
51
|
+
Unselected rows using the default check indicator no longer lose label width to an empty wrapper. Selected marks and themed indicators that render an unselected state keep their space at the configured logical edge.
|
|
52
|
+
- Slider marks inside the filled region use the fill color: marks at or behind the thumb in single mode, and marks between the thumbs in range mode, now paint with the accent fill color instead of the default mark color. Marks on the unfilled side are unchanged. (#6455)
|
|
53
|
+
- Slider uses the track token for unfilled tick marks so marks and rails stay aligned across themes (#6461)
|
|
54
|
+
- Spinner: animate the arc's dash offset instead of rotating the ring, fixing residual wobble on iOS Safari (#6311; fixes #6253)
|
|
55
|
+
The earlier fix for #3617 added `willChange: 'transform'` to the rotating `<svg>`, which smooths the rotation's motion but does nothing about how WebKit rasterizes a rotating stroked shape's rounded cap on each frame. Rotating the whole ring still visibly wobbled on iOS Safari.
|
|
56
|
+
|
|
57
|
+
Animates `stroke-dashoffset` on the stationary arc `<circle>` instead of rotating the `<svg>`, so the shape never rotates and WebKit never re-rasterizes the cap at an intermediate angle. Confirmed against a real iOS Safari device by the issue reporter.
|
|
58
|
+
|
|
59
|
+
- Table: contain overscroll only while its inner viewport can scroll, so a fitting table no longer creates a dead scroll zone in its parent. (#6410)
|
|
60
|
+
- Apply the theme's body font to the theme scope root. Generated theme CSS set `font-family` on headings, paragraphs, and code elements but never established a base font on the page, so components styled with `font-family: inherit` (SideNav items, Buttons) fell back to the browser default serif. The generator now emits `font-family: var(--font-family-body)` on `:scope`, which inherits through the tree. (#6450)
|
|
61
|
+
- Keep ToggleButton callbacks synchronous and run pressed Actions through Button’s clickAction pathway, preserving callback cancellation and optimistic pending feedback. Omit the Action pathway for callback-only toggles and value-identified ToggleButtonGroup members, whose selection remains group-owned. (#6463)
|
|
62
|
+
- Keep a ToggleButton's own `isDisabled` when its ToggleButtonGroup does not disable anything. The group always supplies an `isDisabled` boolean, so the previous `??` fallback never ran and an enabled group re-enabled a member that had disabled itself — the member selected on click, and a member carrying a `tooltip` stayed operable while looking unavailable. A disabled group still disables every member; it just cannot re-enable one. (#6356)
|
|
63
|
+
|
|
64
|
+
#### Contributors
|
|
65
|
+
|
|
66
|
+
Thanks to everyone who contributed to this release:
|
|
67
|
+
|
|
68
|
+
- @aldentan
|
|
69
|
+
- @athz
|
|
70
|
+
- @cixzhang
|
|
71
|
+
- @ernestt
|
|
72
|
+
- @harjothkhara
|
|
73
|
+
- @HelloOjasMutreja
|
|
74
|
+
- @jiunshinn
|
|
75
|
+
- @kentonquatman
|
|
76
|
+
- @korkt-kim
|
|
77
|
+
- @ManoharPaturi
|
|
78
|
+
- @nynexman4464
|
|
79
|
+
- @rupesh-kumar-sah
|
|
80
|
+
- @vjeux
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
3
84
|
# 0.6.2
|
|
4
85
|
|
|
5
86
|
#### New Features
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @input Uses React, StyleX, theme tokens
|
|
4
4
|
* @output Exports ChatComposerDrawer component
|
|
5
5
|
* @position Collapsible drawer panel for ChatComposer.
|
|
6
|
-
* Supports expanded (full content) and collapsed (
|
|
7
|
-
* with fade animation and grid-template-rows height transition.
|
|
6
|
+
* Supports expanded (full content) and collapsed (default or caller-composed
|
|
7
|
+
* summary) states with fade animation and grid-template-rows height transition.
|
|
8
8
|
* The collapse toggle exposes aria-expanded + aria-controls linking it to
|
|
9
9
|
* the content region (disclosure pattern).
|
|
10
10
|
*
|
|
@@ -31,10 +31,18 @@ export interface ChatComposerDrawerProps extends BaseProps<HTMLDivElement> {
|
|
|
31
31
|
*/
|
|
32
32
|
count?: number;
|
|
33
33
|
/**
|
|
34
|
-
* Label shown next to the count in collapsed
|
|
34
|
+
* Label shown next to the count in the default collapsed summary and used to
|
|
35
|
+
* name the expand/collapse action.
|
|
35
36
|
* @default 'Items'
|
|
36
37
|
*/
|
|
37
38
|
label?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Visual content for the canonical Collapsed summary anatomy part. Replaces
|
|
41
|
+
* the complete default Badge and label when count enables collapse. The
|
|
42
|
+
* component keeps this content presentation-only and owns disclosure
|
|
43
|
+
* semantics and accessible naming.
|
|
44
|
+
*/
|
|
45
|
+
collapsedSummary?: ReactNode;
|
|
38
46
|
/**
|
|
39
47
|
* Whether the drawer is collapsed.
|
|
40
48
|
* Uncontrolled by default (internal toggle).
|
|
@@ -78,7 +86,7 @@ export interface ChatComposerDrawerProps extends BaseProps<HTMLDivElement> {
|
|
|
78
86
|
* </ChatComposerDrawer>
|
|
79
87
|
* ```
|
|
80
88
|
*/
|
|
81
|
-
export declare function ChatComposerDrawer({ ref, children, count, label: labelFromProps, isCollapsed: controlledCollapsed, defaultIsCollapsed, onCollapsedChange, xstyle, className, style, 'data-testid': testId, ...htmlProps }: ChatComposerDrawerProps): React.ReactElement;
|
|
89
|
+
export declare function ChatComposerDrawer({ ref, children, count, label: labelFromProps, collapsedSummary, isCollapsed: controlledCollapsed, defaultIsCollapsed, onCollapsedChange, xstyle, className, style, 'data-testid': testId, ...htmlProps }: ChatComposerDrawerProps): React.ReactElement;
|
|
82
90
|
export declare namespace ChatComposerDrawer {
|
|
83
91
|
var displayName: string;
|
|
84
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposerDrawer.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposerDrawer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAkB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAYnD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAK5C,MAAM,WAAW,uBAAwB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACxE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf
|
|
1
|
+
{"version":3,"file":"ChatComposerDrawer.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposerDrawer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAkB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAYnD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAK5C,MAAM,WAAW,uBAAwB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACxE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnD;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAoID;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,GAAG,EACH,QAAQ,EACR,KAAK,EACL,KAAK,EAAE,cAAc,EACrB,gBAAgB,EAChB,WAAW,EAAE,mBAAmB,EAChC,kBAA0B,EAC1B,iBAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,SAAS,EACb,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAyG9C;yBAvHe,kBAAkB"}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @input Uses React, StyleX, theme tokens
|
|
8
8
|
* @output Exports ChatComposerDrawer component
|
|
9
9
|
* @position Collapsible drawer panel for ChatComposer.
|
|
10
|
-
* Supports expanded (full content) and collapsed (
|
|
11
|
-
* with fade animation and grid-template-rows height transition.
|
|
10
|
+
* Supports expanded (full content) and collapsed (default or caller-composed
|
|
11
|
+
* summary) states with fade animation and grid-template-rows height transition.
|
|
12
12
|
* The collapse toggle exposes aria-expanded + aria-controls linking it to
|
|
13
13
|
* the content region (disclosure pattern).
|
|
14
14
|
*
|
|
@@ -29,7 +29,7 @@ import { mergeProps } from "../utils/index.js";
|
|
|
29
29
|
import { themeProps } from "../utils/themeProps.js";
|
|
30
30
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
31
31
|
import { useTranslator } from "../i18n/index.js";
|
|
32
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
33
|
const styles = {
|
|
34
34
|
root: {
|
|
35
35
|
kVAEAm: "x1n2onr6",
|
|
@@ -80,6 +80,7 @@ export function ChatComposerDrawer({
|
|
|
80
80
|
children,
|
|
81
81
|
count,
|
|
82
82
|
label: labelFromProps,
|
|
83
|
+
collapsedSummary,
|
|
83
84
|
isCollapsed: controlledCollapsed,
|
|
84
85
|
defaultIsCollapsed = false,
|
|
85
86
|
onCollapsedChange,
|
|
@@ -136,24 +137,28 @@ export function ChatComposerDrawer({
|
|
|
136
137
|
toggle();
|
|
137
138
|
}
|
|
138
139
|
},
|
|
139
|
-
children: [/*#__PURE__*/
|
|
140
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
inert: true,
|
|
140
143
|
...{
|
|
141
144
|
0: {
|
|
142
|
-
className: "x1ms6mhf xgkxs2y x1lqcxt8 x3nfvp2 x6s0dn4 x1grt7ep x1txdalj xjspbzw x1hc1fzr x19991ni xuedmi6 xlr8y92"
|
|
145
|
+
className: "x1ms6mhf xgkxs2y x1lqcxt8 x3nfvp2 x6s0dn4 x47corl x1grt7ep x1txdalj xjspbzw x1hc1fzr x19991ni xuedmi6 xlr8y92"
|
|
143
146
|
},
|
|
144
147
|
1: {
|
|
145
148
|
className: "x1ms6mhf xgkxs2y x1lqcxt8 x3nfvp2 x6s0dn4 x1grt7ep x1txdalj xjspbzw x19991ni xuedmi6 xlr8y92 xg01cxk x47corl"
|
|
146
149
|
}
|
|
147
150
|
}[!!!isCollapsed << 0],
|
|
148
|
-
children:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
children: collapsedSummary === undefined ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
152
|
+
children: [/*#__PURE__*/_jsx(Badge, {
|
|
153
|
+
variant: "neutral",
|
|
154
|
+
label: count
|
|
155
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
156
|
+
...{
|
|
157
|
+
className: "xv1l7n4 x1t9gxa6 xjm74w1 x7acx1w xt3l3uh xuedmi6 xlr8y92"
|
|
158
|
+
},
|
|
159
|
+
children: label
|
|
160
|
+
})]
|
|
161
|
+
}) : collapsedSummary
|
|
157
162
|
}), /*#__PURE__*/_jsx("div", {
|
|
158
163
|
...{
|
|
159
164
|
0: {
|
|
@@ -41,6 +41,13 @@ export interface DialogHeaderProps extends BaseProps<HTMLDivElement> {
|
|
|
41
41
|
* Content to render after the title, before the close button (e.g., action buttons).
|
|
42
42
|
*/
|
|
43
43
|
endContent?: ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Overrides automatic end-slot compensation. When omitted, the slot keeps its
|
|
46
|
+
* existing behavior: rendering the close action applies block and logical
|
|
47
|
+
* inline-end compensation. Use `inline`, `block`, or `all` to select the axes
|
|
48
|
+
* explicitly.
|
|
49
|
+
*/
|
|
50
|
+
endContentEdgeCompensation?: 'inline' | 'block' | 'all';
|
|
44
51
|
/**
|
|
45
52
|
* Adds a themed border at the bottom edge.
|
|
46
53
|
* When false, spacing collapse is applied automatically for seamless visual flow.
|
|
@@ -70,7 +77,7 @@ export interface DialogHeaderProps extends BaseProps<HTMLDivElement> {
|
|
|
70
77
|
* </Dialog>
|
|
71
78
|
* ```
|
|
72
79
|
*/
|
|
73
|
-
export declare function DialogHeader({ title, subtitle, onOpenChange, startContent, endContent, hasDivider, xstyle, className, style, ref, ...rest }: DialogHeaderProps): import("react").JSX.Element;
|
|
80
|
+
export declare function DialogHeader({ title, subtitle, onOpenChange, startContent, endContent, endContentEdgeCompensation, hasDivider, xstyle, className, style, ref, ...rest }: DialogHeaderProps): import("react").JSX.Element;
|
|
74
81
|
export declare namespace DialogHeader {
|
|
75
82
|
var displayName: string;
|
|
76
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogHeader.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogHeader.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQxD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DialogHeader.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogHeader.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQxD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA2C5C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAClE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE5C;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;IAExD;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,0BAA0B,EAC1B,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,iBAAiB,+BA8FnB;yBA3Ge,YAAY"}
|
|
@@ -63,6 +63,7 @@ export function DialogHeader({
|
|
|
63
63
|
onOpenChange,
|
|
64
64
|
startContent,
|
|
65
65
|
endContent,
|
|
66
|
+
endContentEdgeCompensation,
|
|
66
67
|
hasDivider,
|
|
67
68
|
xstyle,
|
|
68
69
|
className,
|
|
@@ -75,6 +76,8 @@ export function DialogHeader({
|
|
|
75
76
|
const dialogContext = useDialogContext();
|
|
76
77
|
const shouldAutoFocus = dialogContext?.isInline !== true;
|
|
77
78
|
const titleId = dialogContext?.titleId;
|
|
79
|
+
const shouldCompensateEndBlock = endContentEdgeCompensation == null ? onOpenChange != null : endContentEdgeCompensation === 'block' || endContentEdgeCompensation === 'all';
|
|
80
|
+
const shouldCompensateEndInline = endContentEdgeCompensation == null ? onOpenChange != null : endContentEdgeCompensation === 'inline' || endContentEdgeCompensation === 'all';
|
|
78
81
|
|
|
79
82
|
// Auto-focus the title when mounted for screen reader accessibility.
|
|
80
83
|
// Inline dialogs are documentation/showcase previews, so suppress focus to
|
|
@@ -124,10 +127,16 @@ export function DialogHeader({
|
|
|
124
127
|
0: {
|
|
125
128
|
className: "x78zum5 x6s0dn4 x1txdalj x2lah0s"
|
|
126
129
|
},
|
|
130
|
+
2: {
|
|
131
|
+
className: "x78zum5 x6s0dn4 x1txdalj x2lah0s xhzvc8f"
|
|
132
|
+
},
|
|
127
133
|
1: {
|
|
134
|
+
className: "x78zum5 x6s0dn4 x1txdalj x2lah0s x3kzqx6"
|
|
135
|
+
},
|
|
136
|
+
3: {
|
|
128
137
|
className: "x78zum5 x6s0dn4 x1txdalj x2lah0s xhzvc8f x3kzqx6"
|
|
129
138
|
}
|
|
130
|
-
}[!!
|
|
139
|
+
}[!!shouldCompensateEndBlock << 1 | !!shouldCompensateEndInline << 0],
|
|
131
140
|
children: [endContent, onOpenChange && /*#__PURE__*/_jsx(Button, {
|
|
132
141
|
variant: "ghost",
|
|
133
142
|
label: t('@astryx.dialog.close'),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file InputClearButton.tsx
|
|
3
|
-
* @input Uses React, Button, Icon
|
|
4
|
-
* @output Exports the public InputClearButton and an internal popup-aware variant
|
|
3
|
+
* @input Uses React, Button, and Icon
|
|
4
|
+
* @output Exports the public InputClearButton and an internal popup-aware variant,
|
|
5
|
+
* both with a contextual tooltip matching their required label.
|
|
5
6
|
* @position Shared primitive. Every input that renders a clear affordance —
|
|
6
7
|
* TextInput, NumberInput, TimeInput, DateInput, DateTimeInput,
|
|
7
8
|
* DateRangeInput, Selector, MultiSelector, Typeahead, Tokenizer, FileInput —
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
import type { ReactNode } from 'react';
|
|
13
14
|
import * as stylex from '@stylexjs/stylex';
|
|
14
15
|
export interface InputClearButtonProps {
|
|
16
|
+
/** Contextual accessible name for the button, such as "Clear Search". */
|
|
15
17
|
label: string;
|
|
16
18
|
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
17
19
|
xstyle?: stylex.StyleXStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputClearButton.d.ts","sourceRoot":"","sources":["../../src/Field/InputClearButton.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"InputClearButton.d.ts","sourceRoot":"","sources":["../../src/Field/InputClearButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAkD3C,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;IAC7B;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,6BAA8B,SAAQ,qBAAqB;IACnE,aAAa,EAAE,KAAK,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACtD,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;CACtD;AAiDD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAExE;yBAFe,gBAAgB;;;AAIhC,4EAA4E;AAC5E,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,6BAA6B,GACnC,SAAS,CAEX"}
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file InputClearButton.tsx
|
|
7
|
-
* @input Uses React, Button, Icon
|
|
8
|
-
* @output Exports the public InputClearButton and an internal popup-aware variant
|
|
7
|
+
* @input Uses React, Button, and Icon
|
|
8
|
+
* @output Exports the public InputClearButton and an internal popup-aware variant,
|
|
9
|
+
* both with a contextual tooltip matching their required label.
|
|
9
10
|
* @position Shared primitive. Every input that renders a clear affordance —
|
|
10
11
|
* TextInput, NumberInput, TimeInput, DateInput, DateTimeInput,
|
|
11
12
|
* DateRangeInput, Selector, MultiSelector, Typeahead, Tokenizer, FileInput —
|
|
@@ -49,6 +50,7 @@ function renderInputClearButton({
|
|
|
49
50
|
variant: "ghost",
|
|
50
51
|
size: "sm",
|
|
51
52
|
label: label,
|
|
53
|
+
tooltip: label,
|
|
52
54
|
className: buttonTargetClassName,
|
|
53
55
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
54
56
|
icon: "close",
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Selector.tsx
|
|
3
|
-
* @input Uses React, StyleX,
|
|
4
|
-
* and
|
|
5
|
-
* @output Exports Selector
|
|
3
|
+
* @input Uses React, StyleX, adaptive selection surfaces, theme-resolved
|
|
4
|
+
* indicators, Field, and InputGroup context
|
|
5
|
+
* @output Exports Selector with content-derived option-mark layout
|
|
6
6
|
* @position Core implementation; consumed by index.ts
|
|
7
7
|
*
|
|
8
8
|
* SYNC: When modified, update:
|
|
9
|
+
* - /packages/core/src/Selector/Selector.spec.md
|
|
9
10
|
* - /packages/core/src/Selector/Selector.doc.mjs
|
|
10
11
|
* - /packages/core/src/Selector/Selector.test.tsx
|
|
11
12
|
* - /packages/core/src/Selector/index.ts
|
|
13
|
+
* - /apps/storybook/stories/Selector.stories.tsx
|
|
12
14
|
* - /apps/storybook/stories/InputGroup.stories.tsx
|
|
13
15
|
* - /packages/cli/assets/templates/blocks/components/Selector/ (showcase blocks)
|
|
14
16
|
*/
|
|
@@ -183,10 +185,10 @@ interface SelectorPropsBase<T extends SelectorOptionType = SelectorOptionType> e
|
|
|
183
185
|
*/
|
|
184
186
|
renderValue?: (option: SelectorOptionData) => ReactNode;
|
|
185
187
|
/**
|
|
186
|
-
* Which edge of the option row carries
|
|
187
|
-
* mark
|
|
188
|
-
*
|
|
189
|
-
* CommandPalette.
|
|
188
|
+
* Which logical edge of the option row carries a rendered selection mark. An
|
|
189
|
+
* empty mark consumes no space, so selected and unselected labels may shift or
|
|
190
|
+
* have different available width. `end` is the house convention shared with
|
|
191
|
+
* Typeahead and CommandPalette.
|
|
190
192
|
*
|
|
191
193
|
* @default 'end'
|
|
192
194
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.d.ts","sourceRoot":"","sources":["../../src/Selector/Selector.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Selector.d.ts","sourceRoot":"","sources":["../../src/Selector/Selector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EA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yleX,
|
|
8
|
-
* and
|
|
9
|
-
* @output Exports Selector
|
|
7
|
+
* @input Uses React, StyleX, adaptive selection surfaces, theme-resolved
|
|
8
|
+
* indicators, Field, and InputGroup context
|
|
9
|
+
* @output Exports Selector with content-derived option-mark layout
|
|
10
10
|
* @position Core implementation; consumed by index.ts
|
|
11
11
|
*
|
|
12
12
|
* SYNC: When modified, update:
|
|
13
|
+
* - /packages/core/src/Selector/Selector.spec.md
|
|
13
14
|
* - /packages/core/src/Selector/Selector.doc.mjs
|
|
14
15
|
* - /packages/core/src/Selector/Selector.test.tsx
|
|
15
16
|
* - /packages/core/src/Selector/index.ts
|
|
17
|
+
* - /apps/storybook/stories/Selector.stories.tsx
|
|
16
18
|
* - /apps/storybook/stories/InputGroup.stories.tsx
|
|
17
19
|
* - /packages/cli/assets/templates/blocks/components/Selector/ (showcase blocks)
|
|
18
20
|
*/
|
|
@@ -772,7 +774,7 @@ export function Selector(props) {
|
|
|
772
774
|
*/
|
|
773
775
|
const mark = /*#__PURE__*/_jsx("span", {
|
|
774
776
|
...{
|
|
775
|
-
className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s xgomdpo"
|
|
777
|
+
className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s xgomdpo xjl7jj"
|
|
776
778
|
},
|
|
777
779
|
children: /*#__PURE__*/_jsx(SelectionMark, {
|
|
778
780
|
state: isSelected ? 'checked' : 'unchecked',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../src/Slider/Slider.tsx"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAQhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,SAAS,CAAC,cAAc,CAAC,E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C;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,8CAA8C;IAC9C,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC7C,iEAAiE;IACjE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAChD,8CAA8C;IAC9C,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAmT/D;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,EAAC,GAAG,EAAE,GAAG,KAAK,EAAC,EAAE,WAAW,+BA4rBlD;yBA5rBe,MAAM"}
|
package/dist/Slider/Slider.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Slider.tsx
|
|
7
7
|
* @input Uses React, useId, useRef, useCallback, Field, Tooltip, useTooltip, VisuallyHidden
|
|
8
|
-
* @output Exports Slider and its props; modifier-only key presses do not restore the thumb focus ring
|
|
8
|
+
* @output Exports Slider and its props; unfilled marks share the track token; modifier-only key presses do not restore the thumb focus ring
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by Slider.test.tsx
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -710,18 +710,28 @@ export function Slider({
|
|
|
710
710
|
} : {
|
|
711
711
|
bottom: insetPosition(percent)
|
|
712
712
|
};
|
|
713
|
+
// Marks at or inside the filled region take the fill color:
|
|
714
|
+
// at or behind the thumb in single mode, between the thumbs
|
|
715
|
+
// in range mode.
|
|
716
|
+
const isFilled = isRange ? mark.value >= values[0] && mark.value <= values[1] : mark.value <= values[0];
|
|
713
717
|
return /*#__PURE__*/_jsxs("div", {
|
|
714
718
|
children: [/*#__PURE__*/_jsx("div", {
|
|
715
719
|
"data-testid": "slider-mark",
|
|
716
720
|
"data-mark-value": mark.value,
|
|
717
721
|
...mergeProps({
|
|
718
722
|
0: {
|
|
719
|
-
className: "x10l6tqk
|
|
723
|
+
className: "x10l6tqk xdsb6cv xjspbzw x36qwtl x1xc55vz x1m9mm8y"
|
|
724
|
+
},
|
|
725
|
+
2: {
|
|
726
|
+
className: "x10l6tqk xdsb6cv xjspbzw xfo62xy xdk7pt x11lhmoz xoffwj3"
|
|
720
727
|
},
|
|
721
728
|
1: {
|
|
722
|
-
className: "x10l6tqk
|
|
729
|
+
className: "x10l6tqk xjspbzw x36qwtl x1xc55vz x1m9mm8y x1ewilqj"
|
|
730
|
+
},
|
|
731
|
+
3: {
|
|
732
|
+
className: "x10l6tqk xjspbzw xfo62xy xdk7pt x11lhmoz xoffwj3 x1ewilqj"
|
|
723
733
|
}
|
|
724
|
-
}[!!isHorizontal << 0], {
|
|
734
|
+
}[!!isHorizontal << 1 | !!isFilled << 0], {
|
|
725
735
|
style: markPos
|
|
726
736
|
})
|
|
727
737
|
}), mark.label && /*#__PURE__*/_jsx("span", {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @position Thin wrapper over Button; adds controlled toggle pattern
|
|
6
6
|
*
|
|
7
7
|
* ToggleButton wraps Button with `isPressed` and adds:
|
|
8
|
-
* - `onPressedChange`
|
|
8
|
+
* - `onPressedChange` from internal `onClick`; `pressedChangeAction` via Button
|
|
9
9
|
* - `pressedIcon` for outline-to-filled icon swap
|
|
10
10
|
* - Font weight shift on press with width reservation to prevent layout shift
|
|
11
11
|
* - Group integration via ToggleButtonGroupContext
|
|
@@ -42,10 +42,12 @@ export interface ToggleButtonProps extends BaseProps<HTMLButtonElement> {
|
|
|
42
42
|
*/
|
|
43
43
|
onPressedChange?: (isPressed: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
44
44
|
/**
|
|
45
|
-
* Action handler for API- or navigation-backed toggles, run
|
|
46
|
-
* transition
|
|
47
|
-
*
|
|
48
|
-
*
|
|
45
|
+
* Action handler for API- or navigation-backed toggles, run through Button's
|
|
46
|
+
* clickAction transition after onPressedChange unless that callback prevents
|
|
47
|
+
* default. It also runs without a callback. Omit it for callback-only toggles
|
|
48
|
+
* that need no Action transition. The button shows a loading spinner while
|
|
49
|
+
* the action is pending, including synchronous actions that suspend.
|
|
50
|
+
* Ignored when a value identifies this button as a ToggleButtonGroup member.
|
|
49
51
|
*
|
|
50
52
|
* @example
|
|
51
53
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButton.d.ts","sourceRoot":"","sources":["../../src/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAgB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAI3D,OAAO,EAAS,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4D5C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,CAChB,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KACvC,IAAI,CAAC;IAEV
|
|
1
|
+
{"version":3,"file":"ToggleButton.d.ts","sourceRoot":"","sources":["../../src/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;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,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,KAAK,EACL,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,mBAAmB,EACpC,mBAAmB,EACnB,IAAI,EAAE,QAAQ,EACd,SAAkB,EAClB,UAAU,EAAE,cAAsB,EAClC,SAAiB,EACjB,IAAI,EACJ,UAAkB,EAClB,WAAW,EACX,QAAQ,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,EAAE,UAAU,EACrB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,SAAS,CAiG/B;yBArHe,YAAY"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @position Thin wrapper over Button; adds controlled toggle pattern
|
|
10
10
|
*
|
|
11
11
|
* ToggleButton wraps Button with `isPressed` and adds:
|
|
12
|
-
* - `onPressedChange`
|
|
12
|
+
* - `onPressedChange` from internal `onClick`; `pressedChangeAction` via Button
|
|
13
13
|
* - `pressedIcon` for outline-to-filled icon swap
|
|
14
14
|
* - Font weight shift on press with width reservation to prevent layout shift
|
|
15
15
|
* - Group integration via ToggleButtonGroupContext
|
|
@@ -106,31 +106,17 @@ export function ToggleButton({
|
|
|
106
106
|
// — that is the half `??` got right — but it cannot re-enable a member
|
|
107
107
|
// (family:buttons FR3).
|
|
108
108
|
const isDisabled = (group?.isDisabled ?? false) || isDisabledProp;
|
|
109
|
-
|
|
110
|
-
// Track the pressed state optimistically so the button reflects the intended
|
|
111
|
-
// state immediately while an async action is pending. The optimistic update
|
|
112
|
-
// is applied inside Button's clickAction transition (below), satisfying
|
|
113
|
-
// React's "useOptimistic must run in a transition" rule.
|
|
114
109
|
const [optimisticPressed, setOptimisticPressed] = useOptimistic(committedPressed);
|
|
115
110
|
const isPressed = optimisticPressed;
|
|
116
|
-
|
|
117
|
-
//
|
|
118
|
-
// re-click while an action is pending reads the in-flight intent and toggles
|
|
119
|
-
// (true -> false -> true) rather than recomputing from the stale committed
|
|
120
|
-
// state. handleClick and clickAction share this so the callback and the
|
|
121
|
-
// optimistic update always agree within a single click.
|
|
111
|
+
// Both paths use the same in-flight intent, so re-clicks reverse a pending
|
|
112
|
+
// toggle rather than deriving from the stale controlled value.
|
|
122
113
|
const nextPressed = !isPressed;
|
|
123
114
|
const resolvedIcon = isPressed && pressedIcon ? pressedIcon : icon;
|
|
124
|
-
|
|
125
|
-
// Synchronous part of the toggle. Button calls onClick before clickAction and
|
|
126
|
-
// skips clickAction when the event is defaultPrevented, so calling
|
|
127
|
-
// preventDefault() inside onPressedChange opts out of pressedChangeAction.
|
|
128
115
|
const handleClick = event => {
|
|
129
116
|
if (isDisabled) {
|
|
130
117
|
return;
|
|
131
118
|
}
|
|
132
119
|
if (group && value != null) {
|
|
133
|
-
// Group mode delegates selection to the group; no async-action path.
|
|
134
120
|
group.toggle(value);
|
|
135
121
|
event.preventDefault();
|
|
136
122
|
return;
|
|
@@ -138,16 +124,12 @@ export function ToggleButton({
|
|
|
138
124
|
onPressedChangeProp?.(nextPressed, event);
|
|
139
125
|
};
|
|
140
126
|
|
|
141
|
-
//
|
|
142
|
-
//
|
|
143
|
-
|
|
144
|
-
// wired in group mode (where there is no async action). Button is rendered
|
|
145
|
-
// interruptible, so it stays clickable while pending and a re-click starts a
|
|
146
|
-
// fresh transition that interrupts the previous one.
|
|
147
|
-
const clickAction = group && value != null ? undefined : async () => {
|
|
127
|
+
// Button runs onClick first and skips clickAction when the callback prevents
|
|
128
|
+
// default. Its transition owns both the optimistic update and pending UI.
|
|
129
|
+
const clickAction = pressedChangeAction && !(group && value != null) ? async () => {
|
|
148
130
|
setOptimisticPressed(nextPressed);
|
|
149
|
-
await pressedChangeAction
|
|
150
|
-
};
|
|
131
|
+
await pressedChangeAction(nextPressed);
|
|
132
|
+
} : undefined;
|
|
151
133
|
|
|
152
134
|
// isIconOnly prop is the source of truth for icon-only rendering.
|
|
153
135
|
const labelContent = children != null ? /*#__PURE__*/_jsxs("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeList.d.ts","sourceRoot":"","sources":["../../src/TreeList/TreeList.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAwC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAI5E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EAAC,KAAK,eAAe,EAAE,KAAK,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAE3E,MAAM,WAAW,aAAc,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;;OAGG;IACH,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAE1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAE1B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAE1B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAmFD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,OAAoB,EACpB,OAAsB,EACtB,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,GAAG,EACH,SAAS,EAAE,aAAa,EACxB,GAAG,SAAS,EACb,EAAE,aAAa,+
|
|
1
|
+
{"version":3,"file":"TreeList.d.ts","sourceRoot":"","sources":["../../src/TreeList/TreeList.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAwC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAI5E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EAAC,KAAK,eAAe,EAAE,KAAK,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAE3E,MAAM,WAAW,aAAc,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;;OAGG;IACH,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAE1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAE1B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAE1B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAmFD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,OAAoB,EACpB,OAAsB,EACtB,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,GAAG,EACH,SAAS,EAAE,aAAa,EACxB,GAAG,SAAS,EACb,EAAE,aAAa,+BA0Lf;yBAxMe,QAAQ"}
|
|
@@ -214,6 +214,9 @@ export function TreeList({
|
|
|
214
214
|
description: item.description,
|
|
215
215
|
startContent: item.startContent,
|
|
216
216
|
endContent: item.endContent,
|
|
217
|
+
xstyle: item.xstyle,
|
|
218
|
+
className: item.className,
|
|
219
|
+
style: item.style,
|
|
217
220
|
hasChildren: hasChildren,
|
|
218
221
|
hasExpandableItems: hasExpandableItems,
|
|
219
222
|
onClick: item.onClick,
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* - /packages/cli/assets/templates/blocks/components/TreeList/ (showcase blocks)
|
|
11
11
|
*/
|
|
12
12
|
import { type ReactNode } from 'react';
|
|
13
|
+
import * as stylex from '@stylexjs/stylex';
|
|
13
14
|
import type { TreeListDensity, TreeListVariant } from './TreeListTypes';
|
|
14
15
|
export interface TreeListItemInternalProps {
|
|
15
16
|
id: string;
|
|
@@ -22,6 +23,10 @@ export interface TreeListItemInternalProps {
|
|
|
22
23
|
target?: string;
|
|
23
24
|
isDisabled?: boolean;
|
|
24
25
|
isSelected?: boolean;
|
|
26
|
+
/** Consumer styles for the row element. See `TreeListItemData`. */
|
|
27
|
+
xstyle?: stylex.StyleXStyles;
|
|
28
|
+
className?: string;
|
|
29
|
+
style?: React.CSSProperties;
|
|
25
30
|
hasChildren: boolean;
|
|
26
31
|
/**
|
|
27
32
|
* Whether the tree contains at least one expandable item anywhere (i.e. a
|
|
@@ -58,7 +63,7 @@ export interface TreeListItemInternalProps {
|
|
|
58
63
|
*/
|
|
59
64
|
isTabbable: boolean;
|
|
60
65
|
}
|
|
61
|
-
export declare function TreeListItem({ id, label, description, startContent, endContent, onClick, href, target, isDisabled, isSelected, hasChildren, hasExpandableItems, nestedLevel, isLast, ancestorsIsLast, isExpanded, onToggle, density, variant, renderedChildren, posInSet, setSize, isTabbable, }: TreeListItemInternalProps): import("react").JSX.Element;
|
|
66
|
+
export declare function TreeListItem({ id, label, description, startContent, endContent, xstyle, className, style, onClick, href, target, isDisabled, isSelected, hasChildren, hasExpandableItems, nestedLevel, isLast, ancestorsIsLast, isExpanded, onToggle, density, variant, renderedChildren, posInSet, setSize, isTabbable, }: TreeListItemInternalProps): import("react").JSX.Element;
|
|
62
67
|
export declare namespace TreeListItem {
|
|
63
68
|
var displayName: string;
|
|
64
69
|
}
|