@atom-learning/components 6.0.0-beta.22 → 6.0.0-beta.24

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.
@@ -1,2 +1,2 @@
1
- import{styled as t}from"../../styled.js";const e=t("div",{base:["flex"],variants:{direction:{row:["flex-row"],"row-reverse":["flex-row-reverse"],column:["flex-col"],"column-reverse":["flex-col-reverse"],inherit:["direction-[inherit]"],initial:["direction-[initial]"],revert:["direction-[revert]"],"revert-layer":["direction-[revert-layer]"],unset:["direction-[unset]"]},wrap:{nowrap:["flex-no-wrap"],wrap:["flex-wrap"],"wrap-reverse":["flex-wrap-reverse"],inherit:["[flex-wrap:inherit]"],initial:["[flex-wrap:initial]"],revert:["[flex-wrap:revert]"],"revert-layer":["[flex-wrap:revert-layer]"],unset:["[flex-wrap:unset]"]},justify:{normal:["justify-normal"],unsafe:["[justify-content:unsafe]"],safe:["[justify-content:safe]"],start:["justify-start"],center:["justify-center"],end:["justify-end"],"flex-start":["justify-start"],"flex-end":["justify-end"],left:["[justify-content:left]"],right:["[justify-content:right]"],"space-between":["justify-between"],"space-around":["justify-around"],"space-evenly":["justify-evenly"],stretch:["justify-stretch"],inherit:["[justify-content:inherit]"],initial:["[justify-content:initial]"],revert:["[justify-content:revert]"],"revert-layer":["[justify-content:revert-layer]"],unset:["[justify-content:unset]"]},align:{normal:["[align-items:normal]"],unsafe:["[align-items:unsafe]"],safe:["[align-items:safe]"],center:["items-center"],start:["items-start"],end:["items-end"],"self-start":["[align-items:self-start]"],"self-end":["[align-items:self-end]"],"flex-start":["items-start"],"flex-end":["items-end"],baseline:["items-baseline"],"first baseline":["[align-items:first baseline]"],"last baseline":["[align-items:last baseline]"],stretch:["items-stretch"],inherit:["[align-items:inherit]"],initial:["[align-items:initial]"],revert:["[align-items:revert]"],"revert-layer":["[align-items:revert-layer]"],unset:["[align-items:unset]"]},gap:{0:["gap-0.5"],1:["gap-1"],2:["gap-2"],3:["gap-3"],4:["gap-4"],24:["gap-6"],5:["gap-8"],6:["gap-10"],7:["gap-12"],8:["gap-16"],9:["gap-20"]}}},{enabledResponsiveVariants:!0});e.displayName="Flex";export{e as Flex};
1
+ import{styled as t}from"../../styled.js";const e=t("div",{base:["flex"],variants:{direction:{row:["flex-row"],"row-reverse":["flex-row-reverse"],column:["flex-col"],"column-reverse":["flex-col-reverse"],inherit:["direction-[inherit]"],initial:["direction-[initial]"],revert:["direction-[revert]"],"revert-layer":["direction-[revert-layer]"],unset:["direction-[unset]"]},wrap:{nowrap:["flex-nowrap"],wrap:["flex-wrap"],"wrap-reverse":["flex-wrap-reverse"],inherit:["[flex-wrap:inherit]"],initial:["[flex-wrap:initial]"],revert:["[flex-wrap:revert]"],"revert-layer":["[flex-wrap:revert-layer]"],unset:["[flex-wrap:unset]"]},justify:{normal:["justify-normal"],unsafe:["[justify-content:unsafe]"],safe:["[justify-content:safe]"],start:["justify-start"],center:["justify-center"],end:["justify-end"],"flex-start":["justify-start"],"flex-end":["justify-end"],left:["[justify-content:left]"],right:["[justify-content:right]"],"space-between":["justify-between"],"space-around":["justify-around"],"space-evenly":["justify-evenly"],stretch:["justify-stretch"],inherit:["[justify-content:inherit]"],initial:["[justify-content:initial]"],revert:["[justify-content:revert]"],"revert-layer":["[justify-content:revert-layer]"],unset:["[justify-content:unset]"]},align:{normal:["[align-items:normal]"],unsafe:["[align-items:unsafe]"],safe:["[align-items:safe]"],center:["items-center"],start:["items-start"],end:["items-end"],"self-start":["[align-items:self-start]"],"self-end":["[align-items:self-end]"],"flex-start":["items-start"],"flex-end":["items-end"],baseline:["items-baseline"],"first baseline":["[align-items:first baseline]"],"last baseline":["[align-items:last baseline]"],stretch:["items-stretch"],inherit:["[align-items:inherit]"],initial:["[align-items:initial]"],revert:["[align-items:revert]"],"revert-layer":["[align-items:revert-layer]"],unset:["[align-items:unset]"]},gap:{0:["gap-0.5"],1:["gap-1"],2:["gap-2"],3:["gap-3"],4:["gap-4"],24:["gap-6"],5:["gap-8"],6:["gap-10"],7:["gap-12"],8:["gap-16"],9:["gap-20"]}}},{enabledResponsiveVariants:!0});e.displayName="Flex";export{e as Flex};
2
2
  //# sourceMappingURL=Flex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.js","sources":["../../../src/components/flex/Flex.tsx"],"sourcesContent":["import { styled } from '~/styled'\n\nexport const Flex = styled(\n 'div',\n {\n base: ['flex'],\n variants: {\n direction: {\n row: ['flex-row'],\n 'row-reverse': ['flex-row-reverse'],\n column: ['flex-col'],\n 'column-reverse': ['flex-col-reverse'],\n inherit: ['direction-[inherit]'],\n initial: ['direction-[initial]'],\n revert: ['direction-[revert]'],\n 'revert-layer': ['direction-[revert-layer]'],\n unset: ['direction-[unset]']\n },\n wrap: {\n nowrap: ['flex-no-wrap'],\n wrap: ['flex-wrap'],\n 'wrap-reverse': ['flex-wrap-reverse'],\n inherit: ['[flex-wrap:inherit]'],\n initial: ['[flex-wrap:initial]'],\n revert: ['[flex-wrap:revert]'],\n 'revert-layer': ['[flex-wrap:revert-layer]'],\n unset: ['[flex-wrap:unset]']\n },\n justify: {\n normal: ['justify-normal'],\n unsafe: ['[justify-content:unsafe]'],\n safe: ['[justify-content:safe]'],\n start: ['justify-start'],\n center: ['justify-center'],\n end: ['justify-end'],\n 'flex-start': ['justify-start'],\n 'flex-end': ['justify-end'],\n left: ['[justify-content:left]'],\n right: ['[justify-content:right]'],\n 'space-between': ['justify-between'],\n 'space-around': ['justify-around'],\n 'space-evenly': ['justify-evenly'],\n stretch: ['justify-stretch'],\n inherit: ['[justify-content:inherit]'],\n initial: ['[justify-content:initial]'],\n revert: ['[justify-content:revert]'],\n 'revert-layer': ['[justify-content:revert-layer]'],\n unset: ['[justify-content:unset]']\n },\n align: {\n normal: ['[align-items:normal]'],\n unsafe: ['[align-items:unsafe]'],\n safe: ['[align-items:safe]'],\n center: ['items-center'],\n start: ['items-start'],\n end: ['items-end'],\n 'self-start': ['[align-items:self-start]'],\n 'self-end': ['[align-items:self-end]'],\n 'flex-start': ['items-start'],\n 'flex-end': ['items-end'],\n baseline: ['items-baseline'],\n 'first baseline': ['[align-items:first baseline]'],\n 'last baseline': ['[align-items:last baseline]'],\n stretch: ['items-stretch'],\n inherit: ['[align-items:inherit]'],\n initial: ['[align-items:initial]'],\n revert: ['[align-items:revert]'],\n 'revert-layer': ['[align-items:revert-layer]'],\n unset: ['[align-items:unset]']\n },\n gap: {\n 0: ['gap-0.5'],\n 1: ['gap-1'],\n 2: ['gap-2'],\n 3: ['gap-3'],\n 4: ['gap-4'],\n 24: ['gap-6'],\n 5: ['gap-8'],\n 6: ['gap-10'],\n 7: ['gap-12'],\n 8: ['gap-16'],\n 9: ['gap-20']\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\nFlex.displayName = 'Flex'\n"],"names":["Flex","styled"],"mappings":"yCAEO,MAAMA,EAAOC,EAClB,MACA,CACE,KAAM,CAAC,MAAM,EACb,SAAU,CACR,UAAW,CACT,IAAK,CAAC,UAAU,EAChB,cAAe,CAAC,kBAAkB,EAClC,OAAQ,CAAC,UAAU,EACnB,iBAAkB,CAAC,kBAAkB,EACrC,QAAS,CAAC,qBAAqB,EAC/B,QAAS,CAAC,qBAAqB,EAC/B,OAAQ,CAAC,oBAAoB,EAC7B,eAAgB,CAAC,0BAA0B,EAC3C,MAAO,CAAC,mBAAmB,CAC7B,EACA,KAAM,CACJ,OAAQ,CAAC,cAAc,EACvB,KAAM,CAAC,WAAW,EAClB,eAAgB,CAAC,mBAAmB,EACpC,QAAS,CAAC,qBAAqB,EAC/B,QAAS,CAAC,qBAAqB,EAC/B,OAAQ,CAAC,oBAAoB,EAC7B,eAAgB,CAAC,0BAA0B,EAC3C,MAAO,CAAC,mBAAmB,CAC7B,EACA,QAAS,CACP,OAAQ,CAAC,gBAAgB,EACzB,OAAQ,CAAC,0BAA0B,EACnC,KAAM,CAAC,wBAAwB,EAC/B,MAAO,CAAC,eAAe,EACvB,OAAQ,CAAC,gBAAgB,EACzB,IAAK,CAAC,aAAa,EACnB,aAAc,CAAC,eAAe,EAC9B,WAAY,CAAC,aAAa,EAC1B,KAAM,CAAC,wBAAwB,EAC/B,MAAO,CAAC,yBAAyB,EACjC,gBAAiB,CAAC,iBAAiB,EACnC,eAAgB,CAAC,gBAAgB,EACjC,eAAgB,CAAC,gBAAgB,EACjC,QAAS,CAAC,iBAAiB,EAC3B,QAAS,CAAC,2BAA2B,EACrC,QAAS,CAAC,2BAA2B,EACrC,OAAQ,CAAC,0BAA0B,EACnC,eAAgB,CAAC,gCAAgC,EACjD,MAAO,CAAC,yBAAyB,CACnC,EACA,MAAO,CACL,OAAQ,CAAC,sBAAsB,EAC/B,OAAQ,CAAC,sBAAsB,EAC/B,KAAM,CAAC,oBAAoB,EAC3B,OAAQ,CAAC,cAAc,EACvB,MAAO,CAAC,aAAa,EACrB,IAAK,CAAC,WAAW,EACjB,aAAc,CAAC,0BAA0B,EACzC,WAAY,CAAC,wBAAwB,EACrC,aAAc,CAAC,aAAa,EAC5B,WAAY,CAAC,WAAW,EACxB,SAAU,CAAC,gBAAgB,EAC3B,iBAAkB,CAAC,8BAA8B,EACjD,gBAAiB,CAAC,6BAA6B,EAC/C,QAAS,CAAC,eAAe,EACzB,QAAS,CAAC,uBAAuB,EACjC,QAAS,CAAC,uBAAuB,EACjC,OAAQ,CAAC,sBAAsB,EAC/B,eAAgB,CAAC,4BAA4B,EAC7C,MAAO,CAAC,qBAAqB,CAC/B,EACA,IAAK,CACH,EAAG,CAAC,SAAS,EACb,EAAG,CAAC,OAAO,EACX,EAAG,CAAC,OAAO,EACX,EAAG,CAAC,OAAO,EACX,EAAG,CAAC,OAAO,EACX,GAAI,CAAC,OAAO,EACZ,EAAG,CAAC,OAAO,EACX,EAAG,CAAC,QAAQ,EACZ,EAAG,CAAC,QAAQ,EACZ,EAAG,CAAC,QAAQ,EACZ,EAAG,CAAC,QAAQ,CACd,CACF,CACF,EACA,CAAE,0BAA2B,EAAK,CACpC,EAEAD,EAAK,YAAc"}
