@gridui/inline-notice 0.0.0-stage → 0.0.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 +15 -2
- package/dist/index.d.ts +8 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +7 -0
- package/dist/inline-notice/inline-notice.d.ts +15 -0
- package/dist/styles.css +43 -0
- package/package.json +47 -3
package/README.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gridui/inline-notice
|
|
2
|
+
|
|
3
|
+
Core family. Public API: `InlineNotice`, `InlineNoticeProps`.
|
|
4
|
+
|
|
5
|
+
Import components from `@gridui/inline-notice` and load `@gridui/inline-notice/styles.css` after Theme.
|
|
6
|
+
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
|
+
|
|
8
|
+
See [component ownership](../../docs/component-ownership.md) and [release history](.changeset/history/).
|
|
9
|
+
|
|
10
|
+
## Inline feedback
|
|
11
|
+
|
|
12
|
+
Import `InlineNotice` and its props from Data; see the
|
|
13
|
+
[announcement and actions contract](docs/inline-notice.md). Tone and announcement
|
|
14
|
+
policy remain independent. Applications can supply an action component without
|
|
15
|
+
making Data depend on that component's package.
|
|
2
16
|
|
|
3
|
-
This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/inline-notice/inline-notice.tsx
|
|
2
|
+
import { cn } from "@gridui/style-utils";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var announcementRoles = {
|
|
5
|
+
off: void 0,
|
|
6
|
+
polite: "status",
|
|
7
|
+
assertive: "alert"
|
|
8
|
+
};
|
|
9
|
+
var InlineNotice = (props) => {
|
|
10
|
+
const { title, icon, actions, tone = "neutral", announcement = "off", children, className, ...restProps } = props;
|
|
11
|
+
return /* @__PURE__ */ jsxs(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
...restProps,
|
|
15
|
+
className: cn("gridui-inline-notice", className),
|
|
16
|
+
"data-tone": tone,
|
|
17
|
+
children: [
|
|
18
|
+
icon && /* @__PURE__ */ jsx(
|
|
19
|
+
"span",
|
|
20
|
+
{
|
|
21
|
+
className: "gridui-inline-notice-icon",
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
children: icon
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsxs(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: "gridui-inline-notice-content",
|
|
30
|
+
role: announcementRoles[announcement],
|
|
31
|
+
"aria-live": announcement,
|
|
32
|
+
"aria-atomic": announcement === "off" ? void 0 : true,
|
|
33
|
+
children: [
|
|
34
|
+
title !== void 0 && title !== null && /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: "gridui-inline-notice-title",
|
|
38
|
+
children: title
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
children
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
actions && /* @__PURE__ */ jsx(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: "gridui-inline-notice-actions",
|
|
49
|
+
children: actions
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
InlineNotice
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/inline-notice/inline-notice.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Inline Notice\n * @namespace InlineNotice\n * @description Inline Notice\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type InlineNoticeProps = Omit<ComponentPropsWithRef<\"div\">, \"title\" | \"role\" | \"aria-live\"> & {\n readonly title?: ReactNode;\n readonly icon?: ReactNode;\n readonly actions?: ReactNode;\n readonly tone?: \"neutral\" | \"success\" | \"warning\" | \"danger\";\n readonly announcement?: \"off\" | \"polite\" | \"assertive\";\n};\n\nconst announcementRoles = {\n off: undefined,\n polite: \"status\",\n assertive: \"alert\",\n} as const;\n\nexport const InlineNotice: FC<InlineNoticeProps> = (props: InlineNoticeProps) => {\n const { title, icon, actions, tone = \"neutral\", announcement = \"off\", children, className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"gridui-inline-notice\", className)}\n data-tone={tone}\n >\n {icon && (<span\n className=\"gridui-inline-notice-icon\"\n aria-hidden=\"true\"\n >\n {icon}\n </span>)}\n <div\n className=\"gridui-inline-notice-content\"\n role={announcementRoles[announcement]}\n aria-live={announcement}\n aria-atomic={announcement === \"off\" ? undefined : true}\n >\n {title !== undefined && title !== null && (<div\n className=\"gridui-inline-notice-title\"\n >\n {title}\n </div>)}\n {children}\n </div>\n {actions && (<div\n className=\"gridui-inline-notice-actions\"\n >\n {actions}\n </div>)}\n </div>);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,UAAU;AAwBD,cAMV,YANU;AAblB,IAAM,oBAAoB;AAAA,EACtB,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,WAAW;AACf;AAEO,IAAM,eAAsC,CAAC,UAA6B;AAC7E,QAAM,EAAE,OAAO,MAAM,SAAS,OAAO,WAAW,eAAe,OAAO,UAAU,WAAW,GAAG,UAAU,IAAI;AAC5G,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAW,GAAG,wBAAwB,SAAS;AAAA,MAC/C,aAAW;AAAA,MAEV;AAAA,gBAAS;AAAA,UAAC;AAAA;AAAA,YACP,WAAU;AAAA,YACV,eAAY;AAAA,YAEX;AAAA;AAAA,QACL;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACG,WAAU;AAAA,YACV,MAAM,kBAAkB,YAAY;AAAA,YACpC,aAAW;AAAA,YACX,eAAa,iBAAiB,QAAQ,SAAY;AAAA,YAEjD;AAAA,wBAAU,UAAa,UAAU,QAAS;AAAA,gBAAC;AAAA;AAAA,kBACxC,WAAU;AAAA,kBAET;AAAA;AAAA,cACL;AAAA,cACC;AAAA;AAAA;AAAA,QACL;AAAA,QACC,WAAY;AAAA,UAAC;AAAA;AAAA,YACV,WAAU;AAAA,YAET;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACJ;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Inline Notice
|
|
4
|
+
* @namespace InlineNotice
|
|
5
|
+
* @description Inline Notice
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentPropsWithRef, FC, ReactNode } from "react";
|
|
8
|
+
export type InlineNoticeProps = Omit<ComponentPropsWithRef<"div">, "title" | "role" | "aria-live"> & {
|
|
9
|
+
readonly title?: ReactNode;
|
|
10
|
+
readonly icon?: ReactNode;
|
|
11
|
+
readonly actions?: ReactNode;
|
|
12
|
+
readonly tone?: "neutral" | "success" | "warning" | "danger";
|
|
13
|
+
readonly announcement?: "off" | "polite" | "assertive";
|
|
14
|
+
};
|
|
15
|
+
export declare const InlineNotice: FC<InlineNoticeProps>;
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer theme, base, components, utilities;
|
|
3
|
+
@layer utilities;
|
|
4
|
+
@layer components {
|
|
5
|
+
.gridui-inline-notice {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: flex-start;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
gap: calc(var(--gridui-space-8) + var(--gridui-space-4));
|
|
10
|
+
padding: var(--gridui-space-16);
|
|
11
|
+
border: 1px solid var(--gridui-border);
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
background: var(--gridui-background);
|
|
14
|
+
color: var(--gridui-foreground);
|
|
15
|
+
}
|
|
16
|
+
.gridui-inline-notice[data-tone="success"] {
|
|
17
|
+
border-inline-start: 4px solid var(--gridui-accent-background);
|
|
18
|
+
}
|
|
19
|
+
.gridui-inline-notice[data-tone="warning"] {
|
|
20
|
+
border-inline-start: 4px solid var(--gridui-warning-foreground);
|
|
21
|
+
}
|
|
22
|
+
.gridui-inline-notice[data-tone="danger"] {
|
|
23
|
+
border-inline-start: 4px solid var(--gridui-danger-foreground);
|
|
24
|
+
}
|
|
25
|
+
.gridui-inline-notice-icon {
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
flex: none;
|
|
28
|
+
}
|
|
29
|
+
.gridui-inline-notice-content {
|
|
30
|
+
flex: 1 1 12rem;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
overflow-wrap: anywhere;
|
|
33
|
+
}
|
|
34
|
+
.gridui-inline-notice-title {
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
}
|
|
37
|
+
.gridui-inline-notice-actions {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: var(--gridui-space-8);
|
|
42
|
+
}
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/inline-notice",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "GridUI React inline notice",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./styles.css": "./dist/styles.css"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^19.2.0",
|
|
26
|
+
"react-dom": "^19.2.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@gridui/style-utils": "^2.1.2",
|
|
30
|
+
"@gridui/theme": "^2.1.2"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@gridui-internal/configuration": "0.0.0",
|
|
34
|
+
"@jest/globals": "30.5.2",
|
|
35
|
+
"@types/jest": "30.0.0",
|
|
36
|
+
"@types/node": "26.6.5",
|
|
37
|
+
"@types/react": "19.3.0",
|
|
38
|
+
"@types/react-dom": "19.3.0",
|
|
39
|
+
"jest": "30.5.2",
|
|
40
|
+
"react": "19.3.1",
|
|
41
|
+
"react-dom": "19.3.1",
|
|
42
|
+
"typescript": "6.0.3"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "node ../../scripts/compilation/package.ts",
|
|
46
|
+
"compile": "tsc --project tsconfig.json",
|
|
47
|
+
"test": "jest",
|
|
48
|
+
"coverage": "jest --coverage"
|
|
49
|
+
}
|
|
6
50
|
}
|