tembro 3.1.5 → 3.1.7
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 +7 -1
- package/README.md +241 -91
- package/dist/components/ui/dialog/index.d.ts +3 -1
- package/dist/components/ui/select/index.d.ts +6 -3
- package/dist/showcase/package-meta.d.ts +3 -3
- package/dist/showcase/premium/wizard/index.cjs +1 -0
- package/dist/showcase/premium/wizard/index.d.ts +2 -0
- package/dist/showcase/premium/wizard/index.js +1 -0
- package/dist/showcase/premium/wizard/mock.cjs +1 -0
- package/dist/showcase/premium/wizard/mock.d.ts +2 -0
- package/dist/showcase/premium/wizard/mock.js +1 -0
- package/dist/showcase/premium/wizard/showcase.cjs +1 -0
- package/dist/showcase/premium/wizard/showcase.d.ts +2 -0
- package/dist/showcase/premium/wizard/showcase.js +1 -0
- package/dist/showcase/search-utils.d.ts +1 -1
- package/dist/showcase/site-data.d.ts +6 -6
- package/dist/src/components/layout/app-sidebar.cjs +1 -1
- package/dist/src/components/layout/app-sidebar.js +49 -36
- package/dist/src/components/theme-provider.cjs +1 -1
- package/dist/src/components/theme-provider.js +1 -1
- package/dist/src/components/ui/dialog/index.cjs +1 -1
- package/dist/src/components/ui/dialog/index.js +14 -7
- package/dist/src/components/ui/select/index.cjs +1 -1
- package/dist/src/components/ui/select/index.js +44 -43
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.js +101 -101
- package/dist/src/showcase/component-api-schema.cjs +1 -1
- package/dist/src/showcase/component-api-schema.js +868 -9
- package/dist/src/showcase/demo-snippets/forms/index.cjs +1 -1
- package/dist/src/showcase/demo-snippets/forms/index.js +1 -1
- package/dist/src/showcase/fallback.cjs +4 -4
- package/dist/src/showcase/fallback.js +354 -181
- package/dist/src/showcase/index.cjs +1 -1
- package/dist/src/showcase/index.js +2 -2
- package/dist/src/showcase/package-meta.cjs +1 -1
- package/dist/src/showcase/package-meta.js +1 -1
- package/dist/src/showcase/premium/app-sidebar/mock.cjs +3 -2
- package/dist/src/showcase/premium/app-sidebar/mock.js +1 -1
- package/dist/src/showcase/premium/app-sidebar/showcase.cjs +1 -1
- package/dist/src/showcase/premium/app-sidebar/showcase.js +1 -1
- package/dist/src/showcase/premium/async-select/showcase.cjs +1 -1
- package/dist/src/showcase/premium/async-select/showcase.js +118 -74
- package/dist/src/showcase/premium/avatar/showcase.cjs +1 -1
- package/dist/src/showcase/premium/avatar/showcase.js +5 -5
- package/dist/src/showcase/premium/dialog/mock.cjs +6 -1
- package/dist/src/showcase/premium/dialog/mock.js +1 -1
- package/dist/src/showcase/premium/dialog/showcase.cjs +1 -1
- package/dist/src/showcase/premium/dialog/showcase.js +101 -39
- package/dist/src/showcase/premium/form-wrapper/mock.cjs +2 -2
- package/dist/src/showcase/premium/form-wrapper/mock.js +2 -2
- package/dist/src/showcase/premium/form-wrapper/showcase.cjs +1 -1
- package/dist/src/showcase/premium/form-wrapper/showcase.js +1 -1
- package/dist/src/showcase/premium/index.cjs +1 -1
- package/dist/src/showcase/premium/index.js +9 -3
- package/dist/src/showcase/premium/input/showcase.cjs +1 -1
- package/dist/src/showcase/premium/input/showcase.js +1 -1
- package/dist/src/showcase/premium/json-input/showcase.cjs +1 -1
- package/dist/src/showcase/premium/json-input/showcase.js +1 -1
- package/dist/src/showcase/premium/select/showcase.cjs +1 -1
- package/dist/src/showcase/premium/select/showcase.js +53 -0
- package/dist/src/showcase/premium/table/mock.cjs +1 -1
- package/dist/src/showcase/premium/table/mock.js +1 -1
- package/dist/src/showcase/premium/types.cjs +1 -1
- package/dist/src/showcase/premium/types.js +1 -1
- package/dist/src/showcase/premium/wizard/index.cjs +1 -0
- package/dist/src/showcase/premium/wizard/index.js +3 -0
- package/dist/src/showcase/premium/wizard/mock.cjs +25 -0
- package/dist/src/showcase/premium/wizard/mock.js +32 -0
- package/dist/src/showcase/premium/wizard/showcase.cjs +1 -0
- package/dist/src/showcase/premium/wizard/showcase.js +130 -0
- package/dist/src/showcase/preview-registry.cjs +1 -1
- package/dist/src/showcase/preview-registry.js +6 -6
- package/dist/src/showcase/registry-quality.cjs +1 -1
- package/dist/src/showcase/registry-quality.js +5 -0
- package/dist/src/showcase/registry-specific.cjs +1 -1
- package/dist/src/showcase/registry-specific.js +2 -2
- package/dist/src/showcase/render-registry-preview.cjs +1 -1
- package/dist/src/showcase/render-registry-preview.js +2 -2
- package/dist/src/showcase/site-data.cjs +1 -1
- package/dist/src/showcase/site-data.js +198 -44
- package/dist/src/showcase/tembro-registry.json.cjs +1 -1
- package/dist/src/showcase/tembro-registry.json.js +1 -1
- package/dist/src/showcase/types.cjs +1 -1
- package/dist/src/showcase/types.js +1 -1
- package/package.json +13 -9
- package/packages/cli/dist/index.cjs +127 -127
- package/packages/cli/vendor/src/components/layout/app-sidebar.tsx +31 -6
- package/packages/cli/vendor/src/components/theme-provider.tsx +1 -1
- package/packages/cli/vendor/src/components/ui/dialog/index.tsx +15 -3
- package/packages/cli/vendor/src/components/ui/select/index.tsx +17 -10
- package/packages/cli/vendor/src/showcase/component-api-schema.ts +269 -39
- package/packages/cli/vendor/src/showcase/demo-snippets/forms/index.ts +1 -1
- package/packages/cli/vendor/src/showcase/fallback.tsx +202 -39
- package/packages/cli/vendor/src/showcase/index.ts +6 -6
- package/packages/cli/vendor/src/showcase/package-meta.ts +3 -3
- package/packages/cli/vendor/src/showcase/premium/app-sidebar/mock.ts +3 -2
- package/packages/cli/vendor/src/showcase/premium/app-sidebar/showcase.tsx +1 -1
- package/packages/cli/vendor/src/showcase/premium/async-select/showcase.tsx +50 -4
- package/packages/cli/vendor/src/showcase/premium/avatar/showcase.tsx +5 -5
- package/packages/cli/vendor/src/showcase/premium/dialog/mock.ts +6 -1
- package/packages/cli/vendor/src/showcase/premium/dialog/showcase.tsx +53 -1
- package/packages/cli/vendor/src/showcase/premium/form-wrapper/mock.ts +2 -2
- package/packages/cli/vendor/src/showcase/premium/form-wrapper/showcase.tsx +1 -1
- package/packages/cli/vendor/src/showcase/premium/index.ts +5 -3
- package/packages/cli/vendor/src/showcase/premium/input/showcase.tsx +1 -1
- package/packages/cli/vendor/src/showcase/premium/json-input/showcase.tsx +1 -1
- package/packages/cli/vendor/src/showcase/premium/select/showcase.tsx +38 -0
- package/packages/cli/vendor/src/showcase/premium/table/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/types.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/wizard/index.ts +2 -0
- package/packages/cli/vendor/src/showcase/premium/wizard/mock.ts +41 -0
- package/packages/cli/vendor/src/showcase/premium/wizard/showcase.tsx +88 -0
- package/packages/cli/vendor/src/showcase/preview-registry.tsx +6 -6
- package/packages/cli/vendor/src/showcase/registry-quality.ts +5 -0
- package/packages/cli/vendor/src/showcase/registry-specific.tsx +2 -2
- package/packages/cli/vendor/src/showcase/render-registry-preview.tsx +2 -2
- package/packages/cli/vendor/src/showcase/site-data.tsx +89 -32
- package/packages/cli/vendor/src/showcase/tembro-registry.json +1 -1
- package/packages/cli/vendor/src/showcase/types.ts +1 -1
- package/registry.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../components/actions/demo.cjs"),t=require("../components/calendar/demo.cjs"),n=require("../components/data-table/demo.cjs"),r=require("../components/display/demo.cjs"),i=require("../components/feedback/demo.cjs"),a=require("../components/filters/demo.cjs"),o=require("../components/form/demo.cjs"),s=require("../components/inputs/demo.cjs"),c=require("../components/layout/demo.cjs"),l=require("../components/navigation/demo.cjs"),u=require("../components/overlay/demo.cjs"),d=require("../components/patterns/demo.cjs"),f=require("../components/upload/demo.cjs"),p=require("../components/wizard/demo.cjs"),m=require("./component-api-schema.cjs"),h=require("./fallback.cjs"),g=require("./premium/types.cjs"),_=require("./premium/index.cjs"),v=require("./registry-quality.cjs"),y=require("./registry-specific.cjs"),b=require("./package-meta.cjs"),x=require("./site-data.cjs"),S=require("./supplemental.cjs"),C=require("./types.cjs"),w=require("./preview-catalog.cjs"),T=require("./preview-registry.cjs"),E=require("./search-utils.cjs");var D={...e.actionsShowcaseDemoRegistry,...t.calendarShowcaseDemoRegistry,...n.dataTableShowcaseDemoRegistry,...r.displayShowcaseDemoRegistry,...i.feedbackShowcaseDemoRegistry,...a.filtersShowcaseDemoRegistry,...o.formShowcaseDemoRegistry,...s.inputsShowcaseDemoRegistry,...c.layoutShowcaseDemoRegistry,...l.navigationShowcaseDemoRegistry,...u.overlayShowcaseDemoRegistry,...d.patternsShowcaseDemoRegistry,...f.uploadShowcaseDemoRegistry,...p.wizardShowcaseDemoRegistry,...y.registrySpecificDemoRegistry,...S.supplementalShowcaseDemoRegistry,..._.premiumShowcaseDemoRegistry
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../components/actions/demo.cjs"),t=require("../components/calendar/demo.cjs"),n=require("../components/data-table/demo.cjs"),r=require("../components/display/demo.cjs"),i=require("../components/feedback/demo.cjs"),a=require("../components/filters/demo.cjs"),o=require("../components/form/demo.cjs"),s=require("../components/inputs/demo.cjs"),c=require("../components/layout/demo.cjs"),l=require("../components/navigation/demo.cjs"),u=require("../components/overlay/demo.cjs"),d=require("../components/patterns/demo.cjs"),f=require("../components/upload/demo.cjs"),p=require("../components/wizard/demo.cjs"),m=require("./component-api-schema.cjs"),h=require("./fallback.cjs"),g=require("./premium/types.cjs"),_=require("./premium/index.cjs"),v=require("./registry-quality.cjs"),y=require("./registry-specific.cjs"),b=require("./package-meta.cjs"),x=require("./site-data.cjs"),S=require("./supplemental.cjs"),C=require("./types.cjs"),w=require("./preview-catalog.cjs"),T=require("./preview-registry.cjs"),E=require("./search-utils.cjs");var D={...e.actionsShowcaseDemoRegistry,...t.calendarShowcaseDemoRegistry,...n.dataTableShowcaseDemoRegistry,...r.displayShowcaseDemoRegistry,...i.feedbackShowcaseDemoRegistry,...a.filtersShowcaseDemoRegistry,...o.formShowcaseDemoRegistry,...s.inputsShowcaseDemoRegistry,...c.layoutShowcaseDemoRegistry,...l.navigationShowcaseDemoRegistry,...u.overlayShowcaseDemoRegistry,...d.patternsShowcaseDemoRegistry,...f.uploadShowcaseDemoRegistry,...p.wizardShowcaseDemoRegistry,...y.registrySpecificDemoRegistry,...S.supplementalShowcaseDemoRegistry,...v.registryQualityDemoRegistry,..._.premiumShowcaseDemoRegistry},O=D;exports.CLI_ADD_COMMAND=x.CLI_ADD_COMMAND,exports.CLI_INIT_NEXT_COMMAND=x.CLI_INIT_NEXT_COMMAND,exports.CLI_INIT_VITE_COMMAND=x.CLI_INIT_VITE_COMMAND,exports.CLI_INSTALL_COMMAND=x.CLI_INSTALL_COMMAND,exports.CLI_PACKAGE_NAME=x.CLI_PACKAGE_NAME,exports.CLI_THEME_COMMAND=x.CLI_THEME_COMMAND,exports.DOCS_APP_NAME=x.DOCS_APP_NAME,exports.DOCS_RELEASES_URL=x.DOCS_RELEASES_URL,exports.DOCS_REPO_URL=x.DOCS_REPO_URL,exports.DOCS_ROOT_PATH=x.DOCS_ROOT_PATH,exports.PACKAGE_DEPENDENCY_RANGE=b.PACKAGE_DEPENDENCY_RANGE,exports.PACKAGE_GITHUB_RELEASES_URL=x.PACKAGE_GITHUB_RELEASES_URL,exports.PACKAGE_GITHUB_URL=x.PACKAGE_GITHUB_URL,exports.PACKAGE_IMPORT=x.PACKAGE_IMPORT,exports.PACKAGE_INSTALL_COMMAND=x.PACKAGE_INSTALL_COMMAND,exports.PACKAGE_LATEST_RELEASE_DATE=b.PACKAGE_LATEST_RELEASE_DATE,exports.PACKAGE_LATEST_VERSION=b.PACKAGE_LATEST_VERSION,exports.PACKAGE_NAME=x.PACKAGE_NAME,exports.PACKAGE_NPM_URL=x.PACKAGE_NPM_URL,exports.PACKAGE_RELEASES_URL=x.PACKAGE_RELEASES_URL,exports.PACKAGE_RELEASE_DATE=x.PACKAGE_RELEASE_DATE,exports.PACKAGE_VERSION=x.PACKAGE_VERSION,exports.accessibilityChecks=x.accessibilityChecks,exports.blockCards=x.blockCards,exports.blockCoverageSections=x.blockCoverageSections,exports.blockLayoutFilters=x.blockLayoutFilters,exports.blockPath=x.blockPath,exports.blockSortOptions=x.blockSortOptions,exports.blockTabs=x.blockTabs,exports.blockThemeFilters=x.blockThemeFilters,exports.componentApiSchemas=m.componentApiSchemas,exports.componentCatalog=x.componentCatalog,exports.componentDemoRegistry=O,exports.componentDocsPath=x.componentDocsPath,exports.componentExportPath=x.componentExportPath,exports.componentExportSlug=x.componentExportSlug,exports.componentGroupMeta=x.componentGroupMeta,exports.componentGroupOrder=x.componentGroupOrder,exports.componentModuleCatalog=x.componentModuleCatalog,exports.componentModulePath=x.componentModulePath,exports.componentPlaygroundPath=x.componentPlaygroundPath,exports.componentRelations=x.componentRelations,exports.createGenericShowcaseDemo=h.createGenericShowcaseDemo,exports.defaultComponentDemoState=g.defaultComponentDemoState,exports.defaultShowcaseDemoState=C.defaultShowcaseDemoState,exports.docsSidebar=x.docsSidebar,exports.exampleCards=x.exampleCards,exports.featuredBlock=x.featuredBlock,exports.getComponentApiSchema=m.getComponentApiSchema,exports.getComponentDetailSidebarItems=x.getComponentDetailSidebarItems,exports.getComponentDetailSidebarSections=x.getComponentDetailSidebarSections,exports.getComponentGroup=x.getComponentGroup,exports.getComponentGroupDetails=x.getComponentGroupDetails,exports.getComponentPreview=T.getComponentPreview,exports.getComponentSurfaceCatalogItem=x.getComponentSurfaceCatalogItem,exports.getComponentSurfaceSections=x.getComponentSurfaceSections,exports.getDocumentedMemberByComponent=x.getDocumentedMemberByComponent,exports.getDocumentedMembersByComponents=x.getDocumentedMembersByComponents,exports.getPreviewSurface=w.getPreviewSurface,exports.getPrimaryComponentCatalog=x.getPrimaryComponentCatalog,exports.getPrimaryComponentMemberInventory=x.getPrimaryComponentMemberInventory,exports.getPrimaryComponentSurfaceSlug=x.getPrimaryComponentSurfaceSlug,exports.getPrimaryComponentSurfaceTitle=x.getPrimaryComponentSurfaceTitle,exports.getSearchItemByHref=E.getSearchItemByHref,exports.getVisibleComponentCatalog=x.getVisibleComponentCatalog,exports.getVisibleSearchItems=E.getVisibleSearchItems,exports.globalSearchItems=x.globalSearchItems,exports.inspectorChecks=x.inspectorChecks,exports.installCommand=x.installCommand,exports.isAdvancedSearchItem=E.isAdvancedSearchItem,exports.isPrimaryComponentSurface=x.isPrimaryComponentSurface,exports.playgroundSidebar=x.playgroundSidebar,exports.premiumShowcaseDemoRegistry=_.premiumShowcaseDemoRegistry,exports.previewBlockRegistry=T.previewBlockRegistry,exports.previewSurfaceCatalog=w.previewSurfaceCatalog,exports.primaryNav=x.primaryNav,exports.propRows=x.propRows,exports.registryQualityDemoRegistry=v.registryQualityDemoRegistry,exports.registrySpecificDemoRegistry=y.registrySpecificDemoRegistry,exports.releaseHistory=x.releaseHistory,exports.scoreSearchItem=E.scoreSearchItem,exports.searchGroupLabel=E.searchGroupLabel,exports.searchGroupOrder=E.searchGroupOrder,exports.searchItemKindLabel=E.searchItemKindLabel,exports.showcaseDemoRegistry=D,exports.supplementalShowcaseDemoRegistry=S.supplementalShowcaseDemoRegistry,exports.supplementalShowcaseDemoSlugs=S.supplementalShowcaseDemoSlugs,exports.templatePath=x.templatePath,exports.tocItems=x.tocItems;
|
|
@@ -43,8 +43,8 @@ var $ = {
|
|
|
43
43
|
...u,
|
|
44
44
|
..._,
|
|
45
45
|
...Q,
|
|
46
|
-
...
|
|
47
|
-
...
|
|
46
|
+
...g,
|
|
47
|
+
...h
|
|
48
48
|
}, Je = $;
|
|
49
49
|
//#endregion
|
|
50
50
|
export { x as CLI_ADD_COMMAND, S as CLI_INIT_NEXT_COMMAND, C as CLI_INIT_VITE_COMMAND, w as CLI_INSTALL_COMMAND, T as CLI_PACKAGE_NAME, E as CLI_THEME_COMMAND, D as DOCS_APP_NAME, O as DOCS_RELEASES_URL, k as DOCS_REPO_URL, A as DOCS_ROOT_PATH, v as PACKAGE_DEPENDENCY_RANGE, j as PACKAGE_GITHUB_RELEASES_URL, M as PACKAGE_GITHUB_URL, N as PACKAGE_IMPORT, P as PACKAGE_INSTALL_COMMAND, y as PACKAGE_LATEST_RELEASE_DATE, b as PACKAGE_LATEST_VERSION, F as PACKAGE_NAME, I as PACKAGE_NPM_URL, L as PACKAGE_RELEASES_URL, R as PACKAGE_RELEASE_DATE, z as PACKAGE_VERSION, B as accessibilityChecks, V as blockCards, H as blockCoverageSections, U as blockLayoutFilters, W as blockPath, G as blockSortOptions, K as blockTabs, q as blockThemeFilters, d as componentApiSchemas, J as componentCatalog, Je as componentDemoRegistry, Y as componentDocsPath, X as componentExportPath, Z as componentExportSlug, re as componentGroupMeta, ie as componentGroupOrder, ae as componentModuleCatalog, oe as componentModulePath, se as componentPlaygroundPath, ce as componentRelations, p as createGenericShowcaseDemo, m as defaultComponentDemoState, Ie as defaultShowcaseDemoState, le as docsSidebar, ue as exampleCards, de as featuredBlock, f as getComponentApiSchema, fe as getComponentDetailSidebarItems, pe as getComponentDetailSidebarSections, me as getComponentGroup, he as getComponentGroupDetails, ze as getComponentPreview, ge as getComponentSurfaceCatalogItem, _e as getComponentSurfaceSections, ve as getDocumentedMemberByComponent, ye as getDocumentedMembersByComponents, Le as getPreviewSurface, be as getPrimaryComponentCatalog, xe as getPrimaryComponentMemberInventory, Se as getPrimaryComponentSurfaceSlug, Ce as getPrimaryComponentSurfaceTitle, Ve as getSearchItemByHref, we as getVisibleComponentCatalog, He as getVisibleSearchItems, Te as globalSearchItems, Ee as inspectorChecks, De as installCommand, Ue as isAdvancedSearchItem, Oe as isPrimaryComponentSurface, ke as playgroundSidebar, h as premiumShowcaseDemoRegistry, Be as previewBlockRegistry, Re as previewSurfaceCatalog, Ae as primaryNav, je as propRows, g as registryQualityDemoRegistry, _ as registrySpecificDemoRegistry, Me as releaseHistory, We as scoreSearchItem, Ge as searchGroupLabel, Ke as searchGroupOrder, qe as searchItemKindLabel, $ as showcaseDemoRegistry, Q as supplementalShowcaseDemoRegistry, Fe as supplementalShowcaseDemoSlugs, Ne as templatePath, Pe as tocItems };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`3.1.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`3.1.7`,t=`July 15, 2026`,n=e;exports.PACKAGE_DEPENDENCY_RANGE=n,exports.PACKAGE_LATEST_RELEASE_DATE=t,exports.PACKAGE_LATEST_VERSION=e;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e={code:`import {
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e={code:`import { Link } from "react-router-dom"
|
|
2
|
+
import { Sidebar } from "tembro"
|
|
2
3
|
|
|
3
4
|
const items = [
|
|
4
5
|
{ key: "overview", label: "Overview", href: "/overview", active: true, sectionLabel: "Workspace" },
|
|
@@ -26,7 +27,7 @@ export function Example() {
|
|
|
26
27
|
showSectionLabels
|
|
27
28
|
responsive
|
|
28
29
|
renderLink={({ item: _item, href = "/", ...props }) => (
|
|
29
|
-
<
|
|
30
|
+
<Link {...props} to={href} />
|
|
30
31
|
)}
|
|
31
32
|
header={<div className="px-3 py-2 text-sm font-semibold">Azamat Workspace</div>}
|
|
32
33
|
footerAccount={{ label: "Azamat Workspace", description: "Starter plan", avatar: "AW" }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/showcase/premium/app-sidebar/mock.ts
|
|
2
2
|
var e = {
|
|
3
|
-
code: "import { Sidebar } from \"tembro\"\n\nconst items = [\n { key: \"overview\", label: \"Overview\", href: \"/overview\", active: true, sectionLabel: \"Workspace\" },\n {\n key: \"customers\",\n label: \"Customers\",\n badge: \"12\",\n defaultExpanded: true,\n items: [\n { key: \"active\", label: \"Active\", href: \"/customers/active\" },\n { key: \"archived\", label: \"Archived\", href: \"/customers/archived\" },\n ],\n },\n { key: \"billing\", label: \"Billing\", href: \"/billing\", sectionLabel: \"Manage\" },\n { key: \"settings\", label: \"Settings\", href: \"/settings\", disabled: true },\n]\n\nexport function Example() {\n return (\n <Sidebar\n items={items}\n navigationLabel=\"Workspace navigation\"\n itemSize=\"md\"\n activeIndicator=\"bar\"\n showSectionLabels\n responsive\n renderLink={({ item: _item, href = \"/\", ...props }) => (\n <
|
|
3
|
+
code: "import { Link } from \"react-router-dom\"\nimport { Sidebar } from \"tembro\"\n\nconst items = [\n { key: \"overview\", label: \"Overview\", href: \"/overview\", active: true, sectionLabel: \"Workspace\" },\n {\n key: \"customers\",\n label: \"Customers\",\n badge: \"12\",\n defaultExpanded: true,\n items: [\n { key: \"active\", label: \"Active\", href: \"/customers/active\" },\n { key: \"archived\", label: \"Archived\", href: \"/customers/archived\" },\n ],\n },\n { key: \"billing\", label: \"Billing\", href: \"/billing\", sectionLabel: \"Manage\" },\n { key: \"settings\", label: \"Settings\", href: \"/settings\", disabled: true },\n]\n\nexport function Example() {\n return (\n <Sidebar\n items={items}\n navigationLabel=\"Workspace navigation\"\n itemSize=\"md\"\n activeIndicator=\"bar\"\n showSectionLabels\n responsive\n renderLink={({ item: _item, href = \"/\", ...props }) => (\n <Link {...props} to={href} />\n )}\n header={<div className=\"px-3 py-2 text-sm font-semibold\">Azamat Workspace</div>}\n footerAccount={{ label: \"Azamat Workspace\", description: \"Starter plan\", avatar: \"AW\" }}\n secondaryActions={[{ key: \"support\", label: \"Support\", href: \"/support\" }]}\n onItemSelect={(item) => console.log(item.key)}\n />\n )\n}",
|
|
4
4
|
highlights: [
|
|
5
5
|
"Nested and collapsible route groups",
|
|
6
6
|
"Three density modes",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs"),n=require("../../../components/ui/button/index.cjs"),r=require("../../../components/ui/badge/index.cjs"),i=require("../../../components/layout/app-sidebar.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("lucide-react"),s=require("react/jsx-runtime");var c=[{key:`overview`,label:`Overview`,href:`/overview`,icon:(0,s.jsx)(o.HomeIcon,{className:`size-4`}),sectionLabel:`Core`},{key:`projects`,label:`Projects`,icon:(0,s.jsx)(o.FolderIcon,{className:`size-4`}),badge:`8`,defaultExpanded:!0,items:[{key:`active-projects`,label:`Active projects`,href:`/components/app-sidebar?view=active`},{key:`archived-projects`,label:`Archived`,href:`/components/app-sidebar?view=archived`,badge:`3`}]},{key:`reports`,label:`Reports`,href:`/reports`,icon:(0,s.jsx)(o.BarChart3Icon,{className:`size-4`}),sectionLabel:`Insights`},{key:`billing`,label:`Billing`,href:`/billing`,icon:(0,s.jsx)(o.CreditCardIcon,{className:`size-4`}),badge:`2`},{key:`settings`,label:`Settings`,href:`/settings`,icon:(0,s.jsx)(o.SettingsIcon,{className:`size-4`}),disabled:!0}],l=`rounded-[22px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg)] p-5`;function u({mode:e}){let[u,d]=a.useState(`overview`),[f,p]=a.useState(e===`playground`),[m,h]=a.useState(`desktop`),[g,_]=a.useState(!0),[v,y]=a.useState(`md`),[b,x]=a.useState(`bar`),[S,C]=a.useState(0),w=a.useMemo(()=>c.map(e=>({...e,active:e.key===u,onSelect:()=>d(e.key)})),[u]),T=c.find(e=>e.key===u),E=m===`mobile`;return(0,s.jsxs)(`div`,{className:`space-y-5`,children:[(0,s.jsx)(`section`,{className:`rounded-[24px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg)] p-5 sm:p-6`,children:(0,s.jsxs)(`div`,{className:`flex flex-col gap-6 xl:flex-row xl:items-start xl:justify-between`,children:[(0,s.jsxs)(`div`,{className:`max-w-xl`,children:[(0,s.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.26em] aui-text-muted`,children:`Navigation shell`}),(0,s.jsx)(`h3`,{className:`mt-3 text-2xl font-semibold tracking-tight aui-text-strong`,children:`Sidebar should feel install-ready on its own`}),(0,s.jsx)(`p`,{className:`mt-3 max-w-lg text-sm leading-6 aui-text-muted`,children:`This preview keeps the focus on one reusable sidebar surface: identity, route items, badges, disabled states and collapsed behavior.`})]}),(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,s.jsx)(r.Badge,{variant:`outline`,className:`rounded-full`,children:`Header slot`}),(0,s.jsx)(r.Badge,{variant:`outline`,className:`rounded-full`,children:`Badges`}),(0,s.jsx)(r.Badge,{variant:`outline`,className:`rounded-full`,children:`Mobile drawer`})]})]})}),e===`playground`?(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,s.jsx)(n.Button,{size:`sm`,variant:f?`outline`:`default`,onClick:()=>p(e=>!e),children:f?`Expand sidebar`:`Collapse sidebar`}),(0,s.jsx)(n.Button,{size:`sm`,variant:`outline`,onClick:()=>d(`reports`),children:`Jump to reports`}),(0,s.jsx)(n.Button,{size:`sm`,variant:E?`default`:`outline`,onClick:()=>h(`mobile`),children:`Mobile drawer`}),(0,s.jsx)(n.Button,{size:`sm`,variant:E?`outline`:`default`,onClick:()=>h(`desktop`),children:`Desktop rail`})]}):null,(0,s.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[320px_minmax(0,1fr)]`,children:[(0,s.jsx)(`section`,{className:t.cn(l,E&&`mx-auto w-full max-w-[420px]`),children:(0,s.jsx)(i.Sidebar,{collapsed:f,items:w,showSectionLabels:g,itemSize:v,activeIndicator:b,renderLink:({item:e,href:t=`/components/app-sidebar`,...n})=>(0,s.jsx)(`a`,{...n,href:t}),secondaryActions:[{key:`support`,label:`Support`,icon:(0,s.jsx)(o.LifeBuoyIcon,{className:`size-4`}),onSelect:()=>d(`reports`)}],railItems:[{key:`members`,label:`Members`,icon:(0,s.jsx)(o.UsersIcon,{className:`size-4`}),onSelect:()=>d(`projects`)}],footerAccount:{label:`Azamat Workspace`,description:S?`Account opened ${S}x`:`Starter plan`,avatar:`AW`,onSelect:()=>C(e=>e+1)},responsive:!0,mobileBreakpoint:E?1e4:0,mobileTitle:`Workspace navigation`,mobileDescription:`Open routes, check badges, and move between sections from one compact drawer.`,mobileToggleLabel:`Open workspace menu`,header:(0,s.jsx)(`div`,{className:`px-3 py-2 text-sm font-semibold`,children:`Azamat Workspace`}),footer:(0,s.jsx)(`div`,{className:`aui-text-muted px-3 py-2 text-xs`,children:`Starter plan • 3 editors`}),footerClassName:`bg-[color:var(--aui-page-bg-alt)]/55`,className:`min-h-[440px] rounded-[22px] border border-[color:var(--aui-surface-border)] bg-[color:var(--aui-surface)]`})}),(0,s.jsxs)(`section`,{className:l,children:[(0,s.jsx)(`p`,{className:`text-sm font-medium aui-text-muted`,children:`Current route`}),(0,s.jsx)(`p`,{className:`mt-3 text-2xl font-semibold tracking-tight aui-text-strong`,children:T?.label??`Overview`}),(0,s.jsx)(`p`,{className:`mt-2 max-w-xl text-sm leading-6 aui-text-muted`,children:`Start with the sidebar itself as a stable navigation contract. Only after this feels right should the app introduce a bigger shell, page header, or route-level statistics around it.`}),(0,s.jsxs)(`div`,{className:`mt-6 grid gap-3 sm:grid-cols-3`,children:[(0,s.jsxs)(`div`,{className:`rounded-[20px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3`,children:[(0,s.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.24em] aui-text-muted`,children:`Shell`}),(0,s.jsx)(`p`,{className:`mt-2 text-lg font-semibold aui-text-strong`,children:E?`Mobile drawer`:f?`Collapsed`:`Expanded`})]}),(0,s.jsxs)(`div`,{className:`rounded-[20px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3`,children:[(0,s.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.24em] aui-text-muted`,children:`Visible items`}),(0,s.jsx)(`p`,{className:`mt-2 text-lg font-semibold aui-text-strong`,children:w.length})]}),(0,s.jsxs)(`div`,{className:`rounded-[20px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3`,children:[(0,s.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.24em] aui-text-muted`,children:`Disabled`}),(0,s.jsx)(`p`,{className:`mt-2 text-lg font-semibold aui-text-strong`,children:`1 route`})]})]}),e===`playground`?(0,s.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,s.jsx)(n.Button,{size:`sm`,variant:g?`default`:`outline`,onClick:()=>_(e=>!e),children:g?`Hide section labels`:`Show section labels`}),(0,s.jsx)(n.Button,{size:`sm`,variant:v===`sm`?`default`:`outline`,onClick:()=>y(`sm`),children:`Compact`}),(0,s.jsx)(n.Button,{size:`sm`,variant:v===`md`?`default`:`outline`,onClick:()=>y(`md`),children:`Default`}),(0,s.jsx)(n.Button,{size:`sm`,variant:v===`lg`?`default`:`outline`,onClick:()=>y(`lg`),children:`Comfortable`}),(0,s.jsx)(n.Button,{size:`sm`,variant:b===`bar`?`default`:`outline`,onClick:()=>x(`bar`),children:`Bar active`}),(0,s.jsx)(n.Button,{size:`sm`,variant:b===`pill`?`default`:`outline`,onClick:()=>x(`pill`),children:`Pill active`}),(0,s.jsx)(n.Button,{size:`sm`,variant:b===`none`?`default`:`outline`,onClick:()=>x(`none`),children:`Minimal active`})]}):null]})]})]})}exports.AppSidebarShowcase=u;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs"),n=require("../../../components/ui/button/index.cjs"),r=require("../../../components/ui/badge/index.cjs"),i=require("../../../components/layout/app-sidebar.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("lucide-react"),s=require("react/jsx-runtime");var c=[{key:`overview`,label:`Overview`,href:`/overview`,icon:(0,s.jsx)(o.HomeIcon,{className:`size-4`}),sectionLabel:`Core`},{key:`projects`,label:`Projects`,icon:(0,s.jsx)(o.FolderIcon,{className:`size-4`}),badge:`8`,defaultExpanded:!0,items:[{key:`active-projects`,label:`Active projects`,href:`/components/app-sidebar?view=active`},{key:`archived-projects`,label:`Archived`,href:`/components/app-sidebar?view=archived`,badge:`3`}]},{key:`reports`,label:`Reports`,href:`/reports`,icon:(0,s.jsx)(o.BarChart3Icon,{className:`size-4`}),sectionLabel:`Insights`},{key:`billing`,label:`Billing`,href:`/billing`,icon:(0,s.jsx)(o.CreditCardIcon,{className:`size-4`}),badge:`2`},{key:`settings`,label:`Settings`,href:`/settings`,icon:(0,s.jsx)(o.SettingsIcon,{className:`size-4`}),disabled:!0}],l=`rounded-[22px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg)] p-5`;function u({mode:e}){let[u,d]=a.useState(`overview`),[f,p]=a.useState(e===`playground`),[m,h]=a.useState(`desktop`),[g,_]=a.useState(!0),[v,y]=a.useState(`md`),[b,x]=a.useState(`bar`),[S,C]=a.useState(0),w=a.useMemo(()=>c.map(e=>({...e,active:e.key===u,onSelect:()=>d(e.key)})),[u]),T=c.find(e=>e.key===u),E=m===`mobile`;return(0,s.jsxs)(`div`,{className:`space-y-5`,children:[(0,s.jsx)(`section`,{className:`rounded-[24px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg)] p-5 sm:p-6`,children:(0,s.jsxs)(`div`,{className:`flex flex-col gap-6 xl:flex-row xl:items-start xl:justify-between`,children:[(0,s.jsxs)(`div`,{className:`max-w-xl`,children:[(0,s.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.26em] aui-text-muted`,children:`Navigation shell`}),(0,s.jsx)(`h3`,{className:`mt-3 text-2xl font-semibold tracking-tight aui-text-strong`,children:`Sidebar should feel install-ready on its own`}),(0,s.jsx)(`p`,{className:`mt-3 max-w-lg text-sm leading-6 aui-text-muted`,children:`This preview keeps the focus on one reusable sidebar surface: identity, route items, badges, disabled states, section labels, active indicators and collapsed behavior.`})]}),(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,s.jsx)(r.Badge,{variant:`outline`,className:`rounded-full`,children:`Header slot`}),(0,s.jsx)(r.Badge,{variant:`outline`,className:`rounded-full`,children:`Badges`}),(0,s.jsx)(r.Badge,{variant:`outline`,className:`rounded-full`,children:`Mobile drawer`})]})]})}),e===`playground`?(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,s.jsx)(n.Button,{size:`sm`,variant:f?`outline`:`default`,onClick:()=>p(e=>!e),children:f?`Expand sidebar`:`Collapse sidebar`}),(0,s.jsx)(n.Button,{size:`sm`,variant:`outline`,onClick:()=>d(`reports`),children:`Jump to reports`}),(0,s.jsx)(n.Button,{size:`sm`,variant:E?`default`:`outline`,onClick:()=>h(`mobile`),children:`Mobile drawer`}),(0,s.jsx)(n.Button,{size:`sm`,variant:E?`outline`:`default`,onClick:()=>h(`desktop`),children:`Desktop rail`})]}):null,(0,s.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[320px_minmax(0,1fr)]`,children:[(0,s.jsx)(`section`,{className:t.cn(l,E&&`mx-auto w-full max-w-[420px]`),children:(0,s.jsx)(i.Sidebar,{collapsed:f,items:w,showSectionLabels:g,itemSize:v,activeIndicator:b,renderLink:({item:e,href:t=`/components/app-sidebar`,...n})=>(0,s.jsx)(`a`,{...n,href:t}),secondaryActions:[{key:`support`,label:`Support`,icon:(0,s.jsx)(o.LifeBuoyIcon,{className:`size-4`}),onSelect:()=>d(`reports`)}],railItems:[{key:`members`,label:`Members`,icon:(0,s.jsx)(o.UsersIcon,{className:`size-4`}),onSelect:()=>d(`projects`)}],footerAccount:{label:`Azamat Workspace`,description:S?`Account opened ${S}x`:`Starter plan`,avatar:`AW`,onSelect:()=>C(e=>e+1)},responsive:!0,mobileBreakpoint:E?1e4:0,mobileTitle:`Workspace navigation`,mobileDescription:`Open routes, check badges, and move between sections from one compact drawer.`,mobileToggleLabel:`Open workspace menu`,header:(0,s.jsx)(`div`,{className:`px-3 py-2 text-sm font-semibold`,children:`Azamat Workspace`}),footer:(0,s.jsx)(`div`,{className:`aui-text-muted px-3 py-2 text-xs`,children:`Starter plan • 3 editors`}),footerClassName:`bg-[color:var(--aui-page-bg-alt)]/55`,className:`min-h-[440px] rounded-[22px] border border-[color:var(--aui-surface-border)] bg-[color:var(--aui-surface)]`})}),(0,s.jsxs)(`section`,{className:l,children:[(0,s.jsx)(`p`,{className:`text-sm font-medium aui-text-muted`,children:`Current route`}),(0,s.jsx)(`p`,{className:`mt-3 text-2xl font-semibold tracking-tight aui-text-strong`,children:T?.label??`Overview`}),(0,s.jsx)(`p`,{className:`mt-2 max-w-xl text-sm leading-6 aui-text-muted`,children:`Start with the sidebar itself as a stable navigation contract. Only after this feels right should the app introduce a bigger shell, page header, or route-level statistics around it.`}),(0,s.jsxs)(`div`,{className:`mt-6 grid gap-3 sm:grid-cols-3`,children:[(0,s.jsxs)(`div`,{className:`rounded-[20px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3`,children:[(0,s.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.24em] aui-text-muted`,children:`Shell`}),(0,s.jsx)(`p`,{className:`mt-2 text-lg font-semibold aui-text-strong`,children:E?`Mobile drawer`:f?`Collapsed`:`Expanded`})]}),(0,s.jsxs)(`div`,{className:`rounded-[20px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3`,children:[(0,s.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.24em] aui-text-muted`,children:`Visible items`}),(0,s.jsx)(`p`,{className:`mt-2 text-lg font-semibold aui-text-strong`,children:w.length})]}),(0,s.jsxs)(`div`,{className:`rounded-[20px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3`,children:[(0,s.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.24em] aui-text-muted`,children:`Disabled`}),(0,s.jsx)(`p`,{className:`mt-2 text-lg font-semibold aui-text-strong`,children:`1 route`})]})]}),e===`playground`?(0,s.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,s.jsx)(n.Button,{size:`sm`,variant:g?`default`:`outline`,onClick:()=>_(e=>!e),children:g?`Hide section labels`:`Show section labels`}),(0,s.jsx)(n.Button,{size:`sm`,variant:v===`sm`?`default`:`outline`,onClick:()=>y(`sm`),children:`Compact`}),(0,s.jsx)(n.Button,{size:`sm`,variant:v===`md`?`default`:`outline`,onClick:()=>y(`md`),children:`Default`}),(0,s.jsx)(n.Button,{size:`sm`,variant:v===`lg`?`default`:`outline`,onClick:()=>y(`lg`),children:`Comfortable`}),(0,s.jsx)(n.Button,{size:`sm`,variant:b===`bar`?`default`:`outline`,onClick:()=>x(`bar`),children:`Bar active`}),(0,s.jsx)(n.Button,{size:`sm`,variant:b===`pill`?`default`:`outline`,onClick:()=>x(`pill`),children:`Pill active`}),(0,s.jsx)(n.Button,{size:`sm`,variant:b===`none`?`default`:`outline`,onClick:()=>x(`none`),children:`Minimal active`})]}):null]})]})]})}exports.AppSidebarShowcase=u;
|
|
@@ -79,7 +79,7 @@ function g({ mode: a }) {
|
|
|
79
79
|
}),
|
|
80
80
|
/* @__PURE__ */ f("p", {
|
|
81
81
|
className: "mt-3 max-w-lg text-sm leading-6 aui-text-muted",
|
|
82
|
-
children: "This preview keeps the focus on one reusable sidebar surface: identity, route items, badges, disabled states and collapsed behavior."
|
|
82
|
+
children: "This preview keeps the focus on one reusable sidebar surface: identity, route items, badges, disabled states, section labels, active indicators and collapsed behavior."
|
|
83
83
|
})
|
|
84
84
|
]
|
|
85
85
|
}), /* @__PURE__ */ p("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../components/ui/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../components/ui/button/index.cjs"),t=require("../../../components/ui/badge/index.cjs"),n=require("../../../components/inputs/async-select.cjs"),r=require("../../component-route-data.cjs");let i=require("react"),a=require("react/jsx-runtime");var o=r.routeWorkspaceOptions,s=`rounded-[22px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg)] p-5`,c=async e=>{await new Promise(e=>setTimeout(e,260));let t=e.trim().toLowerCase();if(t===`error`)throw Error(`Unable to load regions`);return t?o.filter(e=>String(e.label??``).toLowerCase().includes(t)):o},l=async e=>(await new Promise(e=>setTimeout(e,120)),o.find(t=>t.value===e)??null),u=async e=>(await new Promise(e=>setTimeout(e,120)),o.filter(t=>e.includes(String(t.value)))),d=async e=>(await new Promise(e=>setTimeout(e,180)),{value:e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)||`custom-region`,label:e.trim(),description:`Created from the current search query`});function f(){let[f,p]=(0,i.useState)(``),[m,h]=(0,i.useState)([`north`,`west`]),g=r.routeWorkspaceOptions.find(e=>e.value===f),_=r.routeWorkspaceOptions.filter(e=>m.includes(String(e.value)));return(0,a.jsx)(`div`,{className:`space-y-5`,children:(0,a.jsxs)(`section`,{className:`rounded-[24px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg)] p-5 sm:p-6`,children:[(0,a.jsxs)(`div`,{className:`flex flex-col gap-6 xl:flex-row xl:items-start xl:justify-between`,children:[(0,a.jsxs)(`div`,{className:`max-w-xl`,children:[(0,a.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.26em] aui-text-muted`,children:`Remote selection`}),(0,a.jsx)(`h3`,{className:`mt-3 text-2xl font-semibold tracking-tight aui-text-strong`,children:`AsyncSelect is the remote member of the Select family`}),(0,a.jsx)(`p`,{className:`mt-3 max-w-lg text-sm leading-6 aui-text-muted`,children:`Use AsyncSelect only when the main Select flow is not enough because the option set is large, remote, or hydration-aware.`})]}),(0,a.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,a.jsx)(t.Badge,{variant:`outline`,className:`rounded-full`,children:`Async`}),(0,a.jsx)(t.Badge,{variant:`outline`,className:`rounded-full`,children:`Search`}),(0,a.jsx)(t.Badge,{variant:`outline`,className:`rounded-full`,children:`Clearable`})]})]}),(0,a.jsxs)(`div`,{className:`mt-6 grid gap-4 xl:grid-cols-[1.12fr_0.88fr]`,children:[(0,a.jsxs)(`div`,{className:s,children:[(0,a.jsx)(`p`,{className:`text-sm font-medium aui-text-muted`,children:`Assign service region`}),(0,a.jsx)(`div`,{className:`mt-3`,children:(0,a.jsx)(n.AsyncSelect,{value:f,onValueChange:e=>p(e??``),loadOptions:c,loadSelectedOption:l,defaultOptions:o,minSearchLength:1,clearable:!0,showSelectedDescription:!0,debounceMs:220,onCreateOption:d,createOptionLabel:e=>`Create region "${e.trim()}"`,labels:{placeholder:`Choose service region`,searchPlaceholder:`Search regions...`,error:`Could not load regions. Try another query.`}})}),(0,a.jsxs)(`div`,{className:`mt-5`,children:[(0,a.jsx)(`p`,{className:`text-sm font-medium aui-text-muted`,children:`Multi select uses the same component`}),(0,a.jsx)(`div`,{className:`mt-3`,children:(0,a.jsx)(n.AsyncSelect,{isMulti:!0,value:m,onValueChange:e=>h(e),loadOptions:c,loadSelectedOptions:u,defaultOptions:o,minSearchLength:1,clearable:!0,showSelectAll:!0,maxSelected:3,maxVisibleTags:2,showSelectedDescription:!0,debounceMs:220,onCreateOption:d,createOptionLabel:e=>`Create team "${e.trim()}"`,labels:{multiPlaceholder:`Choose team coverage`,searchPlaceholder:`Search team regions...`,error:`Could not load teams. Try another query.`,selectedCount:e=>`${e} regions selected`,hiddenSelected:e=>`+${e} more`,maxSelected:e=>`Maximum ${e} regions`}})})]}),(0,a.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,a.jsx)(e.Button,{size:`sm`,variant:`secondary`,onClick:()=>p(`south`),children:`Hydrate South`}),(0,a.jsx)(e.Button,{size:`sm`,variant:`secondary`,onClick:()=>h([`north`,`west`,`central`]),children:`Fill max selected`}),(0,a.jsx)(e.Button,{size:`sm`,variant:`outline`,onClick:()=>{p(``),h([])},children:`Clear all`})]}),(0,a.jsxs)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-3`,children:[(0,a.jsxs)(`div`,{className:`rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3 text-sm`,children:[(0,a.jsx)(`p`,{className:`font-medium aui-text-strong`,children:`Type to query`}),(0,a.jsx)(`p`,{className:`mt-2 leading-6 aui-text-muted`,children:`Minimum search length keeps remote requests intentional. Type error to test failure state.`})]}),(0,a.jsxs)(`div`,{className:`rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3 text-sm`,children:[(0,a.jsx)(`p`,{className:`font-medium aui-text-strong`,children:`Clear safely`}),(0,a.jsx)(`p`,{className:`mt-2 leading-6 aui-text-muted`,children:`Clear action is isolated from the trigger surface.`})]}),(0,a.jsxs)(`div`,{className:`rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3 text-sm`,children:[(0,a.jsx)(`p`,{className:`font-medium aui-text-strong`,children:`Create and hydrate`}),(0,a.jsx)(`p`,{className:`mt-2 leading-6 aui-text-muted`,children:`Create missing options and restore selected labels from ID-first edit state.`})]})]})]}),(0,a.jsxs)(`div`,{className:s,children:[(0,a.jsx)(`p`,{className:`text-sm font-medium aui-text-muted`,children:`Selected result`}),(0,a.jsx)(`p`,{className:`mt-3 text-2xl font-semibold tracking-tight aui-text-strong`,children:g?.label||`No region selected`}),(0,a.jsx)(`p`,{className:`mt-2 text-sm leading-6 aui-text-muted`,children:`Start typing to simulate remote filtering. This should feel like a specialized extension of Select, not a completely separate mental model.`}),(0,a.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,a.jsxs)(`div`,{className:`rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3`,children:[(0,a.jsx)(`p`,{className:`text-xs uppercase tracking-[0.2em] aui-text-muted`,children:`Value`}),(0,a.jsx)(`p`,{className:`mt-2 text-sm font-medium aui-text-strong`,children:f||`none`})]}),(0,a.jsxs)(`div`,{className:`rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3`,children:[(0,a.jsx)(`p`,{className:`text-xs uppercase tracking-[0.2em] aui-text-muted`,children:`Team`}),(0,a.jsx)(`p`,{className:`mt-2 text-sm font-medium aui-text-strong`,children:g?r.routeWorkspaceOptions.find(e=>e.value===g.value)?.team:`No team`})]}),(0,a.jsxs)(`div`,{className:`rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3`,children:[(0,a.jsx)(`p`,{className:`text-xs uppercase tracking-[0.2em] aui-text-muted`,children:`Multi mode`}),(0,a.jsx)(`p`,{className:`mt-2 text-sm font-medium aui-text-strong`,children:_.length?_.map(e=>e.label).join(`, `):`No teams selected`})]})]})]})]})]})})}exports.AsyncSelectShowcase=f;
|
|
@@ -1,97 +1,108 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Button as e } from "../../../components/ui/button/index.js";
|
|
2
|
+
import { Badge as t } from "../../../components/ui/badge/index.js";
|
|
3
|
+
import { AsyncSelect as n } from "../../../components/inputs/async-select.js";
|
|
4
|
+
import { routeWorkspaceOptions as r } from "../../component-route-data.js";
|
|
5
|
+
import { useState as i } from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
7
|
//#region src/showcase/premium/async-select/showcase.tsx
|
|
7
|
-
var
|
|
8
|
+
var s = r, c = "rounded-[22px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg)] p-5", l = async (e) => {
|
|
8
9
|
await new Promise((e) => setTimeout(e, 260));
|
|
9
10
|
let t = e.trim().toLowerCase();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
if (t === "error") throw Error("Unable to load regions");
|
|
12
|
+
return t ? s.filter((e) => String(e.label ?? "").toLowerCase().includes(t)) : s;
|
|
13
|
+
}, u = async (e) => (await new Promise((e) => setTimeout(e, 120)), s.find((t) => t.value === e) ?? null), d = async (e) => (await new Promise((e) => setTimeout(e, 120)), s.filter((t) => e.includes(String(t.value)))), f = async (e) => (await new Promise((e) => setTimeout(e, 180)), {
|
|
14
|
+
value: e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "custom-region",
|
|
15
|
+
label: e.trim(),
|
|
16
|
+
description: "Created from the current search query"
|
|
17
|
+
});
|
|
18
|
+
function p() {
|
|
19
|
+
let [p, m] = i(""), [h, g] = i(["north", "west"]), _ = r.find((e) => e.value === p), v = r.filter((e) => h.includes(String(e.value)));
|
|
20
|
+
return /* @__PURE__ */ a("div", {
|
|
15
21
|
className: "space-y-5",
|
|
16
|
-
children: /* @__PURE__ */
|
|
22
|
+
children: /* @__PURE__ */ o("section", {
|
|
17
23
|
className: "rounded-[24px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg)] p-5 sm:p-6",
|
|
18
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ o("div", {
|
|
19
25
|
className: "flex flex-col gap-6 xl:flex-row xl:items-start xl:justify-between",
|
|
20
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ o("div", {
|
|
21
27
|
className: "max-w-xl",
|
|
22
28
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ a("p", {
|
|
24
30
|
className: "text-xs font-semibold uppercase tracking-[0.26em] aui-text-muted",
|
|
25
31
|
children: "Remote selection"
|
|
26
32
|
}),
|
|
27
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ a("h3", {
|
|
28
34
|
className: "mt-3 text-2xl font-semibold tracking-tight aui-text-strong",
|
|
29
35
|
children: "AsyncSelect is the remote member of the Select family"
|
|
30
36
|
}),
|
|
31
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ a("p", {
|
|
32
38
|
className: "mt-3 max-w-lg text-sm leading-6 aui-text-muted",
|
|
33
39
|
children: "Use AsyncSelect only when the main Select flow is not enough because the option set is large, remote, or hydration-aware."
|
|
34
40
|
})
|
|
35
41
|
]
|
|
36
|
-
}), /* @__PURE__ */
|
|
42
|
+
}), /* @__PURE__ */ o("div", {
|
|
37
43
|
className: "flex flex-wrap gap-2",
|
|
38
44
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ a(t, {
|
|
40
46
|
variant: "outline",
|
|
41
47
|
className: "rounded-full",
|
|
42
48
|
children: "Async"
|
|
43
49
|
}),
|
|
44
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ a(t, {
|
|
45
51
|
variant: "outline",
|
|
46
52
|
className: "rounded-full",
|
|
47
53
|
children: "Search"
|
|
48
54
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ a(t, {
|
|
50
56
|
variant: "outline",
|
|
51
57
|
className: "rounded-full",
|
|
52
58
|
children: "Clearable"
|
|
53
59
|
})
|
|
54
60
|
]
|
|
55
61
|
})]
|
|
56
|
-
}), /* @__PURE__ */
|
|
62
|
+
}), /* @__PURE__ */ o("div", {
|
|
57
63
|
className: "mt-6 grid gap-4 xl:grid-cols-[1.12fr_0.88fr]",
|
|
58
|
-
children: [/* @__PURE__ */
|
|
59
|
-
className:
|
|
64
|
+
children: [/* @__PURE__ */ o("div", {
|
|
65
|
+
className: c,
|
|
60
66
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ a("p", {
|
|
62
68
|
className: "text-sm font-medium aui-text-muted",
|
|
63
69
|
children: "Assign service region"
|
|
64
70
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ a("div", {
|
|
66
72
|
className: "mt-3",
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
-
value:
|
|
69
|
-
onValueChange: (e) =>
|
|
70
|
-
loadOptions:
|
|
71
|
-
|
|
73
|
+
children: /* @__PURE__ */ a(n, {
|
|
74
|
+
value: p,
|
|
75
|
+
onValueChange: (e) => m(e ?? ""),
|
|
76
|
+
loadOptions: l,
|
|
77
|
+
loadSelectedOption: u,
|
|
78
|
+
defaultOptions: s,
|
|
72
79
|
minSearchLength: 1,
|
|
73
80
|
clearable: !0,
|
|
74
81
|
showSelectedDescription: !0,
|
|
75
82
|
debounceMs: 220,
|
|
83
|
+
onCreateOption: f,
|
|
84
|
+
createOptionLabel: (e) => `Create region "${e.trim()}"`,
|
|
76
85
|
labels: {
|
|
77
86
|
placeholder: "Choose service region",
|
|
78
|
-
searchPlaceholder: "Search regions..."
|
|
87
|
+
searchPlaceholder: "Search regions...",
|
|
88
|
+
error: "Could not load regions. Try another query."
|
|
79
89
|
}
|
|
80
90
|
})
|
|
81
91
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ o("div", {
|
|
83
93
|
className: "mt-5",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ a("p", {
|
|
85
95
|
className: "text-sm font-medium aui-text-muted",
|
|
86
96
|
children: "Multi select uses the same component"
|
|
87
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ a("div", {
|
|
88
98
|
className: "mt-3",
|
|
89
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ a(n, {
|
|
90
100
|
isMulti: !0,
|
|
91
|
-
value:
|
|
92
|
-
onValueChange: (e) =>
|
|
93
|
-
loadOptions:
|
|
94
|
-
|
|
101
|
+
value: h,
|
|
102
|
+
onValueChange: (e) => g(e),
|
|
103
|
+
loadOptions: l,
|
|
104
|
+
loadSelectedOptions: d,
|
|
105
|
+
defaultOptions: s,
|
|
95
106
|
minSearchLength: 1,
|
|
96
107
|
clearable: !0,
|
|
97
108
|
showSelectAll: !0,
|
|
@@ -99,97 +110,130 @@ function l() {
|
|
|
99
110
|
maxVisibleTags: 2,
|
|
100
111
|
showSelectedDescription: !0,
|
|
101
112
|
debounceMs: 220,
|
|
113
|
+
onCreateOption: f,
|
|
114
|
+
createOptionLabel: (e) => `Create team "${e.trim()}"`,
|
|
102
115
|
labels: {
|
|
103
116
|
multiPlaceholder: "Choose team coverage",
|
|
104
117
|
searchPlaceholder: "Search team regions...",
|
|
118
|
+
error: "Could not load teams. Try another query.",
|
|
105
119
|
selectedCount: (e) => `${e} regions selected`,
|
|
106
|
-
hiddenSelected: (e) => `+${e} more
|
|
120
|
+
hiddenSelected: (e) => `+${e} more`,
|
|
121
|
+
maxSelected: (e) => `Maximum ${e} regions`
|
|
107
122
|
}
|
|
108
123
|
})
|
|
109
124
|
})]
|
|
110
125
|
}),
|
|
111
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ o("div", {
|
|
127
|
+
className: "mt-4 flex flex-wrap gap-2",
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ a(e, {
|
|
130
|
+
size: "sm",
|
|
131
|
+
variant: "secondary",
|
|
132
|
+
onClick: () => m("south"),
|
|
133
|
+
children: "Hydrate South"
|
|
134
|
+
}),
|
|
135
|
+
/* @__PURE__ */ a(e, {
|
|
136
|
+
size: "sm",
|
|
137
|
+
variant: "secondary",
|
|
138
|
+
onClick: () => g([
|
|
139
|
+
"north",
|
|
140
|
+
"west",
|
|
141
|
+
"central"
|
|
142
|
+
]),
|
|
143
|
+
children: "Fill max selected"
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ a(e, {
|
|
146
|
+
size: "sm",
|
|
147
|
+
variant: "outline",
|
|
148
|
+
onClick: () => {
|
|
149
|
+
m(""), g([]);
|
|
150
|
+
},
|
|
151
|
+
children: "Clear all"
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ o("div", {
|
|
112
156
|
className: "mt-4 grid gap-3 md:grid-cols-3",
|
|
113
157
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ o("div", {
|
|
115
159
|
className: "rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3 text-sm",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ a("p", {
|
|
117
161
|
className: "font-medium aui-text-strong",
|
|
118
162
|
children: "Type to query"
|
|
119
|
-
}), /* @__PURE__ */
|
|
163
|
+
}), /* @__PURE__ */ a("p", {
|
|
120
164
|
className: "mt-2 leading-6 aui-text-muted",
|
|
121
|
-
children: "Minimum search length keeps remote requests intentional."
|
|
165
|
+
children: "Minimum search length keeps remote requests intentional. Type error to test failure state."
|
|
122
166
|
})]
|
|
123
167
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ o("div", {
|
|
125
169
|
className: "rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3 text-sm",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ a("p", {
|
|
127
171
|
className: "font-medium aui-text-strong",
|
|
128
172
|
children: "Clear safely"
|
|
129
|
-
}), /* @__PURE__ */
|
|
173
|
+
}), /* @__PURE__ */ a("p", {
|
|
130
174
|
className: "mt-2 leading-6 aui-text-muted",
|
|
131
175
|
children: "Clear action is isolated from the trigger surface."
|
|
132
176
|
})]
|
|
133
177
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ o("div", {
|
|
135
179
|
className: "rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3 text-sm",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
180
|
+
children: [/* @__PURE__ */ a("p", {
|
|
137
181
|
className: "font-medium aui-text-strong",
|
|
138
|
-
children: "
|
|
139
|
-
}), /* @__PURE__ */
|
|
182
|
+
children: "Create and hydrate"
|
|
183
|
+
}), /* @__PURE__ */ a("p", {
|
|
140
184
|
className: "mt-2 leading-6 aui-text-muted",
|
|
141
|
-
children: "
|
|
185
|
+
children: "Create missing options and restore selected labels from ID-first edit state."
|
|
142
186
|
})]
|
|
143
187
|
})
|
|
144
188
|
]
|
|
145
189
|
})
|
|
146
190
|
]
|
|
147
|
-
}), /* @__PURE__ */
|
|
148
|
-
className:
|
|
191
|
+
}), /* @__PURE__ */ o("div", {
|
|
192
|
+
className: c,
|
|
149
193
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ a("p", {
|
|
151
195
|
className: "text-sm font-medium aui-text-muted",
|
|
152
196
|
children: "Selected result"
|
|
153
197
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ a("p", {
|
|
155
199
|
className: "mt-3 text-2xl font-semibold tracking-tight aui-text-strong",
|
|
156
|
-
children:
|
|
200
|
+
children: _?.label || "No region selected"
|
|
157
201
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ a("p", {
|
|
159
203
|
className: "mt-2 text-sm leading-6 aui-text-muted",
|
|
160
204
|
children: "Start typing to simulate remote filtering. This should feel like a specialized extension of Select, not a completely separate mental model."
|
|
161
205
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ o("div", {
|
|
163
207
|
className: "mt-4 space-y-3",
|
|
164
208
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ o("div", {
|
|
166
210
|
className: "rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
211
|
+
children: [/* @__PURE__ */ a("p", {
|
|
168
212
|
className: "text-xs uppercase tracking-[0.2em] aui-text-muted",
|
|
169
213
|
children: "Value"
|
|
170
|
-
}), /* @__PURE__ */
|
|
214
|
+
}), /* @__PURE__ */ a("p", {
|
|
171
215
|
className: "mt-2 text-sm font-medium aui-text-strong",
|
|
172
|
-
children:
|
|
216
|
+
children: p || "none"
|
|
173
217
|
})]
|
|
174
218
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ o("div", {
|
|
176
220
|
className: "rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ a("p", {
|
|
178
222
|
className: "text-xs uppercase tracking-[0.2em] aui-text-muted",
|
|
179
223
|
children: "Team"
|
|
180
|
-
}), /* @__PURE__ */
|
|
224
|
+
}), /* @__PURE__ */ a("p", {
|
|
181
225
|
className: "mt-2 text-sm font-medium aui-text-strong",
|
|
182
|
-
children:
|
|
226
|
+
children: _ ? r.find((e) => e.value === _.value)?.team : "No team"
|
|
183
227
|
})]
|
|
184
228
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ o("div", {
|
|
186
230
|
className: "rounded-[18px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ a("p", {
|
|
188
232
|
className: "text-xs uppercase tracking-[0.2em] aui-text-muted",
|
|
189
233
|
children: "Multi mode"
|
|
190
|
-
}), /* @__PURE__ */
|
|
234
|
+
}), /* @__PURE__ */ a("p", {
|
|
191
235
|
className: "mt-2 text-sm font-medium aui-text-strong",
|
|
192
|
-
children:
|
|
236
|
+
children: v.length ? v.map((e) => e.label).join(", ") : "No teams selected"
|
|
193
237
|
})]
|
|
194
238
|
})
|
|
195
239
|
]
|
|
@@ -201,4 +245,4 @@ function l() {
|
|
|
201
245
|
});
|
|
202
246
|
}
|
|
203
247
|
//#endregion
|
|
204
|
-
export {
|
|
248
|
+
export { p as AsyncSelectShowcase };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../components/ui/badge/index.cjs"),t=require("../../../components/display/avatar.cjs");let n=require("react/jsx-runtime");var r=`border-t border-[color:var(--aui-divider)] py-6`,i=[{key:`az`,name:`Azamat Jurayev`,status:`online`},{key:`sa`,name:`Saida Karimova`,status:`busy`},{key:`um`,name:`Umid Rakhimov`,status:`away`},{key:`ni`,name:`Nigor Akhmedova`,status:`online`},{key:`ja`,name:`Jasur Tursunov`,status:`offline`}];function a(){return(0,n.jsxs)(`div`,{className:`space-y-0`,children:[(0,n.jsxs)(`section`,{className:`pb-6`,children:[(0,n.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] aui-text-muted`,children:`Installed display primitive`}),(0,n.jsx)(`h3`,{className:`mt-3 text-2xl font-semibold tracking-tight aui-text-strong`,children:`Avatar handles identity without heavy cards`}),(0,n.jsx)(`p`,{className:`mt-3 max-w-2xl text-sm leading-6 aui-text-muted`,children:`Use Avatar for lightweight identity surfaces. Promote to UserCard only when profile metadata and actions are truly needed.`})]}),(0,n.jsx)(`section`,{className:r,children:(0,n.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-[1fr_360px]`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`p`,{className:`text-lg font-semibold aui-text-strong`,children:`Assignee row`}),(0,n.jsx)(`p`,{className:`mt-2 max-w-xl text-sm leading-6 aui-text-muted`,children:`The component should stay readable in compact operational lists, not only inside profile layouts.`}),(0,n.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-4 rounded-xl border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] p-4`,children:[(0,n.jsx)(t.Avatar,{name:`Azamat Jurayev`,size:`lg`,status:`online`}),(0,n.jsxs)(`div`,{className:`min-w-0`,children:[(0,n.jsx)(`p`,{className:`text-sm font-semibold aui-text-strong`,children:`Azamat Jurayev`}),(0,n.jsx)(`p`,{className:`mt-1 text-sm aui-text-muted`,children:`Release owner for the current component pass`})]}),(0,n.jsx)(e.Badge,{variant:`secondary`,children:`Online`})]})]}),(0,n.jsxs)(`div`,{className:`rounded-xl border border-[color:var(--aui-divider)] p-4`,children:[(0,n.jsx)(`p`,{className:`text-sm font-semibold aui-text-strong`,children:`Size and shape`}),(0,n.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3`,children:[(0,n.jsx)(t.Avatar,{name:`
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../components/ui/badge/index.cjs"),t=require("../../../components/display/avatar.cjs");let n=require("react/jsx-runtime");var r=`border-t border-[color:var(--aui-divider)] py-6`,i=[{key:`az`,name:`Azamat Jurayev`,status:`online`},{key:`sa`,name:`Saida Karimova`,status:`busy`},{key:`um`,name:`Umid Rakhimov`,status:`away`},{key:`ni`,name:`Nigor Akhmedova`,status:`online`},{key:`ja`,name:`Jasur Tursunov`,status:`offline`}];function a(){return(0,n.jsxs)(`div`,{className:`space-y-0`,children:[(0,n.jsxs)(`section`,{className:`pb-6`,children:[(0,n.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] aui-text-muted`,children:`Installed display primitive`}),(0,n.jsx)(`h3`,{className:`mt-3 text-2xl font-semibold tracking-tight aui-text-strong`,children:`Avatar handles identity without heavy cards`}),(0,n.jsx)(`p`,{className:`mt-3 max-w-2xl text-sm leading-6 aui-text-muted`,children:`Use Avatar for lightweight identity surfaces. Promote to UserCard only when profile metadata and actions are truly needed.`})]}),(0,n.jsx)(`section`,{className:r,children:(0,n.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-[1fr_360px]`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`p`,{className:`text-lg font-semibold aui-text-strong`,children:`Assignee row`}),(0,n.jsx)(`p`,{className:`mt-2 max-w-xl text-sm leading-6 aui-text-muted`,children:`The component should stay readable in compact operational lists, not only inside profile layouts.`}),(0,n.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-4 rounded-xl border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] p-4`,children:[(0,n.jsx)(t.Avatar,{name:`Azamat Jurayev`,size:`lg`,status:`online`}),(0,n.jsxs)(`div`,{className:`min-w-0`,children:[(0,n.jsx)(`p`,{className:`text-sm font-semibold aui-text-strong`,children:`Azamat Jurayev`}),(0,n.jsx)(`p`,{className:`mt-1 text-sm aui-text-muted`,children:`Release owner for the current component pass`})]}),(0,n.jsx)(e.Badge,{variant:`secondary`,children:`Online`})]})]}),(0,n.jsxs)(`div`,{className:`rounded-xl border border-[color:var(--aui-divider)] p-4`,children:[(0,n.jsx)(`p`,{className:`text-sm font-semibold aui-text-strong`,children:`Size and shape`}),(0,n.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3`,children:[(0,n.jsx)(t.Avatar,{name:`TM`,size:`xs`}),(0,n.jsx)(t.Avatar,{name:`TM`,size:`sm`,shape:`rounded`}),(0,n.jsx)(t.Avatar,{name:`TM`,size:`default`}),(0,n.jsx)(t.Avatar,{name:`TM`,size:`lg`,shape:`square`}),(0,n.jsx)(t.Avatar,{name:`TM`,size:`xl`,shape:`rounded`})]})]})]})}),(0,n.jsx)(`section`,{className:r,children:(0,n.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-[0.9fr_1.1fr]`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`p`,{className:`text-lg font-semibold aui-text-strong`,children:`Team summary`}),(0,n.jsx)(`p`,{className:`mt-2 max-w-xl text-sm leading-6 aui-text-muted`,children:`Grouped avatars work best as a compact cue, not a replacement for a full people management panel.`})]}),(0,n.jsx)(`div`,{className:`rounded-xl border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] p-4`,children:(0,n.jsx)(t.AvatarGroup,{items:i,max:4})})]})})]})}exports.AvatarShowcase=a;
|
|
@@ -96,25 +96,25 @@ function s() {
|
|
|
96
96
|
className: "mt-4 flex flex-wrap items-center gap-3",
|
|
97
97
|
children: [
|
|
98
98
|
/* @__PURE__ */ r(t, {
|
|
99
|
-
name: "
|
|
99
|
+
name: "TM",
|
|
100
100
|
size: "xs"
|
|
101
101
|
}),
|
|
102
102
|
/* @__PURE__ */ r(t, {
|
|
103
|
-
name: "
|
|
103
|
+
name: "TM",
|
|
104
104
|
size: "sm",
|
|
105
105
|
shape: "rounded"
|
|
106
106
|
}),
|
|
107
107
|
/* @__PURE__ */ r(t, {
|
|
108
|
-
name: "
|
|
108
|
+
name: "TM",
|
|
109
109
|
size: "default"
|
|
110
110
|
}),
|
|
111
111
|
/* @__PURE__ */ r(t, {
|
|
112
|
-
name: "
|
|
112
|
+
name: "TM",
|
|
113
113
|
size: "lg",
|
|
114
114
|
shape: "square"
|
|
115
115
|
}),
|
|
116
116
|
/* @__PURE__ */ r(t, {
|
|
117
|
-
name: "
|
|
117
|
+
name: "TM",
|
|
118
118
|
size: "xl",
|
|
119
119
|
shape: "rounded"
|
|
120
120
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e={code:`import * as React from "react"
|
|
2
|
-
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "tembro"
|
|
2
|
+
import { Button, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "tembro"
|
|
3
3
|
|
|
4
4
|
export function Example() {
|
|
5
5
|
const [open, setOpen] = React.useState(false)
|
|
@@ -14,6 +14,11 @@ export function Example() {
|
|
|
14
14
|
Confirm that these notes are final before moving to production.
|
|
15
15
|
</DialogDescription>
|
|
16
16
|
</DialogHeader>
|
|
17
|
+
<DialogBody>
|
|
18
|
+
<p className="text-sm text-muted-foreground">
|
|
19
|
+
The body scrolls independently when content is long, while the footer stays usable.
|
|
20
|
+
</p>
|
|
21
|
+
</DialogBody>
|
|
17
22
|
<DialogFooter>
|
|
18
23
|
<Button variant="outline" onClick={() => setOpen(false)}>Cancel</Button>
|
|
19
24
|
<Button>Publish</Button>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/showcase/premium/dialog/mock.ts
|
|
2
2
|
var e = {
|
|
3
|
-
code: "import * as React from \"react\"\nimport { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from \"tembro\"\n\nexport function Example() {\n const [open, setOpen] = React.useState(false)\n\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger render={<Button>Publish</Button>} />\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Publish update</DialogTitle>\n <DialogDescription>\n Confirm that these notes are final before moving to production.\n </DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <Button variant=\"outline\" onClick={() => setOpen(false)}>Cancel</Button>\n <Button>Publish</Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}",
|
|
3
|
+
code: "import * as React from \"react\"\nimport { Button, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from \"tembro\"\n\nexport function Example() {\n const [open, setOpen] = React.useState(false)\n\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger render={<Button>Publish</Button>} />\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Publish update</DialogTitle>\n <DialogDescription>\n Confirm that these notes are final before moving to production.\n </DialogDescription>\n </DialogHeader>\n <DialogBody>\n <p className=\"text-sm text-muted-foreground\">\n The body scrolls independently when content is long, while the footer stays usable.\n </p>\n </DialogBody>\n <DialogFooter>\n <Button variant=\"outline\" onClick={() => setOpen(false)}>Cancel</Button>\n <Button>Publish</Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}",
|
|
4
4
|
htmlCode: "<button data-slot=\"dialog-trigger\">Open dialog</button>",
|
|
5
5
|
cliCommand: "npx tembro add dialog",
|
|
6
6
|
highlights: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../components/ui/button/index.cjs"),t=require("../../../components/ui/badge/index.cjs"),n=require("../../../components/ui/dialog/index.cjs"),r=require("./data.cjs");let i=require("react/jsx-runtime");var a=`border-t border-[color:var(--aui-divider)] py-6`;function o(){return(0,i.jsxs)(`div`,{className:`space-y-0`,children:[(0,i.jsx)(`section`,{className:`pb-6`,children:(0,i.jsxs)(`div`,{className:`max-w-xl`,children:[(0,i.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.26em] aui-text-muted`,children:`Overlay`}),(0,i.jsx)(`h3`,{className:`mt-3 text-2xl font-semibold tracking-tight aui-text-strong`,children:`Dialogs should justify focus`}),(0,i.jsx)(`p`,{className:`mt-3 text-sm leading-6 aui-text-muted`,children:`Use them for short, high-risk, or confirm-first actions. Keep the trigger, title, description, and footer actions explicit.`})]})}),(0,i.jsx)(`section`,{className:a,children:(0,i.jsx)(`div`,{className:`grid gap-4 xl:grid-cols-3`,children:r.dialogDemoItems.map(r=>(0,i.jsxs)(`div`,{className:`rounded-[20px] border border-[color:var(--aui-divider)] px-4 py-4`,children:[(0,i.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`p`,{className:`text-sm font-semibold aui-text-strong`,children:r.title}),(0,i.jsx)(`p`,{className:`mt-2 text-sm leading-6 aui-text-muted`,children:r.description})]}),(0,i.jsx)(t.Badge,{variant:r.confirmVariant===`destructive`?`destructive`:`outline`,children:r.confirmLabel})]}),(0,i.jsx)(`div`,{className:`mt-4`,children:(0,i.jsxs)(n.Dialog,{children:[(0,i.jsx)(n.DialogTrigger,{render:(0,i.jsx)(e.Button,{variant:r.triggerVariant}),children:r.label}),(0,i.jsxs)(n.DialogContent,{children:[(0,i.jsxs)(n.DialogHeader,{children:[(0,i.jsx)(n.DialogTitle,{children:r.title}),(0,i.jsx)(n.DialogDescription,{children:r.description})]}),(0,i.jsx)(n.DialogFooter,{showCloseButton:!0,children:(0,i.jsx)(e.Button,{variant:r.confirmVariant,children:r.confirmLabel})})]})]})})]},r.label))})}),(0,i.jsx)(`section`,{className:a,children:(0,i.jsx)(`div`,{className:`grid gap-3`,children:[`Keep the page understandable before the overlay opens.`,`Use outcome-specific action labels inside the dialog footer.`,`Do not move long multi-step workflows into a small modal by default.`].map(e=>(0,i.jsx)(`div`,{className:`rounded-[18px] border border-[color:var(--aui-divider)] px-4 py-3 text-sm leading-6 aui-text-muted`,children:e},e))})})]})}exports.DialogShowcase=o;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../components/ui/button/index.cjs"),t=require("../../../components/ui/badge/index.cjs"),n=require("../../../components/ui/dialog/index.cjs"),r=require("./data.cjs");let i=require("react/jsx-runtime");var a=`border-t border-[color:var(--aui-divider)] py-6`;function o(){return(0,i.jsxs)(`div`,{className:`space-y-0`,children:[(0,i.jsx)(`section`,{className:`pb-6`,children:(0,i.jsxs)(`div`,{className:`max-w-xl`,children:[(0,i.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.26em] aui-text-muted`,children:`Overlay`}),(0,i.jsx)(`h3`,{className:`mt-3 text-2xl font-semibold tracking-tight aui-text-strong`,children:`Dialogs should justify focus`}),(0,i.jsx)(`p`,{className:`mt-3 text-sm leading-6 aui-text-muted`,children:`Use them for short, high-risk, or confirm-first actions. Keep the trigger, title, description, and footer actions explicit.`})]})}),(0,i.jsx)(`section`,{className:a,children:(0,i.jsx)(`div`,{className:`grid gap-4 xl:grid-cols-3`,children:r.dialogDemoItems.map(r=>(0,i.jsxs)(`div`,{className:`rounded-[20px] border border-[color:var(--aui-divider)] px-4 py-4`,children:[(0,i.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`p`,{className:`text-sm font-semibold aui-text-strong`,children:r.title}),(0,i.jsx)(`p`,{className:`mt-2 text-sm leading-6 aui-text-muted`,children:r.description})]}),(0,i.jsx)(t.Badge,{variant:r.confirmVariant===`destructive`?`destructive`:`outline`,children:r.confirmLabel})]}),(0,i.jsx)(`div`,{className:`mt-4`,children:(0,i.jsxs)(n.Dialog,{children:[(0,i.jsx)(n.DialogTrigger,{render:(0,i.jsx)(e.Button,{variant:r.triggerVariant}),children:r.label}),(0,i.jsxs)(n.DialogContent,{children:[(0,i.jsxs)(n.DialogHeader,{children:[(0,i.jsx)(n.DialogTitle,{children:r.title}),(0,i.jsx)(n.DialogDescription,{children:r.description})]}),(0,i.jsx)(n.DialogBody,{children:(0,i.jsx)(`div`,{className:`rounded-[16px] border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] px-4 py-3 text-sm leading-6 aui-text-muted`,children:`This body area scrolls independently when content becomes long. Footer actions stay visible and aligned.`})}),(0,i.jsx)(n.DialogFooter,{showCloseButton:!0,children:(0,i.jsx)(e.Button,{variant:r.confirmVariant,children:r.confirmLabel})})]})]})})]},r.label))})}),(0,i.jsx)(`section`,{className:a,children:(0,i.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,i.jsxs)(n.Dialog,{children:[(0,i.jsx)(n.DialogTrigger,{render:(0,i.jsx)(e.Button,{variant:`outline`}),children:`Open form dialog`}),(0,i.jsxs)(n.DialogContent,{size:`lg`,children:[(0,i.jsxs)(n.DialogHeader,{children:[(0,i.jsx)(n.DialogTitle,{children:`Create staff member`}),(0,i.jsx)(n.DialogDescription,{children:`Use focused form dialogs for short admin tasks with stable footer actions.`})]}),(0,i.jsx)(n.DialogBody,{children:(0,i.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[`Full name`,`Phone`,`Role`,`Status`,`Branch`,`Temporary password`].map(e=>(0,i.jsxs)(`label`,{className:`grid gap-2 text-sm font-medium aui-text-strong`,children:[e,(0,i.jsx)(`input`,{className:`h-10 rounded-xl border border-[color:var(--aui-input-border)] bg-[color:var(--aui-input-bg)] px-3 text-sm outline-none focus-visible:border-[color:var(--aui-ring)]`,placeholder:e})]},e))})}),(0,i.jsxs)(n.DialogFooter,{children:[(0,i.jsx)(e.Button,{variant:`outline`,children:`Cancel`}),(0,i.jsx)(e.Button,{children:`Create staff`})]})]})]}),(0,i.jsxs)(n.Dialog,{children:[(0,i.jsx)(n.DialogTrigger,{render:(0,i.jsx)(e.Button,{variant:`destructive`}),children:`Open destructive dialog`}),(0,i.jsxs)(n.DialogContent,{size:`sm`,children:[(0,i.jsxs)(n.DialogHeader,{children:[(0,i.jsx)(n.DialogTitle,{children:`Deactivate restaurant`}),(0,i.jsx)(n.DialogDescription,{children:`This action pauses public ordering and hides active shifts from the restaurant.`})]}),(0,i.jsx)(n.DialogBody,{children:(0,i.jsx)(`div`,{className:`rounded-[16px] border border-red-200 bg-red-50 px-4 py-3 text-sm leading-6 text-red-700`,children:`Operators can reactivate it later, but active customer sessions will be interrupted.`})}),(0,i.jsxs)(n.DialogFooter,{children:[(0,i.jsx)(e.Button,{variant:`outline`,children:`Keep active`}),(0,i.jsx)(e.Button,{variant:`destructive`,children:`Deactivate`})]})]})]})]})}),(0,i.jsx)(`section`,{className:a,children:(0,i.jsx)(`div`,{className:`grid gap-3`,children:[`Keep the page understandable before the overlay opens.`,`Use outcome-specific action labels inside the dialog footer.`,`Do not move long multi-step workflows into a small modal by default.`].map(e=>(0,i.jsx)(`div`,{className:`rounded-[18px] border border-[color:var(--aui-divider)] px-4 py-3 text-sm leading-6 aui-text-muted`,children:e},e))})})]})}exports.DialogShowcase=o;
|