1
+ {"version":3,"file":"Flex.js","sources":["../../../src/components/flex/Flex.tsx"],"sourcesContent":["import { styled } from '~/styled'\n\nexport const Flex = styled(\n 'div',\n {\n base: ['flex'],\n variants: {\n direction: {\n row: ['flex-row'],\n 'row-reverse': ['flex-row-reverse'],\n column: ['flex-col'],\n 'column-reverse': ['flex-col-reverse'],\n inherit: ['direction-[inherit]'],\n initial: ['direction-[initial]'],\n revert: ['direction-[revert]'],\n 'revert-layer': ['direction-[revert-layer]'],\n unset: ['direction-[unset]']\n },\n wrap: {\n nowrap: ['flex-nowrap'],\n wrap: ['flex-wrap'],\n 'wrap-reverse': ['flex-wrap-reverse'],\n inherit: ['[flex-wrap:inherit]'],\n initial: ['[flex-wrap:initial]'],\n revert: ['[flex-wrap:revert]'],\n 'revert-layer': ['[flex-wrap:revert-layer]'],\n unset: ['[flex-wrap:unset]']\n },\n justify: {\n normal: ['justify-normal'],\n unsafe: ['[justify-content:unsafe]'],\n safe: ['[justify-content:safe]'],\n start: ['justify-start'],\n center: ['justify-center'],\n end: ['justify-end'],\n 'flex-start': ['justify-start'],\n 'flex-end': ['justify-end'],\n left: ['[justify-content:left]'],\n right: ['[justify-content:right]'],\n 'space-between': ['justify-between'],\n 'space-around': ['justify-around'],\n 'space-evenly': ['justify-evenly'],\n stretch: ['justify-stretch'],\n inherit: ['[justify-content:inherit]'],\n initial: ['[justify-content:initial]'],\n revert: ['[justify-content:revert]'],\n 'revert-layer': ['[justify-content:revert-layer]'],\n unset: ['[justify-content:unset]']\n },\n align: {\n normal: ['[align-items:normal]'],\n unsafe: ['[align-items:unsafe]'],\n safe: ['[align-items:safe]'],\n center: ['items-center'],\n start: ['items-start'],\n end: ['items-end'],\n 'self-start': ['[align-items:self-start]'],\n 'self-end': ['[align-items:self-end]'],\n 'flex-start': ['items-start'],\n 'flex-end': ['items-end'],\n baseline: ['items-baseline'],\n 'first baseline': ['[align-items:first baseline]'],\n 'last baseline': ['[align-items:last baseline]'],\n stretch: ['items-stretch'],\n inherit: ['[align-items:inherit]'],\n initial: ['[align-items:initial]'],\n revert: ['[align-items:revert]'],\n 'revert-layer': ['[align-items:revert-layer]'],\n unset: ['[align-items:unset]']\n },\n gap: {\n 0: ['gap-0.5'],\n 1: ['gap-1'],\n 2: ['gap-2'],\n 3: ['gap-3'],\n 4: ['gap-4'],\n 24: ['gap-6'],\n 5: ['gap-8'],\n 6: ['gap-10'],\n 7: ['gap-12'],\n 8: ['gap-16'],\n 9: ['gap-20']\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\nFlex.displayName = 'Flex'\n"],"names":["Flex","styled"],"mappings":"yCAEO,MAAMA,EAAOC,EAClB,MACA,CACE,KAAM,CAAC,MAAM,EACb,SAAU,CACR,UAAW,CACT,IAAK,CAAC,UAAU,EAChB,cAAe,CAAC,kBAAkB,EAClC,OAAQ,CAAC,UAAU,EACnB,iBAAkB,CAAC,kBAAkB,EACrC,QAAS,CAAC,qBAAqB,EAC/B,QAAS,CAAC,qBAAqB,EAC/B,OAAQ,CAAC,oBAAoB,EAC7B,eAAgB,CAAC,0BAA0B,EAC3C,MAAO,CAAC,mBAAmB,CAC7B,EACA,KAAM,CACJ,OAAQ,CAAC,aAAa,EACtB,KAAM,CAAC,WAAW,EAClB,eAAgB,CAAC,mBAAmB,EACpC,QAAS,CAAC,qBAAqB,EAC/B,QAAS,CAAC,qBAAqB,EAC/B,OAAQ,CAAC,oBAAoB,EAC7B,eAAgB,CAAC,0BAA0B,EAC3C,MAAO,CAAC,mBAAmB,CAC7B,EACA,QAAS,CACP,OAAQ,CAAC,gBAAgB,EACzB,OAAQ,CAAC,0BAA0B,EACnC,KAAM,CAAC,wBAAwB,EAC/B,MAAO,CAAC,eAAe,EACvB,OAAQ,CAAC,gBAAgB,EACzB,IAAK,CAAC,aAAa,EACnB,aAAc,CAAC,eAAe,EAC9B,WAAY,CAAC,aAAa,EAC1B,KAAM,CAAC,wBAAwB,EAC/B,MAAO,CAAC,yBAAyB,EACjC,gBAAiB,CAAC,iBAAiB,EACnC,eAAgB,CAAC,gBAAgB,EACjC,eAAgB,CAAC,gBAAgB,EACjC,QAAS,CAAC,iBAAiB,EAC3B,QAAS,CAAC,2BAA2B,EACrC,QAAS,CAAC,2BAA2B,EACrC,OAAQ,CAAC,0BAA0B,EACnC,eAAgB,CAAC,gCAAgC,EACjD,MAAO,CAAC,yBAAyB,CACnC,EACA,MAAO,CACL,OAAQ,CAAC,sBAAsB,EAC/B,OAAQ,CAAC,sBAAsB,EAC/B,KAAM,CAAC,oBAAoB,EAC3B,OAAQ,CAAC,cAAc,EACvB,MAAO,CAAC,aAAa,EACrB,IAAK,CAAC,WAAW,EACjB,aAAc,CAAC,0BAA0B,EACzC,WAAY,CAAC,wBAAwB,EACrC,aAAc,CAAC,aAAa,EAC5B,WAAY,CAAC,WAAW,EACxB,SAAU,CAAC,gBAAgB,EAC3B,iBAAkB,CAAC,8BAA8B,EACjD,gBAAiB,CAAC,6BAA6B,EAC/C,QAAS,CAAC,eAAe,EACzB,QAAS,CAAC,uBAAuB,EACjC,QAAS,CAAC,uBAAuB,EACjC,OAAQ,CAAC,sBAAsB,EAC/B,eAAgB,CAAC,4BAA4B,EAC7C,MAAO,CAAC,qBAAqB,CAC/B,EACA,IAAK,CACH,EAAG,CAAC,SAAS,EACb,EAAG,CAAC,OAAO,EACX,EAAG,CAAC,OAAO,EACX,EAAG,CAAC,OAAO,EACX,EAAG,CAAC,OAAO,EACX,GAAI,CAAC,OAAO,EACZ,EAAG,CAAC,OAAO,EACX,EAAG,CAAC,QAAQ,EACZ,EAAG,CAAC,QAAQ,EACZ,EAAG,CAAC,QAAQ,EACZ,EAAG,CAAC,QAAQ,CACd,CACF,CACF,EACA,CAAE,0BAA2B,EAAK,CACpC,EAEAD,EAAK,YAAc"}
@@ -1,2 +1,2 @@
1
- import{Slot as p}from"@radix-ui/react-slot";import*as e from"react";import{styled as w}from"../../styled.js";import{useCallbackRefState as v}from"../../utilities/hooks/useCallbackRef.js";import{Text as k}from"../text/Text.js";const c=e.forwardRef(({asChild:o,config:s,targetWindow:r=!1,onKeyDown:n,...m},l)=>{const[f,y]=v();e.useImperativeHandle(l,()=>f);const t=e.useCallback(i=>{s.forEach(({shortcut:a,action:u})=>{Object.entries(a).every(([b,h])=>i[b]===h)&&u({event:i,shortcut:a})}),n==null||n(i)},[s,n]);return e.useEffect(()=>(r&&window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}),[r,t]),e.createElement(o?p:"div",{onKeyDown:r?void 0:t,ref:y,...m})});c.displayName="KeyboardShortcut";const x=w(k,{base:["bg-grey-100","text-text-subtle","px-2","py-0.5","min-w-6","min-h-6","font-normal","inline-flex","justify-center","items-center","rounded-md","shrink-0"]}),d=o=>e.createElement(x,{size:"sm",as:"kbd",...o});d.displayName="KeyboardShortcut";export{c as KeyboardShortcut,d as KeyboardShortcutIndicator};
1
+ import{Slot as p}from"@radix-ui/react-slot";import*as e from"react";import{styled as w}from"../../styled.js";import{useCallbackRefState as v}from"../../utilities/hooks/useCallbackRef.js";import{Text as x}from"../text/Text.js";const m=e.forwardRef(({asChild:o,config:s,targetWindow:r=!1,onKeyDown:n,...d},l)=>{const[f,y]=v();e.useImperativeHandle(l,()=>f);const t=e.useCallback(i=>{s.forEach(({shortcut:a,action:u})=>{Object.entries(a).every(([b,h])=>i[b]===h)&&u({event:i,shortcut:a})}),n==null||n(i)},[s,n]);return e.useEffect(()=>(r&&window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}),[r,t]),e.createElement(o?p:"div",{onKeyDown:r?void 0:t,ref:y,...d})});m.displayName="KeyboardShortcut";const k=w(x,{base:["bg-grey-100","text-text-subtle","px-2","text-[1em]","py-0.5","min-w-6","min-h-6","font-normal","inline-flex","justify-center","items-center","rounded-md","shrink-0"]}),c=o=>e.createElement(k,{size:"sm",as:"kbd",...o});c.displayName="KeyboardShortcut";export{m as KeyboardShortcut,c as KeyboardShortcutIndicator};
2
2
  //# sourceMappingURL=KeyboardShortcut.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"KeyboardShortcut.js","sources":["../../../src/components/keyboard-shortcut/KeyboardShortcut.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { useCallbackRefState } from '~/utilities/hooks/useCallbackRef'\n\nimport { Text } from '../text'\n\ntype KeyboardEventWindowOrElement =\n | KeyboardEvent\n | React.KeyboardEvent<HTMLDivElement>\ntype ShortcutConfig = Partial<KeyboardEvent>\n\ntype KeyboardShortcutProps = React.HTMLAttributes<HTMLDivElement> & {\n asChild?: boolean\n config: {\n shortcut: ShortcutConfig\n action: ({\n event,\n shortcut\n }: {\n event: KeyboardEvent | React.KeyboardEvent<HTMLDivElement>\n shortcut: ShortcutConfig\n }) => void\n }[]\n targetWindow?: boolean\n onKeyDown?: (e: KeyboardEventWindowOrElement) => void\n}\n\nexport const KeyboardShortcut = React.forwardRef<\n HTMLDivElement,\n KeyboardShortcutProps\n>(({ asChild, config, targetWindow = false, onKeyDown, ...rest }, ref) => {\n const [targetElRef, setTargetElRef] = useCallbackRefState()\n React.useImperativeHandle(ref, () => targetElRef as HTMLDivElement)\n\n const handleOnKeydown = React.useCallback(\n (e: KeyboardEventWindowOrElement) => {\n config.forEach(({ shortcut, action }) => {\n if (Object.entries(shortcut).every(([key, value]) => e[key] === value))\n action({ event: e, shortcut })\n })\n onKeyDown?.(e)\n },\n [config, onKeyDown]\n )\n\n React.useEffect(() => {\n if (targetWindow) window.addEventListener('keydown', handleOnKeydown)\n\n return () => {\n window.removeEventListener('keydown', handleOnKeydown)\n }\n }, [targetWindow, handleOnKeydown])\n\n const Component = asChild ? Slot : 'div'\n\n return (\n <Component\n onKeyDown={targetWindow ? undefined : (handleOnKeydown as any)}\n ref={setTargetElRef}\n {...rest}\n />\n )\n})\n\nKeyboardShortcut.displayName = 'KeyboardShortcut'\n\nconst StyledKeyboardShortcutIndicator = styled(Text, {\n base: [\n 'bg-grey-100',\n 'text-text-subtle',\n 'px-2',\n 'py-0.5',\n 'min-w-6',\n 'min-h-6',\n 'font-normal',\n 'inline-flex',\n 'justify-center',\n 'items-center',\n 'rounded-md',\n 'shrink-0'\n ]\n})\n\ntype KeyboardShortcutIndicatorProps = React.ComponentProps<\n typeof StyledKeyboardShortcutIndicator\n>\n\nexport const KeyboardShortcutIndicator = (\n props: KeyboardShortcutIndicatorProps\n) => {\n return <StyledKeyboardShortcutIndicator size=\"sm\" as=\"kbd\" {...props} />\n}\n\nKeyboardShortcutIndicator.displayName = 'KeyboardShortcut'\n"],"names":["KeyboardShortcut","React","asChild","config","targetWindow","onKeyDown","rest","ref","targetElRef","setTargetElRef","useCallbackRefState","handleOnKeydown","e","shortcut","action","key","value","Slot","StyledKeyboardShortcutIndicator","styled","Text","KeyboardShortcutIndicator","props"],"mappings":"wOA6BaA,EAAmBC,EAAM,WAGpC,CAAC,CAAE,QAAAC,EAAS,OAAAC,EAAQ,aAAAC,EAAe,GAAO,UAAAC,EAAW,GAAGC,CAAK,EAAGC,IAAQ,CACxE,KAAM,CAACC,EAAaC,CAAc,EAAIC,EACtCT,EAAAA,EAAM,oBAAoBM,EAAK,IAAMC,CAA6B,EAElE,MAAMG,EAAkBV,EAAM,YAC3BW,GAAoC,CACnCT,EAAO,QAAQ,CAAC,CAAE,SAAAU,EAAU,OAAAC,CAAO,IAAM,CACnC,OAAO,QAAQD,CAAQ,EAAE,MAAM,CAAC,CAACE,EAAKC,CAAK,IAAMJ,EAAEG,CAAG,IAAMC,CAAK,GACnEF,EAAO,CAAE,MAAOF,EAAG,SAAAC,CAAS,CAAC,CACjC,CAAC,EACDR,GAAA,MAAAA,EAAYO,CAAAA,CACd,EACA,CAACT,EAAQE,CAAS,CACpB,EAEA,OAAAJ,EAAM,UAAU,KACVG,GAAc,OAAO,iBAAiB,UAAWO,CAAe,EAE7D,IAAM,CACX,OAAO,oBAAoB,UAAWA,CAAe,CACvD,GACC,CAACP,EAAcO,CAAe,CAAC,EAKhCV,EAAA,cAHgBC,EAAUe,EAAO,MAGhC,CACC,UAAWb,EAAe,OAAaO,EACvC,IAAKF,EACJ,GAAGH,CAAAA,CACN,CAEJ,CAAC,EAEDN,EAAiB,YAAc,mBAE/B,MAAMkB,EAAkCC,EAAOC,EAAM,CACnD,KAAM,CACJ,cACA,mBACA,OACA,SACA,UACA,UACA,cACA,cACA,iBACA,eACA,aACA,UACF,CACF,CAAC,EAMYC,EACXC,GAEOrB,EAAA,cAACiB,EAAA,CAAgC,KAAK,KAAK,GAAG,MAAO,GAAGI,CAAO,CAAA,EAGxED,EAA0B,YAAc"}
