@ttoss/fsl-ui 0.2.4 → 0.2.6
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 +1 -1
- package/dist/components/AppShell/AppShell.cjs +124 -0
- package/dist/components/AppShell/AppShell.d.cts +74 -0
- package/dist/components/AppShell/AppShell.d.mts +74 -0
- package/dist/components/AppShell/AppShell.mjs +123 -0
- package/dist/components/Badge/Badge.cjs +61 -0
- package/dist/components/Badge/Badge.d.cts +56 -0
- package/dist/components/Badge/Badge.d.mts +56 -0
- package/dist/components/Badge/Badge.mjs +60 -0
- package/dist/components/Box/Box.cjs +114 -0
- package/dist/components/Box/Box.d.cts +115 -0
- package/dist/components/Box/Box.d.mts +115 -0
- package/dist/components/Box/Box.mjs +113 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +1 -1
- package/dist/components/Button/Button.cjs +2 -2
- package/dist/components/Button/Button.d.cts +2 -1
- package/dist/components/Button/Button.d.mts +2 -1
- package/dist/components/Button/Button.mjs +2 -2
- package/dist/components/Checkbox/Checkbox.cjs +2 -2
- package/dist/components/Checkbox/Checkbox.mjs +2 -2
- package/dist/components/CheckboxGroup/CheckboxGroup.cjs +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.mjs +1 -1
- package/dist/components/Code/Code.cjs +69 -0
- package/dist/components/Code/Code.d.cts +53 -0
- package/dist/components/Code/Code.d.mts +53 -0
- package/dist/components/Code/Code.mjs +68 -0
- package/dist/components/Container/Container.cjs +65 -0
- package/dist/components/Container/Container.d.cts +61 -0
- package/dist/components/Container/Container.d.mts +61 -0
- package/dist/components/Container/Container.mjs +64 -0
- package/dist/components/FileTrigger/FileTrigger.cjs +1 -1
- package/dist/components/FileTrigger/FileTrigger.mjs +1 -1
- package/dist/components/Grid/Grid.cjs +88 -0
- package/dist/components/Grid/Grid.d.cts +87 -0
- package/dist/components/Grid/Grid.d.mts +87 -0
- package/dist/components/Grid/Grid.mjs +87 -0
- package/dist/components/GridList/GridList.cjs +2 -2
- package/dist/components/GridList/GridList.mjs +2 -2
- package/dist/components/Group/Group.cjs +1 -1
- package/dist/components/Group/Group.mjs +1 -1
- package/dist/components/Heading/Heading.cjs +78 -0
- package/dist/components/Heading/Heading.d.cts +63 -0
- package/dist/components/Heading/Heading.d.mts +63 -0
- package/dist/components/Heading/Heading.mjs +77 -0
- package/dist/components/Icon/Icon.cjs +2 -1
- package/dist/components/Icon/Icon.d.cts +59 -0
- package/dist/components/Icon/Icon.d.mts +59 -0
- package/dist/components/Icon/Icon.mjs +1 -1
- package/dist/components/Icon/glyphs.cjs +37 -10
- package/dist/components/Icon/glyphs.mjs +34 -10
- package/dist/components/Icon/intents.cjs +32 -0
- package/dist/components/Icon/intents.d.cts +33 -0
- package/dist/components/Icon/intents.d.mts +33 -0
- package/dist/components/Icon/intents.mjs +32 -0
- package/dist/components/Link/Link.cjs +1 -1
- package/dist/components/Link/Link.mjs +1 -1
- package/dist/components/ListBox/ListBox.cjs +1 -1
- package/dist/components/ListBox/ListBox.mjs +1 -1
- package/dist/components/Meter/Meter.cjs +11 -1
- package/dist/components/Meter/Meter.mjs +11 -1
- package/dist/components/NumberField/NumberField.cjs +2 -2
- package/dist/components/NumberField/NumberField.mjs +2 -2
- package/dist/components/ProgressBar/ProgressBar.cjs +1 -1
- package/dist/components/ProgressBar/ProgressBar.mjs +1 -1
- package/dist/components/RadioGroup/RadioGroup.cjs +2 -2
- package/dist/components/RadioGroup/RadioGroup.mjs +2 -2
- package/dist/components/Select/Select.cjs +2 -2
- package/dist/components/Select/Select.mjs +2 -2
- package/dist/components/Separator/Separator.cjs +1 -1
- package/dist/components/Separator/Separator.mjs +1 -1
- package/dist/components/Slider/Slider.cjs +1 -1
- package/dist/components/Slider/Slider.mjs +1 -1
- package/dist/components/Stack/Stack.cjs +89 -0
- package/dist/components/Stack/Stack.d.cts +75 -0
- package/dist/components/Stack/Stack.d.mts +75 -0
- package/dist/components/Stack/Stack.mjs +88 -0
- package/dist/components/Surface/Surface.cjs +84 -0
- package/dist/components/Surface/Surface.d.cts +72 -0
- package/dist/components/Surface/Surface.d.mts +72 -0
- package/dist/components/Surface/Surface.mjs +83 -0
- package/dist/components/Switch/Switch.cjs +3 -3
- package/dist/components/Switch/Switch.d.cts +1 -1
- package/dist/components/Switch/Switch.d.mts +1 -1
- package/dist/components/Switch/Switch.mjs +3 -3
- package/dist/components/Table/Table.cjs +248 -0
- package/dist/components/Table/Table.d.cts +128 -0
- package/dist/components/Table/Table.d.mts +128 -0
- package/dist/components/Table/Table.mjs +239 -0
- package/dist/components/Tabs/Tabs.cjs +71 -28
- package/dist/components/Tabs/Tabs.d.cts +0 -17
- package/dist/components/Tabs/Tabs.d.mts +0 -17
- package/dist/components/Tabs/Tabs.mjs +69 -28
- package/dist/components/Text/Text.cjs +70 -0
- package/dist/components/Text/Text.d.cts +89 -0
- package/dist/components/Text/Text.d.mts +89 -0
- package/dist/components/Text/Text.mjs +69 -0
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.mjs +1 -1
- package/dist/components/ToggleButton/ToggleButton.cjs +2 -2
- package/dist/components/ToggleButton/ToggleButton.mjs +2 -2
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.cjs +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.mjs +1 -1
- package/dist/components/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/Toolbar/Toolbar.mjs +1 -1
- package/dist/composites/Accordion/Accordion.cjs +14 -9
- package/dist/composites/Accordion/Accordion.mjs +14 -9
- package/dist/composites/Dialog/Dialog.cjs +1 -1
- package/dist/composites/Dialog/Dialog.mjs +1 -1
- package/dist/composites/Disclosure/Disclosure.cjs +14 -9
- package/dist/composites/Disclosure/Disclosure.mjs +14 -9
- package/dist/composites/Form/Form.cjs +1 -1
- package/dist/composites/Form/Form.mjs +1 -1
- package/dist/composites/Menu/Menu.cjs +2 -2
- package/dist/composites/Menu/Menu.mjs +2 -2
- package/dist/composites/Popover/Popover.cjs +1 -1
- package/dist/composites/Popover/Popover.mjs +1 -1
- package/dist/composites/SearchField/SearchField.cjs +2 -2
- package/dist/composites/SearchField/SearchField.mjs +2 -2
- package/dist/composites/TagGroup/TagGroup.cjs +2 -2
- package/dist/composites/TagGroup/TagGroup.mjs +2 -2
- package/dist/composites/TextArea/TextArea.cjs +2 -2
- package/dist/composites/TextArea/TextArea.mjs +2 -2
- package/dist/composites/TextField/TextField.cjs +2 -2
- package/dist/composites/TextField/TextField.mjs +2 -2
- package/dist/composites/Tooltip/Tooltip.cjs +1 -1
- package/dist/composites/Tooltip/Tooltip.mjs +1 -1
- package/dist/index.cjs +46 -0
- package/dist/index.d.cts +14 -1
- package/dist/index.d.mts +14 -1
- package/dist/index.mjs +14 -1
- package/llms.txt +51 -8
- package/package.json +4 -4
- package/src/tokens/CONTRACT.md +28 -10
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ Composites accept no `style`/`className`. Geometry the host legitimately owns is
|
|
|
59
59
|
|
|
60
60
|
The registered knobs and the full policy live in `src/tokens/CONTRACT.md` §7.
|
|
61
61
|
|
|
62
|
-
Icons are
|
|
62
|
+
Icons are semantic: `Icon` (public since ADR-010) is named by intent (`<Icon intent="status.success" />`), never by glyph. The theme maps intents to [Iconify](https://iconify.design/) glyphs (default set: Lucide), registered offline (no runtime network fetch); color inherits via `currentColor` and size comes from `vars.sizing.icon.*`.
|
|
63
63
|
|
|
64
64
|
## AI-first surface
|
|
65
65
|
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
|
|
5
|
+
//#region src/components/AppShell/AppShell.tsx
|
|
6
|
+
/** Formal semantic identity — AppShell root (Structure entity, app frame). */
|
|
7
|
+
var appShellMeta = {
|
|
8
|
+
displayName: "AppShell",
|
|
9
|
+
entity: "Structure",
|
|
10
|
+
structure: "root"
|
|
11
|
+
};
|
|
12
|
+
var SIDEBAR_WIDTH = {
|
|
13
|
+
sm: "13rem",
|
|
14
|
+
md: "16rem",
|
|
15
|
+
lg: "20rem"
|
|
16
|
+
};
|
|
17
|
+
/** Build the body's column template from which side panels are present. */
|
|
18
|
+
var bodyColumns = ({
|
|
19
|
+
hasSidebar,
|
|
20
|
+
hasAside,
|
|
21
|
+
sidebarWidth,
|
|
22
|
+
asideWidth
|
|
23
|
+
}) => {
|
|
24
|
+
return `${hasSidebar ? `${SIDEBAR_WIDTH[sidebarWidth]} ` : ""}minmax(0, 1fr)${hasAside ? ` ${SIDEBAR_WIDTH[asideWidth]}` : ""}`;
|
|
25
|
+
};
|
|
26
|
+
var HAIRLINE = `${_ttoss_fsl_theme_vars.vars.border.outline.surface.width} ${_ttoss_fsl_theme_vars.vars.border.outline.surface.style} ${_ttoss_fsl_theme_vars.vars.colors.informational.muted.border?.default}`;
|
|
27
|
+
/**
|
|
28
|
+
* The application-frame primitive — a full-viewport header + sidebars + main.
|
|
29
|
+
*
|
|
30
|
+
* Entity = Structure. Wrap the whole app in an AppShell to get the standard
|
|
31
|
+
* "header over navigator | main | inspector" frame without hand-rolling a grid:
|
|
32
|
+
* pass any of `header`, `sidebar`, `aside`, and the main content as `children`.
|
|
33
|
+
* The frame fills the viewport, each region scrolls on its own, and the main
|
|
34
|
+
* region always takes the remaining width. Sidebar widths come from a named
|
|
35
|
+
* scale — there is no raw track template.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <AppShell
|
|
40
|
+
* header={<Toolbar>…</Toolbar>}
|
|
41
|
+
* sidebar={<Navigator />}
|
|
42
|
+
* aside={<Inspector />}
|
|
43
|
+
* >
|
|
44
|
+
* <MainStage />
|
|
45
|
+
* </AppShell>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
var AppShell = ({
|
|
49
|
+
header,
|
|
50
|
+
sidebar,
|
|
51
|
+
aside,
|
|
52
|
+
sidebarWidth = "sm",
|
|
53
|
+
asideWidth = "sm",
|
|
54
|
+
sidebarLabel,
|
|
55
|
+
asideLabel,
|
|
56
|
+
children,
|
|
57
|
+
...props
|
|
58
|
+
}) => {
|
|
59
|
+
const hasSidebar = sidebar !== void 0 && sidebar !== null;
|
|
60
|
+
const hasAside = aside !== void 0 && aside !== null;
|
|
61
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsxs)("div", {
|
|
62
|
+
...props,
|
|
63
|
+
"data-scope": "app-shell",
|
|
64
|
+
"data-part": "root",
|
|
65
|
+
style: {
|
|
66
|
+
display: "grid",
|
|
67
|
+
gridTemplateRows: header ? "auto minmax(0, 1fr)" : "minmax(0, 1fr)",
|
|
68
|
+
blockSize: "100dvh"
|
|
69
|
+
},
|
|
70
|
+
children: [header ? /* @__PURE__ */(0, react_jsx_runtime.jsx)("header", {
|
|
71
|
+
"data-scope": "app-shell",
|
|
72
|
+
"data-part": "header",
|
|
73
|
+
style: {
|
|
74
|
+
borderBlockEnd: HAIRLINE
|
|
75
|
+
},
|
|
76
|
+
children: header
|
|
77
|
+
}) : null, /* @__PURE__ */(0, react_jsx_runtime.jsxs)("div", {
|
|
78
|
+
"data-scope": "app-shell",
|
|
79
|
+
"data-part": "body",
|
|
80
|
+
style: {
|
|
81
|
+
display: "grid",
|
|
82
|
+
gridTemplateColumns: bodyColumns({
|
|
83
|
+
hasSidebar,
|
|
84
|
+
hasAside,
|
|
85
|
+
sidebarWidth,
|
|
86
|
+
asideWidth
|
|
87
|
+
}),
|
|
88
|
+
minBlockSize: 0
|
|
89
|
+
},
|
|
90
|
+
children: [hasSidebar ? /* @__PURE__ */(0, react_jsx_runtime.jsx)("aside", {
|
|
91
|
+
"data-scope": "app-shell",
|
|
92
|
+
"data-part": "sidebar",
|
|
93
|
+
"aria-label": sidebarLabel,
|
|
94
|
+
style: {
|
|
95
|
+
overflowY: "auto",
|
|
96
|
+
borderInlineEnd: HAIRLINE
|
|
97
|
+
},
|
|
98
|
+
children: sidebar
|
|
99
|
+
}) : null, /* @__PURE__ */(0, react_jsx_runtime.jsx)("main", {
|
|
100
|
+
"data-scope": "app-shell",
|
|
101
|
+
"data-part": "main",
|
|
102
|
+
style: {
|
|
103
|
+
overflow: "auto",
|
|
104
|
+
minInlineSize: 0
|
|
105
|
+
},
|
|
106
|
+
children
|
|
107
|
+
}), hasAside ? /* @__PURE__ */(0, react_jsx_runtime.jsx)("aside", {
|
|
108
|
+
"data-scope": "app-shell",
|
|
109
|
+
"data-part": "aside",
|
|
110
|
+
"aria-label": asideLabel,
|
|
111
|
+
style: {
|
|
112
|
+
overflowY: "auto",
|
|
113
|
+
borderInlineStart: HAIRLINE
|
|
114
|
+
},
|
|
115
|
+
children: aside
|
|
116
|
+
}) : null]
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
AppShell.displayName = appShellMeta.displayName;
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
exports.AppShell = AppShell;
|
|
124
|
+
exports.appShellMeta = appShellMeta;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/AppShell/AppShell.d.ts
|
|
5
|
+
/** Formal semantic identity — AppShell root (Structure entity, app frame). */
|
|
6
|
+
declare const appShellMeta: {
|
|
7
|
+
readonly displayName: "AppShell";
|
|
8
|
+
readonly entity: "Structure";
|
|
9
|
+
readonly structure: "root";
|
|
10
|
+
};
|
|
11
|
+
/** Sidebar width from a named threshold scale (not a raw length). */
|
|
12
|
+
type AppShellSidebarWidth = 'sm' | 'md' | 'lg';
|
|
13
|
+
/** Props for the AppShell component. */
|
|
14
|
+
interface AppShellProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {
|
|
15
|
+
/** Top bar, spanning the full width above the body. Omit for no header. */
|
|
16
|
+
header?: React.ReactNode;
|
|
17
|
+
/** Start-side panel (navigator). Omit for no start sidebar. */
|
|
18
|
+
sidebar?: React.ReactNode;
|
|
19
|
+
/** End-side panel (inspector). Omit for no end aside. */
|
|
20
|
+
aside?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Width of the start `sidebar`, from the named scale.
|
|
23
|
+
* @default 'sm'
|
|
24
|
+
*/
|
|
25
|
+
sidebarWidth?: AppShellSidebarWidth;
|
|
26
|
+
/**
|
|
27
|
+
* Width of the end `aside`, from the named scale.
|
|
28
|
+
* @default 'sm'
|
|
29
|
+
*/
|
|
30
|
+
asideWidth?: AppShellSidebarWidth;
|
|
31
|
+
/** Accessible name for the start `sidebar` landmark (`aria-label`). */
|
|
32
|
+
sidebarLabel?: string;
|
|
33
|
+
/** Accessible name for the end `aside` landmark (`aria-label`). */
|
|
34
|
+
asideLabel?: string;
|
|
35
|
+
/** The main region — always takes the remaining space and scrolls. */
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The application-frame primitive — a full-viewport header + sidebars + main.
|
|
40
|
+
*
|
|
41
|
+
* Entity = Structure. Wrap the whole app in an AppShell to get the standard
|
|
42
|
+
* "header over navigator | main | inspector" frame without hand-rolling a grid:
|
|
43
|
+
* pass any of `header`, `sidebar`, `aside`, and the main content as `children`.
|
|
44
|
+
* The frame fills the viewport, each region scrolls on its own, and the main
|
|
45
|
+
* region always takes the remaining width. Sidebar widths come from a named
|
|
46
|
+
* scale — there is no raw track template.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <AppShell
|
|
51
|
+
* header={<Toolbar>…</Toolbar>}
|
|
52
|
+
* sidebar={<Navigator />}
|
|
53
|
+
* aside={<Inspector />}
|
|
54
|
+
* >
|
|
55
|
+
* <MainStage />
|
|
56
|
+
* </AppShell>
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare const AppShell: {
|
|
60
|
+
({
|
|
61
|
+
header,
|
|
62
|
+
sidebar,
|
|
63
|
+
aside,
|
|
64
|
+
sidebarWidth,
|
|
65
|
+
asideWidth,
|
|
66
|
+
sidebarLabel,
|
|
67
|
+
asideLabel,
|
|
68
|
+
children,
|
|
69
|
+
...props
|
|
70
|
+
}: AppShellProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
displayName: "AppShell";
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
export { AppShell, AppShellProps, AppShellSidebarWidth, appShellMeta };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/AppShell/AppShell.d.ts
|
|
5
|
+
/** Formal semantic identity — AppShell root (Structure entity, app frame). */
|
|
6
|
+
declare const appShellMeta: {
|
|
7
|
+
readonly displayName: "AppShell";
|
|
8
|
+
readonly entity: "Structure";
|
|
9
|
+
readonly structure: "root";
|
|
10
|
+
};
|
|
11
|
+
/** Sidebar width from a named threshold scale (not a raw length). */
|
|
12
|
+
type AppShellSidebarWidth = 'sm' | 'md' | 'lg';
|
|
13
|
+
/** Props for the AppShell component. */
|
|
14
|
+
interface AppShellProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {
|
|
15
|
+
/** Top bar, spanning the full width above the body. Omit for no header. */
|
|
16
|
+
header?: React.ReactNode;
|
|
17
|
+
/** Start-side panel (navigator). Omit for no start sidebar. */
|
|
18
|
+
sidebar?: React.ReactNode;
|
|
19
|
+
/** End-side panel (inspector). Omit for no end aside. */
|
|
20
|
+
aside?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Width of the start `sidebar`, from the named scale.
|
|
23
|
+
* @default 'sm'
|
|
24
|
+
*/
|
|
25
|
+
sidebarWidth?: AppShellSidebarWidth;
|
|
26
|
+
/**
|
|
27
|
+
* Width of the end `aside`, from the named scale.
|
|
28
|
+
* @default 'sm'
|
|
29
|
+
*/
|
|
30
|
+
asideWidth?: AppShellSidebarWidth;
|
|
31
|
+
/** Accessible name for the start `sidebar` landmark (`aria-label`). */
|
|
32
|
+
sidebarLabel?: string;
|
|
33
|
+
/** Accessible name for the end `aside` landmark (`aria-label`). */
|
|
34
|
+
asideLabel?: string;
|
|
35
|
+
/** The main region — always takes the remaining space and scrolls. */
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The application-frame primitive — a full-viewport header + sidebars + main.
|
|
40
|
+
*
|
|
41
|
+
* Entity = Structure. Wrap the whole app in an AppShell to get the standard
|
|
42
|
+
* "header over navigator | main | inspector" frame without hand-rolling a grid:
|
|
43
|
+
* pass any of `header`, `sidebar`, `aside`, and the main content as `children`.
|
|
44
|
+
* The frame fills the viewport, each region scrolls on its own, and the main
|
|
45
|
+
* region always takes the remaining width. Sidebar widths come from a named
|
|
46
|
+
* scale — there is no raw track template.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <AppShell
|
|
51
|
+
* header={<Toolbar>…</Toolbar>}
|
|
52
|
+
* sidebar={<Navigator />}
|
|
53
|
+
* aside={<Inspector />}
|
|
54
|
+
* >
|
|
55
|
+
* <MainStage />
|
|
56
|
+
* </AppShell>
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare const AppShell: {
|
|
60
|
+
({
|
|
61
|
+
header,
|
|
62
|
+
sidebar,
|
|
63
|
+
aside,
|
|
64
|
+
sidebarWidth,
|
|
65
|
+
asideWidth,
|
|
66
|
+
sidebarLabel,
|
|
67
|
+
asideLabel,
|
|
68
|
+
children,
|
|
69
|
+
...props
|
|
70
|
+
}: AppShellProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
displayName: "AppShell";
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
export { AppShell, AppShellProps, AppShellSidebarWidth, appShellMeta };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { vars } from "@ttoss/fsl-theme/vars";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/AppShell/AppShell.tsx
|
|
6
|
+
/** Formal semantic identity — AppShell root (Structure entity, app frame). */
|
|
7
|
+
var appShellMeta = {
|
|
8
|
+
displayName: "AppShell",
|
|
9
|
+
entity: "Structure",
|
|
10
|
+
structure: "root"
|
|
11
|
+
};
|
|
12
|
+
var SIDEBAR_WIDTH = {
|
|
13
|
+
sm: "13rem",
|
|
14
|
+
md: "16rem",
|
|
15
|
+
lg: "20rem"
|
|
16
|
+
};
|
|
17
|
+
/** Build the body's column template from which side panels are present. */
|
|
18
|
+
var bodyColumns = ({
|
|
19
|
+
hasSidebar,
|
|
20
|
+
hasAside,
|
|
21
|
+
sidebarWidth,
|
|
22
|
+
asideWidth
|
|
23
|
+
}) => {
|
|
24
|
+
return `${hasSidebar ? `${SIDEBAR_WIDTH[sidebarWidth]} ` : ""}minmax(0, 1fr)${hasAside ? ` ${SIDEBAR_WIDTH[asideWidth]}` : ""}`;
|
|
25
|
+
};
|
|
26
|
+
var HAIRLINE = `${vars.border.outline.surface.width} ${vars.border.outline.surface.style} ${vars.colors.informational.muted.border?.default}`;
|
|
27
|
+
/**
|
|
28
|
+
* The application-frame primitive — a full-viewport header + sidebars + main.
|
|
29
|
+
*
|
|
30
|
+
* Entity = Structure. Wrap the whole app in an AppShell to get the standard
|
|
31
|
+
* "header over navigator | main | inspector" frame without hand-rolling a grid:
|
|
32
|
+
* pass any of `header`, `sidebar`, `aside`, and the main content as `children`.
|
|
33
|
+
* The frame fills the viewport, each region scrolls on its own, and the main
|
|
34
|
+
* region always takes the remaining width. Sidebar widths come from a named
|
|
35
|
+
* scale — there is no raw track template.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <AppShell
|
|
40
|
+
* header={<Toolbar>…</Toolbar>}
|
|
41
|
+
* sidebar={<Navigator />}
|
|
42
|
+
* aside={<Inspector />}
|
|
43
|
+
* >
|
|
44
|
+
* <MainStage />
|
|
45
|
+
* </AppShell>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
var AppShell = ({
|
|
49
|
+
header,
|
|
50
|
+
sidebar,
|
|
51
|
+
aside,
|
|
52
|
+
sidebarWidth = "sm",
|
|
53
|
+
asideWidth = "sm",
|
|
54
|
+
sidebarLabel,
|
|
55
|
+
asideLabel,
|
|
56
|
+
children,
|
|
57
|
+
...props
|
|
58
|
+
}) => {
|
|
59
|
+
const hasSidebar = sidebar !== void 0 && sidebar !== null;
|
|
60
|
+
const hasAside = aside !== void 0 && aside !== null;
|
|
61
|
+
return /* @__PURE__ */jsxs("div", {
|
|
62
|
+
...props,
|
|
63
|
+
"data-scope": "app-shell",
|
|
64
|
+
"data-part": "root",
|
|
65
|
+
style: {
|
|
66
|
+
display: "grid",
|
|
67
|
+
gridTemplateRows: header ? "auto minmax(0, 1fr)" : "minmax(0, 1fr)",
|
|
68
|
+
blockSize: "100dvh"
|
|
69
|
+
},
|
|
70
|
+
children: [header ? /* @__PURE__ */jsx("header", {
|
|
71
|
+
"data-scope": "app-shell",
|
|
72
|
+
"data-part": "header",
|
|
73
|
+
style: {
|
|
74
|
+
borderBlockEnd: HAIRLINE
|
|
75
|
+
},
|
|
76
|
+
children: header
|
|
77
|
+
}) : null, /* @__PURE__ */jsxs("div", {
|
|
78
|
+
"data-scope": "app-shell",
|
|
79
|
+
"data-part": "body",
|
|
80
|
+
style: {
|
|
81
|
+
display: "grid",
|
|
82
|
+
gridTemplateColumns: bodyColumns({
|
|
83
|
+
hasSidebar,
|
|
84
|
+
hasAside,
|
|
85
|
+
sidebarWidth,
|
|
86
|
+
asideWidth
|
|
87
|
+
}),
|
|
88
|
+
minBlockSize: 0
|
|
89
|
+
},
|
|
90
|
+
children: [hasSidebar ? /* @__PURE__ */jsx("aside", {
|
|
91
|
+
"data-scope": "app-shell",
|
|
92
|
+
"data-part": "sidebar",
|
|
93
|
+
"aria-label": sidebarLabel,
|
|
94
|
+
style: {
|
|
95
|
+
overflowY: "auto",
|
|
96
|
+
borderInlineEnd: HAIRLINE
|
|
97
|
+
},
|
|
98
|
+
children: sidebar
|
|
99
|
+
}) : null, /* @__PURE__ */jsx("main", {
|
|
100
|
+
"data-scope": "app-shell",
|
|
101
|
+
"data-part": "main",
|
|
102
|
+
style: {
|
|
103
|
+
overflow: "auto",
|
|
104
|
+
minInlineSize: 0
|
|
105
|
+
},
|
|
106
|
+
children
|
|
107
|
+
}), hasAside ? /* @__PURE__ */jsx("aside", {
|
|
108
|
+
"data-scope": "app-shell",
|
|
109
|
+
"data-part": "aside",
|
|
110
|
+
"aria-label": asideLabel,
|
|
111
|
+
style: {
|
|
112
|
+
overflowY: "auto",
|
|
113
|
+
borderInlineStart: HAIRLINE
|
|
114
|
+
},
|
|
115
|
+
children: aside
|
|
116
|
+
}) : null]
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
AppShell.displayName = appShellMeta.displayName;
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
export { AppShell, appShellMeta };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
|
|
5
|
+
//#region src/components/Badge/Badge.tsx
|
|
6
|
+
/** Formal semantic identity — Badge root (Feedback entity, status pill). */
|
|
7
|
+
var badgeMeta = {
|
|
8
|
+
displayName: "Badge",
|
|
9
|
+
entity: "Feedback",
|
|
10
|
+
structure: "root"
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A compact status pill bound to the FSL feedback palette.
|
|
14
|
+
*
|
|
15
|
+
* Entity = Feedback. Use it for a small, non-interactive tag whose colour
|
|
16
|
+
* carries meaning: a contrast rating, a validation state, a count. Pick the
|
|
17
|
+
* `evaluation` by valence, not by colour — the theme decides the hue per mode.
|
|
18
|
+
* For running feedback messages use `Toast`; for interactive filters use a
|
|
19
|
+
* control.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Badge evaluation="positive" numeric="tabular">AA 5.1:1</Badge>
|
|
24
|
+
* <Badge evaluation="negative">Fail</Badge>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
var Badge = ({
|
|
28
|
+
evaluation = "primary",
|
|
29
|
+
numeric = "normal",
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}) => {
|
|
33
|
+
const colors = _ttoss_fsl_theme_vars.vars.colors.feedback[evaluation];
|
|
34
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)("span", {
|
|
35
|
+
...props,
|
|
36
|
+
"data-scope": "badge",
|
|
37
|
+
"data-part": "root",
|
|
38
|
+
"data-evaluation": evaluation,
|
|
39
|
+
style: {
|
|
40
|
+
display: "inline-flex",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
justifyContent: "center",
|
|
43
|
+
paddingBlock: _ttoss_fsl_theme_vars.vars.spacing.inset.control.sm,
|
|
44
|
+
paddingInline: _ttoss_fsl_theme_vars.vars.spacing.inset.control.md,
|
|
45
|
+
borderRadius: _ttoss_fsl_theme_vars.vars.radii.control,
|
|
46
|
+
borderWidth: _ttoss_fsl_theme_vars.vars.border.outline.surface.width,
|
|
47
|
+
borderStyle: _ttoss_fsl_theme_vars.vars.border.outline.surface.style,
|
|
48
|
+
borderColor: colors?.border?.default,
|
|
49
|
+
color: colors?.text?.default,
|
|
50
|
+
backgroundColor: colors?.background?.default,
|
|
51
|
+
fontVariantNumeric: numeric === "tabular" ? "tabular-nums" : void 0,
|
|
52
|
+
..._ttoss_fsl_theme_vars.vars.text.label.sm
|
|
53
|
+
},
|
|
54
|
+
children
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
Badge.displayName = badgeMeta.displayName;
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
exports.Badge = Badge;
|
|
61
|
+
exports.badgeMeta = badgeMeta;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
|
|
2
|
+
import { EvaluationsFor } from "../../semantics/taxonomy.cjs";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Badge/Badge.d.ts
|
|
6
|
+
/** Formal semantic identity — Badge root (Feedback entity, status pill). */
|
|
7
|
+
declare const badgeMeta: {
|
|
8
|
+
readonly displayName: "Badge";
|
|
9
|
+
readonly entity: "Feedback";
|
|
10
|
+
readonly structure: "root";
|
|
11
|
+
};
|
|
12
|
+
/** Numeric figure style — `tabular` aligns digits (ratios, counts). */
|
|
13
|
+
type BadgeNumeric = 'normal' | 'tabular';
|
|
14
|
+
/** Props for the Badge component. */
|
|
15
|
+
interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'style' | 'className'> {
|
|
16
|
+
/**
|
|
17
|
+
* Feedback valence the badge communicates. `primary` is neutral-informational;
|
|
18
|
+
* `positive`/`caution`/`negative` carry status colour.
|
|
19
|
+
* @default 'primary'
|
|
20
|
+
*/
|
|
21
|
+
evaluation?: EvaluationsFor<(typeof badgeMeta)['entity']>;
|
|
22
|
+
/**
|
|
23
|
+
* Numeric figure style. `tabular` renders `tabular-nums` so digits line up —
|
|
24
|
+
* use it for ratios/counts inside a scannable column.
|
|
25
|
+
* @default 'normal'
|
|
26
|
+
*/
|
|
27
|
+
numeric?: BadgeNumeric;
|
|
28
|
+
/** The badge label. */
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A compact status pill bound to the FSL feedback palette.
|
|
33
|
+
*
|
|
34
|
+
* Entity = Feedback. Use it for a small, non-interactive tag whose colour
|
|
35
|
+
* carries meaning: a contrast rating, a validation state, a count. Pick the
|
|
36
|
+
* `evaluation` by valence, not by colour — the theme decides the hue per mode.
|
|
37
|
+
* For running feedback messages use `Toast`; for interactive filters use a
|
|
38
|
+
* control.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <Badge evaluation="positive" numeric="tabular">AA 5.1:1</Badge>
|
|
43
|
+
* <Badge evaluation="negative">Fail</Badge>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare const Badge: {
|
|
47
|
+
({
|
|
48
|
+
evaluation,
|
|
49
|
+
numeric,
|
|
50
|
+
children,
|
|
51
|
+
...props
|
|
52
|
+
}: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
displayName: "Badge";
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Badge, BadgeNumeric, BadgeProps, badgeMeta };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
|
|
2
|
+
import { EvaluationsFor } from "../../semantics/taxonomy.mjs";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Badge/Badge.d.ts
|
|
6
|
+
/** Formal semantic identity — Badge root (Feedback entity, status pill). */
|
|
7
|
+
declare const badgeMeta: {
|
|
8
|
+
readonly displayName: "Badge";
|
|
9
|
+
readonly entity: "Feedback";
|
|
10
|
+
readonly structure: "root";
|
|
11
|
+
};
|
|
12
|
+
/** Numeric figure style — `tabular` aligns digits (ratios, counts). */
|
|
13
|
+
type BadgeNumeric = 'normal' | 'tabular';
|
|
14
|
+
/** Props for the Badge component. */
|
|
15
|
+
interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'style' | 'className'> {
|
|
16
|
+
/**
|
|
17
|
+
* Feedback valence the badge communicates. `primary` is neutral-informational;
|
|
18
|
+
* `positive`/`caution`/`negative` carry status colour.
|
|
19
|
+
* @default 'primary'
|
|
20
|
+
*/
|
|
21
|
+
evaluation?: EvaluationsFor<(typeof badgeMeta)['entity']>;
|
|
22
|
+
/**
|
|
23
|
+
* Numeric figure style. `tabular` renders `tabular-nums` so digits line up —
|
|
24
|
+
* use it for ratios/counts inside a scannable column.
|
|
25
|
+
* @default 'normal'
|
|
26
|
+
*/
|
|
27
|
+
numeric?: BadgeNumeric;
|
|
28
|
+
/** The badge label. */
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A compact status pill bound to the FSL feedback palette.
|
|
33
|
+
*
|
|
34
|
+
* Entity = Feedback. Use it for a small, non-interactive tag whose colour
|
|
35
|
+
* carries meaning: a contrast rating, a validation state, a count. Pick the
|
|
36
|
+
* `evaluation` by valence, not by colour — the theme decides the hue per mode.
|
|
37
|
+
* For running feedback messages use `Toast`; for interactive filters use a
|
|
38
|
+
* control.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <Badge evaluation="positive" numeric="tabular">AA 5.1:1</Badge>
|
|
43
|
+
* <Badge evaluation="negative">Fail</Badge>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare const Badge: {
|
|
47
|
+
({
|
|
48
|
+
evaluation,
|
|
49
|
+
numeric,
|
|
50
|
+
children,
|
|
51
|
+
...props
|
|
52
|
+
}: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
displayName: "Badge";
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Badge, BadgeNumeric, BadgeProps, badgeMeta };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { vars } from "@ttoss/fsl-theme/vars";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Badge/Badge.tsx
|
|
6
|
+
/** Formal semantic identity — Badge root (Feedback entity, status pill). */
|
|
7
|
+
var badgeMeta = {
|
|
8
|
+
displayName: "Badge",
|
|
9
|
+
entity: "Feedback",
|
|
10
|
+
structure: "root"
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A compact status pill bound to the FSL feedback palette.
|
|
14
|
+
*
|
|
15
|
+
* Entity = Feedback. Use it for a small, non-interactive tag whose colour
|
|
16
|
+
* carries meaning: a contrast rating, a validation state, a count. Pick the
|
|
17
|
+
* `evaluation` by valence, not by colour — the theme decides the hue per mode.
|
|
18
|
+
* For running feedback messages use `Toast`; for interactive filters use a
|
|
19
|
+
* control.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Badge evaluation="positive" numeric="tabular">AA 5.1:1</Badge>
|
|
24
|
+
* <Badge evaluation="negative">Fail</Badge>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
var Badge = ({
|
|
28
|
+
evaluation = "primary",
|
|
29
|
+
numeric = "normal",
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}) => {
|
|
33
|
+
const colors = vars.colors.feedback[evaluation];
|
|
34
|
+
return /* @__PURE__ */jsx("span", {
|
|
35
|
+
...props,
|
|
36
|
+
"data-scope": "badge",
|
|
37
|
+
"data-part": "root",
|
|
38
|
+
"data-evaluation": evaluation,
|
|
39
|
+
style: {
|
|
40
|
+
display: "inline-flex",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
justifyContent: "center",
|
|
43
|
+
paddingBlock: vars.spacing.inset.control.sm,
|
|
44
|
+
paddingInline: vars.spacing.inset.control.md,
|
|
45
|
+
borderRadius: vars.radii.control,
|
|
46
|
+
borderWidth: vars.border.outline.surface.width,
|
|
47
|
+
borderStyle: vars.border.outline.surface.style,
|
|
48
|
+
borderColor: colors?.border?.default,
|
|
49
|
+
color: colors?.text?.default,
|
|
50
|
+
backgroundColor: colors?.background?.default,
|
|
51
|
+
fontVariantNumeric: numeric === "tabular" ? "tabular-nums" : void 0,
|
|
52
|
+
...vars.text.label.sm
|
|
53
|
+
},
|
|
54
|
+
children
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
Badge.displayName = badgeMeta.displayName;
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Badge, badgeMeta };
|