@astryxdesign/core 0.1.1 → 0.1.2-canary.3893cd5
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 +105 -0
- package/README.md +119 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +4 -1
- package/dist/Banner/Banner.d.ts +7 -0
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +9 -2
- package/dist/Button/Button.d.ts +12 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +51 -13
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +7 -1
- package/dist/HoverCard/HoverCard.d.ts +2 -2
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +18 -6
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +7 -3
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +1 -1
- package/dist/Layer/anchorName.d.ts +20 -0
- package/dist/Layer/anchorName.d.ts.map +1 -0
- package/dist/Layer/anchorName.js +36 -0
- package/dist/Layer/useLayer.d.ts +19 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +15 -6
- package/dist/Link/Link.d.ts +1 -1
- package/dist/Link/Link.js +2 -2
- package/dist/Link/LinkProvider.d.ts +1 -0
- package/dist/Link/LinkProvider.d.ts.map +1 -1
- package/dist/Link/LinkProvider.js +1 -0
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +13 -3
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +13 -0
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +31 -27
- package/dist/Slider/Slider.js +2 -2
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +27 -8
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +30 -7
- package/dist/Table/TableRow.d.ts +6 -1
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +15 -7
- package/dist/Table/index.d.ts +3 -1
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -0
- package/dist/Table/plugins/stickyColumns/index.d.ts +3 -0
- package/dist/Table/plugins/stickyColumns/index.d.ts.map +1 -0
- package/dist/Table/plugins/stickyColumns/index.js +3 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts +25 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +369 -0
- package/dist/Table/types.d.ts +95 -5
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +1 -1
- package/dist/Text/text.stylex.d.ts +2 -2
- package/dist/Text/text.stylex.js +2 -2
- package/dist/Timestamp/Timestamp.d.ts +1 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +28 -3
- package/dist/ToggleButton/ToggleButton.d.ts +7 -9
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +34 -57
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +1 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +1 -0
- package/dist/astryx.css +30 -1
- package/dist/astryx.umd.js +147 -0
- package/dist/astryx.umd.js.map +7 -0
- package/dist/theme/generateThemeRules.js +1 -1
- package/dist/theme/syntax/SyntaxTheme.d.ts +1 -1
- package/dist/theme/syntax/SyntaxTheme.js +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.js +2 -2
- package/dist/theme/syntax/presets.d.ts +1 -1
- package/dist/theme/syntax/presets.d.ts.map +1 -1
- package/dist/theme/syntax/presets.js +1 -1
- package/dist/theme/syntax/tokens.d.ts +1 -1
- package/dist/theme/syntax/tokens.js +1 -1
- package/dist/theme/types.d.ts +1 -1
- package/package.json +6 -2
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +3 -0
- package/src/Banner/Banner.doc.mjs +8 -0
- package/src/Banner/Banner.test.tsx +16 -7
- package/src/Banner/Banner.tsx +9 -2
- package/src/Button/Button.doc.mjs +6 -0
- package/src/Button/Button.test.tsx +105 -11
- package/src/Button/Button.tsx +73 -5
- package/src/Chat/ChatComposer.doc.mjs +3 -0
- package/src/Chat/ChatComposerDrawer.doc.mjs +12 -0
- package/src/CheckboxInput/CheckboxInput.doc.mjs +8 -0
- package/src/ClickableCard/ClickableCard.doc.mjs +15 -0
- package/src/Dialog/Dialog.doc.mjs +2 -2
- package/src/EmptyState/EmptyState.test.tsx +4 -2
- package/src/EmptyState/EmptyState.tsx +6 -2
- package/src/HoverCard/HoverCard.doc.mjs +3 -0
- package/src/HoverCard/HoverCard.test.tsx +189 -2
- package/src/HoverCard/HoverCard.tsx +20 -16
- package/src/HoverCard/useHoverCard.tsx +13 -10
- package/src/Icon/Icon.doc.mjs +8 -0
- package/src/Kbd/Kbd.tsx +2 -9
- package/src/Layer/anchorName.test.ts +146 -0
- package/src/Layer/anchorName.ts +46 -0
- package/src/Layer/useLayer.doc.mjs +7 -2
- package/src/Layer/useLayer.tsx +33 -9
- package/src/Layout/Layout.doc.mjs +1 -1
- package/src/Lightbox/Lightbox.doc.mjs +0 -2
- package/src/Link/Link.test.tsx +2 -2
- package/src/Link/Link.tsx +3 -3
- package/src/Link/LinkProvider.tsx +1 -0
- package/src/List/List.doc.mjs +7 -0
- package/src/Markdown/Markdown.doc.mjs +2 -0
- package/src/Markdown/Markdown.test.tsx +17 -26
- package/src/Markdown/Markdown.tsx +16 -6
- package/src/MobileNav/MobileNav.doc.mjs +8 -8
- package/src/MobileNav/MobileNav.tsx +13 -0
- package/src/MobileNav/MobileNavReopen.test.tsx +118 -0
- package/src/OverflowList/OverflowList.doc.mjs +17 -0
- package/src/Pagination/Pagination.test.tsx +137 -13
- package/src/Pagination/Pagination.tsx +33 -28
- package/src/ProgressBar/ProgressBar.test.tsx +13 -3
- package/src/Resizable/Resizable.doc.mjs +1 -1
- package/src/Section/Section.doc.mjs +11 -0
- package/src/SelectableCard/SelectableCard.doc.mjs +15 -0
- package/src/Selector/Selector.doc.mjs +4 -0
- package/src/Skeleton/Skeleton.doc.mjs +11 -1
- package/src/Slider/Slider.doc.mjs +4 -0
- package/src/Slider/Slider.test.tsx +3 -16
- package/src/Slider/Slider.tsx +1 -1
- package/src/TabList/TabList.doc.mjs +6 -0
- package/src/Table/BaseTable.tsx +51 -24
- package/src/Table/Table.doc.mjs +12 -0
- package/src/Table/Table.test.tsx +29 -30
- package/src/Table/Table.tsx +22 -1
- package/src/Table/TableRow.tsx +37 -7
- package/src/Table/index.ts +3 -0
- package/src/Table/plugins/stickyColumns/index.ts +4 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.test.tsx +163 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +407 -0
- package/src/Table/types.ts +101 -4
- package/src/Table/useBaseTablePlugins.ts +1 -0
- package/src/Table/useTableColumnResize.doc.mjs +96 -0
- package/src/Table/useTableStickyColumns.doc.mjs +59 -0
- package/src/Text/Heading.doc.mjs +15 -2
- package/src/Text/Text.doc.mjs +7 -1
- package/src/Text/text.stylex.ts +2 -2
- package/src/Timestamp/Timestamp.doc.mjs +9 -0
- package/src/Timestamp/Timestamp.test.tsx +44 -18
- package/src/Timestamp/Timestamp.tsx +30 -10
- package/src/ToggleButton/ToggleButton.doc.mjs +9 -3
- package/src/ToggleButton/ToggleButton.test.tsx +39 -18
- package/src/ToggleButton/ToggleButton.tsx +46 -83
- package/src/Tokenizer/Tokenizer.tsx +4 -1
- package/src/Toolbar/Toolbar.doc.mjs +65 -5
- package/src/Tooltip/Tooltip.test.tsx +13 -0
- package/src/Tooltip/useTooltip.tsx +2 -3
- package/src/hooks/useImageMode.test.ts +133 -0
- package/src/theme/derivedVarRegistry.test.ts +4 -0
- package/src/theme/generateThemeRules.test.ts +7 -8
- package/src/theme/generateThemeRules.ts +1 -1
- package/src/theme/syntax/SyntaxTheme.tsx +1 -1
- package/src/theme/syntax/defineSyntaxTheme.ts +20 -11
- package/src/theme/syntax/presets.ts +5 -2
- package/src/theme/syntax/tokens.ts +1 -1
- package/src/theme/types.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,110 @@
|
|
|
1
1
|
# @xds/core
|
|
2
2
|
|
|
3
|
+
# 0.1.2
|
|
4
|
+
|
|
5
|
+
#### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- `Text`, `Heading`, `Link`, and `Timestamp` rename the `color="active"` value to `color="accent"`, now mapping to the dedicated `--color-text-accent` token (legible accent text ink) instead of `--color-accent`. Run `astryx upgrade` to migrate call sites automatically. (#2863)
|
|
8
|
+
|
|
9
|
+
#### New Features
|
|
10
|
+
|
|
11
|
+
- Button: add `isInterruptible` to keep the button clickable while a `clickAction` is pending — the spinner and `aria-busy` still show, but the button is not disabled or deduped, so a re-click interrupts the in-flight action. ToggleButton's async toggle now runs through this path, staying interruptible.
|
|
12
|
+
- Add a prebuilt UMD bundle (`dist/astryx.umd.js`, global `Astryx`) plus `unpkg`/`jsdelivr` fields, so the library works directly from a CDN via a `<script>` tag with no bundler. React/ReactDOM stay as peer globals; the StyleX runtime is bundled in.
|
|
13
|
+
- Add `useTableStickyColumns` — pin a contiguous run of `Table` columns to
|
|
14
|
+
the start and/or end edge with cumulative offsets and scroll-aware drop shadows.
|
|
15
|
+
Configure with `{ startKeys, endKeys }`; an empty config is a valid no-op.
|
|
16
|
+
|
|
17
|
+
#### Fixes
|
|
18
|
+
|
|
19
|
+
- AvatarGroupOverflow now forwards rest props (data-_, aria-_, event handlers, id, role, tabIndex) to the rendered element, matching the behavior of Avatar and AvatarGroup.
|
|
20
|
+
- Fix HoverCard SSR hydration mismatch when used inside an SSR Client Component (#3107). The floating layer now renders inline instead of portaling to `document.body`, so server and client markup match. No API change.
|
|
21
|
+
- Kbd: use the `--color-border-emphasized` token for its bottom border instead of `--color-border` (#2850)
|
|
22
|
+
- useLayer now treats `anchor-name` as a comma-separated list, so multiple layers can anchor to the same element (e.g. two TopNavMegaMenus in one nav) without clobbering each other's anchor. Previously the second menu lost its anchor and rendered over the nav.
|
|
23
|
+
- Fix mobile nav drawer not re-opening after it is closed (#3091)
|
|
24
|
+
The AppShell mobile drawer mounts `MobileNav` inside an `<Activity>` that
|
|
25
|
+
switches to `mode="hidden"` when the drawer closes. On close, React runs the
|
|
26
|
+
drawer effect's cleanup (with a stale `isOpen`) instead of re-running the
|
|
27
|
+
effect with `isOpen=false`, so the deferred `dialog.close()` never fired and
|
|
28
|
+
the native `<dialog>` was left `open` in the hidden subtree. The next open then
|
|
29
|
+
skipped `showModal()` (the dialog was already open), so the drawer could be
|
|
30
|
+
opened and closed once but never re-opened. The effect cleanup now closes the
|
|
31
|
+
dialog if it is still open, keeping the native dialog state in sync so a
|
|
32
|
+
subsequent open cleanly calls `showModal()` again.
|
|
33
|
+
- Core components (`Banner`, `EmptyState`, `Markdown`) no longer render a `<p>` by default — they render `<div>` (appearance unchanged). This avoids hydration mismatches when block content lands in a `<p>`. `Markdown` paragraphs use `role="paragraph"`; pass `components={{paragraph: 'p'}}` to opt back into `<p>`.
|
|
34
|
+
- `Pagination`'s `changeAction` is now interruptible — page changes run in a transition with optimistic page state, so rapid prev/next clicks advance through pages instead of being dropped. `Button`'s `clickAction` keeps its single-fire guard.
|
|
35
|
+
- make the `Slider` default track color visible on muted backgrounds
|
|
36
|
+
The background track painted with `--color-background-muted` — the same token
|
|
37
|
+
used for muted surface fills — so the track disappeared on muted backgrounds.
|
|
38
|
+
The track now uses the dedicated `--color-track` channel token, which is
|
|
39
|
+
designed to stay legible against body/muted surfaces.
|
|
40
|
+
- Polish `useTableStickyColumns` pinned-cell backgrounds so they match the
|
|
41
|
+
rest of the row:
|
|
42
|
+
- Table: the header row no longer picks up the `hasHover` row highlight — hover (and striped) styling now applies to body rows only. Adds an internal `isHeaderRow` flag on the row component so the header row in `<thead>` opts out (#2734)
|
|
43
|
+
- `Timestamp` now renders the current time (and small clock skew up to ~30s in the future) as "now" instead of "in a few seconds" (#3099).
|
|
44
|
+
- ToggleButton onPressedChange receives the click event for preventDefault opt-out
|
|
45
|
+
`onPressedChange` now receives the originating click event as a second
|
|
46
|
+
argument. Calling `event.preventDefault()` skips `pressedChangeAction`, so a
|
|
47
|
+
consumer can handle the toggle entirely in `onPressedChange` without firing the
|
|
48
|
+
action — matching how `Switch`'s `onChange` and `Button`'s `onClick` already
|
|
49
|
+
gate their action props. Existing `(isPressed) => void` handlers keep working;
|
|
50
|
+
the event is an added trailing argument.
|
|
51
|
+
- Tokenizer/PowerSearch: align end content (clear button, resultCount) with the field's inline padding instead of hugging the border (~3px). It now uses spacing-2 (8px) to match the text/start-icon inset (#2849)
|
|
52
|
+
- Tooltip and HoverCard: add ARIA roles to the floating layers — `role="tooltip"` on Tooltip (completing the ARIA tooltip pattern; the trigger already links via `aria-describedby`) and `role="dialog"` on HoverCard. Plumbed via a new optional `role` on the layer render props. (#3240; Popover already exposes `role="dialog"`.)
|
|
53
|
+
|
|
54
|
+
#### Documentation
|
|
55
|
+
|
|
56
|
+
- Document Banner's `defaultIsExpanded` prop, which controls whether the collapsible content area starts expanded but was missing from the docsite properties tab
|
|
57
|
+
- Rename the ClickableCard and SelectableCard examples to follow the "Component — Variant" title convention (`Clickable Card — Nested Button`, `Selectable Card — Multi-select`), and add playground defaults to both card docs so their docsite previews show realistic card content (#2877)
|
|
58
|
+
- Declare playground scaffolds for the Chat sub-components so they preview at a realistic width (ChatComposer and ChatComposerDrawer wrap in a sized container, and the drawer seeds default content), and drop the redundant visible value label from the ChatComposerDrawer "With Progress" example while keeping the accessible label (#2877)
|
|
59
|
+
- Document two public props missing from the docsite properties tab: List's `start` (ordered-list counter start) and CheckboxInput's `isReadOnly`
|
|
60
|
+
- Restore the Icon and Skeleton properties-tab previews on the docsite. Icon now seeds a default `icon` (it was a required, non-generatable prop), and Skeleton renders with concrete preview dimensions instead of collapsing at `100%` (#2848, #2875)
|
|
61
|
+
- Document Heading's `justify` prop, which was supported by the component but missing from the docsite properties tab (#2847)
|
|
62
|
+
- OverflowList: seed example items via playground defaults so the docsite properties-tab preview renders a real list instead of an empty container (#2872)
|
|
63
|
+
- Document Section's `paddingBlock` prop (block-axis padding override), which was supported by the component but missing from the docsite properties tab
|
|
64
|
+
- Give the `Skeleton` properties-tab example explicit dimensions so it is visible
|
|
65
|
+
The `Skeleton` doc had no `playground` config, so the interactive
|
|
66
|
+
properties-tab preview fell back to the prop defaults of `width: '100%'` /
|
|
67
|
+
`height: '100%'`. With no sized parent, the skeleton collapsed to a zero-size
|
|
68
|
+
(invisible) element. The doc now sets a `playground.defaults` of
|
|
69
|
+
`width: 320` / `height: 80` so the shimmer placeholder renders visibly.
|
|
70
|
+
- Update stale `facebookexperimental/xds` doc/JSDoc links to the current `facebook/astryx` namespace in source comments (theme/syntax `@see` references). The old org 301-redirects, so these weren't broken — just stale — and this matches the canonical org used elsewhere
|
|
71
|
+
- Document Table's `verticalAlign` and `textOverflow` props, which were supported by the component but missing from the docsite properties tab
|
|
72
|
+
- Document TabList's `layout` prop ('hug' | 'fill') for tab sizing, which was supported by the component but missing from the docsite properties tab
|
|
73
|
+
- Document Text's `justify` prop, which was supported by the component but missing from the docsite properties tab (same omission previously fixed for Heading) (#2847-adjacent)
|
|
74
|
+
- Restore the Timestamp properties-tab preview on the docsite. `value` is a required prop with no semantic default, so the preview rendered "Invalid time value"; it now seeds a valid ISO 8601 date (#2877)
|
|
75
|
+
- Document ToggleButton's `isIconOnly` prop, which was a supported public prop but missing from the docsite properties tab
|
|
76
|
+
- Make the Toolbar "Table Filter" example use real Selector controls for its Status and Priority filters instead of buttons styled to look like dropdowns, and add meaningful playground defaults plus richer slot options (buttons, icon buttons, tabs, segmented controls, selectors) to the Toolbar docs (#2877).
|
|
77
|
+
|
|
78
|
+
#### Other Changes
|
|
79
|
+
|
|
80
|
+
- Pinned cells paint an opaque base via the overridable
|
|
81
|
+
`--table-sticky-background` variable (defaults to `--color-background-card`),
|
|
82
|
+
fixing a grey mismatch in themes/modes where `surface !== card` (e.g. neutral
|
|
83
|
+
dark). Consumers on a different backdrop override the variable.
|
|
84
|
+
- The row's overlay (striping and/or hover) is replayed on the pinned cell via
|
|
85
|
+
a background-image gradient. `TableRow` publishes its current overlay color as
|
|
86
|
+
the inheritable `--table-row-overlay` variable, so pinned columns mirror the
|
|
87
|
+
row exactly — striped when the table is striped, hover when enabled, nothing
|
|
88
|
+
otherwise (no phantom stripes) — transitioning in lockstep with the row.
|
|
89
|
+
- `background-clip: padding-box` keeps the row divider visible on pinned cells.
|
|
90
|
+
- New `transformScrollWrapper` hook (+ `ScrollWrapperRenderProps`) lets plugins attach a `ref`
|
|
91
|
+
to the horizontal scroll container and inject before/after chrome.
|
|
92
|
+
- `transformHeaderCell` / `transformBodyCell` now receive `columnIndex` and the
|
|
93
|
+
full ordered `columns` list (also surfaced on the render props), enabling
|
|
94
|
+
position-aware plugins such as sticky columns. Existing plugins are unaffected
|
|
95
|
+
— the new args and methods are additive and optional.
|
|
96
|
+
|
|
97
|
+
#### Contributors
|
|
98
|
+
|
|
99
|
+
Thanks to everyone who contributed to this release:
|
|
100
|
+
|
|
101
|
+
- @cixzhang
|
|
102
|
+
- @durvesh1992
|
|
103
|
+
- @ernesttien
|
|
104
|
+
- @humbertovirtudes
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
3
108
|
# 0.1.1
|
|
4
109
|
|
|
5
110
|
#### Breaking Changes
|
package/README.md
CHANGED
|
@@ -70,7 +70,57 @@ npm install @astryxdesign/core @astryxdesign/theme-neutral
|
|
|
70
70
|
|
|
71
71
|
Then pick your setup below based on your framework and styling approach.
|
|
72
72
|
|
|
73
|
-
### Next.js
|
|
73
|
+
### Next.js (simplest)
|
|
74
|
+
|
|
75
|
+
The fastest way to get started. No build plugins, no PostCSS, no Babel config — Astryx ships pre-built CSS and JS, so you import three stylesheets (order matters) and wrap your app in a theme provider.
|
|
76
|
+
|
|
77
|
+
**`src/app/globals.css`**
|
|
78
|
+
|
|
79
|
+
```css
|
|
80
|
+
@import '@astryxdesign/core/reset.css';
|
|
81
|
+
@import '@astryxdesign/core/astryx.css';
|
|
82
|
+
@import '@astryxdesign/theme-neutral/theme.css';
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The import order maps to the layer cascade: `reset.css` (`@layer reset`) → `astryx.css` component styles (`@layer astryx-base`) → `theme.css` token overrides (`@layer astryx-theme`).
|
|
86
|
+
|
|
87
|
+
**`src/app/providers.tsx`**
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
'use client';
|
|
91
|
+
|
|
92
|
+
import Link from 'next/link';
|
|
93
|
+
import {Theme} from '@astryxdesign/core/theme';
|
|
94
|
+
import {LinkProvider} from '@astryxdesign/core/Link';
|
|
95
|
+
import {neutralTheme} from '@astryxdesign/theme-neutral/built';
|
|
96
|
+
|
|
97
|
+
export function Providers({children}: {children: React.ReactNode}) {
|
|
98
|
+
return (
|
|
99
|
+
<Theme theme={neutralTheme}>
|
|
100
|
+
<LinkProvider component={Link}>{children}</LinkProvider>
|
|
101
|
+
</Theme>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**`src/app/layout.tsx`**
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
import './globals.css';
|
|
110
|
+
import {Providers} from './providers';
|
|
111
|
+
|
|
112
|
+
export default function RootLayout({children}: {children: React.ReactNode}) {
|
|
113
|
+
return (
|
|
114
|
+
<html lang="en">
|
|
115
|
+
<body>
|
|
116
|
+
<Providers>{children}</Providers>
|
|
117
|
+
</body>
|
|
118
|
+
</html>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Next.js + Tailwind
|
|
74
124
|
|
|
75
125
|
No build plugins needed; XDS ships pre-built CSS that works alongside Tailwind.
|
|
76
126
|
|
|
@@ -183,3 +233,71 @@ npm install @astryxdesign/core @astryxdesign/theme-neutral
|
|
|
183
233
|
```
|
|
184
234
|
|
|
185
235
|
Same CSS imports and providers as above. No build plugins needed; XDS ships pre-built.
|
|
236
|
+
|
|
237
|
+
### No build step (CDN)
|
|
238
|
+
|
|
239
|
+
For prototypes, embeds, or pages without a bundler, load the components straight
|
|
240
|
+
from a public CDN. Two delivery options ship in the published package:
|
|
241
|
+
|
|
242
|
+
**1. UMD global (`<script>` tag).** A single pre-bundled file exposes every export
|
|
243
|
+
on `window.Astryx`. React and ReactDOM are peer dependencies — load them yourself.
|
|
244
|
+
Pair it with the precompiled stylesheet.
|
|
245
|
+
|
|
246
|
+
```html
|
|
247
|
+
<!doctype html>
|
|
248
|
+
<html data-astryx-theme="neutral">
|
|
249
|
+
<head>
|
|
250
|
+
<link
|
|
251
|
+
rel="stylesheet"
|
|
252
|
+
href="https://cdn.jsdelivr.net/npm/@astryxdesign/core/src/reset.css" />
|
|
253
|
+
<link
|
|
254
|
+
rel="stylesheet"
|
|
255
|
+
href="https://cdn.jsdelivr.net/npm/@astryxdesign/core/dist/astryx.css" />
|
|
256
|
+
</head>
|
|
257
|
+
<body>
|
|
258
|
+
<div id="root"></div>
|
|
259
|
+
<script
|
|
260
|
+
crossorigin
|
|
261
|
+
src="https://unpkg.com/react@19/umd/react.production.min.js"></script>
|
|
262
|
+
<script
|
|
263
|
+
crossorigin
|
|
264
|
+
src="https://unpkg.com/react-dom@19/umd/react-dom.production.min.js"></script>
|
|
265
|
+
<script src="https://cdn.jsdelivr.net/npm/@astryxdesign/core/dist/astryx.umd.js"></script>
|
|
266
|
+
<script>
|
|
267
|
+
const {Button, Card} = window.Astryx;
|
|
268
|
+
const e = React.createElement;
|
|
269
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
270
|
+
e(Card, null, e(Button, {variant: 'primary'}, 'Hello from a CDN')),
|
|
271
|
+
);
|
|
272
|
+
</script>
|
|
273
|
+
</body>
|
|
274
|
+
</html>
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**2. ES modules (no UMD, no globals).** Use [esm.sh](https://esm.sh), which rewrites
|
|
278
|
+
bare imports to browser-resolvable URLs. An import map keeps a single React instance.
|
|
279
|
+
|
|
280
|
+
```html
|
|
281
|
+
<link
|
|
282
|
+
rel="stylesheet"
|
|
283
|
+
href="https://cdn.jsdelivr.net/npm/@astryxdesign/core/dist/astryx.css" />
|
|
284
|
+
<script type="importmap">
|
|
285
|
+
{
|
|
286
|
+
"imports": {
|
|
287
|
+
"react": "https://esm.sh/react@19",
|
|
288
|
+
"react-dom/client": "https://esm.sh/react-dom@19/client",
|
|
289
|
+
"@astryxdesign/core": "https://esm.sh/@astryxdesign/core?external=react,react-dom"
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
</script>
|
|
293
|
+
<script type="module">
|
|
294
|
+
import {createRoot} from 'react-dom/client';
|
|
295
|
+
import {Button} from '@astryxdesign/core';
|
|
296
|
+
// ...render as usual
|
|
297
|
+
</script>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
> Pin a version in production (e.g. `@astryxdesign/core@0.1.1`) — unversioned CDN URLs
|
|
301
|
+
> resolve to the latest release and are cached aggressively. The raw ESM entry
|
|
302
|
+
> (`dist/index.js`) uses bare `react` imports and will **not** run from a plain
|
|
303
|
+
> `<script src>`; use the UMD global or esm.sh as shown above.
|
|
@@ -41,7 +41,7 @@ export interface AvatarGroupOverflowProps extends Omit<BaseProps<HTMLElement>, '
|
|
|
41
41
|
* </AvatarGroup>
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
export declare function AvatarGroupOverflow({ ref, count, onClick, children, xstyle, className, style, }: AvatarGroupOverflowProps): ReactNode;
|
|
44
|
+
export declare function AvatarGroupOverflow({ ref, count, onClick, children, xstyle, className, style, ...rest }: AvatarGroupOverflowProps): ReactNode;
|
|
45
45
|
export declare namespace AvatarGroupOverflow {
|
|
46
46
|
var displayName: string;
|
|
47
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroupOverflow.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupOverflow.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAU5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAM5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,CAAC,WAAW,CAAC,EACtB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA6DD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,
|
|
1
|
+
{"version":3,"file":"AvatarGroupOverflow.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupOverflow.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAU5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAM5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,CAAC,WAAW,CAAC,EACtB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA6DD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,wBAAwB,GAAG,SAAS,CAwDtC;yBAjEe,mBAAmB"}
|
|
@@ -100,7 +100,8 @@ export function AvatarGroupOverflow({
|
|
|
100
100
|
children,
|
|
101
101
|
xstyle,
|
|
102
102
|
className,
|
|
103
|
-
style
|
|
103
|
+
style,
|
|
104
|
+
...rest
|
|
104
105
|
}) {
|
|
105
106
|
const group = useAvatarGroup();
|
|
106
107
|
const numericSize = group?.numericSize ?? 36;
|
|
@@ -113,6 +114,7 @@ export function AvatarGroupOverflow({
|
|
|
113
114
|
type: "button",
|
|
114
115
|
onClick: onClick,
|
|
115
116
|
"aria-label": label,
|
|
117
|
+
...rest,
|
|
116
118
|
...mergeProps(themeProps('avatar-group-overflow'), stylex.props(styles.base, styles.button, styles.overlap, dynamicStyles.size(numericSize), dynamicStyles.fontSize(numericSize), dynamicStyles.overlap(-overlap), xstyle), className, style),
|
|
117
119
|
children: content
|
|
118
120
|
});
|
|
@@ -120,6 +122,7 @@ export function AvatarGroupOverflow({
|
|
|
120
122
|
return /*#__PURE__*/_jsx("span", {
|
|
121
123
|
ref: ref,
|
|
122
124
|
"aria-label": label,
|
|
125
|
+
...rest,
|
|
123
126
|
...mergeProps(themeProps('avatar-group-overflow'), stylex.props(styles.base, styles.overlap, dynamicStyles.size(numericSize), dynamicStyles.fontSize(numericSize), dynamicStyles.overlap(-overlap), xstyle), className, style),
|
|
124
127
|
children: content
|
|
125
128
|
});
|
package/dist/Banner/Banner.d.ts
CHANGED
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
* - Each visual area owns its own border-radius (no overflow:clip on the container)
|
|
13
13
|
* - When children are provided, a collapse/expand toggle button appears in the end area
|
|
14
14
|
*
|
|
15
|
+
* Title and description render as <div> (not <p>): they accept arbitrary
|
|
16
|
+
* ReactNode content, and <p> cannot legally contain block-level children
|
|
17
|
+
* (the HTML parser reparents them, desyncing SSR markup from the hydrated
|
|
18
|
+
* DOM). Using <div> keeps these slots composable with any content. Their
|
|
19
|
+
* StyleX styles set margin: 0 and explicit typography, so the rendered
|
|
20
|
+
* appearance is identical to the previous <p>.
|
|
21
|
+
*
|
|
15
22
|
* SYNC: When modified, update these files to stay in sync:
|
|
16
23
|
* - /packages/core/src/Banner/Banner.doc.mjs (props table, features, implementation notes)
|
|
17
24
|
* - /packages/core/src/Banner/Banner.test.tsx (tests for new/changed behavior)
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAW,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAsB5C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,IA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BA1Ie,MAAM"}
|
package/dist/Banner/Banner.js
CHANGED
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
* - Each visual area owns its own border-radius (no overflow:clip on the container)
|
|
17
17
|
* - When children are provided, a collapse/expand toggle button appears in the end area
|
|
18
18
|
*
|
|
19
|
+
* Title and description render as <div> (not <p>): they accept arbitrary
|
|
20
|
+
* ReactNode content, and <p> cannot legally contain block-level children
|
|
21
|
+
* (the HTML parser reparents them, desyncing SSR markup from the hydrated
|
|
22
|
+
* DOM). Using <div> keeps these slots composable with any content. Their
|
|
23
|
+
* StyleX styles set margin: 0 and explicit typography, so the rendered
|
|
24
|
+
* appearance is identical to the previous <p>.
|
|
25
|
+
*
|
|
19
26
|
* SYNC: When modified, update these files to stay in sync:
|
|
20
27
|
* - /packages/core/src/Banner/Banner.doc.mjs (props table, features, implementation notes)
|
|
21
28
|
* - /packages/core/src/Banner/Banner.test.tsx (tests for new/changed behavior)
|
|
@@ -291,12 +298,12 @@ export function Banner({
|
|
|
291
298
|
...{
|
|
292
299
|
className: "x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli"
|
|
293
300
|
},
|
|
294
|
-
children: [/*#__PURE__*/_jsx("
|
|
301
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
295
302
|
...{
|
|
296
303
|
className: "x1ghz6dp xjb2p0i xcr08ib x2mo6ok x1kq96og x1tgivj0"
|
|
297
304
|
},
|
|
298
305
|
children: title
|
|
299
|
-
}), description != null && /*#__PURE__*/_jsx("
|
|
306
|
+
}), description != null && /*#__PURE__*/_jsx("div", {
|
|
300
307
|
...{
|
|
301
308
|
className: "x1ghz6dp xjb2p0i x141an7d x1sodnla x1ltkj2j xv1l7n4"
|
|
302
309
|
},
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* - /apps/storybook/stories/Button.stories.tsx (storybook stories)
|
|
12
12
|
* - /packages/cli/templates/blocks/components/Button/ (showcase blocks)
|
|
13
13
|
*
|
|
14
|
-
* Last synced props: label, variant, size, isDisabled, isLoading, clickAction, icon, isIconOnly, children, tooltip, endContent, href, as, target, rel
|
|
14
|
+
* Last synced props: label, variant, size, isDisabled, isLoading, isInterruptible, clickAction, icon, isIconOnly, children, tooltip, endContent, href, as, target, rel
|
|
15
15
|
*/
|
|
16
16
|
import { type ReactNode } from 'react';
|
|
17
17
|
import type { BaseProps } from '../BaseProps';
|
|
@@ -93,6 +93,16 @@ export interface ButtonProps extends BaseProps<HTMLButtonElement> {
|
|
|
93
93
|
* @default false
|
|
94
94
|
*/
|
|
95
95
|
isLoading?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Keep the button interactive while a `clickAction` is pending. The loading
|
|
98
|
+
* state still renders the spinner and `aria-busy`, but the button is not
|
|
99
|
+
* disabled and the in-flight action is not deduped — so a re-click lands and
|
|
100
|
+
* interrupts the previous action with a fresh one. Use for interruptible
|
|
101
|
+
* actions (e.g. a toggle whose action can be re-triggered before the previous
|
|
102
|
+
* one settles), not fire-once actions (submit/save/pay).
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
105
|
+
isInterruptible?: boolean;
|
|
96
106
|
/**
|
|
97
107
|
* Click handler. For async actions that should show a loading state,
|
|
98
108
|
* use `clickAction` instead.
|
|
@@ -175,7 +185,7 @@ export interface ButtonProps extends BaseProps<HTMLButtonElement> {
|
|
|
175
185
|
* <Button label="Open in new tab" href="https://example.com" target="_blank" rel="noopener noreferrer" />
|
|
176
186
|
* ```
|
|
177
187
|
*/
|
|
178
|
-
export declare function Button({ label, variant, size: sizeProp, type, isDisabled, isLoading, clickAction, icon, isIconOnly, children, endContent, tooltip, href, as, target, rel, xstyle, className, style, ref, ...props }: ButtonProps): ReactNode;
|
|
188
|
+
export declare function Button({ label, variant, size: sizeProp, type, isDisabled, isLoading, isInterruptible, clickAction, icon, isIconOnly, children, endContent, tooltip, href, as, target, rel, xstyle, className, style, ref, ...props }: ButtonProps): ReactNode;
|
|
179
189
|
export declare namespace Button {
|
|
180
190
|
var displayName: string;
|
|
181
191
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAoB3C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAoGrD,QAAA,MAAM,UAAU;;;;;;;;;;EAUd,CAAC;AAsGH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,EAAE,IAAI,CAAC;IACZ,WAAW,EAAE,IAAI,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,UAAU,CAAC;AAEjD,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC,oDAAoD;IACpD,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EA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1B;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAuHD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,OAAqB,EACrB,IAAI,EAAE,QAAQ,EACd,IAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,eAAuB,EACvB,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,QAAQ,EACR,UAAU,EACV,OAAO,EACP,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,SAAS,CAuMzB;yBA9Ne,MAAM"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* - /apps/storybook/stories/Button.stories.tsx (storybook stories)
|
|
16
16
|
* - /packages/cli/templates/blocks/components/Button/ (showcase blocks)
|
|
17
17
|
*
|
|
18
|
-
* Last synced props: label, variant, size, isDisabled, isLoading, clickAction, icon, isIconOnly, children, tooltip, endContent, href, as, target, rel
|
|
18
|
+
* Last synced props: label, variant, size, isDisabled, isLoading, isInterruptible, clickAction, icon, isIconOnly, children, tooltip, endContent, href, as, target, rel
|
|
19
19
|
*/
|
|
20
20
|
import { useRef, useTransition } from 'react';
|
|
21
21
|
import * as stylex from '@stylexjs/stylex';
|
|
@@ -88,6 +88,10 @@ const styles = {
|
|
|
88
88
|
kmuXW: "x2lah0s",
|
|
89
89
|
$$css: true
|
|
90
90
|
},
|
|
91
|
+
contentWrapper: {
|
|
92
|
+
k1xSpc: "xjp7ctv",
|
|
93
|
+
$$css: true
|
|
94
|
+
},
|
|
91
95
|
link: {
|
|
92
96
|
kybGjl: "x1hl2dhg",
|
|
93
97
|
$$css: true
|
|
@@ -202,6 +206,27 @@ const variants = {
|
|
|
202
206
|
* Button size type derived from the sizeStyles StyleX object
|
|
203
207
|
*/
|
|
204
208
|
|
|
209
|
+
const spinnerReveal = "x18re5ia-B";
|
|
210
|
+
const contentHide = "x188b6p3-B";
|
|
211
|
+
|
|
212
|
+
// Hold the loading swap for a short delay so a fast action (e.g. clickAction)
|
|
213
|
+
// that settles within the delay never flashes a spinner. The spinner fade-in
|
|
214
|
+
// and the content hide share the same delay so the button never shows an empty
|
|
215
|
+
// frame in between. Reduced motion is instant.
|
|
216
|
+
const SPINNER_DELAY = durationVars['--duration-medium-min'];
|
|
217
|
+
const loadingStyles = {
|
|
218
|
+
hiddenContent: {
|
|
219
|
+
kMwMTN: "x19co3pv",
|
|
220
|
+
$$css: true
|
|
221
|
+
},
|
|
222
|
+
hiddenContentDelayed: {
|
|
223
|
+
kKVMdj: "x1ffowhz",
|
|
224
|
+
k44tkh: "xjlvqhv",
|
|
225
|
+
kWV6AL: "x10e4vud",
|
|
226
|
+
kKxzle: "x17yabm6 x14q22ui",
|
|
227
|
+
$$css: true
|
|
228
|
+
}
|
|
229
|
+
};
|
|
205
230
|
const groupStyles = {
|
|
206
231
|
horizontal: {
|
|
207
232
|
krdFHd: "x15mokao x8eehn2",
|
|
@@ -265,6 +290,7 @@ export function Button({
|
|
|
265
290
|
type = 'button',
|
|
266
291
|
isDisabled = false,
|
|
267
292
|
isLoading = false,
|
|
293
|
+
isInterruptible = false,
|
|
268
294
|
clickAction,
|
|
269
295
|
icon,
|
|
270
296
|
isIconOnly = false,
|
|
@@ -284,10 +310,22 @@ export function Button({
|
|
|
284
310
|
const size = useSize(sizeProp, 'md');
|
|
285
311
|
const buttonGroup = useButtonGroup();
|
|
286
312
|
const [isPending, startTransition] = useTransition();
|
|
313
|
+
// clickAction is normally fire-once (submit/save/pay), so a same-tick
|
|
314
|
+
// double-click must dedupe — which neither isPending nor useOptimistic do.
|
|
315
|
+
// Hence the ref guard. Interruptible callers (e.g. ToggleButton) opt out so a
|
|
316
|
+
// re-click can land and interrupt the in-flight action with a fresh one.
|
|
287
317
|
const actionInFlightRef = useRef(false);
|
|
288
318
|
const isLoadingState = isLoading || isPending;
|
|
319
|
+
// Delay the spinner reveal for action-driven loading (clickAction's own
|
|
320
|
+
// transition) so a fast action that settles within the delay does not flash
|
|
321
|
+
// a spinner. Interruptible loading is delayed too, so rapid re-clicks settle
|
|
322
|
+
// before any spinner shows. Explicit isLoading-only stays immediate, since
|
|
323
|
+
// the consumer is deliberately showing it.
|
|
324
|
+
const delaySpinner = isPending || isInterruptible;
|
|
289
325
|
const groupDisabled = buttonGroup?.isDisabled ?? false;
|
|
290
|
-
|
|
326
|
+
// When interruptible, the loading state drives the spinner and aria-busy but
|
|
327
|
+
// not disabled, so clicks keep landing and can interrupt the in-flight action.
|
|
328
|
+
const buttonDisabled = isDisabled || groupDisabled || isLoadingState && !isInterruptible;
|
|
291
329
|
// isIconOnly prop is the source of truth for icon-only rendering.
|
|
292
330
|
// When false (default), label is always rendered as visible text.
|
|
293
331
|
|
|
@@ -301,7 +339,9 @@ export function Button({
|
|
|
301
339
|
// for keyboard users to reach the tooltip. Otherwise use native disabled.
|
|
302
340
|
const useAriaDisabled = tooltip != null && buttonDisabled;
|
|
303
341
|
const handleClick = e => {
|
|
304
|
-
|
|
342
|
+
// The ref guard dedupes fire-once actions. Interruptible callers skip it so
|
|
343
|
+
// a re-click while pending starts a fresh action that interrupts the prior.
|
|
344
|
+
if (buttonDisabled || actionInFlightRef.current && !isInterruptible) {
|
|
305
345
|
e.preventDefault();
|
|
306
346
|
return;
|
|
307
347
|
}
|
|
@@ -344,22 +384,20 @@ export function Button({
|
|
|
344
384
|
const buttonContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
345
385
|
children: [isLoadingState && /*#__PURE__*/_jsx("span", {
|
|
346
386
|
...{
|
|
347
|
-
|
|
348
|
-
|
|
387
|
+
0: {
|
|
388
|
+
className: "x10l6tqk x13vifvy xu96u03 x3m8u43 x1ey2m1c xrvj5dj x1ku5rj1"
|
|
389
|
+
},
|
|
390
|
+
1: {
|
|
391
|
+
className: "x10l6tqk x13vifvy xu96u03 x3m8u43 x1ey2m1c xrvj5dj x1ku5rj1 xqcmdr3 xb2rp9n xskzprw x17yabm6 x14q22ui"
|
|
392
|
+
}
|
|
393
|
+
}[!!delaySpinner << 0],
|
|
349
394
|
"aria-hidden": "true",
|
|
350
395
|
children: /*#__PURE__*/_jsx(Spinner, {
|
|
351
396
|
size: "sm",
|
|
352
397
|
shade: "inherit"
|
|
353
398
|
})
|
|
354
399
|
}), /*#__PURE__*/_jsxs("span", {
|
|
355
|
-
...
|
|
356
|
-
0: {
|
|
357
|
-
className: "xjp7ctv"
|
|
358
|
-
},
|
|
359
|
-
1: {
|
|
360
|
-
className: "xjp7ctv x19co3pv"
|
|
361
|
-
}
|
|
362
|
-
}[!!isLoadingState << 0],
|
|
400
|
+
...stylex.props(styles.contentWrapper, isLoadingState && (delaySpinner ? loadingStyles.hiddenContentDelayed : loadingStyles.hiddenContent)),
|
|
363
401
|
"aria-hidden": isLoadingState || undefined,
|
|
364
402
|
children: [icon && /*#__PURE__*/_jsx("span", {
|
|
365
403
|
...stylex.props(styles.iconWrapper, iconSizeStyles[size]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KA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,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,YAAgB,EAChB,SAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+BA8CjB;yBA1De,UAAU"}
|
|
@@ -96,7 +96,13 @@ export function EmptyState({
|
|
|
96
96
|
1: {
|
|
97
97
|
className: "x1ghz6dp xjb2p0i x2mo6ok xf74fhv x1tgivj0 xcr08ib"
|
|
98
98
|
}
|
|
99
|
-
}[!!isCompact << 0], title), description != null &&
|
|
99
|
+
}[!!isCompact << 0], title), description != null &&
|
|
100
|
+
/*#__PURE__*/
|
|
101
|
+
// Rendered as <div> (not <p>): description accepts ReactNode and a
|
|
102
|
+
// <p> cannot legally contain block children, which causes hydration
|
|
103
|
+
// mismatches. The StyleX style sets margin: 0, so appearance is
|
|
104
|
+
// unchanged.
|
|
105
|
+
_jsx("div", {
|
|
100
106
|
...{
|
|
101
107
|
0: {
|
|
102
108
|
className: "x1ghz6dp xjb2p0i xjm74w1 x1sodnla xw6l6zx xv1l7n4"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file HoverCard.tsx
|
|
3
|
-
* @input Uses React,
|
|
3
|
+
* @input Uses React, useHoverCard hook
|
|
4
4
|
* @output Exports HoverCard component for hover/focus triggered layers
|
|
5
|
-
* @position Layer component; uses inline-safe trigger wrapper and
|
|
5
|
+
* @position Layer component; uses inline-safe trigger wrapper and renders the floating layer inline
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update these files to stay in sync:
|
|
8
8
|
* - /packages/core/src/HoverCard/HoverCard.test.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/HoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,
|
|
1
|
+
{"version":3,"file":"HoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/HoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG7E,OAAO,EAAe,KAAK,qBAAqB,EAAC,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,YAAY,EAAC,qBAAqB,EAAC,MAAM,gBAAgB,CAAC;AAiB1D,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAEzC;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAEtC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAiBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,OAAO,EACP,SAAmB,EACnB,SAAoB,EACpB,KAAW,EACX,SAAe,EACf,YAAqB,EACrB,SAAgB,EAChB,YAAY,EACZ,kBAA2B,EAC3B,MAAM,EACN,aAAa,EACb,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,cAAc,GAAG,YAAY,CAgH/B;yBAhIe,SAAS"}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file HoverCard.tsx
|
|
7
|
-
* @input Uses React,
|
|
7
|
+
* @input Uses React, useHoverCard hook
|
|
8
8
|
* @output Exports HoverCard component for hover/focus triggered layers
|
|
9
|
-
* @position Layer component; uses inline-safe trigger wrapper and
|
|
9
|
+
* @position Layer component; uses inline-safe trigger wrapper and renders the floating layer inline
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
12
12
|
* - /packages/core/src/HoverCard/HoverCard.test.tsx
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
* - /apps/storybook/stories/HoverCard.stories.tsx
|
|
15
15
|
* - /packages/cli/templates/blocks/components/HoverCard/ (showcase blocks)
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
18
|
-
import { createPortal } from 'react-dom';
|
|
17
|
+
import { useCallback, useRef } from 'react';
|
|
19
18
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
20
19
|
import * as stylex from '@stylexjs/stylex';
|
|
21
20
|
import { useHoverCard } from "./useHoverCard.js";
|
|
@@ -125,11 +124,24 @@ export function HoverCard({
|
|
|
125
124
|
}
|
|
126
125
|
};
|
|
127
126
|
}, [textOnly, hoverCard.ref, hoverCard.describedBy]);
|
|
128
|
-
|
|
127
|
+
|
|
128
|
+
// Render the floating layer inline, in the same place on the server and the
|
|
129
|
+
// client. The layer is a `popover` element opened via the Popover API, so the
|
|
130
|
+
// browser promotes it to the top layer when shown — that already escapes
|
|
131
|
+
// ancestor clipping, stacking, and transform containing-block traps, and CSS
|
|
132
|
+
// anchor positioning resolves the trigger reference regardless of where the
|
|
133
|
+
// element sits in the DOM, so no portal is needed to "escape" layout.
|
|
134
|
+
//
|
|
135
|
+
// The layer renders as inline-safe phrasing markup (a `<span>`, see
|
|
136
|
+
// useHoverCard), which stays put inside a `<p>` instead of being reparented
|
|
137
|
+
// by the HTML parser. That keeps the server markup and the first client
|
|
138
|
+
// render identical, so there is no hydration mismatch — and it preserves the
|
|
139
|
+
// inline-safety guarantee (no block elements injected into a paragraph).
|
|
140
|
+
const renderedHoverCard = hoverCard.renderHoverCard(content, {
|
|
129
141
|
xstyle,
|
|
130
142
|
className,
|
|
131
143
|
style
|
|
132
|
-
})
|
|
144
|
+
});
|
|
133
145
|
|
|
134
146
|
// For text-only children: use inline span with ref on wrapper
|
|
135
147
|
if (textOnly) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;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;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAyBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CA4R5E"}
|
|
@@ -261,11 +261,15 @@ export function useHoverCard(options = {}) {
|
|
|
261
261
|
const renderProps = {
|
|
262
262
|
placement: renderPlacement,
|
|
263
263
|
alignment: props?.alignment ?? alignment,
|
|
264
|
-
|
|
264
|
+
role: 'dialog',
|
|
265
|
+
xstyle: [popoverXstyle, layerAnimations[renderPlacement]],
|
|
266
|
+
// Render the layer as inline-safe phrasing markup so HoverCard stays
|
|
267
|
+
// valid (and hydration-stable) inside inline contexts like a `<p>`.
|
|
268
|
+
as: 'span'
|
|
265
269
|
};
|
|
266
|
-
return layer.render(/*#__PURE__*/_jsx("
|
|
270
|
+
return layer.render(/*#__PURE__*/_jsx("span", {
|
|
267
271
|
...mergeProps(themeProps('hovercard'), {
|
|
268
|
-
className: "x1vlblms xvmdzux x126nfab x1t818jl"
|
|
272
|
+
className: "x1lliihq x1vlblms xvmdzux x126nfab x1t818jl"
|
|
269
273
|
}),
|
|
270
274
|
onMouseEnter: () => {
|
|
271
275
|
isHoveringContentRef.current = true;
|
package/dist/Kbd/Kbd.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Kbd.d.ts","sourceRoot":"","sources":["../../src/Kbd/Kbd.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAiG5C,MAAM,WAAW,QAAS,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC1D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"Kbd.d.ts","sourceRoot":"","sources":["../../src/Kbd/Kbd.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAiG5C,MAAM,WAAW,QAAS,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC1D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,GAAG,CAAC,EAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAC,EAAE,QAAQ,qBA2B3E;yBA3Be,GAAG"}
|