@fibrae/semi-foundation 0.4.0 → 0.5.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/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/components/date-picker/foundation.d.ts +1 -1
- package/dist/components/date-picker/months-grid-foundation.d.ts +2 -2
- package/dist/components/dropdown/menu-foundation.d.ts +1 -1
- package/dist/components/notification/notification-list-foundation.d.ts +3 -3
- package/dist/components/select/foundation.d.ts +1 -1
- package/dist/utils/announcer.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ import en_GB from '@fibrae/semi-ui-react/locale/source/en_GB';
|
|
|
65
65
|
</LocaleProvider>;
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
The Vue package's `LocaleProvider` has the same name and takes `:locale`. For adding text or accessible names and filling in every locale pack, see [locale-text](
|
|
68
|
+
The Vue package's `LocaleProvider` has the same name and takes `:locale`. For adding text or accessible names and filling in every locale pack, see [locale-text](../../../.agents/skills/locale-text/SKILL.md).
|
|
69
69
|
|
|
70
70
|
## Related packages
|
|
71
71
|
|
|
@@ -76,4 +76,4 @@ The Vue package's `LocaleProvider` has the same name and takes `:locale`. For ad
|
|
|
76
76
|
|
|
77
77
|
`pnpm --filter @fibrae/semi-foundation build` runs `vp pack`: `src/**/*.ts` emits ESM and type declarations file by file, component SCSS compiles to CSS, and theme tokens compile into `base/tokens.css`. Type checks in the UI packages read the types built here.
|
|
78
78
|
|
|
79
|
-
For general commands, see [CONTRIBUTING.md](
|
|
79
|
+
For general commands, see [CONTRIBUTING.md](../../../CONTRIBUTING.md#常用命令) at the repository root. For how to write styles, the `semi:` importer and the theme token protocol, see the 「组件 SCSS」, 「Sass 模块与 semi: importer」 and 「主题 token 协议」 sections of [styles](../../../.agents/references/styles.md).
|
package/README.zh-CN.md
CHANGED
|
@@ -65,7 +65,7 @@ import en_GB from '@fibrae/semi-ui-react/locale/source/en_GB';
|
|
|
65
65
|
</LocaleProvider>;
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Vue 包的 `LocaleProvider` 同名,通过 `:locale` 传入。新增文案或可访问名称、补齐全部语言包的步骤见 [locale-text](
|
|
68
|
+
Vue 包的 `LocaleProvider` 同名,通过 `:locale` 传入。新增文案或可访问名称、补齐全部语言包的步骤见 [locale-text](../../../.agents/skills/locale-text/SKILL.md)。
|
|
69
69
|
|
|
70
70
|
## 与其他包的关系
|
|
71
71
|
|
|
@@ -76,4 +76,4 @@ Vue 包的 `LocaleProvider` 同名,通过 `:locale` 传入。新增文案或
|
|
|
76
76
|
|
|
77
77
|
`pnpm --filter @fibrae/semi-foundation build` 执行 `vp pack`:`src/**/*.ts` 逐文件输出 ESM 与类型声明,组件 SCSS 编译为 CSS,主题 token 编译进 `base/tokens.css`。各框架 UI 包的类型检查读取这里已构建的类型。
|
|
78
78
|
|
|
79
|
-
通用命令见根目录 [CONTRIBUTING.md](
|
|
79
|
+
通用命令见根目录 [CONTRIBUTING.md](../../../CONTRIBUTING.md#常用命令)。样式写法、`semi:` importer 与主题 token 协议见 [styles](../../../.agents/references/styles.md) 的「组件 SCSS」「Sass 模块与 semi: importer」「主题 token 协议」等节。
|
|
@@ -220,7 +220,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
220
220
|
/** A controlled `open` is not copied into state; a disabled picker shows no panel */
|
|
221
221
|
static isPanelShown(props: Pick<DatePickerFoundationProps, 'open' | 'disabled'>, state: Pick<DatePickerFoundationState, 'panelShow'>): boolean;
|
|
222
222
|
/** The rtl default of `position`, for the position `normalizeProps` left unset; `direction` is read from the host's config */
|
|
223
|
-
static getPosition<P extends string>(position?: P, direction?: string): "
|
|
223
|
+
static getPosition<P extends string>(position?: P, direction?: string): "bottomRight" | "bottomLeft" | P;
|
|
224
224
|
static normalizeProps<P extends string = Position>({ type, format, rangeSeparator, insetInput, position, spacing }: Pick<DatePickerFoundationProps, 'type' | 'format' | 'rangeSeparator' | 'insetInput' | 'spacing'> & {
|
|
225
225
|
position?: P;
|
|
226
226
|
}): {
|
|
@@ -109,10 +109,10 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
109
109
|
* Which panels show their year and month picker; while one does, its weeks need a minHeight, or a change of the
|
|
110
110
|
* number of weeks makes the scroll list unstable
|
|
111
111
|
*/
|
|
112
|
-
static getYAMOpenType(state: Pick<MonthsGridFoundationState, 'monthLeft' | 'monthRight'>): "none" | "
|
|
112
|
+
static getYAMOpenType(state: Pick<MonthsGridFoundationState, 'monthLeft' | 'monthRight'>): "none" | "left" | "right" | "both";
|
|
113
113
|
static isYearOrTime(panel: PanelState): boolean;
|
|
114
114
|
/** The `x-open-type` of a panel: what it shows in place of, or beside, its month */
|
|
115
|
-
static getOpenType(panel: PanelState): "
|
|
115
|
+
static getOpenType(panel: PanelState): "date" | "year" | "time";
|
|
116
116
|
static formatMonthText(locale: Pick<Locale['DatePicker'], 'monthText' | 'months'>, month?: Date): string;
|
|
117
117
|
/** The texts of a panel's date and time switch; the date is the picked range endpoint, else the shown date */
|
|
118
118
|
static getSwitchTexts({ rangeEndpoint, showDate, dateFormat, format: formatProp, locale, dateFnsLocale }: {
|
|
@@ -4,7 +4,7 @@ export type DropdownSelectionMode = 'single' | 'multiple';
|
|
|
4
4
|
* Role and checked state of a menu item, from the menu's selectionMode (as React Aria Menu) and showTick. Without a
|
|
5
5
|
* selectionMode a tick shows a checked state, so showTick alone makes the items checkboxes.
|
|
6
6
|
*/
|
|
7
|
-
export declare function getItemRole(selectionMode?: DropdownSelectionMode, showTick?: boolean): "
|
|
7
|
+
export declare function getItemRole(selectionMode?: DropdownSelectionMode, showTick?: boolean): "menuitemradio" | "menuitemcheckbox" | "menuitem";
|
|
8
8
|
/**
|
|
9
9
|
* What a Dropdown provides to everything inside its popup, read by the menus there and by a Dropdown whose trigger is
|
|
10
10
|
* one of their items. A framework adapter passes it as the foundation context, with the reading direction added.
|
|
@@ -47,14 +47,14 @@ export default class NotificationListStore {
|
|
|
47
47
|
icon?: any;
|
|
48
48
|
getPopupContainer?: () => HTMLElement;
|
|
49
49
|
theme?: NoticeTheme;
|
|
50
|
-
direction?: "
|
|
50
|
+
direction?: "ltr" | "rtl";
|
|
51
51
|
className?: string;
|
|
52
52
|
style?: any;
|
|
53
53
|
stack?: boolean | number;
|
|
54
|
+
left?: number | string;
|
|
55
|
+
right?: number | string;
|
|
54
56
|
top?: number | string;
|
|
55
57
|
bottom?: number | string;
|
|
56
|
-
right?: number | string;
|
|
57
|
-
left?: number | string;
|
|
58
58
|
};
|
|
59
59
|
subscribe: (listener: () => void) => () => void;
|
|
60
60
|
getSnapshot: () => NotificationListState;
|
|
@@ -69,7 +69,7 @@ export default class SelectFoundation<P extends SelectBaseProps = SelectBaseProp
|
|
|
69
69
|
};
|
|
70
70
|
protected initOnce(): void;
|
|
71
71
|
/** The rtl default of `position`; `direction` is read from the host's config */
|
|
72
|
-
static getPosition<P extends string>(position?: P, direction?: string): "
|
|
72
|
+
static getPosition<P extends string>(position?: P, direction?: string): "bottomRight" | "bottomLeft" | P;
|
|
73
73
|
static getVisibleOptions<O extends Pick<OptionRecord, 'show'>>(options: O[]): O[];
|
|
74
74
|
/** The index the combobox points at with `aria-activedescendant`, or undefined when no option is highlighted */
|
|
75
75
|
static getActiveOptionIndex({ isOpen, loading, focusIndex, visibleCount }: {
|
|
@@ -6,7 +6,7 @@ export declare const ANNOUNCE_HOLD = 1000;
|
|
|
6
6
|
* Whether a Toast or Notification of this type is an alert, which its own `role="alert"` announces; the list's
|
|
7
7
|
* announcer skips it so it is not read twice.
|
|
8
8
|
*/
|
|
9
|
-
export declare function isAlertType(type?: string): type is "
|
|
9
|
+
export declare function isAlertType(type?: string): type is "warning" | "error";
|
|
10
10
|
/**
|
|
11
11
|
* The messages for the list's announcer: those new since `shownIds` (the ids of the previous render) or updated in
|
|
12
12
|
* place, alerts excepted. The caller owns `shownIds` and replaces it with the current ids afterwards.
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibrae/semi-foundation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://semi-design-next.pages.dev",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/smile-alive/semi-design-next.git",
|
|
10
|
-
"directory": "packages/semi-foundation"
|
|
10
|
+
"directory": "packages/shared/semi-foundation"
|
|
11
11
|
},
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/smile-alive/semi-design-next/issues"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@date-fns/tz": "^1.5.0",
|
|
27
27
|
"@dnd-kit/dom": "~0.5.1",
|
|
28
|
-
"@fibrae/semi-json-viewer-core": "0.
|
|
28
|
+
"@fibrae/semi-json-viewer-core": "0.5.0",
|
|
29
29
|
"@mdx-js/mdx": "^3.1.1",
|
|
30
30
|
"@shikijs/core": "^4.5.0",
|
|
31
31
|
"clsx": "^2.1.1",
|