1
+ {"version":3,"file":"KeyboardShortcut.js","sources":["../../../src/components/keyboard-shortcut/KeyboardShortcut.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { useCallbackRefState } from '~/utilities/hooks/useCallbackRef'\n\nimport { Text } from '../text'\n\ntype KeyboardEventWindowOrElement =\n | KeyboardEvent\n | React.KeyboardEvent<HTMLDivElement>\ntype ShortcutConfig = Partial<KeyboardEvent>\n\ntype KeyboardShortcutProps = React.HTMLAttributes<HTMLDivElement> & {\n asChild?: boolean\n config: {\n shortcut: ShortcutConfig\n action: ({\n event,\n shortcut\n }: {\n event: KeyboardEvent | React.KeyboardEvent<HTMLDivElement>\n shortcut: ShortcutConfig\n }) => void\n }[]\n targetWindow?: boolean\n onKeyDown?: (e: KeyboardEventWindowOrElement) => void\n}\n\nexport const KeyboardShortcut = React.forwardRef<\n HTMLDivElement,\n KeyboardShortcutProps\n>(({ asChild, config, targetWindow = false, onKeyDown, ...rest }, ref) => {\n const [targetElRef, setTargetElRef] = useCallbackRefState()\n React.useImperativeHandle(ref, () => targetElRef as HTMLDivElement)\n\n const handleOnKeydown = React.useCallback(\n (e: KeyboardEventWindowOrElement) => {\n config.forEach(({ shortcut, action }) => {\n if (Object.entries(shortcut).every(([key, value]) => e[key] === value))\n action({ event: e, shortcut })\n })\n onKeyDown?.(e)\n },\n [config, onKeyDown]\n )\n\n React.useEffect(() => {\n if (targetWindow) window.addEventListener('keydown', handleOnKeydown)\n\n return () => {\n window.removeEventListener('keydown', handleOnKeydown)\n }\n }, [targetWindow, handleOnKeydown])\n\n const Component = asChild ? Slot : 'div'\n\n return (\n <Component\n onKeyDown={targetWindow ? undefined : (handleOnKeydown as any)}\n ref={setTargetElRef}\n {...rest}\n />\n )\n})\n\nKeyboardShortcut.displayName = 'KeyboardShortcut'\n\nconst StyledKeyboardShortcutIndicator = styled(Text, {\n base: [\n 'bg-grey-100',\n 'text-text-subtle',\n 'px-2',\n 'text-[1em]',\n 'py-0.5',\n 'min-w-6',\n 'min-h-6',\n 'font-normal',\n 'inline-flex',\n 'justify-center',\n 'items-center',\n 'rounded-md',\n 'shrink-0'\n ]\n})\n\ntype KeyboardShortcutIndicatorProps = React.ComponentProps<\n typeof StyledKeyboardShortcutIndicator\n>\n\nexport const KeyboardShortcutIndicator = (\n props: KeyboardShortcutIndicatorProps\n) => {\n return <StyledKeyboardShortcutIndicator size=\"sm\" as=\"kbd\" {...props} />\n}\n\nKeyboardShortcutIndicator.displayName = 'KeyboardShortcut'\n"],"names":["KeyboardShortcut","React","asChild","config","targetWindow","onKeyDown","rest","ref","targetElRef","setTargetElRef","useCallbackRefState","handleOnKeydown","e","shortcut","action","key","value","Slot","StyledKeyboardShortcutIndicator","styled","Text","KeyboardShortcutIndicator","props"],"mappings":"wOA6BaA,EAAmBC,EAAM,WAGpC,CAAC,CAAE,QAAAC,EAAS,OAAAC,EAAQ,aAAAC,EAAe,GAAO,UAAAC,EAAW,GAAGC,CAAK,EAAGC,IAAQ,CACxE,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,EACtCT,EAAM,oBAAoBM,EAAK,IAAMC,CAA6B,EAElE,MAAMG,EAAkBV,EAAM,YAC3BW,GAAoC,CACnCT,EAAO,QAAQ,CAAC,CAAE,SAAAU,EAAU,OAAAC,CAAO,IAAM,CACnC,OAAO,QAAQD,CAAQ,EAAE,MAAM,CAAC,CAACE,EAAKC,CAAK,IAAMJ,EAAEG,CAAG,IAAMC,CAAK,GACnEF,EAAO,CAAE,MAAOF,EAAG,SAAAC,CAAS,CAAC,CACjC,CAAC,EACDR,GAAA,MAAAA,EAAYO,CAAAA,CACd,EACA,CAACT,EAAQE,CAAS,CACpB,EAEA,OAAAJ,EAAM,UAAU,KACVG,GAAc,OAAO,iBAAiB,UAAWO,CAAe,EAE7D,IAAM,CACX,OAAO,oBAAoB,UAAWA,CAAe,CACvD,GACC,CAACP,EAAcO,CAAe,CAAC,EAKhCV,EAAA,cAHgBC,EAAUe,EAAO,MAGhC,CACC,UAAWb,EAAe,OAAaO,EACvC,IAAKF,EACJ,GAAGH,CACN,CAAA,CAEJ,CAAC,EAEDN,EAAiB,YAAc,mBAE/B,MAAMkB,EAAkCC,EAAOC,EAAM,CACnD,KAAM,CACJ,cACA,mBACA,OACA,aACA,SACA,UACA,UACA,cACA,cACA,iBACA,eACA,aACA,UACF,CACF,CAAC,EAMYC,EACXC,GAEOrB,EAAA,cAACiB,EAAA,CAAgC,KAAK,KAAK,GAAG,MAAO,GAAGI,CAAO,CAAA,EAGxED,EAA0B,YAAc"}
@@ -1,2 +1,2 @@
1
- import o from"react";import{Text as i}from"../text/Text.js";import{styled as n}from"../../styled.js";import"../side-bar/SideBar.js";import{useSidebarState as s}from"../side-bar/SideBarContext.js";const r=n(i,{base:["font-(--navigation-menu-vertical-item-font-weight)","leading-[1.2]","w-max","max-w-40","opacity-100","motion-safe:translate-0","motion-safe:duration-125","motion-safe:ease-out","motion-safe:transition-[opacity,translate]"],variants:{isExpanded:{true:["opacity-100","motion-safe:translate-0"],false:["opacity-0","motion-safe:translate-x-2"]}},defaultVariants:{isExpanded:!0}}),m=t=>{const{isExpanded:a,shouldExpand:e}=s();return o.createElement(r,{size:"md",as:"span",...t,...e&&{isExpanded:a}})};export{m as NavigationMenuVerticalText};
1
+ import e from"react";import{Text as o}from"../text/Text.js";import{styled as i}from"../../styled.js";import"../side-bar/SideBar.js";import{useSidebarState as n}from"../side-bar/SideBarContext.js";const r=i(o,{base:["font-(--navigation-menu-vertical-item-font-weight)","leading-[1.2]","w-max","max-w-40","motion-safe:duration-125","motion-safe:ease-out","motion-safe:transition-[opacity,translate]"],variants:{isExpanded:{true:["opacity-100","motion-safe:translate-0"],false:["opacity-0","motion-safe:translate-x-2"]}}}),s=t=>{const{isExpanded:a}=n();return e.createElement(r,{size:"md",as:"span",...t,isExpanded:a})};export{s as NavigationMenuVerticalText};
2
2
  //# sourceMappingURL=NavigationMenuVerticalText.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationMenuVerticalText.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalText.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '~/components/text'\nimport { styled } from '~/styled'\n\nimport { useSidebarState } from '../side-bar'\n\nconst StyledNavigationMenuVerticalText = styled(Text, {\n base: [\n 'font-(--navigation-menu-vertical-item-font-weight)',\n 'leading-[1.2]',\n 'w-max',\n 'max-w-40',\n 'opacity-100',\n 'motion-safe:translate-0',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[opacity,translate]'\n ],\n variants: {\n isExpanded: {\n true: ['opacity-100', 'motion-safe:translate-0'],\n false: ['opacity-0', 'motion-safe:translate-x-2']\n }\n },\n defaultVariants: {\n isExpanded: true\n }\n})\n\ntype TStyledNavigationMenuVerticalTextProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalText\n>\n\nexport const NavigationMenuVerticalText = (\n props: TStyledNavigationMenuVerticalTextProps\n): JSX.Element => {\n const { isExpanded, shouldExpand } = useSidebarState()\n\n return (\n <StyledNavigationMenuVerticalText\n size=\"md\"\n as=\"span\"\n {...props}\n {...(shouldExpand && { isExpanded })}\n />\n )\n}\n"],"names":["StyledNavigationMenuVerticalText","styled","Text","NavigationMenuVerticalText","props","isExpanded","shouldExpand","useSidebarState","React"],"mappings":"oMAOA,MAAMA,EAAmCC,EAAOC,EAAM,CACpD,KAAM,CACJ,qDACA,gBACA,QACA,WACA,cACA,0BACA,2BACA,uBACA,4CACF,EACA,SAAU,CACR,WAAY,CACV,KAAM,CAAC,cAAe,yBAAyB,EAC/C,MAAO,CAAC,YAAa,2BAA2B,CAClD,CACF,EACA,gBAAiB,CACf,WAAY,EACd,CACF,CAAC,EAMYC,EACXC,GACgB,CAChB,KAAM,CAAE,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAAA,EAErC,OACEC,EAAA,cAACR,EAAA,CACC,KAAK,KACL,GAAG,OACF,GAAGI,EACH,GAAIE,GAAgB,CAAE,WAAAD,CAAW,EACpC,CAEJ"}
