@the-portland-company/shell 0.89.0 → 0.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +6 -48
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.d.cts +1 -1
- package/dist/app-chrome.d.ts +1 -1
- package/dist/app-chrome.js +3 -3
- package/dist/chrome.css +0 -20
- package/dist/{chunk-SJDFAK5R.js → chunk-WDVQBUWF.js} +4 -10
- package/dist/chunk-WDVQBUWF.js.map +1 -0
- package/dist/{chunk-J23MTK56.js → chunk-ZS7MQXDQ.js} +41 -402
- package/dist/chunk-ZS7MQXDQ.js.map +1 -0
- package/dist/{index-CZylXAP4.d.cts → index-Cg5aEImm.d.cts} +8 -201
- package/dist/{index-DwkSyAip.d.ts → index-DG32i0jC.d.ts} +8 -201
- package/dist/index.cjs +58 -437
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -19
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +39 -412
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +1 -1
- package/dist/native.d.ts +1 -1
- package/dist/native.js +2 -2
- package/package.json +2 -13
- package/dist/chunk-J23MTK56.js.map +0 -1
- package/dist/chunk-SJDFAK5R.js.map +0 -1
- package/eslint/index.cjs +0 -172
- package/eslint/index.d.ts +0 -6
- package/eslint/index.mjs +0 -5
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('@chakra-ui/react');
|
|
4
|
-
var clsx = require('clsx');
|
|
5
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var clsx5 = require('clsx');
|
|
6
6
|
var reactRouterDom = require('react-router-dom');
|
|
7
7
|
var react$1 = require('react');
|
|
8
8
|
require('react-dom');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var clsx5__default = /*#__PURE__*/_interopDefault(clsx5);
|
|
13
13
|
|
|
14
14
|
// src/theme/index.ts
|
|
15
15
|
|
|
@@ -768,12 +768,6 @@ var components = {
|
|
|
768
768
|
};
|
|
769
769
|
|
|
770
770
|
// src/theme/index.ts
|
|
771
|
-
var SHELL_FIELD_MARKER = "data-shell-field";
|
|
772
|
-
var nativeFieldSelector = (state) => {
|
|
773
|
-
const own = `:not([${SHELL_FIELD_MARKER}])`;
|
|
774
|
-
const input = `input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])${own}${state}`;
|
|
775
|
-
return `${input}, textarea${own}${state}, select${own}${state}`;
|
|
776
|
-
};
|
|
777
771
|
var config = {
|
|
778
772
|
initialColorMode: "light",
|
|
779
773
|
useSystemColorMode: false
|
|
@@ -797,13 +791,13 @@ var styles = {
|
|
|
797
791
|
"--mode-input-focus-shadow-color": "var(--app-color-brand-500)"
|
|
798
792
|
},
|
|
799
793
|
// Ensure non-Chakra/native text-like inputs follow mode border colors as well.
|
|
800
|
-
[
|
|
794
|
+
'input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]), textarea, select': {
|
|
801
795
|
borderColor: "var(--mode-input-border-color)"
|
|
802
796
|
},
|
|
803
|
-
[
|
|
797
|
+
'input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):hover, textarea:hover, select:hover': {
|
|
804
798
|
borderColor: "var(--mode-input-hover-border-color)"
|
|
805
799
|
},
|
|
806
|
-
[
|
|
800
|
+
'input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):focus, textarea:focus, select:focus': {
|
|
807
801
|
borderColor: "var(--mode-primary-color)",
|
|
808
802
|
boxShadow: "0 0 0 1px var(--mode-input-focus-shadow-color)"
|
|
809
803
|
}
|
|
@@ -839,132 +833,109 @@ var politogyTheme = react.extendTheme({
|
|
|
839
833
|
full: "9999px"
|
|
840
834
|
}
|
|
841
835
|
});
|
|
842
|
-
var PADDING = {
|
|
843
|
-
none: "p-0",
|
|
844
|
-
sm: "p-4",
|
|
845
|
-
md: "p-6",
|
|
846
|
-
lg: "p-8"
|
|
847
|
-
};
|
|
848
836
|
function Card({
|
|
849
837
|
title,
|
|
850
|
-
subtitle,
|
|
851
|
-
aside,
|
|
852
|
-
actions,
|
|
853
|
-
footer,
|
|
854
838
|
children,
|
|
855
|
-
padding = "md",
|
|
856
|
-
bodyClassName,
|
|
857
839
|
minH,
|
|
858
840
|
className,
|
|
859
841
|
style,
|
|
860
842
|
...props
|
|
861
843
|
}) {
|
|
862
|
-
const structured = Boolean(subtitle || aside || actions || footer || bodyClassName);
|
|
863
|
-
const surface = "rounded-lg border border-[color:var(--app-card-border,var(--color-border))] bg-[color:var(--app-card-bg,var(--color-panel))] text-[color:var(--app-card-fg,var(--color-text))] shadow-sm";
|
|
864
|
-
if (!structured) {
|
|
865
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
866
|
-
"div",
|
|
867
|
-
{
|
|
868
|
-
"data-shell-card": "",
|
|
869
|
-
className: clsx__default.default(surface, PADDING[padding], className),
|
|
870
|
-
style: { minHeight: minH, ...style },
|
|
871
|
-
...props,
|
|
872
|
-
children: [
|
|
873
|
-
title ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-4 text-lg font-semibold", children: title }) : null,
|
|
874
|
-
children
|
|
875
|
-
]
|
|
876
|
-
}
|
|
877
|
-
);
|
|
878
|
-
}
|
|
879
|
-
const hasHeader = Boolean(title || subtitle || aside || actions);
|
|
880
|
-
const divider = "border-[color:var(--app-card-border,var(--color-border))]";
|
|
881
844
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
882
845
|
"div",
|
|
883
846
|
{
|
|
884
|
-
|
|
885
|
-
"data-shell-card-structured": "",
|
|
886
|
-
className: clsx__default.default(surface, "overflow-hidden", className),
|
|
847
|
+
className: `rounded-lg border border-slate-200 bg-white p-6 shadow-sm ${className || ""}`,
|
|
887
848
|
style: { minHeight: minH, ...style },
|
|
888
849
|
...props,
|
|
889
850
|
children: [
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
title ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold", children: title }) : null,
|
|
893
|
-
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-sm text-[color:var(--app-card-fg-muted,var(--color-text-muted))]", children: subtitle }) : null
|
|
894
|
-
] }),
|
|
895
|
-
aside || actions ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
896
|
-
aside,
|
|
897
|
-
actions
|
|
898
|
-
] }) : null
|
|
899
|
-
] }) : null,
|
|
900
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: bodyClassName ?? PADDING[padding], children }),
|
|
901
|
-
footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx__default.default("border-t px-5 py-3", divider), children: footer }) : null
|
|
851
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-4 text-lg font-semibold", children: title }),
|
|
852
|
+
children
|
|
902
853
|
]
|
|
903
854
|
}
|
|
904
855
|
);
|
|
905
856
|
}
|
|
906
857
|
function FormColumn({ children, className }) {
|
|
907
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-shell-form-column": "", className:
|
|
858
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-shell-form-column": "", className: clsx5__default.default("w-full max-w-[960px]", className), children });
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
// src/lib/deprecation.ts
|
|
862
|
+
var warned = /* @__PURE__ */ new Set();
|
|
863
|
+
function isDev() {
|
|
864
|
+
try {
|
|
865
|
+
return typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
|
|
866
|
+
} catch {
|
|
867
|
+
return false;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
function warnDeprecated(key, message) {
|
|
871
|
+
if (!isDev() || warned.has(key)) return;
|
|
872
|
+
warned.add(key);
|
|
873
|
+
console.warn(`[@the-portland-company/shell] ${message}`);
|
|
908
874
|
}
|
|
909
875
|
var MODE_EYEBROW_LABEL = {
|
|
910
876
|
relationship: "Relationship mode",
|
|
911
877
|
campaign: "Campaign mode",
|
|
912
878
|
petition: "Petition mode"
|
|
913
879
|
};
|
|
914
|
-
var
|
|
915
|
-
if (maxW === "full") return "max-w-none";
|
|
916
|
-
if (maxW === "container.lg") return "max-w-6xl";
|
|
917
|
-
if (maxW === "container.md") return "max-w-5xl";
|
|
918
|
-
return "max-w-7xl";
|
|
919
|
-
};
|
|
880
|
+
var EMAIL_PATTERN = /[^\s@]+@[^\s@]+\.[^\s@]+/;
|
|
920
881
|
function PageHeaderView({
|
|
921
|
-
renderCrumbLink,
|
|
922
882
|
title,
|
|
923
883
|
mode,
|
|
924
884
|
eyebrow,
|
|
925
885
|
showEyebrow = true,
|
|
926
886
|
subtitle,
|
|
927
|
-
breadcrumbs
|
|
887
|
+
breadcrumbs,
|
|
928
888
|
actions = null,
|
|
929
889
|
tabBar = null,
|
|
930
|
-
maxW
|
|
890
|
+
maxW,
|
|
931
891
|
hideSidebar = false
|
|
932
892
|
}) {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
893
|
+
if (breadcrumbs !== void 0) {
|
|
894
|
+
warnDeprecated(
|
|
895
|
+
"PageHeader.breadcrumbs",
|
|
896
|
+
'<PageHeader breadcrumbs> is deprecated and renders nothing: the breadcrumb trail is retired (Reference/UI-Platform \u2192 "Page header"). Remove the prop.'
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
if (maxW !== void 0) {
|
|
900
|
+
warnDeprecated(
|
|
901
|
+
"PageHeader.maxW",
|
|
902
|
+
"<PageHeader maxW> is deprecated and ignored: the header spans its container. Use <FormColumn> (960px) or the fluid frame for page width."
|
|
903
|
+
);
|
|
904
|
+
}
|
|
905
|
+
if (typeof title === "string" && EMAIL_PATTERN.test(title) || typeof subtitle === "string" && EMAIL_PATTERN.test(subtitle)) {
|
|
906
|
+
warnDeprecated(
|
|
907
|
+
"PageHeader.email",
|
|
908
|
+
`<PageHeader> title/subtitle contains an email address. The user's email never appears in the page header (Reference/UI-Platform \u2192 "Page header"); identity lives in the left bar footer.`
|
|
909
|
+
);
|
|
940
910
|
}
|
|
941
911
|
const eyebrowText = showEyebrow ? eyebrow ?? (mode ? MODE_EYEBROW_LABEL[mode] : void 0) : void 0;
|
|
942
|
-
if (!title && !eyebrowText &&
|
|
912
|
+
if (!title && !eyebrowText && !actions && !tabBar) {
|
|
943
913
|
return null;
|
|
944
914
|
}
|
|
945
915
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
946
916
|
"div",
|
|
947
917
|
{
|
|
948
|
-
|
|
949
|
-
className:
|
|
918
|
+
"data-shell-page-header": "",
|
|
919
|
+
className: clsx5__default.default("pt-[22px] text-[color:var(--color-text,#2F3136)]", tabBar ? "pb-0" : "pb-4", {
|
|
950
920
|
"md:ml-60": !hideSidebar
|
|
951
921
|
}),
|
|
952
922
|
children: [
|
|
953
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
923
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full px-4 md:px-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full flex-nowrap items-start justify-between gap-4", children: [
|
|
954
924
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
955
925
|
eyebrowText ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
956
926
|
"div",
|
|
957
927
|
{
|
|
958
928
|
className: "truncate text-[11px] font-bold uppercase leading-[1.2] tracking-[0.09em]",
|
|
959
|
-
style: { color: "var(--mode-accent, var(--color-accent, #E63946))" },
|
|
929
|
+
style: { color: "var(--color-accent-fg, var(--mode-accent, var(--color-accent, #E63946)))" },
|
|
960
930
|
children: eyebrowText
|
|
961
931
|
}
|
|
962
932
|
) : null,
|
|
963
933
|
title ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
964
|
-
"
|
|
934
|
+
"h1",
|
|
965
935
|
{
|
|
966
|
-
className: "truncate font-bold
|
|
936
|
+
className: "m-0 truncate font-bold",
|
|
967
937
|
style: {
|
|
938
|
+
color: "var(--color-text, #2F3136)",
|
|
968
939
|
fontFamily: "var(--font-family, ui-sans-serif, system-ui, sans-serif)",
|
|
969
940
|
fontSize: "var(--type-h2-size, 1.875rem)",
|
|
970
941
|
lineHeight: "var(--type-h2-line-height, 1.25)"
|
|
@@ -972,25 +943,7 @@ function PageHeaderView({
|
|
|
972
943
|
children: title
|
|
973
944
|
}
|
|
974
945
|
) }) : null,
|
|
975
|
-
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#
|
|
976
|
-
breadcrumbsWithoutCurrent.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
977
|
-
"nav",
|
|
978
|
-
{
|
|
979
|
-
"aria-label": "Breadcrumb",
|
|
980
|
-
className: clsx__default.default("min-w-0 text-slate-100", title ? "mt-1" : ""),
|
|
981
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex flex-nowrap items-center gap-2 overflow-hidden text-sm text-gray-600", children: breadcrumbsWithoutCurrent.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
982
|
-
"li",
|
|
983
|
-
{
|
|
984
|
-
className: "flex min-w-0 flex-shrink-0 items-center gap-2",
|
|
985
|
-
children: [
|
|
986
|
-
index > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: ">" }) : null,
|
|
987
|
-
item.href ? renderCrumbLink(item.href, item.label, "truncate text-slate-100 hover:underline") : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-slate-100", children: item.label })
|
|
988
|
-
]
|
|
989
|
-
},
|
|
990
|
-
`${item.label}-${index}`
|
|
991
|
-
)) })
|
|
992
|
-
}
|
|
993
|
-
) : null
|
|
946
|
+
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#58657A)]", children: subtitle }) : null
|
|
994
947
|
] }),
|
|
995
948
|
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: actions }) : null
|
|
996
949
|
] }) }),
|
|
@@ -1000,333 +953,7 @@ function PageHeaderView({
|
|
|
1000
953
|
);
|
|
1001
954
|
}
|
|
1002
955
|
function PageHeader(props) {
|
|
1003
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1004
|
-
PageHeaderView,
|
|
1005
|
-
{
|
|
1006
|
-
...props,
|
|
1007
|
-
renderCrumbLink: (href, label, className) => /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Link, { to: href, className, children: label })
|
|
1008
|
-
}
|
|
1009
|
-
);
|
|
1010
|
-
}
|
|
1011
|
-
var VARIANT_CLASS = {
|
|
1012
|
-
primary: "border border-transparent bg-[color:var(--app-btn-primary-bg,var(--color-accent))] text-[color:var(--app-btn-primary-fg,var(--color-white))] hover:bg-[color:var(--app-btn-primary-bg-hover,var(--color-accent-hover))]",
|
|
1013
|
-
secondary: "border border-[color:var(--app-btn-secondary-border,var(--color-border))] bg-[color:var(--app-btn-secondary-bg,var(--color-white))] text-[color:var(--app-btn-secondary-fg,var(--color-text))] hover:bg-[color:var(--app-btn-secondary-bg-hover,var(--color-bg))]",
|
|
1014
|
-
ghost: "border border-transparent bg-transparent text-[color:var(--app-btn-secondary-fg,var(--color-text))] hover:bg-[color:var(--app-btn-secondary-bg-hover,var(--color-bg))]",
|
|
1015
|
-
danger: "border border-transparent bg-[color:var(--chrome-danger,var(--color-race-red))] text-[color:var(--color-white)] hover:bg-[color:var(--color-race-red-600)]"
|
|
1016
|
-
};
|
|
1017
|
-
var SIZE_CLASS = {
|
|
1018
|
-
md: "h-[44px]",
|
|
1019
|
-
sm: "h-[36px]"
|
|
1020
|
-
};
|
|
1021
|
-
var Button = react$1.forwardRef(function Button2({
|
|
1022
|
-
variant = "primary",
|
|
1023
|
-
size = "md",
|
|
1024
|
-
loading = false,
|
|
1025
|
-
disabled = false,
|
|
1026
|
-
href,
|
|
1027
|
-
as,
|
|
1028
|
-
type,
|
|
1029
|
-
className,
|
|
1030
|
-
children,
|
|
1031
|
-
onClick,
|
|
1032
|
-
...props
|
|
1033
|
-
}, ref) {
|
|
1034
|
-
const Component = as ?? (href ? "a" : "button");
|
|
1035
|
-
const isNativeButton = Component === "button";
|
|
1036
|
-
const inactive = disabled || loading;
|
|
1037
|
-
const linkProps = isNativeButton ? { type: type ?? "button", disabled: inactive } : {
|
|
1038
|
-
href,
|
|
1039
|
-
"aria-disabled": inactive || void 0,
|
|
1040
|
-
tabIndex: inactive ? -1 : void 0
|
|
1041
|
-
};
|
|
1042
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1043
|
-
Component,
|
|
1044
|
-
{
|
|
1045
|
-
ref,
|
|
1046
|
-
"data-shell-button": "",
|
|
1047
|
-
"data-variant": variant,
|
|
1048
|
-
"aria-busy": loading || void 0,
|
|
1049
|
-
className: clsx__default.default(
|
|
1050
|
-
"inline-flex items-center justify-center gap-2 rounded-[5px] px-3 text-sm font-semibold no-underline transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--app-field-focus,var(--color-accent))] focus-visible:ring-offset-2",
|
|
1051
|
-
SIZE_CLASS[size],
|
|
1052
|
-
VARIANT_CLASS[variant],
|
|
1053
|
-
inactive && "cursor-not-allowed opacity-50",
|
|
1054
|
-
className
|
|
1055
|
-
),
|
|
1056
|
-
onClick: inactive ? (event) => {
|
|
1057
|
-
event.preventDefault();
|
|
1058
|
-
event.stopPropagation();
|
|
1059
|
-
} : onClick,
|
|
1060
|
-
...linkProps,
|
|
1061
|
-
...props,
|
|
1062
|
-
children: [
|
|
1063
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1064
|
-
"span",
|
|
1065
|
-
{
|
|
1066
|
-
"aria-hidden": "true",
|
|
1067
|
-
"data-shell-button-spinner": "",
|
|
1068
|
-
className: "inline-block h-4 w-4 animate-spin motion-reduce:animate-none rounded-full border-2 border-current border-t-transparent"
|
|
1069
|
-
}
|
|
1070
|
-
) : null,
|
|
1071
|
-
children
|
|
1072
|
-
]
|
|
1073
|
-
}
|
|
1074
|
-
);
|
|
1075
|
-
});
|
|
1076
|
-
var Button_default = Button;
|
|
1077
|
-
function FormField({
|
|
1078
|
-
id,
|
|
1079
|
-
label,
|
|
1080
|
-
helperText,
|
|
1081
|
-
error,
|
|
1082
|
-
required,
|
|
1083
|
-
className,
|
|
1084
|
-
children
|
|
1085
|
-
}) {
|
|
1086
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx__default.default("flex w-full flex-col gap-1", className), children: [
|
|
1087
|
-
label ? /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: id, className: "text-sm font-semibold text-[color:var(--color-text)]", children: [
|
|
1088
|
-
label,
|
|
1089
|
-
required ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: " *" }) : null
|
|
1090
|
-
] }) : null,
|
|
1091
|
-
children,
|
|
1092
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1093
|
-
"p",
|
|
1094
|
-
{
|
|
1095
|
-
id: `${id}-error`,
|
|
1096
|
-
role: "alert",
|
|
1097
|
-
className: "text-xs text-[color:var(--chrome-danger,var(--color-race-red))]",
|
|
1098
|
-
children: error
|
|
1099
|
-
}
|
|
1100
|
-
) : helperText ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${id}-helper`, className: "text-xs text-[color:var(--color-text-muted)]", children: helperText }) : null
|
|
1101
|
-
] });
|
|
1102
|
-
}
|
|
1103
|
-
function describedBy(id, helperText, error, extra) {
|
|
1104
|
-
const generated = error ? `${id}-error` : helperText ? `${id}-helper` : void 0;
|
|
1105
|
-
const merged = [generated, extra].filter(Boolean).join(" ");
|
|
1106
|
-
return merged || void 0;
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
// src/components/fieldStyles.ts
|
|
1110
|
-
var FIELD_BASE = "w-full rounded-[5px] border bg-[color:var(--app-field-bg,var(--color-white))] px-3 text-sm text-[color:var(--color-text)] placeholder:text-[color:var(--color-text-muted)] focus:outline-none focus:ring-2 disabled:cursor-not-allowed disabled:opacity-50";
|
|
1111
|
-
var FIELD_VALID = "border-[color:var(--app-field-border,var(--color-border))] hover:border-[color:var(--app-field-border-hover,var(--color-g4))] focus:border-[color:var(--app-field-focus,var(--color-accent))] focus:ring-[color:var(--app-field-focus,var(--color-accent))]";
|
|
1112
|
-
var FIELD_INVALID = "border-[color:var(--chrome-danger,var(--color-race-red))] focus:ring-[color:var(--chrome-danger,var(--color-race-red))]";
|
|
1113
|
-
var Input = react$1.forwardRef(function Input2({ label, helperText, error, invalid, className, wrapperClassName, id, required, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
1114
|
-
const autoId = react$1.useId();
|
|
1115
|
-
const fieldId = id ?? autoId;
|
|
1116
|
-
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
1117
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1118
|
-
FormField,
|
|
1119
|
-
{
|
|
1120
|
-
id: fieldId,
|
|
1121
|
-
label,
|
|
1122
|
-
helperText,
|
|
1123
|
-
error,
|
|
1124
|
-
required,
|
|
1125
|
-
className: wrapperClassName,
|
|
1126
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1127
|
-
"input",
|
|
1128
|
-
{
|
|
1129
|
-
ref,
|
|
1130
|
-
id: fieldId,
|
|
1131
|
-
required,
|
|
1132
|
-
"data-shell-field": "",
|
|
1133
|
-
"aria-invalid": isInvalid || void 0,
|
|
1134
|
-
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
1135
|
-
className: clsx__default.default(FIELD_BASE, "h-[44px]", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
1136
|
-
...props
|
|
1137
|
-
}
|
|
1138
|
-
)
|
|
1139
|
-
}
|
|
1140
|
-
);
|
|
1141
|
-
});
|
|
1142
|
-
var Input_default = Input;
|
|
1143
|
-
var Select = react$1.forwardRef(function Select2({ label, helperText, error, invalid, className, wrapperClassName, id, required, children, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
1144
|
-
const autoId = react$1.useId();
|
|
1145
|
-
const fieldId = id ?? autoId;
|
|
1146
|
-
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
1147
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1148
|
-
FormField,
|
|
1149
|
-
{
|
|
1150
|
-
id: fieldId,
|
|
1151
|
-
label,
|
|
1152
|
-
helperText,
|
|
1153
|
-
error,
|
|
1154
|
-
required,
|
|
1155
|
-
className: wrapperClassName,
|
|
1156
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1157
|
-
"select",
|
|
1158
|
-
{
|
|
1159
|
-
ref,
|
|
1160
|
-
id: fieldId,
|
|
1161
|
-
required,
|
|
1162
|
-
"data-shell-field": "",
|
|
1163
|
-
"aria-invalid": isInvalid || void 0,
|
|
1164
|
-
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
1165
|
-
className: clsx__default.default(FIELD_BASE, "h-[44px]", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
1166
|
-
...props,
|
|
1167
|
-
children
|
|
1168
|
-
}
|
|
1169
|
-
)
|
|
1170
|
-
}
|
|
1171
|
-
);
|
|
1172
|
-
});
|
|
1173
|
-
var Select_default = Select;
|
|
1174
|
-
var Textarea = react$1.forwardRef(function Textarea2({ label, helperText, error, invalid, className, wrapperClassName, id, required, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
1175
|
-
const autoId = react$1.useId();
|
|
1176
|
-
const fieldId = id ?? autoId;
|
|
1177
|
-
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
1178
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1179
|
-
FormField,
|
|
1180
|
-
{
|
|
1181
|
-
id: fieldId,
|
|
1182
|
-
label,
|
|
1183
|
-
helperText,
|
|
1184
|
-
error,
|
|
1185
|
-
required,
|
|
1186
|
-
className: wrapperClassName,
|
|
1187
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1188
|
-
"textarea",
|
|
1189
|
-
{
|
|
1190
|
-
ref,
|
|
1191
|
-
id: fieldId,
|
|
1192
|
-
required,
|
|
1193
|
-
"data-shell-field": "",
|
|
1194
|
-
"aria-invalid": isInvalid || void 0,
|
|
1195
|
-
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
1196
|
-
className: clsx__default.default(FIELD_BASE, "min-h-[88px] py-3", isInvalid ? FIELD_INVALID : FIELD_VALID, className),
|
|
1197
|
-
...props
|
|
1198
|
-
}
|
|
1199
|
-
)
|
|
1200
|
-
}
|
|
1201
|
-
);
|
|
1202
|
-
});
|
|
1203
|
-
var Textarea_default = Textarea;
|
|
1204
|
-
var Checkbox = react$1.forwardRef(function Checkbox2({
|
|
1205
|
-
label,
|
|
1206
|
-
description,
|
|
1207
|
-
indeterminate,
|
|
1208
|
-
invalid,
|
|
1209
|
-
className,
|
|
1210
|
-
wrapperClassName,
|
|
1211
|
-
id,
|
|
1212
|
-
disabled,
|
|
1213
|
-
"aria-describedby": ariaDescribedBy,
|
|
1214
|
-
...props
|
|
1215
|
-
}, ref) {
|
|
1216
|
-
const autoId = react$1.useId();
|
|
1217
|
-
const fieldId = id ?? autoId;
|
|
1218
|
-
const descId = description ? `${fieldId}-description` : void 0;
|
|
1219
|
-
const inner = react$1.useRef(null);
|
|
1220
|
-
const setRef = react$1.useCallback(
|
|
1221
|
-
(node) => {
|
|
1222
|
-
inner.current = node;
|
|
1223
|
-
if (typeof ref === "function") ref(node);
|
|
1224
|
-
else if (ref) ref.current = node;
|
|
1225
|
-
},
|
|
1226
|
-
[ref]
|
|
1227
|
-
);
|
|
1228
|
-
react$1.useEffect(() => {
|
|
1229
|
-
if (inner.current) inner.current.indeterminate = Boolean(indeterminate);
|
|
1230
|
-
}, [indeterminate]);
|
|
1231
|
-
const describedBy2 = [descId, ariaDescribedBy].filter(Boolean).join(" ") || void 0;
|
|
1232
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1233
|
-
"label",
|
|
1234
|
-
{
|
|
1235
|
-
htmlFor: fieldId,
|
|
1236
|
-
"data-shell-checkbox": "",
|
|
1237
|
-
className: clsx__default.default(
|
|
1238
|
-
"flex min-h-[44px] items-start gap-3 py-[10px] text-sm text-[color:var(--app-card-fg,var(--color-text))]",
|
|
1239
|
-
disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
1240
|
-
wrapperClassName
|
|
1241
|
-
),
|
|
1242
|
-
children: [
|
|
1243
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1244
|
-
"input",
|
|
1245
|
-
{
|
|
1246
|
-
...props,
|
|
1247
|
-
ref: setRef,
|
|
1248
|
-
id: fieldId,
|
|
1249
|
-
type: "checkbox",
|
|
1250
|
-
disabled,
|
|
1251
|
-
"data-shell-field": "",
|
|
1252
|
-
"aria-invalid": invalid || void 0,
|
|
1253
|
-
"aria-describedby": describedBy2,
|
|
1254
|
-
className: clsx__default.default(
|
|
1255
|
-
"mt-[2px] h-5 w-5 shrink-0 rounded-[5px] border focus:outline-none focus-visible:ring-2",
|
|
1256
|
-
"accent-[color:var(--color-accent-bg-safe,var(--color-accent))]",
|
|
1257
|
-
"focus-visible:ring-[color:var(--app-field-focus,var(--color-accent))]",
|
|
1258
|
-
invalid ? "border-[color:var(--chrome-danger,var(--color-race-red))] outline outline-2 outline-[color:var(--chrome-danger,var(--color-race-red))]" : "border-[color:var(--app-field-border,var(--color-border))]",
|
|
1259
|
-
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
1260
|
-
className
|
|
1261
|
-
)
|
|
1262
|
-
}
|
|
1263
|
-
),
|
|
1264
|
-
label || description ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0", children: [
|
|
1265
|
-
label ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block font-medium", children: label }) : null,
|
|
1266
|
-
description ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1267
|
-
"span",
|
|
1268
|
-
{
|
|
1269
|
-
id: descId,
|
|
1270
|
-
className: "block text-xs text-[color:var(--app-card-fg-muted,var(--color-text-muted))]",
|
|
1271
|
-
children: description
|
|
1272
|
-
}
|
|
1273
|
-
) : null
|
|
1274
|
-
] }) : null
|
|
1275
|
-
]
|
|
1276
|
-
}
|
|
1277
|
-
);
|
|
1278
|
-
});
|
|
1279
|
-
var Checkbox_default = Checkbox;
|
|
1280
|
-
var FileInput = react$1.forwardRef(function FileInput2({ label, helperText, error, invalid, className, wrapperClassName, id, required, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
1281
|
-
const autoId = react$1.useId();
|
|
1282
|
-
const fieldId = id ?? autoId;
|
|
1283
|
-
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
1284
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1285
|
-
FormField,
|
|
1286
|
-
{
|
|
1287
|
-
id: fieldId,
|
|
1288
|
-
label,
|
|
1289
|
-
helperText,
|
|
1290
|
-
error,
|
|
1291
|
-
required,
|
|
1292
|
-
className: wrapperClassName,
|
|
1293
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1294
|
-
"input",
|
|
1295
|
-
{
|
|
1296
|
-
...props,
|
|
1297
|
-
ref,
|
|
1298
|
-
id: fieldId,
|
|
1299
|
-
type: "file",
|
|
1300
|
-
required,
|
|
1301
|
-
"data-shell-field": "",
|
|
1302
|
-
"aria-invalid": isInvalid || void 0,
|
|
1303
|
-
"aria-describedby": describedBy(fieldId, helperText, error, ariaDescribedBy),
|
|
1304
|
-
className: clsx__default.default(
|
|
1305
|
-
FIELD_BASE,
|
|
1306
|
-
"h-[44px] cursor-pointer py-[5px] file:mr-3 file:h-[32px] file:cursor-pointer file:rounded-[5px] file:border file:border-[color:var(--app-btn-secondary-border,var(--color-border))] file:bg-[color:var(--app-btn-secondary-bg,var(--color-white))] file:px-3 file:text-sm file:font-medium file:text-[color:var(--app-btn-secondary-fg,var(--color-text))]",
|
|
1307
|
-
isInvalid ? FIELD_INVALID : FIELD_VALID,
|
|
1308
|
-
className
|
|
1309
|
-
)
|
|
1310
|
-
}
|
|
1311
|
-
)
|
|
1312
|
-
}
|
|
1313
|
-
);
|
|
1314
|
-
});
|
|
1315
|
-
var FileInput_default = FileInput;
|
|
1316
|
-
|
|
1317
|
-
// src/lib/deprecation.ts
|
|
1318
|
-
var warned = /* @__PURE__ */ new Set();
|
|
1319
|
-
function isDev() {
|
|
1320
|
-
try {
|
|
1321
|
-
return typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
|
|
1322
|
-
} catch {
|
|
1323
|
-
return false;
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
function warnDeprecated(key, message) {
|
|
1327
|
-
if (!isDev() || warned.has(key)) return;
|
|
1328
|
-
warned.add(key);
|
|
1329
|
-
console.warn(`[@the-portland-company/shell] ${message}`);
|
|
956
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PageHeaderView, { ...props });
|
|
1330
957
|
}
|
|
1331
958
|
function PageContainer({
|
|
1332
959
|
children,
|
|
@@ -1356,7 +983,7 @@ function PageContainer({
|
|
|
1356
983
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1357
984
|
"div",
|
|
1358
985
|
{
|
|
1359
|
-
className:
|
|
986
|
+
className: clsx5__default.default(
|
|
1360
987
|
"mx-auto w-full",
|
|
1361
988
|
maxWClass,
|
|
1362
989
|
pxClass,
|
|
@@ -1389,7 +1016,7 @@ function BreadcrumbBarView({
|
|
|
1389
1016
|
{
|
|
1390
1017
|
className: "ml-0 border-b border-gray-200 px-4 py-3 md:ml-60",
|
|
1391
1018
|
style: { backgroundColor: "var(--app-tab-header-bg, #888888)" },
|
|
1392
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1019
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx5__default.default("mx-auto w-full px-0", maxWClass), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
1393
1020
|
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex items-center gap-2 text-sm text-slate-100", children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2", children: [
|
|
1394
1021
|
index > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: ">" }) : null,
|
|
1395
1022
|
item.href ? renderCrumbLink(item.href, item.label, "text-slate-100 hover:underline") : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-100", children: item.label })
|
|
@@ -1556,7 +1183,7 @@ function HeaderTabBar({
|
|
|
1556
1183
|
{
|
|
1557
1184
|
role: "tablist",
|
|
1558
1185
|
"aria-label": ariaLabel,
|
|
1559
|
-
className:
|
|
1186
|
+
className: clsx5__default.default(
|
|
1560
1187
|
// Header-wide tab strip: background + bottom border only (no outer box).
|
|
1561
1188
|
// Left-aligned and fluid: the container spans the full content width,
|
|
1562
1189
|
// the tabs keep their natural width packed from the left (Global-Rules
|
|
@@ -1580,7 +1207,7 @@ function HeaderTabBar({
|
|
|
1580
1207
|
"aria-label": item.label,
|
|
1581
1208
|
disabled: isDisabled,
|
|
1582
1209
|
onClick: () => onChange(item.id),
|
|
1583
|
-
className:
|
|
1210
|
+
className: clsx5__default.default(
|
|
1584
1211
|
// `group/tbtip relative` powers the shared <TopBarTooltip>.
|
|
1585
1212
|
// Natural width (no flex-1 stretch); 40px square hit area for the
|
|
1586
1213
|
// icon-only tab so the strip stays tappable.
|
|
@@ -2142,17 +1769,12 @@ function SpeculationRulesScript({ items }) {
|
|
|
2142
1769
|
exports.BrandIcon = BrandIcon;
|
|
2143
1770
|
exports.BrandLogo = BrandLogo;
|
|
2144
1771
|
exports.BreadcrumbBar = BreadcrumbBar;
|
|
2145
|
-
exports.Button = Button_default;
|
|
2146
1772
|
exports.Card = Card;
|
|
2147
|
-
exports.Checkbox = Checkbox_default;
|
|
2148
|
-
exports.FileInput = FileInput_default;
|
|
2149
1773
|
exports.FormColumn = FormColumn;
|
|
2150
1774
|
exports.GlobalUiIdProvider = GlobalUiIdProvider;
|
|
2151
1775
|
exports.HeaderTabBar = HeaderTabBar;
|
|
2152
|
-
exports.Input = Input_default;
|
|
2153
1776
|
exports.PageContainer = PageContainer;
|
|
2154
1777
|
exports.PageHeader = PageHeader;
|
|
2155
|
-
exports.Select = Select_default;
|
|
2156
1778
|
exports.ShellChromeContext = ShellChromeContext;
|
|
2157
1779
|
exports.ShellFooterContext = ShellFooterContext;
|
|
2158
1780
|
exports.ShellLinkedAccountsContext = ShellLinkedAccountsContext;
|
|
@@ -2164,7 +1786,6 @@ exports.ShellProvider = ShellProvider;
|
|
|
2164
1786
|
exports.ShellRoleContext = ShellRoleContext;
|
|
2165
1787
|
exports.ShellSupportProviderContext = ShellSupportProviderContext;
|
|
2166
1788
|
exports.SpeculationRulesScript = SpeculationRulesScript;
|
|
2167
|
-
exports.Textarea = Textarea_default;
|
|
2168
1789
|
exports.buildNavSpeculationRules = buildNavSpeculationRules;
|
|
2169
1790
|
exports.buildSpeculationRules = buildSpeculationRules;
|
|
2170
1791
|
exports.collectSiblingAppUrls = collectSiblingAppUrls;
|