@syscore/ui-library 2.0.0-beta-publish-workflow-beta.16 → 2.0.0-beta-publish-workflow-beta.17
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/client/components/icons/IconUtility.tsx +353 -0
- package/client/components/icons/X.tsx +4 -3
- package/client/components/ui/alert-v02.tsx +2 -6
- package/client/components/ui/button-v01.tsx +2 -12
- package/client/components/ui/button.tsx +39 -3
- package/client/components/ui/dropdown.tsx +2 -12
- package/client/components/ui/navigation.tsx +25 -4
- package/client/components/ui/radio-v01.tsx +84 -0
- package/client/components/ui/search-field-v01.tsx +10 -28
- package/client/components/ui/section-heading.tsx +1 -1
- package/client/components/ui/sign-in-field-v01.tsx +150 -0
- package/client/global.css +354 -73
- package/client/lib/system-icons.ts +1583 -0
- package/client/lib/utility-icons.ts +121 -0
- package/client/ui/Button.stories.tsx +63 -0
- package/client/ui/Colors.stories.tsx +34 -31
- package/client/ui/Icons.stories.tsx +179 -0
- package/client/ui/RadioGroup/RadioGroup.stories.tsx +1 -1
- package/client/ui/RadioV01/RadioV01.stories.tsx +136 -0
- package/client/ui/SearchField/SearchField.stories.tsx +4 -1
- package/client/ui/TextAreaV01/TextAreaV01.stories.tsx +23 -2
- package/client/ui/TextFieldV01/PasswordFieldV01.stories.tsx +25 -11
- package/client/ui/TextFieldV01/SignInFieldV01.stories.tsx +196 -0
- package/dist/client/assets/alert/icon-clear.svg.js +4 -0
- package/dist/client/assets/alert/icon-done.svg.js +4 -0
- package/dist/client/assets/avatar-identity/placeholder-icon.svg.js +4 -0
- package/dist/client/assets/breadcrumb/icon-ellipsis.svg.js +4 -0
- package/dist/client/assets/breadcrumb/icon-home.svg.js +4 -0
- package/dist/client/assets/breadcrumb/icon-separator.svg.js +4 -0
- package/dist/client/assets/button-v01/icon-back.svg.js +4 -0
- package/dist/client/assets/button-v01/icon-check.svg.js +4 -0
- package/dist/client/assets/button-v01/icon-close.svg.js +4 -0
- package/dist/client/assets/button-v01/icon-delete.svg.js +4 -0
- package/dist/client/assets/button-v01/icon-device.svg.js +4 -0
- package/dist/client/assets/dropdown/icon-carrot-contract.svg.js +4 -0
- package/dist/client/assets/dropdown/icon-carrot-expand.svg.js +4 -0
- package/dist/client/assets/dropdown/icon-clear.svg.js +4 -0
- package/dist/client/assets/dropdown/icon-enter.svg.js +4 -0
- package/dist/client/components/icons/AlphaIcon.js +129 -0
- package/dist/client/components/icons/ConceptIcons.js +905 -0
- package/dist/client/components/icons/IconUtility.js +410 -0
- package/dist/client/components/icons/NavAccount.js +37 -0
- package/dist/client/components/icons/NavBullet.js +17 -0
- package/dist/client/components/icons/NavLogo.js +48 -0
- package/dist/client/components/icons/StandardLogo.js +93 -0
- package/dist/client/components/icons/UtilityAccordion.js +27 -0
- package/dist/client/components/icons/UtilityChangeType.js +26 -0
- package/dist/client/components/icons/UtilityCheck.js +28 -0
- package/dist/client/components/icons/UtilityChevronDown.js +39 -0
- package/dist/client/components/icons/UtilityClassification.js +53 -0
- package/dist/client/components/icons/UtilityClearRegular.js +51 -0
- package/dist/client/components/icons/UtilityClose.js +49 -0
- package/dist/client/components/icons/UtilityCompare.js +91 -0
- package/dist/client/components/icons/UtilityDrag.js +89 -0
- package/dist/client/components/icons/UtilityEdit.js +50 -0
- package/dist/client/components/icons/UtilityFeedback.js +38 -0
- package/dist/client/components/icons/UtilityHome.js +34 -0
- package/dist/client/components/icons/UtilityMessage.js +41 -0
- package/dist/client/components/icons/UtilityOptions.js +53 -0
- package/dist/client/components/icons/UtilityPortfolio.js +116 -0
- package/dist/client/components/icons/UtilityReset.js +49 -0
- package/dist/client/components/icons/UtilityRevisionsHide.js +76 -0
- package/dist/client/components/icons/UtilityRevisionsShow.js +56 -0
- package/dist/client/components/icons/UtilitySave.js +38 -0
- package/dist/client/components/icons/UtilityScopeLarge.js +123 -0
- package/dist/client/components/icons/UtilityScoring.js +51 -0
- package/dist/client/components/icons/UtilitySearch.js +46 -0
- package/dist/client/components/icons/UtilityShow.js +49 -0
- package/dist/client/components/icons/UtilitySort.js +63 -0
- package/dist/client/components/icons/UtilityTarget.js +29 -0
- package/dist/client/components/icons/UtilityTargetActive.js +48 -0
- package/dist/client/components/icons/UtilityText.js +59 -0
- package/dist/client/components/icons/UtilityTrash.js +66 -0
- package/dist/client/components/icons/UtilityTriangleInfo.js +38 -0
- package/dist/client/components/icons/X.js +40 -0
- package/dist/client/components/icons/achievement-badges/BadgeCertificationBronze.js +144 -0
- package/dist/client/components/icons/achievement-badges/BadgeCertificationGold.js +144 -0
- package/dist/client/components/icons/achievement-badges/BadgeCertificationPlatinum.js +144 -0
- package/dist/client/components/icons/achievement-badges/BadgeCertificationSilver.js +144 -0
- package/dist/client/components/icons/achievement-badges/BadgeRatingCoworking.js +91 -0
- package/dist/client/components/icons/achievement-badges/BadgeRatingDesign.js +91 -0
- package/dist/client/components/icons/achievement-badges/BadgeRatingEquity.js +91 -0
- package/dist/client/components/icons/achievement-badges/BadgeRatingHealthySafety.js +93 -0
- package/dist/client/components/icons/achievement-badges/BadgeRatingOperations.js +93 -0
- package/dist/client/components/icons/achievement-badges/BadgeRatingPerformance.js +93 -0
- package/dist/client/components/icons/achievement-badges/BadgeRatingRealEstate.js +93 -0
- package/dist/client/components/icons/achievement-badges/BadgeRatingResidential.js +93 -0
- package/dist/client/components/icons/achievement-badges/BadgeRatingWorkforce.js +91 -0
- package/dist/client/components/icons/imperative-badges/BadgeImperativePrimary.js +58 -0
- package/dist/client/components/icons/imperative-badges/BadgeImperativeSecondary.js +69 -0
- package/dist/client/components/icons/provider-badges/BadgeEnterpriseProvider.js +117 -0
- package/dist/client/components/icons/provider-badges/BadgePerformanceTestingProvider.js +124 -0
- package/dist/client/components/icons/provider-badges/BadgeProductProvider.js +117 -0
- package/dist/client/components/icons/provider-badges/BadgeSurveyProvider.js +117 -0
- package/dist/client/components/icons/provider-seals/SealEnterpriseProvider.js +100 -0
- package/dist/client/components/icons/provider-seals/SealPerformanceTestingProvider.js +100 -0
- package/dist/client/components/icons/provider-seals/SealProductProvider.js +98 -0
- package/dist/client/components/icons/provider-seals/SealProviders.js +98 -0
- package/dist/client/components/icons/provider-seals/SealSurveyProvider.js +98 -0
- package/dist/client/components/icons/seals/IWBILogo.js +301 -0
- package/dist/client/components/icons/seals/SealCertification.js +206 -0
- package/dist/client/components/icons/seals/SealCertificationBronze.js +140 -0
- package/dist/client/components/icons/seals/SealCertificationGold.js +140 -0
- package/dist/client/components/icons/seals/SealCertificationPlatinum.js +140 -0
- package/dist/client/components/icons/seals/SealCertificationSilver.js +140 -0
- package/dist/client/components/icons/seals/SealIwbiMember.js +134 -0
- package/dist/client/components/icons/seals/SealRating.js +157 -0
- package/dist/client/components/icons/seals/SealRatingCoworking.js +89 -0
- package/dist/client/components/icons/seals/SealRatingDesign.js +89 -0
- package/dist/client/components/icons/seals/SealRatingEquity.js +89 -0
- package/dist/client/components/icons/seals/SealRatingHealthSafety.js +91 -0
- package/dist/client/components/icons/seals/SealRatingOperations.js +89 -0
- package/dist/client/components/icons/seals/SealRatingPerformance.js +91 -0
- package/dist/client/components/icons/seals/SealRatingRealEstate.js +89 -0
- package/dist/client/components/icons/seals/SealRatingWorkforce.js +89 -0
- package/dist/client/components/icons/seals/SealWell.js +132 -0
- package/dist/client/components/icons/seals/SealWellCertification.js +225 -0
- package/dist/client/components/icons/seals/SealWellCommunity.js +197 -0
- package/dist/client/components/icons/seals/SealWellResidence.js +197 -0
- package/dist/client/components/icons/seals/SealWorksWithWell.js +227 -0
- package/dist/client/components/icons/seals/WaterMarkWWWProducts.js +27 -0
- package/dist/client/components/icons/seals/WaterMarkWellProjects.js +36 -0
- package/dist/client/components/icons/seals/WatermarkMemberOrg.js +24 -0
- package/dist/client/components/ui/accordion.js +326 -0
- package/dist/client/components/ui/alert-dialog-panel.js +156 -0
- package/dist/client/components/ui/alert-dialog.js +103 -0
- package/dist/client/components/ui/alert-v02.js +157 -0
- package/dist/client/components/ui/alert.js +55 -0
- package/dist/client/components/ui/app-bar.js +203 -0
- package/dist/client/components/ui/aspect-ratio.js +5 -0
- package/dist/client/components/ui/avatar-identity.js +93 -0
- package/dist/client/components/ui/avatar.js +56 -0
- package/dist/client/components/ui/back-link.js +27 -0
- package/dist/client/components/ui/banner.js +75 -0
- package/dist/client/components/ui/bottom-navigation.js +127 -0
- package/dist/client/components/ui/breadcrumb-trail.js +137 -0
- package/dist/client/components/ui/breadcrumb.js +91 -0
- package/dist/client/components/ui/button-v01.js +173 -0
- package/dist/client/components/ui/button.js +99 -0
- package/dist/client/components/ui/calendar.js +62 -0
- package/dist/client/components/ui/card.js +177 -0
- package/dist/client/components/ui/carousel.js +198 -0
- package/dist/client/components/ui/centered-page.js +10 -0
- package/dist/client/components/ui/chart.js +239 -0
- package/dist/client/components/ui/checkbox-field.js +39 -0
- package/dist/client/components/ui/checkbox.js +18 -0
- package/dist/client/components/ui/code-badge.js +29 -0
- package/dist/client/components/ui/collapsible.js +9 -0
- package/dist/client/components/ui/command.js +79 -0
- package/dist/client/components/ui/context-menu.js +138 -0
- package/dist/client/components/ui/copy.js +39 -0
- package/dist/client/components/ui/credit-card-preview.js +74 -0
- package/dist/client/components/ui/data-grid.js +156 -0
- package/dist/client/components/ui/date-picker.js +142 -0
- package/dist/client/components/ui/dialog.js +179 -0
- package/dist/client/components/ui/drawer.js +95 -0
- package/dist/client/components/ui/drop-zone.js +87 -0
- package/dist/client/components/ui/dropdown-menu.js +139 -0
- package/dist/client/components/ui/dropdown.js +339 -0
- package/dist/client/components/ui/empty-state.js +76 -0
- package/dist/client/components/ui/field-group.js +32 -0
- package/dist/client/components/ui/file-upload-trigger.js +70 -0
- package/dist/client/components/ui/file-upload.js +171 -0
- package/dist/client/components/ui/footer.js +97 -0
- package/dist/client/components/ui/form.js +109 -0
- package/dist/client/components/ui/height-container.js +41 -0
- package/dist/client/components/ui/hero-section.js +44 -0
- package/dist/client/components/ui/hero-split-image.js +45 -0
- package/dist/client/components/ui/hover-card.js +22 -0
- package/dist/client/components/ui/icon-button.js +30 -0
- package/dist/client/components/ui/inline-notice.js +19 -0
- package/dist/client/components/ui/input-otp.js +46 -0
- package/dist/client/components/ui/input.js +37 -0
- package/dist/client/components/ui/label.js +31 -0
- package/dist/client/components/ui/labeled-divider.js +23 -0
- package/dist/client/components/ui/layout.js +724 -0
- package/dist/client/components/ui/menubar.js +157 -0
- package/dist/client/components/ui/meta-row.js +19 -0
- package/dist/client/components/ui/mobile-nav.js +230 -0
- package/dist/client/components/ui/modal-panel.js +116 -0
- package/dist/client/components/ui/navigation-menu.js +89 -0
- package/dist/client/components/ui/navigation.js +452 -0
- package/dist/client/components/ui/outline-node.js +57 -0
- package/dist/client/components/ui/page-header.js +79 -0
- package/dist/client/components/ui/pagination-v01.js +124 -0
- package/dist/client/components/ui/pagination.js +105 -0
- package/dist/client/components/ui/password-field-v01.js +46 -0
- package/dist/client/components/ui/pill-button.js +34 -0
- package/dist/client/components/ui/popover.js +22 -0
- package/dist/client/components/ui/price-tag.js +20 -0
- package/dist/client/components/ui/profile-avatar.js +92 -0
- package/dist/client/components/ui/progress.js +23 -0
- package/dist/client/components/ui/radio-card.js +30 -0
- package/dist/client/components/ui/radio-group.js +32 -0
- package/dist/client/components/ui/radio-v01.js +58 -0
- package/dist/client/components/ui/resizable.js +32 -0
- package/dist/client/components/ui/resource-thumbnail.js +24 -0
- package/dist/client/components/ui/scroll-area.js +37 -0
- package/dist/client/components/ui/search-field-v01.js +111 -0
- package/dist/client/components/ui/search.js +109 -0
- package/dist/client/components/ui/section-badge.js +22 -0
- package/dist/client/components/ui/section-heading.js +21 -0
- package/dist/client/components/ui/select.js +96 -0
- package/dist/client/components/ui/separator.js +24 -0
- package/dist/client/components/ui/sheet.js +106 -0
- package/dist/client/components/ui/side-nav.js +173 -0
- package/dist/client/components/ui/sidebar.js +580 -0
- package/dist/client/components/ui/sign-in-field-v01.js +107 -0
- package/dist/client/components/ui/skeleton.js +17 -0
- package/dist/client/components/ui/slider.js +20 -0
- package/dist/client/components/ui/social-button.js +34 -0
- package/dist/client/components/ui/standard-navigation.js +454 -0
- package/dist/client/components/ui/status-pill.js +42 -0
- package/dist/client/components/ui/stepper.js +111 -0
- package/dist/client/components/ui/switch-v01.js +39 -0
- package/dist/client/components/ui/switch.js +17 -0
- package/dist/client/components/ui/system-bar.js +76 -0
- package/dist/client/components/ui/table.js +107 -0
- package/dist/client/components/ui/tabs-v01.js +74 -0
- package/dist/client/components/ui/tabs.js +253 -0
- package/dist/client/components/ui/tag-v02.js +85 -0
- package/dist/client/components/ui/tag.js +73 -0
- package/dist/client/components/ui/text-area-v01.js +26 -0
- package/dist/client/components/ui/text-field-v01.js +78 -0
- package/dist/client/components/ui/text-link.js +23 -0
- package/dist/client/components/ui/textarea.js +19 -0
- package/dist/client/components/ui/timeline.js +87 -0
- package/dist/client/components/ui/toast-v01.js +155 -0
- package/dist/client/components/ui/toast.js +88 -0
- package/dist/client/components/ui/toaster.js +22 -0
- package/dist/client/components/ui/toggle.js +56 -0
- package/dist/client/components/ui/tooltip.js +328 -0
- package/dist/client/components/ui/typography.js +119 -0
- package/dist/client/hooks/use-mobile.js +20 -0
- package/dist/client/hooks/use-segmented-control.js +32 -0
- package/dist/client/hooks/use-tabs.js +22 -0
- package/dist/client/hooks/use-toast.js +122 -0
- package/dist/client/lib/concept-colors.js +74 -0
- package/dist/client/lib/concept-icons.js +32 -0
- package/dist/client/lib/utility-icons.js +73 -0
- package/dist/client/lib/utils.js +13 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +156 -0
- package/dist/ui/index.js +774 -0
- package/package.json +9 -6
- package/dist/index.cjs.js +0 -1
- package/dist/index.es.js +0 -18989
- /package/{dist → client}/fonts/FT-Made/FTMade-Regular.otf +0 -0
- /package/{dist → client}/fonts/FT-Made/FTMade-Regular.ttf +0 -0
- /package/{dist → client}/fonts/FT-Made/FTMade-Regular.woff +0 -0
- /package/{dist → client}/fonts/FT-Made/FTMade-Regular.woff2 +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-black.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-blackitalic.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-bold.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-bolditalic.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-extrabold.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-extrabolditalic.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-extralight.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-extralightitalic.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-italic.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-light.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-lightitalic.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-medium.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-mediumitalic.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-regular.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-semibold.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-semibolditalic.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-thin.otf +0 -0
- /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-thinitalic.otf +0 -0
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
const spacing = (n) => `${n * 0.25}rem`;
|
|
5
|
+
const warned = /* @__PURE__ */ new Set();
|
|
6
|
+
function warnOnce(message) {
|
|
7
|
+
if (process.env.NODE_ENV === "production" || warned.has(message)) return;
|
|
8
|
+
warned.add(message);
|
|
9
|
+
console.warn(message);
|
|
10
|
+
}
|
|
11
|
+
const SPACE_SCALE = {
|
|
12
|
+
"3xs": 2,
|
|
13
|
+
"2xs": 4,
|
|
14
|
+
xs: 8,
|
|
15
|
+
sm: 12,
|
|
16
|
+
md: 16,
|
|
17
|
+
lg: 20,
|
|
18
|
+
xl: 24,
|
|
19
|
+
"2xl": 32,
|
|
20
|
+
"3xl": 40,
|
|
21
|
+
"4xl": 48,
|
|
22
|
+
"5xl": 64,
|
|
23
|
+
"6xl": 80,
|
|
24
|
+
"7xl": 96,
|
|
25
|
+
"8xl": 120
|
|
26
|
+
};
|
|
27
|
+
const SPACE_NAMES = Object.keys(SPACE_SCALE);
|
|
28
|
+
const SPACER_SPACES = Object.values(
|
|
29
|
+
SPACE_SCALE
|
|
30
|
+
);
|
|
31
|
+
const PX_TO_SPACE = Object.fromEntries(
|
|
32
|
+
SPACE_NAMES.map((name) => [SPACE_SCALE[name], name])
|
|
33
|
+
);
|
|
34
|
+
function tokenCss(name) {
|
|
35
|
+
return `var(--space-${name})`;
|
|
36
|
+
}
|
|
37
|
+
function gapCss(value) {
|
|
38
|
+
if (value == null) return void 0;
|
|
39
|
+
if (typeof value === "string") return tokenCss(value);
|
|
40
|
+
if (value === 0) return "0px";
|
|
41
|
+
const named = PX_TO_SPACE[value * 4];
|
|
42
|
+
if (named) return tokenCss(named);
|
|
43
|
+
warnOnce(
|
|
44
|
+
`layout: spacing ${value} is off the space scale, so ${spacing(value)} is frozen into this app and a design-system change will not reach it. Use a named token (gap="md").`
|
|
45
|
+
);
|
|
46
|
+
return spacing(value);
|
|
47
|
+
}
|
|
48
|
+
const toCssSize = (v) => v === void 0 ? void 0 : typeof v === "number" ? `${v}px` : v;
|
|
49
|
+
const isWrapped = (wrap) => wrap === true || wrap === "wrap";
|
|
50
|
+
const Stack = React.forwardRef(
|
|
51
|
+
({
|
|
52
|
+
as: Component = "div",
|
|
53
|
+
direction = "vertical",
|
|
54
|
+
gap = "md",
|
|
55
|
+
align,
|
|
56
|
+
justify,
|
|
57
|
+
hAlign,
|
|
58
|
+
vAlign,
|
|
59
|
+
wrap = false,
|
|
60
|
+
padding,
|
|
61
|
+
marginY,
|
|
62
|
+
width,
|
|
63
|
+
height,
|
|
64
|
+
maxWidth,
|
|
65
|
+
minHeight,
|
|
66
|
+
isScrollable = false,
|
|
67
|
+
className,
|
|
68
|
+
style,
|
|
69
|
+
...props
|
|
70
|
+
}, ref) => {
|
|
71
|
+
const resolvedJustify = justify ?? (direction === "horizontal" ? hAlign : vAlign);
|
|
72
|
+
const resolvedAlign = align ?? (direction === "horizontal" ? vAlign : hAlign);
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
74
|
+
Component,
|
|
75
|
+
{
|
|
76
|
+
ref,
|
|
77
|
+
className: cn(
|
|
78
|
+
"stack",
|
|
79
|
+
direction === "horizontal" && "stack--horizontal",
|
|
80
|
+
resolvedAlign && `stack--align-${resolvedAlign}`,
|
|
81
|
+
resolvedJustify && `stack--justify-${resolvedJustify}`,
|
|
82
|
+
isWrapped(wrap) && "stack--wrap",
|
|
83
|
+
wrap === "wrap-reverse" && "stack--wrap-reverse",
|
|
84
|
+
isScrollable && "stack--scrollable",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
style: {
|
|
88
|
+
gap: gapCss(gap),
|
|
89
|
+
padding: gapCss(padding),
|
|
90
|
+
marginTop: gapCss(marginY),
|
|
91
|
+
marginBottom: gapCss(marginY),
|
|
92
|
+
width: toCssSize(width),
|
|
93
|
+
height: toCssSize(height),
|
|
94
|
+
maxWidth: toCssSize(maxWidth),
|
|
95
|
+
minHeight: toCssSize(minHeight),
|
|
96
|
+
...style
|
|
97
|
+
},
|
|
98
|
+
...props
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
Stack.displayName = "Stack";
|
|
104
|
+
const HStack = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(Stack, { ref, direction: "horizontal", ...props }));
|
|
105
|
+
HStack.displayName = "HStack";
|
|
106
|
+
const VStack = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(Stack, { ref, direction: "vertical", ...props }));
|
|
107
|
+
VStack.displayName = "VStack";
|
|
108
|
+
const StackItem = React.forwardRef(
|
|
109
|
+
({
|
|
110
|
+
as: Component = "div",
|
|
111
|
+
size = "static",
|
|
112
|
+
alignSelf,
|
|
113
|
+
isScrollable = false,
|
|
114
|
+
className,
|
|
115
|
+
...props
|
|
116
|
+
}, ref) => /* @__PURE__ */ jsx(
|
|
117
|
+
Component,
|
|
118
|
+
{
|
|
119
|
+
ref,
|
|
120
|
+
className: cn(
|
|
121
|
+
"stack-item",
|
|
122
|
+
size === "fill" && "stack-item--fill",
|
|
123
|
+
alignSelf && `stack-item--align-${alignSelf}`,
|
|
124
|
+
isScrollable && "stack-item--scrollable",
|
|
125
|
+
className
|
|
126
|
+
),
|
|
127
|
+
...props
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
);
|
|
131
|
+
StackItem.displayName = "StackItem";
|
|
132
|
+
const Grid = React.forwardRef(
|
|
133
|
+
({
|
|
134
|
+
as: Component = "div",
|
|
135
|
+
columns,
|
|
136
|
+
cols,
|
|
137
|
+
colsSm,
|
|
138
|
+
colsMd,
|
|
139
|
+
colsLg,
|
|
140
|
+
gap = "md",
|
|
141
|
+
rowGap,
|
|
142
|
+
columnGap,
|
|
143
|
+
colGap,
|
|
144
|
+
align,
|
|
145
|
+
justify,
|
|
146
|
+
width,
|
|
147
|
+
height,
|
|
148
|
+
maxWidth,
|
|
149
|
+
minHeight,
|
|
150
|
+
className,
|
|
151
|
+
style,
|
|
152
|
+
...props
|
|
153
|
+
}, ref) => {
|
|
154
|
+
const resolvedColumnGap = columnGap ?? colGap;
|
|
155
|
+
const isResponsive = columns !== void 0 && typeof columns === "object";
|
|
156
|
+
const fixedCols = typeof columns === "number" ? columns : cols ?? 1;
|
|
157
|
+
let template;
|
|
158
|
+
if (isResponsive) {
|
|
159
|
+
const repeat = columns.repeat ?? "fill";
|
|
160
|
+
if (columns.max) {
|
|
161
|
+
template = `repeat(auto-${repeat}, minmax(max(${columns.minWidth}px, calc(100% / ${columns.max})), 1fr))`;
|
|
162
|
+
} else {
|
|
163
|
+
template = `repeat(auto-${repeat}, minmax(${columns.minWidth}px, 1fr))`;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return /* @__PURE__ */ jsx(
|
|
167
|
+
Component,
|
|
168
|
+
{
|
|
169
|
+
ref,
|
|
170
|
+
className: cn(
|
|
171
|
+
"grid-layout",
|
|
172
|
+
!isResponsive && `grid-layout--cols-${fixedCols}`,
|
|
173
|
+
!isResponsive && colsSm && `grid-layout--sm-cols-${colsSm}`,
|
|
174
|
+
!isResponsive && colsMd && `grid-layout--md-cols-${colsMd}`,
|
|
175
|
+
!isResponsive && colsLg && `grid-layout--lg-cols-${colsLg}`,
|
|
176
|
+
align && `grid-layout--align-${align}`,
|
|
177
|
+
justify && `grid-layout--justify-${justify}`,
|
|
178
|
+
className
|
|
179
|
+
),
|
|
180
|
+
style: {
|
|
181
|
+
gridTemplateColumns: template,
|
|
182
|
+
// Never emit the `gap` shorthand alongside `rowGap`/`columnGap` —
|
|
183
|
+
// React warns on mixing a shorthand and its longhands in the same
|
|
184
|
+
// style object across re-renders, even when one side is
|
|
185
|
+
// `undefined`. Decomposing into the two longhands always, with
|
|
186
|
+
// `gap` as their shared fallback, avoids the shorthand entirely.
|
|
187
|
+
rowGap: gapCss(rowGap ?? gap),
|
|
188
|
+
columnGap: gapCss(resolvedColumnGap ?? gap),
|
|
189
|
+
width: toCssSize(width),
|
|
190
|
+
height: toCssSize(height),
|
|
191
|
+
maxWidth: toCssSize(maxWidth),
|
|
192
|
+
minHeight: toCssSize(minHeight),
|
|
193
|
+
...style
|
|
194
|
+
},
|
|
195
|
+
...props
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
Grid.displayName = "Grid";
|
|
201
|
+
const GridSpan = React.forwardRef(
|
|
202
|
+
({ as: Component = "div", columns, rows, className, style, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
203
|
+
Component,
|
|
204
|
+
{
|
|
205
|
+
ref,
|
|
206
|
+
className: cn("grid-span", className),
|
|
207
|
+
style: {
|
|
208
|
+
gridColumn: columns === "full" ? "1 / -1" : columns != null ? `span ${columns}` : void 0,
|
|
209
|
+
gridRow: rows != null ? `span ${rows}` : void 0,
|
|
210
|
+
...style
|
|
211
|
+
},
|
|
212
|
+
...props
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
);
|
|
216
|
+
GridSpan.displayName = "GridSpan";
|
|
217
|
+
const ColumnsPresetMap = {
|
|
218
|
+
sidebar: "var(--layout-panel-width-default) 1fr",
|
|
219
|
+
// A flexible main column and a 20–27.5rem aside (a form beside its live summary).
|
|
220
|
+
"main-aside": "minmax(0, 1fr) minmax(20rem, 27.5rem)",
|
|
221
|
+
"sidebar-right": "1fr var(--layout-panel-width-default)",
|
|
222
|
+
"wide-sidebar": "var(--layout-panel-width-wide) 1fr",
|
|
223
|
+
"narrow-sidebar": "var(--layout-panel-width-narrow) 1fr",
|
|
224
|
+
split: "1fr 1fr",
|
|
225
|
+
"1-2": "1fr 2fr",
|
|
226
|
+
"2-1": "2fr 1fr",
|
|
227
|
+
"1-3": "1fr 3fr",
|
|
228
|
+
"3-1": "3fr 1fr"
|
|
229
|
+
};
|
|
230
|
+
const Columns = React.forwardRef(
|
|
231
|
+
({
|
|
232
|
+
as: Component = "div",
|
|
233
|
+
preset = "split",
|
|
234
|
+
template,
|
|
235
|
+
gap = "xl",
|
|
236
|
+
colGap,
|
|
237
|
+
columnGap,
|
|
238
|
+
rowGap,
|
|
239
|
+
collapse,
|
|
240
|
+
align,
|
|
241
|
+
className,
|
|
242
|
+
style,
|
|
243
|
+
...props
|
|
244
|
+
}, ref) => {
|
|
245
|
+
const resolvedColumnGap = columnGap ?? colGap;
|
|
246
|
+
return /* @__PURE__ */ jsx(
|
|
247
|
+
Component,
|
|
248
|
+
{
|
|
249
|
+
ref,
|
|
250
|
+
className: cn(
|
|
251
|
+
"columns-layout",
|
|
252
|
+
collapse && `columns-layout--collapse-${collapse}`,
|
|
253
|
+
align === "start" && "columns-layout--align-start",
|
|
254
|
+
className
|
|
255
|
+
),
|
|
256
|
+
style: {
|
|
257
|
+
gridTemplateColumns: template ?? ColumnsPresetMap[preset],
|
|
258
|
+
// See Grid's identical comment — never mix the `gap` shorthand
|
|
259
|
+
// with `rowGap`/`columnGap` longhands in the same style object.
|
|
260
|
+
rowGap: gapCss(rowGap ?? gap),
|
|
261
|
+
columnGap: gapCss(resolvedColumnGap ?? gap),
|
|
262
|
+
...style
|
|
263
|
+
},
|
|
264
|
+
...props
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
Columns.displayName = "Columns";
|
|
270
|
+
const Center = React.forwardRef(
|
|
271
|
+
({
|
|
272
|
+
as: Component = "div",
|
|
273
|
+
axis = "both",
|
|
274
|
+
width,
|
|
275
|
+
height,
|
|
276
|
+
maxWidth,
|
|
277
|
+
minHeight,
|
|
278
|
+
padding,
|
|
279
|
+
isInline = false,
|
|
280
|
+
className,
|
|
281
|
+
style,
|
|
282
|
+
...props
|
|
283
|
+
}, ref) => /* @__PURE__ */ jsx(
|
|
284
|
+
Component,
|
|
285
|
+
{
|
|
286
|
+
ref,
|
|
287
|
+
className: cn(
|
|
288
|
+
"center",
|
|
289
|
+
isInline && "center--inline",
|
|
290
|
+
`center--${axis}`,
|
|
291
|
+
className
|
|
292
|
+
),
|
|
293
|
+
style: {
|
|
294
|
+
width: toCssSize(width),
|
|
295
|
+
height: toCssSize(height),
|
|
296
|
+
maxWidth: toCssSize(maxWidth),
|
|
297
|
+
minHeight: toCssSize(minHeight),
|
|
298
|
+
padding: gapCss(padding),
|
|
299
|
+
...style
|
|
300
|
+
},
|
|
301
|
+
...props
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
);
|
|
305
|
+
Center.displayName = "Center";
|
|
306
|
+
const FormLayout = React.forwardRef(
|
|
307
|
+
({
|
|
308
|
+
as: Component = "div",
|
|
309
|
+
direction = "vertical",
|
|
310
|
+
gap,
|
|
311
|
+
width,
|
|
312
|
+
maxWidth,
|
|
313
|
+
className,
|
|
314
|
+
style,
|
|
315
|
+
...props
|
|
316
|
+
}, ref) => /* @__PURE__ */ jsx(
|
|
317
|
+
Component,
|
|
318
|
+
{
|
|
319
|
+
ref,
|
|
320
|
+
className: cn(
|
|
321
|
+
"form-layout",
|
|
322
|
+
direction === "horizontal" && "form-layout--horizontal",
|
|
323
|
+
direction === "horizontal-labels" && "form-layout--horizontal-labels",
|
|
324
|
+
className
|
|
325
|
+
),
|
|
326
|
+
style: {
|
|
327
|
+
gap: gapCss(gap),
|
|
328
|
+
width: toCssSize(width),
|
|
329
|
+
maxWidth: toCssSize(maxWidth),
|
|
330
|
+
...style
|
|
331
|
+
},
|
|
332
|
+
...props
|
|
333
|
+
}
|
|
334
|
+
)
|
|
335
|
+
);
|
|
336
|
+
FormLayout.displayName = "FormLayout";
|
|
337
|
+
const Section = React.forwardRef(
|
|
338
|
+
({
|
|
339
|
+
as: Component = "section",
|
|
340
|
+
padding = "lg",
|
|
341
|
+
maxWidth,
|
|
342
|
+
className,
|
|
343
|
+
style,
|
|
344
|
+
...props
|
|
345
|
+
}, ref) => /* @__PURE__ */ jsx(
|
|
346
|
+
Component,
|
|
347
|
+
{
|
|
348
|
+
ref,
|
|
349
|
+
className: cn(
|
|
350
|
+
"section-layout",
|
|
351
|
+
padding !== "none" && `section-layout--${padding}`,
|
|
352
|
+
className
|
|
353
|
+
),
|
|
354
|
+
style: { maxWidth: toCssSize(maxWidth), ...style },
|
|
355
|
+
...props
|
|
356
|
+
}
|
|
357
|
+
)
|
|
358
|
+
);
|
|
359
|
+
Section.displayName = "Section";
|
|
360
|
+
function panelWidthVar(width) {
|
|
361
|
+
if (width == null) return void 0;
|
|
362
|
+
if (typeof width === "number") {
|
|
363
|
+
warnOnce(
|
|
364
|
+
`LayoutPanel: width={${width}} freezes ${width}px into this app. Use width="rail" | "nav" | "narrow" | "default" | "wide" so --layout-panel-width-* stays in control.`
|
|
365
|
+
);
|
|
366
|
+
return `${width}px`;
|
|
367
|
+
}
|
|
368
|
+
return `var(--layout-panel-width-${width})`;
|
|
369
|
+
}
|
|
370
|
+
function measureVar(measure) {
|
|
371
|
+
if (measure == null) return void 0;
|
|
372
|
+
if (typeof measure !== "string" || !["sm", "md", "lg", "full"].includes(measure)) {
|
|
373
|
+
const frozen = toCssSize(measure);
|
|
374
|
+
warnOnce(
|
|
375
|
+
`Layout: contentWidth={${JSON.stringify(measure)}} freezes ${frozen} into this app. Use contentWidth="sm" | "md" | "lg" | "full" so --layout-measure-* stays in control.`
|
|
376
|
+
);
|
|
377
|
+
return frozen;
|
|
378
|
+
}
|
|
379
|
+
return `var(--layout-measure-${measure})`;
|
|
380
|
+
}
|
|
381
|
+
const LAYOUT_SLOT = Symbol.for("iwbi.layoutSlot");
|
|
382
|
+
function markSlot(component, slot) {
|
|
383
|
+
component[LAYOUT_SLOT] = slot;
|
|
384
|
+
return component;
|
|
385
|
+
}
|
|
386
|
+
function slotIdOf(element) {
|
|
387
|
+
var _a, _b;
|
|
388
|
+
const type = element.type;
|
|
389
|
+
if (typeof type === "string" || typeof type === "number") return void 0;
|
|
390
|
+
const tagged = type;
|
|
391
|
+
return tagged[LAYOUT_SLOT] ?? ((_a = tagged.render) == null ? void 0 : _a[LAYOUT_SLOT]) ?? ((_b = tagged.type) == null ? void 0 : _b[LAYOUT_SLOT]);
|
|
392
|
+
}
|
|
393
|
+
const LayoutHeader = markSlot(
|
|
394
|
+
React.forwardRef(
|
|
395
|
+
({ as = "header", sticky = false, ...props }, ref) => {
|
|
396
|
+
const Component = as;
|
|
397
|
+
return /* @__PURE__ */ jsx(
|
|
398
|
+
Component,
|
|
399
|
+
{
|
|
400
|
+
ref,
|
|
401
|
+
className: cn("layout-header", sticky && "layout-header--sticky"),
|
|
402
|
+
...props
|
|
403
|
+
}
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
),
|
|
407
|
+
"header"
|
|
408
|
+
);
|
|
409
|
+
LayoutHeader.displayName = "LayoutHeader";
|
|
410
|
+
const LayoutFooter = markSlot(
|
|
411
|
+
React.forwardRef(
|
|
412
|
+
({ as = "footer", ...props }, ref) => {
|
|
413
|
+
const Component = as;
|
|
414
|
+
return /* @__PURE__ */ jsx(Component, { ref, className: "layout-footer", ...props });
|
|
415
|
+
}
|
|
416
|
+
),
|
|
417
|
+
"footer"
|
|
418
|
+
);
|
|
419
|
+
LayoutFooter.displayName = "LayoutFooter";
|
|
420
|
+
const LayoutContent = markSlot(
|
|
421
|
+
React.forwardRef(
|
|
422
|
+
({ as = "main", isScrollable = true, tabIndex, ...props }, ref) => {
|
|
423
|
+
const Component = as;
|
|
424
|
+
return /* @__PURE__ */ jsx(
|
|
425
|
+
Component,
|
|
426
|
+
{
|
|
427
|
+
ref,
|
|
428
|
+
className: cn(
|
|
429
|
+
"layout-content",
|
|
430
|
+
isScrollable && "layout-content--scrollable"
|
|
431
|
+
),
|
|
432
|
+
tabIndex: tabIndex ?? (isScrollable ? 0 : void 0),
|
|
433
|
+
...props
|
|
434
|
+
}
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
),
|
|
438
|
+
"content"
|
|
439
|
+
);
|
|
440
|
+
LayoutContent.displayName = "LayoutContent";
|
|
441
|
+
const LayoutPanel = markSlot(
|
|
442
|
+
React.forwardRef(
|
|
443
|
+
({
|
|
444
|
+
as = "aside",
|
|
445
|
+
placement = "start",
|
|
446
|
+
width,
|
|
447
|
+
padding,
|
|
448
|
+
appearance = "default",
|
|
449
|
+
collapsed = false,
|
|
450
|
+
isScrollable = true,
|
|
451
|
+
tabIndex,
|
|
452
|
+
"aria-label": ariaLabel,
|
|
453
|
+
...props
|
|
454
|
+
}, ref) => {
|
|
455
|
+
const Component = as;
|
|
456
|
+
return /* @__PURE__ */ jsx(
|
|
457
|
+
Component,
|
|
458
|
+
{
|
|
459
|
+
ref,
|
|
460
|
+
className: cn(
|
|
461
|
+
"layout-panel",
|
|
462
|
+
`layout-panel--${placement}`,
|
|
463
|
+
isScrollable && "layout-panel--scrollable",
|
|
464
|
+
appearance === "nav" && "layout-panel--nav"
|
|
465
|
+
),
|
|
466
|
+
style: {
|
|
467
|
+
...width != null ? { ["--layout-panel-width"]: panelWidthVar(width) } : void 0,
|
|
468
|
+
...padding != null ? { ["--layout-panel-padding"]: tokenCss(padding) } : void 0
|
|
469
|
+
},
|
|
470
|
+
"data-collapsed": collapsed || void 0,
|
|
471
|
+
tabIndex: tabIndex ?? (isScrollable ? 0 : void 0),
|
|
472
|
+
"aria-label": ariaLabel ?? (placement === "end" ? "Details" : "Navigation"),
|
|
473
|
+
...props
|
|
474
|
+
}
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
),
|
|
478
|
+
"panel"
|
|
479
|
+
);
|
|
480
|
+
LayoutPanel.displayName = "LayoutPanel";
|
|
481
|
+
function collectSlots(children) {
|
|
482
|
+
const slots = {};
|
|
483
|
+
const leftovers = [];
|
|
484
|
+
let sawStartPanel = false;
|
|
485
|
+
React.Children.forEach(children, (child) => {
|
|
486
|
+
if (!React.isValidElement(child)) {
|
|
487
|
+
leftovers.push(child);
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
const slot = slotIdOf(child);
|
|
491
|
+
if (slot === "header" && slots.header == null) {
|
|
492
|
+
slots.header = child;
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
if (slot === "footer" && slots.footer == null) {
|
|
496
|
+
slots.footer = child;
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
if (slot === "content" && slots.content == null) {
|
|
500
|
+
slots.content = child;
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
if (slot === "panel") {
|
|
504
|
+
const placement = child.props.placement ?? (sawStartPanel ? "end" : "start");
|
|
505
|
+
if (placement === "end" && slots.end == null) {
|
|
506
|
+
slots.end = child;
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
if (slots.start == null) {
|
|
510
|
+
slots.start = child;
|
|
511
|
+
sawStartPanel = true;
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
if (slots.end == null) {
|
|
515
|
+
slots.end = child;
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
leftovers.push(child);
|
|
520
|
+
});
|
|
521
|
+
if (leftovers.length > 0) {
|
|
522
|
+
if (process.env.NODE_ENV !== "production") {
|
|
523
|
+
console.warn(
|
|
524
|
+
"Layout: child was not LayoutHeader, LayoutFooter, LayoutContent, or LayoutPanel.",
|
|
525
|
+
leftovers
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
if (slots.content == null) {
|
|
529
|
+
slots.content = leftovers.length === 1 ? leftovers[0] : leftovers;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
return slots;
|
|
533
|
+
}
|
|
534
|
+
const Layout = React.forwardRef(
|
|
535
|
+
({ children, height = "fill", contentWidth, padding = "2xl", ...props }, ref) => {
|
|
536
|
+
const slots = collectSlots(children);
|
|
537
|
+
return /* @__PURE__ */ jsxs(
|
|
538
|
+
"div",
|
|
539
|
+
{
|
|
540
|
+
ref,
|
|
541
|
+
className: cn(
|
|
542
|
+
"layout",
|
|
543
|
+
height === "fill" ? "layout--fill" : "layout--auto"
|
|
544
|
+
),
|
|
545
|
+
style: {
|
|
546
|
+
["--layout-padding"]: gapCss(padding),
|
|
547
|
+
...contentWidth != null ? {
|
|
548
|
+
["--layout-content-max-width"]: measureVar(contentWidth)
|
|
549
|
+
} : void 0
|
|
550
|
+
},
|
|
551
|
+
...props,
|
|
552
|
+
children: [
|
|
553
|
+
slots.header,
|
|
554
|
+
slots.start,
|
|
555
|
+
slots.content != null && (React.isValidElement(slots.content) && slotIdOf(slots.content) === "content" ? slots.content : /* @__PURE__ */ jsx(LayoutContent, { children: slots.content })),
|
|
556
|
+
slots.end,
|
|
557
|
+
slots.footer
|
|
558
|
+
]
|
|
559
|
+
}
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
Layout.displayName = "Layout";
|
|
564
|
+
const Container = React.forwardRef(
|
|
565
|
+
({
|
|
566
|
+
as: Component = "div",
|
|
567
|
+
size = "xl",
|
|
568
|
+
center = true,
|
|
569
|
+
padded = true,
|
|
570
|
+
className,
|
|
571
|
+
...props
|
|
572
|
+
}, ref) => /* @__PURE__ */ jsx(
|
|
573
|
+
Component,
|
|
574
|
+
{
|
|
575
|
+
ref,
|
|
576
|
+
className: cn(
|
|
577
|
+
"container-layout",
|
|
578
|
+
`container-layout--${size}`,
|
|
579
|
+
center && "container-layout--center",
|
|
580
|
+
padded && "container-layout--padded",
|
|
581
|
+
className
|
|
582
|
+
),
|
|
583
|
+
...props
|
|
584
|
+
}
|
|
585
|
+
)
|
|
586
|
+
);
|
|
587
|
+
Container.displayName = "Container";
|
|
588
|
+
const Show = React.forwardRef(
|
|
589
|
+
({ above, below, as: Component = "div", className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
590
|
+
Component,
|
|
591
|
+
{
|
|
592
|
+
ref,
|
|
593
|
+
className: cn(
|
|
594
|
+
above && `show-above-${above}`,
|
|
595
|
+
below && `show-below-${below}`,
|
|
596
|
+
className
|
|
597
|
+
),
|
|
598
|
+
...props
|
|
599
|
+
}
|
|
600
|
+
)
|
|
601
|
+
);
|
|
602
|
+
Show.displayName = "Show";
|
|
603
|
+
const Hide = React.forwardRef(
|
|
604
|
+
({ above, below, as: Component = "div", className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
605
|
+
Component,
|
|
606
|
+
{
|
|
607
|
+
ref,
|
|
608
|
+
className: cn(
|
|
609
|
+
above && `hide-above-${above}`,
|
|
610
|
+
below && `hide-below-${below}`,
|
|
611
|
+
className
|
|
612
|
+
),
|
|
613
|
+
...props
|
|
614
|
+
}
|
|
615
|
+
)
|
|
616
|
+
);
|
|
617
|
+
Hide.displayName = "Hide";
|
|
618
|
+
const Positioned = React.forwardRef(
|
|
619
|
+
({
|
|
620
|
+
as: Component = "div",
|
|
621
|
+
position = "relative",
|
|
622
|
+
top,
|
|
623
|
+
right,
|
|
624
|
+
bottom,
|
|
625
|
+
left,
|
|
626
|
+
inset,
|
|
627
|
+
zIndex,
|
|
628
|
+
fill = false,
|
|
629
|
+
className,
|
|
630
|
+
style,
|
|
631
|
+
...props
|
|
632
|
+
}, ref) => {
|
|
633
|
+
const resolveValue = (v) => v === void 0 ? void 0 : typeof v === "number" ? spacing(v) : v;
|
|
634
|
+
return /* @__PURE__ */ jsx(
|
|
635
|
+
Component,
|
|
636
|
+
{
|
|
637
|
+
ref,
|
|
638
|
+
className: cn(`positioned--${position}`, className),
|
|
639
|
+
style: {
|
|
640
|
+
top: resolveValue(top),
|
|
641
|
+
right: resolveValue(right),
|
|
642
|
+
bottom: resolveValue(bottom),
|
|
643
|
+
left: resolveValue(left),
|
|
644
|
+
inset: fill ? 0 : resolveValue(inset),
|
|
645
|
+
zIndex,
|
|
646
|
+
...style
|
|
647
|
+
},
|
|
648
|
+
...props
|
|
649
|
+
}
|
|
650
|
+
);
|
|
651
|
+
}
|
|
652
|
+
);
|
|
653
|
+
Positioned.displayName = "Positioned";
|
|
654
|
+
function spacerTokenCss(space, size) {
|
|
655
|
+
if (typeof space === "string") return tokenCss(space);
|
|
656
|
+
if (typeof space === "number") {
|
|
657
|
+
const named = PX_TO_SPACE[space];
|
|
658
|
+
return named ? tokenCss(named) : `${space}px`;
|
|
659
|
+
}
|
|
660
|
+
if (size != null) {
|
|
661
|
+
const px = size * 4;
|
|
662
|
+
const named = PX_TO_SPACE[px];
|
|
663
|
+
return named ? tokenCss(named) : spacing(size);
|
|
664
|
+
}
|
|
665
|
+
return tokenCss("md");
|
|
666
|
+
}
|
|
667
|
+
const Spacer = ({
|
|
668
|
+
space,
|
|
669
|
+
size,
|
|
670
|
+
axis = "vertical",
|
|
671
|
+
flex = false,
|
|
672
|
+
className,
|
|
673
|
+
style,
|
|
674
|
+
...props
|
|
675
|
+
}) => {
|
|
676
|
+
const token = spacerTokenCss(space, size);
|
|
677
|
+
return /* @__PURE__ */ jsx(
|
|
678
|
+
"div",
|
|
679
|
+
{
|
|
680
|
+
"aria-hidden": "true",
|
|
681
|
+
className: cn(
|
|
682
|
+
"spacer",
|
|
683
|
+
flex ? "spacer--flex" : axis === "horizontal" ? "spacer--horizontal" : "spacer--vertical",
|
|
684
|
+
className
|
|
685
|
+
),
|
|
686
|
+
style: {
|
|
687
|
+
...flex ? void 0 : axis === "vertical" ? { height: token, minHeight: token } : { width: token, minWidth: token },
|
|
688
|
+
...style
|
|
689
|
+
},
|
|
690
|
+
...props
|
|
691
|
+
}
|
|
692
|
+
);
|
|
693
|
+
};
|
|
694
|
+
Spacer.displayName = "Spacer";
|
|
695
|
+
export {
|
|
696
|
+
Layout as AppShell,
|
|
697
|
+
LayoutFooter as AppShellFooter,
|
|
698
|
+
LayoutHeader as AppShellHeader,
|
|
699
|
+
LayoutContent as AppShellMain,
|
|
700
|
+
LayoutPanel as AppShellSidebar,
|
|
701
|
+
Center,
|
|
702
|
+
Columns,
|
|
703
|
+
Container,
|
|
704
|
+
FormLayout,
|
|
705
|
+
Grid,
|
|
706
|
+
GridSpan,
|
|
707
|
+
HStack,
|
|
708
|
+
Hide,
|
|
709
|
+
Layout,
|
|
710
|
+
LayoutContent,
|
|
711
|
+
LayoutFooter,
|
|
712
|
+
LayoutHeader,
|
|
713
|
+
LayoutPanel,
|
|
714
|
+
Positioned,
|
|
715
|
+
SPACER_SPACES,
|
|
716
|
+
SPACE_NAMES,
|
|
717
|
+
SPACE_SCALE,
|
|
718
|
+
Section,
|
|
719
|
+
Show,
|
|
720
|
+
Spacer,
|
|
721
|
+
Stack,
|
|
722
|
+
StackItem,
|
|
723
|
+
VStack
|
|
724
|
+
};
|