1
+ {"version":3,"file":"NavigationMenuVerticalText.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalText.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '~/components/text'\nimport { styled } from '~/styled'\n\nimport { useSidebarState } from '../side-bar'\n\nconst StyledNavigationMenuVerticalText = styled(Text, {\n base: [\n 'font-(--navigation-menu-vertical-item-font-weight)',\n 'leading-[1.2]',\n 'w-max',\n 'max-w-40',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[opacity,translate]'\n ],\n variants: {\n isExpanded: {\n true: ['opacity-100', 'motion-safe:translate-0'],\n false: ['opacity-0', 'motion-safe:translate-x-2']\n }\n }\n})\n\ntype TStyledNavigationMenuVerticalTextProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalText\n>\n\nexport const NavigationMenuVerticalText = (\n props: TStyledNavigationMenuVerticalTextProps\n): JSX.Element => {\n const { isExpanded } = useSidebarState()\n\n return (\n <StyledNavigationMenuVerticalText\n size=\"md\"\n as=\"span\"\n {...props}\n isExpanded={isExpanded}\n />\n )\n}\n"],"names":["StyledNavigationMenuVerticalText","styled","Text","NavigationMenuVerticalText","props","isExpanded","useSidebarState","React"],"mappings":"oMAOA,MAAMA,EAAmCC,EAAOC,EAAM,CACpD,KAAM,CACJ,qDACA,gBACA,QACA,WACA,2BACA,uBACA,4CACF,EACA,SAAU,CACR,WAAY,CACV,KAAM,CAAC,cAAe,yBAAyB,EAC/C,MAAO,CAAC,YAAa,2BAA2B,CAClD,CACF,CACF,CAAC,EAMYC,EACXC,GACgB,CAChB,KAAM,CAAE,WAAAC,CAAW,EAAIC,IAEvB,OACEC,EAAA,cAACP,EAAA,CACC,KAAK,KACL,GAAG,OACF,GAAGI,EACJ,WAAYC,EACd,CAEJ"}
@@ -1,2 +1,2 @@
1
- import v from"clsx";import a from"react";import{useInteractOutside as B,useFocusWithin as y,useHover as E}from"react-aria";import{styled as i,Theme as g}from"../../styled.js";import{SideBarBrand as w,SideBarBrandLogo as S,SideBarBrandName as _,SideBarHeader as H,SideBarBody as N,SideBarFooter as F}from"./SideBarComponents.js";import{SideBarContext as k}from"./SideBarContext.js";const W={"--background":"white","--text":"var(--color-grey-800)","--border":"var(--color-grey-200)"},P=i("div",{base:["sticky","z-1"],variants:{type:{static:[],expandable:["w-22"]}}}),T=i("div",{base:["bg-(--background)","border-r","border-r-(--border)","shadow-[4px_0_4px_-2px_rgba(31,31,31,0)]","flex","flex-col","h-full","overflow-hidden","will-change-width","motion-safe:duration-125","motion-safe:ease-out","motion-safe:transition-[shadow,width]"],variants:{type:{static:[],expandable:[]},isExpanded:{true:["w-[16rem]"],false:["w-22"]}},compoundVariants:[{isExpanded:!0,type:"expandable",class:["shadow-[4px_0_4px_-2px_rgba(31,31,31,0.1)]"]}]}),V=i("div",{base:["bottom-0","left-0","absolute","right-0","top-0","transition-all"],variants:{isVisible:{true:["delay-0","visible"],false:["delay-50","invisible"]}}}),e=({theme:n,className:l,children:p,type:o="expandable",offset:m="0px",style:c,...f})=>{const d=o==="expandable",[r,t]=a.useState(d),s=a.useRef(null);B({ref:s,onInteractOutside:()=>t(!1)});const{focusWithinProps:u}=y({onFocusWithin:()=>t(!0),onBlurWithin:()=>t(!1)}),{hoverProps:b,isHovered:x}=E({onHoverStart:()=>t(!0),onHoverEnd:()=>t(!1)}),h=o==="expandable"?{...u,...b,onTouchEnd:()=>t(!0),ref:s}:{};return a.createElement(k.Provider,{value:{isExpanded:r,shouldExpand:d}},a.createElement(g,{theme:n||W},a.createElement(P,{...f,style:{...c,"--offset":m},type:o,className:v("h-[calc(100svh-var(--offset))]","top-(--offset)",l)},a.createElement(T,{...h,isExpanded:r,type:o},p,o==="expandable"&&a.createElement(V,{isVisible:!x&&!r})))))};e.Brand=w,e.BrandLogo=S,e.BrandName=_,e.Header=H,e.Body=N,e.Footer=F,e.displayName="SideBar";export{e as SideBar};
1
+ import x from"clsx";import a from"react";import{useInteractOutside as v,useFocusWithin as B,useHover as y}from"react-aria";import{styled as i,Theme as g}from"../../styled.js";import{SideBarBrand as w,SideBarBrandLogo as E,SideBarBrandName as S,SideBarHeader as _,SideBarBody as H,SideBarFooter as N}from"./SideBarComponents.js";import{SideBarContext as k}from"./SideBarContext.js";const F={"--background":"white","--text":"var(--color-grey-800)","--border":"var(--color-grey-200)"},W=i("div",{base:["sticky","z-1"],variants:{type:{static:[],expandable:["w-22"]}}}),P=i("div",{base:["bg-(--background)","border-r","border-r-(--border)","shadow-[4px_0_4px_-2px_rgba(31,31,31,0)]","flex","flex-col","h-full","overflow-hidden","will-change-width","motion-safe:duration-125","motion-safe:ease-out","motion-safe:transition-[shadow,width]"],variants:{type:{static:[],expandable:[]},isExpanded:{true:["w-[16rem]"],false:["w-22"]}},compoundVariants:[{isExpanded:!0,type:"expandable",class:["shadow-[4px_0_4px_-2px_rgba(31,31,31,0.1)]"]}]}),T=i("div",{base:["bottom-0","left-0","absolute","right-0","top-0","transition-all"],variants:{isVisible:{true:["delay-0","visible"],false:["delay-50","invisible"]}}}),e=({theme:d,className:n,children:l,type:t="expandable",offset:p="0px",style:c,...m})=>{const[o,r]=a.useState(t==="static"),s=a.useRef(null);v({ref:s,onInteractOutside:()=>r(!1)});const{focusWithinProps:f}=B({onFocusWithin:()=>r(!0),onBlurWithin:()=>r(!1)}),{hoverProps:u,isHovered:b}=y({onHoverStart:()=>r(!0),onHoverEnd:()=>r(!1)}),h=t==="expandable"?{...f,...u,onTouchEnd:()=>r(!0),ref:s}:{};return a.createElement(k.Provider,{value:{isExpanded:o}},a.createElement(g,{theme:d||F},a.createElement(W,{...m,style:{...c,"--offset":p},type:t,className:x("h-[calc(100svh-var(--offset))]","top-(--offset)",n)},a.createElement(P,{...h,isExpanded:o,type:t},l,t==="expandable"&&a.createElement(T,{isVisible:!b&&!o})))))};e.Brand=w,e.BrandLogo=E,e.BrandName=S,e.Header=_,e.Body=H,e.Footer=N,e.displayName="SideBar";export{e as SideBar};
2
2
  //# sourceMappingURL=SideBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideBar.js","sources":["../../../src/components/side-bar/SideBar.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport React from 'react'\nimport { useFocusWithin, useHover, useInteractOutside } from 'react-aria'\n\nimport { styled, Theme } from '~/styled'\n\nimport {\n SideBarBody,\n SideBarBrand,\n SideBarBrandLogo,\n SideBarBrandName,\n SideBarFooter,\n SideBarHeader\n} from './SideBarComponents'\nimport { SideBarContext } from './SideBarContext'\n\nconst light = {\n '--background': 'white',\n '--text': 'var(--color-grey-800)',\n '--border': 'var(--color-grey-200)'\n}\n\nconst Root = styled('div', {\n base: ['sticky', 'z-1'],\n variants: {\n type: {\n static: [],\n expandable: ['w-22']\n }\n }\n})\n\nconst Content = styled('div', {\n base: [\n 'bg-(--background)',\n 'border-r',\n 'border-r-(--border)',\n 'shadow-[4px_0_4px_-2px_rgba(31,31,31,0)]',\n 'flex',\n 'flex-col',\n 'h-full',\n 'overflow-hidden',\n 'will-change-width',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[shadow,width]'\n ],\n variants: {\n type: {\n static: [],\n expandable: []\n },\n isExpanded: {\n true: ['w-[16rem]'],\n false: ['w-22']\n }\n },\n compoundVariants: [\n {\n isExpanded: true,\n type: 'expandable',\n class: ['shadow-[4px_0_4px_-2px_rgba(31,31,31,0.1)]']\n }\n ]\n})\n\nconst PointerBlocker = styled('div', {\n base: [\n 'bottom-0',\n 'left-0',\n 'absolute',\n 'right-0',\n 'top-0',\n 'transition-all'\n ],\n variants: {\n isVisible: {\n true: ['delay-0', 'visible'],\n false: ['delay-50', 'invisible']\n }\n }\n})\n\ntype SideBarProps = React.ComponentProps<typeof Root> & {\n className?: string\n offset?: number | string\n} & React.ComponentProps<typeof Theme>\n\nexport const SideBar = ({\n theme,\n className,\n children,\n type = 'expandable',\n offset = '0px',\n style,\n ...rest\n}: SideBarProps) => {\n const shouldExpand = type === 'expandable'\n const [isExpanded, setIsExpanded] = React.useState(shouldExpand)\n const ref = React.useRef<HTMLDivElement>(null)\n\n useInteractOutside({\n ref,\n onInteractOutside: () => setIsExpanded(false)\n })\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin: () => setIsExpanded(true),\n onBlurWithin: () => setIsExpanded(false)\n })\n const { hoverProps, isHovered } = useHover({\n onHoverStart: () => setIsExpanded(true),\n onHoverEnd: () => setIsExpanded(false)\n })\n const touchProps = {\n onTouchEnd: () => setIsExpanded(true)\n }\n\n const expandableProps =\n type === 'expandable'\n ? {\n ...focusWithinProps,\n ...hoverProps,\n ...touchProps,\n ref\n }\n : {}\n\n return (\n <SideBarContext.Provider value={{ isExpanded, shouldExpand }}>\n <Theme theme={theme || light}>\n <Root\n {...rest}\n style={{ ...style, '--offset': offset }}\n type={type}\n className={clsx(\n 'h-[calc(100svh-var(--offset))]',\n 'top-(--offset)',\n className\n )}\n >\n <Content {...expandableProps} isExpanded={isExpanded} type={type}>\n {children}\n {/**\n * When the SideBar is collapsed, ensure that the initial tap event\n * is used to expand the nav first before making the items available\n */}\n {type === 'expandable' && (\n <PointerBlocker isVisible={!isHovered && !isExpanded} />\n )}\n </Content>\n </Root>\n </Theme>\n </SideBarContext.Provider>\n )\n}\n\nSideBar.Brand = SideBarBrand\nSideBar.BrandLogo = SideBarBrandLogo\nSideBar.BrandName = SideBarBrandName\nSideBar.Header = SideBarHeader\nSideBar.Body = SideBarBody\nSideBar.Footer = SideBarFooter\n\nSideBar.displayName = 'SideBar'\n"],"names":["light","Root","styled","Content","PointerBlocker","SideBar","theme","className","children","type","offset","style","rest","shouldExpand","isExpanded","setIsExpanded","React","ref","useInteractOutside","focusWithinProps","useFocusWithin","hoverProps","isHovered","useHover","expandableProps","SideBarContext","Theme","clsx","SideBarBrand","SideBarBrandLogo","SideBarBrandName","SideBarHeader","SideBarBody","SideBarFooter"],"mappings":"6XAgBA,MAAMA,EAAQ,CACZ,eAAgB,QAChB,SAAU,wBACV,WAAY,uBACd,EAEMC,EAAOC,EAAO,MAAO,CACzB,KAAM,CAAC,SAAU,KAAK,EACtB,SAAU,CACR,KAAM,CACJ,OAAQ,GACR,WAAY,CAAC,MAAM,CACrB,CACF,CACF,CAAC,EAEKC,EAAUD,EAAO,MAAO,CAC5B,KAAM,CACJ,oBACA,WACA,sBACA,2CACA,OACA,WACA,SACA,kBACA,oBACA,2BACA,uBACA,uCACF,EACA,SAAU,CACR,KAAM,CACJ,OAAQ,GACR,WAAY,CAAA,CACd,EACA,WAAY,CACV,KAAM,CAAC,WAAW,EAClB,MAAO,CAAC,MAAM,CAChB,CACF,EACA,iBAAkB,CAChB,CACE,WAAY,GACZ,KAAM,aACN,MAAO,CAAC,4CAA4C,CACtD,CACF,CACF,CAAC,EAEKE,EAAiBF,EAAO,MAAO,CACnC,KAAM,CACJ,WACA,SACA,WACA,UACA,QACA,gBACF,EACA,SAAU,CACR,UAAW,CACT,KAAM,CAAC,UAAW,SAAS,EAC3B,MAAO,CAAC,WAAY,WAAW,CACjC,CACF,CACF,CAAC,EAOYG,EAAU,CAAC,CACtB,MAAAC,EACA,UAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,aACP,OAAAC,EAAS,MACT,MAAAC,EACA,GAAGC,CACL,IAAoB,CAClB,MAAMC,EAAeJ,IAAS,aACxB,CAACK,EAAYC,CAAa,EAAIC,EAAM,SAASH,CAAY,EACzDI,EAAMD,EAAM,OAAuB,IAAI,EAE7CE,EAAmB,CACjB,IAAAD,EACA,kBAAmB,IAAMF,EAAc,EAAK,CAC9C,CAAC,EACD,KAAM,CAAE,iBAAAI,CAAiB,EAAIC,EAAe,CAC1C,cAAe,IAAML,EAAc,EAAI,EACvC,aAAc,IAAMA,EAAc,EAAK,CACzC,CAAC,EACK,CAAE,WAAAM,EAAY,UAAAC,CAAU,EAAIC,EAAS,CACzC,aAAc,IAAMR,EAAc,EAAI,EACtC,WAAY,IAAMA,EAAc,EAAK,CACvC,CAAC,EAKKS,EACJf,IAAS,aACL,CACE,GAAGU,EACH,GAAGE,EAPT,WAAY,IAAMN,EAAc,EAAI,EAS9B,IAAAE,CACF,EACA,CAEN,EAAA,OACED,EAAA,cAACS,EAAe,SAAf,CAAwB,MAAO,CAAE,WAAAX,EAAY,aAAAD,CAAa,GACzDG,EAAA,cAACU,EAAA,CAAM,MAAOpB,GAASN,CACrBgB,EAAAA,EAAA,cAACf,EAAA,CACE,GAAGW,EACJ,MAAO,CAAE,GAAGD,EAAO,WAAYD,CAAO,EACtC,KAAMD,EACN,UAAWkB,EACT,iCACA,iBACApB,CACF,CAAA,EAEAS,EAAA,cAACb,EAAA,CAAS,GAAGqB,EAAiB,WAAYV,EAAY,KAAML,CACzDD,EAAAA,EAKAC,IAAS,cACRO,EAAA,cAACZ,EAAA,CAAe,UAAW,CAACkB,GAAa,CAACR,CAAY,CAAA,CAE1D,CACF,CACF,CACF,CAEJ,EAEAT,EAAQ,MAAQuB,EAChBvB,EAAQ,UAAYwB,EACpBxB,EAAQ,UAAYyB,EACpBzB,EAAQ,OAAS0B,EACjB1B,EAAQ,KAAO2B,EACf3B,EAAQ,OAAS4B,EAEjB5B,EAAQ,YAAc"}
