@stapel/listings-react 0.4.0 → 0.8.0
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 +180 -0
- package/dist/api/generated/schema.d.ts +94 -4
- package/dist/api/generated/schema.d.ts.map +1 -1
- package/dist/default/FavoritesPane.d.ts +40 -3
- package/dist/default/FavoritesPane.d.ts.map +1 -1
- package/dist/default/FavoritesPane.js +30 -18
- package/dist/default/FavoritesPane.js.map +1 -1
- package/dist/default/ListingCard.d.ts +81 -4
- package/dist/default/ListingCard.d.ts.map +1 -1
- package/dist/default/ListingCard.js +97 -27
- package/dist/default/ListingCard.js.map +1 -1
- package/dist/default/ListingComposerPage.d.ts +163 -23
- package/dist/default/ListingComposerPage.d.ts.map +1 -1
- package/dist/default/ListingComposerPage.js +85 -43
- package/dist/default/ListingComposerPage.js.map +1 -1
- package/dist/default/ListingDetailPane.d.ts +41 -4
- package/dist/default/ListingDetailPane.d.ts.map +1 -1
- package/dist/default/ListingDetailPane.js +38 -25
- package/dist/default/ListingDetailPane.js.map +1 -1
- package/dist/default/ListingPhoto.d.ts +13 -1
- package/dist/default/ListingPhoto.d.ts.map +1 -1
- package/dist/default/ListingPhoto.js +47 -9
- package/dist/default/ListingPhoto.js.map +1 -1
- package/dist/default/ListingPrice.d.ts +13 -0
- package/dist/default/ListingPrice.d.ts.map +1 -0
- package/dist/default/ListingPrice.js +60 -0
- package/dist/default/ListingPrice.js.map +1 -0
- package/dist/default/MyListingsPane.d.ts +7 -28
- package/dist/default/MyListingsPane.d.ts.map +1 -1
- package/dist/default/MyListingsPane.js +136 -67
- package/dist/default/MyListingsPane.js.map +1 -1
- package/dist/default/SignInLink.js +8 -7
- package/dist/default/SignInLink.js.map +1 -1
- package/dist/default/StatusTags.d.ts +16 -5
- package/dist/default/StatusTags.d.ts.map +1 -1
- package/dist/default/StatusTags.js +19 -13
- package/dist/default/StatusTags.js.map +1 -1
- package/dist/default/index.d.ts +15 -9
- package/dist/default/index.d.ts.map +1 -1
- package/dist/default/index.js +13 -6
- package/dist/default/index.js.map +1 -1
- package/dist/headless/Favorites.d.ts +6 -0
- package/dist/headless/Favorites.d.ts.map +1 -1
- package/dist/headless/Favorites.js +23 -7
- package/dist/headless/Favorites.js.map +1 -1
- package/dist/headless/ListingActions.d.ts +12 -0
- package/dist/headless/ListingActions.d.ts.map +1 -1
- package/dist/headless/ListingActions.js +3 -0
- package/dist/headless/ListingActions.js.map +1 -1
- package/dist/headless/ListingComposer.d.ts +23 -0
- package/dist/headless/ListingComposer.d.ts.map +1 -1
- package/dist/headless/ListingComposer.js +33 -7
- package/dist/headless/ListingComposer.js.map +1 -1
- package/dist/headless/ListingDetail.d.ts.map +1 -1
- package/dist/headless/ListingDetail.js +7 -5
- package/dist/headless/ListingDetail.js.map +1 -1
- package/dist/headless/useMandateGate.d.ts +33 -2
- package/dist/headless/useMandateGate.d.ts.map +1 -1
- package/dist/headless/useMandateGate.js +42 -4
- package/dist/headless/useMandateGate.js.map +1 -1
- package/dist/i18n/es.d.ts +6 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +23 -5
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/generated/errors.es.gen.d.ts +1 -1
- package/dist/i18n/generated/errors.es.gen.js +1 -1
- package/dist/i18n/generated/errors.gen.d.ts +6 -0
- package/dist/i18n/generated/errors.gen.d.ts.map +1 -1
- package/dist/i18n/generated/errors.gen.js +3 -0
- package/dist/i18n/generated/errors.gen.js.map +1 -1
- package/dist/i18n/generated/errors.ru.gen.d.ts +1 -1
- package/dist/i18n/generated/errors.ru.gen.js +1 -1
- package/dist/i18n/keys.d.ts +30 -3
- package/dist/i18n/keys.d.ts.map +1 -1
- package/dist/i18n/keys.js +47 -7
- package/dist/i18n/keys.js.map +1 -1
- package/dist/i18n/ru.d.ts +16 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +35 -5
- package/dist/i18n/ru.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/draft.d.ts +9 -6
- package/dist/model/draft.d.ts.map +1 -1
- package/dist/model/draft.js +3 -1
- package/dist/model/draft.js.map +1 -1
- package/dist/model/features.d.ts +21 -7
- package/dist/model/features.d.ts.map +1 -1
- package/dist/model/features.js +26 -0
- package/dist/model/features.js.map +1 -1
- package/llms.txt +9 -8
- package/manifest.json +82 -31
- package/nav-manifest.json +1 -1
- package/package.json +19 -14
- package/src/analytics/generated/events.json +1 -1
- package/src/api/generated/schema.ts +94 -4
- package/src/default/FavoritesPane.tsx +156 -82
- package/src/default/ListingCard.tsx +283 -116
- package/src/default/ListingComposerPage.tsx +403 -187
- package/src/default/ListingDetailPane.tsx +200 -98
- package/src/default/ListingPhoto.tsx +89 -16
- package/src/default/ListingPrice.tsx +77 -0
- package/src/default/MyListingsPane.tsx +286 -228
- package/src/default/SignInLink.tsx +4 -4
- package/src/default/StatusTags.tsx +36 -18
- package/src/default/index.ts +18 -7
- package/src/headless/Favorites.tsx +36 -7
- package/src/headless/ListingActions.tsx +19 -0
- package/src/headless/ListingComposer.tsx +56 -5
- package/src/headless/ListingDetail.tsx +12 -5
- package/src/headless/useMandateGate.ts +49 -5
- package/src/i18n/es.ts +29 -5
- package/src/i18n/generated/errors.es.gen.ts +1 -1
- package/src/i18n/generated/errors.gen.ts +3 -0
- package/src/i18n/generated/errors.json +7 -0
- package/src/i18n/generated/errors.ru.gen.ts +1 -1
- package/src/i18n/keys.ts +54 -7
- package/src/i18n/ru.ts +41 -5
- package/src/index.ts +5 -1
- package/src/model/draft.ts +12 -7
- package/src/model/features.ts +48 -7
- package/dist/default/ErrorAlert.d.ts +0 -9
- package/dist/default/ErrorAlert.d.ts.map +0 -1
- package/dist/default/ErrorAlert.js +0 -27
- package/dist/default/ErrorAlert.js.map +0 -1
- package/dist/default/theme.d.ts +0 -25
- package/dist/default/theme.d.ts.map +0 -1
- package/dist/default/theme.js +0 -40
- package/dist/default/theme.js.map +0 -1
- package/src/default/ErrorAlert.tsx +0 -46
- package/src/default/theme.tsx +0 -67
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The one error surface this pair's default skin renders, so the split copy
|
|
3
|
-
* core produces reaches a screen the same way everywhere (mirrors the
|
|
4
|
-
* docs/notifications/workspaces etalon).
|
|
5
|
-
*
|
|
6
|
-
* Core's `describeFlowError` splits a failure into the sentence a person
|
|
7
|
-
* reads and the technical detail a support agent quotes (owner report
|
|
8
|
-
* 2026-08-09: the status used to be spliced into the sentence, ending in a
|
|
9
|
-
* bare `" (500)"`). The split only helps if a skin renders both halves at
|
|
10
|
-
* their own weights: `message` at normal weight, `detail` muted and small.
|
|
11
|
-
*
|
|
12
|
-
* `undefined` in — including a `detail` core left `undefined` because there
|
|
13
|
-
* was nothing worth quoting — renders nothing rather than an empty line.
|
|
14
|
-
*/
|
|
15
|
-
import { Alert, Typography } from "antd";
|
|
16
|
-
import type { CSSProperties, ReactElement, ReactNode } from "react";
|
|
17
|
-
import type { FlowErrorDisplay } from "@stapel/core";
|
|
18
|
-
|
|
19
|
-
export function ErrorAlert(props: {
|
|
20
|
-
error: FlowErrorDisplay | undefined;
|
|
21
|
-
style?: CSSProperties | undefined;
|
|
22
|
-
testId?: string | undefined;
|
|
23
|
-
action?: ReactNode;
|
|
24
|
-
}): ReactElement | null {
|
|
25
|
-
const { error } = props;
|
|
26
|
-
if (!error) return null;
|
|
27
|
-
return (
|
|
28
|
-
<Alert
|
|
29
|
-
type="error"
|
|
30
|
-
showIcon
|
|
31
|
-
{...(props.style ? { style: props.style } : {})}
|
|
32
|
-
{...(props.testId ? { "data-testid": props.testId } : {})}
|
|
33
|
-
{...(props.action ? { action: props.action } : {})}
|
|
34
|
-
message={error.message}
|
|
35
|
-
{...(error.detail
|
|
36
|
-
? {
|
|
37
|
-
description: (
|
|
38
|
-
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
|
39
|
-
{error.detail}
|
|
40
|
-
</Typography.Text>
|
|
41
|
-
),
|
|
42
|
-
}
|
|
43
|
-
: {})}
|
|
44
|
-
/>
|
|
45
|
-
);
|
|
46
|
-
}
|
package/src/default/theme.tsx
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The default skin's INTERNAL theme provider — every `/default` surface wraps
|
|
3
|
-
* itself in this, so the skin is readable no matter what the host supplies
|
|
4
|
-
* (tracker #26: a skin set with no internal provider once inherited a theme
|
|
5
|
-
* bridge serving light-mode values inside a dark document — text on
|
|
6
|
-
* background at 1.00:1). The theme derives from `@stapel/tokens` via
|
|
7
|
-
* `@stapel/tokens-antd`'s `toAntdThemeConfig(mode)`; `mode` defaults to what
|
|
8
|
-
* the HOST's document declares (`resolveThemeMode()` — the `data-theme`
|
|
9
|
-
* attribute `tokens.css` keys its dark block on), never to a hardcoded side.
|
|
10
|
-
*
|
|
11
|
-
* This is also what "override styles" means for this pair: a storefront
|
|
12
|
-
* retheming through the §68 token JSON regenerates its `--stapel-*` custom
|
|
13
|
-
* properties and the result page follows with zero code — a far better deal
|
|
14
|
-
* than a prop-per-colour API, and the reason the skin has none.
|
|
15
|
-
*/
|
|
16
|
-
import { useMemo } from "react";
|
|
17
|
-
import type { CSSProperties, ReactElement, ReactNode } from "react";
|
|
18
|
-
import { ConfigProvider } from "antd";
|
|
19
|
-
import {
|
|
20
|
-
resolveThemeMode,
|
|
21
|
-
toAntdTheme,
|
|
22
|
-
toAntdThemeConfig,
|
|
23
|
-
} from "@stapel/tokens-antd";
|
|
24
|
-
import type { ThemeMode } from "@stapel/tokens-antd";
|
|
25
|
-
|
|
26
|
-
export interface ListingsSkinThemeProps {
|
|
27
|
-
/**
|
|
28
|
-
* Light or dark. Defaults to the mode the host's document declares
|
|
29
|
-
* (`resolveThemeMode()`). Pass explicitly to pin a side.
|
|
30
|
-
*/
|
|
31
|
-
readonly mode?: ThemeMode;
|
|
32
|
-
/** Extra styles merged onto the themed root element (layout only — colors
|
|
33
|
-
* come from the mode). */
|
|
34
|
-
readonly style?: CSSProperties;
|
|
35
|
-
readonly children: ReactNode;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* `<ListingsSkinTheme/>` — the self-theming wrapper of
|
|
40
|
-
* `@stapel/listings-react/default`. Standalone use is supported (wrap any
|
|
41
|
-
* composition of the skin's parts once); the shipped surfaces
|
|
42
|
-
* (`ListingCard`, `ListingDetailPane`, `ListingComposerPage`,
|
|
43
|
-
* `MyListingsPane`, `FavoritesPane`)
|
|
44
|
-
* each already wrap themselves, and nested antd
|
|
45
|
-
* `ConfigProvider`s merge, so composing them under one `ListingsSkinTheme`
|
|
46
|
-
* stays correct.
|
|
47
|
-
*/
|
|
48
|
-
export function ListingsSkinTheme(props: ListingsSkinThemeProps): ReactElement {
|
|
49
|
-
const mode = props.mode ?? resolveThemeMode();
|
|
50
|
-
const theme = useMemo(() => toAntdThemeConfig(mode), [mode]);
|
|
51
|
-
const token = useMemo(() => toAntdTheme(mode), [mode]);
|
|
52
|
-
return (
|
|
53
|
-
<ConfigProvider theme={theme}>
|
|
54
|
-
<div
|
|
55
|
-
data-listings-skin-root
|
|
56
|
-
data-listings-skin-mode={mode}
|
|
57
|
-
style={{
|
|
58
|
-
color: token.colorText,
|
|
59
|
-
backgroundColor: token.colorBgContainer,
|
|
60
|
-
...props.style,
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
{props.children}
|
|
64
|
-
</div>
|
|
65
|
-
</ConfigProvider>
|
|
66
|
-
);
|
|
67
|
-
}
|