@astryxdesign/core 0.4.7-canary.a7bedb2 → 0.4.7-canary.b6c0501
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 +1 -1
- package/dist/Banner/Banner.d.ts +40 -15
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +51 -18
- package/dist/Chat/ChatTokenizedText.d.ts +2 -0
- package/dist/Chat/ChatTokenizedText.d.ts.map +1 -1
- package/dist/Chat/ChatTokenizedText.js +11 -6
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +28 -6
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +20 -6
- package/dist/Spinner/Spinner.d.ts +3 -3
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +130 -78
- package/dist/TabList/Tab.d.ts +15 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +32 -7
- package/dist/TabList/TabList.d.ts +46 -7
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +351 -21
- package/dist/TabList/TabListContext.d.ts +11 -1
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +11 -2
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.d.ts.map +1 -1
- package/dist/Table/TableRow.d.ts +16 -5
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +16 -5
- package/dist/astryx.css +29 -1
- package/dist/utils/sharedResizeObserver.d.ts.map +1 -1
- package/dist/utils/sharedResizeObserver.js +10 -1
- package/package.json +2 -2
- package/src/Banner/Banner.doc.mjs +13 -11
- package/src/Banner/Banner.test.tsx +102 -15
- package/src/Banner/Banner.tsx +72 -25
- package/src/Chat/ChatTokenizedText.tsx +17 -10
- package/src/Markdown/incremental.test.ts +16 -2
- package/src/Markdown/parser.perf.test.ts +29 -4
- package/src/Markdown/parser.ts +36 -7
- package/src/PowerSearch/PowerSearch.tsx +6 -1
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +201 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +17 -2
- package/src/Spinner/Spinner.test.tsx +147 -1
- package/src/Spinner/Spinner.tsx +120 -101
- package/src/TabList/Tab.doc.mjs +13 -1
- package/src/TabList/Tab.tsx +67 -7
- package/src/TabList/TabList.doc.mjs +22 -6
- package/src/TabList/TabList.test.tsx +559 -0
- package/src/TabList/TabList.tsx +488 -21
- package/src/TabList/TabListContext.ts +13 -2
- package/src/TabList/index.ts +6 -2
- package/src/Table/Table.doc.mjs +6 -1
- package/src/Table/Table.test.tsx +97 -14
- package/src/Table/TableBody.doc.mjs +40 -0
- package/src/Table/TableFooter.doc.mjs +40 -0
- package/src/Table/TableHeader.doc.mjs +40 -0
- package/src/Table/TableRow.tsx +16 -5
- package/src/utils/sharedResizeObserver.ts +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -189,7 +189,7 @@ Thanks to everyone who contributed to this release:
|
|
|
189
189
|
- BottomSheet: a pull up from the scroll area now expands the sheet on iOS. Below the tallest detent, dragging up inside the content did nothing on a real device while the grab handle worked — the sheet took the gesture and then froze for the rest of the pull. iOS Safari raises PointerEvents for a finger under the same numeric id it puts in `Touch.identifier`, so the drag the touch path started was keyed to a live pointer: `beginDrag` captured that pointer, WebKit handed the capture straight back, and the `lostpointercapture` a millisecond later cancelled the drag. Touch-driven drags are now marked as such — they take no pointer capture, and `lostpointercapture`, `pointercancel` and `pointermove` for that same finger no longer cancel, end or double-drive them. Browsers that keep the two id spaces apart were never affected, which is why this only showed up on device (#5178).
|
|
190
190
|
- Calendar weekday headers now use compact CLDR stand-alone-short names for the selected locale, while preserving the existing `Su` / `Mo` / `Tu` English labels.
|
|
191
191
|
- Render generated id attributes on Markdown headings so Outline hash links scroll to their target. Heading slugs now come from parser helpers shared with parseOutlineFromMarkdown, and the components.heading override receives the generated id (#4765).
|
|
192
|
-
- StatusDot:
|
|
192
|
+
- StatusDot: add an `icon` prop for API parity with `AvatarStatusDot` — an optional ReactNode rendered centered in the 8px dot, painted from the dot's `currentColor` ink; booleans and empty renders are ignored so `cond && <Icon />` stays safe. Each variant now pairs its plate with a dedicated ink (`--color-on-*`, the Badge precedent) so a passed icon stays legible — notably the fixed dark on-warning ink on the yellow plate, where a light surface ink lands near 2:1. Per design review, the dot itself deliberately stays a plain colored signal: at 8px, built-in per-variant glyphs satisfy WCAG 1.4.1 on paper but are not genuinely readable, so making the status accessible in context (binary signal, visible label, `icon`, or an accessible alternative) is the builder's responsibility — see the StatusDot usage guidance (#4373).
|
|
193
193
|
- `Table`'s row-expansion chevron now mirrors correctly under RTL. It previously rotated on expand with no RTL handling at all, so the directional glyph pointed the same way regardless of text direction, matching the pattern already used by `TreeListItem`'s chevron (#5153).
|
|
194
194
|
|
|
195
195
|
#### Contributors
|
package/dist/Banner/Banner.d.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Banner.tsx
|
|
3
|
-
* @input Uses React useState/useRef/useId, Button, Icon (with registry string names), StyleX
|
|
3
|
+
* @input Uses React useState/useRef/useId, useCollapsible, Button, Icon (with registry string names), StyleX
|
|
4
4
|
* @output Exports Banner component, BannerProps, BannerStatus, BannerContainer types
|
|
5
5
|
* @position Core implementation; consumed by index.ts, tested by Banner.test.tsx
|
|
6
6
|
*
|
|
7
7
|
* Visual structure:
|
|
8
8
|
* - Root container: layout-only wrapper (flex column), no visual styling, no theme target
|
|
9
9
|
* - Header area (themeProps 'banner'): colored status background with icon, title, description, actions, dismiss
|
|
10
|
-
* - Content area (themeProps 'banner-content'):
|
|
10
|
+
* - Content area (themeProps 'banner-content'): card background for additional content (children)
|
|
11
11
|
* - Status icon (themeProps 'banner-icon'): the target rides on the default
|
|
12
12
|
* <Icon> itself — the element that paints — so 'status:X' overrides reach
|
|
13
13
|
* the glyph (#4166); for a custom `icon` node it stays on the layout wrapper
|
|
14
14
|
* - No left border accent — color is expressed through the full header background
|
|
15
15
|
* - Each visual area owns its own border-radius (no overflow:clip on the container)
|
|
16
|
-
* -
|
|
16
|
+
* - Children are collapsible by default: a toggle appears in the header end
|
|
17
|
+
* area and the content starts closed. `collapsible={false}` opts out and
|
|
18
|
+
* pins the content open with no toggle. The whole collapse axis (enabled /
|
|
19
|
+
* default / controlled) lives on that one prop and is driven by the shared
|
|
20
|
+
* `useCollapsible` hook rather than local state.
|
|
17
21
|
*
|
|
18
22
|
* A status added through `BannerStatusMap` augmentation has no entry in the
|
|
19
23
|
* status lookups, so it renders with no status fill, no default glyph and the
|
|
@@ -35,6 +39,7 @@
|
|
|
35
39
|
*/
|
|
36
40
|
import { type ReactNode } from 'react';
|
|
37
41
|
import type { BaseProps } from '../BaseProps';
|
|
42
|
+
import type { CollapsibleConfig } from '../Collapsible/useCollapsible';
|
|
38
43
|
import type { Elevation } from '../utils/types';
|
|
39
44
|
import type { BannerStatusMap, BannerContainerMap } from './index';
|
|
40
45
|
/**
|
|
@@ -109,15 +114,29 @@ export interface BannerProps extends BaseProps<HTMLDivElement> {
|
|
|
109
114
|
*/
|
|
110
115
|
elevation?: Elevation;
|
|
111
116
|
/**
|
|
112
|
-
* Whether the content area (children)
|
|
113
|
-
*
|
|
114
|
-
*
|
|
117
|
+
* Whether the content area (children) sits behind an expand/collapse toggle
|
|
118
|
+
* in the header. On by default, so a banner with children behaves as it
|
|
119
|
+
* always has.
|
|
120
|
+
*
|
|
121
|
+
* - omitted / `true` — collapsible, starts collapsed
|
|
122
|
+
* - `{defaultIsOpen: true}` — collapsible, starts open
|
|
123
|
+
* - `{isOpen, onOpenChange}` — controlled by the consumer
|
|
124
|
+
* - `false` — not collapsible: children are always visible, with no toggle,
|
|
125
|
+
* no `aria-expanded`, and a content region that stays mounted
|
|
126
|
+
*
|
|
127
|
+
* Takes the shared `CollapsibleConfig` so a banner's disclosure is
|
|
128
|
+
* configured exactly like `Collapsible`'s, rather than through a
|
|
129
|
+
* Banner-only vocabulary. Banner's default differs from the hook's on one
|
|
130
|
+
* point — it starts closed, not open — because a banner's message lives in
|
|
131
|
+
* its header and the content is supplementary.
|
|
132
|
+
*
|
|
133
|
+
* @default true
|
|
115
134
|
*/
|
|
116
|
-
|
|
135
|
+
collapsible?: boolean | CollapsibleConfig;
|
|
117
136
|
/**
|
|
118
|
-
* Extra content rendered below the header in a
|
|
137
|
+
* Extra content rendered below the header in a card-background area.
|
|
119
138
|
* Use for rich content like lists, links, or detailed information.
|
|
120
|
-
*
|
|
139
|
+
* Collapsed behind a toggle unless `collapsible={false}`.
|
|
121
140
|
*/
|
|
122
141
|
children?: ReactNode;
|
|
123
142
|
}
|
|
@@ -126,11 +145,12 @@ export interface BannerProps extends BaseProps<HTMLDivElement> {
|
|
|
126
145
|
*
|
|
127
146
|
* Two-part visual structure:
|
|
128
147
|
* - Header: colored status background with icon, title, description, and actions
|
|
129
|
-
* - Content (optional):
|
|
148
|
+
* - Content (optional): card background area for additional rich content
|
|
130
149
|
*
|
|
131
|
-
* When children are provided, a
|
|
132
|
-
*
|
|
133
|
-
*
|
|
150
|
+
* When children are provided, a chevron toggle appears in the header end area
|
|
151
|
+
* (to the left of the dismiss button if present) and the content starts
|
|
152
|
+
* collapsed. Pass `collapsible={false}` for content that is always visible,
|
|
153
|
+
* or a config object to change the initial state or control it.
|
|
134
154
|
*
|
|
135
155
|
* Manages its own dismissed state internally — the banner hides on dismiss
|
|
136
156
|
* even if `onDismiss` is not provided, so product teams don't need to wire
|
|
@@ -161,12 +181,17 @@ export interface BannerProps extends BaseProps<HTMLDivElement> {
|
|
|
161
181
|
* <Banner
|
|
162
182
|
* status="warning"
|
|
163
183
|
* title="Configuration changes"
|
|
164
|
-
*
|
|
184
|
+
* collapsible={{defaultIsOpen: true}}>
|
|
165
185
|
* <p>Details here...</p>
|
|
166
186
|
* </Banner>
|
|
187
|
+
* <Banner status="error" title="3 fields need attention" collapsible={false}>
|
|
188
|
+
* <ul>
|
|
189
|
+
* <li>Email address is invalid</li>
|
|
190
|
+
* </ul>
|
|
191
|
+
* </Banner>
|
|
167
192
|
* ```
|
|
168
193
|
*/
|
|
169
|
-
export declare function Banner({ status, title, description, icon, isDismissable, onDismiss, endContent, container, elevation,
|
|
194
|
+
export declare function Banner({ status, title, description, icon, isDismissable, onDismiss, endContent, container, elevation, collapsible, children, xstyle, className, style, ref, onFocusCapture, onPointerDownCapture, ...rest }: BannerProps): import("react").JSX.Element | null;
|
|
170
195
|
export declare namespace Banner {
|
|
171
196
|
var displayName: string;
|
|
172
197
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../src/Banner/Banner.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../src/Banner/Banner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAA0B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgB5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI9C,OAAO,KAAK,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAMjE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC5D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAmND;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,KAAK,EACL,WAAW,EACX,IAAI,EACJ,aAAqB,EACrB,SAAS,EACT,UAAU,EACV,SAAkB,EAClB,SAAkB,EAClB,WAAkB,EAClB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,cAAc,EACd,oBAAoB,EACpB,GAAG,IAAI,EACR,EAAE,WAAW,sCAoOb;yBAvPe,MAAM"}
|
package/dist/Banner/Banner.js
CHANGED
|
@@ -4,20 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Banner.tsx
|
|
7
|
-
* @input Uses React useState/useRef/useId, Button, Icon (with registry string names), StyleX
|
|
7
|
+
* @input Uses React useState/useRef/useId, useCollapsible, Button, Icon (with registry string names), StyleX
|
|
8
8
|
* @output Exports Banner component, BannerProps, BannerStatus, BannerContainer types
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by Banner.test.tsx
|
|
10
10
|
*
|
|
11
11
|
* Visual structure:
|
|
12
12
|
* - Root container: layout-only wrapper (flex column), no visual styling, no theme target
|
|
13
13
|
* - Header area (themeProps 'banner'): colored status background with icon, title, description, actions, dismiss
|
|
14
|
-
* - Content area (themeProps 'banner-content'):
|
|
14
|
+
* - Content area (themeProps 'banner-content'): card background for additional content (children)
|
|
15
15
|
* - Status icon (themeProps 'banner-icon'): the target rides on the default
|
|
16
16
|
* <Icon> itself — the element that paints — so 'status:X' overrides reach
|
|
17
17
|
* the glyph (#4166); for a custom `icon` node it stays on the layout wrapper
|
|
18
18
|
* - No left border accent — color is expressed through the full header background
|
|
19
19
|
* - Each visual area owns its own border-radius (no overflow:clip on the container)
|
|
20
|
-
* -
|
|
20
|
+
* - Children are collapsible by default: a toggle appears in the header end
|
|
21
|
+
* area and the content starts closed. `collapsible={false}` opts out and
|
|
22
|
+
* pins the content open with no toggle. The whole collapse axis (enabled /
|
|
23
|
+
* default / controlled) lives on that one prop and is driven by the shared
|
|
24
|
+
* `useCollapsible` hook rather than local state.
|
|
21
25
|
*
|
|
22
26
|
* A status added through `BannerStatusMap` augmentation has no entry in the
|
|
23
27
|
* status lookups, so it renders with no status fill, no default glyph and the
|
|
@@ -43,6 +47,7 @@ import { Button } from "../Button/index.js";
|
|
|
43
47
|
import { Icon } from "../Icon/index.js";
|
|
44
48
|
import "../theme/tokens.stylex.js";
|
|
45
49
|
import { colorVars, spacingVars, radiusVars, fontWeightVars, typeScaleVars, borderVars, durationVars, easeVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
50
|
+
import { useCollapsible } from "../Collapsible/useCollapsible.js";
|
|
46
51
|
import { composeEventHandlers, isRenderable, mergeProps } from "../utils/index.js";
|
|
47
52
|
import { edgeCompSlot } from "../Layout/edgeCompensation.stylex.js";
|
|
48
53
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -221,11 +226,12 @@ const elevationStyles = {
|
|
|
221
226
|
*
|
|
222
227
|
* Two-part visual structure:
|
|
223
228
|
* - Header: colored status background with icon, title, description, and actions
|
|
224
|
-
* - Content (optional):
|
|
229
|
+
* - Content (optional): card background area for additional rich content
|
|
225
230
|
*
|
|
226
|
-
* When children are provided, a
|
|
227
|
-
*
|
|
228
|
-
*
|
|
231
|
+
* When children are provided, a chevron toggle appears in the header end area
|
|
232
|
+
* (to the left of the dismiss button if present) and the content starts
|
|
233
|
+
* collapsed. Pass `collapsible={false}` for content that is always visible,
|
|
234
|
+
* or a config object to change the initial state or control it.
|
|
229
235
|
*
|
|
230
236
|
* Manages its own dismissed state internally — the banner hides on dismiss
|
|
231
237
|
* even if `onDismiss` is not provided, so product teams don't need to wire
|
|
@@ -256,9 +262,14 @@ const elevationStyles = {
|
|
|
256
262
|
* <Banner
|
|
257
263
|
* status="warning"
|
|
258
264
|
* title="Configuration changes"
|
|
259
|
-
*
|
|
265
|
+
* collapsible={{defaultIsOpen: true}}>
|
|
260
266
|
* <p>Details here...</p>
|
|
261
267
|
* </Banner>
|
|
268
|
+
* <Banner status="error" title="3 fields need attention" collapsible={false}>
|
|
269
|
+
* <ul>
|
|
270
|
+
* <li>Email address is invalid</li>
|
|
271
|
+
* </ul>
|
|
272
|
+
* </Banner>
|
|
262
273
|
* ```
|
|
263
274
|
*/
|
|
264
275
|
export function Banner({
|
|
@@ -271,7 +282,7 @@ export function Banner({
|
|
|
271
282
|
endContent,
|
|
272
283
|
container = 'card',
|
|
273
284
|
elevation = 'none',
|
|
274
|
-
|
|
285
|
+
collapsible = true,
|
|
275
286
|
children,
|
|
276
287
|
xstyle,
|
|
277
288
|
className,
|
|
@@ -283,7 +294,25 @@ export function Banner({
|
|
|
283
294
|
}) {
|
|
284
295
|
const t = useTranslator();
|
|
285
296
|
const [isDismissed, setIsDismissed] = useState(false);
|
|
286
|
-
|
|
297
|
+
// The disclosure state machine is the shared one — Banner owns no collapse
|
|
298
|
+
// state of its own. `collapsible={false}` disables it, and that is what
|
|
299
|
+
// makes the content permanently visible.
|
|
300
|
+
//
|
|
301
|
+
// The one place Banner departs from the hook's defaults: `useCollapsible`
|
|
302
|
+
// opens by default, a banner starts closed. Its header already carries the
|
|
303
|
+
// message, so the content is supplementary — and this is the behaviour
|
|
304
|
+
// Banner has always had.
|
|
305
|
+
const collapsibleConfig = collapsible != null && typeof collapsible === 'object' ? collapsible : {};
|
|
306
|
+
const {
|
|
307
|
+
isEnabled: isCollapsible,
|
|
308
|
+
isOpen: isExpanded,
|
|
309
|
+
toggle: handleToggleExpand
|
|
310
|
+
} = useCollapsible({
|
|
311
|
+
isCollapsible: collapsible !== false && {
|
|
312
|
+
...collapsibleConfig,
|
|
313
|
+
defaultIsOpen: collapsibleConfig.defaultIsOpen ?? false
|
|
314
|
+
}
|
|
315
|
+
});
|
|
287
316
|
// The element focus came from before it entered the banner. Dismissing
|
|
288
317
|
// unmounts the whole banner, dismiss button included, so without a handoff
|
|
289
318
|
// the browser drops focus to <body> and a keyboard user loses their place.
|
|
@@ -292,7 +321,8 @@ export function Banner({
|
|
|
292
321
|
// Links the expand/collapse toggle to the content region it shows/hides so
|
|
293
322
|
// assistive tech can move from the button to its controlled content
|
|
294
323
|
// (disclosure pattern). The region is conditionally rendered, so aria-controls
|
|
295
|
-
// below is set only while it's mounted to avoid a dangling reference.
|
|
324
|
+
// below is set only while it's mounted to avoid a dangling reference. A
|
|
325
|
+
// non-collapsible banner has no toggle, so neither end of the link is used.
|
|
296
326
|
const contentId = useId();
|
|
297
327
|
const defaultIconName = defaultIconNames[status];
|
|
298
328
|
const role = statusRole[status] ?? FALLBACK_ROLE;
|
|
@@ -325,17 +355,20 @@ export function Banner({
|
|
|
325
355
|
origin.focus();
|
|
326
356
|
}
|
|
327
357
|
};
|
|
328
|
-
const handleToggleExpand = () => {
|
|
329
|
-
setIsExpanded(prev => !prev);
|
|
330
|
-
};
|
|
331
358
|
|
|
359
|
+
// The toggle exists only for a collapsible banner that actually has content
|
|
360
|
+
// to disclose.
|
|
361
|
+
const hasToggle = isCollapsible && hasChildren;
|
|
332
362
|
// Show the end area if there are actions, dismiss, or a collapsible toggle
|
|
333
|
-
const showEndArea = isRenderable(endContent) || isDismissable ||
|
|
363
|
+
const showEndArea = isRenderable(endContent) || isDismissable || hasToggle;
|
|
334
364
|
// Center items vertically when there's only a title (no description)
|
|
335
365
|
// and the banner has action buttons
|
|
336
366
|
const hasActions = isRenderable(endContent) || isDismissable;
|
|
337
367
|
const isSingleLine = !isRenderable(description) && hasActions;
|
|
338
|
-
|
|
368
|
+
|
|
369
|
+
// Non-collapsible children are always shown; collapsible ones follow the
|
|
370
|
+
// hook's open state.
|
|
371
|
+
const showContent = hasChildren && (!isCollapsible || isExpanded);
|
|
339
372
|
const isCard = container === 'card';
|
|
340
373
|
return /*#__PURE__*/_jsxs("div", {
|
|
341
374
|
ref: ref,
|
|
@@ -394,7 +427,7 @@ export function Banner({
|
|
|
394
427
|
})]
|
|
395
428
|
}), showEndArea && /*#__PURE__*/_jsxs("div", {
|
|
396
429
|
...stylex.props(styles.endArea, edgeCompSlot.inset(spacingVars['--spacing-2'])),
|
|
397
|
-
children: [endContent,
|
|
430
|
+
children: [endContent, hasToggle && /*#__PURE__*/_jsx(Button, {
|
|
398
431
|
variant: "ghost",
|
|
399
432
|
size: "sm",
|
|
400
433
|
label: isExpanded ? t('@astryx.banner.collapse') : t('@astryx.banner.expand'),
|
|
@@ -424,7 +457,7 @@ export function Banner({
|
|
|
424
457
|
})]
|
|
425
458
|
})]
|
|
426
459
|
}), showContent && /*#__PURE__*/_jsx("div", {
|
|
427
|
-
id: contentId,
|
|
460
|
+
id: hasToggle ? contentId : undefined,
|
|
428
461
|
...mergeProps(themeProps('banner-content', {
|
|
429
462
|
container,
|
|
430
463
|
status
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update:
|
|
12
12
|
* - /packages/core/src/Chat/index.ts
|
|
13
|
+
* - /packages/core/src/Chat/ChatComposerInput.tsx (token alignment must match,
|
|
14
|
+
* or a token moves when the message is sent)
|
|
13
15
|
* - /packages/cli/assets/templates/blocks/components/ChatTokenizedText/ (block examples)
|
|
14
16
|
*/
|
|
15
17
|
import React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatTokenizedText.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatTokenizedText.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"ChatTokenizedText.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatTokenizedText.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAuB,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqB5C,MAAM,WAAW,sBAAuB,SAAQ,SAAS,CAAC,eAAe,CAAC;IACxE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAoBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,GAAG,EACH,QAAQ,EACR,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,sBAAsB,qBA+BxB;yBAvCe,iBAAiB"}
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
*
|
|
15
15
|
* SYNC: When modified, update:
|
|
16
16
|
* - /packages/core/src/Chat/index.ts
|
|
17
|
+
* - /packages/core/src/Chat/ChatComposerInput.tsx (token alignment must match,
|
|
18
|
+
* or a token moves when the message is sent)
|
|
17
19
|
* - /packages/cli/assets/templates/blocks/components/ChatTokenizedText/ (block examples)
|
|
18
20
|
*/
|
|
19
21
|
import React from 'react';
|
|
@@ -106,12 +108,15 @@ function renderTokens(text, tokens) {
|
|
|
106
108
|
const matched = match[0];
|
|
107
109
|
const token = tokenMap.get(matched);
|
|
108
110
|
if (token) {
|
|
109
|
-
parts.push(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
parts.push(/*#__PURE__*/_jsx("span", {
|
|
112
|
+
...{
|
|
113
|
+
className: "x3nfvp2 xxymvpz"
|
|
114
|
+
},
|
|
115
|
+
children: isCustomToken(token) ? token.render() : /*#__PURE__*/_jsx(Badge, {
|
|
116
|
+
label: token.label,
|
|
117
|
+
variant: token.variant,
|
|
118
|
+
icon: token.icon
|
|
119
|
+
})
|
|
115
120
|
}, `${matched}-${match.index}`));
|
|
116
121
|
}
|
|
117
122
|
lastIndex = match.index + matched.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/Markdown/parser.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAMH,MAAM,MAAM,UAAU,GAClB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,GAC/B;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;CAAC,GACtC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;CAAC,GACxC;IAAC,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;CAAC,GAC/C;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,GAC/B;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAA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AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAEzD;AA4DD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAkJ5D;AAwHD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,gBAAgB,EACvB,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAC9B,SAAS,EAAE,CAAC;AACf,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,YAAY,GACpB,SAAS,EAAE,CAAC;AAwHf,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAoBtD;AAED,4EAA4E;AAC5E,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO7C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,MAAM,CAKR"}
|
package/dist/Markdown/parser.js
CHANGED
|
@@ -1384,12 +1384,23 @@ export function createIncrementalState() {
|
|
|
1384
1384
|
|
|
1385
1385
|
/**
|
|
1386
1386
|
* Find the line-index of the last blank line that is NOT inside a fenced code
|
|
1387
|
-
* block
|
|
1387
|
+
* block, and report whether a fence is still open at the end of the input.
|
|
1388
|
+
* Returns -1 when nothing is settled.
|
|
1389
|
+
*
|
|
1390
|
+
* This index must never move backwards as more of the document arrives. The
|
|
1391
|
+
* caller's cache is keyed on the settled text staying a prefix of what it was,
|
|
1392
|
+
* so a boundary that retracts by one line costs a re-parse of every block in
|
|
1393
|
+
* the document. Two things used to retract it: a blank last line, which is
|
|
1394
|
+
* just the newline the stream has written so far and stops being blank as soon
|
|
1395
|
+
* as the next chunk appends to it; and an open fence, which used to collapse
|
|
1396
|
+
* the boundary to -1 even though the content before the fence opened cannot be
|
|
1397
|
+
* changed by anything typed inside it.
|
|
1388
1398
|
*/
|
|
1389
1399
|
function findSettledBoundary(lines) {
|
|
1390
1400
|
let inFence = false;
|
|
1391
1401
|
let fenceMarker = '';
|
|
1392
1402
|
let lastBoundary = -1;
|
|
1403
|
+
let boundaryBeforeFence = -1;
|
|
1393
1404
|
for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
1394
1405
|
const line = lines[lineIndex];
|
|
1395
1406
|
|
|
@@ -1399,16 +1410,20 @@ function findSettledBoundary(lines) {
|
|
|
1399
1410
|
if (!inFence) {
|
|
1400
1411
|
inFence = true;
|
|
1401
1412
|
fenceMarker = fenceMatch[1];
|
|
1413
|
+
boundaryBeforeFence = lastBoundary;
|
|
1402
1414
|
} else if (fenceMatch[1].startsWith(fenceMarker[0]) && fenceMatch[1].length >= fenceMarker.length) {
|
|
1403
1415
|
inFence = false;
|
|
1404
1416
|
fenceMarker = '';
|
|
1405
1417
|
}
|
|
1406
1418
|
}
|
|
1407
|
-
if (!inFence && line.trim() === '' && lineIndex > 0) {
|
|
1419
|
+
if (!inFence && line.trim() === '' && lineIndex > 0 && lineIndex < lines.length - 1) {
|
|
1408
1420
|
lastBoundary = lineIndex;
|
|
1409
1421
|
}
|
|
1410
1422
|
}
|
|
1411
|
-
return
|
|
1423
|
+
return {
|
|
1424
|
+
boundary: inFence ? boundaryBeforeFence : lastBoundary,
|
|
1425
|
+
openFence: inFence
|
|
1426
|
+
};
|
|
1412
1427
|
}
|
|
1413
1428
|
|
|
1414
1429
|
/**
|
|
@@ -1718,15 +1733,22 @@ export function parseMarkdownIncremental(input, state, arg) {
|
|
|
1718
1733
|
linkDefs
|
|
1719
1734
|
} : opts;
|
|
1720
1735
|
const lines = input.split('\n');
|
|
1721
|
-
const
|
|
1736
|
+
const {
|
|
1737
|
+
boundary,
|
|
1738
|
+
openFence
|
|
1739
|
+
} = findSettledBoundary(lines);
|
|
1722
1740
|
if (boundary < 0) {
|
|
1723
|
-
//
|
|
1741
|
+
// Nothing settled yet — no blank line, or a fence opened before the first
|
|
1742
|
+
// one — so there is no prefix to keep and the whole input is re-parsed.
|
|
1724
1743
|
state.prevInput = input;
|
|
1725
1744
|
return parseMarkdownImpl(input, parseOpts);
|
|
1726
1745
|
}
|
|
1727
1746
|
const settledText = lines.slice(0, boundary).join('\n');
|
|
1728
1747
|
const unsettledRaw = lines.slice(boundary).join('\n').trim();
|
|
1729
|
-
|
|
1748
|
+
// Structural trimming holds back lines that look like an incomplete list or
|
|
1749
|
+
// table, which inside a fence is ordinary code: a TypeScript union or a `- `
|
|
1750
|
+
// would disappear from the code block as it streams.
|
|
1751
|
+
const unsettledText = openFence ? unsettledRaw : trimUnsettledStructural(unsettledRaw);
|
|
1730
1752
|
let settledBlocks;
|
|
1731
1753
|
if (settledText === state.settledText) {
|
|
1732
1754
|
// Settled portion unchanged — reuse cached blocks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearch.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearch.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAuB9D,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAIjB,qBAAqB,EACrB,iBAAiB,EAIjB,qBAAqB,EACtB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"PowerSearch.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearch.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAU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ClB,OAAO,EACP,QAAQ,EACR,KAAK,EAAE,cAAc,EACrB,aAAoB,EACpB,WAAW,EAAE,oBAAoB,EACjC,YAAoB,EACpB,QAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,aAA0B,EAC1B,cAAmB,EACnB,sBAAsB,EAAE,+BAA+B,EACvD,UAAU,EACV,qBAAqB,EACrB,UAAU,EACV,WAAW,EACX,GAAG,EACH,SAAS,EACT,IAAI,EAAE,QAAQ,EACd,aAAa,EAAE,MAAM,EACrB,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EAAE,kBAAkB,GAC/B,EAAE,gBAAgB,qBAogBlB;yBAniBe,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchEditPopover.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchEditPopover.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAA0D,MAAM,OAAO,CAAC;AAY/E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EAGd,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"PowerSearchEditPopover.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchEditPopover.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAA0D,MAAM,OAAO,CAAC;AAY/E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EAGd,MAAM,SAAS,CAAC;AA+DjB,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,cAAc,CAAC;IACvB,uCAAuC;IACvC,MAAM,EAAE,aAAa,CAAC;IACtB,qDAAqD;IACrD,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,6EAA6E;IAC7E,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,wDAAwD;IACxD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA8eD,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,MAAM,EAAE,aAAa,EACrB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,eAAe,EAAE,wBAAwB,EACzC,UAAkB,GACnB,EAAE,2BAA2B,qBAwR7B"}
|
|
@@ -25,6 +25,18 @@ import { spacingVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
|
25
25
|
import { PowerSearchValueEditor } from "./PowerSearchValueEditor.js";
|
|
26
26
|
import { resolveOperatorLabel } from "./resolveOperatorLabel.js";
|
|
27
27
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
// Below the popover layer's 400px floor (see popoverLayerStyles in
|
|
29
|
+
// PowerSearch.tsx) the chip rows collapse from one line to wrapped lines.
|
|
30
|
+
// A container query, not a viewport one, so the rows track the width the
|
|
31
|
+
// popover actually got (#4761).
|
|
32
|
+
const CHIP_ROW_COLLAPSE = '@container (max-width: 399px)';
|
|
33
|
+
const styles = {
|
|
34
|
+
chipRow: {
|
|
35
|
+
kwnvtZ: "xozqiw3 x1alyx8p",
|
|
36
|
+
$$css: true
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
28
40
|
// =============================================================================
|
|
29
41
|
// Editable filter state for recursive nesting
|
|
30
42
|
// =============================================================================
|
|
@@ -178,9 +190,10 @@ function NestedSubFilterRow({
|
|
|
178
190
|
return /*#__PURE__*/_jsxs(HStack, {
|
|
179
191
|
gap: 2,
|
|
180
192
|
vAlign: "center",
|
|
193
|
+
xstyle: styles.chipRow,
|
|
181
194
|
children: [/*#__PURE__*/_jsx("div", {
|
|
182
195
|
...{
|
|
183
|
-
className: "x2lah0s x1oysuqx"
|
|
196
|
+
className: "x2lah0s x1oysuqx x193iq5w"
|
|
184
197
|
},
|
|
185
198
|
children: /*#__PURE__*/_jsx(Selector, {
|
|
186
199
|
label: t('@astryx.powersearch.editor.field'),
|
|
@@ -193,7 +206,7 @@ function NestedSubFilterRow({
|
|
|
193
206
|
})
|
|
194
207
|
}), operatorOptions.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
195
208
|
...{
|
|
196
|
-
className: "x2lah0s xzjbwwf"
|
|
209
|
+
className: "x2lah0s xzjbwwf x193iq5w"
|
|
197
210
|
},
|
|
198
211
|
children: /*#__PURE__*/_jsx(Selector, {
|
|
199
212
|
label: t('@astryx.powersearch.editor.operator'),
|
|
@@ -371,7 +384,7 @@ function NestedEditor({
|
|
|
371
384
|
},
|
|
372
385
|
children: operatorOptions.length > 1 ? /*#__PURE__*/_jsx("div", {
|
|
373
386
|
...{
|
|
374
|
-
className: "x1iyjqo2 x2lah0s"
|
|
387
|
+
className: "x1iyjqo2 x2lah0s x193iq5w"
|
|
375
388
|
},
|
|
376
389
|
children: /*#__PURE__*/_jsx(Selector, {
|
|
377
390
|
label: t('@astryx.powersearch.editor.groupOperator'),
|
|
@@ -528,7 +541,7 @@ export function PowerSearchEditPopover({
|
|
|
528
541
|
if (isNestedType) {
|
|
529
542
|
return /*#__PURE__*/_jsxs("div", {
|
|
530
543
|
...{
|
|
531
|
-
className: "xb3r6kr"
|
|
544
|
+
className: "xb3r6kr x12h1iku"
|
|
532
545
|
},
|
|
533
546
|
onKeyDown: handleKeyDown,
|
|
534
547
|
children: [/*#__PURE__*/_jsx("div", {
|
|
@@ -595,7 +608,7 @@ export function PowerSearchEditPopover({
|
|
|
595
608
|
}
|
|
596
609
|
return /*#__PURE__*/_jsxs("div", {
|
|
597
610
|
...{
|
|
598
|
-
className: "xb3r6kr"
|
|
611
|
+
className: "xb3r6kr x12h1iku"
|
|
599
612
|
},
|
|
600
613
|
onKeyDown: handleKeyDown,
|
|
601
614
|
children: [/*#__PURE__*/_jsx("div", {
|
|
@@ -604,6 +617,7 @@ export function PowerSearchEditPopover({
|
|
|
604
617
|
},
|
|
605
618
|
children: /*#__PURE__*/_jsxs(HStack, {
|
|
606
619
|
gap: 2,
|
|
620
|
+
xstyle: styles.chipRow,
|
|
607
621
|
children: [/*#__PURE__*/_jsx("div", {
|
|
608
622
|
...{
|
|
609
623
|
className: "x1iyjqo2 xs83m0k xeuugli"
|
|
@@ -619,7 +633,7 @@ export function PowerSearchEditPopover({
|
|
|
619
633
|
})
|
|
620
634
|
}), showOperatorSelector && operatorOptions.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
621
635
|
...{
|
|
622
|
-
className: "x1iyjqo2 x2lah0s"
|
|
636
|
+
className: "x1iyjqo2 x2lah0s x193iq5w"
|
|
623
637
|
},
|
|
624
638
|
children: /*#__PURE__*/_jsx(Selector, {
|
|
625
639
|
label: t('@astryx.powersearch.editor.operator'),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Spinner.tsx
|
|
3
|
-
* @input Uses React, StyleX,
|
|
3
|
+
* @input Uses React, StyleX, SVG rendering
|
|
4
4
|
* @output Exports Spinner component, SpinnerProps, SpinnerSize, SpinnerShade types
|
|
5
5
|
* @position Core implementation of spinner loading indicator
|
|
6
6
|
*
|
|
@@ -41,7 +41,7 @@ export interface SpinnerProps extends BaseProps<HTMLSpanElement> {
|
|
|
41
41
|
* - 'sm': 10px diameter
|
|
42
42
|
* - 'md': 14px diameter
|
|
43
43
|
* - 'lg': 18px diameter
|
|
44
|
-
* - 'xl':
|
|
44
|
+
* - 'xl': 28px diameter
|
|
45
45
|
* @default 'md'
|
|
46
46
|
*/
|
|
47
47
|
size?: SpinnerSize;
|
|
@@ -77,7 +77,7 @@ export interface SpinnerProps extends BaseProps<HTMLSpanElement> {
|
|
|
77
77
|
'data-testid'?: string;
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
* An animated loading indicator. Available in
|
|
80
|
+
* An animated loading indicator. Available in four sizes and four color shades.
|
|
81
81
|
*
|
|
82
82
|
* @example
|
|
83
83
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAe5C,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;CAKV,CAAC;AAmIF,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,KAAK,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExE,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAW,EACX,KAAiB,EACjB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,SAAS,EACb,EAAE,YAAY,+BAsFd;yBAjGe,OAAO"}
|