1
+ {"version":3,"file":"SideBar.js","sources":["../../../src/components/side-bar/SideBar.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport React from 'react'\nimport { useFocusWithin, useHover, useInteractOutside } from 'react-aria'\n\nimport { styled, Theme } from '~/styled'\n\nimport {\n SideBarBody,\n SideBarBrand,\n SideBarBrandLogo,\n SideBarBrandName,\n SideBarFooter,\n SideBarHeader\n} from './SideBarComponents'\nimport { SideBarContext } from './SideBarContext'\n\nconst light = {\n '--background': 'white',\n '--text': 'var(--color-grey-800)',\n '--border': 'var(--color-grey-200)'\n}\n\nconst Root = styled('div', {\n base: ['sticky', 'z-1'],\n variants: {\n type: {\n static: [],\n expandable: ['w-22']\n }\n }\n})\n\nconst Content = styled('div', {\n base: [\n 'bg-(--background)',\n 'border-r',\n 'border-r-(--border)',\n 'shadow-[4px_0_4px_-2px_rgba(31,31,31,0)]',\n 'flex',\n 'flex-col',\n 'h-full',\n 'overflow-hidden',\n 'will-change-width',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[shadow,width]'\n ],\n variants: {\n type: {\n static: [],\n expandable: []\n },\n isExpanded: {\n true: ['w-[16rem]'],\n false: ['w-22']\n }\n },\n compoundVariants: [\n {\n isExpanded: true,\n type: 'expandable',\n class: ['shadow-[4px_0_4px_-2px_rgba(31,31,31,0.1)]']\n }\n ]\n})\n\nconst PointerBlocker = styled('div', {\n base: [\n 'bottom-0',\n 'left-0',\n 'absolute',\n 'right-0',\n 'top-0',\n 'transition-all'\n ],\n variants: {\n isVisible: {\n true: ['delay-0', 'visible'],\n false: ['delay-50', 'invisible']\n }\n }\n})\n\ntype SideBarProps = React.ComponentProps<typeof Root> & {\n className?: string\n offset?: number | string\n} & React.ComponentProps<typeof Theme>\n\nexport const SideBar = ({\n theme,\n className,\n children,\n type = 'expandable',\n offset = '0px',\n style,\n ...rest\n}: SideBarProps) => {\n const [isExpanded, setIsExpanded] = React.useState(type === 'static')\n const ref = React.useRef<HTMLDivElement>(null)\n\n useInteractOutside({\n ref,\n onInteractOutside: () => setIsExpanded(false)\n })\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin: () => setIsExpanded(true),\n onBlurWithin: () => setIsExpanded(false)\n })\n const { hoverProps, isHovered } = useHover({\n onHoverStart: () => setIsExpanded(true),\n onHoverEnd: () => setIsExpanded(false)\n })\n const touchProps = {\n onTouchEnd: () => setIsExpanded(true)\n }\n\n const expandableProps =\n type === 'expandable'\n ? {\n ...focusWithinProps,\n ...hoverProps,\n ...touchProps,\n ref\n }\n : {}\n\n return (\n <SideBarContext.Provider value={{ isExpanded }}>\n <Theme theme={theme || light}>\n <Root\n {...rest}\n style={{ ...style, '--offset': offset }}\n type={type}\n className={clsx(\n 'h-[calc(100svh-var(--offset))]',\n 'top-(--offset)',\n className\n )}\n >\n <Content {...expandableProps} isExpanded={isExpanded} type={type}>\n {children}\n {/**\n * When the SideBar is collapsed, ensure that the initial tap event\n * is used to expand the nav first before making the items available\n */}\n {type === 'expandable' && (\n <PointerBlocker isVisible={!isHovered && !isExpanded} />\n )}\n </Content>\n </Root>\n </Theme>\n </SideBarContext.Provider>\n )\n}\n\nSideBar.Brand = SideBarBrand\nSideBar.BrandLogo = SideBarBrandLogo\nSideBar.BrandName = SideBarBrandName\nSideBar.Header = SideBarHeader\nSideBar.Body = SideBarBody\nSideBar.Footer = SideBarFooter\n\nSideBar.displayName = 'SideBar'\n"],"names":["light","Root","styled","Content","PointerBlocker","SideBar","theme","className","children","type","offset","style","rest","isExpanded","setIsExpanded","React","ref","useInteractOutside","focusWithinProps","useFocusWithin","hoverProps","isHovered","useHover","expandableProps","SideBarContext","Theme","clsx","SideBarBrand","SideBarBrandLogo","SideBarBrandName","SideBarHeader","SideBarBody","SideBarFooter"],"mappings":"6XAgBA,MAAMA,EAAQ,CACZ,eAAgB,QAChB,SAAU,wBACV,WAAY,uBACd,EAEMC,EAAOC,EAAO,MAAO,CACzB,KAAM,CAAC,SAAU,KAAK,EACtB,SAAU,CACR,KAAM,CACJ,OAAQ,CAAA,EACR,WAAY,CAAC,MAAM,CACrB,CACF,CACF,CAAC,EAEKC,EAAUD,EAAO,MAAO,CAC5B,KAAM,CACJ,oBACA,WACA,sBACA,2CACA,OACA,WACA,SACA,kBACA,oBACA,2BACA,uBACA,uCACF,EACA,SAAU,CACR,KAAM,CACJ,OAAQ,CACR,EAAA,WAAY,CACd,CAAA,EACA,WAAY,CACV,KAAM,CAAC,WAAW,EAClB,MAAO,CAAC,MAAM,CAChB,CACF,EACA,iBAAkB,CAChB,CACE,WAAY,GACZ,KAAM,aACN,MAAO,CAAC,4CAA4C,CACtD,CACF,CACF,CAAC,EAEKE,EAAiBF,EAAO,MAAO,CACnC,KAAM,CACJ,WACA,SACA,WACA,UACA,QACA,gBACF,EACA,SAAU,CACR,UAAW,CACT,KAAM,CAAC,UAAW,SAAS,EAC3B,MAAO,CAAC,WAAY,WAAW,CACjC,CACF,CACF,CAAC,EAOYG,EAAU,CAAC,CACtB,MAAAC,EACA,UAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,aACP,OAAAC,EAAS,MACT,MAAAC,EACA,GAAGC,CACL,IAAoB,CAClB,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAM,SAASN,IAAS,QAAQ,EAC9DO,EAAMD,EAAM,OAAuB,IAAI,EAE7CE,EAAmB,CACjB,IAAAD,EACA,kBAAmB,IAAMF,EAAc,EAAK,CAC9C,CAAC,EACD,KAAM,CAAE,iBAAAI,CAAiB,EAAIC,EAAe,CAC1C,cAAe,IAAML,EAAc,EAAI,EACvC,aAAc,IAAMA,EAAc,EAAK,CACzC,CAAC,EACK,CAAE,WAAAM,EAAY,UAAAC,CAAU,EAAIC,EAAS,CACzC,aAAc,IAAMR,EAAc,EAAI,EACtC,WAAY,IAAMA,EAAc,EAAK,CACvC,CAAC,EAKKS,EACJd,IAAS,aACL,CACE,GAAGS,EACH,GAAGE,EAPT,WAAY,IAAMN,EAAc,EAAI,EAS9B,IAAAE,CACF,EACA,CAAA,EAEN,OACED,EAAA,cAACS,EAAe,SAAf,CAAwB,MAAO,CAAE,WAAAX,CAAW,CAAA,EAC3CE,EAAA,cAACU,EAAA,CAAM,MAAOnB,GAASN,GACrBe,EAAA,cAACd,EAAA,CACE,GAAGW,EACJ,MAAO,CAAE,GAAGD,EAAO,WAAYD,CAAO,EACtC,KAAMD,EACN,UAAWiB,EACT,iCACA,iBACAnB,CACF,CAEAQ,EAAAA,EAAA,cAACZ,EAAA,CAAS,GAAGoB,EAAiB,WAAYV,EAAY,KAAMJ,GACzDD,EAKAC,IAAS,cACRM,EAAA,cAACX,EAAA,CAAe,UAAW,CAACiB,GAAa,CAACR,CAAY,CAAA,CAE1D,CACF,CACF,CACF,CAEJ,EAEAR,EAAQ,MAAQsB,EAChBtB,EAAQ,UAAYuB,EACpBvB,EAAQ,UAAYwB,EACpBxB,EAAQ,OAASyB,EACjBzB,EAAQ,KAAO0B,EACf1B,EAAQ,OAAS2B,EAEjB3B,EAAQ,YAAc"}
@@ -1,9 +1,7 @@
1
1
  import * as React from 'react';
