@ps1ui/core 0.0.0 → 0.1.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.
Files changed (100) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -0
  3. package/dist/base.css +378 -0
  4. package/dist/components/Anchor/Anchor.d.mts +14 -0
  5. package/dist/components/Anchor/Anchor.mjs +15 -0
  6. package/dist/components/Anchor/Anchor.mjs.map +1 -0
  7. package/dist/components/Button/Button.d.mts +30 -0
  8. package/dist/components/Button/Button.mjs +17 -0
  9. package/dist/components/Button/Button.mjs.map +1 -0
  10. package/dist/components/Card/Card.d.mts +7 -0
  11. package/dist/components/Card/Card.mjs +14 -0
  12. package/dist/components/Card/Card.mjs.map +1 -0
  13. package/dist/components/Checkbox/Checkbox.d.mts +10 -0
  14. package/dist/components/Checkbox/Checkbox.mjs +23 -0
  15. package/dist/components/Checkbox/Checkbox.mjs.map +1 -0
  16. package/dist/components/Code/Code.d.mts +7 -0
  17. package/dist/components/Code/Code.mjs +14 -0
  18. package/dist/components/Code/Code.mjs.map +1 -0
  19. package/dist/components/CodeBlock/CodeBlock.d.mts +15 -0
  20. package/dist/components/CodeBlock/CodeBlock.mjs +44 -0
  21. package/dist/components/CodeBlock/CodeBlock.mjs.map +1 -0
  22. package/dist/components/CodeBlock/refractor.d.mts +7 -0
  23. package/dist/components/CodeBlock/refractor.mjs +26 -0
  24. package/dist/components/CodeBlock/refractor.mjs.map +1 -0
  25. package/dist/components/Container/Container.d.mts +21 -0
  26. package/dist/components/Container/Container.mjs +24 -0
  27. package/dist/components/Container/Container.mjs.map +1 -0
  28. package/dist/components/Details/Details.d.mts +10 -0
  29. package/dist/components/Details/Details.mjs +20 -0
  30. package/dist/components/Details/Details.mjs.map +1 -0
  31. package/dist/components/Grid/Grid.d.mts +21 -0
  32. package/dist/components/Grid/Grid.mjs +24 -0
  33. package/dist/components/Grid/Grid.mjs.map +1 -0
  34. package/dist/components/GridItem/GridItem.d.mts +14 -0
  35. package/dist/components/GridItem/GridItem.mjs +21 -0
  36. package/dist/components/GridItem/GridItem.mjs.map +1 -0
  37. package/dist/components/Heading/Heading.d.mts +26 -0
  38. package/dist/components/Heading/Heading.mjs +53 -0
  39. package/dist/components/Heading/Heading.mjs.map +1 -0
  40. package/dist/components/Input/Input.d.mts +7 -0
  41. package/dist/components/Input/Input.mjs +15 -0
  42. package/dist/components/Input/Input.mjs.map +1 -0
  43. package/dist/components/Label/Label.d.mts +7 -0
  44. package/dist/components/Label/Label.mjs +14 -0
  45. package/dist/components/Label/Label.mjs.map +1 -0
  46. package/dist/components/List/List.d.mts +13 -0
  47. package/dist/components/List/List.mjs +15 -0
  48. package/dist/components/List/List.mjs.map +1 -0
  49. package/dist/components/ListItem/ListItem.d.mts +7 -0
  50. package/dist/components/ListItem/ListItem.mjs +13 -0
  51. package/dist/components/ListItem/ListItem.mjs.map +1 -0
  52. package/dist/components/PS1Root/PS1Root.d.mts +7 -0
  53. package/dist/components/PS1Root/PS1Root.mjs +13 -0
  54. package/dist/components/PS1Root/PS1Root.mjs.map +1 -0
  55. package/dist/components/Stack/Stack.d.mts +33 -0
  56. package/dist/components/Stack/Stack.mjs +48 -0
  57. package/dist/components/Stack/Stack.mjs.map +1 -0
  58. package/dist/components/Table/Table.d.mts +7 -0
  59. package/dist/components/Table/Table.mjs +25 -0
  60. package/dist/components/Table/Table.mjs.map +1 -0
  61. package/dist/components/Tbody/Tbody.d.mts +7 -0
  62. package/dist/components/Tbody/Tbody.mjs +13 -0
  63. package/dist/components/Tbody/Tbody.mjs.map +1 -0
  64. package/dist/components/Td/Td.d.mts +7 -0
  65. package/dist/components/Td/Td.mjs +13 -0
  66. package/dist/components/Td/Td.mjs.map +1 -0
  67. package/dist/components/Text/Text.d.mts +31 -0
  68. package/dist/components/Text/Text.mjs +34 -0
  69. package/dist/components/Text/Text.mjs.map +1 -0
  70. package/dist/components/Th/Th.d.mts +7 -0
  71. package/dist/components/Th/Th.mjs +13 -0
  72. package/dist/components/Th/Th.mjs.map +1 -0
  73. package/dist/components/Thead/Thead.d.mts +7 -0
  74. package/dist/components/Thead/Thead.mjs +13 -0
  75. package/dist/components/Thead/Thead.mjs.map +1 -0
  76. package/dist/components/Tr/Tr.d.mts +7 -0
  77. package/dist/components/Tr/Tr.mjs +13 -0
  78. package/dist/components/Tr/Tr.mjs.map +1 -0
  79. package/dist/components.css +1870 -0
  80. package/dist/index.d.mts +28 -0
  81. package/dist/index.mjs +25 -0
  82. package/dist/styles.css +1930 -0
  83. package/dist/utils/cx.mjs +8 -0
  84. package/dist/utils/cx.mjs.map +1 -0
  85. package/dist/utils/numbers.mjs +8 -0
  86. package/dist/utils/numbers.mjs.map +1 -0
  87. package/dist/utils/responsive.d.mts +6 -0
  88. package/dist/utils/responsive.mjs +39 -0
  89. package/dist/utils/responsive.mjs.map +1 -0
  90. package/dist/utils/spacing.d.mts +5 -0
  91. package/dist/utils/spacing.mjs +8 -0
  92. package/dist/utils/spacing.mjs.map +1 -0
  93. package/dist/utils/typography.d.mts +5 -0
  94. package/dist/utils/typography.mjs +16 -0
  95. package/dist/utils/typography.mjs.map +1 -0
  96. package/dist/utils/useMergedRef.mjs +30 -0
  97. package/dist/utils/useMergedRef.mjs.map +1 -0
  98. package/dist/utils/useScrollableFocus.mjs +29 -0
  99. package/dist/utils/useScrollableFocus.mjs.map +1 -0
  100. package/package.json +84 -3
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { cx } from "../../utils/cx.mjs";
3
+ import { useMergedRef } from "../../utils/useMergedRef.mjs";
4
+ import { useScrollableFocus } from "../../utils/useScrollableFocus.mjs";
5
+ import { refractor } from "./refractor.mjs";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Fragment, useLayoutEffect, useMemo } from "react";
8
+ import { toJsxRuntime } from "hast-util-to-jsx-runtime";
9
+ //#region src/components/CodeBlock/CodeBlock.tsx
10
+ function CodeBlock({ code, children, language, className, onBlur, ref: forwardedRef, ...rest }) {
11
+ const source = code ?? children ?? "";
12
+ const { highlighted, registered } = useMemo(() => {
13
+ const isRegistered = !!language && refractor.registered(language);
14
+ return {
15
+ registered: isRegistered,
16
+ highlighted: isRegistered ? toJsxRuntime(refractor.highlight(source, language), {
17
+ Fragment,
18
+ jsx,
19
+ jsxs
20
+ }) : source
21
+ };
22
+ }, [source, language]);
23
+ const { scrollerRef, tabIndex, measure } = useScrollableFocus();
24
+ useLayoutEffect(() => measure(), [measure, source]);
25
+ const mergedRef = useMergedRef(scrollerRef, forwardedRef);
26
+ return /* @__PURE__ */ jsx("pre", {
27
+ tabIndex,
28
+ ...rest,
29
+ ref: mergedRef,
30
+ className: cx("ps1ui-codeblock", className),
31
+ onBlur: (event) => {
32
+ onBlur?.(event);
33
+ measure();
34
+ },
35
+ children: /* @__PURE__ */ jsx("code", {
36
+ className: registered ? `language-${language}` : void 0,
37
+ children: highlighted
38
+ })
39
+ });
40
+ }
41
+ //#endregion
42
+ export { CodeBlock };
43
+
44
+ //# sourceMappingURL=CodeBlock.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlock.mjs","names":[],"sources":["../../../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["\"use client\";\n\nimport { Fragment, useLayoutEffect, useMemo, type ComponentProps } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { toJsxRuntime } from \"hast-util-to-jsx-runtime\";\nimport { cx } from \"../../utils/cx\";\nimport { useMergedRef } from \"../../utils/useMergedRef\";\nimport { useScrollableFocus } from \"../../utils/useScrollableFocus\";\nimport { refractor, type CodeBlockLanguage } from \"./refractor\";\n\nexport type { CodeBlockLanguage };\n\n// `language` is a new prop (not the native HTML `lang` attribute). HTML `lang`\n// is a BCP47 natural-language tag (\"en\", \"ja\") — a different concept that\n// remains part of the base <pre> attrs and passes through untouched. See\n// CodeBlock.test.tsx for the passthrough assertion.\n//\n// `code` is an alternative to `children` for environments that wrap JSX\n// children on the way to a React tree — e.g. Astro's `.astro` → React island\n// boundary rewraps `children` as an AstroComponentInstance, breaking the\n// `children: string` contract. Named props are passed through as-is, so\n// `<CodeBlock code={snippet}>` survives that boundary. `code` wins when both\n// are supplied; the same string appears in the rendered DOM either way.\nexport type CodeBlockProps = Omit<ComponentProps<\"pre\">, \"children\"> & {\n /** Code to render. Takes precedence over children; use it where JSX children get rewrapped (e.g. Astro islands). */\n code?: string;\n /** Code to render, as the element's only child. */\n children?: string;\n // `CodeBlockLanguage | (string & {})` is TypeScript's \"loose union\" pattern:\n // canonical language names surface in autocomplete, but aliases (`ts`, `html`, ...)\n // and dynamically-sourced strings (e.g. from a markdown fenced-code parser) still\n // pass through the type and are resolved at runtime via refractor's alias table.\n /** Prism language name or alias. Unknown or omitted values render as plain text. */\n language?: CodeBlockLanguage | (string & {});\n};\n\nexport function CodeBlock({\n code,\n children,\n language,\n className,\n onBlur,\n ref: forwardedRef,\n ...rest\n}: CodeBlockProps) {\n // `code` takes precedence — see the type doc for the Astro/RSC-wrapped-children\n // rationale. Empty string is the \"neither provided\" fallback so the component\n // renders a valid empty <pre> instead of throwing on `.highlight(undefined)`.\n const source = code ?? children ?? \"\";\n // `registered` captures both \"language was provided\" and \"refractor knows it\" —\n // used for the highlight path, the language-<x> class, and to keep the class\n // off unhighlighted blocks (so downstream tools and consumer Prism themes\n // don't mistake a raw-text fallback for a highlighted block).\n //\n // useMemo keyed on (children, language) collapses repeated tokenization when a\n // frequently-re-rendering parent forces this component to re-render with the\n // same code — Prism tokenization of a multi-KB snippet + hast → JSX rebuild\n // is not cheap.\n const { highlighted, registered } = useMemo(() => {\n const isRegistered = !!language && refractor.registered(language);\n return {\n registered: isRegistered,\n highlighted: isRegistered\n ? toJsxRuntime(refractor.highlight(source, language), { Fragment, jsx, jsxs })\n : source,\n };\n }, [source, language]);\n\n // Keyboard reachability of the <pre> (its own scroll container) — tabIndex\n // only while the code actually overflows, kept while focused, safe-side\n // under static SSR — is the shared useScrollableFocus contract (see the\n // hook's header for the full account). The overflowing content is the\n // inline <code>, whose box a ResizeObserver can't watch, so content-driven\n // re-measures are keyed on the source string instead.\n const { scrollerRef, tabIndex, measure } = useScrollableFocus<HTMLPreElement>();\n useLayoutEffect(() => measure(), [measure, source]);\n\n // Merge the caller's ref with the hook's so both get the <pre> node.\n const mergedRef = useMergedRef(scrollerRef, forwardedRef);\n\n return (\n <pre\n // oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- axe scrollable-region-focusable requires the <pre> be keyboard-reachable when its content overflows; useScrollableFocus gates this on measured overflow so short snippets stay out of the tab order.\n tabIndex={tabIndex}\n {...rest}\n ref={mergedRef}\n className={cx(\"ps1ui-codeblock\", className)}\n // Chained (not spread) so the caller's handler still runs: the\n // re-measure drops the kept-while-focused tab stop once focus leaves —\n // see useScrollableFocus.\n onBlur={(event) => {\n onBlur?.(event);\n measure();\n }}\n >\n <code className={registered ? `language-${language}` : undefined}>{highlighted}</code>\n </pre>\n );\n}\n"],"mappings":";;;;;;;;;AAoCA,SAAgB,UAAU,EACxB,MACA,UACA,UACA,WACA,QACA,KAAK,cACL,GAAG,QACc;CAIjB,MAAM,SAAS,QAAQ,YAAY;CAUnC,MAAM,EAAE,aAAa,eAAe,cAAc;EAChD,MAAM,eAAe,CAAC,CAAC,YAAY,UAAU,WAAW,QAAQ;EAChE,OAAO;GACL,YAAY;GACZ,aAAa,eACT,aAAa,UAAU,UAAU,QAAQ,QAAQ,GAAG;IAAE;IAAU;IAAK;GAAK,CAAC,IAC3E;EACN;CACF,GAAG,CAAC,QAAQ,QAAQ,CAAC;CAQrB,MAAM,EAAE,aAAa,UAAU,YAAY,mBAAmC;CAC9E,sBAAsB,QAAQ,GAAG,CAAC,SAAS,MAAM,CAAC;CAGlD,MAAM,YAAY,aAAa,aAAa,YAAY;CAExD,OACE,oBAAC,OAAD;EAEY;EACV,GAAI;EACJ,KAAK;EACL,WAAW,GAAG,mBAAmB,SAAS;EAI1C,SAAS,UAAU;GACjB,SAAS,KAAK;GACd,QAAQ;EACV;YAEA,oBAAC,QAAD;GAAM,WAAW,aAAa,YAAY,aAAa,KAAA;aAAY;EAAkB,CAAA;CAClF,CAAA;AAET"}
@@ -0,0 +1,7 @@
1
+ import "refractor";
2
+ //#region src/components/CodeBlock/refractor.d.ts
3
+ declare const KNOWN_LANGS: readonly ["arduino", "bash", "basic", "c", "cpp", "csharp", "css", "diff", "go", "ini", "java", "javascript", "json", "kotlin", "less", "lua", "makefile", "markdown", "markup", "objectivec", "perl", "php", "python", "r", "regex", "ruby", "rust", "sass", "scss", "sql", "swift", "typescript", "vbnet", "yaml", "dart", "docker", "graphql", "jsx", "nginx", "powershell", "shell-session", "toml", "tsx", "zig"];
4
+ type CodeBlockLanguage = (typeof KNOWN_LANGS)[number];
5
+ //#endregion
6
+ export { CodeBlockLanguage };
7
+ //# sourceMappingURL=refractor.d.mts.map
@@ -0,0 +1,26 @@
1
+ import { refractor } from "refractor";
2
+ import dart from "refractor/dart";
3
+ import docker from "refractor/docker";
4
+ import graphql from "refractor/graphql";
5
+ import jsx from "refractor/jsx";
6
+ import nginx from "refractor/nginx";
7
+ import powershell from "refractor/powershell";
8
+ import shellSession from "refractor/shell-session";
9
+ import toml from "refractor/toml";
10
+ import tsx from "refractor/tsx";
11
+ import zig from "refractor/zig";
12
+ //#region src/components/CodeBlock/refractor.ts
13
+ refractor.register(dart);
14
+ refractor.register(docker);
15
+ refractor.register(graphql);
16
+ refractor.register(jsx);
17
+ refractor.register(nginx);
18
+ refractor.register(powershell);
19
+ refractor.register(shellSession);
20
+ refractor.register(toml);
21
+ refractor.register(tsx);
22
+ refractor.register(zig);
23
+ //#endregion
24
+ export { refractor };
25
+
26
+ //# sourceMappingURL=refractor.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refractor.mjs","names":[],"sources":["../../../src/components/CodeBlock/refractor.ts"],"sourcesContent":["// Shared Refractor singleton. `refractor` (as opposed to `refractor/core`) ships with\n// ~36 \"checked\" languages pre-registered — see refractor/lib/common.js. We layer a\n// curated set of additional languages on top so common ecosystem grammars work out of\n// the box. Static imports on purpose: only CodeBlock consumers pay for them (this\n// module is its own side-effectful dist chunk — see package.json `sideEffects`),\n// and lazy `import()` registration would make highlighting async (unhighlighted\n// first paint, no SSR story) for a few KB per grammar. Keep this list intentional.\nimport { refractor } from \"refractor\";\n\nimport dart from \"refractor/dart\";\nimport docker from \"refractor/docker\";\nimport graphql from \"refractor/graphql\";\nimport jsx from \"refractor/jsx\";\nimport nginx from \"refractor/nginx\";\nimport powershell from \"refractor/powershell\";\nimport shellSession from \"refractor/shell-session\";\nimport toml from \"refractor/toml\";\nimport tsx from \"refractor/tsx\";\nimport zig from \"refractor/zig\";\n\nrefractor.register(dart);\nrefractor.register(docker);\nrefractor.register(graphql);\nrefractor.register(jsx);\nrefractor.register(nginx);\nrefractor.register(powershell);\nrefractor.register(shellSession);\nrefractor.register(toml);\nrefractor.register(tsx);\nrefractor.register(zig);\n\n// Canonical display names of every language the singleton has registered AND\n// makes sense to expose to consumers. Kept as an `as const` tuple purely so\n// `CodeBlockLanguage` can derive from it — the array itself is intentionally\n// unexported (tree-shakes to nothing in consumer bundles).\n//\n// If you add/remove a `refractor.register(...)` above OR alter what refractor's\n// `common` bundle registers, update this list to match. `scripts/check-languages.mjs`\n// enforces the invariant that every name here is actually registered at runtime.\n//\n// Deliberately EXCLUDED even though refractor registers them:\n// - `clike`, `markup-templating` — base grammars other languages extend; passing\n// them as the top-level language produces near-empty highlighting.\n//\n// Aliases (e.g. `ts` → `typescript`, `html` → `markup`) are NOT listed here; they\n// still resolve at runtime via refractor's alias table and pass through the type\n// via the `(string & {})` escape hatch on `CodeBlockProps[\"language\"]`.\nconst KNOWN_LANGS = [\n // from refractor/lib/common.js (registered by `import { refractor } from \"refractor\"`)\n \"arduino\",\n \"bash\",\n \"basic\",\n \"c\",\n \"cpp\",\n \"csharp\",\n \"css\",\n \"diff\",\n \"go\",\n \"ini\",\n \"java\",\n \"javascript\",\n \"json\",\n \"kotlin\",\n \"less\",\n \"lua\",\n \"makefile\",\n \"markdown\",\n \"markup\",\n \"objectivec\",\n \"perl\",\n \"php\",\n \"python\",\n \"r\",\n \"regex\",\n \"ruby\",\n \"rust\",\n \"sass\",\n \"scss\",\n \"sql\",\n \"swift\",\n \"typescript\",\n \"vbnet\",\n \"yaml\",\n // registered above\n \"dart\",\n \"docker\",\n \"graphql\",\n \"jsx\",\n \"nginx\",\n \"powershell\",\n \"shell-session\",\n \"toml\",\n \"tsx\",\n \"zig\",\n] as const;\n\nexport type CodeBlockLanguage = (typeof KNOWN_LANGS)[number];\n\nexport { refractor };\n"],"mappings":";;;;;;;;;;;;AAoBA,UAAU,SAAS,IAAI;AACvB,UAAU,SAAS,MAAM;AACzB,UAAU,SAAS,OAAO;AAC1B,UAAU,SAAS,GAAG;AACtB,UAAU,SAAS,KAAK;AACxB,UAAU,SAAS,UAAU;AAC7B,UAAU,SAAS,YAAY;AAC/B,UAAU,SAAS,IAAI;AACvB,UAAU,SAAS,GAAG;AACtB,UAAU,SAAS,GAAG"}
@@ -0,0 +1,21 @@
1
+ import { Responsive } from "../../utils/responsive.mjs";
2
+ import { SpaceScale } from "../../utils/spacing.mjs";
3
+ import { ComponentProps } from "react";
4
+ //#region src/components/Container/Container.d.ts
5
+ type ContainerSize = "sm" | "md" | "lg" | "xl" | "full";
6
+ type ContainerProps = ComponentProps<"div"> & {
7
+ /**
8
+ * Max-width preset; "full" removes the cap.
9
+ * @default "lg"
10
+ */
11
+ size?: Responsive<ContainerSize>;
12
+ /**
13
+ * Horizontal padding on the space scale.
14
+ * @default "lg"
15
+ */
16
+ px?: Responsive<SpaceScale>;
17
+ };
18
+ declare function Container({ size, px, className, style, ...rest }: ContainerProps): import("react").JSX.Element;
19
+ //#endregion
20
+ export { Container, ContainerProps, ContainerSize };
21
+ //# sourceMappingURL=Container.d.mts.map
@@ -0,0 +1,24 @@
1
+ import { cx } from "../../utils/cx.mjs";
2
+ import { resolveResponsive } from "../../utils/responsive.mjs";
3
+ import { spaceToVar } from "../../utils/spacing.mjs";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/Container/Container.tsx
6
+ const sizeToVar = (v) => v === "full" ? "none" : `var(--ps1ui-container-${v})`;
7
+ function Container({ size, px, className, style, ...rest }) {
8
+ const sizeVars = resolveResponsive(size, "--_container-size", sizeToVar);
9
+ const pxVars = resolveResponsive(px, "--_container-px", spaceToVar);
10
+ const mergedStyle = {
11
+ ...style,
12
+ ...sizeVars,
13
+ ...pxVars
14
+ };
15
+ return /* @__PURE__ */ jsx("div", {
16
+ ...rest,
17
+ className: cx("ps1ui-container", className),
18
+ style: mergedStyle
19
+ });
20
+ }
21
+ //#endregion
22
+ export { Container };
23
+
24
+ //# sourceMappingURL=Container.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Container.mjs","names":[],"sources":["../../../src/components/Container/Container.tsx"],"sourcesContent":["import type { ComponentProps, CSSProperties } from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport { resolveResponsive, type Responsive } from \"../../utils/responsive\";\nimport { spaceToVar, type SpaceScale } from \"../../utils/spacing\";\n\nexport type ContainerSize = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"full\";\n\nexport type ContainerProps = ComponentProps<\"div\"> & {\n /**\n * Max-width preset; \"full\" removes the cap.\n * @default \"lg\"\n */\n size?: Responsive<ContainerSize>;\n /**\n * Horizontal padding on the space scale.\n * @default \"lg\"\n */\n px?: Responsive<SpaceScale>;\n};\n\n// size → max-width. `full` maps to `none` (unbounded), the rest reference\n// the --ps1ui-container-* max-width tokens in tokens.css.\nconst sizeToVar = (v: ContainerSize): string =>\n v === \"full\" ? \"none\" : `var(--ps1ui-container-${v})`;\n\nexport function Container({ size, px, className, style, ...rest }: ContainerProps) {\n const sizeVars = resolveResponsive(size, \"--_container-size\", sizeToVar);\n const pxVars = resolveResponsive(px, \"--_container-px\", spaceToVar);\n // Caller style first, internal `--_*` vars win — see Text.tsx. Cast because\n // csstype has no index signature for `--*` keys (React 19 included).\n const mergedStyle: CSSProperties = {\n ...style,\n ...sizeVars,\n ...pxVars,\n } as CSSProperties;\n return <div {...rest} className={cx(\"ps1ui-container\", className)} style={mergedStyle} />;\n}\n"],"mappings":";;;;;AAsBA,MAAM,aAAa,MACjB,MAAM,SAAS,SAAS,yBAAyB,EAAE;AAErD,SAAgB,UAAU,EAAE,MAAM,IAAI,WAAW,OAAO,GAAG,QAAwB;CACjF,MAAM,WAAW,kBAAkB,MAAM,qBAAqB,SAAS;CACvE,MAAM,SAAS,kBAAkB,IAAI,mBAAmB,UAAU;CAGlE,MAAM,cAA6B;EACjC,GAAG;EACH,GAAG;EACH,GAAG;CACL;CACA,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAM,WAAW,GAAG,mBAAmB,SAAS;EAAG,OAAO;CAAc,CAAA;AAC1F"}
@@ -0,0 +1,10 @@
1
+ import { ComponentProps, ReactNode } from "react";
2
+ //#region src/components/Details/Details.d.ts
3
+ type DetailsProps = ComponentProps<"details"> & {
4
+ /** Content of the always-visible summary row. */
5
+ summary: ReactNode;
6
+ };
7
+ declare function Details({ summary, children, className, ...rest }: DetailsProps): import("react").JSX.Element;
8
+ //#endregion
9
+ export { Details, DetailsProps };
10
+ //# sourceMappingURL=Details.d.mts.map
@@ -0,0 +1,20 @@
1
+ import { cx } from "../../utils/cx.mjs";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/components/Details/Details.tsx
4
+ function Details({ summary, children, className, ...rest }) {
5
+ return /* @__PURE__ */ jsxs("details", {
6
+ ...rest,
7
+ className: cx("ps1ui-details", className),
8
+ children: [/* @__PURE__ */ jsx("summary", {
9
+ className: "ps1ui-details__summary",
10
+ children: summary
11
+ }), /* @__PURE__ */ jsx("div", {
12
+ className: "ps1ui-details__body",
13
+ children
14
+ })]
15
+ });
16
+ }
17
+ //#endregion
18
+ export { Details };
19
+
20
+ //# sourceMappingURL=Details.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Details.mjs","names":[],"sources":["../../../src/components/Details/Details.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport type DetailsProps = ComponentProps<\"details\"> & {\n /** Content of the always-visible summary row. */\n summary: ReactNode;\n};\n\nexport function Details({ summary, children, className, ...rest }: DetailsProps) {\n return (\n <details {...rest} className={cx(\"ps1ui-details\", className)}>\n <summary className=\"ps1ui-details__summary\">{summary}</summary>\n <div className=\"ps1ui-details__body\">{children}</div>\n </details>\n );\n}\n"],"mappings":";;;AAQA,SAAgB,QAAQ,EAAE,SAAS,UAAU,WAAW,GAAG,QAAsB;CAC/E,OACE,qBAAC,WAAD;EAAS,GAAI;EAAM,WAAW,GAAG,iBAAiB,SAAS;YAA3D,CACE,oBAAC,WAAD;GAAS,WAAU;aAA0B;EAAiB,CAAA,GAC9D,oBAAC,OAAD;GAAK,WAAU;GAAuB;EAAc,CAAA,CAC7C;;AAEb"}
@@ -0,0 +1,21 @@
1
+ import { Responsive } from "../../utils/responsive.mjs";
2
+ import { SpaceScale } from "../../utils/spacing.mjs";
3
+ import { ComponentProps } from "react";
4
+ //#region src/components/Grid/Grid.d.ts
5
+ type GridGap = SpaceScale;
6
+ type GridProps = ComponentProps<"div"> & {
7
+ /**
8
+ * Number of equal-width columns.
9
+ * @default 1
10
+ */
11
+ columns?: Responsive<number>;
12
+ /**
13
+ * Gap between cells on the space scale.
14
+ * @default "md"
15
+ */
16
+ gap?: Responsive<GridGap>;
17
+ };
18
+ declare function Grid({ columns, gap, className, style, ...rest }: GridProps): import("react").JSX.Element;
19
+ //#endregion
20
+ export { Grid, GridGap, GridProps };
21
+ //# sourceMappingURL=Grid.d.mts.map
@@ -0,0 +1,24 @@
1
+ import { cx } from "../../utils/cx.mjs";
2
+ import { resolveResponsive } from "../../utils/responsive.mjs";
3
+ import { spaceToVar } from "../../utils/spacing.mjs";
4
+ import { safePositiveInt } from "../../utils/numbers.mjs";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/components/Grid/Grid.tsx
7
+ function Grid({ columns, gap, className, style, ...rest }) {
8
+ const columnsVars = resolveResponsive(columns, "--_grid-columns", safePositiveInt);
9
+ const gapVars = resolveResponsive(gap, "--_grid-gap", spaceToVar);
10
+ const mergedStyle = {
11
+ ...style,
12
+ ...columnsVars,
13
+ ...gapVars
14
+ };
15
+ return /* @__PURE__ */ jsx("div", {
16
+ ...rest,
17
+ className: cx("ps1ui-grid", className),
18
+ style: mergedStyle
19
+ });
20
+ }
21
+ //#endregion
22
+ export { Grid };
23
+
24
+ //# sourceMappingURL=Grid.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grid.mjs","names":[],"sources":["../../../src/components/Grid/Grid.tsx"],"sourcesContent":["import type { ComponentProps, CSSProperties } from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport { safePositiveInt } from \"../../utils/numbers\";\nimport { resolveResponsive, type Responsive } from \"../../utils/responsive\";\nimport { spaceToVar, type SpaceScale } from \"../../utils/spacing\";\n\nexport type GridGap = SpaceScale;\n\nexport type GridProps = ComponentProps<\"div\"> & {\n /**\n * Number of equal-width columns.\n * @default 1\n */\n columns?: Responsive<number>;\n /**\n * Gap between cells on the space scale.\n * @default \"md\"\n */\n gap?: Responsive<GridGap>;\n};\n\nexport function Grid({ columns, gap, className, style, ...rest }: GridProps) {\n // `repeat(N, ...)` requires N ≥ 1 integer — `safePositiveInt` clamps at\n // the system boundary. See utils/numbers.ts for the full rationale.\n const columnsVars = resolveResponsive(columns, \"--_grid-columns\", safePositiveInt);\n const gapVars = resolveResponsive(gap, \"--_grid-gap\", spaceToVar);\n // Caller style first, internal `--_*` vars win — see Text.tsx. Cast because\n // csstype has no index signature for `--*` keys (React 19 included).\n const mergedStyle: CSSProperties = {\n ...style,\n ...columnsVars,\n ...gapVars,\n } as CSSProperties;\n return <div {...rest} className={cx(\"ps1ui-grid\", className)} style={mergedStyle} />;\n}\n"],"mappings":";;;;;;AAqBA,SAAgB,KAAK,EAAE,SAAS,KAAK,WAAW,OAAO,GAAG,QAAmB;CAG3E,MAAM,cAAc,kBAAkB,SAAS,mBAAmB,eAAe;CACjF,MAAM,UAAU,kBAAkB,KAAK,eAAe,UAAU;CAGhE,MAAM,cAA6B;EACjC,GAAG;EACH,GAAG;EACH,GAAG;CACL;CACA,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAM,WAAW,GAAG,cAAc,SAAS;EAAG,OAAO;CAAc,CAAA;AACrF"}
@@ -0,0 +1,14 @@
1
+ import { Responsive } from "../../utils/responsive.mjs";
2
+ import { ComponentProps } from "react";
3
+ //#region src/components/GridItem/GridItem.d.ts
4
+ type GridItemProps = ComponentProps<"div"> & {
5
+ /**
6
+ * Number of grid columns the item spans.
7
+ * @default 1
8
+ */
9
+ colSpan?: Responsive<number>;
10
+ };
11
+ declare function GridItem({ colSpan, className, style, ...rest }: GridItemProps): import("react").JSX.Element;
12
+ //#endregion
13
+ export { GridItem, GridItemProps };
14
+ //# sourceMappingURL=GridItem.d.mts.map
@@ -0,0 +1,21 @@
1
+ import { cx } from "../../utils/cx.mjs";
2
+ import { resolveResponsive } from "../../utils/responsive.mjs";
3
+ import { safePositiveInt } from "../../utils/numbers.mjs";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/GridItem/GridItem.tsx
6
+ function GridItem({ colSpan, className, style, ...rest }) {
7
+ const colSpanVars = resolveResponsive(colSpan, "--_griditem-col-span", safePositiveInt);
8
+ const mergedStyle = {
9
+ ...style,
10
+ ...colSpanVars
11
+ };
12
+ return /* @__PURE__ */ jsx("div", {
13
+ ...rest,
14
+ className: cx("ps1ui-griditem", className),
15
+ style: mergedStyle
16
+ });
17
+ }
18
+ //#endregion
19
+ export { GridItem };
20
+
21
+ //# sourceMappingURL=GridItem.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridItem.mjs","names":[],"sources":["../../../src/components/GridItem/GridItem.tsx"],"sourcesContent":["import type { ComponentProps, CSSProperties } from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport { safePositiveInt } from \"../../utils/numbers\";\nimport { resolveResponsive, type Responsive } from \"../../utils/responsive\";\n\nexport type GridItemProps = ComponentProps<\"div\"> & {\n /**\n * Number of grid columns the item spans.\n * @default 1\n */\n colSpan?: Responsive<number>;\n};\n\nexport function GridItem({ colSpan, className, style, ...rest }: GridItemProps) {\n // `grid-column: span N` requires N ≥ 1 integer — `safePositiveInt` clamps\n // at the system boundary. See utils/numbers.ts for the full rationale.\n const colSpanVars = resolveResponsive(colSpan, \"--_griditem-col-span\", safePositiveInt);\n // Caller style first, internal `--_*` vars win — see Text.tsx. Cast because\n // csstype has no index signature for `--*` keys (React 19 included).\n const mergedStyle: CSSProperties = {\n ...style,\n ...colSpanVars,\n } as CSSProperties;\n return <div {...rest} className={cx(\"ps1ui-griditem\", className)} style={mergedStyle} />;\n}\n"],"mappings":";;;;;AAaA,SAAgB,SAAS,EAAE,SAAS,WAAW,OAAO,GAAG,QAAuB;CAG9E,MAAM,cAAc,kBAAkB,SAAS,wBAAwB,eAAe;CAGtF,MAAM,cAA6B;EACjC,GAAG;EACH,GAAG;CACL;CACA,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAM,WAAW,GAAG,kBAAkB,SAAS;EAAG,OAAO;CAAc,CAAA;AACzF"}
@@ -0,0 +1,26 @@
1
+ import { Responsive } from "../../utils/responsive.mjs";
2
+ import { FontWeight } from "../../utils/typography.mjs";
3
+ import { CSSProperties, ComponentPropsWithoutRef } from "react";
4
+ //#region src/components/Heading/Heading.d.ts
5
+ type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
6
+ type HeadingElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
7
+ type HeadingSize = "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
8
+ type HeadingWeight = FontWeight;
9
+ type HeadingOwnProps<E extends HeadingElement> = {
10
+ /** Semantic level: renders the matching h1–h6 tag and sets the default size and weight. */
11
+ level: HeadingLevel;
12
+ /** Heading tag to render when it should differ from level — visual defaults stay driven by level. */
13
+ as?: E;
14
+ /** Font size. Defaults to the level's size. */
15
+ size?: Responsive<HeadingSize>;
16
+ /** Font weight. Defaults to the level's weight. */
17
+ weight?: Responsive<HeadingWeight>;
18
+ };
19
+ type HeadingProps<E extends HeadingElement = HeadingElement> = HeadingOwnProps<E> & Omit<ComponentPropsWithoutRef<E>, keyof HeadingOwnProps<E>>;
20
+ declare function Heading<E extends HeadingElement = HeadingElement>({ level, as, size: sizeProp, weight: weightProp, className, style, ...rest }: HeadingProps<E>): import("react").ReactElement<Omit<HeadingProps<E>, "as" | "className" | "level" | "size" | "style" | "weight"> & {
21
+ className: string;
22
+ style: CSSProperties;
23
+ }, string | import("react").JSXElementConstructor<any>>;
24
+ //#endregion
25
+ export { Heading, HeadingElement, HeadingLevel, HeadingProps, HeadingSize, HeadingWeight };
26
+ //# sourceMappingURL=Heading.d.mts.map
@@ -0,0 +1,53 @@
1
+ import { cx } from "../../utils/cx.mjs";
2
+ import { resolveResponsive, withResponsiveBase } from "../../utils/responsive.mjs";
3
+ import { fontSizeToVar, weightToValue } from "../../utils/typography.mjs";
4
+ import { createElement } from "react";
5
+ //#region src/components/Heading/Heading.tsx
6
+ const LEVEL_DEFAULTS = {
7
+ 1: {
8
+ size: "3xl",
9
+ weight: "bold"
10
+ },
11
+ 2: {
12
+ size: "2xl",
13
+ weight: "semibold"
14
+ },
15
+ 3: {
16
+ size: "xl",
17
+ weight: "semibold"
18
+ },
19
+ 4: {
20
+ size: "lg",
21
+ weight: "semibold"
22
+ },
23
+ 5: {
24
+ size: "md",
25
+ weight: "medium"
26
+ },
27
+ 6: {
28
+ size: "sm",
29
+ weight: "medium"
30
+ }
31
+ };
32
+ function Heading({ level, as, size: sizeProp, weight: weightProp, className, style, ...rest }) {
33
+ const tag = as ?? `h${level}`;
34
+ const defaults = LEVEL_DEFAULTS[level];
35
+ const size = withResponsiveBase(sizeProp, defaults.size);
36
+ const weight = withResponsiveBase(weightProp, defaults.weight);
37
+ const sizeVars = resolveResponsive(size, "--_heading-size", fontSizeToVar);
38
+ const weightVars = resolveResponsive(weight, "--_heading-weight", weightToValue);
39
+ const mergedStyle = {
40
+ ...style,
41
+ ...sizeVars,
42
+ ...weightVars
43
+ };
44
+ return createElement(tag, {
45
+ ...rest,
46
+ className: cx("ps1ui-heading", className),
47
+ style: mergedStyle
48
+ });
49
+ }
50
+ //#endregion
51
+ export { Heading };
52
+
53
+ //# sourceMappingURL=Heading.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Heading.mjs","names":[],"sources":["../../../src/components/Heading/Heading.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport type { ComponentPropsWithoutRef, CSSProperties } from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport { resolveResponsive, withResponsiveBase, type Responsive } from \"../../utils/responsive\";\nimport { fontSizeToVar, weightToValue, type FontWeight } from \"../../utils/typography\";\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type HeadingElement = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\nexport type HeadingSize = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\";\n// HeadingWeight is a re-export of the shared FontWeight scale. Keeping a\n// component-local alias preserves the public type name (backwards compat)\n// while the underlying scale stays single-sourced in utils/typography.ts.\nexport type HeadingWeight = FontWeight;\n\ntype HeadingOwnProps<E extends HeadingElement> = {\n /** Semantic level: renders the matching h1–h6 tag and sets the default size and weight. */\n level: HeadingLevel;\n /** Heading tag to render when it should differ from level — visual defaults stay driven by level. */\n as?: E;\n /** Font size. Defaults to the level's size. */\n size?: Responsive<HeadingSize>;\n /** Font weight. Defaults to the level's weight. */\n weight?: Responsive<HeadingWeight>;\n};\n\n// Deliberate exception to the general \"use ComponentProps<'tag'>\" rule other components follow —\n// same reasoning as Text: with a polymorphic `as` prop TypeScript cannot correctly narrow the\n// `ref` type. All h1-h6 do resolve to HTMLHeadingElement so ref would happen to work today, but\n// keeping the polymorphic pattern consistent avoids surprises if the tag set ever widens.\nexport type HeadingProps<E extends HeadingElement = HeadingElement> = HeadingOwnProps<E> &\n Omit<ComponentPropsWithoutRef<E>, keyof HeadingOwnProps<E>>;\n\n// Exhaustive over HeadingLevel so a new level cannot be added without classifying its defaults.\nconst LEVEL_DEFAULTS: Record<HeadingLevel, { size: HeadingSize; weight: HeadingWeight }> = {\n 1: { size: \"3xl\", weight: \"bold\" },\n 2: { size: \"2xl\", weight: \"semibold\" },\n 3: { size: \"xl\", weight: \"semibold\" },\n 4: { size: \"lg\", weight: \"semibold\" },\n 5: { size: \"md\", weight: \"medium\" },\n 6: { size: \"sm\", weight: \"medium\" },\n};\n\nexport function Heading<E extends HeadingElement = HeadingElement>({\n level,\n as,\n size: sizeProp,\n weight: weightProp,\n className,\n style,\n ...rest\n}: HeadingProps<E>) {\n const tag = as ?? (`h${level}` as HeadingElement);\n const defaults = LEVEL_DEFAULTS[level];\n // `withResponsiveBase` bakes the level's default in at the `base`\n // breakpoint when the caller either omits the prop entirely or passes a\n // responsive object with no `base` entry. Concretely, `<Heading level={1}\n // size={{ md: \"2xl\" }}>` renders as level 1's default `3xl` at base, then\n // `2xl` at the md breakpoint — matching the intuition \"level sets the\n // default; the object overrides at specific widths\".\n const size = withResponsiveBase(sizeProp, defaults.size);\n const weight = withResponsiveBase(weightProp, defaults.weight);\n\n const sizeVars = resolveResponsive(size, \"--_heading-size\", fontSizeToVar);\n const weightVars = resolveResponsive(weight, \"--_heading-weight\", weightToValue);\n\n // Caller style first, internal `--_*` vars win — see Text.tsx. Cast because\n // csstype has no index signature for `--*` keys (React 19 included).\n const mergedStyle: CSSProperties = {\n ...style,\n ...sizeVars,\n ...weightVars,\n } as CSSProperties;\n\n return createElement(tag, {\n ...rest,\n className: cx(\"ps1ui-heading\", className),\n style: mergedStyle,\n });\n}\n"],"mappings":";;;;;AAkCA,MAAM,iBAAqF;CACzF,GAAG;EAAE,MAAM;EAAO,QAAQ;CAAO;CACjC,GAAG;EAAE,MAAM;EAAO,QAAQ;CAAW;CACrC,GAAG;EAAE,MAAM;EAAM,QAAQ;CAAW;CACpC,GAAG;EAAE,MAAM;EAAM,QAAQ;CAAW;CACpC,GAAG;EAAE,MAAM;EAAM,QAAQ;CAAS;CAClC,GAAG;EAAE,MAAM;EAAM,QAAQ;CAAS;AACpC;AAEA,SAAgB,QAAmD,EACjE,OACA,IACA,MAAM,UACN,QAAQ,YACR,WACA,OACA,GAAG,QACe;CAClB,MAAM,MAAM,MAAO,IAAI;CACvB,MAAM,WAAW,eAAe;CAOhC,MAAM,OAAO,mBAAmB,UAAU,SAAS,IAAI;CACvD,MAAM,SAAS,mBAAmB,YAAY,SAAS,MAAM;CAE7D,MAAM,WAAW,kBAAkB,MAAM,mBAAmB,aAAa;CACzE,MAAM,aAAa,kBAAkB,QAAQ,qBAAqB,aAAa;CAI/E,MAAM,cAA6B;EACjC,GAAG;EACH,GAAG;EACH,GAAG;CACL;CAEA,OAAO,cAAc,KAAK;EACxB,GAAG;EACH,WAAW,GAAG,iBAAiB,SAAS;EACxC,OAAO;CACT,CAAC;AACH"}
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/components/Input/Input.d.ts
3
+ type InputProps = ComponentProps<"input">;
4
+ declare function Input({ className, type, ...rest }: InputProps): import("react").JSX.Element;
5
+ //#endregion
6
+ export { Input, InputProps };
7
+ //# sourceMappingURL=Input.d.mts.map
@@ -0,0 +1,15 @@
1
+ import { cx } from "../../utils/cx.mjs";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/Input/Input.tsx
4
+ function Input({ className, type = "text", ...rest }) {
5
+ const classes = cx("ps1ui-input", className);
6
+ return /* @__PURE__ */ jsx("input", {
7
+ ...rest,
8
+ type,
9
+ className: classes
10
+ });
11
+ }
12
+ //#endregion
13
+ export { Input };
14
+
15
+ //# sourceMappingURL=Input.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.mjs","names":[],"sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport type InputProps = ComponentProps<\"input\">;\n\nexport function Input({ className, type = \"text\", ...rest }: InputProps) {\n const classes = cx(\"ps1ui-input\", className);\n return <input {...rest} type={type} className={classes} />;\n}\n"],"mappings":";;;AAKA,SAAgB,MAAM,EAAE,WAAW,OAAO,QAAQ,GAAG,QAAoB;CACvE,MAAM,UAAU,GAAG,eAAe,SAAS;CAC3C,OAAO,oBAAC,SAAD;EAAO,GAAI;EAAY;EAAM,WAAW;CAAU,CAAA;AAC3D"}
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/components/Label/Label.d.ts
3
+ type LabelProps = ComponentProps<"label">;
4
+ declare function Label({ className, ...rest }: LabelProps): import("react").JSX.Element;
5
+ //#endregion
6
+ export { Label, LabelProps };
7
+ //# sourceMappingURL=Label.d.mts.map
@@ -0,0 +1,14 @@
1
+ import { cx } from "../../utils/cx.mjs";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/Label/Label.tsx
4
+ function Label({ className, ...rest }) {
5
+ const classes = cx("ps1ui-label", className);
6
+ return /* @__PURE__ */ jsx("label", {
7
+ ...rest,
8
+ className: classes
9
+ });
10
+ }
11
+ //#endregion
12
+ export { Label };
13
+
14
+ //# sourceMappingURL=Label.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Label.mjs","names":[],"sources":["../../../src/components/Label/Label.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport type LabelProps = ComponentProps<\"label\">;\n\nexport function Label({ className, ...rest }: LabelProps) {\n const classes = cx(\"ps1ui-label\", className);\n // oxlint-disable-next-line jsx-a11y/label-has-associated-control -- ultra-thin <label> wrapper; the caller supplies htmlFor or nests the control.\n return <label {...rest} className={classes} />;\n}\n"],"mappings":";;;AAKA,SAAgB,MAAM,EAAE,WAAW,GAAG,QAAoB;CACxD,MAAM,UAAU,GAAG,eAAe,SAAS;CAE3C,OAAO,oBAAC,SAAD;EAAO,GAAI;EAAM,WAAW;CAAU,CAAA;AAC/C"}
@@ -0,0 +1,13 @@
1
+ import { ComponentProps, ReactElement } from "react";
2
+ //#region src/components/List/List.d.ts
3
+ type ListProps = ({
4
+ /** Render an <ol> with numbered markers instead of an <ul>. */
5
+ ordered?: false;
6
+ } & ComponentProps<"ul">) | ({
7
+ /** Render an <ol> with numbered markers instead of an <ul>. */
8
+ ordered: true;
9
+ } & Omit<ComponentProps<"ol">, "type">);
10
+ declare function List(props: ListProps): ReactElement;
11
+ //#endregion
12
+ export { List, ListProps };
13
+ //# sourceMappingURL=List.d.mts.map
@@ -0,0 +1,15 @@
1
+ import { cx } from "../../utils/cx.mjs";
2
+ import { createElement } from "react";
3
+ //#region src/components/List/List.tsx
4
+ function List(props) {
5
+ const { ordered = false, className, ...rest } = props;
6
+ return createElement(ordered ? "ol" : "ul", {
7
+ role: "list",
8
+ ...rest,
9
+ className: cx("ps1ui-list", ordered ? "ps1ui-list--ordered" : "ps1ui-list--unordered", className)
10
+ });
11
+ }
12
+ //#endregion
13
+ export { List };
14
+
15
+ //# sourceMappingURL=List.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.mjs","names":[],"sources":["../../../src/components/List/List.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport type { ComponentProps, ReactElement } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\n// Discriminated union: an unordered <List> shouldn't typecheck with <ol>-only\n// attributes (start / reversed) and shouldn't type its ref as HTMLOListElement.\n// `type` is dropped from the ordered variant because the visible marker is\n// drawn by `::before`, not the browser's `::marker`, so `type=\"a\"` would\n// silently not affect the visible numbering.\nexport type ListProps =\n | ({\n /** Render an <ol> with numbered markers instead of an <ul>. */\n ordered?: false;\n } & ComponentProps<\"ul\">)\n | ({\n /** Render an <ol> with numbered markers instead of an <ul>. */\n ordered: true;\n } & Omit<ComponentProps<\"ol\">, \"type\">);\n\n// Return type annotated so tsdown emits a small ReactElement in the .d.mts\n// instead of the wide DetailedReactHTMLElement createElement infers for a\n// `\"ol\" | \"ul\"` tag union.\nexport function List(props: ListProps): ReactElement {\n const { ordered = false, className, ...rest } = props;\n const tag = ordered ? \"ol\" : \"ul\";\n return createElement(tag, {\n // Safari's a11y tree drops list semantics (\"list, N items\") when the\n // computed `list-style-type` is `none` — the global reset applies that,\n // so `role=\"list\"` restores VoiceOver's announcement. Placed before\n // `...rest` so a caller can override with a different role.\n role: \"list\",\n ...rest,\n className: cx(\n \"ps1ui-list\",\n ordered ? \"ps1ui-list--ordered\" : \"ps1ui-list--unordered\",\n className,\n ),\n });\n}\n"],"mappings":";;;AAsBA,SAAgB,KAAK,OAAgC;CACnD,MAAM,EAAE,UAAU,OAAO,WAAW,GAAG,SAAS;CAEhD,OAAO,cADK,UAAU,OAAO,MACH;EAKxB,MAAM;EACN,GAAG;EACH,WAAW,GACT,cACA,UAAU,wBAAwB,yBAClC,SACF;CACF,CAAC;AACH"}
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/components/ListItem/ListItem.d.ts
3
+ type ListItemProps = ComponentProps<"li">;
4
+ declare function ListItem({ className, ...rest }: ListItemProps): import("react").JSX.Element;
5
+ //#endregion
6
+ export { ListItem, ListItemProps };
7
+ //# sourceMappingURL=ListItem.d.mts.map
@@ -0,0 +1,13 @@
1
+ import { cx } from "../../utils/cx.mjs";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/ListItem/ListItem.tsx
4
+ function ListItem({ className, ...rest }) {
5
+ return /* @__PURE__ */ jsx("li", {
6
+ ...rest,
7
+ className: cx("ps1ui-listitem", className)
8
+ });
9
+ }
10
+ //#endregion
11
+ export { ListItem };
12
+
13
+ //# sourceMappingURL=ListItem.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItem.mjs","names":[],"sources":["../../../src/components/ListItem/ListItem.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\n// Thin typed wrapper for `<li>` inside a `<List>`. The marker styling lives\n// on `.ps1ui-list > li` in List.css, so a bare `<li>` continues to render\n// identically — ListItem exists to give call sites a stable class hook\n// (`.ps1ui-listitem`, matching GridItem's `.ps1ui-griditem`) and a\n// documented API surface for what belongs inside a `<List>`.\nexport type ListItemProps = ComponentProps<\"li\">;\n\nexport function ListItem({ className, ...rest }: ListItemProps) {\n return <li {...rest} className={cx(\"ps1ui-listitem\", className)} />;\n}\n"],"mappings":";;;AAUA,SAAgB,SAAS,EAAE,WAAW,GAAG,QAAuB;CAC9D,OAAO,oBAAC,MAAD;EAAI,GAAI;EAAM,WAAW,GAAG,kBAAkB,SAAS;CAAI,CAAA;AACpE"}
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/components/PS1Root/PS1Root.d.ts
3
+ type PS1RootProps = ComponentProps<"div">;
4
+ declare function PS1Root({ className, ...rest }: PS1RootProps): import("react").JSX.Element;
5
+ //#endregion
6
+ export { PS1Root, PS1RootProps };
7
+ //# sourceMappingURL=PS1Root.d.mts.map
@@ -0,0 +1,13 @@
1
+ import { cx } from "../../utils/cx.mjs";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/PS1Root/PS1Root.tsx
4
+ function PS1Root({ className, ...rest }) {
5
+ return /* @__PURE__ */ jsx("div", {
6
+ ...rest,
7
+ className: cx("ps1ui-root", className)
8
+ });
9
+ }
10
+ //#endregion
11
+ export { PS1Root };
12
+
13
+ //# sourceMappingURL=PS1Root.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PS1Root.mjs","names":[],"sources":["../../../src/components/PS1Root/PS1Root.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport type PS1RootProps = ComponentProps<\"div\">;\n\n// PS1Root establishes the app-level responsive containment context.\n//\n// Wrap your app's tree in `<PS1Root>` once, at the top level. Responsive props\n// on descendant ps1ui components (`Grid columns={{ base: 1, md: 3 }}` and\n// friends) query their nearest ancestor with CSS `container-type: inline-size`\n// — this component provides that ancestor. Without a PS1Root (or another\n// containment ancestor like Container / Grid / Stack), responsive props\n// silently fall back to their `base` value only.\n//\n// A side effect of `container-type: inline-size` per CSS Containment L2:\n// `contain: layout` is implied, which makes PS1Root the containing block for\n// `position: fixed` descendants. For overlays that must anchor to the viewport\n// (Modal, Tooltip, Popover) render them via React Portal to `document.body`\n// so they escape PS1Root's containment. Raw `position: fixed` inside PS1Root\n// scrolls with the page instead of pinning to the viewport.\nexport function PS1Root({ className, ...rest }: PS1RootProps) {\n return <div {...rest} className={cx(\"ps1ui-root\", className)} />;\n}\n"],"mappings":";;;AAoBA,SAAgB,QAAQ,EAAE,WAAW,GAAG,QAAsB;CAC5D,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAM,WAAW,GAAG,cAAc,SAAS;CAAI,CAAA;AACjE"}
@@ -0,0 +1,33 @@
1
+ import { Responsive } from "../../utils/responsive.mjs";
2
+ import { SpaceScale } from "../../utils/spacing.mjs";
3
+ import { ComponentProps } from "react";
4
+ //#region src/components/Stack/Stack.d.ts
5
+ type StackDirection = "row" | "column";
6
+ type StackGap = SpaceScale;
7
+ type StackAlign = "start" | "center" | "end" | "stretch" | "baseline";
8
+ type StackJustify = "start" | "center" | "end" | "between" | "around" | "evenly";
9
+ type StackProps = ComponentProps<"div"> & {
10
+ /**
11
+ * Main-axis direction.
12
+ * @default "column"
13
+ */
14
+ direction?: Responsive<StackDirection>;
15
+ /**
16
+ * Gap between items on the space scale.
17
+ * @default "md"
18
+ */
19
+ gap?: Responsive<StackGap>;
20
+ /** Cross-axis alignment (align-items). */
21
+ align?: Responsive<StackAlign>;
22
+ /** Main-axis distribution (justify-content). */
23
+ justify?: Responsive<StackJustify>;
24
+ /**
25
+ * Wrap items onto multiple lines instead of overflowing.
26
+ * @default false
27
+ */
28
+ wrap?: Responsive<boolean>;
29
+ };
30
+ declare function Stack({ direction, gap, align, justify, wrap, className, style, ...rest }: StackProps): import("react").JSX.Element;
31
+ //#endregion
32
+ export { Stack, StackAlign, StackDirection, StackGap, StackJustify, StackProps };
33
+ //# sourceMappingURL=Stack.d.mts.map