@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Code/Code.d.ts
|
|
5
|
+
/** Formal semantic identity — Code root (Structure entity, monospace text). */
|
|
6
|
+
declare const codeMeta: {
|
|
7
|
+
readonly displayName: "Code";
|
|
8
|
+
readonly entity: "Structure";
|
|
9
|
+
readonly structure: "root";
|
|
10
|
+
};
|
|
11
|
+
/** Monospace type step. */
|
|
12
|
+
type CodeSize = 'sm' | 'md';
|
|
13
|
+
/** Props for the Code component. */
|
|
14
|
+
interface CodeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'style' | 'className'> {
|
|
15
|
+
/**
|
|
16
|
+
* Render as a scrollable `<pre>` block (`true`) or an inline `<code>` run
|
|
17
|
+
* (`false`). A block gets a bordered surface and its own scroll; inline sits
|
|
18
|
+
* within the surrounding text.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
block?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Monospace type step.
|
|
24
|
+
* @default 'sm'
|
|
25
|
+
*/
|
|
26
|
+
size?: CodeSize;
|
|
27
|
+
/** The code content. */
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Source text in the monospace type role.
|
|
32
|
+
*
|
|
33
|
+
* Entity = Structure. Use inline `Code` for a token or keyword inside prose,
|
|
34
|
+
* and `block` for a multi-line snippet — the block is a bordered, scrollable
|
|
35
|
+
* surface. Type comes from the `code` scale; there is no raw font vocabulary.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <Code>npx skills add ttoss/skills --skill fsl</Code>
|
|
40
|
+
* <Code block>{generatedThemeSource}</Code>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
declare const Code: {
|
|
44
|
+
({
|
|
45
|
+
block,
|
|
46
|
+
size,
|
|
47
|
+
children,
|
|
48
|
+
...props
|
|
49
|
+
}: CodeProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
displayName: "Code";
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { Code, CodeProps, CodeSize, codeMeta };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Code/Code.d.ts
|
|
5
|
+
/** Formal semantic identity — Code root (Structure entity, monospace text). */
|
|
6
|
+
declare const codeMeta: {
|
|
7
|
+
readonly displayName: "Code";
|
|
8
|
+
readonly entity: "Structure";
|
|
9
|
+
readonly structure: "root";
|
|
10
|
+
};
|
|
11
|
+
/** Monospace type step. */
|
|
12
|
+
type CodeSize = 'sm' | 'md';
|
|
13
|
+
/** Props for the Code component. */
|
|
14
|
+
interface CodeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'style' | 'className'> {
|
|
15
|
+
/**
|
|
16
|
+
* Render as a scrollable `<pre>` block (`true`) or an inline `<code>` run
|
|
17
|
+
* (`false`). A block gets a bordered surface and its own scroll; inline sits
|
|
18
|
+
* within the surrounding text.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
block?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Monospace type step.
|
|
24
|
+
* @default 'sm'
|
|
25
|
+
*/
|
|
26
|
+
size?: CodeSize;
|
|
27
|
+
/** The code content. */
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Source text in the monospace type role.
|
|
32
|
+
*
|
|
33
|
+
* Entity = Structure. Use inline `Code` for a token or keyword inside prose,
|
|
34
|
+
* and `block` for a multi-line snippet — the block is a bordered, scrollable
|
|
35
|
+
* surface. Type comes from the `code` scale; there is no raw font vocabulary.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <Code>npx skills add ttoss/skills --skill fsl</Code>
|
|
40
|
+
* <Code block>{generatedThemeSource}</Code>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
declare const Code: {
|
|
44
|
+
({
|
|
45
|
+
block,
|
|
46
|
+
size,
|
|
47
|
+
children,
|
|
48
|
+
...props
|
|
49
|
+
}: CodeProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
displayName: "Code";
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { Code, CodeProps, CodeSize, codeMeta };
|
|
@@ -0,0 +1,68 @@
|
|
|
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/Code/Code.tsx
|
|
6
|
+
/** Formal semantic identity — Code root (Structure entity, monospace text). */
|
|
7
|
+
var codeMeta = {
|
|
8
|
+
displayName: "Code",
|
|
9
|
+
entity: "Structure",
|
|
10
|
+
structure: "root"
|
|
11
|
+
};
|
|
12
|
+
var TYPE_BY_SIZE = {
|
|
13
|
+
sm: vars.text.code.sm,
|
|
14
|
+
md: vars.text.code.md
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Source text in the monospace type role.
|
|
18
|
+
*
|
|
19
|
+
* Entity = Structure. Use inline `Code` for a token or keyword inside prose,
|
|
20
|
+
* and `block` for a multi-line snippet — the block is a bordered, scrollable
|
|
21
|
+
* surface. Type comes from the `code` scale; there is no raw font vocabulary.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Code>npx skills add ttoss/skills --skill fsl</Code>
|
|
26
|
+
* <Code block>{generatedThemeSource}</Code>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
var Code = ({
|
|
30
|
+
block = false,
|
|
31
|
+
size = "sm",
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}) => {
|
|
35
|
+
const type = TYPE_BY_SIZE[size];
|
|
36
|
+
if (!block) return /* @__PURE__ */jsx("code", {
|
|
37
|
+
...props,
|
|
38
|
+
"data-scope": "code",
|
|
39
|
+
"data-part": "root",
|
|
40
|
+
style: type,
|
|
41
|
+
children
|
|
42
|
+
});
|
|
43
|
+
return /* @__PURE__ */jsx("pre", {
|
|
44
|
+
...props,
|
|
45
|
+
"data-scope": "code",
|
|
46
|
+
"data-part": "root",
|
|
47
|
+
"data-block": "true",
|
|
48
|
+
style: {
|
|
49
|
+
margin: 0,
|
|
50
|
+
overflow: "auto",
|
|
51
|
+
padding: vars.spacing.inset.surface.sm,
|
|
52
|
+
borderRadius: vars.radii.surface,
|
|
53
|
+
borderWidth: vars.border.outline.surface.width,
|
|
54
|
+
borderStyle: vars.border.outline.surface.style,
|
|
55
|
+
borderColor: vars.colors.informational.muted.border?.default,
|
|
56
|
+
color: vars.colors.informational.primary.text?.default,
|
|
57
|
+
backgroundColor: vars.colors.informational.primary.background?.default,
|
|
58
|
+
...type
|
|
59
|
+
},
|
|
60
|
+
children: /* @__PURE__ */jsx("code", {
|
|
61
|
+
children
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
Code.displayName = codeMeta.displayName;
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { Code, codeMeta };
|
|
@@ -0,0 +1,65 @@
|
|
|
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/Container/Container.tsx
|
|
6
|
+
/** Formal semantic identity — Container root (Structure entity, page shell). */
|
|
7
|
+
var containerMeta = {
|
|
8
|
+
displayName: "Container",
|
|
9
|
+
entity: "Structure",
|
|
10
|
+
structure: "root"
|
|
11
|
+
};
|
|
12
|
+
var MAX_WIDTH = {
|
|
13
|
+
surface: _ttoss_fsl_theme_vars.vars.sizing.surface.maxWidth,
|
|
14
|
+
reading: _ttoss_fsl_theme_vars.vars.sizing.measure.reading
|
|
15
|
+
};
|
|
16
|
+
var GUTTER = {
|
|
17
|
+
none: "0",
|
|
18
|
+
section: _ttoss_fsl_theme_vars.vars.spacing.gutter.section,
|
|
19
|
+
page: _ttoss_fsl_theme_vars.vars.spacing.gutter.page
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The page-shell primitive — a centered, width-capped, gutter-padded column.
|
|
23
|
+
*
|
|
24
|
+
* Entity = Structure. Wrap a page (or a major region) in a Container to give
|
|
25
|
+
* it the product's standard content width and edge padding without hand-rolling
|
|
26
|
+
* `max-width` + `margin: auto`. Pick `size="reading"` for long-form article
|
|
27
|
+
* columns and `size="surface"` for app/page shells. Place `Stack`, `Grid`, and
|
|
28
|
+
* `Surface` inside it.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <Container size="surface">
|
|
33
|
+
* <Stack gap="xl">
|
|
34
|
+
* <Heading level={1}>Dashboard</Heading>
|
|
35
|
+
* <Grid columns={3} gap="lg">…</Grid>
|
|
36
|
+
* </Stack>
|
|
37
|
+
* </Container>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
var Container = ({
|
|
41
|
+
size = "surface",
|
|
42
|
+
gutter = "page",
|
|
43
|
+
children,
|
|
44
|
+
...props
|
|
45
|
+
}) => {
|
|
46
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)("div", {
|
|
47
|
+
...props,
|
|
48
|
+
"data-scope": "container",
|
|
49
|
+
"data-part": "root",
|
|
50
|
+
"data-size": size,
|
|
51
|
+
style: {
|
|
52
|
+
boxSizing: "border-box",
|
|
53
|
+
marginInline: "auto",
|
|
54
|
+
width: "100%",
|
|
55
|
+
maxWidth: MAX_WIDTH[size],
|
|
56
|
+
paddingInline: GUTTER[gutter]
|
|
57
|
+
},
|
|
58
|
+
children
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
Container.displayName = containerMeta.displayName;
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
exports.Container = Container;
|
|
65
|
+
exports.containerMeta = containerMeta;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Container/Container.d.ts
|
|
5
|
+
/** Formal semantic identity — Container root (Structure entity, page shell). */
|
|
6
|
+
declare const containerMeta: {
|
|
7
|
+
readonly displayName: "Container";
|
|
8
|
+
readonly entity: "Structure";
|
|
9
|
+
readonly structure: "root";
|
|
10
|
+
};
|
|
11
|
+
/** The inline-size cap: a structural surface width or the readability measure. */
|
|
12
|
+
type ContainerSize = 'surface' | 'reading';
|
|
13
|
+
/** Edge padding drawn from the gutter scale (`none` removes it). */
|
|
14
|
+
type ContainerGutter = 'none' | 'section' | 'page';
|
|
15
|
+
/** Props for the Container component. */
|
|
16
|
+
interface ContainerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {
|
|
17
|
+
/**
|
|
18
|
+
* Inline-size cap. `surface` is the structural page/content width; `reading`
|
|
19
|
+
* is the narrower long-form readability measure. There is no raw max-width.
|
|
20
|
+
* @default 'surface'
|
|
21
|
+
*/
|
|
22
|
+
size?: ContainerSize;
|
|
23
|
+
/**
|
|
24
|
+
* Edge padding from the gutter scale. `page` is the full page gutter;
|
|
25
|
+
* `section` a tighter one; `none` removes it for full-bleed children.
|
|
26
|
+
* @default 'page'
|
|
27
|
+
*/
|
|
28
|
+
gutter?: ContainerGutter;
|
|
29
|
+
/** The shell's content. */
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The page-shell primitive — a centered, width-capped, gutter-padded column.
|
|
34
|
+
*
|
|
35
|
+
* Entity = Structure. Wrap a page (or a major region) in a Container to give
|
|
36
|
+
* it the product's standard content width and edge padding without hand-rolling
|
|
37
|
+
* `max-width` + `margin: auto`. Pick `size="reading"` for long-form article
|
|
38
|
+
* columns and `size="surface"` for app/page shells. Place `Stack`, `Grid`, and
|
|
39
|
+
* `Surface` inside it.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Container size="surface">
|
|
44
|
+
* <Stack gap="xl">
|
|
45
|
+
* <Heading level={1}>Dashboard</Heading>
|
|
46
|
+
* <Grid columns={3} gap="lg">…</Grid>
|
|
47
|
+
* </Stack>
|
|
48
|
+
* </Container>
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
declare const Container: {
|
|
52
|
+
({
|
|
53
|
+
size,
|
|
54
|
+
gutter,
|
|
55
|
+
children,
|
|
56
|
+
...props
|
|
57
|
+
}: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
displayName: "Container";
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { Container, ContainerGutter, ContainerProps, ContainerSize, containerMeta };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Container/Container.d.ts
|
|
5
|
+
/** Formal semantic identity — Container root (Structure entity, page shell). */
|
|
6
|
+
declare const containerMeta: {
|
|
7
|
+
readonly displayName: "Container";
|
|
8
|
+
readonly entity: "Structure";
|
|
9
|
+
readonly structure: "root";
|
|
10
|
+
};
|
|
11
|
+
/** The inline-size cap: a structural surface width or the readability measure. */
|
|
12
|
+
type ContainerSize = 'surface' | 'reading';
|
|
13
|
+
/** Edge padding drawn from the gutter scale (`none` removes it). */
|
|
14
|
+
type ContainerGutter = 'none' | 'section' | 'page';
|
|
15
|
+
/** Props for the Container component. */
|
|
16
|
+
interface ContainerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {
|
|
17
|
+
/**
|
|
18
|
+
* Inline-size cap. `surface` is the structural page/content width; `reading`
|
|
19
|
+
* is the narrower long-form readability measure. There is no raw max-width.
|
|
20
|
+
* @default 'surface'
|
|
21
|
+
*/
|
|
22
|
+
size?: ContainerSize;
|
|
23
|
+
/**
|
|
24
|
+
* Edge padding from the gutter scale. `page` is the full page gutter;
|
|
25
|
+
* `section` a tighter one; `none` removes it for full-bleed children.
|
|
26
|
+
* @default 'page'
|
|
27
|
+
*/
|
|
28
|
+
gutter?: ContainerGutter;
|
|
29
|
+
/** The shell's content. */
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The page-shell primitive — a centered, width-capped, gutter-padded column.
|
|
34
|
+
*
|
|
35
|
+
* Entity = Structure. Wrap a page (or a major region) in a Container to give
|
|
36
|
+
* it the product's standard content width and edge padding without hand-rolling
|
|
37
|
+
* `max-width` + `margin: auto`. Pick `size="reading"` for long-form article
|
|
38
|
+
* columns and `size="surface"` for app/page shells. Place `Stack`, `Grid`, and
|
|
39
|
+
* `Surface` inside it.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Container size="surface">
|
|
44
|
+
* <Stack gap="xl">
|
|
45
|
+
* <Heading level={1}>Dashboard</Heading>
|
|
46
|
+
* <Grid columns={3} gap="lg">…</Grid>
|
|
47
|
+
* </Stack>
|
|
48
|
+
* </Container>
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
declare const Container: {
|
|
52
|
+
({
|
|
53
|
+
size,
|
|
54
|
+
gutter,
|
|
55
|
+
children,
|
|
56
|
+
...props
|
|
57
|
+
}: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
displayName: "Container";
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { Container, ContainerGutter, ContainerProps, ContainerSize, containerMeta };
|
|
@@ -0,0 +1,64 @@
|
|
|
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/Container/Container.tsx
|
|
6
|
+
/** Formal semantic identity — Container root (Structure entity, page shell). */
|
|
7
|
+
var containerMeta = {
|
|
8
|
+
displayName: "Container",
|
|
9
|
+
entity: "Structure",
|
|
10
|
+
structure: "root"
|
|
11
|
+
};
|
|
12
|
+
var MAX_WIDTH = {
|
|
13
|
+
surface: vars.sizing.surface.maxWidth,
|
|
14
|
+
reading: vars.sizing.measure.reading
|
|
15
|
+
};
|
|
16
|
+
var GUTTER = {
|
|
17
|
+
none: "0",
|
|
18
|
+
section: vars.spacing.gutter.section,
|
|
19
|
+
page: vars.spacing.gutter.page
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The page-shell primitive — a centered, width-capped, gutter-padded column.
|
|
23
|
+
*
|
|
24
|
+
* Entity = Structure. Wrap a page (or a major region) in a Container to give
|
|
25
|
+
* it the product's standard content width and edge padding without hand-rolling
|
|
26
|
+
* `max-width` + `margin: auto`. Pick `size="reading"` for long-form article
|
|
27
|
+
* columns and `size="surface"` for app/page shells. Place `Stack`, `Grid`, and
|
|
28
|
+
* `Surface` inside it.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <Container size="surface">
|
|
33
|
+
* <Stack gap="xl">
|
|
34
|
+
* <Heading level={1}>Dashboard</Heading>
|
|
35
|
+
* <Grid columns={3} gap="lg">…</Grid>
|
|
36
|
+
* </Stack>
|
|
37
|
+
* </Container>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
var Container = ({
|
|
41
|
+
size = "surface",
|
|
42
|
+
gutter = "page",
|
|
43
|
+
children,
|
|
44
|
+
...props
|
|
45
|
+
}) => {
|
|
46
|
+
return /* @__PURE__ */jsx("div", {
|
|
47
|
+
...props,
|
|
48
|
+
"data-scope": "container",
|
|
49
|
+
"data-part": "root",
|
|
50
|
+
"data-size": size,
|
|
51
|
+
style: {
|
|
52
|
+
boxSizing: "border-box",
|
|
53
|
+
marginInline: "auto",
|
|
54
|
+
width: "100%",
|
|
55
|
+
maxWidth: MAX_WIDTH[size],
|
|
56
|
+
paddingInline: GUTTER[gutter]
|
|
57
|
+
},
|
|
58
|
+
children
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
Container.displayName = containerMeta.displayName;
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { Container, containerMeta };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
2
|
const require_Button = require('../Button/Button.cjs');
|
|
3
|
-
let react_aria_components = require("react-aria-components");
|
|
4
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
let react_aria_components = require("react-aria-components");
|
|
5
5
|
|
|
6
6
|
//#region src/components/FileTrigger/FileTrigger.tsx
|
|
7
7
|
/** Formal semantic identity — FileTrigger root (Action entity). */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
2
|
import { Button as Button$1 } from "../Button/Button.mjs";
|
|
3
|
-
import { FileTrigger } from "react-aria-components";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { FileTrigger } from "react-aria-components";
|
|
5
5
|
|
|
6
6
|
//#region src/components/FileTrigger/FileTrigger.tsx
|
|
7
7
|
/** Formal semantic identity — FileTrigger root (Action entity). */
|
|
@@ -0,0 +1,88 @@
|
|
|
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/Grid/Grid.tsx
|
|
6
|
+
/** Formal semantic identity — Grid root (Structure entity, 2D layout). */
|
|
7
|
+
var gridMeta = {
|
|
8
|
+
displayName: "Grid",
|
|
9
|
+
entity: "Structure",
|
|
10
|
+
structure: "root"
|
|
11
|
+
};
|
|
12
|
+
var GAP = {
|
|
13
|
+
xs: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.xs,
|
|
14
|
+
sm: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.sm,
|
|
15
|
+
md: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.md,
|
|
16
|
+
lg: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.lg,
|
|
17
|
+
xl: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.xl
|
|
18
|
+
};
|
|
19
|
+
var MIN_COLUMN_WIDTH = {
|
|
20
|
+
xs: "12rem",
|
|
21
|
+
sm: "16rem",
|
|
22
|
+
md: "20rem",
|
|
23
|
+
lg: "24rem"
|
|
24
|
+
};
|
|
25
|
+
var ALIGN = {
|
|
26
|
+
start: "start",
|
|
27
|
+
center: "center",
|
|
28
|
+
end: "end",
|
|
29
|
+
stretch: "stretch"
|
|
30
|
+
};
|
|
31
|
+
/** Equal-fraction track template with an overflow-safe minimum. */
|
|
32
|
+
var tracks = count => {
|
|
33
|
+
return `repeat(${count}, minmax(0, 1fr))`;
|
|
34
|
+
};
|
|
35
|
+
/** Responsive auto-fit template — as many ≥`min`-wide columns as fit. */
|
|
36
|
+
var autoTracks = min => {
|
|
37
|
+
return `repeat(auto-fit, minmax(min(100%, ${MIN_COLUMN_WIDTH[min]}), 1fr))`;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* The 2D layout primitive — a CSS grid spaced from the FSL gap scale.
|
|
41
|
+
*
|
|
42
|
+
* Entity = Structure. Use it for card grids, form field matrices, and any
|
|
43
|
+
* two-dimensional arrangement. `columns`/`rows` are structural integers that
|
|
44
|
+
* resolve to equal, overflow-safe fraction tracks; `gap` draws only from the
|
|
45
|
+
* named scale, so grid rhythm stays consistent across a product. For a single
|
|
46
|
+
* axis of flow, reach for `Stack` instead.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* // Fixed columns
|
|
51
|
+
* <Grid columns={3} gap="lg">…</Grid>
|
|
52
|
+
* // Responsive: as many ≥16rem columns as fit, reflowing automatically
|
|
53
|
+
* <Grid minColumnWidth="sm" gap="lg">…</Grid>
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
var Grid = ({
|
|
57
|
+
columns = 1,
|
|
58
|
+
minColumnWidth,
|
|
59
|
+
rows,
|
|
60
|
+
gap = "md",
|
|
61
|
+
align = "stretch",
|
|
62
|
+
justify = "stretch",
|
|
63
|
+
children,
|
|
64
|
+
...props
|
|
65
|
+
}) => {
|
|
66
|
+
const templateColumns = minColumnWidth === void 0 ? tracks(columns) : autoTracks(minColumnWidth);
|
|
67
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)("div", {
|
|
68
|
+
...props,
|
|
69
|
+
"data-scope": "grid",
|
|
70
|
+
"data-part": "root",
|
|
71
|
+
"data-columns": minColumnWidth === void 0 ? columns : "auto",
|
|
72
|
+
"data-gap": gap,
|
|
73
|
+
style: {
|
|
74
|
+
display: "grid",
|
|
75
|
+
gridTemplateColumns: templateColumns,
|
|
76
|
+
gridTemplateRows: rows === void 0 ? void 0 : tracks(rows),
|
|
77
|
+
gap: GAP[gap],
|
|
78
|
+
alignItems: ALIGN[align],
|
|
79
|
+
justifyItems: ALIGN[justify]
|
|
80
|
+
},
|
|
81
|
+
children
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
Grid.displayName = gridMeta.displayName;
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
exports.Grid = Grid;
|
|
88
|
+
exports.gridMeta = gridMeta;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Grid/Grid.d.ts
|
|
5
|
+
/** Formal semantic identity — Grid root (Structure entity, 2D layout). */
|
|
6
|
+
declare const gridMeta: {
|
|
7
|
+
readonly displayName: "Grid";
|
|
8
|
+
readonly entity: "Structure";
|
|
9
|
+
readonly structure: "root";
|
|
10
|
+
};
|
|
11
|
+
/** A step of the gap scale. */
|
|
12
|
+
type GridGap = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
13
|
+
/** Track (item) alignment along an axis. */
|
|
14
|
+
type GridAlign = 'start' | 'center' | 'end' | 'stretch';
|
|
15
|
+
/**
|
|
16
|
+
* Minimum column width for a responsive auto-fit grid. A small named
|
|
17
|
+
* threshold scale (like a breakpoint), not a per-use length — the grid fits as
|
|
18
|
+
* many equal columns as the container allows, each at least this wide, and
|
|
19
|
+
* reflows the count automatically.
|
|
20
|
+
*/
|
|
21
|
+
type GridMinColumnWidth = 'xs' | 'sm' | 'md' | 'lg';
|
|
22
|
+
/** Props for the Grid component. */
|
|
23
|
+
interface GridProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {
|
|
24
|
+
/**
|
|
25
|
+
* Number of equal-fraction columns (`repeat(N, minmax(0, 1fr))`). A
|
|
26
|
+
* structural integer, not a length — there is no raw track template.
|
|
27
|
+
* Ignored when `minColumnWidth` is set (responsive auto-fit takes over).
|
|
28
|
+
* @default 1
|
|
29
|
+
*/
|
|
30
|
+
columns?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Make the grid **responsive**: fit as many equal columns as the container
|
|
33
|
+
* allows, each at least this wide, reflowing the count automatically
|
|
34
|
+
* (`repeat(auto-fit, minmax(…, 1fr))`). Takes a named threshold, not a
|
|
35
|
+
* length. When set, it overrides `columns`.
|
|
36
|
+
*/
|
|
37
|
+
minColumnWidth?: GridMinColumnWidth;
|
|
38
|
+
/**
|
|
39
|
+
* Number of equal-fraction rows. Omit to let rows size to content (the
|
|
40
|
+
* common case); set it only for explicit row grids.
|
|
41
|
+
*/
|
|
42
|
+
rows?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Space between tracks (row and column), from the gap scale. There is no
|
|
45
|
+
* raw-length vocabulary — rhythm always comes from the scale.
|
|
46
|
+
* @default 'md'
|
|
47
|
+
*/
|
|
48
|
+
gap?: GridGap;
|
|
49
|
+
/** Block-axis alignment of items within their tracks (`align-items`). @default 'stretch' */
|
|
50
|
+
align?: GridAlign;
|
|
51
|
+
/** Inline-axis alignment of items within their tracks (`justify-items`). @default 'stretch' */
|
|
52
|
+
justify?: GridAlign;
|
|
53
|
+
/** The grid items. */
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The 2D layout primitive — a CSS grid spaced from the FSL gap scale.
|
|
58
|
+
*
|
|
59
|
+
* Entity = Structure. Use it for card grids, form field matrices, and any
|
|
60
|
+
* two-dimensional arrangement. `columns`/`rows` are structural integers that
|
|
61
|
+
* resolve to equal, overflow-safe fraction tracks; `gap` draws only from the
|
|
62
|
+
* named scale, so grid rhythm stays consistent across a product. For a single
|
|
63
|
+
* axis of flow, reach for `Stack` instead.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* // Fixed columns
|
|
68
|
+
* <Grid columns={3} gap="lg">…</Grid>
|
|
69
|
+
* // Responsive: as many ≥16rem columns as fit, reflowing automatically
|
|
70
|
+
* <Grid minColumnWidth="sm" gap="lg">…</Grid>
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare const Grid: {
|
|
74
|
+
({
|
|
75
|
+
columns,
|
|
76
|
+
minColumnWidth,
|
|
77
|
+
rows,
|
|
78
|
+
gap,
|
|
79
|
+
align,
|
|
80
|
+
justify,
|
|
81
|
+
children,
|
|
82
|
+
...props
|
|
83
|
+
}: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
displayName: "Grid";
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Grid, GridAlign, GridGap, GridMinColumnWidth, GridProps, gridMeta };
|