2
2
  export declare const SideBarContext: React.Context<{
3
3
  isExpanded?: boolean;
4
- shouldExpand: boolean;
5
4
  }>;
6
5
  export declare const useSidebarState: () => {
7
6
  isExpanded?: boolean;
8
- shouldExpand: boolean;
9
7
  };
@@ -1,2 +1,2 @@
1
- import*as e from"react";const t=e.createContext({isExpanded:void 0,shouldExpand:!1}),o=()=>e.useContext(t);export{t as SideBarContext,o as useSidebarState};
1
+ import*as e from"react";const t=e.createContext({isExpanded:void 0}),o=()=>e.useContext(t);export{t as SideBarContext,o as useSidebarState};
2
2
  //# sourceMappingURL=SideBarContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideBarContext.js","sources":["../../../src/components/side-bar/SideBarContext.tsx"],"sourcesContent":["import * as React from 'react'\n\nexport const SideBarContext = React.createContext<{\n isExpanded?: boolean\n shouldExpand: boolean\n}>({\n isExpanded: undefined,\n shouldExpand: false\n})\n\nexport const useSidebarState = () => React.useContext(SideBarContext)\n"],"names":["SideBarContext","React","useSidebarState"],"mappings":"wBAEO,MAAMA,EAAiBC,EAAM,cAGjC,CACD,WAAY,OACZ,aAAc,EAChB,CAAC,EAEYC,EAAkB,IAAMD,EAAM,WAAWD,CAAc"}
1
+ {"version":3,"file":"SideBarContext.js","sources":["../../../src/components/side-bar/SideBarContext.tsx"],"sourcesContent":["import * as React from 'react'\n\nexport const SideBarContext = React.createContext<{\n isExpanded?: boolean\n}>({\n isExpanded: undefined\n})\n\nexport const useSidebarState = () => React.useContext(SideBarContext)\n"],"names":["SideBarContext","React","useSidebarState"],"mappings":"wBAEa,MAAAA,EAAiBC,EAAM,cAEjC,CACD,WAAY,MACd,CAAC,EAEYC,EAAkB,IAAMD,EAAM,WAAWD,CAAc"}
@@ -1,2 +1,2 @@
1
- import*as e from"react";import{styled as r,Theme as m}from"../../styled.js";import{useWindowScrollPosition as p}from"../../utilities/hooks/useWindowScrollPosition.js";import{Divider as l}from"../divider/Divider.js";import{Flex as c}from"../flex/Flex.js";import{colorSchemes as b}from"./TopBar.colorscheme.config.js";import{TopBarActionIcon as f}from"./TopBarActionIcon.js";import{TopBarBrand as u,TopBarBrandLogo as h,TopBarBrandName as x}from"./TopBarBrand.js";const B=()=>e.createElement(l,{orientation:"vertical",className:"bg-divider h-6"}),g=r("div",{base:["bg-(--background)","sticky","flex","items-center","z-10","transition-shadow","duration-200","ease-out"],variants:{hasScrolled:{true:["shadow-[0px_4px_4px_-2px_rgba(31,31,31,0.1)]"]},size:{md:["h-16"],lg:["h-24"]},diffused:{true:["supports-color-mix:bg-[color-mix(in_hsl,(--base-1)_70%,transparent)]","supports-color-mix:backdrop-blur-sm"]},appearance:{standard:["w-screen","max-w-full","top-0","border-b","border-b-(--border-bottom)"],rounded:["w-full","top-2","p-2","border","border-white","rounded-full"]}}},{enabledResponsiveVariants:!0}),w=r(c,{base:["items-center","h-10","mx-4","w-full","md:mx-8"]}),o=({size:a="md",diffused:t,theme:i,appearance:s="standard",...d})=>{const{y:n}=p();return e.createElement(m,{theme:i||b.light},e.createElement(g,{hasScrolled:!!n,diffused:t,appearance:s,size:a},e.createElement(w,{...d})))},T=Object.assign(o,{Brand:u,BrandLogo:h,BrandName:x,ActionIcon:f,Divider:B});o.displayName="TopBar";export{T as TopBar};
1
+ import*as e from"react";import{styled as r,Theme as m}from"../../styled.js";import{useWindowScrollPosition as p}from"../../utilities/hooks/useWindowScrollPosition.js";import{Divider as l}from"../divider/Divider.js";import{Flex as c}from"../flex/Flex.js";import{colorSchemes as b}from"./TopBar.colorscheme.config.js";import{TopBarActionIcon as f}from"./TopBarActionIcon.js";import{TopBarBrand as u,TopBarBrandLogo as h,TopBarBrandName as x}from"./TopBarBrand.js";const B=()=>e.createElement(l,{orientation:"vertical",className:"bg-divider h-6"}),g=r("div",{base:["bg-(--background)","sticky","flex","items-center","z-15","transition-shadow","duration-200","ease-out"],variants:{hasScrolled:{true:["shadow-[0px_4px_4px_-2px_rgba(31,31,31,0.1)]"]},size:{md:["h-16"],lg:["h-24"]},diffused:{true:["supports-color-mix:bg-[color-mix(in_hsl,(--base-1)_70%,transparent)]","supports-color-mix:backdrop-blur-sm"]},appearance:{standard:["w-screen","max-w-full","top-0","border-b","border-b-(--border-bottom)"],rounded:["w-full","top-2","p-2","border","border-white","rounded-full"]}}},{enabledResponsiveVariants:!0}),w=r(c,{base:["items-center","h-10","mx-4","w-full","md:mx-8"]}),o=({size:a="md",diffused:t,theme:i,appearance:s="standard",...d})=>{const{y:n}=p();return e.createElement(m,{theme:i||b.light},e.createElement(g,{hasScrolled:!!n,diffused:t,appearance:s,size:a},e.createElement(w,{...d})))},T=Object.assign(o,{Brand:u,BrandLogo:h,BrandName:x,ActionIcon:f,Divider:B});o.displayName="TopBar";export{T as TopBar};
2
2
  //# sourceMappingURL=TopBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TopBar.js","sources":["../../../src/components/top-bar/TopBar.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled, Theme } from '~/styled'\nimport { useWindowScrollPosition } from '~/utilities/hooks/useWindowScrollPosition'\n\nimport { Divider } from '../divider'\nimport { Flex } from '../flex'\nimport { colorSchemes as topBarColorSchemes } from './TopBar.colorscheme.config'\nimport { TopBarActionIcon } from './TopBarActionIcon'\nimport { TopBarBrand, TopBarBrandLogo, TopBarBrandName } from './TopBarBrand'\n\nconst TopBarDivider = () => (\n <Divider orientation=\"vertical\" className=\"bg-divider h-6\" />\n)\n\nconst StyledRoot = styled(\n 'div',\n {\n base: [\n 'bg-(--background)',\n 'sticky',\n 'flex',\n 'items-center',\n 'z-10',\n 'transition-shadow',\n 'duration-200',\n 'ease-out'\n ],\n variants: {\n hasScrolled: {\n true: ['shadow-[0px_4px_4px_-2px_rgba(31,31,31,0.1)]']\n },\n size: {\n md: ['h-16'],\n lg: ['h-24']\n },\n diffused: {\n true: [\n 'supports-color-mix:bg-[color-mix(in_hsl,(--base-1)_70%,transparent)]',\n 'supports-color-mix:backdrop-blur-sm'\n ]\n },\n appearance: {\n standard: [\n 'w-screen',\n 'max-w-full',\n 'top-0',\n 'border-b',\n 'border-b-(--border-bottom)'\n ],\n rounded: [\n 'w-full',\n 'top-2',\n 'p-2',\n 'border',\n 'border-white',\n 'rounded-full'\n ]\n }\n }\n },\n {\n enabledResponsiveVariants: true\n }\n)\n\nconst Container = styled(Flex, {\n base: ['items-center', 'h-10', 'mx-4', 'w-full', 'md:mx-8']\n})\n\ntype StyledRootProps = React.ComponentProps<typeof StyledRoot>\n\ntype TopBarProps = StyledRootProps & React.ComponentProps<typeof Theme>\n\nconst TopBarComponent = ({\n size = 'md',\n diffused,\n theme,\n appearance = 'standard',\n ...props\n}: React.PropsWithChildren<TopBarProps>) => {\n const { y: scrollPositionY } = useWindowScrollPosition()\n\n return (\n <Theme theme={theme || topBarColorSchemes['light']}>\n <StyledRoot\n hasScrolled={!!scrollPositionY}\n diffused={diffused}\n appearance={appearance}\n size={size}\n >\n <Container {...props} />\n </StyledRoot>\n </Theme>\n )\n}\n\nexport const TopBar = Object.assign(TopBarComponent, {\n Brand: TopBarBrand,\n BrandLogo: TopBarBrandLogo,\n BrandName: TopBarBrandName,\n ActionIcon: TopBarActionIcon,\n Divider: TopBarDivider\n})\n\nTopBarComponent.displayName = 'TopBar'\n"],"names":["TopBarDivider","React","Divider","StyledRoot","styled","Container","Flex","TopBarComponent","size","diffused","theme","appearance","props","scrollPositionY","useWindowScrollPosition","Theme","topBarColorSchemes","TopBar","TopBarBrand","TopBarBrandLogo","TopBarBrandName","TopBarActionIcon"],"mappings":"8cAWA,MAAMA,EAAgB,IACpBC,EAAA,cAACC,EAAA,CAAQ,YAAY,WAAW,UAAU,gBAAA,CAAiB,EAGvDC,EAAaC,EACjB,MACA,CACE,KAAM,CACJ,oBACA,SACA,OACA,eACA,OACA,oBACA,eACA,UACF,EACA,SAAU,CACR,YAAa,CACX,KAAM,CAAC,8CAA8C,CACvD,EACA,KAAM,CACJ,GAAI,CAAC,MAAM,EACX,GAAI,CAAC,MAAM,CACb,EACA,SAAU,CACR,KAAM,CACJ,uEACA,qCACF,CACF,EACA,WAAY,CACV,SAAU,CACR,WACA,aACA,QACA,WACA,4BACF,EACA,QAAS,CACP,SACA,QACA,MACA,SACA,eACA,cACF,CACF,CACF,CACF,EACA,CACE,0BAA2B,EAC7B,CACF,EAEMC,EAAYD,EAAOE,EAAM,CAC7B,KAAM,CAAC,eAAgB,OAAQ,OAAQ,SAAU,SAAS,CAC5D,CAAC,EAMKC,EAAkB,CAAC,CACvB,KAAAC,EAAO,KACP,SAAAC,EACA,MAAAC,EACA,WAAAC,EAAa,WACb,GAAGC,CACL,IAA4C,CAC1C,KAAM,CAAE,EAAGC,CAAgB,EAAIC,EAE/B,EAAA,OACEb,EAAA,cAACc,EAAA,CAAM,MAAOL,GAASM,EAAmB,KACxCf,EAAAA,EAAA,cAACE,EAAA,CACC,YAAa,CAAC,CAACU,EACf,SAAUJ,EACV,WAAYE,EACZ,KAAMH,CAAAA,EAENP,EAAA,cAACI,EAAA,CAAW,GAAGO,CAAO,CAAA,CACxB,CACF,CAEJ,EAEaK,EAAS,OAAO,OAAOV,EAAiB,CACnD,MAAOW,EACP,UAAWC,EACX,UAAWC,EACX,WAAYC,EACZ,QAASrB,CACX,CAAC,EAEDO,EAAgB,YAAc"}
1
+ {"version":3,"file":"TopBar.js","sources":["../../../src/components/top-bar/TopBar.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled, Theme } from '~/styled'\nimport { useWindowScrollPosition } from '~/utilities/hooks/useWindowScrollPosition'\n\nimport { Divider } from '../divider'\nimport { Flex } from '../flex'\nimport { colorSchemes as topBarColorSchemes } from './TopBar.colorscheme.config'\nimport { TopBarActionIcon } from './TopBarActionIcon'\nimport { TopBarBrand, TopBarBrandLogo, TopBarBrandName } from './TopBarBrand'\n\nconst TopBarDivider = () => (\n <Divider orientation=\"vertical\" className=\"bg-divider h-6\" />\n)\n\nconst StyledRoot = styled(\n 'div',\n {\n base: [\n 'bg-(--background)',\n 'sticky',\n 'flex',\n 'items-center',\n 'z-15',\n 'transition-shadow',\n 'duration-200',\n 'ease-out'\n ],\n variants: {\n hasScrolled: {\n true: ['shadow-[0px_4px_4px_-2px_rgba(31,31,31,0.1)]']\n },\n size: {\n md: ['h-16'],\n lg: ['h-24']\n },\n diffused: {\n true: [\n 'supports-color-mix:bg-[color-mix(in_hsl,(--base-1)_70%,transparent)]',\n 'supports-color-mix:backdrop-blur-sm'\n ]\n },\n appearance: {\n standard: [\n 'w-screen',\n 'max-w-full',\n 'top-0',\n 'border-b',\n 'border-b-(--border-bottom)'\n ],\n rounded: [\n 'w-full',\n 'top-2',\n 'p-2',\n 'border',\n 'border-white',\n 'rounded-full'\n ]\n }\n }\n },\n {\n enabledResponsiveVariants: true\n }\n)\n\nconst Container = styled(Flex, {\n base: ['items-center', 'h-10', 'mx-4', 'w-full', 'md:mx-8']\n})\n\ntype StyledRootProps = React.ComponentProps<typeof StyledRoot>\n\ntype TopBarProps = StyledRootProps & React.ComponentProps<typeof Theme>\n\nconst TopBarComponent = ({\n size = 'md',\n diffused,\n theme,\n appearance = 'standard',\n ...props\n}: React.PropsWithChildren<TopBarProps>) => {\n const { y: scrollPositionY } = useWindowScrollPosition()\n\n return (\n <Theme theme={theme || topBarColorSchemes['light']}>\n <StyledRoot\n hasScrolled={!!scrollPositionY}\n diffused={diffused}\n appearance={appearance}\n size={size}\n >\n <Container {...props} />\n </StyledRoot>\n </Theme>\n )\n}\n\nexport const TopBar = Object.assign(TopBarComponent, {\n Brand: TopBarBrand,\n BrandLogo: TopBarBrandLogo,\n BrandName: TopBarBrandName,\n ActionIcon: TopBarActionIcon,\n Divider: TopBarDivider\n})\n\nTopBarComponent.displayName = 'TopBar'\n"],"names":["TopBarDivider","React","Divider","StyledRoot","styled","Container","Flex","TopBarComponent","size","diffused","theme","appearance","props","scrollPositionY","useWindowScrollPosition","Theme","topBarColorSchemes","TopBar","TopBarBrand","TopBarBrandLogo","TopBarBrandName","TopBarActionIcon"],"mappings":"8cAWA,MAAMA,EAAgB,IACpBC,EAAA,cAACC,EAAA,CAAQ,YAAY,WAAW,UAAU,gBAAA,CAAiB,EAGvDC,EAAaC,EACjB,MACA,CACE,KAAM,CACJ,oBACA,SACA,OACA,eACA,OACA,oBACA,eACA,UACF,EACA,SAAU,CACR,YAAa,CACX,KAAM,CAAC,8CAA8C,CACvD,EACA,KAAM,CACJ,GAAI,CAAC,MAAM,EACX,GAAI,CAAC,MAAM,CACb,EACA,SAAU,CACR,KAAM,CACJ,uEACA,qCACF,CACF,EACA,WAAY,CACV,SAAU,CACR,WACA,aACA,QACA,WACA,4BACF,EACA,QAAS,CACP,SACA,QACA,MACA,SACA,eACA,cACF,CACF,CACF,CACF,EACA,CACE,0BAA2B,EAC7B,CACF,EAEMC,EAAYD,EAAOE,EAAM,CAC7B,KAAM,CAAC,eAAgB,OAAQ,OAAQ,SAAU,SAAS,CAC5D,CAAC,EAMKC,EAAkB,CAAC,CACvB,KAAAC,EAAO,KACP,SAAAC,EACA,MAAAC,EACA,WAAAC,EAAa,WACb,GAAGC,CACL,IAA4C,CAC1C,KAAM,CAAE,EAAGC,CAAgB,EAAIC,EAE/B,EAAA,OACEb,EAAA,cAACc,EAAA,CAAM,MAAOL,GAASM,EAAmB,KACxCf,EAAAA,EAAA,cAACE,EAAA,CACC,YAAa,CAAC,CAACU,EACf,SAAUJ,EACV,WAAYE,EACZ,KAAMH,CAAAA,EAENP,EAAA,cAACI,EAAA,CAAW,GAAGO,CAAO,CAAA,CACxB,CACF,CAEJ,EAEaK,EAAS,OAAO,OAAOV,EAAiB,CACnD,MAAOW,EACP,UAAWC,EACX,UAAWC,EACX,WAAYC,EACZ,QAASrB,CACX,CAAC,EAEDO,EAAgB,YAAc"}